@pod-os/elements 0.4.1-97844f2.0 → 0.5.1-1f12da7.0

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 (26) hide show
  1. package/dist/cjs/elements.cjs.js +1 -1
  2. package/dist/cjs/{ion-app_42.cjs.entry.js → ion-app_44.cjs.entry.js} +257 -31
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/collection/apps/pos-app-generic/pos-app-generic.js +1 -1
  5. package/dist/collection/apps/pos-app-rdf-document/pos-app-rdf-document.js +1 -1
  6. package/dist/collection/collection-manifest.json +1 -0
  7. package/dist/collection/components/pos-navigation-bar/pos-navigation-bar.js +1 -1
  8. package/dist/collection/components/pos-resource/pos-resource.js +3 -1
  9. package/dist/collection/components/pos-type-badges/pos-type-badges.css +24 -0
  10. package/dist/collection/components/pos-type-badges/pos-type-badges.js +67 -0
  11. package/dist/collection/components/pos-type-router/pos-type-router.js +1 -1
  12. package/dist/custom-elements/index.d.ts +6 -0
  13. package/dist/custom-elements/index.js +239 -31
  14. package/dist/elements/elements.esm.js +1 -1
  15. package/dist/elements/p-971bcc64.entry.js +67 -0
  16. package/dist/esm/elements.js +1 -1
  17. package/dist/esm/{ion-app_42.entry.js → ion-app_44.entry.js} +256 -32
  18. package/dist/esm/loader.js +1 -1
  19. package/dist/types/components/pos-type-badges/pos-type-badges.d.ts +13 -0
  20. package/dist/types/components/pos-type-router/pos-type-router.d.ts +2 -2
  21. package/dist/types/components.d.ts +18 -0
  22. package/package.json +2 -2
  23. package/dist/cjs/ion-badge.cjs.entry.js +0 -29
  24. package/dist/elements/p-54211c52.entry.js +0 -1
  25. package/dist/elements/p-74916699.entry.js +0 -67
  26. package/dist/esm/ion-badge.entry.js +0 -25
@@ -0,0 +1,67 @@
1
+ import{r as t,h as e,H as n,a as i,c as r,f as o,d as s,w as a,e as c,i as u}from"./p-7e5300af.js";import{g as l,c as h,a as d}from"./p-cff82b6f.js";import{c as f,o as p,h as v}from"./p-cfc0e54d.js";import{h as g,i as m,c as w,r as b,d as y}from"./p-4f24d306.js";const x=class{constructor(e){t(this,e)}componentDidLoad(){E((async()=>{const t=d(window,"hybrid");h.getBoolean("_testing")||import("./p-99f8abed.js").then((t=>t.startTapClick(h))),h.getBoolean("statusTap",t)&&import("./p-f84987ee.js").then((t=>t.startStatusTap())),h.getBoolean("inputShims",k())&&import("./p-f0474f46.js").then((t=>t.startInputShims(h)));const e=await import("./p-03bda390.js");h.getBoolean("hardwareBackButton",t)?e.startHardwareBackButton():e.blockHardwareBackButton(),"undefined"!=typeof window&&import("./p-91fe653f.js").then((t=>t.startKeyboardAssist(window))),import("./p-aab0f63c.js").then((t=>t.startFocusVisible()))}))}render(){const t=l(this);return e(n,{class:{[t]:!0,"ion-page":!0,"force-statusbar-padding":h.getBoolean("_forceStatusbarPadding")}})}get el(){return i(this)}},k=()=>d(window,"ios")&&d(window,"mobile"),E=t=>{"requestIdleCallback"in window?window.requestIdleCallback(t):setTimeout(t,32)};x.style="html.plt-mobile ion-app{user-select:none}html.plt-mobile ion-app [contenteditable]{user-select:text}ion-app.force-statusbar-padding{--ion-safe-area-top:20px}";const S=class{constructor(e){t(this,e)}render(){const t=l(this);return e(n,{class:f(this.color,{[t]:!0})},e("slot",null))}};S.style={ios:":host{--background:var(--ion-color-primary, #3880ff);--color:var(--ion-color-primary-contrast, #fff);--padding-top:3px;--padding-end:8px;--padding-bottom:3px;--padding-start:8px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:inline-block;min-width:10px;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);font-size:13px;font-weight:bold;line-height:1;text-align:center;white-space:nowrap;contain:content;vertical-align:baseline}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}:host(.ion-color){background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(:empty){display:none}:host{border-radius:10px}",md:":host{--background:var(--ion-color-primary, #3880ff);--color:var(--ion-color-primary-contrast, #fff);--padding-top:3px;--padding-end:8px;--padding-bottom:3px;--padding-start:8px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:inline-block;min-width:10px;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);font-size:13px;font-weight:bold;line-height:1;text-align:center;white-space:nowrap;contain:content;vertical-align:baseline}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}:host(.ion-color){background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(:empty){display:none}:host{--padding-top:3px;--padding-end:4px;--padding-bottom:4px;--padding-start:4px;border-radius:4px}"};const F=class{constructor(e){t(this,e),this.ionFocus=r(this,"ionFocus",7),this.ionBlur=r(this,"ionBlur",7),this.inItem=!1,this.inListHeader=!1,this.inToolbar=!1,this.inheritedAttributes={},this.buttonType="button",this.disabled=!1,this.routerDirection="forward",this.strong=!1,this.type="button",this.handleClick=t=>{if("button"===this.type)p(this.href,t,this.routerDirection,this.routerAnimation);else if(g(this.el)){const e=this.el.closest("form");if(e){t.preventDefault();const n=document.createElement("button");n.type=this.type,n.style.display="none",e.appendChild(n),n.click(),n.remove()}}},this.onFocus=()=>{this.ionFocus.emit()},this.onBlur=()=>{this.ionBlur.emit()}}componentWillLoad(){this.inToolbar=!!this.el.closest("ion-buttons"),this.inListHeader=!!this.el.closest("ion-list-header"),this.inItem=!!this.el.closest("ion-item")||!!this.el.closest("ion-item-divider"),this.inheritedAttributes=m(this.el)}get hasIconOnly(){return!!this.el.querySelector('[slot="icon-only"]')}get rippleType(){return(void 0===this.fill||"clear"===this.fill)&&this.hasIconOnly&&this.inToolbar?"unbounded":"bounded"}render(){const t=l(this),{buttonType:i,type:r,disabled:o,rel:s,target:a,size:c,href:u,color:h,expand:d,hasIconOnly:p,shape:g,strong:m,inheritedAttributes:w}=this,b=void 0===c&&this.inItem?"small":c,y=void 0===u?"button":"a",x="button"===y?{type:r}:{download:this.download,href:u,rel:s,target:a};let k=this.fill;return void 0===k&&(k=this.inToolbar||this.inListHeader?"clear":"solid"),e(n,{onClick:this.handleClick,"aria-disabled":o?"true":null,class:f(h,{[t]:!0,[i]:!0,[`${i}-${d}`]:void 0!==d,[`${i}-${b}`]:void 0!==b,[`${i}-${g}`]:void 0!==g,[`${i}-${k}`]:!0,[`${i}-strong`]:m,"in-toolbar":v("ion-toolbar",this.el),"in-toolbar-color":v("ion-toolbar[color]",this.el),"button-has-icon-only":p,"button-disabled":o,"ion-activatable":!0,"ion-focusable":!0})},e(y,Object.assign({},x,{class:"button-native",part:"native",disabled:o,onFocus:this.onFocus,onBlur:this.onBlur},w),e("span",{class:"button-inner"},e("slot",{name:"icon-only"}),e("slot",{name:"start"}),e("slot",null),e("slot",{name:"end"})),"md"===t&&e("ion-ripple-effect",{type:this.rippleType})))}get el(){return i(this)}};F.style={ios:':host{--overflow:hidden;--ripple-color:currentColor;--border-width:initial;--border-color:initial;--border-style:initial;--color-activated:var(--color);--color-focused:var(--color);--color-hover:var(--color);--box-shadow:none;display:inline-block;width:auto;color:var(--color);font-family:var(--ion-font-family, inherit);text-align:center;text-decoration:none;text-overflow:ellipsis;white-space:nowrap;user-select:none;vertical-align:top;vertical-align:-webkit-baseline-middle;font-kerning:none}:host(.button-disabled){cursor:default;opacity:0.5;pointer-events:none}:host(.button-solid){--background:var(--ion-color-primary, #3880ff);--color:var(--ion-color-primary-contrast, #fff)}:host(.button-outline){--border-color:var(--ion-color-primary, #3880ff);--background:transparent;--color:var(--ion-color-primary, #3880ff)}:host(.button-clear){--border-width:0;--background:transparent;--color:var(--ion-color-primary, #3880ff)}:host(.button-block){display:block}:host(.button-block) .button-native{margin-left:0;margin-right:0;display:block;width:100%;clear:both;contain:content}:host(.button-block) .button-native::after{clear:both}:host(.button-full){display:block}:host(.button-full) .button-native{margin-left:0;margin-right:0;display:block;width:100%;contain:content}:host(.button-full:not(.button-round)) .button-native{border-radius:0;border-right-width:0;border-left-width:0}.button-native{border-radius:var(--border-radius);-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:block;position:relative;width:100%;height:100%;transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:var(--background);line-height:1;box-shadow:var(--box-shadow);contain:layout style;cursor:pointer;opacity:var(--opacity);overflow:var(--overflow);z-index:0;box-sizing:border-box;appearance:none}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.button-native{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.button-native::-moz-focus-inner{border:0}.button-inner{display:flex;position:relative;flex-flow:row nowrap;flex-shrink:0;align-items:center;justify-content:center;width:100%;height:100%;z-index:1}::slotted(ion-icon){font-size:1.4em;pointer-events:none}::slotted(ion-icon[slot=start]){margin-left:-0.3em;margin-right:0.3em;margin-top:0;margin-bottom:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-icon[slot=start]){margin-left:unset;margin-right:unset;-webkit-margin-start:-0.3em;margin-inline-start:-0.3em;-webkit-margin-end:0.3em;margin-inline-end:0.3em}}::slotted(ion-icon[slot=end]){margin-left:0.3em;margin-right:-0.2em;margin-top:0;margin-bottom:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-icon[slot=end]){margin-left:unset;margin-right:unset;-webkit-margin-start:0.3em;margin-inline-start:0.3em;-webkit-margin-end:-0.2em;margin-inline-end:-0.2em}}::slotted(ion-icon[slot=icon-only]){font-size:1.8em}ion-ripple-effect{color:var(--ripple-color)}.button-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0}:host(.ion-activated){color:var(--color-activated)}:host(.ion-activated) .button-native::after{background:var(--background-activated);opacity:var(--background-activated-opacity)}:host(.ion-focused){color:var(--color-focused)}:host(.ion-focused) .button-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}@media (any-hover: hover){:host(:hover){color:var(--color-hover)}:host(:hover) .button-native::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}}:host(.button-solid.ion-color) .button-native{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.button-outline.ion-color) .button-native{border-color:var(--ion-color-base);background:transparent;color:var(--ion-color-base)}:host(.button-clear.ion-color) .button-native{background:transparent;color:var(--ion-color-base)}:host(.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native{color:var(--ion-toolbar-color, var(--color))}:host(.button-outline.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native{border-color:var(--ion-toolbar-color, var(--color, var(--border-color)))}:host(.button-solid.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native{background:var(--ion-toolbar-color, var(--background));color:var(--ion-toolbar-background, var(--color))}:host{--border-radius:10px;--padding-top:0;--padding-bottom:0;--padding-start:1em;--padding-end:1em;--transition:background-color, opacity 100ms linear;margin-left:2px;margin-right:2px;margin-top:4px;margin-bottom:4px;height:2.8em;font-size:16px;font-weight:500;letter-spacing:-0.03em}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{margin-left:unset;margin-right:unset;-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:2px;margin-inline-end:2px}}:host(.button-solid){--background-activated:var(--ion-color-primary-shade, #3171e0);--background-focused:var(--ion-color-primary-shade, #3171e0);--background-hover:var(--ion-color-primary-tint, #4c8dff);--background-activated-opacity:1;--background-focused-opacity:1;--background-hover-opacity:1}:host(.button-outline){--border-radius:10px;--border-width:1px;--border-style:solid;--background-activated:var(--ion-color-primary, #3880ff);--background-focused:var(--ion-color-primary, #3880ff);--background-hover:transparent;--background-focused-opacity:.1;--color-activated:var(--ion-color-primary-contrast, #fff)}:host(.button-clear){--background-activated:transparent;--background-focused:var(--ion-color-primary, #3880ff);--background-hover:transparent;--background-focused-opacity:.1;font-size:17px;font-weight:normal;letter-spacing:0}:host(.button-large){--border-radius:12px;--padding-top:0;--padding-start:1em;--padding-end:1em;--padding-bottom:0;height:2.8em;font-size:20px}:host(.button-small){--border-radius:6px;--padding-top:0;--padding-start:0.9em;--padding-end:0.9em;--padding-bottom:0;height:2.1em;font-size:13px}:host(.button-round){--border-radius:64px;--padding-top:0;--padding-start:26px;--padding-end:26px;--padding-bottom:0}:host(.button-strong){font-weight:600}:host(.button-clear.ion-activated){opacity:0.4}:host(.button-outline.ion-activated.ion-color) .button-native{color:var(--ion-color-contrast)}:host(.button-outline.ion-activated.ion-color) .button-native::after{background:var(--ion-color-base)}:host(.button-solid.ion-color.ion-activated) .button-native::after{background:var(--ion-color-shade)}:host(.button-outline.ion-focused.ion-color) .button-native,:host(.button-clear.ion-focused.ion-color) .button-native{color:var(--ion-color-base)}:host(.button-outline.ion-focused.ion-color) .button-native::after,:host(.button-clear.ion-focused.ion-color) .button-native::after{background:var(--ion-color-base)}:host(.button-solid.ion-color.ion-focused) .button-native::after{background:var(--ion-color-shade)}@media (any-hover: hover){:host(.button-clear:hover),:host(.button-outline:hover){opacity:0.6}:host(.button-clear.ion-color:hover) .button-native,:host(.button-outline.ion-color:hover) .button-native{color:var(--ion-color-base)}:host(.button-clear.ion-color:hover) .button-native::after,:host(.button-outline.ion-color:hover) .button-native::after{background:transparent}:host(.button-solid.ion-color:hover) .button-native::after{background:var(--ion-color-tint)}:host(:hover.button-solid.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native::after{background:#fff;opacity:0.1}}',md:':host{--overflow:hidden;--ripple-color:currentColor;--border-width:initial;--border-color:initial;--border-style:initial;--color-activated:var(--color);--color-focused:var(--color);--color-hover:var(--color);--box-shadow:none;display:inline-block;width:auto;color:var(--color);font-family:var(--ion-font-family, inherit);text-align:center;text-decoration:none;text-overflow:ellipsis;white-space:nowrap;user-select:none;vertical-align:top;vertical-align:-webkit-baseline-middle;font-kerning:none}:host(.button-disabled){cursor:default;opacity:0.5;pointer-events:none}:host(.button-solid){--background:var(--ion-color-primary, #3880ff);--color:var(--ion-color-primary-contrast, #fff)}:host(.button-outline){--border-color:var(--ion-color-primary, #3880ff);--background:transparent;--color:var(--ion-color-primary, #3880ff)}:host(.button-clear){--border-width:0;--background:transparent;--color:var(--ion-color-primary, #3880ff)}:host(.button-block){display:block}:host(.button-block) .button-native{margin-left:0;margin-right:0;display:block;width:100%;clear:both;contain:content}:host(.button-block) .button-native::after{clear:both}:host(.button-full){display:block}:host(.button-full) .button-native{margin-left:0;margin-right:0;display:block;width:100%;contain:content}:host(.button-full:not(.button-round)) .button-native{border-radius:0;border-right-width:0;border-left-width:0}.button-native{border-radius:var(--border-radius);-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:block;position:relative;width:100%;height:100%;transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:var(--background);line-height:1;box-shadow:var(--box-shadow);contain:layout style;cursor:pointer;opacity:var(--opacity);overflow:var(--overflow);z-index:0;box-sizing:border-box;appearance:none}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.button-native{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.button-native::-moz-focus-inner{border:0}.button-inner{display:flex;position:relative;flex-flow:row nowrap;flex-shrink:0;align-items:center;justify-content:center;width:100%;height:100%;z-index:1}::slotted(ion-icon){font-size:1.4em;pointer-events:none}::slotted(ion-icon[slot=start]){margin-left:-0.3em;margin-right:0.3em;margin-top:0;margin-bottom:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-icon[slot=start]){margin-left:unset;margin-right:unset;-webkit-margin-start:-0.3em;margin-inline-start:-0.3em;-webkit-margin-end:0.3em;margin-inline-end:0.3em}}::slotted(ion-icon[slot=end]){margin-left:0.3em;margin-right:-0.2em;margin-top:0;margin-bottom:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-icon[slot=end]){margin-left:unset;margin-right:unset;-webkit-margin-start:0.3em;margin-inline-start:0.3em;-webkit-margin-end:-0.2em;margin-inline-end:-0.2em}}::slotted(ion-icon[slot=icon-only]){font-size:1.8em}ion-ripple-effect{color:var(--ripple-color)}.button-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0}:host(.ion-activated){color:var(--color-activated)}:host(.ion-activated) .button-native::after{background:var(--background-activated);opacity:var(--background-activated-opacity)}:host(.ion-focused){color:var(--color-focused)}:host(.ion-focused) .button-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}@media (any-hover: hover){:host(:hover){color:var(--color-hover)}:host(:hover) .button-native::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}}:host(.button-solid.ion-color) .button-native{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.button-outline.ion-color) .button-native{border-color:var(--ion-color-base);background:transparent;color:var(--ion-color-base)}:host(.button-clear.ion-color) .button-native{background:transparent;color:var(--ion-color-base)}:host(.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native{color:var(--ion-toolbar-color, var(--color))}:host(.button-outline.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native{border-color:var(--ion-toolbar-color, var(--color, var(--border-color)))}:host(.button-solid.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native{background:var(--ion-toolbar-color, var(--background));color:var(--ion-toolbar-background, var(--color))}:host{--border-radius:4px;--padding-top:0;--padding-bottom:0;--padding-start:1.1em;--padding-end:1.1em;--transition:box-shadow 280ms cubic-bezier(.4, 0, .2, 1),\n background-color 15ms linear,\n color 15ms linear;margin-left:2px;margin-right:2px;margin-top:4px;margin-bottom:4px;height:36px;font-size:14px;font-weight:500;letter-spacing:0.06em;text-transform:uppercase}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{margin-left:unset;margin-right:unset;-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:2px;margin-inline-end:2px}}:host(.button-solid){--background-activated:transparent;--background-hover:var(--ion-color-primary-contrast, #fff);--background-focused:var(--ion-color-primary-contrast, #fff);--background-activated-opacity:0;--background-focused-opacity:.24;--background-hover-opacity:.08;--box-shadow:0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12)}:host(.button-solid.ion-activated){--box-shadow:0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12)}:host(.button-outline){--border-width:2px;--border-style:solid;--box-shadow:none;--background-activated:transparent;--background-focused:var(--ion-color-primary, #3880ff);--background-hover:var(--ion-color-primary, #3880ff);--background-activated-opacity:0;--background-focused-opacity:.12;--background-hover-opacity:.04}:host(.button-outline.ion-activated.ion-color) .button-native{background:transparent}:host(.button-clear){--background-activated:transparent;--background-focused:var(--ion-color-primary, #3880ff);--background-hover:var(--ion-color-primary, #3880ff);--background-activated-opacity:0;--background-focused-opacity:.12;--background-hover-opacity:.04}:host(.button-round){--border-radius:64px;--padding-top:0;--padding-start:26px;--padding-end:26px;--padding-bottom:0}:host(.button-large){--padding-top:0;--padding-start:1em;--padding-end:1em;--padding-bottom:0;height:2.8em;font-size:20px}:host(.button-small){--padding-top:0;--padding-start:0.9em;--padding-end:0.9em;--padding-bottom:0;height:2.1em;font-size:13px}:host(.button-strong){font-weight:bold}::slotted(ion-icon[slot=icon-only]){padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}:host(.button-solid.ion-color.ion-focused) .button-native::after{background:var(--ion-color-contrast)}:host(.button-clear.ion-color.ion-focused) .button-native::after,:host(.button-outline.ion-color.ion-focused) .button-native::after{background:var(--ion-color-base)}@media (any-hover: hover){:host(.button-solid.ion-color:hover) .button-native::after{background:var(--ion-color-contrast)}:host(.button-clear.ion-color:hover) .button-native::after,:host(.button-outline.ion-color:hover) .button-native::after{background:var(--ion-color-base)}}'};const A=class{constructor(e){t(this,e),this.button=!1,this.type="button",this.disabled=!1,this.routerDirection="forward"}isClickable(){return void 0!==this.href||this.button}renderCard(t){const n=this.isClickable();if(!n)return[e("slot",null)];const{href:i,routerAnimation:r,routerDirection:o}=this,s=n?void 0===i?"button":"a":"div";return e(s,Object.assign({},"button"===s?{type:this.type}:{download:this.download,href:this.href,rel:this.rel,target:this.target},{class:"card-native",part:"native",disabled:this.disabled,onClick:t=>p(i,t,o,r)}),e("slot",null),n&&"md"===t&&e("ion-ripple-effect",null))}render(){const t=l(this);return e(n,{class:f(this.color,{[t]:!0,"card-disabled":this.disabled,"ion-activatable":this.isClickable()})},this.renderCard(t))}};A.style={ios:":host{--ion-safe-area-left:0px;--ion-safe-area-right:0px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:block;position:relative;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);overflow:hidden}:host(.ion-color){background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.card-disabled){cursor:default;opacity:0.3;pointer-events:none}.card-native{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;width:100%;min-height:var(--min-height);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:inherit}.card-native::-moz-focus-inner{border:0}button,a{cursor:pointer;user-select:none;-webkit-user-drag:none}ion-ripple-effect{color:var(--ripple-color)}:host{--background:var(--ion-card-background, var(--ion-item-background, var(--ion-background-color, #fff)));--color:var(--ion-card-color, var(--ion-item-color, var(--ion-color-step-600, #666666)));margin-left:16px;margin-right:16px;margin-top:24px;margin-bottom:24px;border-radius:8px;transform:translateZ(0);transition:transform 500ms cubic-bezier(0.12, 0.72, 0.29, 1);font-size:14px;box-shadow:0 4px 16px rgba(0, 0, 0, 0.12)}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{margin-left:unset;margin-right:unset;-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:16px;margin-inline-end:16px}}:host(.ion-activated){transform:scale3d(0.97, 0.97, 1)}",md:":host{--ion-safe-area-left:0px;--ion-safe-area-right:0px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:block;position:relative;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);overflow:hidden}:host(.ion-color){background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.card-disabled){cursor:default;opacity:0.3;pointer-events:none}.card-native{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;width:100%;min-height:var(--min-height);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:inherit}.card-native::-moz-focus-inner{border:0}button,a{cursor:pointer;user-select:none;-webkit-user-drag:none}ion-ripple-effect{color:var(--ripple-color)}:host{--background:var(--ion-card-background, var(--ion-item-background, var(--ion-background-color, #fff)));--color:var(--ion-card-color, var(--ion-item-color, var(--ion-color-step-550, #737373)));margin-left:10px;margin-right:10px;margin-top:10px;margin-bottom:10px;border-radius:4px;font-size:14px;box-shadow:0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12)}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{margin-left:unset;margin-right:unset;-webkit-margin-start:10px;margin-inline-start:10px;-webkit-margin-end:10px;margin-inline-end:10px}}"};const _=class{constructor(e){t(this,e)}render(){const t=l(this);return e(n,{class:{[t]:!0,[`card-content-${t}`]:!0}})}};_.style={ios:"ion-card-content{display:block;position:relative}.card-content-ios{padding-left:20px;padding-right:20px;padding-top:20px;padding-bottom:20px;font-size:16px;line-height:1.4}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.card-content-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:20px;padding-inline-end:20px}}.card-content-ios h1{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:24px;font-weight:normal}.card-content-ios h2{margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:16px;font-weight:normal}.card-content-ios h3,.card-content-ios h4,.card-content-ios h5,.card-content-ios h6{margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:14px;font-weight:normal}.card-content-ios p{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:14px}ion-card-header+.card-content-ios{padding-top:0}",md:"ion-card-content{display:block;position:relative}.card-content-md{padding-left:16px;padding-right:16px;padding-top:13px;padding-bottom:13px;font-size:14px;line-height:1.5}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.card-content-md{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}.card-content-md h1{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:24px;font-weight:normal}.card-content-md h2{margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:16px;font-weight:normal}.card-content-md h3,.card-content-md h4,.card-content-md h5,.card-content-md h6{margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:14px;font-weight:normal}.card-content-md p{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:14px;font-weight:normal;line-height:1.5}ion-card-header+.card-content-md{padding-top:0}"};const j=class{constructor(e){t(this,e),this.translucent=!1}render(){const t=l(this);return e(n,{class:f(this.color,{"card-header-translucent":this.translucent,"ion-inherit-color":!0,[t]:!0})},e("slot",null))}};j.style={ios:":host{--background:transparent;--color:inherit;display:block;position:relative;background:var(--background);color:var(--color)}:host(.ion-color){background:var(--ion-color-base);color:var(--ion-color-contrast)}:host{padding-left:20px;padding-right:20px;padding-top:20px;padding-bottom:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:20px;padding-inline-end:20px}}@supports (backdrop-filter: blur(0)){:host(.card-header-translucent){background-color:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.9);backdrop-filter:saturate(180%) blur(30px)}}",md:":host{--background:transparent;--color:inherit;display:block;position:relative;background:var(--background);color:var(--color)}:host(.ion-color){background:var(--ion-color-base);color:var(--ion-color-contrast)}:host{padding-left:16px;padding-right:16px;padding-top:16px;padding-bottom:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}::slotted(ion-card-title:not(:first-child)),::slotted(ion-card-subtitle:not(:first-child)){margin-top:8px}"};const C=class{constructor(e){t(this,e)}render(){const t=l(this);return e(n,{role:"heading","aria-level":"2",class:f(this.color,{"ion-inherit-color":!0,[t]:!0})},e("slot",null))}};C.style={ios:":host{display:block;position:relative;color:var(--color)}:host(.ion-color){color:var(--ion-color-base)}:host{--color:var(--ion-text-color, #000);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;font-size:28px;font-weight:700;line-height:1.2}",md:":host{display:block;position:relative;color:var(--color)}:host(.ion-color){color:var(--ion-color-base)}:host{--color:var(--ion-color-step-850, #262626);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;font-size:20px;font-weight:500;line-height:1.2}"};const R={xs:"(min-width: 0px)",sm:"(min-width: 576px)",md:"(min-width: 768px)",lg:"(min-width: 992px)",xl:"(min-width: 1200px)"},I=t=>void 0===t||""===t||!!window.matchMedia&&window.matchMedia(R[t]).matches,T=window,O=!!(T.CSS&&T.CSS.supports&&T.CSS.supports("--a: 0")),N=["","xs","sm","md","lg","xl"],P=class{constructor(e){t(this,e)}onResize(){o(this)}getColumns(t){let e;for(const n of N){const i=I(n),r=this[t+n.charAt(0).toUpperCase()+n.slice(1)];i&&void 0!==r&&(e=r)}return e}calculateSize(){const t=this.getColumns("size");if(!t||""===t)return;const e="auto"===t?"auto":O?`calc(calc(${t} / var(--ion-grid-columns, 12)) * 100%)`:t/12*100+"%";return{flex:`0 0 ${e}`,width:`${e}`,"max-width":`${e}`}}calculatePosition(t,e){const n=this.getColumns(t);if(n)return{[e]:O?`calc(calc(${n} / var(--ion-grid-columns, 12)) * 100%)`:n>0&&n<12?n/12*100+"%":"auto"}}calculateOffset(t){return this.calculatePosition("offset",t?"margin-right":"margin-left")}calculatePull(t){return this.calculatePosition("pull",t?"left":"right")}calculatePush(t){return this.calculatePosition("push",t?"right":"left")}render(){const t="rtl"===document.dir,i=l(this);return e(n,{class:{[i]:!0},style:Object.assign(Object.assign(Object.assign(Object.assign({},this.calculateOffset(t)),this.calculatePull(t)),this.calculatePush(t)),this.calculateSize())},e("slot",null))}};P.style=":host{padding-left:var(--ion-grid-column-padding-xs, var(--ion-grid-column-padding, 5px));padding-right:var(--ion-grid-column-padding-xs, var(--ion-grid-column-padding, 5px));padding-top:var(--ion-grid-column-padding-xs, var(--ion-grid-column-padding, 5px));padding-bottom:var(--ion-grid-column-padding-xs, var(--ion-grid-column-padding, 5px));margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;box-sizing:border-box;position:relative;flex-basis:0;flex-grow:1;width:100%;max-width:100%;min-height:1px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-column-padding-xs, var(--ion-grid-column-padding, 5px));padding-inline-start:var(--ion-grid-column-padding-xs, var(--ion-grid-column-padding, 5px));-webkit-padding-end:var(--ion-grid-column-padding-xs, var(--ion-grid-column-padding, 5px));padding-inline-end:var(--ion-grid-column-padding-xs, var(--ion-grid-column-padding, 5px))}}@media (min-width: 576px){:host{padding-left:var(--ion-grid-column-padding-sm, var(--ion-grid-column-padding, 5px));padding-right:var(--ion-grid-column-padding-sm, var(--ion-grid-column-padding, 5px));padding-top:var(--ion-grid-column-padding-sm, var(--ion-grid-column-padding, 5px));padding-bottom:var(--ion-grid-column-padding-sm, var(--ion-grid-column-padding, 5px))}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-column-padding-sm, var(--ion-grid-column-padding, 5px));padding-inline-start:var(--ion-grid-column-padding-sm, var(--ion-grid-column-padding, 5px));-webkit-padding-end:var(--ion-grid-column-padding-sm, var(--ion-grid-column-padding, 5px));padding-inline-end:var(--ion-grid-column-padding-sm, var(--ion-grid-column-padding, 5px))}}}@media (min-width: 768px){:host{padding-left:var(--ion-grid-column-padding-md, var(--ion-grid-column-padding, 5px));padding-right:var(--ion-grid-column-padding-md, var(--ion-grid-column-padding, 5px));padding-top:var(--ion-grid-column-padding-md, var(--ion-grid-column-padding, 5px));padding-bottom:var(--ion-grid-column-padding-md, var(--ion-grid-column-padding, 5px))}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-column-padding-md, var(--ion-grid-column-padding, 5px));padding-inline-start:var(--ion-grid-column-padding-md, var(--ion-grid-column-padding, 5px));-webkit-padding-end:var(--ion-grid-column-padding-md, var(--ion-grid-column-padding, 5px));padding-inline-end:var(--ion-grid-column-padding-md, var(--ion-grid-column-padding, 5px))}}}@media (min-width: 992px){:host{padding-left:var(--ion-grid-column-padding-lg, var(--ion-grid-column-padding, 5px));padding-right:var(--ion-grid-column-padding-lg, var(--ion-grid-column-padding, 5px));padding-top:var(--ion-grid-column-padding-lg, var(--ion-grid-column-padding, 5px));padding-bottom:var(--ion-grid-column-padding-lg, var(--ion-grid-column-padding, 5px))}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-column-padding-lg, var(--ion-grid-column-padding, 5px));padding-inline-start:var(--ion-grid-column-padding-lg, var(--ion-grid-column-padding, 5px));-webkit-padding-end:var(--ion-grid-column-padding-lg, var(--ion-grid-column-padding, 5px));padding-inline-end:var(--ion-grid-column-padding-lg, var(--ion-grid-column-padding, 5px))}}}@media (min-width: 1200px){:host{padding-left:var(--ion-grid-column-padding-xl, var(--ion-grid-column-padding, 5px));padding-right:var(--ion-grid-column-padding-xl, var(--ion-grid-column-padding, 5px));padding-top:var(--ion-grid-column-padding-xl, var(--ion-grid-column-padding, 5px));padding-bottom:var(--ion-grid-column-padding-xl, var(--ion-grid-column-padding, 5px))}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-column-padding-xl, var(--ion-grid-column-padding, 5px));padding-inline-start:var(--ion-grid-column-padding-xl, var(--ion-grid-column-padding, 5px));-webkit-padding-end:var(--ion-grid-column-padding-xl, var(--ion-grid-column-padding, 5px));padding-inline-end:var(--ion-grid-column-padding-xl, var(--ion-grid-column-padding, 5px))}}}";const D=class{constructor(e){t(this,e),this.ionScrollStart=r(this,"ionScrollStart",7),this.ionScroll=r(this,"ionScroll",7),this.ionScrollEnd=r(this,"ionScrollEnd",7),this.isScrolling=!1,this.lastScroll=0,this.queued=!1,this.cTop=-1,this.cBottom=-1,this.isMainContent=!0,this.detail={scrollTop:0,scrollLeft:0,type:"scroll",event:void 0,startX:0,startY:0,startTime:0,currentX:0,currentY:0,velocityX:0,velocityY:0,deltaX:0,deltaY:0,currentTime:0,data:void 0,isScrolling:!0},this.fullscreen=!1,this.scrollX=!1,this.scrollY=!0,this.scrollEvents=!1}connectedCallback(){this.isMainContent=null===this.el.closest("ion-menu, ion-popover, ion-modal")}disconnectedCallback(){this.onScrollEnd()}onAppLoad(){this.resize()}shouldForceOverscroll(){const{forceOverscroll:t}=this,e=l(this);return void 0===t?"ios"===e&&d("ios"):t}resize(){this.fullscreen?s((()=>this.readDimensions())):0===this.cTop&&0===this.cBottom||(this.cTop=this.cBottom=0,o(this))}readDimensions(){const t=M(this.el),e=Math.max(this.el.offsetTop,0),n=Math.max(t.offsetHeight-e-this.el.offsetHeight,0);(e!==this.cTop||n!==this.cBottom)&&(this.cTop=e,this.cBottom=n,o(this))}onScroll(t){const e=Date.now(),n=!this.isScrolling;this.lastScroll=e,n&&this.onScrollStart(),!this.queued&&this.scrollEvents&&(this.queued=!0,s((e=>{this.queued=!1,this.detail.event=t,U(this.detail,this.scrollEl,e,n),this.ionScroll.emit(this.detail)})))}getScrollElement(){return Promise.resolve(this.scrollEl)}scrollToTop(t=0){return this.scrollToPoint(void 0,0,t)}scrollToBottom(t=0){return this.scrollToPoint(void 0,this.scrollEl.scrollHeight-this.scrollEl.clientHeight,t)}scrollByPoint(t,e,n){return this.scrollToPoint(t+this.scrollEl.scrollLeft,e+this.scrollEl.scrollTop,n)}async scrollToPoint(t,e,n=0){const i=this.scrollEl;if(n<32)return null!=e&&(i.scrollTop=e),void(null!=t&&(i.scrollLeft=t));let r,o=0;const s=new Promise((t=>r=t)),a=i.scrollTop,c=i.scrollLeft,u=null!=e?e-a:0,l=null!=t?t-c:0,h=t=>{const e=Math.min(1,(t-o)/n)-1,s=Math.pow(e,3)+1;0!==u&&(i.scrollTop=Math.floor(s*u+a)),0!==l&&(i.scrollLeft=Math.floor(s*l+c)),s<1?requestAnimationFrame(h):r()};return requestAnimationFrame((t=>{o=t,h(t)})),s}onScrollStart(){this.isScrolling=!0,this.ionScrollStart.emit({isScrolling:!0}),this.watchDog&&clearInterval(this.watchDog),this.watchDog=setInterval((()=>{this.lastScroll<Date.now()-120&&this.onScrollEnd()}),100)}onScrollEnd(){clearInterval(this.watchDog),this.watchDog=null,this.isScrolling&&(this.isScrolling=!1,this.ionScrollEnd.emit({isScrolling:!1}))}render(){const{isMainContent:t,scrollX:i,scrollY:r}=this,o=l(this),s=this.shouldForceOverscroll(),a=t?"main":"div",c="ios"===o&&h.getBoolean("experimentalTransitionShadow",!0);return this.resize(),e(n,{class:f(this.color,{[o]:!0,"content-sizing":v("ion-popover",this.el),overscroll:s}),style:{"--offset-top":`${this.cTop}px`,"--offset-bottom":`${this.cBottom}px`}},e("div",{id:"background-content",part:"background"}),e(a,{class:{"inner-scroll":!0,"scroll-x":i,"scroll-y":r,overscroll:(i||r)&&s},ref:t=>this.scrollEl=t,onScroll:this.scrollEvents?t=>this.onScroll(t):void 0,part:"scroll"},e("slot",null)),c?e("div",{class:"transition-effect"},e("div",{class:"transition-cover"}),e("div",{class:"transition-shadow"})):null,e("slot",{name:"fixed"}))}get el(){return i(this)}},M=t=>{const e=t.closest("ion-tabs");if(e)return e;return t.closest("ion-app, ion-page, .ion-page, page-inner, .popover-content")||(t=>t.parentElement?t.parentElement:t.parentNode&&t.parentNode.host?t.parentNode.host:null)(t)},U=(t,e,n,i)=>{const r=t.currentX,o=t.currentY,s=e.scrollLeft,a=e.scrollTop,c=n-t.currentTime;if(i&&(t.startTime=n,t.startX=s,t.startY=a,t.velocityX=t.velocityY=0),t.currentTime=n,t.currentX=t.scrollLeft=s,t.currentY=t.scrollTop=a,t.deltaX=s-t.startX,t.deltaY=a-t.startY,c>0&&c<100){const e=(a-o)/c;t.velocityX=(s-r)/c*.7+.3*t.velocityX,t.velocityY=.7*e+.3*t.velocityY}};D.style=':host{--background:var(--ion-background-color, #fff);--color:var(--ion-text-color, #000);--padding-top:0px;--padding-bottom:0px;--padding-start:0px;--padding-end:0px;--keyboard-offset:0px;--offset-top:0px;--offset-bottom:0px;--overflow:auto;display:block;position:relative;flex:1;width:100%;height:100%;margin:0 !important;padding:0 !important;font-family:var(--ion-font-family, inherit);contain:size style}:host(.ion-color) .inner-scroll{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.outer-content){--background:var(--ion-color-step-50, #f2f2f2)}#background-content{left:0px;right:0px;top:calc(var(--offset-top) * -1);bottom:calc(var(--offset-bottom) * -1);position:absolute;background:var(--background)}.inner-scroll{left:0px;right:0px;top:calc(var(--offset-top) * -1);bottom:calc(var(--offset-bottom) * -1);padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:calc(var(--padding-top) + var(--offset-top));padding-bottom:calc(var(--padding-bottom) + var(--keyboard-offset) + var(--offset-bottom));position:absolute;color:var(--color);box-sizing:border-box;overflow:hidden}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.inner-scroll{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.scroll-y,.scroll-x{-webkit-overflow-scrolling:touch;z-index:0;will-change:scroll-position}.scroll-y{touch-action:pan-y;overflow-y:var(--overflow);overscroll-behavior-y:contain}.scroll-x{touch-action:pan-x;overflow-x:var(--overflow);overscroll-behavior-x:contain}.scroll-x.scroll-y{touch-action:auto}.overscroll::before,.overscroll::after{position:absolute;width:1px;height:1px;content:""}.overscroll::before{bottom:-1px}.overscroll::after{top:-1px}:host(.content-sizing){display:flex;flex-direction:column;min-height:0;contain:none}:host(.content-sizing) .inner-scroll{position:relative;top:0;bottom:0;margin-top:calc(var(--offset-top) * -1);margin-bottom:calc(var(--offset-bottom) * -1)}.transition-effect{display:none;position:absolute;left:-100%;width:100%;height:100vh;opacity:0;pointer-events:none}.transition-cover{position:absolute;right:0;width:100%;height:100%;background:black;opacity:0.1}.transition-shadow{display:block;position:absolute;right:0;width:10px;height:100%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAgCAYAAAAIXrg4AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MTE3MDgzRkQ5QTkyMTFFOUEwNzQ5MkJFREE1NUY2MjQiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MTE3MDgzRkU5QTkyMTFFOUEwNzQ5MkJFREE1NUY2MjQiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDoxMTcwODNGQjlBOTIxMUU5QTA3NDkyQkVEQTU1RjYyNCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDoxMTcwODNGQzlBOTIxMUU5QTA3NDkyQkVEQTU1RjYyNCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PmePEuQAAABNSURBVHjaYvz//z8DIxAwMDAwATGMhmFmPDQuOSZks0AMmoJBaQHjkPfB0Lfg/2gQjVow+HPy/yHvg9GiYjQfjMbBqAWjFgy/4hogwADYqwdzxy5BuwAAAABJRU5ErkJggg==);background-repeat:repeat-y;background-size:10px 16px}::slotted([slot=fixed]){position:absolute;transform:translateZ(0)}';const L=class{constructor(e){t(this,e),this.translucent=!1}render(){const t=l(this),i=this.translucent;return e(n,{role:"contentinfo",class:{[t]:!0,[`footer-${t}`]:!0,"footer-translucent":i,[`footer-translucent-${t}`]:i}},"ios"===t&&i&&e("div",{class:"footer-background"}),e("slot",null))}};L.style={ios:"ion-footer{display:block;position:relative;order:1;width:100%;z-index:10}ion-footer ion-toolbar:last-of-type{padding-bottom:var(--ion-safe-area-bottom, 0)}.footer-ios ion-toolbar:first-of-type{--border-width:0.55px 0 0}@supports (backdrop-filter: blur(0)){.footer-background{left:0;right:0;top:0;bottom:0;position:absolute;backdrop-filter:saturate(180%) blur(20px)}.footer-translucent-ios ion-toolbar{--opacity:.8}}.footer-ios.ion-no-border ion-toolbar:first-of-type{--border-width:0}",md:'ion-footer{display:block;position:relative;order:1;width:100%;z-index:10}ion-footer ion-toolbar:last-of-type{padding-bottom:var(--ion-safe-area-bottom, 0)}.footer-md::before{left:0;top:-2px;bottom:auto;background-position:left 0 top 0;position:absolute;width:100%;height:2px;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAHBAMAAADzDtBxAAAAD1BMVEUAAAAAAAAAAAAAAAAAAABPDueNAAAABXRSTlMUCS0gBIh/TXEAAAAaSURBVAjXYxCEAgY4UIICBmMogMsgFLtAAQCNSwXZKOdPxgAAAABJRU5ErkJggg==");background-repeat:repeat-x;content:""}[dir=rtl] .footer-md::before,:host-context([dir=rtl]) .footer-md::before{left:unset;right:unset;right:0}[dir=rtl] .footer-md::before,:host-context([dir=rtl]) .footer-md::before{background-position:right 0 top 0}.footer-md.ion-no-border::before{display:none}'};const B=class{constructor(e){t(this,e),this.fixed=!1}render(){const t=l(this);return e(n,{class:{[t]:!0,"grid-fixed":this.fixed}},e("slot",null))}};B.style=":host{padding-left:var(--ion-grid-padding-xs, var(--ion-grid-padding, 5px));padding-right:var(--ion-grid-padding-xs, var(--ion-grid-padding, 5px));padding-top:var(--ion-grid-padding-xs, var(--ion-grid-padding, 5px));padding-bottom:var(--ion-grid-padding-xs, var(--ion-grid-padding, 5px));margin-left:auto;margin-right:auto;display:block;flex:1}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-padding-xs, var(--ion-grid-padding, 5px));padding-inline-start:var(--ion-grid-padding-xs, var(--ion-grid-padding, 5px));-webkit-padding-end:var(--ion-grid-padding-xs, var(--ion-grid-padding, 5px));padding-inline-end:var(--ion-grid-padding-xs, var(--ion-grid-padding, 5px))}}@media (min-width: 576px){:host{padding-left:var(--ion-grid-padding-sm, var(--ion-grid-padding, 5px));padding-right:var(--ion-grid-padding-sm, var(--ion-grid-padding, 5px));padding-top:var(--ion-grid-padding-sm, var(--ion-grid-padding, 5px));padding-bottom:var(--ion-grid-padding-sm, var(--ion-grid-padding, 5px))}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-padding-sm, var(--ion-grid-padding, 5px));padding-inline-start:var(--ion-grid-padding-sm, var(--ion-grid-padding, 5px));-webkit-padding-end:var(--ion-grid-padding-sm, var(--ion-grid-padding, 5px));padding-inline-end:var(--ion-grid-padding-sm, var(--ion-grid-padding, 5px))}}}@media (min-width: 768px){:host{padding-left:var(--ion-grid-padding-md, var(--ion-grid-padding, 5px));padding-right:var(--ion-grid-padding-md, var(--ion-grid-padding, 5px));padding-top:var(--ion-grid-padding-md, var(--ion-grid-padding, 5px));padding-bottom:var(--ion-grid-padding-md, var(--ion-grid-padding, 5px))}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-padding-md, var(--ion-grid-padding, 5px));padding-inline-start:var(--ion-grid-padding-md, var(--ion-grid-padding, 5px));-webkit-padding-end:var(--ion-grid-padding-md, var(--ion-grid-padding, 5px));padding-inline-end:var(--ion-grid-padding-md, var(--ion-grid-padding, 5px))}}}@media (min-width: 992px){:host{padding-left:var(--ion-grid-padding-lg, var(--ion-grid-padding, 5px));padding-right:var(--ion-grid-padding-lg, var(--ion-grid-padding, 5px));padding-top:var(--ion-grid-padding-lg, var(--ion-grid-padding, 5px));padding-bottom:var(--ion-grid-padding-lg, var(--ion-grid-padding, 5px))}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-padding-lg, var(--ion-grid-padding, 5px));padding-inline-start:var(--ion-grid-padding-lg, var(--ion-grid-padding, 5px));-webkit-padding-end:var(--ion-grid-padding-lg, var(--ion-grid-padding, 5px));padding-inline-end:var(--ion-grid-padding-lg, var(--ion-grid-padding, 5px))}}}@media (min-width: 1200px){:host{padding-left:var(--ion-grid-padding-xl, var(--ion-grid-padding, 5px));padding-right:var(--ion-grid-padding-xl, var(--ion-grid-padding, 5px));padding-top:var(--ion-grid-padding-xl, var(--ion-grid-padding, 5px));padding-bottom:var(--ion-grid-padding-xl, var(--ion-grid-padding, 5px))}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-padding-xl, var(--ion-grid-padding, 5px));padding-inline-start:var(--ion-grid-padding-xl, var(--ion-grid-padding, 5px));-webkit-padding-end:var(--ion-grid-padding-xl, var(--ion-grid-padding, 5px));padding-inline-end:var(--ion-grid-padding-xl, var(--ion-grid-padding, 5px))}}}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}:host(.grid-fixed){width:var(--ion-grid-width-xs, var(--ion-grid-width, 100%));max-width:100%}@media (min-width: 576px){:host(.grid-fixed){width:var(--ion-grid-width-sm, var(--ion-grid-width, 540px))}}@media (min-width: 768px){:host(.grid-fixed){width:var(--ion-grid-width-md, var(--ion-grid-width, 720px))}}@media (min-width: 992px){:host(.grid-fixed){width:var(--ion-grid-width-lg, var(--ion-grid-width, 960px))}}@media (min-width: 1200px){:host(.grid-fixed){width:var(--ion-grid-width-xl, var(--ion-grid-width, 1140px))}}:host(.ion-no-padding){--ion-grid-column-padding:0;--ion-grid-column-padding-xs:0;--ion-grid-column-padding-sm:0;--ion-grid-column-padding-md:0;--ion-grid-column-padding-lg:0;--ion-grid-column-padding-xl:0}";const J=t=>{const e=document.querySelector(`${t}.ion-cloned-element`);if(null!==e)return e;const n=document.createElement(t);return n.classList.add("ion-cloned-element"),n.style.setProperty("display","none"),document.body.appendChild(n),n},$=t=>{if(!t)return;const e=t.querySelectorAll("ion-toolbar");return{el:t,toolbars:Array.from(e).map((t=>{const e=t.querySelector("ion-title");return{el:t,background:t.shadowRoot.querySelector(".toolbar-background"),ionTitleEl:e,innerTitleEl:e?e.shadowRoot.querySelector(".toolbar-title"):null,ionButtonsEl:Array.from(t.querySelectorAll("ion-buttons"))||[]}}))||[]}},H=(t,e)=>{void 0===e?t.background.style.removeProperty("--opacity"):t.background.style.setProperty("--opacity",e.toString())},z=(t,e=!0)=>{e?t.el.classList.remove("header-collapse-condense-inactive"):t.el.classList.add("header-collapse-condense-inactive")},K=class{constructor(e){t(this,e),this.collapsibleHeaderInitialized=!1,this.inheritedAttributes={},this.translucent=!1}componentWillLoad(){this.inheritedAttributes=m(this.el)}async componentDidLoad(){await this.checkCollapsibleHeader()}async componentDidUpdate(){await this.checkCollapsibleHeader()}disconnectedCallback(){this.destroyCollapsibleHeader()}async checkCollapsibleHeader(){const t="condense"===this.collapse,e=!(!t||"ios"!==l(this))&&t;if(!e&&this.collapsibleHeaderInitialized)this.destroyCollapsibleHeader();else if(e&&!this.collapsibleHeaderInitialized){const t=this.el.closest("ion-app,ion-page,.ion-page,page-inner"),e=t?t.querySelector("ion-content"):null;a((()=>{J("ion-title").size="large",J("ion-back-button")})),await this.setupCollapsibleHeader(e,t)}}destroyCollapsibleHeader(){this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=void 0),this.scrollEl&&this.contentScrollCallback&&(this.scrollEl.removeEventListener("scroll",this.contentScrollCallback),this.contentScrollCallback=void 0),this.collapsibleMainHeader&&(this.collapsibleMainHeader.classList.remove("header-collapse-main"),this.collapsibleMainHeader=void 0)}async setupCollapsibleHeader(t,e){if(!t||!e)return void console.error("ion-header requires a content to collapse, make sure there is an ion-content.");if("undefined"==typeof IntersectionObserver)return;this.scrollEl=await t.getScrollElement();const n=e.querySelectorAll("ion-header");if(this.collapsibleMainHeader=Array.from(n).find((t=>"condense"!==t.collapse)),!this.collapsibleMainHeader)return;const i=$(this.collapsibleMainHeader),r=$(this.el);i&&r&&(z(i,!1),i.toolbars.forEach((t=>{H(t,0)})),this.intersectionObserver=new IntersectionObserver((t=>{((t,e,n,i)=>{a((()=>{const r=i.scrollTop;((t,e,n)=>{if(!t[0].isIntersecting)return;const i=t[0].intersectionRatio>.9||n<=0?0:100*(1-t[0].intersectionRatio)/75;e.toolbars.forEach((t=>{H(t,1===i?void 0:i)}))})(t,e,r);const o=t[0],s=o.intersectionRect,a=s.width*s.height,c=0===a&&0==o.rootBounds.width*o.rootBounds.height,u=Math.abs(s.left-o.boundingClientRect.left),l=Math.abs(s.right-o.boundingClientRect.right);c||a>0&&(u>=5||l>=5)||(o.isIntersecting?(z(e,!1),z(n)):(0===s.x&&0===s.y||0!==s.width&&0!==s.height)&&r>0&&(z(e),z(n,!1),H(e.toolbars[0])))}))})(t,i,r,this.scrollEl)}),{root:t,threshold:[.25,.3,.4,.5,.6,.7,.8,.9,1]}),this.intersectionObserver.observe(r.toolbars[r.toolbars.length-1].el),this.contentScrollCallback=()=>{((t,e,n)=>{s((()=>{const i=w(1,1+-t.scrollTop/500,1.1);null===n.querySelector("ion-refresher.refresher-native")&&a((()=>{((t=[],e=1,n=!1)=>{t.forEach((t=>{const i=t.ionTitleEl,r=t.innerTitleEl;i&&"large"===i.size&&(r.style.transition=n?"all 0.2s ease-in-out":"",r.style.transform=`scale3d(${e}, ${e}, 1)`)}))})(e.toolbars,i)}))}))})(this.scrollEl,r,t)},this.scrollEl.addEventListener("scroll",this.contentScrollCallback),a((()=>{void 0!==this.collapsibleMainHeader&&this.collapsibleMainHeader.classList.add("header-collapse-main")})),this.collapsibleHeaderInitialized=!0)}render(){const{translucent:t,inheritedAttributes:i}=this,r=l(this),o=this.collapse||"none",s=v("ion-menu",this.el)?"none":"banner";return e(n,Object.assign({role:s,class:{[r]:!0,[`header-${r}`]:!0,"header-translucent":this.translucent,[`header-collapse-${o}`]:!0,[`header-translucent-${r}`]:this.translucent}},i),"ios"===r&&t&&e("div",{class:"header-background"}),e("slot",null))}get el(){return i(this)}};let W;K.style={ios:"ion-header{display:block;position:relative;order:-1;width:100%;z-index:10}ion-header ion-toolbar:first-of-type{padding-top:var(--ion-safe-area-top, 0)}.header-ios ion-toolbar:last-of-type{--border-width:0 0 0.55px}@supports (backdrop-filter: blur(0)){.header-background{left:0;right:0;top:0;bottom:0;position:absolute;backdrop-filter:saturate(180%) blur(20px)}.header-translucent-ios ion-toolbar{--opacity:.8}.header-collapse-condense-inactive .header-background{backdrop-filter:blur(20px)}}.header-ios.ion-no-border ion-toolbar:last-of-type{--border-width:0}.header-collapse-condense{z-index:9}.header-collapse-condense ion-toolbar{position:sticky;top:0}.header-collapse-condense ion-toolbar:first-of-type{padding-top:7px;z-index:1}.header-collapse-condense ion-toolbar{--background:var(--ion-background-color, #fff);z-index:0}.header-collapse-condense ion-toolbar ion-searchbar{height:48px;padding-top:0px;padding-bottom:13px}.header-collapse-main ion-toolbar.in-toolbar ion-title,.header-collapse-main ion-toolbar.in-toolbar ion-buttons{transition:all 0.2s ease-in-out}.header-collapse-condense-inactive:not(.header-collapse-condense) ion-toolbar.in-toolbar ion-title,.header-collapse-condense-inactive:not(.header-collapse-condense) ion-toolbar.in-toolbar ion-buttons.buttons-collapse{opacity:0;pointer-events:none}.header-collapse-condense-inactive.header-collapse-condense ion-toolbar.in-toolbar ion-title,.header-collapse-condense-inactive.header-collapse-condense ion-toolbar.in-toolbar ion-buttons.buttons-collapse{visibility:hidden}",md:'ion-header{display:block;position:relative;order:-1;width:100%;z-index:10}ion-header ion-toolbar:first-of-type{padding-top:var(--ion-safe-area-top, 0)}.header-md::after{left:0;bottom:-5px;background-position:left 0 top -2px;position:absolute;width:100%;height:5px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAHBAMAAADzDtBxAAAAD1BMVEUAAAAAAAAAAAAAAAAAAABPDueNAAAABXRSTlMUCS0gBIh/TXEAAAAaSURBVAjXYxCEAgY4UIICBmMogMsgFLtAAQCNSwXZKOdPxgAAAABJRU5ErkJggg==);background-repeat:repeat-x;content:""}[dir=rtl] .header-md::after,:host-context([dir=rtl]) .header-md::after{left:unset;right:unset;right:0}[dir=rtl] .header-md::after,:host-context([dir=rtl]) .header-md::after{background-position:right 0 top -2px}.header-collapse-condense{display:none}.header-md.ion-no-border::after{display:none}'};const q=(t,e,n,i,r)=>(n="ios"===(n&&Y(n))?"ios":"md",i&&"ios"===n?t=Y(i):r&&"md"===n?t=Y(r):(t||!e||G(e)||(t=e),X(t)&&(t=Y(t))),X(t)&&""!==t.trim()?""!==t.replace(/[a-z]|-|\d/gi,"")?null:t:null),V=t=>X(t)&&(t=t.trim(),G(t))?t:null,G=t=>t.length>0&&/(\/|\.)/.test(t),X=t=>"string"==typeof t,Y=t=>t.toLowerCase(),Z=t=>{if(1===t.nodeType){if("script"===t.nodeName.toLowerCase())return!1;for(let e=0;e<t.attributes.length;e++){const n=t.attributes[e].value;if(X(n)&&0===n.toLowerCase().indexOf("on"))return!1}for(let e=0;e<t.childNodes.length;e++)if(!Z(t.childNodes[e]))return!1}return!0},Q=new Map,tt=new Map,et=class{constructor(e){t(this,e),this.iconName=null,this.isVisible=!1,this.mode=nt(),this.lazy=!1,this.sanitize=!0}connectedCallback(){this.waitUntilVisible(this.el,"50px",(()=>{this.isVisible=!0,this.loadIcon()}))}disconnectedCallback(){this.io&&(this.io.disconnect(),this.io=void 0)}waitUntilVisible(t,e,n){if(this.lazy&&"undefined"!=typeof window&&window.IntersectionObserver){const i=this.io=new window.IntersectionObserver((t=>{t[0].isIntersecting&&(i.disconnect(),this.io=void 0,n())}),{rootMargin:e});i.observe(t)}else n()}loadIcon(){if(this.isVisible){const t=(t=>{let e=V(t.src);if(e)return e;if(e=q(t.name,t.icon,t.mode,t.ios,t.md),e)return n=e,(()=>{if("undefined"==typeof window)return new Map;if(!W){const t=window;t.Ionicons=t.Ionicons||{},W=t.Ionicons.map=t.Ionicons.map||new Map}return W})().get(n)||c(`svg/${n}.svg`);var n;if(t.icon){if(e=V(t.icon),e)return e;if(e=V(t.icon[t.mode]),e)return e}return null})(this);t&&(Q.has(t)?this.svgContent=Q.get(t):((t,e)=>{let n=tt.get(t);if(!n){if("undefined"==typeof fetch||"undefined"==typeof document)return Q.set(t,""),Promise.resolve();n=fetch(t).then((n=>{if(n.ok)return n.text().then((n=>{n&&!1!==e&&(n=(t=>{const e=document.createElement("div");e.innerHTML=t;for(let t=e.childNodes.length-1;t>=0;t--)"svg"!==e.childNodes[t].nodeName.toLowerCase()&&e.removeChild(e.childNodes[t]);const n=e.firstElementChild;if(n&&"svg"===n.nodeName.toLowerCase()){const t=n.getAttribute("class")||"";if(n.setAttribute("class",(t+" s-ion-icon").trim()),Z(n))return e.innerHTML}return""})(n)),Q.set(t,n||"")}));Q.set(t,"")})),tt.set(t,n)}return n})(t,this.sanitize).then((()=>this.svgContent=Q.get(t))))}const t=this.iconName=q(this.name,this.icon,this.mode,this.ios,this.md);this.ariaLabel||"true"===this.ariaHidden||t&&(this.ariaLabel=t.replace(/\-/g," "))}render(){const{iconName:t}=this,i=this.mode||"md",r=this.flipRtl||t&&(t.indexOf("arrow")>-1||t.indexOf("chevron")>-1)&&!1!==this.flipRtl;return e(n,{role:"img",class:Object.assign(Object.assign({[i]:!0},it(this.color)),{[`icon-${this.size}`]:!!this.size,"flip-rtl":!!r&&"rtl"===this.el.ownerDocument.dir})},e("div",this.svgContent?{class:"icon-inner",innerHTML:this.svgContent}:{class:"icon-inner"}))}static get assetsDirs(){return["svg"]}get el(){return i(this)}static get watchers(){return{name:["loadIcon"],src:["loadIcon"],icon:["loadIcon"]}}},nt=()=>"undefined"!=typeof document&&document.documentElement.getAttribute("mode")||"md",it=t=>t?{"ion-color":!0,[`ion-color-${t}`]:!0}:null;et.style=":host{display:inline-block;width:1em;height:1em;contain:strict;fill:currentColor;box-sizing:content-box !important}:host .ionicon{stroke:currentColor}.ionicon-fill-none{fill:none}.ionicon-stroke-width{stroke-width:32px;stroke-width:var(--ionicon-stroke-width, 32px)}.icon-inner,.ionicon,svg{display:block;height:100%;width:100%}:host(.flip-rtl) .icon-inner{transform:scaleX(-1)}:host(.icon-small){font-size:18px !important}:host(.icon-large){font-size:32px !important}:host(.ion-color){color:var(--ion-color-base) !important}:host(.ion-color-primary){--ion-color-base:var(--ion-color-primary, #3880ff)}:host(.ion-color-secondary){--ion-color-base:var(--ion-color-secondary, #0cd1e8)}:host(.ion-color-tertiary){--ion-color-base:var(--ion-color-tertiary, #f4a942)}:host(.ion-color-success){--ion-color-base:var(--ion-color-success, #10dc60)}:host(.ion-color-warning){--ion-color-base:var(--ion-color-warning, #ffce00)}:host(.ion-color-danger){--ion-color-base:var(--ion-color-danger, #f14141)}:host(.ion-color-light){--ion-color-base:var(--ion-color-light, #f4f5f8)}:host(.ion-color-medium){--ion-color-base:var(--ion-color-medium, #989aa2)}:host(.ion-color-dark){--ion-color-base:var(--ion-color-dark, #222428)}";const rt=class{constructor(e){t(this,e),this.labelColorStyles={},this.itemStyles=new Map,this.multipleInputs=!1,this.focusable=!0,this.button=!1,this.detailIcon="chevron-forward",this.disabled=!1,this.routerDirection="forward",this.type="button"}labelColorChanged(t){const{color:e}=this;void 0===e&&(this.labelColorStyles=t.detail)}itemStyle(t){t.stopPropagation();const e=t.target.tagName,n=t.detail,i={},r=this.itemStyles.get(e)||{};let s=!1;Object.keys(n).forEach((t=>{if(n[t]){const e=`item-${t}`;r[e]||(s=!0),i[e]=!0}})),s||Object.keys(i).length===Object.keys(r).length||(s=!0),s&&(this.itemStyles.set(e,i),o(this))}componentDidUpdate(){const t=this.getFirstInput();t&&!this.clickListener&&(this.clickListener=e=>this.delegateFocus(e,t),this.el.addEventListener("click",this.clickListener))}disconnectedCallback(){this.getFirstInput()&&this.clickListener&&(this.el.removeEventListener("click",this.clickListener),this.clickListener=void 0)}componentDidLoad(){b((()=>{this.setMultipleInputs(),this.focusable=this.isFocusable()}))}setMultipleInputs(){const t=this.el.querySelectorAll("ion-checkbox, ion-datetime, ion-select, ion-radio"),e=this.el.querySelectorAll("ion-input, ion-range, ion-searchbar, ion-segment, ion-textarea, ion-toggle"),n=this.el.querySelectorAll("ion-anchor, ion-button, a, button");this.multipleInputs=t.length+e.length>1||t.length+n.length>1||t.length>0&&this.isClickable()}hasCover(){return 1===this.el.querySelectorAll("ion-checkbox, ion-datetime, ion-select, ion-radio").length&&!this.multipleInputs}isClickable(){return void 0!==this.href||this.button}canActivate(){return this.isClickable()||this.hasCover()}isFocusable(){const t=this.el.querySelector(".ion-focusable");return this.canActivate()||null!==t}getFirstInput(){return this.el.querySelectorAll("ion-input, ion-textarea")[0]}delegateFocus(t,e){const n="ION-ITEM"===t.target.tagName;let i=!1;document.activeElement&&(i=e.querySelector("input, textarea")===document.activeElement),n&&i&&(e.fireFocusEvents=!1,e.setBlur(),e.setFocus(),b((()=>{e.fireFocusEvents=!0})))}render(){const{detail:t,detailIcon:i,download:r,labelColorStyles:o,lines:s,disabled:a,href:c,rel:u,target:h,routerAnimation:d,routerDirection:g}=this,m={},w=l(this),b=this.isClickable(),y=this.canActivate(),x=b?void 0===c?"button":"a":"div",k="button"===x?{type:this.type}:{download:r,href:c,rel:u,target:h},E=b?{onClick:t=>{p(c,t,g,d)}}:{},S=void 0!==t?t:"ios"===w&&b;return this.itemStyles.forEach((t=>{Object.assign(m,t)})),e(n,{"aria-disabled":a||m["item-interactive-disabled"]?"true":null,class:Object.assign(Object.assign(Object.assign({},m),o),f(this.color,{item:!0,[w]:!0,[`item-lines-${s}`]:void 0!==s,"item-disabled":a,"in-list":v("ion-list",this.el),"item-multiple-inputs":this.multipleInputs,"ion-activatable":y,"ion-focusable":this.focusable}))},e(x,Object.assign({},k,{class:"item-native",part:"native",disabled:a},E),e("slot",{name:"start"}),e("div",{class:"item-inner"},e("div",{class:"input-wrapper"},e("slot",null)),e("slot",{name:"end"}),S&&e("ion-icon",{icon:i,lazy:!1,class:"item-detail-icon",part:"detail-icon","aria-hidden":"true"}),e("div",{class:"item-inner-highlight"})),y&&"md"===w&&e("ion-ripple-effect",null)),e("div",{class:"item-highlight"}))}static get delegatesFocus(){return!0}get el(){return i(this)}};rt.style={ios:':host{--border-radius:0px;--border-width:0px;--border-style:solid;--padding-top:0px;--padding-bottom:0px;--padding-end:0px;--padding-start:0px;--inner-border-width:0px;--inner-padding-top:0px;--inner-padding-bottom:0px;--inner-padding-start:0px;--inner-padding-end:0px;--inner-box-shadow:none;--show-full-highlight:0;--show-inset-highlight:0;--detail-icon-color:initial;--detail-icon-font-size:20px;--detail-icon-opacity:0.25;--color-activated:var(--color);--color-focused:var(--color);--color-hover:var(--color);--ripple-color:currentColor;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:block;position:relative;align-items:center;justify-content:space-between;outline:none;color:var(--color);font-family:var(--ion-font-family, inherit);text-align:initial;text-decoration:none;overflow:hidden;box-sizing:border-box}:host(.ion-color) .item-native{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.ion-color) .item-native,:host(.ion-color) .item-inner{border-color:var(--ion-color-shade)}:host(.ion-activated) .item-native{color:var(--color-activated)}:host(.ion-activated) .item-native::after{background:var(--background-activated);opacity:var(--background-activated-opacity)}:host(.ion-color.ion-activated) .item-native{color:var(--ion-color-contrast)}:host(.ion-focused) .item-native{color:var(--color-focused)}:host(.ion-focused) .item-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}:host(.ion-color.ion-focused) .item-native{color:var(--ion-color-contrast)}:host(.ion-color.ion-focused) .item-native::after{background:var(--ion-color-contrast)}@media (any-hover: hover){:host(.ion-activatable:hover) .item-native{color:var(--color-hover)}:host(.ion-activatable:hover) .item-native::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}:host(.ion-color.ion-activatable:hover) .item-native{color:var(--ion-color-contrast)}:host(.ion-color.ion-activatable:hover) .item-native::after{background:var(--ion-color-contrast)}}:host(.item-interactive-disabled:not(.item-multiple-inputs)){cursor:default;pointer-events:none}:host(.item-disabled){cursor:default;opacity:0.3;pointer-events:none}.item-native{border-radius:var(--border-radius);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:flex;position:relative;align-items:inherit;justify-content:inherit;width:100%;min-height:var(--min-height);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:var(--background);overflow:inherit;box-sizing:border-box;z-index:1}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.item-native{padding-left:unset;padding-right:unset;-webkit-padding-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-inline-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.item-native::-moz-focus-inner{border:0}.item-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0;transition:var(--transition);z-index:-1}button,a{cursor:pointer;user-select:none;-webkit-user-drag:none}.item-inner{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--inner-padding-start);padding-right:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-top:var(--inner-padding-top);padding-bottom:var(--inner-padding-bottom);display:flex;position:relative;flex:1;flex-direction:inherit;align-items:inherit;align-self:stretch;min-height:inherit;border-width:var(--inner-border-width);border-style:var(--border-style);border-color:var(--border-color);box-shadow:var(--inner-box-shadow);overflow:inherit;box-sizing:border-box}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.item-inner{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--inner-padding-start);padding-inline-start:var(--inner-padding-start);-webkit-padding-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-inline-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end))}}.item-detail-icon{color:var(--detail-icon-color);font-size:var(--detail-icon-font-size);opacity:var(--detail-icon-opacity)}::slotted(ion-icon){font-size:1.6em}::slotted(ion-button){--margin-top:0;--margin-bottom:0;--margin-start:0;--margin-end:0;z-index:1}::slotted(ion-label:not([slot=end])){flex:1}:host(.item-input){align-items:center}.input-wrapper{display:flex;flex:1;flex-direction:inherit;align-items:inherit;align-self:stretch;text-overflow:ellipsis;overflow:inherit;box-sizing:border-box}:host(.item-label-stacked),:host(.item-label-floating){align-items:start}:host(.item-label-stacked) .input-wrapper,:host(.item-label-floating) .input-wrapper{flex:1;flex-direction:column}.item-highlight,.item-inner-highlight{left:0;right:0;bottom:0;position:absolute;background:var(--highlight-background);z-index:1}.item-highlight{height:var(--full-highlight-height)}.item-inner-highlight{height:var(--inset-highlight-height)}:host(.item-interactive.item-has-focus),:host(.item-interactive.ion-touched.ion-invalid){--full-highlight-height:calc(var(--highlight-height) * var(--show-full-highlight));--inset-highlight-height:calc(var(--highlight-height) * var(--show-inset-highlight))}:host(.item-interactive.item-has-focus){--highlight-background:var(--highlight-color-focused)}:host(.item-interactive.ion-valid){--highlight-background:var(--highlight-color-valid)}:host(.item-interactive.ion-invalid){--highlight-background:var(--highlight-color-invalid)}:host(:not(.item-label)) ::slotted(ion-select){--padding-start:0;max-width:none}:host(.item-label-stacked) ::slotted(ion-select),:host(.item-label-floating) ::slotted(ion-select){--padding-top:8px;--padding-bottom:8px;--padding-start:0;align-self:stretch;width:100%;max-width:100%}:host(:not(.item-label)) ::slotted(ion-datetime){--padding-start:0}:host(.item-label-stacked) ::slotted(ion-datetime),:host(.item-label-floating) ::slotted(ion-datetime){--padding-start:0;width:100%}:host(.item-multiple-inputs) ::slotted(ion-checkbox),:host(.item-multiple-inputs) ::slotted(ion-datetime),:host(.item-multiple-inputs) ::slotted(ion-radio),:host(.item-multiple-inputs) ::slotted(ion-select){position:relative}:host(.item-textarea){align-items:stretch}::slotted(ion-reorder[slot]){margin-top:0;margin-bottom:0}ion-ripple-effect{color:var(--ripple-color)}:host{--min-height:44px;--transition:background-color 200ms linear, opacity 200ms linear;--padding-start:20px;--inner-padding-end:10px;--inner-border-width:0px 0px 0.55px 0px;--background:var(--ion-item-background, var(--ion-background-color, #fff));--background-activated:#000;--background-focused:#000;--background-hover:currentColor;--background-activated-opacity:.12;--background-focused-opacity:.15;--background-hover-opacity:.04;--border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-250, #c8c7cc)));--color:var(--ion-item-color, var(--ion-text-color, #000));--highlight-height:0;--highlight-color-focused:var(--ion-color-primary, #3880ff);--highlight-color-valid:var(--ion-color-success, #2dd36f);--highlight-color-invalid:var(--ion-color-danger, #eb445a);font-size:17px}:host(.ion-activated){--transition:none}:host(.ion-color.ion-focused) .item-native::after{background:#000;opacity:0.15}:host(.ion-color.ion-activated) .item-native::after{background:#000;opacity:0.12}:host(.item-interactive){--show-full-highlight:0;--show-inset-highlight:1}:host(.item-lines-full){--border-width:0px 0px 0.55px 0px;--show-full-highlight:1;--show-inset-highlight:0}:host(.item-lines-inset){--inner-border-width:0px 0px 0.55px 0px;--show-full-highlight:0;--show-inset-highlight:1}:host(.item-lines-inset),:host(.item-lines-none){--border-width:0px;--show-full-highlight:0}:host(.item-lines-full),:host(.item-lines-none){--inner-border-width:0px;--show-inset-highlight:0}::slotted([slot=start]){margin-left:0;margin-right:20px;margin-top:2px;margin-bottom:2px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted([slot=start]){margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:20px;margin-inline-end:20px}}::slotted([slot=end]){margin-left:10px;margin-right:10px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted([slot=end]){margin-left:unset;margin-right:unset;-webkit-margin-start:10px;margin-inline-start:10px;-webkit-margin-end:10px;margin-inline-end:10px}}::slotted(ion-icon[slot=start]),::slotted(ion-icon[slot=end]){margin-top:7px;margin-bottom:7px}::slotted(ion-toggle[slot=start]),::slotted(ion-toggle[slot=end]){margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}:host(.item-label-stacked) ::slotted([slot=end]),:host(.item-label-floating) ::slotted([slot=end]){margin-top:7px;margin-bottom:7px}::slotted(.button-small){--padding-top:0px;--padding-bottom:0px;--padding-start:.5em;--padding-end:.5em;height:24px;font-size:13px}::slotted(ion-avatar){width:36px;height:36px}::slotted(ion-thumbnail){width:56px;height:56px}::slotted(ion-avatar[slot=end]),::slotted(ion-thumbnail[slot=end]){margin-left:10px;margin-right:10px;margin-top:10px;margin-bottom:10px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-avatar[slot=end]),::slotted(ion-thumbnail[slot=end]){margin-left:unset;margin-right:unset;-webkit-margin-start:10px;margin-inline-start:10px;-webkit-margin-end:10px;margin-inline-end:10px}}:host(.item-radio) ::slotted(ion-label),:host(.item-toggle) ::slotted(ion-label){margin-left:0px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.item-radio) ::slotted(ion-label),:host(.item-toggle) ::slotted(ion-label){margin-left:unset;-webkit-margin-start:0px;margin-inline-start:0px}}::slotted(ion-label){margin-left:0;margin-right:8px;margin-top:10px;margin-bottom:10px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-label){margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:8px;margin-inline-end:8px}}:host(.item-label-floating),:host(.item-label-stacked){--min-height:68px}:host(.item-label-stacked) ::slotted(ion-select),:host(.item-label-floating) ::slotted(ion-select){--padding-top:8px;--padding-bottom:8px;--padding-start:0px}:host(.item-label-fixed) ::slotted(ion-select),:host(.item-label-fixed) ::slotted(ion-datetime){--padding-start:0}',md:':host{--border-radius:0px;--border-width:0px;--border-style:solid;--padding-top:0px;--padding-bottom:0px;--padding-end:0px;--padding-start:0px;--inner-border-width:0px;--inner-padding-top:0px;--inner-padding-bottom:0px;--inner-padding-start:0px;--inner-padding-end:0px;--inner-box-shadow:none;--show-full-highlight:0;--show-inset-highlight:0;--detail-icon-color:initial;--detail-icon-font-size:20px;--detail-icon-opacity:0.25;--color-activated:var(--color);--color-focused:var(--color);--color-hover:var(--color);--ripple-color:currentColor;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:block;position:relative;align-items:center;justify-content:space-between;outline:none;color:var(--color);font-family:var(--ion-font-family, inherit);text-align:initial;text-decoration:none;overflow:hidden;box-sizing:border-box}:host(.ion-color) .item-native{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.ion-color) .item-native,:host(.ion-color) .item-inner{border-color:var(--ion-color-shade)}:host(.ion-activated) .item-native{color:var(--color-activated)}:host(.ion-activated) .item-native::after{background:var(--background-activated);opacity:var(--background-activated-opacity)}:host(.ion-color.ion-activated) .item-native{color:var(--ion-color-contrast)}:host(.ion-focused) .item-native{color:var(--color-focused)}:host(.ion-focused) .item-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}:host(.ion-color.ion-focused) .item-native{color:var(--ion-color-contrast)}:host(.ion-color.ion-focused) .item-native::after{background:var(--ion-color-contrast)}@media (any-hover: hover){:host(.ion-activatable:hover) .item-native{color:var(--color-hover)}:host(.ion-activatable:hover) .item-native::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}:host(.ion-color.ion-activatable:hover) .item-native{color:var(--ion-color-contrast)}:host(.ion-color.ion-activatable:hover) .item-native::after{background:var(--ion-color-contrast)}}:host(.item-interactive-disabled:not(.item-multiple-inputs)){cursor:default;pointer-events:none}:host(.item-disabled){cursor:default;opacity:0.3;pointer-events:none}.item-native{border-radius:var(--border-radius);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:flex;position:relative;align-items:inherit;justify-content:inherit;width:100%;min-height:var(--min-height);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:var(--background);overflow:inherit;box-sizing:border-box;z-index:1}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.item-native{padding-left:unset;padding-right:unset;-webkit-padding-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-inline-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.item-native::-moz-focus-inner{border:0}.item-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0;transition:var(--transition);z-index:-1}button,a{cursor:pointer;user-select:none;-webkit-user-drag:none}.item-inner{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--inner-padding-start);padding-right:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-top:var(--inner-padding-top);padding-bottom:var(--inner-padding-bottom);display:flex;position:relative;flex:1;flex-direction:inherit;align-items:inherit;align-self:stretch;min-height:inherit;border-width:var(--inner-border-width);border-style:var(--border-style);border-color:var(--border-color);box-shadow:var(--inner-box-shadow);overflow:inherit;box-sizing:border-box}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.item-inner{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--inner-padding-start);padding-inline-start:var(--inner-padding-start);-webkit-padding-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-inline-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end))}}.item-detail-icon{color:var(--detail-icon-color);font-size:var(--detail-icon-font-size);opacity:var(--detail-icon-opacity)}::slotted(ion-icon){font-size:1.6em}::slotted(ion-button){--margin-top:0;--margin-bottom:0;--margin-start:0;--margin-end:0;z-index:1}::slotted(ion-label:not([slot=end])){flex:1}:host(.item-input){align-items:center}.input-wrapper{display:flex;flex:1;flex-direction:inherit;align-items:inherit;align-self:stretch;text-overflow:ellipsis;overflow:inherit;box-sizing:border-box}:host(.item-label-stacked),:host(.item-label-floating){align-items:start}:host(.item-label-stacked) .input-wrapper,:host(.item-label-floating) .input-wrapper{flex:1;flex-direction:column}.item-highlight,.item-inner-highlight{left:0;right:0;bottom:0;position:absolute;background:var(--highlight-background);z-index:1}.item-highlight{height:var(--full-highlight-height)}.item-inner-highlight{height:var(--inset-highlight-height)}:host(.item-interactive.item-has-focus),:host(.item-interactive.ion-touched.ion-invalid){--full-highlight-height:calc(var(--highlight-height) * var(--show-full-highlight));--inset-highlight-height:calc(var(--highlight-height) * var(--show-inset-highlight))}:host(.item-interactive.item-has-focus){--highlight-background:var(--highlight-color-focused)}:host(.item-interactive.ion-valid){--highlight-background:var(--highlight-color-valid)}:host(.item-interactive.ion-invalid){--highlight-background:var(--highlight-color-invalid)}:host(:not(.item-label)) ::slotted(ion-select){--padding-start:0;max-width:none}:host(.item-label-stacked) ::slotted(ion-select),:host(.item-label-floating) ::slotted(ion-select){--padding-top:8px;--padding-bottom:8px;--padding-start:0;align-self:stretch;width:100%;max-width:100%}:host(:not(.item-label)) ::slotted(ion-datetime){--padding-start:0}:host(.item-label-stacked) ::slotted(ion-datetime),:host(.item-label-floating) ::slotted(ion-datetime){--padding-start:0;width:100%}:host(.item-multiple-inputs) ::slotted(ion-checkbox),:host(.item-multiple-inputs) ::slotted(ion-datetime),:host(.item-multiple-inputs) ::slotted(ion-radio),:host(.item-multiple-inputs) ::slotted(ion-select){position:relative}:host(.item-textarea){align-items:stretch}::slotted(ion-reorder[slot]){margin-top:0;margin-bottom:0}ion-ripple-effect{color:var(--ripple-color)}:host{--min-height:48px;--background:var(--ion-item-background, var(--ion-background-color, #fff));--background-activated:transparent;--background-focused:currentColor;--background-hover:currentColor;--background-activated-opacity:0;--background-focused-opacity:.12;--background-hover-opacity:.04;--border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, rgba(0, 0, 0, 0.13))));--color:var(--ion-item-color, var(--ion-text-color, #000));--transition:opacity 15ms linear, background-color 15ms linear;--padding-start:16px;--border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, rgba(0, 0, 0, 0.13))));--inner-padding-end:16px;--inner-border-width:0 0 1px 0;--highlight-height:2px;--highlight-color-focused:var(--ion-color-primary, #3880ff);--highlight-color-valid:var(--ion-color-success, #2dd36f);--highlight-color-invalid:var(--ion-color-danger, #eb445a);font-size:16px;font-weight:normal;text-transform:none}:host(.ion-color.ion-activated) .item-native::after{background:transparent}:host(.item-interactive){--border-width:0 0 1px 0;--inner-border-width:0;--show-full-highlight:1;--show-inset-highlight:0}:host(.item-lines-full){--border-width:0 0 1px 0;--show-full-highlight:1;--show-inset-highlight:0}:host(.item-lines-inset){--inner-border-width:0 0 1px 0;--show-full-highlight:0;--show-inset-highlight:1}:host(.item-lines-inset),:host(.item-lines-none){--border-width:0;--show-full-highlight:0}:host(.item-lines-full),:host(.item-lines-none){--inner-border-width:0;--show-inset-highlight:0}:host(.item-multi-line) ::slotted([slot=start]),:host(.item-multi-line) ::slotted([slot=end]){margin-top:16px;margin-bottom:16px;align-self:flex-start}::slotted([slot=start]){margin-right:32px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted([slot=start]){margin-right:unset;-webkit-margin-end:32px;margin-inline-end:32px}}::slotted([slot=end]){margin-left:32px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted([slot=end]){margin-left:unset;-webkit-margin-start:32px;margin-inline-start:32px}}::slotted(ion-icon){color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.54);font-size:24px}:host(.ion-color) ::slotted(ion-icon){color:var(--ion-color-contrast)}::slotted(ion-icon[slot]){margin-top:12px;margin-bottom:12px}::slotted(ion-icon[slot=start]){margin-right:32px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-icon[slot=start]){margin-right:unset;-webkit-margin-end:32px;margin-inline-end:32px}}::slotted(ion-icon[slot=end]){margin-left:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-icon[slot=end]){margin-left:unset;-webkit-margin-start:16px;margin-inline-start:16px}}::slotted(ion-toggle[slot=start]),::slotted(ion-toggle[slot=end]){margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}::slotted(ion-note){margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;align-self:flex-start;font-size:11px}::slotted(ion-note[slot]){padding-left:0;padding-right:0;padding-top:18px;padding-bottom:10px}::slotted(ion-note[slot=start]){padding-right:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-note[slot=start]){padding-right:unset;-webkit-padding-end:16px;padding-inline-end:16px}}::slotted(ion-note[slot=end]){padding-left:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-note[slot=end]){padding-left:unset;-webkit-padding-start:16px;padding-inline-start:16px}}::slotted(ion-avatar){width:40px;height:40px}::slotted(ion-thumbnail){width:56px;height:56px}::slotted(ion-avatar),::slotted(ion-thumbnail){margin-top:8px;margin-bottom:8px}::slotted(ion-avatar[slot=start]),::slotted(ion-thumbnail[slot=start]){margin-right:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-avatar[slot=start]),::slotted(ion-thumbnail[slot=start]){margin-right:unset;-webkit-margin-end:16px;margin-inline-end:16px}}::slotted(ion-avatar[slot=end]),::slotted(ion-thumbnail[slot=end]){margin-left:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-avatar[slot=end]),::slotted(ion-thumbnail[slot=end]){margin-left:unset;-webkit-margin-start:16px;margin-inline-start:16px}}::slotted(ion-label){margin-left:0;margin-right:0;margin-top:11px;margin-bottom:10px}:host(.item-label-stacked) ::slotted([slot=end]),:host(.item-label-floating) ::slotted([slot=end]){margin-top:7px;margin-bottom:7px}:host(.item-label-fixed) ::slotted(ion-select),:host(.item-label-fixed) ::slotted(ion-datetime){--padding-start:8px}:host(.item-toggle) ::slotted(ion-label),:host(.item-radio) ::slotted(ion-label){margin-left:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.item-toggle) ::slotted(ion-label),:host(.item-radio) ::slotted(ion-label){margin-left:unset;-webkit-margin-start:0;margin-inline-start:0}}::slotted(.button-small){--padding-top:0;--padding-bottom:0;--padding-start:.6em;--padding-end:.6em;height:25px;font-size:12px}:host(.item-label-floating),:host(.item-label-stacked){--min-height:55px}:host(.item-label-stacked) ::slotted(ion-select),:host(.item-label-floating) ::slotted(ion-select){--padding-top:8px;--padding-bottom:8px;--padding-start:0}:host(.item-has-focus:not(.ion-color)) ::slotted(.label-stacked),:host(.item-has-focus:not(.ion-color)) ::slotted(.label-floating){color:var(--ion-color-primary, #3880ff)}:host(.ion-color){--highlight-color-focused:var(--ion-color-contrast)}:host(.item-label-color){--highlight-color-focused:var(--ion-color-base)}'};const ot=class{constructor(e){t(this,e),this.sticky=!1}render(){const t=l(this);return e(n,{class:f(this.color,{[t]:!0,"item-divider-sticky":this.sticky,item:!0})},e("slot",{name:"start"}),e("div",{class:"item-divider-inner"},e("div",{class:"item-divider-wrapper"},e("slot",null)),e("slot",{name:"end"})))}get el(){return i(this)}};ot.style={ios:":host{--padding-top:0px;--padding-end:0px;--padding-bottom:0px;--padding-start:0px;--inner-padding-top:0px;--inner-padding-end:0px;--inner-padding-bottom:0px;--inner-padding-start:0px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:flex;align-items:center;justify-content:space-between;width:100%;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);overflow:hidden;z-index:100;box-sizing:border-box}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-inline-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}:host(.ion-color){background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.item-divider-sticky){position:sticky;top:0}.item-divider-inner{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--inner-padding-start);padding-right:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-top:var(--inner-padding-top);padding-bottom:var(--inner-padding-bottom);display:flex;flex:1;flex-direction:inherit;align-items:inherit;align-self:stretch;min-height:inherit;border:0;overflow:hidden}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.item-divider-inner{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--inner-padding-start);padding-inline-start:var(--inner-padding-start);-webkit-padding-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-inline-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end))}}.item-divider-wrapper{display:flex;flex:1;flex-direction:inherit;align-items:inherit;align-self:stretch;text-overflow:ellipsis;overflow:hidden}:host{--background:var(--ion-color-step-100, #e6e6e6);--color:var(--ion-color-step-850, #262626);--padding-start:20px;--inner-padding-end:10px;border-radius:0;position:relative;min-height:28px;font-size:17px;font-weight:600}:host([slot=start]){margin-left:0;margin-right:20px;margin-top:2px;margin-bottom:2px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host([slot=start]){margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:20px;margin-inline-end:20px}}:host([slot=end]){margin-left:10px;margin-right:10px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host([slot=end]){margin-left:unset;margin-right:unset;-webkit-margin-start:10px;margin-inline-start:10px;-webkit-margin-end:10px;margin-inline-end:10px}}::slotted(ion-icon[slot=start]),::slotted(ion-icon[slot=end]){margin-top:7px;margin-bottom:7px}::slotted(h1){margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:24px;font-weight:normal}::slotted(h2){margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:17px;font-weight:normal}::slotted(h3),::slotted(h4),::slotted(h5),::slotted(h6){margin-left:0;margin-right:0;margin-top:0;margin-bottom:3px;font-size:14px;font-weight:normal;line-height:normal}::slotted(p){margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.4);font-size:14px;line-height:normal;text-overflow:inherit;overflow:inherit}::slotted(h2:last-child) ::slotted(h3:last-child),::slotted(h4:last-child),::slotted(h5:last-child),::slotted(h6:last-child),::slotted(p:last-child){margin-bottom:0}",md:":host{--padding-top:0px;--padding-end:0px;--padding-bottom:0px;--padding-start:0px;--inner-padding-top:0px;--inner-padding-end:0px;--inner-padding-bottom:0px;--inner-padding-start:0px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:flex;align-items:center;justify-content:space-between;width:100%;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);overflow:hidden;z-index:100;box-sizing:border-box}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-inline-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}:host(.ion-color){background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.item-divider-sticky){position:sticky;top:0}.item-divider-inner{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--inner-padding-start);padding-right:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-top:var(--inner-padding-top);padding-bottom:var(--inner-padding-bottom);display:flex;flex:1;flex-direction:inherit;align-items:inherit;align-self:stretch;min-height:inherit;border:0;overflow:hidden}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.item-divider-inner{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--inner-padding-start);padding-inline-start:var(--inner-padding-start);-webkit-padding-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-inline-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end))}}.item-divider-wrapper{display:flex;flex:1;flex-direction:inherit;align-items:inherit;align-self:stretch;text-overflow:ellipsis;overflow:hidden}:host{--background:var(--ion-background-color, #fff);--color:var(--ion-color-step-400, #999999);--padding-start:16px;--inner-padding-end:0;min-height:30px;border-bottom:1px solid var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, rgba(0, 0, 0, 0.13))));font-size:14px}::slotted([slot=start]){margin-right:32px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted([slot=start]){margin-right:unset;-webkit-margin-end:32px;margin-inline-end:32px}}::slotted([slot=end]){margin-left:32px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted([slot=end]){margin-left:unset;-webkit-margin-start:32px;margin-inline-start:32px}}::slotted(ion-label){margin-left:0;margin-right:0;margin-top:13px;margin-bottom:10px}::slotted(ion-icon){color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.54);font-size:24px}:host(.ion-color) ::slotted(ion-icon){color:var(--ion-color-contrast)}::slotted(ion-icon[slot]){margin-top:12px;margin-bottom:12px}::slotted(ion-icon[slot=start]){margin-right:32px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-icon[slot=start]){margin-right:unset;-webkit-margin-end:32px;margin-inline-end:32px}}::slotted(ion-icon[slot=end]){margin-left:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-icon[slot=end]){margin-left:unset;-webkit-margin-start:16px;margin-inline-start:16px}}::slotted(ion-note){margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;align-self:flex-start;font-size:11px}::slotted(ion-note[slot]){padding-left:0;padding-right:0;padding-top:18px;padding-bottom:10px}::slotted(ion-note[slot=start]){padding-right:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-note[slot=start]){padding-right:unset;-webkit-padding-end:16px;padding-inline-end:16px}}::slotted(ion-note[slot=end]){padding-left:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-note[slot=end]){padding-left:unset;-webkit-padding-start:16px;padding-inline-start:16px}}::slotted(ion-avatar){width:40px;height:40px}::slotted(ion-thumbnail){width:56px;height:56px}::slotted(ion-avatar),::slotted(ion-thumbnail){margin-top:8px;margin-bottom:8px}::slotted(ion-avatar[slot=start]),::slotted(ion-thumbnail[slot=start]){margin-right:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-avatar[slot=start]),::slotted(ion-thumbnail[slot=start]){margin-right:unset;-webkit-margin-end:16px;margin-inline-end:16px}}::slotted(ion-avatar[slot=end]),::slotted(ion-thumbnail[slot=end]){margin-left:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-avatar[slot=end]),::slotted(ion-thumbnail[slot=end]){margin-left:unset;-webkit-margin-start:16px;margin-inline-start:16px}}::slotted(h1){margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:24px;font-weight:normal}::slotted(h2){margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:16px;font-weight:normal}::slotted(h3,h4,h5,h6){margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:14px;font-weight:normal;line-height:normal}::slotted(p){margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;color:var(--ion-color-step-600, #666666);font-size:14px;line-height:normal;text-overflow:inherit;overflow:inherit}"};const st=class{constructor(e){t(this,e)}render(){const t=l(this);return e(n,{role:"group",class:{[t]:!0,[`item-group-${t}`]:!0,item:!0}})}};st.style={ios:"ion-item-group{display:block}",md:"ion-item-group{display:block}"};const at=class{constructor(e){t(this,e),this.ionColor=r(this,"ionColor",7),this.ionStyle=r(this,"ionStyle",7),this.inRange=!1,this.noAnimate=!1}componentWillLoad(){this.inRange=!!this.el.closest("ion-range"),this.noAnimate="floating"===this.position,this.emitStyle(),this.emitColor()}componentDidLoad(){this.noAnimate&&setTimeout((()=>{this.noAnimate=!1}),1e3)}colorChanged(){this.emitColor()}positionChanged(){this.emitStyle()}emitColor(){const{color:t}=this;this.ionColor.emit({"item-label-color":void 0!==t,[`ion-color-${t}`]:void 0!==t})}emitStyle(){const{inRange:t,position:e}=this;t||this.ionStyle.emit({label:!0,[`label-${e}`]:void 0!==e})}render(){const t=this.position,i=l(this);return e(n,{class:f(this.color,{[i]:!0,"in-item-color":v("ion-item.ion-color",this.el),[`label-${t}`]:void 0!==t,"label-no-animate":this.noAnimate})})}get el(){return i(this)}static get watchers(){return{color:["colorChanged"],position:["positionChanged"]}}};at.style={ios:".item.sc-ion-label-ios-h,.item .sc-ion-label-ios-h{--color:initial;display:block;color:var(--color);font-family:var(--ion-font-family, inherit);font-size:inherit;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;box-sizing:border-box}.ion-color.sc-ion-label-ios-h{color:var(--ion-color-base)}.ion-text-wrap.sc-ion-label-ios-h,[text-wrap].sc-ion-label-ios-h{white-space:normal}.item-interactive-disabled.sc-ion-label-ios-h:not(.item-multiple-inputs),.item-interactive-disabled:not(.item-multiple-inputs) .sc-ion-label-ios-h{cursor:default;opacity:0.3;pointer-events:none}.item-input.sc-ion-label-ios-h,.item-input .sc-ion-label-ios-h{flex:initial;max-width:200px;pointer-events:none}.item-textarea.sc-ion-label-ios-h,.item-textarea .sc-ion-label-ios-h{align-self:baseline}.label-fixed.sc-ion-label-ios-h{flex:0 0 100px;width:100px;min-width:100px;max-width:200px}.label-stacked.sc-ion-label-ios-h,.label-floating.sc-ion-label-ios-h{margin-bottom:0;align-self:stretch;width:auto;max-width:100%}.label-no-animate.label-floating.sc-ion-label-ios-h{transition:none}.sc-ion-label-ios-s h1,.sc-ion-label-ios-s h2,.sc-ion-label-ios-s h3,.sc-ion-label-ios-s h4,.sc-ion-label-ios-s h5,.sc-ion-label-ios-s h6{text-overflow:inherit;overflow:inherit}.ion-text-wrap.sc-ion-label-ios-h,[text-wrap].sc-ion-label-ios-h{font-size:14px;line-height:1.5}.label-stacked.sc-ion-label-ios-h{margin-bottom:4px;font-size:14px}.label-floating.sc-ion-label-ios-h{margin-bottom:0;transform:translate3d(0, 29px, 0);transform-origin:left top;transition:transform 150ms ease-in-out}[dir=rtl].sc-ion-label-ios-h -no-combinator.label-floating.sc-ion-label-ios-h,[dir=rtl] .sc-ion-label-ios-h -no-combinator.label-floating.sc-ion-label-ios-h,[dir=rtl].label-floating.sc-ion-label-ios-h,[dir=rtl] .label-floating.sc-ion-label-ios-h{transform-origin:right top}.item-textarea.label-floating.sc-ion-label-ios-h,.item-textarea .label-floating.sc-ion-label-ios-h{transform:translate3d(0, 28px, 0)}.item-has-focus.label-floating.sc-ion-label-ios-h,.item-has-focus .label-floating.sc-ion-label-ios-h,.item-has-placeholder.sc-ion-label-ios-h:not(.item-input).label-floating,.item-has-placeholder:not(.item-input) .label-floating.sc-ion-label-ios-h,.item-has-value.label-floating.sc-ion-label-ios-h,.item-has-value .label-floating.sc-ion-label-ios-h{transform:translate3d(0, 0, 0) scale(0.82)}.sc-ion-label-ios-s h1{margin-left:0;margin-right:0;margin-top:3px;margin-bottom:2px;font-size:22px;font-weight:normal}.sc-ion-label-ios-s h2{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:17px;font-weight:normal}.sc-ion-label-ios-s h3,.sc-ion-label-ios-s h4,.sc-ion-label-ios-s h5,.sc-ion-label-ios-s h6{margin-left:0;margin-right:0;margin-top:0;margin-bottom:3px;font-size:14px;font-weight:normal;line-height:normal}.sc-ion-label-ios-s p{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:14px;line-height:normal;text-overflow:inherit;overflow:inherit}.sc-ion-label-ios-s>p{color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.4)}.sc-ion-label-ios-h.in-item-color.sc-ion-label-ios-s>p{color:inherit}.sc-ion-label-ios-s h2:last-child,.sc-ion-label-ios-s h3:last-child,.sc-ion-label-ios-s h4:last-child,.sc-ion-label-ios-s h5:last-child,.sc-ion-label-ios-s h6:last-child,.sc-ion-label-ios-s p:last-child{margin-bottom:0}",md:".item.sc-ion-label-md-h,.item .sc-ion-label-md-h{--color:initial;display:block;color:var(--color);font-family:var(--ion-font-family, inherit);font-size:inherit;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;box-sizing:border-box}.ion-color.sc-ion-label-md-h{color:var(--ion-color-base)}.ion-text-wrap.sc-ion-label-md-h,[text-wrap].sc-ion-label-md-h{white-space:normal}.item-interactive-disabled.sc-ion-label-md-h:not(.item-multiple-inputs),.item-interactive-disabled:not(.item-multiple-inputs) .sc-ion-label-md-h{cursor:default;opacity:0.3;pointer-events:none}.item-input.sc-ion-label-md-h,.item-input .sc-ion-label-md-h{flex:initial;max-width:200px;pointer-events:none}.item-textarea.sc-ion-label-md-h,.item-textarea .sc-ion-label-md-h{align-self:baseline}.label-fixed.sc-ion-label-md-h{flex:0 0 100px;width:100px;min-width:100px;max-width:200px}.label-stacked.sc-ion-label-md-h,.label-floating.sc-ion-label-md-h{margin-bottom:0;align-self:stretch;width:auto;max-width:100%}.label-no-animate.label-floating.sc-ion-label-md-h{transition:none}.sc-ion-label-md-s h1,.sc-ion-label-md-s h2,.sc-ion-label-md-s h3,.sc-ion-label-md-s h4,.sc-ion-label-md-s h5,.sc-ion-label-md-s h6{text-overflow:inherit;overflow:inherit}.ion-text-wrap.sc-ion-label-md-h,[text-wrap].sc-ion-label-md-h{line-height:1.5}.label-stacked.sc-ion-label-md-h{transform-origin:left top;transform:translateY(50%) scale(0.75);transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1)}[dir=rtl].sc-ion-label-md-h -no-combinator.label-stacked.sc-ion-label-md-h,[dir=rtl] .sc-ion-label-md-h -no-combinator.label-stacked.sc-ion-label-md-h,[dir=rtl].label-stacked.sc-ion-label-md-h,[dir=rtl] .label-stacked.sc-ion-label-md-h{transform-origin:right top}.label-floating.sc-ion-label-md-h{transform:translateY(96%);transform-origin:left top;transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1), transform 150ms cubic-bezier(0.4, 0, 0.2, 1)}[dir=rtl].sc-ion-label-md-h -no-combinator.label-floating.sc-ion-label-md-h,[dir=rtl] .sc-ion-label-md-h -no-combinator.label-floating.sc-ion-label-md-h,[dir=rtl].label-floating.sc-ion-label-md-h,[dir=rtl] .label-floating.sc-ion-label-md-h{transform-origin:right top}.item-textarea.label-floating.sc-ion-label-md-h,.item-textarea .label-floating.sc-ion-label-md-h{transform:translateY(185%)}.label-stacked.sc-ion-label-md-h,.label-floating.sc-ion-label-md-h{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}.item-has-focus.label-floating.sc-ion-label-md-h,.item-has-focus .label-floating.sc-ion-label-md-h,.item-has-placeholder.sc-ion-label-md-h:not(.item-input).label-floating,.item-has-placeholder:not(.item-input) .label-floating.sc-ion-label-md-h,.item-has-value.label-floating.sc-ion-label-md-h,.item-has-value .label-floating.sc-ion-label-md-h{transform:translateY(50%) scale(0.75)}.item-has-focus.label-stacked.sc-ion-label-md-h:not(.ion-color),.item-has-focus .label-stacked.sc-ion-label-md-h:not(.ion-color),.item-has-focus.label-floating.sc-ion-label-md-h:not(.ion-color),.item-has-focus .label-floating.sc-ion-label-md-h:not(.ion-color){color:var(--ion-color-primary, #3880ff)}.item-has-focus.ion-color.label-stacked.sc-ion-label-md-h:not(.ion-color),.item-has-focus.ion-color .label-stacked.sc-ion-label-md-h:not(.ion-color),.item-has-focus.ion-color.label-floating.sc-ion-label-md-h:not(.ion-color),.item-has-focus.ion-color .label-floating.sc-ion-label-md-h:not(.ion-color){color:var(--ion-color-contrast)}.sc-ion-label-md-s h1{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:24px;font-weight:normal}.sc-ion-label-md-s h2{margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:16px;font-weight:normal}.sc-ion-label-md-s h3,.sc-ion-label-md-s h4,.sc-ion-label-md-s h5,.sc-ion-label-md-s h6{margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:14px;font-weight:normal;line-height:normal}.sc-ion-label-md-s p{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:14px;line-height:20px;text-overflow:inherit;overflow:inherit}.sc-ion-label-md-s>p{color:var(--ion-color-step-600, #666666)}.sc-ion-label-md-h.in-item-color.sc-ion-label-md-s>p{color:inherit}"};const ct=class{constructor(e){t(this,e),this.inset=!1}async closeSlidingItems(){const t=this.el.querySelector("ion-item-sliding");return!(!t||!t.closeOpened)&&t.closeOpened()}render(){const t=l(this),{lines:i,inset:r}=this;return e(n,{class:{[t]:!0,[`list-${t}`]:!0,"list-inset":r,[`list-lines-${i}`]:void 0!==i,[`list-${t}-lines-${i}`]:void 0!==i}})}get el(){return i(this)}};ct.style={ios:"ion-list{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;display:block;contain:content;list-style-type:none}ion-list.list-inset{transform:translateZ(0);overflow:hidden}.list-ios{background:var(--ion-item-background, var(--ion-background-color, #fff))}.list-ios.list-inset{margin-left:16px;margin-right:16px;margin-top:16px;margin-bottom:16px;border-radius:4px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.list-ios.list-inset{margin-left:unset;margin-right:unset;-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:16px;margin-inline-end:16px}}.list-ios.list-inset ion-item{--border-width:0 0 1px 0;--inner-border-width:0}.list-ios.list-inset ion-item:last-child{--border-width:0;--inner-border-width:0}.list-ios.list-inset+ion-list.list-inset{margin-top:0}.list-ios-lines-none .item{--border-width:0;--inner-border-width:0}.list-ios-lines-full .item,.list-ios .item-lines-full{--border-width:0 0 0.55px 0}.list-ios-lines-full .item{--inner-border-width:0}.list-ios-lines-inset .item,.list-ios .item-lines-inset{--inner-border-width:0 0 0.55px 0}.list-ios .item-lines-inset{--border-width:0}.list-ios .item-lines-full{--inner-border-width:0}.list-ios .item-lines-none{--border-width:0;--inner-border-width:0}ion-card .list-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}",md:"ion-list{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;display:block;contain:content;list-style-type:none}ion-list.list-inset{transform:translateZ(0);overflow:hidden}.list-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:8px;padding-bottom:8px;background:var(--ion-item-background, var(--ion-background-color, #fff))}.list-md>.input:last-child::after{left:0}[dir=rtl] .list-md>.input:last-child::after,:host-context([dir=rtl]) .list-md>.input:last-child::after{left:unset;right:unset;right:0}.list-md.list-inset{margin-left:16px;margin-right:16px;margin-top:16px;margin-bottom:16px;border-radius:2px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.list-md.list-inset{margin-left:unset;margin-right:unset;-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:16px;margin-inline-end:16px}}.list-md.list-inset ion-item:first-child{--border-radius:2px 2px 0 0;--border-width:0 0 1px 0}.list-md.list-inset ion-item:last-child{--border-radius:0 0 2px, 2px;--border-width:0}.list-md.list-inset .item-interactive{--padding-start:0;--padding-end:0}.list-md.list-inset+ion-list.list-inset{margin-top:0}.list-md-lines-none .item{--border-width:0;--inner-border-width:0}.list-md-lines-full .item,.list-md .item-lines-full{--border-width:0 0 1px 0}.list-md-lines-full .item{--inner-border-width:0}.list-md-lines-inset .item,.list-md .item-lines-inset{--inner-border-width:0 0 1px 0}.list-md .item-lines-inset{--border-width:0}.list-md .item-lines-full{--inner-border-width:0}.list-md .item-lines-none{--border-width:0;--inner-border-width:0}ion-card .list-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}"};const ut=class{constructor(e){t(this,e),this.type="determinate",this.reversed=!1,this.value=0,this.buffer=1}render(){const{color:t,type:i,reversed:r,value:o,buffer:s}=this,a=h.getBoolean("_testing"),c=l(this);return e(n,{role:"progressbar","aria-valuenow":"determinate"===i?o:null,"aria-valuemin":"0","aria-valuemax":"1",class:f(t,{[c]:!0,[`progress-bar-${i}`]:!0,"progress-paused":a,"progress-bar-reversed":"rtl"===document.dir?!r:r})},"indeterminate"===i?lt():ht(o,s))}},lt=()=>e("div",{part:"track",class:"progress-buffer-bar"},e("div",{class:"indeterminate-bar-primary"},e("span",{part:"progress",class:"progress-indeterminate"})),e("div",{class:"indeterminate-bar-secondary"},e("span",{part:"progress",class:"progress-indeterminate"}))),ht=(t,n)=>{const i=w(0,t,1),r=w(0,n,1);return[e("div",{part:"progress",class:"progress",style:{transform:`scaleX(${i})`}}),e("div",{class:{"buffer-circles-container":!0,"ion-hide":1===r},style:{transform:`translateX(${100*r}%)`}},e("div",{class:"buffer-circles-container",style:{transform:`translateX(-${100*r}%)`}},e("div",{part:"stream",class:"buffer-circles"}))),e("div",{part:"track",class:"progress-buffer-bar",style:{transform:`scaleX(${r})`}})]};ut.style={ios:":host{--background:rgba(var(--ion-color-primary-rgb, 56, 128, 255), 0.3);--progress-background:var(--ion-color-primary, #3880ff);--buffer-background:var(--background);display:block;position:relative;width:100%;contain:strict;direction:ltr;overflow:hidden}.progress,.progress-indeterminate,.indeterminate-bar-primary,.indeterminate-bar-secondary,.progress-buffer-bar{left:0;right:0;top:0;bottom:0;position:absolute;width:100%;height:100%}.buffer-circles-container,.buffer-circles{left:0;right:0;top:0;bottom:0;position:absolute}.buffer-circles{right:-10px;left:-10px;}.progress,.progress-buffer-bar,.buffer-circles-container{transform-origin:left top;transition:transform 150ms linear}.progress,.progress-indeterminate{background:var(--progress-background);z-index:2}.progress-buffer-bar{background:var(--buffer-background);z-index:1}.buffer-circles-container{overflow:hidden}.indeterminate-bar-primary{top:0;right:0;bottom:0;left:-145.166611%;animation:primary-indeterminate-translate 2s infinite linear}.indeterminate-bar-primary .progress-indeterminate{animation:primary-indeterminate-scale 2s infinite linear;animation-play-state:inherit}.indeterminate-bar-secondary{top:0;right:0;bottom:0;left:-54.888891%;animation:secondary-indeterminate-translate 2s infinite linear}.indeterminate-bar-secondary .progress-indeterminate{animation:secondary-indeterminate-scale 2s infinite linear;animation-play-state:inherit}.buffer-circles{background-image:radial-gradient(ellipse at center, var(--buffer-background) 0%, var(--buffer-background) 30%, transparent 30%);background-repeat:repeat-x;background-position:5px center;background-size:10px 10px;z-index:0;animation:buffering 450ms infinite linear}:host(.progress-bar-reversed){transform:scaleX(-1)}:host(.progress-paused) .indeterminate-bar-secondary,:host(.progress-paused) .indeterminate-bar-primary,:host(.progress-paused) .buffer-circles{animation-play-state:paused}:host(.ion-color) .progress-buffer-bar{background:rgba(var(--ion-color-base-rgb), 0.3)}:host(.ion-color) .buffer-circles{background-image:radial-gradient(ellipse at center, rgba(var(--ion-color-base-rgb), 0.3) 0%, rgba(var(--ion-color-base-rgb), 0.3) 30%, transparent 30%)}:host(.ion-color) .progress,:host(.ion-color) .progress-indeterminate{background:var(--ion-color-base)}@keyframes primary-indeterminate-translate{0%{transform:translateX(0)}20%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(0)}59.15%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(83.67142%)}100%{transform:translateX(200.611057%)}}@keyframes primary-indeterminate-scale{0%{transform:scaleX(0.08)}36.65%{animation-timing-function:cubic-bezier(0.334731, 0.12482, 0.785844, 1);transform:scaleX(0.08)}69.15%{animation-timing-function:cubic-bezier(0.06, 0.11, 0.6, 1);transform:scaleX(0.661479)}100%{transform:scaleX(0.08)}}@keyframes secondary-indeterminate-translate{0%{animation-timing-function:cubic-bezier(0.15, 0, 0.515058, 0.409685);transform:translateX(0)}25%{animation-timing-function:cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);transform:translateX(37.651913%)}48.35%{animation-timing-function:cubic-bezier(0.4, 0.627035, 0.6, 0.902026);transform:translateX(84.386165%)}100%{transform:translateX(160.277782%)}}@keyframes secondary-indeterminate-scale{0%{animation-timing-function:cubic-bezier(0.205028, 0.057051, 0.57661, 0.453971);transform:scaleX(0.08)}19.15%{animation-timing-function:cubic-bezier(0.152313, 0.196432, 0.648374, 1.004315);transform:scaleX(0.457104)}44.15%{animation-timing-function:cubic-bezier(0.257759, -0.003163, 0.211762, 1.38179);transform:scaleX(0.72796)}100%{transform:scaleX(0.08)}}@keyframes buffering{to{transform:translateX(-10px)}}:host{height:3px}",md:":host{--background:rgba(var(--ion-color-primary-rgb, 56, 128, 255), 0.3);--progress-background:var(--ion-color-primary, #3880ff);--buffer-background:var(--background);display:block;position:relative;width:100%;contain:strict;direction:ltr;overflow:hidden}.progress,.progress-indeterminate,.indeterminate-bar-primary,.indeterminate-bar-secondary,.progress-buffer-bar{left:0;right:0;top:0;bottom:0;position:absolute;width:100%;height:100%}.buffer-circles-container,.buffer-circles{left:0;right:0;top:0;bottom:0;position:absolute}.buffer-circles{right:-10px;left:-10px;}.progress,.progress-buffer-bar,.buffer-circles-container{transform-origin:left top;transition:transform 150ms linear}.progress,.progress-indeterminate{background:var(--progress-background);z-index:2}.progress-buffer-bar{background:var(--buffer-background);z-index:1}.buffer-circles-container{overflow:hidden}.indeterminate-bar-primary{top:0;right:0;bottom:0;left:-145.166611%;animation:primary-indeterminate-translate 2s infinite linear}.indeterminate-bar-primary .progress-indeterminate{animation:primary-indeterminate-scale 2s infinite linear;animation-play-state:inherit}.indeterminate-bar-secondary{top:0;right:0;bottom:0;left:-54.888891%;animation:secondary-indeterminate-translate 2s infinite linear}.indeterminate-bar-secondary .progress-indeterminate{animation:secondary-indeterminate-scale 2s infinite linear;animation-play-state:inherit}.buffer-circles{background-image:radial-gradient(ellipse at center, var(--buffer-background) 0%, var(--buffer-background) 30%, transparent 30%);background-repeat:repeat-x;background-position:5px center;background-size:10px 10px;z-index:0;animation:buffering 450ms infinite linear}:host(.progress-bar-reversed){transform:scaleX(-1)}:host(.progress-paused) .indeterminate-bar-secondary,:host(.progress-paused) .indeterminate-bar-primary,:host(.progress-paused) .buffer-circles{animation-play-state:paused}:host(.ion-color) .progress-buffer-bar{background:rgba(var(--ion-color-base-rgb), 0.3)}:host(.ion-color) .buffer-circles{background-image:radial-gradient(ellipse at center, rgba(var(--ion-color-base-rgb), 0.3) 0%, rgba(var(--ion-color-base-rgb), 0.3) 30%, transparent 30%)}:host(.ion-color) .progress,:host(.ion-color) .progress-indeterminate{background:var(--ion-color-base)}@keyframes primary-indeterminate-translate{0%{transform:translateX(0)}20%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(0)}59.15%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(83.67142%)}100%{transform:translateX(200.611057%)}}@keyframes primary-indeterminate-scale{0%{transform:scaleX(0.08)}36.65%{animation-timing-function:cubic-bezier(0.334731, 0.12482, 0.785844, 1);transform:scaleX(0.08)}69.15%{animation-timing-function:cubic-bezier(0.06, 0.11, 0.6, 1);transform:scaleX(0.661479)}100%{transform:scaleX(0.08)}}@keyframes secondary-indeterminate-translate{0%{animation-timing-function:cubic-bezier(0.15, 0, 0.515058, 0.409685);transform:translateX(0)}25%{animation-timing-function:cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);transform:translateX(37.651913%)}48.35%{animation-timing-function:cubic-bezier(0.4, 0.627035, 0.6, 0.902026);transform:translateX(84.386165%)}100%{transform:translateX(160.277782%)}}@keyframes secondary-indeterminate-scale{0%{animation-timing-function:cubic-bezier(0.205028, 0.057051, 0.57661, 0.453971);transform:scaleX(0.08)}19.15%{animation-timing-function:cubic-bezier(0.152313, 0.196432, 0.648374, 1.004315);transform:scaleX(0.457104)}44.15%{animation-timing-function:cubic-bezier(0.257759, -0.003163, 0.211762, 1.38179);transform:scaleX(0.72796)}100%{transform:scaleX(0.08)}}@keyframes buffering{to{transform:translateX(-10px)}}:host{height:4px}"};const dt=class{constructor(e){t(this,e),this.type="bounded"}async addRipple(t,e){return new Promise((n=>{s((()=>{const i=this.el.getBoundingClientRect(),r=i.width,o=i.height,s=Math.sqrt(r*r+o*o),c=Math.max(o,r),u=this.unbounded?c:s+pt,l=Math.floor(c*vt),h=u/l;let d=t-i.left,f=e-i.top;this.unbounded&&(d=.5*r,f=.5*o);const p=d-.5*l,v=f-.5*l,g=.5*r-d,m=.5*o-f;a((()=>{const t=document.createElement("div");t.classList.add("ripple-effect");const e=t.style;e.top=v+"px",e.left=p+"px",e.width=e.height=l+"px",e.setProperty("--final-scale",`${h}`),e.setProperty("--translate-end",`${g}px, ${m}px`),(this.el.shadowRoot||this.el).appendChild(t),setTimeout((()=>{n((()=>{ft(t)}))}),325)}))}))}))}get unbounded(){return"unbounded"===this.type}render(){const t=l(this);return e(n,{role:"presentation",class:{[t]:!0,unbounded:this.unbounded}})}get el(){return i(this)}},ft=t=>{t.classList.add("fade-out"),setTimeout((()=>{t.remove()}),200)},pt=10,vt=.5;dt.style=":host{left:0;right:0;top:0;bottom:0;position:absolute;contain:strict;pointer-events:none}:host(.unbounded){contain:layout size style}.ripple-effect{border-radius:50%;position:absolute;background-color:currentColor;color:inherit;contain:strict;opacity:0;animation:225ms rippleAnimation forwards, 75ms fadeInAnimation forwards;will-change:transform, opacity;pointer-events:none}.fade-out{transform:translate(var(--translate-end)) scale(var(--final-scale, 1));animation:150ms fadeOutAnimation forwards}@keyframes rippleAnimation{from{animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:scale(1)}to{transform:translate(var(--translate-end)) scale(var(--final-scale, 1))}}@keyframes fadeInAnimation{from{animation-timing-function:linear;opacity:0}to{opacity:0.16}}@keyframes fadeOutAnimation{from{animation-timing-function:linear;opacity:0.16}to{opacity:0}}";const gt=class{constructor(e){t(this,e)}render(){return e(n,{class:l(this)},e("slot",null))}};gt.style=":host{display:flex;flex-wrap:wrap}";const mt=class{constructor(e){t(this,e),this.ionInput=r(this,"ionInput",7),this.ionChange=r(this,"ionChange",7),this.ionCancel=r(this,"ionCancel",7),this.ionClear=r(this,"ionClear",7),this.ionBlur=r(this,"ionBlur",7),this.ionFocus=r(this,"ionFocus",7),this.ionStyle=r(this,"ionStyle",7),this.isCancelVisible=!1,this.shouldAlignLeft=!0,this.focused=!1,this.noAnimate=!0,this.animated=!1,this.autocomplete="off",this.autocorrect="off",this.cancelButtonIcon=h.get("backButtonIcon","arrow-back-sharp"),this.cancelButtonText="Cancel",this.debounce=250,this.disabled=!1,this.placeholder="Search",this.showCancelButton="never",this.showClearButton="focus",this.spellcheck=!1,this.type="search",this.value="",this.onClearInput=(t,e)=>{this.ionClear.emit(),t&&(t.preventDefault(),t.stopPropagation()),setTimeout((()=>{""!==this.getValue()&&(this.value="",this.ionInput.emit(),e&&!this.focused&&this.setFocus())}),64)},this.onCancelSearchbar=t=>{t&&(t.preventDefault(),t.stopPropagation()),this.ionCancel.emit(),this.onClearInput(),this.nativeInput&&this.nativeInput.blur()},this.onInput=t=>{const e=t.target;e&&(this.value=e.value),this.ionInput.emit(t)},this.onBlur=()=>{this.focused=!1,this.ionBlur.emit(),this.positionElements()},this.onFocus=()=>{this.focused=!0,this.ionFocus.emit(),this.positionElements()}}debounceChanged(){this.ionChange=y(this.ionChange,this.debounce)}valueChanged(){const t=this.nativeInput,e=this.getValue();t&&t.value!==e&&(t.value=e),this.ionChange.emit({value:e})}showCancelButtonChanged(){requestAnimationFrame((()=>{this.positionElements(),o(this)}))}connectedCallback(){this.emitStyle()}componentDidLoad(){this.positionElements(),this.debounceChanged(),setTimeout((()=>{this.noAnimate=!1}),300)}emitStyle(){this.ionStyle.emit({searchbar:!0})}async setFocus(){this.nativeInput&&this.nativeInput.focus()}getInputElement(){return Promise.resolve(this.nativeInput)}positionElements(){const t=this.getValue(),e=this.shouldAlignLeft,n=l(this),i=!this.animated||""!==t.trim()||!!this.focused;this.shouldAlignLeft=i,"ios"===n&&(e!==i&&this.positionPlaceholder(),this.animated&&this.positionCancelButton())}positionPlaceholder(){const t=this.nativeInput;if(!t)return;const e="rtl"===document.dir,n=(this.el.shadowRoot||this.el).querySelector(".searchbar-search-icon");if(this.shouldAlignLeft)t.removeAttribute("style"),n.removeAttribute("style");else{const i=document,r=i.createElement("span");r.innerText=this.placeholder||"",i.body.appendChild(r),b((()=>{const i=r.offsetWidth;r.remove();const o="calc(50% - "+i/2+"px)",s="calc(50% - "+(i/2+30)+"px)";e?(t.style.paddingRight=o,n.style.marginRight=s):(t.style.paddingLeft=o,n.style.marginLeft=s)}))}}positionCancelButton(){const t="rtl"===document.dir,e=(this.el.shadowRoot||this.el).querySelector(".searchbar-cancel-button"),n=this.shouldShowCancelButton();if(e&&n!==this.isCancelVisible){const i=e.style;if(this.isCancelVisible=n,n)t?i.marginLeft="0":i.marginRight="0";else{const n=e.offsetWidth;n>0&&(t?i.marginLeft=-n+"px":i.marginRight=-n+"px")}}}getValue(){return this.value||""}hasValue(){return""!==this.getValue()}shouldShowCancelButton(){return!("never"===this.showCancelButton||"focus"===this.showCancelButton&&!this.focused)}shouldShowClearButton(){return!("never"===this.showClearButton||"focus"===this.showClearButton&&!this.focused)}render(){const{cancelButtonText:t}=this,i=this.animated&&h.getBoolean("animated",!0),r=l(this),o=this.clearIcon||("ios"===r?"close-circle":"close-sharp"),s=this.searchIcon||("ios"===r?"search-outline":"search-sharp"),a=this.shouldShowCancelButton(),c="never"!==this.showCancelButton&&e("button",{"aria-label":t,"aria-hidden":a?void 0:"true",type:"button",tabIndex:"ios"!==r||a?void 0:-1,onMouseDown:this.onCancelSearchbar,onTouchStart:this.onCancelSearchbar,class:"searchbar-cancel-button"},e("div",{"aria-hidden":"true"},"md"===r?e("ion-icon",{"aria-hidden":"true",mode:r,icon:this.cancelButtonIcon,lazy:!1}):t));return e(n,{role:"search","aria-disabled":this.disabled?"true":null,class:f(this.color,{[r]:!0,"searchbar-animated":i,"searchbar-disabled":this.disabled,"searchbar-no-animate":i&&this.noAnimate,"searchbar-has-value":this.hasValue(),"searchbar-left-aligned":this.shouldAlignLeft,"searchbar-has-focus":this.focused,"searchbar-should-show-clear":this.shouldShowClearButton(),"searchbar-should-show-cancel":this.shouldShowCancelButton()})},e("div",{class:"searchbar-input-container"},e("input",{"aria-label":"search text",disabled:this.disabled,ref:t=>this.nativeInput=t,class:"searchbar-input",inputMode:this.inputmode,enterKeyHint:this.enterkeyhint,onInput:this.onInput,onBlur:this.onBlur,onFocus:this.onFocus,placeholder:this.placeholder,type:this.type,value:this.getValue(),autoComplete:this.autocomplete,autoCorrect:this.autocorrect,spellcheck:this.spellcheck}),"md"===r&&c,e("ion-icon",{"aria-hidden":"true",mode:r,icon:s,lazy:!1,class:"searchbar-search-icon"}),e("button",{"aria-label":"reset",type:"button","no-blur":!0,class:"searchbar-clear-button",onMouseDown:t=>this.onClearInput(t,!0),onTouchStart:t=>this.onClearInput(t,!0)},e("ion-icon",{"aria-hidden":"true",mode:r,icon:o,lazy:!1,class:"searchbar-clear-icon"}))),"ios"===r&&c)}get el(){return i(this)}static get watchers(){return{debounce:["debounceChanged"],value:["valueChanged"],showCancelButton:["showCancelButtonChanged"]}}};mt.style={ios:".sc-ion-searchbar-ios-h{--placeholder-color:initial;--placeholder-font-style:initial;--placeholder-font-weight:initial;--placeholder-opacity:.5;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:flex;position:relative;align-items:center;width:100%;color:var(--color);font-family:var(--ion-font-family, inherit);box-sizing:border-box}.ion-color.sc-ion-searchbar-ios-h{color:var(--ion-color-contrast)}.ion-color.sc-ion-searchbar-ios-h .searchbar-input.sc-ion-searchbar-ios{background:var(--ion-color-base)}.ion-color.sc-ion-searchbar-ios-h .searchbar-clear-button.sc-ion-searchbar-ios,.ion-color.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios,.ion-color.sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios{color:inherit}.searchbar-search-icon.sc-ion-searchbar-ios{color:var(--icon-color);pointer-events:none}.searchbar-input-container.sc-ion-searchbar-ios{display:block;position:relative;flex-shrink:1;width:100%}.searchbar-input.sc-ion-searchbar-ios{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;border-radius:var(--border-radius);display:block;width:100%;border:0;outline:none;background:var(--background);font-family:inherit;box-shadow:var(--box-shadow);box-sizing:border-box;appearance:none}.searchbar-input.sc-ion-searchbar-ios::placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.searchbar-input.sc-ion-searchbar-ios::-webkit-search-cancel-button,.searchbar-input.sc-ion-searchbar-ios::-ms-clear{display:none}.searchbar-cancel-button.sc-ion-searchbar-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:none;height:100%;border:0;outline:none;color:var(--cancel-button-color);cursor:pointer;appearance:none}.searchbar-cancel-button.sc-ion-searchbar-ios>div.sc-ion-searchbar-ios{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.searchbar-clear-button.sc-ion-searchbar-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;display:none;min-height:0;outline:none;color:var(--clear-button-color);appearance:none}.searchbar-has-value.searchbar-should-show-clear.sc-ion-searchbar-ios-h .searchbar-clear-button.sc-ion-searchbar-ios{display:block}.searchbar-disabled.sc-ion-searchbar-ios-h{cursor:default;opacity:0.4;pointer-events:none}.sc-ion-searchbar-ios-h{--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.07);--border-radius:10px;--box-shadow:none;--cancel-button-color:var(--ion-color-primary, #3880ff);--clear-button-color:var(--ion-color-step-600, #666666);--color:var(--ion-text-color, #000);--icon-color:var(--ion-color-step-600, #666666);padding-left:12px;padding-right:12px;padding-top:12px;padding-bottom:12px;height:60px;contain:strict}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.sc-ion-searchbar-ios-h{padding-left:unset;padding-right:unset;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px}}.searchbar-input-container.sc-ion-searchbar-ios{height:36px}.searchbar-search-icon.sc-ion-searchbar-ios{margin-left:calc(50% - 60px);left:5px;top:0;position:absolute;width:22px;height:100%;contain:strict}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.searchbar-search-icon.sc-ion-searchbar-ios{margin-left:unset;-webkit-margin-start:calc(50% - 60px);margin-inline-start:calc(50% - 60px)}}[dir=rtl].sc-ion-searchbar-ios .searchbar-search-icon.sc-ion-searchbar-ios,[dir=rtl].sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios,[dir=rtl] .sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios{left:unset;right:unset;right:5px}.searchbar-input.sc-ion-searchbar-ios{padding-left:28px;padding-right:28px;padding-top:0;padding-bottom:0;height:100%;font-size:17px;font-weight:400;contain:strict}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.searchbar-input.sc-ion-searchbar-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:28px;padding-inline-start:28px;-webkit-padding-end:28px;padding-inline-end:28px}}.searchbar-clear-button.sc-ion-searchbar-ios{right:0;top:0;background-position:center;position:absolute;width:30px;height:100%;border:0;background-color:transparent}[dir=rtl].sc-ion-searchbar-ios .searchbar-clear-button.sc-ion-searchbar-ios,[dir=rtl].sc-ion-searchbar-ios-h .searchbar-clear-button.sc-ion-searchbar-ios,[dir=rtl] .sc-ion-searchbar-ios-h .searchbar-clear-button.sc-ion-searchbar-ios{left:unset;right:unset;left:0}.searchbar-clear-icon.sc-ion-searchbar-ios{width:18px;height:100%}.searchbar-cancel-button.sc-ion-searchbar-ios{padding-left:8px;padding-right:0;padding-top:0;padding-bottom:0;flex-shrink:0;background-color:transparent;font-size:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.searchbar-cancel-button.sc-ion-searchbar-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:0;padding-inline-end:0}}.searchbar-left-aligned.sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios{margin-left:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.searchbar-left-aligned.sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios{margin-left:unset;-webkit-margin-start:0;margin-inline-start:0}}.searchbar-left-aligned.sc-ion-searchbar-ios-h .searchbar-input.sc-ion-searchbar-ios{padding-left:30px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.searchbar-left-aligned.sc-ion-searchbar-ios-h .searchbar-input.sc-ion-searchbar-ios{padding-left:unset;-webkit-padding-start:30px;padding-inline-start:30px}}.searchbar-has-focus.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios,.searchbar-should-show-cancel.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios,.searchbar-animated.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios{display:block}.searchbar-animated.sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios,.searchbar-animated.sc-ion-searchbar-ios-h .searchbar-input.sc-ion-searchbar-ios{transition:all 300ms ease}.searchbar-animated.searchbar-has-focus.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios,.searchbar-animated.searchbar-should-show-cancel.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios{opacity:1;pointer-events:auto}.searchbar-animated.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios{margin-right:-100%;transform:translate3d(0, 0, 0);transition:all 300ms ease;opacity:0;pointer-events:none}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.searchbar-animated.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios{margin-right:unset;-webkit-margin-end:-100%;margin-inline-end:-100%}}.searchbar-no-animate.sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios,.searchbar-no-animate.sc-ion-searchbar-ios-h .searchbar-input.sc-ion-searchbar-ios,.searchbar-no-animate.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios{transition-duration:0ms}.ion-color.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios{color:var(--ion-color-base)}@media (any-hover: hover){.ion-color.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios:hover{color:var(--ion-color-tint)}}ion-toolbar.sc-ion-searchbar-ios-h,ion-toolbar .sc-ion-searchbar-ios-h{padding-top:1px;padding-bottom:15px;height:52px}ion-toolbar.ion-color.sc-ion-searchbar-ios-h:not(.ion-color),ion-toolbar.ion-color .sc-ion-searchbar-ios-h:not(.ion-color){color:inherit}ion-toolbar.ion-color.sc-ion-searchbar-ios-h:not(.ion-color) .searchbar-cancel-button.sc-ion-searchbar-ios,ion-toolbar.ion-color .sc-ion-searchbar-ios-h:not(.ion-color) .searchbar-cancel-button.sc-ion-searchbar-ios{color:currentColor}ion-toolbar.ion-color.sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios,ion-toolbar.ion-color .sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios{color:currentColor;opacity:0.5}ion-toolbar.ion-color.sc-ion-searchbar-ios-h:not(.ion-color) .searchbar-input.sc-ion-searchbar-ios,ion-toolbar.ion-color .sc-ion-searchbar-ios-h:not(.ion-color) .searchbar-input.sc-ion-searchbar-ios{background:rgba(var(--ion-color-contrast-rgb), 0.07);color:currentColor}ion-toolbar.ion-color.sc-ion-searchbar-ios-h:not(.ion-color) .searchbar-clear-button.sc-ion-searchbar-ios,ion-toolbar.ion-color .sc-ion-searchbar-ios-h:not(.ion-color) .searchbar-clear-button.sc-ion-searchbar-ios{color:currentColor;opacity:0.5}",md:".sc-ion-searchbar-md-h{--placeholder-color:initial;--placeholder-font-style:initial;--placeholder-font-weight:initial;--placeholder-opacity:.5;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:flex;position:relative;align-items:center;width:100%;color:var(--color);font-family:var(--ion-font-family, inherit);box-sizing:border-box}.ion-color.sc-ion-searchbar-md-h{color:var(--ion-color-contrast)}.ion-color.sc-ion-searchbar-md-h .searchbar-input.sc-ion-searchbar-md{background:var(--ion-color-base)}.ion-color.sc-ion-searchbar-md-h .searchbar-clear-button.sc-ion-searchbar-md,.ion-color.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md,.ion-color.sc-ion-searchbar-md-h .searchbar-search-icon.sc-ion-searchbar-md{color:inherit}.searchbar-search-icon.sc-ion-searchbar-md{color:var(--icon-color);pointer-events:none}.searchbar-input-container.sc-ion-searchbar-md{display:block;position:relative;flex-shrink:1;width:100%}.searchbar-input.sc-ion-searchbar-md{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;border-radius:var(--border-radius);display:block;width:100%;border:0;outline:none;background:var(--background);font-family:inherit;box-shadow:var(--box-shadow);box-sizing:border-box;appearance:none}.searchbar-input.sc-ion-searchbar-md::placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.searchbar-input.sc-ion-searchbar-md::-webkit-search-cancel-button,.searchbar-input.sc-ion-searchbar-md::-ms-clear{display:none}.searchbar-cancel-button.sc-ion-searchbar-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:none;height:100%;border:0;outline:none;color:var(--cancel-button-color);cursor:pointer;appearance:none}.searchbar-cancel-button.sc-ion-searchbar-md>div.sc-ion-searchbar-md{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.searchbar-clear-button.sc-ion-searchbar-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;display:none;min-height:0;outline:none;color:var(--clear-button-color);appearance:none}.searchbar-has-value.searchbar-should-show-clear.sc-ion-searchbar-md-h .searchbar-clear-button.sc-ion-searchbar-md{display:block}.searchbar-disabled.sc-ion-searchbar-md-h{cursor:default;opacity:0.4;pointer-events:none}.sc-ion-searchbar-md-h{--background:var(--ion-background-color, #fff);--border-radius:2px;--box-shadow:0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12);--cancel-button-color:var(--ion-color-step-900, #1a1a1a);--clear-button-color:initial;--color:var(--ion-color-step-850, #262626);--icon-color:var(--ion-color-step-600, #666666);padding-left:8px;padding-right:8px;padding-top:8px;padding-bottom:8px;background:inherit}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.sc-ion-searchbar-md-h{padding-left:unset;padding-right:unset;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px}}.searchbar-search-icon.sc-ion-searchbar-md{left:16px;top:11px;width:21px;height:21px}[dir=rtl].sc-ion-searchbar-md .searchbar-search-icon.sc-ion-searchbar-md,[dir=rtl].sc-ion-searchbar-md-h .searchbar-search-icon.sc-ion-searchbar-md,[dir=rtl] .sc-ion-searchbar-md-h .searchbar-search-icon.sc-ion-searchbar-md{left:unset;right:unset;right:16px}.searchbar-cancel-button.sc-ion-searchbar-md{left:5px;top:0;background-color:transparent;font-size:1.6em}[dir=rtl].sc-ion-searchbar-md .searchbar-cancel-button.sc-ion-searchbar-md,[dir=rtl].sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md,[dir=rtl] .sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md{left:unset;right:unset;right:5px}.searchbar-search-icon.sc-ion-searchbar-md,.searchbar-cancel-button.sc-ion-searchbar-md{position:absolute}.searchbar-search-icon.ion-activated.sc-ion-searchbar-md,.searchbar-cancel-button.ion-activated.sc-ion-searchbar-md{background-color:transparent}.searchbar-input.sc-ion-searchbar-md{padding-left:55px;padding-right:55px;padding-top:6px;padding-bottom:6px;background-position:left 8px center;height:auto;font-size:16px;font-weight:400;line-height:30px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.searchbar-input.sc-ion-searchbar-md{padding-left:unset;padding-right:unset;-webkit-padding-start:55px;padding-inline-start:55px;-webkit-padding-end:55px;padding-inline-end:55px}}[dir=rtl].sc-ion-searchbar-md .searchbar-input.sc-ion-searchbar-md,[dir=rtl].sc-ion-searchbar-md-h .searchbar-input.sc-ion-searchbar-md,[dir=rtl] .sc-ion-searchbar-md-h .searchbar-input.sc-ion-searchbar-md{background-position:right 8px center}.searchbar-clear-button.sc-ion-searchbar-md{right:13px;top:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;position:absolute;height:100%;border:0;background-color:transparent}[dir=rtl].sc-ion-searchbar-md .searchbar-clear-button.sc-ion-searchbar-md,[dir=rtl].sc-ion-searchbar-md-h .searchbar-clear-button.sc-ion-searchbar-md,[dir=rtl] .sc-ion-searchbar-md-h .searchbar-clear-button.sc-ion-searchbar-md{left:unset;right:unset;left:13px}.searchbar-clear-button.ion-activated.sc-ion-searchbar-md{background-color:transparent}.searchbar-clear-icon.sc-ion-searchbar-md{width:22px;height:100%}.searchbar-has-focus.sc-ion-searchbar-md-h .searchbar-search-icon.sc-ion-searchbar-md{display:block}.searchbar-has-focus.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md,.searchbar-should-show-cancel.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md{display:block}.searchbar-has-focus.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md+.searchbar-search-icon.sc-ion-searchbar-md,.searchbar-should-show-cancel.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md+.searchbar-search-icon.sc-ion-searchbar-md{display:none}ion-toolbar.sc-ion-searchbar-md-h,ion-toolbar .sc-ion-searchbar-md-h{padding-left:7px;padding-right:7px;padding-top:3px;padding-bottom:3px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){ion-toolbar.sc-ion-searchbar-md-h,ion-toolbar .sc-ion-searchbar-md-h{padding-left:unset;padding-right:unset;-webkit-padding-start:7px;padding-inline-start:7px;-webkit-padding-end:7px;padding-inline-end:7px}}"};const wt=class{constructor(e){t(this,e),this.animated=!1}render(){const t=this.animated&&h.getBoolean("animated",!0),i=v("ion-avatar",this.el)||v("ion-thumbnail",this.el),r=l(this);return e(n,{class:{[r]:!0,"skeleton-text-animated":t,"in-media":i}},e("span",null," "))}get el(){return i(this)}};wt.style=":host{--background:rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.065);border-radius:var(--border-radius, inherit);display:block;width:100%;height:inherit;margin-top:4px;margin-bottom:4px;background:var(--background);line-height:10px;user-select:none;pointer-events:none}span{display:inline-block}:host(.in-media){margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;height:100%}:host(.skeleton-text-animated){position:relative;background:linear-gradient(to right, rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.065) 8%, rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.135) 18%, rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.065) 33%);background-size:800px 104px;animation-duration:1s;animation-fill-mode:forwards;animation-iteration-count:infinite;animation-name:shimmer;animation-timing-function:linear}@keyframes shimmer{0%{background-position:-400px 0}100%{background-position:400px 0}}";const bt=class{constructor(e){t(this,e),this.ionStyle=r(this,"ionStyle",7)}sizeChanged(){this.emitStyle()}connectedCallback(){this.emitStyle()}emitStyle(){const t=this.getSize();this.ionStyle.emit({[`title-${t}`]:!0})}getSize(){return void 0!==this.size?this.size:"default"}render(){const t=l(this),i=this.getSize();return e(n,{class:f(this.color,{[t]:!0,[`title-${i}`]:!0,"title-rtl":"rtl"===document.dir})},e("div",{class:"toolbar-title"},e("slot",null)))}get el(){return i(this)}static get watchers(){return{size:["sizeChanged"]}}};bt.style={ios:":host{--color:initial;display:flex;flex:1;align-items:center;transform:translateZ(0);color:var(--color)}:host(.ion-color){color:var(--ion-color-base)}.toolbar-title{display:block;width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;pointer-events:auto}:host(.title-small) .toolbar-title{white-space:normal}:host{left:0;top:0;padding-left:90px;padding-right:90px;padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);position:absolute;width:100%;height:100%;transform:translateZ(0);font-size:17px;font-weight:600;text-align:center;box-sizing:border-box;pointer-events:none}:host-context([dir=rtl]){left:unset;right:unset;right:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:90px;padding-inline-start:90px;-webkit-padding-end:90px;padding-inline-end:90px}}:host(.title-small){padding-left:9px;padding-right:9px;padding-top:6px;padding-bottom:16px;position:relative;font-size:13px;font-weight:normal}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.title-small){padding-left:unset;padding-right:unset;-webkit-padding-start:9px;padding-inline-start:9px;-webkit-padding-end:9px;padding-inline-end:9px}}:host(.title-large){padding-left:16px;padding-right:16px;padding-top:0;padding-bottom:0;transform-origin:left center;bottom:0;align-items:flex-end;min-width:100%;padding-bottom:6px;font-size:34px;font-weight:700;text-align:start}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.title-large){padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}:host(.title-large.title-rtl){transform-origin:right center}:host(.title-large.ion-cloned-element){--color:var(--ion-text-color, #000)}:host(.title-large) .toolbar-title{transform-origin:inherit}:host-context([dir=rtl]):host(.title-large) .toolbar-title,:host-context([dir=rtl]).title-large .toolbar-title{transform-origin:calc(100% - inherit)}",md:":host{--color:initial;display:flex;flex:1;align-items:center;transform:translateZ(0);color:var(--color)}:host(.ion-color){color:var(--ion-color-base)}.toolbar-title{display:block;width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;pointer-events:auto}:host(.title-small) .toolbar-title{white-space:normal}:host{padding-left:20px;padding-right:20px;padding-top:0;padding-bottom:0;font-size:20px;font-weight:500;letter-spacing:0.0125em}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:20px;padding-inline-end:20px}}:host(.title-small){width:100%;height:100%;font-size:15px;font-weight:normal}"};const yt=class{constructor(e){t(this,e),this.childrenStyles=new Map}componentWillLoad(){const t=Array.from(this.el.querySelectorAll("ion-buttons")),e=t.find((t=>"start"===t.slot));e&&e.classList.add("buttons-first-slot");const n=t.reverse(),i=n.find((t=>"end"===t.slot))||n.find((t=>"primary"===t.slot))||n.find((t=>"secondary"===t.slot));i&&i.classList.add("buttons-last-slot")}childrenStyle(t){t.stopPropagation();const e=t.target.tagName,n=t.detail,i={},r=this.childrenStyles.get(e)||{};let s=!1;Object.keys(n).forEach((t=>{const e=`toolbar-${t}`,o=n[t];o!==r[e]&&(s=!0),o&&(i[e]=!0)})),s&&(this.childrenStyles.set(e,i),o(this))}render(){const t=l(this),i={};return this.childrenStyles.forEach((t=>{Object.assign(i,t)})),e(n,{class:Object.assign(Object.assign({},i),f(this.color,{[t]:!0,"in-toolbar":v("ion-toolbar",this.el)}))},e("div",{class:"toolbar-background"}),e("div",{class:"toolbar-container"},e("slot",{name:"start"}),e("slot",{name:"secondary"}),e("div",{class:"toolbar-content"},e("slot",null)),e("slot",{name:"primary"}),e("slot",{name:"end"})))}get el(){return i(this)}};yt.style={ios:":host{--border-width:0;--border-style:solid;--opacity:1;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;padding-left:var(--ion-safe-area-left);padding-right:var(--ion-safe-area-right);display:block;position:relative;width:100%;color:var(--color);font-family:var(--ion-font-family, inherit);contain:content;z-index:10;box-sizing:border-box}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-safe-area-left);padding-inline-start:var(--ion-safe-area-left);-webkit-padding-end:var(--ion-safe-area-right);padding-inline-end:var(--ion-safe-area-right)}}:host(.ion-color){color:var(--ion-color-contrast)}:host(.ion-color) .toolbar-background{background:var(--ion-color-base)}.toolbar-container{padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:flex;position:relative;flex-direction:row;align-items:center;justify-content:space-between;width:100%;min-height:var(--min-height);contain:content;overflow:hidden;z-index:10;box-sizing:border-box}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.toolbar-container{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.toolbar-background{left:0;right:0;top:0;bottom:0;position:absolute;transform:translateZ(0);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);contain:strict;opacity:var(--opacity);z-index:-1;pointer-events:none}::slotted(ion-progress-bar){left:0;right:0;bottom:0;position:absolute}:host{--background:var(--ion-toolbar-background, var(--ion-color-step-50, #fff));--color:var(--ion-toolbar-color, var(--ion-text-color, #000));--border-color:var(--ion-toolbar-border-color, var(--ion-border-color, var(--ion-color-step-150, rgba(0, 0, 0, 0.2))));--padding-top:3px;--padding-bottom:3px;--padding-start:4px;--padding-end:4px;--min-height:44px}.toolbar-content{flex:1;order:4;min-width:0}:host(.toolbar-segment) .toolbar-content{display:inline-flex}:host(.toolbar-searchbar) .toolbar-container{padding-top:0;padding-bottom:0}:host(.toolbar-searchbar) ::slotted(*){align-self:start}:host(.toolbar-searchbar) ::slotted(ion-chip){margin-top:3px}:host(.toolbar-searchbar) ::slotted(ion-back-button){height:38px}::slotted(ion-buttons){min-height:38px}::slotted([slot=start]){order:2}::slotted([slot=secondary]){order:3}::slotted([slot=primary]){order:5;text-align:end}::slotted([slot=end]){order:6;text-align:end}:host(.toolbar-title-large) .toolbar-container{flex-wrap:wrap;align-items:flex-start}:host(.toolbar-title-large) .toolbar-content ion-title{flex:1;order:8;min-width:100%}",md:":host{--border-width:0;--border-style:solid;--opacity:1;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;padding-left:var(--ion-safe-area-left);padding-right:var(--ion-safe-area-right);display:block;position:relative;width:100%;color:var(--color);font-family:var(--ion-font-family, inherit);contain:content;z-index:10;box-sizing:border-box}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-safe-area-left);padding-inline-start:var(--ion-safe-area-left);-webkit-padding-end:var(--ion-safe-area-right);padding-inline-end:var(--ion-safe-area-right)}}:host(.ion-color){color:var(--ion-color-contrast)}:host(.ion-color) .toolbar-background{background:var(--ion-color-base)}.toolbar-container{padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:flex;position:relative;flex-direction:row;align-items:center;justify-content:space-between;width:100%;min-height:var(--min-height);contain:content;overflow:hidden;z-index:10;box-sizing:border-box}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.toolbar-container{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.toolbar-background{left:0;right:0;top:0;bottom:0;position:absolute;transform:translateZ(0);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);contain:strict;opacity:var(--opacity);z-index:-1;pointer-events:none}::slotted(ion-progress-bar){left:0;right:0;bottom:0;position:absolute}:host{--background:var(--ion-toolbar-background, var(--ion-background-color, #fff));--color:var(--ion-toolbar-color, var(--ion-text-color, #424242));--border-color:var(--ion-toolbar-border-color, var(--ion-border-color, var(--ion-color-step-150, #c1c4cd)));--padding-top:0;--padding-bottom:0;--padding-start:0;--padding-end:0;--min-height:56px}.toolbar-content{flex:1;order:3;min-width:0;max-width:100%}::slotted(ion-segment){min-height:var(--min-height)}::slotted(.buttons-first-slot){margin-left:4px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(.buttons-first-slot){margin-left:unset;-webkit-margin-start:4px;margin-inline-start:4px}}::slotted(.buttons-last-slot){margin-right:4px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(.buttons-last-slot){margin-right:unset;-webkit-margin-end:4px;margin-inline-end:4px}}::slotted([slot=start]){order:2}::slotted([slot=secondary]){order:4}::slotted([slot=primary]){order:5;text-align:end}::slotted([slot=end]){order:6;text-align:end}"};const xt=t=>!("isConnected"in t)||t.isConnected,kt=(()=>{let t;return(...e)=>{t&&clearTimeout(t),t=setTimeout((()=>{t=0,(t=>{for(let e of t.keys())t.set(e,t.get(e).filter(xt))})(...e)}),2e3)}})(),Et=(t,e)=>{const n=((t,e=((t,e)=>t!==e))=>{let n=new Map(Object.entries(null!=t?t:{}));const i={dispose:[],get:[],set:[],reset:[]},r=()=>{n=new Map(Object.entries(null!=t?t:{})),i.reset.forEach((t=>t()))},o=t=>(i.get.forEach((e=>e(t))),n.get(t)),s=(t,r)=>{const o=n.get(t);e(r,o,t)&&(n.set(t,r),i.set.forEach((e=>e(t,r,o))))},a="undefined"==typeof Proxy?{}:new Proxy(t,{get:(t,e)=>o(e),ownKeys:()=>Array.from(n.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(t,e)=>n.has(e),set:(t,e,n)=>(s(e,n),!0)}),c=(t,e)=>(i[t].push(e),()=>{((t,e)=>{const n=t.indexOf(e);n>=0&&(t[n]=t[t.length-1],t.length--)})(i[t],e)});return{state:a,get:o,set:s,on:c,onChange:(e,n)=>{const i=c("set",((t,i)=>{t===e&&n(i)})),r=c("reset",(()=>n(t[e])));return()=>{i(),r()}},use:(...t)=>{const e=t.reduce(((t,e)=>(e.set&&t.push(c("set",e.set)),e.get&&t.push(c("get",e.get)),e.reset&&t.push(c("reset",e.reset)),e.dispose&&t.push(c("dispose",e.dispose)),t)),[]);return()=>e.forEach((t=>t()))},dispose:()=>{i.dispose.forEach((t=>t())),r()},reset:r,forceUpdate:t=>{const e=n.get(t);i.set.forEach((n=>n(t,e,e)))}}})(t,e);return n.use((()=>{if("function"!=typeof u)return{};const t=new Map;return{dispose:()=>t.clear(),get:e=>{const n=u();n&&((t,e,n)=>{const i=t.get(e);i?i.includes(n)||i.push(n):t.set(e,[n])})(t,e,n)},set:e=>{const n=t.get(e);n&&t.set(e,n.filter(o)),kt(t)},reset:()=>{t.forEach((t=>t.forEach(o))),kt(t)}}})()),n},St=Et({getIdpUrl:()=>prompt("Please enter your Identity Provider URL","http://localhost:3000"),isLoggedIn:!1,webId:""});var Ft,At,_t,jt,Ct,Rt,It=Object.create,Tt=Object.defineProperty,Ot=Object.defineProperties,Nt=Object.getOwnPropertyDescriptor,Pt=Object.getOwnPropertyDescriptors,Dt=Object.getOwnPropertyNames,Mt=Object.getOwnPropertySymbols,Ut=Object.getPrototypeOf,Lt=Object.prototype.hasOwnProperty,Bt=Object.prototype.propertyIsEnumerable,Jt=(t,e,n)=>e in t?Tt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,$t=(t,e)=>{for(var n in e||={})Lt.call(e,n)&&Jt(t,n,e[n]);if(Mt)for(var n of Mt(e))Bt.call(e,n)&&Jt(t,n,e[n]);return t},Ht=(t,e)=>Ot(t,Pt(e)),zt=(t,e)=>function(){return t&&(e=(0,t[Dt(t)[0]])(t=0)),e},Kt=(t,e)=>function(){return e||(0,t[Dt(t)[0]])((e={exports:{}}).exports,e),e.exports},Wt=(t,e)=>{for(var n in e)Tt(t,n,{get:e[n],enumerable:!0})},qt=(t,e,n,i)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let r of Dt(e))Lt.call(t,r)||r===n||Tt(t,r,{get:()=>e[r],enumerable:!(i=Nt(e,r))||i.enumerable});return t},Vt=(t,e,n)=>(n=null!=t?It(Ut(t)):{},qt(!e&&t&&t.__esModule?n:Tt(n,"default",{value:t,enumerable:!0}),t)),Gt=t=>qt(Tt({},"__esModule",{value:!0}),t),Xt=(t,e,n)=>new Promise(((i,r)=>{var o=t=>{try{a(n.next(t))}catch(t){r(t)}},s=t=>{try{a(n.throw(t))}catch(t){r(t)}},a=t=>t.done?i(t.value):Promise.resolve(t.value).then(o,s);a((n=n.apply(t,e)).next())})),Yt=Kt({"../node_modules/events/events.js"(t,e){var n,i="object"==typeof Reflect?Reflect:null,r=i&&"function"==typeof i.apply?i.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!=t};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(t,e){return new Promise((function(n,i){function r(n){t.removeListener(e,o),i(n)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",r),n([].slice.call(arguments))}g(t,e,o,{once:!0}),"error"!==e&&function(t,e){"function"==typeof t.on&&g(t,"error",e,{once:!0})}(t,r)}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function c(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function l(t,e,n,i){var r,o,s;if(c(n),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),o=t._events),s=o[e]),void 0===s)s=o[e]=n,++t._eventsCount;else if("function"==typeof s?s=o[e]=i?[n,s]:[s,n]:i?s.unshift(n):s.push(n),(r=u(t))>0&&s.length>r&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=s.length,console&&console.warn&&console.warn(a)}return t}function h(){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(t,e,n){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},r=h.bind(i);return r.listener=n,i.wrapFn=r,r}function f(t,e,n){var i=t._events;if(void 0===i)return[];var r=i[e];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(r):v(r,r.length)}function p(t){var e=this._events;if(void 0!==e){var n=e[t];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function v(t,e){for(var n=new Array(e),i=0;i<e;++i)n[i]=t[i];return n}function g(t,e,n,i){if("function"==typeof t.on)i.once?t.once(e,n):t.on(e,n);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function r(o){i.once&&t.removeEventListener(e,r),n(o)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");a=t}}),s.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},s.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var i="error"===t,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=o[t];if(void 0===c)return!1;if("function"==typeof c)r(c,this,e);else{var u=c.length,l=v(c,u);for(n=0;n<u;++n)r(l[n],this,e)}return!0},s.prototype.on=s.prototype.addListener=function(t,e){return l(this,t,e,!1)},s.prototype.prependListener=function(t,e){return l(this,t,e,!0)},s.prototype.once=function(t,e){return c(e),this.on(t,d(this,t,e)),this},s.prototype.prependOnceListener=function(t,e){return c(e),this.prependListener(t,d(this,t,e)),this},s.prototype.off=s.prototype.removeListener=function(t,e){var n,i,r,o,s;if(c(e),void 0===(i=this._events))return this;if(void 0===(n=i[t]))return this;if(n===e||n.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(r=-1,o=n.length-1;o>=0;o--)if(n[o]===e||n[o].listener===e){s=n[o].listener,r=o;break}if(r<0)return this;0===r?n.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(n,r),1===n.length&&(i[t]=n[0]),void 0!==i.removeListener&&this.emit("removeListener",t,s||e)}return this},s.prototype.removeAllListeners=function(t){var e,n,i;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[t]),this;if(0===arguments.length){var r,o=Object.keys(n);for(i=0;i<o.length;++i)"removeListener"!==(r=o[i])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(void 0!==e)for(i=e.length-1;i>=0;i--)this.removeListener(t,e[i]);return this},s.prototype.listeners=function(t){return f(this,t,!0)},s.prototype.rawListeners=function(t){return f(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):p.call(t,e)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}}}),Zt=Kt({"../node_modules/@inrupt/solid-client-authn-core/dist/constant.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_SCOPES=t.REFRESH_BEFORE_EXPIRATION_SECONDS=t.EVENTS=t.PREFERRED_SIGNING_ALG=t.SOLID_CLIENT_AUTHN_KEY_PREFIX=void 0,t.SOLID_CLIENT_AUTHN_KEY_PREFIX="solidClientAuthn:",t.PREFERRED_SIGNING_ALG=["ES256","RS256"],t.EVENTS={ERROR:"error",LOGIN:"login",LOGOUT:"logout",NEW_REFRESH_TOKEN:"newRefreshToken",SESSION_EXPIRED:"sessionExpired",SESSION_EXTENDED:"sessionExtended",SESSION_RESTORED:"sessionRestore",TIMEOUT_SET:"timeoutSet"},t.REFRESH_BEFORE_EXPIRATION_SECONDS=5,t.DEFAULT_SCOPES=["openid","offline_access","webid"].join(" ")}}),Qt=Kt({"../node_modules/@inrupt/solid-client-authn-core/dist/errors/InruptError.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=class extends Error{constructor(t,n,i=!0){super("string"==typeof t?e.substituteParams(t,n):e.appendErrorIri(e.lookupErrorIri(t,n),t,i))}httpResponse(t,n=!0){return this.message=e.appendHttpResponseDetails(this.message,t,n),this.httpErrorResponse=t,this}hasHttpResponse(){return void 0!==this.httpErrorResponse}getHttpResponse(){return this.httpErrorResponse}getHttpStatusCode(){if(void 0===this.httpErrorResponse)throw new e("This InruptError was not provided with a HTTP response - so we can't get its HTTP Status Code.");return this.httpErrorResponse.status}getHttpStatusText(){if(void 0===this.httpErrorResponse)throw new e("This InruptError was not provided with a HTTP response - so we can't get its HTTP Status Text!");return this.httpErrorResponse.statusText}static determineIfVocabTerm(t){return void 0!==t.strict}static lookupErrorIri(t,n){if(e.determineIfVocabTerm(t)){const e=void 0===n?t.message:t.messageParams(...n);return void 0===e?`Looked up error message IRI [${t.value}], but found no message value.`:e}return`Error message looked up at: [${t.value}]${void 0===n?"":`, with params [${n.toString()}]`}`}static appendHttpResponseDetails(t,e,n){return n&&void 0!==e?`${t} HTTP details: status code [${e.status}], status text [${e.statusText}].`:t}static appendErrorIri(t,e,n){return n?`${t} Error IRI: [${e.value}].`:t}static substituteParams(t,e){let n=t;if(void 0!==e){const i=t.split("{{").length-1;if(i!==e.length)throw new Error(`Setting parameters on message [${t}], but it requires [${i}] params and we received [${e.length}].`);for(let t=0;t<e.length;t+=1)n=n.replace(`{{${t}}}`,e[t])}return n}};t.default=e}}),te=Kt({"../node_modules/@inrupt/solid-client-authn-core/dist/util/handlerPattern/AggregateHandler.js"(t){var e=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0});var n=e(Qt());t.default=class{constructor(t){this.handleables=t}async getProperHandler(t){const e=await Promise.all(this.handleables.map((e=>e.canHandle(...t))));for(let t=0;t<e.length;t+=1)if(e[t])return this.handleables[t];return null}async canHandle(...t){return null!==await this.getProperHandler(t)}async handle(...t){const e=await this.getProperHandler(t);if(e)return e.handle(...t);throw new n.default(`[${this.constructor.name}] cannot find a suitable handler for: ${t.map((t=>{try{return JSON.stringify(t)}catch(e){return t.toString()}})).join(", ")}`)}}}}),ee=Kt({"../node_modules/cross-fetch/dist/browser-ponyfill.js"(t,e){var n,i="undefined"!=typeof self?self:t,r=function(){function t(){this.fetch=!1,this.DOMException=i.DOMException}return t.prototype=i,new t}();n=r,function(t){var e="URLSearchParams"in n,i="Symbol"in n&&"iterator"in Symbol,r="FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(t){return!1}}(),o="FormData"in n,s="ArrayBuffer"in n;if(s)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(t){return t&&a.indexOf(Object.prototype.toString.call(t))>-1};function u(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function l(t){return"string"!=typeof t&&(t=String(t)),t}function h(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return i&&(e[Symbol.iterator]=function(){return e}),e}function d(t){this.map={},t instanceof d?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function f(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function p(t){return new Promise((function(e,n){t.onload=function(){e(t.result)},t.onerror=function(){n(t.error)}}))}function v(t){var e=new FileReader,n=p(e);return e.readAsArrayBuffer(t),n}function g(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(t){var n;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:r&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:o&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:e&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():s&&r&&(n=t)&&DataView.prototype.isPrototypeOf(n)?(this._bodyArrayBuffer=g(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(t)||c(t))?this._bodyArrayBuffer=g(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):e&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r&&(this.blob=function(){var t=f(this);if(t)return t;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(v)}),this.text=function(){var t,e,n,i=f(this);if(i)return i;if(this._bodyBlob)return t=this._bodyBlob,n=p(e=new FileReader),e.readAsText(t),n;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),n=new Array(e.length),i=0;i<e.length;i++)n[i]=String.fromCharCode(e[i]);return n.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(y)}),this.json=function(){return this.text().then(JSON.parse)},this}d.prototype.append=function(t,e){t=u(t),e=l(e);var n=this.map[t];this.map[t]=n?n+", "+e:e},d.prototype.delete=function(t){delete this.map[u(t)]},d.prototype.get=function(t){return t=u(t),this.has(t)?this.map[t]:null},d.prototype.has=function(t){return this.map.hasOwnProperty(u(t))},d.prototype.set=function(t,e){this.map[u(t)]=l(e)},d.prototype.forEach=function(t,e){for(var n in this.map)this.map.hasOwnProperty(n)&&t.call(e,this.map[n],n,this)},d.prototype.keys=function(){var t=[];return this.forEach((function(e,n){t.push(n)})),h(t)},d.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),h(t)},d.prototype.entries=function(){var t=[];return this.forEach((function(e,n){t.push([n,e])})),h(t)},i&&(d.prototype[Symbol.iterator]=d.prototype.entries);var w=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(t,e){var n,i,r=(e=e||{}).body;if(t instanceof b){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new d(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,r||null==t._bodyInit||(r=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new d(e.headers)),this.method=(i=(n=e.method||this.method||"GET").toUpperCase(),w.indexOf(i)>-1?i:n),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function y(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var n=t.split("="),i=n.shift().replace(/\+/g," "),r=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(i),decodeURIComponent(r))}})),e}function x(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new d(e.headers),this.url=e.url||"",this._initBody(t)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},m.call(b.prototype),m.call(x.prototype),x.prototype.clone=function(){return new x(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},x.error=function(){var t=new x(null,{status:0,statusText:""});return t.type="error",t};var k=[301,302,303,307,308];x.redirect=function(t,e){if(-1===k.indexOf(e))throw new RangeError("Invalid status code");return new x(null,{status:e,headers:{location:t}})},t.DOMException=n.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(t,e){this.message=t,this.name=e;var n=Error(t);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function E(e,n){return new Promise((function(i,o){var s=new b(e,n);if(s.signal&&s.signal.aborted)return o(new t.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function c(){a.abort()}a.onload=function(){var t,e,n={status:a.status,statusText:a.statusText,headers:(t=a.getAllResponseHeaders()||"",e=new d,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var n=t.split(":"),i=n.shift().trim();if(i){var r=n.join(":").trim();e.append(i,r)}})),e)};n.url="responseURL"in a?a.responseURL:n.headers.get("X-Request-URL"),i(new x("response"in a?a.response:a.responseText,n))},a.onerror=function(){o(new TypeError("Network request failed"))},a.ontimeout=function(){o(new TypeError("Network request failed"))},a.onabort=function(){o(new t.DOMException("Aborted","AbortError"))},a.open(s.method,s.url,!0),"include"===s.credentials?a.withCredentials=!0:"omit"===s.credentials&&(a.withCredentials=!1),"responseType"in a&&r&&(a.responseType="blob"),s.headers.forEach((function(t,e){a.setRequestHeader(e,t)})),s.signal&&(s.signal.addEventListener("abort",c),a.onreadystatechange=function(){4===a.readyState&&s.signal.removeEventListener("abort",c)}),a.send(void 0===s._bodyInit?null:s._bodyInit)}))}E.polyfill=!0,n.fetch||(n.fetch=E,n.Headers=d,n.Request=b,n.Response=x),t.Headers=d,t.Request=b,t.Response=x,t.fetch=E,Object.defineProperty(t,"__esModule",{value:!0})}({}),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var o=r;(t=o.fetch).default=o.fetch,t.fetch=o.fetch,t.Headers=o.Headers,t.Request=o.Request,t.Response=o.Response,e.exports=t}}),ne=zt({"../node_modules/jose/dist/browser/runtime/webcrypto.js"(){Ft=crypto,At=t=>t instanceof CryptoKey}}),ie=zt({"../node_modules/jose/dist/browser/runtime/digest.js"(){ne(),_t=async(t,e)=>{const n=`SHA-${t.slice(-3)}`;return new Uint8Array(await Ft.subtle.digest(n,e))}}});function re(...t){const e=t.reduce(((t,{length:e})=>t+e),0),n=new Uint8Array(e);let i=0;return t.forEach((t=>{n.set(t,i),i+=t.length})),n}function oe(t,e,n){if(e<0||e>=Rt)throw new RangeError(`value must be >= 0 and <= ${Rt-1}. Received ${e}`);t.set([e>>>24,e>>>16,e>>>8,255&e],n)}function se(t){const e=Math.floor(t/Rt),n=t%Rt,i=new Uint8Array(8);return oe(i,e,0),oe(i,n,4),i}function ae(t){const e=new Uint8Array(4);return oe(e,t),e}function ce(t){return re(ae(t.length),t)}var ue,le,he,de,fe,pe,ve,ge,me,we,be,ye,xe,ke,Ee,Se,Fe,Ae,_e,je=zt({"../node_modules/jose/dist/browser/lib/buffer_utils.js"(){ie(),jt=new TextEncoder,Ct=new TextDecoder,Rt=2**32}}),Ce=zt({"../node_modules/jose/dist/browser/runtime/base64url.js"(){je(),ue=t=>{let e=t;"string"==typeof e&&(e=jt.encode(e));const n=[];for(let t=0;t<e.length;t+=32768)n.push(String.fromCharCode.apply(null,e.subarray(t,t+32768)));return btoa(n.join(""))},le=t=>ue(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),he=t=>{const e=atob(t),n=new Uint8Array(e.length);for(let t=0;t<e.length;t++)n[t]=e.charCodeAt(t);return n},de=t=>{let e=t;e instanceof Uint8Array&&(e=Ct.decode(e)),e=e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return he(e)}catch(t){throw new TypeError("The input to be decoded is not correctly encoded.")}}}}),Re={};Wt(Re,{JOSEAlgNotAllowed:()=>ge,JOSEError:()=>fe,JOSENotSupported:()=>me,JWEDecryptionFailed:()=>we,JWEInvalid:()=>be,JWKInvalid:()=>ke,JWKSInvalid:()=>Ee,JWKSMultipleMatchingKeys:()=>Fe,JWKSNoMatchingKey:()=>Se,JWKSTimeout:()=>Ae,JWSInvalid:()=>ye,JWSSignatureVerificationFailed:()=>_e,JWTClaimValidationFailed:()=>pe,JWTExpired:()=>ve,JWTInvalid:()=>xe});var Ie,Te,Oe=zt({"../node_modules/jose/dist/browser/util/errors.js"(){fe=class extends Error{constructor(t){var e;super(t),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,null===(e=Error.captureStackTrace)||void 0===e||e.call(Error,this,this.constructor)}static get code(){return"ERR_JOSE_GENERIC"}},pe=class extends fe{constructor(t,e="unspecified",n="unspecified"){super(t),this.code="ERR_JWT_CLAIM_VALIDATION_FAILED",this.claim=e,this.reason=n}static get code(){return"ERR_JWT_CLAIM_VALIDATION_FAILED"}},ve=class extends fe{constructor(t,e="unspecified",n="unspecified"){super(t),this.code="ERR_JWT_EXPIRED",this.claim=e,this.reason=n}static get code(){return"ERR_JWT_EXPIRED"}},ge=class extends fe{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}static get code(){return"ERR_JOSE_ALG_NOT_ALLOWED"}},me=class extends fe{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}static get code(){return"ERR_JOSE_NOT_SUPPORTED"}},we=class extends fe{constructor(){super(...arguments),this.code="ERR_JWE_DECRYPTION_FAILED",this.message="decryption operation failed"}static get code(){return"ERR_JWE_DECRYPTION_FAILED"}},be=class extends fe{constructor(){super(...arguments),this.code="ERR_JWE_INVALID"}static get code(){return"ERR_JWE_INVALID"}},ye=class extends fe{constructor(){super(...arguments),this.code="ERR_JWS_INVALID"}static get code(){return"ERR_JWS_INVALID"}},xe=class extends fe{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}static get code(){return"ERR_JWT_INVALID"}},ke=class extends fe{constructor(){super(...arguments),this.code="ERR_JWK_INVALID"}static get code(){return"ERR_JWK_INVALID"}},Ee=class extends fe{constructor(){super(...arguments),this.code="ERR_JWKS_INVALID"}static get code(){return"ERR_JWKS_INVALID"}},Se=class extends fe{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"}},Fe=class extends fe{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"}},Ae=class extends fe{constructor(){super(...arguments),this.code="ERR_JWKS_TIMEOUT",this.message="request timed out"}static get code(){return"ERR_JWKS_TIMEOUT"}},_e=class extends fe{constructor(){super(...arguments),this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED",this.message="signature verification failed"}static get code(){return"ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}}}}),Ne=zt({"../node_modules/jose/dist/browser/runtime/random.js"(){ne(),Ie=Ft.getRandomValues.bind(Ft)}});function Pe(t){switch(t){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 me(`Unsupported JWE Algorithm: ${t}`)}}var De,Me,Ue,Le=zt({"../node_modules/jose/dist/browser/lib/iv.js"(){Oe(),Ne(),Te=t=>Ie(new Uint8Array(Pe(t)>>3))}}),Be=zt({"../node_modules/jose/dist/browser/lib/check_iv_length.js"(){Oe(),Le(),De=(t,e)=>{if(e.length<<3!==Pe(t))throw new be("Invalid Initialization Vector length")}}}),Je=zt({"../node_modules/jose/dist/browser/runtime/check_cek_length.js"(){Oe(),Me=(t,e)=>{const n=t.byteLength<<3;if(n!==e)throw new be(`Invalid Content Encryption Key length. Expected ${e} bits, got ${n} bits`)}}}),$e=zt({"../node_modules/jose/dist/browser/runtime/timing_safe_equal.js"(){Ue=(t,e)=>{if(!(t instanceof Uint8Array))throw new TypeError("First argument must be a buffer");if(!(e instanceof Uint8Array))throw new TypeError("Second argument must be a buffer");if(t.length!==e.length)throw new TypeError("Input buffers must have the same length");const n=t.length;let i=0,r=-1;for(;++r<n;)i|=t[r]^e[r];return 0===i}}});function He(){return"undefined"!=typeof WebSocketPair||"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||"undefined"!=typeof EdgeRuntime&&"vercel"===EdgeRuntime}var ze=zt({"../node_modules/jose/dist/browser/runtime/env.js"(){}});function Ke(t,e="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${e} must be ${t}`)}function We(t,e){return t.name===e}function qe(t){return parseInt(t.name.slice(4),10)}function Ve(t,e){if(e.length&&!e.some((e=>t.usages.includes(e)))){let t="CryptoKey does not support this operation, its usages must include ";if(e.length>2){const n=e.pop();t+=`one of ${e.join(", ")}, or ${n}.`}else t+=2===e.length?`one of ${e[0]} or ${e[1]}.`:`${e[0]}.`;throw new TypeError(t)}}function Ge(t,e,...n){switch(e){case"A128GCM":case"A192GCM":case"A256GCM":{if(!We(t.algorithm,"AES-GCM"))throw Ke("AES-GCM");const n=parseInt(e.slice(1,4),10);if(t.algorithm.length!==n)throw Ke(n,"algorithm.length");break}case"A128KW":case"A192KW":case"A256KW":{if(!We(t.algorithm,"AES-KW"))throw Ke("AES-KW");const n=parseInt(e.slice(1,4),10);if(t.algorithm.length!==n)throw Ke(n,"algorithm.length");break}case"ECDH":switch(t.algorithm.name){case"ECDH":case"X25519":case"X448":break;default:throw Ke("ECDH, X25519, or X448")}break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(!We(t.algorithm,"PBKDF2"))throw Ke("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(!We(t.algorithm,"RSA-OAEP"))throw Ke("RSA-OAEP");const n=parseInt(e.slice(9),10)||1;if(qe(t.algorithm.hash)!==n)throw Ke(`SHA-${n}`,"algorithm.hash");break}default:throw new TypeError("CryptoKey does not support this operation")}Ve(t,n)}var Xe,Ye=zt({"../node_modules/jose/dist/browser/lib/crypto_key.js"(){ze()}});function Ze(t,e,...n){if(n.length>2){const e=n.pop();t+=`one of type ${n.join(", ")}, or ${e}.`}else t+=2===n.length?`one of type ${n[0]} or ${n[1]}.`:`of type ${n[0]}.`;return null==e?t+=` Received ${e}`:"function"==typeof e&&e.name?t+=` Received function ${e.name}`:"object"==typeof e&&null!=e&&e.constructor&&e.constructor.name&&(t+=` Received an instance of ${e.constructor.name}`),t}function Qe(t,e,...n){return Ze(`Key for the ${t} algorithm must be `,e,...n)}var tn,en,nn,rn,on,sn,an=zt({"../node_modules/jose/dist/browser/lib/invalid_key_input.js"(){Xe=(t,...e)=>Ze("Key must be ",t,...e)}}),cn=zt({"../node_modules/jose/dist/browser/runtime/is_key_like.js"(){ne(),tn=t=>At(t),en=["CryptoKey"]}}),un=zt({"../node_modules/jose/dist/browser/runtime/decrypt.js"(){je(),Be(),Je(),$e(),Oe(),ne(),Ye(),an(),cn(),nn=async(t,e,n,i,r,o)=>{if(!(At(e)||e instanceof Uint8Array))throw new TypeError(Xe(e,...en,"Uint8Array"));switch(De(t,i),t){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return e instanceof Uint8Array&&Me(e,parseInt(t.slice(-3),10)),async function(t,e,n,i,r,o){if(!(e instanceof Uint8Array))throw new TypeError(Xe(e,"Uint8Array"));const s=parseInt(t.slice(1,4),10),a=await Ft.subtle.importKey("raw",e.subarray(s>>3),"AES-CBC",!1,["decrypt"]),c=await Ft.subtle.importKey("raw",e.subarray(0,s>>3),{hash:"SHA-"+(s<<1),name:"HMAC"},!1,["sign"]),u=re(o,i,n,se(o.length<<3)),l=new Uint8Array((await Ft.subtle.sign("HMAC",c,u)).slice(0,s>>3));let h,d;try{h=Ue(r,l)}catch(t){}if(!h)throw new we;try{d=new Uint8Array(await Ft.subtle.decrypt({iv:i,name:"AES-CBC"},a,n))}catch(t){}if(!d)throw new we;return d}(t,e,n,i,r,o);case"A128GCM":case"A192GCM":case"A256GCM":return e instanceof Uint8Array&&Me(e,parseInt(t.slice(1,4),10)),async function(t,e,n,i,r,o){let s;e instanceof Uint8Array?s=await Ft.subtle.importKey("raw",e,"AES-GCM",!1,["decrypt"]):(Ge(e,t,"decrypt"),s=e);try{return new Uint8Array(await Ft.subtle.decrypt({additionalData:o,iv:i,name:"AES-GCM",tagLength:128},s,re(n,r)))}catch(t){throw new we}}(t,e,n,i,r,o);default:throw new me("Unsupported JWE Content Encryption Algorithm")}}}}),ln=zt({"../node_modules/jose/dist/browser/runtime/zlib.js"(){Oe(),rn=async()=>{throw new me('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.')},on=async()=>{throw new me('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.')}}}),hn=zt({"../node_modules/jose/dist/browser/lib/is_disjoint.js"(){sn=(...t)=>{const e=t.filter(Boolean);if(0===e.length||1===e.length)return!0;let n;for(const t of e){const e=Object.keys(t);if(n&&0!==n.size)for(const t of e){if(n.has(t))return!1;n.add(t)}else n=new Set(e)}return!0}}});function dn(t){if("object"!=typeof(e=t)||null===e||"[object Object]"!==Object.prototype.toString.call(t))return!1;var e;if(null===Object.getPrototypeOf(t))return!0;let n=t;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(t)===n}var fn,pn,vn,gn=zt({"../node_modules/jose/dist/browser/lib/is_object.js"(){}}),mn=zt({"../node_modules/jose/dist/browser/runtime/bogus.js"(){fn=[{hash:"SHA-256",name:"HMAC"},!0,["sign"]]}});function wn(t,e){if(t.algorithm.length!==parseInt(e.slice(1,4),10))throw new TypeError(`Invalid key size for alg: ${e}`)}function bn(t,e,n){if(At(t))return Ge(t,e,n),t;if(t instanceof Uint8Array)return Ft.subtle.importKey("raw",t,"AES-KW",!0,[n]);throw new TypeError(Xe(t,...en,"Uint8Array"))}var yn=zt({"../node_modules/jose/dist/browser/runtime/aeskw.js"(){mn(),ne(),Ye(),an(),cn(),pn=async(t,e,n)=>{const i=await bn(e,t,"wrapKey");wn(i,t);const r=await Ft.subtle.importKey("raw",n,...fn);return new Uint8Array(await Ft.subtle.wrapKey("raw",r,i,"AES-KW"))},vn=async(t,e,n)=>{const i=await bn(e,t,"unwrapKey");wn(i,t);const r=await Ft.subtle.unwrapKey("raw",n,i,"AES-KW",...fn);return new Uint8Array(await Ft.subtle.exportKey("raw",r))}}});async function xn(t,e,n,i,r=new Uint8Array(0),o=new Uint8Array(0)){if(!At(t))throw new TypeError(Xe(t,...en));if(Ge(t,"ECDH"),!At(e))throw new TypeError(Xe(e,...en));Ge(e,"ECDH","deriveBits");const s=re(ce(jt.encode(n)),ce(r),ce(o),ae(i));let a;return a="X25519"===t.algorithm.name?256:"X448"===t.algorithm.name?448:Math.ceil(parseInt(t.algorithm.namedCurve.substr(-3),10)/8)<<3,async function(t,e,n){const i=Math.ceil((e>>3)/32),r=new Uint8Array(32*i);for(let e=0;e<i;e++){const i=new Uint8Array(4+t.length+n.length);i.set(ae(e+1)),i.set(t,4),i.set(n,4+t.length),r.set(await _t("sha256",i),32*e)}return r.slice(0,e>>3)}(new Uint8Array(await Ft.subtle.deriveBits({name:t.algorithm.name,public:t},e,a)),i,s)}function kn(t){if(!At(t))throw new TypeError(Xe(t,...en));return["P-256","P-384","P-521"].includes(t.algorithm.namedCurve)||"X25519"===t.algorithm.name||"X448"===t.algorithm.name}var En,Sn,Fn=zt({"../node_modules/jose/dist/browser/runtime/ecdhes.js"(){je(),ne(),Ye(),an(),cn()}}),An=zt({"../node_modules/jose/dist/browser/lib/check_p2s.js"(){Oe()}});async function _n(t,e,n,i){!function(t){if(!(t instanceof Uint8Array)||t.length<8)throw new be("PBES2 Salt Input must be 8 or more octets")}(t);const r=function(t,e){return re(jt.encode(t),new Uint8Array([0]),e)}(e,t),o=parseInt(e.slice(13,16),10),s={hash:`SHA-${e.slice(8,11)}`,iterations:n,name:"PBKDF2",salt:r},a={length:o,name:"AES-KW"},c=await function(t,e){if(t instanceof Uint8Array)return Ft.subtle.importKey("raw",t,"PBKDF2",!1,["deriveBits"]);if(At(t))return Ge(t,e,"deriveBits","deriveKey"),t;throw new TypeError(Xe(t,...en,"Uint8Array"))}(i,e);if(c.usages.includes("deriveBits"))return new Uint8Array(await Ft.subtle.deriveBits(s,c,o));if(c.usages.includes("deriveKey"))return Ft.subtle.deriveKey(s,c,a,!1,["wrapKey","unwrapKey"]);throw new TypeError('PBKDF2 key "usages" must include "deriveBits" or "deriveKey"')}var jn=zt({"../node_modules/jose/dist/browser/runtime/pbes2kw.js"(){Ne(),je(),Ce(),yn(),An(),ne(),Ye(),an(),cn(),En=async(t,e,n,i=2048,r=Ie(new Uint8Array(16)))=>{const o=await _n(r,t,i,e);return{encryptedKey:await pn(t.slice(-6),o,n),p2c:i,p2s:le(r)}},Sn=async(t,e,n,i,r)=>{const o=await _n(r,t,i,e);return vn(t.slice(-6),o,n)}}});function Cn(t){switch(t){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return"RSA-OAEP";default:throw new me(`alg ${t} is not supported either by JOSE or your javascript runtime`)}}var Rn,In,Tn,On,Nn=zt({"../node_modules/jose/dist/browser/runtime/subtle_rsaes.js"(){Oe()}}),Pn=zt({"../node_modules/jose/dist/browser/runtime/check_key_length.js"(){Rn=(t,e)=>{if(t.startsWith("RS")||t.startsWith("PS")){const{modulusLength:n}=e.algorithm;if("number"!=typeof n||n<2048)throw new TypeError(`${t} requires key modulusLength to be 2048 bits or larger`)}}}}),Dn=zt({"../node_modules/jose/dist/browser/runtime/rsaes.js"(){Nn(),mn(),ne(),Ye(),Pn(),an(),cn(),In=async(t,e,n)=>{if(!At(e))throw new TypeError(Xe(e,...en));if(Ge(e,t,"encrypt","wrapKey"),Rn(t,e),e.usages.includes("encrypt"))return new Uint8Array(await Ft.subtle.encrypt(Cn(t),e,n));if(e.usages.includes("wrapKey")){const i=await Ft.subtle.importKey("raw",n,...fn);return new Uint8Array(await Ft.subtle.wrapKey("raw",i,e,Cn(t)))}throw new TypeError('RSA-OAEP key "usages" must include "encrypt" or "wrapKey" for this operation')},Tn=async(t,e,n)=>{if(!At(e))throw new TypeError(Xe(e,...en));if(Ge(e,t,"decrypt","unwrapKey"),Rn(t,e),e.usages.includes("decrypt"))return new Uint8Array(await Ft.subtle.decrypt(Cn(t),e,n));if(e.usages.includes("unwrapKey")){const i=await Ft.subtle.unwrapKey("raw",n,e,Cn(t),...fn);return new Uint8Array(await Ft.subtle.exportKey("raw",i))}throw new TypeError('RSA-OAEP key "usages" must include "decrypt" or "unwrapKey" for this operation')}}});function Mn(t){switch(t){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 me(`Unsupported JWE Algorithm: ${t}`)}}var Un,Ln,Bn,Jn,$n,Hn,zn,Kn,Wn,qn,Vn=zt({"../node_modules/jose/dist/browser/lib/cek.js"(){Oe(),Ne(),On=t=>Ie(new Uint8Array(Mn(t)>>3))}}),Gn=zt({"../node_modules/jose/dist/browser/lib/format_pem.js"(){Un=(t,e)=>`-----BEGIN ${e}-----\n${(t.match(/.{1,64}/g)||[]).join("\n")}\n-----END ${e}-----`}}),Xn=zt({"../node_modules/jose/dist/browser/runtime/asn1.js"(){ze(),ne(),an(),Ce(),Gn(),Oe(),cn(),Ln=async(t,e,n)=>{if(!At(n))throw new TypeError(Xe(n,...en));if(!n.extractable)throw new TypeError("CryptoKey is not extractable");if(n.type!==t)throw new TypeError(`key is not a ${t} key`);return Un(ue(new Uint8Array(await Ft.subtle.exportKey(e,n))),`${t.toUpperCase()} KEY`)},Bn=t=>Ln("public","spki",t),Jn=t=>Ln("private","pkcs8",t),$n=(t,e,n=0)=>{0===n&&(e.unshift(e.length),e.unshift(6));let i=t.indexOf(e[0],n);if(-1===i)return!1;const r=t.subarray(i,i+e.length);return r.length===e.length&&(r.every(((t,n)=>t===e[n]))||$n(t,e,i+1))},Hn=t=>{switch(!0){case $n(t,[42,134,72,206,61,3,1,7]):return"P-256";case $n(t,[43,129,4,0,34]):return"P-384";case $n(t,[43,129,4,0,35]):return"P-521";case $n(t,[43,101,110]):return"X25519";case $n(t,[43,101,111]):return"X448";case $n(t,[43,101,112]):return"Ed25519";case $n(t,[43,101,113]):return"Ed448";default:throw new me("Invalid or unsupported EC Key Curve or OKP Key Sub Type")}},zn=async(t,e,n,i,r)=>{var o;let s,a;const c=new Uint8Array(atob(n.replace(t,"")).split("").map((t=>t.charCodeAt(0)))),u="spki"===e;switch(i){case"PS256":case"PS384":case"PS512":s={name:"RSA-PSS",hash:`SHA-${i.slice(-3)}`},a=u?["verify"]:["sign"];break;case"RS256":case"RS384":case"RS512":s={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${i.slice(-3)}`},a=u?["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(i.slice(-3),10)||1}`},a=u?["encrypt","wrapKey"]:["decrypt","unwrapKey"];break;case"ES256":s={name:"ECDSA",namedCurve:"P-256"},a=u?["verify"]:["sign"];break;case"ES384":s={name:"ECDSA",namedCurve:"P-384"},a=u?["verify"]:["sign"];break;case"ES512":s={name:"ECDSA",namedCurve:"P-521"},a=u?["verify"]:["sign"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{const t=Hn(c);s=t.startsWith("P-")?{name:"ECDH",namedCurve:t}:{name:t},a=u?[]:["deriveBits"];break}case He()&&"EdDSA":{const t=Hn(c).toUpperCase();s={name:`NODE-${t}`,namedCurve:`NODE-${t}`},a=u?["verify"]:["sign"];break}case"EdDSA":s={name:Hn(c)},a=u?["verify"]:["sign"];break;default:throw new me('Invalid or unsupported "alg" (Algorithm) value')}return Ft.subtle.importKey(e,c,s,null!==(o=null==r?void 0:r.extractable)&&void 0!==o&&o,a)},Kn=(t,e,n)=>zn(/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g,"pkcs8",t,e,n),Wn=(t,e,n)=>zn(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g,"spki",t,e,n)}}),Yn=zt({"../node_modules/jose/dist/browser/runtime/jwk_to_key.js"(){ze(),ne(),Oe(),Ce(),qn=async t=>{var e,n;const{algorithm:i,keyUsages:r}=function(t){let e,n;switch(t.kty){case"oct":switch(t.alg){case"HS256":case"HS384":case"HS512":e={name:"HMAC",hash:`SHA-${t.alg.slice(-3)}`},n=["sign","verify"];break;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":throw new me(`${t.alg} keys cannot be imported as CryptoKey instances`);case"A128GCM":case"A192GCM":case"A256GCM":case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":e={name:"AES-GCM"},n=["encrypt","decrypt"];break;case"A128KW":case"A192KW":case"A256KW":e={name:"AES-KW"},n=["wrapKey","unwrapKey"];break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":e={name:"PBKDF2"},n=["deriveBits"];break;default:throw new me('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"RSA":switch(t.alg){case"PS256":case"PS384":case"PS512":e={name:"RSA-PSS",hash:`SHA-${t.alg.slice(-3)}`},n=t.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":e={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${t.alg.slice(-3)}`},n=t.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":e={name:"RSA-OAEP",hash:`SHA-${parseInt(t.alg.slice(-3),10)||1}`},n=t.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new me('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"EC":switch(t.alg){case"ES256":e={name:"ECDSA",namedCurve:"P-256"},n=t.d?["sign"]:["verify"];break;case"ES384":e={name:"ECDSA",namedCurve:"P-384"},n=t.d?["sign"]:["verify"];break;case"ES512":e={name:"ECDSA",namedCurve:"P-521"},n=t.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":e={name:"ECDH",namedCurve:t.crv},n=t.d?["deriveBits"]:[];break;default:throw new me('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case He()&&"OKP":if("EdDSA"!==t.alg)throw new me('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');switch(t.crv){case"Ed25519":e={name:"NODE-ED25519",namedCurve:"NODE-ED25519"},n=t.d?["sign"]:["verify"];break;default:throw new me('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"OKP":switch(t.alg){case"EdDSA":e={name:t.crv},n=t.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":e={name:t.crv},n=t.d?["deriveBits"]:[];break;default:throw new me('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new me('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:e,keyUsages:n}}(t),o=[i,null!==(e=t.ext)&&void 0!==e&&e,null!==(n=t.key_ops)&&void 0!==n?n:r];if("PBKDF2"===i.name)return Ft.subtle.importKey("raw",de(t.k),...o);const s={...t};return delete s.alg,Ft.subtle.importKey("jwk",s,...o)}}});function Zn(t){let e=[],n=0;for(;n<t.length;){let i=Qn(t.subarray(n));e.push(i),n+=i.byteLength}return e}function Qn(t){let e=0,n=31&t[0];if(e++,31===n){for(n=0;t[e]>=128;)n=128*n+t[e]-128,e++;n=128*n+t[e]-128,e++}let i=0;if(t[e]<128)i=t[e],e++;else{if(128===i){for(i=0;0!==t[e+i]||0!==t[e+i+1];){if(i>t.byteLength)throw new TypeError("invalid indefinite form length");i++}const n=e+i+2;return{byteLength:n,contents:t.subarray(e,e+i),raw:t.subarray(0,n)}}{let n=127&t[e];e++,i=0;for(let r=0;r<n;r++)i=256*i+t[e],e++}}const r=e+i;return{byteLength:r,contents:t.subarray(e,r),raw:t.subarray(0,r)}}async function ti(t,e,n){if("string"!=typeof t||0!==t.indexOf("-----BEGIN PUBLIC KEY-----"))throw new TypeError('"spki" must be SPKI formatted string');return Wn(t,e,n)}async function ei(t,e,n){if("string"!=typeof t||0!==t.indexOf("-----BEGIN CERTIFICATE-----"))throw new TypeError('"x509" must be X.509 formatted string');let i;try{i=function(t){const e=t.replace(/(?:-----(?:BEGIN|END) CERTIFICATE-----|\s)/g,""),n=he(e);return Un(function(t){const e=Zn(Zn(Qn(t).contents)[0].contents);return ue(e[160===e[0].raw[0]?6:5].raw)}(n),"PUBLIC KEY")}(t)}catch(t){throw new TypeError("failed to parse the X.509 certificate",{cause:t})}return Wn(i,e,n)}async function ni(t,e,n){if("string"!=typeof t||0!==t.indexOf("-----BEGIN PRIVATE KEY-----"))throw new TypeError('"pkcs8" must be PCKS8 formatted string');return Kn(t,e,n)}async function ii(t,e,n){if(!dn(t))throw new TypeError("JWK must be an object");if(e||(e=t.alg),"string"!=typeof e||!e)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');switch(t.kty){case"oct":if("string"!=typeof t.k||!t.k)throw new TypeError('missing "k" (Key Value) Parameter value');return null!=n||(n=!0!==t.ext),n?qn({...t,alg:e,ext:!1}):de(t.k);case"RSA":if(void 0!==t.oth)throw new me('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return qn({...t,alg:e});default:throw new me('Unsupported "kty" (Key Type) Parameter value')}}var ri,oi,si,ai,ci,ui=zt({"../node_modules/jose/dist/browser/key/import.js"(){Ce(),Xn(),Xn(),Yn(),Oe(),Gn(),gn()}}),li=zt({"../node_modules/jose/dist/browser/lib/check_key_type.js"(){an(),cn(),ri=(t,e)=>{if(!(e instanceof Uint8Array)){if(!tn(e))throw new TypeError(Qe(t,e,...en,"Uint8Array"));if("secret"!==e.type)throw new TypeError(`${en.join(" or ")} instances for symmetric algorithms must be of type "secret"`)}},oi=(t,e,n)=>{if(!tn(e))throw new TypeError(Qe(t,e,...en));if("secret"===e.type)throw new TypeError(`${en.join(" or ")} instances for asymmetric algorithms must not be of type "secret"`);if("sign"===n&&"public"===e.type)throw new TypeError(`${en.join(" or ")} instances for asymmetric algorithm signing must be of type "private"`);if("decrypt"===n&&"public"===e.type)throw new TypeError(`${en.join(" or ")} instances for asymmetric algorithm decryption must be of type "private"`);if(e.algorithm&&"verify"===n&&"private"===e.type)throw new TypeError(`${en.join(" or ")} instances for asymmetric algorithm verifying must be of type "public"`);if(e.algorithm&&"encrypt"===n&&"private"===e.type)throw new TypeError(`${en.join(" or ")} instances for asymmetric algorithm encryption must be of type "public"`)},si=(t,e,n)=>{t.startsWith("HS")||"dir"===t||t.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(t)?ri(t,e):oi(t,e,n)}}}),hi=zt({"../node_modules/jose/dist/browser/runtime/encrypt.js"(){je(),Be(),Je(),ne(),Ye(),an(),Oe(),cn(),ai=async(t,e,n,i,r)=>{if(!(At(n)||n instanceof Uint8Array))throw new TypeError(Xe(n,...en,"Uint8Array"));switch(De(t,i),t){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return n instanceof Uint8Array&&Me(n,parseInt(t.slice(-3),10)),async function(t,e,n,i,r){if(!(n instanceof Uint8Array))throw new TypeError(Xe(n,"Uint8Array"));const o=parseInt(t.slice(1,4),10),s=await Ft.subtle.importKey("raw",n.subarray(o>>3),"AES-CBC",!1,["encrypt"]),a=await Ft.subtle.importKey("raw",n.subarray(0,o>>3),{hash:"SHA-"+(o<<1),name:"HMAC"},!1,["sign"]),c=new Uint8Array(await Ft.subtle.encrypt({iv:i,name:"AES-CBC"},s,e)),u=re(r,i,c,se(r.length<<3));return{ciphertext:c,tag:new Uint8Array((await Ft.subtle.sign("HMAC",a,u)).slice(0,o>>3))}}(t,e,n,i,r);case"A128GCM":case"A192GCM":case"A256GCM":return n instanceof Uint8Array&&Me(n,parseInt(t.slice(1,4),10)),async function(t,e,n,i,r){let o;n instanceof Uint8Array?o=await Ft.subtle.importKey("raw",n,"AES-GCM",!1,["encrypt"]):(Ge(n,t,"encrypt"),o=n);const s=new Uint8Array(await Ft.subtle.encrypt({additionalData:r,iv:i,name:"AES-GCM",tagLength:128},o,e)),a=s.slice(-16);return{ciphertext:s.slice(0,-16),tag:a}}(t,e,n,i,r);default:throw new me("Unsupported JWE Content Encryption Algorithm")}}}}),di=zt({"../node_modules/jose/dist/browser/lib/aesgcmkw.js"(){hi(),un(),Le(),Ce()}});async function fi(t,e,n,i,r){switch(si(t,e,"decrypt"),t){case"dir":if(void 0!==n)throw new be("Encountered unexpected JWE Encrypted Key");return e;case"ECDH-ES":if(void 0!==n)throw new be("Encountered unexpected JWE Encrypted Key");case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!dn(i.epk))throw new be('JOSE Header "epk" (Ephemeral Public Key) missing or invalid');if(!kn(e))throw new me("ECDH with the provided key is not allowed or not supported by your javascript runtime");const r=await ii(i.epk,t);let o,s;if(void 0!==i.apu){if("string"!=typeof i.apu)throw new be('JOSE Header "apu" (Agreement PartyUInfo) invalid');o=de(i.apu)}if(void 0!==i.apv){if("string"!=typeof i.apv)throw new be('JOSE Header "apv" (Agreement PartyVInfo) invalid');s=de(i.apv)}const a=await xn(r,e,"ECDH-ES"===t?i.enc:t,"ECDH-ES"===t?Mn(i.enc):parseInt(t.slice(-5,-2),10),o,s);if("ECDH-ES"===t)return a;if(void 0===n)throw new be("JWE Encrypted Key missing");return vn(t.slice(-6),a,n)}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":if(void 0===n)throw new be("JWE Encrypted Key missing");return Tn(t,e,n);case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(void 0===n)throw new be("JWE Encrypted Key missing");if("number"!=typeof i.p2c)throw new be('JOSE Header "p2c" (PBES2 Count) missing or invalid');if(i.p2c>((null==r?void 0:r.maxPBES2Count)||1e4))throw new be('JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds');if("string"!=typeof i.p2s)throw new be('JOSE Header "p2s" (PBES2 Salt) missing or invalid');return Sn(t,e,n,i.p2c,de(i.p2s));case"A128KW":case"A192KW":case"A256KW":if(void 0===n)throw new be("JWE Encrypted Key missing");return vn(t,e,n);case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":if(void 0===n)throw new be("JWE Encrypted Key missing");if("string"!=typeof i.iv)throw new be('JOSE Header "iv" (Initialization Vector) missing or invalid');if("string"!=typeof i.tag)throw new be('JOSE Header "tag" (Authentication Tag) missing or invalid');return async function(t,e,n,i,r){const o=t.slice(0,7);return nn(o,e,n,i,r,new Uint8Array(0))}(t,e,n,de(i.iv),de(i.tag));default:throw new me('Invalid or unsupported "alg" (JWE Algorithm) header value')}}var pi,vi=zt({"../node_modules/jose/dist/browser/lib/decrypt_key_management.js"(){yn(),Fn(),jn(),Dn(),Ce(),Oe(),Vn(),ui(),li(),gn(),di(),ci=fi}});function gi(t,e,n,i,r){if(void 0!==r.crit&&void 0===i.crit)throw new t('"crit" (Critical) Header Parameter MUST be integrity protected');if(!i||void 0===i.crit)return new Set;if(!Array.isArray(i.crit)||0===i.crit.length||i.crit.some((t=>"string"!=typeof t||0===t.length)))throw new t('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let o;o=void 0!==n?new Map([...Object.entries(n),...e.entries()]):e;for(const e of i.crit){if(!o.has(e))throw new me(`Extension Header Parameter "${e}" is not recognized`);if(void 0===r[e])throw new t(`Extension Header Parameter "${e}" is missing`);if(o.get(e)&&void 0===i[e])throw new t(`Extension Header Parameter "${e}" MUST be integrity protected`)}return new Set(i.crit)}var mi,wi=zt({"../node_modules/jose/dist/browser/lib/validate_crit.js"(){Oe(),pi=gi}}),bi=zt({"../node_modules/jose/dist/browser/lib/validate_algorithms.js"(){mi=(t,e)=>{if(void 0!==e&&(!Array.isArray(e)||e.some((t=>"string"!=typeof t))))throw new TypeError(`"${t}" option must be an array of strings`);if(e)return new Set(e)}}});async function yi(t,e,n){var i;if(!dn(t))throw new be("Flattened JWE must be an object");if(void 0===t.protected&&void 0===t.header&&void 0===t.unprotected)throw new be("JOSE Header missing");if("string"!=typeof t.iv)throw new be("JWE Initialization Vector missing or incorrect type");if("string"!=typeof t.ciphertext)throw new be("JWE Ciphertext missing or incorrect type");if("string"!=typeof t.tag)throw new be("JWE Authentication Tag missing or incorrect type");if(void 0!==t.protected&&"string"!=typeof t.protected)throw new be("JWE Protected Header incorrect type");if(void 0!==t.encrypted_key&&"string"!=typeof t.encrypted_key)throw new be("JWE Encrypted Key incorrect type");if(void 0!==t.aad&&"string"!=typeof t.aad)throw new be("JWE AAD incorrect type");if(void 0!==t.header&&!dn(t.header))throw new be("JWE Shared Unprotected Header incorrect type");if(void 0!==t.unprotected&&!dn(t.unprotected))throw new be("JWE Per-Recipient Unprotected Header incorrect type");let r;if(t.protected)try{const e=de(t.protected);r=JSON.parse(Ct.decode(e))}catch(t){throw new be("JWE Protected Header is invalid")}if(!sn(r,t.header,t.unprotected))throw new be("JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint");const o={...r,...t.header,...t.unprotected};if(pi(be,new Map,null==n?void 0:n.crit,r,o),void 0!==o.zip){if(!r||!r.zip)throw new be('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==o.zip)throw new me('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:s,enc:a}=o;if("string"!=typeof s||!s)throw new be("missing JWE Algorithm (alg) in JWE Header");if("string"!=typeof a||!a)throw new be("missing JWE Encryption Algorithm (enc) in JWE Header");const c=n&&mi("keyManagementAlgorithms",n.keyManagementAlgorithms),u=n&&mi("contentEncryptionAlgorithms",n.contentEncryptionAlgorithms);if(c&&!c.has(s))throw new ge('"alg" (Algorithm) Header Parameter not allowed');if(u&&!u.has(a))throw new ge('"enc" (Encryption Algorithm) Header Parameter not allowed');let l;void 0!==t.encrypted_key&&(l=de(t.encrypted_key));let h,d=!1;"function"==typeof e&&(e=await e(r,t),d=!0);try{h=await ci(s,e,l,o,n)}catch(t){if(t instanceof TypeError||t instanceof be||t instanceof me)throw t;h=On(a)}const f=de(t.iv),p=de(t.tag),v=jt.encode(null!==(i=t.protected)&&void 0!==i?i:"");let g;g=void 0!==t.aad?re(v,jt.encode("."),jt.encode(t.aad)):v;let m=await nn(a,h,de(t.ciphertext),f,p,g);"DEF"===o.zip&&(m=await((null==n?void 0:n.inflateRaw)||rn)(m));const w={plaintext:m};return void 0!==t.protected&&(w.protectedHeader=r),void 0!==t.aad&&(w.additionalAuthenticatedData=de(t.aad)),void 0!==t.unprotected&&(w.sharedUnprotectedHeader=t.unprotected),void 0!==t.header&&(w.unprotectedHeader=t.header),d?{...w,key:e}:w}var xi=zt({"../node_modules/jose/dist/browser/jwe/flattened/decrypt.js"(){Ce(),un(),ln(),Oe(),hn(),gn(),vi(),je(),Vn(),wi(),bi()}});async function ki(t,e,n){if(t instanceof Uint8Array&&(t=Ct.decode(t)),"string"!=typeof t)throw new be("Compact JWE must be a string or Uint8Array");const{0:i,1:r,2:o,3:s,4:a,length:c}=t.split(".");if(5!==c)throw new be("Invalid Compact JWE");const u=await yi({ciphertext:s,iv:o||void 0,protected:i||void 0,tag:a||void 0,encrypted_key:r||void 0},e,n),l={plaintext:u.plaintext,protectedHeader:u.protectedHeader};return"function"==typeof e?{...l,key:u.key}:l}var Ei=zt({"../node_modules/jose/dist/browser/jwe/compact/decrypt.js"(){xi(),Oe(),je()}});async function Si(t,e,n){if(!dn(t))throw new be("General JWE must be an object");if(!Array.isArray(t.recipients)||!t.recipients.every(dn))throw new be("JWE Recipients missing or incorrect type");if(!t.recipients.length)throw new be("JWE Recipients has no members");for(const i of t.recipients)try{return await yi({aad:t.aad,ciphertext:t.ciphertext,encrypted_key:i.encrypted_key,header:i.header,iv:t.iv,protected:t.protected,tag:t.tag,unprotected:t.unprotected},e,n)}catch(t){}throw new we}var Fi,Ai=zt({"../node_modules/jose/dist/browser/jwe/general/decrypt.js"(){xi(),Oe(),gn()}}),_i=zt({"../node_modules/jose/dist/browser/runtime/key_to_jwk.js"(){ne(),an(),Ce(),cn(),Fi=async t=>{if(t instanceof Uint8Array)return{kty:"oct",k:le(t)};if(!At(t))throw new TypeError(Xe(t,...en,"Uint8Array"));if(!t.extractable)throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK");const{ext:e,key_ops:n,alg:i,use:r,...o}=await Ft.subtle.exportKey("jwk",t);return o}}});async function ji(t){return Bn(t)}async function Ci(t){return Jn(t)}async function Ri(t){return Fi(t)}var Ii,Ti=zt({"../node_modules/jose/dist/browser/key/export.js"(){Xn(),Xn(),_i()}});async function Oi(t,e,n,i,r={}){let o,s,a;switch(si(t,n,"encrypt"),t){case"dir":a=n;break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!kn(n))throw new me("ECDH with the provided key is not allowed or not supported by your javascript runtime");const{apu:c,apv:u}=r;let{epk:l}=r;l||(l=(await async function(t){if(!At(t))throw new TypeError(Xe(t,...en));return Ft.subtle.generateKey(t.algorithm,!0,["deriveBits"])}(n)).privateKey);const{x:h,y:d,crv:f,kty:p}=await Ri(l),v=await xn(n,l,"ECDH-ES"===t?e:t,"ECDH-ES"===t?Mn(e):parseInt(t.slice(-5,-2),10),c,u);if(s={epk:{x:h,crv:f,kty:p}},"EC"===p&&(s.epk.y=d),c&&(s.apu=le(c)),u&&(s.apv=le(u)),"ECDH-ES"===t){a=v;break}a=i||On(e);const g=t.slice(-6);o=await pn(g,v,a);break}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":a=i||On(e),o=await In(t,n,a);break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{a=i||On(e);const{p2c:c,p2s:u}=r;({encryptedKey:o,...s}=await En(t,n,a,c,u));break}case"A128KW":case"A192KW":case"A256KW":a=i||On(e),o=await pn(t,n,a);break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{a=i||On(e);const{iv:c}=r;({encryptedKey:o,...s}=await async function(t,e,n,i){const r=t.slice(0,7);i||(i=Te(r));const{ciphertext:o,tag:s}=await ai(r,n,e,i,new Uint8Array(0));return{encryptedKey:o,iv:le(i),tag:le(s)}}(t,n,a,c));break}default:throw new me('Invalid or unsupported "alg" (JWE Algorithm) header value')}return{cek:a,encryptedKey:o,parameters:s}}var Ni,Pi,Di,Mi,Ui=zt({"../node_modules/jose/dist/browser/lib/encrypt_key_management.js"(){yn(),Fn(),jn(),Dn(),Ce(),Vn(),Oe(),Ti(),li(),di(),Ii=Oi}}),Li=zt({"../node_modules/jose/dist/browser/jwe/flattened/encrypt.js"(){Ce(),hi(),ln(),Le(),Ui(),Oe(),hn(),je(),wi(),Ni=Symbol(),Pi=class{constructor(t){if(!(t instanceof Uint8Array))throw new TypeError("plaintext must be an instance of Uint8Array");this._plaintext=t}setKeyManagementParameters(t){if(this._keyManagementParameters)throw new TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=t,this}setProtectedHeader(t){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=t,this}setSharedUnprotectedHeader(t){if(this._sharedUnprotectedHeader)throw new TypeError("setSharedUnprotectedHeader can only be called once");return this._sharedUnprotectedHeader=t,this}setUnprotectedHeader(t){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=t,this}setAdditionalAuthenticatedData(t){return this._aad=t,this}setContentEncryptionKey(t){if(this._cek)throw new TypeError("setContentEncryptionKey can only be called once");return this._cek=t,this}setInitializationVector(t){if(this._iv)throw new TypeError("setInitializationVector can only be called once");return this._iv=t,this}async encrypt(t,e){if(!this._protectedHeader&&!this._unprotectedHeader&&!this._sharedUnprotectedHeader)throw new be("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(!sn(this._protectedHeader,this._unprotectedHeader,this._sharedUnprotectedHeader))throw new be("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");const n={...this._protectedHeader,...this._unprotectedHeader,...this._sharedUnprotectedHeader};if(pi(be,new Map,null==e?void 0:e.crit,this._protectedHeader,n),void 0!==n.zip){if(!this._protectedHeader||!this._protectedHeader.zip)throw new be('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==n.zip)throw new me('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:i,enc:r}=n;if("string"!=typeof i||!i)throw new be('JWE "alg" (Algorithm) Header Parameter missing or invalid');if("string"!=typeof r||!r)throw new be('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');let o,s,a,c,u,l,h;if("dir"===i){if(this._cek)throw new TypeError("setContentEncryptionKey cannot be called when using Direct Encryption")}else if("ECDH-ES"===i&&this._cek)throw new TypeError("setContentEncryptionKey cannot be called when using Direct Key Agreement");{let n;({cek:s,encryptedKey:o,parameters:n}=await Ii(i,r,t,this._cek,this._keyManagementParameters)),n&&(e&&Ni in e?this._unprotectedHeader?this._unprotectedHeader={...this._unprotectedHeader,...n}:this.setUnprotectedHeader(n):this._protectedHeader?this._protectedHeader={...this._protectedHeader,...n}:this.setProtectedHeader(n))}if(this._iv||(this._iv=Te(r)),c=jt.encode(this._protectedHeader?le(JSON.stringify(this._protectedHeader)):""),this._aad?(u=le(this._aad),a=re(c,jt.encode("."),jt.encode(u))):a=c,"DEF"===n.zip){const t=await((null==e?void 0:e.deflateRaw)||on)(this._plaintext);({ciphertext:l,tag:h}=await ai(r,t,s,this._iv,a))}else({ciphertext:l,tag:h}=await ai(r,this._plaintext,s,this._iv,a));const d={ciphertext:le(l),iv:le(this._iv),tag:le(h)};return o&&(d.encrypted_key=le(o)),u&&(d.aad=u),this._protectedHeader&&(d.protected=Ct.decode(c)),this._sharedUnprotectedHeader&&(d.unprotected=this._sharedUnprotectedHeader),this._unprotectedHeader&&(d.header=this._unprotectedHeader),d}}}}),Bi=zt({"../node_modules/jose/dist/browser/jwe/general/encrypt.js"(){Li(),Oe(),Vn(),hn(),Ui(),Ce(),wi(),Di=class{constructor(t,e,n){this.parent=t,this.key=e,this.options=n}setUnprotectedHeader(t){if(this.unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this.unprotectedHeader=t,this}addRecipient(...t){return this.parent.addRecipient(...t)}encrypt(...t){return this.parent.encrypt(...t)}done(){return this.parent}},Mi=class{constructor(t){this._recipients=[],this._plaintext=t}addRecipient(t,e){const n=new Di(this,t,{crit:null==e?void 0:e.crit});return this._recipients.push(n),n}setProtectedHeader(t){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=t,this}setSharedUnprotectedHeader(t){if(this._unprotectedHeader)throw new TypeError("setSharedUnprotectedHeader can only be called once");return this._unprotectedHeader=t,this}setAdditionalAuthenticatedData(t){return this._aad=t,this}async encrypt(t){var e,n,i;if(!this._recipients.length)throw new be("at least one recipient must be added");if(t={deflateRaw:null==t?void 0:t.deflateRaw},1===this._recipients.length){const[e]=this._recipients,n=await new Pi(this._plaintext).setAdditionalAuthenticatedData(this._aad).setProtectedHeader(this._protectedHeader).setSharedUnprotectedHeader(this._unprotectedHeader).setUnprotectedHeader(e.unprotectedHeader).encrypt(e.key,{...e.options,...t});let i={ciphertext:n.ciphertext,iv:n.iv,recipients:[{}],tag:n.tag};return n.aad&&(i.aad=n.aad),n.protected&&(i.protected=n.protected),n.unprotected&&(i.unprotected=n.unprotected),n.encrypted_key&&(i.recipients[0].encrypted_key=n.encrypted_key),n.header&&(i.recipients[0].header=n.header),i}let r;for(let t=0;t<this._recipients.length;t++){const e=this._recipients[t];if(!sn(this._protectedHeader,this._unprotectedHeader,e.unprotectedHeader))throw new be("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");const n={...this._protectedHeader,...this._unprotectedHeader,...e.unprotectedHeader},{alg:i}=n;if("string"!=typeof i||!i)throw new be('JWE "alg" (Algorithm) Header Parameter missing or invalid');if("dir"===i||"ECDH-ES"===i)throw new be('"dir" and "ECDH-ES" alg may only be used with a single recipient');if("string"!=typeof n.enc||!n.enc)throw new be('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');if(r){if(r!==n.enc)throw new be('JWE "enc" (Encryption Algorithm) Header Parameter must be the same for all recipients')}else r=n.enc;if(pi(be,new Map,e.options.crit,this._protectedHeader,n),!(void 0===n.zip||this._protectedHeader&&this._protectedHeader.zip))throw new be('JWE "zip" (Compression Algorithm) Header MUST be integrity protected')}const o=On(r);let s={ciphertext:"",iv:"",recipients:[],tag:""};for(let a=0;a<this._recipients.length;a++){const c=this._recipients[a],u={};s.recipients.push(u);const l={...this._protectedHeader,...this._unprotectedHeader,...c.unprotectedHeader}.alg.startsWith("PBES2")?2048+a:void 0;if(0===a){const e=await new Pi(this._plaintext).setAdditionalAuthenticatedData(this._aad).setContentEncryptionKey(o).setProtectedHeader(this._protectedHeader).setSharedUnprotectedHeader(this._unprotectedHeader).setUnprotectedHeader(c.unprotectedHeader).setKeyManagementParameters({p2c:l}).encrypt(c.key,{...c.options,...t,[Ni]:!0});s.ciphertext=e.ciphertext,s.iv=e.iv,s.tag=e.tag,e.aad&&(s.aad=e.aad),e.protected&&(s.protected=e.protected),e.unprotected&&(s.unprotected=e.unprotected),u.encrypted_key=e.encrypted_key,e.header&&(u.header=e.header);continue}const{encryptedKey:h,parameters:d}=await Ii((null===(e=c.unprotectedHeader)||void 0===e?void 0:e.alg)||(null===(n=this._protectedHeader)||void 0===n?void 0:n.alg)||(null===(i=this._unprotectedHeader)||void 0===i?void 0:i.alg),r,c.key,o,{p2c:l});u.encrypted_key=le(h),(c.unprotectedHeader||d)&&(u.header={...c.unprotectedHeader,...d})}return s}}}});function Ji(t,e){const n=`SHA-${t.slice(-3)}`;switch(t){case"HS256":case"HS384":case"HS512":return{hash:n,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:n,name:"RSA-PSS",saltLength:t.slice(-3)>>3};case"RS256":case"RS384":case"RS512":return{hash:n,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:n,name:"ECDSA",namedCurve:e.namedCurve};case He()&&"EdDSA":const{namedCurve:i}=e;return{name:i,namedCurve:i};case"EdDSA":return{name:e.name};default:throw new me(`alg ${t} is not supported either by JOSE or your javascript runtime`)}}var $i=zt({"../node_modules/jose/dist/browser/runtime/subtle_dsa.js"(){ze(),Oe()}});function Hi(t,e,n){if(At(e))return function(t,e,...n){switch(e){case"HS256":case"HS384":case"HS512":{if(!We(t.algorithm,"HMAC"))throw Ke("HMAC");const n=parseInt(e.slice(2),10);if(qe(t.algorithm.hash)!==n)throw Ke(`SHA-${n}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!We(t.algorithm,"RSASSA-PKCS1-v1_5"))throw Ke("RSASSA-PKCS1-v1_5");const n=parseInt(e.slice(2),10);if(qe(t.algorithm.hash)!==n)throw Ke(`SHA-${n}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!We(t.algorithm,"RSA-PSS"))throw Ke("RSA-PSS");const n=parseInt(e.slice(2),10);if(qe(t.algorithm.hash)!==n)throw Ke(`SHA-${n}`,"algorithm.hash");break}case He()&&"EdDSA":if(!We(t.algorithm,"NODE-ED25519"))throw Ke("NODE-ED25519");break;case"EdDSA":if("Ed25519"!==t.algorithm.name&&"Ed448"!==t.algorithm.name)throw Ke("Ed25519 or Ed448");break;case"ES256":case"ES384":case"ES512":{if(!We(t.algorithm,"ECDSA"))throw Ke("ECDSA");const n=function(t){switch(t){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}(e);if(t.algorithm.namedCurve!==n)throw Ke(n,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}Ve(t,n)}(e,t,n),e;if(e instanceof Uint8Array){if(!t.startsWith("HS"))throw new TypeError(Xe(e,...en));return Ft.subtle.importKey("raw",e,{hash:`SHA-${t.slice(-3)}`,name:"HMAC"},!1,[n])}throw new TypeError(Xe(e,...en,"Uint8Array"))}var zi,Ki=zt({"../node_modules/jose/dist/browser/runtime/get_sign_verify_key.js"(){ne(),Ye(),an(),cn()}}),Wi=zt({"../node_modules/jose/dist/browser/runtime/verify.js"(){$i(),ne(),Pn(),Ki(),zi=async(t,e,n,i)=>{const r=await Hi(t,e,"verify");Rn(t,r);const o=Ji(t,r.algorithm);try{return await Ft.subtle.verify(o,r,n,i)}catch(t){return!1}}}});async function qi(t,e,n){var i;if(!dn(t))throw new ye("Flattened JWS must be an object");if(void 0===t.protected&&void 0===t.header)throw new ye('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==t.protected&&"string"!=typeof t.protected)throw new ye("JWS Protected Header incorrect type");if(void 0===t.payload)throw new ye("JWS Payload missing");if("string"!=typeof t.signature)throw new ye("JWS Signature missing or incorrect type");if(void 0!==t.header&&!dn(t.header))throw new ye("JWS Unprotected Header incorrect type");let r={};if(t.protected)try{const e=de(t.protected);r=JSON.parse(Ct.decode(e))}catch(t){throw new ye("JWS Protected Header is invalid")}if(!sn(r,t.header))throw new ye("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const o={...r,...t.header};let s=!0;if(pi(ye,new Map([["b64",!0]]),null==n?void 0:n.crit,r,o).has("b64")&&(s=r.b64,"boolean"!=typeof s))throw new ye('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:a}=o;if("string"!=typeof a||!a)throw new ye('JWS "alg" (Algorithm) Header Parameter missing or invalid');const c=n&&mi("algorithms",n.algorithms);if(c&&!c.has(a))throw new ge('"alg" (Algorithm) Header Parameter not allowed');if(s){if("string"!=typeof t.payload)throw new ye("JWS Payload must be a string")}else if("string"!=typeof t.payload&&!(t.payload instanceof Uint8Array))throw new ye("JWS Payload must be a string or an Uint8Array instance");let u=!1;"function"==typeof e&&(e=await e(r,t),u=!0),si(a,e,"verify");const l=re(jt.encode(null!==(i=t.protected)&&void 0!==i?i:""),jt.encode("."),"string"==typeof t.payload?jt.encode(t.payload):t.payload),h=de(t.signature);if(!await zi(a,e,h,l))throw new _e;let d;d=s?de(t.payload):"string"==typeof t.payload?jt.encode(t.payload):t.payload;const f={payload:d};return void 0!==t.protected&&(f.protectedHeader=r),void 0!==t.header&&(f.unprotectedHeader=t.header),u?{...f,key:e}:f}var Vi=zt({"../node_modules/jose/dist/browser/jws/flattened/verify.js"(){Ce(),Wi(),Oe(),je(),hn(),gn(),li(),wi(),bi()}});async function Gi(t,e,n){if(t instanceof Uint8Array&&(t=Ct.decode(t)),"string"!=typeof t)throw new ye("Compact JWS must be a string or Uint8Array");const{0:i,1:r,2:o,length:s}=t.split(".");if(3!==s)throw new ye("Invalid Compact JWS");const a=await qi({payload:r,protected:i,signature:o},e,n),c={payload:a.payload,protectedHeader:a.protectedHeader};return"function"==typeof e?{...c,key:a.key}:c}var Xi=zt({"../node_modules/jose/dist/browser/jws/compact/verify.js"(){Vi(),Oe(),je()}});async function Yi(t,e,n){if(!dn(t))throw new ye("General JWS must be an object");if(!Array.isArray(t.signatures)||!t.signatures.every(dn))throw new ye("JWS Signatures missing or incorrect type");for(const i of t.signatures)try{return await qi({header:i.header,payload:t.payload,protected:i.protected,signature:i.signature},e,n)}catch(t){}throw new _e}var Zi,Qi,tr,er,nr,ir,rr=zt({"../node_modules/jose/dist/browser/jws/general/verify.js"(){Vi(),Oe(),gn()}}),or=zt({"../node_modules/jose/dist/browser/lib/epoch.js"(){Zi=t=>Math.floor(t.getTime()/1e3)}}),sr=zt({"../node_modules/jose/dist/browser/lib/secs.js"(){Qi=/^(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)$/i,tr=t=>{const e=Qi.exec(t);if(!e)throw new TypeError("Invalid time period format");const n=parseFloat(e[1]);switch(e[2].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":return Math.round(n);case"minute":case"minutes":case"min":case"mins":case"m":return Math.round(60*n);case"hour":case"hours":case"hr":case"hrs":case"h":return Math.round(3600*n);case"day":case"days":case"d":return Math.round(86400*n);case"week":case"weeks":case"w":return Math.round(604800*n);default:return Math.round(31557600*n)}}}}),ar=zt({"../node_modules/jose/dist/browser/lib/jwt_claims_set.js"(){Oe(),je(),or(),sr(),gn(),er=t=>t.toLowerCase().replace(/^application\//,""),nr=(t,e)=>"string"==typeof t?e.includes(t):!!Array.isArray(t)&&e.some(Set.prototype.has.bind(new Set(t))),ir=(t,e,n={})=>{const{typ:i}=n;if(i&&("string"!=typeof t.typ||er(t.typ)!==er(i)))throw new pe('unexpected "typ" JWT header value',"typ","check_failed");let r;try{r=JSON.parse(Ct.decode(e))}catch(t){}if(!dn(r))throw new xe("JWT Claims Set must be a top-level JSON object");const{issuer:o}=n;if(o&&!(Array.isArray(o)?o:[o]).includes(r.iss))throw new pe('unexpected "iss" claim value',"iss","check_failed");const{subject:s}=n;if(s&&r.sub!==s)throw new pe('unexpected "sub" claim value',"sub","check_failed");const{audience:a}=n;if(a&&!nr(r.aud,"string"==typeof a?[a]:a))throw new pe('unexpected "aud" claim value',"aud","check_failed");let c;switch(typeof n.clockTolerance){case"string":c=tr(n.clockTolerance);break;case"number":c=n.clockTolerance;break;case"undefined":c=0;break;default:throw new TypeError("Invalid clockTolerance option type")}const{currentDate:u}=n,l=Zi(u||new Date);if((void 0!==r.iat||n.maxTokenAge)&&"number"!=typeof r.iat)throw new pe('"iat" claim must be a number',"iat","invalid");if(void 0!==r.nbf){if("number"!=typeof r.nbf)throw new pe('"nbf" claim must be a number',"nbf","invalid");if(r.nbf>l+c)throw new pe('"nbf" claim timestamp check failed',"nbf","check_failed")}if(void 0!==r.exp){if("number"!=typeof r.exp)throw new pe('"exp" claim must be a number',"exp","invalid");if(r.exp<=l-c)throw new ve('"exp" claim timestamp check failed',"exp","check_failed")}if(n.maxTokenAge){const t=l-r.iat;if(t-c>("number"==typeof n.maxTokenAge?n.maxTokenAge:tr(n.maxTokenAge)))throw new ve('"iat" claim timestamp check failed (too far in the past)',"iat","check_failed");if(t<0-c)throw new pe('"iat" claim timestamp check failed (it should be in the past)',"iat","check_failed")}return r}}});async function cr(t,e,n){var i;const r=await Gi(t,e,n);if((null===(i=r.protectedHeader.crit)||void 0===i?void 0:i.includes("b64"))&&!1===r.protectedHeader.b64)throw new xe("JWTs MUST NOT use unencoded payload");const o={payload:ir(r.protectedHeader,r.payload,n),protectedHeader:r.protectedHeader};return"function"==typeof e?{...o,key:r.key}:o}var ur=zt({"../node_modules/jose/dist/browser/jwt/verify.js"(){Xi(),ar(),Oe()}});async function lr(t,e,n){const i=await ki(t,e,n),r=ir(i.protectedHeader,i.plaintext,n),{protectedHeader:o}=i;if(void 0!==o.iss&&o.iss!==r.iss)throw new pe('replicated "iss" claim header parameter mismatch',"iss","mismatch");if(void 0!==o.sub&&o.sub!==r.sub)throw new pe('replicated "sub" claim header parameter mismatch',"sub","mismatch");if(void 0!==o.aud&&JSON.stringify(o.aud)!==JSON.stringify(r.aud))throw new pe('replicated "aud" claim header parameter mismatch',"aud","mismatch");const s={payload:r,protectedHeader:o};return"function"==typeof e?{...s,key:i.key}:s}var hr,dr,fr,pr,vr,gr,mr,wr,br,yr,xr=zt({"../node_modules/jose/dist/browser/jwt/decrypt.js"(){Ei(),ar(),Oe()}}),kr=zt({"../node_modules/jose/dist/browser/jwe/compact/encrypt.js"(){Li(),hr=class{constructor(t){this._flattened=new Pi(t)}setContentEncryptionKey(t){return this._flattened.setContentEncryptionKey(t),this}setInitializationVector(t){return this._flattened.setInitializationVector(t),this}setProtectedHeader(t){return this._flattened.setProtectedHeader(t),this}setKeyManagementParameters(t){return this._flattened.setKeyManagementParameters(t),this}async encrypt(t,e){const n=await this._flattened.encrypt(t,e);return[n.protected,n.encrypted_key,n.iv,n.ciphertext,n.tag].join(".")}}}}),Er=zt({"../node_modules/jose/dist/browser/runtime/sign.js"(){$i(),ne(),Pn(),Ki(),dr=async(t,e,n)=>{const i=await Hi(t,e,"sign");Rn(t,i);const r=await Ft.subtle.sign(Ji(t,i.algorithm),i,n);return new Uint8Array(r)}}}),Sr=zt({"../node_modules/jose/dist/browser/jws/flattened/sign.js"(){Ce(),Er(),hn(),Oe(),je(),li(),wi(),fr=class{constructor(t){if(!(t instanceof Uint8Array))throw new TypeError("payload must be an instance of Uint8Array");this._payload=t}setProtectedHeader(t){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=t,this}setUnprotectedHeader(t){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=t,this}async sign(t,e){if(!this._protectedHeader&&!this._unprotectedHeader)throw new ye("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!sn(this._protectedHeader,this._unprotectedHeader))throw new ye("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const n={...this._protectedHeader,...this._unprotectedHeader};let i=!0;if(pi(ye,new Map([["b64",!0]]),null==e?void 0:e.crit,this._protectedHeader,n).has("b64")&&(i=this._protectedHeader.b64,"boolean"!=typeof i))throw new ye('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:r}=n;if("string"!=typeof r||!r)throw new ye('JWS "alg" (Algorithm) Header Parameter missing or invalid');si(r,t,"sign");let o,s=this._payload;i&&(s=jt.encode(le(s))),o=jt.encode(this._protectedHeader?le(JSON.stringify(this._protectedHeader)):"");const a=re(o,jt.encode("."),s),c=await dr(r,t,a),u={signature:le(c),payload:""};return i&&(u.payload=Ct.decode(s)),this._unprotectedHeader&&(u.header=this._unprotectedHeader),this._protectedHeader&&(u.protected=Ct.decode(o)),u}}}}),Fr=zt({"../node_modules/jose/dist/browser/jws/compact/sign.js"(){Sr(),pr=class{constructor(t){this._flattened=new fr(t)}setProtectedHeader(t){return this._flattened.setProtectedHeader(t),this}async sign(t,e){const n=await this._flattened.sign(t,e);if(void 0===n.payload)throw new TypeError("use the flattened module for creating JWS with b64: false");return`${n.protected}.${n.payload}.${n.signature}`}}}}),Ar=zt({"../node_modules/jose/dist/browser/jws/general/sign.js"(){Sr(),Oe(),vr=class{constructor(t,e,n){this.parent=t,this.key=e,this.options=n}setProtectedHeader(t){if(this.protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this.protectedHeader=t,this}setUnprotectedHeader(t){if(this.unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this.unprotectedHeader=t,this}addSignature(...t){return this.parent.addSignature(...t)}sign(...t){return this.parent.sign(...t)}done(){return this.parent}},gr=class{constructor(t){this._signatures=[],this._payload=t}addSignature(t,e){const n=new vr(this,t,e);return this._signatures.push(n),n}async sign(){if(!this._signatures.length)throw new ye("at least one signature must be added");const t={signatures:[],payload:""};for(let e=0;e<this._signatures.length;e++){const n=this._signatures[e],i=new fr(this._payload);i.setProtectedHeader(n.protectedHeader),i.setUnprotectedHeader(n.unprotectedHeader);const{payload:r,...o}=await i.sign(n.key,n.options);if(0===e)t.payload=r;else if(t.payload!==r)throw new ye("inconsistent use of JWS Unencoded Payload Option (RFC7797)");t.signatures.push(o)}return t}}}}),_r=zt({"../node_modules/jose/dist/browser/jwt/produce.js"(){or(),gn(),sr(),mr=class{constructor(t){if(!dn(t))throw new TypeError("JWT Claims Set MUST be an object");this._payload=t}setIssuer(t){return this._payload={...this._payload,iss:t},this}setSubject(t){return this._payload={...this._payload,sub:t},this}setAudience(t){return this._payload={...this._payload,aud:t},this}setJti(t){return this._payload={...this._payload,jti:t},this}setNotBefore(t){return this._payload="number"==typeof t?{...this._payload,nbf:t}:{...this._payload,nbf:Zi(new Date)+tr(t)},this}setExpirationTime(t){return this._payload="number"==typeof t?{...this._payload,exp:t}:{...this._payload,exp:Zi(new Date)+tr(t)},this}setIssuedAt(t){return this._payload=void 0===t?{...this._payload,iat:Zi(new Date)}:{...this._payload,iat:t},this}}}}),jr=zt({"../node_modules/jose/dist/browser/jwt/sign.js"(){Fr(),Oe(),je(),_r(),wr=class extends mr{setProtectedHeader(t){return this._protectedHeader=t,this}async sign(t,e){var n;const i=new pr(jt.encode(JSON.stringify(this._payload)));if(i.setProtectedHeader(this._protectedHeader),Array.isArray(null===(n=this._protectedHeader)||void 0===n?void 0:n.crit)&&this._protectedHeader.crit.includes("b64")&&!1===this._protectedHeader.b64)throw new xe("JWTs MUST NOT use unencoded payload");return i.sign(t,e)}}}}),Cr=zt({"../node_modules/jose/dist/browser/jwt/encrypt.js"(){kr(),je(),_r(),br=class extends mr{setProtectedHeader(t){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=t,this}setKeyManagementParameters(t){if(this._keyManagementParameters)throw new TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=t,this}setContentEncryptionKey(t){if(this._cek)throw new TypeError("setContentEncryptionKey can only be called once");return this._cek=t,this}setInitializationVector(t){if(this._iv)throw new TypeError("setInitializationVector can only be called once");return this._iv=t,this}replicateIssuerAsHeader(){return this._replicateIssuerAsHeader=!0,this}replicateSubjectAsHeader(){return this._replicateSubjectAsHeader=!0,this}replicateAudienceAsHeader(){return this._replicateAudienceAsHeader=!0,this}async encrypt(t,e){const n=new hr(jt.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}),n.setProtectedHeader(this._protectedHeader),this._iv&&n.setInitializationVector(this._iv),this._cek&&n.setContentEncryptionKey(this._cek),this._keyManagementParameters&&n.setKeyManagementParameters(this._keyManagementParameters),n.encrypt(t,e)}}}});async function Rr(t,e){if(!dn(t))throw new TypeError("JWK must be an object");if(null!=e||(e="sha256"),"sha256"!==e&&"sha384"!==e&&"sha512"!==e)throw new TypeError('digestAlgorithm must one of "sha256", "sha384", or "sha512"');let n;switch(t.kty){case"EC":yr(t.crv,'"crv" (Curve) Parameter'),yr(t.x,'"x" (X Coordinate) Parameter'),yr(t.y,'"y" (Y Coordinate) Parameter'),n={crv:t.crv,kty:t.kty,x:t.x,y:t.y};break;case"OKP":yr(t.crv,'"crv" (Subtype of Key Pair) Parameter'),yr(t.x,'"x" (Public Key) Parameter'),n={crv:t.crv,kty:t.kty,x:t.x};break;case"RSA":yr(t.e,'"e" (Exponent) Parameter'),yr(t.n,'"n" (Modulus) Parameter'),n={e:t.e,kty:t.kty,n:t.n};break;case"oct":yr(t.k,'"k" (Key Value) Parameter'),n={k:t.k,kty:t.kty};break;default:throw new me('"kty" (Key Type) Parameter missing or unsupported')}const i=jt.encode(JSON.stringify(n));return le(await _t(e,i))}async function Ir(t,e){null!=e||(e="sha256");const n=await Rr(t,e);return`urn:ietf:params:oauth:jwk-thumbprint:sha-${e.slice(-3)}:${n}`}var Tr=zt({"../node_modules/jose/dist/browser/jwk/thumbprint.js"(){ie(),Ce(),Oe(),je(),gn(),yr=(t,e)=>{if("string"!=typeof t||!t)throw new ke(`${e} missing or invalid`)}}});async function Or(t,e){const n={...t,...e.header};if(!dn(n.jwk))throw new ye('"jwk" (JSON Web Key) Header Parameter must be a JSON object');const i=await ii({...n.jwk,ext:!0},n.alg,!0);if(i instanceof Uint8Array||"public"!==i.type)throw new ye('"jwk" (JSON Web Key) Header Parameter must be a public key');return i}var Nr,Pr=zt({"../node_modules/jose/dist/browser/jwk/embedded.js"(){ui(),gn(),Oe()}});function Dr(t){return t&&"object"==typeof t&&Array.isArray(t.keys)&&t.keys.every(Mr)}function Mr(t){return dn(t)}function Ur(t){return Nr.prototype.getKey.bind(new Nr(t))}var Lr,Br,Jr=zt({"../node_modules/jose/dist/browser/jwks/local.js"(){ui(),Oe(),gn(),Nr=class{constructor(t){if(this._cached=new WeakMap,!Dr(t))throw new Ee("JSON Web Key Set malformed");var e;this._jwks=(e=t,"function"==typeof structuredClone?structuredClone(e):JSON.parse(JSON.stringify(e)))}async getKey(t,e){const{alg:n,kid:i}={...t,...e.header},r=function(t){switch("string"==typeof t&&t.slice(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";default:throw new me('Unsupported "alg" value for a JSON Web Key Set')}}(n),o=this._jwks.keys.filter((t=>{let e=r===t.kty;if(e&&"string"==typeof i&&(e=i===t.kid),e&&"string"==typeof t.alg&&(e=n===t.alg),e&&"string"==typeof t.use&&(e="sig"===t.use),e&&Array.isArray(t.key_ops)&&(e=t.key_ops.includes("verify")),e&&"EdDSA"===n&&(e="Ed25519"===t.crv||"Ed448"===t.crv),e)switch(n){case"ES256":e="P-256"===t.crv;break;case"ES256K":e="secp256k1"===t.crv;break;case"ES384":e="P-384"===t.crv;break;case"ES512":e="P-521"===t.crv}return e})),{0:s,length:a}=o;if(0===a)throw new Se;if(1!==a)throw new Fe;const c=this._cached.get(s)||this._cached.set(s,{}).get(s);if(void 0===c[n]){const t=await ii({...s,ext:!0},n);if(t instanceof Uint8Array||"public"!==t.type)throw new Ee("JSON Web Key Set members must be public keys");c[n]=t}return c[n]}}}}),$r=zt({"../node_modules/jose/dist/browser/runtime/fetch_jwks.js"(){Oe(),Lr=async(t,e,n)=>{let i,r,o=!1;"function"==typeof AbortController&&(i=new AbortController,r=setTimeout((()=>{o=!0,i.abort()}),e));const s=await fetch(t.href,{signal:i?i.signal:void 0,redirect:"manual",headers:n.headers}).catch((t=>{if(o)throw new Ae;throw t}));if(void 0!==r&&clearTimeout(r),200!==s.status)throw new fe("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await s.json()}catch(t){throw new fe("Failed to parse the JSON Web Key Set HTTP response as JSON")}}}});function Hr(t,e){return Br.prototype.getKey.bind(new Br(t,e))}var zr,Kr,Wr,qr=zt({"../node_modules/jose/dist/browser/jwks/remote.js"(){$r(),ze(),Oe(),Jr(),Br=class extends Nr{constructor(t,e){if(super({keys:[]}),this._jwks=void 0,!(t instanceof URL))throw new TypeError("url must be an instance of URL");this._url=new URL(t.href),this._options={agent:null==e?void 0:e.agent,headers:null==e?void 0:e.headers},this._timeoutDuration="number"==typeof(null==e?void 0:e.timeoutDuration)?null==e?void 0:e.timeoutDuration:5e3,this._cooldownDuration="number"==typeof(null==e?void 0:e.cooldownDuration)?null==e?void 0:e.cooldownDuration:3e4,this._cacheMaxAge="number"==typeof(null==e?void 0:e.cacheMaxAge)?null==e?void 0:e.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(t,e){this._jwks&&this.fresh()||await this.reload();try{return await super.getKey(t,e)}catch(n){if(n instanceof Se&&!1===this.coolingDown())return await this.reload(),super.getKey(t,e);throw n}}async reload(){if(this._pendingFetch&&He())return new Promise((t=>{const e=()=>{void 0===this._pendingFetch?t():setTimeout(e,5)};e()}));this._pendingFetch||(this._pendingFetch=Lr(this._url,this._timeoutDuration,this._options).then((t=>{if(!Dr(t))throw new Ee("JSON Web Key Set malformed");this._jwks={keys:t.keys},this._jwksTimestamp=Date.now(),this._pendingFetch=void 0})).catch((t=>{throw this._pendingFetch=void 0,t}))),await this._pendingFetch}}}}),Vr=zt({"../node_modules/jose/dist/browser/jwt/unsecured.js"(){Ce(),je(),Oe(),ar(),_r(),zr=class extends mr{encode(){return`${le(JSON.stringify({alg:"none"}))}.${le(JSON.stringify(this._payload))}.`}static decode(t,e){if("string"!=typeof t)throw new xe("Unsecured JWT must be a string");const{0:n,1:i,2:r,length:o}=t.split(".");if(3!==o||""!==r)throw new xe("Invalid Unsecured JWT");let s;try{if(s=JSON.parse(Ct.decode(de(n))),"none"!==s.alg)throw new Error}catch(t){throw new xe("Invalid Unsecured JWT")}return{payload:ir(s,de(i),e),header:s}}}}}),Gr={};Wt(Gr,{decode:()=>Wr,encode:()=>Kr});var Xr=zt({"../node_modules/jose/dist/browser/util/base64url.js"(){Ce(),Kr=le,Wr=de}});function Yr(t){let e;if("string"==typeof t){const n=t.split(".");3!==n.length&&5!==n.length||([e]=n)}else if("object"==typeof t&&t){if(!("protected"in t))throw new TypeError("Token does not contain a Protected Header");e=t.protected}try{if("string"!=typeof e||!e)throw new Error;const t=JSON.parse(Ct.decode(Wr(e)));if(!dn(t))throw new Error;return t}catch(t){throw new TypeError("Invalid Token or Protected Header formatting")}}var Zr=zt({"../node_modules/jose/dist/browser/util/decode_protected_header.js"(){Xr(),je(),gn()}});function Qr(t){if("string"!=typeof t)throw new xe("JWTs must use Compact JWS serialization, JWT must be a string");const{1:e,length:n}=t.split(".");if(5===n)throw new xe("Only JWTs using Compact JWS serialization can be decoded");if(3!==n)throw new xe("Invalid JWT");if(!e)throw new xe("JWTs must contain a payload");let i,r;try{i=Wr(e)}catch(t){throw new xe("Failed to parse the base64url encoded payload")}try{r=JSON.parse(Ct.decode(i))}catch(t){throw new xe("Failed to parse the decoded payload as JSON")}if(!dn(r))throw new xe("Invalid JWT Claims Set");return r}var to=zt({"../node_modules/jose/dist/browser/util/decode_jwt.js"(){Xr(),je(),gn(),Oe()}});function eo(t){var e;const n=null!==(e=null==t?void 0:t.modulusLength)&&void 0!==e?e:2048;if("number"!=typeof n||n<2048)throw new me("Invalid or unsupported modulusLength option provided, 2048 bits or larger keys must be used");return n}var no=zt({"../node_modules/jose/dist/browser/runtime/generate.js"(){ze(),ne(),Oe(),Ne()}});async function io(t,e){return async function(t,e){var n,i,r;let o,s;switch(t){case"PS256":case"PS384":case"PS512":o={name:"RSA-PSS",hash:`SHA-${t.slice(-3)}`,publicExponent:new Uint8Array([1,0,1]),modulusLength:eo(e)},s=["sign","verify"];break;case"RS256":case"RS384":case"RS512":o={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${t.slice(-3)}`,publicExponent:new Uint8Array([1,0,1]),modulusLength:eo(e)},s=["sign","verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":o={name:"RSA-OAEP",hash:`SHA-${parseInt(t.slice(-3),10)||1}`,publicExponent:new Uint8Array([1,0,1]),modulusLength:eo(e)},s=["decrypt","unwrapKey","encrypt","wrapKey"];break;case"ES256":o={name:"ECDSA",namedCurve:"P-256"},s=["sign","verify"];break;case"ES384":o={name:"ECDSA",namedCurve:"P-384"},s=["sign","verify"];break;case"ES512":o={name:"ECDSA",namedCurve:"P-521"},s=["sign","verify"];break;case He()&&"EdDSA":switch(null==e?void 0:e.crv){case void 0:case"Ed25519":o={name:"NODE-ED25519",namedCurve:"NODE-ED25519"},s=["sign","verify"];break;default:throw new me("Invalid or unsupported crv option provided")}break;case"EdDSA":s=["sign","verify"];const r=null!==(n=null==e?void 0:e.crv)&&void 0!==n?n:"Ed25519";switch(r){case"Ed25519":case"Ed448":o={name:r};break;default:throw new me("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 t=null!==(i=null==e?void 0:e.crv)&&void 0!==i?i:"P-256";switch(t){case"P-256":case"P-384":case"P-521":o={name:"ECDH",namedCurve:t};break;case"X25519":case"X448":o={name:t};break;default:throw new me("Invalid or unsupported crv option provided, supported values are P-256, P-384, P-521, X25519, and X448")}break}default:throw new me('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}return Ft.subtle.generateKey(o,null!==(r=null==e?void 0:e.extractable)&&void 0!==r&&r,s)}(t,e)}var ro=zt({"../node_modules/jose/dist/browser/key/generate_key_pair.js"(){no()}});async function oo(t,e){return async function(t,e){var n;let i,r,o;switch(t){case"HS256":case"HS384":case"HS512":i=parseInt(t.slice(-3),10),r={name:"HMAC",hash:`SHA-${i}`,length:i},o=["sign","verify"];break;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return i=parseInt(t.slice(-3),10),Ie(new Uint8Array(i>>3));case"A128KW":case"A192KW":case"A256KW":i=parseInt(t.slice(1,4),10),r={name:"AES-KW",length:i},o=["wrapKey","unwrapKey"];break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":case"A128GCM":case"A192GCM":case"A256GCM":i=parseInt(t.slice(1,4),10),r={name:"AES-GCM",length:i},o=["encrypt","decrypt"];break;default:throw new me('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}return Ft.subtle.generateKey(r,null!==(n=null==e?void 0:e.extractable)&&void 0!==n&&n,o)}(t,e)}var so=zt({"../node_modules/jose/dist/browser/key/generate_secret.js"(){no()}}),ao={};Wt(ao,{CompactEncrypt:()=>hr,CompactSign:()=>pr,EmbeddedJWK:()=>Or,EncryptJWT:()=>br,FlattenedEncrypt:()=>Pi,FlattenedSign:()=>fr,GeneralEncrypt:()=>Mi,GeneralSign:()=>gr,SignJWT:()=>wr,UnsecuredJWT:()=>zr,base64url:()=>Gr,calculateJwkThumbprint:()=>Rr,calculateJwkThumbprintUri:()=>Ir,compactDecrypt:()=>ki,compactVerify:()=>Gi,createLocalJWKSet:()=>Ur,createRemoteJWKSet:()=>Hr,decodeJwt:()=>Qr,decodeProtectedHeader:()=>Yr,errors:()=>Re,exportJWK:()=>Ri,exportPKCS8:()=>Ci,exportSPKI:()=>ji,flattenedDecrypt:()=>yi,flattenedVerify:()=>qi,generalDecrypt:()=>Si,generalVerify:()=>Yi,generateKeyPair:()=>io,generateSecret:()=>oo,importJWK:()=>ii,importPKCS8:()=>ni,importSPKI:()=>ti,importX509:()=>ei,jwtDecrypt:()=>lr,jwtVerify:()=>cr});var co,uo,lo=zt({"../node_modules/jose/dist/browser/index.js"(){Ei(),xi(),Ai(),Bi(),Xi(),Vi(),rr(),ur(),xr(),kr(),Li(),Fr(),Sr(),Ar(),jr(),Cr(),Tr(),Pr(),Jr(),qr(),Vr(),Ti(),ui(),Zr(),to(),Oe(),ro(),so(),Xr()}}),ho=Kt({"../node_modules/@inrupt/solid-client-authn-core/dist/util/token.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getWebidFromTokenPayload=t.fetchJwks=void 0;var e=ee(),n=(lo(),Gt(ao));async function i(t,n){const i=await(0,e.fetch)(t);if(200!==i.status)throw new Error(`Could not fetch JWKS for [${n}] at [${t}]: ${i.status} ${i.statusText}`);let r;try{r=(await i.json()).keys[0]}catch(e){throw new Error(`Malformed JWKS for [${n}] at [${t}]: ${e.message}`)}return r}t.fetchJwks=i,t.getWebidFromTokenPayload=async function(t,e,r,o){const s=await i(e,r);let a;try{const{payload:e}=await(0,n.jwtVerify)(t,await(0,n.importJWK)(s),{issuer:r,audience:o});a=e}catch(t){throw new Error(`Token verification failed: ${t.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(t){throw new Error(`The token has no 'webid' claim, and its 'sub' claim of [${a.sub}] is invalid as a URL - error [${t}].`)}}}}),fo=Kt({"../node_modules/@inrupt/solid-client-authn-core/dist/sessionInfo/ISessionInfo.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.isSupportedTokenType=void 0,t.isSupportedTokenType=function(t){return"string"==typeof t&&["DPoP","Bearer"].includes(t)}}}),po=Kt({"../node_modules/@inrupt/solid-client-authn-core/dist/sessionInfo/ISessionInfoManager.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.USER_SESSION_PREFIX=void 0,t.USER_SESSION_PREFIX="solidClientAuthenticationUser"}}),vo=Kt({"../node_modules/@inrupt/solid-client-authn-core/dist/login/oidc/IClientRegistrar.js"(t){function e(t){try{return new URL(t),!0}catch(t){return!1}}Object.defineProperty(t,"__esModule",{value:!0}),t.handleRegistration=t.determineSigningAlg=void 0,t.determineSigningAlg=function(t,e){var n;return null!==(n=e.find((e=>t.includes(e))))&&void 0!==n?n:null},t.handleRegistration=async function(t,n,i,r){const o=function(t,n){return void 0===t.clientId||e(t.clientId)?n.scopesSupported.includes("webid")&&void 0!==t.clientId&&e(t.clientId)?"solid-oidc":"dynamic":"static"}(t,n);return"dynamic"===o?r.getClient({sessionId:t.sessionId,clientName:t.clientName,redirectUrl:t.redirectUrl},n):(await i.setForUser(t.sessionId,{clientId:t.clientId}),t.clientSecret&&await i.setForUser(t.sessionId,{clientSecret:t.clientSecret}),t.clientName&&await i.setForUser(t.sessionId,{clientName:t.clientName}),{clientId:t.clientId,clientSecret:t.clientSecret,clientName:t.clientName,clientType:o})}}}),go=Kt({"../node_modules/@inrupt/solid-client-authn-core/dist/storage/StorageUtility.js"(t){var e=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.saveSessionInfoToStorage=t.loadOidcContextFromStorage=t.getSessionIdFromOauthState=void 0;var n=(lo(),Gt(ao)),i=e(Qt());t.getSessionIdFromOauthState=async function(t,e){return t.getForUser(e,"sessionId")},t.loadOidcContextFromStorage=async function(t,e,n){try{const[i,r,o,s]=await Promise.all([e.getForUser(t,"issuer",{errorIfNull:!0}),e.getForUser(t,"codeVerifier"),e.getForUser(t,"redirectUrl"),e.getForUser(t,"dpop",{errorIfNull:!0})]);return await e.deleteForUser(t,"codeVerifier"),{codeVerifier:r,redirectUrl:o,issuerConfig:await n.fetchConfig(i),dpop:"true"===s}}catch(e){throw new Error(`Failed to retrieve OIDC context from storage associated with session [${t}]: ${e}`)}},t.saveSessionInfoToStorage=async function(t,e,i,r,o,s,a){void 0!==o&&await t.setForUser(e,{refreshToken:o},{secure:s}),void 0!==i&&await t.setForUser(e,{webId:i},{secure:s}),void 0!==r&&await t.setForUser(e,{isLoggedIn:r},{secure:s}),void 0!==a&&await t.setForUser(e,{publicKey:JSON.stringify(a.publicKey),privateKey:JSON.stringify(await(0,n.exportJWK)(a.privateKey))},{secure:s})},t.default=class{constructor(t,e){this.secureStorage=t,this.insecureStorage=e}getKey(t){return`solidClientAuthenticationUser:${t}`}async getUserData(t,e){const n=await(e?this.secureStorage:this.insecureStorage).get(this.getKey(t));if(void 0===n)return{};try{return JSON.parse(n)}catch(r){throw new i.default(`Data for user [${t}] in [${e?"secure":"unsecure"}] storage is corrupted - expected valid JSON, but got: ${n}`)}}async setUserData(t,e,n){await(n?this.secureStorage:this.insecureStorage).set(this.getKey(t),JSON.stringify(e))}async get(t,e){const n=await((null==e?void 0:e.secure)?this.secureStorage:this.insecureStorage).get(t);if(void 0===n&&(null==e?void 0:e.errorIfNull))throw new i.default(`[${t}] is not stored`);return n}async set(t,e,n){return((null==n?void 0:n.secure)?this.secureStorage:this.insecureStorage).set(t,e)}async delete(t,e){return((null==e?void 0:e.secure)?this.secureStorage:this.insecureStorage).delete(t)}async getForUser(t,e,n){const r=await this.getUserData(t,null==n?void 0:n.secure);let o;if(r&&r[e]||(o=void 0),o=r[e],void 0===o&&(null==n?void 0:n.errorIfNull))throw new i.default(`Field [${e}] for user [${t}] is not stored`);return o||void 0}async setForUser(t,e,n){let i;try{i=await this.getUserData(t,null==n?void 0:n.secure)}catch(t){i={}}await this.setUserData(t,{...i,...e},null==n?void 0:n.secure)}async deleteForUser(t,e,n){const i=await this.getUserData(t,null==n?void 0:n.secure);delete i[e],await this.setUserData(t,i,null==n?void 0:n.secure)}async deleteAllUserData(t,e){await((null==e?void 0:e.secure)?this.secureStorage:this.insecureStorage).delete(this.getKey(t))}}}}),mo=Kt({"../node_modules/@inrupt/solid-client-authn-core/dist/storage/InMemoryStorage.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{constructor(){this.map={}}async get(t){return this.map[t]||void 0}async set(t,e){this.map[t]=e}async delete(t){delete this.map[t]}}}}),wo=Kt({"../node_modules/@inrupt/solid-client-authn-core/dist/errors/ConfigurationError.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=class extends Error{constructor(t){super(t)}};t.default=e}}),bo=Kt({"../node_modules/@inrupt/solid-client-authn-core/dist/errors/NotImplementedError.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=class extends Error{constructor(t){super(`[${t}] is not implemented`)}};t.default=e}}),yo=Kt({"../node_modules/@inrupt/solid-client-authn-core/dist/errors/InvalidResponseError.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidResponseError=void 0;var e=class extends Error{constructor(t){super(`Invalid response from OIDC provider: missing fields ${t}`),this.missingFields=t}};t.InvalidResponseError=e}}),xo=Kt({"../node_modules/@inrupt/solid-client-authn-core/dist/errors/OidcProviderError.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.OidcProviderError=void 0;var e=class extends Error{constructor(t,e,n){super(t),this.error=e,this.errorDescription=n}};t.OidcProviderError=e}});function ko(){if(!co&&!(co="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 co(uo)}var Eo,So,Fo=zt({"../node_modules/uuid/dist/esm-browser/rng.js"(){uo=new Uint8Array(16)}}),Ao=zt({"../node_modules/uuid/dist/esm-browser/regex.js"(){Eo=/^(?:[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}});function _o(t){return"string"==typeof t&&Eo.test(t)}var jo,Co,Ro,Io=zt({"../node_modules/uuid/dist/esm-browser/validate.js"(){Ao(),So=_o}});function To(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(jo[t[e+0]]+jo[t[e+1]]+jo[t[e+2]]+jo[t[e+3]]+"-"+jo[t[e+4]]+jo[t[e+5]]+"-"+jo[t[e+6]]+jo[t[e+7]]+"-"+jo[t[e+8]]+jo[t[e+9]]+"-"+jo[t[e+10]]+jo[t[e+11]]+jo[t[e+12]]+jo[t[e+13]]+jo[t[e+14]]+jo[t[e+15]]).toLowerCase();if(!So(n))throw TypeError("Stringified UUID is invalid");return n}var Oo,No,Po,Do,Mo,Uo=zt({"../node_modules/uuid/dist/esm-browser/stringify.js"(){for(Io(),jo=[],Co=0;Co<256;++Co)jo.push((Co+256).toString(16).substr(1));Ro=To}});function Lo(t,e,n){var i=e&&n||0,r=e||new Array(16),o=(t=t||{}).node||Oo,s=void 0!==t.clockseq?t.clockseq:No;if(null==o||null==s){var a=t.random||(t.rng||ko)();null==o&&(o=Oo=[1|a[0],a[1],a[2],a[3],a[4],a[5]]),null==s&&(s=No=16383&(a[6]<<8|a[7]))}var c=void 0!==t.msecs?t.msecs:Date.now(),u=void 0!==t.nsecs?t.nsecs:Do+1,l=c-Po+(u-Do)/1e4;if(l<0&&void 0===t.clockseq&&(s=s+1&16383),(l<0||c>Po)&&void 0===t.nsecs&&(u=0),u>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Po=c,Do=u,No=s;var h=(1e4*(268435455&(c+=122192928e5))+u)%4294967296;r[i++]=h>>>24&255,r[i++]=h>>>16&255,r[i++]=h>>>8&255,r[i++]=255&h;var d=c/4294967296*1e4&268435455;r[i++]=d>>>8&255,r[i++]=255&d,r[i++]=d>>>24&15|16,r[i++]=d>>>16&255,r[i++]=s>>>8|128,r[i++]=255&s;for(var f=0;f<6;++f)r[i+f]=o[f];return e||Ro(r)}var Bo,Jo=zt({"../node_modules/uuid/dist/esm-browser/v1.js"(){Fo(),Uo(),Po=0,Do=0,Mo=Lo}});function $o(t){if(!So(t))throw TypeError("Invalid UUID");var e,n=new Uint8Array(16);return n[0]=(e=parseInt(t.slice(0,8),16))>>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=255&e,n[4]=(e=parseInt(t.slice(9,13),16))>>>8,n[5]=255&e,n[6]=(e=parseInt(t.slice(14,18),16))>>>8,n[7]=255&e,n[8]=(e=parseInt(t.slice(19,23),16))>>>8,n[9]=255&e,n[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=255&e,n}var Ho,zo,Ko=zt({"../node_modules/uuid/dist/esm-browser/parse.js"(){Io(),Bo=$o}});function Wo(t,e,n){function i(t,i,r,o){if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));for(var e=[],n=0;n<t.length;++n)e.push(t.charCodeAt(n));return e}(t)),"string"==typeof i&&(i=Bo(i)),16!==i.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var s=new Uint8Array(16+t.length);if(s.set(i),s.set(t,i.length),(s=n(s))[6]=15&s[6]|e,s[8]=63&s[8]|128,r){o=o||0;for(var a=0;a<16;++a)r[o+a]=s[a];return r}return Ro(s)}try{i.name=t}catch(t){}return i.DNS=Ho,i.URL=zo,i}var qo,Vo=zt({"../node_modules/uuid/dist/esm-browser/v35.js"(){Uo(),Ko(),Ho="6ba7b810-9dad-11d1-80b4-00c04fd430c8",zo="6ba7b811-9dad-11d1-80b4-00c04fd430c8"}});function Go(t){if("string"==typeof t){var e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(var n=0;n<e.length;++n)t[n]=e.charCodeAt(n)}return function(t){for(var e=[],n=32*t.length,i="0123456789abcdef",r=0;r<n;r+=8){var o=t[r>>5]>>>r%32&255,s=parseInt(i.charAt(o>>>4&15)+i.charAt(15&o),16);e.push(s)}return e}(function(t,e){t[e>>5]|=128<<e%32,t[Xo(e)-1]=e;for(var n=1732584193,i=-271733879,r=-1732584194,o=271733878,s=0;s<t.length;s+=16){var a=n,c=i,u=r,l=o;n=Qo(n,i,r,o,t[s],7,-680876936),o=Qo(o,n,i,r,t[s+1],12,-389564586),r=Qo(r,o,n,i,t[s+2],17,606105819),i=Qo(i,r,o,n,t[s+3],22,-1044525330),n=Qo(n,i,r,o,t[s+4],7,-176418897),o=Qo(o,n,i,r,t[s+5],12,1200080426),r=Qo(r,o,n,i,t[s+6],17,-1473231341),i=Qo(i,r,o,n,t[s+7],22,-45705983),n=Qo(n,i,r,o,t[s+8],7,1770035416),o=Qo(o,n,i,r,t[s+9],12,-1958414417),r=Qo(r,o,n,i,t[s+10],17,-42063),i=Qo(i,r,o,n,t[s+11],22,-1990404162),n=Qo(n,i,r,o,t[s+12],7,1804603682),o=Qo(o,n,i,r,t[s+13],12,-40341101),r=Qo(r,o,n,i,t[s+14],17,-1502002290),n=ts(n,i=Qo(i,r,o,n,t[s+15],22,1236535329),r,o,t[s+1],5,-165796510),o=ts(o,n,i,r,t[s+6],9,-1069501632),r=ts(r,o,n,i,t[s+11],14,643717713),i=ts(i,r,o,n,t[s],20,-373897302),n=ts(n,i,r,o,t[s+5],5,-701558691),o=ts(o,n,i,r,t[s+10],9,38016083),r=ts(r,o,n,i,t[s+15],14,-660478335),i=ts(i,r,o,n,t[s+4],20,-405537848),n=ts(n,i,r,o,t[s+9],5,568446438),o=ts(o,n,i,r,t[s+14],9,-1019803690),r=ts(r,o,n,i,t[s+3],14,-187363961),i=ts(i,r,o,n,t[s+8],20,1163531501),n=ts(n,i,r,o,t[s+13],5,-1444681467),o=ts(o,n,i,r,t[s+2],9,-51403784),r=ts(r,o,n,i,t[s+7],14,1735328473),n=es(n,i=ts(i,r,o,n,t[s+12],20,-1926607734),r,o,t[s+5],4,-378558),o=es(o,n,i,r,t[s+8],11,-2022574463),r=es(r,o,n,i,t[s+11],16,1839030562),i=es(i,r,o,n,t[s+14],23,-35309556),n=es(n,i,r,o,t[s+1],4,-1530992060),o=es(o,n,i,r,t[s+4],11,1272893353),r=es(r,o,n,i,t[s+7],16,-155497632),i=es(i,r,o,n,t[s+10],23,-1094730640),n=es(n,i,r,o,t[s+13],4,681279174),o=es(o,n,i,r,t[s],11,-358537222),r=es(r,o,n,i,t[s+3],16,-722521979),i=es(i,r,o,n,t[s+6],23,76029189),n=es(n,i,r,o,t[s+9],4,-640364487),o=es(o,n,i,r,t[s+12],11,-421815835),r=es(r,o,n,i,t[s+15],16,530742520),n=ns(n,i=es(i,r,o,n,t[s+2],23,-995338651),r,o,t[s],6,-198630844),o=ns(o,n,i,r,t[s+7],10,1126891415),r=ns(r,o,n,i,t[s+14],15,-1416354905),i=ns(i,r,o,n,t[s+5],21,-57434055),n=ns(n,i,r,o,t[s+12],6,1700485571),o=ns(o,n,i,r,t[s+3],10,-1894986606),r=ns(r,o,n,i,t[s+10],15,-1051523),i=ns(i,r,o,n,t[s+1],21,-2054922799),n=ns(n,i,r,o,t[s+8],6,1873313359),o=ns(o,n,i,r,t[s+15],10,-30611744),r=ns(r,o,n,i,t[s+6],15,-1560198380),i=ns(i,r,o,n,t[s+13],21,1309151649),n=ns(n,i,r,o,t[s+4],6,-145523070),o=ns(o,n,i,r,t[s+11],10,-1120210379),r=ns(r,o,n,i,t[s+2],15,718787259),i=ns(i,r,o,n,t[s+9],21,-343485551),n=Yo(n,a),i=Yo(i,c),r=Yo(r,u),o=Yo(o,l)}return[n,i,r,o]}(function(t){if(0===t.length)return[];for(var e=8*t.length,n=new Uint32Array(Xo(e)),i=0;i<e;i+=8)n[i>>5]|=(255&t[i/8])<<i%32;return n}(t),8*t.length))}function Xo(t){return 14+(t+64>>>9<<4)+1}function Yo(t,e){var n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}function Zo(t,e,n,i,r,o){return Yo((s=Yo(Yo(e,t),Yo(i,o)))<<(a=r)|s>>>32-a,n);var s,a}function Qo(t,e,n,i,r,o,s){return Zo(e&n|~e&i,t,e,r,o,s)}function ts(t,e,n,i,r,o,s){return Zo(e&i|n&~i,t,e,r,o,s)}function es(t,e,n,i,r,o,s){return Zo(e^n^i,t,e,r,o,s)}function ns(t,e,n,i,r,o,s){return Zo(n^(e|~i),t,e,r,o,s)}var is,rs,os,ss=zt({"../node_modules/uuid/dist/esm-browser/md5.js"(){qo=Go}}),as=zt({"../node_modules/uuid/dist/esm-browser/v3.js"(){Vo(),ss(),is=Wo("v3",48,qo),rs=is}});function cs(t,e,n){var i=(t=t||{}).random||(t.rng||ko)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){n=n||0;for(var r=0;r<16;++r)e[n+r]=i[r];return e}return Ro(i)}var us,ls=zt({"../node_modules/uuid/dist/esm-browser/v4.js"(){Fo(),Uo(),os=cs}});function hs(t,e,n,i){switch(t){case 0:return e&n^~e&i;case 1:return e^n^i;case 2:return e&n^e&i^n&i;case 3:return e^n^i}}function ds(t,e){return t<<e|t>>>32-e}function fs(t){var e=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){var i=unescape(encodeURIComponent(t));t=[];for(var r=0;r<i.length;++r)t.push(i.charCodeAt(r))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);for(var o=Math.ceil((t.length/4+2)/16),s=new Array(o),a=0;a<o;++a){for(var c=new Uint32Array(16),u=0;u<16;++u)c[u]=t[64*a+4*u]<<24|t[64*a+4*u+1]<<16|t[64*a+4*u+2]<<8|t[64*a+4*u+3];s[a]=c}s[o-1][14]=8*(t.length-1)/Math.pow(2,32),s[o-1][14]=Math.floor(s[o-1][14]),s[o-1][15]=8*(t.length-1)&4294967295;for(var l=0;l<o;++l){for(var h=new Uint32Array(80),d=0;d<16;++d)h[d]=s[l][d];for(var f=16;f<80;++f)h[f]=ds(h[f-3]^h[f-8]^h[f-14]^h[f-16],1);for(var p=n[0],v=n[1],g=n[2],m=n[3],w=n[4],b=0;b<80;++b){var y=Math.floor(b/20),x=ds(p,5)+hs(y,v,g,m)+w+e[y]+h[b]>>>0;w=m,m=g,g=ds(v,30)>>>0,v=p,p=x}n[0]=n[0]+p>>>0,n[1]=n[1]+v>>>0,n[2]=n[2]+g>>>0,n[3]=n[3]+m>>>0,n[4]=n[4]+w>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]}var ps,vs,gs,ms,ws=zt({"../node_modules/uuid/dist/esm-browser/sha1.js"(){us=fs}}),bs=zt({"../node_modules/uuid/dist/esm-browser/v5.js"(){Vo(),ws(),ps=Wo("v5",80,us),vs=ps}}),ys=zt({"../node_modules/uuid/dist/esm-browser/nil.js"(){gs="00000000-0000-0000-0000-000000000000"}});function xs(t){if(!So(t))throw TypeError("Invalid UUID");return parseInt(t.substr(14,1),16)}var ks=zt({"../node_modules/uuid/dist/esm-browser/version.js"(){Io(),ms=xs}}),Es={};Wt(Es,{NIL:()=>gs,parse:()=>Bo,stringify:()=>Ro,v1:()=>Mo,v3:()=>rs,v4:()=>os,v5:()=>vs,validate:()=>So,version:()=>ms});var Ss=zt({"../node_modules/uuid/dist/esm-browser/index.js"(){Jo(),as(),ls(),bs(),ys(),ks(),Io(),Uo(),Ko()}}),Fs=Kt({"../node_modules/@inrupt/solid-client-authn-core/dist/authenticatedFetch/dpopUtils.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.generateDpopKeyPair=t.createDpopHeader=void 0;var e=(lo(),Gt(ao)),n=(Ss(),Gt(Es)),i=Zt();function r(t){const e=new URL(t);return new URL(e.pathname,e.origin).toString()}t.createDpopHeader=async function(t,o,s){return new e.SignJWT({htu:r(t),htm:o.toUpperCase(),jti:(0,n.v4)()}).setProtectedHeader({alg:i.PREFERRED_SIGNING_ALG[0],jwk:s.publicKey,typ:"dpop+jwt"}).setIssuedAt().sign(s.privateKey,{})},t.generateDpopKeyPair=async function(){const{privateKey:t,publicKey:n}=await(0,e.generateKeyPair)(i.PREFERRED_SIGNING_ALG[0]),r={privateKey:t,publicKey:await(0,e.exportJWK)(n)};return[r.publicKey.alg]=i.PREFERRED_SIGNING_ALG,r}}}),As=Kt({"../node_modules/@inrupt/solid-client-authn-core/dist/authenticatedFetch/fetchFactory.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.buildAuthenticatedFetch=t.DEFAULT_EXPIRATION_TIME_SECONDS=void 0;var e=ee(),n=Zt(),i=Fs(),r=xo(),o=yo();async function s(t,n,r,o,s){return t(r,await async function(t,n,r,o){if(void 0!==r)return async function(t,n,r,o){var s;const a=new e.Headers(null==o?void 0:o.headers);return a.set("Authorization",`DPoP ${n}`),a.set("DPoP",await(0,i.createDpopHeader)(t,null!==(s=null==o?void 0:o.method)&&void 0!==s?s:"get",r)),{...o,headers:a}}(t,n,r,o);const s=new e.Headers(null==o?void 0:o.headers);return s.set("Authorization",`Bearer ${n}`),{...o,headers:s}}(r.toString(),n,s,o))}t.DEFAULT_EXPIRATION_TIME_SECONDS=600;var a=e=>void 0!==e?e-n.REFRESH_BEFORE_EXPIRATION_SECONDS>0?e-n.REFRESH_BEFORE_EXPIRATION_SECONDS:e:t.DEFAULT_EXPIRATION_TIME_SECONDS;t.buildAuthenticatedFetch=async function(e,i,c){var u;let l,h=i;const d=null==c?void 0:c.refreshOptions;if(void 0!==d){const e=async()=>{var i,s,u,f;try{const{accessToken:r,refreshToken:o,expiresIn:s}=await async function(e,i,r){var o;const s=await e.tokenRefresher.refresh(e.sessionId,e.refreshToken,i);return null==r||r.emit(n.EVENTS.SESSION_EXTENDED,null!==(o=s.expiresIn)&&void 0!==o?o:t.DEFAULT_EXPIRATION_TIME_SECONDS),"string"==typeof s.refreshToken&&(null==r||r.emit(n.EVENTS.NEW_REFRESH_TOKEN,s.refreshToken)),{accessToken:s.accessToken,refreshToken:s.refreshToken,expiresIn:s.expiresIn}}(d,c.dpopKey,c.eventEmitter);h=r,void 0!==o&&(d.refreshToken=o),clearTimeout(l),l=setTimeout(e,1e3*a(s)),null===(i=c.eventEmitter)||void 0===i||i.emit(n.EVENTS.TIMEOUT_SET,l)}catch(t){t instanceof r.OidcProviderError&&(null===(s=null==c?void 0:c.eventEmitter)||void 0===s||s.emit(n.EVENTS.ERROR,t.error,t.errorDescription),null===(u=null==c?void 0:c.eventEmitter)||void 0===u||u.emit(n.EVENTS.SESSION_EXPIRED)),t instanceof o.InvalidResponseError&&t.missingFields.includes("access_token")&&(null===(f=null==c?void 0:c.eventEmitter)||void 0===f||f.emit(n.EVENTS.SESSION_EXPIRED))}};l=setTimeout(e,1e3*a(c.expiresIn)),null===(u=c.eventEmitter)||void 0===u||u.emit(n.EVENTS.TIMEOUT_SET,l)}else if(void 0!==c&&void 0!==c.eventEmitter){const t=setTimeout((()=>{c.eventEmitter.emit(n.EVENTS.SESSION_EXPIRED)}),1e3*a(c.expiresIn));c.eventEmitter.emit(n.EVENTS.TIMEOUT_SET,t)}return async(t,n)=>{let i=await s(e,h,t,n,null==c?void 0:c.dpopKey);const r=!i.ok&&![401,403].includes(i.status);return i.ok||r||i.url!==t&&void 0!==(null==c?void 0:c.dpopKey)&&(i=await s(e,h,i.url,n,c.dpopKey)),i}}}}),_s=Kt({"../node_modules/@inrupt/solid-client-authn-core/dist/storage/__mocks__/StorageUtility.js"(t){var e=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.mockStorageUtility=t.mockStorage=t.StorageUtilityMock=t.StorageUtilityGetResponse=void 0;var n=e(go());t.StorageUtilityGetResponse="getResponse",t.StorageUtilityMock={get:async()=>t.StorageUtilityGetResponse,set:async()=>{},delete:async()=>{},getForUser:async()=>t.StorageUtilityGetResponse,setForUser:async()=>{},deleteForUser:async()=>{},deleteAllUserData:async()=>{}},t.mockStorage=t=>{const e=t;return{get:async t=>{if(void 0!==e[t])return"string"==typeof e[t]?e[t]:JSON.stringify(e[t])},set:async(t,n)=>{e[t]=n},delete:async t=>{delete e[t]}}},t.mockStorageUtility=(e,i=!1)=>i?new n.default((0,t.mockStorage)(e),(0,t.mockStorage)({})):new n.default((0,t.mockStorage)({}),(0,t.mockStorage)(e))}}),js=Kt({"../node_modules/@inrupt/solid-client-authn-core/dist/index.js"(t){var e=t&&t.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(e,n);r&&!("get"in r?!e.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,i,r)}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),n=t&&t.__exportStar||function(t,n){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(n,i)||e(n,t,i)},i=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.StorageUtilityGetResponse=t.StorageUtilityMock=t.mockStorageUtility=t.mockStorage=t.buildAuthenticatedFetch=t.generateDpopKeyPair=t.createDpopHeader=t.OidcProviderError=t.InvalidResponseError=t.NotImplementedError=t.ConfigurationError=t.InMemoryStorage=t.getSessionIdFromOauthState=t.saveSessionInfoToStorage=t.loadOidcContextFromStorage=t.StorageUtility=t.determineSigningAlg=t.handleRegistration=t.USER_SESSION_PREFIX=t.isSupportedTokenType=t.fetchJwks=t.getWebidFromTokenPayload=t.AggregateHandler=void 0,n(Zt(),t);var r=te();Object.defineProperty(t,"AggregateHandler",{enumerable:!0,get:function(){return i(r).default}});var o=ho();Object.defineProperty(t,"getWebidFromTokenPayload",{enumerable:!0,get:function(){return o.getWebidFromTokenPayload}}),Object.defineProperty(t,"fetchJwks",{enumerable:!0,get:function(){return o.fetchJwks}});var s=fo();Object.defineProperty(t,"isSupportedTokenType",{enumerable:!0,get:function(){return s.isSupportedTokenType}});var a=po();Object.defineProperty(t,"USER_SESSION_PREFIX",{enumerable:!0,get:function(){return a.USER_SESSION_PREFIX}});var c=vo();Object.defineProperty(t,"handleRegistration",{enumerable:!0,get:function(){return c.handleRegistration}}),Object.defineProperty(t,"determineSigningAlg",{enumerable:!0,get:function(){return c.determineSigningAlg}});var u=go();Object.defineProperty(t,"StorageUtility",{enumerable:!0,get:function(){return i(u).default}}),Object.defineProperty(t,"loadOidcContextFromStorage",{enumerable:!0,get:function(){return u.loadOidcContextFromStorage}}),Object.defineProperty(t,"saveSessionInfoToStorage",{enumerable:!0,get:function(){return u.saveSessionInfoToStorage}}),Object.defineProperty(t,"getSessionIdFromOauthState",{enumerable:!0,get:function(){return u.getSessionIdFromOauthState}});var l=mo();Object.defineProperty(t,"InMemoryStorage",{enumerable:!0,get:function(){return i(l).default}});var h=wo();Object.defineProperty(t,"ConfigurationError",{enumerable:!0,get:function(){return i(h).default}});var d=bo();Object.defineProperty(t,"NotImplementedError",{enumerable:!0,get:function(){return i(d).default}});var f=yo();Object.defineProperty(t,"InvalidResponseError",{enumerable:!0,get:function(){return f.InvalidResponseError}});var p=xo();Object.defineProperty(t,"OidcProviderError",{enumerable:!0,get:function(){return p.OidcProviderError}});var v=Fs();Object.defineProperty(t,"createDpopHeader",{enumerable:!0,get:function(){return v.createDpopHeader}}),Object.defineProperty(t,"generateDpopKeyPair",{enumerable:!0,get:function(){return v.generateDpopKeyPair}});var g=As();Object.defineProperty(t,"buildAuthenticatedFetch",{enumerable:!0,get:function(){return g.buildAuthenticatedFetch}});var m=_s();Object.defineProperty(t,"mockStorage",{enumerable:!0,get:function(){return m.mockStorage}}),Object.defineProperty(t,"mockStorageUtility",{enumerable:!0,get:function(){return m.mockStorageUtility}}),Object.defineProperty(t,"StorageUtilityMock",{enumerable:!0,get:function(){return m.StorageUtilityMock}}),Object.defineProperty(t,"StorageUtilityGetResponse",{enumerable:!0,get:function(){return m.StorageUtilityGetResponse}})}}),Cs=Kt({"../node_modules/@inrupt/solid-client-authn-browser/dist/storage/StorageUtility.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=js();t.default=class extends e.StorageUtility{constructor(t,e){super(t,e)}}}}),Rs=Kt({"../node_modules/@inrupt/oidc-client/lib/oidc-client.min.js"(t,e){!function(n,i){if("object"==typeof t&&"object"==typeof e)e.exports=i();else if("function"==typeof define&&define.amd)define([],i);else{var r=i();for(var o in r)("object"==typeof t?t:n)[o]=r[o]}}(t,(function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=22)}([function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),i={debug:function(){},info:function(){},warn:function(){},error:function(){}},r=void 0,o=void 0;(e.Log=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.reset=function(){o=3,r=i},t.debug=function(){if(o>=4){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];r.debug.apply(r,Array.from(e))}},t.info=function(){if(o>=3){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];r.info.apply(r,Array.from(e))}},t.warn=function(){if(o>=2){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];r.warn.apply(r,Array.from(e))}},t.error=function(){if(o>=1){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];r.error.apply(r,Array.from(e))}},n(t,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 o},set:function(t){if(!(0<=t&&t<=4))throw new Error("Invalid log level");o=t}},{key:"logger",get:function(){return r},set:function(t){if(!t.debug&&t.info&&(t.debug=t.info),!(t.debug&&t.info&&t.warn&&t.error))throw new Error("Invalid logger");r=t}}]),t}()).reset()},function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),i={setInterval:function(t){function e(e,n){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t,e){return setInterval(t,e)})),clearInterval:function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){return clearInterval(t)}))},r=!1,o=null;e.Global=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t._testing=function(){r=!0},t.setXMLHttpRequest=function(t){o=t},n(t,null,[{key:"location",get:function(){if(!r)return location}},{key:"localStorage",get:function(){if(!r&&"undefined"!=typeof window)return localStorage}},{key:"sessionStorage",get:function(){if(!r&&"undefined"!=typeof window)return sessionStorage}},{key:"XMLHttpRequest",get:function(){if(!r&&"undefined"!=typeof window)return o||XMLHttpRequest}},{key:"timer",get:function(){if(!r)return i}}]),t}()},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.MetadataService=void 0;var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(0),o=n(7);function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var a=".well-known/openid-configuration";e.MetadataService=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.JsonService;if(s(this,t),!e)throw r.Log.error("MetadataService: No settings passed to MetadataService"),new Error("settings");this._settings=e,this._jsonService=new n(["application/jwk-set+json"])}return t.prototype.resetSigningKeys=function(){this._settings=this._settings||{},this._settings.signingKeys=void 0},t.prototype.getMetadata=function(){var t=this;return this._settings.metadata?(r.Log.debug("MetadataService.getMetadata: Returning metadata from settings"),Promise.resolve(this._settings.metadata)):this.metadataUrl?(r.Log.debug("MetadataService.getMetadata: getting metadata from",this.metadataUrl),this._jsonService.getJson(this.metadataUrl).then((function(e){return r.Log.debug("MetadataService.getMetadata: json received"),t._settings.metadata=Object.assign({},t._settings.metadataSeed||{},e),t._settings.metadata}))):(r.Log.error("MetadataService.getMetadata: No authority or metadataUrl configured on settings"),Promise.reject(new Error("No authority or metadataUrl configured on settings")))},t.prototype.getIssuer=function(){return this._getMetadataProperty("issuer")},t.prototype.getAuthorizationEndpoint=function(){return this._getMetadataProperty("authorization_endpoint")},t.prototype.getUserInfoEndpoint=function(){return this._getMetadataProperty("userinfo_endpoint")},t.prototype.getTokenEndpoint=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._getMetadataProperty("token_endpoint",t)},t.prototype.getCheckSessionIframe=function(){return this._getMetadataProperty("check_session_iframe",!0)},t.prototype.getEndSessionEndpoint=function(){return this._getMetadataProperty("end_session_endpoint",!0)},t.prototype.getRevocationEndpoint=function(){return this._getMetadataProperty("revocation_endpoint",!0)},t.prototype.getKeysEndpoint=function(){return this._getMetadataProperty("jwks_uri",!0)},t.prototype._getMetadataProperty=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return r.Log.debug("MetadataService.getMetadataProperty for: "+t),this.getMetadata().then((function(n){if(r.Log.debug("MetadataService.getMetadataProperty: metadata recieved"),void 0===n[t]){if(!0===e)return void r.Log.warn("MetadataService.getMetadataProperty: Metadata does not contain optional property "+t);throw r.Log.error("MetadataService.getMetadataProperty: Metadata does not contain property "+t),new Error("Metadata does not contain property "+t)}return n[t]}))},t.prototype.getSigningKeys=function(){var t=this;return this._settings.signingKeys?(r.Log.debug("MetadataService.getSigningKeys: Returning signingKeys from settings"),Promise.resolve(this._settings.signingKeys)):this._getMetadataProperty("jwks_uri").then((function(e){return r.Log.debug("MetadataService.getSigningKeys: jwks_uri received",e),t._jsonService.getJson(e).then((function(e){if(r.Log.debug("MetadataService.getSigningKeys: key set received",e),!e.keys)throw r.Log.error("MetadataService.getSigningKeys: Missing keys on keyset"),new Error("Missing keys on keyset");return t._settings.signingKeys=e.keys,t._settings.signingKeys}))}))},i(t,[{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(a)<0&&("/"!==this._metadataUrl[this._metadataUrl.length-1]&&(this._metadataUrl+="/"),this._metadataUrl+=a))),this._metadataUrl}}]),t}()},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.UrlUtility=void 0;var i=n(0),r=n(1);e.UrlUtility=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.addQueryParam=function(t,e,n){return t.indexOf("?")<0&&(t+="?"),"?"!==t[t.length-1]&&(t+="&"),t+=encodeURIComponent(e),(t+="=")+encodeURIComponent(n)},t.parseUrlFragment=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.Global;"string"!=typeof t&&(t=n.location.href);var o=t.lastIndexOf(e);o>=0&&(t=t.substr(o+1)),"?"===e&&(o=t.indexOf("#"))>=0&&(t=t.substr(0,o));for(var s,a={},c=/([^&=]+)=([^&]*)/g,u=0;s=c.exec(t);)if(a[decodeURIComponent(s[1])]=decodeURIComponent(s[2].replace(/\+/g," ")),u++>50)return i.Log.error("UrlUtility.parseUrlFragment: response exceeded expected number of parameters",t),{error:"Response exceeded expected number of parameters"};for(var l in a)return a;return{}},t}()},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.JoseUtil=void 0;var i,r=n(26),o=(i=n(33))&&i.__esModule?i:{default:i};e.JoseUtil=(0,o.default)({jws:r.jws,KeyUtil:r.KeyUtil,X509:r.X509,crypto:r.crypto,hextob64u:r.hextob64u,b64tohex:r.b64tohex,AllowedSigningAlgs:r.AllowedSigningAlgs})},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.OidcClientSettings=void 0;var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(0),s=n(23),a=n(6),c=n(24),u=n(2);function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var h=".well-known/openid-configuration",d="id_token",f="openid",p="client_secret_post";e.OidcClientSettings=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.authority,r=e.metadataUrl,o=e.metadata,h=e.signingKeys,v=e.metadataSeed,g=e.client_id,m=e.client_secret,w=e.response_type,b=void 0===w?d:w,y=e.scope,x=void 0===y?f:y,k=e.redirect_uri,E=e.post_logout_redirect_uri,S=e.client_authentication,F=void 0===S?p:S,A=e.prompt,_=e.display,j=e.max_age,C=e.ui_locales,R=e.acr_values,I=e.resource,T=e.response_mode,O=e.filterProtocolClaims,N=void 0===O||O,P=e.loadUserInfo,D=void 0===P||P,M=e.staleStateAge,U=void 0===M?900:M,L=e.clockSkew,B=void 0===L?300:L,J=e.clockService,$=void 0===J?new s.ClockService:J,H=e.userInfoJwtIssuer,z=void 0===H?"OP":H,K=e.mergeClaims,W=void 0!==K&&K,q=e.stateStore,V=void 0===q?new a.WebStorageStateStore:q,G=e.ResponseValidatorCtor,X=void 0===G?c.ResponseValidator:G,Y=e.MetadataServiceCtor,Z=void 0===Y?u.MetadataService:Y,Q=e.extraQueryParams,tt=void 0===Q?{}:Q,et=e.extraTokenParams,nt=void 0===et?{}:et;l(this,t),this._authority=n,this._metadataUrl=r,this._metadata=o,this._metadataSeed=v,this._signingKeys=h,this._client_id=g,this._client_secret=m,this._response_type=b,this._scope=x,this._redirect_uri=k,this._post_logout_redirect_uri=E,this._client_authentication=F,this._prompt=A,this._display=_,this._max_age=j,this._ui_locales=C,this._acr_values=R,this._resource=I,this._response_mode=T,this._filterProtocolClaims=!!N,this._loadUserInfo=!!D,this._staleStateAge=U,this._clockSkew=B,this._clockService=$,this._userInfoJwtIssuer=z,this._mergeClaims=!!W,this._stateStore=V,this._validator=new X(this),this._metadataService=new Z(this),this._extraQueryParams="object"===(void 0===tt?"undefined":i(tt))?tt:{},this._extraTokenParams="object"===(void 0===nt?"undefined":i(nt))?nt:{}}return t.prototype.getEpochTime=function(){return this._clockService.getEpochTime()},r(t,[{key:"client_id",get:function(){return this._client_id},set:function(t){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=t}},{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(t){if(this._authority)throw o.Log.error("OidcClientSettings.set_authority: authority has already been assigned."),new Error("authority has already been assigned.");this._authority=t}},{key:"metadataUrl",get:function(){return this._metadataUrl||(this._metadataUrl=this.authority,this._metadataUrl&&this._metadataUrl.indexOf(h)<0&&("/"!==this._metadataUrl[this._metadataUrl.length-1]&&(this._metadataUrl+="/"),this._metadataUrl+=h)),this._metadataUrl}},{key:"metadata",get:function(){return this._metadata},set:function(t){this._metadata=t}},{key:"metadataSeed",get:function(){return this._metadataSeed},set:function(t){this._metadataSeed=t}},{key:"signingKeys",get:function(){return this._signingKeys},set:function(t){this._signingKeys=t}},{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(t){this._extraQueryParams="object"===(void 0===t?"undefined":i(t))?t:{}}},{key:"extraTokenParams",get:function(){return this._extraTokenParams},set:function(t){this._extraTokenParams="object"===(void 0===t?"undefined":i(t))?t:{}}}]),t}()},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.WebStorageStateStore=void 0;var i=n(0),r=n(1);function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.WebStorageStateStore=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.prefix,i=void 0===n?"oidc.":n,s=e.store,a=void 0===s?r.Global.localStorage:s;o(this,t),this._store=a,this._prefix=i}return t.prototype.set=function(t,e){return i.Log.debug("WebStorageStateStore.set",t),this._store.setItem(t=this._prefix+t,e),Promise.resolve()},t.prototype.get=function(t){i.Log.debug("WebStorageStateStore.get",t);var e=this._store.getItem(t=this._prefix+t);return Promise.resolve(e)},t.prototype.remove=function(t){i.Log.debug("WebStorageStateStore.remove",t);var e=this._store.getItem(t=this._prefix+t);return this._store.removeItem(t),Promise.resolve(e)},t.prototype.getAllKeys=function(){i.Log.debug("WebStorageStateStore.getAllKeys");for(var t=[],e=0;e<this._store.length;e++){var n=this._store.key(e);0===n.indexOf(this._prefix)&&t.push(n.substr(this._prefix.length))}return Promise.resolve(t)},t}()},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.JsonService=void 0;var i=n(0),r=n(1);function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.JsonService=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.Global.XMLHttpRequest,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;o(this,t),this._contentTypes=e&&Array.isArray(e)?e.slice():[],this._contentTypes.push("application/json"),i&&this._contentTypes.push("application/jwt"),this._XMLHttpRequest=n,this._jwtHandler=i}return t.prototype.getJson=function(t,e){var n=this;if(!t)throw i.Log.error("JsonService.getJson: No url passed"),new Error("url");return i.Log.debug("JsonService.getJson, url: ",t),new Promise((function(r,o){var s=new n._XMLHttpRequest;s.open("GET",t);var a=n._contentTypes,c=n._jwtHandler;s.onload=function(){if(i.Log.debug("JsonService.getJson: HTTP response received, status",s.status),200===s.status){var e=s.getResponseHeader("Content-Type");if(e){var n=a.find((function(t){if(e.startsWith(t))return!0}));if("application/jwt"==n)return void c(s).then(r,o);if(n)try{return void r(JSON.parse(s.responseText))}catch(t){return i.Log.error("JsonService.getJson: Error parsing JSON response",t.message),void o(t)}}o(Error("Invalid response Content-Type: "+e+", from URL: "+t))}else o(Error(s.statusText+" ("+s.status+")"))},s.onerror=function(){i.Log.error("JsonService.getJson: network error"),o(Error("Network Error"))},e&&(i.Log.debug("JsonService.getJson: token passed, setting Authorization header"),s.setRequestHeader("Authorization","Bearer "+e)),s.send()}))},t.prototype.postForm=function(t,e,n){var r=this;if(!t)throw i.Log.error("JsonService.postForm: No url passed"),new Error("url");return i.Log.debug("JsonService.postForm, url: ",t),new Promise((function(o,s){var a=new r._XMLHttpRequest;a.open("POST",t);var c=r._contentTypes;a.onload=function(){if(i.Log.debug("JsonService.postForm: HTTP response received, status",a.status),200!==a.status){if(400===a.status&&(n=a.getResponseHeader("Content-Type"))&&c.find((function(t){if(n.startsWith(t))return!0})))try{var e=JSON.parse(a.responseText);if(e&&e.error)return i.Log.error("JsonService.postForm: Error from server: ",e.error),void s(new Error(e.error))}catch(t){return i.Log.error("JsonService.postForm: Error parsing JSON response",t.message),void s(t)}s(Error(a.statusText+" ("+a.status+")"))}else{var n;if((n=a.getResponseHeader("Content-Type"))&&c.find((function(t){if(n.startsWith(t))return!0})))try{return void o(JSON.parse(a.responseText))}catch(t){return i.Log.error("JsonService.postForm: Error parsing JSON response",t.message),void s(t)}s(Error("Invalid response Content-Type: "+n+", from URL: "+t))}},a.onerror=function(){i.Log.error("JsonService.postForm: network error"),s(Error("Network Error"))};var u="";for(var l in e){var h=e[l];h&&(u.length>0&&(u+="&"),u+=encodeURIComponent(l),u+="=",u+=encodeURIComponent(h))}a.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),void 0!==n&&a.setRequestHeader("Authorization","Basic "+btoa(n)),a.send(u)}))},t}()},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.SigninRequest=void 0;var i=n(0),r=n(3),o=n(13);e.SigninRequest=function(){function t(e){var n=e.url,s=e.client_id,a=e.redirect_uri,c=e.response_type,u=e.scope,l=e.authority,h=e.data,d=e.prompt,f=e.display,p=e.max_age,v=e.ui_locales,g=e.id_token_hint,m=e.login_hint,w=e.acr_values,b=e.resource,y=e.response_mode,x=e.request,k=e.request_uri,E=e.extraQueryParams,S=e.request_type,F=e.client_secret,A=e.extraTokenParams,_=e.skipUserInfo;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),!n)throw i.Log.error("SigninRequest.ctor: No url passed"),new Error("url");if(!s)throw i.Log.error("SigninRequest.ctor: No client_id passed"),new Error("client_id");if(!a)throw i.Log.error("SigninRequest.ctor: No redirect_uri passed"),new Error("redirect_uri");if(!c)throw i.Log.error("SigninRequest.ctor: No response_type passed"),new Error("response_type");if(!u)throw i.Log.error("SigninRequest.ctor: No scope passed"),new Error("scope");if(!l)throw i.Log.error("SigninRequest.ctor: No authority passed"),new Error("authority");var j=t.isOidc(c),C=t.isCode(c);y||(y=t.isCode(c)?"query":null),this.state=new o.SigninState({nonce:j,data:h,client_id:s,authority:l,redirect_uri:a,code_verifier:C,request_type:S,response_mode:y,client_secret:F,scope:u,extraTokenParams:A,skipUserInfo:_}),n=r.UrlUtility.addQueryParam(n,"client_id",s),n=r.UrlUtility.addQueryParam(n,"redirect_uri",a),n=r.UrlUtility.addQueryParam(n,"response_type",c),n=r.UrlUtility.addQueryParam(n,"scope",u),n=r.UrlUtility.addQueryParam(n,"state",this.state.id),j&&(n=r.UrlUtility.addQueryParam(n,"nonce",this.state.nonce)),C&&(n=r.UrlUtility.addQueryParam(n,"code_challenge",this.state.code_challenge),n=r.UrlUtility.addQueryParam(n,"code_challenge_method","S256"));var R={prompt:d,display:f,max_age:p,ui_locales:v,id_token_hint:g,login_hint:m,acr_values:w,resource:b,request:x,request_uri:k,response_mode:y};for(var I in R)R[I]&&(n=r.UrlUtility.addQueryParam(n,I,R[I]));for(var T in E)n=r.UrlUtility.addQueryParam(n,T,E[T]);this.url=n}return t.isOidc=function(t){return!!t.split(/\s+/g).filter((function(t){return"id_token"===t}))[0]},t.isOAuth=function(t){return!!t.split(/\s+/g).filter((function(t){return"token"===t}))[0]},t.isCode=function(t){return!!t.split(/\s+/g).filter((function(t){return"code"===t}))[0]},t}()},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.State=void 0;var i,r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(0),s=(i=n(14))&&i.__esModule?i:{default:i};function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.State=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.id,i=e.data,r=e.created,o=e.request_type;a(this,t),this._id=n||(0,s.default)(),this._data=i,this._created="number"==typeof r&&r>0?r:parseInt(Date.now()/1e3),this._request_type=o}return t.prototype.toStorageString=function(){return o.Log.debug("State.toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type})},t.fromStorageString=function(e){return o.Log.debug("State.fromStorageString"),new t(JSON.parse(e))},t.clearStaleState=function(e,n){var i=Date.now()/1e3-n;return e.getAllKeys().then((function(n){o.Log.debug("State.clearStaleState: got keys",n);for(var r=[],s=function(s){var a=n[s];c=e.get(a).then((function(n){var r=!1;if(n)try{var s=t.fromStorageString(n);o.Log.debug("State.clearStaleState: got item from key: ",a,s.created),s.created<=i&&(r=!0)}catch(t){o.Log.error("State.clearStaleState: Error parsing state for key",a,t.message),r=!0}else o.Log.debug("State.clearStaleState: no item in storage for key: ",a),r=!0;if(r)return o.Log.debug("State.clearStaleState: removed item for key: ",a),e.remove(a)})),r.push(c)},a=0;a<n.length;a++){var c;s(a)}return o.Log.debug("State.clearStaleState: waiting on promise count:",r.length),Promise.all(r)}))},r(t,[{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}}]),t}()},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.OidcClient=void 0;var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(0),o=n(5),s=n(12),a=n(8),c=n(34),u=n(35),l=n(36),h=n(13),d=n(9);function f(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.OidcClient=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};f(this,t),this._settings=e instanceof o.OidcClientSettings?e:new o.OidcClientSettings(e)}return t.prototype.createSigninRequest=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.response_type,i=e.scope,o=e.redirect_uri,s=e.data,c=e.state,u=e.prompt,l=e.display,h=e.max_age,d=e.ui_locales,f=e.id_token_hint,p=e.login_hint,v=e.acr_values,g=e.resource,m=e.request,w=e.request_uri,b=e.response_mode,y=e.extraQueryParams,x=e.extraTokenParams,k=e.request_type,E=e.skipUserInfo,S=arguments[1];r.Log.debug("OidcClient.createSigninRequest");var F=this._settings.client_id;i=i||this._settings.scope,o=o||this._settings.redirect_uri,u=u||this._settings.prompt,l=l||this._settings.display,h=h||this._settings.max_age,d=d||this._settings.ui_locales,v=v||this._settings.acr_values,g=g||this._settings.resource,b=b||this._settings.response_mode,y=y||this._settings.extraQueryParams,x=x||this._settings.extraTokenParams;var A=this._settings.authority;return a.SigninRequest.isCode(n=n||this._settings.response_type)&&"code"!==n?Promise.reject(new Error("OpenID Connect hybrid flow is not supported")):this._metadataService.getAuthorizationEndpoint().then((function(e){r.Log.debug("OidcClient.createSigninRequest: Received authorization endpoint",e);var _=new a.SigninRequest({url:e,client_id:F,redirect_uri:o,response_type:n,scope:i,data:s||c,authority:A,prompt:u,display:l,max_age:h,ui_locales:d,id_token_hint:f,login_hint:p,acr_values:v,resource:g,request:m,request_uri:w,extraQueryParams:y,extraTokenParams:x,request_type:k,response_mode:b,client_secret:t._settings.client_secret,skipUserInfo:E}),j=_.state;return(S=S||t._stateStore).set(j.id,j.toStorageString()).then((function(){return _}))}))},t.prototype.readSigninResponseState=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];r.Log.debug("OidcClient.readSigninResponseState");var i="query"===this._settings.response_mode||!this._settings.response_mode&&a.SigninRequest.isCode(this._settings.response_type),o=i?"?":"#",s=new c.SigninResponse(t,o);if(!s.state)return r.Log.error("OidcClient.readSigninResponseState: No state in response"),Promise.reject(new Error("No state in response"));e=e||this._stateStore;var u=n?e.remove.bind(e):e.get.bind(e);return u(s.state).then((function(t){if(!t)throw r.Log.error("OidcClient.readSigninResponseState: No matching state found in storage"),new Error("No matching state found in storage");return{state:h.SigninState.fromStorageString(t),response:s}}))},t.prototype.processSigninResponse=function(t,e){var n=this;return r.Log.debug("OidcClient.processSigninResponse"),this.readSigninResponseState(t,e,!0).then((function(t){var e=t.state,i=t.response;return r.Log.debug("OidcClient.processSigninResponse: Received state from storage; validating response"),n._validator.validateSigninResponse(e,i)}))},t.prototype.createSignoutRequest=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.id_token_hint,i=e.data,o=e.state,s=e.post_logout_redirect_uri,a=e.extraQueryParams,c=e.request_type,l=arguments[1];return r.Log.debug("OidcClient.createSignoutRequest"),s=s||this._settings.post_logout_redirect_uri,a=a||this._settings.extraQueryParams,this._metadataService.getEndSessionEndpoint().then((function(e){if(!e)throw r.Log.error("OidcClient.createSignoutRequest: No end session endpoint url returned"),new Error("no end session endpoint");r.Log.debug("OidcClient.createSignoutRequest: Received end session endpoint",e);var h=new u.SignoutRequest({url:e,id_token_hint:n,post_logout_redirect_uri:s,data:i||o,extraQueryParams:a,request_type:c}),d=h.state;return d&&(r.Log.debug("OidcClient.createSignoutRequest: Signout request has state to persist"),(l=l||t._stateStore).set(d.id,d.toStorageString())),h}))},t.prototype.readSignoutResponseState=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];r.Log.debug("OidcClient.readSignoutResponseState");var i=new l.SignoutResponse(t);if(!i.state)return r.Log.debug("OidcClient.readSignoutResponseState: No state in response"),i.error?(r.Log.warn("OidcClient.readSignoutResponseState: Response was error: ",i.error),Promise.reject(new s.ErrorResponse(i))):Promise.resolve({state:void 0,response:i});var o=i.state;e=e||this._stateStore;var a=n?e.remove.bind(e):e.get.bind(e);return a(o).then((function(t){if(!t)throw r.Log.error("OidcClient.readSignoutResponseState: No matching state found in storage"),new Error("No matching state found in storage");return{state:d.State.fromStorageString(t),response:i}}))},t.prototype.processSignoutResponse=function(t,e){var n=this;return r.Log.debug("OidcClient.processSignoutResponse"),this.readSignoutResponseState(t,e,!0).then((function(t){var e=t.state,i=t.response;return e?(r.Log.debug("OidcClient.processSignoutResponse: Received state from storage; validating response"),n._validator.validateSignoutResponse(e,i)):(r.Log.debug("OidcClient.processSignoutResponse: No state from storage; skipping validating response"),i)}))},t.prototype.clearStaleState=function(t){return r.Log.debug("OidcClient.clearStaleState"),d.State.clearStaleState(t=t||this._stateStore,this.settings.staleStateAge)},i(t,[{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}}]),t}()},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.TokenClient=void 0;var i=n(7),r=n(2),o=n(0);function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.TokenClient=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.JsonService,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.MetadataService;if(s(this,t),!e)throw o.Log.error("TokenClient.ctor: No settings passed"),new Error("settings");this._settings=e,this._jsonService=new n,this._metadataService=new a(this._settings)}return t.prototype.exchangeCode=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=Object.assign({},e)).grant_type=e.grant_type||"authorization_code",e.client_id=e.client_id||this._settings.client_id,e.client_secret=e.client_secret||this._settings.client_secret,e.redirect_uri=e.redirect_uri||this._settings.redirect_uri;var n=void 0,i=e._client_authentication||this._settings._client_authentication;return delete e._client_authentication,e.code?e.redirect_uri?e.code_verifier?e.client_id?e.client_secret||"client_secret_basic"!=i?("client_secret_basic"==i&&(n=e.client_id+":"+e.client_secret,delete e.client_id,delete e.client_secret),this._metadataService.getTokenEndpoint(!1).then((function(i){return o.Log.debug("TokenClient.exchangeCode: Received token endpoint"),t._jsonService.postForm(i,e,n).then((function(t){return o.Log.debug("TokenClient.exchangeCode: response received"),t}))}))):(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")))},t.prototype.exchangeRefreshToken=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=Object.assign({},e)).grant_type=e.grant_type||"refresh_token",e.client_id=e.client_id||this._settings.client_id,e.client_secret=e.client_secret||this._settings.client_secret;var n=void 0,i=e._client_authentication||this._settings._client_authentication;return delete e._client_authentication,e.refresh_token?e.client_id?("client_secret_basic"==i&&(n=e.client_id+":"+e.client_secret,delete e.client_id,delete e.client_secret),this._metadataService.getTokenEndpoint(!1).then((function(i){return o.Log.debug("TokenClient.exchangeRefreshToken: Received token endpoint"),t._jsonService.postForm(i,e,n).then((function(t){return o.Log.debug("TokenClient.exchangeRefreshToken: response received"),t}))}))):(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")))},t}()},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.ErrorResponse=void 0;var i=n(0);function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}e.ErrorResponse=function(t){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=n.error,a=n.error_description,c=n.error_uri,u=n.state,l=n.session_state;if(r(this,e),!s)throw i.Log.error("No error passed to ErrorResponse"),new Error("error");var h=o(this,t.call(this,a||s));return h.name="ErrorResponse",h.error=s,h.error_description=a,h.error_uri=c,h.state=u,h.session_state=l,h}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e}(Error)},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.SigninState=void 0;var i,r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(0),s=n(9),a=n(4),c=(i=n(14))&&i.__esModule?i:{default:i};function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}e.SigninState=function(t){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.nonce,r=n.authority,o=n.client_id,s=n.redirect_uri,h=n.code_verifier,d=n.response_mode,f=n.client_secret,p=n.scope,v=n.extraTokenParams,g=n.skipUserInfo;u(this,e);var m=l(this,t.call(this,arguments[0]));if(!0===i?m._nonce=(0,c.default)():i&&(m._nonce=i),!0===h?m._code_verifier=(0,c.default)()+(0,c.default)()+(0,c.default)():h&&(m._code_verifier=h),m.code_verifier){var w=a.JoseUtil.hashString(m.code_verifier,"SHA256");m._code_challenge=a.JoseUtil.hexToBase64Url(w)}return m._redirect_uri=s,m._authority=r,m._client_id=o,m._response_mode=d,m._client_secret=f,m._scope=p,m._extraTokenParams=v,m._skipUserInfo=g,m}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.toStorageString=function(){return o.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})},e.fromStorageString=function(t){return o.Log.debug("SigninState.fromStorageString"),new e(JSON.parse(t))},r(e,[{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}}]),e}(s.State)},function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){return("undefined"!=n&&null!==n&&void 0!==n.getRandomValues?i:r)().replace(/-/g,"")};var n="undefined"!=typeof window?window.crypto||window.msCrypto:null;function i(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(function(t){return(t^n.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16)}))}function r(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(function(t){return(t^16*Math.random()>>t/4).toString(16)}))}t.exports=e.default},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.User=void 0;var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(0);e.User=function(){function t(e){var n=e.id_token,i=e.session_state,r=e.access_token,o=e.refresh_token,s=e.token_type,a=e.scope,c=e.profile,u=e.expires_at,l=e.state;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.id_token=n,this.session_state=i,this.access_token=r,this.refresh_token=o,this.token_type=s,this.scope=a,this.profile=c,this.expires_at=u,this.state=l}return t.prototype.toStorageString=function(){return r.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})},t.fromStorageString=function(e){return r.Log.debug("User.fromStorageString"),new t(JSON.parse(e))},i(t,[{key:"expires_in",get:function(){if(this.expires_at){var t=parseInt(Date.now()/1e3);return this.expires_at-t}},set:function(t){var e=parseInt(t);if("number"==typeof e&&e>0){var n=parseInt(Date.now()/1e3);this.expires_at=n+e}}},{key:"expired",get:function(){var t=this.expires_in;if(void 0!==t)return t<=0}},{key:"scopes",get:function(){return(this.scope||"").split(" ")}}]),t}()},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.AccessTokenEvents=void 0;var i=n(0),r=n(46);function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.AccessTokenEvents=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.accessTokenExpiringNotificationTime,i=void 0===n?60:n,s=e.accessTokenExpiringTimer,a=void 0===s?new r.Timer("Access token expiring"):s,c=e.accessTokenExpiredTimer,u=void 0===c?new r.Timer("Access token expired"):c;o(this,t),this._accessTokenExpiringNotificationTime=i,this._accessTokenExpiring=a,this._accessTokenExpired=u}return t.prototype.load=function(t){if(t.access_token&&void 0!==t.expires_in){var e=t.expires_in;if(i.Log.debug("AccessTokenEvents.load: access token present, remaining duration:",e),e>0){var n=e-this._accessTokenExpiringNotificationTime;n<=0&&(n=1),i.Log.debug("AccessTokenEvents.load: registering expiring timer in:",n),this._accessTokenExpiring.init(n)}else i.Log.debug("AccessTokenEvents.load: canceling existing expiring timer becase we're past expiration."),this._accessTokenExpiring.cancel();var r=e+1;i.Log.debug("AccessTokenEvents.load: registering expired timer in:",r),this._accessTokenExpired.init(r)}else this._accessTokenExpiring.cancel(),this._accessTokenExpired.cancel()},t.prototype.unload=function(){i.Log.debug("AccessTokenEvents.unload: canceling existing access token timers"),this._accessTokenExpiring.cancel(),this._accessTokenExpired.cancel()},t.prototype.addAccessTokenExpiring=function(t){this._accessTokenExpiring.addHandler(t)},t.prototype.removeAccessTokenExpiring=function(t){this._accessTokenExpiring.removeHandler(t)},t.prototype.addAccessTokenExpired=function(t){this._accessTokenExpired.addHandler(t)},t.prototype.removeAccessTokenExpired=function(t){this._accessTokenExpired.removeHandler(t)},t}()},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.Event=void 0;var i=n(0);e.Event=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._name=e,this._callbacks=[]}return t.prototype.addHandler=function(t){this._callbacks.push(t)},t.prototype.removeHandler=function(t){var e=this._callbacks.findIndex((function(e){return e===t}));e>=0&&this._callbacks.splice(e,1)},t.prototype.raise=function(){i.Log.debug("Event: Raising event: "+this._name);for(var t=0;t<this._callbacks.length;t++){var e;(e=this._callbacks)[t].apply(e,arguments)}},t}()},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.SessionMonitor=void 0;var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(0),o=n(19),s=n(1);function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.SessionMonitor=function(){function t(e){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.CheckSessionIFrame,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.Global.timer;if(a(this,t),!e)throw r.Log.error("SessionMonitor.ctor: No user manager passed to SessionMonitor"),new Error("userManager");this._userManager=e,this._CheckSessionIFrameCtor=i,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(t){t?n._start(t):n._settings.monitorAnonymousSession&&n._userManager.querySessionStatus().then((function(t){var e={session_state:t.session_state};t.sub&&t.sid&&(e.profile={sub:t.sub,sid:t.sid}),n._start(e)})).catch((function(t){r.Log.error("SessionMonitor ctor: error from querySessionStatus:",t.message)}))})).catch((function(t){r.Log.error("SessionMonitor ctor: error from getUser:",t.message)})))}return t.prototype._start=function(t){var e=this,n=t.session_state;n&&(t.profile?(this._sub=t.profile.sub,this._sid=t.profile.sid,r.Log.debug("SessionMonitor._start: session_state:",n,", sub:",this._sub)):(this._sub=void 0,this._sid=void 0,r.Log.debug("SessionMonitor._start: session_state:",n,", anonymous user")),this._checkSessionIFrame?this._checkSessionIFrame.start(n):this._metadataService.getCheckSessionIframe().then((function(t){if(t){r.Log.debug("SessionMonitor._start: Initializing check session iframe");var i=e._client_id,o=e._checkSessionInterval,s=e._stopCheckSessionOnError;e._checkSessionIFrame=new e._CheckSessionIFrameCtor(e._callback.bind(e),i,t,o,s),e._checkSessionIFrame.load().then((function(){e._checkSessionIFrame.start(n)}))}else r.Log.warn("SessionMonitor._start: No check session iframe found in the metadata")})).catch((function(t){r.Log.error("SessionMonitor._start: Error from getCheckSessionIframe:",t.message)})))},t.prototype._stop=function(){var t=this;if(this._sub=void 0,this._sid=void 0,this._checkSessionIFrame&&(r.Log.debug("SessionMonitor._stop"),this._checkSessionIFrame.stop()),this._settings.monitorAnonymousSession)var e=this._timer.setInterval((function(){t._timer.clearInterval(e),t._userManager.querySessionStatus().then((function(e){var n={session_state:e.session_state};e.sub&&e.sid&&(n.profile={sub:e.sub,sid:e.sid}),t._start(n)})).catch((function(t){r.Log.error("SessionMonitor: error from querySessionStatus:",t.message)}))}),1e3)},t.prototype._callback=function(){var t=this;this._userManager.querySessionStatus().then((function(e){var n=!0;e?e.sub===t._sub?(n=!1,t._checkSessionIFrame.start(e.session_state),e.sid===t._sid?r.Log.debug("SessionMonitor._callback: Same sub still logged in at OP, restarting check session iframe; session_state:",e.session_state):(r.Log.debug("SessionMonitor._callback: Same sub still logged in at OP, session state has changed, restarting check session iframe; session_state:",e.session_state),t._userManager.events._raiseUserSessionChanged())):r.Log.debug("SessionMonitor._callback: Different subject signed into OP:",e.sub):r.Log.debug("SessionMonitor._callback: Subject no longer signed into OP"),n&&(t._sub?(r.Log.debug("SessionMonitor._callback: SessionMonitor._callback; raising signed out event"),t._userManager.events._raiseUserSignedOut()):(r.Log.debug("SessionMonitor._callback: SessionMonitor._callback; raising signed in event"),t._userManager.events._raiseUserSignedIn()))})).catch((function(e){t._sub&&(r.Log.debug("SessionMonitor._callback: Error calling queryCurrentSigninSession; raising signed out event",e.message),t._userManager.events._raiseUserSignedOut())}))},i(t,[{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}}]),t}()},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.CheckSessionIFrame=void 0;var i=n(0);function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.CheckSessionIFrame=function(){function t(e,n,i,o){var s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];r(this,t),this._callback=e,this._client_id=n,this._url=i,this._interval=o||2e3,this._stopOnError=s;var a=i.indexOf("/",i.indexOf("//")+2);this._frame_origin=i.substr(0,a),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=i}return t.prototype.load=function(){var t=this;return new Promise((function(e){t._frame.onload=function(){e()},window.document.body.appendChild(t._frame),t._boundMessageEvent=t._message.bind(t),window.addEventListener("message",t._boundMessageEvent,!1)}))},t.prototype._message=function(t){t.origin===this._frame_origin&&t.source===this._frame.contentWindow&&("error"===t.data?(i.Log.error("CheckSessionIFrame: error message from check session op iframe"),this._stopOnError&&this.stop()):"changed"===t.data?(i.Log.debug("CheckSessionIFrame: changed message from check session op iframe"),this.stop(),this._callback()):i.Log.debug("CheckSessionIFrame: "+t.data+" message from check session op iframe"))},t.prototype.start=function(t){var e=this;if(this._session_state!==t){i.Log.debug("CheckSessionIFrame.start"),this.stop(),this._session_state=t;var n=function(){e._frame.contentWindow.postMessage(e._client_id+" "+e._session_state,e._frame_origin)};n(),this._timer=window.setInterval(n,this._interval)}},t.prototype.stop=function(){this._session_state=null,this._timer&&(i.Log.debug("CheckSessionIFrame.stop"),window.clearInterval(this._timer),this._timer=null)},t}()},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.TokenRevocationClient=void 0;var i=n(0),r=n(2),o=n(1);function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var a="access_token",c="refresh_token";e.TokenRevocationClient=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.Global.XMLHttpRequest,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.MetadataService;if(s(this,t),!e)throw i.Log.error("TokenRevocationClient.ctor: No settings provided"),new Error("No settings provided.");this._settings=e,this._XMLHttpRequestCtor=n,this._metadataService=new a(this._settings)}return t.prototype.revoke=function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"access_token";if(!t)throw i.Log.error("TokenRevocationClient.revoke: No token provided"),new Error("No token provided.");if(r!==a&&r!=c)throw i.Log.error("TokenRevocationClient.revoke: Invalid token type"),new Error("Invalid token type.");return this._metadataService.getRevocationEndpoint().then((function(o){if(o)return i.Log.debug("TokenRevocationClient.revoke: Revoking "+r),n._revoke(o,n._settings.client_id,n._settings.client_secret,t,r);if(e)throw i.Log.error("TokenRevocationClient.revoke: Revocation not supported"),new Error("Revocation not supported")}))},t.prototype._revoke=function(t,e,n,r,o){var s=this;return new Promise((function(a,c){var u=new s._XMLHttpRequestCtor;u.open("POST",t),u.onload=function(){i.Log.debug("TokenRevocationClient.revoke: HTTP response received, status",u.status),200===u.status?a():c(Error(u.statusText+" ("+u.status+")"))},u.onerror=function(){i.Log.debug("TokenRevocationClient.revoke: Network Error."),c("Network Error")};var l="client_id="+encodeURIComponent(e);n&&(l+="&client_secret="+encodeURIComponent(n)),l+="&token_type_hint="+encodeURIComponent(o),l+="&token="+encodeURIComponent(r),u.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),u.send(l)}))},t}()},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.CordovaPopupWindow=void 0;var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(0);e.CordovaPopupWindow=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._promise=new Promise((function(t,e){n._resolve=t,n._reject=e})),this.features=e.popupWindowFeatures||"location=no,toolbar=no,zoom=no",this.target=e.popupWindowTarget||"_blank",this.redirect_uri=e.startUrl,r.Log.debug("CordovaPopupWindow.ctor: redirect_uri: "+this.redirect_uri)}return t.prototype._isInAppBrowserInstalled=function(t){return["cordova-plugin-inappbrowser","cordova-plugin-inappbrowser.inappbrowser","org.apache.cordova.inappbrowser"].some((function(e){return t.hasOwnProperty(e)}))},t.prototype.navigate=function(t){if(t&&t.url){if(!window.cordova)return this._error("cordova is undefined");var e=window.cordova.require("cordova/plugin_list").metadata;if(!1===this._isInAppBrowserInstalled(e))return this._error("InAppBrowser plugin not found");this._popup=cordova.InAppBrowser.open(t.url,this.target,this.features),this._popup?(r.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},t.prototype._loadStartCallback=function(t){0===t.url.indexOf(this.redirect_uri)&&this._success({url:t.url})},t.prototype._exitCallback=function(t){this._error(t)},t.prototype._success=function(t){this._cleanup(),r.Log.debug("CordovaPopupWindow: Successful response from cordova popup window"),this._resolve(t)},t.prototype._error=function(t){this._cleanup(),r.Log.error(t),this._reject(new Error(t))},t.prototype.close=function(){this._cleanup()},t.prototype._cleanup=function(){this._popup&&(r.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},i(t,[{key:"promise",get:function(){return this._promise}}]),t}()},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var i=n(0),r=n(10),o=n(5),s=n(6),a=n(37),c=n(38),u=n(16),l=n(2),h=n(48),d=n(49),f=n(19),p=n(20),v=n(18),g=n(1),m=n(15),w=n(50);e.default={Version:w.Version,Log:i.Log,OidcClient:r.OidcClient,OidcClientSettings:o.OidcClientSettings,WebStorageStateStore:s.WebStorageStateStore,InMemoryWebStorage:a.InMemoryWebStorage,UserManager:c.UserManager,AccessTokenEvents:u.AccessTokenEvents,MetadataService:l.MetadataService,CordovaPopupNavigator:h.CordovaPopupNavigator,CordovaIFrameNavigator:d.CordovaIFrameNavigator,CheckSessionIFrame:f.CheckSessionIFrame,TokenRevocationClient:p.TokenRevocationClient,SessionMonitor:v.SessionMonitor,Global:g.Global,User:m.User},t.exports=e.default},function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ClockService=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.prototype.getEpochTime=function(){return Promise.resolve(Date.now()/1e3|0)},t}()},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.ResponseValidator=void 0;var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=n(0),o=n(2),s=n(25),a=n(11),c=n(12),u=n(4);function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var h=["nonce","at_hash","iat","nbf","exp","aud","iss","c_hash"];e.ResponseValidator=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.MetadataService,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.UserInfoService,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:u.JoseUtil,h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:a.TokenClient;if(l(this,t),!e)throw r.Log.error("ResponseValidator.ctor: No settings passed to ResponseValidator"),new Error("settings");this._settings=e,this._metadataService=new n(this._settings),this._userInfoService=new i(this._settings),this._joseUtil=c,this._tokenClient=new h(this._settings)}return t.prototype.validateSigninResponse=function(t,e){var n=this;return r.Log.debug("ResponseValidator.validateSigninResponse"),this._processSigninParams(t,e).then((function(e){return r.Log.debug("ResponseValidator.validateSigninResponse: state processed"),n._validateTokens(t,e).then((function(e){return r.Log.debug("ResponseValidator.validateSigninResponse: tokens validated"),n._processClaims(t,e).then((function(t){return r.Log.debug("ResponseValidator.validateSigninResponse: claims processed"),t}))}))}))},t.prototype.validateSignoutResponse=function(t,e){return t.id!==e.state?(r.Log.error("ResponseValidator.validateSignoutResponse: State does not match"),Promise.reject(new Error("State does not match"))):(r.Log.debug("ResponseValidator.validateSignoutResponse: state validated"),e.state=t.data,e.error?(r.Log.warn("ResponseValidator.validateSignoutResponse: Response was error",e.error),Promise.reject(new c.ErrorResponse(e))):Promise.resolve(e))},t.prototype._processSigninParams=function(t,e){if(t.id!==e.state)return r.Log.error("ResponseValidator._processSigninParams: State does not match"),Promise.reject(new Error("State does not match"));if(!t.client_id)return r.Log.error("ResponseValidator._processSigninParams: No client_id on state"),Promise.reject(new Error("No client_id on state"));if(!t.authority)return r.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!==t.authority)return r.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=t.authority;if(this._settings.client_id){if(this._settings.client_id&&this._settings.client_id!==t.client_id)return r.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=t.client_id;return r.Log.debug("ResponseValidator._processSigninParams: state validated"),e.state=t.data,e.error?(r.Log.warn("ResponseValidator._processSigninParams: Response was error",e.error),Promise.reject(new c.ErrorResponse(e))):t.nonce&&!e.id_token?(r.Log.error("ResponseValidator._processSigninParams: Expecting id_token in response"),Promise.reject(new Error("No id_token in response"))):!t.nonce&&e.id_token?(r.Log.error("ResponseValidator._processSigninParams: Not expecting id_token in response"),Promise.reject(new Error("Unexpected id_token in response"))):t.code_verifier&&!e.code?(r.Log.error("ResponseValidator._processSigninParams: Expecting code in response"),Promise.reject(new Error("No code in response"))):!t.code_verifier&&e.code?(r.Log.error("ResponseValidator._processSigninParams: Not expecting code in response"),Promise.reject(new Error("Unexpected code in response"))):(e.scope||(e.scope=t.scope),Promise.resolve(e))},t.prototype._processClaims=function(t,e){var n=this;if(e.isOpenIdConnect){if(r.Log.debug("ResponseValidator._processClaims: response is OIDC, processing claims"),e.profile=this._filterProtocolClaims(e.profile),!0!==t.skipUserInfo&&this._settings.loadUserInfo&&e.access_token)return r.Log.debug("ResponseValidator._processClaims: loading user info"),this._userInfoService.getClaims(e.access_token).then((function(t){return r.Log.debug("ResponseValidator._processClaims: user info claims received from user info endpoint"),t.sub!==e.profile.sub?(r.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"))):(e.profile=n._mergeClaims(e.profile,t),r.Log.debug("ResponseValidator._processClaims: user info claims received, updated profile:",e.profile),e)}));r.Log.debug("ResponseValidator._processClaims: not loading user info")}else r.Log.debug("ResponseValidator._processClaims: response is not OIDC, not processing claims");return Promise.resolve(e)},t.prototype._mergeClaims=function(t,e){var n=Object.assign({},t);for(var r in e){var o=e[r];Array.isArray(o)||(o=[o]);for(var s=0;s<o.length;s++){var a=o[s];n[r]?Array.isArray(n[r])?n[r].indexOf(a)<0&&n[r].push(a):n[r]!==a&&(n[r]="object"===(void 0===a?"undefined":i(a))&&this._settings.mergeClaims?this._mergeClaims(n[r],a):[n[r],a]):n[r]=a}}return n},t.prototype._filterProtocolClaims=function(t){r.Log.debug("ResponseValidator._filterProtocolClaims, incoming claims:",t);var e=Object.assign({},t);return this._settings._filterProtocolClaims?(h.forEach((function(t){delete e[t]})),r.Log.debug("ResponseValidator._filterProtocolClaims: protocol claims filtered",e)):r.Log.debug("ResponseValidator._filterProtocolClaims: protocol claims not filtered"),e},t.prototype._validateTokens=function(t,e){return e.code?(r.Log.debug("ResponseValidator._validateTokens: Validating code"),this._processCode(t,e)):e.id_token?e.access_token?(r.Log.debug("ResponseValidator._validateTokens: Validating id_token and access_token"),this._validateIdTokenAndAccessToken(t,e)):(r.Log.debug("ResponseValidator._validateTokens: Validating id_token"),this._validateIdToken(t,e)):(r.Log.debug("ResponseValidator._validateTokens: No code to process or id_token to validate"),Promise.resolve(e))},t.prototype._processCode=function(t,e){var n=this,o={client_id:t.client_id,client_secret:t.client_secret,code:e.code,redirect_uri:t.redirect_uri,code_verifier:t.code_verifier};return t.extraTokenParams&&"object"===i(t.extraTokenParams)&&Object.assign(o,t.extraTokenParams),this._tokenClient.exchangeCode(o).then((function(i){for(var o in i)e[o]=i[o];return e.id_token?(r.Log.debug("ResponseValidator._processCode: token response successful, processing id_token"),n._validateIdTokenAttributes(t,e)):(r.Log.debug("ResponseValidator._processCode: token response successful, returning response"),e)}))},t.prototype._validateIdTokenAttributes=function(t,e){var n=this;return this._metadataService.getIssuer().then((function(i){var o=t.client_id,s=n._settings.clockSkew;return r.Log.debug("ResponseValidator._validateIdTokenAttributes: Validaing JWT attributes; using clock skew (in seconds) of: ",s),n._settings.getEpochTime().then((function(a){return n._joseUtil.validateJwtAttributes(e.id_token,i,o,s,a).then((function(n){return t.nonce&&t.nonce!==n.nonce?(r.Log.error("ResponseValidator._validateIdTokenAttributes: Invalid nonce in id_token"),Promise.reject(new Error("Invalid nonce in id_token"))):n.sub?(e.profile=n,e):(r.Log.error("ResponseValidator._validateIdTokenAttributes: No sub present in id_token"),Promise.reject(new Error("No sub present in id_token")))}))}))}))},t.prototype._validateIdTokenAndAccessToken=function(t,e){var n=this;return this._validateIdToken(t,e).then((function(t){return n._validateAccessToken(t)}))},t.prototype._getSigningKeyForJwt=function(t){var e=this;return this._metadataService.getSigningKeys().then((function(n){var i=t.header.kid;if(!n)return r.Log.error("ResponseValidator._validateIdToken: No signing keys from metadata"),Promise.reject(new Error("No signing keys from metadata"));r.Log.debug("ResponseValidator._validateIdToken: Received signing keys");var o=void 0;if(i)o=n.filter((function(t){return t.kid===i}))[0];else{if((n=e._filterByAlg(n,t.header.alg)).length>1)return r.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=n[0]}return Promise.resolve(o)}))},t.prototype._getSigningKeyForJwtWithSingleRetry=function(t){var e=this;return this._getSigningKeyForJwt(t).then((function(n){return n?Promise.resolve(n):(e._metadataService.resetSigningKeys(),e._getSigningKeyForJwt(t))}))},t.prototype._validateIdToken=function(t,e){var n=this;if(!t.nonce)return r.Log.error("ResponseValidator._validateIdToken: No nonce on state"),Promise.reject(new Error("No nonce on state"));var i=this._joseUtil.parseJwt(e.id_token);return i&&i.header&&i.payload?t.nonce!==i.payload.nonce?(r.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 r.Log.debug("ResponseValidator._validateIdToken: Received issuer"),n._getSigningKeyForJwtWithSingleRetry(i).then((function(s){if(!s)return r.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 a=t.client_id,c=n._settings.clockSkew;return r.Log.debug("ResponseValidator._validateIdToken: Validaing JWT; using clock skew (in seconds) of: ",c),n._joseUtil.validateJwt(e.id_token,s,o,a,c).then((function(){return r.Log.debug("ResponseValidator._validateIdToken: JWT validation successful"),i.payload.sub?(e.profile=i.payload,e):(r.Log.error("ResponseValidator._validateIdToken: No sub present in id_token"),Promise.reject(new Error("No sub present in id_token")))}))}))})):(r.Log.error("ResponseValidator._validateIdToken: Failed to parse id_token",i),Promise.reject(new Error("Failed to parse id_token")))},t.prototype._filterByAlg=function(t,e){var n=null;if(e.startsWith("RS"))n="RSA";else if(e.startsWith("PS"))n="PS";else{if(!e.startsWith("ES"))return r.Log.debug("ResponseValidator._filterByAlg: alg not supported: ",e),[];n="EC"}return r.Log.debug("ResponseValidator._filterByAlg: Looking for keys that match kty: ",n),t=t.filter((function(t){return t.kty===n})),r.Log.debug("ResponseValidator._filterByAlg: Number of keys that match kty: ",n,t.length),t},t.prototype._validateAccessToken=function(t){if(!t.profile)return r.Log.error("ResponseValidator._validateAccessToken: No profile loaded from id_token"),Promise.reject(new Error("No profile loaded from id_token"));if(!t.profile.at_hash)return r.Log.error("ResponseValidator._validateAccessToken: No at_hash in id_token"),Promise.reject(new Error("No at_hash in id_token"));if(!t.id_token)return r.Log.error("ResponseValidator._validateAccessToken: No id_token"),Promise.reject(new Error("No id_token"));var e=this._joseUtil.parseJwt(t.id_token);if(!e||!e.header)return r.Log.error("ResponseValidator._validateAccessToken: Failed to parse id_token",e),Promise.reject(new Error("Failed to parse id_token"));var n=e.header.alg;if(!n||5!==n.length)return r.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",n),Promise.reject(new Error("Unsupported alg: "+n));var i=n.substr(2,3);if(!i)return r.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",n,i),Promise.reject(new Error("Unsupported alg: "+n));if(256!==(i=parseInt(i))&&384!==i&&512!==i)return r.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",n,i),Promise.reject(new Error("Unsupported alg: "+n));var o="sha"+i,s=this._joseUtil.hashString(t.access_token,o);if(!s)return r.Log.error("ResponseValidator._validateAccessToken: access_token hash failed:",o),Promise.reject(new Error("Failed to validate at_hash"));var a=s.substr(0,s.length/2),c=this._joseUtil.hexToBase64Url(a);return c!==t.profile.at_hash?(r.Log.error("ResponseValidator._validateAccessToken: Failed to validate at_hash",c,t.profile.at_hash),Promise.reject(new Error("Failed to validate at_hash"))):(r.Log.debug("ResponseValidator._validateAccessToken: success"),Promise.resolve(t))},t}()},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.UserInfoService=void 0;var i=n(7),r=n(2),o=n(0),s=n(4);function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.UserInfoService=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.JsonService,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.MetadataService,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:s.JoseUtil;if(a(this,t),!e)throw o.Log.error("UserInfoService.ctor: No settings passed"),new Error("settings");this._settings=e,this._jsonService=new n(void 0,void 0,this._getClaimsFromJwt.bind(this)),this._metadataService=new c(this._settings),this._joseUtil=u}return t.prototype.getClaims=function(t){var e=this;return t?this._metadataService.getUserInfoEndpoint().then((function(n){return o.Log.debug("UserInfoService.getClaims: received userinfo url",n),e._jsonService.getJson(n,t).then((function(t){return o.Log.debug("UserInfoService.getClaims: claims received",t),t}))})):(o.Log.error("UserInfoService.getClaims: No token passed"),Promise.reject(new Error("A token is required")))},t.prototype._getClaimsFromJwt=function(t){var e=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,r=void 0;switch(this._settings.userInfoJwtIssuer){case"OP":r=this._metadataService.getIssuer();break;case"ANY":r=Promise.resolve(n.payload.iss);break;default:r=Promise.resolve(this._settings.userInfoJwtIssuer)}return r.then((function(r){return o.Log.debug("UserInfoService._getClaimsFromJwt: Received issuer:"+r),e._metadataService.getSigningKeys().then((function(s){if(!s)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 a=void 0;if(i)a=s.filter((function(t){return t.kid===i}))[0];else{if((s=e._filterByAlg(s,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"));a=s[0]}if(!a)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=e._settings.client_id,u=e._settings.clockSkew;return o.Log.debug("UserInfoService._getClaimsFromJwt: Validaing JWT; using clock skew (in seconds) of: ",u),e._joseUtil.validateJwt(t.responseText,a,r,c,u,void 0,!0).then((function(){return o.Log.debug("UserInfoService._getClaimsFromJwt: JWT validation successful"),n.payload}))}))}))}catch(t){return o.Log.error("UserInfoService._getClaimsFromJwt: Error parsing JWT response",t.message),void reject(t)}},t.prototype._filterByAlg=function(t,e){var n=null;if(e.startsWith("RS"))n="RSA";else if(e.startsWith("PS"))n="PS";else{if(!e.startsWith("ES"))return o.Log.debug("UserInfoService._filterByAlg: alg not supported: ",e),[];n="EC"}return o.Log.debug("UserInfoService._filterByAlg: Looking for keys that match kty: ",n),t=t.filter((function(t){return t.kty===n})),o.Log.debug("UserInfoService._filterByAlg: Number of keys that match kty: ",n,t.length),t},t}()},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.AllowedSigningAlgs=e.b64tohex=e.hextob64u=e.crypto=e.X509=e.KeyUtil=e.jws=void 0;var i=n(27);e.jws=i.jws,e.KeyUtil=i.KEYUTIL,e.X509=i.X509,e.crypto=i.crypto,e.hextob64u=i.hextob64u,e.b64tohex=i.b64tohex,e.AllowedSigningAlgs=["RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"]},function(t,e,n){(function(t){Object.defineProperty(e,"__esModule",{value:!0});var n,i,r,o,s,a,c,u,l,h,d,f,p,v,g,m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},w={},b=b||(n=Math,r=(i={}).lib={},o=r.Base=function(){function t(){}return{extend:function(e){t.prototype=this;var n=new t;return e&&n.mixIn(e),n.hasOwnProperty("init")||(n.init=function(){n.$super.init.apply(this,arguments)}),n.init.prototype=n,n.$super=this,n},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),s=r.WordArray=o.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||c).stringify(this)},concat:function(t){var e=this.words,n=t.words,i=this.sigBytes,r=t.sigBytes;if(this.clamp(),i%4)for(var o=0;o<r;o++)e[i+o>>>2]|=(n[o>>>2]>>>24-o%4*8&255)<<24-(i+o)%4*8;else for(o=0;o<r;o+=4)e[i+o>>>2]=n[o>>>2];return this.sigBytes+=r,this},clamp:function(){var t=this.words,e=this.sigBytes;t[e>>>2]&=4294967295<<32-e%4*8,t.length=n.ceil(e/4)},clone:function(){var t=o.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],i=0;i<t;i+=4)e.push(4294967296*n.random()|0);return new s.init(e,t)}}),a=i.enc={},c=a.Hex={stringify:function(t){for(var e=t.words,n=t.sigBytes,i=[],r=0;r<n;r++){var o=e[r>>>2]>>>24-r%4*8&255;i.push((o>>>4).toString(16)),i.push((15&o).toString(16))}return i.join("")},parse:function(t){for(var e=t.length,n=[],i=0;i<e;i+=2)n[i>>>3]|=parseInt(t.substr(i,2),16)<<24-i%8*4;return new s.init(n,e/2)}},u=a.Latin1={stringify:function(t){for(var e=t.words,n=t.sigBytes,i=[],r=0;r<n;r++)i.push(String.fromCharCode(e[r>>>2]>>>24-r%4*8&255));return i.join("")},parse:function(t){for(var e=t.length,n=[],i=0;i<e;i++)n[i>>>2]|=(255&t.charCodeAt(i))<<24-i%4*8;return new s.init(n,e)}},l=a.Utf8={stringify:function(t){try{return decodeURIComponent(escape(u.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return u.parse(unescape(encodeURIComponent(t)))}},h=r.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=l.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(t){var e=this._data,i=e.words,r=e.sigBytes,o=this.blockSize,a=r/(4*o),c=(a=t?n.ceil(a):n.max((0|a)-this._minBufferSize,0))*o,u=n.min(4*c,r);if(c){for(var l=0;l<c;l+=o)this._doProcessBlock(i,l);var h=i.splice(0,c);e.sigBytes-=u}return new s.init(h,u)},clone:function(){var t=o.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),r.Hasher=h.extend({cfg:o.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){h.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,n){return new t.init(n).finalize(e)}},_createHmacHelper:function(t){return function(e,n){return new d.HMAC.init(t,n).finalize(e)}}}),d=i.algo={},i);p=(f=b).lib,v=p.Base,g=p.WordArray,(f=f.x64={}).Word=v.extend({init:function(t,e){this.high=t,this.low=e}}),f.WordArray=v.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:8*t.length},toX32:function(){for(var t=this.words,e=t.length,n=[],i=0;i<e;i++){var r=t[i];n.push(r.high),n.push(r.low)}return g.create(n,this.sigBytes)},clone:function(){for(var t=v.clone.call(this),e=t.words=this.words.slice(0),n=e.length,i=0;i<n;i++)e[i]=e[i].clone();return t}}),function(){var t=b.lib.WordArray;b.enc.Base64={stringify:function(t){var e=t.words,n=t.sigBytes,i=this._map;t.clamp(),t=[];for(var r=0;r<n;r+=3)for(var o=(e[r>>>2]>>>24-r%4*8&255)<<16|(e[r+1>>>2]>>>24-(r+1)%4*8&255)<<8|e[r+2>>>2]>>>24-(r+2)%4*8&255,s=0;4>s&&r+.75*s<n;s++)t.push(i.charAt(o>>>6*(3-s)&63));if(e=i.charAt(64))for(;t.length%4;)t.push(e);return t.join("")},parse:function(e){var n=e.length,i=this._map;(r=i.charAt(64))&&-1!=(r=e.indexOf(r))&&(n=r);for(var r=[],o=0,s=0;s<n;s++)if(s%4){var a=i.indexOf(e.charAt(s-1))<<s%4*2,c=i.indexOf(e.charAt(s))>>>6-s%4*2;r[o>>>2]|=(a|c)<<24-o%4*8,o++}return t.create(r,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(t){for(var e=b,n=(r=e.lib).WordArray,i=r.Hasher,r=e.algo,o=[],s=[],a=function(t){return 4294967296*(t-(0|t))|0},c=2,u=0;64>u;){var l;t:{for(var h=t.sqrt(l=c),d=2;d<=h;d++)if(!(l%d)){l=!1;break t}l=!0}l&&(8>u&&(o[u]=a(t.pow(c,.5))),s[u]=a(t.pow(c,1/3)),u++),c++}var f=[];r=r.SHA256=i.extend({_doReset:function(){this._hash=new n.init(o.slice(0))},_doProcessBlock:function(t,e){for(var n=this._hash.words,i=n[0],r=n[1],o=n[2],a=n[3],c=n[4],u=n[5],l=n[6],h=n[7],d=0;64>d;d++){if(16>d)f[d]=0|t[e+d];else{var p=f[d-15],v=f[d-2];f[d]=((p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3)+f[d-7]+((v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10)+f[d-16]}p=h+((c<<26|c>>>6)^(c<<21|c>>>11)^(c<<7|c>>>25))+(c&u^~c&l)+s[d]+f[d],v=((i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22))+(i&r^i&o^r&o),h=l,l=u,u=c,c=a+p|0,a=o,o=r,r=i,i=p+v|0}n[0]=n[0]+i|0,n[1]=n[1]+r|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0,n[5]=n[5]+u|0,n[6]=n[6]+l|0,n[7]=n[7]+h|0},_doFinalize:function(){var e=this._data,n=e.words,i=8*this._nDataBytes,r=8*e.sigBytes;return n[r>>>5]|=128<<24-r%32,n[14+(r+64>>>9<<4)]=t.floor(i/4294967296),n[15+(r+64>>>9<<4)]=i,e.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var t=i.clone.call(this);return t._hash=this._hash.clone(),t}}),e.SHA256=i._createHelper(r),e.HmacSHA256=i._createHmacHelper(r)}(Math),function(){function t(){return i.create.apply(i,arguments)}for(var e=b,n=e.lib.Hasher,i=(o=e.x64).Word,r=o.WordArray,o=e.algo,s=[t(1116352408,3609767458),t(1899447441,602891725),t(3049323471,3964484399),t(3921009573,2173295548),t(961987163,4081628472),t(1508970993,3053834265),t(2453635748,2937671579),t(2870763221,3664609560),t(3624381080,2734883394),t(310598401,1164996542),t(607225278,1323610764),t(1426881987,3590304994),t(1925078388,4068182383),t(2162078206,991336113),t(2614888103,633803317),t(3248222580,3479774868),t(3835390401,2666613458),t(4022224774,944711139),t(264347078,2341262773),t(604807628,2007800933),t(770255983,1495990901),t(1249150122,1856431235),t(1555081692,3175218132),t(1996064986,2198950837),t(2554220882,3999719339),t(2821834349,766784016),t(2952996808,2566594879),t(3210313671,3203337956),t(3336571891,1034457026),t(3584528711,2466948901),t(113926993,3758326383),t(338241895,168717936),t(666307205,1188179964),t(773529912,1546045734),t(1294757372,1522805485),t(1396182291,2643833823),t(1695183700,2343527390),t(1986661051,1014477480),t(2177026350,1206759142),t(2456956037,344077627),t(2730485921,1290863460),t(2820302411,3158454273),t(3259730800,3505952657),t(3345764771,106217008),t(3516065817,3606008344),t(3600352804,1432725776),t(4094571909,1467031594),t(275423344,851169720),t(430227734,3100823752),t(506948616,1363258195),t(659060556,3750685593),t(883997877,3785050280),t(958139571,3318307427),t(1322822218,3812723403),t(1537002063,2003034995),t(1747873779,3602036899),t(1955562222,1575990012),t(2024104815,1125592928),t(2227730452,2716904306),t(2361852424,442776044),t(2428436474,593698344),t(2756734187,3733110249),t(3204031479,2999351573),t(3329325298,3815920427),t(3391569614,3928383900),t(3515267271,566280711),t(3940187606,3454069534),t(4118630271,4000239992),t(116418474,1914138554),t(174292421,2731055270),t(289380356,3203993006),t(460393269,320620315),t(685471733,587496836),t(852142971,1086792851),t(1017036298,365543100),t(1126000580,2618297676),t(1288033470,3409855158),t(1501505948,4234509866),t(1607167915,987167468),t(1816402316,1246189591)],a=[],c=0;80>c;c++)a[c]=t();o=o.SHA512=n.extend({_doReset:function(){this._hash=new r.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var n=(h=this._hash.words)[0],i=h[1],r=h[2],o=h[3],c=h[4],u=h[5],l=h[6],h=h[7],d=n.high,f=n.low,p=i.high,v=i.low,g=r.high,m=r.low,w=o.high,b=o.low,y=c.high,x=c.low,k=u.high,E=u.low,S=l.high,F=l.low,A=h.high,_=h.low,j=d,C=f,R=p,I=v,T=g,O=m,N=w,P=b,D=y,M=x,U=k,L=E,B=S,J=F,$=A,H=_,z=0;80>z;z++){var K=a[z];if(16>z)var W=K.high=0|t[e+2*z],q=K.low=0|t[e+2*z+1];else{W=((q=(W=a[z-15]).high)>>>1|(V=W.low)<<31)^(q>>>8|V<<24)^q>>>7;var V=(V>>>1|q<<31)^(V>>>8|q<<24)^(V>>>7|q<<25),G=((q=(G=a[z-2]).high)>>>19|(X=G.low)<<13)^(q<<3|X>>>29)^q>>>6,X=(X>>>19|q<<13)^(X<<3|q>>>29)^(X>>>6|q<<26),Y=(q=a[z-7]).high,Z=(Q=a[z-16]).high,Q=Q.low;W=(W=(W=W+Y+((q=V+q.low)>>>0<V>>>0?1:0))+G+((q+=X)>>>0<X>>>0?1:0))+Z+((q+=Q)>>>0<Q>>>0?1:0),K.high=W,K.low=q}Y=D&U^~D&B,Q=M&L^~M&J,K=j&R^j&T^R&T;var tt=C&I^C&O^I&O,et=(V=(j>>>28|C<<4)^(j<<30|C>>>2)^(j<<25|C>>>7),G=(C>>>28|j<<4)^(C<<30|j>>>2)^(C<<25|j>>>7),(X=s[z]).high),nt=X.low;Z=$+((D>>>14|M<<18)^(D>>>18|M<<14)^(D<<23|M>>>9))+((X=H+((M>>>14|D<<18)^(M>>>18|D<<14)^(M<<23|D>>>9)))>>>0<H>>>0?1:0),$=B,H=J,B=U,J=L,U=D,L=M,D=N+(Z=(Z=(Z=Z+Y+((X+=Q)>>>0<Q>>>0?1:0))+et+((X+=nt)>>>0<nt>>>0?1:0))+W+((X+=q)>>>0<q>>>0?1:0))+((M=P+X|0)>>>0<P>>>0?1:0)|0,N=T,P=O,T=R,O=I,R=j,I=C,j=Z+(K=V+K+((q=G+tt)>>>0<G>>>0?1:0))+((C=X+q|0)>>>0<X>>>0?1:0)|0}f=n.low=f+C,n.high=d+j+(f>>>0<C>>>0?1:0),v=i.low=v+I,i.high=p+R+(v>>>0<I>>>0?1:0),m=r.low=m+O,r.high=g+T+(m>>>0<O>>>0?1:0),b=o.low=b+P,o.high=w+N+(b>>>0<P>>>0?1:0),x=c.low=x+M,c.high=y+D+(x>>>0<M>>>0?1:0),E=u.low=E+L,u.high=k+U+(E>>>0<L>>>0?1:0),F=l.low=F+J,l.high=S+B+(F>>>0<J>>>0?1:0),_=h.low=_+H,h.high=A+$+(_>>>0<H>>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;return e[i>>>5]|=128<<24-i%32,e[30+(i+128>>>10<<5)]=Math.floor(n/4294967296),e[31+(i+128>>>10<<5)]=n,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32}),e.SHA512=n._createHelper(o),e.HmacSHA512=n._createHmacHelper(o)}(),function(){var t=b,e=(r=t.x64).Word,n=r.WordArray,i=(r=t.algo).SHA512,r=r.SHA384=i.extend({_doReset:function(){this._hash=new n.init([new e.init(3418070365,3238371032),new e.init(1654270250,914150663),new e.init(2438529370,812702999),new e.init(355462360,4144912697),new e.init(1731405415,4290775857),new e.init(2394180231,1750603025),new e.init(3675008525,1694076839),new e.init(1203062813,3204075428)])},_doFinalize:function(){var t=i._doFinalize.call(this);return t.sigBytes-=16,t}});t.SHA384=i._createHelper(r),t.HmacSHA384=i._createHmacHelper(r)}();var y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function x(t){var e,n,i="";for(e=0;e+3<=t.length;e+=3)n=parseInt(t.substring(e,e+3),16),i+=y.charAt(n>>6)+y.charAt(63&n);for(e+1==t.length?(n=parseInt(t.substring(e,e+1),16),i+=y.charAt(n<<2)):e+2==t.length&&(n=parseInt(t.substring(e,e+2),16),i+=y.charAt(n>>2)+y.charAt((3&n)<<4));(3&i.length)>0;)i+="=";return i}function k(t){var e,n,i,r="",o=0;for(e=0;e<t.length&&"="!=t.charAt(e);++e)(i=y.indexOf(t.charAt(e)))<0||(0==o?(r+=C(i>>2),n=3&i,o=1):1==o?(r+=C(n<<2|i>>4),n=15&i,o=2):2==o?(r+=C(n),r+=C(i>>2),n=3&i,o=3):(r+=C(n<<2|i>>4),r+=C(15&i),o=0));return 1==o&&(r+=C(n<<2)),r}function E(t){var e,n=k(t),i=new Array;for(e=0;2*e<n.length;++e)i[e]=parseInt(n.substring(2*e,2*e+2),16);return i}function S(t,e,n){null!=t&&("number"==typeof t?this.fromNumber(t,e,n):this.fromString(t,null==e&&"string"!=typeof t?256:e))}function F(){return new S(null)}S.prototype.am=function(t,e,n,i,r,o){for(;--o>=0;){var s=e*this[t++]+n[i]+r;r=Math.floor(s/67108864),n[i++]=67108863&s}return r},S.prototype.DB=26,S.prototype.DM=67108863,S.prototype.DV=1<<26,S.prototype.FV=Math.pow(2,52),S.prototype.F1=26,S.prototype.F2=0;var A,_,j=new Array;for(A="0".charCodeAt(0),_=0;_<=9;++_)j[A++]=_;for(A="a".charCodeAt(0),_=10;_<36;++_)j[A++]=_;for(A="A".charCodeAt(0),_=10;_<36;++_)j[A++]=_;function C(t){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(t)}function R(t,e){var n=j[t.charCodeAt(e)];return null==n?-1:n}function I(t){var e=F();return e.fromInt(t),e}function T(t){var e,n=1;return 0!=(e=t>>>16)&&(t=e,n+=16),0!=(e=t>>8)&&(t=e,n+=8),0!=(e=t>>4)&&(t=e,n+=4),0!=(e=t>>2)&&(t=e,n+=2),0!=(e=t>>1)&&(t=e,n+=1),n}function O(t){this.m=t}function N(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function P(t,e){return t&e}function D(t,e){return t|e}function M(t,e){return t^e}function U(t,e){return t&~e}function L(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function B(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function J(){}function $(t){return t}function H(t){this.r2=F(),this.q3=F(),S.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}O.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},O.prototype.revert=function(t){return t},O.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},O.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},O.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},N.prototype.convert=function(t){var e=F();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(S.ZERO)>0&&this.m.subTo(e,e),e},N.prototype.revert=function(t){var e=F();return t.copyTo(e),this.reduce(e),e},N.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var n=32767&t[e],i=n*this.mpl+((n*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(t[n=e+this.m.t]+=this.m.am(0,i,t,e,0,this.m.t);t[n]>=t.DV;)t[n]-=t.DV,t[++n]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},N.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},N.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},S.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},S.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},S.prototype.fromString=function(t,e){var n;if(16==e)n=4;else if(8==e)n=3;else if(256==e)n=8;else if(2==e)n=1;else if(32==e)n=5;else{if(4!=e)return void this.fromRadix(t,e);n=2}this.t=0,this.s=0;for(var i=t.length,r=!1,o=0;--i>=0;){var s=8==n?255&t[i]:R(t,i);s<0?"-"==t.charAt(i)&&(r=!0):(r=!1,0==o?this[this.t++]=s:o+n>this.DB?(this[this.t-1]|=(s&(1<<this.DB-o)-1)<<o,this[this.t++]=s>>this.DB-o):this[this.t-1]|=s<<o,(o+=n)>=this.DB&&(o-=this.DB))}8==n&&0!=(128&t[0])&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),r&&S.ZERO.subTo(this,this)},S.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t},S.prototype.dlShiftTo=function(t,e){var n;for(n=this.t-1;n>=0;--n)e[n+t]=this[n];for(n=t-1;n>=0;--n)e[n]=0;e.t=this.t+t,e.s=this.s},S.prototype.drShiftTo=function(t,e){for(var n=t;n<this.t;++n)e[n-t]=this[n];e.t=Math.max(this.t-t,0),e.s=this.s},S.prototype.lShiftTo=function(t,e){var n,i=t%this.DB,r=this.DB-i,o=(1<<r)-1,s=Math.floor(t/this.DB),a=this.s<<i&this.DM;for(n=this.t-1;n>=0;--n)e[n+s+1]=this[n]>>r|a,a=(this[n]&o)<<i;for(n=s-1;n>=0;--n)e[n]=0;e[s]=a,e.t=this.t+s+1,e.s=this.s,e.clamp()},S.prototype.rShiftTo=function(t,e){e.s=this.s;var n=Math.floor(t/this.DB);if(n>=this.t)e.t=0;else{var i=t%this.DB,r=this.DB-i,o=(1<<i)-1;e[0]=this[n]>>i;for(var s=n+1;s<this.t;++s)e[s-n-1]|=(this[s]&o)<<r,e[s-n]=this[s]>>i;i>0&&(e[this.t-n-1]|=(this.s&o)<<r),e.t=this.t-n,e.clamp()}},S.prototype.subTo=function(t,e){for(var n=0,i=0,r=Math.min(t.t,this.t);n<r;)i+=this[n]-t[n],e[n++]=i&this.DM,i>>=this.DB;if(t.t<this.t){for(i-=t.s;n<this.t;)i+=this[n],e[n++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;n<t.t;)i-=t[n],e[n++]=i&this.DM,i>>=this.DB;i-=t.s}e.s=i<0?-1:0,i<-1?e[n++]=this.DV+i:i>0&&(e[n++]=i),e.t=n,e.clamp()},S.prototype.multiplyTo=function(t,e){var n=this.abs(),i=t.abs(),r=n.t;for(e.t=r+i.t;--r>=0;)e[r]=0;for(r=0;r<i.t;++r)e[r+n.t]=n.am(0,i[r],e,r,0,n.t);e.s=0,e.clamp(),this.s!=t.s&&S.ZERO.subTo(e,e)},S.prototype.squareTo=function(t){for(var e=this.abs(),n=t.t=2*e.t;--n>=0;)t[n]=0;for(n=0;n<e.t-1;++n){var i=e.am(n,e[n],t,2*n,0,1);(t[n+e.t]+=e.am(n+1,2*e[n],t,2*n+1,i,e.t-n-1))>=e.DV&&(t[n+e.t]-=e.DV,t[n+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(n,e[n],t,2*n,0,1)),t.s=0,t.clamp()},S.prototype.divRemTo=function(t,e,n){var i=t.abs();if(!(i.t<=0)){var r=this.abs();if(r.t<i.t)return null!=e&&e.fromInt(0),void(null!=n&&this.copyTo(n));null==n&&(n=F());var o=F(),s=this.s,a=t.s,c=this.DB-T(i[i.t-1]);c>0?(i.lShiftTo(c,o),r.lShiftTo(c,n)):(i.copyTo(o),r.copyTo(n));var u=o.t,l=o[u-1];if(0!=l){var h=l*(1<<this.F1)+(u>1?o[u-2]>>this.F2:0),d=this.FV/h,f=(1<<this.F1)/h,p=1<<this.F2,v=n.t,g=v-u,m=null==e?F():e;for(o.dlShiftTo(g,m),n.compareTo(m)>=0&&(n[n.t++]=1,n.subTo(m,n)),S.ONE.dlShiftTo(u,m),m.subTo(o,o);o.t<u;)o[o.t++]=0;for(;--g>=0;){var w=n[--v]==l?this.DM:Math.floor(n[v]*d+(n[v-1]+p)*f);if((n[v]+=o.am(0,w,n,g,0,u))<w)for(o.dlShiftTo(g,m),n.subTo(m,n);n[v]<--w;)n.subTo(m,n)}null!=e&&(n.drShiftTo(u,e),s!=a&&S.ZERO.subTo(e,e)),n.t=u,n.clamp(),c>0&&n.rShiftTo(c,n),s<0&&S.ZERO.subTo(n,n)}}},S.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},S.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},S.prototype.exp=function(t,e){if(t>4294967295||t<1)return S.ONE;var n=F(),i=F(),r=e.convert(this),o=T(t)-1;for(r.copyTo(n);--o>=0;)if(e.sqrTo(n,i),(t&1<<o)>0)e.mulTo(i,r,n);else{var s=n;n=i,i=s}return e.revert(n)},S.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var n,i=(1<<e)-1,r=!1,o="",s=this.t,a=this.DB-s*this.DB%e;if(s-- >0)for(a<this.DB&&(n=this[s]>>a)>0&&(r=!0,o=C(n));s>=0;)a<e?(n=(this[s]&(1<<a)-1)<<e-a,n|=this[--s]>>(a+=this.DB-e)):(n=this[s]>>(a-=e)&i,a<=0&&(a+=this.DB,--s)),n>0&&(r=!0),r&&(o+=C(n));return r?o:"0"},S.prototype.negate=function(){var t=F();return S.ZERO.subTo(this,t),t},S.prototype.abs=function(){return this.s<0?this.negate():this},S.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var n=this.t;if(0!=(e=n-t.t))return this.s<0?-e:e;for(;--n>=0;)if(0!=(e=this[n]-t[n]))return e;return 0},S.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+T(this[this.t-1]^this.s&this.DM)},S.prototype.mod=function(t){var e=F();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(S.ZERO)>0&&t.subTo(e,e),e},S.prototype.modPowInt=function(t,e){var n;return n=t<256||e.isEven()?new O(e):new N(e),this.exp(t,n)},S.ZERO=I(0),S.ONE=I(1),J.prototype.convert=$,J.prototype.revert=$,J.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n)},J.prototype.sqrTo=function(t,e){t.squareTo(e)},H.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=F();return t.copyTo(e),this.reduce(e),e},H.prototype.revert=function(t){return t},H.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},H.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},H.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var z,K,W,q=[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],V=(1<<26)/q[q.length-1];function G(){this.i=0,this.j=0,this.S=new Array}function X(){!function(t){K[W++]^=255&t,K[W++]^=t>>8&255,K[W++]^=t>>16&255,K[W++]^=t>>24&255,W>=256&&(W-=256)}((new Date).getTime())}if(S.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},S.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),n=Math.pow(t,e),i=I(n),r=F(),o=F(),s="";for(this.divRemTo(i,r,o);r.signum()>0;)s=(n+o.intValue()).toString(t).substr(1)+s,r.divRemTo(i,r,o);return o.intValue().toString(t)+s},S.prototype.fromRadix=function(t,e){this.fromInt(0),null==e&&(e=10);for(var n=this.chunkSize(e),i=Math.pow(e,n),r=!1,o=0,s=0,a=0;a<t.length;++a){var c=R(t,a);c<0?"-"==t.charAt(a)&&0==this.signum()&&(r=!0):(s=e*s+c,++o>=n&&(this.dMultiply(i),this.dAddOffset(s,0),o=0,s=0))}o>0&&(this.dMultiply(Math.pow(e,o)),this.dAddOffset(s,0)),r&&S.ZERO.subTo(this,this)},S.prototype.fromNumber=function(t,e,n){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,n),this.testBit(t-1)||this.bitwiseTo(S.ONE.shiftLeft(t-1),D,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(S.ONE.shiftLeft(t-1),this);else{var i=new Array,r=7&t;i.length=1+(t>>3),e.nextBytes(i),r>0?i[0]&=(1<<r)-1:i[0]=0,this.fromString(i,256)}},S.prototype.bitwiseTo=function(t,e,n){var i,r,o=Math.min(t.t,this.t);for(i=0;i<o;++i)n[i]=e(this[i],t[i]);if(t.t<this.t){for(r=t.s&this.DM,i=o;i<this.t;++i)n[i]=e(this[i],r);n.t=this.t}else{for(r=this.s&this.DM,i=o;i<t.t;++i)n[i]=e(r,t[i]);n.t=t.t}n.s=e(this.s,t.s),n.clamp()},S.prototype.changeBit=function(t,e){var n=S.ONE.shiftLeft(t);return this.bitwiseTo(n,e,n),n},S.prototype.addTo=function(t,e){for(var n=0,i=0,r=Math.min(t.t,this.t);n<r;)i+=this[n]+t[n],e[n++]=i&this.DM,i>>=this.DB;if(t.t<this.t){for(i+=t.s;n<this.t;)i+=this[n],e[n++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;n<t.t;)i+=t[n],e[n++]=i&this.DM,i>>=this.DB;i+=t.s}e.s=i<0?-1:0,i>0?e[n++]=i:i<-1&&(e[n++]=this.DV+i),e.t=n,e.clamp()},S.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},S.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},S.prototype.multiplyLowerTo=function(t,e,n){var i,r=Math.min(this.t+t.t,e);for(n.s=0,n.t=r;r>0;)n[--r]=0;for(i=n.t-this.t;r<i;++r)n[r+this.t]=this.am(0,t[r],n,r,0,this.t);for(i=Math.min(t.t,e);r<i;++r)this.am(0,t[r],n,r,0,e-r);n.clamp()},S.prototype.multiplyUpperTo=function(t,e,n){--e;var i=n.t=this.t+t.t-e;for(n.s=0;--i>=0;)n[i]=0;for(i=Math.max(e-this.t,0);i<t.t;++i)n[this.t+i-e]=this.am(e-i,t[i],n,0,0,this.t+i-e);n.clamp(),n.drShiftTo(1,n)},S.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t,n=this.s<0?t-1:0;if(this.t>0)if(0==e)n=this[0]%t;else for(var i=this.t-1;i>=0;--i)n=(e*n+this[i])%t;return n},S.prototype.millerRabin=function(t){var e=this.subtract(S.ONE),n=e.getLowestSetBit();if(n<=0)return!1;var i=e.shiftRight(n);(t=t+1>>1)>q.length&&(t=q.length);for(var r=F(),o=0;o<t;++o){r.fromInt(q[Math.floor(Math.random()*q.length)]);var s=r.modPow(i,this);if(0!=s.compareTo(S.ONE)&&0!=s.compareTo(e)){for(var a=1;a++<n&&0!=s.compareTo(e);)if(0==(s=s.modPowInt(2,this)).compareTo(S.ONE))return!1;if(0!=s.compareTo(e))return!1}}return!0},S.prototype.clone=function(){var t=F();return this.copyTo(t),t},S.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]},S.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},S.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},S.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},S.prototype.toByteArray=function(){var t=this.t,e=new Array;e[0]=this.s;var n,i=this.DB-t*this.DB%8,r=0;if(t-- >0)for(i<this.DB&&(n=this[t]>>i)!=(this.s&this.DM)>>i&&(e[r++]=n|this.s<<this.DB-i);t>=0;)i<8?(n=(this[t]&(1<<i)-1)<<8-i,n|=this[--t]>>(i+=this.DB-8)):(n=this[t]>>(i-=8)&255,i<=0&&(i+=this.DB,--t)),0!=(128&n)&&(n|=-256),0==r&&(128&this.s)!=(128&n)&&++r,(r>0||n!=this.s)&&(e[r++]=n);return e},S.prototype.equals=function(t){return 0==this.compareTo(t)},S.prototype.min=function(t){return this.compareTo(t)<0?this:t},S.prototype.max=function(t){return this.compareTo(t)>0?this:t},S.prototype.and=function(t){var e=F();return this.bitwiseTo(t,P,e),e},S.prototype.or=function(t){var e=F();return this.bitwiseTo(t,D,e),e},S.prototype.xor=function(t){var e=F();return this.bitwiseTo(t,M,e),e},S.prototype.andNot=function(t){var e=F();return this.bitwiseTo(t,U,e),e},S.prototype.not=function(){for(var t=F(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t},S.prototype.shiftLeft=function(t){var e=F();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},S.prototype.shiftRight=function(t){var e=F();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},S.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+L(this[t]);return this.s<0?this.t*this.DB:-1},S.prototype.bitCount=function(){for(var t=0,e=this.s&this.DM,n=0;n<this.t;++n)t+=B(this[n]^e);return t},S.prototype.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this[e]&1<<t%this.DB)},S.prototype.setBit=function(t){return this.changeBit(t,D)},S.prototype.clearBit=function(t){return this.changeBit(t,U)},S.prototype.flipBit=function(t){return this.changeBit(t,M)},S.prototype.add=function(t){var e=F();return this.addTo(t,e),e},S.prototype.subtract=function(t){var e=F();return this.subTo(t,e),e},S.prototype.multiply=function(t){var e=F();return this.multiplyTo(t,e),e},S.prototype.divide=function(t){var e=F();return this.divRemTo(t,e,null),e},S.prototype.remainder=function(t){var e=F();return this.divRemTo(t,null,e),e},S.prototype.divideAndRemainder=function(t){var e=F(),n=F();return this.divRemTo(t,e,n),new Array(e,n)},S.prototype.modPow=function(t,e){var n,i,r=t.bitLength(),o=I(1);if(r<=0)return o;n=r<18?1:r<48?3:r<144?4:r<768?5:6,i=r<8?new O(e):e.isEven()?new H(e):new N(e);var s=new Array,a=3,c=n-1,u=(1<<n)-1;if(s[1]=i.convert(this),n>1){var l=F();for(i.sqrTo(s[1],l);a<=u;)s[a]=F(),i.mulTo(l,s[a-2],s[a]),a+=2}var h,d,f=t.t-1,p=!0,v=F();for(r=T(t[f])-1;f>=0;){for(r>=c?h=t[f]>>r-c&u:(h=(t[f]&(1<<r+1)-1)<<c-r,f>0&&(h|=t[f-1]>>this.DB+r-c)),a=n;0==(1&h);)h>>=1,--a;if((r-=a)<0&&(r+=this.DB,--f),p)s[h].copyTo(o),p=!1;else{for(;a>1;)i.sqrTo(o,v),i.sqrTo(v,o),a-=2;a>0?i.sqrTo(o,v):(d=o,o=v,v=d),i.mulTo(v,s[h],o)}for(;f>=0&&0==(t[f]&1<<r);)i.sqrTo(o,v),d=o,o=v,v=d,--r<0&&(r=this.DB-1,--f)}return i.revert(o)},S.prototype.modInverse=function(t){var e=t.isEven();if(this.isEven()&&e||0==t.signum())return S.ZERO;for(var n=t.clone(),i=this.clone(),r=I(1),o=I(0),s=I(0),a=I(1);0!=n.signum();){for(;n.isEven();)n.rShiftTo(1,n),e?(r.isEven()&&o.isEven()||(r.addTo(this,r),o.subTo(t,o)),r.rShiftTo(1,r)):o.isEven()||o.subTo(t,o),o.rShiftTo(1,o);for(;i.isEven();)i.rShiftTo(1,i),e?(s.isEven()&&a.isEven()||(s.addTo(this,s),a.subTo(t,a)),s.rShiftTo(1,s)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);n.compareTo(i)>=0?(n.subTo(i,n),e&&r.subTo(s,r),o.subTo(a,o)):(i.subTo(n,i),e&&s.subTo(r,s),a.subTo(o,a))}return 0!=i.compareTo(S.ONE)?S.ZERO:a.compareTo(t)>=0?a.subtract(t):a.signum()<0?(a.addTo(t,a),a.signum()<0?a.add(t):a):a},S.prototype.pow=function(t){return this.exp(t,new J)},S.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),n=t.s<0?t.negate():t.clone();if(e.compareTo(n)<0){var i=e;e=n,n=i}var r=e.getLowestSetBit(),o=n.getLowestSetBit();if(o<0)return e;for(r<o&&(o=r),o>0&&(e.rShiftTo(o,e),n.rShiftTo(o,n));e.signum()>0;)(r=e.getLowestSetBit())>0&&e.rShiftTo(r,e),(r=n.getLowestSetBit())>0&&n.rShiftTo(r,n),e.compareTo(n)>=0?(e.subTo(n,e),e.rShiftTo(1,e)):(n.subTo(e,n),n.rShiftTo(1,n));return o>0&&n.lShiftTo(o,n),n},S.prototype.isProbablePrime=function(t){var e,n=this.abs();if(1==n.t&&n[0]<=q[q.length-1]){for(e=0;e<q.length;++e)if(n[0]==q[e])return!0;return!1}if(n.isEven())return!1;for(e=1;e<q.length;){for(var i=q[e],r=e+1;r<q.length&&i<V;)i*=q[r++];for(i=n.modInt(i);e<r;)if(i%q[e++]==0)return!1}return n.millerRabin(t)},S.prototype.square=function(){var t=F();return this.squareTo(t),t},G.prototype.init=function(t){var e,n,i;for(e=0;e<256;++e)this.S[e]=e;for(n=0,e=0;e<256;++e)i=this.S[e],this.S[e]=this.S[n=n+this.S[e]+t[e%t.length]&255],this.S[n]=i;this.i=0,this.j=0},G.prototype.next=function(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]},null==K){var Y;if(K=new Array,W=0,void 0!==w&&void 0!==w.msCrypto){var Z=w.msCrypto;if(Z.getRandomValues){var Q=new Uint8Array(32);for(Z.getRandomValues(Q),Y=0;Y<32;++Y)K[W++]=Q[Y]}}for(;W<256;)Y=Math.floor(65536*Math.random()),K[W++]=Y>>>8,K[W++]=255&Y;W=0,X()}function tt(){if(null==z){for(X(),(z=new G).init(K),W=0;W<K.length;++W)K[W]=0;W=0}return z.next()}function et(){}function nt(t,e){return new S(t,e)}function it(t,e,n){for(var i="",r=0;i.length<e;)i+=n(String.fromCharCode.apply(String,t.concat([(4278190080&r)>>24,(16711680&r)>>16,(65280&r)>>8,255&r]))),r+=1;return i}function rt(){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 ot(t,e){this.x=e,this.q=t}function st(t,e,n,i){this.curve=t,this.x=e,this.y=n,this.z=null==i?S.ONE:i,this.zinv=null}function at(t,e,n){this.q=t,this.a=this.fromBigInteger(e),this.b=this.fromBigInteger(n),this.infinity=new st(this,null,null)}et.prototype.nextBytes=function(t){var e;for(e=0;e<t.length;++e)t[e]=tt()},rt.prototype.doPublic=function(t){return t.modPowInt(this.e,this.n)},rt.prototype.setPublic=function(t,e){if(this.isPublic=!0,this.isPrivate=!1,"string"!=typeof t)this.n=t,this.e=e;else{if(!(null!=t&&null!=e&&t.length>0&&e.length>0))throw"Invalid RSA public key";this.n=nt(t,16),this.e=parseInt(e,16)}},rt.prototype.encrypt=function(t){var e=function(t,e){if(e<t.length+11)throw"Message too long for RSA";for(var n=new Array,i=t.length-1;i>=0&&e>0;){var r=t.charCodeAt(i--);r<128?n[--e]=r:r>127&&r<2048?(n[--e]=63&r|128,n[--e]=r>>6|192):(n[--e]=63&r|128,n[--e]=r>>6&63|128,n[--e]=r>>12|224)}n[--e]=0;for(var o=new et,s=new Array;e>2;){for(s[0]=0;0==s[0];)o.nextBytes(s);n[--e]=s[0]}return n[--e]=2,n[--e]=0,new S(n)}(t,this.n.bitLength()+7>>3);if(null==e)return null;var n=this.doPublic(e);if(null==n)return null;var i=n.toString(16);return 0==(1&i.length)?i:"0"+i},rt.prototype.encryptOAEP=function(t,e,n){var i=function(t,e,n,i){var r=ut.crypto.MessageDigest,o=ut.crypto.Util,s=null;if(n||(n="sha1"),"string"==typeof n&&(s=r.getCanonicalAlgName(n),i=r.getHashLength(s),n=function(t){return Et(o.hashHex(St(t),s))}),t.length+2*i+2>e)throw"Message too long for RSA";var a,c="";for(a=0;a<e-t.length-2*i-2;a+=1)c+="\0";var u=n("")+c+""+t,l=new Array(i);(new et).nextBytes(l);var h=it(l,u.length,n),d=[];for(a=0;a<u.length;a+=1)d[a]=u.charCodeAt(a)^h.charCodeAt(a);var f=it(d,l.length,n),p=[0];for(a=0;a<l.length;a+=1)p[a+1]=l[a]^f.charCodeAt(a);return new S(p.concat(d))}(t,this.n.bitLength()+7>>3,e,n);if(null==i)return null;var r=this.doPublic(i);if(null==r)return null;var o=r.toString(16);return 0==(1&o.length)?o:"0"+o},rt.prototype.type="RSA",ot.prototype.equals=function(t){return t==this||this.q.equals(t.q)&&this.x.equals(t.x)},ot.prototype.toBigInteger=function(){return this.x},ot.prototype.negate=function(){return new ot(this.q,this.x.negate().mod(this.q))},ot.prototype.add=function(t){return new ot(this.q,this.x.add(t.toBigInteger()).mod(this.q))},ot.prototype.subtract=function(t){return new ot(this.q,this.x.subtract(t.toBigInteger()).mod(this.q))},ot.prototype.multiply=function(t){return new ot(this.q,this.x.multiply(t.toBigInteger()).mod(this.q))},ot.prototype.square=function(){return new ot(this.q,this.x.square().mod(this.q))},ot.prototype.divide=function(t){return new ot(this.q,this.x.multiply(t.toBigInteger().modInverse(this.q)).mod(this.q))},st.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))},st.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))},st.prototype.equals=function(t){return t==this||(this.isInfinity()?t.isInfinity():t.isInfinity()?this.isInfinity():!!t.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(t.z)).mod(this.curve.q).equals(S.ZERO)&&t.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(t.z)).mod(this.curve.q).equals(S.ZERO))},st.prototype.isInfinity=function(){return null==this.x&&null==this.y||this.z.equals(S.ZERO)&&!this.y.toBigInteger().equals(S.ZERO)},st.prototype.negate=function(){return new st(this.curve,this.x,this.y.negate(),this.z)},st.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(t.z)).mod(this.curve.q),n=t.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(t.z)).mod(this.curve.q);if(S.ZERO.equals(n))return S.ZERO.equals(e)?this.twice():this.curve.getInfinity();var i=new S("3"),r=this.x.toBigInteger(),o=this.y.toBigInteger(),s=(t.x.toBigInteger(),t.y.toBigInteger(),n.square()),a=s.multiply(n),c=r.multiply(s),u=e.square().multiply(this.z),l=u.subtract(c.shiftLeft(1)).multiply(t.z).subtract(a).multiply(n).mod(this.curve.q),h=c.multiply(i).multiply(e).subtract(o.multiply(a)).subtract(u.multiply(e)).multiply(t.z).add(e.multiply(a)).mod(this.curve.q),d=a.multiply(this.z).multiply(t.z).mod(this.curve.q);return new st(this.curve,this.curve.fromBigInteger(l),this.curve.fromBigInteger(h),d)},st.prototype.twice=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var t=new S("3"),e=this.x.toBigInteger(),n=this.y.toBigInteger(),i=n.multiply(this.z),r=i.multiply(n).mod(this.curve.q),o=this.curve.a.toBigInteger(),s=e.square().multiply(t);S.ZERO.equals(o)||(s=s.add(this.z.square().multiply(o)));var a=(s=s.mod(this.curve.q)).square().subtract(e.shiftLeft(3).multiply(r)).shiftLeft(1).multiply(i).mod(this.curve.q),c=s.multiply(t).multiply(e).subtract(r.shiftLeft(1)).shiftLeft(2).multiply(r).subtract(s.square().multiply(s)).mod(this.curve.q),u=i.square().multiply(i).shiftLeft(3).mod(this.curve.q);return new st(this.curve,this.curve.fromBigInteger(a),this.curve.fromBigInteger(c),u)},st.prototype.multiply=function(t){if(this.isInfinity())return this;if(0==t.signum())return this.curve.getInfinity();var e,n=t,i=n.multiply(new S("3")),r=this.negate(),o=this,s=this.curve.q.subtract(t),a=s.multiply(new S("3")),c=new st(this.curve,this.x,this.y),u=c.negate();for(e=i.bitLength()-2;e>0;--e){o=o.twice();var l=i.testBit(e);l!=n.testBit(e)&&(o=o.add(l?this:r))}for(e=a.bitLength()-2;e>0;--e){c=c.twice();var h=a.testBit(e);h!=s.testBit(e)&&(c=c.add(h?c:u))}return o},st.prototype.multiplyTwo=function(t,e,n){var i;i=t.bitLength()>n.bitLength()?t.bitLength()-1:n.bitLength()-1;for(var r=this.curve.getInfinity(),o=this.add(e);i>=0;)r=r.twice(),t.testBit(i)?r=n.testBit(i)?r.add(o):r.add(this):n.testBit(i)&&(r=r.add(e)),--i;return r},at.prototype.getQ=function(){return this.q},at.prototype.getA=function(){return this.a},at.prototype.getB=function(){return this.b},at.prototype.equals=function(t){return t==this||this.q.equals(t.q)&&this.a.equals(t.a)&&this.b.equals(t.b)},at.prototype.getInfinity=function(){return this.infinity},at.prototype.fromBigInteger=function(t){return new ot(this.q,t)},at.prototype.decodePointHex=function(t){switch(parseInt(t.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:return null;case 4:case 6:case 7:var e=(t.length-2)/2,n=t.substr(2,e),i=t.substr(e+2,e);return new st(this,this.fromBigInteger(new S(n,16)),this.fromBigInteger(new S(i,16)));default:return null}},ot.prototype.getByteLength=function(){return Math.floor((this.toBigInteger().bitLength()+7)/8)},st.prototype.getEncoded=function(t){var e=function(t,e){var n=t.toByteArrayUnsigned();if(e<n.length)n=n.slice(n.length-e);else for(;e>n.length;)n.unshift(0);return n},n=this.getX().toBigInteger(),i=this.getY().toBigInteger(),r=e(n,32);return t?i.isEven()?r.unshift(2):r.unshift(3):(r.unshift(4),r=r.concat(e(i,32))),r},st.decodeFrom=function(t,e){var n=e.length-1,i=e.slice(1,1+n/2),r=e.slice(1+n/2,1+n);i.unshift(0),r.unshift(0);var o=new S(i),s=new S(r);return new st(t,t.fromBigInteger(o),t.fromBigInteger(s))},st.decodeFromHex=function(t,e){e.substr(0,2);var n=e.length-2,i=e.substr(2,n/2),r=e.substr(2+n/2,n/2),o=new S(i,16),s=new S(r,16);return new st(t,t.fromBigInteger(o),t.fromBigInteger(s))},st.prototype.add2D=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;if(this.x.equals(t.x))return this.y.equals(t.y)?this.twice():this.curve.getInfinity();var e=t.x.subtract(this.x),n=t.y.subtract(this.y).divide(e),i=n.square().subtract(this.x).subtract(t.x),r=n.multiply(this.x.subtract(i)).subtract(this.y);return new st(this.curve,i,r)},st.prototype.twice2D=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var t=this.curve.fromBigInteger(S.valueOf(2)),e=this.curve.fromBigInteger(S.valueOf(3)),n=this.x.square().multiply(e).add(this.curve.a).divide(this.y.multiply(t)),i=n.square().subtract(this.x.multiply(t)),r=n.multiply(this.x.subtract(i)).subtract(this.y);return new st(this.curve,i,r)},st.prototype.multiply2D=function(t){if(this.isInfinity())return this;if(0==t.signum())return this.curve.getInfinity();var e,n=t,i=n.multiply(new S("3")),r=this.negate(),o=this;for(e=i.bitLength()-2;e>0;--e){o=o.twice();var s=i.testBit(e);s!=n.testBit(e)&&(o=o.add2D(s?this:r))}return o},st.prototype.isOnCurve=function(){var t=this.getX().toBigInteger(),e=this.getY().toBigInteger(),n=this.curve.getA().toBigInteger(),i=this.curve.getB().toBigInteger(),r=this.curve.getQ(),o=e.multiply(e).mod(r),s=t.multiply(t).multiply(t).add(n.multiply(t)).add(i).mod(r);return o.equals(s)},st.prototype.toString=function(){return"("+this.getX().toBigInteger().toString()+","+this.getY().toBigInteger().toString()+")"},st.prototype.validate=function(){var t=this.curve.getQ();if(this.isInfinity())throw new Error("Point is at infinity.");var e=this.getX().toBigInteger(),n=this.getY().toBigInteger();if(e.compareTo(S.ONE)<0||e.compareTo(t.subtract(S.ONE))>0)throw new Error("x coordinate out of bounds");if(n.compareTo(S.ONE)<0||n.compareTo(t.subtract(S.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(t).isInfinity())throw new Error("Point is not a scalar multiple of G.");return!0};var ct=function(){var t=new RegExp('(?:false|true|null|[\\{\\}\\[\\]]|(?:-?\\b(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\\b)|(?:"(?:[^\\0-\\x08\\x0a-\\x1f"\\\\]|\\\\(?:["/\\\\bfnrt]|u[0-9A-Fa-f]{4}))*"))',"g"),e=new RegExp("\\\\(?:([^u])|u(.{4}))","g"),n={'"':'"',"/":"/","\\":"\\",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function i(t,e,i){return e?n[e]:String.fromCharCode(parseInt(i,16))}var r=new String(""),o=Object.hasOwnProperty;return function(n,s){var a,c,u=n.match(t),l=u[0],h=!1;"{"===l?a={}:"["===l?a=[]:(a=[],h=!0);for(var d=[a],f=1-h,p=u.length;f<p;++f){var v;switch((l=u[f]).charCodeAt(0)){default:(v=d[0])[c||v.length]=+l,c=void 0;break;case 34:if(-1!==(l=l.substring(1,l.length-1)).indexOf("\\")&&(l=l.replace(e,i)),v=d[0],!c){if(!(v instanceof Array)){c=l||r;break}c=v.length}v[c]=l,c=void 0;break;case 91:d.unshift((v=d[0])[c||v.length]=[]),c=void 0;break;case 93:d.shift();break;case 102:(v=d[0])[c||v.length]=!1,c=void 0;break;case 110:(v=d[0])[c||v.length]=null,c=void 0;break;case 116:(v=d[0])[c||v.length]=!0,c=void 0;break;case 123:d.unshift((v=d[0])[c||v.length]={}),c=void 0;break;case 125:d.shift()}}if(h){if(1!==d.length)throw new Error;a=a[0]}else if(d.length)throw new Error;return s&&(a=function t(e,n){var i=e[n];if(i&&"object"===(void 0===i?"undefined":m(i))){var r=null;for(var a in i)if(o.call(i,a)&&i!==e){var c=t(i,a);void 0!==c?i[a]=c:(r||(r=[]),r.push(a))}if(r)for(var u=r.length;--u>=0;)delete i[r[u]]}return s.call(e,n,i)}({"":a},"")),a}}();void 0!==ut&&ut||(e.KJUR=ut={}),void 0!==ut.asn1&&ut.asn1||(ut.asn1={}),ut.asn1.ASN1Util=new function(){this.integerToByteHex=function(t){var e=t.toString(16);return e.length%2==1&&(e="0"+e),e},this.bigIntToMinTwosComplementsHex=function(t){var e=t.toString(16);if("-"!=e.substr(0,1))e.length%2==1?e="0"+e:e.match(/^[0-7]/)||(e="00"+e);else{var n=e.substr(1).length;n%2==1?n+=1:e.match(/^[0-7]/)||(n+=2);for(var i="",r=0;r<n;r++)i+="f";e=new S(i,16).xor(t).add(S.ONE).toString(16).replace(/^-/,"")}return e},this.getPEMStringFromHex=function(t,e){return jt(t,e)},this.newObject=function(t){var e=ut.asn1,n=e.ASN1Object,i=e.DERBoolean,r=e.DERInteger,o=e.DERBitString,s=e.DEROctetString,a=e.DERNull,c=e.DERObjectIdentifier,u=e.DEREnumerated,l=e.DERUTF8String,h=e.DERNumericString,d=e.DERPrintableString,f=e.DERTeletexString,p=e.DERIA5String,v=e.DERUTCTime,g=e.DERGeneralizedTime,m=e.DERVisibleString,w=e.DERBMPString,b=e.DERSequence,y=e.DERSet,x=e.DERTaggedObject,k=e.ASN1Util.newObject;if(t instanceof e.ASN1Object)return t;var E=Object.keys(t);if(1!=E.length)throw new Error("key of param shall be only one.");var S=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(":"+S+":"))throw new Error("undefined key: "+S);if("bool"==S)return new i(t[S]);if("int"==S)return new r(t[S]);if("bitstr"==S)return new o(t[S]);if("octstr"==S)return new s(t[S]);if("null"==S)return new a(t[S]);if("oid"==S)return new c(t[S]);if("enum"==S)return new u(t[S]);if("utf8str"==S)return new l(t[S]);if("numstr"==S)return new h(t[S]);if("prnstr"==S)return new d(t[S]);if("telstr"==S)return new f(t[S]);if("ia5str"==S)return new p(t[S]);if("utctime"==S)return new v(t[S]);if("gentime"==S)return new g(t[S]);if("visstr"==S)return new m(t[S]);if("bmpstr"==S)return new w(t[S]);if("asn1"==S)return new n(t[S]);if("seq"==S){for(var F=t[S],A=[],_=0;_<F.length;_++){var j=k(F[_]);A.push(j)}return new b({array:A})}if("set"==S){for(F=t[S],A=[],_=0;_<F.length;_++)j=k(F[_]),A.push(j);return new y({array:A})}if("tag"==S){var C=t[S];if("[object Array]"===Object.prototype.toString.call(C)&&3==C.length){var R=k(C[2]);return new x({tag:C[0],explicit:C[1],obj:R})}return new x(C)}},this.jsonToASN1HEX=function(t){return this.newObject(t).getEncodedHex()}},ut.asn1.ASN1Util.oidHexToInt=function(t){for(var e="",n=parseInt(t.substr(0,2),16),i=(e=Math.floor(n/40)+"."+n%40,""),r=2;r<t.length;r+=2){var o=("00000000"+parseInt(t.substr(r,2),16).toString(2)).slice(-8);i+=o.substr(1,7),"0"==o.substr(0,1)&&(e=e+"."+new S(i,2).toString(10),i="")}return e},ut.asn1.ASN1Util.oidIntToHex=function(t){var e=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},n=function(t){var n="",i=new S(t,10).toString(2),r=7-i.length%7;7==r&&(r=0);for(var o="",s=0;s<r;s++)o+="0";for(i=o+i,s=0;s<i.length-1;s+=7){var a=i.substr(s,7);s!=i.length-7&&(a="1"+a),n+=e(parseInt(a,2))}return n};if(!t.match(/^[0-9.]+$/))throw"malformed oid string: "+t;var i="",r=t.split("."),o=40*parseInt(r[0])+parseInt(r[1]);i+=e(o),r.splice(0,2);for(var s=0;s<r.length;s++)i+=n(r[s]);return i},ut.asn1.ASN1Object=function(t){this.params=null,this.getLengthHexFromValue=function(){if(void 0===this.hV||null==this.hV)throw new Error("this.hV is null or undefined");if(this.hV.length%2==1)throw new Error("value hex must be even length: n="+"".length+",v="+this.hV);var t=this.hV.length/2,e=t.toString(16);if(e.length%2==1&&(e="0"+e),t<128)return e;var n=e.length/2;if(n>15)throw"ASN.1 length too long to represent by 8x: n = "+t.toString(16);return(128+n).toString(16)+e},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(t){this.params=t},null!=t&&null!=t.tlv&&(this.hTLV=t.tlv,this.isModified=!1)},ut.asn1.DERAbstractString=function(t){ut.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=xt(this.s).toLowerCase()},this.setStringHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t?this.setString(t):void 0!==t.str?this.setString(t.str):void 0!==t.hex&&this.setStringHex(t.hex))},$t(ut.asn1.DERAbstractString,ut.asn1.ASN1Object),ut.asn1.DERAbstractTime=function(){ut.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(t){var e=t.getTime()+6e4*t.getTimezoneOffset();return new Date(e)},this.formatDate=function(t,e,n){var i=this.zeroPadding,r=this.localDateToUTC(t),o=String(r.getFullYear());"utc"==e&&(o=o.substr(2,2));var s=o+i(String(r.getMonth()+1),2)+i(String(r.getDate()),2)+i(String(r.getHours()),2)+i(String(r.getMinutes()),2)+i(String(r.getSeconds()),2);if(!0===n){var a=r.getMilliseconds();if(0!=a){var c=i(String(a),3);s=s+"."+(c=c.replace(/[0]+$/,""))}}return s+"Z"},this.zeroPadding=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=gt(t)},this.setByDateValue=function(t,e,n,i,r,o){var s=new Date(Date.UTC(t,e-1,n,i,r,o,0));this.setByDate(s)},this.getFreshValueHex=function(){return this.hV}},$t(ut.asn1.DERAbstractTime,ut.asn1.ASN1Object),ut.asn1.DERAbstractStructured=function(t){ut.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array=t},this.appendASN1Object=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array.push(t)},this.asn1Array=new Array,void 0!==t&&void 0!==t.array&&(this.asn1Array=t.array)},$t(ut.asn1.DERAbstractStructured,ut.asn1.ASN1Object),ut.asn1.DERBoolean=function(t){ut.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV=0==t?"010100":"0101ff"},$t(ut.asn1.DERBoolean,ut.asn1.ASN1Object),ut.asn1.DERInteger=function(t){ut.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=ut.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new S(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.bigint?this.setByBigInteger(t.bigint):void 0!==t.int?this.setByInteger(t.int):"number"==typeof t?this.setByInteger(t):void 0!==t.hex&&this.setValueHex(t.hex))},$t(ut.asn1.DERInteger,ut.asn1.ASN1Object),ut.asn1.DERBitString=function(t){if(void 0!==t&&void 0!==t.obj){var e=ut.asn1.ASN1Util.newObject(t.obj);t.hex="00"+e.getEncodedHex()}ut.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(t){this.hTLV=null,this.isModified=!0,this.hV=t},this.setUnusedBitsAndHexValue=function(t,e){if(t<0||7<t)throw"unused bits shall be from 0 to 7: u = "+t;var n="0"+t;this.hTLV=null,this.isModified=!0,this.hV=n+e},this.setByBinaryString=function(t){var e=8-(t=t.replace(/0+$/,"")).length%8;8==e&&(e=0);for(var n=0;n<=e;n++)t+="0";var i="";for(n=0;n<t.length-1;n+=8){var r=t.substr(n,8),o=parseInt(r,2).toString(16);1==o.length&&(o="0"+o),i+=o}this.hTLV=null,this.isModified=!0,this.hV="0"+e+i},this.setByBooleanArray=function(t){for(var e="",n=0;n<t.length;n++)e+=1==t[n]?"1":"0";this.setByBinaryString(e)},this.newFalseArray=function(t){for(var e=new Array(t),n=0;n<t;n++)e[n]=!1;return e},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t&&t.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(t):void 0!==t.hex?this.setHexValueIncludingUnusedBits(t.hex):void 0!==t.bin?this.setByBinaryString(t.bin):void 0!==t.array&&this.setByBooleanArray(t.array))},$t(ut.asn1.DERBitString,ut.asn1.ASN1Object),ut.asn1.DEROctetString=function(t){if(void 0!==t&&void 0!==t.obj){var e=ut.asn1.ASN1Util.newObject(t.obj);t.hex=e.getEncodedHex()}ut.asn1.DEROctetString.superclass.constructor.call(this,t),this.hT="04"},$t(ut.asn1.DEROctetString,ut.asn1.DERAbstractString),ut.asn1.DERNull=function(){ut.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},$t(ut.asn1.DERNull,ut.asn1.ASN1Object),ut.asn1.DERObjectIdentifier=function(t){ut.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.setValueOidString=function(t){var e=function(t){var e=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},n=function(t){var n="",i=parseInt(t,10).toString(2),r=7-i.length%7;7==r&&(r=0);for(var o="",s=0;s<r;s++)o+="0";for(i=o+i,s=0;s<i.length-1;s+=7){var a=i.substr(s,7);s!=i.length-7&&(a="1"+a),n+=e(parseInt(a,2))}return n};try{if(!t.match(/^[0-9.]+$/))return null;var i="",r=t.split("."),o=40*parseInt(r[0],10)+parseInt(r[1],10);i+=e(o),r.splice(0,2);for(var s=0;s<r.length;s++)i+=n(r[s]);return i}catch(t){return null}}(t);if(null==e)throw new Error("malformed oid string: "+t);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.setValueName=function(t){var e=ut.asn1.x509.OID.name2oid(t);if(""===e)throw new Error("DERObjectIdentifier oidName undefined: "+t);this.setValueOidString(e)},this.setValueNameOrOid=function(t){t.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(t):this.setValueName(t)},this.getFreshValueHex=function(){return this.hV},this.setByParam=function(t){"string"==typeof t?this.setValueNameOrOid(t):void 0!==t.oid?this.setValueNameOrOid(t.oid):void 0!==t.name?this.setValueNameOrOid(t.name):void 0!==t.hex&&this.setValueHex(t.hex)},void 0!==t&&this.setByParam(t)},$t(ut.asn1.DERObjectIdentifier,ut.asn1.ASN1Object),ut.asn1.DEREnumerated=function(t){ut.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=ut.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new S(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.int?this.setByInteger(t.int):"number"==typeof t?this.setByInteger(t):void 0!==t.hex&&this.setValueHex(t.hex))},$t(ut.asn1.DEREnumerated,ut.asn1.ASN1Object),ut.asn1.DERUTF8String=function(t){ut.asn1.DERUTF8String.superclass.constructor.call(this,t),this.hT="0c"},$t(ut.asn1.DERUTF8String,ut.asn1.DERAbstractString),ut.asn1.DERNumericString=function(t){ut.asn1.DERNumericString.superclass.constructor.call(this,t),this.hT="12"},$t(ut.asn1.DERNumericString,ut.asn1.DERAbstractString),ut.asn1.DERPrintableString=function(t){ut.asn1.DERPrintableString.superclass.constructor.call(this,t),this.hT="13"},$t(ut.asn1.DERPrintableString,ut.asn1.DERAbstractString),ut.asn1.DERTeletexString=function(t){ut.asn1.DERTeletexString.superclass.constructor.call(this,t),this.hT="14"},$t(ut.asn1.DERTeletexString,ut.asn1.DERAbstractString),ut.asn1.DERIA5String=function(t){ut.asn1.DERIA5String.superclass.constructor.call(this,t),this.hT="16"},$t(ut.asn1.DERIA5String,ut.asn1.DERAbstractString),ut.asn1.DERVisibleString=function(t){ut.asn1.DERIA5String.superclass.constructor.call(this,t),this.hT="1a"},$t(ut.asn1.DERVisibleString,ut.asn1.DERAbstractString),ut.asn1.DERBMPString=function(t){ut.asn1.DERBMPString.superclass.constructor.call(this,t),this.hT="1e"},$t(ut.asn1.DERBMPString,ut.asn1.DERAbstractString),ut.asn1.DERUTCTime=function(t){ut.asn1.DERUTCTime.superclass.constructor.call(this,t),this.hT="17",this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"utc"),this.hV=gt(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=gt(this.s)),this.hV},void 0!==t&&(void 0!==t.str?this.setString(t.str):"string"==typeof t&&t.match(/^[0-9]{12}Z$/)?this.setString(t):void 0!==t.hex?this.setStringHex(t.hex):void 0!==t.date&&this.setByDate(t.date))},$t(ut.asn1.DERUTCTime,ut.asn1.DERAbstractTime),ut.asn1.DERGeneralizedTime=function(t){ut.asn1.DERGeneralizedTime.superclass.constructor.call(this,t),this.hT="18",this.withMillis=!1,this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=gt(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=gt(this.s)),this.hV},void 0!==t&&(void 0!==t.str?this.setString(t.str):"string"==typeof t&&t.match(/^[0-9]{14}Z$/)?this.setString(t):void 0!==t.hex?this.setStringHex(t.hex):void 0!==t.date&&this.setByDate(t.date),!0===t.millis&&(this.withMillis=!0))},$t(ut.asn1.DERGeneralizedTime,ut.asn1.DERAbstractTime),ut.asn1.DERSequence=function(t){ut.asn1.DERSequence.superclass.constructor.call(this,t),this.hT="30",this.getFreshValueHex=function(){for(var t="",e=0;e<this.asn1Array.length;e++)t+=this.asn1Array[e].getEncodedHex();return this.hV=t,this.hV}},$t(ut.asn1.DERSequence,ut.asn1.DERAbstractStructured),ut.asn1.DERSet=function(t){ut.asn1.DERSet.superclass.constructor.call(this,t),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var t=new Array,e=0;e<this.asn1Array.length;e++)t.push(this.asn1Array[e].getEncodedHex());return 1==this.sortFlag&&t.sort(),this.hV=t.join(""),this.hV},void 0!==t&&void 0!==t.sortflag&&0==t.sortflag&&(this.sortFlag=!1)},$t(ut.asn1.DERSet,ut.asn1.DERAbstractStructured),ut.asn1.DERTaggedObject=function(t){ut.asn1.DERTaggedObject.superclass.constructor.call(this);var e=ut.asn1;this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(t,e,n){this.hT=e,this.isExplicit=t,this.asn1Object=n,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=n.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,e),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},this.setByParam=function(t){null!=t.tag&&(this.hT=t.tag),null!=t.explicit&&(this.isExplicit=t.explicit),null!=t.tage&&(this.hT=t.tage,this.isExplicit=!0),null!=t.tagi&&(this.hT=t.tagi,this.isExplicit=!1),null!=t.obj&&(t.obj instanceof e.ASN1Object?(this.asn1Object=t.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)):"object"==m(t.obj)&&(this.asn1Object=e.ASN1Util.newObject(t.obj),this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},null!=t&&this.setByParam(t)},$t(ut.asn1.DERTaggedObject,ut.asn1.ASN1Object);var ut,lt,ht,dt=new function(){};function ft(t){for(var e=new Array,n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}function pt(t){for(var e="",n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return e}function vt(t){for(var e="",n=0;n<t.length;n++){var i=t[n].toString(16);1==i.length&&(i="0"+i),e+=i}return e}function gt(t){return vt(ft(t))}function mt(t){return(t=(t=t.replace(/\=/g,"")).replace(/\+/g,"-")).replace(/\//g,"_")}function wt(t){return t.length%4==2?t+="==":t.length%4==3&&(t+="="),(t=t.replace(/-/g,"+")).replace(/_/g,"/")}function bt(t){return t.length%2==1&&(t="0"+t),mt(x(t))}function yt(t){return k(wt(t))}function xt(t){return Tt(Ut(t))}function kt(t){return decodeURIComponent(Ot(t))}function Et(t){for(var e="",n=0;n<t.length-1;n+=2)e+=String.fromCharCode(parseInt(t.substr(n,2),16));return e}function St(t){for(var e="",n=0;n<t.length;n++)e+=("0"+t.charCodeAt(n).toString(16)).slice(-2);return e}function Ft(t){return x(t)}function At(t){return Ft(t).replace(/(.{64})/g,"$1\r\n").replace(/\r\n$/,"")}function _t(t){return k(t.replace(/[^0-9A-Za-z\/+=]*/g,""))}function jt(t,e){return"-----BEGIN "+e+"-----\r\n"+At(t)+"\r\n-----END "+e+"-----\r\n"}function Ct(t,e){if(-1==t.indexOf("-----BEGIN "))throw"can't find PEM header: "+e;return _t(t=void 0!==e?(t=t.replace(new RegExp("^[^]*-----BEGIN "+e+"-----"),"")).replace(new RegExp("-----END "+e+"-----[^]*$"),""):(t=t.replace(/^[^]*-----BEGIN [^-]+-----/,"")).replace(/-----END [^-]+-----[^]*$/,""))}function Rt(t){var e,n,i,r,o,s,a,c,u,l,h;if(h=t.match(/^(\d{2}|\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(|\.\d+)Z$/))return c=h[1],e=parseInt(c),2===c.length&&(50<=e&&e<100?e=1900+e:0<=e&&e<50&&(e=2e3+e)),n=parseInt(h[2])-1,i=parseInt(h[3]),r=parseInt(h[4]),o=parseInt(h[5]),s=parseInt(h[6]),a=0,""!==(u=h[7])&&(l=(u.substr(1)+"00").substr(0,3),a=parseInt(l)),Date.UTC(e,n,i,r,o,s,a);throw"unsupported zulu format: "+t}function It(t){return~~(Rt(t)/1e3)}function Tt(t){return t.replace(/%/g,"")}function Ot(t){return t.replace(/(..)/g,"%$1")}function Nt(t){var e="malformed IPv6 address";if(!t.match(/^[0-9A-Fa-f:]+$/))throw e;var n=(t=t.toLowerCase()).split(":").length-1;if(n<2)throw e;var i=":".repeat(7-n+2),r=(t=t.replace("::",i)).split(":");if(8!=r.length)throw e;for(var o=0;o<8;o++)r[o]=("0000"+r[o]).slice(-4);return r.join("")}function Pt(t){if(!t.match(/^[0-9A-Fa-f]{32}$/))throw"malformed IPv6 address octet";for(var e=(t=t.toLowerCase()).match(/.{1,4}/g),n=0;n<8;n++)e[n]=e[n].replace(/^0+/,""),""==e[n]&&(e[n]="0");var i=(t=":"+e.join(":")+":").match(/:(0:){2,}/g);if(null===i)return t.slice(1,-1);var r="";for(n=0;n<i.length;n++)i[n].length>r.length&&(r=i[n]);return(t=t.replace(r,"::")).slice(1,-1)}function Dt(t){var e="malformed hex value";if(!t.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw e;if(8!=t.length)return 32==t.length?Pt(t):t;try{return parseInt(t.substr(0,2),16)+"."+parseInt(t.substr(2,2),16)+"."+parseInt(t.substr(4,2),16)+"."+parseInt(t.substr(6,2),16)}catch(t){throw e}}function Mt(t){return t.match(/.{4}/g).map((function(t){var e=parseInt(t.substr(0,2),16),n=parseInt(t.substr(2),16);if(0==e&n<128)return String.fromCharCode(n);if(e<8){var i=128|63&n;return kt((192|(7&e)<<3|(192&n)>>6).toString(16)+i.toString(16))}i=128|(15&e)<<2|(192&n)>>6;var r=128|63&n;return kt((224|(240&e)>>4).toString(16)+i.toString(16)+r.toString(16))})).join("")}function Ut(t){for(var e=encodeURIComponent(t),n="",i=0;i<e.length;i++)"%"==e[i]?(n+=e.substr(i,3),i+=2):n=n+"%"+gt(e[i]);return n}function Lt(t){return!(t.length%2!=0||!t.match(/^[0-9a-f]+$/)&&!t.match(/^[0-9A-F]+$/))}function Bt(t){return t.length%2==1?"0"+t:t.substr(0,1)>"7"?"00"+t:t}dt.getLblen=function(t,e){if("8"!=t.substr(e+2,1))return 1;var n=parseInt(t.substr(e+3,1));return 0==n?-1:0<n&&n<10?n+1:-2},dt.getL=function(t,e){var n=dt.getLblen(t,e);return n<1?"":t.substr(e+2,2*n)},dt.getVblen=function(t,e){var n;return""==(n=dt.getL(t,e))?-1:("8"===n.substr(0,1)?new S(n.substr(2),16):new S(n,16)).intValue()},dt.getVidx=function(t,e){var n=dt.getLblen(t,e);return n<0?n:e+2*(n+1)},dt.getV=function(t,e){var n=dt.getVidx(t,e),i=dt.getVblen(t,e);return t.substr(n,2*i)},dt.getTLV=function(t,e){return t.substr(e,2)+dt.getL(t,e)+dt.getV(t,e)},dt.getTLVblen=function(t,e){return 2+2*dt.getLblen(t,e)+2*dt.getVblen(t,e)},dt.getNextSiblingIdx=function(t,e){return dt.getVidx(t,e)+2*dt.getVblen(t,e)},dt.getChildIdx=function(t,e){var n,i,r,o=dt,s=[];n=o.getVidx(t,e),i=2*o.getVblen(t,e),"03"==t.substr(e,2)&&(n+=2,i-=2),r=0;for(var a=n;r<=i;){var c=o.getTLVblen(t,a);if((r+=c)<=i&&s.push(a),a+=c,r>=i)break}return s},dt.getNthChildIdx=function(t,e,n){return dt.getChildIdx(t,e)[n]},dt.getIdxbyList=function(t,e,n,i){var r,o,s=dt;return 0==n.length?void 0!==i&&t.substr(e,2)!==i?-1:e:(r=n.shift())>=(o=s.getChildIdx(t,e)).length?-1:s.getIdxbyList(t,o[r],n,i)},dt.getIdxbyListEx=function(t,e,n,i){var r,o,s=dt;if(0==n.length)return void 0!==i&&t.substr(e,2)!==i?-1:e;r=n.shift(),o=s.getChildIdx(t,e);for(var a=0,c=0;c<o.length;c++){var u=t.substr(o[c],2);if("number"==typeof r&&!s.isContextTag(u)&&a==r||"string"==typeof r&&s.isContextTag(u,r))return s.getIdxbyListEx(t,o[c],n,i);s.isContextTag(u)||a++}return-1},dt.getTLVbyList=function(t,e,n,i){var r=dt,o=r.getIdxbyList(t,e,n,i);return-1==o||o>=t.length?null:r.getTLV(t,o)},dt.getTLVbyListEx=function(t,e,n,i){var r=dt,o=r.getIdxbyListEx(t,e,n,i);return-1==o?null:r.getTLV(t,o)},dt.getVbyList=function(t,e,n,i,r){var o,s,a=dt;return-1==(o=a.getIdxbyList(t,e,n,i))||o>=t.length?null:(s=a.getV(t,o),!0===r&&(s=s.substr(2)),s)},dt.getVbyListEx=function(t,e,n,i,r){var o,s,a=dt;return-1==(o=a.getIdxbyListEx(t,e,n,i))?null:(s=a.getV(t,o),"03"==t.substr(o,2)&&!1!==r&&(s=s.substr(2)),s)},dt.getInt=function(t,e,n){null==n&&(n=-1);try{var i=t.substr(e,2);if("02"!=i&&"03"!=i)return n;var r=dt.getV(t,e);return"02"==i?parseInt(r,16):function(t){try{var e=t.substr(0,2);if("00"==e)return parseInt(t.substr(2),16);var n=parseInt(e,16),i=t.substr(2),r=parseInt(i,16).toString(2);return"0"==r&&(r="00000000"),r=r.slice(0,0-n),parseInt(r,2)}catch(t){return-1}}(r)}catch(t){return n}},dt.getOID=function(t,e,n){null==n&&(n=null);try{return"06"!=t.substr(e,2)?n:function(t){if(!Lt(t))return null;try{var e=[],n=t.substr(0,2),i=parseInt(n,16);e[0]=new String(Math.floor(i/40)),e[1]=new String(i%40);for(var r=t.substr(2),o=[],s=0;s<r.length/2;s++)o.push(parseInt(r.substr(2*s,2),16));var a=[],c="";for(s=0;s<o.length;s++)128&o[s]?c+=Jt((127&o[s]).toString(2),7):(c+=Jt((127&o[s]).toString(2),7),a.push(new String(parseInt(c,2))),c="");var u=e.join(".");return a.length>0&&(u=u+"."+a.join(".")),u}catch(t){return null}}(dt.getV(t,e))}catch(t){return n}},dt.getOIDName=function(t,e,n){null==n&&(n=null);try{var i=dt.getOID(t,e,n);if(i==n)return n;var r=ut.asn1.x509.OID.oid2name(i);return""==r?i:r}catch(t){return n}},dt.getString=function(t,e,n){null==n&&(n=null);try{return Et(dt.getV(t,e))}catch(t){return n}},dt.hextooidstr=function(t){var e=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},n=[],i=t.substr(0,2),r=parseInt(i,16);n[0]=new String(Math.floor(r/40)),n[1]=new String(r%40);for(var o=t.substr(2),s=[],a=0;a<o.length/2;a++)s.push(parseInt(o.substr(2*a,2),16));var c=[],u="";for(a=0;a<s.length;a++)128&s[a]?u+=e((127&s[a]).toString(2),7):(u+=e((127&s[a]).toString(2),7),c.push(new String(parseInt(u,2))),u="");var l=n.join(".");return c.length>0&&(l=l+"."+c.join(".")),l},dt.dump=function(t,e,n,i){var r=dt,o=r.getV,s=r.dump,a=r.getChildIdx,c=t;t instanceof ut.asn1.ASN1Object&&(c=t.getEncodedHex());var u=function(t,e){return t.length<=2*e?t:t.substr(0,e)+"..(total "+t.length/2+"bytes).."+t.substr(t.length-e,e)};void 0===e&&(e={ommit_long_octet:32}),void 0===n&&(n=0),void 0===i&&(i="");var l,h=e.ommit_long_octet;if("01"==(l=c.substr(n,2)))return"00"==(d=o(c,n))?i+"BOOLEAN FALSE\n":i+"BOOLEAN TRUE\n";if("02"==l)return i+"INTEGER "+u(d=o(c,n),h)+"\n";if("03"==l){var d=o(c,n);return r.isASN1HEX(d.substr(2))?(x=i+"BITSTRING, encapsulates\n")+s(d.substr(2),e,0,i+" "):i+"BITSTRING "+u(d,h)+"\n"}if("04"==l)return d=o(c,n),r.isASN1HEX(d)?(x=i+"OCTETSTRING, encapsulates\n")+s(d,e,0,i+" "):i+"OCTETSTRING "+u(d,h)+"\n";if("05"==l)return i+"NULL\n";if("06"==l){var f=o(c,n),p=ut.asn1.ASN1Util.oidHexToInt(f),v=ut.asn1.x509.OID.oid2name(p),g=p.replace(/\./g," ");return""!=v?i+"ObjectIdentifier "+v+" ("+g+")\n":i+"ObjectIdentifier ("+g+")\n"}if("0a"==l)return i+"ENUMERATED "+parseInt(o(c,n))+"\n";if("0c"==l)return i+"UTF8String '"+kt(o(c,n))+"'\n";if("13"==l)return i+"PrintableString '"+kt(o(c,n))+"'\n";if("14"==l)return i+"TeletexString '"+kt(o(c,n))+"'\n";if("16"==l)return i+"IA5String '"+kt(o(c,n))+"'\n";if("17"==l)return i+"UTCTime "+kt(o(c,n))+"\n";if("18"==l)return i+"GeneralizedTime "+kt(o(c,n))+"\n";if("1a"==l)return i+"VisualString '"+kt(o(c,n))+"'\n";if("1e"==l)return i+"BMPString '"+Mt(o(c,n))+"'\n";if("30"==l){if("3000"==c.substr(n,4))return i+"SEQUENCE {}\n";x=i+"SEQUENCE\n";var m=e;if((2==(y=a(c,n)).length||3==y.length)&&"06"==c.substr(y[0],2)&&"04"==c.substr(y[y.length-1],2)){v=r.oidname(o(c,y[0]));var w=JSON.parse(JSON.stringify(e));w.x509ExtName=v,m=w}for(var b=0;b<y.length;b++)x+=s(c,m,y[b],i+" ");return x}if("31"==l){x=i+"SET\n";var y=a(c,n);for(b=0;b<y.length;b++)x+=s(c,e,y[b],i+" ");return x}if(0!=(128&(l=parseInt(l,16)))){var x,k=31&l;if(0!=(32&l)){for(x=i+"["+k+"]\n",y=a(c,n),b=0;b<y.length;b++)x+=s(c,e,y[b],i+" ");return x}return d=o(c,n),dt.isASN1HEX(d)?(x=i+"["+k+"]\n")+s(d,e,0,i+" "):(("68747470"==d.substr(0,8)||"subjectAltName"===e.x509ExtName&&2==k)&&(d=kt(d)),i+"["+k+"] "+d+"\n")}return i+"UNKNOWN("+l+") "+o(c,n)+"\n"},dt.isContextTag=function(t,e){var n,i;t=t.toLowerCase();try{n=parseInt(t,16)}catch(t){return-1}if(void 0===e)return 128==(192&n);try{return null!=e.match(/^\[[0-9]+\]$/)&&!((i=parseInt(e.substr(1,e.length-1),10))>31)&&128==(192&n)&&(31&n)==i}catch(t){return!1}},dt.isASN1HEX=function(t){var e=dt;if(t.length%2==1)return!1;var n=e.getVblen(t,0),i=t.substr(0,2),r=e.getL(t,0);return t.length-i.length-r.length==2*n},dt.checkStrictDER=function(t,e,n,i,r){var o=dt;if(void 0===n){if("string"!=typeof t)throw new Error("not hex string");if(t=t.toLowerCase(),!ut.lang.String.isHex(t))throw new Error("not hex string");n=t.length,r=(i=t.length/2)<128?1:Math.ceil(i.toString(16))+1}if(o.getL(t,e).length>2*r)throw new Error("L of TLV too long: idx="+e);var s=o.getVblen(t,e);if(s>i)throw new Error("value of L too long than hex: idx="+e);var a=o.getTLV(t,e),c=a.length-2-o.getL(t,e).length;if(c!==2*s)throw new Error("V string length and L's value not the same:"+c+"/"+2*s);if(0===e&&t.length!=a.length)throw new Error("total length and TLV length unmatch:"+t.length+"!="+a.length);var u=t.substr(e,2);if("02"===u){var l=o.getVidx(t,e);if("00"==t.substr(l,2)&&t.charCodeAt(l+2)<56)throw new Error("not least zeros for DER INTEGER")}if(32&parseInt(u,16)){for(var h=o.getVblen(t,e),d=0,f=o.getChildIdx(t,e),p=0;p<f.length;p++)d+=o.getTLV(t,f[p]).length,o.checkStrictDER(t,f[p],n,i,r);if(2*h!=d)throw new Error("sum of children's TLV length and L unmatch: "+2*h+"!="+d)}},dt.oidname=function(t){var e=ut.asn1;ut.lang.String.isHex(t)&&(t=e.ASN1Util.oidHexToInt(t));var n=e.x509.OID.oid2name(t);return""===n&&(n=t),n},void 0!==ut&&ut||(e.KJUR=ut={}),void 0!==ut.lang&&ut.lang||(ut.lang={}),ut.lang.String=function(){},"function"==typeof t?(e.utf8tob64u=lt=function(e){return mt(t.from(e,"utf8").toString("base64"))},e.b64utoutf8=ht=function(e){return t.from(wt(e),"base64").toString("utf8")}):(e.utf8tob64u=lt=function(t){return bt(Tt(Ut(t)))},e.b64utoutf8=ht=function(t){return decodeURIComponent(Ot(yt(t)))}),ut.lang.String.isInteger=function(t){return!!t.match(/^[0-9]+$/)||!!t.match(/^-[0-9]+$/)},ut.lang.String.isHex=function(t){return Lt(t)},ut.lang.String.isBase64=function(t){return!(!(t=t.replace(/\s+/g,"")).match(/^[0-9A-Za-z+\/]+={0,3}$/)||t.length%4!=0)},ut.lang.String.isBase64URL=function(t){return!t.match(/[+/=]/)&&(t=wt(t),ut.lang.String.isBase64(t))},ut.lang.String.isIntegerArray=function(t){return!!(t=t.replace(/\s+/g,"")).match(/^\[[0-9,]+\]$/)},ut.lang.String.isPrintable=function(t){return null!==t.match(/^[0-9A-Za-z '()+,-./:=?]*$/)},ut.lang.String.isIA5=function(t){return null!==t.match(/^[\x20-\x21\x23-\x7f]*$/)},ut.lang.String.isMail=function(t){return null!==t.match(/^[A-Za-z0-9]{1}[A-Za-z0-9_.-]*@{1}[A-Za-z0-9_.-]{1,}\.[A-Za-z0-9]{1,}$/)};var Jt=function(t,e,n){return null==n&&(n="0"),t.length>=e?t:new Array(e-t.length+1).join(n)+t};function $t(t,e){var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t,t.superclass=e.prototype,e.prototype.constructor==Object.prototype.constructor&&(e.prototype.constructor=e)}void 0!==ut&&ut||(e.KJUR=ut={}),void 0!==ut.crypto&&ut.crypto||(ut.crypto={}),ut.crypto.Util=new function(){this.DIGESTINFOHEAD={sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",ripemd160:"3021300906052b2403020105000414"},this.DEFAULTPROVIDER={md5:"cryptojs",sha1:"cryptojs",sha224:"cryptojs",sha256:"cryptojs",sha384:"cryptojs",sha512:"cryptojs",ripemd160:"cryptojs",hmacmd5:"cryptojs",hmacsha1:"cryptojs",hmacsha224:"cryptojs",hmacsha256:"cryptojs",hmacsha384:"cryptojs",hmacsha512:"cryptojs",hmacripemd160:"cryptojs",MD5withRSA:"cryptojs/jsrsa",SHA1withRSA:"cryptojs/jsrsa",SHA224withRSA:"cryptojs/jsrsa",SHA256withRSA:"cryptojs/jsrsa",SHA384withRSA:"cryptojs/jsrsa",SHA512withRSA:"cryptojs/jsrsa",RIPEMD160withRSA:"cryptojs/jsrsa",MD5withECDSA:"cryptojs/jsrsa",SHA1withECDSA:"cryptojs/jsrsa",SHA224withECDSA:"cryptojs/jsrsa",SHA256withECDSA:"cryptojs/jsrsa",SHA384withECDSA:"cryptojs/jsrsa",SHA512withECDSA:"cryptojs/jsrsa",RIPEMD160withECDSA:"cryptojs/jsrsa",SHA1withDSA:"cryptojs/jsrsa",SHA224withDSA:"cryptojs/jsrsa",SHA256withDSA:"cryptojs/jsrsa",MD5withRSAandMGF1:"cryptojs/jsrsa",SHAwithRSAandMGF1:"cryptojs/jsrsa",SHA1withRSAandMGF1:"cryptojs/jsrsa",SHA224withRSAandMGF1:"cryptojs/jsrsa",SHA256withRSAandMGF1:"cryptojs/jsrsa",SHA384withRSAandMGF1:"cryptojs/jsrsa",SHA512withRSAandMGF1:"cryptojs/jsrsa",RIPEMD160withRSAandMGF1:"cryptojs/jsrsa"},this.CRYPTOJSMESSAGEDIGESTNAME={md5:b.algo.MD5,sha1:b.algo.SHA1,sha224:b.algo.SHA224,sha256:b.algo.SHA256,sha384:b.algo.SHA384,sha512:b.algo.SHA512,ripemd160:b.algo.RIPEMD160},this.getDigestInfoHex=function(t,e){if(void 0===this.DIGESTINFOHEAD[e])throw"alg not supported in Util.DIGESTINFOHEAD: "+e;return this.DIGESTINFOHEAD[e]+t},this.getPaddedDigestInfoHex=function(t,e,n){var i=this.getDigestInfoHex(t,e),r=n/4;if(i.length+22>r)throw"key is too short for SigAlg: keylen="+n+","+e;for(var o="0001",s="00"+i,a="",c=r-o.length-s.length,u=0;u<c;u+=2)a+="ff";return o+a+s},this.hashString=function(t,e){return new ut.crypto.MessageDigest({alg:e}).digestString(t)},this.hashHex=function(t,e){return new ut.crypto.MessageDigest({alg:e}).digestHex(t)},this.sha1=function(t){return this.hashString(t,"sha1")},this.sha256=function(t){return this.hashString(t,"sha256")},this.sha256Hex=function(t){return this.hashHex(t,"sha256")},this.sha512=function(t){return this.hashString(t,"sha512")},this.sha512Hex=function(t){return this.hashHex(t,"sha512")},this.isKey=function(t){return t instanceof rt||t instanceof ut.crypto.DSA||t instanceof ut.crypto.ECDSA}},ut.crypto.Util.md5=function(t){return new ut.crypto.MessageDigest({alg:"md5",prov:"cryptojs"}).digestString(t)},ut.crypto.Util.ripemd160=function(t){return new ut.crypto.MessageDigest({alg:"ripemd160",prov:"cryptojs"}).digestString(t)},ut.crypto.Util.SECURERANDOMGEN=new et,ut.crypto.Util.getRandomHexOfNbytes=function(t){var e=new Array(t);return ut.crypto.Util.SECURERANDOMGEN.nextBytes(e),vt(e)},ut.crypto.Util.getRandomBigIntegerOfNbytes=function(t){return new S(ut.crypto.Util.getRandomHexOfNbytes(t),16)},ut.crypto.Util.getRandomHexOfNbits=function(t){var e=t%8,n=new Array((t-e)/8+1);return ut.crypto.Util.SECURERANDOMGEN.nextBytes(n),n[0]=(255<<e&255^255)&n[0],vt(n)},ut.crypto.Util.getRandomBigIntegerOfNbits=function(t){return new S(ut.crypto.Util.getRandomHexOfNbits(t),16)},ut.crypto.Util.getRandomBigIntegerZeroToMax=function(t){for(var e=t.bitLength();;){var n=ut.crypto.Util.getRandomBigIntegerOfNbits(e);if(-1!=t.compareTo(n))return n}},ut.crypto.Util.getRandomBigIntegerMinToMax=function(t,e){var n=t.compareTo(e);if(1==n)throw"biMin is greater than biMax";if(0==n)return t;var i=e.subtract(t);return ut.crypto.Util.getRandomBigIntegerZeroToMax(i).add(t)},ut.crypto.MessageDigest=function(t){this.setAlgAndProvider=function(t,e){if(null!==(t=ut.crypto.MessageDigest.getCanonicalAlgName(t))&&void 0===e&&(e=ut.crypto.Util.DEFAULTPROVIDER[t]),-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(t)&&"cryptojs"==e){try{this.md=ut.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[t].create()}catch(e){throw"setAlgAndProvider hash alg set fail alg="+t+"/"+e}this.updateString=function(t){this.md.update(t)},this.updateHex=function(t){var e=b.enc.Hex.parse(t);this.md.update(e)},this.digest=function(){return this.md.finalize().toString(b.enc.Hex)},this.digestString=function(t){return this.updateString(t),this.digest()},this.digestHex=function(t){return this.updateHex(t),this.digest()}}if(-1!=":sha256:".indexOf(t)&&"sjcl"==e){try{this.md=new sjcl.hash.sha256}catch(e){throw"setAlgAndProvider hash alg set fail alg="+t+"/"+e}this.updateString=function(t){this.md.update(t)},this.updateHex=function(t){var e=sjcl.codec.hex.toBits(t);this.md.update(e)},this.digest=function(){var t=this.md.finalize();return sjcl.codec.hex.fromBits(t)},this.digestString=function(t){return this.updateString(t),this.digest()},this.digestHex=function(t){return this.updateHex(t),this.digest()}}},this.updateString=function(){throw"updateString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.updateHex=function(){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(){throw"digestString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestHex=function(){throw"digestHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},void 0!==t&&void 0!==t.alg&&(this.algName=t.alg,void 0===t.prov&&(this.provName=ut.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))},ut.crypto.MessageDigest.getCanonicalAlgName=function(t){return"string"==typeof t&&(t=(t=t.toLowerCase()).replace(/-/,"")),t},ut.crypto.MessageDigest.getHashLength=function(t){var e=ut.crypto.MessageDigest,n=e.getCanonicalAlgName(t);if(void 0===e.HASHLENGTH[n])throw"not supported algorithm: "+t;return e.HASHLENGTH[n]},ut.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20},ut.crypto.Mac=function(t){this.setAlgAndProvider=function(t,e){if(null==(t=t.toLowerCase())&&(t="hmacsha1"),"hmac"!=(t=t.toLowerCase()).substr(0,4))throw"setAlgAndProvider unsupported HMAC alg: "+t;void 0===e&&(e=ut.crypto.Util.DEFAULTPROVIDER[t]),this.algProv=t+"/"+e;var n=t.substr(4);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(n)&&"cryptojs"==e){try{this.mac=b.algo.HMAC.create(ut.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[n],this.pass)}catch(t){throw"setAlgAndProvider hash alg set fail hashAlg="+n+"/"+t}this.updateString=function(t){this.mac.update(t)},this.updateHex=function(t){var e=b.enc.Hex.parse(t);this.mac.update(e)},this.doFinal=function(){return this.mac.finalize().toString(b.enc.Hex)},this.doFinalString=function(t){return this.updateString(t),this.doFinal()},this.doFinalHex=function(t){return this.updateHex(t),this.doFinal()}}},this.updateString=function(){throw"updateString(str) not supported for this alg/prov: "+this.algProv},this.updateHex=function(){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(){throw"digestString(str) not supported for this alg/prov: "+this.algProv},this.doFinalHex=function(){throw"digestHex(hex) not supported for this alg/prov: "+this.algProv},this.setPassword=function(t){if("string"==typeof t){var e=t;return t.length%2!=1&&t.match(/^[0-9A-Fa-f]+$/)||(e=St(t)),void(this.pass=b.enc.Hex.parse(e))}if("object"!=(void 0===t?"undefined":m(t)))throw"KJUR.crypto.Mac unsupported password type: "+t;if(e=null,void 0!==t.hex){if(t.hex.length%2!=0||!t.hex.match(/^[0-9A-Fa-f]+$/))throw"Mac: wrong hex password: "+t.hex;e=t.hex}if(void 0!==t.utf8&&(e=xt(t.utf8)),void 0!==t.rstr&&(e=St(t.rstr)),void 0!==t.b64&&(e=k(t.b64)),void 0!==t.b64u&&(e=yt(t.b64u)),null==e)throw"KJUR.crypto.Mac unsupported password type: "+t;this.pass=b.enc.Hex.parse(e)},void 0!==t&&(void 0!==t.pass&&this.setPassword(t.pass),void 0!==t.alg&&(this.algName=t.alg,void 0===t.prov&&(this.provName=ut.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName)))},ut.crypto.Signature=function(t){var e=null;if(this._setAlgNames=function(){var t=this.algName.match(/^(.+)with(.+)$/);t&&(this.mdAlgName=t[1].toLowerCase(),this.pubkeyAlgName=t[2].toLowerCase(),"rsaandmgf1"==this.pubkeyAlgName&&"sha"==this.mdAlgName&&(this.mdAlgName="sha1"))},this._zeroPaddingOfSignature=function(t,e){for(var n="",i=e/4-t.length,r=0;r<i;r++)n+="0";return n+t},this.setAlgAndProvider=function(t,e){if(this._setAlgNames(),"cryptojs/jsrsa"!=e)throw new Error("provider not supported: "+e);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(this.mdAlgName)){try{this.md=new ut.crypto.MessageDigest({alg:this.mdAlgName})}catch(t){throw new Error("setAlgAndProvider hash alg set fail alg="+this.mdAlgName+"/"+t)}this.init=function(t,e){var n=null;try{n=void 0===e?Ht.getKey(t):Ht.getKey(t,e)}catch(t){throw"init failed:"+t}if(!0===n.isPrivate)this.prvKey=n,this.state="SIGN";else{if(!0!==n.isPublic)throw"init failed.:"+n;this.pubKey=n,this.state="VERIFY"}},this.updateString=function(t){this.md.updateString(t)},this.updateHex=function(t){this.md.updateHex(t)},this.sign=function(){if(this.sHashHex=this.md.digest(),void 0===this.prvKey&&void 0!==this.ecprvhex&&void 0!==this.eccurvename&&void 0!==ut.crypto.ECDSA&&(this.prvKey=new ut.crypto.ECDSA({curve:this.eccurvename,prv:this.ecprvhex})),this.prvKey instanceof rt&&"rsaandmgf1"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHashPSS(this.sHashHex,this.mdAlgName,this.pssSaltLen);else if(this.prvKey instanceof rt&&"rsa"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex,this.mdAlgName);else if(this.prvKey instanceof ut.crypto.ECDSA)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex);else{if(!(this.prvKey instanceof ut.crypto.DSA))throw"Signature: unsupported private key alg: "+this.pubkeyAlgName;this.hSign=this.prvKey.signWithMessageHash(this.sHashHex)}return this.hSign},this.signString=function(t){return this.updateString(t),this.sign()},this.signHex=function(t){return this.updateHex(t),this.sign()},this.verify=function(t){if(this.sHashHex=this.md.digest(),void 0===this.pubKey&&void 0!==this.ecpubhex&&void 0!==this.eccurvename&&void 0!==ut.crypto.ECDSA&&(this.pubKey=new ut.crypto.ECDSA({curve:this.eccurvename,pub:this.ecpubhex})),this.pubKey instanceof rt&&"rsaandmgf1"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,t,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof rt&&"rsa"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);if(void 0!==ut.crypto.ECDSA&&this.pubKey instanceof ut.crypto.ECDSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);if(void 0!==ut.crypto.DSA&&this.pubKey instanceof ut.crypto.DSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);throw"Signature: unsupported public key alg: "+this.pubkeyAlgName}}},this.init=function(){throw"init(key, pass) not supported for this alg:prov="+this.algProvName},this.updateString=function(){throw"updateString(str) not supported for this alg:prov="+this.algProvName},this.updateHex=function(){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(){throw"digestString(str) not supported for this alg:prov="+this.algProvName},this.signHex=function(){throw"digestHex(hex) not supported for this alg:prov="+this.algProvName},this.verify=function(){throw"verify(hSigVal) not supported for this alg:prov="+this.algProvName},this.initParams=t,void 0!==t&&(void 0!==t.alg&&(this.algName=t.alg,this.provName=void 0===t.prov?ut.crypto.Util.DEFAULTPROVIDER[this.algName]:t.prov,this.algProvName=this.algName+":"+this.provName,this.setAlgAndProvider(this.algName,this.provName),this._setAlgNames()),void 0!==t.psssaltlen&&(this.pssSaltLen=t.psssaltlen),void 0!==t.prvkeypem)){if(void 0!==t.prvkeypas)throw"both prvkeypem and prvkeypas parameters not supported";try{e=Ht.getKey(t.prvkeypem),this.init(e)}catch(t){throw"fatal error to load pem private key: "+t}}},ut.crypto.Cipher=function(){},ut.crypto.Cipher.encrypt=function(t,e,n){if(e instanceof rt&&e.isPublic){var i=ut.crypto.Cipher.getAlgByKeyAndName(e,n);if("RSA"===i)return e.encrypt(t);if("RSAOAEP"===i)return e.encryptOAEP(t,"sha1");var r=i.match(/^RSAOAEP(\d+)$/);if(null!==r)return e.encryptOAEP(t,"sha"+r[1]);throw"Cipher.encrypt: unsupported algorithm for RSAKey: "+n}throw"Cipher.encrypt: unsupported key or algorithm"},ut.crypto.Cipher.decrypt=function(t,e,n){if(e instanceof rt&&e.isPrivate){var i=ut.crypto.Cipher.getAlgByKeyAndName(e,n);if("RSA"===i)return e.decrypt(t);if("RSAOAEP"===i)return e.decryptOAEP(t,"sha1");var r=i.match(/^RSAOAEP(\d+)$/);if(null!==r)return e.decryptOAEP(t,"sha"+r[1]);throw"Cipher.decrypt: unsupported algorithm for RSAKey: "+n}throw"Cipher.decrypt: unsupported key or algorithm"},ut.crypto.Cipher.getAlgByKeyAndName=function(t,e){if(t instanceof rt){if(-1!=":RSA:RSAOAEP:RSAOAEP224:RSAOAEP256:RSAOAEP384:RSAOAEP512:".indexOf(e))return e;if(null==e)return"RSA";throw"getAlgByKeyAndName: not supported algorithm name for RSAKey: "+e}throw"getAlgByKeyAndName: not supported algorithm name: "+e},ut.crypto.OID=new function(){this.oidhex2name={"2a864886f70d010101":"rsaEncryption","2a8648ce3d0201":"ecPublicKey","2a8648ce380401":"dsa","2a8648ce3d030107":"secp256r1","2b8104001f":"secp192k1","2b81040021":"secp224r1","2b8104000a":"secp256k1","2b81040023":"secp521r1","2b81040022":"secp384r1","2a8648ce380403":"SHA1withDSA","608648016503040301":"SHA224withDSA","608648016503040302":"SHA256withDSA"}},void 0!==ut&&ut||(e.KJUR=ut={}),void 0!==ut.crypto&&ut.crypto||(ut.crypto={}),ut.crypto.ECDSA=function(t){var e=Error,n=S,i=st,r=ut.crypto.ECDSA,o=ut.crypto.ECParameterDB,s=r.getName,a=dt.getVbyListEx,c=dt.isASN1HEX,u=new et;this.type="EC",this.isPrivate=!1,this.isPublic=!1,this.getBigRandom=function(t){return new n(t.bitLength(),u).mod(t.subtract(n.ONE)).add(n.ONE)},this.setNamedCurve=function(t){this.ecparams=o.getByName(t),this.prvKeyHex=null,this.pubKeyHex=null,this.curveName=t},this.setPrivateKeyHex=function(t){this.isPrivate=!0,this.prvKeyHex=t},this.setPublicKeyHex=function(t){this.isPublic=!0,this.pubKeyHex=t},this.getPublicKeyXYHex=function(){var t=this.pubKeyHex;if("04"!==t.substr(0,2))throw"this method supports uncompressed format(04) only";var e=this.ecparams.keylen/4;if(t.length!==2+2*e)throw"malformed public key hex length";var n={};return n.x=t.substr(2,e),n.y=t.substr(2+e),n},this.getShortNISTPCurveName=function(){var t=this.curveName;return"secp256r1"===t||"NIST P-256"===t||"P-256"===t||"prime256v1"===t?"P-256":"secp384r1"===t||"NIST P-384"===t||"P-384"===t?"P-384":null},this.generateKeyPairHex=function(){var t=this.getBigRandom(this.ecparams.n),e=this.ecparams.G.multiply(t),n=e.getX().toBigInteger(),i=e.getY().toBigInteger(),r=this.ecparams.keylen/4,o=("0000000000"+t.toString(16)).slice(-r),s="04"+("0000000000"+n.toString(16)).slice(-r)+("0000000000"+i.toString(16)).slice(-r);return this.setPrivateKeyHex(o),this.setPublicKeyHex(s),{ecprvhex:o,ecpubhex:s}},this.signWithMessageHash=function(t){return this.signHex(t,this.prvKeyHex)},this.signHex=function(t,e){var i=new n(e,16),o=this.ecparams.n,s=new n(t.substring(0,this.ecparams.keylen/4),16);do{var a=this.getBigRandom(o),c=this.ecparams.G.multiply(a).getX().toBigInteger().mod(o)}while(c.compareTo(n.ZERO)<=0);var u=a.modInverse(o).multiply(s.add(i.multiply(c))).mod(o);return r.biRSSigToASN1Sig(c,u)},this.sign=function(t,e){var i=e,r=this.ecparams.n,o=n.fromByteArrayUnsigned(t);do{var s=this.getBigRandom(r),a=this.ecparams.G.multiply(s).getX().toBigInteger().mod(r)}while(a.compareTo(S.ZERO)<=0);var c=s.modInverse(r).multiply(o.add(i.multiply(a))).mod(r);return this.serializeSig(a,c)},this.verifyWithMessageHash=function(t,e){return this.verifyHex(t,e,this.pubKeyHex)},this.verifyHex=function(t,e,o){try{var s,a,c=r.parseSigHex(e);s=c.r,a=c.s;var u=i.decodeFromHex(this.ecparams.curve,o),l=new n(t.substring(0,this.ecparams.keylen/4),16);return this.verifyRaw(l,s,a,u)}catch(t){return!1}},this.verify=function(t,e,r){var o,s,a;if(Bitcoin.Util.isArray(e)){var c=this.parseSig(e);o=c.r,s=c.s}else{if("object"!==(void 0===e?"undefined":m(e))||!e.r||!e.s)throw"Invalid value for signature";o=e.r,s=e.s}if(r instanceof st)a=r;else{if(!Bitcoin.Util.isArray(r))throw"Invalid format for pubkey value, must be byte array or ECPointFp";a=i.decodeFrom(this.ecparams.curve,r)}var u=n.fromByteArrayUnsigned(t);return this.verifyRaw(u,o,s,a)},this.verifyRaw=function(t,e,i,r){var o=this.ecparams.n,s=this.ecparams.G;if(e.compareTo(n.ONE)<0||e.compareTo(o)>=0)return!1;if(i.compareTo(n.ONE)<0||i.compareTo(o)>=0)return!1;var a=i.modInverse(o),c=t.multiply(a).mod(o),u=e.multiply(a).mod(o);return s.multiply(c).add(r.multiply(u)).getX().toBigInteger().mod(o).equals(e)},this.serializeSig=function(t,e){var n=t.toByteArraySigned(),i=e.toByteArraySigned(),r=[];return r.push(2),r.push(n.length),(r=r.concat(n)).push(2),r.push(i.length),(r=r.concat(i)).unshift(r.length),r.unshift(48),r},this.parseSig=function(t){var e;if(48!=t[0])throw new Error("Signature not a valid DERSequence");if(2!=t[e=2])throw new Error("First element in signature must be a DERInteger");var i=t.slice(e+2,e+2+t[e+1]);if(2!=t[e+=2+t[e+1]])throw new Error("Second element in signature must be a DERInteger");var r=t.slice(e+2,e+2+t[e+1]);return e+=2+t[e+1],{r:n.fromByteArrayUnsigned(i),s:n.fromByteArrayUnsigned(r)}},this.parseSigCompact=function(t){if(65!==t.length)throw"Signature has the wrong length";var e=t[0]-27;if(e<0||e>7)throw"Invalid signature type";var i=this.ecparams.n;return{r:n.fromByteArrayUnsigned(t.slice(1,33)).mod(i),s:n.fromByteArrayUnsigned(t.slice(33,65)).mod(i),i:e}},this.readPKCS5PrvKeyHex=function(t){if(!1===c(t))throw new Error("not ASN.1 hex string");var e,n,i;try{e=a(t,0,["[0]",0],"06"),n=a(t,0,[1],"04");try{i=a(t,0,["[1]",0],"03")}catch(t){}}catch(t){throw new Error("malformed PKCS#1/5 plain ECC private key")}if(this.curveName=s(e),void 0===this.curveName)throw"unsupported curve name";this.setNamedCurve(this.curveName),this.setPublicKeyHex(i),this.setPrivateKeyHex(n),this.isPublic=!1},this.readPKCS8PrvKeyHex=function(t){if(!1===c(t))throw new e("not ASN.1 hex string");var n,i,r;try{a(t,0,[1,0],"06"),n=a(t,0,[1,1],"06"),i=a(t,0,[2,0,1],"04");try{r=a(t,0,[2,0,"[1]",0],"03")}catch(t){}}catch(t){throw new e("malformed PKCS#8 plain ECC private key")}if(this.curveName=s(n),void 0===this.curveName)throw new e("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(r),this.setPrivateKeyHex(i),this.isPublic=!1},this.readPKCS8PubKeyHex=function(t){if(!1===c(t))throw new e("not ASN.1 hex string");var n,i;try{a(t,0,[0,0],"06"),n=a(t,0,[0,1],"06"),i=a(t,0,[1],"03")}catch(t){throw new e("malformed PKCS#8 ECC public key")}if(this.curveName=s(n),null===this.curveName)throw new e("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(i)},this.readCertPubKeyHex=function(t){if(!1===c(t))throw new e("not ASN.1 hex string");var n,i;try{n=a(t,0,[0,5,0,1],"06"),i=a(t,0,[0,5,1],"03")}catch(t){throw new e("malformed X.509 certificate ECC public key")}if(this.curveName=s(n),null===this.curveName)throw new e("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(i)},void 0!==t&&void 0!==t.curve&&(this.curveName=t.curve),void 0===this.curveName&&(this.curveName="secp256r1"),this.setNamedCurve(this.curveName),void 0!==t&&(void 0!==t.prv&&this.setPrivateKeyHex(t.prv),void 0!==t.pub&&this.setPublicKeyHex(t.pub))},ut.crypto.ECDSA.parseSigHex=function(t){var e=ut.crypto.ECDSA.parseSigHexInHexRS(t);return{r:new S(e.r,16),s:new S(e.s,16)}},ut.crypto.ECDSA.parseSigHexInHexRS=function(t){var e=dt.getChildIdx,n=dt.getV;if(dt.checkStrictDER(t,0),"30"!=t.substr(0,2))throw new Error("signature is not a ASN.1 sequence");var i=e(t,0);if(2!=i.length)throw new Error("signature shall have two elements");var r=i[0],o=i[1];if("02"!=t.substr(r,2))throw new Error("1st item not ASN.1 integer");if("02"!=t.substr(o,2))throw new Error("2nd item not ASN.1 integer");return{r:n(t,r),s:n(t,o)}},ut.crypto.ECDSA.asn1SigToConcatSig=function(t){var e=ut.crypto.ECDSA.parseSigHexInHexRS(t),n=e.r,i=e.s;if("00"==n.substr(0,2)&&n.length%32==2&&(n=n.substr(2)),"00"==i.substr(0,2)&&i.length%32==2&&(i=i.substr(2)),n.length%32==30&&(n="00"+n),i.length%32==30&&(i="00"+i),n.length%32!=0)throw"unknown ECDSA sig r length error";if(i.length%32!=0)throw"unknown ECDSA sig s length error";return n+i},ut.crypto.ECDSA.concatSigToASN1Sig=function(t){if(t.length/2*8%128!=0)throw"unknown ECDSA concatinated r-s sig length error";var e=t.substr(0,t.length/2),n=t.substr(t.length/2);return ut.crypto.ECDSA.hexRSSigToASN1Sig(e,n)},ut.crypto.ECDSA.hexRSSigToASN1Sig=function(t,e){var n=new S(t,16),i=new S(e,16);return ut.crypto.ECDSA.biRSSigToASN1Sig(n,i)},ut.crypto.ECDSA.biRSSigToASN1Sig=function(t,e){var n=ut.asn1,i=new n.DERInteger({bigint:t}),r=new n.DERInteger({bigint:e});return new n.DERSequence({array:[i,r]}).getEncodedHex()},ut.crypto.ECDSA.getName=function(t){return"2b8104001f"===t?"secp192k1":"2a8648ce3d030107"===t?"secp256r1":"2b8104000a"===t?"secp256k1":"2b81040021"===t?"secp224r1":"2b81040022"===t?"secp384r1":-1!=="|secp256r1|NIST P-256|P-256|prime256v1|".indexOf(t)?"secp256r1":-1!=="|secp256k1|".indexOf(t)?"secp256k1":-1!=="|secp224r1|NIST P-224|P-224|".indexOf(t)?"secp224r1":-1!=="|secp384r1|NIST P-384|P-384|".indexOf(t)?"secp384r1":null},void 0!==ut&&ut||(e.KJUR=ut={}),void 0!==ut.crypto&&ut.crypto||(ut.crypto={}),ut.crypto.ECParameterDB=new function(){var t={},e={};function n(t){return new S(t,16)}this.getByName=function(n){var i=n;if(void 0!==e[i]&&(i=e[n]),void 0!==t[i])return t[i];throw"unregistered EC curve name: "+i},this.regist=function(i,r,o,s,a,c,u,l,h,d,f,p){t[i]={};var v=n(o),g=n(s),m=n(a),w=n(c),b=n(u),y=new at(v,g,m),x=y.decodePointHex("04"+l+h);t[i].name=i,t[i].keylen=r,t[i].curve=y,t[i].G=x,t[i].n=w,t[i].h=b,t[i].oid=f,t[i].info=p;for(var k=0;k<d.length;k++)e[d[k]]=i}},ut.crypto.ECParameterDB.regist("secp128r1",128,"FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC","E87579C11079F43DD824993C2CEE5ED3","FFFFFFFE0000000075A30D1B9038A115","1","161FF7528B899B2D0C28607CA52C5B86","CF5AC8395BAFEB13C02DA292DDED7A83",[],"","secp128r1 : SECG curve over a 128 bit prime field"),ut.crypto.ECParameterDB.regist("secp160k1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73","0","7","0100000000000000000001B8FA16DFAB9ACA16B6B3","1","3B4C382CE37AA192A4019E763036F4F5DD4D7EBB","938CF935318FDCED6BC28286531733C3F03C4FEE",[],"","secp160k1 : SECG curve over a 160 bit prime field"),ut.crypto.ECParameterDB.regist("secp160r1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC","1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45","0100000000000000000001F4C8F927AED3CA752257","1","4A96B5688EF573284664698968C38BB913CBFC82","23A628553168947D59DCC912042351377AC5FB32",[],"","secp160r1 : SECG curve over a 160 bit prime field"),ut.crypto.ECParameterDB.regist("secp192k1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37","0","3","FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D","1","DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D","9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D",[]),ut.crypto.ECParameterDB.regist("secp192r1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC","64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1","FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831","1","188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012","07192B95FFC8DA78631011ED6B24CDD573F977A11E794811",[]),ut.crypto.ECParameterDB.regist("secp224r1",224,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE","B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4","FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D","1","B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21","BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34",[]),ut.crypto.ECParameterDB.regist("secp256k1",256,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F","0","7","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","1","79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798","483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8",[]),ut.crypto.ECParameterDB.regist("secp256r1",256,"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC","5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B","FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551","1","6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296","4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5",["NIST P-256","P-256","prime256v1"]),ut.crypto.ECParameterDB.regist("secp384r1",384,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC","B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973","1","AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7","3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f",["NIST P-384","P-384"]),ut.crypto.ECParameterDB.regist("secp521r1",521,"1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC","051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409","1","C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66","011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650",["NIST P-521","P-521"]);var Ht=function(){var t=function(t,n,i){return e(b.AES,t,n,i)},e=function(t,e,n,i){var r=b.enc.Hex.parse(e),o=b.enc.Hex.parse(n),s=b.enc.Hex.parse(i),a={};a.key=o,a.iv=s,a.ciphertext=r;var c=t.decrypt(a,o,{iv:s});return b.enc.Hex.stringify(c)},n=function(t,e,n){return i(b.AES,t,e,n)},i=function(t,e,n,i){var r=b.enc.Hex.parse(e),o=b.enc.Hex.parse(n),s=b.enc.Hex.parse(i),a=t.encrypt(r,o,{iv:s}),c=b.enc.Hex.parse(a.toString());return b.enc.Base64.stringify(c)},r={"AES-256-CBC":{proc:t,eproc:n,keylen:32,ivlen:16},"AES-192-CBC":{proc:t,eproc:n,keylen:24,ivlen:16},"AES-128-CBC":{proc:t,eproc:n,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:function(t,n,i){return e(b.TripleDES,t,n,i)},eproc:function(t,e,n){return i(b.TripleDES,t,e,n)},keylen:24,ivlen:8},"DES-CBC":{proc:function(t,n,i){return e(b.DES,t,n,i)},eproc:function(t,e,n){return i(b.DES,t,e,n)},keylen:8,ivlen:8}},o=function(t){var e={},n=t.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));n&&(e.cipher=n[1],e.ivsalt=n[2]);var i=t.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));i&&(e.type=i[1]);var r=-1,o=0;-1!=t.indexOf("\r\n\r\n")&&(r=t.indexOf("\r\n\r\n"),o=2),-1!=t.indexOf("\n\n")&&(r=t.indexOf("\n\n"),o=1);var s=t.indexOf("-----END");if(-1!=r&&-1!=s){var a=t.substring(r+2*o,s-o);a=a.replace(/\s+/g,""),e.data=a}return e},s=function(t,e,n){for(var i=n.substring(0,16),o=b.enc.Hex.parse(i),s=b.enc.Utf8.parse(e),a=r[t].keylen+r[t].ivlen,c="",u=null;;){var l=b.algo.MD5.create();if(null!=u&&l.update(u),l.update(s),l.update(o),u=l.finalize(),(c+=b.enc.Hex.stringify(u)).length>=2*a)break}var h={};return h.keyhex=c.substr(0,2*r[t].keylen),h.ivhex=c.substr(2*r[t].keylen,2*r[t].ivlen),h},a=function(t,e,n,i){var o=b.enc.Base64.parse(t),s=b.enc.Hex.stringify(o);return(0,r[e].proc)(s,n,i)};return{version:"1.0.0",parsePKCS5PEM:function(t){return o(t)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(t,e,n){return s(t,e,n)},decryptKeyB64:function(t,e,n,i){return a(t,e,n,i)},getDecryptedKeyHex:function(t,e){var n=o(t),i=n.cipher,r=n.ivsalt,c=n.data,u=s(i,e,r).keyhex;return a(c,i,u,r)},getEncryptedPKCS5PEMFromPrvKeyHex:function(t,e,n,i,o){var a,c,u="";if(void 0!==i&&null!=i||(i="AES-256-CBC"),void 0===r[i])throw new Error("KEYUTIL unsupported algorithm: "+i);return void 0!==o&&null!=o||(o=(a=r[i].ivlen,c=b.lib.WordArray.random(a),b.enc.Hex.stringify(c)).toUpperCase()),u="-----BEGIN "+t+" PRIVATE KEY-----\r\n",u+="Proc-Type: 4,ENCRYPTED\r\n",u+="DEK-Info: "+i+","+o+"\r\n",u+="\r\n",(u+=function(t,e,n,i){return(0,r[e].eproc)(t,n,i)}(e,i,s(i,n,o).keyhex,o).replace(/(.{64})/g,"$1\r\n"))+"\r\n-----END "+t+" PRIVATE KEY-----\r\n"},parseHexOfEncryptedPKCS8:function(t){var e=dt.getChildIdx,n=dt.getV,i={},r=e(t,0);if(2!=r.length)throw new Error("malformed format: SEQUENCE(0).items != 2: "+r.length);i.ciphertext=n(t,r[1]);var o=e(t,r[0]);if(2!=o.length)throw new Error("malformed format: SEQUENCE(0.0).items != 2: "+o.length);if("2a864886f70d01050d"!=n(t,o[0]))throw new Error("this only supports pkcs5PBES2");var s=e(t,o[1]);if(2!=o.length)throw new Error("malformed format: SEQUENCE(0.0.1).items != 2: "+s.length);var a=e(t,s[1]);if(2!=a.length)throw new Error("malformed format: SEQUENCE(0.0.1.1).items != 2: "+a.length);if("2a864886f70d0307"!=n(t,a[0]))throw"this only supports TripleDES";i.encryptionSchemeAlg="TripleDES",i.encryptionSchemeIV=n(t,a[1]);var c=e(t,s[0]);if(2!=c.length)throw new Error("malformed format: SEQUENCE(0.0.1.0).items != 2: "+c.length);if("2a864886f70d01050c"!=n(t,c[0]))throw new Error("this only supports pkcs5PBKDF2");var u=e(t,c[1]);if(u.length<2)throw new Error("malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+u.length);i.pbkdf2Salt=n(t,u[0]);var l=n(t,u[1]);try{i.pbkdf2Iter=parseInt(l,16)}catch(t){throw new Error("malformed format pbkdf2Iter: "+l)}return i},getPBKDF2KeyHexFromParam:function(t,e){var n=b.enc.Hex.parse(t.pbkdf2Salt),i=b.PBKDF2(e,n,{keySize:6,iterations:t.pbkdf2Iter});return b.enc.Hex.stringify(i)},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(t,e){var n=Ct(t,"ENCRYPTED PRIVATE KEY"),i=this.parseHexOfEncryptedPKCS8(n),r=Ht.getPBKDF2KeyHexFromParam(i,e),o={};o.ciphertext=b.enc.Hex.parse(i.ciphertext);var s=b.enc.Hex.parse(r),a=b.enc.Hex.parse(i.encryptionSchemeIV),c=b.TripleDES.decrypt(o,s,{iv:a});return b.enc.Hex.stringify(c)},getKeyFromEncryptedPKCS8PEM:function(t,e){var n=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(t,e);return this.getKeyFromPlainPrivatePKCS8Hex(n)},parsePlainPrivatePKCS8Hex:function(t){var e=dt,n=e.getChildIdx,i=e.getV,r={algparam:null};if("30"!=t.substr(0,2))throw new Error("malformed plain PKCS8 private key(code:001)");var o=n(t,0);if(o.length<3)throw new Error("malformed plain PKCS8 private key(code:002)");if("30"!=t.substr(o[1],2))throw new Error("malformed PKCS8 private key(code:003)");var s=n(t,o[1]);if(2!=s.length)throw new Error("malformed PKCS8 private key(code:004)");if("06"!=t.substr(s[0],2))throw new Error("malformed PKCS8 private key(code:005)");if(r.algoid=i(t,s[0]),"06"==t.substr(s[1],2)&&(r.algparam=i(t,s[1])),"04"!=t.substr(o[2],2))throw new Error("malformed PKCS8 private key(code:006)");return r.keyidx=e.getVidx(t,o[2]),r},getKeyFromPlainPrivatePKCS8PEM:function(t){var e=Ct(t,"PRIVATE KEY");return this.getKeyFromPlainPrivatePKCS8Hex(e)},getKeyFromPlainPrivatePKCS8Hex:function(t){var e,n=this.parsePlainPrivatePKCS8Hex(t);if("2a864886f70d010101"==n.algoid)e=new rt;else if("2a8648ce380401"==n.algoid)e=new ut.crypto.DSA;else{if("2a8648ce3d0201"!=n.algoid)throw new Error("unsupported private key algorithm");e=new ut.crypto.ECDSA}return e.readPKCS8PrvKeyHex(t),e},_getKeyFromPublicPKCS8Hex:function(t){var e,n=dt.getVbyList(t,0,[0,0],"06");if("2a864886f70d010101"===n)e=new rt;else if("2a8648ce380401"===n)e=new ut.crypto.DSA;else{if("2a8648ce3d0201"!==n)throw new Error("unsupported PKCS#8 public key hex");e=new ut.crypto.ECDSA}return e.readPKCS8PubKeyHex(t),e},parsePublicRawRSAKeyHex:function(t){var e=dt.getChildIdx,n=dt.getV,i={};if("30"!=t.substr(0,2))throw new Error("malformed RSA key(code:001)");var r=e(t,0);if(2!=r.length)throw new Error("malformed RSA key(code:002)");if("02"!=t.substr(r[0],2))throw new Error("malformed RSA key(code:003)");if(i.n=n(t,r[0]),"02"!=t.substr(r[1],2))throw new Error("malformed RSA key(code:004)");return i.e=n(t,r[1]),i},parsePublicPKCS8Hex:function(t){var e=dt,n=e.getChildIdx,i=e.getV,r={algparam:null},o=n(t,0);if(2!=o.length)throw new Error("outer DERSequence shall have 2 elements: "+o.length);var s=o[0];if("30"!=t.substr(s,2))throw new Error("malformed PKCS8 public key(code:001)");var a=n(t,s);if(2!=a.length)throw new Error("malformed PKCS8 public key(code:002)");if("06"!=t.substr(a[0],2))throw new Error("malformed PKCS8 public key(code:003)");if(r.algoid=i(t,a[0]),"06"==t.substr(a[1],2)?r.algparam=i(t,a[1]):"30"==t.substr(a[1],2)&&(r.algparam={},r.algparam.p=e.getVbyList(t,a[1],[0],"02"),r.algparam.q=e.getVbyList(t,a[1],[1],"02"),r.algparam.g=e.getVbyList(t,a[1],[2],"02")),"03"!=t.substr(o[1],2))throw new Error("malformed PKCS8 public key(code:004)");return r.key=i(t,o[1]).substr(2),r}}}();function zt(t,e){for(var n="",i=e/4-t.length,r=0;r<i;r++)n+="0";return n+t}function Kt(t,e,n){for(var i="",r=0;i.length<e;)i+=Et(n(St(t+String.fromCharCode.apply(String,[(4278190080&r)>>24,(16711680&r)>>16,(65280&r)>>8,255&r])))),r+=1;return i}function Wt(t){for(var e in ut.crypto.Util.DIGESTINFOHEAD){var n=ut.crypto.Util.DIGESTINFOHEAD[e],i=n.length;if(t.substring(0,i)==n)return[e,t.substring(i)]}return[]}function qt(t){var e,n=dt,i=n.getChildIdx,r=n.getV,o=n.getTLV,s=n.getVbyList,a=n.getVbyListEx,c=n.getTLVbyList,u=n.getTLVbyListEx,l=n.getIdxbyList,h=n.getIdxbyListEx,d=n.getVidx,f=n.getInt,p=n.oidname,v=n.hextooidstr,g=Ct;try{e=ut.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch(t){}this.HEX2STAG={"0c":"utf8",13:"prn",16:"ia5","1a":"vis","1e":"bmp"},this.hex=null,this.version=0,this.foffset=0,this.aExtInfo=null,this.getVersion=function(){if(null===this.hex||0!==this.version)return this.version;var t=c(this.hex,0,[0,0]);if("a0"==t.substr(0,2)){var e=c(t,0,[0]),n=f(e,0);if(n<0||2<n)throw new Error("malformed version field");return this.version=n+1,this.version}return this.version=1,this.foffset=-1,1},this.getSerialNumberHex=function(){return a(this.hex,0,[0,0],"02")},this.getSignatureAlgorithmField=function(){var t=u(this.hex,0,[0,1]);return this.getAlgorithmIdentifierName(t)},this.getAlgorithmIdentifierName=function(t){for(var n in e)if(t===e[n])return n;return p(a(t,0,[0],"06"))},this.getIssuer=function(){return this.getX500Name(this.getIssuerHex())},this.getIssuerHex=function(){return c(this.hex,0,[0,3+this.foffset],"30")},this.getIssuerString=function(){return this.getIssuer().str},this.getSubject=function(){return this.getX500Name(this.getSubjectHex())},this.getSubjectHex=function(){return c(this.hex,0,[0,5+this.foffset],"30")},this.getSubjectString=function(){return this.getSubject().str},this.getNotBefore=function(){var t=s(this.hex,0,[0,4+this.foffset,0]);return t=t.replace(/(..)/g,"%$1"),decodeURIComponent(t)},this.getNotAfter=function(){var t=s(this.hex,0,[0,4+this.foffset,1]);return t=t.replace(/(..)/g,"%$1"),decodeURIComponent(t)},this.getPublicKeyHex=function(){return n.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 t=this.getPublicKeyIdx();return l(this.hex,t,[1,0],"30")},this.getPublicKey=function(){return Ht.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var t=c(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(t)},this.getSignatureValueHex=function(){return s(this.hex,0,[2],"03",!0)},this.verifySignature=function(t){var e=this.getSignatureAlgorithmField(),n=this.getSignatureValueHex(),i=c(this.hex,0,[0],"30"),r=new ut.crypto.Signature({alg:e});return r.init(t),r.updateHex(i),r.verify(n)},this.parseExt=function(t){var e,o,a;if(void 0===t){if(3!==this.version)return-1;e=l(a=this.hex,0,[0,7,0],"30"),o=i(a,e)}else{a=Ct(t);var c=l(a,0,[0,3,0,0],"06");if("2a864886f70d01090e"!=r(a,c))return void(this.aExtInfo=new Array);e=l(a,0,[0,3,0,1,0],"30"),o=i(a,e),this.hex=a}this.aExtInfo=new Array;for(var u=0;u<o.length;u++){var h={critical:!1},f=0;3===i(a,o[u]).length&&(h.critical=!0,f=1),h.oid=n.hextooidstr(s(a,o[u],[0],"06"));var p=l(a,o[u],[1+f]);h.vidx=d(a,p),this.aExtInfo.push(h)}},this.getExtInfo=function(t){var e=this.aExtInfo,n=t;if(t.match(/^[0-9.]+$/)||(n=ut.asn1.x509.OID.name2oid(t)),""!==n)for(var i=0;i<e.length;i++)if(e[i].oid===n)return e[i]},this.getExtBasicConstraints=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("basicConstraints");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var i={extname:"basicConstraints"};if(e&&(i.critical=!0),"3000"===t)return i;if("30030101ff"===t)return i.cA=!0,i;if("30060101ff02"===t.substr(0,12)){var s=r(t,10),a=parseInt(s,16);return i.cA=!0,i.pathLen=a,i}throw new Error("hExtV parse error: "+t)},this.getExtKeyUsage=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("keyUsage");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var i={extname:"keyUsage"};return e&&(i.critical=!0),i.names=this.getExtKeyUsageString(t).split(","),i},this.getExtKeyUsageBin=function(t){if(void 0===t){var e=this.getExtInfo("keyUsage");if(void 0===e)return"";t=o(this.hex,e.vidx)}if(8!=t.length&&10!=t.length)throw new Error("malformed key usage value: "+t);var n="000000000000000"+parseInt(t.substr(6),16).toString(2);return 8==t.length&&(n=n.slice(-8)),10==t.length&&(n=n.slice(-16)),""==(n=n.replace(/0+$/,""))&&(n="0"),n},this.getExtKeyUsageString=function(t){for(var e=this.getExtKeyUsageBin(t),n=new Array,i=0;i<e.length;i++)"1"==e.substr(i,1)&&n.push(qt.KEYUSAGE_NAME[i]);return n.join(",")},this.getExtSubjectKeyIdentifier=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("subjectKeyIdentifier");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var i={extname:"subjectKeyIdentifier"};e&&(i.critical=!0);var s=r(t,0);return i.kid={hex:s},i},this.getExtAuthorityKeyIdentifier=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("authorityKeyIdentifier");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var s={extname:"authorityKeyIdentifier"};e&&(s.critical=!0);for(var a=i(t,0),c=0;c<a.length;c++){var u=t.substr(a[c],2);if("80"===u&&(s.kid={hex:r(t,a[c])}),"a1"===u){var l=o(t,a[c]),h=this.getGeneralNames(l);s.issuer=h[0].dn}"82"===u&&(s.sn={hex:r(t,a[c])})}return s},this.getExtExtKeyUsage=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("extKeyUsage");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var s={extname:"extKeyUsage",array:[]};e&&(s.critical=!0);for(var a=i(t,0),c=0;c<a.length;c++)s.array.push(p(r(t,a[c])));return s},this.getExtExtKeyUsageName=function(){var t=this.getExtInfo("extKeyUsage");if(void 0===t)return t;var e=new Array,n=o(this.hex,t.vidx);if(""===n)return e;for(var s=i(n,0),a=0;a<s.length;a++)e.push(p(r(n,s[a])));return e},this.getExtSubjectAltName=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("subjectAltName");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var i={extname:"subjectAltName",array:[]};return e&&(i.critical=!0),i.array=this.getGeneralNames(t),i},this.getExtIssuerAltName=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("issuerAltName");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var i={extname:"issuerAltName",array:[]};return e&&(i.critical=!0),i.array=this.getGeneralNames(t),i},this.getGeneralNames=function(t){for(var e=i(t,0),n=[],r=0;r<e.length;r++){var s=this.getGeneralName(o(t,e[r]));void 0!==s&&n.push(s)}return n},this.getGeneralName=function(t){var e=t.substr(0,2),n=r(t,0),i=Et(n);return"81"==e?{rfc822:i}:"82"==e?{dns:i}:"86"==e?{uri:i}:"87"==e?{ip:Dt(n)}:"a4"==e?{dn:this.getX500Name(n)}:void 0},this.getExtSubjectAltName2=function(){var t,e,n,s=this.getExtInfo("subjectAltName");if(void 0===s)return s;for(var a=new Array,c=o(this.hex,s.vidx),u=i(c,0),l=0;l<u.length;l++)n=c.substr(u[l],2),t=r(c,u[l]),"81"===n&&(e=kt(t),a.push(["MAIL",e])),"82"===n&&(e=kt(t),a.push(["DNS",e])),"84"===n&&(e=qt.hex2dn(t,0),a.push(["DN",e])),"86"===n&&(e=kt(t),a.push(["URI",e])),"87"===n&&(e=Dt(t),a.push(["IP",e]));return a},this.getExtCRLDistributionPoints=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("cRLDistributionPoints");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var r={extname:"cRLDistributionPoints",array:[]};e&&(r.critical=!0);for(var s=i(t,0),a=0;a<s.length;a++){var c=o(t,s[a]);r.array.push(this.getDistributionPoint(c))}return r},this.getDistributionPoint=function(t){for(var e={},n=i(t,0),r=0;r<n.length;r++){var s=t.substr(n[r],2),a=o(t,n[r]);"a0"==s&&(e.dpname=this.getDistributionPointName(a))}return e},this.getDistributionPointName=function(t){for(var e={},n=i(t,0),r=0;r<n.length;r++){var s=t.substr(n[r],2),a=o(t,n[r]);"a0"==s&&(e.full=this.getGeneralNames(a))}return e},this.getExtCRLDistributionPointsURI=function(){var t=this.getExtInfo("cRLDistributionPoints");if(void 0===t)return t;for(var e=new Array,n=i(this.hex,t.vidx),r=0;r<n.length;r++)try{var o=kt(s(this.hex,n[r],[0,0,0],"86"));e.push(o)}catch(t){}return e},this.getExtAIAInfo=function(){var t=this.getExtInfo("authorityInfoAccess");if(void 0===t)return t;for(var e={ocsp:[],caissuer:[]},n=i(this.hex,t.vidx),r=0;r<n.length;r++){var o=s(this.hex,n[r],[0],"06"),a=s(this.hex,n[r],[1],"86");"2b06010505073001"===o&&e.ocsp.push(kt(a)),"2b06010505073002"===o&&e.caissuer.push(kt(a))}return e},this.getExtAuthorityInfoAccess=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("authorityInfoAccess");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var r={extname:"authorityInfoAccess",array:[]};e&&(r.critical=!0);for(var c=i(t,0),u=0;u<c.length;u++){var l=a(t,c[u],[0],"06"),h=kt(s(t,c[u],[1],"86"));if("2b06010505073001"==l)r.array.push({ocsp:h});else{if("2b06010505073002"!=l)throw new Error("unknown method: "+l);r.array.push({caissuer:h})}}return r},this.getExtCertificatePolicies=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("certificatePolicies");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var r={extname:"certificatePolicies",array:[]};e&&(r.critical=!0);for(var s=i(t,0),a=0;a<s.length;a++){var c=o(t,s[a]),u=this.getPolicyInformation(c);r.array.push(u)}return r},this.getPolicyInformation=function(t){var e={},n=s(t,0,[0],"06");e.policyoid=p(n);var r=h(t,0,[1],"30");if(-1!=r){e.array=[];for(var a=i(t,r),c=0;c<a.length;c++){var u=o(t,a[c]),l=this.getPolicyQualifierInfo(u);e.array.push(l)}}return e},this.getPolicyQualifierInfo=function(t){var e={},n=s(t,0,[0],"06");if("2b06010505070201"===n){var i=a(t,0,[1],"16");e.cps=Et(i)}else if("2b06010505070202"===n){var r=c(t,0,[1],"30");e.unotice=this.getUserNotice(r)}return e},this.getUserNotice=function(t){for(var e={},n=i(t,0),r=0;r<n.length;r++){var s=o(t,n[r]);"30"!=s.substr(0,2)&&(e.exptext=this.getDisplayText(s))}return e},this.getDisplayText=function(t){var e={};return e.type={"0c":"utf8",16:"ia5","1a":"vis","1e":"bmp"}[t.substr(0,2)],e.str=Et(r(t,0)),e},this.getExtCRLNumber=function(t,e){var n={extname:"cRLNumber"};if(e&&(n.critical=!0),"02"==t.substr(0,2))return n.num={hex:r(t,0)},n;throw new Error("hExtV parse error: "+t)},this.getExtCRLReason=function(t,e){var n={extname:"cRLReason"};if(e&&(n.critical=!0),"0a"==t.substr(0,2))return n.code=parseInt(r(t,0),16),n;throw new Error("hExtV parse error: "+t)},this.getExtOcspNonce=function(t,e){var n={extname:"ocspNonce"};e&&(n.critical=!0);var i=r(t,0);return n.hex=i,n},this.getExtOcspNoCheck=function(t,e){var n={extname:"ocspNoCheck"};return e&&(n.critical=!0),n},this.getExtAdobeTimeStamp=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("adobeTimeStamp");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var r={extname:"adobeTimeStamp"};e&&(r.critical=!0);var s=i(t,0);if(s.length>1){var a=o(t,s[1]),c=this.getGeneralName(a);null!=c.uri&&(r.uri=c.uri)}if(s.length>2){var u=o(t,s[2]);"0101ff"==u&&(r.reqauth=!0),"010100"==u&&(r.reqauth=!1)}return r},this.getX500NameRule=function(t){for(var e=null,n=[],i=0;i<t.length;i++)for(var r=t[i],o=0;o<r.length;o++)n.push(r[o]);for(i=0;i<n.length;i++){var s=n[i],a=s.ds,c=s.type;if("prn"!=a&&"utf8"!=a&&"ia5"!=a)return"mixed";if("ia5"==a){if("CN"!=c)return"mixed";if(ut.lang.String.isMail(s.value))continue;return"mixed"}if("C"==c){if("prn"==a)continue;return"mixed"}if(null==e)e=a;else if(e!==a)return"mixed"}return null==e?"prn":e},this.getX500Name=function(t){var e=this.getX500NameArray(t);return{array:e,str:this.dnarraytostr(e)}},this.getX500NameArray=function(t){for(var e=[],n=i(t,0),r=0;r<n.length;r++)e.push(this.getRDN(o(t,n[r])));return e},this.getRDN=function(t){for(var e=[],n=i(t,0),r=0;r<n.length;r++)e.push(this.getAttrTypeAndValue(o(t,n[r])));return e},this.getAttrTypeAndValue=function(t){var e={type:null,value:null,ds:null},n=i(t,0),r=s(t,n[0],[],"06"),o=s(t,n[1],[]),a=ut.asn1.ASN1Util.oidHexToInt(r);return e.type=ut.asn1.x509.OID.oid2atype(a),e.ds=this.HEX2STAG[t.substr(n[1],2)],e.value="bmp"!=e.ds?kt(o):Mt(o),e},this.readCertPEM=function(t){this.readCertHex(g(t))},this.readCertHex=function(t){this.hex=t,this.getVersion();try{l(this.hex,0,[0,7],"a3"),this.parseExt()}catch(t){}},this.getParam=function(){var t={};return t.version=this.getVersion(),t.serial={hex:this.getSerialNumberHex()},t.sigalg=this.getSignatureAlgorithmField(),t.issuer=this.getIssuer(),t.notbefore=this.getNotBefore(),t.notafter=this.getNotAfter(),t.subject=this.getSubject(),t.sbjpubkey=jt(this.getPublicKeyHex(),"PUBLIC KEY"),this.aExtInfo.length>0&&(t.ext=this.getExtParamArray()),t.sighex=this.getSignatureValueHex(),t},this.getExtParamArray=function(t){null==t&&-1!=h(this.hex,0,[0,"[3]"])&&(t=u(this.hex,0,[0,"[3]",0],"30"));for(var e=[],n=i(t,0),r=0;r<n.length;r++){var s=o(t,n[r]),a=this.getExtParam(s);null!=a&&e.push(a)}return e},this.getExtParam=function(t){var e=i(t,0).length;if(2!=e&&3!=e)throw new Error("wrong number elements in Extension: "+e+" "+t);var n=v(s(t,0,[0],"06")),r=!1;3==e&&"0101ff"==c(t,0,[1])&&(r=!0);var o=c(t,0,[e-1,0]),a=void 0;if("2.5.29.14"==n?a=this.getExtSubjectKeyIdentifier(o,r):"2.5.29.15"==n?a=this.getExtKeyUsage(o,r):"2.5.29.17"==n?a=this.getExtSubjectAltName(o,r):"2.5.29.18"==n?a=this.getExtIssuerAltName(o,r):"2.5.29.19"==n?a=this.getExtBasicConstraints(o,r):"2.5.29.31"==n?a=this.getExtCRLDistributionPoints(o,r):"2.5.29.32"==n?a=this.getExtCertificatePolicies(o,r):"2.5.29.35"==n?a=this.getExtAuthorityKeyIdentifier(o,r):"2.5.29.37"==n?a=this.getExtExtKeyUsage(o,r):"1.3.6.1.5.5.7.1.1"==n?a=this.getExtAuthorityInfoAccess(o,r):"2.5.29.20"==n?a=this.getExtCRLNumber(o,r):"2.5.29.21"==n?a=this.getExtCRLReason(o,r):"1.3.6.1.5.5.7.48.1.2"==n?a=this.getExtOcspNonce(o,r):"1.3.6.1.5.5.7.48.1.5"==n?a=this.getExtOcspNoCheck(o,r):"1.2.840.113583.1.1.9.1"==n&&(a=this.getExtAdobeTimeStamp(o,r)),null!=a)return a;var u={extname:n,extn:o};return r&&(u.critical=!0),u},this.findExt=function(t,e){for(var n=0;n<t.length;n++)if(t[n].extname==e)return t[n];return null},this.updateExtCDPFullURI=function(t,e){var n=this.findExt(t,"cRLDistributionPoints");if(null!=n&&null!=n.array)for(var i=n.array,r=0;r<i.length;r++)if(null!=i[r].dpname&&null!=i[r].dpname.full)for(var o=i[r].dpname.full,s=0;s<o.length;s++){var a=o[r];null!=a.uri&&(a.uri=e)}},this.updateExtAIAOCSP=function(t,e){var n=this.findExt(t,"authorityInfoAccess");if(null!=n&&null!=n.array)for(var i=n.array,r=0;r<i.length;r++)null!=i[r].ocsp&&(i[r].ocsp=e)},this.updateExtAIACAIssuer=function(t,e){var n=this.findExt(t,"authorityInfoAccess");if(null!=n&&null!=n.array)for(var i=n.array,r=0;r<i.length;r++)null!=i[r].caissuer&&(i[r].caissuer=e)},this.dnarraytostr=function(t){return"/"+t.map((function(t){return(e=t,e.map((function(t){return(e=t,e.type+"="+e.value).replace(/\+/,"\\+");var e})).join("+")).replace(/\//,"\\/");var e})).join("/")},this.getInfo=function(){var t,e,n,i,r=function(t){for(var e="",n=t.array,i=0;i<n.length;i++){var r=n[i];if(e+=" policy oid: "+r.policyoid+"\n",void 0!==r.array)for(var o=0;o<r.array.length;o++){var s=r.array[o];void 0!==s.cps&&(e+=" cps: "+s.cps+"\n")}}return e},o=function(t){for(var e="",n=t.array,i=0;i<n.length;i++){var r=n[i];try{void 0!==r.dpname.full[0].uri&&(e+=" "+r.dpname.full[0].uri+"\n")}catch(t){}try{void 0!==r.dname.full[0].dn.hex&&(e+=" "+qt.hex2dn(r.dpname.full[0].dn.hex)+"\n")}catch(t){}}return e},s=function(t){for(var e="",n=t.array,i=0;i<n.length;i++){var r=n[i];void 0!==r.caissuer&&(e+=" caissuer: "+r.caissuer+"\n"),void 0!==r.ocsp&&(e+=" ocsp: "+r.ocsp+"\n")}return e};if(t="Basic Fields\n",t+=" serial number: "+this.getSerialNumberHex()+"\n",t+=" signature algorithm: "+this.getSignatureAlgorithmField()+"\n",t+=" issuer: "+this.getIssuerString()+"\n",t+=" notBefore: "+this.getNotBefore()+"\n",t+=" notAfter: "+this.getNotAfter()+"\n",t+=" subject: "+this.getSubjectString()+"\n",t+=" subject public key info: \n",t+=" key algorithm: "+(e=this.getPublicKey()).type+"\n","RSA"===e.type&&(t+=" n="+Bt(e.n.toString(16)).substr(0,16)+"...\n",t+=" e="+Bt(e.e.toString(16))+"\n"),null!=(n=this.aExtInfo)){t+="X509v3 Extensions:\n";for(var a=0;a<n.length;a++){var c=n[a],u=ut.asn1.x509.OID.oid2name(c.oid);""===u&&(u=c.oid);var l="";if(!0===c.critical&&(l="CRITICAL"),t+=" "+u+" "+l+":\n","basicConstraints"===u){var h=this.getExtBasicConstraints();void 0===h.cA?t+=" {}\n":(t+=" cA=true",void 0!==h.pathLen&&(t+=", pathLen="+h.pathLen),t+="\n")}else if("keyUsage"===u)t+=" "+this.getExtKeyUsageString()+"\n";else if("subjectKeyIdentifier"===u)t+=" "+this.getExtSubjectKeyIdentifier().kid.hex+"\n";else if("authorityKeyIdentifier"===u){var d=this.getExtAuthorityKeyIdentifier();void 0!==d.kid&&(t+=" kid="+d.kid.hex+"\n")}else"extKeyUsage"===u?t+=" "+this.getExtExtKeyUsage().array.join(", ")+"\n":"subjectAltName"===u?t+=" "+(i=this.getExtSubjectAltName(),JSON.stringify(i.array).replace(/[\[\]\{\}\"]/g,"")+"\n"):"cRLDistributionPoints"===u?t+=o(this.getExtCRLDistributionPoints()):"authorityInfoAccess"===u?t+=s(this.getExtAuthorityInfoAccess()):"certificatePolicies"===u&&(t+=r(this.getExtCertificatePolicies()))}}return(t+="signature algorithm: "+this.getSignatureAlgorithmName()+"\n")+"signature: "+this.getSignatureValueHex().substr(0,16)+"...\n"},"string"==typeof t&&(-1!=t.indexOf("-----BEGIN")?this.readCertPEM(t):ut.lang.String.isHex(t)&&this.readCertHex(t))}Ht.getKey=function(t,e,n){var i,r=(m=dt).getChildIdx,o=m.getVbyList,s=ut.crypto,a=s.ECDSA,c=s.DSA,u=rt,l=Ct,h=Ht;if(void 0!==u&&t instanceof u)return t;if(void 0!==a&&t instanceof a)return t;if(void 0!==c&&t instanceof c)return t;if(void 0!==t.curve&&void 0!==t.xy&&void 0===t.d)return new a({pub:t.xy,curve:t.curve});if(void 0!==t.curve&&void 0!==t.d)return new a({prv:t.d,curve:t.curve});if(void 0===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0===t.d)return(C=new u).setPublic(t.n,t.e),C;if(void 0===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d&&void 0!==t.p&&void 0!==t.q&&void 0!==t.dp&&void 0!==t.dq&&void 0!==t.co&&void 0===t.qi)return(C=new u).setPrivateEx(t.n,t.e,t.d,t.p,t.q,t.dp,t.dq,t.co),C;if(void 0===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d&&void 0===t.p)return(C=new u).setPrivate(t.n,t.e,t.d),C;if(void 0!==t.p&&void 0!==t.q&&void 0!==t.g&&void 0!==t.y&&void 0===t.x)return(C=new c).setPublic(t.p,t.q,t.g,t.y),C;if(void 0!==t.p&&void 0!==t.q&&void 0!==t.g&&void 0!==t.y&&void 0!==t.x)return(C=new c).setPrivate(t.p,t.q,t.g,t.y,t.x),C;if("RSA"===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0===t.d)return(C=new u).setPublic(yt(t.n),yt(t.e)),C;if("RSA"===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d&&void 0!==t.p&&void 0!==t.q&&void 0!==t.dp&&void 0!==t.dq&&void 0!==t.qi)return(C=new u).setPrivateEx(yt(t.n),yt(t.e),yt(t.d),yt(t.p),yt(t.q),yt(t.dp),yt(t.dq),yt(t.qi)),C;if("RSA"===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d)return(C=new u).setPrivate(yt(t.n),yt(t.e),yt(t.d)),C;if("EC"===t.kty&&void 0!==t.crv&&void 0!==t.x&&void 0!==t.y&&void 0===t.d){var d=(j=new a({curve:t.crv})).ecparams.keylen/4,f="04"+("0000000000"+yt(t.x)).slice(-d)+("0000000000"+yt(t.y)).slice(-d);return j.setPublicKeyHex(f),j}if("EC"===t.kty&&void 0!==t.crv&&void 0!==t.x&&void 0!==t.y&&void 0!==t.d){d=(j=new a({curve:t.crv})).ecparams.keylen/4,f="04"+("0000000000"+yt(t.x)).slice(-d)+("0000000000"+yt(t.y)).slice(-d);var p=("0000000000"+yt(t.d)).slice(-d);return j.setPublicKeyHex(f),j.setPrivateKeyHex(p),j}if("pkcs5prv"===n){var v,g=t,m=dt;if(9===(v=r(g,0)).length)(C=new u).readPKCS5PrvKeyHex(g);else if(6===v.length)(C=new c).readPKCS5PrvKeyHex(g);else{if(!(v.length>2&&"04"===g.substr(v[1],2)))throw new Error("unsupported PKCS#1/5 hexadecimal key");(C=new a).readPKCS5PrvKeyHex(g)}return C}if("pkcs8prv"===n)return h.getKeyFromPlainPrivatePKCS8Hex(t);if("pkcs8pub"===n)return h._getKeyFromPublicPKCS8Hex(t);if("x509pub"===n)return qt.getPublicKeyFromCertHex(t);if(-1!=t.indexOf("-END CERTIFICATE-",0)||-1!=t.indexOf("-END X509 CERTIFICATE-",0)||-1!=t.indexOf("-END TRUSTED CERTIFICATE-",0))return qt.getPublicKeyFromCertPEM(t);if(-1!=t.indexOf("-END PUBLIC KEY-")){var w=Ct(t,"PUBLIC KEY");return h._getKeyFromPublicPKCS8Hex(w)}if(-1!=t.indexOf("-END RSA PRIVATE KEY-")&&-1==t.indexOf("4,ENCRYPTED")){var b=l(t,"RSA PRIVATE KEY");return h.getKey(b,null,"pkcs5prv")}if(-1!=t.indexOf("-END DSA PRIVATE KEY-")&&-1==t.indexOf("4,ENCRYPTED")){var y=o(i=l(t,"DSA PRIVATE KEY"),0,[1],"02"),x=o(i,0,[2],"02"),k=o(i,0,[3],"02"),E=o(i,0,[4],"02"),F=o(i,0,[5],"02");return(C=new c).setPrivate(new S(y,16),new S(x,16),new S(k,16),new S(E,16),new S(F,16)),C}if(-1!=t.indexOf("-END EC PRIVATE KEY-")&&-1==t.indexOf("4,ENCRYPTED"))return b=l(t,"EC PRIVATE KEY"),h.getKey(b,null,"pkcs5prv");if(-1!=t.indexOf("-END PRIVATE KEY-"))return h.getKeyFromPlainPrivatePKCS8PEM(t);if(-1!=t.indexOf("-END RSA PRIVATE KEY-")&&-1!=t.indexOf("4,ENCRYPTED")){var A=h.getDecryptedKeyHex(t,e),_=new rt;return _.readPKCS5PrvKeyHex(A),_}if(-1!=t.indexOf("-END EC PRIVATE KEY-")&&-1!=t.indexOf("4,ENCRYPTED")){var j,C=o(i=h.getDecryptedKeyHex(t,e),0,[1],"04"),R=o(i,0,[2,0],"06"),I=o(i,0,[3,0],"03").substr(2);if(void 0===ut.crypto.OID.oidhex2name[R])throw new Error("undefined OID(hex) in KJUR.crypto.OID: "+R);return(j=new a({curve:ut.crypto.OID.oidhex2name[R]})).setPublicKeyHex(I),j.setPrivateKeyHex(C),j.isPublic=!1,j}if(-1!=t.indexOf("-END DSA PRIVATE KEY-")&&-1!=t.indexOf("4,ENCRYPTED"))return y=o(i=h.getDecryptedKeyHex(t,e),0,[1],"02"),x=o(i,0,[2],"02"),k=o(i,0,[3],"02"),E=o(i,0,[4],"02"),F=o(i,0,[5],"02"),(C=new c).setPrivate(new S(y,16),new S(x,16),new S(k,16),new S(E,16),new S(F,16)),C;if(-1!=t.indexOf("-END ENCRYPTED PRIVATE KEY-"))return h.getKeyFromEncryptedPKCS8PEM(t,e);throw new Error("not supported argument")},Ht.generateKeypair=function(t,e){if("RSA"==t){var n=e;(s=new rt).generate(n,"10001"),s.isPrivate=!0,s.isPublic=!0;var i=new rt,r=s.n.toString(16),o=s.e.toString(16);return i.setPublic(r,o),i.isPrivate=!1,i.isPublic=!0,(a={}).prvKeyObj=s,a.pubKeyObj=i,a}if("EC"==t){var s,a,c=e,u=new ut.crypto.ECDSA({curve:c}).generateKeyPairHex();return(s=new ut.crypto.ECDSA({curve:c})).setPublicKeyHex(u.ecpubhex),s.setPrivateKeyHex(u.ecprvhex),s.isPrivate=!0,s.isPublic=!1,(i=new ut.crypto.ECDSA({curve:c})).setPublicKeyHex(u.ecpubhex),i.isPrivate=!1,i.isPublic=!0,(a={}).prvKeyObj=s,a.pubKeyObj=i,a}throw new Error("unknown algorithm: "+t)},Ht.getPEM=function(t,e,n,i,r,o){var s=ut.asn1,a=s.DERObjectIdentifier,c=s.DERInteger,u=s.ASN1Util.newObject,l=ut.crypto,h=l.DSA,d=l.ECDSA,f=rt;function p(t){return u({seq:[{int:0},{int:{bigint:t.n}},{int:t.e},{int:{bigint:t.d}},{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.dmp1}},{int:{bigint:t.dmq1}},{int:{bigint:t.coeff}}]})}function v(t){return u({seq:[{int:1},{octstr:{hex:t.prvKeyHex}},{tag:["a0",!0,{oid:{name:t.curveName}}]},{tag:["a1",!0,{bitstr:{hex:"00"+t.pubKeyHex}}]}]})}function g(t){return u({seq:[{int:0},{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.g}},{int:{bigint:t.y}},{int:{bigint:t.x}}]})}if((void 0!==f&&t instanceof f||void 0!==h&&t instanceof h||void 0!==d&&t instanceof d)&&1==t.isPublic&&(void 0===e||"PKCS8PUB"==e))return jt(x=new(0,s.x509.SubjectPublicKeyInfo)(t).getEncodedHex(),"PUBLIC KEY");if("PKCS1PRV"==e&&void 0!==f&&t instanceof f&&(void 0===n||null==n)&&1==t.isPrivate)return jt(x=p(t).getEncodedHex(),"RSA PRIVATE KEY");if("PKCS1PRV"==e&&void 0!==d&&t instanceof d&&(void 0===n||null==n)&&1==t.isPrivate){var m=new a({name:t.curveName}).getEncodedHex(),w=v(t).getEncodedHex(),y="";return(y+=jt(m,"EC PARAMETERS"))+jt(w,"EC PRIVATE KEY")}if("PKCS1PRV"==e&&void 0!==h&&t instanceof h&&(void 0===n||null==n)&&1==t.isPrivate)return jt(x=g(t).getEncodedHex(),"DSA PRIVATE KEY");if("PKCS5PRV"==e&&void 0!==f&&t instanceof f&&void 0!==n&&null!=n&&1==t.isPrivate){var x=p(t).getEncodedHex();return void 0===i&&(i="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",x,n,i,o)}if("PKCS5PRV"==e&&void 0!==d&&t instanceof d&&void 0!==n&&null!=n&&1==t.isPrivate)return x=v(t).getEncodedHex(),void 0===i&&(i="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("EC",x,n,i,o);if("PKCS5PRV"==e&&void 0!==h&&t instanceof h&&void 0!==n&&null!=n&&1==t.isPrivate)return x=g(t).getEncodedHex(),void 0===i&&(i="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA",x,n,i,o);var k=function(t,e){var n=E(t,e);return new u({seq:[{seq:[{oid:{name:"pkcs5PBES2"}},{seq:[{seq:[{oid:{name:"pkcs5PBKDF2"}},{seq:[{octstr:{hex:n.pbkdf2Salt}},{int:n.pbkdf2Iter}]}]},{seq:[{oid:{name:"des-EDE3-CBC"}},{octstr:{hex:n.encryptionSchemeIV}}]}]}]},{octstr:{hex:n.ciphertext}}]}).getEncodedHex()},E=function(t,e){var n=b.lib.WordArray.random(8),i=b.lib.WordArray.random(8),r=b.PBKDF2(e,n,{keySize:6,iterations:100}),o=b.enc.Hex.parse(t),s=b.TripleDES.encrypt(o,r,{iv:i})+"",a={};return a.ciphertext=s,a.pbkdf2Salt=b.enc.Hex.stringify(n),a.pbkdf2Iter=100,a.encryptionSchemeAlg="DES-EDE3-CBC",a.encryptionSchemeIV=b.enc.Hex.stringify(i),a};if("PKCS8PRV"==e&&null!=f&&t instanceof f&&1==t.isPrivate){var S=p(t).getEncodedHex();return x=u({seq:[{int:0},{seq:[{oid:{name:"rsaEncryption"}},{null:!0}]},{octstr:{hex:S}}]}).getEncodedHex(),void 0===n||null==n?jt(x,"PRIVATE KEY"):jt(w=k(x,n),"ENCRYPTED PRIVATE KEY")}if("PKCS8PRV"==e&&void 0!==d&&t instanceof d&&1==t.isPrivate)return S=new u({seq:[{int:1},{octstr:{hex:t.prvKeyHex}},{tag:["a1",!0,{bitstr:{hex:"00"+t.pubKeyHex}}]}]}).getEncodedHex(),x=u({seq:[{int:0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:t.curveName}}]},{octstr:{hex:S}}]}).getEncodedHex(),void 0===n||null==n?jt(x,"PRIVATE KEY"):jt(w=k(x,n),"ENCRYPTED PRIVATE KEY");if("PKCS8PRV"==e&&void 0!==h&&t instanceof h&&1==t.isPrivate)return S=new c({bigint:t.x}).getEncodedHex(),x=u({seq:[{int:0},{seq:[{oid:{name:"dsa"}},{seq:[{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.g}}]}]},{octstr:{hex:S}}]}).getEncodedHex(),void 0===n||null==n?jt(x,"PRIVATE KEY"):jt(w=k(x,n),"ENCRYPTED PRIVATE KEY");throw new Error("unsupported object nor format")},Ht.getKeyFromCSRPEM=function(t){var e=Ct(t,"CERTIFICATE REQUEST");return Ht.getKeyFromCSRHex(e)},Ht.getKeyFromCSRHex=function(t){var e=Ht.parseCSRHex(t);return Ht.getKey(e.p8pubkeyhex,null,"pkcs8pub")},Ht.parseCSRHex=function(t){var e=dt.getChildIdx,n=dt.getTLV,i={},r=t;if("30"!=r.substr(0,2))throw new Error("malformed CSR(code:001)");var o=e(r,0);if(o.length<1)throw new Error("malformed CSR(code:002)");if("30"!=r.substr(o[0],2))throw new Error("malformed CSR(code:003)");var s=e(r,o[0]);if(s.length<3)throw new Error("malformed CSR(code:004)");return i.p8pubkeyhex=n(r,s[2]),i},Ht.getKeyID=function(t){var e=Ht,n=dt;"string"==typeof t&&-1!=t.indexOf("BEGIN ")&&(t=e.getKey(t));var i=Ct(e.getPEM(t)),r=n.getIdxbyList(i,0,[1]),o=n.getV(i,r).substring(2);return ut.crypto.Util.hashHex(o,"sha1")},Ht.getJWKFromKey=function(t){var e={};if(t instanceof rt&&t.isPrivate)return e.kty="RSA",e.n=bt(t.n.toString(16)),e.e=bt(t.e.toString(16)),e.d=bt(t.d.toString(16)),e.p=bt(t.p.toString(16)),e.q=bt(t.q.toString(16)),e.dp=bt(t.dmp1.toString(16)),e.dq=bt(t.dmq1.toString(16)),e.qi=bt(t.coeff.toString(16)),e;if(t instanceof rt&&t.isPublic)return e.kty="RSA",e.n=bt(t.n.toString(16)),e.e=bt(t.e.toString(16)),e;if(t instanceof ut.crypto.ECDSA&&t.isPrivate){if("P-256"!==(i=t.getShortNISTPCurveName())&&"P-384"!==i)throw new Error("unsupported curve name for JWT: "+i);var n=t.getPublicKeyXYHex();return e.kty="EC",e.crv=i,e.x=bt(n.x),e.y=bt(n.y),e.d=bt(t.prvKeyHex),e}if(t instanceof ut.crypto.ECDSA&&t.isPublic){var i;if("P-256"!==(i=t.getShortNISTPCurveName())&&"P-384"!==i)throw new Error("unsupported curve name for JWT: "+i);return n=t.getPublicKeyXYHex(),e.kty="EC",e.crv=i,e.x=bt(n.x),e.y=bt(n.y),e}throw new Error("not supported key object")},rt.getPosArrayOfChildrenFromHex=function(t){return dt.getChildIdx(t,0)},rt.getHexValueArrayOfChildrenFromHex=function(t){var e,n=dt.getV,i=n(t,(e=rt.getPosArrayOfChildrenFromHex(t))[0]),r=n(t,e[1]),o=n(t,e[2]),s=n(t,e[3]),a=n(t,e[4]),c=n(t,e[5]),u=n(t,e[6]),l=n(t,e[7]),h=n(t,e[8]);return(e=new Array).push(i,r,o,s,a,c,u,l,h),e},rt.prototype.readPrivateKeyFromPEMString=function(t){var e=Ct(t),n=rt.getHexValueArrayOfChildrenFromHex(e);this.setPrivateEx(n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8])},rt.prototype.readPKCS5PrvKeyHex=function(t){var e=rt.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},rt.prototype.readPKCS8PrvKeyHex=function(t){var e,n,i,r,o,s,a,c,u=dt.getVbyListEx;if(!1===dt.isASN1HEX(t))throw new Error("not ASN.1 hex string");try{e=u(t,0,[2,0,1],"02"),n=u(t,0,[2,0,2],"02"),i=u(t,0,[2,0,3],"02"),r=u(t,0,[2,0,4],"02"),o=u(t,0,[2,0,5],"02"),s=u(t,0,[2,0,6],"02"),a=u(t,0,[2,0,7],"02"),c=u(t,0,[2,0,8],"02")}catch(t){throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(e,n,i,r,o,s,a,c)},rt.prototype.readPKCS5PubKeyHex=function(t){var e=dt,n=e.getV;if(!1===e.isASN1HEX(t))throw new Error("keyHex is not ASN.1 hex string");var i=e.getChildIdx(t,0);if(2!==i.length||"02"!==t.substr(i[0],2)||"02"!==t.substr(i[1],2))throw new Error("wrong hex for PKCS#5 public key");var r=n(t,i[0]),o=n(t,i[1]);this.setPublic(r,o)},rt.prototype.readPKCS8PubKeyHex=function(t){var e=dt;if(!1===e.isASN1HEX(t))throw new Error("not ASN.1 hex string");if("06092a864886f70d010101"!==e.getTLVbyListEx(t,0,[0,0]))throw new Error("not PKCS8 RSA public key");var n=e.getTLVbyListEx(t,0,[1,0]);this.readPKCS5PubKeyHex(n)},rt.prototype.readCertPubKeyHex=function(t){var e,n;(e=new qt).readCertHex(t),n=e.getPublicKeyHex(),this.readPKCS8PubKeyHex(n)},rt.prototype.sign=function(t,e){var n=ut.crypto.Util.hashString(t,e);return this.signWithMessageHash(n,e)},rt.prototype.signWithMessageHash=function(t,e){var n=nt(ut.crypto.Util.getPaddedDigestInfoHex(t,e,this.n.bitLength()),16);return zt(this.doPrivate(n).toString(16),this.n.bitLength())},rt.prototype.signPSS=function(t,e,n){var i,r=(i=St(t),ut.crypto.Util.hashHex(i,e));return void 0===n&&(n=-1),this.signWithMessageHashPSS(r,e,n)},rt.prototype.signWithMessageHashPSS=function(t,e,n){var i,r=Et(t),o=r.length,s=this.n.bitLength()-1,a=Math.ceil(s/8),c=function(t){return ut.crypto.Util.hashHex(t,e)};if(-1===n||void 0===n)n=o;else if(-2===n)n=a-o-2;else if(n<-2)throw new Error("invalid salt length");if(a<o+n+2)throw new Error("data too long");var u="";n>0&&(u=new Array(n),(new et).nextBytes(u),u=String.fromCharCode.apply(String,u));var l=Et(c(St("\0\0\0\0\0\0\0\0"+r+u))),h=[];for(i=0;i<a-n-o-2;i+=1)h[i]=0;var d=String.fromCharCode.apply(String,h)+""+u,f=Kt(l,d.length,c),p=[];for(i=0;i<d.length;i+=1)p[i]=d.charCodeAt(i)^f.charCodeAt(i);for(p[0]&=~(65280>>8*a-s&255),i=0;i<o;i++)p.push(l.charCodeAt(i));return p.push(188),zt(this.doPrivate(new S(p)).toString(16),this.n.bitLength())},rt.prototype.verify=function(t,e){if(null==(e=e.toLowerCase()).match(/^[0-9a-f]+$/))return!1;var n=nt(e,16),i=this.n.bitLength();if(n.bitLength()>i)return!1;var r=this.doPublic(n).toString(16);if(r.length+3!=i/4)return!1;var o=Wt(r.replace(/^1f+00/,""));return 0!=o.length&&o[1]==ut.crypto.Util.hashString(t,o[0])},rt.prototype.verifyWithMessageHash=function(t,e){if(e.length!=Math.ceil(this.n.bitLength()/4))return!1;var n=nt(e,16);if(n.bitLength()>this.n.bitLength())return 0;var i=Wt(this.doPublic(n).toString(16).replace(/^1f+00/,""));return 0!=i.length&&i[1]==t},rt.prototype.verifyPSS=function(t,e,n,i){var r,o=(r=St(t),ut.crypto.Util.hashHex(r,n));return void 0===i&&(i=-1),this.verifyWithMessageHashPSS(o,e,n,i)},rt.prototype.verifyWithMessageHashPSS=function(t,e,n,i){if(e.length!=Math.ceil(this.n.bitLength()/4))return!1;var r,o=new S(e,16),s=function(t){return ut.crypto.Util.hashHex(t,n)},a=Et(t),c=a.length,u=this.n.bitLength()-1,l=Math.ceil(u/8);if(-1===i||void 0===i)i=c;else if(-2===i)i=l-c-2;else if(i<-2)throw new Error("invalid salt length");if(l<c+i+2)throw new Error("data too long");var h=this.doPublic(o).toByteArray();for(r=0;r<h.length;r+=1)h[r]&=255;for(;h.length<l;)h.unshift(0);if(188!==h[l-1])throw new Error("encoded message does not end in 0xbc");var d=(h=String.fromCharCode.apply(String,h)).substr(0,l-c-1),f=h.substr(d.length,c),p=65280>>8*l-u&255;if(0!=(d.charCodeAt(0)&p))throw new Error("bits beyond keysize not zero");var v=Kt(f,d.length,s),g=[];for(r=0;r<d.length;r+=1)g[r]=d.charCodeAt(r)^v.charCodeAt(r);g[0]&=~p;var m=l-c-i-2;for(r=0;r<m;r+=1)if(0!==g[r])throw new Error("leftmost octets not zero");if(1!==g[m])throw new Error("0x01 marker not found");return f===Et(s(St("\0\0\0\0\0\0\0\0"+a+String.fromCharCode.apply(String,g.slice(-i)))))},rt.SALT_LEN_HLEN=-1,rt.SALT_LEN_MAX=-2,rt.SALT_LEN_RECOVER=-2,qt.hex2dn=function(t,e){void 0===e&&(e=0);var n=new qt;return dt.getTLV(t,e),n.getX500Name(t).str},qt.hex2rdn=function(t,e){if(void 0===e&&(e=0),"31"!==t.substr(e,2))throw new Error("malformed RDN");for(var n=new Array,i=dt.getChildIdx(t,e),r=0;r<i.length;r++)n.push(qt.hex2attrTypeValue(t,i[r]));return(n=n.map((function(t){return t.replace("+","\\+")}))).join("+")},qt.hex2attrTypeValue=function(t,e){var n=dt,i=n.getV;if(void 0===e&&(e=0),"30"!==t.substr(e,2))throw new Error("malformed attribute type and value");var r=n.getChildIdx(t,e);2!==r.length||t.substr(r[0],2);var o=i(t,r[0]),s=ut.asn1.ASN1Util.oidHexToInt(o);return ut.asn1.x509.OID.oid2atype(s)+"="+Et(i(t,r[1]))},qt.getPublicKeyFromCertHex=function(t){var e=new qt;return e.readCertHex(t),e.getPublicKey()},qt.getPublicKeyFromCertPEM=function(t){var e=new qt;return e.readCertPEM(t),e.getPublicKey()},qt.getPublicKeyInfoPropOfCertPEM=function(t){var e,n,i=dt.getVbyList,r={algparam:null};return(e=new qt).readCertPEM(t),n=e.getPublicKeyHex(),r.keyhex=i(n,0,[1],"03").substr(2),r.algoid=i(n,0,[0,0],"06"),"2a8648ce3d0201"===r.algoid&&(r.algparam=i(n,0,[0,1],"06")),r},qt.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"],void 0!==ut&&ut||(e.KJUR=ut={}),void 0!==ut.jws&&ut.jws||(ut.jws={}),ut.jws.JWS=function(){var t=ut.jws.JWS.isSafeJSONString;this.parseJWS=function(e,n){if(void 0===this.parsedJWS||!n&&void 0===this.parsedJWS.sigvalH){var i=e.match(/^([^.]+)\.([^.]+)\.([^.]+)$/);if(null==i)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";var r=i[1],o=i[2],s=i[3],a=r+"."+o;if(this.parsedJWS={},this.parsedJWS.headB64U=r,this.parsedJWS.payloadB64U=o,this.parsedJWS.sigvalB64U=s,this.parsedJWS.si=a,!n){var c=yt(s),u=nt(c,16);this.parsedJWS.sigvalH=c,this.parsedJWS.sigvalBI=u}var l=ht(r),h=ht(o);if(this.parsedJWS.headS=l,this.parsedJWS.payloadS=h,!t(l,this.parsedJWS,"headP"))throw"malformed JSON string for JWS Head: "+l}}},ut.jws.JWS.sign=function(t,e,n,i,r){var o,s,a,c=ut.jws.JWS,u=c.readSafeJSONString,l=c.isSafeJSONString,h=ut.crypto,d=h.Mac,f=h.Signature,p=JSON;if("string"!=typeof e&&"object"!=(void 0===e?"undefined":m(e)))throw"spHeader must be JSON string or object: "+e;if("object"==(void 0===e?"undefined":m(e))&&(o=p.stringify(s=e)),"string"==typeof e){if(!l(o=e))throw"JWS Head is not safe JSON string: "+o;s=u(o)}if(a=n,"object"==(void 0===n?"undefined":m(n))&&(a=p.stringify(n)),""!=t&&null!=t||void 0===s.alg||(t=s.alg),""!=t&&null!=t&&void 0===s.alg&&(s.alg=t,o=p.stringify(s)),t!==s.alg)throw"alg and sHeader.alg doesn't match: "+t+"!="+s.alg;var v=null;if(void 0===c.jwsalg2sigalg[t])throw"unsupported alg name: "+t;v=c.jwsalg2sigalg[t];var g=lt(o)+"."+lt(a),w="";if("Hmac"==v.substr(0,4)){if(void 0===i)throw"mac key shall be specified for HS* alg";var b=new d({alg:v,prov:"cryptojs",pass:i});b.updateString(g),w=b.doFinal()}else if(-1!=v.indexOf("withECDSA")){(x=new f({alg:v})).init(i,r),x.updateString(g);var y=x.sign();w=ut.crypto.ECDSA.asn1SigToConcatSig(y)}else{var x;"none"!=v&&((x=new f({alg:v})).init(i,r),x.updateString(g),w=x.sign())}return g+"."+bt(w)},ut.jws.JWS.verify=function(t,e,n){var i,r=ut.jws.JWS,o=r.readSafeJSONString,s=ut.crypto,a=s.ECDSA,c=s.Mac,u=s.Signature;void 0!==m(rt)&&(i=rt);var l=t.split(".");if(3!==l.length)return!1;var h,d=l[0]+"."+l[1],f=yt(l[2]),p=o(ht(l[0])),v=null;if(void 0===p.alg)throw"algorithm not specified in header";if(h=(v=p.alg).substr(0,2),null!=n&&"[object Array]"===Object.prototype.toString.call(n)&&n.length>0&&-1==(":"+n.join(":")+":").indexOf(":"+v+":"))throw"algorithm '"+v+"' not accepted in the list";if("none"!=v&&null===e)throw"key shall be specified to verify.";if("string"==typeof e&&-1!=e.indexOf("-----BEGIN ")&&(e=Ht.getKey(e)),!("RS"!=h&&"PS"!=h||e instanceof i))throw"key shall be a RSAKey obj for RS* and PS* algs";if("ES"==h&&!(e instanceof a))throw"key shall be a ECDSA obj for ES* algs";var g=null;if(void 0===r.jwsalg2sigalg[p.alg])throw"unsupported alg name: "+v;if("none"==(g=r.jwsalg2sigalg[v]))throw"not supported";if("Hmac"==g.substr(0,4)){if(void 0===e)throw"hexadecimal key shall be specified for HMAC";var w=new c({alg:g,pass:e});return w.updateString(d),f==w.doFinal()}if(-1!=g.indexOf("withECDSA")){var b,y=null;try{y=a.concatSigToASN1Sig(f)}catch(t){return!1}return(b=new u({alg:g})).init(e),b.updateString(d),b.verify(y)}return(b=new u({alg:g})).init(e),b.updateString(d),b.verify(f)},ut.jws.JWS.parse=function(t){var e,n,i=t.split("."),r={};if(2!=i.length&&3!=i.length)throw"malformed sJWS: wrong number of '.' splitted elements";return e=i[1],3==i.length&&(n=i[2]),r.headerObj=ut.jws.JWS.readSafeJSONString(ht(i[0])),r.payloadObj=ut.jws.JWS.readSafeJSONString(ht(e)),r.headerPP=JSON.stringify(r.headerObj,null," "),r.payloadPP=null==r.payloadObj?ht(e):JSON.stringify(r.payloadObj,null," "),void 0!==n&&(r.sigHex=yt(n)),r},ut.jws.JWS.verifyJWT=function(t,e,n){var i=ut.jws,r=i.JWS,o=r.readSafeJSONString,s=r.inArray,a=r.includedArray,c=t.split("."),u=c[0],l=c[1],h=(yt(c[2]),o(ht(u))),d=o(ht(l));if(void 0===h.alg)return!1;if(void 0===n.alg)throw"acceptField.alg shall be specified";if(!s(h.alg,n.alg))return!1;if(void 0!==d.iss&&"object"===m(n.iss)&&!s(d.iss,n.iss))return!1;if(void 0!==d.sub&&"object"===m(n.sub)&&!s(d.sub,n.sub))return!1;if(void 0!==d.aud&&"object"===m(n.aud))if("string"==typeof d.aud){if(!s(d.aud,n.aud))return!1}else if("object"==m(d.aud)&&!a(d.aud,n.aud))return!1;var f=i.IntDate.getNow();return void 0!==n.verifyAt&&"number"==typeof n.verifyAt&&(f=n.verifyAt),void 0!==n.gracePeriod&&"number"==typeof n.gracePeriod||(n.gracePeriod=0),!(void 0!==d.exp&&"number"==typeof d.exp&&d.exp+n.gracePeriod<f||void 0!==d.nbf&&"number"==typeof d.nbf&&f<d.nbf-n.gracePeriod||void 0!==d.iat&&"number"==typeof d.iat&&f<d.iat-n.gracePeriod||void 0!==d.jti&&void 0!==n.jti&&d.jti!==n.jti||!r.verify(t,e,n.alg))},ut.jws.JWS.includedArray=function(t,e){var n=ut.jws.JWS.inArray;if(null===t)return!1;if("object"!==(void 0===t?"undefined":m(t)))return!1;if("number"!=typeof t.length)return!1;for(var i=0;i<t.length;i++)if(!n(t[i],e))return!1;return!0},ut.jws.JWS.inArray=function(t,e){if(null===e)return!1;if("object"!==(void 0===e?"undefined":m(e)))return!1;if("number"!=typeof e.length)return!1;for(var n=0;n<e.length;n++)if(e[n]==t)return!0;return!1},ut.jws.JWS.jwsalg2sigalg={HS256:"HmacSHA256",HS384:"HmacSHA384",HS512:"HmacSHA512",RS256:"SHA256withRSA",RS384:"SHA384withRSA",RS512:"SHA512withRSA",ES256:"SHA256withECDSA",ES384:"SHA384withECDSA",PS256:"SHA256withRSAandMGF1",PS384:"SHA384withRSAandMGF1",PS512:"SHA512withRSAandMGF1",none:"none"},ut.jws.JWS.isSafeJSONString=function(t,e,n){var i=null;try{return"object"!=(void 0===(i=ct(t))?"undefined":m(i))||i.constructor===Array?0:(e&&(e[n]=i),1)}catch(t){return 0}},ut.jws.JWS.readSafeJSONString=function(t){var e=null;try{return"object"!=(void 0===(e=ct(t))?"undefined":m(e))||e.constructor===Array?null:e}catch(t){return null}},ut.jws.JWS.getEncodedSignatureValueFromJWS=function(t){var e=t.match(/^[^.]+\.[^.]+\.([^.]+)$/);if(null==e)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";return e[1]},ut.jws.JWS.getJWKthumbprint=function(t){if("RSA"!==t.kty&&"EC"!==t.kty&&"oct"!==t.kty)throw"unsupported algorithm for JWK Thumprint";var e="{";if("RSA"===t.kty){if("string"!=typeof t.n||"string"!=typeof t.e)throw"wrong n and e value for RSA key";e+='"e":"'+t.e+'",',e+='"kty":"'+t.kty+'",',e+='"n":"'+t.n+'"}'}else if("EC"===t.kty){if("string"!=typeof t.crv||"string"!=typeof t.x||"string"!=typeof t.y)throw"wrong crv, x and y value for EC key";e+='"crv":"'+t.crv+'",',e+='"kty":"'+t.kty+'",',e+='"x":"'+t.x+'",',e+='"y":"'+t.y+'"}'}else if("oct"===t.kty){if("string"!=typeof t.k)throw"wrong k value for oct(symmetric) key";e+='"kty":"'+t.kty+'",',e+='"k":"'+t.k+'"}'}var n=St(e);return bt(ut.crypto.Util.hashHex(n,"sha256"))},ut.jws.IntDate={},ut.jws.IntDate.get=function(t){var e=ut.jws.IntDate,n=e.getNow,i=e.getZulu;if("now"==t)return n();if("now + 1hour"==t)return n()+3600;if("now + 1day"==t)return n()+86400;if("now + 1month"==t)return n()+2592e3;if("now + 1year"==t)return n()+31536e3;if(t.match(/Z$/))return i(t);if(t.match(/^[0-9]+$/))return parseInt(t);throw"unsupported format: "+t},ut.jws.IntDate.getZulu=function(t){return It(t)},ut.jws.IntDate.getNow=function(){return~~(new Date/1e3)},ut.jws.IntDate.intDate2UTCString=function(t){return new Date(1e3*t).toUTCString()},ut.jws.IntDate.intDate2Zulu=function(t){var e=new Date(1e3*t);return("0000"+e.getUTCFullYear()).slice(-4)+("00"+(e.getUTCMonth()+1)).slice(-2)+("00"+e.getUTCDate()).slice(-2)+("00"+e.getUTCHours()).slice(-2)+("00"+e.getUTCMinutes()).slice(-2)+("00"+e.getUTCSeconds()).slice(-2)+"Z"},e.SecureRandom=et,e.rng_seed_time=X,e.BigInteger=S,e.RSAKey=rt,e.EDSA=ut.crypto.EDSA,e.DSA=ut.crypto.DSA,e.Signature=ut.crypto.Signature,e.MessageDigest=ut.crypto.MessageDigest,e.Mac=ut.crypto.Mac,e.Cipher=ut.crypto.Cipher,e.KEYUTIL=Ht,e.ASN1HEX=dt,e.X509=qt,e.CryptoJS=b,e.b64tohex=k,e.b64toBA=E,e.stoBA=ft,e.BAtos=pt,e.BAtohex=vt,e.stohex=gt,e.stob64=function(t){return x(gt(t))},e.stob64u=function(t){return mt(x(gt(t)))},e.b64utos=function(t){return pt(E(wt(t)))},e.b64tob64u=mt,e.b64utob64=wt,e.hex2b64=x,e.hextob64u=bt,e.b64utohex=yt,e.utf8tob64u=lt,e.b64utoutf8=ht,e.utf8tob64=function(t){return x(Tt(Ut(t)))},e.b64toutf8=function(t){return decodeURIComponent(Ot(k(t)))},e.utf8tohex=xt,e.hextoutf8=kt,e.hextorstr=Et,e.rstrtohex=St,e.hextob64=Ft,e.hextob64nl=At,e.b64nltohex=_t,e.hextopem=jt,e.pemtohex=Ct,e.hextoArrayBuffer=function(t){if(t.length%2!=0)throw"input is not even length";if(null==t.match(/^[0-9A-Fa-f]+$/))throw"input is not hexadecimal";for(var e=new ArrayBuffer(t.length/2),n=new DataView(e),i=0;i<t.length/2;i++)n.setUint8(i,parseInt(t.substr(2*i,2),16));return e},e.ArrayBuffertohex=function(t){for(var e="",n=new DataView(t),i=0;i<t.byteLength;i++)e+=("00"+n.getUint8(i).toString(16)).slice(-2);return e},e.zulutomsec=Rt,e.zulutosec=It,e.zulutodate=function(t){return new Date(Rt(t))},e.datetozulu=function(t,e,n){var i,r=t.getUTCFullYear();if(e){if(r<1950||2049<r)throw"not proper year for UTCTime: "+r;i=(""+r).slice(-2)}else i=("000"+r).slice(-4);if(i+=("0"+(t.getUTCMonth()+1)).slice(-2),i+=("0"+t.getUTCDate()).slice(-2),i+=("0"+t.getUTCHours()).slice(-2),i+=("0"+t.getUTCMinutes()).slice(-2),i+=("0"+t.getUTCSeconds()).slice(-2),n){var o=t.getUTCMilliseconds();0!==o&&(i+="."+(o=(o=("00"+o).slice(-3)).replace(/0+$/g,"")))}return i+"Z"},e.uricmptohex=Tt,e.hextouricmp=Ot,e.ipv6tohex=Nt,e.hextoipv6=Pt,e.hextoip=Dt,e.iptohex=function(t){var e="malformed IP address";if(!(t=t.toLowerCase(t)).match(/^[0-9.]+$/)){if(t.match(/^[0-9a-f:]+$/)&&-1!==t.indexOf(":"))return Nt(t);throw e}var n=t.split(".");if(4!==n.length)throw e;var i="";try{for(var r=0;r<4;r++)i+=("0"+parseInt(n[r]).toString(16)).slice(-2);return i}catch(t){throw e}},e.encodeURIComponentAll=Ut,e.newline_toUnix=function(t){return t.replace(/\r\n/gm,"\n")},e.newline_toDos=function(t){return(t=t.replace(/\r\n/gm,"\n")).replace(/\n/gm,"\r\n")},e.hextoposhex=Bt,e.intarystrtohex=function(t){t=(t=(t=t.replace(/^\s*\[\s*/,"")).replace(/\s*\]\s*$/,"")).replace(/\s*/g,"");try{return t.split(/,/).map((function(t){var e=parseInt(t);if(e<0||255<e)throw"integer not in range 0-255";return("00"+e.toString(16)).slice(-2)})).join("")}catch(t){throw"malformed integer array string: "+t}},e.strdiffidx=function(t,e){var n=t.length;t.length>e.length&&(n=e.length);for(var i=0;i<n;i++)if(t.charCodeAt(i)!=e.charCodeAt(i))return i;return t.length!=e.length?n:-1},e.KJUR=ut,e.crypto=ut.crypto,e.asn1=ut.asn1,e.jws=ut.jws,e.lang=ut.lang}).call(this,n(28).Buffer)},function(t,e,n){(function(t){var i=n(30),r=n(31),o=n(32);function s(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=c.prototype:(null===t&&(t=new c(e)),t.length=e),t}function c(t,e,n){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return h(this,t)}return u(this,t,e,n)}function u(t,e,n,i){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,i){if(n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(i||0))throw new RangeError("'length' is out of bounds");return e=void 0===n&&void 0===i?new Uint8Array(e):void 0===i?new Uint8Array(e,n):new Uint8Array(e,n,i),c.TYPED_ARRAY_SUPPORT?(t=e).__proto__=c.prototype:t=d(t,e),t}(t,e,n,i):"string"==typeof e?function(t,e,n){if("string"==typeof n&&""!==n||(n="utf8"),!c.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var i=0|p(e,n),r=(t=a(t,i)).write(e,n);return r!==i&&(t=t.slice(0,r)),t}(t,e,n):function(t,e){if(c.isBuffer(e)){var n=0|f(e.length);return 0===(t=a(t,n)).length||e.copy(t,0,0,n),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(i=e.length)!=i?a(t,0):d(t,e);if("Buffer"===e.type&&o(e.data))return d(t,e.data)}var i;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function h(t,e){if(l(e),t=a(t,e<0?0:0|f(e)),!c.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function d(t,e){var n=e.length<0?0:0|f(e.length);t=a(t,n);for(var i=0;i<n;i+=1)t[i]=255&e[i];return t}function f(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function p(t,e){if(c.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return J(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return $(t).length;default:if(i)return J(t).length;e=(""+e).toLowerCase(),i=!0}}function v(t,e,n){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,n);case"utf8":case"utf-8":return A(this,e,n);case"ascii":return j(this,e,n);case"latin1":case"binary":return C(this,e,n);case"base64":return F(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,n);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function g(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function m(t,e,n,i,r){if(0===t.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=r?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(r)return-1;n=t.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof e&&(e=c.from(e,i)),c.isBuffer(e))return 0===e.length?-1:w(t,e,n,i,r);if("number"==typeof e)return e&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):w(t,[e],n,i,r);throw new TypeError("val must be string, number or Buffer")}function w(t,e,n,i,r){var o,s=1,a=t.length,c=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;s=2,a/=2,c/=2,n/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(r){var l=-1;for(o=n;o<a;o++)if(u(t,o)===u(e,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===c)return l*s}else-1!==l&&(o-=o-l),l=-1}else for(n+c>a&&(n=a-c),o=n;o>=0;o--){for(var h=!0,d=0;d<c;d++)if(u(t,o+d)!==u(e,d)){h=!1;break}if(h)return o}return-1}function b(t,e,n,i){n=Number(n)||0;var r=t.length-n;i?(i=Number(i))>r&&(i=r):i=r;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var s=0;s<i;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[n+s]=a}return s}function y(t,e,n,i){return H(J(e,t.length-n),t,n,i)}function x(t,e,n,i){return H(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,i)}function k(t,e,n,i){return x(t,e,n,i)}function E(t,e,n,i){return H($(e),t,n,i)}function S(t,e,n,i){return H(function(t,e){for(var n,i,r=[],o=0;o<t.length&&!((e-=2)<0);++o)i=(n=t.charCodeAt(o))>>8,r.push(n%256),r.push(i);return r}(e,t.length-n),t,n,i)}function F(t,e,n){return i.fromByteArray(0===e&&n===t.length?t:t.slice(e,n))}function A(t,e,n){n=Math.min(t.length,n);for(var i=[],r=e;r<n;){var o,s,a,c,u=t[r],l=null,h=u>239?4:u>223?3:u>191?2:1;if(r+h<=n)switch(h){case 1:u<128&&(l=u);break;case 2:128==(192&(o=t[r+1]))&&(c=(31&u)<<6|63&o)>127&&(l=c);break;case 3:s=t[r+2],128==(192&(o=t[r+1]))&&128==(192&s)&&(c=(15&u)<<12|(63&o)<<6|63&s)>2047&&(c<55296||c>57343)&&(l=c);break;case 4:s=t[r+2],a=t[r+3],128==(192&(o=t[r+1]))&&128==(192&s)&&128==(192&a)&&(c=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&c<1114112&&(l=c)}null===l?(l=65533,h=1):l>65535&&(i.push((l-=65536)>>>10&1023|55296),l=56320|1023&l),i.push(l),r+=h}return function(t){var e=t.length;if(e<=_)return String.fromCharCode.apply(String,t);for(var n="",i=0;i<e;)n+=String.fromCharCode.apply(String,t.slice(i,i+=_));return n}(i)}e.Buffer=c,e.SlowBuffer=function(t){return+t!=t&&(t=0),c.alloc(+t)},e.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=s(),c.poolSize=8192,c._augment=function(t){return t.__proto__=c.prototype,t},c.from=function(t,e,n){return u(null,t,e,n)},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(t,e,n){return i=null,o=e,s=n,l(r=t),r<=0?a(i,r):void 0!==o?"string"==typeof s?a(i,r).fill(o,s):a(i,r).fill(o):a(i,r);var i,r,o,s},c.allocUnsafe=function(t){return h(null,t)},c.allocUnsafeSlow=function(t){return h(null,t)},c.isBuffer=function(t){return!(null==t||!t._isBuffer)},c.compare=function(t,e){if(!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,i=e.length,r=0,o=Math.min(n,i);r<o;++r)if(t[r]!==e[r]){n=t[r],i=e[r];break}return n<i?-1:i<n?1:0},c.isEncoding=function(t){switch(String(t).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(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var i=c.allocUnsafe(e),r=0;for(n=0;n<t.length;++n){var s=t[n];if(!c.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,r),r+=s.length}return i},c.byteLength=p,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},c.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},c.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},c.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?A(this,0,t):v.apply(this,arguments)},c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},c.prototype.compare=function(t,e,n,i,r){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===i&&(i=0),void 0===r&&(r=this.length),e<0||n>t.length||i<0||r>this.length)throw new RangeError("out of range index");if(i>=r&&e>=n)return 0;if(i>=r)return-1;if(e>=n)return 1;if(this===t)return 0;for(var o=(r>>>=0)-(i>>>=0),s=(n>>>=0)-(e>>>=0),a=Math.min(o,s),u=this.slice(i,r),l=t.slice(e,n),h=0;h<a;++h)if(u[h]!==l[h]){o=u[h],s=l[h];break}return o<s?-1:s<o?1:0},c.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},c.prototype.indexOf=function(t,e,n){return m(this,t,e,n,!0)},c.prototype.lastIndexOf=function(t,e,n){return m(this,t,e,n,!1)},c.prototype.write=function(t,e,n,i){if(void 0===e)i="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)i=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===i&&(i="utf8")):(i=n,n=void 0)}var r=this.length-e;if((void 0===n||n>r)&&(n=r),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return b(this,t,e,n);case"utf8":case"utf-8":return y(this,t,e,n);case"ascii":return x(this,t,e,n);case"latin1":case"binary":return k(this,t,e,n);case"base64":return E(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var _=4096;function j(t,e,n){var i="";n=Math.min(t.length,n);for(var r=e;r<n;++r)i+=String.fromCharCode(127&t[r]);return i}function C(t,e,n){var i="";n=Math.min(t.length,n);for(var r=e;r<n;++r)i+=String.fromCharCode(t[r]);return i}function R(t,e,n){var i=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>i)&&(n=i);for(var r="",o=e;o<n;++o)r+=B(t[o]);return r}function I(t,e,n){for(var i=t.slice(e,n),r="",o=0;o<i.length;o+=2)r+=String.fromCharCode(i[o]+256*i[o+1]);return r}function T(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function O(t,e,n,i,r,o){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||e<o)throw new RangeError('"value" argument is out of bounds');if(n+i>t.length)throw new RangeError("Index out of range")}function N(t,e,n,i){e<0&&(e=65535+e+1);for(var r=0,o=Math.min(t.length-n,2);r<o;++r)t[n+r]=(e&255<<8*(i?r:1-r))>>>8*(i?r:1-r)}function P(t,e,n,i){e<0&&(e=4294967295+e+1);for(var r=0,o=Math.min(t.length-n,4);r<o;++r)t[n+r]=e>>>8*(i?r:3-r)&255}function D(t,e,n,i){if(n+i>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function M(t,e,n,i,o){return o||D(t,0,n,4),r.write(t,e,n,i,23,4),n+4}function U(t,e,n,i,o){return o||D(t,0,n,8),r.write(t,e,n,i,52,8),n+8}c.prototype.slice=function(t,e){var n,i=this.length;if((t=~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),(e=void 0===e?i:~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),e<t&&(e=t),c.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=c.prototype;else{var r=e-t;n=new c(r,void 0);for(var o=0;o<r;++o)n[o]=this[o+t]}return n},c.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||T(t,e,this.length);for(var i=this[t],r=1,o=0;++o<e&&(r*=256);)i+=this[t+o]*r;return i},c.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||T(t,e,this.length);for(var i=this[t+--e],r=1;e>0&&(r*=256);)i+=this[t+--e]*r;return i},c.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]},c.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||T(t,e,this.length);for(var i=this[t],r=1,o=0;++o<e&&(r*=256);)i+=this[t+o]*r;return i>=(r*=128)&&(i-=Math.pow(2,8*e)),i},c.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||T(t,e,this.length);for(var i=e,r=1,o=this[t+--i];i>0&&(r*=256);)o+=this[t+--i]*r;return o>=(r*=128)&&(o-=Math.pow(2,8*e)),o},c.prototype.readInt8=function(t,e){return e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),r.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),r.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),r.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),r.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function(t,e,n,i){t=+t,e|=0,n|=0,i||O(this,t,e,n,Math.pow(2,8*n)-1,0);var r=1,o=0;for(this[e]=255&t;++o<n&&(r*=256);)this[e+o]=t/r&255;return e+n},c.prototype.writeUIntBE=function(t,e,n,i){t=+t,e|=0,n|=0,i||O(this,t,e,n,Math.pow(2,8*n)-1,0);var r=n-1,o=1;for(this[e+r]=255&t;--r>=0&&(o*=256);)this[e+r]=t/o&255;return e+n},c.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,1,255,0),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},c.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):N(this,t,e,!0),e+2},c.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):N(this,t,e,!1),e+2},c.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):P(this,t,e,!0),e+4},c.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):P(this,t,e,!1),e+4},c.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e|=0,!i){var r=Math.pow(2,8*n-1);O(this,t,e,n,r-1,-r)}var o=0,s=1,a=0;for(this[e]=255&t;++o<n&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+n},c.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e|=0,!i){var r=Math.pow(2,8*n-1);O(this,t,e,n,r-1,-r)}var o=n-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+n},c.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,1,127,-128),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):N(this,t,e,!0),e+2},c.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):N(this,t,e,!1),e+2},c.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):P(this,t,e,!0),e+4},c.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):P(this,t,e,!1),e+4},c.prototype.writeFloatLE=function(t,e,n){return M(this,t,e,!0,n)},c.prototype.writeFloatBE=function(t,e,n){return M(this,t,e,!1,n)},c.prototype.writeDoubleLE=function(t,e,n){return U(this,t,e,!0,n)},c.prototype.writeDoubleBE=function(t,e,n){return U(this,t,e,!1,n)},c.prototype.copy=function(t,e,n,i){if(n||(n=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<n&&(i=n),i===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-n&&(i=t.length-e+n);var r,o=i-n;if(this===t&&n<e&&e<i)for(r=o-1;r>=0;--r)t[r+e]=this[r+n];else if(o<1e3||!c.TYPED_ARRAY_SUPPORT)for(r=0;r<o;++r)t[r+e]=this[r+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o},c.prototype.fill=function(t,e,n,i){if("string"==typeof t){if("string"==typeof e?(i=e,e=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),1===t.length){var r=t.charCodeAt(0);r<256&&(t=r)}if(void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!c.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var o;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o<n;++o)this[o]=t;else{var s=c.isBuffer(t)?t:J(new c(t,i).toString()),a=s.length;for(o=0;o<n-e;++o)this[o+e]=s[o%a]}return this};var L=/[^+\/0-9A-Za-z-_]/g;function B(t){return t<16?"0"+t.toString(16):t.toString(16)}function J(t,e){var n;e=e||1/0;for(var i=t.length,r=null,o=[],s=0;s<i;++s){if((n=t.charCodeAt(s))>55295&&n<57344){if(!r){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===i){(e-=3)>-1&&o.push(239,191,189);continue}r=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(e-=3)>-1&&o.push(239,191,189);if(r=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function $(t){return i.toByteArray(function(t){if((t=(e=t,e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")).replace(L,"")).length<2)return"";for(var e;t.length%4!=0;)t+="=";return t}(t))}function H(t,e,n,i){for(var r=0;r<i&&!(r+n>=e.length||r>=t.length);++r)e[r+n]=t[r];return r}}).call(this,n(29))},function(t){var e;e=function(){return this}();try{e=e||new Function("return this")()}catch(t){"object"==typeof window&&(e=window)}t.exports=e},function(t,e){e.byteLength=function(t){var e=c(t),n=e[1];return 3*(e[0]+n)/4-n},e.toByteArray=function(t){var e,n,o,s=c(t),a=s[0],u=s[1],l=new r(3*(a+(o=u))/4-o),h=0,d=u>0?a-4:a;for(n=0;n<d;n+=4)e=i[t.charCodeAt(n)]<<18|i[t.charCodeAt(n+1)]<<12|i[t.charCodeAt(n+2)]<<6|i[t.charCodeAt(n+3)],l[h++]=e>>16&255,l[h++]=e>>8&255,l[h++]=255&e;return 2===u&&(e=i[t.charCodeAt(n)]<<2|i[t.charCodeAt(n+1)]>>4,l[h++]=255&e),1===u&&(e=i[t.charCodeAt(n)]<<10|i[t.charCodeAt(n+1)]<<4|i[t.charCodeAt(n+2)]>>2,l[h++]=e>>8&255,l[h++]=255&e),l},e.fromByteArray=function(t){for(var e,i=t.length,r=i%3,o=[],s=16383,a=0,c=i-r;a<c;a+=s)o.push(u(t,a,a+s>c?c:a+s));return 1===r?o.push(n[(e=t[i-1])>>2]+n[e<<4&63]+"=="):2===r&&o.push(n[(e=(t[i-2]<<8)+t[i-1])>>10]+n[e>>4&63]+n[e<<2&63]+"="),o.join("")};for(var n=[],i=[],r="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=o.length;s<a;++s)n[s]=o[s],i[o.charCodeAt(s)]=s;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function u(t,e,i){for(var r,o=[],s=e;s<i;s+=3)o.push(n[(r=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]))>>18&63]+n[r>>12&63]+n[r>>6&63]+n[63&r]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,n,i,r){var o,s,a=8*r-i-1,c=(1<<a)-1,u=c>>1,l=-7,h=n?r-1:0,d=n?-1:1,f=t[e+h];for(h+=d,o=f&(1<<-l)-1,f>>=-l,l+=a;l>0;o=256*o+t[e+h],h+=d,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=i;l>0;s=256*s+t[e+h],h+=d,l-=8);if(0===o)o=1-u;else{if(o===c)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,i),o-=u}return(f?-1:1)*s*Math.pow(2,o-i)},e.write=function(t,e,n,i,r,o){var s,a,c,u=8*o-r-1,l=(1<<u)-1,h=l>>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:o-1,p=i?1:-1,v=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-s))<1&&(s--,c*=2),(e+=s+h>=1?d/c:d*Math.pow(2,1-h))*c>=2&&(s++,c/=2),s+h>=l?(a=0,s=l):s+h>=1?(a=(e*c-1)*Math.pow(2,r),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,r),s=0));r>=8;t[n+f]=255&a,f+=p,a/=256,r-=8);for(s=s<<r|a,u+=r;u>0;t[n+f]=255&s,f+=p,s/=256,u-=8);t[n+f-p]|=128*v}},function(t){var e={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==e.call(t)}},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=t.jws,n=t.KeyUtil,r=t.X509,o=t.crypto,s=t.hextob64u,a=t.b64tohex,c=t.AllowedSigningAlgs;return function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.parseJwt=function(t){i.Log.debug("JoseUtil.parseJwt");try{var n=e.JWS.parse(t);return{header:n.headerObj,payload:n.payloadObj}}catch(t){i.Log.error(t)}},t.validateJwt=function(e,o,s,c,u,l,h){i.Log.debug("JoseUtil.validateJwt");try{if("RSA"===o.kty)if(o.e&&o.n)o=n.getKey(o);else{if(!o.x5c||!o.x5c.length)return i.Log.error("JoseUtil.validateJwt: RSA key missing key material",o),Promise.reject(new Error("RSA key missing key material"));var d=a(o.x5c[0]);o=r.getPublicKeyFromCertHex(d)}else{if("EC"!==o.kty)return i.Log.error("JoseUtil.validateJwt: Unsupported key type",o&&o.kty),Promise.reject(new Error(o.kty));if(!(o.crv&&o.x&&o.y))return i.Log.error("JoseUtil.validateJwt: EC key missing key material",o),Promise.reject(new Error("EC key missing key material"));o=n.getKey(o)}return t._validateJwt(e,o,s,c,u,l,h)}catch(t){return i.Log.error(t&&t.message||t),Promise.reject("JWT validation failed")}},t.validateJwtAttributes=function(e,n,r,o,s,a){o||(o=0),s||(s=parseInt(Date.now()/1e3));var c=t.parseJwt(e).payload;if(!c.iss)return i.Log.error("JoseUtil._validateJwt: issuer was not provided"),Promise.reject(new Error("issuer was not provided"));if(c.iss!==n)return i.Log.error("JoseUtil._validateJwt: Invalid issuer in token",c.iss),Promise.reject(new Error("Invalid issuer in token: "+c.iss));if(!c.aud)return i.Log.error("JoseUtil._validateJwt: aud was not provided"),Promise.reject(new Error("aud was not provided"));if(!(c.aud===r||Array.isArray(c.aud)&&c.aud.indexOf(r)>=0))return i.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!==r)return i.Log.error("JoseUtil._validateJwt: Invalid azp in token",c.azp),Promise.reject(new Error("Invalid azp in token: "+c.azp));if(!a){var u=s+o,l=s-o;if(!c.iat)return i.Log.error("JoseUtil._validateJwt: iat was not provided"),Promise.reject(new Error("iat was not provided"));if(u<c.iat)return i.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 i.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 i.Log.error("JoseUtil._validateJwt: exp was not provided"),Promise.reject(new Error("exp was not provided"));if(c.exp<l)return i.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)},t._validateJwt=function(n,r,o,s,a,u,l){return t.validateJwtAttributes(n,o,s,a,u,l).then((function(t){try{return e.JWS.verify(n,r,c)?t:(i.Log.error("JoseUtil._validateJwt: signature validation failed"),Promise.reject(new Error("signature validation failed")))}catch(t){return i.Log.error(t&&t.message||t),Promise.reject(new Error("signature validation failed"))}}))},t.hashString=function(t,e){try{return o.Util.hashString(t,e)}catch(t){i.Log.error(t)}},t.hexToBase64Url=function(t){try{return s(t)}catch(t){i.Log.error(t)}},t}()};var i=n(0);t.exports=e.default},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.SigninResponse=void 0;var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(3);function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.SigninResponse=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#";o(this,t);var i=r.UrlUtility.parseUrlFragment(e,n);this.error=i.error,this.error_description=i.error_description,this.error_uri=i.error_uri,this.code=i.code,this.state=i.state,this.id_token=i.id_token,this.session_state=i.session_state,this.access_token=i.access_token,this.token_type=i.token_type,this.scope=i.scope,this.profile=void 0,this.expires_in=i.expires_in}return i(t,[{key:"expires_in",get:function(){if(this.expires_at){var t=parseInt(Date.now()/1e3);return this.expires_at-t}},set:function(t){var e=parseInt(t);if("number"==typeof e&&e>0){var n=parseInt(Date.now()/1e3);this.expires_at=n+e}}},{key:"expired",get:function(){var t=this.expires_in;if(void 0!==t)return t<=0}},{key:"scopes",get:function(){return(this.scope||"").split(" ")}},{key:"isOpenIdConnect",get:function(){return this.scopes.indexOf("openid")>=0||!!this.id_token}}]),t}()},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.SignoutRequest=void 0;var i=n(0),r=n(3),o=n(9);e.SignoutRequest=function t(e){var n=e.url,s=e.id_token_hint,a=e.post_logout_redirect_uri,c=e.data,u=e.extraQueryParams,l=e.request_type;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),!n)throw i.Log.error("SignoutRequest.ctor: No url passed"),new Error("url");for(var h in s&&(n=r.UrlUtility.addQueryParam(n,"id_token_hint",s)),a&&(n=r.UrlUtility.addQueryParam(n,"post_logout_redirect_uri",a),c&&(this.state=new o.State({data:c,request_type:l}),n=r.UrlUtility.addQueryParam(n,"state",this.state.id))),u)n=r.UrlUtility.addQueryParam(n,h,u[h]);this.url=n}},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.SignoutResponse=void 0;var i=n(3);e.SignoutResponse=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=i.UrlUtility.parseUrlFragment(e,"?");this.error=n.error,this.error_description=n.error_description,this.error_uri=n.error_uri,this.state=n.state}},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.InMemoryWebStorage=void 0;var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(0);e.InMemoryWebStorage=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._data={}}return t.prototype.getItem=function(t){return r.Log.debug("InMemoryWebStorage.getItem",t),this._data[t]},t.prototype.setItem=function(t,e){r.Log.debug("InMemoryWebStorage.setItem",t),this._data[t]=e},t.prototype.removeItem=function(t){r.Log.debug("InMemoryWebStorage.removeItem",t),delete this._data[t]},t.prototype.key=function(t){return Object.getOwnPropertyNames(this._data)[t]},i(t,[{key:"length",get:function(){return Object.getOwnPropertyNames(this._data).length}}]),t}()},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.UserManager=void 0;var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(0),o=n(10),s=n(39),a=n(15),c=n(45),u=n(47),l=n(18),h=n(8),d=n(20),f=n(11),p=n(4);function v(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function g(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}e.UserManager=function(t){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.SilentRenewService,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.SessionMonitor,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:d.TokenRevocationClient,h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:f.TokenClient,m=arguments.length>5&&void 0!==arguments[5]?arguments[5]:p.JoseUtil;v(this,e),n instanceof s.UserManagerSettings||(n=new s.UserManagerSettings(n));var w=g(this,t.call(this,n));return w._events=new c.UserManagerEvents(n),w._silentRenewService=new i(w),w.settings.automaticSilentRenew&&(r.Log.debug("UserManager.ctor: automaticSilentRenew is configured, setting up silent renew"),w.startSilentRenew()),w.settings.monitorSession&&(r.Log.debug("UserManager.ctor: monitorSession is configured, setting up session monitor"),w._sessionMonitor=new o(w)),w._tokenRevocationClient=new a(w._settings),w._tokenClient=new h(w._settings),w._joseUtil=m,w}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.getUser=function(){var t=this;return this._loadUser().then((function(e){return e?(r.Log.info("UserManager.getUser: user loaded"),t._events.load(e,!1),e):(r.Log.info("UserManager.getUser: user not found in storage"),null)}))},e.prototype.removeUser=function(){var t=this;return this.storeUser(null).then((function(){r.Log.info("UserManager.removeUser: user removed from storage"),t._events.unload()}))},e.prototype.signinRedirect=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(t=Object.assign({},t)).request_type="si:r";var e={useReplaceToNavigate:t.useReplaceToNavigate};return this._signinStart(t,this._redirectNavigator,e).then((function(){r.Log.info("UserManager.signinRedirect: successful")}))},e.prototype.signinRedirectCallback=function(t){return this._signinEnd(t||this._redirectNavigator.url).then((function(t){return t.profile&&t.profile.sub?r.Log.info("UserManager.signinRedirectCallback: successful, signed in sub: ",t.profile.sub):r.Log.info("UserManager.signinRedirectCallback: no sub"),t}))},e.prototype.signinPopup=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(t=Object.assign({},t)).request_type="si:p";var e=t.redirect_uri||this.settings.popup_redirect_uri||this.settings.redirect_uri;return e?(t.redirect_uri=e,t.display="popup",this._signin(t,this._popupNavigator,{startUrl:e,popupWindowFeatures:t.popupWindowFeatures||this.settings.popupWindowFeatures,popupWindowTarget:t.popupWindowTarget||this.settings.popupWindowTarget}).then((function(t){return t&&(t.profile&&t.profile.sub?r.Log.info("UserManager.signinPopup: signinPopup successful, signed in sub: ",t.profile.sub):r.Log.info("UserManager.signinPopup: no sub")),t}))):(r.Log.error("UserManager.signinPopup: No popup_redirect_uri or redirect_uri configured"),Promise.reject(new Error("No popup_redirect_uri or redirect_uri configured")))},e.prototype.signinPopupCallback=function(t){return this._signinCallback(t,this._popupNavigator).then((function(t){return t&&(t.profile&&t.profile.sub?r.Log.info("UserManager.signinPopupCallback: successful, signed in sub: ",t.profile.sub):r.Log.info("UserManager.signinPopupCallback: no sub")),t})).catch((function(t){r.Log.error(t.message)}))},e.prototype.signinSilent=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e=Object.assign({},e),this._loadUser().then((function(n){return n&&n.refresh_token?(e.refresh_token=n.refresh_token,t._useRefreshToken(e)):(e.request_type="si:s",e.id_token_hint=e.id_token_hint||t.settings.includeIdTokenInSilentRenew&&n&&n.id_token,n&&t._settings.validateSubOnSilentRenew&&(r.Log.debug("UserManager.signinSilent, subject prior to silent renew: ",n.profile.sub),e.current_sub=n.profile.sub),t._signinSilentIframe(e))}))},e.prototype._useRefreshToken=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._tokenClient.exchangeRefreshToken(e).then((function(e){return e?e.access_token?t._loadUser().then((function(n){if(n){var i=Promise.resolve();return e.id_token&&(i=t._validateIdTokenFromTokenRefreshToken(n.profile,e.id_token)),i.then((function(){return r.Log.debug("UserManager._useRefreshToken: refresh token response success"),n.id_token=e.id_token||n.id_token,n.access_token=e.access_token,n.refresh_token=e.refresh_token||n.refresh_token,n.expires_in=e.expires_in,t.storeUser(n).then((function(){return t._events.load(n),n}))}))}return null})):(r.Log.error("UserManager._useRefreshToken: No access token returned from token endpoint"),Promise.reject("No access token returned from token endpoint")):(r.Log.error("UserManager._useRefreshToken: No response returned from token endpoint"),Promise.reject("No response returned from token endpoint"))}))},e.prototype._validateIdTokenFromTokenRefreshToken=function(t,e){var n=this;return this._metadataService.getIssuer().then((function(i){return n.settings.getEpochTime().then((function(o){return n._joseUtil.validateJwtAttributes(e,i,n._settings.client_id,n._settings.clockSkew,o).then((function(e){return e?e.sub!==t.sub?(r.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"))):e.auth_time&&e.auth_time!==t.auth_time?(r.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"))):e.azp&&e.azp!==t.azp?(r.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"))):!e.azp&&t.azp?(r.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:(r.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: Failed to validate id_token"),Promise.reject(new Error("Failed to validate id_token")))}))}))}))},e.prototype._signinSilentIframe=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.redirect_uri||this.settings.silent_redirect_uri||this.settings.redirect_uri;return e?(t.redirect_uri=e,t.prompt=t.prompt||"none",this._signin(t,this._iframeNavigator,{startUrl:e,silentRequestTimeout:t.silentRequestTimeout||this.settings.silentRequestTimeout}).then((function(t){return t&&(t.profile&&t.profile.sub?r.Log.info("UserManager.signinSilent: successful, signed in sub: ",t.profile.sub):r.Log.info("UserManager.signinSilent: no sub")),t}))):(r.Log.error("UserManager.signinSilent: No silent_redirect_uri configured"),Promise.reject(new Error("No silent_redirect_uri configured")))},e.prototype.signinSilentCallback=function(t){return this._signinCallback(t,this._iframeNavigator).then((function(t){return t&&(t.profile&&t.profile.sub?r.Log.info("UserManager.signinSilentCallback: successful, signed in sub: ",t.profile.sub):r.Log.info("UserManager.signinSilentCallback: no sub")),t}))},e.prototype.signinCallback=function(t){var e=this;return this.readSigninResponseState(t).then((function(n){var i=n.state;return"si:r"===i.request_type?e.signinRedirectCallback(t):"si:p"===i.request_type?e.signinPopupCallback(t):"si:s"===i.request_type?e.signinSilentCallback(t):Promise.reject(new Error("invalid response_type in state"))}))},e.prototype.signoutCallback=function(t,e){var n=this;return this.readSignoutResponseState(t).then((function(i){var r=i.state,o=i.response;return r?"so:r"===r.request_type?n.signoutRedirectCallback(t):"so:p"===r.request_type?n.signoutPopupCallback(t,e):Promise.reject(new Error("invalid response_type in state")):o}))},e.prototype.querySessionStatus=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=Object.assign({},e)).request_type="si:s";var n=e.redirect_uri||this.settings.silent_redirect_uri||this.settings.redirect_uri;return n?(e.redirect_uri=n,e.prompt="none",e.response_type=e.response_type||this.settings.query_status_response_type,e.scope=e.scope||"openid",e.skipUserInfo=!0,this._signinStart(e,this._iframeNavigator,{startUrl:n,silentRequestTimeout:e.silentRequestTimeout||this.settings.silentRequestTimeout}).then((function(e){return t.processSigninResponse(e.url).then((function(t){if(r.Log.debug("UserManager.querySessionStatus: got signin response"),t.session_state&&t.profile.sub)return r.Log.info("UserManager.querySessionStatus: querySessionStatus success for sub: ",t.profile.sub),{session_state:t.session_state,sub:t.profile.sub,sid:t.profile.sid};r.Log.info("querySessionStatus successful, user not authenticated")})).catch((function(e){if(e.session_state&&t.settings.monitorAnonymousSession&&("login_required"==e.message||"consent_required"==e.message||"interaction_required"==e.message||"account_selection_required"==e.message))return r.Log.info("UserManager.querySessionStatus: querySessionStatus success for anonymous user"),{session_state:e.session_state};throw e}))}))):(r.Log.error("UserManager.querySessionStatus: No silent_redirect_uri configured"),Promise.reject(new Error("No silent_redirect_uri configured")))},e.prototype._signin=function(t,e){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._signinStart(t,e,i).then((function(e){return n._signinEnd(e.url,t)}))},e.prototype._signinStart=function(t,e){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.prepare(i).then((function(e){return r.Log.debug("UserManager._signinStart: got navigator window handle"),n.createSigninRequest(t).then((function(t){return r.Log.debug("UserManager._signinStart: got signin request"),i.url=t.url,i.id=t.state.id,e.navigate(i)})).catch((function(t){throw e.close&&(r.Log.debug("UserManager._signinStart: Error after preparing navigator, closing navigator window"),e.close()),t}))}))},e.prototype._signinEnd=function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.processSigninResponse(t).then((function(t){r.Log.debug("UserManager._signinEnd: got signin response");var i=new a.User(t);if(n.current_sub){if(n.current_sub!==i.profile.sub)return r.Log.debug("UserManager._signinEnd: current user does not match user returned from signin. sub from signin: ",i.profile.sub),Promise.reject(new Error("login_required"));r.Log.debug("UserManager._signinEnd: current user matches user returned from signin")}return e.storeUser(i).then((function(){return r.Log.debug("UserManager._signinEnd: user stored"),e._events.load(i),i}))}))},e.prototype._signinCallback=function(t,e){r.Log.debug("UserManager._signinCallback");var n="query"===this._settings.response_mode||!this._settings.response_mode&&h.SigninRequest.isCode(this._settings.response_type)?"?":"#";return e.callback(t,void 0,n)},e.prototype.signoutRedirect=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(t=Object.assign({},t)).request_type="so:r";var e=t.post_logout_redirect_uri||this.settings.post_logout_redirect_uri;e&&(t.post_logout_redirect_uri=e);var n={useReplaceToNavigate:t.useReplaceToNavigate};return this._signoutStart(t,this._redirectNavigator,n).then((function(){r.Log.info("UserManager.signoutRedirect: successful")}))},e.prototype.signoutRedirectCallback=function(t){return this._signoutEnd(t||this._redirectNavigator.url).then((function(t){return r.Log.info("UserManager.signoutRedirectCallback: successful"),t}))},e.prototype.signoutPopup=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(t=Object.assign({},t)).request_type="so:p";var e=t.post_logout_redirect_uri||this.settings.popup_post_logout_redirect_uri||this.settings.post_logout_redirect_uri;return t.post_logout_redirect_uri=e,t.display="popup",t.post_logout_redirect_uri&&(t.state=t.state||{}),this._signout(t,this._popupNavigator,{startUrl:e,popupWindowFeatures:t.popupWindowFeatures||this.settings.popupWindowFeatures,popupWindowTarget:t.popupWindowTarget||this.settings.popupWindowTarget}).then((function(){r.Log.info("UserManager.signoutPopup: successful")}))},e.prototype.signoutPopupCallback=function(t,e){return void 0===e&&"boolean"==typeof t&&(e=t,t=null),this._popupNavigator.callback(t,e,"?").then((function(){r.Log.info("UserManager.signoutPopupCallback: successful")}))},e.prototype._signout=function(t,e){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._signoutStart(t,e,i).then((function(t){return n._signoutEnd(t.url)}))},e.prototype._signoutStart=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this,n=arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.prepare(i).then((function(n){return r.Log.debug("UserManager._signoutStart: got navigator window handle"),e._loadUser().then((function(o){return r.Log.debug("UserManager._signoutStart: loaded current user from storage"),(e._settings.revokeAccessTokenOnSignout?e._revokeInternal(o):Promise.resolve()).then((function(){var s=t.id_token_hint||o&&o.id_token;return s&&(r.Log.debug("UserManager._signoutStart: Setting id_token into signout request"),t.id_token_hint=s),e.removeUser().then((function(){return r.Log.debug("UserManager._signoutStart: user removed, creating signout request"),e.createSignoutRequest(t).then((function(t){return r.Log.debug("UserManager._signoutStart: got signout request"),i.url=t.url,t.state&&(i.id=t.state.id),n.navigate(i)}))}))}))})).catch((function(t){throw n.close&&(r.Log.debug("UserManager._signoutStart: Error after preparing navigator, closing navigator window"),n.close()),t}))}))},e.prototype._signoutEnd=function(t){return this.processSignoutResponse(t).then((function(t){return r.Log.debug("UserManager._signoutEnd: got signout response"),t}))},e.prototype.revokeAccessToken=function(){var t=this;return this._loadUser().then((function(e){return t._revokeInternal(e,!0).then((function(n){if(n)return r.Log.debug("UserManager.revokeAccessToken: removing token properties from user and re-storing"),e.access_token=null,e.refresh_token=null,e.expires_at=null,e.token_type=null,t.storeUser(e).then((function(){r.Log.debug("UserManager.revokeAccessToken: user stored"),t._events.load(e)}))}))})).then((function(){r.Log.info("UserManager.revokeAccessToken: access token revoked successfully")}))},e.prototype._revokeInternal=function(t,e){var n=this;if(t){var i=t.refresh_token;return this._revokeAccessTokenInternal(t.access_token,e).then((function(t){return n._revokeRefreshTokenInternal(i,e).then((function(e){return t||e||r.Log.debug("UserManager.revokeAccessToken: no need to revoke due to no token(s), or JWT format"),t||e}))}))}return Promise.resolve(!1)},e.prototype._revokeAccessTokenInternal=function(t,e){return!t||t.indexOf(".")>=0?Promise.resolve(!1):this._tokenRevocationClient.revoke(t,e).then((function(){return!0}))},e.prototype._revokeRefreshTokenInternal=function(t,e){return t?this._tokenRevocationClient.revoke(t,e,"refresh_token").then((function(){return!0})):Promise.resolve(!1)},e.prototype.startSilentRenew=function(){this._silentRenewService.start()},e.prototype.stopSilentRenew=function(){this._silentRenewService.stop()},e.prototype._loadUser=function(){return this._userStore.get(this._userStoreKey).then((function(t){return t?(r.Log.debug("UserManager._loadUser: user storageString loaded"),a.User.fromStorageString(t)):(r.Log.debug("UserManager._loadUser: no user storageString"),null)}))},e.prototype.storeUser=function(t){if(t){r.Log.debug("UserManager.storeUser: storing user");var e=t.toStorageString();return this._userStore.set(this._userStoreKey,e)}return r.Log.debug("storeUser.storeUser: removing user"),this._userStore.remove(this._userStoreKey)},i(e,[{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}}]),e}(o.OidcClient)},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.UserManagerSettings=void 0;var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=(n(0),n(5)),o=n(40),s=n(41),a=n(43),c=n(6),u=n(1),l=n(8);function h(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function d(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}e.UserManagerSettings=function(t){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.popup_redirect_uri,r=n.popup_post_logout_redirect_uri,f=n.popupWindowFeatures,p=n.popupWindowTarget,v=n.silent_redirect_uri,g=n.silentRequestTimeout,m=n.automaticSilentRenew,w=void 0!==m&&m,b=n.validateSubOnSilentRenew,y=void 0!==b&&b,x=n.includeIdTokenInSilentRenew,k=void 0===x||x,E=n.monitorSession,S=void 0===E||E,F=n.monitorAnonymousSession,A=void 0!==F&&F,_=n.checkSessionInterval,j=void 0===_?2e3:_,C=n.stopCheckSessionOnError,R=void 0===C||C,I=n.query_status_response_type,T=n.revokeAccessTokenOnSignout,O=void 0!==T&&T,N=n.accessTokenExpiringNotificationTime,P=void 0===N?60:N,D=n.redirectNavigator,M=void 0===D?new o.RedirectNavigator:D,U=n.popupNavigator,L=void 0===U?new s.PopupNavigator:U,B=n.iframeNavigator,J=void 0===B?new a.IFrameNavigator:B,$=n.userStore,H=void 0===$?new c.WebStorageStateStore({store:u.Global.sessionStorage}):$;h(this,e);var z=d(this,t.call(this,arguments[0]));return z._popup_redirect_uri=i,z._popup_post_logout_redirect_uri=r,z._popupWindowFeatures=f,z._popupWindowTarget=p,z._silent_redirect_uri=v,z._silentRequestTimeout=g,z._automaticSilentRenew=w,z._validateSubOnSilentRenew=y,z._includeIdTokenInSilentRenew=k,z._accessTokenExpiringNotificationTime=P,z._monitorSession=S,z._monitorAnonymousSession=A,z._checkSessionInterval=j,z._stopCheckSessionOnError=R,z._query_status_response_type=I||(arguments[0]&&arguments[0].response_type?l.SigninRequest.isOidc(arguments[0].response_type)?"id_token":"code":"id_token"),z._revokeAccessTokenOnSignout=O,z._redirectNavigator=M,z._popupNavigator=L,z._iframeNavigator=J,z._userStore=H,z}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),i(e,[{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}}]),e}(r.OidcClientSettings)},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.RedirectNavigator=void 0;var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(0);e.RedirectNavigator=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.prototype.prepare=function(){return Promise.resolve(this)},t.prototype.navigate=function(t){return t&&t.url?(t.useReplaceToNavigate?window.location.replace(t.url):window.location=t.url,Promise.resolve()):(r.Log.error("RedirectNavigator.navigate: No url provided"),Promise.reject(new Error("No url provided")))},i(t,[{key:"url",get:function(){return window.location.href}}]),t}()},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.PopupNavigator=void 0;var i=n(0),r=n(42);e.PopupNavigator=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.prototype.prepare=function(t){var e=new r.PopupWindow(t);return Promise.resolve(e)},t.prototype.callback=function(t,e,n){i.Log.debug("PopupNavigator.callback");try{return r.PopupWindow.notifyOpener(t,e,n),Promise.resolve()}catch(t){return Promise.reject(t)}},t}()},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.PopupWindow=void 0;var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(0),o=n(3);e.PopupWindow=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._promise=new Promise((function(t,e){n._resolve=t,n._reject=e})),this._popup=window.open("",e.popupWindowTarget||"_blank",e.popupWindowFeatures||"location=no,toolbar=no,width=500,height=500,left=100,top=100;"),this._popup&&(r.Log.debug("PopupWindow.ctor: popup successfully created"),this._checkForPopupClosedTimer=window.setInterval(this._checkForPopupClosed.bind(this),500))}return t.prototype.navigate=function(t){return this._popup?t&&t.url?(r.Log.debug("PopupWindow.navigate: Setting URL in popup"),this._id=t.id,this._id&&(window["popupCallback_"+t.id]=this._callback.bind(this)),this._popup.focus(),this._popup.window.location=t.url):(this._error("PopupWindow.navigate: no url provided"),this._error("No url provided")):this._error("PopupWindow.navigate: Error opening popup window"),this.promise},t.prototype._success=function(t){r.Log.debug("PopupWindow.callback: Successful response from popup window"),this._cleanup(),this._resolve(t)},t.prototype._error=function(t){r.Log.error("PopupWindow.error: ",t),this._cleanup(),this._reject(new Error(t))},t.prototype.close=function(){this._cleanup(!1)},t.prototype._cleanup=function(t){r.Log.debug("PopupWindow.cleanup"),window.clearInterval(this._checkForPopupClosedTimer),this._checkForPopupClosedTimer=null,delete window["popupCallback_"+this._id],this._popup&&!t&&this._popup.close(),this._popup=null},t.prototype._checkForPopupClosed=function(){this._popup&&!this._popup.closed||this._error("Popup window closed")},t.prototype._callback=function(t,e){this._cleanup(e),t?(r.Log.debug("PopupWindow.callback success"),this._success({url:t})):(r.Log.debug("PopupWindow.callback: Invalid response from popup"),this._error("Invalid response from popup"))},t.notifyOpener=function(t,e,n){if(window.opener){if(t=t||window.location.href){var i=o.UrlUtility.parseUrlFragment(t,n);if(i.state){var s=window.opener["popupCallback_"+i.state];s?(r.Log.debug("PopupWindow.notifyOpener: passing url message to opener"),s(t,e)):r.Log.warn("PopupWindow.notifyOpener: no matching callback found on opener")}else r.Log.warn("PopupWindow.notifyOpener: no state found in response url")}}else r.Log.warn("PopupWindow.notifyOpener: no window.opener. Can't complete notification.")},i(t,[{key:"promise",get:function(){return this._promise}}]),t}()},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.IFrameNavigator=void 0;var i=n(0),r=n(44);e.IFrameNavigator=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.prototype.prepare=function(t){var e=new r.IFrameWindow(t);return Promise.resolve(e)},t.prototype.callback=function(t){i.Log.debug("IFrameNavigator.callback");try{return r.IFrameWindow.notifyParent(t),Promise.resolve()}catch(t){return Promise.reject(t)}},t}()},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.IFrameWindow=void 0;var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(0);e.IFrameWindow=function(){function t(){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._promise=new Promise((function(t,n){e._resolve=t,e._reject=n})),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 t.prototype.navigate=function(t){if(t&&t.url){var e=t.silentRequestTimeout||1e4;r.Log.debug("IFrameWindow.navigate: Using timeout of:",e),this._timer=window.setTimeout(this._timeout.bind(this),e),this._frame.src=t.url}else this._error("No url provided");return this.promise},t.prototype._success=function(t){this._cleanup(),r.Log.debug("IFrameWindow: Successful response from frame window"),this._resolve(t)},t.prototype._error=function(t){this._cleanup(),r.Log.error(t),this._reject(new Error(t))},t.prototype.close=function(){this._cleanup()},t.prototype._cleanup=function(){this._frame&&(r.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)},t.prototype._timeout=function(){r.Log.debug("IFrameWindow.timeout"),this._error("Frame window timed out")},t.prototype._message=function(t){if(r.Log.debug("IFrameWindow.message"),this._timer&&t.origin===this._origin&&t.source===this._frame.contentWindow&&"string"==typeof t.data&&(t.data.startsWith("http://")||t.data.startsWith("https://"))){var e=t.data;e?this._success({url:e}):this._error("Invalid response from frame")}},t.notifyParent=function(t){r.Log.debug("IFrameWindow.notifyParent"),(t=t||window.location.href)&&(r.Log.debug("IFrameWindow.notifyParent: posting url message to parent"),window.parent.postMessage(t,location.protocol+"//"+location.host))},i(t,[{key:"promise",get:function(){return this._promise}},{key:"_origin",get:function(){return location.protocol+"//"+location.host}}]),t}()},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.UserManagerEvents=void 0;var i=n(0),r=n(16),o=n(17);e.UserManagerEvents=function(t){function e(n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,n));return i._userLoaded=new o.Event("User loaded"),i._userUnloaded=new o.Event("User unloaded"),i._silentRenewError=new o.Event("Silent renew error"),i._userSignedIn=new o.Event("User signed in"),i._userSignedOut=new o.Event("User signed out"),i._userSessionChanged=new o.Event("User session changed"),i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.load=function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];i.Log.debug("UserManagerEvents.load"),t.prototype.load.call(this,e),n&&this._userLoaded.raise(e)},e.prototype.unload=function(){i.Log.debug("UserManagerEvents.unload"),t.prototype.unload.call(this),this._userUnloaded.raise()},e.prototype.addUserLoaded=function(t){this._userLoaded.addHandler(t)},e.prototype.removeUserLoaded=function(t){this._userLoaded.removeHandler(t)},e.prototype.addUserUnloaded=function(t){this._userUnloaded.addHandler(t)},e.prototype.removeUserUnloaded=function(t){this._userUnloaded.removeHandler(t)},e.prototype.addSilentRenewError=function(t){this._silentRenewError.addHandler(t)},e.prototype.removeSilentRenewError=function(t){this._silentRenewError.removeHandler(t)},e.prototype._raiseSilentRenewError=function(t){i.Log.debug("UserManagerEvents._raiseSilentRenewError",t.message),this._silentRenewError.raise(t)},e.prototype.addUserSignedIn=function(t){this._userSignedIn.addHandler(t)},e.prototype.removeUserSignedIn=function(t){this._userSignedIn.removeHandler(t)},e.prototype._raiseUserSignedIn=function(){i.Log.debug("UserManagerEvents._raiseUserSignedIn"),this._userSignedIn.raise()},e.prototype.addUserSignedOut=function(t){this._userSignedOut.addHandler(t)},e.prototype.removeUserSignedOut=function(t){this._userSignedOut.removeHandler(t)},e.prototype._raiseUserSignedOut=function(){i.Log.debug("UserManagerEvents._raiseUserSignedOut"),this._userSignedOut.raise()},e.prototype.addUserSessionChanged=function(t){this._userSessionChanged.addHandler(t)},e.prototype.removeUserSessionChanged=function(t){this._userSessionChanged.removeHandler(t)},e.prototype._raiseUserSessionChanged=function(){i.Log.debug("UserManagerEvents._raiseUserSessionChanged"),this._userSessionChanged.raise()},e}(r.AccessTokenEvents)},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.Timer=void 0;var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(0),o=n(1),s=n(17);function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}e.Timer=function(t){function e(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.Global.timer,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;a(this,e);var s=c(this,t.call(this,n));return s._timer=i,s._nowFunc=r||function(){return Date.now()/1e3},s}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.init=function(t){t<=0&&(t=1),t=parseInt(t);var e=this.now+t;if(this.expiration===e&&this._timerHandle)r.Log.debug("Timer.init timer "+this._name+" skipping initialization since already initialized for expiration:",this.expiration);else{this.cancel(),r.Log.debug("Timer.init timer "+this._name+" for duration:",t),this._expiration=e;var n=5;t<n&&(n=t),this._timerHandle=this._timer.setInterval(this._callback.bind(this),1e3*n)}},e.prototype.cancel=function(){this._timerHandle&&(r.Log.debug("Timer.cancel: ",this._name),this._timer.clearInterval(this._timerHandle),this._timerHandle=null)},e.prototype._callback=function(){r.Log.debug("Timer.callback; "+this._name+" timer expires in:",this._expiration-this.now),this._expiration<=this.now&&(this.cancel(),t.prototype.raise.call(this))},i(e,[{key:"now",get:function(){return parseInt(this._nowFunc())}},{key:"expiration",get:function(){return this._expiration}}]),e}(s.Event)},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.SilentRenewService=void 0;var i=n(0);e.SilentRenewService=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._userManager=e}return t.prototype.start=function(){this._callback||(this._callback=this._tokenExpiring.bind(this),this._userManager.events.addAccessTokenExpiring(this._callback),this._userManager.getUser().then((function(){})).catch((function(t){i.Log.error("SilentRenewService.start: Error from getUser:",t.message)})))},t.prototype.stop=function(){this._callback&&(this._userManager.events.removeAccessTokenExpiring(this._callback),delete this._callback)},t.prototype._tokenExpiring=function(){var t=this;this._userManager.signinSilent().then((function(){i.Log.debug("SilentRenewService._tokenExpiring: Silent token renewal successful")}),(function(e){i.Log.error("SilentRenewService._tokenExpiring: Error from signinSilent:",e.message),t._userManager.events._raiseSilentRenewError(e)}))},t}()},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.CordovaPopupNavigator=void 0;var i=n(21);e.CordovaPopupNavigator=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.prototype.prepare=function(t){var e=new i.CordovaPopupWindow(t);return Promise.resolve(e)},t}()},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.CordovaIFrameNavigator=void 0;var i=n(21);e.CordovaIFrameNavigator=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.prototype.prepare=function(t){t.popupWindowFeatures="hidden=yes";var e=new i.CordovaPopupWindow(t);return Promise.resolve(e)},t}()},function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Version="1.11.6"}])}))}}),Is=Kt({"../node_modules/@inrupt/oidc-client-ext/dist/index.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Rs(),n=js();function i(t){return void 0!==t.error_description&&"string"==typeof t.error_description}function r(t,e){if(void 0!==(r=t).error&&"string"==typeof r.error)throw new n.OidcProviderError(`Token endpoint returned error [${t.error}]${i(t)?`: ${t.error_description}`:""}${function(t){return void 0!==t.error_uri&&"string"==typeof t.error_uri}(t)?` (see ${t.error_uri})`:""}`,t.error,i(t)?t.error_description:void 0);var r;if(!function(t){return void 0!==t.access_token&&"string"==typeof t.access_token}(t))throw new n.InvalidResponseError(["access_token"]);if(!function(t){return void 0!==t.id_token&&"string"==typeof t.id_token}(t))throw new n.InvalidResponseError(["id_token"]);if(!function(t){return void 0!==t.token_type&&"string"==typeof t.token_type}(t))throw new n.InvalidResponseError(["token_type"]);if(!function(t){return void 0===t.expires_in||"number"==typeof t.expires_in}(t))throw new n.InvalidResponseError(["expires_in"]);if(!e&&"bearer"!==t.token_type.toLowerCase())throw new Error(`Invalid token endpoint response: requested a [Bearer] token, but got a 'token_type' value of [${t.token_type}].`);return t}Object.defineProperty(t,"CordovaIFrameNavigator",{enumerable:!0,get:function(){return e.CordovaIFrameNavigator}}),Object.defineProperty(t,"CordovaPopupNavigator",{enumerable:!0,get:function(){return e.CordovaPopupNavigator}}),Object.defineProperty(t,"InMemoryWebStorage",{enumerable:!0,get:function(){return e.InMemoryWebStorage}}),Object.defineProperty(t,"Log",{enumerable:!0,get:function(){return e.Log}}),Object.defineProperty(t,"OidcClient",{enumerable:!0,get:function(){return e.OidcClient}}),Object.defineProperty(t,"SessionMonitor",{enumerable:!0,get:function(){return e.SessionMonitor}}),Object.defineProperty(t,"User",{enumerable:!0,get:function(){return e.User}}),Object.defineProperty(t,"UserManager",{enumerable:!0,get:function(){return e.UserManager}}),Object.defineProperty(t,"Version",{enumerable:!0,get:function(){return e.Version}}),Object.defineProperty(t,"WebStorageStateStore",{enumerable:!0,get:function(){return e.WebStorageStateStore}}),t.clearOidcPersistentStorage=async function(){const t=new e.OidcClient({response_mode:"query"});await t.clearStaleState(new e.WebStorageStateStore({}));const n=window.localStorage,i=[];for(let t=0;t<=n.length;t+=1){const e=n.key(t);e&&(e.match(/^oidc\..+$/)||e.match(/^solidClientAuthenticationUser:.+$/))&&i.push(e)}i.forEach((t=>n.removeItem(t)))},t.getBearerToken=async function(t){let i;try{const r=new e.OidcClient({response_mode:"query",loadUserInfo:!1});if(i=await r.processSigninResponse(t),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 o=await n.getWebidFromTokenPayload(i.id_token,r.settings.metadata.jwks_uri,r.settings.metadata.issuer,r.settings.client_id);return{accessToken:i.access_token,idToken:i.id_token,webId:o,refreshToken:i.refresh_token}}catch(e){throw new Error(`Problem handling Auth Code Grant (Flow) redirect - URL [${t}]: ${e}`)}},t.getDpopToken=async function(t,e,i){return async function(t,e,i,o){!function(t,e){if(e.grantType&&(!t.grantTypesSupported||!t.grantTypesSupported.includes(e.grantType)))throw new Error(`The issuer [${t.issuer}] does not support the [${e.grantType}] grant`);if(!t.tokenEndpoint)throw new Error(`This issuer [${t.issuer}] does not have a token endpoint`)}(t,i);const s={"content-type":"application/x-www-form-urlencoded"};let a;o&&(a=await n.generateDpopKeyPair(),s.DPoP=await n.createDpopHeader(t.tokenEndpoint,"POST",a)),e.clientSecret&&(s.Authorization=`Basic ${btoa(`${e.clientId}:${e.clientSecret}`)}`);const c={method:"POST",headers:s,body:new URLSearchParams({grant_type:i.grantType,redirect_uri:i.redirectUrl,code:i.code,code_verifier:i.codeVerifier,client_id:e.clientId}).toString()},u=await await fetch(t.tokenEndpoint,c),l=r(await u.json(),o),h=await n.getWebidFromTokenPayload(l.id_token,t.jwksUri,t.issuer,e.clientId);return{accessToken:l.access_token,idToken:l.id_token,refreshToken:(d=l,void 0!==d.refresh_token&&"string"==typeof d.refresh_token?l.refresh_token:void 0),webId:h,dpopKey:a,expiresIn:l.expires_in};var d}(t,e,i,!0)},t.refresh=async function(t,e,i,o){if(void 0===i.clientId)throw new Error("No client ID available when trying to refresh the access token.");const s={grant_type:"refresh_token",refresh_token:t,scope:n.DEFAULT_SCOPES};let a={};void 0!==o&&(a={DPoP:await n.createDpopHeader(e.tokenEndpoint,"POST",o)});let c={};void 0!==i.clientSecret?c={Authorization:`Basic ${btoa(`${i.clientId}:${i.clientSecret}`)}`}:(t=>{try{return new URL(t),!0}catch(t){return!1}})(i.clientId)&&(s.client_id=i.clientId);const u=await fetch(e.tokenEndpoint,{method:"POST",body:new URLSearchParams(s).toString(),headers:{...a,...c,"Content-Type":"application/x-www-form-urlencoded"}});let l;try{l=await u.json()}catch(t){throw new Error(`The token endpoint of issuer ${e.issuer} returned a malformed response.`)}const h=r(l,void 0!==o),d=await n.getWebidFromTokenPayload(h.id_token,e.jwksUri,e.issuer,i.clientId);return{accessToken:h.access_token,idToken:h.id_token,refreshToken:"string"==typeof h.refresh_token?h.refresh_token:void 0,webId:d,dpopKey:o,expiresIn:h.expires_in}},t.registerClient=async function(t,e){var i;if(!e.registrationEndpoint)throw new Error("Dynamic Registration could not be completed because the issuer has no registration endpoint.");if(!Array.isArray(e.idTokenSigningAlgValuesSupported))throw new Error("The OIDC issuer discovery profile is missing the 'id_token_signing_alg_values_supported' value, which is mandatory.");const r=n.determineSigningAlg(e.idTokenSigningAlgValuesSupported,n.PREFERRED_SIGNING_ALG),o={client_name:t.clientName,application_type:"web",redirect_uris:[null===(i=t.redirectUrl)||void 0===i?void 0:i.toString()],subject_type:"public",token_endpoint_auth_method:"client_secret_basic",id_token_signed_response_alg:r,grant_types:["authorization_code","refresh_token"]},s=await fetch(e.registrationEndpoint.toString(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)});if(s.ok){const e=await s.json();return function(t,e){if(void 0===t.client_id)throw new Error(`Dynamic client registration failed: no client_id has been found on ${JSON.stringify(t)}`);if(e.redirectUrl&&(void 0===t.redirect_uris||t.redirect_uris[0]!==e.redirectUrl.toString()))throw new Error(`Dynamic client registration failed: the returned redirect URIs ${JSON.stringify(t.redirect_uris)} don't match the provided ${JSON.stringify([e.redirectUrl.toString()])}`)}(e,t),{clientId:e.client_id,clientSecret:e.client_secret,idTokenSignedResponseAlg:e.id_token_signed_response_alg,clientType:"dynamic"}}throw 400===s.status&&function(t,e){var n,i,r,o;if("invalid_redirect_uri"===t.error)throw new Error(`Dynamic client registration failed: the provided redirect uri [${null===(n=e.redirectUrl)||void 0===n?void 0:n.toString()}] is invalid - ${null!==(i=t.error_description)&&void 0!==i?i:""}`);if("invalid_client_metadata"===t.error)throw new Error(`Dynamic client registration failed: the provided client metadata ${JSON.stringify(e)} is invalid - ${null!==(r=t.error_description)&&void 0!==r?r:""}`);throw new Error(`Dynamic client registration failed: ${t.error} - ${null!==(o=t.error_description)&&void 0!==o?o:""}`)}(await s.json(),t),new Error(`Dynamic client registration failed: the server returned ${s.status} ${s.statusText} - ${await s.text()}`)},t.removeOidcQueryParam=function(t){const e=new URL(t);return e.searchParams.delete("code"),e.searchParams.delete("state"),e.hash="",e.toString()}}}),Ts=Kt({"../node_modules/@inrupt/solid-client-authn-browser/dist/ClientAuthentication.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=js(),n=Is(),i=(t,e)=>window.fetch(t,e);t.default=class{constructor(t,r,o,s,a){this.loginHandler=t,this.redirectHandler=r,this.logoutHandler=o,this.sessionInfoManager=s,this.issuerConfigFetcher=a,this.login=async(t,e)=>{var i,r;await this.sessionInfoManager.clear(t.sessionId);const o=(0,n.removeOidcQueryParam)(null!==(i=t.redirectUrl)&&void 0!==i?i:window.location.href);await this.loginHandler.handle({...t,redirectUrl:o,clientName:null!==(r=t.clientName)&&void 0!==r?r:t.clientId,eventEmitter:e})},this.fetch=i,this.logout=async t=>{await this.logoutHandler.handle(t),this.fetch=i},this.getSessionInfo=async t=>this.sessionInfoManager.get(t),this.getAllSessionInfo=async()=>this.sessionInfoManager.getAll(),this.validateCurrentSession=async t=>{const e=await this.sessionInfoManager.get(t);return void 0===e||void 0===e.clientAppId||void 0===e.issuer?null:e},this.handleIncomingRedirect=async(t,n)=>{try{const e=await this.redirectHandler.handle(t,n);return this.fetch=e.fetch.bind(window),this.cleanUrlAfterRedirect(t),{isLoggedIn:e.isLoggedIn,webId:e.webId,sessionId:e.sessionId,expirationDate:e.expirationDate}}catch(i){return this.cleanUrlAfterRedirect(t),void n.emit(e.EVENTS.ERROR,"redirect",i)}}}cleanUrlAfterRedirect(t){const e=new URL(t);e.searchParams.delete("state"),e.searchParams.delete("code"),e.searchParams.delete("id_token"),e.searchParams.delete("access_token"),e.searchParams.delete("error"),e.searchParams.delete("error_description"),window.history.replaceState(null,"",e.toString())}}}}),Os=Kt({"../node_modules/@inrupt/solid-client-authn-browser/dist/login/oidc/OidcLoginHandler.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=js();function n(t){return"string"==typeof t.oidcIssuer}function i(t){return"string"==typeof t.redirectUrl}t.default=class{constructor(t,e,n,i){this.storageUtility=t,this.oidcHandler=e,this.issuerConfigFetcher=n,this.clientRegistrar=i}async canHandle(t){return n(t)&&i(t)}async handle(t){if(!n(t))throw new e.ConfigurationError(`OidcLoginHandler requires an OIDC issuer: missing property 'oidcIssuer' in ${JSON.stringify(t)}`);if(!i(t))throw new e.ConfigurationError(`OidcLoginHandler requires a redirect URL: missing property 'redirectUrl' in ${JSON.stringify(t)}`);const r=await this.issuerConfigFetcher.fetchConfig(t.oidcIssuer),o=await(0,e.handleRegistration)(t,r,this.storageUtility,this.clientRegistrar),s={issuer:r.issuer,dpop:"dpop"===t.tokenType.toLowerCase(),...t,issuerConfiguration:r,client:o};return this.oidcHandler.handle(s)}}}}),Ns=Kt({"../node_modules/@inrupt/solid-client-authn-browser/dist/login/oidc/oidcHandlers/AuthorizationCodeWithPkceOidcHandler.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=js(),n=Is();t.default=class{constructor(t,e){this.storageUtility=t,this.redirector=e}async canHandle(t){return!!(t.issuerConfiguration.grantTypesSupported&&t.issuerConfiguration.grantTypesSupported.indexOf("authorization_code")>-1)}async handle(t){var i;const r={authority:t.issuer.toString(),client_id:t.client.clientId,client_secret:t.client.clientSecret,redirect_uri:t.redirectUrl.toString(),post_logout_redirect_uri:t.redirectUrl.toString(),response_type:"code",scope:e.DEFAULT_SCOPES,filterProtocolClaims:!0,loadUserInfo:!1,code_verifier:!0,prompt:null!==(i=t.prompt)&&void 0!==i?i:"consent"},o=new n.OidcClient(r),{redirector:s}=this,a=this.storageUtility;try{const e=await o.createSigninRequest();await Promise.all([a.setForUser(e.state._id,{sessionId:t.sessionId}),a.setForUser(t.sessionId,{codeVerifier:e.state._code_verifier,issuer:t.issuer.toString(),redirectUrl:t.redirectUrl,dpop:t.dpop?"true":"false"})]),s.redirect(e.url.toString(),{handleRedirect:t.handleRedirect})}catch(t){console.error(t)}}}}}),Ps=Kt({"../node_modules/@inrupt/solid-client-authn-browser/dist/util/urlPath.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.appendToUrlPathname=void 0,t.appendToUrlPathname=function(t,e){const n=new URL(t),i=n.pathname;return n.pathname=`${i}${i.endsWith("/")?"":"/"}${e.startsWith("/")?e.substring(1):e}`,n.toString()}}}),Ds=Kt({"../node_modules/@inrupt/solid-client-authn-browser/dist/login/oidc/IssuerConfigFetcher.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WELL_KNOWN_OPENID_CONFIG=void 0;var e=js(),n=Ps();t.WELL_KNOWN_OPENID_CONFIG=".well-known/openid-configuration";var i={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}},r=class{constructor(t){this.storageUtility=t}static getLocalStorageKey(t){return`issuerConfig:${t}`}async fetchConfig(o){let s;const a=(0,n.appendToUrlPathname)(o,t.WELL_KNOWN_OPENID_CONFIG),c=await window.fetch(a);try{s=function(t){const e={};return Object.keys(t).forEach((n=>{i[n]&&(e[i[n].toKey]=t[n])})),Array.isArray(e.scopesSupported)||(e.scopesSupported=["openid"]),e}(await c.json())}catch(t){throw new e.ConfigurationError(`[${o.toString()}] has an invalid configuration: ${t.message}`)}return await this.storageUtility.set(r.getLocalStorageKey(o),JSON.stringify(s)),s}};t.default=r}}),Ms=Kt({"../node_modules/@inrupt/solid-client-authn-browser/dist/sessionInfo/SessionInfoManager.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SessionInfoManager=t.clear=t.getUnauthenticatedSession=void 0;var e=js(),n=(Ss(),Gt(Es)),i=Is();async function r(t,e){await Promise.all([e.deleteAllUserData(t,{secure:!1}),e.deleteAllUserData(t,{secure:!0}),e.delete("clientKey",{secure:!1})]),await(0,i.clearOidcPersistentStorage)()}t.getUnauthenticatedSession=function(){return{isLoggedIn:!1,sessionId:(0,n.v4)(),fetch}},t.clear=r,t.SessionInfoManager=class{constructor(t){this.storageUtility=t}update(t,e){throw new Error("Not Implemented")}async get(t){var n;const i=await this.storageUtility.getForUser(t,"isLoggedIn",{secure:!0}),r=await this.storageUtility.getForUser(t,"webId",{secure:!0}),o=await this.storageUtility.getForUser(t,"clientId",{secure:!1}),s=await this.storageUtility.getForUser(t,"clientSecret",{secure:!1}),a=await this.storageUtility.getForUser(t,"redirectUrl",{secure:!1}),c=await this.storageUtility.getForUser(t,"refreshToken",{secure:!0}),u=await this.storageUtility.getForUser(t,"issuer",{secure:!1}),l=null!==(n=await this.storageUtility.getForUser(t,"tokenType",{secure:!1}))&&void 0!==n?n:"DPoP";if(!(0,e.isSupportedTokenType)(l))throw new Error(`Tokens of type [${l}] are not supported.`);if(void 0!==o||void 0!==i||void 0!==r||void 0!==c)return{sessionId:t,webId:r,isLoggedIn:"true"===i,redirectUrl:a,refreshToken:c,issuer:u,clientAppId:o,clientAppSecret:s,tokenType:l}}async getAll(){throw new Error("Not implemented")}async clear(t){return r(t,this.storageUtility)}async register(t){throw new Error("Not implemented")}async getRegisteredSessionIdAll(){throw new Error("Not implemented")}async clearAll(){throw new Error("Not implemented")}}}}),Us=Kt({"../node_modules/@inrupt/solid-client-authn-browser/dist/login/oidc/incomingRedirectHandler/FallbackRedirectHandler.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.FallbackRedirectHandler=void 0;var e=Ms();t.FallbackRedirectHandler=class{async canHandle(t){try{return new URL(t),!0}catch(e){throw new Error(`[${t}] is not a valid URL, and cannot be used as a redirect URL: ${e}`)}}async handle(t){return(0,e.getUnauthenticatedSession)()}}}}),Ls=Kt({"../node_modules/@inrupt/solid-client-authn-browser/dist/logout/GeneralLogoutHandler.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{constructor(t){this.sessionInfoManager=t}async canHandle(){return!0}async handle(t){await this.sessionInfoManager.clear(t)}}}}),Bs=Kt({"../node_modules/@inrupt/solid-client-authn-browser/dist/login/oidc/incomingRedirectHandler/AuthCodeRedirectHandler.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.AuthCodeRedirectHandler=void 0;var e=js(),n=Is();t.AuthCodeRedirectHandler=class{constructor(t,e,n,i,r){this.storageUtility=t,this.sessionInfoManager=e,this.issuerConfigFetcher=n,this.clientRegistrar=i,this.tokerRefresher=r}async canHandle(t){try{const e=new URL(t);return null!==e.searchParams.get("code")&&null!==e.searchParams.get("state")}catch(e){throw new Error(`[${t}] is not a valid URL, and cannot be used as a redirect URL: ${e}`)}}async handle(t,i){if(!await this.canHandle(t))throw new Error(`AuthCodeRedirectHandler cannot handle [${t}]: it is missing one of [code, state].`);const r=new URL(t),o=r.searchParams.get("state"),s=await this.storageUtility.getForUser(o,"sessionId",{errorIfNull:!0}),{issuerConfig:a,codeVerifier:c,redirectUrl:u,dpop:l}=await(0,e.loadOidcContextFromStorage)(s,this.storageUtility,this.issuerConfigFetcher);if(void 0===c)throw new Error(`The code verifier for session ${s} is missing from storage.`);if(void 0===u)throw new Error(`The redirect URL for session ${s} is missing from storage.`);const h=await this.clientRegistrar.getClient({sessionId:s},a);let d;const f=Date.now();let p;l?(d=await(0,n.getDpopToken)(a,h,{grantType:"authorization_code",code:r.searchParams.get("code"),codeVerifier:c,redirectUrl:u}),window.localStorage.removeItem(`oidc.${o}`)):d=await(0,n.getBearerToken)(r.toString()),void 0!==d.refreshToken&&(p={sessionId:s,refreshToken:d.refreshToken,tokenRefresher:this.tokerRefresher});const v=await(0,e.buildAuthenticatedFetch)(fetch,d.accessToken,{dpopKey:d.dpopKey,refreshOptions:p,eventEmitter:i,expiresIn:d.expiresIn});await this.storageUtility.setForUser(s,{webId:d.webId,isLoggedIn:"true"},{secure:!0}),r.searchParams.delete("code"),await this.storageUtility.setForUser(s,{redirectUrl:r.toString()},{secure:!1});const g=await this.sessionInfoManager.get(s);if(!g)throw new Error(`Could not retrieve session: [${s}].`);return Object.assign(g,{fetch:v,expirationDate:"number"==typeof d.expiresIn?f+1e3*d.expiresIn:null})}}}}),Js=Kt({"../node_modules/@inrupt/solid-client-authn-browser/dist/login/oidc/AggregateRedirectHandler.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=js();t.default=class extends e.AggregateHandler{constructor(t){super(t)}}}}),$s=Kt({"../node_modules/@inrupt/solid-client-authn-browser/dist/storage/BrowserStorage.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{get storage(){return window.localStorage}async get(t){return this.storage.getItem(t)||void 0}async set(t,e){this.storage.setItem(t,e)}async delete(t){this.storage.removeItem(t)}}}}),Hs=Kt({"../node_modules/@inrupt/solid-client-authn-browser/dist/login/oidc/Redirector.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{redirect(t,e){e&&e.handleRedirect?e.handleRedirect(t):e&&e.redirectByReplacingState?window.history.replaceState({},"",t):window.location.href=t}}}}),zs=Kt({"../node_modules/@inrupt/solid-client-authn-browser/dist/login/oidc/ClientRegistrar.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Is();t.default=class{constructor(t){this.storageUtility=t}async getClient(t,n){const[i,r]=await Promise.all([this.storageUtility.getForUser(t.sessionId,"clientId",{secure:!1}),this.storageUtility.getForUser(t.sessionId,"clientSecret",{secure:!1})]);if(i)return{clientId:i,clientSecret:r,clientType:"dynamic"};try{const i=await(0,e.registerClient)(t,n),r={clientId:i.clientId};return i.clientSecret&&(r.clientSecret=i.clientSecret),i.idTokenSignedResponseAlg&&(r.idTokenSignedResponseAlg=i.idTokenSignedResponseAlg),await this.storageUtility.setForUser(t.sessionId,r,{secure:!1}),i}catch(t){throw new Error(`Client registration failed: [${t}]`)}}}}}),Ks=Kt({"../node_modules/@inrupt/solid-client-authn-browser/dist/login/oidc/incomingRedirectHandler/ErrorOidcHandler.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorOidcHandler=void 0;var e=js(),n=Ms();t.ErrorOidcHandler=class{async canHandle(t){try{return new URL(t).searchParams.has("error")}catch(e){throw new Error(`[${t}] is not a valid URL, and cannot be used as a redirect URL: ${e}`)}}async handle(t,i){if(void 0!==i){const n=new URL(t),r=n.searchParams.get("error"),o=n.searchParams.get("error_description");i.emit(e.EVENTS.ERROR,r,o)}return(0,n.getUnauthenticatedSession)()}}}}),Ws=Kt({"../node_modules/@inrupt/solid-client-authn-browser/dist/login/oidc/refresh/TokenRefresher.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=js(),n=Is();t.default=class{constructor(t,e,n){this.storageUtility=t,this.issuerConfigFetcher=e,this.clientRegistrar=n}async refresh(t,i,r,o){const s=await(0,e.loadOidcContextFromStorage)(t,this.storageUtility,this.issuerConfigFetcher),a=await this.clientRegistrar.getClient({sessionId:t},s.issuerConfig);if(void 0===i)throw new Error(`Session [${t}] has no refresh token to allow it to refresh its access token.`);if(s.dpop&&void 0===r)throw new Error(`For session [${t}], the key bound to the DPoP access token must be provided to refresh said access token.`);const c=await(0,n.refresh)(i,s.issuerConfig,a,r);return void 0!==c.refreshToken&&(null==o||o.emit(e.EVENTS.NEW_REFRESH_TOKEN,c.refreshToken),await this.storageUtility.setForUser(t,{refreshToken:c.refreshToken})),c}}}}),qs=Kt({"../node_modules/@inrupt/solid-client-authn-browser/dist/dependencies.js"(t){var e=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.getClientAuthenticationWithDependencies=void 0;var n=js(),i=e(Cs()),r=e(Ts()),o=e(Os()),s=e(Ns()),a=e(Ds()),c=Us(),u=e(Ls()),l=Ms(),h=Bs(),d=e(Js()),f=e($s()),p=e(Hs()),v=e(zs()),g=Ks(),m=e(Ws());t.getClientAuthenticationWithDependencies=function(t){const e=new n.InMemoryStorage,w=t.secureStorage||e,b=t.insecureStorage||new f.default,y=new i.default(w,b),x=new a.default(y),k=new v.default(y),E=new l.SessionInfoManager(y),S=new m.default(y,x,k),F=new o.default(y,new s.default(y,new p.default),x,k),A=new d.default([new g.ErrorOidcHandler,new h.AuthCodeRedirectHandler(y,E,x,k,S),new c.FallbackRedirectHandler]);return new r.default(F,A,new u.default(E),E,x)}}}),Vs=Kt({"../node_modules/@inrupt/solid-client-authn-browser/dist/constant.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.KEY_CURRENT_URL=t.KEY_CURRENT_SESSION=void 0;var e=js();t.KEY_CURRENT_SESSION=`${e.SOLID_CLIENT_AUTHN_KEY_PREFIX}currentSession`,t.KEY_CURRENT_URL=`${e.SOLID_CLIENT_AUTHN_KEY_PREFIX}currentUrl`}}),Gs=Kt({"../node_modules/@inrupt/solid-client-authn-browser/dist/Session.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Session=t.silentlyAuthenticate=void 0;var e=Yt(),n=js(),i=(Ss(),Gt(Es)),r=qs(),o=Vs();async function s(t,e,n){var i;const r=await e.validateCurrentSession(t);return null!==r&&(window.localStorage.setItem(o.KEY_CURRENT_URL,window.location.href),await e.login({sessionId:t,prompt:"none",oidcIssuer:r.issuer,redirectUrl:r.redirectUrl,clientId:r.clientAppId,clientSecret:r.clientAppSecret,tokenType:null!==(i=r.tokenType)&&void 0!==i?i:"DPoP"},n),!0)}t.silentlyAuthenticate=s,t.Session=class extends e.EventEmitter{constructor(t={},e){super(),this.tokenRequestInProgress=!1,this.login=async t=>{var e;return await this.clientAuthentication.login({sessionId:this.info.sessionId,...t,tokenType:null!==(e=t.tokenType)&&void 0!==e?e:"DPoP"},this),new Promise((()=>{}))},this.fetch=async(t,e)=>this.clientAuthentication.fetch(t,e),this.internalLogout=async t=>{window.localStorage.removeItem(o.KEY_CURRENT_SESSION),await this.clientAuthentication.logout(this.info.sessionId),this.info.isLoggedIn=!1,t&&this.emit(n.EVENTS.LOGOUT)},this.logout=async()=>this.internalLogout(!0),this.handleIncomingRedirect=async(t={})=>{var e;if(this.info.isLoggedIn)return this.info;if(this.tokenRequestInProgress)return;const i="string"==typeof t?{url:t}:t,r=null!==(e=i.url)&&void 0!==e?e:window.location.href;this.tokenRequestInProgress=!0;const a=await this.clientAuthentication.handleIncomingRedirect(r,this);if(function(t){return!!(null==t?void 0:t.isLoggedIn)}(a)){this.setSessionInfo(a);const t=window.localStorage.getItem(o.KEY_CURRENT_URL);null===t?this.emit(n.EVENTS.LOGIN):(window.localStorage.removeItem(o.KEY_CURRENT_URL),this.emit(n.EVENTS.SESSION_RESTORED,t))}else if(!0===i.restorePreviousSession){const t=window.localStorage.getItem(o.KEY_CURRENT_SESSION);if(null!==t&&await s(t,this.clientAuthentication,this))return new Promise((()=>{}))}return this.tokenRequestInProgress=!1,a},this.clientAuthentication=t.clientAuthentication?t.clientAuthentication:(0,r.getClientAuthenticationWithDependencies)(t.secureStorage&&t.insecureStorage?{secureStorage:t.secureStorage,insecureStorage:t.insecureStorage}:{}),this.info=t.sessionInfo?{sessionId:t.sessionInfo.sessionId,isLoggedIn:!1,webId:t.sessionInfo.webId}:{sessionId:null!=e?e:(0,i.v4)(),isLoggedIn:!1},this.on(n.EVENTS.LOGIN,(()=>window.localStorage.setItem(o.KEY_CURRENT_SESSION,this.info.sessionId))),this.on(n.EVENTS.SESSION_EXPIRED,(()=>this.internalLogout(!1))),this.on(n.EVENTS.ERROR,(()=>this.internalLogout(!1)))}onLogin(t){this.on(n.EVENTS.LOGIN,t)}onLogout(t){this.on(n.EVENTS.LOGOUT,t)}onError(t){this.on(n.EVENTS.ERROR,t)}onSessionRestore(t){this.on(n.EVENTS.SESSION_RESTORED,t)}onSessionExpiration(t){this.on(n.EVENTS.SESSION_EXPIRED,t)}setSessionInfo(t){this.info.isLoggedIn=t.isLoggedIn,this.info.webId=t.webId,this.info.sessionId=t.sessionId,this.info.expirationDate=t.expirationDate,this.on(n.EVENTS.SESSION_EXTENDED,(t=>{this.info.expirationDate=Date.now()+1e3*t}))}}}}),Xs=Kt({"../node_modules/@inrupt/solid-client-authn-browser/dist/defaultSession.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.onSessionRestore=t.onLogout=t.onLogin=t.handleIncomingRedirect=t.logout=t.login=t.fetch=t.getDefaultSession=void 0;var e,n=Gs();function i(){return void 0===e&&(e=new n.Session),e}t.getDefaultSession=i,t.fetch=(...t)=>i().fetch(...t),t.login=(...t)=>i().login(...t),t.logout=(...t)=>i().logout(...t),t.handleIncomingRedirect=(...t)=>i().handleIncomingRedirect(...t),t.onLogin=(...t)=>i().onLogin(...t),t.onLogout=(...t)=>i().onLogout(...t),t.onSessionRestore=(...t)=>i().onSessionRestore(...t)}}),Ys=Kt({"../node_modules/@inrupt/solid-client-authn-browser/dist/index.js"(t){var e=t&&t.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(e,n);r&&!("get"in r?!e.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,i,r)}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),n=t&&t.__exportStar||function(t,n){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(n,i)||e(n,t,i)};Object.defineProperty(t,"__esModule",{value:!0}),t.InMemoryStorage=t.ConfigurationError=t.NotImplementedError=t.getClientAuthenticationWithDependencies=t.Session=void 0;var i=Gs();Object.defineProperty(t,"Session",{enumerable:!0,get:function(){return i.Session}});var r=qs();Object.defineProperty(t,"getClientAuthenticationWithDependencies",{enumerable:!0,get:function(){return r.getClientAuthenticationWithDependencies}}),n(Xs(),t);var o=js();Object.defineProperty(t,"NotImplementedError",{enumerable:!0,get:function(){return o.NotImplementedError}}),Object.defineProperty(t,"ConfigurationError",{enumerable:!0,get:function(){return o.ConfigurationError}}),Object.defineProperty(t,"InMemoryStorage",{enumerable:!0,get:function(){return o.InMemoryStorage}})}}),Zs=Kt({"../node_modules/rdf-canonize/lib/IdentifierIssuer.js"(t,e){e.exports=class t{constructor(t,e=new Map,n=0){this.prefix=t,this._existing=e,this.counter=n}clone(){const{prefix:e,_existing:n,counter:i}=this;return new t(e,new Map(n),i)}getId(t){const e=t&&this._existing.get(t);if(e)return e;const n=this.prefix+this.counter;return this.counter++,t&&this._existing.set(t,n),n}hasId(t){return this._existing.has(t)}getOldIds(){return[...this._existing.keys()]}}}}),Qs=Kt({"../node_modules/setimmediate/setImmediate.js"(t){!function(t){if(!t.setImmediate){var e,n,i,r,o,s=1,a={},c=!1,u=t.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(t);l=l&&l.setTimeout?l:t,"[object process]"==={}.toString.call(t.process)?e=function(t){process.nextTick((function(){d(t)}))}:function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?(r="setImmediate$"+Math.random()+"$",o=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(r)&&d(+e.data.slice(r.length))},t.addEventListener?t.addEventListener("message",o,!1):t.attachEvent("onmessage",o),e=function(e){t.postMessage(r+e,"*")}):t.MessageChannel?((i=new MessageChannel).port1.onmessage=function(t){d(t.data)},e=function(t){i.port2.postMessage(t)}):u&&"onreadystatechange"in u.createElement("script")?(n=u.documentElement,e=function(t){var e=u.createElement("script");e.onreadystatechange=function(){d(t),e.onreadystatechange=null,n.removeChild(e),e=null},n.appendChild(e)}):e=function(t){setTimeout(d,0,t)},l.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var n=new Array(arguments.length-1),i=0;i<n.length;i++)n[i]=arguments[i+1];var r={callback:t,args:n};return a[s]=r,e(s),s++},l.clearImmediate=h}function h(t){delete a[t]}function d(t){if(c)setTimeout(d,0,t);else{var e=a[t];if(e){c=!0;try{!function(t){var e=t.callback,n=t.args;switch(n.length){case 0:e();break;case 1:e(n[0]);break;case 2:e(n[0],n[1]);break;case 3:e(n[0],n[1],n[2]);break;default:e.apply(void 0,n)}}(e)}finally{h(t),c=!1}}}}}("undefined"==typeof self?"undefined"==typeof global?t:global:self)}}),ta=Kt({"../node_modules/rdf-canonize/lib/MessageDigest-browser.js"(t,e){Qs();var n=self.crypto||self.msCrypto;e.exports=class{constructor(t){if(!n||!n.subtle)throw new Error("crypto.subtle not found.");if("sha256"===t)this.algorithm={name:"SHA-256"};else{if("sha1"!==t)throw new Error(`Unsupported algorithm "${t}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(t){this._content+=t}async digest(){const t=(new TextEncoder).encode(this._content),e=new Uint8Array(await n.subtle.digest(this.algorithm,t));let i="";for(let t=0;t<e.length;++t)i+=e[t].toString(16).padStart(2,"0");return i}}}}),ea=Kt({"../node_modules/rdf-canonize/lib/Permuter.js"(t,e){e.exports=class{constructor(t){this.current=t.sort(),this.done=!1,this.dir=new Map;for(let e=0;e<t.length;++e)this.dir.set(t[e],!0)}hasNext(){return!this.done}next(){const{current:t,dir:e}=this,n=t.slice();let i=null,r=0;const o=t.length;for(let n=0;n<o;++n){const s=t[n],a=e.get(s);(null===i||s>i)&&(a&&n>0&&s>t[n-1]||!a&&n<o-1&&s>t[n+1])&&(i=s,r=n)}if(null===i)this.done=!0;else{const n=e.get(i)?r-1:r+1;t[r]=t[n],t[n]=i;for(const n of t)n>i&&e.set(n,!e.get(n))}return n}}}}),na=Kt({"../node_modules/rdf-canonize/lib/NQuads.js"(t,e){var n="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",i="http://www.w3.org/2001/XMLSchema#string",r="NamedNode",o="BlankNode",s="Literal",a="DefaultGraph",c={};c.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,c.empty=new RegExp("^[ \\t]*$"),c.quad=new RegExp('^[ \\t]*(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_0-9])(?:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀.])*(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀]))?))[ \\t]+(?:<([^:]+:[^>]*)>)[ \\t]+(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_0-9])(?:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀.])*(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀]))?)|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^(?:<([^:]+:[^>]*)>))|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))[ \\t]*(?:\\.|(?:(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_0-9])(?:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀.])*(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀]))?))[ \\t]*\\.))[ \\t]*$'),e.exports=class t{static parse(t){const e=[],u={},h=t.split(c.eoln);let d=0;for(const t of h){if(d++,c.empty.test(t))continue;const h=t.match(c.quad);if(null===h)throw new Error("N-Quads parse error on line "+d+".");const v={subject:null,predicate:null,object:null,graph:null};if(v.subject=void 0!==h[1]?{termType:r,value:h[1]}:{termType:o,value:h[2]},v.predicate={termType:r,value:h[3]},void 0!==h[4]?v.object={termType:r,value:h[4]}:void 0!==h[5]?v.object={termType:o,value:h[5]}:(v.object={termType:s,value:void 0,datatype:{termType:r}},void 0!==h[7]?v.object.datatype.value=h[7]:void 0!==h[8]?(v.object.datatype.value=n,v.object.language=h[8]):v.object.datatype.value=i,v.object.value=h[6].replace(l,(function(t,e,n,i){if(e)switch(e){case"t":return"\t";case"b":return"\b";case"n":return"\n";case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(n)return String.fromCharCode(parseInt(n,16));if(i)throw new Error("Unsupported U escape")}))),v.graph=void 0!==h[9]?{termType:r,value:h[9]}:void 0!==h[10]?{termType:o,value:h[10]}:{termType:a,value:""},v.graph.value in u){let t=!0;const n=u[v.graph.value];for(const e of n)if((f=e).subject.termType===(p=v).subject.termType&&f.object.termType===p.object.termType&&f.subject.value===p.subject.value&&f.predicate.value===p.predicate.value&&f.object.value===p.object.value&&(f.object.termType!==s||f.object.datatype.termType===p.object.datatype.termType&&f.object.language===p.object.language&&f.object.datatype.value===p.object.datatype.value)){t=!1;break}t&&(n.push(v),e.push(v))}else u[v.graph.value]=[v],e.push(v)}var f,p;return e}static serialize(e){Array.isArray(e)||(e=t.legacyDatasetToQuads(e));const n=[];for(const i of e)n.push(t.serializeQuad(i));return n.sort().join("")}static serializeQuadComponents(t,e,s,a){let c="";return c+=t.termType===r?`<${t.value}>`:`${t.value}`,c+=` <${e.value}> `,s.termType===r?c+=`<${s.value}>`:s.termType===o?c+=s.value:(c+=`"${function(t){return t.replace(u,(function(t){switch(t){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}}))}(s.value)}"`,s.datatype.value===n?s.language&&(c+=`@${s.language}`):s.datatype.value!==i&&(c+=`^^<${s.datatype.value}>`)),a.termType===r?c+=` <${a.value}>`:a.termType===o&&(c+=` ${a.value}`),c+=" .\n",c}static serializeQuad(e){return t.serializeQuadComponents(e.subject,e.predicate,e.object,e.graph)}static legacyDatasetToQuads(t){const e=[],c={"blank node":o,IRI:r,literal:s};for(const u in t)t[u].forEach((t=>{const l={};for(const e in t){const o=t[e],a={termType:c[o.type],value:o.value};a.termType===s&&(a.datatype={termType:r},"datatype"in o&&(a.datatype.value=o.datatype),"language"in o?("datatype"in o||(a.datatype.value=n),a.language=o.language):"datatype"in o||(a.datatype.value=i)),l[e]=a}l.graph="@default"===u?{termType:a,value:""}:{termType:u.startsWith("_:")?o:r,value:u},e.push(l)}));return e}};var u=/["\\\n\r]/g,l=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g}}),ia=Kt({"../node_modules/rdf-canonize/lib/URDNA2015.js"(t,e){var n=Zs(),i=ta(),r=ea(),o=na();function s(t,e){return t.hash<e.hash?-1:t.hash>e.hash?1:0}e.exports=class{constructor({createMessageDigest:t=(()=>new i("sha256")),maxDeepIterations:e=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new n("_:c14n"),this.createMessageDigest=t,this.maxDeepIterations=e,this.quads=null,this.deepIterations=null}async main(t){this.deepIterations=new Map,this.quads=t;for(const e of t)this._addBlankNodeQuadInfo({quad:e,component:e.subject}),this._addBlankNodeQuadInfo({quad:e,component:e.object}),this._addBlankNodeQuadInfo({quad:e,component:e.graph});const e=new Map,i=[...this.blankNodeInfo.keys()];let r=0;for(const t of i)++r%100==0&&await this._yield(),await this._hashAndTrackBlankNode({id:t,hashToBlankNodes:e});const a=[...e.keys()].sort(),c=[];for(const t of a){const n=e.get(t);n.length>1?c.push(n):this.canonicalIssuer.getId(n[0])}for(const t of c){const e=[];for(const i of t){if(this.canonicalIssuer.hasId(i))continue;const t=new n("_:b");t.getId(i);const r=await this.hashNDegreeQuads(i,t);e.push(r)}e.sort(s);for(const t of e){const e=t.issuer.getOldIds();for(const t of e)this.canonicalIssuer.getId(t)}}const u=[];for(const t of this.quads){const e=o.serializeQuadComponents(this._componentWithCanonicalId(t.subject),t.predicate,this._componentWithCanonicalId(t.object),this._componentWithCanonicalId(t.graph));u.push(e)}return u.sort(),u.join("")}async hashFirstDegreeQuads(t){const e=[],n=this.blankNodeInfo.get(t),i=n.quads;for(const n of i){const i={subject:null,predicate:n.predicate,object:null,graph:null};i.subject=this.modifyFirstDegreeComponent(t,n.subject,"subject"),i.object=this.modifyFirstDegreeComponent(t,n.object,"object"),i.graph=this.modifyFirstDegreeComponent(t,n.graph,"graph"),e.push(o.serializeQuad(i))}e.sort();const r=this.createMessageDigest();for(const t of e)r.update(t);return n.hash=await r.digest(),n.hash}async hashRelatedBlankNode(t,e,n,i){let r;r=this.canonicalIssuer.hasId(t)?this.canonicalIssuer.getId(t):n.hasId(t)?n.getId(t):this.blankNodeInfo.get(t).hash;const o=this.createMessageDigest();return o.update(i),"g"!==i&&o.update(this.getRelatedPredicate(e)),o.update(r),o.digest()}async hashNDegreeQuads(t,e){const n=this.deepIterations.get(t)||0;if(n>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(t,n+1);const i=this.createMessageDigest(),o=await this.createHashToRelated(t,e),s=[...o.keys()].sort();for(const t of s){i.update(t);let n,s="";const a=new r(o.get(t));let c=0;for(;a.hasNext();){const t=a.next();++c%3==0&&await this._yield();let i=e.clone(),r="";const o=[];let u=!1;for(const e of t)if(this.canonicalIssuer.hasId(e)?r+=this.canonicalIssuer.getId(e):(i.hasId(e)||o.push(e),r+=i.getId(e)),0!==s.length&&r>s){u=!0;break}if(!u){for(const t of o){const e=await this.hashNDegreeQuads(t,i);if(r+=i.getId(t),r+=`<${e.hash}>`,i=e.issuer,0!==s.length&&r>s){u=!0;break}}u||(0===s.length||r<s)&&(s=r,n=i)}}i.update(s),e=n}return{hash:await i.digest(),issuer:e}}modifyFirstDegreeComponent(t,e){return"BlankNode"!==e.termType?e:{termType:"BlankNode",value:e.value===t?"_:a":"_:z"}}getRelatedPredicate(t){return`<${t.predicate.value}>`}async createHashToRelated(t,e){const n=new Map,i=this.blankNodeInfo.get(t).quads;let r=0;for(const o of i)++r%100==0&&await this._yield(),await Promise.all([this._addRelatedBlankNodeHash({quad:o,component:o.subject,position:"s",id:t,issuer:e,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:o,component:o.object,position:"o",id:t,issuer:e,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:o,component:o.graph,position:"g",id:t,issuer:e,hashToRelated:n})]);return n}async _hashAndTrackBlankNode({id:t,hashToBlankNodes:e}){const n=await this.hashFirstDegreeQuads(t),i=e.get(n);i?i.push(t):e.set(n,[t])}_addBlankNodeQuadInfo({quad:t,component:e}){if("BlankNode"!==e.termType)return;const n=e.value,i=this.blankNodeInfo.get(n);i?i.quads.add(t):this.blankNodeInfo.set(n,{quads:new Set([t]),hash:null})}async _addRelatedBlankNodeHash({quad:t,component:e,position:n,id:i,issuer:r,hashToRelated:o}){if("BlankNode"!==e.termType||e.value===i)return;const s=e.value,a=await this.hashRelatedBlankNode(s,t,r,n),c=o.get(a);c?c.push(s):o.set(a,[s])}_componentWithCanonicalId(t){return"BlankNode"!==t.termType||t.value.startsWith(this.canonicalIssuer.prefix)?t:{termType:"BlankNode",value:this.canonicalIssuer.getId(t.value)}}async _yield(){return new Promise((t=>setImmediate(t)))}}}}),ra=Kt({"../node_modules/rdf-canonize/lib/URGNA2012.js"(t,e){var n=ta(),i=ia();e.exports=class extends i{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new n("sha1")}modifyFirstDegreeComponent(t,e,n){return"BlankNode"!==e.termType?e:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:e.value===t?"_:a":"_:z"}}getRelatedPredicate(t){return t.predicate.value}async createHashToRelated(t,e){const n=new Map,i=this.blankNodeInfo.get(t).quads;let r=0;for(const o of i){let i,s;if("BlankNode"===o.subject.termType&&o.subject.value!==t)s=o.subject.value,i="p";else{if("BlankNode"!==o.object.termType||o.object.value===t)continue;s=o.object.value,i="r"}++r%100==0&&await this._yield();const a=await this.hashRelatedBlankNode(s,o,e,i),c=n.get(a);c?c.push(s):n.set(a,[s])}return n}}}}),oa=Kt({"../node_modules/rdf-canonize/lib/URDNA2015Sync.js"(t,e){var n=Zs(),i=ta(),r=ea(),o=na();function s(t,e){return t.hash<e.hash?-1:t.hash>e.hash?1:0}e.exports=class{constructor({createMessageDigest:t=(()=>new i("sha256")),maxDeepIterations:e=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new n("_:c14n"),this.createMessageDigest=t,this.maxDeepIterations=e,this.quads=null,this.deepIterations=null}main(t){this.deepIterations=new Map,this.quads=t;for(const e of t)this._addBlankNodeQuadInfo({quad:e,component:e.subject}),this._addBlankNodeQuadInfo({quad:e,component:e.object}),this._addBlankNodeQuadInfo({quad:e,component:e.graph});const e=new Map,i=[...this.blankNodeInfo.keys()];for(const t of i)this._hashAndTrackBlankNode({id:t,hashToBlankNodes:e});const r=[...e.keys()].sort(),a=[];for(const t of r){const n=e.get(t);n.length>1?a.push(n):this.canonicalIssuer.getId(n[0])}for(const t of a){const e=[];for(const i of t){if(this.canonicalIssuer.hasId(i))continue;const t=new n("_:b");t.getId(i);const r=this.hashNDegreeQuads(i,t);e.push(r)}e.sort(s);for(const t of e){const e=t.issuer.getOldIds();for(const t of e)this.canonicalIssuer.getId(t)}}const c=[];for(const t of this.quads){const e=o.serializeQuadComponents(this._componentWithCanonicalId({component:t.subject}),t.predicate,this._componentWithCanonicalId({component:t.object}),this._componentWithCanonicalId({component:t.graph}));c.push(e)}return c.sort(),c.join("")}hashFirstDegreeQuads(t){const e=[],n=this.blankNodeInfo.get(t),i=n.quads;for(const n of i){const i={subject:null,predicate:n.predicate,object:null,graph:null};i.subject=this.modifyFirstDegreeComponent(t,n.subject,"subject"),i.object=this.modifyFirstDegreeComponent(t,n.object,"object"),i.graph=this.modifyFirstDegreeComponent(t,n.graph,"graph"),e.push(o.serializeQuad(i))}e.sort();const r=this.createMessageDigest();for(const t of e)r.update(t);return n.hash=r.digest(),n.hash}hashRelatedBlankNode(t,e,n,i){let r;r=this.canonicalIssuer.hasId(t)?this.canonicalIssuer.getId(t):n.hasId(t)?n.getId(t):this.blankNodeInfo.get(t).hash;const o=this.createMessageDigest();return o.update(i),"g"!==i&&o.update(this.getRelatedPredicate(e)),o.update(r),o.digest()}hashNDegreeQuads(t,e){const n=this.deepIterations.get(t)||0;if(n>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(t,n+1);const i=this.createMessageDigest(),o=this.createHashToRelated(t,e),s=[...o.keys()].sort();for(const t of s){i.update(t);let n,s="";const a=new r(o.get(t));for(;a.hasNext();){const t=a.next();let i=e.clone(),r="";const o=[];let c=!1;for(const e of t)if(this.canonicalIssuer.hasId(e)?r+=this.canonicalIssuer.getId(e):(i.hasId(e)||o.push(e),r+=i.getId(e)),0!==s.length&&r>s){c=!0;break}if(!c){for(const t of o){const e=this.hashNDegreeQuads(t,i);if(r+=i.getId(t),r+=`<${e.hash}>`,i=e.issuer,0!==s.length&&r>s){c=!0;break}}c||(0===s.length||r<s)&&(s=r,n=i)}}i.update(s),e=n}return{hash:i.digest(),issuer:e}}modifyFirstDegreeComponent(t,e){return"BlankNode"!==e.termType?e:{termType:"BlankNode",value:e.value===t?"_:a":"_:z"}}getRelatedPredicate(t){return`<${t.predicate.value}>`}createHashToRelated(t,e){const n=new Map,i=this.blankNodeInfo.get(t).quads;for(const r of i)this._addRelatedBlankNodeHash({quad:r,component:r.subject,position:"s",id:t,issuer:e,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:r,component:r.object,position:"o",id:t,issuer:e,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:r,component:r.graph,position:"g",id:t,issuer:e,hashToRelated:n});return n}_hashAndTrackBlankNode({id:t,hashToBlankNodes:e}){const n=this.hashFirstDegreeQuads(t),i=e.get(n);i?i.push(t):e.set(n,[t])}_addBlankNodeQuadInfo({quad:t,component:e}){if("BlankNode"!==e.termType)return;const n=e.value,i=this.blankNodeInfo.get(n);i?i.quads.add(t):this.blankNodeInfo.set(n,{quads:new Set([t]),hash:null})}_addRelatedBlankNodeHash({quad:t,component:e,position:n,id:i,issuer:r,hashToRelated:o}){if("BlankNode"!==e.termType||e.value===i)return;const s=e.value,a=this.hashRelatedBlankNode(s,t,r,n),c=o.get(a);c?c.push(s):o.set(a,[s])}_componentWithCanonicalId({component:t}){return"BlankNode"!==t.termType||t.value.startsWith(this.canonicalIssuer.prefix)?t:{termType:"BlankNode",value:this.canonicalIssuer.getId(t.value)}}}}}),sa=Kt({"../node_modules/rdf-canonize/lib/URGNA2012Sync.js"(t,e){var n=ta(),i=oa();e.exports=class extends i{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new n("sha1")}modifyFirstDegreeComponent(t,e,n){return"BlankNode"!==e.termType?e:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:e.value===t?"_:a":"_:z"}}getRelatedPredicate(t){return t.predicate.value}createHashToRelated(t,e){const n=new Map,i=this.blankNodeInfo.get(t).quads;for(const r of i){let i,o;if("BlankNode"===r.subject.termType&&r.subject.value!==t)o=r.subject.value,i="p";else{if("BlankNode"!==r.object.termType||r.object.value===t)continue;o=r.object.value,i="r"}const s=this.hashRelatedBlankNode(o,r,e,i),a=n.get(s);a?a.push(o):n.set(s,[o])}return n}}}}),aa=Kt({"(disabled):rdf-canonize-native"(){}}),ca=Kt({"../node_modules/rdf-canonize/lib/index.js"(t){var e,n=ia(),i=ra(),r=oa(),o=sa();try{e=aa()}catch(t){}t.NQuads=na(),t.IdentifierIssuer=Zs(),t._rdfCanonizeNative=function(t){return t&&(e=t),e},t.canonize=async function(r,o){if(Array.isArray(r)||(r=t.NQuads.legacyDatasetToQuads(r)),o.useNative){if(!e)throw new Error("rdf-canonize-native not available");if(o.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return new Promise(((t,n)=>e.canonize(r,o,((e,i)=>e?n(e):t(i)))))}if("URDNA2015"===o.algorithm)return new n(o).main(r);if("URGNA2012"===o.algorithm){if(o.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new i(o).main(r)}if(!("algorithm"in o))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+o.algorithm)},t._canonizeSync=function(n,i){if(Array.isArray(n)||(n=t.NQuads.legacyDatasetToQuads(n)),i.useNative){if(!e)throw new Error("rdf-canonize-native not available");if(i.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return e.canonizeSync(n,i)}if("URDNA2015"===i.algorithm)return new r(i).main(n);if("URGNA2012"===i.algorithm){if(i.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new o(i).main(n)}if(!("algorithm"in i))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+i.algorithm)}}}),ua=Kt({"../node_modules/rdf-canonize/index.js"(t,e){e.exports=ca()}}),la=Kt({"../node_modules/jsonld/lib/types.js"(t,e){var n={};e.exports=n,n.isArray=Array.isArray,n.isBoolean=t=>"boolean"==typeof t||"[object Boolean]"===Object.prototype.toString.call(t),n.isDouble=t=>n.isNumber(t)&&(-1!==String(t).indexOf(".")||Math.abs(t)>=1e21),n.isEmptyObject=t=>n.isObject(t)&&0===Object.keys(t).length,n.isNumber=t=>"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t),n.isNumeric=t=>!isNaN(parseFloat(t))&&isFinite(t),n.isObject=t=>"[object Object]"===Object.prototype.toString.call(t),n.isString=t=>"string"==typeof t||"[object String]"===Object.prototype.toString.call(t),n.isUndefined=t=>void 0===t}}),ha=Kt({"../node_modules/jsonld/lib/graphTypes.js"(t,e){var n=la(),i={};e.exports=i,i.isSubject=t=>!(!n.isObject(t)||"@value"in t||"@set"in t||"@list"in t)&&(Object.keys(t).length>1||!("@id"in t)),i.isSubjectReference=t=>n.isObject(t)&&1===Object.keys(t).length&&"@id"in t,i.isValue=t=>n.isObject(t)&&"@value"in t,i.isList=t=>n.isObject(t)&&"@list"in t,i.isGraph=t=>n.isObject(t)&&"@graph"in t&&1===Object.keys(t).filter((t=>"@id"!==t&&"@index"!==t)).length,i.isSimpleGraph=t=>i.isGraph(t)&&!("@id"in t),i.isBlankNode=t=>!!n.isObject(t)&&("@id"in t?0===t["@id"].indexOf("_:"):0===Object.keys(t).length||!("@value"in t||"@set"in t||"@list"in t))}}),da=Kt({"../node_modules/jsonld/lib/JsonLdError.js"(t,e){e.exports=class extends Error{constructor(t="An unspecified JSON-LD error occurred.",e="jsonld.Error",n={}){super(t),this.name=e,this.message=t,this.details=n}}}}),fa=Kt({"../node_modules/jsonld/lib/util.js"(t,e){var n=ha(),i=la(),r=ua().IdentifierIssuer,o=da(),s=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,a=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,c=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,u="application/ld+json, application/json",l={};function h(t,e){if(i.isArray(e))for(let n=0;n<e.length;++n)e[n]=h(t,e[n]);else if(n.isList(e))e["@list"]=h(t,e["@list"]);else if(i.isObject(e)){n.isBlankNode(e)&&(e["@id"]=t.getId(e["@id"]));const i=Object.keys(e).sort();for(let n=0;n<i.length;++n){const r=i[n];"@id"!==r&&(e[r]=h(t,e[r]))}}return e}e.exports=l,l.IdentifierIssuer=r,l.clone=function(t){if(t&&"object"==typeof t){let e;if(i.isArray(t)){e=[];for(let n=0;n<t.length;++n)e[n]=l.clone(t[n])}else if(t instanceof Map){e=new Map;for(const[n,i]of t)e.set(n,l.clone(i))}else if(t instanceof Set){e=new Set;for(const n of t)e.add(l.clone(n))}else if(i.isObject(t)){e={};for(const n in t)e[n]=l.clone(t[n])}else e=t.toString();return e}return t},l.asArray=function(t){return Array.isArray(t)?t:[t]},l.buildHeaders=(t={})=>{if(Object.keys(t).some((t=>"accept"===t.toLowerCase())))throw new RangeError('Accept header may not be specified; only "'+u+'" is supported.');return Object.assign({Accept:u},t)},l.parseLinkHeader=t=>{const e={},n=t.match(s);for(let t=0;t<n.length;++t){let i=n[t].match(a);if(!i)continue;const r={target:i[1]},o=i[2];for(;i=c.exec(o);)r[i[1]]=void 0===i[2]?i[3]:i[2];const s=r.rel||"";Array.isArray(e[s])?e[s].push(r):e[s]=e.hasOwnProperty(s)?[e[s],r]:r}return e},l.validateTypeValue=(t,e)=>{if(!(i.isString(t)||i.isArray(t)&&t.every((t=>i.isString(t))))){if(e&&i.isObject(t))switch(Object.keys(t).length){case 0:return;case 1:if("@default"in t&&l.asArray(t["@default"]).every((t=>i.isString(t))))return}throw new o('Invalid JSON-LD syntax; "@type" value must a string, an array of strings, an empty object, or a default object.',"jsonld.SyntaxError",{code:"invalid type value",value:t})}},l.hasProperty=(t,e)=>{if(t.hasOwnProperty(e)){const n=t[e];return!i.isArray(n)||n.length>0}return!1},l.hasValue=(t,e,r)=>{if(l.hasProperty(t,e)){let o=t[e];const s=n.isList(o);if(i.isArray(o)||s){s&&(o=o["@list"]);for(let t=0;t<o.length;++t)if(l.compareValues(r,o[t]))return!0}else if(!i.isArray(r))return l.compareValues(r,o)}return!1},l.addValue=(t,e,n,r)=>{if("propertyIsArray"in(r=r||{})||(r.propertyIsArray=!1),"valueIsArray"in r||(r.valueIsArray=!1),"allowDuplicate"in r||(r.allowDuplicate=!0),"prependValue"in r||(r.prependValue=!1),r.valueIsArray)t[e]=n;else if(i.isArray(n)){0===n.length&&r.propertyIsArray&&!t.hasOwnProperty(e)&&(t[e]=[]),r.prependValue&&(n=n.concat(t[e]),t[e]=[]);for(let i=0;i<n.length;++i)l.addValue(t,e,n[i],r)}else if(t.hasOwnProperty(e)){const o=!r.allowDuplicate&&l.hasValue(t,e,n);i.isArray(t[e])||o&&!r.propertyIsArray||(t[e]=[t[e]]),o||(r.prependValue?t[e].unshift(n):t[e].push(n))}else t[e]=r.propertyIsArray?[n]:n},l.getValues=(t,e)=>[].concat(t[e]||[]),l.removeProperty=(t,e)=>{delete t[e]},l.removeValue=(t,e,n,i)=>{"propertyIsArray"in(i=i||{})||(i.propertyIsArray=!1);const r=l.getValues(t,e).filter((t=>!l.compareValues(t,n)));0===r.length?l.removeProperty(t,e):t[e]=1!==r.length||i.propertyIsArray?r:r[0]},l.relabelBlankNodes=(t,e)=>h((e=e||{}).issuer||new r("_:b"),t),l.compareValues=(t,e)=>t===e||!(!n.isValue(t)||!n.isValue(e)||t["@value"]!==e["@value"]||t["@type"]!==e["@type"]||t["@language"]!==e["@language"]||t["@index"]!==e["@index"])||!!(i.isObject(t)&&"@id"in t&&i.isObject(e)&&"@id"in e)&&t["@id"]===e["@id"],l.compareShortestLeast=(t,e)=>t.length<e.length?-1:e.length<t.length?1:t===e?0:t<e?-1:1}}),pa=Kt({"../node_modules/jsonld/lib/constants.js"(t,e){var n="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i="http://www.w3.org/2001/XMLSchema#";e.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:n,RDF_LIST:n+"List",RDF_FIRST:n+"first",RDF_REST:n+"rest",RDF_NIL:n+"nil",RDF_TYPE:n+"type",RDF_PLAIN_LITERAL:n+"PlainLiteral",RDF_XML_LITERAL:n+"XMLLiteral",RDF_JSON_LITERAL:n+"JSON",RDF_OBJECT:n+"object",RDF_LANGSTRING:n+"langString",XSD:i,XSD_BOOLEAN:i+"boolean",XSD_DOUBLE:i+"double",XSD_INTEGER:i+"integer",XSD_STRING:i+"string"}}}),va=Kt({"../node_modules/jsonld/lib/RequestQueue.js"(t,e){e.exports=class{constructor(){this._requests={}}wrapLoader(t){const e=this;return e._loader=t,function(){return e.add.apply(e,arguments)}}async add(t){let e=this._requests[t];if(e)return Promise.resolve(e);e=this._requests[t]=this._loader(t);try{return await e}finally{delete this._requests[t]}}}}}),ga=Kt({"../node_modules/jsonld/lib/url.js"(t,e){var n=la(),i={};e.exports=i,i.parsers={simple:{keys:["href","scheme","authority","path","query","fragment"],regex:/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/},full:{keys:["href","protocol","scheme","authority","auth","user","password","hostname","port","path","directory","file","query","fragment"],regex:/^(([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},i.parse=(t,e)=>{const n={},r=i.parsers[e||"full"],o=r.regex.exec(t);let s=r.keys.length;for(;s--;)n[r.keys[s]]=void 0===o[s]?null:o[s];return("https"===n.scheme&&"443"===n.port||"http"===n.scheme&&"80"===n.port)&&(n.href=n.href.replace(":"+n.port,""),n.authority=n.authority.replace(":"+n.port,""),n.port=null),n.normalizedPath=i.removeDotSegments(n.path),n},i.prependBase=(t,e)=>{if(null===t)return e;if(i.isAbsolute(e))return e;t&&!n.isString(t)||(t=i.parse(t||""));const r=i.parse(e),o={protocol:t.protocol||""};if(null!==r.authority)o.authority=r.authority,o.path=r.path,o.query=r.query;else if(o.authority=t.authority,""===r.path)o.path=t.path,o.query=null!==r.query?r.query:t.query;else{if(0===r.path.indexOf("/"))o.path=r.path;else{let e=t.path;e=e.substr(0,e.lastIndexOf("/")+1),(e.length>0||t.authority)&&"/"!==e.substr(-1)&&(e+="/"),e+=r.path,o.path=e}o.query=r.query}""!==r.path&&(o.path=i.removeDotSegments(o.path));let s=o.protocol;return null!==o.authority&&(s+="//"+o.authority),s+=o.path,null!==o.query&&(s+="?"+o.query),null!==r.fragment&&(s+="#"+r.fragment),""===s&&(s="./"),s},i.removeBase=(t,e)=>{if(null===t)return e;t&&!n.isString(t)||(t=i.parse(t||""));let r="";if(""!==t.href?r+=(t.protocol||"")+"//"+(t.authority||""):e.indexOf("//")&&(r+="//"),0!==e.indexOf(r))return e;const o=i.parse(e.substr(r.length)),s=t.normalizedPath.split("/"),a=o.normalizedPath.split("/"),c=o.fragment||o.query?0:1;for(;s.length>0&&a.length>c&&s[0]===a[0];)s.shift(),a.shift();let u="";if(s.length>0){s.pop();for(let t=0;t<s.length;++t)u+="../"}return u+=a.join("/"),null!==o.query&&(u+="?"+o.query),null!==o.fragment&&(u+="#"+o.fragment),""===u&&(u="./"),u},i.removeDotSegments=t=>{if(0===t.length)return"";const e=t.split("/"),n=[];for(;e.length>0;){const t=e.shift(),i=0===e.length;"."!==t?".."!==t?n.push(t):(n.pop(),i&&n.push("")):i&&n.push("")}return"/"===t[0]&&n.length>0&&""!==n[0]&&n.unshift(""),1===n.length&&""===n[0]?"/":n.join("/")};var r=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;i.isAbsolute=t=>n.isString(t)&&r.test(t),i.isRelative=t=>n.isString(t)}}),ma=Kt({"../node_modules/jsonld/lib/documentLoaders/xhr.js"(t,e){var{parseLinkHeader:n,buildHeaders:i}=fa(),{LINK_HEADER_CONTEXT:r}=pa(),o=da(),s=va(),{prependBase:a}=ga(),c=/(^|(\r\n))link:/i;e.exports=({secure:t,headers:e={},xhr:u}={headers:{}})=>(e=i(e),(new s).wrapLoader((async function i(s){if(0!==s.indexOf("http:")&&0!==s.indexOf("https:"))throw new o('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:s});if(t&&0!==s.indexOf("https"))throw new o('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:s});let l;try{l=await function(t,e,n){const i=new(t=t||XMLHttpRequest);return new Promise(((t,r)=>{i.onload=()=>t(i),i.onerror=t=>r(t),i.open("GET",e,!0);for(const t in n)i.setRequestHeader(t,n[t]);i.send()}))}(u,s,e)}catch(t){throw new o("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:s,cause:t})}if(l.status>=400)throw new o("URL could not be dereferenced: "+l.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:s,httpStatusCode:l.status});let h={contextUrl:null,documentUrl:s,document:l.response},d=null;const f=l.getResponseHeader("Content-Type");let p;if(c.test(l.getAllResponseHeaders())&&(p=l.getResponseHeader("Link")),p&&"application/ld+json"!==f){const t=n(p),e=t[r];if(Array.isArray(e))throw new o("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:s});e&&(h.contextUrl=e.target),d=t.alternate,d&&"application/ld+json"==d.type&&!(f||"").match(/^application\/(\w*\+)?json$/)&&(h=await i(a(s,d.target)))}return h})))}}),wa=Kt({"../node_modules/jsonld/lib/platform-browser.js"(t,e){var n=ma(),i={};e.exports=i,i.setupDocumentLoaders=function(t){"undefined"!=typeof XMLHttpRequest&&(t.documentLoaders.xhr=n,t.useDocumentLoader("xhr"))},i.setupGlobals=function(t){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:t.JsonLdProcessor})}}}),ba=Kt({"../node_modules/yallist/iterator.js"(t,e){e.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}}}),ya=Kt({"../node_modules/yallist/yallist.js"(t,e){function n(t){var e=this;if(e instanceof n||(e=new n),e.tail=null,e.head=null,e.length=0,t&&"function"==typeof t.forEach)t.forEach((function(t){e.push(t)}));else if(arguments.length>0)for(var i=0,r=arguments.length;i<r;i++)e.push(arguments[i]);return e}function i(t,e){t.tail=new o(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function r(t,e){t.head=new o(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function o(t,e,n,i){if(!(this instanceof o))return new o(t,e,n,i);this.list=i,this.value=t,e?(e.next=this,this.prev=e):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}e.exports=n,n.Node=o,n.create=n,n.prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var e=t.next,n=t.prev;return e&&(e.prev=n),n&&(n.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=n),t.list.length--,t.next=null,t.prev=null,t.list=null,e},n.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var e=this.head;t.list=this,t.next=e,e&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}},n.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var e=this.tail;t.list=this,t.prev=e,e&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}},n.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++)i(this,arguments[t]);return this.length},n.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++)r(this,arguments[t]);return this.length},n.prototype.pop=function(){if(this.tail){var t=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}},n.prototype.shift=function(){if(this.head){var t=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}},n.prototype.forEach=function(t,e){e=e||this;for(var n=this.head,i=0;null!==n;i++)t.call(e,n.value,i,this),n=n.next},n.prototype.forEachReverse=function(t,e){e=e||this;for(var n=this.tail,i=this.length-1;null!==n;i--)t.call(e,n.value,i,this),n=n.prev},n.prototype.get=function(t){for(var e=0,n=this.head;null!==n&&e<t;e++)n=n.next;if(e===t&&null!==n)return n.value},n.prototype.getReverse=function(t){for(var e=0,n=this.tail;null!==n&&e<t;e++)n=n.prev;if(e===t&&null!==n)return n.value},n.prototype.map=function(t,e){e=e||this;for(var i=new n,r=this.head;null!==r;)i.push(t.call(e,r.value,this)),r=r.next;return i},n.prototype.mapReverse=function(t,e){e=e||this;for(var i=new n,r=this.tail;null!==r;)i.push(t.call(e,r.value,this)),r=r.prev;return i},n.prototype.reduce=function(t,e){var n,i=this.head;if(arguments.length>1)n=e;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");i=this.head.next,n=this.head.value}for(var r=0;null!==i;r++)n=t(n,i.value,r),i=i.next;return n},n.prototype.reduceReverse=function(t,e){var n,i=this.tail;if(arguments.length>1)n=e;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");i=this.tail.prev,n=this.tail.value}for(var r=this.length-1;null!==i;r--)n=t(n,i.value,r),i=i.prev;return n},n.prototype.toArray=function(){for(var t=new Array(this.length),e=0,n=this.head;null!==n;e++)t[e]=n.value,n=n.next;return t},n.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,n=this.tail;null!==n;e++)t[e]=n.value,n=n.prev;return t},n.prototype.slice=function(t,e){(e=e||this.length)<0&&(e+=this.length),(t=t||0)<0&&(t+=this.length);var i=new n;if(e<t||e<0)return i;t<0&&(t=0),e>this.length&&(e=this.length);for(var r=0,o=this.head;null!==o&&r<t;r++)o=o.next;for(;null!==o&&r<e;r++,o=o.next)i.push(o.value);return i},n.prototype.sliceReverse=function(t,e){(e=e||this.length)<0&&(e+=this.length),(t=t||0)<0&&(t+=this.length);var i=new n;if(e<t||e<0)return i;t<0&&(t=0),e>this.length&&(e=this.length);for(var r=this.length,o=this.tail;null!==o&&r>e;r--)o=o.prev;for(;null!==o&&r>t;r--,o=o.prev)i.push(o.value);return i},n.prototype.splice=function(t,e,...n){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var i=0,r=this.head;null!==r&&i<t;i++)r=r.next;var s,a,c,u,l=[];for(i=0;r&&i<e;i++)l.push(r.value),r=this.removeNode(r);for(null===r&&(r=this.tail),r!==this.head&&r!==this.tail&&(r=r.prev),i=0;i<n.length;i++)c=n[i],u=void 0,null===(u=(a=r)===(s=this).head?new o(c,null,a,s):new o(c,a,a.next,s)).next&&(s.tail=u),null===u.prev&&(s.head=u),s.length++,r=u;return l},n.prototype.reverse=function(){for(var t=this.head,e=this.tail,n=t;null!==n;n=n.prev){var i=n.prev;n.prev=n.next,n.next=i}return this.head=e,this.tail=t,this};try{ba()(n)}catch(t){}}}),xa=Kt({"../node_modules/lru-cache/index.js"(t,e){var n=ya(),i=Symbol("max"),r=Symbol("length"),o=Symbol("lengthCalculator"),s=Symbol("allowStale"),a=Symbol("maxAge"),c=Symbol("dispose"),u=Symbol("noDisposeOnSet"),l=Symbol("lruList"),h=Symbol("cache"),d=Symbol("updateAgeOnGet"),f=()=>1,p=(t,e,n)=>{const i=t[h].get(e);if(i){const e=i.value;if(v(t,e)){if(m(t,i),!t[s])return}else n&&(t[d]&&(i.value.now=Date.now()),t[l].unshiftNode(i));return e.value}},v=(t,e)=>{if(!e||!e.maxAge&&!t[a])return!1;const n=Date.now()-e.now;return e.maxAge?n>e.maxAge:t[a]&&n>t[a]},g=t=>{if(t[r]>t[i])for(let e=t[l].tail;t[r]>t[i]&&null!==e;){const n=e.prev;m(t,e),e=n}},m=(t,e)=>{if(e){const n=e.value;t[c]&&t[c](n.key,n.value),t[r]-=n.length,t[h].delete(n.key),t[l].removeNode(e)}},w=(t,e,n,i)=>{let r=n.value;v(t,r)&&(m(t,n),t[s]||(r=void 0)),r&&e.call(i,r.value,r.key,t)};e.exports=class{constructor(t){if("number"==typeof t&&(t={max:t}),t||(t={}),t.max&&("number"!=typeof t.max||t.max<0))throw new TypeError("max must be a non-negative number");this[i]=t.max||1/0;const e=t.length||f;if(this[o]="function"!=typeof e?f:e,this[s]=t.stale||!1,t.maxAge&&"number"!=typeof t.maxAge)throw new TypeError("maxAge must be a number");this[a]=t.maxAge||0,this[c]=t.dispose,this[u]=t.noDisposeOnSet||!1,this[d]=t.updateAgeOnGet||!1,this.reset()}set max(t){if("number"!=typeof t||t<0)throw new TypeError("max must be a non-negative number");this[i]=t||1/0,g(this)}get max(){return this[i]}set allowStale(t){this[s]=!!t}get allowStale(){return this[s]}set maxAge(t){if("number"!=typeof t)throw new TypeError("maxAge must be a non-negative number");this[a]=t,g(this)}get maxAge(){return this[a]}set lengthCalculator(t){"function"!=typeof t&&(t=f),t!==this[o]&&(this[o]=t,this[r]=0,this[l].forEach((t=>{t.length=this[o](t.value,t.key),this[r]+=t.length}))),g(this)}get lengthCalculator(){return this[o]}get length(){return this[r]}get itemCount(){return this[l].length}rforEach(t,e){e=e||this;for(let n=this[l].tail;null!==n;){const i=n.prev;w(this,t,n,e),n=i}}forEach(t,e){e=e||this;for(let n=this[l].head;null!==n;){const i=n.next;w(this,t,n,e),n=i}}keys(){return this[l].toArray().map((t=>t.key))}values(){return this[l].toArray().map((t=>t.value))}reset(){this[c]&&this[l]&&this[l].length&&this[l].forEach((t=>this[c](t.key,t.value))),this[h]=new Map,this[l]=new n,this[r]=0}dump(){return this[l].map((t=>!v(this,t)&&{k:t.key,v:t.value,e:t.now+(t.maxAge||0)})).toArray().filter((t=>t))}dumpLru(){return this[l]}set(t,e,n){if((n=n||this[a])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");const s=n?Date.now():0,d=this[o](e,t);if(this[h].has(t)){if(d>this[i])return m(this,this[h].get(t)),!1;const o=this[h].get(t).value;return this[c]&&(this[u]||this[c](t,o.value)),o.now=s,o.maxAge=n,o.value=e,this[r]+=d-o.length,o.length=d,this.get(t),g(this),!0}const f=new class{constructor(t,e,n,i,r){this.key=t,this.value=e,this.length=n,this.now=i,this.maxAge=r||0}}(t,e,d,s,n);return f.length>this[i]?(this[c]&&this[c](t,e),!1):(this[r]+=f.length,this[l].unshift(f),this[h].set(t,this[l].head),g(this),!0)}has(t){if(!this[h].has(t))return!1;const e=this[h].get(t).value;return!v(this,e)}get(t){return p(this,t,!0)}peek(t){return p(this,t,!1)}pop(){const t=this[l].tail;return t?(m(this,t),t.value):null}del(t){m(this,this[h].get(t))}load(t){this.reset();const e=Date.now();for(let n=t.length-1;n>=0;n--){const i=t[n],r=i.e||0;if(0===r)this.set(i.k,i.v);else{const t=r-e;t>0&&this.set(i.k,i.v,t)}}}prune(){this[h].forEach(((t,e)=>p(this,e,!1)))}}}}),ka=Kt({"../node_modules/jsonld/lib/ResolvedContext.js"(t,e){var n=xa();e.exports=class{constructor({document:t}){this.document=t,this.cache=new n({max:10})}getProcessed(t){return this.cache.get(t)}setProcessed(t,e){this.cache.set(t,e)}}}}),Ea=Kt({"../node_modules/jsonld/lib/ContextResolver.js"(t,e){var{isArray:n,isObject:i,isString:r}=la(),{asArray:o}=fa(),{prependBase:s}=ga(),a=da(),c=ka();function u(t){throw new a("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:t})}function l({context:t,base:e}){if(!t)return;const o=t["@context"];if(r(o))t["@context"]=s(e,o);else if(n(o))for(let t=0;t<o.length;++t){const n=o[t];r(n)?o[t]=s(e,n):i(n)&&l({context:{"@context":n},base:e})}else if(i(o))for(const t in o)l({context:o[t],base:e})}e.exports=class{constructor({sharedCache:t}){this.perOpCache=new Map,this.sharedCache=t}async resolve({activeCtx:t,context:e,documentLoader:s,base:a,cycles:l=new Set}){e&&i(e)&&e["@context"]&&(e=e["@context"]),e=o(e);const h=[];for(const o of e){if(r(o)){let e=this._get(o);e||(e=await this._resolveRemoteContext({activeCtx:t,url:o,documentLoader:s,base:a,cycles:l})),n(e)?h.push(...e):h.push(e);continue}if(null===o){h.push(new c({document:null}));continue}i(o)||u(e);const d=JSON.stringify(o);let f=this._get(d);f||(f=new c({document:o}),this._cacheResolvedContext({key:d,resolved:f,tag:"static"})),h.push(f)}return h}_get(t){let e=this.perOpCache.get(t);if(!e){const n=this.sharedCache.get(t);n&&(e=n.get("static"),e&&this.perOpCache.set(t,e))}return e}_cacheResolvedContext({key:t,resolved:e,tag:n}){if(this.perOpCache.set(t,e),void 0!==n){let i=this.sharedCache.get(t);i||(i=new Map,this.sharedCache.set(t,i)),i.set(n,e)}return e}async _resolveRemoteContext({activeCtx:t,url:e,documentLoader:n,base:i,cycles:r}){e=s(i,e);const{context:o,remoteDoc:a}=await this._fetchContext({activeCtx:t,url:e,documentLoader:n,cycles:r});l({context:o,base:i=a.documentUrl||e});const c=await this.resolve({activeCtx:t,context:o,documentLoader:n,base:i,cycles:r});return this._cacheResolvedContext({key:e,resolved:c,tag:a.tag}),c}async _fetchContext({activeCtx:t,url:e,documentLoader:o,cycles:s}){if(s.size>10)throw new a("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===t.processingMode?"loading remote context failed":"context overflow",max:10});if(s.has(e))throw new a("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===t.processingMode?"recursive context inclusion":"context overflow",url:e});let c,u;s.add(e);try{u=await o(e),c=u.document||null,r(c)&&(c=JSON.parse(c))}catch(t){throw new a("Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context.","jsonld.InvalidUrl",{code:"loading remote context failed",url:e,cause:t})}if(!i(c))throw new a("Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object.","jsonld.InvalidUrl",{code:"invalid remote context",url:e});return c="@context"in c?{"@context":c["@context"]}:{"@context":{}},u.contextUrl&&(n(c["@context"])||(c["@context"]=[c["@context"]]),c["@context"].push(u.contextUrl)),{context:c,remoteDoc:u}}}}}),Sa=Kt({"../node_modules/jsonld/lib/NQuads.js"(t,e){e.exports=ua().NQuads}}),Fa=Kt({"../node_modules/jsonld/lib/context.js"(t,e){var n=fa(),i=da(),{isArray:r,isObject:o,isString:s,isUndefined:a}=la(),{isAbsolute:c,isRelative:u,prependBase:l}=ga(),{asArray:h,compareShortestLeast:d}=fa(),f=new Map,p=/^@[a-zA-Z]+$/,v={};function g(t,e,n,i,r,a){if(null===e||!s(e)||v.isKeyword(e))return e;if(e.match(p))return null;if(i&&i.hasOwnProperty(e)&&!0!==r.get(e)&&v.createTermDefinition({activeCtx:t,localCtx:i,term:e,defined:r,options:a}),(n=n||{}).vocab){const n=t.mappings.get(e);if(null===n)return null;if(o(n)&&"@id"in n)return n["@id"]}const u=e.indexOf(":");if(u>0){const n=e.substr(0,u),o=e.substr(u+1);if("_"===n||0===o.indexOf("//"))return e;i&&i.hasOwnProperty(n)&&v.createTermDefinition({activeCtx:t,localCtx:i,term:n,defined:r,options:a});const s=t.mappings.get(n);if(s&&s._prefix)return s["@id"]+o;if(c(e))return e}if(n.vocab&&"@vocab"in t)return t["@vocab"]+e;if(n.base&&"@base"in t){if(t["@base"])return l(l(a.base,t["@base"]),e)}else if(n.base)return l(a.base,e);return e}function m(t,e){if(!t||"object"!=typeof t||!e||"object"!=typeof e)return t===e;const n=Array.isArray(t);if(n!==Array.isArray(e))return!1;if(n){if(t.length!==e.length)return!1;for(let n=0;n<t.length;++n)if(!m(t[n],e[n]))return!1;return!0}const i=Object.keys(t),r=Object.keys(e);if(i.length!==r.length)return!1;for(const n in t){let i=t[n],r=e[n];if("@container"===n&&Array.isArray(i)&&Array.isArray(r)&&(i=i.slice().sort(),r=r.slice().sort()),!m(i,r))return!1}return!0}e.exports=v,v.process=async({activeCtx:t,localCtx:e,options:a,propagate:d=!0,overrideProtected:f=!1,cycles:p=new Set})=>{if(o(e)&&"@context"in e&&r(e["@context"])&&(e=e["@context"]),0===h(e).length)return t;const m=await a.contextResolver.resolve({activeCtx:t,context:e,documentLoader:a.documentLoader,base:a.base});o(m[0].document)&&"boolean"==typeof m[0].document["@propagate"]&&(d=m[0].document["@propagate"]);let w=t;d||w.previousContext||(w=w.clone(),w.previousContext=t);for(const r of m){let{document:h}=r;if(t=w,null===h){if(!f&&0!==Object.keys(t.protected).length){const o=a&&a.protectedMode||"error";if("error"===o)throw new i("Tried to nullify a context with protected terms outside of a term definition.","jsonld.SyntaxError",{code:"invalid context nullification"});if("warn"===o){console.warn("WARNING: invalid context nullification");const e=r.getProcessed(t);if(e){w=t=e;continue}const i=t;w=t=v.getInitialContext(a).clone();for(const[e,r]of Object.entries(i.protected))r&&(t.mappings[e]=n.clone(i.mappings[e]));t.protected=n.clone(i.protected),r.setProcessed(i,w);continue}throw new i("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:e,protectedMode:o})}w=t=v.getInitialContext(a).clone();continue}const d=r.getProcessed(t);if(d){w=t=d;continue}if(o(h)&&"@context"in h&&(h=h["@context"]),!o(h))throw new i("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:h});w=w.clone();const m=new Map;if("@version"in h){if(1.1!==h["@version"])throw new i("Unsupported JSON-LD version: "+h["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:h});if(t.processingMode&&"json-ld-1.0"===t.processingMode)throw new i("@version: "+h["@version"]+" not compatible with "+t.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:h});w.processingMode="json-ld-1.1",w["@version"]=h["@version"],m.set("@version",!0)}if(w.processingMode=w.processingMode||t.processingMode,"@base"in h){let t=h["@base"];if(null===t||c(t));else{if(!u(t))throw new i('Invalid JSON-LD syntax; the value of "@base" in a @context must be an absolute IRI, a relative IRI, or null.',"jsonld.SyntaxError",{code:"invalid base IRI",context:h});t=l(w["@base"],t)}w["@base"]=t,m.set("@base",!0)}if("@vocab"in h){const t=h["@vocab"];if(null===t)delete w["@vocab"];else{if(!s(t))throw new i('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:h});if(!c(t)&&v.processingMode(w,1))throw new i('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:h});w["@vocab"]=g(w,t,{vocab:!0,base:!0},void 0,void 0,a)}m.set("@vocab",!0)}if("@language"in h){const t=h["@language"];if(null===t)delete w["@language"];else{if(!s(t))throw new i('Invalid JSON-LD syntax; the value of "@language" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid default language",context:h});w["@language"]=t.toLowerCase()}m.set("@language",!0)}if("@direction"in h){const e=h["@direction"];if("json-ld-1.0"===t.processingMode)throw new i("Invalid JSON-LD syntax; @direction not compatible with "+t.processingMode,"jsonld.SyntaxError",{code:"invalid context member",context:h});if(null===e)delete w["@direction"];else{if("ltr"!==e&&"rtl"!==e)throw new i('Invalid JSON-LD syntax; the value of "@direction" in a @context must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:h});w["@direction"]=e}m.set("@direction",!0)}if("@propagate"in h){const n=h["@propagate"];if("json-ld-1.0"===t.processingMode)throw new i("Invalid JSON-LD syntax; @propagate not compatible with "+t.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:h});if("boolean"!=typeof n)throw new i("Invalid JSON-LD syntax; @propagate value must be a boolean.","jsonld.SyntaxError",{code:"invalid @propagate value",context:e});m.set("@propagate",!0)}if("@import"in h){const n=h["@import"];if("json-ld-1.0"===t.processingMode)throw new i("Invalid JSON-LD syntax; @import not compatible with "+t.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:h});if(!s(n))throw new i("Invalid JSON-LD syntax; @import must be a string.","jsonld.SyntaxError",{code:"invalid @import value",context:e});const r=await a.contextResolver.resolve({activeCtx:t,context:n,documentLoader:a.documentLoader,base:a.base});if(1!==r.length)throw new i("Invalid JSON-LD syntax; @import must reference a single context.","jsonld.SyntaxError",{code:"invalid remote context",context:e});const o=r[0].getProcessed(t);if(o)h=o;else{const n=r[0].document;if("@import"in n)throw new i("Invalid JSON-LD syntax: imported context must not include @import.","jsonld.SyntaxError",{code:"invalid context entry",context:e});for(const t in n)h.hasOwnProperty(t)||(h[t]=n[t]);r[0].setProcessed(t,h)}m.set("@import",!0)}m.set("@protected",h["@protected"]||!1);for(const t in h)if(v.createTermDefinition({activeCtx:w,localCtx:h,term:t,defined:m,options:a,overrideProtected:f}),o(h[t])&&"@context"in h[t]){const e=h[t]["@context"];let n=!0;if(s(e)){const t=l(a.base,e);p.has(t)?n=!1:p.add(t)}if(n)try{await v.process({activeCtx:w.clone(),localCtx:h[t]["@context"],overrideProtected:!0,options:a,cycles:p})}catch(e){throw new i("Invalid JSON-LD syntax; invalid scoped context.","jsonld.SyntaxError",{code:"invalid scoped context",context:h[t]["@context"],term:t})}}r.setProcessed(t,w)}return w},v.createTermDefinition=({activeCtx:t,localCtx:e,term:n,defined:a,options:u,overrideProtected:l=!1})=>{if(a.has(n)){if(a.get(n))return;throw new i("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:e,term:n})}let h;if(a.set(n,!1),e.hasOwnProperty(n)&&(h=e[n]),"@type"===n&&o(h)&&"@set"===(h["@container"]||"@set")&&v.processingMode(t,1.1)){const t=["@container","@id","@protected"],r=Object.keys(h);if(0===r.length||r.some((e=>!t.includes(e))))throw new i("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:e,term:n})}else{if(v.isKeyword(n))throw new i("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:e,term:n});if(n.match(p))return void console.warn('WARNING: terms beginning with "@" are reserved for future use and ignored',{term:n});if(""===n)throw new i("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:e})}const d=t.mappings.get(n);t.mappings.has(n)&&t.mappings.delete(n);let f=!1;if((s(h)||null===h)&&(f=!0,h={"@id":h}),!o(h))throw new i("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:e});const w={};t.mappings.set(n,w),w.reverse=!1;const b=["@container","@id","@language","@reverse","@type"];v.processingMode(t,1.1)&&b.push("@context","@direction","@index","@nest","@prefix","@protected");for(const t in h)if(!b.includes(t))throw new i("Invalid JSON-LD syntax; a term definition must not contain "+t,"jsonld.SyntaxError",{code:"invalid term definition",context:e});const y=n.indexOf(":");if(w._termHasColon=y>0,"@reverse"in h){if("@id"in h)throw new i("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:e});if("@nest"in h)throw new i("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:e});const r=h["@reverse"];if(!s(r))throw new i("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:e});if(!v.isKeyword(r)&&r.match(p))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{reverse:r}),void(d?t.mappings.set(n,d):t.mappings.delete(n));const o=g(t,r,{vocab:!0,base:!1},e,a,u);if(!c(o))throw new i("Invalid JSON-LD syntax; a @context @reverse value must be an absolute IRI or a blank node identifier.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:e});w["@id"]=o,w.reverse=!0}else if("@id"in h){let r=h["@id"];if(r&&!s(r))throw new i("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:e});if(null===r)w["@id"]=null;else{if(!v.isKeyword(r)&&r.match(p))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{id:r}),void(d?t.mappings.set(n,d):t.mappings.delete(n));if(r!==n){if(r=g(t,r,{vocab:!0,base:!1},e,a,u),!c(r)&&!v.isKeyword(r))throw new i("Invalid JSON-LD syntax; a @context @id value must be an absolute IRI, a blank node identifier, or a keyword.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:e});if(n.match(/(?::[^:])|\//)&&g(t,n,{vocab:!0,base:!1},e,new Map(a).set(n,!0),u)!==r)throw new i("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:e});w["@id"]=r,w._prefix=f&&!w._termHasColon&&r.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in w))if(w._termHasColon){const i=n.substr(0,y);if(e.hasOwnProperty(i)&&v.createTermDefinition({activeCtx:t,localCtx:e,term:i,defined:a,options:u}),t.mappings.has(i)){const e=n.substr(y+1);w["@id"]=t.mappings.get(i)["@id"]+e}else w["@id"]=n}else if("@type"===n)w["@id"]=n;else{if(!("@vocab"in t))throw new i("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:e,term:n});w["@id"]=t["@vocab"]+n}if((!0===h["@protected"]||!0===a.get("@protected")&&!1!==h["@protected"])&&(t.protected[n]=!0,w.protected=!0),a.set(n,!0),"@type"in h){let n=h["@type"];if(!s(n))throw new i("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:e});if("@json"===n||"@none"===n){if(v.processingMode(t,1))throw new i(`Invalid JSON-LD syntax; an @context @type value must not be "${n}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:e})}else if("@id"!==n&&"@vocab"!==n){if(n=g(t,n,{vocab:!0,base:!1},e,a,u),!c(n))throw new i("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:e});if(0===n.indexOf("_:"))throw new i("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:e})}w["@type"]=n}if("@container"in h){const n=s(h["@container"])?[h["@container"]]:h["@container"]||[],o=["@list","@set","@index","@language"];let a=!0;const c=n.includes("@set");if(v.processingMode(t,1.1)){if(o.push("@graph","@id","@type"),n.includes("@list")){if(1!==n.length)throw new i("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:e})}else if(n.includes("@graph")){if(n.some((t=>"@graph"!==t&&"@id"!==t&&"@index"!==t&&"@set"!==t)))throw new i("Invalid JSON-LD syntax; @context @container with @graph must have no other values other than @id, @index, and @set","jsonld.SyntaxError",{code:"invalid container mapping",context:e})}else a&=n.length<=(c?2:1);if(n.includes("@type")&&(w["@type"]=w["@type"]||"@id",!["@id","@vocab"].includes(w["@type"])))throw new i("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:e})}else a&=!r(h["@container"]),a&=n.length<=1;if(a&=n.every((t=>o.includes(t))),a&=!(c&&n.includes("@list")),!a)throw new i("Invalid JSON-LD syntax; @context @container value must be one of the following: "+o.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:e});if(w.reverse&&!n.every((t=>["@index","@set"].includes(t))))throw new i("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:e});w["@container"]=n}if("@index"in h){if(!("@container"in h)||!w["@container"].includes("@index"))throw new i(`Invalid JSON-LD syntax; @index without @index in @container: "${h["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:e});if(!s(h["@index"])||0===h["@index"].indexOf("@"))throw new i(`Invalid JSON-LD syntax; @index must expand to an IRI: "${h["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:e});w["@index"]=h["@index"]}if("@context"in h&&(w["@context"]=h["@context"]),"@language"in h&&!("@type"in h)){let t=h["@language"];if(null!==t&&!s(t))throw new i("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:e});null!==t&&(t=t.toLowerCase()),w["@language"]=t}if("@prefix"in h){if(n.match(/:|\//))throw new i("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:e});if(v.isKeyword(w["@id"]))throw new i("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:e});if("boolean"!=typeof h["@prefix"])throw new i("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:e});w._prefix=!0===h["@prefix"]}if("@direction"in h){const t=h["@direction"];if(null!==t&&"ltr"!==t&&"rtl"!==t)throw new i('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:e});w["@direction"]=t}if("@nest"in h){const t=h["@nest"];if(!s(t)||"@nest"!==t&&0===t.indexOf("@"))throw new i("Invalid JSON-LD syntax; @context @nest value must be a string which is not a keyword other than @nest.","jsonld.SyntaxError",{code:"invalid @nest value",context:e});w["@nest"]=t}const x=w["@id"];if("@context"===x||"@preserve"===x)throw new i("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:e});if(d&&d.protected&&!l&&(t.protected[n]=!0,w.protected=!0,!m(d,w))){const t=u&&u.protectedMode||"error";if("error"===t)throw new i(`Invalid JSON-LD syntax; tried to redefine "${n}" which is a protected term.`,"jsonld.SyntaxError",{code:"protected term redefinition",context:e,term:n});if("warn"===t)return void console.warn("WARNING: protected term redefinition",{term:n});throw new i("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:e,term:n,protectedMode:t})}},v.expandIri=(t,e,n,i)=>g(t,e,n,void 0,void 0,i),v.getInitialContext=t=>{const e=JSON.stringify({processingMode:t.processingMode}),i=f.get(e);if(i)return i;const r={processingMode:t.processingMode,mappings:new Map,inverse:null,getInverse:function(){const t=this;if(t.inverse)return t.inverse;const e=t.inverse={},n=t.fastCurieMap={},i={},r=(t["@language"]||"@none").toLowerCase(),a=t["@direction"],c=t.mappings,u=[...c.keys()].sort(d);for(const t of u){const o=c.get(t);if(null===o)continue;let u=o["@container"]||"@none";if(u=[].concat(u).sort().join(""),null===o["@id"])continue;const l=h(o["@id"]);for(const c of l){let l=e[c];const h=v.isKeyword(c);if(l)h||o._termHasColon||i[c].push(t);else if(e[c]=l={},!h&&!o._termHasColon){i[c]=[t];const e={iri:c,terms:i[c]};c[0]in n?n[c[0]].push(e):n[c[0]]=[e]}if(l[u]||(l[u]={"@language":{},"@type":{},"@any":{}}),l=l[u],s(t,l["@any"],"@none"),o.reverse)s(t,l["@type"],"@reverse");else if("@none"===o["@type"])s(t,l["@any"],"@none"),s(t,l["@language"],"@none"),s(t,l["@type"],"@none");else if("@type"in o)s(t,l["@type"],o["@type"]);else if("@language"in o&&"@direction"in o){const e=o["@language"],n=o["@direction"];s(t,l["@language"],e&&n?`${e}_${n}`.toLowerCase():e?e.toLowerCase():n?`_${n}`:"@null")}else"@language"in o?s(t,l["@language"],(o["@language"]||"@null").toLowerCase()):"@direction"in o?s(t,l["@language"],o["@direction"]?`_${o["@direction"]}`:"@none"):a?(s(t,l["@language"],`_${a}`),s(t,l["@language"],"@none"),s(t,l["@type"],"@none")):(s(t,l["@language"],r),s(t,l["@language"],"@none"),s(t,l["@type"],"@none"))}}for(const t in n)o(n,t,1);return e},clone:function(){const t={};return t.mappings=n.clone(this.mappings),t.clone=this.clone,t.inverse=null,t.getInverse=this.getInverse,t.protected=n.clone(this.protected),this.previousContext&&(t.previousContext=this.previousContext.clone()),t.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(t["@base"]=this["@base"]),"@language"in this&&(t["@language"]=this["@language"]),"@vocab"in this&&(t["@vocab"]=this["@vocab"]),t},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===f.size&&f.clear(),f.set(e,r),r;function o(t,e,n){const i=t[e],r=t[e]={};let s,a;for(const t of i)s=t.iri,a=n>=s.length?"":s[n],a in r?r[a].push(t):r[a]=[t];for(const t in r)""!==t&&o(r,t,n+1)}function s(t,e,n){e.hasOwnProperty(n)||(e[n]=t)}},v.getContextValue=(t,e,n)=>{if(null===e){if("@context"===n)return;return null}if(t.mappings.has(e)){const i=t.mappings.get(e);if(a(n))return i;if(i.hasOwnProperty(n))return i[n]}return"@language"===n&&n in t||"@direction"===n&&n in t?t[n]:"@context"!==n?null:void 0},v.processingMode=(t,e)=>e.toString()>="1.1"?!t.processingMode||t.processingMode>="json-ld-"+e.toString():"json-ld-1.0"===t.processingMode,v.isKeyword=t=>{if(!s(t)||"@"!==t[0])return!1;switch(t){case"@base":case"@container":case"@context":case"@default":case"@direction":case"@embed":case"@explicit":case"@graph":case"@id":case"@included":case"@index":case"@json":case"@language":case"@list":case"@nest":case"@none":case"@omitDefault":case"@prefix":case"@preserve":case"@protected":case"@requireAll":case"@reverse":case"@set":case"@type":case"@value":case"@version":case"@vocab":return!0}return!1}}}),Aa=Kt({"../node_modules/jsonld/lib/expand.js"(t,e){var n=da(),{isArray:i,isObject:r,isEmptyObject:o,isString:s,isUndefined:a}=la(),{isList:c,isValue:u,isGraph:l,isSubject:h}=ha(),{expandIri:d,getContextValue:f,isKeyword:p,process:v,processingMode:g}=Fa(),{isAbsolute:m}=ga(),{addValue:w,asArray:b,getValues:y,validateTypeValue:x}=fa(),k={};e.exports=k;var E=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/;async function S({activeCtx:t,activeProperty:e,expandedActiveProperty:l,element:y,expandedParent:F,options:j={},insideList:C,typeKey:R,typeScopedContext:I,expansionMap:T}){const O=Object.keys(y).sort(),N=[];let P;const D=y[R]&&"@json"===d(t,i(y[R])?y[R][0]:y[R],{vocab:!0},j);for(const S of O){let R,O=y[S];if("@context"===S)continue;let M=d(t,S,{vocab:!0},j);if((null===M||!m(M)&&!p(M))&&(M=T({unmappedProperty:S,activeCtx:t,activeProperty:e,parent:y,options:j,insideList:C,value:O,expandedParent:F}),void 0===M))continue;if(p(M)){if("@reverse"===l)throw new n("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:O});if(M in F&&"@included"!==M&&"@type"!==M)throw new n("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:M})}if("@id"===M){if(!s(O)){if(!j.isFrame)throw new n('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:O});if(r(O)){if(!o(O))throw new n('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:O})}else{if(!i(O))throw new n('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:O});if(!O.every((t=>s(t))))throw new n('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:O})}}w(F,"@id",b(O).map((e=>s(e)?d(t,e,{base:!0},j):e)),{propertyIsArray:j.isFrame});continue}if("@type"===M){r(O)&&(O=Object.fromEntries(Object.entries(O).map((([t,e])=>[d(I,t,{vocab:!0}),b(e).map((t=>d(I,t,{base:!0,vocab:!0})))])))),x(O,j.isFrame),w(F,"@type",b(O).map((t=>s(t)?d(I,t,{base:!0,vocab:!0},j):t)),{propertyIsArray:j.isFrame});continue}if("@included"===M&&g(t,1.1)){const i=b(await k.expand({activeCtx:t,activeProperty:e,element:O,options:j,expansionMap:T}));if(!i.every((t=>h(t))))throw new n("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:O});w(F,"@included",i,{propertyIsArray:!0});continue}if("@graph"===M&&!r(O)&&!i(O))throw new n('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:O});if("@value"===M){P=O,D&&g(t,1.1)?F["@value"]=O:w(F,"@value",O,{propertyIsArray:j.isFrame});continue}if("@language"===M){if(null===O)continue;if(!s(O)&&!j.isFrame)throw new n('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:O});O=b(O).map((t=>s(t)?t.toLowerCase():t));for(const t of O)s(t)&&!t.match(E)&&console.warn(`@language must be valid BCP47: ${t}`);w(F,"@language",O,{propertyIsArray:j.isFrame});continue}if("@direction"===M){if(!s(O)&&!j.isFrame)throw new n('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:O});O=b(O);for(const t of O)if(s(t)&&"ltr"!==t&&"rtl"!==t)throw new n('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:O});w(F,"@direction",O,{propertyIsArray:j.isFrame});continue}if("@index"===M){if(!s(O))throw new n('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:O});w(F,"@index",O);continue}if("@reverse"===M){if(!r(O))throw new n('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:O});if(R=await k.expand({activeCtx:t,activeProperty:"@reverse",element:O,options:j,expansionMap:T}),"@reverse"in R)for(const t in R["@reverse"])w(F,t,R["@reverse"][t],{propertyIsArray:!0});let e=F["@reverse"]||null;for(const t in R){if("@reverse"===t)continue;null===e&&(e=F["@reverse"]={}),w(e,t,[],{propertyIsArray:!0});const i=R[t];for(let r=0;r<i.length;++r){const o=i[r];if(u(o)||c(o))throw new n('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:R});w(e,t,o,{propertyIsArray:!0})}}continue}if("@nest"===M){N.push(S);continue}let U=t;const L=f(t,S,"@context");a(L)||(U=await v({activeCtx:t,localCtx:L,propagate:!0,overrideProtected:!0,options:j}));const B=f(U,S,"@container")||[];if(B.includes("@language")&&r(O))R=A(U,O,f(U,S,"@direction"),j);else if(B.includes("@index")&&r(O)){const e=B.includes("@graph"),n=f(U,S,"@index")||"@index",i="@index"!==n&&d(t,n,{vocab:!0},j);R=await _({activeCtx:U,options:j,activeProperty:S,value:O,expansionMap:T,asGraph:e,indexKey:n,propertyIndex:i})}else if(B.includes("@id")&&r(O)){const t=B.includes("@graph");R=await _({activeCtx:U,options:j,activeProperty:S,value:O,expansionMap:T,asGraph:t,indexKey:"@id"})}else if(B.includes("@type")&&r(O))R=await _({activeCtx:U.revertToPreviousContext(),options:j,activeProperty:S,value:O,expansionMap:T,asGraph:!1,indexKey:"@type"});else{const n="@list"===M;if(n||"@set"===M){let t=e;n&&"@graph"===l&&(t=null),R=await k.expand({activeCtx:U,activeProperty:t,element:O,options:j,insideList:n,expansionMap:T})}else R="@json"===f(t,S,"@type")?{"@type":"@json","@value":O}:await k.expand({activeCtx:U,activeProperty:S,element:O,options:j,insideList:!1,expansionMap:T})}if(null!==R||"@value"===M||(R=T({unmappedValue:O,expandedProperty:M,activeCtx:U,activeProperty:e,parent:y,options:j,insideList:C,key:S,expandedParent:F}),void 0!==R))if("@list"!==M&&!c(R)&&B.includes("@list")&&(R={"@list":b(R)}),B.includes("@graph")&&!B.some((t=>"@id"===t||"@index"===t))&&(R=b(R).map((t=>({"@graph":b(t)})))),U.mappings.has(S)&&U.mappings.get(S).reverse){const t=F["@reverse"]=F["@reverse"]||{};R=b(R);for(let e=0;e<R.length;++e){const i=R[e];if(u(i)||c(i))throw new n('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:R});w(t,M,i,{propertyIsArray:!0})}}else w(F,M,R,{propertyIsArray:!0})}if("@value"in F)if("@json"===F["@type"]&&g(t,1.1));else if((r(P)||i(P))&&!j.isFrame)throw new n('Invalid JSON-LD syntax; "@value" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid value object value",value:P});for(const o of N){const s=i(y[o])?y[o]:[y[o]];for(const i of s){if(!r(i)||Object.keys(i).some((e=>"@value"===d(t,e,{vocab:!0},j))))throw new n("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:i});await S({activeCtx:t,activeProperty:e,expandedActiveProperty:l,element:i,expandedParent:F,options:j,insideList:C,typeScopedContext:I,typeKey:R,expansionMap:T})}}}function F({activeCtx:t,activeProperty:e,value:n,options:i}){if(null==n)return null;const r=d(t,e,{vocab:!0},i);if("@id"===r)return d(t,n,{base:!0},i);if("@type"===r)return d(t,n,{vocab:!0,base:!0},i);const o=f(t,e,"@type");if(("@id"===o||"@graph"===r)&&s(n))return{"@id":d(t,n,{base:!0},i)};if("@vocab"===o&&s(n))return{"@id":d(t,n,{vocab:!0,base:!0},i)};if(p(r))return n;const a={};if(o&&!["@id","@vocab","@none"].includes(o))a["@type"]=o;else if(s(n)){const n=f(t,e,"@language");null!==n&&(a["@language"]=n);const i=f(t,e,"@direction");null!==i&&(a["@direction"]=i)}return["boolean","number","string"].includes(typeof n)||(n=n.toString()),a["@value"]=n,a}function A(t,e,r,o){const a=[],c=Object.keys(e).sort();for(const u of c){const c=d(t,u,{vocab:!0},o);let l=e[u];i(l)||(l=[l]);for(const t of l){if(null===t)continue;if(!s(t))throw new n("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:e});const i={"@value":t};"@none"!==c&&(i["@language"]=u.toLowerCase()),r&&(i["@direction"]=r),a.push(i)}}return a}async function _({activeCtx:t,options:e,activeProperty:r,value:o,expansionMap:s,asGraph:c,indexKey:h,propertyIndex:p}){const g=[],m=Object.keys(o).sort(),b="@type"===h;for(let y of m){if(b){const n=f(t,y,"@context");a(n)||(t=await v({activeCtx:t,localCtx:n,propagate:!1,options:e}))}let m,x=o[y];i(x)||(x=[x]),x=await k.expand({activeCtx:t,activeProperty:r,element:x,options:e,insideList:!1,insideIndex:!0,expansionMap:s}),m=p?"@none"===y?"@none":F({activeCtx:t,activeProperty:h,value:y,options:e}):d(t,y,{vocab:!0},e),"@id"===h?y=d(t,y,{base:!0},e):b&&(y=m);for(let t of x){if(c&&!l(t)&&(t={"@graph":[t]}),"@type"===h)"@none"===m||(t["@type"]=t["@type"]?[y].concat(t["@type"]):[y]);else{if(u(t)&&!["@language","@type","@index"].includes(h))throw new n(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${h}".`,"jsonld.SyntaxError",{code:"invalid value object",value:t});p?"@none"!==m&&w(t,p,m,{propertyIsArray:!0,prependValue:!0}):"@none"===m||h in t||(t[h]=y)}g.push(t)}}return g}k.expand=async({activeCtx:t,activeProperty:e=null,element:c,options:u={},insideList:l=!1,insideIndex:h=!1,typeScopedContext:p=null,expansionMap:w=(()=>{})})=>{if(null==c)return null;if("@default"===e&&(u=Object.assign({},u,{isFrame:!1})),!i(c)&&!r(c)){if(!l&&(null===e||"@graph"===d(t,e,{vocab:!0},u))){const n=await w({unmappedValue:c,activeCtx:t,activeProperty:e,options:u,insideList:l});return void 0===n?null:n}return F({activeCtx:t,activeProperty:e,value:c,options:u})}if(i(c)){let n=[];const r=f(t,e,"@container")||[];l=l||r.includes("@list");for(let r=0;r<c.length;++r){let o=await k.expand({activeCtx:t,activeProperty:e,element:c[r],options:u,expansionMap:w,insideIndex:h,typeScopedContext:p});l&&i(o)&&(o={"@list":o}),null===o&&(o=await w({unmappedValue:c[r],activeCtx:t,activeProperty:e,parent:c,index:r,options:u,expandedParent:n,insideList:l}),void 0===o)||(i(o)?n=n.concat(o):n.push(o))}return n}const x=d(t,e,{vocab:!0},u),E=f(t,e,"@context");p=p||(t.previousContext?t:null);let A=Object.keys(c).sort(),_=!h;if(_&&p&&A.length<=2&&!A.includes("@context"))for(const e of A){const n=d(p,e,{vocab:!0},u);if("@value"===n){_=!1,t=p;break}if("@id"===n&&1===A.length){_=!1;break}}_&&(t=t.revertToPreviousContext()),a(E)||(t=await v({activeCtx:t,localCtx:E,propagate:!0,overrideProtected:!0,options:u})),"@context"in c&&(t=await v({activeCtx:t,localCtx:c["@context"],options:u})),p=t;let j=null;for(const e of A)if("@type"===d(t,e,{vocab:!0},u)){j=j||e;const n=c[e],i=Array.isArray(n)?n.length>1?n.slice().sort():n:[n];for(const e of i){const n=f(p,e,"@context");a(n)||(t=await v({activeCtx:t,localCtx:n,options:u,propagate:!1}))}}let C={};await S({activeCtx:t,activeProperty:e,expandedActiveProperty:x,element:c,expandedParent:C,options:u,insideList:l,typeKey:j,typeScopedContext:p,expansionMap:w}),A=Object.keys(C);let R=A.length;if("@value"in C){if("@type"in C&&("@language"in C||"@direction"in C))throw new n('Invalid JSON-LD syntax; an element containing "@value" may not contain both "@type" and either "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:C});let i=R-1;if("@type"in C&&(i-=1),"@index"in C&&(i-=1),"@language"in C&&(i-=1),"@direction"in C&&(i-=1),0!==i)throw new n('Invalid JSON-LD syntax; an element containing "@value" may only have an "@index" property and either "@type" or either or both "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:C});const r=null===C["@value"]?[]:b(C["@value"]),a=y(C,"@type");if(g(t,1.1)&&a.includes("@json")&&1===a.length);else if(0===r.length){const n=await w({unmappedValue:C,activeCtx:t,activeProperty:e,element:c,options:u,insideList:l});C=void 0!==n?n:null}else{if(!r.every((t=>s(t)||o(t)))&&"@language"in C)throw new n("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:C});if(!a.every((t=>m(t)&&!(s(t)&&0===t.indexOf("_:"))||o(t))))throw new n('Invalid JSON-LD syntax; an element containing "@value" and "@type" must have an absolute IRI for the value of "@type".',"jsonld.SyntaxError",{code:"invalid typed value",element:C})}}else if("@type"in C&&!i(C["@type"]))C["@type"]=[C["@type"]];else if("@set"in C||"@list"in C){if(R>1&&(2!==R||!("@index"in C)))throw new n('Invalid JSON-LD syntax; if an element has the property "@set" or "@list", then it can have at most one other property that is "@index".',"jsonld.SyntaxError",{code:"invalid set or list object",element:C});"@set"in C&&(C=C["@set"],A=Object.keys(C),R=A.length)}else if(1===R&&"@language"in C){const n=await w(C,{unmappedValue:C,activeCtx:t,activeProperty:e,element:c,options:u,insideList:l});C=void 0!==n?n:null}if(r(C)&&!u.keepFreeFloatingNodes&&!l&&(null===e||"@graph"===x)&&(0===R||"@value"in C||"@list"in C||1===R&&"@id"in C)){const n=await w({unmappedValue:C,activeCtx:t,activeProperty:e,element:c,options:u,insideList:l});C=void 0!==n?n:null}return C}}}),_a=Kt({"../node_modules/jsonld/lib/nodeMap.js"(t,e){var{isKeyword:n}=Fa(),i=ha(),r=la(),o=fa(),s=da(),a={};e.exports=a,a.createMergedNodeMap=(t,e)=>{const n=(e=e||{}).issuer||new o.IdentifierIssuer("_:b"),i={"@default":{}};return a.createNodeMap(t,i,"@default",n),a.mergeNodeMaps(i)},a.createNodeMap=(t,e,c,u,l,h)=>{if(r.isArray(t)){for(const n of t)a.createNodeMap(n,e,c,u,void 0,h);return}if(!r.isObject(t))return void(h&&h.push(t));if(i.isValue(t)){if("@type"in t){let e=t["@type"];0===e.indexOf("_:")&&(t["@type"]=e=u.getId(e))}return void(h&&h.push(t))}if(h&&i.isList(t)){const n=[];return a.createNodeMap(t["@list"],e,c,u,l,n),void h.push({"@list":n})}if("@type"in t){const e=t["@type"];for(const t of e)0===t.indexOf("_:")&&u.getId(t)}r.isUndefined(l)&&(l=i.isBlankNode(t)?u.getId(t["@id"]):t["@id"]),h&&h.push({"@id":l});const d=e[c],f=d[l]=d[l]||{};f["@id"]=l;const p=Object.keys(t).sort();for(let r of p){if("@id"===r)continue;if("@reverse"===r){const n={"@id":l},r=t["@reverse"];for(const t in r){const s=r[t];for(const r of s){let s=r["@id"];i.isBlankNode(r)&&(s=u.getId(s)),a.createNodeMap(r,e,c,u,s),o.addValue(d[s],t,n,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===r){l in e||(e[l]={}),a.createNodeMap(t[r],e,l,u);continue}if("@included"===r){a.createNodeMap(t[r],e,c,u);continue}if("@type"!==r&&n(r)){if("@index"===r&&r in f&&(t[r]!==f[r]||t[r]["@id"]!==f[r]["@id"]))throw new s("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:f});f[r]=t[r];continue}const h=t[r];if(0===r.indexOf("_:")&&(r=u.getId(r)),0!==h.length)for(let t of h)if("@type"===r&&(t=0===t.indexOf("_:")?u.getId(t):t),i.isSubject(t)||i.isSubjectReference(t)){if("@id"in t&&!t["@id"])continue;const n=i.isBlankNode(t)?u.getId(t["@id"]):t["@id"];o.addValue(f,r,{"@id":n},{propertyIsArray:!0,allowDuplicate:!1}),a.createNodeMap(t,e,c,u,n)}else if(i.isValue(t))o.addValue(f,r,t,{propertyIsArray:!0,allowDuplicate:!1});else if(i.isList(t)){const n=[];a.createNodeMap(t["@list"],e,c,u,l,n),t={"@list":n},o.addValue(f,r,t,{propertyIsArray:!0,allowDuplicate:!1})}else a.createNodeMap(t,e,c,u,l),o.addValue(f,r,t,{propertyIsArray:!0,allowDuplicate:!1});else o.addValue(f,r,[],{propertyIsArray:!0})}},a.mergeNodeMapGraphs=t=>{const e={};for(const i of Object.keys(t).sort())for(const r of Object.keys(t[i]).sort()){const s=t[i][r];r in e||(e[r]={"@id":r});const a=e[r];for(const t of Object.keys(s).sort())if(n(t)&&"@type"!==t)a[t]=o.clone(s[t]);else for(const e of s[t])o.addValue(a,t,o.clone(e),{propertyIsArray:!0,allowDuplicate:!1})}return e},a.mergeNodeMaps=t=>{const e=t["@default"],n=Object.keys(t).sort();for(const r of n){if("@default"===r)continue;const n=t[r];let o=e[r];o?"@graph"in o||(o["@graph"]=[]):e[r]=o={"@id":r,"@graph":[]};const s=o["@graph"];for(const t of Object.keys(n).sort()){const e=n[t];i.isSubjectReference(e)||s.push(e)}}return e}}}),ja=Kt({"../node_modules/jsonld/lib/flatten.js"(t,e){var{isSubjectReference:n}=ha(),{createMergedNodeMap:i}=_a(),r={};e.exports=r,r.flatten=t=>{const e=i(t),r=[],o=Object.keys(e).sort();for(let t=0;t<o.length;++t){const i=e[o[t]];n(i)||r.push(i)}return r}}}),Ca=Kt({"../node_modules/jsonld/lib/fromRdf.js"(t,e){var n=da(),i=ha(),r=la(),o=fa(),{RDF_LIST:s,RDF_FIRST:a,RDF_REST:c,RDF_NIL:u,RDF_TYPE:l,RDF_JSON_LITERAL:h,XSD_BOOLEAN:d,XSD_DOUBLE:f,XSD_INTEGER:p,XSD_STRING:v}=pa(),g=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,m={};function w(t,e,i){if(t.termType.endsWith("Node"))return{"@id":t.value};const o={"@value":t.value};if(t.language)o["@language"]=t.language;else{let s=t.datatype.value;if(s||(s=v),s===h){s="@json";try{o["@value"]=JSON.parse(o["@value"])}catch(t){throw new n("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:o["@value"],cause:t})}}if(e){if(s===d)"true"===o["@value"]?o["@value"]=!0:"false"===o["@value"]&&(o["@value"]=!1);else if(r.isNumeric(o["@value"]))if(s===p){const t=parseInt(o["@value"],10);t.toFixed(0)===o["@value"]&&(o["@value"]=t)}else s===f&&(o["@value"]=parseFloat(o["@value"]));[d,p,f,v].includes(s)||(o["@type"]=s)}else if("i18n-datatype"===i&&s.startsWith("https://www.w3.org/ns/i18n#")){const[,t,e]=s.split(/[#_]/);t.length>0&&(o["@language"]=t,t.match(g)||console.warn(`@language must be valid BCP47: ${t}`)),o["@direction"]=e}else s!==v&&(o["@type"]=s)}return o}e.exports=m,m.fromRDF=async(t,{useRdfType:e=!1,useNativeTypes:n=!1,rdfDirection:h=null})=>{const d={},f={"@default":d},p={};for(const i of t){const t="DefaultGraph"===i.graph.termType?"@default":i.graph.value;t in f||(f[t]={}),"@default"===t||t in d||(d[t]={"@id":t});const r=f[t],s=i.subject.value,a=i.predicate.value,c=i.object;s in r||(r[s]={"@id":s});const v=r[s],g=c.termType.endsWith("Node");if(g&&!(c.value in r)&&(r[c.value]={"@id":c.value}),a===l&&!e&&g){o.addValue(v,"@type",c.value,{propertyIsArray:!0});continue}const m=w(c,n,h);if(o.addValue(v,a,m,{propertyIsArray:!0}),g)if(c.value===u){const t=r[c.value];"usages"in t||(t.usages=[]),t.usages.push({node:v,property:a,value:m})}else p[c.value]=!(c.value in p)&&{node:v,property:a,value:m}}for(const t in f){const e=f[t];if(!(u in e))continue;const n=e[u];if(n.usages){for(let t of n.usages){let n=t.node,o=t.property,u=t.value;const l=[],h=[];let d=Object.keys(n).length;for(;o===c&&r.isObject(p[n["@id"]])&&r.isArray(n[a])&&1===n[a].length&&r.isArray(n[c])&&1===n[c].length&&(3===d||4===d&&r.isArray(n["@type"])&&1===n["@type"].length&&n["@type"][0]===s)&&(l.push(n[a][0]),h.push(n["@id"]),t=p[n["@id"]],n=t.node,o=t.property,u=t.value,d=Object.keys(n).length,i.isBlankNode(n)););delete u["@id"],u["@list"]=l.reverse();for(const t of h)delete e[t]}delete n.usages}}const v=[],g=Object.keys(d).sort();for(const t of g){const e=d[t];if(t in f){const n=e["@graph"]=[],r=f[t],o=Object.keys(r).sort();for(const t of o){const e=r[t];i.isSubjectReference(e)||n.push(e)}}i.isSubjectReference(e)||v.push(e)}return v}}}),Ra=Kt({"../node_modules/canonicalize/lib/canonicalize.js"(t,e){e.exports=function t(e){return null===e||"object"!=typeof e||null!=e.toJSON?JSON.stringify(e):Array.isArray(e)?"["+e.reduce(((e,n,i)=>e+(0===i?"":",")+t(void 0===n||"symbol"==typeof n?null:n)),"")+"]":"{"+Object.keys(e).sort().reduce(((n,i)=>void 0===e[i]||"symbol"==typeof e[i]?n:n+(0===n.length?"":",")+t(i)+":"+t(e[i])),"")+"}"}}}),Ia=Kt({"../node_modules/jsonld/lib/toRdf.js"(t,e){var{createNodeMap:n}=_a(),{isKeyword:i}=Fa(),r=ha(),o=Ra(),s=la(),a=fa(),{RDF_FIRST:c,RDF_REST:u,RDF_NIL:l,RDF_TYPE:h,RDF_JSON_LITERAL:d,RDF_LANGSTRING:f,XSD_BOOLEAN:p,XSD_DOUBLE:v,XSD_INTEGER:g,XSD_STRING:m}=pa(),{isAbsolute:w}=ga(),b={};function y(t,e,n,r,o){const s=Object.keys(e).sort();for(const a of s){const s=e[a],c=Object.keys(s).sort();for(let e of c){const c=s[e];if("@type"===e)e=h;else if(i(e))continue;for(const i of c){const s={termType:a.startsWith("_:")?"BlankNode":"NamedNode",value:a};if(!w(a))continue;const c={termType:e.startsWith("_:")?"BlankNode":"NamedNode",value:e};if(!w(e))continue;if("BlankNode"===c.termType&&!o.produceGeneralizedRdf)continue;const u=x(i,r,t,n,o.rdfDirection);u&&t.push({subject:s,predicate:c,object:u,graph:n})}}}}function x(t,e,n,i,a){const h={};if(r.isValue(t)){h.termType="Literal",h.value=void 0,h.datatype={termType:"NamedNode"};let e=t["@value"];const n=t["@type"]||null;"@json"===n?(h.value=o(e),h.datatype.value=d):s.isBoolean(e)?(h.value=e.toString(),h.datatype.value=n||p):s.isDouble(e)||n===v?(s.isDouble(e)||(e=parseFloat(e)),h.value=e.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),h.datatype.value=n||v):s.isNumber(e)?(h.value=e.toFixed(0),h.datatype.value=n||g):"i18n-datatype"===a&&"@direction"in t?(h.datatype.value="https://www.w3.org/ns/i18n#"+(t["@language"]||"")+`_${t["@direction"]}`,h.value=e):"@language"in t?(h.value=e,h.datatype.value=n||f,h.language=t["@language"]):(h.value=e,h.datatype.value=n||m)}else if(r.isList(t)){const r=function(t,e,n,i,r){const o={termType:"NamedNode",value:c},s={termType:"NamedNode",value:u},a={termType:"NamedNode",value:l},h=t.pop(),d=h?{termType:"BlankNode",value:e.getId()}:a;let f=d;for(const a of t){const t=x(a,e,n,i,r),c={termType:"BlankNode",value:e.getId()};n.push({subject:f,predicate:o,object:t,graph:i}),n.push({subject:f,predicate:s,object:c,graph:i}),f=c}if(h){const t=x(h,e,n,i,r);n.push({subject:f,predicate:o,object:t,graph:i}),n.push({subject:f,predicate:s,object:a,graph:i})}return d}(t["@list"],e,n,i,a);h.termType=r.termType,h.value=r.value}else{const e=s.isObject(t)?t["@id"]:t;h.termType=e.startsWith("_:")?"BlankNode":"NamedNode",h.value=e}return"NamedNode"!==h.termType||w(h.value)?h:null}e.exports=b,b.toRDF=(t,e)=>{const i=new a.IdentifierIssuer("_:b"),r={"@default":{}};n(t,r,"@default",i);const o=[],s=Object.keys(r).sort();for(const t of s){let n;if("@default"===t)n={termType:"DefaultGraph",value:""};else{if(!w(t))continue;n=t.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},n.value=t}y(o,r[t],n,i,e)}return o}}}),Ta=Kt({"../node_modules/jsonld/lib/frame.js"(t,e){var{isKeyword:n}=Fa(),i=ha(),r=la(),o=fa(),s=ga(),a=da(),{createNodeMap:c,mergeNodeMapGraphs:u}=_a(),l={};function h(t){const e={};for(const n in t)void 0!==t[n]&&(e["@"+n]=[t[n]]);return[e]}function d(t,e,n){for(let i=n.length-1;i>=0;--i){const r=n[i];if(r.graph===e&&r.subject["@id"]===t["@id"])return!0}return!1}function f(t,e,n){const i="@"+n;let r=i in t?t[i][0]:e[n];if("embed"===n)if(!0===r)r="@once";else if(!1===r)r="@never";else if("@always"!==r&&"@never"!==r&&"@link"!==r&&"@first"!==r&&"@last"!==r&&"@once"!==r)throw new a("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:t});return r}function p(t){if(!r.isArray(t)||1!==t.length||!r.isObject(t[0]))throw new a("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:t});if("@id"in t[0])for(const e of o.asArray(t[0]["@id"]))if(!r.isObject(e)&&!s.isAbsolute(e)||r.isString(e)&&0===e.indexOf("_:"))throw new a("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:t});if("@type"in t[0])for(const e of o.asArray(t[0]["@type"]))if(!r.isObject(e)&&!s.isAbsolute(e)||r.isString(e)&&0===e.indexOf("_:"))throw new a("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:t})}function v(t,e,s,a){let c=!0,u=!1;for(const l in s){let h=!1;const d=o.getValues(e,l),f=0===o.getValues(s,l).length;if("@id"===l){if(r.isEmptyObject(s["@id"][0]||{})?h=!0:s["@id"].length>=0&&(h=s["@id"].includes(d[0])),!a.requireAll)return h}else if("@type"===l){if(c=!1,f){if(d.length>0)return!1;h=!0}else if(1===s["@type"].length&&r.isEmptyObject(s["@type"][0]))h=d.length>0;else for(const t of s["@type"])h=!(!r.isObject(t)||!("@default"in t))||h||d.some((e=>e===t));if(!a.requireAll)return h}else{if(n(l))continue;{const e=o.getValues(s,l)[0];let n=!1;if(e&&(p([e]),n="@default"in e),c=!1,0===d.length&&n)continue;if(d.length>0&&f)return!1;if(void 0===e){if(d.length>0)return!1;h=!0}else if(i.isList(e)){const n=e["@list"][0];if(i.isList(d[0])){const e=d[0]["@list"];i.isValue(n)?h=e.some((t=>y(n,t))):(i.isSubject(n)||i.isSubjectReference(n))&&(h=e.some((e=>b(t,n,e,a))))}}else h=i.isValue(e)?d.some((t=>y(e,t))):i.isSubjectReference(e)?d.some((n=>b(t,e,n,a))):!!r.isObject(e)&&d.length>0}}if(!h&&a.requireAll)return!1;u=u||h}return c||u}function g(t,e){const n=t.uniqueEmbeds[t.graph],i=n[e],s=i.parent,a=i.property,c={"@id":e};if(r.isArray(s)){for(let t=0;t<s.length;++t)if(o.compareValues(s[t],c)){s[t]=c;break}}else{const t=r.isArray(s[a]);o.removeValue(s,a,c,{propertyIsArray:t}),o.addValue(s,a,c,{propertyIsArray:t})}const u=t=>{const e=Object.keys(n);for(const i of e)i in n&&r.isObject(n[i].parent)&&n[i].parent["@id"]===t&&(delete n[i],u(i))};u(e)}function m(t,e){if(r.isArray(t))return t.map((t=>m(t,e)));if(r.isObject(t)){if("@preserve"in t)return t["@preserve"][0];if(i.isValue(t))return t;if(i.isList(t))return t["@list"]=m(t["@list"],e),t;if("@id"in t){const n=t["@id"];if(e.link.hasOwnProperty(n)){const i=e.link[n].indexOf(t);if(-1!==i)return e.link[n][i];e.link[n].push(t)}else e.link[n]=[t]}for(const n in t)"@id"===n&&e.bnodesToClear.includes(t[n])?delete t["@id"]:t[n]=m(t[n],e)}return t}function w(t,e,n){r.isObject(t)?o.addValue(t,e,n,{propertyIsArray:!0}):t.push(n)}function b(t,e,n,i){if(!("@id"in n))return!1;const r=t.subjects[n["@id"]];return r&&v(t,r,e,i)}function y(t,e){const n=e["@value"],i=e["@type"],o=e["@language"],s=t["@value"]?r.isArray(t["@value"])?t["@value"]:[t["@value"]]:[],a=t["@type"]?r.isArray(t["@type"])?t["@type"]:[t["@type"]]:[],c=t["@language"]?r.isArray(t["@language"])?t["@language"]:[t["@language"]]:[];return 0===s.length&&0===a.length&&0===c.length||!(!s.includes(n)&&!r.isEmptyObject(s[0]))&&!!(!i&&0===a.length||a.includes(i)||i&&r.isEmptyObject(a[0]))&&!!(!o&&0===c.length||c.includes(o)||o&&r.isEmptyObject(c[0]))}e.exports=l,l.frameMergedOrDefault=(t,e,n)=>{const i={options:n,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},r=new o.IdentifierIssuer("_:b");c(t,i.graphMap,"@default",r),n.merged&&(i.graphMap["@merged"]=u(i.graphMap),i.graph="@merged"),i.subjects=i.graphMap[i.graph];const s=[];return l.frame(i,Object.keys(i.subjects).sort(),e,s),n.pruneBlankNodeIdentifiers&&(n.bnodesToClear=Object.keys(i.bnodeMap).filter((t=>1===i.bnodeMap[t].length))),n.link={},m(s,n)},l.frame=(t,e,s,c,u=null)=>{p(s);const m=t.options,b={embed:f(s=s[0],m,"embed"),explicit:f(s,m,"explicit"),requireAll:f(s,m,"requireAll")};t.link.hasOwnProperty(t.graph)||(t.link[t.graph]={});const x=t.link[t.graph],k=function(t,e,n,i){const r={};for(const o of e){const e=t.graphMap[t.graph][o];v(t,e,n,i)&&(r[o]=e)}return r}(t,e,s,b),E=Object.keys(k).sort();for(const p of E){const v=k[p];if(null===u?t.uniqueEmbeds={[t.graph]:{}}:t.uniqueEmbeds[t.graph]=t.uniqueEmbeds[t.graph]||{},"@link"===b.embed&&p in x){w(c,u,x[p]);continue}const E={"@id":p};if(0===p.indexOf("_:")&&o.addValue(t.bnodeMap,p,E,{propertyIsArray:!0}),x[p]=E,("@first"===b.embed||"@last"===b.embed)&&t.is11)throw new a("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:s});if(t.embedded||!t.uniqueEmbeds[t.graph].hasOwnProperty(p))if(!t.embedded||"@never"!==b.embed&&!d(v,t.graph,t.subjectStack))if(!t.embedded||"@first"!=b.embed&&"@once"!=b.embed||!t.uniqueEmbeds[t.graph].hasOwnProperty(p)){if("@last"===b.embed&&p in t.uniqueEmbeds[t.graph]&&g(t,p),t.uniqueEmbeds[t.graph][p]={parent:c,property:u},t.subjectStack.push({subject:v,graph:t.graph}),p in t.graphMap){let e=!1,n=null;"@graph"in s?(n=s["@graph"][0],e=!("@merged"===p||"@default"===p),r.isObject(n)||(n={})):(e="@merged"!==t.graph,n={}),e&&l.frame({...t,graph:p,embedded:!1},Object.keys(t.graphMap[p]).sort(),[n],E,"@graph")}"@included"in s&&l.frame({...t,embedded:!1},e,s["@included"],E,"@included");for(const e of Object.keys(v).sort())if(n(e)){if(E[e]=o.clone(v[e]),"@type"===e)for(const e of v["@type"])0===e.indexOf("_:")&&o.addValue(t.bnodeMap,e,E,{propertyIsArray:!0})}else if(!b.explicit||e in s)for(const n of v[e]){const r=e in s?s[e]:h(b);if(i.isList(n)){const r=s[e]&&s[e][0]&&s[e][0]["@list"]?s[e][0]["@list"]:h(b),a={"@list":[]};w(E,e,a);const c=n["@list"];for(const e of c)i.isSubjectReference(e)?l.frame({...t,embedded:!0},[e["@id"]],r,a,"@list"):w(a,"@list",o.clone(e))}else i.isSubjectReference(n)?l.frame({...t,embedded:!0},[n["@id"]],r,E,e):y(r[0],n)&&w(E,e,o.clone(n))}for(const t of Object.keys(s).sort()){if("@type"===t){if(!r.isObject(s[t][0])||!("@default"in s[t][0]))continue}else if(n(t))continue;const e=s[t][0]||{};if(!f(e,m,"omitDefault")&&!(t in E)){let n="@null";"@default"in e&&(n=o.clone(e["@default"])),r.isArray(n)||(n=[n]),E[t]=[{"@preserve":n}]}}for(const e of Object.keys(s["@reverse"]||{}).sort()){const n=s["@reverse"][e];for(const i of Object.keys(t.subjects))o.getValues(t.subjects[i],e).some((t=>t["@id"]===p))&&(E["@reverse"]=E["@reverse"]||{},o.addValue(E["@reverse"],e,[],{propertyIsArray:!0}),l.frame({...t,embedded:!0},[i],n,E["@reverse"][e],u))}w(c,u,E),t.subjectStack.pop()}else w(c,u,E);else w(c,u,E)}},l.cleanupNull=(t,e)=>{if(r.isArray(t))return t.map((t=>l.cleanupNull(t,e))).filter((t=>t));if("@null"===t)return null;if(r.isObject(t)){if("@id"in t){const n=t["@id"];if(e.link.hasOwnProperty(n)){const i=e.link[n].indexOf(t);if(-1!==i)return e.link[n][i];e.link[n].push(t)}else e.link[n]=[t]}for(const n in t)t[n]=l.cleanupNull(t[n],e)}return t}}}),Oa=Kt({"../node_modules/jsonld/lib/compact.js"(t,e){var n=da(),{isArray:i,isObject:r,isString:o,isUndefined:s}=la(),{isList:a,isValue:c,isGraph:u,isSimpleGraph:l,isSubjectReference:h}=ha(),{expandIri:d,getContextValue:f,isKeyword:p,process:v,processingMode:g}=Fa(),{removeBase:m,prependBase:w}=ga(),{addValue:b,asArray:y,compareShortestLeast:x}=fa(),k={};function E(t,e,i){if("@nest"!==d(t,e,{vocab:!0},i))throw new n("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}e.exports=k,k.compact=async({activeCtx:t,activeProperty:e=null,element:d,options:m={},compactionMap:w=(()=>{})})=>{if(i(d)){let n=[];for(let i=0;i<d.length;++i){let r=await k.compact({activeCtx:t,activeProperty:e,element:d[i],options:m,compactionMap:w});null===r&&(r=await w({unmappedValue:d[i],activeCtx:t,activeProperty:e,parent:d,index:i,options:m}),void 0===r)||n.push(r)}return m.compactArrays&&1===n.length&&0===(f(t,e,"@container")||[]).length&&(n=n[0]),n}const x=f(t,e,"@context");if(s(x)||(t=await v({activeCtx:t,localCtx:x,propagate:!0,overrideProtected:!0,options:m})),r(d)){if(m.link&&"@id"in d&&m.link.hasOwnProperty(d["@id"])){const t=m.link[d["@id"]];for(let e=0;e<t.length;++e)if(t[e].expanded===d)return t[e].compacted}if(c(d)||h(d)){const n=k.compactValue({activeCtx:t,activeProperty:e,value:d,options:m});return m.link&&h(d)&&(m.link.hasOwnProperty(d["@id"])||(m.link[d["@id"]]=[]),m.link[d["@id"]].push({expanded:d,compacted:n})),n}if(a(d)&&(f(t,e,"@container")||[]).includes("@list"))return k.compact({activeCtx:t,activeProperty:e,element:d["@list"],options:m,compactionMap:w});const x="@reverse"===e,S={},F=t;c(d)||h(d)||(t=t.revertToPreviousContext());const A=f(F,e,"@context");s(A)||(t=await v({activeCtx:t,localCtx:A,propagate:!0,overrideProtected:!0,options:m})),m.link&&"@id"in d&&(m.link.hasOwnProperty(d["@id"])||(m.link[d["@id"]]=[]),m.link[d["@id"]].push({expanded:d,compacted:S}));let _=d["@type"]||[];_.length>1&&(_=Array.from(_).sort());const j=t;for(const e of _){const n=k.compactIri({activeCtx:j,iri:e,relativeTo:{vocab:!0}}),i=f(F,n,"@context");s(i)||(t=await v({activeCtx:t,localCtx:i,options:m,propagate:!1}))}const C=Object.keys(d).sort();for(const s of C){const h=d[s];if("@id"!==s)if("@type"!==s)if("@reverse"!==s)if("@preserve"!==s)if("@index"!==s)if("@graph"!==s&&"@list"!==s&&"@included"!==s&&p(s)){const e=k.compactIri({activeCtx:t,iri:s,relativeTo:{vocab:!0}});b(S,e,h)}else{if(!i(h))throw new n("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===h.length){const e=k.compactIri({activeCtx:t,iri:s,value:h,relativeTo:{vocab:!0},reverse:x}),n=t.mappings.has(e)?t.mappings.get(e)["@nest"]:null;let i=S;n&&(E(t,n,m),r(S[n])||(S[n]={}),i=S[n]),b(i,e,h,{propertyIsArray:!0})}for(const e of h){const n=k.compactIri({activeCtx:t,iri:s,value:e,relativeTo:{vocab:!0},reverse:x}),h=t.mappings.has(n)?t.mappings.get(n)["@nest"]:null;let d=S;h&&(E(t,h,m),r(S[h])||(S[h]={}),d=S[h]);const p=f(t,n,"@container")||[],v=u(e),g=a(e);let F;g?F=e["@list"]:v&&(F=e["@graph"]);let A=await k.compact({activeCtx:t,activeProperty:n,element:g||v?F:e,options:m,compactionMap:w});if(g){if(i(A)||(A=[A]),p.includes("@list")){b(d,n,A,{valueIsArray:!0,allowDuplicate:!0});continue}A={[k.compactIri({activeCtx:t,iri:"@list",relativeTo:{vocab:!0}})]:A},"@index"in e&&(A[k.compactIri({activeCtx:t,iri:"@index",relativeTo:{vocab:!0}})]=e["@index"])}if(v)if(p.includes("@graph")&&(p.includes("@id")||p.includes("@index")&&l(e))){let i;d.hasOwnProperty(n)?i=d[n]:d[n]=i={};const r=(p.includes("@id")?e["@id"]:e["@index"])||k.compactIri({activeCtx:t,iri:"@none",relativeTo:{vocab:!0}});b(i,r,A,{propertyIsArray:!m.compactArrays||p.includes("@set")})}else p.includes("@graph")&&l(e)?(i(A)&&A.length>1&&(A={"@included":A}),b(d,n,A,{propertyIsArray:!m.compactArrays||p.includes("@set")})):(i(A)&&1===A.length&&m.compactArrays&&(A=A[0]),A={[k.compactIri({activeCtx:t,iri:"@graph",relativeTo:{vocab:!0}})]:A},"@id"in e&&(A[k.compactIri({activeCtx:t,iri:"@id",relativeTo:{vocab:!0}})]=e["@id"]),"@index"in e&&(A[k.compactIri({activeCtx:t,iri:"@index",relativeTo:{vocab:!0}})]=e["@index"]),b(d,n,A,{propertyIsArray:!m.compactArrays||p.includes("@set")}));else if(p.includes("@language")||p.includes("@index")||p.includes("@id")||p.includes("@type")){let i,r;if(d.hasOwnProperty(n)?i=d[n]:d[n]=i={},p.includes("@language"))c(A)&&(A=A["@value"]),r=e["@language"];else if(p.includes("@index")){const i=f(t,n,"@index")||"@index",s=k.compactIri({activeCtx:t,iri:i,relativeTo:{vocab:!0}});if("@index"===i)r=e["@index"],delete A[s];else{let t;if([r,...t]=y(A[i]||[]),o(r))switch(t.length){case 0:delete A[i];break;case 1:A[i]=t[0];break;default:A[i]=t}else r=null}}else if(p.includes("@id")){const e=k.compactIri({activeCtx:t,iri:"@id",relativeTo:{vocab:!0}});r=A[e],delete A[e]}else if(p.includes("@type")){const i=k.compactIri({activeCtx:t,iri:"@type",relativeTo:{vocab:!0}});let o;switch([r,...o]=y(A[i]||[]),o.length){case 0:delete A[i];break;case 1:A[i]=o[0];break;default:A[i]=o}1===Object.keys(A).length&&"@id"in e&&(A=await k.compact({activeCtx:t,activeProperty:n,element:{"@id":e["@id"]},options:m,compactionMap:w}))}r||(r=k.compactIri({activeCtx:t,iri:"@none",relativeTo:{vocab:!0}})),b(i,r,A,{propertyIsArray:p.includes("@set")})}else{const t=!m.compactArrays||p.includes("@set")||p.includes("@list")||i(A)&&0===A.length||"@list"===s||"@graph"===s;b(d,n,A,{propertyIsArray:t})}}}else{if((f(t,e,"@container")||[]).includes("@index"))continue;const n=k.compactIri({activeCtx:t,iri:s,relativeTo:{vocab:!0}});b(S,n,h)}else{const n=await k.compact({activeCtx:t,activeProperty:e,element:h,options:m,compactionMap:w});i(n)&&0===n.length||b(S,s,n)}else{const e=await k.compact({activeCtx:t,activeProperty:"@reverse",element:h,options:m,compactionMap:w});for(const n in e)if(t.mappings.has(n)&&t.mappings.get(n).reverse){const i=e[n],r=(f(t,n,"@container")||[]).includes("@set")||!m.compactArrays;b(S,n,i,{propertyIsArray:r}),delete e[n]}if(Object.keys(e).length>0){const n=k.compactIri({activeCtx:t,iri:s,relativeTo:{vocab:!0}});b(S,n,e)}}else{let e=y(h).map((t=>k.compactIri({activeCtx:F,iri:t,relativeTo:{vocab:!0}})));1===e.length&&(e=e[0]);const n=k.compactIri({activeCtx:t,iri:"@type",relativeTo:{vocab:!0}}),r=(f(t,n,"@container")||[]).includes("@set")&&g(t,1.1)||i(e)&&0===h.length;b(S,n,e,{propertyIsArray:r})}else{let e=y(h).map((e=>k.compactIri({activeCtx:t,iri:e,relativeTo:{vocab:!1},base:m.base})));1===e.length&&(e=e[0]),S[k.compactIri({activeCtx:t,iri:"@id",relativeTo:{vocab:!0}})]=e}}return S}return d},k.compactIri=({activeCtx:t,iri:e,value:i=null,relativeTo:o={vocab:!1},reverse:s=!1,base:l=null})=>{if(null===e)return e;t.isPropertyTermScoped&&t.previousContext&&(t=t.previousContext);const h=t.getInverse();if(p(e)&&e in h&&"@none"in h[e]&&"@type"in h[e]["@none"]&&"@none"in h[e]["@none"]["@type"])return h[e]["@none"]["@type"]["@none"];if(o.vocab&&e in h){const n=t["@language"]||"@none",o=[];r(i)&&"@index"in i&&!("@graph"in i)&&o.push("@index","@index@set"),r(i)&&"@preserve"in i&&(i=i["@preserve"][0]),u(i)?("@index"in i&&o.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in i&&o.push("@graph@id","@graph@id@set"),o.push("@graph","@graph@set","@set"),"@index"in i||o.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in i||o.push("@graph@id","@graph@id@set")):r(i)&&!c(i)&&o.push("@id","@id@set","@type","@set@type");let l="@language",h="@null";if(s)l="@type",h="@reverse",o.push("@set");else if(a(i)){"@index"in i||o.push("@list");const t=i["@list"];if(0===t.length)l="@any",h="@none";else{let e=0===t.length?n:null,i=null;for(let n=0;n<t.length;++n){const r=t[n];let o="@none",s="@none";if(c(r)?"@direction"in r?o=`${(r["@language"]||"").toLowerCase()}_${r["@direction"]}`:"@language"in r?o=r["@language"].toLowerCase():"@type"in r?s=r["@type"]:o="@null":s="@id",null===e?e=o:o!==e&&c(r)&&(e="@none"),null===i?i=s:s!==i&&(i="@none"),"@none"===e&&"@none"===i)break}e=e||"@none",i=i||"@none","@none"!==i?(l="@type",h=i):h=e}}else{if(c(i))if("@language"in i&&!("@index"in i)){o.push("@language","@language@set"),h=i["@language"];const t=i["@direction"];t&&(h=`${h}_${t}`)}else"@direction"in i&&!("@index"in i)?h=`_${i["@direction"]}`:"@type"in i&&(l="@type",h=i["@type"]);else l="@type",h="@id";o.push("@set")}o.push("@none"),r(i)&&!("@index"in i)&&o.push("@index","@index@set"),c(i)&&1===Object.keys(i).length&&o.push("@language","@language@set");const d=function(t,e,n,i,o,s){null===s&&(s="@null");const a=[];if(("@id"===s||"@reverse"===s)&&r(n)&&"@id"in n){"@reverse"===s&&a.push("@reverse");const e=k.compactIri({activeCtx:t,iri:n["@id"],relativeTo:{vocab:!0}});t.mappings.has(e)&&t.mappings.get(e)&&t.mappings.get(e)["@id"]===n["@id"]?a.push.apply(a,["@vocab","@id"]):a.push.apply(a,["@id","@vocab"])}else{a.push(s);const t=a.find((t=>t.includes("_")));t&&a.push(t.replace(/^[^_]+_/,"_"))}a.push("@none");const c=t.inverse[e];for(const t of i){if(!(t in c))continue;const e=c[t][o];for(const t of a)if(t in e)return e[t]}return null}(t,e,i,o,l,h);if(null!==d)return d}if(o.vocab&&"@vocab"in t){const n=t["@vocab"];if(0===e.indexOf(n)&&e!==n){const i=e.substr(n.length);if(!t.mappings.has(i))return i}}let d=null;const f=[];let v=t.fastCurieMap;const g=e.length-1;for(let t=0;t<g&&e[t]in v;++t)v=v[e[t]],""in v&&f.push(v[""][0]);for(let n=f.length-1;n>=0;--n){const r=f[n],o=r.terms;for(const n of o){const o=n+":"+e.substr(r.iri.length);t.mappings.get(n)._prefix&&(!t.mappings.has(o)||null===i&&t.mappings.get(o)["@id"]===e)&&(null===d||x(o,d)<0)&&(d=o)}}if(null!==d)return d;for(const[i,r]of t.mappings)if(r&&r._prefix&&e.startsWith(i+":"))throw new n(`Absolute IRI "${e}" confused with prefix "${i}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:t});return o.vocab?e:"@base"in t?t["@base"]?m(w(l,t["@base"]),e):e:m(l,e)},k.compactValue=({activeCtx:t,activeProperty:e,value:n,options:i})=>{if(c(n)){const i=f(t,e,"@type"),r=f(t,e,"@language"),s=f(t,e,"@direction"),a=f(t,e,"@container")||[],c="@index"in n&&!a.includes("@index");if(!c&&"@none"!==i){if(n["@type"]===i)return n["@value"];if("@language"in n&&n["@language"]===r&&"@direction"in n&&n["@direction"]===s)return n["@value"];if("@language"in n&&n["@language"]===r)return n["@value"];if("@direction"in n&&n["@direction"]===s)return n["@value"]}const u=Object.keys(n).length,l=1===u||2===u&&"@index"in n&&!c,h="@language"in t,d=o(n["@value"]),p=t.mappings.has(e)&&null===t.mappings.get(e)["@language"];if(l&&"@none"!==i&&(!h||!d||p))return n["@value"];const v={};return c&&(v[k.compactIri({activeCtx:t,iri:"@index",relativeTo:{vocab:!0}})]=n["@index"]),"@type"in n?v[k.compactIri({activeCtx:t,iri:"@type",relativeTo:{vocab:!0}})]=k.compactIri({activeCtx:t,iri:n["@type"],relativeTo:{vocab:!0}}):"@language"in n&&(v[k.compactIri({activeCtx:t,iri:"@language",relativeTo:{vocab:!0}})]=n["@language"]),"@direction"in n&&(v[k.compactIri({activeCtx:t,iri:"@direction",relativeTo:{vocab:!0}})]=n["@direction"]),v[k.compactIri({activeCtx:t,iri:"@value",relativeTo:{vocab:!0}})]=n["@value"],v}const r=d(t,e,{vocab:!0},i),s=f(t,e,"@type"),a=k.compactIri({activeCtx:t,iri:n["@id"],relativeTo:{vocab:"@vocab"===s},base:i.base});return"@id"===s||"@vocab"===s||"@graph"===r?a:{[k.compactIri({activeCtx:t,iri:"@id",relativeTo:{vocab:!0}})]:a}}}}),Na=Kt({"../node_modules/jsonld/lib/JsonLdProcessor.js"(t,e){e.exports=t=>{class e{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(e,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(e.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:e}),e.compact=function(e,n){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):t.compact(e,n)},e.expand=function(e){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):t.expand(e)},e.flatten=function(e){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):t.flatten(e)},e}}}),Pa=Kt({"../node_modules/jsonld/lib/jsonld.js"(t,e){var n=ua(),i=wa(),r=fa(),o=Ea(),s=r.IdentifierIssuer,a=da(),c=xa(),u=Sa(),{expand:l}=Aa(),{flatten:h}=ja(),{fromRDF:d}=Ca(),{toRDF:f}=Ia(),{frameMergedOrDefault:p,cleanupNull:v}=Ta(),{isArray:g,isObject:m,isString:w}=la(),{isSubjectReference:b}=ha(),{expandIri:y,getInitialContext:x,process:k,processingMode:E}=Fa(),{compact:S,compactIri:F}=Oa(),{createNodeMap:A,createMergedNodeMap:_,mergeNodeMaps:j}=_a(),C=function(t){const e={},C=new c({max:100});function R(e,{documentLoader:n=t.documentLoader,...i}){return Object.assign({},{documentLoader:n},i,e)}return t.compact=async function(e,n,i){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===n)throw new a("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===e)return null;let c;(i=R(i,{base:w(e)?e:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new s("_:b"),contextResolver:new o({sharedCache:C})})).link&&(i.skipExpansion=!0),i.compactToRelative||delete i.base,c=i.skipExpansion?e:await t.expand(e,i);const u=await t.processContext(x(i),n,i);let l=await S({activeCtx:u,element:c,options:i,compactionMap:i.compactionMap});i.compactArrays&&!i.graph&&g(l)?1===l.length?l=l[0]:0===l.length&&(l={}):i.graph&&m(l)&&(l=[l]),m(n)&&"@context"in n&&(n=n["@context"]),n=r.clone(n),g(n)||(n=[n]);const h=n;n=[];for(let t=0;t<h.length;++t)(!m(h[t])||Object.keys(h[t]).length>0)&&n.push(h[t]);const d=n.length>0;if(1===n.length&&(n=n[0]),g(l)){const t=F({activeCtx:u,iri:"@graph",relativeTo:{vocab:!0}}),e=l;l={},d&&(l["@context"]=n),l[t]=e}else if(m(l)&&d){const t=l;l={"@context":n};for(const e in t)l[e]=t[e]}return l},t.expand=async function(e,n){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");!1===(n=R(n,{keepFreeFloatingNodes:!1,contextResolver:new o({sharedCache:C})})).expansionMap&&(n.expansionMap=void 0);const i={},s=[];if("expandContext"in n){const t=r.clone(n.expandContext);i.expandContext=m(t)&&"@context"in t?t:{"@context":t},s.push(i.expandContext)}let a;if(w(e)){const r=await t.get(e,n);a=r.documentUrl,i.input=r.document,r.contextUrl&&(i.remoteContext={"@context":r.contextUrl},s.push(i.remoteContext))}else i.input=r.clone(e);"base"in n||(n.base=a||"");let c=x(n);for(const t of s)c=await k({activeCtx:c,localCtx:t,options:n});let u=await l({activeCtx:c,element:i.input,options:n,expansionMap:n.expansionMap});return m(u)&&"@graph"in u&&1===Object.keys(u).length?u=u["@graph"]:null===u&&(u=[]),g(u)||(u=[u]),u},t.flatten=async function(e,n,i){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");n="function"==typeof n?null:n||null,i=R(i,{base:w(e)?e:"",contextResolver:new o({sharedCache:C})});const r=await t.expand(e,i),s=h(r);if(null===n)return s;i.graph=!0,i.skipExpansion=!0;const a=await t.compact(s,n,i);return a},t.frame=async function(e,n,i){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(i=R(i,{base:w(e)?e:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new o({sharedCache:C})}),w(n)){const e=await t.get(n,i);if(n=e.document,e.contextUrl){let t=n["@context"];t?g(t)?t.push(e.contextUrl):t=[t,e.contextUrl]:t=e.contextUrl,n["@context"]=t}}const r=n&&n["@context"]||{},s=await t.processContext(x(i),r,i);i.hasOwnProperty("omitGraph")||(i.omitGraph=E(s,1.1)),i.hasOwnProperty("pruneBlankNodeIdentifiers")||(i.pruneBlankNodeIdentifiers=E(s,1.1));const a=await t.expand(e,i),c={...i};c.isFrame=!0,c.keepFreeFloatingNodes=!0;const u=await t.expand(n,c),l=Object.keys(n).map((t=>y(s,t,{vocab:!0})));c.merged=!l.includes("@graph"),c.is11=E(s,1.1);const h=p(a,u,c);c.graph=!i.omitGraph,c.skipExpansion=!0,c.link={},c.framing=!0;let d=await t.compact(h,r,c);return c.link={},d=v(d,c),d},t.link=async function(e,n,i){const r={};return n&&(r["@context"]=n),r["@embed"]="@link",t.frame(e,r,i)},t.normalize=t.canonize=async function(e,i){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(i=R(i,{base:w(e)?e:"",algorithm:"URDNA2015",skipExpansion:!1,contextResolver:new o({sharedCache:C})}))){if("application/n-quads"!==i.inputFormat&&"application/nquads"!==i.inputFormat)throw new a("Unknown canonicalization input format.","jsonld.CanonizeError");const t=u.parse(e);return n.canonize(t,i)}const r={...i};delete r.format,r.produceGeneralizedRdf=!1;const s=await t.toRDF(e,r);return n.canonize(s,i)},t.fromRDF=async function(t,n){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");n=R(n,{format:w(t)?"application/n-quads":void 0});const{format:i}=n;let{rdfParser:r}=n;if(i){if(r=r||e[i],!r)throw new a("Unknown input format.","jsonld.UnknownFormat",{format:i})}else r=()=>t;const o=await r(t);return d(o,n)},t.toRDF=async function(e,n){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let i;i=(n=R(n,{base:w(e)?e:"",skipExpansion:!1,contextResolver:new o({sharedCache:C})})).skipExpansion?e:await t.expand(e,n);const r=f(i,n);if(n.format){if("application/n-quads"===n.format||"application/nquads"===n.format)return u.serialize(r);throw new a("Unknown output format.","jsonld.UnknownFormat",{format:n.format})}return r},t.createNodeMap=async function(e,n){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");n=R(n,{base:w(e)?e:"",contextResolver:new o({sharedCache:C})});const i=await t.expand(e,n);return _(i,n)},t.merge=async function(e,n,i){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!g(e))throw new TypeError('Could not merge, "docs" must be an array.');n="function"==typeof n?null:n||null,i=R(i,{contextResolver:new o({sharedCache:C})});const a=await Promise.all(e.map((e=>{const n={...i};return t.expand(e,n)})));let c=!0;"mergeNodes"in i&&(c=i.mergeNodes);const u=i.issuer||new s("_:b"),l={"@default":{}};for(let t=0;t<a.length;++t){const e=r.relabelBlankNodes(a[t],{issuer:new s("_:b"+t+"-")}),n=c||0===t?l:{"@default":{}};if(A(e,n,"@default",u),n!==l)for(const t in n){const e=n[t];if(!(t in l)){l[t]=e;continue}const i=l[t];for(const t in e)t in i||(i[t]=e[t])}}const h=j(l),d=[],f=Object.keys(h).sort();for(let t=0;t<f.length;++t){const e=h[f[t]];b(e)||d.push(e)}if(null===n)return d;i.graph=!0,i.skipExpansion=!0;const p=await t.compact(d,n,i);return p},Object.defineProperty(t,"documentLoader",{get:()=>t._documentLoader,set:e=>t._documentLoader=e}),t.documentLoader=async t=>{throw new a("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:t})},t.get=async function(e,n){let i;i="function"==typeof n.documentLoader?n.documentLoader:t.documentLoader;const r=await i(e);try{if(!r.document)throw new a("No remote document found at the given URL.","jsonld.NullRemoteDocument");w(r.document)&&(r.document=JSON.parse(r.document))}catch(t){throw new a("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:t,remoteDoc:r})}return r},t.processContext=async function(t,e,n){return n=R(n,{base:"",contextResolver:new o({sharedCache:C})}),null===e?x(n):(e=r.clone(e),m(e)&&"@context"in e||(e={"@context":e}),k({activeCtx:t,localCtx:e,options:n}))},t.getContextValue=Fa().getContextValue,t.documentLoaders={},t.useDocumentLoader=function(e){if(!(e in t.documentLoaders))throw new a('Unknown document loader type: "'+e+'"',"jsonld.UnknownDocumentLoader",{type:e});t.documentLoader=t.documentLoaders[e].apply(t,Array.prototype.slice.call(arguments,1))},t.registerRDFParser=function(t,n){e[t]=n},t.unregisterRDFParser=function(t){delete e[t]},t.registerRDFParser("application/n-quads",u.parse),t.registerRDFParser("application/nquads",u.parse),t.url=ga(),t.util=r,Object.assign(t,r),t.promises=t,t.RequestQueue=va(),t.JsonLdProcessor=Na()(t),i.setupGlobals(t),i.setupDocumentLoaders(t),t},R=function(){return C((function(){return R()}))};C(R),e.exports=R}}),Da=Kt({"../node_modules/queue-microtask/index.js"(t,e){var n;e.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:global):t=>(n||(n=Promise.resolve())).then(t).catch((t=>setTimeout((()=>{throw t}),0)))}}),Ma=Kt({"../node_modules/@babel/runtime/helpers/typeof.js"(t,e){function n(t){return e.exports=n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e.exports.__esModule=!0,e.exports.default=e.exports,n(t)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),Ua=Kt({"../node_modules/@babel/runtime/helpers/regeneratorRuntime.js"(t,e){var n=Ma().default;function i(){e.exports=i=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},r=Object.prototype,o=r.hasOwnProperty,s="function"==typeof Symbol?Symbol:{},a=s.iterator||"@@iterator",c=s.asyncIterator||"@@asyncIterator",u=s.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function h(t,e,n,i){var r,o,s,a,c=Object.create((e&&e.prototype instanceof p?e:p).prototype),u=new A(i||[]);return c._invoke=(r=t,o=n,s=u,a="suspendedStart",function(t,e){if("executing"===a)throw new Error("Generator is already running");if("completed"===a){if("throw"===t)throw e;return{value:void 0,done:!0}}for(s.method=t,s.arg=e;;){var n=s.delegate;if(n){var i=E(n,s);if(i){if(i===f)continue;return i}}if("next"===s.method)s.sent=s._sent=s.arg;else if("throw"===s.method){if("suspendedStart"===a)throw a="completed",s.arg;s.dispatchException(s.arg)}else"return"===s.method&&s.abrupt("return",s.arg);a="executing";var c=d(r,o,s);if("normal"===c.type){if(a=s.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:s.done}}"throw"===c.type&&(a="completed",s.method="throw",s.arg=c.arg)}}),c}function d(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=h;var f={};function p(){}function v(){}function g(){}var m={};l(m,a,(function(){return this}));var w=Object.getPrototypeOf,b=w&&w(w(_([])));b&&b!==r&&o.call(b,a)&&(m=b);var y=g.prototype=p.prototype=Object.create(m);function x(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function i(r,s,a,c){var u=d(t[r],t,s);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==n(h)&&o.call(h,"__await")?e.resolve(h.__await).then((function(t){i("next",t,a,c)}),(function(t){i("throw",t,a,c)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return i("throw",t,a,c)}))}c(u.arg)}var r;this._invoke=function(t,n){function o(){return new e((function(e,r){i(t,n,e,r)}))}return r=r?r.then(o,o):o()}}function E(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var i=d(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var r=i.arg;return r?r.done?(e[t.resultName]=r.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):r:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function F(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function _(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(o.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:j}}function j(){return{value:void 0,done:!0}}return v.prototype=g,l(y,"constructor",g),l(g,"constructor",v),v.displayName=l(g,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,u,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},x(k.prototype),l(k.prototype,c,(function(){return this})),t.AsyncIterator=k,t.async=function(e,n,i,r,o){void 0===o&&(o=Promise);var s=new k(h(e,n,i,r),o);return t.isGeneratorFunction(n)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},x(y),l(y,u,"Generator"),l(y,a,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var i=e.pop();if(i in t)return n.value=i,n.done=!1,n}return n.done=!0,n}},t.values=_,A.prototype={constructor:A,reset:function(t){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(F),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,i){return s.type="throw",s.arg=t,e.next=n,i&&(e.method="next",e.arg=void 0),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i],s=r.completion;if("root"===r.tryLoc)return n("end");if(r.tryLoc<=this.prev){var a=o.call(r,"catchLoc"),c=o.call(r,"finallyLoc");if(a&&c){if(this.prev<r.catchLoc)return n(r.catchLoc,!0);if(this.prev<r.finallyLoc)return n(r.finallyLoc)}else if(a){if(this.prev<r.catchLoc)return n(r.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return n(r.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&o.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var r=i;break}}r&&("break"===t||"continue"===t)&&r.tryLoc<=e&&e<=r.finallyLoc&&(r=null);var s=r?r.completion:{};return s.type=t,s.arg=e,r?(this.method="next",this.next=r.finallyLoc,f):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),F(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var i=n.completion;if("throw"===i.type){var r=i.arg;F(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:_(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}}),La=Kt({"../node_modules/@babel/runtime/regenerator/index.js"(t,e){var n=Ua()();e.exports=n;try{regeneratorRuntime=n}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}}),Ba=Kt({"../node_modules/@xmldom/xmldom/lib/conventions.js"(t){function e(t,e){return void 0===e&&(e=Object),e&&"function"==typeof e.freeze?e.freeze(t):t}var n=e({HTML:"text/html",isHTML:function(t){return t===n.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),i=e({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(t){return t===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(t,e){if(null===t||"object"!=typeof t)throw new TypeError("target is not an object");for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},t.find=function(t,e,n){if(void 0===n&&(n=Array.prototype),t&&"function"==typeof n.find)return n.find.call(t,e);for(var i=0;i<t.length;i++)if(Object.prototype.hasOwnProperty.call(t,i)){var r=t[i];if(e.call(void 0,r,i,t))return r}},t.freeze=e,t.MIME_TYPE=n,t.NAMESPACE=i}}),Ja=Kt({"../node_modules/@xmldom/xmldom/lib/dom.js"(t){var e=Ba(),n=e.find,i=e.NAMESPACE;function r(t){return""!==t}function o(t,e){return t.hasOwnProperty(e)||(t[e]=!0),t}function s(t){if(!t)return[];var e=function(t){return t?t.split(/[\t\n\f\r ]+/).filter(r):[]}(t);return Object.keys(e.reduce(o,{}))}function a(t,e){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}function c(t,e){var n=t.prototype;if(!(n instanceof e)){let i=function(){};i.prototype=e.prototype,i=new i,a(n,i),t.prototype=n=i}n.constructor!=t&&("function"!=typeof t&&console.error("unknown Class:"+t),n.constructor=t)}var u={},l=u.ELEMENT_NODE=1,h=u.ATTRIBUTE_NODE=2,d=u.TEXT_NODE=3,f=u.CDATA_SECTION_NODE=4,p=u.ENTITY_REFERENCE_NODE=5,v=u.ENTITY_NODE=6,g=u.PROCESSING_INSTRUCTION_NODE=7,m=u.COMMENT_NODE=8,w=u.DOCUMENT_NODE=9,b=u.DOCUMENT_TYPE_NODE=10,y=u.DOCUMENT_FRAGMENT_NODE=11,x=u.NOTATION_NODE=12,k={},E={};k.INDEX_SIZE_ERR=(E[1]="Index size error",1),k.DOMSTRING_SIZE_ERR=(E[2]="DOMString size error",2);var S=k.HIERARCHY_REQUEST_ERR=(E[3]="Hierarchy request error",3);k.WRONG_DOCUMENT_ERR=(E[4]="Wrong document",4),k.INVALID_CHARACTER_ERR=(E[5]="Invalid character",5),k.NO_DATA_ALLOWED_ERR=(E[6]="No data allowed",6),k.NO_MODIFICATION_ALLOWED_ERR=(E[7]="No modification allowed",7);var F=k.NOT_FOUND_ERR=(E[8]="Not found",8);k.NOT_SUPPORTED_ERR=(E[9]="Not supported",9);var A=k.INUSE_ATTRIBUTE_ERR=(E[10]="Attribute in use",10);function _(t,e){if(e instanceof Error)var n=e;else n=this,Error.call(this,E[t]),this.message=E[t],Error.captureStackTrace&&Error.captureStackTrace(this,_);return n.code=t,e&&(this.message=this.message+": "+e),n}function j(){}function C(t,e){this._node=t,this._refresh=e,R(this)}function R(t){var e=t._node._inc||t._node.ownerDocument._inc;if(t._inc!=e){var n=t._refresh(t._node);gt(t,"length",n.length),a(n,t),t._inc=e}}function I(){}function T(t,e){for(var n=t.length;n--;)if(t[n]===e)return n}function O(t,e,n,r){if(r?e[T(e,r)]=n:e[e.length++]=n,t){n.ownerElement=t;var o=t.ownerDocument;o&&(r&&B(o,t,r),function(t,e,n){t&&t._inc++,n.namespaceURI===i.XMLNS&&(e._nsMap[n.prefix?n.localName:""]=n.value)}(o,t,n))}}function N(t,e,n){var i=T(e,n);if(!(i>=0))throw new _(F,new Error(t.tagName+"@"+n));for(var r=e.length-1;i<r;)e[i]=e[++i];if(e.length=r,t){var o=t.ownerDocument;o&&(B(o,t,n),n.ownerElement=null)}}function P(){}function D(){}function M(t){return("<"==t?"&lt;":">"==t&&"&gt;")||"&"==t&&"&amp;"||'"'==t&&"&quot;"||"&#"+t.charCodeAt()+";"}function U(t,e){if(e(t))return!0;if(t=t.firstChild)do{if(U(t,e))return!0}while(t=t.nextSibling)}function L(){this.ownerDocument=this}function B(t,e,n){t&&t._inc++,n.namespaceURI===i.XMLNS&&delete e._nsMap[n.prefix?n.localName:""]}function J(t,e,n){if(t&&t._inc){t._inc++;var i=e.childNodes;if(n)i[i.length++]=n;else{for(var r=e.firstChild,o=0;r;)i[o++]=r,r=r.nextSibling;i.length=o,delete i[i.length]}}}function $(t,e){var n=e.previousSibling,i=e.nextSibling;return n?n.nextSibling=i:t.firstChild=i,i?i.previousSibling=n:t.lastChild=n,e.parentNode=null,e.previousSibling=null,e.nextSibling=null,J(t.ownerDocument,t),e}function H(t){return t&&t.nodeType===D.DOCUMENT_TYPE_NODE}function z(t){return t&&t.nodeType===D.ELEMENT_NODE}function K(t){return t&&t.nodeType===D.TEXT_NODE}function W(t,e){var i=t.childNodes||[];if(n(i,z)||H(e))return!1;var r=n(i,H);return!(e&&r&&i.indexOf(r)>i.indexOf(e))}function q(t,e){var i=t.childNodes||[];if(n(i,(function(t){return z(t)&&t!==e})))return!1;var r=n(i,H);return!(e&&r&&i.indexOf(r)>i.indexOf(e))}function V(t,e,i){var r=t.childNodes||[],o=e.childNodes||[];if(e.nodeType===D.DOCUMENT_FRAGMENT_NODE){var s=o.filter(z);if(s.length>1||n(o,K))throw new _(S,"More than one element or text in fragment");if(1===s.length&&!W(t,i))throw new _(S,"Element in fragment can not be inserted before doctype")}if(z(e)&&!W(t,i))throw new _(S,"Only one element can be added and only after doctype");if(H(e)){if(n(r,H))throw new _(S,"Only one doctype is allowed");var a=n(r,z);if(i&&r.indexOf(a)<r.indexOf(i))throw new _(S,"Doctype can only be inserted before an element");if(!i&&a)throw new _(S,"Doctype can not be appended since element is present")}}function G(t,e,i){var r=t.childNodes||[],o=e.childNodes||[];if(e.nodeType===D.DOCUMENT_FRAGMENT_NODE){var s=o.filter(z);if(s.length>1||n(o,K))throw new _(S,"More than one element or text in fragment");if(1===s.length&&!q(t,i))throw new _(S,"Element in fragment can not be inserted before doctype")}if(z(e)&&!q(t,i))throw new _(S,"Only one element can be added and only after doctype");if(H(e)){if(n(r,(function(t){return H(t)&&t!==i})))throw new _(S,"Only one doctype is allowed");var a=n(r,z);if(i&&r.indexOf(a)<r.indexOf(i))throw new _(S,"Doctype can only be inserted before an element")}}function X(t,e,n,i){(function(t,e,n){if(!function(t){return t&&(t.nodeType===D.DOCUMENT_NODE||t.nodeType===D.DOCUMENT_FRAGMENT_NODE||t.nodeType===D.ELEMENT_NODE)}(t))throw new _(S,"Unexpected parent node type "+t.nodeType);if(n&&n.parentNode!==t)throw new _(F,"child not in parent");if(!function(t){return t&&(z(t)||K(t)||H(t)||t.nodeType===D.DOCUMENT_FRAGMENT_NODE||t.nodeType===D.COMMENT_NODE||t.nodeType===D.PROCESSING_INSTRUCTION_NODE)}(e)||H(e)&&t.nodeType!==D.DOCUMENT_NODE)throw new _(S,"Unexpected node type "+e.nodeType+" for parent node type "+t.nodeType)})(t,e,n),t.nodeType===D.DOCUMENT_NODE&&(i||V)(t,e,n);var r=e.parentNode;if(r&&r.removeChild(e),e.nodeType===y){var o=e.firstChild;if(null==o)return e;var s=e.lastChild}else o=s=e;var a=n?n.previousSibling:t.lastChild;o.previousSibling=a,s.nextSibling=n,a?a.nextSibling=o:t.firstChild=o,null==n?t.lastChild=s:n.previousSibling=s;do{o.parentNode=t}while(o!==s&&(o=o.nextSibling));return J(t.ownerDocument||t,t),e.nodeType==y&&(e.firstChild=e.lastChild=null),e}function Y(){this._nsMap={}}function Z(){}function Q(){}function tt(){}function et(){}function nt(){}function it(){}function rt(){}function ot(){}function st(){}function at(){}function ct(){}function ut(){}function lt(t,e){var n=[],i=9==this.nodeType&&this.documentElement||this,r=i.prefix,o=i.namespaceURI;if(o&&null==r&&null==(r=i.lookupPrefix(o)))var s=[{namespace:o,prefix:null}];return ft(this,n,t,e,s),n.join("")}function ht(t,e,n){var r=t.prefix||"",o=t.namespaceURI;if(!o)return!1;if("xml"===r&&o===i.XML||o===i.XMLNS)return!1;for(var s=n.length;s--;){var a=n[s];if(a.prefix===r)return a.namespace!==o}return!0}function dt(t,e,n){t.push(" ",e,'="',n.replace(/[<>&"\t\n\r]/g,M),'"')}function ft(t,e,n,r,o){if(o||(o=[]),r){if(!(t=r(t)))return;if("string"==typeof t)return void e.push(t)}switch(t.nodeType){case l:var s=t.attributes,a=s.length,c=t.firstChild,u=t.tagName,v=u;if(!(n=i.isHTML(t.namespaceURI)||n)&&!t.prefix&&t.namespaceURI){for(var x,k=0;k<s.length;k++)if("xmlns"===s.item(k).name){x=s.item(k).value;break}if(!x)for(var E=o.length-1;E>=0;E--)if(""===(S=o[E]).prefix&&S.namespace===t.namespaceURI){x=S.namespace;break}if(x!==t.namespaceURI)for(E=o.length-1;E>=0;E--){var S;if((S=o[E]).namespace===t.namespaceURI){S.prefix&&(v=S.prefix+":"+u);break}}}e.push("<",v);for(var F=0;F<a;F++)"xmlns"==(A=s.item(F)).prefix?o.push({prefix:A.localName,namespace:A.value}):"xmlns"==A.nodeName&&o.push({prefix:"",namespace:A.value});for(F=0;F<a;F++){var A,_,j;ht(A=s.item(F),0,o)&&(dt(e,(_=A.prefix||"")?"xmlns:"+_:"xmlns",j=A.namespaceURI),o.push({prefix:_,namespace:j})),ft(A,e,n,r,o)}if(u===v&&ht(t,0,o)&&(dt(e,(_=t.prefix||"")?"xmlns:"+_:"xmlns",j=t.namespaceURI),o.push({prefix:_,namespace:j})),c||n&&!/^(?:meta|link|img|br|hr|input)$/i.test(u)){if(e.push(">"),n&&/^script$/i.test(u))for(;c;)c.data?e.push(c.data):ft(c,e,n,r,o.slice()),c=c.nextSibling;else for(;c;)ft(c,e,n,r,o.slice()),c=c.nextSibling;e.push("</",v,">")}else e.push("/>");return;case w:case y:for(c=t.firstChild;c;)ft(c,e,n,r,o.slice()),c=c.nextSibling;return;case h:return dt(e,t.name,t.value);case d:return e.push(t.data.replace(/[<&>]/g,M));case f:return e.push("<![CDATA[",t.data,"]]>");case m:return e.push("\x3c!--",t.data,"--\x3e");case b:var C=t.publicId,R=t.systemId;if(e.push("<!DOCTYPE ",t.name),C)e.push(" PUBLIC ",C),R&&"."!=R&&e.push(" ",R),e.push(">");else if(R&&"."!=R)e.push(" SYSTEM ",R,">");else{var I=t.internalSubset;I&&e.push(" [",I,"]"),e.push(">")}return;case g:return e.push("<?",t.target," ",t.data,"?>");case p:return e.push("&",t.nodeName,";");default:e.push("??",t.nodeName)}}function pt(t,e,n){var i;switch(e.nodeType){case l:(i=e.cloneNode(!1)).ownerDocument=t;case y:break;case h:n=!0}if(i||(i=e.cloneNode(!1)),i.ownerDocument=t,i.parentNode=null,n)for(var r=e.firstChild;r;)i.appendChild(pt(t,r,n)),r=r.nextSibling;return i}function vt(t,e,n){var i=new e.constructor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var o=e[r];"object"!=typeof o&&o!=i[r]&&(i[r]=o)}switch(e.childNodes&&(i.childNodes=new j),i.ownerDocument=t,i.nodeType){case l:var s=e.attributes,a=i.attributes=new I,c=s.length;a._ownerElement=i;for(var u=0;u<c;u++)i.setAttributeNode(vt(t,s.item(u),!0));break;case h:n=!0}if(n)for(var d=e.firstChild;d;)i.appendChild(vt(t,d,n)),d=d.nextSibling;return i}function gt(t,e,n){t[e]=n}k.INVALID_STATE_ERR=(E[11]="Invalid state",11),k.SYNTAX_ERR=(E[12]="Syntax error",12),k.INVALID_MODIFICATION_ERR=(E[13]="Invalid modification",13),k.NAMESPACE_ERR=(E[14]="Invalid namespace",14),k.INVALID_ACCESS_ERR=(E[15]="Invalid access",15),_.prototype=Error.prototype,a(k,_),j.prototype={length:0,item:function(t){return this[t]||null},toString:function(t,e){for(var n=[],i=0;i<this.length;i++)ft(this[i],n,t,e);return n.join("")},filter:function(t){return Array.prototype.filter.call(this,t)},indexOf:function(t){return Array.prototype.indexOf.call(this,t)}},C.prototype.item=function(t){return R(this),this[t]},c(C,j),I.prototype={length:0,item:j.prototype.item,getNamedItem:function(t){for(var e=this.length;e--;){var n=this[e];if(n.nodeName==t)return n}},setNamedItem:function(t){var e=t.ownerElement;if(e&&e!=this._ownerElement)throw new _(A);var n=this.getNamedItem(t.nodeName);return O(this._ownerElement,this,t,n),n},setNamedItemNS:function(t){var e,n=t.ownerElement;if(n&&n!=this._ownerElement)throw new _(A);return e=this.getNamedItemNS(t.namespaceURI,t.localName),O(this._ownerElement,this,t,e),e},removeNamedItem:function(t){var e=this.getNamedItem(t);return N(this._ownerElement,this,e),e},removeNamedItemNS:function(t,e){var n=this.getNamedItemNS(t,e);return N(this._ownerElement,this,n),n},getNamedItemNS:function(t,e){for(var n=this.length;n--;){var i=this[n];if(i.localName==e&&i.namespaceURI==t)return i}return null}},P.prototype={hasFeature:function(){return!0},createDocument:function(t,e,n){var i=new L;if(i.implementation=this,i.childNodes=new j,i.doctype=n||null,n&&i.appendChild(n),e){var r=i.createElementNS(t,e);i.appendChild(r)}return i},createDocumentType:function(t,e,n){var i=new it;return i.name=t,i.nodeName=t,i.publicId=e||"",i.systemId=n||"",i}},D.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(t,e){return X(this,t,e)},replaceChild:function(t,e){X(this,t,e,G),e&&this.removeChild(e)},removeChild:function(t){return $(this,t)},appendChild:function(t){return this.insertBefore(t,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(t){return vt(this.ownerDocument||this,this,t)},normalize:function(){for(var t=this.firstChild;t;){var e=t.nextSibling;e&&e.nodeType==d&&t.nodeType==d?(this.removeChild(e),t.appendData(e.data)):(t.normalize(),t=e)}},isSupported:function(t,e){return this.ownerDocument.implementation.hasFeature(t,e)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(t){for(var e=this;e;){var n=e._nsMap;if(n)for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)&&n[i]===t)return i;e=e.nodeType==h?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(t){for(var e=this;e;){var n=e._nsMap;if(n&&Object.prototype.hasOwnProperty.call(n,t))return n[t];e=e.nodeType==h?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(t){return null==this.lookupPrefix(t)}},a(u,D),a(u,D.prototype),L.prototype={nodeName:"#document",nodeType:w,doctype:null,documentElement:null,_inc:1,insertBefore:function(t,e){if(t.nodeType==y){for(var n=t.firstChild;n;){var i=n.nextSibling;this.insertBefore(n,e),n=i}return t}return X(this,t,e),t.ownerDocument=this,null===this.documentElement&&t.nodeType===l&&(this.documentElement=t),t},removeChild:function(t){return this.documentElement==t&&(this.documentElement=null),$(this,t)},replaceChild:function(t,e){X(this,t,e,G),t.ownerDocument=this,e&&this.removeChild(e),z(t)&&(this.documentElement=t)},importNode:function(t,e){return pt(this,t,e)},getElementById:function(t){var e=null;return U(this.documentElement,(function(n){if(n.nodeType==l&&n.getAttribute("id")==t)return e=n,!0})),e},getElementsByClassName:function(t){var e=s(t);return new C(this,(function(n){var i=[];return e.length>0&&U(n.documentElement,(function(r){if(r!==n&&r.nodeType===l){var o=r.getAttribute("class");if(o){var a=t===o;if(!a){var c=s(o);a=e.every((u=c,function(t){return u&&-1!==u.indexOf(t)}))}a&&i.push(r)}}var u})),i}))},createElement:function(t){var e=new Y;return e.ownerDocument=this,e.nodeName=t,e.tagName=t,e.localName=t,e.childNodes=new j,(e.attributes=new I)._ownerElement=e,e},createDocumentFragment:function(){var t=new at;return t.ownerDocument=this,t.childNodes=new j,t},createTextNode:function(t){var e=new tt;return e.ownerDocument=this,e.appendData(t),e},createComment:function(t){var e=new et;return e.ownerDocument=this,e.appendData(t),e},createCDATASection:function(t){var e=new nt;return e.ownerDocument=this,e.appendData(t),e},createProcessingInstruction:function(t,e){var n=new ct;return n.ownerDocument=this,n.tagName=n.target=t,n.nodeValue=n.data=e,n},createAttribute:function(t){var e=new Z;return e.ownerDocument=this,e.name=t,e.nodeName=t,e.localName=t,e.specified=!0,e},createEntityReference:function(t){var e=new st;return e.ownerDocument=this,e.nodeName=t,e},createElementNS:function(t,e){var n=new Y,i=e.split(":"),r=n.attributes=new I;return n.childNodes=new j,n.ownerDocument=this,n.nodeName=e,n.tagName=e,n.namespaceURI=t,2==i.length?(n.prefix=i[0],n.localName=i[1]):n.localName=e,r._ownerElement=n,n},createAttributeNS:function(t,e){var n=new Z,i=e.split(":");return n.ownerDocument=this,n.nodeName=e,n.name=e,n.namespaceURI=t,n.specified=!0,2==i.length?(n.prefix=i[0],n.localName=i[1]):n.localName=e,n}},c(L,D),L.prototype.getElementsByTagName=(Y.prototype={nodeType:l,hasAttribute:function(t){return null!=this.getAttributeNode(t)},getAttribute:function(t){var e=this.getAttributeNode(t);return e&&e.value||""},getAttributeNode:function(t){return this.attributes.getNamedItem(t)},setAttribute:function(t,e){var n=this.ownerDocument.createAttribute(t);n.value=n.nodeValue=""+e,this.setAttributeNode(n)},removeAttribute:function(t){var e=this.getAttributeNode(t);e&&this.removeAttributeNode(e)},appendChild:function(t){return t.nodeType===y?this.insertBefore(t,null):function(t,e){return e.parentNode&&e.parentNode.removeChild(e),e.parentNode=t,e.previousSibling=t.lastChild,e.nextSibling=null,e.previousSibling?e.previousSibling.nextSibling=e:t.firstChild=e,t.lastChild=e,J(t.ownerDocument,t,e),e}(this,t)},setAttributeNode:function(t){return this.attributes.setNamedItem(t)},setAttributeNodeNS:function(t){return this.attributes.setNamedItemNS(t)},removeAttributeNode:function(t){return this.attributes.removeNamedItem(t.nodeName)},removeAttributeNS:function(t,e){var n=this.getAttributeNodeNS(t,e);n&&this.removeAttributeNode(n)},hasAttributeNS:function(t,e){return null!=this.getAttributeNodeNS(t,e)},getAttributeNS:function(t,e){var n=this.getAttributeNodeNS(t,e);return n&&n.value||""},setAttributeNS:function(t,e,n){var i=this.ownerDocument.createAttributeNS(t,e);i.value=i.nodeValue=""+n,this.setAttributeNode(i)},getAttributeNodeNS:function(t,e){return this.attributes.getNamedItemNS(t,e)},getElementsByTagName:function(t){return new C(this,(function(e){var n=[];return U(e,(function(i){i===e||i.nodeType!=l||"*"!==t&&i.tagName!=t||n.push(i)})),n}))},getElementsByTagNameNS:function(t,e){return new C(this,(function(n){var i=[];return U(n,(function(r){r===n||r.nodeType!==l||"*"!==t&&r.namespaceURI!==t||"*"!==e&&r.localName!=e||i.push(r)})),i}))}}).getElementsByTagName,L.prototype.getElementsByTagNameNS=Y.prototype.getElementsByTagNameNS,c(Y,D),Z.prototype.nodeType=h,c(Z,D),Q.prototype={data:"",substringData:function(t,e){return this.data.substring(t,t+e)},appendData:function(t){this.nodeValue=this.data=t=this.data+t,this.length=t.length},insertData:function(t,e){this.replaceData(t,0,e)},appendChild:function(){throw new Error(E[S])},deleteData:function(t,e){this.replaceData(t,e,"")},replaceData:function(t,e,n){var i=this.data.substring(0,t),r=this.data.substring(t+e);this.nodeValue=this.data=n=i+n+r,this.length=n.length}},c(Q,D),tt.prototype={nodeName:"#text",nodeType:d,splitText:function(t){var e=this.data,n=e.substring(t);e=e.substring(0,t),this.data=this.nodeValue=e,this.length=e.length;var i=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(i,this.nextSibling),i}},c(tt,Q),et.prototype={nodeName:"#comment",nodeType:m},c(et,Q),nt.prototype={nodeName:"#cdata-section",nodeType:f},c(nt,Q),it.prototype.nodeType=b,c(it,D),rt.prototype.nodeType=x,c(rt,D),ot.prototype.nodeType=v,c(ot,D),st.prototype.nodeType=p,c(st,D),at.prototype.nodeName="#document-fragment",at.prototype.nodeType=y,c(at,D),ct.prototype.nodeType=g,c(ct,D),ut.prototype.serializeToString=function(t,e,n){return lt.call(t,e,n)},D.prototype.toString=lt;try{if(Object.defineProperty){let t=function(e){switch(e.nodeType){case l:case y:var n=[];for(e=e.firstChild;e;)7!==e.nodeType&&8!==e.nodeType&&n.push(t(e)),e=e.nextSibling;return n.join("");default:return e.nodeValue}};Object.defineProperty(C.prototype,"length",{get:function(){return R(this),this.$$length}}),Object.defineProperty(D.prototype,"textContent",{get:function(){return t(this)},set:function(t){switch(this.nodeType){case l:case y:for(;this.firstChild;)this.removeChild(this.firstChild);(t||String(t))&&this.appendChild(this.ownerDocument.createTextNode(t));break;default:this.data=t,this.value=t,this.nodeValue=t}}}),gt=function(t,e,n){t["$$"+e]=n}}}catch(t){}t.DocumentType=it,t.DOMException=_,t.DOMImplementation=P,t.Element=Y,t.Node=D,t.NodeList=j,t.XMLSerializer=ut}}),$a=Kt({"../node_modules/@xmldom/xmldom/lib/entities.js"(t){var e=Ba().freeze;t.XML_ENTITIES=e({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),t.HTML_ENTITIES=e({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}}),Ha=Kt({"../node_modules/@xmldom/xmldom/lib/sax.js"(t){var e=Ba().NAMESPACE,n=/[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]/,i=new RegExp("[\\-\\.0-9"+n.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),r=new RegExp("^"+n.source+i.source+"*(?::"+n.source+i.source+"*)?$");function o(t,e){this.message=t,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,o)}function s(){}function a(t,e){return e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber,e}function c(t,n,i,r,o,s){function a(t,e,n){i.attributeNames.hasOwnProperty(t)&&s.fatalError("Attribute "+t+" redefined"),i.addValue(t,e.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,o),n)}for(var c,u=++n,l=0;;){var h=t.charAt(u);switch(h){case"=":if(1===l)c=t.slice(n,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&&(s.warning('attribute value must after "="'),c=t.slice(n,u)),!((u=t.indexOf(h,n=u+1))>0))throw new Error("attribute value no end '"+h+"' match");a(c,d=t.slice(n,u),n-1),l=5}else{if(4!=l)throw new Error('attribute value must after "="');a(c,d=t.slice(n,u),n),s.warning('attribute "'+c+'" missed start quot('+h+")!!"),n=u+1,l=5}break;case"/":switch(l){case 0:i.setTagName(t.slice(n,u));case 5:case 6:case 7:l=7,i.closed=!0;case 4:case 1:case 2:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return s.error("unexpected end of input"),0==l&&i.setTagName(t.slice(n,u)),u;case">":switch(l){case 0:i.setTagName(t.slice(n,u));case 5:case 6:case 7:break;case 4:case 1:"/"===(d=t.slice(n,u)).slice(-1)&&(i.closed=!0,d=d.slice(0,-1));case 2:2===l&&(d=c),4==l?(s.warning('attribute "'+d+'" missed quot(")!'),a(c,d,n)):(e.isHTML(r[""])&&d.match(/^(?:disabled|checked|selected)$/i)||s.warning('attribute "'+d+'" missed value!! "'+d+'" instead!!'),a(d,d,n));break;case 3:throw new Error("attribute value missed!!")}return u;case"€":h=" ";default:if(h<=" ")switch(l){case 0:i.setTagName(t.slice(n,u)),l=6;break;case 1:c=t.slice(n,u),l=2;break;case 4:var d=t.slice(n,u);s.warning('attribute "'+d+'" missed quot(")!!'),a(c,d,n);case 5:l=6}else switch(l){case 2:e.isHTML(r[""])&&c.match(/^(?:disabled|checked|selected)$/i)||s.warning('attribute "'+c+'" missed value!! "'+c+'" instead2!!'),a(c,c,n),n=u,l=1;break;case 5:s.warning('attribute space is required"'+c+'"!!');case 6:l=1,n=u;break;case 3:l=4,n=u;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}u++}}function u(t,n,i){for(var r=t.tagName,o=null,s=t.length;s--;){var a=t[s],c=a.qName,u=a.value;if((p=c.indexOf(":"))>0)var l=a.prefix=c.slice(0,p),h=c.slice(p+1),f="xmlns"===l&&h;else h=c,l=null,f="xmlns"===c&&"";a.localName=h,!1!==f&&(null==o&&(o={},d(i,i={})),i[f]=o[f]=u,a.uri=e.XMLNS,n.startPrefixMapping(f,u))}for(s=t.length;s--;)(l=(a=t[s]).prefix)&&("xml"===l&&(a.uri=e.XML),"xmlns"!==l&&(a.uri=i[l||""]));var p;(p=r.indexOf(":"))>0?(l=t.prefix=r.slice(0,p),h=t.localName=r.slice(p+1)):(l=null,h=t.localName=r);var v=t.uri=i[l||""];if(n.startElement(v,h,r,t),!t.closed)return t.currentNSMap=i,t.localNSMap=o,!0;if(n.endElement(v,h,r),o)for(l in o)Object.prototype.hasOwnProperty.call(o,l)&&n.endPrefixMapping(l)}function l(t,e,n,i,r){if(/^(?:script|textarea)$/i.test(n)){var o=t.indexOf("</"+n+">",e),s=t.substring(e+1,o);if(/[&<]/.test(s))return/^script$/i.test(n)?(r.characters(s,0,s.length),o):(s=s.replace(/&#?\w+;/g,i),r.characters(s,0,s.length),o)}return e+1}function h(t,e,n,i){var r=i[n];return null==r&&((r=t.lastIndexOf("</"+n+">"))<e&&(r=t.lastIndexOf("</"+n)),i[n]=r),r<e}function d(t,e){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}function f(t,e,n,i){switch(t.charAt(e+2)){case"-":return"-"===t.charAt(e+3)?(r=t.indexOf("--\x3e",e+4))>e?(n.comment(t,e+4,r-e-4),r+3):(i.error("Unclosed comment"),-1):-1;default:if("CDATA["==t.substr(e+3,6)){var r=t.indexOf("]]>",e+9);return n.startCDATA(),n.characters(t,e+9,r-e-9),n.endCDATA(),r+3}var o=function(t,e){var n,i=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(r.lastIndex=e,r.exec(t);n=r.exec(t);)if(i.push(n),n[1])return i}(t,e),s=o.length;if(s>1&&/!doctype/i.test(o[0][0])){var a=o[1][0],c=!1,u=!1;s>3&&(/^public$/i.test(o[2][0])?(c=o[3][0],u=s>4&&o[4][0]):/^system$/i.test(o[2][0])&&(u=o[3][0]));var l=o[s-1];return n.startDTD(a,c,u),n.endDTD(),l.index+l[0].length}}return-1}function p(t,e,n){var i=t.indexOf("?>",e);if(i){var r=t.substring(e,i).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return r?(n.processingInstruction(r[1],r[2]),i+2):-1}return-1}function v(){this.attributeNames={}}(o.prototype=new Error).name=o.name,s.prototype={parse:function(t,n,i){var r=this.domBuilder;r.startDocument(),d(n,n={}),function(t,n,i,r,s){function d(t){var e,n=t.slice(1,-1);return Object.hasOwnProperty.call(i,n)?i[n]:"#"===n.charAt(0)?(e=parseInt(n.substr(1).replace("x","0x")))>65535?(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e))):String.fromCharCode(e):(s.error("entity not found:"+t),t)}function g(e){if(e>S){var n=t.substring(S,e).replace(/&#?\w+;/g,d);x&&m(S),r.characters(n,0,e-S),S=e}}function m(e,n){for(;e>=b&&(n=y.exec(t));)b=(w=n.index)+n[0].length,x.lineNumber++;x.columnNumber=e-w+1}for(var w=0,b=0,y=/.*(?:\r\n?|\n)|.*$/g,x=r.locator,k=[{currentNSMap:n}],E={},S=0;;){try{var F=t.indexOf("<",S);if(F<0){if(!t.substr(S).match(/^\s*$/)){var A=r.doc,_=A.createTextNode(t.substr(S));A.appendChild(_),r.currentElement=_}return}switch(F>S&&g(F),t.charAt(F+1)){case"/":var j=t.indexOf(">",F+3),C=t.substring(F+2,j).replace(/[ \t\n\r]+$/g,""),R=k.pop();j<0?(C=t.substring(F+2).replace(/[\s<].*/,""),s.error("end tag name: "+C+" is not complete:"+R.tagName),j=F+1+C.length):C.match(/\s</)&&(C=C.replace(/[\s<].*/,""),s.error("end tag name: "+C+" maybe not complete"),j=F+1+C.length);var I=R.localNSMap,T=R.tagName==C;if(T||R.tagName&&R.tagName.toLowerCase()==C.toLowerCase()){if(r.endElement(R.uri,R.localName,C),I)for(var O in I)Object.prototype.hasOwnProperty.call(I,O)&&r.endPrefixMapping(O);T||s.fatalError("end tag name: "+C+" is not match the current start tagName:"+R.tagName)}else k.push(R);j++;break;case"?":x&&m(F),j=p(t,F,r);break;case"!":x&&m(F),j=f(t,F,r,s);break;default:x&&m(F);var N=new v,P=k[k.length-1].currentNSMap,D=(j=c(t,F,N,P,d,s),N.length);if(!N.closed&&h(t,j,N.tagName,E)&&(N.closed=!0,i.nbsp||s.warning("unclosed xml attribute")),x&&D){for(var M=a(x,{}),U=0;U<D;U++){var L=N[U];m(L.offset),L.locator=a(x,{})}r.locator=M,u(N,r,P)&&k.push(N),r.locator=x}else u(N,r,P)&&k.push(N);e.isHTML(N.uri)&&!N.closed?j=l(t,j,N.tagName,d,r):j++}}catch(t){if(t instanceof o)throw t;s.error("element parse error: "+t),j=-1}j>S?S=j:g(Math.max(F,S)+1)}}(t,n,i,r,this.errorHandler),r.endDocument()}},v.prototype={setTagName:function(t){if(!r.test(t))throw new Error("invalid tagName:"+t);this.tagName=t},addValue:function(t,e,n){if(!r.test(t))throw new Error("invalid attribute:"+t);this.attributeNames[t]=this.length,this[this.length++]={qName:t,value:e,offset:n}},length:0,getLocalName:function(t){return this[t].localName},getLocator:function(t){return this[t].locator},getQName:function(t){return this[t].qName},getURI:function(t){return this[t].uri},getValue:function(t){return this[t].value}},t.XMLReader=s,t.ParseError=o}}),za=Kt({"../node_modules/@xmldom/xmldom/lib/dom-parser.js"(t){var e=Ba(),n=Ja(),i=$a(),r=Ha(),o=n.DOMImplementation,s=e.NAMESPACE,a=r.ParseError,c=r.XMLReader;function u(t){return t.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028]/g,"\n")}function l(t){this.options=t||{locator:{}}}function h(){this.cdata=!1}function d(t,e){e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber}function f(t){if(t)return"\n@"+(t.systemId||"")+"#[line:"+t.lineNumber+",col:"+t.columnNumber+"]"}function p(t,e,n){return"string"==typeof t?t.substr(e,n):t.length>=e+n||e?new java.lang.String(t,e,n)+"":t}function v(t,e){t.currentElement?t.currentElement.appendChild(e):t.doc.appendChild(e)}l.prototype.parseFromString=function(t,e){var n=this.options,r=new c,o=n.domBuilder||new h,a=n.errorHandler,l=n.locator,d=n.xmlns||{},p=/\/x?html?$/.test(e),v=p?i.HTML_ENTITIES:i.XML_ENTITIES;return l&&o.setDocumentLocator(l),r.errorHandler=function(t,e,n){if(!t){if(e instanceof h)return e;t=e}var i={},r=t instanceof Function;function o(e){var o=t[e];!o&&r&&(o=2==t.length?function(n){t(e,n)}:t),i[e]=o&&function(t){o("[xmldom "+e+"]\t"+t+f(n))}||function(){}}return n=n||{},o("warning"),o("error"),o("fatalError"),i}(a,o,l),r.domBuilder=n.domBuilder||o,p&&(d[""]=s.HTML),d.xml=d.xml||s.XML,t&&"string"==typeof t?r.parse((n.normalizeLineEndings||u)(t),d,v):r.errorHandler.error("invalid doc source"),o.doc},h.prototype={startDocument:function(){this.doc=(new o).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(t,e,n,i){var r=this.doc,o=r.createElementNS(t,n||e),s=i.length;v(this,o),this.currentElement=o,this.locator&&d(this.locator,o);for(var a=0;a<s;a++){t=i.getURI(a);var c=i.getValue(a),u=(n=i.getQName(a),r.createAttributeNS(t,n));this.locator&&d(i.getLocator(a),u),u.value=u.nodeValue=c,o.setAttributeNode(u)}},endElement:function(){this.currentElement=this.currentElement.parentNode},startPrefixMapping:function(){},endPrefixMapping:function(){},processingInstruction:function(t,e){var n=this.doc.createProcessingInstruction(t,e);this.locator&&d(this.locator,n),v(this,n)},ignorableWhitespace:function(){},characters:function(t,e,n){if(t=p.apply(this,arguments)){if(this.cdata)var i=this.doc.createCDATASection(t);else i=this.doc.createTextNode(t);this.currentElement?this.currentElement.appendChild(i):/^\s*$/.test(t)&&this.doc.appendChild(i),this.locator&&d(this.locator,i)}},skippedEntity:function(){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(t){(this.locator=t)&&(t.lineNumber=0)},comment:function(t,e,n){t=p.apply(this,arguments);var i=this.doc.createComment(t);this.locator&&d(this.locator,i),v(this,i)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(t,e,n){var i=this.doc.implementation;if(i&&i.createDocumentType){var r=i.createDocumentType(t,e,n);this.locator&&d(this.locator,r),v(this,r),this.doc.doctype=r}},warning:function(t){console.warn("[xmldom warning]\t"+t,f(this.locator))},error:function(t){console.error("[xmldom error]\t"+t,f(this.locator))},fatalError:function(t){throw new a(t,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,(function(t){h.prototype[t]=function(){return null}})),t.__DOMHandler=h,t.normalizeLineEndings=u,t.DOMParser=l}}),Ka=Kt({"../node_modules/@xmldom/xmldom/lib/index.js"(t){var e=Ja();t.DOMImplementation=e.DOMImplementation,t.XMLSerializer=e.XMLSerializer,t.DOMParser=za().DOMParser}}),Wa=Kt({"../node_modules/solid-namespace/index.js"(t,e){var n={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/"};e.exports=function(t={namedNode:t=>t}){const e={};for(const i in n){const r=n[i];e[i]=function(e=""){return t.namedNode(r+e)}}return e}}}),qa=Vt(Ys());function Va(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Ga(t,e,n){return e&&Va(t.prototype,e),n&&Va(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Xa(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ya(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Za(t,e){return(Za=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Qa(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Za(t,e)}function tc(t){return(tc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ec(t,e){if(e&&("object"===tc(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Ya(t)}function nc(t){return(nc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ic(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var rc={Literal:1,Collection:3,Graph:4,NamedNode:5,BlankNode:6,Variable:7},oc=function(){function t(e){Xa(this,t),ic(this,"termType",void 0),ic(this,"classOrder",void 0),ic(this,"value",void 0),this.value=e}return Ga(t,[{key:"substitute",value:function(){return console.log("@@@ node substitute"+this),this}},{key:"compareTerm",value:function(t){return this.classOrder<t.classOrder?-1:this.classOrder>t.classOrder?1:this.value<t.value?-1:this.value>t.value?1:0}},{key:"equals",value:function(t){return!!t&&this.termType===t.termType&&this.value===t.value}},{key:"hashString",value:function(){return this.toCanonical()}},{key:"sameTerm",value:function(t){return this.equals(t)}},{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")}}]),t}();ic(oc,"fromValue",void 0),ic(oc,"toJS",void 0);var sc=function(){Qa(i,oc);var t,e,n=(t=i,e=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(t){return!1}}(),function(){var n,i=nc(t);if(e){var r=nc(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ec(this,n)});function i(t){var e;return Xa(this,i),ic(Ya(e=n.call(this,i.getId(t))),"termType","BlankNode"),ic(Ya(e),"classOrder",rc.BlankNode),ic(Ya(e),"isBlank",1),ic(Ya(e),"isVar",1),e}return Ga(i,[{key:"id",get:function(){return this.value},set:function(t){this.value=t}},{key:"compareTerm",value:function(t){return this.classOrder<t.classOrder?-1:this.classOrder>t.classOrder?1:this.id<t.id?-1:this.id>t.id?1:0}},{key:"copy",value:function(t){var e=new i;return t.copyTo(this,e),e}},{key:"toCanonical",value:function(){return i.NTAnonymousNodePrefix+this.value}},{key:"toString",value:function(){return i.NTAnonymousNodePrefix+this.id}}],[{key:"getId",value:function(t){if(t){if("string"!=typeof t)throw console.log("Bad blank id:",t),new Error("Bad id argument to new blank node: "+t);if(t.includes("#")){var e=t.split("#");return e[e.length-1]}return t}return"n"+i.nextId++}}]),i}();function ac(t){return"string"==typeof t?t:t.value}function cc(t){return"object"===tc(t)&&null!==t&&"subject"in t}function uc(t){return"object"===tc(t)&&null!==t&&"statements"in t}function lc(t){return dc(t)&&"Collection"===t.termType}function hc(t){return t&&Object.prototype.hasOwnProperty.call(t,"termType")&&("NamedNode"===t.termType||"Variable"===t.termType||"BlankNode"===t.termType||"Collection"===t.termType||"Literal"===t.termType||"Graph"===t.termType)}function dc(t){return"object"===tc(t)&&null!==t&&"termType"in t}function fc(t){return"Literal"===t.termType}function pc(t){return"object"===tc(t)&&null!==t&&"subject"in t&&"predicate"in t&&"object"in t}function vc(t){return dc(t)&&"NamedNode"===t.termType}function gc(t){return dc(t)&&("NamedNode"===t.termType||"Variable"===t.termType||"BlankNode"===t.termType)}function mc(t){return dc(t)&&("NamedNode"===t.termType||"Variable"===t.termType)}function wc(t){return dc(t)&&("NamedNode"===t.termType||"Variable"===t.termType||"BlankNode"===t.termType||"DefaultGraph"===t.termType)}ic(sc,"nextId",0),ic(sc,"NTAnonymousNodePrefix","_:");var bc=function(){Qa(i,oc);var t,e,n=(t=i,e=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(t){return!1}}(),function(){var n,i=nc(t);if(e){var r=nc(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ec(this,n)});function i(t){var e;if(Xa(this,i),ic(Ya(e=n.call(this,ac(t))),"termType","NamedNode"),ic(Ya(e),"classOrder",rc.NamedNode),!e.value)throw new Error("Missing IRI for NamedNode");if(!e.value.includes(":"))throw new Error('NamedNode IRI "'+t+'" must be absolute.');if(e.value.includes(" "))throw new Error('Error: NamedNode IRI "'+t+'" must not contain unencoded spaces.');return e}return Ga(i,[{key:"dir",value:function(){var t=this.value.split("#")[0],e=t.slice(0,-1).lastIndexOf("/"),n=t.indexOf("//");return n>=0&&e<n+2||e<0?null:new i(t.slice(0,e+1))}},{key:"site",value:function(){var t=this.value.split("#")[0],e=t.indexOf("//");if(e<0)throw new Error("This URI does not have a web site part (origin)");var n=t.indexOf("/",e+2);return new i(n<0?t.slice(0)+"/":t.slice(0,n+1))}},{key:"doc",value:function(){return this.value.indexOf("#")<0?this:new i(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(t){this.value=t}}],[{key:"fromValue",value:function(t){return null==t||dc(t)?t:new i(t)}}]),i}(),yc={boolean:new bc("http://www.w3.org/2001/XMLSchema#boolean"),dateTime:new bc("http://www.w3.org/2001/XMLSchema#dateTime"),decimal:new bc("http://www.w3.org/2001/XMLSchema#decimal"),double:new bc("http://www.w3.org/2001/XMLSchema#double"),integer:new bc("http://www.w3.org/2001/XMLSchema#integer"),langString:new bc("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),string:new bc("http://www.w3.org/2001/XMLSchema#string")};var xc=function(){Qa(i,oc);var t,e,n=(t=i,e=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(t){return!1}}(),function(){var n,i=nc(t);if(e){var r=nc(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ec(this,n)});function i(t,e,r){var o;return Xa(this,i),ic(Ya(o=n.call(this,t)),"termType","Literal"),ic(Ya(o),"classOrder",rc.Literal),ic(Ya(o),"datatype",yc.string),ic(Ya(o),"isVar",0),ic(Ya(o),"language",""),e?(o.language=e,o.datatype=yc.langString):o.datatype=r?bc.fromValue(r):yc.string,o}return Ga(i,[{key:"copy",value:function(){return new i(this.value,this.lang,this.datatype)}},{key:"equals",value:function(t){return!!t&&this.termType===t.termType&&this.value===t.value&&this.language===t.language&&(!this.datatype&&!t.datatype||this.datatype&&this.datatype.equals(t.datatype))}},{key:"lang",get:function(){return this.language},set:function(t){this.language=t||""}},{key:"toNT",value:function(){return i.toNT(this)}},{key:"toString",value:function(){return""+this.value}}],[{key:"toNT",value:function(t){if("number"==typeof t.value)return""+t.value;if("string"!=typeof t.value)throw new Error("Value of RDF literal is not string or number: "+t.value);var e=t.value;return e='"'+(e=(e=(e=(e=e.replace(/\\/g,"\\\\")).replace(/\"/g,'\\"')).replace(/\n/g,"\\n")).replace(/\r/g,"\\r"))+'"',t.language?e+="@"+t.language:t.datatype.equals(yc.string)||(e+="^^"+t.datatype.toCanonical()),e}},{key:"fromBoolean",value:function(t){return new i(t?"1":"0",null,yc.boolean)}},{key:"fromDate",value:function(t){if(!(t instanceof Date))throw new TypeError("Invalid argument to Literal.fromDate()");var e=function(t){return(""+(100+t)).slice(1,3)};return new i(t.getUTCFullYear()+"-"+e(t.getUTCMonth()+1)+"-"+e(t.getUTCDate())+"T"+e(t.getUTCHours())+":"+e(t.getUTCMinutes())+":"+e(t.getUTCSeconds())+"Z",null,yc.dateTime)}},{key:"fromNumber",value:function(t){if("number"!=typeof t)throw new TypeError("Invalid argument to Literal.fromNumber()");var e,n=t.toString();return e=n.indexOf("e")<0&&Math.abs(t)<=Number.MAX_SAFE_INTEGER?Number.isInteger(t)?yc.integer:yc.decimal:yc.double,new i(n,null,e)}},{key:"fromValue",value:function(t){if(fc(t))return t;switch(tc(t)){case"object":if(t instanceof Date)return i.fromDate(t);case"boolean":return i.fromBoolean(t);case"number":return i.fromNumber(t);case"string":return new i(t)}throw new Error("Can't make literal from "+t+" of type "+tc(t))}}]),i}();function kc(t){return null==t||dc(t)?t:Array.isArray(t)?new Ec(t):xc.fromValue(t)}var Ec=function(){Qa(i,oc);var t,e,n=(t=i,e=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(t){return!1}}(),function(){var n,i=nc(t);if(e){var r=nc(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ec(this,n)});function i(t){var e;return Xa(this,i),ic(Ya(e=n.call(this,(sc.nextId++).toString())),"termType","Collection"),ic(Ya(e),"classOrder",rc.Collection),ic(Ya(e),"closed",!1),ic(Ya(e),"compareTerm",sc.prototype.compareTerm),ic(Ya(e),"elements",[]),ic(Ya(e),"isVar",0),t&&t.length>0&&t.forEach((function(t){e.elements.push(kc(t))})),e}return Ga(i,[{key:"id",get:function(){return this.value},set:function(t){this.value=t}},{key:"append",value:function(t){return this.elements.push(t)}},{key:"close",value:function(){return this.closed=!0,this.closed}},{key:"shift",value:function(){return this.elements.shift()}},{key:"substitute",value:function(t){return new i(this.elements.map((function(e){return e.substitute(t)})))}},{key:"toNT",value:function(){return i.toNT(this)}},{key:"toString",value:function(){return"("+this.elements.join(" ")+")"}},{key:"unshift",value:function(t){return this.elements.unshift(t)}}],[{key:"toNT",value:function(t){return sc.NTAnonymousNodePrefix+t.id}}]),i}();function Sc(t){return function(...e){var n=e.pop();return t.call(this,e,n)}}ic(Ec,"termType","Collection");var Fc="function"==typeof queueMicrotask&&queueMicrotask,Ac="function"==typeof setImmediate&&setImmediate,_c="object"==typeof process&&"function"==typeof process.nextTick;function jc(t){setTimeout(t,0)}function Cc(t){return(e,...n)=>t((()=>e(...n)))}var Rc=Cc(Fc?queueMicrotask:Ac?setImmediate:_c?process.nextTick:jc);function Ic(t){return Nc(t)?function(...e){const n=e.pop();return Tc(t.apply(this,e),n)}:Sc((function(e,n){var i;try{i=t.apply(this,e)}catch(t){return n(t)}if(i&&"function"==typeof i.then)return Tc(i,n);n(null,i)}))}function Tc(t,e){return t.then((t=>{Oc(e,null,t)}),(t=>{Oc(e,t&&t.message?t:new Error(t))}))}function Oc(t,e,n){try{t(e,n)}catch(t){Rc((t=>{throw t}),t)}}function Nc(t){return"AsyncFunction"===t[Symbol.toStringTag]}function Pc(t){if("function"!=typeof t)throw new Error("expected a function");return Nc(t)?Ic(t):t}function Dc(t,e=t.length){if(!e)throw new Error("arity is undefined");return function(...n){return"function"==typeof n[e-1]?t.apply(this,n):new Promise(((i,r)=>{n[e-1]=(t,...e)=>{if(t)return r(t);i(e.length>1?e:e[0])},t.apply(this,n)}))}}function Mc(t){return function(e,...n){return Dc((function(i){var r=this;return t(e,((t,e)=>{Pc(t).apply(r,n.concat(e))}),i)}))}}function Uc(t,e,n,i){e=e||[];var r=[],o=0,s=Pc(n);return t(e,((t,e,n)=>{var i=o++;s(t,((t,e)=>{r[i]=e,n(t)}))}),(t=>{i(t,r)}))}function Lc(t){return t&&"number"==typeof t.length&&t.length>=0&&t.length%1==0}var Bc={};function Jc(t){function e(...e){if(null!==t){var n=t;t=null,n.apply(this,e)}}return Object.assign(e,t),e}function $c(t){return function(...e){if(null===t)throw new Error("Callback was already called.");var n=t;t=null,n.apply(this,e)}}function Hc(t,e,n,i){let r=!1,o=!1,s=!1,a=0,c=0;function u(){a>=e||s||r||(s=!0,t.next().then((({value:t,done:e})=>{if(!o&&!r){if(s=!1,e)return r=!0,void(a<=0&&i(null));a++,n(t,c,l),c++,u()}})).catch(h))}function l(t,e){if(a-=1,!o)return t?h(t):!1===t?(r=!0,void(o=!0)):e===Bc||r&&a<=0?(r=!0,i(null)):void u()}function h(t){o||(s=!1,r=!0,i(t))}u()}var zc=t=>(e,n,i)=>{if(i=Jc(i),t<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!e)return i(null);if("AsyncGenerator"===e[Symbol.toStringTag])return Hc(e,t,n,i);if(function(t){return"function"==typeof t[Symbol.asyncIterator]}(e))return Hc(e[Symbol.asyncIterator](),t,n,i);var r=function(t){if(Lc(t))return function(t){var e=-1,n=t.length;return function(){return++e<n?{value:t[e],key:e}:null}}(t);var e=function(t){return t[Symbol.iterator]&&t[Symbol.iterator]()}(t);return e?function(t){var e=-1;return function(){var n=t.next();return n.done?null:(e++,{value:n.value,key:e})}}(e):function(t){var e=t?Object.keys(t):[],n=-1,i=e.length;return function r(){var o=e[++n];return"__proto__"===o?r():n<i?{value:t[o],key:o}:null}}(t)}(e),o=!1,s=!1,a=0,c=!1;function u(t,e){if(!s)if(a-=1,t)o=!0,i(t);else if(!1===t)o=!0,s=!0;else{if(e===Bc||o&&a<=0)return o=!0,i(null);c||l()}}function l(){for(c=!0;a<t&&!o;){var e=r();if(null===e)return o=!0,void(a<=0&&i(null));a+=1,n(e.value,e.key,$c(u))}c=!1}l()},Kc=Dc((function(t,e,n,i){return zc(e)(t,Pc(n),i)}),4);function Wc(t,e,n){n=Jc(n);var i=0,r=0,{length:o}=t,s=!1;function a(t,e){!1===t&&(s=!0),!0!==s&&(t?n(t):++r!==o&&e!==Bc||n(null))}for(0===o&&n(null);i<o;i++)e(t[i],i,$c(a))}function qc(t,e,n){return Kc(t,1/0,e,n)}var Vc=Dc((function(t,e,n){return(Lc(t)?Wc:qc)(t,Pc(e),n)}),3),Gc=Dc((function(t,e,n){return Uc(Vc,t,e,n)}),3),Xc=Mc(Gc),Yc=Dc((function(t,e,n){return Kc(t,1,e,n)}),3),Zc=Dc((function(t,e,n){return Uc(Yc,t,e,n)}),3),Qc=Mc(Zc),tu=Symbol("promiseCallback");function eu(){let t,e;function n(n,...i){if(n)return e(n);t(i.length>1?i:i[0])}return n[tu]=new Promise(((n,i)=>{t=n,e=i})),n}function nu(t,e,n){"number"!=typeof e&&(n=e,e=null),n=Jc(n||eu());var i=Object.keys(t).length;if(!i)return n(null);e||(e=i);var r={},o=0,s=!1,a=!1,c=Object.create(null),u=[],l=[],h={};function d(t,e){u.push((()=>function(t,e){if(!a){var i=$c(((e,...i)=>{if(o--,!1!==e)if(i.length<2&&([i]=i),e){var u={};if(Object.keys(r).forEach((t=>{u[t]=r[t]})),u[t]=i,a=!0,c=Object.create(null),s)return;n(e,u)}else r[t]=i,(c[t]||[]).forEach((t=>t())),f();else s=!0}));o++;var u=Pc(e[e.length-1]);e.length>1?u(r,i):u(i)}}(t,e)))}function f(){if(!s){if(0===u.length&&0===o)return n(null,r);for(;u.length&&o<e;)u.shift()()}}function p(e){var n=[];return Object.keys(t).forEach((i=>{const r=t[i];Array.isArray(r)&&r.indexOf(e)>=0&&n.push(i)})),n}return Object.keys(t).forEach((e=>{var n=t[e];if(!Array.isArray(n))return d(e,[n]),void l.push(e);var i=n.slice(0,n.length-1),r=i.length;if(0===r)return d(e,n),void l.push(e);h[e]=r,i.forEach((o=>{if(!t[o])throw new Error("async.auto task `"+e+"` has a non-existent dependency `"+o+"` in "+i.join(", "));var s,a;(a=c[s=o])||(a=c[s]=[]),a.push((()=>{0==--r&&d(e,n)}))}))})),function(){for(var t=0;l.length;)t++,p(l.pop()).forEach((t=>{0==--h[t]&&l.push(t)}));if(t!==i)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}(),f(),n[tu]}var iu=/^(?:async\s+)?(?:function)?\s*\w*\s*\(\s*([^)]+)\s*\)(?:\s*{)/,ru=/^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/,ou=/,/,su=/(=.+)?(\s*)$/,au=class{constructor(){this.head=this.tail=null,this.length=0}removeLink(t){return t.prev?t.prev.next=t.next:this.head=t.next,t.next?t.next.prev=t.prev:this.tail=t.prev,t.prev=t.next=null,this.length-=1,t}empty(){for(;this.head;)this.shift();return this}insertAfter(t,e){e.prev=t,e.next=t.next,t.next?t.next.prev=e:this.tail=e,t.next=e,this.length+=1}insertBefore(t,e){e.prev=t.prev,e.next=t,t.prev?t.prev.next=e:this.head=e,t.prev=e,this.length+=1}unshift(t){this.head?this.insertBefore(this.head,t):cu(this,t)}push(t){this.tail?this.insertAfter(this.tail,t):cu(this,t)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){for(var t=this.head;t;)yield t.data,t=t.next}remove(t){for(var e=this.head;e;){var{next:n}=e;t(e)&&this.removeLink(e),e=n}return this}};function cu(t,e){t.length=1,t.head=t.tail=e}function uu(t,e,n){if(null==e)e=1;else if(0===e)throw new RangeError("Concurrency must not be zero");var i=Pc(t),r=0,o=[];const s={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function a(t,e){return t?e?void(s[t]=s[t].filter((t=>t!==e))):s[t]=[]:Object.keys(s).forEach((t=>s[t]=[]))}function c(t,...e){s[t].forEach((t=>t(...e)))}var u=!1;function l(t,e,n,i){if(null!=i&&"function"!=typeof i)throw new Error("task callback must be a function");var r,o;function s(t,...e){return t?n?o(t):r():e.length<=1?r(e[0]):void r(e)}v.started=!0;var a=v._createTaskItem(t,n?s:i||s);if(e?v._tasks.unshift(a):v._tasks.push(a),u||(u=!0,Rc((()=>{u=!1,v.process()}))),n||!i)return new Promise(((t,e)=>{r=t,o=e}))}function h(t){return function(e,...n){r-=1;for(var i=0,s=t.length;i<s;i++){var a=t[i],u=o.indexOf(a);0===u?o.shift():u>0&&o.splice(u,1),a.callback(e,...n),null!=e&&c("error",e,a.data)}r<=v.concurrency-v.buffer&&c("unsaturated"),v.idle()&&c("drain"),v.process()}}function d(t){return!(0!==t.length||!v.idle()||(Rc((()=>c("drain"))),0))}const f=t=>e=>{if(!e)return new Promise(((e,n)=>{!function(t){const i=(...r)=>{a(t,i),((t,i)=>{if(t)return n(t);e(i)})(...r)};s[t].push(i)}(t)}));a(t),function(t,e){s[t].push(e)}(t,e)};var p=!1,v={_tasks:new au,_createTaskItem:(t,e)=>({data:t,callback:e}),*[Symbol.iterator](){yield*v._tasks[Symbol.iterator]()},concurrency:e,payload:n,buffer:e/4,started:!1,paused:!1,push(t,e){if(Array.isArray(t)){if(d(t))return;return t.map((t=>l(t,!1,!1,e)))}return l(t,!1,!1,e)},pushAsync(t,e){if(Array.isArray(t)){if(d(t))return;return t.map((t=>l(t,!1,!0,e)))}return l(t,!1,!0,e)},kill(){a(),v._tasks.empty()},unshift(t,e){if(Array.isArray(t)){if(d(t))return;return t.map((t=>l(t,!0,!1,e)))}return l(t,!0,!1,e)},unshiftAsync(t,e){if(Array.isArray(t)){if(d(t))return;return t.map((t=>l(t,!0,!0,e)))}return l(t,!0,!0,e)},remove(t){v._tasks.remove(t)},process(){if(!p){for(p=!0;!v.paused&&r<v.concurrency&&v._tasks.length;){var t=[],e=[],n=v._tasks.length;v.payload&&(n=Math.min(n,v.payload));for(var s=0;s<n;s++){var a=v._tasks.shift();t.push(a),o.push(a),e.push(a.data)}r+=1,0===v._tasks.length&&c("empty"),r===v.concurrency&&c("saturated");var u=$c(h(t));i(e,u)}p=!1}},length:()=>v._tasks.length,running:()=>r,workersList:()=>o,idle:()=>v._tasks.length+r===0,pause(){v.paused=!0},resume(){!1!==v.paused&&(v.paused=!1,Rc(v.process))}};return Object.defineProperties(v,{saturated:{writable:!1,value:f("saturated")},unsaturated:{writable:!1,value:f("unsaturated")},empty:{writable:!1,value:f("empty")},drain:{writable:!1,value:f("drain")},error:{writable:!1,value:f("error")}}),v}var lu=Dc((function(t,e,n,i){i=Jc(i);var r=Pc(n);return Yc(t,((t,n,i)=>{r(e,t,((t,n)=>{e=n,i(t)}))}),(t=>i(t,e)))}),4);function hu(...t){var e=t.map(Pc);return function(...t){var n=this,i=t[t.length-1];return"function"==typeof i?t.pop():i=eu(),lu(e,t,((t,e,i)=>{e.apply(n,t.concat(((t,...e)=>{i(t,e)})))}),((t,e)=>i(t,...e))),i[tu]}}var du=Dc((function(t,e,n,i){return Uc(zc(e),t,n,i)}),4),fu=Dc((function(t,e,n,i){var r=Pc(n);return du(t,e,((t,e)=>{r(t,((t,...n)=>t?e(t):e(t,n)))}),((t,e)=>{for(var n=[],r=0;r<e.length;r++)e[r]&&(n=n.concat(...e[r]));return i(t,n)}))}),4),pu=Dc((function(t,e,n){return fu(t,1/0,e,n)}),3),vu=Dc((function(t,e,n){return fu(t,1,e,n)}),3);function gu(t,e){return(n,i,r,o)=>{var s,a=!1;const c=Pc(r);n(i,((n,i,r)=>{c(n,((i,o)=>i||!1===i?r(i):t(o)&&!s?(a=!0,s=e(!0,n),r(null,Bc)):void r()))}),(t=>{if(t)return o(t);o(null,a?s:e(!1))}))}}var mu=Dc((function(t,e,n){return gu((t=>t),((t,e)=>e))(Vc,t,e,n)}),3),wu=Dc((function(t,e,n,i){return gu((t=>t),((t,e)=>e))(zc(e),t,n,i)}),4),bu=Dc((function(t,e,n){return gu((t=>t),((t,e)=>e))(zc(1),t,e,n)}),3);function yu(t){return(e,...n)=>Pc(e)(...n,((e,...n)=>{"object"==typeof console&&(e?console.error&&console.error(e):console[t]&&n.forEach((e=>console[t](e))))}))}var xu=yu("dir"),ku=Dc((function(t,e,n){n=$c(n);var i,r=Pc(t),o=Pc(e);function s(t,...e){if(t)return n(t);!1!==t&&(i=e,o(...e,a))}function a(t,e){return t?n(t):!1!==t?e?void r(s):n(null,...i):void 0}return a(null,!0)}),3);function Eu(t){return(e,n,i)=>t(e,i)}var Su=Dc((function(t,e,n){return Vc(t,Eu(Pc(e)),n)}),3),Fu=Dc((function(t,e,n,i){return zc(e)(t,Eu(Pc(n)),i)}),4),Au=Dc((function(t,e,n){return Fu(t,1,e,n)}),3);function _u(t){return Nc(t)?t:function(...e){var n=e.pop(),i=!0;e.push(((...t)=>{i?Rc((()=>n(...t))):n(...t)})),t.apply(this,e),i=!1}}var ju=Dc((function(t,e,n){return gu((t=>!t),(t=>!t))(Vc,t,e,n)}),3),Cu=Dc((function(t,e,n,i){return gu((t=>!t),(t=>!t))(zc(e),t,n,i)}),4),Ru=Dc((function(t,e,n){return gu((t=>!t),(t=>!t))(Yc,t,e,n)}),3);function Iu(t,e,n,i){var r=new Array(e.length);t(e,((t,e,i)=>{n(t,((t,n)=>{r[e]=!!n,i(t)}))}),(t=>{if(t)return i(t);for(var n=[],o=0;o<e.length;o++)r[o]&&n.push(e[o]);i(null,n)}))}function Tu(t,e,n,i){var r=[];t(e,((t,e,i)=>{n(t,((n,o)=>{if(n)return i(n);o&&r.push({index:e,value:t}),i(n)}))}),(t=>{if(t)return i(t);i(null,r.sort(((t,e)=>t.index-e.index)).map((t=>t.value)))}))}function Ou(t,e,n,i){return(Lc(e)?Iu:Tu)(t,e,Pc(n),i)}var Nu=Dc((function(t,e,n){return Ou(Vc,t,e,n)}),3),Pu=Dc((function(t,e,n,i){return Ou(zc(e),t,n,i)}),4),Du=Dc((function(t,e,n){return Ou(Yc,t,e,n)}),3),Mu=Dc((function(t,e){var n=$c(e),i=Pc(_u(t));return function t(e){if(e)return n(e);!1!==e&&i(t)}()}),2),Uu=Dc((function(t,e,n,i){var r=Pc(n);return du(t,e,((t,e)=>{r(t,((n,i)=>n?e(n):e(n,{key:i,val:t})))}),((t,e)=>{for(var n={},{hasOwnProperty:r}=Object.prototype,o=0;o<e.length;o++)if(e[o]){var{key:s}=e[o],{val:a}=e[o];r.call(n,s)?n[s].push(a):n[s]=[a]}return i(t,n)}))}),4),Lu=yu("log"),Bu=Dc((function(t,e,n,i){i=Jc(i);var r={},o=Pc(n);return zc(e)(t,((t,e,n)=>{o(t,e,((t,i)=>{if(t)return n(t);r[e]=i,n(t)}))}),(t=>i(t,r)))}),4),Ju=Cc(_c?process.nextTick:Ac?setImmediate:jc),$u=Dc(((t,e,n)=>{var i=Lc(e)?[]:{};t(e,((t,e,n)=>{Pc(t)(((t,...r)=>{r.length<2&&([r]=r),i[e]=r,n(t)}))}),(t=>n(t,i)))}),3);function Hu(t,e){var n=Pc(t);return uu(((t,e)=>{n(t[0],e)}),e,1)}var zu=class{constructor(){this.heap=[],this.pushCount=Number.MIN_SAFE_INTEGER}get length(){return this.heap.length}empty(){return this.heap=[],this}percUp(t){let e;for(;t>0&&qu(this.heap[t],this.heap[e=Wu(t)]);){let n=this.heap[t];this.heap[t]=this.heap[e],this.heap[e]=n,t=e}}percDown(t){let e;for(;(e=Ku(t))<this.heap.length&&(e+1<this.heap.length&&qu(this.heap[e+1],this.heap[e])&&(e+=1),!qu(this.heap[t],this.heap[e]));){let n=this.heap[t];this.heap[t]=this.heap[e],this.heap[e]=n,t=e}}push(t){t.pushCount=++this.pushCount,this.heap.push(t),this.percUp(this.heap.length-1)}unshift(t){return this.heap.push(t)}shift(){let[t]=this.heap;return this.heap[0]=this.heap[this.heap.length-1],this.heap.pop(),this.percDown(0),t}toArray(){return[...this]}*[Symbol.iterator](){for(let t=0;t<this.heap.length;t++)yield this.heap[t].data}remove(t){let e=0;for(let n=0;n<this.heap.length;n++)t(this.heap[n])||(this.heap[e]=this.heap[n],e++);this.heap.splice(e);for(let t=Wu(this.heap.length-1);t>=0;t--)this.percDown(t);return this}};function Ku(t){return 1+(t<<1)}function Wu(t){return(t+1>>1)-1}function qu(t,e){return t.priority!==e.priority?t.priority<e.priority:t.pushCount<e.pushCount}var Vu=Dc((function(t,e){if(e=Jc(e),!Array.isArray(t))return e(new TypeError("First argument to race must be an array of functions"));if(!t.length)return e();for(var n=0,i=t.length;n<i;n++)Pc(t[n])(e)}),2);function Gu(t,e,n,i){var r=[...t].reverse();return lu(r,e,n,i)}function Xu(t){var e=Pc(t);return Sc((function(t,n){return t.push(((t,...e)=>{let i={};if(t&&(i.error=t),e.length>0){var r=e;e.length<=1&&([r]=e),i.value=r}n(null,i)})),e.apply(this,t)}))}function Yu(t,e,n,i){const r=Pc(n);return Ou(t,e,((t,e)=>{r(t,((t,n)=>{e(t,!n)}))}),i)}var Zu=Dc((function(t,e,n){return Yu(Vc,t,e,n)}),3),Qu=Dc((function(t,e,n,i){return Yu(zc(e),t,n,i)}),4),tl=Dc((function(t,e,n){return Yu(Yc,t,e,n)}),3);function el(t){return function(){return t}}function nl(t,e,n){var i={times:5,intervalFunc:el(0)};if(arguments.length<3&&"function"==typeof t?(n=e||eu(),e=t):(il(i,t),n=n||eu()),"function"!=typeof e)throw new Error("Invalid arguments for async.retry");var r=Pc(e),o=1;function s(){r(((t,...e)=>{!1!==t&&(t&&o++<i.times&&("function"!=typeof i.errorFilter||i.errorFilter(t))?setTimeout(s,i.intervalFunc(o-1)):n(t,...e))}))}return s(),n[tu]}function il(t,e){if("object"==typeof e)t.times=+e.times||5,t.intervalFunc="function"==typeof e.interval?e.interval:el(+e.interval||0),t.errorFilter=e.errorFilter;else{if("number"!=typeof e&&"string"!=typeof e)throw new Error("Invalid arguments for async.retry");t.times=+e||5}}var rl=Dc((function(t,e,n){return gu(Boolean,(t=>t))(Vc,t,e,n)}),3),ol=Dc((function(t,e,n,i){return gu(Boolean,(t=>t))(zc(e),t,n,i)}),4),sl=Dc((function(t,e,n){return gu(Boolean,(t=>t))(Yc,t,e,n)}),3),al=Dc((function(t,e,n){var i=Pc(e);return Gc(t,((t,e)=>{i(t,((n,i)=>{if(n)return e(n);e(n,{value:t,criteria:i})}))}),((t,e)=>{if(t)return n(t);n(null,e.sort(r).map((t=>t.value)))}));function r(t,e){var n=t.criteria,i=e.criteria;return n<i?-1:n>i?1:0}}),3);function cl(t,e,n,i){var r=Pc(n);return du(function(t){for(var e=Array(t);t--;)e[t]=t;return e}(t),e,r,i)}var ul,ll=Dc((function(t,e){var n,i=null;return Au(t,((t,e)=>{Pc(t)(((t,...r)=>{if(!1===t)return e(t);r.length<2?[n]=r:n=r,i=t,e(t?null:{})}))}),(()=>e(i,n)))})),hl=Dc((function(t,e,n){n=$c(n);var i=Pc(e),r=Pc(t),o=[];function s(t,...e){if(t)return n(t);o=e,!1!==t&&r(a)}function a(t,e){return t?n(t):!1!==t?e?void i(s):n(null,...o):void 0}return r(a)}),3),dl=Dc((function(t,e){if(e=Jc(e),!Array.isArray(t))return e(new Error("First argument to waterfall must be an array of functions"));if(!t.length)return e();var n=0;function i(e){Pc(t[n++])(...e,$c(r))}function r(r,...o){if(!1!==r)return r||n===t.length?e(r,...o):void i(o)}i([])})),fl={apply:function(t,...e){return(...n)=>t(...e,...n)},applyEach:Xc,applyEachSeries:Qc,asyncify:Ic,auto:nu,autoInject:function(t,e){var n={};return Object.keys(t).forEach((e=>{var i,r=t[e],o=Nc(r),s=!o&&1===r.length||o&&0===r.length;if(Array.isArray(r))i=[...r],r=i.pop(),n[e]=i.concat(i.length>0?a:r);else if(s)n[e]=r;else{if(i=function(t){const e=function(t){let e="",n=0,i=t.indexOf("*/");for(;n<t.length;)if("/"===t[n]&&"/"===t[n+1]){let e=t.indexOf("\n",n);n=-1===e?t.length:e}else if(-1!==i&&"/"===t[n]&&"*"===t[n+1]){let r=t.indexOf("*/",n);-1!==r?(n=r+2,i=t.indexOf("*/",n)):(e+=t[n],n++)}else e+=t[n],n++;return e}(t.toString());let n=e.match(iu);if(n||(n=e.match(ru)),!n)throw new Error("could not parse args in autoInject\nSource:\n"+e);let[,i]=n;return i.replace(/\s/g,"").split(ou).map((t=>t.replace(su,"").trim()))}(r),0===r.length&&!o&&0===i.length)throw new Error("autoInject task functions require explicit parameters.");o||i.pop(),n[e]=i.concat(a)}function a(t,e){var n=i.map((e=>t[e]));n.push(e),Pc(r)(...n)}})),nu(n,e)},cargo:function(t,e){return uu(t,1,e)},cargoQueue:function(t,e,n){return uu(t,e,n)},compose:function(...t){return hu(...t.reverse())},concat:pu,concatLimit:fu,concatSeries:vu,constant:function(...t){return function(...e){return e.pop()(null,...t)}},detect:mu,detectLimit:wu,detectSeries:bu,dir:xu,doUntil:function(t,e,n){const i=Pc(e);return ku(t,((...t)=>{const e=t.pop();i(...t,((t,n)=>e(t,!n)))}),n)},doWhilst:ku,each:Su,eachLimit:Fu,eachOf:Vc,eachOfLimit:Kc,eachOfSeries:Yc,eachSeries:Au,ensureAsync:_u,every:ju,everyLimit:Cu,everySeries:Ru,filter:Nu,filterLimit:Pu,filterSeries:Du,forever:Mu,groupBy:function(t,e,n){return Uu(t,1/0,e,n)},groupByLimit:Uu,groupBySeries:function(t,e,n){return Uu(t,1,e,n)},log:Lu,map:Gc,mapLimit:du,mapSeries:Zc,mapValues:function(t,e,n){return Bu(t,1/0,e,n)},mapValuesLimit:Bu,mapValuesSeries:function(t,e,n){return Bu(t,1,e,n)},memoize:function(t,e=(t=>t)){var n=Object.create(null),i=Object.create(null),r=Pc(t),o=Sc(((t,o)=>{var s=e(...t);s in n?Rc((()=>o(null,...n[s]))):s in i?i[s].push(o):(i[s]=[o],r(...t,((t,...e)=>{t||(n[s]=e);var r=i[s];delete i[s];for(var o=0,a=r.length;o<a;o++)r[o](t,...e)})))}));return o.memo=n,o.unmemoized=t,o},nextTick:Ju,parallel:function(t,e){return $u(Vc,t,e)},parallelLimit:function(t,e,n){return $u(zc(e),t,n)},priorityQueue:function(t,e){var n=Hu(t,e),{push:i,pushAsync:r}=n;function o(t,e){return Array.isArray(t)?t.map((t=>({data:t,priority:e}))):{data:t,priority:e}}return n._tasks=new zu,n._createTaskItem=({data:t,priority:e},n)=>({data:t,priority:e,callback:n}),n.push=function(t,e=0,n){return i(o(t,e),n)},n.pushAsync=function(t,e=0,n){return r(o(t,e),n)},delete n.unshift,delete n.unshiftAsync,n},queue:Hu,race:Vu,reduce:lu,reduceRight:Gu,reflect:Xu,reflectAll:function(t){var e;return Array.isArray(t)?e=t.map(Xu):(e={},Object.keys(t).forEach((n=>{e[n]=Xu.call(this,t[n])}))),e},reject:Zu,rejectLimit:Qu,rejectSeries:tl,retry:nl,retryable:function(t,e){e||(e=t,t=null);let n=t&&t.arity||e.length;Nc(e)&&(n+=1);var i=Pc(e);return Sc(((e,r)=>{function o(t){i(...e,t)}return(e.length<n-1||null==r)&&(e.push(r),r=eu()),t?nl(t,o,r):nl(o,r),r[tu]}))},seq:hu,series:function(t,e){return $u(Yc,t,e)},setImmediate:Rc,some:rl,someLimit:ol,someSeries:sl,sortBy:al,timeout:function(t,e,n){var i=Pc(t);return Sc(((r,o)=>{var s,a=!1;r.push(((...t)=>{a||(o(...t),clearTimeout(s))})),s=setTimeout((function(){var e=new Error('Callback function "'+(t.name||"anonymous")+'" timed out.');e.code="ETIMEDOUT",n&&(e.info=n),a=!0,o(e)}),e),i(...r)}))},times:function(t,e,n){return cl(t,1/0,e,n)},timesLimit:cl,timesSeries:function(t,e,n){return cl(t,1,e,n)},transform:function(t,e,n,i){arguments.length<=3&&"function"==typeof e&&(i=n,n=e,e=Array.isArray(t)?[]:{}),i=Jc(i||eu());var r=Pc(n);return Vc(t,((t,n,i)=>{r(e,t,n,i)}),(t=>i(t,e))),i[tu]},tryEach:ll,unmemoize:function(t){return(...e)=>(t.unmemoized||t)(...e)},until:function(t,e,n){const i=Pc(t);return hl((t=>i(((e,n)=>t(e,!n)))),e,n)},waterfall:dl,whilst:hl,all:ju,allLimit:Cu,allSeries:Ru,any:rl,anyLimit:ol,anySeries:sl,find:mu,findLimit:wu,findSeries:bu,flatMap:pu,flatMapLimit:fu,flatMapSeries:vu,forEach:Su,forEachSeries:Au,forEachLimit:Fu,forEachOf:Vc,forEachOfSeries:Yc,forEachOfLimit:Kc,inject:lu,foldl:lu,foldr:Gu,select:Nu,selectLimit:Pu,selectSeries:Du,wrapSync:Ic,during:hl,doDuring:ku},pl=Vt(Pa()),vl="http://www.w3.org/1999/02/22-rdf-syntax-ns#",gl="http://www.w3.org/2001/XMLSchema#",ml="http://www.w3.org/2000/10/swap/",wl={xsd:{decimal:`${gl}decimal`,boolean:`${gl}boolean`,double:`${gl}double`,integer:`${gl}integer`,string:`${gl}string`},rdf:{type:`${vl}type`,nil:`${vl}nil`,first:`${vl}first`,rest:`${vl}rest`,langString:`${vl}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${ml}reify#forSome`,forAll:`${ml}reify#forAll`},log:{implies:`${ml}log#implies`}},bl=Vt(Da()),{xsd:yl}=wl,xl=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,kl={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},El=/[\x00-\x20<>\\"\{\}\|\^\`]/,Sl={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},Fl=/$0^/,{rdf:Al,xsd:_l}=wl,jl=0,Cl={namedNode:function(t){return new Il(t)},blankNode:function(t){return new Ol(t||"n3-"+jl++)},variable:function(t){return new Nl(t)},literal:function(t,e){if("string"==typeof e)return new Tl(`"${t}"@${e.toLowerCase()}`);let n=e?e.value:"";return""===n&&("boolean"==typeof t?n=_l.boolean:"number"==typeof t&&(Number.isFinite(t)?n=Number.isInteger(t)?_l.integer:_l.double:(n=_l.double,Number.isNaN(t)||(t=t>0?"INF":"-INF")))),new Tl(""===n||n===_l.string?`"${t}"`:`"${t}"^^${n}`)},defaultGraph:function(){return ul},quad:Dl,triple:Dl},Rl=class{constructor(t){this.id=t}get value(){return this.id}equals(t){return t instanceof Rl?this.id===t.id:!!t&&this.termType===t.termType&&this.value===t.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}},Il=class extends Rl{get termType(){return"NamedNode"}},Tl=class extends Rl{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const t=this.id;let e=t.lastIndexOf('"')+1;return e<t.length&&"@"===t[e++]?t.substr(e).toLowerCase():""}get datatype(){return new Il(this.datatypeString)}get datatypeString(){const t=this.id,e=t.lastIndexOf('"')+1,n=e<t.length?t[e]:"";return"^"===n?t.substr(e+2):"@"!==n?_l.string:Al.langString}equals(t){return t instanceof Tl?this.id===t.id:!!t&&!!t.datatype&&this.termType===t.termType&&this.value===t.value&&this.language===t.language&&this.datatype.value===t.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}},Ol=class extends Rl{constructor(t){super(`_:${t}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}},Nl=class extends Rl{constructor(t){super(`?${t}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}};ul=new class extends Rl{constructor(){return super(""),ul||this}get termType(){return"DefaultGraph"}equals(t){return this===t||!!t&&this.termType===t.termType}};var Pl=class extends Rl{constructor(t,e,n,i){super(""),this._subject=t,this._predicate=e,this._object=n,this._graph=i||ul}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(t){return!!t&&this._subject.equals(t.subject)&&this._predicate.equals(t.predicate)&&this._object.equals(t.object)&&this._graph.equals(t.graph)}};function Dl(t,e,n,i){return new Pl(t,e,n,i)}var Ml=0,Ul=class{constructor(t){this._contextStack=[],this._graph=null,this._setBase((t=t||{}).baseIRI),t.factory&&Bl(this,t.factory);const e="string"==typeof t.format?t.format.match(/\w*$/)[0].toLowerCase():"",n=/turtle/.test(e),i=/trig/.test(e),r=/triple/.test(e),o=/quad/.test(e),s=this._n3Mode=/n3/.test(e),a=r||o;(this._supportsNamedGraphs=!(n||s))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(n||i||r||s),this._supportsRDFStar=""===e||/star|\*$/.test(e),a&&(this._resolveRelativeIRI=()=>null),this._blankNodePrefix="string"!=typeof t.blankNodePrefix?"":t.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=t.lexer||new class{constructor(t){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]*)?$/,this._lineMode=!!(t=t||{}).lineMode){this._n3Mode=!1;for(const t in this)!(t in Sl)&&this[t]instanceof RegExp&&(this[t]=Fl)}else this._n3Mode=!1!==t.n3;this._comments=!!t.comments,this._literalClosingPos=0}_tokenizeToEnd(t,e){let n=this._input,i=n.length;for(;;){let t,s;for(;t=this._newline.exec(n);)this._comments&&(s=this._comment.exec(t[0]))&&r("comment",s[1],"",this._line,t[0].length),n=n.substr(t[0].length,n.length),i=n.length,this._line++;if(!t&&(t=this._whitespace.exec(n))&&(n=n.substr(t[0].length,n.length)),this._endOfFile.test(n))return e&&(this._comments&&(s=this._comment.exec(n))&&r("comment",s[1],"",this._line,n.length),n=null,r("eof","","",this._line,0)),this._input=n;const a=this._line,c=n[0];let u="",l="",h="",d=null,f=0,p=!1;switch(c){case"^":if(n.length<3)break;if("^"!==n[1]){this._n3Mode&&(f=1,u="^");break}if(this._previousMarker="^^",n=n.substr(2),"<"!==n[0]){p=!0;break}case"<":if(d=this._unescapedIri.exec(n))u="IRI",l=d[1];else if(d=this._iri.exec(n)){if(l=this._unescape(d[1]),null===l||El.test(l))return o(this);u="IRI"}else n.length>1&&"<"===n[1]?(u="<<",f=2):this._n3Mode&&n.length>1&&"="===n[1]&&(u="inverse",f=2,l=">");break;case">":n.length>1&&">"===n[1]&&(u=">>",f=2);break;case"_":((d=this._blank.exec(n))||e&&(d=this._blank.exec(`${n} `)))&&(u="blank",h="_",l=d[1]);break;case'"':if(d=this._simpleQuotedString.exec(n))l=d[1];else if(({value:l,matchLength:f}=this._parseLiteral(n)),null===l)return o(this);null===d&&0===f||(u="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(d=this._simpleApostropheString.exec(n))l=d[1];else if(({value:l,matchLength:f}=this._parseLiteral(n)),null===l)return o(this);null===d&&0===f||(u="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(d=this._variable.exec(n))&&(u="var",l=d[0]);break;case"@":"literal"===this._previousMarker&&(d=this._langcode.exec(n))?(u="langcode",l=d[1]):(d=this._keyword.exec(n))&&(u=d[0]);break;case".":if(1===n.length?e:n[1]<"0"||n[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"-":(d=this._number.exec(n)||e&&(d=this._number.exec(`${n} `)))&&(u="literal",l=d[0],h="string"==typeof d[1]?yl.double:"string"==typeof d[2]?yl.decimal:yl.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(d=this._sparqlKeyword.exec(n))?u=d[0].toUpperCase():p=!0;break;case"f":case"t":(d=this._boolean.exec(n))?(u="literal",l=d[0],h=yl.boolean):p=!0;break;case"a":(d=this._shortPredicates.exec(n))?(u="abbreviation",l="a"):p=!0;break;case"=":this._n3Mode&&n.length>1&&(u="abbreviation",">"!==n[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:p=!0}if(p&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(d=this._prefix.exec(n))?((d=this._prefixed.exec(n))||e&&(d=this._prefixed.exec(`${n} `)))&&(u="prefixed",h=d[1]||"",l=this._unescape(d[2])):(u="prefix",l=d[1]||"")),"^^"===this._previousMarker)switch(u){case"prefixed":u="type";break;case"IRI":u="typeIRI";break;default:u=""}if(!u)return e||!/^'''|^"""/.test(n)&&/\n|\r/.test(n)?o(this):this._input=n;const v=f||d[0].length,g=r(u,l,h,a,v);this.previousToken=g,this._previousMarker=u,n=n.substr(v,n.length)}function r(e,r,o,s,a){const c=n?i-n.length:i,u={type:e,value:r,prefix:o,line:s,start:c,end:c+a};return t(null,u),u}function o(e){t(e._syntaxError(/^\S*/.exec(n)[0]))}}_unescape(t){let e=!1;const n=t.replace(xl,((t,n,i,r)=>{if("string"==typeof n)return String.fromCharCode(Number.parseInt(n,16));if("string"==typeof i){let t=Number.parseInt(i,16);return t<=65535?String.fromCharCode(Number.parseInt(i,16)):String.fromCharCode(55296+((t-=65536)>>10),56320+(1023&t))}return r in kl?kl[r]:(e=!0,"")}));return e?null:n}_parseLiteral(t){if(t.length>=3){const e=t.match(/^(?:"""|"|'''|'|)/)[0],n=e.length;let i=Math.max(this._literalClosingPos,n);for(;(i=t.indexOf(e,i))>0;){let e=0;for(;"\\"===t[i-e-1];)e++;if(e%2==0){const e=t.substring(n,i),r=e.split(/\r\n|\r|\n/).length-1,o=i+n;if(1===n&&0!==r||3===n&&this._lineMode)break;return this._line+=r,{value:this._unescape(e),matchLength:o}}i++}this._literalClosingPos=t.length-n+1}return{value:"",matchLength:0}}_syntaxError(t){this._input=null;const e=new Error(`Unexpected "${t}" on line ${this._line}.`);return e.context={token:void 0,line:this._line,previousToken:this.previousToken},e}_readStartingBom(t){return t.startsWith("\ufeff")?t.substr(1):t}tokenize(t,e){if(this._line=1,"string"==typeof t){if(this._input=this._readStartingBom(t),"function"!=typeof e){const t=[];let e;if(this._tokenizeToEnd(((n,i)=>n?e=n:t.push(i)),!0),e)throw e;return t}(0,bl.default)((()=>this._tokenizeToEnd(e,!0)))}else this._pendingBuffer=null,"function"==typeof t.setEncoding&&t.setEncoding("utf8"),t.on("data",(t=>{null!==this._input&&0!==t.length&&(this._pendingBuffer&&(t=Buffer.concat([this._pendingBuffer,t]),this._pendingBuffer=null),128&t[t.length-1]?this._pendingBuffer=t:(void 0===this._input?this._input=this._readStartingBom("string"==typeof t?t:t.toString()):this._input+=t,this._tokenizeToEnd(e,!1)))})),t.on("end",(()=>{"string"==typeof this._input&&this._tokenizeToEnd(e,!0)})),t.on("error",e)}}({lineMode:a,n3:s}),this._explicitQuantifiers=!!t.explicitQuantifiers}static _resetBlankNodePrefix(){Ml=0}_setBase(t){if(t){const e=t.indexOf("#");e>=0&&(t=t.substr(0,e)),this._base=t,this._basePath=t.indexOf("/")<0?t:t.replace(/[^\/?]*(?:\?.*)?$/,""),t=t.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=t[0],this._baseScheme=t[1]}else this._base="",this._basePath=""}_saveContext(t,e,n,i,r){const o=this._n3Mode;this._contextStack.push({type:t,subject:n,predicate:i,object:r,graph:e,inverse:!!o&&this._inversePredicate,blankPrefix:o?this._prefixes._:"",quantified:o?this._quantified:null}),o&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.id.substr(2)}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(t,e){const n=this._contextStack.pop();if(!n||n.type!==t)return this._error(`Unexpected ${e.type}`,e);this._subject=n.subject,this._predicate=n.predicate,this._object=n.object,this._graph=n.graph,this._n3Mode&&(this._inversePredicate=n.inverse,this._prefixes._=n.blankPrefix,this._quantified=n.quantified)}_readInTopContext(t){switch(t.type){case"eof":return null!==this._graph?this._error("Unclosed graph",t):(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(t)}}_readEntity(t,e){let n;switch(t.type){case"IRI":case"typeIRI":const e=this._resolveIRI(t.value);if(null===e)return this._error("Invalid IRI",t);n=this._namedNode(e);break;case"type":case"prefixed":const i=this._prefixes[t.prefix];if(void 0===i)return this._error(`Undefined prefix "${t.prefix}:"`,t);n=this._namedNode(i+t.value);break;case"blank":n=this._blankNode(this._prefixes[t.prefix]+t.value);break;case"var":n=this._variable(t.value.substr(1));break;default:return this._error(`Expected entity but got ${t.type}`,t)}return!e&&this._n3Mode&&n.id in this._quantified&&(n=this._quantified[n.id]),n}_readSubject(t){switch(this._predicate=null,t.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",t);case"}":return this._readPunctuation(t);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',t);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',t);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",t);if(0===t.prefix.length)return this._literalValue=t.value,this._completeSubjectLiteral;this._subject=this._literal(t.value,this._namedNode(t.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",t);default:if(void 0===(this._subject=this._readEntity(t)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(t){const e=t.type;switch(e){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[t.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${e}`,t):(this._subject=null,"]"===e?this._readBlankNodeTail(t):this._readPunctuation(t));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",t);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",t);default:if(void 0===(this._predicate=this._readEntity(t)))return}return this._readObject}_readObject(t){switch(t.type){case"literal":if(0===t.prefix.length)return this._literalValue=t.value,this._readDataTypeOrLang;this._object=this._literal(t.value,this._namedNode(t.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",t);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",t);default:if(void 0===(this._object=this._readEntity(t)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(t){return"{"===t.type?this._readGraph(t):this._readPredicate(t)}_readGraph(t){return"{"!==t.type?this._error(`Expected graph but got ${t.type}`,t):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(t){return"]"===t.type?(this._subject=null,this._readBlankNodeTail(t)):(this._predicate=null,this._readPredicate(t))}_readBlankNodeTail(t){if("]"!==t.type)return this._readBlankNodePunctuation(t);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const e=null===this._predicate;return this._restoreContext("blank",t),null!==this._object?this._getContextEndReader():null!==this._predicate?this._readObject:e?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(t){switch(t.type){case".":case"}":return this._subject=null,this._readPunctuation(t);default:return this._readPredicate(t)}}_readListItem(t){let e=null,n=null,i=this._readListItem;const r=this._subject,o=this._contextStack,s=o[o.length-1];switch(t.type){case"[":this._saveContext("blank",this._graph,n=this._blankNode(),this.RDF_FIRST,this._subject=e=this._blankNode()),i=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,n=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",t),0!==o.length&&"list"===o[o.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(i=this._readPredicate,this._subject===this.RDF_NIL)return i}else if(i=this._getContextEndReader(),this._object===this.RDF_NIL)return i;n=this.RDF_NIL;break;case"literal":0===t.prefix.length?(this._literalValue=t.value,i=this._readListItemDataTypeOrLang):(e=this._literal(t.value,this._namedNode(t.prefix)),i=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",t);default:if(void 0===(e=this._readEntity(t)))return}if(null===n&&(this._subject=n=this._blankNode()),null===r?null===s.predicate?s.subject=n:s.object=n:this._emit(r,this.RDF_REST,n,this._graph),null!==e){if(this._n3Mode&&("IRI"===t.type||"prefixed"===t.type))return this._saveContext("item",this._graph,n,this.RDF_FIRST,e),this._subject=e,this._predicate=null,this._getPathReader(this._readListItem);this._emit(n,this.RDF_FIRST,e,this._graph)}return i}_readDataTypeOrLang(t){return this._completeObjectLiteral(t,!1)}_readListItemDataTypeOrLang(t){return this._completeObjectLiteral(t,!0)}_completeLiteral(t){let e=this._literal(this._literalValue);switch(t.type){case"type":case"typeIRI":const n=this._readEntity(t);if(void 0===n)return;e=this._literal(this._literalValue,n),t=null;break;case"langcode":e=this._literal(this._literalValue,t.value),t=null}return{token:t,literal:e}}_completeSubjectLiteral(t){return this._subject=this._completeLiteral(t).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(t,e){const n=this._completeLiteral(t);if(n)return this._object=n.literal,e&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===n.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(n.token))}_readFormulaTail(t){return"}"!==t.type?this._readPunctuation(t):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",t),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(t){let e,n=this._graph;const i=this._subject,r=this._inversePredicate;switch(t.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",t);if(this._n3Mode)return this._readFormulaTail(t);this._graph=null;case".":this._subject=null,e=this._contextStack.length?this._readSubject:this._readInTopContext,r&&(this._inversePredicate=!1);break;case";":e=this._readPredicate;break;case",":e=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(n=this._readEntity(t))){e=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,t)}if(null!==i){const t=this._predicate,e=this._object;r?this._emit(e,t,i,n):this._emit(i,t,e,n)}return e}_readBlankNodePunctuation(t){let e;switch(t.type){case";":e=this._readPredicate;break;case",":e=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,t)}return this._emit(this._subject,this._predicate,this._object,this._graph),e}_readQuadPunctuation(t){return"."!==t.type?this._error("Expected dot to follow quad",t):this._readInTopContext}_readPrefix(t){return"prefix"!==t.type?this._error("Expected prefix to follow @prefix",t):(this._prefix=t.value,this._readPrefixIRI)}_readPrefixIRI(t){if("IRI"!==t.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,t);const e=this._readEntity(t);return this._prefixes[this._prefix]=e.value,this._prefixCallback(this._prefix,e),this._readDeclarationPunctuation}_readBaseIRI(t){const e="IRI"===t.type&&this._resolveIRI(t.value);return e?(this._setBase(e),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",t)}_readNamedGraphLabel(t){switch(t.type){case"IRI":case"blank":case"prefixed":return this._readSubject(t),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",t)}}_readNamedGraphBlankLabel(t){return"]"!==t.type?this._error("Invalid graph label",t):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(t){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(t)):"."!==t.type?this._error("Expected declaration to end with a dot",t):this._readInTopContext}_readQuantifierList(t){let e;switch(t.type){case"IRI":case"prefixed":if(void 0!==(e=this._readEntity(t,!0)))break;default:return this._error(`Unexpected ${t.type}`,t)}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,e,this.QUANTIFIERS_GRAPH)):this._quantified[e.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(t){return","===t.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(t))}_getPathReader(t){return this._afterPath=t,this._readPath}_readPath(t){switch(t.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const e=this._contextStack,n=e.length&&e[e.length-1];if(n&&"item"===n.type){const e=this._subject;this._restoreContext("item",t),this._emit(this._subject,this.RDF_FIRST,e,this._graph)}return this._afterPath(t)}}_readForwardPath(t){let e,n;const i=this._blankNode();if(void 0!==(n=this._readEntity(t)))return null===this._predicate?(e=this._subject,this._subject=i):(e=this._object,this._object=i),this._emit(e,n,i,this._graph),this._readPath}_readBackwardPath(t){const e=this._blankNode();let n,i;if(void 0!==(n=this._readEntity(t)))return null===this._predicate?(i=this._subject,this._subject=e):(i=this._object,this._object=e),this._emit(e,n,i,this._graph),this._readPath}_readRDFStarTailOrGraph(t){return">>"!==t.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(t))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,t):this._readRDFStarTail(t)}_readRDFStarTail(t){if(">>"!==t.type)return this._error(`Expected >> but got ${t.type}`,t);const e=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",t),null===this._subject?(this._subject=e,this._readPredicate):(this._object=e,this._getContextEndReader())}_getContextEndReader(){const t=this._contextStack;if(!t.length)return this._readPunctuation;switch(t[t.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(t,e,n,i){this._callback(null,this._quad(t,e,n,i||this.DEFAULTGRAPH))}_error(t,e){const n=new Error(`${t} on line ${e.line}.`);n.context={token:e,line:e.line,previousToken:this._lexer.previousToken},this._callback(n),this._callback=Ll}_resolveIRI(t){return/^[a-z][a-z0-9+.-]*:/i.test(t)?t:this._resolveRelativeIRI(t)}_resolveRelativeIRI(t){if(!t.length)return this._base;switch(t[0]){case"#":return this._base+t;case"?":return this._base.replace(/(?:\?.*)?$/,t);case"/":return("/"===t[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(t);default:return/^[^/:]*:/.test(t)?null:this._removeDotSegments(this._basePath+t)}}_removeDotSegments(t){if(!/(^|\/)\.\.?($|[/#?])/.test(t))return t;const e=t.length;let n="",i=-1,r=-1,o=0,s="/";for(;i<e;){switch(s){case":":if(r<0&&"/"===t[++i]&&"/"===t[++i])for(;(r=i+1)<e&&"/"!==t[r];)i=r;break;case"?":case"#":i=e;break;case"/":if("."===t[i+1])switch(s=t[1+ ++i],s){case"/":n+=t.substring(o,i-1),o=i+1;break;case void 0:case"?":case"#":return n+t.substring(o,i)+t.substr(i+1);case".":if(s=t[1+ ++i],void 0===s||"/"===s||"?"===s||"#"===s){if(n+=t.substring(o,i-2),(o=n.lastIndexOf("/"))>=r&&(n=n.substr(0,o)),"/"!==s)return`${n}/${t.substr(i+1)}`;o=i+1}}}s=t[++i]}return n+t.substring(o)}parse(t,e,n){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${Ml++}_`,this._prefixCallback=n||Ll,this._inversePredicate=!1,this._quantified=Object.create(null),!e){const e=[];let n;if(this._callback=(t,i)=>{t?n=t:i&&e.push(i)},this._lexer.tokenize(t).every((t=>this._readCallback=this._readCallback(t))),n)throw n;return e}this._callback=e,this._lexer.tokenize(t,((t,e)=>{null!==t?(this._callback(t),this._callback=Ll):this._readCallback&&(this._readCallback=this._readCallback(e))}))}};function Ll(){}function Bl(t,e){const n=e.namedNode;t._namedNode=n,t._blankNode=e.blankNode,t._literal=e.literal,t._variable=e.variable,t._quad=e.quad,t.DEFAULTGRAPH=e.defaultGraph(),t.RDF_FIRST=n(wl.rdf.first),t.RDF_REST=n(wl.rdf.rest),t.RDF_NIL=n(wl.rdf.nil),t.N3_FORALL=n(wl.r.forAll),t.N3_FORSOME=n(wl.r.forSome),t.ABBREVIATIONS={a:n(wl.rdf.type),"=":n(wl.owl.sameAs),">":n(wl.log.implies)},t.QUANTIFIERS_GRAPH=n("urn:n3:quantifiers")}Bl(Ul.prototype,Cl);var Jl=Cl.defaultGraph(),{rdf:$l,xsd:Hl}=wl,zl=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,Kl=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,Wl={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"},ql=class extends Rl{equals(){return!1}};function Vl(t){let e=Wl[t];return void 0===e&&(1===t.length?(e=t.charCodeAt(0).toString(16),e="\\u0000".substr(0,6-e.length)+e):(e=(1024*(t.charCodeAt(0)-55296)+t.charCodeAt(1)+9216).toString(16),e="\\U00000000".substr(0,10-e.length)+e)),e}function Gl(t){return t.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}function Xl(t,e,n,i,r,o,s){try{var a=t[o](s),c=a.value}catch(t){return void n(t)}a.done?e(c):Promise.resolve(c).then(i,r)}var Yl=Vt(La());new bc("chrome:theSession");var Zl=function(){Qa(i,oc);var t,e,n=(t=i,e=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(t){return!1}}(),function(){var n,i=nc(t);if(e){var r=nc(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ec(this,n)});function i(){var t;return Xa(this,i),ic(Ya(t=n.call(this,"")),"value",""),ic(Ya(t),"termType","DefaultGraph"),ic(Ya(t),"uri","chrome:theSession"),t}return Ga(i,[{key:"toCanonical",value:function(){return this.value}},{key:"toString",value:function(){return"DefaultGraph"}}]),i}();function Ql(t){return!!t&&"DefaultGraph"===t.termType}var th=new Zl,eh=function(){function t(e,n,i,r){Xa(this,t),ic(this,"subject",void 0),ic(this,"predicate",void 0),ic(this,"object",void 0),ic(this,"graph",void 0),this.subject=oc.fromValue(e),this.predicate=oc.fromValue(n),this.object=oc.fromValue(i),this.graph=null==r?th:oc.fromValue(r)}return Ga(t,[{key:"why",get:function(){return this.graph},set:function(t){this.graph=t}},{key:"equals",value:function(t){return t.subject.equals(this.subject)&&t.predicate.equals(this.predicate)&&t.object.equals(this.object)&&t.graph.equals(this.graph)}},{key:"substitute",value:function(e){var n=new t(this.subject.substitute(e),this.predicate.substitute(e),this.object.substitute(e),Ql(this.graph)?this.graph:this.graph.substitute(e));return console.log("@@@ statement substitute:"+n),n}},{key:"toCanonical",value:function(){var t=[this.subject.toCanonical(),this.predicate.toCanonical(),this.object.toCanonical()];return this.graph&&"DefaultGraph"!==this.graph.termType&&t.push(this.graph.toCanonical()),t.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(),Ql(this.graph)?"":this.graph.toNT()].join(" ")+" ."}},{key:"toString",value:function(){return this.toNT()}}]),t}(),nh={};Wt(nh,{docpart:()=>rh,document:()=>oh,hostpart:()=>sh,join:()=>ah,protocol:()=>ch,refTo:()=>uh});var ih=ih||console.log;function rh(t){var e;return(e=t.indexOf("#"))<0?t:t.slice(0,e)}function oh(t){return new bc(rh(t))}function sh(t){var e=/[^\/]*\/\/([^\/]*)\//.exec(t);return e?e[1]:""}function ah(t,e){var n,i,r,o,s,a=e.indexOf("#");if(a>0&&(e=e.slice(0,a)),0===t.length)return e;if(0===t.indexOf("#"))return e+t;if(t.indexOf(":")>=0)return t;if(n=e.indexOf(":"),0===e.length)return t;if(n<0)return ih("Invalid base: "+e+" in join with given: "+t),t;if(i=e.slice(0,+n+1||9e9),0===t.indexOf("//"))return i+t;if(e.indexOf("//",n)===n+1){if((r=e.indexOf("/",n+3))<0)return e.length-n-3>0?e+"/"+t:i+t}else if((r=e.indexOf("/",n+1))<0)return e.length-n-1>0?e+"/"+t:i+t;if(0===t.indexOf("/"))return e.slice(0,r)+t;if((o=(s=e.slice(r)).lastIndexOf("/"))<0)return i+t;for(o>=0&&o<s.length-1&&(s=s.slice(0,+o+1||9e9)),s+=t;s.match(/[^\/]*\/\.\.\//);)s=s.replace(/[^\/]*\/\.\.\//,"");return s=(s=s.replace(/\.\//g,"")).replace(/\/\.$/,"/"),e.slice(0,r)+s}function ch(t){var e=t.indexOf(":");return e<0?null:t.slice(0,e)}function uh(t,e){var n,i,r,o,s,a,c,u,l,h,d,f,p=new RegExp("^[-_a-zA-Z0-9.]+:(//[^/]*)?/[^/]*$");if(!t)return e;if(t===e)return"";for(n=c=0,o=e.length;c<o&&e[n]===t[n];n=++c);if(t.slice(0,n).match(p)&&((i=e.indexOf("//"))<0&&(i=-2),r=e.indexOf("/",i+2),"/"!==e[r+1]&&"/"!==t[r+1]&&e.slice(0,r)===t.slice(0,r)))return e.slice(r);if("#"===e[n]&&t.length===n)return e.slice(n);for(;n>0&&"/"!==e[n-1];)n--;if(n<3)return e;if(t.indexOf("//",n-2)>0||e.indexOf("//",n-2)>0)return e;if(t.indexOf(":",n)>0)return e;for(a=0,u=0,s=(h=t.slice(n)).length;u<s;u++)"/"===h[u]&&a++;if(0===a&&n<e.length&&"#"===e[n])return"./"+e.slice(n);if(0===a&&n===e.length)return"./";if(f="",a>0)for(l=1,d=a;d>=1?l<=d:l>=d;d>=1?++l:--l)f+="../";return f+e.slice(n)}var lh,hh,dh,fh=function(){Qa(i,oc);var t,e,n=(t=i,e=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(t){return!1}}(),function(){var n,i=nc(t);if(e){var r=nc(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ec(this,n)});function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Xa(this,i),ic(Ya(t=n.call(this,e)),"termType","Variable"),ic(Ya(t),"base","varid:"),ic(Ya(t),"classOrder",rc.Variable),ic(Ya(t),"isVar",1),ic(Ya(t),"uri",void 0),t.base="varid:",t.uri=ah(e,t.base),t}return Ga(i,[{key:"equals",value:function(t){return!!t&&this.termType===t.termType&&this.value===t.value}},{key:"hashString",value:function(){return this.toString()}},{key:"substitute",value:function(t){var e;return null!=(e=t[this.toNT()])?e:this}},{key:"toString",value:function(){return i.toString(this)}}],[{key:"toString",value:function(t){return t.uri.slice(0,t.base.length)===t.base?"?".concat(t.uri.slice(t.base.length)):"?".concat(t.uri)}}]),i}();(hh=lh||(lh={})).collections="COLLECTIONS",hh.defaultGraphType="DEFAULT_GRAPH_TYPE",hh.equalsMethod="EQUALS_METHOD",hh.id="ID",hh.identity="IDENTITY",hh.reversibleId="REVERSIBLE_ID",hh.variableType="VARIABLE_TYPE";var ph=new Zl,vh={supports:(dh={},ic(dh,lh.collections,!1),ic(dh,lh.defaultGraphType,!1),ic(dh,lh.equalsMethod,!0),ic(dh,lh.identity,!1),ic(dh,lh.id,!0),ic(dh,lh.reversibleId,!1),ic(dh,lh.variableType,!0),dh),blankNode:function(t){return new sc(t)},defaultGraph:function(){return ph},equals:function(t,e){return t===e||!t||!e||(pc(t)||pc(e)?!(!pc(t)||!pc(e))&&this.equals(t.subject,e.subject)&&this.equals(t.predicate,e.predicate)&&this.equals(t.object,e.object)&&this.equals(t.graph,e.graph):!(!dc(t)||!dc(e))&&this.id(t)===this.id(e))},id:function(t){if(!t)return"undefined";if(pc(t))return this.quadToNQ(t);switch(t.termType){case"DefaultGraph":return"defaultGraph";case"Variable":return fh.toString(t);default:var e=this.termToNQ(t);if(e)return e;throw new Error("Can't id term with type '".concat(t.termType,"'"))}},isQuad:function(t){return t instanceof eh},literal:function(t,e){if("string"!=typeof t&&!e)return xc.fromValue(t);var n="string"==typeof t?t:""+t;return"string"==typeof e?-1===e.indexOf(":")?new xc(n,e):new xc(n,null,this.namedNode(e)):new xc(n,null,e)},namedNode:function(t){return new bc(t)},quad:function(t,e,n,i){return new eh(t,e,n,i||ph)},triple:function(t,e,n,i){return this.quad(t,e,n,i)},quadToNQ:function(t){return"".concat(this.termToNQ(t.subject)," ").concat(this.termToNQ(t.predicate)," ").concat(this.termToNQ(t.object)," ").concat(this.termToNQ(t.graph)," .")},termToNQ:function(t){var e=this;switch(t.termType){case"BlankNode":return"_:"+t.value;case"DefaultGraph":return"";case"Empty":return"<http://www.w3.org/1999/02/22-rdf-syntax-ns#nil>";case"Literal":return xc.toNT(t);case"Graph":case"NamedNode":return"<"+t.value+">";case"Collection":return"("+t.elements.map((function(t){return e.termToNQ(t)})).join(" ")+")";default:throw new Error("Can't serialize nonstandard term type (was '".concat(t.termType,"')"))}},toNQ:function(t){return this.isQuad(t)?this.quadToNQ(t):this.termToNQ(t)},variable:function(t){return new fh(t)}},gh=function(){},mh=function(){},wh=function(){},bh=function(){};function yh(t,e){var n=e||{namedNode:function(t){return new bc(t)}};return function(e){return n.namedNode(t+(e||""))}}var xh=Vt(Ka());function kh(t,e){t.callbacks={};for(var n=e.length-1;n>=0;n--)t.callbacks[e[n]]=[];t.addHook=function(e){t.callbacks[e]||(t.callbacks[e]=[])},t.addCallback=function(e,n){t.callbacks[e].push(n)},t.removeCallback=function(e,n){for(var i=0;i<t.callbacks[e].length;i++)if(t.callbacks[e][i].name===n)return t.callbacks[e].splice(i,1),!0;return!1},t.insertCallback=function(e,n){t.callbacks[e].unshift(n)},t.fireCallbacks=function(e,n){var i,r,o=[],s=[],a=t.callbacks[e].length;for(i=a-1;i>=0;i--)(r=t.callbacks[e][i])&&r.apply(t,n)&&o.push(r);for(i=o.length-1;i>=0;i--)s.push(o[i]);for(i=a;i<t.callbacks[e].length;i++)s.push(t.callbacks[e][i]);t.callbacks[e]=s}}function Eh(t,e){var n=[];(e=e||{})&&e.selfClosing&&e.selfClosing.split(" ").forEach((function(t){n[t]=!0}));var i=[];return e&&e.skipAttributes&&e.skipAttributes.split(" ").forEach((function(t){i[t]=!0})),Sh(t,e,n,i)}function Sh(t,e,n,i){var r,o="",s=[!1];if(void 0===t.nodeType)return o;if(1===t.nodeType){if(t.hasAttribute("class")&&e&&e.classWithChildText&&t.matches(e.classWithChildText.class))o+=t.querySelector(e.classWithChildText.element).textContent;else if(!(e&&e.skipNodeWithClass&&t.matches("."+e.skipNodeWithClass))){var a=t.nodeName.toLowerCase();o+="<"+a;var c=[];for(r=t.attributes.length-1;r>=0;r--){var u=t.attributes[r];if(!(i&&i.length>0&&i[u.name]||/^\d+$/.test(u.name))){if("class"===u.name&&e&&e.replaceClassItemWith&&u.value.split(" ").indexOf(e.replaceClassItemWith.source)>-1){var l=new RegExp(e.replaceClassItemWith.source,"g");u.value=u.value.replace(l,e.replaceClassItemWith.target).trim()}"class"===u.name&&e&&e.skipClassWithValue&&e.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&&(e&&e.sortAttributes&&c.sort((function(t,e){return t.toLowerCase().localeCompare(e.toLowerCase())})),o+=" "+c.join(" ")),n&&n.ename)o+=" />";else{for(o+=">",o+="html"===a?"\n ":"",s.push("style"===a||"script"===a),r=0;r<t.childNodes.length;r++)o+=Sh(t.childNodes[r]);s.pop(),o+="body"===a?"</"+a+">\n":"</"+a+">"}}}else if(8===t.nodeType)o+="\x3c!--"+t.nodeValue+"--\x3e";else if(3===t.nodeType||4===t.nodeType){var h=t.nodeValue.replace(/\n+$/,"");o+=s[s.length-1]?h:h.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}else console.log("Warning; Cannot handle serialising nodes of type: "+t.nodeType),console.log(t);return o}function Fh(t,e,n,i){var r=function(t){return"BlankNode"===t.termType?null:t},o=function(t){var e=n.statementsMatching(t).map((function(t){return r(t.subject)+" "+r(t.predicate)+" "+r(t.object)})).concat(n.statementsMatching(void 0,void 0,t).map((function(t){return r(t.subject)+" "+r(t.predicate)+" "+r(t.object)})));return e.sort(),e.join("\n")},s=Object.prototype.hasOwnProperty.call(n,"compareTerms")?n.compareTerms(t,e):t.compareTerm(e);return"BlankNode"===t.termType&&"BlankNode"===e.termType?0===s?0:o(t)>o(e)?1:o(t)<o(e)?-1:s:i&&t.uri&&e.uri?(i[t.uri]||t.uri).localeCompare(i[e.uri]||e.uri):s}function Ah(t,e){return e=e||{},"undefined"!=typeof module&&module&&module.exports?(new xh.DOMParser).parseFromString(t,e.contentType||"application/xhtml+xml"):("undefined"!=typeof window&&window.DOMParser?new window.DOMParser:new xh.DOMParser).parseFromString(t,"application/xml")}function _h(t,e){for(var n=0;n<t.length;n++)if(t[n].subject.equals(e.subject)&&t[n].predicate.equals(e.predicate)&&t[n].object.equals(e.object)&&t[n].why.equals(e.why))return void t.splice(n,1);throw new Error("RDFArrayRemove: Array did not contain "+e+" "+e.why)}function jh(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:vh;return{boolean:t.namedNode("http://www.w3.org/2001/XMLSchema#boolean"),dateTime:t.namedNode("http://www.w3.org/2001/XMLSchema#dateTime"),decimal:t.namedNode("http://www.w3.org/2001/XMLSchema#decimal"),double:t.namedNode("http://www.w3.org/2001/XMLSchema#double"),integer:t.namedNode("http://www.w3.org/2001/XMLSchema#integer"),langString:t.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),string:t.namedNode("http://www.w3.org/2001/XMLSchema#string")}}jh(vh);var Ch=Vt(Wa()),Rh=function(){function t(e){Xa(this,t),ic(this,"_notQNameChars","\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~"),ic(this,"_notNameChars",this._notQNameChars+":"),ic(this,"validPrefix",new RegExp(/^[a-zA-Z][a-zA-Z0-9]*$/)),ic(this,"forbidden1",new RegExp(/[\\"\b\f\r\v\t\n\u0080-\uffff]/gm)),ic(this,"forbidden3",new RegExp(/[\\"\b\f\r\v\u0080-\uffff]/gm)),this.flags="",this.base=null,this.prefixes=[],this.namespaces=[];var n=Object.keys((0,Ch.default)());for(var i in n){var r=(0,Ch.default)()[n[i]](""),o=n[i];this.prefixes[r]=o,this.namespaces[o]=r}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=e,this.rdfFactory=e.rdfFactory||vh,this.xsd=jh(this.rdfFactory)}return Ga(t,[{key:"setBase",value:function(t){return this.base=t,this}},{key:"setFlags",value:function(t){return this.flags=t||"",this}},{key:"toStr",value:function(t){var e=t.toNT();return"Graph"===t.termType&&(this.formulas[e]=t),e}},{key:"fromStr",value:function(t){if("{"===t[0]){var e=this.formulas[t];return e||console.log("No formula object for "+t),e}return this.store.fromNT(t)}},{key:"setNamespaces",value:function(t){for(var e in t)this.setPrefix(e,t[e]);return this}},{key:"setPrefix",value:function(t,e){if("default"!==t.slice(0,7)&&"ns"!==t.slice(0,2)&&t&&e){for(var n in this.prefixes)this.prefixes[n]==t&&delete this.prefixes[n];this.prefixes[e]=t,this.namespaces[t]=e}}},{key:"suggestPrefix",value:function(t,e){"default"!==t.slice(0,7)&&"ns"!==t.slice(0,2)&&t&&e&&(t in this.namespaces||e in this.prefixes||(this.prefixes[e]=t,this.namespaces[t]=e))}},{key:"suggestNamespaces",value:function(t){for(var e in t)this.suggestPrefix(e,t[e]);return this}},{key:"checkIntegrity",value:function(){var t,e;for(t in this.namespaces)if(this.prefixes[this.namespaces[t]]!==t)throw new Error("Serializer integity error 1: "+t+", "+this.namespaces[t]+", "+this.prefixes[this.namespaces[t]]+"!");for(e in this.prefixes)if(this.namespaces[this.prefixes[e]]!==e)throw new Error("Serializer integity error 2: "+e+", "+this.prefixs[e]+", "+this.namespaces[this.prefixes[e]]+"!")}},{key:"makeUpPrefix",value:function(t){var e=t,n=function(e){return!!this.validPrefix.test(e)&&"ns"!==e&&!(e in this.namespaces)&&(this.prefixes[t]=e,this.namespaces[e]=t,e)}.bind(this);"#/".indexOf(e[e.length-1])>=0&&(e=e.slice(0,-1));var i=e.lastIndexOf("/");i>=0&&(e=e.slice(i+1));for(var r=0;r<e.length&&this.prefixchars.indexOf(e[r]);)r++;if((e=e.slice(0,r)).length<6&&n(e))return e;if(n(e.slice(0,3)))return e.slice(0,3);if(n(e.slice(0,2)))return e.slice(0,2);if(n(e.slice(0,4)))return e.slice(0,4);if(n(e.slice(0,1)))return e.slice(0,1);if(n(e.slice(0,5)))return e.slice(0,5);this.validPrefix.test(e)||(e="n");for(var o=0;;o++)if(n(e.slice(0,3)+o))return e.slice(0,3)+o}},{key:"rootSubjects",value:function(t){for(var e={},n={},i={},r=0;r<t.length;r++){var o=t[r],s=function(t){e.hasOwnProperty(t)||(e[t]=[]),e[t].push(o.subject)};[o.subject,o.predicate,o.object].map((function(t){"BlankNode"===t.termType?i[t.toNT()]=!0:"Collection"===t.termType&&t.elements.forEach((function(t){s(t)}))})),s(t[r].object);var a=n[this.toStr(o.subject)];a||(a=[]),a.push(o),n[this.toStr(o.subject)]=a}var c=[];for(var u in n)if(n.hasOwnProperty(u)){var l=this.fromStr(u);"BlankNode"===l.termType&&e[l]&&1===e[l].length||c.push(l)}this.incoming=e;for(var h={},d=0;d<c.length;d++)h[c[d].toNT()]=!0;return{roots:c,subjects:n,rootsHash:h,incoming:e}}},{key:"toN3",value:function(t){return this.statementsToN3(t.statements)}},{key:"explicitURI",value:function(t){return"<"+(t=this.flags.indexOf("r")<0&&this.base?uh(this.base,t):this.flags.indexOf("u")>=0?function(t){for(var e,n="",i=0;i<t.length;i++)n+=(e=t.charCodeAt(i))>65535?"\\U"+("00000000"+e.toString(16)).slice(-8):e>126?"\\u"+("0000"+e.toString(16)).slice(-4):t[i];return n}(t):encodeURI(t))+">"}},{key:"statementsToNTriples",value:function(t){var e=t.slice();e.sort();for(var n="",i="http://www.w3.org/1999/02/22-rdf-syntax-ns#",r=this,o=this.store,s=this.rdfFactory,a=function t(e){if("Collection"!==e.termType)return r.atomicTermToN3(e);for(var a=e.elements,c=o.sym(i+"nill"),u=a.length-1;u>=0;u--){var l=s.blankNode();n+=t(l)+" "+t(o.sym(i+"first"))+" "+t(a[u])+".\n",n+=t(l)+" "+t(o.sym(i+"rest"))+" "+t(c)+".\n",c=l}return r.atomicTermToN3(c)},c=0;c<e.length;c++){var u=e[c],l="";l+=a(u.subject)+" ",l+=a(u.predicate)+" ",l+=a(u.object)+" ",this.flags.indexOf("q")>=0&&(l+=a(u.why)+" "),n+=l+=".\n"}return n}},{key:"statementsToN3",value:function(e){var n=this.store,i={"http://www.w3.org/1999/02/22-rdf-syntax-ns#type":"aaa:00"};e.sort((function(t,e){return function(t,e,n,i){return Fh(t.subject,e.subject,n,i)||Fh(t.predicate,e.predicate,n,i)||Fh(t.object,e.object,n,i)}(t,e,n,i)})),this.base&&!this.defaultNamespace&&(this.defaultNamespace=this.base+"#");var r={};this.flags.indexOf("s")<0&&(r["http://www.w3.org/2002/07/owl#sameAs"]="="),this.flags.indexOf("t")<0&&(r["http://www.w3.org/1999/02/22-rdf-syntax-ns#type"]="a"),this.flags.indexOf("i")<0&&(r["http://www.w3.org/2000/10/swap/log#implies"]="=>");var o=function(t){for(var e="",n=0;n<t;n++)e+=" ";return e},s=function t(e){for(var n="",i=0;i<e.length;i++){var r=e[i],o="string"==typeof r?r:t(r);if(0!==i){var s=n.slice(-1)||" ";","===o||";"===o||("."!==o||"0123456789.:".includes(s))&&(n+=" ")}n+=o}return n},a=function(t){for(var e=this.rootSubjects(t),n=e.roots,i=[],r=0;r<n.length;r++)i.push(c(n[r],e));return i}.bind(this);function c(t,e){return"BlankNode"!==t.termType||e.incoming[t]?[h(t,e)].concat([u(t,e)]).concat(["."]):l(t,e,!0).concat(["."])}var u=function(t,e){var n=[],i=null,o=e.subjects[this.toStr(t)]||[];if(void 0===o)throw new Error("Cant find statements for "+t);for(var s=[],a=0;a<o.length;a++){var c=o[a];c.predicate.uri===i?s.push(","):(i&&(n=n.concat([s]).concat([";"]),s=[]),n.push(r[c.predicate.uri]?r[c.predicate.uri]:h(c.predicate,e))),i=c.predicate.uri,s.push(l(c.object,e))}return n.concat([s])}.bind(this),l=function(t,e,n){return"BlankNode"!==t.termType||!n&&void 0!==e.rootsHash[t.toNT()]?h(t,e):e.subjects[this.toStr(t)]?["[",u(t,e),"]"]:"[]"}.bind(this);t.prototype.termToN3=h;var h=function(t,e){var n,i;switch(t.termType){case"Graph":return(i=(i=["{"]).concat(a(t.statements))).concat(["}"]);case"Collection":for(i=["("],n=0;n<t.elements.length;n++)i.push([l(t.elements[n],e)]);return i.push(")"),i;default:return this.atomicTermToN3(t)}}.bind(this),d=function(){var t="";for(var e in this.defaultNamespace&&(t+="@prefix : "+this.explicitURI(this.defaultNamespace)+".\n"),this.prefixes)this.prefixes.hasOwnProperty(e)&&this.namespacesUsed[e]&&(t+="@prefix "+this.prefixes[e]+": "+this.explicitURI(e)+".\n");return t+"\n"}.bind(this),f=a(e);return d()+function t(e,n){var i="",r=1e5;void 0===n&&(n=-1);for(var a=0;a<e.length;a++){var c=e[a];if("string"!=typeof c){var u=t(c,n+1);if(u.length<10*(80-4*n)&&u.indexOf('"""')<0){var l=s(c);l.length<80-4*n&&(c=l,u="")}u&&(r=1e4),i+=u}if("string"==typeof c){if(1===c.length&&"\n"===i.slice(-1)&&",.;".indexOf(c)>=0){i=i.slice(0,-1),"."==c&&"0123456789.:".includes(i.charAt(i.length-1))&&(i+=" ",r+=1),i+=c+"\n",r+=1;continue}if(r<4*n+4||r+c.length+1<80&&";.".indexOf(i[i.length-2])<0)i=i.slice(0,-1)+" "+c+"\n",r+=c.length+1;else{var h=o(4*n)+c;i+=h+"\n",r=h.length,n<0&&(i+="\n",r=1e5)}}}return i}(f)}},{key:"atomicTermToN3",value:function(t,e){switch(t.termType){case"BlankNode":case"Variable":return t.toNT();case"Literal":var n=t.value;if("string"!=typeof n)throw new TypeError("Value of RDF literal node must be a string");if(t.datatype&&this.flags.indexOf("x")<0)switch(t.datatype.uri){case"http://www.w3.org/2001/XMLSchema#integer":return n;case"http://www.w3.org/2001/XMLSchema#decimal":return n.indexOf(".")<0&&(n+=".0"),n;case"http://www.w3.org/2001/XMLSchema#double":var i=n.toLowerCase().indexOf("e")>0;return n.indexOf(".")<0&&!i&&(n+=".0"),i||(n+="e0"),n;case"http://www.w3.org/2001/XMLSchema#boolean":return"1"===t.value?"true":"false"}var r=this.stringToN3(t.value);return t.language?r+="@"+t.language:t.datatype.equals(this.xsd.string)||(r+="^^"+this.atomicTermToN3(t.datatype,e)),r;case"NamedNode":return this.symbolToN3(t);case"DefaultGraph":return"";default:throw new Error("Internal: atomicTermToN3 cannot handle "+t+" of termType: "+t.termType)}}},{key:"stringToN3",value:function(t,e){e||(e="e");var n,i,r,o,s,a="";for(t.length>20&&'"'!==t.slice(-1)&&e.indexOf("n")<0&&(t.indexOf("\n")>0||t.indexOf('"')>0)?(o='"""',s=this.forbidden3):(o='"',s=this.forbidden1),n=0;n<t.length&&(s.lastIndex=0,null!=s.exec(t.slice(n)));){a+=t.slice(n,i=n+s.lastIndex-1);var c=t[i];'"'===c&&'"""'===o&&'"""'!==t.slice(i,i+3)?a+=c:(r='\b\f\r\t\v\n\\"'.indexOf(c))>=0?a+="\\"+'bfrtvn\\"'[r]:e.indexOf("e")>=0?a+="\\u"+("000"+c.charCodeAt(0).toString(16).toLowerCase()).slice(-4):a+=c,n=i+1}return o+a+t.slice(n)+o}},{key:"symbolToN3",value:function(t){var e=t.uri,n=e.indexOf("#");if(n<0&&this.flags.indexOf("/")<0&&(n=e.lastIndexOf("/")),n>=0&&this.flags.indexOf("p")<0&&(0===e.indexOf("http")||0===e.indexOf("ws")||0===e.indexOf("file"))){for(var i=!0,r=n+1;r<e.length;r++)if(this._notNameChars.indexOf(e[r])>=0){i=!1;break}if(i){var o=e.slice(n+1),s=e.slice(0,n+1);if(this.defaultNamespace&&this.defaultNamespace===s&&this.flags.indexOf("d")<0)return this.flags.indexOf("k")>=0&&this.keyords.indexOf(o)<0?o:":"+o;var a=this.prefixes[s];if(a||(a=this.makeUpPrefix(s)),a)return this.namespacesUsed[s]=!0,a+":"+o}}return this.explicitURI(e)}},{key:"writeStore",value:function(t){var e=this.store,n=e.fetcher,i=n&&n.appNode,r=this.store.index[3];for(var o in r){var s=e.fromNT(o);i&&s.equals(i)||t("\n"+this.atomicTermToN3(s)+" "+this.atomicTermToN3(e.sym("http://www.w3.org/2000/10/swap/log#semantics"))+" { "+this.statementsToN3(e.statementsMatching(void 0,void 0,void 0,s))+" }.\n")}e.statementsMatching(void 0,e.sym("http://www.w3.org/2007/ont/link#requestedURI")).map((function(n){t("\n<"+n.object.value+"> log:metadata {\n");var i=e.statementsMatching(void 0,void 0,void 0,n.subject);t(this.statementsToN3(this.statementsToN3(i))),t("}.\n")}));var a=[];i&&a.push(i);var c=[];a.map((function(t){c=c.concat(e.statementsMatching(void 0,void 0,void 0,t))})),t(this.statementsToN3(c))}},{key:"statementsToXML",value:function(t){var e=[];e["http://www.w3.org/1999/02/22-rdf-syntax-ns#"]=!0;var n="http://www.w3.org/1999/02/22-rdf-syntax-ns#_",i=function(t){for(var e="",n=0;n<t;n++)e+=" ";return e},r=function t(e){for(var n="",i=0;i<e.length;i++){var r=e[i];n+="string"==typeof r?r:t(r)}return n},o=function(t){this.suggestPrefix("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#");for(var e=this.rootSubjects(t),n=e.roots,i=[],r=0;r<n.length;r++)i.push(c(n[r],e));return i}.bind(this);function s(t){return void 0===t?"@@@undefined@@@@":t.replace(/[&<"]/g,(function(t){switch(t[0]){case"&":return"&amp;";case"<":return"&lt;";case'"':return"&quot;"}}))}var a=function(t){return s(this.base?nh.refTo(this.base,t.uri):t.uri)}.bind(this),c=function(t,e){var i,r,o,d,f=[],p=e.subjects[this.toStr(t)];if(void 0===p)return l(t,e);p.sort((function(t,e){var i=t.predicate.uri,r=e.predicate.uri;if(i.substring(0,n.length)===n||r.substring(0,n.length)===n)return i.localeCompare(r);var o=i.substring(n.length),s=r.substring(n.length),a=parseInt(o,10),c=parseInt(s,10);return isNaN(a)||isNaN(c)||a!==o||c!==s?i.localeCompare(r):a-c}));for(var v=0;v<p.length;v++)if("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"!==(o=p[v]).predicate.uri||i||"NamedNode"!==o.object.termType){if((d=o.predicate).uri.substr(0,n.length)===n){var g=d.uri.substr(n.length);g===parseInt(g,10).toString()&&(d=this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#li"))}switch(r=h(d),o.object.termType){case"BlankNode":f=f.concat(1===e.incoming[o.object].length?["<"+r+' rdf:parseType="Resource">',c(o.object,e),"</"+r+">"]:["<"+r+' rdf:nodeID="'+o.object.toNT().slice(2)+'"/>']);break;case"NamedNode":f=f.concat(["<"+r+' rdf:resource="'+a(o.object)+'"/>']);break;case"Literal":f=f.concat(["<"+r+(o.object.datatype.equals(this.xsd.string)?"":' rdf:datatype="'+s(o.object.datatype.uri)+'"')+(o.object.language?' xml:lang="'+o.object.language+'"':"")+">"+s(o.object.value)+"</"+r+">"]);break;case"Collection":f=f.concat(["<"+r+' rdf:parseType="Collection">',u(o.object,e),"</"+r+">"]);break;default:throw new Error("Can't serialize object of type "+o.object.termType+" into XML")}}else i=o.object;var m=i?h(i):"rdf:Description",w="";return"BlankNode"===t.termType?e.incoming[t]&&1===e.incoming[t].length||(w=' rdf:nodeID="'+t.toNT().slice(2)+'"'):w=' rdf:about="'+a(t)+'"',["<"+m+w+">"].concat([f]).concat(["</"+m+">"])}.bind(this);function u(t,e){for(var n=[],i=0;i<t.elements.length;i++)n.push(c(t.elements[i],e));return n}var l=function(t,e){var n=[],i=e.subjects[this.toStr(t)];if(!i)return n;i.sort();for(var r=0;r<i.length;r++){var o=i[r];switch(o.object.termType){case"BlankNode":n=e.rootsHash[o.object.toNT()]?n.concat(["<"+h(o.predicate)+' rdf:nodeID="'+o.object.toNT().slice(2)+'">',"</"+h(o.predicate)+">"]):n.concat(["<"+h(o.predicate)+' rdf:parseType="Resource">',l(o.object,e),"</"+h(o.predicate)+">"]);break;case"NamedNode":n=n.concat(["<"+h(o.predicate)+' rdf:resource="'+a(o.object)+'"/>']);break;case"Literal":n=n.concat(["<"+h(o.predicate)+(o.object.datatype.equals(this.xsd.string)?"":' rdf:datatype="'+s(o.object.datatype.value)+'"')+(o.object.language?' xml:lang="'+o.object.language+'"':"")+">"+s(o.object.value)+"</"+h(o.predicate)+">"]);break;case"Collection":n=n.concat(["<"+h(o.predicate)+' rdf:parseType="Collection">',u(o.object,e),"</"+h(o.predicate)+">"]);break;default:throw new Error("Can't serialize object of type "+o.object.termType+" into XML")}}return n}.bind(this),h=function(t){var n=t.uri,i=n.indexOf("#");if(i<0&&this.flags.indexOf("/")<0&&(i=n.lastIndexOf("/")),i<0)throw new Error("Cannot make qname out of <"+n+">");for(var r=i+1;r<n.length;r++)if(this._notNameChars.indexOf(n[r])>=0)throw new Error('Invalid character "'+n[r]+'" cannot be in XML qname for URI: '+n);var o=n.slice(i+1),s=n.slice(0,i+1);if(this.defaultNamespace&&this.defaultNamespace===s&&this.flags.indexOf("d")<0)return o;var a=this.prefixes[s];return a||(a=this.makeUpPrefix(s)),e[s]=!0,a+":"+o}.bind(this),d=o(t),f="<rdf:RDF";for(var p in this.defaultNamespace&&(f+=' xmlns="'+s(this.defaultNamespace)+'"'),e)if(e.hasOwnProperty(p)){var v=this.base&&this.flags.includes("z")?nh.refTo(this.base,p):p;f+="\n xmlns:"+this.prefixes[p]+'="'+s(v)+'"'}return function t(e,n){var o,s="",a=1e5;n||(n=0);for(var c=0;c<e.length;c++){var u=e[c];if("string"!=typeof u){var l=t(u,n+1);l.length<10*(80-4*n)&&l.indexOf('"""')<0&&(o=r(u)).length<80-4*n&&(u=" "+o,l=""),l&&(a=1e4),s+=l}"string"==typeof u&&(a<4*n+4?(s=s.slice(0,-1)+" "+u+"\n",a+=u.length+1):(s+=(o=i(4*n)+u)+"\n",a=o.length))}return s}([f+=">",d,"</rdf:RDF>"],-1)}}]),t}();function Ih(t,e,n,i,r,o){n=n||(null==t?void 0:t.value);var s,a,c,u,l,h=o||{};i=i||"text/turtle";try{var d=function(t){return new Rh(t)}(e);h.flags&&d.setFlags(h.flags);var f=e.statementsMatching(void 0,void 0,void 0,t);switch("namespaces"in e&&d.suggestNamespaces(e.namespaces),h.namespaces&&d.setNamespaces(h.namespaces),d.setBase(n),i){case"application/rdf+xml":return p(null,d.statementsToXML(f));case"text/n3":case"application/n3":return p(null,d.statementsToN3(f));case"text/turtle":case"application/x-turtle":return d.setFlags("si"),p(null,d.statementsToN3(f));case"application/n-triples":return d.setFlags("deinprstux"),p(null,d.statementsToNTriples(f));case"application/ld+json":d.setFlags("deinprstux"),s=d.statementsToNTriples(f),a=r,u=new Ul,l=new class{constructor(t,e){if(this._prefixRegex=/$0^/,t&&"function"!=typeof t.write&&(e=t,t=null),this._lists=(e=e||{}).lists,t)this._outputStream=t,this._endStream=void 0===e.end||!!e.end;else{let t="";this._outputStream={write(e,n,i){t+=e,i&&i()},end:e=>{e&&e(null,t)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(e.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=Jl,this._prefixIRIs=Object.create(null),e.prefixes&&this.addPrefixes(e.prefixes),e.baseIRI&&(this._baseMatcher=new RegExp(`^${Gl(e.baseIRI)}${e.baseIRI.endsWith("/")?"":"[#?]"}`),this._baseLength=e.baseIRI.length))}get _inDefaultGraph(){return Jl.equals(this._graph)}_write(t,e){this._outputStream.write(t,"utf8",e)}_writeQuad(t,e,n,i,r){try{i.equals(this._graph)||(this._write((null===this._subject?"":this._inDefaultGraph?".\n":"\n}\n")+(Jl.equals(i)?"":`${this._encodeIriOrBlank(i)} {\n`)),this._graph=i,this._subject=null),t.equals(this._subject)?e.equals(this._predicate)?this._write(`, ${this._encodeObject(n)}`,r):this._write(`;\n ${this._encodePredicate(this._predicate=e)} ${this._encodeObject(n)}`,r):this._write(`${(null===this._subject?"":".\n")+this._encodeSubject(this._subject=t)} ${this._encodePredicate(this._predicate=e)} ${this._encodeObject(n)}`,r)}catch(t){r&&r(t)}}_writeQuadLine(t,e,n,i,r){delete this._prefixMatch,this._write(this.quadToString(t,e,n,i),r)}quadToString(t,e,n,i){return`${this._encodeSubject(t)} ${this._encodeIriOrBlank(e)} ${this._encodeObject(n)}${i&&i.value?` ${this._encodeIriOrBlank(i)} .\n`:" .\n"}`}quadsToString(t){return t.map((t=>this.quadToString(t.subject,t.predicate,t.object,t.graph))).join("")}_encodeSubject(t){return"Quad"===t.termType?this._encodeQuad(t):this._encodeIriOrBlank(t)}_encodeIriOrBlank(t){if("NamedNode"!==t.termType)return this._lists&&t.value in this._lists&&(t=this.list(this._lists[t.value])),"id"in t?t.id:`_:${t.value}`;let e=t.value;this._baseMatcher&&this._baseMatcher.test(e)&&(e=e.substr(this._baseLength)),zl.test(e)&&(e=e.replace(Kl,Vl));const n=this._prefixRegex.exec(e);return n?n[1]?this._prefixIRIs[n[1]]+n[2]:e:`<${e}>`}_encodeLiteral(t){let e=t.value;if(zl.test(e)&&(e=e.replace(Kl,Vl)),t.language)return`"${e}"@${t.language}`;if(this._lineMode){if(t.datatype.value===Hl.string)return`"${e}"`}else switch(t.datatype.value){case Hl.string:return`"${e}"`;case Hl.boolean:if("true"===e||"false"===e)return e;break;case Hl.integer:if(/^[+-]?\d+$/.test(e))return e;break;case Hl.decimal:if(/^[+-]?\d*\.\d+$/.test(e))return e;break;case Hl.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(e))return e}return`"${e}"^^${this._encodeIriOrBlank(t.datatype)}`}_encodePredicate(t){return t.value===$l.type?"a":this._encodeIriOrBlank(t)}_encodeObject(t){switch(t.termType){case"Quad":return this._encodeQuad(t);case"Literal":return this._encodeLiteral(t);default:return this._encodeIriOrBlank(t)}}_encodeQuad({subject:t,predicate:e,object:n,graph:i}){return`<<${this._encodeSubject(t)} ${this._encodePredicate(e)} ${this._encodeObject(n)}${r=i,r&&"DefaultGraph"===r.termType?"":` ${this._encodeIriOrBlank(i)}`}>>`;var r}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(t,e,n,i,r){void 0===n?this._writeQuad(t.subject,t.predicate,t.object,t.graph,e):"function"==typeof i?this._writeQuad(t,e,n,Jl,i):this._writeQuad(t,e,n,i||Jl,r)}addQuads(t){for(let e=0;e<t.length;e++)this.addQuad(t[e])}addPrefix(t,e,n){const i={};i[t]=e,this.addPrefixes(i,n)}addPrefixes(t,e){if(!this._prefixIRIs)return e&&e();let n=!1;for(let e in t){let i=t[e];"string"!=typeof i&&(i=i.value),n=!0,null!==this._subject&&(this._write(this._inDefaultGraph?".\n":"\n}\n"),this._subject=null,this._graph=""),this._prefixIRIs[i]=e+=":",this._write(`@prefix ${e} <${i}>.\n`)}if(n){let t="",e="";for(const n in this._prefixIRIs)t+=t?`|${n}`:n,e+=(e?"|":"")+this._prefixIRIs[n];t=Gl(t),this._prefixRegex=new RegExp(`^(?:${e})[^/]*$|^(${t})([a-zA-Z][\\-_a-zA-Z0-9]*)$`)}this._write(n?"\n":"",e)}blank(t,e){let n,i,r=t;switch(void 0===t?r=[]:t.termType?r=[{predicate:t,object:e}]:"length"in t||(r=[t]),i=r.length){case 0:return new ql("[]");case 1:if(n=r[0],!(n.object instanceof ql))return new ql(`[ ${this._encodePredicate(n.predicate)} ${this._encodeObject(n.object)} ]`);default:let e="[";for(let o=0;o<i;o++)n=r[o],n.predicate.equals(t)?e+=`, ${this._encodeObject(n.object)}`:(e+=`${(o?";\n ":"\n ")+this._encodePredicate(n.predicate)} ${this._encodeObject(n.object)}`,t=n.predicate);return new ql(`${e}\n]`)}}list(t){const e=t&&t.length||0,n=new Array(e);for(let i=0;i<e;i++)n[i]=this._encodeObject(t[i]);return new ql(`(${n.join(" ")})`)}end(t){null!==this._subject&&(this._write(this._inDefaultGraph?".\n":"\n}\n"),this._subject=null),this._write=this._blockedWrite;let e=t&&((n,i)=>{e=null,t(n,i)});if(this._endStream)try{return this._outputStream.end(e)}catch(t){}e&&e()}}({format:"N-Quads"}),fl.waterfall([function(t){u.parse(s,(function(e,n){e?t(e):null!==n?l.addQuad(n):l.end(t)}))},function(t,e){try{pl.default.fromRDF(t,{format:"application/nquads"}).then((function(t){e(null,t)}))}catch(t){e(t)}},function(t){c=JSON.stringify(t),a(null,c)}],(function(t){a(t,c)}));break;case"application/n-quads":case"application/nquads":return d.setFlags("deinprstux q"),p(null,d.statementsToNTriples(f));default:throw new Error("Serialize: Content-type "+i+" not supported for data write.")}}catch(t){if(r)return r(t,void 0);throw t}function p(t,e){return r?void r(t,e):e}}var Th=["blankNode","defaultGraph","literal","namedNode","quad","variable","supports"],Oh="http://www.w3.org/1999/02/22-rdf-syntax-ns#rest";function Nh(t,e,n){var i=[];return n.reduce((function(e,n,r,o){var s;return i.push(t.quad(e,t.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#first"),o[r])),r<o.length-1?(s=t.blankNode(),i.push(t.quad(e,t.namedNode(Oh),s))):i.push(t.quad(e,t.namedNode(Oh),t.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"))),s}),e),i}function Ph(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=t.length;for(n<0&&(n=i+n);n<i;n++)if(t[n]===e)return n;return-1}function Dh(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Mh(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Mh(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}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,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function Mh(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var Uh=function(){Qa(i,oc);var t,e,n=(t=i,e=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(t){return!1}}(),function(){var n,i=nc(t);if(e){var r=nc(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ec(this,n)});function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};Xa(this,i),(t=n.call(this,"")).statements=e,t.constraints=r,t.initBindings=o,t.optional=s,ic(Ya(t),"termType","Graph"),ic(Ya(t),"classOrder",rc.Graph),ic(Ya(t),"fetcher",void 0),ic(Ya(t),"isVar",0),ic(Ya(t),"ns",yh),ic(Ya(t),"rdfFactory",void 0),t.rdfFactory=a&&a.rdfFactory||vh;var c,u=Dh(Th);try{var l=function(){var e=c.value;t[e]=function(){var n;return(n=t.rdfFactory)[e].apply(n,arguments)}};for(u.s();!(c=u.n()).done;)l()}catch(t){u.e(t)}finally{u.f()}return t}return Ga(i,[{key:"add",value:function(t,e,n,i){var r=this;return 1===arguments.length&&t.forEach((function(t){return r.add(t.subject,t.predicate,t.object,t.graph)})),this.statements.push(this.rdfFactory.quad(t,e,n,i))}},{key:"addStatement",value:function(t){return this.add(t)}},{key:"bnode",value:function(t){return this.rdfFactory.blankNode(t)}},{key:"addAll",value:function(t){var e=this;t.forEach((function(t){e.add(t.subject,t.predicate,t.object,t.graph)}))}},{key:"any",value:function(t,e,n,i){var r=this.anyStatementMatching(t,e,n,i);return null==r?null:null==t?r.subject:null==e?r.predicate:null==n?r.object:null}},{key:"anyValue",value:function(t,e,n,i){var r=this.any(t,e,n,i);return r?r.value:void 0}},{key:"anyJS",value:function(t,e,n,i){var r=this.any(t,e,n,i);return r?oc.toJS(r):void 0}},{key:"anyStatementMatching",value:function(t,e,n,i){var r=this.statementsMatching(t,e,n,i,!0);if(r&&0!==r.length)return r[0]}},{key:"id",value:function(t){return this.rdfFactory.id(t)}},{key:"statementsMatching",value:function(t,e,n,i,r){var o=this.statements.filter((function(r){return(!t||t.equals(r.subject))&&(!e||e.equals(r.predicate))&&(!n||n.equals(r.object))&&(!i||i.equals(r.graph))}));return r?0===o.length?[]:[o[0]]:o}},{key:"bottomTypeURIs",value:function(t){var e,n,i,r,o,s;for(var a in e=[],t)if(t.hasOwnProperty(a)){for(s=t[a],n=!0,i=0,r=(o=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),this.rdfFactory.namedNode(a))).length;i<r;i++)if(o[i].uri in t){n=!1;break}n&&(e[a]=s)}return e}},{key:"collection",value:function(){return new Ec}},{key:"each",value:function(t,e,n,i){var r=[],o=this.statementsMatching(t,e,n,i,!1);if(null==t)for(var s=0,a=o.length;s<a;s++)r.push(o[s].subject);else if(null==e)for(var c=0,u=o.length;c<u;c++)r.push(o[c].predicate);else if(null==n)for(var l=0,h=o.length;l<h;l++)r.push(o[l].object);else if(null==i)for(var d=0,f=o.length;d<f;d++)r.push(new bc(o[d].graph.value));return r}},{key:"equals",value:function(t){return!!t&&this.hashString()===t.hashString()}},{key:"findMembersNT",value:function(t){var e,n,i,r,o,s,a,c,u,l,h,d,f;for(var p in(h={})[t.toNT()]=!0,r={},o=this.transitiveClosure(h,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!0))if(o.hasOwnProperty(p)){for(var v=0,g=(s=this.statementsMatching(void 0,this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),this.fromNT(p))).length;v<g;v++)r[(d=s[v]).subject.toNT()]=d;for(var m=0,w=(a=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#domain"),this.fromNT(p))).length;m<w;m++)for(i=0,e=(c=this.statementsMatching(void 0,a[m])).length;i<e;i++)r[(d=c[i]).subject.toNT()]=d;for(var b=0,y=(u=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#range"),this.fromNT(p))).length;b<y;b++)for(f=0,n=(l=this.statementsMatching(void 0,u[b])).length;f<n;f++)r[(d=l[f]).object.toNT()]=d}return r}},{key:"findMemberURIs",value:function(t){return this.NTtoURI(this.findMembersNT(t))}},{key:"findSubClassesNT",value:function(t){var e={};return e[t.toNT()]=!0,this.transitiveClosure(e,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!0)}},{key:"findSuperClassesNT",value:function(t){var e={};return e[t.toNT()]=!0,this.transitiveClosure(e,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!1)}},{key:"findTypesNT",value:function(t){var e,n,i,r,o,s;s=[];for(var a=0,c=(e=this.statementsMatching(t,void 0,void 0)).length;a<c;a++)if("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"===(o=e[a]).predicate.uri)s[o.object.toNT()]=o;else for(var u=0,l=(n=this.each(o.predicate,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#domain"))).length;u<l;u++)s[n[u].toNT()]=o;for(var h=0,d=(i=this.statementsMatching(void 0,void 0,t)).length;h<d;h++)for(var f=0,p=(r=this.each((o=i[h]).predicate,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#range"))).length;f<p;f++)s[r[f].toNT()]=o;return this.transitiveClosure(s,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!1)}},{key:"findTypeURIs",value:function(t){return this.NTtoURI(this.findTypesNT(t))}},{key:"connectedStatements",value:function(t,e,n){n=n||[];for(var i=[t],r={},o={},s=[],a=this,c=function(t){var c=function(t){"BlankNode"!==t.termType||r[t.value]||(r[t.value]=!0,i.push(t))},u=a.statementsMatching(null,null,t,e).concat(a.statementsMatching(t,null,null,e));(u=u.filter((function(t){if(n[t.predicate.value])return!1;var e=t.toNT();return!o[e]&&(o[e]=!0,!0)}))).forEach((function(t){c(t.subject),c(t.object)})),s=s.concat(u)};i.length;)c(i.shift());return s}},{key:"formula",value:function(){return new i}},{key:"fromNT",value:function(t){var e,n,i;switch(t[0]){case"<":return this.sym(t.slice(1,-1));case'"':if(i=void 0,e=void 0,(n=t.lastIndexOf('"'))<t.length-1)if("@"===t[n+1])i=t.slice(n+2);else{if("^^"!==t.slice(n+1,n+3))throw new Error("Can't convert string from NT: "+t);e=this.fromNT(t.slice(n+3))}return t=(t=(t=(t=t.slice(1,n)).replace(/\\"/g,'"')).replace(/\\n/g,"\n")).replace(/\\\\/g,"\\"),this.rdfFactory.literal(t,i||e);case"_":return this.rdfFactory.blankNode(t.slice(2));case"?":return new fh(t.slice(1))}throw new Error("Can't convert from NT: "+t)}},{key:"holds",value:function(t,e,n,i){var r;if(1===arguments.length){if(!t)return!0;if(t instanceof Array){for(r=0;r<t.length;r++)if(!this.holds(t[r]))return!1;return!0}if(cc(t))return this.holds(t.subject,t.predicate,t.object,t.graph);if(t.statements)return this.holds(t.statements)}var o=this.anyStatementMatching(t,e,n,i);return null!=o}},{key:"holdsStatement",value:function(t){return this.holds(t.subject,t.predicate,t.object,t.graph)}},{key:"list",value:function(t,e){if(e.rdfFactory.supports.COLLECTIONS){var n=e.rdfFactory.collection();return t.forEach((function(t){n.append(t)})),n}var i=e.rdfFactory.blankNode(),r=Nh(e.rdfFactory,i,t);return e.addAll(r),i}},{key:"NTtoURI",value:function(t){var e,n,i={};for(e in t)t.hasOwnProperty(e)&&(n=t[e],"<"===e[0]&&(i[e.slice(1,-1)]=n));return i}},{key:"serialize",value:function(t,e,n,i){return Ih(n,this,t,e,void 0,i)}},{key:"substitute",value:function(t){var e=this.statements.map((function(e){return e.substitute(t)}));console.log("Formula subs statmnts:"+e);var n=new i;return n.addAll(e),console.log("indexed-form subs formula:"+n),n}},{key:"sym",value:function(t,e){if(e)throw new Error("This feature (kb.sym with 2 args) is removed. Do not assume prefix mappings.");return this.rdfFactory.namedNode(t)}},{key:"the",value:function(t,e,n,i){var r=this.any(t,e,n,i);return null==r&&bh("No value found for the() {"+t+" "+e+" "+n+"}."),r}},{key:"transitiveClosure",value:function(t,e,n){var i,r,o,s,a,c={};Object.assign(c,t);for(var u={};;){if(null==(a=function(){for(var t in c)if(c.hasOwnProperty(t))return t}()))return u;for(i=0,r=(s=n?this.each(void 0,e,this.fromNT(a)):this.each(this.fromNT(a),e)).length;i<r;i++)(o=s[i].toNT())in u||o in c||(c[o]=c[a]);u[a]=c[a],delete c[a]}}},{key:"topTypeURIs",value:function(t){var e,n,i,r,o,s,a;for(n in s=[],t)if(t.hasOwnProperty(n)){for(a=t[n],r=0,e=0,i=(o=this.each(this.rdfFactory.namedNode(n),this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"))).length;e<i;e++)if("http://www.w3.org/2000/01/rdf-schema#Resource"!==o[e].uri){r++;break}r||(s[n]=a)}return s["http://www.w3.org/2000/01/rdf-schema#Resource"]&&delete s["http://www.w3.org/2000/01/rdf-schema#Resource"],s["http://www.w3.org/2002/07/owl#Thing"]&&delete s["http://www.w3.org/2002/07/owl#Thing"],s}},{key:"toString",value:function(){return"{"+this.statements.join("\n")+"}"}},{key:"variable",value:function(t){return new fh(t)}},{key:"whether",value:function(t,e,n,i){return this.statementsMatching(t,e,n,i,!1).length}}]),i}();oc.fromValue=kc;var Lh=oc,Bh={xsd:yh("http://www.w3.org/2001/XMLSchema#")};oc.toJS=function(t){return lc(t)?t.elements.map(oc.toJS):fc(t)?t.datatype.equals(Bh.xsd("boolean"))?"1"===t.value||"true"===t.value:t.datatype.equals(Bh.xsd("dateTime"))||t.datatype.equals(Bh.xsd("date"))?new Date(t.value):t.datatype.equals(Bh.xsd("integer"))||t.datatype.equals(Bh.xsd("float"))||t.datatype.equals(Bh.xsd("decimal"))?Number(t.value):t.value:t};var Jh=Ga((function t(e,n){Xa(this,t),this.pat=new Yh,this.vars=[],this.name=e,this.id=n}));function $h(t,e,n,i){function r(t){var e,n="";for(e in t)t.hasOwnProperty(e)&&(n+=" "+e+" -> "+t[e]);return n}function o(t){var e,n="Bindings: ",i=t.length;for(e=0;e<i;e++)n+=r(t[e][0])+";\n\t";return n}function s(t,e,n,i){var r;if(t.length!==e.length)return[];if(!t.length)return[[[],null]];var o=function(t,e,n,i){var r=n[t];if(void 0===r){if(t.isVar){var o=[];return o[t]=e,[[o,null]]}r=t}if(!r.complexType)return i.redirections[r]&&(r=i.redirections[r]),i.redirections[e]&&(e=i.redirections[e]),r.equals(e)||r.uri&&"chrome:theSession"===r.uri?[[[],null]]:[];if(t instanceof Array)return e instanceof Array?s(t,e,n):[];throw new Error("query.js: oops - code not written yet")}(t[0],e[0],n,i);if(0===o.length)return o;var a,c,u,l,h,d,f,p=[],v=o.length;for(a=0;a<v;a++){for(h in f=[],c=o[a][0])c.hasOwnProperty(h)&&(f[h]=c[h]);for(h in n)n.hasOwnProperty(h)&&(f[h]=n[h]);for(l=(r=s(t.slice(1),e.slice(1),f,i)).length,u=0;u<l;u++){for(h in d=r[u][0],c)c.hasOwnProperty(h)&&(d[h]=c[h]);p.push([d,null])}}return p}function a(t,e){var n,i={};for(n in t)t.hasOwnProperty(n)&&(i[n]=t[n]);for(n in e)e.hasOwnProperty(n)&&(i[n]=e[n]);return i}function c(t,e){return this.trunkBindings=e,this.originalCallback=t,this.branches=[],this}function u(t,e){return this.count=0,this.success=!1,this.done=!1,this.callback=t,this.onDone=e,this}c.prototype.checkAllDone=function(){var t;for(t=0;t<this.branches.length;t++)if(!this.branches[t].done)return;gh("OPTIONAL BIDNINGS ALL DONE:"),this.doCallBacks(this.branches.length-1,this.trunkBindings)},c.prototype.doCallBacks=function(t,e){var n;if(t<0)return this.originalCallback(e);for(n=0;n<this.branches[t].results.length;n++)this.doCallBacks(t-1,a(e,this.branches[t].results[n]))},u.prototype.reportMatch=function(t){this.callback(t),this.success=!0},u.prototype.reportDone=function(){this.done=!0,wh("Mandatory query branch finished.***"),void 0!==this.onDone&&this.onDone()};var l=function(t){return this.count=0,this.done=!1,this.results=[],this.junction=t,t.branches.push(this),this};function h(t,e,n){var i,r,o,s,a,c;for(e.nvars=0,e.index=null,i=[e.subject,e.predicate,e.object,e.why],s=[t.subjectIndex,t.predicateIndex,t.objectIndex,t.whyIndex],o=0;o<4;o++){var u=i[o];if(u.uri&&"chrome:theSession"===u.uri);else if(u.isVar&&void 0===n[u])e.nvars++;else{if(void 0,t.redirections[t.id(u=void 0===(c=n[a=i[o]])?a:c)]&&(u=t.redirections[t.id(u)]),!(r=s[o][t.id(u)]))return e.index=[],!1;(null===e.index||e.index.length>r.length)&&(e.index=r)}}return null===e.index&&(e.index=t.statements),!0}function d(t,e){return t.nvars!==e.nvars?t.nvars-e.nvars:t.index.length-e.index.length}l.prototype.reportMatch=function(t){this.results.push(t)},l.prototype.reportDone=function(){gh("Optional branch finished - results.length = "+this.results.length),0===this.results.length&&(this.results.push({}),gh("Optional branch FAILED - that's OK.")),this.done=!0,this.junction.checkAllDone()};var f=function t(n,i,o,s,a,u,h){gh("Match begins, Branch count now: "+h.count+" for "+h.pattern_debug);var d,f,p=i.statements;if(0===p.length){if(gh("FOUND MATCH WITH BINDINGS:"+r(o)),0===i.optional.length)h.reportMatch(o);else{gh("OPTIONAL: "+i.optional);var g,m=new c(e,o),w=[];for(g=0;g<i.optional.length;g++)w[g]=new l(m),w[g].pattern_debug=i.optional[g];for(g=0;g<i.optional.length;g++)w[g].count=w[g].count+1,t(n,i.optional[g],o,"",a,e,w[g])}return h.count--,void gh("Match ends -- success , Branch count now: "+h.count+" for "+h.pattern_debug)}var b=p.length;if(a){var y=function(e){var r=e.uri.split("#")[0];a.nowOrWhenFetched(r,void 0,(function(r,c){r||console.log("Error following link to <"+e.uri+"> in query: "+c),t(n,i,o,s,a,u,h)}))};for(f=0;f<b;f++){if(void 0!==o[(d=p[f]).subject]&&o[d.subject].uri&&a&&"unrequested"===a.getState(rh(o[d.subject].uri)))return void y(o[d.subject]);if(void 0!==o[d.object]&&o[d.object].uri&&a&&"unrequested"===a.getState(rh(o[d.object].uri)))return void y(o[d.object])}}v(n,i,o,s,a,u,h)},p=function(t,e){var n,i,r=!0;for(n in t)t.hasOwnProperty(n)&&e[n]&&(i=e[n].test)&&!i(t[n])&&(r=!1);return r},v=function(t,e,n,i,a,c,u){var l,v,g,m,w,b,y,x=e.statements,k=x.length;for(l=0;l<k;l++)h(t,y=x[l],n);x.sort(d),y=x[0];var E,S=t.formula();S.optional=e.optional,S.constraints=e.constraints,S.statements=x.slice(1),gh(i+"match2 searching "+y.index.length+" for "+y+"; bindings so far="+r(n));var F,A,_=y.index.length,j=0;for(E=0;E<_;E++)for(F=s([y.subject,y.predicate,y.object,y.why],[(A=y.index[E]).subject,A.predicate,A.object,A.why],n,t),wh(i+" From first: "+F.length+": "+o(F)),g=F.length,v=0;v<g;v++)if(w=[],p(b=F[v][0],e.constraints)){for(m in b)b.hasOwnProperty(m)&&(w[m]=b[m]);for(m in n)n.hasOwnProperty(m)&&(w[m]=n[m]);u.count++,j++,f(t,S,w,i+" ",a,c,u)}else gh("Branch count CS: "+u.count);u.count--,0===j&&gh("Match2 fails completely on "+y),gh("Match2 ends, Branch count: "+u.count+" for "+u.pattern_debug),0===u.count&&(gh("Branch finished."),u.reportDone())},g=this;gh("Query on "+this.statements.length);var m=new u(e,i);m.count++,t.sync?f(g,t.pat,t.pat.initBindings,"",n,e,m):setTimeout((function(){f(g,t.pat,t.pat.initBindings,"",n,e,m)}),0)}function Hh(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function zh(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Hh(Object(n),!0).forEach((function(e){ic(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Hh(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Kh(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Wh(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wh(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}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,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function Wh(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var qh="http://www.w3.org/2002/07/owl#";function Vh(t,e,n,i){var r=t.any(e,n,void 0);return!!r&&(t.equate(r,i),!0)}function Gh(t,e,n,i){var r=t.any(void 0,n,i);return!!r&&(t.equate(r,e),!0)}function Xh(t,e,n,i,r){t.typeCallback&&t.typeCallback(t,i,r);var o=t.classActions[t.id(i)],s=!1;if(o)for(var a=0;a<o.length;a++)s=s||o[a](t,e,n,i,r);return s}var Yh=function(){Qa(i,Uh);var t,e,n=(t=i,e=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(t){return!1}}(),function(){var n,i=nc(t);if(e){var r=nc(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ec(this,n)});function i(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Xa(this,i),ic(Ya(e=n.call(this,void 0,void 0,void 0,void 0,r)),"updater",void 0),ic(Ya(e),"namespaces",void 0),ic(Ya(e),"classActions",void 0),ic(Ya(e),"propertyActions",void 0),ic(Ya(e),"redirections",void 0),ic(Ya(e),"aliases",void 0),ic(Ya(e),"HTTPRedirects",void 0),ic(Ya(e),"subjectIndex",void 0),ic(Ya(e),"predicateIndex",void 0),ic(Ya(e),"objectIndex",void 0),ic(Ya(e),"whyIndex",void 0),ic(Ya(e),"index",void 0),ic(Ya(e),"features",void 0),ic(Ya(e),"_universalVariables",void 0),ic(Ya(e),"_existentialVariables",void 0),ic(Ya(e),"rdfArrayRemove",void 0),ic(Ya(e),"dataCallbacks",void 0),e.propertyActions={},e.classActions={},e.redirections=[],e.aliases=[],e.HTTPRedirects=[],e.subjectIndex=[],e.predicateIndex=[],e.objectIndex=[],e.whyIndex=[],e.index=[e.subjectIndex,e.predicateIndex,e.objectIndex,e.whyIndex],e.namespaces={},e.features=t||[],e.rdfArrayRemove=r.rdfArrayRemove||_h,r.dataCallback&&(e.dataCallbacks=[r.dataCallback]),e.initPropertyActions(e.features),e}return Ga(i,[{key:"substitute",value:function(t){var e=this.statements.map((function(e){return e.substitute(t)})),n=new i;return n.add(e),n}},{key:"addDataCallback",value:function(t){this.dataCallbacks||(this.dataCallbacks=[]),this.dataCallbacks.push(t)}},{key:"applyPatch",value:function(t,e,n){var i,r=this,o=null;function s(s){if(t.delete){i=t.delete,o&&(i=i.substitute(o));var a=[],c=(i=i.statements).map((function(t){var n=r.statementsMatching(t.subject,t.predicate,t.object,e);return 0===n.length?(a.push(t),null):n[0]}));if(a.length)return n("Could not find to delete: "+a.join("\n or "));c.map((function(t){r.remove(t)}))}t.insert&&(i=t.insert,o&&(i=i.substitute(o)),(i=i.statements).map((function(t){t.graph=e,r.add(t.subject,t.predicate,t.object,t.graph)}))),s()}if(t.where){var a=new Jh("patch");a.pat=t.where,a.pat.statements.map((function(t){t.graph=nf(e.value)})),a.sync=!0;var c=[];r.query(a,(function(t){c.push(t)}),r.fetcher,(function(){return 0===c.length?n("No match found to be patched:"+t.where):c.length>1?n("Patch ambiguous. No patch done."):(o=c[0],void s(n))}))}else s(n)}},{key:"declareExistential",value:function(t){return this._existentialVariables||(this._existentialVariables=[]),this._existentialVariables.push(t),t}},{key:"initPropertyActions",value:function(t){this.propertyActions[this.rdfFactory.id(this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"))]=[Xh],Ph(t,"sameAs")>=0&&(this.propertyActions[this.rdfFactory.id(this.rdfFactory.namedNode("".concat(qh,"sameAs")))]=[function(t,e,n,i){return t.equate(e,i),!0}]),Ph(t,"InverseFunctionalProperty")>=0&&(this.classActions[this.rdfFactory.id(this.rdfFactory.namedNode("".concat(qh,"InverseFunctionalProperty")))]=[function(t,e){return t.newPropertyAction(e,Gh)}]),Ph(t,"FunctionalProperty")>=0&&(this.classActions[this.rdfFactory.id(this.rdfFactory.namedNode("".concat(qh,"FunctionalProperty")))]=[function(t,e){return t.newPropertyAction(e,Vh)}])}},{key:"addStatement",value:function(t){return this.add(t.subject,t.predicate,t.object,t.graph),this.statements.length}},{key:"add",value:function(t,e,n,i){var r,o,s;if(1===arguments.length){if(t instanceof Array)for(r=0;r<t.length;r++)this.add(t[r]);else pc(t)?this.add(t.subject,t.predicate,t.object,t.graph):uc(t)&&this.add(t.statements);return this}i||(i=this.fetcher?this.fetcher.appNode:this.rdfFactory.defaultGraph()),"string"==typeof t&&(t=this.rdfFactory.namedNode(t)),e=Lh.fromValue(e);var a=Lh.fromValue(n);if(i=Lh.fromValue(i),!gc(t))throw new Error("Subject is not a subject type");if(!mc(e))throw new Error("Predicate ".concat(e," is not a predicate type"));if(!hc(a))throw new Error("Object ".concat(a," is not an object type"));if(!wc(i))throw new Error("Why is not a graph type");this.predicateCallback&&this.predicateCallback(this,e,i);var c=this.id(this.canon(e)),u=!1;if(o=this.propertyActions[c])for(r=0;r<o.length;r++)u=u||o[r](this,t,e,a,i);if(this.holds(t,e,a,i))return null;var l=[this.id(this.canon(t)),c,this.id(this.canon(a)),this.id(this.canon(i))];for(s=this.rdfFactory.quad(t,e,a,i),r=0;r<4;r++){var h=this.index[r],d=l[r];h[d]||(h[d]=[]),h[d].push(s)}if(this.statements.push(s),this.dataCallbacks){var f,p=Kh(this.dataCallbacks);try{for(p.s();!(f=p.n()).done;){var v=f.value;v(s)}}catch(t){p.e(t)}finally{p.f()}}return s}},{key:"canon",value:function(t){if(!t)return t;var e=this.redirections[this.id(t)];if(e)return e;switch(t.termType){case"BlankNode":return new sc(t.value);case"Collection":return t;case"DefaultGraph":return new Zl;case"Empty":case"Graph":return t;case"Literal":return new xc(t.value,t.language,t.datatype);case"NamedNode":return new bc(t.value);case"Variable":return new fh(t.value);default:throw new Error("Term Type not recognized for canonization: ".concat(t.termType))}}},{key:"check",value:function(){this.checkStatementList(this.statements);for(var t=0;t<4;t++){var e=this.index[t];for(var n in e)e.hasOwnProperty(n)&&this.checkStatementList(e[n],t)}}},{key:"checkStatementList",value:function(t,e){void 0===e&&(e=0);for(var n,i=" found in "+["subject","predicate","object","why"][e]+" index.",r=0;r<t.length;r++){for(var o=[(n=t[r]).subject,n.predicate,n.object,n.graph],s=function(t,e){for(var n=0;n<t.length;n++)if(t[n].subject.equals(e.subject)&&t[n].predicate.equals(e.predicate)&&t[n].object.equals(e.object)&&t[n].why.equals(e.graph))return!0},a=0;a<4;a++){var c=this.canon(o[a]),u=this.id(c);this.index[a][u]&&s(this.index[a][u],n)}if(!s(this.statements,n))throw new Error("Statement list does not statement "+n+"@"+n.graph+i)}}},{key:"close",value:function(){return this}},{key:"compareTerms",value:function(t,e){return Object.prototype.hasOwnProperty.call(t,"compareTerm")?t.compareTerm(e):rc[t.termType]<rc[e.termType]?-1:rc[t.termType]>rc[e.termType]?1:t.value<e.value?-1:t.value>e.value?1:0}},{key:"copyTo",value:function(t,e,n){n||(n=[]);var i=this.statementsMatching(t);-1!==Ph(n,"two-direction")&&i.concat(this.statementsMatching(void 0,void 0,t));for(var r=0;r<i.length;r++){var o=i[r];switch(o.object.termType){case"NamedNode":this.add(e,o.predicate,o.object);break;case"Literal":case"BlankNode":case"Collection":this.add(e,o.predicate,o.object.copy(this))}-1!==Ph(n,"delete")&&this.remove(o)}}},{key:"equate",value:function(t,e){var n=this.canon(t),i=this.canon(e),r=this.compareTerms(n,i);return!r||(r<0?this.replaceWith(i,n):this.replaceWith(n,i))}},{key:"formula",value:function(t){return new i(t)}},{key:"length",get:function(){return this.statements.length}},{key:"match",value:function(t,e,n,i){return this.statementsMatching(Lh.fromValue(t),Lh.fromValue(e),Lh.fromValue(n),Lh.fromValue(i))}},{key:"mentionsURI",value:function(t){var e="<"+t+">";return!!this.subjectIndex[e]||!!this.objectIndex[e]||!!this.predicateIndex[e]}},{key:"newExistential",value:function(t){if(!t)return this.bnode();var e=this.sym(t);return this.declareExistential(e)}},{key:"newPropertyAction",value:function(t,e){var n=this.id(t);this.propertyActions[n]||(this.propertyActions[n]=[]),this.propertyActions[n].push(e);for(var i=this.statementsMatching(void 0,t,void 0),r=!1,o=0;o<i.length;o++)r=r||e(this,i[o].subject,t,i[o].object);return r}},{key:"newUniversal",value:function(t){var e=this.sym(t);return this._universalVariables||(this._universalVariables=[]),this._universalVariables.push(e),e}},{key:"variable",value:function(t){return new fh(t)}},{key:"nextSymbol",value:function(t){for(var e=0;;e++){var n=t.value+"#n"+e;if(!this.mentionsURI(n))return this.sym(n)}}},{key:"query",value:function(t,e,n,i){return $h.call(this,t,e,n,i)}},{key:"querySync",value:function(t){var e=[],n=!1;if(t.sync=!0,$h.call(this,t,(function(t){e.push(t)}),null,(function(){n=!0})),!n)throw new Error("Sync query should have called done function");return e}},{key:"remove",value:function(t){if(t instanceof Array){for(var e=0;e<t.length;e++)this.remove(t[e]);return this}if(uc(t))return this.remove(t.statements);var n=this.statementsMatching(t.subject,t.predicate,t.object,t.graph);if(!n.length)throw new Error("Statement to be removed is not on store: "+t);return this.removeStatement(n[0]),this}},{key:"removeDocument",value:function(t){for(var e=this.statementsMatching(void 0,void 0,void 0,t).slice(),n=0;n<e.length;n++)this.removeStatement(e[n]);return this}},{key:"removeMany",value:function(t,e,n,i,r){for(var o=this.statementsMatching(t,e,n,i,!1),s=[],a=0;a<o.length;a++)s.push(o[a]);for(r&&(s=s.slice(0,r)),a=0;a<s.length;a++)this.remove(s[a])}},{key:"removeMatches",value:function(t,e,n,i){return this.removeStatements(this.statementsMatching(t,e,n,i)),this}},{key:"removeStatement",value:function(t){for(var e=[t.subject,t.predicate,t.object,t.graph],n=0;n<4;n++){var i=this.canon(e[n]),r=this.id(i);this.index[n][r]&&this.rdfArrayRemove(this.index[n][r],t)}return this.rdfArrayRemove(this.statements,t),this}},{key:"removeStatements",value:function(t){for(var e=0;e<t.length;e++)this.remove(t[e]);return this}},{key:"replaceWith",value:function(t,e){for(var n=this.id(t),i=this.id(e),r=function(t){var e=t[n];if(e){var r=t[i];t[i]=r?e.concat(r):e,delete t[n]}},o=0;o<4;o++)r(this.index[o]);if(this.redirections[n]=e,t.value){if(this.aliases[i]||(this.aliases[i]=[]),this.aliases[i].push(t),this.aliases[n])for(o=0;o<this.aliases[n].length;o++)this.redirections[this.id(this.aliases[n][o])]=e,this.aliases[i].push(this.aliases[n][o]);this.add(e,this.sym("http://www.w3.org/2007/ont/link#uri"),t),this.fetcher&&this.fetcher.nowKnownAs(t,e)}return r(this.classActions),r(this.propertyActions),!0}},{key:"allAliases",value:function(t){var e=this.aliases[this.id(this.canon(t))]||[];return e.push(this.canon(t)),e}},{key:"sameThings",value:function(t,e){if(t.equals(e))return!0;var n=this.canon(t);if(!n)return!1;var i=this.canon(e);return!!i&&n.value===i.value}},{key:"setPrefixForURI",value:function(t,e){if(("tab"!==t||!this.namespaces.tab)&&"ns"!==t.slice(0,2)&&"default"!==t.slice(0,7)){for(var n in this.namespaces)this.namespaces[n]==e&&delete this.namespaces[n];this.namespaces[t]=e}}},{key:"statementsMatching",value:function(t,e,n,i,r){var o,s,a=[t,e,n,i],c=[],u=[],l=[];for(o=0;o<4;o++)c[o]=this.canon(Lh.fromValue(a[o])),c[o]&&(l.push(o),u[o]=this.id(c[o]));if(0===l.length)return this.statements;if(1===l.length)return(s=this.index[o=l[0]][u[o]])&&r&&s.length>1&&(s=s.slice(0,1)),s||[];var h,d,f=1e10;for(d=0;d<l.length;d++){if(!(s=this.index[o=l[d]][u[o]]))return[];s.length<f&&(f=s.length,h=d)}for(var p=l[h],v=this.index[p][u[p]],g=l.slice(0,h).concat(l.slice(h+1)),m=[],w=["subject","predicate","object","why"],b=0;b<v.length;b++){var y=v[b];for(d=0;d<g.length;d++)if(!this.canon(y[w[o=g[d]]]).equals(c[o])){y=null;break}if(null!=y&&(m.push(y),r))break}return m}},{key:"uris",value:function(t){var e=this.canon(t),n=this.aliases[this.id(e)];if(!e.value)return[];var i=[e.value];if(n)for(var r=0;r<n.length;r++)i.push(n[r].uri);return i}},{key:"serialize",value:function(t,e,n,i){var r,o=null!==(r=i)&&void 0!==r&&r.namespaces?zh(zh({},this.namespaces),i.namespaces):zh({},this.namespaces);return Ih(n,this,t,e,void 0,i=zh(zh({},i||{}),{},{namespaces:o}))}}],[{key:"defaultGraphURI",get:function(){return"chrome:theSession"}}]),i}();ic(Yh,"handleRDFType",void 0),Yh.handleRDFType=Xh;var Zh="http://www.w3.org/2000/10/swap/log#",Qh=function(t){return t},td=function(t){return t},ed=function(t){if(t.length>0)throw"missing.js: oops nnonempty dict not imp";return[]},nd=function(t){return t.length},id=function(t,e,n){if(void 0===t.slice)throw"@@ mising.js: No .slice function for "+t+" of type "+tc(t);return void 0===n||null==n?t.slice(e):t.slice(e,n)},rd=Error("dummy error stop iteration"),od=function(t){return this.last=0,this.li=t,this.next=function(){if(this.last==this.li.length)throw rd;return this.li[this.last++]},this},sd=function(t,e){return t.indexOf(e)},ad=function(t,e){if(!t){if(e)throw"python Assertion failed: "+e;throw"(python) Assertion failed."}};String.prototype.encode=function(t){if("utf-8"!=t)throw"UTF8_converter: can only do utf-8";return function(t){t=t.replace(/\r\n/g,"\n");for(var e="",n=0;n<t.length;n++){var i=t.charCodeAt(n);i<128?e+=String.fromCharCode(i):i>127&&i<2048?(e+=String.fromCharCode(i>>6|192),e+=String.fromCharCode(63&i|128)):(e+=String.fromCharCode(i>>12|224),e+=String.fromCharCode(i>>6&63|128),e+=String.fromCharCode(63&i|128))}return e}(this)},String.prototype.decode=function(t){if("utf-8"!=t)throw"UTF8_converter: can only do utf-8";return this};var cd,ud=function(t,e){return ah(e,t)},ld="\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~:",hd=new RegExp("^([-+]?[0-9]+)(\\.[0-9]+)?(e[-+]?[0-9]+)?","g"),dd=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?"),fd=new RegExp('[\\\\\\r\\n\\"]',"g"),pd=new RegExp("^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*","g"),vd=function(t,e,n,i,r,o,s,a){return new gd(t,e,n,i,r,o,s,a)},gd=function(){function t(e,n,i,r,o,s,a,c){Xa(this,t),void 0===n&&(n=null),void 0===i&&(i=""),void 0===r&&(r=null),void 0===o&&(o=""),void 0===a&&(a=""),void 0===c&&(c=null),this._bindings=new ed([]),this._flags=a,""!=i&&(ad(i.indexOf(":")>=0,"Document URI not absolute: "+i),this._bindings[""]=i+"#"),this._store=e,o&&e.setGenPrefix(o),this._thisDoc=i,this.source=e.sym(i),this.lines=0,this.statementCount=0,this.startOfLine=0,this.previousLine=0,this._genPrefix=o,this.keywords=new td(["a","this","bind","has","is","of","true","false"]),this.keywordsSet=0,this._anonymousNodes=new ed([]),this._variables=new ed([]),this._parentVariables=new ed([]),this._reason=c,this._reason2=null,this._baseURI=r||i||null,ad(!this._baseURI||this._baseURI.indexOf(":")>=0),this._genPrefix||(this._genPrefix=this._thisDoc?this._thisDoc+"#_g":RDFSink_uniqueURI()),this._formula=null==n?this._thisDoc?e.formula(i+"#_formula"):e.formula():n,this._context=this._formula,this._parentContext=null}return Ga(t,[{key:"here",value:function(t){return this._genPrefix+"_L"+this.lines+"C"+(t-this.startOfLine+1)}},{key:"formula",value:function(){return this._formula}},{key:"loadStream",value:function(t){return this.loadBuf(t.read())}},{key:"loadBuf",value:function(t){return this.startDoc(),this.feed(t),this.endDoc()}},{key:"feed",value:function(t){for(var e=t.decode("utf-8"),n=0;n>=0;){var i=this.skipSpace(e,n);if(i<0)return;if((n=this.directiveOrStatement(e,i))<0)throw md(this._thisDoc,this.lines,e,i,"expected directive or statement")}}},{key:"directiveOrStatement",value:function(t,e){var n,i=this.skipSpace(t,e);return i<0?i:(n=this.directive(t,i))>=0||(n=this.statement(t,i))>=0?this.checkDot(t,n):n}},{key:"tok",value:function(t,e,n){if("@"==e.slice(n,n+1))n+=1;else if(Ph(this.keywords,t)<0)return-1;var i=n+nd(t);return e.slice(n,i)==t&&"\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~".indexOf(e.charAt(i))>=0?i:-1}},{key:"directive",value:function(t,e){if((o=this.skipSpace(t,e))<0)return o;var n=new td([]);if((o=this.tok("bind",t,e))>0)throw md(this._thisDoc,this.lines,t,e,"keyword bind is obsolete: use @prefix");if((o=this.tok("keywords",t,e))>0){if((e=this.commaSeparatedList(t,o,n,!1))<0)throw md(this._thisDoc,this.lines,t,e,"'@keywords' needs comma separated list of words");return this.setKeywords(id(n,null,null)),e}if((o=this.tok("forAll",t,e))>0){if((e=this.commaSeparatedList(t,o,n,!0))<0)throw md(this._thisDoc,this.lines,t,e,"Bad variable list after @forAll");var i=new od(n);try{for(;;){var r=i.next();(Ph(this._variables,r)<0||Ph(this._parentVariables,r)>=0)&&(this._variables[r]=this._context.newUniversal(r))}}catch(t){if(t!=rd)throw t}return e}if((o=this.tok("forSome",t,e))>0){if((e=this.commaSeparatedList(t,o,n,this.uri_ref2))<0)throw md(this._thisDoc,this.lines,t,e,"Bad variable list after @forSome");i=new od(n);try{for(;;)r=i.next(),this._context.declareExistential(r)}catch(t){if(t!=rd)throw t}return e}if((o=this.tok("prefix",t,e))>=0){var o,s=new td([]);if((e=this.qname(t,o,s))<0)throw md(this._thisDoc,this.lines,t,o,"expected qname after @prefix");if((o=this.uri_ref2(t,e,s))<0)throw md(this._thisDoc,this.lines,t,e,"expected <uriref> after @prefix _qname_");var a=s[1].uri;return this._baseURI?a=ud(this._baseURI,a):ad(a.indexOf(":")>=0,"With no base URI, cannot handle relative URI for NS"),ad(a.indexOf(":")>=0),this._bindings[s[0][0]]=a,this.bind(s[0][0],function(t){return encodeURI(t)}(a)),o}if((o=this.tok("base",t,e))>=0){if(s=new td([]),(e=this.uri_ref2(t,o,s))<0)throw md(this._thisDoc,this.lines,t,o,"expected <uri> after @base ");if(a=s[0].uri,!this._baseURI)throw md(this._thisDoc,this.lines,t,o,"With no previous base URI, cannot use relative URI in @base <"+a+">");return a=ud(this._baseURI,a),ad(a.indexOf(":")>=0),this._baseURI=a,e}return-1}},{key:"bind",value:function(t,e){""==t||this._store.setPrefixForURI(t,e)}},{key:"setKeywords",value:function(t){null==t?this.keywordsSet=0:(this.keywords=t,this.keywordsSet=1)}},{key:"startDoc",value:function(){}},{key:"endDoc",value:function(){return this._formula}},{key:"makeStatement",value:function(t){t[0].add(t[2],t[1],t[3],this.source),this.statementCount+=1}},{key:"statement",value:function(t,e){var n=new td([]);if((e=this.object(t,e,n))<0)return e;var i=this.property_list(t,e,n[0]);if(i<0)throw md(this._thisDoc,this.lines,t,e,"expected propertylist");return i}},{key:"subject",value:function(t,e,n){return this.item(t,e,n)}},{key:"verb",value:function(t,e,n){if((r=this.skipSpace(t,e))<0)return r;var i=new td([]);if((r=this.tok("has",t,e))>=0){if((e=this.prop(t,r,i))<0)throw md(this._thisDoc,this.lines,t,r,"expected property after 'has'");return n.push(new Qh(["->",i[0]])),e}if((r=this.tok("is",t,e))>=0){var r;if((e=this.prop(t,r,i))<0)throw md(this._thisDoc,this.lines,t,r,"expected <property> after 'is'");if((r=this.skipSpace(t,e))<0)throw md(this._thisDoc,this.lines,t,e,"End of file found, expected property after 'is'");if((r=this.tok("of",t,e=r))<0)throw md(this._thisDoc,this.lines,t,e,"expected 'of' after 'is' <prop>");return n.push(new Qh(["<-",i[0]])),r}if((r=this.tok("a",t,e))>=0)return n.push(new Qh(["->",this._store.sym("http://www.w3.org/1999/02/22-rdf-syntax-ns#type")])),r;if("<="==t.slice(e,e+2))return n.push(new Qh(["<-",this._store.sym(Zh+"implies")])),e+2;if("="==t.slice(e,e+1))return">"==t.slice(e+1,e+2)?(n.push(new Qh(["->",this._store.sym(Zh+"implies")])),e+2):(n.push(new Qh(["->",this._store.sym("http://www.w3.org/2002/07/owl#sameAs")])),e+1);if(":="==t.slice(e,e+2))return n.push(new Qh(["->",Zh+"becomes"])),e+2;if((r=this.prop(t,e,i))>=0)return n.push(new Qh(["->",i[0]])),r;if(">-"==t.slice(e,e+2)||"<-"==t.slice(e,e+2))throw md(this._thisDoc,this.lines,t,r,">- ... -> syntax is obsolete.");return-1}},{key:"prop",value:function(t,e,n){return this.item(t,e,n)}},{key:"item",value:function(t,e,n){return this.path(t,e,n)}},{key:"blankNode",value:function(t){return this._context.bnode(t,this._reason2)}},{key:"path",value:function(t,e,n){if((o=this.nodeOrLiteral(t,e,n))<0)return o;for(;"!^.".indexOf(t.slice(o,o+1))>=0;){var i=t.slice(o,o+1);if("."==i){var r=t.slice(o+1,o+2);if(!r||ld.indexOf(r)>=0&&":?<[{(".indexOf(r)<0)break}var o,s=n.pop(),a=this.blankNode(this.here(o));if((o=this.node(t,o+1,n))<0)throw md(this._thisDoc,this.lines,t,o,"EOF found in middle of path syntax");var c=n.pop();this.makeStatement(new Qh("^"==i?[this._context,c,a,s]:[this._context,c,s,a])),n.push(a)}return o}},{key:"anonymousNode",value:function(t){if(e=this._anonymousNodes[t])return e;var e=this._store.bnode(t);return this._anonymousNodes[t]=e,e}},{key:"node",value:function(t,e,n,i){void 0===i&&(i=null);var r=i;if((l=this.skipSpace(t,e))<0)return l;var o=t.slice(e=l,e+1);if("["==o){var s=this.here(e);if((l=this.skipSpace(t,e+1))<0)throw md(this._thisDoc,this.lines,t,e,"EOF after '['");if("="==t.slice(l,l+1)){e=l+1;var a=new td([]);if(!((l=this.objectList(t,e,a))>=0))throw md(this._thisDoc,this.lines,t,e,"objectList expected after [= ");if(r=a[0],nd(a)>1){var c=new od(a);try{for(;;){var u=c.next();this.makeStatement(new Qh([this._context,this._store.sym("http://www.w3.org/2002/07/owl#sameAs"),r,u]))}}catch(t){if(t!=rd)throw t}}if((l=this.skipSpace(t,l))<0)throw md(this._thisDoc,this.lines,t,e,"EOF when objectList expected after [ = ");if(";"==t.slice(l,l+1))var l=l+1}if(null==r&&(r=this.blankNode(s)),(e=this.property_list(t,l,r))<0)throw md(this._thisDoc,this.lines,t,l,"property_list expected");if((l=this.skipSpace(t,e))<0)throw md(this._thisDoc,this.lines,t,e,"EOF when ']' expected after [ <propertyList>");if("]"!=t.slice(l,l+1))throw md(this._thisDoc,this.lines,t,l,"']' expected");return n.push(r),l+1}if("{"==o){if("$"==t.slice(e+1,e+2)){l=(e+=1)+1;for(var h=new td([]),d=!0;;){if((e=this.skipSpace(t,l))<0)throw md(this._thisDoc,this.lines,t,e,"needed '$}', found end.");if("$}"==t.slice(e,e+2)){l=e+2;break}if(d)d=!1;else{if(","!=t.slice(e,e+1))throw md(this._thisDoc,this.lines,t,e,"expected: ','");e+=1}var f=new td([]);if((l=this.item(t,e,f))<0)throw md(this._thisDoc,this.lines,t,e,"expected item in set or '$}'");h.push(f[0])}return n.push(this._store.newSet(h,this._context)),l}l=e+1;var p=this._parentContext;this._parentContext=this._context;var v=this._anonymousNodes,g=this._parentVariables;this._parentVariables=this._variables,this._anonymousNodes=new ed([]),this._variables=this._variables.slice();var m=this._reason2;for(this._reason2=null,null==r&&(r=this._store.formula()),this._context=r;;){if((e=this.skipSpace(t,l))<0)throw md(this._thisDoc,this.lines,t,e,"needed '}', found end.");if("}"==t.slice(e,e+1)){l=e+1;break}if((l=this.directiveOrStatement(t,e))<0)throw md(this._thisDoc,this.lines,t,e,"expected statement or '}'")}return this._anonymousNodes=v,this._variables=this._parentVariables,this._parentVariables=g,this._context=this._parentContext,this._reason2=m,this._parentContext=p,n.push(r.close()),l}if("("==o){var w=this._store.list;for("$"==t.slice(e+1,e+2)&&(w=this._store.newSet,e+=1),l=e+1,h=new td([]);;){if((e=this.skipSpace(t,l))<0)throw md(this._thisDoc,this.lines,t,e,"needed ')', found end.");if(")"==t.slice(e,e+1)){l=e+1;break}if(f=new td([]),(l=this.item(t,e,f))<0)throw md(this._thisDoc,this.lines,t,e,"expected item in list or ')'");h.push(f[0])}return n.push(w(h,this._context)),l}if((l=this.tok("this",t,e))>=0)throw md(this._thisDoc,this.lines,t,e,"Keyword 'this' was ancient N3. Now use @forSome and @forAll keywords.");return(l=this.tok("true",t,e))>=0?(n.push(!0),l):(l=this.tok("false",t,e))>=0?(n.push(!1),l):null==r&&(l=this.uri_ref2(t,e,n))>=0?l:-1}},{key:"property_list",value:function(t,e,n){for(;;){if((u=this.skipSpace(t,e))<0)throw md(this._thisDoc,this.lines,t,e,"EOF found when expected verb in property list");if(":-"!=t.slice(u,u+2)){e=u;var i=new td([]);if((u=this.verb(t,e,i))<=0)return e;var r=new td([]);if((e=this.objectList(t,u,r))<0)throw md(this._thisDoc,this.lines,t,u,"objectList expected");var o=new od(r);try{for(;;){var s=o.next(),a=i[0],c=a[1];this.makeStatement(new Qh("->"==a[0]?[this._context,c,n,s]:[this._context,c,s,n]))}}catch(t){if(t!=rd)throw t}if((u=this.skipSpace(t,e))<0)throw md(this._thisDoc,this.lines,t,u,"EOF found in list of objects");if(";"!=t.slice(e,e+1))return e;e+=1}else{e=u+2;var u,l=new td([]);if((u=this.node(t,e,l,n))<0)throw md(this._thisDoc,this.lines,t,e,"bad {} or () or [] node after :- ");e=u}}}},{key:"commaSeparatedList",value:function(t,e,n,i){if((r=this.skipSpace(t,e))<0)throw md(this._thisDoc,this.lines,t,r,"EOF found expecting comma sep list");if("."==t.charAt(r))return e;if(i)var r=this.uri_ref2(t,r,n);else r=this.bareWord(t,r,n);if(r<0)return-1;for(;;){if((e=this.skipSpace(t,r))<0)return e;var o=t.slice(e,e+1);if(","!=o)return"."!=o?-1:e;if((r=i?this.uri_ref2(t,e+1,n):this.bareWord(t,e+1,n))<0)throw md(this._thisDoc,this.lines,t,r,"bad list content")}}},{key:"objectList",value:function(t,e,n){if((e=this.object(t,e,n))<0)return-1;for(;;){var i=this.skipSpace(t,e);if(i<0)throw md(this._thisDoc,this.lines,t,i,"EOF found after object");if(","!=t.slice(i,i+1))return i;if((e=this.object(t,i+1,n))<0)return e}}},{key:"checkDot",value:function(t,e){var n=this.skipSpace(t,e);if(n<0)return n;if("."==t.slice(n,n+1))return n+1;if("}"==t.slice(n,n+1))return n;if("]"==t.slice(n,n+1))return n;throw md(this._thisDoc,this.lines,t,n,"expected '.' or '}' or ']' at end of statement")}},{key:"uri_ref2",value:function(t,e,n){var i=new td([]);if((d=this.qname(t,e,i))>=0){var r=i[0],o=r[0],s=r[1];if(null==o){ad(0,"not used?");var a=this._baseURI+"#"}else if(!(a=this._bindings[o])){if("_"==o)return n.push(this.anonymousNode(s)),d;throw md(this._thisDoc,this.lines,t,e,"Prefix "+o+" not bound.")}var c=this._store.sym(a+s);return Ph(this._variables,c)>=0?n.push(this._variables[c]):n.push(c),d}if((e=this.skipSpace(t,e))<0)return-1;if("?"==t.charAt(e)){var u=new td([]);return(d=this.variable(t,e,u))>0?(n.push(u[0]),d):-1}if("<"==t.charAt(e)){for(var l=e+=1;e<nd(t);){if(">"==t.charAt(e)){var h=t.slice(l,e);return this._baseURI?h=ud(this._baseURI,h):ad(h.indexOf(":")>=0,"With no base URI, cannot deal with relative URIs"),"#"==t.slice(e-1,e)&&"#"!=id(h,-1,null)&&(h+="#"),c=this._store.sym(h),Ph(this._variables,c)>=0?n.push(this._variables[c]):n.push(c),e+1}e+=1}throw md(this._thisDoc,this.lines,t,d,"unterminated URI reference")}if(this.keywordsSet){var d;if(u=new td([]),(d=this.bareWord(t,e,u))<0)return-1;if(Ph(this.keywords,u[0])>=0)throw md(this._thisDoc,this.lines,t,e,'Keyword "'+u[0]+'" not allowed here.');return n.push(this._store.sym(this._bindings[""]+u[0])),d}return-1}},{key:"skipSpace",value:function(t,e){for(var n=e||0;n<t.length;n++){var i=t.charAt(n);if(" \n\r\t\f\v            ​\u2028\u2029 ".indexOf(i)<0){if("#"!==t.charAt(n))return n;for(;;n++){if(n===t.length)return-1;if("\n"===t.charAt(n)){this.lines=this.lines+1;break}}}else"\n"===t.charAt(n)&&(this.lines=this.lines+1)}return-1}},{key:"variable",value:function(t,e,n){if((i=this.skipSpace(t,e))<0)return-1;if("?"!=t.slice(i,i+1))return-1;var i;if(e=i+=1,"0123456789-".indexOf(t.charAt(i))>=0)throw md(this._thisDoc,this.lines,t,i,"Varible name can't start with '"+t.charAt(i)+"s'");for(;e<nd(t)&&ld.indexOf(t.charAt(e))<0;)e+=1;if(null==this._parentContext)throw md(this._thisDoc,this.lines,t,i,"Can't use ?xxx syntax for variable in outermost level: "+t.slice(i-1,e));return n.push(this._store.variable(t.slice(i,e))),e}},{key:"bareWord",value:function(t,e,n){var i=this.skipSpace(t,e);if(i<0)return-1;var r=t.charAt(i);if("0123456789-".indexOf(r)>=0)return-1;if(ld.indexOf(r)>=0)return-1;for(e=i;e<nd(t)&&ld.indexOf(t.charAt(e))<0;)e+=1;return n.push(t.slice(i,e)),e}},{key:"qname",value:function(t,e,n){if((e=this.skipSpace(t,e))<0)return-1;var i=t.charAt(e);if("0123456789-+".indexOf(i)>=0)return-1;if(ld.indexOf(i)<0){var r=i;for(e+=1;e<nd(t)&&(i=t.charAt(e),ld.indexOf(i)<0);)r+=i,e+=1}else r="";if(e<nd(t)&&":"==t.charAt(e)){var o=r;for(e+=1,r="";e<nd(t)&&(i=t.charAt(e),ld.indexOf(i)<0);)r+=i,e+=1;return n.push(new Qh([o,r])),e}return r&&this.keywordsSet&&Ph(this.keywords,r)<0?(n.push(new Qh(["",r])),e):-1}},{key:"object",value:function(t,e,n){if((s=this.subject(t,e,n))>=0)return s;if((s=this.skipSpace(t,e))<0)return-1;var i=null,r=t.charAt(e=s);if('"'==r||"'"==r){i=t.slice(e,e+3==r+r)?r+r+r:r,e+=nd(i);var o=this.strconst(t,e,i),s=o[0];return n.push(this._store.literal(o[1])),s}return-1}},{key:"nodeOrLiteral",value:function(t,e,n){if((h=this.node(t,e,n))>=0)return h;if((h=this.skipSpace(t,e))<0)return-1;var i=t.charAt(e=h);if("-+0987654321".indexOf(i)>=0){if(dd.lastIndex=0,null!=(l=dd.exec(t.slice(e))))h=e+(r=l[0]).length,r.indexOf("T")>=0?n.push(this._store.literal(r,this._store.sym("http://www.w3.org/2001/XMLSchema#dateTime"))):n.push(this._store.literal(r,this._store.sym("http://www.w3.org/2001/XMLSchema#date")));else{var r;if(hd.lastIndex=0,null==(l=hd.exec(t.slice(e))))throw md(this._thisDoc,this.lines,t,e,"Bad number or date syntax");(r=t.slice(e,h=e+hd.lastIndex)).indexOf("e")>=0?n.push(this._store.literal(parseFloat(r),this._store.sym("http://www.w3.org/2001/XMLSchema#double"))):t.slice(e,h).indexOf(".")>=0?n.push(this._store.literal(parseFloat(r),this._store.sym("http://www.w3.org/2001/XMLSchema#decimal"))):n.push(this._store.literal(parseInt(r),this._store.sym("http://www.w3.org/2001/XMLSchema#integer")))}return h}if('"'==t.charAt(e)){if('"""'==t.slice(e,e+3))var o='"""';else o='"';e+=nd(o);var s=null,a=this.strconst(t,e,o),c=a[1],u=null;if("@"==t.slice(h=a[0],h+1)){var l;if(pd.lastIndex=0,null==(l=pd.exec(t.slice(h+1))))throw md(this._thisDoc,startline,t,e,"Bad language code syntax on string literal, after @");u=t.slice(h+1,e=pd.lastIndex+h+1);var h=e}if("^^"==t.slice(h,h+2)){var d=new td([]);h=this.uri_ref2(t,h+2,d),s=d[0]}return n.push(this._store.literal(c,u||s)),h}return-1}},{key:"strconst",value:function(t,e,n){for(var i=e,r="",o=this.lines;i<nd(t);){if(e=i+nd(n),t.slice(i,e)==n)return new Qh([e,r]);if('"'!=t.charAt(i)){if(fd.lastIndex=0,!fd.exec(t.slice(i)))throw md(this._thisDoc,o,t,i,"Closing quote missing in string at ^ in "+t.slice(i-20,i)+"^"+t.slice(i,i+20));if(r+=t.slice(i,e=i+fd.lastIndex-1),'"'!=(c=t.charAt(e)))if("\r"!=c){if("\n"==c){if('"'==n)throw md(this._thisDoc,o,t,e,"newline found in string literal");this.lines=this.lines+1,r+=c,i=e+1,this.previousLine=this.startOfLine,this.startOfLine=i}else if("\\"==c){if(!(c=t.slice(i=e+1,i+1)))throw md(this._thisDoc,o,t,e,"unterminated string literal (2)");var s=sd('abfrtvn\\"',c);if(s>=0)r+='a\b\f\r\t\v\n\\"'.charAt(s),i+=1;else if("u"==c)i=(a=this.uEscape(t,i+1,o))[0],r+=c=a[1];else{if("U"!=c)throw md(this._thisDoc,this.lines,t,e,"bad escape");var a,c;i=(a=this.UEscape(t,i+1,o))[0],r+=c=a[1]}}}else i=e+1;else i=e}else r=r+'"',i=i+1}throw md(this._thisDoc,this.lines,t,e,"unterminated string literal")}},{key:"uEscape",value:function(t,e,n){for(var i=e,r=0,o=0;r<4;){var s=t.slice(i,i+1).toLowerCase();if(i+=1,""==s)throw md(this._thisDoc,n,t,e,"unterminated string literal(3)");var a=sd("0123456789abcdef",s);if(a<0)throw md(this._thisDoc,n,t,e,"bad string literal hex escape");o=16*o+a,r+=1}var c=String.fromCharCode(o);return new Qh([i,c])}},{key:"UEscape",value:function(t,e,n){for(var i=e,r=0,o="\\U";r<8;){var s=t.slice(i,i+1).toLowerCase();if(i+=1,""==s)throw md(this._thisDoc,n,t,e,"unterminated string literal(3)");if(sd("0123456789abcdef",s)<0)throw md(this._thisDoc,n,t,e,"bad string literal hex escape");o+=s,r+=1}var a,c=(a="0x"+id(o,2,10)-0,String.fromCharCode(a));return new Qh([i,c])}}]),t}();function md(t,e,n,i,r){var o=e+1,s="Line "+o+" of <"+t+">: Bad syntax: "+r+'\nat: "'+n.slice(i,i+30)+'"',a=new SyntaxError(s,t,o);return a.lineNo=o,a.characterInFile=i,a.syntaxProblem=r,a}function wd(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function bd(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?wd(Object(n),!0).forEach((function(e){ic(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):wd(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var yd,xd=bd(bd({},vh),{},{supports:(cd={},ic(cd,lh.collections,!0),ic(cd,lh.defaultGraphType,!1),ic(cd,lh.equalsMethod,!0),ic(cd,lh.identity,!1),ic(cd,lh.id,!0),ic(cd,lh.reversibleId,!1),ic(cd,lh.variableType,!0),cd),collection:function(t){return new Ec(t)},id:function(t){var e,n=this;return lc(t)?"( ".concat(t.elements.map((function(t){return n.id(t)})).join(", ")," )"):dc(e=t)&&"Variable"===e.termType?fh.toString(t):vh.id(t)},termToNQ:function(t){return"Collection"===t.termType?Ec.toNT(t):vh.termToNQ(t)}}),kd=Vt(Pa());function Ed(t,e){return"string"==typeof e?t.rdfFactory.literal(e):Object.prototype.hasOwnProperty.call(e,"@list")?!0===t.rdfFactory.supports.COLLECTIONS?function(t,e){if(!Array.isArray(e))throw new TypeError("Object must be an array");return t.rdfFactory.collection(e.map((function(e){return Ed(t,e)})))}(t,e["@list"]):function(t,e){var n=e["@id"]?t.rdfFactory.namedNode(e["@id"]):t.rdfFactory.blankNode(),i=e["@list"].map((function(e){return Ed(t,e)})),r=Nh(t.rdfFactory,n,i);return t.addAll(r),n}(t,e):Object.prototype.hasOwnProperty.call(e,"@id")?t.rdfFactory.namedNode(e["@id"]):Object.prototype.hasOwnProperty.call(e,"@language")?t.rdfFactory.literal(e["@value"],e["@language"]):Object.prototype.hasOwnProperty.call(e,"@type")?t.rdfFactory.literal(e["@value"],t.rdfFactory.namedNode(e["@type"])):Object.prototype.hasOwnProperty.call(e,"@value")?t.rdfFactory.literal(e["@value"]):t.rdfFactory.literal(e)}function Sd(t,e,n,i){var r=n&&Object.prototype.hasOwnProperty.call(n,"termType")?n.value:n;return kd.default.flatten(JSON.parse(t),null,{base:r}).then((function(t){return t.reduce((function(t,i){return e=Fd(e,n,i)}),e)})).then(i).catch(i)}function Fd(t,e,n){for(var i=n["@id"]?t.rdfFactory.namedNode(n["@id"]):t.rdfFactory.blankNode(),r=0,o=Object.keys(n);r<o.length;r++){var s=o[r];if("@id"!==s){if("@graph"==s)for(var a=i,c=n[s],u=0;u<c.length;u++)t=Fd(t,a,c[u]);var l=n[s];if(Array.isArray(l))for(var h=0;h<l.length;h++)t.addStatement(Ad(t,i,s,l[h],e));else t.addStatement(Ad(t,i,s,l,e))}}return t}function Ad(t,e,n,i,r){var o,s;return"@type"===n?(o=t.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),s=t.rdfFactory.namedNode(i)):(o=t.rdfFactory.namedNode(n),s=Ed(t,i)),t.rdfFactory.quad(e,o,s,t.rdfFactory.namedNode(r))}void 0===yd&&(yd={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 _d=function(){function t(e,n){Xa(this,t),this.options=n||{},this.kb=e,this.target=n.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 Ga(t,[{key:"addTriple",value:function(t,e,n,i){var r,o,s,a;r=void 0===e?vh.namedNode(this.options.base):this.toRDFNodeObject(e),s=this.toRDFNodeObject(n),o=this.toRDFNodeObject(i),a=vh.namedNode(this.options.base),this.kb.add(r,s,o,a)}},{key:"ancestorPath",value:function(t){for(var e="";t&&t.nodeType!==yd.DOCUMENT_NODE;)e="/"+t.localName+e,t=t.parentNode;return e}},{key:"copyMappings",value:function(t){var e={};for(var n in t)e[n]=t[n];return e}},{key:"copyProperties",value:function(){}},{key:"deriveDateTimeType",value:function(e){for(var n=0;n<t.dateTimeTypes.length;n++){var i=t.dateTimeTypes[n].pattern.exec(e);if(i&&i[0].length===e.length)return t.dateTimeTypes[n].type}return null}},{key:"init",value:function(){}},{key:"newBlankNode",value:function(){return this.blankCounter++,"_:"+this.blankCounter}},{key:"newSubjectOrigin",value:function(){}},{key:"parseCURIE",value:function(e,n){var i,r=e.indexOf(":");if(r>=0){var o=e.substring(0,r);if(""===o)return(i=n[""])?i+e.substring(r+1):null;if("_"===o)return"_:"+e.substring(r+1);if(t.NCNAME.test(o)&&(i=n[o]))return i+e.substring(r+1)}return null}},{key:"parseCURIEOrURI",value:function(t,e,n){return this.parseCURIE(t,e,n)||this.resolveAndNormalize(n,t)}},{key:"parsePredicate",value:function(t,e,n,i,r,o){if(""===t)return null;var s=this.parseTermOrCURIEOrAbsURI(t,e,o?null:n,i,r);return s&&0===s.indexOf("_:")?null:s}},{key:"parsePrefixMappings",value:function(t,e){for(var n=this.tokenize(t),i=null,r=0;r<n.length;r++)":"===n[r][n[r].length-1]?i=n[r].substring(0,n[r].length-1):i&&(e[i]=this.options.base?ah(n[r],this.options.base):n[r],i=null)}},{key:"parseSafeCURIEOrCURIEOrURI",value:function(t,e,n){return"["===(t=this.trim(t)).charAt(0)&&"]"===t.charAt(t.length-1)?0===(t=(t=t.substring(1,t.length-1)).trim(t)).length?null:"_:"===t?this.theOne:this.parseCURIE(t,e,n):this.parseCURIEOrURI(t,e,n)}},{key:"parseTermOrCURIEOrAbsURI",value:function(t,e,n,i,r){t=this.trim(t);var o=this.parseCURIE(t,i,r);if(o)return o;if(n){if(e&&!this.absURIRE.exec(t))return e+t;var s=n[t];if(s)return s;if(s=n[t.toLowerCase()])return s}return this.absURIRE.exec(t)?this.resolveAndNormalize(r,t):null}},{key:"parseTermOrCURIEOrURI",value:function(t,e,n,i,r){t=this.trim(t);var o=this.parseCURIE(t,i,r);if(o)return o;var s=n[t];return s||((s=n[t.toLowerCase()])?s:e&&!this.absURIRE.exec(t)?e+t:this.resolveAndNormalize(r,t))}},{key:"parseURI",value:function(t){return t}},{key:"process",value:function(e,n){var i;n=n||{},e.nodeType===yd.DOCUMENT_NODE?(e.baseURI&&!n.baseURI&&(n.baseURI=e.baseURI),i=e.baseURI,(e=e.documentElement).baseURI||(e.baseURI=i),this.setContext(e)):e.parentNode.nodeType===yd.DOCUMENT_NODE&&this.setContext(e);var r=[],o=function(t){if(!t&&n&&n.baseURI)return n.baseURI;var e=t.indexOf("#");return e>=0&&(t=t.substring(0,e)),n&&n.baseURIMap&&(t=n.baseURIMap(t)),t};for(r.push({current:e,context:this.push(null,o(e.baseURI))});r.length>0;){var s=r.shift();if(s.parent){if(s.context.parent&&s.context.parent.listMapping===s.listMapping)continue;for(var a in s.listMapping){var c=s.listMapping[a];if(0!==c.length){for(var u=[],l=0;l<c.length;l++)u.push(this.newBlankNode());for(var h=0;h<u.length;h++)this.addTriple(s.parent,u[h],"http://www.w3.org/1999/02/22-rdf-syntax-ns#first",c[h]),this.addTriple(s.parent,u[h],"http://www.w3.org/1999/02/22-rdf-syntax-ns#rest",{type:t.objectURI,value:h+1<u.length?u[h+1]:"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"});this.addTriple(s.parent,s.subject,a,{type:t.objectURI,value:u[0]})}else this.addTriple(s.parent,s.subject,a,{type:t.objectURI,value:"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"})}}else{var d=s.current,f=s.context,p=!1,v=null,g=null,m=null,w=f.prefixes,b=!1,y=[],x=f.listMapping,k=!f.parent,E=f.language,S=f.vocabulary;i=this.parseURI(o(d.baseURI)),d.item=null;var F=d.getAttributeNode("vocab");if(F){var A=this.trim(F.value);A.length>0?this.addTriple(d,i.spec,"http://www.w3.org/ns/rdfa#usesVocabulary",{type:t.objectURI,value:S=A}):S=this.vocabulary}for(var _=0;_<d.attributes.length;_++){var j=d.attributes[_];if("x"===j.nodeName.charAt(0)&&0===j.nodeName.indexOf("xmlns:")){b||(w=this.copyMappings(w),b=!0);var C=j.nodeName.substring(6),R=t.trim(j.value);w[C]=this.options.base?ah(R,this.options.base):R}}var I=d.getAttributeNode("prefix");I&&(b||(w=this.copyMappings(w),b=!0),this.parsePrefixMappings(I.value,w));for(var T=null,O=0;!T&&O<this.langAttributes.length;O++)T=d.getAttributeNodeNS(this.langAttributes[O].namespaceURI,this.langAttributes[O].localName);if(T){var N=t.trim(T.value);E=N.length>0?N:null}var P,D,M=d.getAttributeNode("rel"),U=d.getAttributeNode("rev"),L=d.getAttributeNode("typeof"),B=d.getAttributeNode("property"),J=d.getAttributeNode("datatype"),$=this.inHTMLMode?d.getAttributeNode("datetime"):null,H=d.getAttributeNode("content"),z=d.getAttributeNode("about"),K=d.getAttributeNode("src"),W=d.getAttributeNode("resource"),q=d.getAttributeNode("href"),V=d.getAttributeNode("inlist"),G=[];if(M){D=this.tokenize(M.value);for(var X=0;X<D.length;X++)(P=this.parsePredicate(D[X],S,f.terms,w,i,this.inHTMLMode&&null!==B))&&G.push(P)}var Y=[];if(U){D=this.tokenize(U.value);for(var Z=0;Z<D.length;Z++)(P=this.parsePredicate(D[Z],S,f.terms,w,i,this.inHTMLMode&&B))&&Y.push(P)}if(this.inHTMLMode&&(M||U)&&B&&(0===G.length&&(M=null),0===Y.length&&(U=null)),M||U?(z&&(v=this.parseSafeCURIEOrCURIEOrURI(z.value,w,i)),L&&(m=v),v||(d.parentNode.nodeType===yd.DOCUMENT_NODE?v=o(d.baseURI):f.parentObject&&(v=o(d.parentNode.baseURI)===f.parentObject?o(d.baseURI):f.parentObject)),W&&(g=this.parseSafeCURIEOrCURIEOrURI(W.value,w,i)),g||(q?g=this.resolveAndNormalize(i,encodeURI(q.value)):K?g=this.resolveAndNormalize(i,encodeURI(K.value)):!L||z||this.inXHTMLMode&&("head"===d.localName||"body"===d.localName)||(g=this.newBlankNode())),!L||z||!this.inXHTMLMode||"head"!==d.localName&&"body"!==d.localName?L&&!z&&(m=g):m=v):!B||H||J?(z&&(v=this.parseSafeCURIEOrCURIEOrURI(z.value,w,i)),!v&&W&&(v=this.parseSafeCURIEOrCURIEOrURI(W.value,w,i)),!v&&q&&(v=this.resolveAndNormalize(i,encodeURI(q.value))),!v&&K&&(v=this.resolveAndNormalize(i,encodeURI(K.value))),v||(d.parentNode.nodeType===yd.DOCUMENT_NODE?v=o(d.baseURI):!this.inXHTMLMode&&!this.inHTMLMode||"head"!==d.localName&&"body"!==d.localName?L?v=this.newBlankNode():f.parentObject&&(v=o(d.parentNode.baseURI)===f.parentObject?o(d.baseURI):f.parentObject,B||(p=!0)):v=o(d.parentNode.baseURI)===f.parentObject?o(d.baseURI):f.parentObject),L&&(m=v)):(z&&(v=this.parseSafeCURIEOrCURIEOrURI(z.value,w,i),L&&(m=v)),v||d.parentNode.nodeType!==yd.DOCUMENT_NODE?!v&&f.parentObject&&(v=o(d.parentNode.baseURI)===f.parentObject?o(d.baseURI):f.parentObject):(v=o(d.baseURI),L&&(m=v)),L&&!m&&(W&&(m=this.parseSafeCURIEOrCURIEOrURI(W.value,w,i)),!m&&q&&(m=this.resolveAndNormalize(i,encodeURI(q.value))),!m&&K&&(m=this.resolveAndNormalize(i,encodeURI(K.value))),m||!this.inXHTMLMode&&!this.inHTMLMode||"head"!==d.localName&&"body"!==d.localName||(m=v),m||(m=this.newBlankNode()),g=m)),v&&(z||W||m)){var Q=v;L&&!z&&!W&&g&&(Q=g),this.newSubjectOrigin(d,Q)}if(m){D=this.tokenize(L.value);for(var tt=0;tt<D.length;tt++){var et=this.parseTermOrCURIEOrAbsURI(D[tt],S,f.terms,w,i);et&&this.addTriple(d,m,t.typeURI,{type:t.objectURI,value:et})}}if(v&&v!==f.parentObject&&(x={},k=!0),g){if(M&&V)for(var nt=0;nt<G.length;nt++){var it=x[G[nt]];it||(x[G[nt]]=it=[]),it.push({type:t.objectURI,value:g})}else if(M)for(var rt=0;rt<G.length;rt++)this.addTriple(d,v,G[rt],{type:t.objectURI,value:g});if(U)for(var ot=0;ot<Y.length;ot++)this.addTriple(d,g,Y[ot],{type:t.objectURI,value:v})}else{if(v&&!g&&(M||U)&&(g=this.newBlankNode()),M&&V)for(var st=0;st<G.length;st++){var at=x[G[st]];at||(x[P]=at=[]),y.push({predicate:G[st],list:at})}else if(M)for(var ct=0;ct<G.length;ct++)y.push({predicate:G[ct],forward:!0});if(U)for(var ut=0;ut<Y.length;ut++)y.push({predicate:Y[ut],forward:!1})}if(B){var lt=null,ht=null;J?(lt=""===J.value?t.PlainLiteralURI:this.parseTermOrCURIEOrAbsURI(J.value,S,f.terms,w,i),ht=$&&!H?$.value:lt===t.XMLLiteralURI||lt===t.HTMLLiteralURI?null:H?H.value:d.textContent):H?(lt=t.PlainLiteralURI,ht=H.value):$?(lt=t.deriveDateTimeType(ht=$.value))||(lt=t.PlainLiteralURI):M||U||(W&&(ht=this.parseSafeCURIEOrCURIEOrURI(W.value,w,i)),!ht&&q?ht=this.resolveAndNormalize(i,encodeURI(q.value)):!ht&&K&&(ht=this.resolveAndNormalize(i,encodeURI(K.value))),ht&&(lt=t.objectURI)),lt||(L&&!z?(lt=t.objectURI,ht=m):(ht=d.textContent,this.inHTMLMode&&"time"===d.localName&&(lt=t.deriveDateTimeType(ht)),lt||(lt=t.PlainLiteralURI))),D=this.tokenize(B.value);for(var dt=0;dt<D.length;dt++){var ft=this.parsePredicate(D[dt],S,f.terms,w,i);if(ft)if(V){var pt=x[ft];pt||(x[ft]=pt=[]),pt.push(lt===t.XMLLiteralURI||lt===t.HTMLLiteralURI?{type:lt,value:d.childNodes}:{type:lt||t.PlainLiteralURI,value:ht,language:E})}else this.addTriple(d,v,ft,lt===t.XMLLiteralURI||lt===t.HTMLLiteralURI?{type:lt,value:d.childNodes}:{type:lt||t.PlainLiteralURI,value:ht,language:E})}}if(v&&!p)for(var vt=0;vt<f.incomplete.length;vt++)f.incomplete[vt].list?f.incomplete[vt].list.push({type:t.objectURI,value:v}):f.incomplete[vt].forward?this.addTriple(d,f.subject,f.incomplete[vt].predicate,{type:t.objectURI,value:v}):this.addTriple(d,v,f.incomplete[vt].predicate,{type:t.objectURI,value:f.subject});var gt=null,mt=v;p?((gt=this.push(f,f.subject)).parentObject=o(d.parentNode.baseURI)===f.parentObject?o(d.baseURI):f.parentObject,gt.incomplete=f.incomplete,gt.language=E,gt.prefixes=w,gt.vocabulary=S):((gt=this.push(f,v)).parentObject=g||v||f.subject,gt.prefixes=w,gt.incomplete=y,g&&(mt=g,x={},k=!0),gt.listMapping=x,gt.language=E,gt.vocabulary=S),k&&r.unshift({parent:d,context:f,subject:mt,listMapping:x});for(var wt=d.lastChild;wt;wt=wt.previousSibling)wt.nodeType===yd.ELEMENT_NODE&&r.unshift({current:wt,context:gt})}}this.inHTMLMode&&this.copyProperties();for(var bt=0;bt<this.finishedHandlers.length;bt++)this.finishedHandlers[bt](e)}},{key:"push",value:function(t,e){return{parent:t,subject:e||(t?t.subject:null),parentObject:null,incomplete:[],listMapping:t?t.listMapping:{},language:t?t.language:this.language,prefixes:t?t.prefixes:this.target.graph.prefixes,terms:t?t.terms:this.target.graph.terms,vocabulary:t?t.vocabulary:this.vocabulary}}},{key:"resolveAndNormalize",value:function(t,e){return ah(e,t)}},{key:"setContext",value:function(t){"html"===t.localName&&"XHTML+RDFa 1.1"===t.getAttribute("version")?this.setXHTMLContext():"html"===t.localName||"http://www.w3.org/1999/xhtml"===t.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(t){return this.trim(t).split(/\s+/)}},{key:"toRDFNodeObject",value:function(e){var n=this;if(void 0!==e){if("string"==typeof e)return"_:"===e.substring(0,2)?(void 0===this.blankNodes[e.substring(2)]&&(this.blankNodes[e.substring(2)]=new sc(e.substring(2))),this.blankNodes[e.substring(2)]):vh.namedNode(e);switch(e.type){case t.objectURI:return"_:"===e.value.substring(0,2)?(void 0===this.blankNodes[e.value.substring(2)]&&(this.blankNodes[e.value.substring(2)]=new sc(e.value.substring(2))),this.blankNodes[e.value.substring(2)]):vh.namedNode(e.value);case t.PlainLiteralURI:return new xc(e.value,e.language||"");case t.XMLLiteralURI:case t.HTMLLiteralURI:var i="";return Object.keys(e.value).forEach((function(t){i+=Eh(e.value[t],n.htmlOptions)})),new xc(i,"",new bc(e.type));default:return new xc(e.value,"",new bc(e.type))}}}},{key:"trim",value:function(t){return t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}}],[{key:"parseRDFaDOM",value:function(e,n,i){var r=new t(n,{base:i});e.baseURI||(e.baseURI=i),r.process(e,{baseURI:i})}},{key:"tokenize",value:function(t){return this.trim(t).split(/\s+/)}},{key:"trim",value:function(t){return t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}}]),t}();_d.XMLLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral",_d.HTMLLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML",_d.PlainLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral",_d.objectURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#object",_d.typeURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",_d.nameChar="[-A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�က0-F.0-9·̀-ͯ‿-⁀]",_d.nameStartChar="[A-Za-zÀ-ÖØ-öø-ÿĀ-ıĴ-ľŁ-ňŊ-žƀ-ǃǍ-ǰǴ-ǵǺ-ȗɐ-ʨʻ-ˁΆΈ-ΊΌΎ-ΡΣ-ώϐ-ϖϚϜϞϠϢ-ϳЁ-ЌЎ-яё-ќў-ҁҐ-ӄӇ-ӈӋ-ӌӐ-ӫӮ-ӵӸ-ӹԱ-Ֆՙա-ֆא-תװ-ײء-غف-يٱ-ڷں-ھۀ-ێې-ۓەۥ-ۦअ-हऽक़-ॡঅ-ঌএ-ঐও-নপ-রলশ-হড়-ঢ়য়-ৡৰ-ৱਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઋઍએ-ઑઓ-નપ-રલ-ળવ-હઽૠଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଶ-ହଽଡ଼-ଢ଼ୟ-ୡஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-வஷ-ஹఅ-ఌఎ-ఐఒ-నప-ళవ-హౠ-ౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹೞೠ-ೡഅ-ഌഎ-ഐഒ-നപ-ഹൠ-ൡก-ฮะา-ำเ-ๅກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ຮະາ-ຳຽເ-ໄཀ-ཇཉ-ཀྵႠ-Ⴥა-ჶᄀᄂ-ᄃᄅ-ᄇᄉᄋ-ᄌᄎ-ᄒᄼᄾᅀᅌᅎᅐᅔ-ᅕᅙᅟ-ᅡᅣᅥᅧᅩᅭ-ᅮᅲ-ᅳᅵᆞᆨᆫᆮ-ᆯᆷ-ᆸᆺᆼ-ᇂᇫᇰᇹḀ-ẛẠ-ỹἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼΩK-Å℮ↀ-ↂぁ-ゔァ-ヺㄅ-ㄬ가-힣一-龥〇〡-〩_]",_d.NCNAME=new RegExp("^"+_d.nameStartChar+_d.nameChar+"*$"),_d.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 jd=_d.parseRDFaDOM,Cd=function(){function t(e){Xa(this,t),this.store=e,this.bnodes={},this.why=null,this.reify=!1}return Ga(t,[{key:"frameFactory",value:function(e,n,i){return{NODE:1,ARC:2,parent:n,parser:e,store:e.store,element:i,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(t,e){e=ah(e,this.base),this.node=this.store.sym(e),this.nodeType=t},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 e=this.store.sym(ah("#"+this.parent.rdfid,this.base));this.store.add(e,this.store.sym(t.ns.RDF+"type"),this.store.sym(t.ns.RDF+"Statement"),this.parser.why),this.store.add(e,this.store.sym(t.ns.RDF+"subject"),this.parent.parent.node,this.parser.why),this.store.add(e,this.store.sym(t.ns.RDF+"predicate"),this.parent.node,this.parser.why),this.store.add(e,this.store.sym(t.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(t){this.addSymbol(this.NODE,t),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(t){this.node=null!=t?null!=this.parser.bnodes[t]?this.parser.bnodes[t]:this.parser.bnodes[t]=this.store.bnode():this.store.bnode(),this.nodeType=this.NODE,this.isTripleToLoad()&&this.loadTriple()},addArc:function(e){e===t.ns.RDF+"li"&&(e=t.ns.RDF+"_"+this.parent.listIndex,this.parent.listIndex++),this.addSymbol(this.ARC,e)},addLiteral:function(e){this.node=this.store.literal(e,this.parent.datatype&&this.parent.datatype!==t.ns.RDF+"langString"?this.store.sym(this.parent.datatype):this.lang),this.nodeType=this.NODE,this.isTripleToLoad()&&this.loadTriple()}}}},{key:"getAttributeNodeNS",value:function(t,e,n){var i=null;if(t.getAttributeNodeNS)i=t.getAttributeNodeNS(e,n);else for(var r,o=t.attributes,s=0;s<o.length;++s)if((r=o[s]).namespaceURI===e&&(r.prefix?r.prefix+":"+n:n)===r.nodeName){i=r;break}return i}},{key:"parse",value:function(e,n,i){var r,o=e.childNodes;if(this.cleanParser(),e.nodeType===t.nodeType.DOCUMENT){for(var s=0;s<o.length;s++)if(o[s].nodeType===t.nodeType.ELEMENT){r=o[s];break}}else{if(e.nodeType!==t.nodeType.ELEMENT)throw new Error("RDFParser: can't find root in "+n+". Halting. ");r=e}this.why=i;var a=this.frameFactory(this);return this.base=n,a.base=n,a.lang=null,this.parseDOM(this.buildFrame(a,r)),!0}},{key:"parseDOM",value:function(e){for(var n,i=function(t){var e="";if(null==t.namespaceURI)throw new Error("RDF/XML syntax error: No namespace for "+t.localName+" in "+this.base);return t.namespaceURI&&(e+=t.namespaceURI),t.localName?e+=t.localName:t.nodeName&&(t.nodeName.indexOf(":")>=0?e+=t.nodeName.split(":")[1]:e+=t.nodeName),e}.bind(this),r=!0;e.parent;){var o=e.element,s=o.attributes;if(o.nodeType===t.nodeType.TEXT||o.nodeType===t.nodeType.CDATA_SECTION)e.parent.nodeType===e.NODE&&(e.addArc(t.ns.RDF+"value"),e=this.buildFrame(e)),e.addLiteral(o.nodeValue);else if(i(o)!==t.ns.RDF+"RDF")if(e.parent&&e.parent.collection&&(e.addCollectionArc(),(e=this.buildFrame(e,e.element)).parent.element=null),e.parent&&e.parent.nodeType&&e.parent.nodeType!==e.ARC){e.addArc(i(o)),this.reify&&(n=this.getAttributeNodeNS(o,t.ns.RDF,"ID"))&&(e.rdfid=n.nodeValue,o.removeAttributeNode(n));var a=this.getAttributeNodeNS(o,t.ns.RDF,"parseType"),c=this.getAttributeNodeNS(o,t.ns.RDF,"datatype");if(c&&(e.datatype=c.nodeValue,o.removeAttributeNode(c)),a){var u=a.nodeValue;"Literal"===u?(e.datatype=t.ns.RDF+"XMLLiteral",(e=this.buildFrame(e)).addLiteral(o.childNodes),r=!1):"Resource"===u?((e=this.buildFrame(e,e.element)).parent.element=null,e.addBNode()):"Collection"===u&&((e=this.buildFrame(e,e.element)).parent.element=null,e.addCollection()),o.removeAttributeNode(a)}if(0!==s.length){var l=this.getAttributeNodeNS(o,t.ns.RDF,"resource"),h=this.getAttributeNodeNS(o,t.ns.RDF,"nodeID");e=this.buildFrame(e),l?(e.addNode(l.nodeValue),o.removeAttributeNode(l)):h?(e.addBNode(h.nodeValue),o.removeAttributeNode(h)):e.addBNode();for(var d=s.length-1;d>=0;d--){var f=this.buildFrame(e);f.addArc(i(s[d])),i(s[d])===t.ns.RDF+"type"?this.buildFrame(f).addNode(s[d].nodeValue):this.buildFrame(f).addLiteral(s[d].nodeValue)}}else 0===o.childNodes.length&&this.buildFrame(e).addLiteral("")}else{var p=this.getAttributeNodeNS(o,t.ns.RDF,"about");if(n=this.getAttributeNodeNS(o,t.ns.RDF,"ID"),p&&n)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(!p&&n)e.addNode("#"+n.nodeValue),o.removeAttributeNode(n);else if(null==p&&null==n){var v=this.getAttributeNodeNS(o,t.ns.RDF,"nodeID");v?(e.addBNode(v.nodeValue),o.removeAttributeNode(v)):e.addBNode()}else e.addNode(p.nodeValue),o.removeAttributeNode(p);var g=this.getAttributeNodeNS(o,t.ns.RDF,"type");t.ns.RDF+"Description"!==i(o)&&(g={nodeValue:i(o)}),null!=g&&(this.store.add(e.node,this.store.sym(t.ns.RDF+"type"),this.store.sym(ah(g.nodeValue,e.base)),this.why),g.nodeName&&o.removeAttributeNode(g));for(var m=s.length-1;m>=0;m--)this.store.add(e.node,this.store.sym(i(s[m])),this.store.literal(s[m].nodeValue,e.lang),this.why)}for(o=e.element;e.parent;){for(var w=e;null==o;)o=(e=e.parent).element;var b=o.childNodes&&o.childNodes[e.lastChild];if(b&&r){if((b.nodeType===t.nodeType.ELEMENT||b.nodeType===t.nodeType.TEXT||b.nodeType===t.nodeType.CDATA_SECTION)&&(b.nodeType!==t.nodeType.TEXT&&b.nodeType!==t.nodeType.CDATA_SECTION||1===o.childNodes.length)){e.lastChild++,e=this.buildFrame(w,o.childNodes[e.lastChild-1]);break}e.lastChild++}else{if(e.terminateFrame(),!(e=e.parent))break;o=e.element,r=!0}}}}},{key:"cleanParser",value:function(){this.bnodes={},this.why=null}},{key:"buildFrame",value:function(e,n){var i=this.frameFactory(this,e,n);if(e&&(i.base=e.base,i.lang=e.lang),!n||n.nodeType===t.nodeType.TEXT||n.nodeType===t.nodeType.CDATA_SECTION)return i;var r=n.attributes,o=n.getAttributeNode("xml:base");null!=o&&(i.base=o.nodeValue,n.removeAttribute("xml:base"));var s=n.getAttributeNode("xml:lang");null!=s&&(i.lang=s.nodeValue,n.removeAttribute("xml:lang"));for(var a=r.length-1;a>=0;a--)if("xml"===r[a].nodeName.substr(0,3)){if("xmlns:"===r[a].name.slice(0,6)){var c=r[a].nodeValue;this.base&&(c=ah(c,this.base)),this.store.setPrefixForURI(r[a].name.slice(6),c)}n.removeAttributeNode(r[a])}return i}}]),t}();function Rd(t,e,n){var i,r,o,s=["INSERT","DELETE","WHERE"],a=yh("http://www.w3.org/ns/pim/patch#"),c=vd(e,e,n,n,null,null,"",null),u={},l=function(t,e,n,i,r){return"Line "+(e+1)+" of <"+t+">: Bad syntax:\n "+r+'\n at: "'+n.slice(i,i+30)+'"'};i=0;var h=e.sym(n+"#query");for(u.query=h;;){if((r=c.skipSpace(t,i))<0)return u;if(";"===t[r]){if((i=c.skipSpace(t,r+1))<0)return u;r=i}var d=!1;for(o=0;o<s.length;o++){var f=s[o];if(t.slice(r,r+f.length)===f){if((i=c.skipSpace(t,r+f.length))<0)throw l(c._thisDoc,c.lines,t,r+f.length,"found EOF, needed {...} after "+f);if(("INSERT"===f||"DELETE"===f)&&"DATA"===t.slice(i,i+4)){if((r=c.skipSpace(t,i+4))<0)throw l(c._thisDoc,c.lines,t,i+4,"needed {...} after INSERT DATA "+f);i=r}var p=[];if((r=c.node(t,i,p))<0)throw l(c._thisDoc,c.lines,t,i,"bad syntax or EOF in {...} after "+f);u[f.toLowerCase()]=p[0],e.add(h,a(f.toLowerCase()),p[0]),d=!0,i=r}}if(!d&&"@prefix"===t.slice(r,r+7)){if((i=c.directive(t,r))<0)throw l(c._thisDoc,c.lines,t,i,"bad syntax or EOF after @prefix ");i=c.checkDot(t,i),d=!0}if(!d)throw l(c._thisDoc,c.lines,t,r,"Unknown syntax at start of statememt: '"+t.slice(r).slice(0,20)+"'")}}function Id(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"text/turtle",r=arguments.length>4?arguments[4]:void 0;i=(i=i||"text/turtle").split(";")[0];try{if("text/n3"===i||"text/turtle"===i){var o=vd(e,e,n,n,null,null,"",null);o.loadBuf(t),c()}else if("application/rdf+xml"===i){var s=new Cd(e);s.parse(Ah(t),n,e.sym(n)),c()}else if("application/xhtml+xml"===i)jd(Ah(t,{contentType:"application/xhtml+xml"}),e,n),c();else if("text/html"===i)jd(Ah(t,{contentType:"text/html"}),e,n),c();else if("application/sparql-update"===i||"application/sparql-update-single-match"===i)Rd(t,e,n),c();else if("application/ld+json"===i)Sd(t,e,n,c);else{if("application/n-quads"!==i&&"application/nquads"!==i)throw void 0===i?new Error("contentType is undefined"):new Error("Don't know how to parse "+i+" yet");var a=new Ul({factory:xd});l(null,t)}}catch(t){u(t)}function c(){r&&r(null,e)}function u(t){if("application/ld+json"!==i||"application/n-quads"!==i||"application/nquads"!==i){if(!r){var o=new Error(t+" while trying to parse <"+n+"> as "+i);throw o.cause=t,o}r(t,e)}}function l(t,n){t&&r(t,e);try{a.parse(n,h)}catch(t){r(t,e)}}function h(t,n){n?e.add(n.subject,n.predicate,n.object,n.graph):r(t,e)}Id.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}}ic(Cd,"ns",{RDF:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",RDFS:"http://www.w3.org/2000/01/rdf-schema#"}),ic(Cd,"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 Td=Vt(ee());function Od(t){var e=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(t){return!1}}();return function(){var n,i=nc(t);if(e){var r=nc(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ec(this,n)}}var Nd={"text/n3":!0,"text/turtle":!0,"application/rdf+xml":!0,"application/xhtml+xml":!0,"text/html":!0,"application/ld+json":!0},Pd={rdf:"application/rdf+xml",owl:"application/rdf+xml",n3:"text/n3",ttl:"text/turtle",nt:"text/n3",acl:"text/n3",html:"text/html",xml:"text/xml"},Dd=function(t){return{link:yh("http://www.w3.org/2007/ont/link#",t),http:yh("http://www.w3.org/2007/ont/http#",t),httph:yh("http://www.w3.org/2007/ont/httph#",t),rdf:yh("http://www.w3.org/1999/02/22-rdf-syntax-ns#",t),rdfs:yh("http://www.w3.org/2000/01/rdf-schema#",t),dc:yh("http://purl.org/dc/elements/1.1/",t),ldp:yh("http://www.w3.org/ns/ldp#",t)}},Md=Dd(),Ud=Ga((function t(e,n){Xa(this,t),ic(this,"response",void 0),ic(this,"dom",void 0),this.response=e,this.dom=n}));ic(Ud,"pattern",void 0);var Ld=function(){Qa(e,Ud);var t=Od(e);function e(){return Xa(this,e),t.apply(this,arguments)}return Ga(e,[{key:"parse",value:function(t,e,n){var i=t.store;if(this.dom||(this.dom=Ah(e)),"parsererror"===this.dom.documentElement.nodeName)return t.failFetch(n,"Badly formed XML in "+n.resource.value,"parse_error");var r=new Cd(i);try{r.parse(this.dom,n.original.value,n.original)}catch(e){return t.failFetch(n,"Syntax error parsing RDF/XML! "+e,"parse_error")}return n.noMeta||i.add(n.original,Md.rdf("type"),Md.link("RDFDocument"),t.appNode),t.doneFetch(n,this.response)}}],[{key:"toString",value:function(){return"RDFXMLHandler"}},{key:"register",value:function(t){t.mediatypes["application/rdf+xml"]={q:.9}}}]),e}();Ld.pattern=new RegExp("application/rdf\\+xml");var Bd=function(){Qa(e,Ud);var t=Od(e);function e(){return Xa(this,e),t.apply(this,arguments)}return Ga(e,[{key:"parse",value:function(t,e,n){var i,r;this.dom||(this.dom=Ah(e));var o=t.store,s=this.dom.getElementsByTagName("title");s.length>0&&o.add(n.resource,Md.dc("title"),o.rdfFactory.literal(s[0].textContent),n.resource);for(var a=this.dom.getElementsByTagName("link"),c=a.length-1;c>=0;c--)r=!1,(i=a[c].getAttribute("rel"))||(i=a[c].getAttribute("rev"),r=!0),i&&t.linkData(n.original,i,a[c].getAttribute("href"),n.resource,r);for(var u=this.dom.getElementsByTagName("script"),l=0;l<u.length;l++){var h=u[l].getAttribute("type");Nd[h]&&(Id(u[l].textContent,o,n.original.value,h),Id(u[l].textContent,o,n.original.value,h))}if(n.noMeta||o.add(n.resource,Md.rdf("type"),Md.link("WebPage"),t.appNode),!n.noRDFa&&jd)try{jd(this.dom,o,n.original.value)}catch(e){return t.failFetch(n,"Error trying to parse "+n.resource+" as RDFa:\n"+e+":\n"+e.stack,"parse_error")}return t.doneFetch(n,this.response)}}],[{key:"toString",value:function(){return"XHTMLHandler"}},{key:"register",value:function(t){t.mediatypes["application/xhtml+xml"]={}}}]),e}();Bd.pattern=new RegExp("application/xhtml");var Jd=function(){Qa(e,Ud);var t=Od(e);function e(){return Xa(this,e),t.apply(this,arguments)}return Ga(e,[{key:"parse",value:function(t,n,i){for(var r=Ah(n),o=0;o<r.childNodes.length;o++){var s=r.childNodes[o];if(e.isElement(s)){var a=s.namespaceURI;if(a&&a===a.rdf)return t.addStatus(i.req,"Has XML root element in the RDF namespace, so assume RDF/XML."),new Ld(this.response,r).parse(t,n,i);break}}if(r.doctype&&"html"===r.doctype.name&&r.doctype.publicId.match(/^-\/\/W3C\/\/DTD XHTML/)&&r.doctype.systemId.match(/http:\/\/www.w3.org\/TR\/xhtml/))return t.addStatus(i.req,"Has XHTML DOCTYPE. Switching to XHTML Handler.\n"),new Bd(this.response,r).parse(t,n,i);var c=r.getElementsByTagName("html")[0];if(c){var u=c.getAttribute("xmlns");if(u&&u.match(/^http:\/\/www.w3.org\/1999\/xhtml/))return t.addStatus(i.req,"Has a default namespace for XHTML. Switching to XHTMLHandler.\n"),new Bd(this.response,r).parse(t,n,i)}return t.failFetch(i,"Unsupported dialect of XML: not RDF or XHTML namespace, etc.\n"+n.slice(0,80),901)}}],[{key:"toString",value:function(){return"XMLHandler"}},{key:"register",value:function(t){t.mediatypes["text/xml"]={q:.5},t.mediatypes["application/xml"]={q:.5}}},{key:"isElement",value:function(t){return t.nodeType===Node.ELEMENT_NODE}}]),e}();Jd.pattern=new RegExp("(text|application)/(.*)xml");var $d=function(){Qa(e,Ud);var t=Od(e);function e(){return Xa(this,e),t.apply(this,arguments)}return Ga(e,[{key:"parse",value:function(t,e,n){var i=t.store;if(qd(e))return t.addStatus(n.req,"Has an XML declaration. We'll assume it's XHTML as the content-type was text/html.\n"),new Bd(this.response).parse(t,e,n);if(function(t){var e=t.indexOf("<!DOCTYPE html"),n=t.indexOf(">");return!(-1===e||-1===n||e>n)&&-1!==t.substr(e,n-e).indexOf("XHTML")}(e))return t.addStatus(n.req,"Has XHTML DOCTYPE. Switching to XHTMLHandler.\n"),new Bd(this.response).parse(t,e,n);if(function(t){return!!t.match(/[^(<html)]*<html\s+[^<]*xmlns=['"]http:\/\/www.w3.org\/1999\/xhtml["'][^<]*>/)}(e))return t.addStatus(n.req,"Has default namespace for XHTML, so switching to XHTMLHandler.\n"),new Bd(this.response).parse(t,e,n);var r=new RegExp("<title>([\\s\\S]+?)</title>","im").exec(e);return r&&i.add(n.resource,Md.dc("title"),i.rdfFactory.literal(r[1]),n.resource),i.add(n.resource,Md.rdf("type"),Md.link("WebPage"),t.appNode),t.addStatus(n.req,"non-XML HTML document, not parsed for data."),t.doneFetch(n,this.response)}}],[{key:"toString",value:function(){return"HTMLHandler"}},{key:"register",value:function(t){t.mediatypes["text/html"]={q:.9}}}]),e}();$d.pattern=new RegExp("text/html");var Hd=function(){Qa(e,Ud);var t=Od(e);function e(){return Xa(this,e),t.apply(this,arguments)}return Ga(e,[{key:"parse",value:function(t,e,n,i){var r=t.store;return new Promise((function(o){try{Sd(e,r,n.original.value,(function(){o(t.doneFetch(n,i))}))}catch(e){o(t.failFetch(n,"Error trying to parse "+n.resource+" as JSON-LD:\n"+e,"parse_error",i))}}))}}],[{key:"toString",value:function(){return"JsonLdHandler"}},{key:"register",value:function(t){t.mediatypes["application/ld+json"]={q:.9}}}]),e}();Hd.pattern=/application\/ld\+json/;var zd=function(){Qa(e,Ud);var t=Od(e);function e(){return Xa(this,e),t.apply(this,arguments)}return Ga(e,[{key:"parse",value:function(t,e,n){return qd(e)?(t.addStatus(n.req,"Warning: "+n.resource+" has an XML declaration. We'll assume it's XML but its content-type wasn't XML.\n"),new Jd(this.response).parse(t,e,n)):e.slice(0,500).match(/xmlns:/)?(t.addStatus(n.req,"May have an XML namespace. We'll assume it's XML but its content-type wasn't XML.\n"),new Jd(this.response).parse(t,e,n)):(t.addStatus(n.req,"Plain text document, no known RDF semantics."),t.doneFetch(n,this.response))}}],[{key:"toString",value:function(){return"TextHandler"}},{key:"register",value:function(t){t.mediatypes["text/plain"]={q:.5}}}]),e}();zd.pattern=new RegExp("text/plain");var Kd=function(){Qa(e,Ud);var t=Od(e);function e(){return Xa(this,e),t.apply(this,arguments)}return Ga(e,[{key:"parse",value:function(t,e,n,i){var r=t.store,o=vd(r,r,n.original.value,n.original.value,null,null,"",null);try{o.loadBuf(e)}catch(e){return t.failFetch(n,"Error trying to parse "+n.resource+" as Notation3:\n"+e,"parse_error",i)}return t.addStatus(n.req,"N3 parsed: "+o.statementCount+" triples in "+o.lines+" lines."),t.store.add(n.original,Md.rdf("type"),Md.link("RDFDocument"),t.appNode),t.doneFetch(n,this.response)}}],[{key:"toString",value:function(){return"N3Handler"}},{key:"register",value:function(t){t.mediatypes["text/n3"]={q:"1.0"},t.mediatypes["text/turtle"]={q:1}}}]),e}();Kd.pattern=new RegExp("(application|text)/(x-)?(rdf\\+)?(n3|turtle)");var Wd={RDFXMLHandler:Ld,XHTMLHandler:Bd,XMLHandler:Jd,HTMLHandler:$d,TextHandler:zd,N3Handler:Kd,JsonLdHandler:Hd};function qd(t){return!!t.match(/\s*<\?xml\s+version\s*=[^<>]+\?>/)}var Vd=function(){function t(e){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Xa(this,t),ic(this,"store",void 0),ic(this,"timeout",void 0),ic(this,"_fetch",void 0),ic(this,"mediatypes",void 0),ic(this,"appNode",void 0),ic(this,"requested",void 0),ic(this,"timeouts",void 0),ic(this,"redirectedTo",void 0),ic(this,"fetchQueue",void 0),ic(this,"fetchCallbacks",void 0),ic(this,"nonexistent",void 0),ic(this,"lookedUp",void 0),ic(this,"handlers",void 0),ic(this,"ns",void 0),ic(this,"fireCallbacks",void 0),this.store=e||new Yh,this.ns=Dd(this.store.rdfFactory),this.timeout=i.timeout||3e4,this._fetch=i.fetch||"undefined"!=typeof global&&(global.solidFetcher||global.solidFetch)||"undefined"!=typeof window&&(window.solidFetcher||window.solidFetch)||Td.default,!this._fetch)throw new Error("No _fetch function available for Fetcher");this.appNode=this.store.rdfFactory.blankNode(),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}},kh(this,["request","fail","refresh","retract","done"]),Object.keys(i.handlers||Wd).map((function(t){return n.addHandler(Wd[t])}))}var e,n;return Ga(t,[{key:"load",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(n=Object.assign({},n),t instanceof Array)return Promise.all(t.map((function(t){return e.load(t,Object.assign({},n))})));var i=t,r=ac(i);r=r.split("#")[0],n=this.initFetchOptions(r,n);var o=this.initFetchOptions(r,n);return this.pendingFetchPromise(r,o.baseURI,o)}},{key:"pendingFetchPromise",value:function(t,e,n){var i,r=this;return!n.force&&this.fetchQueue[e]?i=this.fetchQueue[e]:(i=Promise.race([this.setRequestTimeout(t,n),this.fetchUri(t,n)]),this.fetchQueue[e]=i,this.cleanupFetchRequest(e,void 0,this.timeout)),i.then((function(e){return t in r.timeouts&&(r.timeouts[t].forEach(clearTimeout),delete r.timeouts[t]),e}))}},{key:"cleanupFetchRequest",value:function(t,e,n){var i=this;void 0!==e&&console.warn("_options is deprecated"),this.timeouts[t]=(this.timeouts[t]||[]).concat(setTimeout((function(){i.isPending(t)||delete i.fetchQueue[t]}),n))}},{key:"initFetchOptions",value:function(e,n){var i=this.store;!n.method||"GET"===n.method.toUpperCase()||(n.force=!0),n.resource=i.rdfFactory.namedNode(e),n.baseURI=n.baseURI||e,n.original=i.rdfFactory.namedNode(n.baseURI),n.req=i.bnode(),n.headers=n.headers||new Td.Headers,n.contentType&&(n.headers["content-type"]=n.contentType),n.force&&(n.cache="no-cache");var r=this.acceptString();n.headers.accept=r;var o=t.offlineOverride(e);n.requestedURI=o,t.setCredentials(o,n);var s=t.proxyIfNecessary(o);return o!==s&&(n.proxyUsed=!0),n.actualProxyURI=s,n}},{key:"fetchUri",value:function(e,n){var i=this;if(!e)return Promise.reject(new Error("Cannot fetch an empty uri"));if(t.unsupportedProtocol(e))return this.failFetch(n,"fetcher: Unsupported protocol","unsupported_protocol");var r=this.getState(e);if(n.force)delete this.nonexistent[e];else{if("fetched"===r)return Promise.resolve(this.doneFetch(n,{status:200,ok:!0,statusText:"Already loaded into quadstore."}));if("failed"===r&&404===this.requested[e]){var o="Previously failed: "+this.requested[e],s={url:e,status:this.requested[e],statusText:o,responseText:o,headers:new Td.Headers,ok:!1,body:null,bodyUsed:!1,size:0,timeout:0};return this.failFetch(n,o,this.requested[e],s)}}this.fireCallbacks("request",[e]),this.requested[e]=!0,n.noMeta||this.saveRequestMetadata(e,n);var a=n.actualProxyURI;return this._fetch(a,n).then((function(t){return i.handleResponse(t,e,n)}),(function(t){var r={url:a,status:999,statusText:(t.name||"network failure")+": "+(t.errno||t.code||t.type),responseText:t.message,headers:new Td.Headers,ok:!1,body:null,bodyUsed:!1,size:0,timeout:0};return console.log("Fetcher: <"+a+"> Non-HTTP fetch exception: "+t),i.handleError(r,e,n)}))}},{key:"nowOrWhenFetched",value:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=ac(t);"function"==typeof e?n=e:void 0===e||(vc(e)?i.referringTerm=e:i=e),this.load(r,i).then((function(t){if(n)if(t)if(t.ok)n(!0,"OK",t);else{var e="HTTP error: Status "+t.status+" ("+t.statusText+")";t.responseText&&(e+=" "+t.responseText),console.log(e+" fetching "+r),n(!1,e,t)}else{var i="@@ nowOrWhenFetched: no response object!";console.log(i),n(!1,i)}}),(function(t){var e=t.message||t.statusText;e="Failed to load <"+r+"> "+e,console.log(e),t.response&&t.response.status&&(e+=" status: "+t.response.status),n(!1,e,t.response)}))}},{key:"addStatus",value:function(t,e){var n=new Date;e="["+n.getHours()+":"+n.getMinutes()+":"+n.getSeconds()+"."+n.getMilliseconds()+"] "+e;var i=this.store,r=i.the(t,this.ns.link("status"));lc(r)?r.append(i.rdfFactory.literal(e)):mh("web.js: No list to add to: "+r+","+e)}},{key:"failFetch",value:function(t,e,n,i){this.addStatus(t.req,e),t.noMeta||this.store.add(t.original,this.ns.link("error"),this.store.rdfFactory.literal(e));var r=(t.method||"GET").toUpperCase();("GET"===r||"HEAD"===r)&&(t.resource.equals(t.original),this.requested[rh(t.original.value)]=n,this.fireCallbacks("fail",[t.original.value,e]));var o=new Error("Fetcher: "+e);return o.status=n,o.statusText=e,o.response=i,Promise.reject(o)}},{key:"linkData",value:function(t,e,n,i,r){if(n){var o,s=this.store,a=s.rdfFactory.namedNode(ah(n,t.value));if("alternate"===e||"seeAlso"===e||"meta"===e||"describedby"===e){if(a.value===t.value)return;o=this.ns.rdfs("seeAlso")}else o=s.rdfFactory.namedNode("type"===e?"http://www.w3.org/1999/02/22-rdf-syntax-ns#type":ah(encodeURIComponent(e),"http://www.iana.org/assignments/link-relations/"));r?s.add(a,o,t,i):s.add(t,o,a,i)}}},{key:"parseLinkHeader",value:function(t,e,n){if(t){var i=/[^\(\)<>@,;:"\/\[\]\?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*"))/g,r=t.match(/<[^>]*>\s*(\s*;\s*[^()<>@,;:"/[\]?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*")))*(,|$)/g);if(null!=r)for(var o=0;o<r.length;o++){var s=r[o].split(">"),a=s[0].substring(1),c=s[1].match(i);if(null==c)return;for(var u=0;u<c.length;u++){var l=c[u].split("=")[1].replace(/["']/g,"");this.linkData(e,l,a,n)}}}}},{key:"doneFetch",value:function(t,e){return this.addStatus(t.req,"Done."),this.requested[t.original.value]="done",this.fireCallbacks("done",[t.original.value]),e.req=t.req,e}},{key:"nowKnownAs",value:function(t,e){this.lookedUp[t.value]?this.lookedUp[e.value]||this.lookUpThing(e,t):this.lookedUp[e.value]&&(this.lookedUp[t.value]||this.lookUpThing(t,e))}},{key:"putBack",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=ac(t),r=new bc(i).doc();return n.contentType=n["content-type"]||n["Content-Type"]||n.contentType||"text/turtle","application/ld+json"===n.contentType?new Promise((function(i,o){Ih(r,e.store,r.uri,n.contentType,(function(r,s){r?o(r):(n.data=s,e.webOperation("PUT",t,n).then((function(t){return i(t)})).catch((function(t){return o(t)})))}))})):(n.data=Ih(r,this.store,r.value,n.contentType),this.webOperation("PUT",i,n))}},{key:"webCopy",value:function(t,e,n){var i=this;return this.webOperation("GET",t).then((function(t){return i.webOperation("PUT",e,{data:t.responseText,contentType:n})}))}},{key:"delete",value:function(t,e){var n=this;return this.webOperation("DELETE",t,e).then((function(e){return n.requested[t]=404,n.nonexistent[t]=!0,n.unload(n.store.rdfFactory.namedNode(t)),e}))}},{key:"createIfNotExists",value:(e=Yl.default.mark((function t(e){var n,i,r,o,s=arguments;return Yl.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=s.length>1&&void 0!==s[1]?s[1]:"text/turtle",i=s.length>2&&void 0!==s[2]?s[2]:"",r=this,t.prev=3,t.next=6,r.load(e);case 6:o=t.sent,t.next=29;break;case 9:if(t.prev=9,t.t0=t.catch(3),404!==t.t0.response.status){t.next=27;break}return console.log("createIfNotExists: doc does NOT exist, will create... "+e),t.prev=13,t.next=16,r.webOperation("PUT",e.value,{data:i,contentType:n});case 16:o=t.sent,t.next=23;break;case 19:throw t.prev=19,t.t1=t.catch(13),console.log("createIfNotExists doc FAILED: "+e+": "+t.t1),t.t1;case 23:return delete r.requested[e.value],t.abrupt("return",o);case 27:throw console.log("createIfNotExists doc load error NOT 404: "+e+": "+t.t0),t.t0;case 29:return t.abrupt("return",o);case 30:case"end":return t.stop()}}),t,this,[[3,9],[13,19]])})),n=function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function s(t){Xl(o,i,r,s,a,"next",t)}function a(t){Xl(o,i,r,s,a,"throw",t)}s(void 0)}))},function(t){return n.apply(this,arguments)})},{key:"createContainer",value:function(t,e,n){var i={"content-type":"text/turtle",link:this.ns.ldp("BasicContainer")+'; rel="type"'};e&&(i.slug=e);var r={headers:i};return n&&(r.body=n),this.webOperation("POST",t,r)}},{key:"invalidateCache",value:function(t){var e=ac(t),n=this;if(n.fetchQueue&&n.fetchQueue[e]&&(console.log("Internal error - fetchQueue exists "+e),"resolved"===n.fetchQueue[e].PromiseStatus?delete n.fetchQueue[e]:(delete n.fetchQueue[e],console.log("*** Fetcher: pending fetchQueue deleted "+e))),n.requested[e]&&"done"!==n.requested[e]&&"failed"!==n.requested[e]&&404!==n.requested[e]){var i="Rdflib: fetcher: Destructive operation on <".concat(n.requested[e],"> file being fetched! ")+e;console.error(i)}else delete n.requested[e],delete n.nonexistent[e]}},{key:"webOperation",value:function(e,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=ac(n);i.method=e,i.body=i.data||i.body,i.force=!0;var o=this;if(i.body&&!i.contentType)throw new Error("Web operation sending data must have a defined contentType.");return i.contentType&&(i.headers=i.headers||{},i.headers["content-type"]=i.contentType),t.setCredentials(r,i),new Promise((function(t,n){o._fetch(r,i).then((function(i){if(i.ok)"PUT"!==e&&"PATCH"!==e&&"POST"!==e&&"DELETE"!==e||o.invalidateCache(r),i.text?i.text().then((function(e){i.responseText=e,t(i)})):t(i);else{var s="Web error: "+i.status;i.statusText&&(s+=" ("+i.statusText+")"),s+=" on "+e+" of <"+r+">",i.responseText&&(s+=": "+i.responseText);var a=new Error(s);a.response=i,n(a)}}),(function(t){n(new Error("Fetch error for "+e+" of <"+r+">:"+t))}))}))}},{key:"lookUpThing",value:function(t,e){var n=this,i=this.store.uris(t);return(i=i.map((function(t){return rh(t)}))).forEach((function(t){n.lookedUp[t]=!0})),this.load(i,{referringTerm:e})}},{key:"getHeader",value:function(t,e){for(var n=this.store,i=t.value,r=n.each(void 0,this.ns.link("requestedURI"),n.rdfFactory.literal(i)),o=0;o<r.length;o++){var s=r[o];if(void 0!==s){var a=n.any(s,this.ns.link("response"));if(void 0!==a&&n.anyValue(a,this.ns.http("status"))&&n.anyValue(a,this.ns.http("status")).startsWith("2")){var c=n.each(a,this.ns.httph(e.toLowerCase()));return c.length?c.map((function(t){return t.value})):[]}}}}},{key:"saveRequestMetadata",value:function(t,e){var n=e.req,i=this.store,r=e.referringTerm;this.addStatus(e.req,"Accept: "+e.headers.accept),vc(r)&&i.add(i.rdfFactory.namedNode(t),this.ns.link("requestedBy"),r,this.appNode),e.original&&e.original.value!==t&&i.add(n,this.ns.link("orginalURI"),i.rdfFactory.literal(e.original.value),this.appNode);var o=new Date,s="["+o.getHours()+":"+o.getMinutes()+":"+o.getSeconds()+"] ";i.add(n,this.ns.rdfs("label"),i.rdfFactory.literal(s+" Request for "+t),this.appNode),i.add(n,this.ns.link("requestedURI"),i.rdfFactory.literal(t),this.appNode),i.add(n,this.ns.link("status"),i.collection(),this.appNode)}},{key:"saveResponseMetadata",value:function(t,e){var n=this,i=this.store,r=i.bnode();return i.add(e.req,this.ns.link("response"),r,r),i.add(r,this.ns.http("status"),i.rdfFactory.literal(t.status),r),i.add(r,this.ns.http("statusText"),i.rdfFactory.literal(t.statusText),r),t.headers.forEach((function(t,o){var s;i.add(r,n.ns.httph(o),n.store.rdfFactory.literal(t),r),"content-type"===o&&i.add(e.resource,n.ns.rdf("type"),i.rdfFactory.namedNode((s=t,s=s.split(";")[0].trim(),new bc("http://www.w3.org/ns/iana/media-types/"+s+"#Resource")).value),r)})),r}},{key:"objectRefresh",value:function(t){var e=this.store.uris(t);if(void 0!==e)for(var n=0;n<e.length;n++)this.refresh(this.store.rdfFactory.namedNode(rh(e[n])))}},{key:"refresh",value:function(t,e){this.fireCallbacks("refresh",arguments),this.nowOrWhenFetched(t,{force:!0,clearPreviousData:!0},e)}},{key:"refreshIfExpired",value:function(t,e){var n=this.getHeader(t,"Expires");!n||new Date(n[0]).getTime()<=(new Date).getTime()?this.refresh(t,e):e(!0,"Not expired",{})}},{key:"retract",value:function(t){this.store.removeMany(void 0,void 0,void 0,t),t.value&&delete this.requested[rh(t.value)],this.fireCallbacks("retract",arguments)}},{key:"getState",value:function(t){return void 0===this.requested[t]?"unrequested":!0===this.requested[t]?"requested":"done"===this.requested[t]?"fetched":"redirected"===this.requested[t]?this.getState(this.redirectedTo[t]):"failed"}},{key:"isPending",value:function(t){return!0===this.requested[t]}},{key:"unload",value:function(t){this.store.removeDocument(t),delete this.requested[t.value]}},{key:"addHandler",value:function(t){this.handlers.push(t),t.register(this)}},{key:"retryNoCredentials",value:function(t,e){console.log("Fetcher: CORS: RETRYING with NO CREDENTIALS for "+e.resource),e.retriedWithNoCredentials=!0,delete this.requested[t],delete this.fetchQueue[t];var n=Object.assign({},e,{credentials:"omit"});return this.addStatus(e.req,"Abort: Will retry with credentials SUPPRESSED to see if that helps"),this.load(t,n)}},{key:"isCrossSite",value:function(t){if("undefined"==typeof document||!document.location)return!1;var e=sh,n=""+document.location;return(e(n)&&e(t)&&e(n))!==e(t)}},{key:"handleError",value:function(e,n,i){if(this.isCrossSite(n)){if(i.credentials&&"include"===i.credentials&&!i.retriedWithNoCredentials)return this.retryNoCredentials(n,i);var r=t.crossSiteProxy(n);if(r&&!i.proxyUsed)return console.log("web: Direct failed so trying proxy "+r),this.redirectToProxy(r,i)}var o;return e instanceof Error?o="Fetch error: "+e.message:(o=e.statusText,e.responseText&&(o+=" ".concat(e.responseText))),this.failFetch(i,o,e.status||998,e)}},{key:"addType",value:function(t,e,n,i){var r=e;if(i){var o=n.any(r,this.ns.link("requestedURI"));o&&o.value!==i&&n.add(n.rdfFactory.namedNode(i),this.ns.rdf("type"),t,this.appNode)}for(;;){var s=n.any(r,this.ns.link("requestedURI"));if(s&&s.value&&n.add(n.rdfFactory.namedNode(s.value),this.ns.rdf("type"),t,this.appNode),!(r=n.any(void 0,n.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#redirectedRequest"),r)))break;var a=n.any(r,n.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#response"));if(!a)break;var c=n.any(a,n.rdfFactory.namedNode("http://www.w3.org/2007/ont/http#status"));if(!c)break;if("301"!==c&&"302"!==c)break}}},{key:"handleResponse",value:function(t,e,n){var i=this,r=this.store,o=t.headers,s=n.req,a=this.saveResponseMetadata(t,n),c=this.normalizedContentType(n,o)||"",u=o.get("content-location");if(0===t.status)return console.log("Masked error - status 0 for "+e),this.handleError(t,e,n);if(t.status>=400)return 404===t.status&&(this.nonexistent[n.original.value]=!0,this.nonexistent[e]=!0),this.saveErrorResponse(t,a).then((function(){return i.failFetch(n,n.resource+" "+t.statusText,t.status,t)}));var l=null,h=null;if(u&&(h=ah(u,e))!==e&&(l=h),200===t.status){this.addType(this.ns.link("Document"),s,r,e),l&&this.addType(this.ns.link("Document"),s,r,l),n.clearPreviousData&&r.removeDocument(n.resource);var d=c.includes("image/")||c.includes("application/pdf");c&&d&&(this.addType(r.rdfFactory.namedNode("http://purl.org/dc/terms/Image"),s,r,e),l&&this.addType(r.rdfFactory.namedNode("http://purl.org/dc/terms/Image"),s,r,l))}if(u){if(!n.force&&l&&"done"===this.requested[h])return this.doneFetch(n,t);this.requested[h]=!0}this.parseLinkHeader(o.get("link"),n.original,s);var f=this.handlerForContentType(c,t);return f?t.text().then((function(e){return t.responseText=e,f.parse(i,e,n,t)})):(this.addStatus(s,"Fetch over. No data handled."),this.doneFetch(n,t))}},{key:"saveErrorResponse",value:function(t,e){var n=this,i=this.store;return t.text().then((function(t){t.length>10&&i.add(e,n.ns.http("content"),i.rdfFactory.literal(t),e)}))}},{key:"handlerForContentType",value:function(t,e){if(!t)return null;var n=this.handlers.find((function(e){return t.match(e.pattern)}));return n?new n(e):null}},{key:"guessContentType",value:function(t){return Pd[t.split(".").pop()]}},{key:"normalizedContentType",value:function(t,e){if(t.forceContentType)return t.forceContentType;var n=e.get("content-type");if(!n||n.includes("application/octet-stream")){var i=this.guessContentType(t.resource.value);if(i)return i}var r=ch(t.resource.value);return!n&&["file","chrome"].includes(r)?"text/xml":n}},{key:"redirectToProxy",value:function(t,e){var n=this;this.addStatus(e.req,"BLOCKED -> Cross-site Proxy to <"+t+">"),e.proxyUsed=!0;var i=this.store,r=e.req;e.noMeta||(i.add(r,this.ns.link("redirectedTo"),i.rdfFactory.namedNode(t),r),this.addStatus(r,"redirected to new request")),this.requested[e.resource.value]="redirected",this.redirectedTo[e.resource.value]=t;var o=Object.assign({},e);return o.baseURI=e.resource.value,this.fetchUri(t,o).then((function(t){return o.noMeta||i.add(r,n.ns.link("redirectedRequest"),o.req,n.appNode),t}))}},{key:"setRequestTimeout",value:function(t,e){var n=this;return new Promise((function(i){n.timeouts[t]=(n.timeouts[t]||[]).concat(setTimeout((function(){!n.isPending(t)||e.retriedWithNoCredentials||e.proxyUsed||i(n.failFetch(e,"Request to ".concat(t," timed out"),"timeout"))}),n.timeout))}))}},{key:"addFetchCallback",value:function(t,e){this.fetchCallbacks[t]?this.fetchCallbacks[t].push(e):this.fetchCallbacks[t]=[e]}},{key:"acceptString",value:function(){var t="";for(var e in this.mediatypes)for(var n in""!==t&&(t+=", "),t+=e,this.mediatypes[e])t+=";"+n+"="+this.mediatypes[e][n];return t}}],[{key:"crossSiteProxy",value:function(e){return t.crossSiteProxyTemplate?t.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(e)):void 0}},{key:"offlineOverride",value:function(t){var e,n=t;return"undefined"!=typeof window&&window.panes&&(e=window.panes.UI)&&e.preferences&&e.preferences.get("offlineModeUsingLocalhost")&&"http://"===n.slice(0,7)&&"localhost/"!==n.slice(7,17)&&(n="http://localhost/"+n.slice(7),mh("Localhost kludge for offline use: actually getting <"+n+">")),n}},{key:"proxyIfNecessary",value:function(e){var n;if("undefined"!=typeof window&&window.panes&&(n=window.panes.UI)&&n.isExtension)return e;if("undefined"!=typeof $SolidTestEnvironment&&$SolidTestEnvironment.localSiteMap){var i=function t(e,n){var i=n[e.shift()];return i?"string"==typeof i?i+e.join("/"):e?t(e,i):null:null}(e.split("/").slice(2),$SolidTestEnvironment.localSiteMap);if(i)return i}return t.crossSiteProxyTemplate&&"undefined"!=typeof document&&document.location&&"https:"===(""+document.location).slice(0,6)&&"http:"===e.slice(0,5)?t.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(e)):e}},{key:"unsupportedProtocol",value:function(t){var e=ch(t);return"tel"===e||"mailto"===e||"urn"===e}},{key:"setCredentials",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};void 0===e.credentials&&(e.credentials=void 0!==e.withCredentials?e.withCredentials?"include":"omit":"include")}}]),t}();function Gd(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function Xd(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Gd(Object(n),!0).forEach((function(e){ic(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Gd(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}ic(Vd,"HANDLERS",void 0),ic(Vd,"CONTENT_TYPE_BY_EXT",void 0),ic(Vd,"crossSiteProxyTemplate",void 0),Vd.HANDLERS=Wd,Vd.CONTENT_TYPE_BY_EXT=Pd;var Yd,Zd=Xd(Xd({},xd),{},{fetcher:function(t,e){return new Vd(t,e)},graph:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return new Yh(t,e||{rdfFactory:xd})},lit:function(t,e,n){return this.literal(""+t,e||n)},st:function(t,e,n,i){return this.quad(t,e,n,i)}}),Qd={};for(Yd in Zd)"function"==typeof Zd[Yd]&&(Qd[Yd]=Zd[Yd].bind(Zd));var tf=Qd.fetcher,ef=Qd.graph,nf=Qd.namedNode;new Uh;var rf=(t,e)=>{const n=t[e.predicate.uri];return Ht($t({},t),{[e.predicate.uri]:n?[...n,e.subject.value]:[e.subject.value]})},of=(t,e)=>{const n=t[e.predicate.uri];return Ht($t({},t),{[e.predicate.uri]:n?[...n,e.object.value]:[e.object.value]})},sf=class{constructor(t,e){this.uri=t,this.store=e}label(){const t=this.anyValue("http://www.w3.org/2006/vcard/ns#fn","http://xmlns.com/foaf/0.1/name","http://xmlns.com/foaf/0.1/nick","https://schema.org/name","http://schema.org/name","http://purl.org/dc/terms/title","http://purl.org/dc/elements/1.1/title","http://www.w3.org/2000/01/rdf-schema#label","https://www.w3.org/ns/activitystreams#name","http://schema.org/caption","https://schema.org/caption");return null!=t?t:this.uri}literals(){const t=this.store.statementsMatching(nf(this.uri)).filter((t=>fc(t.object))).reduce(of,{});return Object.keys(t).map((e=>({predicate:e,values:t[e]})))}relations(){const t=this.store.statementsMatching(nf(this.uri)).filter((t=>vc(t.object)&&!t.predicate.sameTerm(nf("http://www.w3.org/1999/02/22-rdf-syntax-ns#type")))).reduce(of,{});return Object.keys(t).map((e=>({predicate:e,uris:t[e]})))}reverseRelations(){const t=this.store.statementsMatching(void 0,void 0,nf(this.uri)).reduce(rf,{});return Object.keys(t).map((e=>({predicate:e,uris:t[e]})))}anyValue(...t){let e;return t.some((t=>(e=this.store.anyValue(nf(this.uri),nf(t)),Boolean(e)))),e}description(){return this.anyValue("http://purl.org/dc/terms/description","http://purl.org/dc/elements/1.1/description","http://schema.org/description","https://schema.org/description","https://schema.org/text","http://www.w3.org/2000/01/rdf-schema#comment","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#content","http://www.w3.org/2006/vcard/ns#note")}picture(){const t=this.anyValue("http://schema.org/image","https://schema.org/image","http://schema.org/logo","https://schema.org/logo","http://www.w3.org/2006/vcard/ns#hasPhoto","http://www.w3.org/2006/vcard/ns#photo","http://www.w3.org/2006/vcard/ns#hasLogo","http://www.w3.org/2006/vcard/ns#logo","http://xmlns.com/foaf/0.1/img","http://xmlns.com/foaf/0.1/depiction","http://xmlns.com/foaf/0.1/thumbnail");return t?{url:t}:this.findActivityStreamsPicture()}findActivityStreamsPicture(){const t=this.store.any(nf(this.uri),nf("https://www.w3.org/ns/activitystreams#image"))||this.store.any(nf(this.uri),nf("https://www.w3.org/ns/activitystreams#icon"));if(!(t&&(e=t,dc(e)&&"termType"in e&&"BlankNode"===e.termType||vc(t))))return null;var e;const n=this.store.anyValue(t,nf("https://www.w3.org/ns/activitystreams#url"));return n?{url:n}:null}types(){const t=this.store.findTypeURIs(nf(this.uri));return Object.keys(t).map((t=>{return{uri:t,label:(e=t,e.includes("#")?e.substring(e.lastIndexOf("#")+1):e.substring(e.lastIndexOf("/")+1))};var e}))}assume(t){return new t(this.uri,this.store)}},af=class extends sf{constructor(t,e){super(t,e),this.uri=t,this.store=e}subjects(){const t=this.store.statementsMatching(null,null,null,nf(this.uri)).filter((t=>vc(t.subject))).map((t=>t.subject.value)),e=new Set(t);return e.delete(this.uri),[...e].map((t=>({uri:t})))}};
2
+ /*!
3
+ * Copyright (c) 2016-2021 Digital Bazaar, Inc. All rights reserved.
4
+ */
5
+ /*!
6
+ * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
7
+ */
8
+ /*!
9
+ * The buffer module from node.js, for the browser.
10
+ *
11
+ * @author Feross Aboukhadijeh <http://feross.org>
12
+ * @license MIT
13
+ */
14
+ /*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
15
+ */
16
+ /*! Mike Samuel (c) 2009 | code.google.com/p/json-sans-eval
17
+ */
18
+ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
19
+ /*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
20
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
21
+ /**
22
+ * A JavaScript implementation of the JSON-LD API.
23
+ *
24
+ * @author Dave Longley
25
+ *
26
+ * @license BSD 3-Clause License
27
+ * Copyright (c) 2011-2019 Digital Bazaar, Inc.
28
+ * All rights reserved.
29
+ *
30
+ * Redistribution and use in source and binary forms, with or without
31
+ * modification, are permitted provided that the following conditions are met:
32
+ *
33
+ * Redistributions of source code must retain the above copyright notice,
34
+ * this list of conditions and the following disclaimer.
35
+ *
36
+ * Redistributions in binary form must reproduce the above copyright
37
+ * notice, this list of conditions and the following disclaimer in the
38
+ * documentation and/or other materials provided with the distribution.
39
+ *
40
+ * Neither the name of the Digital Bazaar, Inc. nor the names of its
41
+ * contributors may be used to endorse or promote products derived from
42
+ * this software without specific prior written permission.
43
+ *
44
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
45
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
46
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
47
+ * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
48
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
49
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
50
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
51
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
52
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
53
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
54
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
55
+ */
56
+ /**
57
+ * Removes the @preserve keywords from expanded result of framing.
58
+ *
59
+ * @param input the framed, framed output.
60
+ * @param options the framing options used.
61
+ *
62
+ * @return the resulting output.
63
+ */
64
+ // disallow aliasing @context and @preserve
65
+ // remove @preserve
66
+ // remove @preserve from results
67
+ const cf=()=>new class{constructor(){this.session=new class{get authenticatedFetch(){return this._authenticatedFetch}constructor(){this.session=new qa.Session,this._authenticatedFetch=this.session.fetch}handleIncomingRedirect(){return Xt(this,null,(function*(){return this.session.handleIncomingRedirect({restorePreviousSession:!1})}))}login(t){return Xt(this,null,(function*(){return this.session.login({oidcIssuer:t,redirectUrl:window.location.href,clientName:`Pod OS at ${window.location.host}`})}))}logout(){return Xt(this,null,(function*(){return this.session.logout()}))}trackSession(t){this.session.onLogin((()=>t(this.session.info))),this.session.onLogout((()=>t(this.session.info))),this.session.onSessionRestore((()=>t(this.session.info))),t(this.session.info)}},this.store=new class{constructor(t){this.graph=ef(),this.fetcher=tf(this.graph,{fetch:t.authenticatedFetch})}fetch(t){return this.fetcher.load(nf(t),{force:!0})}get(t){return new sf(t,this.graph)}}(this.session),this.fileFetcher=new class{constructor(t){this.session=t}fetchFile(t){return Xt(this,null,(function*(){const e=yield this.session.authenticatedFetch(t);if(e.ok){const n=yield e.blob();return new class{constructor(t,e){this.url=t,this.data=e}blob(){return this.data}}(t,n)}return new class{constructor(t,e){this.url=t,this.status=e}toString(){return`${this.status.toString()} - ${this.url}`}blob(){return null}}(t,new class{constructor(t,e){this.code=t,this.text=e}toString(){return this.text?`${this.code} - ${this.text}`:this.code.toString()}}(e.status,e.statusText))}))}}(this.session)}handleIncomingRedirect(){this.session.handleIncomingRedirect()}fetch(t){return this.store.fetch(t)}fetchFile(t){return this.fileFetcher.fetchFile(t)}trackSession(t){return this.session.trackSession(t)}logout(){return this.session.logout()}login(t="http://localhost:3000"){return this.session.login(t)}},uf=class{constructor(e){t(this,e),this.os=void 0}componentWillLoad(){this.os=cf(),this.os.handleIncomingRedirect(),this.os.trackSession((t=>{St.state.isLoggedIn=t.isLoggedIn,St.state.webId=t.webId}))}async initializeOs(t){t.stopPropagation(),t.detail(this.os)}render(){return e("ion-app",null,e("slot",null))}},lf=class{constructor(e){t(this,e)}render(){return e("pos-app",null,e("ion-header",null,e("ion-toolbar",null,e("ion-title",{slot:"start"},"PodOS"),e("pos-login",null))),e("ion-content",null,e("pos-router",null)),e("ion-footer",null,e("ion-toolbar",null,e("ion-title",null,"PodOS Browser"))))}},hf=class{constructor(e){t(this,e)}render(){return e("ion-grid",null,e("ion-row",null,e("ion-col",{size:"12","size-sm":!0},e("ion-card",null,e("ion-card-header",null,e("pos-type-badges",null),e("pos-picture",null),e("ion-card-title",null,e("pos-label",null))),e("ion-card-content",null,e("pos-description",null)))),e("ion-col",{size:"12","size-sm":!0},e("pos-literals",null)),e("ion-col",{size:"12","size-sm":!0},e("pos-relations",null),e("pos-reverse-relations",null))))}},df=class{constructor(e){t(this,e)}render(){return e("ion-grid",null,e("ion-row",null,e("ion-col",{size:"12","size-sm":!0},e("pos-subjects",null)),e("ion-col",{size:"12","size-sm":!0},e("ion-card",null,e("ion-card-header",null,e("ion-card-title",null,e("pos-label",null),e("pos-type-badges",null)),e("pos-literals",null))))))}};function ff(t){t.subscribeResource.emit(t.receiveResource)}const pf=class{constructor(e){t(this,e),this.subscribeResource=r(this,"pod-os:resource",7),this.receiveResource=t=>{this.resource=t},this.resource=void 0}componentWillLoad(){ff(this)}render(){return this.resource?this.resource.description():null}},vf=({file:t})=>{const n=function(t){switch(t.code){case 401:case 403:return"lock-closed-outline";case 404:return"help-circle-outline";default:return"alert-circle-outline"}}(t.status);return e("div",null,e("a",{class:"error",href:t.url},e("div",null,e("ion-icon",{name:n})),e("div",{class:"code"},t.status.code),e("div",{class:"text"},t.status.text)))},gf=class{constructor(e){t(this,e),this.initializeOsEmitter=r(this,"pod-os:init",7),this.setOs=async t=>{this.os=t},this.src=void 0,this.os=void 0,this.dataUri=void 0,this.brokenFile=void 0,this.error=void 0,this.loading=!0}componentWillLoad(){St.onChange("isLoggedIn",(()=>this.fetchBlob())),this.initializeOsEmitter.emit(this.setOs)}async fetchBlob(){try{this.loading=!0;const t=await this.os.fetchFile(this.src);t.blob()?(this.dataUri=URL.createObjectURL(t.blob()),this.error=null):this.brokenFile=t}catch(t){this.error=t}finally{this.loading=!1}}render(){return this.loading?e("ion-skeleton-text",{animated:!0}):this.error?e("div",{class:"error"},this.error.message):this.brokenFile?e(vf,{file:this.brokenFile}):e("img",{src:this.dataUri})}static get watchers(){return{os:["fetchBlob"],src:["fetchBlob"]}}};gf.style=":host{}img,ion-skeleton-text,div.error{border-radius:var(--border-radius);width:var(--width);height:var(--height)}.error{display:flex;opacity:0.8;background:repeating-linear-gradient( -45deg, rgba(150, 0, 0, 0.1), rgba(150, 0, 0, 0.1) 10px, #fff 5px, #fff 25px );flex-direction:column;border:1px solid red;color:black;align-items:center;justify-content:center;word-break:break-all;padding:1rem;box-sizing:border-box}.error ion-icon{color:#282828;--ionicon-stroke-width:calc(var(--width) / 5);font-size:calc(var(--width) / 2)}a{text-decoration:none;width:var(--width);height:var(--height)}.code{font-weight:bold;font-size:calc(var(--width) / 8)}.text{font-size:calc(var(--width) / 20)}";const mf=class{constructor(e){t(this,e),this.subscribeResource=r(this,"pod-os:resource",7),this.receiveResource=t=>{this.resource=t},this.resource=void 0}componentWillLoad(){ff(this)}render(){return this.resource?this.resource.label():null}},wf=class{constructor(e){t(this,e),this.subscribeResource=r(this,"pod-os:resource",7),this.receiveResource=t=>{this.data=t.literals()},this.data=[]}componentWillLoad(){ff(this)}render(){const t=this.data.map((t=>e("ion-item-group",null,e("ion-item-divider",null,e("ion-label",null,t.predicate)),t.values.map((t=>e("ion-item",null,e("ion-label",{class:"ion-text-wrap"},t)," "))))));return this.data.length>0?e("ion-list",null,t):null}},bf=class{constructor(e){t(this,e),this.initializeOsEmitter=r(this,"pod-os:init",7),this.setOs=async t=>{this.os=t},this.os=void 0}componentWillLoad(){this.initializeOsEmitter.emit(this.setOs)}login(){const t=St.state.getIdpUrl();this.os.login(t)}logout(){this.os.logout()}render(){return e(n,null,St.state.isLoggedIn?e("pos-resource",{uri:St.state.webId},e("span",{class:"user-data"},e("pos-picture",null),e("pos-label",null))):"",!St.state.isLoggedIn&&e("ion-button",{onClick:()=>this.login()},"Login"),St.state.isLoggedIn&&e("ion-button",{onClick:()=>this.logout()},"Logout"))}};bf.style=":host{display:flex;gap:10px}.user-data{align-items:center;display:inline-flex;gap:10px}.user-data pos-picture{--width:40px;--height:40px;--border-radius:50%}";const yf=class{constructor(e){t(this,e),this.linkEmitter=r(this,"pod-os:link",7),this.uri="",this.value=this.uri}onChange(t){this.value=t.detail.value}onSubmit(t){t.preventDefault(),this.linkEmitter.emit(this.value)}render(){return e("form",{onSubmit:t=>this.onSubmit(t)},e("ion-searchbar",{enterkeyhint:"search",placeholder:"Enter URI",value:this.uri,debounce:0,onIonChange:t=>this.onChange(t)}))}},xf=class{constructor(e){t(this,e),this.subscribeResource=r(this,"pod-os:resource",7),this.receiveResource=t=>{this.resource=t},this.resource=void 0}componentWillLoad(){ff(this)}render(){const t=this.resource?this.resource.picture():null;return t?e("pos-image",{src:t.url}):null}};xf.style=":host{--width:300px;--height:300px;--border-radius:var(--border-radius, 0)}";const kf=class{constructor(e){t(this,e),this.subscribeResource=r(this,"pod-os:resource",7),this.receiveResource=t=>{this.data=t.relations()},this.data=[]}componentWillLoad(){ff(this)}render(){const t=this.data.map((t=>e("ion-item-group",null,e("ion-item-divider",null,e("ion-label",null,t.predicate)),t.uris.map((t=>e("pos-rich-link",{uri:t}))))));return this.data.length>0?e("ion-list",null,t):null}},Ef=class{constructor(e){t(this,e),this.initializeOsEmitter=r(this,"pod-os:init",7),this.setOs=async t=>{this.os=t},this.os=void 0,this.resource=void 0,this.consumers=[],this.uri=void 0,this.lazy=!1,this.error=void 0,this.loading=!0}componentWillLoad(){St.onChange("isLoggedIn",(()=>this.loadResource())),this.initializeOsEmitter.emit(this.setOs)}async provideResource(t){t.stopPropagation(),this.resource&&t.detail(this.resource),this.consumers.push(t)}async loadResource(){await this.getResource(!this.lazy)}async fetch(){await this.getResource(!0)}async getResource(t=!1){try{t&&(this.loading=!0,await this.os.fetch(this.uri)),this.resource=this.os.store.get(this.uri),this.error=null,this.consumers.forEach((t=>{t.detail(this.resource)}))}catch(t){this.error=t}finally{this.loading=!1}}render(){return this.loading?e("ion-progress-bar",{type:"indeterminate"}):this.error?e("ion-card",null,e("ion-card-header",null,e("p",null,"Sorry, something went wrong"),e("p",null,"Status:",this.error.status),e("details",null,this.error.message)),e("ion-card-content",null,e("p",null,"You can try to open the link outside PodOS:"),e("a",{href:this.uri},this.uri))):e("slot",null)}static get watchers(){return{os:["loadResource"],uri:["loadResource"]}}},Sf=class{constructor(e){t(this,e),this.subscribeResource=r(this,"pod-os:resource",7),this.receiveResource=t=>{this.data=t.reverseRelations()},this.data=[]}componentWillLoad(){ff(this)}render(){const t=this.data.map((t=>e("ion-item-group",null,e("ion-item-divider",null,e("ion-label",null,"is ",t.predicate," of")),t.uris.map((t=>e("pos-rich-link",{uri:t}))))));return this.data.length>0?e("ion-list",null,t):null}},Ff=class{constructor(e){t(this,e),this.linkEmitter=r(this,"pod-os:link",7),this.uri=void 0}render(){return e("pos-resource",{lazy:!0,uri:this.uri},e("ion-item",{href:this.uri,onClick:t=>{t.preventDefault(),this.linkEmitter.emit(this.uri)}},e("ion-label",null,e("h2",null,e("pos-label",null)),e("p",null,e("ion-label",{style:{maxWidth:"50rem"}},e("pos-description",null))),e("p",null,e("a",{href:this.uri},this.uri)))))}},Af=(t,e)=>{var n;return"to"in t?{path:t.path,to:t.to}:{path:t.path,id:t.id,jsx:null!==(n=t.render)&&void 0!==n?n:e}},_f=(t,e)=>{if("string"==typeof e){if(e===t)return{}}else if("function"==typeof e){const n=e(t);if(n)return!0===n?{}:{...n}}else{const n=e.exec(t);if(n)return e.lastIndex=0,{...n}}},jf=t=>t.pathname.toLowerCase(),Cf=new RegExp(["(\\\\.)","(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?"].join("|"),"g"),Rf=t=>t.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),If=t=>t.replace(/([=!:$/()])/g,"\\$1"),Tf=t=>t&&t.sensitive?"":"i",Of=(t,e,n)=>{for(var i=(n=n||{}).strict,r=!1!==n.end,o=Rf(n.delimiter||"/"),s=n.delimiters||"./",a=[].concat(n.endsWith||[]).map(Rf).concat("$").join("|"),c="",u=!1,l=0;l<t.length;l++){var h=t[l];if("string"==typeof h)c+=Rf(h),u=l===t.length-1&&s.indexOf(h[h.length-1])>-1;else{var d=Rf(h.prefix||""),f=h.repeat?"(?:"+h.pattern+")(?:"+d+"(?:"+h.pattern+"))*":h.pattern;e&&e.push(h),c+=h.optional?h.partial?d+"("+f+")?":"(?:"+d+"("+f+"))?":d+"("+f+")"}}return r?(i||(c+="(?:"+o+")?"),c+="$"===a?"$":"(?="+a+")"):(i||(c+="(?:"+o+"(?="+a+"))?"),u||(c+="(?="+o+"|"+a+")")),new RegExp("^"+c,Tf(n))},Nf=(t,e,n)=>t instanceof RegExp?((t,e)=>{if(!e)return t;var n=t.source.match(/\((?!\?)/g);if(n)for(var i=0;i<n.length;i++)e.push({name:i,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,pattern:null});return t})(t,e):Array.isArray(t)?((t,e,n)=>{for(var i=[],r=0;r<t.length;r++)i.push(Nf(t[r],e,n).source);return new RegExp("(?:"+i.join("|")+")",Tf(n))})(t,e,n):((t,e,n)=>Of(((t,e)=>{for(var n,i=[],r=0,o=0,s="",a=e&&e.delimiter||"/",c=e&&e.delimiters||"./",u=!1;null!==(n=Cf.exec(t));){var l=n[0],h=n[1],d=n.index;if(s+=t.slice(o,d),o=d+l.length,h)s+=h[1],u=!0;else{var f="",p=t[o],v=n[2],g=n[3],m=n[4],w=n[5];if(!u&&s.length){var b=s.length-1;c.indexOf(s[b])>-1&&(f=s[b],s=s.slice(0,b))}s&&(i.push(s),s="",u=!1);var y=f||a,x=g||m;i.push({name:v||r++,prefix:f,delimiter:y,optional:"?"===w||"*"===w,repeat:"+"===w||"*"===w,partial:""!==f&&void 0!==p&&p!==f,pattern:x?If(x):"[^"+Rf(y)+"]+?"})}}return(s||o<t.length)&&i.push(s+t.substr(o)),i})(t,n),e,n))(t,e,n);let Pf=0;const Df={},Mf=(t,e={})=>{const{exact:n=!1,strict:i=!1}=e,{re:r,keys:o}=((t,e)=>{const n=`${e.end}${e.strict}`,i=Df[n]||(Df[n]={}),r=JSON.stringify(t);if(i[r])return i[r];const o=[],s={re:Nf(t,o,e),keys:o};return Pf<1e4&&(i[r]=s,Pf+=1),s})(t,{end:n,strict:i});return t=>{const e=r.exec(t);if(!e)return;const[i,...s]=e;return n&&t!==i?void 0:o.reduce(((t,e,n)=>(t[e.name]=s[n],t)),{})}},Uf=(()=>{const t=window,e=new URL(t.location.href),n=(void 0,jf),{state:i,onChange:r,dispose:o}=Et({url:e,activePath:n(e)},((t,e,n)=>"url"===n?t.href!==e.href:t!==e)),s=t=>{history.pushState(null,null,t);const e=new URL(t,document.baseURI);i.url=e,i.activePath=n(e)},a=t=>{const{activePath:e}=i;for(let n of t){const i=_f(e,n.path);if(i){if(null!=n.to){const i="string"==typeof n.to?n.to:n.to(e);return s(i),a(t)}return{params:i,route:n}}}},c=()=>{const e=new URL(t.location.href);i.url=e,i.activePath=n(e)},u={Switch:(t,e)=>{const n=a(e);if(n)return"function"==typeof n.route.jsx?n.route.jsx(n.params):n.route.jsx},get url(){return i.url},get activePath(){return i.activePath},push:s,onChange:r,dispose:()=>{t.removeEventListener("popstate",c),o()}};return c(),t.addEventListener("popstate",c),u})(),Lf=class{constructor(e){t(this,e),this.uri=void 0}linkClicked(t){this.navigate(t.detail)}componentWillLoad(){this.updateUri(),Uf.onChange("url",(()=>{this.updateUri()}))}navigate(t){Uf.push("?uri="+encodeURIComponent(t))}updateUri(){this.uri=new URLSearchParams(window.location.search).get("uri")||window.location.href}render(){return console.log("render router",this.uri),e(Uf.Switch,null,e(Af,{path:Mf("",{exact:!1})},e("pos-navigation-bar",{uri:this.uri}),e("pos-resource",{key:this.uri,uri:this.uri},e("pos-type-router",null))))}},Bf=class{constructor(e){t(this,e),this.subscribeResource=r(this,"pod-os:resource",7),this.receiveResource=t=>{const e=t.assume(af);this.data=e.subjects()},this.data=[]}componentWillLoad(){ff(this)}render(){const t=this.data.map((t=>e("pos-rich-link",{uri:t.uri})));return this.data.length>0?e("ion-list",null,t):null}},Jf=class{constructor(e){t(this,e),this.subscribeResource=r(this,"pod-os:resource",7),this.receiveResource=t=>{this.data=t.types(),this.typeLabels=[...new Set(t.types().map((t=>t.label)))]},this.data=[],this.typeLabels=[],this.isExpanded=!1}componentWillLoad(){ff(this)}toggleDetails(){this.isExpanded=!this.isExpanded}render(){return 0==this.data.length?null:this.isExpanded?e("div",{class:"types expanded"},e("ion-badge",{class:"toggle",onClick:()=>this.toggleDetails()},e("ion-icon",{name:"contract-outline"})),this.data.map((t=>e("ion-badge",null,t.uri)))):e(n,null,e("div",{class:"types"},this.typeLabels.map((t=>e("ion-badge",null,t))),e("ion-badge",{class:"toggle",onClick:()=>this.toggleDetails()},e("ion-icon",{name:"expand-outline"}))))}};Jf.style=".types{display:flex;gap:0.25rem;margin:0.5rem 0}.expanded{flex-direction:column;justify-content:flex-start;align-items:flex-start}ion-badge{color:#333;background:#eee}ion-badge.toggle{cursor:pointer}ion-badge.toggle:hover{background:#ddd}";const $f=class{constructor(e){t(this,e),this.subscribeResource=r(this,"pod-os:resource",7),this.receiveResource=t=>{this.types=t.types()},this.types=void 0}componentWillLoad(){ff(this)}render(){return this.types?this.renderApp():null}renderApp(){return this.types.some((t=>"http://www.w3.org/2007/ont/link#RDFDocument"===t.uri))?e("pos-app-rdf-document",null):e("pos-app-generic",null)}};export{x as ion_app,S as ion_badge,F as ion_button,A as ion_card,_ as ion_card_content,j as ion_card_header,C as ion_card_title,P as ion_col,D as ion_content,L as ion_footer,B as ion_grid,K as ion_header,et as ion_icon,rt as ion_item,ot as ion_item_divider,st as ion_item_group,at as ion_label,ct as ion_list,ut as ion_progress_bar,dt as ion_ripple_effect,gt as ion_row,mt as ion_searchbar,wt as ion_skeleton_text,bt as ion_title,yt as ion_toolbar,uf as pos_app,lf as pos_app_browser,hf as pos_app_generic,df as pos_app_rdf_document,pf as pos_description,gf as pos_image,mf as pos_label,wf as pos_literals,bf as pos_login,yf as pos_navigation_bar,xf as pos_picture,kf as pos_relations,Ef as pos_resource,Sf as pos_reverse_relations,Ff as pos_rich_link,Lf as pos_router,Bf as pos_subjects,Jf as pos_type_badges,$f as pos_type_router}