@chillicream/nitro-embedded 31.0.0 → 32.0.0-insider.7
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/assets/{context-providers.3bb3e100.FKi0_TO-.js → context-providers.3d52dae0.CDo0K4_6.js} +4 -4
- package/assets/{editor.worker.3bb3e100.Bohx8jEU.js → editor.worker.3d52dae0.BRRUfNgJ.js} +1 -1
- package/assets/{graphql-engine-scheduler.3bb3e100.DVQyu7AR.js → graphql-engine-scheduler.3d52dae0.Dm0EX7GT.js} +3 -3
- package/assets/{graphql-indexer-scheduler.3bb3e100.CqhPLZWs.js → graphql-indexer-scheduler.3d52dae0.CqbXhOeL.js} +3 -3
- package/assets/{graphql.worker.3bb3e100.oIw_tk8e.js → graphql.worker.3d52dae0.CdlCLxPV.js} +3 -3
- package/assets/{index.3bb3e100.C48yzvhN.js → index.3d52dae0.Dps7WlPI.js} +1 -1
- package/assets/{json.worker.3bb3e100.CMFoC_r4.js → json.worker.3d52dae0.DKYOvew3.js} +1 -1
- package/assets/{jsonMode.3bb3e100.MJblKPy4.js → jsonMode.3d52dae0.BDY0lA7q.js} +1 -1
- package/assets/{main.3bb3e100.DR3PUywM.js → main.3d52dae0.CdFA2yRd.js} +11 -11
- package/assets/{monaco.3bb3e100.YGWcjMGm.css → monaco.3d52dae0.BhrLoHHZ.css} +1 -1
- package/assets/{monaco.3bb3e100.Dv4YZyNQ.css → monaco.3d52dae0.qSiNq0Ps.css} +1 -1
- package/assets/{monaco.3bb3e100.1ZTTp31h.js → monaco.3d52dae0.u3wdT8ro.js} +2 -2
- package/assets/{session-scheduler.3bb3e100.CwqEb4vy.js → session-scheduler.3d52dae0.CX7ebmjY.js} +3 -3
- package/assets/{yaml.3bb3e100.Ck0DN8AF.js → yaml.3d52dae0.t0sfaowD.js} +1 -1
- package/assets/{yaml.worker.3bb3e100.CUuB4G2M.js → yaml.worker.3d52dae0.o-AnIqAF.js} +1 -1
- package/favicon.ico +0 -0
- package/favicon.svg +4 -4
- package/index.html +4 -4
- package/package.json +1 -1
- package/service-worker.js +1 -1
- /package/assets/{FiraCode-Medium.3bb3e100.-YTCSZkP.woff2 → FiraCode-Medium.3d52dae0.-YTCSZkP.woff2} +0 -0
- /package/assets/{codicon.3bb3e100.Hscy-R9e.ttf → codicon.3d52dae0.Hscy-R9e.ttf} +0 -0
- /package/assets/{context-providers.3bb3e100.3HkX5s82.css → context-providers.3d52dae0.3HkX5s82.css} +0 -0
- /package/assets/{main.3bb3e100.BdMtxJz7.css → main.3d52dae0.BdMtxJz7.css} +0 -0
- /package/assets/{monaco.3bb3e100.BcYI0mkj.js → monaco.3d52dae0.BJ8Ek4T9.js} +0 -0
- /package/assets/{monaco.3bb3e100.30sXCQqu.js → monaco.3d52dae0.BRaHXvjk.js} +0 -0
- /package/assets/{monaco.3bb3e100.C736ncm0.js → monaco.3d52dae0.BW9gIsDr.js} +0 -0
- /package/assets/{monaco.3bb3e100.CVK0TB_r.js → monaco.3d52dae0.CQSn52En.js} +0 -0
- /package/assets/{monaco.3bb3e100.5FsXw5iS.js → monaco.3d52dae0.DxipQGKs.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./context-providers.
|
|
2
|
-
import{p as process$1,B as Buffer$1,l as languages,a as Buffer,U as Uri,e as editor,_ as __vitePreload}from"./monaco.
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./context-providers.3d52dae0.CDo0K4_6.js","./monaco.3d52dae0.u3wdT8ro.js","./monaco.3d52dae0.BhrLoHHZ.css","./context-providers.3d52dae0.3HkX5s82.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{p as process$1,B as Buffer$1,l as languages,a as Buffer,U as Uri,e as editor,_ as __vitePreload}from"./monaco.3d52dae0.u3wdT8ro.js";function _mergeNamespaces(on,In){for(var Rn=0;Rn<In.length;Rn++){const Mn=In[Rn];if(typeof Mn!="string"&&!Array.isArray(Mn)){for(const Ln in Mn)if(Ln!=="default"&&!(Ln in on)){const Hn=Object.getOwnPropertyDescriptor(Mn,Ln);Hn&&Object.defineProperty(on,Ln,Hn.get?Hn:{enumerable:!0,get:()=>Mn[Ln]})}}}return Object.freeze(Object.defineProperty(on,Symbol.toStringTag,{value:"Module"}))}(function(){const In=document.createElement("link").relList;if(In&&In.supports&&In.supports("modulepreload"))return;for(const Ln of document.querySelectorAll('link[rel="modulepreload"]'))Mn(Ln);new MutationObserver(Ln=>{for(const Hn of Ln)if(Hn.type==="childList")for(const jn of Hn.addedNodes)jn.tagName==="LINK"&&jn.rel==="modulepreload"&&Mn(jn)}).observe(document,{childList:!0,subtree:!0});function Rn(Ln){const Hn={};return Ln.integrity&&(Hn.integrity=Ln.integrity),Ln.referrerPolicy&&(Hn.referrerPolicy=Ln.referrerPolicy),Ln.crossOrigin==="use-credentials"?Hn.credentials="include":Ln.crossOrigin==="anonymous"?Hn.credentials="omit":Hn.credentials="same-origin",Hn}function Mn(Ln){if(Ln.ep)return;Ln.ep=!0;const Hn=Rn(Ln);fetch(Ln.href,Hn)}})();var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(on){return on&&on.__esModule&&Object.prototype.hasOwnProperty.call(on,"default")?on.default:on}function getAugmentedNamespace(on){if(Object.prototype.hasOwnProperty.call(on,"__esModule"))return on;var In=on.default;if(typeof In=="function"){var Rn=function Mn(){var Ln=!1;try{Ln=this instanceof Mn}catch{}return Ln?Reflect.construct(In,arguments,this.constructor):In.apply(this,arguments)};Rn.prototype=In.prototype}else Rn={};return Object.defineProperty(Rn,"__esModule",{value:!0}),Object.keys(on).forEach(function(Mn){var Ln=Object.getOwnPropertyDescriptor(on,Mn);Object.defineProperty(Rn,Mn,Ln.get?Ln:{enumerable:!0,get:function(){return on[Mn]}})}),Rn}var jsxRuntime={exports:{}},reactJsxRuntime_production={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.js
|
|
5
5
|
*
|
|
@@ -4227,7 +4227,7 @@ export default theme;`}function coefficientToPercentage(on){return typeof on=="n
|
|
|
4227
4227
|
0px 3px 4px 0px ${THEME_COLORS.base.shadow},
|
|
4228
4228
|
0px 1px 8px 0px ${THEME_COLORS.base.shadow}`}),paperWidthLg:({theme:on})=>({flexBasis:"90%",width:"90%",height:"90%",maxWidth:on.spacing(1140),minHeight:on.spacing(300),maxHeight:on.spacing(980)}),paperWidthMd:({theme:on})=>({flexBasis:"90%",width:"90%",height:"90%",maxWidth:on.spacing(600),minHeight:on.spacing(300),maxHeight:on.spacing(500)}),paperWidthSm:({theme:on})=>({width:"initial",height:"initial",maxWidth:on.spacing(450),minHeight:on.spacing(100),maxHeight:on.spacing(400)})}},MuiDialogActions:{styleOverrides:{root:({theme:on})=>({display:"flex",flex:`0 0 ${on.spacing(60)}`,flexDirection:"row",alignItems:"center",overflow:"hidden",padding:on.spacing(0,20)})}},MuiDialogContent:{styleOverrides:{root:({theme:on})=>({flex:"1 1 auto",flexDirection:"column",overflow:"hidden",padding:on.spacing(0,20),fontWeight:"normal",color:THEME_COLORS.base.subtitle,"&.no-padding":{padding:0},"& > p":{margin:on.spacing(6,0,18)}})}},MuiDialogTitle:{styleOverrides:{root:({theme:on})=>({display:"flex",flex:"1 1 auto",flexDirection:"row",padding:0,fontSize:on.typography.h3.fontSize,fontWeight:500,color:THEME_COLORS.base.heading})}},MuiDivider:{styleOverrides:{root:({theme:on})=>({borderBottomWidth:on.spacing(1),borderColor:THEME_COLORS.base.separator})}},MuiFab:{defaultProps:{size:"small"}},MuiFilledInput:{defaultProps:{margin:"dense"}},MuiFormControl:{defaultProps:{margin:"dense"},styleOverrides:{root:({theme:on})=>({display:"flex",flexDirection:"column",gap:on.spacing(4),margin:0,"& > .MuiFormLabel-root":{fontSize:on.typography.body1.fontSize,lineHeight:on.typography.body1.lineHeight,fontWeight:500,color:THEME_COLORS.components.labelText}})}},MuiFormHelperText:{defaultProps:{margin:"dense"},styleOverrides:{root:{margin:"0 !important",color:THEME_COLORS.components.helperText,"&.Mui-disabled":{color:THEME_COLORS.components.helperText}}}},MuiFormControlLabel:{styleOverrides:{root:({theme:on})=>({display:"flex",alignItems:"center",justifyContent:"space-between",gap:on.spacing(16),margin:0}),label:({theme:on})=>({fontWeight:on.typography.fontWeightMedium,color:THEME_COLORS.components.labelText,"&.Mui-disabled":{color:THEME_COLORS.components.labelText}})}},MuiFormLabel:{styleOverrides:{root:({theme:on})=>({display:"flex",alignItems:"center",gap:on.spacing(8),margin:"0 !important","&.Mui-focused":{color:on.palette.text.primary}})}},MuiGrid:{styleOverrides:{root:{margin:0}}},MuiIconButton:{defaultProps:{color:"secondary",disableRipple:!0,size:"small"},styleOverrides:{root:({theme:on})=>({borderRadius:on.spacing(4),padding:0,transition:"background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease","&.spin > .icon":{animation:`${FULL_ROTATION} 1.2s 0.3s linear infinite`}}),colorSecondary:({theme:on})=>({border:`${on.spacing(1)} solid
|
|
4229
4229
|
${THEME_COLORS.components.buttonIconBorder}`,color:THEME_COLORS.components.buttonIconText,backgroundColor:THEME_COLORS.components.buttonIcon,"&.active":{borderColor:THEME_COLORS.components.toggleButtonActive,color:THEME_COLORS.components.toggleButtonActiveText,backgroundColor:THEME_COLORS.components.toggleButtonActive,"& > .icon":{fill:THEME_COLORS.components.toggleButtonActiveText},"&:hover, &:focus, &.menu-open":{borderColor:THEME_COLORS.components.toggleButton,color:THEME_COLORS.components.toggleButtonText,backgroundColor:THEME_COLORS.components.toggleButton,"& > .icon":{fill:THEME_COLORS.components.toggleButtonText}}},"&:disabled":{pointerEvents:"none",cursor:"default",opacity:.5,"&:hover":{backgroundColor:"initial"}},"&:hover, &:focus, &.menu-open":{borderColor:THEME_COLORS.components.buttonIconHoverBorder,color:THEME_COLORS.components.buttonIconHoverText,backgroundColor:THEME_COLORS.components.buttonIconHover,"& > .icon":{fill:THEME_COLORS.components.buttonIconHoverText}},"& > .icon":{fill:THEME_COLORS.components.buttonIconText}}),colorInherit:({theme:on})=>({border:`${on.spacing(1)} solid
|
|
4230
|
-
${THEME_COLORS.components.buttonIconBorder}`,color:THEME_COLORS.components.buttonIconText,backgroundColor:THEME_COLORS.components.buttonIcon,"&:disabled":{pointerEvents:"none",cursor:"default",opacity:.5,"&:hover":{backgroundColor:"initial"}},"& > .icon":{fill:THEME_COLORS.components.buttonIconText}}),sizeSmall:({theme:on})=>({width:on.spacing(30),height:on.spacing(30)})}},MuiInputAdornment:{styleOverrides:{root:({theme:on})=>({flexShrink:0,justifyContent:"center",margin:0,"&.MuiInputAdornment-sizeSmall":{minWidth:on.spacing(28),minHeight:on.spacing(28),"&.MuiInputAdornment-positionStart":{marginRight:on.spacing(-6)}}})}},MuiInputBase:{defaultProps:{margin:"dense"},styleOverrides:{root:({theme:on})=>({borderRadius:on.spacing(4),height:on.spacing(30),fontSize:on.typography.body1.fontSize,lineHeight:on.typography.body1.lineHeight,backgroundColor:THEME_COLORS.components.field,color:THEME_COLORS.components.fieldText,transition:"background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease","&.MuiInputBase-multiline":{height:"auto"},"&.Mui-disabled, &.Mui-disabled:hover":{backgroundColor:THEME_COLORS.components.fieldDisabled,color:THEME_COLORS.components.fieldDisabledText,"& .MuiInputBase-input::placeholder":{color:THEME_COLORS.components.fieldDisabledPlaceholder}},"&.Mui-focused, &:hover":{backgroundColor:THEME_COLORS.components.fieldHover,color:THEME_COLORS.components.fieldHoverText,"& .MuiInputBase-input::placeholder":{color:THEME_COLORS.components.fieldHoverPlaceholder}},"&.Mui-error":{color:THEME_COLORS.states.failure}}),adornedStart:{"& .icon":{fill:THEME_COLORS.components.fieldText},"&:Mui-disabled .icon":{fill:THEME_COLORS.components.fieldDisabled},"&.Mui-error .icon":{fill:THEME_COLORS.states.failure}},adornedEnd:{"& .icon":{fill:THEME_COLORS.components.fieldText},"&:Mui-disabled .icon":{fill:THEME_COLORS.components.fieldDisabled},"&.Mui-error .icon":{fill:THEME_COLORS.states.failure}},input:({theme:on})=>({height:on.spacing(16),padding:on.spacing(6,8),"&::placeholder":{opacity:1,color:THEME_COLORS.components.fieldPlaceholder,transition:"color 0.2s ease"},"&:autofill":{transitionProperty:"background-color, color",transitionDelay:"86400s"}})}},MuiInputLabel:{defaultProps:{margin:"dense",shrink:!0},styleOverrides:{root:({theme:on})=>({position:"relative",transform:"none",fontSize:on.typography.body1.fontSize,fontWeight:on.typography.fontWeightMedium,color:THEME_COLORS.components.labelText,"&.Mui-focused":{color:THEME_COLORS.components.labelText},"&.Mui-error":{color:THEME_COLORS.states.failure}})}},MuiLinearProgress:{styleOverrides:{root:({theme:on})=>({height:on.spacing(2),"&.impact > .MuiLinearProgress-barColorPrimary":{backgroundColor:THEME_COLORS.chart.impact},"&.impact.MuiLinearProgress-colorPrimary":{backgroundColor:THEME_COLORS.chart.impactBackground}}),barColorPrimary:{backgroundColor:THEME_COLORS.base.spinner},colorPrimary:{backgroundColor:THEME_COLORS.base.separator}}},MuiLink:{styleOverrides:{root:({theme:on})=>({textDecoration:"underline",whiteSpace:"nowrap","& > .icon":{flex:`0 0 ${on.spacing(14)}`,width:on.spacing(14),height:on.spacing(14)},"&:hover":{textDecoration:"none"},"&.MuiTypography-root":{display:"inline-flex",gap:on.spacing(4),alignItems:"center",cursor:"pointer",color:THEME_COLORS.components.linkText+" !important",textDecorationColor:THEME_COLORS.components.linkText+" !important","& > .icon.link":{fill:THEME_COLORS.components.linkText}},"&.MuiTypography-root:hover":{color:THEME_COLORS.components.linkHoverText+" !important",textDecorationColor:THEME_COLORS.components.linkHoverText+" !important","& > .icon.link":{fill:THEME_COLORS.components.linkHoverText}}}),button:{"&.MuiTypography-root, .MuiPaper-root &.MuiTypography-root":{cursor:"pointer",color:THEME_COLORS.components.linkText,textDecorationColor:THEME_COLORS.components.linkText,"& > .icon.link":{fill:THEME_COLORS.components.linkText}},"&.MuiTypography-root:hover":{color:THEME_COLORS.components.linkHoverText,textDecorationColor:THEME_COLORS.components.linkHoverText,"& > .icon.link":{fill:THEME_COLORS.components.linkHoverText}}}}},MuiList:{defaultProps:{dense:!0},styleOverrides:{root:({theme:on})=>({overflow:"visible",padding:on.spacing(0,8),"& .MuiList-root":{padding:on.spacing(0)}})}},MuiListSubheader:{defaultProps:{disableSticky:!0},styleOverrides:{root:({theme:on})=>({padding:on.spacing(4,12),fontSize:on.typography.body2.fontSize,fontWeight:600,lineHeight:on.typography.body2.lineHeight,color:THEME_COLORS.base.textAlt,backgroundColor:"unset"})}},MuiListItemButton:{styleOverrides:{root:({theme:on})=>({display:"flex",alignItems:"center",gap:on.spacing(8),borderRadius:on.spacing(4),height:on.spacing(32),padding:on.spacing(3,12),overflow:"visible",fontSize:on.typography.body1.fontSize,lineHeight:on.typography.body1.lineHeight,backgroundColor:THEME_COLORS.base.tab,"&:hover":{backgroundColor:THEME_COLORS.base.tabHover,"& > .MuiListItemIcon-root > .icon":{fill:THEME_COLORS.base.tabHoverText},"& > .MuiListItemText-root > .MuiListItemText-primary":{color:THEME_COLORS.base.tabHoverText}},"&.Mui-selected":{position:"relative",backgroundColor:THEME_COLORS.base.tabActiveHover,"&:hover":{backgroundColor:THEME_COLORS.base.tabActiveHover,"&::before":{backgroundColor:THEME_COLORS.base.tabActiveHoverBorder},"& > .MuiListItemIcon-root > .icon":{fill:THEME_COLORS.base.tabActiveHoverText},"& > .MuiListItemText-root > .MuiListItemText-primary":{color:THEME_COLORS.base.tabActiveHoverText}},"&::before":{position:"absolute",top:on.spacing(2),bottom:on.spacing(2),left:on.spacing(-8),width:on.spacing(4),pointerEvents:"none",content:'""',borderRadius:on.spacing(2),backgroundColor:THEME_COLORS.base.tabActiveBorder},"& > .MuiListItemIcon-root > .icon":{fill:THEME_COLORS.base.tabActiveText},"& > .MuiListItemText-root > .MuiListItemText-primary":{color:THEME_COLORS.base.tabActiveText}},"& > .MuiListItemIcon-root > .icon":{fill:THEME_COLORS.base.tabText},"& > .MuiListItemText-root > .MuiListItemText-primary":{color:THEME_COLORS.base.tabText}})}},MuiListItemIcon:{styleOverrides:{root:({theme:on})=>({"&.MuiListItemIcon-root":{display:"flex",alignItems:"center",justifyContent:"center",minWidth:on.spacing(16)}})}},MuiListItemText:{styleOverrides:{root:({theme:on})=>({"&.child-selected > .MuiListItemText-primary":{fontWeight:500},"& .MuiListItemText-primary":{display:"flex",flex:"1 1 auto",flexDirection:"row",alignItems:"center",gap:on.spacing(7),fontSize:on.typography.body1.fontSize,fontWeight:on.typography.body1.fontWeight,lineHeight:on.typography.body1.lineHeight}})}},MuiListItemSecondaryAction:{styleOverrides:{root:({theme:on})=>({"& .MuiTypography-body2":{fontSize:on.typography.body1.fontSize,lineHeight:on.typography.body1.lineHeight}})}},MuiMenu:{defaultProps:{MenuListProps:{disablePadding:!0},transitionDuration:0,slotProps:{paper:{elevation:1}}},styleOverrides:{root:{pointerEvents:"none"},list:({theme:on})=>({minWidth:on.spacing(180),padding:on.spacing(4)}),paper:({theme:on})=>({padding:0,pointerEvents:"auto",color:THEME_COLORS.base.text,backgroundColor:THEME_COLORS.components.menu,border:`${on.spacing(1)} solid ${THEME_COLORS.components.menuBorder}`})}},MuiMenuItem:{defaultProps:{disableRipple:!0,disableTouchRipple:!0},styleOverrides:{root:({theme:on})=>({height:on.spacing(24),minHeight:"auto",boxSizing:"content-box",borderRadius:on.spacing(4),padding:on.spacing(3,12),fontSize:on.typography.body1.fontSize,fontWeight:on.typography.body1.fontWeight,lineHeight:on.typography.body1.lineHeight,color:THEME_COLORS.components.menuItemText,backgroundColor:THEME_COLORS.components.menuItem,"&:hover, &:focus":{backgroundColor:THEME_COLORS.components.menuItemHover},"&.Mui-focusVisible":{color:THEME_COLORS.components.menuItemHoverText,backgroundColor:THEME_COLORS.components.menuItemHover},"&.Mui-selected, &.Mui-selected:hover":{color:THEME_COLORS.components.menuItemHoverText,backgroundColor:THEME_COLORS.components.menuItemHover},"+.MuiDivider-root":{marginTop:on.spacing(4),marginBottom:on.spacing(4),borderBottomWidth:on.spacing(1),borderColor:THEME_COLORS.components.menuSeparator},"& .MuiListItemSecondaryAction-root":{right:on.spacing(12)},"& > .MuiListItemIcon-root":{marginRight:on.spacing(6),minWidth:on.spacing(16)}})}},MuiMultiSectionDigitalClockSection:{styleOverrides:{root:({theme:on})=>({fontSize:on.typography.body1.fontSize,fontWeight:on.typography.body1.fontWeight,lineHeight:on.typography.body1.lineHeight,padding:on.spacing(4)}),item:({theme:on})=>({margin:"0 !important",width:"initial",height:on.spacing(24),padding:on.spacing(3,12),"&:not(.Mui-selected):hover, &:not(.Mui-selected):focus":{backgroundColor:THEME_COLORS.components.menuItemHover,color:THEME_COLORS.components.menuItemHoverText},"&.Mui-selected":{backgroundColor:THEME_COLORS.components.buttonPrimary,color:THEME_COLORS.components.buttonPrimaryText},"&.Mui-selected:hover, &.Mui-selected:focus":{backgroundColor:THEME_COLORS.components.buttonPrimaryHover,color:THEME_COLORS.components.buttonPrimaryHoverText}})}},MuiOutlinedInput:{defaultProps:{margin:"dense"},styleOverrides:{root:({theme:on})=>({"&.Mui-disabled .MuiOutlinedInput-notchedOutline, &.Mui-disabled:hover .MuiOutlinedInput-notchedOutline":{borderColor:THEME_COLORS.components.fieldDisabledBorder},"&.Mui-focused .MuiOutlinedInput-notchedOutline, &:hover .MuiOutlinedInput-notchedOutline":{borderWidth:on.spacing(1),borderColor:THEME_COLORS.components.fieldHoverBorder},"&.Mui-error .MuiOutlinedInput-notchedOutline, &.Mui-error:hover .MuiOutlinedInput-notchedOutline, &.Mui-error.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:THEME_COLORS.states.failure}}),input:({theme:on})=>({height:on.spacing(16),padding:on.spacing(6,8)}),multiline:({theme:on})=>({padding:on.spacing(6,8),"& .MuiOutlinedInput-input":{padding:0,height:"auto",overflow:"auto !important","&::-webkit-scrollbar":{display:"block"}}}),notchedOutline:{top:0,borderColor:THEME_COLORS.components.fieldBorder,"& > legend":{display:"none"}},adornedStart:{paddingLeft:0},adornedEnd:{paddingRight:0}}},MuiPagination:{defaultProps:{shape:"rounded"}},MuiPaginationItem:{defaultProps:{size:"small"},styleOverrides:{root:({theme:on})=>({minWidth:on.spacing(30),height:on.spacing(30)}),text:({theme:on})=>({borderStyle:"solid",borderWidth:on.spacing(1),borderColor:"transparent",color:THEME_COLORS.components.buttonText,backgroundColor:"transparent","&:focus, &:focus.Mui-selected":{borderColor:THEME_COLORS.components.buttonHoverBorder,color:THEME_COLORS.components.buttonHoverText,backgroundColor:THEME_COLORS.components.buttonHover},"&:hover, &.Mui-selected":{borderColor:THEME_COLORS.components.buttonHoverBorder,color:THEME_COLORS.components.buttonHoverText,backgroundColor:THEME_COLORS.components.buttonHover},"&:disabled":{borderColor:"transparent",color:THEME_COLORS.components.buttonDisabledText,backgroundColor:"transparent"}})}},MuiPaper:{styleOverrides:{root:({theme:on})=>({"&.Menu":{padding:on.spacing(4,0),color:THEME_COLORS.base.text,backgroundColor:THEME_COLORS.components.menu,border:`${on.spacing(1)} solid ${THEME_COLORS.components.menuBorder}`},"&.MuiPaper-rounded":{borderRadius:on.spacing(4)}})}},MuiPickerPopper:{styleOverrides:{root:({theme:on})=>({padding:on.spacing(4),overflow:"visible"}),paper:({theme:on})=>({color:THEME_COLORS.base.text,backgroundColor:THEME_COLORS.components.menu,border:`${on.spacing(1)} solid ${THEME_COLORS.components.menuBorder}`,margin:`-${on.spacing(3)} -${on.spacing(4)}`})}},MuiPickersArrowSwitcher:{styleOverrides:{button:{color:THEME_COLORS.components.buttonText,"&.Mui-disabled":{color:THEME_COLORS.components.buttonDisabledText}},spacer:({theme:on})=>({width:on.spacing(24)})}},MuiPickersCalendarHeader:{styleOverrides:{root:({theme:on})=>({margin:on.spacing(8,16,4,24),padding:0}),labelContainer:({theme:on})=>({fontSize:on.typography.h6.fontSize,fontWeight:on.typography.h6.fontWeight,lineHeight:on.typography.h6.lineHeight})}},MuiPickersLayout:{styleOverrides:{root:({theme:on})=>({"& .MuiChip-sizeMedium":{height:on.spacing(28),fontSize:"1.083rem"}})}},MuiPickersTextField:{styleOverrides:{root:{"& > .MuiPickersInputBase-root":{padding:0}}}},MuiPopper:{defaultProps:{transition:!1},styleOverrides:{root:{overflow:"visible !important"}}},MuiSkeleton:{styleOverrides:{root:{backgroundColor:THEME_COLORS.base.text}}},MuiStepContent:{styleOverrides:{root:({theme:on})=>({marginLeft:on.spacing(15),paddingLeft:on.spacing(23)})}},MuiStepConnector:{styleOverrides:{root:({theme:on})=>({marginLeft:on.spacing(15)})}},MuiStepLabel:{styleOverrides:{iconContainer:({theme:on})=>({"& > .MuiStepIcon-root":{width:on.spacing(30),height:on.spacing(30),color:THEME_COLORS.states.none,fill:THEME_COLORS.states.none},"& > .MuiStepIcon-root > .MuiStepIcon-text":{fill:THEME_COLORS.states.noneText}}),label:{fontSize:"1.25rem",fontWeight:500,lineHeight:"1.5",color:THEME_COLORS.base.heading,"&.Mui-active":{color:THEME_COLORS.base.heading},"&.Mui-completed":{color:THEME_COLORS.base.heading},"&.Mui-disabled":{color:THEME_COLORS.base.heading}}}},MuiSwitch:{defaultProps:{size:"small"}},MuiTab:{defaultProps:{disableRipple:!0},styleOverrides:{root:({theme:on})=>({borderTopLeftRadius:0,borderTopRightRadius:0,paddingTop:0,paddingRight:on.spacing(2),paddingBottom:0,paddingLeft:on.spacing(2),minWidth:"initial",minHeight:on.spacing(30),fontWeight:"500",textTransform:"none","& > .label":{borderRadius:on.spacing(4),padding:on.spacing(4,6),color:THEME_COLORS.base.tabText,backgroundColor:THEME_COLORS.base.tab,transition:"background-color 0.2s ease, color 0.2s ease",".MuiBadge-dot":{top:0,right:on.spacing(-2)}},"&:hover > .label":{color:THEME_COLORS.base.tabHoverText,backgroundColor:THEME_COLORS.base.tabHover},"&.Mui-selected > .label":{color:THEME_COLORS.base.tabActiveText,backgroundColor:THEME_COLORS.base.tabActive},"&.Mui-selected:hover > .label":{color:THEME_COLORS.base.tabActiveText,backgroundColor:THEME_COLORS.base.tabActiveHover}})}},MuiTable:{defaultProps:{size:"small"},styleOverrides:{root:{borderCollapse:"separate"}}},MuiTableRow:{styleOverrides:{root:{"&.MuiTableRow-hover:hover":{backgroundColor:THEME_COLORS.base.itemHover}}}},MuiTableCell:{defaultProps:{size:"medium"},styleOverrides:{root:({theme:on})=>({color:THEME_COLORS.base.text,fontSize:on.typography.body1.fontSize,lineHeight:on.typography.body1.lineHeight,borderTop:`${on.spacing(1)} solid ${THEME_COLORS.base.border}`,borderBottomWidth:0}),sizeMedium:({theme:on})=>({height:on.spacing(36),padding:on.spacing(0,8)}),head:{border:0},footer:({theme:on})=>({borderBottom:`${on.spacing(1)} solid ${THEME_COLORS.components.menuBorder}`})}},MuiTabs:{defaultProps:{TabIndicatorProps:{style:{transition:"none"}}},styleOverrides:{root:({theme:on})=>({minHeight:on.spacing(36),"& .MuiTabs-flexContainer":{overflow:"unset"},"& .MuiTabs-indicator":{borderRadius:on.spacing(3,3,0,0),height:on.spacing(3),backgroundColor:THEME_COLORS.base.tabActiveBorder},"& .MuiTabs-indicator:hover":{backgroundColor:THEME_COLORS.base.tabActiveHoverBorder},"& button":{minHeight:on.spacing(36),fontSize:on.typography.body1.fontSize}})}},MuiTextField:{defaultProps:{margin:"dense"},styleOverrides:{root:{margin:0}}},MuiToggleButton:{defaultProps:{disableRipple:!0},styleOverrides:{root:({theme:on})=>({border:`${on.spacing(1)} solid ${THEME_COLORS.components.toggleButtonBorder}`,borderRadius:on.spacing(4),backgroundColor:THEME_COLORS.components.toggleButton,height:on.spacing(30),"& > .icon":{fill:THEME_COLORS.components.toggleButtonText},"&:hover":{backgroundColor:THEME_COLORS.components.toggleButtonHover,"& > .icon":{fill:THEME_COLORS.components.toggleButtonHoverText}},"&.Mui-selected":{backgroundColor:THEME_COLORS.components.toggleButtonActive,"& > .icon":{fill:THEME_COLORS.components.toggleButtonActiveText}},"&.Mui-selected:hover":{backgroundColor:THEME_COLORS.components.toggleButtonActive,"& > .icon":{fill:THEME_COLORS.components.toggleButtonActiveText}}})}},MuiToggleButtonGroup:{styleOverrides:{root:({theme:on})=>({borderRadius:on.spacing(4),backgroundColor:"transparent",flex:"0 0 auto","& .MuiToggleButtonGroup-grouped:not(:first-of-type)":{marginLeft:0,borderLeft:0}})}},MuiTooltip:{defaultProps:{disableInteractive:!0},styleOverrides:{tooltip:({theme:on})=>({border:`${on.spacing(1)} solid ${THEME_COLORS.components.tooltipBorder}`,backgroundColor:THEME_COLORS.components.tooltip,boxShadow:`0 ${on.spacing(1)} ${on.spacing(4)} 0 ${THEME_COLORS.base.shadow}`,color:THEME_COLORS.components.tooltipText,[`.${tooltipClasses.popper}[data-popper-placement*="left"] &`]:{marginRight:on.spacing(4)},[`.${tooltipClasses.popper}[data-popper-placement*="right"] &`]:{marginLeft:on.spacing(4)},[`.${tooltipClasses.popper}[data-popper-placement*="top"] &`]:{marginBottom:on.spacing(4)},[`.${tooltipClasses.popper}[data-popper-placement*="bottom"] &`]:{marginTop:on.spacing(4)}})}},MuiToolbar:{defaultProps:{variant:"dense"},styleOverrides:{root:({theme:on})=>({width:"100%",height:on.spacing(36),minHeight:on.spacing(36),paddingLeft:0,paddingRight:0,"@media (min-width: 600px)":{paddingLeft:0,paddingRight:0}})}},MuiTypography:{defaultProps:{variant:"body1"},styleOverrides:{root:{"&.ellipsis":{overflow:"hidden",textAlign:"start",textOverflow:"ellipsis",whiteSpace:"nowrap"}},h1:{"&.MuiTypography-root.MuiTypography-h1":{color:THEME_COLORS.base.heading}},h2:{"&.MuiTypography-root.MuiTypography-h2":{color:THEME_COLORS.base.heading}},h3:{"&.MuiTypography-root.MuiTypography-h3":{color:THEME_COLORS.base.heading}},h4:{"&.MuiTypography-root.MuiTypography-h4":{color:THEME_COLORS.base.heading}},h5:{"&.MuiTypography-root.MuiTypography-h5":{color:THEME_COLORS.base.heading}},h6:{"&.MuiTypography-root.MuiTypography-h6":{color:THEME_COLORS.base.heading}},subtitle1:{"&.MuiTypography-root.MuiTypography-subtitle1":{color:THEME_COLORS.base.textAlt}},subtitle2:{"&.MuiTypography-root.MuiTypography-subtitle2":{color:THEME_COLORS.base.textAlt}},body1:{"&.MuiTypography-root.MuiTypography-body1":{color:THEME_COLORS.base.text}},body2:{"&.MuiTypography-root.MuiTypography-body2":{color:THEME_COLORS.base.text}}}}}});function createNamedContext(on,In){const Rn=reactExports.createContext(on);return Rn.displayName=In,Rn}const COMPONENTS_CONTAINER_ID="components",ROOT_CONTAINER_ID="root",APP_LICENSE="ChilliCream License 1.0",APP_LICENSE_URL="https://chillicream.com/licensing/chillicream-license",APP_NAME="Nitro",APP_VERSION$1="31.0.0",APP_SCHEME="chillicream-nitro",APP_SIGNIN_PATH="signin-redirect",APP_GRAPHQL_CLIENT_ID="Q2xpZW50Cmc5ZjAwOTFmNTY5NmQ0NTZkOWUwZDQ0ZDMzYjJhZDJlOA==",COMPANY_NAME="ChilliCream, Inc.",COMPANY_URL="https://chillicream.com",cloudUriPattern=new RegExp("^https?:\\/\\/.*?\\.(bananacakepop\\.com|chillicream\\.com|chillicream\\.cloud)","i"),IS_RUNNING_IN_CLOUD=cloudUriPattern?.test(self.origin)??!1,IS_RUNNING_IN_ELECTRON=navigator.userAgent.indexOf("Electron")>=0,APP_TYPE=IS_RUNNING_IN_CLOUD?"cloud":IS_RUNNING_IN_ELECTRON?"app":"middleware",APP_AGENT=`${APP_NAME}/${APP_VERSION$1} (${APP_TYPE})`,OS_NAME=getOsName(),IS_MAC_LIKE=isMacLike();function getOsName(){return navigator.userAgent.indexOf("Win")>=0?"Windows":navigator.userAgent.indexOf("Mac")>=0?"macOS":navigator.userAgent.indexOf("X11")>=0||navigator.userAgent.indexOf("Linux")>=0?"Linux":"Unknown"}function isMacLike(){const on=navigator.userAgent.toLowerCase();return on.includes("mac os")||on.includes("ipad")}const CONTEXT_NOT_INITIALIZED="Context not initialized",HEADER_ACCEPT="Accept",HEADER_ACCEPT_ENCODING="Accept-Encoding",HEADER_AUTHORIZATION="Authorization",HEADER_CONTENT_TYPE="Content-Type",HEADER_FUSION_OPERATION_PLAN="Fusion-Operation-Plan",HEADER_ORIGIN="Origin",HEADER_SET_COOKIE="Set-Cookie",HEADER_USER_AGENT="User-Agent",HTTP_SCHEME_PATTERN=/^https?:\/\//i,HTTP_SECURE_SCHEME_PATTERN=/^https:\/\//i,WS_SCHEME_PATTERN=/^wss?:\/\//i,INTERPOLATION_PATTERN=/({{\s*[a-z0-9_\-|.:+#$!?;,]+\s*}})/gi,INTERPOLATION_VARIABLE_NAME_PATTERN=/{{\s*([a-z0-9_\-|.:+#$!?;,]+)\s*}}/gi,INTERPOLATION_EXPRESSION_PATTERN=/({{)(\s*)([a-z0-9_\-|.:+#$!?;,]+)(\s*)(}})/gi,FUSION_OPERATION_PLAN_HEADER_NAME_PATTERN=/fusion-operation-plan/i,STARTS_WITH_INTERPOLATION_PATTERN=/^{{/i,VALID_NAME_PATTERN=/^[a-z0-9]{1}[_\-&+.:#!/\\()[\]{}a-z0-9\s]{0,63}$/i,TWENTY_FIVE_MILLISECONDS=25,FIFTY_MILLISECONDS=50,ONE_HUNDRED_MILLISECONDS=100,TWO_HUNDRED_MILLISECONDS=200,TWO_HUNDRED_FIFTY_MILLISECONDS=250,THREE_HUNDRED_MILLISECONDS=300,FIVE_HUNDRED_MILLISECONDS=500,ONE_SECOND$1=1e3,TWO_SECONDS=2e3,FIVE_SECONDS=5e3,TEN_SECONDS=1e4,THIRTY_SECONDS=3e4,ONE_MINUTE$1=6e4,TWO_MINUTES=12e4,FIVE_MINUTES=3e5,SIX_HOURS=216e5,NINETY_DAYS=7776e6,PERSONAL_ORGANIZATION_ID="personal",PERSONAL_WORKSPACE_TENANT="personal";function getDuration(on){return on?on>0&&on<1?"~1 ms":on>0&&on<ONE_SECOND$1?on+" ms":on>=ONE_SECOND$1&&on<=ONE_MINUTE$1?Math.round(on/ONE_SECOND$1)+" sec":Math.round(on/ONE_MINUTE$1)+" min":"N/A"}function round$5(on,In){const Rn=Math.pow(10,In);return Math.round(on*Rn)/Rn}function getSize$2(on){return on?on<1e3?on+" B":on>=1e3&&on<1e6?round$5(on/1e3,1)+" KB":on>=1e6&&on<1e9?round$5(on/1e6,1)+" MB":round$5(on/1e9,1)+" GB":"N/A"}const ABORT_ERROR_NAME="AbortError",ABORT_ERROR=new DOMException("Action cancelled",ABORT_ERROR_NAME),TIMEOUT_ABORT_ERROR_MESSAGE="Action timed out",TIMEOUT_ABORT_ERROR=new DOMException(TIMEOUT_ABORT_ERROR_MESSAGE,ABORT_ERROR_NAME);class TimeoutAbortSignal{#e;#t;#r;constructor(In,Rn){this.#e=In,this.#t=Rn}get aborted(){return this.#e.aborted}get cancelled(){return this.#t()}get onabort(){return this.#e.onabort}get reason(){return this.#e.reason}dispatchEvent(In){return this.#e.dispatchEvent(In)}throwIfAborted(){this.#e.throwIfAborted()}toAbortSignal(){return this.#e}toPromise(){if(this.#r)return this.#r;const In=this;let Rn=!1;return this.#r=new Promise((Mn,Ln)=>{if(In.aborted){Rn=!0,Ln(TIMEOUT_ABORT_ERROR);return}if(In.cancelled){Rn=!0,Mn();return}function Hn(){In.removeEventListener("abort",Hn),In.removeEventListener("cancelled",jn),Rn||(Rn=!0,Ln(TIMEOUT_ABORT_ERROR))}function jn(){In.removeEventListener("abort",Hn),In.removeEventListener("cancelled",jn),Rn||(Rn=!0,Mn())}In.addEventListener("abort",Hn),In.addEventListener("cancelled",jn)}),this.#r}addEventListener(In,Rn,Mn){this.#e.addEventListener(In,Rn,Mn)}removeEventListener(In,Rn,Mn){this.#e.removeEventListener(In,Rn,Mn)}}class TimeoutAbortController{_controller=new AbortController;_signal=new TimeoutAbortSignal(this._controller.signal,()=>this._cancelled);_cancelled=!1;_timeoutHandle;constructor(In){this._timeoutHandle=self.setTimeout(()=>{this.abort(TIMEOUT_ABORT_ERROR_MESSAGE)},In)}get signal(){return this._signal}abort(In){this._controller.abort(In)}cancel(){this._cancelled=!0,self.clearTimeout(this._timeoutHandle),this._signal.dispatchEvent(new Event("cancelled"))}}function isAbortError(on){return on instanceof DOMException&&on.name===ABORT_ERROR_NAME}function isTimeoutAbortError(on){return isAbortError(on)&&on.message===TIMEOUT_ABORT_ERROR_MESSAGE}function linkAbortSignals(on,In){const Rn=new AbortController;if(on.aborted||In.aborted)Rn.abort(on.reason??In.reason);else{let Mn=function(Hn){return()=>{Rn.signal.aborted||Rn.abort(Hn.reason)}},Ln=function(){Rn.signal.removeEventListener("abort",Ln),on.removeEventListener("abort",Mn(on)),In.removeEventListener("abort",Mn(In))};Rn.signal.addEventListener("abort",Ln),on.addEventListener("abort",Mn(on)),In.addEventListener("abort",Mn(In))}return Rn.signal}function createAbortScope(on,In,Rn){return Rn?Rn.aborted?Promise.reject(ABORT_ERROR):(Rn.addEventListener("abort",on),In().finally(()=>{Rn.removeEventListener("abort",on)})):In()}function distinct(on){return on.filter((In,Rn,Mn)=>Mn.indexOf(In)===Rn)}function equals(on,In){let Rn=on.length;if(Rn!==In.length)return!1;for(;Rn--;)if(on[Rn]!==In[Rn])return!1;return!0}class LinkedListImplementation{stack;constructor(In){this.stack=In?[...In]:[]}append(In){return this.stack.indexOf(In)===-1&&this.stack.push(In),this}find(In){const Rn=this.stack.indexOf(In);return Rn!==-1?this.stack[Rn]:null}getFirst(){return this.stack[0]||null}setFirst(In){const Rn=this.stack.indexOf(In);return Rn!==0&&In&&(Rn===-1?this.stack.splice(0,0,In):this.stack.splice(0,0,this.stack.splice(Rn,1).pop())),this}getLast(){return this.stack.length>0?this.stack[this.stack.length-1]:null}setLast(In){const Rn=this.stack.indexOf(In),Mn=this.stack.length-1;return(Rn===-1||Rn!==Mn)&&In&&(Rn===-1?this.stack.push(In):this.stack.push(this.stack.splice(Rn,1).pop())),this}count(){return this.stack.length}remove(...In){return In.forEach(Rn=>{const Mn=this.stack.indexOf(Rn);Mn!==-1&&this.stack.splice(Mn,1)}),this}update(In,Rn){const Mn=this.stack.indexOf(In);return Mn!==-1&&this.stack.splice(Mn,1,Rn),this}toArray(){return[].concat(this.stack)}}function createLinkedList(on){return new LinkedListImplementation(on)}function encodeBase64$1(on,In){return Buffer$1.from(on,In).toString("base64")}function decodeBase64(on,In){return Buffer$1.from(on,"base64").toString(In)}function beautifyEndpoint(on,In){if(on?.length){let Rn=on?.trim().replace(HTTP_SCHEME_PATTERN,"");const Mn=Rn.indexOf("/");return Mn===-1?Rn:Rn.substring(0,Mn)}return In??""}var inherits_browser={exports:{}},hasRequiredInherits_browser;function requireInherits_browser(){return hasRequiredInherits_browser||(hasRequiredInherits_browser=1,typeof Object.create=="function"?inherits_browser.exports=function(In,Rn){Rn&&(In.super_=Rn,In.prototype=Object.create(Rn.prototype,{constructor:{value:In,enumerable:!1,writable:!0,configurable:!0}}))}:inherits_browser.exports=function(In,Rn){if(Rn){In.super_=Rn;var Mn=function(){};Mn.prototype=Rn.prototype,In.prototype=new Mn,In.prototype.constructor=In}}),inherits_browser.exports}var safeBuffer$1={exports:{}},dist$2={},hasRequiredDist;function requireDist(){return hasRequiredDist||(hasRequiredDist=1,function(on){Object.defineProperties(on,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var In={},Rn={};Rn.byteLength=vi,Rn.toByteArray=mi,Rn.fromByteArray=Ei;for(var Mn=[],Ln=[],Hn=typeof Uint8Array<"u"?Uint8Array:Array,jn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Wn=0,Yn=jn.length;Wn<Yn;++Wn)Mn[Wn]=jn[Wn],Ln[jn.charCodeAt(Wn)]=Wn;Ln[45]=62,Ln[95]=63;function hi(Ci){var Ai=Ci.length;if(Ai%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var Ii=Ci.indexOf("=");Ii===-1&&(Ii=Ai);var Ni=Ii===Ai?0:4-Ii%4;return[Ii,Ni]}function vi(Ci){var Ai=hi(Ci),Ii=Ai[0],Ni=Ai[1];return(Ii+Ni)*3/4-Ni}function gi(Ci,Ai,Ii){return(Ai+Ii)*3/4-Ii}function mi(Ci){var Ai,Ii=hi(Ci),Ni=Ii[0],Pi=Ii[1],Vi=new Hn(gi(Ci,Ni,Pi)),Ui=0,Gi=Pi>0?Ni-4:Ni,Yi;for(Yi=0;Yi<Gi;Yi+=4)Ai=Ln[Ci.charCodeAt(Yi)]<<18|Ln[Ci.charCodeAt(Yi+1)]<<12|Ln[Ci.charCodeAt(Yi+2)]<<6|Ln[Ci.charCodeAt(Yi+3)],Vi[Ui++]=Ai>>16&255,Vi[Ui++]=Ai>>8&255,Vi[Ui++]=Ai&255;return Pi===2&&(Ai=Ln[Ci.charCodeAt(Yi)]<<2|Ln[Ci.charCodeAt(Yi+1)]>>4,Vi[Ui++]=Ai&255),Pi===1&&(Ai=Ln[Ci.charCodeAt(Yi)]<<10|Ln[Ci.charCodeAt(Yi+1)]<<4|Ln[Ci.charCodeAt(Yi+2)]>>2,Vi[Ui++]=Ai>>8&255,Vi[Ui++]=Ai&255),Vi}function yi(Ci){return Mn[Ci>>18&63]+Mn[Ci>>12&63]+Mn[Ci>>6&63]+Mn[Ci&63]}function bi(Ci,Ai,Ii){for(var Ni,Pi=[],Vi=Ai;Vi<Ii;Vi+=3)Ni=(Ci[Vi]<<16&16711680)+(Ci[Vi+1]<<8&65280)+(Ci[Vi+2]&255),Pi.push(yi(Ni));return Pi.join("")}function Ei(Ci){for(var Ai,Ii=Ci.length,Ni=Ii%3,Pi=[],Vi=16383,Ui=0,Gi=Ii-Ni;Ui<Gi;Ui+=Vi)Pi.push(bi(Ci,Ui,Ui+Vi>Gi?Gi:Ui+Vi));return Ni===1?(Ai=Ci[Ii-1],Pi.push(Mn[Ai>>2]+Mn[Ai<<4&63]+"==")):Ni===2&&(Ai=(Ci[Ii-2]<<8)+Ci[Ii-1],Pi.push(Mn[Ai>>10]+Mn[Ai>>4&63]+Mn[Ai<<2&63]+"=")),Pi.join("")}var _i={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */_i.read=function(Ci,Ai,Ii,Ni,Pi){var Vi,Ui,Gi=Pi*8-Ni-1,Yi=(1<<Gi)-1,zi=Yi>>1,Mi=-7,Li=Ii?Pi-1:0,wi=Ii?-1:1,Ri=Ci[Ai+Li];for(Li+=wi,Vi=Ri&(1<<-Mi)-1,Ri>>=-Mi,Mi+=Gi;Mi>0;Vi=Vi*256+Ci[Ai+Li],Li+=wi,Mi-=8);for(Ui=Vi&(1<<-Mi)-1,Vi>>=-Mi,Mi+=Ni;Mi>0;Ui=Ui*256+Ci[Ai+Li],Li+=wi,Mi-=8);if(Vi===0)Vi=1-zi;else{if(Vi===Yi)return Ui?NaN:(Ri?-1:1)*(1/0);Ui=Ui+Math.pow(2,Ni),Vi=Vi-zi}return(Ri?-1:1)*Ui*Math.pow(2,Vi-Ni)},_i.write=function(Ci,Ai,Ii,Ni,Pi,Vi){var Ui,Gi,Yi,zi=Vi*8-Pi-1,Mi=(1<<zi)-1,Li=Mi>>1,wi=Pi===23?Math.pow(2,-24)-Math.pow(2,-77):0,Ri=Ni?0:Vi-1,ki=Ni?1:-1,Bi=Ai<0||Ai===0&&1/Ai<0?1:0;for(Ai=Math.abs(Ai),isNaN(Ai)||Ai===1/0?(Gi=isNaN(Ai)?1:0,Ui=Mi):(Ui=Math.floor(Math.log(Ai)/Math.LN2),Ai*(Yi=Math.pow(2,-Ui))<1&&(Ui--,Yi*=2),Ui+Li>=1?Ai+=wi/Yi:Ai+=wi*Math.pow(2,1-Li),Ai*Yi>=2&&(Ui++,Yi/=2),Ui+Li>=Mi?(Gi=0,Ui=Mi):Ui+Li>=1?(Gi=(Ai*Yi-1)*Math.pow(2,Pi),Ui=Ui+Li):(Gi=Ai*Math.pow(2,Li-1)*Math.pow(2,Pi),Ui=0));Pi>=8;Ci[Ii+Ri]=Gi&255,Ri+=ki,Gi/=256,Pi-=8);for(Ui=Ui<<Pi|Gi,zi+=Pi;zi>0;Ci[Ii+Ri]=Ui&255,Ri+=ki,Ui/=256,zi-=8);Ci[Ii+Ri-ki]|=Bi*128};/*!
|
|
4230
|
+
${THEME_COLORS.components.buttonIconBorder}`,color:THEME_COLORS.components.buttonIconText,backgroundColor:THEME_COLORS.components.buttonIcon,"&:disabled":{pointerEvents:"none",cursor:"default",opacity:.5,"&:hover":{backgroundColor:"initial"}},"& > .icon":{fill:THEME_COLORS.components.buttonIconText}}),sizeSmall:({theme:on})=>({width:on.spacing(30),height:on.spacing(30)})}},MuiInputAdornment:{styleOverrides:{root:({theme:on})=>({flexShrink:0,justifyContent:"center",margin:0,"&.MuiInputAdornment-sizeSmall":{minWidth:on.spacing(28),minHeight:on.spacing(28),"&.MuiInputAdornment-positionStart":{marginRight:on.spacing(-6)}}})}},MuiInputBase:{defaultProps:{margin:"dense"},styleOverrides:{root:({theme:on})=>({borderRadius:on.spacing(4),height:on.spacing(30),fontSize:on.typography.body1.fontSize,lineHeight:on.typography.body1.lineHeight,backgroundColor:THEME_COLORS.components.field,color:THEME_COLORS.components.fieldText,transition:"background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease","&.MuiInputBase-multiline":{height:"auto"},"&.Mui-disabled, &.Mui-disabled:hover":{backgroundColor:THEME_COLORS.components.fieldDisabled,color:THEME_COLORS.components.fieldDisabledText,"& .MuiInputBase-input::placeholder":{color:THEME_COLORS.components.fieldDisabledPlaceholder}},"&.Mui-focused, &:hover":{backgroundColor:THEME_COLORS.components.fieldHover,color:THEME_COLORS.components.fieldHoverText,"& .MuiInputBase-input::placeholder":{color:THEME_COLORS.components.fieldHoverPlaceholder}},"&.Mui-error":{color:THEME_COLORS.states.failure}}),adornedStart:{"& .icon":{fill:THEME_COLORS.components.fieldText},"&:Mui-disabled .icon":{fill:THEME_COLORS.components.fieldDisabled},"&.Mui-error .icon":{fill:THEME_COLORS.states.failure}},adornedEnd:{"& .icon":{fill:THEME_COLORS.components.fieldText},"&:Mui-disabled .icon":{fill:THEME_COLORS.components.fieldDisabled},"&.Mui-error .icon":{fill:THEME_COLORS.states.failure}},input:({theme:on})=>({height:on.spacing(16),padding:on.spacing(6,8),"&::placeholder":{opacity:1,color:THEME_COLORS.components.fieldPlaceholder,transition:"color 0.2s ease"},"&:autofill":{transitionProperty:"background-color, color",transitionDelay:"86400s"}})}},MuiInputLabel:{defaultProps:{margin:"dense",shrink:!0},styleOverrides:{root:({theme:on})=>({position:"relative",transform:"none",fontSize:on.typography.body1.fontSize,fontWeight:on.typography.fontWeightMedium,color:THEME_COLORS.components.labelText,"&.Mui-focused":{color:THEME_COLORS.components.labelText},"&.Mui-error":{color:THEME_COLORS.states.failure}})}},MuiLinearProgress:{styleOverrides:{root:({theme:on})=>({height:on.spacing(2),"&.impact > .MuiLinearProgress-barColorPrimary":{backgroundColor:THEME_COLORS.chart.impact},"&.impact.MuiLinearProgress-colorPrimary":{backgroundColor:THEME_COLORS.chart.impactBackground}}),barColorPrimary:{backgroundColor:THEME_COLORS.base.spinner},colorPrimary:{backgroundColor:THEME_COLORS.base.separator}}},MuiLink:{styleOverrides:{root:({theme:on})=>({textDecoration:"underline",whiteSpace:"nowrap","& > .icon":{flex:`0 0 ${on.spacing(14)}`,width:on.spacing(14),height:on.spacing(14)},"&:hover":{textDecoration:"none"},"&.MuiTypography-root":{display:"inline-flex",gap:on.spacing(4),alignItems:"center",cursor:"pointer",color:THEME_COLORS.components.linkText+" !important",textDecorationColor:THEME_COLORS.components.linkText+" !important","& > .icon.link":{fill:THEME_COLORS.components.linkText}},"&.MuiTypography-root:hover":{color:THEME_COLORS.components.linkHoverText+" !important",textDecorationColor:THEME_COLORS.components.linkHoverText+" !important","& > .icon.link":{fill:THEME_COLORS.components.linkHoverText}}}),button:{"&.MuiTypography-root, .MuiPaper-root &.MuiTypography-root":{cursor:"pointer",color:THEME_COLORS.components.linkText,textDecorationColor:THEME_COLORS.components.linkText,"& > .icon.link":{fill:THEME_COLORS.components.linkText}},"&.MuiTypography-root:hover":{color:THEME_COLORS.components.linkHoverText,textDecorationColor:THEME_COLORS.components.linkHoverText,"& > .icon.link":{fill:THEME_COLORS.components.linkHoverText}}}}},MuiList:{defaultProps:{dense:!0},styleOverrides:{root:({theme:on})=>({overflow:"visible",padding:on.spacing(0,8),"& .MuiList-root":{padding:on.spacing(0)}})}},MuiListSubheader:{defaultProps:{disableSticky:!0},styleOverrides:{root:({theme:on})=>({padding:on.spacing(4,12),fontSize:on.typography.body2.fontSize,fontWeight:600,lineHeight:on.typography.body2.lineHeight,color:THEME_COLORS.base.textAlt,backgroundColor:"unset"})}},MuiListItemButton:{styleOverrides:{root:({theme:on})=>({display:"flex",alignItems:"center",gap:on.spacing(8),borderRadius:on.spacing(4),height:on.spacing(32),padding:on.spacing(3,12),overflow:"visible",fontSize:on.typography.body1.fontSize,lineHeight:on.typography.body1.lineHeight,backgroundColor:THEME_COLORS.base.tab,"&:hover":{backgroundColor:THEME_COLORS.base.tabHover,"& > .MuiListItemIcon-root > .icon":{fill:THEME_COLORS.base.tabHoverText},"& > .MuiListItemText-root > .MuiListItemText-primary":{color:THEME_COLORS.base.tabHoverText}},"&.Mui-selected":{position:"relative",backgroundColor:THEME_COLORS.base.tabActiveHover,"&:hover":{backgroundColor:THEME_COLORS.base.tabActiveHover,"&::before":{backgroundColor:THEME_COLORS.base.tabActiveHoverBorder},"& > .MuiListItemIcon-root > .icon":{fill:THEME_COLORS.base.tabActiveHoverText},"& > .MuiListItemText-root > .MuiListItemText-primary":{color:THEME_COLORS.base.tabActiveHoverText}},"&::before":{position:"absolute",top:on.spacing(2),bottom:on.spacing(2),left:on.spacing(-8),width:on.spacing(4),pointerEvents:"none",content:'""',borderRadius:on.spacing(2),backgroundColor:THEME_COLORS.base.tabActiveBorder},"& > .MuiListItemIcon-root > .icon":{fill:THEME_COLORS.base.tabActiveText},"& > .MuiListItemText-root > .MuiListItemText-primary":{color:THEME_COLORS.base.tabActiveText}},"& > .MuiListItemIcon-root > .icon":{fill:THEME_COLORS.base.tabText},"& > .MuiListItemText-root > .MuiListItemText-primary":{color:THEME_COLORS.base.tabText}})}},MuiListItemIcon:{styleOverrides:{root:({theme:on})=>({"&.MuiListItemIcon-root":{display:"flex",alignItems:"center",justifyContent:"center",minWidth:on.spacing(16)}})}},MuiListItemText:{styleOverrides:{root:({theme:on})=>({"&.child-selected > .MuiListItemText-primary":{fontWeight:500},"& .MuiListItemText-primary":{display:"flex",flex:"1 1 auto",flexDirection:"row",alignItems:"center",gap:on.spacing(7),fontSize:on.typography.body1.fontSize,fontWeight:on.typography.body1.fontWeight,lineHeight:on.typography.body1.lineHeight}})}},MuiListItemSecondaryAction:{styleOverrides:{root:({theme:on})=>({"& .MuiTypography-body2":{fontSize:on.typography.body1.fontSize,lineHeight:on.typography.body1.lineHeight}})}},MuiMenu:{defaultProps:{MenuListProps:{disablePadding:!0},transitionDuration:0,slotProps:{paper:{elevation:1}}},styleOverrides:{root:{pointerEvents:"none"},list:({theme:on})=>({minWidth:on.spacing(180),padding:on.spacing(4)}),paper:({theme:on})=>({padding:0,pointerEvents:"auto",color:THEME_COLORS.base.text,backgroundColor:THEME_COLORS.components.menu,border:`${on.spacing(1)} solid ${THEME_COLORS.components.menuBorder}`})}},MuiMenuItem:{defaultProps:{disableRipple:!0,disableTouchRipple:!0},styleOverrides:{root:({theme:on})=>({height:on.spacing(24),minHeight:"auto",boxSizing:"content-box",borderRadius:on.spacing(4),padding:on.spacing(3,12),fontSize:on.typography.body1.fontSize,fontWeight:on.typography.body1.fontWeight,lineHeight:on.typography.body1.lineHeight,color:THEME_COLORS.components.menuItemText,backgroundColor:THEME_COLORS.components.menuItem,"&:hover, &:focus":{backgroundColor:THEME_COLORS.components.menuItemHover},"&.Mui-focusVisible":{color:THEME_COLORS.components.menuItemHoverText,backgroundColor:THEME_COLORS.components.menuItemHover},"&.Mui-selected, &.Mui-selected:hover":{color:THEME_COLORS.components.menuItemHoverText,backgroundColor:THEME_COLORS.components.menuItemHover},"+.MuiDivider-root":{marginTop:on.spacing(4),marginBottom:on.spacing(4),borderBottomWidth:on.spacing(1),borderColor:THEME_COLORS.components.menuSeparator},"& .MuiListItemSecondaryAction-root":{right:on.spacing(12)},"& > .MuiListItemIcon-root":{marginRight:on.spacing(6),minWidth:on.spacing(16)}})}},MuiMultiSectionDigitalClockSection:{styleOverrides:{root:({theme:on})=>({fontSize:on.typography.body1.fontSize,fontWeight:on.typography.body1.fontWeight,lineHeight:on.typography.body1.lineHeight,padding:on.spacing(4)}),item:({theme:on})=>({margin:"0 !important",width:"initial",height:on.spacing(24),padding:on.spacing(3,12),"&:not(.Mui-selected):hover, &:not(.Mui-selected):focus":{backgroundColor:THEME_COLORS.components.menuItemHover,color:THEME_COLORS.components.menuItemHoverText},"&.Mui-selected":{backgroundColor:THEME_COLORS.components.buttonPrimary,color:THEME_COLORS.components.buttonPrimaryText},"&.Mui-selected:hover, &.Mui-selected:focus":{backgroundColor:THEME_COLORS.components.buttonPrimaryHover,color:THEME_COLORS.components.buttonPrimaryHoverText}})}},MuiOutlinedInput:{defaultProps:{margin:"dense"},styleOverrides:{root:({theme:on})=>({"&.Mui-disabled .MuiOutlinedInput-notchedOutline, &.Mui-disabled:hover .MuiOutlinedInput-notchedOutline":{borderColor:THEME_COLORS.components.fieldDisabledBorder},"&.Mui-focused .MuiOutlinedInput-notchedOutline, &:hover .MuiOutlinedInput-notchedOutline":{borderWidth:on.spacing(1),borderColor:THEME_COLORS.components.fieldHoverBorder},"&.Mui-error .MuiOutlinedInput-notchedOutline, &.Mui-error:hover .MuiOutlinedInput-notchedOutline, &.Mui-error.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:THEME_COLORS.states.failure}}),input:({theme:on})=>({height:on.spacing(16),padding:on.spacing(6,8)}),multiline:({theme:on})=>({padding:on.spacing(6,8),"& .MuiOutlinedInput-input":{padding:0,height:"auto",overflow:"auto !important","&::-webkit-scrollbar":{display:"block"}}}),notchedOutline:{top:0,borderColor:THEME_COLORS.components.fieldBorder,"& > legend":{display:"none"}},adornedStart:{paddingLeft:0},adornedEnd:{paddingRight:0}}},MuiPagination:{defaultProps:{shape:"rounded"}},MuiPaginationItem:{defaultProps:{size:"small"},styleOverrides:{root:({theme:on})=>({minWidth:on.spacing(30),height:on.spacing(30)}),text:({theme:on})=>({borderStyle:"solid",borderWidth:on.spacing(1),borderColor:"transparent",color:THEME_COLORS.components.buttonText,backgroundColor:"transparent","&:focus, &:focus.Mui-selected":{borderColor:THEME_COLORS.components.buttonHoverBorder,color:THEME_COLORS.components.buttonHoverText,backgroundColor:THEME_COLORS.components.buttonHover},"&:hover, &.Mui-selected":{borderColor:THEME_COLORS.components.buttonHoverBorder,color:THEME_COLORS.components.buttonHoverText,backgroundColor:THEME_COLORS.components.buttonHover},"&:disabled":{borderColor:"transparent",color:THEME_COLORS.components.buttonDisabledText,backgroundColor:"transparent"}})}},MuiPaper:{styleOverrides:{root:({theme:on})=>({"&.Menu":{padding:on.spacing(4,0),color:THEME_COLORS.base.text,backgroundColor:THEME_COLORS.components.menu,border:`${on.spacing(1)} solid ${THEME_COLORS.components.menuBorder}`},"&.MuiPaper-rounded":{borderRadius:on.spacing(4)}})}},MuiPickerPopper:{styleOverrides:{root:({theme:on})=>({padding:on.spacing(4),overflow:"visible"}),paper:({theme:on})=>({color:THEME_COLORS.base.text,backgroundColor:THEME_COLORS.components.menu,border:`${on.spacing(1)} solid ${THEME_COLORS.components.menuBorder}`,margin:`-${on.spacing(3)} -${on.spacing(4)}`})}},MuiPickersArrowSwitcher:{styleOverrides:{button:{color:THEME_COLORS.components.buttonText,"&.Mui-disabled":{color:THEME_COLORS.components.buttonDisabledText}},spacer:({theme:on})=>({width:on.spacing(24)})}},MuiPickersCalendarHeader:{styleOverrides:{root:({theme:on})=>({margin:on.spacing(8,16,4,24),padding:0}),labelContainer:({theme:on})=>({fontSize:on.typography.h6.fontSize,fontWeight:on.typography.h6.fontWeight,lineHeight:on.typography.h6.lineHeight})}},MuiPickersLayout:{styleOverrides:{root:({theme:on})=>({"& .MuiChip-sizeMedium":{height:on.spacing(28),fontSize:"1.083rem"}})}},MuiPickersTextField:{styleOverrides:{root:{"& > .MuiPickersInputBase-root":{padding:0}}}},MuiPopper:{defaultProps:{transition:!1},styleOverrides:{root:{overflow:"visible !important"}}},MuiSkeleton:{styleOverrides:{root:{backgroundColor:THEME_COLORS.base.text}}},MuiStepContent:{styleOverrides:{root:({theme:on})=>({marginLeft:on.spacing(15),paddingLeft:on.spacing(23)})}},MuiStepConnector:{styleOverrides:{root:({theme:on})=>({marginLeft:on.spacing(15)})}},MuiStepLabel:{styleOverrides:{iconContainer:({theme:on})=>({"& > .MuiStepIcon-root":{width:on.spacing(30),height:on.spacing(30),color:THEME_COLORS.states.none,fill:THEME_COLORS.states.none},"& > .MuiStepIcon-root > .MuiStepIcon-text":{fill:THEME_COLORS.states.noneText}}),label:{fontSize:"1.25rem",fontWeight:500,lineHeight:"1.5",color:THEME_COLORS.base.heading,"&.Mui-active":{color:THEME_COLORS.base.heading},"&.Mui-completed":{color:THEME_COLORS.base.heading},"&.Mui-disabled":{color:THEME_COLORS.base.heading}}}},MuiSwitch:{defaultProps:{size:"small"}},MuiTab:{defaultProps:{disableRipple:!0},styleOverrides:{root:({theme:on})=>({borderTopLeftRadius:0,borderTopRightRadius:0,paddingTop:0,paddingRight:on.spacing(2),paddingBottom:0,paddingLeft:on.spacing(2),minWidth:"initial",minHeight:on.spacing(30),fontWeight:"500",textTransform:"none","& > .label":{borderRadius:on.spacing(4),padding:on.spacing(4,6),color:THEME_COLORS.base.tabText,backgroundColor:THEME_COLORS.base.tab,transition:"background-color 0.2s ease, color 0.2s ease",".MuiBadge-dot":{top:0,right:on.spacing(-2)}},"&:hover > .label":{color:THEME_COLORS.base.tabHoverText,backgroundColor:THEME_COLORS.base.tabHover},"&.Mui-selected > .label":{color:THEME_COLORS.base.tabActiveText,backgroundColor:THEME_COLORS.base.tabActive},"&.Mui-selected:hover > .label":{color:THEME_COLORS.base.tabActiveText,backgroundColor:THEME_COLORS.base.tabActiveHover}})}},MuiTable:{defaultProps:{size:"small"},styleOverrides:{root:{borderCollapse:"separate"}}},MuiTableRow:{styleOverrides:{root:{"&.MuiTableRow-hover:hover":{backgroundColor:THEME_COLORS.base.itemHover}}}},MuiTableCell:{defaultProps:{size:"medium"},styleOverrides:{root:({theme:on})=>({color:THEME_COLORS.base.text,fontSize:on.typography.body1.fontSize,lineHeight:on.typography.body1.lineHeight,borderTop:`${on.spacing(1)} solid ${THEME_COLORS.base.border}`,borderBottomWidth:0}),sizeMedium:({theme:on})=>({height:on.spacing(36),padding:on.spacing(0,8)}),head:{border:0},footer:({theme:on})=>({borderBottom:`${on.spacing(1)} solid ${THEME_COLORS.components.menuBorder}`})}},MuiTabs:{defaultProps:{TabIndicatorProps:{style:{transition:"none"}}},styleOverrides:{root:({theme:on})=>({minHeight:on.spacing(36),"& .MuiTabs-flexContainer":{overflow:"unset"},"& .MuiTabs-indicator":{borderRadius:on.spacing(3,3,0,0),height:on.spacing(3),backgroundColor:THEME_COLORS.base.tabActiveBorder},"& .MuiTabs-indicator:hover":{backgroundColor:THEME_COLORS.base.tabActiveHoverBorder},"& button":{minHeight:on.spacing(36),fontSize:on.typography.body1.fontSize}})}},MuiTextField:{defaultProps:{margin:"dense"},styleOverrides:{root:{margin:0}}},MuiToggleButton:{defaultProps:{disableRipple:!0},styleOverrides:{root:({theme:on})=>({border:`${on.spacing(1)} solid ${THEME_COLORS.components.toggleButtonBorder}`,borderRadius:on.spacing(4),backgroundColor:THEME_COLORS.components.toggleButton,height:on.spacing(30),"& > .icon":{fill:THEME_COLORS.components.toggleButtonText},"&:hover":{backgroundColor:THEME_COLORS.components.toggleButtonHover,"& > .icon":{fill:THEME_COLORS.components.toggleButtonHoverText}},"&.Mui-selected":{backgroundColor:THEME_COLORS.components.toggleButtonActive,"& > .icon":{fill:THEME_COLORS.components.toggleButtonActiveText}},"&.Mui-selected:hover":{backgroundColor:THEME_COLORS.components.toggleButtonActive,"& > .icon":{fill:THEME_COLORS.components.toggleButtonActiveText}}})}},MuiToggleButtonGroup:{styleOverrides:{root:({theme:on})=>({borderRadius:on.spacing(4),backgroundColor:"transparent",flex:"0 0 auto","& .MuiToggleButtonGroup-grouped:not(:first-of-type)":{marginLeft:0,borderLeft:0}})}},MuiTooltip:{defaultProps:{disableInteractive:!0},styleOverrides:{tooltip:({theme:on})=>({border:`${on.spacing(1)} solid ${THEME_COLORS.components.tooltipBorder}`,backgroundColor:THEME_COLORS.components.tooltip,boxShadow:`0 ${on.spacing(1)} ${on.spacing(4)} 0 ${THEME_COLORS.base.shadow}`,color:THEME_COLORS.components.tooltipText,[`.${tooltipClasses.popper}[data-popper-placement*="left"] &`]:{marginRight:on.spacing(4)},[`.${tooltipClasses.popper}[data-popper-placement*="right"] &`]:{marginLeft:on.spacing(4)},[`.${tooltipClasses.popper}[data-popper-placement*="top"] &`]:{marginBottom:on.spacing(4)},[`.${tooltipClasses.popper}[data-popper-placement*="bottom"] &`]:{marginTop:on.spacing(4)}})}},MuiToolbar:{defaultProps:{variant:"dense"},styleOverrides:{root:({theme:on})=>({width:"100%",height:on.spacing(36),minHeight:on.spacing(36),paddingLeft:0,paddingRight:0,"@media (min-width: 600px)":{paddingLeft:0,paddingRight:0}})}},MuiTypography:{defaultProps:{variant:"body1"},styleOverrides:{root:{"&.ellipsis":{overflow:"hidden",textAlign:"start",textOverflow:"ellipsis",whiteSpace:"nowrap"}},h1:{"&.MuiTypography-root.MuiTypography-h1":{color:THEME_COLORS.base.heading}},h2:{"&.MuiTypography-root.MuiTypography-h2":{color:THEME_COLORS.base.heading}},h3:{"&.MuiTypography-root.MuiTypography-h3":{color:THEME_COLORS.base.heading}},h4:{"&.MuiTypography-root.MuiTypography-h4":{color:THEME_COLORS.base.heading}},h5:{"&.MuiTypography-root.MuiTypography-h5":{color:THEME_COLORS.base.heading}},h6:{"&.MuiTypography-root.MuiTypography-h6":{color:THEME_COLORS.base.heading}},subtitle1:{"&.MuiTypography-root.MuiTypography-subtitle1":{color:THEME_COLORS.base.textAlt}},subtitle2:{"&.MuiTypography-root.MuiTypography-subtitle2":{color:THEME_COLORS.base.textAlt}},body1:{"&.MuiTypography-root.MuiTypography-body1":{color:THEME_COLORS.base.text}},body2:{"&.MuiTypography-root.MuiTypography-body2":{color:THEME_COLORS.base.text}}}}}});function createNamedContext(on,In){const Rn=reactExports.createContext(on);return Rn.displayName=In,Rn}const COMPONENTS_CONTAINER_ID="components",ROOT_CONTAINER_ID="root",APP_LICENSE="ChilliCream License 1.0",APP_LICENSE_URL="https://chillicream.com/licensing/chillicream-license",APP_NAME="Nitro",APP_VERSION$1="32.0.0-insider.7",APP_SCHEME="chillicream-nitro-insider",APP_SIGNIN_PATH="signin-redirect",APP_GRAPHQL_CLIENT_ID="Q2xpZW50Cmc5ZjAwOTFmNTY5NmQ0NTZkOWUwZDQ0ZDMzYjJhZDJlOA==",COMPANY_NAME="ChilliCream, Inc.",COMPANY_URL="https://chillicream.com",cloudUriPattern=new RegExp("^https?:\\/\\/.*?\\.(bananacakepop\\.com|chillicream\\.com|chillicream\\.cloud)","i"),IS_RUNNING_IN_CLOUD=cloudUriPattern?.test(self.origin)??!1,IS_RUNNING_IN_ELECTRON=navigator.userAgent.indexOf("Electron")>=0,APP_TYPE=IS_RUNNING_IN_CLOUD?"cloud":IS_RUNNING_IN_ELECTRON?"app":"middleware",APP_AGENT=`${APP_NAME}/${APP_VERSION$1} (${APP_TYPE})`,OS_NAME=getOsName(),IS_MAC_LIKE=isMacLike();function getOsName(){return navigator.userAgent.indexOf("Win")>=0?"Windows":navigator.userAgent.indexOf("Mac")>=0?"macOS":navigator.userAgent.indexOf("X11")>=0||navigator.userAgent.indexOf("Linux")>=0?"Linux":"Unknown"}function isMacLike(){const on=navigator.userAgent.toLowerCase();return on.includes("mac os")||on.includes("ipad")}const CONTEXT_NOT_INITIALIZED="Context not initialized",HEADER_ACCEPT="Accept",HEADER_ACCEPT_ENCODING="Accept-Encoding",HEADER_AUTHORIZATION="Authorization",HEADER_CONTENT_TYPE="Content-Type",HEADER_FUSION_OPERATION_PLAN="Fusion-Operation-Plan",HEADER_ORIGIN="Origin",HEADER_SET_COOKIE="Set-Cookie",HEADER_USER_AGENT="User-Agent",HTTP_SCHEME_PATTERN=/^https?:\/\//i,HTTP_SECURE_SCHEME_PATTERN=/^https:\/\//i,WS_SCHEME_PATTERN=/^wss?:\/\//i,INTERPOLATION_PATTERN=/({{\s*[a-z0-9_\-|.:+#$!?;,]+\s*}})/gi,INTERPOLATION_VARIABLE_NAME_PATTERN=/{{\s*([a-z0-9_\-|.:+#$!?;,]+)\s*}}/gi,INTERPOLATION_EXPRESSION_PATTERN=/({{)(\s*)([a-z0-9_\-|.:+#$!?;,]+)(\s*)(}})/gi,FUSION_OPERATION_PLAN_HEADER_NAME_PATTERN=/fusion-operation-plan/i,STARTS_WITH_INTERPOLATION_PATTERN=/^{{/i,VALID_NAME_PATTERN=/^[a-z0-9]{1}[_\-&+.:#!/\\()[\]{}a-z0-9\s]{0,63}$/i,TWENTY_FIVE_MILLISECONDS=25,FIFTY_MILLISECONDS=50,ONE_HUNDRED_MILLISECONDS=100,TWO_HUNDRED_MILLISECONDS=200,TWO_HUNDRED_FIFTY_MILLISECONDS=250,THREE_HUNDRED_MILLISECONDS=300,FIVE_HUNDRED_MILLISECONDS=500,ONE_SECOND$1=1e3,TWO_SECONDS=2e3,FIVE_SECONDS=5e3,TEN_SECONDS=1e4,THIRTY_SECONDS=3e4,ONE_MINUTE$1=6e4,TWO_MINUTES=12e4,FIVE_MINUTES=3e5,SIX_HOURS=216e5,NINETY_DAYS=7776e6,PERSONAL_ORGANIZATION_ID="personal",PERSONAL_WORKSPACE_TENANT="personal";function getDuration(on){return on?on>0&&on<1?"~1 ms":on>0&&on<ONE_SECOND$1?on+" ms":on>=ONE_SECOND$1&&on<=ONE_MINUTE$1?Math.round(on/ONE_SECOND$1)+" sec":Math.round(on/ONE_MINUTE$1)+" min":"N/A"}function round$5(on,In){const Rn=Math.pow(10,In);return Math.round(on*Rn)/Rn}function getSize$2(on){return on?on<1e3?on+" B":on>=1e3&&on<1e6?round$5(on/1e3,1)+" KB":on>=1e6&&on<1e9?round$5(on/1e6,1)+" MB":round$5(on/1e9,1)+" GB":"N/A"}const ABORT_ERROR_NAME="AbortError",ABORT_ERROR=new DOMException("Action cancelled",ABORT_ERROR_NAME),TIMEOUT_ABORT_ERROR_MESSAGE="Action timed out",TIMEOUT_ABORT_ERROR=new DOMException(TIMEOUT_ABORT_ERROR_MESSAGE,ABORT_ERROR_NAME);class TimeoutAbortSignal{#e;#t;#r;constructor(In,Rn){this.#e=In,this.#t=Rn}get aborted(){return this.#e.aborted}get cancelled(){return this.#t()}get onabort(){return this.#e.onabort}get reason(){return this.#e.reason}dispatchEvent(In){return this.#e.dispatchEvent(In)}throwIfAborted(){this.#e.throwIfAborted()}toAbortSignal(){return this.#e}toPromise(){if(this.#r)return this.#r;const In=this;let Rn=!1;return this.#r=new Promise((Mn,Ln)=>{if(In.aborted){Rn=!0,Ln(TIMEOUT_ABORT_ERROR);return}if(In.cancelled){Rn=!0,Mn();return}function Hn(){In.removeEventListener("abort",Hn),In.removeEventListener("cancelled",jn),Rn||(Rn=!0,Ln(TIMEOUT_ABORT_ERROR))}function jn(){In.removeEventListener("abort",Hn),In.removeEventListener("cancelled",jn),Rn||(Rn=!0,Mn())}In.addEventListener("abort",Hn),In.addEventListener("cancelled",jn)}),this.#r}addEventListener(In,Rn,Mn){this.#e.addEventListener(In,Rn,Mn)}removeEventListener(In,Rn,Mn){this.#e.removeEventListener(In,Rn,Mn)}}class TimeoutAbortController{_controller=new AbortController;_signal=new TimeoutAbortSignal(this._controller.signal,()=>this._cancelled);_cancelled=!1;_timeoutHandle;constructor(In){this._timeoutHandle=self.setTimeout(()=>{this.abort(TIMEOUT_ABORT_ERROR_MESSAGE)},In)}get signal(){return this._signal}abort(In){this._controller.abort(In)}cancel(){this._cancelled=!0,self.clearTimeout(this._timeoutHandle),this._signal.dispatchEvent(new Event("cancelled"))}}function isAbortError(on){return on instanceof DOMException&&on.name===ABORT_ERROR_NAME}function isTimeoutAbortError(on){return isAbortError(on)&&on.message===TIMEOUT_ABORT_ERROR_MESSAGE}function linkAbortSignals(on,In){const Rn=new AbortController;if(on.aborted||In.aborted)Rn.abort(on.reason??In.reason);else{let Mn=function(Hn){return()=>{Rn.signal.aborted||Rn.abort(Hn.reason)}},Ln=function(){Rn.signal.removeEventListener("abort",Ln),on.removeEventListener("abort",Mn(on)),In.removeEventListener("abort",Mn(In))};Rn.signal.addEventListener("abort",Ln),on.addEventListener("abort",Mn(on)),In.addEventListener("abort",Mn(In))}return Rn.signal}function createAbortScope(on,In,Rn){return Rn?Rn.aborted?Promise.reject(ABORT_ERROR):(Rn.addEventListener("abort",on),In().finally(()=>{Rn.removeEventListener("abort",on)})):In()}function distinct(on){return on.filter((In,Rn,Mn)=>Mn.indexOf(In)===Rn)}function equals(on,In){let Rn=on.length;if(Rn!==In.length)return!1;for(;Rn--;)if(on[Rn]!==In[Rn])return!1;return!0}class LinkedListImplementation{stack;constructor(In){this.stack=In?[...In]:[]}append(In){return this.stack.indexOf(In)===-1&&this.stack.push(In),this}find(In){const Rn=this.stack.indexOf(In);return Rn!==-1?this.stack[Rn]:null}getFirst(){return this.stack[0]||null}setFirst(In){const Rn=this.stack.indexOf(In);return Rn!==0&&In&&(Rn===-1?this.stack.splice(0,0,In):this.stack.splice(0,0,this.stack.splice(Rn,1).pop())),this}getLast(){return this.stack.length>0?this.stack[this.stack.length-1]:null}setLast(In){const Rn=this.stack.indexOf(In),Mn=this.stack.length-1;return(Rn===-1||Rn!==Mn)&&In&&(Rn===-1?this.stack.push(In):this.stack.push(this.stack.splice(Rn,1).pop())),this}count(){return this.stack.length}remove(...In){return In.forEach(Rn=>{const Mn=this.stack.indexOf(Rn);Mn!==-1&&this.stack.splice(Mn,1)}),this}update(In,Rn){const Mn=this.stack.indexOf(In);return Mn!==-1&&this.stack.splice(Mn,1,Rn),this}toArray(){return[].concat(this.stack)}}function createLinkedList(on){return new LinkedListImplementation(on)}function encodeBase64$1(on,In){return Buffer$1.from(on,In).toString("base64")}function decodeBase64(on,In){return Buffer$1.from(on,"base64").toString(In)}function beautifyEndpoint(on,In){if(on?.length){let Rn=on?.trim().replace(HTTP_SCHEME_PATTERN,"");const Mn=Rn.indexOf("/");return Mn===-1?Rn:Rn.substring(0,Mn)}return In??""}var inherits_browser={exports:{}},hasRequiredInherits_browser;function requireInherits_browser(){return hasRequiredInherits_browser||(hasRequiredInherits_browser=1,typeof Object.create=="function"?inherits_browser.exports=function(In,Rn){Rn&&(In.super_=Rn,In.prototype=Object.create(Rn.prototype,{constructor:{value:In,enumerable:!1,writable:!0,configurable:!0}}))}:inherits_browser.exports=function(In,Rn){if(Rn){In.super_=Rn;var Mn=function(){};Mn.prototype=Rn.prototype,In.prototype=new Mn,In.prototype.constructor=In}}),inherits_browser.exports}var safeBuffer$1={exports:{}},dist$2={},hasRequiredDist;function requireDist(){return hasRequiredDist||(hasRequiredDist=1,function(on){Object.defineProperties(on,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var In={},Rn={};Rn.byteLength=vi,Rn.toByteArray=mi,Rn.fromByteArray=Ei;for(var Mn=[],Ln=[],Hn=typeof Uint8Array<"u"?Uint8Array:Array,jn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Wn=0,Yn=jn.length;Wn<Yn;++Wn)Mn[Wn]=jn[Wn],Ln[jn.charCodeAt(Wn)]=Wn;Ln[45]=62,Ln[95]=63;function hi(Ci){var Ai=Ci.length;if(Ai%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var Ii=Ci.indexOf("=");Ii===-1&&(Ii=Ai);var Ni=Ii===Ai?0:4-Ii%4;return[Ii,Ni]}function vi(Ci){var Ai=hi(Ci),Ii=Ai[0],Ni=Ai[1];return(Ii+Ni)*3/4-Ni}function gi(Ci,Ai,Ii){return(Ai+Ii)*3/4-Ii}function mi(Ci){var Ai,Ii=hi(Ci),Ni=Ii[0],Pi=Ii[1],Vi=new Hn(gi(Ci,Ni,Pi)),Ui=0,Gi=Pi>0?Ni-4:Ni,Yi;for(Yi=0;Yi<Gi;Yi+=4)Ai=Ln[Ci.charCodeAt(Yi)]<<18|Ln[Ci.charCodeAt(Yi+1)]<<12|Ln[Ci.charCodeAt(Yi+2)]<<6|Ln[Ci.charCodeAt(Yi+3)],Vi[Ui++]=Ai>>16&255,Vi[Ui++]=Ai>>8&255,Vi[Ui++]=Ai&255;return Pi===2&&(Ai=Ln[Ci.charCodeAt(Yi)]<<2|Ln[Ci.charCodeAt(Yi+1)]>>4,Vi[Ui++]=Ai&255),Pi===1&&(Ai=Ln[Ci.charCodeAt(Yi)]<<10|Ln[Ci.charCodeAt(Yi+1)]<<4|Ln[Ci.charCodeAt(Yi+2)]>>2,Vi[Ui++]=Ai>>8&255,Vi[Ui++]=Ai&255),Vi}function yi(Ci){return Mn[Ci>>18&63]+Mn[Ci>>12&63]+Mn[Ci>>6&63]+Mn[Ci&63]}function bi(Ci,Ai,Ii){for(var Ni,Pi=[],Vi=Ai;Vi<Ii;Vi+=3)Ni=(Ci[Vi]<<16&16711680)+(Ci[Vi+1]<<8&65280)+(Ci[Vi+2]&255),Pi.push(yi(Ni));return Pi.join("")}function Ei(Ci){for(var Ai,Ii=Ci.length,Ni=Ii%3,Pi=[],Vi=16383,Ui=0,Gi=Ii-Ni;Ui<Gi;Ui+=Vi)Pi.push(bi(Ci,Ui,Ui+Vi>Gi?Gi:Ui+Vi));return Ni===1?(Ai=Ci[Ii-1],Pi.push(Mn[Ai>>2]+Mn[Ai<<4&63]+"==")):Ni===2&&(Ai=(Ci[Ii-2]<<8)+Ci[Ii-1],Pi.push(Mn[Ai>>10]+Mn[Ai>>4&63]+Mn[Ai<<2&63]+"=")),Pi.join("")}var _i={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */_i.read=function(Ci,Ai,Ii,Ni,Pi){var Vi,Ui,Gi=Pi*8-Ni-1,Yi=(1<<Gi)-1,zi=Yi>>1,Mi=-7,Li=Ii?Pi-1:0,wi=Ii?-1:1,Ri=Ci[Ai+Li];for(Li+=wi,Vi=Ri&(1<<-Mi)-1,Ri>>=-Mi,Mi+=Gi;Mi>0;Vi=Vi*256+Ci[Ai+Li],Li+=wi,Mi-=8);for(Ui=Vi&(1<<-Mi)-1,Vi>>=-Mi,Mi+=Ni;Mi>0;Ui=Ui*256+Ci[Ai+Li],Li+=wi,Mi-=8);if(Vi===0)Vi=1-zi;else{if(Vi===Yi)return Ui?NaN:(Ri?-1:1)*(1/0);Ui=Ui+Math.pow(2,Ni),Vi=Vi-zi}return(Ri?-1:1)*Ui*Math.pow(2,Vi-Ni)},_i.write=function(Ci,Ai,Ii,Ni,Pi,Vi){var Ui,Gi,Yi,zi=Vi*8-Pi-1,Mi=(1<<zi)-1,Li=Mi>>1,wi=Pi===23?Math.pow(2,-24)-Math.pow(2,-77):0,Ri=Ni?0:Vi-1,ki=Ni?1:-1,Bi=Ai<0||Ai===0&&1/Ai<0?1:0;for(Ai=Math.abs(Ai),isNaN(Ai)||Ai===1/0?(Gi=isNaN(Ai)?1:0,Ui=Mi):(Ui=Math.floor(Math.log(Ai)/Math.LN2),Ai*(Yi=Math.pow(2,-Ui))<1&&(Ui--,Yi*=2),Ui+Li>=1?Ai+=wi/Yi:Ai+=wi*Math.pow(2,1-Li),Ai*Yi>=2&&(Ui++,Yi/=2),Ui+Li>=Mi?(Gi=0,Ui=Mi):Ui+Li>=1?(Gi=(Ai*Yi-1)*Math.pow(2,Pi),Ui=Ui+Li):(Gi=Ai*Math.pow(2,Li-1)*Math.pow(2,Pi),Ui=0));Pi>=8;Ci[Ii+Ri]=Gi&255,Ri+=ki,Gi/=256,Pi-=8);for(Ui=Ui<<Pi|Gi,zi+=Pi;zi>0;Ci[Ii+Ri]=Ui&255,Ri+=ki,Ui/=256,zi-=8);Ci[Ii+Ri-ki]|=Bi*128};/*!
|
|
4231
4231
|
* The buffer module from node.js, for the browser.
|
|
4232
4232
|
*
|
|
4233
4233
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
@@ -4370,7 +4370,7 @@ ${In}</tr>
|
|
|
4370
4370
|
`}tablecell(In,Rn){const Mn=Rn.header?"th":"td";return(Rn.align?`<${Mn} align="${Rn.align}">`:`<${Mn}>`)+In+`</${Mn}>
|
|
4371
4371
|
`}strong(In){return`<strong>${In}</strong>`}em(In){return`<em>${In}</em>`}codespan(In){return`<code>${In}</code>`}br(){return this.options.xhtml?"<br/>":"<br>"}del(In){return`<del>${In}</del>`}link(In,Rn,Mn){if(In=cleanUrl(this.options.sanitize,this.options.baseUrl,In),In===null)return Mn;let Ln='<a href="'+In+'"';return Rn&&(Ln+=' title="'+Rn+'"'),Ln+=">"+Mn+"</a>",Ln}image(In,Rn,Mn){if(In=cleanUrl(this.options.sanitize,this.options.baseUrl,In),In===null)return Mn;let Ln=`<img src="${In}" alt="${Mn}"`;return Rn&&(Ln+=` title="${Rn}"`),Ln+=this.options.xhtml?"/>":">",Ln}text(In){return In}}class TextRenderer{strong(In){return In}em(In){return In}codespan(In){return In}del(In){return In}html(In){return In}text(In){return In}link(In,Rn,Mn){return""+Mn}image(In,Rn,Mn){return""+Mn}br(){return""}}class Slugger{constructor(){this.seen={}}serialize(In){return In.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(In,Rn){let Mn=In,Ln=0;if(this.seen.hasOwnProperty(Mn)){Ln=this.seen[In];do Ln++,Mn=In+"-"+Ln;while(this.seen.hasOwnProperty(Mn))}return Rn||(this.seen[In]=Ln,this.seen[Mn]=0),Mn}slug(In,Rn={}){const Mn=this.serialize(In);return this.getNextSafeSlug(Mn,Rn.dryrun)}}let Parser$3=class Lv{constructor(In){this.options=In||defaults$2,this.options.renderer=this.options.renderer||new Renderer,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new TextRenderer,this.slugger=new Slugger}static parse(In,Rn){return new Lv(Rn).parse(In)}static parseInline(In,Rn){return new Lv(Rn).parseInline(In)}parse(In,Rn=!0){let Mn="",Ln,Hn,jn,Wn,Yn,hi,vi,gi,mi,yi,bi,Ei,_i,xi,Ci,Ai,Ii,Ni,Pi;const Vi=In.length;for(Ln=0;Ln<Vi;Ln++){if(yi=In[Ln],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[yi.type]&&(Pi=this.options.extensions.renderers[yi.type].call({parser:this},yi),Pi!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(yi.type))){Mn+=Pi||"";continue}switch(yi.type){case"space":continue;case"hr":{Mn+=this.renderer.hr();continue}case"heading":{Mn+=this.renderer.heading(this.parseInline(yi.tokens),yi.depth,unescape$1(this.parseInline(yi.tokens,this.textRenderer)),this.slugger);continue}case"code":{Mn+=this.renderer.code(yi.text,yi.lang,yi.escaped);continue}case"table":{for(gi="",vi="",Wn=yi.header.length,Hn=0;Hn<Wn;Hn++)vi+=this.renderer.tablecell(this.parseInline(yi.header[Hn].tokens),{header:!0,align:yi.align[Hn]});for(gi+=this.renderer.tablerow(vi),mi="",Wn=yi.rows.length,Hn=0;Hn<Wn;Hn++){for(hi=yi.rows[Hn],vi="",Yn=hi.length,jn=0;jn<Yn;jn++)vi+=this.renderer.tablecell(this.parseInline(hi[jn].tokens),{header:!1,align:yi.align[jn]});mi+=this.renderer.tablerow(vi)}Mn+=this.renderer.table(gi,mi);continue}case"blockquote":{mi=this.parse(yi.tokens),Mn+=this.renderer.blockquote(mi);continue}case"list":{for(bi=yi.ordered,Ei=yi.start,_i=yi.loose,Wn=yi.items.length,mi="",Hn=0;Hn<Wn;Hn++)Ci=yi.items[Hn],Ai=Ci.checked,Ii=Ci.task,xi="",Ci.task&&(Ni=this.renderer.checkbox(Ai),_i?Ci.tokens.length>0&&Ci.tokens[0].type==="paragraph"?(Ci.tokens[0].text=Ni+" "+Ci.tokens[0].text,Ci.tokens[0].tokens&&Ci.tokens[0].tokens.length>0&&Ci.tokens[0].tokens[0].type==="text"&&(Ci.tokens[0].tokens[0].text=Ni+" "+Ci.tokens[0].tokens[0].text)):Ci.tokens.unshift({type:"text",text:Ni}):xi+=Ni),xi+=this.parse(Ci.tokens,_i),mi+=this.renderer.listitem(xi,Ii,Ai);Mn+=this.renderer.list(mi,bi,Ei);continue}case"html":{Mn+=this.renderer.html(yi.text);continue}case"paragraph":{Mn+=this.renderer.paragraph(this.parseInline(yi.tokens));continue}case"text":{for(mi=yi.tokens?this.parseInline(yi.tokens):yi.text;Ln+1<Vi&&In[Ln+1].type==="text";)yi=In[++Ln],mi+=`
|
|
4372
4372
|
`+(yi.tokens?this.parseInline(yi.tokens):yi.text);Mn+=Rn?this.renderer.paragraph(mi):mi;continue}default:{const Ui='Token with "'+yi.type+'" type was not found.';if(this.options.silent){console.error(Ui);return}else throw new Error(Ui)}}}return Mn}parseInline(In,Rn){Rn=Rn||this.renderer;let Mn="",Ln,Hn,jn;const Wn=In.length;for(Ln=0;Ln<Wn;Ln++){if(Hn=In[Ln],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[Hn.type]&&(jn=this.options.extensions.renderers[Hn.type].call({parser:this},Hn),jn!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(Hn.type))){Mn+=jn||"";continue}switch(Hn.type){case"escape":{Mn+=Rn.text(Hn.text);break}case"html":{Mn+=Rn.html(Hn.text);break}case"link":{Mn+=Rn.link(Hn.href,Hn.title,this.parseInline(Hn.tokens,Rn));break}case"image":{Mn+=Rn.image(Hn.href,Hn.title,Hn.text);break}case"strong":{Mn+=Rn.strong(this.parseInline(Hn.tokens,Rn));break}case"em":{Mn+=Rn.em(this.parseInline(Hn.tokens,Rn));break}case"codespan":{Mn+=Rn.codespan(Hn.text);break}case"br":{Mn+=Rn.br();break}case"del":{Mn+=Rn.del(this.parseInline(Hn.tokens,Rn));break}case"text":{Mn+=Rn.text(Hn.text);break}default:{const Yn='Token with "'+Hn.type+'" type was not found.';if(this.options.silent){console.error(Yn);return}else throw new Error(Yn)}}}return Mn}};class Hooks{constructor(In){this.options=In||defaults$2}static passThroughHooks=new Set(["preprocess","postprocess"]);preprocess(In){return In}postprocess(In){return In}}function onError(on,In,Rn){return Mn=>{if(Mn.message+=`
|
|
4373
|
-
Please report this to https://github.com/markedjs/marked.`,on){const Ln="<p>An error occurred:</p><pre>"+escape$1(Mn.message+"",!0)+"</pre>";if(In)return Promise.resolve(Ln);if(Rn){Rn(null,Ln);return}return Ln}if(In)return Promise.reject(Mn);if(Rn){Rn(Mn);return}throw Mn}}function parseMarkdown(on,In){return(Rn,Mn,Ln)=>{typeof Mn=="function"&&(Ln=Mn,Mn=null);const Hn={...Mn};Mn={...marked.defaults,...Hn};const jn=onError(Mn.silent,Mn.async,Ln);if(typeof Rn>"u"||Rn===null)return jn(new Error("marked(): input parameter is undefined or null"));if(typeof Rn!="string")return jn(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Rn)+", string expected"));if(checkSanitizeDeprecation(Mn),Mn.hooks&&(Mn.hooks.options=Mn),Ln){const Wn=Mn.highlight;let Yn;try{Mn.hooks&&(Rn=Mn.hooks.preprocess(Rn)),Yn=on(Rn,Mn)}catch(gi){return jn(gi)}const hi=function(gi){let mi;if(!gi)try{Mn.walkTokens&&marked.walkTokens(Yn,Mn.walkTokens),mi=In(Yn,Mn),Mn.hooks&&(mi=Mn.hooks.postprocess(mi))}catch(yi){gi=yi}return Mn.highlight=Wn,gi?jn(gi):Ln(null,mi)};if(!Wn||Wn.length<3||(delete Mn.highlight,!Yn.length))return hi();let vi=0;marked.walkTokens(Yn,function(gi){gi.type==="code"&&(vi++,setTimeout(()=>{Wn(gi.text,gi.lang,function(mi,yi){if(mi)return hi(mi);yi!=null&&yi!==gi.text&&(gi.text=yi,gi.escaped=!0),vi--,vi===0&&hi()})},0))}),vi===0&&hi();return}if(Mn.async)return Promise.resolve(Mn.hooks?Mn.hooks.preprocess(Rn):Rn).then(Wn=>on(Wn,Mn)).then(Wn=>Mn.walkTokens?Promise.all(marked.walkTokens(Wn,Mn.walkTokens)).then(()=>Wn):Wn).then(Wn=>In(Wn,Mn)).then(Wn=>Mn.hooks?Mn.hooks.postprocess(Wn):Wn).catch(jn);try{Mn.hooks&&(Rn=Mn.hooks.preprocess(Rn));const Wn=on(Rn,Mn);Mn.walkTokens&&marked.walkTokens(Wn,Mn.walkTokens);let Yn=In(Wn,Mn);return Mn.hooks&&(Yn=Mn.hooks.postprocess(Yn)),Yn}catch(Wn){return jn(Wn)}}}function marked(on,In,Rn){return parseMarkdown(Lexer$2.lex,Parser$3.parse)(on,In,Rn)}marked.options=marked.setOptions=function(on){return marked.defaults={...marked.defaults,...on},changeDefaults(marked.defaults),marked};marked.getDefaults=getDefaults;marked.defaults=defaults$2;marked.use=function(...on){const In=marked.defaults.extensions||{renderers:{},childTokens:{}};on.forEach(Rn=>{const Mn={...Rn};if(Mn.async=marked.defaults.async||Mn.async||!1,Rn.extensions&&(Rn.extensions.forEach(Ln=>{if(!Ln.name)throw new Error("extension name required");if(Ln.renderer){const Hn=In.renderers[Ln.name];Hn?In.renderers[Ln.name]=function(...jn){let Wn=Ln.renderer.apply(this,jn);return Wn===!1&&(Wn=Hn.apply(this,jn)),Wn}:In.renderers[Ln.name]=Ln.renderer}if(Ln.tokenizer){if(!Ln.level||Ln.level!=="block"&&Ln.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");In[Ln.level]?In[Ln.level].unshift(Ln.tokenizer):In[Ln.level]=[Ln.tokenizer],Ln.start&&(Ln.level==="block"?In.startBlock?In.startBlock.push(Ln.start):In.startBlock=[Ln.start]:Ln.level==="inline"&&(In.startInline?In.startInline.push(Ln.start):In.startInline=[Ln.start]))}Ln.childTokens&&(In.childTokens[Ln.name]=Ln.childTokens)}),Mn.extensions=In),Rn.renderer){const Ln=marked.defaults.renderer||new Renderer;for(const Hn in Rn.renderer){const jn=Ln[Hn];Ln[Hn]=(...Wn)=>{let Yn=Rn.renderer[Hn].apply(Ln,Wn);return Yn===!1&&(Yn=jn.apply(Ln,Wn)),Yn}}Mn.renderer=Ln}if(Rn.tokenizer){const Ln=marked.defaults.tokenizer||new Tokenizer;for(const Hn in Rn.tokenizer){const jn=Ln[Hn];Ln[Hn]=(...Wn)=>{let Yn=Rn.tokenizer[Hn].apply(Ln,Wn);return Yn===!1&&(Yn=jn.apply(Ln,Wn)),Yn}}Mn.tokenizer=Ln}if(Rn.hooks){const Ln=marked.defaults.hooks||new Hooks;for(const Hn in Rn.hooks){const jn=Ln[Hn];Hooks.passThroughHooks.has(Hn)?Ln[Hn]=Wn=>{if(marked.defaults.async)return Promise.resolve(Rn.hooks[Hn].call(Ln,Wn)).then(hi=>jn.call(Ln,hi));const Yn=Rn.hooks[Hn].call(Ln,Wn);return jn.call(Ln,Yn)}:Ln[Hn]=(...Wn)=>{let Yn=Rn.hooks[Hn].apply(Ln,Wn);return Yn===!1&&(Yn=jn.apply(Ln,Wn)),Yn}}Mn.hooks=Ln}if(Rn.walkTokens){const Ln=marked.defaults.walkTokens;Mn.walkTokens=function(Hn){let jn=[];return jn.push(Rn.walkTokens.call(this,Hn)),Ln&&(jn=jn.concat(Ln.call(this,Hn))),jn}}marked.setOptions(Mn)})};marked.walkTokens=function(on,In){let Rn=[];for(const Mn of on)switch(Rn=Rn.concat(In.call(marked,Mn)),Mn.type){case"table":{for(const Ln of Mn.header)Rn=Rn.concat(marked.walkTokens(Ln.tokens,In));for(const Ln of Mn.rows)for(const Hn of Ln)Rn=Rn.concat(marked.walkTokens(Hn.tokens,In));break}case"list":{Rn=Rn.concat(marked.walkTokens(Mn.items,In));break}default:marked.defaults.extensions&&marked.defaults.extensions.childTokens&&marked.defaults.extensions.childTokens[Mn.type]?marked.defaults.extensions.childTokens[Mn.type].forEach(function(Ln){Rn=Rn.concat(marked.walkTokens(Mn[Ln],In))}):Mn.tokens&&(Rn=Rn.concat(marked.walkTokens(Mn.tokens,In)))}return Rn};marked.parseInline=parseMarkdown(Lexer$2.lexInline,Parser$3.parseInline);marked.Parser=Parser$3;marked.parser=Parser$3.parse;marked.Renderer=Renderer;marked.TextRenderer=TextRenderer;marked.Lexer=Lexer$2;marked.lexer=Lexer$2.lex;marked.Tokenizer=Tokenizer;marked.Slugger=Slugger;marked.Hooks=Hooks;marked.parse=marked;marked.options;marked.setOptions;marked.use;marked.walkTokens;marked.parseInline;Parser$3.parse;Lexer$2.lex;const renderer=new marked.Renderer,linkRenderer=renderer.link;renderer.link=(on,In,Rn)=>{const Mn=on?.startsWith(`${window.location.protocol}//${window.location.hostname}`)??!0,Ln=linkRenderer.call(renderer,on,In,Rn);return Mn?Ln:Ln.replace(/^<a /,'<a rel="nofollow noopener noreferrer" target="_blank" ')};marked.setOptions({gfm:!1,sanitizer:purify.sanitize,renderer});function renderMarkdown(on){return marked(on)}function createSubject(on){let In=on;const Rn=new Set,Mn={value:()=>In,subscribe:Ln=>{const Hn={onNext:Ln};return Rn.add(Hn),()=>{Rn.has(Hn)&&Rn.delete(Hn)}}};return{...Mn,observable:Mn,next:Ln=>{Ln instanceof Function?In=Ln(In):In=Ln,Rn.forEach(({onNext:Hn})=>Hn(In))},unsubscribeAll:()=>{Rn.forEach(Ln=>{Rn.delete(Ln)})}}}function useSubject(on){const In=reactExports.useRef();return In.current||(In.current=createSubject(on)),In}function useSelectionObservable(on,In,Rn){const Mn=useSubject(on?In(on.value()):Rn);return reactExports.useEffect(()=>{function Ln(Hn){Mn.current.value()!==Hn&&Mn.current.next(Hn)}if(!on){Ln(Rn);return}return Ln(In(on.value())),on.subscribe(Hn=>{Ln(In(Hn))})},[Rn,Mn,on,In]),Mn.current.observable}function useCurrentValue(on,In,Rn){return on?In(on.value()):Rn}function useSubjectNext(on,In){return reactExports.useCallback(Rn=>{on&&on.next(Mn=>In(Mn,Rn))},[on,In])}function useCombine(on,In){const Rn=useSubject([on.value(),In.value()]);return reactExports.useEffect(()=>{function Mn(Ln){Rn.current.value()[0]!==Ln&&Rn.current.next([Ln,In.value()])}return Mn(on.value()),on.subscribe(Mn)},[on,In,Rn]),reactExports.useEffect(()=>{function Mn(Ln){Rn.current.value()[1]!==Ln&&Rn.current.next([on.value(),Ln])}return Mn(In.value()),In.subscribe(Mn)},[on,In,Rn]),Rn.current.observable}function useRefWithInitializer(on){const In=reactExports.useRef(void 0),Rn=reactExports.useRef(!1);return Rn.current||(Rn.current=!0,In.current=on()),In}function createVirtualScrolling(on,In="horizontal"){function Rn(Mn){on&&In==="horizontal"&&!Mn.shiftKey&&Mn.deltaY&&(on.scrollLeft+=Mn.deltaY)}return on.addEventListener("wheel",Rn,{passive:!0}),()=>{on.removeEventListener("wheel",Rn)}}function appendUrlSegment(on,In){return on=new URL(on),In==null||(In.startsWith("/")&&(In=In.substring(1)),on.pathname.endsWith("/")||(on.pathname+="/"),on.pathname+=In),on}function tryParseUrl(on){try{return new URL(on)}catch{return}}function removeTrailingSlash(on){return on.replace(/\/$/,"")}const instanceOfAny=(on,In)=>In.some(Rn=>on instanceof Rn);let idbProxyableTypes,cursorAdvanceMethods;function getIdbProxyableTypes(){return idbProxyableTypes||(idbProxyableTypes=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function getCursorAdvanceMethods(){return cursorAdvanceMethods||(cursorAdvanceMethods=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const cursorRequestMap=new WeakMap,transactionDoneMap=new WeakMap,transactionStoreNamesMap=new WeakMap,transformCache=new WeakMap,reverseTransformCache=new WeakMap;function promisifyRequest(on){const In=new Promise((Rn,Mn)=>{const Ln=()=>{on.removeEventListener("success",Hn),on.removeEventListener("error",jn)},Hn=()=>{Rn(wrap$1(on.result)),Ln()},jn=()=>{Mn(on.error),Ln()};on.addEventListener("success",Hn),on.addEventListener("error",jn)});return In.then(Rn=>{Rn instanceof IDBCursor&&cursorRequestMap.set(Rn,on)}).catch(()=>{}),reverseTransformCache.set(In,on),In}function cacheDonePromiseForTransaction(on){if(transactionDoneMap.has(on))return;const In=new Promise((Rn,Mn)=>{const Ln=()=>{on.removeEventListener("complete",Hn),on.removeEventListener("error",jn),on.removeEventListener("abort",jn)},Hn=()=>{Rn(),Ln()},jn=()=>{Mn(on.error||new DOMException("AbortError","AbortError")),Ln()};on.addEventListener("complete",Hn),on.addEventListener("error",jn),on.addEventListener("abort",jn)});transactionDoneMap.set(on,In)}let idbProxyTraps={get(on,In,Rn){if(on instanceof IDBTransaction){if(In==="done")return transactionDoneMap.get(on);if(In==="objectStoreNames")return on.objectStoreNames||transactionStoreNamesMap.get(on);if(In==="store")return Rn.objectStoreNames[1]?void 0:Rn.objectStore(Rn.objectStoreNames[0])}return wrap$1(on[In])},set(on,In,Rn){return on[In]=Rn,!0},has(on,In){return on instanceof IDBTransaction&&(In==="done"||In==="store")?!0:In in on}};function replaceTraps(on){idbProxyTraps=on(idbProxyTraps)}function wrapFunction(on){return on===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(In,...Rn){const Mn=on.call(unwrap(this),In,...Rn);return transactionStoreNamesMap.set(Mn,In.sort?In.sort():[In]),wrap$1(Mn)}:getCursorAdvanceMethods().includes(on)?function(...In){return on.apply(unwrap(this),In),wrap$1(cursorRequestMap.get(this))}:function(...In){return wrap$1(on.apply(unwrap(this),In))}}function transformCachableValue(on){return typeof on=="function"?wrapFunction(on):(on instanceof IDBTransaction&&cacheDonePromiseForTransaction(on),instanceOfAny(on,getIdbProxyableTypes())?new Proxy(on,idbProxyTraps):on)}function wrap$1(on){if(on instanceof IDBRequest)return promisifyRequest(on);if(transformCache.has(on))return transformCache.get(on);const In=transformCachableValue(on);return In!==on&&(transformCache.set(on,In),reverseTransformCache.set(In,on)),In}const unwrap=on=>reverseTransformCache.get(on);function openDB(on,In,{blocked:Rn,upgrade:Mn,blocking:Ln,terminated:Hn}={}){const jn=indexedDB.open(on,In),Wn=wrap$1(jn);return Mn&&jn.addEventListener("upgradeneeded",Yn=>{Mn(wrap$1(jn.result),Yn.oldVersion,Yn.newVersion,wrap$1(jn.transaction),Yn)}),Rn&&jn.addEventListener("blocked",Yn=>Rn(Yn.oldVersion,Yn.newVersion,Yn)),Wn.then(Yn=>{Hn&&Yn.addEventListener("close",()=>Hn()),Ln&&Yn.addEventListener("versionchange",hi=>Ln(hi.oldVersion,hi.newVersion,hi))}).catch(()=>{}),Wn}function deleteDB(on,{blocked:In}={}){const Rn=indexedDB.deleteDatabase(on);return In&&Rn.addEventListener("blocked",Mn=>In(Mn.oldVersion,Mn)),wrap$1(Rn).then(()=>{})}const readMethods=["get","getKey","getAll","getAllKeys","count"],writeMethods=["put","add","delete","clear"],cachedMethods=new Map;function getMethod(on,In){if(!(on instanceof IDBDatabase&&!(In in on)&&typeof In=="string"))return;if(cachedMethods.get(In))return cachedMethods.get(In);const Rn=In.replace(/FromIndex$/,""),Mn=In!==Rn,Ln=writeMethods.includes(Rn);if(!(Rn in(Mn?IDBIndex:IDBObjectStore).prototype)||!(Ln||readMethods.includes(Rn)))return;const Hn=async function(jn,...Wn){const Yn=this.transaction(jn,Ln?"readwrite":"readonly");let hi=Yn.store;return Mn&&(hi=hi.index(Wn.shift())),(await Promise.all([hi[Rn](...Wn),Ln&&Yn.done]))[0]};return cachedMethods.set(In,Hn),Hn}replaceTraps(on=>({...on,get:(In,Rn,Mn)=>getMethod(In,Rn)||on.get(In,Rn,Mn),has:(In,Rn)=>!!getMethod(In,Rn)||on.has(In,Rn)}));const advanceMethodProps=["continue","continuePrimaryKey","advance"],methodMap={},advanceResults=new WeakMap,ittrProxiedCursorToOriginalProxy=new WeakMap,cursorIteratorTraps={get(on,In){if(!advanceMethodProps.includes(In))return on[In];let Rn=methodMap[In];return Rn||(Rn=methodMap[In]=function(...Mn){advanceResults.set(this,ittrProxiedCursorToOriginalProxy.get(this)[In](...Mn))}),Rn}};async function*iterate(...on){let In=this;if(In instanceof IDBCursor||(In=await In.openCursor(...on)),!In)return;In=In;const Rn=new Proxy(In,cursorIteratorTraps);for(ittrProxiedCursorToOriginalProxy.set(Rn,In),reverseTransformCache.set(Rn,unwrap(In));In;)yield Rn,In=await(advanceResults.get(Rn)||In.continue()),advanceResults.delete(Rn)}function isIteratorProp(on,In){return In===Symbol.asyncIterator&&instanceOfAny(on,[IDBIndex,IDBObjectStore,IDBCursor])||In==="iterate"&&instanceOfAny(on,[IDBIndex,IDBObjectStore])}replaceTraps(on=>({...on,get(In,Rn,Mn){return isIteratorProp(In,Rn)?iterate:on.get(In,Rn,Mn)},has(In,Rn){return isIteratorProp(In,Rn)||on.has(In,Rn)}}));const stores={app:!0,attachment:!0,item:!0,mutex:!0,schema:!0,"schema-attachment":!0,session:!0,setting:!0,tab:!0,"tab-view-state":!0,"update-log":!0,workspace:!0,"workspace-sync":!0},STORE_NAMES=Object.keys(stores),DB_NAME="chillicream-nitro";function getDatabaseName(){return self.appNamespace?`${DB_NAME}-${self.appNamespace}`:DB_NAME}function deleteEntity(on,In){return openDatabaseScope(Rn=>Rn.delete(on,In))}function getAllEntities(on){return openDatabaseScope(In=>In.getAll(on))}function getEntityByKey(on,In){return openDatabaseScope(Rn=>Rn.get(on,In))}function putEntity(on,In){return openDatabaseScope(async Rn=>{await Rn.put(on,In)})}async function updateEntityTransactional(on,In,Rn){let Mn=await on.get(In);return Mn&&(Mn=Rn(Mn),Mn&&await on.put(Mn)),Mn}function openDatabase(){return openDB(getDatabaseName())}async function openDatabaseScope(on){const In=await openDatabase();try{return await on(In)}finally{In.close()}}async function openTransactionScope(on,In,Rn,Mn,Ln){const Hn=await createTransaction(on,In,Rn);try{return Ln?await createAbortScope(()=>Hn.abort("transaction aborted"),()=>Mn(Hn,on.version),Ln):await Mn(Hn,on.version)}finally{await Hn.done}}function openDatabaseWithTransactionScope(on,In,Rn,Mn){return openDatabaseScope(Ln=>openTransactionScope(Ln,on,In,Rn,Mn))}function deleteDatabase(){return deleteDB(getDatabaseName())}async function databaseExists(on){const In=await window.indexedDB.databases(),Rn=getDatabaseName();return In.some(({name:Mn,version:Ln})=>Mn===Rn&&!0)}const camelizationCache=new Map;function camelizeString(on){let In=camelizationCache.get(on);return In||(In=on.split("-").reduce((Rn,Mn)=>(Mn&&(Rn!==""?(Rn+=Mn[0].toUpperCase(),Rn+=Mn.substring(1)):Rn=Mn),Rn),""),camelizationCache.set(on,In)),In}async function createTransaction(on,In,Rn){const Mn=on.transaction(In,Rn),Ln={},Hn={};for(const jn of In){const Wn=Mn.objectStore(jn),Yn=camelizeString(jn);Ln[Yn]=Wn,Hn[Yn]={};for(const hi of Wn.indexNames)Hn[Yn][hi]=Wn.index(hi)}return{abort:jn=>abortWithError(Mn,jn),done:Mn.done.catch(jn=>{if(!isAbortError(jn))throw jn}),store:Ln,index:Hn}}function abortWithError(on,In){throw on.abort(),new Error(In)}function purgeByTenants(on){return openDatabaseWithTransactionScope(STORE_NAMES,"readwrite",async In=>{const Rn=[];for(const Ln of on)Rn.push(purgeByTenantTransactional(In,Ln));await Promise.all(Rn);const Mn=[];for await(const{value:Ln}of In.store.session)Mn.push([Ln.sub,Ln.apiUrl]);for await(const{value:Ln}of In.store.setting)Mn.some(([Hn,jn])=>Hn===Ln.sub&&jn===Ln.apiUrl)||await In.store.setting.delete(Ln.id);Mn.length||(await In.store.app.delete(APP_AUTHENTICATION_STATE),await In.store.app.delete(APP_CURRENT_TENANT))})}async function purgeByTenantTransactional(on,In){const Rn=await on.index.workspace.user.getAll([In.tenant,In.sub,In.apiUrl]);if(!Rn.length)return;const Mn=await on.index.session.key.getAllKeys([In.sub,In.tenant,In.issuer]);await Promise.all([...Mn.map(Ln=>on.store.session.delete(Ln)),...Rn.map(({id:Ln})=>deleteWorkspaceTransactional(on,Ln))])}async function deleteWorkspaceTransactional(on,In){await Promise.all([on.store.workspace.delete(In),deleteWorkspaceTabStateTransactional(on,In),deleteWorkspaceAttachmentsTransactional(on,In),deleteWorkspaceItemsTransactional(on,In),deleteWorkspaceSyncEntriesTransactional(on,In)])}async function deleteWorkspaceTabStateTransactional(on,In){const Rn=await on.index.tabViewState.workspace.getAllKeys(In);await Promise.all([on.store.tab.delete(In),...Rn.map(Mn=>on.store.tabViewState.delete(Mn))])}async function deleteWorkspaceAttachmentsTransactional(on,In){const Rn=[];let Mn=await on.index.attachment.workspace.openKeyCursor(In);for(;Mn;)Rn.push(on.store.attachment.delete(Mn.primaryKey)),Mn=await Mn.continue();await Promise.all(Rn)}async function deleteWorkspaceItemsTransactional(on,In){const Rn=[];let Mn=await on.index.item.workspace.openKeyCursor(In);for(;Mn;)Rn.push(on.store.item.delete(Mn.primaryKey)),Mn=await Mn.continue();await Promise.all(Rn)}async function deleteWorkspaceSyncEntriesTransactional(on,In){const Rn=[];let Mn=await on.index.workspaceSync.workspace.openKeyCursor(In);for(;Mn;)Rn.push(on.store.workspaceSync.delete(Mn.primaryKey)),Mn=await Mn.continue();await Promise.all(Rn)}globalThis.idbGet=function(on,In){return openDatabaseScope(async Rn=>{console.log("IDB_GET",{store:on,key:In,data:await Rn.get(on,In)})})};globalThis.idbSet=function(on,In,Rn){return openDatabaseScope(async Mn=>{console.log("IDB_SET",{store:on,key:Rn,value:In,result:await Mn.put(on,In,Rn)})})};function areTenantsEqual(on,In){return on?.tenant===In?.tenant&&on?.sub===In?.sub&&on?.login===In?.login&&on?.apiUrl===In?.apiUrl&&on?.issuer===In?.issuer}async function getUserSession({sub:on,tenant:In,issuer:Rn}){return openDatabaseWithTransactionScope(["session"],"readonly",Mn=>Mn.index.session.key.get([on,In,Rn]))}async function getUserSessions(){return getAllEntities("session")}async function replaceUserSession(on){return await putEntity("session",on),on}const APP_KEY="app";function getAppValue(on){return getEntityByKey(APP_KEY,on)}function putAppValue(on,In){return openDatabaseScope(async Rn=>{await Rn.put(APP_KEY,In,on)})}const APP_SHELL_KEY="shell";function getShell(){return getAppValue(APP_SHELL_KEY)}function setShell(on){return putAppValue(APP_SHELL_KEY,on)}const APP_TELEMETRY_KEY="telemetry";function getTelemetry(){return getAppValue(APP_TELEMETRY_KEY)}function setTelemetry(on){return putAppValue(APP_TELEMETRY_KEY,on)}const APP_AUTHENTICATION_STATE="auth-state";function deleteAuthenticationState(){return deleteEntity("app",APP_AUTHENTICATION_STATE)}function getAuthenticationState(){return getEntityByKey("app",APP_AUTHENTICATION_STATE)}function setAuthenticationState(on){return putAppValue(APP_AUTHENTICATION_STATE,on)}const APP_CURRENT_TENANT="current-tenant";function getCurrentTenant(){return getEntityByKey("app",APP_CURRENT_TENANT)}function setCurrentTenant(on){return putAppValue(APP_CURRENT_TENANT,on)}function getAppSession(on){return openDatabaseWithTransactionScope([APP_KEY,"session"],"readonly",In=>Promise.all([In.store.app.get(APP_CURRENT_TENANT),In.store.session.getAll()]).then(([Rn,Mn])=>{if(!Mn)return null;const Ln=Rn?Mn.find(Hn=>areTenantsEqual(Hn,Rn)):void 0;return{userSessions:Mn,activeSession:Ln}}),on)}const APP_VERSION="app-version";function setAppVersion(on){return putAppValue(APP_VERSION,on)}const CURRENT_THEME="current-theme";async function getCurrentTheme(){return await getAppValue(CURRENT_THEME)}function setCurrentTheme(on){return putAppValue(CURRENT_THEME,on)}const P_ACCESS_TOKEN="access_token",P_ID_TOKEN="id_token",P_CLIENT_ID="client_id",P_CLIENT_SECRET="client_secret",P_AUDIENCE="audience",P_RESOURCE="resource",P_CODE_CHALLENGE="code_challenge",P_CODE_CHALLENGE_METHOD="code_challenge_method",P_CODE_VERIFIER="code_verifier",P_CODE="code",P_NONCE="nonce",P_ERROR="error",P_ERROR_DESCRIPTION="error_description",P_ERROR_URI="error_uri",P_EXPIRES_IN="expires_in",P_GRANT_TYPE="grant_type",P_PASSWORD="password",P_REDIRECT_URI="redirect_uri",P_REFRESH_TOKEN="refresh_token",P_RESPONSE_TYPE="response_type",P_LOGIN_HINT="login_hint",P_ACR_VALUES="acr_values",P_SCOPE="scope",P_STATE="state",P_TOKEN_TYPE="token_type",P_USERNAME="username",CONTENT_TYPE_FORM_URLENCODED="application/x-www-form-urlencoded",CONTENT_TYPE_APPLICATION_JSON="application/json",BEARER_TOKEN_VALUE_PREFIX="Bearer",GRANT_TYPE_AUTHORIZATION_CODE="authorization_code",GRANT_TYPE_CLIENT_CREDENTIALS="client_credentials",GRANT_TYPE_IMPLICIT="implicit",GRANT_TYPE_PASSWORD="password",GRANT_TYPE_REFRESH="refresh_token",PKCE_CHALLENGE_PLAIN="plain",PKCE_CHALLENGE_S256="S256",RESPONSE_TYPE_CODE="code",RESPONSE_TYPE_ID_TOKEN="id_token",RESPONSE_TYPE_ID_TOKEN_TOKEN="id_token token",RESPONSE_TYPE_TOKEN="token";function sendMessage(on,In=self){In.postMessage(on,In.location.origin)}function registerReceiveMessage(on,In,Rn=self){function Mn(Ln){Ln.origin===Rn.location.origin&&Ln.data.kind===on&&In(Ln.data)}return Rn.addEventListener("message",Mn),()=>{Rn.removeEventListener("message",Mn)}}const ACTIVATED_WORKSPACE_MESSAGE="nitro-activated-workspace",ANALYZE_DOCUMENT_MESSAGE="nitro-analyze-document",CONNECTION_SETTINGS_UPDATED_MESSAGE="nitro-connection-settings-updated",DELETED_ITEMS_MESSAGE="nitro-deleted-items",DOCUMENT_ANALYZED_MESSAGE="nitro-document-analyzed",ENVIRONMENT_DRAFT_REVERTED="nitro-environment-draft-reverted",LOG_ENTRY_ACTIVATED_MESSAGE="nitro-log-entry-activated",MOVED_ITEMS_MESSAGE="nitro-moved-items",OAUTH_MESSAGE="nitro-oauth",RENAMED_ITEM_MESSAGE="nitro-renamed-item",RENEW_SESSION_MESSAGE="nitro-renew-session",SCHEMA_INDEXED_MESSAGE="nitro-schema-indexed",SCHEMA_UPDATED_MESSAGE="nitro-schema-updated",SIGNED_IN_MESSAGE="nitro-signed-in-session",SIGNED_OUT_MESSAGE="nitro-signed-out-session",THEME_SETTINGS_CHANGED_MESSAGE="nitro-theme-settings-changed",WORKSPACE_SYNCHRONIZED_MESSAGE="nitro-workspace-synchronized";var cryptoJs$1={exports:{}};function commonjsRequire(on){throw new Error('Could not dynamically require "'+on+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var core$1={exports:{}},cryptoBrowserify={},browser$b={exports:{}},hasRequiredBrowser$b;function requireBrowser$b(){if(hasRequiredBrowser$b)return browser$b.exports;hasRequiredBrowser$b=1;var on=65536,In=4294967295;function Rn(){throw new Error(`Secure random number generation is not supported by this browser.
|
|
4373
|
+
Please report this to https://github.com/markedjs/marked.`,on){const Ln="<p>An error occurred:</p><pre>"+escape$1(Mn.message+"",!0)+"</pre>";if(In)return Promise.resolve(Ln);if(Rn){Rn(null,Ln);return}return Ln}if(In)return Promise.reject(Mn);if(Rn){Rn(Mn);return}throw Mn}}function parseMarkdown(on,In){return(Rn,Mn,Ln)=>{typeof Mn=="function"&&(Ln=Mn,Mn=null);const Hn={...Mn};Mn={...marked.defaults,...Hn};const jn=onError(Mn.silent,Mn.async,Ln);if(typeof Rn>"u"||Rn===null)return jn(new Error("marked(): input parameter is undefined or null"));if(typeof Rn!="string")return jn(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Rn)+", string expected"));if(checkSanitizeDeprecation(Mn),Mn.hooks&&(Mn.hooks.options=Mn),Ln){const Wn=Mn.highlight;let Yn;try{Mn.hooks&&(Rn=Mn.hooks.preprocess(Rn)),Yn=on(Rn,Mn)}catch(gi){return jn(gi)}const hi=function(gi){let mi;if(!gi)try{Mn.walkTokens&&marked.walkTokens(Yn,Mn.walkTokens),mi=In(Yn,Mn),Mn.hooks&&(mi=Mn.hooks.postprocess(mi))}catch(yi){gi=yi}return Mn.highlight=Wn,gi?jn(gi):Ln(null,mi)};if(!Wn||Wn.length<3||(delete Mn.highlight,!Yn.length))return hi();let vi=0;marked.walkTokens(Yn,function(gi){gi.type==="code"&&(vi++,setTimeout(()=>{Wn(gi.text,gi.lang,function(mi,yi){if(mi)return hi(mi);yi!=null&&yi!==gi.text&&(gi.text=yi,gi.escaped=!0),vi--,vi===0&&hi()})},0))}),vi===0&&hi();return}if(Mn.async)return Promise.resolve(Mn.hooks?Mn.hooks.preprocess(Rn):Rn).then(Wn=>on(Wn,Mn)).then(Wn=>Mn.walkTokens?Promise.all(marked.walkTokens(Wn,Mn.walkTokens)).then(()=>Wn):Wn).then(Wn=>In(Wn,Mn)).then(Wn=>Mn.hooks?Mn.hooks.postprocess(Wn):Wn).catch(jn);try{Mn.hooks&&(Rn=Mn.hooks.preprocess(Rn));const Wn=on(Rn,Mn);Mn.walkTokens&&marked.walkTokens(Wn,Mn.walkTokens);let Yn=In(Wn,Mn);return Mn.hooks&&(Yn=Mn.hooks.postprocess(Yn)),Yn}catch(Wn){return jn(Wn)}}}function marked(on,In,Rn){return parseMarkdown(Lexer$2.lex,Parser$3.parse)(on,In,Rn)}marked.options=marked.setOptions=function(on){return marked.defaults={...marked.defaults,...on},changeDefaults(marked.defaults),marked};marked.getDefaults=getDefaults;marked.defaults=defaults$2;marked.use=function(...on){const In=marked.defaults.extensions||{renderers:{},childTokens:{}};on.forEach(Rn=>{const Mn={...Rn};if(Mn.async=marked.defaults.async||Mn.async||!1,Rn.extensions&&(Rn.extensions.forEach(Ln=>{if(!Ln.name)throw new Error("extension name required");if(Ln.renderer){const Hn=In.renderers[Ln.name];Hn?In.renderers[Ln.name]=function(...jn){let Wn=Ln.renderer.apply(this,jn);return Wn===!1&&(Wn=Hn.apply(this,jn)),Wn}:In.renderers[Ln.name]=Ln.renderer}if(Ln.tokenizer){if(!Ln.level||Ln.level!=="block"&&Ln.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");In[Ln.level]?In[Ln.level].unshift(Ln.tokenizer):In[Ln.level]=[Ln.tokenizer],Ln.start&&(Ln.level==="block"?In.startBlock?In.startBlock.push(Ln.start):In.startBlock=[Ln.start]:Ln.level==="inline"&&(In.startInline?In.startInline.push(Ln.start):In.startInline=[Ln.start]))}Ln.childTokens&&(In.childTokens[Ln.name]=Ln.childTokens)}),Mn.extensions=In),Rn.renderer){const Ln=marked.defaults.renderer||new Renderer;for(const Hn in Rn.renderer){const jn=Ln[Hn];Ln[Hn]=(...Wn)=>{let Yn=Rn.renderer[Hn].apply(Ln,Wn);return Yn===!1&&(Yn=jn.apply(Ln,Wn)),Yn}}Mn.renderer=Ln}if(Rn.tokenizer){const Ln=marked.defaults.tokenizer||new Tokenizer;for(const Hn in Rn.tokenizer){const jn=Ln[Hn];Ln[Hn]=(...Wn)=>{let Yn=Rn.tokenizer[Hn].apply(Ln,Wn);return Yn===!1&&(Yn=jn.apply(Ln,Wn)),Yn}}Mn.tokenizer=Ln}if(Rn.hooks){const Ln=marked.defaults.hooks||new Hooks;for(const Hn in Rn.hooks){const jn=Ln[Hn];Hooks.passThroughHooks.has(Hn)?Ln[Hn]=Wn=>{if(marked.defaults.async)return Promise.resolve(Rn.hooks[Hn].call(Ln,Wn)).then(hi=>jn.call(Ln,hi));const Yn=Rn.hooks[Hn].call(Ln,Wn);return jn.call(Ln,Yn)}:Ln[Hn]=(...Wn)=>{let Yn=Rn.hooks[Hn].apply(Ln,Wn);return Yn===!1&&(Yn=jn.apply(Ln,Wn)),Yn}}Mn.hooks=Ln}if(Rn.walkTokens){const Ln=marked.defaults.walkTokens;Mn.walkTokens=function(Hn){let jn=[];return jn.push(Rn.walkTokens.call(this,Hn)),Ln&&(jn=jn.concat(Ln.call(this,Hn))),jn}}marked.setOptions(Mn)})};marked.walkTokens=function(on,In){let Rn=[];for(const Mn of on)switch(Rn=Rn.concat(In.call(marked,Mn)),Mn.type){case"table":{for(const Ln of Mn.header)Rn=Rn.concat(marked.walkTokens(Ln.tokens,In));for(const Ln of Mn.rows)for(const Hn of Ln)Rn=Rn.concat(marked.walkTokens(Hn.tokens,In));break}case"list":{Rn=Rn.concat(marked.walkTokens(Mn.items,In));break}default:marked.defaults.extensions&&marked.defaults.extensions.childTokens&&marked.defaults.extensions.childTokens[Mn.type]?marked.defaults.extensions.childTokens[Mn.type].forEach(function(Ln){Rn=Rn.concat(marked.walkTokens(Mn[Ln],In))}):Mn.tokens&&(Rn=Rn.concat(marked.walkTokens(Mn.tokens,In)))}return Rn};marked.parseInline=parseMarkdown(Lexer$2.lexInline,Parser$3.parseInline);marked.Parser=Parser$3;marked.parser=Parser$3.parse;marked.Renderer=Renderer;marked.TextRenderer=TextRenderer;marked.Lexer=Lexer$2;marked.lexer=Lexer$2.lex;marked.Tokenizer=Tokenizer;marked.Slugger=Slugger;marked.Hooks=Hooks;marked.parse=marked;marked.options;marked.setOptions;marked.use;marked.walkTokens;marked.parseInline;Parser$3.parse;Lexer$2.lex;const renderer=new marked.Renderer,linkRenderer=renderer.link;renderer.link=(on,In,Rn)=>{const Mn=on?.startsWith(`${window.location.protocol}//${window.location.hostname}`)??!0,Ln=linkRenderer.call(renderer,on,In,Rn);return Mn?Ln:Ln.replace(/^<a /,'<a rel="nofollow noopener noreferrer" target="_blank" ')};marked.setOptions({gfm:!1,sanitizer:purify.sanitize,renderer});function renderMarkdown(on){return marked(on)}function createSubject(on){let In=on;const Rn=new Set,Mn={value:()=>In,subscribe:Ln=>{const Hn={onNext:Ln};return Rn.add(Hn),()=>{Rn.has(Hn)&&Rn.delete(Hn)}}};return{...Mn,observable:Mn,next:Ln=>{Ln instanceof Function?In=Ln(In):In=Ln,Rn.forEach(({onNext:Hn})=>Hn(In))},unsubscribeAll:()=>{Rn.forEach(Ln=>{Rn.delete(Ln)})}}}function useSubject(on){const In=reactExports.useRef();return In.current||(In.current=createSubject(on)),In}function useSelectionObservable(on,In,Rn){const Mn=useSubject(on?In(on.value()):Rn);return reactExports.useEffect(()=>{function Ln(Hn){Mn.current.value()!==Hn&&Mn.current.next(Hn)}if(!on){Ln(Rn);return}return Ln(In(on.value())),on.subscribe(Hn=>{Ln(In(Hn))})},[Rn,Mn,on,In]),Mn.current.observable}function useCurrentValue(on,In,Rn){return on?In(on.value()):Rn}function useSubjectNext(on,In){return reactExports.useCallback(Rn=>{on&&on.next(Mn=>In(Mn,Rn))},[on,In])}function useCombine(on,In){const Rn=useSubject([on.value(),In.value()]);return reactExports.useEffect(()=>{function Mn(Ln){Rn.current.value()[0]!==Ln&&Rn.current.next([Ln,In.value()])}return Mn(on.value()),on.subscribe(Mn)},[on,In,Rn]),reactExports.useEffect(()=>{function Mn(Ln){Rn.current.value()[1]!==Ln&&Rn.current.next([on.value(),Ln])}return Mn(In.value()),In.subscribe(Mn)},[on,In,Rn]),Rn.current.observable}function useRefWithInitializer(on){const In=reactExports.useRef(void 0),Rn=reactExports.useRef(!1);return Rn.current||(Rn.current=!0,In.current=on()),In}function createVirtualScrolling(on,In="horizontal"){function Rn(Mn){on&&In==="horizontal"&&!Mn.shiftKey&&Mn.deltaY&&(on.scrollLeft+=Mn.deltaY)}return on.addEventListener("wheel",Rn,{passive:!0}),()=>{on.removeEventListener("wheel",Rn)}}function appendUrlSegment(on,In){return on=new URL(on),In==null||(In.startsWith("/")&&(In=In.substring(1)),on.pathname.endsWith("/")||(on.pathname+="/"),on.pathname+=In),on}function tryParseUrl(on){try{return new URL(on)}catch{return}}function removeTrailingSlash(on){return on.replace(/\/$/,"")}const instanceOfAny=(on,In)=>In.some(Rn=>on instanceof Rn);let idbProxyableTypes,cursorAdvanceMethods;function getIdbProxyableTypes(){return idbProxyableTypes||(idbProxyableTypes=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function getCursorAdvanceMethods(){return cursorAdvanceMethods||(cursorAdvanceMethods=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const cursorRequestMap=new WeakMap,transactionDoneMap=new WeakMap,transactionStoreNamesMap=new WeakMap,transformCache=new WeakMap,reverseTransformCache=new WeakMap;function promisifyRequest(on){const In=new Promise((Rn,Mn)=>{const Ln=()=>{on.removeEventListener("success",Hn),on.removeEventListener("error",jn)},Hn=()=>{Rn(wrap$1(on.result)),Ln()},jn=()=>{Mn(on.error),Ln()};on.addEventListener("success",Hn),on.addEventListener("error",jn)});return In.then(Rn=>{Rn instanceof IDBCursor&&cursorRequestMap.set(Rn,on)}).catch(()=>{}),reverseTransformCache.set(In,on),In}function cacheDonePromiseForTransaction(on){if(transactionDoneMap.has(on))return;const In=new Promise((Rn,Mn)=>{const Ln=()=>{on.removeEventListener("complete",Hn),on.removeEventListener("error",jn),on.removeEventListener("abort",jn)},Hn=()=>{Rn(),Ln()},jn=()=>{Mn(on.error||new DOMException("AbortError","AbortError")),Ln()};on.addEventListener("complete",Hn),on.addEventListener("error",jn),on.addEventListener("abort",jn)});transactionDoneMap.set(on,In)}let idbProxyTraps={get(on,In,Rn){if(on instanceof IDBTransaction){if(In==="done")return transactionDoneMap.get(on);if(In==="objectStoreNames")return on.objectStoreNames||transactionStoreNamesMap.get(on);if(In==="store")return Rn.objectStoreNames[1]?void 0:Rn.objectStore(Rn.objectStoreNames[0])}return wrap$1(on[In])},set(on,In,Rn){return on[In]=Rn,!0},has(on,In){return on instanceof IDBTransaction&&(In==="done"||In==="store")?!0:In in on}};function replaceTraps(on){idbProxyTraps=on(idbProxyTraps)}function wrapFunction(on){return on===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(In,...Rn){const Mn=on.call(unwrap(this),In,...Rn);return transactionStoreNamesMap.set(Mn,In.sort?In.sort():[In]),wrap$1(Mn)}:getCursorAdvanceMethods().includes(on)?function(...In){return on.apply(unwrap(this),In),wrap$1(cursorRequestMap.get(this))}:function(...In){return wrap$1(on.apply(unwrap(this),In))}}function transformCachableValue(on){return typeof on=="function"?wrapFunction(on):(on instanceof IDBTransaction&&cacheDonePromiseForTransaction(on),instanceOfAny(on,getIdbProxyableTypes())?new Proxy(on,idbProxyTraps):on)}function wrap$1(on){if(on instanceof IDBRequest)return promisifyRequest(on);if(transformCache.has(on))return transformCache.get(on);const In=transformCachableValue(on);return In!==on&&(transformCache.set(on,In),reverseTransformCache.set(In,on)),In}const unwrap=on=>reverseTransformCache.get(on);function openDB(on,In,{blocked:Rn,upgrade:Mn,blocking:Ln,terminated:Hn}={}){const jn=indexedDB.open(on,In),Wn=wrap$1(jn);return Mn&&jn.addEventListener("upgradeneeded",Yn=>{Mn(wrap$1(jn.result),Yn.oldVersion,Yn.newVersion,wrap$1(jn.transaction),Yn)}),Rn&&jn.addEventListener("blocked",Yn=>Rn(Yn.oldVersion,Yn.newVersion,Yn)),Wn.then(Yn=>{Hn&&Yn.addEventListener("close",()=>Hn()),Ln&&Yn.addEventListener("versionchange",hi=>Ln(hi.oldVersion,hi.newVersion,hi))}).catch(()=>{}),Wn}function deleteDB(on,{blocked:In}={}){const Rn=indexedDB.deleteDatabase(on);return In&&Rn.addEventListener("blocked",Mn=>In(Mn.oldVersion,Mn)),wrap$1(Rn).then(()=>{})}const readMethods=["get","getKey","getAll","getAllKeys","count"],writeMethods=["put","add","delete","clear"],cachedMethods=new Map;function getMethod(on,In){if(!(on instanceof IDBDatabase&&!(In in on)&&typeof In=="string"))return;if(cachedMethods.get(In))return cachedMethods.get(In);const Rn=In.replace(/FromIndex$/,""),Mn=In!==Rn,Ln=writeMethods.includes(Rn);if(!(Rn in(Mn?IDBIndex:IDBObjectStore).prototype)||!(Ln||readMethods.includes(Rn)))return;const Hn=async function(jn,...Wn){const Yn=this.transaction(jn,Ln?"readwrite":"readonly");let hi=Yn.store;return Mn&&(hi=hi.index(Wn.shift())),(await Promise.all([hi[Rn](...Wn),Ln&&Yn.done]))[0]};return cachedMethods.set(In,Hn),Hn}replaceTraps(on=>({...on,get:(In,Rn,Mn)=>getMethod(In,Rn)||on.get(In,Rn,Mn),has:(In,Rn)=>!!getMethod(In,Rn)||on.has(In,Rn)}));const advanceMethodProps=["continue","continuePrimaryKey","advance"],methodMap={},advanceResults=new WeakMap,ittrProxiedCursorToOriginalProxy=new WeakMap,cursorIteratorTraps={get(on,In){if(!advanceMethodProps.includes(In))return on[In];let Rn=methodMap[In];return Rn||(Rn=methodMap[In]=function(...Mn){advanceResults.set(this,ittrProxiedCursorToOriginalProxy.get(this)[In](...Mn))}),Rn}};async function*iterate(...on){let In=this;if(In instanceof IDBCursor||(In=await In.openCursor(...on)),!In)return;In=In;const Rn=new Proxy(In,cursorIteratorTraps);for(ittrProxiedCursorToOriginalProxy.set(Rn,In),reverseTransformCache.set(Rn,unwrap(In));In;)yield Rn,In=await(advanceResults.get(Rn)||In.continue()),advanceResults.delete(Rn)}function isIteratorProp(on,In){return In===Symbol.asyncIterator&&instanceOfAny(on,[IDBIndex,IDBObjectStore,IDBCursor])||In==="iterate"&&instanceOfAny(on,[IDBIndex,IDBObjectStore])}replaceTraps(on=>({...on,get(In,Rn,Mn){return isIteratorProp(In,Rn)?iterate:on.get(In,Rn,Mn)},has(In,Rn){return isIteratorProp(In,Rn)||on.has(In,Rn)}}));const stores={app:!0,attachment:!0,item:!0,mutex:!0,schema:!0,"schema-attachment":!0,session:!0,setting:!0,tab:!0,"tab-view-state":!0,"update-log":!0,workspace:!0,"workspace-sync":!0},STORE_NAMES=Object.keys(stores),DB_NAME="chillicream-nitro-insider";function getDatabaseName(){return self.appNamespace?`${DB_NAME}-${self.appNamespace}`:DB_NAME}function deleteEntity(on,In){return openDatabaseScope(Rn=>Rn.delete(on,In))}function getAllEntities(on){return openDatabaseScope(In=>In.getAll(on))}function getEntityByKey(on,In){return openDatabaseScope(Rn=>Rn.get(on,In))}function putEntity(on,In){return openDatabaseScope(async Rn=>{await Rn.put(on,In)})}async function updateEntityTransactional(on,In,Rn){let Mn=await on.get(In);return Mn&&(Mn=Rn(Mn),Mn&&await on.put(Mn)),Mn}function openDatabase(){return openDB(getDatabaseName())}async function openDatabaseScope(on){const In=await openDatabase();try{return await on(In)}finally{In.close()}}async function openTransactionScope(on,In,Rn,Mn,Ln){const Hn=await createTransaction(on,In,Rn);try{return Ln?await createAbortScope(()=>Hn.abort("transaction aborted"),()=>Mn(Hn,on.version),Ln):await Mn(Hn,on.version)}finally{await Hn.done}}function openDatabaseWithTransactionScope(on,In,Rn,Mn){return openDatabaseScope(Ln=>openTransactionScope(Ln,on,In,Rn,Mn))}function deleteDatabase(){return deleteDB(getDatabaseName())}async function databaseExists(on){const In=await window.indexedDB.databases(),Rn=getDatabaseName();return In.some(({name:Mn,version:Ln})=>Mn===Rn&&!0)}const camelizationCache=new Map;function camelizeString(on){let In=camelizationCache.get(on);return In||(In=on.split("-").reduce((Rn,Mn)=>(Mn&&(Rn!==""?(Rn+=Mn[0].toUpperCase(),Rn+=Mn.substring(1)):Rn=Mn),Rn),""),camelizationCache.set(on,In)),In}async function createTransaction(on,In,Rn){const Mn=on.transaction(In,Rn),Ln={},Hn={};for(const jn of In){const Wn=Mn.objectStore(jn),Yn=camelizeString(jn);Ln[Yn]=Wn,Hn[Yn]={};for(const hi of Wn.indexNames)Hn[Yn][hi]=Wn.index(hi)}return{abort:jn=>abortWithError(Mn,jn),done:Mn.done.catch(jn=>{if(!isAbortError(jn))throw jn}),store:Ln,index:Hn}}function abortWithError(on,In){throw on.abort(),new Error(In)}function purgeByTenants(on){return openDatabaseWithTransactionScope(STORE_NAMES,"readwrite",async In=>{const Rn=[];for(const Ln of on)Rn.push(purgeByTenantTransactional(In,Ln));await Promise.all(Rn);const Mn=[];for await(const{value:Ln}of In.store.session)Mn.push([Ln.sub,Ln.apiUrl]);for await(const{value:Ln}of In.store.setting)Mn.some(([Hn,jn])=>Hn===Ln.sub&&jn===Ln.apiUrl)||await In.store.setting.delete(Ln.id);Mn.length||(await In.store.app.delete(APP_AUTHENTICATION_STATE),await In.store.app.delete(APP_CURRENT_TENANT))})}async function purgeByTenantTransactional(on,In){const Rn=await on.index.workspace.user.getAll([In.tenant,In.sub,In.apiUrl]);if(!Rn.length)return;const Mn=await on.index.session.key.getAllKeys([In.sub,In.tenant,In.issuer]);await Promise.all([...Mn.map(Ln=>on.store.session.delete(Ln)),...Rn.map(({id:Ln})=>deleteWorkspaceTransactional(on,Ln))])}async function deleteWorkspaceTransactional(on,In){await Promise.all([on.store.workspace.delete(In),deleteWorkspaceTabStateTransactional(on,In),deleteWorkspaceAttachmentsTransactional(on,In),deleteWorkspaceItemsTransactional(on,In),deleteWorkspaceSyncEntriesTransactional(on,In)])}async function deleteWorkspaceTabStateTransactional(on,In){const Rn=await on.index.tabViewState.workspace.getAllKeys(In);await Promise.all([on.store.tab.delete(In),...Rn.map(Mn=>on.store.tabViewState.delete(Mn))])}async function deleteWorkspaceAttachmentsTransactional(on,In){const Rn=[];let Mn=await on.index.attachment.workspace.openKeyCursor(In);for(;Mn;)Rn.push(on.store.attachment.delete(Mn.primaryKey)),Mn=await Mn.continue();await Promise.all(Rn)}async function deleteWorkspaceItemsTransactional(on,In){const Rn=[];let Mn=await on.index.item.workspace.openKeyCursor(In);for(;Mn;)Rn.push(on.store.item.delete(Mn.primaryKey)),Mn=await Mn.continue();await Promise.all(Rn)}async function deleteWorkspaceSyncEntriesTransactional(on,In){const Rn=[];let Mn=await on.index.workspaceSync.workspace.openKeyCursor(In);for(;Mn;)Rn.push(on.store.workspaceSync.delete(Mn.primaryKey)),Mn=await Mn.continue();await Promise.all(Rn)}globalThis.idbGet=function(on,In){return openDatabaseScope(async Rn=>{console.log("IDB_GET",{store:on,key:In,data:await Rn.get(on,In)})})};globalThis.idbSet=function(on,In,Rn){return openDatabaseScope(async Mn=>{console.log("IDB_SET",{store:on,key:Rn,value:In,result:await Mn.put(on,In,Rn)})})};function areTenantsEqual(on,In){return on?.tenant===In?.tenant&&on?.sub===In?.sub&&on?.login===In?.login&&on?.apiUrl===In?.apiUrl&&on?.issuer===In?.issuer}async function getUserSession({sub:on,tenant:In,issuer:Rn}){return openDatabaseWithTransactionScope(["session"],"readonly",Mn=>Mn.index.session.key.get([on,In,Rn]))}async function getUserSessions(){return getAllEntities("session")}async function replaceUserSession(on){return await putEntity("session",on),on}const APP_KEY="app";function getAppValue(on){return getEntityByKey(APP_KEY,on)}function putAppValue(on,In){return openDatabaseScope(async Rn=>{await Rn.put(APP_KEY,In,on)})}const APP_SHELL_KEY="shell";function getShell(){return getAppValue(APP_SHELL_KEY)}function setShell(on){return putAppValue(APP_SHELL_KEY,on)}const APP_TELEMETRY_KEY="telemetry";function getTelemetry(){return getAppValue(APP_TELEMETRY_KEY)}function setTelemetry(on){return putAppValue(APP_TELEMETRY_KEY,on)}const APP_AUTHENTICATION_STATE="auth-state";function deleteAuthenticationState(){return deleteEntity("app",APP_AUTHENTICATION_STATE)}function getAuthenticationState(){return getEntityByKey("app",APP_AUTHENTICATION_STATE)}function setAuthenticationState(on){return putAppValue(APP_AUTHENTICATION_STATE,on)}const APP_CURRENT_TENANT="current-tenant";function getCurrentTenant(){return getEntityByKey("app",APP_CURRENT_TENANT)}function setCurrentTenant(on){return putAppValue(APP_CURRENT_TENANT,on)}function getAppSession(on){return openDatabaseWithTransactionScope([APP_KEY,"session"],"readonly",In=>Promise.all([In.store.app.get(APP_CURRENT_TENANT),In.store.session.getAll()]).then(([Rn,Mn])=>{if(!Mn)return null;const Ln=Rn?Mn.find(Hn=>areTenantsEqual(Hn,Rn)):void 0;return{userSessions:Mn,activeSession:Ln}}),on)}const APP_VERSION="app-version";function setAppVersion(on){return putAppValue(APP_VERSION,on)}const CURRENT_THEME="current-theme";async function getCurrentTheme(){return await getAppValue(CURRENT_THEME)}function setCurrentTheme(on){return putAppValue(CURRENT_THEME,on)}const P_ACCESS_TOKEN="access_token",P_ID_TOKEN="id_token",P_CLIENT_ID="client_id",P_CLIENT_SECRET="client_secret",P_AUDIENCE="audience",P_RESOURCE="resource",P_CODE_CHALLENGE="code_challenge",P_CODE_CHALLENGE_METHOD="code_challenge_method",P_CODE_VERIFIER="code_verifier",P_CODE="code",P_NONCE="nonce",P_ERROR="error",P_ERROR_DESCRIPTION="error_description",P_ERROR_URI="error_uri",P_EXPIRES_IN="expires_in",P_GRANT_TYPE="grant_type",P_PASSWORD="password",P_REDIRECT_URI="redirect_uri",P_REFRESH_TOKEN="refresh_token",P_RESPONSE_TYPE="response_type",P_LOGIN_HINT="login_hint",P_ACR_VALUES="acr_values",P_SCOPE="scope",P_STATE="state",P_TOKEN_TYPE="token_type",P_USERNAME="username",CONTENT_TYPE_FORM_URLENCODED="application/x-www-form-urlencoded",CONTENT_TYPE_APPLICATION_JSON="application/json",BEARER_TOKEN_VALUE_PREFIX="Bearer",GRANT_TYPE_AUTHORIZATION_CODE="authorization_code",GRANT_TYPE_CLIENT_CREDENTIALS="client_credentials",GRANT_TYPE_IMPLICIT="implicit",GRANT_TYPE_PASSWORD="password",GRANT_TYPE_REFRESH="refresh_token",PKCE_CHALLENGE_PLAIN="plain",PKCE_CHALLENGE_S256="S256",RESPONSE_TYPE_CODE="code",RESPONSE_TYPE_ID_TOKEN="id_token",RESPONSE_TYPE_ID_TOKEN_TOKEN="id_token token",RESPONSE_TYPE_TOKEN="token";function sendMessage(on,In=self){In.postMessage(on,In.location.origin)}function registerReceiveMessage(on,In,Rn=self){function Mn(Ln){Ln.origin===Rn.location.origin&&Ln.data.kind===on&&In(Ln.data)}return Rn.addEventListener("message",Mn),()=>{Rn.removeEventListener("message",Mn)}}const ACTIVATED_WORKSPACE_MESSAGE="nitro-activated-workspace",ANALYZE_DOCUMENT_MESSAGE="nitro-analyze-document",CONNECTION_SETTINGS_UPDATED_MESSAGE="nitro-connection-settings-updated",DELETED_ITEMS_MESSAGE="nitro-deleted-items",DOCUMENT_ANALYZED_MESSAGE="nitro-document-analyzed",ENVIRONMENT_DRAFT_REVERTED="nitro-environment-draft-reverted",LOG_ENTRY_ACTIVATED_MESSAGE="nitro-log-entry-activated",MOVED_ITEMS_MESSAGE="nitro-moved-items",OAUTH_MESSAGE="nitro-oauth",RENAMED_ITEM_MESSAGE="nitro-renamed-item",RENEW_SESSION_MESSAGE="nitro-renew-session",SCHEMA_INDEXED_MESSAGE="nitro-schema-indexed",SCHEMA_UPDATED_MESSAGE="nitro-schema-updated",SIGNED_IN_MESSAGE="nitro-signed-in-session",SIGNED_OUT_MESSAGE="nitro-signed-out-session",THEME_SETTINGS_CHANGED_MESSAGE="nitro-theme-settings-changed",WORKSPACE_SYNCHRONIZED_MESSAGE="nitro-workspace-synchronized";var cryptoJs$1={exports:{}};function commonjsRequire(on){throw new Error('Could not dynamically require "'+on+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var core$1={exports:{}},cryptoBrowserify={},browser$b={exports:{}},hasRequiredBrowser$b;function requireBrowser$b(){if(hasRequiredBrowser$b)return browser$b.exports;hasRequiredBrowser$b=1;var on=65536,In=4294967295;function Rn(){throw new Error(`Secure random number generation is not supported by this browser.
|
|
4374
4374
|
Use Chrome, Firefox or Internet Explorer 11`)}var Mn=requireSafeBuffer$1().Buffer,Ln=commonjsGlobal.crypto||commonjsGlobal.msCrypto;Ln&&Ln.getRandomValues?browser$b.exports=Hn:browser$b.exports=Rn;function Hn(jn,Wn){if(jn>In)throw new RangeError("requested too many random bytes");var Yn=Mn.allocUnsafe(jn);if(jn>0)if(jn>on)for(var hi=0;hi<jn;hi+=on)Ln.getRandomValues(Yn.slice(hi,hi+on));else Ln.getRandomValues(Yn);return typeof Wn=="function"?process$1.nextTick(function(){Wn(null,Yn)}):Yn}return browser$b.exports}var hashBase$1,hasRequiredHashBase$1;function requireHashBase$1(){if(hasRequiredHashBase$1)return hashBase$1;hasRequiredHashBase$1=1;var on=requireSafeBuffer$1().Buffer,In=requireReadableBrowser$1().Transform,Rn=requireInherits_browser();function Mn(Hn,jn){if(!on.isBuffer(Hn)&&typeof Hn!="string")throw new TypeError(jn+" must be a string or a buffer")}function Ln(Hn){In.call(this),this._block=on.allocUnsafe(Hn),this._blockSize=Hn,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}return Rn(Ln,In),Ln.prototype._transform=function(Hn,jn,Wn){var Yn=null;try{this.update(Hn,jn)}catch(hi){Yn=hi}Wn(Yn)},Ln.prototype._flush=function(Hn){var jn=null;try{this.push(this.digest())}catch(Wn){jn=Wn}Hn(jn)},Ln.prototype.update=function(Hn,jn){if(Mn(Hn,"Data"),this._finalized)throw new Error("Digest already called");on.isBuffer(Hn)||(Hn=on.from(Hn,jn));for(var Wn=this._block,Yn=0;this._blockOffset+Hn.length-Yn>=this._blockSize;){for(var hi=this._blockOffset;hi<this._blockSize;)Wn[hi++]=Hn[Yn++];this._update(),this._blockOffset=0}for(;Yn<Hn.length;)Wn[this._blockOffset++]=Hn[Yn++];for(var vi=0,gi=Hn.length*8;gi>0;++vi)this._length[vi]+=gi,gi=this._length[vi]/4294967296|0,gi>0&&(this._length[vi]-=4294967296*gi);return this},Ln.prototype._update=function(){throw new Error("_update is not implemented")},Ln.prototype.digest=function(Hn){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var jn=this._digest();Hn!==void 0&&(jn=jn.toString(Hn)),this._block.fill(0),this._blockOffset=0;for(var Wn=0;Wn<4;++Wn)this._length[Wn]=0;return jn},Ln.prototype._digest=function(){throw new Error("_digest is not implemented")},hashBase$1=Ln,hashBase$1}var ripemd160$3,hasRequiredRipemd160$2;function requireRipemd160$2(){if(hasRequiredRipemd160$2)return ripemd160$3;hasRequiredRipemd160$2=1;var on=requireDist().Buffer,In=requireInherits_browser(),Rn=requireHashBase$1(),Mn=new Array(16),Ln=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],Hn=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],jn=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],Wn=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],Yn=[0,1518500249,1859775393,2400959708,2840853838],hi=[1352829926,1548603684,1836072691,2053994217,0];function vi(){Rn.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}In(vi,Rn),vi.prototype._update=function(){for(var xi=Mn,Ci=0;Ci<16;++Ci)xi[Ci]=this._block.readInt32LE(Ci*4);for(var Ai=this._a|0,Ii=this._b|0,Ni=this._c|0,Pi=this._d|0,Vi=this._e|0,Ui=this._a|0,Gi=this._b|0,Yi=this._c|0,zi=this._d|0,Mi=this._e|0,Li=0;Li<80;Li+=1){var wi,Ri;Li<16?(wi=mi(Ai,Ii,Ni,Pi,Vi,xi[Ln[Li]],Yn[0],jn[Li]),Ri=_i(Ui,Gi,Yi,zi,Mi,xi[Hn[Li]],hi[0],Wn[Li])):Li<32?(wi=yi(Ai,Ii,Ni,Pi,Vi,xi[Ln[Li]],Yn[1],jn[Li]),Ri=Ei(Ui,Gi,Yi,zi,Mi,xi[Hn[Li]],hi[1],Wn[Li])):Li<48?(wi=bi(Ai,Ii,Ni,Pi,Vi,xi[Ln[Li]],Yn[2],jn[Li]),Ri=bi(Ui,Gi,Yi,zi,Mi,xi[Hn[Li]],hi[2],Wn[Li])):Li<64?(wi=Ei(Ai,Ii,Ni,Pi,Vi,xi[Ln[Li]],Yn[3],jn[Li]),Ri=yi(Ui,Gi,Yi,zi,Mi,xi[Hn[Li]],hi[3],Wn[Li])):(wi=_i(Ai,Ii,Ni,Pi,Vi,xi[Ln[Li]],Yn[4],jn[Li]),Ri=mi(Ui,Gi,Yi,zi,Mi,xi[Hn[Li]],hi[4],Wn[Li])),Ai=Vi,Vi=Pi,Pi=gi(Ni,10),Ni=Ii,Ii=wi,Ui=Mi,Mi=zi,zi=gi(Yi,10),Yi=Gi,Gi=Ri}var ki=this._b+Ni+zi|0;this._b=this._c+Pi+Mi|0,this._c=this._d+Vi+Ui|0,this._d=this._e+Ai+Gi|0,this._e=this._a+Ii+Yi|0,this._a=ki},vi.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var xi=on.alloc?on.alloc(20):new on(20);return xi.writeInt32LE(this._a,0),xi.writeInt32LE(this._b,4),xi.writeInt32LE(this._c,8),xi.writeInt32LE(this._d,12),xi.writeInt32LE(this._e,16),xi};function gi(xi,Ci){return xi<<Ci|xi>>>32-Ci}function mi(xi,Ci,Ai,Ii,Ni,Pi,Vi,Ui){return gi(xi+(Ci^Ai^Ii)+Pi+Vi|0,Ui)+Ni|0}function yi(xi,Ci,Ai,Ii,Ni,Pi,Vi,Ui){return gi(xi+(Ci&Ai|~Ci&Ii)+Pi+Vi|0,Ui)+Ni|0}function bi(xi,Ci,Ai,Ii,Ni,Pi,Vi,Ui){return gi(xi+((Ci|~Ai)^Ii)+Pi+Vi|0,Ui)+Ni|0}function Ei(xi,Ci,Ai,Ii,Ni,Pi,Vi,Ui){return gi(xi+(Ci&Ii|Ai&~Ii)+Pi+Vi|0,Ui)+Ni|0}function _i(xi,Ci,Ai,Ii,Ni,Pi,Vi,Ui){return gi(xi+(Ci^(Ai|~Ii))+Pi+Vi|0,Ui)+Ni|0}return ripemd160$3=vi,ripemd160$3}var sha_js={exports:{}},isarray$1,hasRequiredIsarray$1;function requireIsarray$1(){if(hasRequiredIsarray$1)return isarray$1;hasRequiredIsarray$1=1;var on={}.toString;return isarray$1=Array.isArray||function(In){return on.call(In)=="[object Array]"},isarray$1}var isTypedArray$1,hasRequiredIsTypedArray;function requireIsTypedArray(){if(hasRequiredIsTypedArray)return isTypedArray$1;hasRequiredIsTypedArray=1;var on=requireWhichTypedArray();return isTypedArray$1=function(Rn){return!!on(Rn)},isTypedArray$1}var typedArrayBuffer,hasRequiredTypedArrayBuffer;function requireTypedArrayBuffer(){if(hasRequiredTypedArrayBuffer)return typedArrayBuffer;hasRequiredTypedArrayBuffer=1;var on=requireType(),In=requireCallBound(),Rn=In("TypedArray.prototype.buffer",!0),Mn=requireIsTypedArray();return typedArrayBuffer=Rn||function(Hn){if(!Mn(Hn))throw new on("Not a Typed Array");return Hn.buffer},typedArrayBuffer}var toBuffer,hasRequiredToBuffer$1;function requireToBuffer$1(){if(hasRequiredToBuffer$1)return toBuffer;hasRequiredToBuffer$1=1;var on=requireSafeBuffer$1().Buffer,In=requireIsarray$1(),Rn=requireTypedArrayBuffer(),Mn=ArrayBuffer.isView||function(Yn){try{return Rn(Yn),!0}catch{return!1}},Ln=typeof Uint8Array<"u",Hn=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",jn=Hn&&(on.prototype instanceof Uint8Array||on.TYPED_ARRAY_SUPPORT);return toBuffer=function(Yn,hi){if(Yn instanceof on)return Yn;if(typeof Yn=="string")return on.from(Yn,hi);if(Hn&&Mn(Yn)){if(Yn.byteLength===0)return on.alloc(0);if(jn){var vi=on.from(Yn.buffer,Yn.byteOffset,Yn.byteLength);if(vi.byteLength===Yn.byteLength)return vi}var gi=Yn instanceof Uint8Array?Yn:new Uint8Array(Yn.buffer,Yn.byteOffset,Yn.byteLength),mi=on.from(gi);if(mi.length===Yn.byteLength)return mi}if(Ln&&Yn instanceof Uint8Array)return on.from(Yn);var yi=In(Yn);if(yi)for(var bi=0;bi<Yn.length;bi+=1){var Ei=Yn[bi];if(typeof Ei!="number"||Ei<0||Ei>255||~~Ei!==Ei)throw new RangeError("Array items must be numbers in the range 0-255.")}if(yi||on.isBuffer(Yn)&&Yn.constructor&&typeof Yn.constructor.isBuffer=="function"&&Yn.constructor.isBuffer(Yn))return on.from(Yn);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')},toBuffer}var hash$1,hasRequiredHash$1;function requireHash$1(){if(hasRequiredHash$1)return hash$1;hasRequiredHash$1=1;var on=requireSafeBuffer$1().Buffer,In=requireToBuffer$1();function Rn(Mn,Ln){this._block=on.alloc(Mn),this._finalSize=Ln,this._blockSize=Mn,this._len=0}return Rn.prototype.update=function(Mn,Ln){Mn=In(Mn,Ln||"utf8");for(var Hn=this._block,jn=this._blockSize,Wn=Mn.length,Yn=this._len,hi=0;hi<Wn;){for(var vi=Yn%jn,gi=Math.min(Wn-hi,jn-vi),mi=0;mi<gi;mi++)Hn[vi+mi]=Mn[hi+mi];Yn+=gi,hi+=gi,Yn%jn===0&&this._update(Hn)}return this._len+=Wn,this},Rn.prototype.digest=function(Mn){var Ln=this._len%this._blockSize;this._block[Ln]=128,this._block.fill(0,Ln+1),Ln>=this._finalSize&&(this._update(this._block),this._block.fill(0));var Hn=this._len*8;if(Hn<=4294967295)this._block.writeUInt32BE(Hn,this._blockSize-4);else{var jn=(Hn&4294967295)>>>0,Wn=(Hn-jn)/4294967296;this._block.writeUInt32BE(Wn,this._blockSize-8),this._block.writeUInt32BE(jn,this._blockSize-4)}this._update(this._block);var Yn=this._hash();return Mn?Yn.toString(Mn):Yn},Rn.prototype._update=function(){throw new Error("_update must be implemented by subclass")},hash$1=Rn,hash$1}var sha$1,hasRequiredSha$1;function requireSha$1(){if(hasRequiredSha$1)return sha$1;hasRequiredSha$1=1;var on=requireInherits_browser(),In=requireHash$1(),Rn=requireSafeBuffer$1().Buffer,Mn=[1518500249,1859775393,-1894007588,-899497514],Ln=new Array(80);function Hn(){this.init(),this._w=Ln,In.call(this,64,56)}on(Hn,In),Hn.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function jn(hi){return hi<<5|hi>>>27}function Wn(hi){return hi<<30|hi>>>2}function Yn(hi,vi,gi,mi){return hi===0?vi&gi|~vi&mi:hi===2?vi&gi|vi&mi|gi&mi:vi^gi^mi}return Hn.prototype._update=function(hi){for(var vi=this._w,gi=this._a|0,mi=this._b|0,yi=this._c|0,bi=this._d|0,Ei=this._e|0,_i=0;_i<16;++_i)vi[_i]=hi.readInt32BE(_i*4);for(;_i<80;++_i)vi[_i]=vi[_i-3]^vi[_i-8]^vi[_i-14]^vi[_i-16];for(var xi=0;xi<80;++xi){var Ci=~~(xi/20),Ai=jn(gi)+Yn(Ci,mi,yi,bi)+Ei+vi[xi]+Mn[Ci]|0;Ei=bi,bi=yi,yi=Wn(mi),mi=gi,gi=Ai}this._a=gi+this._a|0,this._b=mi+this._b|0,this._c=yi+this._c|0,this._d=bi+this._d|0,this._e=Ei+this._e|0},Hn.prototype._hash=function(){var hi=Rn.allocUnsafe(20);return hi.writeInt32BE(this._a|0,0),hi.writeInt32BE(this._b|0,4),hi.writeInt32BE(this._c|0,8),hi.writeInt32BE(this._d|0,12),hi.writeInt32BE(this._e|0,16),hi},sha$1=Hn,sha$1}var sha1$2,hasRequiredSha1$1;function requireSha1$1(){if(hasRequiredSha1$1)return sha1$2;hasRequiredSha1$1=1;var on=requireInherits_browser(),In=requireHash$1(),Rn=requireSafeBuffer$1().Buffer,Mn=[1518500249,1859775393,-1894007588,-899497514],Ln=new Array(80);function Hn(){this.init(),this._w=Ln,In.call(this,64,56)}on(Hn,In),Hn.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function jn(vi){return vi<<1|vi>>>31}function Wn(vi){return vi<<5|vi>>>27}function Yn(vi){return vi<<30|vi>>>2}function hi(vi,gi,mi,yi){return vi===0?gi&mi|~gi&yi:vi===2?gi&mi|gi&yi|mi&yi:gi^mi^yi}return Hn.prototype._update=function(vi){for(var gi=this._w,mi=this._a|0,yi=this._b|0,bi=this._c|0,Ei=this._d|0,_i=this._e|0,xi=0;xi<16;++xi)gi[xi]=vi.readInt32BE(xi*4);for(;xi<80;++xi)gi[xi]=jn(gi[xi-3]^gi[xi-8]^gi[xi-14]^gi[xi-16]);for(var Ci=0;Ci<80;++Ci){var Ai=~~(Ci/20),Ii=Wn(mi)+hi(Ai,yi,bi,Ei)+_i+gi[Ci]+Mn[Ai]|0;_i=Ei,Ei=bi,bi=Yn(yi),yi=mi,mi=Ii}this._a=mi+this._a|0,this._b=yi+this._b|0,this._c=bi+this._c|0,this._d=Ei+this._d|0,this._e=_i+this._e|0},Hn.prototype._hash=function(){var vi=Rn.allocUnsafe(20);return vi.writeInt32BE(this._a|0,0),vi.writeInt32BE(this._b|0,4),vi.writeInt32BE(this._c|0,8),vi.writeInt32BE(this._d|0,12),vi.writeInt32BE(this._e|0,16),vi},sha1$2=Hn,sha1$2}var sha256$3,hasRequiredSha256$1;function requireSha256$1(){if(hasRequiredSha256$1)return sha256$3;hasRequiredSha256$1=1;var on=requireInherits_browser(),In=requireHash$1(),Rn=requireSafeBuffer$1().Buffer,Mn=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Ln=new Array(64);function Hn(){this.init(),this._w=Ln,In.call(this,64,56)}on(Hn,In),Hn.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function jn(mi,yi,bi){return bi^mi&(yi^bi)}function Wn(mi,yi,bi){return mi&yi|bi&(mi|yi)}function Yn(mi){return(mi>>>2|mi<<30)^(mi>>>13|mi<<19)^(mi>>>22|mi<<10)}function hi(mi){return(mi>>>6|mi<<26)^(mi>>>11|mi<<21)^(mi>>>25|mi<<7)}function vi(mi){return(mi>>>7|mi<<25)^(mi>>>18|mi<<14)^mi>>>3}function gi(mi){return(mi>>>17|mi<<15)^(mi>>>19|mi<<13)^mi>>>10}return Hn.prototype._update=function(mi){for(var yi=this._w,bi=this._a|0,Ei=this._b|0,_i=this._c|0,xi=this._d|0,Ci=this._e|0,Ai=this._f|0,Ii=this._g|0,Ni=this._h|0,Pi=0;Pi<16;++Pi)yi[Pi]=mi.readInt32BE(Pi*4);for(;Pi<64;++Pi)yi[Pi]=gi(yi[Pi-2])+yi[Pi-7]+vi(yi[Pi-15])+yi[Pi-16]|0;for(var Vi=0;Vi<64;++Vi){var Ui=Ni+hi(Ci)+jn(Ci,Ai,Ii)+Mn[Vi]+yi[Vi]|0,Gi=Yn(bi)+Wn(bi,Ei,_i)|0;Ni=Ii,Ii=Ai,Ai=Ci,Ci=xi+Ui|0,xi=_i,_i=Ei,Ei=bi,bi=Ui+Gi|0}this._a=bi+this._a|0,this._b=Ei+this._b|0,this._c=_i+this._c|0,this._d=xi+this._d|0,this._e=Ci+this._e|0,this._f=Ai+this._f|0,this._g=Ii+this._g|0,this._h=Ni+this._h|0},Hn.prototype._hash=function(){var mi=Rn.allocUnsafe(32);return mi.writeInt32BE(this._a,0),mi.writeInt32BE(this._b,4),mi.writeInt32BE(this._c,8),mi.writeInt32BE(this._d,12),mi.writeInt32BE(this._e,16),mi.writeInt32BE(this._f,20),mi.writeInt32BE(this._g,24),mi.writeInt32BE(this._h,28),mi},sha256$3=Hn,sha256$3}var sha224$3,hasRequiredSha224$1;function requireSha224$1(){if(hasRequiredSha224$1)return sha224$3;hasRequiredSha224$1=1;var on=requireInherits_browser(),In=requireSha256$1(),Rn=requireHash$1(),Mn=requireSafeBuffer$1().Buffer,Ln=new Array(64);function Hn(){this.init(),this._w=Ln,Rn.call(this,64,56)}return on(Hn,In),Hn.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},Hn.prototype._hash=function(){var jn=Mn.allocUnsafe(28);return jn.writeInt32BE(this._a,0),jn.writeInt32BE(this._b,4),jn.writeInt32BE(this._c,8),jn.writeInt32BE(this._d,12),jn.writeInt32BE(this._e,16),jn.writeInt32BE(this._f,20),jn.writeInt32BE(this._g,24),jn},sha224$3=Hn,sha224$3}var sha512$3,hasRequiredSha512$1;function requireSha512$1(){if(hasRequiredSha512$1)return sha512$3;hasRequiredSha512$1=1;var on=requireInherits_browser(),In=requireHash$1(),Rn=requireSafeBuffer$1().Buffer,Mn=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],Ln=new Array(160);function Hn(){this.init(),this._w=Ln,In.call(this,128,112)}on(Hn,In),Hn.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function jn(Ei,_i,xi){return xi^Ei&(_i^xi)}function Wn(Ei,_i,xi){return Ei&_i|xi&(Ei|_i)}function Yn(Ei,_i){return(Ei>>>28|_i<<4)^(_i>>>2|Ei<<30)^(_i>>>7|Ei<<25)}function hi(Ei,_i){return(Ei>>>14|_i<<18)^(Ei>>>18|_i<<14)^(_i>>>9|Ei<<23)}function vi(Ei,_i){return(Ei>>>1|_i<<31)^(Ei>>>8|_i<<24)^Ei>>>7}function gi(Ei,_i){return(Ei>>>1|_i<<31)^(Ei>>>8|_i<<24)^(Ei>>>7|_i<<25)}function mi(Ei,_i){return(Ei>>>19|_i<<13)^(_i>>>29|Ei<<3)^Ei>>>6}function yi(Ei,_i){return(Ei>>>19|_i<<13)^(_i>>>29|Ei<<3)^(Ei>>>6|_i<<26)}function bi(Ei,_i){return Ei>>>0<_i>>>0?1:0}return Hn.prototype._update=function(Ei){for(var _i=this._w,xi=this._ah|0,Ci=this._bh|0,Ai=this._ch|0,Ii=this._dh|0,Ni=this._eh|0,Pi=this._fh|0,Vi=this._gh|0,Ui=this._hh|0,Gi=this._al|0,Yi=this._bl|0,zi=this._cl|0,Mi=this._dl|0,Li=this._el|0,wi=this._fl|0,Ri=this._gl|0,ki=this._hl|0,Bi=0;Bi<32;Bi+=2)_i[Bi]=Ei.readInt32BE(Bi*4),_i[Bi+1]=Ei.readInt32BE(Bi*4+4);for(;Bi<160;Bi+=2){var Hi=_i[Bi-30],Ki=_i[Bi-30+1],ji=vi(Hi,Ki),Fi=gi(Ki,Hi);Hi=_i[Bi-4],Ki=_i[Bi-4+1];var $i=mi(Hi,Ki),Wi=yi(Ki,Hi),Qi=_i[Bi-14],ea=_i[Bi-14+1],na=_i[Bi-32],Ji=_i[Bi-32+1],ra=Fi+ea|0,sa=ji+Qi+bi(ra,Fi)|0;ra=ra+Wi|0,sa=sa+$i+bi(ra,Wi)|0,ra=ra+Ji|0,sa=sa+na+bi(ra,Ji)|0,_i[Bi]=sa,_i[Bi+1]=ra}for(var la=0;la<160;la+=2){sa=_i[la],ra=_i[la+1];var aa=Wn(xi,Ci,Ai),ta=Wn(Gi,Yi,zi),fa=Yn(xi,Gi),ca=Yn(Gi,xi),pa=hi(Ni,Li),Ea=hi(Li,Ni),xa=Mn[la],ga=Mn[la+1],ma=jn(Ni,Pi,Vi),Aa=jn(Li,wi,Ri),va=ki+Ea|0,Sa=Ui+pa+bi(va,ki)|0;va=va+Aa|0,Sa=Sa+ma+bi(va,Aa)|0,va=va+ga|0,Sa=Sa+xa+bi(va,ga)|0,va=va+ra|0,Sa=Sa+sa+bi(va,ra)|0;var Ta=ca+ta|0,wa=fa+aa+bi(Ta,ca)|0;Ui=Vi,ki=Ri,Vi=Pi,Ri=wi,Pi=Ni,wi=Li,Li=Mi+va|0,Ni=Ii+Sa+bi(Li,Mi)|0,Ii=Ai,Mi=zi,Ai=Ci,zi=Yi,Ci=xi,Yi=Gi,Gi=va+Ta|0,xi=Sa+wa+bi(Gi,va)|0}this._al=this._al+Gi|0,this._bl=this._bl+Yi|0,this._cl=this._cl+zi|0,this._dl=this._dl+Mi|0,this._el=this._el+Li|0,this._fl=this._fl+wi|0,this._gl=this._gl+Ri|0,this._hl=this._hl+ki|0,this._ah=this._ah+xi+bi(this._al,Gi)|0,this._bh=this._bh+Ci+bi(this._bl,Yi)|0,this._ch=this._ch+Ai+bi(this._cl,zi)|0,this._dh=this._dh+Ii+bi(this._dl,Mi)|0,this._eh=this._eh+Ni+bi(this._el,Li)|0,this._fh=this._fh+Pi+bi(this._fl,wi)|0,this._gh=this._gh+Vi+bi(this._gl,Ri)|0,this._hh=this._hh+Ui+bi(this._hl,ki)|0},Hn.prototype._hash=function(){var Ei=Rn.allocUnsafe(64);function _i(xi,Ci,Ai){Ei.writeInt32BE(xi,Ai),Ei.writeInt32BE(Ci,Ai+4)}return _i(this._ah,this._al,0),_i(this._bh,this._bl,8),_i(this._ch,this._cl,16),_i(this._dh,this._dl,24),_i(this._eh,this._el,32),_i(this._fh,this._fl,40),_i(this._gh,this._gl,48),_i(this._hh,this._hl,56),Ei},sha512$3=Hn,sha512$3}var sha384$3,hasRequiredSha384$1;function requireSha384$1(){if(hasRequiredSha384$1)return sha384$3;hasRequiredSha384$1=1;var on=requireInherits_browser(),In=requireSha512$1(),Rn=requireHash$1(),Mn=requireSafeBuffer$1().Buffer,Ln=new Array(160);function Hn(){this.init(),this._w=Ln,Rn.call(this,128,112)}return on(Hn,In),Hn.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},Hn.prototype._hash=function(){var jn=Mn.allocUnsafe(48);function Wn(Yn,hi,vi){jn.writeInt32BE(Yn,vi),jn.writeInt32BE(hi,vi+4)}return Wn(this._ah,this._al,0),Wn(this._bh,this._bl,8),Wn(this._ch,this._cl,16),Wn(this._dh,this._dl,24),Wn(this._eh,this._el,32),Wn(this._fh,this._fl,40),jn},sha384$3=Hn,sha384$3}var hasRequiredSha_js;function requireSha_js(){return hasRequiredSha_js||(hasRequiredSha_js=1,function(on){on.exports=function(Rn){var Mn=Rn.toLowerCase(),Ln=on.exports[Mn];if(!Ln)throw new Error(Mn+" is not supported (we accept pull requests)");return new Ln},on.exports.sha=requireSha$1(),on.exports.sha1=requireSha1$1(),on.exports.sha224=requireSha224$1(),on.exports.sha256=requireSha256$1(),on.exports.sha384=requireSha384$1(),on.exports.sha512=requireSha512$1()}(sha_js)),sha_js.exports}var streamBrowserify,hasRequiredStreamBrowserify;function requireStreamBrowserify(){if(hasRequiredStreamBrowserify)return streamBrowserify;hasRequiredStreamBrowserify=1,streamBrowserify=Rn;var on=requireEvents().EventEmitter,In=requireInherits_browser();In(Rn,on),Rn.Readable=require_stream_readable$1(),Rn.Writable=require_stream_writable$1(),Rn.Duplex=require_stream_duplex$1(),Rn.Transform=require_stream_transform$1(),Rn.PassThrough=require_stream_passthrough$1(),Rn.finished=requireEndOfStream(),Rn.pipeline=requirePipeline(),Rn.Stream=Rn;function Rn(){on.call(this)}return Rn.prototype.pipe=function(Mn,Ln){var Hn=this;function jn(yi){Mn.writable&&Mn.write(yi)===!1&&Hn.pause&&Hn.pause()}Hn.on("data",jn);function Wn(){Hn.readable&&Hn.resume&&Hn.resume()}Mn.on("drain",Wn),!Mn._isStdio&&(!Ln||Ln.end!==!1)&&(Hn.on("end",hi),Hn.on("close",vi));var Yn=!1;function hi(){Yn||(Yn=!0,Mn.end())}function vi(){Yn||(Yn=!0,typeof Mn.destroy=="function"&&Mn.destroy())}function gi(yi){if(mi(),on.listenerCount(this,"error")===0)throw yi}Hn.on("error",gi),Mn.on("error",gi);function mi(){Hn.removeListener("data",jn),Mn.removeListener("drain",Wn),Hn.removeListener("end",hi),Hn.removeListener("close",vi),Hn.removeListener("error",gi),Mn.removeListener("error",gi),Hn.removeListener("end",mi),Hn.removeListener("close",mi),Mn.removeListener("close",mi)}return Hn.on("end",mi),Hn.on("close",mi),Mn.on("close",mi),Mn.emit("pipe",Hn),Mn},streamBrowserify}var cipherBase,hasRequiredCipherBase;function requireCipherBase(){if(hasRequiredCipherBase)return cipherBase;hasRequiredCipherBase=1;var on=requireSafeBuffer$1().Buffer,In=requireStreamBrowserify().Transform,Rn=requireString_decoder().StringDecoder,Mn=requireInherits_browser();function Ln(Yn){In.call(this),this.hashMode=typeof Yn=="string",this.hashMode?this[Yn]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}Mn(Ln,In);var Hn=typeof Uint8Array<"u",jn=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&ArrayBuffer.isView&&(on.prototype instanceof Uint8Array||on.TYPED_ARRAY_SUPPORT);function Wn(Yn,hi){if(Yn instanceof on)return Yn;if(typeof Yn=="string")return on.from(Yn,hi);if(jn&&ArrayBuffer.isView(Yn)){if(Yn.byteLength===0)return on.alloc(0);var vi=on.from(Yn.buffer,Yn.byteOffset,Yn.byteLength);if(vi.byteLength===Yn.byteLength)return vi}if(Hn&&Yn instanceof Uint8Array||on.isBuffer(Yn)&&Yn.constructor&&typeof Yn.constructor.isBuffer=="function"&&Yn.constructor.isBuffer(Yn))return on.from(Yn);throw new TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}return Ln.prototype.update=function(Yn,hi,vi){var gi=Wn(Yn,hi),mi=this._update(gi);return this.hashMode?this:(vi&&(mi=this._toString(mi,vi)),mi)},Ln.prototype.setAutoPadding=function(){},Ln.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},Ln.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},Ln.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},Ln.prototype._transform=function(Yn,hi,vi){var gi;try{this.hashMode?this._update(Yn):this.push(this._update(Yn))}catch(mi){gi=mi}finally{vi(gi)}},Ln.prototype._flush=function(Yn){var hi;try{this.push(this.__final())}catch(vi){hi=vi}Yn(hi)},Ln.prototype._finalOrDigest=function(Yn){var hi=this.__final()||on.alloc(0);return Yn&&(hi=this._toString(hi,Yn,!0)),hi},Ln.prototype._toString=function(Yn,hi,vi){if(this._decoder||(this._decoder=new Rn(hi),this._encoding=hi),this._encoding!==hi)throw new Error("can’t switch encodings");var gi=this._decoder.write(Yn);return vi&&(gi+=this._decoder.end()),gi},cipherBase=Ln,cipherBase}var browser$a,hasRequiredBrowser$a;function requireBrowser$a(){if(hasRequiredBrowser$a)return browser$a;hasRequiredBrowser$a=1;var on=requireInherits_browser(),In=requireMd5_js(),Rn=requireRipemd160$2(),Mn=requireSha_js(),Ln=requireCipherBase();function Hn(jn){Ln.call(this,"digest"),this._hash=jn}return on(Hn,Ln),Hn.prototype._update=function(jn){this._hash.update(jn)},Hn.prototype._final=function(){return this._hash.digest()},browser$a=function(Wn){return Wn=Wn.toLowerCase(),Wn==="md5"?new In:Wn==="rmd160"||Wn==="ripemd160"?new Rn:new Hn(Mn(Wn))},browser$a}var legacy,hasRequiredLegacy;function requireLegacy(){if(hasRequiredLegacy)return legacy;hasRequiredLegacy=1;var on=requireInherits_browser(),In=requireSafeBuffer$1().Buffer,Rn=requireCipherBase(),Mn=In.alloc(128),Ln=64;function Hn(jn,Wn){Rn.call(this,"digest"),typeof Wn=="string"&&(Wn=In.from(Wn)),this._alg=jn,this._key=Wn,Wn.length>Ln?Wn=jn(Wn):Wn.length<Ln&&(Wn=In.concat([Wn,Mn],Ln));for(var Yn=this._ipad=In.allocUnsafe(Ln),hi=this._opad=In.allocUnsafe(Ln),vi=0;vi<Ln;vi++)Yn[vi]=Wn[vi]^54,hi[vi]=Wn[vi]^92;this._hash=[Yn]}return on(Hn,Rn),Hn.prototype._update=function(jn){this._hash.push(jn)},Hn.prototype._final=function(){var jn=this._alg(In.concat(this._hash));return this._alg(In.concat([this._opad,jn]))},legacy=Hn,legacy}var md5$3,hasRequiredMd5$2;function requireMd5$2(){if(hasRequiredMd5$2)return md5$3;hasRequiredMd5$2=1;var on=requireMd5_js();return md5$3=function(In){return new on().update(In).digest()},md5$3}var browser$9,hasRequiredBrowser$9;function requireBrowser$9(){if(hasRequiredBrowser$9)return browser$9;hasRequiredBrowser$9=1;var on=requireInherits_browser(),In=requireLegacy(),Rn=requireCipherBase(),Mn=requireSafeBuffer$1().Buffer,Ln=requireMd5$2(),Hn=requireRipemd160$2(),jn=requireSha_js(),Wn=Mn.alloc(128);function Yn(hi,vi){Rn.call(this,"digest"),typeof vi=="string"&&(vi=Mn.from(vi));var gi=hi==="sha512"||hi==="sha384"?128:64;if(this._alg=hi,this._key=vi,vi.length>gi){var mi=hi==="rmd160"?new Hn:jn(hi);vi=mi.update(vi).digest()}else vi.length<gi&&(vi=Mn.concat([vi,Wn],gi));for(var yi=this._ipad=Mn.allocUnsafe(gi),bi=this._opad=Mn.allocUnsafe(gi),Ei=0;Ei<gi;Ei++)yi[Ei]=vi[Ei]^54,bi[Ei]=vi[Ei]^92;this._hash=hi==="rmd160"?new Hn:jn(hi),this._hash.update(yi)}return on(Yn,Rn),Yn.prototype._update=function(hi){this._hash.update(hi)},Yn.prototype._final=function(){var hi=this._hash.digest(),vi=this._alg==="rmd160"?new Hn:jn(this._alg);return vi.update(this._opad).update(hi).digest()},browser$9=function(vi,gi){return vi=vi.toLowerCase(),vi==="rmd160"||vi==="ripemd160"?new Yn("rmd160",gi):vi==="md5"?new In(Ln,gi):new Yn(vi,gi)},browser$9}const sha224WithRSAEncryption={sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption={sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption={sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption={sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},sha256$2={sign:"ecdsa",hash:"sha256",id:""},sha224$2={sign:"ecdsa",hash:"sha224",id:""},sha384$2={sign:"ecdsa",hash:"sha384",id:""},sha512$2={sign:"ecdsa",hash:"sha512",id:""},DSA={sign:"dsa",hash:"sha1",id:""},ripemd160WithRSA={sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption={sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},require$$6={sha224WithRSAEncryption,"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption,"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption,"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption,"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:sha256$2,sha224:sha224$2,sha384:sha384$2,sha512:sha512$2,"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA,"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA,"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption,"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}};var algos,hasRequiredAlgos;function requireAlgos(){return hasRequiredAlgos||(hasRequiredAlgos=1,algos=require$$6),algos}var browser$8={},precondition,hasRequiredPrecondition;function requirePrecondition(){if(hasRequiredPrecondition)return precondition;hasRequiredPrecondition=1;var on=Math.pow(2,30)-1;return precondition=function(In,Rn){if(typeof In!="number")throw new TypeError("Iterations not a number");if(In<0)throw new TypeError("Bad iterations");if(typeof Rn!="number")throw new TypeError("Key length not a number");if(Rn<0||Rn>on||Rn!==Rn)throw new TypeError("Bad key length")},precondition}var defaultEncoding_1,hasRequiredDefaultEncoding;function requireDefaultEncoding(){if(hasRequiredDefaultEncoding)return defaultEncoding_1;hasRequiredDefaultEncoding=1;var on;if(commonjsGlobal.process&&commonjsGlobal.process.browser)on="utf-8";else if(commonjsGlobal.process&&commonjsGlobal.process.version){var In=parseInt(process$1.version.split(".")[0].slice(1),10);on=In>=6?"utf-8":"binary"}else on="utf-8";return defaultEncoding_1=on,defaultEncoding_1}var makeHash,hasRequiredMakeHash;function requireMakeHash(){if(hasRequiredMakeHash)return makeHash;hasRequiredMakeHash=1;var on=4,In=new Buffer(on);In.fill(0);var Rn=8,Mn=16;function Ln(Hn){if(Hn.length%on!==0){var jn=Hn.length+(on-Hn.length%on);Hn=Buffer.concat([Hn,In],jn)}for(var Wn=new Array(Hn.length>>>2),Yn=0,hi=0;Yn<Hn.length;Yn+=on,hi++)Wn[hi]=Hn.readInt32LE(Yn);return Wn}return makeHash=function(jn,Wn){var Yn=Wn(Ln(jn),jn.length*Rn);jn=new Buffer(Mn);for(var hi=0;hi<Yn.length;hi++)jn.writeInt32LE(Yn[hi],hi<<2,!0);return jn},makeHash}var md5$2,hasRequiredMd5$1;function requireMd5$1(){if(hasRequiredMd5$1)return md5$2;hasRequiredMd5$1=1;var on=requireMakeHash();function In(hi,vi){hi[vi>>5]|=128<<vi%32,hi[(vi+64>>>9<<4)+14]=vi;for(var gi=1732584193,mi=-271733879,yi=-1732584194,bi=271733878,Ei=0;Ei<hi.length;Ei+=16){var _i=gi,xi=mi,Ci=yi,Ai=bi;gi=Mn(gi,mi,yi,bi,hi[Ei+0],7,-680876936),bi=Mn(bi,gi,mi,yi,hi[Ei+1],12,-389564586),yi=Mn(yi,bi,gi,mi,hi[Ei+2],17,606105819),mi=Mn(mi,yi,bi,gi,hi[Ei+3],22,-1044525330),gi=Mn(gi,mi,yi,bi,hi[Ei+4],7,-176418897),bi=Mn(bi,gi,mi,yi,hi[Ei+5],12,1200080426),yi=Mn(yi,bi,gi,mi,hi[Ei+6],17,-1473231341),mi=Mn(mi,yi,bi,gi,hi[Ei+7],22,-45705983),gi=Mn(gi,mi,yi,bi,hi[Ei+8],7,1770035416),bi=Mn(bi,gi,mi,yi,hi[Ei+9],12,-1958414417),yi=Mn(yi,bi,gi,mi,hi[Ei+10],17,-42063),mi=Mn(mi,yi,bi,gi,hi[Ei+11],22,-1990404162),gi=Mn(gi,mi,yi,bi,hi[Ei+12],7,1804603682),bi=Mn(bi,gi,mi,yi,hi[Ei+13],12,-40341101),yi=Mn(yi,bi,gi,mi,hi[Ei+14],17,-1502002290),mi=Mn(mi,yi,bi,gi,hi[Ei+15],22,1236535329),gi=Ln(gi,mi,yi,bi,hi[Ei+1],5,-165796510),bi=Ln(bi,gi,mi,yi,hi[Ei+6],9,-1069501632),yi=Ln(yi,bi,gi,mi,hi[Ei+11],14,643717713),mi=Ln(mi,yi,bi,gi,hi[Ei+0],20,-373897302),gi=Ln(gi,mi,yi,bi,hi[Ei+5],5,-701558691),bi=Ln(bi,gi,mi,yi,hi[Ei+10],9,38016083),yi=Ln(yi,bi,gi,mi,hi[Ei+15],14,-660478335),mi=Ln(mi,yi,bi,gi,hi[Ei+4],20,-405537848),gi=Ln(gi,mi,yi,bi,hi[Ei+9],5,568446438),bi=Ln(bi,gi,mi,yi,hi[Ei+14],9,-1019803690),yi=Ln(yi,bi,gi,mi,hi[Ei+3],14,-187363961),mi=Ln(mi,yi,bi,gi,hi[Ei+8],20,1163531501),gi=Ln(gi,mi,yi,bi,hi[Ei+13],5,-1444681467),bi=Ln(bi,gi,mi,yi,hi[Ei+2],9,-51403784),yi=Ln(yi,bi,gi,mi,hi[Ei+7],14,1735328473),mi=Ln(mi,yi,bi,gi,hi[Ei+12],20,-1926607734),gi=Hn(gi,mi,yi,bi,hi[Ei+5],4,-378558),bi=Hn(bi,gi,mi,yi,hi[Ei+8],11,-2022574463),yi=Hn(yi,bi,gi,mi,hi[Ei+11],16,1839030562),mi=Hn(mi,yi,bi,gi,hi[Ei+14],23,-35309556),gi=Hn(gi,mi,yi,bi,hi[Ei+1],4,-1530992060),bi=Hn(bi,gi,mi,yi,hi[Ei+4],11,1272893353),yi=Hn(yi,bi,gi,mi,hi[Ei+7],16,-155497632),mi=Hn(mi,yi,bi,gi,hi[Ei+10],23,-1094730640),gi=Hn(gi,mi,yi,bi,hi[Ei+13],4,681279174),bi=Hn(bi,gi,mi,yi,hi[Ei+0],11,-358537222),yi=Hn(yi,bi,gi,mi,hi[Ei+3],16,-722521979),mi=Hn(mi,yi,bi,gi,hi[Ei+6],23,76029189),gi=Hn(gi,mi,yi,bi,hi[Ei+9],4,-640364487),bi=Hn(bi,gi,mi,yi,hi[Ei+12],11,-421815835),yi=Hn(yi,bi,gi,mi,hi[Ei+15],16,530742520),mi=Hn(mi,yi,bi,gi,hi[Ei+2],23,-995338651),gi=jn(gi,mi,yi,bi,hi[Ei+0],6,-198630844),bi=jn(bi,gi,mi,yi,hi[Ei+7],10,1126891415),yi=jn(yi,bi,gi,mi,hi[Ei+14],15,-1416354905),mi=jn(mi,yi,bi,gi,hi[Ei+5],21,-57434055),gi=jn(gi,mi,yi,bi,hi[Ei+12],6,1700485571),bi=jn(bi,gi,mi,yi,hi[Ei+3],10,-1894986606),yi=jn(yi,bi,gi,mi,hi[Ei+10],15,-1051523),mi=jn(mi,yi,bi,gi,hi[Ei+1],21,-2054922799),gi=jn(gi,mi,yi,bi,hi[Ei+8],6,1873313359),bi=jn(bi,gi,mi,yi,hi[Ei+15],10,-30611744),yi=jn(yi,bi,gi,mi,hi[Ei+6],15,-1560198380),mi=jn(mi,yi,bi,gi,hi[Ei+13],21,1309151649),gi=jn(gi,mi,yi,bi,hi[Ei+4],6,-145523070),bi=jn(bi,gi,mi,yi,hi[Ei+11],10,-1120210379),yi=jn(yi,bi,gi,mi,hi[Ei+2],15,718787259),mi=jn(mi,yi,bi,gi,hi[Ei+9],21,-343485551),gi=Wn(gi,_i),mi=Wn(mi,xi),yi=Wn(yi,Ci),bi=Wn(bi,Ai)}return[gi,mi,yi,bi]}function Rn(hi,vi,gi,mi,yi,bi){return Wn(Yn(Wn(Wn(vi,hi),Wn(mi,bi)),yi),gi)}function Mn(hi,vi,gi,mi,yi,bi,Ei){return Rn(vi&gi|~vi&mi,hi,vi,yi,bi,Ei)}function Ln(hi,vi,gi,mi,yi,bi,Ei){return Rn(vi&mi|gi&~mi,hi,vi,yi,bi,Ei)}function Hn(hi,vi,gi,mi,yi,bi,Ei){return Rn(vi^gi^mi,hi,vi,yi,bi,Ei)}function jn(hi,vi,gi,mi,yi,bi,Ei){return Rn(gi^(vi|~mi),hi,vi,yi,bi,Ei)}function Wn(hi,vi){var gi=(hi&65535)+(vi&65535),mi=(hi>>16)+(vi>>16)+(gi>>16);return mi<<16|gi&65535}function Yn(hi,vi){return hi<<vi|hi>>>32-vi}return md5$2=function(vi){return on(vi,In)},md5$2}var hashBase,hasRequiredHashBase;function requireHashBase(){if(hasRequiredHashBase)return hashBase;hasRequiredHashBase=1;var on=requireStreamBrowserify().Transform,In=requireInherits_browser();function Rn(Mn){on.call(this),this._block=new Buffer(Mn),this._blockSize=Mn,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}return In(Rn,on),Rn.prototype._transform=function(Mn,Ln,Hn){var jn=null;try{Ln!=="buffer"&&(Mn=new Buffer(Mn,Ln)),this.update(Mn)}catch(Wn){jn=Wn}Hn(jn)},Rn.prototype._flush=function(Mn){var Ln=null;try{this.push(this._digest())}catch(Hn){Ln=Hn}Mn(Ln)},Rn.prototype.update=function(Mn,Ln){if(!Buffer.isBuffer(Mn)&&typeof Mn!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");Buffer.isBuffer(Mn)||(Mn=new Buffer(Mn,Ln||"binary"));for(var Hn=this._block,jn=0;this._blockOffset+Mn.length-jn>=this._blockSize;){for(var Wn=this._blockOffset;Wn<this._blockSize;)Hn[Wn++]=Mn[jn++];this._update(),this._blockOffset=0}for(;jn<Mn.length;)Hn[this._blockOffset++]=Mn[jn++];for(var Yn=0,hi=Mn.length*8;hi>0;++Yn)this._length[Yn]+=hi,hi=this._length[Yn]/4294967296|0,hi>0&&(this._length[Yn]-=4294967296*hi);return this},Rn.prototype._update=function(Mn){throw new Error("_update is not implemented")},Rn.prototype.digest=function(Mn){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var Ln=this._digest();return Mn!==void 0&&(Ln=Ln.toString(Mn)),Ln},Rn.prototype._digest=function(){throw new Error("_digest is not implemented")},hashBase=Rn,hashBase}var ripemd160$2,hasRequiredRipemd160$1;function requireRipemd160$1(){if(hasRequiredRipemd160$1)return ripemd160$2;hasRequiredRipemd160$1=1;var on=requireInherits_browser(),In=requireHashBase();function Rn(){In.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}on(Rn,In),Rn.prototype._update=function(){for(var hi=new Array(16),vi=0;vi<16;++vi)hi[vi]=this._block.readInt32LE(vi*4);var gi=this._a,mi=this._b,yi=this._c,bi=this._d,Ei=this._e;gi=Ln(gi,mi,yi,bi,Ei,hi[0],0,11),yi=Mn(yi,10),Ei=Ln(Ei,gi,mi,yi,bi,hi[1],0,14),mi=Mn(mi,10),bi=Ln(bi,Ei,gi,mi,yi,hi[2],0,15),gi=Mn(gi,10),yi=Ln(yi,bi,Ei,gi,mi,hi[3],0,12),Ei=Mn(Ei,10),mi=Ln(mi,yi,bi,Ei,gi,hi[4],0,5),bi=Mn(bi,10),gi=Ln(gi,mi,yi,bi,Ei,hi[5],0,8),yi=Mn(yi,10),Ei=Ln(Ei,gi,mi,yi,bi,hi[6],0,7),mi=Mn(mi,10),bi=Ln(bi,Ei,gi,mi,yi,hi[7],0,9),gi=Mn(gi,10),yi=Ln(yi,bi,Ei,gi,mi,hi[8],0,11),Ei=Mn(Ei,10),mi=Ln(mi,yi,bi,Ei,gi,hi[9],0,13),bi=Mn(bi,10),gi=Ln(gi,mi,yi,bi,Ei,hi[10],0,14),yi=Mn(yi,10),Ei=Ln(Ei,gi,mi,yi,bi,hi[11],0,15),mi=Mn(mi,10),bi=Ln(bi,Ei,gi,mi,yi,hi[12],0,6),gi=Mn(gi,10),yi=Ln(yi,bi,Ei,gi,mi,hi[13],0,7),Ei=Mn(Ei,10),mi=Ln(mi,yi,bi,Ei,gi,hi[14],0,9),bi=Mn(bi,10),gi=Ln(gi,mi,yi,bi,Ei,hi[15],0,8),yi=Mn(yi,10),Ei=Hn(Ei,gi,mi,yi,bi,hi[7],1518500249,7),mi=Mn(mi,10),bi=Hn(bi,Ei,gi,mi,yi,hi[4],1518500249,6),gi=Mn(gi,10),yi=Hn(yi,bi,Ei,gi,mi,hi[13],1518500249,8),Ei=Mn(Ei,10),mi=Hn(mi,yi,bi,Ei,gi,hi[1],1518500249,13),bi=Mn(bi,10),gi=Hn(gi,mi,yi,bi,Ei,hi[10],1518500249,11),yi=Mn(yi,10),Ei=Hn(Ei,gi,mi,yi,bi,hi[6],1518500249,9),mi=Mn(mi,10),bi=Hn(bi,Ei,gi,mi,yi,hi[15],1518500249,7),gi=Mn(gi,10),yi=Hn(yi,bi,Ei,gi,mi,hi[3],1518500249,15),Ei=Mn(Ei,10),mi=Hn(mi,yi,bi,Ei,gi,hi[12],1518500249,7),bi=Mn(bi,10),gi=Hn(gi,mi,yi,bi,Ei,hi[0],1518500249,12),yi=Mn(yi,10),Ei=Hn(Ei,gi,mi,yi,bi,hi[9],1518500249,15),mi=Mn(mi,10),bi=Hn(bi,Ei,gi,mi,yi,hi[5],1518500249,9),gi=Mn(gi,10),yi=Hn(yi,bi,Ei,gi,mi,hi[2],1518500249,11),Ei=Mn(Ei,10),mi=Hn(mi,yi,bi,Ei,gi,hi[14],1518500249,7),bi=Mn(bi,10),gi=Hn(gi,mi,yi,bi,Ei,hi[11],1518500249,13),yi=Mn(yi,10),Ei=Hn(Ei,gi,mi,yi,bi,hi[8],1518500249,12),mi=Mn(mi,10),bi=jn(bi,Ei,gi,mi,yi,hi[3],1859775393,11),gi=Mn(gi,10),yi=jn(yi,bi,Ei,gi,mi,hi[10],1859775393,13),Ei=Mn(Ei,10),mi=jn(mi,yi,bi,Ei,gi,hi[14],1859775393,6),bi=Mn(bi,10),gi=jn(gi,mi,yi,bi,Ei,hi[4],1859775393,7),yi=Mn(yi,10),Ei=jn(Ei,gi,mi,yi,bi,hi[9],1859775393,14),mi=Mn(mi,10),bi=jn(bi,Ei,gi,mi,yi,hi[15],1859775393,9),gi=Mn(gi,10),yi=jn(yi,bi,Ei,gi,mi,hi[8],1859775393,13),Ei=Mn(Ei,10),mi=jn(mi,yi,bi,Ei,gi,hi[1],1859775393,15),bi=Mn(bi,10),gi=jn(gi,mi,yi,bi,Ei,hi[2],1859775393,14),yi=Mn(yi,10),Ei=jn(Ei,gi,mi,yi,bi,hi[7],1859775393,8),mi=Mn(mi,10),bi=jn(bi,Ei,gi,mi,yi,hi[0],1859775393,13),gi=Mn(gi,10),yi=jn(yi,bi,Ei,gi,mi,hi[6],1859775393,6),Ei=Mn(Ei,10),mi=jn(mi,yi,bi,Ei,gi,hi[13],1859775393,5),bi=Mn(bi,10),gi=jn(gi,mi,yi,bi,Ei,hi[11],1859775393,12),yi=Mn(yi,10),Ei=jn(Ei,gi,mi,yi,bi,hi[5],1859775393,7),mi=Mn(mi,10),bi=jn(bi,Ei,gi,mi,yi,hi[12],1859775393,5),gi=Mn(gi,10),yi=Wn(yi,bi,Ei,gi,mi,hi[1],2400959708,11),Ei=Mn(Ei,10),mi=Wn(mi,yi,bi,Ei,gi,hi[9],2400959708,12),bi=Mn(bi,10),gi=Wn(gi,mi,yi,bi,Ei,hi[11],2400959708,14),yi=Mn(yi,10),Ei=Wn(Ei,gi,mi,yi,bi,hi[10],2400959708,15),mi=Mn(mi,10),bi=Wn(bi,Ei,gi,mi,yi,hi[0],2400959708,14),gi=Mn(gi,10),yi=Wn(yi,bi,Ei,gi,mi,hi[8],2400959708,15),Ei=Mn(Ei,10),mi=Wn(mi,yi,bi,Ei,gi,hi[12],2400959708,9),bi=Mn(bi,10),gi=Wn(gi,mi,yi,bi,Ei,hi[4],2400959708,8),yi=Mn(yi,10),Ei=Wn(Ei,gi,mi,yi,bi,hi[13],2400959708,9),mi=Mn(mi,10),bi=Wn(bi,Ei,gi,mi,yi,hi[3],2400959708,14),gi=Mn(gi,10),yi=Wn(yi,bi,Ei,gi,mi,hi[7],2400959708,5),Ei=Mn(Ei,10),mi=Wn(mi,yi,bi,Ei,gi,hi[15],2400959708,6),bi=Mn(bi,10),gi=Wn(gi,mi,yi,bi,Ei,hi[14],2400959708,8),yi=Mn(yi,10),Ei=Wn(Ei,gi,mi,yi,bi,hi[5],2400959708,6),mi=Mn(mi,10),bi=Wn(bi,Ei,gi,mi,yi,hi[6],2400959708,5),gi=Mn(gi,10),yi=Wn(yi,bi,Ei,gi,mi,hi[2],2400959708,12),Ei=Mn(Ei,10),mi=Yn(mi,yi,bi,Ei,gi,hi[4],2840853838,9),bi=Mn(bi,10),gi=Yn(gi,mi,yi,bi,Ei,hi[0],2840853838,15),yi=Mn(yi,10),Ei=Yn(Ei,gi,mi,yi,bi,hi[5],2840853838,5),mi=Mn(mi,10),bi=Yn(bi,Ei,gi,mi,yi,hi[9],2840853838,11),gi=Mn(gi,10),yi=Yn(yi,bi,Ei,gi,mi,hi[7],2840853838,6),Ei=Mn(Ei,10),mi=Yn(mi,yi,bi,Ei,gi,hi[12],2840853838,8),bi=Mn(bi,10),gi=Yn(gi,mi,yi,bi,Ei,hi[2],2840853838,13),yi=Mn(yi,10),Ei=Yn(Ei,gi,mi,yi,bi,hi[10],2840853838,12),mi=Mn(mi,10),bi=Yn(bi,Ei,gi,mi,yi,hi[14],2840853838,5),gi=Mn(gi,10),yi=Yn(yi,bi,Ei,gi,mi,hi[1],2840853838,12),Ei=Mn(Ei,10),mi=Yn(mi,yi,bi,Ei,gi,hi[3],2840853838,13),bi=Mn(bi,10),gi=Yn(gi,mi,yi,bi,Ei,hi[8],2840853838,14),yi=Mn(yi,10),Ei=Yn(Ei,gi,mi,yi,bi,hi[11],2840853838,11),mi=Mn(mi,10),bi=Yn(bi,Ei,gi,mi,yi,hi[6],2840853838,8),gi=Mn(gi,10),yi=Yn(yi,bi,Ei,gi,mi,hi[15],2840853838,5),Ei=Mn(Ei,10),mi=Yn(mi,yi,bi,Ei,gi,hi[13],2840853838,6),bi=Mn(bi,10);var _i=this._a,xi=this._b,Ci=this._c,Ai=this._d,Ii=this._e;_i=Yn(_i,xi,Ci,Ai,Ii,hi[5],1352829926,8),Ci=Mn(Ci,10),Ii=Yn(Ii,_i,xi,Ci,Ai,hi[14],1352829926,9),xi=Mn(xi,10),Ai=Yn(Ai,Ii,_i,xi,Ci,hi[7],1352829926,9),_i=Mn(_i,10),Ci=Yn(Ci,Ai,Ii,_i,xi,hi[0],1352829926,11),Ii=Mn(Ii,10),xi=Yn(xi,Ci,Ai,Ii,_i,hi[9],1352829926,13),Ai=Mn(Ai,10),_i=Yn(_i,xi,Ci,Ai,Ii,hi[2],1352829926,15),Ci=Mn(Ci,10),Ii=Yn(Ii,_i,xi,Ci,Ai,hi[11],1352829926,15),xi=Mn(xi,10),Ai=Yn(Ai,Ii,_i,xi,Ci,hi[4],1352829926,5),_i=Mn(_i,10),Ci=Yn(Ci,Ai,Ii,_i,xi,hi[13],1352829926,7),Ii=Mn(Ii,10),xi=Yn(xi,Ci,Ai,Ii,_i,hi[6],1352829926,7),Ai=Mn(Ai,10),_i=Yn(_i,xi,Ci,Ai,Ii,hi[15],1352829926,8),Ci=Mn(Ci,10),Ii=Yn(Ii,_i,xi,Ci,Ai,hi[8],1352829926,11),xi=Mn(xi,10),Ai=Yn(Ai,Ii,_i,xi,Ci,hi[1],1352829926,14),_i=Mn(_i,10),Ci=Yn(Ci,Ai,Ii,_i,xi,hi[10],1352829926,14),Ii=Mn(Ii,10),xi=Yn(xi,Ci,Ai,Ii,_i,hi[3],1352829926,12),Ai=Mn(Ai,10),_i=Yn(_i,xi,Ci,Ai,Ii,hi[12],1352829926,6),Ci=Mn(Ci,10),Ii=Wn(Ii,_i,xi,Ci,Ai,hi[6],1548603684,9),xi=Mn(xi,10),Ai=Wn(Ai,Ii,_i,xi,Ci,hi[11],1548603684,13),_i=Mn(_i,10),Ci=Wn(Ci,Ai,Ii,_i,xi,hi[3],1548603684,15),Ii=Mn(Ii,10),xi=Wn(xi,Ci,Ai,Ii,_i,hi[7],1548603684,7),Ai=Mn(Ai,10),_i=Wn(_i,xi,Ci,Ai,Ii,hi[0],1548603684,12),Ci=Mn(Ci,10),Ii=Wn(Ii,_i,xi,Ci,Ai,hi[13],1548603684,8),xi=Mn(xi,10),Ai=Wn(Ai,Ii,_i,xi,Ci,hi[5],1548603684,9),_i=Mn(_i,10),Ci=Wn(Ci,Ai,Ii,_i,xi,hi[10],1548603684,11),Ii=Mn(Ii,10),xi=Wn(xi,Ci,Ai,Ii,_i,hi[14],1548603684,7),Ai=Mn(Ai,10),_i=Wn(_i,xi,Ci,Ai,Ii,hi[15],1548603684,7),Ci=Mn(Ci,10),Ii=Wn(Ii,_i,xi,Ci,Ai,hi[8],1548603684,12),xi=Mn(xi,10),Ai=Wn(Ai,Ii,_i,xi,Ci,hi[12],1548603684,7),_i=Mn(_i,10),Ci=Wn(Ci,Ai,Ii,_i,xi,hi[4],1548603684,6),Ii=Mn(Ii,10),xi=Wn(xi,Ci,Ai,Ii,_i,hi[9],1548603684,15),Ai=Mn(Ai,10),_i=Wn(_i,xi,Ci,Ai,Ii,hi[1],1548603684,13),Ci=Mn(Ci,10),Ii=Wn(Ii,_i,xi,Ci,Ai,hi[2],1548603684,11),xi=Mn(xi,10),Ai=jn(Ai,Ii,_i,xi,Ci,hi[15],1836072691,9),_i=Mn(_i,10),Ci=jn(Ci,Ai,Ii,_i,xi,hi[5],1836072691,7),Ii=Mn(Ii,10),xi=jn(xi,Ci,Ai,Ii,_i,hi[1],1836072691,15),Ai=Mn(Ai,10),_i=jn(_i,xi,Ci,Ai,Ii,hi[3],1836072691,11),Ci=Mn(Ci,10),Ii=jn(Ii,_i,xi,Ci,Ai,hi[7],1836072691,8),xi=Mn(xi,10),Ai=jn(Ai,Ii,_i,xi,Ci,hi[14],1836072691,6),_i=Mn(_i,10),Ci=jn(Ci,Ai,Ii,_i,xi,hi[6],1836072691,6),Ii=Mn(Ii,10),xi=jn(xi,Ci,Ai,Ii,_i,hi[9],1836072691,14),Ai=Mn(Ai,10),_i=jn(_i,xi,Ci,Ai,Ii,hi[11],1836072691,12),Ci=Mn(Ci,10),Ii=jn(Ii,_i,xi,Ci,Ai,hi[8],1836072691,13),xi=Mn(xi,10),Ai=jn(Ai,Ii,_i,xi,Ci,hi[12],1836072691,5),_i=Mn(_i,10),Ci=jn(Ci,Ai,Ii,_i,xi,hi[2],1836072691,14),Ii=Mn(Ii,10),xi=jn(xi,Ci,Ai,Ii,_i,hi[10],1836072691,13),Ai=Mn(Ai,10),_i=jn(_i,xi,Ci,Ai,Ii,hi[0],1836072691,13),Ci=Mn(Ci,10),Ii=jn(Ii,_i,xi,Ci,Ai,hi[4],1836072691,7),xi=Mn(xi,10),Ai=jn(Ai,Ii,_i,xi,Ci,hi[13],1836072691,5),_i=Mn(_i,10),Ci=Hn(Ci,Ai,Ii,_i,xi,hi[8],2053994217,15),Ii=Mn(Ii,10),xi=Hn(xi,Ci,Ai,Ii,_i,hi[6],2053994217,5),Ai=Mn(Ai,10),_i=Hn(_i,xi,Ci,Ai,Ii,hi[4],2053994217,8),Ci=Mn(Ci,10),Ii=Hn(Ii,_i,xi,Ci,Ai,hi[1],2053994217,11),xi=Mn(xi,10),Ai=Hn(Ai,Ii,_i,xi,Ci,hi[3],2053994217,14),_i=Mn(_i,10),Ci=Hn(Ci,Ai,Ii,_i,xi,hi[11],2053994217,14),Ii=Mn(Ii,10),xi=Hn(xi,Ci,Ai,Ii,_i,hi[15],2053994217,6),Ai=Mn(Ai,10),_i=Hn(_i,xi,Ci,Ai,Ii,hi[0],2053994217,14),Ci=Mn(Ci,10),Ii=Hn(Ii,_i,xi,Ci,Ai,hi[5],2053994217,6),xi=Mn(xi,10),Ai=Hn(Ai,Ii,_i,xi,Ci,hi[12],2053994217,9),_i=Mn(_i,10),Ci=Hn(Ci,Ai,Ii,_i,xi,hi[2],2053994217,12),Ii=Mn(Ii,10),xi=Hn(xi,Ci,Ai,Ii,_i,hi[13],2053994217,9),Ai=Mn(Ai,10),_i=Hn(_i,xi,Ci,Ai,Ii,hi[9],2053994217,12),Ci=Mn(Ci,10),Ii=Hn(Ii,_i,xi,Ci,Ai,hi[7],2053994217,5),xi=Mn(xi,10),Ai=Hn(Ai,Ii,_i,xi,Ci,hi[10],2053994217,15),_i=Mn(_i,10),Ci=Hn(Ci,Ai,Ii,_i,xi,hi[14],2053994217,8),Ii=Mn(Ii,10),xi=Ln(xi,Ci,Ai,Ii,_i,hi[12],0,8),Ai=Mn(Ai,10),_i=Ln(_i,xi,Ci,Ai,Ii,hi[15],0,5),Ci=Mn(Ci,10),Ii=Ln(Ii,_i,xi,Ci,Ai,hi[10],0,12),xi=Mn(xi,10),Ai=Ln(Ai,Ii,_i,xi,Ci,hi[4],0,9),_i=Mn(_i,10),Ci=Ln(Ci,Ai,Ii,_i,xi,hi[1],0,12),Ii=Mn(Ii,10),xi=Ln(xi,Ci,Ai,Ii,_i,hi[5],0,5),Ai=Mn(Ai,10),_i=Ln(_i,xi,Ci,Ai,Ii,hi[8],0,14),Ci=Mn(Ci,10),Ii=Ln(Ii,_i,xi,Ci,Ai,hi[7],0,6),xi=Mn(xi,10),Ai=Ln(Ai,Ii,_i,xi,Ci,hi[6],0,8),_i=Mn(_i,10),Ci=Ln(Ci,Ai,Ii,_i,xi,hi[2],0,13),Ii=Mn(Ii,10),xi=Ln(xi,Ci,Ai,Ii,_i,hi[13],0,6),Ai=Mn(Ai,10),_i=Ln(_i,xi,Ci,Ai,Ii,hi[14],0,5),Ci=Mn(Ci,10),Ii=Ln(Ii,_i,xi,Ci,Ai,hi[0],0,15),xi=Mn(xi,10),Ai=Ln(Ai,Ii,_i,xi,Ci,hi[3],0,13),_i=Mn(_i,10),Ci=Ln(Ci,Ai,Ii,_i,xi,hi[9],0,11),Ii=Mn(Ii,10),xi=Ln(xi,Ci,Ai,Ii,_i,hi[11],0,11),Ai=Mn(Ai,10);var Ni=this._b+yi+Ai|0;this._b=this._c+bi+Ii|0,this._c=this._d+Ei+_i|0,this._d=this._e+gi+xi|0,this._e=this._a+mi+Ci|0,this._a=Ni},Rn.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var hi=new Buffer(20);return hi.writeInt32LE(this._a,0),hi.writeInt32LE(this._b,4),hi.writeInt32LE(this._c,8),hi.writeInt32LE(this._d,12),hi.writeInt32LE(this._e,16),hi};function Mn(hi,vi){return hi<<vi|hi>>>32-vi}function Ln(hi,vi,gi,mi,yi,bi,Ei,_i){return Mn(hi+(vi^gi^mi)+bi+Ei|0,_i)+yi|0}function Hn(hi,vi,gi,mi,yi,bi,Ei,_i){return Mn(hi+(vi&gi|~vi&mi)+bi+Ei|0,_i)+yi|0}function jn(hi,vi,gi,mi,yi,bi,Ei,_i){return Mn(hi+((vi|~gi)^mi)+bi+Ei|0,_i)+yi|0}function Wn(hi,vi,gi,mi,yi,bi,Ei,_i){return Mn(hi+(vi&mi|gi&~mi)+bi+Ei|0,_i)+yi|0}function Yn(hi,vi,gi,mi,yi,bi,Ei,_i){return Mn(hi+(vi^(gi|~mi))+bi+Ei|0,_i)+yi|0}return ripemd160$2=Rn,ripemd160$2}var toBuffer_1,hasRequiredToBuffer;function requireToBuffer(){if(hasRequiredToBuffer)return toBuffer_1;hasRequiredToBuffer=1;var on=requireSafeBuffer$1().Buffer,In=requireToBuffer$1(),Rn=typeof Uint8Array<"u",Mn=Rn&&typeof ArrayBuffer<"u",Ln=Mn&&ArrayBuffer.isView;return toBuffer_1=function(Hn,jn,Wn){if(typeof Hn=="string"||on.isBuffer(Hn)||Rn&&Hn instanceof Uint8Array||Ln&&Ln(Hn))return In(Hn,jn);throw new TypeError(Wn+" must be a string, a Buffer, a Uint8Array, or a DataView")},toBuffer_1}var syncBrowser,hasRequiredSyncBrowser;function requireSyncBrowser(){if(hasRequiredSyncBrowser)return syncBrowser;hasRequiredSyncBrowser=1;var on=requireMd5$1(),In=requireRipemd160$1(),Rn=requireSha_js(),Mn=requireSafeBuffer$1().Buffer,Ln=requirePrecondition(),Hn=requireDefaultEncoding(),jn=requireToBuffer(),Wn=Mn.alloc(128),Yn={__proto__:null,md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,"sha512-256":32,ripemd160:20,rmd160:20},hi={__proto__:null,"sha-1":"sha1","sha-224":"sha224","sha-256":"sha256","sha-384":"sha384","sha-512":"sha512","ripemd-160":"ripemd160"};function vi(bi){return new In().update(bi).digest()}function gi(bi){function Ei(_i){return Rn(bi).update(_i).digest()}return bi==="rmd160"||bi==="ripemd160"?vi:bi==="md5"?on:Ei}function mi(bi,Ei,_i){var xi=gi(bi),Ci=bi==="sha512"||bi==="sha384"?128:64;Ei.length>Ci?Ei=xi(Ei):Ei.length<Ci&&(Ei=Mn.concat([Ei,Wn],Ci));for(var Ai=Mn.allocUnsafe(Ci+Yn[bi]),Ii=Mn.allocUnsafe(Ci+Yn[bi]),Ni=0;Ni<Ci;Ni++)Ai[Ni]=Ei[Ni]^54,Ii[Ni]=Ei[Ni]^92;var Pi=Mn.allocUnsafe(Ci+_i+4);Ai.copy(Pi,0,0,Ci),this.ipad1=Pi,this.ipad2=Ai,this.opad=Ii,this.alg=bi,this.blocksize=Ci,this.hash=xi,this.size=Yn[bi]}mi.prototype.run=function(bi,Ei){bi.copy(Ei,this.blocksize);var _i=this.hash(Ei);return _i.copy(this.opad,this.blocksize),this.hash(this.opad)};function yi(bi,Ei,_i,xi,Ci){Ln(_i,xi),bi=jn(bi,Hn,"Password"),Ei=jn(Ei,Hn,"Salt");var Ai=(Ci||"sha1").toLowerCase(),Ii=hi[Ai]||Ai,Ni=Yn[Ii];if(typeof Ni!="number"||!Ni)throw new TypeError("Digest algorithm not supported: "+Ci);var Pi=new mi(Ii,bi,Ei.length),Vi=Mn.allocUnsafe(xi),Ui=Mn.allocUnsafe(Ei.length+4);Ei.copy(Ui,0,0,Ei.length);for(var Gi=0,Yi=Ni,zi=Math.ceil(xi/Yi),Mi=1;Mi<=zi;Mi++){Ui.writeUInt32BE(Mi,Ei.length);for(var Li=Pi.run(Ui,Pi.ipad1),wi=Li,Ri=1;Ri<_i;Ri++){wi=Pi.run(wi,Pi.ipad2);for(var ki=0;ki<Yi;ki++)Li[ki]^=wi[ki]}Li.copy(Vi,Gi),Gi+=Yi}return Vi}return syncBrowser=yi,syncBrowser}var async,hasRequiredAsync;function requireAsync(){if(hasRequiredAsync)return async;hasRequiredAsync=1;var on=requireSafeBuffer$1().Buffer,In=requirePrecondition(),Rn=requireDefaultEncoding(),Mn=requireSyncBrowser(),Ln=requireToBuffer(),Hn,jn=commonjsGlobal.crypto&&commonjsGlobal.crypto.subtle,Wn={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},Yn=[],hi;function vi(){return hi||(commonjsGlobal.process&&commonjsGlobal.process.nextTick?hi=commonjsGlobal.process.nextTick:commonjsGlobal.queueMicrotask?hi=commonjsGlobal.queueMicrotask:commonjsGlobal.setImmediate?hi=commonjsGlobal.setImmediate:hi=commonjsGlobal.setTimeout,hi)}function gi(bi,Ei,_i,xi,Ci){return jn.importKey("raw",bi,{name:"PBKDF2"},!1,["deriveBits"]).then(function(Ai){return jn.deriveBits({name:"PBKDF2",salt:Ei,iterations:_i,hash:{name:Ci}},Ai,xi<<3)}).then(function(Ai){return on.from(Ai)})}function mi(bi){if(commonjsGlobal.process&&!commonjsGlobal.process.browser||!jn||!jn.importKey||!jn.deriveBits)return Promise.resolve(!1);if(Yn[bi]!==void 0)return Yn[bi];Hn=Hn||on.alloc(8);var Ei=gi(Hn,Hn,10,128,bi).then(function(){return!0},function(){return!1});return Yn[bi]=Ei,Ei}function yi(bi,Ei){bi.then(function(_i){vi()(function(){Ei(null,_i)})},function(_i){vi()(function(){Ei(_i)})})}return async=function(bi,Ei,_i,xi,Ci,Ai){typeof Ci=="function"&&(Ai=Ci,Ci=void 0),Ci=Ci||"sha1";var Ii=Wn[Ci.toLowerCase()];if(!Ii||typeof commonjsGlobal.Promise!="function"){vi()(function(){var Ni;try{Ni=Mn(bi,Ei,_i,xi,Ci)}catch(Pi){Ai(Pi);return}Ai(null,Ni)});return}if(In(_i,xi),bi=Ln(bi,Rn,"Password"),Ei=Ln(Ei,Rn,"Salt"),typeof Ai!="function")throw new Error("No callback provided to pbkdf2");yi(mi(Ii).then(function(Ni){return Ni?gi(bi,Ei,_i,xi,Ii):Mn(bi,Ei,_i,xi,Ci)}),Ai)},async}var hasRequiredBrowser$8;function requireBrowser$8(){return hasRequiredBrowser$8||(hasRequiredBrowser$8=1,browser$8.pbkdf2=requireAsync(),browser$8.pbkdf2Sync=requireSyncBrowser()),browser$8}var browser$7={},des$1={},utils$3={},hasRequiredUtils$3;function requireUtils$3(){if(hasRequiredUtils$3)return utils$3;hasRequiredUtils$3=1,utils$3.readUInt32BE=function(Ln,Hn){var jn=Ln[0+Hn]<<24|Ln[1+Hn]<<16|Ln[2+Hn]<<8|Ln[3+Hn];return jn>>>0},utils$3.writeUInt32BE=function(Ln,Hn,jn){Ln[0+jn]=Hn>>>24,Ln[1+jn]=Hn>>>16&255,Ln[2+jn]=Hn>>>8&255,Ln[3+jn]=Hn&255},utils$3.ip=function(Ln,Hn,jn,Wn){for(var Yn=0,hi=0,vi=6;vi>=0;vi-=2){for(var gi=0;gi<=24;gi+=8)Yn<<=1,Yn|=Hn>>>gi+vi&1;for(var gi=0;gi<=24;gi+=8)Yn<<=1,Yn|=Ln>>>gi+vi&1}for(var vi=6;vi>=0;vi-=2){for(var gi=1;gi<=25;gi+=8)hi<<=1,hi|=Hn>>>gi+vi&1;for(var gi=1;gi<=25;gi+=8)hi<<=1,hi|=Ln>>>gi+vi&1}jn[Wn+0]=Yn>>>0,jn[Wn+1]=hi>>>0},utils$3.rip=function(Ln,Hn,jn,Wn){for(var Yn=0,hi=0,vi=0;vi<4;vi++)for(var gi=24;gi>=0;gi-=8)Yn<<=1,Yn|=Hn>>>gi+vi&1,Yn<<=1,Yn|=Ln>>>gi+vi&1;for(var vi=4;vi<8;vi++)for(var gi=24;gi>=0;gi-=8)hi<<=1,hi|=Hn>>>gi+vi&1,hi<<=1,hi|=Ln>>>gi+vi&1;jn[Wn+0]=Yn>>>0,jn[Wn+1]=hi>>>0},utils$3.pc1=function(Ln,Hn,jn,Wn){for(var Yn=0,hi=0,vi=7;vi>=5;vi--){for(var gi=0;gi<=24;gi+=8)Yn<<=1,Yn|=Hn>>gi+vi&1;for(var gi=0;gi<=24;gi+=8)Yn<<=1,Yn|=Ln>>gi+vi&1}for(var gi=0;gi<=24;gi+=8)Yn<<=1,Yn|=Hn>>gi+vi&1;for(var vi=1;vi<=3;vi++){for(var gi=0;gi<=24;gi+=8)hi<<=1,hi|=Hn>>gi+vi&1;for(var gi=0;gi<=24;gi+=8)hi<<=1,hi|=Ln>>gi+vi&1}for(var gi=0;gi<=24;gi+=8)hi<<=1,hi|=Ln>>gi+vi&1;jn[Wn+0]=Yn>>>0,jn[Wn+1]=hi>>>0},utils$3.r28shl=function(Ln,Hn){return Ln<<Hn&268435455|Ln>>>28-Hn};var on=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];utils$3.pc2=function(Ln,Hn,jn,Wn){for(var Yn=0,hi=0,vi=on.length>>>1,gi=0;gi<vi;gi++)Yn<<=1,Yn|=Ln>>>on[gi]&1;for(var gi=vi;gi<on.length;gi++)hi<<=1,hi|=Hn>>>on[gi]&1;jn[Wn+0]=Yn>>>0,jn[Wn+1]=hi>>>0},utils$3.expand=function(Ln,Hn,jn){var Wn=0,Yn=0;Wn=(Ln&1)<<5|Ln>>>27;for(var hi=23;hi>=15;hi-=4)Wn<<=6,Wn|=Ln>>>hi&63;for(var hi=11;hi>=3;hi-=4)Yn|=Ln>>>hi&63,Yn<<=6;Yn|=(Ln&31)<<1|Ln>>>31,Hn[jn+0]=Wn>>>0,Hn[jn+1]=Yn>>>0};var In=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];utils$3.substitute=function(Ln,Hn){for(var jn=0,Wn=0;Wn<4;Wn++){var Yn=Ln>>>18-Wn*6&63,hi=In[Wn*64+Yn];jn<<=4,jn|=hi}for(var Wn=0;Wn<4;Wn++){var Yn=Hn>>>18-Wn*6&63,hi=In[256+Wn*64+Yn];jn<<=4,jn|=hi}return jn>>>0};var Rn=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];return utils$3.permute=function(Ln){for(var Hn=0,jn=0;jn<Rn.length;jn++)Hn<<=1,Hn|=Ln>>>Rn[jn]&1;return Hn>>>0},utils$3.padSplit=function(Ln,Hn,jn){for(var Wn=Ln.toString(2);Wn.length<Hn;)Wn="0"+Wn;for(var Yn=[],hi=0;hi<Hn;hi+=jn)Yn.push(Wn.slice(hi,hi+jn));return Yn.join(" ")},utils$3}var minimalisticAssert,hasRequiredMinimalisticAssert;function requireMinimalisticAssert(){if(hasRequiredMinimalisticAssert)return minimalisticAssert;hasRequiredMinimalisticAssert=1,minimalisticAssert=on;function on(In,Rn){if(!In)throw new Error(Rn||"Assertion failed")}return on.equal=function(Rn,Mn,Ln){if(Rn!=Mn)throw new Error(Ln||"Assertion failed: "+Rn+" != "+Mn)},minimalisticAssert}var cipher,hasRequiredCipher;function requireCipher(){if(hasRequiredCipher)return cipher;hasRequiredCipher=1;var on=requireMinimalisticAssert();function In(Rn){this.options=Rn,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=Rn.padding!==!1}return cipher=In,In.prototype._init=function(){},In.prototype.update=function(Mn){return Mn.length===0?[]:this.type==="decrypt"?this._updateDecrypt(Mn):this._updateEncrypt(Mn)},In.prototype._buffer=function(Mn,Ln){for(var Hn=Math.min(this.buffer.length-this.bufferOff,Mn.length-Ln),jn=0;jn<Hn;jn++)this.buffer[this.bufferOff+jn]=Mn[Ln+jn];return this.bufferOff+=Hn,Hn},In.prototype._flushBuffer=function(Mn,Ln){return this._update(this.buffer,0,Mn,Ln),this.bufferOff=0,this.blockSize},In.prototype._updateEncrypt=function(Mn){var Ln=0,Hn=0,jn=(this.bufferOff+Mn.length)/this.blockSize|0,Wn=new Array(jn*this.blockSize);this.bufferOff!==0&&(Ln+=this._buffer(Mn,Ln),this.bufferOff===this.buffer.length&&(Hn+=this._flushBuffer(Wn,Hn)));for(var Yn=Mn.length-(Mn.length-Ln)%this.blockSize;Ln<Yn;Ln+=this.blockSize)this._update(Mn,Ln,Wn,Hn),Hn+=this.blockSize;for(;Ln<Mn.length;Ln++,this.bufferOff++)this.buffer[this.bufferOff]=Mn[Ln];return Wn},In.prototype._updateDecrypt=function(Mn){for(var Ln=0,Hn=0,jn=Math.ceil((this.bufferOff+Mn.length)/this.blockSize)-1,Wn=new Array(jn*this.blockSize);jn>0;jn--)Ln+=this._buffer(Mn,Ln),Hn+=this._flushBuffer(Wn,Hn);return Ln+=this._buffer(Mn,Ln),Wn},In.prototype.final=function(Mn){var Ln;Mn&&(Ln=this.update(Mn));var Hn;return this.type==="encrypt"?Hn=this._finalEncrypt():Hn=this._finalDecrypt(),Ln?Ln.concat(Hn):Hn},In.prototype._pad=function(Mn,Ln){if(Ln===0)return!1;for(;Ln<Mn.length;)Mn[Ln++]=0;return!0},In.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var Mn=new Array(this.blockSize);return this._update(this.buffer,0,Mn,0),Mn},In.prototype._unpad=function(Mn){return Mn},In.prototype._finalDecrypt=function(){on.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var Mn=new Array(this.blockSize);return this._flushBuffer(Mn,0),this._unpad(Mn)},cipher}var des,hasRequiredDes$1;function requireDes$1(){if(hasRequiredDes$1)return des;hasRequiredDes$1=1;var on=requireMinimalisticAssert(),In=requireInherits_browser(),Rn=requireUtils$3(),Mn=requireCipher();function Ln(){this.tmp=new Array(2),this.keys=null}function Hn(Wn){Mn.call(this,Wn);var Yn=new Ln;this._desState=Yn,this.deriveKeys(Yn,Wn.key)}In(Hn,Mn),des=Hn,Hn.create=function(Yn){return new Hn(Yn)};var jn=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];return Hn.prototype.deriveKeys=function(Yn,hi){Yn.keys=new Array(32),on.equal(hi.length,this.blockSize,"Invalid key length");var vi=Rn.readUInt32BE(hi,0),gi=Rn.readUInt32BE(hi,4);Rn.pc1(vi,gi,Yn.tmp,0),vi=Yn.tmp[0],gi=Yn.tmp[1];for(var mi=0;mi<Yn.keys.length;mi+=2){var yi=jn[mi>>>1];vi=Rn.r28shl(vi,yi),gi=Rn.r28shl(gi,yi),Rn.pc2(vi,gi,Yn.keys,mi)}},Hn.prototype._update=function(Yn,hi,vi,gi){var mi=this._desState,yi=Rn.readUInt32BE(Yn,hi),bi=Rn.readUInt32BE(Yn,hi+4);Rn.ip(yi,bi,mi.tmp,0),yi=mi.tmp[0],bi=mi.tmp[1],this.type==="encrypt"?this._encrypt(mi,yi,bi,mi.tmp,0):this._decrypt(mi,yi,bi,mi.tmp,0),yi=mi.tmp[0],bi=mi.tmp[1],Rn.writeUInt32BE(vi,yi,gi),Rn.writeUInt32BE(vi,bi,gi+4)},Hn.prototype._pad=function(Yn,hi){if(this.padding===!1)return!1;for(var vi=Yn.length-hi,gi=hi;gi<Yn.length;gi++)Yn[gi]=vi;return!0},Hn.prototype._unpad=function(Yn){if(this.padding===!1)return Yn;for(var hi=Yn[Yn.length-1],vi=Yn.length-hi;vi<Yn.length;vi++)on.equal(Yn[vi],hi);return Yn.slice(0,Yn.length-hi)},Hn.prototype._encrypt=function(Yn,hi,vi,gi,mi){for(var yi=hi,bi=vi,Ei=0;Ei<Yn.keys.length;Ei+=2){var _i=Yn.keys[Ei],xi=Yn.keys[Ei+1];Rn.expand(bi,Yn.tmp,0),_i^=Yn.tmp[0],xi^=Yn.tmp[1];var Ci=Rn.substitute(_i,xi),Ai=Rn.permute(Ci),Ii=bi;bi=(yi^Ai)>>>0,yi=Ii}Rn.rip(bi,yi,gi,mi)},Hn.prototype._decrypt=function(Yn,hi,vi,gi,mi){for(var yi=vi,bi=hi,Ei=Yn.keys.length-2;Ei>=0;Ei-=2){var _i=Yn.keys[Ei],xi=Yn.keys[Ei+1];Rn.expand(yi,Yn.tmp,0),_i^=Yn.tmp[0],xi^=Yn.tmp[1];var Ci=Rn.substitute(_i,xi),Ai=Rn.permute(Ci),Ii=yi;yi=(bi^Ai)>>>0,bi=Ii}Rn.rip(yi,bi,gi,mi)},des}var cbc$1={},hasRequiredCbc$1;function requireCbc$1(){if(hasRequiredCbc$1)return cbc$1;hasRequiredCbc$1=1;var on=requireMinimalisticAssert(),In=requireInherits_browser(),Rn={};function Mn(Hn){on.equal(Hn.length,8,"Invalid IV length"),this.iv=new Array(8);for(var jn=0;jn<this.iv.length;jn++)this.iv[jn]=Hn[jn]}function Ln(Hn){function jn(vi){Hn.call(this,vi),this._cbcInit()}In(jn,Hn);for(var Wn=Object.keys(Rn),Yn=0;Yn<Wn.length;Yn++){var hi=Wn[Yn];jn.prototype[hi]=Rn[hi]}return jn.create=function(gi){return new jn(gi)},jn}return cbc$1.instantiate=Ln,Rn._cbcInit=function(){var jn=new Mn(this.options.iv);this._cbcState=jn},Rn._update=function(jn,Wn,Yn,hi){var vi=this._cbcState,gi=this.constructor.super_.prototype,mi=vi.iv;if(this.type==="encrypt"){for(var yi=0;yi<this.blockSize;yi++)mi[yi]^=jn[Wn+yi];gi._update.call(this,mi,0,Yn,hi);for(var yi=0;yi<this.blockSize;yi++)mi[yi]=Yn[hi+yi]}else{gi._update.call(this,jn,Wn,Yn,hi);for(var yi=0;yi<this.blockSize;yi++)Yn[hi+yi]^=mi[yi];for(var yi=0;yi<this.blockSize;yi++)mi[yi]=jn[Wn+yi]}},cbc$1}var ede,hasRequiredEde;function requireEde(){if(hasRequiredEde)return ede;hasRequiredEde=1;var on=requireMinimalisticAssert(),In=requireInherits_browser(),Rn=requireCipher(),Mn=requireDes$1();function Ln(jn,Wn){on.equal(Wn.length,24,"Invalid key length");var Yn=Wn.slice(0,8),hi=Wn.slice(8,16),vi=Wn.slice(16,24);jn==="encrypt"?this.ciphers=[Mn.create({type:"encrypt",key:Yn}),Mn.create({type:"decrypt",key:hi}),Mn.create({type:"encrypt",key:vi})]:this.ciphers=[Mn.create({type:"decrypt",key:vi}),Mn.create({type:"encrypt",key:hi}),Mn.create({type:"decrypt",key:Yn})]}function Hn(jn){Rn.call(this,jn);var Wn=new Ln(this.type,this.options.key);this._edeState=Wn}return In(Hn,Rn),ede=Hn,Hn.create=function(Wn){return new Hn(Wn)},Hn.prototype._update=function(Wn,Yn,hi,vi){var gi=this._edeState;gi.ciphers[0]._update(Wn,Yn,hi,vi),gi.ciphers[1]._update(hi,vi,hi,vi),gi.ciphers[2]._update(hi,vi,hi,vi)},Hn.prototype._pad=Mn.prototype._pad,Hn.prototype._unpad=Mn.prototype._unpad,ede}var hasRequiredDes;function requireDes(){return hasRequiredDes||(hasRequiredDes=1,des$1.utils=requireUtils$3(),des$1.Cipher=requireCipher(),des$1.DES=requireDes$1(),des$1.CBC=requireCbc$1(),des$1.EDE=requireEde()),des$1}var browserifyDes,hasRequiredBrowserifyDes;function requireBrowserifyDes(){if(hasRequiredBrowserifyDes)return browserifyDes;hasRequiredBrowserifyDes=1;var on=requireCipherBase(),In=requireDes(),Rn=requireInherits_browser(),Mn=requireSafeBuffer$1().Buffer,Ln={"des-ede3-cbc":In.CBC.instantiate(In.EDE),"des-ede3":In.EDE,"des-ede-cbc":In.CBC.instantiate(In.EDE),"des-ede":In.EDE,"des-cbc":In.CBC.instantiate(In.DES),"des-ecb":In.DES};Ln.des=Ln["des-cbc"],Ln.des3=Ln["des-ede3-cbc"],browserifyDes=Hn,Rn(Hn,on);function Hn(jn){on.call(this);var Wn=jn.mode.toLowerCase(),Yn=Ln[Wn],hi;jn.decrypt?hi="decrypt":hi="encrypt";var vi=jn.key;Mn.isBuffer(vi)||(vi=Mn.from(vi)),(Wn==="des-ede"||Wn==="des-ede-cbc")&&(vi=Mn.concat([vi,vi.slice(0,8)]));var gi=jn.iv;Mn.isBuffer(gi)||(gi=Mn.from(gi)),this._des=Yn.create({key:vi,iv:gi,type:hi})}return Hn.prototype._update=function(jn){return Mn.from(this._des.update(jn))},Hn.prototype._final=function(){return Mn.from(this._des.final())},browserifyDes}var browser$6={},encrypter={},ecb={},hasRequiredEcb;function requireEcb(){return hasRequiredEcb||(hasRequiredEcb=1,ecb.encrypt=function(on,In){return on._cipher.encryptBlock(In)},ecb.decrypt=function(on,In){return on._cipher.decryptBlock(In)}),ecb}var cbc={},bufferXor,hasRequiredBufferXor;function requireBufferXor(){return hasRequiredBufferXor||(hasRequiredBufferXor=1,bufferXor=function(In,Rn){for(var Mn=Math.min(In.length,Rn.length),Ln=new Buffer(Mn),Hn=0;Hn<Mn;++Hn)Ln[Hn]=In[Hn]^Rn[Hn];return Ln}),bufferXor}var hasRequiredCbc;function requireCbc(){if(hasRequiredCbc)return cbc;hasRequiredCbc=1;var on=requireBufferXor();return cbc.encrypt=function(In,Rn){var Mn=on(Rn,In._prev);return In._prev=In._cipher.encryptBlock(Mn),In._prev},cbc.decrypt=function(In,Rn){var Mn=In._prev;In._prev=Rn;var Ln=In._cipher.decryptBlock(Rn);return on(Ln,Mn)},cbc}var cfb={},hasRequiredCfb;function requireCfb(){if(hasRequiredCfb)return cfb;hasRequiredCfb=1;var on=requireSafeBuffer$1().Buffer,In=requireBufferXor();function Rn(Mn,Ln,Hn){var jn=Ln.length,Wn=In(Ln,Mn._cache);return Mn._cache=Mn._cache.slice(jn),Mn._prev=on.concat([Mn._prev,Hn?Ln:Wn]),Wn}return cfb.encrypt=function(Mn,Ln,Hn){for(var jn=on.allocUnsafe(0),Wn;Ln.length;)if(Mn._cache.length===0&&(Mn._cache=Mn._cipher.encryptBlock(Mn._prev),Mn._prev=on.allocUnsafe(0)),Mn._cache.length<=Ln.length)Wn=Mn._cache.length,jn=on.concat([jn,Rn(Mn,Ln.slice(0,Wn),Hn)]),Ln=Ln.slice(Wn);else{jn=on.concat([jn,Rn(Mn,Ln,Hn)]);break}return jn},cfb}var cfb8={},hasRequiredCfb8;function requireCfb8(){if(hasRequiredCfb8)return cfb8;hasRequiredCfb8=1;var on=requireSafeBuffer$1().Buffer;function In(Rn,Mn,Ln){var Hn=Rn._cipher.encryptBlock(Rn._prev),jn=Hn[0]^Mn;return Rn._prev=on.concat([Rn._prev.slice(1),on.from([Ln?Mn:jn])]),jn}return cfb8.encrypt=function(Rn,Mn,Ln){for(var Hn=Mn.length,jn=on.allocUnsafe(Hn),Wn=-1;++Wn<Hn;)jn[Wn]=In(Rn,Mn[Wn],Ln);return jn},cfb8}var cfb1={},hasRequiredCfb1;function requireCfb1(){if(hasRequiredCfb1)return cfb1;hasRequiredCfb1=1;var on=requireSafeBuffer$1().Buffer;function In(Mn,Ln,Hn){for(var jn,Wn=-1,Yn=8,hi=0,vi,gi;++Wn<Yn;)jn=Mn._cipher.encryptBlock(Mn._prev),vi=Ln&1<<7-Wn?128:0,gi=jn[0]^vi,hi+=(gi&128)>>Wn%8,Mn._prev=Rn(Mn._prev,Hn?vi:gi);return hi}function Rn(Mn,Ln){var Hn=Mn.length,jn=-1,Wn=on.allocUnsafe(Mn.length);for(Mn=on.concat([Mn,on.from([Ln])]);++jn<Hn;)Wn[jn]=Mn[jn]<<1|Mn[jn+1]>>7;return Wn}return cfb1.encrypt=function(Mn,Ln,Hn){for(var jn=Ln.length,Wn=on.allocUnsafe(jn),Yn=-1;++Yn<jn;)Wn[Yn]=In(Mn,Ln[Yn],Hn);return Wn},cfb1}var ofb={},hasRequiredOfb;function requireOfb(){if(hasRequiredOfb)return ofb;hasRequiredOfb=1;var on=requireBufferXor();function In(Rn){return Rn._prev=Rn._cipher.encryptBlock(Rn._prev),Rn._prev}return ofb.encrypt=function(Rn,Mn){for(;Rn._cache.length<Mn.length;)Rn._cache=Buffer.concat([Rn._cache,In(Rn)]);var Ln=Rn._cache.slice(0,Mn.length);return Rn._cache=Rn._cache.slice(Mn.length),on(Mn,Ln)},ofb}var ctr={},incr32_1,hasRequiredIncr32;function requireIncr32(){if(hasRequiredIncr32)return incr32_1;hasRequiredIncr32=1;function on(In){for(var Rn=In.length,Mn;Rn--;)if(Mn=In.readUInt8(Rn),Mn===255)In.writeUInt8(0,Rn);else{Mn++,In.writeUInt8(Mn,Rn);break}}return incr32_1=on,incr32_1}var hasRequiredCtr;function requireCtr(){if(hasRequiredCtr)return ctr;hasRequiredCtr=1;var on=requireBufferXor(),In=requireSafeBuffer$1().Buffer,Rn=requireIncr32();function Mn(Hn){var jn=Hn._cipher.encryptBlockRaw(Hn._prev);return Rn(Hn._prev),jn}var Ln=16;return ctr.encrypt=function(Hn,jn){var Wn=Math.ceil(jn.length/Ln),Yn=Hn._cache.length;Hn._cache=In.concat([Hn._cache,In.allocUnsafe(Wn*Ln)]);for(var hi=0;hi<Wn;hi++){var vi=Mn(Hn),gi=Yn+hi*Ln;Hn._cache.writeUInt32BE(vi[0],gi+0),Hn._cache.writeUInt32BE(vi[1],gi+4),Hn._cache.writeUInt32BE(vi[2],gi+8),Hn._cache.writeUInt32BE(vi[3],gi+12)}var mi=Hn._cache.slice(0,jn.length);return Hn._cache=Hn._cache.slice(jn.length),on(jn,mi)},ctr}const aes128={cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},aes192={cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},aes256={cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},require$$2={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128,aes192,aes256,"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}};var modes_1,hasRequiredModes$1;function requireModes$1(){if(hasRequiredModes$1)return modes_1;hasRequiredModes$1=1;var on={ECB:requireEcb(),CBC:requireCbc(),CFB:requireCfb(),CFB8:requireCfb8(),CFB1:requireCfb1(),OFB:requireOfb(),CTR:requireCtr(),GCM:requireCtr()},In=require$$2;for(var Rn in In)In[Rn].module=on[In[Rn].mode];return modes_1=In,modes_1}var aes$2={},hasRequiredAes$1;function requireAes$1(){if(hasRequiredAes$1)return aes$2;hasRequiredAes$1=1;var on=requireSafeBuffer$1().Buffer;function In(Wn){on.isBuffer(Wn)||(Wn=on.from(Wn));for(var Yn=Wn.length/4|0,hi=new Array(Yn),vi=0;vi<Yn;vi++)hi[vi]=Wn.readUInt32BE(vi*4);return hi}function Rn(Wn){for(var Yn=0;Yn<Wn.length;Wn++)Wn[Yn]=0}function Mn(Wn,Yn,hi,vi,gi){for(var mi=hi[0],yi=hi[1],bi=hi[2],Ei=hi[3],_i=Wn[0]^Yn[0],xi=Wn[1]^Yn[1],Ci=Wn[2]^Yn[2],Ai=Wn[3]^Yn[3],Ii,Ni,Pi,Vi,Ui=4,Gi=1;Gi<gi;Gi++)Ii=mi[_i>>>24]^yi[xi>>>16&255]^bi[Ci>>>8&255]^Ei[Ai&255]^Yn[Ui++],Ni=mi[xi>>>24]^yi[Ci>>>16&255]^bi[Ai>>>8&255]^Ei[_i&255]^Yn[Ui++],Pi=mi[Ci>>>24]^yi[Ai>>>16&255]^bi[_i>>>8&255]^Ei[xi&255]^Yn[Ui++],Vi=mi[Ai>>>24]^yi[_i>>>16&255]^bi[xi>>>8&255]^Ei[Ci&255]^Yn[Ui++],_i=Ii,xi=Ni,Ci=Pi,Ai=Vi;return Ii=(vi[_i>>>24]<<24|vi[xi>>>16&255]<<16|vi[Ci>>>8&255]<<8|vi[Ai&255])^Yn[Ui++],Ni=(vi[xi>>>24]<<24|vi[Ci>>>16&255]<<16|vi[Ai>>>8&255]<<8|vi[_i&255])^Yn[Ui++],Pi=(vi[Ci>>>24]<<24|vi[Ai>>>16&255]<<16|vi[_i>>>8&255]<<8|vi[xi&255])^Yn[Ui++],Vi=(vi[Ai>>>24]<<24|vi[_i>>>16&255]<<16|vi[xi>>>8&255]<<8|vi[Ci&255])^Yn[Ui++],Ii=Ii>>>0,Ni=Ni>>>0,Pi=Pi>>>0,Vi=Vi>>>0,[Ii,Ni,Pi,Vi]}var Ln=[0,1,2,4,8,16,32,64,128,27,54],Hn=function(){for(var Wn=new Array(256),Yn=0;Yn<256;Yn++)Yn<128?Wn[Yn]=Yn<<1:Wn[Yn]=Yn<<1^283;for(var hi=[],vi=[],gi=[[],[],[],[]],mi=[[],[],[],[]],yi=0,bi=0,Ei=0;Ei<256;++Ei){var _i=bi^bi<<1^bi<<2^bi<<3^bi<<4;_i=_i>>>8^_i&255^99,hi[yi]=_i,vi[_i]=yi;var xi=Wn[yi],Ci=Wn[xi],Ai=Wn[Ci],Ii=Wn[_i]*257^_i*16843008;gi[0][yi]=Ii<<24|Ii>>>8,gi[1][yi]=Ii<<16|Ii>>>16,gi[2][yi]=Ii<<8|Ii>>>24,gi[3][yi]=Ii,Ii=Ai*16843009^Ci*65537^xi*257^yi*16843008,mi[0][_i]=Ii<<24|Ii>>>8,mi[1][_i]=Ii<<16|Ii>>>16,mi[2][_i]=Ii<<8|Ii>>>24,mi[3][_i]=Ii,yi===0?yi=bi=1:(yi=xi^Wn[Wn[Wn[Ai^xi]]],bi^=Wn[Wn[bi]])}return{SBOX:hi,INV_SBOX:vi,SUB_MIX:gi,INV_SUB_MIX:mi}}();function jn(Wn){this._key=In(Wn),this._reset()}return jn.blockSize=16,jn.keySize=256/8,jn.prototype.blockSize=jn.blockSize,jn.prototype.keySize=jn.keySize,jn.prototype._reset=function(){for(var Wn=this._key,Yn=Wn.length,hi=Yn+6,vi=(hi+1)*4,gi=[],mi=0;mi<Yn;mi++)gi[mi]=Wn[mi];for(mi=Yn;mi<vi;mi++){var yi=gi[mi-1];mi%Yn===0?(yi=yi<<8|yi>>>24,yi=Hn.SBOX[yi>>>24]<<24|Hn.SBOX[yi>>>16&255]<<16|Hn.SBOX[yi>>>8&255]<<8|Hn.SBOX[yi&255],yi^=Ln[mi/Yn|0]<<24):Yn>6&&mi%Yn===4&&(yi=Hn.SBOX[yi>>>24]<<24|Hn.SBOX[yi>>>16&255]<<16|Hn.SBOX[yi>>>8&255]<<8|Hn.SBOX[yi&255]),gi[mi]=gi[mi-Yn]^yi}for(var bi=[],Ei=0;Ei<vi;Ei++){var _i=vi-Ei,xi=gi[_i-(Ei%4?0:4)];Ei<4||_i<=4?bi[Ei]=xi:bi[Ei]=Hn.INV_SUB_MIX[0][Hn.SBOX[xi>>>24]]^Hn.INV_SUB_MIX[1][Hn.SBOX[xi>>>16&255]]^Hn.INV_SUB_MIX[2][Hn.SBOX[xi>>>8&255]]^Hn.INV_SUB_MIX[3][Hn.SBOX[xi&255]]}this._nRounds=hi,this._keySchedule=gi,this._invKeySchedule=bi},jn.prototype.encryptBlockRaw=function(Wn){return Wn=In(Wn),Mn(Wn,this._keySchedule,Hn.SUB_MIX,Hn.SBOX,this._nRounds)},jn.prototype.encryptBlock=function(Wn){var Yn=this.encryptBlockRaw(Wn),hi=on.allocUnsafe(16);return hi.writeUInt32BE(Yn[0],0),hi.writeUInt32BE(Yn[1],4),hi.writeUInt32BE(Yn[2],8),hi.writeUInt32BE(Yn[3],12),hi},jn.prototype.decryptBlock=function(Wn){Wn=In(Wn);var Yn=Wn[1];Wn[1]=Wn[3],Wn[3]=Yn;var hi=Mn(Wn,this._invKeySchedule,Hn.INV_SUB_MIX,Hn.INV_SBOX,this._nRounds),vi=on.allocUnsafe(16);return vi.writeUInt32BE(hi[0],0),vi.writeUInt32BE(hi[3],4),vi.writeUInt32BE(hi[2],8),vi.writeUInt32BE(hi[1],12),vi},jn.prototype.scrub=function(){Rn(this._keySchedule),Rn(this._invKeySchedule),Rn(this._key)},aes$2.AES=jn,aes$2}var ghash,hasRequiredGhash;function requireGhash(){if(hasRequiredGhash)return ghash;hasRequiredGhash=1;var on=requireSafeBuffer$1().Buffer,In=on.alloc(16,0);function Rn(Hn){return[Hn.readUInt32BE(0),Hn.readUInt32BE(4),Hn.readUInt32BE(8),Hn.readUInt32BE(12)]}function Mn(Hn){var jn=on.allocUnsafe(16);return jn.writeUInt32BE(Hn[0]>>>0,0),jn.writeUInt32BE(Hn[1]>>>0,4),jn.writeUInt32BE(Hn[2]>>>0,8),jn.writeUInt32BE(Hn[3]>>>0,12),jn}function Ln(Hn){this.h=Hn,this.state=on.alloc(16,0),this.cache=on.allocUnsafe(0)}return Ln.prototype.ghash=function(Hn){for(var jn=-1;++jn<Hn.length;)this.state[jn]^=Hn[jn];this._multiply()},Ln.prototype._multiply=function(){for(var Hn=Rn(this.h),jn=[0,0,0,0],Wn,Yn,hi,vi=-1;++vi<128;){for(Yn=(this.state[~~(vi/8)]&1<<7-vi%8)!==0,Yn&&(jn[0]^=Hn[0],jn[1]^=Hn[1],jn[2]^=Hn[2],jn[3]^=Hn[3]),hi=(Hn[3]&1)!==0,Wn=3;Wn>0;Wn--)Hn[Wn]=Hn[Wn]>>>1|(Hn[Wn-1]&1)<<31;Hn[0]=Hn[0]>>>1,hi&&(Hn[0]=Hn[0]^225<<24)}this.state=Mn(jn)},Ln.prototype.update=function(Hn){this.cache=on.concat([this.cache,Hn]);for(var jn;this.cache.length>=16;)jn=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(jn)},Ln.prototype.final=function(Hn,jn){return this.cache.length&&this.ghash(on.concat([this.cache,In],16)),this.ghash(Mn([0,Hn,0,jn])),this.state},ghash=Ln,ghash}var authCipher,hasRequiredAuthCipher;function requireAuthCipher(){if(hasRequiredAuthCipher)return authCipher;hasRequiredAuthCipher=1;var on=requireAes$1(),In=requireSafeBuffer$1().Buffer,Rn=requireCipherBase(),Mn=requireInherits_browser(),Ln=requireGhash(),Hn=requireBufferXor(),jn=requireIncr32();function Wn(vi,gi){var mi=0;vi.length!==gi.length&&mi++;for(var yi=Math.min(vi.length,gi.length),bi=0;bi<yi;++bi)mi+=vi[bi]^gi[bi];return mi}function Yn(vi,gi,mi){if(gi.length===12)return vi._finID=In.concat([gi,In.from([0,0,0,1])]),In.concat([gi,In.from([0,0,0,2])]);var yi=new Ln(mi),bi=gi.length,Ei=bi%16;yi.update(gi),Ei&&(Ei=16-Ei,yi.update(In.alloc(Ei,0))),yi.update(In.alloc(8,0));var _i=bi*8,xi=In.alloc(8);xi.writeUIntBE(_i,0,8),yi.update(xi),vi._finID=yi.state;var Ci=In.from(vi._finID);return jn(Ci),Ci}function hi(vi,gi,mi,yi){Rn.call(this);var bi=In.alloc(4,0);this._cipher=new on.AES(gi);var Ei=this._cipher.encryptBlock(bi);this._ghash=new Ln(Ei),mi=Yn(this,mi,Ei),this._prev=In.from(mi),this._cache=In.allocUnsafe(0),this._secCache=In.allocUnsafe(0),this._decrypt=yi,this._alen=0,this._len=0,this._mode=vi,this._authTag=null,this._called=!1}return Mn(hi,Rn),hi.prototype._update=function(vi){if(!this._called&&this._alen){var gi=16-this._alen%16;gi<16&&(gi=In.alloc(gi,0),this._ghash.update(gi))}this._called=!0;var mi=this._mode.encrypt(this,vi);return this._decrypt?this._ghash.update(vi):this._ghash.update(mi),this._len+=vi.length,mi},hi.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var vi=Hn(this._ghash.final(this._alen*8,this._len*8),this._cipher.encryptBlock(this._finID));if(this._decrypt&&Wn(vi,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=vi,this._cipher.scrub()},hi.prototype.getAuthTag=function(){if(this._decrypt||!In.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},hi.prototype.setAuthTag=function(gi){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=gi},hi.prototype.setAAD=function(gi){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(gi),this._alen+=gi.length},authCipher=hi,authCipher}var streamCipher,hasRequiredStreamCipher;function requireStreamCipher(){if(hasRequiredStreamCipher)return streamCipher;hasRequiredStreamCipher=1;var on=requireAes$1(),In=requireSafeBuffer$1().Buffer,Rn=requireCipherBase(),Mn=requireInherits_browser();function Ln(Hn,jn,Wn,Yn){Rn.call(this),this._cipher=new on.AES(jn),this._prev=In.from(Wn),this._cache=In.allocUnsafe(0),this._secCache=In.allocUnsafe(0),this._decrypt=Yn,this._mode=Hn}return Mn(Ln,Rn),Ln.prototype._update=function(Hn){return this._mode.encrypt(this,Hn,this._decrypt)},Ln.prototype._final=function(){this._cipher.scrub()},streamCipher=Ln,streamCipher}var evp_bytestokey,hasRequiredEvp_bytestokey;function requireEvp_bytestokey(){if(hasRequiredEvp_bytestokey)return evp_bytestokey;hasRequiredEvp_bytestokey=1;var on=requireSafeBuffer$1().Buffer,In=requireMd5_js();function Rn(Mn,Ln,Hn,jn){if(on.isBuffer(Mn)||(Mn=on.from(Mn,"binary")),Ln&&(on.isBuffer(Ln)||(Ln=on.from(Ln,"binary")),Ln.length!==8))throw new RangeError("salt should be Buffer with 8 byte length");for(var Wn=Hn/8,Yn=on.alloc(Wn),hi=on.alloc(jn||0),vi=on.alloc(0);Wn>0||jn>0;){var gi=new In;gi.update(vi),gi.update(Mn),Ln&&gi.update(Ln),vi=gi.digest();var mi=0;if(Wn>0){var yi=Yn.length-Wn;mi=Math.min(Wn,vi.length),vi.copy(Yn,yi,0,mi),Wn-=mi}if(mi<vi.length&&jn>0){var bi=hi.length-jn,Ei=Math.min(jn,vi.length-mi);vi.copy(hi,bi,mi,mi+Ei),jn-=Ei}}return vi.fill(0),{key:Yn,iv:hi}}return evp_bytestokey=Rn,evp_bytestokey}var hasRequiredEncrypter;function requireEncrypter(){if(hasRequiredEncrypter)return encrypter;hasRequiredEncrypter=1;var on=requireModes$1(),In=requireAuthCipher(),Rn=requireSafeBuffer$1().Buffer,Mn=requireStreamCipher(),Ln=requireCipherBase(),Hn=requireAes$1(),jn=requireEvp_bytestokey(),Wn=requireInherits_browser();function Yn(yi,bi,Ei){Ln.call(this),this._cache=new vi,this._cipher=new Hn.AES(bi),this._prev=Rn.from(Ei),this._mode=yi,this._autopadding=!0}Wn(Yn,Ln),Yn.prototype._update=function(yi){this._cache.add(yi);for(var bi,Ei,_i=[];bi=this._cache.get();)Ei=this._mode.encrypt(this,bi),_i.push(Ei);return Rn.concat(_i)};var hi=Rn.alloc(16,16);Yn.prototype._final=function(){var yi=this._cache.flush();if(this._autopadding)return yi=this._mode.encrypt(this,yi),this._cipher.scrub(),yi;if(!yi.equals(hi))throw this._cipher.scrub(),new Error("data not multiple of block length")},Yn.prototype.setAutoPadding=function(yi){return this._autopadding=!!yi,this};function vi(){this.cache=Rn.allocUnsafe(0)}vi.prototype.add=function(yi){this.cache=Rn.concat([this.cache,yi])},vi.prototype.get=function(){if(this.cache.length>15){var yi=this.cache.slice(0,16);return this.cache=this.cache.slice(16),yi}return null},vi.prototype.flush=function(){for(var yi=16-this.cache.length,bi=Rn.allocUnsafe(yi),Ei=-1;++Ei<yi;)bi.writeUInt8(yi,Ei);return Rn.concat([this.cache,bi])};function gi(yi,bi,Ei){var _i=on[yi.toLowerCase()];if(!_i)throw new TypeError("invalid suite type");if(typeof bi=="string"&&(bi=Rn.from(bi)),bi.length!==_i.key/8)throw new TypeError("invalid key length "+bi.length);if(typeof Ei=="string"&&(Ei=Rn.from(Ei)),_i.mode!=="GCM"&&Ei.length!==_i.iv)throw new TypeError("invalid iv length "+Ei.length);return _i.type==="stream"?new Mn(_i.module,bi,Ei):_i.type==="auth"?new In(_i.module,bi,Ei):new Yn(_i.module,bi,Ei)}function mi(yi,bi){var Ei=on[yi.toLowerCase()];if(!Ei)throw new TypeError("invalid suite type");var _i=jn(bi,!1,Ei.key,Ei.iv);return gi(yi,_i.key,_i.iv)}return encrypter.createCipheriv=gi,encrypter.createCipher=mi,encrypter}var decrypter={},hasRequiredDecrypter;function requireDecrypter(){if(hasRequiredDecrypter)return decrypter;hasRequiredDecrypter=1;var on=requireAuthCipher(),In=requireSafeBuffer$1().Buffer,Rn=requireModes$1(),Mn=requireStreamCipher(),Ln=requireCipherBase(),Hn=requireAes$1(),jn=requireEvp_bytestokey(),Wn=requireInherits_browser();function Yn(yi,bi,Ei){Ln.call(this),this._cache=new hi,this._last=void 0,this._cipher=new Hn.AES(bi),this._prev=In.from(Ei),this._mode=yi,this._autopadding=!0}Wn(Yn,Ln),Yn.prototype._update=function(yi){this._cache.add(yi);for(var bi,Ei,_i=[];bi=this._cache.get(this._autopadding);)Ei=this._mode.decrypt(this,bi),_i.push(Ei);return In.concat(_i)},Yn.prototype._final=function(){var yi=this._cache.flush();if(this._autopadding)return vi(this._mode.decrypt(this,yi));if(yi)throw new Error("data not multiple of block length")},Yn.prototype.setAutoPadding=function(yi){return this._autopadding=!!yi,this};function hi(){this.cache=In.allocUnsafe(0)}hi.prototype.add=function(yi){this.cache=In.concat([this.cache,yi])},hi.prototype.get=function(yi){var bi;if(yi){if(this.cache.length>16)return bi=this.cache.slice(0,16),this.cache=this.cache.slice(16),bi}else if(this.cache.length>=16)return bi=this.cache.slice(0,16),this.cache=this.cache.slice(16),bi;return null},hi.prototype.flush=function(){if(this.cache.length)return this.cache};function vi(yi){var bi=yi[15];if(bi<1||bi>16)throw new Error("unable to decrypt data");for(var Ei=-1;++Ei<bi;)if(yi[Ei+(16-bi)]!==bi)throw new Error("unable to decrypt data");if(bi!==16)return yi.slice(0,16-bi)}function gi(yi,bi,Ei){var _i=Rn[yi.toLowerCase()];if(!_i)throw new TypeError("invalid suite type");if(typeof Ei=="string"&&(Ei=In.from(Ei)),_i.mode!=="GCM"&&Ei.length!==_i.iv)throw new TypeError("invalid iv length "+Ei.length);if(typeof bi=="string"&&(bi=In.from(bi)),bi.length!==_i.key/8)throw new TypeError("invalid key length "+bi.length);return _i.type==="stream"?new Mn(_i.module,bi,Ei,!0):_i.type==="auth"?new on(_i.module,bi,Ei,!0):new Yn(_i.module,bi,Ei)}function mi(yi,bi){var Ei=Rn[yi.toLowerCase()];if(!Ei)throw new TypeError("invalid suite type");var _i=jn(bi,!1,Ei.key,Ei.iv);return gi(yi,_i.key,_i.iv)}return decrypter.createDecipher=mi,decrypter.createDecipheriv=gi,decrypter}var hasRequiredBrowser$7;function requireBrowser$7(){if(hasRequiredBrowser$7)return browser$6;hasRequiredBrowser$7=1;var on=requireEncrypter(),In=requireDecrypter(),Rn=require$$2;function Mn(){return Object.keys(Rn)}return browser$6.createCipher=browser$6.Cipher=on.createCipher,browser$6.createCipheriv=browser$6.Cipheriv=on.createCipheriv,browser$6.createDecipher=browser$6.Decipher=In.createDecipher,browser$6.createDecipheriv=browser$6.Decipheriv=In.createDecipheriv,browser$6.listCiphers=browser$6.getCiphers=Mn,browser$6}var modes={},hasRequiredModes;function requireModes(){return hasRequiredModes||(hasRequiredModes=1,function(on){on["des-ecb"]={key:8,iv:0},on["des-cbc"]=on.des={key:8,iv:8},on["des-ede3-cbc"]=on.des3={key:24,iv:8},on["des-ede3"]={key:24,iv:0},on["des-ede-cbc"]={key:16,iv:8},on["des-ede"]={key:16,iv:0}}(modes)),modes}var hasRequiredBrowser$6;function requireBrowser$6(){if(hasRequiredBrowser$6)return browser$7;hasRequiredBrowser$6=1;var on=requireBrowserifyDes(),In=requireBrowser$7(),Rn=requireModes$1(),Mn=requireModes(),Ln=requireEvp_bytestokey();function Hn(vi,gi){vi=vi.toLowerCase();var mi,yi;if(Rn[vi])mi=Rn[vi].key,yi=Rn[vi].iv;else if(Mn[vi])mi=Mn[vi].key*8,yi=Mn[vi].iv;else throw new TypeError("invalid suite type");var bi=Ln(gi,!1,mi,yi);return Wn(vi,bi.key,bi.iv)}function jn(vi,gi){vi=vi.toLowerCase();var mi,yi;if(Rn[vi])mi=Rn[vi].key,yi=Rn[vi].iv;else if(Mn[vi])mi=Mn[vi].key*8,yi=Mn[vi].iv;else throw new TypeError("invalid suite type");var bi=Ln(gi,!1,mi,yi);return Yn(vi,bi.key,bi.iv)}function Wn(vi,gi,mi){if(vi=vi.toLowerCase(),Rn[vi])return In.createCipheriv(vi,gi,mi);if(Mn[vi])return new on({key:gi,iv:mi,mode:vi});throw new TypeError("invalid suite type")}function Yn(vi,gi,mi){if(vi=vi.toLowerCase(),Rn[vi])return In.createDecipheriv(vi,gi,mi);if(Mn[vi])return new on({key:gi,iv:mi,mode:vi,decrypt:!0});throw new TypeError("invalid suite type")}function hi(){return Object.keys(Mn).concat(In.getCiphers())}return browser$7.createCipher=browser$7.Cipher=Hn,browser$7.createCipheriv=browser$7.Cipheriv=Wn,browser$7.createDecipher=browser$7.Decipher=jn,browser$7.createDecipheriv=browser$7.Decipheriv=Yn,browser$7.listCiphers=browser$7.getCiphers=hi,browser$7}var browser$5={},bn$5={exports:{}},bn$4=bn$5.exports,hasRequiredBn$2;function requireBn$2(){return hasRequiredBn$2||(hasRequiredBn$2=1,function(on){(function(In,Rn){function Mn(zi,Mi){if(!zi)throw new Error(Mi||"Assertion failed")}function Ln(zi,Mi){zi.super_=Mi;var Li=function(){};Li.prototype=Mi.prototype,zi.prototype=new Li,zi.prototype.constructor=zi}function Hn(zi,Mi,Li){if(Hn.isBN(zi))return zi;this.negative=0,this.words=null,this.length=0,this.red=null,zi!==null&&((Mi==="le"||Mi==="be")&&(Li=Mi,Mi=10),this._init(zi||0,Mi||10,Li||"be"))}typeof In=="object"?In.exports=Hn:Rn.BN=Hn,Hn.BN=Hn,Hn.wordSize=26;var jn;try{typeof window<"u"&&typeof window.Buffer<"u"?jn=window.Buffer:jn=requireDist().Buffer}catch{}Hn.isBN=function(Mi){return Mi instanceof Hn?!0:Mi!==null&&typeof Mi=="object"&&Mi.constructor.wordSize===Hn.wordSize&&Array.isArray(Mi.words)},Hn.max=function(Mi,Li){return Mi.cmp(Li)>0?Mi:Li},Hn.min=function(Mi,Li){return Mi.cmp(Li)<0?Mi:Li},Hn.prototype._init=function(Mi,Li,wi){if(typeof Mi=="number")return this._initNumber(Mi,Li,wi);if(typeof Mi=="object")return this._initArray(Mi,Li,wi);Li==="hex"&&(Li=16),Mn(Li===(Li|0)&&Li>=2&&Li<=36),Mi=Mi.toString().replace(/\s+/g,"");var Ri=0;Mi[0]==="-"&&(Ri++,this.negative=1),Ri<Mi.length&&(Li===16?this._parseHex(Mi,Ri,wi):(this._parseBase(Mi,Li,Ri),wi==="le"&&this._initArray(this.toArray(),Li,wi)))},Hn.prototype._initNumber=function(Mi,Li,wi){Mi<0&&(this.negative=1,Mi=-Mi),Mi<67108864?(this.words=[Mi&67108863],this.length=1):Mi<4503599627370496?(this.words=[Mi&67108863,Mi/67108864&67108863],this.length=2):(Mn(Mi<9007199254740992),this.words=[Mi&67108863,Mi/67108864&67108863,1],this.length=3),wi==="le"&&this._initArray(this.toArray(),Li,wi)},Hn.prototype._initArray=function(Mi,Li,wi){if(Mn(typeof Mi.length=="number"),Mi.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(Mi.length/3),this.words=new Array(this.length);for(var Ri=0;Ri<this.length;Ri++)this.words[Ri]=0;var ki,Bi,Hi=0;if(wi==="be")for(Ri=Mi.length-1,ki=0;Ri>=0;Ri-=3)Bi=Mi[Ri]|Mi[Ri-1]<<8|Mi[Ri-2]<<16,this.words[ki]|=Bi<<Hi&67108863,this.words[ki+1]=Bi>>>26-Hi&67108863,Hi+=24,Hi>=26&&(Hi-=26,ki++);else if(wi==="le")for(Ri=0,ki=0;Ri<Mi.length;Ri+=3)Bi=Mi[Ri]|Mi[Ri+1]<<8|Mi[Ri+2]<<16,this.words[ki]|=Bi<<Hi&67108863,this.words[ki+1]=Bi>>>26-Hi&67108863,Hi+=24,Hi>=26&&(Hi-=26,ki++);return this.strip()};function Wn(zi,Mi){var Li=zi.charCodeAt(Mi);return Li>=65&&Li<=70?Li-55:Li>=97&&Li<=102?Li-87:Li-48&15}function Yn(zi,Mi,Li){var wi=Wn(zi,Li);return Li-1>=Mi&&(wi|=Wn(zi,Li-1)<<4),wi}Hn.prototype._parseHex=function(Mi,Li,wi){this.length=Math.ceil((Mi.length-Li)/6),this.words=new Array(this.length);for(var Ri=0;Ri<this.length;Ri++)this.words[Ri]=0;var ki=0,Bi=0,Hi;if(wi==="be")for(Ri=Mi.length-1;Ri>=Li;Ri-=2)Hi=Yn(Mi,Li,Ri)<<ki,this.words[Bi]|=Hi&67108863,ki>=18?(ki-=18,Bi+=1,this.words[Bi]|=Hi>>>26):ki+=8;else{var Ki=Mi.length-Li;for(Ri=Ki%2===0?Li+1:Li;Ri<Mi.length;Ri+=2)Hi=Yn(Mi,Li,Ri)<<ki,this.words[Bi]|=Hi&67108863,ki>=18?(ki-=18,Bi+=1,this.words[Bi]|=Hi>>>26):ki+=8}this.strip()};function hi(zi,Mi,Li,wi){for(var Ri=0,ki=Math.min(zi.length,Li),Bi=Mi;Bi<ki;Bi++){var Hi=zi.charCodeAt(Bi)-48;Ri*=wi,Hi>=49?Ri+=Hi-49+10:Hi>=17?Ri+=Hi-17+10:Ri+=Hi}return Ri}Hn.prototype._parseBase=function(Mi,Li,wi){this.words=[0],this.length=1;for(var Ri=0,ki=1;ki<=67108863;ki*=Li)Ri++;Ri--,ki=ki/Li|0;for(var Bi=Mi.length-wi,Hi=Bi%Ri,Ki=Math.min(Bi,Bi-Hi)+wi,ji=0,Fi=wi;Fi<Ki;Fi+=Ri)ji=hi(Mi,Fi,Fi+Ri,Li),this.imuln(ki),this.words[0]+ji<67108864?this.words[0]+=ji:this._iaddn(ji);if(Hi!==0){var $i=1;for(ji=hi(Mi,Fi,Mi.length,Li),Fi=0;Fi<Hi;Fi++)$i*=Li;this.imuln($i),this.words[0]+ji<67108864?this.words[0]+=ji:this._iaddn(ji)}this.strip()},Hn.prototype.copy=function(Mi){Mi.words=new Array(this.length);for(var Li=0;Li<this.length;Li++)Mi.words[Li]=this.words[Li];Mi.length=this.length,Mi.negative=this.negative,Mi.red=this.red},Hn.prototype.clone=function(){var Mi=new Hn(null);return this.copy(Mi),Mi},Hn.prototype._expand=function(Mi){for(;this.length<Mi;)this.words[this.length++]=0;return this},Hn.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},Hn.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},Hn.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var vi=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],gi=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],mi=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];Hn.prototype.toString=function(Mi,Li){Mi=Mi||10,Li=Li|0||1;var wi;if(Mi===16||Mi==="hex"){wi="";for(var Ri=0,ki=0,Bi=0;Bi<this.length;Bi++){var Hi=this.words[Bi],Ki=((Hi<<Ri|ki)&16777215).toString(16);ki=Hi>>>24-Ri&16777215,Ri+=2,Ri>=26&&(Ri-=26,Bi--),ki!==0||Bi!==this.length-1?wi=vi[6-Ki.length]+Ki+wi:wi=Ki+wi}for(ki!==0&&(wi=ki.toString(16)+wi);wi.length%Li!==0;)wi="0"+wi;return this.negative!==0&&(wi="-"+wi),wi}if(Mi===(Mi|0)&&Mi>=2&&Mi<=36){var ji=gi[Mi],Fi=mi[Mi];wi="";var $i=this.clone();for($i.negative=0;!$i.isZero();){var Wi=$i.modn(Fi).toString(Mi);$i=$i.idivn(Fi),$i.isZero()?wi=Wi+wi:wi=vi[ji-Wi.length]+Wi+wi}for(this.isZero()&&(wi="0"+wi);wi.length%Li!==0;)wi="0"+wi;return this.negative!==0&&(wi="-"+wi),wi}Mn(!1,"Base should be between 2 and 36")},Hn.prototype.toNumber=function(){var Mi=this.words[0];return this.length===2?Mi+=this.words[1]*67108864:this.length===3&&this.words[2]===1?Mi+=4503599627370496+this.words[1]*67108864:this.length>2&&Mn(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-Mi:Mi},Hn.prototype.toJSON=function(){return this.toString(16)},Hn.prototype.toBuffer=function(Mi,Li){return Mn(typeof jn<"u"),this.toArrayLike(jn,Mi,Li)},Hn.prototype.toArray=function(Mi,Li){return this.toArrayLike(Array,Mi,Li)},Hn.prototype.toArrayLike=function(Mi,Li,wi){var Ri=this.byteLength(),ki=wi||Math.max(1,Ri);Mn(Ri<=ki,"byte array longer than desired length"),Mn(ki>0,"Requested array length <= 0"),this.strip();var Bi=Li==="le",Hi=new Mi(ki),Ki,ji,Fi=this.clone();if(Bi){for(ji=0;!Fi.isZero();ji++)Ki=Fi.andln(255),Fi.iushrn(8),Hi[ji]=Ki;for(;ji<ki;ji++)Hi[ji]=0}else{for(ji=0;ji<ki-Ri;ji++)Hi[ji]=0;for(ji=0;!Fi.isZero();ji++)Ki=Fi.andln(255),Fi.iushrn(8),Hi[ki-ji-1]=Ki}return Hi},Math.clz32?Hn.prototype._countBits=function(Mi){return 32-Math.clz32(Mi)}:Hn.prototype._countBits=function(Mi){var Li=Mi,wi=0;return Li>=4096&&(wi+=13,Li>>>=13),Li>=64&&(wi+=7,Li>>>=7),Li>=8&&(wi+=4,Li>>>=4),Li>=2&&(wi+=2,Li>>>=2),wi+Li},Hn.prototype._zeroBits=function(Mi){if(Mi===0)return 26;var Li=Mi,wi=0;return(Li&8191)===0&&(wi+=13,Li>>>=13),(Li&127)===0&&(wi+=7,Li>>>=7),(Li&15)===0&&(wi+=4,Li>>>=4),(Li&3)===0&&(wi+=2,Li>>>=2),(Li&1)===0&&wi++,wi},Hn.prototype.bitLength=function(){var Mi=this.words[this.length-1],Li=this._countBits(Mi);return(this.length-1)*26+Li};function yi(zi){for(var Mi=new Array(zi.bitLength()),Li=0;Li<Mi.length;Li++){var wi=Li/26|0,Ri=Li%26;Mi[Li]=(zi.words[wi]&1<<Ri)>>>Ri}return Mi}Hn.prototype.zeroBits=function(){if(this.isZero())return 0;for(var Mi=0,Li=0;Li<this.length;Li++){var wi=this._zeroBits(this.words[Li]);if(Mi+=wi,wi!==26)break}return Mi},Hn.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},Hn.prototype.toTwos=function(Mi){return this.negative!==0?this.abs().inotn(Mi).iaddn(1):this.clone()},Hn.prototype.fromTwos=function(Mi){return this.testn(Mi-1)?this.notn(Mi).iaddn(1).ineg():this.clone()},Hn.prototype.isNeg=function(){return this.negative!==0},Hn.prototype.neg=function(){return this.clone().ineg()},Hn.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},Hn.prototype.iuor=function(Mi){for(;this.length<Mi.length;)this.words[this.length++]=0;for(var Li=0;Li<Mi.length;Li++)this.words[Li]=this.words[Li]|Mi.words[Li];return this.strip()},Hn.prototype.ior=function(Mi){return Mn((this.negative|Mi.negative)===0),this.iuor(Mi)},Hn.prototype.or=function(Mi){return this.length>Mi.length?this.clone().ior(Mi):Mi.clone().ior(this)},Hn.prototype.uor=function(Mi){return this.length>Mi.length?this.clone().iuor(Mi):Mi.clone().iuor(this)},Hn.prototype.iuand=function(Mi){var Li;this.length>Mi.length?Li=Mi:Li=this;for(var wi=0;wi<Li.length;wi++)this.words[wi]=this.words[wi]&Mi.words[wi];return this.length=Li.length,this.strip()},Hn.prototype.iand=function(Mi){return Mn((this.negative|Mi.negative)===0),this.iuand(Mi)},Hn.prototype.and=function(Mi){return this.length>Mi.length?this.clone().iand(Mi):Mi.clone().iand(this)},Hn.prototype.uand=function(Mi){return this.length>Mi.length?this.clone().iuand(Mi):Mi.clone().iuand(this)},Hn.prototype.iuxor=function(Mi){var Li,wi;this.length>Mi.length?(Li=this,wi=Mi):(Li=Mi,wi=this);for(var Ri=0;Ri<wi.length;Ri++)this.words[Ri]=Li.words[Ri]^wi.words[Ri];if(this!==Li)for(;Ri<Li.length;Ri++)this.words[Ri]=Li.words[Ri];return this.length=Li.length,this.strip()},Hn.prototype.ixor=function(Mi){return Mn((this.negative|Mi.negative)===0),this.iuxor(Mi)},Hn.prototype.xor=function(Mi){return this.length>Mi.length?this.clone().ixor(Mi):Mi.clone().ixor(this)},Hn.prototype.uxor=function(Mi){return this.length>Mi.length?this.clone().iuxor(Mi):Mi.clone().iuxor(this)},Hn.prototype.inotn=function(Mi){Mn(typeof Mi=="number"&&Mi>=0);var Li=Math.ceil(Mi/26)|0,wi=Mi%26;this._expand(Li),wi>0&&Li--;for(var Ri=0;Ri<Li;Ri++)this.words[Ri]=~this.words[Ri]&67108863;return wi>0&&(this.words[Ri]=~this.words[Ri]&67108863>>26-wi),this.strip()},Hn.prototype.notn=function(Mi){return this.clone().inotn(Mi)},Hn.prototype.setn=function(Mi,Li){Mn(typeof Mi=="number"&&Mi>=0);var wi=Mi/26|0,Ri=Mi%26;return this._expand(wi+1),Li?this.words[wi]=this.words[wi]|1<<Ri:this.words[wi]=this.words[wi]&~(1<<Ri),this.strip()},Hn.prototype.iadd=function(Mi){var Li;if(this.negative!==0&&Mi.negative===0)return this.negative=0,Li=this.isub(Mi),this.negative^=1,this._normSign();if(this.negative===0&&Mi.negative!==0)return Mi.negative=0,Li=this.isub(Mi),Mi.negative=1,Li._normSign();var wi,Ri;this.length>Mi.length?(wi=this,Ri=Mi):(wi=Mi,Ri=this);for(var ki=0,Bi=0;Bi<Ri.length;Bi++)Li=(wi.words[Bi]|0)+(Ri.words[Bi]|0)+ki,this.words[Bi]=Li&67108863,ki=Li>>>26;for(;ki!==0&&Bi<wi.length;Bi++)Li=(wi.words[Bi]|0)+ki,this.words[Bi]=Li&67108863,ki=Li>>>26;if(this.length=wi.length,ki!==0)this.words[this.length]=ki,this.length++;else if(wi!==this)for(;Bi<wi.length;Bi++)this.words[Bi]=wi.words[Bi];return this},Hn.prototype.add=function(Mi){var Li;return Mi.negative!==0&&this.negative===0?(Mi.negative=0,Li=this.sub(Mi),Mi.negative^=1,Li):Mi.negative===0&&this.negative!==0?(this.negative=0,Li=Mi.sub(this),this.negative=1,Li):this.length>Mi.length?this.clone().iadd(Mi):Mi.clone().iadd(this)},Hn.prototype.isub=function(Mi){if(Mi.negative!==0){Mi.negative=0;var Li=this.iadd(Mi);return Mi.negative=1,Li._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(Mi),this.negative=1,this._normSign();var wi=this.cmp(Mi);if(wi===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Ri,ki;wi>0?(Ri=this,ki=Mi):(Ri=Mi,ki=this);for(var Bi=0,Hi=0;Hi<ki.length;Hi++)Li=(Ri.words[Hi]|0)-(ki.words[Hi]|0)+Bi,Bi=Li>>26,this.words[Hi]=Li&67108863;for(;Bi!==0&&Hi<Ri.length;Hi++)Li=(Ri.words[Hi]|0)+Bi,Bi=Li>>26,this.words[Hi]=Li&67108863;if(Bi===0&&Hi<Ri.length&&Ri!==this)for(;Hi<Ri.length;Hi++)this.words[Hi]=Ri.words[Hi];return this.length=Math.max(this.length,Hi),Ri!==this&&(this.negative=1),this.strip()},Hn.prototype.sub=function(Mi){return this.clone().isub(Mi)};function bi(zi,Mi,Li){Li.negative=Mi.negative^zi.negative;var wi=zi.length+Mi.length|0;Li.length=wi,wi=wi-1|0;var Ri=zi.words[0]|0,ki=Mi.words[0]|0,Bi=Ri*ki,Hi=Bi&67108863,Ki=Bi/67108864|0;Li.words[0]=Hi;for(var ji=1;ji<wi;ji++){for(var Fi=Ki>>>26,$i=Ki&67108863,Wi=Math.min(ji,Mi.length-1),Qi=Math.max(0,ji-zi.length+1);Qi<=Wi;Qi++){var ea=ji-Qi|0;Ri=zi.words[ea]|0,ki=Mi.words[Qi]|0,Bi=Ri*ki+$i,Fi+=Bi/67108864|0,$i=Bi&67108863}Li.words[ji]=$i|0,Ki=Fi|0}return Ki!==0?Li.words[ji]=Ki|0:Li.length--,Li.strip()}var Ei=function(Mi,Li,wi){var Ri=Mi.words,ki=Li.words,Bi=wi.words,Hi=0,Ki,ji,Fi,$i=Ri[0]|0,Wi=$i&8191,Qi=$i>>>13,ea=Ri[1]|0,na=ea&8191,Ji=ea>>>13,ra=Ri[2]|0,sa=ra&8191,la=ra>>>13,aa=Ri[3]|0,ta=aa&8191,fa=aa>>>13,ca=Ri[4]|0,pa=ca&8191,Ea=ca>>>13,xa=Ri[5]|0,ga=xa&8191,ma=xa>>>13,Aa=Ri[6]|0,va=Aa&8191,Sa=Aa>>>13,Ta=Ri[7]|0,wa=Ta&8191,Na=Ta>>>13,$a=Ri[8]|0,Ma=$a&8191,Ka=$a>>>13,Ga=Ri[9]|0,Ha=Ga&8191,Ua=Ga>>>13,vo=ki[0]|0,Ja=vo&8191,bo=vo>>>13,es=ki[1]|0,Ya=es&8191,Xa=es>>>13,To=ki[2]|0,Wa=To&8191,ls=To>>>13,ns=ki[3]|0,Co=ns&8191,cs=ns>>>13,os=ki[4]|0,So=os&8191,us=os>>>13,Oo=ki[5]|0,da=Oo&8191,ia=Oo>>>13,oa=ki[6]|0,ha=oa&8191,Ca=oa>>>13,Ia=ki[7]|0,Da=Ia&8191,rs=Ia>>>13,as=ki[8]|0,No=as&8191,ss=as>>>13,Za=ki[9]|0,zo=Za&8191,Ss=Za>>>13;wi.negative=Mi.negative^Li.negative,wi.length=19,Ki=Math.imul(Wi,Ja),ji=Math.imul(Wi,bo),ji=ji+Math.imul(Qi,Ja)|0,Fi=Math.imul(Qi,bo);var vs=(Hi+Ki|0)+((ji&8191)<<13)|0;Hi=(Fi+(ji>>>13)|0)+(vs>>>26)|0,vs&=67108863,Ki=Math.imul(na,Ja),ji=Math.imul(na,bo),ji=ji+Math.imul(Ji,Ja)|0,Fi=Math.imul(Ji,bo),Ki=Ki+Math.imul(Wi,Ya)|0,ji=ji+Math.imul(Wi,Xa)|0,ji=ji+Math.imul(Qi,Ya)|0,Fi=Fi+Math.imul(Qi,Xa)|0;var gs=(Hi+Ki|0)+((ji&8191)<<13)|0;Hi=(Fi+(ji>>>13)|0)+(gs>>>26)|0,gs&=67108863,Ki=Math.imul(sa,Ja),ji=Math.imul(sa,bo),ji=ji+Math.imul(la,Ja)|0,Fi=Math.imul(la,bo),Ki=Ki+Math.imul(na,Ya)|0,ji=ji+Math.imul(na,Xa)|0,ji=ji+Math.imul(Ji,Ya)|0,Fi=Fi+Math.imul(Ji,Xa)|0,Ki=Ki+Math.imul(Wi,Wa)|0,ji=ji+Math.imul(Wi,ls)|0,ji=ji+Math.imul(Qi,Wa)|0,Fi=Fi+Math.imul(Qi,ls)|0;var Xs=(Hi+Ki|0)+((ji&8191)<<13)|0;Hi=(Fi+(ji>>>13)|0)+(Xs>>>26)|0,Xs&=67108863,Ki=Math.imul(ta,Ja),ji=Math.imul(ta,bo),ji=ji+Math.imul(fa,Ja)|0,Fi=Math.imul(fa,bo),Ki=Ki+Math.imul(sa,Ya)|0,ji=ji+Math.imul(sa,Xa)|0,ji=ji+Math.imul(la,Ya)|0,Fi=Fi+Math.imul(la,Xa)|0,Ki=Ki+Math.imul(na,Wa)|0,ji=ji+Math.imul(na,ls)|0,ji=ji+Math.imul(Ji,Wa)|0,Fi=Fi+Math.imul(Ji,ls)|0,Ki=Ki+Math.imul(Wi,Co)|0,ji=ji+Math.imul(Wi,cs)|0,ji=ji+Math.imul(Qi,Co)|0,Fi=Fi+Math.imul(Qi,cs)|0;var La=(Hi+Ki|0)+((ji&8191)<<13)|0;Hi=(Fi+(ji>>>13)|0)+(La>>>26)|0,La&=67108863,Ki=Math.imul(pa,Ja),ji=Math.imul(pa,bo),ji=ji+Math.imul(Ea,Ja)|0,Fi=Math.imul(Ea,bo),Ki=Ki+Math.imul(ta,Ya)|0,ji=ji+Math.imul(ta,Xa)|0,ji=ji+Math.imul(fa,Ya)|0,Fi=Fi+Math.imul(fa,Xa)|0,Ki=Ki+Math.imul(sa,Wa)|0,ji=ji+Math.imul(sa,ls)|0,ji=ji+Math.imul(la,Wa)|0,Fi=Fi+Math.imul(la,ls)|0,Ki=Ki+Math.imul(na,Co)|0,ji=ji+Math.imul(na,cs)|0,ji=ji+Math.imul(Ji,Co)|0,Fi=Fi+Math.imul(Ji,cs)|0,Ki=Ki+Math.imul(Wi,So)|0,ji=ji+Math.imul(Wi,us)|0,ji=ji+Math.imul(Qi,So)|0,Fi=Fi+Math.imul(Qi,us)|0;var ba=(Hi+Ki|0)+((ji&8191)<<13)|0;Hi=(Fi+(ji>>>13)|0)+(ba>>>26)|0,ba&=67108863,Ki=Math.imul(ga,Ja),ji=Math.imul(ga,bo),ji=ji+Math.imul(ma,Ja)|0,Fi=Math.imul(ma,bo),Ki=Ki+Math.imul(pa,Ya)|0,ji=ji+Math.imul(pa,Xa)|0,ji=ji+Math.imul(Ea,Ya)|0,Fi=Fi+Math.imul(Ea,Xa)|0,Ki=Ki+Math.imul(ta,Wa)|0,ji=ji+Math.imul(ta,ls)|0,ji=ji+Math.imul(fa,Wa)|0,Fi=Fi+Math.imul(fa,ls)|0,Ki=Ki+Math.imul(sa,Co)|0,ji=ji+Math.imul(sa,cs)|0,ji=ji+Math.imul(la,Co)|0,Fi=Fi+Math.imul(la,cs)|0,Ki=Ki+Math.imul(na,So)|0,ji=ji+Math.imul(na,us)|0,ji=ji+Math.imul(Ji,So)|0,Fi=Fi+Math.imul(Ji,us)|0,Ki=Ki+Math.imul(Wi,da)|0,ji=ji+Math.imul(Wi,ia)|0,ji=ji+Math.imul(Qi,da)|0,Fi=Fi+Math.imul(Qi,ia)|0;var ka=(Hi+Ki|0)+((ji&8191)<<13)|0;Hi=(Fi+(ji>>>13)|0)+(ka>>>26)|0,ka&=67108863,Ki=Math.imul(va,Ja),ji=Math.imul(va,bo),ji=ji+Math.imul(Sa,Ja)|0,Fi=Math.imul(Sa,bo),Ki=Ki+Math.imul(ga,Ya)|0,ji=ji+Math.imul(ga,Xa)|0,ji=ji+Math.imul(ma,Ya)|0,Fi=Fi+Math.imul(ma,Xa)|0,Ki=Ki+Math.imul(pa,Wa)|0,ji=ji+Math.imul(pa,ls)|0,ji=ji+Math.imul(Ea,Wa)|0,Fi=Fi+Math.imul(Ea,ls)|0,Ki=Ki+Math.imul(ta,Co)|0,ji=ji+Math.imul(ta,cs)|0,ji=ji+Math.imul(fa,Co)|0,Fi=Fi+Math.imul(fa,cs)|0,Ki=Ki+Math.imul(sa,So)|0,ji=ji+Math.imul(sa,us)|0,ji=ji+Math.imul(la,So)|0,Fi=Fi+Math.imul(la,us)|0,Ki=Ki+Math.imul(na,da)|0,ji=ji+Math.imul(na,ia)|0,ji=ji+Math.imul(Ji,da)|0,Fi=Fi+Math.imul(Ji,ia)|0,Ki=Ki+Math.imul(Wi,ha)|0,ji=ji+Math.imul(Wi,Ca)|0,ji=ji+Math.imul(Qi,ha)|0,Fi=Fi+Math.imul(Qi,Ca)|0;var ja=(Hi+Ki|0)+((ji&8191)<<13)|0;Hi=(Fi+(ji>>>13)|0)+(ja>>>26)|0,ja&=67108863,Ki=Math.imul(wa,Ja),ji=Math.imul(wa,bo),ji=ji+Math.imul(Na,Ja)|0,Fi=Math.imul(Na,bo),Ki=Ki+Math.imul(va,Ya)|0,ji=ji+Math.imul(va,Xa)|0,ji=ji+Math.imul(Sa,Ya)|0,Fi=Fi+Math.imul(Sa,Xa)|0,Ki=Ki+Math.imul(ga,Wa)|0,ji=ji+Math.imul(ga,ls)|0,ji=ji+Math.imul(ma,Wa)|0,Fi=Fi+Math.imul(ma,ls)|0,Ki=Ki+Math.imul(pa,Co)|0,ji=ji+Math.imul(pa,cs)|0,ji=ji+Math.imul(Ea,Co)|0,Fi=Fi+Math.imul(Ea,cs)|0,Ki=Ki+Math.imul(ta,So)|0,ji=ji+Math.imul(ta,us)|0,ji=ji+Math.imul(fa,So)|0,Fi=Fi+Math.imul(fa,us)|0,Ki=Ki+Math.imul(sa,da)|0,ji=ji+Math.imul(sa,ia)|0,ji=ji+Math.imul(la,da)|0,Fi=Fi+Math.imul(la,ia)|0,Ki=Ki+Math.imul(na,ha)|0,ji=ji+Math.imul(na,Ca)|0,ji=ji+Math.imul(Ji,ha)|0,Fi=Fi+Math.imul(Ji,Ca)|0,Ki=Ki+Math.imul(Wi,Da)|0,ji=ji+Math.imul(Wi,rs)|0,ji=ji+Math.imul(Qi,Da)|0,Fi=Fi+Math.imul(Qi,rs)|0;var ts=(Hi+Ki|0)+((ji&8191)<<13)|0;Hi=(Fi+(ji>>>13)|0)+(ts>>>26)|0,ts&=67108863,Ki=Math.imul(Ma,Ja),ji=Math.imul(Ma,bo),ji=ji+Math.imul(Ka,Ja)|0,Fi=Math.imul(Ka,bo),Ki=Ki+Math.imul(wa,Ya)|0,ji=ji+Math.imul(wa,Xa)|0,ji=ji+Math.imul(Na,Ya)|0,Fi=Fi+Math.imul(Na,Xa)|0,Ki=Ki+Math.imul(va,Wa)|0,ji=ji+Math.imul(va,ls)|0,ji=ji+Math.imul(Sa,Wa)|0,Fi=Fi+Math.imul(Sa,ls)|0,Ki=Ki+Math.imul(ga,Co)|0,ji=ji+Math.imul(ga,cs)|0,ji=ji+Math.imul(ma,Co)|0,Fi=Fi+Math.imul(ma,cs)|0,Ki=Ki+Math.imul(pa,So)|0,ji=ji+Math.imul(pa,us)|0,ji=ji+Math.imul(Ea,So)|0,Fi=Fi+Math.imul(Ea,us)|0,Ki=Ki+Math.imul(ta,da)|0,ji=ji+Math.imul(ta,ia)|0,ji=ji+Math.imul(fa,da)|0,Fi=Fi+Math.imul(fa,ia)|0,Ki=Ki+Math.imul(sa,ha)|0,ji=ji+Math.imul(sa,Ca)|0,ji=ji+Math.imul(la,ha)|0,Fi=Fi+Math.imul(la,Ca)|0,Ki=Ki+Math.imul(na,Da)|0,ji=ji+Math.imul(na,rs)|0,ji=ji+Math.imul(Ji,Da)|0,Fi=Fi+Math.imul(Ji,rs)|0,Ki=Ki+Math.imul(Wi,No)|0,ji=ji+Math.imul(Wi,ss)|0,ji=ji+Math.imul(Qi,No)|0,Fi=Fi+Math.imul(Qi,ss)|0;var ys=(Hi+Ki|0)+((ji&8191)<<13)|0;Hi=(Fi+(ji>>>13)|0)+(ys>>>26)|0,ys&=67108863,Ki=Math.imul(Ha,Ja),ji=Math.imul(Ha,bo),ji=ji+Math.imul(Ua,Ja)|0,Fi=Math.imul(Ua,bo),Ki=Ki+Math.imul(Ma,Ya)|0,ji=ji+Math.imul(Ma,Xa)|0,ji=ji+Math.imul(Ka,Ya)|0,Fi=Fi+Math.imul(Ka,Xa)|0,Ki=Ki+Math.imul(wa,Wa)|0,ji=ji+Math.imul(wa,ls)|0,ji=ji+Math.imul(Na,Wa)|0,Fi=Fi+Math.imul(Na,ls)|0,Ki=Ki+Math.imul(va,Co)|0,ji=ji+Math.imul(va,cs)|0,ji=ji+Math.imul(Sa,Co)|0,Fi=Fi+Math.imul(Sa,cs)|0,Ki=Ki+Math.imul(ga,So)|0,ji=ji+Math.imul(ga,us)|0,ji=ji+Math.imul(ma,So)|0,Fi=Fi+Math.imul(ma,us)|0,Ki=Ki+Math.imul(pa,da)|0,ji=ji+Math.imul(pa,ia)|0,ji=ji+Math.imul(Ea,da)|0,Fi=Fi+Math.imul(Ea,ia)|0,Ki=Ki+Math.imul(ta,ha)|0,ji=ji+Math.imul(ta,Ca)|0,ji=ji+Math.imul(fa,ha)|0,Fi=Fi+Math.imul(fa,Ca)|0,Ki=Ki+Math.imul(sa,Da)|0,ji=ji+Math.imul(sa,rs)|0,ji=ji+Math.imul(la,Da)|0,Fi=Fi+Math.imul(la,rs)|0,Ki=Ki+Math.imul(na,No)|0,ji=ji+Math.imul(na,ss)|0,ji=ji+Math.imul(Ji,No)|0,Fi=Fi+Math.imul(Ji,ss)|0,Ki=Ki+Math.imul(Wi,zo)|0,ji=ji+Math.imul(Wi,Ss)|0,ji=ji+Math.imul(Qi,zo)|0,Fi=Fi+Math.imul(Qi,Ss)|0;var ps=(Hi+Ki|0)+((ji&8191)<<13)|0;Hi=(Fi+(ji>>>13)|0)+(ps>>>26)|0,ps&=67108863,Ki=Math.imul(Ha,Ya),ji=Math.imul(Ha,Xa),ji=ji+Math.imul(Ua,Ya)|0,Fi=Math.imul(Ua,Xa),Ki=Ki+Math.imul(Ma,Wa)|0,ji=ji+Math.imul(Ma,ls)|0,ji=ji+Math.imul(Ka,Wa)|0,Fi=Fi+Math.imul(Ka,ls)|0,Ki=Ki+Math.imul(wa,Co)|0,ji=ji+Math.imul(wa,cs)|0,ji=ji+Math.imul(Na,Co)|0,Fi=Fi+Math.imul(Na,cs)|0,Ki=Ki+Math.imul(va,So)|0,ji=ji+Math.imul(va,us)|0,ji=ji+Math.imul(Sa,So)|0,Fi=Fi+Math.imul(Sa,us)|0,Ki=Ki+Math.imul(ga,da)|0,ji=ji+Math.imul(ga,ia)|0,ji=ji+Math.imul(ma,da)|0,Fi=Fi+Math.imul(ma,ia)|0,Ki=Ki+Math.imul(pa,ha)|0,ji=ji+Math.imul(pa,Ca)|0,ji=ji+Math.imul(Ea,ha)|0,Fi=Fi+Math.imul(Ea,Ca)|0,Ki=Ki+Math.imul(ta,Da)|0,ji=ji+Math.imul(ta,rs)|0,ji=ji+Math.imul(fa,Da)|0,Fi=Fi+Math.imul(fa,rs)|0,Ki=Ki+Math.imul(sa,No)|0,ji=ji+Math.imul(sa,ss)|0,ji=ji+Math.imul(la,No)|0,Fi=Fi+Math.imul(la,ss)|0,Ki=Ki+Math.imul(na,zo)|0,ji=ji+Math.imul(na,Ss)|0,ji=ji+Math.imul(Ji,zo)|0,Fi=Fi+Math.imul(Ji,Ss)|0;var hs=(Hi+Ki|0)+((ji&8191)<<13)|0;Hi=(Fi+(ji>>>13)|0)+(hs>>>26)|0,hs&=67108863,Ki=Math.imul(Ha,Wa),ji=Math.imul(Ha,ls),ji=ji+Math.imul(Ua,Wa)|0,Fi=Math.imul(Ua,ls),Ki=Ki+Math.imul(Ma,Co)|0,ji=ji+Math.imul(Ma,cs)|0,ji=ji+Math.imul(Ka,Co)|0,Fi=Fi+Math.imul(Ka,cs)|0,Ki=Ki+Math.imul(wa,So)|0,ji=ji+Math.imul(wa,us)|0,ji=ji+Math.imul(Na,So)|0,Fi=Fi+Math.imul(Na,us)|0,Ki=Ki+Math.imul(va,da)|0,ji=ji+Math.imul(va,ia)|0,ji=ji+Math.imul(Sa,da)|0,Fi=Fi+Math.imul(Sa,ia)|0,Ki=Ki+Math.imul(ga,ha)|0,ji=ji+Math.imul(ga,Ca)|0,ji=ji+Math.imul(ma,ha)|0,Fi=Fi+Math.imul(ma,Ca)|0,Ki=Ki+Math.imul(pa,Da)|0,ji=ji+Math.imul(pa,rs)|0,ji=ji+Math.imul(Ea,Da)|0,Fi=Fi+Math.imul(Ea,rs)|0,Ki=Ki+Math.imul(ta,No)|0,ji=ji+Math.imul(ta,ss)|0,ji=ji+Math.imul(fa,No)|0,Fi=Fi+Math.imul(fa,ss)|0,Ki=Ki+Math.imul(sa,zo)|0,ji=ji+Math.imul(sa,Ss)|0,ji=ji+Math.imul(la,zo)|0,Fi=Fi+Math.imul(la,Ss)|0;var Ls=(Hi+Ki|0)+((ji&8191)<<13)|0;Hi=(Fi+(ji>>>13)|0)+(Ls>>>26)|0,Ls&=67108863,Ki=Math.imul(Ha,Co),ji=Math.imul(Ha,cs),ji=ji+Math.imul(Ua,Co)|0,Fi=Math.imul(Ua,cs),Ki=Ki+Math.imul(Ma,So)|0,ji=ji+Math.imul(Ma,us)|0,ji=ji+Math.imul(Ka,So)|0,Fi=Fi+Math.imul(Ka,us)|0,Ki=Ki+Math.imul(wa,da)|0,ji=ji+Math.imul(wa,ia)|0,ji=ji+Math.imul(Na,da)|0,Fi=Fi+Math.imul(Na,ia)|0,Ki=Ki+Math.imul(va,ha)|0,ji=ji+Math.imul(va,Ca)|0,ji=ji+Math.imul(Sa,ha)|0,Fi=Fi+Math.imul(Sa,Ca)|0,Ki=Ki+Math.imul(ga,Da)|0,ji=ji+Math.imul(ga,rs)|0,ji=ji+Math.imul(ma,Da)|0,Fi=Fi+Math.imul(ma,rs)|0,Ki=Ki+Math.imul(pa,No)|0,ji=ji+Math.imul(pa,ss)|0,ji=ji+Math.imul(Ea,No)|0,Fi=Fi+Math.imul(Ea,ss)|0,Ki=Ki+Math.imul(ta,zo)|0,ji=ji+Math.imul(ta,Ss)|0,ji=ji+Math.imul(fa,zo)|0,Fi=Fi+Math.imul(fa,Ss)|0;var js=(Hi+Ki|0)+((ji&8191)<<13)|0;Hi=(Fi+(ji>>>13)|0)+(js>>>26)|0,js&=67108863,Ki=Math.imul(Ha,So),ji=Math.imul(Ha,us),ji=ji+Math.imul(Ua,So)|0,Fi=Math.imul(Ua,us),Ki=Ki+Math.imul(Ma,da)|0,ji=ji+Math.imul(Ma,ia)|0,ji=ji+Math.imul(Ka,da)|0,Fi=Fi+Math.imul(Ka,ia)|0,Ki=Ki+Math.imul(wa,ha)|0,ji=ji+Math.imul(wa,Ca)|0,ji=ji+Math.imul(Na,ha)|0,Fi=Fi+Math.imul(Na,Ca)|0,Ki=Ki+Math.imul(va,Da)|0,ji=ji+Math.imul(va,rs)|0,ji=ji+Math.imul(Sa,Da)|0,Fi=Fi+Math.imul(Sa,rs)|0,Ki=Ki+Math.imul(ga,No)|0,ji=ji+Math.imul(ga,ss)|0,ji=ji+Math.imul(ma,No)|0,Fi=Fi+Math.imul(ma,ss)|0,Ki=Ki+Math.imul(pa,zo)|0,ji=ji+Math.imul(pa,Ss)|0,ji=ji+Math.imul(Ea,zo)|0,Fi=Fi+Math.imul(Ea,Ss)|0;var Ts=(Hi+Ki|0)+((ji&8191)<<13)|0;Hi=(Fi+(ji>>>13)|0)+(Ts>>>26)|0,Ts&=67108863,Ki=Math.imul(Ha,da),ji=Math.imul(Ha,ia),ji=ji+Math.imul(Ua,da)|0,Fi=Math.imul(Ua,ia),Ki=Ki+Math.imul(Ma,ha)|0,ji=ji+Math.imul(Ma,Ca)|0,ji=ji+Math.imul(Ka,ha)|0,Fi=Fi+Math.imul(Ka,Ca)|0,Ki=Ki+Math.imul(wa,Da)|0,ji=ji+Math.imul(wa,rs)|0,ji=ji+Math.imul(Na,Da)|0,Fi=Fi+Math.imul(Na,rs)|0,Ki=Ki+Math.imul(va,No)|0,ji=ji+Math.imul(va,ss)|0,ji=ji+Math.imul(Sa,No)|0,Fi=Fi+Math.imul(Sa,ss)|0,Ki=Ki+Math.imul(ga,zo)|0,ji=ji+Math.imul(ga,Ss)|0,ji=ji+Math.imul(ma,zo)|0,Fi=Fi+Math.imul(ma,Ss)|0;var Us=(Hi+Ki|0)+((ji&8191)<<13)|0;Hi=(Fi+(ji>>>13)|0)+(Us>>>26)|0,Us&=67108863,Ki=Math.imul(Ha,ha),ji=Math.imul(Ha,Ca),ji=ji+Math.imul(Ua,ha)|0,Fi=Math.imul(Ua,Ca),Ki=Ki+Math.imul(Ma,Da)|0,ji=ji+Math.imul(Ma,rs)|0,ji=ji+Math.imul(Ka,Da)|0,Fi=Fi+Math.imul(Ka,rs)|0,Ki=Ki+Math.imul(wa,No)|0,ji=ji+Math.imul(wa,ss)|0,ji=ji+Math.imul(Na,No)|0,Fi=Fi+Math.imul(Na,ss)|0,Ki=Ki+Math.imul(va,zo)|0,ji=ji+Math.imul(va,Ss)|0,ji=ji+Math.imul(Sa,zo)|0,Fi=Fi+Math.imul(Sa,Ss)|0;var Es=(Hi+Ki|0)+((ji&8191)<<13)|0;Hi=(Fi+(ji>>>13)|0)+(Es>>>26)|0,Es&=67108863,Ki=Math.imul(Ha,Da),ji=Math.imul(Ha,rs),ji=ji+Math.imul(Ua,Da)|0,Fi=Math.imul(Ua,rs),Ki=Ki+Math.imul(Ma,No)|0,ji=ji+Math.imul(Ma,ss)|0,ji=ji+Math.imul(Ka,No)|0,Fi=Fi+Math.imul(Ka,ss)|0,Ki=Ki+Math.imul(wa,zo)|0,ji=ji+Math.imul(wa,Ss)|0,ji=ji+Math.imul(Na,zo)|0,Fi=Fi+Math.imul(Na,Ss)|0;var zs=(Hi+Ki|0)+((ji&8191)<<13)|0;Hi=(Fi+(ji>>>13)|0)+(zs>>>26)|0,zs&=67108863,Ki=Math.imul(Ha,No),ji=Math.imul(Ha,ss),ji=ji+Math.imul(Ua,No)|0,Fi=Math.imul(Ua,ss),Ki=Ki+Math.imul(Ma,zo)|0,ji=ji+Math.imul(Ma,Ss)|0,ji=ji+Math.imul(Ka,zo)|0,Fi=Fi+Math.imul(Ka,Ss)|0;var Ks=(Hi+Ki|0)+((ji&8191)<<13)|0;Hi=(Fi+(ji>>>13)|0)+(Ks>>>26)|0,Ks&=67108863,Ki=Math.imul(Ha,zo),ji=Math.imul(Ha,Ss),ji=ji+Math.imul(Ua,zo)|0,Fi=Math.imul(Ua,Ss);var nl=(Hi+Ki|0)+((ji&8191)<<13)|0;return Hi=(Fi+(ji>>>13)|0)+(nl>>>26)|0,nl&=67108863,Bi[0]=vs,Bi[1]=gs,Bi[2]=Xs,Bi[3]=La,Bi[4]=ba,Bi[5]=ka,Bi[6]=ja,Bi[7]=ts,Bi[8]=ys,Bi[9]=ps,Bi[10]=hs,Bi[11]=Ls,Bi[12]=js,Bi[13]=Ts,Bi[14]=Us,Bi[15]=Es,Bi[16]=zs,Bi[17]=Ks,Bi[18]=nl,Hi!==0&&(Bi[19]=Hi,wi.length++),wi};Math.imul||(Ei=bi);function _i(zi,Mi,Li){Li.negative=Mi.negative^zi.negative,Li.length=zi.length+Mi.length;for(var wi=0,Ri=0,ki=0;ki<Li.length-1;ki++){var Bi=Ri;Ri=0;for(var Hi=wi&67108863,Ki=Math.min(ki,Mi.length-1),ji=Math.max(0,ki-zi.length+1);ji<=Ki;ji++){var Fi=ki-ji,$i=zi.words[Fi]|0,Wi=Mi.words[ji]|0,Qi=$i*Wi,ea=Qi&67108863;Bi=Bi+(Qi/67108864|0)|0,ea=ea+Hi|0,Hi=ea&67108863,Bi=Bi+(ea>>>26)|0,Ri+=Bi>>>26,Bi&=67108863}Li.words[ki]=Hi,wi=Bi,Bi=Ri}return wi!==0?Li.words[ki]=wi:Li.length--,Li.strip()}function xi(zi,Mi,Li){var wi=new Ci;return wi.mulp(zi,Mi,Li)}Hn.prototype.mulTo=function(Mi,Li){var wi,Ri=this.length+Mi.length;return this.length===10&&Mi.length===10?wi=Ei(this,Mi,Li):Ri<63?wi=bi(this,Mi,Li):Ri<1024?wi=_i(this,Mi,Li):wi=xi(this,Mi,Li),wi};function Ci(zi,Mi){this.x=zi,this.y=Mi}Ci.prototype.makeRBT=function(Mi){for(var Li=new Array(Mi),wi=Hn.prototype._countBits(Mi)-1,Ri=0;Ri<Mi;Ri++)Li[Ri]=this.revBin(Ri,wi,Mi);return Li},Ci.prototype.revBin=function(Mi,Li,wi){if(Mi===0||Mi===wi-1)return Mi;for(var Ri=0,ki=0;ki<Li;ki++)Ri|=(Mi&1)<<Li-ki-1,Mi>>=1;return Ri},Ci.prototype.permute=function(Mi,Li,wi,Ri,ki,Bi){for(var Hi=0;Hi<Bi;Hi++)Ri[Hi]=Li[Mi[Hi]],ki[Hi]=wi[Mi[Hi]]},Ci.prototype.transform=function(Mi,Li,wi,Ri,ki,Bi){this.permute(Bi,Mi,Li,wi,Ri,ki);for(var Hi=1;Hi<ki;Hi<<=1)for(var Ki=Hi<<1,ji=Math.cos(2*Math.PI/Ki),Fi=Math.sin(2*Math.PI/Ki),$i=0;$i<ki;$i+=Ki)for(var Wi=ji,Qi=Fi,ea=0;ea<Hi;ea++){var na=wi[$i+ea],Ji=Ri[$i+ea],ra=wi[$i+ea+Hi],sa=Ri[$i+ea+Hi],la=Wi*ra-Qi*sa;sa=Wi*sa+Qi*ra,ra=la,wi[$i+ea]=na+ra,Ri[$i+ea]=Ji+sa,wi[$i+ea+Hi]=na-ra,Ri[$i+ea+Hi]=Ji-sa,ea!==Ki&&(la=ji*Wi-Fi*Qi,Qi=ji*Qi+Fi*Wi,Wi=la)}},Ci.prototype.guessLen13b=function(Mi,Li){var wi=Math.max(Li,Mi)|1,Ri=wi&1,ki=0;for(wi=wi/2|0;wi;wi=wi>>>1)ki++;return 1<<ki+1+Ri},Ci.prototype.conjugate=function(Mi,Li,wi){if(!(wi<=1))for(var Ri=0;Ri<wi/2;Ri++){var ki=Mi[Ri];Mi[Ri]=Mi[wi-Ri-1],Mi[wi-Ri-1]=ki,ki=Li[Ri],Li[Ri]=-Li[wi-Ri-1],Li[wi-Ri-1]=-ki}},Ci.prototype.normalize13b=function(Mi,Li){for(var wi=0,Ri=0;Ri<Li/2;Ri++){var ki=Math.round(Mi[2*Ri+1]/Li)*8192+Math.round(Mi[2*Ri]/Li)+wi;Mi[Ri]=ki&67108863,ki<67108864?wi=0:wi=ki/67108864|0}return Mi},Ci.prototype.convert13b=function(Mi,Li,wi,Ri){for(var ki=0,Bi=0;Bi<Li;Bi++)ki=ki+(Mi[Bi]|0),wi[2*Bi]=ki&8191,ki=ki>>>13,wi[2*Bi+1]=ki&8191,ki=ki>>>13;for(Bi=2*Li;Bi<Ri;++Bi)wi[Bi]=0;Mn(ki===0),Mn((ki&-8192)===0)},Ci.prototype.stub=function(Mi){for(var Li=new Array(Mi),wi=0;wi<Mi;wi++)Li[wi]=0;return Li},Ci.prototype.mulp=function(Mi,Li,wi){var Ri=2*this.guessLen13b(Mi.length,Li.length),ki=this.makeRBT(Ri),Bi=this.stub(Ri),Hi=new Array(Ri),Ki=new Array(Ri),ji=new Array(Ri),Fi=new Array(Ri),$i=new Array(Ri),Wi=new Array(Ri),Qi=wi.words;Qi.length=Ri,this.convert13b(Mi.words,Mi.length,Hi,Ri),this.convert13b(Li.words,Li.length,Fi,Ri),this.transform(Hi,Bi,Ki,ji,Ri,ki),this.transform(Fi,Bi,$i,Wi,Ri,ki);for(var ea=0;ea<Ri;ea++){var na=Ki[ea]*$i[ea]-ji[ea]*Wi[ea];ji[ea]=Ki[ea]*Wi[ea]+ji[ea]*$i[ea],Ki[ea]=na}return this.conjugate(Ki,ji,Ri),this.transform(Ki,ji,Qi,Bi,Ri,ki),this.conjugate(Qi,Bi,Ri),this.normalize13b(Qi,Ri),wi.negative=Mi.negative^Li.negative,wi.length=Mi.length+Li.length,wi.strip()},Hn.prototype.mul=function(Mi){var Li=new Hn(null);return Li.words=new Array(this.length+Mi.length),this.mulTo(Mi,Li)},Hn.prototype.mulf=function(Mi){var Li=new Hn(null);return Li.words=new Array(this.length+Mi.length),xi(this,Mi,Li)},Hn.prototype.imul=function(Mi){return this.clone().mulTo(Mi,this)},Hn.prototype.imuln=function(Mi){Mn(typeof Mi=="number"),Mn(Mi<67108864);for(var Li=0,wi=0;wi<this.length;wi++){var Ri=(this.words[wi]|0)*Mi,ki=(Ri&67108863)+(Li&67108863);Li>>=26,Li+=Ri/67108864|0,Li+=ki>>>26,this.words[wi]=ki&67108863}return Li!==0&&(this.words[wi]=Li,this.length++),this.length=Mi===0?1:this.length,this},Hn.prototype.muln=function(Mi){return this.clone().imuln(Mi)},Hn.prototype.sqr=function(){return this.mul(this)},Hn.prototype.isqr=function(){return this.imul(this.clone())},Hn.prototype.pow=function(Mi){var Li=yi(Mi);if(Li.length===0)return new Hn(1);for(var wi=this,Ri=0;Ri<Li.length&&Li[Ri]===0;Ri++,wi=wi.sqr());if(++Ri<Li.length)for(var ki=wi.sqr();Ri<Li.length;Ri++,ki=ki.sqr())Li[Ri]!==0&&(wi=wi.mul(ki));return wi},Hn.prototype.iushln=function(Mi){Mn(typeof Mi=="number"&&Mi>=0);var Li=Mi%26,wi=(Mi-Li)/26,Ri=67108863>>>26-Li<<26-Li,ki;if(Li!==0){var Bi=0;for(ki=0;ki<this.length;ki++){var Hi=this.words[ki]&Ri,Ki=(this.words[ki]|0)-Hi<<Li;this.words[ki]=Ki|Bi,Bi=Hi>>>26-Li}Bi&&(this.words[ki]=Bi,this.length++)}if(wi!==0){for(ki=this.length-1;ki>=0;ki--)this.words[ki+wi]=this.words[ki];for(ki=0;ki<wi;ki++)this.words[ki]=0;this.length+=wi}return this.strip()},Hn.prototype.ishln=function(Mi){return Mn(this.negative===0),this.iushln(Mi)},Hn.prototype.iushrn=function(Mi,Li,wi){Mn(typeof Mi=="number"&&Mi>=0);var Ri;Li?Ri=(Li-Li%26)/26:Ri=0;var ki=Mi%26,Bi=Math.min((Mi-ki)/26,this.length),Hi=67108863^67108863>>>ki<<ki,Ki=wi;if(Ri-=Bi,Ri=Math.max(0,Ri),Ki){for(var ji=0;ji<Bi;ji++)Ki.words[ji]=this.words[ji];Ki.length=Bi}if(Bi!==0)if(this.length>Bi)for(this.length-=Bi,ji=0;ji<this.length;ji++)this.words[ji]=this.words[ji+Bi];else this.words[0]=0,this.length=1;var Fi=0;for(ji=this.length-1;ji>=0&&(Fi!==0||ji>=Ri);ji--){var $i=this.words[ji]|0;this.words[ji]=Fi<<26-ki|$i>>>ki,Fi=$i&Hi}return Ki&&Fi!==0&&(Ki.words[Ki.length++]=Fi),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},Hn.prototype.ishrn=function(Mi,Li,wi){return Mn(this.negative===0),this.iushrn(Mi,Li,wi)},Hn.prototype.shln=function(Mi){return this.clone().ishln(Mi)},Hn.prototype.ushln=function(Mi){return this.clone().iushln(Mi)},Hn.prototype.shrn=function(Mi){return this.clone().ishrn(Mi)},Hn.prototype.ushrn=function(Mi){return this.clone().iushrn(Mi)},Hn.prototype.testn=function(Mi){Mn(typeof Mi=="number"&&Mi>=0);var Li=Mi%26,wi=(Mi-Li)/26,Ri=1<<Li;if(this.length<=wi)return!1;var ki=this.words[wi];return!!(ki&Ri)},Hn.prototype.imaskn=function(Mi){Mn(typeof Mi=="number"&&Mi>=0);var Li=Mi%26,wi=(Mi-Li)/26;if(Mn(this.negative===0,"imaskn works only with positive numbers"),this.length<=wi)return this;if(Li!==0&&wi++,this.length=Math.min(wi,this.length),Li!==0){var Ri=67108863^67108863>>>Li<<Li;this.words[this.length-1]&=Ri}return this.strip()},Hn.prototype.maskn=function(Mi){return this.clone().imaskn(Mi)},Hn.prototype.iaddn=function(Mi){return Mn(typeof Mi=="number"),Mn(Mi<67108864),Mi<0?this.isubn(-Mi):this.negative!==0?this.length===1&&(this.words[0]|0)<Mi?(this.words[0]=Mi-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(Mi),this.negative=1,this):this._iaddn(Mi)},Hn.prototype._iaddn=function(Mi){this.words[0]+=Mi;for(var Li=0;Li<this.length&&this.words[Li]>=67108864;Li++)this.words[Li]-=67108864,Li===this.length-1?this.words[Li+1]=1:this.words[Li+1]++;return this.length=Math.max(this.length,Li+1),this},Hn.prototype.isubn=function(Mi){if(Mn(typeof Mi=="number"),Mn(Mi<67108864),Mi<0)return this.iaddn(-Mi);if(this.negative!==0)return this.negative=0,this.iaddn(Mi),this.negative=1,this;if(this.words[0]-=Mi,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var Li=0;Li<this.length&&this.words[Li]<0;Li++)this.words[Li]+=67108864,this.words[Li+1]-=1;return this.strip()},Hn.prototype.addn=function(Mi){return this.clone().iaddn(Mi)},Hn.prototype.subn=function(Mi){return this.clone().isubn(Mi)},Hn.prototype.iabs=function(){return this.negative=0,this},Hn.prototype.abs=function(){return this.clone().iabs()},Hn.prototype._ishlnsubmul=function(Mi,Li,wi){var Ri=Mi.length+wi,ki;this._expand(Ri);var Bi,Hi=0;for(ki=0;ki<Mi.length;ki++){Bi=(this.words[ki+wi]|0)+Hi;var Ki=(Mi.words[ki]|0)*Li;Bi-=Ki&67108863,Hi=(Bi>>26)-(Ki/67108864|0),this.words[ki+wi]=Bi&67108863}for(;ki<this.length-wi;ki++)Bi=(this.words[ki+wi]|0)+Hi,Hi=Bi>>26,this.words[ki+wi]=Bi&67108863;if(Hi===0)return this.strip();for(Mn(Hi===-1),Hi=0,ki=0;ki<this.length;ki++)Bi=-(this.words[ki]|0)+Hi,Hi=Bi>>26,this.words[ki]=Bi&67108863;return this.negative=1,this.strip()},Hn.prototype._wordDiv=function(Mi,Li){var wi=this.length-Mi.length,Ri=this.clone(),ki=Mi,Bi=ki.words[ki.length-1]|0,Hi=this._countBits(Bi);wi=26-Hi,wi!==0&&(ki=ki.ushln(wi),Ri.iushln(wi),Bi=ki.words[ki.length-1]|0);var Ki=Ri.length-ki.length,ji;if(Li!=="mod"){ji=new Hn(null),ji.length=Ki+1,ji.words=new Array(ji.length);for(var Fi=0;Fi<ji.length;Fi++)ji.words[Fi]=0}var $i=Ri.clone()._ishlnsubmul(ki,1,Ki);$i.negative===0&&(Ri=$i,ji&&(ji.words[Ki]=1));for(var Wi=Ki-1;Wi>=0;Wi--){var Qi=(Ri.words[ki.length+Wi]|0)*67108864+(Ri.words[ki.length+Wi-1]|0);for(Qi=Math.min(Qi/Bi|0,67108863),Ri._ishlnsubmul(ki,Qi,Wi);Ri.negative!==0;)Qi--,Ri.negative=0,Ri._ishlnsubmul(ki,1,Wi),Ri.isZero()||(Ri.negative^=1);ji&&(ji.words[Wi]=Qi)}return ji&&ji.strip(),Ri.strip(),Li!=="div"&&wi!==0&&Ri.iushrn(wi),{div:ji||null,mod:Ri}},Hn.prototype.divmod=function(Mi,Li,wi){if(Mn(!Mi.isZero()),this.isZero())return{div:new Hn(0),mod:new Hn(0)};var Ri,ki,Bi;return this.negative!==0&&Mi.negative===0?(Bi=this.neg().divmod(Mi,Li),Li!=="mod"&&(Ri=Bi.div.neg()),Li!=="div"&&(ki=Bi.mod.neg(),wi&&ki.negative!==0&&ki.iadd(Mi)),{div:Ri,mod:ki}):this.negative===0&&Mi.negative!==0?(Bi=this.divmod(Mi.neg(),Li),Li!=="mod"&&(Ri=Bi.div.neg()),{div:Ri,mod:Bi.mod}):(this.negative&Mi.negative)!==0?(Bi=this.neg().divmod(Mi.neg(),Li),Li!=="div"&&(ki=Bi.mod.neg(),wi&&ki.negative!==0&&ki.isub(Mi)),{div:Bi.div,mod:ki}):Mi.length>this.length||this.cmp(Mi)<0?{div:new Hn(0),mod:this}:Mi.length===1?Li==="div"?{div:this.divn(Mi.words[0]),mod:null}:Li==="mod"?{div:null,mod:new Hn(this.modn(Mi.words[0]))}:{div:this.divn(Mi.words[0]),mod:new Hn(this.modn(Mi.words[0]))}:this._wordDiv(Mi,Li)},Hn.prototype.div=function(Mi){return this.divmod(Mi,"div",!1).div},Hn.prototype.mod=function(Mi){return this.divmod(Mi,"mod",!1).mod},Hn.prototype.umod=function(Mi){return this.divmod(Mi,"mod",!0).mod},Hn.prototype.divRound=function(Mi){var Li=this.divmod(Mi);if(Li.mod.isZero())return Li.div;var wi=Li.div.negative!==0?Li.mod.isub(Mi):Li.mod,Ri=Mi.ushrn(1),ki=Mi.andln(1),Bi=wi.cmp(Ri);return Bi<0||ki===1&&Bi===0?Li.div:Li.div.negative!==0?Li.div.isubn(1):Li.div.iaddn(1)},Hn.prototype.modn=function(Mi){Mn(Mi<=67108863);for(var Li=(1<<26)%Mi,wi=0,Ri=this.length-1;Ri>=0;Ri--)wi=(Li*wi+(this.words[Ri]|0))%Mi;return wi},Hn.prototype.idivn=function(Mi){Mn(Mi<=67108863);for(var Li=0,wi=this.length-1;wi>=0;wi--){var Ri=(this.words[wi]|0)+Li*67108864;this.words[wi]=Ri/Mi|0,Li=Ri%Mi}return this.strip()},Hn.prototype.divn=function(Mi){return this.clone().idivn(Mi)},Hn.prototype.egcd=function(Mi){Mn(Mi.negative===0),Mn(!Mi.isZero());var Li=this,wi=Mi.clone();Li.negative!==0?Li=Li.umod(Mi):Li=Li.clone();for(var Ri=new Hn(1),ki=new Hn(0),Bi=new Hn(0),Hi=new Hn(1),Ki=0;Li.isEven()&&wi.isEven();)Li.iushrn(1),wi.iushrn(1),++Ki;for(var ji=wi.clone(),Fi=Li.clone();!Li.isZero();){for(var $i=0,Wi=1;(Li.words[0]&Wi)===0&&$i<26;++$i,Wi<<=1);if($i>0)for(Li.iushrn($i);$i-- >0;)(Ri.isOdd()||ki.isOdd())&&(Ri.iadd(ji),ki.isub(Fi)),Ri.iushrn(1),ki.iushrn(1);for(var Qi=0,ea=1;(wi.words[0]&ea)===0&&Qi<26;++Qi,ea<<=1);if(Qi>0)for(wi.iushrn(Qi);Qi-- >0;)(Bi.isOdd()||Hi.isOdd())&&(Bi.iadd(ji),Hi.isub(Fi)),Bi.iushrn(1),Hi.iushrn(1);Li.cmp(wi)>=0?(Li.isub(wi),Ri.isub(Bi),ki.isub(Hi)):(wi.isub(Li),Bi.isub(Ri),Hi.isub(ki))}return{a:Bi,b:Hi,gcd:wi.iushln(Ki)}},Hn.prototype._invmp=function(Mi){Mn(Mi.negative===0),Mn(!Mi.isZero());var Li=this,wi=Mi.clone();Li.negative!==0?Li=Li.umod(Mi):Li=Li.clone();for(var Ri=new Hn(1),ki=new Hn(0),Bi=wi.clone();Li.cmpn(1)>0&&wi.cmpn(1)>0;){for(var Hi=0,Ki=1;(Li.words[0]&Ki)===0&&Hi<26;++Hi,Ki<<=1);if(Hi>0)for(Li.iushrn(Hi);Hi-- >0;)Ri.isOdd()&&Ri.iadd(Bi),Ri.iushrn(1);for(var ji=0,Fi=1;(wi.words[0]&Fi)===0&&ji<26;++ji,Fi<<=1);if(ji>0)for(wi.iushrn(ji);ji-- >0;)ki.isOdd()&&ki.iadd(Bi),ki.iushrn(1);Li.cmp(wi)>=0?(Li.isub(wi),Ri.isub(ki)):(wi.isub(Li),ki.isub(Ri))}var $i;return Li.cmpn(1)===0?$i=Ri:$i=ki,$i.cmpn(0)<0&&$i.iadd(Mi),$i},Hn.prototype.gcd=function(Mi){if(this.isZero())return Mi.abs();if(Mi.isZero())return this.abs();var Li=this.clone(),wi=Mi.clone();Li.negative=0,wi.negative=0;for(var Ri=0;Li.isEven()&&wi.isEven();Ri++)Li.iushrn(1),wi.iushrn(1);do{for(;Li.isEven();)Li.iushrn(1);for(;wi.isEven();)wi.iushrn(1);var ki=Li.cmp(wi);if(ki<0){var Bi=Li;Li=wi,wi=Bi}else if(ki===0||wi.cmpn(1)===0)break;Li.isub(wi)}while(!0);return wi.iushln(Ri)},Hn.prototype.invm=function(Mi){return this.egcd(Mi).a.umod(Mi)},Hn.prototype.isEven=function(){return(this.words[0]&1)===0},Hn.prototype.isOdd=function(){return(this.words[0]&1)===1},Hn.prototype.andln=function(Mi){return this.words[0]&Mi},Hn.prototype.bincn=function(Mi){Mn(typeof Mi=="number");var Li=Mi%26,wi=(Mi-Li)/26,Ri=1<<Li;if(this.length<=wi)return this._expand(wi+1),this.words[wi]|=Ri,this;for(var ki=Ri,Bi=wi;ki!==0&&Bi<this.length;Bi++){var Hi=this.words[Bi]|0;Hi+=ki,ki=Hi>>>26,Hi&=67108863,this.words[Bi]=Hi}return ki!==0&&(this.words[Bi]=ki,this.length++),this},Hn.prototype.isZero=function(){return this.length===1&&this.words[0]===0},Hn.prototype.cmpn=function(Mi){var Li=Mi<0;if(this.negative!==0&&!Li)return-1;if(this.negative===0&&Li)return 1;this.strip();var wi;if(this.length>1)wi=1;else{Li&&(Mi=-Mi),Mn(Mi<=67108863,"Number is too big");var Ri=this.words[0]|0;wi=Ri===Mi?0:Ri<Mi?-1:1}return this.negative!==0?-wi|0:wi},Hn.prototype.cmp=function(Mi){if(this.negative!==0&&Mi.negative===0)return-1;if(this.negative===0&&Mi.negative!==0)return 1;var Li=this.ucmp(Mi);return this.negative!==0?-Li|0:Li},Hn.prototype.ucmp=function(Mi){if(this.length>Mi.length)return 1;if(this.length<Mi.length)return-1;for(var Li=0,wi=this.length-1;wi>=0;wi--){var Ri=this.words[wi]|0,ki=Mi.words[wi]|0;if(Ri!==ki){Ri<ki?Li=-1:Ri>ki&&(Li=1);break}}return Li},Hn.prototype.gtn=function(Mi){return this.cmpn(Mi)===1},Hn.prototype.gt=function(Mi){return this.cmp(Mi)===1},Hn.prototype.gten=function(Mi){return this.cmpn(Mi)>=0},Hn.prototype.gte=function(Mi){return this.cmp(Mi)>=0},Hn.prototype.ltn=function(Mi){return this.cmpn(Mi)===-1},Hn.prototype.lt=function(Mi){return this.cmp(Mi)===-1},Hn.prototype.lten=function(Mi){return this.cmpn(Mi)<=0},Hn.prototype.lte=function(Mi){return this.cmp(Mi)<=0},Hn.prototype.eqn=function(Mi){return this.cmpn(Mi)===0},Hn.prototype.eq=function(Mi){return this.cmp(Mi)===0},Hn.red=function(Mi){return new Gi(Mi)},Hn.prototype.toRed=function(Mi){return Mn(!this.red,"Already a number in reduction context"),Mn(this.negative===0,"red works only with positives"),Mi.convertTo(this)._forceRed(Mi)},Hn.prototype.fromRed=function(){return Mn(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},Hn.prototype._forceRed=function(Mi){return this.red=Mi,this},Hn.prototype.forceRed=function(Mi){return Mn(!this.red,"Already a number in reduction context"),this._forceRed(Mi)},Hn.prototype.redAdd=function(Mi){return Mn(this.red,"redAdd works only with red numbers"),this.red.add(this,Mi)},Hn.prototype.redIAdd=function(Mi){return Mn(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,Mi)},Hn.prototype.redSub=function(Mi){return Mn(this.red,"redSub works only with red numbers"),this.red.sub(this,Mi)},Hn.prototype.redISub=function(Mi){return Mn(this.red,"redISub works only with red numbers"),this.red.isub(this,Mi)},Hn.prototype.redShl=function(Mi){return Mn(this.red,"redShl works only with red numbers"),this.red.shl(this,Mi)},Hn.prototype.redMul=function(Mi){return Mn(this.red,"redMul works only with red numbers"),this.red._verify2(this,Mi),this.red.mul(this,Mi)},Hn.prototype.redIMul=function(Mi){return Mn(this.red,"redMul works only with red numbers"),this.red._verify2(this,Mi),this.red.imul(this,Mi)},Hn.prototype.redSqr=function(){return Mn(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},Hn.prototype.redISqr=function(){return Mn(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},Hn.prototype.redSqrt=function(){return Mn(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},Hn.prototype.redInvm=function(){return Mn(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},Hn.prototype.redNeg=function(){return Mn(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},Hn.prototype.redPow=function(Mi){return Mn(this.red&&!Mi.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,Mi)};var Ai={k256:null,p224:null,p192:null,p25519:null};function Ii(zi,Mi){this.name=zi,this.p=new Hn(Mi,16),this.n=this.p.bitLength(),this.k=new Hn(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Ii.prototype._tmp=function(){var Mi=new Hn(null);return Mi.words=new Array(Math.ceil(this.n/13)),Mi},Ii.prototype.ireduce=function(Mi){var Li=Mi,wi;do this.split(Li,this.tmp),Li=this.imulK(Li),Li=Li.iadd(this.tmp),wi=Li.bitLength();while(wi>this.n);var Ri=wi<this.n?-1:Li.ucmp(this.p);return Ri===0?(Li.words[0]=0,Li.length=1):Ri>0?Li.isub(this.p):Li.strip!==void 0?Li.strip():Li._strip(),Li},Ii.prototype.split=function(Mi,Li){Mi.iushrn(this.n,0,Li)},Ii.prototype.imulK=function(Mi){return Mi.imul(this.k)};function Ni(){Ii.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}Ln(Ni,Ii),Ni.prototype.split=function(Mi,Li){for(var wi=4194303,Ri=Math.min(Mi.length,9),ki=0;ki<Ri;ki++)Li.words[ki]=Mi.words[ki];if(Li.length=Ri,Mi.length<=9){Mi.words[0]=0,Mi.length=1;return}var Bi=Mi.words[9];for(Li.words[Li.length++]=Bi&wi,ki=10;ki<Mi.length;ki++){var Hi=Mi.words[ki]|0;Mi.words[ki-10]=(Hi&wi)<<4|Bi>>>22,Bi=Hi}Bi>>>=22,Mi.words[ki-10]=Bi,Bi===0&&Mi.length>10?Mi.length-=10:Mi.length-=9},Ni.prototype.imulK=function(Mi){Mi.words[Mi.length]=0,Mi.words[Mi.length+1]=0,Mi.length+=2;for(var Li=0,wi=0;wi<Mi.length;wi++){var Ri=Mi.words[wi]|0;Li+=Ri*977,Mi.words[wi]=Li&67108863,Li=Ri*64+(Li/67108864|0)}return Mi.words[Mi.length-1]===0&&(Mi.length--,Mi.words[Mi.length-1]===0&&Mi.length--),Mi};function Pi(){Ii.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}Ln(Pi,Ii);function Vi(){Ii.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}Ln(Vi,Ii);function Ui(){Ii.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}Ln(Ui,Ii),Ui.prototype.imulK=function(Mi){for(var Li=0,wi=0;wi<Mi.length;wi++){var Ri=(Mi.words[wi]|0)*19+Li,ki=Ri&67108863;Ri>>>=26,Mi.words[wi]=ki,Li=Ri}return Li!==0&&(Mi.words[Mi.length++]=Li),Mi},Hn._prime=function(Mi){if(Ai[Mi])return Ai[Mi];var Li;if(Mi==="k256")Li=new Ni;else if(Mi==="p224")Li=new Pi;else if(Mi==="p192")Li=new Vi;else if(Mi==="p25519")Li=new Ui;else throw new Error("Unknown prime "+Mi);return Ai[Mi]=Li,Li};function Gi(zi){if(typeof zi=="string"){var Mi=Hn._prime(zi);this.m=Mi.p,this.prime=Mi}else Mn(zi.gtn(1),"modulus must be greater than 1"),this.m=zi,this.prime=null}Gi.prototype._verify1=function(Mi){Mn(Mi.negative===0,"red works only with positives"),Mn(Mi.red,"red works only with red numbers")},Gi.prototype._verify2=function(Mi,Li){Mn((Mi.negative|Li.negative)===0,"red works only with positives"),Mn(Mi.red&&Mi.red===Li.red,"red works only with red numbers")},Gi.prototype.imod=function(Mi){return this.prime?this.prime.ireduce(Mi)._forceRed(this):Mi.umod(this.m)._forceRed(this)},Gi.prototype.neg=function(Mi){return Mi.isZero()?Mi.clone():this.m.sub(Mi)._forceRed(this)},Gi.prototype.add=function(Mi,Li){this._verify2(Mi,Li);var wi=Mi.add(Li);return wi.cmp(this.m)>=0&&wi.isub(this.m),wi._forceRed(this)},Gi.prototype.iadd=function(Mi,Li){this._verify2(Mi,Li);var wi=Mi.iadd(Li);return wi.cmp(this.m)>=0&&wi.isub(this.m),wi},Gi.prototype.sub=function(Mi,Li){this._verify2(Mi,Li);var wi=Mi.sub(Li);return wi.cmpn(0)<0&&wi.iadd(this.m),wi._forceRed(this)},Gi.prototype.isub=function(Mi,Li){this._verify2(Mi,Li);var wi=Mi.isub(Li);return wi.cmpn(0)<0&&wi.iadd(this.m),wi},Gi.prototype.shl=function(Mi,Li){return this._verify1(Mi),this.imod(Mi.ushln(Li))},Gi.prototype.imul=function(Mi,Li){return this._verify2(Mi,Li),this.imod(Mi.imul(Li))},Gi.prototype.mul=function(Mi,Li){return this._verify2(Mi,Li),this.imod(Mi.mul(Li))},Gi.prototype.isqr=function(Mi){return this.imul(Mi,Mi.clone())},Gi.prototype.sqr=function(Mi){return this.mul(Mi,Mi)},Gi.prototype.sqrt=function(Mi){if(Mi.isZero())return Mi.clone();var Li=this.m.andln(3);if(Mn(Li%2===1),Li===3){var wi=this.m.add(new Hn(1)).iushrn(2);return this.pow(Mi,wi)}for(var Ri=this.m.subn(1),ki=0;!Ri.isZero()&&Ri.andln(1)===0;)ki++,Ri.iushrn(1);Mn(!Ri.isZero());var Bi=new Hn(1).toRed(this),Hi=Bi.redNeg(),Ki=this.m.subn(1).iushrn(1),ji=this.m.bitLength();for(ji=new Hn(2*ji*ji).toRed(this);this.pow(ji,Ki).cmp(Hi)!==0;)ji.redIAdd(Hi);for(var Fi=this.pow(ji,Ri),$i=this.pow(Mi,Ri.addn(1).iushrn(1)),Wi=this.pow(Mi,Ri),Qi=ki;Wi.cmp(Bi)!==0;){for(var ea=Wi,na=0;ea.cmp(Bi)!==0;na++)ea=ea.redSqr();Mn(na<Qi);var Ji=this.pow(Fi,new Hn(1).iushln(Qi-na-1));$i=$i.redMul(Ji),Fi=Ji.redSqr(),Wi=Wi.redMul(Fi),Qi=na}return $i},Gi.prototype.invm=function(Mi){var Li=Mi._invmp(this.m);return Li.negative!==0?(Li.negative=0,this.imod(Li).redNeg()):this.imod(Li)},Gi.prototype.pow=function(Mi,Li){if(Li.isZero())return new Hn(1).toRed(this);if(Li.cmpn(1)===0)return Mi.clone();var wi=4,Ri=new Array(1<<wi);Ri[0]=new Hn(1).toRed(this),Ri[1]=Mi;for(var ki=2;ki<Ri.length;ki++)Ri[ki]=this.mul(Ri[ki-1],Mi);var Bi=Ri[0],Hi=0,Ki=0,ji=Li.bitLength()%26;for(ji===0&&(ji=26),ki=Li.length-1;ki>=0;ki--){for(var Fi=Li.words[ki],$i=ji-1;$i>=0;$i--){var Wi=Fi>>$i&1;if(Bi!==Ri[0]&&(Bi=this.sqr(Bi)),Wi===0&&Hi===0){Ki=0;continue}Hi<<=1,Hi|=Wi,Ki++,!(Ki!==wi&&(ki!==0||$i!==0))&&(Bi=this.mul(Bi,Ri[Hi]),Ki=0,Hi=0)}ji=26}return Bi},Gi.prototype.convertTo=function(Mi){var Li=Mi.umod(this.m);return Li===Mi?Li.clone():Li},Gi.prototype.convertFrom=function(Mi){var Li=Mi.clone();return Li.red=null,Li},Hn.mont=function(Mi){return new Yi(Mi)};function Yi(zi){Gi.call(this,zi),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new Hn(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}Ln(Yi,Gi),Yi.prototype.convertTo=function(Mi){return this.imod(Mi.ushln(this.shift))},Yi.prototype.convertFrom=function(Mi){var Li=this.imod(Mi.mul(this.rinv));return Li.red=null,Li},Yi.prototype.imul=function(Mi,Li){if(Mi.isZero()||Li.isZero())return Mi.words[0]=0,Mi.length=1,Mi;var wi=Mi.imul(Li),Ri=wi.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),ki=wi.isub(Ri).iushrn(this.shift),Bi=ki;return ki.cmp(this.m)>=0?Bi=ki.isub(this.m):ki.cmpn(0)<0&&(Bi=ki.iadd(this.m)),Bi._forceRed(this)},Yi.prototype.mul=function(Mi,Li){if(Mi.isZero()||Li.isZero())return new Hn(0)._forceRed(this);var wi=Mi.mul(Li),Ri=wi.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),ki=wi.isub(Ri).iushrn(this.shift),Bi=ki;return ki.cmp(this.m)>=0?Bi=ki.isub(this.m):ki.cmpn(0)<0&&(Bi=ki.iadd(this.m)),Bi._forceRed(this)},Yi.prototype.invm=function(Mi){var Li=this.imod(Mi._invmp(this.m).mul(this.r2));return Li._forceRed(this)}})(on,bn$4)}(bn$5)),bn$5.exports}var brorand={exports:{}},hasRequiredBrorand;function requireBrorand(){if(hasRequiredBrorand)return brorand.exports;hasRequiredBrorand=1;var on;brorand.exports=function(Ln){return on||(on=new In(null)),on.generate(Ln)};function In(Mn){this.rand=Mn}if(brorand.exports.Rand=In,In.prototype.generate=function(Ln){return this._rand(Ln)},In.prototype._rand=function(Ln){if(this.rand.getBytes)return this.rand.getBytes(Ln);for(var Hn=new Uint8Array(Ln),jn=0;jn<Hn.length;jn++)Hn[jn]=this.rand.getByte();return Hn},typeof self=="object")self.crypto&&self.crypto.getRandomValues?In.prototype._rand=function(Ln){var Hn=new Uint8Array(Ln);return self.crypto.getRandomValues(Hn),Hn}:self.msCrypto&&self.msCrypto.getRandomValues?In.prototype._rand=function(Ln){var Hn=new Uint8Array(Ln);return self.msCrypto.getRandomValues(Hn),Hn}:typeof window=="object"&&(In.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var Rn=requireCryptoBrowserify();if(typeof Rn.randomBytes!="function")throw new Error("Not supported");In.prototype._rand=function(Ln){return Rn.randomBytes(Ln)}}catch{}return brorand.exports}var mr,hasRequiredMr;function requireMr(){if(hasRequiredMr)return mr;hasRequiredMr=1;var on=requireBn$2(),In=requireBrorand();function Rn(Mn){this.rand=Mn||new In.Rand}return mr=Rn,Rn.create=function(Ln){return new Rn(Ln)},Rn.prototype._randbelow=function(Ln){var Hn=Ln.bitLength(),jn=Math.ceil(Hn/8);do var Wn=new on(this.rand.generate(jn));while(Wn.cmp(Ln)>=0);return Wn},Rn.prototype._randrange=function(Ln,Hn){var jn=Hn.sub(Ln);return Ln.add(this._randbelow(jn))},Rn.prototype.test=function(Ln,Hn,jn){var Wn=Ln.bitLength(),Yn=on.mont(Ln),hi=new on(1).toRed(Yn);Hn||(Hn=Math.max(1,Wn/48|0));for(var vi=Ln.subn(1),gi=0;!vi.testn(gi);gi++);for(var mi=Ln.shrn(gi),yi=vi.toRed(Yn),bi=!0;Hn>0;Hn--){var Ei=this._randrange(new on(2),vi);jn&&jn(Ei);var _i=Ei.toRed(Yn).redPow(mi);if(!(_i.cmp(hi)===0||_i.cmp(yi)===0)){for(var xi=1;xi<gi;xi++){if(_i=_i.redSqr(),_i.cmp(hi)===0)return!1;if(_i.cmp(yi)===0)break}if(xi===gi)return!1}}return bi},Rn.prototype.getDivisor=function(Ln,Hn){var jn=Ln.bitLength(),Wn=on.mont(Ln),Yn=new on(1).toRed(Wn);Hn||(Hn=Math.max(1,jn/48|0));for(var hi=Ln.subn(1),vi=0;!hi.testn(vi);vi++);for(var gi=Ln.shrn(vi),mi=hi.toRed(Wn);Hn>0;Hn--){var yi=this._randrange(new on(2),hi),bi=Ln.gcd(yi);if(bi.cmpn(1)!==0)return bi;var Ei=yi.toRed(Wn).redPow(gi);if(!(Ei.cmp(Yn)===0||Ei.cmp(mi)===0)){for(var _i=1;_i<vi;_i++){if(Ei=Ei.redSqr(),Ei.cmp(Yn)===0)return Ei.fromRed().subn(1).gcd(Ln);if(Ei.cmp(mi)===0)break}if(_i===vi)return Ei=Ei.redSqr(),Ei.fromRed().subn(1).gcd(Ln)}}return!1},mr}var generatePrime,hasRequiredGeneratePrime;function requireGeneratePrime(){if(hasRequiredGeneratePrime)return generatePrime;hasRequiredGeneratePrime=1;var on=requireBrowser$b();generatePrime=_i,_i.simpleSieve=bi,_i.fermatTest=Ei;var In=requireBn$2(),Rn=new In(24),Mn=requireMr(),Ln=new Mn,Hn=new In(1),jn=new In(2),Wn=new In(5);new In(16),new In(8);var Yn=new In(10),hi=new In(3);new In(7);var vi=new In(11),gi=new In(4);new In(12);var mi=null;function yi(){if(mi!==null)return mi;var xi=1048576,Ci=[];Ci[0]=2;for(var Ai=1,Ii=3;Ii<xi;Ii+=2){for(var Ni=Math.ceil(Math.sqrt(Ii)),Pi=0;Pi<Ai&&Ci[Pi]<=Ni&&Ii%Ci[Pi]!==0;Pi++);Ai!==Pi&&Ci[Pi]<=Ni||(Ci[Ai++]=Ii)}return mi=Ci,Ci}function bi(xi){for(var Ci=yi(),Ai=0;Ai<Ci.length;Ai++)if(xi.modn(Ci[Ai])===0)return xi.cmpn(Ci[Ai])===0;return!0}function Ei(xi){var Ci=In.mont(xi);return jn.toRed(Ci).redPow(xi.subn(1)).fromRed().cmpn(1)===0}function _i(xi,Ci){if(xi<16)return Ci===2||Ci===5?new In([140,123]):new In([140,39]);Ci=new In(Ci);for(var Ai,Ii;;){for(Ai=new In(on(Math.ceil(xi/8)));Ai.bitLength()>xi;)Ai.ishrn(1);if(Ai.isEven()&&Ai.iadd(Hn),Ai.testn(1)||Ai.iadd(jn),Ci.cmp(jn)){if(!Ci.cmp(Wn))for(;Ai.mod(Yn).cmp(hi);)Ai.iadd(gi)}else for(;Ai.mod(Rn).cmp(vi);)Ai.iadd(gi);if(Ii=Ai.shrn(1),bi(Ii)&&bi(Ai)&&Ei(Ii)&&Ei(Ai)&&Ln.test(Ii)&&Ln.test(Ai))return Ai}}return generatePrime}const modp1={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"},require$$1$1={modp1,modp2,modp5,modp14,modp15,modp16,modp17,modp18};var dh,hasRequiredDh;function requireDh(){if(hasRequiredDh)return dh;hasRequiredDh=1;var on=requireBn$2(),In=requireMr(),Rn=new In,Mn=new on(24),Ln=new on(11),Hn=new on(10),jn=new on(3),Wn=new on(7),Yn=requireGeneratePrime(),hi=requireBrowser$b();dh=bi;function vi(_i,xi){return xi=xi||"utf8",Buffer.isBuffer(_i)||(_i=new Buffer(_i,xi)),this._pub=new on(_i),this}function gi(_i,xi){return xi=xi||"utf8",Buffer.isBuffer(_i)||(_i=new Buffer(_i,xi)),this._priv=new on(_i),this}var mi={};function yi(_i,xi){var Ci=xi.toString("hex"),Ai=[Ci,_i.toString(16)].join("_");if(Ai in mi)return mi[Ai];var Ii=0;if(_i.isEven()||!Yn.simpleSieve||!Yn.fermatTest(_i)||!Rn.test(_i))return Ii+=1,Ci==="02"||Ci==="05"?Ii+=8:Ii+=4,mi[Ai]=Ii,Ii;Rn.test(_i.shrn(1))||(Ii+=2);var Ni;switch(Ci){case"02":_i.mod(Mn).cmp(Ln)&&(Ii+=8);break;case"05":Ni=_i.mod(Hn),Ni.cmp(jn)&&Ni.cmp(Wn)&&(Ii+=8);break;default:Ii+=4}return mi[Ai]=Ii,Ii}function bi(_i,xi,Ci){this.setGenerator(xi),this.__prime=new on(_i),this._prime=on.mont(this.__prime),this._primeLen=_i.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,Ci?(this.setPublicKey=vi,this.setPrivateKey=gi):this._primeCode=8}Object.defineProperty(bi.prototype,"verifyError",{enumerable:!0,get:function(){return typeof this._primeCode!="number"&&(this._primeCode=yi(this.__prime,this.__gen)),this._primeCode}}),bi.prototype.generateKeys=function(){return this._priv||(this._priv=new on(hi(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},bi.prototype.computeSecret=function(_i){_i=new on(_i),_i=_i.toRed(this._prime);var xi=_i.redPow(this._priv).fromRed(),Ci=new Buffer(xi.toArray()),Ai=this.getPrime();if(Ci.length<Ai.length){var Ii=new Buffer(Ai.length-Ci.length);Ii.fill(0),Ci=Buffer.concat([Ii,Ci])}return Ci},bi.prototype.getPublicKey=function(xi){return Ei(this._pub,xi)},bi.prototype.getPrivateKey=function(xi){return Ei(this._priv,xi)},bi.prototype.getPrime=function(_i){return Ei(this.__prime,_i)},bi.prototype.getGenerator=function(_i){return Ei(this._gen,_i)},bi.prototype.setGenerator=function(_i,xi){return xi=xi||"utf8",Buffer.isBuffer(_i)||(_i=new Buffer(_i,xi)),this.__gen=_i,this._gen=new on(_i),this};function Ei(_i,xi){var Ci=new Buffer(_i.toArray());return xi?Ci.toString(xi):Ci}return dh}var hasRequiredBrowser$5;function requireBrowser$5(){if(hasRequiredBrowser$5)return browser$5;hasRequiredBrowser$5=1;var on=requireGeneratePrime(),In=require$$1$1,Rn=requireDh();function Mn(jn){var Wn=new Buffer(In[jn].prime,"hex"),Yn=new Buffer(In[jn].gen,"hex");return new Rn(Wn,Yn)}var Ln={binary:!0,hex:!0,base64:!0};function Hn(jn,Wn,Yn,hi){return Buffer.isBuffer(Wn)||Ln[Wn]===void 0?Hn(jn,"binary",Wn,Yn):(Wn=Wn||"binary",hi=hi||"binary",Yn=Yn||new Buffer([2]),Buffer.isBuffer(Yn)||(Yn=new Buffer(Yn,hi)),typeof jn=="number"?new Rn(on(jn,Yn),Yn,!0):(Buffer.isBuffer(jn)||(jn=new Buffer(jn,Wn)),new Rn(jn,Yn,!0)))}return browser$5.DiffieHellmanGroup=browser$5.createDiffieHellmanGroup=browser$5.getDiffieHellman=Mn,browser$5.createDiffieHellman=browser$5.DiffieHellman=Hn,browser$5}var readableBrowser={exports:{}},processNextickArgs={exports:{}},hasRequiredProcessNextickArgs;function requireProcessNextickArgs(){if(hasRequiredProcessNextickArgs)return processNextickArgs.exports;hasRequiredProcessNextickArgs=1,typeof process$1>"u"||!process$1.version||process$1.version.indexOf("v0.")===0||process$1.version.indexOf("v1.")===0&&process$1.version.indexOf("v1.8.")!==0?processNextickArgs.exports={nextTick:on}:processNextickArgs.exports=process$1;function on(In,Rn,Mn,Ln){if(typeof In!="function")throw new TypeError('"callback" argument must be a function');var Hn=arguments.length,jn,Wn;switch(Hn){case 0:case 1:return process$1.nextTick(In);case 2:return process$1.nextTick(function(){In.call(null,Rn)});case 3:return process$1.nextTick(function(){In.call(null,Rn,Mn)});case 4:return process$1.nextTick(function(){In.call(null,Rn,Mn,Ln)});default:for(jn=new Array(Hn-1),Wn=0;Wn<jn.length;)jn[Wn++]=arguments[Wn];return process$1.nextTick(function(){In.apply(null,jn)})}}return processNextickArgs.exports}var isarray,hasRequiredIsarray;function requireIsarray(){if(hasRequiredIsarray)return isarray;hasRequiredIsarray=1;var on={}.toString;return isarray=Array.isArray||function(In){return on.call(In)=="[object Array]"},isarray}var streamBrowser,hasRequiredStreamBrowser;function requireStreamBrowser(){return hasRequiredStreamBrowser||(hasRequiredStreamBrowser=1,streamBrowser=requireEvents().EventEmitter),streamBrowser}var safeBuffer={exports:{}},hasRequiredSafeBuffer;function requireSafeBuffer(){return hasRequiredSafeBuffer||(hasRequiredSafeBuffer=1,function(on,In){var Rn=requireDist(),Mn=Rn.Buffer;function Ln(jn,Wn){for(var Yn in jn)Wn[Yn]=jn[Yn]}Mn.from&&Mn.alloc&&Mn.allocUnsafe&&Mn.allocUnsafeSlow?on.exports=Rn:(Ln(Rn,In),In.Buffer=Hn);function Hn(jn,Wn,Yn){return Mn(jn,Wn,Yn)}Ln(Mn,Hn),Hn.from=function(jn,Wn,Yn){if(typeof jn=="number")throw new TypeError("Argument must not be a number");return Mn(jn,Wn,Yn)},Hn.alloc=function(jn,Wn,Yn){if(typeof jn!="number")throw new TypeError("Argument must be a number");var hi=Mn(jn);return Wn!==void 0?typeof Yn=="string"?hi.fill(Wn,Yn):hi.fill(Wn):hi.fill(0),hi},Hn.allocUnsafe=function(jn){if(typeof jn!="number")throw new TypeError("Argument must be a number");return Mn(jn)},Hn.allocUnsafeSlow=function(jn){if(typeof jn!="number")throw new TypeError("Argument must be a number");return Rn.SlowBuffer(jn)}}(safeBuffer,safeBuffer.exports)),safeBuffer.exports}var util={},hasRequiredUtil;function requireUtil(){if(hasRequiredUtil)return util;hasRequiredUtil=1;function on(Ei){return Array.isArray?Array.isArray(Ei):bi(Ei)==="[object Array]"}util.isArray=on;function In(Ei){return typeof Ei=="boolean"}util.isBoolean=In;function Rn(Ei){return Ei===null}util.isNull=Rn;function Mn(Ei){return Ei==null}util.isNullOrUndefined=Mn;function Ln(Ei){return typeof Ei=="number"}util.isNumber=Ln;function Hn(Ei){return typeof Ei=="string"}util.isString=Hn;function jn(Ei){return typeof Ei=="symbol"}util.isSymbol=jn;function Wn(Ei){return Ei===void 0}util.isUndefined=Wn;function Yn(Ei){return bi(Ei)==="[object RegExp]"}util.isRegExp=Yn;function hi(Ei){return typeof Ei=="object"&&Ei!==null}util.isObject=hi;function vi(Ei){return bi(Ei)==="[object Date]"}util.isDate=vi;function gi(Ei){return bi(Ei)==="[object Error]"||Ei instanceof Error}util.isError=gi;function mi(Ei){return typeof Ei=="function"}util.isFunction=mi;function yi(Ei){return Ei===null||typeof Ei=="boolean"||typeof Ei=="number"||typeof Ei=="string"||typeof Ei=="symbol"||typeof Ei>"u"}util.isPrimitive=yi,util.isBuffer=requireDist().Buffer.isBuffer;function bi(Ei){return Object.prototype.toString.call(Ei)}return util}var BufferList={exports:{}},hasRequiredBufferList;function requireBufferList(){return hasRequiredBufferList||(hasRequiredBufferList=1,function(on){function In(Hn,jn){if(!(Hn instanceof jn))throw new TypeError("Cannot call a class as a function")}var Rn=requireSafeBuffer().Buffer,Mn=requireUtil$1();function Ln(Hn,jn,Wn){Hn.copy(jn,Wn)}on.exports=function(){function Hn(){In(this,Hn),this.head=null,this.tail=null,this.length=0}return Hn.prototype.push=function(Wn){var Yn={data:Wn,next:null};this.length>0?this.tail.next=Yn:this.head=Yn,this.tail=Yn,++this.length},Hn.prototype.unshift=function(Wn){var Yn={data:Wn,next:this.head};this.length===0&&(this.tail=Yn),this.head=Yn,++this.length},Hn.prototype.shift=function(){if(this.length!==0){var Wn=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,Wn}},Hn.prototype.clear=function(){this.head=this.tail=null,this.length=0},Hn.prototype.join=function(Wn){if(this.length===0)return"";for(var Yn=this.head,hi=""+Yn.data;Yn=Yn.next;)hi+=Wn+Yn.data;return hi},Hn.prototype.concat=function(Wn){if(this.length===0)return Rn.alloc(0);for(var Yn=Rn.allocUnsafe(Wn>>>0),hi=this.head,vi=0;hi;)Ln(hi.data,Yn,vi),vi+=hi.data.length,hi=hi.next;return Yn},Hn}(),Mn&&Mn.inspect&&Mn.inspect.custom&&(on.exports.prototype[Mn.inspect.custom]=function(){var Hn=Mn.inspect({length:this.length});return this.constructor.name+" "+Hn})}(BufferList)),BufferList.exports}var destroy_1,hasRequiredDestroy;function requireDestroy(){if(hasRequiredDestroy)return destroy_1;hasRequiredDestroy=1;var on=requireProcessNextickArgs();function In(Ln,Hn){var jn=this,Wn=this._readableState&&this._readableState.destroyed,Yn=this._writableState&&this._writableState.destroyed;return Wn||Yn?(Hn?Hn(Ln):Ln&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,on.nextTick(Mn,this,Ln)):on.nextTick(Mn,this,Ln)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(Ln||null,function(hi){!Hn&&hi?jn._writableState?jn._writableState.errorEmitted||(jn._writableState.errorEmitted=!0,on.nextTick(Mn,jn,hi)):on.nextTick(Mn,jn,hi):Hn&&Hn(hi)}),this)}function Rn(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Mn(Ln,Hn){Ln.emit("error",Hn)}return destroy_1={destroy:In,undestroy:Rn},destroy_1}var _stream_writable,hasRequired_stream_writable;function require_stream_writable(){if(hasRequired_stream_writable)return _stream_writable;hasRequired_stream_writable=1;var on=requireProcessNextickArgs();_stream_writable=Ei;function In(Bi){var Hi=this;this.next=null,this.entry=null,this.finish=function(){ki(Hi,Bi)}}var Rn=!process$1.browser&&["v0.10","v0.9."].indexOf(process$1.version.slice(0,5))>-1?setImmediate:on.nextTick,Mn;Ei.WritableState=yi;var Ln=Object.create(requireUtil());Ln.inherits=requireInherits_browser();var Hn={deprecate:requireBrowser$c()},jn=requireStreamBrowser(),Wn=requireSafeBuffer().Buffer,Yn=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function hi(Bi){return Wn.from(Bi)}function vi(Bi){return Wn.isBuffer(Bi)||Bi instanceof Yn}var gi=requireDestroy();Ln.inherits(Ei,jn);function mi(){}function yi(Bi,Hi){Mn=Mn||require_stream_duplex(),Bi=Bi||{};var Ki=Hi instanceof Mn;this.objectMode=!!Bi.objectMode,Ki&&(this.objectMode=this.objectMode||!!Bi.writableObjectMode);var ji=Bi.highWaterMark,Fi=Bi.writableHighWaterMark,$i=this.objectMode?16:16*1024;ji||ji===0?this.highWaterMark=ji:Ki&&(Fi||Fi===0)?this.highWaterMark=Fi:this.highWaterMark=$i,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Wi=Bi.decodeStrings===!1;this.decodeStrings=!Wi,this.defaultEncoding=Bi.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(Qi){Vi(Hi,Qi)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new In(this)}yi.prototype.getBuffer=function(){for(var Hi=this.bufferedRequest,Ki=[];Hi;)Ki.push(Hi),Hi=Hi.next;return Ki},function(){try{Object.defineProperty(yi.prototype,"buffer",{get:Hn.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var bi;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(bi=Function.prototype[Symbol.hasInstance],Object.defineProperty(Ei,Symbol.hasInstance,{value:function(Bi){return bi.call(this,Bi)?!0:this!==Ei?!1:Bi&&Bi._writableState instanceof yi}})):bi=function(Bi){return Bi instanceof this};function Ei(Bi){if(Mn=Mn||require_stream_duplex(),!bi.call(Ei,this)&&!(this instanceof Mn))return new Ei(Bi);this._writableState=new yi(Bi,this),this.writable=!0,Bi&&(typeof Bi.write=="function"&&(this._write=Bi.write),typeof Bi.writev=="function"&&(this._writev=Bi.writev),typeof Bi.destroy=="function"&&(this._destroy=Bi.destroy),typeof Bi.final=="function"&&(this._final=Bi.final)),jn.call(this)}Ei.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function _i(Bi,Hi){var Ki=new Error("write after end");Bi.emit("error",Ki),on.nextTick(Hi,Ki)}function xi(Bi,Hi,Ki,ji){var Fi=!0,$i=!1;return Ki===null?$i=new TypeError("May not write null values to stream"):typeof Ki!="string"&&Ki!==void 0&&!Hi.objectMode&&($i=new TypeError("Invalid non-string/buffer chunk")),$i&&(Bi.emit("error",$i),on.nextTick(ji,$i),Fi=!1),Fi}Ei.prototype.write=function(Bi,Hi,Ki){var ji=this._writableState,Fi=!1,$i=!ji.objectMode&&vi(Bi);return $i&&!Wn.isBuffer(Bi)&&(Bi=hi(Bi)),typeof Hi=="function"&&(Ki=Hi,Hi=null),$i?Hi="buffer":Hi||(Hi=ji.defaultEncoding),typeof Ki!="function"&&(Ki=mi),ji.ended?_i(this,Ki):($i||xi(this,ji,Bi,Ki))&&(ji.pendingcb++,Fi=Ai(this,ji,$i,Bi,Hi,Ki)),Fi},Ei.prototype.cork=function(){var Bi=this._writableState;Bi.corked++},Ei.prototype.uncork=function(){var Bi=this._writableState;Bi.corked&&(Bi.corked--,!Bi.writing&&!Bi.corked&&!Bi.bufferProcessing&&Bi.bufferedRequest&&Yi(this,Bi))},Ei.prototype.setDefaultEncoding=function(Hi){if(typeof Hi=="string"&&(Hi=Hi.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((Hi+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+Hi);return this._writableState.defaultEncoding=Hi,this};function Ci(Bi,Hi,Ki){return!Bi.objectMode&&Bi.decodeStrings!==!1&&typeof Hi=="string"&&(Hi=Wn.from(Hi,Ki)),Hi}Object.defineProperty(Ei.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Ai(Bi,Hi,Ki,ji,Fi,$i){if(!Ki){var Wi=Ci(Hi,ji,Fi);ji!==Wi&&(Ki=!0,Fi="buffer",ji=Wi)}var Qi=Hi.objectMode?1:ji.length;Hi.length+=Qi;var ea=Hi.length<Hi.highWaterMark;if(ea||(Hi.needDrain=!0),Hi.writing||Hi.corked){var na=Hi.lastBufferedRequest;Hi.lastBufferedRequest={chunk:ji,encoding:Fi,isBuf:Ki,callback:$i,next:null},na?na.next=Hi.lastBufferedRequest:Hi.bufferedRequest=Hi.lastBufferedRequest,Hi.bufferedRequestCount+=1}else Ii(Bi,Hi,!1,Qi,ji,Fi,$i);return ea}function Ii(Bi,Hi,Ki,ji,Fi,$i,Wi){Hi.writelen=ji,Hi.writecb=Wi,Hi.writing=!0,Hi.sync=!0,Ki?Bi._writev(Fi,Hi.onwrite):Bi._write(Fi,$i,Hi.onwrite),Hi.sync=!1}function Ni(Bi,Hi,Ki,ji,Fi){--Hi.pendingcb,Ki?(on.nextTick(Fi,ji),on.nextTick(wi,Bi,Hi),Bi._writableState.errorEmitted=!0,Bi.emit("error",ji)):(Fi(ji),Bi._writableState.errorEmitted=!0,Bi.emit("error",ji),wi(Bi,Hi))}function Pi(Bi){Bi.writing=!1,Bi.writecb=null,Bi.length-=Bi.writelen,Bi.writelen=0}function Vi(Bi,Hi){var Ki=Bi._writableState,ji=Ki.sync,Fi=Ki.writecb;if(Pi(Ki),Hi)Ni(Bi,Ki,ji,Hi,Fi);else{var $i=zi(Ki);!$i&&!Ki.corked&&!Ki.bufferProcessing&&Ki.bufferedRequest&&Yi(Bi,Ki),ji?Rn(Ui,Bi,Ki,$i,Fi):Ui(Bi,Ki,$i,Fi)}}function Ui(Bi,Hi,Ki,ji){Ki||Gi(Bi,Hi),Hi.pendingcb--,ji(),wi(Bi,Hi)}function Gi(Bi,Hi){Hi.length===0&&Hi.needDrain&&(Hi.needDrain=!1,Bi.emit("drain"))}function Yi(Bi,Hi){Hi.bufferProcessing=!0;var Ki=Hi.bufferedRequest;if(Bi._writev&&Ki&&Ki.next){var ji=Hi.bufferedRequestCount,Fi=new Array(ji),$i=Hi.corkedRequestsFree;$i.entry=Ki;for(var Wi=0,Qi=!0;Ki;)Fi[Wi]=Ki,Ki.isBuf||(Qi=!1),Ki=Ki.next,Wi+=1;Fi.allBuffers=Qi,Ii(Bi,Hi,!0,Hi.length,Fi,"",$i.finish),Hi.pendingcb++,Hi.lastBufferedRequest=null,$i.next?(Hi.corkedRequestsFree=$i.next,$i.next=null):Hi.corkedRequestsFree=new In(Hi),Hi.bufferedRequestCount=0}else{for(;Ki;){var ea=Ki.chunk,na=Ki.encoding,Ji=Ki.callback,ra=Hi.objectMode?1:ea.length;if(Ii(Bi,Hi,!1,ra,ea,na,Ji),Ki=Ki.next,Hi.bufferedRequestCount--,Hi.writing)break}Ki===null&&(Hi.lastBufferedRequest=null)}Hi.bufferedRequest=Ki,Hi.bufferProcessing=!1}Ei.prototype._write=function(Bi,Hi,Ki){Ki(new Error("_write() is not implemented"))},Ei.prototype._writev=null,Ei.prototype.end=function(Bi,Hi,Ki){var ji=this._writableState;typeof Bi=="function"?(Ki=Bi,Bi=null,Hi=null):typeof Hi=="function"&&(Ki=Hi,Hi=null),Bi!=null&&this.write(Bi,Hi),ji.corked&&(ji.corked=1,this.uncork()),ji.ending||Ri(this,ji,Ki)};function zi(Bi){return Bi.ending&&Bi.length===0&&Bi.bufferedRequest===null&&!Bi.finished&&!Bi.writing}function Mi(Bi,Hi){Bi._final(function(Ki){Hi.pendingcb--,Ki&&Bi.emit("error",Ki),Hi.prefinished=!0,Bi.emit("prefinish"),wi(Bi,Hi)})}function Li(Bi,Hi){!Hi.prefinished&&!Hi.finalCalled&&(typeof Bi._final=="function"?(Hi.pendingcb++,Hi.finalCalled=!0,on.nextTick(Mi,Bi,Hi)):(Hi.prefinished=!0,Bi.emit("prefinish")))}function wi(Bi,Hi){var Ki=zi(Hi);return Ki&&(Li(Bi,Hi),Hi.pendingcb===0&&(Hi.finished=!0,Bi.emit("finish"))),Ki}function Ri(Bi,Hi,Ki){Hi.ending=!0,wi(Bi,Hi),Ki&&(Hi.finished?on.nextTick(Ki):Bi.once("finish",Ki)),Hi.ended=!0,Bi.writable=!1}function ki(Bi,Hi,Ki){var ji=Bi.entry;for(Bi.entry=null;ji;){var Fi=ji.callback;Hi.pendingcb--,Fi(Ki),ji=ji.next}Hi.corkedRequestsFree.next=Bi}return Object.defineProperty(Ei.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(Bi){this._writableState&&(this._writableState.destroyed=Bi)}}),Ei.prototype.destroy=gi.destroy,Ei.prototype._undestroy=gi.undestroy,Ei.prototype._destroy=function(Bi,Hi){this.end(),Hi(Bi)},_stream_writable}var _stream_duplex,hasRequired_stream_duplex;function require_stream_duplex(){if(hasRequired_stream_duplex)return _stream_duplex;hasRequired_stream_duplex=1;var on=requireProcessNextickArgs(),In=Object.keys||function(gi){var mi=[];for(var yi in gi)mi.push(yi);return mi};_stream_duplex=Yn;var Rn=Object.create(requireUtil());Rn.inherits=requireInherits_browser();var Mn=require_stream_readable(),Ln=require_stream_writable();Rn.inherits(Yn,Mn);for(var Hn=In(Ln.prototype),jn=0;jn<Hn.length;jn++){var Wn=Hn[jn];Yn.prototype[Wn]||(Yn.prototype[Wn]=Ln.prototype[Wn])}function Yn(gi){if(!(this instanceof Yn))return new Yn(gi);Mn.call(this,gi),Ln.call(this,gi),gi&&gi.readable===!1&&(this.readable=!1),gi&&gi.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,gi&&gi.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",hi)}Object.defineProperty(Yn.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function hi(){this.allowHalfOpen||this._writableState.ended||on.nextTick(vi,this)}function vi(gi){gi.end()}return Object.defineProperty(Yn.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(gi){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=gi,this._writableState.destroyed=gi)}}),Yn.prototype._destroy=function(gi,mi){this.push(null),this.end(),on.nextTick(mi,gi)},_stream_duplex}var _stream_readable,hasRequired_stream_readable;function require_stream_readable(){if(hasRequired_stream_readable)return _stream_readable;hasRequired_stream_readable=1;var on=requireProcessNextickArgs();_stream_readable=Ci;var In=requireIsarray(),Rn;Ci.ReadableState=xi,requireEvents().EventEmitter;var Mn=function(Ji,ra){return Ji.listeners(ra).length},Ln=requireStreamBrowser(),Hn=requireSafeBuffer().Buffer,jn=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Wn(Ji){return Hn.from(Ji)}function Yn(Ji){return Hn.isBuffer(Ji)||Ji instanceof jn}var hi=Object.create(requireUtil());hi.inherits=requireInherits_browser();var vi=requireUtil$1(),gi=void 0;vi&&vi.debuglog?gi=vi.debuglog("stream"):gi=function(){};var mi=requireBufferList(),yi=requireDestroy(),bi;hi.inherits(Ci,Ln);var Ei=["error","close","destroy","pause","resume"];function _i(Ji,ra,sa){if(typeof Ji.prependListener=="function")return Ji.prependListener(ra,sa);!Ji._events||!Ji._events[ra]?Ji.on(ra,sa):In(Ji._events[ra])?Ji._events[ra].unshift(sa):Ji._events[ra]=[sa,Ji._events[ra]]}function xi(Ji,ra){Rn=Rn||require_stream_duplex(),Ji=Ji||{};var sa=ra instanceof Rn;this.objectMode=!!Ji.objectMode,sa&&(this.objectMode=this.objectMode||!!Ji.readableObjectMode);var la=Ji.highWaterMark,aa=Ji.readableHighWaterMark,ta=this.objectMode?16:16*1024;la||la===0?this.highWaterMark=la:sa&&(aa||aa===0)?this.highWaterMark=aa:this.highWaterMark=ta,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new mi,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=Ji.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,Ji.encoding&&(bi||(bi=requireString_decoder().StringDecoder),this.decoder=new bi(Ji.encoding),this.encoding=Ji.encoding)}function Ci(Ji){if(Rn=Rn||require_stream_duplex(),!(this instanceof Ci))return new Ci(Ji);this._readableState=new xi(Ji,this),this.readable=!0,Ji&&(typeof Ji.read=="function"&&(this._read=Ji.read),typeof Ji.destroy=="function"&&(this._destroy=Ji.destroy)),Ln.call(this)}Object.defineProperty(Ci.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(Ji){this._readableState&&(this._readableState.destroyed=Ji)}}),Ci.prototype.destroy=yi.destroy,Ci.prototype._undestroy=yi.undestroy,Ci.prototype._destroy=function(Ji,ra){this.push(null),ra(Ji)},Ci.prototype.push=function(Ji,ra){var sa=this._readableState,la;return sa.objectMode?la=!0:typeof Ji=="string"&&(ra=ra||sa.defaultEncoding,ra!==sa.encoding&&(Ji=Hn.from(Ji,ra),ra=""),la=!0),Ai(this,Ji,ra,!1,la)},Ci.prototype.unshift=function(Ji){return Ai(this,Ji,null,!0,!1)};function Ai(Ji,ra,sa,la,aa){var ta=Ji._readableState;if(ra===null)ta.reading=!1,Yi(Ji,ta);else{var fa;aa||(fa=Ni(ta,ra)),fa?Ji.emit("error",fa):ta.objectMode||ra&&ra.length>0?(typeof ra!="string"&&!ta.objectMode&&Object.getPrototypeOf(ra)!==Hn.prototype&&(ra=Wn(ra)),la?ta.endEmitted?Ji.emit("error",new Error("stream.unshift() after end event")):Ii(Ji,ta,ra,!0):ta.ended?Ji.emit("error",new Error("stream.push() after EOF")):(ta.reading=!1,ta.decoder&&!sa?(ra=ta.decoder.write(ra),ta.objectMode||ra.length!==0?Ii(Ji,ta,ra,!1):Li(Ji,ta)):Ii(Ji,ta,ra,!1))):la||(ta.reading=!1)}return Pi(ta)}function Ii(Ji,ra,sa,la){ra.flowing&&ra.length===0&&!ra.sync?(Ji.emit("data",sa),Ji.read(0)):(ra.length+=ra.objectMode?1:sa.length,la?ra.buffer.unshift(sa):ra.buffer.push(sa),ra.needReadable&&zi(Ji)),Li(Ji,ra)}function Ni(Ji,ra){var sa;return!Yn(ra)&&typeof ra!="string"&&ra!==void 0&&!Ji.objectMode&&(sa=new TypeError("Invalid non-string/buffer chunk")),sa}function Pi(Ji){return!Ji.ended&&(Ji.needReadable||Ji.length<Ji.highWaterMark||Ji.length===0)}Ci.prototype.isPaused=function(){return this._readableState.flowing===!1},Ci.prototype.setEncoding=function(Ji){return bi||(bi=requireString_decoder().StringDecoder),this._readableState.decoder=new bi(Ji),this._readableState.encoding=Ji,this};var Vi=8388608;function Ui(Ji){return Ji>=Vi?Ji=Vi:(Ji--,Ji|=Ji>>>1,Ji|=Ji>>>2,Ji|=Ji>>>4,Ji|=Ji>>>8,Ji|=Ji>>>16,Ji++),Ji}function Gi(Ji,ra){return Ji<=0||ra.length===0&&ra.ended?0:ra.objectMode?1:Ji!==Ji?ra.flowing&&ra.length?ra.buffer.head.data.length:ra.length:(Ji>ra.highWaterMark&&(ra.highWaterMark=Ui(Ji)),Ji<=ra.length?Ji:ra.ended?ra.length:(ra.needReadable=!0,0))}Ci.prototype.read=function(Ji){gi("read",Ji),Ji=parseInt(Ji,10);var ra=this._readableState,sa=Ji;if(Ji!==0&&(ra.emittedReadable=!1),Ji===0&&ra.needReadable&&(ra.length>=ra.highWaterMark||ra.ended))return gi("read: emitReadable",ra.length,ra.ended),ra.length===0&&ra.ended?Qi(this):zi(this),null;if(Ji=Gi(Ji,ra),Ji===0&&ra.ended)return ra.length===0&&Qi(this),null;var la=ra.needReadable;gi("need readable",la),(ra.length===0||ra.length-Ji<ra.highWaterMark)&&(la=!0,gi("length less than watermark",la)),ra.ended||ra.reading?(la=!1,gi("reading or ended",la)):la&&(gi("do read"),ra.reading=!0,ra.sync=!0,ra.length===0&&(ra.needReadable=!0),this._read(ra.highWaterMark),ra.sync=!1,ra.reading||(Ji=Gi(sa,ra)));var aa;return Ji>0?aa=ji(Ji,ra):aa=null,aa===null?(ra.needReadable=!0,Ji=0):ra.length-=Ji,ra.length===0&&(ra.ended||(ra.needReadable=!0),sa!==Ji&&ra.ended&&Qi(this)),aa!==null&&this.emit("data",aa),aa};function Yi(Ji,ra){if(!ra.ended){if(ra.decoder){var sa=ra.decoder.end();sa&&sa.length&&(ra.buffer.push(sa),ra.length+=ra.objectMode?1:sa.length)}ra.ended=!0,zi(Ji)}}function zi(Ji){var ra=Ji._readableState;ra.needReadable=!1,ra.emittedReadable||(gi("emitReadable",ra.flowing),ra.emittedReadable=!0,ra.sync?on.nextTick(Mi,Ji):Mi(Ji))}function Mi(Ji){gi("emit readable"),Ji.emit("readable"),Ki(Ji)}function Li(Ji,ra){ra.readingMore||(ra.readingMore=!0,on.nextTick(wi,Ji,ra))}function wi(Ji,ra){for(var sa=ra.length;!ra.reading&&!ra.flowing&&!ra.ended&&ra.length<ra.highWaterMark&&(gi("maybeReadMore read 0"),Ji.read(0),sa!==ra.length);)sa=ra.length;ra.readingMore=!1}Ci.prototype._read=function(Ji){this.emit("error",new Error("_read() is not implemented"))},Ci.prototype.pipe=function(Ji,ra){var sa=this,la=this._readableState;switch(la.pipesCount){case 0:la.pipes=Ji;break;case 1:la.pipes=[la.pipes,Ji];break;default:la.pipes.push(Ji);break}la.pipesCount+=1,gi("pipe count=%d opts=%j",la.pipesCount,ra);var aa=(!ra||ra.end!==!1)&&Ji!==process$1.stdout&&Ji!==process$1.stderr,ta=aa?ca:Ta;la.endEmitted?on.nextTick(ta):sa.once("end",ta),Ji.on("unpipe",fa);function fa(wa,Na){gi("onunpipe"),wa===sa&&Na&&Na.hasUnpiped===!1&&(Na.hasUnpiped=!0,xa())}function ca(){gi("onend"),Ji.end()}var pa=Ri(sa);Ji.on("drain",pa);var Ea=!1;function xa(){gi("cleanup"),Ji.removeListener("close",va),Ji.removeListener("finish",Sa),Ji.removeListener("drain",pa),Ji.removeListener("error",Aa),Ji.removeListener("unpipe",fa),sa.removeListener("end",ca),sa.removeListener("end",Ta),sa.removeListener("data",ma),Ea=!0,la.awaitDrain&&(!Ji._writableState||Ji._writableState.needDrain)&&pa()}var ga=!1;sa.on("data",ma);function ma(wa){gi("ondata"),ga=!1;var Na=Ji.write(wa);Na===!1&&!ga&&((la.pipesCount===1&&la.pipes===Ji||la.pipesCount>1&&na(la.pipes,Ji)!==-1)&&!Ea&&(gi("false write response, pause",la.awaitDrain),la.awaitDrain++,ga=!0),sa.pause())}function Aa(wa){gi("onerror",wa),Ta(),Ji.removeListener("error",Aa),Mn(Ji,"error")===0&&Ji.emit("error",wa)}_i(Ji,"error",Aa);function va(){Ji.removeListener("finish",Sa),Ta()}Ji.once("close",va);function Sa(){gi("onfinish"),Ji.removeListener("close",va),Ta()}Ji.once("finish",Sa);function Ta(){gi("unpipe"),sa.unpipe(Ji)}return Ji.emit("pipe",sa),la.flowing||(gi("pipe resume"),sa.resume()),Ji};function Ri(Ji){return function(){var ra=Ji._readableState;gi("pipeOnDrain",ra.awaitDrain),ra.awaitDrain&&ra.awaitDrain--,ra.awaitDrain===0&&Mn(Ji,"data")&&(ra.flowing=!0,Ki(Ji))}}Ci.prototype.unpipe=function(Ji){var ra=this._readableState,sa={hasUnpiped:!1};if(ra.pipesCount===0)return this;if(ra.pipesCount===1)return Ji&&Ji!==ra.pipes?this:(Ji||(Ji=ra.pipes),ra.pipes=null,ra.pipesCount=0,ra.flowing=!1,Ji&&Ji.emit("unpipe",this,sa),this);if(!Ji){var la=ra.pipes,aa=ra.pipesCount;ra.pipes=null,ra.pipesCount=0,ra.flowing=!1;for(var ta=0;ta<aa;ta++)la[ta].emit("unpipe",this,{hasUnpiped:!1});return this}var fa=na(ra.pipes,Ji);return fa===-1?this:(ra.pipes.splice(fa,1),ra.pipesCount-=1,ra.pipesCount===1&&(ra.pipes=ra.pipes[0]),Ji.emit("unpipe",this,sa),this)},Ci.prototype.on=function(Ji,ra){var sa=Ln.prototype.on.call(this,Ji,ra);if(Ji==="data")this._readableState.flowing!==!1&&this.resume();else if(Ji==="readable"){var la=this._readableState;!la.endEmitted&&!la.readableListening&&(la.readableListening=la.needReadable=!0,la.emittedReadable=!1,la.reading?la.length&&zi(this):on.nextTick(ki,this))}return sa},Ci.prototype.addListener=Ci.prototype.on;function ki(Ji){gi("readable nexttick read 0"),Ji.read(0)}Ci.prototype.resume=function(){var Ji=this._readableState;return Ji.flowing||(gi("resume"),Ji.flowing=!0,Bi(this,Ji)),this};function Bi(Ji,ra){ra.resumeScheduled||(ra.resumeScheduled=!0,on.nextTick(Hi,Ji,ra))}function Hi(Ji,ra){ra.reading||(gi("resume read 0"),Ji.read(0)),ra.resumeScheduled=!1,ra.awaitDrain=0,Ji.emit("resume"),Ki(Ji),ra.flowing&&!ra.reading&&Ji.read(0)}Ci.prototype.pause=function(){return gi("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(gi("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function Ki(Ji){var ra=Ji._readableState;for(gi("flow",ra.flowing);ra.flowing&&Ji.read()!==null;);}Ci.prototype.wrap=function(Ji){var ra=this,sa=this._readableState,la=!1;Ji.on("end",function(){if(gi("wrapped end"),sa.decoder&&!sa.ended){var fa=sa.decoder.end();fa&&fa.length&&ra.push(fa)}ra.push(null)}),Ji.on("data",function(fa){if(gi("wrapped data"),sa.decoder&&(fa=sa.decoder.write(fa)),!(sa.objectMode&&fa==null)&&!(!sa.objectMode&&(!fa||!fa.length))){var ca=ra.push(fa);ca||(la=!0,Ji.pause())}});for(var aa in Ji)this[aa]===void 0&&typeof Ji[aa]=="function"&&(this[aa]=function(fa){return function(){return Ji[fa].apply(Ji,arguments)}}(aa));for(var ta=0;ta<Ei.length;ta++)Ji.on(Ei[ta],this.emit.bind(this,Ei[ta]));return this._read=function(fa){gi("wrapped _read",fa),la&&(la=!1,Ji.resume())},this},Object.defineProperty(Ci.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Ci._fromList=ji;function ji(Ji,ra){if(ra.length===0)return null;var sa;return ra.objectMode?sa=ra.buffer.shift():!Ji||Ji>=ra.length?(ra.decoder?sa=ra.buffer.join(""):ra.buffer.length===1?sa=ra.buffer.head.data:sa=ra.buffer.concat(ra.length),ra.buffer.clear()):sa=Fi(Ji,ra.buffer,ra.decoder),sa}function Fi(Ji,ra,sa){var la;return Ji<ra.head.data.length?(la=ra.head.data.slice(0,Ji),ra.head.data=ra.head.data.slice(Ji)):Ji===ra.head.data.length?la=ra.shift():la=sa?$i(Ji,ra):Wi(Ji,ra),la}function $i(Ji,ra){var sa=ra.head,la=1,aa=sa.data;for(Ji-=aa.length;sa=sa.next;){var ta=sa.data,fa=Ji>ta.length?ta.length:Ji;if(fa===ta.length?aa+=ta:aa+=ta.slice(0,Ji),Ji-=fa,Ji===0){fa===ta.length?(++la,sa.next?ra.head=sa.next:ra.head=ra.tail=null):(ra.head=sa,sa.data=ta.slice(fa));break}++la}return ra.length-=la,aa}function Wi(Ji,ra){var sa=Hn.allocUnsafe(Ji),la=ra.head,aa=1;for(la.data.copy(sa),Ji-=la.data.length;la=la.next;){var ta=la.data,fa=Ji>ta.length?ta.length:Ji;if(ta.copy(sa,sa.length-Ji,0,fa),Ji-=fa,Ji===0){fa===ta.length?(++aa,la.next?ra.head=la.next:ra.head=ra.tail=null):(ra.head=la,la.data=ta.slice(fa));break}++aa}return ra.length-=aa,sa}function Qi(Ji){var ra=Ji._readableState;if(ra.length>0)throw new Error('"endReadable()" called on non-empty stream');ra.endEmitted||(ra.ended=!0,on.nextTick(ea,ra,Ji))}function ea(Ji,ra){!Ji.endEmitted&&Ji.length===0&&(Ji.endEmitted=!0,ra.readable=!1,ra.emit("end"))}function na(Ji,ra){for(var sa=0,la=Ji.length;sa<la;sa++)if(Ji[sa]===ra)return sa;return-1}return _stream_readable}var _stream_transform,hasRequired_stream_transform;function require_stream_transform(){if(hasRequired_stream_transform)return _stream_transform;hasRequired_stream_transform=1,_stream_transform=Mn;var on=require_stream_duplex(),In=Object.create(requireUtil());In.inherits=requireInherits_browser(),In.inherits(Mn,on);function Rn(jn,Wn){var Yn=this._transformState;Yn.transforming=!1;var hi=Yn.writecb;if(!hi)return this.emit("error",new Error("write callback called multiple times"));Yn.writechunk=null,Yn.writecb=null,Wn!=null&&this.push(Wn),hi(jn);var vi=this._readableState;vi.reading=!1,(vi.needReadable||vi.length<vi.highWaterMark)&&this._read(vi.highWaterMark)}function Mn(jn){if(!(this instanceof Mn))return new Mn(jn);on.call(this,jn),this._transformState={afterTransform:Rn.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,jn&&(typeof jn.transform=="function"&&(this._transform=jn.transform),typeof jn.flush=="function"&&(this._flush=jn.flush)),this.on("prefinish",Ln)}function Ln(){var jn=this;typeof this._flush=="function"?this._flush(function(Wn,Yn){Hn(jn,Wn,Yn)}):Hn(this,null,null)}Mn.prototype.push=function(jn,Wn){return this._transformState.needTransform=!1,on.prototype.push.call(this,jn,Wn)},Mn.prototype._transform=function(jn,Wn,Yn){throw new Error("_transform() is not implemented")},Mn.prototype._write=function(jn,Wn,Yn){var hi=this._transformState;if(hi.writecb=Yn,hi.writechunk=jn,hi.writeencoding=Wn,!hi.transforming){var vi=this._readableState;(hi.needTransform||vi.needReadable||vi.length<vi.highWaterMark)&&this._read(vi.highWaterMark)}},Mn.prototype._read=function(jn){var Wn=this._transformState;Wn.writechunk!==null&&Wn.writecb&&!Wn.transforming?(Wn.transforming=!0,this._transform(Wn.writechunk,Wn.writeencoding,Wn.afterTransform)):Wn.needTransform=!0},Mn.prototype._destroy=function(jn,Wn){var Yn=this;on.prototype._destroy.call(this,jn,function(hi){Wn(hi),Yn.emit("close")})};function Hn(jn,Wn,Yn){if(Wn)return jn.emit("error",Wn);if(Yn!=null&&jn.push(Yn),jn._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(jn._transformState.transforming)throw new Error("Calling transform done when still transforming");return jn.push(null)}return _stream_transform}var _stream_passthrough,hasRequired_stream_passthrough;function require_stream_passthrough(){if(hasRequired_stream_passthrough)return _stream_passthrough;hasRequired_stream_passthrough=1,_stream_passthrough=Rn;var on=require_stream_transform(),In=Object.create(requireUtil());In.inherits=requireInherits_browser(),In.inherits(Rn,on);function Rn(Mn){if(!(this instanceof Rn))return new Rn(Mn);on.call(this,Mn)}return Rn.prototype._transform=function(Mn,Ln,Hn){Hn(null,Mn)},_stream_passthrough}var hasRequiredReadableBrowser;function requireReadableBrowser(){return hasRequiredReadableBrowser||(hasRequiredReadableBrowser=1,function(on,In){In=on.exports=require_stream_readable(),In.Stream=In,In.Readable=In,In.Writable=require_stream_writable(),In.Duplex=require_stream_duplex(),In.Transform=require_stream_transform(),In.PassThrough=require_stream_passthrough()}(readableBrowser,readableBrowser.exports)),readableBrowser.exports}var sign={exports:{}},bn$3={exports:{}},bn$2=bn$3.exports,hasRequiredBn$1;function requireBn$1(){return hasRequiredBn$1||(hasRequiredBn$1=1,function(on){(function(In,Rn){function Mn(Li,wi){if(!Li)throw new Error(wi||"Assertion failed")}function Ln(Li,wi){Li.super_=wi;var Ri=function(){};Ri.prototype=wi.prototype,Li.prototype=new Ri,Li.prototype.constructor=Li}function Hn(Li,wi,Ri){if(Hn.isBN(Li))return Li;this.negative=0,this.words=null,this.length=0,this.red=null,Li!==null&&((wi==="le"||wi==="be")&&(Ri=wi,wi=10),this._init(Li||0,wi||10,Ri||"be"))}typeof In=="object"?In.exports=Hn:Rn.BN=Hn,Hn.BN=Hn,Hn.wordSize=26;var jn;try{typeof window<"u"&&typeof window.Buffer<"u"?jn=window.Buffer:jn=requireDist().Buffer}catch{}Hn.isBN=function(wi){return wi instanceof Hn?!0:wi!==null&&typeof wi=="object"&&wi.constructor.wordSize===Hn.wordSize&&Array.isArray(wi.words)},Hn.max=function(wi,Ri){return wi.cmp(Ri)>0?wi:Ri},Hn.min=function(wi,Ri){return wi.cmp(Ri)<0?wi:Ri},Hn.prototype._init=function(wi,Ri,ki){if(typeof wi=="number")return this._initNumber(wi,Ri,ki);if(typeof wi=="object")return this._initArray(wi,Ri,ki);Ri==="hex"&&(Ri=16),Mn(Ri===(Ri|0)&&Ri>=2&&Ri<=36),wi=wi.toString().replace(/\s+/g,"");var Bi=0;wi[0]==="-"&&(Bi++,this.negative=1),Bi<wi.length&&(Ri===16?this._parseHex(wi,Bi,ki):(this._parseBase(wi,Ri,Bi),ki==="le"&&this._initArray(this.toArray(),Ri,ki)))},Hn.prototype._initNumber=function(wi,Ri,ki){wi<0&&(this.negative=1,wi=-wi),wi<67108864?(this.words=[wi&67108863],this.length=1):wi<4503599627370496?(this.words=[wi&67108863,wi/67108864&67108863],this.length=2):(Mn(wi<9007199254740992),this.words=[wi&67108863,wi/67108864&67108863,1],this.length=3),ki==="le"&&this._initArray(this.toArray(),Ri,ki)},Hn.prototype._initArray=function(wi,Ri,ki){if(Mn(typeof wi.length=="number"),wi.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(wi.length/3),this.words=new Array(this.length);for(var Bi=0;Bi<this.length;Bi++)this.words[Bi]=0;var Hi,Ki,ji=0;if(ki==="be")for(Bi=wi.length-1,Hi=0;Bi>=0;Bi-=3)Ki=wi[Bi]|wi[Bi-1]<<8|wi[Bi-2]<<16,this.words[Hi]|=Ki<<ji&67108863,this.words[Hi+1]=Ki>>>26-ji&67108863,ji+=24,ji>=26&&(ji-=26,Hi++);else if(ki==="le")for(Bi=0,Hi=0;Bi<wi.length;Bi+=3)Ki=wi[Bi]|wi[Bi+1]<<8|wi[Bi+2]<<16,this.words[Hi]|=Ki<<ji&67108863,this.words[Hi+1]=Ki>>>26-ji&67108863,ji+=24,ji>=26&&(ji-=26,Hi++);return this._strip()};function Wn(Li,wi){var Ri=Li.charCodeAt(wi);if(Ri>=48&&Ri<=57)return Ri-48;if(Ri>=65&&Ri<=70)return Ri-55;if(Ri>=97&&Ri<=102)return Ri-87;Mn(!1,"Invalid character in "+Li)}function Yn(Li,wi,Ri){var ki=Wn(Li,Ri);return Ri-1>=wi&&(ki|=Wn(Li,Ri-1)<<4),ki}Hn.prototype._parseHex=function(wi,Ri,ki){this.length=Math.ceil((wi.length-Ri)/6),this.words=new Array(this.length);for(var Bi=0;Bi<this.length;Bi++)this.words[Bi]=0;var Hi=0,Ki=0,ji;if(ki==="be")for(Bi=wi.length-1;Bi>=Ri;Bi-=2)ji=Yn(wi,Ri,Bi)<<Hi,this.words[Ki]|=ji&67108863,Hi>=18?(Hi-=18,Ki+=1,this.words[Ki]|=ji>>>26):Hi+=8;else{var Fi=wi.length-Ri;for(Bi=Fi%2===0?Ri+1:Ri;Bi<wi.length;Bi+=2)ji=Yn(wi,Ri,Bi)<<Hi,this.words[Ki]|=ji&67108863,Hi>=18?(Hi-=18,Ki+=1,this.words[Ki]|=ji>>>26):Hi+=8}this._strip()};function hi(Li,wi,Ri,ki){for(var Bi=0,Hi=0,Ki=Math.min(Li.length,Ri),ji=wi;ji<Ki;ji++){var Fi=Li.charCodeAt(ji)-48;Bi*=ki,Fi>=49?Hi=Fi-49+10:Fi>=17?Hi=Fi-17+10:Hi=Fi,Mn(Fi>=0&&Hi<ki,"Invalid character"),Bi+=Hi}return Bi}Hn.prototype._parseBase=function(wi,Ri,ki){this.words=[0],this.length=1;for(var Bi=0,Hi=1;Hi<=67108863;Hi*=Ri)Bi++;Bi--,Hi=Hi/Ri|0;for(var Ki=wi.length-ki,ji=Ki%Bi,Fi=Math.min(Ki,Ki-ji)+ki,$i=0,Wi=ki;Wi<Fi;Wi+=Bi)$i=hi(wi,Wi,Wi+Bi,Ri),this.imuln(Hi),this.words[0]+$i<67108864?this.words[0]+=$i:this._iaddn($i);if(ji!==0){var Qi=1;for($i=hi(wi,Wi,wi.length,Ri),Wi=0;Wi<ji;Wi++)Qi*=Ri;this.imuln(Qi),this.words[0]+$i<67108864?this.words[0]+=$i:this._iaddn($i)}this._strip()},Hn.prototype.copy=function(wi){wi.words=new Array(this.length);for(var Ri=0;Ri<this.length;Ri++)wi.words[Ri]=this.words[Ri];wi.length=this.length,wi.negative=this.negative,wi.red=this.red};function vi(Li,wi){Li.words=wi.words,Li.length=wi.length,Li.negative=wi.negative,Li.red=wi.red}if(Hn.prototype._move=function(wi){vi(wi,this)},Hn.prototype.clone=function(){var wi=new Hn(null);return this.copy(wi),wi},Hn.prototype._expand=function(wi){for(;this.length<wi;)this.words[this.length++]=0;return this},Hn.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},Hn.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{Hn.prototype[Symbol.for("nodejs.util.inspect.custom")]=gi}catch{Hn.prototype.inspect=gi}else Hn.prototype.inspect=gi;function gi(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var mi=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],yi=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],bi=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];Hn.prototype.toString=function(wi,Ri){wi=wi||10,Ri=Ri|0||1;var ki;if(wi===16||wi==="hex"){ki="";for(var Bi=0,Hi=0,Ki=0;Ki<this.length;Ki++){var ji=this.words[Ki],Fi=((ji<<Bi|Hi)&16777215).toString(16);Hi=ji>>>24-Bi&16777215,Bi+=2,Bi>=26&&(Bi-=26,Ki--),Hi!==0||Ki!==this.length-1?ki=mi[6-Fi.length]+Fi+ki:ki=Fi+ki}for(Hi!==0&&(ki=Hi.toString(16)+ki);ki.length%Ri!==0;)ki="0"+ki;return this.negative!==0&&(ki="-"+ki),ki}if(wi===(wi|0)&&wi>=2&&wi<=36){var $i=yi[wi],Wi=bi[wi];ki="";var Qi=this.clone();for(Qi.negative=0;!Qi.isZero();){var ea=Qi.modrn(Wi).toString(wi);Qi=Qi.idivn(Wi),Qi.isZero()?ki=ea+ki:ki=mi[$i-ea.length]+ea+ki}for(this.isZero()&&(ki="0"+ki);ki.length%Ri!==0;)ki="0"+ki;return this.negative!==0&&(ki="-"+ki),ki}Mn(!1,"Base should be between 2 and 36")},Hn.prototype.toNumber=function(){var wi=this.words[0];return this.length===2?wi+=this.words[1]*67108864:this.length===3&&this.words[2]===1?wi+=4503599627370496+this.words[1]*67108864:this.length>2&&Mn(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-wi:wi},Hn.prototype.toJSON=function(){return this.toString(16,2)},jn&&(Hn.prototype.toBuffer=function(wi,Ri){return this.toArrayLike(jn,wi,Ri)}),Hn.prototype.toArray=function(wi,Ri){return this.toArrayLike(Array,wi,Ri)};var Ei=function(wi,Ri){return wi.allocUnsafe?wi.allocUnsafe(Ri):new wi(Ri)};Hn.prototype.toArrayLike=function(wi,Ri,ki){this._strip();var Bi=this.byteLength(),Hi=ki||Math.max(1,Bi);Mn(Bi<=Hi,"byte array longer than desired length"),Mn(Hi>0,"Requested array length <= 0");var Ki=Ei(wi,Hi),ji=Ri==="le"?"LE":"BE";return this["_toArrayLike"+ji](Ki,Bi),Ki},Hn.prototype._toArrayLikeLE=function(wi,Ri){for(var ki=0,Bi=0,Hi=0,Ki=0;Hi<this.length;Hi++){var ji=this.words[Hi]<<Ki|Bi;wi[ki++]=ji&255,ki<wi.length&&(wi[ki++]=ji>>8&255),ki<wi.length&&(wi[ki++]=ji>>16&255),Ki===6?(ki<wi.length&&(wi[ki++]=ji>>24&255),Bi=0,Ki=0):(Bi=ji>>>24,Ki+=2)}if(ki<wi.length)for(wi[ki++]=Bi;ki<wi.length;)wi[ki++]=0},Hn.prototype._toArrayLikeBE=function(wi,Ri){for(var ki=wi.length-1,Bi=0,Hi=0,Ki=0;Hi<this.length;Hi++){var ji=this.words[Hi]<<Ki|Bi;wi[ki--]=ji&255,ki>=0&&(wi[ki--]=ji>>8&255),ki>=0&&(wi[ki--]=ji>>16&255),Ki===6?(ki>=0&&(wi[ki--]=ji>>24&255),Bi=0,Ki=0):(Bi=ji>>>24,Ki+=2)}if(ki>=0)for(wi[ki--]=Bi;ki>=0;)wi[ki--]=0},Math.clz32?Hn.prototype._countBits=function(wi){return 32-Math.clz32(wi)}:Hn.prototype._countBits=function(wi){var Ri=wi,ki=0;return Ri>=4096&&(ki+=13,Ri>>>=13),Ri>=64&&(ki+=7,Ri>>>=7),Ri>=8&&(ki+=4,Ri>>>=4),Ri>=2&&(ki+=2,Ri>>>=2),ki+Ri},Hn.prototype._zeroBits=function(wi){if(wi===0)return 26;var Ri=wi,ki=0;return(Ri&8191)===0&&(ki+=13,Ri>>>=13),(Ri&127)===0&&(ki+=7,Ri>>>=7),(Ri&15)===0&&(ki+=4,Ri>>>=4),(Ri&3)===0&&(ki+=2,Ri>>>=2),(Ri&1)===0&&ki++,ki},Hn.prototype.bitLength=function(){var wi=this.words[this.length-1],Ri=this._countBits(wi);return(this.length-1)*26+Ri};function _i(Li){for(var wi=new Array(Li.bitLength()),Ri=0;Ri<wi.length;Ri++){var ki=Ri/26|0,Bi=Ri%26;wi[Ri]=Li.words[ki]>>>Bi&1}return wi}Hn.prototype.zeroBits=function(){if(this.isZero())return 0;for(var wi=0,Ri=0;Ri<this.length;Ri++){var ki=this._zeroBits(this.words[Ri]);if(wi+=ki,ki!==26)break}return wi},Hn.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},Hn.prototype.toTwos=function(wi){return this.negative!==0?this.abs().inotn(wi).iaddn(1):this.clone()},Hn.prototype.fromTwos=function(wi){return this.testn(wi-1)?this.notn(wi).iaddn(1).ineg():this.clone()},Hn.prototype.isNeg=function(){return this.negative!==0},Hn.prototype.neg=function(){return this.clone().ineg()},Hn.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},Hn.prototype.iuor=function(wi){for(;this.length<wi.length;)this.words[this.length++]=0;for(var Ri=0;Ri<wi.length;Ri++)this.words[Ri]=this.words[Ri]|wi.words[Ri];return this._strip()},Hn.prototype.ior=function(wi){return Mn((this.negative|wi.negative)===0),this.iuor(wi)},Hn.prototype.or=function(wi){return this.length>wi.length?this.clone().ior(wi):wi.clone().ior(this)},Hn.prototype.uor=function(wi){return this.length>wi.length?this.clone().iuor(wi):wi.clone().iuor(this)},Hn.prototype.iuand=function(wi){var Ri;this.length>wi.length?Ri=wi:Ri=this;for(var ki=0;ki<Ri.length;ki++)this.words[ki]=this.words[ki]&wi.words[ki];return this.length=Ri.length,this._strip()},Hn.prototype.iand=function(wi){return Mn((this.negative|wi.negative)===0),this.iuand(wi)},Hn.prototype.and=function(wi){return this.length>wi.length?this.clone().iand(wi):wi.clone().iand(this)},Hn.prototype.uand=function(wi){return this.length>wi.length?this.clone().iuand(wi):wi.clone().iuand(this)},Hn.prototype.iuxor=function(wi){var Ri,ki;this.length>wi.length?(Ri=this,ki=wi):(Ri=wi,ki=this);for(var Bi=0;Bi<ki.length;Bi++)this.words[Bi]=Ri.words[Bi]^ki.words[Bi];if(this!==Ri)for(;Bi<Ri.length;Bi++)this.words[Bi]=Ri.words[Bi];return this.length=Ri.length,this._strip()},Hn.prototype.ixor=function(wi){return Mn((this.negative|wi.negative)===0),this.iuxor(wi)},Hn.prototype.xor=function(wi){return this.length>wi.length?this.clone().ixor(wi):wi.clone().ixor(this)},Hn.prototype.uxor=function(wi){return this.length>wi.length?this.clone().iuxor(wi):wi.clone().iuxor(this)},Hn.prototype.inotn=function(wi){Mn(typeof wi=="number"&&wi>=0);var Ri=Math.ceil(wi/26)|0,ki=wi%26;this._expand(Ri),ki>0&&Ri--;for(var Bi=0;Bi<Ri;Bi++)this.words[Bi]=~this.words[Bi]&67108863;return ki>0&&(this.words[Bi]=~this.words[Bi]&67108863>>26-ki),this._strip()},Hn.prototype.notn=function(wi){return this.clone().inotn(wi)},Hn.prototype.setn=function(wi,Ri){Mn(typeof wi=="number"&&wi>=0);var ki=wi/26|0,Bi=wi%26;return this._expand(ki+1),Ri?this.words[ki]=this.words[ki]|1<<Bi:this.words[ki]=this.words[ki]&~(1<<Bi),this._strip()},Hn.prototype.iadd=function(wi){var Ri;if(this.negative!==0&&wi.negative===0)return this.negative=0,Ri=this.isub(wi),this.negative^=1,this._normSign();if(this.negative===0&&wi.negative!==0)return wi.negative=0,Ri=this.isub(wi),wi.negative=1,Ri._normSign();var ki,Bi;this.length>wi.length?(ki=this,Bi=wi):(ki=wi,Bi=this);for(var Hi=0,Ki=0;Ki<Bi.length;Ki++)Ri=(ki.words[Ki]|0)+(Bi.words[Ki]|0)+Hi,this.words[Ki]=Ri&67108863,Hi=Ri>>>26;for(;Hi!==0&&Ki<ki.length;Ki++)Ri=(ki.words[Ki]|0)+Hi,this.words[Ki]=Ri&67108863,Hi=Ri>>>26;if(this.length=ki.length,Hi!==0)this.words[this.length]=Hi,this.length++;else if(ki!==this)for(;Ki<ki.length;Ki++)this.words[Ki]=ki.words[Ki];return this},Hn.prototype.add=function(wi){var Ri;return wi.negative!==0&&this.negative===0?(wi.negative=0,Ri=this.sub(wi),wi.negative^=1,Ri):wi.negative===0&&this.negative!==0?(this.negative=0,Ri=wi.sub(this),this.negative=1,Ri):this.length>wi.length?this.clone().iadd(wi):wi.clone().iadd(this)},Hn.prototype.isub=function(wi){if(wi.negative!==0){wi.negative=0;var Ri=this.iadd(wi);return wi.negative=1,Ri._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(wi),this.negative=1,this._normSign();var ki=this.cmp(wi);if(ki===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Bi,Hi;ki>0?(Bi=this,Hi=wi):(Bi=wi,Hi=this);for(var Ki=0,ji=0;ji<Hi.length;ji++)Ri=(Bi.words[ji]|0)-(Hi.words[ji]|0)+Ki,Ki=Ri>>26,this.words[ji]=Ri&67108863;for(;Ki!==0&&ji<Bi.length;ji++)Ri=(Bi.words[ji]|0)+Ki,Ki=Ri>>26,this.words[ji]=Ri&67108863;if(Ki===0&&ji<Bi.length&&Bi!==this)for(;ji<Bi.length;ji++)this.words[ji]=Bi.words[ji];return this.length=Math.max(this.length,ji),Bi!==this&&(this.negative=1),this._strip()},Hn.prototype.sub=function(wi){return this.clone().isub(wi)};function xi(Li,wi,Ri){Ri.negative=wi.negative^Li.negative;var ki=Li.length+wi.length|0;Ri.length=ki,ki=ki-1|0;var Bi=Li.words[0]|0,Hi=wi.words[0]|0,Ki=Bi*Hi,ji=Ki&67108863,Fi=Ki/67108864|0;Ri.words[0]=ji;for(var $i=1;$i<ki;$i++){for(var Wi=Fi>>>26,Qi=Fi&67108863,ea=Math.min($i,wi.length-1),na=Math.max(0,$i-Li.length+1);na<=ea;na++){var Ji=$i-na|0;Bi=Li.words[Ji]|0,Hi=wi.words[na]|0,Ki=Bi*Hi+Qi,Wi+=Ki/67108864|0,Qi=Ki&67108863}Ri.words[$i]=Qi|0,Fi=Wi|0}return Fi!==0?Ri.words[$i]=Fi|0:Ri.length--,Ri._strip()}var Ci=function(wi,Ri,ki){var Bi=wi.words,Hi=Ri.words,Ki=ki.words,ji=0,Fi,$i,Wi,Qi=Bi[0]|0,ea=Qi&8191,na=Qi>>>13,Ji=Bi[1]|0,ra=Ji&8191,sa=Ji>>>13,la=Bi[2]|0,aa=la&8191,ta=la>>>13,fa=Bi[3]|0,ca=fa&8191,pa=fa>>>13,Ea=Bi[4]|0,xa=Ea&8191,ga=Ea>>>13,ma=Bi[5]|0,Aa=ma&8191,va=ma>>>13,Sa=Bi[6]|0,Ta=Sa&8191,wa=Sa>>>13,Na=Bi[7]|0,$a=Na&8191,Ma=Na>>>13,Ka=Bi[8]|0,Ga=Ka&8191,Ha=Ka>>>13,Ua=Bi[9]|0,vo=Ua&8191,Ja=Ua>>>13,bo=Hi[0]|0,es=bo&8191,Ya=bo>>>13,Xa=Hi[1]|0,To=Xa&8191,Wa=Xa>>>13,ls=Hi[2]|0,ns=ls&8191,Co=ls>>>13,cs=Hi[3]|0,os=cs&8191,So=cs>>>13,us=Hi[4]|0,Oo=us&8191,da=us>>>13,ia=Hi[5]|0,oa=ia&8191,ha=ia>>>13,Ca=Hi[6]|0,Ia=Ca&8191,Da=Ca>>>13,rs=Hi[7]|0,as=rs&8191,No=rs>>>13,ss=Hi[8]|0,Za=ss&8191,zo=ss>>>13,Ss=Hi[9]|0,vs=Ss&8191,gs=Ss>>>13;ki.negative=wi.negative^Ri.negative,ki.length=19,Fi=Math.imul(ea,es),$i=Math.imul(ea,Ya),$i=$i+Math.imul(na,es)|0,Wi=Math.imul(na,Ya);var Xs=(ji+Fi|0)+(($i&8191)<<13)|0;ji=(Wi+($i>>>13)|0)+(Xs>>>26)|0,Xs&=67108863,Fi=Math.imul(ra,es),$i=Math.imul(ra,Ya),$i=$i+Math.imul(sa,es)|0,Wi=Math.imul(sa,Ya),Fi=Fi+Math.imul(ea,To)|0,$i=$i+Math.imul(ea,Wa)|0,$i=$i+Math.imul(na,To)|0,Wi=Wi+Math.imul(na,Wa)|0;var La=(ji+Fi|0)+(($i&8191)<<13)|0;ji=(Wi+($i>>>13)|0)+(La>>>26)|0,La&=67108863,Fi=Math.imul(aa,es),$i=Math.imul(aa,Ya),$i=$i+Math.imul(ta,es)|0,Wi=Math.imul(ta,Ya),Fi=Fi+Math.imul(ra,To)|0,$i=$i+Math.imul(ra,Wa)|0,$i=$i+Math.imul(sa,To)|0,Wi=Wi+Math.imul(sa,Wa)|0,Fi=Fi+Math.imul(ea,ns)|0,$i=$i+Math.imul(ea,Co)|0,$i=$i+Math.imul(na,ns)|0,Wi=Wi+Math.imul(na,Co)|0;var ba=(ji+Fi|0)+(($i&8191)<<13)|0;ji=(Wi+($i>>>13)|0)+(ba>>>26)|0,ba&=67108863,Fi=Math.imul(ca,es),$i=Math.imul(ca,Ya),$i=$i+Math.imul(pa,es)|0,Wi=Math.imul(pa,Ya),Fi=Fi+Math.imul(aa,To)|0,$i=$i+Math.imul(aa,Wa)|0,$i=$i+Math.imul(ta,To)|0,Wi=Wi+Math.imul(ta,Wa)|0,Fi=Fi+Math.imul(ra,ns)|0,$i=$i+Math.imul(ra,Co)|0,$i=$i+Math.imul(sa,ns)|0,Wi=Wi+Math.imul(sa,Co)|0,Fi=Fi+Math.imul(ea,os)|0,$i=$i+Math.imul(ea,So)|0,$i=$i+Math.imul(na,os)|0,Wi=Wi+Math.imul(na,So)|0;var ka=(ji+Fi|0)+(($i&8191)<<13)|0;ji=(Wi+($i>>>13)|0)+(ka>>>26)|0,ka&=67108863,Fi=Math.imul(xa,es),$i=Math.imul(xa,Ya),$i=$i+Math.imul(ga,es)|0,Wi=Math.imul(ga,Ya),Fi=Fi+Math.imul(ca,To)|0,$i=$i+Math.imul(ca,Wa)|0,$i=$i+Math.imul(pa,To)|0,Wi=Wi+Math.imul(pa,Wa)|0,Fi=Fi+Math.imul(aa,ns)|0,$i=$i+Math.imul(aa,Co)|0,$i=$i+Math.imul(ta,ns)|0,Wi=Wi+Math.imul(ta,Co)|0,Fi=Fi+Math.imul(ra,os)|0,$i=$i+Math.imul(ra,So)|0,$i=$i+Math.imul(sa,os)|0,Wi=Wi+Math.imul(sa,So)|0,Fi=Fi+Math.imul(ea,Oo)|0,$i=$i+Math.imul(ea,da)|0,$i=$i+Math.imul(na,Oo)|0,Wi=Wi+Math.imul(na,da)|0;var ja=(ji+Fi|0)+(($i&8191)<<13)|0;ji=(Wi+($i>>>13)|0)+(ja>>>26)|0,ja&=67108863,Fi=Math.imul(Aa,es),$i=Math.imul(Aa,Ya),$i=$i+Math.imul(va,es)|0,Wi=Math.imul(va,Ya),Fi=Fi+Math.imul(xa,To)|0,$i=$i+Math.imul(xa,Wa)|0,$i=$i+Math.imul(ga,To)|0,Wi=Wi+Math.imul(ga,Wa)|0,Fi=Fi+Math.imul(ca,ns)|0,$i=$i+Math.imul(ca,Co)|0,$i=$i+Math.imul(pa,ns)|0,Wi=Wi+Math.imul(pa,Co)|0,Fi=Fi+Math.imul(aa,os)|0,$i=$i+Math.imul(aa,So)|0,$i=$i+Math.imul(ta,os)|0,Wi=Wi+Math.imul(ta,So)|0,Fi=Fi+Math.imul(ra,Oo)|0,$i=$i+Math.imul(ra,da)|0,$i=$i+Math.imul(sa,Oo)|0,Wi=Wi+Math.imul(sa,da)|0,Fi=Fi+Math.imul(ea,oa)|0,$i=$i+Math.imul(ea,ha)|0,$i=$i+Math.imul(na,oa)|0,Wi=Wi+Math.imul(na,ha)|0;var ts=(ji+Fi|0)+(($i&8191)<<13)|0;ji=(Wi+($i>>>13)|0)+(ts>>>26)|0,ts&=67108863,Fi=Math.imul(Ta,es),$i=Math.imul(Ta,Ya),$i=$i+Math.imul(wa,es)|0,Wi=Math.imul(wa,Ya),Fi=Fi+Math.imul(Aa,To)|0,$i=$i+Math.imul(Aa,Wa)|0,$i=$i+Math.imul(va,To)|0,Wi=Wi+Math.imul(va,Wa)|0,Fi=Fi+Math.imul(xa,ns)|0,$i=$i+Math.imul(xa,Co)|0,$i=$i+Math.imul(ga,ns)|0,Wi=Wi+Math.imul(ga,Co)|0,Fi=Fi+Math.imul(ca,os)|0,$i=$i+Math.imul(ca,So)|0,$i=$i+Math.imul(pa,os)|0,Wi=Wi+Math.imul(pa,So)|0,Fi=Fi+Math.imul(aa,Oo)|0,$i=$i+Math.imul(aa,da)|0,$i=$i+Math.imul(ta,Oo)|0,Wi=Wi+Math.imul(ta,da)|0,Fi=Fi+Math.imul(ra,oa)|0,$i=$i+Math.imul(ra,ha)|0,$i=$i+Math.imul(sa,oa)|0,Wi=Wi+Math.imul(sa,ha)|0,Fi=Fi+Math.imul(ea,Ia)|0,$i=$i+Math.imul(ea,Da)|0,$i=$i+Math.imul(na,Ia)|0,Wi=Wi+Math.imul(na,Da)|0;var ys=(ji+Fi|0)+(($i&8191)<<13)|0;ji=(Wi+($i>>>13)|0)+(ys>>>26)|0,ys&=67108863,Fi=Math.imul($a,es),$i=Math.imul($a,Ya),$i=$i+Math.imul(Ma,es)|0,Wi=Math.imul(Ma,Ya),Fi=Fi+Math.imul(Ta,To)|0,$i=$i+Math.imul(Ta,Wa)|0,$i=$i+Math.imul(wa,To)|0,Wi=Wi+Math.imul(wa,Wa)|0,Fi=Fi+Math.imul(Aa,ns)|0,$i=$i+Math.imul(Aa,Co)|0,$i=$i+Math.imul(va,ns)|0,Wi=Wi+Math.imul(va,Co)|0,Fi=Fi+Math.imul(xa,os)|0,$i=$i+Math.imul(xa,So)|0,$i=$i+Math.imul(ga,os)|0,Wi=Wi+Math.imul(ga,So)|0,Fi=Fi+Math.imul(ca,Oo)|0,$i=$i+Math.imul(ca,da)|0,$i=$i+Math.imul(pa,Oo)|0,Wi=Wi+Math.imul(pa,da)|0,Fi=Fi+Math.imul(aa,oa)|0,$i=$i+Math.imul(aa,ha)|0,$i=$i+Math.imul(ta,oa)|0,Wi=Wi+Math.imul(ta,ha)|0,Fi=Fi+Math.imul(ra,Ia)|0,$i=$i+Math.imul(ra,Da)|0,$i=$i+Math.imul(sa,Ia)|0,Wi=Wi+Math.imul(sa,Da)|0,Fi=Fi+Math.imul(ea,as)|0,$i=$i+Math.imul(ea,No)|0,$i=$i+Math.imul(na,as)|0,Wi=Wi+Math.imul(na,No)|0;var ps=(ji+Fi|0)+(($i&8191)<<13)|0;ji=(Wi+($i>>>13)|0)+(ps>>>26)|0,ps&=67108863,Fi=Math.imul(Ga,es),$i=Math.imul(Ga,Ya),$i=$i+Math.imul(Ha,es)|0,Wi=Math.imul(Ha,Ya),Fi=Fi+Math.imul($a,To)|0,$i=$i+Math.imul($a,Wa)|0,$i=$i+Math.imul(Ma,To)|0,Wi=Wi+Math.imul(Ma,Wa)|0,Fi=Fi+Math.imul(Ta,ns)|0,$i=$i+Math.imul(Ta,Co)|0,$i=$i+Math.imul(wa,ns)|0,Wi=Wi+Math.imul(wa,Co)|0,Fi=Fi+Math.imul(Aa,os)|0,$i=$i+Math.imul(Aa,So)|0,$i=$i+Math.imul(va,os)|0,Wi=Wi+Math.imul(va,So)|0,Fi=Fi+Math.imul(xa,Oo)|0,$i=$i+Math.imul(xa,da)|0,$i=$i+Math.imul(ga,Oo)|0,Wi=Wi+Math.imul(ga,da)|0,Fi=Fi+Math.imul(ca,oa)|0,$i=$i+Math.imul(ca,ha)|0,$i=$i+Math.imul(pa,oa)|0,Wi=Wi+Math.imul(pa,ha)|0,Fi=Fi+Math.imul(aa,Ia)|0,$i=$i+Math.imul(aa,Da)|0,$i=$i+Math.imul(ta,Ia)|0,Wi=Wi+Math.imul(ta,Da)|0,Fi=Fi+Math.imul(ra,as)|0,$i=$i+Math.imul(ra,No)|0,$i=$i+Math.imul(sa,as)|0,Wi=Wi+Math.imul(sa,No)|0,Fi=Fi+Math.imul(ea,Za)|0,$i=$i+Math.imul(ea,zo)|0,$i=$i+Math.imul(na,Za)|0,Wi=Wi+Math.imul(na,zo)|0;var hs=(ji+Fi|0)+(($i&8191)<<13)|0;ji=(Wi+($i>>>13)|0)+(hs>>>26)|0,hs&=67108863,Fi=Math.imul(vo,es),$i=Math.imul(vo,Ya),$i=$i+Math.imul(Ja,es)|0,Wi=Math.imul(Ja,Ya),Fi=Fi+Math.imul(Ga,To)|0,$i=$i+Math.imul(Ga,Wa)|0,$i=$i+Math.imul(Ha,To)|0,Wi=Wi+Math.imul(Ha,Wa)|0,Fi=Fi+Math.imul($a,ns)|0,$i=$i+Math.imul($a,Co)|0,$i=$i+Math.imul(Ma,ns)|0,Wi=Wi+Math.imul(Ma,Co)|0,Fi=Fi+Math.imul(Ta,os)|0,$i=$i+Math.imul(Ta,So)|0,$i=$i+Math.imul(wa,os)|0,Wi=Wi+Math.imul(wa,So)|0,Fi=Fi+Math.imul(Aa,Oo)|0,$i=$i+Math.imul(Aa,da)|0,$i=$i+Math.imul(va,Oo)|0,Wi=Wi+Math.imul(va,da)|0,Fi=Fi+Math.imul(xa,oa)|0,$i=$i+Math.imul(xa,ha)|0,$i=$i+Math.imul(ga,oa)|0,Wi=Wi+Math.imul(ga,ha)|0,Fi=Fi+Math.imul(ca,Ia)|0,$i=$i+Math.imul(ca,Da)|0,$i=$i+Math.imul(pa,Ia)|0,Wi=Wi+Math.imul(pa,Da)|0,Fi=Fi+Math.imul(aa,as)|0,$i=$i+Math.imul(aa,No)|0,$i=$i+Math.imul(ta,as)|0,Wi=Wi+Math.imul(ta,No)|0,Fi=Fi+Math.imul(ra,Za)|0,$i=$i+Math.imul(ra,zo)|0,$i=$i+Math.imul(sa,Za)|0,Wi=Wi+Math.imul(sa,zo)|0,Fi=Fi+Math.imul(ea,vs)|0,$i=$i+Math.imul(ea,gs)|0,$i=$i+Math.imul(na,vs)|0,Wi=Wi+Math.imul(na,gs)|0;var Ls=(ji+Fi|0)+(($i&8191)<<13)|0;ji=(Wi+($i>>>13)|0)+(Ls>>>26)|0,Ls&=67108863,Fi=Math.imul(vo,To),$i=Math.imul(vo,Wa),$i=$i+Math.imul(Ja,To)|0,Wi=Math.imul(Ja,Wa),Fi=Fi+Math.imul(Ga,ns)|0,$i=$i+Math.imul(Ga,Co)|0,$i=$i+Math.imul(Ha,ns)|0,Wi=Wi+Math.imul(Ha,Co)|0,Fi=Fi+Math.imul($a,os)|0,$i=$i+Math.imul($a,So)|0,$i=$i+Math.imul(Ma,os)|0,Wi=Wi+Math.imul(Ma,So)|0,Fi=Fi+Math.imul(Ta,Oo)|0,$i=$i+Math.imul(Ta,da)|0,$i=$i+Math.imul(wa,Oo)|0,Wi=Wi+Math.imul(wa,da)|0,Fi=Fi+Math.imul(Aa,oa)|0,$i=$i+Math.imul(Aa,ha)|0,$i=$i+Math.imul(va,oa)|0,Wi=Wi+Math.imul(va,ha)|0,Fi=Fi+Math.imul(xa,Ia)|0,$i=$i+Math.imul(xa,Da)|0,$i=$i+Math.imul(ga,Ia)|0,Wi=Wi+Math.imul(ga,Da)|0,Fi=Fi+Math.imul(ca,as)|0,$i=$i+Math.imul(ca,No)|0,$i=$i+Math.imul(pa,as)|0,Wi=Wi+Math.imul(pa,No)|0,Fi=Fi+Math.imul(aa,Za)|0,$i=$i+Math.imul(aa,zo)|0,$i=$i+Math.imul(ta,Za)|0,Wi=Wi+Math.imul(ta,zo)|0,Fi=Fi+Math.imul(ra,vs)|0,$i=$i+Math.imul(ra,gs)|0,$i=$i+Math.imul(sa,vs)|0,Wi=Wi+Math.imul(sa,gs)|0;var js=(ji+Fi|0)+(($i&8191)<<13)|0;ji=(Wi+($i>>>13)|0)+(js>>>26)|0,js&=67108863,Fi=Math.imul(vo,ns),$i=Math.imul(vo,Co),$i=$i+Math.imul(Ja,ns)|0,Wi=Math.imul(Ja,Co),Fi=Fi+Math.imul(Ga,os)|0,$i=$i+Math.imul(Ga,So)|0,$i=$i+Math.imul(Ha,os)|0,Wi=Wi+Math.imul(Ha,So)|0,Fi=Fi+Math.imul($a,Oo)|0,$i=$i+Math.imul($a,da)|0,$i=$i+Math.imul(Ma,Oo)|0,Wi=Wi+Math.imul(Ma,da)|0,Fi=Fi+Math.imul(Ta,oa)|0,$i=$i+Math.imul(Ta,ha)|0,$i=$i+Math.imul(wa,oa)|0,Wi=Wi+Math.imul(wa,ha)|0,Fi=Fi+Math.imul(Aa,Ia)|0,$i=$i+Math.imul(Aa,Da)|0,$i=$i+Math.imul(va,Ia)|0,Wi=Wi+Math.imul(va,Da)|0,Fi=Fi+Math.imul(xa,as)|0,$i=$i+Math.imul(xa,No)|0,$i=$i+Math.imul(ga,as)|0,Wi=Wi+Math.imul(ga,No)|0,Fi=Fi+Math.imul(ca,Za)|0,$i=$i+Math.imul(ca,zo)|0,$i=$i+Math.imul(pa,Za)|0,Wi=Wi+Math.imul(pa,zo)|0,Fi=Fi+Math.imul(aa,vs)|0,$i=$i+Math.imul(aa,gs)|0,$i=$i+Math.imul(ta,vs)|0,Wi=Wi+Math.imul(ta,gs)|0;var Ts=(ji+Fi|0)+(($i&8191)<<13)|0;ji=(Wi+($i>>>13)|0)+(Ts>>>26)|0,Ts&=67108863,Fi=Math.imul(vo,os),$i=Math.imul(vo,So),$i=$i+Math.imul(Ja,os)|0,Wi=Math.imul(Ja,So),Fi=Fi+Math.imul(Ga,Oo)|0,$i=$i+Math.imul(Ga,da)|0,$i=$i+Math.imul(Ha,Oo)|0,Wi=Wi+Math.imul(Ha,da)|0,Fi=Fi+Math.imul($a,oa)|0,$i=$i+Math.imul($a,ha)|0,$i=$i+Math.imul(Ma,oa)|0,Wi=Wi+Math.imul(Ma,ha)|0,Fi=Fi+Math.imul(Ta,Ia)|0,$i=$i+Math.imul(Ta,Da)|0,$i=$i+Math.imul(wa,Ia)|0,Wi=Wi+Math.imul(wa,Da)|0,Fi=Fi+Math.imul(Aa,as)|0,$i=$i+Math.imul(Aa,No)|0,$i=$i+Math.imul(va,as)|0,Wi=Wi+Math.imul(va,No)|0,Fi=Fi+Math.imul(xa,Za)|0,$i=$i+Math.imul(xa,zo)|0,$i=$i+Math.imul(ga,Za)|0,Wi=Wi+Math.imul(ga,zo)|0,Fi=Fi+Math.imul(ca,vs)|0,$i=$i+Math.imul(ca,gs)|0,$i=$i+Math.imul(pa,vs)|0,Wi=Wi+Math.imul(pa,gs)|0;var Us=(ji+Fi|0)+(($i&8191)<<13)|0;ji=(Wi+($i>>>13)|0)+(Us>>>26)|0,Us&=67108863,Fi=Math.imul(vo,Oo),$i=Math.imul(vo,da),$i=$i+Math.imul(Ja,Oo)|0,Wi=Math.imul(Ja,da),Fi=Fi+Math.imul(Ga,oa)|0,$i=$i+Math.imul(Ga,ha)|0,$i=$i+Math.imul(Ha,oa)|0,Wi=Wi+Math.imul(Ha,ha)|0,Fi=Fi+Math.imul($a,Ia)|0,$i=$i+Math.imul($a,Da)|0,$i=$i+Math.imul(Ma,Ia)|0,Wi=Wi+Math.imul(Ma,Da)|0,Fi=Fi+Math.imul(Ta,as)|0,$i=$i+Math.imul(Ta,No)|0,$i=$i+Math.imul(wa,as)|0,Wi=Wi+Math.imul(wa,No)|0,Fi=Fi+Math.imul(Aa,Za)|0,$i=$i+Math.imul(Aa,zo)|0,$i=$i+Math.imul(va,Za)|0,Wi=Wi+Math.imul(va,zo)|0,Fi=Fi+Math.imul(xa,vs)|0,$i=$i+Math.imul(xa,gs)|0,$i=$i+Math.imul(ga,vs)|0,Wi=Wi+Math.imul(ga,gs)|0;var Es=(ji+Fi|0)+(($i&8191)<<13)|0;ji=(Wi+($i>>>13)|0)+(Es>>>26)|0,Es&=67108863,Fi=Math.imul(vo,oa),$i=Math.imul(vo,ha),$i=$i+Math.imul(Ja,oa)|0,Wi=Math.imul(Ja,ha),Fi=Fi+Math.imul(Ga,Ia)|0,$i=$i+Math.imul(Ga,Da)|0,$i=$i+Math.imul(Ha,Ia)|0,Wi=Wi+Math.imul(Ha,Da)|0,Fi=Fi+Math.imul($a,as)|0,$i=$i+Math.imul($a,No)|0,$i=$i+Math.imul(Ma,as)|0,Wi=Wi+Math.imul(Ma,No)|0,Fi=Fi+Math.imul(Ta,Za)|0,$i=$i+Math.imul(Ta,zo)|0,$i=$i+Math.imul(wa,Za)|0,Wi=Wi+Math.imul(wa,zo)|0,Fi=Fi+Math.imul(Aa,vs)|0,$i=$i+Math.imul(Aa,gs)|0,$i=$i+Math.imul(va,vs)|0,Wi=Wi+Math.imul(va,gs)|0;var zs=(ji+Fi|0)+(($i&8191)<<13)|0;ji=(Wi+($i>>>13)|0)+(zs>>>26)|0,zs&=67108863,Fi=Math.imul(vo,Ia),$i=Math.imul(vo,Da),$i=$i+Math.imul(Ja,Ia)|0,Wi=Math.imul(Ja,Da),Fi=Fi+Math.imul(Ga,as)|0,$i=$i+Math.imul(Ga,No)|0,$i=$i+Math.imul(Ha,as)|0,Wi=Wi+Math.imul(Ha,No)|0,Fi=Fi+Math.imul($a,Za)|0,$i=$i+Math.imul($a,zo)|0,$i=$i+Math.imul(Ma,Za)|0,Wi=Wi+Math.imul(Ma,zo)|0,Fi=Fi+Math.imul(Ta,vs)|0,$i=$i+Math.imul(Ta,gs)|0,$i=$i+Math.imul(wa,vs)|0,Wi=Wi+Math.imul(wa,gs)|0;var Ks=(ji+Fi|0)+(($i&8191)<<13)|0;ji=(Wi+($i>>>13)|0)+(Ks>>>26)|0,Ks&=67108863,Fi=Math.imul(vo,as),$i=Math.imul(vo,No),$i=$i+Math.imul(Ja,as)|0,Wi=Math.imul(Ja,No),Fi=Fi+Math.imul(Ga,Za)|0,$i=$i+Math.imul(Ga,zo)|0,$i=$i+Math.imul(Ha,Za)|0,Wi=Wi+Math.imul(Ha,zo)|0,Fi=Fi+Math.imul($a,vs)|0,$i=$i+Math.imul($a,gs)|0,$i=$i+Math.imul(Ma,vs)|0,Wi=Wi+Math.imul(Ma,gs)|0;var nl=(ji+Fi|0)+(($i&8191)<<13)|0;ji=(Wi+($i>>>13)|0)+(nl>>>26)|0,nl&=67108863,Fi=Math.imul(vo,Za),$i=Math.imul(vo,zo),$i=$i+Math.imul(Ja,Za)|0,Wi=Math.imul(Ja,zo),Fi=Fi+Math.imul(Ga,vs)|0,$i=$i+Math.imul(Ga,gs)|0,$i=$i+Math.imul(Ha,vs)|0,Wi=Wi+Math.imul(Ha,gs)|0;var Tl=(ji+Fi|0)+(($i&8191)<<13)|0;ji=(Wi+($i>>>13)|0)+(Tl>>>26)|0,Tl&=67108863,Fi=Math.imul(vo,vs),$i=Math.imul(vo,gs),$i=$i+Math.imul(Ja,vs)|0,Wi=Math.imul(Ja,gs);var Cl=(ji+Fi|0)+(($i&8191)<<13)|0;return ji=(Wi+($i>>>13)|0)+(Cl>>>26)|0,Cl&=67108863,Ki[0]=Xs,Ki[1]=La,Ki[2]=ba,Ki[3]=ka,Ki[4]=ja,Ki[5]=ts,Ki[6]=ys,Ki[7]=ps,Ki[8]=hs,Ki[9]=Ls,Ki[10]=js,Ki[11]=Ts,Ki[12]=Us,Ki[13]=Es,Ki[14]=zs,Ki[15]=Ks,Ki[16]=nl,Ki[17]=Tl,Ki[18]=Cl,ji!==0&&(Ki[19]=ji,ki.length++),ki};Math.imul||(Ci=xi);function Ai(Li,wi,Ri){Ri.negative=wi.negative^Li.negative,Ri.length=Li.length+wi.length;for(var ki=0,Bi=0,Hi=0;Hi<Ri.length-1;Hi++){var Ki=Bi;Bi=0;for(var ji=ki&67108863,Fi=Math.min(Hi,wi.length-1),$i=Math.max(0,Hi-Li.length+1);$i<=Fi;$i++){var Wi=Hi-$i,Qi=Li.words[Wi]|0,ea=wi.words[$i]|0,na=Qi*ea,Ji=na&67108863;Ki=Ki+(na/67108864|0)|0,Ji=Ji+ji|0,ji=Ji&67108863,Ki=Ki+(Ji>>>26)|0,Bi+=Ki>>>26,Ki&=67108863}Ri.words[Hi]=ji,ki=Ki,Ki=Bi}return ki!==0?Ri.words[Hi]=ki:Ri.length--,Ri._strip()}function Ii(Li,wi,Ri){return Ai(Li,wi,Ri)}Hn.prototype.mulTo=function(wi,Ri){var ki,Bi=this.length+wi.length;return this.length===10&&wi.length===10?ki=Ci(this,wi,Ri):Bi<63?ki=xi(this,wi,Ri):Bi<1024?ki=Ai(this,wi,Ri):ki=Ii(this,wi,Ri),ki},Hn.prototype.mul=function(wi){var Ri=new Hn(null);return Ri.words=new Array(this.length+wi.length),this.mulTo(wi,Ri)},Hn.prototype.mulf=function(wi){var Ri=new Hn(null);return Ri.words=new Array(this.length+wi.length),Ii(this,wi,Ri)},Hn.prototype.imul=function(wi){return this.clone().mulTo(wi,this)},Hn.prototype.imuln=function(wi){var Ri=wi<0;Ri&&(wi=-wi),Mn(typeof wi=="number"),Mn(wi<67108864);for(var ki=0,Bi=0;Bi<this.length;Bi++){var Hi=(this.words[Bi]|0)*wi,Ki=(Hi&67108863)+(ki&67108863);ki>>=26,ki+=Hi/67108864|0,ki+=Ki>>>26,this.words[Bi]=Ki&67108863}return ki!==0&&(this.words[Bi]=ki,this.length++),this.length=wi===0?1:this.length,Ri?this.ineg():this},Hn.prototype.muln=function(wi){return this.clone().imuln(wi)},Hn.prototype.sqr=function(){return this.mul(this)},Hn.prototype.isqr=function(){return this.imul(this.clone())},Hn.prototype.pow=function(wi){var Ri=_i(wi);if(Ri.length===0)return new Hn(1);for(var ki=this,Bi=0;Bi<Ri.length&&Ri[Bi]===0;Bi++,ki=ki.sqr());if(++Bi<Ri.length)for(var Hi=ki.sqr();Bi<Ri.length;Bi++,Hi=Hi.sqr())Ri[Bi]!==0&&(ki=ki.mul(Hi));return ki},Hn.prototype.iushln=function(wi){Mn(typeof wi=="number"&&wi>=0);var Ri=wi%26,ki=(wi-Ri)/26,Bi=67108863>>>26-Ri<<26-Ri,Hi;if(Ri!==0){var Ki=0;for(Hi=0;Hi<this.length;Hi++){var ji=this.words[Hi]&Bi,Fi=(this.words[Hi]|0)-ji<<Ri;this.words[Hi]=Fi|Ki,Ki=ji>>>26-Ri}Ki&&(this.words[Hi]=Ki,this.length++)}if(ki!==0){for(Hi=this.length-1;Hi>=0;Hi--)this.words[Hi+ki]=this.words[Hi];for(Hi=0;Hi<ki;Hi++)this.words[Hi]=0;this.length+=ki}return this._strip()},Hn.prototype.ishln=function(wi){return Mn(this.negative===0),this.iushln(wi)},Hn.prototype.iushrn=function(wi,Ri,ki){Mn(typeof wi=="number"&&wi>=0);var Bi;Ri?Bi=(Ri-Ri%26)/26:Bi=0;var Hi=wi%26,Ki=Math.min((wi-Hi)/26,this.length),ji=67108863^67108863>>>Hi<<Hi,Fi=ki;if(Bi-=Ki,Bi=Math.max(0,Bi),Fi){for(var $i=0;$i<Ki;$i++)Fi.words[$i]=this.words[$i];Fi.length=Ki}if(Ki!==0)if(this.length>Ki)for(this.length-=Ki,$i=0;$i<this.length;$i++)this.words[$i]=this.words[$i+Ki];else this.words[0]=0,this.length=1;var Wi=0;for($i=this.length-1;$i>=0&&(Wi!==0||$i>=Bi);$i--){var Qi=this.words[$i]|0;this.words[$i]=Wi<<26-Hi|Qi>>>Hi,Wi=Qi&ji}return Fi&&Wi!==0&&(Fi.words[Fi.length++]=Wi),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},Hn.prototype.ishrn=function(wi,Ri,ki){return Mn(this.negative===0),this.iushrn(wi,Ri,ki)},Hn.prototype.shln=function(wi){return this.clone().ishln(wi)},Hn.prototype.ushln=function(wi){return this.clone().iushln(wi)},Hn.prototype.shrn=function(wi){return this.clone().ishrn(wi)},Hn.prototype.ushrn=function(wi){return this.clone().iushrn(wi)},Hn.prototype.testn=function(wi){Mn(typeof wi=="number"&&wi>=0);var Ri=wi%26,ki=(wi-Ri)/26,Bi=1<<Ri;if(this.length<=ki)return!1;var Hi=this.words[ki];return!!(Hi&Bi)},Hn.prototype.imaskn=function(wi){Mn(typeof wi=="number"&&wi>=0);var Ri=wi%26,ki=(wi-Ri)/26;if(Mn(this.negative===0,"imaskn works only with positive numbers"),this.length<=ki)return this;if(Ri!==0&&ki++,this.length=Math.min(ki,this.length),Ri!==0){var Bi=67108863^67108863>>>Ri<<Ri;this.words[this.length-1]&=Bi}return this._strip()},Hn.prototype.maskn=function(wi){return this.clone().imaskn(wi)},Hn.prototype.iaddn=function(wi){return Mn(typeof wi=="number"),Mn(wi<67108864),wi<0?this.isubn(-wi):this.negative!==0?this.length===1&&(this.words[0]|0)<=wi?(this.words[0]=wi-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(wi),this.negative=1,this):this._iaddn(wi)},Hn.prototype._iaddn=function(wi){this.words[0]+=wi;for(var Ri=0;Ri<this.length&&this.words[Ri]>=67108864;Ri++)this.words[Ri]-=67108864,Ri===this.length-1?this.words[Ri+1]=1:this.words[Ri+1]++;return this.length=Math.max(this.length,Ri+1),this},Hn.prototype.isubn=function(wi){if(Mn(typeof wi=="number"),Mn(wi<67108864),wi<0)return this.iaddn(-wi);if(this.negative!==0)return this.negative=0,this.iaddn(wi),this.negative=1,this;if(this.words[0]-=wi,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var Ri=0;Ri<this.length&&this.words[Ri]<0;Ri++)this.words[Ri]+=67108864,this.words[Ri+1]-=1;return this._strip()},Hn.prototype.addn=function(wi){return this.clone().iaddn(wi)},Hn.prototype.subn=function(wi){return this.clone().isubn(wi)},Hn.prototype.iabs=function(){return this.negative=0,this},Hn.prototype.abs=function(){return this.clone().iabs()},Hn.prototype._ishlnsubmul=function(wi,Ri,ki){var Bi=wi.length+ki,Hi;this._expand(Bi);var Ki,ji=0;for(Hi=0;Hi<wi.length;Hi++){Ki=(this.words[Hi+ki]|0)+ji;var Fi=(wi.words[Hi]|0)*Ri;Ki-=Fi&67108863,ji=(Ki>>26)-(Fi/67108864|0),this.words[Hi+ki]=Ki&67108863}for(;Hi<this.length-ki;Hi++)Ki=(this.words[Hi+ki]|0)+ji,ji=Ki>>26,this.words[Hi+ki]=Ki&67108863;if(ji===0)return this._strip();for(Mn(ji===-1),ji=0,Hi=0;Hi<this.length;Hi++)Ki=-(this.words[Hi]|0)+ji,ji=Ki>>26,this.words[Hi]=Ki&67108863;return this.negative=1,this._strip()},Hn.prototype._wordDiv=function(wi,Ri){var ki=this.length-wi.length,Bi=this.clone(),Hi=wi,Ki=Hi.words[Hi.length-1]|0,ji=this._countBits(Ki);ki=26-ji,ki!==0&&(Hi=Hi.ushln(ki),Bi.iushln(ki),Ki=Hi.words[Hi.length-1]|0);var Fi=Bi.length-Hi.length,$i;if(Ri!=="mod"){$i=new Hn(null),$i.length=Fi+1,$i.words=new Array($i.length);for(var Wi=0;Wi<$i.length;Wi++)$i.words[Wi]=0}var Qi=Bi.clone()._ishlnsubmul(Hi,1,Fi);Qi.negative===0&&(Bi=Qi,$i&&($i.words[Fi]=1));for(var ea=Fi-1;ea>=0;ea--){var na=(Bi.words[Hi.length+ea]|0)*67108864+(Bi.words[Hi.length+ea-1]|0);for(na=Math.min(na/Ki|0,67108863),Bi._ishlnsubmul(Hi,na,ea);Bi.negative!==0;)na--,Bi.negative=0,Bi._ishlnsubmul(Hi,1,ea),Bi.isZero()||(Bi.negative^=1);$i&&($i.words[ea]=na)}return $i&&$i._strip(),Bi._strip(),Ri!=="div"&&ki!==0&&Bi.iushrn(ki),{div:$i||null,mod:Bi}},Hn.prototype.divmod=function(wi,Ri,ki){if(Mn(!wi.isZero()),this.isZero())return{div:new Hn(0),mod:new Hn(0)};var Bi,Hi,Ki;return this.negative!==0&&wi.negative===0?(Ki=this.neg().divmod(wi,Ri),Ri!=="mod"&&(Bi=Ki.div.neg()),Ri!=="div"&&(Hi=Ki.mod.neg(),ki&&Hi.negative!==0&&Hi.iadd(wi)),{div:Bi,mod:Hi}):this.negative===0&&wi.negative!==0?(Ki=this.divmod(wi.neg(),Ri),Ri!=="mod"&&(Bi=Ki.div.neg()),{div:Bi,mod:Ki.mod}):(this.negative&wi.negative)!==0?(Ki=this.neg().divmod(wi.neg(),Ri),Ri!=="div"&&(Hi=Ki.mod.neg(),ki&&Hi.negative!==0&&Hi.isub(wi)),{div:Ki.div,mod:Hi}):wi.length>this.length||this.cmp(wi)<0?{div:new Hn(0),mod:this}:wi.length===1?Ri==="div"?{div:this.divn(wi.words[0]),mod:null}:Ri==="mod"?{div:null,mod:new Hn(this.modrn(wi.words[0]))}:{div:this.divn(wi.words[0]),mod:new Hn(this.modrn(wi.words[0]))}:this._wordDiv(wi,Ri)},Hn.prototype.div=function(wi){return this.divmod(wi,"div",!1).div},Hn.prototype.mod=function(wi){return this.divmod(wi,"mod",!1).mod},Hn.prototype.umod=function(wi){return this.divmod(wi,"mod",!0).mod},Hn.prototype.divRound=function(wi){var Ri=this.divmod(wi);if(Ri.mod.isZero())return Ri.div;var ki=Ri.div.negative!==0?Ri.mod.isub(wi):Ri.mod,Bi=wi.ushrn(1),Hi=wi.andln(1),Ki=ki.cmp(Bi);return Ki<0||Hi===1&&Ki===0?Ri.div:Ri.div.negative!==0?Ri.div.isubn(1):Ri.div.iaddn(1)},Hn.prototype.modrn=function(wi){var Ri=wi<0;Ri&&(wi=-wi),Mn(wi<=67108863);for(var ki=(1<<26)%wi,Bi=0,Hi=this.length-1;Hi>=0;Hi--)Bi=(ki*Bi+(this.words[Hi]|0))%wi;return Ri?-Bi:Bi},Hn.prototype.modn=function(wi){return this.modrn(wi)},Hn.prototype.idivn=function(wi){var Ri=wi<0;Ri&&(wi=-wi),Mn(wi<=67108863);for(var ki=0,Bi=this.length-1;Bi>=0;Bi--){var Hi=(this.words[Bi]|0)+ki*67108864;this.words[Bi]=Hi/wi|0,ki=Hi%wi}return this._strip(),Ri?this.ineg():this},Hn.prototype.divn=function(wi){return this.clone().idivn(wi)},Hn.prototype.egcd=function(wi){Mn(wi.negative===0),Mn(!wi.isZero());var Ri=this,ki=wi.clone();Ri.negative!==0?Ri=Ri.umod(wi):Ri=Ri.clone();for(var Bi=new Hn(1),Hi=new Hn(0),Ki=new Hn(0),ji=new Hn(1),Fi=0;Ri.isEven()&&ki.isEven();)Ri.iushrn(1),ki.iushrn(1),++Fi;for(var $i=ki.clone(),Wi=Ri.clone();!Ri.isZero();){for(var Qi=0,ea=1;(Ri.words[0]&ea)===0&&Qi<26;++Qi,ea<<=1);if(Qi>0)for(Ri.iushrn(Qi);Qi-- >0;)(Bi.isOdd()||Hi.isOdd())&&(Bi.iadd($i),Hi.isub(Wi)),Bi.iushrn(1),Hi.iushrn(1);for(var na=0,Ji=1;(ki.words[0]&Ji)===0&&na<26;++na,Ji<<=1);if(na>0)for(ki.iushrn(na);na-- >0;)(Ki.isOdd()||ji.isOdd())&&(Ki.iadd($i),ji.isub(Wi)),Ki.iushrn(1),ji.iushrn(1);Ri.cmp(ki)>=0?(Ri.isub(ki),Bi.isub(Ki),Hi.isub(ji)):(ki.isub(Ri),Ki.isub(Bi),ji.isub(Hi))}return{a:Ki,b:ji,gcd:ki.iushln(Fi)}},Hn.prototype._invmp=function(wi){Mn(wi.negative===0),Mn(!wi.isZero());var Ri=this,ki=wi.clone();Ri.negative!==0?Ri=Ri.umod(wi):Ri=Ri.clone();for(var Bi=new Hn(1),Hi=new Hn(0),Ki=ki.clone();Ri.cmpn(1)>0&&ki.cmpn(1)>0;){for(var ji=0,Fi=1;(Ri.words[0]&Fi)===0&&ji<26;++ji,Fi<<=1);if(ji>0)for(Ri.iushrn(ji);ji-- >0;)Bi.isOdd()&&Bi.iadd(Ki),Bi.iushrn(1);for(var $i=0,Wi=1;(ki.words[0]&Wi)===0&&$i<26;++$i,Wi<<=1);if($i>0)for(ki.iushrn($i);$i-- >0;)Hi.isOdd()&&Hi.iadd(Ki),Hi.iushrn(1);Ri.cmp(ki)>=0?(Ri.isub(ki),Bi.isub(Hi)):(ki.isub(Ri),Hi.isub(Bi))}var Qi;return Ri.cmpn(1)===0?Qi=Bi:Qi=Hi,Qi.cmpn(0)<0&&Qi.iadd(wi),Qi},Hn.prototype.gcd=function(wi){if(this.isZero())return wi.abs();if(wi.isZero())return this.abs();var Ri=this.clone(),ki=wi.clone();Ri.negative=0,ki.negative=0;for(var Bi=0;Ri.isEven()&&ki.isEven();Bi++)Ri.iushrn(1),ki.iushrn(1);do{for(;Ri.isEven();)Ri.iushrn(1);for(;ki.isEven();)ki.iushrn(1);var Hi=Ri.cmp(ki);if(Hi<0){var Ki=Ri;Ri=ki,ki=Ki}else if(Hi===0||ki.cmpn(1)===0)break;Ri.isub(ki)}while(!0);return ki.iushln(Bi)},Hn.prototype.invm=function(wi){return this.egcd(wi).a.umod(wi)},Hn.prototype.isEven=function(){return(this.words[0]&1)===0},Hn.prototype.isOdd=function(){return(this.words[0]&1)===1},Hn.prototype.andln=function(wi){return this.words[0]&wi},Hn.prototype.bincn=function(wi){Mn(typeof wi=="number");var Ri=wi%26,ki=(wi-Ri)/26,Bi=1<<Ri;if(this.length<=ki)return this._expand(ki+1),this.words[ki]|=Bi,this;for(var Hi=Bi,Ki=ki;Hi!==0&&Ki<this.length;Ki++){var ji=this.words[Ki]|0;ji+=Hi,Hi=ji>>>26,ji&=67108863,this.words[Ki]=ji}return Hi!==0&&(this.words[Ki]=Hi,this.length++),this},Hn.prototype.isZero=function(){return this.length===1&&this.words[0]===0},Hn.prototype.cmpn=function(wi){var Ri=wi<0;if(this.negative!==0&&!Ri)return-1;if(this.negative===0&&Ri)return 1;this._strip();var ki;if(this.length>1)ki=1;else{Ri&&(wi=-wi),Mn(wi<=67108863,"Number is too big");var Bi=this.words[0]|0;ki=Bi===wi?0:Bi<wi?-1:1}return this.negative!==0?-ki|0:ki},Hn.prototype.cmp=function(wi){if(this.negative!==0&&wi.negative===0)return-1;if(this.negative===0&&wi.negative!==0)return 1;var Ri=this.ucmp(wi);return this.negative!==0?-Ri|0:Ri},Hn.prototype.ucmp=function(wi){if(this.length>wi.length)return 1;if(this.length<wi.length)return-1;for(var Ri=0,ki=this.length-1;ki>=0;ki--){var Bi=this.words[ki]|0,Hi=wi.words[ki]|0;if(Bi!==Hi){Bi<Hi?Ri=-1:Bi>Hi&&(Ri=1);break}}return Ri},Hn.prototype.gtn=function(wi){return this.cmpn(wi)===1},Hn.prototype.gt=function(wi){return this.cmp(wi)===1},Hn.prototype.gten=function(wi){return this.cmpn(wi)>=0},Hn.prototype.gte=function(wi){return this.cmp(wi)>=0},Hn.prototype.ltn=function(wi){return this.cmpn(wi)===-1},Hn.prototype.lt=function(wi){return this.cmp(wi)===-1},Hn.prototype.lten=function(wi){return this.cmpn(wi)<=0},Hn.prototype.lte=function(wi){return this.cmp(wi)<=0},Hn.prototype.eqn=function(wi){return this.cmpn(wi)===0},Hn.prototype.eq=function(wi){return this.cmp(wi)===0},Hn.red=function(wi){return new zi(wi)},Hn.prototype.toRed=function(wi){return Mn(!this.red,"Already a number in reduction context"),Mn(this.negative===0,"red works only with positives"),wi.convertTo(this)._forceRed(wi)},Hn.prototype.fromRed=function(){return Mn(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},Hn.prototype._forceRed=function(wi){return this.red=wi,this},Hn.prototype.forceRed=function(wi){return Mn(!this.red,"Already a number in reduction context"),this._forceRed(wi)},Hn.prototype.redAdd=function(wi){return Mn(this.red,"redAdd works only with red numbers"),this.red.add(this,wi)},Hn.prototype.redIAdd=function(wi){return Mn(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,wi)},Hn.prototype.redSub=function(wi){return Mn(this.red,"redSub works only with red numbers"),this.red.sub(this,wi)},Hn.prototype.redISub=function(wi){return Mn(this.red,"redISub works only with red numbers"),this.red.isub(this,wi)},Hn.prototype.redShl=function(wi){return Mn(this.red,"redShl works only with red numbers"),this.red.shl(this,wi)},Hn.prototype.redMul=function(wi){return Mn(this.red,"redMul works only with red numbers"),this.red._verify2(this,wi),this.red.mul(this,wi)},Hn.prototype.redIMul=function(wi){return Mn(this.red,"redMul works only with red numbers"),this.red._verify2(this,wi),this.red.imul(this,wi)},Hn.prototype.redSqr=function(){return Mn(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},Hn.prototype.redISqr=function(){return Mn(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},Hn.prototype.redSqrt=function(){return Mn(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},Hn.prototype.redInvm=function(){return Mn(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},Hn.prototype.redNeg=function(){return Mn(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},Hn.prototype.redPow=function(wi){return Mn(this.red&&!wi.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,wi)};var Ni={k256:null,p224:null,p192:null,p25519:null};function Pi(Li,wi){this.name=Li,this.p=new Hn(wi,16),this.n=this.p.bitLength(),this.k=new Hn(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Pi.prototype._tmp=function(){var wi=new Hn(null);return wi.words=new Array(Math.ceil(this.n/13)),wi},Pi.prototype.ireduce=function(wi){var Ri=wi,ki;do this.split(Ri,this.tmp),Ri=this.imulK(Ri),Ri=Ri.iadd(this.tmp),ki=Ri.bitLength();while(ki>this.n);var Bi=ki<this.n?-1:Ri.ucmp(this.p);return Bi===0?(Ri.words[0]=0,Ri.length=1):Bi>0?Ri.isub(this.p):Ri.strip!==void 0?Ri.strip():Ri._strip(),Ri},Pi.prototype.split=function(wi,Ri){wi.iushrn(this.n,0,Ri)},Pi.prototype.imulK=function(wi){return wi.imul(this.k)};function Vi(){Pi.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}Ln(Vi,Pi),Vi.prototype.split=function(wi,Ri){for(var ki=4194303,Bi=Math.min(wi.length,9),Hi=0;Hi<Bi;Hi++)Ri.words[Hi]=wi.words[Hi];if(Ri.length=Bi,wi.length<=9){wi.words[0]=0,wi.length=1;return}var Ki=wi.words[9];for(Ri.words[Ri.length++]=Ki&ki,Hi=10;Hi<wi.length;Hi++){var ji=wi.words[Hi]|0;wi.words[Hi-10]=(ji&ki)<<4|Ki>>>22,Ki=ji}Ki>>>=22,wi.words[Hi-10]=Ki,Ki===0&&wi.length>10?wi.length-=10:wi.length-=9},Vi.prototype.imulK=function(wi){wi.words[wi.length]=0,wi.words[wi.length+1]=0,wi.length+=2;for(var Ri=0,ki=0;ki<wi.length;ki++){var Bi=wi.words[ki]|0;Ri+=Bi*977,wi.words[ki]=Ri&67108863,Ri=Bi*64+(Ri/67108864|0)}return wi.words[wi.length-1]===0&&(wi.length--,wi.words[wi.length-1]===0&&wi.length--),wi};function Ui(){Pi.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}Ln(Ui,Pi);function Gi(){Pi.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}Ln(Gi,Pi);function Yi(){Pi.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}Ln(Yi,Pi),Yi.prototype.imulK=function(wi){for(var Ri=0,ki=0;ki<wi.length;ki++){var Bi=(wi.words[ki]|0)*19+Ri,Hi=Bi&67108863;Bi>>>=26,wi.words[ki]=Hi,Ri=Bi}return Ri!==0&&(wi.words[wi.length++]=Ri),wi},Hn._prime=function(wi){if(Ni[wi])return Ni[wi];var Ri;if(wi==="k256")Ri=new Vi;else if(wi==="p224")Ri=new Ui;else if(wi==="p192")Ri=new Gi;else if(wi==="p25519")Ri=new Yi;else throw new Error("Unknown prime "+wi);return Ni[wi]=Ri,Ri};function zi(Li){if(typeof Li=="string"){var wi=Hn._prime(Li);this.m=wi.p,this.prime=wi}else Mn(Li.gtn(1),"modulus must be greater than 1"),this.m=Li,this.prime=null}zi.prototype._verify1=function(wi){Mn(wi.negative===0,"red works only with positives"),Mn(wi.red,"red works only with red numbers")},zi.prototype._verify2=function(wi,Ri){Mn((wi.negative|Ri.negative)===0,"red works only with positives"),Mn(wi.red&&wi.red===Ri.red,"red works only with red numbers")},zi.prototype.imod=function(wi){return this.prime?this.prime.ireduce(wi)._forceRed(this):(vi(wi,wi.umod(this.m)._forceRed(this)),wi)},zi.prototype.neg=function(wi){return wi.isZero()?wi.clone():this.m.sub(wi)._forceRed(this)},zi.prototype.add=function(wi,Ri){this._verify2(wi,Ri);var ki=wi.add(Ri);return ki.cmp(this.m)>=0&&ki.isub(this.m),ki._forceRed(this)},zi.prototype.iadd=function(wi,Ri){this._verify2(wi,Ri);var ki=wi.iadd(Ri);return ki.cmp(this.m)>=0&&ki.isub(this.m),ki},zi.prototype.sub=function(wi,Ri){this._verify2(wi,Ri);var ki=wi.sub(Ri);return ki.cmpn(0)<0&&ki.iadd(this.m),ki._forceRed(this)},zi.prototype.isub=function(wi,Ri){this._verify2(wi,Ri);var ki=wi.isub(Ri);return ki.cmpn(0)<0&&ki.iadd(this.m),ki},zi.prototype.shl=function(wi,Ri){return this._verify1(wi),this.imod(wi.ushln(Ri))},zi.prototype.imul=function(wi,Ri){return this._verify2(wi,Ri),this.imod(wi.imul(Ri))},zi.prototype.mul=function(wi,Ri){return this._verify2(wi,Ri),this.imod(wi.mul(Ri))},zi.prototype.isqr=function(wi){return this.imul(wi,wi.clone())},zi.prototype.sqr=function(wi){return this.mul(wi,wi)},zi.prototype.sqrt=function(wi){if(wi.isZero())return wi.clone();var Ri=this.m.andln(3);if(Mn(Ri%2===1),Ri===3){var ki=this.m.add(new Hn(1)).iushrn(2);return this.pow(wi,ki)}for(var Bi=this.m.subn(1),Hi=0;!Bi.isZero()&&Bi.andln(1)===0;)Hi++,Bi.iushrn(1);Mn(!Bi.isZero());var Ki=new Hn(1).toRed(this),ji=Ki.redNeg(),Fi=this.m.subn(1).iushrn(1),$i=this.m.bitLength();for($i=new Hn(2*$i*$i).toRed(this);this.pow($i,Fi).cmp(ji)!==0;)$i.redIAdd(ji);for(var Wi=this.pow($i,Bi),Qi=this.pow(wi,Bi.addn(1).iushrn(1)),ea=this.pow(wi,Bi),na=Hi;ea.cmp(Ki)!==0;){for(var Ji=ea,ra=0;Ji.cmp(Ki)!==0;ra++)Ji=Ji.redSqr();Mn(ra<na);var sa=this.pow(Wi,new Hn(1).iushln(na-ra-1));Qi=Qi.redMul(sa),Wi=sa.redSqr(),ea=ea.redMul(Wi),na=ra}return Qi},zi.prototype.invm=function(wi){var Ri=wi._invmp(this.m);return Ri.negative!==0?(Ri.negative=0,this.imod(Ri).redNeg()):this.imod(Ri)},zi.prototype.pow=function(wi,Ri){if(Ri.isZero())return new Hn(1).toRed(this);if(Ri.cmpn(1)===0)return wi.clone();var ki=4,Bi=new Array(1<<ki);Bi[0]=new Hn(1).toRed(this),Bi[1]=wi;for(var Hi=2;Hi<Bi.length;Hi++)Bi[Hi]=this.mul(Bi[Hi-1],wi);var Ki=Bi[0],ji=0,Fi=0,$i=Ri.bitLength()%26;for($i===0&&($i=26),Hi=Ri.length-1;Hi>=0;Hi--){for(var Wi=Ri.words[Hi],Qi=$i-1;Qi>=0;Qi--){var ea=Wi>>Qi&1;if(Ki!==Bi[0]&&(Ki=this.sqr(Ki)),ea===0&&ji===0){Fi=0;continue}ji<<=1,ji|=ea,Fi++,!(Fi!==ki&&(Hi!==0||Qi!==0))&&(Ki=this.mul(Ki,Bi[ji]),Fi=0,ji=0)}$i=26}return Ki},zi.prototype.convertTo=function(wi){var Ri=wi.umod(this.m);return Ri===wi?Ri.clone():Ri},zi.prototype.convertFrom=function(wi){var Ri=wi.clone();return Ri.red=null,Ri},Hn.mont=function(wi){return new Mi(wi)};function Mi(Li){zi.call(this,Li),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new Hn(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}Ln(Mi,zi),Mi.prototype.convertTo=function(wi){return this.imod(wi.ushln(this.shift))},Mi.prototype.convertFrom=function(wi){var Ri=this.imod(wi.mul(this.rinv));return Ri.red=null,Ri},Mi.prototype.imul=function(wi,Ri){if(wi.isZero()||Ri.isZero())return wi.words[0]=0,wi.length=1,wi;var ki=wi.imul(Ri),Bi=ki.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Hi=ki.isub(Bi).iushrn(this.shift),Ki=Hi;return Hi.cmp(this.m)>=0?Ki=Hi.isub(this.m):Hi.cmpn(0)<0&&(Ki=Hi.iadd(this.m)),Ki._forceRed(this)},Mi.prototype.mul=function(wi,Ri){if(wi.isZero()||Ri.isZero())return new Hn(0)._forceRed(this);var ki=wi.mul(Ri),Bi=ki.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Hi=ki.isub(Bi).iushrn(this.shift),Ki=Hi;return Hi.cmp(this.m)>=0?Ki=Hi.isub(this.m):Hi.cmpn(0)<0&&(Ki=Hi.iadd(this.m)),Ki._forceRed(this)},Mi.prototype.invm=function(wi){var Ri=this.imod(wi._invmp(this.m).mul(this.r2));return Ri._forceRed(this)}})(on,bn$2)}(bn$3)),bn$3.exports}var browserifyRsa,hasRequiredBrowserifyRsa;function requireBrowserifyRsa(){if(hasRequiredBrowserifyRsa)return browserifyRsa;hasRequiredBrowserifyRsa=1;var on=requireBn$1(),In=requireBrowser$b(),Rn=requireSafeBuffer$1().Buffer;function Mn(jn){var Wn=jn.modulus.byteLength(),Yn;do Yn=new on(In(Wn));while(Yn.cmp(jn.modulus)>=0||!Yn.umod(jn.prime1)||!Yn.umod(jn.prime2));return Yn}function Ln(jn){var Wn=Mn(jn),Yn=Wn.toRed(on.mont(jn.modulus)).redPow(new on(jn.publicExponent)).fromRed();return{blinder:Yn,unblinder:Wn.invm(jn.modulus)}}function Hn(jn,Wn){var Yn=Ln(Wn),hi=Wn.modulus.byteLength(),vi=new on(jn).mul(Yn.blinder).umod(Wn.modulus),gi=vi.toRed(on.mont(Wn.prime1)),mi=vi.toRed(on.mont(Wn.prime2)),yi=Wn.coefficient,bi=Wn.prime1,Ei=Wn.prime2,_i=gi.redPow(Wn.exponent1).fromRed(),xi=mi.redPow(Wn.exponent2).fromRed(),Ci=_i.isub(xi).imul(yi).umod(bi).imul(Ei);return xi.iadd(Ci).imul(Yn.unblinder).umod(Wn.modulus).toArrayLike(Rn,"be",hi)}return Hn.getr=Mn,browserifyRsa=Hn,browserifyRsa}var elliptic={};const version$1="6.6.1",require$$0$1={version:version$1};var utils$2={},utils$1={},hasRequiredUtils$2;function requireUtils$2(){return hasRequiredUtils$2||(hasRequiredUtils$2=1,function(on){var In=on;function Rn(Hn,jn){if(Array.isArray(Hn))return Hn.slice();if(!Hn)return[];var Wn=[];if(typeof Hn!="string"){for(var Yn=0;Yn<Hn.length;Yn++)Wn[Yn]=Hn[Yn]|0;return Wn}if(jn==="hex"){Hn=Hn.replace(/[^a-z0-9]+/ig,""),Hn.length%2!==0&&(Hn="0"+Hn);for(var Yn=0;Yn<Hn.length;Yn+=2)Wn.push(parseInt(Hn[Yn]+Hn[Yn+1],16))}else for(var Yn=0;Yn<Hn.length;Yn++){var hi=Hn.charCodeAt(Yn),vi=hi>>8,gi=hi&255;vi?Wn.push(vi,gi):Wn.push(gi)}return Wn}In.toArray=Rn;function Mn(Hn){return Hn.length===1?"0"+Hn:Hn}In.zero2=Mn;function Ln(Hn){for(var jn="",Wn=0;Wn<Hn.length;Wn++)jn+=Mn(Hn[Wn].toString(16));return jn}In.toHex=Ln,In.encode=function(jn,Wn){return Wn==="hex"?Ln(jn):jn}}(utils$1)),utils$1}var hasRequiredUtils$1;function requireUtils$1(){return hasRequiredUtils$1||(hasRequiredUtils$1=1,function(on){var In=on,Rn=requireBn$2(),Mn=requireMinimalisticAssert(),Ln=requireUtils$2();In.assert=Mn,In.toArray=Ln.toArray,In.zero2=Ln.zero2,In.toHex=Ln.toHex,In.encode=Ln.encode;function Hn(vi,gi,mi){var yi=new Array(Math.max(vi.bitLength(),mi)+1),bi;for(bi=0;bi<yi.length;bi+=1)yi[bi]=0;var Ei=1<<gi+1,_i=vi.clone();for(bi=0;bi<yi.length;bi++){var xi,Ci=_i.andln(Ei-1);_i.isOdd()?(Ci>(Ei>>1)-1?xi=(Ei>>1)-Ci:xi=Ci,_i.isubn(xi)):xi=0,yi[bi]=xi,_i.iushrn(1)}return yi}In.getNAF=Hn;function jn(vi,gi){var mi=[[],[]];vi=vi.clone(),gi=gi.clone();for(var yi=0,bi=0,Ei;vi.cmpn(-yi)>0||gi.cmpn(-bi)>0;){var _i=vi.andln(3)+yi&3,xi=gi.andln(3)+bi&3;_i===3&&(_i=-1),xi===3&&(xi=-1);var Ci;(_i&1)===0?Ci=0:(Ei=vi.andln(7)+yi&7,(Ei===3||Ei===5)&&xi===2?Ci=-_i:Ci=_i),mi[0].push(Ci);var Ai;(xi&1)===0?Ai=0:(Ei=gi.andln(7)+bi&7,(Ei===3||Ei===5)&&_i===2?Ai=-xi:Ai=xi),mi[1].push(Ai),2*yi===Ci+1&&(yi=1-yi),2*bi===Ai+1&&(bi=1-bi),vi.iushrn(1),gi.iushrn(1)}return mi}In.getJSF=jn;function Wn(vi,gi,mi){var yi="_"+gi;vi.prototype[gi]=function(){return this[yi]!==void 0?this[yi]:this[yi]=mi.call(this)}}In.cachedProperty=Wn;function Yn(vi){return typeof vi=="string"?In.toArray(vi,"hex"):vi}In.parseBytes=Yn;function hi(vi){return new Rn(vi,"hex","le")}In.intFromLE=hi}(utils$2)),utils$2}var curve={},base$2,hasRequiredBase$1;function requireBase$1(){if(hasRequiredBase$1)return base$2;hasRequiredBase$1=1;var on=requireBn$2(),In=requireUtils$1(),Rn=In.getNAF,Mn=In.getJSF,Ln=In.assert;function Hn(Wn,Yn){this.type=Wn,this.p=new on(Yn.p,16),this.red=Yn.prime?on.red(Yn.prime):on.mont(this.p),this.zero=new on(0).toRed(this.red),this.one=new on(1).toRed(this.red),this.two=new on(2).toRed(this.red),this.n=Yn.n&&new on(Yn.n,16),this.g=Yn.g&&this.pointFromJSON(Yn.g,Yn.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var hi=this.n&&this.p.div(this.n);!hi||hi.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}base$2=Hn,Hn.prototype.point=function(){throw new Error("Not implemented")},Hn.prototype.validate=function(){throw new Error("Not implemented")},Hn.prototype._fixedNafMul=function(Yn,hi){Ln(Yn.precomputed);var vi=Yn._getDoubles(),gi=Rn(hi,1,this._bitLength),mi=(1<<vi.step+1)-(vi.step%2===0?2:1);mi/=3;var yi=[],bi,Ei;for(bi=0;bi<gi.length;bi+=vi.step){Ei=0;for(var _i=bi+vi.step-1;_i>=bi;_i--)Ei=(Ei<<1)+gi[_i];yi.push(Ei)}for(var xi=this.jpoint(null,null,null),Ci=this.jpoint(null,null,null),Ai=mi;Ai>0;Ai--){for(bi=0;bi<yi.length;bi++)Ei=yi[bi],Ei===Ai?Ci=Ci.mixedAdd(vi.points[bi]):Ei===-Ai&&(Ci=Ci.mixedAdd(vi.points[bi].neg()));xi=xi.add(Ci)}return xi.toP()},Hn.prototype._wnafMul=function(Yn,hi){var vi=4,gi=Yn._getNAFPoints(vi);vi=gi.wnd;for(var mi=gi.points,yi=Rn(hi,vi,this._bitLength),bi=this.jpoint(null,null,null),Ei=yi.length-1;Ei>=0;Ei--){for(var _i=0;Ei>=0&&yi[Ei]===0;Ei--)_i++;if(Ei>=0&&_i++,bi=bi.dblp(_i),Ei<0)break;var xi=yi[Ei];Ln(xi!==0),Yn.type==="affine"?xi>0?bi=bi.mixedAdd(mi[xi-1>>1]):bi=bi.mixedAdd(mi[-xi-1>>1].neg()):xi>0?bi=bi.add(mi[xi-1>>1]):bi=bi.add(mi[-xi-1>>1].neg())}return Yn.type==="affine"?bi.toP():bi},Hn.prototype._wnafMulAdd=function(Yn,hi,vi,gi,mi){var yi=this._wnafT1,bi=this._wnafT2,Ei=this._wnafT3,_i=0,xi,Ci,Ai;for(xi=0;xi<gi;xi++){Ai=hi[xi];var Ii=Ai._getNAFPoints(Yn);yi[xi]=Ii.wnd,bi[xi]=Ii.points}for(xi=gi-1;xi>=1;xi-=2){var Ni=xi-1,Pi=xi;if(yi[Ni]!==1||yi[Pi]!==1){Ei[Ni]=Rn(vi[Ni],yi[Ni],this._bitLength),Ei[Pi]=Rn(vi[Pi],yi[Pi],this._bitLength),_i=Math.max(Ei[Ni].length,_i),_i=Math.max(Ei[Pi].length,_i);continue}var Vi=[hi[Ni],null,null,hi[Pi]];hi[Ni].y.cmp(hi[Pi].y)===0?(Vi[1]=hi[Ni].add(hi[Pi]),Vi[2]=hi[Ni].toJ().mixedAdd(hi[Pi].neg())):hi[Ni].y.cmp(hi[Pi].y.redNeg())===0?(Vi[1]=hi[Ni].toJ().mixedAdd(hi[Pi]),Vi[2]=hi[Ni].add(hi[Pi].neg())):(Vi[1]=hi[Ni].toJ().mixedAdd(hi[Pi]),Vi[2]=hi[Ni].toJ().mixedAdd(hi[Pi].neg()));var Ui=[-3,-1,-5,-7,0,7,5,1,3],Gi=Mn(vi[Ni],vi[Pi]);for(_i=Math.max(Gi[0].length,_i),Ei[Ni]=new Array(_i),Ei[Pi]=new Array(_i),Ci=0;Ci<_i;Ci++){var Yi=Gi[0][Ci]|0,zi=Gi[1][Ci]|0;Ei[Ni][Ci]=Ui[(Yi+1)*3+(zi+1)],Ei[Pi][Ci]=0,bi[Ni]=Vi}}var Mi=this.jpoint(null,null,null),Li=this._wnafT4;for(xi=_i;xi>=0;xi--){for(var wi=0;xi>=0;){var Ri=!0;for(Ci=0;Ci<gi;Ci++)Li[Ci]=Ei[Ci][xi]|0,Li[Ci]!==0&&(Ri=!1);if(!Ri)break;wi++,xi--}if(xi>=0&&wi++,Mi=Mi.dblp(wi),xi<0)break;for(Ci=0;Ci<gi;Ci++){var ki=Li[Ci];ki!==0&&(ki>0?Ai=bi[Ci][ki-1>>1]:ki<0&&(Ai=bi[Ci][-ki-1>>1].neg()),Ai.type==="affine"?Mi=Mi.mixedAdd(Ai):Mi=Mi.add(Ai))}}for(xi=0;xi<gi;xi++)bi[xi]=null;return mi?Mi:Mi.toP()};function jn(Wn,Yn){this.curve=Wn,this.type=Yn,this.precomputed=null}return Hn.BasePoint=jn,jn.prototype.eq=function(){throw new Error("Not implemented")},jn.prototype.validate=function(){return this.curve.validate(this)},Hn.prototype.decodePoint=function(Yn,hi){Yn=In.toArray(Yn,hi);var vi=this.p.byteLength();if((Yn[0]===4||Yn[0]===6||Yn[0]===7)&&Yn.length-1===2*vi){Yn[0]===6?Ln(Yn[Yn.length-1]%2===0):Yn[0]===7&&Ln(Yn[Yn.length-1]%2===1);var gi=this.point(Yn.slice(1,1+vi),Yn.slice(1+vi,1+2*vi));return gi}else if((Yn[0]===2||Yn[0]===3)&&Yn.length-1===vi)return this.pointFromX(Yn.slice(1,1+vi),Yn[0]===3);throw new Error("Unknown point format")},jn.prototype.encodeCompressed=function(Yn){return this.encode(Yn,!0)},jn.prototype._encode=function(Yn){var hi=this.curve.p.byteLength(),vi=this.getX().toArray("be",hi);return Yn?[this.getY().isEven()?2:3].concat(vi):[4].concat(vi,this.getY().toArray("be",hi))},jn.prototype.encode=function(Yn,hi){return In.encode(this._encode(hi),Yn)},jn.prototype.precompute=function(Yn){if(this.precomputed)return this;var hi={doubles:null,naf:null,beta:null};return hi.naf=this._getNAFPoints(8),hi.doubles=this._getDoubles(4,Yn),hi.beta=this._getBeta(),this.precomputed=hi,this},jn.prototype._hasDoubles=function(Yn){if(!this.precomputed)return!1;var hi=this.precomputed.doubles;return hi?hi.points.length>=Math.ceil((Yn.bitLength()+1)/hi.step):!1},jn.prototype._getDoubles=function(Yn,hi){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var vi=[this],gi=this,mi=0;mi<hi;mi+=Yn){for(var yi=0;yi<Yn;yi++)gi=gi.dbl();vi.push(gi)}return{step:Yn,points:vi}},jn.prototype._getNAFPoints=function(Yn){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var hi=[this],vi=(1<<Yn)-1,gi=vi===1?null:this.dbl(),mi=1;mi<vi;mi++)hi[mi]=hi[mi-1].add(gi);return{wnd:Yn,points:hi}},jn.prototype._getBeta=function(){return null},jn.prototype.dblp=function(Yn){for(var hi=this,vi=0;vi<Yn;vi++)hi=hi.dbl();return hi},base$2}var short,hasRequiredShort;function requireShort(){if(hasRequiredShort)return short;hasRequiredShort=1;var on=requireUtils$1(),In=requireBn$2(),Rn=requireInherits_browser(),Mn=requireBase$1(),Ln=on.assert;function Hn(Yn){Mn.call(this,"short",Yn),this.a=new In(Yn.a,16).toRed(this.red),this.b=new In(Yn.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(Yn),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}Rn(Hn,Mn),short=Hn,Hn.prototype._getEndomorphism=function(hi){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var vi,gi;if(hi.beta)vi=new In(hi.beta,16).toRed(this.red);else{var mi=this._getEndoRoots(this.p);vi=mi[0].cmp(mi[1])<0?mi[0]:mi[1],vi=vi.toRed(this.red)}if(hi.lambda)gi=new In(hi.lambda,16);else{var yi=this._getEndoRoots(this.n);this.g.mul(yi[0]).x.cmp(this.g.x.redMul(vi))===0?gi=yi[0]:(gi=yi[1],Ln(this.g.mul(gi).x.cmp(this.g.x.redMul(vi))===0))}var bi;return hi.basis?bi=hi.basis.map(function(Ei){return{a:new In(Ei.a,16),b:new In(Ei.b,16)}}):bi=this._getEndoBasis(gi),{beta:vi,lambda:gi,basis:bi}}},Hn.prototype._getEndoRoots=function(hi){var vi=hi===this.p?this.red:In.mont(hi),gi=new In(2).toRed(vi).redInvm(),mi=gi.redNeg(),yi=new In(3).toRed(vi).redNeg().redSqrt().redMul(gi),bi=mi.redAdd(yi).fromRed(),Ei=mi.redSub(yi).fromRed();return[bi,Ei]},Hn.prototype._getEndoBasis=function(hi){for(var vi=this.n.ushrn(Math.floor(this.n.bitLength()/2)),gi=hi,mi=this.n.clone(),yi=new In(1),bi=new In(0),Ei=new In(0),_i=new In(1),xi,Ci,Ai,Ii,Ni,Pi,Vi,Ui=0,Gi,Yi;gi.cmpn(0)!==0;){var zi=mi.div(gi);Gi=mi.sub(zi.mul(gi)),Yi=Ei.sub(zi.mul(yi));var Mi=_i.sub(zi.mul(bi));if(!Ai&&Gi.cmp(vi)<0)xi=Vi.neg(),Ci=yi,Ai=Gi.neg(),Ii=Yi;else if(Ai&&++Ui===2)break;Vi=Gi,mi=gi,gi=Gi,Ei=yi,yi=Yi,_i=bi,bi=Mi}Ni=Gi.neg(),Pi=Yi;var Li=Ai.sqr().add(Ii.sqr()),wi=Ni.sqr().add(Pi.sqr());return wi.cmp(Li)>=0&&(Ni=xi,Pi=Ci),Ai.negative&&(Ai=Ai.neg(),Ii=Ii.neg()),Ni.negative&&(Ni=Ni.neg(),Pi=Pi.neg()),[{a:Ai,b:Ii},{a:Ni,b:Pi}]},Hn.prototype._endoSplit=function(hi){var vi=this.endo.basis,gi=vi[0],mi=vi[1],yi=mi.b.mul(hi).divRound(this.n),bi=gi.b.neg().mul(hi).divRound(this.n),Ei=yi.mul(gi.a),_i=bi.mul(mi.a),xi=yi.mul(gi.b),Ci=bi.mul(mi.b),Ai=hi.sub(Ei).sub(_i),Ii=xi.add(Ci).neg();return{k1:Ai,k2:Ii}},Hn.prototype.pointFromX=function(hi,vi){hi=new In(hi,16),hi.red||(hi=hi.toRed(this.red));var gi=hi.redSqr().redMul(hi).redIAdd(hi.redMul(this.a)).redIAdd(this.b),mi=gi.redSqrt();if(mi.redSqr().redSub(gi).cmp(this.zero)!==0)throw new Error("invalid point");var yi=mi.fromRed().isOdd();return(vi&&!yi||!vi&&yi)&&(mi=mi.redNeg()),this.point(hi,mi)},Hn.prototype.validate=function(hi){if(hi.inf)return!0;var vi=hi.x,gi=hi.y,mi=this.a.redMul(vi),yi=vi.redSqr().redMul(vi).redIAdd(mi).redIAdd(this.b);return gi.redSqr().redISub(yi).cmpn(0)===0},Hn.prototype._endoWnafMulAdd=function(hi,vi,gi){for(var mi=this._endoWnafT1,yi=this._endoWnafT2,bi=0;bi<hi.length;bi++){var Ei=this._endoSplit(vi[bi]),_i=hi[bi],xi=_i._getBeta();Ei.k1.negative&&(Ei.k1.ineg(),_i=_i.neg(!0)),Ei.k2.negative&&(Ei.k2.ineg(),xi=xi.neg(!0)),mi[bi*2]=_i,mi[bi*2+1]=xi,yi[bi*2]=Ei.k1,yi[bi*2+1]=Ei.k2}for(var Ci=this._wnafMulAdd(1,mi,yi,bi*2,gi),Ai=0;Ai<bi*2;Ai++)mi[Ai]=null,yi[Ai]=null;return Ci};function jn(Yn,hi,vi,gi){Mn.BasePoint.call(this,Yn,"affine"),hi===null&&vi===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new In(hi,16),this.y=new In(vi,16),gi&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}Rn(jn,Mn.BasePoint),Hn.prototype.point=function(hi,vi,gi){return new jn(this,hi,vi,gi)},Hn.prototype.pointFromJSON=function(hi,vi){return jn.fromJSON(this,hi,vi)},jn.prototype._getBeta=function(){if(this.curve.endo){var hi=this.precomputed;if(hi&&hi.beta)return hi.beta;var vi=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(hi){var gi=this.curve,mi=function(yi){return gi.point(yi.x.redMul(gi.endo.beta),yi.y)};hi.beta=vi,vi.precomputed={beta:null,naf:hi.naf&&{wnd:hi.naf.wnd,points:hi.naf.points.map(mi)},doubles:hi.doubles&&{step:hi.doubles.step,points:hi.doubles.points.map(mi)}}}return vi}},jn.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},jn.fromJSON=function(hi,vi,gi){typeof vi=="string"&&(vi=JSON.parse(vi));var mi=hi.point(vi[0],vi[1],gi);if(!vi[2])return mi;function yi(Ei){return hi.point(Ei[0],Ei[1],gi)}var bi=vi[2];return mi.precomputed={beta:null,doubles:bi.doubles&&{step:bi.doubles.step,points:[mi].concat(bi.doubles.points.map(yi))},naf:bi.naf&&{wnd:bi.naf.wnd,points:[mi].concat(bi.naf.points.map(yi))}},mi},jn.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},jn.prototype.isInfinity=function(){return this.inf},jn.prototype.add=function(hi){if(this.inf)return hi;if(hi.inf)return this;if(this.eq(hi))return this.dbl();if(this.neg().eq(hi))return this.curve.point(null,null);if(this.x.cmp(hi.x)===0)return this.curve.point(null,null);var vi=this.y.redSub(hi.y);vi.cmpn(0)!==0&&(vi=vi.redMul(this.x.redSub(hi.x).redInvm()));var gi=vi.redSqr().redISub(this.x).redISub(hi.x),mi=vi.redMul(this.x.redSub(gi)).redISub(this.y);return this.curve.point(gi,mi)},jn.prototype.dbl=function(){if(this.inf)return this;var hi=this.y.redAdd(this.y);if(hi.cmpn(0)===0)return this.curve.point(null,null);var vi=this.curve.a,gi=this.x.redSqr(),mi=hi.redInvm(),yi=gi.redAdd(gi).redIAdd(gi).redIAdd(vi).redMul(mi),bi=yi.redSqr().redISub(this.x.redAdd(this.x)),Ei=yi.redMul(this.x.redSub(bi)).redISub(this.y);return this.curve.point(bi,Ei)},jn.prototype.getX=function(){return this.x.fromRed()},jn.prototype.getY=function(){return this.y.fromRed()},jn.prototype.mul=function(hi){return hi=new In(hi,16),this.isInfinity()?this:this._hasDoubles(hi)?this.curve._fixedNafMul(this,hi):this.curve.endo?this.curve._endoWnafMulAdd([this],[hi]):this.curve._wnafMul(this,hi)},jn.prototype.mulAdd=function(hi,vi,gi){var mi=[this,vi],yi=[hi,gi];return this.curve.endo?this.curve._endoWnafMulAdd(mi,yi):this.curve._wnafMulAdd(1,mi,yi,2)},jn.prototype.jmulAdd=function(hi,vi,gi){var mi=[this,vi],yi=[hi,gi];return this.curve.endo?this.curve._endoWnafMulAdd(mi,yi,!0):this.curve._wnafMulAdd(1,mi,yi,2,!0)},jn.prototype.eq=function(hi){return this===hi||this.inf===hi.inf&&(this.inf||this.x.cmp(hi.x)===0&&this.y.cmp(hi.y)===0)},jn.prototype.neg=function(hi){if(this.inf)return this;var vi=this.curve.point(this.x,this.y.redNeg());if(hi&&this.precomputed){var gi=this.precomputed,mi=function(yi){return yi.neg()};vi.precomputed={naf:gi.naf&&{wnd:gi.naf.wnd,points:gi.naf.points.map(mi)},doubles:gi.doubles&&{step:gi.doubles.step,points:gi.doubles.points.map(mi)}}}return vi},jn.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var hi=this.curve.jpoint(this.x,this.y,this.curve.one);return hi};function Wn(Yn,hi,vi,gi){Mn.BasePoint.call(this,Yn,"jacobian"),hi===null&&vi===null&&gi===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new In(0)):(this.x=new In(hi,16),this.y=new In(vi,16),this.z=new In(gi,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}return Rn(Wn,Mn.BasePoint),Hn.prototype.jpoint=function(hi,vi,gi){return new Wn(this,hi,vi,gi)},Wn.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var hi=this.z.redInvm(),vi=hi.redSqr(),gi=this.x.redMul(vi),mi=this.y.redMul(vi).redMul(hi);return this.curve.point(gi,mi)},Wn.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Wn.prototype.add=function(hi){if(this.isInfinity())return hi;if(hi.isInfinity())return this;var vi=hi.z.redSqr(),gi=this.z.redSqr(),mi=this.x.redMul(vi),yi=hi.x.redMul(gi),bi=this.y.redMul(vi.redMul(hi.z)),Ei=hi.y.redMul(gi.redMul(this.z)),_i=mi.redSub(yi),xi=bi.redSub(Ei);if(_i.cmpn(0)===0)return xi.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var Ci=_i.redSqr(),Ai=Ci.redMul(_i),Ii=mi.redMul(Ci),Ni=xi.redSqr().redIAdd(Ai).redISub(Ii).redISub(Ii),Pi=xi.redMul(Ii.redISub(Ni)).redISub(bi.redMul(Ai)),Vi=this.z.redMul(hi.z).redMul(_i);return this.curve.jpoint(Ni,Pi,Vi)},Wn.prototype.mixedAdd=function(hi){if(this.isInfinity())return hi.toJ();if(hi.isInfinity())return this;var vi=this.z.redSqr(),gi=this.x,mi=hi.x.redMul(vi),yi=this.y,bi=hi.y.redMul(vi).redMul(this.z),Ei=gi.redSub(mi),_i=yi.redSub(bi);if(Ei.cmpn(0)===0)return _i.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var xi=Ei.redSqr(),Ci=xi.redMul(Ei),Ai=gi.redMul(xi),Ii=_i.redSqr().redIAdd(Ci).redISub(Ai).redISub(Ai),Ni=_i.redMul(Ai.redISub(Ii)).redISub(yi.redMul(Ci)),Pi=this.z.redMul(Ei);return this.curve.jpoint(Ii,Ni,Pi)},Wn.prototype.dblp=function(hi){if(hi===0)return this;if(this.isInfinity())return this;if(!hi)return this.dbl();var vi;if(this.curve.zeroA||this.curve.threeA){var gi=this;for(vi=0;vi<hi;vi++)gi=gi.dbl();return gi}var mi=this.curve.a,yi=this.curve.tinv,bi=this.x,Ei=this.y,_i=this.z,xi=_i.redSqr().redSqr(),Ci=Ei.redAdd(Ei);for(vi=0;vi<hi;vi++){var Ai=bi.redSqr(),Ii=Ci.redSqr(),Ni=Ii.redSqr(),Pi=Ai.redAdd(Ai).redIAdd(Ai).redIAdd(mi.redMul(xi)),Vi=bi.redMul(Ii),Ui=Pi.redSqr().redISub(Vi.redAdd(Vi)),Gi=Vi.redISub(Ui),Yi=Pi.redMul(Gi);Yi=Yi.redIAdd(Yi).redISub(Ni);var zi=Ci.redMul(_i);vi+1<hi&&(xi=xi.redMul(Ni)),bi=Ui,_i=zi,Ci=Yi}return this.curve.jpoint(bi,Ci.redMul(yi),_i)},Wn.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},Wn.prototype._zeroDbl=function(){var hi,vi,gi;if(this.zOne){var mi=this.x.redSqr(),yi=this.y.redSqr(),bi=yi.redSqr(),Ei=this.x.redAdd(yi).redSqr().redISub(mi).redISub(bi);Ei=Ei.redIAdd(Ei);var _i=mi.redAdd(mi).redIAdd(mi),xi=_i.redSqr().redISub(Ei).redISub(Ei),Ci=bi.redIAdd(bi);Ci=Ci.redIAdd(Ci),Ci=Ci.redIAdd(Ci),hi=xi,vi=_i.redMul(Ei.redISub(xi)).redISub(Ci),gi=this.y.redAdd(this.y)}else{var Ai=this.x.redSqr(),Ii=this.y.redSqr(),Ni=Ii.redSqr(),Pi=this.x.redAdd(Ii).redSqr().redISub(Ai).redISub(Ni);Pi=Pi.redIAdd(Pi);var Vi=Ai.redAdd(Ai).redIAdd(Ai),Ui=Vi.redSqr(),Gi=Ni.redIAdd(Ni);Gi=Gi.redIAdd(Gi),Gi=Gi.redIAdd(Gi),hi=Ui.redISub(Pi).redISub(Pi),vi=Vi.redMul(Pi.redISub(hi)).redISub(Gi),gi=this.y.redMul(this.z),gi=gi.redIAdd(gi)}return this.curve.jpoint(hi,vi,gi)},Wn.prototype._threeDbl=function(){var hi,vi,gi;if(this.zOne){var mi=this.x.redSqr(),yi=this.y.redSqr(),bi=yi.redSqr(),Ei=this.x.redAdd(yi).redSqr().redISub(mi).redISub(bi);Ei=Ei.redIAdd(Ei);var _i=mi.redAdd(mi).redIAdd(mi).redIAdd(this.curve.a),xi=_i.redSqr().redISub(Ei).redISub(Ei);hi=xi;var Ci=bi.redIAdd(bi);Ci=Ci.redIAdd(Ci),Ci=Ci.redIAdd(Ci),vi=_i.redMul(Ei.redISub(xi)).redISub(Ci),gi=this.y.redAdd(this.y)}else{var Ai=this.z.redSqr(),Ii=this.y.redSqr(),Ni=this.x.redMul(Ii),Pi=this.x.redSub(Ai).redMul(this.x.redAdd(Ai));Pi=Pi.redAdd(Pi).redIAdd(Pi);var Vi=Ni.redIAdd(Ni);Vi=Vi.redIAdd(Vi);var Ui=Vi.redAdd(Vi);hi=Pi.redSqr().redISub(Ui),gi=this.y.redAdd(this.z).redSqr().redISub(Ii).redISub(Ai);var Gi=Ii.redSqr();Gi=Gi.redIAdd(Gi),Gi=Gi.redIAdd(Gi),Gi=Gi.redIAdd(Gi),vi=Pi.redMul(Vi.redISub(hi)).redISub(Gi)}return this.curve.jpoint(hi,vi,gi)},Wn.prototype._dbl=function(){var hi=this.curve.a,vi=this.x,gi=this.y,mi=this.z,yi=mi.redSqr().redSqr(),bi=vi.redSqr(),Ei=gi.redSqr(),_i=bi.redAdd(bi).redIAdd(bi).redIAdd(hi.redMul(yi)),xi=vi.redAdd(vi);xi=xi.redIAdd(xi);var Ci=xi.redMul(Ei),Ai=_i.redSqr().redISub(Ci.redAdd(Ci)),Ii=Ci.redISub(Ai),Ni=Ei.redSqr();Ni=Ni.redIAdd(Ni),Ni=Ni.redIAdd(Ni),Ni=Ni.redIAdd(Ni);var Pi=_i.redMul(Ii).redISub(Ni),Vi=gi.redAdd(gi).redMul(mi);return this.curve.jpoint(Ai,Pi,Vi)},Wn.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var hi=this.x.redSqr(),vi=this.y.redSqr(),gi=this.z.redSqr(),mi=vi.redSqr(),yi=hi.redAdd(hi).redIAdd(hi),bi=yi.redSqr(),Ei=this.x.redAdd(vi).redSqr().redISub(hi).redISub(mi);Ei=Ei.redIAdd(Ei),Ei=Ei.redAdd(Ei).redIAdd(Ei),Ei=Ei.redISub(bi);var _i=Ei.redSqr(),xi=mi.redIAdd(mi);xi=xi.redIAdd(xi),xi=xi.redIAdd(xi),xi=xi.redIAdd(xi);var Ci=yi.redIAdd(Ei).redSqr().redISub(bi).redISub(_i).redISub(xi),Ai=vi.redMul(Ci);Ai=Ai.redIAdd(Ai),Ai=Ai.redIAdd(Ai);var Ii=this.x.redMul(_i).redISub(Ai);Ii=Ii.redIAdd(Ii),Ii=Ii.redIAdd(Ii);var Ni=this.y.redMul(Ci.redMul(xi.redISub(Ci)).redISub(Ei.redMul(_i)));Ni=Ni.redIAdd(Ni),Ni=Ni.redIAdd(Ni),Ni=Ni.redIAdd(Ni);var Pi=this.z.redAdd(Ei).redSqr().redISub(gi).redISub(_i);return this.curve.jpoint(Ii,Ni,Pi)},Wn.prototype.mul=function(hi,vi){return hi=new In(hi,vi),this.curve._wnafMul(this,hi)},Wn.prototype.eq=function(hi){if(hi.type==="affine")return this.eq(hi.toJ());if(this===hi)return!0;var vi=this.z.redSqr(),gi=hi.z.redSqr();if(this.x.redMul(gi).redISub(hi.x.redMul(vi)).cmpn(0)!==0)return!1;var mi=vi.redMul(this.z),yi=gi.redMul(hi.z);return this.y.redMul(yi).redISub(hi.y.redMul(mi)).cmpn(0)===0},Wn.prototype.eqXToP=function(hi){var vi=this.z.redSqr(),gi=hi.toRed(this.curve.red).redMul(vi);if(this.x.cmp(gi)===0)return!0;for(var mi=hi.clone(),yi=this.curve.redN.redMul(vi);;){if(mi.iadd(this.curve.n),mi.cmp(this.curve.p)>=0)return!1;if(gi.redIAdd(yi),this.x.cmp(gi)===0)return!0}},Wn.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},Wn.prototype.isInfinity=function(){return this.z.cmpn(0)===0},short}var mont,hasRequiredMont;function requireMont(){if(hasRequiredMont)return mont;hasRequiredMont=1;var on=requireBn$2(),In=requireInherits_browser(),Rn=requireBase$1(),Mn=requireUtils$1();function Ln(jn){Rn.call(this,"mont",jn),this.a=new on(jn.a,16).toRed(this.red),this.b=new on(jn.b,16).toRed(this.red),this.i4=new on(4).toRed(this.red).redInvm(),this.two=new on(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}In(Ln,Rn),mont=Ln,Ln.prototype.validate=function(Wn){var Yn=Wn.normalize().x,hi=Yn.redSqr(),vi=hi.redMul(Yn).redAdd(hi.redMul(this.a)).redAdd(Yn),gi=vi.redSqrt();return gi.redSqr().cmp(vi)===0};function Hn(jn,Wn,Yn){Rn.BasePoint.call(this,jn,"projective"),Wn===null&&Yn===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new on(Wn,16),this.z=new on(Yn,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}return In(Hn,Rn.BasePoint),Ln.prototype.decodePoint=function(Wn,Yn){return this.point(Mn.toArray(Wn,Yn),1)},Ln.prototype.point=function(Wn,Yn){return new Hn(this,Wn,Yn)},Ln.prototype.pointFromJSON=function(Wn){return Hn.fromJSON(this,Wn)},Hn.prototype.precompute=function(){},Hn.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},Hn.fromJSON=function(Wn,Yn){return new Hn(Wn,Yn[0],Yn[1]||Wn.one)},Hn.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Hn.prototype.isInfinity=function(){return this.z.cmpn(0)===0},Hn.prototype.dbl=function(){var Wn=this.x.redAdd(this.z),Yn=Wn.redSqr(),hi=this.x.redSub(this.z),vi=hi.redSqr(),gi=Yn.redSub(vi),mi=Yn.redMul(vi),yi=gi.redMul(vi.redAdd(this.curve.a24.redMul(gi)));return this.curve.point(mi,yi)},Hn.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},Hn.prototype.diffAdd=function(Wn,Yn){var hi=this.x.redAdd(this.z),vi=this.x.redSub(this.z),gi=Wn.x.redAdd(Wn.z),mi=Wn.x.redSub(Wn.z),yi=mi.redMul(hi),bi=gi.redMul(vi),Ei=Yn.z.redMul(yi.redAdd(bi).redSqr()),_i=Yn.x.redMul(yi.redISub(bi).redSqr());return this.curve.point(Ei,_i)},Hn.prototype.mul=function(Wn){for(var Yn=Wn.clone(),hi=this,vi=this.curve.point(null,null),gi=this,mi=[];Yn.cmpn(0)!==0;Yn.iushrn(1))mi.push(Yn.andln(1));for(var yi=mi.length-1;yi>=0;yi--)mi[yi]===0?(hi=hi.diffAdd(vi,gi),vi=vi.dbl()):(vi=hi.diffAdd(vi,gi),hi=hi.dbl());return vi},Hn.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},Hn.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},Hn.prototype.eq=function(Wn){return this.getX().cmp(Wn.getX())===0},Hn.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Hn.prototype.getX=function(){return this.normalize(),this.x.fromRed()},mont}var edwards,hasRequiredEdwards;function requireEdwards(){if(hasRequiredEdwards)return edwards;hasRequiredEdwards=1;var on=requireUtils$1(),In=requireBn$2(),Rn=requireInherits_browser(),Mn=requireBase$1(),Ln=on.assert;function Hn(Wn){this.twisted=(Wn.a|0)!==1,this.mOneA=this.twisted&&(Wn.a|0)===-1,this.extended=this.mOneA,Mn.call(this,"edwards",Wn),this.a=new In(Wn.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new In(Wn.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new In(Wn.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),Ln(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(Wn.c|0)===1}Rn(Hn,Mn),edwards=Hn,Hn.prototype._mulA=function(Yn){return this.mOneA?Yn.redNeg():this.a.redMul(Yn)},Hn.prototype._mulC=function(Yn){return this.oneC?Yn:this.c.redMul(Yn)},Hn.prototype.jpoint=function(Yn,hi,vi,gi){return this.point(Yn,hi,vi,gi)},Hn.prototype.pointFromX=function(Yn,hi){Yn=new In(Yn,16),Yn.red||(Yn=Yn.toRed(this.red));var vi=Yn.redSqr(),gi=this.c2.redSub(this.a.redMul(vi)),mi=this.one.redSub(this.c2.redMul(this.d).redMul(vi)),yi=gi.redMul(mi.redInvm()),bi=yi.redSqrt();if(bi.redSqr().redSub(yi).cmp(this.zero)!==0)throw new Error("invalid point");var Ei=bi.fromRed().isOdd();return(hi&&!Ei||!hi&&Ei)&&(bi=bi.redNeg()),this.point(Yn,bi)},Hn.prototype.pointFromY=function(Yn,hi){Yn=new In(Yn,16),Yn.red||(Yn=Yn.toRed(this.red));var vi=Yn.redSqr(),gi=vi.redSub(this.c2),mi=vi.redMul(this.d).redMul(this.c2).redSub(this.a),yi=gi.redMul(mi.redInvm());if(yi.cmp(this.zero)===0){if(hi)throw new Error("invalid point");return this.point(this.zero,Yn)}var bi=yi.redSqrt();if(bi.redSqr().redSub(yi).cmp(this.zero)!==0)throw new Error("invalid point");return bi.fromRed().isOdd()!==hi&&(bi=bi.redNeg()),this.point(bi,Yn)},Hn.prototype.validate=function(Yn){if(Yn.isInfinity())return!0;Yn.normalize();var hi=Yn.x.redSqr(),vi=Yn.y.redSqr(),gi=hi.redMul(this.a).redAdd(vi),mi=this.c2.redMul(this.one.redAdd(this.d.redMul(hi).redMul(vi)));return gi.cmp(mi)===0};function jn(Wn,Yn,hi,vi,gi){Mn.BasePoint.call(this,Wn,"projective"),Yn===null&&hi===null&&vi===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new In(Yn,16),this.y=new In(hi,16),this.z=vi?new In(vi,16):this.curve.one,this.t=gi&&new In(gi,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}return Rn(jn,Mn.BasePoint),Hn.prototype.pointFromJSON=function(Yn){return jn.fromJSON(this,Yn)},Hn.prototype.point=function(Yn,hi,vi,gi){return new jn(this,Yn,hi,vi,gi)},jn.fromJSON=function(Yn,hi){return new jn(Yn,hi[0],hi[1],hi[2])},jn.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},jn.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},jn.prototype._extDbl=function(){var Yn=this.x.redSqr(),hi=this.y.redSqr(),vi=this.z.redSqr();vi=vi.redIAdd(vi);var gi=this.curve._mulA(Yn),mi=this.x.redAdd(this.y).redSqr().redISub(Yn).redISub(hi),yi=gi.redAdd(hi),bi=yi.redSub(vi),Ei=gi.redSub(hi),_i=mi.redMul(bi),xi=yi.redMul(Ei),Ci=mi.redMul(Ei),Ai=bi.redMul(yi);return this.curve.point(_i,xi,Ai,Ci)},jn.prototype._projDbl=function(){var Yn=this.x.redAdd(this.y).redSqr(),hi=this.x.redSqr(),vi=this.y.redSqr(),gi,mi,yi,bi,Ei,_i;if(this.curve.twisted){bi=this.curve._mulA(hi);var xi=bi.redAdd(vi);this.zOne?(gi=Yn.redSub(hi).redSub(vi).redMul(xi.redSub(this.curve.two)),mi=xi.redMul(bi.redSub(vi)),yi=xi.redSqr().redSub(xi).redSub(xi)):(Ei=this.z.redSqr(),_i=xi.redSub(Ei).redISub(Ei),gi=Yn.redSub(hi).redISub(vi).redMul(_i),mi=xi.redMul(bi.redSub(vi)),yi=xi.redMul(_i))}else bi=hi.redAdd(vi),Ei=this.curve._mulC(this.z).redSqr(),_i=bi.redSub(Ei).redSub(Ei),gi=this.curve._mulC(Yn.redISub(bi)).redMul(_i),mi=this.curve._mulC(bi).redMul(hi.redISub(vi)),yi=bi.redMul(_i);return this.curve.point(gi,mi,yi)},jn.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},jn.prototype._extAdd=function(Yn){var hi=this.y.redSub(this.x).redMul(Yn.y.redSub(Yn.x)),vi=this.y.redAdd(this.x).redMul(Yn.y.redAdd(Yn.x)),gi=this.t.redMul(this.curve.dd).redMul(Yn.t),mi=this.z.redMul(Yn.z.redAdd(Yn.z)),yi=vi.redSub(hi),bi=mi.redSub(gi),Ei=mi.redAdd(gi),_i=vi.redAdd(hi),xi=yi.redMul(bi),Ci=Ei.redMul(_i),Ai=yi.redMul(_i),Ii=bi.redMul(Ei);return this.curve.point(xi,Ci,Ii,Ai)},jn.prototype._projAdd=function(Yn){var hi=this.z.redMul(Yn.z),vi=hi.redSqr(),gi=this.x.redMul(Yn.x),mi=this.y.redMul(Yn.y),yi=this.curve.d.redMul(gi).redMul(mi),bi=vi.redSub(yi),Ei=vi.redAdd(yi),_i=this.x.redAdd(this.y).redMul(Yn.x.redAdd(Yn.y)).redISub(gi).redISub(mi),xi=hi.redMul(bi).redMul(_i),Ci,Ai;return this.curve.twisted?(Ci=hi.redMul(Ei).redMul(mi.redSub(this.curve._mulA(gi))),Ai=bi.redMul(Ei)):(Ci=hi.redMul(Ei).redMul(mi.redSub(gi)),Ai=this.curve._mulC(bi).redMul(Ei)),this.curve.point(xi,Ci,Ai)},jn.prototype.add=function(Yn){return this.isInfinity()?Yn:Yn.isInfinity()?this:this.curve.extended?this._extAdd(Yn):this._projAdd(Yn)},jn.prototype.mul=function(Yn){return this._hasDoubles(Yn)?this.curve._fixedNafMul(this,Yn):this.curve._wnafMul(this,Yn)},jn.prototype.mulAdd=function(Yn,hi,vi){return this.curve._wnafMulAdd(1,[this,hi],[Yn,vi],2,!1)},jn.prototype.jmulAdd=function(Yn,hi,vi){return this.curve._wnafMulAdd(1,[this,hi],[Yn,vi],2,!0)},jn.prototype.normalize=function(){if(this.zOne)return this;var Yn=this.z.redInvm();return this.x=this.x.redMul(Yn),this.y=this.y.redMul(Yn),this.t&&(this.t=this.t.redMul(Yn)),this.z=this.curve.one,this.zOne=!0,this},jn.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},jn.prototype.getX=function(){return this.normalize(),this.x.fromRed()},jn.prototype.getY=function(){return this.normalize(),this.y.fromRed()},jn.prototype.eq=function(Yn){return this===Yn||this.getX().cmp(Yn.getX())===0&&this.getY().cmp(Yn.getY())===0},jn.prototype.eqXToP=function(Yn){var hi=Yn.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(hi)===0)return!0;for(var vi=Yn.clone(),gi=this.curve.redN.redMul(this.z);;){if(vi.iadd(this.curve.n),vi.cmp(this.curve.p)>=0)return!1;if(hi.redIAdd(gi),this.x.cmp(hi)===0)return!0}},jn.prototype.toP=jn.prototype.normalize,jn.prototype.mixedAdd=jn.prototype.add,edwards}var hasRequiredCurve;function requireCurve(){return hasRequiredCurve||(hasRequiredCurve=1,function(on){var In=on;In.base=requireBase$1(),In.short=requireShort(),In.mont=requireMont(),In.edwards=requireEdwards()}(curve)),curve}var curves={},hash={},utils={},hasRequiredUtils;function requireUtils(){if(hasRequiredUtils)return utils;hasRequiredUtils=1;var on=requireMinimalisticAssert(),In=requireInherits_browser();utils.inherits=In;function Rn(Mi,Li){return(Mi.charCodeAt(Li)&64512)!==55296||Li<0||Li+1>=Mi.length?!1:(Mi.charCodeAt(Li+1)&64512)===56320}function Mn(Mi,Li){if(Array.isArray(Mi))return Mi.slice();if(!Mi)return[];var wi=[];if(typeof Mi=="string")if(Li){if(Li==="hex")for(Mi=Mi.replace(/[^a-z0-9]+/ig,""),Mi.length%2!==0&&(Mi="0"+Mi),ki=0;ki<Mi.length;ki+=2)wi.push(parseInt(Mi[ki]+Mi[ki+1],16))}else for(var Ri=0,ki=0;ki<Mi.length;ki++){var Bi=Mi.charCodeAt(ki);Bi<128?wi[Ri++]=Bi:Bi<2048?(wi[Ri++]=Bi>>6|192,wi[Ri++]=Bi&63|128):Rn(Mi,ki)?(Bi=65536+((Bi&1023)<<10)+(Mi.charCodeAt(++ki)&1023),wi[Ri++]=Bi>>18|240,wi[Ri++]=Bi>>12&63|128,wi[Ri++]=Bi>>6&63|128,wi[Ri++]=Bi&63|128):(wi[Ri++]=Bi>>12|224,wi[Ri++]=Bi>>6&63|128,wi[Ri++]=Bi&63|128)}else for(ki=0;ki<Mi.length;ki++)wi[ki]=Mi[ki]|0;return wi}utils.toArray=Mn;function Ln(Mi){for(var Li="",wi=0;wi<Mi.length;wi++)Li+=Wn(Mi[wi].toString(16));return Li}utils.toHex=Ln;function Hn(Mi){var Li=Mi>>>24|Mi>>>8&65280|Mi<<8&16711680|(Mi&255)<<24;return Li>>>0}utils.htonl=Hn;function jn(Mi,Li){for(var wi="",Ri=0;Ri<Mi.length;Ri++){var ki=Mi[Ri];Li==="little"&&(ki=Hn(ki)),wi+=Yn(ki.toString(16))}return wi}utils.toHex32=jn;function Wn(Mi){return Mi.length===1?"0"+Mi:Mi}utils.zero2=Wn;function Yn(Mi){return Mi.length===7?"0"+Mi:Mi.length===6?"00"+Mi:Mi.length===5?"000"+Mi:Mi.length===4?"0000"+Mi:Mi.length===3?"00000"+Mi:Mi.length===2?"000000"+Mi:Mi.length===1?"0000000"+Mi:Mi}utils.zero8=Yn;function hi(Mi,Li,wi,Ri){var ki=wi-Li;on(ki%4===0);for(var Bi=new Array(ki/4),Hi=0,Ki=Li;Hi<Bi.length;Hi++,Ki+=4){var ji;Ri==="big"?ji=Mi[Ki]<<24|Mi[Ki+1]<<16|Mi[Ki+2]<<8|Mi[Ki+3]:ji=Mi[Ki+3]<<24|Mi[Ki+2]<<16|Mi[Ki+1]<<8|Mi[Ki],Bi[Hi]=ji>>>0}return Bi}utils.join32=hi;function vi(Mi,Li){for(var wi=new Array(Mi.length*4),Ri=0,ki=0;Ri<Mi.length;Ri++,ki+=4){var Bi=Mi[Ri];Li==="big"?(wi[ki]=Bi>>>24,wi[ki+1]=Bi>>>16&255,wi[ki+2]=Bi>>>8&255,wi[ki+3]=Bi&255):(wi[ki+3]=Bi>>>24,wi[ki+2]=Bi>>>16&255,wi[ki+1]=Bi>>>8&255,wi[ki]=Bi&255)}return wi}utils.split32=vi;function gi(Mi,Li){return Mi>>>Li|Mi<<32-Li}utils.rotr32=gi;function mi(Mi,Li){return Mi<<Li|Mi>>>32-Li}utils.rotl32=mi;function yi(Mi,Li){return Mi+Li>>>0}utils.sum32=yi;function bi(Mi,Li,wi){return Mi+Li+wi>>>0}utils.sum32_3=bi;function Ei(Mi,Li,wi,Ri){return Mi+Li+wi+Ri>>>0}utils.sum32_4=Ei;function _i(Mi,Li,wi,Ri,ki){return Mi+Li+wi+Ri+ki>>>0}utils.sum32_5=_i;function xi(Mi,Li,wi,Ri){var ki=Mi[Li],Bi=Mi[Li+1],Hi=Ri+Bi>>>0,Ki=(Hi<Ri?1:0)+wi+ki;Mi[Li]=Ki>>>0,Mi[Li+1]=Hi}utils.sum64=xi;function Ci(Mi,Li,wi,Ri){var ki=Li+Ri>>>0,Bi=(ki<Li?1:0)+Mi+wi;return Bi>>>0}utils.sum64_hi=Ci;function Ai(Mi,Li,wi,Ri){var ki=Li+Ri;return ki>>>0}utils.sum64_lo=Ai;function Ii(Mi,Li,wi,Ri,ki,Bi,Hi,Ki){var ji=0,Fi=Li;Fi=Fi+Ri>>>0,ji+=Fi<Li?1:0,Fi=Fi+Bi>>>0,ji+=Fi<Bi?1:0,Fi=Fi+Ki>>>0,ji+=Fi<Ki?1:0;var $i=Mi+wi+ki+Hi+ji;return $i>>>0}utils.sum64_4_hi=Ii;function Ni(Mi,Li,wi,Ri,ki,Bi,Hi,Ki){var ji=Li+Ri+Bi+Ki;return ji>>>0}utils.sum64_4_lo=Ni;function Pi(Mi,Li,wi,Ri,ki,Bi,Hi,Ki,ji,Fi){var $i=0,Wi=Li;Wi=Wi+Ri>>>0,$i+=Wi<Li?1:0,Wi=Wi+Bi>>>0,$i+=Wi<Bi?1:0,Wi=Wi+Ki>>>0,$i+=Wi<Ki?1:0,Wi=Wi+Fi>>>0,$i+=Wi<Fi?1:0;var Qi=Mi+wi+ki+Hi+ji+$i;return Qi>>>0}utils.sum64_5_hi=Pi;function Vi(Mi,Li,wi,Ri,ki,Bi,Hi,Ki,ji,Fi){var $i=Li+Ri+Bi+Ki+Fi;return $i>>>0}utils.sum64_5_lo=Vi;function Ui(Mi,Li,wi){var Ri=Li<<32-wi|Mi>>>wi;return Ri>>>0}utils.rotr64_hi=Ui;function Gi(Mi,Li,wi){var Ri=Mi<<32-wi|Li>>>wi;return Ri>>>0}utils.rotr64_lo=Gi;function Yi(Mi,Li,wi){return Mi>>>wi}utils.shr64_hi=Yi;function zi(Mi,Li,wi){var Ri=Mi<<32-wi|Li>>>wi;return Ri>>>0}return utils.shr64_lo=zi,utils}var common$1={},hasRequiredCommon$1;function requireCommon$1(){if(hasRequiredCommon$1)return common$1;hasRequiredCommon$1=1;var on=requireUtils(),In=requireMinimalisticAssert();function Rn(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}return common$1.BlockHash=Rn,Rn.prototype.update=function(Ln,Hn){if(Ln=on.toArray(Ln,Hn),this.pending?this.pending=this.pending.concat(Ln):this.pending=Ln,this.pendingTotal+=Ln.length,this.pending.length>=this._delta8){Ln=this.pending;var jn=Ln.length%this._delta8;this.pending=Ln.slice(Ln.length-jn,Ln.length),this.pending.length===0&&(this.pending=null),Ln=on.join32(Ln,0,Ln.length-jn,this.endian);for(var Wn=0;Wn<Ln.length;Wn+=this._delta32)this._update(Ln,Wn,Wn+this._delta32)}return this},Rn.prototype.digest=function(Ln){return this.update(this._pad()),In(this.pending===null),this._digest(Ln)},Rn.prototype._pad=function(){var Ln=this.pendingTotal,Hn=this._delta8,jn=Hn-(Ln+this.padLength)%Hn,Wn=new Array(jn+this.padLength);Wn[0]=128;for(var Yn=1;Yn<jn;Yn++)Wn[Yn]=0;if(Ln<<=3,this.endian==="big"){for(var hi=8;hi<this.padLength;hi++)Wn[Yn++]=0;Wn[Yn++]=0,Wn[Yn++]=0,Wn[Yn++]=0,Wn[Yn++]=0,Wn[Yn++]=Ln>>>24&255,Wn[Yn++]=Ln>>>16&255,Wn[Yn++]=Ln>>>8&255,Wn[Yn++]=Ln&255}else for(Wn[Yn++]=Ln&255,Wn[Yn++]=Ln>>>8&255,Wn[Yn++]=Ln>>>16&255,Wn[Yn++]=Ln>>>24&255,Wn[Yn++]=0,Wn[Yn++]=0,Wn[Yn++]=0,Wn[Yn++]=0,hi=8;hi<this.padLength;hi++)Wn[Yn++]=0;return Wn},common$1}var sha={},common={},hasRequiredCommon;function requireCommon(){if(hasRequiredCommon)return common;hasRequiredCommon=1;var on=requireUtils(),In=on.rotr32;function Rn(vi,gi,mi,yi){if(vi===0)return Mn(gi,mi,yi);if(vi===1||vi===3)return Hn(gi,mi,yi);if(vi===2)return Ln(gi,mi,yi)}common.ft_1=Rn;function Mn(vi,gi,mi){return vi&gi^~vi&mi}common.ch32=Mn;function Ln(vi,gi,mi){return vi&gi^vi&mi^gi&mi}common.maj32=Ln;function Hn(vi,gi,mi){return vi^gi^mi}common.p32=Hn;function jn(vi){return In(vi,2)^In(vi,13)^In(vi,22)}common.s0_256=jn;function Wn(vi){return In(vi,6)^In(vi,11)^In(vi,25)}common.s1_256=Wn;function Yn(vi){return In(vi,7)^In(vi,18)^vi>>>3}common.g0_256=Yn;function hi(vi){return In(vi,17)^In(vi,19)^vi>>>10}return common.g1_256=hi,common}var _1,hasRequired_1;function require_1(){if(hasRequired_1)return _1;hasRequired_1=1;var on=requireUtils(),In=requireCommon$1(),Rn=requireCommon(),Mn=on.rotl32,Ln=on.sum32,Hn=on.sum32_5,jn=Rn.ft_1,Wn=In.BlockHash,Yn=[1518500249,1859775393,2400959708,3395469782];function hi(){if(!(this instanceof hi))return new hi;Wn.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}return on.inherits(hi,Wn),_1=hi,hi.blockSize=512,hi.outSize=160,hi.hmacStrength=80,hi.padLength=64,hi.prototype._update=function(gi,mi){for(var yi=this.W,bi=0;bi<16;bi++)yi[bi]=gi[mi+bi];for(;bi<yi.length;bi++)yi[bi]=Mn(yi[bi-3]^yi[bi-8]^yi[bi-14]^yi[bi-16],1);var Ei=this.h[0],_i=this.h[1],xi=this.h[2],Ci=this.h[3],Ai=this.h[4];for(bi=0;bi<yi.length;bi++){var Ii=~~(bi/20),Ni=Hn(Mn(Ei,5),jn(Ii,_i,xi,Ci),Ai,yi[bi],Yn[Ii]);Ai=Ci,Ci=xi,xi=Mn(_i,30),_i=Ei,Ei=Ni}this.h[0]=Ln(this.h[0],Ei),this.h[1]=Ln(this.h[1],_i),this.h[2]=Ln(this.h[2],xi),this.h[3]=Ln(this.h[3],Ci),this.h[4]=Ln(this.h[4],Ai)},hi.prototype._digest=function(gi){return gi==="hex"?on.toHex32(this.h,"big"):on.split32(this.h,"big")},_1}var _256,hasRequired_256;function require_256(){if(hasRequired_256)return _256;hasRequired_256=1;var on=requireUtils(),In=requireCommon$1(),Rn=requireCommon(),Mn=requireMinimalisticAssert(),Ln=on.sum32,Hn=on.sum32_4,jn=on.sum32_5,Wn=Rn.ch32,Yn=Rn.maj32,hi=Rn.s0_256,vi=Rn.s1_256,gi=Rn.g0_256,mi=Rn.g1_256,yi=In.BlockHash,bi=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function Ei(){if(!(this instanceof Ei))return new Ei;yi.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=bi,this.W=new Array(64)}return on.inherits(Ei,yi),_256=Ei,Ei.blockSize=512,Ei.outSize=256,Ei.hmacStrength=192,Ei.padLength=64,Ei.prototype._update=function(xi,Ci){for(var Ai=this.W,Ii=0;Ii<16;Ii++)Ai[Ii]=xi[Ci+Ii];for(;Ii<Ai.length;Ii++)Ai[Ii]=Hn(mi(Ai[Ii-2]),Ai[Ii-7],gi(Ai[Ii-15]),Ai[Ii-16]);var Ni=this.h[0],Pi=this.h[1],Vi=this.h[2],Ui=this.h[3],Gi=this.h[4],Yi=this.h[5],zi=this.h[6],Mi=this.h[7];for(Mn(this.k.length===Ai.length),Ii=0;Ii<Ai.length;Ii++){var Li=jn(Mi,vi(Gi),Wn(Gi,Yi,zi),this.k[Ii],Ai[Ii]),wi=Ln(hi(Ni),Yn(Ni,Pi,Vi));Mi=zi,zi=Yi,Yi=Gi,Gi=Ln(Ui,Li),Ui=Vi,Vi=Pi,Pi=Ni,Ni=Ln(Li,wi)}this.h[0]=Ln(this.h[0],Ni),this.h[1]=Ln(this.h[1],Pi),this.h[2]=Ln(this.h[2],Vi),this.h[3]=Ln(this.h[3],Ui),this.h[4]=Ln(this.h[4],Gi),this.h[5]=Ln(this.h[5],Yi),this.h[6]=Ln(this.h[6],zi),this.h[7]=Ln(this.h[7],Mi)},Ei.prototype._digest=function(xi){return xi==="hex"?on.toHex32(this.h,"big"):on.split32(this.h,"big")},_256}var _224,hasRequired_224;function require_224(){if(hasRequired_224)return _224;hasRequired_224=1;var on=requireUtils(),In=require_256();function Rn(){if(!(this instanceof Rn))return new Rn;In.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}return on.inherits(Rn,In),_224=Rn,Rn.blockSize=512,Rn.outSize=224,Rn.hmacStrength=192,Rn.padLength=64,Rn.prototype._digest=function(Ln){return Ln==="hex"?on.toHex32(this.h.slice(0,7),"big"):on.split32(this.h.slice(0,7),"big")},_224}var _512,hasRequired_512;function require_512(){if(hasRequired_512)return _512;hasRequired_512=1;var on=requireUtils(),In=requireCommon$1(),Rn=requireMinimalisticAssert(),Mn=on.rotr64_hi,Ln=on.rotr64_lo,Hn=on.shr64_hi,jn=on.shr64_lo,Wn=on.sum64,Yn=on.sum64_hi,hi=on.sum64_lo,vi=on.sum64_4_hi,gi=on.sum64_4_lo,mi=on.sum64_5_hi,yi=on.sum64_5_lo,bi=In.BlockHash,Ei=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function _i(){if(!(this instanceof _i))return new _i;bi.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=Ei,this.W=new Array(160)}on.inherits(_i,bi),_512=_i,_i.blockSize=1024,_i.outSize=512,_i.hmacStrength=192,_i.padLength=128,_i.prototype._prepareBlock=function(wi,Ri){for(var ki=this.W,Bi=0;Bi<32;Bi++)ki[Bi]=wi[Ri+Bi];for(;Bi<ki.length;Bi+=2){var Hi=zi(ki[Bi-4],ki[Bi-3]),Ki=Mi(ki[Bi-4],ki[Bi-3]),ji=ki[Bi-14],Fi=ki[Bi-13],$i=Gi(ki[Bi-30],ki[Bi-29]),Wi=Yi(ki[Bi-30],ki[Bi-29]),Qi=ki[Bi-32],ea=ki[Bi-31];ki[Bi]=vi(Hi,Ki,ji,Fi,$i,Wi,Qi,ea),ki[Bi+1]=gi(Hi,Ki,ji,Fi,$i,Wi,Qi,ea)}},_i.prototype._update=function(wi,Ri){this._prepareBlock(wi,Ri);var ki=this.W,Bi=this.h[0],Hi=this.h[1],Ki=this.h[2],ji=this.h[3],Fi=this.h[4],$i=this.h[5],Wi=this.h[6],Qi=this.h[7],ea=this.h[8],na=this.h[9],Ji=this.h[10],ra=this.h[11],sa=this.h[12],la=this.h[13],aa=this.h[14],ta=this.h[15];Rn(this.k.length===ki.length);for(var fa=0;fa<ki.length;fa+=2){var ca=aa,pa=ta,Ea=Vi(ea,na),xa=Ui(ea,na),ga=xi(ea,na,Ji,ra,sa),ma=Ci(ea,na,Ji,ra,sa,la),Aa=this.k[fa],va=this.k[fa+1],Sa=ki[fa],Ta=ki[fa+1],wa=mi(ca,pa,Ea,xa,ga,ma,Aa,va,Sa,Ta),Na=yi(ca,pa,Ea,xa,ga,ma,Aa,va,Sa,Ta);ca=Ni(Bi,Hi),pa=Pi(Bi,Hi),Ea=Ai(Bi,Hi,Ki,ji,Fi),xa=Ii(Bi,Hi,Ki,ji,Fi,$i);var $a=Yn(ca,pa,Ea,xa),Ma=hi(ca,pa,Ea,xa);aa=sa,ta=la,sa=Ji,la=ra,Ji=ea,ra=na,ea=Yn(Wi,Qi,wa,Na),na=hi(Qi,Qi,wa,Na),Wi=Fi,Qi=$i,Fi=Ki,$i=ji,Ki=Bi,ji=Hi,Bi=Yn(wa,Na,$a,Ma),Hi=hi(wa,Na,$a,Ma)}Wn(this.h,0,Bi,Hi),Wn(this.h,2,Ki,ji),Wn(this.h,4,Fi,$i),Wn(this.h,6,Wi,Qi),Wn(this.h,8,ea,na),Wn(this.h,10,Ji,ra),Wn(this.h,12,sa,la),Wn(this.h,14,aa,ta)},_i.prototype._digest=function(wi){return wi==="hex"?on.toHex32(this.h,"big"):on.split32(this.h,"big")};function xi(Li,wi,Ri,ki,Bi){var Hi=Li&Ri^~Li&Bi;return Hi<0&&(Hi+=4294967296),Hi}function Ci(Li,wi,Ri,ki,Bi,Hi){var Ki=wi&ki^~wi&Hi;return Ki<0&&(Ki+=4294967296),Ki}function Ai(Li,wi,Ri,ki,Bi){var Hi=Li&Ri^Li&Bi^Ri&Bi;return Hi<0&&(Hi+=4294967296),Hi}function Ii(Li,wi,Ri,ki,Bi,Hi){var Ki=wi&ki^wi&Hi^ki&Hi;return Ki<0&&(Ki+=4294967296),Ki}function Ni(Li,wi){var Ri=Mn(Li,wi,28),ki=Mn(wi,Li,2),Bi=Mn(wi,Li,7),Hi=Ri^ki^Bi;return Hi<0&&(Hi+=4294967296),Hi}function Pi(Li,wi){var Ri=Ln(Li,wi,28),ki=Ln(wi,Li,2),Bi=Ln(wi,Li,7),Hi=Ri^ki^Bi;return Hi<0&&(Hi+=4294967296),Hi}function Vi(Li,wi){var Ri=Mn(Li,wi,14),ki=Mn(Li,wi,18),Bi=Mn(wi,Li,9),Hi=Ri^ki^Bi;return Hi<0&&(Hi+=4294967296),Hi}function Ui(Li,wi){var Ri=Ln(Li,wi,14),ki=Ln(Li,wi,18),Bi=Ln(wi,Li,9),Hi=Ri^ki^Bi;return Hi<0&&(Hi+=4294967296),Hi}function Gi(Li,wi){var Ri=Mn(Li,wi,1),ki=Mn(Li,wi,8),Bi=Hn(Li,wi,7),Hi=Ri^ki^Bi;return Hi<0&&(Hi+=4294967296),Hi}function Yi(Li,wi){var Ri=Ln(Li,wi,1),ki=Ln(Li,wi,8),Bi=jn(Li,wi,7),Hi=Ri^ki^Bi;return Hi<0&&(Hi+=4294967296),Hi}function zi(Li,wi){var Ri=Mn(Li,wi,19),ki=Mn(wi,Li,29),Bi=Hn(Li,wi,6),Hi=Ri^ki^Bi;return Hi<0&&(Hi+=4294967296),Hi}function Mi(Li,wi){var Ri=Ln(Li,wi,19),ki=Ln(wi,Li,29),Bi=jn(Li,wi,6),Hi=Ri^ki^Bi;return Hi<0&&(Hi+=4294967296),Hi}return _512}var _384,hasRequired_384;function require_384(){if(hasRequired_384)return _384;hasRequired_384=1;var on=requireUtils(),In=require_512();function Rn(){if(!(this instanceof Rn))return new Rn;In.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}return on.inherits(Rn,In),_384=Rn,Rn.blockSize=1024,Rn.outSize=384,Rn.hmacStrength=192,Rn.padLength=128,Rn.prototype._digest=function(Ln){return Ln==="hex"?on.toHex32(this.h.slice(0,12),"big"):on.split32(this.h.slice(0,12),"big")},_384}var hasRequiredSha;function requireSha(){return hasRequiredSha||(hasRequiredSha=1,sha.sha1=require_1(),sha.sha224=require_224(),sha.sha256=require_256(),sha.sha384=require_384(),sha.sha512=require_512()),sha}var ripemd={},hasRequiredRipemd;function requireRipemd(){if(hasRequiredRipemd)return ripemd;hasRequiredRipemd=1;var on=requireUtils(),In=requireCommon$1(),Rn=on.rotl32,Mn=on.sum32,Ln=on.sum32_3,Hn=on.sum32_4,jn=In.BlockHash;function Wn(){if(!(this instanceof Wn))return new Wn;jn.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}on.inherits(Wn,jn),ripemd.ripemd160=Wn,Wn.blockSize=512,Wn.outSize=160,Wn.hmacStrength=192,Wn.padLength=64,Wn.prototype._update=function(_i,xi){for(var Ci=this.h[0],Ai=this.h[1],Ii=this.h[2],Ni=this.h[3],Pi=this.h[4],Vi=Ci,Ui=Ai,Gi=Ii,Yi=Ni,zi=Pi,Mi=0;Mi<80;Mi++){var Li=Mn(Rn(Hn(Ci,Yn(Mi,Ai,Ii,Ni),_i[gi[Mi]+xi],hi(Mi)),yi[Mi]),Pi);Ci=Pi,Pi=Ni,Ni=Rn(Ii,10),Ii=Ai,Ai=Li,Li=Mn(Rn(Hn(Vi,Yn(79-Mi,Ui,Gi,Yi),_i[mi[Mi]+xi],vi(Mi)),bi[Mi]),zi),Vi=zi,zi=Yi,Yi=Rn(Gi,10),Gi=Ui,Ui=Li}Li=Ln(this.h[1],Ii,Yi),this.h[1]=Ln(this.h[2],Ni,zi),this.h[2]=Ln(this.h[3],Pi,Vi),this.h[3]=Ln(this.h[4],Ci,Ui),this.h[4]=Ln(this.h[0],Ai,Gi),this.h[0]=Li},Wn.prototype._digest=function(_i){return _i==="hex"?on.toHex32(this.h,"little"):on.split32(this.h,"little")};function Yn(Ei,_i,xi,Ci){return Ei<=15?_i^xi^Ci:Ei<=31?_i&xi|~_i&Ci:Ei<=47?(_i|~xi)^Ci:Ei<=63?_i&Ci|xi&~Ci:_i^(xi|~Ci)}function hi(Ei){return Ei<=15?0:Ei<=31?1518500249:Ei<=47?1859775393:Ei<=63?2400959708:2840853838}function vi(Ei){return Ei<=15?1352829926:Ei<=31?1548603684:Ei<=47?1836072691:Ei<=63?2053994217:0}var gi=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],mi=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],yi=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],bi=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11];return ripemd}var hmac$2,hasRequiredHmac$1;function requireHmac$1(){if(hasRequiredHmac$1)return hmac$2;hasRequiredHmac$1=1;var on=requireUtils(),In=requireMinimalisticAssert();function Rn(Mn,Ln,Hn){if(!(this instanceof Rn))return new Rn(Mn,Ln,Hn);this.Hash=Mn,this.blockSize=Mn.blockSize/8,this.outSize=Mn.outSize/8,this.inner=null,this.outer=null,this._init(on.toArray(Ln,Hn))}return hmac$2=Rn,Rn.prototype._init=function(Ln){Ln.length>this.blockSize&&(Ln=new this.Hash().update(Ln).digest()),In(Ln.length<=this.blockSize);for(var Hn=Ln.length;Hn<this.blockSize;Hn++)Ln.push(0);for(Hn=0;Hn<Ln.length;Hn++)Ln[Hn]^=54;for(this.inner=new this.Hash().update(Ln),Hn=0;Hn<Ln.length;Hn++)Ln[Hn]^=106;this.outer=new this.Hash().update(Ln)},Rn.prototype.update=function(Ln,Hn){return this.inner.update(Ln,Hn),this},Rn.prototype.digest=function(Ln){return this.outer.update(this.inner.digest()),this.outer.digest(Ln)},hmac$2}var hasRequiredHash;function requireHash(){return hasRequiredHash||(hasRequiredHash=1,function(on){var In=on;In.utils=requireUtils(),In.common=requireCommon$1(),In.sha=requireSha(),In.ripemd=requireRipemd(),In.hmac=requireHmac$1(),In.sha1=In.sha.sha1,In.sha256=In.sha.sha256,In.sha224=In.sha.sha224,In.sha384=In.sha.sha384,In.sha512=In.sha.sha512,In.ripemd160=In.ripemd.ripemd160}(hash)),hash}var secp256k1,hasRequiredSecp256k1;function requireSecp256k1(){return hasRequiredSecp256k1||(hasRequiredSecp256k1=1,secp256k1={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}),secp256k1}var hasRequiredCurves;function requireCurves(){return hasRequiredCurves||(hasRequiredCurves=1,function(on){var In=on,Rn=requireHash(),Mn=requireCurve(),Ln=requireUtils$1(),Hn=Ln.assert;function jn(hi){hi.type==="short"?this.curve=new Mn.short(hi):hi.type==="edwards"?this.curve=new Mn.edwards(hi):this.curve=new Mn.mont(hi),this.g=this.curve.g,this.n=this.curve.n,this.hash=hi.hash,Hn(this.g.validate(),"Invalid curve"),Hn(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}In.PresetCurve=jn;function Wn(hi,vi){Object.defineProperty(In,hi,{configurable:!0,enumerable:!0,get:function(){var gi=new jn(vi);return Object.defineProperty(In,hi,{configurable:!0,enumerable:!0,value:gi}),gi}})}Wn("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Rn.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),Wn("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Rn.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),Wn("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Rn.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),Wn("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Rn.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),Wn("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Rn.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),Wn("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Rn.sha256,gRed:!1,g:["9"]}),Wn("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Rn.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var Yn;try{Yn=requireSecp256k1()}catch{Yn=void 0}Wn("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Rn.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",Yn]})}(curves)),curves}var hmacDrbg,hasRequiredHmacDrbg;function requireHmacDrbg(){if(hasRequiredHmacDrbg)return hmacDrbg;hasRequiredHmacDrbg=1;var on=requireHash(),In=requireUtils$2(),Rn=requireMinimalisticAssert();function Mn(Ln){if(!(this instanceof Mn))return new Mn(Ln);this.hash=Ln.hash,this.predResist=!!Ln.predResist,this.outLen=this.hash.outSize,this.minEntropy=Ln.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var Hn=In.toArray(Ln.entropy,Ln.entropyEnc||"hex"),jn=In.toArray(Ln.nonce,Ln.nonceEnc||"hex"),Wn=In.toArray(Ln.pers,Ln.persEnc||"hex");Rn(Hn.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(Hn,jn,Wn)}return hmacDrbg=Mn,Mn.prototype._init=function(Hn,jn,Wn){var Yn=Hn.concat(jn).concat(Wn);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var hi=0;hi<this.V.length;hi++)this.K[hi]=0,this.V[hi]=1;this._update(Yn),this._reseed=1,this.reseedInterval=281474976710656},Mn.prototype._hmac=function(){return new on.hmac(this.hash,this.K)},Mn.prototype._update=function(Hn){var jn=this._hmac().update(this.V).update([0]);Hn&&(jn=jn.update(Hn)),this.K=jn.digest(),this.V=this._hmac().update(this.V).digest(),Hn&&(this.K=this._hmac().update(this.V).update([1]).update(Hn).digest(),this.V=this._hmac().update(this.V).digest())},Mn.prototype.reseed=function(Hn,jn,Wn,Yn){typeof jn!="string"&&(Yn=Wn,Wn=jn,jn=null),Hn=In.toArray(Hn,jn),Wn=In.toArray(Wn,Yn),Rn(Hn.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(Hn.concat(Wn||[])),this._reseed=1},Mn.prototype.generate=function(Hn,jn,Wn,Yn){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof jn!="string"&&(Yn=Wn,Wn=jn,jn=null),Wn&&(Wn=In.toArray(Wn,Yn||"hex"),this._update(Wn));for(var hi=[];hi.length<Hn;)this.V=this._hmac().update(this.V).digest(),hi=hi.concat(this.V);var vi=hi.slice(0,Hn);return this._update(Wn),this._reseed++,In.encode(vi,jn)},hmacDrbg}var key$1,hasRequiredKey$1;function requireKey$1(){if(hasRequiredKey$1)return key$1;hasRequiredKey$1=1;var on=requireBn$2(),In=requireUtils$1(),Rn=In.assert;function Mn(Ln,Hn){this.ec=Ln,this.priv=null,this.pub=null,Hn.priv&&this._importPrivate(Hn.priv,Hn.privEnc),Hn.pub&&this._importPublic(Hn.pub,Hn.pubEnc)}return key$1=Mn,Mn.fromPublic=function(Hn,jn,Wn){return jn instanceof Mn?jn:new Mn(Hn,{pub:jn,pubEnc:Wn})},Mn.fromPrivate=function(Hn,jn,Wn){return jn instanceof Mn?jn:new Mn(Hn,{priv:jn,privEnc:Wn})},Mn.prototype.validate=function(){var Hn=this.getPublic();return Hn.isInfinity()?{result:!1,reason:"Invalid public key"}:Hn.validate()?Hn.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},Mn.prototype.getPublic=function(Hn,jn){return typeof Hn=="string"&&(jn=Hn,Hn=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),jn?this.pub.encode(jn,Hn):this.pub},Mn.prototype.getPrivate=function(Hn){return Hn==="hex"?this.priv.toString(16,2):this.priv},Mn.prototype._importPrivate=function(Hn,jn){this.priv=new on(Hn,jn||16),this.priv=this.priv.umod(this.ec.curve.n)},Mn.prototype._importPublic=function(Hn,jn){if(Hn.x||Hn.y){this.ec.curve.type==="mont"?Rn(Hn.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&Rn(Hn.x&&Hn.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(Hn.x,Hn.y);return}this.pub=this.ec.curve.decodePoint(Hn,jn)},Mn.prototype.derive=function(Hn){return Hn.validate()||Rn(Hn.validate(),"public point not validated"),Hn.mul(this.priv).getX()},Mn.prototype.sign=function(Hn,jn,Wn){return this.ec.sign(Hn,this,jn,Wn)},Mn.prototype.verify=function(Hn,jn,Wn){return this.ec.verify(Hn,jn,this,void 0,Wn)},Mn.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},key$1}var signature$1,hasRequiredSignature$1;function requireSignature$1(){if(hasRequiredSignature$1)return signature$1;hasRequiredSignature$1=1;var on=requireBn$2(),In=requireUtils$1(),Rn=In.assert;function Mn(Yn,hi){if(Yn instanceof Mn)return Yn;this._importDER(Yn,hi)||(Rn(Yn.r&&Yn.s,"Signature without r or s"),this.r=new on(Yn.r,16),this.s=new on(Yn.s,16),Yn.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=Yn.recoveryParam)}signature$1=Mn;function Ln(){this.place=0}function Hn(Yn,hi){var vi=Yn[hi.place++];if(!(vi&128))return vi;var gi=vi&15;if(gi===0||gi>4||Yn[hi.place]===0)return!1;for(var mi=0,yi=0,bi=hi.place;yi<gi;yi++,bi++)mi<<=8,mi|=Yn[bi],mi>>>=0;return mi<=127?!1:(hi.place=bi,mi)}function jn(Yn){for(var hi=0,vi=Yn.length-1;!Yn[hi]&&!(Yn[hi+1]&128)&&hi<vi;)hi++;return hi===0?Yn:Yn.slice(hi)}Mn.prototype._importDER=function(hi,vi){hi=In.toArray(hi,vi);var gi=new Ln;if(hi[gi.place++]!==48)return!1;var mi=Hn(hi,gi);if(mi===!1||mi+gi.place!==hi.length||hi[gi.place++]!==2)return!1;var yi=Hn(hi,gi);if(yi===!1||(hi[gi.place]&128)!==0)return!1;var bi=hi.slice(gi.place,yi+gi.place);if(gi.place+=yi,hi[gi.place++]!==2)return!1;var Ei=Hn(hi,gi);if(Ei===!1||hi.length!==Ei+gi.place||(hi[gi.place]&128)!==0)return!1;var _i=hi.slice(gi.place,Ei+gi.place);if(bi[0]===0)if(bi[1]&128)bi=bi.slice(1);else return!1;if(_i[0]===0)if(_i[1]&128)_i=_i.slice(1);else return!1;return this.r=new on(bi),this.s=new on(_i),this.recoveryParam=null,!0};function Wn(Yn,hi){if(hi<128){Yn.push(hi);return}var vi=1+(Math.log(hi)/Math.LN2>>>3);for(Yn.push(vi|128);--vi;)Yn.push(hi>>>(vi<<3)&255);Yn.push(hi)}return Mn.prototype.toDER=function(hi){var vi=this.r.toArray(),gi=this.s.toArray();for(vi[0]&128&&(vi=[0].concat(vi)),gi[0]&128&&(gi=[0].concat(gi)),vi=jn(vi),gi=jn(gi);!gi[0]&&!(gi[1]&128);)gi=gi.slice(1);var mi=[2];Wn(mi,vi.length),mi=mi.concat(vi),mi.push(2),Wn(mi,gi.length);var yi=mi.concat(gi),bi=[48];return Wn(bi,yi.length),bi=bi.concat(yi),In.encode(bi,hi)},signature$1}var ec,hasRequiredEc;function requireEc(){if(hasRequiredEc)return ec;hasRequiredEc=1;var on=requireBn$2(),In=requireHmacDrbg(),Rn=requireUtils$1(),Mn=requireCurves(),Ln=requireBrorand(),Hn=Rn.assert,jn=requireKey$1(),Wn=requireSignature$1();function Yn(hi){if(!(this instanceof Yn))return new Yn(hi);typeof hi=="string"&&(Hn(Object.prototype.hasOwnProperty.call(Mn,hi),"Unknown curve "+hi),hi=Mn[hi]),hi instanceof Mn.PresetCurve&&(hi={curve:hi}),this.curve=hi.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=hi.curve.g,this.g.precompute(hi.curve.n.bitLength()+1),this.hash=hi.hash||hi.curve.hash}return ec=Yn,Yn.prototype.keyPair=function(vi){return new jn(this,vi)},Yn.prototype.keyFromPrivate=function(vi,gi){return jn.fromPrivate(this,vi,gi)},Yn.prototype.keyFromPublic=function(vi,gi){return jn.fromPublic(this,vi,gi)},Yn.prototype.genKeyPair=function(vi){vi||(vi={});for(var gi=new In({hash:this.hash,pers:vi.pers,persEnc:vi.persEnc||"utf8",entropy:vi.entropy||Ln(this.hash.hmacStrength),entropyEnc:vi.entropy&&vi.entropyEnc||"utf8",nonce:this.n.toArray()}),mi=this.n.byteLength(),yi=this.n.sub(new on(2));;){var bi=new on(gi.generate(mi));if(!(bi.cmp(yi)>0))return bi.iaddn(1),this.keyFromPrivate(bi)}},Yn.prototype._truncateToN=function(vi,gi,mi){var yi;if(on.isBN(vi)||typeof vi=="number")vi=new on(vi,16),yi=vi.byteLength();else if(typeof vi=="object")yi=vi.length,vi=new on(vi,16);else{var bi=vi.toString();yi=bi.length+1>>>1,vi=new on(bi,16)}typeof mi!="number"&&(mi=yi*8);var Ei=mi-this.n.bitLength();return Ei>0&&(vi=vi.ushrn(Ei)),!gi&&vi.cmp(this.n)>=0?vi.sub(this.n):vi},Yn.prototype.sign=function(vi,gi,mi,yi){if(typeof mi=="object"&&(yi=mi,mi=null),yi||(yi={}),typeof vi!="string"&&typeof vi!="number"&&!on.isBN(vi)){Hn(typeof vi=="object"&&vi&&typeof vi.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),Hn(vi.length>>>0===vi.length);for(var bi=0;bi<vi.length;bi++)Hn((vi[bi]&255)===vi[bi])}gi=this.keyFromPrivate(gi,mi),vi=this._truncateToN(vi,!1,yi.msgBitLength),Hn(!vi.isNeg(),"Can not sign a negative message");var Ei=this.n.byteLength(),_i=gi.getPrivate().toArray("be",Ei),xi=vi.toArray("be",Ei);Hn(new on(xi).eq(vi),"Can not sign message");for(var Ci=new In({hash:this.hash,entropy:_i,nonce:xi,pers:yi.pers,persEnc:yi.persEnc||"utf8"}),Ai=this.n.sub(new on(1)),Ii=0;;Ii++){var Ni=yi.k?yi.k(Ii):new on(Ci.generate(this.n.byteLength()));if(Ni=this._truncateToN(Ni,!0),!(Ni.cmpn(1)<=0||Ni.cmp(Ai)>=0)){var Pi=this.g.mul(Ni);if(!Pi.isInfinity()){var Vi=Pi.getX(),Ui=Vi.umod(this.n);if(Ui.cmpn(0)!==0){var Gi=Ni.invm(this.n).mul(Ui.mul(gi.getPrivate()).iadd(vi));if(Gi=Gi.umod(this.n),Gi.cmpn(0)!==0){var Yi=(Pi.getY().isOdd()?1:0)|(Vi.cmp(Ui)!==0?2:0);return yi.canonical&&Gi.cmp(this.nh)>0&&(Gi=this.n.sub(Gi),Yi^=1),new Wn({r:Ui,s:Gi,recoveryParam:Yi})}}}}}},Yn.prototype.verify=function(vi,gi,mi,yi,bi){bi||(bi={}),vi=this._truncateToN(vi,!1,bi.msgBitLength),mi=this.keyFromPublic(mi,yi),gi=new Wn(gi,"hex");var Ei=gi.r,_i=gi.s;if(Ei.cmpn(1)<0||Ei.cmp(this.n)>=0||_i.cmpn(1)<0||_i.cmp(this.n)>=0)return!1;var xi=_i.invm(this.n),Ci=xi.mul(vi).umod(this.n),Ai=xi.mul(Ei).umod(this.n),Ii;return this.curve._maxwellTrick?(Ii=this.g.jmulAdd(Ci,mi.getPublic(),Ai),Ii.isInfinity()?!1:Ii.eqXToP(Ei)):(Ii=this.g.mulAdd(Ci,mi.getPublic(),Ai),Ii.isInfinity()?!1:Ii.getX().umod(this.n).cmp(Ei)===0)},Yn.prototype.recoverPubKey=function(hi,vi,gi,mi){Hn((3&gi)===gi,"The recovery param is more than two bits"),vi=new Wn(vi,mi);var yi=this.n,bi=new on(hi),Ei=vi.r,_i=vi.s,xi=gi&1,Ci=gi>>1;if(Ei.cmp(this.curve.p.umod(this.curve.n))>=0&&Ci)throw new Error("Unable to find sencond key candinate");Ci?Ei=this.curve.pointFromX(Ei.add(this.curve.n),xi):Ei=this.curve.pointFromX(Ei,xi);var Ai=vi.r.invm(yi),Ii=yi.sub(bi).mul(Ai).umod(yi),Ni=_i.mul(Ai).umod(yi);return this.g.mulAdd(Ii,Ei,Ni)},Yn.prototype.getKeyRecoveryParam=function(hi,vi,gi,mi){if(vi=new Wn(vi,mi),vi.recoveryParam!==null)return vi.recoveryParam;for(var yi=0;yi<4;yi++){var bi;try{bi=this.recoverPubKey(hi,vi,yi)}catch{continue}if(bi.eq(gi))return yi}throw new Error("Unable to find valid recovery factor")},ec}var key,hasRequiredKey;function requireKey(){if(hasRequiredKey)return key;hasRequiredKey=1;var on=requireUtils$1(),In=on.assert,Rn=on.parseBytes,Mn=on.cachedProperty;function Ln(Hn,jn){this.eddsa=Hn,this._secret=Rn(jn.secret),Hn.isPoint(jn.pub)?this._pub=jn.pub:this._pubBytes=Rn(jn.pub)}return Ln.fromPublic=function(jn,Wn){return Wn instanceof Ln?Wn:new Ln(jn,{pub:Wn})},Ln.fromSecret=function(jn,Wn){return Wn instanceof Ln?Wn:new Ln(jn,{secret:Wn})},Ln.prototype.secret=function(){return this._secret},Mn(Ln,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),Mn(Ln,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),Mn(Ln,"privBytes",function(){var jn=this.eddsa,Wn=this.hash(),Yn=jn.encodingLength-1,hi=Wn.slice(0,jn.encodingLength);return hi[0]&=248,hi[Yn]&=127,hi[Yn]|=64,hi}),Mn(Ln,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),Mn(Ln,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),Mn(Ln,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),Ln.prototype.sign=function(jn){return In(this._secret,"KeyPair can only verify"),this.eddsa.sign(jn,this)},Ln.prototype.verify=function(jn,Wn){return this.eddsa.verify(jn,Wn,this)},Ln.prototype.getSecret=function(jn){return In(this._secret,"KeyPair is public only"),on.encode(this.secret(),jn)},Ln.prototype.getPublic=function(jn){return on.encode(this.pubBytes(),jn)},key=Ln,key}var signature,hasRequiredSignature;function requireSignature(){if(hasRequiredSignature)return signature;hasRequiredSignature=1;var on=requireBn$2(),In=requireUtils$1(),Rn=In.assert,Mn=In.cachedProperty,Ln=In.parseBytes;function Hn(jn,Wn){this.eddsa=jn,typeof Wn!="object"&&(Wn=Ln(Wn)),Array.isArray(Wn)&&(Rn(Wn.length===jn.encodingLength*2,"Signature has invalid size"),Wn={R:Wn.slice(0,jn.encodingLength),S:Wn.slice(jn.encodingLength)}),Rn(Wn.R&&Wn.S,"Signature without R or S"),jn.isPoint(Wn.R)&&(this._R=Wn.R),Wn.S instanceof on&&(this._S=Wn.S),this._Rencoded=Array.isArray(Wn.R)?Wn.R:Wn.Rencoded,this._Sencoded=Array.isArray(Wn.S)?Wn.S:Wn.Sencoded}return Mn(Hn,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),Mn(Hn,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),Mn(Hn,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),Mn(Hn,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),Hn.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},Hn.prototype.toHex=function(){return In.encode(this.toBytes(),"hex").toUpperCase()},signature=Hn,signature}var eddsa,hasRequiredEddsa;function requireEddsa(){if(hasRequiredEddsa)return eddsa;hasRequiredEddsa=1;var on=requireHash(),In=requireCurves(),Rn=requireUtils$1(),Mn=Rn.assert,Ln=Rn.parseBytes,Hn=requireKey(),jn=requireSignature();function Wn(Yn){if(Mn(Yn==="ed25519","only tested with ed25519 so far"),!(this instanceof Wn))return new Wn(Yn);Yn=In[Yn].curve,this.curve=Yn,this.g=Yn.g,this.g.precompute(Yn.n.bitLength()+1),this.pointClass=Yn.point().constructor,this.encodingLength=Math.ceil(Yn.n.bitLength()/8),this.hash=on.sha512}return eddsa=Wn,Wn.prototype.sign=function(hi,vi){hi=Ln(hi);var gi=this.keyFromSecret(vi),mi=this.hashInt(gi.messagePrefix(),hi),yi=this.g.mul(mi),bi=this.encodePoint(yi),Ei=this.hashInt(bi,gi.pubBytes(),hi).mul(gi.priv()),_i=mi.add(Ei).umod(this.curve.n);return this.makeSignature({R:yi,S:_i,Rencoded:bi})},Wn.prototype.verify=function(hi,vi,gi){if(hi=Ln(hi),vi=this.makeSignature(vi),vi.S().gte(vi.eddsa.curve.n)||vi.S().isNeg())return!1;var mi=this.keyFromPublic(gi),yi=this.hashInt(vi.Rencoded(),mi.pubBytes(),hi),bi=this.g.mul(vi.S()),Ei=vi.R().add(mi.pub().mul(yi));return Ei.eq(bi)},Wn.prototype.hashInt=function(){for(var hi=this.hash(),vi=0;vi<arguments.length;vi++)hi.update(arguments[vi]);return Rn.intFromLE(hi.digest()).umod(this.curve.n)},Wn.prototype.keyFromPublic=function(hi){return Hn.fromPublic(this,hi)},Wn.prototype.keyFromSecret=function(hi){return Hn.fromSecret(this,hi)},Wn.prototype.makeSignature=function(hi){return hi instanceof jn?hi:new jn(this,hi)},Wn.prototype.encodePoint=function(hi){var vi=hi.getY().toArray("le",this.encodingLength);return vi[this.encodingLength-1]|=hi.getX().isOdd()?128:0,vi},Wn.prototype.decodePoint=function(hi){hi=Rn.parseBytes(hi);var vi=hi.length-1,gi=hi.slice(0,vi).concat(hi[vi]&-129),mi=(hi[vi]&128)!==0,yi=Rn.intFromLE(gi);return this.curve.pointFromY(yi,mi)},Wn.prototype.encodeInt=function(hi){return hi.toArray("le",this.encodingLength)},Wn.prototype.decodeInt=function(hi){return Rn.intFromLE(hi)},Wn.prototype.isPoint=function(hi){return hi instanceof this.pointClass},eddsa}var hasRequiredElliptic;function requireElliptic(){return hasRequiredElliptic||(hasRequiredElliptic=1,function(on){var In=on;In.version=require$$0$1.version,In.utils=requireUtils$1(),In.rand=requireBrorand(),In.curve=requireCurve(),In.curves=requireCurves(),In.ec=requireEc(),In.eddsa=requireEddsa()}(elliptic)),elliptic}var bn$1={exports:{}},bn=bn$1.exports,hasRequiredBn;function requireBn(){return hasRequiredBn||(hasRequiredBn=1,function(on){(function(In,Rn){function Mn(Li,wi){if(!Li)throw new Error(wi||"Assertion failed")}function Ln(Li,wi){Li.super_=wi;var Ri=function(){};Ri.prototype=wi.prototype,Li.prototype=new Ri,Li.prototype.constructor=Li}function Hn(Li,wi,Ri){if(Hn.isBN(Li))return Li;this.negative=0,this.words=null,this.length=0,this.red=null,Li!==null&&((wi==="le"||wi==="be")&&(Ri=wi,wi=10),this._init(Li||0,wi||10,Ri||"be"))}typeof In=="object"?In.exports=Hn:Rn.BN=Hn,Hn.BN=Hn,Hn.wordSize=26;var jn;try{typeof window<"u"&&typeof window.Buffer<"u"?jn=window.Buffer:jn=requireDist().Buffer}catch{}Hn.isBN=function(wi){return wi instanceof Hn?!0:wi!==null&&typeof wi=="object"&&wi.constructor.wordSize===Hn.wordSize&&Array.isArray(wi.words)},Hn.max=function(wi,Ri){return wi.cmp(Ri)>0?wi:Ri},Hn.min=function(wi,Ri){return wi.cmp(Ri)<0?wi:Ri},Hn.prototype._init=function(wi,Ri,ki){if(typeof wi=="number")return this._initNumber(wi,Ri,ki);if(typeof wi=="object")return this._initArray(wi,Ri,ki);Ri==="hex"&&(Ri=16),Mn(Ri===(Ri|0)&&Ri>=2&&Ri<=36),wi=wi.toString().replace(/\s+/g,"");var Bi=0;wi[0]==="-"&&(Bi++,this.negative=1),Bi<wi.length&&(Ri===16?this._parseHex(wi,Bi,ki):(this._parseBase(wi,Ri,Bi),ki==="le"&&this._initArray(this.toArray(),Ri,ki)))},Hn.prototype._initNumber=function(wi,Ri,ki){wi<0&&(this.negative=1,wi=-wi),wi<67108864?(this.words=[wi&67108863],this.length=1):wi<4503599627370496?(this.words=[wi&67108863,wi/67108864&67108863],this.length=2):(Mn(wi<9007199254740992),this.words=[wi&67108863,wi/67108864&67108863,1],this.length=3),ki==="le"&&this._initArray(this.toArray(),Ri,ki)},Hn.prototype._initArray=function(wi,Ri,ki){if(Mn(typeof wi.length=="number"),wi.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(wi.length/3),this.words=new Array(this.length);for(var Bi=0;Bi<this.length;Bi++)this.words[Bi]=0;var Hi,Ki,ji=0;if(ki==="be")for(Bi=wi.length-1,Hi=0;Bi>=0;Bi-=3)Ki=wi[Bi]|wi[Bi-1]<<8|wi[Bi-2]<<16,this.words[Hi]|=Ki<<ji&67108863,this.words[Hi+1]=Ki>>>26-ji&67108863,ji+=24,ji>=26&&(ji-=26,Hi++);else if(ki==="le")for(Bi=0,Hi=0;Bi<wi.length;Bi+=3)Ki=wi[Bi]|wi[Bi+1]<<8|wi[Bi+2]<<16,this.words[Hi]|=Ki<<ji&67108863,this.words[Hi+1]=Ki>>>26-ji&67108863,ji+=24,ji>=26&&(ji-=26,Hi++);return this._strip()};function Wn(Li,wi){var Ri=Li.charCodeAt(wi);if(Ri>=48&&Ri<=57)return Ri-48;if(Ri>=65&&Ri<=70)return Ri-55;if(Ri>=97&&Ri<=102)return Ri-87;Mn(!1,"Invalid character in "+Li)}function Yn(Li,wi,Ri){var ki=Wn(Li,Ri);return Ri-1>=wi&&(ki|=Wn(Li,Ri-1)<<4),ki}Hn.prototype._parseHex=function(wi,Ri,ki){this.length=Math.ceil((wi.length-Ri)/6),this.words=new Array(this.length);for(var Bi=0;Bi<this.length;Bi++)this.words[Bi]=0;var Hi=0,Ki=0,ji;if(ki==="be")for(Bi=wi.length-1;Bi>=Ri;Bi-=2)ji=Yn(wi,Ri,Bi)<<Hi,this.words[Ki]|=ji&67108863,Hi>=18?(Hi-=18,Ki+=1,this.words[Ki]|=ji>>>26):Hi+=8;else{var Fi=wi.length-Ri;for(Bi=Fi%2===0?Ri+1:Ri;Bi<wi.length;Bi+=2)ji=Yn(wi,Ri,Bi)<<Hi,this.words[Ki]|=ji&67108863,Hi>=18?(Hi-=18,Ki+=1,this.words[Ki]|=ji>>>26):Hi+=8}this._strip()};function hi(Li,wi,Ri,ki){for(var Bi=0,Hi=0,Ki=Math.min(Li.length,Ri),ji=wi;ji<Ki;ji++){var Fi=Li.charCodeAt(ji)-48;Bi*=ki,Fi>=49?Hi=Fi-49+10:Fi>=17?Hi=Fi-17+10:Hi=Fi,Mn(Fi>=0&&Hi<ki,"Invalid character"),Bi+=Hi}return Bi}Hn.prototype._parseBase=function(wi,Ri,ki){this.words=[0],this.length=1;for(var Bi=0,Hi=1;Hi<=67108863;Hi*=Ri)Bi++;Bi--,Hi=Hi/Ri|0;for(var Ki=wi.length-ki,ji=Ki%Bi,Fi=Math.min(Ki,Ki-ji)+ki,$i=0,Wi=ki;Wi<Fi;Wi+=Bi)$i=hi(wi,Wi,Wi+Bi,Ri),this.imuln(Hi),this.words[0]+$i<67108864?this.words[0]+=$i:this._iaddn($i);if(ji!==0){var Qi=1;for($i=hi(wi,Wi,wi.length,Ri),Wi=0;Wi<ji;Wi++)Qi*=Ri;this.imuln(Qi),this.words[0]+$i<67108864?this.words[0]+=$i:this._iaddn($i)}this._strip()},Hn.prototype.copy=function(wi){wi.words=new Array(this.length);for(var Ri=0;Ri<this.length;Ri++)wi.words[Ri]=this.words[Ri];wi.length=this.length,wi.negative=this.negative,wi.red=this.red};function vi(Li,wi){Li.words=wi.words,Li.length=wi.length,Li.negative=wi.negative,Li.red=wi.red}if(Hn.prototype._move=function(wi){vi(wi,this)},Hn.prototype.clone=function(){var wi=new Hn(null);return this.copy(wi),wi},Hn.prototype._expand=function(wi){for(;this.length<wi;)this.words[this.length++]=0;return this},Hn.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},Hn.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{Hn.prototype[Symbol.for("nodejs.util.inspect.custom")]=gi}catch{Hn.prototype.inspect=gi}else Hn.prototype.inspect=gi;function gi(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var mi=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],yi=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],bi=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];Hn.prototype.toString=function(wi,Ri){wi=wi||10,Ri=Ri|0||1;var ki;if(wi===16||wi==="hex"){ki="";for(var Bi=0,Hi=0,Ki=0;Ki<this.length;Ki++){var ji=this.words[Ki],Fi=((ji<<Bi|Hi)&16777215).toString(16);Hi=ji>>>24-Bi&16777215,Bi+=2,Bi>=26&&(Bi-=26,Ki--),Hi!==0||Ki!==this.length-1?ki=mi[6-Fi.length]+Fi+ki:ki=Fi+ki}for(Hi!==0&&(ki=Hi.toString(16)+ki);ki.length%Ri!==0;)ki="0"+ki;return this.negative!==0&&(ki="-"+ki),ki}if(wi===(wi|0)&&wi>=2&&wi<=36){var $i=yi[wi],Wi=bi[wi];ki="";var Qi=this.clone();for(Qi.negative=0;!Qi.isZero();){var ea=Qi.modrn(Wi).toString(wi);Qi=Qi.idivn(Wi),Qi.isZero()?ki=ea+ki:ki=mi[$i-ea.length]+ea+ki}for(this.isZero()&&(ki="0"+ki);ki.length%Ri!==0;)ki="0"+ki;return this.negative!==0&&(ki="-"+ki),ki}Mn(!1,"Base should be between 2 and 36")},Hn.prototype.toNumber=function(){var wi=this.words[0];return this.length===2?wi+=this.words[1]*67108864:this.length===3&&this.words[2]===1?wi+=4503599627370496+this.words[1]*67108864:this.length>2&&Mn(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-wi:wi},Hn.prototype.toJSON=function(){return this.toString(16,2)},jn&&(Hn.prototype.toBuffer=function(wi,Ri){return this.toArrayLike(jn,wi,Ri)}),Hn.prototype.toArray=function(wi,Ri){return this.toArrayLike(Array,wi,Ri)};var Ei=function(wi,Ri){return wi.allocUnsafe?wi.allocUnsafe(Ri):new wi(Ri)};Hn.prototype.toArrayLike=function(wi,Ri,ki){this._strip();var Bi=this.byteLength(),Hi=ki||Math.max(1,Bi);Mn(Bi<=Hi,"byte array longer than desired length"),Mn(Hi>0,"Requested array length <= 0");var Ki=Ei(wi,Hi),ji=Ri==="le"?"LE":"BE";return this["_toArrayLike"+ji](Ki,Bi),Ki},Hn.prototype._toArrayLikeLE=function(wi,Ri){for(var ki=0,Bi=0,Hi=0,Ki=0;Hi<this.length;Hi++){var ji=this.words[Hi]<<Ki|Bi;wi[ki++]=ji&255,ki<wi.length&&(wi[ki++]=ji>>8&255),ki<wi.length&&(wi[ki++]=ji>>16&255),Ki===6?(ki<wi.length&&(wi[ki++]=ji>>24&255),Bi=0,Ki=0):(Bi=ji>>>24,Ki+=2)}if(ki<wi.length)for(wi[ki++]=Bi;ki<wi.length;)wi[ki++]=0},Hn.prototype._toArrayLikeBE=function(wi,Ri){for(var ki=wi.length-1,Bi=0,Hi=0,Ki=0;Hi<this.length;Hi++){var ji=this.words[Hi]<<Ki|Bi;wi[ki--]=ji&255,ki>=0&&(wi[ki--]=ji>>8&255),ki>=0&&(wi[ki--]=ji>>16&255),Ki===6?(ki>=0&&(wi[ki--]=ji>>24&255),Bi=0,Ki=0):(Bi=ji>>>24,Ki+=2)}if(ki>=0)for(wi[ki--]=Bi;ki>=0;)wi[ki--]=0},Math.clz32?Hn.prototype._countBits=function(wi){return 32-Math.clz32(wi)}:Hn.prototype._countBits=function(wi){var Ri=wi,ki=0;return Ri>=4096&&(ki+=13,Ri>>>=13),Ri>=64&&(ki+=7,Ri>>>=7),Ri>=8&&(ki+=4,Ri>>>=4),Ri>=2&&(ki+=2,Ri>>>=2),ki+Ri},Hn.prototype._zeroBits=function(wi){if(wi===0)return 26;var Ri=wi,ki=0;return(Ri&8191)===0&&(ki+=13,Ri>>>=13),(Ri&127)===0&&(ki+=7,Ri>>>=7),(Ri&15)===0&&(ki+=4,Ri>>>=4),(Ri&3)===0&&(ki+=2,Ri>>>=2),(Ri&1)===0&&ki++,ki},Hn.prototype.bitLength=function(){var wi=this.words[this.length-1],Ri=this._countBits(wi);return(this.length-1)*26+Ri};function _i(Li){for(var wi=new Array(Li.bitLength()),Ri=0;Ri<wi.length;Ri++){var ki=Ri/26|0,Bi=Ri%26;wi[Ri]=Li.words[ki]>>>Bi&1}return wi}Hn.prototype.zeroBits=function(){if(this.isZero())return 0;for(var wi=0,Ri=0;Ri<this.length;Ri++){var ki=this._zeroBits(this.words[Ri]);if(wi+=ki,ki!==26)break}return wi},Hn.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},Hn.prototype.toTwos=function(wi){return this.negative!==0?this.abs().inotn(wi).iaddn(1):this.clone()},Hn.prototype.fromTwos=function(wi){return this.testn(wi-1)?this.notn(wi).iaddn(1).ineg():this.clone()},Hn.prototype.isNeg=function(){return this.negative!==0},Hn.prototype.neg=function(){return this.clone().ineg()},Hn.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},Hn.prototype.iuor=function(wi){for(;this.length<wi.length;)this.words[this.length++]=0;for(var Ri=0;Ri<wi.length;Ri++)this.words[Ri]=this.words[Ri]|wi.words[Ri];return this._strip()},Hn.prototype.ior=function(wi){return Mn((this.negative|wi.negative)===0),this.iuor(wi)},Hn.prototype.or=function(wi){return this.length>wi.length?this.clone().ior(wi):wi.clone().ior(this)},Hn.prototype.uor=function(wi){return this.length>wi.length?this.clone().iuor(wi):wi.clone().iuor(this)},Hn.prototype.iuand=function(wi){var Ri;this.length>wi.length?Ri=wi:Ri=this;for(var ki=0;ki<Ri.length;ki++)this.words[ki]=this.words[ki]&wi.words[ki];return this.length=Ri.length,this._strip()},Hn.prototype.iand=function(wi){return Mn((this.negative|wi.negative)===0),this.iuand(wi)},Hn.prototype.and=function(wi){return this.length>wi.length?this.clone().iand(wi):wi.clone().iand(this)},Hn.prototype.uand=function(wi){return this.length>wi.length?this.clone().iuand(wi):wi.clone().iuand(this)},Hn.prototype.iuxor=function(wi){var Ri,ki;this.length>wi.length?(Ri=this,ki=wi):(Ri=wi,ki=this);for(var Bi=0;Bi<ki.length;Bi++)this.words[Bi]=Ri.words[Bi]^ki.words[Bi];if(this!==Ri)for(;Bi<Ri.length;Bi++)this.words[Bi]=Ri.words[Bi];return this.length=Ri.length,this._strip()},Hn.prototype.ixor=function(wi){return Mn((this.negative|wi.negative)===0),this.iuxor(wi)},Hn.prototype.xor=function(wi){return this.length>wi.length?this.clone().ixor(wi):wi.clone().ixor(this)},Hn.prototype.uxor=function(wi){return this.length>wi.length?this.clone().iuxor(wi):wi.clone().iuxor(this)},Hn.prototype.inotn=function(wi){Mn(typeof wi=="number"&&wi>=0);var Ri=Math.ceil(wi/26)|0,ki=wi%26;this._expand(Ri),ki>0&&Ri--;for(var Bi=0;Bi<Ri;Bi++)this.words[Bi]=~this.words[Bi]&67108863;return ki>0&&(this.words[Bi]=~this.words[Bi]&67108863>>26-ki),this._strip()},Hn.prototype.notn=function(wi){return this.clone().inotn(wi)},Hn.prototype.setn=function(wi,Ri){Mn(typeof wi=="number"&&wi>=0);var ki=wi/26|0,Bi=wi%26;return this._expand(ki+1),Ri?this.words[ki]=this.words[ki]|1<<Bi:this.words[ki]=this.words[ki]&~(1<<Bi),this._strip()},Hn.prototype.iadd=function(wi){var Ri;if(this.negative!==0&&wi.negative===0)return this.negative=0,Ri=this.isub(wi),this.negative^=1,this._normSign();if(this.negative===0&&wi.negative!==0)return wi.negative=0,Ri=this.isub(wi),wi.negative=1,Ri._normSign();var ki,Bi;this.length>wi.length?(ki=this,Bi=wi):(ki=wi,Bi=this);for(var Hi=0,Ki=0;Ki<Bi.length;Ki++)Ri=(ki.words[Ki]|0)+(Bi.words[Ki]|0)+Hi,this.words[Ki]=Ri&67108863,Hi=Ri>>>26;for(;Hi!==0&&Ki<ki.length;Ki++)Ri=(ki.words[Ki]|0)+Hi,this.words[Ki]=Ri&67108863,Hi=Ri>>>26;if(this.length=ki.length,Hi!==0)this.words[this.length]=Hi,this.length++;else if(ki!==this)for(;Ki<ki.length;Ki++)this.words[Ki]=ki.words[Ki];return this},Hn.prototype.add=function(wi){var Ri;return wi.negative!==0&&this.negative===0?(wi.negative=0,Ri=this.sub(wi),wi.negative^=1,Ri):wi.negative===0&&this.negative!==0?(this.negative=0,Ri=wi.sub(this),this.negative=1,Ri):this.length>wi.length?this.clone().iadd(wi):wi.clone().iadd(this)},Hn.prototype.isub=function(wi){if(wi.negative!==0){wi.negative=0;var Ri=this.iadd(wi);return wi.negative=1,Ri._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(wi),this.negative=1,this._normSign();var ki=this.cmp(wi);if(ki===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Bi,Hi;ki>0?(Bi=this,Hi=wi):(Bi=wi,Hi=this);for(var Ki=0,ji=0;ji<Hi.length;ji++)Ri=(Bi.words[ji]|0)-(Hi.words[ji]|0)+Ki,Ki=Ri>>26,this.words[ji]=Ri&67108863;for(;Ki!==0&&ji<Bi.length;ji++)Ri=(Bi.words[ji]|0)+Ki,Ki=Ri>>26,this.words[ji]=Ri&67108863;if(Ki===0&&ji<Bi.length&&Bi!==this)for(;ji<Bi.length;ji++)this.words[ji]=Bi.words[ji];return this.length=Math.max(this.length,ji),Bi!==this&&(this.negative=1),this._strip()},Hn.prototype.sub=function(wi){return this.clone().isub(wi)};function xi(Li,wi,Ri){Ri.negative=wi.negative^Li.negative;var ki=Li.length+wi.length|0;Ri.length=ki,ki=ki-1|0;var Bi=Li.words[0]|0,Hi=wi.words[0]|0,Ki=Bi*Hi,ji=Ki&67108863,Fi=Ki/67108864|0;Ri.words[0]=ji;for(var $i=1;$i<ki;$i++){for(var Wi=Fi>>>26,Qi=Fi&67108863,ea=Math.min($i,wi.length-1),na=Math.max(0,$i-Li.length+1);na<=ea;na++){var Ji=$i-na|0;Bi=Li.words[Ji]|0,Hi=wi.words[na]|0,Ki=Bi*Hi+Qi,Wi+=Ki/67108864|0,Qi=Ki&67108863}Ri.words[$i]=Qi|0,Fi=Wi|0}return Fi!==0?Ri.words[$i]=Fi|0:Ri.length--,Ri._strip()}var Ci=function(wi,Ri,ki){var Bi=wi.words,Hi=Ri.words,Ki=ki.words,ji=0,Fi,$i,Wi,Qi=Bi[0]|0,ea=Qi&8191,na=Qi>>>13,Ji=Bi[1]|0,ra=Ji&8191,sa=Ji>>>13,la=Bi[2]|0,aa=la&8191,ta=la>>>13,fa=Bi[3]|0,ca=fa&8191,pa=fa>>>13,Ea=Bi[4]|0,xa=Ea&8191,ga=Ea>>>13,ma=Bi[5]|0,Aa=ma&8191,va=ma>>>13,Sa=Bi[6]|0,Ta=Sa&8191,wa=Sa>>>13,Na=Bi[7]|0,$a=Na&8191,Ma=Na>>>13,Ka=Bi[8]|0,Ga=Ka&8191,Ha=Ka>>>13,Ua=Bi[9]|0,vo=Ua&8191,Ja=Ua>>>13,bo=Hi[0]|0,es=bo&8191,Ya=bo>>>13,Xa=Hi[1]|0,To=Xa&8191,Wa=Xa>>>13,ls=Hi[2]|0,ns=ls&8191,Co=ls>>>13,cs=Hi[3]|0,os=cs&8191,So=cs>>>13,us=Hi[4]|0,Oo=us&8191,da=us>>>13,ia=Hi[5]|0,oa=ia&8191,ha=ia>>>13,Ca=Hi[6]|0,Ia=Ca&8191,Da=Ca>>>13,rs=Hi[7]|0,as=rs&8191,No=rs>>>13,ss=Hi[8]|0,Za=ss&8191,zo=ss>>>13,Ss=Hi[9]|0,vs=Ss&8191,gs=Ss>>>13;ki.negative=wi.negative^Ri.negative,ki.length=19,Fi=Math.imul(ea,es),$i=Math.imul(ea,Ya),$i=$i+Math.imul(na,es)|0,Wi=Math.imul(na,Ya);var Xs=(ji+Fi|0)+(($i&8191)<<13)|0;ji=(Wi+($i>>>13)|0)+(Xs>>>26)|0,Xs&=67108863,Fi=Math.imul(ra,es),$i=Math.imul(ra,Ya),$i=$i+Math.imul(sa,es)|0,Wi=Math.imul(sa,Ya),Fi=Fi+Math.imul(ea,To)|0,$i=$i+Math.imul(ea,Wa)|0,$i=$i+Math.imul(na,To)|0,Wi=Wi+Math.imul(na,Wa)|0;var La=(ji+Fi|0)+(($i&8191)<<13)|0;ji=(Wi+($i>>>13)|0)+(La>>>26)|0,La&=67108863,Fi=Math.imul(aa,es),$i=Math.imul(aa,Ya),$i=$i+Math.imul(ta,es)|0,Wi=Math.imul(ta,Ya),Fi=Fi+Math.imul(ra,To)|0,$i=$i+Math.imul(ra,Wa)|0,$i=$i+Math.imul(sa,To)|0,Wi=Wi+Math.imul(sa,Wa)|0,Fi=Fi+Math.imul(ea,ns)|0,$i=$i+Math.imul(ea,Co)|0,$i=$i+Math.imul(na,ns)|0,Wi=Wi+Math.imul(na,Co)|0;var ba=(ji+Fi|0)+(($i&8191)<<13)|0;ji=(Wi+($i>>>13)|0)+(ba>>>26)|0,ba&=67108863,Fi=Math.imul(ca,es),$i=Math.imul(ca,Ya),$i=$i+Math.imul(pa,es)|0,Wi=Math.imul(pa,Ya),Fi=Fi+Math.imul(aa,To)|0,$i=$i+Math.imul(aa,Wa)|0,$i=$i+Math.imul(ta,To)|0,Wi=Wi+Math.imul(ta,Wa)|0,Fi=Fi+Math.imul(ra,ns)|0,$i=$i+Math.imul(ra,Co)|0,$i=$i+Math.imul(sa,ns)|0,Wi=Wi+Math.imul(sa,Co)|0,Fi=Fi+Math.imul(ea,os)|0,$i=$i+Math.imul(ea,So)|0,$i=$i+Math.imul(na,os)|0,Wi=Wi+Math.imul(na,So)|0;var ka=(ji+Fi|0)+(($i&8191)<<13)|0;ji=(Wi+($i>>>13)|0)+(ka>>>26)|0,ka&=67108863,Fi=Math.imul(xa,es),$i=Math.imul(xa,Ya),$i=$i+Math.imul(ga,es)|0,Wi=Math.imul(ga,Ya),Fi=Fi+Math.imul(ca,To)|0,$i=$i+Math.imul(ca,Wa)|0,$i=$i+Math.imul(pa,To)|0,Wi=Wi+Math.imul(pa,Wa)|0,Fi=Fi+Math.imul(aa,ns)|0,$i=$i+Math.imul(aa,Co)|0,$i=$i+Math.imul(ta,ns)|0,Wi=Wi+Math.imul(ta,Co)|0,Fi=Fi+Math.imul(ra,os)|0,$i=$i+Math.imul(ra,So)|0,$i=$i+Math.imul(sa,os)|0,Wi=Wi+Math.imul(sa,So)|0,Fi=Fi+Math.imul(ea,Oo)|0,$i=$i+Math.imul(ea,da)|0,$i=$i+Math.imul(na,Oo)|0,Wi=Wi+Math.imul(na,da)|0;var ja=(ji+Fi|0)+(($i&8191)<<13)|0;ji=(Wi+($i>>>13)|0)+(ja>>>26)|0,ja&=67108863,Fi=Math.imul(Aa,es),$i=Math.imul(Aa,Ya),$i=$i+Math.imul(va,es)|0,Wi=Math.imul(va,Ya),Fi=Fi+Math.imul(xa,To)|0,$i=$i+Math.imul(xa,Wa)|0,$i=$i+Math.imul(ga,To)|0,Wi=Wi+Math.imul(ga,Wa)|0,Fi=Fi+Math.imul(ca,ns)|0,$i=$i+Math.imul(ca,Co)|0,$i=$i+Math.imul(pa,ns)|0,Wi=Wi+Math.imul(pa,Co)|0,Fi=Fi+Math.imul(aa,os)|0,$i=$i+Math.imul(aa,So)|0,$i=$i+Math.imul(ta,os)|0,Wi=Wi+Math.imul(ta,So)|0,Fi=Fi+Math.imul(ra,Oo)|0,$i=$i+Math.imul(ra,da)|0,$i=$i+Math.imul(sa,Oo)|0,Wi=Wi+Math.imul(sa,da)|0,Fi=Fi+Math.imul(ea,oa)|0,$i=$i+Math.imul(ea,ha)|0,$i=$i+Math.imul(na,oa)|0,Wi=Wi+Math.imul(na,ha)|0;var ts=(ji+Fi|0)+(($i&8191)<<13)|0;ji=(Wi+($i>>>13)|0)+(ts>>>26)|0,ts&=67108863,Fi=Math.imul(Ta,es),$i=Math.imul(Ta,Ya),$i=$i+Math.imul(wa,es)|0,Wi=Math.imul(wa,Ya),Fi=Fi+Math.imul(Aa,To)|0,$i=$i+Math.imul(Aa,Wa)|0,$i=$i+Math.imul(va,To)|0,Wi=Wi+Math.imul(va,Wa)|0,Fi=Fi+Math.imul(xa,ns)|0,$i=$i+Math.imul(xa,Co)|0,$i=$i+Math.imul(ga,ns)|0,Wi=Wi+Math.imul(ga,Co)|0,Fi=Fi+Math.imul(ca,os)|0,$i=$i+Math.imul(ca,So)|0,$i=$i+Math.imul(pa,os)|0,Wi=Wi+Math.imul(pa,So)|0,Fi=Fi+Math.imul(aa,Oo)|0,$i=$i+Math.imul(aa,da)|0,$i=$i+Math.imul(ta,Oo)|0,Wi=Wi+Math.imul(ta,da)|0,Fi=Fi+Math.imul(ra,oa)|0,$i=$i+Math.imul(ra,ha)|0,$i=$i+Math.imul(sa,oa)|0,Wi=Wi+Math.imul(sa,ha)|0,Fi=Fi+Math.imul(ea,Ia)|0,$i=$i+Math.imul(ea,Da)|0,$i=$i+Math.imul(na,Ia)|0,Wi=Wi+Math.imul(na,Da)|0;var ys=(ji+Fi|0)+(($i&8191)<<13)|0;ji=(Wi+($i>>>13)|0)+(ys>>>26)|0,ys&=67108863,Fi=Math.imul($a,es),$i=Math.imul($a,Ya),$i=$i+Math.imul(Ma,es)|0,Wi=Math.imul(Ma,Ya),Fi=Fi+Math.imul(Ta,To)|0,$i=$i+Math.imul(Ta,Wa)|0,$i=$i+Math.imul(wa,To)|0,Wi=Wi+Math.imul(wa,Wa)|0,Fi=Fi+Math.imul(Aa,ns)|0,$i=$i+Math.imul(Aa,Co)|0,$i=$i+Math.imul(va,ns)|0,Wi=Wi+Math.imul(va,Co)|0,Fi=Fi+Math.imul(xa,os)|0,$i=$i+Math.imul(xa,So)|0,$i=$i+Math.imul(ga,os)|0,Wi=Wi+Math.imul(ga,So)|0,Fi=Fi+Math.imul(ca,Oo)|0,$i=$i+Math.imul(ca,da)|0,$i=$i+Math.imul(pa,Oo)|0,Wi=Wi+Math.imul(pa,da)|0,Fi=Fi+Math.imul(aa,oa)|0,$i=$i+Math.imul(aa,ha)|0,$i=$i+Math.imul(ta,oa)|0,Wi=Wi+Math.imul(ta,ha)|0,Fi=Fi+Math.imul(ra,Ia)|0,$i=$i+Math.imul(ra,Da)|0,$i=$i+Math.imul(sa,Ia)|0,Wi=Wi+Math.imul(sa,Da)|0,Fi=Fi+Math.imul(ea,as)|0,$i=$i+Math.imul(ea,No)|0,$i=$i+Math.imul(na,as)|0,Wi=Wi+Math.imul(na,No)|0;var ps=(ji+Fi|0)+(($i&8191)<<13)|0;ji=(Wi+($i>>>13)|0)+(ps>>>26)|0,ps&=67108863,Fi=Math.imul(Ga,es),$i=Math.imul(Ga,Ya),$i=$i+Math.imul(Ha,es)|0,Wi=Math.imul(Ha,Ya),Fi=Fi+Math.imul($a,To)|0,$i=$i+Math.imul($a,Wa)|0,$i=$i+Math.imul(Ma,To)|0,Wi=Wi+Math.imul(Ma,Wa)|0,Fi=Fi+Math.imul(Ta,ns)|0,$i=$i+Math.imul(Ta,Co)|0,$i=$i+Math.imul(wa,ns)|0,Wi=Wi+Math.imul(wa,Co)|0,Fi=Fi+Math.imul(Aa,os)|0,$i=$i+Math.imul(Aa,So)|0,$i=$i+Math.imul(va,os)|0,Wi=Wi+Math.imul(va,So)|0,Fi=Fi+Math.imul(xa,Oo)|0,$i=$i+Math.imul(xa,da)|0,$i=$i+Math.imul(ga,Oo)|0,Wi=Wi+Math.imul(ga,da)|0,Fi=Fi+Math.imul(ca,oa)|0,$i=$i+Math.imul(ca,ha)|0,$i=$i+Math.imul(pa,oa)|0,Wi=Wi+Math.imul(pa,ha)|0,Fi=Fi+Math.imul(aa,Ia)|0,$i=$i+Math.imul(aa,Da)|0,$i=$i+Math.imul(ta,Ia)|0,Wi=Wi+Math.imul(ta,Da)|0,Fi=Fi+Math.imul(ra,as)|0,$i=$i+Math.imul(ra,No)|0,$i=$i+Math.imul(sa,as)|0,Wi=Wi+Math.imul(sa,No)|0,Fi=Fi+Math.imul(ea,Za)|0,$i=$i+Math.imul(ea,zo)|0,$i=$i+Math.imul(na,Za)|0,Wi=Wi+Math.imul(na,zo)|0;var hs=(ji+Fi|0)+(($i&8191)<<13)|0;ji=(Wi+($i>>>13)|0)+(hs>>>26)|0,hs&=67108863,Fi=Math.imul(vo,es),$i=Math.imul(vo,Ya),$i=$i+Math.imul(Ja,es)|0,Wi=Math.imul(Ja,Ya),Fi=Fi+Math.imul(Ga,To)|0,$i=$i+Math.imul(Ga,Wa)|0,$i=$i+Math.imul(Ha,To)|0,Wi=Wi+Math.imul(Ha,Wa)|0,Fi=Fi+Math.imul($a,ns)|0,$i=$i+Math.imul($a,Co)|0,$i=$i+Math.imul(Ma,ns)|0,Wi=Wi+Math.imul(Ma,Co)|0,Fi=Fi+Math.imul(Ta,os)|0,$i=$i+Math.imul(Ta,So)|0,$i=$i+Math.imul(wa,os)|0,Wi=Wi+Math.imul(wa,So)|0,Fi=Fi+Math.imul(Aa,Oo)|0,$i=$i+Math.imul(Aa,da)|0,$i=$i+Math.imul(va,Oo)|0,Wi=Wi+Math.imul(va,da)|0,Fi=Fi+Math.imul(xa,oa)|0,$i=$i+Math.imul(xa,ha)|0,$i=$i+Math.imul(ga,oa)|0,Wi=Wi+Math.imul(ga,ha)|0,Fi=Fi+Math.imul(ca,Ia)|0,$i=$i+Math.imul(ca,Da)|0,$i=$i+Math.imul(pa,Ia)|0,Wi=Wi+Math.imul(pa,Da)|0,Fi=Fi+Math.imul(aa,as)|0,$i=$i+Math.imul(aa,No)|0,$i=$i+Math.imul(ta,as)|0,Wi=Wi+Math.imul(ta,No)|0,Fi=Fi+Math.imul(ra,Za)|0,$i=$i+Math.imul(ra,zo)|0,$i=$i+Math.imul(sa,Za)|0,Wi=Wi+Math.imul(sa,zo)|0,Fi=Fi+Math.imul(ea,vs)|0,$i=$i+Math.imul(ea,gs)|0,$i=$i+Math.imul(na,vs)|0,Wi=Wi+Math.imul(na,gs)|0;var Ls=(ji+Fi|0)+(($i&8191)<<13)|0;ji=(Wi+($i>>>13)|0)+(Ls>>>26)|0,Ls&=67108863,Fi=Math.imul(vo,To),$i=Math.imul(vo,Wa),$i=$i+Math.imul(Ja,To)|0,Wi=Math.imul(Ja,Wa),Fi=Fi+Math.imul(Ga,ns)|0,$i=$i+Math.imul(Ga,Co)|0,$i=$i+Math.imul(Ha,ns)|0,Wi=Wi+Math.imul(Ha,Co)|0,Fi=Fi+Math.imul($a,os)|0,$i=$i+Math.imul($a,So)|0,$i=$i+Math.imul(Ma,os)|0,Wi=Wi+Math.imul(Ma,So)|0,Fi=Fi+Math.imul(Ta,Oo)|0,$i=$i+Math.imul(Ta,da)|0,$i=$i+Math.imul(wa,Oo)|0,Wi=Wi+Math.imul(wa,da)|0,Fi=Fi+Math.imul(Aa,oa)|0,$i=$i+Math.imul(Aa,ha)|0,$i=$i+Math.imul(va,oa)|0,Wi=Wi+Math.imul(va,ha)|0,Fi=Fi+Math.imul(xa,Ia)|0,$i=$i+Math.imul(xa,Da)|0,$i=$i+Math.imul(ga,Ia)|0,Wi=Wi+Math.imul(ga,Da)|0,Fi=Fi+Math.imul(ca,as)|0,$i=$i+Math.imul(ca,No)|0,$i=$i+Math.imul(pa,as)|0,Wi=Wi+Math.imul(pa,No)|0,Fi=Fi+Math.imul(aa,Za)|0,$i=$i+Math.imul(aa,zo)|0,$i=$i+Math.imul(ta,Za)|0,Wi=Wi+Math.imul(ta,zo)|0,Fi=Fi+Math.imul(ra,vs)|0,$i=$i+Math.imul(ra,gs)|0,$i=$i+Math.imul(sa,vs)|0,Wi=Wi+Math.imul(sa,gs)|0;var js=(ji+Fi|0)+(($i&8191)<<13)|0;ji=(Wi+($i>>>13)|0)+(js>>>26)|0,js&=67108863,Fi=Math.imul(vo,ns),$i=Math.imul(vo,Co),$i=$i+Math.imul(Ja,ns)|0,Wi=Math.imul(Ja,Co),Fi=Fi+Math.imul(Ga,os)|0,$i=$i+Math.imul(Ga,So)|0,$i=$i+Math.imul(Ha,os)|0,Wi=Wi+Math.imul(Ha,So)|0,Fi=Fi+Math.imul($a,Oo)|0,$i=$i+Math.imul($a,da)|0,$i=$i+Math.imul(Ma,Oo)|0,Wi=Wi+Math.imul(Ma,da)|0,Fi=Fi+Math.imul(Ta,oa)|0,$i=$i+Math.imul(Ta,ha)|0,$i=$i+Math.imul(wa,oa)|0,Wi=Wi+Math.imul(wa,ha)|0,Fi=Fi+Math.imul(Aa,Ia)|0,$i=$i+Math.imul(Aa,Da)|0,$i=$i+Math.imul(va,Ia)|0,Wi=Wi+Math.imul(va,Da)|0,Fi=Fi+Math.imul(xa,as)|0,$i=$i+Math.imul(xa,No)|0,$i=$i+Math.imul(ga,as)|0,Wi=Wi+Math.imul(ga,No)|0,Fi=Fi+Math.imul(ca,Za)|0,$i=$i+Math.imul(ca,zo)|0,$i=$i+Math.imul(pa,Za)|0,Wi=Wi+Math.imul(pa,zo)|0,Fi=Fi+Math.imul(aa,vs)|0,$i=$i+Math.imul(aa,gs)|0,$i=$i+Math.imul(ta,vs)|0,Wi=Wi+Math.imul(ta,gs)|0;var Ts=(ji+Fi|0)+(($i&8191)<<13)|0;ji=(Wi+($i>>>13)|0)+(Ts>>>26)|0,Ts&=67108863,Fi=Math.imul(vo,os),$i=Math.imul(vo,So),$i=$i+Math.imul(Ja,os)|0,Wi=Math.imul(Ja,So),Fi=Fi+Math.imul(Ga,Oo)|0,$i=$i+Math.imul(Ga,da)|0,$i=$i+Math.imul(Ha,Oo)|0,Wi=Wi+Math.imul(Ha,da)|0,Fi=Fi+Math.imul($a,oa)|0,$i=$i+Math.imul($a,ha)|0,$i=$i+Math.imul(Ma,oa)|0,Wi=Wi+Math.imul(Ma,ha)|0,Fi=Fi+Math.imul(Ta,Ia)|0,$i=$i+Math.imul(Ta,Da)|0,$i=$i+Math.imul(wa,Ia)|0,Wi=Wi+Math.imul(wa,Da)|0,Fi=Fi+Math.imul(Aa,as)|0,$i=$i+Math.imul(Aa,No)|0,$i=$i+Math.imul(va,as)|0,Wi=Wi+Math.imul(va,No)|0,Fi=Fi+Math.imul(xa,Za)|0,$i=$i+Math.imul(xa,zo)|0,$i=$i+Math.imul(ga,Za)|0,Wi=Wi+Math.imul(ga,zo)|0,Fi=Fi+Math.imul(ca,vs)|0,$i=$i+Math.imul(ca,gs)|0,$i=$i+Math.imul(pa,vs)|0,Wi=Wi+Math.imul(pa,gs)|0;var Us=(ji+Fi|0)+(($i&8191)<<13)|0;ji=(Wi+($i>>>13)|0)+(Us>>>26)|0,Us&=67108863,Fi=Math.imul(vo,Oo),$i=Math.imul(vo,da),$i=$i+Math.imul(Ja,Oo)|0,Wi=Math.imul(Ja,da),Fi=Fi+Math.imul(Ga,oa)|0,$i=$i+Math.imul(Ga,ha)|0,$i=$i+Math.imul(Ha,oa)|0,Wi=Wi+Math.imul(Ha,ha)|0,Fi=Fi+Math.imul($a,Ia)|0,$i=$i+Math.imul($a,Da)|0,$i=$i+Math.imul(Ma,Ia)|0,Wi=Wi+Math.imul(Ma,Da)|0,Fi=Fi+Math.imul(Ta,as)|0,$i=$i+Math.imul(Ta,No)|0,$i=$i+Math.imul(wa,as)|0,Wi=Wi+Math.imul(wa,No)|0,Fi=Fi+Math.imul(Aa,Za)|0,$i=$i+Math.imul(Aa,zo)|0,$i=$i+Math.imul(va,Za)|0,Wi=Wi+Math.imul(va,zo)|0,Fi=Fi+Math.imul(xa,vs)|0,$i=$i+Math.imul(xa,gs)|0,$i=$i+Math.imul(ga,vs)|0,Wi=Wi+Math.imul(ga,gs)|0;var Es=(ji+Fi|0)+(($i&8191)<<13)|0;ji=(Wi+($i>>>13)|0)+(Es>>>26)|0,Es&=67108863,Fi=Math.imul(vo,oa),$i=Math.imul(vo,ha),$i=$i+Math.imul(Ja,oa)|0,Wi=Math.imul(Ja,ha),Fi=Fi+Math.imul(Ga,Ia)|0,$i=$i+Math.imul(Ga,Da)|0,$i=$i+Math.imul(Ha,Ia)|0,Wi=Wi+Math.imul(Ha,Da)|0,Fi=Fi+Math.imul($a,as)|0,$i=$i+Math.imul($a,No)|0,$i=$i+Math.imul(Ma,as)|0,Wi=Wi+Math.imul(Ma,No)|0,Fi=Fi+Math.imul(Ta,Za)|0,$i=$i+Math.imul(Ta,zo)|0,$i=$i+Math.imul(wa,Za)|0,Wi=Wi+Math.imul(wa,zo)|0,Fi=Fi+Math.imul(Aa,vs)|0,$i=$i+Math.imul(Aa,gs)|0,$i=$i+Math.imul(va,vs)|0,Wi=Wi+Math.imul(va,gs)|0;var zs=(ji+Fi|0)+(($i&8191)<<13)|0;ji=(Wi+($i>>>13)|0)+(zs>>>26)|0,zs&=67108863,Fi=Math.imul(vo,Ia),$i=Math.imul(vo,Da),$i=$i+Math.imul(Ja,Ia)|0,Wi=Math.imul(Ja,Da),Fi=Fi+Math.imul(Ga,as)|0,$i=$i+Math.imul(Ga,No)|0,$i=$i+Math.imul(Ha,as)|0,Wi=Wi+Math.imul(Ha,No)|0,Fi=Fi+Math.imul($a,Za)|0,$i=$i+Math.imul($a,zo)|0,$i=$i+Math.imul(Ma,Za)|0,Wi=Wi+Math.imul(Ma,zo)|0,Fi=Fi+Math.imul(Ta,vs)|0,$i=$i+Math.imul(Ta,gs)|0,$i=$i+Math.imul(wa,vs)|0,Wi=Wi+Math.imul(wa,gs)|0;var Ks=(ji+Fi|0)+(($i&8191)<<13)|0;ji=(Wi+($i>>>13)|0)+(Ks>>>26)|0,Ks&=67108863,Fi=Math.imul(vo,as),$i=Math.imul(vo,No),$i=$i+Math.imul(Ja,as)|0,Wi=Math.imul(Ja,No),Fi=Fi+Math.imul(Ga,Za)|0,$i=$i+Math.imul(Ga,zo)|0,$i=$i+Math.imul(Ha,Za)|0,Wi=Wi+Math.imul(Ha,zo)|0,Fi=Fi+Math.imul($a,vs)|0,$i=$i+Math.imul($a,gs)|0,$i=$i+Math.imul(Ma,vs)|0,Wi=Wi+Math.imul(Ma,gs)|0;var nl=(ji+Fi|0)+(($i&8191)<<13)|0;ji=(Wi+($i>>>13)|0)+(nl>>>26)|0,nl&=67108863,Fi=Math.imul(vo,Za),$i=Math.imul(vo,zo),$i=$i+Math.imul(Ja,Za)|0,Wi=Math.imul(Ja,zo),Fi=Fi+Math.imul(Ga,vs)|0,$i=$i+Math.imul(Ga,gs)|0,$i=$i+Math.imul(Ha,vs)|0,Wi=Wi+Math.imul(Ha,gs)|0;var Tl=(ji+Fi|0)+(($i&8191)<<13)|0;ji=(Wi+($i>>>13)|0)+(Tl>>>26)|0,Tl&=67108863,Fi=Math.imul(vo,vs),$i=Math.imul(vo,gs),$i=$i+Math.imul(Ja,vs)|0,Wi=Math.imul(Ja,gs);var Cl=(ji+Fi|0)+(($i&8191)<<13)|0;return ji=(Wi+($i>>>13)|0)+(Cl>>>26)|0,Cl&=67108863,Ki[0]=Xs,Ki[1]=La,Ki[2]=ba,Ki[3]=ka,Ki[4]=ja,Ki[5]=ts,Ki[6]=ys,Ki[7]=ps,Ki[8]=hs,Ki[9]=Ls,Ki[10]=js,Ki[11]=Ts,Ki[12]=Us,Ki[13]=Es,Ki[14]=zs,Ki[15]=Ks,Ki[16]=nl,Ki[17]=Tl,Ki[18]=Cl,ji!==0&&(Ki[19]=ji,ki.length++),ki};Math.imul||(Ci=xi);function Ai(Li,wi,Ri){Ri.negative=wi.negative^Li.negative,Ri.length=Li.length+wi.length;for(var ki=0,Bi=0,Hi=0;Hi<Ri.length-1;Hi++){var Ki=Bi;Bi=0;for(var ji=ki&67108863,Fi=Math.min(Hi,wi.length-1),$i=Math.max(0,Hi-Li.length+1);$i<=Fi;$i++){var Wi=Hi-$i,Qi=Li.words[Wi]|0,ea=wi.words[$i]|0,na=Qi*ea,Ji=na&67108863;Ki=Ki+(na/67108864|0)|0,Ji=Ji+ji|0,ji=Ji&67108863,Ki=Ki+(Ji>>>26)|0,Bi+=Ki>>>26,Ki&=67108863}Ri.words[Hi]=ji,ki=Ki,Ki=Bi}return ki!==0?Ri.words[Hi]=ki:Ri.length--,Ri._strip()}function Ii(Li,wi,Ri){return Ai(Li,wi,Ri)}Hn.prototype.mulTo=function(wi,Ri){var ki,Bi=this.length+wi.length;return this.length===10&&wi.length===10?ki=Ci(this,wi,Ri):Bi<63?ki=xi(this,wi,Ri):Bi<1024?ki=Ai(this,wi,Ri):ki=Ii(this,wi,Ri),ki},Hn.prototype.mul=function(wi){var Ri=new Hn(null);return Ri.words=new Array(this.length+wi.length),this.mulTo(wi,Ri)},Hn.prototype.mulf=function(wi){var Ri=new Hn(null);return Ri.words=new Array(this.length+wi.length),Ii(this,wi,Ri)},Hn.prototype.imul=function(wi){return this.clone().mulTo(wi,this)},Hn.prototype.imuln=function(wi){var Ri=wi<0;Ri&&(wi=-wi),Mn(typeof wi=="number"),Mn(wi<67108864);for(var ki=0,Bi=0;Bi<this.length;Bi++){var Hi=(this.words[Bi]|0)*wi,Ki=(Hi&67108863)+(ki&67108863);ki>>=26,ki+=Hi/67108864|0,ki+=Ki>>>26,this.words[Bi]=Ki&67108863}return ki!==0&&(this.words[Bi]=ki,this.length++),this.length=wi===0?1:this.length,Ri?this.ineg():this},Hn.prototype.muln=function(wi){return this.clone().imuln(wi)},Hn.prototype.sqr=function(){return this.mul(this)},Hn.prototype.isqr=function(){return this.imul(this.clone())},Hn.prototype.pow=function(wi){var Ri=_i(wi);if(Ri.length===0)return new Hn(1);for(var ki=this,Bi=0;Bi<Ri.length&&Ri[Bi]===0;Bi++,ki=ki.sqr());if(++Bi<Ri.length)for(var Hi=ki.sqr();Bi<Ri.length;Bi++,Hi=Hi.sqr())Ri[Bi]!==0&&(ki=ki.mul(Hi));return ki},Hn.prototype.iushln=function(wi){Mn(typeof wi=="number"&&wi>=0);var Ri=wi%26,ki=(wi-Ri)/26,Bi=67108863>>>26-Ri<<26-Ri,Hi;if(Ri!==0){var Ki=0;for(Hi=0;Hi<this.length;Hi++){var ji=this.words[Hi]&Bi,Fi=(this.words[Hi]|0)-ji<<Ri;this.words[Hi]=Fi|Ki,Ki=ji>>>26-Ri}Ki&&(this.words[Hi]=Ki,this.length++)}if(ki!==0){for(Hi=this.length-1;Hi>=0;Hi--)this.words[Hi+ki]=this.words[Hi];for(Hi=0;Hi<ki;Hi++)this.words[Hi]=0;this.length+=ki}return this._strip()},Hn.prototype.ishln=function(wi){return Mn(this.negative===0),this.iushln(wi)},Hn.prototype.iushrn=function(wi,Ri,ki){Mn(typeof wi=="number"&&wi>=0);var Bi;Ri?Bi=(Ri-Ri%26)/26:Bi=0;var Hi=wi%26,Ki=Math.min((wi-Hi)/26,this.length),ji=67108863^67108863>>>Hi<<Hi,Fi=ki;if(Bi-=Ki,Bi=Math.max(0,Bi),Fi){for(var $i=0;$i<Ki;$i++)Fi.words[$i]=this.words[$i];Fi.length=Ki}if(Ki!==0)if(this.length>Ki)for(this.length-=Ki,$i=0;$i<this.length;$i++)this.words[$i]=this.words[$i+Ki];else this.words[0]=0,this.length=1;var Wi=0;for($i=this.length-1;$i>=0&&(Wi!==0||$i>=Bi);$i--){var Qi=this.words[$i]|0;this.words[$i]=Wi<<26-Hi|Qi>>>Hi,Wi=Qi&ji}return Fi&&Wi!==0&&(Fi.words[Fi.length++]=Wi),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},Hn.prototype.ishrn=function(wi,Ri,ki){return Mn(this.negative===0),this.iushrn(wi,Ri,ki)},Hn.prototype.shln=function(wi){return this.clone().ishln(wi)},Hn.prototype.ushln=function(wi){return this.clone().iushln(wi)},Hn.prototype.shrn=function(wi){return this.clone().ishrn(wi)},Hn.prototype.ushrn=function(wi){return this.clone().iushrn(wi)},Hn.prototype.testn=function(wi){Mn(typeof wi=="number"&&wi>=0);var Ri=wi%26,ki=(wi-Ri)/26,Bi=1<<Ri;if(this.length<=ki)return!1;var Hi=this.words[ki];return!!(Hi&Bi)},Hn.prototype.imaskn=function(wi){Mn(typeof wi=="number"&&wi>=0);var Ri=wi%26,ki=(wi-Ri)/26;if(Mn(this.negative===0,"imaskn works only with positive numbers"),this.length<=ki)return this;if(Ri!==0&&ki++,this.length=Math.min(ki,this.length),Ri!==0){var Bi=67108863^67108863>>>Ri<<Ri;this.words[this.length-1]&=Bi}return this._strip()},Hn.prototype.maskn=function(wi){return this.clone().imaskn(wi)},Hn.prototype.iaddn=function(wi){return Mn(typeof wi=="number"),Mn(wi<67108864),wi<0?this.isubn(-wi):this.negative!==0?this.length===1&&(this.words[0]|0)<=wi?(this.words[0]=wi-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(wi),this.negative=1,this):this._iaddn(wi)},Hn.prototype._iaddn=function(wi){this.words[0]+=wi;for(var Ri=0;Ri<this.length&&this.words[Ri]>=67108864;Ri++)this.words[Ri]-=67108864,Ri===this.length-1?this.words[Ri+1]=1:this.words[Ri+1]++;return this.length=Math.max(this.length,Ri+1),this},Hn.prototype.isubn=function(wi){if(Mn(typeof wi=="number"),Mn(wi<67108864),wi<0)return this.iaddn(-wi);if(this.negative!==0)return this.negative=0,this.iaddn(wi),this.negative=1,this;if(this.words[0]-=wi,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var Ri=0;Ri<this.length&&this.words[Ri]<0;Ri++)this.words[Ri]+=67108864,this.words[Ri+1]-=1;return this._strip()},Hn.prototype.addn=function(wi){return this.clone().iaddn(wi)},Hn.prototype.subn=function(wi){return this.clone().isubn(wi)},Hn.prototype.iabs=function(){return this.negative=0,this},Hn.prototype.abs=function(){return this.clone().iabs()},Hn.prototype._ishlnsubmul=function(wi,Ri,ki){var Bi=wi.length+ki,Hi;this._expand(Bi);var Ki,ji=0;for(Hi=0;Hi<wi.length;Hi++){Ki=(this.words[Hi+ki]|0)+ji;var Fi=(wi.words[Hi]|0)*Ri;Ki-=Fi&67108863,ji=(Ki>>26)-(Fi/67108864|0),this.words[Hi+ki]=Ki&67108863}for(;Hi<this.length-ki;Hi++)Ki=(this.words[Hi+ki]|0)+ji,ji=Ki>>26,this.words[Hi+ki]=Ki&67108863;if(ji===0)return this._strip();for(Mn(ji===-1),ji=0,Hi=0;Hi<this.length;Hi++)Ki=-(this.words[Hi]|0)+ji,ji=Ki>>26,this.words[Hi]=Ki&67108863;return this.negative=1,this._strip()},Hn.prototype._wordDiv=function(wi,Ri){var ki=this.length-wi.length,Bi=this.clone(),Hi=wi,Ki=Hi.words[Hi.length-1]|0,ji=this._countBits(Ki);ki=26-ji,ki!==0&&(Hi=Hi.ushln(ki),Bi.iushln(ki),Ki=Hi.words[Hi.length-1]|0);var Fi=Bi.length-Hi.length,$i;if(Ri!=="mod"){$i=new Hn(null),$i.length=Fi+1,$i.words=new Array($i.length);for(var Wi=0;Wi<$i.length;Wi++)$i.words[Wi]=0}var Qi=Bi.clone()._ishlnsubmul(Hi,1,Fi);Qi.negative===0&&(Bi=Qi,$i&&($i.words[Fi]=1));for(var ea=Fi-1;ea>=0;ea--){var na=(Bi.words[Hi.length+ea]|0)*67108864+(Bi.words[Hi.length+ea-1]|0);for(na=Math.min(na/Ki|0,67108863),Bi._ishlnsubmul(Hi,na,ea);Bi.negative!==0;)na--,Bi.negative=0,Bi._ishlnsubmul(Hi,1,ea),Bi.isZero()||(Bi.negative^=1);$i&&($i.words[ea]=na)}return $i&&$i._strip(),Bi._strip(),Ri!=="div"&&ki!==0&&Bi.iushrn(ki),{div:$i||null,mod:Bi}},Hn.prototype.divmod=function(wi,Ri,ki){if(Mn(!wi.isZero()),this.isZero())return{div:new Hn(0),mod:new Hn(0)};var Bi,Hi,Ki;return this.negative!==0&&wi.negative===0?(Ki=this.neg().divmod(wi,Ri),Ri!=="mod"&&(Bi=Ki.div.neg()),Ri!=="div"&&(Hi=Ki.mod.neg(),ki&&Hi.negative!==0&&Hi.iadd(wi)),{div:Bi,mod:Hi}):this.negative===0&&wi.negative!==0?(Ki=this.divmod(wi.neg(),Ri),Ri!=="mod"&&(Bi=Ki.div.neg()),{div:Bi,mod:Ki.mod}):(this.negative&wi.negative)!==0?(Ki=this.neg().divmod(wi.neg(),Ri),Ri!=="div"&&(Hi=Ki.mod.neg(),ki&&Hi.negative!==0&&Hi.isub(wi)),{div:Ki.div,mod:Hi}):wi.length>this.length||this.cmp(wi)<0?{div:new Hn(0),mod:this}:wi.length===1?Ri==="div"?{div:this.divn(wi.words[0]),mod:null}:Ri==="mod"?{div:null,mod:new Hn(this.modrn(wi.words[0]))}:{div:this.divn(wi.words[0]),mod:new Hn(this.modrn(wi.words[0]))}:this._wordDiv(wi,Ri)},Hn.prototype.div=function(wi){return this.divmod(wi,"div",!1).div},Hn.prototype.mod=function(wi){return this.divmod(wi,"mod",!1).mod},Hn.prototype.umod=function(wi){return this.divmod(wi,"mod",!0).mod},Hn.prototype.divRound=function(wi){var Ri=this.divmod(wi);if(Ri.mod.isZero())return Ri.div;var ki=Ri.div.negative!==0?Ri.mod.isub(wi):Ri.mod,Bi=wi.ushrn(1),Hi=wi.andln(1),Ki=ki.cmp(Bi);return Ki<0||Hi===1&&Ki===0?Ri.div:Ri.div.negative!==0?Ri.div.isubn(1):Ri.div.iaddn(1)},Hn.prototype.modrn=function(wi){var Ri=wi<0;Ri&&(wi=-wi),Mn(wi<=67108863);for(var ki=(1<<26)%wi,Bi=0,Hi=this.length-1;Hi>=0;Hi--)Bi=(ki*Bi+(this.words[Hi]|0))%wi;return Ri?-Bi:Bi},Hn.prototype.modn=function(wi){return this.modrn(wi)},Hn.prototype.idivn=function(wi){var Ri=wi<0;Ri&&(wi=-wi),Mn(wi<=67108863);for(var ki=0,Bi=this.length-1;Bi>=0;Bi--){var Hi=(this.words[Bi]|0)+ki*67108864;this.words[Bi]=Hi/wi|0,ki=Hi%wi}return this._strip(),Ri?this.ineg():this},Hn.prototype.divn=function(wi){return this.clone().idivn(wi)},Hn.prototype.egcd=function(wi){Mn(wi.negative===0),Mn(!wi.isZero());var Ri=this,ki=wi.clone();Ri.negative!==0?Ri=Ri.umod(wi):Ri=Ri.clone();for(var Bi=new Hn(1),Hi=new Hn(0),Ki=new Hn(0),ji=new Hn(1),Fi=0;Ri.isEven()&&ki.isEven();)Ri.iushrn(1),ki.iushrn(1),++Fi;for(var $i=ki.clone(),Wi=Ri.clone();!Ri.isZero();){for(var Qi=0,ea=1;(Ri.words[0]&ea)===0&&Qi<26;++Qi,ea<<=1);if(Qi>0)for(Ri.iushrn(Qi);Qi-- >0;)(Bi.isOdd()||Hi.isOdd())&&(Bi.iadd($i),Hi.isub(Wi)),Bi.iushrn(1),Hi.iushrn(1);for(var na=0,Ji=1;(ki.words[0]&Ji)===0&&na<26;++na,Ji<<=1);if(na>0)for(ki.iushrn(na);na-- >0;)(Ki.isOdd()||ji.isOdd())&&(Ki.iadd($i),ji.isub(Wi)),Ki.iushrn(1),ji.iushrn(1);Ri.cmp(ki)>=0?(Ri.isub(ki),Bi.isub(Ki),Hi.isub(ji)):(ki.isub(Ri),Ki.isub(Bi),ji.isub(Hi))}return{a:Ki,b:ji,gcd:ki.iushln(Fi)}},Hn.prototype._invmp=function(wi){Mn(wi.negative===0),Mn(!wi.isZero());var Ri=this,ki=wi.clone();Ri.negative!==0?Ri=Ri.umod(wi):Ri=Ri.clone();for(var Bi=new Hn(1),Hi=new Hn(0),Ki=ki.clone();Ri.cmpn(1)>0&&ki.cmpn(1)>0;){for(var ji=0,Fi=1;(Ri.words[0]&Fi)===0&&ji<26;++ji,Fi<<=1);if(ji>0)for(Ri.iushrn(ji);ji-- >0;)Bi.isOdd()&&Bi.iadd(Ki),Bi.iushrn(1);for(var $i=0,Wi=1;(ki.words[0]&Wi)===0&&$i<26;++$i,Wi<<=1);if($i>0)for(ki.iushrn($i);$i-- >0;)Hi.isOdd()&&Hi.iadd(Ki),Hi.iushrn(1);Ri.cmp(ki)>=0?(Ri.isub(ki),Bi.isub(Hi)):(ki.isub(Ri),Hi.isub(Bi))}var Qi;return Ri.cmpn(1)===0?Qi=Bi:Qi=Hi,Qi.cmpn(0)<0&&Qi.iadd(wi),Qi},Hn.prototype.gcd=function(wi){if(this.isZero())return wi.abs();if(wi.isZero())return this.abs();var Ri=this.clone(),ki=wi.clone();Ri.negative=0,ki.negative=0;for(var Bi=0;Ri.isEven()&&ki.isEven();Bi++)Ri.iushrn(1),ki.iushrn(1);do{for(;Ri.isEven();)Ri.iushrn(1);for(;ki.isEven();)ki.iushrn(1);var Hi=Ri.cmp(ki);if(Hi<0){var Ki=Ri;Ri=ki,ki=Ki}else if(Hi===0||ki.cmpn(1)===0)break;Ri.isub(ki)}while(!0);return ki.iushln(Bi)},Hn.prototype.invm=function(wi){return this.egcd(wi).a.umod(wi)},Hn.prototype.isEven=function(){return(this.words[0]&1)===0},Hn.prototype.isOdd=function(){return(this.words[0]&1)===1},Hn.prototype.andln=function(wi){return this.words[0]&wi},Hn.prototype.bincn=function(wi){Mn(typeof wi=="number");var Ri=wi%26,ki=(wi-Ri)/26,Bi=1<<Ri;if(this.length<=ki)return this._expand(ki+1),this.words[ki]|=Bi,this;for(var Hi=Bi,Ki=ki;Hi!==0&&Ki<this.length;Ki++){var ji=this.words[Ki]|0;ji+=Hi,Hi=ji>>>26,ji&=67108863,this.words[Ki]=ji}return Hi!==0&&(this.words[Ki]=Hi,this.length++),this},Hn.prototype.isZero=function(){return this.length===1&&this.words[0]===0},Hn.prototype.cmpn=function(wi){var Ri=wi<0;if(this.negative!==0&&!Ri)return-1;if(this.negative===0&&Ri)return 1;this._strip();var ki;if(this.length>1)ki=1;else{Ri&&(wi=-wi),Mn(wi<=67108863,"Number is too big");var Bi=this.words[0]|0;ki=Bi===wi?0:Bi<wi?-1:1}return this.negative!==0?-ki|0:ki},Hn.prototype.cmp=function(wi){if(this.negative!==0&&wi.negative===0)return-1;if(this.negative===0&&wi.negative!==0)return 1;var Ri=this.ucmp(wi);return this.negative!==0?-Ri|0:Ri},Hn.prototype.ucmp=function(wi){if(this.length>wi.length)return 1;if(this.length<wi.length)return-1;for(var Ri=0,ki=this.length-1;ki>=0;ki--){var Bi=this.words[ki]|0,Hi=wi.words[ki]|0;if(Bi!==Hi){Bi<Hi?Ri=-1:Bi>Hi&&(Ri=1);break}}return Ri},Hn.prototype.gtn=function(wi){return this.cmpn(wi)===1},Hn.prototype.gt=function(wi){return this.cmp(wi)===1},Hn.prototype.gten=function(wi){return this.cmpn(wi)>=0},Hn.prototype.gte=function(wi){return this.cmp(wi)>=0},Hn.prototype.ltn=function(wi){return this.cmpn(wi)===-1},Hn.prototype.lt=function(wi){return this.cmp(wi)===-1},Hn.prototype.lten=function(wi){return this.cmpn(wi)<=0},Hn.prototype.lte=function(wi){return this.cmp(wi)<=0},Hn.prototype.eqn=function(wi){return this.cmpn(wi)===0},Hn.prototype.eq=function(wi){return this.cmp(wi)===0},Hn.red=function(wi){return new zi(wi)},Hn.prototype.toRed=function(wi){return Mn(!this.red,"Already a number in reduction context"),Mn(this.negative===0,"red works only with positives"),wi.convertTo(this)._forceRed(wi)},Hn.prototype.fromRed=function(){return Mn(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},Hn.prototype._forceRed=function(wi){return this.red=wi,this},Hn.prototype.forceRed=function(wi){return Mn(!this.red,"Already a number in reduction context"),this._forceRed(wi)},Hn.prototype.redAdd=function(wi){return Mn(this.red,"redAdd works only with red numbers"),this.red.add(this,wi)},Hn.prototype.redIAdd=function(wi){return Mn(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,wi)},Hn.prototype.redSub=function(wi){return Mn(this.red,"redSub works only with red numbers"),this.red.sub(this,wi)},Hn.prototype.redISub=function(wi){return Mn(this.red,"redISub works only with red numbers"),this.red.isub(this,wi)},Hn.prototype.redShl=function(wi){return Mn(this.red,"redShl works only with red numbers"),this.red.shl(this,wi)},Hn.prototype.redMul=function(wi){return Mn(this.red,"redMul works only with red numbers"),this.red._verify2(this,wi),this.red.mul(this,wi)},Hn.prototype.redIMul=function(wi){return Mn(this.red,"redMul works only with red numbers"),this.red._verify2(this,wi),this.red.imul(this,wi)},Hn.prototype.redSqr=function(){return Mn(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},Hn.prototype.redISqr=function(){return Mn(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},Hn.prototype.redSqrt=function(){return Mn(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},Hn.prototype.redInvm=function(){return Mn(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},Hn.prototype.redNeg=function(){return Mn(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},Hn.prototype.redPow=function(wi){return Mn(this.red&&!wi.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,wi)};var Ni={k256:null,p224:null,p192:null,p25519:null};function Pi(Li,wi){this.name=Li,this.p=new Hn(wi,16),this.n=this.p.bitLength(),this.k=new Hn(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Pi.prototype._tmp=function(){var wi=new Hn(null);return wi.words=new Array(Math.ceil(this.n/13)),wi},Pi.prototype.ireduce=function(wi){var Ri=wi,ki;do this.split(Ri,this.tmp),Ri=this.imulK(Ri),Ri=Ri.iadd(this.tmp),ki=Ri.bitLength();while(ki>this.n);var Bi=ki<this.n?-1:Ri.ucmp(this.p);return Bi===0?(Ri.words[0]=0,Ri.length=1):Bi>0?Ri.isub(this.p):Ri.strip!==void 0?Ri.strip():Ri._strip(),Ri},Pi.prototype.split=function(wi,Ri){wi.iushrn(this.n,0,Ri)},Pi.prototype.imulK=function(wi){return wi.imul(this.k)};function Vi(){Pi.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}Ln(Vi,Pi),Vi.prototype.split=function(wi,Ri){for(var ki=4194303,Bi=Math.min(wi.length,9),Hi=0;Hi<Bi;Hi++)Ri.words[Hi]=wi.words[Hi];if(Ri.length=Bi,wi.length<=9){wi.words[0]=0,wi.length=1;return}var Ki=wi.words[9];for(Ri.words[Ri.length++]=Ki&ki,Hi=10;Hi<wi.length;Hi++){var ji=wi.words[Hi]|0;wi.words[Hi-10]=(ji&ki)<<4|Ki>>>22,Ki=ji}Ki>>>=22,wi.words[Hi-10]=Ki,Ki===0&&wi.length>10?wi.length-=10:wi.length-=9},Vi.prototype.imulK=function(wi){wi.words[wi.length]=0,wi.words[wi.length+1]=0,wi.length+=2;for(var Ri=0,ki=0;ki<wi.length;ki++){var Bi=wi.words[ki]|0;Ri+=Bi*977,wi.words[ki]=Ri&67108863,Ri=Bi*64+(Ri/67108864|0)}return wi.words[wi.length-1]===0&&(wi.length--,wi.words[wi.length-1]===0&&wi.length--),wi};function Ui(){Pi.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}Ln(Ui,Pi);function Gi(){Pi.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}Ln(Gi,Pi);function Yi(){Pi.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}Ln(Yi,Pi),Yi.prototype.imulK=function(wi){for(var Ri=0,ki=0;ki<wi.length;ki++){var Bi=(wi.words[ki]|0)*19+Ri,Hi=Bi&67108863;Bi>>>=26,wi.words[ki]=Hi,Ri=Bi}return Ri!==0&&(wi.words[wi.length++]=Ri),wi},Hn._prime=function(wi){if(Ni[wi])return Ni[wi];var Ri;if(wi==="k256")Ri=new Vi;else if(wi==="p224")Ri=new Ui;else if(wi==="p192")Ri=new Gi;else if(wi==="p25519")Ri=new Yi;else throw new Error("Unknown prime "+wi);return Ni[wi]=Ri,Ri};function zi(Li){if(typeof Li=="string"){var wi=Hn._prime(Li);this.m=wi.p,this.prime=wi}else Mn(Li.gtn(1),"modulus must be greater than 1"),this.m=Li,this.prime=null}zi.prototype._verify1=function(wi){Mn(wi.negative===0,"red works only with positives"),Mn(wi.red,"red works only with red numbers")},zi.prototype._verify2=function(wi,Ri){Mn((wi.negative|Ri.negative)===0,"red works only with positives"),Mn(wi.red&&wi.red===Ri.red,"red works only with red numbers")},zi.prototype.imod=function(wi){return this.prime?this.prime.ireduce(wi)._forceRed(this):(vi(wi,wi.umod(this.m)._forceRed(this)),wi)},zi.prototype.neg=function(wi){return wi.isZero()?wi.clone():this.m.sub(wi)._forceRed(this)},zi.prototype.add=function(wi,Ri){this._verify2(wi,Ri);var ki=wi.add(Ri);return ki.cmp(this.m)>=0&&ki.isub(this.m),ki._forceRed(this)},zi.prototype.iadd=function(wi,Ri){this._verify2(wi,Ri);var ki=wi.iadd(Ri);return ki.cmp(this.m)>=0&&ki.isub(this.m),ki},zi.prototype.sub=function(wi,Ri){this._verify2(wi,Ri);var ki=wi.sub(Ri);return ki.cmpn(0)<0&&ki.iadd(this.m),ki._forceRed(this)},zi.prototype.isub=function(wi,Ri){this._verify2(wi,Ri);var ki=wi.isub(Ri);return ki.cmpn(0)<0&&ki.iadd(this.m),ki},zi.prototype.shl=function(wi,Ri){return this._verify1(wi),this.imod(wi.ushln(Ri))},zi.prototype.imul=function(wi,Ri){return this._verify2(wi,Ri),this.imod(wi.imul(Ri))},zi.prototype.mul=function(wi,Ri){return this._verify2(wi,Ri),this.imod(wi.mul(Ri))},zi.prototype.isqr=function(wi){return this.imul(wi,wi.clone())},zi.prototype.sqr=function(wi){return this.mul(wi,wi)},zi.prototype.sqrt=function(wi){if(wi.isZero())return wi.clone();var Ri=this.m.andln(3);if(Mn(Ri%2===1),Ri===3){var ki=this.m.add(new Hn(1)).iushrn(2);return this.pow(wi,ki)}for(var Bi=this.m.subn(1),Hi=0;!Bi.isZero()&&Bi.andln(1)===0;)Hi++,Bi.iushrn(1);Mn(!Bi.isZero());var Ki=new Hn(1).toRed(this),ji=Ki.redNeg(),Fi=this.m.subn(1).iushrn(1),$i=this.m.bitLength();for($i=new Hn(2*$i*$i).toRed(this);this.pow($i,Fi).cmp(ji)!==0;)$i.redIAdd(ji);for(var Wi=this.pow($i,Bi),Qi=this.pow(wi,Bi.addn(1).iushrn(1)),ea=this.pow(wi,Bi),na=Hi;ea.cmp(Ki)!==0;){for(var Ji=ea,ra=0;Ji.cmp(Ki)!==0;ra++)Ji=Ji.redSqr();Mn(ra<na);var sa=this.pow(Wi,new Hn(1).iushln(na-ra-1));Qi=Qi.redMul(sa),Wi=sa.redSqr(),ea=ea.redMul(Wi),na=ra}return Qi},zi.prototype.invm=function(wi){var Ri=wi._invmp(this.m);return Ri.negative!==0?(Ri.negative=0,this.imod(Ri).redNeg()):this.imod(Ri)},zi.prototype.pow=function(wi,Ri){if(Ri.isZero())return new Hn(1).toRed(this);if(Ri.cmpn(1)===0)return wi.clone();var ki=4,Bi=new Array(1<<ki);Bi[0]=new Hn(1).toRed(this),Bi[1]=wi;for(var Hi=2;Hi<Bi.length;Hi++)Bi[Hi]=this.mul(Bi[Hi-1],wi);var Ki=Bi[0],ji=0,Fi=0,$i=Ri.bitLength()%26;for($i===0&&($i=26),Hi=Ri.length-1;Hi>=0;Hi--){for(var Wi=Ri.words[Hi],Qi=$i-1;Qi>=0;Qi--){var ea=Wi>>Qi&1;if(Ki!==Bi[0]&&(Ki=this.sqr(Ki)),ea===0&&ji===0){Fi=0;continue}ji<<=1,ji|=ea,Fi++,!(Fi!==ki&&(Hi!==0||Qi!==0))&&(Ki=this.mul(Ki,Bi[ji]),Fi=0,ji=0)}$i=26}return Ki},zi.prototype.convertTo=function(wi){var Ri=wi.umod(this.m);return Ri===wi?Ri.clone():Ri},zi.prototype.convertFrom=function(wi){var Ri=wi.clone();return Ri.red=null,Ri},Hn.mont=function(wi){return new Mi(wi)};function Mi(Li){zi.call(this,Li),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new Hn(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}Ln(Mi,zi),Mi.prototype.convertTo=function(wi){return this.imod(wi.ushln(this.shift))},Mi.prototype.convertFrom=function(wi){var Ri=this.imod(wi.mul(this.rinv));return Ri.red=null,Ri},Mi.prototype.imul=function(wi,Ri){if(wi.isZero()||Ri.isZero())return wi.words[0]=0,wi.length=1,wi;var ki=wi.imul(Ri),Bi=ki.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Hi=ki.isub(Bi).iushrn(this.shift),Ki=Hi;return Hi.cmp(this.m)>=0?Ki=Hi.isub(this.m):Hi.cmpn(0)<0&&(Ki=Hi.iadd(this.m)),Ki._forceRed(this)},Mi.prototype.mul=function(wi,Ri){if(wi.isZero()||Ri.isZero())return new Hn(0)._forceRed(this);var ki=wi.mul(Ri),Bi=ki.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Hi=ki.isub(Bi).iushrn(this.shift),Ki=Hi;return Hi.cmp(this.m)>=0?Ki=Hi.isub(this.m):Hi.cmpn(0)<0&&(Ki=Hi.iadd(this.m)),Ki._forceRed(this)},Mi.prototype.invm=function(wi){var Ri=this.imod(wi._invmp(this.m).mul(this.r2));return Ri._forceRed(this)}})(on,bn)}(bn$1)),bn$1.exports}var asn1$1={},asn1={},api$1={},vmBrowserify={},hasRequiredVmBrowserify;function requireVmBrowserify(){return hasRequiredVmBrowserify||(hasRequiredVmBrowserify=1,function(exports){var indexOf=function(on,In){if(on.indexOf)return on.indexOf(In);for(var Rn=0;Rn<on.length;Rn++)if(on[Rn]===In)return Rn;return-1},Object_keys=function(on){if(Object.keys)return Object.keys(on);var In=[];for(var Rn in on)In.push(Rn);return In},forEach=function(on,In){if(on.forEach)return on.forEach(In);for(var Rn=0;Rn<on.length;Rn++)In(on[Rn],Rn,on)},defineProp=function(){try{return Object.defineProperty({},"_",{}),function(on,In,Rn){Object.defineProperty(on,In,{writable:!0,enumerable:!1,configurable:!0,value:Rn})}}catch{return function(In,Rn,Mn){In[Rn]=Mn}}}(),globals=["Array","Boolean","Date","Error","EvalError","Function","Infinity","JSON","Math","NaN","Number","Object","RangeError","ReferenceError","RegExp","String","SyntaxError","TypeError","URIError","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","eval","isFinite","isNaN","parseFloat","parseInt","undefined","unescape"];function Context(){}Context.prototype={};var Script=exports.Script=function(In){if(!(this instanceof Script))return new Script(In);this.code=In};Script.prototype.runInContext=function(on){if(!(on instanceof Context))throw new TypeError("needs a 'context' argument.");var In=document.createElement("iframe");In.style||(In.style={}),In.style.display="none",document.body.appendChild(In);var Rn=In.contentWindow,Mn=Rn.eval,Ln=Rn.execScript;!Mn&&Ln&&(Ln.call(Rn,"null"),Mn=Rn.eval),forEach(Object_keys(on),function(Wn){Rn[Wn]=on[Wn]}),forEach(globals,function(Wn){on[Wn]&&(Rn[Wn]=on[Wn])});var Hn=Object_keys(Rn),jn=Mn.call(Rn,this.code);return forEach(Object_keys(Rn),function(Wn){(Wn in on||indexOf(Hn,Wn)===-1)&&(on[Wn]=Rn[Wn])}),forEach(globals,function(Wn){Wn in on||defineProp(on,Wn,Rn[Wn])}),document.body.removeChild(In),jn},Script.prototype.runInThisContext=function(){return eval(this.code)},Script.prototype.runInNewContext=function(on){var In=Script.createContext(on),Rn=this.runInContext(In);return on&&forEach(Object_keys(In),function(Mn){on[Mn]=In[Mn]}),Rn},forEach(Object_keys(Script.prototype),function(on){exports[on]=Script[on]=function(In){var Rn=Script(In);return Rn[on].apply(Rn,[].slice.call(arguments,1))}}),exports.isContext=function(on){return on instanceof Context},exports.createScript=function(on){return exports.Script(on)},exports.createContext=Script.createContext=function(on){var In=new Context;return typeof on=="object"&&forEach(Object_keys(on),function(Rn){In[Rn]=on[Rn]}),In}}(vmBrowserify)),vmBrowserify}var hasRequiredApi$1;function requireApi$1(){return hasRequiredApi$1||(hasRequiredApi$1=1,function(on){var In=requireAsn1$1(),Rn=requireInherits_browser(),Mn=on;Mn.define=function(jn,Wn){return new Ln(jn,Wn)};function Ln(Hn,jn){this.name=Hn,this.body=jn,this.decoders={},this.encoders={}}Ln.prototype._createNamed=function(jn){var Wn;try{Wn=requireVmBrowserify().runInThisContext("(function "+this.name+`(entity) {
|
|
4375
4375
|
this._initNamed(entity);
|
|
4376
4376
|
})`)}catch{Wn=function(hi){this._initNamed(hi)}}return Rn(Wn,jn),Wn.prototype._initNamed=function(hi){jn.call(this,hi)},new Wn(this)},Ln.prototype._getDecoder=function(jn){return jn=jn||"der",this.decoders.hasOwnProperty(jn)||(this.decoders[jn]=this._createNamed(In.decoders[jn])),this.decoders[jn]},Ln.prototype.decode=function(jn,Wn,Yn){return this._getDecoder(Wn).decode(jn,Yn)},Ln.prototype._getEncoder=function(jn){return jn=jn||"der",this.encoders.hasOwnProperty(jn)||(this.encoders[jn]=this._createNamed(In.encoders[jn])),this.encoders[jn]},Ln.prototype.encode=function(jn,Wn,Yn){return this._getEncoder(Wn).encode(jn,Yn)}}(api$1)),api$1}var base$1={},reporter={},hasRequiredReporter;function requireReporter(){if(hasRequiredReporter)return reporter;hasRequiredReporter=1;var on=requireInherits_browser();function In(Mn){this._reporterState={obj:null,path:[],options:Mn||{},errors:[]}}reporter.Reporter=In,In.prototype.isError=function(Ln){return Ln instanceof Rn},In.prototype.save=function(){var Ln=this._reporterState;return{obj:Ln.obj,pathLen:Ln.path.length}},In.prototype.restore=function(Ln){var Hn=this._reporterState;Hn.obj=Ln.obj,Hn.path=Hn.path.slice(0,Ln.pathLen)},In.prototype.enterKey=function(Ln){return this._reporterState.path.push(Ln)},In.prototype.exitKey=function(Ln){var Hn=this._reporterState;Hn.path=Hn.path.slice(0,Ln-1)},In.prototype.leaveKey=function(Ln,Hn,jn){var Wn=this._reporterState;this.exitKey(Ln),Wn.obj!==null&&(Wn.obj[Hn]=jn)},In.prototype.path=function(){return this._reporterState.path.join("/")},In.prototype.enterObject=function(){var Ln=this._reporterState,Hn=Ln.obj;return Ln.obj={},Hn},In.prototype.leaveObject=function(Ln){var Hn=this._reporterState,jn=Hn.obj;return Hn.obj=Ln,jn},In.prototype.error=function(Ln){var Hn,jn=this._reporterState,Wn=Ln instanceof Rn;if(Wn?Hn=Ln:Hn=new Rn(jn.path.map(function(Yn){return"["+JSON.stringify(Yn)+"]"}).join(""),Ln.message||Ln,Ln.stack),!jn.options.partial)throw Hn;return Wn||jn.errors.push(Hn),Hn},In.prototype.wrapResult=function(Ln){var Hn=this._reporterState;return Hn.options.partial?{result:this.isError(Ln)?null:Ln,errors:Hn.errors}:Ln};function Rn(Mn,Ln){this.path=Mn,this.rethrow(Ln)}return on(Rn,Error),Rn.prototype.rethrow=function(Ln){if(this.message=Ln+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,Rn),!this.stack)try{throw new Error(this.message)}catch(Hn){this.stack=Hn.stack}return this},reporter}var buffer={},hasRequiredBuffer;function requireBuffer(){if(hasRequiredBuffer)return buffer;hasRequiredBuffer=1;var on=requireInherits_browser(),In=requireBase().Reporter,Rn=requireDist().Buffer;function Mn(Hn,jn){if(In.call(this,jn),!Rn.isBuffer(Hn)){this.error("Input not Buffer");return}this.base=Hn,this.offset=0,this.length=Hn.length}on(Mn,In),buffer.DecoderBuffer=Mn,Mn.prototype.save=function(){return{offset:this.offset,reporter:In.prototype.save.call(this)}},Mn.prototype.restore=function(jn){var Wn=new Mn(this.base);return Wn.offset=jn.offset,Wn.length=this.offset,this.offset=jn.offset,In.prototype.restore.call(this,jn.reporter),Wn},Mn.prototype.isEmpty=function(){return this.offset===this.length},Mn.prototype.readUInt8=function(jn){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(jn||"DecoderBuffer overrun")},Mn.prototype.skip=function(jn,Wn){if(!(this.offset+jn<=this.length))return this.error(Wn||"DecoderBuffer overrun");var Yn=new Mn(this.base);return Yn._reporterState=this._reporterState,Yn.offset=this.offset,Yn.length=this.offset+jn,this.offset+=jn,Yn},Mn.prototype.raw=function(jn){return this.base.slice(jn?jn.offset:this.offset,this.length)};function Ln(Hn,jn){if(Array.isArray(Hn))this.length=0,this.value=Hn.map(function(Wn){return Wn instanceof Ln||(Wn=new Ln(Wn,jn)),this.length+=Wn.length,Wn},this);else if(typeof Hn=="number"){if(!(0<=Hn&&Hn<=255))return jn.error("non-byte EncoderBuffer value");this.value=Hn,this.length=1}else if(typeof Hn=="string")this.value=Hn,this.length=Rn.byteLength(Hn);else if(Rn.isBuffer(Hn))this.value=Hn,this.length=Hn.length;else return jn.error("Unsupported type: "+typeof Hn)}return buffer.EncoderBuffer=Ln,Ln.prototype.join=function(jn,Wn){return jn||(jn=new Rn(this.length)),Wn||(Wn=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(Yn){Yn.join(jn,Wn),Wn+=Yn.length}):(typeof this.value=="number"?jn[Wn]=this.value:typeof this.value=="string"?jn.write(this.value,Wn):Rn.isBuffer(this.value)&&this.value.copy(jn,Wn),Wn+=this.length)),jn},buffer}var node,hasRequiredNode;function requireNode(){if(hasRequiredNode)return node;hasRequiredNode=1;var on=requireBase().Reporter,In=requireBase().EncoderBuffer,Rn=requireBase().DecoderBuffer,Mn=requireMinimalisticAssert(),Ln=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],Hn=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(Ln),jn=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function Wn(hi,vi){var gi={};this._baseState=gi,gi.enc=hi,gi.parent=vi||null,gi.children=null,gi.tag=null,gi.args=null,gi.reverseArgs=null,gi.choice=null,gi.optional=!1,gi.any=!1,gi.obj=!1,gi.use=null,gi.useDecoder=null,gi.key=null,gi.default=null,gi.explicit=null,gi.implicit=null,gi.contains=null,gi.parent||(gi.children=[],this._wrap())}node=Wn;var Yn=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];return Wn.prototype.clone=function(){var vi=this._baseState,gi={};Yn.forEach(function(yi){gi[yi]=vi[yi]});var mi=new this.constructor(gi.parent);return mi._baseState=gi,mi},Wn.prototype._wrap=function(){var vi=this._baseState;Hn.forEach(function(gi){this[gi]=function(){var yi=new this.constructor(this);return vi.children.push(yi),yi[gi].apply(yi,arguments)}},this)},Wn.prototype._init=function(vi){var gi=this._baseState;Mn(gi.parent===null),vi.call(this),gi.children=gi.children.filter(function(mi){return mi._baseState.parent===this},this),Mn.equal(gi.children.length,1,"Root node can have only one child")},Wn.prototype._useArgs=function(vi){var gi=this._baseState,mi=vi.filter(function(yi){return yi instanceof this.constructor},this);vi=vi.filter(function(yi){return!(yi instanceof this.constructor)},this),mi.length!==0&&(Mn(gi.children===null),gi.children=mi,mi.forEach(function(yi){yi._baseState.parent=this},this)),vi.length!==0&&(Mn(gi.args===null),gi.args=vi,gi.reverseArgs=vi.map(function(yi){if(typeof yi!="object"||yi.constructor!==Object)return yi;var bi={};return Object.keys(yi).forEach(function(Ei){Ei==(Ei|0)&&(Ei|=0);var _i=yi[Ei];bi[_i]=Ei}),bi}))},jn.forEach(function(hi){Wn.prototype[hi]=function(){var gi=this._baseState;throw new Error(hi+" not implemented for encoding: "+gi.enc)}}),Ln.forEach(function(hi){Wn.prototype[hi]=function(){var gi=this._baseState,mi=Array.prototype.slice.call(arguments);return Mn(gi.tag===null),gi.tag=hi,this._useArgs(mi),this}}),Wn.prototype.use=function(vi){Mn(vi);var gi=this._baseState;return Mn(gi.use===null),gi.use=vi,this},Wn.prototype.optional=function(){var vi=this._baseState;return vi.optional=!0,this},Wn.prototype.def=function(vi){var gi=this._baseState;return Mn(gi.default===null),gi.default=vi,gi.optional=!0,this},Wn.prototype.explicit=function(vi){var gi=this._baseState;return Mn(gi.explicit===null&&gi.implicit===null),gi.explicit=vi,this},Wn.prototype.implicit=function(vi){var gi=this._baseState;return Mn(gi.explicit===null&&gi.implicit===null),gi.implicit=vi,this},Wn.prototype.obj=function(){var vi=this._baseState,gi=Array.prototype.slice.call(arguments);return vi.obj=!0,gi.length!==0&&this._useArgs(gi),this},Wn.prototype.key=function(vi){var gi=this._baseState;return Mn(gi.key===null),gi.key=vi,this},Wn.prototype.any=function(){var vi=this._baseState;return vi.any=!0,this},Wn.prototype.choice=function(vi){var gi=this._baseState;return Mn(gi.choice===null),gi.choice=vi,this._useArgs(Object.keys(vi).map(function(mi){return vi[mi]})),this},Wn.prototype.contains=function(vi){var gi=this._baseState;return Mn(gi.use===null),gi.contains=vi,this},Wn.prototype._decode=function(vi,gi){var mi=this._baseState;if(mi.parent===null)return vi.wrapResult(mi.children[0]._decode(vi,gi));var yi=mi.default,bi=!0,Ei=null;if(mi.key!==null&&(Ei=vi.enterKey(mi.key)),mi.optional){var _i=null;if(mi.explicit!==null?_i=mi.explicit:mi.implicit!==null?_i=mi.implicit:mi.tag!==null&&(_i=mi.tag),_i===null&&!mi.any){var xi=vi.save();try{mi.choice===null?this._decodeGeneric(mi.tag,vi,gi):this._decodeChoice(vi,gi),bi=!0}catch{bi=!1}vi.restore(xi)}else if(bi=this._peekTag(vi,_i,mi.any),vi.isError(bi))return bi}var Ci;if(mi.obj&&bi&&(Ci=vi.enterObject()),bi){if(mi.explicit!==null){var Ai=this._decodeTag(vi,mi.explicit);if(vi.isError(Ai))return Ai;vi=Ai}var Ii=vi.offset;if(mi.use===null&&mi.choice===null){if(mi.any)var xi=vi.save();var Ni=this._decodeTag(vi,mi.implicit!==null?mi.implicit:mi.tag,mi.any);if(vi.isError(Ni))return Ni;mi.any?yi=vi.raw(xi):vi=Ni}if(gi&&gi.track&&mi.tag!==null&&gi.track(vi.path(),Ii,vi.length,"tagged"),gi&&gi.track&&mi.tag!==null&&gi.track(vi.path(),vi.offset,vi.length,"content"),mi.any?yi=yi:mi.choice===null?yi=this._decodeGeneric(mi.tag,vi,gi):yi=this._decodeChoice(vi,gi),vi.isError(yi))return yi;if(!mi.any&&mi.choice===null&&mi.children!==null&&mi.children.forEach(function(Ui){Ui._decode(vi,gi)}),mi.contains&&(mi.tag==="octstr"||mi.tag==="bitstr")){var Pi=new Rn(yi);yi=this._getUse(mi.contains,vi._reporterState.obj)._decode(Pi,gi)}}return mi.obj&&bi&&(yi=vi.leaveObject(Ci)),mi.key!==null&&(yi!==null||bi===!0)?vi.leaveKey(Ei,mi.key,yi):Ei!==null&&vi.exitKey(Ei),yi},Wn.prototype._decodeGeneric=function(vi,gi,mi){var yi=this._baseState;return vi==="seq"||vi==="set"?null:vi==="seqof"||vi==="setof"?this._decodeList(gi,vi,yi.args[0],mi):/str$/.test(vi)?this._decodeStr(gi,vi,mi):vi==="objid"&&yi.args?this._decodeObjid(gi,yi.args[0],yi.args[1],mi):vi==="objid"?this._decodeObjid(gi,null,null,mi):vi==="gentime"||vi==="utctime"?this._decodeTime(gi,vi,mi):vi==="null_"?this._decodeNull(gi,mi):vi==="bool"?this._decodeBool(gi,mi):vi==="objDesc"?this._decodeStr(gi,vi,mi):vi==="int"||vi==="enum"?this._decodeInt(gi,yi.args&&yi.args[0],mi):yi.use!==null?this._getUse(yi.use,gi._reporterState.obj)._decode(gi,mi):gi.error("unknown tag: "+vi)},Wn.prototype._getUse=function(vi,gi){var mi=this._baseState;return mi.useDecoder=this._use(vi,gi),Mn(mi.useDecoder._baseState.parent===null),mi.useDecoder=mi.useDecoder._baseState.children[0],mi.implicit!==mi.useDecoder._baseState.implicit&&(mi.useDecoder=mi.useDecoder.clone(),mi.useDecoder._baseState.implicit=mi.implicit),mi.useDecoder},Wn.prototype._decodeChoice=function(vi,gi){var mi=this._baseState,yi=null,bi=!1;return Object.keys(mi.choice).some(function(Ei){var _i=vi.save(),xi=mi.choice[Ei];try{var Ci=xi._decode(vi,gi);if(vi.isError(Ci))return!1;yi={type:Ei,value:Ci},bi=!0}catch{return vi.restore(_i),!1}return!0},this),bi?yi:vi.error("Choice not matched")},Wn.prototype._createEncoderBuffer=function(vi){return new In(vi,this.reporter)},Wn.prototype._encode=function(vi,gi,mi){var yi=this._baseState;if(!(yi.default!==null&&yi.default===vi)){var bi=this._encodeValue(vi,gi,mi);if(bi!==void 0&&!this._skipDefault(bi,gi,mi))return bi}},Wn.prototype._encodeValue=function(vi,gi,mi){var yi=this._baseState;if(yi.parent===null)return yi.children[0]._encode(vi,gi||new on);var xi=null;if(this.reporter=gi,yi.optional&&vi===void 0)if(yi.default!==null)vi=yi.default;else return;var bi=null,Ei=!1;if(yi.any)xi=this._createEncoderBuffer(vi);else if(yi.choice)xi=this._encodeChoice(vi,gi);else if(yi.contains)bi=this._getUse(yi.contains,mi)._encode(vi,gi),Ei=!0;else if(yi.children)bi=yi.children.map(function(Ii){if(Ii._baseState.tag==="null_")return Ii._encode(null,gi,vi);if(Ii._baseState.key===null)return gi.error("Child should have a key");var Ni=gi.enterKey(Ii._baseState.key);if(typeof vi!="object")return gi.error("Child expected, but input is not object");var Pi=Ii._encode(vi[Ii._baseState.key],gi,vi);return gi.leaveKey(Ni),Pi},this).filter(function(Ii){return Ii}),bi=this._createEncoderBuffer(bi);else if(yi.tag==="seqof"||yi.tag==="setof"){if(!(yi.args&&yi.args.length===1))return gi.error("Too many args for : "+yi.tag);if(!Array.isArray(vi))return gi.error("seqof/setof, but data is not Array");var _i=this.clone();_i._baseState.implicit=null,bi=this._createEncoderBuffer(vi.map(function(Ii){var Ni=this._baseState;return this._getUse(Ni.args[0],vi)._encode(Ii,gi)},_i))}else yi.use!==null?xi=this._getUse(yi.use,mi)._encode(vi,gi):(bi=this._encodePrimitive(yi.tag,vi),Ei=!0);var xi;if(!yi.any&&yi.choice===null){var Ci=yi.implicit!==null?yi.implicit:yi.tag,Ai=yi.implicit===null?"universal":"context";Ci===null?yi.use===null&&gi.error("Tag could be omitted only for .use()"):yi.use===null&&(xi=this._encodeComposite(Ci,Ei,Ai,bi))}return yi.explicit!==null&&(xi=this._encodeComposite(yi.explicit,!1,"context",xi)),xi},Wn.prototype._encodeChoice=function(vi,gi){var mi=this._baseState,yi=mi.choice[vi.type];return yi||Mn(!1,vi.type+" not found in "+JSON.stringify(Object.keys(mi.choice))),yi._encode(vi.value,gi)},Wn.prototype._encodePrimitive=function(vi,gi){var mi=this._baseState;if(/str$/.test(vi))return this._encodeStr(gi,vi);if(vi==="objid"&&mi.args)return this._encodeObjid(gi,mi.reverseArgs[0],mi.args[1]);if(vi==="objid")return this._encodeObjid(gi,null,null);if(vi==="gentime"||vi==="utctime")return this._encodeTime(gi,vi);if(vi==="null_")return this._encodeNull();if(vi==="int"||vi==="enum")return this._encodeInt(gi,mi.args&&mi.reverseArgs[0]);if(vi==="bool")return this._encodeBool(gi);if(vi==="objDesc")return this._encodeStr(gi,vi);throw new Error("Unsupported tag: "+vi)},Wn.prototype._isNumstr=function(vi){return/^[0-9 ]*$/.test(vi)},Wn.prototype._isPrintstr=function(vi){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(vi)},node}var hasRequiredBase;function requireBase(){return hasRequiredBase||(hasRequiredBase=1,function(on){var In=on;In.Reporter=requireReporter().Reporter,In.DecoderBuffer=requireBuffer().DecoderBuffer,In.EncoderBuffer=requireBuffer().EncoderBuffer,In.Node=requireNode()}(base$1)),base$1}var constants={},der={},hasRequiredDer$2;function requireDer$2(){return hasRequiredDer$2||(hasRequiredDer$2=1,function(on){var In=requireConstants();on.tagClass={0:"universal",1:"application",2:"context",3:"private"},on.tagClassByName=In._reverse(on.tagClass),on.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},on.tagByName=In._reverse(on.tag)}(der)),der}var hasRequiredConstants;function requireConstants(){return hasRequiredConstants||(hasRequiredConstants=1,function(on){var In=on;In._reverse=function(Mn){var Ln={};return Object.keys(Mn).forEach(function(Hn){(Hn|0)==Hn&&(Hn=Hn|0);var jn=Mn[Hn];Ln[jn]=Hn}),Ln},In.der=requireDer$2()}(constants)),constants}var decoders={},der_1$1,hasRequiredDer$1;function requireDer$1(){if(hasRequiredDer$1)return der_1$1;hasRequiredDer$1=1;var on=requireInherits_browser(),In=requireAsn1$1(),Rn=In.base,Mn=In.bignum,Ln=In.constants.der;function Hn(hi){this.enc="der",this.name=hi.name,this.entity=hi,this.tree=new jn,this.tree._init(hi.body)}der_1$1=Hn,Hn.prototype.decode=function(vi,gi){return vi instanceof Rn.DecoderBuffer||(vi=new Rn.DecoderBuffer(vi,gi)),this.tree._decode(vi,gi)};function jn(hi){Rn.Node.call(this,"der",hi)}on(jn,Rn.Node),jn.prototype._peekTag=function(vi,gi,mi){if(vi.isEmpty())return!1;var yi=vi.save(),bi=Wn(vi,'Failed to peek tag: "'+gi+'"');return vi.isError(bi)?bi:(vi.restore(yi),bi.tag===gi||bi.tagStr===gi||bi.tagStr+"of"===gi||mi)},jn.prototype._decodeTag=function(vi,gi,mi){var yi=Wn(vi,'Failed to decode tag of "'+gi+'"');if(vi.isError(yi))return yi;var bi=Yn(vi,yi.primitive,'Failed to get length of "'+gi+'"');if(vi.isError(bi))return bi;if(!mi&&yi.tag!==gi&&yi.tagStr!==gi&&yi.tagStr+"of"!==gi)return vi.error('Failed to match tag: "'+gi+'"');if(yi.primitive||bi!==null)return vi.skip(bi,'Failed to match body of: "'+gi+'"');var Ei=vi.save(),_i=this._skipUntilEnd(vi,'Failed to skip indefinite length body: "'+this.tag+'"');return vi.isError(_i)?_i:(bi=vi.offset-Ei.offset,vi.restore(Ei),vi.skip(bi,'Failed to match body of: "'+gi+'"'))},jn.prototype._skipUntilEnd=function(vi,gi){for(;;){var mi=Wn(vi,gi);if(vi.isError(mi))return mi;var yi=Yn(vi,mi.primitive,gi);if(vi.isError(yi))return yi;var bi;if(mi.primitive||yi!==null?bi=vi.skip(yi):bi=this._skipUntilEnd(vi,gi),vi.isError(bi))return bi;if(mi.tagStr==="end")break}},jn.prototype._decodeList=function(vi,gi,mi,yi){for(var bi=[];!vi.isEmpty();){var Ei=this._peekTag(vi,"end");if(vi.isError(Ei))return Ei;var _i=mi.decode(vi,"der",yi);if(vi.isError(_i)&&Ei)break;bi.push(_i)}return bi},jn.prototype._decodeStr=function(vi,gi){if(gi==="bitstr"){var mi=vi.readUInt8();return vi.isError(mi)?mi:{unused:mi,data:vi.raw()}}else if(gi==="bmpstr"){var yi=vi.raw();if(yi.length%2===1)return vi.error("Decoding of string type: bmpstr length mismatch");for(var bi="",Ei=0;Ei<yi.length/2;Ei++)bi+=String.fromCharCode(yi.readUInt16BE(Ei*2));return bi}else if(gi==="numstr"){var _i=vi.raw().toString("ascii");return this._isNumstr(_i)?_i:vi.error("Decoding of string type: numstr unsupported characters")}else{if(gi==="octstr")return vi.raw();if(gi==="objDesc")return vi.raw();if(gi==="printstr"){var xi=vi.raw().toString("ascii");return this._isPrintstr(xi)?xi:vi.error("Decoding of string type: printstr unsupported characters")}else return/str$/.test(gi)?vi.raw().toString():vi.error("Decoding of string type: "+gi+" unsupported")}},jn.prototype._decodeObjid=function(vi,gi,mi){for(var yi,bi=[],Ei=0;!vi.isEmpty();){var _i=vi.readUInt8();Ei<<=7,Ei|=_i&127,(_i&128)===0&&(bi.push(Ei),Ei=0)}_i&128&&bi.push(Ei);var xi=bi[0]/40|0,Ci=bi[0]%40;if(mi?yi=bi:yi=[xi,Ci].concat(bi.slice(1)),gi){var Ai=gi[yi.join(" ")];Ai===void 0&&(Ai=gi[yi.join(".")]),Ai!==void 0&&(yi=Ai)}return yi},jn.prototype._decodeTime=function(vi,gi){var mi=vi.raw().toString();if(gi==="gentime")var yi=mi.slice(0,4)|0,bi=mi.slice(4,6)|0,Ei=mi.slice(6,8)|0,_i=mi.slice(8,10)|0,xi=mi.slice(10,12)|0,Ci=mi.slice(12,14)|0;else if(gi==="utctime"){var yi=mi.slice(0,2)|0,bi=mi.slice(2,4)|0,Ei=mi.slice(4,6)|0,_i=mi.slice(6,8)|0,xi=mi.slice(8,10)|0,Ci=mi.slice(10,12)|0;yi<70?yi=2e3+yi:yi=1900+yi}else return vi.error("Decoding "+gi+" time is not supported yet");return Date.UTC(yi,bi-1,Ei,_i,xi,Ci,0)},jn.prototype._decodeNull=function(vi){return null},jn.prototype._decodeBool=function(vi){var gi=vi.readUInt8();return vi.isError(gi)?gi:gi!==0},jn.prototype._decodeInt=function(vi,gi){var mi=vi.raw(),yi=new Mn(mi);return gi&&(yi=gi[yi.toString(10)]||yi),yi},jn.prototype._use=function(vi,gi){return typeof vi=="function"&&(vi=vi(gi)),vi._getDecoder("der").tree};function Wn(hi,vi){var gi=hi.readUInt8(vi);if(hi.isError(gi))return gi;var mi=Ln.tagClass[gi>>6],yi=(gi&32)===0;if((gi&31)===31){var bi=gi;for(gi=0;(bi&128)===128;){if(bi=hi.readUInt8(vi),hi.isError(bi))return bi;gi<<=7,gi|=bi&127}}else gi&=31;var Ei=Ln.tag[gi];return{cls:mi,primitive:yi,tag:gi,tagStr:Ei}}function Yn(hi,vi,gi){var mi=hi.readUInt8(gi);if(hi.isError(mi))return mi;if(!vi&&mi===128)return null;if((mi&128)===0)return mi;var yi=mi&127;if(yi>4)return hi.error("length octect is too long");mi=0;for(var bi=0;bi<yi;bi++){mi<<=8;var Ei=hi.readUInt8(gi);if(hi.isError(Ei))return Ei;mi|=Ei}return mi}return der_1$1}var pem$1,hasRequiredPem$1;function requirePem$1(){if(hasRequiredPem$1)return pem$1;hasRequiredPem$1=1;var on=requireInherits_browser(),In=requireDist().Buffer,Rn=requireDer$1();function Mn(Ln){Rn.call(this,Ln),this.enc="pem"}return on(Mn,Rn),pem$1=Mn,Mn.prototype.decode=function(Hn,jn){for(var Wn=Hn.toString().split(/[\r\n]+/g),Yn=jn.label.toUpperCase(),hi=/^-----(BEGIN|END) ([^-]+)-----$/,vi=-1,gi=-1,mi=0;mi<Wn.length;mi++){var yi=Wn[mi].match(hi);if(yi!==null&&yi[2]===Yn)if(vi===-1){if(yi[1]!=="BEGIN")break;vi=mi}else{if(yi[1]!=="END")break;gi=mi;break}}if(vi===-1||gi===-1)throw new Error("PEM section not found for: "+Yn);var bi=Wn.slice(vi+1,gi).join("");bi.replace(/[^a-z0-9\+\/=]+/gi,"");var Ei=new In(bi,"base64");return Rn.prototype.decode.call(this,Ei,jn)},pem$1}var hasRequiredDecoders;function requireDecoders(){return hasRequiredDecoders||(hasRequiredDecoders=1,function(on){var In=on;In.der=requireDer$1(),In.pem=requirePem$1()}(decoders)),decoders}var encoders={},der_1,hasRequiredDer;function requireDer(){if(hasRequiredDer)return der_1;hasRequiredDer=1;var on=requireInherits_browser(),In=requireDist().Buffer,Rn=requireAsn1$1(),Mn=Rn.base,Ln=Rn.constants.der;function Hn(hi){this.enc="der",this.name=hi.name,this.entity=hi,this.tree=new jn,this.tree._init(hi.body)}der_1=Hn,Hn.prototype.encode=function(vi,gi){return this.tree._encode(vi,gi).join()};function jn(hi){Mn.Node.call(this,"der",hi)}on(jn,Mn.Node),jn.prototype._encodeComposite=function(vi,gi,mi,yi){var bi=Yn(vi,gi,mi,this.reporter);if(yi.length<128){var xi=new In(2);return xi[0]=bi,xi[1]=yi.length,this._createEncoderBuffer([xi,yi])}for(var Ei=1,_i=yi.length;_i>=256;_i>>=8)Ei++;var xi=new In(2+Ei);xi[0]=bi,xi[1]=128|Ei;for(var _i=1+Ei,Ci=yi.length;Ci>0;_i--,Ci>>=8)xi[_i]=Ci&255;return this._createEncoderBuffer([xi,yi])},jn.prototype._encodeStr=function(vi,gi){if(gi==="bitstr")return this._createEncoderBuffer([vi.unused|0,vi.data]);if(gi==="bmpstr"){for(var mi=new In(vi.length*2),yi=0;yi<vi.length;yi++)mi.writeUInt16BE(vi.charCodeAt(yi),yi*2);return this._createEncoderBuffer(mi)}else return gi==="numstr"?this._isNumstr(vi)?this._createEncoderBuffer(vi):this.reporter.error("Encoding of string type: numstr supports only digits and space"):gi==="printstr"?this._isPrintstr(vi)?this._createEncoderBuffer(vi):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(gi)?this._createEncoderBuffer(vi):gi==="objDesc"?this._createEncoderBuffer(vi):this.reporter.error("Encoding of string type: "+gi+" unsupported")},jn.prototype._encodeObjid=function(vi,gi,mi){if(typeof vi=="string"){if(!gi)return this.reporter.error("string objid given, but no values map found");if(!gi.hasOwnProperty(vi))return this.reporter.error("objid not found in values map");vi=gi[vi].split(/[\s\.]+/g);for(var yi=0;yi<vi.length;yi++)vi[yi]|=0}else if(Array.isArray(vi)){vi=vi.slice();for(var yi=0;yi<vi.length;yi++)vi[yi]|=0}if(!Array.isArray(vi))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(vi));if(!mi){if(vi[1]>=40)return this.reporter.error("Second objid identifier OOB");vi.splice(0,2,vi[0]*40+vi[1])}for(var bi=0,yi=0;yi<vi.length;yi++){var Ei=vi[yi];for(bi++;Ei>=128;Ei>>=7)bi++}for(var _i=new In(bi),xi=_i.length-1,yi=vi.length-1;yi>=0;yi--){var Ei=vi[yi];for(_i[xi--]=Ei&127;(Ei>>=7)>0;)_i[xi--]=128|Ei&127}return this._createEncoderBuffer(_i)};function Wn(hi){return hi<10?"0"+hi:hi}jn.prototype._encodeTime=function(vi,gi){var mi,yi=new Date(vi);return gi==="gentime"?mi=[Wn(yi.getFullYear()),Wn(yi.getUTCMonth()+1),Wn(yi.getUTCDate()),Wn(yi.getUTCHours()),Wn(yi.getUTCMinutes()),Wn(yi.getUTCSeconds()),"Z"].join(""):gi==="utctime"?mi=[Wn(yi.getFullYear()%100),Wn(yi.getUTCMonth()+1),Wn(yi.getUTCDate()),Wn(yi.getUTCHours()),Wn(yi.getUTCMinutes()),Wn(yi.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+gi+" time is not supported yet"),this._encodeStr(mi,"octstr")},jn.prototype._encodeNull=function(){return this._createEncoderBuffer("")},jn.prototype._encodeInt=function(vi,gi){if(typeof vi=="string"){if(!gi)return this.reporter.error("String int or enum given, but no values map");if(!gi.hasOwnProperty(vi))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(vi));vi=gi[vi]}if(typeof vi!="number"&&!In.isBuffer(vi)){var mi=vi.toArray();!vi.sign&&mi[0]&128&&mi.unshift(0),vi=new In(mi)}if(In.isBuffer(vi)){var yi=vi.length;vi.length===0&&yi++;var Ei=new In(yi);return vi.copy(Ei),vi.length===0&&(Ei[0]=0),this._createEncoderBuffer(Ei)}if(vi<128)return this._createEncoderBuffer(vi);if(vi<256)return this._createEncoderBuffer([0,vi]);for(var yi=1,bi=vi;bi>=256;bi>>=8)yi++;for(var Ei=new Array(yi),bi=Ei.length-1;bi>=0;bi--)Ei[bi]=vi&255,vi>>=8;return Ei[0]&128&&Ei.unshift(0),this._createEncoderBuffer(new In(Ei))},jn.prototype._encodeBool=function(vi){return this._createEncoderBuffer(vi?255:0)},jn.prototype._use=function(vi,gi){return typeof vi=="function"&&(vi=vi(gi)),vi._getEncoder("der").tree},jn.prototype._skipDefault=function(vi,gi,mi){var yi=this._baseState,bi;if(yi.default===null)return!1;var Ei=vi.join();if(yi.defaultBuffer===void 0&&(yi.defaultBuffer=this._encodeValue(yi.default,gi,mi).join()),Ei.length!==yi.defaultBuffer.length)return!1;for(bi=0;bi<Ei.length;bi++)if(Ei[bi]!==yi.defaultBuffer[bi])return!1;return!0};function Yn(hi,vi,gi,mi){var yi;if(hi==="seqof"?hi="seq":hi==="setof"&&(hi="set"),Ln.tagByName.hasOwnProperty(hi))yi=Ln.tagByName[hi];else if(typeof hi=="number"&&(hi|0)===hi)yi=hi;else return mi.error("Unknown tag: "+hi);return yi>=31?mi.error("Multi-octet tag encoding unsupported"):(vi||(yi|=32),yi|=Ln.tagClassByName[gi||"universal"]<<6,yi)}return der_1}var pem,hasRequiredPem;function requirePem(){if(hasRequiredPem)return pem;hasRequiredPem=1;var on=requireInherits_browser(),In=requireDer();function Rn(Mn){In.call(this,Mn),this.enc="pem"}return on(Rn,In),pem=Rn,Rn.prototype.encode=function(Ln,Hn){for(var jn=In.prototype.encode.call(this,Ln),Wn=jn.toString("base64"),Yn=["-----BEGIN "+Hn.label+"-----"],hi=0;hi<Wn.length;hi+=64)Yn.push(Wn.slice(hi,hi+64));return Yn.push("-----END "+Hn.label+"-----"),Yn.join(`
|
|
@@ -4489,7 +4489,7 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
4489
4489
|
display: flex;
|
|
4490
4490
|
flex-direction: row;
|
|
4491
4491
|
justify-content: flex-end;
|
|
4492
|
-
`;function r$1(on){var In,Rn,Mn="";if(typeof on=="string"||typeof on=="number")Mn+=on;else if(typeof on=="object")if(Array.isArray(on))for(In=0;In<on.length;In++)on[In]&&(Rn=r$1(on[In]))&&(Mn&&(Mn+=" "),Mn+=Rn);else for(In in on)on[In]&&(Mn&&(Mn+=" "),Mn+=In);return Mn}function clsx(){for(var on,In,Rn=0,Mn="";Rn<arguments.length;)(on=arguments[Rn++])&&(In=r$1(on))&&(Mn&&(Mn+=" "),Mn+=In);return Mn}function _extends(){return _extends=Object.assign||function(on){for(var In=1;In<arguments.length;In++){var Rn=arguments[In];for(var Mn in Rn)Object.prototype.hasOwnProperty.call(Rn,Mn)&&(on[Mn]=Rn[Mn])}return on},_extends.apply(this,arguments)}function _objectWithoutPropertiesLoose(on,In){if(on==null)return{};var Rn={},Mn=Object.keys(on),Ln,Hn;for(Hn=0;Hn<Mn.length;Hn++)Ln=Mn[Hn],!(In.indexOf(Ln)>=0)&&(Rn[Ln]=on[Ln]);return Rn}function isNum(on){return typeof on=="number"&&!isNaN(on)}function isBool(on){return typeof on=="boolean"}function isStr(on){return typeof on=="string"}function isFn(on){return typeof on=="function"}function parseClassName(on){return isStr(on)||isFn(on)?on:null}function isToastIdValid(on){return on===0||on}function getAutoCloseDelay(on,In){return on===!1||isNum(on)&&on>0?on:In}var canUseDom=!!(typeof window<"u"&&window.document&&window.document.createElement);function canBeRendered(on){return reactExports.isValidElement(on)||isStr(on)||isFn(on)||isNum(on)}var POSITION={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"};function collapseToast(on,In,Rn){Rn===void 0&&(Rn=300);var Mn=on.scrollHeight,Ln=on.style;requestAnimationFrame(function(){Ln.minHeight="initial",Ln.height=Mn+"px",Ln.transition="all "+Rn+"ms",requestAnimationFrame(function(){Ln.height="0",Ln.padding="0",Ln.margin="0",setTimeout(In,Rn)})})}function cssTransition(on){var In=on.enter,Rn=on.exit,Mn=on.appendPosition,Ln=Mn===void 0?!1:Mn,Hn=on.collapse,jn=Hn===void 0?!0:Hn,Wn=on.collapseDuration,Yn=Wn===void 0?300:Wn;return function(vi){var gi=vi.children,mi=vi.position,yi=vi.preventExitTransition,bi=vi.done,Ei=vi.nodeRef,_i=vi.isIn,xi=Ln?In+"--"+mi:In,Ci=Ln?Rn+"--"+mi:Rn,Ai=reactExports.useRef(),Ii=reactExports.useRef(0);reactExports.useLayoutEffect(function(){Ni()},[]),reactExports.useEffect(function(){_i||(yi?Ui():Vi())},[_i]);function Ni(){var Gi=Ei.current;Ai.current=Gi.className,Gi.className+=" "+xi,Gi.addEventListener("animationend",Pi),Gi.addEventListener("animationcancel",Pi)}function Pi(Gi){if(Gi.target===Ei.current){var Yi=Ei.current;Yi.dispatchEvent(new Event("d")),Yi.removeEventListener("animationend",Pi),Yi.removeEventListener("animationcancel",Pi),Ii.current===0&&(Yi.className=Ai.current)}}function Vi(){Ii.current=1;var Gi=Ei.current;Gi.className+=" "+Ci,Gi.addEventListener("animationend",Ui)}function Ui(){var Gi=Ei.current;Gi.removeEventListener("animationend",Ui),jn?collapseToast(Gi,bi,Yn):bi()}return React.createElement(React.Fragment,null,gi)}}var eventManager={list:new Map,emitQueue:new Map,on:function on(In,Rn){return this.list.has(In)||this.list.set(In,[]),this.list.get(In).push(Rn),this},off:function on(In,Rn){if(Rn){var Mn=this.list.get(In).filter(function(Ln){return Ln!==Rn});return this.list.set(In,Mn),this}return this.list.delete(In),this},cancelEmit:function on(In){var Rn=this.emitQueue.get(In);return Rn&&(Rn.forEach(clearTimeout),this.emitQueue.delete(In)),this},emit:function on(In){for(var Rn=this,Mn=arguments.length,Ln=new Array(Mn>1?Mn-1:0),Hn=1;Hn<Mn;Hn++)Ln[Hn-1]=arguments[Hn];this.list.has(In)&&this.list.get(In).forEach(function(jn){var Wn=setTimeout(function(){jn.apply(void 0,Ln)},0);Rn.emitQueue.has(In)||Rn.emitQueue.set(In,[]),Rn.emitQueue.get(In).push(Wn)})}},_excluded=["delay","staleId"];function useToastContainer(on){var In=reactExports.useReducer(function(xi){return xi+1},0),Rn=In[1],Mn=reactExports.useState([]),Ln=Mn[0],Hn=Mn[1],jn=reactExports.useRef(null),Wn=reactExports.useRef(new Map).current,Yn=function(Ci){return Ln.indexOf(Ci)!==-1},hi=reactExports.useRef({toastKey:1,displayedToast:0,count:0,queue:[],props:on,containerId:null,isToastActive:Yn,getToast:function(Ci){return Wn.get(Ci)}}).current;reactExports.useEffect(function(){return hi.containerId=on.containerId,eventManager.cancelEmit(3).on(0,bi).on(1,function(xi){return jn.current&&gi(xi)}).on(5,vi).emit(2,hi),function(){return eventManager.emit(3,hi)}},[]),reactExports.useEffect(function(){hi.isToastActive=Yn,hi.displayedToast=Ln.length,eventManager.emit(4,Ln.length,on.containerId)},[Ln]),reactExports.useEffect(function(){hi.props=on});function vi(xi){var Ci=xi.containerId,Ai=hi.props.limit;Ai&&(!Ci||hi.containerId===Ci)&&(hi.count-=hi.queue.length,hi.queue=[])}function gi(xi){Hn(function(Ci){return isToastIdValid(xi)?Ci.filter(function(Ai){return Ai!==xi}):[]})}function mi(){var xi=hi.queue.shift(),Ci=xi.toastContent,Ai=xi.toastProps,Ii=xi.staleId;Ei(Ci,Ai,Ii)}function yi(xi){return!jn.current||hi.props.enableMultiContainer&&xi.containerId!==hi.props.containerId||Wn.has(xi.toastId)&&xi.updateId==null}function bi(xi,Ci){var Ai=Ci.delay,Ii=Ci.staleId,Ni=_objectWithoutPropertiesLoose(Ci,_excluded);if(!(!canBeRendered(xi)||yi(Ni))){var Pi=Ni.toastId,Vi=Ni.updateId,Ui=Ni.data,Gi=hi.props,Yi=function(){return gi(Pi)},zi=Vi==null;zi&&hi.count++;var Mi={toastId:Pi,updateId:Vi,isLoading:Ni.isLoading,theme:Ni.theme||Gi.theme,icon:Ni.icon!=null?Ni.icon:Gi.icon,isIn:!1,key:Ni.key||hi.toastKey++,type:Ni.type,closeToast:Yi,closeButton:Ni.closeButton,rtl:Gi.rtl,position:Ni.position||Gi.position,transition:Ni.transition||Gi.transition,className:parseClassName(Ni.className||Gi.toastClassName),bodyClassName:parseClassName(Ni.bodyClassName||Gi.bodyClassName),style:Ni.style||Gi.toastStyle,bodyStyle:Ni.bodyStyle||Gi.bodyStyle,onClick:Ni.onClick||Gi.onClick,pauseOnHover:isBool(Ni.pauseOnHover)?Ni.pauseOnHover:Gi.pauseOnHover,pauseOnFocusLoss:isBool(Ni.pauseOnFocusLoss)?Ni.pauseOnFocusLoss:Gi.pauseOnFocusLoss,draggable:isBool(Ni.draggable)?Ni.draggable:Gi.draggable,draggablePercent:Ni.draggablePercent||Gi.draggablePercent,draggableDirection:Ni.draggableDirection||Gi.draggableDirection,closeOnClick:isBool(Ni.closeOnClick)?Ni.closeOnClick:Gi.closeOnClick,progressClassName:parseClassName(Ni.progressClassName||Gi.progressClassName),progressStyle:Ni.progressStyle||Gi.progressStyle,autoClose:Ni.isLoading?!1:getAutoCloseDelay(Ni.autoClose,Gi.autoClose),hideProgressBar:isBool(Ni.hideProgressBar)?Ni.hideProgressBar:Gi.hideProgressBar,progress:Ni.progress,role:Ni.role||Gi.role,deleteToast:function(){Wn.delete(Pi);var Ri=hi.queue.length;if(hi.count=isToastIdValid(Pi)?hi.count-1:hi.count-hi.displayedToast,hi.count<0&&(hi.count=0),Ri>0){var ki=isToastIdValid(Pi)?1:hi.props.limit;if(Ri===1||ki===1)hi.displayedToast++,mi();else{var Bi=ki>Ri?Ri:ki;hi.displayedToast=Bi;for(var Hi=0;Hi<Bi;Hi++)mi()}}else Rn()}};isFn(Ni.onOpen)&&(Mi.onOpen=Ni.onOpen),isFn(Ni.onClose)&&(Mi.onClose=Ni.onClose),Mi.closeButton=Gi.closeButton,Ni.closeButton===!1||canBeRendered(Ni.closeButton)?Mi.closeButton=Ni.closeButton:Ni.closeButton===!0&&(Mi.closeButton=canBeRendered(Gi.closeButton)?Gi.closeButton:!0);var Li=xi;reactExports.isValidElement(xi)&&!isStr(xi.type)?Li=reactExports.cloneElement(xi,{closeToast:Yi,toastProps:Mi,data:Ui}):isFn(xi)&&(Li=xi({closeToast:Yi,toastProps:Mi,data:Ui})),Gi.limit&&Gi.limit>0&&hi.count>Gi.limit&&zi?hi.queue.push({toastContent:Li,toastProps:Mi,staleId:Ii}):isNum(Ai)&&Ai>0?setTimeout(function(){Ei(Li,Mi,Ii)},Ai):Ei(Li,Mi,Ii)}}function Ei(xi,Ci,Ai){var Ii=Ci.toastId;Ai&&Wn.delete(Ai),Wn.set(Ii,{content:xi,props:Ci}),Hn(function(Ni){return[].concat(Ni,[Ii]).filter(function(Pi){return Pi!==Ai})})}function _i(xi){var Ci=new Map,Ai=Array.from(Wn.values());return on.newestOnTop&&Ai.reverse(),Ai.forEach(function(Ii){var Ni=Ii.props.position;Ci.has(Ni)||Ci.set(Ni,[]),Ci.get(Ni).push(Ii)}),Array.from(Ci,function(Ii){return xi(Ii[0],Ii[1])})}return{getToastToRender:_i,containerRef:jn,isToastActive:Yn}}function getX(on){return on.targetTouches&&on.targetTouches.length>=1?on.targetTouches[0].clientX:on.clientX}function getY(on){return on.targetTouches&&on.targetTouches.length>=1?on.targetTouches[0].clientY:on.clientY}function useToast(on){var In=reactExports.useState(!1),Rn=In[0],Mn=In[1],Ln=reactExports.useState(!1),Hn=Ln[0],jn=Ln[1],Wn=reactExports.useRef(null),Yn=reactExports.useRef({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,hi=reactExports.useRef(on),vi=on.autoClose,gi=on.pauseOnHover,mi=on.closeToast,yi=on.onClick,bi=on.closeOnClick;reactExports.useEffect(function(){hi.current=on}),reactExports.useEffect(function(){return Wn.current&&Wn.current.addEventListener("d",xi,{once:!0}),isFn(on.onOpen)&&on.onOpen(reactExports.isValidElement(on.children)&&on.children.props),function(){var Yi=hi.current;isFn(Yi.onClose)&&Yi.onClose(reactExports.isValidElement(Yi.children)&&Yi.children.props)}},[]),reactExports.useEffect(function(){return on.pauseOnFocusLoss&&Ai(),function(){on.pauseOnFocusLoss&&Ii()}},[on.pauseOnFocusLoss]);function Ei(Yi){if(on.draggable){Ni();var zi=Wn.current;Yn.canCloseOnClick=!0,Yn.canDrag=!0,Yn.boundingRect=zi.getBoundingClientRect(),zi.style.transition="",Yn.x=getX(Yi.nativeEvent),Yn.y=getY(Yi.nativeEvent),on.draggableDirection==="x"?(Yn.start=Yn.x,Yn.removalDistance=zi.offsetWidth*(on.draggablePercent/100)):(Yn.start=Yn.y,Yn.removalDistance=zi.offsetHeight*(on.draggablePercent===80?on.draggablePercent*1.5:on.draggablePercent/100))}}function _i(){if(Yn.boundingRect){var Yi=Yn.boundingRect,zi=Yi.top,Mi=Yi.bottom,Li=Yi.left,wi=Yi.right;on.pauseOnHover&&Yn.x>=Li&&Yn.x<=wi&&Yn.y>=zi&&Yn.y<=Mi?Ci():xi()}}function xi(){Mn(!0)}function Ci(){Mn(!1)}function Ai(){document.hasFocus()||Ci(),window.addEventListener("focus",xi),window.addEventListener("blur",Ci)}function Ii(){window.removeEventListener("focus",xi),window.removeEventListener("blur",Ci)}function Ni(){Yn.didMove=!1,document.addEventListener("mousemove",Vi),document.addEventListener("mouseup",Ui),document.addEventListener("touchmove",Vi),document.addEventListener("touchend",Ui)}function Pi(){document.removeEventListener("mousemove",Vi),document.removeEventListener("mouseup",Ui),document.removeEventListener("touchmove",Vi),document.removeEventListener("touchend",Ui)}function Vi(Yi){var zi=Wn.current;Yn.canDrag&&zi&&(Yn.didMove=!0,Rn&&Ci(),Yn.x=getX(Yi),Yn.y=getY(Yi),on.draggableDirection==="x"?Yn.delta=Yn.x-Yn.start:Yn.delta=Yn.y-Yn.start,Yn.start!==Yn.x&&(Yn.canCloseOnClick=!1),zi.style.transform="translate"+on.draggableDirection+"("+Yn.delta+"px)",zi.style.opacity=""+(1-Math.abs(Yn.delta/Yn.removalDistance)))}function Ui(){Pi();var Yi=Wn.current;if(Yn.canDrag&&Yn.didMove&&Yi){if(Yn.canDrag=!1,Math.abs(Yn.delta)>Yn.removalDistance){jn(!0),on.closeToast();return}Yi.style.transition="transform 0.2s, opacity 0.2s",Yi.style.transform="translate"+on.draggableDirection+"(0)",Yi.style.opacity="1"}}var Gi={onMouseDown:Ei,onTouchStart:Ei,onMouseUp:_i,onTouchEnd:_i};return vi&&gi&&(Gi.onMouseEnter=Ci,Gi.onMouseLeave=xi),bi&&(Gi.onClick=function(Yi){yi&&yi(Yi),Yn.canCloseOnClick&&mi()}),{playToast:xi,pauseToast:Ci,isRunning:Rn,preventExitTransition:Hn,toastRef:Wn,eventHandlers:Gi}}function CloseButton(on){var In=on.closeToast,Rn=on.theme,Mn=on.ariaLabel,Ln=Mn===void 0?"close":Mn;return reactExports.createElement("button",{className:"Toastify__close-button Toastify__close-button--"+Rn,type:"button",onClick:function(jn){jn.stopPropagation(),In(jn)},"aria-label":Ln},reactExports.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},reactExports.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function ProgressBar(on){var In,Rn,Mn=on.delay,Ln=on.isRunning,Hn=on.closeToast,jn=on.type,Wn=on.hide,Yn=on.className,hi=on.style,vi=on.controlledProgress,gi=on.progress,mi=on.rtl,yi=on.isIn,bi=on.theme,Ei=_extends({},hi,{animationDuration:Mn+"ms",animationPlayState:Ln?"running":"paused",opacity:Wn?0:1});vi&&(Ei.transform="scaleX("+gi+")");var _i=clsx("Toastify__progress-bar",vi?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated","Toastify__progress-bar-theme--"+bi,"Toastify__progress-bar--"+jn,(In={},In["Toastify__progress-bar--rtl"]=mi,In)),xi=isFn(Yn)?Yn({rtl:mi,type:jn,defaultClassName:_i}):clsx(_i,Yn),Ci=(Rn={},Rn[vi&&gi>=1?"onTransitionEnd":"onAnimationEnd"]=vi&&gi<1?null:function(){yi&&Hn()},Rn);return reactExports.createElement("div",Object.assign({role:"progressbar","aria-hidden":Wn?"true":"false","aria-label":"notification timer",className:xi,style:Ei},Ci))}ProgressBar.defaultProps={type:TYPE.DEFAULT,hide:!1};var _excluded$1=["theme","type"],Svg=function on(In){var Rn=In.theme,Mn=In.type,Ln=_objectWithoutPropertiesLoose(In,_excluded$1);return reactExports.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"100%",height:"100%",fill:Rn==="colored"?"currentColor":"var(--toastify-icon-color-"+Mn+")"},Ln))};function Warning(on){return reactExports.createElement(Svg,Object.assign({},on),reactExports.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))}function Info(on){return reactExports.createElement(Svg,Object.assign({},on),reactExports.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))}function Success(on){return reactExports.createElement(Svg,Object.assign({},on),reactExports.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))}function Error$1(on){return reactExports.createElement(Svg,Object.assign({},on),reactExports.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))}function Spinner$2(){return reactExports.createElement("div",{className:"Toastify__spinner"})}var Icons={info:Info,warning:Warning,success:Success,error:Error$1,spinner:Spinner$2},Toast=function on(In){var Rn,Mn,Ln=useToast(In),Hn=Ln.isRunning,jn=Ln.preventExitTransition,Wn=Ln.toastRef,Yn=Ln.eventHandlers,hi=In.closeButton,vi=In.children,gi=In.autoClose,mi=In.onClick,yi=In.type,bi=In.hideProgressBar,Ei=In.closeToast,_i=In.transition,xi=In.position,Ci=In.className,Ai=In.style,Ii=In.bodyClassName,Ni=In.bodyStyle,Pi=In.progressClassName,Vi=In.progressStyle,Ui=In.updateId,Gi=In.role,Yi=In.progress,zi=In.rtl,Mi=In.toastId,Li=In.deleteToast,wi=In.isIn,Ri=In.isLoading,ki=In.icon,Bi=In.theme,Hi=clsx("Toastify__toast","Toastify__toast-theme--"+Bi,"Toastify__toast--"+yi,(Rn={},Rn["Toastify__toast--rtl"]=zi,Rn)),Ki=isFn(Ci)?Ci({rtl:zi,position:xi,type:yi,defaultClassName:Hi}):clsx(Hi,Ci),ji=!!Yi,Fi=Icons[yi],$i={theme:Bi,type:yi},Wi=Fi&&Fi($i);ki===!1?Wi=void 0:isFn(ki)?Wi=ki($i):reactExports.isValidElement(ki)?Wi=reactExports.cloneElement(ki,$i):isStr(ki)?Wi=ki:Ri&&(Wi=Icons.spinner());function Qi(ea){if(ea){var na={closeToast:Ei,type:yi,theme:Bi};if(isFn(ea))return ea(na);if(reactExports.isValidElement(ea))return reactExports.cloneElement(ea,na)}}return reactExports.createElement(_i,{isIn:wi,done:Li,position:xi,preventExitTransition:jn,nodeRef:Wn},reactExports.createElement("div",Object.assign({id:Mi,onClick:mi,className:Ki},Yn,{style:Ai,ref:Wn}),reactExports.createElement("div",Object.assign({},wi&&{role:Gi},{className:isFn(Ii)?Ii({type:yi}):clsx("Toastify__toast-body",Ii),style:Ni}),Wi&&reactExports.createElement("div",{className:clsx("Toastify__toast-icon",(Mn={},Mn["Toastify--animate-icon Toastify__zoom-enter"]=!Ri,Mn))},Wi),reactExports.createElement("div",null,vi)),Qi(hi),(gi||ji)&&reactExports.createElement(ProgressBar,Object.assign({},Ui&&!ji?{key:"pb-"+Ui}:{},{rtl:zi,theme:Bi,delay:gi,isRunning:Hn,isIn:wi,closeToast:Ei,hide:bi,type:yi,style:Vi,className:Pi,controlledProgress:ji,progress:Yi}))))},Bounce=cssTransition({enter:"Toastify--animate Toastify__bounce-enter",exit:"Toastify--animate Toastify__bounce-exit",appendPosition:!0}),ToastContainer=function on(In){var Rn=useToastContainer(In),Mn=Rn.getToastToRender,Ln=Rn.containerRef,Hn=Rn.isToastActive,jn=In.className,Wn=In.style,Yn=In.rtl,hi=In.containerId;function vi(gi){var mi,yi=clsx("Toastify__toast-container","Toastify__toast-container--"+gi,(mi={},mi["Toastify__toast-container--rtl"]=Yn,mi));return isFn(jn)?jn({position:gi,rtl:Yn,defaultClassName:yi}):clsx(yi,parseClassName(jn))}return reactExports.createElement("div",{ref:Ln,className:"Toastify",id:hi},Mn(function(gi,mi){var yi=mi.length?_extends({},Wn):_extends({},Wn,{pointerEvents:"none"});return reactExports.createElement("div",{className:vi(gi),style:yi,key:"container-"+gi},mi.map(function(bi){var Ei=bi.content,_i=bi.props;return reactExports.createElement(Toast,Object.assign({},_i,{isIn:Hn(_i.toastId),key:"toast-"+_i.key,closeButton:_i.closeButton===!0?CloseButton:_i.closeButton}),Ei)}))}))};ToastContainer.defaultProps={position:POSITION.TOP_RIGHT,transition:Bounce,rtl:!1,autoClose:5e3,hideProgressBar:!1,closeButton:CloseButton,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,newestOnTop:!1,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};var containers=new Map,latestInstance,containerDomNode,containerConfig,queue=[],lazy=!1;function getToast(on,In){var Rn=In.containerId,Mn=containers.get(Rn||latestInstance);return Mn?Mn.getToast(on):null}function generateToastId(){return Math.random().toString(36).substring(2,9)}function getToastId(on){return on&&(isStr(on.toastId)||isNum(on.toastId))?on.toastId:generateToastId()}function dispatchToast(on,In){return containers.size>0?eventManager.emit(0,on,In):(queue.push({content:on,options:In}),lazy&&canUseDom&&(lazy=!1,containerDomNode=document.createElement("div"),document.body.appendChild(containerDomNode),reactDomExports.render(reactExports.createElement(ToastContainer,Object.assign({},containerConfig)),containerDomNode))),In.toastId}function mergeOptions(on,In){return _extends({},In,{type:In&&In.type||on,toastId:getToastId(In)})}function createToastByType(on){return function(In,Rn){return dispatchToast(In,mergeOptions(on,Rn))}}function toast(on,In){return dispatchToast(on,mergeOptions(TYPE.DEFAULT,In))}toast.loading=function(on,In){return dispatchToast(on,mergeOptions(TYPE.DEFAULT,_extends({isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1},In)))};function handlePromise(on,In,Rn){var Mn=In.pending,Ln=In.error,Hn=In.success,jn;Mn&&(jn=isStr(Mn)?toast.loading(Mn,Rn):toast.loading(Mn.render,_extends({},Rn,Mn)));var Wn={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},Yn=function(gi,mi,yi){if(mi==null){toast.dismiss(jn);return}var bi=_extends({type:gi},Wn,Rn,{data:yi}),Ei=isStr(mi)?{render:mi}:mi;return jn?toast.update(jn,_extends({},bi,Ei)):toast(Ei.render,_extends({},bi,Ei)),yi},hi=isFn(on)?on():on;return hi.then(function(vi){return Yn("success",Hn,vi)}).catch(function(vi){return Yn("error",Ln,vi)}),hi}toast.promise=handlePromise;toast.success=createToastByType(TYPE.SUCCESS);toast.info=createToastByType(TYPE.INFO);toast.error=createToastByType(TYPE.ERROR);toast.warning=createToastByType(TYPE.WARNING);toast.warn=toast.warning;toast.dark=function(on,In){return dispatchToast(on,mergeOptions(TYPE.DEFAULT,_extends({theme:"dark"},In)))};toast.dismiss=function(on){return eventManager.emit(1,on)};toast.clearWaitingQueue=function(on){return on===void 0&&(on={}),eventManager.emit(5,on)};toast.isActive=function(on){var In=!1;return containers.forEach(function(Rn){Rn.isToastActive&&Rn.isToastActive(on)&&(In=!0)}),In};toast.update=function(on,In){In===void 0&&(In={}),setTimeout(function(){var Rn=getToast(on,In);if(Rn){var Mn=Rn.props,Ln=Rn.content,Hn=_extends({},Mn,In,{toastId:In.toastId||on,updateId:generateToastId()});Hn.toastId!==on&&(Hn.staleId=on);var jn=Hn.render||Ln;delete Hn.render,dispatchToast(jn,Hn)}},0)};toast.done=function(on){toast.update(on,{progress:1})};toast.onChange=function(on){return isFn(on)&&eventManager.on(4,on),function(){isFn(on)&&eventManager.off(4,on)}};toast.configure=function(on){on===void 0&&(on={}),lazy=!0,containerConfig=on};toast.POSITION=POSITION;toast.TYPE=TYPE;eventManager.on(2,function(on){latestInstance=on.containerId||on,containers.set(latestInstance,on),queue.forEach(function(In){eventManager.emit(0,In.content,In.options)}),queue=[]}).on(3,function(on){containers.delete(on.containerId||on),containers.size===0&&eventManager.off(0).off(1).off(5),canUseDom&&containerDomNode&&document.body.removeChild(containerDomNode)});const toastId$3="error";function triggerErrorNotification(on,In){const Rn=jsx$1(ToastMessage,{title:on,content:In});return toast.isActive(toastId$3)&&toast.dismiss(toastId$3),toast.error(Rn,{toastId:toastId$3,autoClose:TEN_SECONDS,closeButton:!0}),{dismiss:()=>{toast.dismiss(toastId$3)}}}const toastId$2="user-session";function triggerUserSessionExpiredNotification(on){const In=jsx$1(ToastMessage,{title:"Session Expired",content:jsx$1(UserSessionExpiredMessage,{})}),Rn=toast.warning(In,{toastId:toastId$2,autoClose:TEN_SECONDS,closeButton:!0});on.addEventListener("abort",()=>{toast.dismiss(Rn)})}function UserSessionExpiredMessage(){const[on,In]=reactExports.useState(!1);return jsxs(Fragment,{children:[jsx$1(ToastContentParagraph,{children:"Your session has been recently expired."}),jsx$1(ToastFooter,{children:jsx$1(Button,{color:"primary",disabled:on,onClick:()=>{In(!0),sendMessage({kind:RENEW_SESSION_MESSAGE})},children:"Renew Session"})})]})}const toastId$1="user-sign-in";function triggerSignInNotification(on){const In=jsx$1(ToastMessage,{title:"Signing In",content:jsx$1(UserSigningInMessage,{abortController:on})}),Rn=toast.loading(In,{toastId:toastId$1,type:"info"});on.signal.addEventListener("abort",()=>{toast.dismiss(Rn)})}function UserSigningInMessage({abortController:on}){const[In,Rn]=reactExports.useState(!1);return jsxs(Fragment,{children:[jsx$1(ToastContentParagraph,{children:"You're signing in..."}),jsx$1(ToastFooter,{children:jsx$1(Button,{color:"primary",disabled:In,onClick:()=>{Rn(!0),on.abort()},children:"Cancel"})})]})}function triggerCreateAccountNotification(){const on=jsx$1(ToastMessage,{title:"User Account Setup",content:"We're setting up your account..."});toast.update(toastId$1,{isLoading:!0,render:on,type:"info"})}function triggerCancelAccountCreationNotification(){const on=jsx$1(ToastMessage,{title:"User Account Creation Cancelled",content:"You've cancelled account creation!"});toast.update(toastId$1,{autoClose:TEN_SECONDS,closeButton:!0,isLoading:!1,render:on,type:"warning"})}function triggerLoadAccountNotification(){const on=jsx$1(ToastMessage,{title:"Loading User Account",content:"We're loading your account..."});toast.update(toastId$1,{isLoading:!0,render:on,type:"info"})}function triggerSingInCompleteNotification(){const on=jsx$1(ToastMessage,{title:"Sign In Successful",content:"You've been successfully signed in."});toast.update(toastId$1,{autoClose:TEN_SECONDS,closeButton:!0,isLoading:!1,render:on,type:"success"})}function triggerSignInCancelledNotification(){const on=jsx$1(ToastMessage,{title:"Sign In Cancelled",content:"You've successfully cancelled sign in."});toast.update(toastId$1,{autoClose:TEN_SECONDS,closeButton:!0,isLoading:!1,render:on,type:"warning"})}function triggerSignInFailedNotification(){const on=jsx$1(ToastMessage,{title:"Sign In Failed",content:"We've encountered an error while signing you in. Please refresh and try again!"});toast.update(toastId$1,{autoClose:TEN_SECONDS,closeButton:!0,isLoading:!1,render:on,type:"error"})}function triggerSignOutNotification(on){const In=jsx$1(ToastMessage,{title:"Sign Out Failed",content:"We've encountered an error while signing you out. Please refresh and try again!"}),Rn=jsx$1(ToastMessage,{title:"Signing Out",content:"You're signing out..."}),Mn=jsx$1(ToastMessage,{title:"Sign Out Successful",content:"You've been signed out successfully."});return toast.promise(on.then(()=>new Promise(Ln=>window.setTimeout(Ln,FIVE_HUNDRED_MILLISECONDS))),{error:{render:In},pending:{render:Rn},success:{render:Mn}})}const toastId="workspace";function triggerPrepareWorkspaceNotification(){const on=jsx$1(ToastMessage,{title:"Workspace Preparation",content:"We're preparing your workspace..."});toast.info(on,{toastId,isLoading:!0,type:"info"})}function triggerWorkspacePrepared(){const on=jsx$1(ToastMessage,{title:"Workspace Prepared",content:"Your workspace is prepared"});toast.update(toastId,{autoClose:TEN_SECONDS,render:on,type:"success",closeButton:!0,isLoading:!1})}function triggerWorkspacePreparationFailed(){const on=jsx$1(ToastMessage,{title:"Workspace Preparation Failed",content:"We could not prepare your workspace. Try again later."});toast.update(toastId,{autoClose:TEN_SECONDS,render:on,type:"error",closeButton:!0,isLoading:!1})}class MigrationFailedError extends Error{constructor(In,Rn,Mn){super("The migration has failed"),this.fromVersion=In,this.toVersion=Rn,this.migrationLog=Mn}}function isMigrationFailedError(on){return on instanceof MigrationFailedError}class DatabaseMigration{migrateData(In,Rn){return Promise.resolve()}}class InitialMigration extends DatabaseMigration{migrateSchema(In){In.createObjectStore("app"),In.createObjectStore("mutex",{keyPath:"resource"}),In.createObjectStore("schema",{keyPath:"endpoint"}),In.createObjectStore("schema-attachment",{keyPath:["endpoint","kind"]}),In.createObjectStore("tab",{keyPath:"workspaceId"}),In.createObjectStore("update-log",{keyPath:"id"});const Rn=In.createObjectStore("attachment",{keyPath:["itemId","kind"]}),Mn=In.createObjectStore("item",{keyPath:"id"}),Ln=In.createObjectStore("session",{keyPath:"id"}),Hn=In.createObjectStore("setting",{keyPath:"id"}),jn=In.createObjectStore("workspace",{keyPath:"id"}),Wn=In.createObjectStore("workspace-sync",{keyPath:"id"});Rn.createIndex("workspace","workspaceId"),Mn.createIndex("children","parentId"),Mn.createIndex("day",["workspaceId","day"]),Mn.createIndex("kind",["workspaceId","kind"]),Mn.createIndex("remote","remoteId",{unique:!0}),Mn.createIndex("workspace","workspaceId"),Ln.createIndex("key",["sub","tenant","issuer"],{unique:!0}),Hn.createIndex("key",["sub","apiUrl"],{unique:!0}),jn.createIndex("user",["tenant","sub","apiUrl"]),Wn.createIndex("created","created"),Wn.createIndex("workspace","item.workspaceId")}}class SchemaStatisticsMigration extends DatabaseMigration{migrateSchema(){}async migrateData(In){await In.clear("schema"),await In.clear("schema-attachment");const Rn=In.transaction("tab","readwrite");for await(const Mn of Rn.store.iterate()){const Ln=[];for(const Hn of Mn.value.tabs)Hn.kind==="api"||Hn.kind==="document"?Ln.push({...Hn,activeSchemaViewId:"reference",activeSchemaReferenceViewId:"list"}):Ln.push(Hn);await Rn.store.put({...Mn.value,tabs:Ln})}await Rn.done}}class OperationLensMigration extends DatabaseMigration{migrateSchema(){}async migrateData(In){await In.clear("schema"),await In.clear("schema-attachment")}}class TabViewStateMigration extends DatabaseMigration{migrateSchema(In){In.createObjectStore("tab-view-state",{keyPath:"id"}).createIndex("workspace","workspaceId")}async migrateData(In){const Rn=In.transaction(["tab","tab-view-state"],"readwrite"),Mn=Rn.objectStore("tab"),Ln=Rn.objectStore("tab-view-state");for await(const Hn of Mn.iterate()){const jn=[],Wn=[];for(const Yn of Hn.value.tabs){const[hi,vi]=migrateTab(Yn,Hn.value.workspaceId);jn.push(hi),vi&&Wn.push(Ln.put(vi))}Wn.push(Mn.put({...Hn.value,tabs:jn})),await Promise.all(Wn)}await Rn.done}}function migrateTab(on,In){switch(on.kind){case"api":return migrateApiTab(on,In);case"document":return migrateDocumentTab(on,In);case"environment":return[on,void 0]}}function migrateApiTab(on,In){const{activeViewId:Rn,apiKind:Mn,apiKindDraft:Ln,activeClientId:Hn,activeDeploymentId:jn,activeMonitoringViewId:Wn,activeOperation:Yn,activeResolver:hi,activeSchemaViewId:vi,activeSchemaChangelogId:gi,activeSchemaChangelogViewId:mi,activeSchemaReferenceViewId:yi,activeStage:bi,activeTransaction:Ei,metricsDateTimeRange:_i,schemaSdlEditorViewState:xi,hideDeprecatedItemsInSchemaReference:Ci,isArgumentTypeInfoCollapsed:Ai,isEnumValuesInfoCollapsed:Ii,isFieldArgumentsInfoCollapsed:Ni,isFieldReturnTypeInfoCollapsed:Pi,isSdlPreviewInfoCollapsed:Vi,...Ui}=on,Gi={id:on.id,workspaceId:In,api:{kind:Mn,kindDraft:Ln,activeViewId:Rn,activeClientId:Hn,activeDeploymentId:jn,activeMonitoringViewId:Wn,activeOperation:Yn,activeResolver:hi,activeStage:bi,activeSchemaChangelogId:gi,activeSchemaChangelogViewId:mi,activeTransaction:Ei,metricsDateTimeRange:_i},detailInfo:{isArgumentTypeInfoCollapsed:Ai,isEnumValuesInfoCollapsed:Ii,isFieldArgumentsInfoCollapsed:Ni,isFieldReturnTypeInfoCollapsed:Pi,isSdlPreviewInfoCollapsed:Vi},schema:{activeSchemaViewId:vi,activeSchemaReferenceViewId:yi,sdlEditorViewState:xi,hideDeprecatedItemsInSchemaReference:Ci}};return[Ui,Gi]}function migrateDocumentTab(on,In){const{activeViewId:Rn,activeOperation:Mn,activeOperationCompanionViewId:Ln,activeOperationsSettingsViewId:Hn,activeResponseViewId:jn,activeSchemaReferenceViewId:Wn,activeSchemaViewId:Yn,activeStage:hi,focusedElement:vi,hideDeprecatedItemsInSchemaReference:gi,isArgumentTypeInfoCollapsed:mi,isEnumValuesInfoCollapsed:yi,isFieldArgumentsInfoCollapsed:bi,isFieldReturnTypeInfoCollapsed:Ei,isOperationCompanionCollapsed:_i,isOperationsSettingsPaneCollapsed:xi,isResponseEntriesPaneCollapsed:Ci,isSdlPreviewInfoCollapsed:Ai,isSelectionPathInfoCollapsed:Ii,isTypeImplementsInfoCollapsed:Ni,isTypePossibleTypesInfoCollapsed:Pi,operationsEditorViewState:Vi,operationsSettingsPaneHeight:Ui,responseEditorViewState:Gi,responseEntriesPaneHeight:Yi,schemaSdlEditorViewState:zi,showIntrospectionFieldsInOperationBuilder:Mi,variablesEditorViewState:Li,...wi}=on,Ri={id:on.id,workspaceId:In,api:{activeStage:hi},graphqlDocument:{activeViewId:Rn,activeOperation:Mn,activeOperationsSettingsViewId:Hn,activeResponseViewId:jn,focusedElement:vi,isOperationCompanionCollapsed:_i,isOperationsSettingsPaneCollapsed:xi,isResponseEntriesPaneCollapsed:Ci,operationsEditorViewState:Vi,operationsSettingsPaneHeight:Ui,responseEditorViewState:Gi,responseEntriesPaneHeight:Yi,showIntrospectionFieldsInOperationBuilder:Mi,variablesEditorViewState:Li},detailInfo:{isArgumentTypeInfoCollapsed:!1,isEnumValuesInfoCollapsed:!1,isFieldArgumentsInfoCollapsed:!1,isFieldReturnTypeInfoCollapsed:!1,isSdlPreviewInfoCollapsed:!1,isSelectionPathInfoCollapsed:!1,isTypeImplementsInfoCollapsed:!1,isTypePossibleTypesInfoCollapsed:!1},schema:{activeSchemaViewId:"reference",activeSchemaReferenceViewId:Wn,sdlEditorViewState:zi}};return[wi,Ri]}class DocumentResponseViewMigration extends DatabaseMigration{migrateSchema(){}async migrateData(In){const Rn=In.transaction(["tab-view-state"],"readwrite"),Mn=Rn.objectStore("tab-view-state"),Ln=[];for await(const Hn of Mn.iterate()){const jn=migrateTabViewState(Hn.value);jn&&Ln.push(Mn.put(jn))}await Promise.all(Ln),await Rn.done}}function migrateTabViewState(on){if(on.graphqlDocument)return{...on,graphqlDocument:{...on.graphqlDocument,activeResponseViewId:"response",activeResponseViewFormat:"json"}}}class FusionSchemaDirectivesMigration extends DatabaseMigration{migrateSchema(){}async migrateData(In){await In.clear("schema"),await In.clear("schema-attachment")}}function createLogEntry(on,In){const Rn=now();return In?{created:Rn,message:on,details:In}:{created:Rn,message:on}}async function migrationFailed(on,In,Rn,Mn){return Rn.push(createLogEntry("Migration failed",Mn)),await on.put("update-log",{...In,logs:Rn}),"migration-failed"}async function migrationSucceeded(on,In,Rn){return Rn.push(createLogEntry("Migration succeeded")),await on.put("update-log",{...In,logs:Rn}),"migrated"}const migrations=[new InitialMigration,new SchemaStatisticsMigration,new OperationLensMigration,new TabViewStateMigration,new DocumentResponseViewMigration,new FusionSchemaDirectivesMigration];async function migrate(){const on=getDatabaseName();let In=!1,Rn=await openDB(on,void 0,{upgrade:(jn,Wn,Yn,hi)=>{In=!0,migrations[0].migrateSchema(jn,hi)}});const Mn=Rn.version;let Ln=Rn.version;In?await migrateDataAndClose(Rn,0):Rn.close();for(var Hn=Mn;Hn<migrations.length;Hn++){const{migrateSchema:jn}=migrations[Hn];Rn=await openDB(on,Hn+1,{upgrade:(Wn,Yn,hi,vi)=>jn(Wn,vi)}),Ln=Rn.version,await migrateDataAndClose(Rn,Hn)}return await setAppVersion(APP_AGENT),{newVersion:Ln,previousVersion:Mn}}async function migrateDataAndClose(on,In){const Rn=In+1,Mn={id:`upgrade-to-${Rn}`,created:now(),fromVersion:In,toVersion:Rn,logs:[]},Ln=[];try{await migrations[In].migrateData(on,Ln),await migrationSucceeded(on,Mn,Ln),on.close()}catch(Hn){throw Ln.push(createLogEntry(Hn instanceof Error?Hn.message:"unknown error")),on&&(await migrationFailed(on,Mn,Ln),on.close()),new MigrationFailedError(In,Rn,JSON.stringify(Ln,void 0,2))}}function DataMigrationProvider({children:on}){const[In,Rn]=reactExports.useState(0);return reactExports.useEffect(()=>{migrate().then(({newVersion:Mn})=>Rn(Mn))},[Rn]),In?jsx$1(DatabaseVersionContext.Provider,{value:In,children:on}):null}const DatabaseVersionContext=createNamedContext(0,"DatabaseVersion");function useDatabaseVersion(){return reactExports.useContext(DatabaseVersionContext)}var LogLevel=(on=>(on[on.error=0]="error",on[on.warning=1]="warning",on[on.info=2]="info",on))(LogLevel||{});const BASIC_LOG_ENTRY_KIND="basic";var RequestKind=(on=>(on.GRAPHQL_OPERATION="graphql-operation",on.GRAPHQL_INTROSPECTION="graphql-introspection",on.GRAPHQL_SDL_FETCH="graphql-sdl-fetch",on.GRAPHQL_SDL_PROBE="graphql-sdl-probe",on))(RequestKind||{});const HTTP_REQUEST_LOG_ENTRY_KIND="http-request",HTTP_RESPONSE_LOG_ENTRY_KIND="http-response",HTTP_RESPONSE_BODY_CHUNK_LOG_ENTRY_KIND="http-response-body-chunk",HTTP_RESPONSE_CANCELLED_LOG_ENTRY_KIND="http-response-cancelled",HTTP_RESPONSE_FAILED_LOG_ENTRY_KIND="http-response-failed",HTTP_RESPONSE_FINISHED_LOG_ENTRY_KIND="http-response-finished",SCOPE_BEGIN_LOG_ENTRY_KIND="scope-begin",SCOPE_END_LOG_ENTRY_KIND="scope-end",SUBSCRIPTION_REQUEST_STARTED_LOG_ENTRY_KIND="subscription-request-started",SUBSCRIPTION_REQUEST_PROTOCOL_LOG_ENTRY_KIND="subscription-request-protocol",SUBSCRIPTION_REQUEST_MESSAGE_LOG_ENTRY_KIND="subscription-request-message",SUBSCRIPTION_REQUEST_STOPPED_LOG_ENTRY_KIND="subscription-request-stopped";function requireLock(on,In,Rn){const Mn=FIVE_SECONDS,Ln=createId("mutex");return acquireLock(on,Ln,Mn).then(async()=>{const Hn=new TimeoutAbortController(Mn);try{const[jn]=await Promise.all([In(Hn.signal.toAbortSignal()).then(Wn=>(Hn.cancel(),Wn)),Hn.signal.toPromise()]);return jn}catch(jn){throw isTimeoutAbortError(jn)?new LockExpiredError(on):jn}finally{Hn.cancel(),await releaseLock(on)}})}async function acquireLock(on,In,Rn){for(;!await tryAcquireLock(on,In,Rn);)await delay(FIFTY_MILLISECONDS)}class LockExpiredError extends Error{constructor(In){super(`Lock for resource "${In}" has been expired`)}}async function tryGetUserSessionAndRefresh(on){const In=await getCurrentTenant();if(!In)return null;let Rn=await getUserSession(In);if(!Rn)return null;if(isSessionExpired(Rn)&&(Rn=await refreshSession(Rn),isSessionExpired(Rn)))throw new UserSessionExpiredError;return Rn}async function refreshSession(on,In){return requireLock("refresh-session",Rn);async function Rn(Mn){const Ln=Mn;let Hn=await getUserSession(on)||on;if(!isSessionExpired(Hn)&&Hn.requiresSignIn)return Hn;const jn=new Headers,Wn=new URLSearchParams;jn.append(HEADER_CONTENT_TYPE,"application/x-www-form-urlencoded"),Wn.append("client_id","3c9f56bd-0e2c-4358-9bf5-ff3a0efa9bf5"),Wn.append("grant_type","refresh_token"),Wn.append("refresh_token",Hn.refreshToken);try{const Yn=await fetch(`${Hn.issuer}/connect/token`,{method:"POST",headers:jn,body:Wn,signal:Ln});if(Yn.ok){const hi=await Yn.json();if(isToken(hi))return replaceUserSession({...Hn,requiresSignIn:!1,idToken:hi.id_token,accessToken:hi.access_token,refreshToken:hi.refresh_token,expiresAt:now()+hi.expires_in*ONE_SECOND$1})}else if(Yn.status===400&&(Hn=await getUserSession(on)||on,isSessionExpired(Hn)))return replaceUserSession({...Hn,requiresSignIn:!0,lastTriedToRefresh:now()});return Hn}catch(Yn){console.error(Yn)}return Hn=await getUserSession(on)||on,isSessionExpired(Hn)?replaceUserSession({...Hn,lastTriedToRefresh:now()}):Hn}}function isToken(on){return isDictionary(on)&&"access_token"in on}class UserSessionExpiredError extends Error{constructor(){super("User session has been expired")}}async function getHttpOptions(on){const In=await tryGetUserSessionAndRefresh(),Rn=isURL(on)?on:new URL(on,In?.apiUrl??"https://api.chillicream.com").href,Mn=getHeaders(In?.accessToken);return{uri:Rn,headers:Mn}}function getHeaders(on){const In=new Headers;if(In.set("CCC-Agent",APP_AGENT),In.set("GraphQL-Agent",APP_AGENT),In.set("GraphQL-Client-Id",APP_GRAPHQL_CLIENT_ID),In.set("GraphQL-Client-Version",APP_VERSION$1),In.set("GraphQL-Defer-RFC","v2"),on)In.set("Authorization",`Bearer ${on}`);else throw new UserSessionExpiredError;return In}var RelayFeatureFlags_1,hasRequiredRelayFeatureFlags;function requireRelayFeatureFlags(){if(hasRequiredRelayFeatureFlags)return RelayFeatureFlags_1;hasRequiredRelayFeatureFlags=1;var on={ENABLE_CLIENT_EDGES:!1,ENABLE_VARIABLE_CONNECTION_KEY:!1,ENABLE_RELAY_RESOLVERS:!1,ENABLE_GETFRAGMENTIDENTIFIER_OPTIMIZATION:!1,ENABLE_FRIENDLY_QUERY_NAME_GQL_URL:!1,ENABLE_LOAD_QUERY_REQUEST_DEDUPING:!0,ENABLE_DO_NOT_WRAP_LIVE_QUERY:!1,ENABLE_NOTIFY_SUBSCRIPTION:!1,BATCH_ASYNC_MODULE_UPDATES_FN:null,ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT:!1,MAX_DATA_ID_LENGTH:null,STRING_INTERN_LEVEL:0,LOG_MISSING_RECORDS_IN_PROD:!1,ENABLE_LOOSE_SUBSCRIPTION_ATTRIBUTION:!1,ENABLE_OPERATION_TRACKER_OPTIMISTIC_UPDATES:!1,ENABLE_RELAY_OPERATION_TRACKER_SUSPENSE:!1,ENABLE_FIELD_ERROR_HANDLING:!1,ENABLE_FIELD_ERROR_HANDLING_THROW_BY_DEFAULT:!1,ENABLE_FIELD_ERROR_HANDLING_CATCH_DIRECTIVE:!1,ENABLE_SHALLOW_FREEZE_RESOLVER_VALUES:!0,ENABLE_STRICT_EQUAL_SELECTORS:!1};return RelayFeatureFlags_1=on,RelayFeatureFlags_1}var StringInterner,hasRequiredStringInterner;function requireStringInterner(){if(hasRequiredStringInterner)return StringInterner;hasRequiredStringInterner=1;var on=new Map,In=1,Rn=Hn(),Mn=" ",Ln="\v";function Hn(){for(var Yn=new Set,hi=0;hi<10;++hi)Yn.add(hi.toString());return Yn}function jn(Yn){return Yn[0]===Mn&&Rn.has(Yn[1])||Yn[0]===Ln?Ln+Yn:Yn}function Wn(Yn,hi){if(hi==null||Yn.length<hi)return jn(Yn);var vi=on.get(Yn);return vi!=null||(vi=Mn+In++,on.set(Yn,vi)),vi}return StringInterner={intern:Wn},StringInterner}var ClientID,hasRequiredClientID;function requireClientID(){if(hasRequiredClientID)return ClientID;hasRequiredClientID=1;var on=requireRelayFeatureFlags(),In=requireStringInterner(),Rn=In.intern,Mn="client:";function Ln(hi,vi,gi){var mi=on.STRING_INTERN_LEVEL<=0?hi:Rn(hi,on.MAX_DATA_ID_LENGTH),yi=mi+":"+vi;return gi!=null&&(yi+=":"+gi),yi.indexOf(Mn)!==0&&(yi=Mn+yi),yi}function Hn(hi){return hi.indexOf(Mn)===0}var jn=0;function Wn(){return"".concat(Mn,"local:").concat(jn++)}function Yn(hi,vi,gi){var mi="".concat(Mn).concat(hi,":").concat(vi);return gi!=null&&(mi+=":"+gi),mi}return ClientID={generateClientID:Ln,generateClientObjectClientID:Yn,generateUniqueClientID:Wn,isClientID:Hn},ClientID}var interopRequireDefault={exports:{}},hasRequiredInteropRequireDefault;function requireInteropRequireDefault(){return hasRequiredInteropRequireDefault||(hasRequiredInteropRequireDefault=1,function(on){function In(Rn){return Rn&&Rn.__esModule?Rn:{default:Rn}}on.exports=In,on.exports.__esModule=!0,on.exports.default=on.exports}(interopRequireDefault)),interopRequireDefault.exports}var toConsumableArray={exports:{}},arrayWithoutHoles={exports:{}},arrayLikeToArray={exports:{}},hasRequiredArrayLikeToArray;function requireArrayLikeToArray(){return hasRequiredArrayLikeToArray||(hasRequiredArrayLikeToArray=1,function(on){function In(Rn,Mn){(Mn==null||Mn>Rn.length)&&(Mn=Rn.length);for(var Ln=0,Hn=new Array(Mn);Ln<Mn;Ln++)Hn[Ln]=Rn[Ln];return Hn}on.exports=In,on.exports.__esModule=!0,on.exports.default=on.exports}(arrayLikeToArray)),arrayLikeToArray.exports}var hasRequiredArrayWithoutHoles;function requireArrayWithoutHoles(){return hasRequiredArrayWithoutHoles||(hasRequiredArrayWithoutHoles=1,function(on){var In=requireArrayLikeToArray();function Rn(Mn){if(Array.isArray(Mn))return In(Mn)}on.exports=Rn,on.exports.__esModule=!0,on.exports.default=on.exports}(arrayWithoutHoles)),arrayWithoutHoles.exports}var iterableToArray={exports:{}},hasRequiredIterableToArray;function requireIterableToArray(){return hasRequiredIterableToArray||(hasRequiredIterableToArray=1,function(on){function In(Rn){if(typeof Symbol<"u"&&Rn[Symbol.iterator]!=null||Rn["@@iterator"]!=null)return Array.from(Rn)}on.exports=In,on.exports.__esModule=!0,on.exports.default=on.exports}(iterableToArray)),iterableToArray.exports}var unsupportedIterableToArray={exports:{}},hasRequiredUnsupportedIterableToArray;function requireUnsupportedIterableToArray(){return hasRequiredUnsupportedIterableToArray||(hasRequiredUnsupportedIterableToArray=1,function(on){var In=requireArrayLikeToArray();function Rn(Mn,Ln){if(Mn){if(typeof Mn=="string")return In(Mn,Ln);var Hn=Object.prototype.toString.call(Mn).slice(8,-1);if(Hn==="Object"&&Mn.constructor&&(Hn=Mn.constructor.name),Hn==="Map"||Hn==="Set")return Array.from(Mn);if(Hn==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Hn))return In(Mn,Ln)}}on.exports=Rn,on.exports.__esModule=!0,on.exports.default=on.exports}(unsupportedIterableToArray)),unsupportedIterableToArray.exports}var nonIterableSpread={exports:{}},hasRequiredNonIterableSpread;function requireNonIterableSpread(){return hasRequiredNonIterableSpread||(hasRequiredNonIterableSpread=1,function(on){function In(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
4492
|
+
`;function r$1(on){var In,Rn,Mn="";if(typeof on=="string"||typeof on=="number")Mn+=on;else if(typeof on=="object")if(Array.isArray(on))for(In=0;In<on.length;In++)on[In]&&(Rn=r$1(on[In]))&&(Mn&&(Mn+=" "),Mn+=Rn);else for(In in on)on[In]&&(Mn&&(Mn+=" "),Mn+=In);return Mn}function clsx(){for(var on,In,Rn=0,Mn="";Rn<arguments.length;)(on=arguments[Rn++])&&(In=r$1(on))&&(Mn&&(Mn+=" "),Mn+=In);return Mn}function _extends(){return _extends=Object.assign||function(on){for(var In=1;In<arguments.length;In++){var Rn=arguments[In];for(var Mn in Rn)Object.prototype.hasOwnProperty.call(Rn,Mn)&&(on[Mn]=Rn[Mn])}return on},_extends.apply(this,arguments)}function _objectWithoutPropertiesLoose(on,In){if(on==null)return{};var Rn={},Mn=Object.keys(on),Ln,Hn;for(Hn=0;Hn<Mn.length;Hn++)Ln=Mn[Hn],!(In.indexOf(Ln)>=0)&&(Rn[Ln]=on[Ln]);return Rn}function isNum(on){return typeof on=="number"&&!isNaN(on)}function isBool(on){return typeof on=="boolean"}function isStr(on){return typeof on=="string"}function isFn(on){return typeof on=="function"}function parseClassName(on){return isStr(on)||isFn(on)?on:null}function isToastIdValid(on){return on===0||on}function getAutoCloseDelay(on,In){return on===!1||isNum(on)&&on>0?on:In}var canUseDom=!!(typeof window<"u"&&window.document&&window.document.createElement);function canBeRendered(on){return reactExports.isValidElement(on)||isStr(on)||isFn(on)||isNum(on)}var POSITION={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"};function collapseToast(on,In,Rn){Rn===void 0&&(Rn=300);var Mn=on.scrollHeight,Ln=on.style;requestAnimationFrame(function(){Ln.minHeight="initial",Ln.height=Mn+"px",Ln.transition="all "+Rn+"ms",requestAnimationFrame(function(){Ln.height="0",Ln.padding="0",Ln.margin="0",setTimeout(In,Rn)})})}function cssTransition(on){var In=on.enter,Rn=on.exit,Mn=on.appendPosition,Ln=Mn===void 0?!1:Mn,Hn=on.collapse,jn=Hn===void 0?!0:Hn,Wn=on.collapseDuration,Yn=Wn===void 0?300:Wn;return function(vi){var gi=vi.children,mi=vi.position,yi=vi.preventExitTransition,bi=vi.done,Ei=vi.nodeRef,_i=vi.isIn,xi=Ln?In+"--"+mi:In,Ci=Ln?Rn+"--"+mi:Rn,Ai=reactExports.useRef(),Ii=reactExports.useRef(0);reactExports.useLayoutEffect(function(){Ni()},[]),reactExports.useEffect(function(){_i||(yi?Ui():Vi())},[_i]);function Ni(){var Gi=Ei.current;Ai.current=Gi.className,Gi.className+=" "+xi,Gi.addEventListener("animationend",Pi),Gi.addEventListener("animationcancel",Pi)}function Pi(Gi){if(Gi.target===Ei.current){var Yi=Ei.current;Yi.dispatchEvent(new Event("d")),Yi.removeEventListener("animationend",Pi),Yi.removeEventListener("animationcancel",Pi),Ii.current===0&&(Yi.className=Ai.current)}}function Vi(){Ii.current=1;var Gi=Ei.current;Gi.className+=" "+Ci,Gi.addEventListener("animationend",Ui)}function Ui(){var Gi=Ei.current;Gi.removeEventListener("animationend",Ui),jn?collapseToast(Gi,bi,Yn):bi()}return React.createElement(React.Fragment,null,gi)}}var eventManager={list:new Map,emitQueue:new Map,on:function on(In,Rn){return this.list.has(In)||this.list.set(In,[]),this.list.get(In).push(Rn),this},off:function on(In,Rn){if(Rn){var Mn=this.list.get(In).filter(function(Ln){return Ln!==Rn});return this.list.set(In,Mn),this}return this.list.delete(In),this},cancelEmit:function on(In){var Rn=this.emitQueue.get(In);return Rn&&(Rn.forEach(clearTimeout),this.emitQueue.delete(In)),this},emit:function on(In){for(var Rn=this,Mn=arguments.length,Ln=new Array(Mn>1?Mn-1:0),Hn=1;Hn<Mn;Hn++)Ln[Hn-1]=arguments[Hn];this.list.has(In)&&this.list.get(In).forEach(function(jn){var Wn=setTimeout(function(){jn.apply(void 0,Ln)},0);Rn.emitQueue.has(In)||Rn.emitQueue.set(In,[]),Rn.emitQueue.get(In).push(Wn)})}},_excluded=["delay","staleId"];function useToastContainer(on){var In=reactExports.useReducer(function(xi){return xi+1},0),Rn=In[1],Mn=reactExports.useState([]),Ln=Mn[0],Hn=Mn[1],jn=reactExports.useRef(null),Wn=reactExports.useRef(new Map).current,Yn=function(Ci){return Ln.indexOf(Ci)!==-1},hi=reactExports.useRef({toastKey:1,displayedToast:0,count:0,queue:[],props:on,containerId:null,isToastActive:Yn,getToast:function(Ci){return Wn.get(Ci)}}).current;reactExports.useEffect(function(){return hi.containerId=on.containerId,eventManager.cancelEmit(3).on(0,bi).on(1,function(xi){return jn.current&&gi(xi)}).on(5,vi).emit(2,hi),function(){return eventManager.emit(3,hi)}},[]),reactExports.useEffect(function(){hi.isToastActive=Yn,hi.displayedToast=Ln.length,eventManager.emit(4,Ln.length,on.containerId)},[Ln]),reactExports.useEffect(function(){hi.props=on});function vi(xi){var Ci=xi.containerId,Ai=hi.props.limit;Ai&&(!Ci||hi.containerId===Ci)&&(hi.count-=hi.queue.length,hi.queue=[])}function gi(xi){Hn(function(Ci){return isToastIdValid(xi)?Ci.filter(function(Ai){return Ai!==xi}):[]})}function mi(){var xi=hi.queue.shift(),Ci=xi.toastContent,Ai=xi.toastProps,Ii=xi.staleId;Ei(Ci,Ai,Ii)}function yi(xi){return!jn.current||hi.props.enableMultiContainer&&xi.containerId!==hi.props.containerId||Wn.has(xi.toastId)&&xi.updateId==null}function bi(xi,Ci){var Ai=Ci.delay,Ii=Ci.staleId,Ni=_objectWithoutPropertiesLoose(Ci,_excluded);if(!(!canBeRendered(xi)||yi(Ni))){var Pi=Ni.toastId,Vi=Ni.updateId,Ui=Ni.data,Gi=hi.props,Yi=function(){return gi(Pi)},zi=Vi==null;zi&&hi.count++;var Mi={toastId:Pi,updateId:Vi,isLoading:Ni.isLoading,theme:Ni.theme||Gi.theme,icon:Ni.icon!=null?Ni.icon:Gi.icon,isIn:!1,key:Ni.key||hi.toastKey++,type:Ni.type,closeToast:Yi,closeButton:Ni.closeButton,rtl:Gi.rtl,position:Ni.position||Gi.position,transition:Ni.transition||Gi.transition,className:parseClassName(Ni.className||Gi.toastClassName),bodyClassName:parseClassName(Ni.bodyClassName||Gi.bodyClassName),style:Ni.style||Gi.toastStyle,bodyStyle:Ni.bodyStyle||Gi.bodyStyle,onClick:Ni.onClick||Gi.onClick,pauseOnHover:isBool(Ni.pauseOnHover)?Ni.pauseOnHover:Gi.pauseOnHover,pauseOnFocusLoss:isBool(Ni.pauseOnFocusLoss)?Ni.pauseOnFocusLoss:Gi.pauseOnFocusLoss,draggable:isBool(Ni.draggable)?Ni.draggable:Gi.draggable,draggablePercent:Ni.draggablePercent||Gi.draggablePercent,draggableDirection:Ni.draggableDirection||Gi.draggableDirection,closeOnClick:isBool(Ni.closeOnClick)?Ni.closeOnClick:Gi.closeOnClick,progressClassName:parseClassName(Ni.progressClassName||Gi.progressClassName),progressStyle:Ni.progressStyle||Gi.progressStyle,autoClose:Ni.isLoading?!1:getAutoCloseDelay(Ni.autoClose,Gi.autoClose),hideProgressBar:isBool(Ni.hideProgressBar)?Ni.hideProgressBar:Gi.hideProgressBar,progress:Ni.progress,role:Ni.role||Gi.role,deleteToast:function(){Wn.delete(Pi);var Ri=hi.queue.length;if(hi.count=isToastIdValid(Pi)?hi.count-1:hi.count-hi.displayedToast,hi.count<0&&(hi.count=0),Ri>0){var ki=isToastIdValid(Pi)?1:hi.props.limit;if(Ri===1||ki===1)hi.displayedToast++,mi();else{var Bi=ki>Ri?Ri:ki;hi.displayedToast=Bi;for(var Hi=0;Hi<Bi;Hi++)mi()}}else Rn()}};isFn(Ni.onOpen)&&(Mi.onOpen=Ni.onOpen),isFn(Ni.onClose)&&(Mi.onClose=Ni.onClose),Mi.closeButton=Gi.closeButton,Ni.closeButton===!1||canBeRendered(Ni.closeButton)?Mi.closeButton=Ni.closeButton:Ni.closeButton===!0&&(Mi.closeButton=canBeRendered(Gi.closeButton)?Gi.closeButton:!0);var Li=xi;reactExports.isValidElement(xi)&&!isStr(xi.type)?Li=reactExports.cloneElement(xi,{closeToast:Yi,toastProps:Mi,data:Ui}):isFn(xi)&&(Li=xi({closeToast:Yi,toastProps:Mi,data:Ui})),Gi.limit&&Gi.limit>0&&hi.count>Gi.limit&&zi?hi.queue.push({toastContent:Li,toastProps:Mi,staleId:Ii}):isNum(Ai)&&Ai>0?setTimeout(function(){Ei(Li,Mi,Ii)},Ai):Ei(Li,Mi,Ii)}}function Ei(xi,Ci,Ai){var Ii=Ci.toastId;Ai&&Wn.delete(Ai),Wn.set(Ii,{content:xi,props:Ci}),Hn(function(Ni){return[].concat(Ni,[Ii]).filter(function(Pi){return Pi!==Ai})})}function _i(xi){var Ci=new Map,Ai=Array.from(Wn.values());return on.newestOnTop&&Ai.reverse(),Ai.forEach(function(Ii){var Ni=Ii.props.position;Ci.has(Ni)||Ci.set(Ni,[]),Ci.get(Ni).push(Ii)}),Array.from(Ci,function(Ii){return xi(Ii[0],Ii[1])})}return{getToastToRender:_i,containerRef:jn,isToastActive:Yn}}function getX(on){return on.targetTouches&&on.targetTouches.length>=1?on.targetTouches[0].clientX:on.clientX}function getY(on){return on.targetTouches&&on.targetTouches.length>=1?on.targetTouches[0].clientY:on.clientY}function useToast(on){var In=reactExports.useState(!1),Rn=In[0],Mn=In[1],Ln=reactExports.useState(!1),Hn=Ln[0],jn=Ln[1],Wn=reactExports.useRef(null),Yn=reactExports.useRef({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,hi=reactExports.useRef(on),vi=on.autoClose,gi=on.pauseOnHover,mi=on.closeToast,yi=on.onClick,bi=on.closeOnClick;reactExports.useEffect(function(){hi.current=on}),reactExports.useEffect(function(){return Wn.current&&Wn.current.addEventListener("d",xi,{once:!0}),isFn(on.onOpen)&&on.onOpen(reactExports.isValidElement(on.children)&&on.children.props),function(){var Yi=hi.current;isFn(Yi.onClose)&&Yi.onClose(reactExports.isValidElement(Yi.children)&&Yi.children.props)}},[]),reactExports.useEffect(function(){return on.pauseOnFocusLoss&&Ai(),function(){on.pauseOnFocusLoss&&Ii()}},[on.pauseOnFocusLoss]);function Ei(Yi){if(on.draggable){Ni();var zi=Wn.current;Yn.canCloseOnClick=!0,Yn.canDrag=!0,Yn.boundingRect=zi.getBoundingClientRect(),zi.style.transition="",Yn.x=getX(Yi.nativeEvent),Yn.y=getY(Yi.nativeEvent),on.draggableDirection==="x"?(Yn.start=Yn.x,Yn.removalDistance=zi.offsetWidth*(on.draggablePercent/100)):(Yn.start=Yn.y,Yn.removalDistance=zi.offsetHeight*(on.draggablePercent===80?on.draggablePercent*1.5:on.draggablePercent/100))}}function _i(){if(Yn.boundingRect){var Yi=Yn.boundingRect,zi=Yi.top,Mi=Yi.bottom,Li=Yi.left,wi=Yi.right;on.pauseOnHover&&Yn.x>=Li&&Yn.x<=wi&&Yn.y>=zi&&Yn.y<=Mi?Ci():xi()}}function xi(){Mn(!0)}function Ci(){Mn(!1)}function Ai(){document.hasFocus()||Ci(),window.addEventListener("focus",xi),window.addEventListener("blur",Ci)}function Ii(){window.removeEventListener("focus",xi),window.removeEventListener("blur",Ci)}function Ni(){Yn.didMove=!1,document.addEventListener("mousemove",Vi),document.addEventListener("mouseup",Ui),document.addEventListener("touchmove",Vi),document.addEventListener("touchend",Ui)}function Pi(){document.removeEventListener("mousemove",Vi),document.removeEventListener("mouseup",Ui),document.removeEventListener("touchmove",Vi),document.removeEventListener("touchend",Ui)}function Vi(Yi){var zi=Wn.current;Yn.canDrag&&zi&&(Yn.didMove=!0,Rn&&Ci(),Yn.x=getX(Yi),Yn.y=getY(Yi),on.draggableDirection==="x"?Yn.delta=Yn.x-Yn.start:Yn.delta=Yn.y-Yn.start,Yn.start!==Yn.x&&(Yn.canCloseOnClick=!1),zi.style.transform="translate"+on.draggableDirection+"("+Yn.delta+"px)",zi.style.opacity=""+(1-Math.abs(Yn.delta/Yn.removalDistance)))}function Ui(){Pi();var Yi=Wn.current;if(Yn.canDrag&&Yn.didMove&&Yi){if(Yn.canDrag=!1,Math.abs(Yn.delta)>Yn.removalDistance){jn(!0),on.closeToast();return}Yi.style.transition="transform 0.2s, opacity 0.2s",Yi.style.transform="translate"+on.draggableDirection+"(0)",Yi.style.opacity="1"}}var Gi={onMouseDown:Ei,onTouchStart:Ei,onMouseUp:_i,onTouchEnd:_i};return vi&&gi&&(Gi.onMouseEnter=Ci,Gi.onMouseLeave=xi),bi&&(Gi.onClick=function(Yi){yi&&yi(Yi),Yn.canCloseOnClick&&mi()}),{playToast:xi,pauseToast:Ci,isRunning:Rn,preventExitTransition:Hn,toastRef:Wn,eventHandlers:Gi}}function CloseButton(on){var In=on.closeToast,Rn=on.theme,Mn=on.ariaLabel,Ln=Mn===void 0?"close":Mn;return reactExports.createElement("button",{className:"Toastify__close-button Toastify__close-button--"+Rn,type:"button",onClick:function(jn){jn.stopPropagation(),In(jn)},"aria-label":Ln},reactExports.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},reactExports.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function ProgressBar(on){var In,Rn,Mn=on.delay,Ln=on.isRunning,Hn=on.closeToast,jn=on.type,Wn=on.hide,Yn=on.className,hi=on.style,vi=on.controlledProgress,gi=on.progress,mi=on.rtl,yi=on.isIn,bi=on.theme,Ei=_extends({},hi,{animationDuration:Mn+"ms",animationPlayState:Ln?"running":"paused",opacity:Wn?0:1});vi&&(Ei.transform="scaleX("+gi+")");var _i=clsx("Toastify__progress-bar",vi?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated","Toastify__progress-bar-theme--"+bi,"Toastify__progress-bar--"+jn,(In={},In["Toastify__progress-bar--rtl"]=mi,In)),xi=isFn(Yn)?Yn({rtl:mi,type:jn,defaultClassName:_i}):clsx(_i,Yn),Ci=(Rn={},Rn[vi&&gi>=1?"onTransitionEnd":"onAnimationEnd"]=vi&&gi<1?null:function(){yi&&Hn()},Rn);return reactExports.createElement("div",Object.assign({role:"progressbar","aria-hidden":Wn?"true":"false","aria-label":"notification timer",className:xi,style:Ei},Ci))}ProgressBar.defaultProps={type:TYPE.DEFAULT,hide:!1};var _excluded$1=["theme","type"],Svg=function on(In){var Rn=In.theme,Mn=In.type,Ln=_objectWithoutPropertiesLoose(In,_excluded$1);return reactExports.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"100%",height:"100%",fill:Rn==="colored"?"currentColor":"var(--toastify-icon-color-"+Mn+")"},Ln))};function Warning(on){return reactExports.createElement(Svg,Object.assign({},on),reactExports.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))}function Info(on){return reactExports.createElement(Svg,Object.assign({},on),reactExports.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))}function Success(on){return reactExports.createElement(Svg,Object.assign({},on),reactExports.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))}function Error$1(on){return reactExports.createElement(Svg,Object.assign({},on),reactExports.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))}function Spinner$2(){return reactExports.createElement("div",{className:"Toastify__spinner"})}var Icons={info:Info,warning:Warning,success:Success,error:Error$1,spinner:Spinner$2},Toast=function on(In){var Rn,Mn,Ln=useToast(In),Hn=Ln.isRunning,jn=Ln.preventExitTransition,Wn=Ln.toastRef,Yn=Ln.eventHandlers,hi=In.closeButton,vi=In.children,gi=In.autoClose,mi=In.onClick,yi=In.type,bi=In.hideProgressBar,Ei=In.closeToast,_i=In.transition,xi=In.position,Ci=In.className,Ai=In.style,Ii=In.bodyClassName,Ni=In.bodyStyle,Pi=In.progressClassName,Vi=In.progressStyle,Ui=In.updateId,Gi=In.role,Yi=In.progress,zi=In.rtl,Mi=In.toastId,Li=In.deleteToast,wi=In.isIn,Ri=In.isLoading,ki=In.icon,Bi=In.theme,Hi=clsx("Toastify__toast","Toastify__toast-theme--"+Bi,"Toastify__toast--"+yi,(Rn={},Rn["Toastify__toast--rtl"]=zi,Rn)),Ki=isFn(Ci)?Ci({rtl:zi,position:xi,type:yi,defaultClassName:Hi}):clsx(Hi,Ci),ji=!!Yi,Fi=Icons[yi],$i={theme:Bi,type:yi},Wi=Fi&&Fi($i);ki===!1?Wi=void 0:isFn(ki)?Wi=ki($i):reactExports.isValidElement(ki)?Wi=reactExports.cloneElement(ki,$i):isStr(ki)?Wi=ki:Ri&&(Wi=Icons.spinner());function Qi(ea){if(ea){var na={closeToast:Ei,type:yi,theme:Bi};if(isFn(ea))return ea(na);if(reactExports.isValidElement(ea))return reactExports.cloneElement(ea,na)}}return reactExports.createElement(_i,{isIn:wi,done:Li,position:xi,preventExitTransition:jn,nodeRef:Wn},reactExports.createElement("div",Object.assign({id:Mi,onClick:mi,className:Ki},Yn,{style:Ai,ref:Wn}),reactExports.createElement("div",Object.assign({},wi&&{role:Gi},{className:isFn(Ii)?Ii({type:yi}):clsx("Toastify__toast-body",Ii),style:Ni}),Wi&&reactExports.createElement("div",{className:clsx("Toastify__toast-icon",(Mn={},Mn["Toastify--animate-icon Toastify__zoom-enter"]=!Ri,Mn))},Wi),reactExports.createElement("div",null,vi)),Qi(hi),(gi||ji)&&reactExports.createElement(ProgressBar,Object.assign({},Ui&&!ji?{key:"pb-"+Ui}:{},{rtl:zi,theme:Bi,delay:gi,isRunning:Hn,isIn:wi,closeToast:Ei,hide:bi,type:yi,style:Vi,className:Pi,controlledProgress:ji,progress:Yi}))))},Bounce=cssTransition({enter:"Toastify--animate Toastify__bounce-enter",exit:"Toastify--animate Toastify__bounce-exit",appendPosition:!0}),ToastContainer=function on(In){var Rn=useToastContainer(In),Mn=Rn.getToastToRender,Ln=Rn.containerRef,Hn=Rn.isToastActive,jn=In.className,Wn=In.style,Yn=In.rtl,hi=In.containerId;function vi(gi){var mi,yi=clsx("Toastify__toast-container","Toastify__toast-container--"+gi,(mi={},mi["Toastify__toast-container--rtl"]=Yn,mi));return isFn(jn)?jn({position:gi,rtl:Yn,defaultClassName:yi}):clsx(yi,parseClassName(jn))}return reactExports.createElement("div",{ref:Ln,className:"Toastify",id:hi},Mn(function(gi,mi){var yi=mi.length?_extends({},Wn):_extends({},Wn,{pointerEvents:"none"});return reactExports.createElement("div",{className:vi(gi),style:yi,key:"container-"+gi},mi.map(function(bi){var Ei=bi.content,_i=bi.props;return reactExports.createElement(Toast,Object.assign({},_i,{isIn:Hn(_i.toastId),key:"toast-"+_i.key,closeButton:_i.closeButton===!0?CloseButton:_i.closeButton}),Ei)}))}))};ToastContainer.defaultProps={position:POSITION.TOP_RIGHT,transition:Bounce,rtl:!1,autoClose:5e3,hideProgressBar:!1,closeButton:CloseButton,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,newestOnTop:!1,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};var containers=new Map,latestInstance,containerDomNode,containerConfig,queue=[],lazy=!1;function getToast(on,In){var Rn=In.containerId,Mn=containers.get(Rn||latestInstance);return Mn?Mn.getToast(on):null}function generateToastId(){return Math.random().toString(36).substring(2,9)}function getToastId(on){return on&&(isStr(on.toastId)||isNum(on.toastId))?on.toastId:generateToastId()}function dispatchToast(on,In){return containers.size>0?eventManager.emit(0,on,In):(queue.push({content:on,options:In}),lazy&&canUseDom&&(lazy=!1,containerDomNode=document.createElement("div"),document.body.appendChild(containerDomNode),reactDomExports.render(reactExports.createElement(ToastContainer,Object.assign({},containerConfig)),containerDomNode))),In.toastId}function mergeOptions(on,In){return _extends({},In,{type:In&&In.type||on,toastId:getToastId(In)})}function createToastByType(on){return function(In,Rn){return dispatchToast(In,mergeOptions(on,Rn))}}function toast(on,In){return dispatchToast(on,mergeOptions(TYPE.DEFAULT,In))}toast.loading=function(on,In){return dispatchToast(on,mergeOptions(TYPE.DEFAULT,_extends({isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1},In)))};function handlePromise(on,In,Rn){var Mn=In.pending,Ln=In.error,Hn=In.success,jn;Mn&&(jn=isStr(Mn)?toast.loading(Mn,Rn):toast.loading(Mn.render,_extends({},Rn,Mn)));var Wn={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},Yn=function(gi,mi,yi){if(mi==null){toast.dismiss(jn);return}var bi=_extends({type:gi},Wn,Rn,{data:yi}),Ei=isStr(mi)?{render:mi}:mi;return jn?toast.update(jn,_extends({},bi,Ei)):toast(Ei.render,_extends({},bi,Ei)),yi},hi=isFn(on)?on():on;return hi.then(function(vi){return Yn("success",Hn,vi)}).catch(function(vi){return Yn("error",Ln,vi)}),hi}toast.promise=handlePromise;toast.success=createToastByType(TYPE.SUCCESS);toast.info=createToastByType(TYPE.INFO);toast.error=createToastByType(TYPE.ERROR);toast.warning=createToastByType(TYPE.WARNING);toast.warn=toast.warning;toast.dark=function(on,In){return dispatchToast(on,mergeOptions(TYPE.DEFAULT,_extends({theme:"dark"},In)))};toast.dismiss=function(on){return eventManager.emit(1,on)};toast.clearWaitingQueue=function(on){return on===void 0&&(on={}),eventManager.emit(5,on)};toast.isActive=function(on){var In=!1;return containers.forEach(function(Rn){Rn.isToastActive&&Rn.isToastActive(on)&&(In=!0)}),In};toast.update=function(on,In){In===void 0&&(In={}),setTimeout(function(){var Rn=getToast(on,In);if(Rn){var Mn=Rn.props,Ln=Rn.content,Hn=_extends({},Mn,In,{toastId:In.toastId||on,updateId:generateToastId()});Hn.toastId!==on&&(Hn.staleId=on);var jn=Hn.render||Ln;delete Hn.render,dispatchToast(jn,Hn)}},0)};toast.done=function(on){toast.update(on,{progress:1})};toast.onChange=function(on){return isFn(on)&&eventManager.on(4,on),function(){isFn(on)&&eventManager.off(4,on)}};toast.configure=function(on){on===void 0&&(on={}),lazy=!0,containerConfig=on};toast.POSITION=POSITION;toast.TYPE=TYPE;eventManager.on(2,function(on){latestInstance=on.containerId||on,containers.set(latestInstance,on),queue.forEach(function(In){eventManager.emit(0,In.content,In.options)}),queue=[]}).on(3,function(on){containers.delete(on.containerId||on),containers.size===0&&eventManager.off(0).off(1).off(5),canUseDom&&containerDomNode&&document.body.removeChild(containerDomNode)});const toastId$3="error";function triggerErrorNotification(on,In){const Rn=jsx$1(ToastMessage,{title:on,content:In});return toast.isActive(toastId$3)&&toast.dismiss(toastId$3),toast.error(Rn,{toastId:toastId$3,autoClose:TEN_SECONDS,closeButton:!0}),{dismiss:()=>{toast.dismiss(toastId$3)}}}const toastId$2="user-session";function triggerUserSessionExpiredNotification(on){const In=jsx$1(ToastMessage,{title:"Session Expired",content:jsx$1(UserSessionExpiredMessage,{})}),Rn=toast.warning(In,{toastId:toastId$2,autoClose:TEN_SECONDS,closeButton:!0});on.addEventListener("abort",()=>{toast.dismiss(Rn)})}function UserSessionExpiredMessage(){const[on,In]=reactExports.useState(!1);return jsxs(Fragment,{children:[jsx$1(ToastContentParagraph,{children:"Your session has been recently expired."}),jsx$1(ToastFooter,{children:jsx$1(Button,{color:"primary",disabled:on,onClick:()=>{In(!0),sendMessage({kind:RENEW_SESSION_MESSAGE})},children:"Renew Session"})})]})}const toastId$1="user-sign-in";function triggerSignInNotification(on){const In=jsx$1(ToastMessage,{title:"Signing In",content:jsx$1(UserSigningInMessage,{abortController:on})}),Rn=toast.loading(In,{toastId:toastId$1,type:"info"});on.signal.addEventListener("abort",()=>{toast.dismiss(Rn)})}function UserSigningInMessage({abortController:on}){const[In,Rn]=reactExports.useState(!1);return jsxs(Fragment,{children:[jsx$1(ToastContentParagraph,{children:"You're signing in..."}),jsx$1(ToastFooter,{children:jsx$1(Button,{color:"primary",disabled:In,onClick:()=>{Rn(!0),on.abort()},children:"Cancel"})})]})}function triggerCreateAccountNotification(){const on=jsx$1(ToastMessage,{title:"User Account Setup",content:"We're setting up your account..."});toast.update(toastId$1,{isLoading:!0,render:on,type:"info"})}function triggerCancelAccountCreationNotification(){const on=jsx$1(ToastMessage,{title:"User Account Creation Cancelled",content:"You've cancelled account creation!"});toast.update(toastId$1,{autoClose:TEN_SECONDS,closeButton:!0,isLoading:!1,render:on,type:"warning"})}function triggerLoadAccountNotification(){const on=jsx$1(ToastMessage,{title:"Loading User Account",content:"We're loading your account..."});toast.update(toastId$1,{isLoading:!0,render:on,type:"info"})}function triggerSingInCompleteNotification(){const on=jsx$1(ToastMessage,{title:"Sign In Successful",content:"You've been successfully signed in."});toast.update(toastId$1,{autoClose:TEN_SECONDS,closeButton:!0,isLoading:!1,render:on,type:"success"})}function triggerSignInCancelledNotification(){const on=jsx$1(ToastMessage,{title:"Sign In Cancelled",content:"You've successfully cancelled sign in."});toast.update(toastId$1,{autoClose:TEN_SECONDS,closeButton:!0,isLoading:!1,render:on,type:"warning"})}function triggerSignInFailedNotification(){const on=jsx$1(ToastMessage,{title:"Sign In Failed",content:"We've encountered an error while signing you in. Please refresh and try again!"});toast.update(toastId$1,{autoClose:TEN_SECONDS,closeButton:!0,isLoading:!1,render:on,type:"error"})}function triggerSignOutNotification(on){const In=jsx$1(ToastMessage,{title:"Sign Out Failed",content:"We've encountered an error while signing you out. Please refresh and try again!"}),Rn=jsx$1(ToastMessage,{title:"Signing Out",content:"You're signing out..."}),Mn=jsx$1(ToastMessage,{title:"Sign Out Successful",content:"You've been signed out successfully."});return toast.promise(on.then(()=>new Promise(Ln=>window.setTimeout(Ln,FIVE_HUNDRED_MILLISECONDS))),{error:{render:In},pending:{render:Rn},success:{render:Mn}})}const toastId="workspace";function triggerPrepareWorkspaceNotification(){const on=jsx$1(ToastMessage,{title:"Workspace Preparation",content:"We're preparing your workspace..."});toast.info(on,{toastId,isLoading:!0,type:"info"})}function triggerWorkspacePrepared(){const on=jsx$1(ToastMessage,{title:"Workspace Prepared",content:"Your workspace is prepared"});toast.update(toastId,{autoClose:TEN_SECONDS,render:on,type:"success",closeButton:!0,isLoading:!1})}function triggerWorkspacePreparationFailed(){const on=jsx$1(ToastMessage,{title:"Workspace Preparation Failed",content:"We could not prepare your workspace. Try again later."});toast.update(toastId,{autoClose:TEN_SECONDS,render:on,type:"error",closeButton:!0,isLoading:!1})}class MigrationFailedError extends Error{constructor(In,Rn,Mn){super("The migration has failed"),this.fromVersion=In,this.toVersion=Rn,this.migrationLog=Mn}}function isMigrationFailedError(on){return on instanceof MigrationFailedError}class DatabaseMigration{migrateData(In,Rn){return Promise.resolve()}}class InitialMigration extends DatabaseMigration{migrateSchema(In){In.createObjectStore("app"),In.createObjectStore("mutex",{keyPath:"resource"}),In.createObjectStore("schema",{keyPath:"endpoint"}),In.createObjectStore("schema-attachment",{keyPath:["endpoint","kind"]}),In.createObjectStore("tab",{keyPath:"workspaceId"}),In.createObjectStore("update-log",{keyPath:"id"});const Rn=In.createObjectStore("attachment",{keyPath:["itemId","kind"]}),Mn=In.createObjectStore("item",{keyPath:"id"}),Ln=In.createObjectStore("session",{keyPath:"id"}),Hn=In.createObjectStore("setting",{keyPath:"id"}),jn=In.createObjectStore("workspace",{keyPath:"id"}),Wn=In.createObjectStore("workspace-sync",{keyPath:"id"});Rn.createIndex("workspace","workspaceId"),Mn.createIndex("children","parentId"),Mn.createIndex("day",["workspaceId","day"]),Mn.createIndex("kind",["workspaceId","kind"]),Mn.createIndex("remote","remoteId",{unique:!0}),Mn.createIndex("workspace","workspaceId"),Ln.createIndex("key",["sub","tenant","issuer"],{unique:!0}),Hn.createIndex("key",["sub","apiUrl"],{unique:!0}),jn.createIndex("user",["tenant","sub","apiUrl"]),Wn.createIndex("created","created"),Wn.createIndex("workspace","item.workspaceId")}}class SchemaStatisticsMigration extends DatabaseMigration{migrateSchema(){}async migrateData(In){await In.clear("schema"),await In.clear("schema-attachment");const Rn=In.transaction("tab","readwrite");for await(const Mn of Rn.store.iterate()){const Ln=[];for(const Hn of Mn.value.tabs)Hn.kind==="api"||Hn.kind==="document"?Ln.push({...Hn,activeSchemaViewId:"reference",activeSchemaReferenceViewId:"list"}):Ln.push(Hn);await Rn.store.put({...Mn.value,tabs:Ln})}await Rn.done}}class OperationLensMigration extends DatabaseMigration{migrateSchema(){}async migrateData(In){await In.clear("schema"),await In.clear("schema-attachment")}}class TabViewStateMigration extends DatabaseMigration{migrateSchema(In){In.createObjectStore("tab-view-state",{keyPath:"id"}).createIndex("workspace","workspaceId")}async migrateData(In){const Rn=In.transaction(["tab","tab-view-state"],"readwrite"),Mn=Rn.objectStore("tab"),Ln=Rn.objectStore("tab-view-state");for await(const Hn of Mn.iterate()){const jn=[],Wn=[];for(const Yn of Hn.value.tabs){const[hi,vi]=migrateTab(Yn,Hn.value.workspaceId);jn.push(hi),vi&&Wn.push(Ln.put(vi))}Wn.push(Mn.put({...Hn.value,tabs:jn})),await Promise.all(Wn)}await Rn.done}}function migrateTab(on,In){switch(on.kind){case"api":return migrateApiTab(on,In);case"document":return migrateDocumentTab(on,In);case"environment":return[on,void 0]}}function migrateApiTab(on,In){const{activeViewId:Rn,apiKind:Mn,apiKindDraft:Ln,activeClientId:Hn,activeDeploymentId:jn,activeMonitoringViewId:Wn,activeOperation:Yn,activeResolver:hi,activeSchemaViewId:vi,activeSchemaChangelogId:gi,activeSchemaChangelogViewId:mi,activeSchemaReferenceViewId:yi,activeStage:bi,activeTransaction:Ei,metricsDateTimeRange:_i,schemaSdlEditorViewState:xi,hideDeprecatedItemsInSchemaReference:Ci,isArgumentTypeInfoCollapsed:Ai,isEnumValuesInfoCollapsed:Ii,isFieldArgumentsInfoCollapsed:Ni,isFieldReturnTypeInfoCollapsed:Pi,isSdlPreviewInfoCollapsed:Vi,...Ui}=on,Gi={id:on.id,workspaceId:In,api:{kind:Mn,kindDraft:Ln,activeViewId:Rn,activeClientId:Hn,activeDeploymentId:jn,activeMonitoringViewId:Wn,activeOperation:Yn,activeResolver:hi,activeStage:bi,activeSchemaChangelogId:gi,activeSchemaChangelogViewId:mi,activeTransaction:Ei,metricsDateTimeRange:_i},detailInfo:{isArgumentTypeInfoCollapsed:Ai,isEnumValuesInfoCollapsed:Ii,isFieldArgumentsInfoCollapsed:Ni,isFieldReturnTypeInfoCollapsed:Pi,isSdlPreviewInfoCollapsed:Vi},schema:{activeSchemaViewId:vi,activeSchemaReferenceViewId:yi,sdlEditorViewState:xi,hideDeprecatedItemsInSchemaReference:Ci}};return[Ui,Gi]}function migrateDocumentTab(on,In){const{activeViewId:Rn,activeOperation:Mn,activeOperationCompanionViewId:Ln,activeOperationsSettingsViewId:Hn,activeResponseViewId:jn,activeSchemaReferenceViewId:Wn,activeSchemaViewId:Yn,activeStage:hi,focusedElement:vi,hideDeprecatedItemsInSchemaReference:gi,isArgumentTypeInfoCollapsed:mi,isEnumValuesInfoCollapsed:yi,isFieldArgumentsInfoCollapsed:bi,isFieldReturnTypeInfoCollapsed:Ei,isOperationCompanionCollapsed:_i,isOperationsSettingsPaneCollapsed:xi,isResponseEntriesPaneCollapsed:Ci,isSdlPreviewInfoCollapsed:Ai,isSelectionPathInfoCollapsed:Ii,isTypeImplementsInfoCollapsed:Ni,isTypePossibleTypesInfoCollapsed:Pi,operationsEditorViewState:Vi,operationsSettingsPaneHeight:Ui,responseEditorViewState:Gi,responseEntriesPaneHeight:Yi,schemaSdlEditorViewState:zi,showIntrospectionFieldsInOperationBuilder:Mi,variablesEditorViewState:Li,...wi}=on,Ri={id:on.id,workspaceId:In,api:{activeStage:hi},graphqlDocument:{activeViewId:Rn,activeOperation:Mn,activeOperationsSettingsViewId:Hn,activeResponseViewId:jn,focusedElement:vi,isOperationCompanionCollapsed:_i,isOperationsSettingsPaneCollapsed:xi,isResponseEntriesPaneCollapsed:Ci,operationsEditorViewState:Vi,operationsSettingsPaneHeight:Ui,responseEditorViewState:Gi,responseEntriesPaneHeight:Yi,showIntrospectionFieldsInOperationBuilder:Mi,variablesEditorViewState:Li},detailInfo:{isArgumentTypeInfoCollapsed:!1,isEnumValuesInfoCollapsed:!1,isFieldArgumentsInfoCollapsed:!1,isFieldReturnTypeInfoCollapsed:!1,isSdlPreviewInfoCollapsed:!1,isSelectionPathInfoCollapsed:!1,isTypeImplementsInfoCollapsed:!1,isTypePossibleTypesInfoCollapsed:!1},schema:{activeSchemaViewId:"reference",activeSchemaReferenceViewId:Wn,sdlEditorViewState:zi}};return[wi,Ri]}class DocumentResponseViewMigration extends DatabaseMigration{migrateSchema(){}async migrateData(In){const Rn=In.transaction(["tab-view-state"],"readwrite"),Mn=Rn.objectStore("tab-view-state"),Ln=[];for await(const Hn of Mn.iterate()){const jn=migrateTabViewState(Hn.value);jn&&Ln.push(Mn.put(jn))}await Promise.all(Ln),await Rn.done}}function migrateTabViewState(on){if(on.graphqlDocument)return{...on,graphqlDocument:{...on.graphqlDocument,activeResponseViewId:"response",activeResponseViewFormat:"json"}}}class FusionSchemaDirectivesMigration extends DatabaseMigration{migrateSchema(){}async migrateData(In){await In.clear("schema"),await In.clear("schema-attachment")}}function createLogEntry(on,In){const Rn=now();return In?{created:Rn,message:on,details:In}:{created:Rn,message:on}}async function migrationFailed(on,In,Rn,Mn){return Rn.push(createLogEntry("Migration failed",Mn)),await on.put("update-log",{...In,logs:Rn}),"migration-failed"}async function migrationSucceeded(on,In,Rn){return Rn.push(createLogEntry("Migration succeeded")),await on.put("update-log",{...In,logs:Rn}),"migrated"}const migrations=[new InitialMigration,new SchemaStatisticsMigration,new OperationLensMigration,new TabViewStateMigration,new DocumentResponseViewMigration,new FusionSchemaDirectivesMigration];async function migrate(){const on=getDatabaseName();let In=!1,Rn=await openDB(on,void 0,{upgrade:(jn,Wn,Yn,hi)=>{In=!0,migrations[0].migrateSchema(jn,hi)}});const Mn=Rn.version;let Ln=Rn.version;In?await migrateDataAndClose(Rn,0):Rn.close();for(var Hn=Mn;Hn<migrations.length;Hn++){const{migrateSchema:jn}=migrations[Hn];Rn=await openDB(on,Hn+1,{upgrade:(Wn,Yn,hi,vi)=>jn(Wn,vi)}),Ln=Rn.version,await migrateDataAndClose(Rn,Hn)}return await setAppVersion(APP_AGENT),{newVersion:Ln,previousVersion:Mn}}async function migrateDataAndClose(on,In){const Rn=In+1,Mn={id:`upgrade-to-${Rn}`,created:now(),fromVersion:In,toVersion:Rn,logs:[]},Ln=[];try{await migrations[In].migrateData(on,Ln),await migrationSucceeded(on,Mn,Ln),on.close()}catch(Hn){throw Ln.push(createLogEntry(Hn instanceof Error?Hn.message:"unknown error")),on&&(await migrationFailed(on,Mn,Ln),on.close()),new MigrationFailedError(In,Rn,JSON.stringify(Ln,void 0,2))}}function DataMigrationProvider({children:on}){const[In,Rn]=reactExports.useState(0);return reactExports.useEffect(()=>{migrate().then(({newVersion:Mn})=>Rn(Mn))},[Rn]),In?jsx$1(DatabaseVersionContext.Provider,{value:In,children:on}):null}const DatabaseVersionContext=createNamedContext(0,"DatabaseVersion");function useDatabaseVersion(){return reactExports.useContext(DatabaseVersionContext)}var LogLevel=(on=>(on[on.error=0]="error",on[on.warning=1]="warning",on[on.info=2]="info",on))(LogLevel||{});const BASIC_LOG_ENTRY_KIND="basic";var RequestKind=(on=>(on.GRAPHQL_OPERATION="graphql-operation",on.GRAPHQL_INTROSPECTION="graphql-introspection",on.GRAPHQL_SDL_FETCH="graphql-sdl-fetch",on.GRAPHQL_SDL_PROBE="graphql-sdl-probe",on))(RequestKind||{});const HTTP_REQUEST_LOG_ENTRY_KIND="http-request",HTTP_RESPONSE_LOG_ENTRY_KIND="http-response",HTTP_RESPONSE_BODY_CHUNK_LOG_ENTRY_KIND="http-response-body-chunk",HTTP_RESPONSE_CANCELLED_LOG_ENTRY_KIND="http-response-cancelled",HTTP_RESPONSE_FAILED_LOG_ENTRY_KIND="http-response-failed",HTTP_RESPONSE_FINISHED_LOG_ENTRY_KIND="http-response-finished",SCOPE_BEGIN_LOG_ENTRY_KIND="scope-begin",SCOPE_END_LOG_ENTRY_KIND="scope-end",SUBSCRIPTION_REQUEST_STARTED_LOG_ENTRY_KIND="subscription-request-started",SUBSCRIPTION_REQUEST_PROTOCOL_LOG_ENTRY_KIND="subscription-request-protocol",SUBSCRIPTION_REQUEST_MESSAGE_LOG_ENTRY_KIND="subscription-request-message",SUBSCRIPTION_REQUEST_STOPPED_LOG_ENTRY_KIND="subscription-request-stopped";function requireLock(on,In,Rn){const Mn=FIVE_SECONDS,Ln=createId("mutex");return acquireLock(on,Ln,Mn).then(async()=>{const Hn=new TimeoutAbortController(Mn);try{const[jn]=await Promise.all([In(Hn.signal.toAbortSignal()).then(Wn=>(Hn.cancel(),Wn)),Hn.signal.toPromise()]);return jn}catch(jn){throw isTimeoutAbortError(jn)?new LockExpiredError(on):jn}finally{Hn.cancel(),await releaseLock(on)}})}async function acquireLock(on,In,Rn){for(;!await tryAcquireLock(on,In,Rn);)await delay(FIFTY_MILLISECONDS)}class LockExpiredError extends Error{constructor(In){super(`Lock for resource "${In}" has been expired`)}}async function tryGetUserSessionAndRefresh(on){const In=await getCurrentTenant();if(!In)return null;let Rn=await getUserSession(In);if(!Rn)return null;if(isSessionExpired(Rn)&&(Rn=await refreshSession(Rn),isSessionExpired(Rn)))throw new UserSessionExpiredError;return Rn}async function refreshSession(on,In){return requireLock("refresh-session",Rn);async function Rn(Mn){const Ln=Mn;let Hn=await getUserSession(on)||on;if(!isSessionExpired(Hn)&&Hn.requiresSignIn)return Hn;const jn=new Headers,Wn=new URLSearchParams;jn.append(HEADER_CONTENT_TYPE,"application/x-www-form-urlencoded"),Wn.append("client_id","d8b1d8dd-c26d-4b54-8cde-5f3c8eb054ba"),Wn.append("grant_type","refresh_token"),Wn.append("refresh_token",Hn.refreshToken);try{const Yn=await fetch(`${Hn.issuer}/connect/token`,{method:"POST",headers:jn,body:Wn,signal:Ln});if(Yn.ok){const hi=await Yn.json();if(isToken(hi))return replaceUserSession({...Hn,requiresSignIn:!1,idToken:hi.id_token,accessToken:hi.access_token,refreshToken:hi.refresh_token,expiresAt:now()+hi.expires_in*ONE_SECOND$1})}else if(Yn.status===400&&(Hn=await getUserSession(on)||on,isSessionExpired(Hn)))return replaceUserSession({...Hn,requiresSignIn:!0,lastTriedToRefresh:now()});return Hn}catch(Yn){console.error(Yn)}return Hn=await getUserSession(on)||on,isSessionExpired(Hn)?replaceUserSession({...Hn,lastTriedToRefresh:now()}):Hn}}function isToken(on){return isDictionary(on)&&"access_token"in on}class UserSessionExpiredError extends Error{constructor(){super("User session has been expired")}}async function getHttpOptions(on){const In=await tryGetUserSessionAndRefresh(),Rn=isURL(on)?on:new URL(on,In?.apiUrl??"https://api.chillicream.com").href,Mn=getHeaders(In?.accessToken);return{uri:Rn,headers:Mn}}function getHeaders(on){const In=new Headers;if(In.set("CCC-Agent",APP_AGENT),In.set("GraphQL-Agent",APP_AGENT),In.set("GraphQL-Client-Id",APP_GRAPHQL_CLIENT_ID),In.set("GraphQL-Client-Version",APP_VERSION$1),In.set("GraphQL-Defer-RFC","v2"),on)In.set("Authorization",`Bearer ${on}`);else throw new UserSessionExpiredError;return In}var RelayFeatureFlags_1,hasRequiredRelayFeatureFlags;function requireRelayFeatureFlags(){if(hasRequiredRelayFeatureFlags)return RelayFeatureFlags_1;hasRequiredRelayFeatureFlags=1;var on={ENABLE_CLIENT_EDGES:!1,ENABLE_VARIABLE_CONNECTION_KEY:!1,ENABLE_RELAY_RESOLVERS:!1,ENABLE_GETFRAGMENTIDENTIFIER_OPTIMIZATION:!1,ENABLE_FRIENDLY_QUERY_NAME_GQL_URL:!1,ENABLE_LOAD_QUERY_REQUEST_DEDUPING:!0,ENABLE_DO_NOT_WRAP_LIVE_QUERY:!1,ENABLE_NOTIFY_SUBSCRIPTION:!1,BATCH_ASYNC_MODULE_UPDATES_FN:null,ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT:!1,MAX_DATA_ID_LENGTH:null,STRING_INTERN_LEVEL:0,LOG_MISSING_RECORDS_IN_PROD:!1,ENABLE_LOOSE_SUBSCRIPTION_ATTRIBUTION:!1,ENABLE_OPERATION_TRACKER_OPTIMISTIC_UPDATES:!1,ENABLE_RELAY_OPERATION_TRACKER_SUSPENSE:!1,ENABLE_FIELD_ERROR_HANDLING:!1,ENABLE_FIELD_ERROR_HANDLING_THROW_BY_DEFAULT:!1,ENABLE_FIELD_ERROR_HANDLING_CATCH_DIRECTIVE:!1,ENABLE_SHALLOW_FREEZE_RESOLVER_VALUES:!0,ENABLE_STRICT_EQUAL_SELECTORS:!1};return RelayFeatureFlags_1=on,RelayFeatureFlags_1}var StringInterner,hasRequiredStringInterner;function requireStringInterner(){if(hasRequiredStringInterner)return StringInterner;hasRequiredStringInterner=1;var on=new Map,In=1,Rn=Hn(),Mn=" ",Ln="\v";function Hn(){for(var Yn=new Set,hi=0;hi<10;++hi)Yn.add(hi.toString());return Yn}function jn(Yn){return Yn[0]===Mn&&Rn.has(Yn[1])||Yn[0]===Ln?Ln+Yn:Yn}function Wn(Yn,hi){if(hi==null||Yn.length<hi)return jn(Yn);var vi=on.get(Yn);return vi!=null||(vi=Mn+In++,on.set(Yn,vi)),vi}return StringInterner={intern:Wn},StringInterner}var ClientID,hasRequiredClientID;function requireClientID(){if(hasRequiredClientID)return ClientID;hasRequiredClientID=1;var on=requireRelayFeatureFlags(),In=requireStringInterner(),Rn=In.intern,Mn="client:";function Ln(hi,vi,gi){var mi=on.STRING_INTERN_LEVEL<=0?hi:Rn(hi,on.MAX_DATA_ID_LENGTH),yi=mi+":"+vi;return gi!=null&&(yi+=":"+gi),yi.indexOf(Mn)!==0&&(yi=Mn+yi),yi}function Hn(hi){return hi.indexOf(Mn)===0}var jn=0;function Wn(){return"".concat(Mn,"local:").concat(jn++)}function Yn(hi,vi,gi){var mi="".concat(Mn).concat(hi,":").concat(vi);return gi!=null&&(mi+=":"+gi),mi}return ClientID={generateClientID:Ln,generateClientObjectClientID:Yn,generateUniqueClientID:Wn,isClientID:Hn},ClientID}var interopRequireDefault={exports:{}},hasRequiredInteropRequireDefault;function requireInteropRequireDefault(){return hasRequiredInteropRequireDefault||(hasRequiredInteropRequireDefault=1,function(on){function In(Rn){return Rn&&Rn.__esModule?Rn:{default:Rn}}on.exports=In,on.exports.__esModule=!0,on.exports.default=on.exports}(interopRequireDefault)),interopRequireDefault.exports}var toConsumableArray={exports:{}},arrayWithoutHoles={exports:{}},arrayLikeToArray={exports:{}},hasRequiredArrayLikeToArray;function requireArrayLikeToArray(){return hasRequiredArrayLikeToArray||(hasRequiredArrayLikeToArray=1,function(on){function In(Rn,Mn){(Mn==null||Mn>Rn.length)&&(Mn=Rn.length);for(var Ln=0,Hn=new Array(Mn);Ln<Mn;Ln++)Hn[Ln]=Rn[Ln];return Hn}on.exports=In,on.exports.__esModule=!0,on.exports.default=on.exports}(arrayLikeToArray)),arrayLikeToArray.exports}var hasRequiredArrayWithoutHoles;function requireArrayWithoutHoles(){return hasRequiredArrayWithoutHoles||(hasRequiredArrayWithoutHoles=1,function(on){var In=requireArrayLikeToArray();function Rn(Mn){if(Array.isArray(Mn))return In(Mn)}on.exports=Rn,on.exports.__esModule=!0,on.exports.default=on.exports}(arrayWithoutHoles)),arrayWithoutHoles.exports}var iterableToArray={exports:{}},hasRequiredIterableToArray;function requireIterableToArray(){return hasRequiredIterableToArray||(hasRequiredIterableToArray=1,function(on){function In(Rn){if(typeof Symbol<"u"&&Rn[Symbol.iterator]!=null||Rn["@@iterator"]!=null)return Array.from(Rn)}on.exports=In,on.exports.__esModule=!0,on.exports.default=on.exports}(iterableToArray)),iterableToArray.exports}var unsupportedIterableToArray={exports:{}},hasRequiredUnsupportedIterableToArray;function requireUnsupportedIterableToArray(){return hasRequiredUnsupportedIterableToArray||(hasRequiredUnsupportedIterableToArray=1,function(on){var In=requireArrayLikeToArray();function Rn(Mn,Ln){if(Mn){if(typeof Mn=="string")return In(Mn,Ln);var Hn=Object.prototype.toString.call(Mn).slice(8,-1);if(Hn==="Object"&&Mn.constructor&&(Hn=Mn.constructor.name),Hn==="Map"||Hn==="Set")return Array.from(Mn);if(Hn==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Hn))return In(Mn,Ln)}}on.exports=Rn,on.exports.__esModule=!0,on.exports.default=on.exports}(unsupportedIterableToArray)),unsupportedIterableToArray.exports}var nonIterableSpread={exports:{}},hasRequiredNonIterableSpread;function requireNonIterableSpread(){return hasRequiredNonIterableSpread||(hasRequiredNonIterableSpread=1,function(on){function In(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
4493
4493
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}on.exports=In,on.exports.__esModule=!0,on.exports.default=on.exports}(nonIterableSpread)),nonIterableSpread.exports}var hasRequiredToConsumableArray;function requireToConsumableArray(){return hasRequiredToConsumableArray||(hasRequiredToConsumableArray=1,function(on){var In=requireArrayWithoutHoles(),Rn=requireIterableToArray(),Mn=requireUnsupportedIterableToArray(),Ln=requireNonIterableSpread();function Hn(jn){return In(jn)||Rn(jn)||Mn(jn)||Ln()}on.exports=Hn,on.exports.__esModule=!0,on.exports.default=on.exports}(toConsumableArray)),toConsumableArray.exports}var RelayDefaultHandleKey,hasRequiredRelayDefaultHandleKey;function requireRelayDefaultHandleKey(){return hasRequiredRelayDefaultHandleKey||(hasRequiredRelayDefaultHandleKey=1,RelayDefaultHandleKey={DEFAULT_HANDLE_KEY:""}),RelayDefaultHandleKey}var browser,hasRequiredBrowser;function requireBrowser(){if(hasRequiredBrowser)return browser;hasRequiredBrowser=1;var on=function(In,Rn,Mn,Ln,Hn,jn,Wn,Yn){if(!In){var hi;if(Rn===void 0)hi=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var vi=[Mn,Ln,Hn,jn,Wn,Yn],gi=0;hi=new Error(Rn.replace(/%s/g,function(){return vi[gi++]})),hi.name="Invariant Violation"}throw hi.framesToPop=1,hi}};return browser=on,browser}var getRelayHandleKey_1,hasRequiredGetRelayHandleKey;function requireGetRelayHandleKey(){if(hasRequiredGetRelayHandleKey)return getRelayHandleKey_1;hasRequiredGetRelayHandleKey=1;var on=requireRelayDefaultHandleKey(),In=on.DEFAULT_HANDLE_KEY,Rn=requireBrowser();function Mn(Ln,Hn,jn){return Hn&&Hn!==In?"__".concat(Hn,"_").concat(Ln):(jn==null&&Rn(!1),"__".concat(jn,"_").concat(Ln))}return getRelayHandleKey_1=Mn,getRelayHandleKey_1}var RelayConcreteNode_1,hasRequiredRelayConcreteNode;function requireRelayConcreteNode(){if(hasRequiredRelayConcreteNode)return RelayConcreteNode_1;hasRequiredRelayConcreteNode=1;var on={ACTOR_CHANGE:"ActorChange",CONDITION:"Condition",CLIENT_COMPONENT:"ClientComponent",CLIENT_EDGE_TO_SERVER_OBJECT:"ClientEdgeToServerObject",CLIENT_EDGE_TO_CLIENT_OBJECT:"ClientEdgeToClientObject",CLIENT_EXTENSION:"ClientExtension",DEFER:"Defer",CONNECTION:"Connection",FRAGMENT:"Fragment",FRAGMENT_SPREAD:"FragmentSpread",INLINE_DATA_FRAGMENT_SPREAD:"InlineDataFragmentSpread",INLINE_DATA_FRAGMENT:"InlineDataFragment",INLINE_FRAGMENT:"InlineFragment",LINKED_FIELD:"LinkedField",LINKED_HANDLE:"LinkedHandle",LITERAL:"Literal",LIST_VALUE:"ListValue",LOCAL_ARGUMENT:"LocalArgument",MODULE_IMPORT:"ModuleImport",ALIASED_FRAGMENT_SPREAD:"AliasedFragmentSpread",ALIASED_INLINE_FRAGMENT_SPREAD:"AliasedInlineFragmentSpread",RELAY_RESOLVER:"RelayResolver",RELAY_LIVE_RESOLVER:"RelayLiveResolver",REQUIRED_FIELD:"RequiredField",OBJECT_VALUE:"ObjectValue",OPERATION:"Operation",REQUEST:"Request",ROOT_ARGUMENT:"RootArgument",SCALAR_FIELD:"ScalarField",SCALAR_HANDLE:"ScalarHandle",SPLIT_OPERATION:"SplitOperation",STREAM:"Stream",TYPE_DISCRIMINATOR:"TypeDiscriminator",UPDATABLE_QUERY:"UpdatableQuery",VARIABLE:"Variable"};return RelayConcreteNode_1=on,RelayConcreteNode_1}var stableCopy_1,hasRequiredStableCopy;function requireStableCopy(){if(hasRequiredStableCopy)return stableCopy_1;hasRequiredStableCopy=1;function on(In){if(!In||typeof In!="object")return In;if(Array.isArray(In))return In.map(on);for(var Rn=Object.keys(In).sort(),Mn={},Ln=0;Ln<Rn.length;Ln++)Mn[Rn[Ln]]=on(In[Rn[Ln]]);return Mn}return stableCopy_1=on,stableCopy_1}var RelayStoreUtils_1,hasRequiredRelayStoreUtils;function requireRelayStoreUtils(){if(hasRequiredRelayStoreUtils)return RelayStoreUtils_1;hasRequiredRelayStoreUtils=1;var on=requireInteropRequireDefault().default,In=on(requireToConsumableArray()),Rn=requireGetRelayHandleKey(),Mn=requireRelayConcreteNode(),Ln=requireStableCopy(),Hn=requireBrowser(),jn=Mn.VARIABLE,Wn=Mn.LITERAL,Yn=Mn.OBJECT_VALUE,hi=Mn.LIST_VALUE,vi="__errors",gi="__module_component_",mi="__module_operation_";function yi(Ui,Gi){if(Ui.kind===jn)return Ii(Ui.variableName,Gi);if(Ui.kind===Wn)return Ui.value;if(Ui.kind===Yn){var Yi={};return Ui.fields.forEach(function(Mi){Yi[Mi.name]=yi(Mi,Gi)}),Yi}else if(Ui.kind===hi){var zi=[];return Ui.items.forEach(function(Mi){Mi!=null&&zi.push(yi(Mi,Gi))}),zi}}function bi(Ui,Gi,Yi){var zi={};return Yi&&(zi[Vi.FRAGMENT_POINTER_IS_WITHIN_UNMATCHED_TYPE_REFINEMENT]=!0),Ui&&Ui.forEach(function(Mi){zi[Mi.name]=yi(Mi,Gi)}),zi}function Ei(Ui,Gi){var Yi=Ui.dynamicKey,zi=Ui.handle,Mi=Ui.key,Li=Ui.name,wi=Ui.args,Ri=Ui.filters,ki=Rn(zi,Mi,Li),Bi=null;return wi&&Ri&&wi.length!==0&&Ri.length!==0&&(Bi=wi.filter(function(Hi){return Ri.indexOf(Hi.name)>-1})),Yi&&(Bi=Bi!=null?[Yi].concat((0,In.default)(Bi)):[Yi]),Bi===null?ki:Ai(ki,bi(Bi,Gi))}function _i(Ui,Gi){if(Ui.storageKey)return Ui.storageKey;var Yi=xi(Ui),zi=Ui.name;return Yi&&Yi.length!==0?Ai(zi,bi(Yi,Gi)):zi}function xi(Ui){if(Ui.kind==="RelayResolver"||Ui.kind==="RelayLiveResolver"){var Gi;if(Ui.args==null){var Yi;return(Yi=Ui.fragment)===null||Yi===void 0?void 0:Yi.args}return((Gi=Ui.fragment)===null||Gi===void 0?void 0:Gi.args)==null?Ui.args:Ui.args.concat(Ui.fragment.args)}var zi=typeof Ui.args>"u"?void 0:Ui.args;return zi}function Ci(Ui,Gi){return Ai(Ui,Ln(Gi))}function Ai(Ui,Gi){if(!Gi)return Ui;var Yi=[];for(var zi in Gi)if(Gi.hasOwnProperty(zi)){var Mi=Gi[zi];if(Mi!=null){var Li;Yi.push(zi+":"+((Li=JSON.stringify(Mi))!==null&&Li!==void 0?Li:"undefined"))}}return Yi.length===0?Ui:Ui+"(".concat(Yi.join(","),")")}function Ii(Ui,Gi){return Gi.hasOwnProperty(Ui)||Hn(!1),Ln(Gi[Ui])}function Ni(Ui){return"".concat(gi).concat(Ui)}function Pi(Ui){return"".concat(mi).concat(Ui)}var Vi={ACTOR_IDENTIFIER_KEY:"__actorIdentifier",CLIENT_EDGE_TRAVERSAL_PATH:"__clientEdgeTraversalPath",FRAGMENTS_KEY:"__fragments",FRAGMENT_OWNER_KEY:"__fragmentOwner",FRAGMENT_POINTER_IS_WITHIN_UNMATCHED_TYPE_REFINEMENT:"$isWithinUnmatchedTypeRefinement",FRAGMENT_PROP_NAME_KEY:"__fragmentPropName",MODULE_COMPONENT_KEY:"__module_component",ERRORS_KEY:vi,ID_KEY:"__id",REF_KEY:"__ref",REFS_KEY:"__refs",ROOT_ID:"client:root",ROOT_TYPE:"__Root",TYPENAME_KEY:"__typename",INVALIDATED_AT_KEY:"__invalidated_at",RELAY_RESOLVER_VALUE_KEY:"__resolverValue",RELAY_RESOLVER_INVALIDATION_KEY:"__resolverValueMayBeInvalid",RELAY_RESOLVER_SNAPSHOT_KEY:"__resolverSnapshot",RELAY_RESOLVER_ERROR_KEY:"__resolverError",RELAY_RESOLVER_OUTPUT_TYPE_RECORD_IDS:"__resolverOutputTypeRecordIDs",formatStorageKey:Ai,getArgumentValue:yi,getArgumentValues:bi,getHandleStorageKey:Ei,getStorageKey:_i,getStableStorageKey:Ci,getModuleComponentKey:Ni,getModuleOperationKey:Pi};return RelayStoreUtils_1=Vi,RelayStoreUtils_1}var ConnectionInterface_1,hasRequiredConnectionInterface;function requireConnectionInterface(){if(hasRequiredConnectionInterface)return ConnectionInterface_1;hasRequiredConnectionInterface=1;var on={after:!0,before:!0,find:!0,first:!0,last:!0,surrounds:!0},In={CURSOR:"cursor",EDGES:"edges",END_CURSOR:"endCursor",HAS_NEXT_PAGE:"hasNextPage",HAS_PREV_PAGE:"hasPreviousPage",NODE:"node",PAGE_INFO_TYPE:"PageInfo",PAGE_INFO:"pageInfo",START_CURSOR:"startCursor"},Rn={inject:function(Ln){In=Ln},get:function(){return In},isConnectionCall:function(Ln){return on.hasOwnProperty(Ln.name)}};return ConnectionInterface_1=Rn,ConnectionInterface_1}var emptyFunction_1,hasRequiredEmptyFunction;function requireEmptyFunction(){if(hasRequiredEmptyFunction)return emptyFunction_1;hasRequiredEmptyFunction=1;function on(Rn){return function(){return Rn}}var In=function(){};return In.thatReturns=on,In.thatReturnsFalse=on(!1),In.thatReturnsTrue=on(!0),In.thatReturnsNull=on(null),In.thatReturnsThis=function(){return this},In.thatReturnsArgument=function(Rn){return Rn},emptyFunction_1=In,emptyFunction_1}var warning_1,hasRequiredWarning;function requireWarning(){if(hasRequiredWarning)return warning_1;hasRequiredWarning=1;var on=requireEmptyFunction(),In=on;return warning_1=In,warning_1}var ConnectionHandler,hasRequiredConnectionHandler;function requireConnectionHandler(){if(hasRequiredConnectionHandler)return ConnectionHandler;hasRequiredConnectionHandler=1;var on=requireClientID(),In=on.generateClientID,Rn=requireRelayStoreUtils(),Mn=Rn.getStableStorageKey,Ln=requireGetRelayHandleKey(),Hn=requireConnectionInterface(),jn=requireBrowser();requireWarning();var Wn="connection",Yn="__connection_next_edge_index";function hi(Ci,Ai){var Ii=Ci.get(Ai.dataID);if(Ii){var Ni=Hn.get(),Pi=Ni.EDGES,Vi=Ni.END_CURSOR,Ui=Ni.HAS_NEXT_PAGE,Gi=Ni.HAS_PREV_PAGE,Yi=Ni.PAGE_INFO,zi=Ni.PAGE_INFO_TYPE,Mi=Ni.START_CURSOR,Li=Ii.getLinkedRecord(Ai.fieldKey),wi=Li&&Li.getLinkedRecord(Yi);if(!Li){Ii.setValue(null,Ai.handleKey);return}var Ri=In(Ii.getDataID(),Ai.handleKey),ki=Ii.getLinkedRecord(Ai.handleKey),Bi=ki??Ci.get(Ri),Hi=Bi&&Bi.getLinkedRecord(Yi);if(Bi){ki==null&&Ii.setLinkedRecord(Bi,Ai.handleKey);var Fi=Bi,$i=Li.getLinkedRecords(Pi);$i&&($i=$i.map(function(Ea){return _i(Ci,Fi,Ea)}));var Wi=Fi.getLinkedRecords(Pi),Qi=Fi.getLinkedRecord(Yi);Fi.copyFieldsFrom(Li),Wi&&Fi.setLinkedRecords(Wi,Pi),Qi&&Fi.setLinkedRecord(Qi,Yi);var ea=[],na=Ai.args;if(Wi&&$i)if(na.after!=null){var Ji,ra=(Ji=Hi)===null||Ji===void 0?void 0:Ji.getValue(Vi),sa=wi?.getValue(Vi),la=Hi&&na.after===ra,aa=Hi&&ra===sa;if(la||aa){var ta=new Set;xi(Wi,ea,ta),xi($i,ea,ta)}else return}else if(na.before!=null)if(Hi&&na.before===Hi.getValue(Mi)){var fa=new Set;xi($i,ea,fa),xi(Wi,ea,fa)}else return;else ea=$i;else $i?ea=$i:ea=Wi;if(ea!=null&&ea!==Wi&&Fi.setLinkedRecords(ea,Pi),Hi&&wi){if(na.after==null&&na.before==null)Hi.copyFieldsFrom(wi);else if(na.before!=null||na.after==null&&na.last){Hi.setValue(!!wi.getValue(Gi),Gi);var ca=wi.getValue(Mi);typeof ca=="string"&&Hi.setValue(ca,Mi)}else if(na.after!=null||na.before==null&&na.first){Hi.setValue(!!wi.getValue(Ui),Ui);var pa=wi.getValue(Vi);typeof pa=="string"&&Hi.setValue(pa,Vi)}}}else{var Ki=Ci.create(Ri,Li.getType());Ki.setValue(0,Yn),Ki.copyFieldsFrom(Li);var ji=Li.getLinkedRecords(Pi);ji&&(ji=ji.map(function(Ea){return _i(Ci,Ki,Ea)}),Ki.setLinkedRecords(ji,Pi)),Ii.setLinkedRecord(Ki,Ai.handleKey),Hi=Ci.create(In(Ki.getDataID(),Yi),zi),Hi.setValue(!1,Ui),Hi.setValue(!1,Gi),Hi.setValue(null,Vi),Hi.setValue(null,Mi),wi&&Hi.copyFieldsFrom(wi),Ki.setLinkedRecord(Hi,Yi)}}}function vi(Ci,Ai,Ii){var Ni=Ln(Wn,Ai,null);return Ci.getLinkedRecord(Ni,Ii)}function gi(Ci,Ai,Ii){var Ni=Ln(Wn,Ai,null),Pi=Mn(Ni,Ii);return In(Ci,Pi)}function mi(Ci,Ai,Ii){var Ni=Hn.get(),Pi=Ni.CURSOR,Vi=Ni.EDGES,Ui=Ci.getLinkedRecords(Vi);if(!Ui){Ci.setLinkedRecords([Ai],Vi);return}var Gi;if(Ii==null)Gi=Ui.concat(Ai);else{Gi=[];for(var Yi=!1,zi=0;zi<Ui.length;zi++){var Mi=Ui[zi];if(Gi.push(Mi),Mi!=null){var Li=Mi.getValue(Pi);Ii===Li&&(Gi.push(Ai),Yi=!0)}}Yi||Gi.push(Ai)}Ci.setLinkedRecords(Gi,Vi)}function yi(Ci,Ai,Ii,Ni){var Pi=Hn.get(),Vi=Pi.NODE,Ui=In(Ai.getDataID(),Ii.getDataID()),Gi=Ci.get(Ui);return Gi||(Gi=Ci.create(Ui,Ni)),Gi.setLinkedRecord(Ii,Vi),Gi.getValue("cursor")==null&&Gi.setValue(null,"cursor"),Gi}function bi(Ci,Ai,Ii){var Ni=Hn.get(),Pi=Ni.CURSOR,Vi=Ni.EDGES,Ui=Ci.getLinkedRecords(Vi);if(!Ui){Ci.setLinkedRecords([Ai],Vi);return}var Gi;if(Ii==null)Gi=[Ai].concat(Ui);else{Gi=[];for(var Yi=!1,zi=0;zi<Ui.length;zi++){var Mi=Ui[zi];if(Mi!=null){var Li=Mi.getValue(Pi);Ii===Li&&(Gi.push(Ai),Yi=!0)}Gi.push(Mi)}Yi||Gi.unshift(Ai)}Ci.setLinkedRecords(Gi,Vi)}function Ei(Ci,Ai){var Ii=Hn.get(),Ni=Ii.EDGES,Pi=Ii.NODE,Vi=Ci.getLinkedRecords(Ni);if(Vi){for(var Ui,Gi=0;Gi<Vi.length;Gi++){var Yi=Vi[Gi],zi=Yi&&Yi.getLinkedRecord(Pi);zi!=null&&zi.getDataID()===Ai?Ui===void 0&&(Ui=Vi.slice(0,Gi)):Ui!==void 0&&Ui.push(Yi)}Ui!==void 0&&Ci.setLinkedRecords(Ui,Ni)}}function _i(Ci,Ai,Ii){if(Ii==null)return Ii;var Ni=Hn.get(),Pi=Ni.EDGES,Vi=Ai.getValue(Yn);typeof Vi!="number"&&jn(!1);var Ui=In(Ai.getDataID(),Pi,Vi),Gi=Ci.create(Ui,Ii.getType());return Gi.copyFieldsFrom(Ii),Gi.getValue("cursor")==null&&Gi.setValue(null,"cursor"),Ai.setValue(Vi+1,Yn),Gi}function xi(Ci,Ai,Ii){for(var Ni=Hn.get(),Pi=Ni.NODE,Vi=0;Vi<Ci.length;Vi++){var Ui=Ci[Vi];if(Ui){var Gi=Ui.getLinkedRecord(Pi),Yi=Gi&&Gi.getDataID();if(Yi){if(Ii.has(Yi))continue;Ii.add(Yi)}Ai.push(Ui)}}}return ConnectionHandler={buildConnectionEdge:_i,createEdge:yi,deleteNode:Ei,getConnection:vi,getConnectionID:gi,insertEdgeAfter:mi,insertEdgeBefore:bi,update:hi},ConnectionHandler}var createForOfIteratorHelper={exports:{}},hasRequiredCreateForOfIteratorHelper;function requireCreateForOfIteratorHelper(){return hasRequiredCreateForOfIteratorHelper||(hasRequiredCreateForOfIteratorHelper=1,function(on){var In=requireUnsupportedIterableToArray();function Rn(Mn,Ln){var Hn=typeof Symbol<"u"&&Mn[Symbol.iterator]||Mn["@@iterator"];if(!Hn){if(Array.isArray(Mn)||(Hn=In(Mn))||Ln&&Mn&&typeof Mn.length=="number"){Hn&&(Mn=Hn);var jn=0,Wn=function(){};return{s:Wn,n:function(){return jn>=Mn.length?{done:!0}:{done:!1,value:Mn[jn++]}},e:function(mi){throw mi},f:Wn}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
4494
4494
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Yn=!0,hi=!1,vi;return{s:function(){Hn=Hn.call(Mn)},n:function(){var mi=Hn.next();return Yn=mi.done,mi},e:function(mi){hi=!0,vi=mi},f:function(){try{!Yn&&Hn.return!=null&&Hn.return()}finally{if(hi)throw vi}}}}on.exports=Rn,on.exports.__esModule=!0,on.exports.default=on.exports}(createForOfIteratorHelper)),createForOfIteratorHelper.exports}var MutationHandlers,hasRequiredMutationHandlers;function requireMutationHandlers(){if(hasRequiredMutationHandlers)return MutationHandlers;hasRequiredMutationHandlers=1;var on=requireInteropRequireDefault().default,In=on(requireCreateForOfIteratorHelper()),Rn=requireConnectionHandler(),Mn=requireConnectionInterface(),Ln=requireBrowser(),Hn=requireWarning(),jn={update:function(Ei,_i){var xi=Ei.get(_i.dataID);if(xi!=null){var Ci=xi.getValue(_i.fieldKey);typeof Ci=="string"?Ei.delete(Ci):Array.isArray(Ci)&&Ci.forEach(function(Ai){typeof Ai=="string"&&Ei.delete(Ai)})}}},Wn={update:function(Ei,_i){var xi=Ei.get(_i.dataID);if(xi!=null){var Ci=_i.handleArgs.connections;Ci==null&&Ln(!1);var Ai=xi.getValue(_i.fieldKey),Ii=Array.isArray(Ai)?Ai:[Ai];Ii.forEach(function(Ni){if(typeof Ni=="string"){var Pi=(0,In.default)(Ci),Vi;try{for(Pi.s();!(Vi=Pi.n()).done;){var Ui=Vi.value,Gi=Ei.get(Ui);Gi!=null&&Rn.deleteNode(Gi,Ni)}}catch(Yi){Pi.e(Yi)}finally{Pi.f()}}})}}},Yn={update:mi(Rn.insertEdgeAfter)},hi={update:mi(Rn.insertEdgeBefore)},vi={update:yi(Rn.insertEdgeAfter)},gi={update:yi(Rn.insertEdgeBefore)};function mi(bi){return function(Ei,_i){var xi,Ci=Ei.get(_i.dataID);if(Ci!=null){var Ai=_i.handleArgs.connections;Ai==null&&Ln(!1);var Ii,Ni;try{Ii=Ci.getLinkedRecord(_i.fieldKey)}catch{}if(!Ii)try{Ni=Ci.getLinkedRecords(_i.fieldKey)}catch{}if(!(Ii==null&&Ni==null)){var Pi=Mn.get(),Vi=Pi.NODE,Ui=Pi.EDGES,Gi=(xi=Ni)!==null&&xi!==void 0?xi:[Ii],Yi=(0,In.default)(Gi),zi;try{var Mi=function(){var ki=zi.value;if(ki==null)return"continue";var Bi=ki.getLinkedRecord("node");if(!Bi)return"continue";var Hi=Bi.getDataID(),Ki=(0,In.default)(Ai),ji;try{for(Ki.s();!(ji=Ki.n()).done;){var Fi=ji.value,$i=Ei.get(Fi);if($i!=null){var Wi=(Li=$i.getLinkedRecords(Ui))===null||Li===void 0?void 0:Li.some(function(ea){var na;return(ea==null||(na=ea.getLinkedRecord(Vi))===null||na===void 0?void 0:na.getDataID())===Hi});if(!Wi){var Qi=Rn.buildConnectionEdge(Ei,$i,ki);Qi==null&&Ln(!1),bi($i,Qi)}}}}catch(ea){Ki.e(ea)}finally{Ki.f()}};for(Yi.s();!(zi=Yi.n()).done;)var Li,wi=Mi()}catch(Ri){Yi.e(Ri)}finally{Yi.f()}}}}}function yi(bi){return function(Ei,_i){var xi,Ci=Ei.get(_i.dataID);if(Ci!=null){var Ai=_i.handleArgs,Ii=Ai.connections,Ni=Ai.edgeTypeName;Ii==null&&Ln(!1),Ni==null&&Ln(!1);var Pi,Vi;try{Pi=Ci.getLinkedRecord(_i.fieldKey)}catch{}if(!Pi)try{Vi=Ci.getLinkedRecords(_i.fieldKey)}catch{}if(!(Pi==null&&Vi==null)){var Ui=Mn.get(),Gi=Ui.NODE,Yi=Ui.EDGES,zi=(xi=Vi)!==null&&xi!==void 0?xi:[Pi],Mi=(0,In.default)(zi),Li;try{var wi=function(){var Hi=Li.value;if(Hi==null)return"continue";var Ki=Hi.getDataID(),ji=(0,In.default)(Ii),Fi;try{for(ji.s();!(Fi=ji.n()).done;){var $i=Fi.value,Wi=Ei.get($i);if(Wi!=null){var Qi=(Ri=Wi.getLinkedRecords(Yi))===null||Ri===void 0?void 0:Ri.some(function(na){var Ji;return(na==null||(Ji=na.getLinkedRecord(Gi))===null||Ji===void 0?void 0:Ji.getDataID())===Ki});if(!Qi){var ea=Rn.createEdge(Ei,Wi,Hi,Ni);ea==null&&Ln(!1),bi(Wi,ea)}}}}catch(na){ji.e(na)}finally{ji.f()}};for(Mi.s();!(Li=Mi.n()).done;)var Ri,ki=wi()}catch(Bi){Mi.e(Bi)}finally{Mi.f()}}}}}return MutationHandlers={AppendEdgeHandler:Yn,DeleteRecordHandler:jn,PrependEdgeHandler:hi,AppendNodeHandler:vi,PrependNodeHandler:gi,DeleteEdgeHandler:Wn},MutationHandlers}var RelayDefaultHandlerProvider_1,hasRequiredRelayDefaultHandlerProvider;function requireRelayDefaultHandlerProvider(){if(hasRequiredRelayDefaultHandlerProvider)return RelayDefaultHandlerProvider_1;hasRequiredRelayDefaultHandlerProvider=1;var on=requireConnectionHandler(),In=requireMutationHandlers(),Rn=requireBrowser();function Mn(Ln){switch(Ln){case"connection":return on;case"deleteRecord":return In.DeleteRecordHandler;case"deleteEdge":return In.DeleteEdgeHandler;case"appendEdge":return In.AppendEdgeHandler;case"prependEdge":return In.PrependEdgeHandler;case"appendNode":return In.AppendNodeHandler;case"prependNode":return In.PrependNodeHandler}Rn(!1)}return RelayDefaultHandlerProvider_1=Mn,RelayDefaultHandlerProvider_1}var GraphQLTag,hasRequiredGraphQLTag;function requireGraphQLTag(){if(hasRequiredGraphQLTag)return GraphQLTag;hasRequiredGraphQLTag=1;var on=requireRelayConcreteNode(),In=requireBrowser();requireWarning();function Rn(bi){In(!1)}function Mn(bi){var Ei=bi;return typeof Ei=="function"?Ei=Ei():Ei.default&&(Ei=Ei.default),Ei}function Ln(bi){var Ei=Mn(bi);return typeof Ei=="object"&&Ei!==null&&Ei.kind===on.FRAGMENT}function Hn(bi){var Ei=Mn(bi);return typeof Ei=="object"&&Ei!==null&&Ei.kind===on.REQUEST}function jn(bi){var Ei=Mn(bi);return typeof Ei=="object"&&Ei!==null&&Ei.kind===on.UPDATABLE_QUERY}function Wn(bi){var Ei=Mn(bi);return typeof Ei=="object"&&Ei!==null&&Ei.kind===on.INLINE_DATA_FRAGMENT}function Yn(bi){var Ei=Mn(bi);return Ln(Ei)||In(!1),Ei}function hi(bi){var Ei,_i=Yn(bi),xi=(Ei=_i.metadata)===null||Ei===void 0?void 0:Ei.refetch,Ci=xi?.connection;return xi===null||typeof xi!="object"||Ci===null||typeof Ci!="object"?null:_i}function vi(bi){var Ei,_i=Yn(bi),xi=(Ei=_i.metadata)===null||Ei===void 0?void 0:Ei.refetch;return xi===null||typeof xi!="object"?null:_i}function gi(bi){var Ei=Mn(bi);return Hn(Ei)||In(!1),Ei}function mi(bi){var Ei=Mn(bi);return jn(Ei)||In(!1),Ei}function yi(bi){var Ei=Mn(bi);return Wn(Ei)||In(!1),Ei}return GraphQLTag={getFragment:Yn,getNode:Mn,getPaginationFragment:hi,getRefetchableFragment:vi,getRequest:gi,getUpdatableQuery:mi,getInlineDataFragment:yi,graphql:Rn,isFragment:Ln,isRequest:Hn,isUpdatableQuery:jn,isInlineDataFragment:Wn},GraphQLTag}var isRelayModernEnvironment_1,hasRequiredIsRelayModernEnvironment;function requireIsRelayModernEnvironment(){if(hasRequiredIsRelayModernEnvironment)return isRelayModernEnvironment_1;hasRequiredIsRelayModernEnvironment=1;function on(In){return!!(In&&In["@@RelayModernEnvironment"])}return isRelayModernEnvironment_1=on,isRelayModernEnvironment_1}var deepFreeze_1,hasRequiredDeepFreeze;function requireDeepFreeze(){if(hasRequiredDeepFreeze)return deepFreeze_1;hasRequiredDeepFreeze=1;function on(Rn){return In(Rn)&&(Object.freeze(Rn),Object.getOwnPropertyNames(Rn).forEach(function(Mn){var Ln=Rn[Mn];Ln&&typeof Ln=="object"&&!Object.isFrozen(Ln)&&on(Ln)})),Rn}function In(Rn){return Rn!=null&&(Array.isArray(Rn)||typeof Rn=="object"&&Rn.constructor===Object)}return deepFreeze_1=on,deepFreeze_1}var getRequestIdentifier_1,hasRequiredGetRequestIdentifier;function requireGetRequestIdentifier(){if(hasRequiredGetRequestIdentifier)return getRequestIdentifier_1;hasRequiredGetRequestIdentifier=1;var on=requireStableCopy(),In=requireBrowser();function Rn(Mn,Ln){var Hn=Mn.cacheID!=null?Mn.cacheID:Mn.id;return Hn==null&&In(!1),Hn+JSON.stringify(on(Ln))}return getRequestIdentifier_1=Rn,getRequestIdentifier_1}var objectSpread2={exports:{}},defineProperty={exports:{}},toPropertyKey={exports:{}},_typeof={exports:{}},hasRequired_typeof;function require_typeof(){return hasRequired_typeof||(hasRequired_typeof=1,function(on){function In(Rn){"@babel/helpers - typeof";return on.exports=In=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Mn){return typeof Mn}:function(Mn){return Mn&&typeof Symbol=="function"&&Mn.constructor===Symbol&&Mn!==Symbol.prototype?"symbol":typeof Mn},on.exports.__esModule=!0,on.exports.default=on.exports,In(Rn)}on.exports=In,on.exports.__esModule=!0,on.exports.default=on.exports}(_typeof)),_typeof.exports}var toPrimitive={exports:{}},hasRequiredToPrimitive;function requireToPrimitive(){return hasRequiredToPrimitive||(hasRequiredToPrimitive=1,function(on){var In=require_typeof().default;function Rn(Mn,Ln){if(In(Mn)!="object"||!Mn)return Mn;var Hn=Mn[Symbol.toPrimitive];if(Hn!==void 0){var jn=Hn.call(Mn,Ln||"default");if(In(jn)!="object")return jn;throw new TypeError("@@toPrimitive must return a primitive value.")}return(Ln==="string"?String:Number)(Mn)}on.exports=Rn,on.exports.__esModule=!0,on.exports.default=on.exports}(toPrimitive)),toPrimitive.exports}var hasRequiredToPropertyKey;function requireToPropertyKey(){return hasRequiredToPropertyKey||(hasRequiredToPropertyKey=1,function(on){var In=require_typeof().default,Rn=requireToPrimitive();function Mn(Ln){var Hn=Rn(Ln,"string");return In(Hn)=="symbol"?Hn:Hn+""}on.exports=Mn,on.exports.__esModule=!0,on.exports.default=on.exports}(toPropertyKey)),toPropertyKey.exports}var hasRequiredDefineProperty;function requireDefineProperty(){return hasRequiredDefineProperty||(hasRequiredDefineProperty=1,function(on){var In=requireToPropertyKey();function Rn(Mn,Ln,Hn){return Ln=In(Ln),Ln in Mn?Object.defineProperty(Mn,Ln,{value:Hn,enumerable:!0,configurable:!0,writable:!0}):Mn[Ln]=Hn,Mn}on.exports=Rn,on.exports.__esModule=!0,on.exports.default=on.exports}(defineProperty)),defineProperty.exports}var hasRequiredObjectSpread2;function requireObjectSpread2(){return hasRequiredObjectSpread2||(hasRequiredObjectSpread2=1,function(on){var In=requireDefineProperty();function Rn(Ln,Hn){var jn=Object.keys(Ln);if(Object.getOwnPropertySymbols){var Wn=Object.getOwnPropertySymbols(Ln);Hn&&(Wn=Wn.filter(function(Yn){return Object.getOwnPropertyDescriptor(Ln,Yn).enumerable})),jn.push.apply(jn,Wn)}return jn}function Mn(Ln){for(var Hn=1;Hn<arguments.length;Hn++){var jn=arguments[Hn]!=null?arguments[Hn]:{};Hn%2?Rn(Object(jn),!0).forEach(function(Wn){In(Ln,Wn,jn[Wn])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Ln,Object.getOwnPropertyDescriptors(jn)):Rn(Object(jn)).forEach(function(Wn){Object.defineProperty(Ln,Wn,Object.getOwnPropertyDescriptor(jn,Wn))})}return Ln}on.exports=Mn,on.exports.__esModule=!0,on.exports.default=on.exports}(objectSpread2)),objectSpread2.exports}var RelayConcreteVariables,hasRequiredRelayConcreteVariables;function requireRelayConcreteVariables(){if(hasRequiredRelayConcreteVariables)return RelayConcreteVariables;hasRequiredRelayConcreteVariables=1;var on=requireInteropRequireDefault().default,In=on(requireObjectSpread2()),Rn=requireRelayStoreUtils(),Mn=Rn.getArgumentValues,Ln=requireBrowser();function Hn(Yn,hi,vi){if(Yn.argumentDefinitions==null)return vi;var gi;return Yn.argumentDefinitions.forEach(function(mi){if(!vi.hasOwnProperty(mi.name))switch(gi=gi||(0,In.default)({},vi),mi.kind){case"LocalArgument":gi[mi.name]=mi.defaultValue;break;case"RootArgument":if(!hi.hasOwnProperty(mi.name)){gi[mi.name]=void 0;break}gi[mi.name]=hi[mi.name];break;default:Ln(!1)}}),gi||vi}function jn(Yn,hi,vi){var gi={};return Yn.argumentDefinitions.forEach(function(mi){var yi=mi.defaultValue;vi[mi.name]!=null&&(yi=vi[mi.name]),gi[mi.name]=yi}),hi!=null&&Object.keys(hi).forEach(function(mi){gi[mi]=hi[mi].get()}),gi}function Wn(Yn,hi,vi){if(hi==null)return Yn;var gi=(0,In.default)({},Yn),mi=vi?Mn(vi,Yn):{};return hi.forEach(function(yi){var bi,Ei=(bi=mi[yi.name])!==null&&bi!==void 0?bi:yi.defaultValue;gi[yi.name]=Ei}),gi}return RelayConcreteVariables={getLocalVariables:Wn,getFragmentVariables:Hn,getOperationVariables:jn},RelayConcreteVariables}var areEqual_1,hasRequiredAreEqual;function requireAreEqual(){if(hasRequiredAreEqual)return areEqual_1;hasRequiredAreEqual=1;var on=[],In=[];/**
|
|
4495
4495
|
* Checks if two values are equal. Values may be primitives, arrays, or objects.
|
|
@@ -4720,8 +4720,8 @@ ${In.join(`
|
|
|
4720
4720
|
}
|
|
4721
4721
|
}
|
|
4722
4722
|
}
|
|
4723
|
-
`,_gql_doc={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"IntrospectionQuery"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__type"},arguments:[{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"StringValue",value:"__Type",block:!1}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"fields"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:137,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:_gql_source}}};print(_gql_doc$3);print(_gql_doc$2);print(_gql_doc$1);print(_gql_doc);const SERVER_NOT_REACHABLE="Server Not Reachable";function isServerNotReachableError(on){return isDictionary(on)&&"message"in on&&on.message===SERVER_NOT_REACHABLE}class SchedulerClientBase extends MessageObserver{constructor(In){super(),this.createWorker=In}#e;#t;#r=!0;#n;#i=0;getContext(){if(!this.#e){const In=this.createWorker(),Rn={sendMessage:Mn=>In.postMessage(Mn)};In.onmessage=({data:Mn})=>{this.handleMessage(Rn,Mn)},this.#t=In,this.#e=Rn,this.#n=this.registerReceiveMessageHandler("scheduler-status-updated",({payload:{idling:Mn,lastUpdated:Ln}})=>{this.#r=Mn,this.#i=Ln}),this.checkIfIdle(),this.initializeWorker()}return this.#e}checkIfIdle(){const In=()=>{if(this.#t&&this.#r&&document.hidden&&now()-this.#i>TWO_MINUTES){this.stopWorker();return}this.checkIfIdle()};window.setTimeout(In,THIRTY_SECONDS)}initializeWorker(){this.sendMessage(new Message(INITIALIZE_WORKER_MESSAGE_TYPE,{appNamespace:window.appNamespace}))}stopWorker(){this.#t?.terminate(),this.#n?.(),this.#n=void 0,this.#t=void 0,this.#e=void 0}cancelTask(In){this.sendMessage(new Message(CANCEL_TASK_MESSAGE_TYPE,{taskId:In}))}}const DOCUMENT_ANALYSIS_MESSAGE_TYPE="analyze-document",DOCUMENT_OPERATIONS_ANALYSIS_MESSAGE_TYPE="analyze-document-operations",FILES_UPDATED_MESSAGE_TYPE="files-updated",VARIABLE_JSON_SCHEMA_UPDATED_MESSAGE_TYPE="variable-json-schema-updated";var backo2,hasRequiredBacko2;function requireBacko2(){if(hasRequiredBacko2)return backo2;hasRequiredBacko2=1,backo2=on;function on(In){In=In||{},this.ms=In.min||100,this.max=In.max||1e4,this.factor=In.factor||2,this.jitter=In.jitter>0&&In.jitter<=1?In.jitter:0,this.attempts=0}return on.prototype.duration=function(){var In=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var Rn=Math.random(),Mn=Math.floor(Rn*this.jitter*In);In=(Math.floor(Rn*10)&1)==0?In-Mn:In+Mn}return Math.min(In,this.max)|0},on.prototype.reset=function(){this.attempts=0},on.prototype.setMin=function(In){this.ms=In},on.prototype.setMax=function(In){this.max=In},on.prototype.setJitter=function(In){this.jitter=In},backo2}requireBacko2();var eventemitter3={exports:{}},hasRequiredEventemitter3;function requireEventemitter3(){return hasRequiredEventemitter3||(hasRequiredEventemitter3=1,function(on){var In=Object.prototype.hasOwnProperty,Rn="~";function Mn(){}Object.create&&(Mn.prototype=Object.create(null),new Mn().__proto__||(Rn=!1));function Ln(Yn,hi,vi){this.fn=Yn,this.context=hi,this.once=vi||!1}function Hn(Yn,hi,vi,gi,mi){if(typeof vi!="function")throw new TypeError("The listener must be a function");var yi=new Ln(vi,gi||Yn,mi),bi=Rn?Rn+hi:hi;return Yn._events[bi]?Yn._events[bi].fn?Yn._events[bi]=[Yn._events[bi],yi]:Yn._events[bi].push(yi):(Yn._events[bi]=yi,Yn._eventsCount++),Yn}function jn(Yn,hi){--Yn._eventsCount===0?Yn._events=new Mn:delete Yn._events[hi]}function Wn(){this._events=new Mn,this._eventsCount=0}Wn.prototype.eventNames=function(){var hi=[],vi,gi;if(this._eventsCount===0)return hi;for(gi in vi=this._events)In.call(vi,gi)&&hi.push(Rn?gi.slice(1):gi);return Object.getOwnPropertySymbols?hi.concat(Object.getOwnPropertySymbols(vi)):hi},Wn.prototype.listeners=function(hi){var vi=Rn?Rn+hi:hi,gi=this._events[vi];if(!gi)return[];if(gi.fn)return[gi.fn];for(var mi=0,yi=gi.length,bi=new Array(yi);mi<yi;mi++)bi[mi]=gi[mi].fn;return bi},Wn.prototype.listenerCount=function(hi){var vi=Rn?Rn+hi:hi,gi=this._events[vi];return gi?gi.fn?1:gi.length:0},Wn.prototype.emit=function(hi,vi,gi,mi,yi,bi){var Ei=Rn?Rn+hi:hi;if(!this._events[Ei])return!1;var _i=this._events[Ei],xi=arguments.length,Ci,Ai;if(_i.fn){switch(_i.once&&this.removeListener(hi,_i.fn,void 0,!0),xi){case 1:return _i.fn.call(_i.context),!0;case 2:return _i.fn.call(_i.context,vi),!0;case 3:return _i.fn.call(_i.context,vi,gi),!0;case 4:return _i.fn.call(_i.context,vi,gi,mi),!0;case 5:return _i.fn.call(_i.context,vi,gi,mi,yi),!0;case 6:return _i.fn.call(_i.context,vi,gi,mi,yi,bi),!0}for(Ai=1,Ci=new Array(xi-1);Ai<xi;Ai++)Ci[Ai-1]=arguments[Ai];_i.fn.apply(_i.context,Ci)}else{var Ii=_i.length,Ni;for(Ai=0;Ai<Ii;Ai++)switch(_i[Ai].once&&this.removeListener(hi,_i[Ai].fn,void 0,!0),xi){case 1:_i[Ai].fn.call(_i[Ai].context);break;case 2:_i[Ai].fn.call(_i[Ai].context,vi);break;case 3:_i[Ai].fn.call(_i[Ai].context,vi,gi);break;case 4:_i[Ai].fn.call(_i[Ai].context,vi,gi,mi);break;default:if(!Ci)for(Ni=1,Ci=new Array(xi-1);Ni<xi;Ni++)Ci[Ni-1]=arguments[Ni];_i[Ai].fn.apply(_i[Ai].context,Ci)}}return!0},Wn.prototype.on=function(hi,vi,gi){return Hn(this,hi,vi,gi,!1)},Wn.prototype.once=function(hi,vi,gi){return Hn(this,hi,vi,gi,!0)},Wn.prototype.removeListener=function(hi,vi,gi,mi){var yi=Rn?Rn+hi:hi;if(!this._events[yi])return this;if(!vi)return jn(this,yi),this;var bi=this._events[yi];if(bi.fn)bi.fn===vi&&(!mi||bi.once)&&(!gi||bi.context===gi)&&jn(this,yi);else{for(var Ei=0,_i=[],xi=bi.length;Ei<xi;Ei++)(bi[Ei].fn!==vi||mi&&!bi[Ei].once||gi&&bi[Ei].context!==gi)&&_i.push(bi[Ei]);_i.length?this._events[yi]=_i.length===1?_i[0]:_i:jn(this,yi)}return this},Wn.prototype.removeAllListeners=function(hi){var vi;return hi?(vi=Rn?Rn+hi:hi,this._events[vi]&&jn(this,vi)):(this._events=new Mn,this._eventsCount=0),this},Wn.prototype.off=Wn.prototype.removeListener,Wn.prototype.addListener=Wn.prototype.on,Wn.prefixed=Rn,Wn.EventEmitter=Wn,on.exports=Wn}(eventemitter3)),eventemitter3.exports}requireEventemitter3();var defaults={},hasRequiredDefaults;function requireDefaults(){if(hasRequiredDefaults)return defaults;hasRequiredDefaults=1,Object.defineProperty(defaults,"__esModule",{value:!0}),defaults.WS_TIMEOUT=defaults.MIN_WS_TIMEOUT=void 0;var on=1e3;defaults.MIN_WS_TIMEOUT=on;var In=3e4;return defaults.WS_TIMEOUT=In,defaults}requireDefaults();var messageTypes={},hasRequiredMessageTypes;function requireMessageTypes(){if(hasRequiredMessageTypes)return messageTypes;hasRequiredMessageTypes=1,Object.defineProperty(messageTypes,"__esModule",{value:!0});var on=function(){function In(){throw new Error("Static Class")}return In.GQL_CONNECTION_INIT="connection_init",In.GQL_CONNECTION_ACK="connection_ack",In.GQL_CONNECTION_ERROR="connection_error",In.GQL_CONNECTION_KEEP_ALIVE="ka",In.GQL_CONNECTION_TERMINATE="connection_terminate",In.GQL_START="start",In.GQL_DATA="data",In.GQL_ERROR="error",In.GQL_COMPLETE="complete",In.GQL_STOP="stop",In.SUBSCRIPTION_START="subscription_start",In.SUBSCRIPTION_DATA="subscription_data",In.SUBSCRIPTION_SUCCESS="subscription_success",In.SUBSCRIPTION_FAIL="subscription_fail",In.SUBSCRIPTION_END="subscription_end",In.INIT="init",In.INIT_SUCCESS="init_success",In.INIT_FAIL="init_fail",In.KEEP_ALIVE="keepalive",In}();return messageTypes.default=on,messageTypes}requireMessageTypes();var protocol={},hasRequiredProtocol;function requireProtocol(){if(hasRequiredProtocol)return protocol;hasRequiredProtocol=1,Object.defineProperty(protocol,"__esModule",{value:!0}),protocol.GRAPHQL_SUBSCRIPTIONS=protocol.GRAPHQL_WS=void 0;var on="graphql-ws";protocol.GRAPHQL_WS=on;var In="graphql-subscriptions";return protocol.GRAPHQL_SUBSCRIPTIONS=In,protocol}requireProtocol();var isObject$1={},hasRequiredIsObject;function requireIsObject(){if(hasRequiredIsObject)return isObject$1;hasRequiredIsObject=1,Object.defineProperty(isObject$1,"__esModule",{value:!0});function on(In){return In!==null&&typeof In=="object"}return isObject$1.default=on,isObject$1}requireIsObject();var isString$1={},hasRequiredIsString;function requireIsString(){if(hasRequiredIsString)return isString$1;hasRequiredIsString=1,Object.defineProperty(isString$1,"__esModule",{value:!0});function on(In){return typeof In=="string"}return isString$1.default=on,isString$1}requireIsString();function symbolObservablePonyfill(on){var In,Rn=on.Symbol;return typeof Rn=="function"?Rn.observable?In=Rn.observable:(In=Rn("observable"),Rn.observable=In):In="@@observable",In}var root;typeof self<"u"?root=self:typeof window<"u"?root=window:typeof global$1<"u"?root=global$1:typeof module<"u"?root=module:root=Function("return this")();symbolObservablePonyfill(root);const _global=typeof global$1<"u"?global$1:typeof window<"u"?window:{};_global.WebSocket||_global.MozWebSocket;const EXECUTE_OPERATION_REQUEST_MESSAGE_TYPE="execute-operation",DEFAULT_SCHEMA_INFO={endpoint:"",exists:!1,hash:"",indexed:!1,hasMutationType:!1,hasSubscriptionType:!1,hasUploadType:!1},CANCEL_OPERATION_REQUEST_MESSAGE_TYPE="cancel-request",SCHEMA_API_FETCHER_MESSAGE_TYPE="fetch-api-schema",FETCH_SCHEMA_DIRECTIVE="fetch-directive",FETCH_SCHEMA_DIRECTIVES="fetch-directives",SCHEMA_FETCHER_CACHED_MESSAGE_TYPE="get-cached-schema",SCHEMA_FETCHER_MESSAGE_TYPE="fetch-schema",FETCH_SCHEMA_FIELD_TYPE="fetch-field",FETCH_SCHEMA_FIELD_TYPES="fetch-fields",FETCH_SCHEMA_FIELDS_AND_TYPES="fetch-fields-and-types",FETCH_SCHEMA_REFERENCE="fetch-schema-reference",FETCH_SCHEMA_ROOT_TYPES="fetch-schema-root-types",FETCH_SCHEMA_TYPE="fetch-type",FETCH_SCHEMA_TYPES="fetch-types";class GraphQLEngineSchedulerClient extends SchedulerClientBase{analyzeDocument(In,Rn){return this.sendAndReceiveMessage(new Message(DOCUMENT_ANALYSIS_MESSAGE_TYPE,{documentId:In}),!1,Rn)}analyzeDocumentOperations(In,Rn){return this.sendAndReceiveMessage(new Message(DOCUMENT_OPERATIONS_ANALYSIS_MESSAGE_TYPE,{documentId:In}),!1,Rn)}cancelRequest(In){this.sendMessage(new Message(CANCEL_OPERATION_REQUEST_MESSAGE_TYPE,{documentId:In}))}executeOperation(In,Rn,Mn,Ln){this.sendMessage(new Message(EXECUTE_OPERATION_REQUEST_MESSAGE_TYPE,{documentId:In,workspaceId:Rn,environmentId:Mn,operationIndex:Ln}))}filesUpdated(In){this.sendMessage(new Message(FILES_UPDATED_MESSAGE_TYPE,{documentId:In}))}fetchSchema(In,Rn,Mn){return this.sendAndReceiveMessage(new Message(SCHEMA_FETCHER_MESSAGE_TYPE,{documentId:In,environmentId:Rn}),!1,Mn)}fetchApiSchema(In,Rn,Mn){return this.sendAndReceiveMessage(new Message(SCHEMA_API_FETCHER_MESSAGE_TYPE,{apiId:In,stageId:Rn}),!1,Mn)}getCachedSchema(In,Rn){return this.sendAndReceiveMessage(new Message(SCHEMA_FETCHER_CACHED_MESSAGE_TYPE,{documentId:In,environmentId:Rn}))}getDirective(In,Rn){return this.sendAndReceiveMessage(new Message(FETCH_SCHEMA_DIRECTIVE,{schemaEndpoint:In,coordinate:Rn}))}getDirectives(In){return this.sendAndReceiveMessage(new Message(FETCH_SCHEMA_DIRECTIVES,{schemaEndpoint:In}))}getField(In,Rn){return this.sendAndReceiveMessage(new Message(FETCH_SCHEMA_FIELD_TYPE,{schemaEndpoint:In,coordinate:Rn}))}getFields(In,Rn,Mn){return this.sendAndReceiveMessage(new Message(FETCH_SCHEMA_FIELD_TYPES,{schemaEndpoint:In,typeName:Rn,options:Mn}))}getFieldsAndTypes(In,Rn,Mn){return this.sendAndReceiveMessage(new Message(FETCH_SCHEMA_FIELDS_AND_TYPES,{schemaEndpoint:In,coordinate:Rn,options:Mn}))}getRootTypes(In,Rn){return this.sendAndReceiveMessage(new Message(FETCH_SCHEMA_ROOT_TYPES,{schemaEndpoint:In,filter:Rn}))}getSchemaReference(In,Rn,Mn){return this.sendAndReceiveMessage(new Message(FETCH_SCHEMA_REFERENCE,{schemaEndpoint:In,typeCategory:Rn,filter:Mn}))}getType(In,Rn){return this.sendAndReceiveMessage(new Message(FETCH_SCHEMA_TYPE,{schemaEndpoint:In,typeName:Rn}))}getTypes(In,Rn){return this.sendAndReceiveMessage(new Message(FETCH_SCHEMA_TYPES,{schemaEndpoint:In,filter:Rn}))}onReceiveOperationRequestStatus(In){return this.registerReceiveMessageHandler(OPERATION_REQUEST_STATUS_MESSAGE_TYPE,({payload:Rn})=>In(Rn))}onReceiveHistoryEntry(In){return this.registerReceiveMessageHandler(HISTORY_ENTRY_MESSAGE_TYPE,({payload:Rn})=>{In(Rn)})}onReceiveLogEntry(In){return this.registerReceiveMessageHandler(LOG_ENTRY_MESSAGE_TYPE,({payload:Rn})=>{In(Rn)})}onReceiveResult(In){return this.registerReceiveMessageHandler(OPERATION_RESULT_MESSAGE_TYPE,({payload:{documentId:Rn,result:Mn}})=>{In(Rn,Mn)})}onReceiveResultMessage(In){return this.registerReceiveMessageHandler(OPERATION_RESULT_EVENT_MESSAGE_TYPE,({payload:{documentId:Rn,resultId:Mn,event:Ln}})=>{In(Rn,Mn,Ln)})}onReceiveResultPatch(In){return this.registerReceiveMessageHandler(OPERATION_RESULT_PATCH_MESSAGE_TYPE,({payload:{documentId:Rn,resultId:Mn,patch:Ln}})=>{In(Rn,Mn,Ln)})}onReceiveVariableBatchingResult(In){return this.registerReceiveMessageHandler(OPERATION_VARIABLE_BATCHING_RESULT_MESSAGE_TYPE,({payload:{documentId:Rn,resultId:Mn,result:Ln}})=>{In(Rn,Mn,Ln)})}onVariableJsonSchemaUpdated(In){return this.registerReceiveMessageHandler(VARIABLE_JSON_SCHEMA_UPDATED_MESSAGE_TYPE,({payload:{documentId:Rn,variableJsonSchemaHash:Mn}})=>{In(Rn,Mn)})}}const INDEX_SCHEMA_MESSAGE_TYPE="index-schema",SCHEMA_INDEXED_MESSAGE_TYPE="schema-indexed";class GraphQLIndexerSchedulerClient extends SchedulerClientBase{indexSchema(In,Rn,Mn){this.sendMessage(new Message(INDEX_SCHEMA_MESSAGE_TYPE,{schemaEndpoint:In,schemaHash:Rn,schemaUpdatedAt:Mn}))}onSchemaIndexed(In){return this.registerReceiveMessageHandler(SCHEMA_INDEXED_MESSAGE_TYPE,({payload:Rn})=>{In(Rn)})}}function WorkerWrapper$6(on){return new Worker(""+new URL("graphql-engine-scheduler.3bb3e100.DVQyu7AR.js",import.meta.url).href,{type:"module",name:on?.name})}function WorkerWrapper$5(on){return new Worker(""+new URL("graphql-indexer-scheduler.3bb3e100.CqhPLZWs.js",import.meta.url).href,{type:"module",name:on?.name})}function WorkerWrapper$4(on){return new Worker(""+new URL("session-scheduler.3bb3e100.CwqEb4vy.js",import.meta.url).href,{type:"module",name:on?.name})}const CREATE_USER_ACCOUNT_MESSAGE_TYPE="create-user-account";function createCreateUserAccountMessage(){return new Message(CREATE_USER_ACCOUNT_MESSAGE_TYPE,{})}const CREATE_WORKSPACE_TASK_TYPE="create-workspace-task";function createCreateWorkspaceMessage(on,In){return new Message(CREATE_WORKSPACE_TASK_TYPE,{userSession:on,workspaceName:In})}const DELETE_API_TASK_TYPE="delete-api-task";function createDeleteApiMessage(on){return new Message(DELETE_API_TASK_TYPE,{apiId:on})}const ORGANIZATION_INFO_FETCHER_MESSAGE_TYPE="fetch-organization-info";function createOrganizationInfoMessage(){return new Message(ORGANIZATION_INFO_FETCHER_MESSAGE_TYPE,void 0)}const SETTINGS_FETCHER_MESSAGE_TYPE="fetch-settings";function createFetchSettingsMessage(){return new Message(SETTINGS_FETCHER_MESSAGE_TYPE,void 0)}const FETCH_WORKSPACES_TASK_TYPE="fetch-workspaces-task-type";function createFetchWorkspacesMessage(on){return new Message(FETCH_WORKSPACES_TASK_TYPE,{userSession:on})}const PERSIST_THEME_SETTINGS_MESSAGE_TYPE="persist-theme-settings";function createPersistThemeSettingsMessage(on){return new Message(PERSIST_THEME_SETTINGS_MESSAGE_TYPE,on)}const REFRESH_TOKEN_MESSAGE_TYPE="refresh-token";function createRefreshTokenMessage(on){return new Message(REFRESH_TOKEN_MESSAGE_TYPE,{tenantInfo:on})}const UPDATE_FEATURE_FLAGS_MESSAGE_TYPE="update-feature-flags";function createUpdateFeatureFlagsMessage(on){return new Message(UPDATE_FEATURE_FLAGS_MESSAGE_TYPE,{featureFlags:on})}const USER_ACCOUNT_FETCHER_MESSAGE_TYPE="fetch-user-account";function createUserAccountMessage(){return new Message(USER_ACCOUNT_FETCHER_MESSAGE_TYPE,void 0)}const WORKSPACE_SYNCHRONIZATION_MESSAGE_TYPE="synchronize-workspace",WORKSPACE_SYNCHRONIZATION_PROGRESS_MESSAGE_TYPE="synchronize-workspace-progress";function createSynchronizeWorkspaceMessage(on,In){return new Message(WORKSPACE_SYNCHRONIZATION_MESSAGE_TYPE,{workspaceId:on,version:In})}const UPDATE_PREFERENCES_MESSAGE_TYPE="update-preferences";function createUpdatePreferencesMessage(on){return new Message(UPDATE_PREFERENCES_MESSAGE_TYPE,{preferences:on})}class SessionSchedulerClient extends SchedulerClientBase{fetchOrganizationInfo(In){return this.sendAndReceiveMessage(createOrganizationInfoMessage(),!1,In)}fetchUserAccount(In){return this.sendAndReceiveMessage(createUserAccountMessage(),!1,In)}createUserAccount(In){return this.sendAndReceiveMessage(createCreateUserAccountMessage(),!1,In)}refreshToken(In,Rn){return this.sendAndReceiveMessage(createRefreshTokenMessage(In),!1,Rn)}fetchSettings(In){return this.sendAndReceiveMessage(createFetchSettingsMessage(),!1,In)}persistThemeSettings(In){this.sendMessage(createPersistThemeSettingsMessage(In))}fetchWorkspaces(In,Rn){return this.sendAndReceiveMessage(createFetchWorkspacesMessage(In),!1,Rn)}createWorkspace(In,Rn,Mn){return this.sendAndReceiveMessage(createCreateWorkspaceMessage(In,Rn),!1,Mn)}synchronizeWorkspace(In,Rn,Mn){return this.sendAndReceiveMessage(createSynchronizeWorkspaceMessage(In,Rn),!1,Mn)}updateFeatureFlags(In,Rn){return this.sendAndReceiveMessage(createUpdateFeatureFlagsMessage(In),!1,Rn)}updatePreferences(In,Rn){return this.sendAndReceiveMessage(createUpdatePreferencesMessage(In),!1,Rn)}deleteApi(In,Rn){return this.sendAndReceiveMessage(createDeleteApiMessage(In),!1,Rn)}onReceiveLogEntry(In){return this.registerReceiveMessageHandler(LOG_ENTRY_MESSAGE_TYPE,({payload:Rn})=>In(Rn))}onReceiveUserSessionExpired(In){return this.registerReceiveMessageHandler(USER_SESSION_EXPIRED_MESSAGE_TYPE,()=>In())}onReceiveWorkspaceSynchronizationProgress(In){return this.registerReceiveMessageHandler(WORKSPACE_SYNCHRONIZATION_PROGRESS_MESSAGE_TYPE,({payload:Rn})=>In(Rn))}}const graphQLEngineSchedulerClient=new GraphQLEngineSchedulerClient(()=>new WorkerWrapper$6({name:"graphql-engine"})),graphQLIndexerSchedulerClient=new GraphQLIndexerSchedulerClient(()=>new WorkerWrapper$5({name:"graphql-indexer"})),sessionSchedulerClient=new SessionSchedulerClient(()=>new WorkerWrapper$4({name:"session"}));class ServiceProvider{#e=new Map;#t;#r=null;constructor(In,Rn){this.#t=new Map(In.map(([Mn,Ln,Hn])=>[Mn,{create:Ln,dependencies:Hn}])),this.#r=Rn??null}get parent(){return this.#r}getService(In){let Rn=this,Mn=this.#e.get(In)??null;if(Mn)return Mn;const Ln=this.#t.get(In);if(!Ln){for(;!Mn&&(Rn=Rn.parent);)Mn=Rn.getService(In);return Mn}if(Mn=Ln.create(Rn)??null,Mn&&(this.#e.set(In,Mn),Ln.dependencies))for(const Hn of Ln.dependencies)this.getService(Hn);return Mn}getRequiredService(In){const Rn=this.getService(In);if(!Rn)throw new Error(`Service "${In}" not found!`);return Rn}[Symbol.dispose](){this.#e.forEach(In=>{isDisposable(In)&&In[Symbol.dispose]()}),this.#e.clear()}}function ServiceDependencyProvider({children:on,services:In}){const Rn=useServiceProvider(),Mn=useRefWithInitializer(()=>new ServiceProvider(In,Rn));return reactExports.useEffect(()=>()=>Mn.current[Symbol.dispose](),[Mn]),jsx$1(ServiceProviderContext.Provider,{value:Mn.current,children:on})}const ServiceProviderContext=createNamedContext(null,ServiceProvider.name);function useServiceProvider(){return reactExports.useContext(ServiceProviderContext)}function useRequiredService(on){const In=useServiceProvider();if(!In)throw new Error("Provider undefined!");return In.getRequiredService(on)}var ItemChangeAction=(on=>(on.LOAD="load",on.LOAD_DEPENDENCY="load-dependency",on.UNLOAD="unload",on.UPDATE="update",on.SAVE="save",on))(ItemChangeAction||{});const ALL_LISTENER_NAME$1="all";class ItemStore{#e=new LifecycleCache({lru:!1});#t=new Map;#r;#n=new Map;constructor(){this.#r=[registerReceiveMessage(ACTIVATED_WORKSPACE_MESSAGE,({workspaceId:In})=>{this.#e.forEach(Rn=>{Rn.workspaceId!==In&&this.unloadItem(Rn.id)})}),registerReceiveMessage(DELETED_ITEMS_MESSAGE,({deletedItems:In})=>{In.forEach(({id:Rn})=>this.unloadItem(Rn))}),registerReceiveMessage(RENAMED_ITEM_MESSAGE,({itemId:In,itemKind:Rn})=>this.reload(In,Rn)),registerReceiveMessage(MOVED_ITEMS_MESSAGE,({movedItems:In})=>In.forEach(({id:Rn,kind:Mn})=>this.reload(Rn,Mn))),sessionSchedulerClient.onReceiveWorkspaceSynchronizationProgress(({changes:In})=>In.forEach(async Rn=>{switch(Rn.kind){case"delete":this.unloadItem(Rn.id);break;case"update":await this.reload(Rn.id,Rn.itemKind);break}}))]}async createApi(In,Rn,Mn,Ln){const Hn=await createApiItem(In,Rn,Mn,null,null,Ln);return this.#e.set(In,Hn,{permanent:!0}),this.triggerListeners(In,"load",Hn),Hn}async createNewApi(In,Rn,Mn){const Ln=await createNewApiItem(In,Rn,Mn);return this.#e.set(In,Ln,{permanent:!0}),this.triggerListeners(In,"load",Ln),Ln}async createApiDocument(In,Rn,Mn,Ln,Hn){const jn=await createApiDocumentItem(In,Rn,Mn,Ln,null,null,Hn);return await this.setDocument(In,jn,"load"),jn}async createBasicDocument(In,Rn,Mn,Ln,Hn){const jn=await createBasicDocumentItem(In,Rn,Mn,null,null,Ln,Hn);return await this.setDocument(In,jn,"load"),jn}async createNewDocument(In,Rn,Mn,Ln){const Hn=await createNewDocumentItem(In,Rn,Mn,Ln);return await this.setDocument(In,Hn,"load"),Hn}async createEnvironment(In,Rn,Mn){const Ln=await createEnvironmentItem(In,Rn,null,null,Mn);return this.#e.set(In,Ln,{permanent:!0}),this.triggerListeners(In,"load",Ln),Ln}async createNewEnvironment(In,Rn,Mn){const Ln=await createNewEnvironmentItem(In,Rn,Mn);return this.#e.set(In,Ln,{permanent:!0}),this.triggerListeners(In,"load",Ln),Ln}async duplicateApi(In,Rn,Mn){const Ln=await duplicateApiItem(In,Rn,Mn);return Ln&&(this.#e.set(Rn,Ln,{permanent:!0}),this.triggerListeners(Rn,"load",Ln)),Ln}async duplicateDocument(In,Rn,Mn){const Ln=await duplicateDocumentItem(In,Rn,Mn);return Ln&&await this.setDocument(Rn,Ln,"load"),Ln}async duplicateEnvironment(In,Rn,Mn){const Ln=await duplicateEnvironmentItem(In,Rn,Mn);return Ln&&(this.#e.set(Rn,Ln,{permanent:!0}),this.triggerListeners(Rn,"load",Ln)),Ln}get(In){return this.#e.get(In)}async getApi(In){const Rn=this.#e.get(In);return isApiItem(Rn)?(this.#e.isPermanent(In)||(this.#e.set(In,Rn,{permanent:!0}),this.triggerListeners(In,"load",Rn)),Rn):await this.reloadApi(In,!0)}async getNewApi(In){const Rn=this.#e.get(In);if(isNewApiItem(Rn))return this.#e.isPermanent(In)||(this.#e.set(In,Rn,{permanent:!0}),this.triggerListeners(In,"load",Rn)),Rn;const[Mn,Ln]=this.loadItem(In,()=>this.getNewApi(In));if(Mn)return await Ln;const Hn=await Ln;return Hn&&(this.#e.set(In,Hn,{permanent:!0}),this.triggerListeners(In,"load",Hn)),Hn}async getDocument(In){const Rn=this.#e.get(In);return isDocumentItem(Rn)?Rn:await this.reloadDocument(In)}async getEnvironment(In){const Rn=this.#e.get(In);return isEnvironmentItem(Rn)?Rn:await this.reloadEnvironment(In)}async saveApi(In,Rn){const Mn=this.#e.get(In);if(isApiItem(Mn))try{const Ln=await saveApiItem(In,Rn);return this.#e.set(In,Ln,{permanent:!0}),this.triggerListeners(In,"save",Ln),Ln}catch{return}}async saveNewApi(In,Rn,Mn,Ln,Hn){const jn=this.#e.get(In);if(isNewApiItem(jn))try{const Wn=await saveNewApiItem(In,Rn,Mn,Ln,Hn);return this.#e.set(In,Wn,{permanent:!0}),this.triggerListeners(In,"save",Wn),Wn}catch{return}}async saveDocument(In){const Rn=this.#e.get(In);if(isDocumentItem(Rn))try{const Mn=await saveDocumentItem(In);return await this.setDocument(In,Mn,"save"),Mn}catch{return}}async saveNewDocument(In,Rn,Mn,Ln){const Hn=this.#e.get(In);if(isDocumentItem(Hn))try{const jn=await saveNewDocumentItem(In,Rn,Mn,Ln);return await this.setDocument(In,jn,"save"),jn}catch{return}}async saveEnvironment(In){const Rn=this.#e.get(In);if(isEnvironmentItem(Rn))try{const Mn=await saveEnvironmentItem(In);return this.#e.set(In,Mn,{permanent:!0}),this.triggerListeners(In,"save",Mn),Mn}catch{return}}async saveNewEnvironment(In,Rn,Mn){const Ln=this.#e.get(In);if(isNewEnvironmentItem(Ln))try{const Hn=await saveNewEnvironmentItem(In,Rn,Mn);return this.#e.set(In,Hn,{permanent:!0}),this.triggerListeners(In,"save",Hn),Hn}catch{return}}subscribe(In,Rn){let Mn=this.#n.get(In);return Mn||(Mn=new Set,this.#n.set(In,Mn)),Mn.has(Rn)||Mn.add(Rn),()=>{Mn.delete(Rn),Mn.size===0&&this.#n.delete(In)}}subscribeAll(In){return this.subscribe(ALL_LISTENER_NAME$1,In)}unloadItem(In){const Rn=this.#e.get(In);if(Rn){const Mn=this.#e.isPermanent(In);return this.#e.delete(In),Mn&&this.triggerListeners(In,"unload",Rn),!0}return!1}updateDocumentContentBody(In,Rn){return this.updateDocumentContent(In,Mn=>updateDocumentContentBody(Mn,Rn))}updateDocumentContentVariables(In,Rn){return this.updateDocumentContent(In,Mn=>updateDocumentContentVariables(Mn,Rn))}[Symbol.dispose](){this.#e[Symbol.dispose](),this.#r.forEach(In=>In())}loadItem(In,Rn){if(this.#t.has(In))return[!0,this.#t.get(In)];const Mn=Rn().then(Ln=>(this.#t.delete(In),Ln));return this.#t.set(In,Mn),[!1,Mn]}async reload(In,Rn){switch(Rn){case"api":await this.reloadApi(In,!1);break;case"api-document":case"document":await this.reloadDocument(In);break;case"environment":await this.reloadEnvironment(In);break}}async reloadApi(In,Rn){const[Mn,Ln]=this.loadItem(In,()=>getApiItem(In));if(Mn)return await Ln;const Hn=await Ln;if(Hn){const jn=Rn||this.#e.isPermanent(In);this.#e.set(In,Hn,{permanent:jn}),jn?this.triggerListeners(In,"load",Hn):this.triggerListeners(In,"load-dependency",Hn)}return Hn}async reloadDocument(In){const[Rn,Mn]=this.loadItem(In,()=>getDocumentItemAndContent(In));if(Rn)return await Mn;const Ln=await Mn;return Ln&&await this.setDocument(In,Ln,"load"),Ln}async reloadEnvironment(In){const[Rn,Mn]=this.loadItem(In,()=>getEnvironmentItemAndVariables(In));if(Rn)return await Mn;const Ln=await Mn;return Ln&&(this.#e.set(In,Ln,{permanent:!0}),this.triggerListeners(In,"load",Ln)),Ln}async setDocument(In,Rn,Mn){if(isApiDocumentItem(Rn)){if(this.#e.set(In,Rn,{permanent:!0,references:[Rn.apiId]}),this.#e.has(Rn.apiId)){this.triggerListeners(In,Mn,Rn);return}const[Ln,Hn]=this.loadItem(Rn.apiId,()=>getApiItem(Rn.apiId));if(Ln){await Hn,this.triggerListeners(In,Mn,Rn);return}const jn=await Hn;jn&&(this.#e.set(jn.id,jn,{permanent:!1}),this.triggerListeners(jn.id,"load-dependency",jn)),this.triggerListeners(In,Mn,Rn)}else this.#e.set(In,Rn,{permanent:!0}),this.triggerListeners(In,Mn,Rn)}async updateDocumentContent(In,Rn){const Mn=this.#e.get(In);if(!isDocumentItem(Mn))return;const Ln=await Rn(In);return Ln&&(this.#e.update(In,Ln),this.triggerListeners(In,"update",Ln)),Ln}triggerListeners(In,Rn,Mn){requestAnimationFrame(()=>{const Ln=this.#n.get(ALL_LISTENER_NAME$1);Ln&&Ln.forEach(jn=>jn(Rn,Mn));const Hn=this.#n.get(In);Hn&&Hn.forEach(jn=>jn(Rn,Mn))})}}function useItemStore(){return useRequiredService(ItemStore.name)}function applyObjectChanges(on,In){let Rn=null;for(const Mn of Object.keys(on)){const Ln=In[Mn],Hn=on[Mn];let jn;typeof Ln=="object"&&Ln!==null&&typeof Hn=="object"&&Hn!==null&&!Array.isArray(Ln)&&!Array.isArray(Hn)?jn=applyObjectChanges(Hn,Ln):jn=Hn,Object.is(jn,Ln)||(Rn??={...In},Rn[Mn]=jn)}return Rn??In}const ALL_LISTENER_NAME="all";class TabViewStateStore{#e=new SimpleCache({lru:!1});#t;#r=new Map;constructor(){this.#t=[registerReceiveMessage(DELETED_ITEMS_MESSAGE,({deletedItems:In})=>In.forEach(({id:Rn})=>this.delete(Rn))),registerReceiveMessage(DOCUMENT_ANALYZED_MESSAGE,({documentId:In,operations:Rn})=>{const Mn=this.#e.get(In);if(!(!Mn||!Mn.graphqlDocument)){if(Rn.length===0){this.update(In,{graphqlDocument:{activeOperation:void 0}});return}(Mn.graphqlDocument.activeOperation===void 0||Mn.graphqlDocument.activeOperation>=Rn.length)&&this.update(In,{graphqlDocument:{activeOperation:0}})}}),sessionSchedulerClient.onReceiveWorkspaceSynchronizationProgress(({changes:In})=>In.forEach(async Rn=>{switch(Rn.kind){case"delete":await this.delete(Rn.id);break}}))]}create(In){this.#e.set(In.id,In),this.triggerListeners(In.id,"create",In),setTabViewState(In)}createApi(In,Rn,Mn){this.create({id:In,workspaceId:Rn,api:{...Mn?.api,activeViewId:Mn?.api?.activeViewId??DEFAULT_TAB_VIEW_STATE_VALUES.api.activeViewId,activeSchemaChangelogViewId:Mn?.api?.activeSchemaChangelogViewId??DEFAULT_TAB_VIEW_STATE_VALUES.api.activeSchemaChangelogViewId,activeMonitoringViewId:Mn?.api?.activeMonitoringViewId??DEFAULT_TAB_VIEW_STATE_VALUES.api.activeMonitoringViewId,metricsDateTimeRange:Mn?.api?.metricsDateTimeRange??DEFAULT_TAB_VIEW_STATE_VALUES.api.metricsDateTimeRange},detailInfo:Mn?.detailInfo?{...Mn?.detailInfo}:void 0,schema:{...Mn?.schema,activeSchemaViewId:Mn?.schema?.activeSchemaViewId??DEFAULT_TAB_VIEW_STATE_VALUES.schema.activeSchemaViewId,activeSchemaReferenceViewId:Mn?.schema?.activeSchemaReferenceViewId??DEFAULT_TAB_VIEW_STATE_VALUES.schema.activeSchemaReferenceViewId,hideDeprecatedItemsInSchemaReference:Mn?.schema?.hideDeprecatedItemsInSchemaReference??DEFAULT_TAB_VIEW_STATE_VALUES.schema.hideDeprecatedItemsInSchemaReference}})}createGraphqlDocument(In,Rn,Mn){this.create({id:In,workspaceId:Rn,api:{...Mn?.api,metricsDateTimeRange:Mn?.api?.metricsDateTimeRange??DEFAULT_TAB_VIEW_STATE_VALUES.api.metricsDateTimeRange},graphqlDocument:{...Mn?.graphqlDocument,activeViewId:Mn?.graphqlDocument?.activeViewId??DEFAULT_TAB_VIEW_STATE_VALUES.graphqlDocument.activeViewId,activeOperationCompanionViewId:Mn?.graphqlDocument?.activeOperationCompanionViewId??DEFAULT_TAB_VIEW_STATE_VALUES.graphqlDocument.activeOperationCompanionViewId,activeOperationsSettingsViewId:Mn?.graphqlDocument?.activeOperationsSettingsViewId??DEFAULT_TAB_VIEW_STATE_VALUES.graphqlDocument.activeOperationsSettingsViewId,activeResponseViewId:Mn?.graphqlDocument?.activeResponseViewId??DEFAULT_TAB_VIEW_STATE_VALUES.graphqlDocument.activeResponseViewId,isOperationCompanionCollapsed:Mn?.graphqlDocument?.isOperationCompanionCollapsed??DEFAULT_TAB_VIEW_STATE_VALUES.graphqlDocument.isOperationCompanionCollapsed,isOperationsSettingsPaneCollapsed:Mn?.graphqlDocument?.isOperationsSettingsPaneCollapsed??DEFAULT_TAB_VIEW_STATE_VALUES.graphqlDocument.isOperationsSettingsPaneCollapsed,isResponseEntriesPaneCollapsed:Mn?.graphqlDocument?.isResponseEntriesPaneCollapsed??DEFAULT_TAB_VIEW_STATE_VALUES.graphqlDocument.isResponseEntriesPaneCollapsed,operationsSettingsPaneHeight:Mn?.graphqlDocument?.operationsSettingsPaneHeight??DEFAULT_TAB_VIEW_STATE_VALUES.graphqlDocument.operationsSettingsPaneHeight,responseEntriesPaneHeight:Mn?.graphqlDocument?.responseEntriesPaneHeight??DEFAULT_TAB_VIEW_STATE_VALUES.graphqlDocument.responseEntriesPaneHeight,focusedElement:Mn?.graphqlDocument?.focusedElement??DEFAULT_TAB_VIEW_STATE_VALUES.graphqlDocument.focusedElement,showIntrospectionFieldsInOperationBuilder:Mn?.graphqlDocument?.showIntrospectionFieldsInOperationBuilder??DEFAULT_TAB_VIEW_STATE_VALUES.graphqlDocument.showIntrospectionFieldsInOperationBuilder},detailInfo:Mn?.detailInfo?{...Mn?.detailInfo}:void 0,schema:{...Mn?.schema,activeSchemaViewId:Mn?.schema?.activeSchemaViewId??DEFAULT_TAB_VIEW_STATE_VALUES.schema.activeSchemaViewId,activeSchemaReferenceViewId:Mn?.schema?.activeSchemaReferenceViewId??DEFAULT_TAB_VIEW_STATE_VALUES.schema.activeSchemaReferenceViewId,hideDeprecatedItemsInSchemaReference:Mn?.schema?.hideDeprecatedItemsInSchemaReference??DEFAULT_TAB_VIEW_STATE_VALUES.schema.hideDeprecatedItemsInSchemaReference}})}async delete(In){const Rn=this.#e.get(In);return Rn?(await deleteTabViewState(In),this.#e.delete(In),this.triggerListeners(In,"delete",Rn),!0):!1}get(In){return this.#e.get(In)}async load(In){this.#e.forEach(Mn=>{this.#e.delete(Mn.id),this.triggerListeners(Mn.id,"unload",Mn)});const Rn=await loadAllTabViewState(In);if(Rn)for(const Mn of Rn)this.#e.set(Mn.id,Mn),this.triggerListeners(Mn.id,"load",Mn)}subscribe(In,Rn){let Mn=this.#r.get(In);return Mn||(Mn=new Set,this.#r.set(In,Mn)),Mn.has(Rn)||Mn.add(Rn),()=>{Mn.delete(Rn),Mn.size===0&&this.#r.delete(In)}}subscribeAll(In){return this.subscribe(ALL_LISTENER_NAME,In)}update(In,Rn){const Mn=this.#e.get(In);if(!Mn)return;typeof Rn=="function"&&(Rn=Rn(Mn));const Ln=applyObjectChanges(Rn,Mn);Ln!==Mn&&(this.#e.set(In,Ln),this.triggerListeners(In,"update",Ln),setTabViewState(Ln))}[Symbol.dispose](){this.#e[Symbol.dispose](),this.#t.forEach(In=>In())}triggerListeners(In,Rn,Mn){const Ln=this.#r.get(ALL_LISTENER_NAME);Ln&&Ln.forEach(jn=>jn(Rn,Mn));const Hn=this.#r.get(In);Hn&&Hn.forEach(jn=>jn(Rn,Mn))}}function useTabViewStateStore(){return useRequiredService(TabViewStateStore.name)}class SchemaErrorCache extends SimpleCache{constructor(){super({lru:!0})}[Symbol.dispose](){super[Symbol.dispose]()}}function useSchemaErrorCache(){return useRequiredService(SchemaErrorCache.name)}const INITIAL_STATE$5={activeId:null,activeChildId:null,entries:[],followNewest:!0,stats:{all:0,errors:0,infos:0,warnings:0}};function LogProvider({children:on}){const In=useSubject(INITIAL_STATE$5);return useOnWorkspaceSwitchResetState(In.current),jsx$1(ActivateLogEntryProvider,{state$:In.current,children:jsx$1(AppendLogEntryProvider,{state$:In.current,children:jsx$1(AppendSchedulerLogEntryProvider,{state$:In.current,children:jsx$1(ClearLogProvider,{state$:In.current,children:jsx$1(CollapseLogScopeProvider,{state$:In.current,children:jsx$1(DeactivateLogEntryProvider,{state$:In.current,children:jsx$1(ExpandLogScopeProvider,{state$:In.current,children:jsx$1(UpdateFollowNewestProvider,{state$:In.current,children:jsx$1(LogStateContext.Provider,{value:In.current,children:on})})})})})})})})})}function useOnReceiveLogEntry$1(on){reactExports.useEffect(()=>graphQLEngineSchedulerClient.onReceiveLogEntry(on),[on])}function useOnWorkspaceSwitchResetState(on){reactExports.useEffect(()=>registerReceiveMessage(ACTIVATED_WORKSPACE_MESSAGE,()=>{on.next(INITIAL_STATE$5)}),[on])}const ActivateLogEntryContext=createNamedContext(noop$2,"ActivateLogEntry");function useActivateLogEntry(){return reactExports.useContext(ActivateLogEntryContext)}function ActivateLogEntryProvider({children:on,state$:In}){const Rn=reactExports.useCallback((Mn,Ln,Hn)=>{const jn=In.value();(jn.activeId!==Mn||jn.activeChildId!==Ln)&&jn.entries.some(({id:Wn})=>Wn===Mn)&&(In.next({...jn,entries:jn.entries.map(Wn=>Wn.id===Mn&&Wn.kind==="scope"?{...Wn,expanded:!0}:Wn),activeId:Mn,activeChildId:Ln??null,followNewest:Hn===void 0?jn.followNewest:Hn}),Mn&&sendMessage({kind:LOG_ENTRY_ACTIVATED_MESSAGE,logEntryId:Mn}))},[In]);return jsx$1(ActivateLogEntryContext.Provider,{value:Rn,children:on})}const AppendLogEntryContext=createNamedContext(async()=>"","AppendLogEntry");function useAppendLogEntry(){return reactExports.useContext(AppendLogEntryContext)}function AppendLogEntryProvider({children:on,state$:In}){const Rn=reactExports.useCallback(async(Mn,Ln,Hn,jn)=>{const Wn=await getItemDetails(Mn),Yn=createId();return appendLogEntry(In,{id:Yn,item:Wn,kind:"basic",level:Ln,message:Hn,timestamp:now(),details:jn}),Yn},[In]);return jsx$1(AppendLogEntryContext.Provider,{value:Rn,children:on})}const AppendSchedulerLogEntryContext=createNamedContext(noop$2,"AppendSchedulerLogEntry");function useAppendSchedulerLogEntry(){return reactExports.useContext(AppendSchedulerLogEntryContext)}function AppendSchedulerLogEntryProvider({children:on,state$:In}){const Rn=useSchemaErrorCache(),Mn=reactExports.useCallback(async Ln=>{const{kind:Hn}=Ln,jn=await getItemDetails(Ln.itemId);switch(Hn){case BASIC_LOG_ENTRY_KIND:appendLogEntry(In,{id:Ln.requestId??createId(),item:jn,kind:"basic",level:Ln.level,timestamp:now(),message:Ln.message,details:Ln.details});break;case HTTP_REQUEST_LOG_ENTRY_KIND:appendLogEntry(In,{id:Ln.requestId,scopeId:Ln.scopeId,item:jn,kind:"http-request",name:Ln.name,level:Ln.level,status:"pending",started:Ln.started,request:{uri:Ln.requestUri,method:Ln.method,headers:Ln.headers,body:Ln.body,cache:Ln.cache,credentials:Ln.credentials,referrerPolicy:Ln.referrerPolicy}});break;case HTTP_RESPONSE_LOG_ENTRY_KIND:updateLogEntry(In,Ln.requestId,vi=>({...vi,response:{body:"",headers:Ln.headers,chunks:0,contentLength:0,statusCode:Ln.statusCode,statusText:Ln.statusText}}));break;case HTTP_RESPONSE_BODY_CHUNK_LOG_ENTRY_KIND:updateLogEntry(In,Ln.requestId,vi=>({...vi,response:{...vi.response,body:vi.response.body+Ln.chunk,chunks:Ln.chunkIndex+1}}));break;case HTTP_RESPONSE_CANCELLED_LOG_ENTRY_KIND:updateLogEntry(In,Ln.requestId,vi=>({...vi,level:LogLevel.warning,status:"cancelled",stopped:Ln.stopped,duration:diff$1(vi.started,Ln.stopped),response:{...vi.response,contentLength:Ln.contentLength,error:Ln.error}}));break;case HTTP_RESPONSE_FAILED_LOG_ENTRY_KIND:{if(updateLogEntry(In,Ln.requestId,vi=>({...vi,level:LogLevel.error,status:"failed",stopped:Ln.stopped,duration:diff$1(vi.started,Ln.stopped),response:{...vi.response,contentLength:Ln.contentLength,error:Ln.error}})),Ln.requestKind===RequestKind.GRAPHQL_INTROSPECTION||Ln.requestKind===RequestKind.GRAPHQL_SDL_FETCH){const vi=Rn.get(Ln.itemId);if(Ln.scopeId!==vi?.scopeId||!Ln.scopeId&&!vi?.scopeId){const gi=In.value().entries.find(({id:mi})=>mi===Ln.requestId);gi?.kind==="http-request"&&Rn.set(Ln.itemId,gi)}}break}case HTTP_RESPONSE_FINISHED_LOG_ENTRY_KIND:{if(updateLogEntry(In,Ln.requestId,vi=>({...vi,status:"succeeded",stopped:Ln.stopped,duration:diff$1(vi.started,Ln.stopped),response:{...vi.response,contentLength:Ln.contentLength}})),Ln.requestKind===RequestKind.GRAPHQL_INTROSPECTION||Ln.requestKind===RequestKind.GRAPHQL_SDL_FETCH||Ln.requestKind===RequestKind.GRAPHQL_SDL_PROBE){const vi=Rn.get(Ln.itemId);vi&&(vi.scopeId!==Ln.scopeId||!vi.scopeId&&!Ln.scopeId)&&Rn.delete(Ln.itemId)}break}case SCOPE_BEGIN_LOG_ENTRY_KIND:appendLogEntry(In,{id:Ln.scopeId,item:jn,kind:"scope",name:Ln.name,level:Ln.level,started:Ln.started,details:Ln.details?{...Ln.details,status:"pending"}:{status:"pending"}});break;case SCOPE_END_LOG_ENTRY_KIND:const Wn=In.value().entries.filter(vi=>vi.kind==="http-request"&&vi.scopeId===Ln.scopeId),Yn=Wn.length?Wn[Wn.length-1]:null,hi=Wn.length?Wn.find(vi=>vi.status==="cancelled"||vi.status==="failed")??Yn:null;updateLogEntry(In,Ln.scopeId,vi=>({...vi,stopped:Ln.stopped,duration:diff$1(vi.started,Ln.stopped),level:hi?.level??vi.level,details:{...vi.details,cache:Yn?.request.cache,contentLength:Wn.reduce((gi,mi)=>gi+(mi.response?.contentLength??0),0),credentials:Yn?.request.credentials,method:Yn?.request.method,referrerPolicy:Yn?.request.referrerPolicy,requestHeaders:Yn?.request.headers,responseHeaders:Yn?.response?.headers,status:hi?.status??"succeeded",statusCode:hi?.response?.statusCode,statusText:hi?.response?.statusText}}));break;case SUBSCRIPTION_REQUEST_STARTED_LOG_ENTRY_KIND:appendLogEntry(In,{id:Ln.requestId,item:jn,kind:"subscription-request",level:Ln.level,status:"pending",started:Ln.started,uri:Ln.requestUri,protocol:Ln.protocol,connectionParams:Ln.connectionParams,contentLength:0,messages:0,data:""});break;case SUBSCRIPTION_REQUEST_PROTOCOL_LOG_ENTRY_KIND:updateLogEntry(In,Ln.requestId,vi=>({...vi,protocol:Ln.protocol}));break;case SUBSCRIPTION_REQUEST_MESSAGE_LOG_ENTRY_KIND:updateLogEntry(In,Ln.requestId,vi=>{const gi=vi.data+Ln.data+`
|
|
4724
|
-
`;return{...vi,messages:vi.messages+1,contentLength:gi.length,data:gi}});break;case SUBSCRIPTION_REQUEST_STOPPED_LOG_ENTRY_KIND:updateLogEntry(In,Ln.requestId,vi=>({...vi,level:Ln.reason==="failed"?LogLevel.error:LogLevel.info,status:Ln.reason,error:Ln.error,stopped:Ln.stopped,duration:diff$1(vi.started,Ln.stopped)}));break}},[Rn,In]);return useOnReceiveLogEntry$1(Mn),jsx$1(AppendSchedulerLogEntryContext.Provider,{value:Mn,children:on})}const ClearLogContext=createNamedContext(noop$2,"ClearLog");function useClearLog(){return reactExports.useContext(ClearLogContext)}function ClearLogProvider({children:on,state$:In}){const Rn=reactExports.useCallback(()=>{In.next(INITIAL_STATE$5)},[In]);return jsx$1(ClearLogContext.Provider,{value:Rn,children:on})}const CollapseLogScopeContext=createNamedContext(noop$2,"CollapseLogScope");function useCollapseLogScope(){return reactExports.useContext(CollapseLogScopeContext)}function CollapseLogScopeProvider({children:on,state$:In}){const Rn=reactExports.useCallback(Mn=>{In.value().entries.some(Ln=>Ln.id===Mn&&Ln.kind==="scope"&&Ln.expanded)&&In.next(Ln=>({...Ln,activeChildId:Ln.activeId===Mn?null:Ln.activeChildId,followNewest:!1,entries:Ln.entries.map(Hn=>Hn.id===Mn?{...Hn,expanded:!1}:Hn)}))},[In]);return jsx$1(CollapseLogScopeContext.Provider,{value:Rn,children:on})}const DeactivateLogEntryContext=createNamedContext(noop$2,"DeactivateLogEntry");function useDeactivateLogEntry(){return reactExports.useContext(DeactivateLogEntryContext)}function DeactivateLogEntryProvider({children:on,state$:In}){const Rn=reactExports.useCallback(()=>{In.next(Mn=>({...Mn,activeId:null}))},[In]);return jsx$1(DeactivateLogEntryContext.Provider,{value:Rn,children:on})}const ExpandLogScopeContext=createNamedContext(noop$2,"ExpandLogScope");function useExpandLogScope(){return reactExports.useContext(ExpandLogScopeContext)}function ExpandLogScopeProvider({children:on,state$:In}){const Rn=reactExports.useCallback(Mn=>{In.value().entries.some(Ln=>Ln.id===Mn&&Ln.kind==="scope"&&!Ln.expanded)&&In.next(Ln=>({...Ln,followNewest:!1,entries:Ln.entries.map(Hn=>Hn.id===Mn?{...Hn,expanded:!0}:Hn)}))},[In]);return jsx$1(ExpandLogScopeContext.Provider,{value:Rn,children:on})}const UpdateFollowNewestContext=createNamedContext(noop$2,"UpdateFollowNewest");function useUpdateFollowNewest(){return reactExports.useContext(UpdateFollowNewestContext)}function UpdateFollowNewestProvider({children:on,state$:In}){const Rn=reactExports.useCallback(Mn=>{const Ln=In.value();Ln.followNewest!==Mn&&In.next({...Ln,followNewest:Mn})},[In]);return jsx$1(UpdateFollowNewestContext.Provider,{value:Rn,children:on})}const LogStateContext=createNamedContext(null,"LogState");function LogSelector(on){const In={activeId:on.activeId,activeChildId:on.activeChildId,entries:on.entries.filter(Rn=>!(Rn.kind==="http-request"&&Rn.scopeId)).reduce((Rn,Mn)=>{const{id:Ln,kind:Hn,item:jn,level:Wn}=Mn;switch(Hn){case"basic":Rn.push({id:Ln,kind:Hn,item:jn,level:Wn,message:Mn.message,timestamp:Mn.timestamp});break;case"http-request":Rn.push(mapToHttpRequestLogListEntry(Mn));break;case"scope":Rn.push({id:Ln,kind:Hn,item:jn,level:Wn,name:Mn.name,started:Mn.started,duration:Mn.duration,details:Mn.details,expanded:!!Mn.expanded});const Yn=on.entries.filter(vi=>vi.kind==="http-request"&&vi.scopeId===Ln),hi=Yn[Yn.length-1];if(Yn.length&&Mn.expanded)for(const vi of Yn)Rn.push(mapToHttpRequestLogListEntry(vi,vi===hi));break;case"subscription-request":Rn.push({id:Ln,kind:Hn,item:jn,level:Wn,uri:Mn.uri,contentLength:Mn.stopped?Mn.contentLength:0,started:Mn.started,status:Mn.status,duration:Mn.duration,protocol:Mn.protocol});break;default:throw new Error("Unknown kind")}return Rn},[]),followNewest:on.followNewest,hash:""};return{...In,hash:createHash(JSON.stringify(In))}}function mapToHttpRequestLogListEntry(on,In){return{id:on.id,kind:on.kind,scopeId:on.scopeId,item:on.item,level:on.level,uri:on.request.uri,method:on.request.method,name:on.name,contentLength:on.stopped?on.response?.contentLength??0:0,started:on.started,status:on.status,statusCode:on.response?.statusCode,duration:on.duration,lastChild:In}}function useLog(){return useSelector(LogStateContext,LogSelector,(on,In)=>on.hash===In.hash)}function ActiveLogEntrySelector(on){const In=on.activeChildId||on.activeId;if(In)return on.entries.find(({id:Rn})=>Rn===In)}function useActiveLogEntry(){return useSelector(LogStateContext,ActiveLogEntrySelector)}function ActiveLogEntryIdSelector(on){return on.activeId}function useActiveLogEntryId(){return useSelector(LogStateContext,ActiveLogEntryIdSelector)}function HasLogEntrySelector(on){return In=>!!In?.entries.some(({id:Rn})=>Rn===on)}function useHasLogEntry(on){return useSelector(LogStateContext,HasLogEntrySelector(on))}function HasLogEntriesSelector(on){return!!on?.entries.length}function useHasLogEntries(){return useSelector(LogStateContext,HasLogEntriesSelector)}function LogStatsSelector(on){return on.stats}function useLogStats(){return useSelector(LogStateContext,LogStatsSelector)}async function appendLogEntry(on,In){on.next(Rn=>({...Rn,entries:[...Rn.entries,In],stats:{all:Rn.stats.all+1,errors:In.level===LogLevel.error?Rn.stats.errors+1:Rn.stats.errors,infos:In.level===LogLevel.info?Rn.stats.infos+1:Rn.stats.infos,warnings:In.level===LogLevel.warning?Rn.stats.warnings+1:Rn.stats.warnings}}))}function updateLogEntry(on,In,Rn){on.next(Mn=>{const Ln=Mn.entries.map(Hn=>Hn.id===In?Rn(Hn):Hn);return{...Mn,entries:Ln,stats:{...Mn.stats,errors:Ln.filter(({level:Hn})=>Hn===LogLevel.error).length,infos:Ln.filter(({level:Hn})=>Hn===LogLevel.info).length,warnings:Ln.filter(({level:Hn})=>Hn===LogLevel.warning).length}}})}async function getItemDetails(on){if(!on)return null;const In=await getItemNameAndKind(on);if(In){const[Rn,Mn]=In;return{id:on,name:Rn,kind:Mn}}return{id:on,name:"N/A"}}function NetworkProvider({children:on}){const In=reactExports.useRef(null),Rn=useSubject(window.navigator.onLine);return reactExports.useEffect(()=>{async function Mn(){try{const hi=await fetch("https://api.chillicream.com/status",{method:"GET",cache:"no-store",signal:AbortSignal.timeout(5e3)});Rn.current.next(hi.ok)}catch{Rn.current.next(!1)}}function Ln(){In.current&&window.clearInterval(In.current),Mn(),In.current=window.setInterval(Mn,THIRTY_SECONDS)}function Hn(){In.current&&(window.clearInterval(In.current),In.current=null)}window.navigator.onLine?document.visibilityState==="visible"&&Ln():Rn.current.next(!1);function jn(){document.visibilityState==="visible"&&Ln()}function Wn(){Rn.current.next(!1),Hn()}function Yn(){document.visibilityState==="visible"?window.navigator.onLine&&Ln():Hn()}return window.addEventListener("offline",Wn),window.addEventListener("online",jn),document.addEventListener("visibilitychange",Yn),()=>{window.removeEventListener("offline",Wn),window.removeEventListener("online",jn),document.removeEventListener("visibilitychange",Yn),Hn()}},[Rn]),jsx$1(IsOnlineContext.Provider,{value:Rn.current,children:on})}const IsOnlineContext=createNamedContext(null,"IsOnline");function IsOnlineSelector(on){return on}function useIsOnline(){return useSelector(IsOnlineContext,IsOnlineSelector)}function useIsOnlineObservable(){return useObservable(IsOnlineContext)}const DEFAULT_PRESET={useBrowserUrlAsEndpoint:!1},LOAD_PRESET=!(IS_RUNNING_IN_CLOUD||IS_RUNNING_IN_ELECTRON);function PresetProvider({children:on}){const In=useInitialize$7();return In?jsx$1(PresetContext.Provider,{value:In,children:on}):null}function useInitialize$7(){const on=useForceUpdate(),In=reactExports.useRef(null);return LOAD_PRESET||(In.current=DEFAULT_PRESET),reactExports.useEffect(()=>{In.current||getPreset().then(Rn=>{In.current=Rn,on()})},[on]),In.current}async function getPreset(){const on=await fetchPreset("nitro-config.json");return on||(await fetchPreset("bcp-config.json")??DEFAULT_PRESET)}async function fetchPreset(on){const{origin:In}=window.location,Rn=extractAppUrlPath(window.location);try{return await(await fetch(resolveUrl$1(`${In}${Rn}`,on))).json()}catch{return null}}const PresetContext=createNamedContext(DEFAULT_PRESET,"Preset");function usePreset(){return reactExports.useContext(PresetContext)}function useIsBoundToOrganization(){return!!usePreset().organization}const INITIAL_STATE$4={signInState:"init",synchronizing:!1,sessions:[]};function SessionProvider({children:on}){const In=useInitialize$6();return useOnReceiveLogEntry(),In?jsx$1(HandleSignInCallbackProvider,{state$:In,children:jsx$1(UpsertSessionProvider,{state$:In,children:jsx$1(ActivateSessionProvider,{state$:In,children:jsx$1(SignInProvider,{state$:In,children:jsx$1(SignOutProvider,{state$:In,children:jsx$1(SignOutAllProvider,{state$:In,children:jsx$1(CreateUserAccountProvider,{children:jsx$1(SignOutOfCurrentSessionProvider,{state$:In,children:jsx$1(SignInActiveSessionProvider,{state$:In,children:jsx$1(SessionStateContext.Provider,{value:In,children:on})})})})})})})})})}):null}function useInitialize$6(){const on=reactExports.useRef(null),In=useForceUpdate();return reactExports.useEffect(()=>{if(!on.current){let Rn=function(Mn){on.current=createSubject(refreshSignInState(Mn)),In()};createLoadAppSessionAction().then(Rn,()=>Rn(INITIAL_STATE$4))}},[In]),useExpiredSessionNotification(on.current),useRefreshToken(on.current),useActivatedWorkspace(on.current),on.current}async function createLoadAppSessionAction(on){const In=await getAppSession(on);return In?{synchronizing:!1,signInState:"sign-in",sessions:In.userSessions,activeSession:In.activeSession}:INITIAL_STATE$4}function useOnReceiveLogEntry(){const on=useAppendSchedulerLogEntry();reactExports.useEffect(()=>sessionSchedulerClient.onReceiveLogEntry(on),[on])}function useExpiredSessionNotification(on){const In=reactExports.useRef(()=>{});reactExports.useEffect(()=>{if(on){let Rn=function(Hn){if(Hn.activeSession===Ln)return;Mn?.abort();const jn=new AbortController;Mn=jn,Ln=Hn.activeSession,In.current=()=>{isSigninRedirect(window.location)||triggerUserSessionExpiredNotification(jn.signal)}},Mn,Ln;return Rn(on.value()),on.subscribe(Rn)}},[on]),reactExports.useEffect(()=>sessionSchedulerClient.onReceiveUserSessionExpired(In.current),[]),reactExports.useEffect(()=>{function Rn(Mn){Mn.activeSession?.requiresSignIn&&In.current()}if(on)return Rn(on.value()),on.subscribe(Rn)},[on])}function useRefreshToken(on){const In=useCombine(on??createSubject(INITIAL_STATE$4),useIsOnlineObservable()),Rn=useUpsertSessionAction(on);reactExports.useEffect(()=>{let Mn;function Ln([Hn,jn]){if(jn&&Hn.activeSession&&!Hn.activeSession.requiresSignIn){Mn=new AbortController;const Wn=async()=>{if(!Hn.activeSession)return;const vi=await sessionSchedulerClient.refreshToken(Hn.activeSession,Mn?.signal);await Rn(vi)},Yn=msUntilSessionExpired(Hn.activeSession),hi=window.setTimeout(Wn,Yn>0?Yn:0);Mn.signal.addEventListener("abort",()=>window.clearTimeout(hi))}else Mn&&(Mn.abort(),Mn=void 0)}return Ln(In.value()),In.subscribe(Ln)},[In,Rn])}function useActivatedWorkspace(on){reactExports.useEffect(()=>registerReceiveMessage(ACTIVATED_WORKSPACE_MESSAGE,async({session:In,workspaceId:Rn})=>{if(!on)return;const Mn=on.value(),{activeSession:Ln}=Mn;if(Ln?.id===In.id&&Ln.activeWorkspaceId!==Rn){const Hn={...Ln,activeWorkspaceId:Rn||void 0};await replaceUserSession(Hn),on.next(jn=>({...jn,activeSession:Hn}))}}),[on])}function HandleSignInCallbackProvider({children:on,state$:In}){const Rn=useHandleSignInCallback(In);return IS_RUNNING_IN_ELECTRON?jsx$1(HandleElectronSignInCallbackProvider,{state$:In,handleSignInCallback:Rn,children:on}):jsx$1(HandleWebSignInCallbackProvider,{handleSignInCallback:Rn,children:on})}function HandleElectronSignInCallbackProvider({children:on,state$:In,handleSignInCallback:Rn}){return useElectronSignInListener(In,Rn),jsx$1(Fragment,{children:on})}function HandleWebSignInCallbackProvider({children:on,handleSignInCallback:In}){return reactExports.useEffect(()=>{!IS_RUNNING_IN_ELECTRON&&isSigninRedirect(window.location)&&In(window.location.href)},[In]),jsx$1(Fragment,{children:on})}function useHandleSignInCallback(on){const In=useSignOut(),Rn=useUpsertSessionAction(on),Mn=useActivateSessionAction(on);return reactExports.useCallback(async(Ln,Hn)=>{const jn=new AbortController,Wn=Hn?linkAbortSignals(jn.signal,Hn):jn.signal;let Yn,hi=!1;try{Wn.addEventListener("abort",()=>{hi||triggerSignInCancelledNotification()}),on.next(Mi=>({...Mi,signInState:"sign-in"})),triggerSignInNotification(jn);const vi=parseCodeFromUrl(Ln),gi=parseIssuerFromUrl(Ln),{codeVerifier:mi,redirectUrl:yi}=await getAndValidateAuthenticationState(),{refreshToken:bi,idToken:Ei,accessToken:_i,expiresAt:xi}=await getAndValidateToken(gi,vi,yi,mi,Wn),{tenant:Ci,sub:Ai,email:Ii,login:Ni,apiUrl:Pi}=parseAccessToken(_i),Vi=await getUserSession({sub:Ai,tenant:Ci,issuer:gi});Yn=Vi?{id:Vi.id,issuer:gi,tenant:Ci,sub:Ai,accessToken:_i,refreshToken:bi,idToken:Ei,expiresAt:xi*ONE_SECOND$1,email:Ii,login:Ni,requiresSignIn:!1,hasUserAccount:!0,organization:Vi?Vi.organization:{displayName:"",id:""},activeWorkspaceId:Vi.activeWorkspaceId,billingUrl:Vi.billingUrl,manageTenantUrl:Vi.manageTenantUrl,apiUrl:Pi}:{id:nanoid(),issuer:gi,tenant:Ci,sub:Ai,accessToken:_i,refreshToken:bi,idToken:Ei,expiresAt:xi*ONE_SECOND$1,email:Ii,login:Ni,requiresSignIn:!1,hasUserAccount:!1,organization:{displayName:"",id:""},billingUrl:null,manageTenantUrl:null,apiUrl:Pi},await setCurrentTenant({tenant:Ci,sub:Ai,login:Ni,issuer:gi,apiUrl:Pi}),await Rn(Yn),triggerLoadAccountNotification();const Ui=await fetchUserAccount(Wn);if(Wn.aborted)return;const Gi=await fetchOrganizationInfo(Wn);if(Wn.aborted)return;const Yi=Ui!=="user-not-found",zi={...Yn,hasUserAccount:Yi,organization:Gi,billingUrl:Yi?Ui.billingUrl:null,manageTenantUrl:Yi?Ui.manageTenantUrl:null};await Rn(zi),await Mn(zi),hi=!0,triggerSingInCompleteNotification(),sendMessage({kind:SIGNED_IN_MESSAGE})}catch{Yn&&await In(Yn),triggerSignInFailedNotification()}finally{clearSignInPathFromUrl(),on.next(vi=>refreshSignInState({...vi,electron:void 0})),await deleteAuthenticationState()}},[on,Mn,In,Rn])}function clearSignInPathFromUrl(){const on=new URL(window.location.href);on.pathname=on.pathname.replace(APP_SIGNIN_PATH,""),window.history.pushState("","",`${on.origin}${on.pathname}`)}function useElectronSignInListener(on,In){reactExports.useEffect(()=>{if(IS_RUNNING_IN_ELECTRON){let Rn=function(Yn){const hi=window.messageChannel;if(!hi){triggerSignInFailedNotification();return}Hn=new AbortController,triggerSignInNotification(Hn),Hn.signal.addEventListener("abort",jn);function vi(mi){In(mi,Hn?.signal).then(()=>Hn=void 0).finally(jn)}const gi=hi.onRedirectUrlReceiver(vi);hi.triggerSignIn(Yn),jn=()=>{Hn?.abort(),gi()}},Mn=function(Yn){Ln.electron!==Yn.electron&&(Ln=Yn,Yn.electron&&Rn(Yn.electron.signInUrl))},Ln=on.value(),Hn,jn;const Wn=on.subscribe(Mn);return()=>{Wn(),jn()}}},[on,In])}function useIsUserSignedIn(){const on=useSignInState();return on==="signed-in"||on==="session-expired"}function UserNameSelector(on){return on.activeSession?.email??""}function useUserName(){return useSelector(SessionStateContext,UserNameSelector)}const ActivateSessionContext=createNamedContext(asyncNoop,"ActivateSession");function useActivateSessionAction(on){return reactExports.useCallback(async In=>{if(await setCurrentTenant(In?{tenant:In.tenant,sub:In.sub,login:In.login,issuer:In.issuer,apiUrl:In.apiUrl}:void 0),In){const Rn="accessToken"in In?In:await getUserSession(In);on.next(Mn=>refreshSignInState({...Mn,activeSession:Rn}))}else on.next(Rn=>refreshSignInState({...Rn,activeSession:void 0}))},[on])}function ActivateSessionProvider({children:on,state$:In}){const Rn=useActivateSessionAction(In);return jsx$1(ActivateSessionContext.Provider,{value:Rn,children:on})}function useActivateSession(){return reactExports.useContext(ActivateSessionContext)}const SignOutContext=createNamedContext(asyncNoop,"SignOut");function SignOutProvider({children:on,state$:In}){const Rn=useActivateSession(),Mn=reactExports.useCallback(async Ln=>{await signOutFromIssuers([Ln],In.value().activeSession===Ln);const Hn=await getUserSessions();Hn.length?(In.next(jn=>({...jn,sessions:Hn})),await Rn(Hn[0])):In.next({sessions:Hn,signInState:"signed-out",synchronizing:!1})},[In,Rn]);return jsx$1(SignOutContext.Provider,{value:Mn,children:on})}function useSignOut(){const on=reactExports.useContext(SignOutContext);return In=>triggerSignOutNotification(on(In))}const UpsertSessionContext=createNamedContext(asyncNoop,"UpsertSession");function useUpsertSession(){return reactExports.useContext(UpsertSessionContext)}function useUpsertSessionAction(on){return reactExports.useCallback(async In=>{if(on){await replaceUserSession(In);const Rn=await getUserSessions();on.next(Mn=>({...Mn,activeSession:areTenantsEqual(Mn.activeSession,In)?In:Mn.activeSession,sessions:Rn}))}},[on])}function UpsertSessionProvider({children:on,state$:In}){return jsx$1(UpsertSessionContext.Provider,{value:useUpsertSessionAction(In),children:on})}const CreateUserAccountContext=createNamedContext(asyncNoop,"CreateUserAccount");function useCreateUserAccount(){return reactExports.useContext(CreateUserAccountContext)}function CreateUserAccountProvider({children:on}){const In=useUpsertSession(),Rn=reactExports.useCallback(async(Mn,Ln)=>{try{triggerCreateAccountNotification();const Hn=await sessionSchedulerClient.createUserAccount(Ln),jn=await getUserSession(Mn);!jn||(Hn.errors?.length??0)>0?triggerSignInFailedNotification():await In({...jn,hasUserAccount:!0})}catch{triggerSignInFailedNotification()}},[In]);return jsx$1(CreateUserAccountContext.Provider,{value:Rn,children:on})}const SignOutOfCurrentSessionContext=createNamedContext(asyncNoop,"SignOutOfCurrentSession");function useSignOutOfCurrentSession(){return reactExports.useContext(SignOutOfCurrentSessionContext)}function SignOutOfCurrentSessionProvider({children:on,state$:In}){const Rn=useSignOut(),Mn=reactExports.useCallback(async()=>{const Ln=In.value()?.activeSession;Ln&&await Rn(Ln)},[In,Rn]);return jsx$1(SignOutOfCurrentSessionContext.Provider,{value:Mn,children:on})}const SignInContext=createNamedContext(asyncNoop,"SignIn");function useSignIn(){return reactExports.useContext(SignInContext)}function SignInProvider({children:on,state$:In}){const Rn=usePreset(),Mn=useAppendLogEntry(),Ln=reactExports.useCallback(async(Hn,jn)=>{let{codeVerifier:Wn,codeChallenge:Yn}=generateCodeVerifier(PKCE_CHALLENGE_S256);const hi=getRedirectUrl(),vi=Hn?.issuer??jn??Rn.organization?.serverUrl??Rn.instanceUrl??"https://identity.chillicream.com",gi=Hn?`tenant:${Hn.tenant}`:!Rn.organization?.serverUrl&&Rn.organization?.name?`tenant:${Rn.organization.name}`:"",mi=buildAuthorizeUrl({authorizationUrl:`${vi}/connect/authorize`,clientId:"3c9f56bd-0e2c-4358-9bf5-ff3a0efa9bf5",redirectUrl:hi,scope:"openid offline_access documents:read documents:write workspace:manage",pkceMethod:PKCE_CHALLENGE_S256,codeChallenge:Yn,acrValues:gi,loginHint:Hn?`${Hn.sub}:${Hn.login}`:""});await setAuthenticationState({codeVerifier:Wn,codeChallenge:Yn,redirectUrl:hi}),IS_RUNNING_IN_ELECTRON?In.next(yi=>({...yi,signInState:"sign-in",electron:{signInUrl:mi}})):redirect(mi)},[In,Rn?.instanceUrl,Rn?.organization]);return reactExports.useEffect(()=>registerReceiveMessage(RENEW_SESSION_MESSAGE,()=>{Mn(null,LogLevel.info,"Renew user session"),Ln(In.value()?.activeSession)}),[In,Mn,Ln]),jsx$1(SignInContext.Provider,{value:Ln,children:on})}const SignInActiveSessionContext=createNamedContext(asyncNoop,"SignInActiveSession");function SignInActiveSessionProvider({children:on,state$:In}){const Rn=useSignIn(),Mn=reactExports.useCallback(async()=>{await Rn(In.value()?.activeSession)},[Rn,In]);return jsx$1(SignInActiveSessionContext.Provider,{value:Mn,children:on})}function useSignInActiveSession(){return reactExports.useContext(SignInActiveSessionContext)}const SessionStateContext=createNamedContext(null,"SessionState");function ActiveSessionSelector(on){return on.activeSession}function useActiveSession(){return useSelector(SessionStateContext,ActiveSessionSelector)}function useActiveSessionObservable(){return useSelectionObservable(reactExports.useContext(SessionStateContext),ActiveSessionSelector,void 0)}function SignInStateSelector(on){return on.signInState}function useSignInState(){return useSelector(SessionStateContext,SignInStateSelector)}function useSignInStateObservable(){return useSelectionObservable(reactExports.useContext(SessionStateContext),SignInStateSelector,INITIAL_STATE$4.signInState)}function SessionsSelector(on){return on.sessions}function useSessions(){return useSelector(SessionStateContext,SessionsSelector)}function IsUserAccountMissingSelector(on){return on.activeSession?.hasUserAccount===!1}function useIsUserAccountMissing(){return useSelector(SessionStateContext,IsUserAccountMissingSelector)}const SignOutAllContext=createNamedContext(asyncNoop,"SignOutAll");function SignOutAllProvider({children:on,state$:In}){const Rn=reactExports.useCallback(()=>{const Mn=In.value().sessions;return triggerSignOutNotification(signOutFromIssuers(Mn,!0).then(()=>{In.next({sessions:[],signInState:"signed-out",synchronizing:!1})}))},[In]);return jsx$1(SignOutAllContext.Provider,{value:Rn,children:on})}function useSignOutAll(){return reactExports.useContext(SignOutAllContext)}async function signOutFromIssuers(on,In){await Promise.all(on.map(async({idToken:Rn,issuer:Mn})=>{try{await fetch(`${Mn}/connect/endsession?id_token_hint${Rn?`=${Rn}`:""}`)}finally{}})),await purgeByTenants(on),In&&sendMessage({kind:SIGNED_OUT_MESSAGE})}function refreshSignInState(on){return{...on,signInState:on.activeSession?.hasUserAccount?"signed-in":"signed-out"}}function parseCodeFromUrl(on){const In=parseCodeResponse(new URL(on));if(!In.code)throw new Error("no code");return In.code}function parseIssuerFromUrl(on){const In=new URL(on),Rn=In.searchParams.get("iss");if(Rn)return removeTrailingSlash(Rn);if(In.hash?.length>0)return parseIssuerFromUrl("http://temp/"+In.hash.substring(1));throw new Error("Could not get issuer from callback url")}async function getAndValidateAuthenticationState(){const on=await getAuthenticationState();if(!on?.codeVerifier||!on.codeChallenge||!on.redirectUrl)throw new Error("illegal auth state");return on}async function getAndValidateToken(on,In,Rn,Mn,Ln){const Hn=await getToken$1({accessTokenUrl:`${on}/connect/token`,clientId:"3c9f56bd-0e2c-4358-9bf5-ff3a0efa9bf5",credentialsInBody:!1,redirectUrl:Rn,code:In,codeVerifier:Mn},Ln),{refreshToken:jn,identityToken:Wn,accessToken:Yn,expiresAt:hi}=Hn;if(!jn||!Wn||!Yn||!hi)throw new Error("illegal auth state");return{refreshToken:jn,idToken:Wn,accessToken:Yn,expiresAt:hi}}function parseAccessToken(on){const In=parseJwt(on)??{},{tenant:Rn,sub:Mn,email:Ln,login:Hn,api_url:jn}=In,Wn=Yn=>Yn instanceof String||typeof Yn=="string";if(!Wn(Rn)||!Wn(Mn)||!Wn(Ln)||!Wn(Hn)||!Wn(jn))throw new Error("Could not parse access token");return{tenant:Rn,sub:Mn,email:Ln,login:Hn,apiUrl:`https://${jn}`}}async function fetchOrganizationInfo(on){const In=await sessionSchedulerClient.fetchOrganizationInfo(on);switch(In.kind){case"error":throw new Error(In.error);case"personal":return{displayName:"Personal Account",id:PERSONAL_ORGANIZATION_ID};case"organization":{const{displayName:Rn,id:Mn}=In;if(!Rn||!Mn)throw new Error("Could not parse the organization info response");return{displayName:Rn,id:Mn}}default:throw new Error("Illegal state")}}async function fetchUserAccount(on){const In=await sessionSchedulerClient.fetchUserAccount(on);switch(In.kind){case"error":throw new Error(In.error);case"user-not-found":return"user-not-found";case"user":const{id:Rn,username:Mn,billingUrl:Ln,manageTenantUrl:Hn}=In;if(!Mn||!Rn)throw new Error("Could not parse the user response");return{id:Rn,username:Mn,billingUrl:Ln,manageTenantUrl:Hn};default:throw new Error("Illegal state")}}function getRedirectUrl(){return IS_RUNNING_IN_ELECTRON?`${APP_SCHEME}://${APP_SIGNIN_PATH}`:appendUrlSegment(window.location.href,APP_SIGNIN_PATH).toString()}function redirect(on){IS_RUNNING_IN_ELECTRON?window.open(on):window.location.replace(on)}function isSigninRedirect({hash:on,pathname:In}){return on.startsWith(`#/${APP_SIGNIN_PATH}`)||In.endsWith(`/${APP_SIGNIN_PATH}`)}const DEFAULT_WORKSPACE_NAME="Default",DEFAULT_STATE={workspaces:[],activeWorkspace:void 0,synchronizing:!1,synchronizationResult:null,loading:!1};function WorkspaceProvider({children:on}){const In=reactExports.useRef(null),[Rn,Mn]=useInitialize$5();return Rn?jsx$1(ActivateWorkspaceProvider,{state$:Rn,activeSession$:Mn,children:jsx$1(CancelSynchronizeWorkspaceProvider,{abortControllerRef:In,children:jsx$1(SynchronizeWorkspaceProvider,{state$:Rn,abortControllerRef:In,children:jsx$1(WorkspaceStateContext.Provider,{value:Rn,children:on})})})}):null}function useInitialize$5(){const on=useForceUpdate(),In=useActiveSessionObservable(),Rn=reactExports.useRef(null);return reactExports.useEffect(()=>{let Mn;async function Ln(Hn){if(Rn.current)areTenantsEqual(Mn,Hn)&&Mn?.hasUserAccount===Hn?.hasUserAccount||(Mn=Hn,Hn&&Hn.hasUserAccount?(Rn.current.next(jn=>({...jn,loading:!0})),await loadInitialState(Hn,Rn.current)):Rn.current.next(DEFAULT_STATE));else if(Mn=Hn,Hn&&Hn.hasUserAccount){Rn.current=createSubject({...DEFAULT_STATE,loading:!0});try{await loadInitialState(Hn,Rn.current)}finally{on()}}else Rn.current=createSubject(DEFAULT_STATE),on()}return Ln(In.value()),In.subscribe(Ln)},[In,on]),usePersistState$1(Rn.current),[Rn.current,In]}function usePersistState$1(on){reactExports.useEffect(()=>{if(on){const In=on.value().activeWorkspace;return on.subscribe(async Rn=>{Rn.activeWorkspace&&Rn.activeWorkspace!==In&&await upsertWorkspace(Rn.activeWorkspace)})}},[on])}async function loadInitialState(on,In,Rn){try{const Mn=await loadWorkspaces(on,In);let Ln;try{Ln=await refreshWorkspaces(on,In,Rn),Ln.length||(triggerPrepareWorkspaceNotification(),await sessionSchedulerClient.createWorkspace(on,DEFAULT_WORKSPACE_NAME),Ln=await loadWorkspaces(on,In))}catch{Ln=Mn}Ln.length?triggerWorkspacePrepared():triggerWorkspacePreparationFailed()}catch{In.next(DEFAULT_STATE)}}async function loadWorkspaces(on,In){const Rn=await getWorkspacesByTenant(on);let Mn=on.activeWorkspaceId?Rn.find(({id:Ln})=>Ln===on.activeWorkspaceId):void 0;return!Mn&&Rn.length&&(Mn=Rn[0]),sendMessage({kind:ACTIVATED_WORKSPACE_MESSAGE,session:on,workspaceId:Mn?.id??null}),In.next(Ln=>({...Ln,activeWorkspace:Mn,workspaces:Rn,loading:!Rn.length})),Rn}async function refreshWorkspaces(on,In,Rn){return await sessionSchedulerClient.fetchWorkspaces(on,Rn),loadWorkspaces(on,In)}const ActivateWorkspaceContext=createNamedContext(noop$2,"ActivateWorkspace");function ActivateWorkspaceProvider({children:on,state$:In,activeSession$:Rn}){const Mn=reactExports.useCallback(Ln=>{const Hn=In.value(),jn=Rn.value();if(!jn||Hn.activeWorkspace?.id===Ln)return;const Wn=Hn.workspaces.find(({id:Yn})=>Yn===Ln);Wn&&(sendMessage({kind:ACTIVATED_WORKSPACE_MESSAGE,session:jn,workspaceId:Wn.id}),In.next(Yn=>({...Yn,activeWorkspace:Wn})))},[Rn,In]);return jsx$1(ActivateWorkspaceContext.Provider,{value:Mn,children:on})}function useActivateWorkspace(){return reactExports.useContext(ActivateWorkspaceContext)}const CancelSynchronizeWorkspaceContext=createNamedContext(noop$2,"CancelSynchronizeWorkspace");function CancelSynchronizeWorkspaceProvider({children:on,abortControllerRef:In}){const Rn=reactExports.useCallback(()=>{In.current?.abort()},[In]);return jsx$1(CancelSynchronizeWorkspaceContext.Provider,{value:Rn,children:on})}const SynchronizeWorkspaceContext=createNamedContext(asyncNoop,"SynchronizeWorkspace");function SynchronizeWorkspaceProvider({children:on,state$:In,abortControllerRef:Rn}){const Mn=useIsOnline(),Ln=reactExports.useRef(Mn),Hn=useDatabaseVersion(),jn=useAppendLogEntry();Ln.current=Mn;const Wn=reactExports.useCallback(async()=>{const Yn=In.value().activeWorkspace;if(!Yn||Rn.current||!Ln.current)return;Rn.current=new AbortController,In.next(gi=>({...gi,synchronizing:!0}));const vi=Yn.dbVersion!==Hn?void 0:Yn.version;try{const gi=await synchronizeWorkspace(jn,Yn.id,vi,Rn.current.signal);if(gi){const mi=yi=>yi&&yi.id===Yn.id?{...yi,version:gi.version,hasChanges:gi.hasChanges,dbVersion:Hn}:yi;In.next(yi=>{const bi=mi(yi.activeWorkspace);return{...yi,activeWorkspace:bi,workspaces:yi.workspaces.map(Ei=>Ei.id===bi?.id?bi:Ei),synchronizing:!1,synchronizationResult:gi}})}else In.next(mi=>mi.synchronizing?{...mi,synchronizing:!1}:mi)}catch{In.next(gi=>gi.synchronizing?{...gi,synchronizing:!1}:gi)}finally{Rn.current=null}},[Rn,Hn,In,jn]);return useTriggerSynchronizationOnWorkspaceSwitch(Wn,In),useSynchronizeWorkspaceEveryMinute(Wn,Mn),jsx$1(SynchronizeWorkspaceContext.Provider,{value:Wn,children:on})}async function synchronizeWorkspace(on,In,Rn,Mn){try{const Ln=await sessionSchedulerClient.synchronizeWorkspace(In,Rn,Mn);if(Ln.kind==="aborted")return null;switch(Ln.version&&Ln.version!==Rn&&sendMessage({kind:WORKSPACE_SYNCHRONIZED_MESSAGE,workspaceId:In,version:Ln.version}),Ln.kind){case"cancelled":return on(null,LogLevel.info,"Workspace synchronization has been cancelled."),{workspaceId:Ln.workspaceId,version:Ln.version,hasChanges:Ln.hasChanges};case"failed":return on(null,LogLevel.info,"Workspace synchronization has been failed."),null;case"success":return{workspaceId:Ln.workspaceId,version:Ln.version,hasChanges:Ln.hasChanges}}}catch{return on(null,LogLevel.info,"Workspace synchronization has been failed."),null}}function useSynchronizeWorkspaceEveryMinute(on,In){const Mn=useActiveSession()?.requiresSignIn;reactExports.useEffect(()=>{if(In){let Ln=!1;const Hn=()=>window.setTimeout(async()=>{Mn||await on(),Ln||(jn=Hn())},ONE_MINUTE$1);let jn=Hn();return()=>{Ln=!0,window.clearTimeout(jn)}}},[In,on,Mn])}function useTriggerSynchronizationOnWorkspaceSwitch(on,In){reactExports.useEffect(()=>{let Rn;function Mn(Ln){Ln.activeWorkspace?.id!==Rn&&(Rn=Ln.activeWorkspace?.id,Ln.activeWorkspace&&!Ln.synchronizing&&on())}return Mn(In.value()),In.subscribe(Mn)},[on,In])}function useSynchronizeWorkspace(){const on=reactExports.useContext(SynchronizeWorkspaceContext);return()=>void on()}const WorkspaceStateContext=createNamedContext(null,"WorkspaceStateContext");function useWorkspaceStateSubject(){return reactExports.useContext(WorkspaceStateContext)}function ActiveWorkspaceSelector(on){return on.activeWorkspace??null}function useActiveWorkspace(){return useSelector(WorkspaceStateContext,ActiveWorkspaceSelector)}function useActiveWorkspaceObservable(){return useSelectionObservable(reactExports.useContext(WorkspaceStateContext),ActiveWorkspaceSelector,null)}function WorkspacesSelector(on){return on.workspaces}function useWorkspaces(){return useSelector(WorkspaceStateContext,WorkspacesSelector)}function WorkspaceIdSelector(on){return on.activeWorkspace?.id??null}function useWorkspaceId(){return useSelector(WorkspaceStateContext,WorkspaceIdSelector)}function useWorkspaceIdObservable(){return useSelectionObservable(reactExports.useContext(WorkspaceStateContext),WorkspaceIdSelector,null)}function WorkspaceNameSelector(on){return on.activeWorkspace?.name??null}function useWorkspaceNameObservable(){return useSelectionObservable(reactExports.useContext(WorkspaceStateContext),WorkspaceNameSelector,null)}function WorkspaceSynchronizingSelector(on){return on.synchronizing}function useWorkspaceSynchronizing(){return useSelector(WorkspaceStateContext,WorkspaceSynchronizingSelector)}function IsOrganizationalWorkspace(on){return on.activeWorkspace?on.activeWorkspace.tenant!==PERSONAL_WORKSPACE_TENANT:!1}function useIsOrganizationalWorkspace(){return useSelector(WorkspaceStateContext,IsOrganizationalWorkspace)}function useReloadWorkspaces(){const on=reactExports.useContext(WorkspaceStateContext),In=useActiveSession();return reactExports.useCallback(async()=>{!on||!In||await refreshWorkspaces(In,on)},[on,In])}const INITIAL_STATE$3={activeEnvironment:null,environments:[],loading:!1};function EnvironmentProvider({children:on}){const In=useWorkspaceIdObservable(),Rn=useInitialize$4(In);return Rn?jsx$1(CreateEnvironmentProvider,{state$:Rn,workspaceId$:In,children:jsx$1(DeleteEnvironmentProvider,{state$:Rn,workspaceId$:In,children:jsx$1(RenameEnvironmentProvider,{state$:Rn,workspaceId$:In,children:jsx$1(EnvironmentStateContext.Provider,{value:Rn,children:on})})})}):null}function useInitialize$4(on){const In=useForceUpdate(),Rn=useCombine(on,useActiveEnvironmentIdObservable()),Mn=reactExports.useRef(null);return reactExports.useEffect(()=>{let Ln=null,Hn=null;async function jn(hi,vi){async function gi(mi,yi){if(mi.next({...INITIAL_STATE$3,loading:!!yi}),!!yi)try{const bi=await getEnvironmentItems(yi);mi.next({activeEnvironment:bi.find(({id:Ei})=>Ei===vi)??null,environments:sortEnvironments(bi),loading:!1})}catch{mi.next(INITIAL_STATE$3)}}if(Mn.current)Ln!==hi?await gi(Mn.current,hi):Hn!==vi&&Mn.current.next(mi=>({...mi,activeEnvironment:mi.environments.find(({id:yi})=>yi===vi)??null}));else{Mn.current=createSubject(INITIAL_STATE$3);try{await gi(Mn.current,hi)}finally{In()}}Ln=hi,Hn=vi}const[Wn,Yn]=Rn.value();return jn(Wn,Yn),Rn.subscribe(([hi,vi])=>jn(hi,vi))},[Rn,In]),useCleanupRemovedEnvironments(Mn.current),useReloadEnvironments(Mn.current),Mn.current}function useCleanupRemovedEnvironments(on){const In=useActivateEnvironment();reactExports.useEffect(()=>{if(on)return registerReceiveMessage(DELETED_ITEMS_MESSAGE,({deletedItems:Rn})=>{const Mn=Rn.filter(({kind:Hn})=>isEnvironmentItemKind(Hn)).map(({id:Hn})=>Hn),Ln=on.value().activeEnvironment?.id;Ln&&Mn.includes(Ln)&&In(null),on.next(Hn=>Mn.length?{...Hn,environments:Hn.environments.filter(({id:jn})=>!Mn.includes(jn))}:Hn)})},[on,In])}function useReloadEnvironments(on){const In=useActivateEnvironment();reactExports.useEffect(()=>{if(on)return registerReceiveMessage(WORKSPACE_SYNCHRONIZED_MESSAGE,async({workspaceId:Rn})=>{const Mn=await getEnvironmentItems(Rn),Ln=on.value().activeEnvironment?.id;Ln&&!Mn.some(({id:jn})=>jn===Ln)&&In(null);let{activeEnvironment:Hn}=on.value();Hn&&(Hn=await getEnvironmentItem(Hn.id)??null),on.next(jn=>({...jn,activeEnvironment:Hn,environments:sortEnvironments(Mn)}))})},[on,In])}function sortEnvironments(on){return on.sort((In,Rn)=>In.name.localeCompare(Rn.name,"en",{sensitivity:"base"}))}const EnvironmentStateContext=createNamedContext(null,"EnvironmentState");function useActivateEnvironment(){return useSubjectNext(useWorkspaceStateSubject(),updateActiveEnvironmentId)}function updateActiveEnvironmentId(on,In){const{activeWorkspace:Rn}=on;return!Rn||ActiveEnvironmentIdSelector(on)===In?on:{...on,activeWorkspace:{...Rn,appState:{...Rn.appState,activeEnvironmentId:In}}}}const CreateEnvironmentContext=createNamedContext(asyncNoop,"CreateEnvironment");function CreateEnvironmentProvider({children:on,state$:In,workspaceId$:Rn}){const Mn=reactExports.useCallback(async(Ln,Hn)=>{const jn=Rn.value();jn&&(await createEnvironmentItem(Ln,jn,null,null,Hn),In.next(Wn=>({...Wn,environments:sortEnvironments([...Wn.environments,{id:Ln,name:Hn}])})))},[In,Rn]);return jsx$1(CreateEnvironmentContext.Provider,{value:Mn,children:on})}const DeleteEnvironmentContext=createNamedContext(asyncNoop,"CreateEnvironment");function useDeleteEnvironment(){return reactExports.useContext(DeleteEnvironmentContext)}function DeleteEnvironmentProvider({children:on,state$:In,workspaceId$:Rn}){const Mn=useActivateEnvironment(),Ln=useSynchronizeWorkspace(),Hn=reactExports.useCallback(async jn=>{const Wn=Rn.value();if(Wn){const Yn=In.value().activeEnvironment?.id===jn;Yn&&Mn(null);const hi=await deleteItem(jn);In.next(vi=>({...vi,environments:vi.environments.filter(gi=>gi.id!==jn),activeEnvironment:Yn?null:vi.activeEnvironment})),sendMessage({kind:DELETED_ITEMS_MESSAGE,workspaceId:Wn,deletedItems:hi}),Ln()}},[In,Rn,Mn,Ln]);return jsx$1(DeleteEnvironmentContext.Provider,{value:Hn,children:on})}const RenameEnvironmentContext=createNamedContext(asyncNoop,"CreateEnvironment");function useRenameEnvironment(){return reactExports.useContext(RenameEnvironmentContext)}function RenameEnvironmentProvider({children:on,state$:In,workspaceId$:Rn}){const Mn=useSynchronizeWorkspace(),Ln=reactExports.useCallback(async(Hn,jn)=>{const Wn=Rn.value();if(Wn){let Yn=In.value().activeEnvironment;Yn?.id===Hn&&(Yn={id:Hn,name:jn});const hi=await renameItem(Hn,jn);hi&&(In.next(vi=>({...vi,environments:sortEnvironments(vi.environments.map(gi=>gi.id===Hn?{id:Hn,name:jn}:gi)),activeEnvironment:Yn})),sendMessage({kind:RENAMED_ITEM_MESSAGE,workspaceId:Wn,itemId:Hn,itemKind:hi.kind,itemName:jn}),Mn())}},[In,Rn,Mn]);return jsx$1(RenameEnvironmentContext.Provider,{value:Ln,children:on})}function ActiveEnvironmentSelector(on){return on.activeEnvironment}function useActiveEnvironment(){return useSelector(EnvironmentStateContext,ActiveEnvironmentSelector)}function ActiveEnvironmentIdSelector(on){return on.activeWorkspace?.appState?.activeEnvironmentId||null}function useActiveEnvironmentId(){return useObservableSelector(useWorkspaceStateSubject(),ActiveEnvironmentIdSelector)}function useActiveEnvironmentIdObservable(){return useSelectionObservable(useWorkspaceStateSubject(),ActiveEnvironmentIdSelector,null)}function EnvironmentsSelector(on){return on.environments}function useEnvironments(){return useSelector(EnvironmentStateContext,EnvironmentsSelector)}function useFetchToken(){const on=useActiveEnvironmentId(),[In,Rn]=reactExports.useState(!1),[Mn,Ln]=reactExports.useState(),Hn=reactExports.useRef(),jn=reactExports.useCallback(()=>{Hn.current?.abort(),Hn.current=void 0,Rn(!1)},[Rn]),Wn=reactExports.useCallback(async Yn=>{if(In)return;const hi=new AbortController;Hn.current=hi;try{Rn(!0),Ln(void 0);const vi=await getResolvedVariables(on);return await authorizeAndGetToken(interpolateOAuth2Authentication(Yn,vi)??Yn,hi.signal)}catch(vi){Ln(vi);return}finally{Rn(!1),hi.abort()}},[on,In,Ln,Rn]);return reactExports.useEffect(()=>jn,[jn]),{error:Mn,cancel:jn,fetchToken:Wn,loading:In}}const INITIAL_STATE$2={refs:{},cache:{}};function ConnectionSettingsProvider({children:on}){const In=useInitialize$3();return jsx$1(UpdateConnectionSettingsProvider,{state$:In.current,children:jsx$1(ConnectionSettingsStateContext.Provider,{value:In.current,children:on})})}function useInitialize$3(){const on=useRefWithInitializer(()=>createSubject(INITIAL_STATE$2)),In=useItemStore(),Rn=useSetCacheItem(on.current);return useConnectionSettingsUpdated(on.current),reactExports.useEffect(()=>In.subscribeAll(async(Mn,Ln)=>{if(!(!isApiItem(Ln)&&!isDocumentItem(Ln)))switch(Mn){case ItemChangeAction.LOAD:{const Hn=isApiDocumentItem(Ln)?Ln.apiId:Ln.id,jn=on.current.value().refs[Ln.id],Wn=on.current.value();if(isApiItem(Ln)&&isApiAlreadyCached(Wn,Hn)){on.current.next(hi=>removeUnreferencedCacheItem({...hi,refs:{...hi.refs,[Ln.id]:Hn}},jn));break}const Yn=(await getConnectionSettings(Hn))?.http??DEFAULT_HTTP_CONNECTION;Rn(Hn,jn,Ln.id,Yn)}break;case ItemChangeAction.UNLOAD:{const Hn=on.current.value().refs[Ln.id];if(!Hn)return;on.current.next(jn=>removeCacheItemAndKey(jn,Hn,Ln.id))}break}}),[on,In,Rn]),on}function useConnectionSettingsUpdated(on){reactExports.useEffect(()=>registerReceiveMessage(CONNECTION_SETTINGS_UPDATED_MESSAGE,({documentId:In,connectionSettings:Rn})=>{const Mn=on.value().refs[In];Mn&&on.next(Ln=>({...Ln,cache:{...Ln.cache,[Mn]:{...Ln.cache[Mn],data:Rn.http}}}))}),[on])}const ConnectionSettingsStateContext=createNamedContext(null,"ConnectionSettingsState");function ConnectionSettingsSelector(on){return reactExports.useCallback(In=>{const Rn=In.refs[on]??"";return{apiOrDocumentId:Rn,httpConnection:In.cache[Rn]?.data??DEFAULT_HTTP_CONNECTION}},[on])}function useConnectionSettings(on){return useSelector(ConnectionSettingsStateContext,ConnectionSettingsSelector(on))}function AuthorizationHeaderValueSelector(on){return In=>ConnectionSettingsSelector(on)(In).httpConnection.authentication?.headerValue??null}function useAuthorizationHeaderValue(on){return useSelector(ConnectionSettingsStateContext,AuthorizationHeaderValueSelector(on))}function HttpHeadersSelector(on){return In=>ConnectionSettingsSelector(on)(In).httpConnection.headers??null}function useHttpHeaders(on){return useSelector(ConnectionSettingsStateContext,HttpHeadersSelector(on))}function HttpSchemaEndpointSelector(on){return In=>{const Rn=ConnectionSettingsSelector(on)(In).httpConnection;return Rn.sdlEndpoint||Rn.endpoint}}function useHttpSchemaEndpoint(on){return useSelector(ConnectionSettingsStateContext,HttpSchemaEndpointSelector(on))}function useHttpSchemaEndpointObservable(on){return useSelectionObservable(reactExports.useContext(ConnectionSettingsStateContext),In=>{const Rn=In.refs[on]??"",Mn=In.cache[Rn]?.data??DEFAULT_HTTP_CONNECTION;return Mn.sdlEndpoint||Mn.endpoint},"")}function HttpEndpointSelector(on){return In=>ConnectionSettingsSelector(on)(In).httpConnection.endpoint}function useHttpEndpoint(on){return useSelector(ConnectionSettingsStateContext,HttpEndpointSelector(on))}function useBeautifiedHttpEndpoint(on){return beautifyEndpoint(useSelector(ConnectionSettingsStateContext,HttpEndpointSelector(on)))}function QueryPlanEnabledSelector(on){return In=>ConnectionSettingsSelector(on)(In).httpConnection.headers?.some(({name:Rn,value:Mn,enabled:Ln})=>FUSION_OPERATION_PLAN_HEADER_NAME_PATTERN.test(Rn)&&Mn.trim()==="1"&&Ln)??!1}function useQueryPlanEnabled(on){return useSelector(ConnectionSettingsStateContext,QueryPlanEnabledSelector(on))}const UpdateConnectionSettingsContext=createNamedContext(asyncNoop,"UpdateConnectionSettings");function UpdateConnectionSettingsProvider({children:on,state$:In}){const Rn=reactExports.useCallback(async function(Ln,Hn,jn){const Wn=await updateHttpConnectionSettings(Ln,Hn,jn);Wn&&In.next(Yn=>Yn.cache[Wn.itemId]?{...Yn,cache:{...Yn.cache,[Wn.itemId]:{...Yn.cache[Wn.itemId],data:Wn.http}}}:Yn)},[In]);return jsx$1(UpdateConnectionSettingsContext.Provider,{value:Rn,children:on})}function useUpdateConnectionSettings(){return reactExports.useContext(UpdateConnectionSettingsContext)}function useEnableQueryPlan(on){const In=useUpdateConnectionSettings(),Rn=useHttpHeaders(on);return reactExports.useCallback(Mn=>{if(!Rn)return In(on,{headers:[{name:HEADER_FUSION_OPERATION_PLAN,value:"1",enabled:!0}]},Mn);const Ln=Rn.findLastIndex(({name:Hn})=>FUSION_OPERATION_PLAN_HEADER_NAME_PATTERN.test(Hn));return In(on,{headers:Ln!==-1?Rn.map((Hn,jn)=>jn===Ln?{name:HEADER_FUSION_OPERATION_PLAN,value:"1",enabled:!0}:Hn):[...Rn,{name:HEADER_FUSION_OPERATION_PLAN,value:"1",enabled:!0}]})},[on,Rn,In])}function useSetCacheItem(on){return reactExports.useCallback((In,Rn,Mn,Ln)=>{const Hn={apiOrDocumentId:In,data:Ln};on.next(jn=>removeUnreferencedCacheItem({...jn,refs:{...jn.refs,[Mn]:In},cache:{...jn.cache,[In]:Hn}},Rn))},[on])}function isApiAlreadyCached(on,In){return Object.values(on.refs).some(Rn=>Rn===In)}function removeCacheItemAndKey(on,In,Rn){const Mn=Object.values(on.refs).filter(jn=>jn===In).length,Ln=Object.entries(on.cache).filter(([jn])=>!(jn===In&&!Mn)),Hn=Object.entries(on.refs).filter(([jn])=>jn!==Rn);return{...on,refs:Object.fromEntries(Hn),cache:Object.fromEntries(Ln)}}function removeUnreferencedCacheItem(on,In){const Rn=Object.values(on.refs).filter(Ln=>Ln===In).length,Mn=Object.entries(on.cache).filter(([Ln])=>!(Ln===In&&!Rn));return{...on,cache:Object.fromEntries(Mn)}}const modalSubject$=createSubject(void 0),modalApi={get current(){return modalSubject$.observable},show(on){modalSubject$.next(on)},hide(on,In){const Rn=modalSubject$.value();Rn?.id===on&&(modalSubject$.next(void 0),In!==void 0&&Rn.onDone?.(In))}};function isEqual(on,In){return on?.item?.id===In?.item?.id}function useActiveModal(on){const In=reactExports.useCallback(Rn=>{if(Rn&&(!on||on&&Rn.id===on))return{item:Rn,hide(Mn){modalApi.hide(Rn.id,Mn)}}},[on]);return useSyncStore(modalApi.current,In,{useRequestAnimationFrame:!1,isEqual})}const ButtonGroup=styled("div")(({theme:on})=>css`
|
|
4723
|
+
`,_gql_doc={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"IntrospectionQuery"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__type"},arguments:[{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"StringValue",value:"__Type",block:!1}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"fields"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:137,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:_gql_source}}};print(_gql_doc$3);print(_gql_doc$2);print(_gql_doc$1);print(_gql_doc);const SERVER_NOT_REACHABLE="Server Not Reachable";function isServerNotReachableError(on){return isDictionary(on)&&"message"in on&&on.message===SERVER_NOT_REACHABLE}class SchedulerClientBase extends MessageObserver{constructor(In){super(),this.createWorker=In}#e;#t;#r=!0;#n;#i=0;getContext(){if(!this.#e){const In=this.createWorker(),Rn={sendMessage:Mn=>In.postMessage(Mn)};In.onmessage=({data:Mn})=>{this.handleMessage(Rn,Mn)},this.#t=In,this.#e=Rn,this.#n=this.registerReceiveMessageHandler("scheduler-status-updated",({payload:{idling:Mn,lastUpdated:Ln}})=>{this.#r=Mn,this.#i=Ln}),this.checkIfIdle(),this.initializeWorker()}return this.#e}checkIfIdle(){const In=()=>{if(this.#t&&this.#r&&document.hidden&&now()-this.#i>TWO_MINUTES){this.stopWorker();return}this.checkIfIdle()};window.setTimeout(In,THIRTY_SECONDS)}initializeWorker(){this.sendMessage(new Message(INITIALIZE_WORKER_MESSAGE_TYPE,{appNamespace:window.appNamespace}))}stopWorker(){this.#t?.terminate(),this.#n?.(),this.#n=void 0,this.#t=void 0,this.#e=void 0}cancelTask(In){this.sendMessage(new Message(CANCEL_TASK_MESSAGE_TYPE,{taskId:In}))}}const DOCUMENT_ANALYSIS_MESSAGE_TYPE="analyze-document",DOCUMENT_OPERATIONS_ANALYSIS_MESSAGE_TYPE="analyze-document-operations",FILES_UPDATED_MESSAGE_TYPE="files-updated",VARIABLE_JSON_SCHEMA_UPDATED_MESSAGE_TYPE="variable-json-schema-updated";var backo2,hasRequiredBacko2;function requireBacko2(){if(hasRequiredBacko2)return backo2;hasRequiredBacko2=1,backo2=on;function on(In){In=In||{},this.ms=In.min||100,this.max=In.max||1e4,this.factor=In.factor||2,this.jitter=In.jitter>0&&In.jitter<=1?In.jitter:0,this.attempts=0}return on.prototype.duration=function(){var In=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var Rn=Math.random(),Mn=Math.floor(Rn*this.jitter*In);In=(Math.floor(Rn*10)&1)==0?In-Mn:In+Mn}return Math.min(In,this.max)|0},on.prototype.reset=function(){this.attempts=0},on.prototype.setMin=function(In){this.ms=In},on.prototype.setMax=function(In){this.max=In},on.prototype.setJitter=function(In){this.jitter=In},backo2}requireBacko2();var eventemitter3={exports:{}},hasRequiredEventemitter3;function requireEventemitter3(){return hasRequiredEventemitter3||(hasRequiredEventemitter3=1,function(on){var In=Object.prototype.hasOwnProperty,Rn="~";function Mn(){}Object.create&&(Mn.prototype=Object.create(null),new Mn().__proto__||(Rn=!1));function Ln(Yn,hi,vi){this.fn=Yn,this.context=hi,this.once=vi||!1}function Hn(Yn,hi,vi,gi,mi){if(typeof vi!="function")throw new TypeError("The listener must be a function");var yi=new Ln(vi,gi||Yn,mi),bi=Rn?Rn+hi:hi;return Yn._events[bi]?Yn._events[bi].fn?Yn._events[bi]=[Yn._events[bi],yi]:Yn._events[bi].push(yi):(Yn._events[bi]=yi,Yn._eventsCount++),Yn}function jn(Yn,hi){--Yn._eventsCount===0?Yn._events=new Mn:delete Yn._events[hi]}function Wn(){this._events=new Mn,this._eventsCount=0}Wn.prototype.eventNames=function(){var hi=[],vi,gi;if(this._eventsCount===0)return hi;for(gi in vi=this._events)In.call(vi,gi)&&hi.push(Rn?gi.slice(1):gi);return Object.getOwnPropertySymbols?hi.concat(Object.getOwnPropertySymbols(vi)):hi},Wn.prototype.listeners=function(hi){var vi=Rn?Rn+hi:hi,gi=this._events[vi];if(!gi)return[];if(gi.fn)return[gi.fn];for(var mi=0,yi=gi.length,bi=new Array(yi);mi<yi;mi++)bi[mi]=gi[mi].fn;return bi},Wn.prototype.listenerCount=function(hi){var vi=Rn?Rn+hi:hi,gi=this._events[vi];return gi?gi.fn?1:gi.length:0},Wn.prototype.emit=function(hi,vi,gi,mi,yi,bi){var Ei=Rn?Rn+hi:hi;if(!this._events[Ei])return!1;var _i=this._events[Ei],xi=arguments.length,Ci,Ai;if(_i.fn){switch(_i.once&&this.removeListener(hi,_i.fn,void 0,!0),xi){case 1:return _i.fn.call(_i.context),!0;case 2:return _i.fn.call(_i.context,vi),!0;case 3:return _i.fn.call(_i.context,vi,gi),!0;case 4:return _i.fn.call(_i.context,vi,gi,mi),!0;case 5:return _i.fn.call(_i.context,vi,gi,mi,yi),!0;case 6:return _i.fn.call(_i.context,vi,gi,mi,yi,bi),!0}for(Ai=1,Ci=new Array(xi-1);Ai<xi;Ai++)Ci[Ai-1]=arguments[Ai];_i.fn.apply(_i.context,Ci)}else{var Ii=_i.length,Ni;for(Ai=0;Ai<Ii;Ai++)switch(_i[Ai].once&&this.removeListener(hi,_i[Ai].fn,void 0,!0),xi){case 1:_i[Ai].fn.call(_i[Ai].context);break;case 2:_i[Ai].fn.call(_i[Ai].context,vi);break;case 3:_i[Ai].fn.call(_i[Ai].context,vi,gi);break;case 4:_i[Ai].fn.call(_i[Ai].context,vi,gi,mi);break;default:if(!Ci)for(Ni=1,Ci=new Array(xi-1);Ni<xi;Ni++)Ci[Ni-1]=arguments[Ni];_i[Ai].fn.apply(_i[Ai].context,Ci)}}return!0},Wn.prototype.on=function(hi,vi,gi){return Hn(this,hi,vi,gi,!1)},Wn.prototype.once=function(hi,vi,gi){return Hn(this,hi,vi,gi,!0)},Wn.prototype.removeListener=function(hi,vi,gi,mi){var yi=Rn?Rn+hi:hi;if(!this._events[yi])return this;if(!vi)return jn(this,yi),this;var bi=this._events[yi];if(bi.fn)bi.fn===vi&&(!mi||bi.once)&&(!gi||bi.context===gi)&&jn(this,yi);else{for(var Ei=0,_i=[],xi=bi.length;Ei<xi;Ei++)(bi[Ei].fn!==vi||mi&&!bi[Ei].once||gi&&bi[Ei].context!==gi)&&_i.push(bi[Ei]);_i.length?this._events[yi]=_i.length===1?_i[0]:_i:jn(this,yi)}return this},Wn.prototype.removeAllListeners=function(hi){var vi;return hi?(vi=Rn?Rn+hi:hi,this._events[vi]&&jn(this,vi)):(this._events=new Mn,this._eventsCount=0),this},Wn.prototype.off=Wn.prototype.removeListener,Wn.prototype.addListener=Wn.prototype.on,Wn.prefixed=Rn,Wn.EventEmitter=Wn,on.exports=Wn}(eventemitter3)),eventemitter3.exports}requireEventemitter3();var defaults={},hasRequiredDefaults;function requireDefaults(){if(hasRequiredDefaults)return defaults;hasRequiredDefaults=1,Object.defineProperty(defaults,"__esModule",{value:!0}),defaults.WS_TIMEOUT=defaults.MIN_WS_TIMEOUT=void 0;var on=1e3;defaults.MIN_WS_TIMEOUT=on;var In=3e4;return defaults.WS_TIMEOUT=In,defaults}requireDefaults();var messageTypes={},hasRequiredMessageTypes;function requireMessageTypes(){if(hasRequiredMessageTypes)return messageTypes;hasRequiredMessageTypes=1,Object.defineProperty(messageTypes,"__esModule",{value:!0});var on=function(){function In(){throw new Error("Static Class")}return In.GQL_CONNECTION_INIT="connection_init",In.GQL_CONNECTION_ACK="connection_ack",In.GQL_CONNECTION_ERROR="connection_error",In.GQL_CONNECTION_KEEP_ALIVE="ka",In.GQL_CONNECTION_TERMINATE="connection_terminate",In.GQL_START="start",In.GQL_DATA="data",In.GQL_ERROR="error",In.GQL_COMPLETE="complete",In.GQL_STOP="stop",In.SUBSCRIPTION_START="subscription_start",In.SUBSCRIPTION_DATA="subscription_data",In.SUBSCRIPTION_SUCCESS="subscription_success",In.SUBSCRIPTION_FAIL="subscription_fail",In.SUBSCRIPTION_END="subscription_end",In.INIT="init",In.INIT_SUCCESS="init_success",In.INIT_FAIL="init_fail",In.KEEP_ALIVE="keepalive",In}();return messageTypes.default=on,messageTypes}requireMessageTypes();var protocol={},hasRequiredProtocol;function requireProtocol(){if(hasRequiredProtocol)return protocol;hasRequiredProtocol=1,Object.defineProperty(protocol,"__esModule",{value:!0}),protocol.GRAPHQL_SUBSCRIPTIONS=protocol.GRAPHQL_WS=void 0;var on="graphql-ws";protocol.GRAPHQL_WS=on;var In="graphql-subscriptions";return protocol.GRAPHQL_SUBSCRIPTIONS=In,protocol}requireProtocol();var isObject$1={},hasRequiredIsObject;function requireIsObject(){if(hasRequiredIsObject)return isObject$1;hasRequiredIsObject=1,Object.defineProperty(isObject$1,"__esModule",{value:!0});function on(In){return In!==null&&typeof In=="object"}return isObject$1.default=on,isObject$1}requireIsObject();var isString$1={},hasRequiredIsString;function requireIsString(){if(hasRequiredIsString)return isString$1;hasRequiredIsString=1,Object.defineProperty(isString$1,"__esModule",{value:!0});function on(In){return typeof In=="string"}return isString$1.default=on,isString$1}requireIsString();function symbolObservablePonyfill(on){var In,Rn=on.Symbol;return typeof Rn=="function"?Rn.observable?In=Rn.observable:(In=Rn("observable"),Rn.observable=In):In="@@observable",In}var root;typeof self<"u"?root=self:typeof window<"u"?root=window:typeof global$1<"u"?root=global$1:typeof module<"u"?root=module:root=Function("return this")();symbolObservablePonyfill(root);const _global=typeof global$1<"u"?global$1:typeof window<"u"?window:{};_global.WebSocket||_global.MozWebSocket;const EXECUTE_OPERATION_REQUEST_MESSAGE_TYPE="execute-operation",DEFAULT_SCHEMA_INFO={endpoint:"",exists:!1,hash:"",indexed:!1,hasMutationType:!1,hasSubscriptionType:!1,hasUploadType:!1},CANCEL_OPERATION_REQUEST_MESSAGE_TYPE="cancel-request",SCHEMA_API_FETCHER_MESSAGE_TYPE="fetch-api-schema",FETCH_SCHEMA_DIRECTIVE="fetch-directive",FETCH_SCHEMA_DIRECTIVES="fetch-directives",SCHEMA_FETCHER_CACHED_MESSAGE_TYPE="get-cached-schema",SCHEMA_FETCHER_MESSAGE_TYPE="fetch-schema",FETCH_SCHEMA_FIELD_TYPE="fetch-field",FETCH_SCHEMA_FIELD_TYPES="fetch-fields",FETCH_SCHEMA_FIELDS_AND_TYPES="fetch-fields-and-types",FETCH_SCHEMA_REFERENCE="fetch-schema-reference",FETCH_SCHEMA_ROOT_TYPES="fetch-schema-root-types",FETCH_SCHEMA_TYPE="fetch-type",FETCH_SCHEMA_TYPES="fetch-types";class GraphQLEngineSchedulerClient extends SchedulerClientBase{analyzeDocument(In,Rn){return this.sendAndReceiveMessage(new Message(DOCUMENT_ANALYSIS_MESSAGE_TYPE,{documentId:In}),!1,Rn)}analyzeDocumentOperations(In,Rn){return this.sendAndReceiveMessage(new Message(DOCUMENT_OPERATIONS_ANALYSIS_MESSAGE_TYPE,{documentId:In}),!1,Rn)}cancelRequest(In){this.sendMessage(new Message(CANCEL_OPERATION_REQUEST_MESSAGE_TYPE,{documentId:In}))}executeOperation(In,Rn,Mn,Ln){this.sendMessage(new Message(EXECUTE_OPERATION_REQUEST_MESSAGE_TYPE,{documentId:In,workspaceId:Rn,environmentId:Mn,operationIndex:Ln}))}filesUpdated(In){this.sendMessage(new Message(FILES_UPDATED_MESSAGE_TYPE,{documentId:In}))}fetchSchema(In,Rn,Mn){return this.sendAndReceiveMessage(new Message(SCHEMA_FETCHER_MESSAGE_TYPE,{documentId:In,environmentId:Rn}),!1,Mn)}fetchApiSchema(In,Rn,Mn){return this.sendAndReceiveMessage(new Message(SCHEMA_API_FETCHER_MESSAGE_TYPE,{apiId:In,stageId:Rn}),!1,Mn)}getCachedSchema(In,Rn){return this.sendAndReceiveMessage(new Message(SCHEMA_FETCHER_CACHED_MESSAGE_TYPE,{documentId:In,environmentId:Rn}))}getDirective(In,Rn){return this.sendAndReceiveMessage(new Message(FETCH_SCHEMA_DIRECTIVE,{schemaEndpoint:In,coordinate:Rn}))}getDirectives(In){return this.sendAndReceiveMessage(new Message(FETCH_SCHEMA_DIRECTIVES,{schemaEndpoint:In}))}getField(In,Rn){return this.sendAndReceiveMessage(new Message(FETCH_SCHEMA_FIELD_TYPE,{schemaEndpoint:In,coordinate:Rn}))}getFields(In,Rn,Mn){return this.sendAndReceiveMessage(new Message(FETCH_SCHEMA_FIELD_TYPES,{schemaEndpoint:In,typeName:Rn,options:Mn}))}getFieldsAndTypes(In,Rn,Mn){return this.sendAndReceiveMessage(new Message(FETCH_SCHEMA_FIELDS_AND_TYPES,{schemaEndpoint:In,coordinate:Rn,options:Mn}))}getRootTypes(In,Rn){return this.sendAndReceiveMessage(new Message(FETCH_SCHEMA_ROOT_TYPES,{schemaEndpoint:In,filter:Rn}))}getSchemaReference(In,Rn,Mn){return this.sendAndReceiveMessage(new Message(FETCH_SCHEMA_REFERENCE,{schemaEndpoint:In,typeCategory:Rn,filter:Mn}))}getType(In,Rn){return this.sendAndReceiveMessage(new Message(FETCH_SCHEMA_TYPE,{schemaEndpoint:In,typeName:Rn}))}getTypes(In,Rn){return this.sendAndReceiveMessage(new Message(FETCH_SCHEMA_TYPES,{schemaEndpoint:In,filter:Rn}))}onReceiveOperationRequestStatus(In){return this.registerReceiveMessageHandler(OPERATION_REQUEST_STATUS_MESSAGE_TYPE,({payload:Rn})=>In(Rn))}onReceiveHistoryEntry(In){return this.registerReceiveMessageHandler(HISTORY_ENTRY_MESSAGE_TYPE,({payload:Rn})=>{In(Rn)})}onReceiveLogEntry(In){return this.registerReceiveMessageHandler(LOG_ENTRY_MESSAGE_TYPE,({payload:Rn})=>{In(Rn)})}onReceiveResult(In){return this.registerReceiveMessageHandler(OPERATION_RESULT_MESSAGE_TYPE,({payload:{documentId:Rn,result:Mn}})=>{In(Rn,Mn)})}onReceiveResultMessage(In){return this.registerReceiveMessageHandler(OPERATION_RESULT_EVENT_MESSAGE_TYPE,({payload:{documentId:Rn,resultId:Mn,event:Ln}})=>{In(Rn,Mn,Ln)})}onReceiveResultPatch(In){return this.registerReceiveMessageHandler(OPERATION_RESULT_PATCH_MESSAGE_TYPE,({payload:{documentId:Rn,resultId:Mn,patch:Ln}})=>{In(Rn,Mn,Ln)})}onReceiveVariableBatchingResult(In){return this.registerReceiveMessageHandler(OPERATION_VARIABLE_BATCHING_RESULT_MESSAGE_TYPE,({payload:{documentId:Rn,resultId:Mn,result:Ln}})=>{In(Rn,Mn,Ln)})}onVariableJsonSchemaUpdated(In){return this.registerReceiveMessageHandler(VARIABLE_JSON_SCHEMA_UPDATED_MESSAGE_TYPE,({payload:{documentId:Rn,variableJsonSchemaHash:Mn}})=>{In(Rn,Mn)})}}const INDEX_SCHEMA_MESSAGE_TYPE="index-schema",SCHEMA_INDEXED_MESSAGE_TYPE="schema-indexed";class GraphQLIndexerSchedulerClient extends SchedulerClientBase{indexSchema(In,Rn,Mn){this.sendMessage(new Message(INDEX_SCHEMA_MESSAGE_TYPE,{schemaEndpoint:In,schemaHash:Rn,schemaUpdatedAt:Mn}))}onSchemaIndexed(In){return this.registerReceiveMessageHandler(SCHEMA_INDEXED_MESSAGE_TYPE,({payload:Rn})=>{In(Rn)})}}function WorkerWrapper$6(on){return new Worker(""+new URL("graphql-engine-scheduler.3d52dae0.Dm0EX7GT.js",import.meta.url).href,{type:"module",name:on?.name})}function WorkerWrapper$5(on){return new Worker(""+new URL("graphql-indexer-scheduler.3d52dae0.CqbXhOeL.js",import.meta.url).href,{type:"module",name:on?.name})}function WorkerWrapper$4(on){return new Worker(""+new URL("session-scheduler.3d52dae0.CX7ebmjY.js",import.meta.url).href,{type:"module",name:on?.name})}const CREATE_USER_ACCOUNT_MESSAGE_TYPE="create-user-account";function createCreateUserAccountMessage(){return new Message(CREATE_USER_ACCOUNT_MESSAGE_TYPE,{})}const CREATE_WORKSPACE_TASK_TYPE="create-workspace-task";function createCreateWorkspaceMessage(on,In){return new Message(CREATE_WORKSPACE_TASK_TYPE,{userSession:on,workspaceName:In})}const DELETE_API_TASK_TYPE="delete-api-task";function createDeleteApiMessage(on){return new Message(DELETE_API_TASK_TYPE,{apiId:on})}const ORGANIZATION_INFO_FETCHER_MESSAGE_TYPE="fetch-organization-info";function createOrganizationInfoMessage(){return new Message(ORGANIZATION_INFO_FETCHER_MESSAGE_TYPE,void 0)}const SETTINGS_FETCHER_MESSAGE_TYPE="fetch-settings";function createFetchSettingsMessage(){return new Message(SETTINGS_FETCHER_MESSAGE_TYPE,void 0)}const FETCH_WORKSPACES_TASK_TYPE="fetch-workspaces-task-type";function createFetchWorkspacesMessage(on){return new Message(FETCH_WORKSPACES_TASK_TYPE,{userSession:on})}const PERSIST_THEME_SETTINGS_MESSAGE_TYPE="persist-theme-settings";function createPersistThemeSettingsMessage(on){return new Message(PERSIST_THEME_SETTINGS_MESSAGE_TYPE,on)}const REFRESH_TOKEN_MESSAGE_TYPE="refresh-token";function createRefreshTokenMessage(on){return new Message(REFRESH_TOKEN_MESSAGE_TYPE,{tenantInfo:on})}const UPDATE_FEATURE_FLAGS_MESSAGE_TYPE="update-feature-flags";function createUpdateFeatureFlagsMessage(on){return new Message(UPDATE_FEATURE_FLAGS_MESSAGE_TYPE,{featureFlags:on})}const USER_ACCOUNT_FETCHER_MESSAGE_TYPE="fetch-user-account";function createUserAccountMessage(){return new Message(USER_ACCOUNT_FETCHER_MESSAGE_TYPE,void 0)}const WORKSPACE_SYNCHRONIZATION_MESSAGE_TYPE="synchronize-workspace",WORKSPACE_SYNCHRONIZATION_PROGRESS_MESSAGE_TYPE="synchronize-workspace-progress";function createSynchronizeWorkspaceMessage(on,In){return new Message(WORKSPACE_SYNCHRONIZATION_MESSAGE_TYPE,{workspaceId:on,version:In})}const UPDATE_PREFERENCES_MESSAGE_TYPE="update-preferences";function createUpdatePreferencesMessage(on){return new Message(UPDATE_PREFERENCES_MESSAGE_TYPE,{preferences:on})}class SessionSchedulerClient extends SchedulerClientBase{fetchOrganizationInfo(In){return this.sendAndReceiveMessage(createOrganizationInfoMessage(),!1,In)}fetchUserAccount(In){return this.sendAndReceiveMessage(createUserAccountMessage(),!1,In)}createUserAccount(In){return this.sendAndReceiveMessage(createCreateUserAccountMessage(),!1,In)}refreshToken(In,Rn){return this.sendAndReceiveMessage(createRefreshTokenMessage(In),!1,Rn)}fetchSettings(In){return this.sendAndReceiveMessage(createFetchSettingsMessage(),!1,In)}persistThemeSettings(In){this.sendMessage(createPersistThemeSettingsMessage(In))}fetchWorkspaces(In,Rn){return this.sendAndReceiveMessage(createFetchWorkspacesMessage(In),!1,Rn)}createWorkspace(In,Rn,Mn){return this.sendAndReceiveMessage(createCreateWorkspaceMessage(In,Rn),!1,Mn)}synchronizeWorkspace(In,Rn,Mn){return this.sendAndReceiveMessage(createSynchronizeWorkspaceMessage(In,Rn),!1,Mn)}updateFeatureFlags(In,Rn){return this.sendAndReceiveMessage(createUpdateFeatureFlagsMessage(In),!1,Rn)}updatePreferences(In,Rn){return this.sendAndReceiveMessage(createUpdatePreferencesMessage(In),!1,Rn)}deleteApi(In,Rn){return this.sendAndReceiveMessage(createDeleteApiMessage(In),!1,Rn)}onReceiveLogEntry(In){return this.registerReceiveMessageHandler(LOG_ENTRY_MESSAGE_TYPE,({payload:Rn})=>In(Rn))}onReceiveUserSessionExpired(In){return this.registerReceiveMessageHandler(USER_SESSION_EXPIRED_MESSAGE_TYPE,()=>In())}onReceiveWorkspaceSynchronizationProgress(In){return this.registerReceiveMessageHandler(WORKSPACE_SYNCHRONIZATION_PROGRESS_MESSAGE_TYPE,({payload:Rn})=>In(Rn))}}const graphQLEngineSchedulerClient=new GraphQLEngineSchedulerClient(()=>new WorkerWrapper$6({name:"graphql-engine"})),graphQLIndexerSchedulerClient=new GraphQLIndexerSchedulerClient(()=>new WorkerWrapper$5({name:"graphql-indexer"})),sessionSchedulerClient=new SessionSchedulerClient(()=>new WorkerWrapper$4({name:"session"}));class ServiceProvider{#e=new Map;#t;#r=null;constructor(In,Rn){this.#t=new Map(In.map(([Mn,Ln,Hn])=>[Mn,{create:Ln,dependencies:Hn}])),this.#r=Rn??null}get parent(){return this.#r}getService(In){let Rn=this,Mn=this.#e.get(In)??null;if(Mn)return Mn;const Ln=this.#t.get(In);if(!Ln){for(;!Mn&&(Rn=Rn.parent);)Mn=Rn.getService(In);return Mn}if(Mn=Ln.create(Rn)??null,Mn&&(this.#e.set(In,Mn),Ln.dependencies))for(const Hn of Ln.dependencies)this.getService(Hn);return Mn}getRequiredService(In){const Rn=this.getService(In);if(!Rn)throw new Error(`Service "${In}" not found!`);return Rn}[Symbol.dispose](){this.#e.forEach(In=>{isDisposable(In)&&In[Symbol.dispose]()}),this.#e.clear()}}function ServiceDependencyProvider({children:on,services:In}){const Rn=useServiceProvider(),Mn=useRefWithInitializer(()=>new ServiceProvider(In,Rn));return reactExports.useEffect(()=>()=>Mn.current[Symbol.dispose](),[Mn]),jsx$1(ServiceProviderContext.Provider,{value:Mn.current,children:on})}const ServiceProviderContext=createNamedContext(null,ServiceProvider.name);function useServiceProvider(){return reactExports.useContext(ServiceProviderContext)}function useRequiredService(on){const In=useServiceProvider();if(!In)throw new Error("Provider undefined!");return In.getRequiredService(on)}var ItemChangeAction=(on=>(on.LOAD="load",on.LOAD_DEPENDENCY="load-dependency",on.UNLOAD="unload",on.UPDATE="update",on.SAVE="save",on))(ItemChangeAction||{});const ALL_LISTENER_NAME$1="all";class ItemStore{#e=new LifecycleCache({lru:!1});#t=new Map;#r;#n=new Map;constructor(){this.#r=[registerReceiveMessage(ACTIVATED_WORKSPACE_MESSAGE,({workspaceId:In})=>{this.#e.forEach(Rn=>{Rn.workspaceId!==In&&this.unloadItem(Rn.id)})}),registerReceiveMessage(DELETED_ITEMS_MESSAGE,({deletedItems:In})=>{In.forEach(({id:Rn})=>this.unloadItem(Rn))}),registerReceiveMessage(RENAMED_ITEM_MESSAGE,({itemId:In,itemKind:Rn})=>this.reload(In,Rn)),registerReceiveMessage(MOVED_ITEMS_MESSAGE,({movedItems:In})=>In.forEach(({id:Rn,kind:Mn})=>this.reload(Rn,Mn))),sessionSchedulerClient.onReceiveWorkspaceSynchronizationProgress(({changes:In})=>In.forEach(async Rn=>{switch(Rn.kind){case"delete":this.unloadItem(Rn.id);break;case"update":await this.reload(Rn.id,Rn.itemKind);break}}))]}async createApi(In,Rn,Mn,Ln){const Hn=await createApiItem(In,Rn,Mn,null,null,Ln);return this.#e.set(In,Hn,{permanent:!0}),this.triggerListeners(In,"load",Hn),Hn}async createNewApi(In,Rn,Mn){const Ln=await createNewApiItem(In,Rn,Mn);return this.#e.set(In,Ln,{permanent:!0}),this.triggerListeners(In,"load",Ln),Ln}async createApiDocument(In,Rn,Mn,Ln,Hn){const jn=await createApiDocumentItem(In,Rn,Mn,Ln,null,null,Hn);return await this.setDocument(In,jn,"load"),jn}async createBasicDocument(In,Rn,Mn,Ln,Hn){const jn=await createBasicDocumentItem(In,Rn,Mn,null,null,Ln,Hn);return await this.setDocument(In,jn,"load"),jn}async createNewDocument(In,Rn,Mn,Ln){const Hn=await createNewDocumentItem(In,Rn,Mn,Ln);return await this.setDocument(In,Hn,"load"),Hn}async createEnvironment(In,Rn,Mn){const Ln=await createEnvironmentItem(In,Rn,null,null,Mn);return this.#e.set(In,Ln,{permanent:!0}),this.triggerListeners(In,"load",Ln),Ln}async createNewEnvironment(In,Rn,Mn){const Ln=await createNewEnvironmentItem(In,Rn,Mn);return this.#e.set(In,Ln,{permanent:!0}),this.triggerListeners(In,"load",Ln),Ln}async duplicateApi(In,Rn,Mn){const Ln=await duplicateApiItem(In,Rn,Mn);return Ln&&(this.#e.set(Rn,Ln,{permanent:!0}),this.triggerListeners(Rn,"load",Ln)),Ln}async duplicateDocument(In,Rn,Mn){const Ln=await duplicateDocumentItem(In,Rn,Mn);return Ln&&await this.setDocument(Rn,Ln,"load"),Ln}async duplicateEnvironment(In,Rn,Mn){const Ln=await duplicateEnvironmentItem(In,Rn,Mn);return Ln&&(this.#e.set(Rn,Ln,{permanent:!0}),this.triggerListeners(Rn,"load",Ln)),Ln}get(In){return this.#e.get(In)}async getApi(In){const Rn=this.#e.get(In);return isApiItem(Rn)?(this.#e.isPermanent(In)||(this.#e.set(In,Rn,{permanent:!0}),this.triggerListeners(In,"load",Rn)),Rn):await this.reloadApi(In,!0)}async getNewApi(In){const Rn=this.#e.get(In);if(isNewApiItem(Rn))return this.#e.isPermanent(In)||(this.#e.set(In,Rn,{permanent:!0}),this.triggerListeners(In,"load",Rn)),Rn;const[Mn,Ln]=this.loadItem(In,()=>this.getNewApi(In));if(Mn)return await Ln;const Hn=await Ln;return Hn&&(this.#e.set(In,Hn,{permanent:!0}),this.triggerListeners(In,"load",Hn)),Hn}async getDocument(In){const Rn=this.#e.get(In);return isDocumentItem(Rn)?Rn:await this.reloadDocument(In)}async getEnvironment(In){const Rn=this.#e.get(In);return isEnvironmentItem(Rn)?Rn:await this.reloadEnvironment(In)}async saveApi(In,Rn){const Mn=this.#e.get(In);if(isApiItem(Mn))try{const Ln=await saveApiItem(In,Rn);return this.#e.set(In,Ln,{permanent:!0}),this.triggerListeners(In,"save",Ln),Ln}catch{return}}async saveNewApi(In,Rn,Mn,Ln,Hn){const jn=this.#e.get(In);if(isNewApiItem(jn))try{const Wn=await saveNewApiItem(In,Rn,Mn,Ln,Hn);return this.#e.set(In,Wn,{permanent:!0}),this.triggerListeners(In,"save",Wn),Wn}catch{return}}async saveDocument(In){const Rn=this.#e.get(In);if(isDocumentItem(Rn))try{const Mn=await saveDocumentItem(In);return await this.setDocument(In,Mn,"save"),Mn}catch{return}}async saveNewDocument(In,Rn,Mn,Ln){const Hn=this.#e.get(In);if(isDocumentItem(Hn))try{const jn=await saveNewDocumentItem(In,Rn,Mn,Ln);return await this.setDocument(In,jn,"save"),jn}catch{return}}async saveEnvironment(In){const Rn=this.#e.get(In);if(isEnvironmentItem(Rn))try{const Mn=await saveEnvironmentItem(In);return this.#e.set(In,Mn,{permanent:!0}),this.triggerListeners(In,"save",Mn),Mn}catch{return}}async saveNewEnvironment(In,Rn,Mn){const Ln=this.#e.get(In);if(isNewEnvironmentItem(Ln))try{const Hn=await saveNewEnvironmentItem(In,Rn,Mn);return this.#e.set(In,Hn,{permanent:!0}),this.triggerListeners(In,"save",Hn),Hn}catch{return}}subscribe(In,Rn){let Mn=this.#n.get(In);return Mn||(Mn=new Set,this.#n.set(In,Mn)),Mn.has(Rn)||Mn.add(Rn),()=>{Mn.delete(Rn),Mn.size===0&&this.#n.delete(In)}}subscribeAll(In){return this.subscribe(ALL_LISTENER_NAME$1,In)}unloadItem(In){const Rn=this.#e.get(In);if(Rn){const Mn=this.#e.isPermanent(In);return this.#e.delete(In),Mn&&this.triggerListeners(In,"unload",Rn),!0}return!1}updateDocumentContentBody(In,Rn){return this.updateDocumentContent(In,Mn=>updateDocumentContentBody(Mn,Rn))}updateDocumentContentVariables(In,Rn){return this.updateDocumentContent(In,Mn=>updateDocumentContentVariables(Mn,Rn))}[Symbol.dispose](){this.#e[Symbol.dispose](),this.#r.forEach(In=>In())}loadItem(In,Rn){if(this.#t.has(In))return[!0,this.#t.get(In)];const Mn=Rn().then(Ln=>(this.#t.delete(In),Ln));return this.#t.set(In,Mn),[!1,Mn]}async reload(In,Rn){switch(Rn){case"api":await this.reloadApi(In,!1);break;case"api-document":case"document":await this.reloadDocument(In);break;case"environment":await this.reloadEnvironment(In);break}}async reloadApi(In,Rn){const[Mn,Ln]=this.loadItem(In,()=>getApiItem(In));if(Mn)return await Ln;const Hn=await Ln;if(Hn){const jn=Rn||this.#e.isPermanent(In);this.#e.set(In,Hn,{permanent:jn}),jn?this.triggerListeners(In,"load",Hn):this.triggerListeners(In,"load-dependency",Hn)}return Hn}async reloadDocument(In){const[Rn,Mn]=this.loadItem(In,()=>getDocumentItemAndContent(In));if(Rn)return await Mn;const Ln=await Mn;return Ln&&await this.setDocument(In,Ln,"load"),Ln}async reloadEnvironment(In){const[Rn,Mn]=this.loadItem(In,()=>getEnvironmentItemAndVariables(In));if(Rn)return await Mn;const Ln=await Mn;return Ln&&(this.#e.set(In,Ln,{permanent:!0}),this.triggerListeners(In,"load",Ln)),Ln}async setDocument(In,Rn,Mn){if(isApiDocumentItem(Rn)){if(this.#e.set(In,Rn,{permanent:!0,references:[Rn.apiId]}),this.#e.has(Rn.apiId)){this.triggerListeners(In,Mn,Rn);return}const[Ln,Hn]=this.loadItem(Rn.apiId,()=>getApiItem(Rn.apiId));if(Ln){await Hn,this.triggerListeners(In,Mn,Rn);return}const jn=await Hn;jn&&(this.#e.set(jn.id,jn,{permanent:!1}),this.triggerListeners(jn.id,"load-dependency",jn)),this.triggerListeners(In,Mn,Rn)}else this.#e.set(In,Rn,{permanent:!0}),this.triggerListeners(In,Mn,Rn)}async updateDocumentContent(In,Rn){const Mn=this.#e.get(In);if(!isDocumentItem(Mn))return;const Ln=await Rn(In);return Ln&&(this.#e.update(In,Ln),this.triggerListeners(In,"update",Ln)),Ln}triggerListeners(In,Rn,Mn){requestAnimationFrame(()=>{const Ln=this.#n.get(ALL_LISTENER_NAME$1);Ln&&Ln.forEach(jn=>jn(Rn,Mn));const Hn=this.#n.get(In);Hn&&Hn.forEach(jn=>jn(Rn,Mn))})}}function useItemStore(){return useRequiredService(ItemStore.name)}function applyObjectChanges(on,In){let Rn=null;for(const Mn of Object.keys(on)){const Ln=In[Mn],Hn=on[Mn];let jn;typeof Ln=="object"&&Ln!==null&&typeof Hn=="object"&&Hn!==null&&!Array.isArray(Ln)&&!Array.isArray(Hn)?jn=applyObjectChanges(Hn,Ln):jn=Hn,Object.is(jn,Ln)||(Rn??={...In},Rn[Mn]=jn)}return Rn??In}const ALL_LISTENER_NAME="all";class TabViewStateStore{#e=new SimpleCache({lru:!1});#t;#r=new Map;constructor(){this.#t=[registerReceiveMessage(DELETED_ITEMS_MESSAGE,({deletedItems:In})=>In.forEach(({id:Rn})=>this.delete(Rn))),registerReceiveMessage(DOCUMENT_ANALYZED_MESSAGE,({documentId:In,operations:Rn})=>{const Mn=this.#e.get(In);if(!(!Mn||!Mn.graphqlDocument)){if(Rn.length===0){this.update(In,{graphqlDocument:{activeOperation:void 0}});return}(Mn.graphqlDocument.activeOperation===void 0||Mn.graphqlDocument.activeOperation>=Rn.length)&&this.update(In,{graphqlDocument:{activeOperation:0}})}}),sessionSchedulerClient.onReceiveWorkspaceSynchronizationProgress(({changes:In})=>In.forEach(async Rn=>{switch(Rn.kind){case"delete":await this.delete(Rn.id);break}}))]}create(In){this.#e.set(In.id,In),this.triggerListeners(In.id,"create",In),setTabViewState(In)}createApi(In,Rn,Mn){this.create({id:In,workspaceId:Rn,api:{...Mn?.api,activeViewId:Mn?.api?.activeViewId??DEFAULT_TAB_VIEW_STATE_VALUES.api.activeViewId,activeSchemaChangelogViewId:Mn?.api?.activeSchemaChangelogViewId??DEFAULT_TAB_VIEW_STATE_VALUES.api.activeSchemaChangelogViewId,activeMonitoringViewId:Mn?.api?.activeMonitoringViewId??DEFAULT_TAB_VIEW_STATE_VALUES.api.activeMonitoringViewId,metricsDateTimeRange:Mn?.api?.metricsDateTimeRange??DEFAULT_TAB_VIEW_STATE_VALUES.api.metricsDateTimeRange},detailInfo:Mn?.detailInfo?{...Mn?.detailInfo}:void 0,schema:{...Mn?.schema,activeSchemaViewId:Mn?.schema?.activeSchemaViewId??DEFAULT_TAB_VIEW_STATE_VALUES.schema.activeSchemaViewId,activeSchemaReferenceViewId:Mn?.schema?.activeSchemaReferenceViewId??DEFAULT_TAB_VIEW_STATE_VALUES.schema.activeSchemaReferenceViewId,hideDeprecatedItemsInSchemaReference:Mn?.schema?.hideDeprecatedItemsInSchemaReference??DEFAULT_TAB_VIEW_STATE_VALUES.schema.hideDeprecatedItemsInSchemaReference}})}createGraphqlDocument(In,Rn,Mn){this.create({id:In,workspaceId:Rn,api:{...Mn?.api,metricsDateTimeRange:Mn?.api?.metricsDateTimeRange??DEFAULT_TAB_VIEW_STATE_VALUES.api.metricsDateTimeRange},graphqlDocument:{...Mn?.graphqlDocument,activeViewId:Mn?.graphqlDocument?.activeViewId??DEFAULT_TAB_VIEW_STATE_VALUES.graphqlDocument.activeViewId,activeOperationCompanionViewId:Mn?.graphqlDocument?.activeOperationCompanionViewId??DEFAULT_TAB_VIEW_STATE_VALUES.graphqlDocument.activeOperationCompanionViewId,activeOperationsSettingsViewId:Mn?.graphqlDocument?.activeOperationsSettingsViewId??DEFAULT_TAB_VIEW_STATE_VALUES.graphqlDocument.activeOperationsSettingsViewId,activeResponseViewId:Mn?.graphqlDocument?.activeResponseViewId??DEFAULT_TAB_VIEW_STATE_VALUES.graphqlDocument.activeResponseViewId,isOperationCompanionCollapsed:Mn?.graphqlDocument?.isOperationCompanionCollapsed??DEFAULT_TAB_VIEW_STATE_VALUES.graphqlDocument.isOperationCompanionCollapsed,isOperationsSettingsPaneCollapsed:Mn?.graphqlDocument?.isOperationsSettingsPaneCollapsed??DEFAULT_TAB_VIEW_STATE_VALUES.graphqlDocument.isOperationsSettingsPaneCollapsed,isResponseEntriesPaneCollapsed:Mn?.graphqlDocument?.isResponseEntriesPaneCollapsed??DEFAULT_TAB_VIEW_STATE_VALUES.graphqlDocument.isResponseEntriesPaneCollapsed,operationsSettingsPaneHeight:Mn?.graphqlDocument?.operationsSettingsPaneHeight??DEFAULT_TAB_VIEW_STATE_VALUES.graphqlDocument.operationsSettingsPaneHeight,responseEntriesPaneHeight:Mn?.graphqlDocument?.responseEntriesPaneHeight??DEFAULT_TAB_VIEW_STATE_VALUES.graphqlDocument.responseEntriesPaneHeight,focusedElement:Mn?.graphqlDocument?.focusedElement??DEFAULT_TAB_VIEW_STATE_VALUES.graphqlDocument.focusedElement,showIntrospectionFieldsInOperationBuilder:Mn?.graphqlDocument?.showIntrospectionFieldsInOperationBuilder??DEFAULT_TAB_VIEW_STATE_VALUES.graphqlDocument.showIntrospectionFieldsInOperationBuilder},detailInfo:Mn?.detailInfo?{...Mn?.detailInfo}:void 0,schema:{...Mn?.schema,activeSchemaViewId:Mn?.schema?.activeSchemaViewId??DEFAULT_TAB_VIEW_STATE_VALUES.schema.activeSchemaViewId,activeSchemaReferenceViewId:Mn?.schema?.activeSchemaReferenceViewId??DEFAULT_TAB_VIEW_STATE_VALUES.schema.activeSchemaReferenceViewId,hideDeprecatedItemsInSchemaReference:Mn?.schema?.hideDeprecatedItemsInSchemaReference??DEFAULT_TAB_VIEW_STATE_VALUES.schema.hideDeprecatedItemsInSchemaReference}})}async delete(In){const Rn=this.#e.get(In);return Rn?(await deleteTabViewState(In),this.#e.delete(In),this.triggerListeners(In,"delete",Rn),!0):!1}get(In){return this.#e.get(In)}async load(In){this.#e.forEach(Mn=>{this.#e.delete(Mn.id),this.triggerListeners(Mn.id,"unload",Mn)});const Rn=await loadAllTabViewState(In);if(Rn)for(const Mn of Rn)this.#e.set(Mn.id,Mn),this.triggerListeners(Mn.id,"load",Mn)}subscribe(In,Rn){let Mn=this.#r.get(In);return Mn||(Mn=new Set,this.#r.set(In,Mn)),Mn.has(Rn)||Mn.add(Rn),()=>{Mn.delete(Rn),Mn.size===0&&this.#r.delete(In)}}subscribeAll(In){return this.subscribe(ALL_LISTENER_NAME,In)}update(In,Rn){const Mn=this.#e.get(In);if(!Mn)return;typeof Rn=="function"&&(Rn=Rn(Mn));const Ln=applyObjectChanges(Rn,Mn);Ln!==Mn&&(this.#e.set(In,Ln),this.triggerListeners(In,"update",Ln),setTabViewState(Ln))}[Symbol.dispose](){this.#e[Symbol.dispose](),this.#t.forEach(In=>In())}triggerListeners(In,Rn,Mn){const Ln=this.#r.get(ALL_LISTENER_NAME);Ln&&Ln.forEach(jn=>jn(Rn,Mn));const Hn=this.#r.get(In);Hn&&Hn.forEach(jn=>jn(Rn,Mn))}}function useTabViewStateStore(){return useRequiredService(TabViewStateStore.name)}class SchemaErrorCache extends SimpleCache{constructor(){super({lru:!0})}[Symbol.dispose](){super[Symbol.dispose]()}}function useSchemaErrorCache(){return useRequiredService(SchemaErrorCache.name)}const INITIAL_STATE$5={activeId:null,activeChildId:null,entries:[],followNewest:!0,stats:{all:0,errors:0,infos:0,warnings:0}};function LogProvider({children:on}){const In=useSubject(INITIAL_STATE$5);return useOnWorkspaceSwitchResetState(In.current),jsx$1(ActivateLogEntryProvider,{state$:In.current,children:jsx$1(AppendLogEntryProvider,{state$:In.current,children:jsx$1(AppendSchedulerLogEntryProvider,{state$:In.current,children:jsx$1(ClearLogProvider,{state$:In.current,children:jsx$1(CollapseLogScopeProvider,{state$:In.current,children:jsx$1(DeactivateLogEntryProvider,{state$:In.current,children:jsx$1(ExpandLogScopeProvider,{state$:In.current,children:jsx$1(UpdateFollowNewestProvider,{state$:In.current,children:jsx$1(LogStateContext.Provider,{value:In.current,children:on})})})})})})})})})}function useOnReceiveLogEntry$1(on){reactExports.useEffect(()=>graphQLEngineSchedulerClient.onReceiveLogEntry(on),[on])}function useOnWorkspaceSwitchResetState(on){reactExports.useEffect(()=>registerReceiveMessage(ACTIVATED_WORKSPACE_MESSAGE,()=>{on.next(INITIAL_STATE$5)}),[on])}const ActivateLogEntryContext=createNamedContext(noop$2,"ActivateLogEntry");function useActivateLogEntry(){return reactExports.useContext(ActivateLogEntryContext)}function ActivateLogEntryProvider({children:on,state$:In}){const Rn=reactExports.useCallback((Mn,Ln,Hn)=>{const jn=In.value();(jn.activeId!==Mn||jn.activeChildId!==Ln)&&jn.entries.some(({id:Wn})=>Wn===Mn)&&(In.next({...jn,entries:jn.entries.map(Wn=>Wn.id===Mn&&Wn.kind==="scope"?{...Wn,expanded:!0}:Wn),activeId:Mn,activeChildId:Ln??null,followNewest:Hn===void 0?jn.followNewest:Hn}),Mn&&sendMessage({kind:LOG_ENTRY_ACTIVATED_MESSAGE,logEntryId:Mn}))},[In]);return jsx$1(ActivateLogEntryContext.Provider,{value:Rn,children:on})}const AppendLogEntryContext=createNamedContext(async()=>"","AppendLogEntry");function useAppendLogEntry(){return reactExports.useContext(AppendLogEntryContext)}function AppendLogEntryProvider({children:on,state$:In}){const Rn=reactExports.useCallback(async(Mn,Ln,Hn,jn)=>{const Wn=await getItemDetails(Mn),Yn=createId();return appendLogEntry(In,{id:Yn,item:Wn,kind:"basic",level:Ln,message:Hn,timestamp:now(),details:jn}),Yn},[In]);return jsx$1(AppendLogEntryContext.Provider,{value:Rn,children:on})}const AppendSchedulerLogEntryContext=createNamedContext(noop$2,"AppendSchedulerLogEntry");function useAppendSchedulerLogEntry(){return reactExports.useContext(AppendSchedulerLogEntryContext)}function AppendSchedulerLogEntryProvider({children:on,state$:In}){const Rn=useSchemaErrorCache(),Mn=reactExports.useCallback(async Ln=>{const{kind:Hn}=Ln,jn=await getItemDetails(Ln.itemId);switch(Hn){case BASIC_LOG_ENTRY_KIND:appendLogEntry(In,{id:Ln.requestId??createId(),item:jn,kind:"basic",level:Ln.level,timestamp:now(),message:Ln.message,details:Ln.details});break;case HTTP_REQUEST_LOG_ENTRY_KIND:appendLogEntry(In,{id:Ln.requestId,scopeId:Ln.scopeId,item:jn,kind:"http-request",name:Ln.name,level:Ln.level,status:"pending",started:Ln.started,request:{uri:Ln.requestUri,method:Ln.method,headers:Ln.headers,body:Ln.body,cache:Ln.cache,credentials:Ln.credentials,referrerPolicy:Ln.referrerPolicy}});break;case HTTP_RESPONSE_LOG_ENTRY_KIND:updateLogEntry(In,Ln.requestId,vi=>({...vi,response:{body:"",headers:Ln.headers,chunks:0,contentLength:0,statusCode:Ln.statusCode,statusText:Ln.statusText}}));break;case HTTP_RESPONSE_BODY_CHUNK_LOG_ENTRY_KIND:updateLogEntry(In,Ln.requestId,vi=>({...vi,response:{...vi.response,body:vi.response.body+Ln.chunk,chunks:Ln.chunkIndex+1}}));break;case HTTP_RESPONSE_CANCELLED_LOG_ENTRY_KIND:updateLogEntry(In,Ln.requestId,vi=>({...vi,level:LogLevel.warning,status:"cancelled",stopped:Ln.stopped,duration:diff$1(vi.started,Ln.stopped),response:{...vi.response,contentLength:Ln.contentLength,error:Ln.error}}));break;case HTTP_RESPONSE_FAILED_LOG_ENTRY_KIND:{if(updateLogEntry(In,Ln.requestId,vi=>({...vi,level:LogLevel.error,status:"failed",stopped:Ln.stopped,duration:diff$1(vi.started,Ln.stopped),response:{...vi.response,contentLength:Ln.contentLength,error:Ln.error}})),Ln.requestKind===RequestKind.GRAPHQL_INTROSPECTION||Ln.requestKind===RequestKind.GRAPHQL_SDL_FETCH){const vi=Rn.get(Ln.itemId);if(Ln.scopeId!==vi?.scopeId||!Ln.scopeId&&!vi?.scopeId){const gi=In.value().entries.find(({id:mi})=>mi===Ln.requestId);gi?.kind==="http-request"&&Rn.set(Ln.itemId,gi)}}break}case HTTP_RESPONSE_FINISHED_LOG_ENTRY_KIND:{if(updateLogEntry(In,Ln.requestId,vi=>({...vi,status:"succeeded",stopped:Ln.stopped,duration:diff$1(vi.started,Ln.stopped),response:{...vi.response,contentLength:Ln.contentLength}})),Ln.requestKind===RequestKind.GRAPHQL_INTROSPECTION||Ln.requestKind===RequestKind.GRAPHQL_SDL_FETCH||Ln.requestKind===RequestKind.GRAPHQL_SDL_PROBE){const vi=Rn.get(Ln.itemId);vi&&(vi.scopeId!==Ln.scopeId||!vi.scopeId&&!Ln.scopeId)&&Rn.delete(Ln.itemId)}break}case SCOPE_BEGIN_LOG_ENTRY_KIND:appendLogEntry(In,{id:Ln.scopeId,item:jn,kind:"scope",name:Ln.name,level:Ln.level,started:Ln.started,details:Ln.details?{...Ln.details,status:"pending"}:{status:"pending"}});break;case SCOPE_END_LOG_ENTRY_KIND:const Wn=In.value().entries.filter(vi=>vi.kind==="http-request"&&vi.scopeId===Ln.scopeId),Yn=Wn.length?Wn[Wn.length-1]:null,hi=Wn.length?Wn.find(vi=>vi.status==="cancelled"||vi.status==="failed")??Yn:null;updateLogEntry(In,Ln.scopeId,vi=>({...vi,stopped:Ln.stopped,duration:diff$1(vi.started,Ln.stopped),level:hi?.level??vi.level,details:{...vi.details,cache:Yn?.request.cache,contentLength:Wn.reduce((gi,mi)=>gi+(mi.response?.contentLength??0),0),credentials:Yn?.request.credentials,method:Yn?.request.method,referrerPolicy:Yn?.request.referrerPolicy,requestHeaders:Yn?.request.headers,responseHeaders:Yn?.response?.headers,status:hi?.status??"succeeded",statusCode:hi?.response?.statusCode,statusText:hi?.response?.statusText}}));break;case SUBSCRIPTION_REQUEST_STARTED_LOG_ENTRY_KIND:appendLogEntry(In,{id:Ln.requestId,item:jn,kind:"subscription-request",level:Ln.level,status:"pending",started:Ln.started,uri:Ln.requestUri,protocol:Ln.protocol,connectionParams:Ln.connectionParams,contentLength:0,messages:0,data:""});break;case SUBSCRIPTION_REQUEST_PROTOCOL_LOG_ENTRY_KIND:updateLogEntry(In,Ln.requestId,vi=>({...vi,protocol:Ln.protocol}));break;case SUBSCRIPTION_REQUEST_MESSAGE_LOG_ENTRY_KIND:updateLogEntry(In,Ln.requestId,vi=>{const gi=vi.data+Ln.data+`
|
|
4724
|
+
`;return{...vi,messages:vi.messages+1,contentLength:gi.length,data:gi}});break;case SUBSCRIPTION_REQUEST_STOPPED_LOG_ENTRY_KIND:updateLogEntry(In,Ln.requestId,vi=>({...vi,level:Ln.reason==="failed"?LogLevel.error:LogLevel.info,status:Ln.reason,error:Ln.error,stopped:Ln.stopped,duration:diff$1(vi.started,Ln.stopped)}));break}},[Rn,In]);return useOnReceiveLogEntry$1(Mn),jsx$1(AppendSchedulerLogEntryContext.Provider,{value:Mn,children:on})}const ClearLogContext=createNamedContext(noop$2,"ClearLog");function useClearLog(){return reactExports.useContext(ClearLogContext)}function ClearLogProvider({children:on,state$:In}){const Rn=reactExports.useCallback(()=>{In.next(INITIAL_STATE$5)},[In]);return jsx$1(ClearLogContext.Provider,{value:Rn,children:on})}const CollapseLogScopeContext=createNamedContext(noop$2,"CollapseLogScope");function useCollapseLogScope(){return reactExports.useContext(CollapseLogScopeContext)}function CollapseLogScopeProvider({children:on,state$:In}){const Rn=reactExports.useCallback(Mn=>{In.value().entries.some(Ln=>Ln.id===Mn&&Ln.kind==="scope"&&Ln.expanded)&&In.next(Ln=>({...Ln,activeChildId:Ln.activeId===Mn?null:Ln.activeChildId,followNewest:!1,entries:Ln.entries.map(Hn=>Hn.id===Mn?{...Hn,expanded:!1}:Hn)}))},[In]);return jsx$1(CollapseLogScopeContext.Provider,{value:Rn,children:on})}const DeactivateLogEntryContext=createNamedContext(noop$2,"DeactivateLogEntry");function useDeactivateLogEntry(){return reactExports.useContext(DeactivateLogEntryContext)}function DeactivateLogEntryProvider({children:on,state$:In}){const Rn=reactExports.useCallback(()=>{In.next(Mn=>({...Mn,activeId:null}))},[In]);return jsx$1(DeactivateLogEntryContext.Provider,{value:Rn,children:on})}const ExpandLogScopeContext=createNamedContext(noop$2,"ExpandLogScope");function useExpandLogScope(){return reactExports.useContext(ExpandLogScopeContext)}function ExpandLogScopeProvider({children:on,state$:In}){const Rn=reactExports.useCallback(Mn=>{In.value().entries.some(Ln=>Ln.id===Mn&&Ln.kind==="scope"&&!Ln.expanded)&&In.next(Ln=>({...Ln,followNewest:!1,entries:Ln.entries.map(Hn=>Hn.id===Mn?{...Hn,expanded:!0}:Hn)}))},[In]);return jsx$1(ExpandLogScopeContext.Provider,{value:Rn,children:on})}const UpdateFollowNewestContext=createNamedContext(noop$2,"UpdateFollowNewest");function useUpdateFollowNewest(){return reactExports.useContext(UpdateFollowNewestContext)}function UpdateFollowNewestProvider({children:on,state$:In}){const Rn=reactExports.useCallback(Mn=>{const Ln=In.value();Ln.followNewest!==Mn&&In.next({...Ln,followNewest:Mn})},[In]);return jsx$1(UpdateFollowNewestContext.Provider,{value:Rn,children:on})}const LogStateContext=createNamedContext(null,"LogState");function LogSelector(on){const In={activeId:on.activeId,activeChildId:on.activeChildId,entries:on.entries.filter(Rn=>!(Rn.kind==="http-request"&&Rn.scopeId)).reduce((Rn,Mn)=>{const{id:Ln,kind:Hn,item:jn,level:Wn}=Mn;switch(Hn){case"basic":Rn.push({id:Ln,kind:Hn,item:jn,level:Wn,message:Mn.message,timestamp:Mn.timestamp});break;case"http-request":Rn.push(mapToHttpRequestLogListEntry(Mn));break;case"scope":Rn.push({id:Ln,kind:Hn,item:jn,level:Wn,name:Mn.name,started:Mn.started,duration:Mn.duration,details:Mn.details,expanded:!!Mn.expanded});const Yn=on.entries.filter(vi=>vi.kind==="http-request"&&vi.scopeId===Ln),hi=Yn[Yn.length-1];if(Yn.length&&Mn.expanded)for(const vi of Yn)Rn.push(mapToHttpRequestLogListEntry(vi,vi===hi));break;case"subscription-request":Rn.push({id:Ln,kind:Hn,item:jn,level:Wn,uri:Mn.uri,contentLength:Mn.stopped?Mn.contentLength:0,started:Mn.started,status:Mn.status,duration:Mn.duration,protocol:Mn.protocol});break;default:throw new Error("Unknown kind")}return Rn},[]),followNewest:on.followNewest,hash:""};return{...In,hash:createHash(JSON.stringify(In))}}function mapToHttpRequestLogListEntry(on,In){return{id:on.id,kind:on.kind,scopeId:on.scopeId,item:on.item,level:on.level,uri:on.request.uri,method:on.request.method,name:on.name,contentLength:on.stopped?on.response?.contentLength??0:0,started:on.started,status:on.status,statusCode:on.response?.statusCode,duration:on.duration,lastChild:In}}function useLog(){return useSelector(LogStateContext,LogSelector,(on,In)=>on.hash===In.hash)}function ActiveLogEntrySelector(on){const In=on.activeChildId||on.activeId;if(In)return on.entries.find(({id:Rn})=>Rn===In)}function useActiveLogEntry(){return useSelector(LogStateContext,ActiveLogEntrySelector)}function ActiveLogEntryIdSelector(on){return on.activeId}function useActiveLogEntryId(){return useSelector(LogStateContext,ActiveLogEntryIdSelector)}function HasLogEntrySelector(on){return In=>!!In?.entries.some(({id:Rn})=>Rn===on)}function useHasLogEntry(on){return useSelector(LogStateContext,HasLogEntrySelector(on))}function HasLogEntriesSelector(on){return!!on?.entries.length}function useHasLogEntries(){return useSelector(LogStateContext,HasLogEntriesSelector)}function LogStatsSelector(on){return on.stats}function useLogStats(){return useSelector(LogStateContext,LogStatsSelector)}async function appendLogEntry(on,In){on.next(Rn=>({...Rn,entries:[...Rn.entries,In],stats:{all:Rn.stats.all+1,errors:In.level===LogLevel.error?Rn.stats.errors+1:Rn.stats.errors,infos:In.level===LogLevel.info?Rn.stats.infos+1:Rn.stats.infos,warnings:In.level===LogLevel.warning?Rn.stats.warnings+1:Rn.stats.warnings}}))}function updateLogEntry(on,In,Rn){on.next(Mn=>{const Ln=Mn.entries.map(Hn=>Hn.id===In?Rn(Hn):Hn);return{...Mn,entries:Ln,stats:{...Mn.stats,errors:Ln.filter(({level:Hn})=>Hn===LogLevel.error).length,infos:Ln.filter(({level:Hn})=>Hn===LogLevel.info).length,warnings:Ln.filter(({level:Hn})=>Hn===LogLevel.warning).length}}})}async function getItemDetails(on){if(!on)return null;const In=await getItemNameAndKind(on);if(In){const[Rn,Mn]=In;return{id:on,name:Rn,kind:Mn}}return{id:on,name:"N/A"}}function NetworkProvider({children:on}){const In=reactExports.useRef(null),Rn=useSubject(window.navigator.onLine);return reactExports.useEffect(()=>{async function Mn(){try{const hi=await fetch("https://api.chillicream.com/status",{method:"GET",cache:"no-store",signal:AbortSignal.timeout(5e3)});Rn.current.next(hi.ok)}catch{Rn.current.next(!1)}}function Ln(){In.current&&window.clearInterval(In.current),Mn(),In.current=window.setInterval(Mn,THIRTY_SECONDS)}function Hn(){In.current&&(window.clearInterval(In.current),In.current=null)}window.navigator.onLine?document.visibilityState==="visible"&&Ln():Rn.current.next(!1);function jn(){document.visibilityState==="visible"&&Ln()}function Wn(){Rn.current.next(!1),Hn()}function Yn(){document.visibilityState==="visible"?window.navigator.onLine&&Ln():Hn()}return window.addEventListener("offline",Wn),window.addEventListener("online",jn),document.addEventListener("visibilitychange",Yn),()=>{window.removeEventListener("offline",Wn),window.removeEventListener("online",jn),document.removeEventListener("visibilitychange",Yn),Hn()}},[Rn]),jsx$1(IsOnlineContext.Provider,{value:Rn.current,children:on})}const IsOnlineContext=createNamedContext(null,"IsOnline");function IsOnlineSelector(on){return on}function useIsOnline(){return useSelector(IsOnlineContext,IsOnlineSelector)}function useIsOnlineObservable(){return useObservable(IsOnlineContext)}const DEFAULT_PRESET={useBrowserUrlAsEndpoint:!1},LOAD_PRESET=!(IS_RUNNING_IN_CLOUD||IS_RUNNING_IN_ELECTRON);function PresetProvider({children:on}){const In=useInitialize$7();return In?jsx$1(PresetContext.Provider,{value:In,children:on}):null}function useInitialize$7(){const on=useForceUpdate(),In=reactExports.useRef(null);return LOAD_PRESET||(In.current=DEFAULT_PRESET),reactExports.useEffect(()=>{In.current||getPreset().then(Rn=>{In.current=Rn,on()})},[on]),In.current}async function getPreset(){const on=await fetchPreset("nitro-config.json");return on||(await fetchPreset("bcp-config.json")??DEFAULT_PRESET)}async function fetchPreset(on){const{origin:In}=window.location,Rn=extractAppUrlPath(window.location);try{return await(await fetch(resolveUrl$1(`${In}${Rn}`,on))).json()}catch{return null}}const PresetContext=createNamedContext(DEFAULT_PRESET,"Preset");function usePreset(){return reactExports.useContext(PresetContext)}function useIsBoundToOrganization(){return!!usePreset().organization}const INITIAL_STATE$4={signInState:"init",synchronizing:!1,sessions:[]};function SessionProvider({children:on}){const In=useInitialize$6();return useOnReceiveLogEntry(),In?jsx$1(HandleSignInCallbackProvider,{state$:In,children:jsx$1(UpsertSessionProvider,{state$:In,children:jsx$1(ActivateSessionProvider,{state$:In,children:jsx$1(SignInProvider,{state$:In,children:jsx$1(SignOutProvider,{state$:In,children:jsx$1(SignOutAllProvider,{state$:In,children:jsx$1(CreateUserAccountProvider,{children:jsx$1(SignOutOfCurrentSessionProvider,{state$:In,children:jsx$1(SignInActiveSessionProvider,{state$:In,children:jsx$1(SessionStateContext.Provider,{value:In,children:on})})})})})})})})})}):null}function useInitialize$6(){const on=reactExports.useRef(null),In=useForceUpdate();return reactExports.useEffect(()=>{if(!on.current){let Rn=function(Mn){on.current=createSubject(refreshSignInState(Mn)),In()};createLoadAppSessionAction().then(Rn,()=>Rn(INITIAL_STATE$4))}},[In]),useExpiredSessionNotification(on.current),useRefreshToken(on.current),useActivatedWorkspace(on.current),on.current}async function createLoadAppSessionAction(on){const In=await getAppSession(on);return In?{synchronizing:!1,signInState:"sign-in",sessions:In.userSessions,activeSession:In.activeSession}:INITIAL_STATE$4}function useOnReceiveLogEntry(){const on=useAppendSchedulerLogEntry();reactExports.useEffect(()=>sessionSchedulerClient.onReceiveLogEntry(on),[on])}function useExpiredSessionNotification(on){const In=reactExports.useRef(()=>{});reactExports.useEffect(()=>{if(on){let Rn=function(Hn){if(Hn.activeSession===Ln)return;Mn?.abort();const jn=new AbortController;Mn=jn,Ln=Hn.activeSession,In.current=()=>{isSigninRedirect(window.location)||triggerUserSessionExpiredNotification(jn.signal)}},Mn,Ln;return Rn(on.value()),on.subscribe(Rn)}},[on]),reactExports.useEffect(()=>sessionSchedulerClient.onReceiveUserSessionExpired(In.current),[]),reactExports.useEffect(()=>{function Rn(Mn){Mn.activeSession?.requiresSignIn&&In.current()}if(on)return Rn(on.value()),on.subscribe(Rn)},[on])}function useRefreshToken(on){const In=useCombine(on??createSubject(INITIAL_STATE$4),useIsOnlineObservable()),Rn=useUpsertSessionAction(on);reactExports.useEffect(()=>{let Mn;function Ln([Hn,jn]){if(jn&&Hn.activeSession&&!Hn.activeSession.requiresSignIn){Mn=new AbortController;const Wn=async()=>{if(!Hn.activeSession)return;const vi=await sessionSchedulerClient.refreshToken(Hn.activeSession,Mn?.signal);await Rn(vi)},Yn=msUntilSessionExpired(Hn.activeSession),hi=window.setTimeout(Wn,Yn>0?Yn:0);Mn.signal.addEventListener("abort",()=>window.clearTimeout(hi))}else Mn&&(Mn.abort(),Mn=void 0)}return Ln(In.value()),In.subscribe(Ln)},[In,Rn])}function useActivatedWorkspace(on){reactExports.useEffect(()=>registerReceiveMessage(ACTIVATED_WORKSPACE_MESSAGE,async({session:In,workspaceId:Rn})=>{if(!on)return;const Mn=on.value(),{activeSession:Ln}=Mn;if(Ln?.id===In.id&&Ln.activeWorkspaceId!==Rn){const Hn={...Ln,activeWorkspaceId:Rn||void 0};await replaceUserSession(Hn),on.next(jn=>({...jn,activeSession:Hn}))}}),[on])}function HandleSignInCallbackProvider({children:on,state$:In}){const Rn=useHandleSignInCallback(In);return IS_RUNNING_IN_ELECTRON?jsx$1(HandleElectronSignInCallbackProvider,{state$:In,handleSignInCallback:Rn,children:on}):jsx$1(HandleWebSignInCallbackProvider,{handleSignInCallback:Rn,children:on})}function HandleElectronSignInCallbackProvider({children:on,state$:In,handleSignInCallback:Rn}){return useElectronSignInListener(In,Rn),jsx$1(Fragment,{children:on})}function HandleWebSignInCallbackProvider({children:on,handleSignInCallback:In}){return reactExports.useEffect(()=>{!IS_RUNNING_IN_ELECTRON&&isSigninRedirect(window.location)&&In(window.location.href)},[In]),jsx$1(Fragment,{children:on})}function useHandleSignInCallback(on){const In=useSignOut(),Rn=useUpsertSessionAction(on),Mn=useActivateSessionAction(on);return reactExports.useCallback(async(Ln,Hn)=>{const jn=new AbortController,Wn=Hn?linkAbortSignals(jn.signal,Hn):jn.signal;let Yn,hi=!1;try{Wn.addEventListener("abort",()=>{hi||triggerSignInCancelledNotification()}),on.next(Mi=>({...Mi,signInState:"sign-in"})),triggerSignInNotification(jn);const vi=parseCodeFromUrl(Ln),gi=parseIssuerFromUrl(Ln),{codeVerifier:mi,redirectUrl:yi}=await getAndValidateAuthenticationState(),{refreshToken:bi,idToken:Ei,accessToken:_i,expiresAt:xi}=await getAndValidateToken(gi,vi,yi,mi,Wn),{tenant:Ci,sub:Ai,email:Ii,login:Ni,apiUrl:Pi}=parseAccessToken(_i),Vi=await getUserSession({sub:Ai,tenant:Ci,issuer:gi});Yn=Vi?{id:Vi.id,issuer:gi,tenant:Ci,sub:Ai,accessToken:_i,refreshToken:bi,idToken:Ei,expiresAt:xi*ONE_SECOND$1,email:Ii,login:Ni,requiresSignIn:!1,hasUserAccount:!0,organization:Vi?Vi.organization:{displayName:"",id:""},activeWorkspaceId:Vi.activeWorkspaceId,billingUrl:Vi.billingUrl,manageTenantUrl:Vi.manageTenantUrl,apiUrl:Pi}:{id:nanoid(),issuer:gi,tenant:Ci,sub:Ai,accessToken:_i,refreshToken:bi,idToken:Ei,expiresAt:xi*ONE_SECOND$1,email:Ii,login:Ni,requiresSignIn:!1,hasUserAccount:!1,organization:{displayName:"",id:""},billingUrl:null,manageTenantUrl:null,apiUrl:Pi},await setCurrentTenant({tenant:Ci,sub:Ai,login:Ni,issuer:gi,apiUrl:Pi}),await Rn(Yn),triggerLoadAccountNotification();const Ui=await fetchUserAccount(Wn);if(Wn.aborted)return;const Gi=await fetchOrganizationInfo(Wn);if(Wn.aborted)return;const Yi=Ui!=="user-not-found",zi={...Yn,hasUserAccount:Yi,organization:Gi,billingUrl:Yi?Ui.billingUrl:null,manageTenantUrl:Yi?Ui.manageTenantUrl:null};await Rn(zi),await Mn(zi),hi=!0,triggerSingInCompleteNotification(),sendMessage({kind:SIGNED_IN_MESSAGE})}catch{Yn&&await In(Yn),triggerSignInFailedNotification()}finally{clearSignInPathFromUrl(),on.next(vi=>refreshSignInState({...vi,electron:void 0})),await deleteAuthenticationState()}},[on,Mn,In,Rn])}function clearSignInPathFromUrl(){const on=new URL(window.location.href);on.pathname=on.pathname.replace(APP_SIGNIN_PATH,""),window.history.pushState("","",`${on.origin}${on.pathname}`)}function useElectronSignInListener(on,In){reactExports.useEffect(()=>{if(IS_RUNNING_IN_ELECTRON){let Rn=function(Yn){const hi=window.messageChannel;if(!hi){triggerSignInFailedNotification();return}Hn=new AbortController,triggerSignInNotification(Hn),Hn.signal.addEventListener("abort",jn);function vi(mi){In(mi,Hn?.signal).then(()=>Hn=void 0).finally(jn)}const gi=hi.onRedirectUrlReceiver(vi);hi.triggerSignIn(Yn),jn=()=>{Hn?.abort(),gi()}},Mn=function(Yn){Ln.electron!==Yn.electron&&(Ln=Yn,Yn.electron&&Rn(Yn.electron.signInUrl))},Ln=on.value(),Hn,jn;const Wn=on.subscribe(Mn);return()=>{Wn(),jn()}}},[on,In])}function useIsUserSignedIn(){const on=useSignInState();return on==="signed-in"||on==="session-expired"}function UserNameSelector(on){return on.activeSession?.email??""}function useUserName(){return useSelector(SessionStateContext,UserNameSelector)}const ActivateSessionContext=createNamedContext(asyncNoop,"ActivateSession");function useActivateSessionAction(on){return reactExports.useCallback(async In=>{if(await setCurrentTenant(In?{tenant:In.tenant,sub:In.sub,login:In.login,issuer:In.issuer,apiUrl:In.apiUrl}:void 0),In){const Rn="accessToken"in In?In:await getUserSession(In);on.next(Mn=>refreshSignInState({...Mn,activeSession:Rn}))}else on.next(Rn=>refreshSignInState({...Rn,activeSession:void 0}))},[on])}function ActivateSessionProvider({children:on,state$:In}){const Rn=useActivateSessionAction(In);return jsx$1(ActivateSessionContext.Provider,{value:Rn,children:on})}function useActivateSession(){return reactExports.useContext(ActivateSessionContext)}const SignOutContext=createNamedContext(asyncNoop,"SignOut");function SignOutProvider({children:on,state$:In}){const Rn=useActivateSession(),Mn=reactExports.useCallback(async Ln=>{await signOutFromIssuers([Ln],In.value().activeSession===Ln);const Hn=await getUserSessions();Hn.length?(In.next(jn=>({...jn,sessions:Hn})),await Rn(Hn[0])):In.next({sessions:Hn,signInState:"signed-out",synchronizing:!1})},[In,Rn]);return jsx$1(SignOutContext.Provider,{value:Mn,children:on})}function useSignOut(){const on=reactExports.useContext(SignOutContext);return In=>triggerSignOutNotification(on(In))}const UpsertSessionContext=createNamedContext(asyncNoop,"UpsertSession");function useUpsertSession(){return reactExports.useContext(UpsertSessionContext)}function useUpsertSessionAction(on){return reactExports.useCallback(async In=>{if(on){await replaceUserSession(In);const Rn=await getUserSessions();on.next(Mn=>({...Mn,activeSession:areTenantsEqual(Mn.activeSession,In)?In:Mn.activeSession,sessions:Rn}))}},[on])}function UpsertSessionProvider({children:on,state$:In}){return jsx$1(UpsertSessionContext.Provider,{value:useUpsertSessionAction(In),children:on})}const CreateUserAccountContext=createNamedContext(asyncNoop,"CreateUserAccount");function useCreateUserAccount(){return reactExports.useContext(CreateUserAccountContext)}function CreateUserAccountProvider({children:on}){const In=useUpsertSession(),Rn=reactExports.useCallback(async(Mn,Ln)=>{try{triggerCreateAccountNotification();const Hn=await sessionSchedulerClient.createUserAccount(Ln),jn=await getUserSession(Mn);!jn||(Hn.errors?.length??0)>0?triggerSignInFailedNotification():await In({...jn,hasUserAccount:!0})}catch{triggerSignInFailedNotification()}},[In]);return jsx$1(CreateUserAccountContext.Provider,{value:Rn,children:on})}const SignOutOfCurrentSessionContext=createNamedContext(asyncNoop,"SignOutOfCurrentSession");function useSignOutOfCurrentSession(){return reactExports.useContext(SignOutOfCurrentSessionContext)}function SignOutOfCurrentSessionProvider({children:on,state$:In}){const Rn=useSignOut(),Mn=reactExports.useCallback(async()=>{const Ln=In.value()?.activeSession;Ln&&await Rn(Ln)},[In,Rn]);return jsx$1(SignOutOfCurrentSessionContext.Provider,{value:Mn,children:on})}const SignInContext=createNamedContext(asyncNoop,"SignIn");function useSignIn(){return reactExports.useContext(SignInContext)}function SignInProvider({children:on,state$:In}){const Rn=usePreset(),Mn=useAppendLogEntry(),Ln=reactExports.useCallback(async(Hn,jn)=>{let{codeVerifier:Wn,codeChallenge:Yn}=generateCodeVerifier(PKCE_CHALLENGE_S256);const hi=getRedirectUrl(),vi=Hn?.issuer??jn??Rn.organization?.serverUrl??Rn.instanceUrl??"https://identity.chillicream.com",gi=Hn?`tenant:${Hn.tenant}`:!Rn.organization?.serverUrl&&Rn.organization?.name?`tenant:${Rn.organization.name}`:"",mi=buildAuthorizeUrl({authorizationUrl:`${vi}/connect/authorize`,clientId:"d8b1d8dd-c26d-4b54-8cde-5f3c8eb054ba",redirectUrl:hi,scope:"openid offline_access documents:read documents:write workspace:manage",pkceMethod:PKCE_CHALLENGE_S256,codeChallenge:Yn,acrValues:gi,loginHint:Hn?`${Hn.sub}:${Hn.login}`:""});await setAuthenticationState({codeVerifier:Wn,codeChallenge:Yn,redirectUrl:hi}),IS_RUNNING_IN_ELECTRON?In.next(yi=>({...yi,signInState:"sign-in",electron:{signInUrl:mi}})):redirect(mi)},[In,Rn?.instanceUrl,Rn?.organization]);return reactExports.useEffect(()=>registerReceiveMessage(RENEW_SESSION_MESSAGE,()=>{Mn(null,LogLevel.info,"Renew user session"),Ln(In.value()?.activeSession)}),[In,Mn,Ln]),jsx$1(SignInContext.Provider,{value:Ln,children:on})}const SignInActiveSessionContext=createNamedContext(asyncNoop,"SignInActiveSession");function SignInActiveSessionProvider({children:on,state$:In}){const Rn=useSignIn(),Mn=reactExports.useCallback(async()=>{await Rn(In.value()?.activeSession)},[Rn,In]);return jsx$1(SignInActiveSessionContext.Provider,{value:Mn,children:on})}function useSignInActiveSession(){return reactExports.useContext(SignInActiveSessionContext)}const SessionStateContext=createNamedContext(null,"SessionState");function ActiveSessionSelector(on){return on.activeSession}function useActiveSession(){return useSelector(SessionStateContext,ActiveSessionSelector)}function useActiveSessionObservable(){return useSelectionObservable(reactExports.useContext(SessionStateContext),ActiveSessionSelector,void 0)}function SignInStateSelector(on){return on.signInState}function useSignInState(){return useSelector(SessionStateContext,SignInStateSelector)}function useSignInStateObservable(){return useSelectionObservable(reactExports.useContext(SessionStateContext),SignInStateSelector,INITIAL_STATE$4.signInState)}function SessionsSelector(on){return on.sessions}function useSessions(){return useSelector(SessionStateContext,SessionsSelector)}function IsUserAccountMissingSelector(on){return on.activeSession?.hasUserAccount===!1}function useIsUserAccountMissing(){return useSelector(SessionStateContext,IsUserAccountMissingSelector)}const SignOutAllContext=createNamedContext(asyncNoop,"SignOutAll");function SignOutAllProvider({children:on,state$:In}){const Rn=reactExports.useCallback(()=>{const Mn=In.value().sessions;return triggerSignOutNotification(signOutFromIssuers(Mn,!0).then(()=>{In.next({sessions:[],signInState:"signed-out",synchronizing:!1})}))},[In]);return jsx$1(SignOutAllContext.Provider,{value:Rn,children:on})}function useSignOutAll(){return reactExports.useContext(SignOutAllContext)}async function signOutFromIssuers(on,In){await Promise.all(on.map(async({idToken:Rn,issuer:Mn})=>{try{await fetch(`${Mn}/connect/endsession?id_token_hint${Rn?`=${Rn}`:""}`)}finally{}})),await purgeByTenants(on),In&&sendMessage({kind:SIGNED_OUT_MESSAGE})}function refreshSignInState(on){return{...on,signInState:on.activeSession?.hasUserAccount?"signed-in":"signed-out"}}function parseCodeFromUrl(on){const In=parseCodeResponse(new URL(on));if(!In.code)throw new Error("no code");return In.code}function parseIssuerFromUrl(on){const In=new URL(on),Rn=In.searchParams.get("iss");if(Rn)return removeTrailingSlash(Rn);if(In.hash?.length>0)return parseIssuerFromUrl("http://temp/"+In.hash.substring(1));throw new Error("Could not get issuer from callback url")}async function getAndValidateAuthenticationState(){const on=await getAuthenticationState();if(!on?.codeVerifier||!on.codeChallenge||!on.redirectUrl)throw new Error("illegal auth state");return on}async function getAndValidateToken(on,In,Rn,Mn,Ln){const Hn=await getToken$1({accessTokenUrl:`${on}/connect/token`,clientId:"d8b1d8dd-c26d-4b54-8cde-5f3c8eb054ba",credentialsInBody:!1,redirectUrl:Rn,code:In,codeVerifier:Mn},Ln),{refreshToken:jn,identityToken:Wn,accessToken:Yn,expiresAt:hi}=Hn;if(!jn||!Wn||!Yn||!hi)throw new Error("illegal auth state");return{refreshToken:jn,idToken:Wn,accessToken:Yn,expiresAt:hi}}function parseAccessToken(on){const In=parseJwt(on)??{},{tenant:Rn,sub:Mn,email:Ln,login:Hn,api_url:jn}=In,Wn=Yn=>Yn instanceof String||typeof Yn=="string";if(!Wn(Rn)||!Wn(Mn)||!Wn(Ln)||!Wn(Hn)||!Wn(jn))throw new Error("Could not parse access token");return{tenant:Rn,sub:Mn,email:Ln,login:Hn,apiUrl:`https://${jn}`}}async function fetchOrganizationInfo(on){const In=await sessionSchedulerClient.fetchOrganizationInfo(on);switch(In.kind){case"error":throw new Error(In.error);case"personal":return{displayName:"Personal Account",id:PERSONAL_ORGANIZATION_ID};case"organization":{const{displayName:Rn,id:Mn}=In;if(!Rn||!Mn)throw new Error("Could not parse the organization info response");return{displayName:Rn,id:Mn}}default:throw new Error("Illegal state")}}async function fetchUserAccount(on){const In=await sessionSchedulerClient.fetchUserAccount(on);switch(In.kind){case"error":throw new Error(In.error);case"user-not-found":return"user-not-found";case"user":const{id:Rn,username:Mn,billingUrl:Ln,manageTenantUrl:Hn}=In;if(!Mn||!Rn)throw new Error("Could not parse the user response");return{id:Rn,username:Mn,billingUrl:Ln,manageTenantUrl:Hn};default:throw new Error("Illegal state")}}function getRedirectUrl(){return IS_RUNNING_IN_ELECTRON?`${APP_SCHEME}://${APP_SIGNIN_PATH}`:appendUrlSegment(window.location.href,APP_SIGNIN_PATH).toString()}function redirect(on){IS_RUNNING_IN_ELECTRON?window.open(on):window.location.replace(on)}function isSigninRedirect({hash:on,pathname:In}){return on.startsWith(`#/${APP_SIGNIN_PATH}`)||In.endsWith(`/${APP_SIGNIN_PATH}`)}const DEFAULT_WORKSPACE_NAME="Default",DEFAULT_STATE={workspaces:[],activeWorkspace:void 0,synchronizing:!1,synchronizationResult:null,loading:!1};function WorkspaceProvider({children:on}){const In=reactExports.useRef(null),[Rn,Mn]=useInitialize$5();return Rn?jsx$1(ActivateWorkspaceProvider,{state$:Rn,activeSession$:Mn,children:jsx$1(CancelSynchronizeWorkspaceProvider,{abortControllerRef:In,children:jsx$1(SynchronizeWorkspaceProvider,{state$:Rn,abortControllerRef:In,children:jsx$1(WorkspaceStateContext.Provider,{value:Rn,children:on})})})}):null}function useInitialize$5(){const on=useForceUpdate(),In=useActiveSessionObservable(),Rn=reactExports.useRef(null);return reactExports.useEffect(()=>{let Mn;async function Ln(Hn){if(Rn.current)areTenantsEqual(Mn,Hn)&&Mn?.hasUserAccount===Hn?.hasUserAccount||(Mn=Hn,Hn&&Hn.hasUserAccount?(Rn.current.next(jn=>({...jn,loading:!0})),await loadInitialState(Hn,Rn.current)):Rn.current.next(DEFAULT_STATE));else if(Mn=Hn,Hn&&Hn.hasUserAccount){Rn.current=createSubject({...DEFAULT_STATE,loading:!0});try{await loadInitialState(Hn,Rn.current)}finally{on()}}else Rn.current=createSubject(DEFAULT_STATE),on()}return Ln(In.value()),In.subscribe(Ln)},[In,on]),usePersistState$1(Rn.current),[Rn.current,In]}function usePersistState$1(on){reactExports.useEffect(()=>{if(on){const In=on.value().activeWorkspace;return on.subscribe(async Rn=>{Rn.activeWorkspace&&Rn.activeWorkspace!==In&&await upsertWorkspace(Rn.activeWorkspace)})}},[on])}async function loadInitialState(on,In,Rn){try{const Mn=await loadWorkspaces(on,In);let Ln;try{Ln=await refreshWorkspaces(on,In,Rn),Ln.length||(triggerPrepareWorkspaceNotification(),await sessionSchedulerClient.createWorkspace(on,DEFAULT_WORKSPACE_NAME),Ln=await loadWorkspaces(on,In))}catch{Ln=Mn}Ln.length?triggerWorkspacePrepared():triggerWorkspacePreparationFailed()}catch{In.next(DEFAULT_STATE)}}async function loadWorkspaces(on,In){const Rn=await getWorkspacesByTenant(on);let Mn=on.activeWorkspaceId?Rn.find(({id:Ln})=>Ln===on.activeWorkspaceId):void 0;return!Mn&&Rn.length&&(Mn=Rn[0]),sendMessage({kind:ACTIVATED_WORKSPACE_MESSAGE,session:on,workspaceId:Mn?.id??null}),In.next(Ln=>({...Ln,activeWorkspace:Mn,workspaces:Rn,loading:!Rn.length})),Rn}async function refreshWorkspaces(on,In,Rn){return await sessionSchedulerClient.fetchWorkspaces(on,Rn),loadWorkspaces(on,In)}const ActivateWorkspaceContext=createNamedContext(noop$2,"ActivateWorkspace");function ActivateWorkspaceProvider({children:on,state$:In,activeSession$:Rn}){const Mn=reactExports.useCallback(Ln=>{const Hn=In.value(),jn=Rn.value();if(!jn||Hn.activeWorkspace?.id===Ln)return;const Wn=Hn.workspaces.find(({id:Yn})=>Yn===Ln);Wn&&(sendMessage({kind:ACTIVATED_WORKSPACE_MESSAGE,session:jn,workspaceId:Wn.id}),In.next(Yn=>({...Yn,activeWorkspace:Wn})))},[Rn,In]);return jsx$1(ActivateWorkspaceContext.Provider,{value:Mn,children:on})}function useActivateWorkspace(){return reactExports.useContext(ActivateWorkspaceContext)}const CancelSynchronizeWorkspaceContext=createNamedContext(noop$2,"CancelSynchronizeWorkspace");function CancelSynchronizeWorkspaceProvider({children:on,abortControllerRef:In}){const Rn=reactExports.useCallback(()=>{In.current?.abort()},[In]);return jsx$1(CancelSynchronizeWorkspaceContext.Provider,{value:Rn,children:on})}const SynchronizeWorkspaceContext=createNamedContext(asyncNoop,"SynchronizeWorkspace");function SynchronizeWorkspaceProvider({children:on,state$:In,abortControllerRef:Rn}){const Mn=useIsOnline(),Ln=reactExports.useRef(Mn),Hn=useDatabaseVersion(),jn=useAppendLogEntry();Ln.current=Mn;const Wn=reactExports.useCallback(async()=>{const Yn=In.value().activeWorkspace;if(!Yn||Rn.current||!Ln.current)return;Rn.current=new AbortController,In.next(gi=>({...gi,synchronizing:!0}));const vi=Yn.dbVersion!==Hn?void 0:Yn.version;try{const gi=await synchronizeWorkspace(jn,Yn.id,vi,Rn.current.signal);if(gi){const mi=yi=>yi&&yi.id===Yn.id?{...yi,version:gi.version,hasChanges:gi.hasChanges,dbVersion:Hn}:yi;In.next(yi=>{const bi=mi(yi.activeWorkspace);return{...yi,activeWorkspace:bi,workspaces:yi.workspaces.map(Ei=>Ei.id===bi?.id?bi:Ei),synchronizing:!1,synchronizationResult:gi}})}else In.next(mi=>mi.synchronizing?{...mi,synchronizing:!1}:mi)}catch{In.next(gi=>gi.synchronizing?{...gi,synchronizing:!1}:gi)}finally{Rn.current=null}},[Rn,Hn,In,jn]);return useTriggerSynchronizationOnWorkspaceSwitch(Wn,In),useSynchronizeWorkspaceEveryMinute(Wn,Mn),jsx$1(SynchronizeWorkspaceContext.Provider,{value:Wn,children:on})}async function synchronizeWorkspace(on,In,Rn,Mn){try{const Ln=await sessionSchedulerClient.synchronizeWorkspace(In,Rn,Mn);if(Ln.kind==="aborted")return null;switch(Ln.version&&Ln.version!==Rn&&sendMessage({kind:WORKSPACE_SYNCHRONIZED_MESSAGE,workspaceId:In,version:Ln.version}),Ln.kind){case"cancelled":return on(null,LogLevel.info,"Workspace synchronization has been cancelled."),{workspaceId:Ln.workspaceId,version:Ln.version,hasChanges:Ln.hasChanges};case"failed":return on(null,LogLevel.info,"Workspace synchronization has been failed."),null;case"success":return{workspaceId:Ln.workspaceId,version:Ln.version,hasChanges:Ln.hasChanges}}}catch{return on(null,LogLevel.info,"Workspace synchronization has been failed."),null}}function useSynchronizeWorkspaceEveryMinute(on,In){const Mn=useActiveSession()?.requiresSignIn;reactExports.useEffect(()=>{if(In){let Ln=!1;const Hn=()=>window.setTimeout(async()=>{Mn||await on(),Ln||(jn=Hn())},ONE_MINUTE$1);let jn=Hn();return()=>{Ln=!0,window.clearTimeout(jn)}}},[In,on,Mn])}function useTriggerSynchronizationOnWorkspaceSwitch(on,In){reactExports.useEffect(()=>{let Rn;function Mn(Ln){Ln.activeWorkspace?.id!==Rn&&(Rn=Ln.activeWorkspace?.id,Ln.activeWorkspace&&!Ln.synchronizing&&on())}return Mn(In.value()),In.subscribe(Mn)},[on,In])}function useSynchronizeWorkspace(){const on=reactExports.useContext(SynchronizeWorkspaceContext);return()=>void on()}const WorkspaceStateContext=createNamedContext(null,"WorkspaceStateContext");function useWorkspaceStateSubject(){return reactExports.useContext(WorkspaceStateContext)}function ActiveWorkspaceSelector(on){return on.activeWorkspace??null}function useActiveWorkspace(){return useSelector(WorkspaceStateContext,ActiveWorkspaceSelector)}function useActiveWorkspaceObservable(){return useSelectionObservable(reactExports.useContext(WorkspaceStateContext),ActiveWorkspaceSelector,null)}function WorkspacesSelector(on){return on.workspaces}function useWorkspaces(){return useSelector(WorkspaceStateContext,WorkspacesSelector)}function WorkspaceIdSelector(on){return on.activeWorkspace?.id??null}function useWorkspaceId(){return useSelector(WorkspaceStateContext,WorkspaceIdSelector)}function useWorkspaceIdObservable(){return useSelectionObservable(reactExports.useContext(WorkspaceStateContext),WorkspaceIdSelector,null)}function WorkspaceNameSelector(on){return on.activeWorkspace?.name??null}function useWorkspaceNameObservable(){return useSelectionObservable(reactExports.useContext(WorkspaceStateContext),WorkspaceNameSelector,null)}function WorkspaceSynchronizingSelector(on){return on.synchronizing}function useWorkspaceSynchronizing(){return useSelector(WorkspaceStateContext,WorkspaceSynchronizingSelector)}function IsOrganizationalWorkspace(on){return on.activeWorkspace?on.activeWorkspace.tenant!==PERSONAL_WORKSPACE_TENANT:!1}function useIsOrganizationalWorkspace(){return useSelector(WorkspaceStateContext,IsOrganizationalWorkspace)}function useReloadWorkspaces(){const on=reactExports.useContext(WorkspaceStateContext),In=useActiveSession();return reactExports.useCallback(async()=>{!on||!In||await refreshWorkspaces(In,on)},[on,In])}const INITIAL_STATE$3={activeEnvironment:null,environments:[],loading:!1};function EnvironmentProvider({children:on}){const In=useWorkspaceIdObservable(),Rn=useInitialize$4(In);return Rn?jsx$1(CreateEnvironmentProvider,{state$:Rn,workspaceId$:In,children:jsx$1(DeleteEnvironmentProvider,{state$:Rn,workspaceId$:In,children:jsx$1(RenameEnvironmentProvider,{state$:Rn,workspaceId$:In,children:jsx$1(EnvironmentStateContext.Provider,{value:Rn,children:on})})})}):null}function useInitialize$4(on){const In=useForceUpdate(),Rn=useCombine(on,useActiveEnvironmentIdObservable()),Mn=reactExports.useRef(null);return reactExports.useEffect(()=>{let Ln=null,Hn=null;async function jn(hi,vi){async function gi(mi,yi){if(mi.next({...INITIAL_STATE$3,loading:!!yi}),!!yi)try{const bi=await getEnvironmentItems(yi);mi.next({activeEnvironment:bi.find(({id:Ei})=>Ei===vi)??null,environments:sortEnvironments(bi),loading:!1})}catch{mi.next(INITIAL_STATE$3)}}if(Mn.current)Ln!==hi?await gi(Mn.current,hi):Hn!==vi&&Mn.current.next(mi=>({...mi,activeEnvironment:mi.environments.find(({id:yi})=>yi===vi)??null}));else{Mn.current=createSubject(INITIAL_STATE$3);try{await gi(Mn.current,hi)}finally{In()}}Ln=hi,Hn=vi}const[Wn,Yn]=Rn.value();return jn(Wn,Yn),Rn.subscribe(([hi,vi])=>jn(hi,vi))},[Rn,In]),useCleanupRemovedEnvironments(Mn.current),useReloadEnvironments(Mn.current),Mn.current}function useCleanupRemovedEnvironments(on){const In=useActivateEnvironment();reactExports.useEffect(()=>{if(on)return registerReceiveMessage(DELETED_ITEMS_MESSAGE,({deletedItems:Rn})=>{const Mn=Rn.filter(({kind:Hn})=>isEnvironmentItemKind(Hn)).map(({id:Hn})=>Hn),Ln=on.value().activeEnvironment?.id;Ln&&Mn.includes(Ln)&&In(null),on.next(Hn=>Mn.length?{...Hn,environments:Hn.environments.filter(({id:jn})=>!Mn.includes(jn))}:Hn)})},[on,In])}function useReloadEnvironments(on){const In=useActivateEnvironment();reactExports.useEffect(()=>{if(on)return registerReceiveMessage(WORKSPACE_SYNCHRONIZED_MESSAGE,async({workspaceId:Rn})=>{const Mn=await getEnvironmentItems(Rn),Ln=on.value().activeEnvironment?.id;Ln&&!Mn.some(({id:jn})=>jn===Ln)&&In(null);let{activeEnvironment:Hn}=on.value();Hn&&(Hn=await getEnvironmentItem(Hn.id)??null),on.next(jn=>({...jn,activeEnvironment:Hn,environments:sortEnvironments(Mn)}))})},[on,In])}function sortEnvironments(on){return on.sort((In,Rn)=>In.name.localeCompare(Rn.name,"en",{sensitivity:"base"}))}const EnvironmentStateContext=createNamedContext(null,"EnvironmentState");function useActivateEnvironment(){return useSubjectNext(useWorkspaceStateSubject(),updateActiveEnvironmentId)}function updateActiveEnvironmentId(on,In){const{activeWorkspace:Rn}=on;return!Rn||ActiveEnvironmentIdSelector(on)===In?on:{...on,activeWorkspace:{...Rn,appState:{...Rn.appState,activeEnvironmentId:In}}}}const CreateEnvironmentContext=createNamedContext(asyncNoop,"CreateEnvironment");function CreateEnvironmentProvider({children:on,state$:In,workspaceId$:Rn}){const Mn=reactExports.useCallback(async(Ln,Hn)=>{const jn=Rn.value();jn&&(await createEnvironmentItem(Ln,jn,null,null,Hn),In.next(Wn=>({...Wn,environments:sortEnvironments([...Wn.environments,{id:Ln,name:Hn}])})))},[In,Rn]);return jsx$1(CreateEnvironmentContext.Provider,{value:Mn,children:on})}const DeleteEnvironmentContext=createNamedContext(asyncNoop,"CreateEnvironment");function useDeleteEnvironment(){return reactExports.useContext(DeleteEnvironmentContext)}function DeleteEnvironmentProvider({children:on,state$:In,workspaceId$:Rn}){const Mn=useActivateEnvironment(),Ln=useSynchronizeWorkspace(),Hn=reactExports.useCallback(async jn=>{const Wn=Rn.value();if(Wn){const Yn=In.value().activeEnvironment?.id===jn;Yn&&Mn(null);const hi=await deleteItem(jn);In.next(vi=>({...vi,environments:vi.environments.filter(gi=>gi.id!==jn),activeEnvironment:Yn?null:vi.activeEnvironment})),sendMessage({kind:DELETED_ITEMS_MESSAGE,workspaceId:Wn,deletedItems:hi}),Ln()}},[In,Rn,Mn,Ln]);return jsx$1(DeleteEnvironmentContext.Provider,{value:Hn,children:on})}const RenameEnvironmentContext=createNamedContext(asyncNoop,"CreateEnvironment");function useRenameEnvironment(){return reactExports.useContext(RenameEnvironmentContext)}function RenameEnvironmentProvider({children:on,state$:In,workspaceId$:Rn}){const Mn=useSynchronizeWorkspace(),Ln=reactExports.useCallback(async(Hn,jn)=>{const Wn=Rn.value();if(Wn){let Yn=In.value().activeEnvironment;Yn?.id===Hn&&(Yn={id:Hn,name:jn});const hi=await renameItem(Hn,jn);hi&&(In.next(vi=>({...vi,environments:sortEnvironments(vi.environments.map(gi=>gi.id===Hn?{id:Hn,name:jn}:gi)),activeEnvironment:Yn})),sendMessage({kind:RENAMED_ITEM_MESSAGE,workspaceId:Wn,itemId:Hn,itemKind:hi.kind,itemName:jn}),Mn())}},[In,Rn,Mn]);return jsx$1(RenameEnvironmentContext.Provider,{value:Ln,children:on})}function ActiveEnvironmentSelector(on){return on.activeEnvironment}function useActiveEnvironment(){return useSelector(EnvironmentStateContext,ActiveEnvironmentSelector)}function ActiveEnvironmentIdSelector(on){return on.activeWorkspace?.appState?.activeEnvironmentId||null}function useActiveEnvironmentId(){return useObservableSelector(useWorkspaceStateSubject(),ActiveEnvironmentIdSelector)}function useActiveEnvironmentIdObservable(){return useSelectionObservable(useWorkspaceStateSubject(),ActiveEnvironmentIdSelector,null)}function EnvironmentsSelector(on){return on.environments}function useEnvironments(){return useSelector(EnvironmentStateContext,EnvironmentsSelector)}function useFetchToken(){const on=useActiveEnvironmentId(),[In,Rn]=reactExports.useState(!1),[Mn,Ln]=reactExports.useState(),Hn=reactExports.useRef(),jn=reactExports.useCallback(()=>{Hn.current?.abort(),Hn.current=void 0,Rn(!1)},[Rn]),Wn=reactExports.useCallback(async Yn=>{if(In)return;const hi=new AbortController;Hn.current=hi;try{Rn(!0),Ln(void 0);const vi=await getResolvedVariables(on);return await authorizeAndGetToken(interpolateOAuth2Authentication(Yn,vi)??Yn,hi.signal)}catch(vi){Ln(vi);return}finally{Rn(!1),hi.abort()}},[on,In,Ln,Rn]);return reactExports.useEffect(()=>jn,[jn]),{error:Mn,cancel:jn,fetchToken:Wn,loading:In}}const INITIAL_STATE$2={refs:{},cache:{}};function ConnectionSettingsProvider({children:on}){const In=useInitialize$3();return jsx$1(UpdateConnectionSettingsProvider,{state$:In.current,children:jsx$1(ConnectionSettingsStateContext.Provider,{value:In.current,children:on})})}function useInitialize$3(){const on=useRefWithInitializer(()=>createSubject(INITIAL_STATE$2)),In=useItemStore(),Rn=useSetCacheItem(on.current);return useConnectionSettingsUpdated(on.current),reactExports.useEffect(()=>In.subscribeAll(async(Mn,Ln)=>{if(!(!isApiItem(Ln)&&!isDocumentItem(Ln)))switch(Mn){case ItemChangeAction.LOAD:{const Hn=isApiDocumentItem(Ln)?Ln.apiId:Ln.id,jn=on.current.value().refs[Ln.id],Wn=on.current.value();if(isApiItem(Ln)&&isApiAlreadyCached(Wn,Hn)){on.current.next(hi=>removeUnreferencedCacheItem({...hi,refs:{...hi.refs,[Ln.id]:Hn}},jn));break}const Yn=(await getConnectionSettings(Hn))?.http??DEFAULT_HTTP_CONNECTION;Rn(Hn,jn,Ln.id,Yn)}break;case ItemChangeAction.UNLOAD:{const Hn=on.current.value().refs[Ln.id];if(!Hn)return;on.current.next(jn=>removeCacheItemAndKey(jn,Hn,Ln.id))}break}}),[on,In,Rn]),on}function useConnectionSettingsUpdated(on){reactExports.useEffect(()=>registerReceiveMessage(CONNECTION_SETTINGS_UPDATED_MESSAGE,({documentId:In,connectionSettings:Rn})=>{const Mn=on.value().refs[In];Mn&&on.next(Ln=>({...Ln,cache:{...Ln.cache,[Mn]:{...Ln.cache[Mn],data:Rn.http}}}))}),[on])}const ConnectionSettingsStateContext=createNamedContext(null,"ConnectionSettingsState");function ConnectionSettingsSelector(on){return reactExports.useCallback(In=>{const Rn=In.refs[on]??"";return{apiOrDocumentId:Rn,httpConnection:In.cache[Rn]?.data??DEFAULT_HTTP_CONNECTION}},[on])}function useConnectionSettings(on){return useSelector(ConnectionSettingsStateContext,ConnectionSettingsSelector(on))}function AuthorizationHeaderValueSelector(on){return In=>ConnectionSettingsSelector(on)(In).httpConnection.authentication?.headerValue??null}function useAuthorizationHeaderValue(on){return useSelector(ConnectionSettingsStateContext,AuthorizationHeaderValueSelector(on))}function HttpHeadersSelector(on){return In=>ConnectionSettingsSelector(on)(In).httpConnection.headers??null}function useHttpHeaders(on){return useSelector(ConnectionSettingsStateContext,HttpHeadersSelector(on))}function HttpSchemaEndpointSelector(on){return In=>{const Rn=ConnectionSettingsSelector(on)(In).httpConnection;return Rn.sdlEndpoint||Rn.endpoint}}function useHttpSchemaEndpoint(on){return useSelector(ConnectionSettingsStateContext,HttpSchemaEndpointSelector(on))}function useHttpSchemaEndpointObservable(on){return useSelectionObservable(reactExports.useContext(ConnectionSettingsStateContext),In=>{const Rn=In.refs[on]??"",Mn=In.cache[Rn]?.data??DEFAULT_HTTP_CONNECTION;return Mn.sdlEndpoint||Mn.endpoint},"")}function HttpEndpointSelector(on){return In=>ConnectionSettingsSelector(on)(In).httpConnection.endpoint}function useHttpEndpoint(on){return useSelector(ConnectionSettingsStateContext,HttpEndpointSelector(on))}function useBeautifiedHttpEndpoint(on){return beautifyEndpoint(useSelector(ConnectionSettingsStateContext,HttpEndpointSelector(on)))}function QueryPlanEnabledSelector(on){return In=>ConnectionSettingsSelector(on)(In).httpConnection.headers?.some(({name:Rn,value:Mn,enabled:Ln})=>FUSION_OPERATION_PLAN_HEADER_NAME_PATTERN.test(Rn)&&Mn.trim()==="1"&&Ln)??!1}function useQueryPlanEnabled(on){return useSelector(ConnectionSettingsStateContext,QueryPlanEnabledSelector(on))}const UpdateConnectionSettingsContext=createNamedContext(asyncNoop,"UpdateConnectionSettings");function UpdateConnectionSettingsProvider({children:on,state$:In}){const Rn=reactExports.useCallback(async function(Ln,Hn,jn){const Wn=await updateHttpConnectionSettings(Ln,Hn,jn);Wn&&In.next(Yn=>Yn.cache[Wn.itemId]?{...Yn,cache:{...Yn.cache,[Wn.itemId]:{...Yn.cache[Wn.itemId],data:Wn.http}}}:Yn)},[In]);return jsx$1(UpdateConnectionSettingsContext.Provider,{value:Rn,children:on})}function useUpdateConnectionSettings(){return reactExports.useContext(UpdateConnectionSettingsContext)}function useEnableQueryPlan(on){const In=useUpdateConnectionSettings(),Rn=useHttpHeaders(on);return reactExports.useCallback(Mn=>{if(!Rn)return In(on,{headers:[{name:HEADER_FUSION_OPERATION_PLAN,value:"1",enabled:!0}]},Mn);const Ln=Rn.findLastIndex(({name:Hn})=>FUSION_OPERATION_PLAN_HEADER_NAME_PATTERN.test(Hn));return In(on,{headers:Ln!==-1?Rn.map((Hn,jn)=>jn===Ln?{name:HEADER_FUSION_OPERATION_PLAN,value:"1",enabled:!0}:Hn):[...Rn,{name:HEADER_FUSION_OPERATION_PLAN,value:"1",enabled:!0}]})},[on,Rn,In])}function useSetCacheItem(on){return reactExports.useCallback((In,Rn,Mn,Ln)=>{const Hn={apiOrDocumentId:In,data:Ln};on.next(jn=>removeUnreferencedCacheItem({...jn,refs:{...jn.refs,[Mn]:In},cache:{...jn.cache,[In]:Hn}},Rn))},[on])}function isApiAlreadyCached(on,In){return Object.values(on.refs).some(Rn=>Rn===In)}function removeCacheItemAndKey(on,In,Rn){const Mn=Object.values(on.refs).filter(jn=>jn===In).length,Ln=Object.entries(on.cache).filter(([jn])=>!(jn===In&&!Mn)),Hn=Object.entries(on.refs).filter(([jn])=>jn!==Rn);return{...on,refs:Object.fromEntries(Hn),cache:Object.fromEntries(Ln)}}function removeUnreferencedCacheItem(on,In){const Rn=Object.values(on.refs).filter(Ln=>Ln===In).length,Mn=Object.entries(on.cache).filter(([Ln])=>!(Ln===In&&!Rn));return{...on,cache:Object.fromEntries(Mn)}}const modalSubject$=createSubject(void 0),modalApi={get current(){return modalSubject$.observable},show(on){modalSubject$.next(on)},hide(on,In){const Rn=modalSubject$.value();Rn?.id===on&&(modalSubject$.next(void 0),In!==void 0&&Rn.onDone?.(In))}};function isEqual(on,In){return on?.item?.id===In?.item?.id}function useActiveModal(on){const In=reactExports.useCallback(Rn=>{if(Rn&&(!on||on&&Rn.id===on))return{item:Rn,hide(Mn){modalApi.hide(Rn.id,Mn)}}},[on]);return useSyncStore(modalApi.current,In,{useRequestAnimationFrame:!1,isEqual})}const ButtonGroup=styled("div")(({theme:on})=>css`
|
|
4725
4725
|
display: flex;
|
|
4726
4726
|
flex: 0 0 auto;
|
|
4727
4727
|
align-items: center;
|
|
@@ -4963,7 +4963,7 @@ ${In.join(`
|
|
|
4963
4963
|
`),Text$1=styled("span")`
|
|
4964
4964
|
flex-wrap: nowrap;
|
|
4965
4965
|
color: ${THEME_COLORS.base.text};
|
|
4966
|
-
`,StyledSwitch=styled(Switch)(({theme:on})=>({width:30,height:18,padding:0,display:"flex","&:active":{"& .MuiSwitch-thumb":{width:15},"& .MuiSwitch-switchBase.Mui-checked":{transform:"translateX(9px)"}},"& .Mui-disabled":{opacity:"0.5 !important","& + .MuiSwitch-track":{opacity:"0.5 !important"}},"& .MuiSwitch-switchBase":{padding:2,color:THEME_COLORS.components.toggleThumb,transition:"color 0.2s ease","& + .MuiSwitch-track":{borderColor:THEME_COLORS.components.toggleTrackBorder,backgroundColor:THEME_COLORS.components.toggleTrack,transition:"background-color 0.2s ease, border-color 0.2s ease"},"&.Mui-checked":{transform:"translateX(12px)",color:THEME_COLORS.components.toggleThumbActive,"& + .MuiSwitch-track":{opacity:1,borderColor:THEME_COLORS.components.toggleTrackActiveBorder,backgroundColor:THEME_COLORS.components.toggleTrackActive}}},"& .MuiSwitch-switchBase:hover":{color:THEME_COLORS.components.toggleThumbHover,"& + .MuiSwitch-track":{borderColor:THEME_COLORS.components.toggleTrackHoverBorder,backgroundColor:THEME_COLORS.components.toggleTrackHover},"&.Mui-checked":{color:THEME_COLORS.components.toggleThumbActiveHover,"& + .MuiSwitch-track":{borderColor:THEME_COLORS.components.toggleTrackActiveHoverBorder,backgroundColor:THEME_COLORS.components.toggleTrackActiveHover}}},"& .MuiSwitch-thumb":{boxShadow:"0 2px 4px 0 rgb(0 35 11 / 20%)",margin:1,width:12,height:12,borderRadius:6,transition:on.transitions.create(["width"],{duration:200})},"& .MuiSwitch-track":{borderRadius:18/2,opacity:1,boxSizing:"border-box",borderStyle:"solid",borderWidth:1}})),defaultOptions={grantType:GRANT_TYPE_AUTHORIZATION_CODE,activeFlowKind:GRANT_TYPE_AUTHORIZATION_CODE,authorizationUrl:"",accessTokenUrl:"",credentialsInBody:!1,clientId:"",clientSecret:"",redirectUrl:"",scope:"",state:"",audience:"",resource:"",responseType:RESPONSE_TYPE_TOKEN,usePkce:!0,pkceMethod:PKCE_CHALLENGE_S256,origin:"",username:"",password:"",prefix:""},OAuth2AuthForm=reactExports.memo(function on({options:In=defaultOptions,onChange:Rn}){const{error:Mn,cancel:Ln,fetchToken:Hn,loading:jn}=useFetchToken();return jsxs(Fragment,{children:[jsx$1(GrantTypeInput,{options:In,onChange:Rn}),jsx$1(GroupInput,{flows:[GRANT_TYPE_AUTHORIZATION_CODE,GRANT_TYPE_IMPLICIT],id:"authorizationUrl",type:"text",placeholder:"https://authorization-server.com/oauth2/authorize",options:In,onChange:Rn,label:"Authorization URL"}),jsx$1(GroupInput,{flows:[GRANT_TYPE_PASSWORD],id:"username",type:"text",placeholder:"",options:In,onChange:Rn,label:"Username"}),jsx$1(GroupInput,{flows:[GRANT_TYPE_PASSWORD],id:"password",type:"password",placeholder:"",options:In,onChange:Rn,label:"Password"}),jsx$1(GroupInput,{flows:[GRANT_TYPE_AUTHORIZATION_CODE,GRANT_TYPE_CLIENT_CREDENTIALS,GRANT_TYPE_PASSWORD],id:"accessTokenUrl",type:"text",placeholder:"https://authorization-server.com/oauth2/token",options:In,onChange:Rn,label:"Access Token URL"}),jsx$1(GroupInput,{flows:[GRANT_TYPE_AUTHORIZATION_CODE,GRANT_TYPE_CLIENT_CREDENTIALS,GRANT_TYPE_IMPLICIT,GRANT_TYPE_PASSWORD],id:"clientId",type:"text",options:In,onChange:Rn,label:"Client ID"}),jsx$1(GroupInput,{flows:[GRANT_TYPE_AUTHORIZATION_CODE,GRANT_TYPE_CLIENT_CREDENTIALS,GRANT_TYPE_PASSWORD],id:"clientSecret",type:"password",options:In,onChange:Rn,label:"Client Secret"}),jsx$1(UsePkceInput,{flows:[GRANT_TYPE_AUTHORIZATION_CODE],options:In,onChange:Rn}),jsx$1(CodeChallengeMethodInput,{flows:[GRANT_TYPE_AUTHORIZATION_CODE],options:In,onChange:Rn}),jsx$1(GroupInput,{flows:[GRANT_TYPE_AUTHORIZATION_CODE,GRANT_TYPE_IMPLICIT],id:"redirectUrl",type:"text",options:In,onChange:Rn,label:"Redirect URL"}),jsx$1(RedirectUrlInfoMessage,{redirectUrl:In.redirectUrl}),jsx$1(ResponseTypeInput,{flows:[GRANT_TYPE_IMPLICIT],options:In,onChange:Rn}),jsx$1(GroupInput,{flows:[GRANT_TYPE_AUTHORIZATION_CODE,GRANT_TYPE_IMPLICIT,GRANT_TYPE_CLIENT_CREDENTIALS,GRANT_TYPE_PASSWORD],id:"scope",type:"text",options:In,onChange:Rn,label:"Scope"}),jsx$1(GroupInput,{flows:[GRANT_TYPE_AUTHORIZATION_CODE,GRANT_TYPE_IMPLICIT],id:"state",type:"text",options:In,onChange:Rn,label:"State"}),jsx$1(CredentialsInBodyInput,{flows:[GRANT_TYPE_AUTHORIZATION_CODE,GRANT_TYPE_CLIENT_CREDENTIALS,GRANT_TYPE_PASSWORD],options:In,onChange:Rn}),jsx$1(GroupInput,{flows:[GRANT_TYPE_AUTHORIZATION_CODE,GRANT_TYPE_IMPLICIT,GRANT_TYPE_CLIENT_CREDENTIALS,GRANT_TYPE_PASSWORD],id:"prefix",type:"text",options:In,onChange:Rn,label:"Header Prefix"}),jsx$1(GroupInput,{flows:[GRANT_TYPE_AUTHORIZATION_CODE,GRANT_TYPE_IMPLICIT,GRANT_TYPE_CLIENT_CREDENTIALS,GRANT_TYPE_PASSWORD],id:"audience",type:"text",options:In,onChange:Rn,label:"Audience"}),jsx$1(GroupInput,{flows:[GRANT_TYPE_AUTHORIZATION_CODE,GRANT_TYPE_CLIENT_CREDENTIALS],id:"resource",type:"text",options:In,onChange:Rn,label:"Resource"}),jsx$1(GroupInput,{flows:[GRANT_TYPE_AUTHORIZATION_CODE],id:"origin",type:"text",options:In,onChange:Rn,label:"Origin"}),jsx$1(TokenDetails,{options:In,onChange:Rn}),jsxs(Group,{children:[jsx$1(ClearTokenButton,{options:In,onChange:Rn}),jsx$1(RefreshTokenButton,{options:In,onChange:Rn,cancel:Ln,fetchToken:Hn,loading:jn}),jsx$1(FetchTokenButton,{options:In,onChange:Rn,cancel:Ln,fetchToken:Hn,loading:jn}),jsx$1(ChangeSessionButton,{options:In,onChange:Rn})]}),Mn&&jsx$1(Alert,{severity:"warning",title:"Error",children:Mn.message??"Ops, something went wrong!"})]})}),FetchTokenButton=({cancel:on,fetchToken:In,loading:Rn,options:Mn,onChange:Ln})=>jsx$1(ButtonWithDescription,{description:"Fetch token",onClick:Rn?hi=>{hi.preventDefault(),hi.stopPropagation(),on()}:async hi=>{hi.preventDefault(),hi.stopPropagation();const vi=await In(Mn);vi&&Ln({oAuth2Options:{...Mn,token:vi}})},children:Rn?jsxs(Fragment,{children:[jsx$1(Spinner$1,{colorSelector:hi=>hi.components.buttonText}),"Cancel"]}):jsx$1(Fragment,{children:"Fetch"})}),GrantTypeInput=({onChange:on,options:In})=>jsxs(Group,{children:[jsx$1(Label,{htmlFor:"grant-type",children:"Grant Type"}),jsxs(Select,{id:"grant-type",onChange:Mn=>{let Ln=GRANT_TYPE_AUTHORIZATION_CODE,Hn=GRANT_TYPE_AUTHORIZATION_CODE;switch(Mn.target.value??""){case GRANT_TYPE_IMPLICIT:Ln=GRANT_TYPE_IMPLICIT,Hn=GRANT_TYPE_IMPLICIT;break;case GRANT_TYPE_CLIENT_CREDENTIALS:Ln=GRANT_TYPE_CLIENT_CREDENTIALS,Hn=GRANT_TYPE_CLIENT_CREDENTIALS;break;case GRANT_TYPE_PASSWORD:Ln=GRANT_TYPE_PASSWORD,Hn=GRANT_TYPE_PASSWORD;break}on({oAuth2Options:{...In,grantType:Hn,activeFlowKind:Ln}})},value:In.activeFlowKind,children:[jsx$1("option",{value:GRANT_TYPE_AUTHORIZATION_CODE,children:"Authorization Code"}),jsx$1("option",{value:GRANT_TYPE_IMPLICIT,children:"Implicit"}),jsx$1("option",{value:GRANT_TYPE_CLIENT_CREDENTIALS,children:"Client Credentials"}),jsx$1("option",{value:GRANT_TYPE_PASSWORD,children:"Resource Owner Password Credentials"})]})]}),GroupInput=({flows:on,label:In,id:Rn,onChange:Mn,options:Ln,...Hn})=>{const jn=useIsFlowActive(Ln.activeFlowKind,on),Wn=Yn=>{Mn({oAuth2Options:{...Ln,[Rn]:Yn.target.value??""}})};return jn?jsxs(Group,{children:[jsx$1(Label,{htmlFor:String(Rn),children:In}),jsx$1(InterpolationInput,{id:String(Rn),value:Ln[Rn],onChange:Wn,...Hn})]}):null},UsePkceInput=({onChange:on,options:In,flows:Rn})=>{const Mn=useIsFlowActive(In.activeFlowKind,Rn),Ln=Hn=>{on({oAuth2Options:{...In,usePkce:Hn}})};return Mn?jsx$1(Group,{children:jsxs(Label,{children:[jsx$1(LabelDescription,{children:"Use PKCE"}),jsx$1(Toggle,{checked:In.usePkce,offText:"No",onText:"Yes",onChange:Ln})]})}):null},CodeChallengeMethodInput=({onChange:on,options:In,flows:Rn})=>{const Mn=useIsFlowActive(In.activeFlowKind,Rn),Ln=Hn=>{const jn=Hn.target.value===PKCE_CHALLENGE_PLAIN?PKCE_CHALLENGE_PLAIN:PKCE_CHALLENGE_S256;on({oAuth2Options:{...In,pkceMethod:jn}})};return Mn&&In.usePkce?jsxs(Group,{children:[jsx$1(Label,{htmlFor:"pkce-method-code-challenge",children:"Code Challenge Method"}),jsxs(Select,{id:"pkce-method-code-challenge",value:In.pkceMethod,onChange:Ln,children:[jsx$1("option",{value:PKCE_CHALLENGE_S256,children:"SHA-256"}),jsx$1("option",{value:PKCE_CHALLENGE_PLAIN,children:"Plain"})]})]}):null},CredentialsInBodyInput=({onChange:on,options:In,flows:Rn})=>useIsFlowActive(In.activeFlowKind,Rn)?jsxs(Group,{children:[jsx$1(Label,{htmlFor:"pkce-method-credentials",children:"Credentials"}),jsxs(Select,{id:"pkce-method-credentials",onChange:Hn=>{const jn=Hn.target.value==="body";on({oAuth2Options:{...In,credentialsInBody:jn}})},value:In.credentialsInBody?"body":"header",children:[jsx$1("option",{value:"header",children:"As Basic Auth Header (default)"}),jsx$1("option",{value:"body",children:"In Request Body"})]})]}):null,TokenDetails=({options:on})=>on.token?jsxs(Fragment,{children:[jsxs(Group,{children:[jsx$1(Label,{htmlFor:"id_token",children:"Id Token"}),jsx$1(Input,{id:"id_token",disabled:!0,value:on.token.identityToken??""})]}),jsxs(Group,{children:[jsx$1(Label,{htmlFor:"access_token",children:"Access Token"}),jsx$1(Input,{id:"access_token",disabled:!0,value:on.token.accessToken??""})]}),jsxs(Group,{children:[jsx$1(Label,{htmlFor:"refresh_token",children:"Refresh Token"}),jsx$1(Input,{id:"refresh_token",disabled:!0,value:on.token.refreshToken??""})]})]}):null;function ClearTokenButton({options:on,onChange:In}){return on.token?jsx$1(ButtonWithDescription,{description:"Clear tokens",onClick:()=>{In({oAuth2Options:{...on,token:void 0}})},children:"Clear"}):null}function ChangeSessionButton({options:on,onChange:In}){if(!IS_RUNNING_IN_ELECTRON||on.activeFlowKind!==GRANT_TYPE_AUTHORIZATION_CODE&&on.activeFlowKind!==GRANT_TYPE_IMPLICIT)return null;const Rn=Mn=>{Mn.preventDefault(),Mn.stopPropagation(),In({oAuth2Options:{...on,sessionId:nanoid()}})};return jsx$1(ButtonWithDescription,{description:"Reset session on identity server",tooltip:`The browser persist your authentication session on ${on.authorizationUrl??"your identity server."}, so that you do not have to sign in every time. If you want to log in with a different user, you should reset your session by pressing the button on the right.`,onClick:Rn,children:"Reset"})}const RefreshTokenButton=({cancel:on,fetchToken:In,loading:Rn,options:Mn,onChange:Ln})=>{const Hn=hi=>{hi.preventDefault(),hi.stopPropagation(),on()},jn=async hi=>{hi.preventDefault(),hi.stopPropagation();const vi=await In({...Mn,grantType:GRANT_TYPE_REFRESH});vi&&Ln({oAuth2Options:{...Mn,token:vi}})};return Mn?.token?.refreshToken?jsx$1(ButtonWithDescription,{description:"Refresh token",onClick:Rn?Hn:jn,children:Rn?jsxs(Fragment,{children:[jsx$1(Spinner$1,{colorSelector:hi=>hi.components.buttonText}),"Cancel"]}):jsx$1(Fragment,{children:"Refresh"})}):null},ResponseTypeInput=({flows:on,onChange:In,options:Rn})=>useIsFlowActive(Rn.activeFlowKind,on)?jsxs(Group,{children:[jsx$1(Label,{htmlFor:"response-type",children:"Response Type"}),jsxs(Select,{id:"response-type",onChange:Hn=>{let jn=RESPONSE_TYPE_TOKEN;switch(Hn.target.value??""){case RESPONSE_TYPE_ID_TOKEN:jn=RESPONSE_TYPE_ID_TOKEN;break;case RESPONSE_TYPE_ID_TOKEN_TOKEN:jn=RESPONSE_TYPE_ID_TOKEN_TOKEN;break}In({oAuth2Options:{...Rn,responseType:jn}})},value:Rn.responseType,children:[jsx$1("option",{value:RESPONSE_TYPE_TOKEN,children:"Access Token"}),jsx$1("option",{value:RESPONSE_TYPE_ID_TOKEN,children:"ID Token"}),jsx$1("option",{value:RESPONSE_TYPE_ID_TOKEN_TOKEN,children:"ID and Access Token"})]})]}):null;function useIsFlowActive(on,In){return reactExports.useMemo(()=>!!In.find(Rn=>Rn===on),[In,on])}function ButtonWithDescription({children:on,description:In,tooltip:Rn,...Mn}){return jsxs(Label,{children:[jsxs(LabelDescription,{children:[In,Rn&&jsx$1(Tooltip,{title:Rn,placement:"top-start",children:jsx$1("span",{children:jsx$1(InfoIcon,{})})})]}),Rn?jsx$1(TooltipButton,{tooltip:Rn,...Mn,children:on}):jsx$1(Button,{...Mn,children:on})]})}function RedirectUrlInfoMessage({redirectUrl:on}){if(!on||IS_RUNNING_IN_ELECTRON)return null;const In=tryParseUrl(on);return In&&isSigninRedirect(In)?jsx$1(Alert,{severity:"error",children:jsxs("p",{children:["The provided URL ",jsx$1("code",{children:on})," cannot be used as it is internally utilized by Nitro for authentication. Please ensure you select a different URL to avoid conflicts with the internal authentication mechanism."]})}):on.startsWith(window.location.href)?null:jsx$1(Alert,{severity:"warning",children:jsxs("p",{children:["The current redirect URL is set to ",jsx$1("code",{children:on}),". Once the authentication process is complete, your browser will be directed to this URL. However, please note that Nitro cannot access this domain, as it is hosted on ",jsx$1("code",{children:window.location.href}),". If you face any problems while fetching the token, make sure to use a redirect URL that begins with ",jsx$1("code",{children:window.location.href}),"."]})})}const AuthFlow=({authentication:on,onChange:In})=>{switch(on.activeAuthenticationKind){case BASIC_AUTHENTICATION_FLOW:return jsx$1(BasicAuthForm,{options:on.basicOptions,onChange:In});case BEARER_TOKEN_AUTHENTICATION_FLOW:return jsx$1(BearerAuthForm,{options:on.bearerOptions,onChange:In});case OAUTH_2_AUTHENTICATION_FLOW:return jsx$1(OAuth2AuthForm,{options:on.oAuth2Options,onChange:In});default:return null}},defaultAuthenticationFlow={activeAuthenticationKind:NO_AUTH_AUTHENTICATION_FLOW},AuthSettings=reactExports.memo(function on({authentication:In=defaultAuthenticationFlow,onChange:Rn}){const[Mn,Ln]=reactExports.useState(In),Hn=Wn=>{let Yn={...Mn,...Wn};const hi=createAuthHeaderValue(Yn);Yn={...Yn,headerValue:hi},Ln(Yn),Rn(Yn)},jn=Wn=>{Hn({activeAuthenticationKind:Wn.target.value})};return reactExports.useEffect(()=>{Ln(In)},[In]),jsxs(Fragment,{children:[jsxs(Group,{children:[jsx$1(Label,{htmlFor:"auth-flow",children:"Type"}),jsx$1(Select,{id:"auth-flow",value:Mn.activeAuthenticationKind,onChange:jn,children:ALL_AUTH_FLOWS.map(({kind:Wn,text:Yn})=>jsx$1("option",{value:Wn,children:Yn},Wn))})]}),jsx$1(AuthFlow,{authentication:Mn,onChange:Hn})]})});function tryParseJsonString(on){if(on===void 0)return on;try{return JSON.parse(on)}catch{return on}}function getSubscriptionTransport(on){switch(on){case AUTO_SUBSCRIPTION_PROTOCOL:return"AUTO";case GRAPHQL_SSE_SUBSCRIPTION_PROTOCOL:return"SSE";case APOLLO_SUBSCRIPTION_PROTOCOL:case GRAPHQL_WS_SUBSCRIPTION_PROTOCOL:return"WS";default:throw new Error("Unknown subscription protocol")}}const DEFAULT_SETTINGS={id:"-",apiUrl:"-",sub:"-",featureFlags:[],preferences:{},theme:DEFAULT_THEME_SETTINGS};function SettingsProvider({children:on}){const In=useInitialize$2();return In?jsx$1(AddFeatureFlagProvider,{settings$:In,children:jsx$1(RemoveFeatureFlagProvider,{settings$:In,children:jsx$1(SetPreferenceProvider,{settings$:In,children:jsx$1(UpdateThemeSettingsProvider,{settings$:In,children:jsx$1(SettingsContext.Provider,{value:In,children:on})})})})}):null}function useInitialize$2(){const on=useActiveSessionObservable(),In=reactExports.useRef(void 0),Rn=useForceUpdate();return reactExports.useEffect(()=>{function Mn(Yn){In.current?(In.current.next(Yn),sendMessage({kind:THEME_SETTINGS_CHANGED_MESSAGE,themeSettings:Yn.theme})):(In.current=createSubject(Yn),sendMessage({kind:THEME_SETTINGS_CHANGED_MESSAGE,themeSettings:Yn.theme}),Rn())}let Ln;async function Hn(Yn){let hi=DEFAULT_SETTINGS;Ln&&(Ln.abort(),Ln=void 0),Yn&&(Ln=new AbortController,hi=await getSettingsBySession(Yn,Ln.signal),Ln=void 0),Mn(hi)}let jn=on.value(),Wn=on.subscribe(Yn=>{jn!==Yn&&(jn=Yn,Hn(Yn))});return Hn(jn),()=>{Wn(),Ln?.abort()}},[on,Rn]),In.current}async function getSettingsBySession(on,In){const{apiUrl:Rn,sub:Mn}=on;let Ln,Hn;try{if(Ln=await getSettings(Mn,Rn),Hn=await fetchSettings(Ln?.id,Mn,Rn,In),Hn)return await upsertSettings(Hn),Hn}catch{}return Hn??Ln??DEFAULT_SETTINGS}async function fetchSettings(on,In,Rn,Mn){const Ln=await sessionSchedulerClient.fetchSettings(Mn);if(Ln.kind==="error")return;let{preferences:Hn,settings:{featureFlags:jn,theme:{usePreferredOsAppearance:Wn,darkThemeName:Yn,lightThemeName:hi,themeName:vi}}}=Ln;return Yn??=DEFAULT_THEME_SETTINGS.darkThemeName,hi??=DEFAULT_THEME_SETTINGS.lightThemeName,vi??=DEFAULT_THEME_SETTINGS.themeName,{id:on??nanoid(),apiUrl:Rn,sub:In,featureFlags:jn,preferences:Hn,theme:{usePreferredOsAppearance:Wn,darkThemeName:Yn,lightThemeName:hi,themeName:vi}}}function useTriggerFeatureFlagsUpdatedFailed(){const on=useActivateLogEntry(),In=useAppendLogEntry();return reactExports.useCallback(async Rn=>{const Mn=await In(null,LogLevel.error,"Feature Flags Not Pushed",Rn.length===1?Rn[0]:Rn);let Ln;function Hn(){on(Mn,void 0,!1),Ln()}const{dismiss:jn}=triggerErrorNotification("Feature Flags Not Pushed",jsxs(Fragment,{children:[jsx$1(ToastContentParagraph,{children:"We were not able to store the latest Feature Flag update on the server. Click on Details to find out more."}),jsx$1(ToastFooter,{children:jsx$1(Button,{color:"primary",onClick:Hn,children:"Details"})})]}));Ln=jn},[on,In])}function useTriggerPreferenceUpdatedFailed(){const on=useActivateLogEntry(),In=useAppendLogEntry();return reactExports.useCallback(async Rn=>{const Mn=await In(null,LogLevel.error,"Preference Not Pushed",Rn.length===1?Rn[0]:Rn);let Ln;function Hn(){on(Mn,void 0,!1),Ln()}const{dismiss:jn}=triggerErrorNotification("Preference Not Pushed",jsxs(Fragment,{children:[jsx$1(ToastContentParagraph,{children:"We were not able to store the latest Preference update on the server. Click on Details to find out more."}),jsx$1(ToastFooter,{children:jsx$1(Button,{color:"primary",onClick:Hn,children:"Details"})})]}));Ln=jn},[on,In])}const SettingsContext=createNamedContext(null,"Settings");function PreferencesSelector(on){return on.preferences??{}}function usePreferences(){return useSelector(SettingsContext,PreferencesSelector)}function usePreferencesObservable(){return useSelectionObservable(reactExports.useContext(SettingsContext),PreferencesSelector,{})}function ThemeSettingsSelector(on){return on.theme}function useThemeSettings(){return useSelector(SettingsContext,ThemeSettingsSelector)}const AddFeatureFlagContext=createNamedContext(noop$2,"AddFeatureFlag");function AddFeatureFlagProvider({children:on,settings$:In}){const Rn=useActiveSession(),Mn=useTriggerFeatureFlagsUpdatedFailed(),Ln=reactExports.useCallback(async Hn=>{if(!Rn)return;const{apiUrl:jn,sub:Wn}=Rn,Yn=await getSettings(Wn,jn);if(Yn?.featureFlags?.includes(Hn))return;const hi=Yn?.featureFlags?[...Yn.featureFlags,Hn]:[Hn],vi=Yn?{...Yn,featureFlags:hi}:{...DEFAULT_SETTINGS,id:nanoid(),featureFlags:hi};In.next(vi);const[gi]=await Promise.all([sessionSchedulerClient.updateFeatureFlags(hi),upsertSettings(vi)]);gi.success||Mn(gi.errorMessages)},[Rn,In,Mn]);return jsx$1(AddFeatureFlagContext.Provider,{value:Ln,children:on})}const RemoveFeatureFlagContext=createNamedContext(noop$2,"RemoveFeatureFlag");function RemoveFeatureFlagProvider({children:on,settings$:In}){const Rn=useActiveSession(),Mn=useTriggerFeatureFlagsUpdatedFailed(),Ln=reactExports.useCallback(async Hn=>{if(!Rn)return;const{apiUrl:jn,sub:Wn}=Rn,Yn=await getSettings(Wn,jn);if(!Yn?.featureFlags?.includes(Hn))return;const hi=Yn.featureFlags.filter(mi=>mi!==Hn),vi={...Yn,featureFlags:hi};In.next(vi);const[gi]=await Promise.all([sessionSchedulerClient.updateFeatureFlags(hi),upsertSettings(vi)]);gi.success||Mn(gi.errorMessages)},[Rn,In,Mn]);return jsx$1(RemoveFeatureFlagContext.Provider,{value:Ln,children:on})}const SetPreferenceContext=createNamedContext(noop$2,"SetPreference");function SetPreferenceProvider({children:on,settings$:In}){const Rn=useActiveSession(),Mn=useTriggerPreferenceUpdatedFailed(),Ln=reactExports.useCallback(async(Hn,jn)=>{if(!Rn)return;const{apiUrl:Wn,sub:Yn}=Rn,hi=await getSettings(Yn,Wn);if(hi?.preferences?.[Hn]===jn)return;const vi=hi?.preferences?{...hi.preferences,[Hn]:jn}:{[Hn]:jn},gi=hi?{...hi,preferences:vi}:{...DEFAULT_SETTINGS,id:nanoid(),preferences:vi};In.next(gi);const[mi]=await Promise.all([sessionSchedulerClient.updatePreferences(vi),upsertSettings(gi)]);mi.success||Mn(mi.errorMessages)},[Rn,In,Mn]);return jsx$1(SetPreferenceContext.Provider,{value:Ln,children:on})}function useSetPreference(){return reactExports.useContext(SetPreferenceContext)}const UpdateThemeSettingsContext=createNamedContext(noop$2,"UpdateThemeSettings");function UpdateThemeSettingsProvider({children:on,settings$:In}){const Rn=useActiveSession(),Mn=reactExports.useCallback(async Ln=>{if(!Rn)return;const{apiUrl:Hn,sub:jn}=Rn,Wn=await getSettings(jn,Hn),Yn=Wn?{...Wn,theme:Ln}:{...DEFAULT_SETTINGS,id:nanoid(),theme:Ln};In.next(Yn),sessionSchedulerClient.persistThemeSettings(Ln),sendMessage({kind:THEME_SETTINGS_CHANGED_MESSAGE,themeSettings:Yn.theme}),await upsertSettings(Yn)},[Rn,In]);return jsx$1(UpdateThemeSettingsContext.Provider,{value:Mn,children:on})}function useUpdateThemeSettings(){return reactExports.useContext(UpdateThemeSettingsContext)}const FiraCodeMedium=""+new URL("FiraCode-Medium.3bb3e100.-YTCSZkP.woff2",import.meta.url).href,BREAD_CRUMB_SIZE=20,HEADER_AND_CONTROL_SIZE=36;function Section({$sectionName:on,...In}){return jsx$1(SectionElement,{...In,role:"section","data-section-name":on})}const SectionElement=styled("div")(({theme:on,$fixedSize:In,$flex:Rn="auto",$flexDirection:Mn,$separator:Ln,$spacing:Hn})=>css`
|
|
4966
|
+
`,StyledSwitch=styled(Switch)(({theme:on})=>({width:30,height:18,padding:0,display:"flex","&:active":{"& .MuiSwitch-thumb":{width:15},"& .MuiSwitch-switchBase.Mui-checked":{transform:"translateX(9px)"}},"& .Mui-disabled":{opacity:"0.5 !important","& + .MuiSwitch-track":{opacity:"0.5 !important"}},"& .MuiSwitch-switchBase":{padding:2,color:THEME_COLORS.components.toggleThumb,transition:"color 0.2s ease","& + .MuiSwitch-track":{borderColor:THEME_COLORS.components.toggleTrackBorder,backgroundColor:THEME_COLORS.components.toggleTrack,transition:"background-color 0.2s ease, border-color 0.2s ease"},"&.Mui-checked":{transform:"translateX(12px)",color:THEME_COLORS.components.toggleThumbActive,"& + .MuiSwitch-track":{opacity:1,borderColor:THEME_COLORS.components.toggleTrackActiveBorder,backgroundColor:THEME_COLORS.components.toggleTrackActive}}},"& .MuiSwitch-switchBase:hover":{color:THEME_COLORS.components.toggleThumbHover,"& + .MuiSwitch-track":{borderColor:THEME_COLORS.components.toggleTrackHoverBorder,backgroundColor:THEME_COLORS.components.toggleTrackHover},"&.Mui-checked":{color:THEME_COLORS.components.toggleThumbActiveHover,"& + .MuiSwitch-track":{borderColor:THEME_COLORS.components.toggleTrackActiveHoverBorder,backgroundColor:THEME_COLORS.components.toggleTrackActiveHover}}},"& .MuiSwitch-thumb":{boxShadow:"0 2px 4px 0 rgb(0 35 11 / 20%)",margin:1,width:12,height:12,borderRadius:6,transition:on.transitions.create(["width"],{duration:200})},"& .MuiSwitch-track":{borderRadius:18/2,opacity:1,boxSizing:"border-box",borderStyle:"solid",borderWidth:1}})),defaultOptions={grantType:GRANT_TYPE_AUTHORIZATION_CODE,activeFlowKind:GRANT_TYPE_AUTHORIZATION_CODE,authorizationUrl:"",accessTokenUrl:"",credentialsInBody:!1,clientId:"",clientSecret:"",redirectUrl:"",scope:"",state:"",audience:"",resource:"",responseType:RESPONSE_TYPE_TOKEN,usePkce:!0,pkceMethod:PKCE_CHALLENGE_S256,origin:"",username:"",password:"",prefix:""},OAuth2AuthForm=reactExports.memo(function on({options:In=defaultOptions,onChange:Rn}){const{error:Mn,cancel:Ln,fetchToken:Hn,loading:jn}=useFetchToken();return jsxs(Fragment,{children:[jsx$1(GrantTypeInput,{options:In,onChange:Rn}),jsx$1(GroupInput,{flows:[GRANT_TYPE_AUTHORIZATION_CODE,GRANT_TYPE_IMPLICIT],id:"authorizationUrl",type:"text",placeholder:"https://authorization-server.com/oauth2/authorize",options:In,onChange:Rn,label:"Authorization URL"}),jsx$1(GroupInput,{flows:[GRANT_TYPE_PASSWORD],id:"username",type:"text",placeholder:"",options:In,onChange:Rn,label:"Username"}),jsx$1(GroupInput,{flows:[GRANT_TYPE_PASSWORD],id:"password",type:"password",placeholder:"",options:In,onChange:Rn,label:"Password"}),jsx$1(GroupInput,{flows:[GRANT_TYPE_AUTHORIZATION_CODE,GRANT_TYPE_CLIENT_CREDENTIALS,GRANT_TYPE_PASSWORD],id:"accessTokenUrl",type:"text",placeholder:"https://authorization-server.com/oauth2/token",options:In,onChange:Rn,label:"Access Token URL"}),jsx$1(GroupInput,{flows:[GRANT_TYPE_AUTHORIZATION_CODE,GRANT_TYPE_CLIENT_CREDENTIALS,GRANT_TYPE_IMPLICIT,GRANT_TYPE_PASSWORD],id:"clientId",type:"text",options:In,onChange:Rn,label:"Client ID"}),jsx$1(GroupInput,{flows:[GRANT_TYPE_AUTHORIZATION_CODE,GRANT_TYPE_CLIENT_CREDENTIALS,GRANT_TYPE_PASSWORD],id:"clientSecret",type:"password",options:In,onChange:Rn,label:"Client Secret"}),jsx$1(UsePkceInput,{flows:[GRANT_TYPE_AUTHORIZATION_CODE],options:In,onChange:Rn}),jsx$1(CodeChallengeMethodInput,{flows:[GRANT_TYPE_AUTHORIZATION_CODE],options:In,onChange:Rn}),jsx$1(GroupInput,{flows:[GRANT_TYPE_AUTHORIZATION_CODE,GRANT_TYPE_IMPLICIT],id:"redirectUrl",type:"text",options:In,onChange:Rn,label:"Redirect URL"}),jsx$1(RedirectUrlInfoMessage,{redirectUrl:In.redirectUrl}),jsx$1(ResponseTypeInput,{flows:[GRANT_TYPE_IMPLICIT],options:In,onChange:Rn}),jsx$1(GroupInput,{flows:[GRANT_TYPE_AUTHORIZATION_CODE,GRANT_TYPE_IMPLICIT,GRANT_TYPE_CLIENT_CREDENTIALS,GRANT_TYPE_PASSWORD],id:"scope",type:"text",options:In,onChange:Rn,label:"Scope"}),jsx$1(GroupInput,{flows:[GRANT_TYPE_AUTHORIZATION_CODE,GRANT_TYPE_IMPLICIT],id:"state",type:"text",options:In,onChange:Rn,label:"State"}),jsx$1(CredentialsInBodyInput,{flows:[GRANT_TYPE_AUTHORIZATION_CODE,GRANT_TYPE_CLIENT_CREDENTIALS,GRANT_TYPE_PASSWORD],options:In,onChange:Rn}),jsx$1(GroupInput,{flows:[GRANT_TYPE_AUTHORIZATION_CODE,GRANT_TYPE_IMPLICIT,GRANT_TYPE_CLIENT_CREDENTIALS,GRANT_TYPE_PASSWORD],id:"prefix",type:"text",options:In,onChange:Rn,label:"Header Prefix"}),jsx$1(GroupInput,{flows:[GRANT_TYPE_AUTHORIZATION_CODE,GRANT_TYPE_IMPLICIT,GRANT_TYPE_CLIENT_CREDENTIALS,GRANT_TYPE_PASSWORD],id:"audience",type:"text",options:In,onChange:Rn,label:"Audience"}),jsx$1(GroupInput,{flows:[GRANT_TYPE_AUTHORIZATION_CODE,GRANT_TYPE_CLIENT_CREDENTIALS],id:"resource",type:"text",options:In,onChange:Rn,label:"Resource"}),jsx$1(GroupInput,{flows:[GRANT_TYPE_AUTHORIZATION_CODE],id:"origin",type:"text",options:In,onChange:Rn,label:"Origin"}),jsx$1(TokenDetails,{options:In,onChange:Rn}),jsxs(Group,{children:[jsx$1(ClearTokenButton,{options:In,onChange:Rn}),jsx$1(RefreshTokenButton,{options:In,onChange:Rn,cancel:Ln,fetchToken:Hn,loading:jn}),jsx$1(FetchTokenButton,{options:In,onChange:Rn,cancel:Ln,fetchToken:Hn,loading:jn}),jsx$1(ChangeSessionButton,{options:In,onChange:Rn})]}),Mn&&jsx$1(Alert,{severity:"warning",title:"Error",children:Mn.message??"Ops, something went wrong!"})]})}),FetchTokenButton=({cancel:on,fetchToken:In,loading:Rn,options:Mn,onChange:Ln})=>jsx$1(ButtonWithDescription,{description:"Fetch token",onClick:Rn?hi=>{hi.preventDefault(),hi.stopPropagation(),on()}:async hi=>{hi.preventDefault(),hi.stopPropagation();const vi=await In(Mn);vi&&Ln({oAuth2Options:{...Mn,token:vi}})},children:Rn?jsxs(Fragment,{children:[jsx$1(Spinner$1,{colorSelector:hi=>hi.components.buttonText}),"Cancel"]}):jsx$1(Fragment,{children:"Fetch"})}),GrantTypeInput=({onChange:on,options:In})=>jsxs(Group,{children:[jsx$1(Label,{htmlFor:"grant-type",children:"Grant Type"}),jsxs(Select,{id:"grant-type",onChange:Mn=>{let Ln=GRANT_TYPE_AUTHORIZATION_CODE,Hn=GRANT_TYPE_AUTHORIZATION_CODE;switch(Mn.target.value??""){case GRANT_TYPE_IMPLICIT:Ln=GRANT_TYPE_IMPLICIT,Hn=GRANT_TYPE_IMPLICIT;break;case GRANT_TYPE_CLIENT_CREDENTIALS:Ln=GRANT_TYPE_CLIENT_CREDENTIALS,Hn=GRANT_TYPE_CLIENT_CREDENTIALS;break;case GRANT_TYPE_PASSWORD:Ln=GRANT_TYPE_PASSWORD,Hn=GRANT_TYPE_PASSWORD;break}on({oAuth2Options:{...In,grantType:Hn,activeFlowKind:Ln}})},value:In.activeFlowKind,children:[jsx$1("option",{value:GRANT_TYPE_AUTHORIZATION_CODE,children:"Authorization Code"}),jsx$1("option",{value:GRANT_TYPE_IMPLICIT,children:"Implicit"}),jsx$1("option",{value:GRANT_TYPE_CLIENT_CREDENTIALS,children:"Client Credentials"}),jsx$1("option",{value:GRANT_TYPE_PASSWORD,children:"Resource Owner Password Credentials"})]})]}),GroupInput=({flows:on,label:In,id:Rn,onChange:Mn,options:Ln,...Hn})=>{const jn=useIsFlowActive(Ln.activeFlowKind,on),Wn=Yn=>{Mn({oAuth2Options:{...Ln,[Rn]:Yn.target.value??""}})};return jn?jsxs(Group,{children:[jsx$1(Label,{htmlFor:String(Rn),children:In}),jsx$1(InterpolationInput,{id:String(Rn),value:Ln[Rn],onChange:Wn,...Hn})]}):null},UsePkceInput=({onChange:on,options:In,flows:Rn})=>{const Mn=useIsFlowActive(In.activeFlowKind,Rn),Ln=Hn=>{on({oAuth2Options:{...In,usePkce:Hn}})};return Mn?jsx$1(Group,{children:jsxs(Label,{children:[jsx$1(LabelDescription,{children:"Use PKCE"}),jsx$1(Toggle,{checked:In.usePkce,offText:"No",onText:"Yes",onChange:Ln})]})}):null},CodeChallengeMethodInput=({onChange:on,options:In,flows:Rn})=>{const Mn=useIsFlowActive(In.activeFlowKind,Rn),Ln=Hn=>{const jn=Hn.target.value===PKCE_CHALLENGE_PLAIN?PKCE_CHALLENGE_PLAIN:PKCE_CHALLENGE_S256;on({oAuth2Options:{...In,pkceMethod:jn}})};return Mn&&In.usePkce?jsxs(Group,{children:[jsx$1(Label,{htmlFor:"pkce-method-code-challenge",children:"Code Challenge Method"}),jsxs(Select,{id:"pkce-method-code-challenge",value:In.pkceMethod,onChange:Ln,children:[jsx$1("option",{value:PKCE_CHALLENGE_S256,children:"SHA-256"}),jsx$1("option",{value:PKCE_CHALLENGE_PLAIN,children:"Plain"})]})]}):null},CredentialsInBodyInput=({onChange:on,options:In,flows:Rn})=>useIsFlowActive(In.activeFlowKind,Rn)?jsxs(Group,{children:[jsx$1(Label,{htmlFor:"pkce-method-credentials",children:"Credentials"}),jsxs(Select,{id:"pkce-method-credentials",onChange:Hn=>{const jn=Hn.target.value==="body";on({oAuth2Options:{...In,credentialsInBody:jn}})},value:In.credentialsInBody?"body":"header",children:[jsx$1("option",{value:"header",children:"As Basic Auth Header (default)"}),jsx$1("option",{value:"body",children:"In Request Body"})]})]}):null,TokenDetails=({options:on})=>on.token?jsxs(Fragment,{children:[jsxs(Group,{children:[jsx$1(Label,{htmlFor:"id_token",children:"Id Token"}),jsx$1(Input,{id:"id_token",disabled:!0,value:on.token.identityToken??""})]}),jsxs(Group,{children:[jsx$1(Label,{htmlFor:"access_token",children:"Access Token"}),jsx$1(Input,{id:"access_token",disabled:!0,value:on.token.accessToken??""})]}),jsxs(Group,{children:[jsx$1(Label,{htmlFor:"refresh_token",children:"Refresh Token"}),jsx$1(Input,{id:"refresh_token",disabled:!0,value:on.token.refreshToken??""})]})]}):null;function ClearTokenButton({options:on,onChange:In}){return on.token?jsx$1(ButtonWithDescription,{description:"Clear tokens",onClick:()=>{In({oAuth2Options:{...on,token:void 0}})},children:"Clear"}):null}function ChangeSessionButton({options:on,onChange:In}){if(!IS_RUNNING_IN_ELECTRON||on.activeFlowKind!==GRANT_TYPE_AUTHORIZATION_CODE&&on.activeFlowKind!==GRANT_TYPE_IMPLICIT)return null;const Rn=Mn=>{Mn.preventDefault(),Mn.stopPropagation(),In({oAuth2Options:{...on,sessionId:nanoid()}})};return jsx$1(ButtonWithDescription,{description:"Reset session on identity server",tooltip:`The browser persist your authentication session on ${on.authorizationUrl??"your identity server."}, so that you do not have to sign in every time. If you want to log in with a different user, you should reset your session by pressing the button on the right.`,onClick:Rn,children:"Reset"})}const RefreshTokenButton=({cancel:on,fetchToken:In,loading:Rn,options:Mn,onChange:Ln})=>{const Hn=hi=>{hi.preventDefault(),hi.stopPropagation(),on()},jn=async hi=>{hi.preventDefault(),hi.stopPropagation();const vi=await In({...Mn,grantType:GRANT_TYPE_REFRESH});vi&&Ln({oAuth2Options:{...Mn,token:vi}})};return Mn?.token?.refreshToken?jsx$1(ButtonWithDescription,{description:"Refresh token",onClick:Rn?Hn:jn,children:Rn?jsxs(Fragment,{children:[jsx$1(Spinner$1,{colorSelector:hi=>hi.components.buttonText}),"Cancel"]}):jsx$1(Fragment,{children:"Refresh"})}):null},ResponseTypeInput=({flows:on,onChange:In,options:Rn})=>useIsFlowActive(Rn.activeFlowKind,on)?jsxs(Group,{children:[jsx$1(Label,{htmlFor:"response-type",children:"Response Type"}),jsxs(Select,{id:"response-type",onChange:Hn=>{let jn=RESPONSE_TYPE_TOKEN;switch(Hn.target.value??""){case RESPONSE_TYPE_ID_TOKEN:jn=RESPONSE_TYPE_ID_TOKEN;break;case RESPONSE_TYPE_ID_TOKEN_TOKEN:jn=RESPONSE_TYPE_ID_TOKEN_TOKEN;break}In({oAuth2Options:{...Rn,responseType:jn}})},value:Rn.responseType,children:[jsx$1("option",{value:RESPONSE_TYPE_TOKEN,children:"Access Token"}),jsx$1("option",{value:RESPONSE_TYPE_ID_TOKEN,children:"ID Token"}),jsx$1("option",{value:RESPONSE_TYPE_ID_TOKEN_TOKEN,children:"ID and Access Token"})]})]}):null;function useIsFlowActive(on,In){return reactExports.useMemo(()=>!!In.find(Rn=>Rn===on),[In,on])}function ButtonWithDescription({children:on,description:In,tooltip:Rn,...Mn}){return jsxs(Label,{children:[jsxs(LabelDescription,{children:[In,Rn&&jsx$1(Tooltip,{title:Rn,placement:"top-start",children:jsx$1("span",{children:jsx$1(InfoIcon,{})})})]}),Rn?jsx$1(TooltipButton,{tooltip:Rn,...Mn,children:on}):jsx$1(Button,{...Mn,children:on})]})}function RedirectUrlInfoMessage({redirectUrl:on}){if(!on||IS_RUNNING_IN_ELECTRON)return null;const In=tryParseUrl(on);return In&&isSigninRedirect(In)?jsx$1(Alert,{severity:"error",children:jsxs("p",{children:["The provided URL ",jsx$1("code",{children:on})," cannot be used as it is internally utilized by Nitro for authentication. Please ensure you select a different URL to avoid conflicts with the internal authentication mechanism."]})}):on.startsWith(window.location.href)?null:jsx$1(Alert,{severity:"warning",children:jsxs("p",{children:["The current redirect URL is set to ",jsx$1("code",{children:on}),". Once the authentication process is complete, your browser will be directed to this URL. However, please note that Nitro cannot access this domain, as it is hosted on ",jsx$1("code",{children:window.location.href}),". If you face any problems while fetching the token, make sure to use a redirect URL that begins with ",jsx$1("code",{children:window.location.href}),"."]})})}const AuthFlow=({authentication:on,onChange:In})=>{switch(on.activeAuthenticationKind){case BASIC_AUTHENTICATION_FLOW:return jsx$1(BasicAuthForm,{options:on.basicOptions,onChange:In});case BEARER_TOKEN_AUTHENTICATION_FLOW:return jsx$1(BearerAuthForm,{options:on.bearerOptions,onChange:In});case OAUTH_2_AUTHENTICATION_FLOW:return jsx$1(OAuth2AuthForm,{options:on.oAuth2Options,onChange:In});default:return null}},defaultAuthenticationFlow={activeAuthenticationKind:NO_AUTH_AUTHENTICATION_FLOW},AuthSettings=reactExports.memo(function on({authentication:In=defaultAuthenticationFlow,onChange:Rn}){const[Mn,Ln]=reactExports.useState(In),Hn=Wn=>{let Yn={...Mn,...Wn};const hi=createAuthHeaderValue(Yn);Yn={...Yn,headerValue:hi},Ln(Yn),Rn(Yn)},jn=Wn=>{Hn({activeAuthenticationKind:Wn.target.value})};return reactExports.useEffect(()=>{Ln(In)},[In]),jsxs(Fragment,{children:[jsxs(Group,{children:[jsx$1(Label,{htmlFor:"auth-flow",children:"Type"}),jsx$1(Select,{id:"auth-flow",value:Mn.activeAuthenticationKind,onChange:jn,children:ALL_AUTH_FLOWS.map(({kind:Wn,text:Yn})=>jsx$1("option",{value:Wn,children:Yn},Wn))})]}),jsx$1(AuthFlow,{authentication:Mn,onChange:Hn})]})});function tryParseJsonString(on){if(on===void 0)return on;try{return JSON.parse(on)}catch{return on}}function getSubscriptionTransport(on){switch(on){case AUTO_SUBSCRIPTION_PROTOCOL:return"AUTO";case GRAPHQL_SSE_SUBSCRIPTION_PROTOCOL:return"SSE";case APOLLO_SUBSCRIPTION_PROTOCOL:case GRAPHQL_WS_SUBSCRIPTION_PROTOCOL:return"WS";default:throw new Error("Unknown subscription protocol")}}const DEFAULT_SETTINGS={id:"-",apiUrl:"-",sub:"-",featureFlags:[],preferences:{},theme:DEFAULT_THEME_SETTINGS};function SettingsProvider({children:on}){const In=useInitialize$2();return In?jsx$1(AddFeatureFlagProvider,{settings$:In,children:jsx$1(RemoveFeatureFlagProvider,{settings$:In,children:jsx$1(SetPreferenceProvider,{settings$:In,children:jsx$1(UpdateThemeSettingsProvider,{settings$:In,children:jsx$1(SettingsContext.Provider,{value:In,children:on})})})})}):null}function useInitialize$2(){const on=useActiveSessionObservable(),In=reactExports.useRef(void 0),Rn=useForceUpdate();return reactExports.useEffect(()=>{function Mn(Yn){In.current?(In.current.next(Yn),sendMessage({kind:THEME_SETTINGS_CHANGED_MESSAGE,themeSettings:Yn.theme})):(In.current=createSubject(Yn),sendMessage({kind:THEME_SETTINGS_CHANGED_MESSAGE,themeSettings:Yn.theme}),Rn())}let Ln;async function Hn(Yn){let hi=DEFAULT_SETTINGS;Ln&&(Ln.abort(),Ln=void 0),Yn&&(Ln=new AbortController,hi=await getSettingsBySession(Yn,Ln.signal),Ln=void 0),Mn(hi)}let jn=on.value(),Wn=on.subscribe(Yn=>{jn!==Yn&&(jn=Yn,Hn(Yn))});return Hn(jn),()=>{Wn(),Ln?.abort()}},[on,Rn]),In.current}async function getSettingsBySession(on,In){const{apiUrl:Rn,sub:Mn}=on;let Ln,Hn;try{if(Ln=await getSettings(Mn,Rn),Hn=await fetchSettings(Ln?.id,Mn,Rn,In),Hn)return await upsertSettings(Hn),Hn}catch{}return Hn??Ln??DEFAULT_SETTINGS}async function fetchSettings(on,In,Rn,Mn){const Ln=await sessionSchedulerClient.fetchSettings(Mn);if(Ln.kind==="error")return;let{preferences:Hn,settings:{featureFlags:jn,theme:{usePreferredOsAppearance:Wn,darkThemeName:Yn,lightThemeName:hi,themeName:vi}}}=Ln;return Yn??=DEFAULT_THEME_SETTINGS.darkThemeName,hi??=DEFAULT_THEME_SETTINGS.lightThemeName,vi??=DEFAULT_THEME_SETTINGS.themeName,{id:on??nanoid(),apiUrl:Rn,sub:In,featureFlags:jn,preferences:Hn,theme:{usePreferredOsAppearance:Wn,darkThemeName:Yn,lightThemeName:hi,themeName:vi}}}function useTriggerFeatureFlagsUpdatedFailed(){const on=useActivateLogEntry(),In=useAppendLogEntry();return reactExports.useCallback(async Rn=>{const Mn=await In(null,LogLevel.error,"Feature Flags Not Pushed",Rn.length===1?Rn[0]:Rn);let Ln;function Hn(){on(Mn,void 0,!1),Ln()}const{dismiss:jn}=triggerErrorNotification("Feature Flags Not Pushed",jsxs(Fragment,{children:[jsx$1(ToastContentParagraph,{children:"We were not able to store the latest Feature Flag update on the server. Click on Details to find out more."}),jsx$1(ToastFooter,{children:jsx$1(Button,{color:"primary",onClick:Hn,children:"Details"})})]}));Ln=jn},[on,In])}function useTriggerPreferenceUpdatedFailed(){const on=useActivateLogEntry(),In=useAppendLogEntry();return reactExports.useCallback(async Rn=>{const Mn=await In(null,LogLevel.error,"Preference Not Pushed",Rn.length===1?Rn[0]:Rn);let Ln;function Hn(){on(Mn,void 0,!1),Ln()}const{dismiss:jn}=triggerErrorNotification("Preference Not Pushed",jsxs(Fragment,{children:[jsx$1(ToastContentParagraph,{children:"We were not able to store the latest Preference update on the server. Click on Details to find out more."}),jsx$1(ToastFooter,{children:jsx$1(Button,{color:"primary",onClick:Hn,children:"Details"})})]}));Ln=jn},[on,In])}const SettingsContext=createNamedContext(null,"Settings");function PreferencesSelector(on){return on.preferences??{}}function usePreferences(){return useSelector(SettingsContext,PreferencesSelector)}function usePreferencesObservable(){return useSelectionObservable(reactExports.useContext(SettingsContext),PreferencesSelector,{})}function ThemeSettingsSelector(on){return on.theme}function useThemeSettings(){return useSelector(SettingsContext,ThemeSettingsSelector)}const AddFeatureFlagContext=createNamedContext(noop$2,"AddFeatureFlag");function AddFeatureFlagProvider({children:on,settings$:In}){const Rn=useActiveSession(),Mn=useTriggerFeatureFlagsUpdatedFailed(),Ln=reactExports.useCallback(async Hn=>{if(!Rn)return;const{apiUrl:jn,sub:Wn}=Rn,Yn=await getSettings(Wn,jn);if(Yn?.featureFlags?.includes(Hn))return;const hi=Yn?.featureFlags?[...Yn.featureFlags,Hn]:[Hn],vi=Yn?{...Yn,featureFlags:hi}:{...DEFAULT_SETTINGS,id:nanoid(),featureFlags:hi};In.next(vi);const[gi]=await Promise.all([sessionSchedulerClient.updateFeatureFlags(hi),upsertSettings(vi)]);gi.success||Mn(gi.errorMessages)},[Rn,In,Mn]);return jsx$1(AddFeatureFlagContext.Provider,{value:Ln,children:on})}const RemoveFeatureFlagContext=createNamedContext(noop$2,"RemoveFeatureFlag");function RemoveFeatureFlagProvider({children:on,settings$:In}){const Rn=useActiveSession(),Mn=useTriggerFeatureFlagsUpdatedFailed(),Ln=reactExports.useCallback(async Hn=>{if(!Rn)return;const{apiUrl:jn,sub:Wn}=Rn,Yn=await getSettings(Wn,jn);if(!Yn?.featureFlags?.includes(Hn))return;const hi=Yn.featureFlags.filter(mi=>mi!==Hn),vi={...Yn,featureFlags:hi};In.next(vi);const[gi]=await Promise.all([sessionSchedulerClient.updateFeatureFlags(hi),upsertSettings(vi)]);gi.success||Mn(gi.errorMessages)},[Rn,In,Mn]);return jsx$1(RemoveFeatureFlagContext.Provider,{value:Ln,children:on})}const SetPreferenceContext=createNamedContext(noop$2,"SetPreference");function SetPreferenceProvider({children:on,settings$:In}){const Rn=useActiveSession(),Mn=useTriggerPreferenceUpdatedFailed(),Ln=reactExports.useCallback(async(Hn,jn)=>{if(!Rn)return;const{apiUrl:Wn,sub:Yn}=Rn,hi=await getSettings(Yn,Wn);if(hi?.preferences?.[Hn]===jn)return;const vi=hi?.preferences?{...hi.preferences,[Hn]:jn}:{[Hn]:jn},gi=hi?{...hi,preferences:vi}:{...DEFAULT_SETTINGS,id:nanoid(),preferences:vi};In.next(gi);const[mi]=await Promise.all([sessionSchedulerClient.updatePreferences(vi),upsertSettings(gi)]);mi.success||Mn(mi.errorMessages)},[Rn,In,Mn]);return jsx$1(SetPreferenceContext.Provider,{value:Ln,children:on})}function useSetPreference(){return reactExports.useContext(SetPreferenceContext)}const UpdateThemeSettingsContext=createNamedContext(noop$2,"UpdateThemeSettings");function UpdateThemeSettingsProvider({children:on,settings$:In}){const Rn=useActiveSession(),Mn=reactExports.useCallback(async Ln=>{if(!Rn)return;const{apiUrl:Hn,sub:jn}=Rn,Wn=await getSettings(jn,Hn),Yn=Wn?{...Wn,theme:Ln}:{...DEFAULT_SETTINGS,id:nanoid(),theme:Ln};In.next(Yn),sessionSchedulerClient.persistThemeSettings(Ln),sendMessage({kind:THEME_SETTINGS_CHANGED_MESSAGE,themeSettings:Yn.theme}),await upsertSettings(Yn)},[Rn,In]);return jsx$1(UpdateThemeSettingsContext.Provider,{value:Mn,children:on})}function useUpdateThemeSettings(){return reactExports.useContext(UpdateThemeSettingsContext)}const FiraCodeMedium=""+new URL("FiraCode-Medium.3d52dae0.-YTCSZkP.woff2",import.meta.url).href,BREAD_CRUMB_SIZE=20,HEADER_AND_CONTROL_SIZE=36;function Section({$sectionName:on,...In}){return jsx$1(SectionElement,{...In,role:"section","data-section-name":on})}const SectionElement=styled("div")(({theme:on,$fixedSize:In,$flex:Rn="auto",$flexDirection:Mn,$separator:Ln,$spacing:Hn})=>css`
|
|
4967
4967
|
display: flex;
|
|
4968
4968
|
flex: ${In?`0 0 ${on.spacing(In)}`:Rn};
|
|
4969
4969
|
overflow: hidden;
|
|
@@ -5137,7 +5137,7 @@ ${In.join(`
|
|
|
5137
5137
|
color: ${THEME_COLORS.states.success};
|
|
5138
5138
|
`;default:return css`
|
|
5139
5139
|
color: ${THEME_COLORS.base.heading};
|
|
5140
|
-
`}}function WorkerWrapper$3(on){return new Worker(""+new URL("graphql.worker.
|
|
5140
|
+
`}}function WorkerWrapper$3(on){return new Worker(""+new URL("graphql.worker.3d52dae0.CdlCLxPV.js",import.meta.url).href,{type:"module",name:on?.name})}function WorkerWrapper$2(on){return new Worker(""+new URL("editor.worker.3d52dae0.BRRUfNgJ.js",import.meta.url).href,{type:"module",name:on?.name})}function WorkerWrapper$1(on){return new Worker(""+new URL("json.worker.3d52dae0.DKYOvew3.js",import.meta.url).href,{type:"module",name:on?.name})}function WorkerWrapper(on){return new Worker(""+new URL("yaml.worker.3d52dae0.o-AnIqAF.js",import.meta.url).href,{type:"module",name:on?.name})}let initialized=!1;(function(){initialized||(self.MonacoEnvironment={getWorker:function(on,In){switch(In){case"json":return new WorkerWrapper$1({name:"json-worker"});case"yaml":return new WorkerWrapper({name:"yaml-worker"});case"graphql":return new WorkerWrapper$3({name:"graphql-worker"});default:return new WorkerWrapper$2({name:"editor-worker"})}}},initialized=!0)})();const ALIAS=Symbol.for("yaml.alias"),DOC=Symbol.for("yaml.document"),MAP=Symbol.for("yaml.map"),PAIR=Symbol.for("yaml.pair"),SCALAR$1=Symbol.for("yaml.scalar"),SEQ=Symbol.for("yaml.seq"),NODE_TYPE=Symbol.for("yaml.node.type"),isAlias=on=>!!on&&typeof on=="object"&&on[NODE_TYPE]===ALIAS,isDocument=on=>!!on&&typeof on=="object"&&on[NODE_TYPE]===DOC,isMap=on=>!!on&&typeof on=="object"&&on[NODE_TYPE]===MAP,isPair=on=>!!on&&typeof on=="object"&&on[NODE_TYPE]===PAIR,isScalar$1=on=>!!on&&typeof on=="object"&&on[NODE_TYPE]===SCALAR$1,isSeq=on=>!!on&&typeof on=="object"&&on[NODE_TYPE]===SEQ;function isCollection$1(on){if(on&&typeof on=="object")switch(on[NODE_TYPE]){case MAP:case SEQ:return!0}return!1}function isNode(on){if(on&&typeof on=="object")switch(on[NODE_TYPE]){case ALIAS:case MAP:case SCALAR$1:case SEQ:return!0}return!1}const hasAnchor=on=>(isScalar$1(on)||isCollection$1(on))&&!!on.anchor,BREAK$1=Symbol("break visit"),SKIP$1=Symbol("skip children"),REMOVE$1=Symbol("remove node");function visit$1(on,In){const Rn=initVisitor(In);isDocument(on)?visit_(null,on.contents,Rn,Object.freeze([on]))===REMOVE$1&&(on.contents=null):visit_(null,on,Rn,Object.freeze([]))}visit$1.BREAK=BREAK$1;visit$1.SKIP=SKIP$1;visit$1.REMOVE=REMOVE$1;function visit_(on,In,Rn,Mn){const Ln=callVisitor(on,In,Rn,Mn);if(isNode(Ln)||isPair(Ln))return replaceNode(on,Mn,Ln),visit_(on,Ln,Rn,Mn);if(typeof Ln!="symbol"){if(isCollection$1(In)){Mn=Object.freeze(Mn.concat(In));for(let Hn=0;Hn<In.items.length;++Hn){const jn=visit_(Hn,In.items[Hn],Rn,Mn);if(typeof jn=="number")Hn=jn-1;else{if(jn===BREAK$1)return BREAK$1;jn===REMOVE$1&&(In.items.splice(Hn,1),Hn-=1)}}}else if(isPair(In)){Mn=Object.freeze(Mn.concat(In));const Hn=visit_("key",In.key,Rn,Mn);if(Hn===BREAK$1)return BREAK$1;Hn===REMOVE$1&&(In.key=null);const jn=visit_("value",In.value,Rn,Mn);if(jn===BREAK$1)return BREAK$1;jn===REMOVE$1&&(In.value=null)}}return Ln}async function visitAsync(on,In){const Rn=initVisitor(In);isDocument(on)?await visitAsync_(null,on.contents,Rn,Object.freeze([on]))===REMOVE$1&&(on.contents=null):await visitAsync_(null,on,Rn,Object.freeze([]))}visitAsync.BREAK=BREAK$1;visitAsync.SKIP=SKIP$1;visitAsync.REMOVE=REMOVE$1;async function visitAsync_(on,In,Rn,Mn){const Ln=await callVisitor(on,In,Rn,Mn);if(isNode(Ln)||isPair(Ln))return replaceNode(on,Mn,Ln),visitAsync_(on,Ln,Rn,Mn);if(typeof Ln!="symbol"){if(isCollection$1(In)){Mn=Object.freeze(Mn.concat(In));for(let Hn=0;Hn<In.items.length;++Hn){const jn=await visitAsync_(Hn,In.items[Hn],Rn,Mn);if(typeof jn=="number")Hn=jn-1;else{if(jn===BREAK$1)return BREAK$1;jn===REMOVE$1&&(In.items.splice(Hn,1),Hn-=1)}}}else if(isPair(In)){Mn=Object.freeze(Mn.concat(In));const Hn=await visitAsync_("key",In.key,Rn,Mn);if(Hn===BREAK$1)return BREAK$1;Hn===REMOVE$1&&(In.key=null);const jn=await visitAsync_("value",In.value,Rn,Mn);if(jn===BREAK$1)return BREAK$1;jn===REMOVE$1&&(In.value=null)}}return Ln}function initVisitor(on){return typeof on=="object"&&(on.Collection||on.Node||on.Value)?Object.assign({Alias:on.Node,Map:on.Node,Scalar:on.Node,Seq:on.Node},on.Value&&{Map:on.Value,Scalar:on.Value,Seq:on.Value},on.Collection&&{Map:on.Collection,Seq:on.Collection},on):on}function callVisitor(on,In,Rn,Mn){if(typeof Rn=="function")return Rn(on,In,Mn);if(isMap(In))return Rn.Map?.(on,In,Mn);if(isSeq(In))return Rn.Seq?.(on,In,Mn);if(isPair(In))return Rn.Pair?.(on,In,Mn);if(isScalar$1(In))return Rn.Scalar?.(on,In,Mn);if(isAlias(In))return Rn.Alias?.(on,In,Mn)}function replaceNode(on,In,Rn){const Mn=In[In.length-1];if(isCollection$1(Mn))Mn.items[on]=Rn;else if(isPair(Mn))on==="key"?Mn.key=Rn:Mn.value=Rn;else if(isDocument(Mn))Mn.contents=Rn;else{const Ln=isAlias(Mn)?"alias":"scalar";throw new Error(`Cannot replace node with ${Ln} parent`)}}const escapeChars={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},escapeTagName=on=>on.replace(/[!,[\]{}]/g,In=>escapeChars[In]);class Directives{constructor(In,Rn){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Directives.defaultYaml,In),this.tags=Object.assign({},Directives.defaultTags,Rn)}clone(){const In=new Directives(this.yaml,this.tags);return In.docStart=this.docStart,In}atDocument(){const In=new Directives(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Directives.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Directives.defaultTags);break}return In}add(In,Rn){this.atNextDocument&&(this.yaml={explicit:Directives.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Directives.defaultTags),this.atNextDocument=!1);const Mn=In.trim().split(/[ \t]+/),Ln=Mn.shift();switch(Ln){case"%TAG":{if(Mn.length!==2&&(Rn(0,"%TAG directive should contain exactly two parts"),Mn.length<2))return!1;const[Hn,jn]=Mn;return this.tags[Hn]=jn,!0}case"%YAML":{if(this.yaml.explicit=!0,Mn.length!==1)return Rn(0,"%YAML directive should contain exactly one part"),!1;const[Hn]=Mn;if(Hn==="1.1"||Hn==="1.2")return this.yaml.version=Hn,!0;{const jn=/^\d+\.\d+$/.test(Hn);return Rn(6,`Unsupported YAML version ${Hn}`,jn),!1}}default:return Rn(0,`Unknown directive ${Ln}`,!0),!1}}tagName(In,Rn){if(In==="!")return"!";if(In[0]!=="!")return Rn(`Not a valid tag: ${In}`),null;if(In[1]==="<"){const jn=In.slice(2,-1);return jn==="!"||jn==="!!"?(Rn(`Verbatim tags aren't resolved, so ${In} is invalid.`),null):(In[In.length-1]!==">"&&Rn("Verbatim tags must end with a >"),jn)}const[,Mn,Ln]=In.match(/^(.*!)([^!]*)$/s);Ln||Rn(`The ${In} tag has no suffix`);const Hn=this.tags[Mn];if(Hn)try{return Hn+decodeURIComponent(Ln)}catch(jn){return Rn(String(jn)),null}return Mn==="!"?In:(Rn(`Could not resolve tag: ${In}`),null)}tagString(In){for(const[Rn,Mn]of Object.entries(this.tags))if(In.startsWith(Mn))return Rn+escapeTagName(In.substring(Mn.length));return In[0]==="!"?In:`!<${In}>`}toString(In){const Rn=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],Mn=Object.entries(this.tags);let Ln;if(In&&Mn.length>0&&isNode(In.contents)){const Hn={};visit$1(In.contents,(jn,Wn)=>{isNode(Wn)&&Wn.tag&&(Hn[Wn.tag]=!0)}),Ln=Object.keys(Hn)}else Ln=[];for(const[Hn,jn]of Mn)Hn==="!!"&&jn==="tag:yaml.org,2002:"||(!In||Ln.some(Wn=>Wn.startsWith(jn)))&&Rn.push(`%TAG ${Hn} ${jn}`);return Rn.join(`
|
|
5141
5141
|
`)}}Directives.defaultYaml={explicit:!1,version:"1.2"};Directives.defaultTags={"!!":"tag:yaml.org,2002:"};function anchorIsValid(on){if(/[\x00-\x19\s,[\]{}]/.test(on)){const Rn=`Anchor must not contain whitespace or control characters: ${JSON.stringify(on)}`;throw new Error(Rn)}return!0}function anchorNames(on){const In=new Set;return visit$1(on,{Value(Rn,Mn){Mn.anchor&&In.add(Mn.anchor)}}),In}function findNewAnchor(on,In){for(let Rn=1;;++Rn){const Mn=`${on}${Rn}`;if(!In.has(Mn))return Mn}}function createNodeAnchors(on,In){const Rn=[],Mn=new Map;let Ln=null;return{onAnchor:Hn=>{Rn.push(Hn),Ln||(Ln=anchorNames(on));const jn=findNewAnchor(In,Ln);return Ln.add(jn),jn},setAnchors:()=>{for(const Hn of Rn){const jn=Mn.get(Hn);if(typeof jn=="object"&&jn.anchor&&(isScalar$1(jn.node)||isCollection$1(jn.node)))jn.node.anchor=jn.anchor;else{const Wn=new Error("Failed to resolve repeated object (this should not happen)");throw Wn.source=Hn,Wn}}},sourceObjects:Mn}}function applyReviver(on,In,Rn,Mn){if(Mn&&typeof Mn=="object")if(Array.isArray(Mn))for(let Ln=0,Hn=Mn.length;Ln<Hn;++Ln){const jn=Mn[Ln],Wn=applyReviver(on,Mn,String(Ln),jn);Wn===void 0?delete Mn[Ln]:Wn!==jn&&(Mn[Ln]=Wn)}else if(Mn instanceof Map)for(const Ln of Array.from(Mn.keys())){const Hn=Mn.get(Ln),jn=applyReviver(on,Mn,Ln,Hn);jn===void 0?Mn.delete(Ln):jn!==Hn&&Mn.set(Ln,jn)}else if(Mn instanceof Set)for(const Ln of Array.from(Mn)){const Hn=applyReviver(on,Mn,Ln,Ln);Hn===void 0?Mn.delete(Ln):Hn!==Ln&&(Mn.delete(Ln),Mn.add(Hn))}else for(const[Ln,Hn]of Object.entries(Mn)){const jn=applyReviver(on,Mn,Ln,Hn);jn===void 0?delete Mn[Ln]:jn!==Hn&&(Mn[Ln]=jn)}return on.call(In,Rn,Mn)}function toJS(on,In,Rn){if(Array.isArray(on))return on.map((Mn,Ln)=>toJS(Mn,String(Ln),Rn));if(on&&typeof on.toJSON=="function"){if(!Rn||!hasAnchor(on))return on.toJSON(In,Rn);const Mn={aliasCount:0,count:1,res:void 0};Rn.anchors.set(on,Mn),Rn.onCreate=Hn=>{Mn.res=Hn,delete Rn.onCreate};const Ln=on.toJSON(In,Rn);return Rn.onCreate&&Rn.onCreate(Ln),Ln}return typeof on=="bigint"&&!Rn?.keep?Number(on):on}class NodeBase{constructor(In){Object.defineProperty(this,NODE_TYPE,{value:In})}clone(){const In=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(In.range=this.range.slice()),In}toJS(In,{mapAsMap:Rn,maxAliasCount:Mn,onAnchor:Ln,reviver:Hn}={}){if(!isDocument(In))throw new TypeError("A document argument is required");const jn={anchors:new Map,doc:In,keep:!0,mapAsMap:Rn===!0,mapKeyWarned:!1,maxAliasCount:typeof Mn=="number"?Mn:100},Wn=toJS(this,"",jn);if(typeof Ln=="function")for(const{count:Yn,res:hi}of jn.anchors.values())Ln(hi,Yn);return typeof Hn=="function"?applyReviver(Hn,{"":Wn},"",Wn):Wn}}class Alias extends NodeBase{constructor(In){super(ALIAS),this.source=In,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(In){let Rn;return visit$1(In,{Node:(Mn,Ln)=>{if(Ln===this)return visit$1.BREAK;Ln.anchor===this.source&&(Rn=Ln)}}),Rn}toJSON(In,Rn){if(!Rn)return{source:this.source};const{anchors:Mn,doc:Ln,maxAliasCount:Hn}=Rn,jn=this.resolve(Ln);if(!jn){const Yn=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(Yn)}let Wn=Mn.get(jn);if(Wn||(toJS(jn,null,Rn),Wn=Mn.get(jn)),!Wn||Wn.res===void 0){const Yn="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(Yn)}if(Hn>=0&&(Wn.count+=1,Wn.aliasCount===0&&(Wn.aliasCount=getAliasCount(Ln,jn,Mn)),Wn.count*Wn.aliasCount>Hn)){const Yn="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(Yn)}return Wn.res}toString(In,Rn,Mn){const Ln=`*${this.source}`;if(In){if(anchorIsValid(this.source),In.options.verifyAliasOrder&&!In.anchors.has(this.source)){const Hn=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(Hn)}if(In.implicitKey)return`${Ln} `}return Ln}}function getAliasCount(on,In,Rn){if(isAlias(In)){const Mn=In.resolve(on),Ln=Rn&&Mn&&Rn.get(Mn);return Ln?Ln.count*Ln.aliasCount:0}else if(isCollection$1(In)){let Mn=0;for(const Ln of In.items){const Hn=getAliasCount(on,Ln,Rn);Hn>Mn&&(Mn=Hn)}return Mn}else if(isPair(In)){const Mn=getAliasCount(on,In.key,Rn),Ln=getAliasCount(on,In.value,Rn);return Math.max(Mn,Ln)}return 1}const isScalarValue=on=>!on||typeof on!="function"&&typeof on!="object";class Scalar extends NodeBase{constructor(In){super(SCALAR$1),this.value=In}toJSON(In,Rn){return Rn?.keep?this.value:toJS(this.value,In,Rn)}toString(){return String(this.value)}}Scalar.BLOCK_FOLDED="BLOCK_FOLDED";Scalar.BLOCK_LITERAL="BLOCK_LITERAL";Scalar.PLAIN="PLAIN";Scalar.QUOTE_DOUBLE="QUOTE_DOUBLE";Scalar.QUOTE_SINGLE="QUOTE_SINGLE";const defaultTagPrefix="tag:yaml.org,2002:";function findTagObject(on,In,Rn){if(In){const Mn=Rn.filter(Hn=>Hn.tag===In),Ln=Mn.find(Hn=>!Hn.format)??Mn[0];if(!Ln)throw new Error(`Tag ${In} not found`);return Ln}return Rn.find(Mn=>Mn.identify?.(on)&&!Mn.format)}function createNode(on,In,Rn){if(isDocument(on)&&(on=on.contents),isNode(on))return on;if(isPair(on)){const gi=Rn.schema[MAP].createNode?.(Rn.schema,null,Rn);return gi.items.push(on),gi}(on instanceof String||on instanceof Number||on instanceof Boolean||typeof BigInt<"u"&&on instanceof BigInt)&&(on=on.valueOf());const{aliasDuplicateObjects:Mn,onAnchor:Ln,onTagObj:Hn,schema:jn,sourceObjects:Wn}=Rn;let Yn;if(Mn&&on&&typeof on=="object"){if(Yn=Wn.get(on),Yn)return Yn.anchor||(Yn.anchor=Ln(on)),new Alias(Yn.anchor);Yn={anchor:null,node:null},Wn.set(on,Yn)}In?.startsWith("!!")&&(In=defaultTagPrefix+In.slice(2));let hi=findTagObject(on,In,jn.tags);if(!hi){if(on&&typeof on.toJSON=="function"&&(on=on.toJSON()),!on||typeof on!="object"){const gi=new Scalar(on);return Yn&&(Yn.node=gi),gi}hi=on instanceof Map?jn[MAP]:Symbol.iterator in Object(on)?jn[SEQ]:jn[MAP]}Hn&&(Hn(hi),delete Rn.onTagObj);const vi=hi?.createNode?hi.createNode(Rn.schema,on,Rn):typeof hi?.nodeClass?.from=="function"?hi.nodeClass.from(Rn.schema,on,Rn):new Scalar(on);return In?vi.tag=In:hi.default||(vi.tag=hi.tag),Yn&&(Yn.node=vi),vi}function collectionFromPath(on,In,Rn){let Mn=Rn;for(let Ln=In.length-1;Ln>=0;--Ln){const Hn=In[Ln];if(typeof Hn=="number"&&Number.isInteger(Hn)&&Hn>=0){const jn=[];jn[Hn]=Mn,Mn=jn}else Mn=new Map([[Hn,Mn]])}return createNode(Mn,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:on,sourceObjects:new Map})}const isEmptyPath=on=>on==null||typeof on=="object"&&!!on[Symbol.iterator]().next().done;class Collection extends NodeBase{constructor(In,Rn){super(In),Object.defineProperty(this,"schema",{value:Rn,configurable:!0,enumerable:!1,writable:!0})}clone(In){const Rn=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return In&&(Rn.schema=In),Rn.items=Rn.items.map(Mn=>isNode(Mn)||isPair(Mn)?Mn.clone(In):Mn),this.range&&(Rn.range=this.range.slice()),Rn}addIn(In,Rn){if(isEmptyPath(In))this.add(Rn);else{const[Mn,...Ln]=In,Hn=this.get(Mn,!0);if(isCollection$1(Hn))Hn.addIn(Ln,Rn);else if(Hn===void 0&&this.schema)this.set(Mn,collectionFromPath(this.schema,Ln,Rn));else throw new Error(`Expected YAML collection at ${Mn}. Remaining path: ${Ln}`)}}deleteIn(In){const[Rn,...Mn]=In;if(Mn.length===0)return this.delete(Rn);const Ln=this.get(Rn,!0);if(isCollection$1(Ln))return Ln.deleteIn(Mn);throw new Error(`Expected YAML collection at ${Rn}. Remaining path: ${Mn}`)}getIn(In,Rn){const[Mn,...Ln]=In,Hn=this.get(Mn,!0);return Ln.length===0?!Rn&&isScalar$1(Hn)?Hn.value:Hn:isCollection$1(Hn)?Hn.getIn(Ln,Rn):void 0}hasAllNullValues(In){return this.items.every(Rn=>{if(!isPair(Rn))return!1;const Mn=Rn.value;return Mn==null||In&&isScalar$1(Mn)&&Mn.value==null&&!Mn.commentBefore&&!Mn.comment&&!Mn.tag})}hasIn(In){const[Rn,...Mn]=In;if(Mn.length===0)return this.has(Rn);const Ln=this.get(Rn,!0);return isCollection$1(Ln)?Ln.hasIn(Mn):!1}setIn(In,Rn){const[Mn,...Ln]=In;if(Ln.length===0)this.set(Mn,Rn);else{const Hn=this.get(Mn,!0);if(isCollection$1(Hn))Hn.setIn(Ln,Rn);else if(Hn===void 0&&this.schema)this.set(Mn,collectionFromPath(this.schema,Ln,Rn));else throw new Error(`Expected YAML collection at ${Mn}. Remaining path: ${Ln}`)}}}const stringifyComment=on=>on.replace(/^(?!$)(?: $)?/gm,"#");function indentComment(on,In){return/^\n+$/.test(on)?on.substring(1):In?on.replace(/^(?! *$)/gm,In):on}const lineComment=(on,In,Rn)=>on.endsWith(`
|
|
5142
5142
|
`)?indentComment(Rn,In):Rn.includes(`
|
|
5143
5143
|
`)?`
|
|
@@ -5424,7 +5424,7 @@ ${Rn.comment}`:Rn.comment}this.doc.range[2]=Rn.offset;break}default:this.errors.
|
|
|
5424
5424
|
justify-content: center;
|
|
5425
5425
|
gap: ${on.spacing(6)};
|
|
5426
5426
|
padding-top: ${on.spacing(8)};
|
|
5427
|
-
`);class ErrorBoundary extends reactExports.Component{#e;constructor(In){super(In),this.state={errorKind:"none"},this.#e=registerReceiveMessage(SIGNED_IN_MESSAGE,()=>{this.state.errorKind==="user-session-expired"&&this.setState({errorKind:"none"})})}static getDerivedStateFromError(In){let Rn="unexpected";return In.message==="Failed to fetch"&&(Rn="network"),In instanceof UserSessionExpiredError&&(Rn="user-session-expired"),{errorKind:Rn}}componentDidCatch(In,Rn){this.state.errorKind==="unexpected"&&console.error({error:In,errorInfo:Rn})}componentWillUnmount(){this.#e()}render(){const{errorKind:In}=this.state,Rn=()=>{this.setState({errorKind:"none"})};switch(In){case"network":return this.props.wrapError?.(jsx$1(NetworkErrorView,{onReset:Rn}))??jsx$1(NetworkErrorView,{onReset:Rn});case"none":return this.props.children;case"unexpected":return this.props.wrapError?.(jsx$1(UnexpectedErrorView,{onReset:Rn}))??jsx$1(UnexpectedErrorView,{onReset:Rn});case"user-session-expired":return this.props.wrapError?.(jsx$1(UserSessionExpiredErrorView,{}))??jsx$1(UserSessionExpiredErrorView,{})}}}function NetworkErrorView({onReset:on}){const[In,Rn]=reactExports.useState(!1);return jsx$1(EmptyContent,{title:"Network Error",icon:jsx$1(FailureIcon,{inheritColor:!0}),error:!0,actions:jsx$1(Button,{size:"medium",variant:"contained",disableElevation:!0,loading:In,onClick:()=>{Rn(!0),on()},children:"Try Again"}),children:jsx$1(Typography,{variant:"subtitle1",children:"Either you're offline or the server is not reachable. Please check your network connection or try again later."})})}function UnexpectedErrorView({onReset:on}){const[In,Rn]=reactExports.useState(!1);return jsx$1(EmptyContent,{title:"Unexpected Error Occurred",icon:jsx$1(FailureIcon,{inheritColor:!0}),error:!0,actions:jsx$1(Button,{size:"medium",variant:"contained",disableElevation:!0,loading:In,onClick:()=>{Rn(!0),on()},children:"Try Again"})})}function UserSessionExpiredErrorView(){const[on,In]=reactExports.useState(!1);return jsx$1(EmptyContent,{title:"User Session Expired",icon:jsx$1(WarningIcon,{inheritColor:!0}),actions:jsx$1(Button,{size:"medium",variant:"contained",disableElevation:!0,loading:on,onClick:()=>{In(!0),sendMessage({kind:RENEW_SESSION_MESSAGE})},children:"Renew Session"}),children:jsx$1(Typography,{variant:"subtitle1",children:"Your session has expired. Renew your session to continue."})})}const HTTP_HEADER_KEYS=["A-IM",HEADER_ACCEPT,"Accept-Datetime","Accept-Language",HEADER_AUTHORIZATION,"Cache-Control","Content-MD5",HEADER_CONTENT_TYPE,"Enable-Tracing","Forwarded","From","GraphQL-Preflight",HEADER_FUSION_OPERATION_PLAN,"HTTP2-Settings","If-Match","If-Modified-Since","If-None-Match","If-Range","If-Unmodified-Since","Max-Forwards","Pragma","Range","Warning","X-Apollo-Tracing"],HttpHeaders=reactExports.memo(function on({authHeaderValue:In,headers:Rn,onChange:Mn}){const Ln=reactExports.useRef([]),Hn=useForceUpdate(),jn=useDebouncedCallback((Yn,hi)=>{hi.newHeader?Ln.current.splice(-1,1,{...hi,newHeader:!1,setFocusOn:hi.name?"key":"value"},{name:"",value:"",enabled:!0,newHeader:!0}):Ln.current.splice(Yn,1,hi),Mn(mapToHttpHeaders(Ln.current)),Hn()},[Mn,Hn]),Wn=reactExports.useCallback(Yn=>{Ln.current=Ln.current.filter((hi,vi)=>vi!==Yn),Mn(mapToHttpHeaders(Ln.current)),Hn()},[Mn,Hn]);return reactExports.useLayoutEffect(()=>{Ln.current=initializeHeaders(Rn),Hn()},[Rn,Hn]),jsxs(Container$1,{children:[jsxs(HeaderRow,{children:[jsx$1(EnabledColumn,{}),jsx$1(KeyColumn,{children:"Name"}),jsx$1(ValueColumn,{children:"Value"}),jsx$1(ActionColumn,{})]}),In&&jsx$1(HttpHeaderRow,{index:-1,readOnly:!0,headerKey:"Authorization",headerValue:In,headerEnabled:!0,onChange:jn,onRemove:Wn}),Ln.current.map(({name:Yn,value:hi,enabled:vi,newHeader:gi,setFocusOn:mi},yi)=>jsx$1(HttpHeaderRow,{index:yi,headerKey:Yn,headerValue:hi,headerEnabled:vi,newHeader:gi,setFocusOn:mi,onChange:jn,onRemove:Wn},yi))]})});function initializeHeaders(on){return(on??[]).map(In=>({...In,newHeader:!1})).concat({name:"",value:"",enabled:!0,newHeader:!0})}function mapToHttpHeaders(on){const In=on.filter(({newHeader:Rn})=>!Rn).map(({name:Rn,value:Mn,enabled:Ln})=>({name:Rn,value:Mn,enabled:Ln}));return In.length?In:null}const HttpHeaderRow=reactExports.memo(function on({index:In,readOnly:Rn,headerKey:Mn,headerValue:Ln,headerEnabled:Hn,newHeader:jn,setFocusOn:Wn,onChange:Yn,onRemove:hi}){const vi=reactExports.useRef(null),[gi,mi]=reactExports.useState(Hn??!0),[yi,bi]=reactExports.useState(Mn),Ei=reactExports.useCallback((Ai="")=>{Ai!==yi&&(bi(Ai),Yn(In,{name:Ai,value:vi.current?.value??"",enabled:gi,newHeader:jn??!1}))},[In,gi,jn,yi,Yn]),_i=reactExports.useCallback(Ai=>{Yn(In,{name:yi,value:Ai.target.value,enabled:gi,newHeader:jn??!1})},[In,gi,jn,yi,Yn]),xi=reactExports.useCallback(Ai=>{mi(Ai),Yn(In,{name:yi,value:vi.current?.value??"",enabled:Ai,newHeader:jn??!1})},[In,jn,yi,Yn]),Ci=reactExports.useCallback(Ai=>{Ai.preventDefault(),hi(In)},[In,hi]);return reactExports.useLayoutEffect(()=>{bi(Mn)},[Mn]),reactExports.useLayoutEffect(()=>{vi.current&&(vi.current.value=Ln)},[Ln]),reactExports.useLayoutEffect(()=>{mi(Hn??!0)},[Hn]),jsxs(Row,{children:[jsx$1(EnabledColumn,{children:jsx$1(UncontrolledToggle,{checked:gi,disabled:Rn??jn??!1,onChange:xi})}),jsx$1(KeyColumn,{children:Rn?jsx$1(TextField,{type:"text",value:Mn,fullWidth:!0,InputProps:{readOnly:Rn}}):jsx$1(HttpHeaderKeys,{initialValue:Mn,enableValidation:!jn&&gi,setFocus:Wn==="key",onChange:Ei})}),jsx$1(ValueColumn,{children:jsx$1(TextField,{inputRef:vi,type:"text",placeholder:"Value",defaultValue:Ln,fullWidth:!0,spellCheck:!1,autoComplete:"off",autoFocus:Wn==="value",InputProps:{readOnly:Rn},onChange:_i})}),jsx$1(ActionColumn,{children:jsx$1(TooltipIconButton,{disabled:Rn??jn??!1,onClick:Ci,children:jsx$1(CloseIcon,{})})})]})}),Container$1=styled("div")`
|
|
5427
|
+
`);class ErrorBoundary extends reactExports.Component{#e;constructor(In){super(In),this.state={errorKind:"none"},this.#e=registerReceiveMessage(SIGNED_IN_MESSAGE,()=>{this.state.errorKind==="user-session-expired"&&this.setState({errorKind:"none"})})}static getDerivedStateFromError(In){let Rn="unexpected";return In.message==="Failed to fetch"&&(Rn="network"),In instanceof UserSessionExpiredError&&(Rn="user-session-expired"),{errorKind:Rn}}componentDidCatch(In,Rn){this.state.errorKind==="unexpected"&&console.error({error:In,errorInfo:Rn})}componentWillUnmount(){this.#e()}render(){const{errorKind:In}=this.state,Rn=()=>{this.setState({errorKind:"none"})};switch(In){case"network":return this.props.wrapError?.(jsx$1(NetworkErrorView,{onReset:Rn}))??jsx$1(NetworkErrorView,{onReset:Rn});case"none":return this.props.children;case"unexpected":return this.props.wrapError?.(jsx$1(UnexpectedErrorView,{onReset:Rn}))??jsx$1(UnexpectedErrorView,{onReset:Rn});case"user-session-expired":return this.props.wrapError?.(jsx$1(UserSessionExpiredErrorView,{}))??jsx$1(UserSessionExpiredErrorView,{})}}}function NetworkErrorView({onReset:on}){const[In,Rn]=reactExports.useState(!1);return jsx$1(EmptyContent,{title:"Network Error",icon:jsx$1(FailureIcon,{inheritColor:!0}),error:!0,actions:jsx$1(Button,{size:"medium",variant:"contained",disableElevation:!0,loading:In,onClick:()=>{Rn(!0),on()},children:"Try Again"}),children:jsx$1(Typography,{variant:"subtitle1",children:"Either you're offline or the server is not reachable. Please check your network connection or try again later."})})}function UnexpectedErrorView({onReset:on}){const[In,Rn]=reactExports.useState(!1);return jsx$1(EmptyContent,{title:"Unexpected Error Occurred",icon:jsx$1(FailureIcon,{inheritColor:!0}),error:!0,actions:jsx$1(Button,{size:"medium",variant:"contained",disableElevation:!0,loading:In,onClick:()=>{Rn(!0),on()},children:"Try Again"})})}function UserSessionExpiredErrorView(){const[on,In]=reactExports.useState(!1);return jsx$1(EmptyContent,{title:"User Session Expired",icon:jsx$1(WarningIcon,{inheritColor:!0}),actions:jsx$1(Button,{size:"medium",variant:"contained",disableElevation:!0,loading:on,onClick:()=>{In(!0),sendMessage({kind:RENEW_SESSION_MESSAGE})},children:"Renew Session"}),children:jsx$1(Typography,{variant:"subtitle1",children:"Your session has expired. Renew your session to continue."})})}const HTTP_HEADER_KEYS=["A-IM",HEADER_ACCEPT,"Accept-Datetime","Accept-Language",HEADER_AUTHORIZATION,"Cache-Control","Content-MD5",HEADER_CONTENT_TYPE,"Enable-Tracing","Forwarded","From","GraphQL-Cost","GraphQL-Preflight",HEADER_FUSION_OPERATION_PLAN,"HTTP2-Settings","If-Match","If-Modified-Since","If-None-Match","If-Range","If-Unmodified-Since","Max-Forwards","Pragma","Range","Warning","X-Apollo-Tracing"],HttpHeaders=reactExports.memo(function on({authHeaderValue:In,headers:Rn,onChange:Mn}){const Ln=reactExports.useRef([]),Hn=useForceUpdate(),jn=useDebouncedCallback((Yn,hi)=>{hi.newHeader?Ln.current.splice(-1,1,{...hi,newHeader:!1,setFocusOn:hi.name?"key":"value"},{name:"",value:"",enabled:!0,newHeader:!0}):Ln.current.splice(Yn,1,hi),Mn(mapToHttpHeaders(Ln.current)),Hn()},[Mn,Hn]),Wn=reactExports.useCallback(Yn=>{Ln.current=Ln.current.filter((hi,vi)=>vi!==Yn),Mn(mapToHttpHeaders(Ln.current)),Hn()},[Mn,Hn]);return reactExports.useLayoutEffect(()=>{Ln.current=initializeHeaders(Rn),Hn()},[Rn,Hn]),jsxs(Container$1,{children:[jsxs(HeaderRow,{children:[jsx$1(EnabledColumn,{}),jsx$1(KeyColumn,{children:"Name"}),jsx$1(ValueColumn,{children:"Value"}),jsx$1(ActionColumn,{})]}),In&&jsx$1(HttpHeaderRow,{index:-1,readOnly:!0,headerKey:"Authorization",headerValue:In,headerEnabled:!0,onChange:jn,onRemove:Wn}),Ln.current.map(({name:Yn,value:hi,enabled:vi,newHeader:gi,setFocusOn:mi},yi)=>jsx$1(HttpHeaderRow,{index:yi,headerKey:Yn,headerValue:hi,headerEnabled:vi,newHeader:gi,setFocusOn:mi,onChange:jn,onRemove:Wn},yi))]})});function initializeHeaders(on){return(on??[]).map(In=>({...In,newHeader:!1})).concat({name:"",value:"",enabled:!0,newHeader:!0})}function mapToHttpHeaders(on){const In=on.filter(({newHeader:Rn})=>!Rn).map(({name:Rn,value:Mn,enabled:Ln})=>({name:Rn,value:Mn,enabled:Ln}));return In.length?In:null}const HttpHeaderRow=reactExports.memo(function on({index:In,readOnly:Rn,headerKey:Mn,headerValue:Ln,headerEnabled:Hn,newHeader:jn,setFocusOn:Wn,onChange:Yn,onRemove:hi}){const vi=reactExports.useRef(null),[gi,mi]=reactExports.useState(Hn??!0),[yi,bi]=reactExports.useState(Mn),Ei=reactExports.useCallback((Ai="")=>{Ai!==yi&&(bi(Ai),Yn(In,{name:Ai,value:vi.current?.value??"",enabled:gi,newHeader:jn??!1}))},[In,gi,jn,yi,Yn]),_i=reactExports.useCallback(Ai=>{Yn(In,{name:yi,value:Ai.target.value,enabled:gi,newHeader:jn??!1})},[In,gi,jn,yi,Yn]),xi=reactExports.useCallback(Ai=>{mi(Ai),Yn(In,{name:yi,value:vi.current?.value??"",enabled:Ai,newHeader:jn??!1})},[In,jn,yi,Yn]),Ci=reactExports.useCallback(Ai=>{Ai.preventDefault(),hi(In)},[In,hi]);return reactExports.useLayoutEffect(()=>{bi(Mn)},[Mn]),reactExports.useLayoutEffect(()=>{vi.current&&(vi.current.value=Ln)},[Ln]),reactExports.useLayoutEffect(()=>{mi(Hn??!0)},[Hn]),jsxs(Row,{children:[jsx$1(EnabledColumn,{children:jsx$1(UncontrolledToggle,{checked:gi,disabled:Rn??jn??!1,onChange:xi})}),jsx$1(KeyColumn,{children:Rn?jsx$1(TextField,{type:"text",value:Mn,fullWidth:!0,InputProps:{readOnly:Rn}}):jsx$1(HttpHeaderKeys,{initialValue:Mn,enableValidation:!jn&&gi,setFocus:Wn==="key",onChange:Ei})}),jsx$1(ValueColumn,{children:jsx$1(TextField,{inputRef:vi,type:"text",placeholder:"Value",defaultValue:Ln,fullWidth:!0,spellCheck:!1,autoComplete:"off",autoFocus:Wn==="value",InputProps:{readOnly:Rn},onChange:_i})}),jsx$1(ActionColumn,{children:jsx$1(TooltipIconButton,{disabled:Rn??jn??!1,onClick:Ci,children:jsx$1(CloseIcon,{})})})]})}),Container$1=styled("div")`
|
|
5428
5428
|
display: flex;
|
|
5429
5429
|
flex: 0 0 auto;
|
|
5430
5430
|
flex-direction: column;
|
|
@@ -5590,7 +5590,7 @@ ${Rn.comment}`:Rn.comment}this.doc.range[2]=Rn.offset;break}default:this.errors.
|
|
|
5590
5590
|
bottom: 0;
|
|
5591
5591
|
left: 0;
|
|
5592
5592
|
margin: auto;
|
|
5593
|
-
`,Providers=reactExports.lazy(()=>__vitePreload(()=>import("./context-providers.
|
|
5593
|
+
`,Providers=reactExports.lazy(()=>__vitePreload(()=>import("./context-providers.3d52dae0.CDo0K4_6.js").then(on=>on.v),__vite__mapDeps([0,1,2,3]),import.meta.url));function Shell(){return window.appNamespace=IS_RUNNING_IN_CLOUD||IS_RUNNING_IN_ELECTRON?"":createAppNamespace(),jsx$1(ThemeProvider,{children:jsx$1(AppLoader,{children:jsx$1(reactExports.Suspense,{children:jsx$1(Providers,{})})})})}function createAppNamespace(){return createHash(extractAppUrlPath(window.location)).slice(0,8)}var client={exports:{}},reactDomClient_production={},scheduler={exports:{}},scheduler_production={};/**
|
|
5594
5594
|
* @license React
|
|
5595
5595
|
* scheduler.production.js
|
|
5596
5596
|
*
|