@pod-os/elements 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ion-app_34.cjs.entry.js +35379 -33168
- package/dist/custom-elements/index.js +35433 -33222
- package/dist/elements/elements.esm.js +1 -1
- package/dist/elements/p-7986b311.entry.js +61 -0
- package/dist/esm/ion-app_34.entry.js +35253 -33042
- package/package.json +2 -2
- package/dist/elements/p-6a64c6cf.entry.js +0 -74
|
@@ -1,74 +0,0 @@
|
|
|
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 u,i as c}from"./p-a712c2f6.js";import{g as l,c as h,a as d}from"./p-8d1d6062.js";import{h as f,i as p,c as v,r as g}from"./p-735719e4.js";import{o as m,c as w,h as b}from"./p-cfc0e54d.js";const y=class{constructor(e){t(this,e)}componentDidLoad(){k((async()=>{const t=d(window,"hybrid");h.getBoolean("_testing")||import("./p-1aa0e849.js").then((t=>t.startTapClick(h))),h.getBoolean("statusTap",t)&&import("./p-854dbdf1.js").then((t=>t.startStatusTap())),h.getBoolean("inputShims",x())&&import("./p-039fd555.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)}},x=()=>d(window,"ios")&&d(window,"mobile"),k=t=>{"requestIdleCallback"in window?window.requestIdleCallback(t):setTimeout(t,32)};y.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),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)m(this.href,t,this.routerDirection,this.routerAnimation);else if(f(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=p(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:u,href:c,color:h,expand:d,hasIconOnly:f,shape:p,strong:v,inheritedAttributes:g}=this,m=void 0===u&&this.inItem?"small":u,y=void 0===c?"button":"a",x="button"===y?{type:r}:{download:this.download,href:c,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:w(h,{[t]:!0,[i]:!0,[`${i}-${d}`]:void 0!==d,[`${i}-${m}`]:void 0!==m,[`${i}-${p}`]:void 0!==p,[`${i}-${k}`]:!0,[`${i}-strong`]:v,"in-toolbar":b("ion-toolbar",this.el),"in-toolbar-color":b("ion-toolbar[color]",this.el),"button-has-icon-only":f,"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},g),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)}};S.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 E=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=>m(i,t,o,r)}),e("slot",null),n&&"md"===t&&e("ion-ripple-effect",null))}render(){const t=l(this);return e(n,{class:w(this.color,{[t]:!0,"card-disabled":this.disabled,"ion-activatable":this.isClickable()})},this.renderCard(t))}};E.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 F=class{constructor(e){t(this,e)}render(){const t=l(this);return e(n,{class:{[t]:!0,[`card-content-${t}`]:!0}})}};F.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 A=class{constructor(e){t(this,e),this.translucent=!1}render(){const t=l(this);return e(n,{class:w(this.color,{"card-header-translucent":this.translucent,"ion-inherit-color":!0,[t]:!0})},e("slot",null))}};A.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 _=class{constructor(e){t(this,e)}render(){const t=l(this);return e(n,{role:"heading","aria-level":"2",class:w(this.color,{"ion-inherit-color":!0,[t]:!0})},e("slot",null))}};_.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 C={xs:"(min-width: 0px)",sm:"(min-width: 576px)",md:"(min-width: 768px)",lg:"(min-width: 992px)",xl:"(min-width: 1200px)"},j=t=>void 0===t||""===t||!!window.matchMedia&&window.matchMedia(C[t]).matches,R=window,T=!!(R.CSS&&R.CSS.supports&&R.CSS.supports("--a: 0")),I=["","xs","sm","md","lg","xl"],O=class{constructor(e){t(this,e)}onResize(){o(this)}getColumns(t){let e;for(const n of I){const i=j(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":T?`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]:T?`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))}};O.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 N=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=P(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,D(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,u=i.scrollLeft,c=null!=e?e-a:0,l=null!=t?t-u:0,h=t=>{const e=Math.min(1,(t-o)/n)-1,s=Math.pow(e,3)+1;0!==c&&(i.scrollTop=Math.floor(s*c+a)),0!==l&&(i.scrollLeft=Math.floor(s*l+u)),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",u="ios"===o&&h.getBoolean("experimentalTransitionShadow",!0);return this.resize(),e(n,{class:w(this.color,{[o]:!0,"content-sizing":b("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)),u?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)}},P=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)},D=(t,e,n,i)=>{const r=t.currentX,o=t.currentY,s=e.scrollLeft,a=e.scrollTop,u=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,u>0&&u<100){const e=(a-o)/u;t.velocityX=(s-r)/u*.7+.3*t.velocityX,t.velocityY=.7*e+.3*t.velocityY}};N.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 M=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))}};M.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 U=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))}};U.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 L=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},B=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"))||[]}}))||[]}},$=(t,e)=>{void 0===e?t.background.style.removeProperty("--opacity"):t.background.style.setProperty("--opacity",e.toString())},H=(t,e=!0)=>{e?t.el.classList.remove("header-collapse-condense-inactive"):t.el.classList.add("header-collapse-condense-inactive")},J=class{constructor(e){t(this,e),this.collapsibleHeaderInitialized=!1,this.inheritedAttributes={},this.translucent=!1}componentWillLoad(){this.inheritedAttributes=p(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((()=>{L("ion-title").size="large",L("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=B(this.collapsibleMainHeader),r=B(this.el);i&&r&&(H(i,!1),i.toolbars.forEach((t=>{$(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=>{$(t,1===i?void 0:i)}))})(t,e,r);const o=t[0],s=o.intersectionRect,a=s.width*s.height,u=0===a&&0==o.rootBounds.width*o.rootBounds.height,c=Math.abs(s.left-o.boundingClientRect.left),l=Math.abs(s.right-o.boundingClientRect.right);u||a>0&&(c>=5||l>=5)||(o.isIntersecting?(H(e,!1),H(n)):(0===s.x&&0===s.y||0!==s.width&&0!==s.height)&&r>0&&(H(e),H(n,!1),$(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=v(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=b("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 z;J.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 K=(t,e,n,i,r)=>(n="ios"===(n&&G(n))?"ios":"md",i&&"ios"===n?t=G(i):r&&"md"===n?t=G(r):(t||!e||q(e)||(t=e),V(t)&&(t=G(t))),V(t)&&""!==t.trim()?""!==t.replace(/[a-z]|-|\d/gi,"")?null:t:null),W=t=>V(t)&&(t=t.trim(),q(t))?t:null,q=t=>t.length>0&&/(\/|\.)/.test(t),V=t=>"string"==typeof t,G=t=>t.toLowerCase(),X=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(V(n)&&0===n.toLowerCase().indexOf("on"))return!1}for(let e=0;e<t.childNodes.length;e++)if(!X(t.childNodes[e]))return!1}return!0},Y=new Map,Z=new Map,Q=class{constructor(e){t(this,e),this.iconName=null,this.isVisible=!1,this.mode=tt(),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=W(t.src);if(e)return e;if(e=K(t.name,t.icon,t.mode,t.ios,t.md),e)return n=e,(()=>{if("undefined"==typeof window)return new Map;if(!z){const t=window;t.Ionicons=t.Ionicons||{},z=t.Ionicons.map=t.Ionicons.map||new Map}return z})().get(n)||u(`svg/${n}.svg`);var n;if(t.icon){if(e=W(t.icon),e)return e;if(e=W(t.icon[t.mode]),e)return e}return null})(this);t&&(Y.has(t)?this.svgContent=Y.get(t):((t,e)=>{let n=Z.get(t);if(!n){if("undefined"==typeof fetch||"undefined"==typeof document)return Y.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()),X(n))return e.innerHTML}return""})(n)),Y.set(t,n||"")}));Y.set(t,"")})),Z.set(t,n)}return n})(t,this.sanitize).then((()=>this.svgContent=Y.get(t))))}const t=this.iconName=K(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},et(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"]}}},tt=()=>"undefined"!=typeof document&&document.documentElement.getAttribute("mode")||"md",et=t=>t?{"ion-color":!0,[`ion-color-${t}`]:!0}:null;Q.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 nt=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(){g((()=>{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(),g((()=>{e.fireFocusEvents=!0})))}render(){const{detail:t,detailIcon:i,download:r,labelColorStyles:o,lines:s,disabled:a,href:u,rel:c,target:h,routerAnimation:d,routerDirection:f}=this,p={},v=l(this),g=this.isClickable(),y=this.canActivate(),x=g?void 0===u?"button":"a":"div",k="button"===x?{type:this.type}:{download:r,href:u,rel:c,target:h},S=g?{onClick:t=>{m(u,t,f,d)}}:{},E=void 0!==t?t:"ios"===v&&g;return this.itemStyles.forEach((t=>{Object.assign(p,t)})),e(n,{"aria-disabled":a||p["item-interactive-disabled"]?"true":null,class:Object.assign(Object.assign(Object.assign({},p),o),w(this.color,{item:!0,[v]:!0,[`item-lines-${s}`]:void 0!==s,"item-disabled":a,"in-list":b("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},S),e("slot",{name:"start"}),e("div",{class:"item-inner"},e("div",{class:"input-wrapper"},e("slot",null)),e("slot",{name:"end"}),E&&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"===v&&e("ion-ripple-effect",null)),e("div",{class:"item-highlight"}))}static get delegatesFocus(){return!0}get el(){return i(this)}};nt.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 it=class{constructor(e){t(this,e),this.sticky=!1}render(){const t=l(this);return e(n,{class:w(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)}};it.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 rt=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}})}};rt.style={ios:"ion-item-group{display:block}",md:"ion-item-group{display:block}"};const ot=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:w(this.color,{[i]:!0,"in-item-color":b("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"]}}};ot.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 st=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)}};st.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 at=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"),u=l(this);return e(n,{role:"progressbar","aria-valuenow":"determinate"===i?o:null,"aria-valuemin":"0","aria-valuemax":"1",class:w(t,{[u]:!0,[`progress-bar-${i}`]:!0,"progress-paused":a,"progress-bar-reversed":"rtl"===document.dir?!r:r})},"indeterminate"===i?ut():ct(o,s))}},ut=()=>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"}))),ct=(t,n)=>{const i=v(0,t,1),r=v(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})`}})]};at.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 lt=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),u=Math.max(o,r),c=this.unbounded?u:s+dt,l=Math.floor(u*ft),h=c/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((()=>{ht(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)}},ht=t=>{t.classList.add("fade-out"),setTimeout((()=>{t.remove()}),200)},dt=10,ft=.5;lt.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 pt=class{constructor(e){t(this,e)}render(){return e(n,{class:l(this)},e("slot",null))}};pt.style=":host{display:flex;flex-wrap:wrap}";const vt=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:w(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"]}}};vt.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 gt=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),w(this.color,{[t]:!0,"in-toolbar":b("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)}};gt.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 mt=t=>!("isConnected"in t)||t.isConnected,wt=(()=>{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(mt))})(...e)}),2e3)}})(),bt=(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)}),u=(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:u,onChange:(e,n)=>{const i=u("set",((t,i)=>{t===e&&n(i)})),r=u("reset",(()=>n(t[e])));return()=>{i(),r()}},use:(...t)=>{const e=t.reduce(((t,e)=>(e.set&&t.push(u("set",e.set)),e.get&&t.push(u("get",e.get)),e.reset&&t.push(u("reset",e.reset)),e.dispose&&t.push(u("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 c)return{};const t=new Map;return{dispose:()=>t.clear(),get:e=>{const n=c();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)),wt(t)},reset:()=>{t.forEach((t=>t.forEach(o))),wt(t)}}})()),n},yt=bt({getIdpUrl:()=>prompt("Please enter your Identity Provider URL","http://localhost:3000"),isLoggedIn:!1,webId:""});var xt,kt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},St=(function(t){(()=>{var e,n,i,r,o,s,a,u,c,l,h,d,f,p,v,g,m,w,b,y,x,k,S,E,F,A,_,C,j,R,T,I,O,N,P,D,M,U,L,B,$,H,J,z,K,W,q,V,G,X,Y,Z,Q,tt,et,nt,it,rt,ot,st,at,ut,ct,lt,ht,dt,ft,pt,vt,gt,mt,wt,bt,yt,xt,St,Et,Ft,At,_t,Ct,jt,Rt,Tt,It,Ot,Nt,Pt,Dt,Mt=Object.create,Ut=Object.defineProperty,Lt=Object.getOwnPropertyDescriptor,Bt=Object.getOwnPropertyNames,$t=Object.getPrototypeOf,Ht=Object.prototype.hasOwnProperty,Jt=t=>Ut(t,"__esModule",{value:!0}),zt=(t,e)=>function(){return t&&(e=(0,t[Object.keys(t)[0]])(t=0)),e},Kt=(t,e)=>function(){return e||(0,t[Object.keys(t)[0]])((e={exports:{}}).exports,e),e.exports},Wt=(t,e)=>{for(var n in Jt(t),e)Ut(t,n,{get:e[n],enumerable:!0})},qt=t=>((t,e,n)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let i of Bt(e))Ht.call(t,i)||"default"===i||Ut(t,i,{get:()=>e[i],enumerable:!(n=Lt(e,i))||n.enumerable});return t})(Jt(Ut(null!=t?Mt($t(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),Vt=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 u(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function c(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function l(t,e,n,i){var r,o,s;if(u(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=c(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 c(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 u=o[t];if(void 0===u)return!1;if("function"==typeof u)r(u,this,e);else{var c=u.length,l=v(u,c);for(n=0;n<c;++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 u(e),this.on(t,d(this,t,e)),this},s.prototype.prependOnceListener=function(t,e){return u(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(u(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):[]}}}),Gt=Kt({"node_modules/@inrupt/solid-client-authn-core/dist/constant.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),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={NEW_REFRESH_TOKEN:"newRefreshToken",ERROR:"onError",SESSION_EXPIRED:"sessionExpired",SESSION_EXTENDED:"sessionExtended",TIMEOUT_SET:"timeoutSet"},t.REFRESH_BEFORE_EXPIRATION_SECONDS=5}}),Xt=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}}),Yt=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(Xt());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(", ")}`)}}}}),Zt=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]"],u=ArrayBuffer.isView||function(t){return t&&a.indexOf(Object.prototype.toString.call(t))>-1};function c(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)||u(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=c(t),e=l(e);var n=this.map[t];this.map[t]=n?n+", "+e:e},d.prototype.delete=function(t){delete this.map[c(t)]},d.prototype.get=function(t){return t=c(t),this.has(t)?this.map[t]:null},d.prototype.has=function(t){return this.map.hasOwnProperty(c(t))},d.prototype.set=function(t,e){this.map[c(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 S(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 u(){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",u),a.onreadystatechange=function(){4===a.readyState&&s.signal.removeEventListener("abort",u)}),a.send(void 0===s._bodyInit?null:s._bodyInit)}))}S.polyfill=!0,n.fetch||(n.fetch=S,n.Headers=d,n.Request=b,n.Response=x),t.Headers=d,t.Request=b,t.Response=x,t.fetch=S,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}}),Qt={};function te(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}function ee(...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 ne(t,e){return ee(g.encode(t),new Uint8Array([0]),e)}function ie(t,e,n){if(e<0||e>=w)throw new RangeError(`value must be >= 0 and <= ${w-1}. Received ${e}`);t.set([e>>>24,e>>>16,e>>>8,255&e],n)}function re(t){const e=Math.floor(t/w),n=t%w,i=new Uint8Array(8);return ie(i,e,0),ie(i,n,4),i}function oe(t){const e=new Uint8Array(4);return ie(e,t),e}function se(t){return ee(oe(t.length),t)}function ae(t){return void 0!==b.CryptoKey&&null!=t&&t instanceof b.CryptoKey}function ue(t,e){if(t.algorithm.length!==parseInt(e.substr(1,3),10))throw new TypeError(`invalid key size for alg: ${e}`)}function ce(t,e){if(ae(t))return t;if(t instanceof Uint8Array)return F.subtle.importKey("raw",t,"AES-KW",!0,[e]);throw new TypeError(C(t,"CryptoKey","Uint8Array"))}function le(t){if(!(t instanceof Uint8Array)||t.length<8)throw new s("PBES2 Salt Input must be 8 or more octets")}function he(t){if(t instanceof Uint8Array)return F.subtle.importKey("raw",t,"PBKDF2",!1,["deriveBits"]);if(ae(t))return t;throw new TypeError(C(t,"CryptoKey","Uint8Array"))}function de(t){switch(t){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return"RSA-OAEP";default:throw new r(`alg ${t} is not supported either by JOSE or your javascript runtime`)}}async function fe(t,e,n){if(!te(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?Y({...t,alg:e,ext:!1}):x(t.k);case"RSA":if(void 0!==t.oth)throw new r('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return Y({...t,alg:e});default:throw new r('unsupported "kty" (Key Type) Parameter value')}}function pe(t){if(!t)throw new s("JWE Encrypted Key missing")}function ve(t,e,n){if(void 0===t[e])throw new s(`JOSE Header ${n} (${e}) missing`)}function ge(t,e,n,i,o){if(void 0!==o.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 s;s=void 0!==n?new Map([...Object.entries(n),...e.entries()]):e;for(const e of i.crit){if(!s.has(e))throw new r(`Extension Header Parameter "${e}" is not recognized`);if(void 0===o[e])throw new t(`Extension Header Parameter "${e}" is missing`);if(s.get(e)&&void 0===i[e])throw new t(`Extension Header Parameter "${e}" MUST be integrity protected`)}return new Set(i.crit)}async function me(t,e,n){var o;if(!te(t))throw new s("Flattened JWE must be an object");if(void 0===t.protected&&void 0===t.header&&void 0===t.unprotected)throw new s("JOSE Header missing");if("string"!=typeof t.iv)throw new s("JWE Initialization Vector missing or incorrect type");if("string"!=typeof t.ciphertext)throw new s("JWE Ciphertext missing or incorrect type");if("string"!=typeof t.tag)throw new s("JWE Authentication Tag missing or incorrect type");if(void 0!==t.protected&&"string"!=typeof t.protected)throw new s("JWE Protected Header incorrect type");if(void 0!==t.encrypted_key&&"string"!=typeof t.encrypted_key)throw new s("JWE Encrypted Key incorrect type");if(void 0!==t.aad&&"string"!=typeof t.aad)throw new s("JWE AAD incorrect type");if(void 0!==t.header&&!te(t.header))throw new s("JWE Shared Unprotected Header incorrect type");if(void 0!==t.unprotected&&!te(t.unprotected))throw new s("JWE Per-Recipient Unprotected Header incorrect type");let a;if(t.protected){const e=x(t.protected);try{a=JSON.parse(m.decode(e))}catch(t){throw new s("JWE Protected Header is invalid")}}if(!v(a,t.header,t.unprotected))throw new s("JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint");const u={...a,...t.header,...t.unprotected};if(et(null==n?void 0:n.crit,a,u),void 0!==u.zip){if(!a||!a.zip)throw new s('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==u.zip)throw new r('unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:c,enc:l}=u;if("string"!=typeof c||!c)throw new s("missing JWE Algorithm (alg) in JWE Header");if("string"!=typeof l||!l)throw new s("missing JWE Encryption Algorithm (enc) in JWE Header");const h=n&&nt(n.keyManagementAlgorithms),d=n&&it(n.contentEncryptionAlgorithms);if(h&&!h.has(c))throw new i('"alg" (Algorithm) Header Parameter not allowed');if(d&&!d.has(l))throw new i('"enc" (Encryption Algorithm) Header Parameter not allowed');let f,p;void 0!==t.encrypted_key&&(f=x(t.encrypted_key)),"function"==typeof e&&(e=await e(a,t));try{p=await async function(t,e,n,i){switch(Z(t,e,"decrypt"),t){case"dir":if(void 0!==n)throw new s("Encountered unexpected JWE Encrypted Key");return e;case"ECDH-ES":if(void 0!==n)throw new s("Encountered unexpected JWE Encrypted Key");case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(ve(i,"epk","Ephemeral Public Key"),!U(e))throw new r("ECDH-ES with the provided key is not allowed or not supported by your javascript runtime");const o=await fe(i.epk,t);let s,a;void 0!==i.apu&&(s=x(i.apu)),void 0!==i.apv&&(a=x(i.apv));const u=await D(o,e,"ECDH-ES"===t?i.enc:t,parseInt(t.substr(-5,3),10)||G.get(i.enc),s,a);if("ECDH-ES"===t)return u;pe(n);const c=t.substr(-6);return N(c,u,n)}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return pe(n),z(t,e,n);case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{pe(n),ve(i,"p2c","PBES2 Count"),ve(i,"p2s","PBES2 Salt");const{p2c:r}=i,o=x(i.p2s);return $(t,e,n,r,o)}case"A128KW":case"A192KW":case"A256KW":return pe(n),N(t,e,n);case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{pe(n),ve(i,"iv","Initialization Vector"),ve(i,"tag","Authentication Tag");const r=x(i.iv),o=x(i.tag);return V(t,e,n,r,o)}default:throw new r('unsupported or invalid "alg" (JWE Algorithm) header value')}}(c,e,f,u)}catch(t){if(t instanceof TypeError)throw t;p=tt(l)}const w=x(t.iv),b=x(t.tag),y=g.encode(null!==(o=t.protected)&&void 0!==o?o:"");let k;k=void 0!==t.aad?ee(y,g.encode("."),g.encode(t.aad)):y;let S=await j(l,p,x(t.ciphertext),w,b,k);"DEF"===u.zip&&(S=await((null==n?void 0:n.inflateRaw)||R)(S));const E={plaintext:S};return void 0!==t.protected&&(E.protectedHeader=a),void 0!==t.aad&&(E.additionalAuthenticatedData=x(t.aad)),void 0!==t.unprotected&&(E.sharedUnprotectedHeader=t.unprotected),void 0!==t.header&&(E.unprotectedHeader=t.header),E}async function we(t,e,n){if(t instanceof Uint8Array&&(t=m.decode(t)),"string"!=typeof t)throw new s("Compact JWE must be a string or Uint8Array");const{0:i,1:r,2:o,3:a,4:u,length:c}=t.split(".");if(5!==c)throw new s("Invalid Compact JWE");const l=await me({ciphertext:a||void 0,iv:o||void 0,protected:i||void 0,tag:u||void 0,encrypted_key:r||void 0},e,n);return{plaintext:l.plaintext,protectedHeader:l.protectedHeader}}async function be(t){return rt(t)}async function ye(t,e,n){if(!te(t))throw new s("General JWE must be an object");if(!Array.isArray(t.recipients)||!t.recipients.every(te))throw new s("JWE Recipients missing or incorrect type");for(const i of t.recipients)try{return await me({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 o}async function xe(t,e){const n={...t,...e.header};if(!te(n.jwk))throw new a('"jwk" (JSON Web Key) Header Parameter must be a JSON object');const i=await fe(n.jwk,n.alg,!0);if("public"!==i.type)throw new a('"jwk" (JSON Web Key) Header Parameter must be a public key');return i}async function ke(t,e="sha256"){if(!te(t))throw new TypeError("JWK must be an object");let n;switch(t.kty){case"EC":lt(t.crv,'"crv" (Curve) Parameter'),lt(t.x,'"x" (X Coordinate) Parameter'),lt(t.y,'"y" (Y Coordinate) Parameter'),n={crv:t.crv,kty:t.kty,x:t.x,y:t.y};break;case"OKP":lt(t.crv,'"crv" (Subtype of Key Pair) Parameter'),lt(t.x,'"x" (Public Key) Parameter'),n={crv:t.crv,kty:t.kty,x:t.x};break;case"RSA":lt(t.e,'"e" (Exponent) Parameter'),lt(t.n,'"n" (Modulus) Parameter'),n={e:t.e,kty:t.kty,n:t.n};break;case"oct":lt(t.k,'"k" (Key Value) Parameter'),n={k:t.k,kty:t.kty};break;default:throw new r('"kty" (Key Type) Parameter missing or unsupported')}const i=g.encode(JSON.stringify(n));return y(await P(e,i))}function Se(t){return te(t)}function Ee(t,e){const n=new dt(t,e);return n.getKey.bind(n)}function Fe(t){switch(t){case"HS256":return{hash:{name:"SHA-256"},name:"HMAC"};case"HS384":return{hash:{name:"SHA-384"},name:"HMAC"};case"HS512":return{hash:{name:"SHA-512"},name:"HMAC"};case"PS256":return{hash:{name:"SHA-256"},name:"RSA-PSS",saltLength:32};case"PS384":return{hash:{name:"SHA-384"},name:"RSA-PSS",saltLength:48};case"PS512":return{hash:{name:"SHA-512"},name:"RSA-PSS",saltLength:64};case"RS256":return{hash:{name:"SHA-256"},name:"RSASSA-PKCS1-v1_5"};case"RS384":return{hash:{name:"SHA-384"},name:"RSASSA-PKCS1-v1_5"};case"RS512":return{hash:{name:"SHA-512"},name:"RSASSA-PKCS1-v1_5"};case"ES256":return{hash:{name:"SHA-256"},name:"ECDSA",namedCurve:"P-256"};case"ES384":return{hash:{name:"SHA-384"},name:"ECDSA",namedCurve:"P-384"};case"ES512":return{hash:{name:"SHA-512"},name:"ECDSA",namedCurve:"P-521"};default:throw new r(`alg ${t} is not supported either by JOSE or your javascript runtime`)}}function Ae(t,e,n){if(ae(e))return e;if(e instanceof Uint8Array){if(!t.startsWith("HS"))throw new TypeError(C(e,"CryptoKey"));return F.subtle.importKey("raw",e,{hash:{name:`SHA-${t.substr(-3)}`},name:"HMAC"},!1,[n])}throw new TypeError(C(e,"CryptoKey","Uint8Array"))}async function _e(t,e,n){var r;if(!te(t))throw new a("Flattened JWS must be an object");if(void 0===t.protected&&void 0===t.header)throw new a('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==t.protected&&"string"!=typeof t.protected)throw new a("JWS Protected Header incorrect type");if(void 0===t.payload)throw new a("JWS Payload missing");if("string"!=typeof t.signature)throw new a("JWS Signature missing or incorrect type");if(void 0!==t.header&&!te(t.header))throw new a("JWS Unprotected Header incorrect type");let o={};if(t.protected){const e=x(t.protected);try{o=JSON.parse(m.decode(e))}catch(t){throw new a("JWS Protected Header is invalid")}}if(!v(o,t.header))throw new a("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const s={...o,...t.header};let u=!0;if(wt(null==n?void 0:n.crit,o,s).has("b64")&&(u=o.b64,"boolean"!=typeof u))throw new a('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:c}=s;if("string"!=typeof c||!c)throw new a('JWS "alg" (Algorithm) Header Parameter missing or invalid');const l=n&&bt(n.algorithms);if(l&&!l.has(c))throw new i('"alg" (Algorithm) Header Parameter not allowed');if(u){if("string"!=typeof t.payload)throw new a("JWS Payload must be a string")}else if("string"!=typeof t.payload&&!(t.payload instanceof Uint8Array))throw new a("JWS Payload must be a string or an Uint8Array instance");"function"==typeof e&&(e=await e(o,t)),Z(c,e,"verify");const h=ee(g.encode(null!==(r=t.protected)&&void 0!==r?r:""),g.encode("."),"string"==typeof t.payload?g.encode(t.payload):t.payload),d=x(t.signature);if(!await mt(c,e,d,h))throw new f;let p;p=u?x(t.payload):"string"==typeof t.payload?g.encode(t.payload):t.payload;const w={payload:p};return void 0!==t.protected&&(w.protectedHeader=o),void 0!==t.header&&(w.unprotectedHeader=t.header),w}async function Ce(t,e,n){if(t instanceof Uint8Array&&(t=m.decode(t)),"string"!=typeof t)throw new a("Compact JWS must be a string or Uint8Array");const{0:i,1:r,2:o,length:s}=t.split(".");if(3!==s)throw new a("Invalid Compact JWS");const u=await _e({payload:r||void 0,protected:i||void 0,signature:o||void 0},e,n);return{payload:u.payload,protectedHeader:u.protectedHeader}}async function je(t,e,n){if(!te(t))throw new a("General JWS must be an object");if(!Array.isArray(t.signatures)||!t.signatures.every(te))throw new a("JWS Signatures missing or incorrect type");for(const i of t.signatures)try{return await _e({header:i.header,payload:t.payload,protected:i.protected,signature:i.signature},e,n)}catch(t){}throw new f}async function Re(t,e,i){const r=await we(t,e,i),o=jt(r.protectedHeader,r.plaintext,i),{protectedHeader:s}=r;if(void 0!==s.iss&&s.iss!==o.iss)throw new n('replicated "iss" claim header parameter mismatch',"iss","mismatch");if(void 0!==s.sub&&s.sub!==o.sub)throw new n('replicated "sub" claim header parameter mismatch',"sub","mismatch");if(void 0!==s.aud&&JSON.stringify(s.aud)!==JSON.stringify(o.aud))throw new n('replicated "aud" claim header parameter mismatch',"aud","mismatch");return{payload:o,protectedHeader:s}}async function Te(t,e,n){var i;const r=await Ce(t,e,n);if((null===(i=r.protectedHeader.crit)||void 0===i?void 0:i.includes("b64"))&&!1===r.protectedHeader.b64)throw new u("JWTs MUST NOT use unencoded payload");return{payload:jt(r.protectedHeader,r.payload,n),protectedHeader:r.protectedHeader}}function Ie(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(m.decode(Pt(e)));if(!te(t))throw new Error;return t}catch(t){throw new TypeError("Invalid Token or Protected Header formatting")}}function Oe(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 r("Invalid or unsupported modulusLength option provided, 2048 bits or larger keys must be used");return n}async function Ne(t,e){return async function(t,e){var n,i;let o,s;switch(t){case"PS256":case"PS384":case"PS512":o={name:"RSA-PSS",hash:{name:`SHA-${t.substr(-3)}`},publicExponent:new Uint8Array([1,0,1]),modulusLength:Oe(e)},s=["sign","verify"];break;case"RS256":case"RS384":case"RS512":o={name:"RSASSA-PKCS1-v1_5",hash:{name:`SHA-${t.substr(-3)}`},publicExponent:new Uint8Array([1,0,1]),modulusLength:Oe(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:{name:`SHA-${parseInt(t.substr(-3),10)||1}`},publicExponent:new Uint8Array([1,0,1]),modulusLength:Oe(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"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":o={name:"ECDH",namedCurve:null!==(n=null==e?void 0:e.crv)&&void 0!==n?n:"P-256"},s=["deriveKey","deriveBits"];break;default:throw new r('unsupported or invalid JWK "alg" (Algorithm) Parameter value')}return F.subtle.generateKey(o,null!==(i=null==e?void 0:e.extractable)&&void 0!==i&&i,s)}(t,e)}async function Pe(t,e){return async function(t,e){var n;let i,o,s;switch(t){case"HS256":case"HS384":case"HS512":i=parseInt(t.substr(-3),10),o={name:"HMAC",hash:{name:`SHA-${i}`},length:i},s=["sign","verify"];break;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return i=parseInt(t.substr(-3),10),L(new Uint8Array(i>>3));case"A128KW":case"A192KW":case"A256KW":i=parseInt(t.substring(1,4),10),o={name:"AES-KW",length:i},s=["wrapKey","unwrapKey"];break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":case"A128GCM":case"A192GCM":case"A256GCM":i=parseInt(t.substring(1,4),10),o={name:"AES-GCM",length:i},s=["encrypt","decrypt"];break;default:throw new r('unsupported or invalid JWK "alg" (Algorithm) Parameter value')}return F.subtle.generateKey(o,null!==(n=null==e?void 0:e.extractable)&&void 0!==n&&n,s)}(t,e)}Wt(Qt,{CompactEncrypt:()=>ct,CompactSign:()=>gt,EmbeddedJWK:()=>xe,EncryptJWT:()=>Tt,FlattenedEncrypt:()=>ut,FlattenedSign:()=>vt,GeneralSign:()=>St,JOSEAlgNotAllowed:()=>i,JOSEError:()=>e,JOSENotSupported:()=>r,JWEDecryptionFailed:()=>o,JWEInvalid:()=>s,JWKInvalid:()=>c,JWKSInvalid:()=>l,JWKSMultipleMatchingKeys:()=>d,JWKSNoMatchingKey:()=>h,JWSInvalid:()=>a,JWSSignatureVerificationFailed:()=>f,JWTClaimValidationFailed:()=>n,JWTExpired:()=>p,JWTInvalid:()=>u,SignJWT:()=>It,UnsecuredJWT:()=>Ot,base64UrlDecode:()=>Pt,base64UrlEncode:()=>Nt,calculateThumbprint:()=>ke,compactDecrypt:()=>we,compactVerify:()=>Ce,createRemoteJWKSet:()=>Ee,decodeProtectedHeader:()=>Ie,flattenedDecrypt:()=>me,flattenedVerify:()=>_e,fromKeyLike:()=>be,generalDecrypt:()=>ye,generalVerify:()=>je,generateKeyPair:()=>Ne,generateSecret:()=>Pe,jwtDecrypt:()=>Re,jwtVerify:()=>Te,parseJwk:()=>fe,random:()=>Dt});var De,Me,Ue=zt({"node_modules/@inrupt/jose-legacy-modules/dist/index.es.js"(){(e=class extends Error{constructor(t){super(t),this.code=e.code,this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}).code="ERR_JOSE_GENERIC",(n=class extends e{constructor(t,e="unspecified",i="unspecified"){super(t),this.code=n.code,this.claim=e,this.reason=i}}).code="ERR_JWT_CLAIM_VALIDATION_FAILED",(i=class extends e{constructor(){super(...arguments),this.code=i.code}}).code="ERR_JOSE_ALG_NOT_ALLOWED",(r=class extends e{constructor(){super(...arguments),this.code=r.code}}).code="ERR_JOSE_NOT_SUPPORTED",(o=class extends e{constructor(){super(...arguments),this.code=o.code,this.message="decryption operation failed"}}).code="ERR_JWE_DECRYPTION_FAILED",(s=class extends e{constructor(){super(...arguments),this.code=s.code}}).code="ERR_JWE_INVALID",(a=class extends e{constructor(){super(...arguments),this.code=a.code}}).code="ERR_JWS_INVALID",(u=class extends e{constructor(){super(...arguments),this.code=u.code}}).code="ERR_JWT_INVALID",(c=class extends e{constructor(){super(...arguments),this.code=c.code}}).code="ERR_JWK_INVALID",(l=class extends e{constructor(){super(...arguments),this.code=l.code}}).code="ERR_JWKS_INVALID",(h=class extends e{constructor(){super(...arguments),this.code=h.code,this.message="no applicable key found in the JSON Web Key Set"}}).code="ERR_JWKS_NO_MATCHING_KEY",(d=class extends e{constructor(){super(...arguments),this.code=d.code,this.message="multiple matching keys found in the JSON Web Key Set"}}).code="ERR_JWKS_MULTIPLE_MATCHING_KEYS",(f=class extends e{constructor(){super(...arguments),this.code=f.code,this.message="signature verification failed"}}).code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED",(p=class extends n{constructor(){super(...arguments),this.code=p.code}}).code="ERR_JWT_EXPIRED",v=(...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},g=new TextEncoder,m=new TextDecoder,w=2**32,b=function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;throw new Error("unable to locate global object")}(),y=t=>{let e=t;"string"==typeof e&&(e=g.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 b.btoa(n.join("")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},x=t=>{let e=t;e instanceof Uint8Array&&(e=m.decode(e)),e=e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return new Uint8Array(b.atob(e).split("").map((t=>t.charCodeAt(0))))}catch(t){throw new TypeError("The input to be decoded is not correctly encoded.")}},k=new Map([["A128CBC-HS256",128],["A128GCM",96],["A128GCMKW",96],["A192CBC-HS384",128],["A192GCM",96],["A192GCMKW",96],["A256CBC-HS512",128],["A256GCM",96],["A256GCMKW",96]]),S=t=>e=>{const n=k.get(e);if(!n)throw new r(`Unsupported JWE Algorithm: ${e}`);return t(new Uint8Array(n>>3))},E=(t,e)=>{if(e.length<<3!==k.get(t))throw new s("Invalid Initialization Vector length")},A=(t,e)=>{let n;switch(t){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":if(n=parseInt(t.substr(-3),10),!(e instanceof Uint8Array))throw new TypeError(`${t} content encryption requires Uint8Array as key input`);break;case"A128GCM":case"A192GCM":case"A256GCM":n=parseInt(t.substr(1,3),10);break;default:throw new r(`Content Encryption Algorithm ${t} is not supported either by JOSE or your javascript runtime`)}if(e instanceof Uint8Array){if(e.length<<3!==n)throw new s("Invalid Content Encryption Key length")}else{if(!ae(e))throw new TypeError("Invalid Content Encryption Key type");{const{length:t}=e.algorithm;if(t!==n)throw new s("Invalid Content Encryption Key length")}}},_=(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},C=(t,...e)=>{let n="Key must be ";if(e.length>2){const t=e.pop();n+=`one of type ${e.join(", ")}, or ${t}.`}else n+=2===e.length?`one of type ${e[0]} or ${e[1]}.`:`of type ${e[0]}.`;return null==t?n+=` Received ${t}`:"function"==typeof t&&t.name?n+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor&&t.constructor.name&&(n+=` Received an instance of ${t.constructor.name}`),n},j=async(t,e,n,i,s,a)=>{if(!(ae(e)||e instanceof Uint8Array))throw new TypeError(C(e,"CryptoKey","Uint8Array"));switch(A(t,e),E(t,i),t){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return async function(t,e,n,i,r,s){const a=parseInt(t.substr(1,3),10),u=await F.subtle.importKey("raw",e.subarray(a>>3),"AES-CBC",!1,["decrypt"]),c=await F.subtle.importKey("raw",e.subarray(0,a>>3),{hash:{name:"SHA-"+(a<<1)},name:"HMAC"},!1,["sign"]),l=ee(s,i,n,re(s.length<<3)),h=new Uint8Array((await F.subtle.sign("HMAC",c,l)).slice(0,a>>3));let d,f;try{d=_(r,h)}catch(t){}if(!d)throw new o;try{f=new Uint8Array(await F.subtle.decrypt({iv:i,name:"AES-CBC"},u,n))}catch(t){}if(!f)throw new o;return f}(t,e,n,i,s,a);case"A128GCM":case"A192GCM":case"A256GCM":return async function(t,e,n,i,r){const s=t instanceof Uint8Array?await F.subtle.importKey("raw",t,"AES-GCM",!1,["decrypt"]):t;try{return new Uint8Array(await F.subtle.decrypt({additionalData:r,iv:n,name:"AES-GCM",tagLength:128},s,ee(e,i)))}catch(t){throw new o}}(e,n,i,s,a);default:throw new r("unsupported JWE Content Encryption Algorithm")}},R=async()=>{throw new r('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, e.g. using the "pako" module.')},T=async()=>{throw new r('JWE "zip" (Compression Algorithm) Header Parameter is not supported by your javascript runtime.')},I=[{hash:{name:"SHA-256"},name:"HMAC"},!0,["sign"]],O=async(t,e,n)=>{const i=await ce(e,"wrapKey");ue(i,t);const r=await F.subtle.importKey("raw",n,...I);return new Uint8Array(await F.subtle.wrapKey("raw",r,i,"AES-KW"))},N=async(t,e,n)=>{const i=await ce(e,"unwrapKey");ue(i,t);const r=await F.subtle.unwrapKey("raw",n,i,"AES-KW",...I);return new Uint8Array(await F.subtle.exportKey("raw",r))},P=async(t,e)=>{const n=`SHA-${t.substr(-3)}`;return new Uint8Array(await F.subtle.digest(n,e))},D=async(t,e,n,i,r=new Uint8Array(0),o=new Uint8Array(0))=>{if(!ae(t))throw new TypeError(C(t,"CryptoKey"));if(!ae(e))throw new TypeError(C(e,"CryptoKey"));const s=ee(se(g.encode(n)),se(r),se(o),oe(i));if(!e.usages.includes("deriveBits"))throw new TypeError('ECDH-ES private key "usages" must include "deriveBits"');const a=new Uint8Array(await F.subtle.deriveBits({name:"ECDH",public:t},e,Math.ceil(parseInt(e.algorithm.namedCurve.substr(-3),10)/8)<<3));return async function(t,e,n,i){const r=Math.ceil((n>>3)/32);let o;for(let n=1;n<=r;n++){const r=new Uint8Array(4+e.length+i.length);r.set(oe(n)),r.set(e,4),r.set(i,4+e.length),o=o?ee(o,await t("sha256",r)):await t("sha256",r)}return o=o.slice(0,n>>3),o}(P,a,i,s)},M=async t=>{if(!ae(t))throw new TypeError(C(t,"CryptoKey"));return(await F.subtle.generateKey({name:"ECDH",namedCurve:t.algorithm.namedCurve},!0,["deriveBits"])).privateKey},U=t=>{if(!ae(t))throw new TypeError(C(t,"CryptoKey"));return["P-256","P-384","P-521"].includes(t.algorithm.namedCurve)},L=(F=b.crypto).getRandomValues.bind(F),B=async(t,e,n,i=Math.floor(2049*Math.random())+2048,r=L(new Uint8Array(16)))=>{le(r);const o=ne(t,r),s=parseInt(t.substr(13,3),10),a={hash:{name:`SHA-${t.substr(8,3)}`},iterations:i,name:"PBKDF2",salt:o},u={length:s,name:"AES-KW"},c=await he(e);let l;if(c.usages.includes("deriveBits"))l=new Uint8Array(await F.subtle.deriveBits(a,c,s));else{if(!c.usages.includes("deriveKey"))throw new TypeError('PBKDF2 key "usages" must include "deriveBits" or "deriveKey"');l=await F.subtle.deriveKey(a,c,u,!1,["wrapKey"])}return{encryptedKey:await O(t.substr(-6),l,n),p2c:i,p2s:y(r)}},$=async(t,e,n,i,r)=>{le(r);const o=ne(t,r),s=parseInt(t.substr(13,3),10),a={hash:{name:`SHA-${t.substr(8,3)}`},iterations:i,name:"PBKDF2",salt:o},u={length:s,name:"AES-KW"},c=await he(e);let l;if(c.usages.includes("deriveBits"))l=new Uint8Array(await F.subtle.deriveBits(a,c,s));else{if(!c.usages.includes("deriveKey"))throw new TypeError('PBKDF2 key "usages" must include "deriveBits" or "deriveKey"');l=await F.subtle.deriveKey(a,c,u,!1,["unwrapKey"])}return N(t.substr(-6),l,n)},H=(t,e)=>{if(t.startsWith("HS")){const n=parseInt(t.substr(-3),10),{length:i}=e.algorithm;if("number"!=typeof i||i<n)throw new TypeError(`${t} requires symmetric keys to be ${n} bits or larger`)}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`)}},J=async(t,e,n)=>{if(!ae(e))throw new TypeError(C(e,"CryptoKey"));if(H(t,e),e.usages.includes("encrypt"))return new Uint8Array(await F.subtle.encrypt(de(t),e,n));if(e.usages.includes("wrapKey")){const i=await F.subtle.importKey("raw",n,...I);return new Uint8Array(await F.subtle.wrapKey("raw",i,e,de(t)))}throw new TypeError('RSA-OAEP key "usages" must include "encrypt" or "wrapKey" for this operation')},z=async(t,e,n)=>{if(!ae(e))throw new TypeError(C(e,"CryptoKey"));if(H(t,e),e.usages.includes("decrypt"))return new Uint8Array(await F.subtle.decrypt(de(t),e,n));if(e.usages.includes("unwrapKey")){const i=await F.subtle.unwrapKey("raw",n,e,de(t),...I);return new Uint8Array(await F.subtle.exportKey("raw",i))}throw new TypeError('RSA-OAEP key "usages" must include "decrypt" or "unwrapKey" for this operation')},K=async(t,e,n,i,o)=>{if(!(ae(n)||n instanceof Uint8Array))throw new TypeError(C(n,"CryptoKey","Uint8Array"));switch(A(t,n),E(t,i),t){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return async function(t,e,n,i,r){const o=parseInt(t.substr(1,3),10),s=await F.subtle.importKey("raw",n.subarray(o>>3),"AES-CBC",!1,["encrypt"]),a=await F.subtle.importKey("raw",n.subarray(0,o>>3),{hash:{name:"SHA-"+(o<<1)},name:"HMAC"},!1,["sign"]),u=new Uint8Array(await F.subtle.encrypt({iv:i,name:"AES-CBC"},s,e)),c=ee(r,i,u,re(r.length<<3));return{ciphertext:u,tag:new Uint8Array((await F.subtle.sign("HMAC",a,c)).slice(0,o>>3))}}(t,e,n,i,o);case"A128GCM":case"A192GCM":case"A256GCM":return async function(t,e,n,i){const r=e instanceof Uint8Array?await F.subtle.importKey("raw",e,"AES-GCM",!1,["encrypt"]):e,o=new Uint8Array(await F.subtle.encrypt({additionalData:i,iv:n,name:"AES-GCM",tagLength:128},r,t)),s=o.slice(-16);return{ciphertext:o.slice(0,-16),tag:s}}(e,n,i,o);default:throw new r("unsupported JWE Content Encryption Algorithm")}},W=S(L),q=async(t,e,n,i)=>{const r=t.substr(0,7);i||(i=W(r));const{ciphertext:o,tag:s}=await K(r,n,e,i,new Uint8Array(0));return{encryptedKey:o,iv:y(i),tag:y(s)}},V=async(t,e,n,i,r)=>{const o=t.substr(0,7);return j(o,e,n,i,r,new Uint8Array(0))},G=new Map([["A128CBC-HS256",256],["A128GCM",128],["A192CBC-HS384",384],["A192GCM",192],["A256CBC-HS512",512],["A256GCM",256]]),Y=async t=>{var e,n;const{algorithm:i,keyUsages:o}=function(t){let e,n;switch(t.kty){case"oct":switch(t.alg){case"HS256":case"HS384":case"HS512":e={name:"HMAC",hash:{name:`SHA-${t.alg.substr(-3)}`}},n=["sign","verify"];break;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":throw new r(`${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 r('unsupported or invalid JWK "alg" (Algorithm) Parameter value')}break;case"RSA":switch(t.alg){case"PS256":case"PS384":case"PS512":e={name:"RSA-PSS",hash:{name:`SHA-${t.alg.substr(-3)}`}},n=t.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":e={name:"RSASSA-PKCS1-v1_5",hash:{name:`SHA-${t.alg.substr(-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:{name:`SHA-${parseInt(t.alg.substr(-3),10)||1}`}},n=t.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new r('unsupported or invalid JWK "alg" (Algorithm) Parameter value')}break;case"EC":switch(t.alg){case"ES256":case"ES384":case"ES512":e={name:"ECDSA",namedCurve: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:"ECDH",namedCurve:t.crv},n=t.d?["deriveBits"]:[];break;default:throw new r('unsupported or invalid JWK "alg" (Algorithm) Parameter value')}break;default:throw new r('unsupported or invalid JWK "kty" (Key Type) Parameter value')}return{algorithm:e,keyUsages:n}}(t);let s="jwk",a={...t};return delete a.alg,"PBKDF2"===i.name&&(s="raw",a=x(t.k)),F.subtle.importKey(s,a,i,null!==(e=t.ext)&&void 0!==e&&e,null!==(n=t.key_ops)&&void 0!==n?n:o)},Z=(t,e,n)=>{if(!(e instanceof Uint8Array||(null==e?void 0:e.type)))throw new TypeError(C(e,"KeyObject","CryptoKey","Uint8Array"));if(t.startsWith("HS")||"dir"===t||t.startsWith("PBES2")||t.match(/^A\d{3}(?:GCM)?KW$/)){if(e instanceof Uint8Array||"secret"===e.type)return;throw new TypeError('CryptoKey or KeyObject instances for symmetric algorithms must be of type "secret"')}if(e instanceof Uint8Array)throw new TypeError(C(e,"KeyObject","CryptoKey"));if("secret"===e.type)throw new TypeError('CryptoKey or KeyObject instances for asymmetric algorithms must not be of type "secret"');if("sign"===n&&"public"===e.type)throw new TypeError('CryptoKey or KeyObject instances for asymmetric algorithm signing must be of type "private"');if("decrypt"===n&&"public"===e.type)throw new TypeError('CryptoKey or KeyObject instances for asymmetric algorithm decryption must be of type "private"')},Q=(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)},tt=(X=t=>e=>{const n=G.get(e);if(!n)throw new r(`Unsupported JWE Algorithm: ${e}`);return t(new Uint8Array(n>>3))})(L),et=ge.bind(void 0,s,new Map),nt=Q.bind(void 0,"keyManagementAlgorithms"),it=Q.bind(void 0,"contentEncryptionAlgorithms"),rt=async t=>{if(t instanceof Uint8Array)return{kty:"oct",k:y(t)};if(!ae(t))throw new TypeError(C(t,"CryptoKey","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 F.subtle.exportKey("jwk",t);return o},ot=X(L),st=S(L),at=ge.bind(void 0,s,new Map),ut=class{constructor(t){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 s("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(!v(this._protectedHeader,this._unprotectedHeader,this._sharedUnprotectedHeader))throw new s("JWE Shared Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");const n={...this._protectedHeader,...this._unprotectedHeader,...this._sharedUnprotectedHeader};if(at(null==e?void 0:e.crit,this._protectedHeader,n),void 0!==n.zip){if(!this._protectedHeader||!this._protectedHeader.zip)throw new s('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==n.zip)throw new r('unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:i,enc:o}=n;if("string"!=typeof i||!i)throw new s('JWE "alg" (Algorithm) Header Parameter missing or invalid');if("string"!=typeof o||!o)throw new s('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');let a,u,c,l,h,d,f;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 e;({cek:u,encryptedKey:a,parameters:e}=await async function(t,e,n,i,o={}){let s,a,u;switch(Z(t,n,"encrypt"),t){case"dir":u=n;break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!U(n))throw new r("ECDH-ES with the provided key is not allowed or not supported by your javascript runtime");const{apu:c,apv:l}=o;let{epk:h}=o;h||(h=await M(n));const{x:d,y:f,crv:p,kty:v}=await be(h),g=await D(n,h,"ECDH-ES"===t?e:t,parseInt(t.substr(-5,3),10)||G.get(e),c,l);if(a={epk:{x:d,y:f,crv:p,kty:v}},c&&(a.apu=y(c)),l&&(a.apv=y(l)),"ECDH-ES"===t){u=g;break}u=i||ot(e);const m=t.substr(-6);s=await O(m,g,u);break}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":u=i||ot(e),s=await J(t,n,u);break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{u=i||ot(e);const{p2c:r,p2s:c}=o;({encryptedKey:s,...a}=await B(t,n,u,r,c));break}case"A128KW":case"A192KW":case"A256KW":u=i||ot(e),s=await O(t,n,u);break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{u=i||ot(e);const{iv:r}=o;({encryptedKey:s,...a}=await q(t,n,u,r));break}default:throw new r('unsupported or invalid "alg" (JWE Algorithm) header value')}return{cek:u,encryptedKey:s,parameters:a}}(i,o,t,this._cek,this._keyManagementParameters)),e&&(this._protectedHeader?this._protectedHeader={...this._protectedHeader,...e}:this.setProtectedHeader(e))}if(this._iv||(this._iv=st(o)),l=g.encode(this._protectedHeader?y(JSON.stringify(this._protectedHeader)):""),this._aad?(h=y(this._aad),c=ee(l,g.encode("."),g.encode(h))):c=l,"DEF"===n.zip){const t=await((null==e?void 0:e.deflateRaw)||T)(this._plaintext);({ciphertext:d,tag:f}=await K(o,t,u,this._iv,c))}else({ciphertext:d,tag:f}=await K(o,this._plaintext,u,this._iv,c));const p={ciphertext:y(d),iv:y(this._iv),tag:y(f)};return a&&(p.encrypted_key=y(a)),h&&(p.aad=h),this._protectedHeader&&(p.protected=m.decode(l)),this._sharedUnprotectedHeader&&(p.unprotected=this._sharedUnprotectedHeader),this._unprotectedHeader&&(p.header=this._unprotectedHeader),p}},ct=class{constructor(t){this._flattened=new ut(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(".")}},lt=(t,e)=>{if("string"!=typeof t||!t)throw new c(`${e} missing or invalid`)},ht=async(t,n)=>{let i;"function"==typeof AbortController&&(i=new AbortController,setTimeout((()=>i.abort()),n));const r=await b.fetch(t.href,{signal:i?i.signal:void 0,redirect:"manual",referrerPolicy:"no-referrer",credentials:"omit",mode:"cors",method:"GET"});if(200!==r.status)throw new e("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await r.json()}catch(t){throw new e("Failed to parse the JSON Web Key Set HTTP response as JSON")}},dt=class{constructor(t,e){if(this._cached=new WeakMap,!(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},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}coolingDown(){return void 0!==this._cooldownStarted&&Date.now()<this._cooldownStarted+this._cooldownDuration}async getKey(t){this._jwks||await this.reload();const e=this._jwks.keys.filter((e=>{let n=e.kty===function(t){switch(t.substr(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";default:throw new r('Unsupported "alg" value for a JSON Web Key Set')}}(t.alg);if(n&&"string"==typeof t.kid&&(n=t.kid===e.kid),n&&"string"==typeof e.alg&&(n=t.alg===e.alg),n&&"string"==typeof e.use&&(n="sig"===e.use),n&&Array.isArray(e.key_ops)&&(n=e.key_ops.includes("verify")),n&&"EdDSA"===t.alg&&(n=["Ed25519","Ed448"].includes(e.crv)),n)switch(t.alg){case"ES256":n="P-256"===e.crv;break;case"ES256K":n="secp256k1"===e.crv;break;case"ES384":n="P-384"===e.crv;break;case"ES512":n="P-521"===e.crv}return n})),{0:n,length:i}=e;if(0===i){if(!1===this.coolingDown())return await this.reload(),this.getKey(t);throw new h}if(1!==i)throw new d;this._cached.has(n)||this._cached.set(n,{});const o=this._cached.get(n);if(void 0===o[t.alg]){const e=await fe({...n,alg:t.alg});if("public"!==e.type)throw new l("JSON Web Key Set members must be public keys");o[t.alg]=e}return o[t.alg]}async reload(){this._pendingFetch||(this._pendingFetch=ht(this._url,this._timeoutDuration).then((t=>{if("object"!=typeof t||!t||!Array.isArray(t.keys)||!t.keys.every(Se))throw new l("JSON Web Key Set malformed");this._jwks={keys:t.keys},this._cooldownStarted=Date.now(),this._pendingFetch=void 0})).catch((t=>{throw this._pendingFetch=void 0,t}))),await this._pendingFetch}},ft=async(t,e,n)=>{const i=await Ae(t,e,"sign");H(t,i);const r=await F.subtle.sign(Fe(t),i,n);return new Uint8Array(r)},pt=ge.bind(void 0,a,new Map([["b64",!0]])),vt=class{constructor(t){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 a("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!v(this._protectedHeader,this._unprotectedHeader))throw new a("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const n={...this._protectedHeader,...this._unprotectedHeader};let i=!0;if(pt(null==e?void 0:e.crit,this._protectedHeader,n).has("b64")&&(i=this._protectedHeader.b64,"boolean"!=typeof i))throw new a('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:r}=n;if("string"!=typeof r||!r)throw new a('JWS "alg" (Algorithm) Header Parameter missing or invalid');Z(r,t,"sign");let o,s=this._payload;i&&(s=g.encode(y(s))),o=g.encode(this._protectedHeader?y(JSON.stringify(this._protectedHeader)):"");const u=ee(o,g.encode("."),s),c=await ft(r,t,u),l={signature:y(c),payload:""};return i&&(l.payload=m.decode(s)),this._unprotectedHeader&&(l.header=this._unprotectedHeader),this._protectedHeader&&(l.protected=m.decode(o)),l}},gt=class{constructor(t){this._flattened=new vt(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}`}},mt=async(t,e,n,i)=>{const r=await Ae(t,e,"verify");H(t,r);const o=Fe(t);try{return await F.subtle.verify(o,r,n,i)}catch(t){return!1}},wt=ge.bind(void 0,a,new Map([["b64",!0]])),bt=Q.bind(void 0,"algorithms"),yt=new WeakMap,xt=class{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}set _protectedHeader(t){yt.get(this).protectedHeader=t}get _protectedHeader(){return yt.get(this).protectedHeader}set _unprotectedHeader(t){yt.get(this).unprotectedHeader=t}get _unprotectedHeader(){return yt.get(this).unprotectedHeader}},St=class{constructor(t){this._signatures=[],this._payload=t}addSignature(t,e){const n=new xt;return yt.set(n,{key:t,options:e}),this._signatures.push(n),n}async sign(){if(!this._signatures.length)throw new a("at least one signature must be added");const t={signatures:[],payload:""};let e=new Set;if(await Promise.all(this._signatures.map((async n=>{const{protectedHeader:i,unprotectedHeader:r,options:o,key:s}=yt.get(n),a=new vt(this._payload);i&&a.setProtectedHeader(i),r&&a.setUnprotectedHeader(r);const{payload:u,...c}=await a.sign(s,o);e.add(u),t.payload=u,t.signatures.push(c)}))),1!==e.size)throw new a("inconsistent use of JWS Unencoded Payload Option (RFC7797)");return t}},Et=t=>Math.floor(t.getTime()/1e3),86400,Ft=/^(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)$/i,At=t=>{const e=Ft.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)}},_t=t=>t.toLowerCase().replace(/^application\//,""),Ct=(t,e)=>"string"==typeof t?e.includes(t):!!Array.isArray(t)&&e.some(Set.prototype.has.bind(new Set(t))),jt=(t,e,i={})=>{const{typ:r}=i;if(r&&("string"!=typeof t.typ||_t(t.typ)!==_t(r)))throw new n('unexpected "typ" JWT header value',"typ","check_failed");let o;try{o=JSON.parse(m.decode(e))}catch(t){}if(!te(o))throw new u("JWT Claims Set must be a top-level JSON object");const{issuer:s}=i;if(s&&!(Array.isArray(s)?s:[s]).includes(o.iss))throw new n('unexpected "iss" claim value',"iss","check_failed");const{subject:a}=i;if(a&&o.sub!==a)throw new n('unexpected "sub" claim value',"sub","check_failed");const{audience:c}=i;if(c&&!Ct(o.aud,"string"==typeof c?[c]:c))throw new n('unexpected "aud" claim value',"aud","check_failed");let l;switch(typeof i.clockTolerance){case"string":l=At(i.clockTolerance);break;case"number":l=i.clockTolerance;break;case"undefined":l=0;break;default:throw new TypeError("Invalid clockTolerance option type")}const{currentDate:h}=i,d=Et(h||new Date);if(void 0!==o.iat||i.maxTokenAge){if("number"!=typeof o.iat)throw new n('"iat" claim must be a number',"iat","invalid");if(void 0===o.exp&&o.iat>d+l)throw new n('"iat" claim timestamp check failed (it should be in the past)',"iat","check_failed")}if(void 0!==o.nbf){if("number"!=typeof o.nbf)throw new n('"nbf" claim must be a number',"nbf","invalid");if(o.nbf>d+l)throw new n('"nbf" claim timestamp check failed',"nbf","check_failed")}if(void 0!==o.exp){if("number"!=typeof o.exp)throw new n('"exp" claim must be a number',"exp","invalid");if(o.exp<=d-l)throw new p('"exp" claim timestamp check failed',"exp","check_failed")}if(i.maxTokenAge){const t=d-o.iat;if(t-l>("number"==typeof i.maxTokenAge?i.maxTokenAge:At(i.maxTokenAge)))throw new p('"iat" claim timestamp check failed (too far in the past)',"iat","check_failed");if(t<0-l)throw new n('"iat" claim timestamp check failed (it should be in the past)',"iat","check_failed")}return o},Rt=class{constructor(t){if(!te(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:Et(new Date)+At(t)},this}setExpirationTime(t){return this._payload="number"==typeof t?{...this._payload,exp:t}:{...this._payload,exp:Et(new Date)+At(t)},this}setIssuedAt(t){return this._payload=void 0===t?{...this._payload,iat:Et(new Date)}:{...this._payload,iat:t},this}},Tt=class extends Rt{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 ct(g.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)}},It=class extends Rt{setProtectedHeader(t){return this._protectedHeader=t,this}async sign(t,e){var n;const i=new gt(g.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 u("JWTs MUST NOT use unencoded payload");return i.sign(t,e)}},Ot=class extends Rt{encode(){return`${y(JSON.stringify({alg:"none"}))}.${y(JSON.stringify(this._payload))}.`}static decode(t,e){if("string"!=typeof t)throw new u("Unsecured JWT must be a string");const{0:n,1:i,2:r,length:o}=t.split(".");if(3!==o||""!==r)throw new u("Invalid Unsecured JWT");let s;try{if(s=JSON.parse(m.decode(x(n))),"none"!==s.alg)throw new Error}catch(t){throw new u("Invalid Unsecured JWT")}return{payload:jt(s,x(i),e),header:s}}},Nt=y,Pt=x,Dt=L}}),Le=Kt({"node_modules/@inrupt/solid-client-authn-core/dist/login/oidc/redirectHandler/IRedirectHandler.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getWebidFromTokenPayload=t.fetchJwks=void 0;var e=Zt(),n=(Ue(),Qt);async function i(t,n){const i=await 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 n.jwtVerify(t,await n.parseJwk(s),{issuer:r,audience:o});a=e}catch(t){throw new Error(`ID token verification failed: ${t.stack}`)}if("string"==typeof a.webid)return a.webid;if("string"!=typeof a.sub)throw new Error(`The ID 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 ID token has no 'webid' claim, and its 'sub' claim of [${a.sub}] is invalid as a URL - error [${t}].`)}}}}),Be=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)}}}),$e=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"}}),He=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)?"https://solidproject.org/TR/solid-oidc"===n.solidOidcSupported&&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})}}}),Je=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=(Ue(),Qt),i=e(Xt());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{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.toString()}`)}},t.saveSessionInfoToStorage=async function(t,e,i,r,o,s,a,u){void 0!==s&&await t.setForUser(e,{refreshToken:s},{secure:a}),void 0!==i&&await t.setForUser(e,{idToken:i},{secure:a}),void 0!==r&&await t.setForUser(e,{webId:r},{secure:a}),void 0!==o&&await t.setForUser(e,{isLoggedIn:o},{secure:a}),void 0!==u&&await t.setForUser(e,{publicKey:JSON.stringify(u.publicKey),privateKey:JSON.stringify(await n.fromKeyLike(u.privateKey))},{secure:a})},t.default=class{constructor(t,e){this.secureStorage=t,this.insecureStorage=e,this.RESOURCE_SERVER_SESSION_INFORMATION_KEY="tmp-resource-server-session-info"}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))}async storeResourceServerSessionInfo(t,e,n){var i;const r=JSON.parse(null!==(i=await this.insecureStorage.get(this.RESOURCE_SERVER_SESSION_INFORMATION_KEY))&&void 0!==i?i:"{}");r.webId!==t&&(r.sessions={}),r.webId=t,r.sessions[e]={expiration:n},await this.insecureStorage.set(this.RESOURCE_SERVER_SESSION_INFORMATION_KEY,JSON.stringify(r))}async clearResourceServerSessionInfo(t){var e;const n=JSON.parse(null!==(e=await this.insecureStorage.get(this.RESOURCE_SERVER_SESSION_INFORMATION_KEY))&&void 0!==e?e:"{}");void 0!==n.sessions&&(delete n.sessions[t],0===Object.keys(n.sessions).length?await this.insecureStorage.set(this.RESOURCE_SERVER_SESSION_INFORMATION_KEY,"{}"):await this.insecureStorage.set(this.RESOURCE_SERVER_SESSION_INFORMATION_KEY,JSON.stringify(n)))}}}}),ze=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]}}}}),Ke=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}}),We=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}}),qe=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}}),Ve=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 Ge(){if(!De&&!(De="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 De(Me)}var Xe,Ye,Ze=zt({"node_modules/uuid/dist/esm-browser/rng.js"(){Me=new Uint8Array(16)}}),Qe=zt({"node_modules/uuid/dist/esm-browser/regex.js"(){Xe=/^(?:[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 tn(t){return"string"==typeof t&&Xe.test(t)}var en,nn,rn,on=zt({"node_modules/uuid/dist/esm-browser/validate.js"(){Qe(),Ye=tn}});function sn(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(en[t[e+0]]+en[t[e+1]]+en[t[e+2]]+en[t[e+3]]+"-"+en[t[e+4]]+en[t[e+5]]+"-"+en[t[e+6]]+en[t[e+7]]+"-"+en[t[e+8]]+en[t[e+9]]+"-"+en[t[e+10]]+en[t[e+11]]+en[t[e+12]]+en[t[e+13]]+en[t[e+14]]+en[t[e+15]]).toLowerCase();if(!Ye(n))throw TypeError("Stringified UUID is invalid");return n}var an,un,cn,ln,hn,dn=zt({"node_modules/uuid/dist/esm-browser/stringify.js"(){for(on(),en=[],nn=0;nn<256;++nn)en.push((nn+256).toString(16).substr(1));rn=sn}});function fn(t,e,n){var i=e&&n||0,r=e||new Array(16),o=(t=t||{}).node||an,s=void 0!==t.clockseq?t.clockseq:un;if(null==o||null==s){var a=t.random||(t.rng||Ge)();null==o&&(o=an=[1|a[0],a[1],a[2],a[3],a[4],a[5]]),null==s&&(s=un=16383&(a[6]<<8|a[7]))}var u=void 0!==t.msecs?t.msecs:Date.now(),c=void 0!==t.nsecs?t.nsecs:ln+1,l=u-cn+(c-ln)/1e4;if(l<0&&void 0===t.clockseq&&(s=s+1&16383),(l<0||u>cn)&&void 0===t.nsecs&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");cn=u,ln=c,un=s;var h=(1e4*(268435455&(u+=122192928e5))+c)%4294967296;r[i++]=h>>>24&255,r[i++]=h>>>16&255,r[i++]=h>>>8&255,r[i++]=255&h;var d=u/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||rn(r)}var pn,vn=zt({"node_modules/uuid/dist/esm-browser/v1.js"(){Ze(),dn(),cn=0,ln=0,hn=fn}});function gn(t){if(!Ye(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 mn,wn,bn=zt({"node_modules/uuid/dist/esm-browser/parse.js"(){on(),pn=gn}});function yn(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=pn(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 rn(s)}try{i.name=t}catch(t){}return i.DNS=mn,i.URL=wn,i}var xn,kn=zt({"node_modules/uuid/dist/esm-browser/v35.js"(){dn(),bn(),mn="6ba7b810-9dad-11d1-80b4-00c04fd430c8",wn="6ba7b811-9dad-11d1-80b4-00c04fd430c8"}});function Sn(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[En(e)-1]=e;for(var n=1732584193,i=-271733879,r=-1732584194,o=271733878,s=0;s<t.length;s+=16){var a=n,u=i,c=r,l=o;n=_n(n,i,r,o,t[s],7,-680876936),o=_n(o,n,i,r,t[s+1],12,-389564586),r=_n(r,o,n,i,t[s+2],17,606105819),i=_n(i,r,o,n,t[s+3],22,-1044525330),n=_n(n,i,r,o,t[s+4],7,-176418897),o=_n(o,n,i,r,t[s+5],12,1200080426),r=_n(r,o,n,i,t[s+6],17,-1473231341),i=_n(i,r,o,n,t[s+7],22,-45705983),n=_n(n,i,r,o,t[s+8],7,1770035416),o=_n(o,n,i,r,t[s+9],12,-1958414417),r=_n(r,o,n,i,t[s+10],17,-42063),i=_n(i,r,o,n,t[s+11],22,-1990404162),n=_n(n,i,r,o,t[s+12],7,1804603682),o=_n(o,n,i,r,t[s+13],12,-40341101),r=_n(r,o,n,i,t[s+14],17,-1502002290),n=Cn(n,i=_n(i,r,o,n,t[s+15],22,1236535329),r,o,t[s+1],5,-165796510),o=Cn(o,n,i,r,t[s+6],9,-1069501632),r=Cn(r,o,n,i,t[s+11],14,643717713),i=Cn(i,r,o,n,t[s],20,-373897302),n=Cn(n,i,r,o,t[s+5],5,-701558691),o=Cn(o,n,i,r,t[s+10],9,38016083),r=Cn(r,o,n,i,t[s+15],14,-660478335),i=Cn(i,r,o,n,t[s+4],20,-405537848),n=Cn(n,i,r,o,t[s+9],5,568446438),o=Cn(o,n,i,r,t[s+14],9,-1019803690),r=Cn(r,o,n,i,t[s+3],14,-187363961),i=Cn(i,r,o,n,t[s+8],20,1163531501),n=Cn(n,i,r,o,t[s+13],5,-1444681467),o=Cn(o,n,i,r,t[s+2],9,-51403784),r=Cn(r,o,n,i,t[s+7],14,1735328473),n=jn(n,i=Cn(i,r,o,n,t[s+12],20,-1926607734),r,o,t[s+5],4,-378558),o=jn(o,n,i,r,t[s+8],11,-2022574463),r=jn(r,o,n,i,t[s+11],16,1839030562),i=jn(i,r,o,n,t[s+14],23,-35309556),n=jn(n,i,r,o,t[s+1],4,-1530992060),o=jn(o,n,i,r,t[s+4],11,1272893353),r=jn(r,o,n,i,t[s+7],16,-155497632),i=jn(i,r,o,n,t[s+10],23,-1094730640),n=jn(n,i,r,o,t[s+13],4,681279174),o=jn(o,n,i,r,t[s],11,-358537222),r=jn(r,o,n,i,t[s+3],16,-722521979),i=jn(i,r,o,n,t[s+6],23,76029189),n=jn(n,i,r,o,t[s+9],4,-640364487),o=jn(o,n,i,r,t[s+12],11,-421815835),r=jn(r,o,n,i,t[s+15],16,530742520),n=Rn(n,i=jn(i,r,o,n,t[s+2],23,-995338651),r,o,t[s],6,-198630844),o=Rn(o,n,i,r,t[s+7],10,1126891415),r=Rn(r,o,n,i,t[s+14],15,-1416354905),i=Rn(i,r,o,n,t[s+5],21,-57434055),n=Rn(n,i,r,o,t[s+12],6,1700485571),o=Rn(o,n,i,r,t[s+3],10,-1894986606),r=Rn(r,o,n,i,t[s+10],15,-1051523),i=Rn(i,r,o,n,t[s+1],21,-2054922799),n=Rn(n,i,r,o,t[s+8],6,1873313359),o=Rn(o,n,i,r,t[s+15],10,-30611744),r=Rn(r,o,n,i,t[s+6],15,-1560198380),i=Rn(i,r,o,n,t[s+13],21,1309151649),n=Rn(n,i,r,o,t[s+4],6,-145523070),o=Rn(o,n,i,r,t[s+11],10,-1120210379),r=Rn(r,o,n,i,t[s+2],15,718787259),i=Rn(i,r,o,n,t[s+9],21,-343485551),n=Fn(n,a),i=Fn(i,u),r=Fn(r,c),o=Fn(o,l)}return[n,i,r,o]}(function(t){if(0===t.length)return[];for(var e=8*t.length,n=new Uint32Array(En(e)),i=0;i<e;i+=8)n[i>>5]|=(255&t[i/8])<<i%32;return n}(t),8*t.length))}function En(t){return 14+(t+64>>>9<<4)+1}function Fn(t,e){var n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}function An(t,e,n,i,r,o){return Fn((s=Fn(Fn(e,t),Fn(i,o)))<<(a=r)|s>>>32-a,n);var s,a}function _n(t,e,n,i,r,o,s){return An(e&n|~e&i,t,e,r,o,s)}function Cn(t,e,n,i,r,o,s){return An(e&i|n&~i,t,e,r,o,s)}function jn(t,e,n,i,r,o,s){return An(e^n^i,t,e,r,o,s)}function Rn(t,e,n,i,r,o,s){return An(n^(e|~i),t,e,r,o,s)}var Tn,In,On,Nn=zt({"node_modules/uuid/dist/esm-browser/md5.js"(){xn=Sn}}),Pn=zt({"node_modules/uuid/dist/esm-browser/v3.js"(){kn(),Nn(),Tn=yn("v3",48,xn),In=Tn}});function Dn(t,e,n){var i=(t=t||{}).random||(t.rng||Ge)();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 rn(i)}var Mn,Un=zt({"node_modules/uuid/dist/esm-browser/v4.js"(){Ze(),dn(),On=Dn}});function Ln(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 Bn(t,e){return t<<e|t>>>32-e}function $n(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 u=new Uint32Array(16),c=0;c<16;++c)u[c]=t[64*a+4*c]<<24|t[64*a+4*c+1]<<16|t[64*a+4*c+2]<<8|t[64*a+4*c+3];s[a]=u}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]=Bn(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=Bn(p,5)+Ln(y,v,g,m)+w+e[y]+h[b]>>>0;w=m,m=g,g=Bn(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 Hn,Jn,zn,Kn,Wn=zt({"node_modules/uuid/dist/esm-browser/sha1.js"(){Mn=$n}}),qn=zt({"node_modules/uuid/dist/esm-browser/v5.js"(){kn(),Wn(),Hn=yn("v5",80,Mn),Jn=Hn}}),Vn=zt({"node_modules/uuid/dist/esm-browser/nil.js"(){zn="00000000-0000-0000-0000-000000000000"}});function Gn(t){if(!Ye(t))throw TypeError("Invalid UUID");return parseInt(t.substr(14,1),16)}var Xn=zt({"node_modules/uuid/dist/esm-browser/version.js"(){on(),Kn=Gn}}),Yn={};Wt(Yn,{NIL:()=>zn,parse:()=>pn,stringify:()=>rn,v1:()=>hn,v3:()=>In,v4:()=>On,v5:()=>Jn,validate:()=>Ye,version:()=>Kn});var Zn=zt({"node_modules/uuid/dist/esm-browser/index.js"(){vn(),Pn(),Un(),qn(),Vn(),Xn(),on(),dn(),bn()}}),Qn=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=(Ue(),Qt),n=(Zn(),Yn),i=Gt();function r(t){const e=new URL(t);return e.hash="",e.username="",e.password="",e.toString()}t.createDpopHeader=async function(t,o,s){return new e.SignJWT({htu:r(t),htm:o.toUpperCase(),jti: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 e.generateKeyPair(i.PREFERRED_SIGNING_ALG[0]),r={privateKey:t,publicKey:await e.fromKeyLike(n)};return[r.publicKey.alg]=i.PREFERRED_SIGNING_ALG,r}}}),ti=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=Gt(),n=Qn(),i=Ve(),r=qe();async function o(t,e,i,r,o){return t(i,await async function(t,e,i,r){return void 0!==i?async function(t,e,i,r){var o;const s={...r};return s.headers={...null==r?void 0:r.headers,Authorization:`DPoP ${e}`,DPoP:await n.createDpopHeader(t,null!==(o=null==r?void 0:r.method)&&void 0!==o?o:"get",i)},s}(t,e,i,r):{...r,headers:{...null==r?void 0:r.headers,Authorization:`Bearer ${e}`}}}(i.toString(),e,o,r))}t.DEFAULT_EXPIRATION_TIME_SECONDS=600;var s=n=>void 0!==n?n-e.REFRESH_BEFORE_EXPIRATION_SECONDS>0?n-e.REFRESH_BEFORE_EXPIRATION_SECONDS:n:t.DEFAULT_EXPIRATION_TIME_SECONDS;t.buildAuthenticatedFetch=async function(n,a,u){var c;let l,h=a;const d=null==u?void 0:u.refreshOptions;if(void 0!==d){const n=async()=>{var o,a,c,f;try{const{accessToken:i,refreshToken:r,expiresIn:a}=await async function(n,i,r){var o;const s=await n.tokenRefresher.refresh(n.sessionId,n.refreshToken,i);return null==r||r.emit(e.EVENTS.SESSION_EXTENDED,null!==(o=s.expiresIn)&&void 0!==o?o:t.DEFAULT_EXPIRATION_TIME_SECONDS),"string"==typeof s.refreshToken&&(null==r||r.emit(e.EVENTS.NEW_REFRESH_TOKEN,s.refreshToken)),{accessToken:s.accessToken,refreshToken:s.refreshToken,expiresIn:s.expiresIn}}(d,u.dpopKey,u.eventEmitter);h=i,void 0!==r&&(d.refreshToken=r),clearTimeout(l),l=setTimeout(n,1e3*s(a)),null===(o=u.eventEmitter)||void 0===o||o.emit(e.EVENTS.TIMEOUT_SET,l)}catch(t){t instanceof i.OidcProviderError&&(null===(a=null==u?void 0:u.eventEmitter)||void 0===a||a.emit(e.EVENTS.ERROR,t.error,t.errorDescription),null===(c=null==u?void 0:u.eventEmitter)||void 0===c||c.emit(e.EVENTS.SESSION_EXPIRED)),t instanceof r.InvalidResponseError&&t.missingFields.includes("access_token")&&(null===(f=null==u?void 0:u.eventEmitter)||void 0===f||f.emit(e.EVENTS.SESSION_EXPIRED))}};l=setTimeout(n,1e3*s(u.expiresIn)),null===(c=u.eventEmitter)||void 0===c||c.emit(e.EVENTS.TIMEOUT_SET,l)}else if(void 0!==u&&void 0!==u.eventEmitter){const t=setTimeout((()=>{u.eventEmitter.emit(e.EVENTS.SESSION_EXPIRED)}),1e3*s(u.expiresIn));u.eventEmitter.emit(e.EVENTS.TIMEOUT_SET,t)}return async(t,e)=>{let i=await o(n,h,t,e,null==u?void 0:u.dpopKey);const r=!i.ok&&![401,403].includes(i.status);return i.ok||r||i.url!==t&&void 0!==(null==u?void 0:u.dpopKey)&&(i=await o(n,h,i.url,e,u.dpopKey)),i}}}}),ei=Kt({"node_modules/@inrupt/solid-client-authn-core/dist/storage/__mocks__/StorageUtility.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.mockStorageUtility=t.mockStorage=t.StorageUtilityMock=t.StorageUtilityGetResponse=void 0;var e=ni();t.StorageUtilityGetResponse="getResponse",t.StorageUtilityMock={get:async()=>t.StorageUtilityGetResponse,set:async()=>{},delete:async()=>{},getForUser:async()=>t.StorageUtilityGetResponse,setForUser:async()=>{},deleteForUser:async()=>{},deleteAllUserData:async()=>{},storeResourceServerSessionInfo:async()=>{},clearResourceServerSessionInfo: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=(n,i=!1)=>i?new e.StorageUtility(t.mockStorage(n),t.mockStorage({})):new e.StorageUtility(t.mockStorage({}),t.mockStorage(n))}}),ni=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),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}: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(Gt(),t);var r=Yt();Object.defineProperty(t,"AggregateHandler",{enumerable:!0,get:function(){return i(r).default}});var o=Le();Object.defineProperty(t,"getWebidFromTokenPayload",{enumerable:!0,get:function(){return o.getWebidFromTokenPayload}}),Object.defineProperty(t,"fetchJwks",{enumerable:!0,get:function(){return o.fetchJwks}});var s=Be();Object.defineProperty(t,"isSupportedTokenType",{enumerable:!0,get:function(){return s.isSupportedTokenType}});var a=$e();Object.defineProperty(t,"USER_SESSION_PREFIX",{enumerable:!0,get:function(){return a.USER_SESSION_PREFIX}});var u=He();Object.defineProperty(t,"handleRegistration",{enumerable:!0,get:function(){return u.handleRegistration}}),Object.defineProperty(t,"determineSigningAlg",{enumerable:!0,get:function(){return u.determineSigningAlg}});var c=Je();Object.defineProperty(t,"StorageUtility",{enumerable:!0,get:function(){return i(c).default}}),Object.defineProperty(t,"loadOidcContextFromStorage",{enumerable:!0,get:function(){return c.loadOidcContextFromStorage}}),Object.defineProperty(t,"saveSessionInfoToStorage",{enumerable:!0,get:function(){return c.saveSessionInfoToStorage}}),Object.defineProperty(t,"getSessionIdFromOauthState",{enumerable:!0,get:function(){return c.getSessionIdFromOauthState}});var l=ze();Object.defineProperty(t,"InMemoryStorage",{enumerable:!0,get:function(){return i(l).default}});var h=Ke();Object.defineProperty(t,"ConfigurationError",{enumerable:!0,get:function(){return i(h).default}});var d=We();Object.defineProperty(t,"NotImplementedError",{enumerable:!0,get:function(){return i(d).default}});var f=qe();Object.defineProperty(t,"InvalidResponseError",{enumerable:!0,get:function(){return f.InvalidResponseError}});var p=Ve();Object.defineProperty(t,"OidcProviderError",{enumerable:!0,get:function(){return p.OidcProviderError}});var v=Qn();Object.defineProperty(t,"createDpopHeader",{enumerable:!0,get:function(){return v.createDpopHeader}}),Object.defineProperty(t,"generateDpopKeyPair",{enumerable:!0,get:function(){return v.generateDpopKeyPair}});var g=ti();Object.defineProperty(t,"buildAuthenticatedFetch",{enumerable:!0,get:function(){return g.buildAuthenticatedFetch}});var m=ei();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}})}}),ii=Kt({"node_modules/@inrupt/solid-client-authn-browser/dist/storage/StorageUtility.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=ni();t.default=class extends e.StorageUtility{constructor(t,e){super(t,e)}}}}),ri=Kt({"node_modules/oidc-client/lib/oidc-client.min.js"(t,e){!function(n,i){if("object"==typeof t&&"object"==typeof e)e.exports=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={},u=/([^&=]+)=([^&]*)/g,c=0;s=u.exec(t);)if(a[decodeURIComponent(s[1])]=decodeURIComponent(s[2].replace(/\+/g," ")),c++>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),u=n(24),c=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,S=e.post_logout_redirect_uri,E=e.client_authentication,F=void 0===E?p:E,A=e.prompt,_=e.display,C=e.max_age,j=e.ui_locales,R=e.acr_values,T=e.resource,I=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,$=e.clockService,H=void 0===$?new s.ClockService:$,J=e.userInfoJwtIssuer,z=void 0===J?"OP":J,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?u.ResponseValidator:G,Y=e.MetadataServiceCtor,Z=void 0===Y?c.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=S,this._client_authentication=F,this._prompt=A,this._display=_,this._max_age=C,this._ui_locales=j,this._acr_values=R,this._resource=T,this._response_mode=I,this._filterProtocolClaims=!!N,this._loadUserInfo=!!D,this._staleStateAge=U,this._clockSkew=B,this._clockService=H,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,u=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 u(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 u=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"))&&u.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"))&&u.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 c="";for(var l in e){var h=e[l];h&&(c.length>0&&(c+="&"),c+=encodeURIComponent(l),c+="=",c+=encodeURIComponent(h))}a.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),void 0!==n&&a.setRequestHeader("Authorization","Basic "+btoa(n)),a.send(c)}))},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,u=e.response_type,c=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,S=e.extraQueryParams,E=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(!u)throw i.Log.error("SigninRequest.ctor: No response_type passed"),new Error("response_type");if(!c)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 C=t.isOidc(u),j=t.isCode(u);y||(y=t.isCode(u)?"query":null),this.state=new o.SigninState({nonce:C,data:h,client_id:s,authority:l,redirect_uri:a,code_verifier:j,request_type:E,response_mode:y,client_secret:F,scope:c,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",u),n=r.UrlUtility.addQueryParam(n,"scope",c),n=r.UrlUtility.addQueryParam(n,"state",this.state.id),C&&(n=r.UrlUtility.addQueryParam(n,"nonce",this.state.nonce)),j&&(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 T in R)R[T]&&(n=r.UrlUtility.addQueryParam(n,T,R[T]));for(var I in S)n=r.UrlUtility.addQueryParam(n,I,S[I]);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];u=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(u)},a=0;a<n.length;a++){var u;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),u=n(34),c=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,u=e.state,c=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,S=e.skipUserInfo,E=arguments[1];r.Log.debug("OidcClient.createSigninRequest");var F=this._settings.client_id;i=i||this._settings.scope,o=o||this._settings.redirect_uri,c=c||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||u,authority:A,prompt:c,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:S}),C=_.state;return(E=E||t._stateStore).set(C.id,C.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 u.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 c=n?e.remove.bind(e):e.get.bind(e);return c(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,u=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 c.SignoutRequest({url:e,id_token_hint:n,post_logout_redirect_uri:s,data:i||o,extraQueryParams:a,request_type:u}),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,u=n.error_uri,c=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=u,h.state=c,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),u=(i=n(14))&&i.__esModule?i:{default:i};function c(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;c(this,e);var m=l(this,t.call(this,arguments[0]));if(!0===i?m._nonce=(0,u.default)():i&&(m._nonce=i),!0===h?m._code_verifier=(0,u.default)()+(0,u.default)()+(0,u.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,u=e.profile,c=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=u,this.expires_at=c,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,u=e.accessTokenExpiredTimer,c=void 0===u?new r.Timer("Access token expired"):u;o(this,t),this._accessTokenExpiringNotificationTime=i,this._accessTokenExpiring=a,this._accessTokenExpired=c}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,u=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=u,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",u="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!=u)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,u){var c=new s._XMLHttpRequestCtor;c.open("POST",t),c.onload=function(){i.Log.debug("TokenRevocationClient.revoke: HTTP response received, status",c.status),200===c.status?a():u(Error(c.statusText+" ("+c.status+")"))},c.onerror=function(){i.Log.debug("TokenRevocationClient.revoke: Network Error."),u("Network Error")};var l="client_id="+encodeURIComponent(e);n&&(l+="&client_secret="+encodeURIComponent(n)),l+="&token_type_hint="+encodeURIComponent(o),l+="&token="+encodeURIComponent(r),c.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),c.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),u=n(38),c=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:u.UserManager,AccessTokenEvents:c.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),u=n(12),c=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,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:c.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=u,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 u.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 u.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,u=n._settings.clockSkew;return r.Log.debug("ResponseValidator._validateIdToken: Validaing JWT; using clock skew (in seconds) of: ",u),n._joseUtil.validateJwt(e.id_token,s,o,a,u).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),u=this._joseUtil.hexToBase64Url(a);return u!==t.profile.at_hash?(r.Log.error("ResponseValidator._validateAccessToken: Failed to validate at_hash",u,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,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.MetadataService,c=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 u(this._settings),this._joseUtil=c}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 u=e._settings.client_id,c=e._settings.clockSkew;return o.Log.debug("UserInfoService._getClaimsFromJwt: Validaing JWT; using clock skew (in seconds) of: ",c),e._joseUtil.validateJwt(t.responseText,a,r,u,c,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="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},i={};if(void 0===r)var r={};r.lang={extend:function(t,e,n){if(!e||!t)throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.");var i=function(){};if(i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t,t.superclass=e.prototype,e.prototype.constructor==Object.prototype.constructor&&(e.prototype.constructor=e),n){var r;for(r in n)t.prototype[r]=n[r];var o=function(){},s=["toString","valueOf"];try{/MSIE/.test(false)&&(o=function(t,e){for(r=0;r<s.length;r+=1){var n=s[r],i=e[n];"function"==typeof i&&i!=Object.prototype[n]&&(t[n]=i)}})}catch(t){}o(t.prototype,n)}}};var o,s,a,u,c,l,h,d,f,p,v,g,m,w,b,y=y||(o=Math,a=(s={}).lib={},u=a.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)}}}(),c=a.WordArray=u.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||h).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=o.ceil(e/4)},clone:function(){var t=u.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],n=0;n<t;n+=4)e.push(4294967296*o.random()|0);return new c.init(e,t)}}),l=s.enc={},h=l.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 c.init(n,e/2)}},d=l.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 c.init(n,e)}},f=l.Utf8={stringify:function(t){try{return decodeURIComponent(escape(d.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return d.parse(unescape(encodeURIComponent(t)))}},p=a.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=f.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(t){var e=this._data,n=e.words,i=e.sigBytes,r=this.blockSize,s=i/(4*r),a=(s=t?o.ceil(s):o.max((0|s)-this._minBufferSize,0))*r,u=o.min(4*a,i);if(a){for(var l=0;l<a;l+=r)this._doProcessBlock(n,l);var h=n.splice(0,a);e.sigBytes-=u}return new c.init(h,u)},clone:function(){var t=u.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),a.Hasher=p.extend({cfg:u.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){p.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 v.HMAC.init(t,n).finalize(e)}}}),v=s.algo={},s);m=(g=y).lib,w=m.Base,b=m.WordArray,(g=g.x64={}).Word=w.extend({init:function(t,e){this.high=t,this.low=e}}),g.WordArray=w.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 b.create(n,this.sigBytes)},clone:function(){for(var t=w.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=y.lib.WordArray;y.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,u=i.indexOf(e.charAt(s))>>>6-s%4*2;r[o>>>2]|=(a|u)<<24-o%4*8,o++}return t.create(r,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(t){for(var e=y,n=(r=e.lib).WordArray,i=r.Hasher,r=e.algo,o=[],s=[],a=function(t){return 4294967296*(t-(0|t))|0},u=2,c=0;64>c;){var l;t:{for(var h=t.sqrt(l=u),d=2;d<=h;d++)if(!(l%d)){l=!1;break t}l=!0}l&&(8>c&&(o[c]=a(t.pow(u,.5))),s[c]=a(t.pow(u,1/3)),c++),u++}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],u=n[4],c=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+((u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25))+(u&c^~u&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=c,c=u,u=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]+u|0,n[5]=n[5]+c|0,n[6]=n[6]+l|0,n[7]=n[7]+h|0},_doFinalize:function(){var e=this._data,n=e.words,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=y,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=[],u=0;80>u;u++)a[u]=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],u=h[4],c=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=u.high,x=u.low,k=c.high,S=c.low,E=l.high,F=l.low,A=h.high,_=h.low,C=d,j=f,R=p,T=v,I=g,O=m,N=w,P=b,D=y,M=x,U=k,L=S,B=E,$=F,H=A,J=_,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&$,K=C&R^C&I^R&I;var tt=j&T^j&O^T&O,et=(V=(C>>>28|j<<4)^(C<<30|j>>>2)^(C<<25|j>>>7),G=(j>>>28|C<<4)^(j<<30|C>>>2)^(j<<25|C>>>7),(X=s[z]).high),nt=X.low;Z=H+((D>>>14|M<<18)^(D>>>18|M<<14)^(D<<23|M>>>9))+((X=J+((M>>>14|D<<18)^(M>>>18|D<<14)^(M<<23|D>>>9)))>>>0<J>>>0?1:0),H=B,J=$,B=U,$=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=I,P=O,I=R,O=T,R=C,T=j,C=Z+(K=V+K+((q=G+tt)>>>0<G>>>0?1:0))+((j=X+q|0)>>>0<X>>>0?1:0)|0}f=n.low=f+j,n.high=d+C+(f>>>0<j>>>0?1:0),v=i.low=v+T,i.high=p+R+(v>>>0<T>>>0?1:0),m=r.low=m+O,r.high=g+I+(m>>>0<O>>>0?1:0),b=o.low=b+P,o.high=w+N+(b>>>0<P>>>0?1:0),x=u.low=x+M,u.high=y+D+(x>>>0<M>>>0?1:0),S=c.low=S+L,c.high=k+U+(S>>>0<L>>>0?1:0),F=l.low=F+$,l.high=E+B+(F>>>0<$>>>0?1:0),_=h.low=_+J,h.high=A+H+(_>>>0<J>>>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=y,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 x="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function k(t){var e,n,i="";for(e=0;e+3<=t.length;e+=3)n=parseInt(t.substring(e,e+3),16),i+=x.charAt(n>>6)+x.charAt(63&n);for(e+1==t.length?(n=parseInt(t.substring(e,e+1),16),i+=x.charAt(n<<2)):e+2==t.length&&(n=parseInt(t.substring(e,e+2),16),i+=x.charAt(n>>2)+x.charAt((3&n)<<4));(3&i.length)>0;)i+="=";return i}function S(t){var e,n,i,r="",o=0;for(e=0;e<t.length&&"="!=t.charAt(e);++e)(i=x.indexOf(t.charAt(e)))<0||(0==o?(r+=R(i>>2),n=3&i,o=1):1==o?(r+=R(n<<2|i>>4),n=15&i,o=2):2==o?(r+=R(n),r+=R(i>>2),n=3&i,o=3):(r+=R(n<<2|i>>4),r+=R(15&i),o=0));return 1==o&&(r+=R(n<<2)),r}function E(t){var e,n=S(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 F(t,e,n){null!=t&&("number"==typeof t?this.fromNumber(t,e,n):this.fromString(t,null==e&&"string"!=typeof t?256:e))}function A(){return new F(null)}F.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},F.prototype.DB=26,F.prototype.DM=67108863,F.prototype.DV=1<<26,F.prototype.FV=Math.pow(2,52),F.prototype.F1=26,F.prototype.F2=0;var _,C,j=new Array;for(_="0".charCodeAt(0),C=0;C<=9;++C)j[_++]=C;for(_="a".charCodeAt(0),C=10;C<36;++C)j[_++]=C;for(_="A".charCodeAt(0),C=10;C<36;++C)j[_++]=C;function R(t){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(t)}function T(t,e){var n=j[t.charCodeAt(e)];return null==n?-1:n}function I(t){var e=A();return e.fromInt(t),e}function O(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 N(t){this.m=t}function P(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 D(t,e){return t&e}function M(t,e){return t|e}function U(t,e){return t^e}function L(t,e){return t&~e}function B(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 $(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function H(){}function J(t){return t}function z(t){this.r2=A(),this.q3=A(),F.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}N.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},N.prototype.revert=function(t){return t},N.prototype.reduce=function(t){t.divRemTo(this.m,null,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)},P.prototype.convert=function(t){var e=A();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(F.ZERO)>0&&this.m.subTo(e,e),e},P.prototype.revert=function(t){var e=A();return t.copyTo(e),this.reduce(e),e},P.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)},P.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},P.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},F.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},F.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},F.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]:T(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&&F.ZERO.subTo(this,this)},F.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t},F.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},F.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},F.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()},F.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()}},F.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()},F.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&&F.ZERO.subTo(e,e)},F.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()},F.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=A());var o=A(),s=this.s,a=t.s,u=this.DB-O(i[i.t-1]);u>0?(i.lShiftTo(u,o),r.lShiftTo(u,n)):(i.copyTo(o),r.copyTo(n));var c=o.t,l=o[c-1];if(0!=l){var h=l*(1<<this.F1)+(c>1?o[c-2]>>this.F2:0),d=this.FV/h,f=(1<<this.F1)/h,p=1<<this.F2,v=n.t,g=v-c,m=null==e?A():e;for(o.dlShiftTo(g,m),n.compareTo(m)>=0&&(n[n.t++]=1,n.subTo(m,n)),F.ONE.dlShiftTo(c,m),m.subTo(o,o);o.t<c;)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,c))<w)for(o.dlShiftTo(g,m),n.subTo(m,n);n[v]<--w;)n.subTo(m,n)}null!=e&&(n.drShiftTo(c,e),s!=a&&F.ZERO.subTo(e,e)),n.t=c,n.clamp(),u>0&&n.rShiftTo(u,n),s<0&&F.ZERO.subTo(n,n)}}},F.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},F.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},F.prototype.exp=function(t,e){if(t>4294967295||t<1)return F.ONE;var n=A(),i=A(),r=e.convert(this),o=O(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)},F.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=R(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+=R(n));return r?o:"0"},F.prototype.negate=function(){var t=A();return F.ZERO.subTo(this,t),t},F.prototype.abs=function(){return this.s<0?this.negate():this},F.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},F.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+O(this[this.t-1]^this.s&this.DM)},F.prototype.mod=function(t){var e=A();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(F.ZERO)>0&&t.subTo(e,e),e},F.prototype.modPowInt=function(t,e){var n;return n=t<256||e.isEven()?new N(e):new P(e),this.exp(t,n)},F.ZERO=I(0),F.ONE=I(1),H.prototype.convert=J,H.prototype.revert=J,H.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n)},H.prototype.sqrTo=function(t,e){t.squareTo(e)},z.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=A();return t.copyTo(e),this.reduce(e),e},z.prototype.revert=function(t){return t},z.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)},z.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},z.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var K,W,q,V=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],G=(1<<26)/V[V.length-1];function X(){this.i=0,this.j=0,this.S=new Array}function Y(){!function(t){W[q++]^=255&t,W[q++]^=t>>8&255,W[q++]^=t>>16&255,W[q++]^=t>>24&255,q>=256&&(q-=256)}((new Date).getTime())}if(F.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},F.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=A(),o=A(),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},F.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 u=T(t,a);u<0?"-"==t.charAt(a)&&0==this.signum()&&(r=!0):(s=e*s+u,++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&&F.ZERO.subTo(this,this)},F.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(F.ONE.shiftLeft(t-1),M,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(F.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)}},F.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()},F.prototype.changeBit=function(t,e){var n=F.ONE.shiftLeft(t);return this.bitwiseTo(n,e,n),n},F.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()},F.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},F.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]}},F.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()},F.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)},F.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},F.prototype.millerRabin=function(t){var e=this.subtract(F.ONE),n=e.getLowestSetBit();if(n<=0)return!1;var i=e.shiftRight(n);(t=t+1>>1)>V.length&&(t=V.length);for(var r=A(),o=0;o<t;++o){r.fromInt(V[Math.floor(Math.random()*V.length)]);var s=r.modPow(i,this);if(0!=s.compareTo(F.ONE)&&0!=s.compareTo(e)){for(var a=1;a++<n&&0!=s.compareTo(e);)if(0==(s=s.modPowInt(2,this)).compareTo(F.ONE))return!1;if(0!=s.compareTo(e))return!1}}return!0},F.prototype.clone=function(){var t=A();return this.copyTo(t),t},F.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]},F.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},F.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},F.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},F.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},F.prototype.equals=function(t){return 0==this.compareTo(t)},F.prototype.min=function(t){return this.compareTo(t)<0?this:t},F.prototype.max=function(t){return this.compareTo(t)>0?this:t},F.prototype.and=function(t){var e=A();return this.bitwiseTo(t,D,e),e},F.prototype.or=function(t){var e=A();return this.bitwiseTo(t,M,e),e},F.prototype.xor=function(t){var e=A();return this.bitwiseTo(t,U,e),e},F.prototype.andNot=function(t){var e=A();return this.bitwiseTo(t,L,e),e},F.prototype.not=function(){for(var t=A(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t},F.prototype.shiftLeft=function(t){var e=A();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},F.prototype.shiftRight=function(t){var e=A();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},F.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+B(this[t]);return this.s<0?this.t*this.DB:-1},F.prototype.bitCount=function(){for(var t=0,e=this.s&this.DM,n=0;n<this.t;++n)t+=$(this[n]^e);return t},F.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)},F.prototype.setBit=function(t){return this.changeBit(t,M)},F.prototype.clearBit=function(t){return this.changeBit(t,L)},F.prototype.flipBit=function(t){return this.changeBit(t,U)},F.prototype.add=function(t){var e=A();return this.addTo(t,e),e},F.prototype.subtract=function(t){var e=A();return this.subTo(t,e),e},F.prototype.multiply=function(t){var e=A();return this.multiplyTo(t,e),e},F.prototype.divide=function(t){var e=A();return this.divRemTo(t,e,null),e},F.prototype.remainder=function(t){var e=A();return this.divRemTo(t,null,e),e},F.prototype.divideAndRemainder=function(t){var e=A(),n=A();return this.divRemTo(t,e,n),new Array(e,n)},F.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 N(e):e.isEven()?new z(e):new P(e);var s=new Array,a=3,u=n-1,c=(1<<n)-1;if(s[1]=i.convert(this),n>1){var l=A();for(i.sqrTo(s[1],l);a<=c;)s[a]=A(),i.mulTo(l,s[a-2],s[a]),a+=2}var h,d,f=t.t-1,p=!0,v=A();for(r=O(t[f])-1;f>=0;){for(r>=u?h=t[f]>>r-u&c:(h=(t[f]&(1<<r+1)-1)<<u-r,f>0&&(h|=t[f-1]>>this.DB+r-u)),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)},F.prototype.modInverse=function(t){var e=t.isEven();if(this.isEven()&&e||0==t.signum())return F.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(F.ONE)?F.ZERO:a.compareTo(t)>=0?a.subtract(t):a.signum()<0?(a.addTo(t,a),a.signum()<0?a.add(t):a):a},F.prototype.pow=function(t){return this.exp(t,new H)},F.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},F.prototype.isProbablePrime=function(t){var e,n=this.abs();if(1==n.t&&n[0]<=V[V.length-1]){for(e=0;e<V.length;++e)if(n[0]==V[e])return!0;return!1}if(n.isEven())return!1;for(e=1;e<V.length;){for(var i=V[e],r=e+1;r<V.length&&i<G;)i*=V[r++];for(i=n.modInt(i);e<r;)if(i%V[e++]==0)return!1}return n.millerRabin(t)},F.prototype.square=function(){var t=A();return this.squareTo(t),t},X.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},X.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==W){var Z;if(W=new Array,q=0,void 0!==i&&void 0!==i.msCrypto){var Q=i.msCrypto;if(Q.getRandomValues){var tt=new Uint8Array(32);for(Q.getRandomValues(tt),Z=0;Z<32;++Z)W[q++]=tt[Z]}}for(;q<256;)Z=Math.floor(65536*Math.random()),W[q++]=Z>>>8,W[q++]=255&Z;q=0,Y()}function et(){if(null==K){for(Y(),(K=new X).init(W),q=0;q<W.length;++q)W[q]=0;q=0}return K.next()}function nt(){}function it(t,e){return new F(t,e)}function rt(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 ot(){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 st(t,e){this.x=e,this.q=t}function at(t,e,n,i){this.curve=t,this.x=e,this.y=n,this.z=null==i?F.ONE:i,this.zinv=null}function ut(t,e,n){this.q=t,this.a=this.fromBigInteger(e),this.b=this.fromBigInteger(n),this.infinity=new at(this,null,null)}nt.prototype.nextBytes=function(t){var e;for(e=0;e<t.length;++e)t[e]=et()},ot.prototype.doPublic=function(t){return t.modPowInt(this.e,this.n)},ot.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=it(t,16),this.e=parseInt(e,16)}},ot.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 nt,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 F(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},ot.prototype.encryptOAEP=function(t,e,n){var i=function(t,e,n,i){var r=lt.crypto.MessageDigest,o=lt.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(Ft(t),s))}),t.length+2*i+2>e)throw"Message too long for RSA";var a,u="";for(a=0;a<e-t.length-2*i-2;a+=1)u+="\0";var c=n("")+u+""+t,l=new Array(i);(new nt).nextBytes(l);var h=rt(l,c.length,n),d=[];for(a=0;a<c.length;a+=1)d[a]=c.charCodeAt(a)^h.charCodeAt(a);var f=rt(d,l.length,n),p=[0];for(a=0;a<l.length;a+=1)p[a+1]=l[a]^f.charCodeAt(a);return new F(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},ot.prototype.type="RSA",st.prototype.equals=function(t){return t==this||this.q.equals(t.q)&&this.x.equals(t.x)},st.prototype.toBigInteger=function(){return this.x},st.prototype.negate=function(){return new st(this.q,this.x.negate().mod(this.q))},st.prototype.add=function(t){return new st(this.q,this.x.add(t.toBigInteger()).mod(this.q))},st.prototype.subtract=function(t){return new st(this.q,this.x.subtract(t.toBigInteger()).mod(this.q))},st.prototype.multiply=function(t){return new st(this.q,this.x.multiply(t.toBigInteger()).mod(this.q))},st.prototype.square=function(){return new st(this.q,this.x.square().mod(this.q))},st.prototype.divide=function(t){return new st(this.q,this.x.multiply(t.toBigInteger().modInverse(this.q)).mod(this.q))},at.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))},at.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))},at.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(F.ZERO)&&t.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(t.z)).mod(this.curve.q).equals(F.ZERO))},at.prototype.isInfinity=function(){return null==this.x&&null==this.y||this.z.equals(F.ZERO)&&!this.y.toBigInteger().equals(F.ZERO)},at.prototype.negate=function(){return new at(this.curve,this.x,this.y.negate(),this.z)},at.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(F.ZERO.equals(n))return F.ZERO.equals(e)?this.twice():this.curve.getInfinity();var i=new F("3"),r=this.x.toBigInteger(),o=this.y.toBigInteger(),s=(t.x.toBigInteger(),t.y.toBigInteger(),n.square()),a=s.multiply(n),u=r.multiply(s),c=e.square().multiply(this.z),l=c.subtract(u.shiftLeft(1)).multiply(t.z).subtract(a).multiply(n).mod(this.curve.q),h=u.multiply(i).multiply(e).subtract(o.multiply(a)).subtract(c.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 at(this.curve,this.curve.fromBigInteger(l),this.curve.fromBigInteger(h),d)},at.prototype.twice=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var t=new F("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);F.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),u=s.multiply(t).multiply(e).subtract(r.shiftLeft(1)).shiftLeft(2).multiply(r).subtract(s.square().multiply(s)).mod(this.curve.q),c=i.square().multiply(i).shiftLeft(3).mod(this.curve.q);return new at(this.curve,this.curve.fromBigInteger(a),this.curve.fromBigInteger(u),c)},at.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 F("3")),r=this.negate(),o=this,s=this.curve.q.subtract(t),a=s.multiply(new F("3")),u=new at(this.curve,this.x,this.y),c=u.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){u=u.twice();var h=a.testBit(e);h!=s.testBit(e)&&(u=u.add(h?u:c))}return o},at.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},ut.prototype.getQ=function(){return this.q},ut.prototype.getA=function(){return this.a},ut.prototype.getB=function(){return this.b},ut.prototype.equals=function(t){return t==this||this.q.equals(t.q)&&this.a.equals(t.a)&&this.b.equals(t.b)},ut.prototype.getInfinity=function(){return this.infinity},ut.prototype.fromBigInteger=function(t){return new st(this.q,t)},ut.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 at(this,this.fromBigInteger(new F(n,16)),this.fromBigInteger(new F(i,16)));default:return null}},st.prototype.getByteLength=function(){return Math.floor((this.toBigInteger().bitLength()+7)/8)},at.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},at.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 F(i),s=new F(r);return new at(t,t.fromBigInteger(o),t.fromBigInteger(s))},at.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 F(i,16),s=new F(r,16);return new at(t,t.fromBigInteger(o),t.fromBigInteger(s))},at.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 at(this.curve,i,r)},at.prototype.twice2D=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var t=this.curve.fromBigInteger(F.valueOf(2)),e=this.curve.fromBigInteger(F.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 at(this.curve,i,r)},at.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 F("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},at.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)},at.prototype.toString=function(){return"("+this.getX().toBigInteger().toString()+","+this.getY().toBigInteger().toString()+")"},at.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(F.ONE)<0||e.compareTo(t.subtract(F.ONE))>0)throw new Error("x coordinate out of bounds");if(n.compareTo(F.ONE)<0||n.compareTo(t.subtract(F.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"),i={'"':'"',"/":"/","\\":"\\",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function r(t,e,n){return e?i[e]:String.fromCharCode(parseInt(n,16))}var o=new String(""),s=Object.hasOwnProperty;return function(i,a){var u,c,l=i.match(t),h=l[0],d=!1;"{"===h?u={}:"["===h?u=[]:(u=[],d=!0);for(var f=[u],p=1-d,v=l.length;p<v;++p){var g;switch((h=l[p]).charCodeAt(0)){default:(g=f[0])[c||g.length]=+h,c=void 0;break;case 34:if(-1!==(h=h.substring(1,h.length-1)).indexOf("\\")&&(h=h.replace(e,r)),g=f[0],!c){if(!(g instanceof Array)){c=h||o;break}c=g.length}g[c]=h,c=void 0;break;case 91:f.unshift((g=f[0])[c||g.length]=[]),c=void 0;break;case 93:f.shift();break;case 102:(g=f[0])[c||g.length]=!1,c=void 0;break;case 110:(g=f[0])[c||g.length]=null,c=void 0;break;case 116:(g=f[0])[c||g.length]=!0,c=void 0;break;case 123:f.unshift((g=f[0])[c||g.length]={}),c=void 0;break;case 125:f.shift()}}if(d){if(1!==f.length)throw new Error;u=u[0]}else if(f.length)throw new Error;return a&&(u=function t(e,i){var r=e[i];if(r&&"object"===(void 0===r?"undefined":n(r))){var o=null;for(var u in r)if(s.call(r,u)&&r!==e){var c=t(r,u);void 0!==c?r[u]=c:(o||(o=[]),o.push(u))}if(o)for(var l=o.length;--l>=0;)delete r[o[l]]}return a.call(e,i,r)}({"":u},"")),u}}();void 0!==lt&<||(e.KJUR=lt={}),void 0!==lt.asn1&<.asn1||(lt.asn1={}),lt.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 F(i,16).xor(t).add(F.ONE).toString(16).replace(/^-/,"")}return e},this.getPEMStringFromHex=function(t,e){return jt(t,e)},this.newObject=function(t){var e=lt.asn1,n=e.ASN1Object,i=e.DERBoolean,r=e.DERInteger,o=e.DERBitString,s=e.DEROctetString,a=e.DERNull,u=e.DERObjectIdentifier,c=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 S=Object.keys(t);if(1!=S.length)throw new Error("key of param shall be only one.");var E=S[0];if(-1==":asn1:bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:visstr:bmpstr:seq:set:tag:".indexOf(":"+E+":"))throw new Error("undefined key: "+E);if("bool"==E)return new i(t[E]);if("int"==E)return new r(t[E]);if("bitstr"==E)return new o(t[E]);if("octstr"==E)return new s(t[E]);if("null"==E)return new a(t[E]);if("oid"==E)return new u(t[E]);if("enum"==E)return new c(t[E]);if("utf8str"==E)return new l(t[E]);if("numstr"==E)return new h(t[E]);if("prnstr"==E)return new d(t[E]);if("telstr"==E)return new f(t[E]);if("ia5str"==E)return new p(t[E]);if("utctime"==E)return new v(t[E]);if("gentime"==E)return new g(t[E]);if("visstr"==E)return new m(t[E]);if("bmpstr"==E)return new w(t[E]);if("asn1"==E)return new n(t[E]);if("seq"==E){for(var F=t[E],A=[],_=0;_<F.length;_++){var C=k(F[_]);A.push(C)}return new b({array:A})}if("set"==E){for(F=t[E],A=[],_=0;_<F.length;_++)C=k(F[_]),A.push(C);return new y({array:A})}if("tag"==E){var j=t[E];if("[object Array]"===Object.prototype.toString.call(j)&&3==j.length){var R=k(j[2]);return new x({tag:j[0],explicit:j[1],obj:R})}return new x(j)}},this.jsonToASN1HEX=function(t){return this.newObject(t).getEncodedHex()}},lt.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 F(i,2).toString(10),i="")}return e},lt.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 F(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},lt.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)},lt.asn1.DERAbstractString=function(t){lt.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=kt(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))},r.lang.extend(lt.asn1.DERAbstractString,lt.asn1.ASN1Object),lt.asn1.DERAbstractTime=function(){lt.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 u=i(String(a),3);s=s+"."+(u=u.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=mt(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}},r.lang.extend(lt.asn1.DERAbstractTime,lt.asn1.ASN1Object),lt.asn1.DERAbstractStructured=function(t){lt.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)},r.lang.extend(lt.asn1.DERAbstractStructured,lt.asn1.ASN1Object),lt.asn1.DERBoolean=function(t){lt.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV=0==t?"010100":"0101ff"},r.lang.extend(lt.asn1.DERBoolean,lt.asn1.ASN1Object),lt.asn1.DERInteger=function(t){lt.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=lt.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new F(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))},r.lang.extend(lt.asn1.DERInteger,lt.asn1.ASN1Object),lt.asn1.DERBitString=function(t){if(void 0!==t&&void 0!==t.obj){var e=lt.asn1.ASN1Util.newObject(t.obj);t.hex="00"+e.getEncodedHex()}lt.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))},r.lang.extend(lt.asn1.DERBitString,lt.asn1.ASN1Object),lt.asn1.DEROctetString=function(t){if(void 0!==t&&void 0!==t.obj){var e=lt.asn1.ASN1Util.newObject(t.obj);t.hex=e.getEncodedHex()}lt.asn1.DEROctetString.superclass.constructor.call(this,t),this.hT="04"},r.lang.extend(lt.asn1.DEROctetString,lt.asn1.DERAbstractString),lt.asn1.DERNull=function(){lt.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},r.lang.extend(lt.asn1.DERNull,lt.asn1.ASN1Object),lt.asn1.DERObjectIdentifier=function(t){lt.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=lt.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)},r.lang.extend(lt.asn1.DERObjectIdentifier,lt.asn1.ASN1Object),lt.asn1.DEREnumerated=function(t){lt.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=lt.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new F(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))},r.lang.extend(lt.asn1.DEREnumerated,lt.asn1.ASN1Object),lt.asn1.DERUTF8String=function(t){lt.asn1.DERUTF8String.superclass.constructor.call(this,t),this.hT="0c"},r.lang.extend(lt.asn1.DERUTF8String,lt.asn1.DERAbstractString),lt.asn1.DERNumericString=function(t){lt.asn1.DERNumericString.superclass.constructor.call(this,t),this.hT="12"},r.lang.extend(lt.asn1.DERNumericString,lt.asn1.DERAbstractString),lt.asn1.DERPrintableString=function(t){lt.asn1.DERPrintableString.superclass.constructor.call(this,t),this.hT="13"},r.lang.extend(lt.asn1.DERPrintableString,lt.asn1.DERAbstractString),lt.asn1.DERTeletexString=function(t){lt.asn1.DERTeletexString.superclass.constructor.call(this,t),this.hT="14"},r.lang.extend(lt.asn1.DERTeletexString,lt.asn1.DERAbstractString),lt.asn1.DERIA5String=function(t){lt.asn1.DERIA5String.superclass.constructor.call(this,t),this.hT="16"},r.lang.extend(lt.asn1.DERIA5String,lt.asn1.DERAbstractString),lt.asn1.DERVisibleString=function(t){lt.asn1.DERIA5String.superclass.constructor.call(this,t),this.hT="1a"},r.lang.extend(lt.asn1.DERVisibleString,lt.asn1.DERAbstractString),lt.asn1.DERBMPString=function(t){lt.asn1.DERBMPString.superclass.constructor.call(this,t),this.hT="1e"},r.lang.extend(lt.asn1.DERBMPString,lt.asn1.DERAbstractString),lt.asn1.DERUTCTime=function(t){lt.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=mt(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=mt(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))},r.lang.extend(lt.asn1.DERUTCTime,lt.asn1.DERAbstractTime),lt.asn1.DERGeneralizedTime=function(t){lt.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=mt(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=mt(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))},r.lang.extend(lt.asn1.DERGeneralizedTime,lt.asn1.DERAbstractTime),lt.asn1.DERSequence=function(t){lt.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}},r.lang.extend(lt.asn1.DERSequence,lt.asn1.DERAbstractStructured),lt.asn1.DERSet=function(t){lt.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)},r.lang.extend(lt.asn1.DERSet,lt.asn1.DERAbstractStructured),lt.asn1.DERTaggedObject=function(t){lt.asn1.DERTaggedObject.superclass.constructor.call(this);var e=lt.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"==n(t.obj)&&(this.asn1Object=e.ASN1Util.newObject(t.obj),this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},null!=t&&this.setByParam(t)},r.lang.extend(lt.asn1.DERTaggedObject,lt.asn1.ASN1Object);var lt,ht,dt,ft=new function(){};function pt(t){for(var e=new Array,n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}function vt(t){for(var e="",n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return e}function gt(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 mt(t){return gt(pt(t))}function wt(t){return(t=(t=t.replace(/\=/g,"")).replace(/\+/g,"-")).replace(/\//g,"_")}function bt(t){return t.length%4==2?t+="==":t.length%4==3&&(t+="="),(t=t.replace(/-/g,"+")).replace(/_/g,"/")}function yt(t){return t.length%2==1&&(t="0"+t),wt(k(t))}function xt(t){return S(bt(t))}function kt(t){return Ot(Ut(t))}function St(t){return decodeURIComponent(Nt(t))}function Et(t){for(var e="",n=0;n<t.length-1;n+=2)e+=String.fromCharCode(parseInt(t.substr(n,2),16));return e}function Ft(t){for(var e="",n=0;n<t.length;n++)e+=("0"+t.charCodeAt(n).toString(16)).slice(-2);return e}function At(t){return k(t)}function _t(t){return At(t).replace(/(.{64})/g,"$1\r\n").replace(/\r\n$/,"")}function Ct(t){return S(t.replace(/[^0-9A-Za-z\/+=]*/g,""))}function jt(t,e){return"-----BEGIN "+e+"-----\r\n"+_t(t)+"\r\n-----END "+e+"-----\r\n"}function Rt(t,e){if(-1==t.indexOf("-----BEGIN "))throw"can't find PEM header: "+e;return Ct(t=void 0!==e?(t=t.replace(new RegExp("^[^]*-----BEGIN "+e+"-----"),"")).replace(new RegExp("-----END "+e+"-----[^]*$"),""):(t=t.replace(/^[^]*-----BEGIN [^-]+-----/,"")).replace(/-----END [^-]+-----[^]*$/,""))}function Tt(t){var e,n,i,r,o,s,a,u,c,l,h;if(h=t.match(/^(\d{2}|\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(|\.\d+)Z$/))return u=h[1],e=parseInt(u),2===u.length&&(50<=e&&e<100?e=1900+e:0<=e&&e<50&&(e=2e3+e)),n=parseInt(h[2])-1,i=parseInt(h[3]),r=parseInt(h[4]),o=parseInt(h[5]),s=parseInt(h[6]),a=0,""!==(c=h[7])&&(l=(c.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~~(Tt(t)/1e3)}function Ot(t){return t.replace(/%/g,"")}function Nt(t){return t.replace(/(..)/g,"%$1")}function Pt(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 Dt(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 Mt(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?Dt(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 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+"%"+mt(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}ft.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},ft.getL=function(t,e){var n=ft.getLblen(t,e);return n<1?"":t.substr(e+2,2*n)},ft.getVblen=function(t,e){var n;return""==(n=ft.getL(t,e))?-1:("8"===n.substr(0,1)?new F(n.substr(2),16):new F(n,16)).intValue()},ft.getVidx=function(t,e){var n=ft.getLblen(t,e);return n<0?n:e+2*(n+1)},ft.getV=function(t,e){var n=ft.getVidx(t,e),i=ft.getVblen(t,e);return t.substr(n,2*i)},ft.getTLV=function(t,e){return t.substr(e,2)+ft.getL(t,e)+ft.getV(t,e)},ft.getTLVblen=function(t,e){return 2+2*ft.getLblen(t,e)+2*ft.getVblen(t,e)},ft.getNextSiblingIdx=function(t,e){return ft.getVidx(t,e)+2*ft.getVblen(t,e)},ft.getChildIdx=function(t,e){var n,i,r,o=ft,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 u=o.getTLVblen(t,a);if((r+=u)<=i&&s.push(a),a+=u,r>=i)break}return s},ft.getNthChildIdx=function(t,e,n){return ft.getChildIdx(t,e)[n]},ft.getIdxbyList=function(t,e,n,i){var r,o,s=ft;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)},ft.getIdxbyListEx=function(t,e,n,i){var r,o,s=ft;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,u=0;u<o.length;u++){var c=t.substr(o[u],2);if("number"==typeof r&&!s.isContextTag(c)&&a==r||"string"==typeof r&&s.isContextTag(c,r))return s.getIdxbyListEx(t,o[u],n,i);s.isContextTag(c)||a++}return-1},ft.getTLVbyList=function(t,e,n,i){var r=ft,o=r.getIdxbyList(t,e,n,i);return-1==o||o>=t.length?null:r.getTLV(t,o)},ft.getTLVbyListEx=function(t,e,n,i){var r=ft,o=r.getIdxbyListEx(t,e,n,i);return-1==o?null:r.getTLV(t,o)},ft.getVbyList=function(t,e,n,i,r){var o,s,a=ft;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)},ft.getVbyListEx=function(t,e,n,i,r){var o,s,a=ft;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)},ft.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=ft.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}},ft.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=[],u="";for(s=0;s<o.length;s++)128&o[s]?u+=$t((127&o[s]).toString(2),7):(u+=$t((127&o[s]).toString(2),7),a.push(new String(parseInt(u,2))),u="");var c=e.join(".");return a.length>0&&(c=c+"."+a.join(".")),c}catch(t){return null}}(ft.getV(t,e))}catch(t){return n}},ft.getOIDName=function(t,e,n){null==n&&(n=null);try{var i=ft.getOID(t,e,n);if(i==n)return n;var r=lt.asn1.x509.OID.oid2name(i);return""==r?i:r}catch(t){return n}},ft.getString=function(t,e,n){null==n&&(n=null);try{return Et(ft.getV(t,e))}catch(t){return n}},ft.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 u=[],c="";for(a=0;a<s.length;a++)128&s[a]?c+=e((127&s[a]).toString(2),7):(c+=e((127&s[a]).toString(2),7),u.push(new String(parseInt(c,2))),c="");var l=n.join(".");return u.length>0&&(l=l+"."+u.join(".")),l},ft.dump=function(t,e,n,i){var r=ft,o=r.getV,s=r.dump,a=r.getChildIdx,u=t;t instanceof lt.asn1.ASN1Object&&(u=t.getEncodedHex());var c=function(t,e){return t.length<=2*e?t:t.substr(0,e)+"..(total "+t.length/2+"bytes).."+t.substr(t.length-e,e)};void 0===e&&(e={ommit_long_octet:32}),void 0===n&&(n=0),void 0===i&&(i="");var l,h=e.ommit_long_octet;if("01"==(l=u.substr(n,2)))return"00"==(d=o(u,n))?i+"BOOLEAN FALSE\n":i+"BOOLEAN TRUE\n";if("02"==l)return i+"INTEGER "+c(d=o(u,n),h)+"\n";if("03"==l){var d=o(u,n);return r.isASN1HEX(d.substr(2))?(x=i+"BITSTRING, encapsulates\n")+s(d.substr(2),e,0,i+" "):i+"BITSTRING "+c(d,h)+"\n"}if("04"==l)return d=o(u,n),r.isASN1HEX(d)?(x=i+"OCTETSTRING, encapsulates\n")+s(d,e,0,i+" "):i+"OCTETSTRING "+c(d,h)+"\n";if("05"==l)return i+"NULL\n";if("06"==l){var f=o(u,n),p=lt.asn1.ASN1Util.oidHexToInt(f),v=lt.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(u,n))+"\n";if("0c"==l)return i+"UTF8String '"+St(o(u,n))+"'\n";if("13"==l)return i+"PrintableString '"+St(o(u,n))+"'\n";if("14"==l)return i+"TeletexString '"+St(o(u,n))+"'\n";if("16"==l)return i+"IA5String '"+St(o(u,n))+"'\n";if("17"==l)return i+"UTCTime "+St(o(u,n))+"\n";if("18"==l)return i+"GeneralizedTime "+St(o(u,n))+"\n";if("1a"==l)return i+"VisualString '"+St(o(u,n))+"'\n";if("1e"==l)return i+"BMPString '"+St(o(u,n))+"'\n";if("30"==l){if("3000"==u.substr(n,4))return i+"SEQUENCE {}\n";x=i+"SEQUENCE\n";var m=e;if((2==(y=a(u,n)).length||3==y.length)&&"06"==u.substr(y[0],2)&&"04"==u.substr(y[y.length-1],2)){v=r.oidname(o(u,y[0]));var w=JSON.parse(JSON.stringify(e));w.x509ExtName=v,m=w}for(var b=0;b<y.length;b++)x+=s(u,m,y[b],i+" ");return x}if("31"==l){x=i+"SET\n";var y=a(u,n);for(b=0;b<y.length;b++)x+=s(u,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(u,n),b=0;b<y.length;b++)x+=s(u,e,y[b],i+" ");return x}return d=o(u,n),ft.isASN1HEX(d)?(x=i+"["+k+"]\n")+s(d,e,0,i+" "):(("68747470"==d.substr(0,8)||"subjectAltName"===e.x509ExtName&&2==k)&&(d=St(d)),i+"["+k+"] "+d+"\n")}return i+"UNKNOWN("+l+") "+o(u,n)+"\n"},ft.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}},ft.isASN1HEX=function(t){var e=ft;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},ft.checkStrictDER=function(t,e,n,i,r){var o=ft;if(void 0===n){if("string"!=typeof t)throw new Error("not hex string");if(t=t.toLowerCase(),!lt.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),u=a.length-2-o.getL(t,e).length;if(u!==2*s)throw new Error("V string length and L's value not the same:"+u+"/"+2*s);if(0===e&&t.length!=a.length)throw new Error("total length and TLV length unmatch:"+t.length+"!="+a.length);var c=t.substr(e,2);if("02"===c){var l=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(c,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)}},ft.oidname=function(t){var e=lt.asn1;lt.lang.String.isHex(t)&&(t=e.ASN1Util.oidHexToInt(t));var n=e.x509.OID.oid2name(t);return""===n&&(n=t),n},void 0!==lt&<||(e.KJUR=lt={}),void 0!==lt.lang&<.lang||(lt.lang={}),lt.lang.String=function(){},"function"==typeof t?(e.utf8tob64u=ht=function(e){return wt(t.from(e,"utf8").toString("base64"))},e.b64utoutf8=dt=function(e){return t.from(bt(e),"base64").toString("utf8")}):(e.utf8tob64u=ht=function(t){return yt(Ot(Ut(t)))},e.b64utoutf8=dt=function(t){return decodeURIComponent(Nt(xt(t)))}),lt.lang.String.isInteger=function(t){return!!t.match(/^[0-9]+$/)||!!t.match(/^-[0-9]+$/)},lt.lang.String.isHex=function(t){return Lt(t)},lt.lang.String.isBase64=function(t){return!(!(t=t.replace(/\s+/g,"")).match(/^[0-9A-Za-z+\/]+={0,3}$/)||t.length%4!=0)},lt.lang.String.isBase64URL=function(t){return!t.match(/[+/=]/)&&(t=bt(t),lt.lang.String.isBase64(t))},lt.lang.String.isIntegerArray=function(t){return!!(t=t.replace(/\s+/g,"")).match(/^\[[0-9,]+\]$/)},lt.lang.String.isPrintable=function(t){return null!==t.match(/^[0-9A-Za-z '()+,-./:=?]*$/)},lt.lang.String.isIA5=function(t){return null!==t.match(/^[\x20-\x21\x23-\x7f]*$/)},lt.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 $t=function(t,e,n){return null==n&&(n="0"),t.length>=e?t:new Array(e-t.length+1).join(n)+t};void 0!==lt&<||(e.KJUR=lt={}),void 0!==lt.crypto&<.crypto||(lt.crypto={}),lt.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:y.algo.MD5,sha1:y.algo.SHA1,sha224:y.algo.SHA224,sha256:y.algo.SHA256,sha384:y.algo.SHA384,sha512:y.algo.SHA512,ripemd160:y.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="",u=r-o.length-s.length,c=0;c<u;c+=2)a+="ff";return o+a+s},this.hashString=function(t,e){return new lt.crypto.MessageDigest({alg:e}).digestString(t)},this.hashHex=function(t,e){return new lt.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 ot||t instanceof lt.crypto.DSA||t instanceof lt.crypto.ECDSA}},lt.crypto.Util.md5=function(t){return new lt.crypto.MessageDigest({alg:"md5",prov:"cryptojs"}).digestString(t)},lt.crypto.Util.ripemd160=function(t){return new lt.crypto.MessageDigest({alg:"ripemd160",prov:"cryptojs"}).digestString(t)},lt.crypto.Util.SECURERANDOMGEN=new nt,lt.crypto.Util.getRandomHexOfNbytes=function(t){var e=new Array(t);return lt.crypto.Util.SECURERANDOMGEN.nextBytes(e),gt(e)},lt.crypto.Util.getRandomBigIntegerOfNbytes=function(t){return new F(lt.crypto.Util.getRandomHexOfNbytes(t),16)},lt.crypto.Util.getRandomHexOfNbits=function(t){var e=t%8,n=new Array((t-e)/8+1);return lt.crypto.Util.SECURERANDOMGEN.nextBytes(n),n[0]=(255<<e&255^255)&n[0],gt(n)},lt.crypto.Util.getRandomBigIntegerOfNbits=function(t){return new F(lt.crypto.Util.getRandomHexOfNbits(t),16)},lt.crypto.Util.getRandomBigIntegerZeroToMax=function(t){for(var e=t.bitLength();;){var n=lt.crypto.Util.getRandomBigIntegerOfNbits(e);if(-1!=t.compareTo(n))return n}},lt.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 lt.crypto.Util.getRandomBigIntegerZeroToMax(i).add(t)},lt.crypto.MessageDigest=function(t){this.setAlgAndProvider=function(t,e){if(null!==(t=lt.crypto.MessageDigest.getCanonicalAlgName(t))&&void 0===e&&(e=lt.crypto.Util.DEFAULTPROVIDER[t]),-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(t)&&"cryptojs"==e){try{this.md=lt.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=y.enc.Hex.parse(t);this.md.update(e)},this.digest=function(){return this.md.finalize().toString(y.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=lt.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))},lt.crypto.MessageDigest.getCanonicalAlgName=function(t){return"string"==typeof t&&(t=(t=t.toLowerCase()).replace(/-/,"")),t},lt.crypto.MessageDigest.getHashLength=function(t){var e=lt.crypto.MessageDigest,n=e.getCanonicalAlgName(t);if(void 0===e.HASHLENGTH[n])throw"not supported algorithm: "+t;return e.HASHLENGTH[n]},lt.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20},lt.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=lt.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=y.algo.HMAC.create(lt.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=y.enc.Hex.parse(t);this.mac.update(e)},this.doFinal=function(){return this.mac.finalize().toString(y.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=Ft(t)),void(this.pass=y.enc.Hex.parse(e))}if("object"!=(void 0===t?"undefined":n(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=kt(t.utf8)),void 0!==t.rstr&&(e=Ft(t.rstr)),void 0!==t.b64&&(e=S(t.b64)),void 0!==t.b64u&&(e=xt(t.b64u)),null==e)throw"KJUR.crypto.Mac unsupported password type: "+t;this.pass=y.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=lt.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName)))},lt.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 lt.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!==lt.crypto.ECDSA&&(this.prvKey=new lt.crypto.ECDSA({curve:this.eccurvename,prv:this.ecprvhex})),this.prvKey instanceof ot&&"rsaandmgf1"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHashPSS(this.sHashHex,this.mdAlgName,this.pssSaltLen);else if(this.prvKey instanceof ot&&"rsa"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex,this.mdAlgName);else if(this.prvKey instanceof lt.crypto.ECDSA)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex);else{if(!(this.prvKey instanceof lt.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!==lt.crypto.ECDSA&&(this.pubKey=new lt.crypto.ECDSA({curve:this.eccurvename,pub:this.ecpubhex})),this.pubKey instanceof ot&&"rsaandmgf1"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,t,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof ot&&"rsa"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);if(void 0!==lt.crypto.ECDSA&&this.pubKey instanceof lt.crypto.ECDSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);if(void 0!==lt.crypto.DSA&&this.pubKey instanceof lt.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?lt.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}}},lt.crypto.Cipher=function(){},lt.crypto.Cipher.encrypt=function(t,e,n){if(e instanceof ot&&e.isPublic){var i=lt.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"},lt.crypto.Cipher.decrypt=function(t,e,n){if(e instanceof ot&&e.isPrivate){var i=lt.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"},lt.crypto.Cipher.getAlgByKeyAndName=function(t,e){if(t instanceof ot){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},lt.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!==lt&<||(e.KJUR=lt={}),void 0!==lt.crypto&<.crypto||(lt.crypto={}),lt.crypto.ECDSA=function(t){var e=Error,i=F,r=at,o=lt.crypto.ECDSA,s=lt.crypto.ECParameterDB,a=o.getName,u=ft.getVbyListEx,c=ft.isASN1HEX,l=new nt;this.type="EC",this.isPrivate=!1,this.isPublic=!1,this.getBigRandom=function(t){return new i(t.bitLength(),l).mod(t.subtract(i.ONE)).add(i.ONE)},this.setNamedCurve=function(t){this.ecparams=s.getByName(t),this.prvKeyHex=null,this.pubKeyHex=null,this.curveName=t},this.setPrivateKeyHex=function(t){this.isPrivate=!0,this.prvKeyHex=t},this.setPublicKeyHex=function(t){this.isPublic=!0,this.pubKeyHex=t},this.getPublicKeyXYHex=function(){var t=this.pubKeyHex;if("04"!==t.substr(0,2))throw"this method supports uncompressed format(04) only";var e=this.ecparams.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 n=new i(e,16),r=this.ecparams.n,s=new i(t.substring(0,this.ecparams.keylen/4),16);do{var a=this.getBigRandom(r),u=this.ecparams.G.multiply(a).getX().toBigInteger().mod(r)}while(u.compareTo(i.ZERO)<=0);var c=a.modInverse(r).multiply(s.add(n.multiply(u))).mod(r);return o.biRSSigToASN1Sig(u,c)},this.sign=function(t,e){var n=e,r=this.ecparams.n,o=i.fromByteArrayUnsigned(t);do{var s=this.getBigRandom(r),a=this.ecparams.G.multiply(s).getX().toBigInteger().mod(r)}while(a.compareTo(F.ZERO)<=0);var u=s.modInverse(r).multiply(o.add(n.multiply(a))).mod(r);return this.serializeSig(a,u)},this.verifyWithMessageHash=function(t,e){return this.verifyHex(t,e,this.pubKeyHex)},this.verifyHex=function(t,e,n){try{var s,a,u=o.parseSigHex(e);s=u.r,a=u.s;var c=r.decodeFromHex(this.ecparams.curve,n),l=new i(t.substring(0,this.ecparams.keylen/4),16);return this.verifyRaw(l,s,a,c)}catch(t){return!1}},this.verify=function(t,e,o){var s,a,u;if(Bitcoin.Util.isArray(e)){var c=this.parseSig(e);s=c.r,a=c.s}else{if("object"!==(void 0===e?"undefined":n(e))||!e.r||!e.s)throw"Invalid value for signature";s=e.r,a=e.s}if(o instanceof at)u=o;else{if(!Bitcoin.Util.isArray(o))throw"Invalid format for pubkey value, must be byte array or ECPointFp";u=r.decodeFrom(this.ecparams.curve,o)}var l=i.fromByteArrayUnsigned(t);return this.verifyRaw(l,s,a,u)},this.verifyRaw=function(t,e,n,r){var o=this.ecparams.n,s=this.ecparams.G;if(e.compareTo(i.ONE)<0||e.compareTo(o)>=0)return!1;if(n.compareTo(i.ONE)<0||n.compareTo(o)>=0)return!1;var a=n.modInverse(o),u=t.multiply(a).mod(o),c=e.multiply(a).mod(o);return s.multiply(u).add(r.multiply(c)).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 n=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:i.fromByteArrayUnsigned(n),s:i.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 n=this.ecparams.n;return{r:i.fromByteArrayUnsigned(t.slice(1,33)).mod(n),s:i.fromByteArrayUnsigned(t.slice(33,65)).mod(n),i:e}},this.readPKCS5PrvKeyHex=function(t){if(!1===c(t))throw new Error("not ASN.1 hex string");var e,n,i;try{e=u(t,0,["[0]",0],"06"),n=u(t,0,[1],"04");try{i=u(t,0,["[1]",0],"03")}catch(t){}}catch(t){throw new Error("malformed PKCS#1/5 plain ECC private key")}if(this.curveName=a(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{u(t,0,[1,0],"06"),n=u(t,0,[1,1],"06"),i=u(t,0,[2,0,1],"04");try{r=u(t,0,[2,0,"[1]",0],"03")}catch(t){}}catch(t){throw new e("malformed PKCS#8 plain ECC private key")}if(this.curveName=a(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{u(t,0,[0,0],"06"),n=u(t,0,[0,1],"06"),i=u(t,0,[1],"03")}catch(t){throw new e("malformed PKCS#8 ECC public key")}if(this.curveName=a(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=u(t,0,[0,5,0,1],"06"),i=u(t,0,[0,5,1],"03")}catch(t){throw new e("malformed X.509 certificate ECC public key")}if(this.curveName=a(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))},lt.crypto.ECDSA.parseSigHex=function(t){var e=lt.crypto.ECDSA.parseSigHexInHexRS(t);return{r:new F(e.r,16),s:new F(e.s,16)}},lt.crypto.ECDSA.parseSigHexInHexRS=function(t){var e=ft.getChildIdx,n=ft.getV;if(ft.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)}},lt.crypto.ECDSA.asn1SigToConcatSig=function(t){var e=lt.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},lt.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 lt.crypto.ECDSA.hexRSSigToASN1Sig(e,n)},lt.crypto.ECDSA.hexRSSigToASN1Sig=function(t,e){var n=new F(t,16),i=new F(e,16);return lt.crypto.ECDSA.biRSSigToASN1Sig(n,i)},lt.crypto.ECDSA.biRSSigToASN1Sig=function(t,e){var n=lt.asn1,i=new n.DERInteger({bigint:t}),r=new n.DERInteger({bigint:e});return new n.DERSequence({array:[i,r]}).getEncodedHex()},lt.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!==lt&<||(e.KJUR=lt={}),void 0!==lt.crypto&<.crypto||(lt.crypto={}),lt.crypto.ECParameterDB=new function(){var t={},e={};function n(t){return new F(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,u,c,l,h,d,f,p){t[i]={};var v=n(o),g=n(s),m=n(a),w=n(u),b=n(c),y=new ut(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}},lt.crypto.ECParameterDB.regist("secp128r1",128,"FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC","E87579C11079F43DD824993C2CEE5ED3","FFFFFFFE0000000075A30D1B9038A115","1","161FF7528B899B2D0C28607CA52C5B86","CF5AC8395BAFEB13C02DA292DDED7A83",[],"","secp128r1 : SECG curve over a 128 bit prime field"),lt.crypto.ECParameterDB.regist("secp160k1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73","0","7","0100000000000000000001B8FA16DFAB9ACA16B6B3","1","3B4C382CE37AA192A4019E763036F4F5DD4D7EBB","938CF935318FDCED6BC28286531733C3F03C4FEE",[],"","secp160k1 : SECG curve over a 160 bit prime field"),lt.crypto.ECParameterDB.regist("secp160r1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC","1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45","0100000000000000000001F4C8F927AED3CA752257","1","4A96B5688EF573284664698968C38BB913CBFC82","23A628553168947D59DCC912042351377AC5FB32",[],"","secp160r1 : SECG curve over a 160 bit prime field"),lt.crypto.ECParameterDB.regist("secp192k1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37","0","3","FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D","1","DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D","9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D",[]),lt.crypto.ECParameterDB.regist("secp192r1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC","64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1","FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831","1","188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012","07192B95FFC8DA78631011ED6B24CDD573F977A11E794811",[]),lt.crypto.ECParameterDB.regist("secp224r1",224,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE","B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4","FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D","1","B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21","BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34",[]),lt.crypto.ECParameterDB.regist("secp256k1",256,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F","0","7","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","1","79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798","483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8",[]),lt.crypto.ECParameterDB.regist("secp256r1",256,"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC","5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B","FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551","1","6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296","4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5",["NIST P-256","P-256","prime256v1"]),lt.crypto.ECParameterDB.regist("secp384r1",384,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC","B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973","1","AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7","3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f",["NIST P-384","P-384"]),lt.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(y.AES,t,n,i)},e=function(t,e,n,i){var r=y.enc.Hex.parse(e),o=y.enc.Hex.parse(n),s=y.enc.Hex.parse(i),a={};a.key=o,a.iv=s,a.ciphertext=r;var u=t.decrypt(a,o,{iv:s});return y.enc.Hex.stringify(u)},n=function(t,e,n){return i(y.AES,t,e,n)},i=function(t,e,n,i){var r=y.enc.Hex.parse(e),o=y.enc.Hex.parse(n),s=y.enc.Hex.parse(i),a=t.encrypt(r,o,{iv:s}),u=y.enc.Hex.parse(a.toString());return y.enc.Base64.stringify(u)},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(y.TripleDES,t,n,i)},eproc:function(t,e,n){return i(y.TripleDES,t,e,n)},keylen:24,ivlen:8},"DES-CBC":{proc:function(t,n,i){return e(y.DES,t,n,i)},eproc:function(t,e,n){return i(y.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=y.enc.Hex.parse(i),s=y.enc.Utf8.parse(e),a=r[t].keylen+r[t].ivlen,u="",c=null;;){var l=y.algo.MD5.create();if(null!=c&&l.update(c),l.update(s),l.update(o),c=l.finalize(),(u+=y.enc.Hex.stringify(c)).length>=2*a)break}var h={};return h.keyhex=u.substr(0,2*r[t].keylen),h.ivhex=u.substr(2*r[t].keylen,2*r[t].ivlen),h},a=function(t,e,n,i){var o=y.enc.Base64.parse(t),s=y.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,u=n.data,c=s(i,e,r).keyhex;return a(u,i,c,r)},getEncryptedPKCS5PEMFromPrvKeyHex:function(t,e,n,i,o){var a,u,c="";if(void 0!==i&&null!=i||(i="AES-256-CBC"),void 0===r[i])throw"KEYUTIL unsupported algorithm: "+i;return void 0!==o&&null!=o||(o=(a=r[i].ivlen,u=y.lib.WordArray.random(a),y.enc.Hex.stringify(u)).toUpperCase()),c="-----BEGIN "+t+" PRIVATE KEY-----\r\n",c+="Proc-Type: 4,ENCRYPTED\r\n",c+="DEK-Info: "+i+","+o+"\r\n",c+="\r\n",(c+=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=ft.getChildIdx,n=ft.getV,i={},r=e(t,0);if(2!=r.length)throw"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"malformed format: SEQUENCE(0.0).items != 2: "+o.length;if("2a864886f70d01050d"!=n(t,o[0]))throw"this only supports pkcs5PBES2";var s=e(t,o[1]);if(2!=o.length)throw"malformed format: SEQUENCE(0.0.1).items != 2: "+s.length;var a=e(t,s[1]);if(2!=a.length)throw"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 u=e(t,s[0]);if(2!=u.length)throw"malformed format: SEQUENCE(0.0.1.0).items != 2: "+u.length;if("2a864886f70d01050c"!=n(t,u[0]))throw"this only supports pkcs5PBKDF2";var c=e(t,u[1]);if(c.length<2)throw"malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+c.length;i.pbkdf2Salt=n(t,c[0]);var l=n(t,c[1]);try{i.pbkdf2Iter=parseInt(l,16)}catch(t){throw"malformed format pbkdf2Iter: "+l}return i},getPBKDF2KeyHexFromParam:function(t,e){var n=y.enc.Hex.parse(t.pbkdf2Salt),i=y.PBKDF2(e,n,{keySize:6,iterations:t.pbkdf2Iter});return y.enc.Hex.stringify(i)},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(t,e){var n=Rt(t,"ENCRYPTED PRIVATE KEY"),i=this.parseHexOfEncryptedPKCS8(n),r=Ht.getPBKDF2KeyHexFromParam(i,e),o={};o.ciphertext=y.enc.Hex.parse(i.ciphertext);var s=y.enc.Hex.parse(r),a=y.enc.Hex.parse(i.encryptionSchemeIV),u=y.TripleDES.decrypt(o,s,{iv:a});return y.enc.Hex.stringify(u)},getKeyFromEncryptedPKCS8PEM:function(t,e){var n=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(t,e);return this.getKeyFromPlainPrivatePKCS8Hex(n)},parsePlainPrivatePKCS8Hex:function(t){var e=ft,n=e.getChildIdx,i=e.getV,r={algparam:null};if("30"!=t.substr(0,2))throw"malformed plain PKCS8 private key(code:001)";var o=n(t,0);if(3!=o.length)throw"malformed plain PKCS8 private key(code:002)";if("30"!=t.substr(o[1],2))throw"malformed PKCS8 private key(code:003)";var s=n(t,o[1]);if(2!=s.length)throw"malformed PKCS8 private key(code:004)";if("06"!=t.substr(s[0],2))throw"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"malformed PKCS8 private key(code:006)";return r.keyidx=e.getVidx(t,o[2]),r},getKeyFromPlainPrivatePKCS8PEM:function(t){var e=Rt(t,"PRIVATE KEY");return this.getKeyFromPlainPrivatePKCS8Hex(e)},getKeyFromPlainPrivatePKCS8Hex:function(t){var e,n=this.parsePlainPrivatePKCS8Hex(t);if("2a864886f70d010101"==n.algoid)e=new ot;else if("2a8648ce380401"==n.algoid)e=new lt.crypto.DSA;else{if("2a8648ce3d0201"!=n.algoid)throw"unsupported private key algorithm";e=new lt.crypto.ECDSA}return e.readPKCS8PrvKeyHex(t),e},_getKeyFromPublicPKCS8Hex:function(t){var e,n=ft.getVbyList(t,0,[0,0],"06");if("2a864886f70d010101"===n)e=new ot;else if("2a8648ce380401"===n)e=new lt.crypto.DSA;else{if("2a8648ce3d0201"!==n)throw"unsupported PKCS#8 public key hex";e=new lt.crypto.ECDSA}return e.readPKCS8PubKeyHex(t),e},parsePublicRawRSAKeyHex:function(t){var e=ft.getChildIdx,n=ft.getV,i={};if("30"!=t.substr(0,2))throw"malformed RSA key(code:001)";var r=e(t,0);if(2!=r.length)throw"malformed RSA key(code:002)";if("02"!=t.substr(r[0],2))throw"malformed RSA key(code:003)";if(i.n=n(t,r[0]),"02"!=t.substr(r[1],2))throw"malformed RSA key(code:004)";return i.e=n(t,r[1]),i},parsePublicPKCS8Hex:function(t){var e=ft,n=e.getChildIdx,i=e.getV,r={algparam:null},o=n(t,0);if(2!=o.length)throw"outer DERSequence shall have 2 elements: "+o.length;var s=o[0];if("30"!=t.substr(s,2))throw"malformed PKCS8 public key(code:001)";var a=n(t,s);if(2!=a.length)throw"malformed PKCS8 public key(code:002)";if("06"!=t.substr(a[0],2))throw"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"malformed PKCS8 public key(code:004)";return r.key=i(t,o[1]).substr(2),r}}}();Ht.getKey=function(t,e,n){var i,r=(m=ft).getChildIdx,o=m.getVbyList,s=lt.crypto,a=s.ECDSA,u=s.DSA,c=ot,l=Rt,h=Ht;if(void 0!==c&&t instanceof c)return t;if(void 0!==a&&t instanceof a)return t;if(void 0!==u&&t instanceof u)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(j=new c).setPublic(t.n,t.e),j;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(j=new c).setPrivateEx(t.n,t.e,t.d,t.p,t.q,t.dp,t.dq,t.co),j;if(void 0===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d&&void 0===t.p)return(j=new c).setPrivate(t.n,t.e,t.d),j;if(void 0!==t.p&&void 0!==t.q&&void 0!==t.g&&void 0!==t.y&&void 0===t.x)return(j=new u).setPublic(t.p,t.q,t.g,t.y),j;if(void 0!==t.p&&void 0!==t.q&&void 0!==t.g&&void 0!==t.y&&void 0!==t.x)return(j=new u).setPrivate(t.p,t.q,t.g,t.y,t.x),j;if("RSA"===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0===t.d)return(j=new c).setPublic(xt(t.n),xt(t.e)),j;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(j=new c).setPrivateEx(xt(t.n),xt(t.e),xt(t.d),xt(t.p),xt(t.q),xt(t.dp),xt(t.dq),xt(t.qi)),j;if("RSA"===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d)return(j=new c).setPrivate(xt(t.n),xt(t.e),xt(t.d)),j;if("EC"===t.kty&&void 0!==t.crv&&void 0!==t.x&&void 0!==t.y&&void 0===t.d){var d=(C=new a({curve:t.crv})).ecparams.keylen/4,f="04"+("0000000000"+xt(t.x)).slice(-d)+("0000000000"+xt(t.y)).slice(-d);return C.setPublicKeyHex(f),C}if("EC"===t.kty&&void 0!==t.crv&&void 0!==t.x&&void 0!==t.y&&void 0!==t.d){d=(C=new a({curve:t.crv})).ecparams.keylen/4,f="04"+("0000000000"+xt(t.x)).slice(-d)+("0000000000"+xt(t.y)).slice(-d);var p=("0000000000"+xt(t.d)).slice(-d);return C.setPublicKeyHex(f),C.setPrivateKeyHex(p),C}if("pkcs5prv"===n){var v,g=t,m=ft;if(9===(v=r(g,0)).length)(j=new c).readPKCS5PrvKeyHex(g);else if(6===v.length)(j=new u).readPKCS5PrvKeyHex(g);else{if(!(v.length>2&&"04"===g.substr(v[1],2)))throw"unsupported PKCS#1/5 hexadecimal key";(j=new a).readPKCS5PrvKeyHex(g)}return j}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=Rt(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"),S=o(i,0,[4],"02"),E=o(i,0,[5],"02");return(j=new u).setPrivate(new F(y,16),new F(x,16),new F(k,16),new F(S,16),new F(E,16)),j}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 ot;return _.readPKCS5PrvKeyHex(A),_}if(-1!=t.indexOf("-END EC PRIVATE KEY-")&&-1!=t.indexOf("4,ENCRYPTED")){var C,j=o(i=h.getDecryptedKeyHex(t,e),0,[1],"04"),R=o(i,0,[2,0],"06"),T=o(i,0,[3,0],"03").substr(2);if(void 0===lt.crypto.OID.oidhex2name[R])throw"undefined OID(hex) in KJUR.crypto.OID: "+R;return(C=new a({curve:lt.crypto.OID.oidhex2name[R]})).setPublicKeyHex(T),C.setPrivateKeyHex(j),C.isPublic=!1,C}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"),S=o(i,0,[4],"02"),E=o(i,0,[5],"02"),(j=new u).setPrivate(new F(y,16),new F(x,16),new F(k,16),new F(S,16),new F(E,16)),j;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 ot).generate(n,"10001"),s.isPrivate=!0,s.isPublic=!0;var i=new ot,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,u=e,c=new lt.crypto.ECDSA({curve:u}).generateKeyPairHex();return(s=new lt.crypto.ECDSA({curve:u})).setPublicKeyHex(c.ecpubhex),s.setPrivateKeyHex(c.ecprvhex),s.isPrivate=!0,s.isPublic=!1,(i=new lt.crypto.ECDSA({curve:u})).setPublicKeyHex(c.ecpubhex),i.isPrivate=!1,i.isPublic=!0,(a={}).prvKeyObj=s,a.pubKeyObj=i,a}throw"unknown algorithm: "+t},Ht.getPEM=function(t,e,n,i,r,o){var s=lt.asn1,a=s.DERObjectIdentifier,u=s.DERInteger,c=s.ASN1Util.newObject,l=lt.crypto,h=l.DSA,d=l.ECDSA,f=ot;function p(t){return c({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 c({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 c({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(),b="";return(b+=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=S(t,e);return new c({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()},S=function(t,e){var n=y.lib.WordArray.random(8),i=y.lib.WordArray.random(8),r=y.PBKDF2(e,n,{keySize:6,iterations:100}),o=y.enc.Hex.parse(t),s=y.TripleDES.encrypt(o,r,{iv:i})+"",a={};return a.ciphertext=s,a.pbkdf2Salt=y.enc.Hex.stringify(n),a.pbkdf2Iter=100,a.encryptionSchemeAlg="DES-EDE3-CBC",a.encryptionSchemeIV=y.enc.Hex.stringify(i),a};if("PKCS8PRV"==e&&null!=f&&t instanceof f&&1==t.isPrivate){var E=p(t).getEncodedHex();return x=c({seq:[{int:0},{seq:[{oid:{name:"rsaEncryption"}},{null:!0}]},{octstr:{hex:E}}]}).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 E=new c({seq:[{int:1},{octstr:{hex:t.prvKeyHex}},{tag:["a1",!0,{bitstr:{hex:"00"+t.pubKeyHex}}]}]}).getEncodedHex(),x=c({seq:[{int:0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:t.curveName}}]},{octstr:{hex:E}}]}).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 E=new u({bigint:t.x}).getEncodedHex(),x=c({seq:[{int:0},{seq:[{oid:{name:"dsa"}},{seq:[{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.g}}]}]},{octstr:{hex:E}}]}).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=Rt(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=ft.getChildIdx,n=ft.getTLV,i={},r=t;if("30"!=r.substr(0,2))throw"malformed CSR(code:001)";var o=e(r,0);if(o.length<1)throw"malformed CSR(code:002)";if("30"!=r.substr(o[0],2))throw"malformed CSR(code:003)";var s=e(r,o[0]);if(s.length<3)throw"malformed CSR(code:004)";return i.p8pubkeyhex=n(r,s[2]),i},Ht.getKeyID=function(t){var e=Ht,n=ft;"string"==typeof t&&-1!=t.indexOf("BEGIN ")&&(t=e.getKey(t));var i=Rt(e.getPEM(t)),r=n.getIdxbyList(i,0,[1]),o=n.getV(i,r).substring(2);return lt.crypto.Util.hashHex(o,"sha1")},Ht.getJWKFromKey=function(t){var e={};if(t instanceof ot&&t.isPrivate)return e.kty="RSA",e.n=yt(t.n.toString(16)),e.e=yt(t.e.toString(16)),e.d=yt(t.d.toString(16)),e.p=yt(t.p.toString(16)),e.q=yt(t.q.toString(16)),e.dp=yt(t.dmp1.toString(16)),e.dq=yt(t.dmq1.toString(16)),e.qi=yt(t.coeff.toString(16)),e;if(t instanceof ot&&t.isPublic)return e.kty="RSA",e.n=yt(t.n.toString(16)),e.e=yt(t.e.toString(16)),e;if(t instanceof lt.crypto.ECDSA&&t.isPrivate){if("P-256"!==(i=t.getShortNISTPCurveName())&&"P-384"!==i)throw"unsupported curve name for JWT: "+i;var n=t.getPublicKeyXYHex();return e.kty="EC",e.crv=i,e.x=yt(n.x),e.y=yt(n.y),e.d=yt(t.prvKeyHex),e}if(t instanceof lt.crypto.ECDSA&&t.isPublic){var i;if("P-256"!==(i=t.getShortNISTPCurveName())&&"P-384"!==i)throw"unsupported curve name for JWT: "+i;return n=t.getPublicKeyXYHex(),e.kty="EC",e.crv=i,e.x=yt(n.x),e.y=yt(n.y),e}throw"not supported key object"},ot.getPosArrayOfChildrenFromHex=function(t){return ft.getChildIdx(t,0)},ot.getHexValueArrayOfChildrenFromHex=function(t){var e,n=ft.getV,i=n(t,(e=ot.getPosArrayOfChildrenFromHex(t))[0]),r=n(t,e[1]),o=n(t,e[2]),s=n(t,e[3]),a=n(t,e[4]),u=n(t,e[5]),c=n(t,e[6]),l=n(t,e[7]),h=n(t,e[8]);return(e=new Array).push(i,r,o,s,a,u,c,l,h),e},ot.prototype.readPrivateKeyFromPEMString=function(t){var e=Rt(t),n=ot.getHexValueArrayOfChildrenFromHex(e);this.setPrivateEx(n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8])},ot.prototype.readPKCS5PrvKeyHex=function(t){var e=ot.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},ot.prototype.readPKCS8PrvKeyHex=function(t){var e,n,i,r,o,s,a,u,c=ft.getVbyListEx;if(!1===ft.isASN1HEX(t))throw new Error("not ASN.1 hex string");try{e=c(t,0,[2,0,1],"02"),n=c(t,0,[2,0,2],"02"),i=c(t,0,[2,0,3],"02"),r=c(t,0,[2,0,4],"02"),o=c(t,0,[2,0,5],"02"),s=c(t,0,[2,0,6],"02"),a=c(t,0,[2,0,7],"02"),u=c(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,u)},ot.prototype.readPKCS5PubKeyHex=function(t){var e=ft,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)},ot.prototype.readPKCS8PubKeyHex=function(t){var e=ft;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)},ot.prototype.readCertPubKeyHex=function(t){var e,n;(e=new qt).readCertHex(t),n=e.getPublicKeyHex(),this.readPKCS8PubKeyHex(n)};var Jt=new RegExp("[^0-9a-f]","gi");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(Ft(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 lt.crypto.Util.DIGESTINFOHEAD){var n=lt.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=ft,i=n.getChildIdx,r=n.getV,o=n.getTLV,s=n.getVbyList,a=n.getVbyListEx,u=n.getTLVbyList,c=n.getTLVbyListEx,l=n.getIdxbyList,h=n.getIdxbyListEx,d=n.getVidx,f=n.oidname,p=n.hextooidstr,v=qt,g=Rt;try{e=lt.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(){return null===this.hex||0!==this.version?this.version:"a003020102"!==u(this.hex,0,[0,0])?(this.version=1,this.foffset=-1,1):(this.version=3,3)},this.getSerialNumberHex=function(){return a(this.hex,0,[0,0],"02")},this.getSignatureAlgorithmField=function(){var t=c(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 f(a(t,0,[0],"06"))},this.getIssuer=function(){return this.getX500Name(this.getIssuerHex())},this.getIssuerHex=function(){return u(this.hex,0,[0,3+this.foffset],"30")},this.getIssuerString=function(){return v.hex2dn(this.getIssuerHex())},this.getSubject=function(){return this.getX500Name(this.getSubjectHex())},this.getSubjectHex=function(){return u(this.hex,0,[0,5+this.foffset],"30")},this.getSubjectString=function(){return v.hex2dn(this.getSubjectHex())},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=u(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=u(this.hex,0,[0],"30"),r=new lt.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=Rt(t);var u=l(a,0,[0,3,0,0],"06");if("2a864886f70d01090e"!=r(a,u))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 c=0;c<o.length;c++){var h={critical:!1},f=0;3===i(a,o[c]).length&&(h.critical=!0,f=1),h.oid=n.hextooidstr(s(a,o[c],[0],"06"));var p=l(a,o[c],[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=lt.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),u=0;u<a.length;u++){var c=t.substr(a[u],2);if("80"===c&&(s.kid={hex:r(t,a[u])}),"a1"===c){var l=o(t,a[u]),h=this.getGeneralNames(l);s.issuer=h[0].dn}"82"===c&&(s.sn={hex:r(t,a[u])})}return s},this.getExtExtKeyUsage=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("extKeyUsage");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var s={extname:"extKeyUsage",array:[]};e&&(s.critical=!0);for(var a=i(t,0),u=0;u<a.length;u++)s.array.push(f(r(t,a[u])));return s},this.getExtExtKeyUsageName=function(){var t=this.getExtInfo("extKeyUsage");if(void 0===t)return t;var e=new Array,n=o(this.hex,t.vidx);if(""===n)return e;for(var s=i(n,0),a=0;a<s.length;a++)e.push(f(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:Mt(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,u=o(this.hex,s.vidx),c=i(u,0),l=0;l<c.length;l++)n=u.substr(c[l],2),t=r(u,c[l]),"81"===n&&(e=St(t),a.push(["MAIL",e])),"82"===n&&(e=St(t),a.push(["DNS",e])),"84"===n&&(e=qt.hex2dn(t,0),a.push(["DN",e])),"86"===n&&(e=St(t),a.push(["URI",e])),"87"===n&&(e=Mt(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 u=o(t,s[a]);r.array.push(this.getDistributionPoint(u))}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=St(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(St(a)),"2b06010505073002"===o&&e.caissuer.push(St(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 u=i(t,0),c=0;c<u.length;c++){var l=a(t,u[c],[0],"06"),h=St(s(t,u[c],[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 u=o(t,s[a]),c=this.getPolicyInformation(u);r.array.push(c)}return r},this.getPolicyInformation=function(t){var e={},n=s(t,0,[0],"06");e.policyoid=f(n);var r=h(t,0,[1],"30");if(-1!=r){e.array=[];for(var a=i(t,r),u=0;u<a.length;u++){var c=o(t,a[u]),l=this.getPolicyQualifierInfo(c);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=u(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]),u=this.getGeneralName(a);null!=u.uri&&(r.uri=u.uri)}if(s.length>2){var c=o(t,s[2]);"0101ff"==c&&(r.reqauth=!0),"010100"==c&&(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,u=s.type;if("prn"!=a&&"utf8"!=a&&"ia5"!=a)return"mixed";if("ia5"==a){if("CN"!=u)return"mixed";if(lt.lang.String.isMail(s.value))continue;return"mixed"}if("C"==u){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=lt.asn1.ASN1Util.oidHexToInt(r);return e.type=lt.asn1.x509.OID.oid2atype(a),e.value=Et(o),e.ds=this.HEX2STAG[t.substr(n[1],2)],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=c(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=p(s(t,0,[0],"06")),r=!1;3==e&&"0101ff"==u(t,0,[1])&&(r=!0);var o=u(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 c={extname:n,extn:o};return r&&(c.critical=!0),c},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 t.map((function(t){return(e=t).type+"="+e.value;var e})).join("+")})).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 u=n[a],c=lt.asn1.x509.OID.oid2name(u.oid);""===c&&(c=u.oid);var l="";if(!0===u.critical&&(l="CRITICAL"),t+=" "+c+" "+l+":\n","basicConstraints"===c){var h=this.getExtBasicConstraints();void 0===h.cA?t+=" {}\n":(t+=" cA=true",void 0!==h.pathLen&&(t+=", pathLen="+h.pathLen),t+="\n")}else if("keyUsage"===c)t+=" "+this.getExtKeyUsageString()+"\n";else if("subjectKeyIdentifier"===c)t+=" "+this.getExtSubjectKeyIdentifier().kid.hex+"\n";else if("authorityKeyIdentifier"===c){var d=this.getExtAuthorityKeyIdentifier();void 0!==d.kid&&(t+=" kid="+d.kid.hex+"\n")}else"extKeyUsage"===c?t+=" "+this.getExtExtKeyUsage().array.join(", ")+"\n":"subjectAltName"===c?t+=" "+(i=this.getExtSubjectAltName(),JSON.stringify(i.array).replace(/[\[\]\{\}\"]/g,"")+"\n"):"cRLDistributionPoints"===c?t+=o(this.getExtCRLDistributionPoints()):"authorityInfoAccess"===c?t+=s(this.getExtAuthorityInfoAccess()):"certificatePolicies"===c&&(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):lt.lang.String.isHex(t)&&this.readCertHex(t))}ot.prototype.sign=function(t,e){var n=lt.crypto.Util.hashString(t,e);return this.signWithMessageHash(n,e)},ot.prototype.signWithMessageHash=function(t,e){var n=it(lt.crypto.Util.getPaddedDigestInfoHex(t,e,this.n.bitLength()),16);return zt(this.doPrivate(n).toString(16),this.n.bitLength())},ot.prototype.signPSS=function(t,e,n){var i,r=(i=Ft(t),lt.crypto.Util.hashHex(i,e));return void 0===n&&(n=-1),this.signWithMessageHashPSS(r,e,n)},ot.prototype.signWithMessageHashPSS=function(t,e,n){var i,r=Et(t),o=r.length,s=this.n.bitLength()-1,a=Math.ceil(s/8),u=function(t){return lt.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 c="";n>0&&(c=new Array(n),(new nt).nextBytes(c),c=String.fromCharCode.apply(String,c));var l=Et(u(Ft("\0\0\0\0\0\0\0\0"+r+c))),h=[];for(i=0;i<a-n-o-2;i+=1)h[i]=0;var d=String.fromCharCode.apply(String,h)+""+c,f=Kt(l,d.length,u),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 F(p)).toString(16),this.n.bitLength())},ot.prototype.verify=function(t,e){var n=it(e=(e=e.replace(Jt,"")).replace(/[ \n]+/g,""),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]==lt.crypto.Util.hashString(t,i[0])},ot.prototype.verifyWithMessageHash=function(t,e){if(e.length!=Math.ceil(this.n.bitLength()/4))return!1;var n=it(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},ot.prototype.verifyPSS=function(t,e,n,i){var r,o=(r=Ft(t),lt.crypto.Util.hashHex(r,n));return void 0===i&&(i=-1),this.verifyWithMessageHashPSS(o,e,n,i)},ot.prototype.verifyWithMessageHashPSS=function(t,e,n,i){if(e.length!=Math.ceil(this.n.bitLength()/4))return!1;var r,o=new F(e,16),s=function(t){return lt.crypto.Util.hashHex(t,n)},a=Et(t),u=a.length,c=this.n.bitLength()-1,l=Math.ceil(c/8);if(-1===i||void 0===i)i=u;else if(-2===i)i=l-u-2;else if(i<-2)throw new Error("invalid salt length");if(l<u+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-u-1),f=h.substr(d.length,u),p=65280>>8*l-c&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-u-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(Ft("\0\0\0\0\0\0\0\0"+a+String.fromCharCode.apply(String,g.slice(-i)))))},ot.SALT_LEN_HLEN=-1,ot.SALT_LEN_MAX=-2,ot.SALT_LEN_RECOVER=-2,qt.hex2dn=function(t,e){if(void 0===e&&(e=0),"30"!==t.substr(e,2))throw new Error("malformed DN");for(var n=new Array,i=ft.getChildIdx(t,e),r=0;r<i.length;r++)n.push(qt.hex2rdn(t,i[r]));return"/"+(n=n.map((function(t){return t.replace("/","\\/")}))).join("/")},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=ft.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=ft,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=lt.asn1.ASN1Util.oidHexToInt(o);return lt.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=ft.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!==lt&<||(e.KJUR=lt={}),void 0!==lt.jws&<.jws||(lt.jws={}),lt.jws.JWS=function(){var t=lt.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 u=xt(s),c=it(u,16);this.parsedJWS.sigvalH=u,this.parsedJWS.sigvalBI=c}var l=dt(r),h=dt(o);if(this.parsedJWS.headS=l,this.parsedJWS.payloadS=h,!t(l,this.parsedJWS,"headP"))throw"malformed JSON string for JWS Head: "+l}}},lt.jws.JWS.sign=function(t,e,i,r,o){var s,a,u,c=lt.jws.JWS,l=c.readSafeJSONString,h=c.isSafeJSONString,d=lt.crypto,f=d.Mac,p=d.Signature,v=JSON;if("string"!=typeof e&&"object"!=(void 0===e?"undefined":n(e)))throw"spHeader must be JSON string or object: "+e;if("object"==(void 0===e?"undefined":n(e))&&(s=v.stringify(a=e)),"string"==typeof e){if(!h(s=e))throw"JWS Head is not safe JSON string: "+s;a=l(s)}if(u=i,"object"==(void 0===i?"undefined":n(i))&&(u=v.stringify(i)),""!=t&&null!=t||void 0===a.alg||(t=a.alg),""!=t&&null!=t&&void 0===a.alg&&(a.alg=t,s=v.stringify(a)),t!==a.alg)throw"alg and sHeader.alg doesn't match: "+t+"!="+a.alg;var g=null;if(void 0===c.jwsalg2sigalg[t])throw"unsupported alg name: "+t;g=c.jwsalg2sigalg[t];var m=ht(s)+"."+ht(u),w="";if("Hmac"==g.substr(0,4)){if(void 0===r)throw"mac key shall be specified for HS* alg";var b=new f({alg:g,prov:"cryptojs",pass:r});b.updateString(m),w=b.doFinal()}else if(-1!=g.indexOf("withECDSA")){(x=new p({alg:g})).init(r,o),x.updateString(m);var y=x.sign();w=lt.crypto.ECDSA.asn1SigToConcatSig(y)}else{var x;"none"!=g&&((x=new p({alg:g})).init(r,o),x.updateString(m),w=x.sign())}return m+"."+yt(w)},lt.jws.JWS.verify=function(t,e,i){var r,o=lt.jws.JWS,s=o.readSafeJSONString,a=lt.crypto,u=a.ECDSA,c=a.Mac,l=a.Signature;void 0!==n(ot)&&(r=ot);var h=t.split(".");if(3!==h.length)return!1;var d,f=h[0]+"."+h[1],p=xt(h[2]),v=s(dt(h[0])),g=null;if(void 0===v.alg)throw"algorithm not specified in header";if(d=(g=v.alg).substr(0,2),null!=i&&"[object Array]"===Object.prototype.toString.call(i)&&i.length>0&&-1==(":"+i.join(":")+":").indexOf(":"+g+":"))throw"algorithm '"+g+"' not accepted in the list";if("none"!=g&&null===e)throw"key shall be specified to verify.";if("string"==typeof e&&-1!=e.indexOf("-----BEGIN ")&&(e=Ht.getKey(e)),!("RS"!=d&&"PS"!=d||e instanceof r))throw"key shall be a RSAKey obj for RS* and PS* algs";if("ES"==d&&!(e instanceof u))throw"key shall be a ECDSA obj for ES* algs";var m=null;if(void 0===o.jwsalg2sigalg[v.alg])throw"unsupported alg name: "+g;if("none"==(m=o.jwsalg2sigalg[g]))throw"not supported";if("Hmac"==m.substr(0,4)){if(void 0===e)throw"hexadecimal key shall be specified for HMAC";var w=new c({alg:m,pass:e});return w.updateString(f),p==w.doFinal()}if(-1!=m.indexOf("withECDSA")){var b,y=null;try{y=u.concatSigToASN1Sig(p)}catch(t){return!1}return(b=new l({alg:m})).init(e),b.updateString(f),b.verify(y)}return(b=new l({alg:m})).init(e),b.updateString(f),b.verify(p)},lt.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=lt.jws.JWS.readSafeJSONString(dt(i[0])),r.payloadObj=lt.jws.JWS.readSafeJSONString(dt(e)),r.headerPP=JSON.stringify(r.headerObj,null," "),r.payloadPP=null==r.payloadObj?dt(e):JSON.stringify(r.payloadObj,null," "),void 0!==n&&(r.sigHex=xt(n)),r},lt.jws.JWS.verifyJWT=function(t,e,i){var r=lt.jws,o=r.JWS,s=o.readSafeJSONString,a=o.inArray,u=o.includedArray,c=t.split("."),l=c[0],h=c[1],d=(xt(c[2]),s(dt(l))),f=s(dt(h));if(void 0===d.alg)return!1;if(void 0===i.alg)throw"acceptField.alg shall be specified";if(!a(d.alg,i.alg))return!1;if(void 0!==f.iss&&"object"===n(i.iss)&&!a(f.iss,i.iss))return!1;if(void 0!==f.sub&&"object"===n(i.sub)&&!a(f.sub,i.sub))return!1;if(void 0!==f.aud&&"object"===n(i.aud))if("string"==typeof f.aud){if(!a(f.aud,i.aud))return!1}else if("object"==n(f.aud)&&!u(f.aud,i.aud))return!1;var p=r.IntDate.getNow();return void 0!==i.verifyAt&&"number"==typeof i.verifyAt&&(p=i.verifyAt),void 0!==i.gracePeriod&&"number"==typeof i.gracePeriod||(i.gracePeriod=0),!(void 0!==f.exp&&"number"==typeof f.exp&&f.exp+i.gracePeriod<p||void 0!==f.nbf&&"number"==typeof f.nbf&&p<f.nbf-i.gracePeriod||void 0!==f.iat&&"number"==typeof f.iat&&p<f.iat-i.gracePeriod||void 0!==f.jti&&void 0!==i.jti&&f.jti!==i.jti||!o.verify(t,e,i.alg))},lt.jws.JWS.includedArray=function(t,e){var i=lt.jws.JWS.inArray;if(null===t)return!1;if("object"!==(void 0===t?"undefined":n(t)))return!1;if("number"!=typeof t.length)return!1;for(var r=0;r<t.length;r++)if(!i(t[r],e))return!1;return!0},lt.jws.JWS.inArray=function(t,e){if(null===e)return!1;if("object"!==(void 0===e?"undefined":n(e)))return!1;if("number"!=typeof e.length)return!1;for(var i=0;i<e.length;i++)if(e[i]==t)return!0;return!1},lt.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"},lt.jws.JWS.isSafeJSONString=function(t,e,i){var r=null;try{return"object"!=(void 0===(r=ct(t))?"undefined":n(r))||r.constructor===Array?0:(e&&(e[i]=r),1)}catch(t){return 0}},lt.jws.JWS.readSafeJSONString=function(t){var e=null;try{return"object"!=(void 0===(e=ct(t))?"undefined":n(e))||e.constructor===Array?null:e}catch(t){return null}},lt.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]},lt.jws.JWS.getJWKthumbprint=function(t){if("RSA"!==t.kty&&"EC"!==t.kty&&"oct"!==t.kty)throw"unsupported algorithm for JWK Thumprint";var e="{";if("RSA"===t.kty){if("string"!=typeof t.n||"string"!=typeof t.e)throw"wrong n and e value for RSA key";e+='"e":"'+t.e+'",',e+='"kty":"'+t.kty+'",',e+='"n":"'+t.n+'"}'}else if("EC"===t.kty){if("string"!=typeof t.crv||"string"!=typeof t.x||"string"!=typeof t.y)throw"wrong crv, x and y value for EC key";e+='"crv":"'+t.crv+'",',e+='"kty":"'+t.kty+'",',e+='"x":"'+t.x+'",',e+='"y":"'+t.y+'"}'}else if("oct"===t.kty){if("string"!=typeof t.k)throw"wrong k value for oct(symmetric) key";e+='"kty":"'+t.kty+'",',e+='"k":"'+t.k+'"}'}var n=Ft(e);return yt(lt.crypto.Util.hashHex(n,"sha256"))},lt.jws.IntDate={},lt.jws.IntDate.get=function(t){var e=lt.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},lt.jws.IntDate.getZulu=function(t){return It(t)},lt.jws.IntDate.getNow=function(){return~~(new Date/1e3)},lt.jws.IntDate.intDate2UTCString=function(t){return new Date(1e3*t).toUTCString()},lt.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=nt,e.rng_seed_time=Y,e.BigInteger=F,e.RSAKey=ot,e.EDSA=lt.crypto.EDSA,e.DSA=lt.crypto.DSA,e.Signature=lt.crypto.Signature,e.MessageDigest=lt.crypto.MessageDigest,e.Mac=lt.crypto.Mac,e.Cipher=lt.crypto.Cipher,e.KEYUTIL=Ht,e.ASN1HEX=ft,e.X509=qt,e.CryptoJS=y,e.b64tohex=S,e.b64toBA=E,e.stoBA=pt,e.BAtos=vt,e.BAtohex=gt,e.stohex=mt,e.stob64=function(t){return k(mt(t))},e.stob64u=function(t){return wt(k(mt(t)))},e.b64utos=function(t){return vt(E(bt(t)))},e.b64tob64u=wt,e.b64utob64=bt,e.hex2b64=k,e.hextob64u=yt,e.b64utohex=xt,e.utf8tob64u=ht,e.b64utoutf8=dt,e.utf8tob64=function(t){return k(Ot(Ut(t)))},e.b64toutf8=function(t){return decodeURIComponent(Nt(S(t)))},e.utf8tohex=kt,e.hextoutf8=St,e.hextorstr=Et,e.rstrtohex=Ft,e.hextob64=At,e.hextob64nl=_t,e.b64nltohex=Ct,e.hextopem=jt,e.pemtohex=Rt,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=Tt,e.zulutosec=It,e.zulutodate=function(t){return new Date(Tt(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=Ot,e.hextouricmp=Nt,e.ipv6tohex=Pt,e.hextoipv6=Dt,e.hextoip=Mt,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 Pt(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=lt,e.crypto=lt.crypto,e.asn1=lt.asn1,e.jws=lt.jws,e.lang=lt.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 u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=u.prototype:(null===t&&(t=new u(e)),t.length=e),t}function u(t,e,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(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 c(this,t,e,n)}function c(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),u.TYPED_ARRAY_SUPPORT?(t=e).__proto__=u.prototype:t=d(t,e),t}(t,e,n,i):"string"==typeof e?function(t,e,n){if("string"==typeof n&&""!==n||(n="utf8"),!u.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(u.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)),!u.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(u.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 $(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return H(t).length;default:if(i)return $(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 C(this,e,n);case"latin1":case"binary":return j(this,e,n);case"base64":return F(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(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=u.from(e,i)),u.isBuffer(e))return 0===e.length?-1:w(t,e,n,i,r);if("number"==typeof e)return e&=255,u.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,u=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,u/=2,n/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(r){var l=-1;for(o=n;o<a;o++)if(c(t,o)===c(e,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===u)return l*s}else-1!==l&&(o-=o-l),l=-1}else for(n+u>a&&(n=a-u),o=n;o>=0;o--){for(var h=!0,d=0;d<u;d++)if(c(t,o+d)!==c(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 J($(e,t.length-n),t,n,i)}function x(t,e,n,i){return J(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 S(t,e,n,i){return J(H(e),t,n,i)}function E(t,e,n,i){return J(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,u,c=t[r],l=null,h=c>239?4:c>223?3:c>191?2:1;if(r+h<=n)switch(h){case 1:c<128&&(l=c);break;case 2:128==(192&(o=t[r+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:s=t[r+2],128==(192&(o=t[r+1]))&&128==(192&s)&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:s=t[r+2],a=t[r+3],128==(192&(o=t[r+1]))&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(l=u)}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=u,e.SlowBuffer=function(t){return+t!=t&&(t=0),u.alloc(+t)},e.INSPECT_MAX_BYTES=50,u.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(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,e,n){return c(null,t,e,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.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},u.allocUnsafe=function(t){return h(null,t)},u.allocUnsafeSlow=function(t){return h(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,e){if(!u.isBuffer(t)||!u.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},u.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}},u.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var i=u.allocUnsafe(e),r=0;for(n=0;n<t.length;++n){var s=t[n];if(!u.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,r),r+=s.length}return i},u.byteLength=p,u.prototype._isBuffer=!0,u.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},u.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},u.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},u.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?A(this,0,t):v.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.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+">"},u.prototype.compare=function(t,e,n,i,r){if(!u.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),c=this.slice(i,r),l=t.slice(e,n),h=0;h<a;++h)if(c[h]!==l[h]){o=c[h],s=l[h];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},u.prototype.indexOf=function(t,e,n){return m(this,t,e,n,!0)},u.prototype.lastIndexOf=function(t,e,n){return m(this,t,e,n,!1)},u.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 S(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var _=4096;function C(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 j(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 T(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 I(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(!u.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}u.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),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=u.prototype;else{var r=e-t;n=new u(r,void 0);for(var o=0;o<r;++o)n[o]=this[o+t]}return n},u.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||I(t,e,this.length);for(var i=this[t],r=1,o=0;++o<e&&(r*=256);)i+=this[t+o]*r;return i},u.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||I(t,e,this.length);for(var i=this[t+--e],r=1;e>0&&(r*=256);)i+=this[t+--e]*r;return i},u.prototype.readUInt8=function(t,e){return e||I(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||I(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||I(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||I(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},u.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||I(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},u.prototype.readInt8=function(t,e){return e||I(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||I(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(t,e){e||I(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(t,e){return e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||I(t,4,this.length),r.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||I(t,4,this.length),r.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||I(t,8,this.length),r.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||I(t,8,this.length),r.read(this,t,!1,52,8)},u.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},u.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},u.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):N(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):N(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,4,4294967295,0),u.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},u.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,4,4294967295,0),u.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},u.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},u.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},u.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):N(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):N(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,4,2147483647,-2147483648),u.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},u.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),u.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},u.prototype.writeFloatLE=function(t,e,n){return M(this,t,e,!0,n)},u.prototype.writeFloatBE=function(t,e,n){return M(this,t,e,!1,n)},u.prototype.writeDoubleLE=function(t,e,n){return U(this,t,e,!0,n)},u.prototype.writeDoubleBE=function(t,e,n){return U(this,t,e,!1,n)},u.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||!u.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},u.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&&!u.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=u.isBuffer(t)?t:$(new u(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 $(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 H(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 J(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=u(t),n=e[1];return 3*(e[0]+n)/4-n},e.toByteArray=function(t){var e,n,o,s=u(t),a=s[0],c=s[1],l=new r(3*(a+(o=c))/4-o),h=0,d=c>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===c&&(e=i[t.charCodeAt(n)]<<2|i[t.charCodeAt(n+1)]>>4,l[h++]=255&e),1===c&&(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,u=i-r;a<u;a+=s)o.push(c(t,a,a+s>u?u: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 u(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 c(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,u=(1<<a)-1,c=u>>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-c;else{if(o===u)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,i),o-=c}return(f?-1:1)*s*Math.pow(2,o-i)},e.write=function(t,e,n,i,r,o){var s,a,u,c=8*o-r-1,l=(1<<c)-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*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+h>=1?d/u:d*Math.pow(2,1-h))*u>=2&&(s++,u/=2),s+h>=l?(a=0,s=l):s+h>=1?(a=(e*u-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,c+=r;c>0;t[n+f]=255&s,f+=p,s/=256,c-=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,u=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,u,c,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,u,c,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 u=t.parseJwt(e).payload;if(!u.iss)return i.Log.error("JoseUtil._validateJwt: issuer was not provided"),Promise.reject(new Error("issuer was not provided"));if(u.iss!==n)return i.Log.error("JoseUtil._validateJwt: Invalid issuer in token",u.iss),Promise.reject(new Error("Invalid issuer in token: "+u.iss));if(!u.aud)return i.Log.error("JoseUtil._validateJwt: aud was not provided"),Promise.reject(new Error("aud was not provided"));if(!(u.aud===r||Array.isArray(u.aud)&&u.aud.indexOf(r)>=0))return i.Log.error("JoseUtil._validateJwt: Invalid audience in token",u.aud),Promise.reject(new Error("Invalid audience in token: "+u.aud));if(u.azp&&u.azp!==r)return i.Log.error("JoseUtil._validateJwt: Invalid azp in token",u.azp),Promise.reject(new Error("Invalid azp in token: "+u.azp));if(!a){var c=s+o,l=s-o;if(!u.iat)return i.Log.error("JoseUtil._validateJwt: iat was not provided"),Promise.reject(new Error("iat was not provided"));if(c<u.iat)return i.Log.error("JoseUtil._validateJwt: iat is in the future",u.iat),Promise.reject(new Error("iat is in the future: "+u.iat));if(u.nbf&&c<u.nbf)return i.Log.error("JoseUtil._validateJwt: nbf is in the future",u.nbf),Promise.reject(new Error("nbf is in the future: "+u.nbf));if(!u.exp)return i.Log.error("JoseUtil._validateJwt: exp was not provided"),Promise.reject(new Error("exp was not provided"));if(u.exp<l)return i.Log.error("JoseUtil._validateJwt: exp is in the past",u.exp),Promise.reject(new Error("exp is in the past:"+u.exp))}return Promise.resolve(u)},t._validateJwt=function(n,r,o,s,a,c,l){return t.validateJwtAttributes(n,o,s,a,c,l).then((function(t){try{return e.JWS.verify(n,r,u)?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,u=e.data,c=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),u&&(this.state=new o.State({data:u,request_type:l}),n=r.UrlUtility.addQueryParam(n,"state",this.state.id))),c)n=r.UrlUtility.addQueryParam(n,h,c[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),u=n(45),c=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]:c.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 u.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),u=n(6),c=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,S=n.monitorSession,E=void 0===S||S,F=n.monitorAnonymousSession,A=void 0!==F&&F,_=n.checkSessionInterval,C=void 0===_?2e3:_,j=n.stopCheckSessionOnError,R=void 0===j||j,T=n.query_status_response_type,I=n.revokeAccessTokenOnSignout,O=void 0!==I&&I,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,$=void 0===B?new a.IFrameNavigator:B,H=n.userStore,J=void 0===H?new u.WebStorageStateStore({store:c.Global.sessionStorage}):H;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=E,z._monitorAnonymousSession=A,z._checkSessionInterval=C,z._stopCheckSessionOnError=R,z._query_status_response_type=T||(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=$,z._userStore=J,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 u(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=u(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.5"}])}))}}),oi=Kt({"node_modules/form-urlencoded/form-urlencoded.js"(t,e){e.exports=(t,e={})=>{const{sorted:n,skipIndex:i,ignorenull:r,skipBracket:o,useDot:s,whitespace:a="+"}=e,u=t=>String(t).replace(/[^ !'()~*]/gu,encodeURIComponent).replace(/ /g,a).replace(/[!'()~*]/g,(t=>`%${t.charCodeAt().toString(16).slice(-2).toUpperCase()}`)),c=(t,e=Object.keys(t))=>n?e.sort():e,l=t=>t.filter((t=>t)).join("&"),h=(t,e,n=typeof e,a=null)=>(e===a?a=r?a:u(t)+"="+a:/string|number|boolean/.test(n)?a=u(t)+"="+u(e):Array.isArray(e)?a=((t,e,n=(o?"":"[]"))=>e.length?l(e.map(((e,r)=>h(i?t+n:t+"["+r+"]",e)))):u(t+n))(t,e):e instanceof Set?a=((t,e)=>l(Array.from(e).map((e=>h(t,e)))))(t,e):"object"===n&&(a=((t,e)=>l(c(e).map((n=>h(s?`${t}.${n}`:`${t}[${n}]`,e[n])))))(t,e)),a);return t&&l(c(t).map((e=>h(e,t[e]))))}}}),si=Kt({"node_modules/@inrupt/oidc-client-ext/dist/index.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=ri(),n=ni();function i(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var r=i(oi());function o(t){return void 0!==t.error_description&&"string"==typeof t.error_description}function s(t,e){if(void 0!==(i=t).error&&"string"==typeof i.error)throw new n.OidcProviderError(`Token endpoint returned error [${t.error}]${o(t)?`: ${t.error_description}`:""}${function(t){return void 0!==t.error_uri&&"string"==typeof t.error_uri}(t)?` (see ${t.error_uri})`:""}`,t.error,o(t)?t.error_description:void 0);var i;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 a={"content-type":"application/x-www-form-urlencoded"};let u;o&&(u=await n.generateDpopKeyPair(),a.DPoP=await n.createDpopHeader(t.tokenEndpoint,"POST",u)),e.clientSecret&&(a.Authorization=`Basic ${btoa(`${e.clientId}:${e.clientSecret}`)}`);const c={method:"POST",headers:a,body:r.default({grant_type:i.grantType,redirect_uri:i.redirectUrl,code:i.code,code_verifier:i.codeVerifier,client_id:e.clientId})},l=await await fetch(t.tokenEndpoint,c),h=s(await l.json(),o),d=await n.getWebidFromTokenPayload(h.id_token,t.jwksUri,t.issuer,e.clientId);return{accessToken:h.access_token,idToken:h.id_token,refreshToken:(f=h,void 0!==f.refresh_token&&"string"==typeof f.refresh_token?h.refresh_token:void 0),webId:d,dpopKey:u,expiresIn:h.expires_in};var f}(t,e,i,!0)},t.refresh=async function(t,e,i,o){const a={grant_type:"refresh_token",refresh_token:t,scope:"openid offline_access"};let u={};void 0!==o&&(u={DPoP:await n.createDpopHeader(e.tokenEndpoint,"POST",o)});let c={};void 0!==i.clientSecret&&(c={Authorization:`Basic ${btoa(`${i.clientId}:${i.clientSecret}`)}`});const l=await fetch(e.tokenEndpoint,{method:"POST",body:r.default(a),headers:{...u,...c,"Content-Type":"application/x-www-form-urlencoded"}});let h;try{h=await l.json()}catch(t){throw new Error(`The token endpoint of issuer ${e.issuer} returned a malformed response.`)}const d=s(h,void 0!==o),f=await n.getWebidFromTokenPayload(d.id_token,e.jwksUri,e.issuer,i.clientId);return{accessToken:d.access_token,idToken:d.id_token,refreshToken:"string"==typeof d.refresh_token?d.refresh_token:void 0,webId:f,dpopKey:o,expiresIn:d.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={"Content-Type":"application/json"};t.registrationAccessToken&&(s.Authorization=`Bearer ${t.registrationAccessToken}`);const a=await fetch(e.registrationEndpoint.toString(),{method:"POST",headers:s,body:JSON.stringify(o)});if(a.ok){const e=await a.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===a.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 a.json(),t),new Error(`Dynamic client registration failed: the server returned ${a.status} ${a.statusText} - ${await a.text()}`)},t.removeOidcQueryParam=function(t){const e=new URL(t);return e.searchParams.delete("code"),e.searchParams.delete("state"),e.hash="",e.toString()}}}),ai=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=ni();t.KEY_CURRENT_SESSION=`${e.SOLID_CLIENT_AUTHN_KEY_PREFIX}currentSession`,t.KEY_CURRENT_URL=`${e.SOLID_CLIENT_AUTHN_KEY_PREFIX}currentUrl`}}),ui=Kt({"node_modules/@inrupt/solid-client-authn-browser/dist/ClientAuthentication.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=ni(),n=si(),i=(Ue(),Qt),r=ai(),o=(t,e)=>window.fetch(t,e);t.default=class{constructor(t,s,a,u,c){this.loginHandler=t,this.redirectHandler=s,this.logoutHandler=a,this.sessionInfoManager=u,this.issuerConfigFetcher=c,this.login=async(t,e)=>{var i,r;await this.sessionInfoManager.clear(t.sessionId);const o=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=o,this.logout=async t=>{await this.logoutHandler.handle(t),this.fetch=o},this.getSessionInfo=async t=>this.sessionInfoManager.get(t),this.getAllSessionInfo=async()=>this.sessionInfoManager.getAll(),this.validateCurrentSession=async()=>{const t=window.localStorage.getItem(r.KEY_CURRENT_SESSION);if(null===t)return null;const n=await this.sessionInfoManager.get(t);if(void 0===n||void 0===n.idToken||void 0===n.clientAppId||void 0===n.issuer)return null;const o=await this.issuerConfigFetcher.fetchConfig(n.issuer);try{const t=await e.fetchJwks(o.jwksUri,o.issuer);return await i.jwtVerify(n.idToken,await i.parseJwk(t),{audience:n.clientAppId,issuer:o.issuer}),n}catch(t){}return null},this.handleIncomingRedirect=async(t,e)=>{const n=await this.redirectHandler.handle(t,e);this.fetch=n.fetch.bind(window);const i=new URL(t);return i.searchParams.delete("state"),i.searchParams.delete("code"),i.searchParams.delete("id_token"),i.searchParams.delete("access_token"),i.searchParams.delete("error"),i.searchParams.delete("error_description"),window.history.replaceState(null,"",i.toString()),{isLoggedIn:n.isLoggedIn,webId:n.webId,sessionId:n.sessionId,expirationDate:n.expirationDate}}}}}}),ci=Kt({"node_modules/@inrupt/solid-client-authn-browser/dist/login/oidc/OidcLoginHandler.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=ni();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 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)}}}}),li=Kt({"node_modules/@inrupt/solid-client-authn-browser/dist/login/oidc/oidcHandlers/AuthorizationCodeWithPkceOidcHandler.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=si();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 n;const i={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:"openid offline_access",filterProtocolClaims:!0,loadUserInfo:!1,code_verifier:!0,prompt:null!==(n=t.prompt)&&void 0!==n?n:"consent"},r=new e.OidcClient(i),{redirector:o}=this,s=this.storageUtility;try{const e=await r.createSigninRequest();await Promise.all([s.setForUser(e.state._id,{sessionId:t.sessionId}),s.setForUser(t.sessionId,{codeVerifier:e.state._code_verifier,issuer:t.issuer.toString(),redirectUrl:t.redirectUrl,dpop:t.dpop?"true":"false"})]),o.redirect(e.url.toString(),{handleRedirect:t.handleRedirect,redirectInIframe:t.inIframe})}catch(t){console.error(t)}}}}}),hi=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()}}}),di=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=ni(),n=hi();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},solid_oidc_supported:{toKey:"solidOidcSupported"}},r=class{constructor(t){this.storageUtility=t}static getLocalStorageKey(t){return`issuerConfig:${t}`}async fetchConfig(o){let s;const a=n.appendToUrlPathname(o,t.WELL_KNOWN_OPENID_CONFIG),u=await window.fetch(a);try{s=function(t){const e={};return Object.keys(t).forEach((n=>{i[n]&&(e[i[n].toKey]=t[n])})),e}(await u.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}}),fi=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=ni(),n=(Zn(),Yn),i=si();async function r(t,e){const n=await e.get("tmp-resource-server-session-info"),r=JSON.parse(null!=n?n:"{}"),{webId:o}=r;if(void 0!==o){const t=new URL(o).origin;await e.clearResourceServerSessionInfo(t)}await Promise.all([e.deleteAllUserData(t,{secure:!1}),e.deleteAllUserData(t,{secure:!0}),e.delete("clientKey",{secure:!1})]),await i.clearOidcPersistentStorage()}t.getUnauthenticatedSession=function(){return{isLoggedIn:!1,sessionId: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,"idToken",{secure:!1}),u=await this.storageUtility.getForUser(t,"redirectUrl",{secure:!1}),c=await this.storageUtility.getForUser(t,"refreshToken",{secure:!0}),l=await this.storageUtility.getForUser(t,"issuer",{secure:!1}),h=null!==(n=await this.storageUtility.getForUser(t,"tokenType",{secure:!1}))&&void 0!==n?n:"DPoP";if(!e.isSupportedTokenType(h))throw new Error(`Tokens of type [${h}] are not supported.`);if(void 0!==o||void 0!==a||void 0!==i||void 0!==r||void 0!==c)return{sessionId:t,webId:r,isLoggedIn:"true"===i,redirectUrl:u,idToken:a,refreshToken:c,issuer:l,clientAppId:o,clientAppSecret:s,tokenType:h}}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")}}}}),pi=Kt({"node_modules/@inrupt/solid-client-authn-browser/dist/login/oidc/redirectHandler/FallbackRedirectHandler.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.FallbackRedirectHandler=void 0;var e=fi();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.toString()}`)}}async handle(t){return e.getUnauthenticatedSession()}}}}),vi=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)}}}}),gi=Kt({"node_modules/@inrupt/solid-client-authn-browser/dist/login/oidc/redirectHandler/AuthCodeRedirectHandler.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.AuthCodeRedirectHandler=t.DEFAULT_LIFESPAN=void 0;var e=ni(),n=si(),i=ai();t.DEFAULT_LIFESPAN=18e5,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.toString()}`)}}async handle(r,o){if(!await this.canHandle(r))throw new Error(`AuthCodeRedirectHandler cannot handle [${r}]: it is missing one of [code, state].`);const s=new URL(r),a=s.searchParams.get("state"),u=await this.storageUtility.getForUser(a,"sessionId",{errorIfNull:!0}),c="true"===await this.storageUtility.getForUser(u,"dpop"),l=await this.storageUtility.getForUser(u,"issuer",{errorIfNull:!0});window.localStorage.setItem(i.KEY_CURRENT_SESSION,u);const h=await this.issuerConfigFetcher.fetchConfig(l),d=await this.clientRegistrar.getClient({sessionId:u},h);let f;const p=Date.now();if(c){const t=await this.storageUtility.getForUser(u,"codeVerifier",{errorIfNull:!0}),e=await this.storageUtility.getForUser(u,"redirectUrl",{errorIfNull:!0});f=await n.getDpopToken(h,d,{grantType:"authorization_code",code:s.searchParams.get("code"),codeVerifier:t,redirectUrl:e})}else f=await n.getBearerToken(s.toString());let v;void 0!==f.refreshToken&&(v={sessionId:u,refreshToken:f.refreshToken,tokenRefresher:this.tokerRefresher});const g=await e.buildAuthenticatedFetch(fetch,f.accessToken,{dpopKey:f.dpopKey,refreshOptions:v,eventEmitter:o,expiresIn:f.expiresIn});await this.storageUtility.setForUser(u,{refreshToken:"<Refresh token that *is* coming back in the redirect URL is not yet being parsed and provided by oidc-client-js in it's response object>",webId:f.webId,isLoggedIn:"true"},{secure:!0}),s.searchParams.delete("code"),await this.storageUtility.setForUser(u,{redirectUrl:s.toString(),idToken:f.idToken},{secure:!1}),"false"===window.localStorage.getItem("tmp-resource-server-session-enabled")||await async function(e,n,i){const r=new URL(e).origin;await n(e);try{if(200===(await n(`${r}/session`)).status)return void await i.storeResourceServerSessionInfo(e,r,Date.now()+t.DEFAULT_LIFESPAN);await i.clearResourceServerSessionInfo(r)}catch(t){await i.clearResourceServerSessionInfo(r)}}(f.webId,g,this.storageUtility);const m=await this.sessionInfoManager.get(u);if(!m)throw new Error(`Could not retrieve session: [${u}].`);return Object.assign(m,{fetch:g,expirationDate:"number"==typeof f.expiresIn?p+1e3*f.expiresIn:null})}}}}),mi=Kt({"node_modules/@inrupt/solid-client-authn-browser/dist/login/oidc/redirectHandler/AggregateRedirectHandler.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=ni();t.default=class extends e.AggregateHandler{constructor(t){super(t)}}}}),wi=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)}}}}),bi=Kt({"node_modules/@inrupt/solid-client-authn-browser/dist/iframe.js"(t){var e;function n(){return void 0===e&&((e=window.document.createElement("iframe")).setAttribute("hidden","true"),e.setAttribute("sandbox","allow-scripts allow-same-origin")),e}Object.defineProperty(t,"__esModule",{value:!0}),t.postRedirectUrlToParent=t.setupIframeListener=t.redirectInIframe=void 0,t.redirectInIframe=function(t){const e=n();window.document.body.appendChild(e),e.src=t},t.setupIframeListener=function(t){"undefined"!=typeof window&&window.addEventListener("message",(async e=>{const i=n();e.origin===window.location.origin&&e.source===i.contentWindow&&"string"==typeof e.data.redirectUrl&&await t(e.data.redirectUrl),window.document.body.contains(i)&&window.document.body.removeChild(i)}))},t.postRedirectUrlToParent=function(t){window.top.postMessage({redirectUrl:t},window.location.origin)}}}),yi=Kt({"node_modules/@inrupt/solid-client-authn-browser/dist/login/oidc/Redirector.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=bi();t.default=class{redirect(t,n){n&&n.handleRedirect?n.handleRedirect(t):n&&n.redirectByReplacingState?window.history.replaceState({},"",t):(null==n?void 0:n.redirectInIframe)?e.redirectInIframe(t):window.location.href=t}}}}),xi=Kt({"node_modules/@inrupt/solid-client-authn-browser/dist/login/oidc/ClientRegistrar.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=si();t.default=class{constructor(t){this.storageUtility=t}async getClient(t,n){var i;const[r,o]=await Promise.all([this.storageUtility.getForUser(t.sessionId,"clientId",{secure:!1}),this.storageUtility.getForUser(t.sessionId,"clientSecret",{secure:!1})]);if(r)return{clientId:r,clientSecret:o,clientType:"dynamic"};const s={...t};s.registrationAccessToken=null!==(i=s.registrationAccessToken)&&void 0!==i?i:await this.storageUtility.getForUser(t.sessionId,"registrationAccessToken");try{const t=await e.registerClient(s,n),i={clientId:t.clientId};return t.clientSecret&&(i.clientSecret=t.clientSecret),t.idTokenSignedResponseAlg&&(i.idTokenSignedResponseAlg=t.idTokenSignedResponseAlg),await this.storageUtility.setForUser(s.sessionId,i,{secure:!1}),t}catch(t){throw new Error(`Client registration failed: [${t.toString()}]`)}}}}}),ki=Kt({"node_modules/@inrupt/solid-client-authn-browser/dist/login/oidc/redirectHandler/ErrorOidcHandler.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorOidcHandler=void 0;var e=ni(),n=fi();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.toString()}`)}}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 n.getUnauthenticatedSession()}}}}),Si=Kt({"node_modules/@inrupt/solid-client-authn-browser/dist/login/oidc/refresh/TokenRefresher.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=ni(),n=si();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 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 u=await n.refresh(i,s.issuerConfig,a,r);return void 0!==u.refreshToken&&(null==o||o.emit(e.EVENTS.NEW_REFRESH_TOKEN,u.refreshToken),await this.storageUtility.setForUser(t,{refreshToken:u.refreshToken})),u}}}}),Ei=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=ni(),i=e(ii()),r=e(ui()),o=e(ci()),s=e(li()),a=e(di()),u=pi(),c=e(vi()),l=fi(),h=gi(),d=e(mi()),f=e(wi()),p=e(yi()),v=e(xi()),g=ki(),m=e(Si());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),S=new l.SessionInfoManager(y),E=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,S,x,k,E),new u.FallbackRedirectHandler]);return new r.default(F,A,new c.default(S),S,x)}}}),Fi=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=Vt(),n=ni(),i=(Zn(),Yn),r=Ei(),o=ai(),s=bi();async function a(t,e,n={inIframe:!1},i){var r;const s=await e.validateCurrentSession();return null!==s&&(window.localStorage.setItem(o.KEY_CURRENT_URL,window.location.href),await e.login({sessionId:t,prompt:"none",oidcIssuer:s.issuer,redirectUrl:s.redirectUrl,clientId:s.clientAppId,clientSecret:s.clientAppSecret,tokenType:null!==(r=s.tokenType)&&void 0!==r?r:"DPoP",inIframe:n.inIframe},i),!0)}function u(t){return!!(null==t?void 0:t.isLoggedIn)}t.silentlyAuthenticate=a,t.Session=class extends e.EventEmitter{constructor(t={},e){super(),this.tokenRequestInProgress=!1,this.tmpFetchWithCookies=!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,credentials:this.tmpFetchWithCookies?"include":null==e?void 0:e.credentials}),this.logout=async()=>{await this.clientAuthentication.logout(this.info.sessionId),this.info.isLoggedIn=!1,this.tmpFetchWithCookies=!1,this.emit("logout")},this.handleIncomingRedirect=async(t={})=>{var e;if(this.info.isLoggedIn)return this.info;if(this.tokenRequestInProgress)return;const n="string"==typeof t?{url:t}:t,i=null!==(e=n.url)&&void 0!==e?e:window.location.href;if(null!==window.frameElement)return void s.postRedirectUrlToParent(i);!0!==n.useEssSession||!0===n.restorePreviousSession?window.localStorage.setItem("tmp-resource-server-session-enabled","false"):window.localStorage.setItem("tmp-resource-server-session-enabled","true");const r=window.localStorage.getItem("tmp-resource-server-session-info");if("string"==typeof r&&!0!==n.restorePreviousSession&&!0===n.useEssSession){let t=function(t){var e;const n=Object.keys(null!==(e=t.sessions)&&void 0!==e?e:{});return"string"==typeof t.webId&&n.length>0&&"number"==typeof t.sessions[n[0]].expiration};const e=JSON.parse(r);if(t(e)){const t=Object.keys(e.sessions),n=new URL(e.webId).hostname,i=t.find((t=>new URL(t).hostname===n));if(e.sessions[null!=i?i:t[0]].expiration-Date.now()>3e5)return this.info.isLoggedIn=!0,this.info.webId=e.webId,this.tmpFetchWithCookies=!0,this.info}}this.tokenRequestInProgress=!0;const c=await this.clientAuthentication.handleIncomingRedirect(i,this);if(u(c)){this.setSessionInfo(c);const t=window.localStorage.getItem(o.KEY_CURRENT_URL);null===t?this.emit("login"):(window.localStorage.removeItem(o.KEY_CURRENT_URL),this.emit("sessionRestore",t))}else if(!0===n.restorePreviousSession){const t=window.localStorage.getItem(o.KEY_CURRENT_SESSION);if(null!==t&&await a(t,this.clientAuthentication,void 0,this))return new Promise((()=>{}))}return this.tokenRequestInProgress=!1,c},this.clientAuthentication=t.clientAuthentication?t.clientAuthentication: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:i.v4(),isLoggedIn:!1},s.setupIframeListener((async t=>{const e=await this.clientAuthentication.handleIncomingRedirect(t,this);u(e)&&this.setSessionInfo(e)})),this.on("tokenRenewal",(()=>a(this.info.sessionId,this.clientAuthentication,{inIframe:!0},this)))}onLogin(t){this.on("login",t)}onLogout(t){this.on("logout",t)}onError(t){this.on(n.EVENTS.ERROR,t)}onSessionRestore(t){this.on("sessionRestore",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}))}}}}),Ai=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=Fi();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)}}),_i=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),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}: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=Fi();Object.defineProperty(t,"Session",{enumerable:!0,get:function(){return i.Session}});var r=Ei();Object.defineProperty(t,"getClientAuthenticationWithDependencies",{enumerable:!0,get:function(){return r.getClientAuthenticationWithDependencies}}),n(Ai(),t);var o=ni();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}})}}),Ci=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()]}}}}),ji=Kt({"node_modules/setimmediate/setImmediate.js"(t){!function(t){if(!t.setImmediate){var e,n,i,r,o,s=1,a={},u=!1,c=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)}):c&&"onreadystatechange"in c.createElement("script")?(n=c.documentElement,e=function(t){var e=c.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(u)setTimeout(d,0,t);else{var e=a[t];if(e){u=!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),u=!1}}}}}("undefined"==typeof self?void 0===kt?t:kt:self)}}),Ri=Kt({"node_modules/rdf-canonize/lib/MessageDigest-browser.js"(t,e){ji();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(`Unsupport 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}}}}),Ti=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}}}}),Ii=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",u={eoln:/(?:\r\n)|(?:\n)|(?:\r)/g};u.empty=new RegExp("^[ \\t]*$"),u.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=[],c={},h=t.split(u.eoln);let d=0;for(const t of h){if(d++,u.empty.test(t))continue;const h=t.match(u.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 c){let t=!0;const n=c[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 c[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 serializeQuad(t){const e=t.subject,s=t.object,a=t.graph;let u="";return u+=e.termType===r?`<${e.value}>`:`${e.value}`,u+=` <${t.predicate.value}> `,s.termType===r?u+=`<${s.value}>`:s.termType===o?u+=s.value:(u+=`"${function(t){return t.replace(c,(function(t){switch(t){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}}))}(s.value)}"`,s.datatype.value===n?s.language&&(u+=`@${s.language}`):s.datatype.value!==i&&(u+=`^^<${s.datatype.value}>`)),a.termType===r?u+=` <${a.value}>`:a.termType===o&&(u+=` ${a.value}`),u+=" .\n",u}static legacyDatasetToQuads(t){const e=[],u={"blank node":o,IRI:r,literal:s};for(const c in t)t[c].forEach((t=>{const l={};for(const e in t){const o=t[e],a={termType:u[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"===c?{termType:a,value:""}:{termType:c.startsWith("_:")?o:r,value:c},e.push(l)}));return e}};var c=/["\\\n\r]/g,l=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g}}),Oi=Kt({"node_modules/rdf-canonize/lib/URDNA2015.js"(t,e){var n=Ci(),i=Ri(),r=Ti(),o=Ii();function s(t,e){return t.hash<e.hash?-1:t.hash>e.hash?1:0}e.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new n("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}async main(t){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(),u=[];for(const t of a){const n=e.get(t);n.length>1?u.push(n):this.canonicalIssuer.getId(n[0])}for(const t of u){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 c=[];for(const t of this.quads){const e={...t};e.subject=this._useCanonicalId({component:e.subject}),e.object=this._useCanonicalId({component:e.object}),e.graph=this._useCanonicalId({component:e.graph}),c.push(o.serializeQuad(e))}return c.sort(),c.join("")}async hashFirstDegreeQuads(t){const e=[],n=this.blankNodeInfo.get(t),r=n.quads;for(const n of r){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 s=new i(this.hashAlgorithm);for(const t of e)s.update(t);return n.hash=await s.digest(),n.hash}async hashRelatedBlankNode(t,e,n,r){let o;o=this.canonicalIssuer.hasId(t)?this.canonicalIssuer.getId(t):n.hasId(t)?n.getId(t):this.blankNodeInfo.get(t).hash;const s=new i(this.hashAlgorithm);return s.update(r),"g"!==r&&s.update(this.getRelatedPredicate(e)),s.update(o),s.digest()}async hashNDegreeQuads(t,e){const n=new i(this.hashAlgorithm),o=await this.createHashToRelated(t,e),s=[...o.keys()].sort();for(const t of s){n.update(t);let i,s="";const a=new r(o.get(t));let u=0;for(;a.hasNext();){const t=a.next();++u%3==0&&await this._yield();let n=e.clone(),r="";const o=[];let c=!1;for(const e of t)if(this.canonicalIssuer.hasId(e)?r+=this.canonicalIssuer.getId(e):(n.hasId(e)||o.push(e),r+=n.getId(e)),0!==s.length&&r>s){c=!0;break}if(!c){for(const t of o){const e=await this.hashNDegreeQuads(t,n);if(r+=n.getId(t),r+=`<${e.hash}>`,n=e.issuer,0!==s.length&&r>s){c=!0;break}}c||(0===s.length||r<s)&&(s=r,i=n)}}n.update(s),e=i}return{hash:await n.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),u=o.get(a);u?u.push(s):o.set(a,[s])}_useCanonicalId({component: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)))}}}}),Ni=Kt({"node_modules/rdf-canonize/lib/URGNA2012.js"(t,e){var n=Oi();e.exports=class extends n{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="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),u=n.get(a);u?u.push(s):n.set(a,[s])}return n}}}}),Pi=Kt({"node_modules/rdf-canonize/lib/URDNA2015Sync.js"(t,e){var n=Ci(),i=Ri(),r=Ti(),o=Ii();function s(t,e){return t.hash<e.hash?-1:t.hash>e.hash?1:0}e.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new n("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(t){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 u=[];for(const t of this.quads){const e={...t};e.subject=this._useCanonicalId({component:e.subject}),e.object=this._useCanonicalId({component:e.object}),e.graph=this._useCanonicalId({component:e.graph}),u.push(o.serializeQuad(e))}return u.sort(),u.join("")}hashFirstDegreeQuads(t){const e=[],n=this.blankNodeInfo.get(t),r=n.quads;for(const n of r){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 s=new i(this.hashAlgorithm);for(const t of e)s.update(t);return n.hash=s.digest(),n.hash}hashRelatedBlankNode(t,e,n,r){let o;o=this.canonicalIssuer.hasId(t)?this.canonicalIssuer.getId(t):n.hasId(t)?n.getId(t):this.blankNodeInfo.get(t).hash;const s=new i(this.hashAlgorithm);return s.update(r),"g"!==r&&s.update(this.getRelatedPredicate(e)),s.update(o),s.digest()}hashNDegreeQuads(t,e){const n=new i(this.hashAlgorithm),o=this.createHashToRelated(t,e),s=[...o.keys()].sort();for(const t of s){n.update(t);let i,s="";const a=new r(o.get(t));for(;a.hasNext();){const t=a.next();let n=e.clone(),r="";const o=[];let u=!1;for(const e of t)if(this.canonicalIssuer.hasId(e)?r+=this.canonicalIssuer.getId(e):(n.hasId(e)||o.push(e),r+=n.getId(e)),0!==s.length&&r>s){u=!0;break}if(!u){for(const t of o){const e=this.hashNDegreeQuads(t,n);if(r+=n.getId(t),r+=`<${e.hash}>`,n=e.issuer,0!==s.length&&r>s){u=!0;break}}u||(0===s.length||r<s)&&(s=r,i=n)}}n.update(s),e=i}return{hash:n.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),u=o.get(a);u?u.push(s):o.set(a,[s])}_useCanonicalId({component:t}){return"BlankNode"!==t.termType||t.value.startsWith(this.canonicalIssuer.prefix)?t:{termType:"BlankNode",value:this.canonicalIssuer.getId(t.value)}}}}}),Di=Kt({"node_modules/rdf-canonize/lib/URGNA2012Sync.js"(t,e){var n=Pi();e.exports=class extends n{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="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}}}}),Mi=Kt({"(disabled):rdf-canonize-native"(){}}),Ui=Kt({"node_modules/rdf-canonize/lib/index.js"(t,e){var n,i=Oi(),r=Ni(),o=Pi(),s=Di();try{n=Mi()}catch(t){}var a={};e.exports=a,a.NQuads=Ii(),a.IdentifierIssuer=Ci(),a._rdfCanonizeNative=function(t){return t&&(n=t),n},a.canonize=async function(t,e){if(Array.isArray(t)||(t=a.NQuads.legacyDatasetToQuads(t)),e.useNative){if(!n)throw new Error("rdf-canonize-native not available");return new Promise(((i,r)=>n.canonize(t,e,((t,e)=>t?r(t):i(e)))))}if("URDNA2015"===e.algorithm)return new i(e).main(t);if("URGNA2012"===e.algorithm)return new r(e).main(t);if(!("algorithm"in e))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+e.algorithm)},a._canonizeSync=function(t,e){if(Array.isArray(t)||(t=a.NQuads.legacyDatasetToQuads(t)),e.useNative){if(n)return n.canonizeSync(t,e);throw new Error("rdf-canonize-native not available")}if("URDNA2015"===e.algorithm)return new o(e).main(t);if("URGNA2012"===e.algorithm)return new s(e).main(t);if(!("algorithm"in e))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+e.algorithm)}}}),Li=Kt({"node_modules/rdf-canonize/index.js"(t,e){e.exports=Ui()}}),Bi=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}}),$i=Kt({"node_modules/jsonld/lib/graphTypes.js"(t,e){var n=Bi(),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))}}),Hi=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}}}}),Ji=Kt({"node_modules/jsonld/lib/util.js"(t,e){var n=$i(),i=Bi(),r=Li().IdentifierIssuer,o=Hi(),s=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,a=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,u=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,c="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 "'+c+'" is supported.');return Object.assign({Accept:c},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=u.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}}),zi=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"}}}),Ki=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]}}}}}),Wi=Kt({"node_modules/jsonld/lib/url.js"(t,e){var n=Bi(),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("/"),u=o.fragment||o.query?0:1;for(;s.length>0&&a.length>u&&s[0]===a[0];)s.shift(),a.shift();let c="";if(s.length>0){s.pop();for(let t=0;t<s.length;++t)c+="../"}return c+=a.join("/"),null!==o.query&&(c+="?"+o.query),null!==o.fragment&&(c+="#"+o.fragment),""===c&&(c="./"),c},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)}}),qi=Kt({"node_modules/jsonld/lib/documentLoaders/xhr.js"(t,e){var{parseLinkHeader:n,buildHeaders:i}=Ji(),{LINK_HEADER_CONTEXT:r}=zi(),o=Hi(),s=Ki(),{prependBase:a}=Wi(),u=/(^|(\r\n))link:/i;e.exports=({secure:t,headers:e={},xhr:c}={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()}))}(c,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(u.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})))}}),Vi=Kt({"node_modules/jsonld/lib/platform-browser.js"(t,e){var n=qi(),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})}}}),Gi=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}}}}),Xi=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,u,c,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++)u=n[i],void 0,null===(c=(a=r)===(s=this).head?new o(u,null,a,s):new o(u,a,a.next,s)).next&&(s.tail=c),null===c.prev&&(s.head=c),s.length++,r=c;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{Gi()(n)}catch(t){}}}),Yi=Kt({"node_modules/lru-cache/index.js"(t,e){var n=Xi(),i=Symbol("max"),r=Symbol("length"),o=Symbol("lengthCalculator"),s=Symbol("allowStale"),a=Symbol("maxAge"),u=Symbol("dispose"),c=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[u]&&t[u](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[u]=t.dispose,this[c]=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[u]&&this[l]&&this[l].length&&this[l].forEach((t=>this[u](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[u]&&(this[c]||this[u](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[u]&&this[u](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)))}}}}),Zi=Kt({"node_modules/jsonld/lib/ResolvedContext.js"(t,e){var n=Yi();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)}}}}),Qi=Kt({"node_modules/jsonld/lib/ContextResolver.js"(t,e){var{isArray:n,isObject:i,isString:r}=Bi(),{asArray:o}=Ji(),{prependBase:s}=Wi(),a=Hi(),u=Zi();function c(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 u({document:null}));continue}i(o)||c(e);const d=JSON.stringify(o);let f=this._get(d);f||(f=new u({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 u=await this.resolve({activeCtx:t,context:o,documentLoader:n,base:i,cycles:r});return this._cacheResolvedContext({key:e,resolved:u,tag:a.tag}),u}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 u,c;s.add(e);try{c=await o(e),u=c.document||null,r(u)&&(u=JSON.parse(u))}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(u))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 u="@context"in u?{"@context":u["@context"]}:{"@context":{}},c.contextUrl&&(n(u["@context"])||(u["@context"]=[u["@context"]]),u["@context"].push(c.contextUrl)),{context:u,remoteDoc:c}}}}}),tr=Kt({"node_modules/jsonld/lib/NQuads.js"(t,e){e.exports=Li().NQuads}}),er=Kt({"node_modules/jsonld/lib/context.js"(t,e){var n=Ji(),i=Hi(),{isArray:r,isObject:o,isString:s,isUndefined:a}=Bi(),{isAbsolute:u,isRelative:c,prependBase:l}=Wi(),{asArray:h,compareShortestLeast:d}=Ji(),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 c=e.indexOf(":");if(c>0){const n=e.substr(0,c),o=e.substr(c+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(u(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||u(t));else{if(!c(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(!u(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:c,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,c);if(!u(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,c),!u(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),c)!==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:c}),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,c),!u(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 u=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<=(u?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&=!(u&&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=c&&c.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"],u=t.mappings,c=[...u.keys()].sort(d);for(const t of c){const o=u.get(t);if(null===o)continue;let c=o["@container"]||"@none";if(c=[].concat(c).sort().join(""),null===o["@id"])continue;const l=h(o["@id"]);for(const u of l){let l=e[u];const h=v.isKeyword(u);if(l)h||o._termHasColon||i[u].push(t);else if(e[u]=l={},!h&&!o._termHasColon){i[u]=[t];const e={iri:u,terms:i[u]};u[0]in n?n[u[0]].push(e):n[u[0]]=[e]}if(l[c]||(l[c]={"@language":{},"@type":{},"@any":{}}),l=l[c],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}}}),nr=Kt({"node_modules/jsonld/lib/expand.js"(t,e){var n=Hi(),{isArray:i,isObject:r,isEmptyObject:o,isString:s,isUndefined:a}=Bi(),{isList:u,isValue:c,isGraph:l,isSubject:h}=$i(),{expandIri:d,getContextValue:f,isKeyword:p,process:v,processingMode:g}=er(),{isAbsolute:m}=Wi(),{addValue:w,asArray:b,getValues:y,validateTypeValue:x}=Ji(),k={};e.exports=k;var S=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/;async function E({activeCtx:t,activeProperty:e,expandedActiveProperty:l,element:y,expandedParent:F,options:C={},insideList:j,typeKey:R,typeScopedContext:T,expansionMap:I}){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},C);for(const E of O){let R,O=y[E];if("@context"===E)continue;let M=d(t,E,{vocab:!0},C);if((null===M||!m(M)&&!p(M))&&(M=I({unmappedProperty:E,activeCtx:t,activeProperty:e,parent:y,options:C,insideList:j,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(!C.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},C):e)),{propertyIsArray:C.isFrame});continue}if("@type"===M){r(O)&&(O=Object.fromEntries(Object.entries(O).map((([t,e])=>[d(T,t,{vocab:!0}),b(e).map((t=>d(T,t,{base:!0,vocab:!0})))])))),x(O,C.isFrame),w(F,"@type",b(O).map((t=>s(t)?d(T,t,{base:!0,vocab:!0},C):t)),{propertyIsArray:C.isFrame});continue}if("@included"===M&&g(t,1.1)){const i=b(await k.expand({activeCtx:t,activeProperty:e,element:O,options:C,expansionMap:I}));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:C.isFrame});continue}if("@language"===M){if(null===O)continue;if(!s(O)&&!C.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(S)&&console.warn(`@language must be valid BCP47: ${t}`);w(F,"@language",O,{propertyIsArray:C.isFrame});continue}if("@direction"===M){if(!s(O)&&!C.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:C.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:C,expansionMap:I}),"@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(c(o)||u(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(E);continue}let U=t;const L=f(t,E,"@context");a(L)||(U=await v({activeCtx:t,localCtx:L,propagate:!0,overrideProtected:!0,options:C}));const B=f(U,E,"@container")||[];if(B.includes("@language")&&r(O))R=A(U,O,f(U,E,"@direction"),C);else if(B.includes("@index")&&r(O)){const e=B.includes("@graph"),n=f(U,E,"@index")||"@index",i="@index"!==n&&d(t,n,{vocab:!0},C);R=await _({activeCtx:U,options:C,activeProperty:E,value:O,expansionMap:I,asGraph:e,indexKey:n,propertyIndex:i})}else if(B.includes("@id")&&r(O)){const t=B.includes("@graph");R=await _({activeCtx:U,options:C,activeProperty:E,value:O,expansionMap:I,asGraph:t,indexKey:"@id"})}else if(B.includes("@type")&&r(O))R=await _({activeCtx:U.revertToPreviousContext(),options:C,activeProperty:E,value:O,expansionMap:I,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:C,insideList:n,expansionMap:I})}else R="@json"===f(t,E,"@type")?{"@type":"@json","@value":O}:await k.expand({activeCtx:U,activeProperty:E,element:O,options:C,insideList:!1,expansionMap:I})}if(null!==R||"@value"===M||(R=I({unmappedValue:O,expandedProperty:M,activeCtx:U,activeProperty:e,parent:y,options:C,insideList:j,key:E,expandedParent:F}),void 0!==R))if("@list"!==M&&!u(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(E)&&U.mappings.get(E).reverse){const t=F["@reverse"]=F["@reverse"]||{};R=b(R);for(let e=0;e<R.length;++e){const i=R[e];if(c(i)||u(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))&&!C.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},C))))throw new n("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:i});await E({activeCtx:t,activeProperty:e,expandedActiveProperty:l,element:i,expandedParent:F,options:C,insideList:j,typeScopedContext:T,typeKey:R,expansionMap:I})}}}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=[],u=Object.keys(e).sort();for(const c of u){const u=d(t,c,{vocab:!0},o);let l=e[c];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"!==u&&(i["@language"]=c.toLowerCase()),r&&(i["@direction"]=r),a.push(i)}}return a}async function _({activeCtx:t,options:e,activeProperty:r,value:o,expansionMap:s,asGraph:u,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(u&&!l(t)&&(t={"@graph":[t]}),"@type"===h)"@none"===m||(t["@type"]=t["@type"]?[y].concat(t["@type"]):[y]);else{if(c(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:u,options:c={},insideList:l=!1,insideIndex:h=!1,typeScopedContext:p=null,expansionMap:w=(()=>{})})=>{if(null==u)return null;if("@default"===e&&(c=Object.assign({},c,{isFrame:!1})),!i(u)&&!r(u)){if(!l&&(null===e||"@graph"===d(t,e,{vocab:!0},c))){const n=await w({unmappedValue:u,activeCtx:t,activeProperty:e,options:c,insideList:l});return void 0===n?null:n}return F({activeCtx:t,activeProperty:e,value:u,options:c})}if(i(u)){let n=[];const r=f(t,e,"@container")||[];l=l||r.includes("@list");for(let r=0;r<u.length;++r){let o=await k.expand({activeCtx:t,activeProperty:e,element:u[r],options:c,expansionMap:w,insideIndex:h,typeScopedContext:p});l&&i(o)&&(o={"@list":o}),null===o&&(o=await w({unmappedValue:u[r],activeCtx:t,activeProperty:e,parent:u,index:r,options:c,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},c),S=f(t,e,"@context");p=p||(t.previousContext?t:null);let A=Object.keys(u).sort(),_=!h;if(_&&p&&A.length<=2&&!A.includes("@context"))for(const e of A){const n=d(p,e,{vocab:!0},c);if("@value"===n){_=!1,t=p;break}if("@id"===n&&1===A.length){_=!1;break}}_&&(t=t.revertToPreviousContext()),a(S)||(t=await v({activeCtx:t,localCtx:S,propagate:!0,overrideProtected:!0,options:c})),"@context"in u&&(t=await v({activeCtx:t,localCtx:u["@context"],options:c})),p=t;let C=null;for(const e of A)if("@type"===d(t,e,{vocab:!0},c)){C=C||e;const n=u[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:c,propagate:!1}))}}let j={};await E({activeCtx:t,activeProperty:e,expandedActiveProperty:x,element:u,expandedParent:j,options:c,insideList:l,typeKey:C,typeScopedContext:p,expansionMap:w}),A=Object.keys(j);let R=A.length;if("@value"in j){if("@type"in j&&("@language"in j||"@direction"in j))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:j});let i=R-1;if("@type"in j&&(i-=1),"@index"in j&&(i-=1),"@language"in j&&(i-=1),"@direction"in j&&(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:j});const r=null===j["@value"]?[]:b(j["@value"]),a=y(j,"@type");if(g(t,1.1)&&a.includes("@json")&&1===a.length);else if(0===r.length){const n=await w({unmappedValue:j,activeCtx:t,activeProperty:e,element:u,options:c,insideList:l});j=void 0!==n?n:null}else{if(!r.every((t=>s(t)||o(t)))&&"@language"in j)throw new n("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:j});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:j})}}else if("@type"in j&&!i(j["@type"]))j["@type"]=[j["@type"]];else if("@set"in j||"@list"in j){if(R>1&&(2!==R||!("@index"in j)))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:j});"@set"in j&&(j=j["@set"],A=Object.keys(j),R=A.length)}else if(1===R&&"@language"in j){const n=await w(j,{unmappedValue:j,activeCtx:t,activeProperty:e,element:u,options:c,insideList:l});j=void 0!==n?n:null}if(r(j)&&!c.keepFreeFloatingNodes&&!l&&(null===e||"@graph"===x)&&(0===R||"@value"in j||"@list"in j||1===R&&"@id"in j)){const n=await w({unmappedValue:j,activeCtx:t,activeProperty:e,element:u,options:c,insideList:l});j=void 0!==n?n:null}return j}}}),ir=Kt({"node_modules/jsonld/lib/nodeMap.js"(t,e){var{isKeyword:n}=er(),i=$i(),r=Bi(),o=Ji(),s=Hi(),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,u,c,l,h)=>{if(r.isArray(t)){for(const n of t)a.createNodeMap(n,e,u,c,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=c.getId(e))}return void(h&&h.push(t))}if(h&&i.isList(t)){const n=[];return a.createNodeMap(t["@list"],e,u,c,l,n),void h.push({"@list":n})}if("@type"in t){const e=t["@type"];for(const t of e)0===t.indexOf("_:")&&c.getId(t)}r.isUndefined(l)&&(l=i.isBlankNode(t)?c.getId(t["@id"]):t["@id"]),h&&h.push({"@id":l});const d=e[u],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=c.getId(s)),a.createNodeMap(r,e,u,c,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,c);continue}if("@included"===r){a.createNodeMap(t[r],e,u,c);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=c.getId(r)),0!==h.length)for(let t of h)if("@type"===r&&(t=0===t.indexOf("_:")?c.getId(t):t),i.isSubject(t)||i.isSubjectReference(t)){if("@id"in t&&!t["@id"])continue;const n=i.isBlankNode(t)?c.getId(t["@id"]):t["@id"];o.addValue(f,r,{"@id":n},{propertyIsArray:!0,allowDuplicate:!1}),a.createNodeMap(t,e,u,c,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,u,c,l,n),t={"@list":n},o.addValue(f,r,t,{propertyIsArray:!0,allowDuplicate:!1})}else a.createNodeMap(t,e,u,c,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}}}),rr=Kt({"node_modules/jsonld/lib/flatten.js"(t,e){var{isSubjectReference:n}=$i(),{createMergedNodeMap:i}=ir(),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}}}),or=Kt({"node_modules/jsonld/lib/fromRdf.js"(t,e){var n=Hi(),i=$i(),r=Bi(),o=Ji(),{RDF_LIST:s,RDF_FIRST:a,RDF_REST:u,RDF_NIL:c,RDF_TYPE:l,RDF_JSON_LITERAL:h,XSD_BOOLEAN:d,XSD_DOUBLE:f,XSD_INTEGER:p,XSD_STRING:v}=zi(),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,u=i.object;s in r||(r[s]={"@id":s});const v=r[s],g=u.termType.endsWith("Node");if(g&&!(u.value in r)&&(r[u.value]={"@id":u.value}),a===l&&!e&&g){o.addValue(v,"@type",u.value,{propertyIsArray:!0});continue}const m=w(u,n,h);if(o.addValue(v,a,m,{propertyIsArray:!0}),g)if(u.value===c){const t=r[u.value];"usages"in t||(t.usages=[]),t.usages.push({node:v,property:a,value:m})}else p[u.value]=!(u.value in p)&&{node:v,property:a,value:m}}for(const t in f){const e=f[t];if(!(c in e))continue;const n=e[c];if(n.usages){for(let t of n.usages){let n=t.node,o=t.property,c=t.value;const l=[],h=[];let d=Object.keys(n).length;for(;o===u&&r.isObject(p[n["@id"]])&&r.isArray(n[a])&&1===n[a].length&&r.isArray(n[u])&&1===n[u].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,c=t.value,d=Object.keys(n).length,i.isBlankNode(n)););delete c["@id"],c["@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}}}),sr=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])),"")+"}"}}}),ar=Kt({"node_modules/jsonld/lib/toRdf.js"(t,e){var{createNodeMap:n}=ir(),{isKeyword:i}=er(),r=$i(),o=sr(),s=Bi(),a=Ji(),{RDF_FIRST:u,RDF_REST:c,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}=zi(),{isAbsolute:w}=Wi(),b={};function y(t,e,n,r,o){const s=Object.keys(e).sort();for(const a of s){const s=e[a],u=Object.keys(s).sort();for(let e of u){const u=s[e];if("@type"===e)e=h;else if(i(e))continue;for(const i of u){const s={termType:a.startsWith("_:")?"BlankNode":"NamedNode",value:a};if(!w(a))continue;const u={termType:e.startsWith("_:")?"BlankNode":"NamedNode",value:e};if(!w(e))continue;if("BlankNode"===u.termType&&!o.produceGeneralizedRdf)continue;const c=x(i,r,t,n,o.rdfDirection);c&&t.push({subject:s,predicate:u,object:c,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:u},s={termType:"NamedNode",value:c},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),u={termType:"BlankNode",value:e.getId()};n.push({subject:f,predicate:o,object:t,graph:i}),n.push({subject:f,predicate:s,object:u,graph:i}),f=u}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}}}),ur=Kt({"node_modules/jsonld/lib/frame.js"(t,e){var{isKeyword:n}=er(),i=$i(),r=Bi(),o=Ji(),s=Wi(),a=Hi(),{createNodeMap:u,mergeNodeMapGraphs:c}=ir(),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 u=!0,c=!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(u=!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),u=!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;c=c||h}return u||c}function g(t,e){const n=t.uniqueEmbeds[t.graph],i=n[e],s=i.parent,a=i.property,u={"@id":e};if(r.isArray(s)){for(let t=0;t<s.length;++t)if(o.compareValues(s[t],u)){s[t]=u;break}}else{const t=r.isArray(s[a]);o.removeValue(s,a,u,{propertyIsArray:t}),o.addValue(s,a,u,{propertyIsArray:t})}const c=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],c(i))};c(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"]]:[],u=t["@language"]?r.isArray(t["@language"])?t["@language"]:[t["@language"]]:[];return 0===s.length&&0===a.length&&0===u.length||!(!s.includes(n)&&!r.isEmptyObject(s[0]))&&!!(!i&&0===a.length||a.includes(i)||i&&r.isEmptyObject(a[0]))&&!!(!o&&0===u.length||u.includes(o)||o&&r.isEmptyObject(u[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");u(t,i.graphMap,"@default",r),n.merged&&(i.graphMap["@merged"]=c(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,u,c=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),S=Object.keys(k).sort();for(const p of S){const v=k[p];if(null===c?t.uniqueEmbeds={[t.graph]:{}}:t.uniqueEmbeds[t.graph]=t.uniqueEmbeds[t.graph]||{},"@link"===b.embed&&p in x){w(u,c,x[p]);continue}const S={"@id":p};if(0===p.indexOf("_:")&&o.addValue(t.bnodeMap,p,S,{propertyIsArray:!0}),x[p]=S,("@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:u,property:c},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],S,"@graph")}"@included"in s&&l.frame({...t,embedded:!1},e,s["@included"],S,"@included");for(const e of Object.keys(v).sort())if(n(e)){if(S[e]=o.clone(v[e]),"@type"===e)for(const e of v["@type"])0===e.indexOf("_:")&&o.addValue(t.bnodeMap,e,S,{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(S,e,a);const u=n["@list"];for(const e of u)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,S,e):y(r[0],n)&&w(S,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 S)){let n="@null";"@default"in e&&(n=o.clone(e["@default"])),r.isArray(n)||(n=[n]),S[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))&&(S["@reverse"]=S["@reverse"]||{},o.addValue(S["@reverse"],e,[],{propertyIsArray:!0}),l.frame({...t,embedded:!0},[i],n,S["@reverse"][e],c))}w(u,c,S),t.subjectStack.pop()}else w(u,c,S);else w(u,c,S)}},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}}}),cr=Kt({"node_modules/jsonld/lib/compact.js"(t,e){var n=Hi(),{isArray:i,isObject:r,isString:o,isUndefined:s}=Bi(),{isList:a,isValue:u,isGraph:c,isSimpleGraph:l,isSubjectReference:h}=$i(),{expandIri:d,getContextValue:f,isKeyword:p,process:v,processingMode:g}=er(),{removeBase:m,prependBase:w}=Wi(),{addValue:b,asArray:y,compareShortestLeast:x}=Ji(),k={};function S(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(u(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,E={},F=t;u(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:E}));let _=d["@type"]||[];_.length>1&&(_=Array.from(_).sort());const C=t;for(const e of _){const n=k.compactIri({activeCtx:C,iri:e,relativeTo:{vocab:!0}}),i=f(F,n,"@context");s(i)||(t=await v({activeCtx:t,localCtx:i,options:m,propagate:!1}))}const j=Object.keys(d).sort();for(const s of j){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(E,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=E;n&&(S(t,n,m),r(E[n])||(E[n]={}),i=E[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=E;h&&(S(t,h,m),r(E[h])||(E[h]={}),d=E[h]);const p=f(t,n,"@container")||[],v=c(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"))u(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(E,n,h)}else{const n=await k.compact({activeCtx:t,activeProperty:e,element:h,options:m,compactionMap:w});i(n)&&0===n.length||b(E,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(E,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(E,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(E,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]),E[k.compactIri({activeCtx:t,iri:"@id",relativeTo:{vocab:!0}})]=e}}return E}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]),c(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)&&!u(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(u(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&&u(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(u(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"),u(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 u=t.inverse[e];for(const t of i){if(!(t in u))continue;const e=u[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(u(n)){const i=f(t,e,"@type"),r=f(t,e,"@language"),s=f(t,e,"@direction"),a=f(t,e,"@container")||[],u="@index"in n&&!a.includes("@index");if(!u&&"@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 c=Object.keys(n).length,l=1===c||2===c&&"@index"in n&&!u,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 u&&(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}}}}),lr=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}}}),hr=Kt({"node_modules/jsonld/lib/jsonld.js"(t,e){var n=Li(),i=Vi(),r=Ji(),o=Qi(),s=r.IdentifierIssuer,a=Hi(),u=Yi(),c=tr(),{expand:l}=nr(),{flatten:h}=rr(),{fromRDF:d}=or(),{toRDF:f}=ar(),{frameMergedOrDefault:p,cleanupNull:v}=ur(),{isArray:g,isObject:m,isString:w}=Bi(),{isSubjectReference:b}=$i(),{expandIri:y,getInitialContext:x,process:k,processingMode:S}=er(),{compact:E,compactIri:F}=cr(),{createNodeMap:A,createMergedNodeMap:_,mergeNodeMaps:C}=ir(),j=function(t){const e={},j=new u({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 u;(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:j})})).link&&(i.skipExpansion=!0),i.compactToRelative||delete i.base,u=i.skipExpansion?e:await t.expand(e,i);const c=await t.processContext(x(i),n,i);let l=await E({activeCtx:c,element:u,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:c,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:j})})).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 u=x(n);for(const t of s)u=await k({activeCtx:u,localCtx:t,options:n});let c=await l({activeCtx:u,element:i.input,options:n,expansionMap:n.expansionMap});return m(c)&&"@graph"in c&&1===Object.keys(c).length?c=c["@graph"]:null===c&&(c=[]),g(c)||(c=[c]),c},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:j})});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:j})}),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=S(s,1.1)),i.hasOwnProperty("pruneBlankNodeIdentifiers")||(i.pruneBlankNodeIdentifiers=S(s,1.1));const a=await t.expand(e,i),u={...i};u.isFrame=!0,u.keepFreeFloatingNodes=!0;const c=await t.expand(n,u),l=Object.keys(n).map((t=>y(s,t,{vocab:!0})));u.merged=!l.includes("@graph"),u.is11=S(s,1.1);const h=p(a,c,u);u.graph=!i.omitGraph,u.skipExpansion=!0,u.link={},u.framing=!0;let d=await t.compact(h,r,u);return u.link={},d=v(d,u),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:j})}))){if("application/n-quads"!==i.inputFormat&&"application/nquads"!==i.inputFormat)throw new a("Unknown canonicalization input format.","jsonld.CanonizeError");const t=c.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:j})})).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 c.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:j})});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:j})});const a=await Promise.all(e.map((e=>{const n={...i};return t.expand(e,n)})));let u=!0;"mergeNodes"in i&&(u=i.mergeNodes);const c=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=u||0===t?l:{"@default":{}};if(A(e,n,"@default",c),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=C(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:j})}),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=er().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",c.parse),t.registerRDFParser("application/nquads",c.parse),t.url=Wi(),t.util=r,Object.assign(t,r),t.promises=t,t.RequestQueue=Ki(),t.JsonLdProcessor=lr()(t),i.setupGlobals(t),i.setupDocumentLoaders(t),t},R=function(){return j((function(){return R()}))};j(R),e.exports=R}}),dr=Kt({"node_modules/queue-microtask/index.js"(t,e){var n;e.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:kt):t=>(n||(n=Promise.resolve())).then(t).catch((t=>setTimeout((()=>{throw t}),0)))}}),fr=Kt({"node_modules/regenerator-runtime/runtime.js"(t,e){var n=function(t){var e,n=Object.prototype,i=n.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",s=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function c(t,e,n,i){var r=Object.create((e&&e.prototype instanceof g?e:g).prototype),o=new C(i||[]);return r._invoke=function(t,e,n){var i=h;return function(r,o){if(i===f)throw new Error("Generator is already running");if(i===p){if("throw"===r)throw o;return R()}for(n.method=r,n.arg=o;;){var s=n.delegate;if(s){var a=F(s,n);if(a){if(a===v)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=f;var u=l(t,e,n);if("normal"===u.type){if(i=n.done?p:d,u.arg===v)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i=p,n.method="throw",n.arg=u.arg)}}}(t,n,o),r}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var h="suspendedStart",d="suspendedYield",f="executing",p="completed",v={};function g(){}function m(){}function w(){}var b={};u(b,o,(function(){return this}));var y=Object.getPrototypeOf,x=y&&y(y(j([])));x&&x!==n&&i.call(x,o)&&(b=x);var k=w.prototype=g.prototype=Object.create(b);function S(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function n(r,o,s,a){var u=l(t[r],t,o);if("throw"!==u.type){var c=u.arg,h=c.value;return h&&"object"==typeof h&&i.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,s,a)}),(function(t){n("throw",t,s,a)})):e.resolve(h).then((function(t){c.value=t,s(c)}),(function(t){return n("throw",t,s,a)}))}a(u.arg)}var r;this._invoke=function(t,i){function o(){return new e((function(e,r){n(t,i,e,r)}))}return r=r?r.then(o,o):o()}}function F(t,n){var i=t.iterator[n.method];if(i===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,F(t,n),"throw"===n.method))return v;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var r=l(i,t.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,v;var o=r.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function A(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 _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function j(t){if(t){var n=t[o];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,s=function n(){for(;++r<t.length;)if(i.call(t,r))return n.value=t[r],n.done=!1,n;return n.value=e,n.done=!0,n};return s.next=s}}return{next:R}}function R(){return{value:e,done:!0}}return m.prototype=w,u(k,"constructor",w),u(w,"constructor",m),m.displayName=u(w,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,u(t,a,"GeneratorFunction")),t.prototype=Object.create(k),t},t.awrap=function(t){return{__await:t}},S(E.prototype),u(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,n,i,r,o){void 0===o&&(o=Promise);var s=new E(c(e,n,i,r),o);return t.isGeneratorFunction(n)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},S(k),u(k,a,"Generator"),u(k,o,(function(){return this})),u(k,"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=j,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(_),!t)for(var n in this)"t"===n.charAt(0)&&i.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},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 n=this;function r(i,r){return a.type="throw",a.arg=t,n.next=i,r&&(n.method="next",n.arg=e),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return r("end");if(s.tryLoc<=this.prev){var u=i.call(s,"catchLoc"),c=i.call(s,"finallyLoc");if(u&&c){if(this.prev<s.catchLoc)return r(s.catchLoc,!0);if(this.prev<s.finallyLoc)return r(s.finallyLoc)}else if(u){if(this.prev<s.catchLoc)return r(s.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return r(s.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=t,s.arg=e,o?(this.method="next",this.next=o.finallyLoc,v):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),v},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),_(n),v}},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;_(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,i){return this.delegate={iterator:j(t),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=e),v}},t}("object"==typeof e?e.exports:{});try{regeneratorRuntime=n}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}}),pr=Kt({"node_modules/@babel/runtime/regenerator/index.js"(t,e){e.exports=fr()}}),vr=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.freeze=e,t.MIME_TYPE=n,t.NAMESPACE=i}}),gr=Kt({"node_modules/@xmldom/xmldom/lib/dom.js"(t){var e=vr().NAMESPACE;function n(t){return""!==t}function i(t,e){return t.hasOwnProperty(e)||(t[e]=!0),t}function r(t){if(!t)return[];var e=function(t){return t?t.split(/[\t\n\f\r ]+/).filter(n):[]}(t);return Object.keys(e.reduce(i,{}))}function o(t,e){for(var n in t)e[n]=t[n]}function s(t,e){var n=t.prototype;if(!(n instanceof e)){let i=function(){};i.prototype=e.prototype,i=new i,o(n,i),t.prototype=n=i}n.constructor!=t&&("function"!=typeof t&&console.error("unknown Class:"+t),n.constructor=t)}var a={},u=a.ELEMENT_NODE=1,c=a.ATTRIBUTE_NODE=2,l=a.TEXT_NODE=3,h=a.CDATA_SECTION_NODE=4,d=a.ENTITY_REFERENCE_NODE=5,f=a.ENTITY_NODE=6,p=a.PROCESSING_INSTRUCTION_NODE=7,v=a.COMMENT_NODE=8,g=a.DOCUMENT_NODE=9,m=a.DOCUMENT_TYPE_NODE=10,w=a.DOCUMENT_FRAGMENT_NODE=11,b=a.NOTATION_NODE=12,y={},x={};y.INDEX_SIZE_ERR=(x[1]="Index size error",1),y.DOMSTRING_SIZE_ERR=(x[2]="DOMString size error",2);var k=y.HIERARCHY_REQUEST_ERR=(x[3]="Hierarchy request error",3);y.WRONG_DOCUMENT_ERR=(x[4]="Wrong document",4),y.INVALID_CHARACTER_ERR=(x[5]="Invalid character",5),y.NO_DATA_ALLOWED_ERR=(x[6]="No data allowed",6),y.NO_MODIFICATION_ALLOWED_ERR=(x[7]="No modification allowed",7);var S=y.NOT_FOUND_ERR=(x[8]="Not found",8);y.NOT_SUPPORTED_ERR=(x[9]="Not supported",9);var E=y.INUSE_ATTRIBUTE_ERR=(x[10]="Attribute in use",10);function F(t,e){if(e instanceof Error)var n=e;else n=this,Error.call(this,x[t]),this.message=x[t],Error.captureStackTrace&&Error.captureStackTrace(this,F);return n.code=t,e&&(this.message=this.message+": "+e),n}function A(){}function _(t,e){this._node=t,this._refresh=e,C(this)}function C(t){var e=t._node._inc||t._node.ownerDocument._inc;if(t._inc!=e){var n=t._refresh(t._node);at(t,"length",n.length),o(n,t),t._inc=e}}function j(){}function R(t,e){for(var n=t.length;n--;)if(t[n]===e)return n}function T(t,n,i,r){if(r?n[R(n,r)]=i:n[n.length++]=i,t){i.ownerElement=t;var o=t.ownerDocument;o&&(r&&U(o,t,r),function(t,n,i){t&&t._inc++,i.namespaceURI===e.XMLNS&&(n._nsMap[i.prefix?i.localName:""]=i.value)}(o,t,i))}}function I(t,e,n){var i=R(e,n);if(!(i>=0))throw F(S,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&&(U(o,t,n),n.ownerElement=null)}}function O(){}function N(){}function P(t){return("<"==t?"<":">"==t&&">")||"&"==t&&"&"||'"'==t&&"""||"&#"+t.charCodeAt()+";"}function D(t,e){if(e(t))return!0;if(t=t.firstChild)do{if(D(t,e))return!0}while(t=t.nextSibling)}function M(){}function U(t,n,i){t&&t._inc++,i.namespaceURI===e.XMLNS&&delete n._nsMap[i.prefix?i.localName:""]}function L(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 B(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,L(t.ownerDocument,t),e}function $(t,e,n){var i=e.parentNode;if(i&&i.removeChild(e),e.nodeType===w){var r=e.firstChild;if(null==r)return e;var o=e.lastChild}else r=o=e;var s=n?n.previousSibling:t.lastChild;r.previousSibling=s,o.nextSibling=n,s?s.nextSibling=r:t.firstChild=r,null==n?t.lastChild=o:n.previousSibling=o;do{r.parentNode=t}while(r!==o&&(r=r.nextSibling));return L(t.ownerDocument||t,t),e.nodeType==w&&(e.firstChild=e.lastChild=null),e}function H(){this._nsMap={}}function J(){}function z(){}function K(){}function W(){}function q(){}function V(){}function G(){}function X(){}function Y(){}function Z(){}function Q(){}function tt(){}function et(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 rt(this,n,t,e,s),n.join("")}function nt(t,n,i){var r=t.prefix||"",o=t.namespaceURI;if(!o)return!1;if("xml"===r&&o===e.XML||o===e.XMLNS)return!1;for(var s=i.length;s--;){var a=i[s];if(a.prefix===r)return a.namespace!==o}return!0}function it(t,e,n){t.push(" ",e,'="',n.replace(/[<&"\t\n\r]/g,P),'"')}function rt(t,n,i,r,o){if(o||(o=[]),r){if(!(t=r(t)))return;if("string"==typeof t)return void n.push(t)}switch(t.nodeType){case u:var s=t.attributes,a=s.length,f=t.firstChild,b=t.tagName,y=b;if(!(i=e.isHTML(t.namespaceURI)||i)&&!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 S=o.length-1;S>=0;S--)if(""===(E=o[S]).prefix&&E.namespace===t.namespaceURI){x=E.namespace;break}if(x!==t.namespaceURI)for(S=o.length-1;S>=0;S--){var E;if((E=o[S]).namespace===t.namespaceURI){E.prefix&&(y=E.prefix+":"+b);break}}}n.push("<",y);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,_,C;nt(A=s.item(F),0,o)&&(it(n,(_=A.prefix||"")?"xmlns:"+_:"xmlns",C=A.namespaceURI),o.push({prefix:_,namespace:C})),rt(A,n,i,r,o)}if(b===y&&nt(t,0,o)&&(it(n,(_=t.prefix||"")?"xmlns:"+_:"xmlns",C=t.namespaceURI),o.push({prefix:_,namespace:C})),f||i&&!/^(?:meta|link|img|br|hr|input)$/i.test(b)){if(n.push(">"),i&&/^script$/i.test(b))for(;f;)f.data?n.push(f.data):rt(f,n,i,r,o.slice()),f=f.nextSibling;else for(;f;)rt(f,n,i,r,o.slice()),f=f.nextSibling;n.push("</",y,">")}else n.push("/>");return;case g:case w:for(f=t.firstChild;f;)rt(f,n,i,r,o.slice()),f=f.nextSibling;return;case c:return it(n,t.name,t.value);case l:return n.push(t.data.replace(/[<&]/g,P).replace(/]]>/g,"]]>"));case h:return n.push("<![CDATA[",t.data,"]]>");case v:return n.push("\x3c!--",t.data,"--\x3e");case m:var j=t.publicId,R=t.systemId;if(n.push("<!DOCTYPE ",t.name),j)n.push(" PUBLIC ",j),R&&"."!=R&&n.push(" ",R),n.push(">");else if(R&&"."!=R)n.push(" SYSTEM ",R,">");else{var T=t.internalSubset;T&&n.push(" [",T,"]"),n.push(">")}return;case p:return n.push("<?",t.target," ",t.data,"?>");case d:return n.push("&",t.nodeName,";");default:n.push("??",t.nodeName)}}function ot(t,e,n){var i;switch(e.nodeType){case u:(i=e.cloneNode(!1)).ownerDocument=t;case w:break;case c:n=!0}if(i||(i=e.cloneNode(!1)),i.ownerDocument=t,i.parentNode=null,n)for(var r=e.firstChild;r;)i.appendChild(ot(t,r,n)),r=r.nextSibling;return i}function st(t,e,n){var i=new e.constructor;for(var r in e){var o=e[r];"object"!=typeof o&&o!=i[r]&&(i[r]=o)}switch(e.childNodes&&(i.childNodes=new A),i.ownerDocument=t,i.nodeType){case u:var s=e.attributes,a=i.attributes=new j,l=s.length;a._ownerElement=i;for(var h=0;h<l;h++)i.setAttributeNode(st(t,s.item(h),!0));break;case c:n=!0}if(n)for(var d=e.firstChild;d;)i.appendChild(st(t,d,n)),d=d.nextSibling;return i}function at(t,e,n){t[e]=n}y.INVALID_STATE_ERR=(x[11]="Invalid state",11),y.SYNTAX_ERR=(x[12]="Syntax error",12),y.INVALID_MODIFICATION_ERR=(x[13]="Invalid modification",13),y.NAMESPACE_ERR=(x[14]="Invalid namespace",14),y.INVALID_ACCESS_ERR=(x[15]="Invalid access",15),F.prototype=Error.prototype,o(y,F),A.prototype={length:0,item:function(t){return this[t]||null},toString:function(t,e){for(var n=[],i=0;i<this.length;i++)rt(this[i],n,t,e);return n.join("")}},_.prototype.item=function(t){return C(this),this[t]},s(_,A),j.prototype={length:0,item:A.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 F(E);var n=this.getNamedItem(t.nodeName);return T(this._ownerElement,this,t,n),n},setNamedItemNS:function(t){var e,n=t.ownerElement;if(n&&n!=this._ownerElement)throw new F(E);return e=this.getNamedItemNS(t.namespaceURI,t.localName),T(this._ownerElement,this,t,e),e},removeNamedItem:function(t){var e=this.getNamedItem(t);return I(this._ownerElement,this,e),e},removeNamedItemNS:function(t,e){var n=this.getNamedItemNS(t,e);return I(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}},O.prototype={hasFeature:function(){return!0},createDocument:function(t,e,n){var i=new M;if(i.implementation=this,i.childNodes=new A,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 V;return i.name=t,i.nodeName=t,i.publicId=e||"",i.systemId=n||"",i}},N.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 $(this,t,e)},replaceChild:function(t,e){this.insertBefore(t,e),e&&this.removeChild(e)},removeChild:function(t){return B(this,t)},appendChild:function(t){return this.insertBefore(t,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(t){return st(this.ownerDocument||this,this,t)},normalize:function(){for(var t=this.firstChild;t;){var e=t.nextSibling;e&&e.nodeType==l&&t.nodeType==l?(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(n[i]==t)return i;e=e.nodeType==c?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(t){for(var e=this;e;){var n=e._nsMap;if(n&&t in n)return n[t];e=e.nodeType==c?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(t){return null==this.lookupPrefix(t)}},o(a,N),o(a,N.prototype),M.prototype={nodeName:"#document",nodeType:g,doctype:null,documentElement:null,_inc:1,insertBefore:function(t,e){if(t.nodeType==w){for(var n=t.firstChild;n;){var i=n.nextSibling;this.insertBefore(n,e),n=i}return t}return null==this.documentElement&&t.nodeType==u&&(this.documentElement=t),$(this,t,e),t.ownerDocument=this,t},removeChild:function(t){return this.documentElement==t&&(this.documentElement=null),B(this,t)},importNode:function(t,e){return ot(this,t,e)},getElementById:function(t){var e=null;return D(this.documentElement,(function(n){if(n.nodeType==u&&n.getAttribute("id")==t)return e=n,!0})),e},getElementsByClassName:function(t){var e=r(t);return new _(this,(function(n){var i=[];return e.length>0&&D(n.documentElement,(function(o){if(o!==n&&o.nodeType===u){var s=o.getAttribute("class");if(s){var a=t===s;if(!a){var c=r(s);a=e.every((l=c,function(t){return l&&-1!==l.indexOf(t)}))}a&&i.push(o)}}var l})),i}))},createElement:function(t){var e=new H;return e.ownerDocument=this,e.nodeName=t,e.tagName=t,e.localName=t,e.childNodes=new A,(e.attributes=new j)._ownerElement=e,e},createDocumentFragment:function(){var t=new Z;return t.ownerDocument=this,t.childNodes=new A,t},createTextNode:function(t){var e=new K;return e.ownerDocument=this,e.appendData(t),e},createComment:function(t){var e=new W;return e.ownerDocument=this,e.appendData(t),e},createCDATASection:function(t){var e=new q;return e.ownerDocument=this,e.appendData(t),e},createProcessingInstruction:function(t,e){var n=new Q;return n.ownerDocument=this,n.tagName=n.target=t,n.nodeValue=n.data=e,n},createAttribute:function(t){var e=new J;return e.ownerDocument=this,e.name=t,e.nodeName=t,e.localName=t,e.specified=!0,e},createEntityReference:function(t){var e=new Y;return e.ownerDocument=this,e.nodeName=t,e},createElementNS:function(t,e){var n=new H,i=e.split(":"),r=n.attributes=new j;return n.childNodes=new A,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 J,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}},s(M,N),M.prototype.getElementsByTagName=(H.prototype={nodeType:u,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===w?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,L(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 _(this,(function(e){var n=[];return D(e,(function(i){i===e||i.nodeType!=u||"*"!==t&&i.tagName!=t||n.push(i)})),n}))},getElementsByTagNameNS:function(t,e){return new _(this,(function(n){var i=[];return D(n,(function(r){r===n||r.nodeType!==u||"*"!==t&&r.namespaceURI!==t||"*"!==e&&r.localName!=e||i.push(r)})),i}))}}).getElementsByTagName,M.prototype.getElementsByTagNameNS=H.prototype.getElementsByTagNameNS,s(H,N),J.prototype.nodeType=c,s(J,N),z.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(x[k])},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}},s(z,N),K.prototype={nodeName:"#text",nodeType:l,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}},s(K,z),W.prototype={nodeName:"#comment",nodeType:v},s(W,z),q.prototype={nodeName:"#cdata-section",nodeType:h},s(q,z),V.prototype.nodeType=m,s(V,N),G.prototype.nodeType=b,s(G,N),X.prototype.nodeType=f,s(X,N),Y.prototype.nodeType=d,s(Y,N),Z.prototype.nodeName="#document-fragment",Z.prototype.nodeType=w,s(Z,N),Q.prototype.nodeType=p,s(Q,N),tt.prototype.serializeToString=function(t,e,n){return et.call(t,e,n)},N.prototype.toString=et;try{if(Object.defineProperty){let t=function(e){switch(e.nodeType){case u:case w: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(_.prototype,"length",{get:function(){return C(this),this.$$length}}),Object.defineProperty(N.prototype,"textContent",{get:function(){return t(this)},set:function(t){switch(this.nodeType){case u:case w: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}}}),at=function(t,e,n){t["$$"+e]=n}}}catch(t){}t.DocumentType=V,t.DOMException=F,t.DOMImplementation=O,t.Element=H,t.Node=N,t.NodeList=A,t.XMLSerializer=tt}}),mr=Kt({"node_modules/@xmldom/xmldom/lib/entities.js"(t){var e=vr().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}}),wr=Kt({"node_modules/@xmldom/xmldom/lib/sax.js"(t){var e=vr().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 u(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 u,c=++n,l=0;;){var h=t.charAt(c);switch(h){case"=":if(1===l)u=t.slice(n,c),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 "="'),u=t.slice(n,c)),!((c=t.indexOf(h,n=c+1))>0))throw new Error("attribute value no end '"+h+"' match");a(u,d=t.slice(n,c),n-1),l=5}else{if(4!=l)throw new Error('attribute value must after "="');a(u,d=t.slice(n,c),n),s.warning('attribute "'+u+'" missed start quot('+h+")!!"),n=c+1,l=5}break;case"/":switch(l){case 0:i.setTagName(t.slice(n,c));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,c)),c;case">":switch(l){case 0:i.setTagName(t.slice(n,c));case 5:case 6:case 7:break;case 4:case 1:"/"===(d=t.slice(n,c)).slice(-1)&&(i.closed=!0,d=d.slice(0,-1));case 2:2===l&&(d=u),4==l?(s.warning('attribute "'+d+'" missed quot(")!'),a(u,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 c;case"":h=" ";default:if(h<=" ")switch(l){case 0:i.setTagName(t.slice(n,c)),l=6;break;case 1:u=t.slice(n,c),l=2;break;case 4:var d=t.slice(n,c);s.warning('attribute "'+d+'" missed quot(")!!'),a(u,d,n);case 5:l=6}else switch(l){case 2:e.isHTML(r[""])&&u.match(/^(?:disabled|checked|selected)$/i)||s.warning('attribute "'+u+'" missed value!! "'+u+'" instead2!!'),a(u,u,n),n=c,l=1;break;case 5:s.warning('attribute space is required"'+u+'"!!');case 6:l=1,n=c;break;case 3:l=4,n=c;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}c++}}function c(t,n,i){for(var r=t.tagName,o=null,s=t.length;s--;){var a=t[s],u=a.qName,c=a.value;if((p=u.indexOf(":"))>0)var l=a.prefix=u.slice(0,p),h=u.slice(p+1),f="xmlns"===l&&h;else h=u,l=null,f="xmlns"===u&&"";a.localName=h,!1!==f&&(null==o&&(o={},d(i,i={})),i[f]=o[f]=c,a.uri=e.XMLNS,n.startPrefixMapping(f,c))}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)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)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],u=!1,c=!1;s>3&&(/^public$/i.test(o[2][0])?(u=o[3][0],c=s>4&&o[4][0]):/^system$/i.test(o[2][0])&&(c=o[3][0]));var l=o[s-1];return n.startDTD(a,u,c),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>E){var n=t.substring(E,e).replace(/&#?\w+;/g,d);x&&m(E),r.characters(n,0,e-E),E=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}],S={},E=0;;){try{var F=t.indexOf("<",E);if(F<0){if(!t.substr(E).match(/^\s*$/)){var A=r.doc,_=A.createTextNode(t.substr(E));A.appendChild(_),r.currentElement=_}return}switch(F>E&&g(F),t.charAt(F+1)){case"/":var C=t.indexOf(">",F+3),j=t.substring(F+2,C).replace(/[ \t\n\r]+$/g,""),R=k.pop();C<0?(j=t.substring(F+2).replace(/[\s<].*/,""),s.error("end tag name: "+j+" is not complete:"+R.tagName),C=F+1+j.length):j.match(/\s</)&&(j=j.replace(/[\s<].*/,""),s.error("end tag name: "+j+" maybe not complete"),C=F+1+j.length);var T=R.localNSMap,I=R.tagName==j;if(I||R.tagName&&R.tagName.toLowerCase()==j.toLowerCase()){if(r.endElement(R.uri,R.localName,j),T)for(var O in T)r.endPrefixMapping(O);I||s.fatalError("end tag name: "+j+" is not match the current start tagName:"+R.tagName)}else k.push(R);C++;break;case"?":x&&m(F),C=p(t,F,r);break;case"!":x&&m(F),C=f(t,F,r,s);break;default:x&&m(F);var N=new v,P=k[k.length-1].currentNSMap,D=(C=u(t,F,N,P,d,s),N.length);if(!N.closed&&h(t,C,N.tagName,S)&&(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,c(N,r,P)&&k.push(N),r.locator=x}else c(N,r,P)&&k.push(N);e.isHTML(N.uri)&&!N.closed?C=l(t,C,N.tagName,d,r):C++}}catch(t){if(t instanceof o)throw t;s.error("element parse error: "+t),C=-1}C>E?E=C:g(Math.max(F,E)+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}}),br=Kt({"node_modules/@xmldom/xmldom/lib/dom-parser.js"(t){var e=vr(),n=gr(),i=mr(),r=wr(),o=n.DOMImplementation,s=e.NAMESPACE,a=r.ParseError,u=r.XMLReader;function c(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 u,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||c)(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 u=i.getValue(a),c=(n=i.getQName(a),r.createAttributeNS(t,n));this.locator&&d(i.getLocator(a),c),c.value=c.nodeValue=u,o.setAttributeNode(c)}},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=c,t.DOMParser=l}}),yr=Kt({"node_modules/@xmldom/xmldom/lib/index.js"(t){var e=gr();t.DOMImplementation=e.DOMImplementation,t.XMLSerializer=e.XMLSerializer,t.DOMParser=br().DOMParser}}),xr=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}}});Wt({},{BrowserSession:()=>Sr,PodOS:()=>Qc});var kr=qt(_i()),Sr=class{get authenticatedFetch(){return this._authenticatedFetch}constructor(){this.session=new kr.Session,this._authenticatedFetch=this.session.fetch}async handleIncomingRedirect(){return this.session.handleIncomingRedirect({restorePreviousSession:!1})}async login(t){return this.session.login({oidcIssuer:t,redirectUrl:window.location.href,clientName:`Pod OS at ${window.location.host}`})}async logout(){return this.session.logout()}async 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)}};function Er(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Fr(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ar(t,e){return(Ar=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function _r(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&&Ar(t,e)}function Cr(t){return(Cr="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 jr(t,e){if(e&&("object"===Cr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Fr(t)}function Rr(t){return(Rr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Tr(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 Ir(t,e,n){return e&&Tr(t.prototype,e),n&&Tr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Or(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Nr={Literal:1,Collection:3,Graph:4,NamedNode:5,BlankNode:6,Variable:7},Pr=function(){function t(e){Er(this,t),Or(this,"termType",void 0),Or(this,"classOrder",void 0),Or(this,"value",void 0),this.value=e}return Ir(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}();Or(Pr,"fromValue",void 0),Or(Pr,"toJS",void 0);var Dr="NamedNode",Mr="BlankNode",Ur="Literal",Lr="Variable",Br="DefaultGraph",$r="Collection",Hr="Empty",Jr="Graph",zr="text/html",Kr="application/ld+json",Wr="text/n3",qr="application/nquads",Vr="application/n-quads",Gr="application/rdf+xml",Xr="application/sparql-update",Yr="application/sparql-update-single-match",Zr="text/turtle",Qr="application/xhtml+xml";var to=function(t){_r(r,t);var e,n,i=(e=r,n=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 t,i=Rr(e);if(n){var r=Rr(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return jr(this,t)});function r(t){var e;return Er(this,r),Or(Fr(e=i.call(this,r.getId(t))),"termType",Mr),Or(Fr(e),"classOrder",Nr.BlankNode),Or(Fr(e),"isBlank",1),Or(Fr(e),"isVar",1),e}return Ir(r,[{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 r;return t.copyTo(this,e),e}},{key:"toCanonical",value:function(){return r.NTAnonymousNodePrefix+this.value}},{key:"toString",value:function(){return r.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"+r.nextId++}}]),r}(Pr);function eo(t){return"string"==typeof t?t:t.value}function no(t){return"object"===Cr(t)&&null!==t&&"subject"in t}function io(t){return"object"===Cr(t)&&null!==t&&"statements"in t}function ro(t){return so(t)&&t.termType===$r}function oo(t){return t&&Object.prototype.hasOwnProperty.call(t,"termType")&&(t.termType===Dr||t.termType===Lr||t.termType===Mr||t.termType===$r||t.termType===Ur||t.termType===Jr)}function so(t){return"object"===Cr(t)&&null!==t&&"termType"in t}function ao(t){return t.termType===Ur}function uo(t){return"object"===Cr(t)&&null!==t&&"subject"in t&&"predicate"in t&&"object"in t}function co(t){return so(t)&&"NamedNode"===t.termType}function lo(t){return so(t)&&(t.termType===Dr||t.termType===Lr||t.termType===Mr)}function ho(t){return so(t)&&(t.termType===Dr||t.termType===Lr)}function fo(t){return so(t)&&(t.termType===Dr||t.termType===Lr||t.termType===Mr||t.termType===Br)}Or(to,"nextId",0),Or(to,"NTAnonymousNodePrefix","_:");var po=function(t){_r(r,t);var e,n,i=(e=r,n=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 t,i=Rr(e);if(n){var r=Rr(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return jr(this,t)});function r(t){var e;if(Er(this,r),Or(Fr(e=i.call(this,eo(t))),"termType",Dr),Or(Fr(e),"classOrder",Nr.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 Ir(r,[{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 r(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 r(n<0?t.slice(0)+"/":t.slice(0,n+1))}},{key:"doc",value:function(){return this.value.indexOf("#")<0?this:new r(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||so(t)?t:new r(t)}}]),r}(Pr),vo={boolean:new po("http://www.w3.org/2001/XMLSchema#boolean"),dateTime:new po("http://www.w3.org/2001/XMLSchema#dateTime"),decimal:new po("http://www.w3.org/2001/XMLSchema#decimal"),double:new po("http://www.w3.org/2001/XMLSchema#double"),integer:new po("http://www.w3.org/2001/XMLSchema#integer"),langString:new po("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),string:new po("http://www.w3.org/2001/XMLSchema#string")};var go=function(t){_r(r,t);var e,n,i=(e=r,n=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 t,i=Rr(e);if(n){var r=Rr(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return jr(this,t)});function r(t,e,n){var o;return Er(this,r),Or(Fr(o=i.call(this,t)),"termType",Ur),Or(Fr(o),"classOrder",Nr.Literal),Or(Fr(o),"datatype",vo.string),Or(Fr(o),"isVar",0),Or(Fr(o),"language",""),e?(o.language=e,o.datatype=vo.langString):o.datatype=n?po.fromValue(n):vo.string,o}return Ir(r,[{key:"copy",value:function(){return new r(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 r.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(vo.string)||(e+="^^"+t.datatype.toCanonical()),e}},{key:"fromBoolean",value:function(t){return new r(t?"1":"0",null,vo.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 r(t.getUTCFullYear()+"-"+e(t.getUTCMonth()+1)+"-"+e(t.getUTCDate())+"T"+e(t.getUTCHours())+":"+e(t.getUTCMinutes())+":"+e(t.getUTCSeconds())+"Z",null,vo.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)?vo.integer:vo.decimal:vo.double,new r(n,null,e)}},{key:"fromValue",value:function(t){if(ao(t))return t;switch(Cr(t)){case"object":if(t instanceof Date)return r.fromDate(t);case"boolean":return r.fromBoolean(t);case"number":return r.fromNumber(t);case"string":return new r(t)}throw new Error("Can't make literal from "+t+" of type "+Cr(t))}}]),r}(Pr);function mo(t){return null==t||so(t)?t:Array.isArray(t)?new wo(t):go.fromValue(t)}var wo=function(t){_r(r,t);var e,n,i=(e=r,n=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 t,i=Rr(e);if(n){var r=Rr(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return jr(this,t)});function r(t){var e;return Er(this,r),Or(Fr(e=i.call(this,(to.nextId++).toString())),"termType",$r),Or(Fr(e),"classOrder",Nr.Collection),Or(Fr(e),"closed",!1),Or(Fr(e),"compareTerm",to.prototype.compareTerm),Or(Fr(e),"elements",[]),Or(Fr(e),"isVar",0),t&&t.length>0&&t.forEach((function(t){e.elements.push(mo(t))})),e}return Ir(r,[{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 r(this.elements.map((function(e){return e.substitute(t)})))}},{key:"toNT",value:function(){return r.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 to.NTAnonymousNodePrefix+t.id}}]),r}(Pr);function bo(t){return function(...e){var n=e.pop();return t.call(this,e,n)}}Or(wo,"termType",$r);var yo="function"==typeof queueMicrotask&&queueMicrotask,xo="function"==typeof setImmediate&&setImmediate,ko="object"==typeof process&&"function"==typeof process.nextTick;function So(t){setTimeout(t,0)}function Eo(t){return(e,...n)=>t((()=>e(...n)))}var Fo=Eo(yo?queueMicrotask:xo?setImmediate:ko?process.nextTick:So);function Ao(t){return jo(t)?function(...e){const n=e.pop();return _o(t.apply(this,e),n)}:bo((function(e,n){var i;try{i=t.apply(this,e)}catch(t){return n(t)}if(i&&"function"==typeof i.then)return _o(i,n);n(null,i)}))}function _o(t,e){return t.then((t=>{Co(e,null,t)}),(t=>{Co(e,t&&t.message?t:new Error(t))}))}function Co(t,e,n){try{t(e,n)}catch(t){Fo((t=>{throw t}),t)}}function jo(t){return"AsyncFunction"===t[Symbol.toStringTag]}function Ro(t){if("function"!=typeof t)throw new Error("expected a function");return jo(t)?Ao(t):t}function To(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 Io(t){return function(e,...n){return To((function(i){var r=this;return t(e,((t,e)=>{Ro(t).apply(r,n.concat(e))}),i)}))}}function Oo(t,e,n,i){e=e||[];var r=[],o=0,s=Ro(n);return t(e,((t,e,n)=>{var i=o++;s(t,((t,e)=>{r[i]=e,n(t)}))}),(t=>{i(t,r)}))}function No(t){return t&&"number"==typeof t.length&&t.length>=0&&t.length%1==0}var Po={};function Do(t){function e(...e){if(null!==t){var n=t;t=null,n.apply(this,e)}}return Object.assign(e,t),e}function Mo(t){return function(...e){if(null===t)throw new Error("Callback was already called.");var n=t;t=null,n.apply(this,e)}}function Uo(t,e,n,i){let r=!1,o=!1,s=!1,a=0,u=0;function c(){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,u,l),u++,c()}})).catch(h))}function l(t,e){if(a-=1,!o)return t?h(t):!1===t?(r=!0,void(o=!0)):e===Po||r&&a<=0?(r=!0,i(null)):void c()}function h(t){o||(s=!1,r=!0,i(t))}c()}var Lo=t=>(e,n,i)=>{if(i=Do(i),t<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!e)return i(null);if("AsyncGenerator"===e[Symbol.toStringTag])return Uo(e,t,n,i);if(function(t){return"function"==typeof t[Symbol.asyncIterator]}(e))return Uo(e[Symbol.asyncIterator](),t,n,i);var r=function(t){if(No(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,u=!1;function c(t,e){if(!s)if(a-=1,t)o=!0,i(t);else if(!1===t)o=!0,s=!0;else{if(e===Po||o&&a<=0)return o=!0,i(null);u||l()}}function l(){for(u=!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,Mo(c))}u=!1}l()},Bo=To((function(t,e,n,i){return Lo(e)(t,Ro(n),i)}),4);function $o(t,e,n){n=Do(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!==Po||n(null))}for(0===o&&n(null);i<o;i++)e(t[i],i,Mo(a))}function Ho(t,e,n){return Bo(t,1/0,e,n)}var Jo=To((function(t,e,n){return(No(t)?$o:Ho)(t,Ro(e),n)}),3),zo=To((function(t,e,n){return Oo(Jo,t,e,n)}),3),Ko=Io(zo),Wo=To((function(t,e,n){return Bo(t,1,e,n)}),3),qo=To((function(t,e,n){return Oo(Wo,t,e,n)}),3),Vo=Io(qo),Go=Symbol("promiseCallback");function Xo(){let t,e;function n(n,...i){if(n)return e(n);t(i.length>1?i:i[0])}return n[Go]=new Promise(((n,i)=>{t=n,e=i})),n}function Yo(t,e,n){"number"!=typeof e&&(n=e,e=null),n=Do(n||Xo());var i=Object.keys(t).length;if(!i)return n(null);e||(e=i);var r={},o=0,s=!1,a=!1,u=Object.create(null),c=[],l=[],h={};function d(t,e){c.push((()=>function(t,e){if(!a){var i=Mo(((e,...i)=>{if(o--,!1!==e)if(i.length<2&&([i]=i),e){var c={};if(Object.keys(r).forEach((t=>{c[t]=r[t]})),c[t]=i,a=!0,u=Object.create(null),s)return;n(e,c)}else r[t]=i,(u[t]||[]).forEach((t=>t())),f();else s=!0}));o++;var c=Ro(e[e.length-1]);e.length>1?c(r,i):c(i)}}(t,e)))}function f(){if(!s){if(0===c.length&&0===o)return n(null,r);for(;c.length&&o<e;)c.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=u[s=o])||(a=u[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[Go]}var Zo=/^(?:async\s+)?(?:function)?\s*\w*\s*\(\s*([^)]+)\s*\)(?:\s*{)/,Qo=/^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/,ts=/,/,es=/(=.+)?(\s*)$/,ns=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):is(this,t)}push(t){this.tail?this.insertAfter(this.tail,t):is(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 is(t,e){t.length=1,t.head=t.tail=e}function rs(t,e,n){if(null==e)e=1;else if(0===e)throw new RangeError("Concurrency must not be zero");var i=Ro(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 u(t,...e){s[t].forEach((t=>t(...e)))}var c=!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={data:t,callback:n?s:i||s};if(e?v._tasks.unshift(a):v._tasks.push(a),c||(c=!0,Fo((()=>{c=!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],c=o.indexOf(a);0===c?o.shift():c>0&&o.splice(c,1),a.callback(e,...n),null!=e&&u("error",e,a.data)}r<=v.concurrency-v.buffer&&u("unsaturated"),v.idle()&&u("drain"),v.process()}}function d(t){return!(0!==t.length||!v.idle()||(Fo((()=>u("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 ns,*[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&&u("empty"),r===v.concurrency&&u("saturated");var c=Mo(h(t));i(e,c)}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,Fo(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 os=To((function(t,e,n,i){i=Do(i);var r=Ro(n);return Wo(t,((t,n,i)=>{r(e,t,((t,n)=>{e=n,i(t)}))}),(t=>i(t,e)))}),4);function ss(...t){var e=t.map(Ro);return function(...t){var n=this,i=t[t.length-1];return"function"==typeof i?t.pop():i=Xo(),os(e,t,((t,e,i)=>{e.apply(n,t.concat(((t,...e)=>{i(t,e)})))}),((t,e)=>i(t,...e))),i[Go]}}var as=To((function(t,e,n,i){return Oo(Lo(e),t,n,i)}),4),us=To((function(t,e,n,i){var r=Ro(n);return as(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),cs=To((function(t,e,n){return us(t,1/0,e,n)}),3),ls=To((function(t,e,n){return us(t,1,e,n)}),3);function hs(t,e){return(n,i,r,o)=>{var s,a=!1;const u=Ro(r);n(i,((n,i,r)=>{u(n,((i,o)=>i||!1===i?r(i):t(o)&&!s?(a=!0,s=e(!0,n),r(null,Po)):void r()))}),(t=>{if(t)return o(t);o(null,a?s:e(!1))}))}}var ds=To((function(t,e,n){return hs((t=>t),((t,e)=>e))(Jo,t,e,n)}),3),fs=To((function(t,e,n,i){return hs((t=>t),((t,e)=>e))(Lo(e),t,n,i)}),4),ps=To((function(t,e,n){return hs((t=>t),((t,e)=>e))(Lo(1),t,e,n)}),3);function vs(t){return(e,...n)=>Ro(e)(...n,((e,...n)=>{"object"==typeof console&&(e?console.error&&console.error(e):console[t]&&n.forEach((e=>console[t](e))))}))}var gs=vs("dir"),ms=To((function(t,e,n){n=Mo(n);var i,r=Ro(t),o=Ro(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 ws(t){return(e,n,i)=>t(e,i)}var bs=To((function(t,e,n){return Jo(t,ws(Ro(e)),n)}),3),ys=To((function(t,e,n,i){return Lo(e)(t,ws(Ro(n)),i)}),4),xs=To((function(t,e,n){return ys(t,1,e,n)}),3);function ks(t){return jo(t)?t:function(...e){var n=e.pop(),i=!0;e.push(((...t)=>{i?Fo((()=>n(...t))):n(...t)})),t.apply(this,e),i=!1}}var Ss=To((function(t,e,n){return hs((t=>!t),(t=>!t))(Jo,t,e,n)}),3),Es=To((function(t,e,n,i){return hs((t=>!t),(t=>!t))(Lo(e),t,n,i)}),4),Fs=To((function(t,e,n){return hs((t=>!t),(t=>!t))(Wo,t,e,n)}),3);function As(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 _s(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 Cs(t,e,n,i){return(No(e)?As:_s)(t,e,Ro(n),i)}var js=To((function(t,e,n){return Cs(Jo,t,e,n)}),3),Rs=To((function(t,e,n,i){return Cs(Lo(e),t,n,i)}),4),Ts=To((function(t,e,n){return Cs(Wo,t,e,n)}),3),Is=To((function(t,e){var n=Mo(e),i=Ro(ks(t));return function t(e){if(e)return n(e);!1!==e&&i(t)}()}),2),Os=To((function(t,e,n,i){var r=Ro(n);return as(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),Ns=vs("log"),Ps=To((function(t,e,n,i){i=Do(i);var r={},o=Ro(n);return Lo(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),Ds=Eo(ko?process.nextTick:xo?setImmediate:So),Ms=To(((t,e,n)=>{var i=No(e)?[]:{};t(e,((t,e,n)=>{Ro(t)(((t,...r)=>{r.length<2&&([r]=r),i[e]=r,n(t)}))}),(t=>n(t,i)))}),3);function Us(t,e){var n=Ro(t);return rs(((t,e)=>{n(t[0],e)}),e,1)}var Ls=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&&Hs(this.heap[t],this.heap[e=$s(t)]);){let n=this.heap[t];this.heap[t]=this.heap[e],this.heap[e]=n,t=e}}percDown(t){let e;for(;(e=Bs(t))<this.heap.length&&(e+1<this.heap.length&&Hs(this.heap[e+1],this.heap[e])&&(e+=1),!Hs(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=$s(this.heap.length-1);t>=0;t--)this.percDown(t);return this}};function Bs(t){return 1+(t<<1)}function $s(t){return(t+1>>1)-1}function Hs(t,e){return t.priority!==e.priority?t.priority<e.priority:t.pushCount<e.pushCount}var Js=To((function(t,e){if(e=Do(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++)Ro(t[n])(e)}),2);function zs(t,e,n,i){var r=[...t].reverse();return os(r,e,n,i)}function Ks(t){var e=Ro(t);return bo((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 Ws(t,e,n,i){const r=Ro(n);return Cs(t,e,((t,e)=>{r(t,((t,n)=>{e(t,!n)}))}),i)}var qs=To((function(t,e,n){return Ws(Jo,t,e,n)}),3),Vs=To((function(t,e,n,i){return Ws(Lo(e),t,n,i)}),4),Gs=To((function(t,e,n){return Ws(Wo,t,e,n)}),3);function Xs(t){return function(){return t}}function Ys(t,e,n){var i={times:5,intervalFunc:Xs(0)};if(arguments.length<3&&"function"==typeof t?(n=e||Xo(),e=t):(Zs(i,t),n=n||Xo()),"function"!=typeof e)throw new Error("Invalid arguments for async.retry");var r=Ro(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[Go]}function Zs(t,e){if("object"==typeof e)t.times=+e.times||5,t.intervalFunc="function"==typeof e.interval?e.interval:Xs(+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 Qs=To((function(t,e,n){return hs(Boolean,(t=>t))(Jo,t,e,n)}),3),ta=To((function(t,e,n,i){return hs(Boolean,(t=>t))(Lo(e),t,n,i)}),4),ea=To((function(t,e,n){return hs(Boolean,(t=>t))(Wo,t,e,n)}),3),na=To((function(t,e,n){var i=Ro(e);return zo(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 ia(t,e,n,i){var r=Ro(n);return as(function(t){for(var e=Array(t);t--;)e[t]=t;return e}(t),e,r,i)}var ra,oa=To((function(t,e){var n,i=null;return xs(t,((t,e)=>{Ro(t)(((t,...r)=>{if(!1===t)return e(t);r.length<2?[n]=r:n=r,i=t,e(t?null:{})}))}),(()=>e(i,n)))})),sa=To((function(t,e,n){n=Mo(n);var i=Ro(e),r=Ro(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),aa=To((function(t,e){if(e=Do(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){Ro(t[n++])(...e,Mo(r))}function r(r,...o){if(!1!==r)return r||n===t.length?e(r,...o):void i(o)}i([])})),ua={apply:function(t,...e){return(...n)=>t(...e,...n)},applyEach:Ko,applyEachSeries:Vo,asyncify:Ao,auto:Yo,autoInject:function(t,e){var n={};return Object.keys(t).forEach((e=>{var i,r=t[e],o=jo(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(Zo);if(n||(n=e.match(Qo)),!n)throw new Error("could not parse args in autoInject\nSource:\n"+e);let[,i]=n;return i.replace(/\s/g,"").split(ts).map((t=>t.replace(es,"").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),Ro(r)(...n)}})),Yo(n,e)},cargo:function(t,e){return rs(t,1,e)},cargoQueue:function(t,e,n){return rs(t,e,n)},compose:function(...t){return ss(...t.reverse())},concat:cs,concatLimit:us,concatSeries:ls,constant:function(...t){return function(...e){return e.pop()(null,...t)}},detect:ds,detectLimit:fs,detectSeries:ps,dir:gs,doUntil:function(t,e,n){const i=Ro(e);return ms(t,((...t)=>{const e=t.pop();i(...t,((t,n)=>e(t,!n)))}),n)},doWhilst:ms,each:bs,eachLimit:ys,eachOf:Jo,eachOfLimit:Bo,eachOfSeries:Wo,eachSeries:xs,ensureAsync:ks,every:Ss,everyLimit:Es,everySeries:Fs,filter:js,filterLimit:Rs,filterSeries:Ts,forever:Is,groupBy:function(t,e,n){return Os(t,1/0,e,n)},groupByLimit:Os,groupBySeries:function(t,e,n){return Os(t,1,e,n)},log:Ns,map:zo,mapLimit:as,mapSeries:qo,mapValues:function(t,e,n){return Ps(t,1/0,e,n)},mapValuesLimit:Ps,mapValuesSeries:function(t,e,n){return Ps(t,1,e,n)},memoize:function(t,e=(t=>t)){var n=Object.create(null),i=Object.create(null),r=Ro(t),o=bo(((t,o)=>{var s=e(...t);s in n?Fo((()=>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:Ds,parallel:function(t,e){return Ms(Jo,t,e)},parallelLimit:function(t,e,n){return Ms(Lo(e),t,n)},priorityQueue:function(t,e){var n=Us(t,e),i=!1;return n._tasks=new Ls,n.push=function(t,e=0,r=(()=>{})){if("function"!=typeof r)throw new Error("task callback must be a function");if(n.started=!0,Array.isArray(t)||(t=[t]),0===t.length&&n.idle())return Fo((()=>n.drain()));for(var o=0,s=t.length;o<s;o++)n._tasks.push({data:t[o],priority:e,callback:r});i||(i=!0,Fo((()=>{i=!1,n.process()})))},delete n.unshift,n},queue:Us,race:Js,reduce:os,reduceRight:zs,reflect:Ks,reflectAll:function(t){var e;return Array.isArray(t)?e=t.map(Ks):(e={},Object.keys(t).forEach((n=>{e[n]=Ks.call(this,t[n])}))),e},reject:qs,rejectLimit:Vs,rejectSeries:Gs,retry:Ys,retryable:function(t,e){e||(e=t,t=null);let n=t&&t.arity||e.length;jo(e)&&(n+=1);var i=Ro(e);return bo(((e,r)=>{function o(t){i(...e,t)}return(e.length<n-1||null==r)&&(e.push(r),r=Xo()),t?Ys(t,o,r):Ys(o,r),r[Go]}))},seq:ss,series:function(t,e){return Ms(Wo,t,e)},setImmediate:Fo,some:Qs,someLimit:ta,someSeries:ea,sortBy:na,timeout:function(t,e,n){var i=Ro(t);return bo(((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 ia(t,1/0,e,n)},timesLimit:ia,timesSeries:function(t,e,n){return ia(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=Do(i||Xo());var r=Ro(n);return Jo(t,((t,n,i)=>{r(e,t,n,i)}),(t=>i(t,e))),i[Go]},tryEach:oa,unmemoize:function(t){return(...e)=>(t.unmemoized||t)(...e)},until:function(t,e,n){const i=Ro(t);return sa((t=>i(((e,n)=>t(e,!n)))),e,n)},waterfall:aa,whilst:sa,all:Ss,allLimit:Es,allSeries:Fs,any:Qs,anyLimit:ta,anySeries:ea,find:ds,findLimit:fs,findSeries:ps,flatMap:cs,flatMapLimit:us,flatMapSeries:ls,forEach:bs,forEachSeries:xs,forEachLimit:ys,forEachOf:Jo,forEachOfSeries:Wo,forEachOfLimit:Bo,inject:os,foldl:os,foldr:zs,select:js,selectLimit:Rs,selectSeries:Ts,wrapSync:Ao,during:sa,doDuring:ms},ca=qt(hr()),la="http://www.w3.org/1999/02/22-rdf-syntax-ns#",ha="http://www.w3.org/2001/XMLSchema#",da="http://www.w3.org/2000/10/swap/",fa={xsd:{decimal:`${ha}decimal`,boolean:`${ha}boolean`,double:`${ha}double`,integer:`${ha}integer`,string:`${ha}string`},rdf:{type:`${la}type`,nil:`${la}nil`,first:`${la}first`,rest:`${la}rest`,langString:`${la}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${da}reify#forSome`,forAll:`${da}reify#forAll`},log:{implies:`${da}log#implies`}},pa=qt(dr()),{xsd:va}=fa,ga=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,ma={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},wa=/[\x00-\x20<>\\"\{\}\|\^\`]/,ba={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},ya=/$0^/,{rdf:xa,xsd:ka}=fa,Sa=0,Ea={namedNode:function(t){return new Aa(t)},blankNode:function(t){return new Ca(t||"n3-"+Sa++)},variable:function(t){return new ja(t)},literal:function(t,e){if("string"==typeof e)return new _a(`"${t}"@${e.toLowerCase()}`);let n=e?e.value:"";return""===n&&("boolean"==typeof t?n=ka.boolean:"number"==typeof t&&(Number.isFinite(t)?n=Number.isInteger(t)?ka.integer:ka.double:(n=ka.double,Number.isNaN(t)||(t=t>0?"INF":"-INF")))),new _a(""===n||n===ka.string?`"${t}"`:`"${t}"^^${n}`)},defaultGraph:function(){return ra},quad:Ta,triple:Ta},Fa=class{constructor(t){this.id=t}get value(){return this.id}get hashCode(){return 0}equals(t){return t instanceof Fa?this.id===t.id:!!t&&this.termType===t.termType&&this.value===t.value}toJSON(){return{termType:this.termType,value:this.value}}},Aa=class extends Fa{get termType(){return"NamedNode"}},_a=class extends Fa{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 Aa(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?ka.string:xa.langString}equals(t){return t instanceof _a?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}}}},Ca=class extends Fa{constructor(t){super(`_:${t}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}},ja=class extends Fa{constructor(t){super(`?${t}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}};ra=new class extends Fa{constructor(){return super(""),ra||this}get termType(){return"DefaultGraph"}equals(t){return this===t||!!t&&this.termType===t.termType}};var Ra=class extends Fa{constructor(t,e,n,i){super(""),this._subject=t,this._predicate=e,this._object=n,this._graph=i||ra}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 Ta(t,e,n,i){return new Ra(t,e,n,i)}var Ia=0,Oa=class{constructor(t){this._contextStack=[],this._graph=null,this._setBase((t=t||{}).baseIRI),t.factory&&Pa(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 ba)&&this[t]instanceof RegExp&&(this[t]=ya)}else this._n3Mode=!1!==t.n3;this._comments=!!t.comments,this._literalClosingPos=0}_tokenizeToEnd(t,e){let n=this._input;const i=this._comments;for(;;){let o,s;for(;o=this._newline.exec(n);)i&&(s=this._comment.exec(o[0]))&&t(null,{line:this._line,type:"comment",value:s[1],prefix:""}),n=n.substr(o[0].length,n.length),this._line++;if(!o&&(o=this._whitespace.exec(n))&&(n=n.substr(o[0].length,n.length)),this._endOfFile.test(n))return e&&(i&&(s=this._comment.exec(n))&&t(null,{line:this._line,type:"comment",value:s[1],prefix:""}),t(n=null,{line:this._line,type:"eof",value:"",prefix:""})),this._input=n;const a=this._line,u=n[0];let c="",l="",h="",d=null,f=0,p=!1;switch(u){case"^":if(n.length<3)break;if("^"!==n[1]){this._n3Mode&&(f=1,c="^");break}if(this._previousMarker="^^",n=n.substr(2),"<"!==n[0]){p=!0;break}case"<":if(d=this._unescapedIri.exec(n))c="IRI",l=d[1];else if(d=this._iri.exec(n)){if(l=this._unescape(d[1]),null===l||wa.test(l))return r(this);c="IRI"}else n.length>1&&"<"===n[1]?(c="<<",f=2):this._n3Mode&&n.length>1&&"="===n[1]&&(c="inverse",f=2,l=">");break;case">":n.length>1&&">"===n[1]&&(c=">>",f=2);break;case"_":((d=this._blank.exec(n))||e&&(d=this._blank.exec(`${n} `)))&&(c="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 r(this);null===d&&0===f||(c="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 r(this);null===d&&0===f||(c="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(d=this._variable.exec(n))&&(c="var",l=d[0]);break;case"@":"literal"===this._previousMarker&&(d=this._langcode.exec(n))?(c="langcode",l=d[1]):(d=this._keyword.exec(n))&&(c=d[0]);break;case".":if(1===n.length?e:n[1]<"0"||n[1]>"9"){c=".",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} `)))&&(c="literal",l=d[0],h="string"==typeof d[1]?va.double:"string"==typeof d[2]?va.decimal:va.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(d=this._sparqlKeyword.exec(n))?c=d[0].toUpperCase():p=!0;break;case"f":case"t":(d=this._boolean.exec(n))?(c="literal",l=d[0],h=va.boolean):p=!0;break;case"a":(d=this._shortPredicates.exec(n))?(c="abbreviation",l="a"):p=!0;break;case"=":this._n3Mode&&n.length>1&&(c="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,c=u);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} `)))&&(c="prefixed",h=d[1]||"",l=this._unescape(d[2])):(c="prefix",l=d[1]||"")),"^^"===this._previousMarker)switch(c){case"prefixed":c="type";break;case"IRI":c="typeIRI";break;default:c=""}if(!c)return e||!/^'''|^"""/.test(n)&&/\n|\r/.test(n)?r(this):this._input=n;const v={line:a,type:c,value:l,prefix:h};t(null,v),this.previousToken=v,this._previousMarker=c,n=n.substr(f||d[0].length,n.length)}function r(e){t(e._syntaxError(/^\S*/.exec(n)[0]))}}_unescape(t){let e=!1;const n=t.replace(ga,((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 ma?ma[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,pa.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(){Ia=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({subject:n,predicate:i,object:r,graph:e,type:t,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(){const t=this._contextStack.pop(),e=this._n3Mode;this._subject=t.subject,this._predicate=t.predicate,this._object=t.object,this._graph=t.graph,e&&(this._inversePredicate=t.inverse,this._prefixes._=t.blankPrefix,this._quantified=t.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(),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(),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(),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 t=this._subject;this._restoreContext(),this._emit(this._subject,this.RDF_FIRST,t,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(),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=Na}_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${Ia++}_`,this._prefixCallback=n||Na,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=Na):this._readCallback&&(this._readCallback=this._readCallback(e))}))}};function Na(){}function Pa(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(fa.rdf.first),t.RDF_REST=n(fa.rdf.rest),t.RDF_NIL=n(fa.rdf.nil),t.N3_FORALL=n(fa.r.forAll),t.N3_FORSOME=n(fa.r.forSome),t.ABBREVIATIONS={a:n(fa.rdf.type),"=":n(fa.owl.sameAs),">":n(fa.log.implies)},t.QUANTIFIERS_GRAPH=n("urn:n3:quantifiers")}Pa(Oa.prototype,Ea);var Da=Ea.defaultGraph(),{rdf:Ma,xsd:Ua}=fa,La=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,Ba=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,$a={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"},Ha=class extends Fa{equals(){return!1}};function Ja(t){let e=$a[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 za(t){return t.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}function Ka(t,e,n,i,r,o,s){try{var a=t[o](s),u=a.value}catch(t){return void n(t)}a.done?e(u):Promise.resolve(u).then(i,r)}var Wa=qt(pr()),qa="chrome:theSession";new po(qa);var Va=function(t){_r(r,t);var e,n,i=(e=r,n=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 t,i=Rr(e);if(n){var r=Rr(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return jr(this,t)});function r(){var t;return Er(this,r),Or(Fr(t=i.call(this,"")),"value",""),Or(Fr(t),"termType",Br),Or(Fr(t),"uri",qa),t}return Ir(r,[{key:"toCanonical",value:function(){return this.value}},{key:"toString",value:function(){return"DefaultGraph"}}]),r}(Pr);function Ga(t){return!!t&&t.termType===Br}var Xa=new Va,Ya=function(){function t(e,n,i,r){Er(this,t),Or(this,"subject",void 0),Or(this,"predicate",void 0),Or(this,"object",void 0),Or(this,"graph",void 0),this.subject=Pr.fromValue(e),this.predicate=Pr.fromValue(n),this.object=Pr.fromValue(i),this.graph=null==r?Xa:Pr.fromValue(r)}return Ir(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),Ga(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&&this.graph.termType!==Br&&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(),Ga(this.graph)?"":this.graph.toNT()].join(" ")+" ."}},{key:"toString",value:function(){return this.toNT()}}]),t}(),Za={};Wt(Za,{docpart:()=>tu,document:()=>eu,hostpart:()=>nu,join:()=>iu,protocol:()=>ru,refTo:()=>ou});var Qa=Qa||console.log;function tu(t){var e;return(e=t.indexOf("#"))<0?t:t.slice(0,e)}function eu(t){return new po(tu(t))}function nu(t){var e=/[^\/]*\/\/([^\/]*)\//.exec(t);return e?e[1]:""}function iu(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 Qa("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 ru(t){var e=t.indexOf(":");return e<0?null:t.slice(0,e)}function ou(t,e){var n,i,r,o,s,a,u,c,l,h,d,f,p=new RegExp("^[-_a-zA-Z0-9.]+:(//[^/]*)?/[^/]*$");if(!t)return e;if(t===e)return"";for(n=u=0,o=e.length;u<o&&e[n]===t[n];n=++u);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,c=0,s=(h=t.slice(n)).length;c<s;c++)"/"===h[c]&&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 su,au,uu,cu=function(t){_r(r,t);var e,n,i=(e=r,n=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 t,i=Rr(e);if(n){var r=Rr(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return jr(this,t)});function r(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Er(this,r),Or(Fr(t=i.call(this,e)),"termType",Lr),Or(Fr(t),"base","varid:"),Or(Fr(t),"classOrder",Nr.Variable),Or(Fr(t),"isVar",1),Or(Fr(t),"uri",void 0),t.base="varid:",t.uri=iu(e,t.base),t}return Ir(r,[{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 r.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)}}]),r}(Pr);(au=su||(su={})).collections="COLLECTIONS",au.defaultGraphType="DEFAULT_GRAPH_TYPE",au.equalsMethod="EQUALS_METHOD",au.id="ID",au.identity="IDENTITY",au.reversibleId="REVERSIBLE_ID",au.variableType="VARIABLE_TYPE";var lu=new Va,hu={supports:(uu={},Or(uu,su.collections,!1),Or(uu,su.defaultGraphType,!1),Or(uu,su.equalsMethod,!0),Or(uu,su.identity,!1),Or(uu,su.id,!0),Or(uu,su.reversibleId,!1),Or(uu,su.variableType,!0),uu),blankNode:function(t){return new to(t)},defaultGraph:function(){return lu},equals:function(t,e){return t===e||!t||!e||(uo(t)||uo(e)?!(!uo(t)||!uo(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):!(!so(t)||!so(e))&&this.id(t)===this.id(e))},id:function(t){if(!t)return"undefined";if(uo(t))return this.quadToNQ(t);switch(t.termType){case Br:return"defaultGraph";case Lr:return cu.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 Ya},literal:function(t,e){if("string"!=typeof t&&!e)return go.fromValue(t);var n="string"==typeof t?t:""+t;return"string"==typeof e?-1===e.indexOf(":")?new go(n,e):new go(n,null,this.namedNode(e)):new go(n,null,e)},namedNode:function(t){return new po(t)},quad:function(t,e,n,i){return new Ya(t,e,n,i||lu)},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 Mr:return"_:"+t.value;case Br:return"";case Hr:return"<http://www.w3.org/1999/02/22-rdf-syntax-ns#nil>";case Ur:return go.toNT(t);case Jr:case Dr:return"<"+t.value+">";case $r: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 cu(t)}},du=function(){},fu=function(){},pu=function(){},vu=function(){};function gu(t,e){var n=e||{namedNode:function(t){return new po(t)}};return function(e){return n.namedNode(t+(e||""))}}var mu=qt(yr());function wu(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 bu(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})),yu(t,e,n,i)}function yu(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 u=[];for(r=t.attributes.length-1;r>=0;r--){var c=t.attributes[r];if(!(i&&i.length>0&&i[c.name]||/^\d+$/.test(c.name))){if("class"===c.name&&e&&e.replaceClassItemWith&&c.value.split(" ").indexOf(e.replaceClassItemWith.source)>-1){var l=new RegExp(e.replaceClassItemWith.source,"g");c.value=c.value.replace(l,e.replaceClassItemWith.target).trim()}"class"===c.name&&e&&e.skipClassWithValue&&e.skipClassWithValue===c.value||u.push(c.name+"='"+c.value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,""")+"'")}}if(u.length>0&&(e&&e.sortAttributes&&u.sort((function(t,e){return t.toLowerCase().localeCompare(e.toLowerCase())})),o+=" "+u.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+=yu(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,"&").replace(/</g,"<").replace(/>/g,">")}else console.log("Warning; Cannot handle serialising nodes of type: "+t.nodeType),console.log(t);return o}function xu(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 ku(e,n){return n=n||{},t&&t.exports?(new mu.DOMParser).parseFromString(e,n.contentType||"application/xhtml+xml"):("undefined"!=typeof window&&window.DOMParser?new window.DOMParser:new mu.DOMParser).parseFromString(e,"application/xml")}function Su(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 Eu(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:hu;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")}}Eu(hu);var Fu=qt(xr()),Au=function(){function t(e){Er(this,t),Or(this,"_notQNameChars","\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~"),Or(this,"_notNameChars",this._notQNameChars+":"),Or(this,"validPrefix",new RegExp(/^[a-zA-Z][a-zA-Z0-9]*$/)),Or(this,"forbidden1",new RegExp(/[\\"\b\f\r\v\t\n\u0080-\uffff]/gm)),Or(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,Fu.default)());for(var i in n){var r=(0,Fu.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||hu,this.xsd=Eu(this.rdfFactory)}return Ir(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:"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 u=[];for(var c in n)if(n.hasOwnProperty(c)){var l=this.fromStr(c);"BlankNode"===l.termType&&e[l]&&1===e[l].length||u.push(l)}this.incoming=e;for(var h={},d=0;d<u.length;d++)h[u[d].toNT()]=!0;return{roots:u,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?ou(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,u=o.sym(i+"nill"),c=a.length-1;c>=0;c--){var l=s.blankNode();n+=t(l)+" "+t(o.sym(i+"first"))+" "+t(a[c])+".\n",n+=t(l)+" "+t(o.sym(i+"rest"))+" "+t(u)+".\n",u=l}return r.atomicTermToN3(u)},u=0;u<e.length;u++){var c=e[u],l="";l+=a(c.subject)+" ",l+=a(c.predicate)+" ",l+=a(c.object)+" ",this.flags.indexOf("q")>=0&&(l+=a(c.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 xu(t.subject,e.subject,n,i)||xu(t.predicate,e.predicate,n,i)||xu(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(u(n[r],e));return i}.bind(this);function u(t,e){return"BlankNode"!==t.termType||e.incoming[t]?[h(t,e)].concat([c(t,e)]).concat(["."]):l(t,e,!0).concat(["."])}var c=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 u=o[a];u.predicate.uri===i?s.push(","):(i&&(n=n.concat([s]).concat([";"]),s=[]),n.push(r[u.predicate.uri]?r[u.predicate.uri]:h(u.predicate,e))),i=u.predicate.uri,s.push(l(u.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)]?["[",c(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 u=e[a];if("string"!=typeof u){var c=t(u,n+1);if(c.length<10*(80-4*n)&&c.indexOf('"""')<0){var l=s(u);l.length<80-4*n&&(u=l,c="")}c&&(r=1e4),i+=c}if("string"==typeof u){if(1===u.length&&"\n"===i.slice(-1)&&",.;".indexOf(u)>=0){i=i.slice(0,-1)+u+"\n",r+=1;continue}if(r<4*n+4||r+u.length+1<80&&";.".indexOf(i[i.length-2])<0)i=i.slice(0,-1)+" "+u+"\n",r+=u.length+1;else{var h=o(4*n)+u;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);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 u=t[i];'"'===u&&'"""'===o&&'"""'!==t.slice(i,i+3)?a+=u:(r='\b\f\r\t\v\n\\"'.indexOf(u))>=0?a+="\\"+'bfrtvn\\"'[r]:e.indexOf("e")>=0?a+="\\u"+("000"+u.charCodeAt(0).toString(16).toLowerCase()).slice(-4):a+=u,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 u=[];a.map((function(t){u=u.concat(e.statementsMatching(void 0,void 0,void 0,t))})),t(this.statementsToN3(u))}},{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(u(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"&";case"<":return"<";case'"':return"""}}))}var a=function(t){return s(this.base?Za.refTo(this.base,t.uri):t.uri)}.bind(this),u=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),u=parseInt(s,10);return isNaN(a)||isNaN(u)||a!==o||u!==s?i.localeCompare(r):a-u}));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">',u(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">',c(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 c(t,e){for(var n=[],i=0;i<t.elements.length;i++)n.push(u(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">',c(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")?Za.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 u=0;u<e.length;u++){var c=e[u];if("string"!=typeof c){var l=t(c,n+1);l.length<10*(80-4*n)&&l.indexOf('"""')<0&&(o=r(c)).length<80-4*n&&(c=" "+o,l=""),l&&(a=1e4),s+=l}"string"==typeof c&&(a<4*n+4?(s=s.slice(0,-1)+" "+c+"\n",a+=c.length+1):(s+=(o=i(4*n)+c)+"\n",a=o.length))}return s}([f+=">",d,"</rdf:RDF>"],-1)}}]),t}();function _u(t,e,n,i,r,o){n=n||t.value;var s,a,u,c,l,h=o||{};i=i||Zr;try{var d=function(t){return new Au(t)}(e);h.flags&&d.setFlags(h.flags);var f=e.statementsMatching(void 0,void 0,void 0,t);switch(d.suggestNamespaces(e.namespaces),d.setBase(n),i){case Gr:return p(null,d.statementsToXML(f));case Wr:case"application/n3":return p(null,d.statementsToN3(f));case Zr: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 Kr:d.setFlags("deinprstux"),s=d.statementsToNTriples(f),a=r,c=new Oa,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=Da,this._prefixIRIs=Object.create(null),e.prefixes&&this.addPrefixes(e.prefixes),e.baseIRI&&(this._baseMatcher=new RegExp(`^${za(e.baseIRI)}${e.baseIRI.endsWith("/")?"":"[#?]"}`),this._baseLength=e.baseIRI.length))}get _inDefaultGraph(){return Da.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")+(Da.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)),La.test(e)&&(e=e.replace(Ba,Ja));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(La.test(e)&&(e=e.replace(Ba,Ja)),t.language)return`"${e}"@${t.language}`;if(this._lineMode){if(t.datatype.value===Ua.string)return`"${e}"`}else switch(t.datatype.value){case Ua.string:return`"${e}"`;case Ua.boolean:if("true"===e||"false"===e)return e;break;case Ua.integer:if(/^[+-]?\d+$/.test(e))return e;break;case Ua.decimal:if(/^[+-]?\d*\.\d+$/.test(e))return e;break;case Ua.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(e))return e}return`"${e}"^^${this._encodeIriOrBlank(t.datatype)}`}_encodePredicate(t){return t.value===Ma.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,Da,i):this._writeQuad(t,e,n,i||Da,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=za(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 Ha("[]");case 1:if(n=r[0],!(n.object instanceof Ha))return new Ha(`[ ${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 Ha(`${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 Ha(`(${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"}),ua.waterfall([function(t){c.parse(s,(function(e,n){e?t(e):null!==n?l.addQuad(n):l.end(t)}))},function(t,e){try{ca.default.fromRDF(t,{format:"application/nquads"}).then((function(t){e(null,t)}))}catch(t){e(t)}},function(t){u=JSON.stringify(t),a(null,u)}],(function(t){a(t,u)}));break;case Vr:case qr: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 Cu=["blankNode","defaultGraph","literal","namedNode","quad","variable","supports"],ju="http://www.w3.org/1999/02/22-rdf-syntax-ns#rest";function Ru(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(ju),s))):i.push(t.quad(e,t.namedNode(ju),t.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"))),s}),e),i}function Tu(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 Iu(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 Ou(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)?Ou(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 Ou(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 Nu=function(t){_r(r,t);var e,n,i=(e=r,n=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 t,i=Rr(e);if(n){var r=Rr(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return jr(this,t)});function r(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=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]:{};Er(this,r),(t=i.call(this,"")).statements=e,t.constraints=n,t.initBindings=o,t.optional=s,Or(Fr(t),"termType",Jr),Or(Fr(t),"classOrder",Nr.Graph),Or(Fr(t),"fetcher",void 0),Or(Fr(t),"isVar",0),Or(Fr(t),"ns",gu),Or(Fr(t),"rdfFactory",void 0),t.rdfFactory=a&&a.rdfFactory||hu;var u,c=Iu(Cu);try{var l=function(){var e=u.value;t[e]=function(){var n;return(n=t.rdfFactory)[e].apply(n,arguments)}};for(c.s();!(u=c.n()).done;)l()}catch(t){c.e(t)}finally{c.f()}return t}return Ir(r,[{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?Pr.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 wo}},{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 u=0,c=o.length;u<c;u++)r.push(o[u].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 po(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,u,c,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=(u=this.statementsMatching(void 0,a[m])).length;i<e;i++)r[(d=u[i]).subject.toNT()]=d;for(var b=0,y=(c=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,c[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,u=(e=this.statementsMatching(t,void 0,void 0)).length;a<u;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 c=0,l=(n=this.each(o.predicate,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#domain"))).length;c<l;c++)s[n[c].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,u=function(t){var u=function(t){"BlankNode"!==t.termType||r[t.value]||(r[t.value]=!0,i.push(t))},c=a.statementsMatching(null,null,t,e).concat(a.statementsMatching(t,null,null,e));(c=c.filter((function(t){if(n[t.predicate.value])return!1;var e=t.toNT();return!o[e]&&(o[e]=!0,!0)}))).forEach((function(t){u(t.subject),u(t.object)})),s=s.concat(c)};i.length;)u(i.shift());return s}},{key:"formula",value:function(){return new r}},{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 cu(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(no(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=Ru(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){var i,r,o;switch((o=_u(this)).suggestNamespaces(this.ns),o.setBase(t),r=n?this.statementsMatching(void 0,void 0,void 0,n):this.statements,null!=e?e:"text/n3"){case"application/rdf+xml":i=o.statementsToXML(r);break;case"text/n3":case"text/turtle":i=o.statementsToN3(r);break;default:throw new Error("serialize: Content-type "+e+" not supported.")}return 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 r;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&&vu("No value found for the() {"+t+" "+e+" "+n+"}."),r}},{key:"transitiveClosure",value:function(t,e,n){var i,r,o,s,a,u={};Object.assign(u,t);for(var c={};;){if(null==(a=function(){for(var t in u)if(u.hasOwnProperty(t))return t}()))return c;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 c||o in u||(u[o]=u[a]);c[a]=u[a],delete u[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 cu(t)}},{key:"whether",value:function(t,e,n,i){return this.statementsMatching(t,e,n,i,!1).length}}]),r}(Pr);Pr.fromValue=mo;var Pu=Pr,Du={xsd:gu("http://www.w3.org/2001/XMLSchema#")};Pr.toJS=function(t){return ro(t)?t.elements.map(Pr.toJS):ao(t)?t.datatype.equals(Du.xsd("boolean"))?"1"===t.value||"true"===t.value:t.datatype.equals(Du.xsd("dateTime"))||t.datatype.equals(Du.xsd("date"))?new Date(t.value):t.datatype.equals(Du.xsd("integer"))||t.datatype.equals(Du.xsd("float"))||t.datatype.equals(Du.xsd("decimal"))?Number(t.value):t.value:t};var Mu=function t(e,n){Er(this,t),this.pat=new Ku,this.vars=[],this.name=e,this.id=n};function Uu(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&&r.uri===qa?[[[],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,u,c,l,h,d,f,p=[],v=o.length;for(a=0;a<v;a++){for(h in f=[],u=o[a][0])u.hasOwnProperty(h)&&(f[h]=u[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,c=0;c<l;c++){for(h in d=r[c][0],u)u.hasOwnProperty(h)&&(d[h]=u[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 u(t,e){return this.trunkBindings=e,this.originalCallback=t,this.branches=[],this}function c(t,e){return this.count=0,this.success=!1,this.done=!1,this.callback=t,this.onDone=e,this}u.prototype.checkAllDone=function(){var t;for(t=0;t<this.branches.length;t++)if(!this.branches[t].done)return;du("OPTIONAL BIDNINGS ALL DONE:"),this.doCallBacks(this.branches.length-1,this.trunkBindings)},u.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]))},c.prototype.reportMatch=function(t){this.callback(t),this.success=!0},c.prototype.reportDone=function(){this.done=!0,pu("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,u;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 c=i[o];if(c.uri&&c.uri===qa);else if(c.isVar&&void 0===n[c])e.nvars++;else{if(void 0,t.redirections[t.id(c=void 0===(u=n[a=i[o]])?a:u)]&&(c=t.redirections[t.id(c)]),!(r=s[o][t.id(c)]))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(){du("Optional branch finished - results.length = "+this.results.length),0===this.results.length&&(this.results.push({}),du("Optional branch FAILED - that's OK.")),this.done=!0,this.junction.checkAllDone()};var f=function t(n,i,o,s,a,c,h){du("Match begins, Branch count now: "+h.count+" for "+h.pattern_debug);var d,f,p=i.statements;if(0===p.length){if(du("FOUND MATCH WITH BINDINGS:"+r(o)),0===i.optional.length)h.reportMatch(o);else{du("OPTIONAL: "+i.optional);var g,m=new u(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 du("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,u){r||console.log("Error following link to <"+e.uri+"> in query: "+u),t(n,i,o,s,a,c,h)}))};for(f=0;f<b;f++){if(void 0!==o[(d=p[f]).subject]&&o[d.subject].uri&&a&&"unrequested"===a.getState(tu(o[d.subject].uri)))return void y(o[d.subject]);if(void 0!==o[d.object]&&o[d.object].uri&&a&&"unrequested"===a.getState(tu(o[d.object].uri)))return void y(o[d.object])}}v(n,i,o,s,a,c,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,u,c){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 S,E=t.formula();E.optional=e.optional,E.constraints=e.constraints,E.statements=x.slice(1),du(i+"match2 searching "+y.index.length+" for "+y+"; bindings so far="+r(n));var F,A,_=y.index.length,C=0;for(S=0;S<_;S++)for(F=s([y.subject,y.predicate,y.object,y.why],[(A=y.index[S]).subject,A.predicate,A.object,A.why],n,t),pu(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]);c.count++,C++,f(t,E,w,i+" ",a,u,c)}else du("Branch count CS: "+c.count);c.count--,0===C&&du("Match2 fails completely on "+y),du("Match2 ends, Branch count: "+c.count+" for "+c.pattern_debug),0===c.count&&(du("Branch finished."),c.reportDone())},g=this;du("Query on "+this.statements.length);var m=new c(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 Lu(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 Bu(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)?Bu(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 Bu(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 $u="http://www.w3.org/2002/07/owl#";function Hu(t,e,n,i){var r=t.any(e,n,void 0);return!!r&&(t.equate(r,i),!0)}function Ju(t,e,n,i){var r=t.any(void 0,n,i);return!!r&&(t.equate(r,e),!0)}function zu(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 Ku=function(t){_r(r,t);var e,n,i=(e=r,n=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 t,i=Rr(e);if(n){var r=Rr(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return jr(this,t)});function r(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Er(this,r),Or(Fr(e=i.call(this,void 0,void 0,void 0,void 0,n)),"updater",void 0),Or(Fr(e),"namespaces",void 0),Or(Fr(e),"classActions",void 0),Or(Fr(e),"propertyActions",void 0),Or(Fr(e),"redirections",void 0),Or(Fr(e),"aliases",void 0),Or(Fr(e),"HTTPRedirects",void 0),Or(Fr(e),"subjectIndex",void 0),Or(Fr(e),"predicateIndex",void 0),Or(Fr(e),"objectIndex",void 0),Or(Fr(e),"whyIndex",void 0),Or(Fr(e),"index",void 0),Or(Fr(e),"features",void 0),Or(Fr(e),"_universalVariables",void 0),Or(Fr(e),"_existentialVariables",void 0),Or(Fr(e),"rdfArrayRemove",void 0),Or(Fr(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=n.rdfArrayRemove||Su,n.dataCallback&&(e.dataCallbacks=[n.dataCallback]),e.initPropertyActions(e.features),e}return Ir(r,[{key:"substitute",value:function(t){var e=this.statements.map((function(e){return e.substitute(t)})),n=new r;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=[],u=(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 "));u.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 Mu("patch");a.pat=t.where,a.pat.statements.map((function(t){t.graph=Yc(e.value)})),a.sync=!0;var u=[];r.query(a,(function(t){u.push(t)}),r.fetcher,(function(){return 0===u.length?n("No match found to be patched:"+t.where):u.length>1?n("Patch ambiguous. No patch done."):(o=u[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"))]=[zu],Tu(t,"sameAs")>=0&&(this.propertyActions[this.rdfFactory.id(this.rdfFactory.namedNode("".concat($u,"sameAs")))]=[function(t,e,n,i){return t.equate(e,i),!0}]),Tu(t,"InverseFunctionalProperty")>=0&&(this.classActions[this.rdfFactory.id(this.rdfFactory.namedNode("".concat($u,"InverseFunctionalProperty")))]=[function(t,e){return t.newPropertyAction(e,Ju)}]),Tu(t,"FunctionalProperty")>=0&&(this.classActions[this.rdfFactory.id(this.rdfFactory.namedNode("".concat($u,"FunctionalProperty")))]=[function(t,e){return t.newPropertyAction(e,Hu)}])}},{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 uo(t)?this.add(t.subject,t.predicate,t.object,t.graph):io(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=Pu.fromValue(e);var a=Pu.fromValue(n);if(i=Pu.fromValue(i),!lo(t))throw new Error("Subject is not a subject type");if(!ho(e))throw new Error("Predicate ".concat(e," is not a predicate type"));if(!oo(a))throw new Error("Object ".concat(a," is not an object type"));if(!fo(i))throw new Error("Why is not a graph type");this.predicateCallback&&this.predicateCallback(this,e,i);var u=this.id(this.canon(e)),c=!1;if(o=this.propertyActions[u])for(r=0;r<o.length;r++)c=c||o[r](this,t,e,a,i);if(this.holds(t,e,a,i))return null;var l=[this.id(this.canon(t)),u,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=Lu(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 Mr:return new to(t.value);case $r:return t;case Br:return new Va;case Hr:case Jr:return t;case Ur:return new go(t.value,t.language,t.datatype);case Dr:return new po(t.value);case Lr:return new cu(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 u=this.canon(o[a]),c=this.id(u);this.index[a][c]&&s(this.index[a][c],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):Nr[t.termType]<Nr[e.termType]?-1:Nr[t.termType]>Nr[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!==Tu(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!==Tu(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 r(t)}},{key:"length",get:function(){return this.statements.length}},{key:"match",value:function(t,e,n,i){return this.statementsMatching(Pu.fromValue(t),Pu.fromValue(e),Pu.fromValue(n),Pu.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 cu(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 Uu.call(this,t,e,n,i)}},{key:"querySync",value:function(t){var e=[],n=!1;if(t.sync=!0,Uu.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(io(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){"tab"===t&&this.namespaces.tab||"ns"!==t.slice(0,2)&&"default"!==t.slice(0,7)&&(this.namespaces[t]=e)}},{key:"statementsMatching",value:function(t,e,n,i,r){var o,s,a=[t,e,n,i],u=[],c=[],l=[];for(o=0;o<4;o++)u[o]=this.canon(Pu.fromValue(a[o])),u[o]&&(l.push(o),c[o]=this.id(u[o]));if(0===l.length)return this.statements;if(1===l.length)return(s=this.index[o=l[0]][c[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]][c[o]]))return[];s.length<f&&(f=s.length,h=d)}for(var p=l[h],v=this.index[p][c[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(u[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:"defaultGraphURI",get:function(){return qa}}]),r}(Nu);Or(Ku,"handleRDFType",void 0),Ku.handleRDFType=zu;var Wu="http://www.w3.org/2000/10/swap/log#",qu=function(t){return t},Vu=function(t){return t},Gu=function(t){if(t.length>0)throw"missing.js: oops nnonempty dict not imp";return[]},Xu=function(t){return t.length},Yu=function(t,e,n){if(void 0===t.slice)throw"@@ mising.js: No .slice function for "+t+" of type "+Cr(t);return void 0===n||null==n?t.slice(e):t.slice(e,n)},Zu=Error("dummy error stop iteration"),Qu=function(t){return this.last=0,this.li=t,this.next=function(){if(this.last==this.li.length)throw Zu;return this.li[this.last++]},this},tc=function(t,e){return t.indexOf(e)},ec=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 nc,ic=function(t,e){return iu(e,t)},rc="http://www.w3.org/2002/07/owl#sameAs",oc="\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~",sc=oc+":",ac=new RegExp("^([-+]?[0-9]+)(\\.[0-9]+)?(e[-+]?[0-9]+)?","g"),uc=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?"),cc=new RegExp('[\\\\\\r\\n\\"]',"g"),lc=new RegExp("^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*","g"),hc=function(t,e,n,i,r,o,s,a){return new dc(t,e,n,i,r,o,s,a)},dc=function(){function t(e,n,i,r,o,s,a,u){Er(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===u&&(u=null),this._bindings=new Gu([]),this._flags=a,""!=i&&(ec(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 Vu(["a","this","bind","has","is","of","true","false"]),this.keywordsSet=0,this._anonymousNodes=new Gu([]),this._variables=new Gu([]),this._parentVariables=new Gu([]),this._reason=u,this._reason2=null,this._baseURI=r||i||null,ec(!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 Ir(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 fc(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(Tu(this.keywords,t)<0)return-1;var i=n+Xu(t);return e.slice(n,i)==t&&oc.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 Vu([]);if((o=this.tok("bind",t,e))>0)throw fc(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 fc(this._thisDoc,this.lines,t,e,"'@keywords' needs comma separated list of words");return this.setKeywords(Yu(n,null,null)),e}if((o=this.tok("forAll",t,e))>0){if((e=this.commaSeparatedList(t,o,n,!0))<0)throw fc(this._thisDoc,this.lines,t,e,"Bad variable list after @forAll");var i=new Qu(n);try{for(;;){var r=i.next();(Tu(this._variables,r)<0||Tu(this._parentVariables,r)>=0)&&(this._variables[r]=this._context.newUniversal(r))}}catch(t){if(t!=Zu)throw t}return e}if((o=this.tok("forSome",t,e))>0){if((e=this.commaSeparatedList(t,o,n,this.uri_ref2))<0)throw fc(this._thisDoc,this.lines,t,e,"Bad variable list after @forSome");i=new Qu(n);try{for(;;)r=i.next(),this._context.declareExistential(r)}catch(t){if(t!=Zu)throw t}return e}if((o=this.tok("prefix",t,e))>=0){var o,s=new Vu([]);if((e=this.qname(t,o,s))<0)throw fc(this._thisDoc,this.lines,t,o,"expected qname after @prefix");if((o=this.uri_ref2(t,e,s))<0)throw fc(this._thisDoc,this.lines,t,e,"expected <uriref> after @prefix _qname_");var a=s[1].uri;return this._baseURI?a=ic(this._baseURI,a):ec(a.indexOf(":")>=0,"With no base URI, cannot handle relative URI for NS"),ec(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 Vu([]),(e=this.uri_ref2(t,o,s))<0)throw fc(this._thisDoc,this.lines,t,o,"expected <uri> after @base ");if(a=s[0].uri,!this._baseURI)throw fc(this._thisDoc,this.lines,t,o,"With no previous base URI, cannot use relative URI in @base <"+a+">");return a=ic(this._baseURI,a),ec(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 Vu([]);if((e=this.object(t,e,n))<0)return e;var i=this.property_list(t,e,n[0]);if(i<0)throw fc(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 Vu([]);if((r=this.tok("has",t,e))>=0){if((e=this.prop(t,r,i))<0)throw fc(this._thisDoc,this.lines,t,r,"expected property after 'has'");return n.push(new qu(["->",i[0]])),e}if((r=this.tok("is",t,e))>=0){var r;if((e=this.prop(t,r,i))<0)throw fc(this._thisDoc,this.lines,t,r,"expected <property> after 'is'");if((r=this.skipSpace(t,e))<0)throw fc(this._thisDoc,this.lines,t,e,"End of file found, expected property after 'is'");if((r=this.tok("of",t,e=r))<0)throw fc(this._thisDoc,this.lines,t,e,"expected 'of' after 'is' <prop>");return n.push(new qu(["<-",i[0]])),r}if((r=this.tok("a",t,e))>=0)return n.push(new qu(["->",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 qu(["<-",this._store.sym(Wu+"implies")])),e+2;if("="==t.slice(e,e+1))return">"==t.slice(e+1,e+2)?(n.push(new qu(["->",this._store.sym(Wu+"implies")])),e+2):(n.push(new qu(["->",this._store.sym(rc)])),e+1);if(":="==t.slice(e,e+2))return n.push(new qu(["->",Wu+"becomes"])),e+2;if((r=this.prop(t,e,i))>=0)return n.push(new qu(["->",i[0]])),r;if(">-"==t.slice(e,e+2)||"<-"==t.slice(e,e+2))throw fc(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||sc.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 fc(this._thisDoc,this.lines,t,o,"EOF found in middle of path syntax");var u=n.pop();this.makeStatement(new qu("^"==i?[this._context,u,a,s]:[this._context,u,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 fc(this._thisDoc,this.lines,t,e,"EOF after '['");if("="==t.slice(l,l+1)){e=l+1;var a=new Vu([]);if(!((l=this.objectList(t,e,a))>=0))throw fc(this._thisDoc,this.lines,t,e,"objectList expected after [= ");if(r=a[0],Xu(a)>1){var u=new Qu(a);try{for(;;){var c=u.next();this.makeStatement(new qu([this._context,this._store.sym(rc),r,c]))}}catch(t){if(t!=Zu)throw t}}if((l=this.skipSpace(t,l))<0)throw fc(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 fc(this._thisDoc,this.lines,t,l,"property_list expected");if((l=this.skipSpace(t,e))<0)throw fc(this._thisDoc,this.lines,t,e,"EOF when ']' expected after [ <propertyList>");if("]"!=t.slice(l,l+1))throw fc(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 Vu([]),d=!0;;){if((e=this.skipSpace(t,l))<0)throw fc(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 fc(this._thisDoc,this.lines,t,e,"expected: ','");e+=1}var f=new Vu([]);if((l=this.item(t,e,f))<0)throw fc(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 Gu([]),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 fc(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 fc(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 Vu([]);;){if((e=this.skipSpace(t,l))<0)throw fc(this._thisDoc,this.lines,t,e,"needed ')', found end.");if(")"==t.slice(e,e+1)){l=e+1;break}if(f=new Vu([]),(l=this.item(t,e,f))<0)throw fc(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 fc(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((c=this.skipSpace(t,e))<0)throw fc(this._thisDoc,this.lines,t,e,"EOF found when expected verb in property list");if(":-"!=t.slice(c,c+2)){e=c;var i=new Vu([]);if((c=this.verb(t,e,i))<=0)return e;var r=new Vu([]);if((e=this.objectList(t,c,r))<0)throw fc(this._thisDoc,this.lines,t,c,"objectList expected");var o=new Qu(r);try{for(;;){var s=o.next(),a=i[0],u=a[1];this.makeStatement(new qu("->"==a[0]?[this._context,u,n,s]:[this._context,u,s,n]))}}catch(t){if(t!=Zu)throw t}if((c=this.skipSpace(t,e))<0)throw fc(this._thisDoc,this.lines,t,c,"EOF found in list of objects");if(";"!=t.slice(e,e+1))return e;e+=1}else{e=c+2;var c,l=new Vu([]);if((c=this.node(t,e,l,n))<0)throw fc(this._thisDoc,this.lines,t,e,"bad {} or () or [] node after :- ");e=c}}}},{key:"commaSeparatedList",value:function(t,e,n,i){if((r=this.skipSpace(t,e))<0)throw fc(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 fc(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 fc(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 fc(this._thisDoc,this.lines,t,n,"expected '.' or '}' or ']' at end of statement")}},{key:"uri_ref2",value:function(t,e,n){var i=new Vu([]);if((d=this.qname(t,e,i))>=0){var r=i[0],o=r[0],s=r[1];if(null==o){ec(0,"not used?");var a=this._baseURI+"#"}else if(!(a=this._bindings[o])){if("_"==o)return n.push(this.anonymousNode(s)),d;throw fc(this._thisDoc,this.lines,t,e,"Prefix "+o+" not bound.")}var u=this._store.sym(a+s);return Tu(this._variables,u)>=0?n.push(this._variables[u]):n.push(u),d}if((e=this.skipSpace(t,e))<0)return-1;if("?"==t.charAt(e)){var c=new Vu([]);return(d=this.variable(t,e,c))>0?(n.push(c[0]),d):-1}if("<"==t.charAt(e)){for(var l=e+=1;e<Xu(t);){if(">"==t.charAt(e)){var h=t.slice(l,e);return this._baseURI?h=ic(this._baseURI,h):ec(h.indexOf(":")>=0,"With no base URI, cannot deal with relative URIs"),"#"==t.slice(e-1,e)&&"#"!=Yu(h,-1,null)&&(h+="#"),u=this._store.sym(h),Tu(this._variables,u)>=0?n.push(this._variables[u]):n.push(u),e+1}e+=1}throw fc(this._thisDoc,this.lines,t,d,"unterminated URI reference")}if(this.keywordsSet){var d;if(c=new Vu([]),(d=this.bareWord(t,e,c))<0)return-1;if(Tu(this.keywords,c[0])>=0)throw fc(this._thisDoc,this.lines,t,e,'Keyword "'+c[0]+'" not allowed here.');return n.push(this._store.sym(this._bindings[""]+c[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 fc(this._thisDoc,this.lines,t,i,"Varible name can't start with '"+t.charAt(i)+"s'");for(;e<Xu(t)&&sc.indexOf(t.charAt(e))<0;)e+=1;if(null==this._parentContext)throw fc(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(sc.indexOf(r)>=0)return-1;for(e=i;e<Xu(t)&&sc.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(sc.indexOf(i)<0){var r=i;for(e+=1;e<Xu(t)&&(i=t.charAt(e),sc.indexOf(i)<0);)r+=i,e+=1}else r="";if(e<Xu(t)&&":"==t.charAt(e)){var o=r;for(e+=1,r="";e<Xu(t)&&(i=t.charAt(e),sc.indexOf(i)<0);)r+=i,e+=1;return n.push(new qu([o,r])),e}return r&&this.keywordsSet&&Tu(this.keywords,r)<0?(n.push(new qu(["",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+=Xu(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(uc.lastIndex=0,null!=(l=uc.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(ac.lastIndex=0,null==(l=ac.exec(t.slice(e))))throw fc(this._thisDoc,this.lines,t,e,"Bad number or date syntax");(r=t.slice(e,h=e+ac.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+=Xu(o);var s=null,a=this.strconst(t,e,o),u=a[1],c=null;if("@"==t.slice(h=a[0],h+1)){var l;if(lc.lastIndex=0,null==(l=lc.exec(t.slice(h+1))))throw fc(this._thisDoc,startline,t,e,"Bad language code syntax on string literal, after @");c=t.slice(h+1,e=lc.lastIndex+h+1);var h=e}if("^^"==t.slice(h,h+2)){var d=new Vu([]);h=this.uri_ref2(t,h+2,d),s=d[0]}return n.push(this._store.literal(u,c||s)),h}return-1}},{key:"strconst",value:function(t,e,n){for(var i=e,r="",o=this.lines;i<Xu(t);){if(e=i+Xu(n),t.slice(i,e)==n)return new qu([e,r]);if('"'!=t.charAt(i)){if(cc.lastIndex=0,!cc.exec(t.slice(i)))throw fc(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+cc.lastIndex-1),'"'!=(u=t.charAt(e)))if("\r"!=u){if("\n"==u){if('"'==n)throw fc(this._thisDoc,o,t,e,"newline found in string literal");this.lines=this.lines+1,r+=u,i=e+1,this.previousLine=this.startOfLine,this.startOfLine=i}else if("\\"==u){if(!(u=t.slice(i=e+1,i+1)))throw fc(this._thisDoc,o,t,e,"unterminated string literal (2)");var s=tc('abfrtvn\\"',u);if(s>=0)r+='a\b\f\r\t\v\n\\"'.charAt(s),i+=1;else if("u"==u)i=(a=this.uEscape(t,i+1,o))[0],r+=u=a[1];else{if("U"!=u)throw fc(this._thisDoc,this.lines,t,e,"bad escape");var a,u;i=(a=this.UEscape(t,i+1,o))[0],r+=u=a[1]}}}else i=e+1;else i=e}else r=r+'"',i=i+1}throw fc(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 fc(this._thisDoc,n,t,e,"unterminated string literal(3)");var a=tc("0123456789abcdef",s);if(a<0)throw fc(this._thisDoc,n,t,e,"bad string literal hex escape");o=16*o+a,r+=1}var u=String.fromCharCode(o);return new qu([i,u])}},{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 fc(this._thisDoc,n,t,e,"unterminated string literal(3)");if(tc("0123456789abcdef",s)<0)throw fc(this._thisDoc,n,t,e,"bad string literal hex escape");o+=s,r+=1}var a,u=(a="0x"+Yu(o,2,10)-0,String.fromCharCode(a));return new qu([i,u])}}]),t}();function fc(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 pc(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 vc(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?pc(Object(n),!0).forEach((function(e){Or(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):pc(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var gc,mc=vc(vc({},hu),{},{supports:(nc={},Or(nc,su.collections,!0),Or(nc,su.defaultGraphType,!1),Or(nc,su.equalsMethod,!0),Or(nc,su.identity,!1),Or(nc,su.id,!0),Or(nc,su.reversibleId,!1),Or(nc,su.variableType,!0),nc),collection:function(t){return new wo(t)},id:function(t){var e,n=this;return ro(t)?"( ".concat(t.elements.map((function(t){return n.id(t)})).join(", ")," )"):so(e=t)&&e.termType===Lr?cu.toString(t):hu.id(t)},termToNQ:function(t){return t.termType===$r?wo.toNT(t):hu.termToNQ(t)}}),wc=qt(hr());function bc(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 bc(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 bc(t,e)})),r=Ru(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 yc(t,e,n,i){var r=n&&Object.prototype.hasOwnProperty.call(n,"termType")?n.value:n;return wc.default.flatten(JSON.parse(t),null,{base:r}).then((function(t){return t.reduce((function(t,i){for(var r=i["@id"]?e.rdfFactory.namedNode(i["@id"]):e.rdfFactory.blankNode(),o=0,s=Object.keys(i);o<s.length;o++){var a=s[o];if("@id"!==a){var u=i[a];if(Array.isArray(u))for(var c=0;c<u.length;c++)e.addStatement(xc(e,r,a,u[c],n));else e.addStatement(xc(e,r,a,u,n))}}return e}),e)})).then(i).catch(i)}function xc(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=bc(t,i)),t.rdfFactory.quad(e,o,s,t.rdfFactory.namedNode(r))}void 0===gc&&(gc={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 kc=function(){function t(e,n){Er(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 Ir(t,[{key:"addTriple",value:function(t,e,n,i){var r,o,s,a;r=void 0===e?hu.namedNode(this.options.base):this.toRDFNodeObject(e),s=this.toRDFNodeObject(n),o=this.toRDFNodeObject(i),a=hu.namedNode(this.options.base),this.kb.add(r,s,o,a)}},{key:"ancestorPath",value:function(t){for(var e="";t&&t.nodeType!==gc.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?iu(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===gc.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===gc.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 u=s.listMapping[a];if(0!==u.length){for(var c=[],l=0;l<u.length;l++)c.push(this.newBlankNode());for(var h=0;h<c.length;h++)this.addTriple(s.parent,c[h],"http://www.w3.org/1999/02/22-rdf-syntax-ns#first",u[h]),this.addTriple(s.parent,c[h],"http://www.w3.org/1999/02/22-rdf-syntax-ns#rest",{type:t.objectURI,value:h+1<c.length?c[h+1]:"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"});this.addTriple(s.parent,s.subject,a,{type:t.objectURI,value:c[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,S=f.language,E=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:E=A}):E=this.vocabulary}for(var _=0;_<d.attributes.length;_++){var C=d.attributes[_];if("x"===C.nodeName.charAt(0)&&0===C.nodeName.indexOf("xmlns:")){b||(w=this.copyMappings(w),b=!0);var j=C.nodeName.substring(6),R=t.trim(C.value);w[j]=this.options.base?iu(R,this.options.base):R}}var T=d.getAttributeNode("prefix");T&&(b||(w=this.copyMappings(w),b=!0),this.parsePrefixMappings(T.value,w));for(var I=null,O=0;!I&&O<this.langAttributes.length;O++)I=d.getAttributeNodeNS(this.langAttributes[O].namespaceURI,this.langAttributes[O].localName);if(I){var N=t.trim(I.value);S=N.length>0?N:null}var P,D,M=d.getAttributeNode("rel"),U=d.getAttributeNode("rev"),L=d.getAttributeNode("typeof"),B=d.getAttributeNode("property"),$=d.getAttributeNode("datatype"),H=this.inHTMLMode?d.getAttributeNode("datetime"):null,J=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],E,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],E,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===gc.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||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===gc.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!==gc.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],E,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 ut=0;ut<G.length;ut++)y.push({predicate:G[ut],forward:!0});if(U)for(var ct=0;ct<Y.length;ct++)y.push({predicate:Y[ct],forward:!1})}if(B){var lt=null,ht=null;$?(lt=""===$.value?t.PlainLiteralURI:this.parseTermOrCURIEOrAbsURI($.value,E,f.terms,w,i),ht=H&&!J?H.value:lt===t.XMLLiteralURI||lt===t.HTMLLiteralURI?null:J?J.value:d.textContent):J?(lt=t.PlainLiteralURI,ht=J.value):H?(lt=t.deriveDateTimeType(ht=H.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],E,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:S})}else this.addTriple(d,v,ft,lt===t.XMLLiteralURI||lt===t.HTMLLiteralURI?{type:lt,value:d.childNodes}:{type:lt||t.PlainLiteralURI,value:ht,language:S})}}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=S,gt.prefixes=w,gt.vocabulary=E):((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=S,gt.vocabulary=E),k&&r.unshift({parent:d,context:f,subject:mt,listMapping:x});for(var wt=d.lastChild;wt;wt=wt.previousSibling)wt.nodeType===gc.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 iu(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 to(e.substring(2))),this.blankNodes[e.substring(2)]):hu.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 to(e.value.substring(2))),this.blankNodes[e.value.substring(2)]):hu.namedNode(e.value);case t.PlainLiteralURI:return new go(e.value,e.language||"");case t.XMLLiteralURI:case t.HTMLLiteralURI:var i="";return Object.keys(e.value).forEach((function(t){i+=bu(e.value[t],n.htmlOptions)})),new go(i,"",new po(e.type));default:return new go(e.value,"",new po(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}();kc.XMLLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral",kc.HTMLLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML",kc.PlainLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral",kc.objectURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#object",kc.typeURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",kc.nameChar="[-A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�က0-F.0-9·̀-ͯ‿-⁀]",kc.nameStartChar="[A-Za-zÀ-ÖØ-öø-ÿĀ-ıĴ-ľŁ-ňŊ-žƀ-ǃǍ-ǰǴ-ǵǺ-ȗɐ-ʨʻ-ˁΆΈ-ΊΌΎ-ΡΣ-ώϐ-ϖϚϜϞϠϢ-ϳЁ-ЌЎ-яё-ќў-ҁҐ-ӄӇ-ӈӋ-ӌӐ-ӫӮ-ӵӸ-ӹԱ-Ֆՙա-ֆא-תװ-ײء-غف-يٱ-ڷں-ھۀ-ێې-ۓەۥ-ۦअ-हऽक़-ॡঅ-ঌএ-ঐও-নপ-রলশ-হড়-ঢ়য়-ৡৰ-ৱਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઋઍએ-ઑઓ-નપ-રલ-ળવ-હઽૠଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଶ-ହଽଡ଼-ଢ଼ୟ-ୡஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-வஷ-ஹఅ-ఌఎ-ఐఒ-నప-ళవ-హౠ-ౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹೞೠ-ೡഅ-ഌഎ-ഐഒ-നപ-ഹൠ-ൡก-ฮะา-ำเ-ๅກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ຮະາ-ຳຽເ-ໄཀ-ཇཉ-ཀྵႠ-Ⴥა-ჶᄀᄂ-ᄃᄅ-ᄇᄉᄋ-ᄌᄎ-ᄒᄼᄾᅀᅌᅎᅐᅔ-ᅕᅙᅟ-ᅡᅣᅥᅧᅩᅭ-ᅮᅲ-ᅳᅵᆞᆨᆫᆮ-ᆯᆷ-ᆸᆺᆼ-ᇂᇫᇰᇹḀ-ẛẠ-ỹἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼΩK-Å℮ↀ-ↂぁ-ゔァ-ヺㄅ-ㄬ가-힣一-龥〇〡-〩_]",kc.NCNAME=new RegExp("^"+kc.nameStartChar+kc.nameChar+"*$"),kc.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 Sc=kc.parseRDFaDOM,Ec=function(){function t(e){Er(this,t),this.store=e,this.bnodes={},this.why=null,this.reify=!1}return Ir(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=iu(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(iu("#"+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"),u=this.getAttributeNodeNS(o,t.ns.RDF,"datatype");if(u&&(e.datatype=u.nodeValue,o.removeAttributeNode(u)),a){var c=a.nodeValue;"Literal"===c?(e.datatype=t.ns.RDF+"XMLLiteral",(e=this.buildFrame(e)).addLiteral(o.childNodes),r=!1):"Resource"===c?((e=this.buildFrame(e,e.element)).parent.element=null,e.addBNode()):"Collection"===c&&((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(iu(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 u=r[a].nodeValue;this.base&&(u=iu(u,this.base)),this.store.setPrefixForURI(r[a].name.slice(6),u)}n.removeAttributeNode(r[a])}return i}}]),t}();function Fc(t,e,n){var i,r,o,s=["INSERT","DELETE","WHERE"],a=gu("http://www.w3.org/ns/pim/patch#"),u=hc(e,e,n,n,null,null,"",null),c={},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(c.query=h;;){if((r=u.skipSpace(t,i))<0)return c;if(";"===t[r]){if((i=u.skipSpace(t,r+1))<0)return c;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=u.skipSpace(t,r+f.length))<0)throw l(u._thisDoc,u.lines,t,r+f.length,"found EOF, needed {...} after "+f);if(("INSERT"===f||"DELETE"===f)&&"DATA"===t.slice(i,i+4)){if((r=u.skipSpace(t,i+4))<0)throw l(u._thisDoc,u.lines,t,i+4,"needed {...} after INSERT DATA "+f);i=r}var p=[];if((r=u.node(t,i,p))<0)throw l(u._thisDoc,u.lines,t,i,"bad syntax or EOF in {...} after "+f);c[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=u.directive(t,r))<0)throw l(u._thisDoc,u.lines,t,i,"bad syntax or EOF after @prefix ");i=u.checkDot(t,i),d=!0}if(!d)throw l(u._thisDoc,u.lines,t,r,"Unknown syntax at start of statememt: '"+t.slice(r).slice(0,20)+"'")}}function Ac(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||Zr).split(";")[0];try{if(i===Wr||i===Zr){var o=hc(e,e,n,n,null,null,"",null);o.loadBuf(t),u()}else if(i===Gr){var s=new Ec(e);s.parse(ku(t),n,e.sym(n)),u()}else if(i===Qr)Sc(ku(t,{contentType:Qr}),e,n),u();else if(i===zr)Sc(ku(t,{contentType:zr}),e,n),u();else if(i===Xr||i===Yr)Fc(t,e,n),u();else if(i===Kr)yc(t,e,n,u);else{if(i!==Vr&&i!==qr)throw void 0===i?new Error("contentType is undefined"):new Error("Don't know how to parse "+i+" yet");var a=new Oa({factory:mc});l(null,t)}}catch(t){c(t)}function u(){r&&r(null,e)}function c(t){if(i!==Kr||i!==Vr||i!==qr){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)}Ac.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}}Or(Ec,"ns",{RDF:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",RDFS:"http://www.w3.org/2000/01/rdf-schema#"}),Or(Ec,"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 _c=qt(Zt());function Cc(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=Rr(t);if(e){var r=Rr(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return jr(this,n)}}var jc={"text/n3":!0,"text/turtle":!0,"application/rdf+xml":!0,"application/xhtml+xml":!0,"text/html":!0,"application/ld+json":!0},Rc={rdf:Gr,owl:Gr,n3:"text/n3",ttl:"text/turtle",nt:"text/n3",acl:"text/n3",html:"text/html",xml:"text/xml"},Tc=function(t){return{link:gu("http://www.w3.org/2007/ont/link#",t),http:gu("http://www.w3.org/2007/ont/http#",t),httph:gu("http://www.w3.org/2007/ont/httph#",t),rdf:gu("http://www.w3.org/1999/02/22-rdf-syntax-ns#",t),rdfs:gu("http://www.w3.org/2000/01/rdf-schema#",t),dc:gu("http://purl.org/dc/elements/1.1/",t),ldp:gu("http://www.w3.org/ns/ldp#",t)}},Ic=Tc(),Oc=function t(e,n){Er(this,t),Or(this,"response",void 0),Or(this,"dom",void 0),this.response=e,this.dom=n};Or(Oc,"pattern",void 0);var Nc=function(t){_r(n,t);var e=Cc(n);function n(){return Er(this,n),e.apply(this,arguments)}return Ir(n,[{key:"parse",value:function(t,e,n){var i=t.store;if(this.dom||(this.dom=ku(e)),"parsererror"===this.dom.documentElement.nodeName)return t.failFetch(n,"Badly formed XML in "+n.resource.value,"parse_error");var r=new Ec(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,Ic.rdf("type"),Ic.link("RDFDocument"),t.appNode),t.doneFetch(n,this.response)}}],[{key:"toString",value:function(){return"RDFXMLHandler"}},{key:"register",value:function(t){t.mediatypes[Gr]={q:.9}}}]),n}(Oc);Nc.pattern=new RegExp("application/rdf\\+xml");var Pc=function(t){_r(n,t);var e=Cc(n);function n(){return Er(this,n),e.apply(this,arguments)}return Ir(n,[{key:"parse",value:function(t,e,n){var i,r;this.dom||(this.dom=ku(e));var o=t.store,s=this.dom.getElementsByTagName("title");s.length>0&&o.add(n.resource,Ic.dc("title"),o.rdfFactory.literal(s[0].textContent),n.resource);for(var a=this.dom.getElementsByTagName("link"),u=a.length-1;u>=0;u--)r=!1,(i=a[u].getAttribute("rel"))||(i=a[u].getAttribute("rev"),r=!0),i&&t.linkData(n.original,i,a[u].getAttribute("href"),n.resource,r);for(var c=this.dom.getElementsByTagName("script"),l=0;l<c.length;l++){var h=c[l].getAttribute("type");jc[h]&&(Ac(c[l].textContent,o,n.original.value,h),Ac(c[l].textContent,o,n.original.value,h))}if(n.noMeta||o.add(n.resource,Ic.rdf("type"),Ic.link("WebPage"),t.appNode),!n.noRDFa&&Sc)try{Sc(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[Qr]={}}}]),n}(Oc);Pc.pattern=new RegExp("application/xhtml");var Dc=function(t){_r(n,t);var e=Cc(n);function n(){return Er(this,n),e.apply(this,arguments)}return Ir(n,[{key:"parse",value:function(t,e,i){for(var r=ku(e),o=0;o<r.childNodes.length;o++){var s=r.childNodes[o];if(n.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 Nc(this.response,r).parse(t,e,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 Pc(this.response,r).parse(t,e,i);var u=r.getElementsByTagName("html")[0];if(u){var c=u.getAttribute("xmlns");if(c&&c.match(/^http:\/\/www.w3.org\/1999\/xhtml/))return t.addStatus(i.req,"Has a default namespace for XHTML. Switching to XHTMLHandler.\n"),new Pc(this.response,r).parse(t,e,i)}return t.failFetch(i,"Unsupported dialect of XML: not RDF or XHTML namespace, etc.\n"+e.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}}]),n}(Oc);Dc.pattern=new RegExp("(text|application)/(.*)xml");var Mc=function(t){_r(n,t);var e=Cc(n);function n(){return Er(this,n),e.apply(this,arguments)}return Ir(n,[{key:"parse",value:function(t,e,n){var i=t.store;if(Hc(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 Pc(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 Pc(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 Pc(this.response).parse(t,e,n);var r=new RegExp("<title>([\\s\\S]+?)</title>","im").exec(e);return r&&i.add(n.resource,Ic.dc("title"),i.rdfFactory.literal(r[1]),n.resource),i.add(n.resource,Ic.rdf("type"),Ic.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}}}]),n}(Oc);Mc.pattern=new RegExp("text/html");var Uc=function(t){_r(n,t);var e=Cc(n);function n(){return Er(this,n),e.apply(this,arguments)}return Ir(n,[{key:"parse",value:function(t,e,n,i){var r=t.store;return new Promise((function(o){try{yc(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}}}]),n}(Oc);Uc.pattern=/application\/ld\+json/;var Lc=function(t){_r(n,t);var e=Cc(n);function n(){return Er(this,n),e.apply(this,arguments)}return Ir(n,[{key:"parse",value:function(t,e,n){return Hc(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 Dc(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 Dc(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}}}]),n}(Oc);Lc.pattern=new RegExp("text/plain");var Bc=function(t){_r(n,t);var e=Cc(n);function n(){return Er(this,n),e.apply(this,arguments)}return Ir(n,[{key:"parse",value:function(t,e,n,i){var r=t.store,o=hc(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,Ic.rdf("type"),Ic.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}}}]),n}(Oc);Bc.pattern=new RegExp("(application|text)/(x-)?(rdf\\+)?(n3|turtle)");var $c={RDFXMLHandler:Nc,XHTMLHandler:Pc,XMLHandler:Dc,HTMLHandler:Mc,TextHandler:Lc,N3Handler:Bc,JsonLdHandler:Uc};function Hc(t){return!!t.match(/\s*<\?xml\s+version\s*=[^<>]+\?>/)}var Jc=function(){function t(e){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Er(this,t),Or(this,"store",void 0),Or(this,"timeout",void 0),Or(this,"_fetch",void 0),Or(this,"mediatypes",void 0),Or(this,"appNode",void 0),Or(this,"requested",void 0),Or(this,"timeouts",void 0),Or(this,"redirectedTo",void 0),Or(this,"fetchQueue",void 0),Or(this,"fetchCallbacks",void 0),Or(this,"nonexistent",void 0),Or(this,"lookedUp",void 0),Or(this,"handlers",void 0),Or(this,"ns",void 0),Or(this,"fireCallbacks",void 0),this.store=e||new Ku,this.ns=Tc(this.store.rdfFactory),this.timeout=i.timeout||3e4,this._fetch=i.fetch||void 0!==kt&&(kt.solidFetcher||kt.solidFetch)||"undefined"!=typeof window&&(window.solidFetcher||window.solidFetch)||_c.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}},wu(this,["request","fail","refresh","retract","done"]),Object.keys(i.handlers||$c).map((function(t){return n.addHandler($c[t])}))}var e,n;return Ir(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=eo(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 _c.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 _c.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 _c.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=eo(t);"function"==typeof e?n=e:void 0===e||(co(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"));ro(r)?r.append(i.rdfFactory.literal(e)):fu("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[tu(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(iu(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":iu(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),u=s[1].match(i);if(null==u)return;for(var c=0;c<u.length;c++){var l=u[c].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=eo(t),r=new po(i).doc();return n.contentType=n["content-type"]||n["Content-Type"]||n.contentType||Zr,"application/ld+json"===n.contentType?new Promise((function(i,o){_u(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=_u(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=Wa.default.mark((function t(e){var n,i,r,o,s=arguments;return Wa.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=s.length>1&&void 0!==s[1]?s[1]:Zr,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){Ka(o,i,r,s,a,"next",t)}function a(t){Ka(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":Zr,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=eo(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=eo(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 tu(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 u=n.each(a,this.ns.httph(e.toLowerCase()));return u.length?u.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),co(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 po("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(tu(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[tu(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=nu,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 u=n.any(a,n.rdfFactory.namedNode("http://www.w3.org/2007/ont/http#status"));if(!u)break;if("301"!==u&&"302"!==u)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),u=this.normalizedContentType(n,o)||"",c=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(c&&(h=iu(c,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=u.includes("image/")||u.includes("application/pdf");u&&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(c){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(u,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 Rc[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=ru(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),fu("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=ru(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 zc(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 Kc(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?zc(Object(n),!0).forEach((function(e){Or(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):zc(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}Or(Jc,"HANDLERS",void 0),Or(Jc,"CONTENT_TYPE_BY_EXT",void 0),Or(Jc,"crossSiteProxyTemplate",void 0),Jc.HANDLERS=$c,Jc.CONTENT_TYPE_BY_EXT=Rc;var Wc,qc=Kc(Kc({},mc),{},{fetcher:function(t,e){return new Jc(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 Ku(t,e||{rdfFactory:mc})},lit:function(t,e,n){return this.literal(""+t,e||n)},st:function(t,e,n,i){return this.quad(t,e,n,i)}}),Vc={};for(Wc in qc)"function"==typeof qc[Wc]&&(Vc[Wc]=qc[Wc].bind(qc));var Gc=Vc.fetcher,Xc=Vc.graph,Yc=Vc.namedNode;new Nu;var Zc=(t,e)=>{const n=t[e.predicate.uri];return{...t,[e.predicate.uri]:n?[...n,e.object.value]:[e.object.value]}},Qc=class{constructor(){this.session=new Sr,this.store=new class{constructor(t){this.graph=Xc(),this.fetcher=Gc(this.graph,{fetch:t.authenticatedFetch})}fetch(t){return this.fetcher.load(Yc(t),{force:!0})}get(t){return new class{constructor(t,e){this.uri=t,this.store=e}label(){return this.anyValue("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://www.w3.org/2006/vcard/ns#fn","http://schema.org/caption","https://schema.org/caption")??this.uri}literals(){const t=this.store.statementsMatching(Yc(this.uri)).filter((t=>ao(t.object))).reduce(Zc,{});return Object.keys(t).map((e=>({predicate:e,values:t[e]})))}relations(){const t=this.store.statementsMatching(Yc(this.uri)).filter((t=>co(t.object))).reduce(Zc,{});return Object.keys(t).map((e=>({predicate:e,uris:t[e]})))}anyValue(...t){let e;return t.some((t=>(e=this.store.anyValue(Yc(this.uri),Yc(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")}}(t,this.graph)}}(this.session)}handleIncomingRedirect(){this.session.handleIncomingRedirect()}fetch(t){return this.store.fetch(t)}trackSession(t){return this.session.trackSession(t)}logout(){return this.session.logout()}login(t="http://localhost:3000"){return this.session.login(t)}}})();
|
|
2
|
-
/*!
|
|
3
|
-
* The buffer module from node.js, for the browser.
|
|
4
|
-
*
|
|
5
|
-
* @author Feross Aboukhadijeh <http://feross.org>
|
|
6
|
-
* @license MIT
|
|
7
|
-
*/
|
|
8
|
-
/*!
|
|
9
|
-
Copyright (c) 2011, Yahoo! Inc. All rights reserved.
|
|
10
|
-
Code licensed under the BSD License:
|
|
11
|
-
http://developer.yahoo.com/yui/license.html
|
|
12
|
-
version: 2.9.0
|
|
13
|
-
*/
|
|
14
|
-
/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
|
|
15
|
-
*/
|
|
16
|
-
/*! CryptoJS v3.1.2 core-fix.js
|
|
17
|
-
* code.google.com/p/crypto-js
|
|
18
|
-
* (c) 2009-2013 by Jeff Mott. All rights reserved.
|
|
19
|
-
* code.google.com/p/crypto-js/wiki/License
|
|
20
|
-
* THIS IS FIX of 'core.js' to fix Hmac issue.
|
|
21
|
-
* https://code.google.com/p/crypto-js/issues/detail?id=84
|
|
22
|
-
* https://crypto-js.googlecode.com/svn-history/r667/branches/3.x/src/core.js
|
|
23
|
-
*/
|
|
24
|
-
/*! Mike Samuel (c) 2009 | code.google.com/p/json-sans-eval
|
|
25
|
-
*/
|
|
26
|
-
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
27
|
-
/*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
28
|
-
/**
|
|
29
|
-
* A JavaScript implementation of the JSON-LD API.
|
|
30
|
-
*
|
|
31
|
-
* @author Dave Longley
|
|
32
|
-
*
|
|
33
|
-
* @license BSD 3-Clause License
|
|
34
|
-
* Copyright (c) 2011-2019 Digital Bazaar, Inc.
|
|
35
|
-
* All rights reserved.
|
|
36
|
-
*
|
|
37
|
-
* Redistribution and use in source and binary forms, with or without
|
|
38
|
-
* modification, are permitted provided that the following conditions are met:
|
|
39
|
-
*
|
|
40
|
-
* Redistributions of source code must retain the above copyright notice,
|
|
41
|
-
* this list of conditions and the following disclaimer.
|
|
42
|
-
*
|
|
43
|
-
* Redistributions in binary form must reproduce the above copyright
|
|
44
|
-
* notice, this list of conditions and the following disclaimer in the
|
|
45
|
-
* documentation and/or other materials provided with the distribution.
|
|
46
|
-
*
|
|
47
|
-
* Neither the name of the Digital Bazaar, Inc. nor the names of its
|
|
48
|
-
* contributors may be used to endorse or promote products derived from
|
|
49
|
-
* this software without specific prior written permission.
|
|
50
|
-
*
|
|
51
|
-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
|
52
|
-
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
53
|
-
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
|
54
|
-
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
55
|
-
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
56
|
-
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
|
57
|
-
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
58
|
-
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
59
|
-
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
60
|
-
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
61
|
-
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
62
|
-
*/
|
|
63
|
-
/**
|
|
64
|
-
* Removes the @preserve keywords from expanded result of framing.
|
|
65
|
-
*
|
|
66
|
-
* @param input the framed, framed output.
|
|
67
|
-
* @param options the framing options used.
|
|
68
|
-
*
|
|
69
|
-
* @return the resulting output.
|
|
70
|
-
*/
|
|
71
|
-
// disallow aliasing @context and @preserve
|
|
72
|
-
// remove @preserve
|
|
73
|
-
// remove @preserve from results
|
|
74
|
-
}(xt={path:undefined,exports:{},require:function(){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}}),xt.exports);const Et=class{constructor(e){t(this,e)}componentWillLoad(){this.os=new St.PodOS,this.os.handleIncomingRedirect(),this.os.trackSession((t=>{yt.state.isLoggedIn=t.isLoggedIn,yt.state.webId=t.webId}))}async initializeOs(t){t.stopPropagation(),t.detail(this.os)}render(){return e("ion-app",null,e("slot",null))}},Ft=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("img",{src:"https://dummyimage.com/250/ffffff/000000"}),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))))}},At=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"},"pod os"),e("pos-login",null))),e("ion-content",null,e("pos-router",null)),e("ion-footer",null,e("ion-toolbar",null,e("ion-title",null,"Footer"))))}},_t=class{constructor(e){t(this,e),this.getResource=r(this,"pod-os:resource",7),this.setResource=async t=>{this.resource=t}}componentWillLoad(){this.getResource.emit(this.setResource)}render(){return this.resource?this.resource.description():null}},Ct=class{constructor(e){t(this,e),this.getResource=r(this,"pod-os:resource",7),this.setResource=async t=>{this.resource=t}}componentWillLoad(){this.getResource.emit(this.setResource)}render(){return this.resource?this.resource.label():null}},jt=class{constructor(e){t(this,e),this.getResource=r(this,"pod-os:resource",7),this.data=[],this.setResource=async t=>{this.data=t.literals()}}componentWillLoad(){this.getResource.emit(this.setResource)}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}},Rt=class{constructor(e){t(this,e),this.initializeOsEmitter=r(this,"pod-os:init",7),this.setOs=async t=>{this.os=t}}componentWillLoad(){this.initializeOsEmitter.emit(this.setOs)}login(){const t=yt.state.getIdpUrl();this.os.login(t)}logout(){this.os.logout()}render(){return e(n,null,yt.state.isLoggedIn?e("pos-resource",{uri:yt.state.webId},e("pos-label",null)):"",!yt.state.isLoggedIn&&e("ion-button",{onClick:()=>this.login()},"Login"),yt.state.isLoggedIn&&e("ion-button",{onClick:()=>this.logout()},"Logout"))}},Tt=class{constructor(e){t(this,e),this.getResource=r(this,"pod-os:resource",7),this.data=[],this.setResource=async t=>{this.data=t.relations()}}componentWillLoad(){this.getResource.emit(this.setResource)}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}},It=class{constructor(e){t(this,e),this.initializeOsEmitter=r(this,"pod-os:init",7),this.consumers=[],this.lazy=!1,this.loading=!0,this.setOs=async t=>{this.os=t}}componentWillLoad(){yt.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("div",null,this.error.message):e("slot",null)}static get watchers(){return{os:["loadResource"],uri:["loadResource"]}}},Ot=class{constructor(e){t(this,e),this.getResource=r(this,"pod-os:resource",7),this.data=[],this.setResource=async t=>{this.data=t.reverseRelations()}}componentWillLoad(){this.getResource.emit(this.setResource)}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}},Nt=class{constructor(e){t(this,e),this.linkEmitter=r(this,"pod-os:link",7)}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)))))}},Pt=(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}},Dt=(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}}},Mt=t=>t.pathname.toLowerCase(),Ut=new RegExp(["(\\\\.)","(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?"].join("|"),"g"),Lt=t=>t.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),Bt=t=>t.replace(/([=!:$/()])/g,"\\$1"),$t=t=>t&&t.sensitive?"":"i",Ht=(t,e,n)=>{for(var i=(n=n||{}).strict,r=!1!==n.end,o=Lt(n.delimiter||"/"),s=n.delimiters||"./",a=[].concat(n.endsWith||[]).map(Lt).concat("$").join("|"),u="",c=!1,l=0;l<t.length;l++){var h=t[l];if("string"==typeof h)u+=Lt(h),c=l===t.length-1&&s.indexOf(h[h.length-1])>-1;else{var d=Lt(h.prefix||""),f=h.repeat?"(?:"+h.pattern+")(?:"+d+"(?:"+h.pattern+"))*":h.pattern;e&&e.push(h),u+=h.optional?h.partial?d+"("+f+")?":"(?:"+d+"("+f+"))?":d+"("+f+")"}}return r?(i||(u+="(?:"+o+")?"),u+="$"===a?"$":"(?="+a+")"):(i||(u+="(?:"+o+"(?="+a+"))?"),c||(u+="(?="+o+"|"+a+")")),new RegExp("^"+u,$t(n))},Jt=(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(Jt(t[r],e,n).source);return new RegExp("(?:"+i.join("|")+")",$t(n))})(t,e,n):((t,e,n)=>Ht(((t,e)=>{for(var n,i=[],r=0,o=0,s="",a=e&&e.delimiter||"/",u=e&&e.delimiters||"./",c=!1;null!==(n=Ut.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],c=!0;else{var f="",p=t[o],v=n[2],g=n[3],m=n[4],w=n[5];if(!c&&s.length){var b=s.length-1;u.indexOf(s[b])>-1&&(f=s[b],s=s.slice(0,b))}s&&(i.push(s),s="",c=!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?Bt(x):"[^"+Lt(y)+"]+?"})}}return(s||o<t.length)&&i.push(s+t.substr(o)),i})(t,n),e,n))(t,e,n);let zt=0;const Kt={},Wt=(t,e={})=>{const{exact:n=!1,strict:i=!1}=e,{re:r,keys:o}=((t,e)=>{const n=`${e.end}${e.strict}`,i=Kt[n]||(Kt[n]={}),r=JSON.stringify(t);if(i[r])return i[r];const o=[],s={re:Jt(t,o,e),keys:o};return zt<1e4&&(i[r]=s,zt+=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)),{})}},qt=(()=>{const t=window,e=new URL(t.location.href),n=(void 0,Mt),{state:i,onChange:r,dispose:o}=bt({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=Dt(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}}}},u=()=>{const e=new URL(t.location.href);i.url=e,i.activePath=n(e)},c={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",u),o()}};return u(),t.addEventListener("popstate",u),c})(),Vt=class{constructor(e){t(this,e)}linkClicked(t){this.navigate(t.detail)}componentWillLoad(){this.updateUri(),qt.onChange("url",(()=>{this.updateUri()}))}navigate(t){qt.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(qt.Switch,null,e(Pt,{path:Wt("",{exact:!1})},e("pos-resource",{key:this.uri,uri:this.uri},e("pos-app-generic",null))))}};export{y as ion_app,S as ion_button,E as ion_card,F as ion_card_content,A as ion_card_header,_ as ion_card_title,O as ion_col,N as ion_content,M as ion_footer,U as ion_grid,J as ion_header,Q as ion_icon,nt as ion_item,it as ion_item_divider,rt as ion_item_group,ot as ion_label,st as ion_list,at as ion_progress_bar,lt as ion_ripple_effect,pt as ion_row,vt as ion_title,gt as ion_toolbar,Et as pos_app,Ft as pos_app_generic,At as pos_demo_app,_t as pos_description,Ct as pos_label,jt as pos_literals,Rt as pos_login,Tt as pos_relations,It as pos_resource,Ot as pos_reverse_relations,Nt as pos_rich_link,Vt as pos_router}
|