@vue-skuilder/standalone-ui 0.2.2 → 0.2.4

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.
@@ -22,8 +22,8 @@ Server rendered element contains fewer child nodes than client vdom.`),O=!0),log
22
22
  If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.`:``;warn$1(`Failed to resolve ${t.slice(0,-1)}: ${c}${u}`)}return b}else process.env.NODE_ENV!==`production`&&warn$1(`resolve${capitalize(t.slice(0,-1))} can only be used in render() or setup().`)}function resolve(t,c){return t&&(t[c]||t[camelize(c)]||t[capitalize(camelize(c))])}function renderList(t,c,u,d){let m,g=u&&u[d],b=isArray$3(t);if(b||isString$1(t)){let u=b&&isReactive(t),d=!1;u&&(d=!isShallow(t),t=shallowReadArray(t)),m=Array(t.length);for(let u=0,b=t.length;u<b;u++)m[u]=c(d?toReactive(t[u]):t[u],u,void 0,g&&g[u])}else if(typeof t==`number`){process.env.NODE_ENV!==`production`&&!Number.isInteger(t)&&warn$1(`The v-for range expect an integer value but got ${t}.`),m=Array(t);for(let u=0;u<t;u++)m[u]=c(u+1,u,void 0,g&&g[u])}else if(isObject$1(t))if(t[Symbol.iterator])m=Array.from(t,(t,u)=>c(t,u,void 0,g&&g[u]));else{let u=Object.keys(t);m=Array(u.length);for(let d=0,b=u.length;d<b;d++){let b=u[d];m[d]=c(t[b],b,d,g&&g[d])}}else m=[];return u&&(u[d]=m),m}function createSlots(t,c){for(let u=0;u<c.length;u++){let d=c[u];if(isArray$3(d))for(let c=0;c<d.length;c++)t[d[c].name]=d[c].fn;else d&&(t[d.name]=d.key?(...t)=>{let c=d.fn(...t);return c&&(c.key=d.key),c}:d.fn)}return t}function renderSlot(t,c,u={},d,m){if(currentRenderingInstance.ce||currentRenderingInstance.parent&&isAsyncWrapper(currentRenderingInstance.parent)&&currentRenderingInstance.parent.ce)return c!==`default`&&(u.name=c),openBlock(),createBlock(Fragment,null,[createVNode(`slot`,u,d&&d())],64);let slot=t[c];process.env.NODE_ENV!==`production`&&slot&&slot.length>1&&(warn$1(`SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.`),slot=()=>[]),slot&&slot._c&&(slot._d=!1),openBlock();let g=slot&&ensureValidVNode(slot(u)),b=u.key||g&&g.key,S=createBlock(Fragment,{key:(b&&!isSymbol(b)?b:`_${c}`)+(!g&&d?`_fb`:``)},g||(d?d():[]),g&&t._===1?64:-2);return!m&&S.scopeId&&(S.slotScopeIds=[S.scopeId+`-s`]),slot&&slot._c&&(slot._d=!0),S}function ensureValidVNode(t){return t.some(t=>isVNode(t)?!(t.type===Comment||t.type===Fragment&&!ensureValidVNode(t.children)):!0)?t:null}function toHandlers(t,c){let u={};if(process.env.NODE_ENV!==`production`&&!isObject$1(t))return warn$1(`v-on with no argument expects an object value.`),u;for(let d in t)u[c&&/[A-Z]/.test(d)?`on:${d}`:toHandlerKey(d)]=t[d];return u}function createDevRenderContext(t){let c={};return Object.defineProperty(c,`_`,{configurable:!0,enumerable:!1,get:()=>t}),Object.keys(publicPropertiesMap).forEach(u=>{Object.defineProperty(c,u,{configurable:!0,enumerable:!1,get:()=>publicPropertiesMap[u](t),set:NOOP})}),c}function exposePropsOnRenderContext(t){let{ctx:c,propsOptions:[u]}=t;u&&Object.keys(u).forEach(u=>{Object.defineProperty(c,u,{enumerable:!0,configurable:!0,get:()=>t.props[u],set:NOOP})})}function exposeSetupStateOnRenderContext(t){let{ctx:c,setupState:u}=t;Object.keys(toRaw(u)).forEach(t=>{if(!u.__isScriptSetup){if(isReservedPrefix(t[0])){warn$1(`setup() return property ${JSON.stringify(t)} should not start with "$" or "_" which are reserved prefixes for Vue internals.`);return}Object.defineProperty(c,t,{enumerable:!0,configurable:!0,get:()=>u[t],set:NOOP})}})}function defineProps(){return process.env.NODE_ENV!==`production`&&warnRuntimeUsage(`defineProps`),null}function defineEmits(){return process.env.NODE_ENV!==`production`&&warnRuntimeUsage(`defineEmits`),null}function defineExpose(t){process.env.NODE_ENV!==`production`&&warnRuntimeUsage(`defineExpose`)}function defineOptions(t){process.env.NODE_ENV!==`production`&&warnRuntimeUsage(`defineOptions`)}function defineSlots(){return process.env.NODE_ENV!==`production`&&warnRuntimeUsage(`defineSlots`),null}function defineModel(){process.env.NODE_ENV!==`production`&&warnRuntimeUsage(`defineModel`)}function withDefaults(t,c){return process.env.NODE_ENV!==`production`&&warnRuntimeUsage(`withDefaults`),null}function useSlots(){return getContext().slots}function useAttrs(){return getContext().attrs}function getContext(){let t=getCurrentInstance();return process.env.NODE_ENV!==`production`&&!t&&warn$1(`useContext() called without active instance.`),t.setupContext||(t.setupContext=createSetupContext(t))}function normalizePropsOrEmits(t){return isArray$3(t)?t.reduce((t,c)=>(t[c]=null,t),{}):t}function mergeDefaults(t,c){let u=normalizePropsOrEmits(t);for(let t in c){if(t.startsWith(`__skip`))continue;let d=u[t];d?isArray$3(d)||isFunction$1(d)?d=u[t]={type:d,default:c[t]}:d.default=c[t]:d===null?d=u[t]={default:c[t]}:process.env.NODE_ENV!==`production`&&warn$1(`props default key "${t}" has no corresponding declaration.`),d&&c[`__skip_${t}`]&&(d.skipFactory=!0)}return u}function mergeModels(t,c){return!t||!c?t||c:isArray$3(t)&&isArray$3(c)?t.concat(c):extend$2({},normalizePropsOrEmits(t),normalizePropsOrEmits(c))}function createPropsRestProxy(t,c){let u={};for(let d in t)c.includes(d)||Object.defineProperty(u,d,{enumerable:!0,get:()=>t[d]});return u}function withAsyncContext(t){let c=getCurrentInstance();process.env.NODE_ENV!==`production`&&!c&&warn$1(`withAsyncContext called without active current instance. This is likely a bug.`);let u=t();return unsetCurrentInstance(),isPromise(u)&&(u=u.catch(t=>{throw setCurrentInstance(c),t})),[u,()=>setCurrentInstance(c)]}function createDuplicateChecker(){let t=Object.create(null);return(c,u)=>{t[u]?warn$1(`${c} property "${u}" is already defined in ${t[u]}.`):t[u]=c}}function applyOptions(t){let c=resolveMergedOptions(t),u=t.proxy,d=t.ctx;shouldCacheAccess=!1,c.beforeCreate&&callHook$1(c.beforeCreate,t,`bc`);let{data:m,computed:g,methods:b,watch:S,provide:C,inject:w,created:T,beforeMount:E,mounted:D,beforeUpdate:O,updated:Or,activated:kr,deactivated:Ar,beforeDestroy:jr,beforeUnmount:Mr,destroyed:Nr,unmounted:Pr,render:Fr,renderTracked:Ir,renderTriggered:Lr,errorCaptured:Rr,serverPrefetch:zr,expose:Br,inheritAttrs:Vr,components:Hr,directives:Ur,filters:Wr}=c,Gr=process.env.NODE_ENV===`production`?null:createDuplicateChecker();if(process.env.NODE_ENV!==`production`){let[c]=t.propsOptions;if(c)for(let t in c)Gr(`Props`,t)}if(w&&resolveInjections(w,d,Gr),b)for(let t in b){let c=b[t];isFunction$1(c)?(process.env.NODE_ENV===`production`?d[t]=c.bind(u):Object.defineProperty(d,t,{value:c.bind(u),configurable:!0,enumerable:!0,writable:!0}),process.env.NODE_ENV!==`production`&&Gr(`Methods`,t)):process.env.NODE_ENV!==`production`&&warn$1(`Method "${t}" has type "${typeof c}" in the component definition. Did you reference the function correctly?`)}if(m){process.env.NODE_ENV!==`production`&&!isFunction$1(m)&&warn$1(`The data option must be a function. Plain object usage is no longer supported.`);let c=m.call(u,u);if(process.env.NODE_ENV!==`production`&&isPromise(c)&&warn$1(`data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.`),!isObject$1(c))process.env.NODE_ENV!==`production`&&warn$1(`data() should return an object.`);else if(t.data=reactive(c),process.env.NODE_ENV!==`production`)for(let t in c)Gr(`Data`,t),isReservedPrefix(t[0])||Object.defineProperty(d,t,{configurable:!0,enumerable:!0,get:()=>c[t],set:NOOP})}if(shouldCacheAccess=!0,g)for(let t in g){let c=g[t],m=isFunction$1(c)?c.bind(u,u):isFunction$1(c.get)?c.get.bind(u,u):NOOP;process.env.NODE_ENV!==`production`&&m===NOOP&&warn$1(`Computed property "${t}" has no getter.`);let b=computed({get:m,set:!isFunction$1(c)&&isFunction$1(c.set)?c.set.bind(u):process.env.NODE_ENV===`production`?NOOP:()=>{warn$1(`Write operation failed: computed property "${t}" is readonly.`)}});Object.defineProperty(d,t,{enumerable:!0,configurable:!0,get:()=>b.value,set:t=>b.value=t}),process.env.NODE_ENV!==`production`&&Gr(`Computed`,t)}if(S)for(let t in S)createWatcher(S[t],d,u,t);if(C){let t=isFunction$1(C)?C.call(u):C;Reflect.ownKeys(t).forEach(c=>{provide(c,t[c])})}T&&callHook$1(T,t,`c`);function registerLifecycleHook(t,c){isArray$3(c)?c.forEach(c=>t(c.bind(u))):c&&t(c.bind(u))}if(registerLifecycleHook(onBeforeMount,E),registerLifecycleHook(onMounted,D),registerLifecycleHook(onBeforeUpdate,O),registerLifecycleHook(onUpdated,Or),registerLifecycleHook(onActivated,kr),registerLifecycleHook(onDeactivated,Ar),registerLifecycleHook(onErrorCaptured,Rr),registerLifecycleHook(onRenderTracked,Ir),registerLifecycleHook(onRenderTriggered,Lr),registerLifecycleHook(onBeforeUnmount,Mr),registerLifecycleHook(onUnmounted,Pr),registerLifecycleHook(onServerPrefetch,zr),isArray$3(Br))if(Br.length){let c=t.exposed||(t.exposed={});Br.forEach(t=>{Object.defineProperty(c,t,{get:()=>u[t],set:c=>u[t]=c})})}else t.exposed||(t.exposed={});Fr&&t.render===NOOP&&(t.render=Fr),Vr!=null&&(t.inheritAttrs=Vr),Hr&&(t.components=Hr),Ur&&(t.directives=Ur),zr&&markAsyncBoundary(t)}function resolveInjections(t,c,u=NOOP){isArray$3(t)&&(t=normalizeInject(t));for(let d in t){let m=t[d],g;g=isObject$1(m)?`default`in m?inject(m.from||d,m.default,!0):inject(m.from||d):inject(m),isRef(g)?Object.defineProperty(c,d,{enumerable:!0,configurable:!0,get:()=>g.value,set:t=>g.value=t}):c[d]=g,process.env.NODE_ENV!==`production`&&u(`Inject`,d)}}function callHook$1(t,c,u){callWithAsyncErrorHandling(isArray$3(t)?t.map(t=>t.bind(c.proxy)):t.bind(c.proxy),c,u)}function createWatcher(t,c,u,d){let m=d.includes(`.`)?createPathGetter(u,d):()=>u[d];if(isString$1(t)){let u=c[t];isFunction$1(u)?watch(m,u):process.env.NODE_ENV!==`production`&&warn$1(`Invalid watch handler specified by key "${t}"`,u)}else if(isFunction$1(t))watch(m,t.bind(u));else if(isObject$1(t))if(isArray$3(t))t.forEach(t=>createWatcher(t,c,u,d));else{let d=isFunction$1(t.handler)?t.handler.bind(u):c[t.handler];isFunction$1(d)?watch(m,d,t):process.env.NODE_ENV!==`production`&&warn$1(`Invalid watch handler specified by key "${t.handler}"`,d)}else process.env.NODE_ENV!==`production`&&warn$1(`Invalid watch option: "${d}"`,t)}function resolveMergedOptions(t){let c=t.type,{mixins:u,extends:d}=c,{mixins:m,optionsCache:g,config:{optionMergeStrategies:b}}=t.appContext,S=g.get(c),C;return S?C=S:!m.length&&!u&&!d?C=c:(C={},m.length&&m.forEach(t=>mergeOptions(C,t,b,!0)),mergeOptions(C,c,b)),isObject$1(c)&&g.set(c,C),C}function mergeOptions(t,c,u,d=!1){let{mixins:m,extends:g}=c;g&&mergeOptions(t,g,u,!0),m&&m.forEach(c=>mergeOptions(t,c,u,!0));for(let m in c)if(d&&m===`expose`)process.env.NODE_ENV!==`production`&&warn$1(`"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.`);else{let d=internalOptionMergeStrats[m]||u&&u[m];t[m]=d?d(t[m],c[m]):c[m]}return t}function mergeDataFn(t,c){return c?t?function mergedDataFn(){return extend$2(isFunction$1(t)?t.call(this,this):t,isFunction$1(c)?c.call(this,this):c)}:c:t}function mergeInject(t,c){return mergeObjectOptions(normalizeInject(t),normalizeInject(c))}function normalizeInject(t){if(isArray$3(t)){let c={};for(let u=0;u<t.length;u++)c[t[u]]=t[u];return c}return t}function mergeAsArray$1(t,c){return t?[...new Set([].concat(t,c))]:c}function mergeObjectOptions(t,c){return t?extend$2(Object.create(null),t,c):c}function mergeEmitsOrPropsOptions(t,c){return t?isArray$3(t)&&isArray$3(c)?[...new Set([...t,...c])]:extend$2(Object.create(null),normalizePropsOrEmits(t),normalizePropsOrEmits(c??{})):c}function mergeWatchOptions(t,c){if(!t)return c;if(!c)return t;let u=extend$2(Object.create(null),t);for(let d in c)u[d]=mergeAsArray$1(t[d],c[d]);return u}function createAppContext(){return{app:null,config:{isNativeTag:NO,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}function createAppAPI(t,c){return function createApp(u,d=null){isFunction$1(u)||(u=extend$2({},u)),d!=null&&!isObject$1(d)&&(process.env.NODE_ENV!==`production`&&warn$1(`root props passed to app.mount() must be an object.`),d=null);let m=createAppContext(),g=new WeakSet,b=[],S=!1,C=m.app={_uid:uid$1++,_component:u,_props:d,_container:null,_context:m,_instance:null,version:version$2,get config(){return m.config},set config(t){process.env.NODE_ENV!==`production`&&warn$1(`app.config cannot be replaced. Modify individual options instead.`)},use(t,...c){return g.has(t)?process.env.NODE_ENV!==`production`&&warn$1(`Plugin has already been applied to target app.`):t&&isFunction$1(t.install)?(g.add(t),t.install(C,...c)):isFunction$1(t)?(g.add(t),t(C,...c)):process.env.NODE_ENV!==`production`&&warn$1(`A plugin must either be a function or an object with an "install" function.`),C},mixin(t){return m.mixins.includes(t)?process.env.NODE_ENV!==`production`&&warn$1(`Mixin has already been applied to target app`+(t.name?`: ${t.name}`:``)):m.mixins.push(t),C},component(t,c){return process.env.NODE_ENV!==`production`&&validateComponentName(t,m.config),c?(process.env.NODE_ENV!==`production`&&m.components[t]&&warn$1(`Component "${t}" has already been registered in target app.`),m.components[t]=c,C):m.components[t]},directive(t,c){return process.env.NODE_ENV!==`production`&&validateDirectiveName(t),c?(process.env.NODE_ENV!==`production`&&m.directives[t]&&warn$1(`Directive "${t}" has already been registered in target app.`),m.directives[t]=c,C):m.directives[t]},mount(g,b,w){if(S)process.env.NODE_ENV!==`production`&&warn$1("App has already been mounted.\nIf you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. `const createMyApp = () => createApp(App)`");else{process.env.NODE_ENV!==`production`&&g.__vue_app__&&warn$1("There is already an app instance mounted on the host container.\n If you want to mount another app on the same host container, you need to unmount the previous app by calling `app.unmount()` first.");let T=C._ceVNode||createVNode(u,d);return T.appContext=m,w===!0?w=`svg`:w===!1&&(w=void 0),process.env.NODE_ENV!==`production`&&(m.reload=()=>{t(cloneVNode(T),g,w)}),b&&c?c(T,g):t(T,g,w),S=!0,C._container=g,g.__vue_app__=C,process.env.NODE_ENV!==`production`&&(C._instance=T.component,devtoolsInitApp(C,version$2)),getComponentPublicInstance(T.component)}},onUnmount(t){process.env.NODE_ENV!==`production`&&typeof t!=`function`&&warn$1(`Expected function as first argument to app.onUnmount(), but got ${typeof t}`),b.push(t)},unmount(){S?(callWithAsyncErrorHandling(b,C._instance,16),t(null,C._container),process.env.NODE_ENV!==`production`&&(C._instance=null,devtoolsUnmountApp(C)),delete C._container.__vue_app__):process.env.NODE_ENV!==`production`&&warn$1(`Cannot unmount an app that is not mounted.`)},provide(t,c){return process.env.NODE_ENV!==`production`&&t in m.provides&&warn$1(`App already provides property with key "${String(t)}". It will be overwritten with the new value.`),m.provides[t]=c,C},runWithContext(t){let c=currentApp;currentApp=C;try{return t()}finally{currentApp=c}}};return C}}function provide(t,c){if(!currentInstance)process.env.NODE_ENV!==`production`&&warn$1(`provide() can only be used inside setup().`);else{let u=currentInstance.provides,d=currentInstance.parent&&currentInstance.parent.provides;d===u&&(u=currentInstance.provides=Object.create(d)),u[t]=c}}function inject(t,c,u=!1){let d=currentInstance||currentRenderingInstance;if(d||currentApp){let m=currentApp?currentApp._context.provides:d?d.parent==null?d.vnode.appContext&&d.vnode.appContext.provides:d.parent.provides:void 0;if(m&&t in m)return m[t];if(arguments.length>1)return u&&isFunction$1(c)?c.call(d&&d.proxy):c;process.env.NODE_ENV!==`production`&&warn$1(`injection "${String(t)}" not found.`)}else process.env.NODE_ENV!==`production`&&warn$1(`inject() can only be used inside setup() or functional components.`)}function hasInjectionContext(){return!!(currentInstance||currentRenderingInstance||currentApp)}function initProps(t,c,u,d=!1){let m={},g=createInternalObject();t.propsDefaults=Object.create(null),setFullProps(t,c,m,g);for(let c in t.propsOptions[0])c in m||(m[c]=void 0);process.env.NODE_ENV!==`production`&&validateProps(c||{},m,t),u?t.props=d?m:shallowReactive(m):t.type.props?t.props=m:t.props=g,t.attrs=g}function isInHmrContext(t){for(;t;){if(t.type.__hmrId)return!0;t=t.parent}}function updateProps(t,c,u,d){let{props:m,attrs:g,vnode:{patchFlag:b}}=t,S=toRaw(m),[C]=t.propsOptions,w=!1;if(!(process.env.NODE_ENV!==`production`&&isInHmrContext(t))&&(d||b>0)&&!(b&16)){if(b&8){let u=t.vnode.dynamicProps;for(let d=0;d<u.length;d++){let b=u[d];if(isEmitListener(t.emitsOptions,b))continue;let T=c[b];if(C)if(hasOwn(g,b))T!==g[b]&&(g[b]=T,w=!0);else{let c=camelize(b);m[c]=resolvePropValue(C,S,c,T,t,!1)}else T!==g[b]&&(g[b]=T,w=!0)}}}else{setFullProps(t,c,m,g)&&(w=!0);let d;for(let g in S)(!c||!hasOwn(c,g)&&((d=hyphenate(g))===g||!hasOwn(c,d)))&&(C?u&&(u[g]!==void 0||u[d]!==void 0)&&(m[g]=resolvePropValue(C,S,g,void 0,t,!0)):delete m[g]);if(g!==S)for(let t in g)(!c||!hasOwn(c,t))&&(delete g[t],w=!0)}w&&trigger(t.attrs,`set`,``),process.env.NODE_ENV!==`production`&&validateProps(c||{},m,t)}function setFullProps(t,c,u,d){let[m,g]=t.propsOptions,b=!1,S;if(c)for(let C in c){if(isReservedProp(C))continue;let w=c[C],T;m&&hasOwn(m,T=camelize(C))?!g||!g.includes(T)?u[T]=w:(S||(S={}))[T]=w:isEmitListener(t.emitsOptions,C)||(!(C in d)||w!==d[C])&&(d[C]=w,b=!0)}if(g){let c=toRaw(u),d=S||EMPTY_OBJ;for(let b=0;b<g.length;b++){let S=g[b];u[S]=resolvePropValue(m,c,S,d[S],t,!hasOwn(d,S))}}return b}function resolvePropValue(t,c,u,d,m,g){let b=t[u];if(b!=null){let t=hasOwn(b,`default`);if(t&&d===void 0){let t=b.default;if(b.type!==Function&&!b.skipFactory&&isFunction$1(t)){let{propsDefaults:g}=m;if(u in g)d=g[u];else{let b=setCurrentInstance(m);d=g[u]=t.call(null,c),b()}}else d=t;m.ce&&m.ce._setProp(u,d)}b[0]&&(g&&!t?d=!1:b[1]&&(d===``||d===hyphenate(u))&&(d=!0))}return d}function normalizePropsOptions(t,c,u=!1){let d=u?mixinPropsCache:c.propsCache,m=d.get(t);if(m)return m;let g=t.props,b={},S=[],C=!1;if(!isFunction$1(t)){let extendProps=t=>{C=!0;let[u,d]=normalizePropsOptions(t,c,!0);extend$2(b,u),d&&S.push(...d)};!u&&c.mixins.length&&c.mixins.forEach(extendProps),t.extends&&extendProps(t.extends),t.mixins&&t.mixins.forEach(extendProps)}if(!g&&!C)return isObject$1(t)&&d.set(t,EMPTY_ARR),EMPTY_ARR;if(isArray$3(g))for(let t=0;t<g.length;t++){process.env.NODE_ENV!==`production`&&!isString$1(g[t])&&warn$1(`props must be strings when using array syntax.`,g[t]);let c=camelize(g[t]);validatePropName(c)&&(b[c]=EMPTY_OBJ)}else if(g){process.env.NODE_ENV!==`production`&&!isObject$1(g)&&warn$1(`invalid props options`,g);for(let t in g){let c=camelize(t);if(validatePropName(c)){let u=g[t],d=b[c]=isArray$3(u)||isFunction$1(u)?{type:u}:extend$2({},u),m=d.type,C=!1,w=!0;if(isArray$3(m))for(let t=0;t<m.length;++t){let c=m[t],u=isFunction$1(c)&&c.name;if(u===`Boolean`){C=!0;break}else u===`String`&&(w=!1)}else C=isFunction$1(m)&&m.name===`Boolean`;d[0]=C,d[1]=w,(C||hasOwn(d,`default`))&&S.push(c)}}}let w=[b,S];return isObject$1(t)&&d.set(t,w),w}function validatePropName(t){return t[0]!==`$`&&!isReservedProp(t)?!0:(process.env.NODE_ENV!==`production`&&warn$1(`Invalid prop name: "${t}" is a reserved property.`),!1)}function getType(t){return t===null?`null`:typeof t==`function`?t.name||``:typeof t==`object`&&t.constructor&&t.constructor.name||``}function validateProps(t,c,u){let d=toRaw(c),m=u.propsOptions[0],g=Object.keys(t).map(t=>camelize(t));for(let t in m){let c=m[t];c!=null&&validateProp(t,d[t],c,process.env.NODE_ENV===`production`?d:shallowReadonly(d),!g.includes(t))}}function validateProp(t,c,u,d,m){let{type:g,required:b,validator:S,skipCheck:C}=u;if(b&&m){warn$1(`Missing required prop: "`+t+`"`);return}if(!(c==null&&!b)){if(g!=null&&g!==!0&&!C){let u=!1,d=isArray$3(g)?g:[g],m=[];for(let t=0;t<d.length&&!u;t++){let{valid:g,expectedType:b}=assertType(c,d[t]);m.push(b||``),u=g}if(!u){warn$1(getInvalidTypeMessage(t,c,m));return}}S&&!S(c,d)&&warn$1(`Invalid prop: custom validator check failed for prop "`+t+`".`)}}function assertType(t,c){let u,d=getType(c);if(d===`null`)u=t===null;else if(isSimpleType(d)){let m=typeof t;u=m===d.toLowerCase(),!u&&m===`object`&&(u=t instanceof c)}else u=d===`Object`?isObject$1(t):d===`Array`?isArray$3(t):t instanceof c;return{valid:u,expectedType:d}}function getInvalidTypeMessage(t,c,u){if(u.length===0)return`Prop type [] for prop "${t}" won't match anything. Did you mean to use type Array instead?`;let d=`Invalid prop: type check failed for prop "${t}". Expected ${u.map(capitalize).join(` | `)}`,m=u[0],g=toRawType(c),b=styleValue(c,m),S=styleValue(c,g);return u.length===1&&isExplicable(m)&&!isBoolean(m,g)&&(d+=` with value ${b}`),d+=`, got ${g} `,isExplicable(g)&&(d+=`with value ${S}.`),d}function styleValue(t,c){return c===`String`?`"${t}"`:c===`Number`?`${Number(t)}`:`${t}`}function isExplicable(t){return[`string`,`number`,`boolean`].some(c=>t.toLowerCase()===c)}function isBoolean(...t){return t.some(t=>t.toLowerCase()===`boolean`)}function startMeasure(t,c){t.appContext.config.performance&&isSupported()&&perf.mark(`vue-${c}-${t.uid}`),process.env.NODE_ENV!==`production`&&devtoolsPerfStart(t,c,isSupported()?perf.now():Date.now())}function endMeasure(t,c){if(t.appContext.config.performance&&isSupported()){let u=`vue-${c}-${t.uid}`,d=u+`:end`;perf.mark(d),perf.measure(`<${formatComponentName(t,t.type)}> ${c}`,u,d),perf.clearMarks(u),perf.clearMarks(d)}process.env.NODE_ENV!==`production`&&devtoolsPerfEnd(t,c,isSupported()?perf.now():Date.now())}function isSupported(){return supported===void 0&&(typeof window<`u`&&window.performance?(supported=!0,perf=window.performance):supported=!1),supported}function initFeatureFlags(){let t=[];if(process.env.NODE_ENV!==`production`&&t.length){let c=t.length>1;console.warn(`Feature flag${c?`s`:``} ${t.join(`, `)} ${c?`are`:`is`} not explicitly defined. You are running the esm-bundler build of Vue, which expects these compile-time feature flags to be globally injected via the bundler config in order to get better tree-shaking in the production bundle.
23
23
 
24
24
  For more details, see https://link.vuejs.org/feature-flags.`)}}function createRenderer(t){return baseCreateRenderer(t)}function createHydrationRenderer(t){return baseCreateRenderer(t,createHydrationFunctions)}function baseCreateRenderer(t,c){initFeatureFlags();let u=getGlobalThis();u.__VUE__=!0,process.env.NODE_ENV!==`production`&&setDevtoolsHook$1(u.__VUE_DEVTOOLS_GLOBAL_HOOK__,u);let{insert:d,remove:m,patchProp:g,createElement:b,createText:S,createComment:C,setText:w,setElementText:T,parentNode:E,nextSibling:D,setScopeId:O=NOOP,insertStaticContent:Or}=t,patch=(t,c,u,d=null,m=null,g=null,b=void 0,S=null,C=process.env.NODE_ENV!==`production`&&isHmrUpdating?!1:!!c.dynamicChildren)=>{if(t===c)return;t&&!isSameVNodeType(t,c)&&(d=getNextHostNode(t),unmount(t,m,g,!0),t=null),c.patchFlag===-2&&(C=!1,c.dynamicChildren=null);let{type:w,ref:T,shapeFlag:E}=c;switch(w){case Text:processText(t,c,u,d);break;case Comment:processCommentNode(t,c,u,d);break;case Static:t==null?mountStaticNode(c,u,d,b):process.env.NODE_ENV!==`production`&&patchStaticNode(t,c,u,b);break;case Fragment:processFragment(t,c,u,d,m,g,b,S,C);break;default:E&1?processElement(t,c,u,d,m,g,b,S,C):E&6?processComponent(t,c,u,d,m,g,b,S,C):E&64||E&128?w.process(t,c,u,d,m,g,b,S,C,Ar):process.env.NODE_ENV!==`production`&&warn$1(`Invalid VNode type:`,w,`(${typeof w})`)}T!=null&&m&&setRef(T,t&&t.ref,g,c||t,!c)},processText=(t,c,u,m)=>{if(t==null)d(c.el=S(c.children),u,m);else{let u=c.el=t.el;c.children!==t.children&&w(u,c.children)}},processCommentNode=(t,c,u,m)=>{t==null?d(c.el=C(c.children||``),u,m):c.el=t.el},mountStaticNode=(t,c,u,d)=>{[t.el,t.anchor]=Or(t.children,c,u,d,t.el,t.anchor)},patchStaticNode=(t,c,u,d)=>{if(c.children!==t.children){let m=D(t.anchor);removeStaticNode(t),[c.el,c.anchor]=Or(c.children,u,m,d)}else c.el=t.el,c.anchor=t.anchor},moveStaticNode=({el:t,anchor:c},u,m)=>{let g;for(;t&&t!==c;)g=D(t),d(t,u,m),t=g;d(c,u,m)},removeStaticNode=({el:t,anchor:c})=>{let u;for(;t&&t!==c;)u=D(t),m(t),t=u;m(c)},processElement=(t,c,u,d,m,g,b,S,C)=>{c.type===`svg`?b=`svg`:c.type===`math`&&(b=`mathml`),t==null?mountElement(c,u,d,m,g,b,S,C):patchElement(t,c,m,g,b,S,C)},mountElement=(t,c,u,m,S,C,w,E)=>{let D,O,{props:Or,shapeFlag:kr,transition:Ar,dirs:jr}=t;if(D=t.el=b(t.type,C,Or&&Or.is,Or),kr&8?T(D,t.children):kr&16&&mountChildren(t.children,D,null,m,S,resolveChildrenNamespace(t,C),w,E),jr&&invokeDirectiveHook(t,null,m,`created`),setScopeId(D,t,t.scopeId,w,m),Or){for(let t in Or)t!==`value`&&!isReservedProp(t)&&g(D,t,null,Or[t],C,m);`value`in Or&&g(D,`value`,null,Or.value,C),(O=Or.onVnodeBeforeMount)&&invokeVNodeHook(O,m,t)}process.env.NODE_ENV!==`production`&&(def(D,`__vnode`,t,!0),def(D,`__vueParentComponent`,m,!0)),jr&&invokeDirectiveHook(t,null,m,`beforeMount`);let Mr=needTransition(S,Ar);Mr&&Ar.beforeEnter(D),d(D,c,u),((O=Or&&Or.onVnodeMounted)||Mr||jr)&&queuePostRenderEffect(()=>{O&&invokeVNodeHook(O,m,t),Mr&&Ar.enter(D),jr&&invokeDirectiveHook(t,null,m,`mounted`)},S)},setScopeId=(t,c,u,d,m)=>{if(u&&O(t,u),d)for(let c=0;c<d.length;c++)O(t,d[c]);if(m){let u=m.subTree;if(process.env.NODE_ENV!==`production`&&u.patchFlag>0&&u.patchFlag&2048&&(u=filterSingleRoot(u.children)||u),c===u||isSuspense(u.type)&&(u.ssContent===c||u.ssFallback===c)){let c=m.vnode;setScopeId(t,c,c.scopeId,c.slotScopeIds,m.parent)}}},mountChildren=(t,c,u,d,m,g,b,S,C=0)=>{for(let w=C;w<t.length;w++)patch(null,t[w]=S?cloneIfMounted(t[w]):normalizeVNode(t[w]),c,u,d,m,g,b,S)},patchElement=(t,c,u,d,m,b,S)=>{let C=c.el=t.el;process.env.NODE_ENV!==`production`&&(C.__vnode=c);let{patchFlag:w,dynamicChildren:E,dirs:D}=c;w|=t.patchFlag&16;let O=t.props||EMPTY_OBJ,Or=c.props||EMPTY_OBJ,kr;if(u&&toggleRecurse(u,!1),(kr=Or.onVnodeBeforeUpdate)&&invokeVNodeHook(kr,u,c,t),D&&invokeDirectiveHook(c,t,u,`beforeUpdate`),u&&toggleRecurse(u,!0),process.env.NODE_ENV!==`production`&&isHmrUpdating&&(w=0,S=!1,E=null),(O.innerHTML&&Or.innerHTML==null||O.textContent&&Or.textContent==null)&&T(C,``),E?(patchBlockChildren(t.dynamicChildren,E,C,u,d,resolveChildrenNamespace(c,m),b),process.env.NODE_ENV!==`production`&&traverseStaticChildren(t,c)):S||patchChildren(t,c,C,null,u,d,resolveChildrenNamespace(c,m),b,!1),w>0){if(w&16)patchProps(C,O,Or,u,m);else if(w&2&&O.class!==Or.class&&g(C,`class`,null,Or.class,m),w&4&&g(C,`style`,O.style,Or.style,m),w&8){let t=c.dynamicProps;for(let c=0;c<t.length;c++){let d=t[c],b=O[d],S=Or[d];(S!==b||d===`value`)&&g(C,d,b,S,m,u)}}w&1&&t.children!==c.children&&T(C,c.children)}else !S&&E==null&&patchProps(C,O,Or,u,m);((kr=Or.onVnodeUpdated)||D)&&queuePostRenderEffect(()=>{kr&&invokeVNodeHook(kr,u,c,t),D&&invokeDirectiveHook(c,t,u,`updated`)},d)},patchBlockChildren=(t,c,u,d,m,g,b)=>{for(let S=0;S<c.length;S++){let C=t[S],w=c[S];patch(C,w,C.el&&(C.type===Fragment||!isSameVNodeType(C,w)||C.shapeFlag&70)?E(C.el):u,null,d,m,g,b,!0)}},patchProps=(t,c,u,d,m)=>{if(c!==u){if(c!==EMPTY_OBJ)for(let b in c)!isReservedProp(b)&&!(b in u)&&g(t,b,c[b],null,m,d);for(let b in u){if(isReservedProp(b))continue;let S=u[b],C=c[b];S!==C&&b!==`value`&&g(t,b,C,S,m,d)}`value`in u&&g(t,`value`,c.value,u.value,m)}},processFragment=(t,c,u,m,g,b,C,w,T)=>{let E=c.el=t?t.el:S(``),D=c.anchor=t?t.anchor:S(``),{patchFlag:O,dynamicChildren:Or,slotScopeIds:kr}=c;process.env.NODE_ENV!==`production`&&(isHmrUpdating||O&2048)&&(O=0,T=!1,Or=null),kr&&(w=w?w.concat(kr):kr),t==null?(d(E,u,m),d(D,u,m),mountChildren(c.children||[],u,D,g,b,C,w,T)):O>0&&O&64&&Or&&t.dynamicChildren?(patchBlockChildren(t.dynamicChildren,Or,u,g,b,C,w),process.env.NODE_ENV===`production`?(c.key!=null||g&&c===g.subTree)&&traverseStaticChildren(t,c,!0):traverseStaticChildren(t,c)):patchChildren(t,c,u,D,g,b,C,w,T)},processComponent=(t,c,u,d,m,g,b,S,C)=>{c.slotScopeIds=S,t==null?c.shapeFlag&512?m.ctx.activate(c,u,d,b,C):mountComponent(c,u,d,m,g,b,C):updateComponent(t,c,C)},mountComponent=(t,c,u,d,m,g,b)=>{let S=t.component=createComponentInstance(t,d,m);process.env.NODE_ENV!==`production`&&S.type.__hmrId&&registerHMR(S),process.env.NODE_ENV!==`production`&&(pushWarningContext(t),startMeasure(S,`mount`)),isKeepAlive(t)&&(S.ctx.renderer=Ar),process.env.NODE_ENV!==`production`&&startMeasure(S,`init`),setupComponent(S,!1,b),process.env.NODE_ENV!==`production`&&endMeasure(S,`init`),S.asyncDep?(process.env.NODE_ENV!==`production`&&isHmrUpdating&&(t.el=null),m&&m.registerDep(S,setupRenderEffect,b),t.el||processCommentNode(null,S.subTree=createVNode(Comment),c,u)):setupRenderEffect(S,t,c,u,m,g,b),process.env.NODE_ENV!==`production`&&(popWarningContext(),endMeasure(S,`mount`))},updateComponent=(t,c,u)=>{let d=c.component=t.component;if(shouldUpdateComponent(t,c,u))if(d.asyncDep&&!d.asyncResolved){process.env.NODE_ENV!==`production`&&pushWarningContext(c),updateComponentPreRender(d,c,u),process.env.NODE_ENV!==`production`&&popWarningContext();return}else d.next=c,d.update();else c.el=t.el,d.vnode=c},setupRenderEffect=(t,c,u,d,m,g,b)=>{let componentUpdateFn=()=>{if(t.isMounted){let{next:c,bu:u,u:d,parent:S,vnode:C}=t;{let u=locateNonHydratedAsyncRoot(t);if(u){c&&(c.el=C.el,updateComponentPreRender(t,c,b)),u.asyncDep.then(()=>{t.isUnmounted||componentUpdateFn()});return}}let w=c,T;process.env.NODE_ENV!==`production`&&pushWarningContext(c||t.vnode),toggleRecurse(t,!1),c?(c.el=C.el,updateComponentPreRender(t,c,b)):c=C,u&&invokeArrayFns(u),(T=c.props&&c.props.onVnodeBeforeUpdate)&&invokeVNodeHook(T,S,c,C),toggleRecurse(t,!0),process.env.NODE_ENV!==`production`&&startMeasure(t,`render`);let D=renderComponentRoot(t);process.env.NODE_ENV!==`production`&&endMeasure(t,`render`);let O=t.subTree;t.subTree=D,process.env.NODE_ENV!==`production`&&startMeasure(t,`patch`),patch(O,D,E(O.el),getNextHostNode(O),t,m,g),process.env.NODE_ENV!==`production`&&endMeasure(t,`patch`),c.el=D.el,w===null&&updateHOCHostEl(t,D.el),d&&queuePostRenderEffect(d,m),(T=c.props&&c.props.onVnodeUpdated)&&queuePostRenderEffect(()=>invokeVNodeHook(T,S,c,C),m),process.env.NODE_ENV!==`production`&&devtoolsComponentUpdated(t),process.env.NODE_ENV!==`production`&&popWarningContext()}else{let b,{el:S,props:C}=c,{bm:w,m:T,parent:E,root:D,type:O}=t,Or=isAsyncWrapper(c);if(toggleRecurse(t,!1),w&&invokeArrayFns(w),!Or&&(b=C&&C.onVnodeBeforeMount)&&invokeVNodeHook(b,E,c),toggleRecurse(t,!0),S&&Mr){let hydrateSubTree=()=>{process.env.NODE_ENV!==`production`&&startMeasure(t,`render`),t.subTree=renderComponentRoot(t),process.env.NODE_ENV!==`production`&&endMeasure(t,`render`),process.env.NODE_ENV!==`production`&&startMeasure(t,`hydrate`),Mr(S,t.subTree,t,m,null),process.env.NODE_ENV!==`production`&&endMeasure(t,`hydrate`)};Or&&O.__asyncHydrate?O.__asyncHydrate(S,t,hydrateSubTree):hydrateSubTree()}else{D.ce&&D.ce._injectChildStyle(O),process.env.NODE_ENV!==`production`&&startMeasure(t,`render`);let b=t.subTree=renderComponentRoot(t);process.env.NODE_ENV!==`production`&&endMeasure(t,`render`),process.env.NODE_ENV!==`production`&&startMeasure(t,`patch`),patch(null,b,u,d,t,m,g),process.env.NODE_ENV!==`production`&&endMeasure(t,`patch`),c.el=b.el}if(T&&queuePostRenderEffect(T,m),!Or&&(b=C&&C.onVnodeMounted)){let t=c;queuePostRenderEffect(()=>invokeVNodeHook(b,E,t),m)}(c.shapeFlag&256||E&&isAsyncWrapper(E.vnode)&&E.vnode.shapeFlag&256)&&t.a&&queuePostRenderEffect(t.a,m),t.isMounted=!0,process.env.NODE_ENV!==`production`&&devtoolsComponentAdded(t),c=u=d=null}};t.scope.on();let S=t.effect=new ReactiveEffect(componentUpdateFn);t.scope.off();let C=t.update=S.run.bind(S),w=t.job=S.runIfDirty.bind(S);w.i=t,w.id=t.uid,S.scheduler=()=>queueJob(w),toggleRecurse(t,!0),process.env.NODE_ENV!==`production`&&(S.onTrack=t.rtc?c=>invokeArrayFns(t.rtc,c):void 0,S.onTrigger=t.rtg?c=>invokeArrayFns(t.rtg,c):void 0),C()},updateComponentPreRender=(t,c,u)=>{c.component=t;let d=t.vnode.props;t.vnode=c,t.next=null,updateProps(t,c.props,d,u),updateSlots(t,c.children,u),pauseTracking(),flushPreFlushCbs(t),resetTracking()},patchChildren=(t,c,u,d,m,g,b,S,C=!1)=>{let w=t&&t.children,E=t?t.shapeFlag:0,D=c.children,{patchFlag:O,shapeFlag:Or}=c;if(O>0){if(O&128){patchKeyedChildren(w,D,u,d,m,g,b,S,C);return}else if(O&256){patchUnkeyedChildren(w,D,u,d,m,g,b,S,C);return}}Or&8?(E&16&&unmountChildren(w,m,g),D!==w&&T(u,D)):E&16?Or&16?patchKeyedChildren(w,D,u,d,m,g,b,S,C):unmountChildren(w,m,g,!0):(E&8&&T(u,``),Or&16&&mountChildren(D,u,d,m,g,b,S,C))},patchUnkeyedChildren=(t,c,u,d,m,g,b,S,C)=>{t=t||EMPTY_ARR,c=c||EMPTY_ARR;let w=t.length,T=c.length,E=Math.min(w,T),D;for(D=0;D<E;D++){let d=c[D]=C?cloneIfMounted(c[D]):normalizeVNode(c[D]);patch(t[D],d,u,null,m,g,b,S,C)}w>T?unmountChildren(t,m,g,!0,!1,E):mountChildren(c,u,d,m,g,b,S,C,E)},patchKeyedChildren=(t,c,u,d,m,g,b,S,C)=>{let w=0,T=c.length,E=t.length-1,D=T-1;for(;w<=E&&w<=D;){let d=t[w],T=c[w]=C?cloneIfMounted(c[w]):normalizeVNode(c[w]);if(isSameVNodeType(d,T))patch(d,T,u,null,m,g,b,S,C);else break;w++}for(;w<=E&&w<=D;){let d=t[E],w=c[D]=C?cloneIfMounted(c[D]):normalizeVNode(c[D]);if(isSameVNodeType(d,w))patch(d,w,u,null,m,g,b,S,C);else break;E--,D--}if(w>E){if(w<=D){let t=D+1,E=t<T?c[t].el:d;for(;w<=D;)patch(null,c[w]=C?cloneIfMounted(c[w]):normalizeVNode(c[w]),u,E,m,g,b,S,C),w++}}else if(w>D)for(;w<=E;)unmount(t[w],m,g,!0),w++;else{let O=w,Or=w,kr=new Map;for(w=Or;w<=D;w++){let t=c[w]=C?cloneIfMounted(c[w]):normalizeVNode(c[w]);t.key!=null&&(process.env.NODE_ENV!==`production`&&kr.has(t.key)&&warn$1(`Duplicate keys found during update:`,JSON.stringify(t.key),`Make sure keys are unique.`),kr.set(t.key,w))}let Ar,jr=0,Mr=D-Or+1,Nr=!1,Pr=0,Fr=Array(Mr);for(w=0;w<Mr;w++)Fr[w]=0;for(w=O;w<=E;w++){let d=t[w];if(jr>=Mr){unmount(d,m,g,!0);continue}let T;if(d.key!=null)T=kr.get(d.key);else for(Ar=Or;Ar<=D;Ar++)if(Fr[Ar-Or]===0&&isSameVNodeType(d,c[Ar])){T=Ar;break}T===void 0?unmount(d,m,g,!0):(Fr[T-Or]=w+1,T>=Pr?Pr=T:Nr=!0,patch(d,c[T],u,null,m,g,b,S,C),jr++)}let Ir=Nr?getSequence(Fr):EMPTY_ARR;for(Ar=Ir.length-1,w=Mr-1;w>=0;w--){let t=Or+w,E=c[t],D=t+1<T?c[t+1].el:d;Fr[w]===0?patch(null,E,u,D,m,g,b,S,C):Nr&&(Ar<0||w!==Ir[Ar]?move(E,u,D,2):Ar--)}}},move=(t,c,u,m,g=null)=>{let{el:b,type:S,transition:C,children:w,shapeFlag:T}=t;if(T&6){move(t.component.subTree,c,u,m);return}if(T&128){t.suspense.move(c,u,m);return}if(T&64){S.move(t,c,u,Ar);return}if(S===Fragment){d(b,c,u);for(let t=0;t<w.length;t++)move(w[t],c,u,m);d(t.anchor,c,u);return}if(S===Static){moveStaticNode(t,c,u);return}if(m!==2&&T&1&&C)if(m===0)C.beforeEnter(b),d(b,c,u),queuePostRenderEffect(()=>C.enter(b),g);else{let{leave:t,delayLeave:m,afterLeave:g}=C,remove2=()=>d(b,c,u),performLeave=()=>{t(b,()=>{remove2(),g&&g()})};m?m(b,remove2,performLeave):performLeave()}else d(b,c,u)},unmount=(t,c,u,d=!1,m=!1)=>{let{type:g,props:b,ref:S,children:C,dynamicChildren:w,shapeFlag:T,patchFlag:E,dirs:D,cacheIndex:O}=t;if(E===-2&&(m=!1),S!=null&&setRef(S,null,u,t,!0),O!=null&&(c.renderCache[O]=void 0),T&256){c.ctx.deactivate(t);return}let Or=T&1&&D,kr=!isAsyncWrapper(t),jr;if(kr&&(jr=b&&b.onVnodeBeforeUnmount)&&invokeVNodeHook(jr,c,t),T&6)unmountComponent(t.component,u,d);else{if(T&128){t.suspense.unmount(u,d);return}Or&&invokeDirectiveHook(t,null,c,`beforeUnmount`),T&64?t.type.remove(t,c,u,Ar,d):w&&!w.hasOnce&&(g!==Fragment||E>0&&E&64)?unmountChildren(w,c,u,!1,!0):(g===Fragment&&E&384||!m&&T&16)&&unmountChildren(C,c,u),d&&remove(t)}(kr&&(jr=b&&b.onVnodeUnmounted)||Or)&&queuePostRenderEffect(()=>{jr&&invokeVNodeHook(jr,c,t),Or&&invokeDirectiveHook(t,null,c,`unmounted`)},u)},remove=t=>{let{type:c,el:u,anchor:d,transition:g}=t;if(c===Fragment){process.env.NODE_ENV!==`production`&&t.patchFlag>0&&t.patchFlag&2048&&g&&!g.persisted?t.children.forEach(t=>{t.type===Comment?m(t.el):remove(t)}):removeFragment(u,d);return}if(c===Static){removeStaticNode(t);return}let performRemove=()=>{m(u),g&&!g.persisted&&g.afterLeave&&g.afterLeave()};if(t.shapeFlag&1&&g&&!g.persisted){let{leave:c,delayLeave:d}=g,performLeave=()=>c(u,performRemove);d?d(t.el,performRemove,performLeave):performLeave()}else performRemove()},removeFragment=(t,c)=>{let u;for(;t!==c;)u=D(t),m(t),t=u;m(c)},unmountComponent=(t,c,u)=>{process.env.NODE_ENV!==`production`&&t.type.__hmrId&&unregisterHMR(t);let{bum:d,scope:m,job:g,subTree:b,um:S,m:C,a:w}=t;invalidateMount(C),invalidateMount(w),d&&invokeArrayFns(d),m.stop(),g&&(g.flags|=8,unmount(b,t,c,u)),S&&queuePostRenderEffect(S,c),queuePostRenderEffect(()=>{t.isUnmounted=!0},c),c&&c.pendingBranch&&!c.isUnmounted&&t.asyncDep&&!t.asyncResolved&&t.suspenseId===c.pendingId&&(c.deps--,c.deps===0&&c.resolve()),process.env.NODE_ENV!==`production`&&devtoolsComponentRemoved(t)},unmountChildren=(t,c,u,d=!1,m=!1,g=0)=>{for(let b=g;b<t.length;b++)unmount(t[b],c,u,d,m)},getNextHostNode=t=>{if(t.shapeFlag&6)return getNextHostNode(t.component.subTree);if(t.shapeFlag&128)return t.suspense.next();let c=D(t.anchor||t.el),u=c&&c[TeleportEndKey];return u?D(u):c},kr=!1,render=(t,c,u)=>{t==null?c._vnode&&unmount(c._vnode,null,null,!0):patch(c._vnode||null,t,c,null,null,null,u),c._vnode=t,kr||(kr=!0,flushPreFlushCbs(),flushPostFlushCbs(),kr=!1)},Ar={p:patch,um:unmount,m:move,r:remove,mt:mountComponent,mc:mountChildren,pc:patchChildren,pbc:patchBlockChildren,n:getNextHostNode,o:t},jr,Mr;return c&&([jr,Mr]=c(Ar)),{render,hydrate:jr,createApp:createAppAPI(render,jr)}}function resolveChildrenNamespace({type:t,props:c},u){return u===`svg`&&t===`foreignObject`||u===`mathml`&&t===`annotation-xml`&&c&&c.encoding&&c.encoding.includes(`html`)?void 0:u}function toggleRecurse({effect:t,job:c},u){u?(t.flags|=32,c.flags|=4):(t.flags&=-33,c.flags&=-5)}function needTransition(t,c){return(!t||t&&!t.pendingBranch)&&c&&!c.persisted}function traverseStaticChildren(t,c,u=!1){let d=t.children,m=c.children;if(isArray$3(d)&&isArray$3(m))for(let t=0;t<d.length;t++){let c=d[t],g=m[t];g.shapeFlag&1&&!g.dynamicChildren&&((g.patchFlag<=0||g.patchFlag===32)&&(g=m[t]=cloneIfMounted(m[t]),g.el=c.el),!u&&g.patchFlag!==-2&&traverseStaticChildren(c,g)),g.type===Text&&(g.el=c.el),process.env.NODE_ENV!==`production`&&g.type===Comment&&!g.el&&(g.el=c.el)}}function getSequence(t){let c=t.slice(),u=[0],d,m,g,b,S,C=t.length;for(d=0;d<C;d++){let C=t[d];if(C!==0){if(m=u[u.length-1],t[m]<C){c[d]=m,u.push(d);continue}for(g=0,b=u.length-1;g<b;)S=g+b>>1,t[u[S]]<C?g=S+1:b=S;C<t[u[g]]&&(g>0&&(c[d]=u[g-1]),u[g]=d)}}for(g=u.length,b=u[g-1];g-- >0;)u[g]=b,b=c[b];return u}function locateNonHydratedAsyncRoot(t){let c=t.subTree.component;if(c)return c.asyncDep&&!c.asyncResolved?c:locateNonHydratedAsyncRoot(c)}function invalidateMount(t){if(t)for(let c=0;c<t.length;c++)t[c].flags|=8}function watchEffect(t,c){return doWatch(t,null,c)}function watchPostEffect(t,c){return doWatch(t,null,process.env.NODE_ENV===`production`?{flush:`post`}:extend$2({},c,{flush:`post`}))}function watchSyncEffect(t,c){return doWatch(t,null,process.env.NODE_ENV===`production`?{flush:`sync`}:extend$2({},c,{flush:`sync`}))}function watch(t,c,u){return process.env.NODE_ENV!==`production`&&!isFunction$1(c)&&warn$1("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."),doWatch(t,c,u)}function doWatch(t,c,u=EMPTY_OBJ){let{immediate:d,deep:m,flush:g,once:b}=u;process.env.NODE_ENV!==`production`&&!c&&(d!==void 0&&warn$1(`watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`),m!==void 0&&warn$1(`watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`),b!==void 0&&warn$1(`watch() "once" option is only respected when using the watch(source, callback, options?) signature.`));let S=extend$2({},u);process.env.NODE_ENV!==`production`&&(S.onWarn=warn$1);let C=c&&d||!c&&g!==`post`,w;if(isInSSRComponentSetup){if(g===`sync`){let t=useSSRContext();w=t.__watcherHandles||(t.__watcherHandles=[])}else if(!C){let watchStopHandle=()=>{};return watchStopHandle.stop=NOOP,watchStopHandle.resume=NOOP,watchStopHandle.pause=NOOP,watchStopHandle}}let T=currentInstance;S.call=(t,c,u)=>callWithAsyncErrorHandling(t,T,c,u);let E=!1;g===`post`?S.scheduler=t=>{queuePostRenderEffect(t,T&&T.suspense)}:g!==`sync`&&(E=!0,S.scheduler=(t,c)=>{c?t():queueJob(t)}),S.augmentJob=t=>{c&&(t.flags|=4),E&&(t.flags|=2,T&&(t.id=T.uid,t.i=T))};let D=watch$1(t,c,S);return isInSSRComponentSetup&&(w?w.push(D):C&&D()),D}function instanceWatch(t,c,u){let d=this.proxy,m=isString$1(t)?t.includes(`.`)?createPathGetter(d,t):()=>d[t]:t.bind(d,d),g;isFunction$1(c)?g=c:(g=c.handler,u=c);let b=setCurrentInstance(this),S=doWatch(m,g.bind(d),u);return b(),S}function createPathGetter(t,c){let u=c.split(`.`);return()=>{let c=t;for(let t=0;t<u.length&&c;t++)c=c[u[t]];return c}}function useModel(t,c,u=EMPTY_OBJ){let d=getCurrentInstance();if(process.env.NODE_ENV!==`production`&&!d)return warn$1(`useModel() called without active instance.`),ref();let m=camelize(c);if(process.env.NODE_ENV!==`production`&&!d.propsOptions[0][m])return warn$1(`useModel() called with prop "${c}" which is not declared.`),ref();let g=hyphenate(c),b=getModelModifiers(t,m),S=customRef((b,S)=>{let C,w=EMPTY_OBJ,T;return watchSyncEffect(()=>{let c=t[m];hasChanged(C,c)&&(C=c,S())}),{get(){return b(),u.get?u.get(C):C},set(t){let b=u.set?u.set(t):t;if(!hasChanged(b,C)&&!(w!==EMPTY_OBJ&&hasChanged(t,w)))return;let E=d.vnode.props;E&&(c in E||m in E||g in E)&&(`onUpdate:${c}`in E||`onUpdate:${m}`in E||`onUpdate:${g}`in E)||(C=t,S()),d.emit(`update:${c}`,b),hasChanged(t,b)&&hasChanged(t,w)&&!hasChanged(b,T)&&S(),w=t,T=b}}});return S[Symbol.iterator]=()=>{let t=0;return{next(){return t<2?{value:t++?b||EMPTY_OBJ:S,done:!1}:{done:!0}}}},S}function emit(t,c,...u){if(t.isUnmounted)return;let d=t.vnode.props||EMPTY_OBJ;if(process.env.NODE_ENV!==`production`){let{emitsOptions:d,propsOptions:[m]}=t;if(d)if(!(c in d))(!m||!(toHandlerKey(camelize(c))in m))&&warn$1(`Component emitted event "${c}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize(c))}" prop.`);else{let t=d[c];isFunction$1(t)&&(t(...u)||warn$1(`Invalid event arguments: event validation failed for event "${c}".`))}}let m=u,g=c.startsWith(`update:`),b=g&&getModelModifiers(d,c.slice(7));if(b&&(b.trim&&(m=u.map(t=>isString$1(t)?t.trim():t)),b.number&&(m=u.map(looseToNumber))),process.env.NODE_ENV!==`production`&&devtoolsComponentEmit(t,c,m),process.env.NODE_ENV!==`production`){let u=c.toLowerCase();u!==c&&d[toHandlerKey(u)]&&warn$1(`Event "${u}" is emitted in component ${formatComponentName(t,t.type)} but the handler is registered for "${c}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${hyphenate(c)}" instead of "${c}".`)}let S,C=d[S=toHandlerKey(c)]||d[S=toHandlerKey(camelize(c))];!C&&g&&(C=d[S=toHandlerKey(hyphenate(c))]),C&&callWithAsyncErrorHandling(C,t,6,m);let w=d[S+`Once`];if(w){if(!t.emitted)t.emitted={};else if(t.emitted[S])return;t.emitted[S]=!0,callWithAsyncErrorHandling(w,t,6,m)}}function normalizeEmitsOptions(t,c,u=!1){let d=c.emitsCache,m=d.get(t);if(m!==void 0)return m;let g=t.emits,b={},S=!1;if(!isFunction$1(t)){let extendEmits=t=>{let u=normalizeEmitsOptions(t,c,!0);u&&(S=!0,extend$2(b,u))};!u&&c.mixins.length&&c.mixins.forEach(extendEmits),t.extends&&extendEmits(t.extends),t.mixins&&t.mixins.forEach(extendEmits)}return!g&&!S?(isObject$1(t)&&d.set(t,null),null):(isArray$3(g)?g.forEach(t=>b[t]=null):extend$2(b,g),isObject$1(t)&&d.set(t,b),b)}function isEmitListener(t,c){return!t||!isOn(c)?!1:(c=c.slice(2).replace(/Once$/,``),hasOwn(t,c[0].toLowerCase()+c.slice(1))||hasOwn(t,hyphenate(c))||hasOwn(t,c))}function markAttrsAccessed(){accessedAttrs=!0}function renderComponentRoot(t){let{type:c,vnode:u,proxy:d,withProxy:m,propsOptions:[g],slots:b,attrs:S,emit:C,render:w,renderCache:T,props:E,data:D,setupState:O,ctx:Or,inheritAttrs:kr}=t,Ar=setCurrentRenderingInstance(t),jr,Mr;process.env.NODE_ENV!==`production`&&(accessedAttrs=!1);try{if(u.shapeFlag&4){let t=m||d,c=process.env.NODE_ENV!==`production`&&O.__isScriptSetup?new Proxy(t,{get(t,c,u){return warn$1(`Property '${String(c)}' was accessed via 'this'. Avoid using 'this' in templates.`),Reflect.get(t,c,u)}}):t;jr=normalizeVNode(w.call(c,t,T,process.env.NODE_ENV===`production`?E:shallowReadonly(E),O,D,Or)),Mr=S}else{let t=c;process.env.NODE_ENV!==`production`&&S===E&&markAttrsAccessed(),jr=normalizeVNode(t.length>1?t(process.env.NODE_ENV===`production`?E:shallowReadonly(E),process.env.NODE_ENV===`production`?{attrs:S,slots:b,emit:C}:{get attrs(){return markAttrsAccessed(),shallowReadonly(S)},slots:b,emit:C}):t(process.env.NODE_ENV===`production`?E:shallowReadonly(E),null)),Mr=c.props?S:getFunctionalFallthrough(S)}}catch(c){blockStack.length=0,handleError(c,t,1),jr=createVNode(Comment)}let Nr=jr,Pr;if(process.env.NODE_ENV!==`production`&&jr.patchFlag>0&&jr.patchFlag&2048&&([Nr,Pr]=getChildRoot(jr)),Mr&&kr!==!1){let t=Object.keys(Mr),{shapeFlag:c}=Nr;if(t.length){if(c&7)g&&t.some(isModelListener)&&(Mr=filterModelListeners(Mr,g)),Nr=cloneVNode(Nr,Mr,!1,!0);else if(process.env.NODE_ENV!==`production`&&!accessedAttrs&&Nr.type!==Comment){let t=Object.keys(S),c=[],u=[];for(let d=0,m=t.length;d<m;d++){let m=t[d];isOn(m)?isModelListener(m)||c.push(m[2].toLowerCase()+m.slice(3)):u.push(m)}u.length&&warn$1(`Extraneous non-props attributes (${u.join(`, `)}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.`),c.length&&warn$1(`Extraneous non-emits event listeners (${c.join(`, `)}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`)}}}return u.dirs&&(process.env.NODE_ENV!==`production`&&!isElementRoot(Nr)&&warn$1(`Runtime directive used on component with non-element root node. The directives will not function as intended.`),Nr=cloneVNode(Nr,null,!1,!0),Nr.dirs=Nr.dirs?Nr.dirs.concat(u.dirs):u.dirs),u.transition&&(process.env.NODE_ENV!==`production`&&!isElementRoot(Nr)&&warn$1(`Component inside <Transition> renders non-element root node that cannot be animated.`),setTransitionHooks(Nr,u.transition)),process.env.NODE_ENV!==`production`&&Pr?Pr(Nr):jr=Nr,setCurrentRenderingInstance(Ar),jr}function filterSingleRoot(t,c=!0){let u;for(let d=0;d<t.length;d++){let m=t[d];if(isVNode(m)){if(m.type!==Comment||m.children===`v-if`){if(u)return;if(u=m,process.env.NODE_ENV!==`production`&&c&&u.patchFlag>0&&u.patchFlag&2048)return filterSingleRoot(u.children)}}else return}return u}function shouldUpdateComponent(t,c,u){let{props:d,children:m,component:g}=t,{props:b,children:S,patchFlag:C}=c,w=g.emitsOptions;if(process.env.NODE_ENV!==`production`&&(m||S)&&isHmrUpdating||c.dirs||c.transition)return!0;if(u&&C>=0){if(C&1024)return!0;if(C&16)return d?hasPropsChanged(d,b,w):!!b;if(C&8){let t=c.dynamicProps;for(let c=0;c<t.length;c++){let u=t[c];if(b[u]!==d[u]&&!isEmitListener(w,u))return!0}}}else return(m||S)&&(!S||!S.$stable)?!0:d===b?!1:d?b?hasPropsChanged(d,b,w):!0:!!b;return!1}function hasPropsChanged(t,c,u){let d=Object.keys(c);if(d.length!==Object.keys(t).length)return!0;for(let m=0;m<d.length;m++){let g=d[m];if(c[g]!==t[g]&&!isEmitListener(u,g))return!0}return!1}function updateHOCHostEl({vnode:t,parent:c},u){for(;c;){let d=c.subTree;if(d.suspense&&d.suspense.activeBranch===t&&(d.el=t.el),d===t)(t=c.vnode).el=u,c=c.parent;else break}}function triggerEvent(t,c){let u=t.props&&t.props[c];isFunction$1(u)&&u()}function mountSuspense(t,c,u,d,m,g,b,S,C){let{p:w,o:{createElement:T}}=C,E=T(`div`),D=t.suspense=createSuspenseBoundary(t,m,d,c,E,u,g,b,S,C);w(null,D.pendingBranch=t.ssContent,E,null,d,D,g,b),D.deps>0?(triggerEvent(t,`onPending`),triggerEvent(t,`onFallback`),w(null,t.ssFallback,c,u,d,null,g,b),setActiveBranch(D,t.ssFallback)):D.resolve(!1,!0)}function patchSuspense(t,c,u,d,m,g,b,S,{p:C,um:w,o:{createElement:T}}){let E=c.suspense=t.suspense;E.vnode=c,c.el=t.el;let D=c.ssContent,O=c.ssFallback,{activeBranch:Or,pendingBranch:kr,isInFallback:Ar,isHydrating:jr}=E;if(kr)E.pendingBranch=D,isSameVNodeType(D,kr)?(C(kr,D,E.hiddenContainer,null,m,E,g,b,S),E.deps<=0?E.resolve():Ar&&(jr||(C(Or,O,u,d,m,null,g,b,S),setActiveBranch(E,O)))):(E.pendingId=suspenseId++,jr?(E.isHydrating=!1,E.activeBranch=kr):w(kr,m,E),E.deps=0,E.effects.length=0,E.hiddenContainer=T(`div`),Ar?(C(null,D,E.hiddenContainer,null,m,E,g,b,S),E.deps<=0?E.resolve():(C(Or,O,u,d,m,null,g,b,S),setActiveBranch(E,O))):Or&&isSameVNodeType(D,Or)?(C(Or,D,u,d,m,E,g,b,S),E.resolve(!0)):(C(null,D,E.hiddenContainer,null,m,E,g,b,S),E.deps<=0&&E.resolve()));else if(Or&&isSameVNodeType(D,Or))C(Or,D,u,d,m,E,g,b,S),setActiveBranch(E,D);else if(triggerEvent(c,`onPending`),E.pendingBranch=D,D.shapeFlag&512?E.pendingId=D.component.suspenseId:E.pendingId=suspenseId++,C(null,D,E.hiddenContainer,null,m,E,g,b,S),E.deps<=0)E.resolve();else{let{timeout:t,pendingId:c}=E;t>0?setTimeout(()=>{E.pendingId===c&&E.fallback(O)},t):t===0&&E.fallback(O)}}function createSuspenseBoundary(t,c,u,d,m,g,b,S,C,w,T=!1){process.env.NODE_ENV!==`production`&&!hasWarned&&(hasWarned=!0,console[console.info?`info`:`log`](`<Suspense> is an experimental feature and its API will likely change.`));let{p:E,m:D,um:O,n:Or,o:{parentNode:kr,remove:Ar}}=w,jr,Mr=isVNodeSuspensible(t);Mr&&c&&c.pendingBranch&&(jr=c.pendingId,c.deps++);let Nr=t.props?toNumber(t.props.timeout):void 0;process.env.NODE_ENV!==`production`&&assertNumber(Nr,`Suspense timeout`);let Pr=g,Fr={vnode:t,parent:c,parentComponent:u,namespace:b,container:d,hiddenContainer:m,deps:0,pendingId:suspenseId++,timeout:typeof Nr==`number`?Nr:-1,activeBranch:null,pendingBranch:null,isInFallback:!T,isHydrating:T,isUnmounted:!1,effects:[],resolve(t=!1,u=!1){if(process.env.NODE_ENV!==`production`){if(!t&&!Fr.pendingBranch)throw Error(`suspense.resolve() is called without a pending branch.`);if(Fr.isUnmounted)throw Error(`suspense.resolve() is called on an already unmounted suspense boundary.`)}let{vnode:d,activeBranch:m,pendingBranch:b,pendingId:S,effects:C,parentComponent:w,container:T}=Fr,E=!1;Fr.isHydrating?Fr.isHydrating=!1:t||(E=m&&b.transition&&b.transition.mode===`out-in`,E&&(m.transition.afterLeave=()=>{S===Fr.pendingId&&(D(b,T,g===Pr?Or(m):g,0),queuePostFlushCb(C))}),m&&(kr(m.el)===T&&(g=Or(m)),O(m,w,Fr,!0)),E||D(b,T,g,0)),setActiveBranch(Fr,b),Fr.pendingBranch=null,Fr.isInFallback=!1;let Ar=Fr.parent,Nr=!1;for(;Ar;){if(Ar.pendingBranch){Ar.effects.push(...C),Nr=!0;break}Ar=Ar.parent}!Nr&&!E&&queuePostFlushCb(C),Fr.effects=[],Mr&&c&&c.pendingBranch&&jr===c.pendingId&&(c.deps--,c.deps===0&&!u&&c.resolve()),triggerEvent(d,`onResolve`)},fallback(t){if(!Fr.pendingBranch)return;let{vnode:c,activeBranch:u,parentComponent:d,container:m,namespace:g}=Fr;triggerEvent(c,`onFallback`);let b=Or(u),mountFallback=()=>{Fr.isInFallback&&(E(null,t,m,b,d,null,g,S,C),setActiveBranch(Fr,t))},w=t.transition&&t.transition.mode===`out-in`;w&&(u.transition.afterLeave=mountFallback),Fr.isInFallback=!0,O(u,d,null,!0),w||mountFallback()},move(t,c,u){Fr.activeBranch&&D(Fr.activeBranch,t,c,u),Fr.container=t},next(){return Fr.activeBranch&&Or(Fr.activeBranch)},registerDep(t,c,u){let d=!!Fr.pendingBranch;d&&Fr.deps++;let m=t.vnode.el;t.asyncDep.catch(c=>{handleError(c,t,0)}).then(g=>{if(t.isUnmounted||Fr.isUnmounted||Fr.pendingId!==t.suspenseId)return;t.asyncResolved=!0;let{vnode:S}=t;process.env.NODE_ENV!==`production`&&pushWarningContext(S),handleSetupResult(t,g,!1),m&&(S.el=m);let C=!m&&t.subTree.el;c(t,S,kr(m||t.subTree.el),m?null:Or(t.subTree),Fr,b,u),C&&Ar(C),updateHOCHostEl(t,S.el),process.env.NODE_ENV!==`production`&&popWarningContext(),d&&--Fr.deps===0&&Fr.resolve()})},unmount(t,c){Fr.isUnmounted=!0,Fr.activeBranch&&O(Fr.activeBranch,u,t,c),Fr.pendingBranch&&O(Fr.pendingBranch,u,t,c)}};return Fr}function hydrateSuspense(t,c,u,d,m,g,b,S,C){let w=c.suspense=createSuspenseBoundary(c,d,u,t.parentNode,document.createElement(`div`),null,m,g,b,S,!0),T=C(t,w.pendingBranch=c.ssContent,u,w,g,b);return w.deps===0&&w.resolve(!1,!0),T}function normalizeSuspenseChildren(t){let{shapeFlag:c,children:u}=t,d=c&32;t.ssContent=normalizeSuspenseSlot(d?u.default:u),t.ssFallback=d?normalizeSuspenseSlot(u.fallback):createVNode(Comment)}function normalizeSuspenseSlot(t){let c;if(isFunction$1(t)){let u=isBlockTreeEnabled&&t._c;u&&(t._d=!1,openBlock()),t=t(),u&&(t._d=!0,c=currentBlock,closeBlock())}if(isArray$3(t)){let c=filterSingleRoot(t);process.env.NODE_ENV!==`production`&&!c&&t.filter(t=>t!==NULL_DYNAMIC_COMPONENT).length>0&&warn$1(`<Suspense> slots expect a single root node.`),t=c}return t=normalizeVNode(t),c&&!t.dynamicChildren&&(t.dynamicChildren=c.filter(c=>c!==t)),t}function queueEffectWithSuspense(t,c){c&&c.pendingBranch?isArray$3(t)?c.effects.push(...t):c.effects.push(t):queuePostFlushCb(t)}function setActiveBranch(t,c){t.activeBranch=c;let{vnode:u,parentComponent:d}=t,m=c.el;for(;!m&&c.component;)c=c.component.subTree,m=c.el;u.el=m,d&&d.subTree===u&&(d.vnode.el=m,updateHOCHostEl(d,m))}function isVNodeSuspensible(t){let c=t.props&&t.props.suspensible;return c!=null&&c!==!1}function openBlock(t=!1){blockStack.push(currentBlock=t?null:[])}function closeBlock(){blockStack.pop(),currentBlock=blockStack[blockStack.length-1]||null}function setBlockTracking(t,c=!1){isBlockTreeEnabled+=t,t<0&&currentBlock&&c&&(currentBlock.hasOnce=!0)}function setupBlock(t){return t.dynamicChildren=isBlockTreeEnabled>0?currentBlock||EMPTY_ARR:null,closeBlock(),isBlockTreeEnabled>0&&currentBlock&&currentBlock.push(t),t}function createElementBlock(t,c,u,d,m,g){return setupBlock(createBaseVNode(t,c,u,d,m,g,!0))}function createBlock(t,c,u,d,m){return setupBlock(createVNode(t,c,u,d,m,!0))}function isVNode(t){return t?t.__v_isVNode===!0:!1}function isSameVNodeType(t,c){if(process.env.NODE_ENV!==`production`&&c.shapeFlag&6&&t.component){let u=hmrDirtyComponents.get(c.type);if(u&&u.has(t.component))return t.shapeFlag&=-257,c.shapeFlag&=-513,!1}return t.type===c.type&&t.key===c.key}function transformVNodeArgs(t){vnodeArgsTransformer=t}function createBaseVNode(t,c=null,u=null,d=0,m=null,g=t===Fragment?0:1,b=!1,S=!1){let C={__v_isVNode:!0,__v_skip:!0,type:t,props:c,key:c&&normalizeKey$2(c),ref:c&&normalizeRef(c),scopeId:currentScopeId,slotScopeIds:null,children:u,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:g,patchFlag:d,dynamicProps:m,dynamicChildren:null,appContext:null,ctx:currentRenderingInstance};return S?(normalizeChildren(C,u),g&128&&t.normalize(C)):u&&(C.shapeFlag|=isString$1(u)?8:16),process.env.NODE_ENV!==`production`&&C.key!==C.key&&warn$1(`VNode created with invalid key (NaN). VNode type:`,C.type),isBlockTreeEnabled>0&&!b&&currentBlock&&(C.patchFlag>0||g&6)&&C.patchFlag!==32&&currentBlock.push(C),C}function _createVNode(t,c=null,u=null,d=0,m=null,g=!1){if((!t||t===NULL_DYNAMIC_COMPONENT)&&(process.env.NODE_ENV!==`production`&&!t&&warn$1(`Invalid vnode type when creating vnode: ${t}.`),t=Comment),isVNode(t)){let d=cloneVNode(t,c,!0);return u&&normalizeChildren(d,u),isBlockTreeEnabled>0&&!g&&currentBlock&&(d.shapeFlag&6?currentBlock[currentBlock.indexOf(t)]=d:currentBlock.push(d)),d.patchFlag=-2,d}if(isClassComponent(t)&&(t=t.__vccOpts),c){c=guardReactiveProps(c);let{class:t,style:u}=c;t&&!isString$1(t)&&(c.class=normalizeClass(t)),isObject$1(u)&&(isProxy(u)&&!isArray$3(u)&&(u=extend$2({},u)),c.style=normalizeStyle(u))}let b=isString$1(t)?1:isSuspense(t)?128:isTeleport(t)?64:isObject$1(t)?4:isFunction$1(t)?2:0;return process.env.NODE_ENV!==`production`&&b&4&&isProxy(t)&&(t=toRaw(t),warn$1("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
25
- Component that was made reactive: `,t)),createBaseVNode(t,c,u,d,m,b,g,!0)}function guardReactiveProps(t){return t?isProxy(t)||isInternalObject(t)?extend$2({},t):t:null}function cloneVNode(t,c,u=!1,d=!1){let{props:m,ref:g,patchFlag:b,children:S,transition:C}=t,w=c?mergeProps(m||{},c):m,T={__v_isVNode:!0,__v_skip:!0,type:t.type,props:w,key:w&&normalizeKey$2(w),ref:c&&c.ref?u&&g?isArray$3(g)?g.concat(normalizeRef(c)):[g,normalizeRef(c)]:normalizeRef(c):g,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:process.env.NODE_ENV!==`production`&&b===-1&&isArray$3(S)?S.map(deepCloneVNode):S,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:c&&t.type!==Fragment?b===-1?16:b|16:b,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:C,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&cloneVNode(t.ssContent),ssFallback:t.ssFallback&&cloneVNode(t.ssFallback),el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return C&&d&&setTransitionHooks(T,C.clone(T)),T}function deepCloneVNode(t){let c=cloneVNode(t);return isArray$3(t.children)&&(c.children=t.children.map(deepCloneVNode)),c}function createTextVNode(t=` `,c=0){return createVNode(Text,null,t,c)}function createStaticVNode(t,c){let u=createVNode(Static,null,t);return u.staticCount=c,u}function createCommentVNode(t=``,c=!1){return c?(openBlock(),createBlock(Comment,null,t)):createVNode(Comment,null,t)}function normalizeVNode(t){return t==null||typeof t==`boolean`?createVNode(Comment):isArray$3(t)?createVNode(Fragment,null,t.slice()):isVNode(t)?cloneIfMounted(t):createVNode(Text,null,String(t))}function cloneIfMounted(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:cloneVNode(t)}function normalizeChildren(t,c){let u=0,{shapeFlag:d}=t;if(c==null)c=null;else if(isArray$3(c))u=16;else if(typeof c==`object`)if(d&65){let u=c.default;u&&(u._c&&(u._d=!1),normalizeChildren(t,u()),u._c&&(u._d=!0));return}else{u=32;let d=c._;!d&&!isInternalObject(c)?c._ctx=currentRenderingInstance:d===3&&currentRenderingInstance&&(currentRenderingInstance.slots._===1?c._=1:(c._=2,t.patchFlag|=1024))}else isFunction$1(c)?(c={default:c,_ctx:currentRenderingInstance},u=32):(c=String(c),d&64?(u=16,c=[createTextVNode(c)]):u=8);t.children=c,t.shapeFlag|=u}function mergeProps(...t){let c={};for(let u=0;u<t.length;u++){let d=t[u];for(let t in d)if(t===`class`)c.class!==d.class&&(c.class=normalizeClass([c.class,d.class]));else if(t===`style`)c.style=normalizeStyle([c.style,d.style]);else if(isOn(t)){let u=c[t],m=d[t];m&&u!==m&&!(isArray$3(u)&&u.includes(m))&&(c[t]=u?[].concat(u,m):m)}else t!==``&&(c[t]=d[t])}return c}function invokeVNodeHook(t,c,u,d=null){callWithAsyncErrorHandling(t,c,7,[u,d])}function createComponentInstance(t,c,u){let d=t.type,m=(c?c.appContext:t.appContext)||emptyAppContext,g={uid:uid++,vnode:t,type:d,parent:c,appContext:m,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new EffectScope(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:c?c.provides:Object.create(m.provides),ids:c?c.ids:[``,0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:normalizePropsOptions(d,m),emitsOptions:normalizeEmitsOptions(d,m),emit:null,emitted:null,propsDefaults:EMPTY_OBJ,inheritAttrs:d.inheritAttrs,ctx:EMPTY_OBJ,data:EMPTY_OBJ,props:EMPTY_OBJ,attrs:EMPTY_OBJ,slots:EMPTY_OBJ,refs:EMPTY_OBJ,setupState:EMPTY_OBJ,setupContext:null,suspense:u,suspenseId:u?u.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return process.env.NODE_ENV===`production`?g.ctx={_:g}:g.ctx=createDevRenderContext(g),g.root=c?c.root:g,g.emit=emit.bind(null,g),t.ce&&t.ce(g),g}function validateComponentName(t,{isNativeTag:c}){(isBuiltInTag(t)||c(t))&&warn$1(`Do not use built-in or reserved HTML elements as component id: `+t)}function isStatefulComponent(t){return t.vnode.shapeFlag&4}function setupComponent(t,c=!1,u=!1){c&&setInSSRSetupState(c);let{props:d,children:m}=t.vnode,g=isStatefulComponent(t);initProps(t,d,g,c),initSlots(t,m,u);let b=g?setupStatefulComponent(t,c):void 0;return c&&setInSSRSetupState(!1),b}function setupStatefulComponent(t,c){var u;let d=t.type;if(process.env.NODE_ENV!==`production`){if(d.name&&validateComponentName(d.name,t.appContext.config),d.components){let c=Object.keys(d.components);for(let u=0;u<c.length;u++)validateComponentName(c[u],t.appContext.config)}if(d.directives){let t=Object.keys(d.directives);for(let c=0;c<t.length;c++)validateDirectiveName(t[c])}d.compilerOptions&&isRuntimeOnly()&&warn$1(`"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.`)}t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,PublicInstanceProxyHandlers),process.env.NODE_ENV!==`production`&&exposePropsOnRenderContext(t);let{setup:m}=d;if(m){pauseTracking();let u=t.setupContext=m.length>1?createSetupContext(t):null,g=setCurrentInstance(t),b=callWithErrorHandling(m,t,0,[process.env.NODE_ENV===`production`?t.props:shallowReadonly(t.props),u]),S=isPromise(b);if(resetTracking(),g(),(S||t.sp)&&!isAsyncWrapper(t)&&markAsyncBoundary(t),S){if(b.then(unsetCurrentInstance,unsetCurrentInstance),c)return b.then(u=>{handleSetupResult(t,u,c)}).catch(c=>{handleError(c,t,0)});t.asyncDep=b,process.env.NODE_ENV!==`production`&&!t.suspense&&warn$1(`Component <${d.name??`Anonymous`}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.`)}else handleSetupResult(t,b,c)}else finishComponentSetup(t,c)}function handleSetupResult(t,c,u){isFunction$1(c)?t.type.__ssrInlineRender?t.ssrRender=c:t.render=c:isObject$1(c)?(process.env.NODE_ENV!==`production`&&isVNode(c)&&warn$1(`setup() should not return VNodes directly - return a render function instead.`),process.env.NODE_ENV!==`production`&&(t.devtoolsRawSetupState=c),t.setupState=proxyRefs(c),process.env.NODE_ENV!==`production`&&exposeSetupStateOnRenderContext(t)):process.env.NODE_ENV!==`production`&&c!==void 0&&warn$1(`setup() should return an object. Received: ${c===null?`null`:typeof c}`),finishComponentSetup(t,u)}function registerRuntimeCompiler(t){compile$1=t,installWithProxy=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,RuntimeCompiledPublicInstanceProxyHandlers))}}function finishComponentSetup(t,c,u){let d=t.type;if(!t.render){if(!c&&compile$1&&!d.render){let c=d.template||resolveMergedOptions(t).template;if(c){process.env.NODE_ENV!==`production`&&startMeasure(t,`compile`);let{isCustomElement:u,compilerOptions:m}=t.appContext.config,{delimiters:g,compilerOptions:b}=d,S=extend$2(extend$2({isCustomElement:u,delimiters:g},m),b);d.render=compile$1(c,S),process.env.NODE_ENV!==`production`&&endMeasure(t,`compile`)}}t.render=d.render||NOOP,installWithProxy&&installWithProxy(t)}{let c=setCurrentInstance(t);pauseTracking();try{applyOptions(t)}finally{resetTracking(),c()}}process.env.NODE_ENV!==`production`&&!d.render&&t.render===NOOP&&!c&&(!compile$1&&d.template?warn$1(`Component provided template option but runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".`):warn$1(`Component is missing template or render function: `,d))}function getSlotsProxy(t){return new Proxy(t.slots,{get(c,u){return track(t,`get`,`$slots`),c[u]}})}function createSetupContext(t){let expose=c=>{if(process.env.NODE_ENV!==`production`&&(t.exposed&&warn$1(`expose() should be called only once per setup().`),c!=null)){let t=typeof c;t===`object`&&(isArray$3(c)?t=`array`:isRef(c)&&(t=`ref`)),t!==`object`&&warn$1(`expose() should be passed a plain object, received ${t}.`)}t.exposed=c||{}};if(process.env.NODE_ENV!==`production`){let c,u;return Object.freeze({get attrs(){return c||(c=new Proxy(t.attrs,attrsProxyHandlers))},get slots(){return u||(u=getSlotsProxy(t))},get emit(){return(c,...u)=>t.emit(c,...u)},expose})}else return{attrs:new Proxy(t.attrs,attrsProxyHandlers),slots:t.slots,emit:t.emit,expose}}function getComponentPublicInstance(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(proxyRefs(markRaw(t.exposed)),{get(c,u){if(u in c)return c[u];if(u in publicPropertiesMap)return publicPropertiesMap[u](t)},has(t,c){return c in t||c in publicPropertiesMap}})):t.proxy}function getComponentName(t,c=!0){return isFunction$1(t)?t.displayName||t.name:t.name||c&&t.__name}function formatComponentName(t,c,u=!1){let d=getComponentName(c);if(!d&&c.__file){let t=c.__file.match(/([^/\\]+)\.\w+$/);t&&(d=t[1])}if(!d&&t&&t.parent){let inferFromRegistry=t=>{for(let u in t)if(t[u]===c)return u};d=inferFromRegistry(t.components||t.parent.type.components)||inferFromRegistry(t.appContext.components)}return d?classify(d):u?`App`:`Anonymous`}function isClassComponent(t){return isFunction$1(t)&&`__vccOpts`in t}function h$2(t,c,u){let d=arguments.length;return d===2?isObject$1(c)&&!isArray$3(c)?isVNode(c)?createVNode(t,null,[c]):createVNode(t,c):createVNode(t,null,c):(d>3?u=Array.prototype.slice.call(arguments,2):d===3&&isVNode(u)&&(u=[u]),createVNode(t,c,u))}function initCustomFormatter(){if(process.env.NODE_ENV===`production`||typeof window>`u`)return;let t={style:`color:#3ba776`},c={style:`color:#1677ff`},u={style:`color:#f5222d`},d={style:`color:#eb2f96`},m={__vue_custom_formatter:!0,header(c){return isObject$1(c)?c.__isVue?[`div`,t,`VueInstance`]:isRef(c)?[`div`,{},[`span`,t,genRefFlag(c)],`<`,formatValue(`_value`in c?c._value:c),`>`]:isReactive(c)?[`div`,{},[`span`,t,isShallow(c)?`ShallowReactive`:`Reactive`],`<`,formatValue(c),`>${isReadonly(c)?` (readonly)`:``}`]:isReadonly(c)?[`div`,{},[`span`,t,isShallow(c)?`ShallowReadonly`:`Readonly`],`<`,formatValue(c),`>`]:null:null},hasBody(t){return t&&t.__isVue},body(t){if(t&&t.__isVue)return[`div`,{},...formatInstance(t.$)]}};function formatInstance(t){let c=[];t.type.props&&t.props&&c.push(createInstanceBlock(`props`,toRaw(t.props))),t.setupState!==EMPTY_OBJ&&c.push(createInstanceBlock(`setup`,t.setupState)),t.data!==EMPTY_OBJ&&c.push(createInstanceBlock(`data`,toRaw(t.data)));let u=extractKeys(t,`computed`);u&&c.push(createInstanceBlock(`computed`,u));let m=extractKeys(t,`inject`);return m&&c.push(createInstanceBlock(`injected`,m)),c.push([`div`,{},[`span`,{style:d.style+`;opacity:0.66`},`$ (internal): `],[`object`,{object:t}]]),c}function createInstanceBlock(t,c){return c=extend$2({},c),Object.keys(c).length?[`div`,{style:`line-height:1.25em;margin-bottom:0.6em`},[`div`,{style:`color:#476582`},t],[`div`,{style:`padding-left:1.25em`},...Object.keys(c).map(t=>[`div`,{},[`span`,d,t+`: `],formatValue(c[t],!1)])]]:[`span`,{}]}function formatValue(t,m=!0){return typeof t==`number`?[`span`,c,t]:typeof t==`string`?[`span`,u,JSON.stringify(t)]:typeof t==`boolean`?[`span`,d,t]:isObject$1(t)?[`object`,{object:m?toRaw(t):t}]:[`span`,u,String(t)]}function extractKeys(t,c){let u=t.type;if(isFunction$1(u))return;let d={};for(let m in t.ctx)isKeyOfType(u,m,c)&&(d[m]=t.ctx[m]);return d}function isKeyOfType(t,c,u){let d=t[u];if(isArray$3(d)&&d.includes(c)||isObject$1(d)&&c in d||t.extends&&isKeyOfType(t.extends,c,u)||t.mixins&&t.mixins.some(t=>isKeyOfType(t,c,u)))return!0}function genRefFlag(t){return isShallow(t)?`ShallowRef`:t.effect?`ComputedRef`:`Ref`}window.devtoolsFormatters?window.devtoolsFormatters.push(m):window.devtoolsFormatters=[m]}function withMemo(t,c,u,d){let m=u[d];if(m&&isMemoSame(m,t))return m;let g=c();return g.memo=t.slice(),g.cacheIndex=d,u[d]=g}function isMemoSame(t,c){let u=t.memo;if(u.length!=c.length)return!1;for(let t=0;t<u.length;t++)if(hasChanged(u[t],c[t]))return!1;return isBlockTreeEnabled>0&&currentBlock&&currentBlock.push(t),!0}var stack$1,isWarning,ErrorCodes$1,ErrorTypeStrings$1,queue$1,flushIndex,pendingPostFlushCbs,activePostFlushCbs,postFlushIndex,resolvedPromise,currentFlushPromise,RECURSION_LIMIT,getId,isHmrUpdating,hmrDirtyComponents,map$1,devtools$1,buffer,devtoolsNotInstalled,devtoolsComponentAdded,devtoolsComponentUpdated,_devtoolsComponentRemoved,devtoolsComponentRemoved,devtoolsPerfStart,devtoolsPerfEnd,currentRenderingInstance,currentScopeId,withScopeId,TeleportEndKey,isTeleport,isTeleportDisabled,isTeleportDeferred,isTargetSVG,isTargetMathML,resolveTarget,TeleportImpl,Teleport,leaveCbKey,enterCbKey$1,TransitionHookValidator,BaseTransitionPropsValidators,recursiveGetSubtree,BaseTransitionImpl,BaseTransition,knownTemplateRefs,hasLoggedMismatchError,logMismatchError,isSVGContainer,isMathMLContainer,getContainerType,isComment,allowMismatchAttr,MismatchTypeString,requestIdleCallback,cancelIdleCallback,hydrateOnIdle,hydrateOnVisible,hydrateOnMediaQuery,hydrateOnInteraction,isAsyncWrapper,isKeepAlive,KeepAlive,createHook,onBeforeMount,onMounted,onBeforeUpdate,onUpdated,onBeforeUnmount,onUnmounted,onServerPrefetch,onRenderTriggered,onRenderTracked,COMPONENTS,DIRECTIVES,NULL_DYNAMIC_COMPONENT,getPublicInstance,publicPropertiesMap,isReservedPrefix,hasSetupBinding,PublicInstanceProxyHandlers,RuntimeCompiledPublicInstanceProxyHandlers,warnRuntimeUsage,shouldCacheAccess,internalOptionMergeStrats,uid$1,currentApp,internalObjectProto,createInternalObject,isInternalObject,mixinPropsCache,isSimpleType,isInternalKey,normalizeSlotValue,normalizeSlot,normalizeObjectSlots,normalizeVNodeSlots,assignSlots,initSlots,updateSlots,supported,perf,queuePostRenderEffect,ssrContextKey,useSSRContext,getModelModifiers,accessedAttrs,getChildRoot,getFunctionalFallthrough,filterModelListeners,isElementRoot,isSuspense,suspenseId,Suspense,hasWarned,Fragment,Text,Comment,Static,blockStack,currentBlock,isBlockTreeEnabled,vnodeArgsTransformer,createVNodeWithArgsTransform,normalizeKey$2,normalizeRef,createVNode,emptyAppContext,uid,currentInstance,getCurrentInstance,internalSetCurrentInstance,setInSSRSetupState,setCurrentInstance,unsetCurrentInstance,isBuiltInTag,isInSSRComponentSetup,compile$1,installWithProxy,isRuntimeOnly,attrsProxyHandlers,classifyRE,classify,computed,version$2,warn$2,ErrorTypeStrings,devtools,setDevtoolsHook,ssrUtils,resolveFilter,compatUtils,DeprecationTypes,init_runtime_core_esm_bundler=__esmMin((()=>{init_reactivity_esm_bundler(),init_shared_esm_bundler(),stack$1=[],isWarning=!1,ErrorCodes$1={SETUP_FUNCTION:0,0:`SETUP_FUNCTION`,RENDER_FUNCTION:1,1:`RENDER_FUNCTION`,NATIVE_EVENT_HANDLER:5,5:`NATIVE_EVENT_HANDLER`,COMPONENT_EVENT_HANDLER:6,6:`COMPONENT_EVENT_HANDLER`,VNODE_HOOK:7,7:`VNODE_HOOK`,DIRECTIVE_HOOK:8,8:`DIRECTIVE_HOOK`,TRANSITION_HOOK:9,9:`TRANSITION_HOOK`,APP_ERROR_HANDLER:10,10:`APP_ERROR_HANDLER`,APP_WARN_HANDLER:11,11:`APP_WARN_HANDLER`,FUNCTION_REF:12,12:`FUNCTION_REF`,ASYNC_COMPONENT_LOADER:13,13:`ASYNC_COMPONENT_LOADER`,SCHEDULER:14,14:`SCHEDULER`,COMPONENT_UPDATE:15,15:`COMPONENT_UPDATE`,APP_UNMOUNT_CLEANUP:16,16:`APP_UNMOUNT_CLEANUP`},ErrorTypeStrings$1={sp:`serverPrefetch hook`,bc:`beforeCreate hook`,c:`created hook`,bm:`beforeMount hook`,m:`mounted hook`,bu:`beforeUpdate hook`,u:`updated`,bum:`beforeUnmount hook`,um:`unmounted hook`,a:`activated hook`,da:`deactivated hook`,ec:`errorCaptured hook`,rtc:`renderTracked hook`,rtg:`renderTriggered hook`,0:`setup function`,1:`render function`,2:`watcher getter`,3:`watcher callback`,4:`watcher cleanup function`,5:`native event handler`,6:`component event handler`,7:`vnode hook`,8:`directive hook`,9:`transition hook`,10:`app errorHandler`,11:`app warnHandler`,12:`ref function`,13:`async component loader`,14:`scheduler flush`,15:`component update`,16:`app unmount cleanup function`},queue$1=[],flushIndex=-1,pendingPostFlushCbs=[],activePostFlushCbs=null,postFlushIndex=0,resolvedPromise=Promise.resolve(),currentFlushPromise=null,RECURSION_LIMIT=100,__name$2(nextTick$2,`nextTick`),getId=t=>t.id==null?t.flags&2?-1:1/0:t.id,isHmrUpdating=!1,hmrDirtyComponents=new Map,process.env.NODE_ENV!==`production`&&(getGlobalThis().__VUE_HMR_RUNTIME__={createRecord:tryWrap(createRecord),rerender:tryWrap(rerender),reload:tryWrap(reload)}),map$1=new Map,buffer=[],devtoolsNotInstalled=!1,devtoolsComponentAdded=createDevtoolsComponentHook(`component:added`),devtoolsComponentUpdated=createDevtoolsComponentHook(`component:updated`),_devtoolsComponentRemoved=createDevtoolsComponentHook(`component:removed`),devtoolsComponentRemoved=t=>{devtools$1&&typeof devtools$1.cleanupBuffer==`function`&&!devtools$1.cleanupBuffer(t)&&_devtoolsComponentRemoved(t)},devtoolsPerfStart=createDevtoolsPerformanceHook(`perf:start`),devtoolsPerfEnd=createDevtoolsPerformanceHook(`perf:end`),currentRenderingInstance=null,currentScopeId=null,withScopeId=t=>withCtx,TeleportEndKey=Symbol(`_vte`),isTeleport=t=>t.__isTeleport,isTeleportDisabled=t=>t&&(t.disabled||t.disabled===``),isTeleportDeferred=t=>t&&(t.defer||t.defer===``),isTargetSVG=t=>typeof SVGElement<`u`&&t instanceof SVGElement,isTargetMathML=t=>typeof MathMLElement==`function`&&t instanceof MathMLElement,resolveTarget=(t,c)=>{let u=t&&t.to;if(isString$1(u))if(c){let d=c(u);return process.env.NODE_ENV!==`production`&&!d&&!isTeleportDisabled(t)&&warn$1(`Failed to locate Teleport target with selector "${u}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`),d}else return process.env.NODE_ENV!==`production`&&warn$1(`Current renderer does not support string target for Teleports. (missing querySelector renderer option)`),null;else return process.env.NODE_ENV!==`production`&&!u&&!isTeleportDisabled(t)&&warn$1(`Invalid Teleport target: ${u}`),u},TeleportImpl={name:`Teleport`,__isTeleport:!0,process(t,c,u,d,m,g,b,S,C,w){let{mc:T,pc:E,pbc:D,o:{insert:O,querySelector:Or,createText:kr,createComment:Ar}}=w,jr=isTeleportDisabled(c.props),{shapeFlag:Mr,children:Nr,dynamicChildren:Pr}=c;if(process.env.NODE_ENV!==`production`&&isHmrUpdating&&(C=!1,Pr=null),t==null){let t=c.el=process.env.NODE_ENV===`production`?kr(``):Ar(`teleport start`),w=c.anchor=process.env.NODE_ENV===`production`?kr(``):Ar(`teleport end`);O(t,u,d),O(w,u,d);let mount=(t,c)=>{Mr&16&&(m&&m.isCE&&(m.ce._teleportTarget=t),T(Nr,t,c,m,g,b,S,C))},mountToTarget=()=>{let t=c.target=resolveTarget(c.props,Or),u=prepareAnchor(t,c,kr,O);t?(b!==`svg`&&isTargetSVG(t)?b=`svg`:b!==`mathml`&&isTargetMathML(t)&&(b=`mathml`),jr||(mount(t,u),updateCssVars(c,!1))):process.env.NODE_ENV!==`production`&&!jr&&warn$1(`Invalid Teleport target on mount:`,t,`(${typeof t})`)};jr&&(mount(u,w),updateCssVars(c,!0)),isTeleportDeferred(c.props)?queuePostRenderEffect(()=>{mountToTarget(),c.el.__isMounted=!0},g):mountToTarget()}else{if(isTeleportDeferred(c.props)&&!t.el.__isMounted){queuePostRenderEffect(()=>{TeleportImpl.process(t,c,u,d,m,g,b,S,C,w),delete t.el.__isMounted},g);return}c.el=t.el,c.targetStart=t.targetStart;let T=c.anchor=t.anchor,O=c.target=t.target,kr=c.targetAnchor=t.targetAnchor,Ar=isTeleportDisabled(t.props),Mr=Ar?u:O,Nr=Ar?T:kr;if(b===`svg`||isTargetSVG(O)?b=`svg`:(b===`mathml`||isTargetMathML(O))&&(b=`mathml`),Pr?(D(t.dynamicChildren,Pr,Mr,m,g,b,S),traverseStaticChildren(t,c,!0)):C||E(t,c,Mr,Nr,m,g,b,S,!1),jr)Ar?c.props&&t.props&&c.props.to!==t.props.to&&(c.props.to=t.props.to):moveTeleport(c,u,T,w,1);else if((c.props&&c.props.to)!==(t.props&&t.props.to)){let t=c.target=resolveTarget(c.props,Or);t?moveTeleport(c,t,null,w,0):process.env.NODE_ENV!==`production`&&warn$1(`Invalid Teleport target on update:`,O,`(${typeof O})`)}else Ar&&moveTeleport(c,O,kr,w,1);updateCssVars(c,jr)}},remove(t,c,u,{um:d,o:{remove:m}},g){let{shapeFlag:b,children:S,anchor:C,targetStart:w,targetAnchor:T,target:E,props:D}=t;if(E&&(m(w),m(T)),g&&m(C),b&16){let t=g||!isTeleportDisabled(D);for(let m=0;m<S.length;m++){let g=S[m];d(g,c,u,t,!!g.dynamicChildren)}}},move:moveTeleport,hydrate:hydrateTeleport},Teleport=TeleportImpl,leaveCbKey=Symbol(`_leaveCb`),enterCbKey$1=Symbol(`_enterCb`),TransitionHookValidator=[Function,Array],BaseTransitionPropsValidators={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:TransitionHookValidator,onEnter:TransitionHookValidator,onAfterEnter:TransitionHookValidator,onEnterCancelled:TransitionHookValidator,onBeforeLeave:TransitionHookValidator,onLeave:TransitionHookValidator,onAfterLeave:TransitionHookValidator,onLeaveCancelled:TransitionHookValidator,onBeforeAppear:TransitionHookValidator,onAppear:TransitionHookValidator,onAfterAppear:TransitionHookValidator,onAppearCancelled:TransitionHookValidator},recursiveGetSubtree=t=>{let c=t.subTree;return c.component?recursiveGetSubtree(c.component):c},BaseTransitionImpl={name:`BaseTransition`,props:BaseTransitionPropsValidators,setup(t,{slots:c}){let u=getCurrentInstance(),d=useTransitionState();return()=>{let m=c.default&&getTransitionRawChildren(c.default(),!0);if(!m||!m.length)return;let g=findNonCommentChild(m),b=toRaw(t),{mode:S}=b;if(process.env.NODE_ENV!==`production`&&S&&S!==`in-out`&&S!==`out-in`&&S!==`default`&&warn$1(`invalid <transition> mode: ${S}`),d.isLeaving)return emptyPlaceholder(g);let C=getInnerChild$1(g);if(!C)return emptyPlaceholder(g);let w=resolveTransitionHooks(C,b,d,u,t=>w=t);C.type!==Comment&&setTransitionHooks(C,w);let T=u.subTree&&getInnerChild$1(u.subTree);if(T&&T.type!==Comment&&!isSameVNodeType(C,T)&&recursiveGetSubtree(u).type!==Comment){let t=resolveTransitionHooks(T,b,d,u);if(setTransitionHooks(T,t),S===`out-in`&&C.type!==Comment)return d.isLeaving=!0,t.afterLeave=()=>{d.isLeaving=!1,u.job.flags&8||u.update(),delete t.afterLeave,T=void 0},emptyPlaceholder(g);S===`in-out`&&C.type!==Comment?t.delayLeave=(t,c,u)=>{let m=getLeavingNodesForType(d,T);m[String(T.key)]=T,t[leaveCbKey]=()=>{c(),t[leaveCbKey]=void 0,delete w.delayedLeave,T=void 0},w.delayedLeave=()=>{u(),delete w.delayedLeave,T=void 0}}:T=void 0}else T&&(T=void 0);return g}}},BaseTransition=BaseTransitionImpl,knownTemplateRefs=new WeakSet,hasLoggedMismatchError=!1,logMismatchError=()=>{hasLoggedMismatchError||(console.error(`Hydration completed but contains mismatches.`),hasLoggedMismatchError=!0)},isSVGContainer=t=>t.namespaceURI.includes(`svg`)&&t.tagName!==`foreignObject`,isMathMLContainer=t=>t.namespaceURI.includes(`MathML`),getContainerType=t=>{if(t.nodeType===1){if(isSVGContainer(t))return`svg`;if(isMathMLContainer(t))return`mathml`}},isComment=t=>t.nodeType===8,allowMismatchAttr=`data-allow-mismatch`,MismatchTypeString={0:`text`,1:`children`,2:`class`,3:`style`,4:`attribute`},requestIdleCallback=getGlobalThis().requestIdleCallback||(t=>setTimeout(t,1)),cancelIdleCallback=getGlobalThis().cancelIdleCallback||(t=>clearTimeout(t)),hydrateOnIdle=(t=1e4)=>c=>{let u=requestIdleCallback(c,{timeout:t});return()=>cancelIdleCallback(u)},hydrateOnVisible=t=>(c,u)=>{let d=new IntersectionObserver(t=>{for(let u of t)if(u.isIntersecting){d.disconnect(),c();break}},t);return u(t=>{if(t instanceof Element){if(elementIsVisibleInViewport(t))return c(),d.disconnect(),!1;d.observe(t)}}),()=>d.disconnect()},hydrateOnMediaQuery=t=>c=>{if(t){let u=matchMedia(t);if(u.matches)c();else return u.addEventListener(`change`,c,{once:!0}),()=>u.removeEventListener(`change`,c)}},hydrateOnInteraction=(t=[])=>(c,u)=>{isString$1(t)&&(t=[t]);let d=!1,doHydrate=t=>{d||(d=!0,teardown(),c(),t.target.dispatchEvent(new t.constructor(t.type,t)))},teardown=()=>{u(c=>{for(let u of t)c.removeEventListener(u,doHydrate)})};return u(c=>{for(let u of t)c.addEventListener(u,doHydrate,{once:!0})}),teardown},isAsyncWrapper=t=>!!t.type.__asyncLoader,isKeepAlive=t=>t.type.__isKeepAlive,KeepAlive={name:`KeepAlive`,__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(t,{slots:c}){let u=getCurrentInstance(),d=u.ctx;if(!d.renderer)return()=>{let t=c.default&&c.default();return t&&t.length===1?t[0]:t};let m=new Map,g=new Set,b=null;process.env.NODE_ENV!==`production`&&(u.__v_cache=m);let S=u.suspense,{renderer:{p:C,m:w,um:T,o:{createElement:E}}}=d,D=E(`div`);d.activate=(t,c,u,d,m)=>{let g=t.component;w(t,c,u,0,S),C(g.vnode,t,c,u,g,S,d,t.slotScopeIds,m),queuePostRenderEffect(()=>{g.isDeactivated=!1,g.a&&invokeArrayFns(g.a);let c=t.props&&t.props.onVnodeMounted;c&&invokeVNodeHook(c,g.parent,t)},S),process.env.NODE_ENV!==`production`&&devtoolsComponentAdded(g)},d.deactivate=t=>{let c=t.component;invalidateMount(c.m),invalidateMount(c.a),w(t,D,null,1,S),queuePostRenderEffect(()=>{c.da&&invokeArrayFns(c.da);let u=t.props&&t.props.onVnodeUnmounted;u&&invokeVNodeHook(u,c.parent,t),c.isDeactivated=!0},S),process.env.NODE_ENV!==`production`&&devtoolsComponentAdded(c)};function unmount(t){resetShapeFlag(t),T(t,u,S,!0)}function pruneCache(t){m.forEach((c,u)=>{let d=getComponentName(c.type);d&&!t(d)&&pruneCacheEntry(u)})}function pruneCacheEntry(t){let c=m.get(t);c&&(!b||!isSameVNodeType(c,b))?unmount(c):b&&resetShapeFlag(b),m.delete(t),g.delete(t)}watch(()=>[t.include,t.exclude],([t,c])=>{t&&pruneCache(c=>matches$1(t,c)),c&&pruneCache(t=>!matches$1(c,t))},{flush:`post`,deep:!0});let O=null,cacheSubtree=()=>{O!=null&&(isSuspense(u.subTree.type)?queuePostRenderEffect(()=>{m.set(O,getInnerChild(u.subTree))},u.subTree.suspense):m.set(O,getInnerChild(u.subTree)))};return onMounted(cacheSubtree),onUpdated(cacheSubtree),onBeforeUnmount(()=>{m.forEach(t=>{let{subTree:c,suspense:d}=u,m=getInnerChild(c);if(t.type===m.type&&t.key===m.key){resetShapeFlag(m);let t=m.component.da;t&&queuePostRenderEffect(t,d);return}unmount(t)})}),()=>{if(O=null,!c.default)return b=null;let u=c.default(),d=u[0];if(u.length>1)return process.env.NODE_ENV!==`production`&&warn$1(`KeepAlive should contain exactly one component child.`),b=null,u;if(!isVNode(d)||!(d.shapeFlag&4)&&!(d.shapeFlag&128))return b=null,d;let S=getInnerChild(d);if(S.type===Comment)return b=null,S;let C=S.type,w=getComponentName(isAsyncWrapper(S)?S.type.__asyncResolved||{}:C),{include:T,exclude:E,max:D}=t;if(T&&(!w||!matches$1(T,w))||E&&w&&matches$1(E,w))return S.shapeFlag&=-257,b=S,d;let Or=S.key==null?C:S.key,kr=m.get(Or);return S.el&&(S=cloneVNode(S),d.shapeFlag&128&&(d.ssContent=S)),O=Or,kr?(S.el=kr.el,S.component=kr.component,S.transition&&setTransitionHooks(S,S.transition),S.shapeFlag|=512,g.delete(Or),g.add(Or)):(g.add(Or),D&&g.size>parseInt(D,10)&&pruneCacheEntry(g.values().next().value)),S.shapeFlag|=256,b=S,isSuspense(d.type)?d:S}}},__name$2(matches$1,`matches`),createHook=t=>(c,u=currentInstance)=>{(!isInSSRComponentSetup||t===`sp`)&&injectHook(t,(...t)=>c(...t),u)},onBeforeMount=createHook(`bm`),onMounted=createHook(`m`),onBeforeUpdate=createHook(`bu`),onUpdated=createHook(`u`),onBeforeUnmount=createHook(`bum`),onUnmounted=createHook(`um`),onServerPrefetch=createHook(`sp`),onRenderTriggered=createHook(`rtg`),onRenderTracked=createHook(`rtc`),COMPONENTS=`components`,DIRECTIVES=`directives`,NULL_DYNAMIC_COMPONENT=Symbol.for(`v-ndc`),getPublicInstance=t=>t?isStatefulComponent(t)?getComponentPublicInstance(t):getPublicInstance(t.parent):null,publicPropertiesMap=extend$2(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>process.env.NODE_ENV===`production`?t.props:shallowReadonly(t.props),$attrs:t=>process.env.NODE_ENV===`production`?t.attrs:shallowReadonly(t.attrs),$slots:t=>process.env.NODE_ENV===`production`?t.slots:shallowReadonly(t.slots),$refs:t=>process.env.NODE_ENV===`production`?t.refs:shallowReadonly(t.refs),$parent:t=>getPublicInstance(t.parent),$root:t=>getPublicInstance(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>resolveMergedOptions(t),$forceUpdate:t=>t.f||(t.f=()=>{queueJob(t.update)}),$nextTick:t=>t.n||(t.n=nextTick$2.bind(t.proxy)),$watch:t=>instanceWatch.bind(t)}),isReservedPrefix=t=>t===`_`||t===`$`,hasSetupBinding=(t,c)=>t!==EMPTY_OBJ&&!t.__isScriptSetup&&hasOwn(t,c),PublicInstanceProxyHandlers={get({_:t},c){if(c===`__v_skip`)return!0;let{ctx:u,setupState:d,data:m,props:g,accessCache:b,type:S,appContext:C}=t;if(process.env.NODE_ENV!==`production`&&c===`__isVue`)return!0;let w;if(c[0]!==`$`){let S=b[c];if(S!==void 0)switch(S){case 1:return d[c];case 2:return m[c];case 4:return u[c];case 3:return g[c]}else if(hasSetupBinding(d,c))return b[c]=1,d[c];else if(m!==EMPTY_OBJ&&hasOwn(m,c))return b[c]=2,m[c];else if((w=t.propsOptions[0])&&hasOwn(w,c))return b[c]=3,g[c];else if(u!==EMPTY_OBJ&&hasOwn(u,c))return b[c]=4,u[c];else shouldCacheAccess&&(b[c]=0)}let T=publicPropertiesMap[c],E,D;if(T)return c===`$attrs`?(track(t.attrs,`get`,``),process.env.NODE_ENV!==`production`&&markAttrsAccessed()):process.env.NODE_ENV!==`production`&&c===`$slots`&&track(t,`get`,c),T(t);if((E=S.__cssModules)&&(E=E[c]))return E;if(u!==EMPTY_OBJ&&hasOwn(u,c))return b[c]=4,u[c];if(D=C.config.globalProperties,hasOwn(D,c))return D[c];process.env.NODE_ENV!==`production`&&currentRenderingInstance&&(!isString$1(c)||c.indexOf(`__v`)!==0)&&(m!==EMPTY_OBJ&&isReservedPrefix(c[0])&&hasOwn(m,c)?warn$1(`Property ${JSON.stringify(c)} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`):t===currentRenderingInstance&&warn$1(`Property ${JSON.stringify(c)} was accessed during render but is not defined on instance.`))},set({_:t},c,u){let{data:d,setupState:m,ctx:g}=t;return hasSetupBinding(m,c)?(m[c]=u,!0):process.env.NODE_ENV!==`production`&&m.__isScriptSetup&&hasOwn(m,c)?(warn$1(`Cannot mutate <script setup> binding "${c}" from Options API.`),!1):d!==EMPTY_OBJ&&hasOwn(d,c)?(d[c]=u,!0):hasOwn(t.props,c)?(process.env.NODE_ENV!==`production`&&warn$1(`Attempting to mutate prop "${c}". Props are readonly.`),!1):c[0]===`$`&&c.slice(1)in t?(process.env.NODE_ENV!==`production`&&warn$1(`Attempting to mutate public property "${c}". Properties starting with $ are reserved and readonly.`),!1):(process.env.NODE_ENV!==`production`&&c in t.appContext.config.globalProperties?Object.defineProperty(g,c,{enumerable:!0,configurable:!0,value:u}):g[c]=u,!0)},has({_:{data:t,setupState:c,accessCache:u,ctx:d,appContext:m,propsOptions:g}},b){let S;return!!u[b]||t!==EMPTY_OBJ&&hasOwn(t,b)||hasSetupBinding(c,b)||(S=g[0])&&hasOwn(S,b)||hasOwn(d,b)||hasOwn(publicPropertiesMap,b)||hasOwn(m.config.globalProperties,b)},defineProperty(t,c,u){return u.get==null?hasOwn(u,`value`)&&this.set(t,c,u.value,null):t._.accessCache[c]=0,Reflect.defineProperty(t,c,u)}},process.env.NODE_ENV!==`production`&&(PublicInstanceProxyHandlers.ownKeys=t=>(warn$1(`Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.`),Reflect.ownKeys(t))),RuntimeCompiledPublicInstanceProxyHandlers=extend$2({},PublicInstanceProxyHandlers,{get(t,c){if(c!==Symbol.unscopables)return PublicInstanceProxyHandlers.get(t,c,t)},has(t,c){let u=c[0]!==`_`&&!isGloballyAllowed(c);return process.env.NODE_ENV!==`production`&&!u&&PublicInstanceProxyHandlers.has(t,c)&&warn$1(`Property ${JSON.stringify(c)} should not start with _ which is a reserved prefix for Vue internals.`),u}}),warnRuntimeUsage=t=>warn$1(`${t}() is a compiler-hint helper that is only usable inside <script setup> of a single file component. Its arguments should be compiled away and passing it at runtime has no effect.`),shouldCacheAccess=!0,__name$2(callHook$1,`callHook`),internalOptionMergeStrats={data:mergeDataFn,props:mergeEmitsOrPropsOptions,emits:mergeEmitsOrPropsOptions,methods:mergeObjectOptions,computed:mergeObjectOptions,beforeCreate:mergeAsArray$1,created:mergeAsArray$1,beforeMount:mergeAsArray$1,mounted:mergeAsArray$1,beforeUpdate:mergeAsArray$1,updated:mergeAsArray$1,beforeDestroy:mergeAsArray$1,beforeUnmount:mergeAsArray$1,destroyed:mergeAsArray$1,unmounted:mergeAsArray$1,activated:mergeAsArray$1,deactivated:mergeAsArray$1,errorCaptured:mergeAsArray$1,serverPrefetch:mergeAsArray$1,components:mergeObjectOptions,directives:mergeObjectOptions,watch:mergeWatchOptions,provide:mergeDataFn,inject:mergeInject},__name$2(mergeAsArray$1,`mergeAsArray`),uid$1=0,currentApp=null,internalObjectProto={},createInternalObject=()=>Object.create(internalObjectProto),isInternalObject=t=>Object.getPrototypeOf(t)===internalObjectProto,mixinPropsCache=new WeakMap,isSimpleType=makeMap(`String,Number,Boolean,Function,Symbol,BigInt`),isInternalKey=t=>t[0]===`_`||t===`$stable`,normalizeSlotValue=t=>isArray$3(t)?t.map(normalizeVNode):[normalizeVNode(t)],normalizeSlot=(t,c,u)=>{if(c._n)return c;let d=withCtx((...d)=>(process.env.NODE_ENV!==`production`&&currentInstance&&(!u||u.root===currentInstance.root)&&warn$1(`Slot "${t}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`),normalizeSlotValue(c(...d))),u);return d._c=!1,d},normalizeObjectSlots=(t,c,u)=>{let d=t._ctx;for(let u in t){if(isInternalKey(u))continue;let m=t[u];if(isFunction$1(m))c[u]=normalizeSlot(u,m,d);else if(m!=null){process.env.NODE_ENV!==`production`&&warn$1(`Non-function value encountered for slot "${u}". Prefer function slots for better performance.`);let t=normalizeSlotValue(m);c[u]=()=>t}}},normalizeVNodeSlots=(t,c)=>{process.env.NODE_ENV!==`production`&&!isKeepAlive(t.vnode)&&warn$1(`Non-function value encountered for default slot. Prefer function slots for better performance.`);let u=normalizeSlotValue(c);t.slots.default=()=>u},assignSlots=(t,c,u)=>{for(let d in c)(u||d!==`_`)&&(t[d]=c[d])},initSlots=(t,c,u)=>{let d=t.slots=createInternalObject();if(t.vnode.shapeFlag&32){let t=c._;t?(assignSlots(d,c,u),u&&def(d,`_`,t,!0)):normalizeObjectSlots(c,d)}else c&&normalizeVNodeSlots(t,c)},updateSlots=(t,c,u)=>{let{vnode:d,slots:m}=t,g=!0,b=EMPTY_OBJ;if(d.shapeFlag&32){let d=c._;d?process.env.NODE_ENV!==`production`&&isHmrUpdating?(assignSlots(m,c,u),trigger(t,`set`,`$slots`)):u&&d===1?g=!1:assignSlots(m,c,u):(g=!c.$stable,normalizeObjectSlots(c,m)),b=c}else c&&(normalizeVNodeSlots(t,c),b={default:1});if(g)for(let t in m)!isInternalKey(t)&&b[t]==null&&delete m[t]},queuePostRenderEffect=queueEffectWithSuspense,ssrContextKey=Symbol.for(`v-scx`),useSSRContext=()=>{{let t=inject(ssrContextKey);return t||process.env.NODE_ENV!==`production`&&warn$1(`Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`),t}},getModelModifiers=(t,c)=>c===`modelValue`||c===`model-value`?t.modelModifiers:t[`${c}Modifiers`]||t[`${camelize(c)}Modifiers`]||t[`${hyphenate(c)}Modifiers`],accessedAttrs=!1,getChildRoot=t=>{let c=t.children,u=t.dynamicChildren,d=filterSingleRoot(c,!1);if(!d)return[t,void 0];if(process.env.NODE_ENV!==`production`&&d.patchFlag>0&&d.patchFlag&2048)return getChildRoot(d);let m=c.indexOf(d),g=u?u.indexOf(d):-1,setRoot=d=>{c[m]=d,u&&(g>-1?u[g]=d:d.patchFlag>0&&(t.dynamicChildren=[...u,d]))};return[normalizeVNode(d),setRoot]},getFunctionalFallthrough=t=>{let c;for(let u in t)(u===`class`||u===`style`||isOn(u))&&((c||(c={}))[u]=t[u]);return c},filterModelListeners=(t,c)=>{let u={};for(let d in t)(!isModelListener(d)||!(d.slice(9)in c))&&(u[d]=t[d]);return u},isElementRoot=t=>t.shapeFlag&7||t.type===Comment,isSuspense=t=>t.__isSuspense,suspenseId=0,Suspense={name:`Suspense`,__isSuspense:!0,process(t,c,u,d,m,g,b,S,C,w){if(t==null)mountSuspense(c,u,d,m,g,b,S,C,w);else{if(g&&g.deps>0&&!t.suspense.isInFallback){c.suspense=t.suspense,c.suspense.vnode=c,c.el=t.el;return}patchSuspense(t,c,u,d,m,b,S,C,w)}},hydrate:hydrateSuspense,normalize:normalizeSuspenseChildren},hasWarned=!1,Fragment=Symbol.for(`v-fgt`),Text=Symbol.for(`v-txt`),Comment=Symbol.for(`v-cmt`),Static=Symbol.for(`v-stc`),blockStack=[],currentBlock=null,isBlockTreeEnabled=1,createVNodeWithArgsTransform=(...t)=>_createVNode(...vnodeArgsTransformer?vnodeArgsTransformer(t,currentRenderingInstance):t),normalizeKey$2=__name$2(({key:t})=>t??null,`normalizeKey`),normalizeRef=({ref:t,ref_key:c,ref_for:u})=>(typeof t==`number`&&(t=``+t),t==null?null:isString$1(t)||isRef(t)||isFunction$1(t)?{i:currentRenderingInstance,r:t,k:c,f:!!u}:t),createVNode=process.env.NODE_ENV===`production`?_createVNode:createVNodeWithArgsTransform,emptyAppContext=createAppContext(),uid=0,currentInstance=null,getCurrentInstance=()=>currentInstance||currentRenderingInstance;{let t=getGlobalThis(),registerGlobalSetter=(c,u)=>{let d;return(d=t[c])||(d=t[c]=[]),d.push(u),t=>{d.length>1?d.forEach(c=>c(t)):d[0](t)}};internalSetCurrentInstance=registerGlobalSetter(`__VUE_INSTANCE_SETTERS__`,t=>currentInstance=t),setInSSRSetupState=registerGlobalSetter(`__VUE_SSR_SETTERS__`,t=>isInSSRComponentSetup=t)}setCurrentInstance=t=>{let c=currentInstance;return internalSetCurrentInstance(t),t.scope.on(),()=>{t.scope.off(),internalSetCurrentInstance(c)}},unsetCurrentInstance=()=>{currentInstance&&currentInstance.scope.off(),internalSetCurrentInstance(null)},isBuiltInTag=makeMap(`slot,component`),isInSSRComponentSetup=!1,isRuntimeOnly=()=>!compile$1,attrsProxyHandlers=process.env.NODE_ENV===`production`?{get(t,c){return track(t,`get`,``),t[c]}}:{get(t,c){return markAttrsAccessed(),track(t,`get`,``),t[c]},set(){return warn$1(`setupContext.attrs is readonly.`),!1},deleteProperty(){return warn$1(`setupContext.attrs is readonly.`),!1}},classifyRE=/(?:^|[-_])(\w)/g,classify=t=>t.replace(classifyRE,t=>t.toUpperCase()).replace(/[-_]/g,``),computed=(t,c)=>{let u=computed$1(t,c,isInSSRComponentSetup);if(process.env.NODE_ENV!==`production`){let t=getCurrentInstance();t&&t.appContext.config.warnRecursiveComputed&&(u._warnRecursive=!0)}return u},__name$2(h$2,`h`),version$2=`3.5.13`,warn$2=process.env.NODE_ENV===`production`?NOOP:warn$1,ErrorTypeStrings=ErrorTypeStrings$1,devtools=(process.env.NODE_ENV,devtools$1),setDevtoolsHook=(process.env.NODE_ENV,setDevtoolsHook$1),ssrUtils={createComponentInstance,setupComponent,renderComponentRoot,setCurrentRenderingInstance,isVNode,normalizeVNode,getComponentPublicInstance,ensureValidVNode,pushWarningContext,popWarningContext}})),runtime_dom_esm_bundler_exports=__exportAll$1({BaseTransition:()=>BaseTransition,BaseTransitionPropsValidators:()=>BaseTransitionPropsValidators,Comment:()=>Comment,DeprecationTypes:()=>null,EffectScope:()=>EffectScope,ErrorCodes:()=>ErrorCodes$1,ErrorTypeStrings:()=>ErrorTypeStrings,Fragment:()=>Fragment,KeepAlive:()=>KeepAlive,ReactiveEffect:()=>ReactiveEffect,Static:()=>Static,Suspense:()=>Suspense,Teleport:()=>Teleport,Text:()=>Text,TrackOpTypes:()=>TrackOpTypes,Transition:()=>Transition,TransitionGroup:()=>TransitionGroup,TriggerOpTypes:()=>TriggerOpTypes,VueElement:()=>VueElement,assertNumber:()=>assertNumber,callWithAsyncErrorHandling:()=>callWithAsyncErrorHandling,callWithErrorHandling:()=>callWithErrorHandling,camelize:()=>camelize,capitalize:()=>capitalize,cloneVNode:()=>cloneVNode,compatUtils:()=>null,computed:()=>computed,createApp:()=>createApp,createBlock:()=>createBlock,createCommentVNode:()=>createCommentVNode,createElementBlock:()=>createElementBlock,createElementVNode:()=>createBaseVNode,createHydrationRenderer:()=>createHydrationRenderer,createPropsRestProxy:()=>createPropsRestProxy,createRenderer:()=>createRenderer,createSSRApp:()=>createSSRApp,createSlots:()=>createSlots,createStaticVNode:()=>createStaticVNode,createTextVNode:()=>createTextVNode,createVNode:()=>createVNode,customRef:()=>customRef,defineAsyncComponent:()=>defineAsyncComponent,defineComponent:()=>defineComponent,defineCustomElement:()=>defineCustomElement,defineEmits:()=>defineEmits,defineExpose:()=>defineExpose,defineModel:()=>defineModel,defineOptions:()=>defineOptions,defineProps:()=>defineProps,defineSSRCustomElement:()=>defineSSRCustomElement,defineSlots:()=>defineSlots,devtools:()=>devtools,effect:()=>effect,effectScope:()=>effectScope,getCurrentInstance:()=>getCurrentInstance,getCurrentScope:()=>getCurrentScope,getCurrentWatcher:()=>getCurrentWatcher,getTransitionRawChildren:()=>getTransitionRawChildren,guardReactiveProps:()=>guardReactiveProps,h:()=>h$2,handleError:()=>handleError,hasInjectionContext:()=>hasInjectionContext,hydrate:()=>hydrate,hydrateOnIdle:()=>hydrateOnIdle,hydrateOnInteraction:()=>hydrateOnInteraction,hydrateOnMediaQuery:()=>hydrateOnMediaQuery,hydrateOnVisible:()=>hydrateOnVisible,initCustomFormatter:()=>initCustomFormatter,initDirectivesForSSR:()=>initDirectivesForSSR,inject:()=>inject,isMemoSame:()=>isMemoSame,isProxy:()=>isProxy,isReactive:()=>isReactive,isReadonly:()=>isReadonly,isRef:()=>isRef,isRuntimeOnly:()=>isRuntimeOnly,isShallow:()=>isShallow,isVNode:()=>isVNode,markRaw:()=>markRaw,mergeDefaults:()=>mergeDefaults,mergeModels:()=>mergeModels,mergeProps:()=>mergeProps,nextTick:()=>nextTick$2,normalizeClass:()=>normalizeClass,normalizeProps:()=>normalizeProps,normalizeStyle:()=>normalizeStyle,onActivated:()=>onActivated,onBeforeMount:()=>onBeforeMount,onBeforeUnmount:()=>onBeforeUnmount,onBeforeUpdate:()=>onBeforeUpdate,onDeactivated:()=>onDeactivated,onErrorCaptured:()=>onErrorCaptured,onMounted:()=>onMounted,onRenderTracked:()=>onRenderTracked,onRenderTriggered:()=>onRenderTriggered,onScopeDispose:()=>onScopeDispose,onServerPrefetch:()=>onServerPrefetch,onUnmounted:()=>onUnmounted,onUpdated:()=>onUpdated,onWatcherCleanup:()=>onWatcherCleanup,openBlock:()=>openBlock,popScopeId:()=>popScopeId,provide:()=>provide,proxyRefs:()=>proxyRefs,pushScopeId:()=>pushScopeId,queuePostFlushCb:()=>queuePostFlushCb,reactive:()=>reactive,readonly:()=>readonly,ref:()=>ref,registerRuntimeCompiler:()=>registerRuntimeCompiler,render:()=>render,renderList:()=>renderList,renderSlot:()=>renderSlot,resolveComponent:()=>resolveComponent,resolveDirective:()=>resolveDirective,resolveDynamicComponent:()=>resolveDynamicComponent,resolveFilter:()=>null,resolveTransitionHooks:()=>resolveTransitionHooks,setBlockTracking:()=>setBlockTracking,setDevtoolsHook:()=>setDevtoolsHook,setTransitionHooks:()=>setTransitionHooks,shallowReactive:()=>shallowReactive,shallowReadonly:()=>shallowReadonly,shallowRef:()=>shallowRef,ssrContextKey:()=>ssrContextKey,ssrUtils:()=>ssrUtils,stop:()=>stop,toDisplayString:()=>toDisplayString,toHandlerKey:()=>toHandlerKey,toHandlers:()=>toHandlers,toRaw:()=>toRaw,toRef:()=>toRef,toRefs:()=>toRefs,toValue:()=>toValue,transformVNodeArgs:()=>transformVNodeArgs,triggerRef:()=>triggerRef,unref:()=>unref,useAttrs:()=>useAttrs,useCssModule:()=>useCssModule,useCssVars:()=>useCssVars,useHost:()=>useHost,useId:()=>useId,useModel:()=>useModel,useSSRContext:()=>useSSRContext,useShadowRoot:()=>useShadowRoot,useSlots:()=>useSlots,useTemplateRef:()=>useTemplateRef,useTransitionState:()=>useTransitionState,vModelCheckbox:()=>vModelCheckbox,vModelDynamic:()=>vModelDynamic,vModelRadio:()=>vModelRadio,vModelSelect:()=>vModelSelect,vModelText:()=>vModelText,vShow:()=>vShow,version:()=>version$2,warn:()=>warn$2,watch:()=>watch,watchEffect:()=>watchEffect,watchPostEffect:()=>watchPostEffect,watchSyncEffect:()=>watchSyncEffect,withAsyncContext:()=>withAsyncContext,withCtx:()=>withCtx,withDefaults:()=>withDefaults,withDirectives:()=>withDirectives,withKeys:()=>withKeys,withMemo:()=>withMemo,withModifiers:()=>withModifiers,withScopeId:()=>withScopeId});function resolveTransitionProps(t){let c={};for(let u in t)u in DOMTransitionPropsValidators||(c[u]=t[u]);if(t.css===!1)return c;let{name:u=`v`,type:d,duration:m,enterFromClass:g=`${u}-enter-from`,enterActiveClass:b=`${u}-enter-active`,enterToClass:S=`${u}-enter-to`,appearFromClass:C=g,appearActiveClass:w=b,appearToClass:T=S,leaveFromClass:E=`${u}-leave-from`,leaveActiveClass:D=`${u}-leave-active`,leaveToClass:O=`${u}-leave-to`}=t,Or=normalizeDuration(m),kr=Or&&Or[0],Ar=Or&&Or[1],{onBeforeEnter:jr,onEnter:Mr,onEnterCancelled:Nr,onLeave:Pr,onLeaveCancelled:Fr,onBeforeAppear:Ir=jr,onAppear:Lr=Mr,onAppearCancelled:Rr=Nr}=c,finishEnter=(t,c,u,d)=>{t._enterCancelled=d,removeTransitionClass(t,c?T:S),removeTransitionClass(t,c?w:b),u&&u()},finishLeave=(t,c)=>{t._isLeaving=!1,removeTransitionClass(t,E),removeTransitionClass(t,O),removeTransitionClass(t,D),c&&c()},makeEnterHook=t=>(c,u)=>{let m=t?Lr:Mr,resolve=()=>finishEnter(c,t,u);callHook(m,[c,resolve]),nextFrame(()=>{removeTransitionClass(c,t?C:g),addTransitionClass(c,t?T:S),hasExplicitCallback(m)||whenTransitionEnds(c,d,kr,resolve)})};return extend$2(c,{onBeforeEnter(t){callHook(jr,[t]),addTransitionClass(t,g),addTransitionClass(t,b)},onBeforeAppear(t){callHook(Ir,[t]),addTransitionClass(t,C),addTransitionClass(t,w)},onEnter:makeEnterHook(!1),onAppear:makeEnterHook(!0),onLeave(t,c){t._isLeaving=!0;let resolve=()=>finishLeave(t,c);addTransitionClass(t,E),t._enterCancelled?(addTransitionClass(t,D),forceReflow()):(forceReflow(),addTransitionClass(t,D)),nextFrame(()=>{t._isLeaving&&(removeTransitionClass(t,E),addTransitionClass(t,O),hasExplicitCallback(Pr)||whenTransitionEnds(t,d,Ar,resolve))}),callHook(Pr,[t,resolve])},onEnterCancelled(t){finishEnter(t,!1,void 0,!0),callHook(Nr,[t])},onAppearCancelled(t){finishEnter(t,!0,void 0,!0),callHook(Rr,[t])},onLeaveCancelled(t){finishLeave(t),callHook(Fr,[t])}})}function normalizeDuration(t){if(t==null)return null;if(isObject$1(t))return[NumberOf(t.enter),NumberOf(t.leave)];{let c=NumberOf(t);return[c,c]}}function NumberOf(t){let c=toNumber(t);return process.env.NODE_ENV!==`production`&&assertNumber(c,`<transition> explicit duration`),c}function addTransitionClass(t,c){c.split(/\s+/).forEach(c=>c&&t.classList.add(c)),(t[vtcKey]||(t[vtcKey]=new Set)).add(c)}function removeTransitionClass(t,c){c.split(/\s+/).forEach(c=>c&&t.classList.remove(c));let u=t[vtcKey];u&&(u.delete(c),u.size||(t[vtcKey]=void 0))}function nextFrame(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}function whenTransitionEnds(t,c,u,d){let m=t._endId=++endId,resolveIfNotStale=()=>{m===t._endId&&d()};if(u!=null)return setTimeout(resolveIfNotStale,u);let{type:g,timeout:b,propCount:S}=getTransitionInfo(t,c);if(!g)return d();let C=g+`end`,w=0,end=()=>{t.removeEventListener(C,onEnd),resolveIfNotStale()},onEnd=c=>{c.target===t&&++w>=S&&end()};setTimeout(()=>{w<S&&end()},b+1),t.addEventListener(C,onEnd)}function getTransitionInfo(t,c){let u=window.getComputedStyle(t),getStyleProperties=t=>(u[t]||``).split(`, `),d=getStyleProperties(`${TRANSITION$1}Delay`),m=getStyleProperties(`${TRANSITION$1}Duration`),g=getTimeout(d,m),b=getStyleProperties(`${ANIMATION}Delay`),S=getStyleProperties(`${ANIMATION}Duration`),C=getTimeout(b,S),w=null,T=0,E=0;c===TRANSITION$1?g>0&&(w=TRANSITION$1,T=g,E=m.length):c===ANIMATION?C>0&&(w=ANIMATION,T=C,E=S.length):(T=Math.max(g,C),w=T>0?g>C?TRANSITION$1:ANIMATION:null,E=w?w===TRANSITION$1?m.length:S.length:0);let D=w===TRANSITION$1&&/\b(transform|all)(,|$)/.test(getStyleProperties(`${TRANSITION$1}Property`).toString());return{type:w,timeout:T,propCount:E,hasTransform:D}}function getTimeout(t,c){for(;t.length<c.length;)t=t.concat(t);return Math.max(...c.map((c,u)=>toMs(c)+toMs(t[u])))}function toMs(t){return t===`auto`?0:Number(t.slice(0,-1).replace(`,`,`.`))*1e3}function forceReflow(){return document.body.offsetHeight}function patchClass(t,c,u){let d=t[vtcKey];d&&(c=(c?[c,...d]:[...d]).join(` `)),c==null?t.removeAttribute(`class`):u?t.setAttribute(`class`,c):t.className=c}function setDisplay(t,c){t.style.display=c?t[vShowOriginalDisplay]:`none`,t[vShowHidden]=!c}function initVShowForSSR(){vShow.getSSRProps=({value:t})=>{if(!t)return{style:{display:`none`}}}}function useCssVars(t){let c=getCurrentInstance();if(!c){process.env.NODE_ENV!==`production`&&warn$2(`useCssVars is called without current active component instance.`);return}let u=c.ut=(u=t(c.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${c.uid}"]`)).forEach(t=>setVarsOnNode(t,u))};process.env.NODE_ENV!==`production`&&(c.getCssVars=()=>t(c.proxy));let setVars=()=>{let d=t(c.proxy);c.ce?setVarsOnNode(c.ce,d):setVarsOnVNode(c.subTree,d),u(d)};onBeforeUpdate(()=>{queuePostFlushCb(setVars)}),onMounted(()=>{watch(setVars,NOOP,{flush:`post`});let t=new MutationObserver(setVars);t.observe(c.subTree.el.parentNode,{childList:!0}),onUnmounted(()=>t.disconnect())})}function setVarsOnVNode(t,c){if(t.shapeFlag&128){let u=t.suspense;t=u.activeBranch,u.pendingBranch&&!u.isHydrating&&u.effects.push(()=>{setVarsOnVNode(u.activeBranch,c)})}for(;t.component;)t=t.component.subTree;if(t.shapeFlag&1&&t.el)setVarsOnNode(t.el,c);else if(t.type===Fragment)t.children.forEach(t=>setVarsOnVNode(t,c));else if(t.type===Static){let{el:u,anchor:d}=t;for(;u&&(setVarsOnNode(u,c),u!==d);)u=u.nextSibling}}function setVarsOnNode(t,c){if(t.nodeType===1){let u=t.style,d=``;for(let t in c)u.setProperty(`--${t}`,c[t]),d+=`--${t}: ${c[t]};`;u[CSS_VAR_TEXT]=d}}function patchStyle(t,c,u){let d=t.style,m=isString$1(u),g=!1;if(u&&!m){if(c)if(isString$1(c))for(let t of c.split(`;`)){let c=t.slice(0,t.indexOf(`:`)).trim();u[c]??setStyle(d,c,``)}else for(let t in c)u[t]??setStyle(d,t,``);for(let t in u)t===`display`&&(g=!0),setStyle(d,t,u[t])}else if(m){if(c!==u){let t=d[CSS_VAR_TEXT];t&&(u+=`;`+t),d.cssText=u,g=displayRE.test(u)}}else c&&t.removeAttribute(`style`);vShowOriginalDisplay in t&&(t[vShowOriginalDisplay]=g?d.display:``,t[vShowHidden]&&(d.display=`none`))}function setStyle(t,c,u){if(isArray$3(u))u.forEach(u=>setStyle(t,c,u));else if(u??(u=``),process.env.NODE_ENV!==`production`&&semicolonRE.test(u)&&warn$2(`Unexpected semicolon at the end of '${c}' style value: '${u}'`),c.startsWith(`--`))t.setProperty(c,u);else{let d=autoPrefix(t,c);importantRE.test(u)?t.setProperty(hyphenate(d),u.replace(importantRE,``),`important`):t[d]=u}}function autoPrefix(t,c){let u=prefixCache[c];if(u)return u;let d=camelize(c);if(d!==`filter`&&d in t)return prefixCache[c]=d;d=capitalize(d);for(let u=0;u<prefixes.length;u++){let m=prefixes[u]+d;if(m in t)return prefixCache[c]=m}return c}function patchAttr(t,c,u,d,m,g=isSpecialBooleanAttr(c)){d&&c.startsWith(`xlink:`)?u==null?t.removeAttributeNS(xlinkNS,c.slice(6,c.length)):t.setAttributeNS(xlinkNS,c,u):u==null||g&&!includeBooleanAttr(u)?t.removeAttribute(c):t.setAttribute(c,g?``:isSymbol(u)?String(u):u)}function patchDOMProp(t,c,u,d,m){if(c===`innerHTML`||c===`textContent`){u!=null&&(t[c]=c===`innerHTML`?unsafeToTrustedHTML(u):u);return}let g=t.tagName;if(c===`value`&&g!==`PROGRESS`&&!g.includes(`-`)){let d=g===`OPTION`?t.getAttribute(`value`)||``:t.value,m=u==null?t.type===`checkbox`?`on`:``:String(u);(d!==m||!(`_value`in t))&&(t.value=m),u??t.removeAttribute(c),t._value=u;return}let b=!1;if(u===``||u==null){let d=typeof t[c];d===`boolean`?u=includeBooleanAttr(u):u==null&&d===`string`?(u=``,b=!0):d===`number`&&(u=0,b=!0)}try{t[c]=u}catch(t){process.env.NODE_ENV!==`production`&&!b&&warn$2(`Failed setting prop "${c}" on <${g.toLowerCase()}>: value ${u} is invalid.`,t)}b&&t.removeAttribute(m||c)}function addEventListener$1(t,c,u,d){t.addEventListener(c,u,d)}function removeEventListener(t,c,u,d){t.removeEventListener(c,u,d)}function patchEvent(t,c,u,d,m=null){let g=t[veiKey]||(t[veiKey]={}),b=g[c];if(d&&b)b.value=process.env.NODE_ENV===`production`?d:sanitizeEventValue(d,c);else{let[u,S]=parseName(c);d?addEventListener$1(t,u,g[c]=createInvoker(process.env.NODE_ENV===`production`?d:sanitizeEventValue(d,c),m),S):b&&(removeEventListener(t,u,b,S),g[c]=void 0)}}function parseName(t){let c;if(optionsModifierRE.test(t)){c={};let u;for(;u=t.match(optionsModifierRE);)t=t.slice(0,t.length-u[0].length),c[u[0].toLowerCase()]=!0}return[t[2]===`:`?t.slice(3):hyphenate(t.slice(2)),c]}function createInvoker(t,c){let invoker=t=>{if(!t._vts)t._vts=Date.now();else if(t._vts<=invoker.attached)return;callWithAsyncErrorHandling(patchStopImmediatePropagation(t,invoker.value),c,5,[t])};return invoker.value=t,invoker.attached=getNow(),invoker}function sanitizeEventValue(t,c){return isFunction$1(t)||isArray$3(t)?t:(warn$2(`Wrong type passed as event handler to ${c} - did you forget @ or : in front of your prop?
26
- Expected function or array of functions, received type ${typeof t}.`),NOOP)}function patchStopImmediatePropagation(t,c){if(isArray$3(c)){let u=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{u.call(t),t._stopped=!0},c.map(t=>c=>!c._stopped&&t&&t(c))}else return c}function shouldSetAsProp(t,c,u,d){if(d)return!!(c===`innerHTML`||c===`textContent`||c in t&&isNativeOn(c)&&isFunction$1(u));if(c===`spellcheck`||c===`draggable`||c===`translate`||c===`form`||c===`list`&&t.tagName===`INPUT`||c===`type`&&t.tagName===`TEXTAREA`)return!1;if(c===`width`||c===`height`){let c=t.tagName;if(c===`IMG`||c===`VIDEO`||c===`CANVAS`||c===`SOURCE`)return!1}return isNativeOn(c)&&isString$1(u)?!1:c in t}function defineCustomElement(t,c,u){let d=defineComponent(t,c);isPlainObject$3(d)&&extend$2(d,c);class VueCustomElement extends VueElement{constructor(t){super(d,t,u)}}return VueCustomElement.def=d,VueCustomElement}function useHost(t){let c=getCurrentInstance();return c&&c.ce||(process.env.NODE_ENV!==`production`&&warn$2(c?`${t||`useHost`} can only be used in components defined via defineCustomElement.`:`${t||`useHost`} called without an active component instance.`),null)}function useShadowRoot(){let t=process.env.NODE_ENV===`production`?useHost():useHost(`useShadowRoot`);return t&&t.shadowRoot}function useCssModule(t=`$style`){{let c=getCurrentInstance();if(!c)return process.env.NODE_ENV!==`production`&&warn$2(`useCssModule must be called inside setup()`),EMPTY_OBJ;let u=c.type.__cssModules;return u?u[t]||(process.env.NODE_ENV!==`production`&&warn$2(`Current instance does not have CSS module named "${t}".`),EMPTY_OBJ):(process.env.NODE_ENV!==`production`&&warn$2(`Current instance does not have CSS modules injected.`),EMPTY_OBJ)}}function callPendingCbs(t){let c=t.el;c[moveCbKey]&&c[moveCbKey](),c[enterCbKey]&&c[enterCbKey]()}function recordPosition(t){newPositionMap.set(t,t.el.getBoundingClientRect())}function applyTranslation(t){let c=positionMap.get(t),u=newPositionMap.get(t),d=c.left-u.left,m=c.top-u.top;if(d||m){let c=t.el.style;return c.transform=c.webkitTransform=`translate(${d}px,${m}px)`,c.transitionDuration=`0s`,t}}function hasCSSTransform(t,c,u){let d=t.cloneNode(),m=t[vtcKey];m&&m.forEach(t=>{t.split(/\s+/).forEach(t=>t&&d.classList.remove(t))}),u.split(/\s+/).forEach(t=>t&&d.classList.add(t)),d.style.display=`none`;let g=c.nodeType===1?c:c.parentNode;g.appendChild(d);let{hasTransform:b}=getTransitionInfo(d);return g.removeChild(d),b}function onCompositionStart(t){t.target.composing=!0}function onCompositionEnd(t){let c=t.target;c.composing&&(c.composing=!1,c.dispatchEvent(new Event(`input`)))}function setChecked(t,{value:c,oldValue:u},d){t._modelValue=c;let m;if(isArray$3(c))m=looseIndexOf(c,d.props.value)>-1;else if(isSet(c))m=c.has(d.props.value);else{if(c===u)return;m=looseEqual(c,getCheckboxValue(t,!0))}t.checked!==m&&(t.checked=m)}function setSelected(t,c){let u=t.multiple,d=isArray$3(c);if(u&&!d&&!isSet(c)){process.env.NODE_ENV!==`production`&&warn$2(`<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(c).slice(8,-1)}.`);return}for(let m=0,g=t.options.length;m<g;m++){let g=t.options[m],b=getValue$2(g);if(u)if(d){let t=typeof b;t===`string`||t===`number`?g.selected=c.some(t=>String(t)===String(b)):g.selected=looseIndexOf(c,b)>-1}else g.selected=c.has(b);else if(looseEqual(getValue$2(g),c)){t.selectedIndex!==m&&(t.selectedIndex=m);return}}!u&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}function getValue$2(t){return`_value`in t?t._value:t.value}function getCheckboxValue(t,c){let u=c?`_trueValue`:`_falseValue`;return u in t?t[u]:c}function resolveDynamicModel(t,c){switch(t){case`SELECT`:return vModelSelect;case`TEXTAREA`:return vModelText;default:switch(c){case`checkbox`:return vModelCheckbox;case`radio`:return vModelRadio;default:return vModelText}}}function callModelHook(t,c,u,d,m){let g=resolveDynamicModel(t.tagName,u.props&&u.props.type)[m];g&&g(t,c,u,d)}function initVModelForSSR(){vModelText.getSSRProps=({value:t})=>({value:t}),vModelRadio.getSSRProps=({value:t},c)=>{if(c.props&&looseEqual(c.props.value,t))return{checked:!0}},vModelCheckbox.getSSRProps=({value:t},c)=>{if(isArray$3(t)){if(c.props&&looseIndexOf(t,c.props.value)>-1)return{checked:!0}}else if(isSet(t)){if(c.props&&t.has(c.props.value))return{checked:!0}}else if(t)return{checked:!0}},vModelDynamic.getSSRProps=(t,c)=>{if(typeof c.type!=`string`)return;let u=resolveDynamicModel(c.type.toUpperCase(),c.props&&c.props.type);if(u.getSSRProps)return u.getSSRProps(t,c)}}function ensureRenderer(){return renderer||(renderer=createRenderer(rendererOptions))}function ensureHydrationRenderer(){return renderer=enabledHydration?renderer:createHydrationRenderer(rendererOptions),enabledHydration=!0,renderer}function resolveRootNamespace(t){if(t instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&t instanceof MathMLElement)return`mathml`}function injectNativeTagCheck(t){Object.defineProperty(t.config,`isNativeTag`,{value:t=>isHTMLTag(t)||isSVGTag(t)||isMathMLTag(t),writable:!1})}function injectCompilerOptionsCheck(t){if(isRuntimeOnly()){let c=t.config.isCustomElement;Object.defineProperty(t.config,`isCustomElement`,{get(){return c},set(){warn$2("The `isCustomElement` config option is deprecated. Use `compilerOptions.isCustomElement` instead.")}});let u=t.config.compilerOptions,d='The `compilerOptions` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, `compilerOptions` must be passed to `@vue/compiler-dom` in the build setup instead.\n- For vue-loader: pass it via vue-loader\'s `compilerOptions` loader option.\n- For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader\n- For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc';Object.defineProperty(t.config,`compilerOptions`,{get(){return warn$2(d),u},set(){warn$2(d)}})}}function normalizeContainer(t){if(isString$1(t)){let c=document.querySelector(t);return process.env.NODE_ENV!==`production`&&!c&&warn$2(`Failed to mount app: mount target selector "${t}" returned null.`),c}return process.env.NODE_ENV!==`production`&&window.ShadowRoot&&t instanceof window.ShadowRoot&&t.mode===`closed`&&warn$2('mounting on a ShadowRoot with `{mode: "closed"}` may lead to unpredictable bugs'),t}var policy,tt$3,unsafeToTrustedHTML,svgNS,mathmlNS,doc,templateContainer,nodeOps,TRANSITION$1,ANIMATION,vtcKey,DOMTransitionPropsValidators,TransitionPropsValidators,decorate$1,Transition,callHook,hasExplicitCallback,endId,vShowOriginalDisplay,vShowHidden,vShow,CSS_VAR_TEXT,displayRE,semicolonRE,importantRE,prefixes,prefixCache,xlinkNS,veiKey,optionsModifierRE,cachedNow,p,getNow,isNativeOn,patchProp,REMOVAL,defineSSRCustomElement,BaseClass,VueElement,positionMap,newPositionMap,moveCbKey,enterCbKey,decorate,TransitionGroup,getModelAssigner,assignKey,vModelText,vModelCheckbox,vModelRadio,vModelSelect,vModelDynamic,systemModifiers,modifierGuards,withModifiers,keyNames,withKeys,rendererOptions,renderer,enabledHydration,render,hydrate,createApp,createSSRApp,ssrDirectiveInitialized,initDirectivesForSSR,init_runtime_dom_esm_bundler=__esmMin((()=>{if(init_runtime_core_esm_bundler(),init_runtime_core_esm_bundler(),init_shared_esm_bundler(),policy=void 0,tt$3=typeof window<`u`&&window.trustedTypes,tt$3)try{policy=tt$3.createPolicy(`vue`,{createHTML:t=>t})}catch(t){process.env.NODE_ENV!==`production`&&warn$2(`Error creating trusted types policy: ${t}`)}unsafeToTrustedHTML=policy?t=>policy.createHTML(t):t=>t,svgNS=`http://www.w3.org/2000/svg`,mathmlNS=`http://www.w3.org/1998/Math/MathML`,doc=typeof document<`u`?document:null,templateContainer=doc&&doc.createElement(`template`),nodeOps={insert:(t,c,u)=>{c.insertBefore(t,u||null)},remove:t=>{let c=t.parentNode;c&&c.removeChild(t)},createElement:(t,c,u,d)=>{let m=c===`svg`?doc.createElementNS(svgNS,t):c===`mathml`?doc.createElementNS(mathmlNS,t):u?doc.createElement(t,{is:u}):doc.createElement(t);return t===`select`&&d&&d.multiple!=null&&m.setAttribute(`multiple`,d.multiple),m},createText:t=>doc.createTextNode(t),createComment:t=>doc.createComment(t),setText:(t,c)=>{t.nodeValue=c},setElementText:(t,c)=>{t.textContent=c},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>doc.querySelector(t),setScopeId(t,c){t.setAttribute(c,``)},insertStaticContent(t,c,u,d,m,g){let b=u?u.previousSibling:c.lastChild;if(m&&(m===g||m.nextSibling))for(;c.insertBefore(m.cloneNode(!0),u),!(m===g||!(m=m.nextSibling)););else{templateContainer.innerHTML=unsafeToTrustedHTML(d===`svg`?`<svg>${t}</svg>`:d===`mathml`?`<math>${t}</math>`:t);let m=templateContainer.content;if(d===`svg`||d===`mathml`){let t=m.firstChild;for(;t.firstChild;)m.appendChild(t.firstChild);m.removeChild(t)}c.insertBefore(m,u)}return[b?b.nextSibling:c.firstChild,u?u.previousSibling:c.lastChild]}},TRANSITION$1=`transition`,ANIMATION=`animation`,vtcKey=Symbol(`_vtc`),DOMTransitionPropsValidators={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},TransitionPropsValidators=extend$2({},BaseTransitionPropsValidators,DOMTransitionPropsValidators),decorate$1=t=>(t.displayName=`Transition`,t.props=TransitionPropsValidators,t),Transition=decorate$1((t,{slots:c})=>h$2(BaseTransition,resolveTransitionProps(t),c)),callHook=(t,c=[])=>{isArray$3(t)?t.forEach(t=>t(...c)):t&&t(...c)},hasExplicitCallback=t=>t?isArray$3(t)?t.some(t=>t.length>1):t.length>1:!1,endId=0,vShowOriginalDisplay=Symbol(`_vod`),vShowHidden=Symbol(`_vsh`),vShow={beforeMount(t,{value:c},{transition:u}){t[vShowOriginalDisplay]=t.style.display===`none`?``:t.style.display,u&&c?u.beforeEnter(t):setDisplay(t,c)},mounted(t,{value:c},{transition:u}){u&&c&&u.enter(t)},updated(t,{value:c,oldValue:u},{transition:d}){!c!=!u&&(d?c?(d.beforeEnter(t),setDisplay(t,!0),d.enter(t)):d.leave(t,()=>{setDisplay(t,!1)}):setDisplay(t,c))},beforeUnmount(t,{value:c}){setDisplay(t,c)}},process.env.NODE_ENV!==`production`&&(vShow.name=`show`),CSS_VAR_TEXT=Symbol(process.env.NODE_ENV===`production`?``:`CSS_VAR_TEXT`),displayRE=/(^|;)\s*display\s*:/,semicolonRE=/[^\\];\s*$/,importantRE=/\s*!important$/,prefixes=[`Webkit`,`Moz`,`ms`],prefixCache={},xlinkNS=`http://www.w3.org/1999/xlink`,__name$2(addEventListener$1,`addEventListener`),veiKey=Symbol(`_vei`),optionsModifierRE=/(?:Once|Passive|Capture)$/,cachedNow=0,p=Promise.resolve(),getNow=()=>cachedNow||(p.then(()=>cachedNow=0),cachedNow=Date.now()),isNativeOn=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,patchProp=(t,c,u,d,m,g)=>{let b=m===`svg`;c===`class`?patchClass(t,d,b):c===`style`?patchStyle(t,u,d):isOn(c)?isModelListener(c)||patchEvent(t,c,u,d,g):(c[0]===`.`?(c=c.slice(1),!0):c[0]===`^`?(c=c.slice(1),!1):shouldSetAsProp(t,c,d,b))?(patchDOMProp(t,c,d),!t.tagName.includes(`-`)&&(c===`value`||c===`checked`||c===`selected`)&&patchAttr(t,c,d,b,g,c!==`value`)):t._isVueCE&&(/[A-Z]/.test(c)||!isString$1(d))?patchDOMProp(t,camelize(c),d,g,c):(c===`true-value`?t._trueValue=d:c===`false-value`&&(t._falseValue=d),patchAttr(t,c,d,b))},REMOVAL={},defineSSRCustomElement=(t,c)=>defineCustomElement(t,c,createSSRApp),BaseClass=typeof HTMLElement<`u`?HTMLElement:class{},VueElement=class VueElement extends BaseClass{constructor(t,c={},u=createApp){super(),this._def=t,this._props=c,this._createApp=u,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._ob=null,this.shadowRoot&&u!==createApp?this._root=this.shadowRoot:(process.env.NODE_ENV!==`production`&&this.shadowRoot&&warn$2("Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use `defineSSRCustomElement`."),t.shadowRoot===!1?this._root=this:(this.attachShadow({mode:`open`}),this._root=this.shadowRoot)),this._def.__asyncLoader||this._resolveProps(this._def)}connectedCallback(){if(!this.isConnected)return;this.shadowRoot||this._parseSlots(),this._connected=!0;let t=this;for(;t=t&&(t.parentNode||t.host);)if(t instanceof VueElement){this._parent=t;break}this._instance||(this._resolved?(this._setParent(),this._update()):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(t=this._parent){t&&(this._instance.parent=t._instance,this._instance.provides=t._instance.provides)}disconnectedCallback(){this._connected=!1,nextTick$2(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null)})}_resolveDef(){if(this._pendingResolve)return;for(let t=0;t<this.attributes.length;t++)this._setAttr(this.attributes[t].name);this._ob=new MutationObserver(t=>{for(let c of t)this._setAttr(c.attributeName)}),this._ob.observe(this,{attributes:!0});let resolve=(t,c=!1)=>{this._resolved=!0,this._pendingResolve=void 0;let{props:u,styles:d}=t,m;if(u&&!isArray$3(u))for(let t in u){let c=u[t];(c===Number||c&&c.type===Number)&&(t in this._props&&(this._props[t]=toNumber(this._props[t])),(m||(m=Object.create(null)))[camelize(t)]=!0)}this._numberProps=m,c&&this._resolveProps(t),this.shadowRoot?this._applyStyles(d):process.env.NODE_ENV!==`production`&&d&&warn$2(`Custom element style injection is not supported when using shadowRoot: false`),this._mount(t)},t=this._def.__asyncLoader;t?this._pendingResolve=t().then(t=>resolve(this._def=t,!0)):resolve(this._def)}_mount(t){process.env.NODE_ENV!==`production`&&!t.name&&(t.name=`VueElement`),this._app=this._createApp(t),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);let c=this._instance&&this._instance.exposed;if(c)for(let t in c)hasOwn(this,t)?process.env.NODE_ENV!==`production`&&warn$2(`Exposed property "${t}" already exists on custom element.`):Object.defineProperty(this,t,{get:()=>unref(c[t])})}_resolveProps(t){let{props:c}=t,u=isArray$3(c)?c:Object.keys(c||{});for(let t of Object.keys(this))t[0]!==`_`&&u.includes(t)&&this._setProp(t,this[t]);for(let t of u.map(camelize))Object.defineProperty(this,t,{get(){return this._getProp(t)},set(c){this._setProp(t,c,!0,!0)}})}_setAttr(t){if(t.startsWith(`data-v-`))return;let c=this.hasAttribute(t),u=c?this.getAttribute(t):REMOVAL,d=camelize(t);c&&this._numberProps&&this._numberProps[d]&&(u=toNumber(u)),this._setProp(d,u,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,c,u=!0,d=!1){if(c!==this._props[t]&&(c===REMOVAL?delete this._props[t]:(this._props[t]=c,t===`key`&&this._app&&(this._app._ceVNode.key=c)),d&&this._instance&&this._update(),u)){let u=this._ob;u&&u.disconnect(),c===!0?this.setAttribute(hyphenate(t),``):typeof c==`string`||typeof c==`number`?this.setAttribute(hyphenate(t),c+``):c||this.removeAttribute(hyphenate(t)),u&&u.observe(this,{attributes:!0})}}_update(){render(this._createVNode(),this._root)}_createVNode(){let t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));let c=createVNode(this._def,extend$2(t,this._props));return this._instance||(c.ce=t=>{this._instance=t,t.ce=this,t.isCE=!0,process.env.NODE_ENV!==`production`&&(t.ceReload=t=>{this._styles&&(this._styles.forEach(t=>this._root.removeChild(t)),this._styles.length=0),this._applyStyles(t),this._instance=null,this._update()});let dispatch=(t,c)=>{this.dispatchEvent(new CustomEvent(t,isPlainObject$3(c[0])?extend$2({detail:c},c[0]):{detail:c}))};t.emit=(t,...c)=>{dispatch(t,c),hyphenate(t)!==t&&dispatch(hyphenate(t),c)},this._setParent()}),c}_applyStyles(t,c){if(!t)return;if(c){if(c===this._def||this._styleChildren.has(c))return;this._styleChildren.add(c)}let u=this._nonce;for(let d=t.length-1;d>=0;d--){let m=document.createElement(`style`);if(u&&m.setAttribute(`nonce`,u),m.textContent=t[d],this.shadowRoot.prepend(m),process.env.NODE_ENV!==`production`)if(c){if(c.__hmrId){this._childStyles||(this._childStyles=new Map);let t=this._childStyles.get(c.__hmrId);t||this._childStyles.set(c.__hmrId,t=[]),t.push(m)}}else (this._styles||(this._styles=[])).push(m)}}_parseSlots(){let t=this._slots={},c;for(;c=this.firstChild;){let u=c.nodeType===1&&c.getAttribute(`slot`)||`default`;(t[u]||(t[u]=[])).push(c),this.removeChild(c)}}_renderSlots(){let t=(this._teleportTarget||this).querySelectorAll(`slot`),c=this._instance.type.__scopeId;for(let u=0;u<t.length;u++){let d=t[u],m=d.getAttribute(`name`)||`default`,g=this._slots[m],b=d.parentNode;if(g)for(let t of g){if(c&&t.nodeType===1){let u=c+`-s`,d=document.createTreeWalker(t,1);t.setAttribute(u,``);let m;for(;m=d.nextNode();)m.setAttribute(u,``)}b.insertBefore(t,d)}else for(;d.firstChild;)b.insertBefore(d.firstChild,d);b.removeChild(d)}}_injectChildStyle(t){this._applyStyles(t.styles,t)}_removeChildStyle(t){if(process.env.NODE_ENV!==`production`&&(this._styleChildren.delete(t),this._childStyles&&t.__hmrId)){let c=this._childStyles.get(t.__hmrId);c&&(c.forEach(t=>this._root.removeChild(t)),c.length=0)}}},positionMap=new WeakMap,newPositionMap=new WeakMap,moveCbKey=Symbol(`_moveCb`),enterCbKey=Symbol(`_enterCb`),decorate=t=>(delete t.props.mode,t),TransitionGroup=decorate({name:`TransitionGroup`,props:extend$2({},TransitionPropsValidators,{tag:String,moveClass:String}),setup(t,{slots:c}){let u=getCurrentInstance(),d=useTransitionState(),m,g;return onUpdated(()=>{if(!m.length)return;let c=t.moveClass||`${t.name||`v`}-move`;if(!hasCSSTransform(m[0].el,u.vnode.el,c))return;m.forEach(callPendingCbs),m.forEach(recordPosition);let d=m.filter(applyTranslation);forceReflow(),d.forEach(t=>{let u=t.el,d=u.style;addTransitionClass(u,c),d.transform=d.webkitTransform=d.transitionDuration=``;let m=u[moveCbKey]=t=>{t&&t.target!==u||(!t||/transform$/.test(t.propertyName))&&(u.removeEventListener(`transitionend`,m),u[moveCbKey]=null,removeTransitionClass(u,c))};u.addEventListener(`transitionend`,m)})}),()=>{let b=toRaw(t),S=resolveTransitionProps(b),C=b.tag||Fragment;if(m=[],g)for(let t=0;t<g.length;t++){let c=g[t];c.el&&c.el instanceof Element&&(m.push(c),setTransitionHooks(c,resolveTransitionHooks(c,S,d,u)),positionMap.set(c,c.el.getBoundingClientRect()))}g=c.default?getTransitionRawChildren(c.default()):[];for(let t=0;t<g.length;t++){let c=g[t];c.key==null?process.env.NODE_ENV!==`production`&&c.type!==Text&&warn$2(`<TransitionGroup> children must be keyed.`):setTransitionHooks(c,resolveTransitionHooks(c,S,d,u))}return createVNode(C,null,g)}}}),getModelAssigner=t=>{let c=t.props[`onUpdate:modelValue`]||!1;return isArray$3(c)?t=>invokeArrayFns(c,t):c},assignKey=Symbol(`_assign`),vModelText={created(t,{modifiers:{lazy:c,trim:u,number:d}},m){t[assignKey]=getModelAssigner(m);let g=d||m.props&&m.props.type===`number`;addEventListener$1(t,c?`change`:`input`,c=>{if(c.target.composing)return;let d=t.value;u&&(d=d.trim()),g&&(d=looseToNumber(d)),t[assignKey](d)}),u&&addEventListener$1(t,`change`,()=>{t.value=t.value.trim()}),c||(addEventListener$1(t,`compositionstart`,onCompositionStart),addEventListener$1(t,`compositionend`,onCompositionEnd),addEventListener$1(t,`change`,onCompositionEnd))},mounted(t,{value:c}){t.value=c??``},beforeUpdate(t,{value:c,oldValue:u,modifiers:{lazy:d,trim:m,number:g}},b){if(t[assignKey]=getModelAssigner(b),t.composing)return;let S=(g||t.type===`number`)&&!/^0\d/.test(t.value)?looseToNumber(t.value):t.value,C=c??``;S!==C&&(document.activeElement===t&&t.type!==`range`&&(d&&c===u||m&&t.value.trim()===C)||(t.value=C))}},vModelCheckbox={deep:!0,created(t,c,u){t[assignKey]=getModelAssigner(u),addEventListener$1(t,`change`,()=>{let c=t._modelValue,u=getValue$2(t),d=t.checked,m=t[assignKey];if(isArray$3(c)){let t=looseIndexOf(c,u),g=t!==-1;if(d&&!g)m(c.concat(u));else if(!d&&g){let u=[...c];u.splice(t,1),m(u)}}else if(isSet(c)){let t=new Set(c);d?t.add(u):t.delete(u),m(t)}else m(getCheckboxValue(t,d))})},mounted:setChecked,beforeUpdate(t,c,u){t[assignKey]=getModelAssigner(u),setChecked(t,c,u)}},vModelRadio={created(t,{value:c},u){t.checked=looseEqual(c,u.props.value),t[assignKey]=getModelAssigner(u),addEventListener$1(t,`change`,()=>{t[assignKey](getValue$2(t))})},beforeUpdate(t,{value:c,oldValue:u},d){t[assignKey]=getModelAssigner(d),c!==u&&(t.checked=looseEqual(c,d.props.value))}},vModelSelect={deep:!0,created(t,{value:c,modifiers:{number:u}},d){let m=isSet(c);addEventListener$1(t,`change`,()=>{let c=Array.prototype.filter.call(t.options,t=>t.selected).map(t=>u?looseToNumber(getValue$2(t)):getValue$2(t));t[assignKey](t.multiple?m?new Set(c):c:c[0]),t._assigning=!0,nextTick$2(()=>{t._assigning=!1})}),t[assignKey]=getModelAssigner(d)},mounted(t,{value:c}){setSelected(t,c)},beforeUpdate(t,c,u){t[assignKey]=getModelAssigner(u)},updated(t,{value:c}){t._assigning||setSelected(t,c)}},__name$2(getValue$2,`getValue`),vModelDynamic={created(t,c,u){callModelHook(t,c,u,null,`created`)},mounted(t,c,u){callModelHook(t,c,u,null,`mounted`)},beforeUpdate(t,c,u,d){callModelHook(t,c,u,d,`beforeUpdate`)},updated(t,c,u,d){callModelHook(t,c,u,d,`updated`)}},systemModifiers=[`ctrl`,`shift`,`alt`,`meta`],modifierGuards={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>`button`in t&&t.button!==0,middle:t=>`button`in t&&t.button!==1,right:t=>`button`in t&&t.button!==2,exact:(t,c)=>systemModifiers.some(u=>t[`${u}Key`]&&!c.includes(u))},withModifiers=(t,c)=>{let u=t._withMods||(t._withMods={}),d=c.join(`.`);return u[d]||(u[d]=(u,...d)=>{for(let t=0;t<c.length;t++){let d=modifierGuards[c[t]];if(d&&d(u,c))return}return t(u,...d)})},keyNames={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},withKeys=(t,c)=>{let u=t._withKeys||(t._withKeys={}),d=c.join(`.`);return u[d]||(u[d]=u=>{if(!(`key`in u))return;let d=hyphenate(u.key);if(c.some(t=>t===d||keyNames[t]===d))return t(u)})},rendererOptions=extend$2({patchProp},nodeOps),enabledHydration=!1,render=(...t)=>{ensureRenderer().render(...t)},hydrate=(...t)=>{ensureHydrationRenderer().hydrate(...t)},createApp=(...t)=>{let c=ensureRenderer().createApp(...t);process.env.NODE_ENV!==`production`&&(injectNativeTagCheck(c),injectCompilerOptionsCheck(c));let{mount:u}=c;return c.mount=t=>{let d=normalizeContainer(t);if(!d)return;let m=c._component;!isFunction$1(m)&&!m.render&&!m.template&&(m.template=d.innerHTML),d.nodeType===1&&(d.textContent=``);let g=u(d,!1,resolveRootNamespace(d));return d instanceof Element&&(d.removeAttribute(`v-cloak`),d.setAttribute(`data-v-app`,``)),g},c},createSSRApp=(...t)=>{let c=ensureHydrationRenderer().createApp(...t);process.env.NODE_ENV!==`production`&&(injectNativeTagCheck(c),injectCompilerOptionsCheck(c));let{mount:u}=c;return c.mount=t=>{let c=normalizeContainer(t);if(c)return u(c,!0,resolveRootNamespace(c))},c},ssrDirectiveInitialized=!1,initDirectivesForSSR=()=>{ssrDirectiveInitialized||(ssrDirectiveInitialized=!0,initVModelForSSR(),initVShowForSSR())}}));function initDev(){initCustomFormatter()}var init_vue_runtime_esm_bundler=__esmMin((()=>{init_runtime_dom_esm_bundler(),init_runtime_dom_esm_bundler(),process.env.NODE_ENV!==`production`&&initDev()}));function hooks(){return hookCallback.apply(null,arguments)}function setHookCallback(t){hookCallback=t}function isArray$2(t){return t instanceof Array||Object.prototype.toString.call(t)===`[object Array]`}function isObject(t){return t!=null&&Object.prototype.toString.call(t)===`[object Object]`}function hasOwnProp(t,c){return Object.prototype.hasOwnProperty.call(t,c)}function isObjectEmpty(t){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(t).length===0;for(var c in t)if(hasOwnProp(t,c))return!1;return!0}function isUndefined(t){return t===void 0}function isNumber(t){return typeof t==`number`||Object.prototype.toString.call(t)===`[object Number]`}function isDate(t){return t instanceof Date||Object.prototype.toString.call(t)===`[object Date]`}function map(t,c){var u=[],d,m=t.length;for(d=0;d<m;++d)u.push(c(t[d],d));return u}function extend$1(t,c){for(var u in c)hasOwnProp(c,u)&&(t[u]=c[u]);return hasOwnProp(c,`toString`)&&(t.toString=c.toString),hasOwnProp(c,`valueOf`)&&(t.valueOf=c.valueOf),t}function createUTC(t,c,u,d){return createLocalOrUTC(t,c,u,d,!0).utc()}function defaultParsingFlags(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function getParsingFlags(t){return t._pf??(t._pf=defaultParsingFlags()),t._pf}function isValid(t){var c=null,u=!1,d=t._d&&!isNaN(t._d.getTime());if(d&&(c=getParsingFlags(t),u=some.call(c.parsedDateParts,function(t){return t!=null}),d=c.overflow<0&&!c.empty&&!c.invalidEra&&!c.invalidMonth&&!c.invalidWeekday&&!c.weekdayMismatch&&!c.nullInput&&!c.invalidFormat&&!c.userInvalidated&&(!c.meridiem||c.meridiem&&u),t._strict&&(d=d&&c.charsLeftOver===0&&c.unusedTokens.length===0&&c.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(t))t._isValid=d;else return d;return t._isValid}function createInvalid(t){var c=createUTC(NaN);return t==null?getParsingFlags(c).userInvalidated=!0:extend$1(getParsingFlags(c),t),c}function copyConfig(t,c){var u,d,m,g=momentProperties.length;if(isUndefined(c._isAMomentObject)||(t._isAMomentObject=c._isAMomentObject),isUndefined(c._i)||(t._i=c._i),isUndefined(c._f)||(t._f=c._f),isUndefined(c._l)||(t._l=c._l),isUndefined(c._strict)||(t._strict=c._strict),isUndefined(c._tzm)||(t._tzm=c._tzm),isUndefined(c._isUTC)||(t._isUTC=c._isUTC),isUndefined(c._offset)||(t._offset=c._offset),isUndefined(c._pf)||(t._pf=getParsingFlags(c)),isUndefined(c._locale)||(t._locale=c._locale),g>0)for(u=0;u<g;u++)d=momentProperties[u],m=c[d],isUndefined(m)||(t[d]=m);return t}function Moment(t){copyConfig(this,t),this._d=new Date(t._d==null?NaN:t._d.getTime()),this.isValid()||(this._d=new Date(NaN)),updateInProgress===!1&&(updateInProgress=!0,hooks.updateOffset(this),updateInProgress=!1)}function isMoment(t){return t instanceof Moment||t!=null&&t._isAMomentObject!=null}function warn(t){hooks.suppressDeprecationWarnings===!1&&typeof console<`u`&&console.warn&&console.warn(`Deprecation warning: `+t)}function deprecate(t,c){var u=!0;return extend$1(function(){if(hooks.deprecationHandler!=null&&hooks.deprecationHandler(null,t),u){var d=[],m,g,b,S=arguments.length;for(g=0;g<S;g++){if(m=``,typeof arguments[g]==`object`){for(b in m+=`
25
+ Component that was made reactive: `,t)),createBaseVNode(t,c,u,d,m,b,g,!0)}function guardReactiveProps(t){return t?isProxy(t)||isInternalObject(t)?extend$2({},t):t:null}function cloneVNode(t,c,u=!1,d=!1){let{props:m,ref:g,patchFlag:b,children:S,transition:C}=t,w=c?mergeProps(m||{},c):m,T={__v_isVNode:!0,__v_skip:!0,type:t.type,props:w,key:w&&normalizeKey$2(w),ref:c&&c.ref?u&&g?isArray$3(g)?g.concat(normalizeRef(c)):[g,normalizeRef(c)]:normalizeRef(c):g,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:process.env.NODE_ENV!==`production`&&b===-1&&isArray$3(S)?S.map(deepCloneVNode):S,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:c&&t.type!==Fragment?b===-1?16:b|16:b,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:C,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&cloneVNode(t.ssContent),ssFallback:t.ssFallback&&cloneVNode(t.ssFallback),el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return C&&d&&setTransitionHooks(T,C.clone(T)),T}function deepCloneVNode(t){let c=cloneVNode(t);return isArray$3(t.children)&&(c.children=t.children.map(deepCloneVNode)),c}function createTextVNode(t=` `,c=0){return createVNode(Text,null,t,c)}function createStaticVNode(t,c){let u=createVNode(Static,null,t);return u.staticCount=c,u}function createCommentVNode(t=``,c=!1){return c?(openBlock(),createBlock(Comment,null,t)):createVNode(Comment,null,t)}function normalizeVNode(t){return t==null||typeof t==`boolean`?createVNode(Comment):isArray$3(t)?createVNode(Fragment,null,t.slice()):isVNode(t)?cloneIfMounted(t):createVNode(Text,null,String(t))}function cloneIfMounted(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:cloneVNode(t)}function normalizeChildren(t,c){let u=0,{shapeFlag:d}=t;if(c==null)c=null;else if(isArray$3(c))u=16;else if(typeof c==`object`)if(d&65){let u=c.default;u&&(u._c&&(u._d=!1),normalizeChildren(t,u()),u._c&&(u._d=!0));return}else{u=32;let d=c._;!d&&!isInternalObject(c)?c._ctx=currentRenderingInstance:d===3&&currentRenderingInstance&&(currentRenderingInstance.slots._===1?c._=1:(c._=2,t.patchFlag|=1024))}else isFunction$1(c)?(c={default:c,_ctx:currentRenderingInstance},u=32):(c=String(c),d&64?(u=16,c=[createTextVNode(c)]):u=8);t.children=c,t.shapeFlag|=u}function mergeProps(...t){let c={};for(let u=0;u<t.length;u++){let d=t[u];for(let t in d)if(t===`class`)c.class!==d.class&&(c.class=normalizeClass([c.class,d.class]));else if(t===`style`)c.style=normalizeStyle([c.style,d.style]);else if(isOn(t)){let u=c[t],m=d[t];m&&u!==m&&!(isArray$3(u)&&u.includes(m))&&(c[t]=u?[].concat(u,m):m)}else t!==``&&(c[t]=d[t])}return c}function invokeVNodeHook(t,c,u,d=null){callWithAsyncErrorHandling(t,c,7,[u,d])}function createComponentInstance(t,c,u){let d=t.type,m=(c?c.appContext:t.appContext)||emptyAppContext,g={uid:uid++,vnode:t,type:d,parent:c,appContext:m,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new EffectScope(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:c?c.provides:Object.create(m.provides),ids:c?c.ids:[``,0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:normalizePropsOptions(d,m),emitsOptions:normalizeEmitsOptions(d,m),emit:null,emitted:null,propsDefaults:EMPTY_OBJ,inheritAttrs:d.inheritAttrs,ctx:EMPTY_OBJ,data:EMPTY_OBJ,props:EMPTY_OBJ,attrs:EMPTY_OBJ,slots:EMPTY_OBJ,refs:EMPTY_OBJ,setupState:EMPTY_OBJ,setupContext:null,suspense:u,suspenseId:u?u.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return process.env.NODE_ENV===`production`?g.ctx={_:g}:g.ctx=createDevRenderContext(g),g.root=c?c.root:g,g.emit=emit.bind(null,g),t.ce&&t.ce(g),g}function validateComponentName(t,{isNativeTag:c}){(isBuiltInTag(t)||c(t))&&warn$1(`Do not use built-in or reserved HTML elements as component id: `+t)}function isStatefulComponent(t){return t.vnode.shapeFlag&4}function setupComponent(t,c=!1,u=!1){c&&setInSSRSetupState(c);let{props:d,children:m}=t.vnode,g=isStatefulComponent(t);initProps(t,d,g,c),initSlots(t,m,u);let b=g?setupStatefulComponent(t,c):void 0;return c&&setInSSRSetupState(!1),b}function setupStatefulComponent(t,c){var u;let d=t.type;if(process.env.NODE_ENV!==`production`){if(d.name&&validateComponentName(d.name,t.appContext.config),d.components){let c=Object.keys(d.components);for(let u=0;u<c.length;u++)validateComponentName(c[u],t.appContext.config)}if(d.directives){let t=Object.keys(d.directives);for(let c=0;c<t.length;c++)validateDirectiveName(t[c])}d.compilerOptions&&isRuntimeOnly()&&warn$1(`"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.`)}t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,PublicInstanceProxyHandlers),process.env.NODE_ENV!==`production`&&exposePropsOnRenderContext(t);let{setup:m}=d;if(m){pauseTracking();let u=t.setupContext=m.length>1?createSetupContext(t):null,g=setCurrentInstance(t),b=callWithErrorHandling(m,t,0,[process.env.NODE_ENV===`production`?t.props:shallowReadonly(t.props),u]),S=isPromise(b);if(resetTracking(),g(),(S||t.sp)&&!isAsyncWrapper(t)&&markAsyncBoundary(t),S){if(b.then(unsetCurrentInstance,unsetCurrentInstance),c)return b.then(u=>{handleSetupResult(t,u,c)}).catch(c=>{handleError(c,t,0)});t.asyncDep=b,process.env.NODE_ENV!==`production`&&!t.suspense&&warn$1(`Component <${d.name??`Anonymous`}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.`)}else handleSetupResult(t,b,c)}else finishComponentSetup(t,c)}function handleSetupResult(t,c,u){isFunction$1(c)?t.type.__ssrInlineRender?t.ssrRender=c:t.render=c:isObject$1(c)?(process.env.NODE_ENV!==`production`&&isVNode(c)&&warn$1(`setup() should not return VNodes directly - return a render function instead.`),process.env.NODE_ENV!==`production`&&(t.devtoolsRawSetupState=c),t.setupState=proxyRefs(c),process.env.NODE_ENV!==`production`&&exposeSetupStateOnRenderContext(t)):process.env.NODE_ENV!==`production`&&c!==void 0&&warn$1(`setup() should return an object. Received: ${c===null?`null`:typeof c}`),finishComponentSetup(t,u)}function registerRuntimeCompiler(t){compile$1=t,installWithProxy=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,RuntimeCompiledPublicInstanceProxyHandlers))}}function finishComponentSetup(t,c,u){let d=t.type;if(!t.render){if(!c&&compile$1&&!d.render){let c=d.template||resolveMergedOptions(t).template;if(c){process.env.NODE_ENV!==`production`&&startMeasure(t,`compile`);let{isCustomElement:u,compilerOptions:m}=t.appContext.config,{delimiters:g,compilerOptions:b}=d,S=extend$2(extend$2({isCustomElement:u,delimiters:g},m),b);d.render=compile$1(c,S),process.env.NODE_ENV!==`production`&&endMeasure(t,`compile`)}}t.render=d.render||NOOP,installWithProxy&&installWithProxy(t)}{let c=setCurrentInstance(t);pauseTracking();try{applyOptions(t)}finally{resetTracking(),c()}}process.env.NODE_ENV!==`production`&&!d.render&&t.render===NOOP&&!c&&(!compile$1&&d.template?warn$1(`Component provided template option but runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".`):warn$1(`Component is missing template or render function: `,d))}function getSlotsProxy(t){return new Proxy(t.slots,{get(c,u){return track(t,`get`,`$slots`),c[u]}})}function createSetupContext(t){let expose=c=>{if(process.env.NODE_ENV!==`production`&&(t.exposed&&warn$1(`expose() should be called only once per setup().`),c!=null)){let t=typeof c;t===`object`&&(isArray$3(c)?t=`array`:isRef(c)&&(t=`ref`)),t!==`object`&&warn$1(`expose() should be passed a plain object, received ${t}.`)}t.exposed=c||{}};if(process.env.NODE_ENV!==`production`){let c,u;return Object.freeze({get attrs(){return c||(c=new Proxy(t.attrs,attrsProxyHandlers))},get slots(){return u||(u=getSlotsProxy(t))},get emit(){return(c,...u)=>t.emit(c,...u)},expose})}else return{attrs:new Proxy(t.attrs,attrsProxyHandlers),slots:t.slots,emit:t.emit,expose}}function getComponentPublicInstance(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(proxyRefs(markRaw(t.exposed)),{get(c,u){if(u in c)return c[u];if(u in publicPropertiesMap)return publicPropertiesMap[u](t)},has(t,c){return c in t||c in publicPropertiesMap}})):t.proxy}function getComponentName(t,c=!0){return isFunction$1(t)?t.displayName||t.name:t.name||c&&t.__name}function formatComponentName(t,c,u=!1){let d=getComponentName(c);if(!d&&c.__file){let t=c.__file.match(/([^/\\]+)\.\w+$/);t&&(d=t[1])}if(!d&&t&&t.parent){let inferFromRegistry=t=>{for(let u in t)if(t[u]===c)return u};d=inferFromRegistry(t.components||t.parent.type.components)||inferFromRegistry(t.appContext.components)}return d?classify(d):u?`App`:`Anonymous`}function isClassComponent(t){return isFunction$1(t)&&`__vccOpts`in t}function h$2(t,c,u){let d=arguments.length;return d===2?isObject$1(c)&&!isArray$3(c)?isVNode(c)?createVNode(t,null,[c]):createVNode(t,c):createVNode(t,null,c):(d>3?u=Array.prototype.slice.call(arguments,2):d===3&&isVNode(u)&&(u=[u]),createVNode(t,c,u))}function initCustomFormatter(){if(process.env.NODE_ENV===`production`||typeof window>`u`)return;let t={style:`color:#3ba776`},c={style:`color:#1677ff`},u={style:`color:#f5222d`},d={style:`color:#eb2f96`},m={__vue_custom_formatter:!0,header(c){return isObject$1(c)?c.__isVue?[`div`,t,`VueInstance`]:isRef(c)?[`div`,{},[`span`,t,genRefFlag(c)],`<`,formatValue(`_value`in c?c._value:c),`>`]:isReactive(c)?[`div`,{},[`span`,t,isShallow(c)?`ShallowReactive`:`Reactive`],`<`,formatValue(c),`>${isReadonly(c)?` (readonly)`:``}`]:isReadonly(c)?[`div`,{},[`span`,t,isShallow(c)?`ShallowReadonly`:`Readonly`],`<`,formatValue(c),`>`]:null:null},hasBody(t){return t&&t.__isVue},body(t){if(t&&t.__isVue)return[`div`,{},...formatInstance(t.$)]}};function formatInstance(t){let c=[];t.type.props&&t.props&&c.push(createInstanceBlock(`props`,toRaw(t.props))),t.setupState!==EMPTY_OBJ&&c.push(createInstanceBlock(`setup`,t.setupState)),t.data!==EMPTY_OBJ&&c.push(createInstanceBlock(`data`,toRaw(t.data)));let u=extractKeys(t,`computed`);u&&c.push(createInstanceBlock(`computed`,u));let m=extractKeys(t,`inject`);return m&&c.push(createInstanceBlock(`injected`,m)),c.push([`div`,{},[`span`,{style:d.style+`;opacity:0.66`},`$ (internal): `],[`object`,{object:t}]]),c}function createInstanceBlock(t,c){return c=extend$2({},c),Object.keys(c).length?[`div`,{style:`line-height:1.25em;margin-bottom:0.6em`},[`div`,{style:`color:#476582`},t],[`div`,{style:`padding-left:1.25em`},...Object.keys(c).map(t=>[`div`,{},[`span`,d,t+`: `],formatValue(c[t],!1)])]]:[`span`,{}]}function formatValue(t,m=!0){return typeof t==`number`?[`span`,c,t]:typeof t==`string`?[`span`,u,JSON.stringify(t)]:typeof t==`boolean`?[`span`,d,t]:isObject$1(t)?[`object`,{object:m?toRaw(t):t}]:[`span`,u,String(t)]}function extractKeys(t,c){let u=t.type;if(isFunction$1(u))return;let d={};for(let m in t.ctx)isKeyOfType(u,m,c)&&(d[m]=t.ctx[m]);return d}function isKeyOfType(t,c,u){let d=t[u];if(isArray$3(d)&&d.includes(c)||isObject$1(d)&&c in d||t.extends&&isKeyOfType(t.extends,c,u)||t.mixins&&t.mixins.some(t=>isKeyOfType(t,c,u)))return!0}function genRefFlag(t){return isShallow(t)?`ShallowRef`:t.effect?`ComputedRef`:`Ref`}window.devtoolsFormatters?window.devtoolsFormatters.push(m):window.devtoolsFormatters=[m]}function withMemo(t,c,u,d){let m=u[d];if(m&&isMemoSame(m,t))return m;let g=c();return g.memo=t.slice(),g.cacheIndex=d,u[d]=g}function isMemoSame(t,c){let u=t.memo;if(u.length!=c.length)return!1;for(let t=0;t<u.length;t++)if(hasChanged(u[t],c[t]))return!1;return isBlockTreeEnabled>0&&currentBlock&&currentBlock.push(t),!0}var stack$1,isWarning,ErrorCodes$1,ErrorTypeStrings$1,queue$1,flushIndex,pendingPostFlushCbs,activePostFlushCbs,postFlushIndex,resolvedPromise,currentFlushPromise,RECURSION_LIMIT,getId,isHmrUpdating,hmrDirtyComponents,map$1,devtools$1,buffer,devtoolsNotInstalled,devtoolsComponentAdded,devtoolsComponentUpdated,_devtoolsComponentRemoved,devtoolsComponentRemoved,devtoolsPerfStart,devtoolsPerfEnd,currentRenderingInstance,currentScopeId,withScopeId,TeleportEndKey,isTeleport,isTeleportDisabled,isTeleportDeferred,isTargetSVG,isTargetMathML,resolveTarget,TeleportImpl,Teleport,leaveCbKey,enterCbKey$1,TransitionHookValidator,BaseTransitionPropsValidators,recursiveGetSubtree,BaseTransitionImpl,BaseTransition,knownTemplateRefs,hasLoggedMismatchError,logMismatchError,isSVGContainer,isMathMLContainer,getContainerType,isComment,allowMismatchAttr,MismatchTypeString,requestIdleCallback,cancelIdleCallback,hydrateOnIdle,hydrateOnVisible,hydrateOnMediaQuery,hydrateOnInteraction,isAsyncWrapper,isKeepAlive,KeepAlive,createHook,onBeforeMount,onMounted,onBeforeUpdate,onUpdated,onBeforeUnmount,onUnmounted,onServerPrefetch,onRenderTriggered,onRenderTracked,COMPONENTS,DIRECTIVES,NULL_DYNAMIC_COMPONENT,getPublicInstance,publicPropertiesMap,isReservedPrefix,hasSetupBinding,PublicInstanceProxyHandlers,RuntimeCompiledPublicInstanceProxyHandlers,warnRuntimeUsage,shouldCacheAccess,internalOptionMergeStrats,uid$1,currentApp,internalObjectProto,createInternalObject,isInternalObject,mixinPropsCache,isSimpleType,isInternalKey,normalizeSlotValue,normalizeSlot,normalizeObjectSlots,normalizeVNodeSlots,assignSlots,initSlots,updateSlots,supported,perf,queuePostRenderEffect,ssrContextKey,useSSRContext,getModelModifiers,accessedAttrs,getChildRoot,getFunctionalFallthrough,filterModelListeners,isElementRoot,isSuspense,suspenseId,Suspense,hasWarned,Fragment,Text,Comment,Static,blockStack,currentBlock,isBlockTreeEnabled,vnodeArgsTransformer,createVNodeWithArgsTransform,normalizeKey$2,normalizeRef,createVNode,emptyAppContext,uid,currentInstance,getCurrentInstance,internalSetCurrentInstance,setInSSRSetupState,setCurrentInstance,unsetCurrentInstance,isBuiltInTag,isInSSRComponentSetup,compile$1,installWithProxy,isRuntimeOnly,attrsProxyHandlers,classifyRE,classify,computed,version$2,warn$2,ErrorTypeStrings,devtools,setDevtoolsHook,ssrUtils,resolveFilter,compatUtils,DeprecationTypes,init_runtime_core_esm_bundler=__esmMin((()=>{init_reactivity_esm_bundler(),init_shared_esm_bundler(),stack$1=[],isWarning=!1,ErrorCodes$1={SETUP_FUNCTION:0,0:`SETUP_FUNCTION`,RENDER_FUNCTION:1,1:`RENDER_FUNCTION`,NATIVE_EVENT_HANDLER:5,5:`NATIVE_EVENT_HANDLER`,COMPONENT_EVENT_HANDLER:6,6:`COMPONENT_EVENT_HANDLER`,VNODE_HOOK:7,7:`VNODE_HOOK`,DIRECTIVE_HOOK:8,8:`DIRECTIVE_HOOK`,TRANSITION_HOOK:9,9:`TRANSITION_HOOK`,APP_ERROR_HANDLER:10,10:`APP_ERROR_HANDLER`,APP_WARN_HANDLER:11,11:`APP_WARN_HANDLER`,FUNCTION_REF:12,12:`FUNCTION_REF`,ASYNC_COMPONENT_LOADER:13,13:`ASYNC_COMPONENT_LOADER`,SCHEDULER:14,14:`SCHEDULER`,COMPONENT_UPDATE:15,15:`COMPONENT_UPDATE`,APP_UNMOUNT_CLEANUP:16,16:`APP_UNMOUNT_CLEANUP`},ErrorTypeStrings$1={sp:`serverPrefetch hook`,bc:`beforeCreate hook`,c:`created hook`,bm:`beforeMount hook`,m:`mounted hook`,bu:`beforeUpdate hook`,u:`updated`,bum:`beforeUnmount hook`,um:`unmounted hook`,a:`activated hook`,da:`deactivated hook`,ec:`errorCaptured hook`,rtc:`renderTracked hook`,rtg:`renderTriggered hook`,0:`setup function`,1:`render function`,2:`watcher getter`,3:`watcher callback`,4:`watcher cleanup function`,5:`native event handler`,6:`component event handler`,7:`vnode hook`,8:`directive hook`,9:`transition hook`,10:`app errorHandler`,11:`app warnHandler`,12:`ref function`,13:`async component loader`,14:`scheduler flush`,15:`component update`,16:`app unmount cleanup function`},queue$1=[],flushIndex=-1,pendingPostFlushCbs=[],activePostFlushCbs=null,postFlushIndex=0,resolvedPromise=Promise.resolve(),currentFlushPromise=null,RECURSION_LIMIT=100,__name$2(nextTick$2,`nextTick`),getId=t=>t.id==null?t.flags&2?-1:1/0:t.id,isHmrUpdating=!1,hmrDirtyComponents=new Map,process.env.NODE_ENV!==`production`&&(getGlobalThis().__VUE_HMR_RUNTIME__={createRecord:tryWrap(createRecord),rerender:tryWrap(rerender),reload:tryWrap(reload)}),map$1=new Map,buffer=[],devtoolsNotInstalled=!1,devtoolsComponentAdded=createDevtoolsComponentHook(`component:added`),devtoolsComponentUpdated=createDevtoolsComponentHook(`component:updated`),_devtoolsComponentRemoved=createDevtoolsComponentHook(`component:removed`),devtoolsComponentRemoved=t=>{devtools$1&&typeof devtools$1.cleanupBuffer==`function`&&!devtools$1.cleanupBuffer(t)&&_devtoolsComponentRemoved(t)},devtoolsPerfStart=createDevtoolsPerformanceHook(`perf:start`),devtoolsPerfEnd=createDevtoolsPerformanceHook(`perf:end`),currentRenderingInstance=null,currentScopeId=null,withScopeId=t=>withCtx,TeleportEndKey=Symbol(`_vte`),isTeleport=t=>t.__isTeleport,isTeleportDisabled=t=>t&&(t.disabled||t.disabled===``),isTeleportDeferred=t=>t&&(t.defer||t.defer===``),isTargetSVG=t=>typeof SVGElement<`u`&&t instanceof SVGElement,isTargetMathML=t=>typeof MathMLElement==`function`&&t instanceof MathMLElement,resolveTarget=(t,c)=>{let u=t&&t.to;if(isString$1(u))if(c){let d=c(u);return process.env.NODE_ENV!==`production`&&!d&&!isTeleportDisabled(t)&&warn$1(`Failed to locate Teleport target with selector "${u}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`),d}else return process.env.NODE_ENV!==`production`&&warn$1(`Current renderer does not support string target for Teleports. (missing querySelector renderer option)`),null;else return process.env.NODE_ENV!==`production`&&!u&&!isTeleportDisabled(t)&&warn$1(`Invalid Teleport target: ${u}`),u},TeleportImpl={name:`Teleport`,__isTeleport:!0,process(t,c,u,d,m,g,b,S,C,w){let{mc:T,pc:E,pbc:D,o:{insert:O,querySelector:Or,createText:kr,createComment:Ar}}=w,jr=isTeleportDisabled(c.props),{shapeFlag:Mr,children:Nr,dynamicChildren:Pr}=c;if(process.env.NODE_ENV!==`production`&&isHmrUpdating&&(C=!1,Pr=null),t==null){let t=c.el=process.env.NODE_ENV===`production`?kr(``):Ar(`teleport start`),w=c.anchor=process.env.NODE_ENV===`production`?kr(``):Ar(`teleport end`);O(t,u,d),O(w,u,d);let mount=(t,c)=>{Mr&16&&(m&&m.isCE&&(m.ce._teleportTarget=t),T(Nr,t,c,m,g,b,S,C))},mountToTarget=()=>{let t=c.target=resolveTarget(c.props,Or),u=prepareAnchor(t,c,kr,O);t?(b!==`svg`&&isTargetSVG(t)?b=`svg`:b!==`mathml`&&isTargetMathML(t)&&(b=`mathml`),jr||(mount(t,u),updateCssVars(c,!1))):process.env.NODE_ENV!==`production`&&!jr&&warn$1(`Invalid Teleport target on mount:`,t,`(${typeof t})`)};jr&&(mount(u,w),updateCssVars(c,!0)),isTeleportDeferred(c.props)?queuePostRenderEffect(()=>{mountToTarget(),c.el.__isMounted=!0},g):mountToTarget()}else{if(isTeleportDeferred(c.props)&&!t.el.__isMounted){queuePostRenderEffect(()=>{TeleportImpl.process(t,c,u,d,m,g,b,S,C,w),delete t.el.__isMounted},g);return}c.el=t.el,c.targetStart=t.targetStart;let T=c.anchor=t.anchor,O=c.target=t.target,kr=c.targetAnchor=t.targetAnchor,Ar=isTeleportDisabled(t.props),Mr=Ar?u:O,Nr=Ar?T:kr;if(b===`svg`||isTargetSVG(O)?b=`svg`:(b===`mathml`||isTargetMathML(O))&&(b=`mathml`),Pr?(D(t.dynamicChildren,Pr,Mr,m,g,b,S),traverseStaticChildren(t,c,!0)):C||E(t,c,Mr,Nr,m,g,b,S,!1),jr)Ar?c.props&&t.props&&c.props.to!==t.props.to&&(c.props.to=t.props.to):moveTeleport(c,u,T,w,1);else if((c.props&&c.props.to)!==(t.props&&t.props.to)){let t=c.target=resolveTarget(c.props,Or);t?moveTeleport(c,t,null,w,0):process.env.NODE_ENV!==`production`&&warn$1(`Invalid Teleport target on update:`,O,`(${typeof O})`)}else Ar&&moveTeleport(c,O,kr,w,1);updateCssVars(c,jr)}},remove(t,c,u,{um:d,o:{remove:m}},g){let{shapeFlag:b,children:S,anchor:C,targetStart:w,targetAnchor:T,target:E,props:D}=t;if(E&&(m(w),m(T)),g&&m(C),b&16){let t=g||!isTeleportDisabled(D);for(let m=0;m<S.length;m++){let g=S[m];d(g,c,u,t,!!g.dynamicChildren)}}},move:moveTeleport,hydrate:hydrateTeleport},Teleport=TeleportImpl,leaveCbKey=Symbol(`_leaveCb`),enterCbKey$1=Symbol(`_enterCb`),TransitionHookValidator=[Function,Array],BaseTransitionPropsValidators={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:TransitionHookValidator,onEnter:TransitionHookValidator,onAfterEnter:TransitionHookValidator,onEnterCancelled:TransitionHookValidator,onBeforeLeave:TransitionHookValidator,onLeave:TransitionHookValidator,onAfterLeave:TransitionHookValidator,onLeaveCancelled:TransitionHookValidator,onBeforeAppear:TransitionHookValidator,onAppear:TransitionHookValidator,onAfterAppear:TransitionHookValidator,onAppearCancelled:TransitionHookValidator},recursiveGetSubtree=t=>{let c=t.subTree;return c.component?recursiveGetSubtree(c.component):c},BaseTransitionImpl={name:`BaseTransition`,props:BaseTransitionPropsValidators,setup(t,{slots:c}){let u=getCurrentInstance(),d=useTransitionState();return()=>{let m=c.default&&getTransitionRawChildren(c.default(),!0);if(!m||!m.length)return;let g=findNonCommentChild(m),b=toRaw(t),{mode:S}=b;if(process.env.NODE_ENV!==`production`&&S&&S!==`in-out`&&S!==`out-in`&&S!==`default`&&warn$1(`invalid <transition> mode: ${S}`),d.isLeaving)return emptyPlaceholder(g);let C=getInnerChild$1(g);if(!C)return emptyPlaceholder(g);let w=resolveTransitionHooks(C,b,d,u,t=>w=t);C.type!==Comment&&setTransitionHooks(C,w);let T=u.subTree&&getInnerChild$1(u.subTree);if(T&&T.type!==Comment&&!isSameVNodeType(C,T)&&recursiveGetSubtree(u).type!==Comment){let t=resolveTransitionHooks(T,b,d,u);if(setTransitionHooks(T,t),S===`out-in`&&C.type!==Comment)return d.isLeaving=!0,t.afterLeave=()=>{d.isLeaving=!1,u.job.flags&8||u.update(),delete t.afterLeave,T=void 0},emptyPlaceholder(g);S===`in-out`&&C.type!==Comment?t.delayLeave=(t,c,u)=>{let m=getLeavingNodesForType(d,T);m[String(T.key)]=T,t[leaveCbKey]=()=>{c(),t[leaveCbKey]=void 0,delete w.delayedLeave,T=void 0},w.delayedLeave=()=>{u(),delete w.delayedLeave,T=void 0}}:T=void 0}else T&&(T=void 0);return g}}},BaseTransition=BaseTransitionImpl,knownTemplateRefs=new WeakSet,hasLoggedMismatchError=!1,logMismatchError=()=>{hasLoggedMismatchError||(console.error(`Hydration completed but contains mismatches.`),hasLoggedMismatchError=!0)},isSVGContainer=t=>t.namespaceURI.includes(`svg`)&&t.tagName!==`foreignObject`,isMathMLContainer=t=>t.namespaceURI.includes(`MathML`),getContainerType=t=>{if(t.nodeType===1){if(isSVGContainer(t))return`svg`;if(isMathMLContainer(t))return`mathml`}},isComment=t=>t.nodeType===8,allowMismatchAttr=`data-allow-mismatch`,MismatchTypeString={0:`text`,1:`children`,2:`class`,3:`style`,4:`attribute`},requestIdleCallback=getGlobalThis().requestIdleCallback||(t=>setTimeout(t,1)),cancelIdleCallback=getGlobalThis().cancelIdleCallback||(t=>clearTimeout(t)),hydrateOnIdle=(t=1e4)=>c=>{let u=requestIdleCallback(c,{timeout:t});return()=>cancelIdleCallback(u)},hydrateOnVisible=t=>(c,u)=>{let d=new IntersectionObserver(t=>{for(let u of t)if(u.isIntersecting){d.disconnect(),c();break}},t);return u(t=>{if(t instanceof Element){if(elementIsVisibleInViewport(t))return c(),d.disconnect(),!1;d.observe(t)}}),()=>d.disconnect()},hydrateOnMediaQuery=t=>c=>{if(t){let u=matchMedia(t);if(u.matches)c();else return u.addEventListener(`change`,c,{once:!0}),()=>u.removeEventListener(`change`,c)}},hydrateOnInteraction=(t=[])=>(c,u)=>{isString$1(t)&&(t=[t]);let d=!1,doHydrate=t=>{d||(d=!0,teardown(),c(),t.target.dispatchEvent(new t.constructor(t.type,t)))},teardown=()=>{u(c=>{for(let u of t)c.removeEventListener(u,doHydrate)})};return u(c=>{for(let u of t)c.addEventListener(u,doHydrate,{once:!0})}),teardown},isAsyncWrapper=t=>!!t.type.__asyncLoader,isKeepAlive=t=>t.type.__isKeepAlive,KeepAlive={name:`KeepAlive`,__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(t,{slots:c}){let u=getCurrentInstance(),d=u.ctx;if(!d.renderer)return()=>{let t=c.default&&c.default();return t&&t.length===1?t[0]:t};let m=new Map,g=new Set,b=null;process.env.NODE_ENV!==`production`&&(u.__v_cache=m);let S=u.suspense,{renderer:{p:C,m:w,um:T,o:{createElement:E}}}=d,D=E(`div`);d.activate=(t,c,u,d,m)=>{let g=t.component;w(t,c,u,0,S),C(g.vnode,t,c,u,g,S,d,t.slotScopeIds,m),queuePostRenderEffect(()=>{g.isDeactivated=!1,g.a&&invokeArrayFns(g.a);let c=t.props&&t.props.onVnodeMounted;c&&invokeVNodeHook(c,g.parent,t)},S),process.env.NODE_ENV!==`production`&&devtoolsComponentAdded(g)},d.deactivate=t=>{let c=t.component;invalidateMount(c.m),invalidateMount(c.a),w(t,D,null,1,S),queuePostRenderEffect(()=>{c.da&&invokeArrayFns(c.da);let u=t.props&&t.props.onVnodeUnmounted;u&&invokeVNodeHook(u,c.parent,t),c.isDeactivated=!0},S),process.env.NODE_ENV!==`production`&&devtoolsComponentAdded(c)};function unmount(t){resetShapeFlag(t),T(t,u,S,!0)}function pruneCache(t){m.forEach((c,u)=>{let d=getComponentName(c.type);d&&!t(d)&&pruneCacheEntry(u)})}function pruneCacheEntry(t){let c=m.get(t);c&&(!b||!isSameVNodeType(c,b))?unmount(c):b&&resetShapeFlag(b),m.delete(t),g.delete(t)}watch(()=>[t.include,t.exclude],([t,c])=>{t&&pruneCache(c=>matches$1(t,c)),c&&pruneCache(t=>!matches$1(c,t))},{flush:`post`,deep:!0});let O=null,cacheSubtree=()=>{O!=null&&(isSuspense(u.subTree.type)?queuePostRenderEffect(()=>{m.set(O,getInnerChild(u.subTree))},u.subTree.suspense):m.set(O,getInnerChild(u.subTree)))};return onMounted(cacheSubtree),onUpdated(cacheSubtree),onBeforeUnmount(()=>{m.forEach(t=>{let{subTree:c,suspense:d}=u,m=getInnerChild(c);if(t.type===m.type&&t.key===m.key){resetShapeFlag(m);let t=m.component.da;t&&queuePostRenderEffect(t,d);return}unmount(t)})}),()=>{if(O=null,!c.default)return b=null;let u=c.default(),d=u[0];if(u.length>1)return process.env.NODE_ENV!==`production`&&warn$1(`KeepAlive should contain exactly one component child.`),b=null,u;if(!isVNode(d)||!(d.shapeFlag&4)&&!(d.shapeFlag&128))return b=null,d;let S=getInnerChild(d);if(S.type===Comment)return b=null,S;let C=S.type,w=getComponentName(isAsyncWrapper(S)?S.type.__asyncResolved||{}:C),{include:T,exclude:E,max:D}=t;if(T&&(!w||!matches$1(T,w))||E&&w&&matches$1(E,w))return S.shapeFlag&=-257,b=S,d;let Or=S.key==null?C:S.key,kr=m.get(Or);return S.el&&(S=cloneVNode(S),d.shapeFlag&128&&(d.ssContent=S)),O=Or,kr?(S.el=kr.el,S.component=kr.component,S.transition&&setTransitionHooks(S,S.transition),S.shapeFlag|=512,g.delete(Or),g.add(Or)):(g.add(Or),D&&g.size>parseInt(D,10)&&pruneCacheEntry(g.values().next().value)),S.shapeFlag|=256,b=S,isSuspense(d.type)?d:S}}},__name$2(matches$1,`matches`),createHook=t=>(c,u=currentInstance)=>{(!isInSSRComponentSetup||t===`sp`)&&injectHook(t,(...t)=>c(...t),u)},onBeforeMount=createHook(`bm`),onMounted=createHook(`m`),onBeforeUpdate=createHook(`bu`),onUpdated=createHook(`u`),onBeforeUnmount=createHook(`bum`),onUnmounted=createHook(`um`),onServerPrefetch=createHook(`sp`),onRenderTriggered=createHook(`rtg`),onRenderTracked=createHook(`rtc`),COMPONENTS=`components`,DIRECTIVES=`directives`,NULL_DYNAMIC_COMPONENT=Symbol.for(`v-ndc`),getPublicInstance=t=>t?isStatefulComponent(t)?getComponentPublicInstance(t):getPublicInstance(t.parent):null,publicPropertiesMap=extend$2(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>process.env.NODE_ENV===`production`?t.props:shallowReadonly(t.props),$attrs:t=>process.env.NODE_ENV===`production`?t.attrs:shallowReadonly(t.attrs),$slots:t=>process.env.NODE_ENV===`production`?t.slots:shallowReadonly(t.slots),$refs:t=>process.env.NODE_ENV===`production`?t.refs:shallowReadonly(t.refs),$parent:t=>getPublicInstance(t.parent),$root:t=>getPublicInstance(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>resolveMergedOptions(t),$forceUpdate:t=>t.f||(t.f=()=>{queueJob(t.update)}),$nextTick:t=>t.n||(t.n=nextTick$2.bind(t.proxy)),$watch:t=>instanceWatch.bind(t)}),isReservedPrefix=t=>t===`_`||t===`$`,hasSetupBinding=(t,c)=>t!==EMPTY_OBJ&&!t.__isScriptSetup&&hasOwn(t,c),PublicInstanceProxyHandlers={get({_:t},c){if(c===`__v_skip`)return!0;let{ctx:u,setupState:d,data:m,props:g,accessCache:b,type:S,appContext:C}=t;if(process.env.NODE_ENV!==`production`&&c===`__isVue`)return!0;let w;if(c[0]!==`$`){let S=b[c];if(S!==void 0)switch(S){case 1:return d[c];case 2:return m[c];case 4:return u[c];case 3:return g[c]}else if(hasSetupBinding(d,c))return b[c]=1,d[c];else if(m!==EMPTY_OBJ&&hasOwn(m,c))return b[c]=2,m[c];else if((w=t.propsOptions[0])&&hasOwn(w,c))return b[c]=3,g[c];else if(u!==EMPTY_OBJ&&hasOwn(u,c))return b[c]=4,u[c];else shouldCacheAccess&&(b[c]=0)}let T=publicPropertiesMap[c],E,D;if(T)return c===`$attrs`?(track(t.attrs,`get`,``),process.env.NODE_ENV!==`production`&&markAttrsAccessed()):process.env.NODE_ENV!==`production`&&c===`$slots`&&track(t,`get`,c),T(t);if((E=S.__cssModules)&&(E=E[c]))return E;if(u!==EMPTY_OBJ&&hasOwn(u,c))return b[c]=4,u[c];if(D=C.config.globalProperties,hasOwn(D,c))return D[c];process.env.NODE_ENV!==`production`&&currentRenderingInstance&&(!isString$1(c)||c.indexOf(`__v`)!==0)&&(m!==EMPTY_OBJ&&isReservedPrefix(c[0])&&hasOwn(m,c)?warn$1(`Property ${JSON.stringify(c)} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`):t===currentRenderingInstance&&warn$1(`Property ${JSON.stringify(c)} was accessed during render but is not defined on instance.`))},set({_:t},c,u){let{data:d,setupState:m,ctx:g}=t;return hasSetupBinding(m,c)?(m[c]=u,!0):process.env.NODE_ENV!==`production`&&m.__isScriptSetup&&hasOwn(m,c)?(warn$1(`Cannot mutate <script setup> binding "${c}" from Options API.`),!1):d!==EMPTY_OBJ&&hasOwn(d,c)?(d[c]=u,!0):hasOwn(t.props,c)?(process.env.NODE_ENV!==`production`&&warn$1(`Attempting to mutate prop "${c}". Props are readonly.`),!1):c[0]===`$`&&c.slice(1)in t?(process.env.NODE_ENV!==`production`&&warn$1(`Attempting to mutate public property "${c}". Properties starting with $ are reserved and readonly.`),!1):(process.env.NODE_ENV!==`production`&&c in t.appContext.config.globalProperties?Object.defineProperty(g,c,{enumerable:!0,configurable:!0,value:u}):g[c]=u,!0)},has({_:{data:t,setupState:c,accessCache:u,ctx:d,appContext:m,propsOptions:g}},b){let S;return!!u[b]||t!==EMPTY_OBJ&&hasOwn(t,b)||hasSetupBinding(c,b)||(S=g[0])&&hasOwn(S,b)||hasOwn(d,b)||hasOwn(publicPropertiesMap,b)||hasOwn(m.config.globalProperties,b)},defineProperty(t,c,u){return u.get==null?hasOwn(u,`value`)&&this.set(t,c,u.value,null):t._.accessCache[c]=0,Reflect.defineProperty(t,c,u)}},process.env.NODE_ENV!==`production`&&(PublicInstanceProxyHandlers.ownKeys=t=>(warn$1(`Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.`),Reflect.ownKeys(t))),RuntimeCompiledPublicInstanceProxyHandlers=extend$2({},PublicInstanceProxyHandlers,{get(t,c){if(c!==Symbol.unscopables)return PublicInstanceProxyHandlers.get(t,c,t)},has(t,c){let u=c[0]!==`_`&&!isGloballyAllowed(c);return process.env.NODE_ENV!==`production`&&!u&&PublicInstanceProxyHandlers.has(t,c)&&warn$1(`Property ${JSON.stringify(c)} should not start with _ which is a reserved prefix for Vue internals.`),u}}),warnRuntimeUsage=t=>warn$1(`${t}() is a compiler-hint helper that is only usable inside <script setup> of a single file component. Its arguments should be compiled away and passing it at runtime has no effect.`),shouldCacheAccess=!0,__name$2(callHook$1,`callHook`),internalOptionMergeStrats={data:mergeDataFn,props:mergeEmitsOrPropsOptions,emits:mergeEmitsOrPropsOptions,methods:mergeObjectOptions,computed:mergeObjectOptions,beforeCreate:mergeAsArray$1,created:mergeAsArray$1,beforeMount:mergeAsArray$1,mounted:mergeAsArray$1,beforeUpdate:mergeAsArray$1,updated:mergeAsArray$1,beforeDestroy:mergeAsArray$1,beforeUnmount:mergeAsArray$1,destroyed:mergeAsArray$1,unmounted:mergeAsArray$1,activated:mergeAsArray$1,deactivated:mergeAsArray$1,errorCaptured:mergeAsArray$1,serverPrefetch:mergeAsArray$1,components:mergeObjectOptions,directives:mergeObjectOptions,watch:mergeWatchOptions,provide:mergeDataFn,inject:mergeInject},__name$2(mergeAsArray$1,`mergeAsArray`),uid$1=0,currentApp=null,internalObjectProto={},createInternalObject=()=>Object.create(internalObjectProto),isInternalObject=t=>Object.getPrototypeOf(t)===internalObjectProto,mixinPropsCache=new WeakMap,isSimpleType=makeMap(`String,Number,Boolean,Function,Symbol,BigInt`),isInternalKey=t=>t[0]===`_`||t===`$stable`,normalizeSlotValue=t=>isArray$3(t)?t.map(normalizeVNode):[normalizeVNode(t)],normalizeSlot=(t,c,u)=>{if(c._n)return c;let d=withCtx((...d)=>(process.env.NODE_ENV!==`production`&&currentInstance&&(!u||u.root===currentInstance.root)&&warn$1(`Slot "${t}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`),normalizeSlotValue(c(...d))),u);return d._c=!1,d},normalizeObjectSlots=(t,c,u)=>{let d=t._ctx;for(let u in t){if(isInternalKey(u))continue;let m=t[u];if(isFunction$1(m))c[u]=normalizeSlot(u,m,d);else if(m!=null){process.env.NODE_ENV!==`production`&&warn$1(`Non-function value encountered for slot "${u}". Prefer function slots for better performance.`);let t=normalizeSlotValue(m);c[u]=()=>t}}},normalizeVNodeSlots=(t,c)=>{process.env.NODE_ENV!==`production`&&!isKeepAlive(t.vnode)&&warn$1(`Non-function value encountered for default slot. Prefer function slots for better performance.`);let u=normalizeSlotValue(c);t.slots.default=()=>u},assignSlots=(t,c,u)=>{for(let d in c)(u||d!==`_`)&&(t[d]=c[d])},initSlots=(t,c,u)=>{let d=t.slots=createInternalObject();if(t.vnode.shapeFlag&32){let t=c._;t?(assignSlots(d,c,u),u&&def(d,`_`,t,!0)):normalizeObjectSlots(c,d)}else c&&normalizeVNodeSlots(t,c)},updateSlots=(t,c,u)=>{let{vnode:d,slots:m}=t,g=!0,b=EMPTY_OBJ;if(d.shapeFlag&32){let d=c._;d?process.env.NODE_ENV!==`production`&&isHmrUpdating?(assignSlots(m,c,u),trigger(t,`set`,`$slots`)):u&&d===1?g=!1:assignSlots(m,c,u):(g=!c.$stable,normalizeObjectSlots(c,m)),b=c}else c&&(normalizeVNodeSlots(t,c),b={default:1});if(g)for(let t in m)!isInternalKey(t)&&b[t]==null&&delete m[t]},queuePostRenderEffect=queueEffectWithSuspense,ssrContextKey=Symbol.for(`v-scx`),useSSRContext=()=>{{let t=inject(ssrContextKey);return t||process.env.NODE_ENV!==`production`&&warn$1(`Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`),t}},getModelModifiers=(t,c)=>c===`modelValue`||c===`model-value`?t.modelModifiers:t[`${c}Modifiers`]||t[`${camelize(c)}Modifiers`]||t[`${hyphenate(c)}Modifiers`],accessedAttrs=!1,getChildRoot=t=>{let c=t.children,u=t.dynamicChildren,d=filterSingleRoot(c,!1);if(!d)return[t,void 0];if(process.env.NODE_ENV!==`production`&&d.patchFlag>0&&d.patchFlag&2048)return getChildRoot(d);let m=c.indexOf(d),g=u?u.indexOf(d):-1,setRoot=d=>{c[m]=d,u&&(g>-1?u[g]=d:d.patchFlag>0&&(t.dynamicChildren=[...u,d]))};return[normalizeVNode(d),setRoot]},getFunctionalFallthrough=t=>{let c;for(let u in t)(u===`class`||u===`style`||isOn(u))&&((c||(c={}))[u]=t[u]);return c},filterModelListeners=(t,c)=>{let u={};for(let d in t)(!isModelListener(d)||!(d.slice(9)in c))&&(u[d]=t[d]);return u},isElementRoot=t=>t.shapeFlag&7||t.type===Comment,isSuspense=t=>t.__isSuspense,suspenseId=0,Suspense={name:`Suspense`,__isSuspense:!0,process(t,c,u,d,m,g,b,S,C,w){if(t==null)mountSuspense(c,u,d,m,g,b,S,C,w);else{if(g&&g.deps>0&&!t.suspense.isInFallback){c.suspense=t.suspense,c.suspense.vnode=c,c.el=t.el;return}patchSuspense(t,c,u,d,m,b,S,C,w)}},hydrate:hydrateSuspense,normalize:normalizeSuspenseChildren},hasWarned=!1,Fragment=Symbol.for(`v-fgt`),Text=Symbol.for(`v-txt`),Comment=Symbol.for(`v-cmt`),Static=Symbol.for(`v-stc`),blockStack=[],currentBlock=null,isBlockTreeEnabled=1,createVNodeWithArgsTransform=(...t)=>_createVNode(...vnodeArgsTransformer?vnodeArgsTransformer(t,currentRenderingInstance):t),normalizeKey$2=__name$2(({key:t})=>t??null,`normalizeKey`),normalizeRef=({ref:t,ref_key:c,ref_for:u})=>(typeof t==`number`&&(t=``+t),t==null?null:isString$1(t)||isRef(t)||isFunction$1(t)?{i:currentRenderingInstance,r:t,k:c,f:!!u}:t),createVNode=process.env.NODE_ENV===`production`?_createVNode:createVNodeWithArgsTransform,emptyAppContext=createAppContext(),uid=0,currentInstance=null,getCurrentInstance=()=>currentInstance||currentRenderingInstance;{let t=getGlobalThis(),registerGlobalSetter=(c,u)=>{let d;return(d=t[c])||(d=t[c]=[]),d.push(u),t=>{d.length>1?d.forEach(c=>c(t)):d[0](t)}};internalSetCurrentInstance=registerGlobalSetter(`__VUE_INSTANCE_SETTERS__`,t=>currentInstance=t),setInSSRSetupState=registerGlobalSetter(`__VUE_SSR_SETTERS__`,t=>isInSSRComponentSetup=t)}setCurrentInstance=t=>{let c=currentInstance;return internalSetCurrentInstance(t),t.scope.on(),()=>{t.scope.off(),internalSetCurrentInstance(c)}},unsetCurrentInstance=()=>{currentInstance&&currentInstance.scope.off(),internalSetCurrentInstance(null)},isBuiltInTag=makeMap(`slot,component`),isInSSRComponentSetup=!1,isRuntimeOnly=()=>!compile$1,attrsProxyHandlers=process.env.NODE_ENV===`production`?{get(t,c){return track(t,`get`,``),t[c]}}:{get(t,c){return markAttrsAccessed(),track(t,`get`,``),t[c]},set(){return warn$1(`setupContext.attrs is readonly.`),!1},deleteProperty(){return warn$1(`setupContext.attrs is readonly.`),!1}},classifyRE=/(?:^|[-_])(\w)/g,classify=t=>t.replace(classifyRE,t=>t.toUpperCase()).replace(/[-_]/g,``),computed=(t,c)=>{let u=computed$1(t,c,isInSSRComponentSetup);if(process.env.NODE_ENV!==`production`){let t=getCurrentInstance();t&&t.appContext.config.warnRecursiveComputed&&(u._warnRecursive=!0)}return u},__name$2(h$2,`h`),version$2=`3.5.13`,warn$2=process.env.NODE_ENV===`production`?NOOP:warn$1,ErrorTypeStrings=ErrorTypeStrings$1,devtools=(process.env.NODE_ENV,devtools$1),setDevtoolsHook=(process.env.NODE_ENV,setDevtoolsHook$1),ssrUtils={createComponentInstance,setupComponent,renderComponentRoot,setCurrentRenderingInstance,isVNode,normalizeVNode,getComponentPublicInstance,ensureValidVNode,pushWarningContext,popWarningContext}})),runtime_dom_esm_bundler_exports=__exportAll$1({BaseTransition:()=>BaseTransition,BaseTransitionPropsValidators:()=>BaseTransitionPropsValidators,Comment:()=>Comment,DeprecationTypes:()=>null,EffectScope:()=>EffectScope,ErrorCodes:()=>ErrorCodes$1,ErrorTypeStrings:()=>ErrorTypeStrings,Fragment:()=>Fragment,KeepAlive:()=>KeepAlive,ReactiveEffect:()=>ReactiveEffect,Static:()=>Static,Suspense:()=>Suspense,Teleport:()=>Teleport,Text:()=>Text,TrackOpTypes:()=>TrackOpTypes,Transition:()=>Transition,TransitionGroup:()=>TransitionGroup,TriggerOpTypes:()=>TriggerOpTypes,VueElement:()=>VueElement,assertNumber:()=>assertNumber,callWithAsyncErrorHandling:()=>callWithAsyncErrorHandling,callWithErrorHandling:()=>callWithErrorHandling,camelize:()=>camelize,capitalize:()=>capitalize,cloneVNode:()=>cloneVNode,compatUtils:()=>null,computed:()=>computed,createApp:()=>createApp,createBlock:()=>createBlock,createCommentVNode:()=>createCommentVNode,createElementBlock:()=>createElementBlock,createElementVNode:()=>createBaseVNode,createHydrationRenderer:()=>createHydrationRenderer,createPropsRestProxy:()=>createPropsRestProxy,createRenderer:()=>createRenderer,createSSRApp:()=>createSSRApp,createSlots:()=>createSlots,createStaticVNode:()=>createStaticVNode,createTextVNode:()=>createTextVNode,createVNode:()=>createVNode,customRef:()=>customRef,defineAsyncComponent:()=>defineAsyncComponent,defineComponent:()=>defineComponent,defineCustomElement:()=>defineCustomElement,defineEmits:()=>defineEmits,defineExpose:()=>defineExpose,defineModel:()=>defineModel,defineOptions:()=>defineOptions,defineProps:()=>defineProps,defineSSRCustomElement:()=>defineSSRCustomElement,defineSlots:()=>defineSlots,devtools:()=>devtools,effect:()=>effect,effectScope:()=>effectScope,getCurrentInstance:()=>getCurrentInstance,getCurrentScope:()=>getCurrentScope,getCurrentWatcher:()=>getCurrentWatcher,getTransitionRawChildren:()=>getTransitionRawChildren,guardReactiveProps:()=>guardReactiveProps,h:()=>h$2,handleError:()=>handleError,hasInjectionContext:()=>hasInjectionContext,hydrate:()=>hydrate,hydrateOnIdle:()=>hydrateOnIdle,hydrateOnInteraction:()=>hydrateOnInteraction,hydrateOnMediaQuery:()=>hydrateOnMediaQuery,hydrateOnVisible:()=>hydrateOnVisible,initCustomFormatter:()=>initCustomFormatter,initDirectivesForSSR:()=>initDirectivesForSSR,inject:()=>inject,isMemoSame:()=>isMemoSame,isProxy:()=>isProxy,isReactive:()=>isReactive,isReadonly:()=>isReadonly,isRef:()=>isRef,isRuntimeOnly:()=>isRuntimeOnly,isShallow:()=>isShallow,isVNode:()=>isVNode,markRaw:()=>markRaw,mergeDefaults:()=>mergeDefaults,mergeModels:()=>mergeModels,mergeProps:()=>mergeProps,nextTick:()=>nextTick$2,normalizeClass:()=>normalizeClass,normalizeProps:()=>normalizeProps,normalizeStyle:()=>normalizeStyle,onActivated:()=>onActivated,onBeforeMount:()=>onBeforeMount,onBeforeUnmount:()=>onBeforeUnmount,onBeforeUpdate:()=>onBeforeUpdate,onDeactivated:()=>onDeactivated,onErrorCaptured:()=>onErrorCaptured,onMounted:()=>onMounted,onRenderTracked:()=>onRenderTracked,onRenderTriggered:()=>onRenderTriggered,onScopeDispose:()=>onScopeDispose,onServerPrefetch:()=>onServerPrefetch,onUnmounted:()=>onUnmounted,onUpdated:()=>onUpdated,onWatcherCleanup:()=>onWatcherCleanup,openBlock:()=>openBlock,popScopeId:()=>popScopeId,provide:()=>provide,proxyRefs:()=>proxyRefs,pushScopeId:()=>pushScopeId,queuePostFlushCb:()=>queuePostFlushCb,reactive:()=>reactive,readonly:()=>readonly,ref:()=>ref,registerRuntimeCompiler:()=>registerRuntimeCompiler,render:()=>render$1,renderList:()=>renderList,renderSlot:()=>renderSlot,resolveComponent:()=>resolveComponent,resolveDirective:()=>resolveDirective,resolveDynamicComponent:()=>resolveDynamicComponent,resolveFilter:()=>null,resolveTransitionHooks:()=>resolveTransitionHooks,setBlockTracking:()=>setBlockTracking,setDevtoolsHook:()=>setDevtoolsHook,setTransitionHooks:()=>setTransitionHooks,shallowReactive:()=>shallowReactive,shallowReadonly:()=>shallowReadonly,shallowRef:()=>shallowRef,ssrContextKey:()=>ssrContextKey,ssrUtils:()=>ssrUtils,stop:()=>stop,toDisplayString:()=>toDisplayString,toHandlerKey:()=>toHandlerKey,toHandlers:()=>toHandlers,toRaw:()=>toRaw,toRef:()=>toRef,toRefs:()=>toRefs,toValue:()=>toValue,transformVNodeArgs:()=>transformVNodeArgs,triggerRef:()=>triggerRef,unref:()=>unref,useAttrs:()=>useAttrs,useCssModule:()=>useCssModule,useCssVars:()=>useCssVars,useHost:()=>useHost,useId:()=>useId,useModel:()=>useModel,useSSRContext:()=>useSSRContext,useShadowRoot:()=>useShadowRoot,useSlots:()=>useSlots,useTemplateRef:()=>useTemplateRef,useTransitionState:()=>useTransitionState,vModelCheckbox:()=>vModelCheckbox,vModelDynamic:()=>vModelDynamic,vModelRadio:()=>vModelRadio,vModelSelect:()=>vModelSelect,vModelText:()=>vModelText,vShow:()=>vShow,version:()=>version$2,warn:()=>warn$2,watch:()=>watch,watchEffect:()=>watchEffect,watchPostEffect:()=>watchPostEffect,watchSyncEffect:()=>watchSyncEffect,withAsyncContext:()=>withAsyncContext,withCtx:()=>withCtx,withDefaults:()=>withDefaults,withDirectives:()=>withDirectives,withKeys:()=>withKeys,withMemo:()=>withMemo,withModifiers:()=>withModifiers,withScopeId:()=>withScopeId});function resolveTransitionProps(t){let c={};for(let u in t)u in DOMTransitionPropsValidators||(c[u]=t[u]);if(t.css===!1)return c;let{name:u=`v`,type:d,duration:m,enterFromClass:g=`${u}-enter-from`,enterActiveClass:b=`${u}-enter-active`,enterToClass:S=`${u}-enter-to`,appearFromClass:C=g,appearActiveClass:w=b,appearToClass:T=S,leaveFromClass:E=`${u}-leave-from`,leaveActiveClass:D=`${u}-leave-active`,leaveToClass:O=`${u}-leave-to`}=t,Or=normalizeDuration(m),kr=Or&&Or[0],Ar=Or&&Or[1],{onBeforeEnter:jr,onEnter:Mr,onEnterCancelled:Nr,onLeave:Pr,onLeaveCancelled:Fr,onBeforeAppear:Ir=jr,onAppear:Lr=Mr,onAppearCancelled:Rr=Nr}=c,finishEnter=(t,c,u,d)=>{t._enterCancelled=d,removeTransitionClass(t,c?T:S),removeTransitionClass(t,c?w:b),u&&u()},finishLeave=(t,c)=>{t._isLeaving=!1,removeTransitionClass(t,E),removeTransitionClass(t,O),removeTransitionClass(t,D),c&&c()},makeEnterHook=t=>(c,u)=>{let m=t?Lr:Mr,resolve=()=>finishEnter(c,t,u);callHook(m,[c,resolve]),nextFrame(()=>{removeTransitionClass(c,t?C:g),addTransitionClass(c,t?T:S),hasExplicitCallback(m)||whenTransitionEnds(c,d,kr,resolve)})};return extend$2(c,{onBeforeEnter(t){callHook(jr,[t]),addTransitionClass(t,g),addTransitionClass(t,b)},onBeforeAppear(t){callHook(Ir,[t]),addTransitionClass(t,C),addTransitionClass(t,w)},onEnter:makeEnterHook(!1),onAppear:makeEnterHook(!0),onLeave(t,c){t._isLeaving=!0;let resolve=()=>finishLeave(t,c);addTransitionClass(t,E),t._enterCancelled?(addTransitionClass(t,D),forceReflow()):(forceReflow(),addTransitionClass(t,D)),nextFrame(()=>{t._isLeaving&&(removeTransitionClass(t,E),addTransitionClass(t,O),hasExplicitCallback(Pr)||whenTransitionEnds(t,d,Ar,resolve))}),callHook(Pr,[t,resolve])},onEnterCancelled(t){finishEnter(t,!1,void 0,!0),callHook(Nr,[t])},onAppearCancelled(t){finishEnter(t,!0,void 0,!0),callHook(Rr,[t])},onLeaveCancelled(t){finishLeave(t),callHook(Fr,[t])}})}function normalizeDuration(t){if(t==null)return null;if(isObject$1(t))return[NumberOf(t.enter),NumberOf(t.leave)];{let c=NumberOf(t);return[c,c]}}function NumberOf(t){let c=toNumber(t);return process.env.NODE_ENV!==`production`&&assertNumber(c,`<transition> explicit duration`),c}function addTransitionClass(t,c){c.split(/\s+/).forEach(c=>c&&t.classList.add(c)),(t[vtcKey]||(t[vtcKey]=new Set)).add(c)}function removeTransitionClass(t,c){c.split(/\s+/).forEach(c=>c&&t.classList.remove(c));let u=t[vtcKey];u&&(u.delete(c),u.size||(t[vtcKey]=void 0))}function nextFrame(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}function whenTransitionEnds(t,c,u,d){let m=t._endId=++endId,resolveIfNotStale=()=>{m===t._endId&&d()};if(u!=null)return setTimeout(resolveIfNotStale,u);let{type:g,timeout:b,propCount:S}=getTransitionInfo(t,c);if(!g)return d();let C=g+`end`,w=0,end=()=>{t.removeEventListener(C,onEnd),resolveIfNotStale()},onEnd=c=>{c.target===t&&++w>=S&&end()};setTimeout(()=>{w<S&&end()},b+1),t.addEventListener(C,onEnd)}function getTransitionInfo(t,c){let u=window.getComputedStyle(t),getStyleProperties=t=>(u[t]||``).split(`, `),d=getStyleProperties(`${TRANSITION$1}Delay`),m=getStyleProperties(`${TRANSITION$1}Duration`),g=getTimeout(d,m),b=getStyleProperties(`${ANIMATION}Delay`),S=getStyleProperties(`${ANIMATION}Duration`),C=getTimeout(b,S),w=null,T=0,E=0;c===TRANSITION$1?g>0&&(w=TRANSITION$1,T=g,E=m.length):c===ANIMATION?C>0&&(w=ANIMATION,T=C,E=S.length):(T=Math.max(g,C),w=T>0?g>C?TRANSITION$1:ANIMATION:null,E=w?w===TRANSITION$1?m.length:S.length:0);let D=w===TRANSITION$1&&/\b(transform|all)(,|$)/.test(getStyleProperties(`${TRANSITION$1}Property`).toString());return{type:w,timeout:T,propCount:E,hasTransform:D}}function getTimeout(t,c){for(;t.length<c.length;)t=t.concat(t);return Math.max(...c.map((c,u)=>toMs(c)+toMs(t[u])))}function toMs(t){return t===`auto`?0:Number(t.slice(0,-1).replace(`,`,`.`))*1e3}function forceReflow(){return document.body.offsetHeight}function patchClass(t,c,u){let d=t[vtcKey];d&&(c=(c?[c,...d]:[...d]).join(` `)),c==null?t.removeAttribute(`class`):u?t.setAttribute(`class`,c):t.className=c}function setDisplay(t,c){t.style.display=c?t[vShowOriginalDisplay]:`none`,t[vShowHidden]=!c}function initVShowForSSR(){vShow.getSSRProps=({value:t})=>{if(!t)return{style:{display:`none`}}}}function useCssVars(t){let c=getCurrentInstance();if(!c){process.env.NODE_ENV!==`production`&&warn$2(`useCssVars is called without current active component instance.`);return}let u=c.ut=(u=t(c.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${c.uid}"]`)).forEach(t=>setVarsOnNode(t,u))};process.env.NODE_ENV!==`production`&&(c.getCssVars=()=>t(c.proxy));let setVars=()=>{let d=t(c.proxy);c.ce?setVarsOnNode(c.ce,d):setVarsOnVNode(c.subTree,d),u(d)};onBeforeUpdate(()=>{queuePostFlushCb(setVars)}),onMounted(()=>{watch(setVars,NOOP,{flush:`post`});let t=new MutationObserver(setVars);t.observe(c.subTree.el.parentNode,{childList:!0}),onUnmounted(()=>t.disconnect())})}function setVarsOnVNode(t,c){if(t.shapeFlag&128){let u=t.suspense;t=u.activeBranch,u.pendingBranch&&!u.isHydrating&&u.effects.push(()=>{setVarsOnVNode(u.activeBranch,c)})}for(;t.component;)t=t.component.subTree;if(t.shapeFlag&1&&t.el)setVarsOnNode(t.el,c);else if(t.type===Fragment)t.children.forEach(t=>setVarsOnVNode(t,c));else if(t.type===Static){let{el:u,anchor:d}=t;for(;u&&(setVarsOnNode(u,c),u!==d);)u=u.nextSibling}}function setVarsOnNode(t,c){if(t.nodeType===1){let u=t.style,d=``;for(let t in c)u.setProperty(`--${t}`,c[t]),d+=`--${t}: ${c[t]};`;u[CSS_VAR_TEXT]=d}}function patchStyle(t,c,u){let d=t.style,m=isString$1(u),g=!1;if(u&&!m){if(c)if(isString$1(c))for(let t of c.split(`;`)){let c=t.slice(0,t.indexOf(`:`)).trim();u[c]??setStyle(d,c,``)}else for(let t in c)u[t]??setStyle(d,t,``);for(let t in u)t===`display`&&(g=!0),setStyle(d,t,u[t])}else if(m){if(c!==u){let t=d[CSS_VAR_TEXT];t&&(u+=`;`+t),d.cssText=u,g=displayRE.test(u)}}else c&&t.removeAttribute(`style`);vShowOriginalDisplay in t&&(t[vShowOriginalDisplay]=g?d.display:``,t[vShowHidden]&&(d.display=`none`))}function setStyle(t,c,u){if(isArray$3(u))u.forEach(u=>setStyle(t,c,u));else if(u??(u=``),process.env.NODE_ENV!==`production`&&semicolonRE.test(u)&&warn$2(`Unexpected semicolon at the end of '${c}' style value: '${u}'`),c.startsWith(`--`))t.setProperty(c,u);else{let d=autoPrefix(t,c);importantRE.test(u)?t.setProperty(hyphenate(d),u.replace(importantRE,``),`important`):t[d]=u}}function autoPrefix(t,c){let u=prefixCache[c];if(u)return u;let d=camelize(c);if(d!==`filter`&&d in t)return prefixCache[c]=d;d=capitalize(d);for(let u=0;u<prefixes.length;u++){let m=prefixes[u]+d;if(m in t)return prefixCache[c]=m}return c}function patchAttr(t,c,u,d,m,g=isSpecialBooleanAttr(c)){d&&c.startsWith(`xlink:`)?u==null?t.removeAttributeNS(xlinkNS,c.slice(6,c.length)):t.setAttributeNS(xlinkNS,c,u):u==null||g&&!includeBooleanAttr(u)?t.removeAttribute(c):t.setAttribute(c,g?``:isSymbol(u)?String(u):u)}function patchDOMProp(t,c,u,d,m){if(c===`innerHTML`||c===`textContent`){u!=null&&(t[c]=c===`innerHTML`?unsafeToTrustedHTML(u):u);return}let g=t.tagName;if(c===`value`&&g!==`PROGRESS`&&!g.includes(`-`)){let d=g===`OPTION`?t.getAttribute(`value`)||``:t.value,m=u==null?t.type===`checkbox`?`on`:``:String(u);(d!==m||!(`_value`in t))&&(t.value=m),u??t.removeAttribute(c),t._value=u;return}let b=!1;if(u===``||u==null){let d=typeof t[c];d===`boolean`?u=includeBooleanAttr(u):u==null&&d===`string`?(u=``,b=!0):d===`number`&&(u=0,b=!0)}try{t[c]=u}catch(t){process.env.NODE_ENV!==`production`&&!b&&warn$2(`Failed setting prop "${c}" on <${g.toLowerCase()}>: value ${u} is invalid.`,t)}b&&t.removeAttribute(m||c)}function addEventListener$1(t,c,u,d){t.addEventListener(c,u,d)}function removeEventListener(t,c,u,d){t.removeEventListener(c,u,d)}function patchEvent(t,c,u,d,m=null){let g=t[veiKey]||(t[veiKey]={}),b=g[c];if(d&&b)b.value=process.env.NODE_ENV===`production`?d:sanitizeEventValue(d,c);else{let[u,S]=parseName(c);d?addEventListener$1(t,u,g[c]=createInvoker(process.env.NODE_ENV===`production`?d:sanitizeEventValue(d,c),m),S):b&&(removeEventListener(t,u,b,S),g[c]=void 0)}}function parseName(t){let c;if(optionsModifierRE.test(t)){c={};let u;for(;u=t.match(optionsModifierRE);)t=t.slice(0,t.length-u[0].length),c[u[0].toLowerCase()]=!0}return[t[2]===`:`?t.slice(3):hyphenate(t.slice(2)),c]}function createInvoker(t,c){let invoker=t=>{if(!t._vts)t._vts=Date.now();else if(t._vts<=invoker.attached)return;callWithAsyncErrorHandling(patchStopImmediatePropagation(t,invoker.value),c,5,[t])};return invoker.value=t,invoker.attached=getNow(),invoker}function sanitizeEventValue(t,c){return isFunction$1(t)||isArray$3(t)?t:(warn$2(`Wrong type passed as event handler to ${c} - did you forget @ or : in front of your prop?
26
+ Expected function or array of functions, received type ${typeof t}.`),NOOP)}function patchStopImmediatePropagation(t,c){if(isArray$3(c)){let u=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{u.call(t),t._stopped=!0},c.map(t=>c=>!c._stopped&&t&&t(c))}else return c}function shouldSetAsProp(t,c,u,d){if(d)return!!(c===`innerHTML`||c===`textContent`||c in t&&isNativeOn(c)&&isFunction$1(u));if(c===`spellcheck`||c===`draggable`||c===`translate`||c===`form`||c===`list`&&t.tagName===`INPUT`||c===`type`&&t.tagName===`TEXTAREA`)return!1;if(c===`width`||c===`height`){let c=t.tagName;if(c===`IMG`||c===`VIDEO`||c===`CANVAS`||c===`SOURCE`)return!1}return isNativeOn(c)&&isString$1(u)?!1:c in t}function defineCustomElement(t,c,u){let d=defineComponent(t,c);isPlainObject$3(d)&&extend$2(d,c);class VueCustomElement extends VueElement{constructor(t){super(d,t,u)}}return VueCustomElement.def=d,VueCustomElement}function useHost(t){let c=getCurrentInstance();return c&&c.ce||(process.env.NODE_ENV!==`production`&&warn$2(c?`${t||`useHost`} can only be used in components defined via defineCustomElement.`:`${t||`useHost`} called without an active component instance.`),null)}function useShadowRoot(){let t=process.env.NODE_ENV===`production`?useHost():useHost(`useShadowRoot`);return t&&t.shadowRoot}function useCssModule(t=`$style`){{let c=getCurrentInstance();if(!c)return process.env.NODE_ENV!==`production`&&warn$2(`useCssModule must be called inside setup()`),EMPTY_OBJ;let u=c.type.__cssModules;return u?u[t]||(process.env.NODE_ENV!==`production`&&warn$2(`Current instance does not have CSS module named "${t}".`),EMPTY_OBJ):(process.env.NODE_ENV!==`production`&&warn$2(`Current instance does not have CSS modules injected.`),EMPTY_OBJ)}}function callPendingCbs(t){let c=t.el;c[moveCbKey]&&c[moveCbKey](),c[enterCbKey]&&c[enterCbKey]()}function recordPosition(t){newPositionMap.set(t,t.el.getBoundingClientRect())}function applyTranslation(t){let c=positionMap.get(t),u=newPositionMap.get(t),d=c.left-u.left,m=c.top-u.top;if(d||m){let c=t.el.style;return c.transform=c.webkitTransform=`translate(${d}px,${m}px)`,c.transitionDuration=`0s`,t}}function hasCSSTransform(t,c,u){let d=t.cloneNode(),m=t[vtcKey];m&&m.forEach(t=>{t.split(/\s+/).forEach(t=>t&&d.classList.remove(t))}),u.split(/\s+/).forEach(t=>t&&d.classList.add(t)),d.style.display=`none`;let g=c.nodeType===1?c:c.parentNode;g.appendChild(d);let{hasTransform:b}=getTransitionInfo(d);return g.removeChild(d),b}function onCompositionStart(t){t.target.composing=!0}function onCompositionEnd(t){let c=t.target;c.composing&&(c.composing=!1,c.dispatchEvent(new Event(`input`)))}function setChecked(t,{value:c,oldValue:u},d){t._modelValue=c;let m;if(isArray$3(c))m=looseIndexOf(c,d.props.value)>-1;else if(isSet(c))m=c.has(d.props.value);else{if(c===u)return;m=looseEqual(c,getCheckboxValue(t,!0))}t.checked!==m&&(t.checked=m)}function setSelected(t,c){let u=t.multiple,d=isArray$3(c);if(u&&!d&&!isSet(c)){process.env.NODE_ENV!==`production`&&warn$2(`<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(c).slice(8,-1)}.`);return}for(let m=0,g=t.options.length;m<g;m++){let g=t.options[m],b=getValue$2(g);if(u)if(d){let t=typeof b;t===`string`||t===`number`?g.selected=c.some(t=>String(t)===String(b)):g.selected=looseIndexOf(c,b)>-1}else g.selected=c.has(b);else if(looseEqual(getValue$2(g),c)){t.selectedIndex!==m&&(t.selectedIndex=m);return}}!u&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}function getValue$2(t){return`_value`in t?t._value:t.value}function getCheckboxValue(t,c){let u=c?`_trueValue`:`_falseValue`;return u in t?t[u]:c}function resolveDynamicModel(t,c){switch(t){case`SELECT`:return vModelSelect;case`TEXTAREA`:return vModelText;default:switch(c){case`checkbox`:return vModelCheckbox;case`radio`:return vModelRadio;default:return vModelText}}}function callModelHook(t,c,u,d,m){let g=resolveDynamicModel(t.tagName,u.props&&u.props.type)[m];g&&g(t,c,u,d)}function initVModelForSSR(){vModelText.getSSRProps=({value:t})=>({value:t}),vModelRadio.getSSRProps=({value:t},c)=>{if(c.props&&looseEqual(c.props.value,t))return{checked:!0}},vModelCheckbox.getSSRProps=({value:t},c)=>{if(isArray$3(t)){if(c.props&&looseIndexOf(t,c.props.value)>-1)return{checked:!0}}else if(isSet(t)){if(c.props&&t.has(c.props.value))return{checked:!0}}else if(t)return{checked:!0}},vModelDynamic.getSSRProps=(t,c)=>{if(typeof c.type!=`string`)return;let u=resolveDynamicModel(c.type.toUpperCase(),c.props&&c.props.type);if(u.getSSRProps)return u.getSSRProps(t,c)}}function ensureRenderer(){return renderer||(renderer=createRenderer(rendererOptions))}function ensureHydrationRenderer(){return renderer=enabledHydration?renderer:createHydrationRenderer(rendererOptions),enabledHydration=!0,renderer}function resolveRootNamespace(t){if(t instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&t instanceof MathMLElement)return`mathml`}function injectNativeTagCheck(t){Object.defineProperty(t.config,`isNativeTag`,{value:t=>isHTMLTag(t)||isSVGTag(t)||isMathMLTag(t),writable:!1})}function injectCompilerOptionsCheck(t){if(isRuntimeOnly()){let c=t.config.isCustomElement;Object.defineProperty(t.config,`isCustomElement`,{get(){return c},set(){warn$2("The `isCustomElement` config option is deprecated. Use `compilerOptions.isCustomElement` instead.")}});let u=t.config.compilerOptions,d='The `compilerOptions` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, `compilerOptions` must be passed to `@vue/compiler-dom` in the build setup instead.\n- For vue-loader: pass it via vue-loader\'s `compilerOptions` loader option.\n- For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader\n- For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc';Object.defineProperty(t.config,`compilerOptions`,{get(){return warn$2(d),u},set(){warn$2(d)}})}}function normalizeContainer(t){if(isString$1(t)){let c=document.querySelector(t);return process.env.NODE_ENV!==`production`&&!c&&warn$2(`Failed to mount app: mount target selector "${t}" returned null.`),c}return process.env.NODE_ENV!==`production`&&window.ShadowRoot&&t instanceof window.ShadowRoot&&t.mode===`closed`&&warn$2('mounting on a ShadowRoot with `{mode: "closed"}` may lead to unpredictable bugs'),t}var policy,tt$3,unsafeToTrustedHTML,svgNS,mathmlNS,doc,templateContainer,nodeOps,TRANSITION$1,ANIMATION,vtcKey,DOMTransitionPropsValidators,TransitionPropsValidators,decorate$1,Transition,callHook,hasExplicitCallback,endId,vShowOriginalDisplay,vShowHidden,vShow,CSS_VAR_TEXT,displayRE,semicolonRE,importantRE,prefixes,prefixCache,xlinkNS,veiKey,optionsModifierRE,cachedNow,p,getNow,isNativeOn,patchProp,REMOVAL,defineSSRCustomElement,BaseClass,VueElement,positionMap,newPositionMap,moveCbKey,enterCbKey,decorate,TransitionGroup,getModelAssigner,assignKey,vModelText,vModelCheckbox,vModelRadio,vModelSelect,vModelDynamic,systemModifiers,modifierGuards,withModifiers,keyNames,withKeys,rendererOptions,renderer,enabledHydration,render$1,hydrate,createApp,createSSRApp,ssrDirectiveInitialized,initDirectivesForSSR,init_runtime_dom_esm_bundler=__esmMin((()=>{if(init_runtime_core_esm_bundler(),init_runtime_core_esm_bundler(),init_shared_esm_bundler(),policy=void 0,tt$3=typeof window<`u`&&window.trustedTypes,tt$3)try{policy=tt$3.createPolicy(`vue`,{createHTML:t=>t})}catch(t){process.env.NODE_ENV!==`production`&&warn$2(`Error creating trusted types policy: ${t}`)}unsafeToTrustedHTML=policy?t=>policy.createHTML(t):t=>t,svgNS=`http://www.w3.org/2000/svg`,mathmlNS=`http://www.w3.org/1998/Math/MathML`,doc=typeof document<`u`?document:null,templateContainer=doc&&doc.createElement(`template`),nodeOps={insert:(t,c,u)=>{c.insertBefore(t,u||null)},remove:t=>{let c=t.parentNode;c&&c.removeChild(t)},createElement:(t,c,u,d)=>{let m=c===`svg`?doc.createElementNS(svgNS,t):c===`mathml`?doc.createElementNS(mathmlNS,t):u?doc.createElement(t,{is:u}):doc.createElement(t);return t===`select`&&d&&d.multiple!=null&&m.setAttribute(`multiple`,d.multiple),m},createText:t=>doc.createTextNode(t),createComment:t=>doc.createComment(t),setText:(t,c)=>{t.nodeValue=c},setElementText:(t,c)=>{t.textContent=c},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>doc.querySelector(t),setScopeId(t,c){t.setAttribute(c,``)},insertStaticContent(t,c,u,d,m,g){let b=u?u.previousSibling:c.lastChild;if(m&&(m===g||m.nextSibling))for(;c.insertBefore(m.cloneNode(!0),u),!(m===g||!(m=m.nextSibling)););else{templateContainer.innerHTML=unsafeToTrustedHTML(d===`svg`?`<svg>${t}</svg>`:d===`mathml`?`<math>${t}</math>`:t);let m=templateContainer.content;if(d===`svg`||d===`mathml`){let t=m.firstChild;for(;t.firstChild;)m.appendChild(t.firstChild);m.removeChild(t)}c.insertBefore(m,u)}return[b?b.nextSibling:c.firstChild,u?u.previousSibling:c.lastChild]}},TRANSITION$1=`transition`,ANIMATION=`animation`,vtcKey=Symbol(`_vtc`),DOMTransitionPropsValidators={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},TransitionPropsValidators=extend$2({},BaseTransitionPropsValidators,DOMTransitionPropsValidators),decorate$1=t=>(t.displayName=`Transition`,t.props=TransitionPropsValidators,t),Transition=decorate$1((t,{slots:c})=>h$2(BaseTransition,resolveTransitionProps(t),c)),callHook=(t,c=[])=>{isArray$3(t)?t.forEach(t=>t(...c)):t&&t(...c)},hasExplicitCallback=t=>t?isArray$3(t)?t.some(t=>t.length>1):t.length>1:!1,endId=0,vShowOriginalDisplay=Symbol(`_vod`),vShowHidden=Symbol(`_vsh`),vShow={beforeMount(t,{value:c},{transition:u}){t[vShowOriginalDisplay]=t.style.display===`none`?``:t.style.display,u&&c?u.beforeEnter(t):setDisplay(t,c)},mounted(t,{value:c},{transition:u}){u&&c&&u.enter(t)},updated(t,{value:c,oldValue:u},{transition:d}){!c!=!u&&(d?c?(d.beforeEnter(t),setDisplay(t,!0),d.enter(t)):d.leave(t,()=>{setDisplay(t,!1)}):setDisplay(t,c))},beforeUnmount(t,{value:c}){setDisplay(t,c)}},process.env.NODE_ENV!==`production`&&(vShow.name=`show`),CSS_VAR_TEXT=Symbol(process.env.NODE_ENV===`production`?``:`CSS_VAR_TEXT`),displayRE=/(^|;)\s*display\s*:/,semicolonRE=/[^\\];\s*$/,importantRE=/\s*!important$/,prefixes=[`Webkit`,`Moz`,`ms`],prefixCache={},xlinkNS=`http://www.w3.org/1999/xlink`,__name$2(addEventListener$1,`addEventListener`),veiKey=Symbol(`_vei`),optionsModifierRE=/(?:Once|Passive|Capture)$/,cachedNow=0,p=Promise.resolve(),getNow=()=>cachedNow||(p.then(()=>cachedNow=0),cachedNow=Date.now()),isNativeOn=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,patchProp=(t,c,u,d,m,g)=>{let b=m===`svg`;c===`class`?patchClass(t,d,b):c===`style`?patchStyle(t,u,d):isOn(c)?isModelListener(c)||patchEvent(t,c,u,d,g):(c[0]===`.`?(c=c.slice(1),!0):c[0]===`^`?(c=c.slice(1),!1):shouldSetAsProp(t,c,d,b))?(patchDOMProp(t,c,d),!t.tagName.includes(`-`)&&(c===`value`||c===`checked`||c===`selected`)&&patchAttr(t,c,d,b,g,c!==`value`)):t._isVueCE&&(/[A-Z]/.test(c)||!isString$1(d))?patchDOMProp(t,camelize(c),d,g,c):(c===`true-value`?t._trueValue=d:c===`false-value`&&(t._falseValue=d),patchAttr(t,c,d,b))},REMOVAL={},defineSSRCustomElement=(t,c)=>defineCustomElement(t,c,createSSRApp),BaseClass=typeof HTMLElement<`u`?HTMLElement:class{},VueElement=class VueElement extends BaseClass{constructor(t,c={},u=createApp){super(),this._def=t,this._props=c,this._createApp=u,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._ob=null,this.shadowRoot&&u!==createApp?this._root=this.shadowRoot:(process.env.NODE_ENV!==`production`&&this.shadowRoot&&warn$2("Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use `defineSSRCustomElement`."),t.shadowRoot===!1?this._root=this:(this.attachShadow({mode:`open`}),this._root=this.shadowRoot)),this._def.__asyncLoader||this._resolveProps(this._def)}connectedCallback(){if(!this.isConnected)return;this.shadowRoot||this._parseSlots(),this._connected=!0;let t=this;for(;t=t&&(t.parentNode||t.host);)if(t instanceof VueElement){this._parent=t;break}this._instance||(this._resolved?(this._setParent(),this._update()):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(t=this._parent){t&&(this._instance.parent=t._instance,this._instance.provides=t._instance.provides)}disconnectedCallback(){this._connected=!1,nextTick$2(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null)})}_resolveDef(){if(this._pendingResolve)return;for(let t=0;t<this.attributes.length;t++)this._setAttr(this.attributes[t].name);this._ob=new MutationObserver(t=>{for(let c of t)this._setAttr(c.attributeName)}),this._ob.observe(this,{attributes:!0});let resolve=(t,c=!1)=>{this._resolved=!0,this._pendingResolve=void 0;let{props:u,styles:d}=t,m;if(u&&!isArray$3(u))for(let t in u){let c=u[t];(c===Number||c&&c.type===Number)&&(t in this._props&&(this._props[t]=toNumber(this._props[t])),(m||(m=Object.create(null)))[camelize(t)]=!0)}this._numberProps=m,c&&this._resolveProps(t),this.shadowRoot?this._applyStyles(d):process.env.NODE_ENV!==`production`&&d&&warn$2(`Custom element style injection is not supported when using shadowRoot: false`),this._mount(t)},t=this._def.__asyncLoader;t?this._pendingResolve=t().then(t=>resolve(this._def=t,!0)):resolve(this._def)}_mount(t){process.env.NODE_ENV!==`production`&&!t.name&&(t.name=`VueElement`),this._app=this._createApp(t),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);let c=this._instance&&this._instance.exposed;if(c)for(let t in c)hasOwn(this,t)?process.env.NODE_ENV!==`production`&&warn$2(`Exposed property "${t}" already exists on custom element.`):Object.defineProperty(this,t,{get:()=>unref(c[t])})}_resolveProps(t){let{props:c}=t,u=isArray$3(c)?c:Object.keys(c||{});for(let t of Object.keys(this))t[0]!==`_`&&u.includes(t)&&this._setProp(t,this[t]);for(let t of u.map(camelize))Object.defineProperty(this,t,{get(){return this._getProp(t)},set(c){this._setProp(t,c,!0,!0)}})}_setAttr(t){if(t.startsWith(`data-v-`))return;let c=this.hasAttribute(t),u=c?this.getAttribute(t):REMOVAL,d=camelize(t);c&&this._numberProps&&this._numberProps[d]&&(u=toNumber(u)),this._setProp(d,u,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,c,u=!0,d=!1){if(c!==this._props[t]&&(c===REMOVAL?delete this._props[t]:(this._props[t]=c,t===`key`&&this._app&&(this._app._ceVNode.key=c)),d&&this._instance&&this._update(),u)){let u=this._ob;u&&u.disconnect(),c===!0?this.setAttribute(hyphenate(t),``):typeof c==`string`||typeof c==`number`?this.setAttribute(hyphenate(t),c+``):c||this.removeAttribute(hyphenate(t)),u&&u.observe(this,{attributes:!0})}}_update(){render$1(this._createVNode(),this._root)}_createVNode(){let t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));let c=createVNode(this._def,extend$2(t,this._props));return this._instance||(c.ce=t=>{this._instance=t,t.ce=this,t.isCE=!0,process.env.NODE_ENV!==`production`&&(t.ceReload=t=>{this._styles&&(this._styles.forEach(t=>this._root.removeChild(t)),this._styles.length=0),this._applyStyles(t),this._instance=null,this._update()});let dispatch=(t,c)=>{this.dispatchEvent(new CustomEvent(t,isPlainObject$3(c[0])?extend$2({detail:c},c[0]):{detail:c}))};t.emit=(t,...c)=>{dispatch(t,c),hyphenate(t)!==t&&dispatch(hyphenate(t),c)},this._setParent()}),c}_applyStyles(t,c){if(!t)return;if(c){if(c===this._def||this._styleChildren.has(c))return;this._styleChildren.add(c)}let u=this._nonce;for(let d=t.length-1;d>=0;d--){let m=document.createElement(`style`);if(u&&m.setAttribute(`nonce`,u),m.textContent=t[d],this.shadowRoot.prepend(m),process.env.NODE_ENV!==`production`)if(c){if(c.__hmrId){this._childStyles||(this._childStyles=new Map);let t=this._childStyles.get(c.__hmrId);t||this._childStyles.set(c.__hmrId,t=[]),t.push(m)}}else (this._styles||(this._styles=[])).push(m)}}_parseSlots(){let t=this._slots={},c;for(;c=this.firstChild;){let u=c.nodeType===1&&c.getAttribute(`slot`)||`default`;(t[u]||(t[u]=[])).push(c),this.removeChild(c)}}_renderSlots(){let t=(this._teleportTarget||this).querySelectorAll(`slot`),c=this._instance.type.__scopeId;for(let u=0;u<t.length;u++){let d=t[u],m=d.getAttribute(`name`)||`default`,g=this._slots[m],b=d.parentNode;if(g)for(let t of g){if(c&&t.nodeType===1){let u=c+`-s`,d=document.createTreeWalker(t,1);t.setAttribute(u,``);let m;for(;m=d.nextNode();)m.setAttribute(u,``)}b.insertBefore(t,d)}else for(;d.firstChild;)b.insertBefore(d.firstChild,d);b.removeChild(d)}}_injectChildStyle(t){this._applyStyles(t.styles,t)}_removeChildStyle(t){if(process.env.NODE_ENV!==`production`&&(this._styleChildren.delete(t),this._childStyles&&t.__hmrId)){let c=this._childStyles.get(t.__hmrId);c&&(c.forEach(t=>this._root.removeChild(t)),c.length=0)}}},positionMap=new WeakMap,newPositionMap=new WeakMap,moveCbKey=Symbol(`_moveCb`),enterCbKey=Symbol(`_enterCb`),decorate=t=>(delete t.props.mode,t),TransitionGroup=decorate({name:`TransitionGroup`,props:extend$2({},TransitionPropsValidators,{tag:String,moveClass:String}),setup(t,{slots:c}){let u=getCurrentInstance(),d=useTransitionState(),m,g;return onUpdated(()=>{if(!m.length)return;let c=t.moveClass||`${t.name||`v`}-move`;if(!hasCSSTransform(m[0].el,u.vnode.el,c))return;m.forEach(callPendingCbs),m.forEach(recordPosition);let d=m.filter(applyTranslation);forceReflow(),d.forEach(t=>{let u=t.el,d=u.style;addTransitionClass(u,c),d.transform=d.webkitTransform=d.transitionDuration=``;let m=u[moveCbKey]=t=>{t&&t.target!==u||(!t||/transform$/.test(t.propertyName))&&(u.removeEventListener(`transitionend`,m),u[moveCbKey]=null,removeTransitionClass(u,c))};u.addEventListener(`transitionend`,m)})}),()=>{let b=toRaw(t),S=resolveTransitionProps(b),C=b.tag||Fragment;if(m=[],g)for(let t=0;t<g.length;t++){let c=g[t];c.el&&c.el instanceof Element&&(m.push(c),setTransitionHooks(c,resolveTransitionHooks(c,S,d,u)),positionMap.set(c,c.el.getBoundingClientRect()))}g=c.default?getTransitionRawChildren(c.default()):[];for(let t=0;t<g.length;t++){let c=g[t];c.key==null?process.env.NODE_ENV!==`production`&&c.type!==Text&&warn$2(`<TransitionGroup> children must be keyed.`):setTransitionHooks(c,resolveTransitionHooks(c,S,d,u))}return createVNode(C,null,g)}}}),getModelAssigner=t=>{let c=t.props[`onUpdate:modelValue`]||!1;return isArray$3(c)?t=>invokeArrayFns(c,t):c},assignKey=Symbol(`_assign`),vModelText={created(t,{modifiers:{lazy:c,trim:u,number:d}},m){t[assignKey]=getModelAssigner(m);let g=d||m.props&&m.props.type===`number`;addEventListener$1(t,c?`change`:`input`,c=>{if(c.target.composing)return;let d=t.value;u&&(d=d.trim()),g&&(d=looseToNumber(d)),t[assignKey](d)}),u&&addEventListener$1(t,`change`,()=>{t.value=t.value.trim()}),c||(addEventListener$1(t,`compositionstart`,onCompositionStart),addEventListener$1(t,`compositionend`,onCompositionEnd),addEventListener$1(t,`change`,onCompositionEnd))},mounted(t,{value:c}){t.value=c??``},beforeUpdate(t,{value:c,oldValue:u,modifiers:{lazy:d,trim:m,number:g}},b){if(t[assignKey]=getModelAssigner(b),t.composing)return;let S=(g||t.type===`number`)&&!/^0\d/.test(t.value)?looseToNumber(t.value):t.value,C=c??``;S!==C&&(document.activeElement===t&&t.type!==`range`&&(d&&c===u||m&&t.value.trim()===C)||(t.value=C))}},vModelCheckbox={deep:!0,created(t,c,u){t[assignKey]=getModelAssigner(u),addEventListener$1(t,`change`,()=>{let c=t._modelValue,u=getValue$2(t),d=t.checked,m=t[assignKey];if(isArray$3(c)){let t=looseIndexOf(c,u),g=t!==-1;if(d&&!g)m(c.concat(u));else if(!d&&g){let u=[...c];u.splice(t,1),m(u)}}else if(isSet(c)){let t=new Set(c);d?t.add(u):t.delete(u),m(t)}else m(getCheckboxValue(t,d))})},mounted:setChecked,beforeUpdate(t,c,u){t[assignKey]=getModelAssigner(u),setChecked(t,c,u)}},vModelRadio={created(t,{value:c},u){t.checked=looseEqual(c,u.props.value),t[assignKey]=getModelAssigner(u),addEventListener$1(t,`change`,()=>{t[assignKey](getValue$2(t))})},beforeUpdate(t,{value:c,oldValue:u},d){t[assignKey]=getModelAssigner(d),c!==u&&(t.checked=looseEqual(c,d.props.value))}},vModelSelect={deep:!0,created(t,{value:c,modifiers:{number:u}},d){let m=isSet(c);addEventListener$1(t,`change`,()=>{let c=Array.prototype.filter.call(t.options,t=>t.selected).map(t=>u?looseToNumber(getValue$2(t)):getValue$2(t));t[assignKey](t.multiple?m?new Set(c):c:c[0]),t._assigning=!0,nextTick$2(()=>{t._assigning=!1})}),t[assignKey]=getModelAssigner(d)},mounted(t,{value:c}){setSelected(t,c)},beforeUpdate(t,c,u){t[assignKey]=getModelAssigner(u)},updated(t,{value:c}){t._assigning||setSelected(t,c)}},__name$2(getValue$2,`getValue`),vModelDynamic={created(t,c,u){callModelHook(t,c,u,null,`created`)},mounted(t,c,u){callModelHook(t,c,u,null,`mounted`)},beforeUpdate(t,c,u,d){callModelHook(t,c,u,d,`beforeUpdate`)},updated(t,c,u,d){callModelHook(t,c,u,d,`updated`)}},systemModifiers=[`ctrl`,`shift`,`alt`,`meta`],modifierGuards={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>`button`in t&&t.button!==0,middle:t=>`button`in t&&t.button!==1,right:t=>`button`in t&&t.button!==2,exact:(t,c)=>systemModifiers.some(u=>t[`${u}Key`]&&!c.includes(u))},withModifiers=(t,c)=>{let u=t._withMods||(t._withMods={}),d=c.join(`.`);return u[d]||(u[d]=(u,...d)=>{for(let t=0;t<c.length;t++){let d=modifierGuards[c[t]];if(d&&d(u,c))return}return t(u,...d)})},keyNames={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},withKeys=(t,c)=>{let u=t._withKeys||(t._withKeys={}),d=c.join(`.`);return u[d]||(u[d]=u=>{if(!(`key`in u))return;let d=hyphenate(u.key);if(c.some(t=>t===d||keyNames[t]===d))return t(u)})},rendererOptions=extend$2({patchProp},nodeOps),enabledHydration=!1,render$1=__name$2((...t)=>{ensureRenderer().render(...t)},`render`),hydrate=(...t)=>{ensureHydrationRenderer().hydrate(...t)},createApp=(...t)=>{let c=ensureRenderer().createApp(...t);process.env.NODE_ENV!==`production`&&(injectNativeTagCheck(c),injectCompilerOptionsCheck(c));let{mount:u}=c;return c.mount=t=>{let d=normalizeContainer(t);if(!d)return;let m=c._component;!isFunction$1(m)&&!m.render&&!m.template&&(m.template=d.innerHTML),d.nodeType===1&&(d.textContent=``);let g=u(d,!1,resolveRootNamespace(d));return d instanceof Element&&(d.removeAttribute(`v-cloak`),d.setAttribute(`data-v-app`,``)),g},c},createSSRApp=(...t)=>{let c=ensureHydrationRenderer().createApp(...t);process.env.NODE_ENV!==`production`&&(injectNativeTagCheck(c),injectCompilerOptionsCheck(c));let{mount:u}=c;return c.mount=t=>{let c=normalizeContainer(t);if(c)return u(c,!0,resolveRootNamespace(c))},c},ssrDirectiveInitialized=!1,initDirectivesForSSR=()=>{ssrDirectiveInitialized||(ssrDirectiveInitialized=!0,initVModelForSSR(),initVShowForSSR())}}));function initDev(){initCustomFormatter()}var init_vue_runtime_esm_bundler=__esmMin((()=>{init_runtime_dom_esm_bundler(),init_runtime_dom_esm_bundler(),process.env.NODE_ENV!==`production`&&initDev()}));function hooks(){return hookCallback.apply(null,arguments)}function setHookCallback(t){hookCallback=t}function isArray$2(t){return t instanceof Array||Object.prototype.toString.call(t)===`[object Array]`}function isObject(t){return t!=null&&Object.prototype.toString.call(t)===`[object Object]`}function hasOwnProp(t,c){return Object.prototype.hasOwnProperty.call(t,c)}function isObjectEmpty(t){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(t).length===0;for(var c in t)if(hasOwnProp(t,c))return!1;return!0}function isUndefined(t){return t===void 0}function isNumber(t){return typeof t==`number`||Object.prototype.toString.call(t)===`[object Number]`}function isDate(t){return t instanceof Date||Object.prototype.toString.call(t)===`[object Date]`}function map(t,c){var u=[],d,m=t.length;for(d=0;d<m;++d)u.push(c(t[d],d));return u}function extend$1(t,c){for(var u in c)hasOwnProp(c,u)&&(t[u]=c[u]);return hasOwnProp(c,`toString`)&&(t.toString=c.toString),hasOwnProp(c,`valueOf`)&&(t.valueOf=c.valueOf),t}function createUTC(t,c,u,d){return createLocalOrUTC(t,c,u,d,!0).utc()}function defaultParsingFlags(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function getParsingFlags(t){return t._pf??(t._pf=defaultParsingFlags()),t._pf}function isValid(t){var c=null,u=!1,d=t._d&&!isNaN(t._d.getTime());if(d&&(c=getParsingFlags(t),u=some.call(c.parsedDateParts,function(t){return t!=null}),d=c.overflow<0&&!c.empty&&!c.invalidEra&&!c.invalidMonth&&!c.invalidWeekday&&!c.weekdayMismatch&&!c.nullInput&&!c.invalidFormat&&!c.userInvalidated&&(!c.meridiem||c.meridiem&&u),t._strict&&(d=d&&c.charsLeftOver===0&&c.unusedTokens.length===0&&c.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(t))t._isValid=d;else return d;return t._isValid}function createInvalid(t){var c=createUTC(NaN);return t==null?getParsingFlags(c).userInvalidated=!0:extend$1(getParsingFlags(c),t),c}function copyConfig(t,c){var u,d,m,g=momentProperties.length;if(isUndefined(c._isAMomentObject)||(t._isAMomentObject=c._isAMomentObject),isUndefined(c._i)||(t._i=c._i),isUndefined(c._f)||(t._f=c._f),isUndefined(c._l)||(t._l=c._l),isUndefined(c._strict)||(t._strict=c._strict),isUndefined(c._tzm)||(t._tzm=c._tzm),isUndefined(c._isUTC)||(t._isUTC=c._isUTC),isUndefined(c._offset)||(t._offset=c._offset),isUndefined(c._pf)||(t._pf=getParsingFlags(c)),isUndefined(c._locale)||(t._locale=c._locale),g>0)for(u=0;u<g;u++)d=momentProperties[u],m=c[d],isUndefined(m)||(t[d]=m);return t}function Moment(t){copyConfig(this,t),this._d=new Date(t._d==null?NaN:t._d.getTime()),this.isValid()||(this._d=new Date(NaN)),updateInProgress===!1&&(updateInProgress=!0,hooks.updateOffset(this),updateInProgress=!1)}function isMoment(t){return t instanceof Moment||t!=null&&t._isAMomentObject!=null}function warn(t){hooks.suppressDeprecationWarnings===!1&&typeof console<`u`&&console.warn&&console.warn(`Deprecation warning: `+t)}function deprecate(t,c){var u=!0;return extend$1(function(){if(hooks.deprecationHandler!=null&&hooks.deprecationHandler(null,t),u){var d=[],m,g,b,S=arguments.length;for(g=0;g<S;g++){if(m=``,typeof arguments[g]==`object`){for(b in m+=`
27
27
  [`+g+`] `,arguments[0])hasOwnProp(arguments[0],b)&&(m+=b+`: `+arguments[0][b]+`, `);m=m.slice(0,-2)}else m=arguments[g];d.push(m)}warn(t+`
28
28
  Arguments: `+Array.prototype.slice.call(d).join(``)+`
29
29
  `+Error().stack),u=!1}return c.apply(this,arguments)},c)}function deprecateSimple(t,c){hooks.deprecationHandler!=null&&hooks.deprecationHandler(t,c),deprecations[t]||(warn(c),deprecations[t]=!0)}function isFunction(t){return typeof Function<`u`&&t instanceof Function||Object.prototype.toString.call(t)===`[object Function]`}function set$1(t){var c,u;for(u in t)hasOwnProp(t,u)&&(c=t[u],isFunction(c)?this[u]=c:this[`_`+u]=c);this._config=t,this._dayOfMonthOrdinalParseLenient=RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+`|\\d{1,2}`)}function mergeConfigs(t,c){var u=extend$1({},t),d;for(d in c)hasOwnProp(c,d)&&(isObject(t[d])&&isObject(c[d])?(u[d]={},extend$1(u[d],t[d]),extend$1(u[d],c[d])):c[d]==null?delete u[d]:u[d]=c[d]);for(d in t)hasOwnProp(t,d)&&!hasOwnProp(c,d)&&isObject(t[d])&&(u[d]=extend$1({},u[d]));return u}function Locale(t){t!=null&&this.set(t)}function calendar(t,c,u){var d=this._calendar[t]||this._calendar.sameElse;return isFunction(d)?d.call(c,u):d}function zeroFill(t,c,u){var d=``+Math.abs(t),m=c-d.length;return(t>=0?u?`+`:``:`-`)+(10**Math.max(0,m)).toString().substr(1)+d}function addFormatToken(t,c,u,d){var func=d;typeof d==`string`&&(func=function(){return this[d]()}),t&&(formatTokenFunctions[t]=func),c&&(formatTokenFunctions[c[0]]=function(){return zeroFill(func.apply(this,arguments),c[1],c[2])}),u&&(formatTokenFunctions[u]=function(){return this.localeData().ordinal(func.apply(this,arguments),t)})}function removeFormattingTokens(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,``):t.replace(/\\/g,``)}function makeFormatFunction(t){var c=t.match(formattingTokens),u,d;for(u=0,d=c.length;u<d;u++)formatTokenFunctions[c[u]]?c[u]=formatTokenFunctions[c[u]]:c[u]=removeFormattingTokens(c[u]);return function(u){var m=``,g;for(g=0;g<d;g++)m+=isFunction(c[g])?c[g].call(u,t):c[g];return m}}function formatMoment(t,c){return t.isValid()?(c=expandFormat(c,t.localeData()),formatFunctions[c]=formatFunctions[c]||makeFormatFunction(c),formatFunctions[c](t)):t.localeData().invalidDate()}function expandFormat(t,c){var u=5;function replaceLongDateFormatTokens(t){return c.longDateFormat(t)||t}for(localFormattingTokens.lastIndex=0;u>=0&&localFormattingTokens.test(t);)t=t.replace(localFormattingTokens,replaceLongDateFormatTokens),localFormattingTokens.lastIndex=0,--u;return t}function longDateFormat(t){var c=this._longDateFormat[t],u=this._longDateFormat[t.toUpperCase()];return c||!u?c:(this._longDateFormat[t]=u.match(formattingTokens).map(function(t){return t===`MMMM`||t===`MM`||t===`DD`||t===`dddd`?t.slice(1):t}).join(``),this._longDateFormat[t])}function invalidDate(){return this._invalidDate}function ordinal(t){return this._ordinal.replace(`%d`,t)}function relativeTime(t,c,u,d){var m=this._relativeTime[u];return isFunction(m)?m(t,c,u,d):m.replace(/%d/i,t)}function pastFuture(t,c){var u=this._relativeTime[t>0?`future`:`past`];return isFunction(u)?u(c):u.replace(/%s/i,c)}function normalizeUnits(t){return typeof t==`string`?aliases[t]||aliases[t.toLowerCase()]:void 0}function normalizeObjectUnits(t){var c={},u,d;for(d in t)hasOwnProp(t,d)&&(u=normalizeUnits(d),u&&(c[u]=t[d]));return c}function getPrioritizedUnits(t){var c=[],u;for(u in t)hasOwnProp(t,u)&&c.push({unit:u,priority:priorities[u]});return c.sort(function(t,c){return t.priority-c.priority}),c}function addRegexToken(t,c,u){regexes[t]=isFunction(c)?c:function(t,d){return t&&u?u:c}}function getParseRegexForToken(t,c){return hasOwnProp(regexes,t)?regexes[t](c._strict,c._locale):new RegExp(unescapeFormat(t))}function unescapeFormat(t){return regexEscape(t.replace(`\\`,``).replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,c,u,d,m){return c||u||d||m}))}function regexEscape(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,`\\$&`)}function absFloor(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function toInt(t){var c=+t,u=0;return c!==0&&isFinite(c)&&(u=absFloor(c)),u}function addParseToken(t,c){var u,func=c,d;for(typeof t==`string`&&(t=[t]),isNumber(c)&&(func=function(t,u){u[c]=toInt(t)}),d=t.length,u=0;u<d;u++)tokens[t[u]]=func}function addWeekParseToken(t,c){addParseToken(t,function(t,u,d,m){d._w=d._w||{},c(t,d._w,d,m)})}function addTimeToArrayFromToken(t,c,u){c!=null&&hasOwnProp(tokens,t)&&tokens[t](c,u._a,u,t)}function isLeapYear(t){return t%4==0&&t%100!=0||t%400==0}function daysInYear(t){return isLeapYear(t)?366:365}function getIsLeapYear(){return isLeapYear(this.year())}function makeGetSet(t,c){return function(u){return u==null?get(this,t):(set$1$1(this,t,u),hooks.updateOffset(this,c),this)}}function get(t,c){if(!t.isValid())return NaN;var u=t._d,d=t._isUTC;switch(c){case`Milliseconds`:return d?u.getUTCMilliseconds():u.getMilliseconds();case`Seconds`:return d?u.getUTCSeconds():u.getSeconds();case`Minutes`:return d?u.getUTCMinutes():u.getMinutes();case`Hours`:return d?u.getUTCHours():u.getHours();case`Date`:return d?u.getUTCDate():u.getDate();case`Day`:return d?u.getUTCDay():u.getDay();case`Month`:return d?u.getUTCMonth():u.getMonth();case`FullYear`:return d?u.getUTCFullYear():u.getFullYear();default:return NaN}}function set$1$1(t,c,u){var d,m,g,b,S;if(!(!t.isValid()||isNaN(u))){switch(d=t._d,m=t._isUTC,c){case`Milliseconds`:m?d.setUTCMilliseconds(u):d.setMilliseconds(u);return;case`Seconds`:m?d.setUTCSeconds(u):d.setSeconds(u);return;case`Minutes`:m?d.setUTCMinutes(u):d.setMinutes(u);return;case`Hours`:m?d.setUTCHours(u):d.setHours(u);return;case`Date`:m?d.setUTCDate(u):d.setDate(u);return;case`FullYear`:break;default:return}g=u,b=t.month(),S=t.date(),S=S===29&&b===1&&!isLeapYear(g)?28:S,m?d.setUTCFullYear(g,b,S):d.setFullYear(g,b,S)}}function stringGet(t){return t=normalizeUnits(t),isFunction(this[t])?this[t]():this}function stringSet(t,c){if(typeof t==`object`){t=normalizeObjectUnits(t);var u=getPrioritizedUnits(t),d,m=u.length;for(d=0;d<m;d++)this[u[d].unit](t[u[d].unit])}else if(t=normalizeUnits(t),isFunction(this[t]))return this[t](c);return this}function mod$1(t,c){return(t%c+c)%c}function daysInMonth(t,c){if(isNaN(t)||isNaN(c))return NaN;var u=mod$1(c,12);return t+=(c-u)/12,u===1?isLeapYear(t)?29:28:31-u%7%2}function localeMonths(t,c){return t?isArray$2(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||MONTHS_IN_FORMAT).test(c)?`format`:`standalone`][t.month()]:isArray$2(this._months)?this._months:this._months.standalone}function localeMonthsShort(t,c){return t?isArray$2(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[MONTHS_IN_FORMAT.test(c)?`format`:`standalone`][t.month()]:isArray$2(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function handleStrictParse(t,c,u){var d,m,g,b=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],d=0;d<12;++d)g=createUTC([2e3,d]),this._shortMonthsParse[d]=this.monthsShort(g,``).toLocaleLowerCase(),this._longMonthsParse[d]=this.months(g,``).toLocaleLowerCase();return u?c===`MMM`?(m=indexOf.call(this._shortMonthsParse,b),m===-1?null:m):(m=indexOf.call(this._longMonthsParse,b),m===-1?null:m):c===`MMM`?(m=indexOf.call(this._shortMonthsParse,b),m===-1?(m=indexOf.call(this._longMonthsParse,b),m===-1?null:m):m):(m=indexOf.call(this._longMonthsParse,b),m===-1?(m=indexOf.call(this._shortMonthsParse,b),m===-1?null:m):m)}function localeMonthsParse(t,c,u){var d,m,g;if(this._monthsParseExact)return handleStrictParse.call(this,t,c,u);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),d=0;d<12;d++)if(m=createUTC([2e3,d]),u&&!this._longMonthsParse[d]&&(this._longMonthsParse[d]=RegExp(`^`+this.months(m,``).replace(`.`,``)+`$`,`i`),this._shortMonthsParse[d]=RegExp(`^`+this.monthsShort(m,``).replace(`.`,``)+`$`,`i`)),!u&&!this._monthsParse[d]&&(g=`^`+this.months(m,``)+`|^`+this.monthsShort(m,``),this._monthsParse[d]=new RegExp(g.replace(`.`,``),`i`)),u&&c===`MMMM`&&this._longMonthsParse[d].test(t)||u&&c===`MMM`&&this._shortMonthsParse[d].test(t)||!u&&this._monthsParse[d].test(t))return d}function setMonth(t,c){if(!t.isValid())return t;if(typeof c==`string`){if(/^\d+$/.test(c))c=toInt(c);else if(c=t.localeData().monthsParse(c),!isNumber(c))return t}var u=c,d=t.date();return d=d<29?d:Math.min(d,daysInMonth(t.year(),u)),t._isUTC?t._d.setUTCMonth(u,d):t._d.setMonth(u,d),t}function getSetMonth(t){return t==null?get(this,`Month`):(setMonth(this,t),hooks.updateOffset(this,!0),this)}function getDaysInMonth(){return daysInMonth(this.year(),this.month())}function monthsShortRegex(t){return this._monthsParseExact?(hasOwnProp(this,`_monthsRegex`)||computeMonthsParse.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(hasOwnProp(this,`_monthsShortRegex`)||(this._monthsShortRegex=defaultMonthsShortRegex),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)}function monthsRegex(t){return this._monthsParseExact?(hasOwnProp(this,`_monthsRegex`)||computeMonthsParse.call(this),t?this._monthsStrictRegex:this._monthsRegex):(hasOwnProp(this,`_monthsRegex`)||(this._monthsRegex=defaultMonthsRegex),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)}function computeMonthsParse(){function cmpLenRev(t,c){return c.length-t.length}var t=[],c=[],u=[],d,m,g,b;for(d=0;d<12;d++)m=createUTC([2e3,d]),g=regexEscape(this.monthsShort(m,``)),b=regexEscape(this.months(m,``)),t.push(g),c.push(b),u.push(b),u.push(g);t.sort(cmpLenRev),c.sort(cmpLenRev),u.sort(cmpLenRev),this._monthsRegex=RegExp(`^(`+u.join(`|`)+`)`,`i`),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=RegExp(`^(`+c.join(`|`)+`)`,`i`),this._monthsShortStrictRegex=RegExp(`^(`+t.join(`|`)+`)`,`i`)}function createDate(t,c,u,d,m,g,b){var S;return t<100&&t>=0?(S=new Date(t+400,c,u,d,m,g,b),isFinite(S.getFullYear())&&S.setFullYear(t)):S=new Date(t,c,u,d,m,g,b),S}function createUTCDate(t){var c,u;return t<100&&t>=0?(u=Array.prototype.slice.call(arguments),u[0]=t+400,c=new Date(Date.UTC.apply(null,u)),isFinite(c.getUTCFullYear())&&c.setUTCFullYear(t)):c=new Date(Date.UTC.apply(null,arguments)),c}function firstWeekOffset(t,c,u){var d=7+c-u;return-((7+createUTCDate(t,0,d).getUTCDay()-c)%7)+d-1}function dayOfYearFromWeeks(t,c,u,d,m){var g=(7+u-d)%7,b=firstWeekOffset(t,d,m),S=1+7*(c-1)+g+b,C,w;return S<=0?(C=t-1,w=daysInYear(C)+S):S>daysInYear(t)?(C=t+1,w=S-daysInYear(t)):(C=t,w=S),{year:C,dayOfYear:w}}function weekOfYear(t,c,u){var d=firstWeekOffset(t.year(),c,u),m=Math.floor((t.dayOfYear()-d-1)/7)+1,g,b;return m<1?(b=t.year()-1,g=m+weeksInYear(b,c,u)):m>weeksInYear(t.year(),c,u)?(g=m-weeksInYear(t.year(),c,u),b=t.year()+1):(b=t.year(),g=m),{week:g,year:b}}function weeksInYear(t,c,u){var d=firstWeekOffset(t,c,u),m=firstWeekOffset(t+1,c,u);return(daysInYear(t)-d+m)/7}function localeWeek(t){return weekOfYear(t,this._week.dow,this._week.doy).week}function localeFirstDayOfWeek(){return this._week.dow}function localeFirstDayOfYear(){return this._week.doy}function getSetWeek(t){var c=this.localeData().week(this);return t==null?c:this.add((t-c)*7,`d`)}function getSetISOWeek(t){var c=weekOfYear(this,1,4).week;return t==null?c:this.add((t-c)*7,`d`)}function parseWeekday(t,c){return typeof t==`string`?isNaN(t)?(t=c.weekdaysParse(t),typeof t==`number`?t:null):parseInt(t,10):t}function parseIsoWeekday(t,c){return typeof t==`string`?c.weekdaysParse(t)%7||7:isNaN(t)?null:t}function shiftWeekdays(t,c){return t.slice(c,7).concat(t.slice(0,c))}function localeWeekdays(t,c){var u=isArray$2(this._weekdays)?this._weekdays:this._weekdays[t&&t!==!0&&this._weekdays.isFormat.test(c)?`format`:`standalone`];return t===!0?shiftWeekdays(u,this._week.dow):t?u[t.day()]:u}function localeWeekdaysShort(t){return t===!0?shiftWeekdays(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function localeWeekdaysMin(t){return t===!0?shiftWeekdays(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function handleStrictParse$1(t,c,u){var d,m,g,b=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],d=0;d<7;++d)g=createUTC([2e3,1]).day(d),this._minWeekdaysParse[d]=this.weekdaysMin(g,``).toLocaleLowerCase(),this._shortWeekdaysParse[d]=this.weekdaysShort(g,``).toLocaleLowerCase(),this._weekdaysParse[d]=this.weekdays(g,``).toLocaleLowerCase();return u?c===`dddd`?(m=indexOf.call(this._weekdaysParse,b),m===-1?null:m):c===`ddd`?(m=indexOf.call(this._shortWeekdaysParse,b),m===-1?null:m):(m=indexOf.call(this._minWeekdaysParse,b),m===-1?null:m):c===`dddd`?(m=indexOf.call(this._weekdaysParse,b),m!==-1||(m=indexOf.call(this._shortWeekdaysParse,b),m!==-1)?m:(m=indexOf.call(this._minWeekdaysParse,b),m===-1?null:m)):c===`ddd`?(m=indexOf.call(this._shortWeekdaysParse,b),m!==-1||(m=indexOf.call(this._weekdaysParse,b),m!==-1)?m:(m=indexOf.call(this._minWeekdaysParse,b),m===-1?null:m)):(m=indexOf.call(this._minWeekdaysParse,b),m!==-1||(m=indexOf.call(this._weekdaysParse,b),m!==-1)?m:(m=indexOf.call(this._shortWeekdaysParse,b),m===-1?null:m))}function localeWeekdaysParse(t,c,u){var d,m,g;if(this._weekdaysParseExact)return handleStrictParse$1.call(this,t,c,u);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),d=0;d<7;d++)if(m=createUTC([2e3,1]).day(d),u&&!this._fullWeekdaysParse[d]&&(this._fullWeekdaysParse[d]=RegExp(`^`+this.weekdays(m,``).replace(`.`,`\\.?`)+`$`,`i`),this._shortWeekdaysParse[d]=RegExp(`^`+this.weekdaysShort(m,``).replace(`.`,`\\.?`)+`$`,`i`),this._minWeekdaysParse[d]=RegExp(`^`+this.weekdaysMin(m,``).replace(`.`,`\\.?`)+`$`,`i`)),this._weekdaysParse[d]||(g=`^`+this.weekdays(m,``)+`|^`+this.weekdaysShort(m,``)+`|^`+this.weekdaysMin(m,``),this._weekdaysParse[d]=new RegExp(g.replace(`.`,``),`i`)),u&&c===`dddd`&&this._fullWeekdaysParse[d].test(t)||u&&c===`ddd`&&this._shortWeekdaysParse[d].test(t)||u&&c===`dd`&&this._minWeekdaysParse[d].test(t)||!u&&this._weekdaysParse[d].test(t))return d}function getSetDayOfWeek(t){if(!this.isValid())return t==null?NaN:this;var c=get(this,`Day`);return t==null?c:(t=parseWeekday(t,this.localeData()),this.add(t-c,`d`))}function getSetLocaleDayOfWeek(t){if(!this.isValid())return t==null?NaN:this;var c=(this.day()+7-this.localeData()._week.dow)%7;return t==null?c:this.add(t-c,`d`)}function getSetISODayOfWeek(t){if(!this.isValid())return t==null?NaN:this;if(t!=null){var c=parseIsoWeekday(t,this.localeData());return this.day(this.day()%7?c:c-7)}else return this.day()||7}function weekdaysRegex(t){return this._weekdaysParseExact?(hasOwnProp(this,`_weekdaysRegex`)||computeWeekdaysParse.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(hasOwnProp(this,`_weekdaysRegex`)||(this._weekdaysRegex=defaultWeekdaysRegex),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function weekdaysShortRegex(t){return this._weekdaysParseExact?(hasOwnProp(this,`_weekdaysRegex`)||computeWeekdaysParse.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(hasOwnProp(this,`_weekdaysShortRegex`)||(this._weekdaysShortRegex=defaultWeekdaysShortRegex),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function weekdaysMinRegex(t){return this._weekdaysParseExact?(hasOwnProp(this,`_weekdaysRegex`)||computeWeekdaysParse.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(hasOwnProp(this,`_weekdaysMinRegex`)||(this._weekdaysMinRegex=defaultWeekdaysMinRegex),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function computeWeekdaysParse(){function cmpLenRev(t,c){return c.length-t.length}var t=[],c=[],u=[],d=[],m,g,b,S,C;for(m=0;m<7;m++)g=createUTC([2e3,1]).day(m),b=regexEscape(this.weekdaysMin(g,``)),S=regexEscape(this.weekdaysShort(g,``)),C=regexEscape(this.weekdays(g,``)),t.push(b),c.push(S),u.push(C),d.push(b),d.push(S),d.push(C);t.sort(cmpLenRev),c.sort(cmpLenRev),u.sort(cmpLenRev),d.sort(cmpLenRev),this._weekdaysRegex=RegExp(`^(`+d.join(`|`)+`)`,`i`),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=RegExp(`^(`+u.join(`|`)+`)`,`i`),this._weekdaysShortStrictRegex=RegExp(`^(`+c.join(`|`)+`)`,`i`),this._weekdaysMinStrictRegex=RegExp(`^(`+t.join(`|`)+`)`,`i`)}function hFormat(){return this.hours()%12||12}function kFormat(){return this.hours()||24}function meridiem(t,c){addFormatToken(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),c)})}function matchMeridiem(t,c){return c._meridiemParse}function localeIsPM(t){return(t+``).toLowerCase().charAt(0)===`p`}function localeMeridiem(t,c,u){return t>11?u?`pm`:`PM`:u?`am`:`AM`}function commonPrefix(t,c){var u,d=Math.min(t.length,c.length);for(u=0;u<d;u+=1)if(t[u]!==c[u])return u;return d}function normalizeLocale(t){return t&&t.toLowerCase().replace(`_`,`-`)}function chooseLocale(t){for(var c=0,u,d,m,g;c<t.length;){for(g=normalizeLocale(t[c]).split(`-`),u=g.length,d=normalizeLocale(t[c+1]),d=d?d.split(`-`):null;u>0;){if(m=loadLocale(g.slice(0,u).join(`-`)),m)return m;if(d&&d.length>=u&&commonPrefix(g,d)>=u-1)break;u--}c++}return globalLocale}function isLocaleNameSane(t){return!!(t&&t.match(`^[^/\\\\]*$`))}function loadLocale(t){var c=null,u;if(locales[t]===void 0&&typeof module<`u`&&module&&module.exports&&isLocaleNameSane(t))try{c=globalLocale._abbr,u=require,u(`./locale/`+t),getSetGlobalLocale(c)}catch{locales[t]=null}return locales[t]}function getSetGlobalLocale(t,c){var u;return t&&(u=isUndefined(c)?getLocale(t):defineLocale(t,c),u?globalLocale=u:typeof console<`u`&&console.warn&&console.warn(`Locale `+t+` not found. Did you forget to load it?`)),globalLocale._abbr}function defineLocale(t,c){if(c!==null){var u,d=baseConfig;if(c.abbr=t,locales[t]!=null)deprecateSimple(`defineLocaleOverride`,`use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info.`),d=locales[t]._config;else if(c.parentLocale!=null)if(locales[c.parentLocale]!=null)d=locales[c.parentLocale]._config;else if(u=loadLocale(c.parentLocale),u!=null)d=u._config;else return localeFamilies[c.parentLocale]||(localeFamilies[c.parentLocale]=[]),localeFamilies[c.parentLocale].push({name:t,config:c}),null;return locales[t]=new Locale(mergeConfigs(d,c)),localeFamilies[t]&&localeFamilies[t].forEach(function(t){defineLocale(t.name,t.config)}),getSetGlobalLocale(t),locales[t]}else return delete locales[t],null}function updateLocale(t,c){if(c!=null){var u,d,m=baseConfig;locales[t]!=null&&locales[t].parentLocale!=null?locales[t].set(mergeConfigs(locales[t]._config,c)):(d=loadLocale(t),d!=null&&(m=d._config),c=mergeConfigs(m,c),d??(c.abbr=t),u=new Locale(c),u.parentLocale=locales[t],locales[t]=u),getSetGlobalLocale(t)}else locales[t]!=null&&(locales[t].parentLocale==null?locales[t]!=null&&delete locales[t]:(locales[t]=locales[t].parentLocale,t===getSetGlobalLocale()&&getSetGlobalLocale(t)));return locales[t]}function getLocale(t){var c;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return globalLocale;if(!isArray$2(t)){if(c=loadLocale(t),c)return c;t=[t]}return chooseLocale(t)}function listLocales(){return keys$1(locales)}function checkOverflow(t){var c,u=t._a;return u&&getParsingFlags(t).overflow===-2&&(c=u[MONTH]<0||u[MONTH]>11?MONTH:u[DATE]<1||u[DATE]>daysInMonth(u[YEAR],u[MONTH])?DATE:u[HOUR]<0||u[HOUR]>24||u[HOUR]===24&&(u[MINUTE]!==0||u[SECOND]!==0||u[MILLISECOND]!==0)?HOUR:u[MINUTE]<0||u[MINUTE]>59?MINUTE:u[SECOND]<0||u[SECOND]>59?SECOND:u[MILLISECOND]<0||u[MILLISECOND]>999?MILLISECOND:-1,getParsingFlags(t)._overflowDayOfYear&&(c<YEAR||c>DATE)&&(c=DATE),getParsingFlags(t)._overflowWeeks&&c===-1&&(c=WEEK),getParsingFlags(t)._overflowWeekday&&c===-1&&(c=WEEKDAY),getParsingFlags(t).overflow=c),t}function configFromISO(t){var c,u,d=t._i,m=extendedIsoRegex.exec(d)||basicIsoRegex.exec(d),g,b,S,C,w=isoDates.length,T=isoTimes.length;if(m){for(getParsingFlags(t).iso=!0,c=0,u=w;c<u;c++)if(isoDates[c][1].exec(m[1])){b=isoDates[c][0],g=isoDates[c][2]!==!1;break}if(b==null){t._isValid=!1;return}if(m[3]){for(c=0,u=T;c<u;c++)if(isoTimes[c][1].exec(m[3])){S=(m[2]||` `)+isoTimes[c][0];break}if(S==null){t._isValid=!1;return}}if(!g&&S!=null){t._isValid=!1;return}if(m[4])if(tzRegex.exec(m[4]))C=`Z`;else{t._isValid=!1;return}t._f=b+(S||``)+(C||``),configFromStringAndFormat(t)}else t._isValid=!1}function extractFromRFC2822Strings(t,c,u,d,m,g){var b=[untruncateYear(t),defaultLocaleMonthsShort.indexOf(c),parseInt(u,10),parseInt(d,10),parseInt(m,10)];return g&&b.push(parseInt(g,10)),b}function untruncateYear(t){var c=parseInt(t,10);return c<=49?2e3+c:c<=999?1900+c:c}function preprocessRFC2822(t){return t.replace(/\([^()]*\)|[\n\t]/g,` `).replace(/(\s\s+)/g,` `).replace(/^\s\s*/,``).replace(/\s\s*$/,``)}function checkWeekday(t,c,u){return t&&defaultLocaleWeekdaysShort.indexOf(t)!==new Date(c[0],c[1],c[2]).getDay()?(getParsingFlags(u).weekdayMismatch=!0,u._isValid=!1,!1):!0}function calculateOffset(t,c,u){if(t)return obsOffsets[t];if(c)return 0;var d=parseInt(u,10),m=d%100;return(d-m)/100*60+m}function configFromRFC2822(t){var c=rfc2822.exec(preprocessRFC2822(t._i)),u;if(c){if(u=extractFromRFC2822Strings(c[4],c[3],c[2],c[5],c[6],c[7]),!checkWeekday(c[1],u,t))return;t._a=u,t._tzm=calculateOffset(c[8],c[9],c[10]),t._d=createUTCDate.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),getParsingFlags(t).rfc2822=!0}else t._isValid=!1}function configFromString(t){var c=aspNetJsonRegex.exec(t._i);if(c!==null){t._d=new Date(+c[1]);return}if(configFromISO(t),t._isValid===!1)delete t._isValid;else return;if(configFromRFC2822(t),t._isValid===!1)delete t._isValid;else return;t._strict?t._isValid=!1:hooks.createFromInputFallback(t)}function defaults$1(t,c,u){return t??c??u}function currentDateArray(t){var c=new Date(hooks.now());return t._useUTC?[c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()]:[c.getFullYear(),c.getMonth(),c.getDate()]}function configFromArray(t){var c,u,d=[],m,g,b;if(!t._d){for(m=currentDateArray(t),t._w&&t._a[DATE]==null&&t._a[MONTH]==null&&dayOfYearFromWeekInfo(t),t._dayOfYear!=null&&(b=defaults$1(t._a[YEAR],m[YEAR]),(t._dayOfYear>daysInYear(b)||t._dayOfYear===0)&&(getParsingFlags(t)._overflowDayOfYear=!0),u=createUTCDate(b,0,t._dayOfYear),t._a[MONTH]=u.getUTCMonth(),t._a[DATE]=u.getUTCDate()),c=0;c<3&&t._a[c]==null;++c)t._a[c]=d[c]=m[c];for(;c<7;c++)t._a[c]=d[c]=t._a[c]==null?c===2?1:0:t._a[c];t._a[HOUR]===24&&t._a[MINUTE]===0&&t._a[SECOND]===0&&t._a[MILLISECOND]===0&&(t._nextDay=!0,t._a[HOUR]=0),t._d=(t._useUTC?createUTCDate:createDate).apply(null,d),g=t._useUTC?t._d.getUTCDay():t._d.getDay(),t._tzm!=null&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[HOUR]=24),t._w&&t._w.d!==void 0&&t._w.d!==g&&(getParsingFlags(t).weekdayMismatch=!0)}}function dayOfYearFromWeekInfo(t){var c=t._w,u,d,m,g,b,S,C,w;c.GG!=null||c.W!=null||c.E!=null?(g=1,b=4,u=defaults$1(c.GG,t._a[YEAR],weekOfYear(createLocal(),1,4).year),d=defaults$1(c.W,1),m=defaults$1(c.E,1),(m<1||m>7)&&(C=!0)):(g=t._locale._week.dow,b=t._locale._week.doy,w=weekOfYear(createLocal(),g,b),u=defaults$1(c.gg,t._a[YEAR],w.year),d=defaults$1(c.w,w.week),c.d==null?c.e==null?m=g:(m=c.e+g,(c.e<0||c.e>6)&&(C=!0)):(m=c.d,(m<0||m>6)&&(C=!0))),d<1||d>weeksInYear(u,g,b)?getParsingFlags(t)._overflowWeeks=!0:C==null?(S=dayOfYearFromWeeks(u,d,m,g,b),t._a[YEAR]=S.year,t._dayOfYear=S.dayOfYear):getParsingFlags(t)._overflowWeekday=!0}function configFromStringAndFormat(t){if(t._f===hooks.ISO_8601){configFromISO(t);return}if(t._f===hooks.RFC_2822){configFromRFC2822(t);return}t._a=[],getParsingFlags(t).empty=!0;var c=``+t._i,u,d,m,g,b,S=c.length,C=0,w,T;for(m=expandFormat(t._f,t._locale).match(formattingTokens)||[],T=m.length,u=0;u<T;u++)g=m[u],d=(c.match(getParseRegexForToken(g,t))||[])[0],d&&(b=c.substr(0,c.indexOf(d)),b.length>0&&getParsingFlags(t).unusedInput.push(b),c=c.slice(c.indexOf(d)+d.length),C+=d.length),formatTokenFunctions[g]?(d?getParsingFlags(t).empty=!1:getParsingFlags(t).unusedTokens.push(g),addTimeToArrayFromToken(g,d,t)):t._strict&&!d&&getParsingFlags(t).unusedTokens.push(g);getParsingFlags(t).charsLeftOver=S-C,c.length>0&&getParsingFlags(t).unusedInput.push(c),t._a[HOUR]<=12&&getParsingFlags(t).bigHour===!0&&t._a[HOUR]>0&&(getParsingFlags(t).bigHour=void 0),getParsingFlags(t).parsedDateParts=t._a.slice(0),getParsingFlags(t).meridiem=t._meridiem,t._a[HOUR]=meridiemFixWrap(t._locale,t._a[HOUR],t._meridiem),w=getParsingFlags(t).era,w!==null&&(t._a[YEAR]=t._locale.erasConvertYear(w,t._a[YEAR])),configFromArray(t),checkOverflow(t)}function meridiemFixWrap(t,c,u){var d;return u==null?c:t.meridiemHour==null?t.isPM==null?c:(d=t.isPM(u),d&&c<12&&(c+=12),!d&&c===12&&(c=0),c):t.meridiemHour(c,u)}function configFromStringAndArray(t){var c,u,d,m,g,b,S=!1,C=t._f.length;if(C===0){getParsingFlags(t).invalidFormat=!0,t._d=new Date(NaN);return}for(m=0;m<C;m++)g=0,b=!1,c=copyConfig({},t),t._useUTC!=null&&(c._useUTC=t._useUTC),c._f=t._f[m],configFromStringAndFormat(c),isValid(c)&&(b=!0),g+=getParsingFlags(c).charsLeftOver,g+=getParsingFlags(c).unusedTokens.length*10,getParsingFlags(c).score=g,S?g<d&&(d=g,u=c):(d==null||g<d||b)&&(d=g,u=c,b&&(S=!0));extend$1(t,u||c)}function configFromObject(t){if(!t._d){var c=normalizeObjectUnits(t._i),u=c.day===void 0?c.date:c.day;t._a=map([c.year,c.month,u,c.hour,c.minute,c.second,c.millisecond],function(t){return t&&parseInt(t,10)}),configFromArray(t)}}function createFromConfig(t){var c=new Moment(checkOverflow(prepareConfig(t)));return c._nextDay&&(c.add(1,`d`),c._nextDay=void 0),c}function prepareConfig(t){var c=t._i,u=t._f;return t._locale=t._locale||getLocale(t._l),c===null||u===void 0&&c===``?createInvalid({nullInput:!0}):(typeof c==`string`&&(t._i=c=t._locale.preparse(c)),isMoment(c)?new Moment(checkOverflow(c)):(isDate(c)?t._d=c:isArray$2(u)?configFromStringAndArray(t):u?configFromStringAndFormat(t):configFromInput(t),isValid(t)||(t._d=null),t))}function configFromInput(t){var c=t._i;isUndefined(c)?t._d=new Date(hooks.now()):isDate(c)?t._d=new Date(c.valueOf()):typeof c==`string`?configFromString(t):isArray$2(c)?(t._a=map(c.slice(0),function(t){return parseInt(t,10)}),configFromArray(t)):isObject(c)?configFromObject(t):isNumber(c)?t._d=new Date(c):hooks.createFromInputFallback(t)}function createLocalOrUTC(t,c,u,d,m){var g={};return(c===!0||c===!1)&&(d=c,c=void 0),(u===!0||u===!1)&&(d=u,u=void 0),(isObject(t)&&isObjectEmpty(t)||isArray$2(t)&&t.length===0)&&(t=void 0),g._isAMomentObject=!0,g._useUTC=g._isUTC=m,g._l=u,g._i=t,g._f=c,g._strict=d,createFromConfig(g)}function createLocal(t,c,u,d){return createLocalOrUTC(t,c,u,d,!1)}function pickBy(t,c){var u,d;if(c.length===1&&isArray$2(c[0])&&(c=c[0]),!c.length)return createLocal();for(u=c[0],d=1;d<c.length;++d)(!c[d].isValid()||c[d][t](u))&&(u=c[d]);return u}function min(){return pickBy(`isBefore`,[].slice.call(arguments,0))}function max$1(){return pickBy(`isAfter`,[].slice.call(arguments,0))}function isDurationValid(t){var c,u=!1,d,m=ordering.length;for(c in t)if(hasOwnProp(t,c)&&!(indexOf.call(ordering,c)!==-1&&(t[c]==null||!isNaN(t[c]))))return!1;for(d=0;d<m;++d)if(t[ordering[d]]){if(u)return!1;parseFloat(t[ordering[d]])!==toInt(t[ordering[d]])&&(u=!0)}return!0}function isValid$1(){return this._isValid}function createInvalid$1(){return createDuration(NaN)}function Duration(t){var c=normalizeObjectUnits(t),u=c.year||0,d=c.quarter||0,m=c.month||0,g=c.week||c.isoWeek||0,b=c.day||0,S=c.hour||0,C=c.minute||0,w=c.second||0,T=c.millisecond||0;this._isValid=isDurationValid(c),this._milliseconds=+T+w*1e3+C*6e4+S*1e3*60*60,this._days=+b+g*7,this._months=+m+d*3+u*12,this._data={},this._locale=getLocale(),this._bubble()}function isDuration(t){return t instanceof Duration}function absRound(t){return t<0?Math.round(-1*t)*-1:Math.round(t)}function compareArrays(t,c,u){var d=Math.min(t.length,c.length),m=Math.abs(t.length-c.length),g=0,b;for(b=0;b<d;b++)(u&&t[b]!==c[b]||!u&&toInt(t[b])!==toInt(c[b]))&&g++;return g+m}function offset(t,c){addFormatToken(t,0,0,function(){var t=this.utcOffset(),u=`+`;return t<0&&(t=-t,u=`-`),u+zeroFill(~~(t/60),2)+c+zeroFill(~~t%60,2)})}function offsetFromString(t,c){var u=(c||``).match(t),d,m,g;return u===null?null:(d=u[u.length-1]||[],m=(d+``).match(chunkOffset)||[`-`,0,0],g=+(m[1]*60)+toInt(m[2]),g===0?0:m[0]===`+`?g:-g)}function cloneWithOffset(t,c){var u,d;return c._isUTC?(u=c.clone(),d=(isMoment(t)||isDate(t)?t.valueOf():createLocal(t).valueOf())-u.valueOf(),u._d.setTime(u._d.valueOf()+d),hooks.updateOffset(u,!1),u):createLocal(t).local()}function getDateOffset(t){return-Math.round(t._d.getTimezoneOffset())}function getSetOffset(t,c,u){var d=this._offset||0,m;if(!this.isValid())return t==null?NaN:this;if(t!=null){if(typeof t==`string`){if(t=offsetFromString(matchShortOffset,t),t===null)return this}else Math.abs(t)<16&&!u&&(t*=60);return!this._isUTC&&c&&(m=getDateOffset(this)),this._offset=t,this._isUTC=!0,m!=null&&this.add(m,`m`),d!==t&&(!c||this._changeInProgress?addSubtract(this,createDuration(t-d,`m`),1,!1):this._changeInProgress||(this._changeInProgress=!0,hooks.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?d:getDateOffset(this)}function getSetZone(t,c){return t==null?-this.utcOffset():(typeof t!=`string`&&(t=-t),this.utcOffset(t,c),this)}function setOffsetToUTC(t){return this.utcOffset(0,t)}function setOffsetToLocal(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(getDateOffset(this),`m`)),this}function setOffsetToParsedOffset(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i==`string`){var t=offsetFromString(matchOffset,this._i);t==null?this.utcOffset(0,!0):this.utcOffset(t)}return this}function hasAlignedHourOffset(t){return this.isValid()?(t=t?createLocal(t).utcOffset():0,(this.utcOffset()-t)%60==0):!1}function isDaylightSavingTime(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function isDaylightSavingTimeShifted(){if(!isUndefined(this._isDSTShifted))return this._isDSTShifted;var t={},c;return copyConfig(t,this),t=prepareConfig(t),t._a?(c=t._isUTC?createUTC(t._a):createLocal(t._a),this._isDSTShifted=this.isValid()&&compareArrays(t._a,c.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function isLocal(){return this.isValid()?!this._isUTC:!1}function isUtcOffset(){return this.isValid()?this._isUTC:!1}function isUtc(){return this.isValid()?this._isUTC&&this._offset===0:!1}function createDuration(t,c){var u=t,d=null,m,g,b;return isDuration(t)?u={ms:t._milliseconds,d:t._days,M:t._months}:isNumber(t)||!isNaN(+t)?(u={},c?u[c]=+t:u.milliseconds=+t):(d=aspNetRegex.exec(t))?(m=d[1]===`-`?-1:1,u={y:0,d:toInt(d[DATE])*m,h:toInt(d[HOUR])*m,m:toInt(d[MINUTE])*m,s:toInt(d[SECOND])*m,ms:toInt(absRound(d[MILLISECOND]*1e3))*m}):(d=isoRegex.exec(t))?(m=d[1]===`-`?-1:1,u={y:parseIso(d[2],m),M:parseIso(d[3],m),w:parseIso(d[4],m),d:parseIso(d[5],m),h:parseIso(d[6],m),m:parseIso(d[7],m),s:parseIso(d[8],m)}):u==null?u={}:typeof u==`object`&&(`from`in u||`to`in u)&&(b=momentsDifference(createLocal(u.from),createLocal(u.to)),u={},u.ms=b.milliseconds,u.M=b.months),g=new Duration(u),isDuration(t)&&hasOwnProp(t,`_locale`)&&(g._locale=t._locale),isDuration(t)&&hasOwnProp(t,`_isValid`)&&(g._isValid=t._isValid),g}function parseIso(t,c){var u=t&&parseFloat(t.replace(`,`,`.`));return(isNaN(u)?0:u)*c}function positiveMomentsDifference(t,c){var u={};return u.months=c.month()-t.month()+(c.year()-t.year())*12,t.clone().add(u.months,`M`).isAfter(c)&&--u.months,u.milliseconds=c-+t.clone().add(u.months,`M`),u}function momentsDifference(t,c){var u;return t.isValid()&&c.isValid()?(c=cloneWithOffset(c,t),t.isBefore(c)?u=positiveMomentsDifference(t,c):(u=positiveMomentsDifference(c,t),u.milliseconds=-u.milliseconds,u.months=-u.months),u):{milliseconds:0,months:0}}function createAdder(t,c){return function(u,d){var m,g;return d!==null&&!isNaN(+d)&&(deprecateSimple(c,`moment().`+c+`(period, number) is deprecated. Please use moment().`+c+`(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.`),g=u,u=d,d=g),m=createDuration(u,d),addSubtract(this,m,t),this}}function addSubtract(t,c,u,d){var m=c._milliseconds,g=absRound(c._days),b=absRound(c._months);t.isValid()&&(d=d??!0,b&&setMonth(t,get(t,`Month`)+b*u),g&&set$1$1(t,`Date`,get(t,`Date`)+g*u),m&&t._d.setTime(t._d.valueOf()+m*u),d&&hooks.updateOffset(t,g||b))}function isString(t){return typeof t==`string`||t instanceof String}function isMomentInput(t){return isMoment(t)||isDate(t)||isString(t)||isNumber(t)||isNumberOrStringArray(t)||isMomentInputObject(t)||t==null}function isMomentInputObject(t){var c=isObject(t)&&!isObjectEmpty(t),u=!1,d=[`years`,`year`,`y`,`months`,`month`,`M`,`days`,`day`,`d`,`dates`,`date`,`D`,`hours`,`hour`,`h`,`minutes`,`minute`,`m`,`seconds`,`second`,`s`,`milliseconds`,`millisecond`,`ms`],m,g,b=d.length;for(m=0;m<b;m+=1)g=d[m],u=u||hasOwnProp(t,g);return c&&u}function isNumberOrStringArray(t){var c=isArray$2(t),u=!1;return c&&(u=t.filter(function(c){return!isNumber(c)&&isString(t)}).length===0),c&&u}function isCalendarSpec(t){var c=isObject(t)&&!isObjectEmpty(t),u=!1,d=[`sameDay`,`nextDay`,`lastDay`,`nextWeek`,`lastWeek`,`sameElse`],m,g;for(m=0;m<d.length;m+=1)g=d[m],u=u||hasOwnProp(t,g);return c&&u}function getCalendarFormat(t,c){var u=t.diff(c,`days`,!0);return u<-6?`sameElse`:u<-1?`lastWeek`:u<0?`lastDay`:u<1?`sameDay`:u<2?`nextDay`:u<7?`nextWeek`:`sameElse`}function calendar$1(t,c){arguments.length===1&&(arguments[0]?isMomentInput(arguments[0])?(t=arguments[0],c=void 0):isCalendarSpec(arguments[0])&&(c=arguments[0],t=void 0):(t=void 0,c=void 0));var u=t||createLocal(),d=cloneWithOffset(u,this).startOf(`day`),m=hooks.calendarFormat(this,d)||`sameElse`,g=c&&(isFunction(c[m])?c[m].call(this,u):c[m]);return this.format(g||this.localeData().calendar(m,this,createLocal(u)))}function clone$3(){return new Moment(this)}function isAfter(t,c){var u=isMoment(t)?t:createLocal(t);return this.isValid()&&u.isValid()?(c=normalizeUnits(c)||`millisecond`,c===`millisecond`?this.valueOf()>u.valueOf():u.valueOf()<this.clone().startOf(c).valueOf()):!1}function isBefore(t,c){var u=isMoment(t)?t:createLocal(t);return this.isValid()&&u.isValid()?(c=normalizeUnits(c)||`millisecond`,c===`millisecond`?this.valueOf()<u.valueOf():this.clone().endOf(c).valueOf()<u.valueOf()):!1}function isBetween(t,c,u,d){var m=isMoment(t)?t:createLocal(t),g=isMoment(c)?c:createLocal(c);return this.isValid()&&m.isValid()&&g.isValid()?(d=d||`()`,(d[0]===`(`?this.isAfter(m,u):!this.isBefore(m,u))&&(d[1]===`)`?this.isBefore(g,u):!this.isAfter(g,u))):!1}function isSame(t,c){var u=isMoment(t)?t:createLocal(t),d;return this.isValid()&&u.isValid()?(c=normalizeUnits(c)||`millisecond`,c===`millisecond`?this.valueOf()===u.valueOf():(d=u.valueOf(),this.clone().startOf(c).valueOf()<=d&&d<=this.clone().endOf(c).valueOf())):!1}function isSameOrAfter(t,c){return this.isSame(t,c)||this.isAfter(t,c)}function isSameOrBefore(t,c){return this.isSame(t,c)||this.isBefore(t,c)}function diff(t,c,u){var d,m,g;if(!this.isValid()||(d=cloneWithOffset(t,this),!d.isValid()))return NaN;switch(m=(d.utcOffset()-this.utcOffset())*6e4,c=normalizeUnits(c),c){case`year`:g=monthDiff(this,d)/12;break;case`month`:g=monthDiff(this,d);break;case`quarter`:g=monthDiff(this,d)/3;break;case`second`:g=(this-d)/1e3;break;case`minute`:g=(this-d)/6e4;break;case`hour`:g=(this-d)/36e5;break;case`day`:g=(this-d-m)/864e5;break;case`week`:g=(this-d-m)/6048e5;break;default:g=this-d}return u?g:absFloor(g)}function monthDiff(t,c){if(t.date()<c.date())return-monthDiff(c,t);var u=(c.year()-t.year())*12+(c.month()-t.month()),d=t.clone().add(u,`months`),m,g;return c-d<0?(m=t.clone().add(u-1,`months`),g=(c-d)/(d-m)):(m=t.clone().add(u+1,`months`),g=(c-d)/(m-d)),-(u+g)||0}function toString(){return this.clone().locale(`en`).format(`ddd MMM DD YYYY HH:mm:ss [GMT]ZZ`)}function toISOString(t){if(!this.isValid())return null;var c=t!==!0,u=c?this.clone().utc():this;return u.year()<0||u.year()>9999?formatMoment(u,c?`YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]`:`YYYYYY-MM-DD[T]HH:mm:ss.SSSZ`):isFunction(Date.prototype.toISOString)?c?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace(`Z`,formatMoment(u,`Z`)):formatMoment(u,c?`YYYY-MM-DD[T]HH:mm:ss.SSS[Z]`:`YYYY-MM-DD[T]HH:mm:ss.SSSZ`)}function inspect(){if(!this.isValid())return`moment.invalid(/* `+this._i+` */)`;var t=`moment`,c=``,u,d,m,g;return this.isLocal()||(t=this.utcOffset()===0?`moment.utc`:`moment.parseZone`,c=`Z`),u=`[`+t+`("]`,d=0<=this.year()&&this.year()<=9999?`YYYY`:`YYYYYY`,m=`-MM-DD[T]HH:mm:ss.SSS`,g=c+`[")]`,this.format(u+d+m+g)}function format(t){t||(t=this.isUtc()?hooks.defaultFormatUtc:hooks.defaultFormat);var c=formatMoment(this,t);return this.localeData().postformat(c)}function from(t,c){return this.isValid()&&(isMoment(t)&&t.isValid()||createLocal(t).isValid())?createDuration({to:this,from:t}).locale(this.locale()).humanize(!c):this.localeData().invalidDate()}function fromNow(t){return this.from(createLocal(),t)}function to(t,c){return this.isValid()&&(isMoment(t)&&t.isValid()||createLocal(t).isValid())?createDuration({from:this,to:t}).locale(this.locale()).humanize(!c):this.localeData().invalidDate()}function toNow(t){return this.to(createLocal(),t)}function locale(t){var c;return t===void 0?this._locale._abbr:(c=getLocale(t),c!=null&&(this._locale=c),this)}function localeData(){return this._locale}function mod$1$1(t,c){return(t%c+c)%c}function localStartOfDate(t,c,u){return t<100&&t>=0?new Date(t+400,c,u)-MS_PER_400_YEARS:new Date(t,c,u).valueOf()}function utcStartOfDate(t,c,u){return t<100&&t>=0?Date.UTC(t+400,c,u)-MS_PER_400_YEARS:Date.UTC(t,c,u)}function startOf(t){var c,u;if(t=normalizeUnits(t),t===void 0||t===`millisecond`||!this.isValid())return this;switch(u=this._isUTC?utcStartOfDate:localStartOfDate,t){case`year`:c=u(this.year(),0,1);break;case`quarter`:c=u(this.year(),this.month()-this.month()%3,1);break;case`month`:c=u(this.year(),this.month(),1);break;case`week`:c=u(this.year(),this.month(),this.date()-this.weekday());break;case`isoWeek`:c=u(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case`day`:case`date`:c=u(this.year(),this.month(),this.date());break;case`hour`:c=this._d.valueOf(),c-=mod$1$1(c+(this._isUTC?0:this.utcOffset()*MS_PER_MINUTE),MS_PER_HOUR);break;case`minute`:c=this._d.valueOf(),c-=mod$1$1(c,MS_PER_MINUTE);break;case`second`:c=this._d.valueOf(),c-=mod$1$1(c,MS_PER_SECOND);break}return this._d.setTime(c),hooks.updateOffset(this,!0),this}function endOf(t){var c,u;if(t=normalizeUnits(t),t===void 0||t===`millisecond`||!this.isValid())return this;switch(u=this._isUTC?utcStartOfDate:localStartOfDate,t){case`year`:c=u(this.year()+1,0,1)-1;break;case`quarter`:c=u(this.year(),this.month()-this.month()%3+3,1)-1;break;case`month`:c=u(this.year(),this.month()+1,1)-1;break;case`week`:c=u(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case`isoWeek`:c=u(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case`day`:case`date`:c=u(this.year(),this.month(),this.date()+1)-1;break;case`hour`:c=this._d.valueOf(),c+=MS_PER_HOUR-mod$1$1(c+(this._isUTC?0:this.utcOffset()*MS_PER_MINUTE),MS_PER_HOUR)-1;break;case`minute`:c=this._d.valueOf(),c+=MS_PER_MINUTE-mod$1$1(c,MS_PER_MINUTE)-1;break;case`second`:c=this._d.valueOf(),c+=MS_PER_SECOND-mod$1$1(c,MS_PER_SECOND)-1;break}return this._d.setTime(c),hooks.updateOffset(this,!0),this}function valueOf(){return this._d.valueOf()-(this._offset||0)*6e4}function unix(){return Math.floor(this.valueOf()/1e3)}function toDate(){return new Date(this.valueOf())}function toArray(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function toObject$1(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function toJSON$1(){return this.isValid()?this.toISOString():null}function isValid$2(){return isValid(this)}function parsingFlags(){return extend$1({},getParsingFlags(this))}function invalidAt(){return getParsingFlags(this).overflow}function creationData(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function localeEras(t,c){var u,d,m,g=this._eras||getLocale(`en`)._eras;for(u=0,d=g.length;u<d;++u){switch(typeof g[u].since){case`string`:m=hooks(g[u].since).startOf(`day`),g[u].since=m.valueOf();break}switch(typeof g[u].until){case`undefined`:g[u].until=1/0;break;case`string`:m=hooks(g[u].until).startOf(`day`).valueOf(),g[u].until=m.valueOf();break}}return g}function localeErasParse(t,c,u){var d,m,g=this.eras(),b,S,C;for(t=t.toUpperCase(),d=0,m=g.length;d<m;++d)if(b=g[d].name.toUpperCase(),S=g[d].abbr.toUpperCase(),C=g[d].narrow.toUpperCase(),u)switch(c){case`N`:case`NN`:case`NNN`:if(S===t)return g[d];break;case`NNNN`:if(b===t)return g[d];break;case`NNNNN`:if(C===t)return g[d];break}else if([b,S,C].indexOf(t)>=0)return g[d]}function localeErasConvertYear(t,c){var u=t.since<=t.until?1:-1;return c===void 0?hooks(t.since).year():hooks(t.since).year()+(c-t.offset)*u}function getEraName(){var t,c,u,d=this.localeData().eras();for(t=0,c=d.length;t<c;++t)if(u=this.clone().startOf(`day`).valueOf(),d[t].since<=u&&u<=d[t].until||d[t].until<=u&&u<=d[t].since)return d[t].name;return``}function getEraNarrow(){var t,c,u,d=this.localeData().eras();for(t=0,c=d.length;t<c;++t)if(u=this.clone().startOf(`day`).valueOf(),d[t].since<=u&&u<=d[t].until||d[t].until<=u&&u<=d[t].since)return d[t].narrow;return``}function getEraAbbr(){var t,c,u,d=this.localeData().eras();for(t=0,c=d.length;t<c;++t)if(u=this.clone().startOf(`day`).valueOf(),d[t].since<=u&&u<=d[t].until||d[t].until<=u&&u<=d[t].since)return d[t].abbr;return``}function getEraYear(){var t,c,u,d,m=this.localeData().eras();for(t=0,c=m.length;t<c;++t)if(u=m[t].since<=m[t].until?1:-1,d=this.clone().startOf(`day`).valueOf(),m[t].since<=d&&d<=m[t].until||m[t].until<=d&&d<=m[t].since)return(this.year()-hooks(m[t].since).year())*u+m[t].offset;return this.year()}function erasNameRegex(t){return hasOwnProp(this,`_erasNameRegex`)||computeErasParse.call(this),t?this._erasNameRegex:this._erasRegex}function erasAbbrRegex(t){return hasOwnProp(this,`_erasAbbrRegex`)||computeErasParse.call(this),t?this._erasAbbrRegex:this._erasRegex}function erasNarrowRegex(t){return hasOwnProp(this,`_erasNarrowRegex`)||computeErasParse.call(this),t?this._erasNarrowRegex:this._erasRegex}function matchEraAbbr(t,c){return c.erasAbbrRegex(t)}function matchEraName(t,c){return c.erasNameRegex(t)}function matchEraNarrow(t,c){return c.erasNarrowRegex(t)}function matchEraYearOrdinal(t,c){return c._eraYearOrdinalRegex||matchUnsigned}function computeErasParse(){var t=[],c=[],u=[],d=[],m,g,b,S,C,w=this.eras();for(m=0,g=w.length;m<g;++m)b=regexEscape(w[m].name),S=regexEscape(w[m].abbr),C=regexEscape(w[m].narrow),c.push(b),t.push(S),u.push(C),d.push(b),d.push(S),d.push(C);this._erasRegex=RegExp(`^(`+d.join(`|`)+`)`,`i`),this._erasNameRegex=RegExp(`^(`+c.join(`|`)+`)`,`i`),this._erasAbbrRegex=RegExp(`^(`+t.join(`|`)+`)`,`i`),this._erasNarrowRegex=RegExp(`^(`+u.join(`|`)+`)`,`i`)}function addWeekYearFormatToken(t,c){addFormatToken(0,[t,t.length],0,c)}function getSetWeekYear(t){return getSetWeekYearHelper.call(this,t,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function getSetISOWeekYear(t){return getSetWeekYearHelper.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function getISOWeeksInYear(){return weeksInYear(this.year(),1,4)}function getISOWeeksInISOWeekYear(){return weeksInYear(this.isoWeekYear(),1,4)}function getWeeksInYear(){var t=this.localeData()._week;return weeksInYear(this.year(),t.dow,t.doy)}function getWeeksInWeekYear(){var t=this.localeData()._week;return weeksInYear(this.weekYear(),t.dow,t.doy)}function getSetWeekYearHelper(t,c,u,d,m){var g;return t==null?weekOfYear(this,d,m).year:(g=weeksInYear(t,d,m),c>g&&(c=g),setWeekAll.call(this,t,c,u,d,m))}function setWeekAll(t,c,u,d,m){var g=dayOfYearFromWeeks(t,c,u,d,m),b=createUTCDate(g.year,0,g.dayOfYear);return this.year(b.getUTCFullYear()),this.month(b.getUTCMonth()),this.date(b.getUTCDate()),this}function getSetQuarter(t){return t==null?Math.ceil((this.month()+1)/3):this.month((t-1)*3+this.month()%3)}function getSetDayOfYear(t){var c=Math.round((this.clone().startOf(`day`)-this.clone().startOf(`year`))/864e5)+1;return t==null?c:this.add(t-c,`d`)}function parseMs(t,c){c[MILLISECOND]=toInt((`0.`+t)*1e3)}function getZoneAbbr(){return this._isUTC?`UTC`:``}function getZoneName(){return this._isUTC?`Coordinated Universal Time`:``}function createUnix(t){return createLocal(t*1e3)}function createInZone(){return createLocal.apply(null,arguments).parseZone()}function preParsePostFormat(t){return t}function get$1$1(t,c,u,d){var m=getLocale(),g=createUTC().set(d,c);return m[u](g,t)}function listMonthsImpl(t,c,u){if(isNumber(t)&&(c=t,t=void 0),t=t||``,c!=null)return get$1$1(t,c,u,`month`);var d,m=[];for(d=0;d<12;d++)m[d]=get$1$1(t,d,u,`month`);return m}function listWeekdaysImpl(t,c,u,d){typeof t==`boolean`?(isNumber(c)&&(u=c,c=void 0),c=c||``):(c=t,u=c,t=!1,isNumber(c)&&(u=c,c=void 0),c=c||``);var m=getLocale(),g=t?m._week.dow:0,b,S=[];if(u!=null)return get$1$1(c,(u+g)%7,d,`day`);for(b=0;b<7;b++)S[b]=get$1$1(c,(b+g)%7,d,`day`);return S}function listMonths(t,c){return listMonthsImpl(t,c,`months`)}function listMonthsShort(t,c){return listMonthsImpl(t,c,`monthsShort`)}function listWeekdays(t,c,u){return listWeekdaysImpl(t,c,u,`weekdays`)}function listWeekdaysShort(t,c,u){return listWeekdaysImpl(t,c,u,`weekdaysShort`)}function listWeekdaysMin(t,c,u){return listWeekdaysImpl(t,c,u,`weekdaysMin`)}function abs(){var t=this._data;return this._milliseconds=mathAbs(this._milliseconds),this._days=mathAbs(this._days),this._months=mathAbs(this._months),t.milliseconds=mathAbs(t.milliseconds),t.seconds=mathAbs(t.seconds),t.minutes=mathAbs(t.minutes),t.hours=mathAbs(t.hours),t.months=mathAbs(t.months),t.years=mathAbs(t.years),this}function addSubtract$1(t,c,u,d){var m=createDuration(c,u);return t._milliseconds+=d*m._milliseconds,t._days+=d*m._days,t._months+=d*m._months,t._bubble()}function add$1$1(t,c){return addSubtract$1(this,t,c,1)}function subtract$1(t,c){return addSubtract$1(this,t,c,-1)}function absCeil(t){return t<0?Math.floor(t):Math.ceil(t)}function bubble(){var t=this._milliseconds,c=this._days,u=this._months,d=this._data,m,g,b,S,C;return t>=0&&c>=0&&u>=0||t<=0&&c<=0&&u<=0||(t+=absCeil(monthsToDays(u)+c)*864e5,c=0,u=0),d.milliseconds=t%1e3,m=absFloor(t/1e3),d.seconds=m%60,g=absFloor(m/60),d.minutes=g%60,b=absFloor(g/60),d.hours=b%24,c+=absFloor(b/24),C=absFloor(daysToMonths(c)),u+=C,c-=absCeil(monthsToDays(C)),S=absFloor(u/12),u%=12,d.days=c,d.months=u,d.years=S,this}function daysToMonths(t){return t*4800/146097}function monthsToDays(t){return t*146097/4800}function as(t){if(!this.isValid())return NaN;var c,u,d=this._milliseconds;if(t=normalizeUnits(t),t===`month`||t===`quarter`||t===`year`)switch(c=this._days+d/864e5,u=this._months+daysToMonths(c),t){case`month`:return u;case`quarter`:return u/3;case`year`:return u/12}else switch(c=this._days+Math.round(monthsToDays(this._months)),t){case`week`:return c/7+d/6048e5;case`day`:return c+d/864e5;case`hour`:return c*24+d/36e5;case`minute`:return c*1440+d/6e4;case`second`:return c*86400+d/1e3;case`millisecond`:return Math.floor(c*864e5)+d;default:throw Error(`Unknown unit `+t)}}function makeAs(t){return function(){return this.as(t)}}function clone$1$1(){return createDuration(this)}function get$2$1(t){return t=normalizeUnits(t),this.isValid()?this[t+`s`]():NaN}function makeGetter(t){return function(){return this.isValid()?this._data[t]:NaN}}function weeks(){return absFloor(this.days()/7)}function substituteTimeAgo(t,c,u,d,m){return m.relativeTime(c||1,!!u,t,d)}function relativeTime$1(t,c,u,d){var m=createDuration(t).abs(),g=round(m.as(`s`)),b=round(m.as(`m`)),S=round(m.as(`h`)),C=round(m.as(`d`)),w=round(m.as(`M`)),T=round(m.as(`w`)),E=round(m.as(`y`)),D=g<=u.ss&&[`s`,g]||g<u.s&&[`ss`,g]||b<=1&&[`m`]||b<u.m&&[`mm`,b]||S<=1&&[`h`]||S<u.h&&[`hh`,S]||C<=1&&[`d`]||C<u.d&&[`dd`,C];return u.w!=null&&(D=D||T<=1&&[`w`]||T<u.w&&[`ww`,T]),D=D||w<=1&&[`M`]||w<u.M&&[`MM`,w]||E<=1&&[`y`]||[`yy`,E],D[2]=c,D[3]=+t>0,D[4]=d,substituteTimeAgo.apply(null,D)}function getSetRelativeTimeRounding(t){return t===void 0?round:typeof t==`function`?(round=t,!0):!1}function getSetRelativeTimeThreshold(t,c){return thresholds[t]===void 0?!1:c===void 0?thresholds[t]:(thresholds[t]=c,t===`s`&&(thresholds.ss=c-1),!0)}function humanize(t,c){if(!this.isValid())return this.localeData().invalidDate();var u=!1,d=thresholds,m,g;return typeof t==`object`&&(c=t,t=!1),typeof t==`boolean`&&(u=t),typeof c==`object`&&(d=Object.assign({},thresholds,c),c.s!=null&&c.ss==null&&(d.ss=c.s-1)),m=this.localeData(),g=relativeTime$1(this,!u,d,m),u&&(g=m.pastFuture(+this,g)),m.postformat(g)}function sign(t){return(t>0)-(t<0)||+t}function toISOString$1(){if(!this.isValid())return this.localeData().invalidDate();var t=abs$1(this._milliseconds)/1e3,c=abs$1(this._days),u=abs$1(this._months),d,m,g,b,S=this.asSeconds(),C,w,T,E;return S?(d=absFloor(t/60),m=absFloor(d/60),t%=60,d%=60,g=absFloor(u/12),u%=12,b=t?t.toFixed(3).replace(/\.?0+$/,``):``,C=S<0?`-`:``,w=sign(this._months)===sign(S)?``:`-`,T=sign(this._days)===sign(S)?``:`-`,E=sign(this._milliseconds)===sign(S)?``:`-`,C+`P`+(g?w+g+`Y`:``)+(u?w+u+`M`:``)+(c?T+c+`D`:``)+(m||d||t?`T`:``)+(m?E+m+`H`:``)+(d?E+d+`M`:``)+(t?E+b+`S`:``)):`P0D`}var hookCallback,some,momentProperties,updateInProgress,deprecations,keys$1,defaultCalendar,formattingTokens,localFormattingTokens,formatFunctions,formatTokenFunctions,defaultLongDateFormat,defaultInvalidDate,defaultOrdinal,defaultDayOfMonthOrdinalParse,defaultRelativeTime,aliases,priorities,match1,match2,match3,match4,match6,match1to2,match3to4,match5to6,match1to3,match1to4,match1to6,matchUnsigned,matchSigned,matchOffset,matchShortOffset,matchTimestamp,matchWord,match1to2NoLeadingZero,match1to2HasZero,regexes,tokens,YEAR,MONTH,DATE,HOUR,MINUTE,SECOND,MILLISECOND,WEEK,WEEKDAY,getSetYear,indexOf,defaultLocaleMonths,defaultLocaleMonthsShort,MONTHS_IN_FORMAT,defaultMonthsShortRegex,defaultMonthsRegex,defaultLocaleWeek,defaultLocaleWeekdays,defaultLocaleWeekdaysShort,defaultLocaleWeekdaysMin,defaultWeekdaysRegex,defaultWeekdaysShortRegex,defaultWeekdaysMinRegex,defaultLocaleMeridiemParse,getSetHour,baseConfig,locales,localeFamilies,globalLocale,extendedIsoRegex,basicIsoRegex,tzRegex,isoDates,isoTimes,aspNetJsonRegex,rfc2822,obsOffsets,prototypeMin,prototypeMax,now,ordering,chunkOffset,aspNetRegex,isoRegex,add,subtract,lang,MS_PER_SECOND,MS_PER_MINUTE,MS_PER_HOUR,MS_PER_400_YEARS,getSetDayOfMonth,getSetMinute,getSetSecond,token,getSetMillisecond,proto,proto$1,mathAbs,asMilliseconds,asSeconds,asMinutes,asHours,asDays,asWeeks,asMonths,asQuarters,asYears,valueOf$1,milliseconds,seconds,minutes,hours,days,months,years,round,thresholds,abs$1,proto$2,init_moment=__esmMin((()=>{for(__name$2(isArray$2,`isArray`),__name$2(extend$1,`extend`),some=Array.prototype.some?Array.prototype.some:function(t){var c=Object(this),u=c.length>>>0,d;for(d=0;d<u;d++)if(d in c&&t.call(this,c[d],d,c))return!0;return!1},momentProperties=hooks.momentProperties=[],updateInProgress=!1,deprecations={},hooks.suppressDeprecationWarnings=!1,hooks.deprecationHandler=null,__name$2(set$1,`set`),keys$1=Object.keys?Object.keys:__name$2(function(t){var c,u=[];for(c in t)hasOwnProp(t,c)&&u.push(c);return u},`keys`),defaultCalendar={sameDay:`[Today at] LT`,nextDay:`[Tomorrow at] LT`,nextWeek:`dddd [at] LT`,lastDay:`[Yesterday at] LT`,lastWeek:`[Last] dddd [at] LT`,sameElse:`L`},formattingTokens=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,localFormattingTokens=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,formatFunctions={},formatTokenFunctions={},defaultLongDateFormat={LTS:`h:mm:ss A`,LT:`h:mm A`,L:`MM/DD/YYYY`,LL:`MMMM D, YYYY`,LLL:`MMMM D, YYYY h:mm A`,LLLL:`dddd, MMMM D, YYYY h:mm A`},defaultInvalidDate=`Invalid date`,defaultOrdinal=`%d`,defaultDayOfMonthOrdinalParse=/\d{1,2}/,defaultRelativeTime={future:`in %s`,past:`%s ago`,s:`a few seconds`,ss:`%d seconds`,m:`a minute`,mm:`%d minutes`,h:`an hour`,hh:`%d hours`,d:`a day`,dd:`%d days`,w:`a week`,ww:`%d weeks`,M:`a month`,MM:`%d months`,y:`a year`,yy:`%d years`},aliases={D:`date`,dates:`date`,date:`date`,d:`day`,days:`day`,day:`day`,e:`weekday`,weekdays:`weekday`,weekday:`weekday`,E:`isoWeekday`,isoweekdays:`isoWeekday`,isoweekday:`isoWeekday`,DDD:`dayOfYear`,dayofyears:`dayOfYear`,dayofyear:`dayOfYear`,h:`hour`,hours:`hour`,hour:`hour`,ms:`millisecond`,milliseconds:`millisecond`,millisecond:`millisecond`,m:`minute`,minutes:`minute`,minute:`minute`,M:`month`,months:`month`,month:`month`,Q:`quarter`,quarters:`quarter`,quarter:`quarter`,s:`second`,seconds:`second`,second:`second`,gg:`weekYear`,weekyears:`weekYear`,weekyear:`weekYear`,GG:`isoWeekYear`,isoweekyears:`isoWeekYear`,isoweekyear:`isoWeekYear`,w:`week`,weeks:`week`,week:`week`,W:`isoWeek`,isoweeks:`isoWeek`,isoweek:`isoWeek`,y:`year`,years:`year`,year:`year`},priorities={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1},match1=/\d/,match2=/\d\d/,match3=/\d{3}/,match4=/\d{4}/,match6=/[+-]?\d{6}/,match1to2=/\d\d?/,match3to4=/\d\d\d\d?/,match5to6=/\d\d\d\d\d\d?/,match1to3=/\d{1,3}/,match1to4=/\d{1,4}/,match1to6=/[+-]?\d{1,6}/,matchUnsigned=/\d+/,matchSigned=/[+-]?\d+/,matchOffset=/Z|[+-]\d\d:?\d\d/gi,matchShortOffset=/Z|[+-]\d\d(?::?\d\d)?/gi,matchTimestamp=/[+-]?\d+(\.\d{1,3})?/,matchWord=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,match1to2NoLeadingZero=/^[1-9]\d?/,match1to2HasZero=/^([1-9]\d|\d)/,regexes={},tokens={},YEAR=0,MONTH=1,DATE=2,HOUR=3,MINUTE=4,SECOND=5,MILLISECOND=6,WEEK=7,WEEKDAY=8,addFormatToken(`Y`,0,0,function(){var t=this.year();return t<=9999?zeroFill(t,4):`+`+t}),addFormatToken(0,[`YY`,2],0,function(){return this.year()%100}),addFormatToken(0,[`YYYY`,4],0,`year`),addFormatToken(0,[`YYYYY`,5],0,`year`),addFormatToken(0,[`YYYYYY`,6,!0],0,`year`),addRegexToken(`Y`,matchSigned),addRegexToken(`YY`,match1to2,match2),addRegexToken(`YYYY`,match1to4,match4),addRegexToken(`YYYYY`,match1to6,match6),addRegexToken(`YYYYYY`,match1to6,match6),addParseToken([`YYYYY`,`YYYYYY`],YEAR),addParseToken(`YYYY`,function(t,c){c[YEAR]=t.length===2?hooks.parseTwoDigitYear(t):toInt(t)}),addParseToken(`YY`,function(t,c){c[YEAR]=hooks.parseTwoDigitYear(t)}),addParseToken(`Y`,function(t,c){c[YEAR]=parseInt(t,10)}),hooks.parseTwoDigitYear=function(t){return toInt(t)+(toInt(t)>68?1900:2e3)},getSetYear=makeGetSet(`FullYear`,!0),__name$2(set$1$1,`set$1`),__name$2(mod$1,`mod`),indexOf=Array.prototype.indexOf?Array.prototype.indexOf:function(t){var c;for(c=0;c<this.length;++c)if(this[c]===t)return c;return-1},addFormatToken(`M`,[`MM`,2],`Mo`,function(){return this.month()+1}),addFormatToken(`MMM`,0,0,function(t){return this.localeData().monthsShort(this,t)}),addFormatToken(`MMMM`,0,0,function(t){return this.localeData().months(this,t)}),addRegexToken(`M`,match1to2,match1to2NoLeadingZero),addRegexToken(`MM`,match1to2,match2),addRegexToken(`MMM`,function(t,c){return c.monthsShortRegex(t)}),addRegexToken(`MMMM`,function(t,c){return c.monthsRegex(t)}),addParseToken([`M`,`MM`],function(t,c){c[MONTH]=toInt(t)-1}),addParseToken([`MMM`,`MMMM`],function(t,c,u,d){var m=u._locale.monthsParse(t,d,u._strict);m==null?getParsingFlags(u).invalidMonth=t:c[MONTH]=m}),defaultLocaleMonths=`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),defaultLocaleMonthsShort=`Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec`.split(`_`),MONTHS_IN_FORMAT=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,defaultMonthsShortRegex=matchWord,defaultMonthsRegex=matchWord,addFormatToken(`w`,[`ww`,2],`wo`,`week`),addFormatToken(`W`,[`WW`,2],`Wo`,`isoWeek`),addRegexToken(`w`,match1to2,match1to2NoLeadingZero),addRegexToken(`ww`,match1to2,match2),addRegexToken(`W`,match1to2,match1to2NoLeadingZero),addRegexToken(`WW`,match1to2,match2),addWeekParseToken([`w`,`ww`,`W`,`WW`],function(t,c,u,d){c[d.substr(0,1)]=toInt(t)}),defaultLocaleWeek={dow:0,doy:6},addFormatToken(`d`,0,`do`,`day`),addFormatToken(`dd`,0,0,function(t){return this.localeData().weekdaysMin(this,t)}),addFormatToken(`ddd`,0,0,function(t){return this.localeData().weekdaysShort(this,t)}),addFormatToken(`dddd`,0,0,function(t){return this.localeData().weekdays(this,t)}),addFormatToken(`e`,0,0,`weekday`),addFormatToken(`E`,0,0,`isoWeekday`),addRegexToken(`d`,match1to2),addRegexToken(`e`,match1to2),addRegexToken(`E`,match1to2),addRegexToken(`dd`,function(t,c){return c.weekdaysMinRegex(t)}),addRegexToken(`ddd`,function(t,c){return c.weekdaysShortRegex(t)}),addRegexToken(`dddd`,function(t,c){return c.weekdaysRegex(t)}),addWeekParseToken([`dd`,`ddd`,`dddd`],function(t,c,u,d){var m=u._locale.weekdaysParse(t,d,u._strict);m==null?getParsingFlags(u).invalidWeekday=t:c.d=m}),addWeekParseToken([`d`,`e`,`E`],function(t,c,u,d){c[d]=toInt(t)}),defaultLocaleWeekdays=`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),defaultLocaleWeekdaysShort=`Sun_Mon_Tue_Wed_Thu_Fri_Sat`.split(`_`),defaultLocaleWeekdaysMin=`Su_Mo_Tu_We_Th_Fr_Sa`.split(`_`),defaultWeekdaysRegex=matchWord,defaultWeekdaysShortRegex=matchWord,defaultWeekdaysMinRegex=matchWord,addFormatToken(`H`,[`HH`,2],0,`hour`),addFormatToken(`h`,[`hh`,2],0,hFormat),addFormatToken(`k`,[`kk`,2],0,kFormat),addFormatToken(`hmm`,0,0,function(){return``+hFormat.apply(this)+zeroFill(this.minutes(),2)}),addFormatToken(`hmmss`,0,0,function(){return``+hFormat.apply(this)+zeroFill(this.minutes(),2)+zeroFill(this.seconds(),2)}),addFormatToken(`Hmm`,0,0,function(){return``+this.hours()+zeroFill(this.minutes(),2)}),addFormatToken(`Hmmss`,0,0,function(){return``+this.hours()+zeroFill(this.minutes(),2)+zeroFill(this.seconds(),2)}),meridiem(`a`,!0),meridiem(`A`,!1),addRegexToken(`a`,matchMeridiem),addRegexToken(`A`,matchMeridiem),addRegexToken(`H`,match1to2,match1to2HasZero),addRegexToken(`h`,match1to2,match1to2NoLeadingZero),addRegexToken(`k`,match1to2,match1to2NoLeadingZero),addRegexToken(`HH`,match1to2,match2),addRegexToken(`hh`,match1to2,match2),addRegexToken(`kk`,match1to2,match2),addRegexToken(`hmm`,match3to4),addRegexToken(`hmmss`,match5to6),addRegexToken(`Hmm`,match3to4),addRegexToken(`Hmmss`,match5to6),addParseToken([`H`,`HH`],HOUR),addParseToken([`k`,`kk`],function(t,c,u){var d=toInt(t);c[HOUR]=d===24?0:d}),addParseToken([`a`,`A`],function(t,c,u){u._isPm=u._locale.isPM(t),u._meridiem=t}),addParseToken([`h`,`hh`],function(t,c,u){c[HOUR]=toInt(t),getParsingFlags(u).bigHour=!0}),addParseToken(`hmm`,function(t,c,u){var d=t.length-2;c[HOUR]=toInt(t.substr(0,d)),c[MINUTE]=toInt(t.substr(d)),getParsingFlags(u).bigHour=!0}),addParseToken(`hmmss`,function(t,c,u){var d=t.length-4,m=t.length-2;c[HOUR]=toInt(t.substr(0,d)),c[MINUTE]=toInt(t.substr(d,2)),c[SECOND]=toInt(t.substr(m)),getParsingFlags(u).bigHour=!0}),addParseToken(`Hmm`,function(t,c,u){var d=t.length-2;c[HOUR]=toInt(t.substr(0,d)),c[MINUTE]=toInt(t.substr(d))}),addParseToken(`Hmmss`,function(t,c,u){var d=t.length-4,m=t.length-2;c[HOUR]=toInt(t.substr(0,d)),c[MINUTE]=toInt(t.substr(d,2)),c[SECOND]=toInt(t.substr(m))}),defaultLocaleMeridiemParse=/[ap]\.?m?\.?/i,getSetHour=makeGetSet(`Hours`,!0),baseConfig={calendar:defaultCalendar,longDateFormat:defaultLongDateFormat,invalidDate:defaultInvalidDate,ordinal:defaultOrdinal,dayOfMonthOrdinalParse:defaultDayOfMonthOrdinalParse,relativeTime:defaultRelativeTime,months:defaultLocaleMonths,monthsShort:defaultLocaleMonthsShort,week:defaultLocaleWeek,weekdays:defaultLocaleWeekdays,weekdaysMin:defaultLocaleWeekdaysMin,weekdaysShort:defaultLocaleWeekdaysShort,meridiemParse:defaultLocaleMeridiemParse},locales={},localeFamilies={},extendedIsoRegex=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,basicIsoRegex=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,tzRegex=/Z|[+-]\d\d(?::?\d\d)?/,isoDates=[[`YYYYYY-MM-DD`,/[+-]\d{6}-\d\d-\d\d/],[`YYYY-MM-DD`,/\d{4}-\d\d-\d\d/],[`GGGG-[W]WW-E`,/\d{4}-W\d\d-\d/],[`GGGG-[W]WW`,/\d{4}-W\d\d/,!1],[`YYYY-DDD`,/\d{4}-\d{3}/],[`YYYY-MM`,/\d{4}-\d\d/,!1],[`YYYYYYMMDD`,/[+-]\d{10}/],[`YYYYMMDD`,/\d{8}/],[`GGGG[W]WWE`,/\d{4}W\d{3}/],[`GGGG[W]WW`,/\d{4}W\d{2}/,!1],[`YYYYDDD`,/\d{7}/],[`YYYYMM`,/\d{6}/,!1],[`YYYY`,/\d{4}/,!1]],isoTimes=[[`HH:mm:ss.SSSS`,/\d\d:\d\d:\d\d\.\d+/],[`HH:mm:ss,SSSS`,/\d\d:\d\d:\d\d,\d+/],[`HH:mm:ss`,/\d\d:\d\d:\d\d/],[`HH:mm`,/\d\d:\d\d/],[`HHmmss.SSSS`,/\d\d\d\d\d\d\.\d+/],[`HHmmss,SSSS`,/\d\d\d\d\d\d,\d+/],[`HHmmss`,/\d\d\d\d\d\d/],[`HHmm`,/\d\d\d\d/],[`HH`,/\d\d/]],aspNetJsonRegex=/^\/?Date\((-?\d+)/i,rfc2822=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,obsOffsets={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480},hooks.createFromInputFallback=deprecate(`value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.`,function(t){t._d=new Date(t._i+(t._useUTC?` UTC`:``))}),__name$2(defaults$1,`defaults`),hooks.ISO_8601=function(){},hooks.RFC_2822=function(){},prototypeMin=deprecate(`moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/`,function(){var t=createLocal.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:createInvalid()}),prototypeMax=deprecate(`moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/`,function(){var t=createLocal.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:createInvalid()}),__name$2(max$1,`max`),now=function(){return Date.now?Date.now():+new Date},ordering=[`year`,`quarter`,`month`,`week`,`day`,`hour`,`minute`,`second`,`millisecond`],offset(`Z`,`:`),offset(`ZZ`,``),addRegexToken(`Z`,matchShortOffset),addRegexToken(`ZZ`,matchShortOffset),addParseToken([`Z`,`ZZ`],function(t,c,u){u._useUTC=!0,u._tzm=offsetFromString(matchShortOffset,t)}),chunkOffset=/([\+\-]|\d\d)/gi,hooks.updateOffset=function(){},aspNetRegex=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,isoRegex=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,createDuration.fn=Duration.prototype,createDuration.invalid=createInvalid$1,add=createAdder(1,`add`),subtract=createAdder(-1,`subtract`),__name$2(clone$3,`clone`),hooks.defaultFormat=`YYYY-MM-DDTHH:mm:ssZ`,hooks.defaultFormatUtc=`YYYY-MM-DDTHH:mm:ss[Z]`,lang=deprecate(`moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.`,function(t){return t===void 0?this.localeData():this.locale(t)}),MS_PER_SECOND=1e3,MS_PER_MINUTE=60*MS_PER_SECOND,MS_PER_HOUR=60*MS_PER_MINUTE,MS_PER_400_YEARS=146097*24*MS_PER_HOUR,__name$2(mod$1$1,`mod$1`),__name$2(toObject$1,`toObject`),__name$2(toJSON$1,`toJSON`),addFormatToken(`N`,0,0,`eraAbbr`),addFormatToken(`NN`,0,0,`eraAbbr`),addFormatToken(`NNN`,0,0,`eraAbbr`),addFormatToken(`NNNN`,0,0,`eraName`),addFormatToken(`NNNNN`,0,0,`eraNarrow`),addFormatToken(`y`,[`y`,1],`yo`,`eraYear`),addFormatToken(`y`,[`yy`,2],0,`eraYear`),addFormatToken(`y`,[`yyy`,3],0,`eraYear`),addFormatToken(`y`,[`yyyy`,4],0,`eraYear`),addRegexToken(`N`,matchEraAbbr),addRegexToken(`NN`,matchEraAbbr),addRegexToken(`NNN`,matchEraAbbr),addRegexToken(`NNNN`,matchEraName),addRegexToken(`NNNNN`,matchEraNarrow),addParseToken([`N`,`NN`,`NNN`,`NNNN`,`NNNNN`],function(t,c,u,d){var m=u._locale.erasParse(t,d,u._strict);m?getParsingFlags(u).era=m:getParsingFlags(u).invalidEra=t}),addRegexToken(`y`,matchUnsigned),addRegexToken(`yy`,matchUnsigned),addRegexToken(`yyy`,matchUnsigned),addRegexToken(`yyyy`,matchUnsigned),addRegexToken(`yo`,matchEraYearOrdinal),addParseToken([`y`,`yy`,`yyy`,`yyyy`],YEAR),addParseToken([`yo`],function(t,c,u,d){var m;u._locale._eraYearOrdinalRegex&&(m=t.match(u._locale._eraYearOrdinalRegex)),u._locale.eraYearOrdinalParse?c[YEAR]=u._locale.eraYearOrdinalParse(t,m):c[YEAR]=parseInt(t,10)}),addFormatToken(0,[`gg`,2],0,function(){return this.weekYear()%100}),addFormatToken(0,[`GG`,2],0,function(){return this.isoWeekYear()%100}),addWeekYearFormatToken(`gggg`,`weekYear`),addWeekYearFormatToken(`ggggg`,`weekYear`),addWeekYearFormatToken(`GGGG`,`isoWeekYear`),addWeekYearFormatToken(`GGGGG`,`isoWeekYear`),addRegexToken(`G`,matchSigned),addRegexToken(`g`,matchSigned),addRegexToken(`GG`,match1to2,match2),addRegexToken(`gg`,match1to2,match2),addRegexToken(`GGGG`,match1to4,match4),addRegexToken(`gggg`,match1to4,match4),addRegexToken(`GGGGG`,match1to6,match6),addRegexToken(`ggggg`,match1to6,match6),addWeekParseToken([`gggg`,`ggggg`,`GGGG`,`GGGGG`],function(t,c,u,d){c[d.substr(0,2)]=toInt(t)}),addWeekParseToken([`gg`,`GG`],function(t,c,u,d){c[d]=hooks.parseTwoDigitYear(t)}),addFormatToken(`Q`,0,`Qo`,`quarter`),addRegexToken(`Q`,match1),addParseToken(`Q`,function(t,c){c[MONTH]=(toInt(t)-1)*3}),addFormatToken(`D`,[`DD`,2],`Do`,`date`),addRegexToken(`D`,match1to2,match1to2NoLeadingZero),addRegexToken(`DD`,match1to2,match2),addRegexToken(`Do`,function(t,c){return t?c._dayOfMonthOrdinalParse||c._ordinalParse:c._dayOfMonthOrdinalParseLenient}),addParseToken([`D`,`DD`],DATE),addParseToken(`Do`,function(t,c){c[DATE]=toInt(t.match(match1to2)[0])}),getSetDayOfMonth=makeGetSet(`Date`,!0),addFormatToken(`DDD`,[`DDDD`,3],`DDDo`,`dayOfYear`),addRegexToken(`DDD`,match1to3),addRegexToken(`DDDD`,match3),addParseToken([`DDD`,`DDDD`],function(t,c,u){u._dayOfYear=toInt(t)}),addFormatToken(`m`,[`mm`,2],0,`minute`),addRegexToken(`m`,match1to2,match1to2HasZero),addRegexToken(`mm`,match1to2,match2),addParseToken([`m`,`mm`],MINUTE),getSetMinute=makeGetSet(`Minutes`,!1),addFormatToken(`s`,[`ss`,2],0,`second`),addRegexToken(`s`,match1to2,match1to2HasZero),addRegexToken(`ss`,match1to2,match2),addParseToken([`s`,`ss`],SECOND),getSetSecond=makeGetSet(`Seconds`,!1),addFormatToken(`S`,0,0,function(){return~~(this.millisecond()/100)}),addFormatToken(0,[`SS`,2],0,function(){return~~(this.millisecond()/10)}),addFormatToken(0,[`SSS`,3],0,`millisecond`),addFormatToken(0,[`SSSS`,4],0,function(){return this.millisecond()*10}),addFormatToken(0,[`SSSSS`,5],0,function(){return this.millisecond()*100}),addFormatToken(0,[`SSSSSS`,6],0,function(){return this.millisecond()*1e3}),addFormatToken(0,[`SSSSSSS`,7],0,function(){return this.millisecond()*1e4}),addFormatToken(0,[`SSSSSSSS`,8],0,function(){return this.millisecond()*1e5}),addFormatToken(0,[`SSSSSSSSS`,9],0,function(){return this.millisecond()*1e6}),addRegexToken(`S`,match1to3,match1),addRegexToken(`SS`,match1to3,match2),addRegexToken(`SSS`,match1to3,match3),token=`SSSS`;token.length<=9;token+=`S`)addRegexToken(token,matchUnsigned);for(token=`S`;token.length<=9;token+=`S`)addParseToken(token,parseMs);getSetMillisecond=makeGetSet(`Milliseconds`,!1),addFormatToken(`z`,0,0,`zoneAbbr`),addFormatToken(`zz`,0,0,`zoneName`),proto=Moment.prototype,proto.add=add,proto.calendar=calendar$1,proto.clone=clone$3,proto.diff=diff,proto.endOf=endOf,proto.format=format,proto.from=from,proto.fromNow=fromNow,proto.to=to,proto.toNow=toNow,proto.get=stringGet,proto.invalidAt=invalidAt,proto.isAfter=isAfter,proto.isBefore=isBefore,proto.isBetween=isBetween,proto.isSame=isSame,proto.isSameOrAfter=isSameOrAfter,proto.isSameOrBefore=isSameOrBefore,proto.isValid=isValid$2,proto.lang=lang,proto.locale=locale,proto.localeData=localeData,proto.max=prototypeMax,proto.min=prototypeMin,proto.parsingFlags=parsingFlags,proto.set=stringSet,proto.startOf=startOf,proto.subtract=subtract,proto.toArray=toArray,proto.toObject=toObject$1,proto.toDate=toDate,proto.toISOString=toISOString,proto.inspect=inspect,typeof Symbol<`u`&&Symbol.for!=null&&(proto[Symbol.for(`nodejs.util.inspect.custom`)]=function(){return`Moment<`+this.format()+`>`}),proto.toJSON=toJSON$1,proto.toString=toString,proto.unix=unix,proto.valueOf=valueOf,proto.creationData=creationData,proto.eraName=getEraName,proto.eraNarrow=getEraNarrow,proto.eraAbbr=getEraAbbr,proto.eraYear=getEraYear,proto.year=getSetYear,proto.isLeapYear=getIsLeapYear,proto.weekYear=getSetWeekYear,proto.isoWeekYear=getSetISOWeekYear,proto.quarter=proto.quarters=getSetQuarter,proto.month=getSetMonth,proto.daysInMonth=getDaysInMonth,proto.week=proto.weeks=getSetWeek,proto.isoWeek=proto.isoWeeks=getSetISOWeek,proto.weeksInYear=getWeeksInYear,proto.weeksInWeekYear=getWeeksInWeekYear,proto.isoWeeksInYear=getISOWeeksInYear,proto.isoWeeksInISOWeekYear=getISOWeeksInISOWeekYear,proto.date=getSetDayOfMonth,proto.day=proto.days=getSetDayOfWeek,proto.weekday=getSetLocaleDayOfWeek,proto.isoWeekday=getSetISODayOfWeek,proto.dayOfYear=getSetDayOfYear,proto.hour=proto.hours=getSetHour,proto.minute=proto.minutes=getSetMinute,proto.second=proto.seconds=getSetSecond,proto.millisecond=proto.milliseconds=getSetMillisecond,proto.utcOffset=getSetOffset,proto.utc=setOffsetToUTC,proto.local=setOffsetToLocal,proto.parseZone=setOffsetToParsedOffset,proto.hasAlignedHourOffset=hasAlignedHourOffset,proto.isDST=isDaylightSavingTime,proto.isLocal=isLocal,proto.isUtcOffset=isUtcOffset,proto.isUtc=isUtc,proto.isUTC=isUtc,proto.zoneAbbr=getZoneAbbr,proto.zoneName=getZoneName,proto.dates=deprecate(`dates accessor is deprecated. Use date instead.`,getSetDayOfMonth),proto.months=deprecate(`months accessor is deprecated. Use month instead`,getSetMonth),proto.years=deprecate(`years accessor is deprecated. Use year instead`,getSetYear),proto.zone=deprecate(`moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/`,getSetZone),proto.isDSTShifted=deprecate(`isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information`,isDaylightSavingTimeShifted),proto$1=Locale.prototype,proto$1.calendar=calendar,proto$1.longDateFormat=longDateFormat,proto$1.invalidDate=invalidDate,proto$1.ordinal=ordinal,proto$1.preparse=preParsePostFormat,proto$1.postformat=preParsePostFormat,proto$1.relativeTime=relativeTime,proto$1.pastFuture=pastFuture,proto$1.set=set$1,proto$1.eras=localeEras,proto$1.erasParse=localeErasParse,proto$1.erasConvertYear=localeErasConvertYear,proto$1.erasAbbrRegex=erasAbbrRegex,proto$1.erasNameRegex=erasNameRegex,proto$1.erasNarrowRegex=erasNarrowRegex,proto$1.months=localeMonths,proto$1.monthsShort=localeMonthsShort,proto$1.monthsParse=localeMonthsParse,proto$1.monthsRegex=monthsRegex,proto$1.monthsShortRegex=monthsShortRegex,proto$1.week=localeWeek,proto$1.firstDayOfYear=localeFirstDayOfYear,proto$1.firstDayOfWeek=localeFirstDayOfWeek,proto$1.weekdays=localeWeekdays,proto$1.weekdaysMin=localeWeekdaysMin,proto$1.weekdaysShort=localeWeekdaysShort,proto$1.weekdaysParse=localeWeekdaysParse,proto$1.weekdaysRegex=weekdaysRegex,proto$1.weekdaysShortRegex=weekdaysShortRegex,proto$1.weekdaysMinRegex=weekdaysMinRegex,proto$1.isPM=localeIsPM,proto$1.meridiem=localeMeridiem,__name$2(get$1$1,`get$1`),getSetGlobalLocale(`en`,{eras:[{since:`0001-01-01`,until:1/0,offset:1,name:`Anno Domini`,narrow:`AD`,abbr:`AD`},{since:`0000-12-31`,until:-1/0,offset:1,name:`Before Christ`,narrow:`BC`,abbr:`BC`}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var c=t%10;return t+(toInt(t%100/10)===1?`th`:c===1?`st`:c===2?`nd`:c===3?`rd`:`th`)}}),hooks.lang=deprecate(`moment.lang is deprecated. Use moment.locale instead.`,getSetGlobalLocale),hooks.langData=deprecate(`moment.langData is deprecated. Use moment.localeData instead.`,getLocale),mathAbs=Math.abs,__name$2(add$1$1,`add$1`),asMilliseconds=makeAs(`ms`),asSeconds=makeAs(`s`),asMinutes=makeAs(`m`),asHours=makeAs(`h`),asDays=makeAs(`d`),asWeeks=makeAs(`w`),asMonths=makeAs(`M`),asQuarters=makeAs(`Q`),asYears=makeAs(`y`),valueOf$1=asMilliseconds,__name$2(clone$1$1,`clone$1`),__name$2(get$2$1,`get$2`),milliseconds=makeGetter(`milliseconds`),seconds=makeGetter(`seconds`),minutes=makeGetter(`minutes`),hours=makeGetter(`hours`),days=makeGetter(`days`),months=makeGetter(`months`),years=makeGetter(`years`),round=Math.round,thresholds={ss:44,s:45,m:45,h:22,d:26,w:null,M:11},abs$1=Math.abs,proto$2=Duration.prototype,proto$2.isValid=isValid$1,proto$2.abs=abs,proto$2.add=add$1$1,proto$2.subtract=subtract$1,proto$2.as=as,proto$2.asMilliseconds=asMilliseconds,proto$2.asSeconds=asSeconds,proto$2.asMinutes=asMinutes,proto$2.asHours=asHours,proto$2.asDays=asDays,proto$2.asWeeks=asWeeks,proto$2.asMonths=asMonths,proto$2.asQuarters=asQuarters,proto$2.asYears=asYears,proto$2.valueOf=valueOf$1,proto$2._bubble=bubble,proto$2.clone=clone$1$1,proto$2.get=get$2$1,proto$2.milliseconds=milliseconds,proto$2.seconds=seconds,proto$2.minutes=minutes,proto$2.hours=hours,proto$2.days=days,proto$2.weeks=weeks,proto$2.months=months,proto$2.years=years,proto$2.humanize=humanize,proto$2.toISOString=toISOString$1,proto$2.toString=toISOString$1,proto$2.toJSON=toISOString$1,proto$2.locale=locale,proto$2.localeData=localeData,proto$2.toIsoString=deprecate(`toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)`,toISOString$1),proto$2.lang=lang,addFormatToken(`X`,0,0,`unix`),addFormatToken(`x`,0,0,`valueOf`),addRegexToken(`x`,matchSigned),addRegexToken(`X`,matchTimestamp),addParseToken(`X`,function(t,c,u){u._d=new Date(parseFloat(t)*1e3)}),addParseToken(`x`,function(t,c,u){u._d=new Date(toInt(t))}),hooks.version=`2.30.1`,setHookCallback(createLocal),hooks.fn=proto,hooks.min=min,hooks.max=max$1,hooks.now=now,hooks.utc=createUTC,hooks.unix=createUnix,hooks.months=listMonths,hooks.isDate=isDate,hooks.locale=getSetGlobalLocale,hooks.invalid=createInvalid,hooks.duration=createDuration,hooks.isMoment=isMoment,hooks.weekdays=listWeekdays,hooks.parseZone=createInZone,hooks.localeData=getLocale,hooks.isDuration=isDuration,hooks.monthsShort=listMonthsShort,hooks.weekdaysMin=listWeekdaysMin,hooks.defineLocale=defineLocale,hooks.updateLocale=updateLocale,hooks.locales=listLocales,hooks.weekdaysShort=listWeekdaysShort,hooks.normalizeUnits=normalizeUnits,hooks.relativeTimeRounding=getSetRelativeTimeRounding,hooks.relativeTimeThreshold=getSetRelativeTimeThreshold,hooks.calendarFormat=getCalendarFormat,hooks.prototype=proto,hooks.HTML5_FMT={DATETIME_LOCAL:`YYYY-MM-DDTHH:mm`,DATETIME_LOCAL_SECONDS:`YYYY-MM-DDTHH:mm:ss`,DATETIME_LOCAL_MS:`YYYY-MM-DDTHH:mm:ss.SSS`,DATE:`YYYY-MM-DD`,TIME:`HH:mm`,TIME_SECONDS:`HH:mm:ss`,TIME_MS:`HH:mm:ss.SSS`,WEEK:`GGGG-[W]WW`,MONTH:`YYYY-MM`}}));function set(t,c,u){return Array.isArray(t)?(t.length=Math.max(t.length,c),t.splice(c,1,u),u):(t[c]=u,u)}function del(t,c){if(Array.isArray(t)){t.splice(c,1);return}delete t[c]}var init_lib=__esmMin((()=>{init_vue_runtime_esm_bundler(),init_vue_runtime_esm_bundler()}));function isPlainObject$2(t){return t&&typeof t==`object`&&Object.prototype.toString.call(t)===`[object Object]`&&typeof t.toJSON!=`function`}function bom(t,{autoBom:c=!1}={}){return c&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob([``,t],{type:t.type}):t}function download(t,c,u){let d=new XMLHttpRequest;d.open(`GET`,t),d.responseType=`blob`,d.onload=function(){saveAs(d.response,c,u)},d.onerror=function(){console.error(`could not download file`)},d.send()}function corsEnabled(t){let c=new XMLHttpRequest;c.open(`HEAD`,t,!1);try{c.send()}catch{}return c.status>=200&&c.status<=299}function click(t){try{t.dispatchEvent(new MouseEvent(`click`))}catch{let c=document.createEvent(`MouseEvents`);c.initMouseEvent(`click`,!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(c)}}function downloadSaveAs(t,c=`download`,u){let d=document.createElement(`a`);d.download=c,d.rel=`noopener`,typeof t==`string`?(d.href=t,d.origin===location.origin?click(d):corsEnabled(d.href)?download(t,c,u):(d.target=`_blank`,click(d))):(d.href=URL.createObjectURL(t),setTimeout(function(){URL.revokeObjectURL(d.href)},4e4),setTimeout(function(){click(d)},0))}function msSaveAs(t,c=`download`,u){if(typeof t==`string`)if(corsEnabled(t))download(t,c,u);else{let c=document.createElement(`a`);c.href=t,c.target=`_blank`,setTimeout(function(){click(c)})}else navigator.msSaveOrOpenBlob(bom(t,u),c)}function fileSaverSaveAs(t,c,u,d){if(d=d||open(``,`_blank`),d&&(d.document.title=d.document.body.innerText=`downloading...`),typeof t==`string`)return download(t,c,u);let m=t.type===`application/octet-stream`,g=/constructor/i.test(String(_global.HTMLElement))||`safari`in _global,b=/CriOS\/[\d]+/.test(navigator.userAgent);if((b||m&&g||isMacOSWebView)&&typeof FileReader<`u`){let c=new FileReader;c.onloadend=function(){let t=c.result;if(typeof t!=`string`)throw d=null,Error(`Wrong reader.result type`);t=b?t:t.replace(/^data:[^;]*;/,`data:attachment/file;`),d?d.location.href=t:location.assign(t),d=null},c.readAsDataURL(t)}else{let c=URL.createObjectURL(t);d?d.location.assign(c):location.href=c,d=null,setTimeout(function(){URL.revokeObjectURL(c)},4e4)}}function patchObject(t,c){for(let u in c){let d=c[u];if(!(u in t))continue;let m=t[u];isPlainObject$2(m)&&isPlainObject$2(d)&&!isRef(d)&&!isReactive(d)?t[u]=patchObject(m,d):t[u]=d}return t}function addSubscription(t,c,u,d=noop){t.push(c);let removeSubscription=()=>{let u=t.indexOf(c);u>-1&&(t.splice(u,1),d())};return!u&&getCurrentScope()&&onScopeDispose(removeSubscription),removeSubscription}function triggerSubscriptions(t,...c){t.slice().forEach(t=>{t(...c)})}function mergeReactiveObjects(t,c){t instanceof Map&&c instanceof Map?c.forEach((c,u)=>t.set(u,c)):t instanceof Set&&c instanceof Set&&c.forEach(t.add,t);for(let u in c){if(!c.hasOwnProperty(u))continue;let d=c[u],m=t[u];isPlainObject$2(m)&&isPlainObject$2(d)&&t.hasOwnProperty(u)&&!isRef(d)&&!isReactive(d)?t[u]=mergeReactiveObjects(m,d):t[u]=d}return t}function shouldHydrate(t){return!isPlainObject$2(t)||!t.hasOwnProperty(skipHydrateSymbol)}function isComputed(t){return!!(isRef(t)&&t.effect)}function createOptionsStore(t,c,u,d){let{state:m,actions:g,getters:b}=c,S=u.state.value[t],C;function setup(){!S&&(process.env.NODE_ENV===`production`||!d)&&(u.state.value[t]=m?m():{});let c=process.env.NODE_ENV!==`production`&&d?toRefs(ref(m?m():{}).value):toRefs(u.state.value[t]);return assign(c,g,Object.keys(b||{}).reduce((d,m)=>(process.env.NODE_ENV!==`production`&&m in c&&console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${m}" in store "${t}".`),d[m]=markRaw(computed(()=>{setActivePinia(u);let c=u._s.get(t);return b[m].call(c,c)})),d),{}))}return C=createSetupStore(t,setup,c,u,d,!0),C}function createSetupStore(t,c,u={},d,m,g){let b,S=assign({actions:{}},u);if(process.env.NODE_ENV!==`production`&&!d._e.active)throw Error(`Pinia destroyed`);let C={deep:!0};process.env.NODE_ENV!==`production`&&(C.onTrigger=t=>{w?O=t:w==0&&!Pr._hotUpdating&&(Array.isArray(O)?O.push(t):console.error(`🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug.`))});let w,T,E=[],D=[],O,Or=d.state.value[t];!g&&!Or&&(process.env.NODE_ENV===`production`||!m)&&(d.state.value[t]={});let kr=ref({}),Ar;function $patch(c){let u;w=T=!1,process.env.NODE_ENV!==`production`&&(O=[]),typeof c==`function`?(c(d.state.value[t]),u={type:MutationType.patchFunction,storeId:t,events:O}):(mergeReactiveObjects(d.state.value[t],c),u={type:MutationType.patchObject,payload:c,storeId:t,events:O});let m=Ar=Symbol();nextTick$2().then(()=>{Ar===m&&(w=!0)}),T=!0,triggerSubscriptions(E,u,d.state.value[t])}let jr=g?function $reset(){let{state:t}=u,c=t?t():{};this.$patch(t=>{assign(t,c)})}:process.env.NODE_ENV===`production`?noop:()=>{throw Error(`🍍: Store "${t}" is built using the setup syntax and does not implement $reset().`)};function $dispose(){b.stop(),E=[],D=[],d._s.delete(t)}let action=(c,u=``)=>{if(ACTION_MARKER in c)return c[ACTION_NAME]=u,c;let wrappedAction=function(){setActivePinia(d);let u=Array.from(arguments),m=[],g=[];function after(t){m.push(t)}function onError(t){g.push(t)}triggerSubscriptions(D,{args:u,name:wrappedAction[ACTION_NAME],store:Pr,after,onError});let b;try{b=c.apply(this&&this.$id===t?this:Pr,u)}catch(t){throw triggerSubscriptions(g,t),t}return b instanceof Promise?b.then(t=>(triggerSubscriptions(m,t),t)).catch(t=>(triggerSubscriptions(g,t),Promise.reject(t))):(triggerSubscriptions(m,b),b)};return wrappedAction[ACTION_MARKER]=!0,wrappedAction[ACTION_NAME]=u,wrappedAction},Mr=markRaw({actions:{},getters:{},state:[],hotState:kr}),Nr={_p:d,$id:t,$onAction:addSubscription.bind(null,D),$patch,$reset:jr,$subscribe(c,u={}){let m=addSubscription(E,c,u.detached,()=>g()),g=b.run(()=>watch(()=>d.state.value[t],d=>{(u.flush===`sync`?T:w)&&c({storeId:t,type:MutationType.direct,events:O},d)},assign({},C,u)));return m},$dispose},Pr=reactive(process.env.NODE_ENV!==`production`||process.env.NODE_ENV!==`production`&&process.env.NODE_ENV!==`test`&&IS_CLIENT?assign({_hmrPayload:Mr,_customProperties:markRaw(new Set)},Nr):Nr);d._s.set(t,Pr);let Fr=(d._a&&d._a.runWithContext||fallbackRunWithContext)(()=>d._e.run(()=>(b=effectScope()).run(()=>c({action}))));for(let c in Fr){let b=Fr[c];isRef(b)&&!isComputed(b)||isReactive(b)?(process.env.NODE_ENV!==`production`&&m?set(kr.value,c,toRef(Fr,c)):g||(Or&&shouldHydrate(b)&&(isRef(b)?b.value=Or[c]:mergeReactiveObjects(b,Or[c])),d.state.value[t][c]=b),process.env.NODE_ENV!==`production`&&Mr.state.push(c)):typeof b==`function`?(Fr[c]=process.env.NODE_ENV!==`production`&&m?b:action(b,c),process.env.NODE_ENV!==`production`&&(Mr.actions[c]=b),S.actions[c]=b):process.env.NODE_ENV!==`production`&&isComputed(b)&&(Mr.getters[c]=g?u.getters[c]:b,IS_CLIENT&&(Fr._getters||(Fr._getters=markRaw([]))).push(c))}if(assign(Pr,Fr),assign(toRaw(Pr),Fr),Object.defineProperty(Pr,`$state`,{get:()=>process.env.NODE_ENV!==`production`&&m?kr.value:d.state.value[t],set:t=>{if(process.env.NODE_ENV!==`production`&&m)throw Error(`cannot set hotState`);$patch(c=>{assign(c,t)})}}),process.env.NODE_ENV!==`production`&&(Pr._hotUpdate=markRaw(c=>{Pr._hotUpdating=!0,c._hmrPayload.state.forEach(t=>{if(t in Pr.$state){let u=c.$state[t],d=Pr.$state[t];typeof u==`object`&&isPlainObject$2(u)&&isPlainObject$2(d)?patchObject(u,d):c.$state[t]=d}set(Pr,t,toRef(c.$state,t))}),Object.keys(Pr.$state).forEach(t=>{t in c.$state||del(Pr,t)}),w=!1,T=!1,d.state.value[t]=toRef(c._hmrPayload,`hotState`),T=!0,nextTick$2().then(()=>{w=!0});for(let t in c._hmrPayload.actions){let u=c[t];set(Pr,t,action(u,t))}for(let t in c._hmrPayload.getters){let u=c._hmrPayload.getters[t];set(Pr,t,g?computed(()=>(setActivePinia(d),u.call(Pr,Pr))):u)}Object.keys(Pr._hmrPayload.getters).forEach(t=>{t in c._hmrPayload.getters||del(Pr,t)}),Object.keys(Pr._hmrPayload.actions).forEach(t=>{t in c._hmrPayload.actions||del(Pr,t)}),Pr._hmrPayload=c._hmrPayload,Pr._getters=c._getters,Pr._hotUpdating=!1})),process.env.NODE_ENV!==`production`&&process.env.NODE_ENV!==`test`&&IS_CLIENT){let t={writable:!0,configurable:!0,enumerable:!1};[`_p`,`_hmrPayload`,`_getters`,`_customProperties`].forEach(c=>{Object.defineProperty(Pr,c,assign({value:Pr[c]},t))})}return d._p.forEach(t=>{if(process.env.NODE_ENV!==`production`&&process.env.NODE_ENV!==`test`&&IS_CLIENT){let c=b.run(()=>t({store:Pr,app:d._a,pinia:d,options:S}));Object.keys(c||{}).forEach(t=>Pr._customProperties.add(t)),assign(Pr,c)}else assign(Pr,b.run(()=>t({store:Pr,app:d._a,pinia:d,options:S})))}),process.env.NODE_ENV!==`production`&&Pr.$state&&typeof Pr.$state==`object`&&typeof Pr.$state.constructor==`function`&&!Pr.$state.constructor.toString().includes(`[native code]`)&&console.warn(`[🍍]: The "state" must be a plain object. It cannot be
@@ -318,10 +318,10 @@ tags: ${m.tags.join(`, `)}`),m.elo!==void 0&&(c+=`
318
318
  elo: ${m.elo}`),d.push({originalText:c,status:`error`,message:`Error processing card: ${t instanceof Error?t.message:`Unknown error`}`})}return d}async function processCard(t,c,u){let{markdown:d,tags:m,elo:g}=t,b=d;m.length>0&&(b+=`
319
319
  tags: ${m.join(`, `)}`),g!==void 0&&(b+=`
320
320
  elo: ${g}`);let S={Input:d,Uploads:[]},C={};for(let t of m)C[t]={score:g||0,count:1};try{let t=await c.addNote(u.courseCode,u.dataShape,S,u.userName,m,void 0,g?{global:{score:g,count:1},tags:C,misc:{}}:void 0);return t.status===Status.ok?{originalText:b,status:`success`,message:`Card added successfully.`,cardId:t.id?t.id:`(unknown)`}:{originalText:b,status:`error`,message:t.message||`Failed to add card to database. Unknown error.`}}catch(t){return logger.error(`Error adding note:`,t),{originalText:b,status:`error`,message:`Error adding card: ${t instanceof Error?t.message:`Unknown error`}`}}}function validateProcessorConfig(t){return t.dataShape?t.courseCode?t.userName?{isValid:!0}:{isValid:!1,errorMessage:`No user name provided for card processing`}:{isValid:!1,errorMessage:`No course code provided for card processing`}:{isValid:!1,errorMessage:`No data shape provided for card processing`}}function getUserDB(){try{return getDataLayer().getUserDB()}catch{return logger.info(`[UserDB Debug] Data layer not initialized yet.`),null}}function getRawDB(){let t=getUserDB();return t?t.localDB||(logger.info(`[UserDB Debug] Unable to access raw database instance.`),null):null}function formatTimestamp(t){return new Date(t).toLocaleString()}function mountUserDBDebugger(){if(typeof window>`u`)return;let t=window;t.skuilder=t.skuilder||{},t.skuilder.userdb=userDBDebugAPI}function isDataShapeRegistered(t,c){let u=NameSpacer.getDataShapeString({dataShape:t.name,course:t.course});return c.dataShapes.find(t=>t.name===u)!==void 0}function isDataShapeSchemaAvailable(t,c){let u=NameSpacer.getDataShapeString({dataShape:t.name,course:t.course}),d=c.dataShapes.find(t=>t.name===u);return d!==void 0&&d.serializedZodSchema!==void 0}function isQuestionTypeRegistered(t,c){let u=NameSpacer.getQuestionString({course:t.course,questionType:t.name});return c.questionTypes.some(t=>t.name===u)}function processCustomQuestionsData(t){let c=[],u=[],d=t.courses.map(t=>t.name);return t.questionClasses.forEach(m=>{let g=d.length>0?d[0]:t.meta.packageName;m.dataShapes&&Array.isArray(m.dataShapes)&&m.dataShapes.forEach(t=>{c.push({name:t.name,course:g,dataShape:t})}),u.push({name:m.name,course:g,questionClass:m,dataShapes:m.dataShapes||[],views:m.views||[]})}),{dataShapes:c,questions:u}}function registerDataShape(t,c){let u=NameSpacer.getDataShapeString({dataShape:t.name,course:t.course}),d;try{d=toZodJSON(t.dataShape)}catch(t){logger.warn(`Failed to generate schema for ${u}:`,t),d=void 0}let m=c.dataShapes.findIndex(t=>t.name===u);if(m!==-1){let g=c.dataShapes[m];return g.serializedZodSchema===d?(logger.info(`DataShape '${t.name}' from '${t.course}' already registered with identical schema`),!1):(g.serializedZodSchema?logger.info(`DataShape '${t.name}' from '${t.course}' schema has changed, updating...`):logger.info(`DataShape '${t.name}' from '${t.course}' already registered, but with no schema. Adding schema to existing entry`),c.dataShapes[m]={name:u,questionTypes:g.questionTypes,serializedZodSchema:d},logger.info(`Updated DataShape: ${u}`),!0)}return c.dataShapes.push({name:u,questionTypes:[],serializedZodSchema:d}),logger.info(`Registered DataShape: ${u}`),!0}function registerQuestionType(t,c){if(isQuestionTypeRegistered(t,c))return logger.info(`QuestionType '${t.name}' from '${t.course}' already registered`),!1;let u=NameSpacer.getQuestionString({course:t.course,questionType:t.name}),d=t.views.map(t=>t.name?t.name:`unnamedComponent`),m=t.dataShapes.map(c=>NameSpacer.getDataShapeString({course:t.course,dataShape:c.name}));return c.questionTypes.push({name:u,viewList:d,dataShapeList:m}),t.dataShapes.forEach(d=>{let m=NameSpacer.getDataShapeString({course:t.course,dataShape:d.name});for(let t of c.dataShapes)t.name===m&&t.questionTypes.push(u)}),logger.info(`Registered QuestionType: ${u}`),!0}function removeDataShape(t,c){let u=c.dataShapes.findIndex(c=>c.name===t);return u===-1?(logger.info(`DataShape '${t}' not found in course config`),!1):(c.dataShapes.splice(u,1),c.questionTypes.forEach(c=>{let u=c.dataShapeList.indexOf(t);u!==-1&&c.dataShapeList.splice(u,1)}),logger.info(`Removed DataShape: ${t}`),!0)}function removeQuestionType(t,c){let u=c.questionTypes.findIndex(c=>c.name===t);return u===-1?(logger.info(`QuestionType '${t}' not found in course config`),!1):(c.questionTypes.splice(u,1),c.dataShapes.forEach(c=>{let u=c.questionTypes.indexOf(t);u!==-1&&c.questionTypes.splice(u,1)}),logger.info(`Removed QuestionType: ${t}`),!0)}async function removeCustomQuestionTypes(t,c,u,d){try{logger.info(`Beginning custom question removal`),logger.info(`Removing ${t.length} data shapes and ${c.length} question types`);let m=0;for(let t of c)removeQuestionType(t,u)&&m++;for(let c of t)removeDataShape(c,u)&&m++;logger.info(`Updating course configuration...`);let g=await d.updateCourseConfig(u);if(!g.ok)throw Error(`Failed to update course config: ${JSON.stringify(g)}`);return logger.info(`Custom question removal complete: ${m} items removed`),{success:!0,removedCount:m}}catch(t){let c=t instanceof Error?t.message:String(t);return logger.error(`Custom question removal failed: ${c}`),{success:!1,removedCount:0,errorMessage:c}}}async function registerSeedData(t,c,u){if(t.questionClass.seedData&&Array.isArray(t.questionClass.seedData)){logger.info(`Registering seed data for question: ${t.name}`);try{let d=t.questionClass.seedData.filter(()=>t.dataShapes.length>0).map(d=>c.addNote(t.course,t.dataShapes[0],d,u,[]));await Promise.all(d),logger.info(`Seed data registered for question: ${t.name}`)}catch(c){logger.warn(`Failed to register seed data for question '${t.name}': ${c instanceof Error?c.message:String(c)}`)}}}async function registerBlanksCard(t,c,u,d,m){try{logger.info(`Registering BlanksCard data shapes and question type...`);let g=0,b=`default`;for(let t of c)registerDataShape({name:t.name,course:b,dataShape:t},u)&&g++;let S={name:t.name,course:b,questionClass:{name:t.name,dataShapes:c,views:t.views||[]},dataShapes:c,views:t.views||[]};registerQuestionType(S,u)&&g++,logger.info(`Updating course configuration with BlanksCard...`);let C=await d.updateCourseConfig(u);if(!C.ok)throw Error(`Failed to update course config: ${JSON.stringify(C)}`);return m&&await registerSeedData(S,d,m),logger.info(`BlanksCard registration complete: ${g} items registered`),{success:!0}}catch(t){let c=t instanceof Error?t.message:String(t);return logger.error(`BlanksCard registration failed: ${c}`),{success:!1,errorMessage:c}}}async function registerCustomQuestionTypes(t,c,u,d){try{logger.info(`Beginning custom question registration`),logger.info(`Processing ${t.questionClasses.length} question classes`);let{dataShapes:m,questions:g}=processCustomQuestionsData(t);logger.info(`Found ${m.length} data shapes and ${g.length} questions`);let b=0;logger.info(`Registering data shapes...`);for(let t of m)registerDataShape(t,c)&&b++;logger.info(`Registering question types...`);for(let t of g)registerQuestionType(t,c)&&b++;logger.info(`Updating course configuration...`);let S=await u.updateCourseConfig(c);if(!S.ok)throw Error(`Failed to update course config: ${JSON.stringify(S)}`);if(d){logger.info(`Registering seed data...`);for(let t of g)await registerSeedData(t,u,d)}return logger.info(`Custom question registration complete: ${b} items registered`),{success:!0,registeredCount:b}}catch(t){let c=t instanceof Error?t.message:String(t);return logger.error(`Custom question registration failed: ${c}`),{success:!1,registeredCount:0,errorMessage:c}}}function newInterval(t,c){return areQuestionRecords(c)?newQuestionInterval(t,c):1e5}function newQuestionInterval(t,c){let u=c.records,d=u[u.length-1],m=lastSuccessfulInterval(u);if(m>c.bestInterval&&(c.bestInterval=m,t.update(c._id,{bestInterval:m}).catch(t=>{logger.warn(`[SpacedRepetition] Failed to update bestInterval for ${c._id}: ${t?.message??t}`)})),d.isCorrect){let t=d.performance,u=isTaggedPerformance(t)?t._global:t,g=Math.min(1,Math.max(0,u));logger.debug(`Demontrated skill: ${g}`);let b=m*(.75+g);if(c.lapses=getLapses(c.records),c.streak=getStreak(c.records),c.lapses&&c.streak&&c.bestInterval&&(c.lapses>=0||c.streak>=0)){let t=(c.lapses*b+c.streak*c.bestInterval)/(c.lapses+c.streak);return logger.debug(`Weighted average interval calculation:
321
- (${c.lapses} * ${b} + ${c.streak} * ${c.bestInterval}) / (${c.lapses} + ${c.streak}) = ${t}`),t}else return b}else return 0}function lastSuccessfulInterval(t){for(let c=t.length-1;c>=1;c--)if(t[c].priorAttemps===0&&t[c].isCorrect){let u=secondsBetween(t[c-1].timeStamp,t[c].timeStamp),d=Math.max(u,1200*60);return logger.debug(`Last interval w/ this card was: ${u}s, returning ${d}s`),d}return getInitialInterval(t)}function getStreak(t){let c=0,u=t.length-1;for(;u>=0&&t[u].isCorrect;)u--,c++;return c}function getLapses(t){return t.filter(t=>t.isCorrect===!1).length}function getInitialInterval(t){return logger.warn(`history of length: ${t.length} ignored!`),3600*24*3}function secondsBetween(t,c){return t=hooks(t),c=hooks(c),duration(c.diff(t)).asSeconds()}function parseAudioURIs(t){return typeof t==`string`?t.match(/https?:\/\/[^\s"'<>]+\.(wav|mp3|ogg|m4a|aac|webm)/gi)??[]:[]}function prefetchAudio(t){return new Promise(c=>{let u=new Audio;u.preload=`auto`;let cleanup=()=>{u.oncanplaythrough=null,u.onerror=null};u.oncanplaythrough=()=>{cleanup(),c()},u.onerror=()=>{cleanup(),logger.warn(`[CardHydrationService] Failed to prefetch audio: ${t}`),c()},u.src=t})}async function validateStaticCourse(t,c){let u={valid:!0,manifestExists:!1,chunksExist:!1,attachmentsExist:!1,errors:[],warnings:[]};try{if(c){if(!(await c.stat(t)).isDirectory())return u.errors.push(`Path is not a directory: ${t}`),u.valid=!1,u}else if(!nodeFS2)return u.errors.push(`File system access not available - validation skipped`),u.valid=!1,u;else if(!(await nodeFS2.promises.stat(t)).isDirectory())return u.errors.push(`Path is not a directory: ${t}`),u.valid=!1,u;let d=`${t}/manifest.json`;try{if(c)if(d=c.joinPath(t,`manifest.json`),await c.exists(d)){u.manifestExists=!0;let t=await c.readFile(d),m=JSON.parse(t);u.courseId=m.courseId,u.courseName=m.courseName,(!m.version||!m.courseId||!m.chunks||!Array.isArray(m.chunks))&&(u.errors.push(`Invalid manifest structure`),u.valid=!1)}else u.errors.push(`Manifest not found: ${d}`),u.valid=!1;else{d=`${t}/manifest.json`,await nodeFS2.promises.access(d),u.manifestExists=!0;let c=await nodeFS2.promises.readFile(d,`utf8`),m=JSON.parse(c);u.courseId=m.courseId,u.courseName=m.courseName,(!m.version||!m.courseId||!m.chunks||!Array.isArray(m.chunks))&&(u.errors.push(`Invalid manifest structure`),u.valid=!1)}}catch(t){let c=t instanceof FileSystemError?t.message:`Manifest not found or invalid: ${d}`;u.errors.push(c),u.valid=!1}let m=`${t}/chunks`;try{c?(m=c.joinPath(t,`chunks`),await c.exists(m)?(await c.stat(m)).isDirectory()?u.chunksExist=!0:(u.errors.push(`Chunks path is not a directory: ${m}`),u.valid=!1):(u.errors.push(`Chunks directory not found: ${m}`),u.valid=!1)):(m=`${t}/chunks`,(await nodeFS2.promises.stat(m)).isDirectory()?u.chunksExist=!0:(u.errors.push(`Chunks path is not a directory: ${m}`),u.valid=!1))}catch(t){let c=t instanceof FileSystemError?t.message:`Chunks directory not found: ${m}`;u.errors.push(c),u.valid=!1}let g;try{c?(g=c.joinPath(t,`attachments`),await c.exists(g)?(await c.stat(g)).isDirectory()&&(u.attachmentsExist=!0):u.warnings.push(`Attachments directory not found: ${g} (this is OK if course has no attachments)`)):(g=`${t}/attachments`,(await nodeFS2.promises.stat(g)).isDirectory()&&(u.attachmentsExist=!0))}catch(c){g=g||`${t}/attachments`;let d=c instanceof FileSystemError?c.message:`Attachments directory not found: ${g} (this is OK if course has no attachments)`;u.warnings.push(d)}}catch(t){u.errors.push(`Failed to validate static course: ${t instanceof Error?t.message:String(t)}`),u.valid=!1}return u}async function validateMigration(t,c,u){let d={valid:!0,documentCountMatch:!1,attachmentIntegrity:!1,viewFunctionality:!1,issues:[]};try{logger.info(`Starting migration validation...`),d.documentCountMatch=compareDocumentCounts(c,await getActualDocumentCounts(t),d.issues),await validateCourseConfig(t,u,d.issues),d.viewFunctionality=await validateViews(t,u,d.issues),d.attachmentIntegrity=await validateAttachmentIntegrity(t,d.issues),d.valid=d.documentCountMatch&&d.viewFunctionality&&d.attachmentIntegrity,logger.info(`Migration validation completed. Valid: ${d.valid}`),d.issues.length>0&&(logger.info(`Validation issues: ${d.issues.length}`),d.issues.forEach(t=>{t.type===`error`?logger.error(`${t.category}: ${t.message}`):logger.warn(`${t.category}: ${t.message}`)}))}catch(t){d.valid=!1,d.issues.push({type:`error`,category:`metadata`,message:`Validation failed: ${t instanceof Error?t.message:String(t)}`})}return d}async function getActualDocumentCounts(t){let c={};try{let u=await t.allDocs({include_docs:!0});for(let t of u.rows){if(t.id.startsWith(`_design/`)){c._design=(c._design||0)+1;continue}let u=t.doc;u&&u.docType?c[u.docType]=(c[u.docType]||0)+1:c.unknown=(c.unknown||0)+1}}catch(t){logger.error(`Failed to get actual document counts:`,t)}return c}function compareDocumentCounts(t,c,u){let d=!0;for(let[m,g]of Object.entries(t)){let t=c[m]||0;t!==g&&(d=!1,u.push({type:`error`,category:`documents`,message:`Document count mismatch for ${m}: expected ${g}, got ${t}`}))}for(let[d,m]of Object.entries(c))!t[d]&&d!==`_design`&&u.push({type:`warning`,category:`documents`,message:`Unexpected document type found: ${d} (${m} documents)`});return d}async function validateCourseConfig(t,c,u){try{let d=await t.get(`CourseConfig`);if(!d){u.push({type:`error`,category:`course_config`,message:`CourseConfig document not found after migration`});return}d.courseID||u.push({type:`warning`,category:`course_config`,message:`CourseConfig document missing courseID field`}),d.courseID!==c.courseId&&u.push({type:`warning`,category:`course_config`,message:`CourseConfig courseID mismatch: expected ${c.courseId}, got ${d.courseID}`}),logger.debug(`CourseConfig document validation passed`)}catch(t){t.status===404?u.push({type:`error`,category:`course_config`,message:`CourseConfig document not found in database`}):u.push({type:`error`,category:`course_config`,message:`Failed to validate CourseConfig document: ${t instanceof Error?t.message:String(t)}`})}}async function validateViews(t,c,u){let d=!0;try{for(let m of c.designDocs)try{if(!await t.get(m._id)){d=!1,u.push({type:`error`,category:`views`,message:`Design document not found: ${m._id}`});continue}for(let c of Object.keys(m.views))try{let u=`${m._id}/${c}`;await t.query(u,{limit:1})}catch(t){d=!1,u.push({type:`error`,category:`views`,message:`View not accessible: ${m._id}/${c} - ${t}`})}}catch(t){d=!1,u.push({type:`error`,category:`views`,message:`Failed to validate design document ${m._id}: ${t}`})}}catch(t){d=!1,u.push({type:`error`,category:`views`,message:`View validation failed: ${t instanceof Error?t.message:String(t)}`})}return d}async function validateAttachmentIntegrity(t,c){let u=!0;try{let d=await t.allDocs({include_docs:!0,limit:10}),m=0,g=0;for(let b of d.rows){let d=b.doc;if(d&&d._attachments)for(let[b,S]of Object.entries(d._attachments)){m++;try{await t.getAttachment(d._id,b)&&g++}catch(t){u=!1,c.push({type:`error`,category:`attachments`,message:`Attachment not accessible: ${d._id}/${b} - ${t}`})}}}m===0?c.push({type:`warning`,category:`attachments`,message:`No attachments found in sampled documents`}):logger.info(`Validated ${g}/${m} sampled attachments`)}catch(t){u=!1,c.push({type:`error`,category:`attachments`,message:`Attachment validation failed: ${t instanceof Error?t.message:String(t)}`})}return u}function buildSourceSummary(t,c,u){let d=t.weighted.map(t=>t.score),m=t.weighted.filter(t=>getCardOrigin(t)===`review`).length,g=t.weighted.filter(t=>getCardOrigin(t)===`new`).length;return{sourceIndex:t.sourceIndex,sourceId:c,sourceName:u,totalCards:t.weighted.length,reviewCount:m,newCount:g,topScore:d.length>0?Math.max(...d):0,bottomScore:d.length>0?Math.min(...d):0,scoreRange:d.length>0?[Math.min(...d),Math.max(...d)]:[0,0],avgScore:d.length>0?d.reduce((t,c)=>t+c,0)/d.length:0}}function buildSourceBreakdown(t,c,u){let d=u.filter(c=>c.courseId===t),m=d.filter(t=>t.selected);return{sourceId:t,sourceName:c,reviewsProvided:d.filter(t=>t.origin===`review`).length,newProvided:d.filter(t=>t.origin===`new`).length,reviewsSelected:m.filter(t=>t.origin===`review`).length,newSelected:m.filter(t=>t.origin===`new`).length,totalSelected:m.length,selectionRate:d.length>0?m.length/d.length*100:0}}function captureMixerRun(t,c,u,d,m,g,b){let S=c.map((t,c)=>buildSourceSummary(t,u[c]||`source-${c}`,d[c])),C=new Set(b.map(t=>t.cardId)),w=new Map;c.forEach(t=>{let c=[...t.weighted].sort((t,c)=>c.score-t.score),d=new Map;c.forEach((t,c)=>{d.set(t.cardId,c+1)}),w.set(u[t.sourceIndex]||`source-${t.sourceIndex}`,d)});let T=new Map;b.forEach((t,c)=>{T.set(t.cardId,c+1)});let E=new Map;c.forEach(t=>{t.weighted.forEach(t=>{E.set(t.cardId,t)})});let D=Array.from(E.values()).map(t=>({cardId:t.cardId,courseId:t.courseId,origin:getCardOrigin(t),score:t.score,sourceIndex:c.findIndex(c=>c.weighted.some(c=>c.cardId===t.cardId)),selected:C.has(t.cardId),rankInSource:w.get(t.courseId)?.get(t.cardId),rankInMix:T.get(t.cardId)})),O=Array.from(new Set(u.filter(t=>t))).map((t,c)=>buildSourceBreakdown(t,d[c],D)),Or={runId:`mix-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,timestamp:new Date,mixerType:t,requestedLimit:m,quotaPerSource:g,sourceSummaries:S,cards:D,finalCount:b.length,reviewsSelected:b.filter(t=>getCardOrigin(t)===`review`).length,newSelected:b.filter(t=>getCardOrigin(t)===`new`).length,sourceBreakdowns:O};runHistory2.unshift(Or),runHistory2.length>MAX_RUNS2&&runHistory2.pop()}function printMixerSummary(t){console.group(`\u{1F3A8} Mixer Run: ${t.mixerType}`),logger.info(`Run ID: ${t.runId}`),logger.info(`Time: ${t.timestamp.toISOString()}`),logger.info(`Config: limit=${t.requestedLimit}${t.quotaPerSource?`, quota/source=${t.quotaPerSource}`:``}`),console.group(`\u{1F4E5} Input: ${t.sourceSummaries.length} sources`);for(let c of t.sourceSummaries)logger.info(` ${c.sourceName||c.sourceId}: ${c.totalCards} cards (${c.reviewCount} reviews, ${c.newCount} new)`),logger.info(` Score range: [${c.scoreRange[0].toFixed(2)}, ${c.scoreRange[1].toFixed(2)}], avg: ${c.avgScore.toFixed(2)}`);console.groupEnd(),console.group(`\u{1F4E4} Output: ${t.finalCount} cards selected (${t.reviewsSelected} reviews, ${t.newSelected} new)`);for(let c of t.sourceBreakdowns){let t=c.sourceName||c.sourceId;logger.info(` ${t}: ${c.totalSelected} selected (${c.reviewsSelected} reviews, ${c.newSelected} new) - ${c.selectionRate.toFixed(1)}% selection rate`)}console.groupEnd(),console.groupEnd()}function mountMixerDebugger(){if(typeof window>`u`)return;let t=window;t.skuilder=t.skuilder||{},t.skuilder.mixer=mixerDebugAPI}function startSessionTracking(t,c,u){clearRunHistory();let d=`session-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;activeSession={sessionId:d,startTime:new Date,initialQueues:{timestamp:new Date,reviewQLength:t,newQLength:c,failedQLength:u},presentations:[],queueSnapshots:[]},logger.debug(`[SessionDebugger] Started tracking session: ${d}`)}function recordCardPresentation(t,c,u,d,m,g){if(!activeSession){logger.warn(`[SessionDebugger] No active session to record presentation`);return}activeSession.presentations.push({timestamp:new Date,sequenceNumber:activeSession.presentations.length+1,cardId:t,courseId:c,courseName:u,origin:d,queueSource:m,score:g})}function snapshotQueues(t,c,u,d,m){activeSession&&activeSession.queueSnapshots.push({timestamp:new Date,reviewQLength:t,newQLength:c,failedQLength:u,reviewQNext3:d,newQNext3:m})}function endSessionTracking(){activeSession&&(activeSession.endTime=new Date,sessionHistory.unshift(activeSession),sessionHistory.length>MAX_HISTORY&&sessionHistory.pop(),logger.debug(`[SessionDebugger] Ended session: ${activeSession.sessionId}`),activeSession=null)}function showCurrentQueue(){if(!activeSession){logger.info(`[Session Debug] No active session.`);return}let t=activeSession.queueSnapshots[activeSession.queueSnapshots.length-1]||activeSession.initialQueues;console.group(`📊 Current Queue State`),logger.info(`Review Queue: ${t.reviewQLength} cards`),t.reviewQNext3&&t.reviewQNext3.length>0&&logger.info(` Next: ${t.reviewQNext3.join(`, `)}`),logger.info(`New Queue: ${t.newQLength} cards`),t.newQNext3&&t.newQNext3.length>0&&logger.info(` Next: ${t.newQNext3.join(`, `)}`),logger.info(`Failed Queue: ${t.failedQLength} cards`),console.groupEnd()}function showPresentationHistory(t=0){let c=t===0&&activeSession?activeSession:sessionHistory[t];if(!c){logger.info(`[Session Debug] No session found at index ${t}`);return}console.group(`\u{1F4DC} Session History: ${c.sessionId}`),logger.info(`Started: ${c.startTime.toLocaleTimeString()}`),c.endTime&&logger.info(`Ended: ${c.endTime.toLocaleTimeString()}`),logger.info(`Cards presented: ${c.presentations.length}`),c.presentations.length>0&&console.table(c.presentations.map(t=>({"#":t.sequenceNumber,course:t.courseName||t.courseId.slice(0,8),origin:t.origin,queue:t.queueSource,score:t.score?.toFixed(3)||`-`,time:t.timestamp.toLocaleTimeString()}))),console.groupEnd()}function showInterleaving(t=0){let c=t===0&&activeSession?activeSession:sessionHistory[t];if(!c){logger.info(`[Session Debug] No session found at index ${t}`);return}console.group(`🔀 Interleaving Analysis`);let u=new Map,d=new Map;if(c.presentations.forEach(t=>{let c=t.courseName||t.courseId;u.set(c,(u.get(c)||0)+1),d.has(c)||d.set(c,{review:0,new:0,failed:0});let m=d.get(c);m[t.origin]++}),logger.info(`Course distribution:`),console.table(Array.from(u.entries()).map(([t,u])=>{let m=d.get(t);return{course:t,total:u,reviews:m.review,new:m.new,failed:m.failed,percentage:(u/c.presentations.length*100).toFixed(1)+`%`}})),c.presentations.length>0){logger.info(`
321
+ (${c.lapses} * ${b} + ${c.streak} * ${c.bestInterval}) / (${c.lapses} + ${c.streak}) = ${t}`),t}else return b}else return 0}function lastSuccessfulInterval(t){for(let c=t.length-1;c>=1;c--)if(t[c].priorAttemps===0&&t[c].isCorrect){let u=secondsBetween(t[c-1].timeStamp,t[c].timeStamp),d=Math.max(u,1200*60);return logger.debug(`Last interval w/ this card was: ${u}s, returning ${d}s`),d}return getInitialInterval(t)}function getStreak(t){let c=0,u=t.length-1;for(;u>=0&&t[u].isCorrect;)u--,c++;return c}function getLapses(t){return t.filter(t=>t.isCorrect===!1).length}function getInitialInterval(t){return logger.warn(`history of length: ${t.length} ignored!`),3600*24*3}function secondsBetween(t,c){return t=hooks(t),c=hooks(c),duration(c.diff(t)).asSeconds()}function parseAudioURIs(t){return typeof t==`string`?t.match(/https?:\/\/[^\s"'<>]+\.(wav|mp3|ogg|m4a|aac|webm)/gi)??[]:[]}function prefetchAudio(t){return new Promise(c=>{let u=new Audio;u.preload=`auto`;let cleanup=()=>{u.oncanplaythrough=null,u.onerror=null};u.oncanplaythrough=()=>{cleanup(),c()},u.onerror=()=>{cleanup(),logger.warn(`[CardHydrationService] Failed to prefetch audio: ${t}`),c()},u.src=t})}async function validateStaticCourse(t,c){let u={valid:!0,manifestExists:!1,chunksExist:!1,attachmentsExist:!1,errors:[],warnings:[]};try{if(c){if(!(await c.stat(t)).isDirectory())return u.errors.push(`Path is not a directory: ${t}`),u.valid=!1,u}else if(!nodeFS2)return u.errors.push(`File system access not available - validation skipped`),u.valid=!1,u;else if(!(await nodeFS2.promises.stat(t)).isDirectory())return u.errors.push(`Path is not a directory: ${t}`),u.valid=!1,u;let d=`${t}/manifest.json`;try{if(c)if(d=c.joinPath(t,`manifest.json`),await c.exists(d)){u.manifestExists=!0;let t=await c.readFile(d),m=JSON.parse(t);u.courseId=m.courseId,u.courseName=m.courseName,(!m.version||!m.courseId||!m.chunks||!Array.isArray(m.chunks))&&(u.errors.push(`Invalid manifest structure`),u.valid=!1)}else u.errors.push(`Manifest not found: ${d}`),u.valid=!1;else{d=`${t}/manifest.json`,await nodeFS2.promises.access(d),u.manifestExists=!0;let c=await nodeFS2.promises.readFile(d,`utf8`),m=JSON.parse(c);u.courseId=m.courseId,u.courseName=m.courseName,(!m.version||!m.courseId||!m.chunks||!Array.isArray(m.chunks))&&(u.errors.push(`Invalid manifest structure`),u.valid=!1)}}catch(t){let c=t instanceof FileSystemError?t.message:`Manifest not found or invalid: ${d}`;u.errors.push(c),u.valid=!1}let m=`${t}/chunks`;try{c?(m=c.joinPath(t,`chunks`),await c.exists(m)?(await c.stat(m)).isDirectory()?u.chunksExist=!0:(u.errors.push(`Chunks path is not a directory: ${m}`),u.valid=!1):(u.errors.push(`Chunks directory not found: ${m}`),u.valid=!1)):(m=`${t}/chunks`,(await nodeFS2.promises.stat(m)).isDirectory()?u.chunksExist=!0:(u.errors.push(`Chunks path is not a directory: ${m}`),u.valid=!1))}catch(t){let c=t instanceof FileSystemError?t.message:`Chunks directory not found: ${m}`;u.errors.push(c),u.valid=!1}let g;try{c?(g=c.joinPath(t,`attachments`),await c.exists(g)?(await c.stat(g)).isDirectory()&&(u.attachmentsExist=!0):u.warnings.push(`Attachments directory not found: ${g} (this is OK if course has no attachments)`)):(g=`${t}/attachments`,(await nodeFS2.promises.stat(g)).isDirectory()&&(u.attachmentsExist=!0))}catch(c){g=g||`${t}/attachments`;let d=c instanceof FileSystemError?c.message:`Attachments directory not found: ${g} (this is OK if course has no attachments)`;u.warnings.push(d)}}catch(t){u.errors.push(`Failed to validate static course: ${t instanceof Error?t.message:String(t)}`),u.valid=!1}return u}async function validateMigration(t,c,u){let d={valid:!0,documentCountMatch:!1,attachmentIntegrity:!1,viewFunctionality:!1,issues:[]};try{logger.info(`Starting migration validation...`),d.documentCountMatch=compareDocumentCounts(c,await getActualDocumentCounts(t),d.issues),await validateCourseConfig(t,u,d.issues),d.viewFunctionality=await validateViews(t,u,d.issues),d.attachmentIntegrity=await validateAttachmentIntegrity(t,d.issues),d.valid=d.documentCountMatch&&d.viewFunctionality&&d.attachmentIntegrity,logger.info(`Migration validation completed. Valid: ${d.valid}`),d.issues.length>0&&(logger.info(`Validation issues: ${d.issues.length}`),d.issues.forEach(t=>{t.type===`error`?logger.error(`${t.category}: ${t.message}`):logger.warn(`${t.category}: ${t.message}`)}))}catch(t){d.valid=!1,d.issues.push({type:`error`,category:`metadata`,message:`Validation failed: ${t instanceof Error?t.message:String(t)}`})}return d}async function getActualDocumentCounts(t){let c={};try{let u=await t.allDocs({include_docs:!0});for(let t of u.rows){if(t.id.startsWith(`_design/`)){c._design=(c._design||0)+1;continue}let u=t.doc;u&&u.docType?c[u.docType]=(c[u.docType]||0)+1:c.unknown=(c.unknown||0)+1}}catch(t){logger.error(`Failed to get actual document counts:`,t)}return c}function compareDocumentCounts(t,c,u){let d=!0;for(let[m,g]of Object.entries(t)){let t=c[m]||0;t!==g&&(d=!1,u.push({type:`error`,category:`documents`,message:`Document count mismatch for ${m}: expected ${g}, got ${t}`}))}for(let[d,m]of Object.entries(c))!t[d]&&d!==`_design`&&u.push({type:`warning`,category:`documents`,message:`Unexpected document type found: ${d} (${m} documents)`});return d}async function validateCourseConfig(t,c,u){try{let d=await t.get(`CourseConfig`);if(!d){u.push({type:`error`,category:`course_config`,message:`CourseConfig document not found after migration`});return}d.courseID||u.push({type:`warning`,category:`course_config`,message:`CourseConfig document missing courseID field`}),d.courseID!==c.courseId&&u.push({type:`warning`,category:`course_config`,message:`CourseConfig courseID mismatch: expected ${c.courseId}, got ${d.courseID}`}),logger.debug(`CourseConfig document validation passed`)}catch(t){t.status===404?u.push({type:`error`,category:`course_config`,message:`CourseConfig document not found in database`}):u.push({type:`error`,category:`course_config`,message:`Failed to validate CourseConfig document: ${t instanceof Error?t.message:String(t)}`})}}async function validateViews(t,c,u){let d=!0;try{for(let m of c.designDocs)try{if(!await t.get(m._id)){d=!1,u.push({type:`error`,category:`views`,message:`Design document not found: ${m._id}`});continue}for(let c of Object.keys(m.views))try{let u=`${m._id}/${c}`;await t.query(u,{limit:1})}catch(t){d=!1,u.push({type:`error`,category:`views`,message:`View not accessible: ${m._id}/${c} - ${t}`})}}catch(t){d=!1,u.push({type:`error`,category:`views`,message:`Failed to validate design document ${m._id}: ${t}`})}}catch(t){d=!1,u.push({type:`error`,category:`views`,message:`View validation failed: ${t instanceof Error?t.message:String(t)}`})}return d}async function validateAttachmentIntegrity(t,c){let u=!0;try{let d=await t.allDocs({include_docs:!0,limit:10}),m=0,g=0;for(let b of d.rows){let d=b.doc;if(d&&d._attachments)for(let[b,S]of Object.entries(d._attachments)){m++;try{await t.getAttachment(d._id,b)&&g++}catch(t){u=!1,c.push({type:`error`,category:`attachments`,message:`Attachment not accessible: ${d._id}/${b} - ${t}`})}}}m===0?c.push({type:`warning`,category:`attachments`,message:`No attachments found in sampled documents`}):logger.info(`Validated ${g}/${m} sampled attachments`)}catch(t){u=!1,c.push({type:`error`,category:`attachments`,message:`Attachment validation failed: ${t instanceof Error?t.message:String(t)}`})}return u}function buildSourceSummary(t,c,u){let d=t.weighted.map(t=>t.score),m=t.weighted.filter(t=>getCardOrigin(t)===`review`).length,g=t.weighted.filter(t=>getCardOrigin(t)===`new`).length;return{sourceIndex:t.sourceIndex,sourceId:c,sourceName:u,totalCards:t.weighted.length,reviewCount:m,newCount:g,topScore:d.length>0?Math.max(...d):0,bottomScore:d.length>0?Math.min(...d):0,scoreRange:d.length>0?[Math.min(...d),Math.max(...d)]:[0,0],avgScore:d.length>0?d.reduce((t,c)=>t+c,0)/d.length:0}}function buildSourceBreakdown(t,c,u){let d=u.filter(c=>c.courseId===t),m=d.filter(t=>t.selected);return{sourceId:t,sourceName:c,reviewsProvided:d.filter(t=>t.origin===`review`).length,newProvided:d.filter(t=>t.origin===`new`).length,reviewsSelected:m.filter(t=>t.origin===`review`).length,newSelected:m.filter(t=>t.origin===`new`).length,totalSelected:m.length,selectionRate:d.length>0?m.length/d.length*100:0}}function captureMixerRun(t,c,u,d,m,g,b){let S=c.map((t,c)=>buildSourceSummary(t,u[c]||`source-${c}`,d[c])),C=new Set(b.map(t=>t.cardId)),w=new Map;c.forEach(t=>{let c=[...t.weighted].sort((t,c)=>c.score-t.score),d=new Map;c.forEach((t,c)=>{d.set(t.cardId,c+1)}),w.set(u[t.sourceIndex]||`source-${t.sourceIndex}`,d)});let T=new Map;b.forEach((t,c)=>{T.set(t.cardId,c+1)});let E=new Map;c.forEach(t=>{t.weighted.forEach(t=>{E.set(t.cardId,t)})});let D=Array.from(E.values()).map(t=>({cardId:t.cardId,courseId:t.courseId,origin:getCardOrigin(t),score:t.score,sourceIndex:c.findIndex(c=>c.weighted.some(c=>c.cardId===t.cardId)),selected:C.has(t.cardId),rankInSource:w.get(t.courseId)?.get(t.cardId),rankInMix:T.get(t.cardId)})),O=Array.from(new Set(u.filter(t=>t))).map((t,c)=>buildSourceBreakdown(t,d[c],D)),Or={runId:`mix-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,timestamp:new Date,mixerType:t,requestedLimit:m,quotaPerSource:g,sourceSummaries:S,cards:D,finalCount:b.length,reviewsSelected:b.filter(t=>getCardOrigin(t)===`review`).length,newSelected:b.filter(t=>getCardOrigin(t)===`new`).length,sourceBreakdowns:O};runHistory2.unshift(Or),runHistory2.length>MAX_RUNS2&&runHistory2.pop()}function printMixerSummary(t){console.group(`\u{1F3A8} Mixer Run: ${t.mixerType}`),logger.info(`Run ID: ${t.runId}`),logger.info(`Time: ${t.timestamp.toISOString()}`),logger.info(`Config: limit=${t.requestedLimit}${t.quotaPerSource?`, quota/source=${t.quotaPerSource}`:``}`),console.group(`\u{1F4E5} Input: ${t.sourceSummaries.length} sources`);for(let c of t.sourceSummaries)logger.info(` ${c.sourceName||c.sourceId}: ${c.totalCards} cards (${c.reviewCount} reviews, ${c.newCount} new)`),logger.info(` Score range: [${c.scoreRange[0].toFixed(2)}, ${c.scoreRange[1].toFixed(2)}], avg: ${c.avgScore.toFixed(2)}`);console.groupEnd(),console.group(`\u{1F4E4} Output: ${t.finalCount} cards selected (${t.reviewsSelected} reviews, ${t.newSelected} new)`);for(let c of t.sourceBreakdowns){let t=c.sourceName||c.sourceId;logger.info(` ${t}: ${c.totalSelected} selected (${c.reviewsSelected} reviews, ${c.newSelected} new) - ${c.selectionRate.toFixed(1)}% selection rate`)}console.groupEnd(),console.groupEnd()}function mountMixerDebugger(){if(typeof window>`u`)return;let t=window;t.skuilder=t.skuilder||{},t.skuilder.mixer=mixerDebugAPI}function registerActiveController(t){activeController=t}function getActiveController(){return activeController}function toggleSessionOverlay(){if(typeof document>`u`){logger.info(`[Session Overlay] No DOM available (non-browser host); overlay unavailable.`);return}overlayEl?(teardown(),logger.info(`[Session Overlay] Hidden.`)):(mount(),logger.info(`[Session Overlay] Shown. Toggle off with window.skuilder.session.dbgOverlay().`))}function mount(){overlayEl=document.createElement(`div`),overlayEl.id=OVERLAY_ID,Object.assign(overlayEl.style,{position:`fixed`,top:`8px`,left:`8px`,zIndex:`2147483647`,maxWidth:`320px`,maxHeight:`90vh`,overflowY:`auto`,padding:`8px 10px`,background:`rgba(17, 24, 39, 0.92)`,color:`#e5e7eb`,font:`11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace`,borderRadius:`6px`,boxShadow:`0 4px 16px rgba(0,0,0,0.4)`,pointerEvents:`auto`,userSelect:`none`}),document.body.appendChild(overlayEl),render(),pollHandle=setInterval(render,POLL_MS)}function teardown(){pollHandle!==null&&(clearInterval(pollHandle),pollHandle=null),overlayEl?.parentNode&&overlayEl.parentNode.removeChild(overlayEl),overlayEl=null}function render(){if(!overlayEl)return;spinnerFrame++;let t=getActiveController();if(!t){overlayEl.innerHTML=headerHtml()+`<div style="opacity:.65">No active session.</div>`;return}let c=t.getDebugSnapshot();overlayEl.innerHTML=headerHtml()+replanHtml(c)+metaHtml(c)+hintsHtml(c.sessionHints)+queueHtml(`reviewQ`,`reviewQ`,c.reviewQ)+queueHtml(`newQ`,`newQ`,c.newQ)+queueHtml(`failedQ`,`failedQ`,c.failedQ),overlayEl.querySelectorAll(`[data-q]`).forEach(t=>{t.onclick=()=>{let c=t.dataset.q;c&&(expanded[c]=!expanded[c],render())}})}function headerHtml(){return`<div style="font-weight:600;color:#93c5fd;margin-bottom:4px">⚙ SessionController</div>`}function replanHtml(t){return t.replanActive?`<div style="margin-bottom:6px;color:#fde047">${SPINNER_FRAMES[spinnerFrame%SPINNER_FRAMES.length]} replanning <span style="opacity:.85">[${esc(t.replanLabel??`(auto)`)}]</span></div>`:`<div style="margin-bottom:6px;opacity:.45">○ idle</div>`}function metaHtml(t){return`<div style="margin-bottom:6px">${[`time ${formatTime(t.secondsRemaining)}${t.hasCardGuarantee?` \xB7 <span style="color:#fbbf24">guarantee ${t.minCardsGuarantee}</span>`:``}`,`well-indicated left: ${t.wellIndicatedRemaining}`,`current: ${t.currentCard?esc(t.currentCard):`<span style="opacity:.6">—</span>`}`].map(t=>`<div>${t}</div>`).join(``)}</div>`}function hintsHtml(t){let c=[];return t&&(t.boostTags&&Object.keys(t.boostTags).length&&c.push(`boost: `+Object.entries(t.boostTags).map(([t,c])=>`${esc(t)}<span style="opacity:.6">\xD7${c}</span>`).join(`, `)),t.boostCards&&Object.keys(t.boostCards).length&&c.push(`boostCards: `+Object.entries(t.boostCards).map(([t,c])=>`${esc(t)}<span style="opacity:.6">\xD7${c}</span>`).join(`, `)),t.requireCards?.length&&c.push(`require: ${t.requireCards.map(esc).join(`, `)}`),t.requireTags?.length&&c.push(`requireTags: ${t.requireTags.map(esc).join(`, `)}`),t.excludeTags?.length&&c.push(`exclude: ${t.excludeTags.map(esc).join(`, `)}`),t.excludeCards?.length&&c.push(`excludeCards: ${t.excludeCards.map(esc).join(`, `)}`)),`<div style="margin-bottom:6px"><div style="color:#86efac">sessionHints</div>${c.length?c.map(t=>`<div style="margin-left:6px">${t}</div>`).join(``):`<div style="margin-left:6px;opacity:.6">none</div>`}</div>`}function queueHtml(t,c,u){let d=u.length>INLINE_THRESHOLD,m=!d||expanded[t],g=d?expanded[t]?`▾ `:`▸ `:``,b=u.dequeueCount?` <span style="opacity:.5">drawn ${u.dequeueCount}</span>`:``,S=d?`cursor:pointer;color:#f9a8d4`:`color:#f9a8d4`,C=`<div${d?` data-q="${t}"`:``} style="${S}">${g}${c}: ${u.length}${b}</div>`,w=``;return w=m&&u.cards.length?`<ol style="margin:2px 0 6px 0;padding-left:20px">`+u.cards.map(t=>`<li style="white-space:nowrap">${esc(t)}</li>`).join(``)+`</ol>`:u.cards.length?`<div style="margin:1px 0 6px 6px;opacity:.55">(${u.length} cards \u2014 click to expand)</div>`:`<div style="margin:1px 0 6px 6px;opacity:.5">empty</div>`,C+w}function formatTime(t){let c=Math.max(0,Math.round(t));return`${Math.floor(c/60)}:${(c%60).toString().padStart(2,`0`)}`}function esc(t){return t.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function startSessionTracking(t,c,u){clearRunHistory();let d=`session-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;activeSession={sessionId:d,startTime:new Date,initialQueues:{timestamp:new Date,reviewQLength:t,newQLength:c,failedQLength:u},presentations:[],queueSnapshots:[]},logger.debug(`[SessionDebugger] Started tracking session: ${d}`)}function recordCardPresentation(t,c,u,d,m,g){if(!activeSession){logger.warn(`[SessionDebugger] No active session to record presentation`);return}activeSession.presentations.push({timestamp:new Date,sequenceNumber:activeSession.presentations.length+1,cardId:t,courseId:c,courseName:u,origin:d,queueSource:m,score:g})}function snapshotQueues(t,c,u,d,m){activeSession&&activeSession.queueSnapshots.push({timestamp:new Date,reviewQLength:t,newQLength:c,failedQLength:u,reviewQNext3:d,newQNext3:m})}function endSessionTracking(){activeSession&&(activeSession.endTime=new Date,sessionHistory.unshift(activeSession),sessionHistory.length>MAX_HISTORY&&sessionHistory.pop(),logger.debug(`[SessionDebugger] Ended session: ${activeSession.sessionId}`),activeSession=null)}function showCurrentQueue(){if(!activeSession){logger.info(`[Session Debug] No active session.`);return}let t=activeSession.queueSnapshots[activeSession.queueSnapshots.length-1]||activeSession.initialQueues;console.group(`📊 Current Queue State`),logger.info(`Review Queue: ${t.reviewQLength} cards`),t.reviewQNext3&&t.reviewQNext3.length>0&&logger.info(` Next: ${t.reviewQNext3.join(`, `)}`),logger.info(`New Queue: ${t.newQLength} cards`),t.newQNext3&&t.newQNext3.length>0&&logger.info(` Next: ${t.newQNext3.join(`, `)}`),logger.info(`Failed Queue: ${t.failedQLength} cards`),console.groupEnd()}function showPresentationHistory(t=0){let c=t===0&&activeSession?activeSession:sessionHistory[t];if(!c){logger.info(`[Session Debug] No session found at index ${t}`);return}console.group(`\u{1F4DC} Session History: ${c.sessionId}`),logger.info(`Started: ${c.startTime.toLocaleTimeString()}`),c.endTime&&logger.info(`Ended: ${c.endTime.toLocaleTimeString()}`),logger.info(`Cards presented: ${c.presentations.length}`),c.presentations.length>0&&console.table(c.presentations.map(t=>({"#":t.sequenceNumber,course:t.courseName||t.courseId.slice(0,8),origin:t.origin,queue:t.queueSource,score:t.score?.toFixed(3)||`-`,time:t.timestamp.toLocaleTimeString()}))),console.groupEnd()}function showInterleaving(t=0){let c=t===0&&activeSession?activeSession:sessionHistory[t];if(!c){logger.info(`[Session Debug] No session found at index ${t}`);return}console.group(`🔀 Interleaving Analysis`);let u=new Map,d=new Map;if(c.presentations.forEach(t=>{let c=t.courseName||t.courseId;u.set(c,(u.get(c)||0)+1),d.has(c)||d.set(c,{review:0,new:0,failed:0});let m=d.get(c);m[t.origin]++}),logger.info(`Course distribution:`),console.table(Array.from(u.entries()).map(([t,u])=>{let m=d.get(t);return{course:t,total:u,reviews:m.review,new:m.new,failed:m.failed,percentage:(u/c.presentations.length*100).toFixed(1)+`%`}})),c.presentations.length>0){logger.info(`
322
322
  Presentation sequence (first 20):`);let t=c.presentations.slice(0,20).map((t,c)=>`${c+1}. ${t.courseName||t.courseId.slice(0,8)} (${t.origin})`).join(`
323
323
  `);logger.info(t)}let m=0,g=1,b=c.presentations[0]?.courseId;for(let t=1;t<c.presentations.length;t++)c.presentations[t].courseId===b?(g++,m=Math.max(m,g)):(b=c.presentations[t].courseId,g=1);m>3&&(logger.info(`
324
- \u26A0\uFE0F Detected clustering: max ${m} cards from same course in a row`),logger.info(`This suggests cards are sorted by score rather than round-robin by course.`)),console.groupEnd()}function mountSessionDebugger(){if(typeof window>`u`)return;let t=window;t.skuilder=t.skuilder||{},t.skuilder.session=sessionDebugAPI}var import___vite_browser_external,import___vite_browser_external$1,import___vite_browser_external$2,import_browser_ponyfill,import_browser_ponyfill$1,import_browser,_SessionController2,__defProp,__getOwnPropNames,__glob,__esm,__export,init_adminDB,init_classroomDB,init_SyncStrategy,isDevelopment,logger,init_logger,GuestUsername,log,DocType,DocTypePrefixes,init_types_legacy,init_util,pouchdb_setup_default,init_pouchdb_setup,init_dataDirectory,REVIEW_TIME_FORMAT,log2,init_userDBHelpers,Loggable,init_Loggable,UpdateQueue,init_updateQueue,UsrCrsData,init_user_course_relDB,CLIENT_CACHE,init_clientCache,AlreadyTaggedErr,init_courseAPI,courseLookupDBTitle,CourseLookup,init_courseLookupDB,PipelineDebugger_exports,_activePipeline,MAX_RUNS,runHistory,DISCARDED_KEEP_TOP,_uiContainer,_selectedRunIndex,_cardSearchQuery,pipelineDebugAPI,init_PipelineDebugger,CompositeGenerator_exports,AggregationMode,DEFAULT_AGGREGATION_MODE,FREQUENCY_BOOST_FACTOR,CompositeGenerator,init_CompositeGenerator,elo_exports,ELONavigator,init_elo,generators_exports,init_generators,prescribed_exports,DEFAULT_FRESHNESS_WINDOW,DEFAULT_MAX_DIRECT_PER_RUN,DEFAULT_MAX_SUPPORT_PER_RUN,DEFAULT_HIERARCHY_DEPTH,DEFAULT_MIN_COUNT,BASE_TARGET_SCORE,BASE_SUPPORT_SCORE,DISCOVERED_SUPPORT_SCORE,MAX_TARGET_MULTIPLIER,MAX_SUPPORT_MULTIPLIER,PRESCRIBED_DEBUG_VERSION,PrescribedCardsGenerator,init_prescribed,srs_exports,DEFAULT_HEALTHY_BACKLOG,MAX_BACKLOG_PRESSURE,SRSNavigator,init_srs,types_exports,init_types,globImport_generators,init_,DEFAULT_LEARNABLE_WEIGHT,init_contentNavigationStrategy,WeightedFilter_exports,WeightedFilter,init_WeightedFilter,eloDistance_exports,DEFAULT_HALF_LIFE,DEFAULT_MIN_MULTIPLIER,DEFAULT_MAX_MULTIPLIER,init_eloDistance,hierarchyDefinition_exports,DEFAULT_MIN_COUNT2,HierarchyDefinitionNavigator,init_hierarchyDefinition,userTagPreference_exports,UserTagPreferenceFilter,init_userTagPreference,filters_exports,init_filters,inferredPreferenceStub_exports,INFERRED_PREFERENCE_NAVIGATOR_STUB,init_inferredPreferenceStub,interferenceMitigator_exports,DEFAULT_MIN_COUNT3,DEFAULT_MIN_ELAPSED_DAYS,DEFAULT_INTERFERENCE_DECAY,InterferenceMitigatorNavigator,init_interferenceMitigator,relativePriority_exports,DEFAULT_PRIORITY,DEFAULT_PRIORITY_INFLUENCE,DEFAULT_COMBINE_MODE,RelativePriorityNavigator,init_relativePriority,types_exports2,init_types2,userGoalStub_exports,USER_GOAL_NAVIGATOR_STUB,init_userGoalStub,globImport_filters,init_2,init_gradient,MIN_OBSERVATIONS_FOR_UPDATE,LEARNING_RATE,MAX_WEIGHT_DELTA,MIN_R_SQUARED_FOR_GRADIENT,FLAT_GRADIENT_THRESHOLD,MAX_HISTORY_LENGTH,init_learning,init_signal,init_recording,MIN_SPREAD,MAX_SPREAD,MIN_WEIGHT,MAX_WEIGHT,init_orchestration,Pipeline_exports,VERBOSE_RESULTS,Pipeline,init_Pipeline,defaults_exports,init_defaults,PipelineAssembler_exports,PipelineAssembler,init_PipelineAssembler,globImport,init_3,navigators_exports,navigatorRegistry,Navigators,NavigatorRole,NavigatorRoles,ContentNavigator,init_navigators,CoursesDB,CourseDB,init_courseDB,classroomLookupDBTitle,CLASSROOM_CONFIG,ClassroomDBBase,StudentClassroomDB,TeacherClassroomDB,ClassroomLookupDB,init_classroomDB2,AdminDB,init_adminDB2,CourseSyncService_exports,DEFAULT_REPLICATION,CourseSyncService,init_CourseSyncService,init_auth,CouchDBSyncStrategy_exports,log3,CouchDBSyncStrategy,init_CouchDBSyncStrategy,isBrowser,GUEST_LOCAL_DB,localUserDB,pouchDBincludeCredentialsConfig,REVIEW_TIME_FORMAT2,init_couch,log4,BaseUser,userCoursesDoc,userClassroomsDoc,init_BaseUserDB,init_common,PouchDataLayerProvider_exports,CouchDataLayerProvider,init_PouchDataLayerProvider,pathUtils,nodeFS,StaticDataUnpacker,init_StaticDataUnpacker,StaticCourseDB,init_courseDB2,StaticCoursesDB,init_coursesDB,NoOpSyncStrategy,init_NoOpSyncStrategy,StaticDataLayerProvider_exports,StaticDataLayerProvider,init_StaticDataLayerProvider,NOT_SET,ENV,dataLayerInstance,init_factory,TagFilteredContentSource,init_TagFilteredContentSource,init_contentSource,init_courseDB3,init_dataLayerProvider,init_userDB,init_interfaces,init_user,init_strategyState,init_userOutcome,init_cardProcessor,init_types3,init_bulkImport,userDBDebugAPI,init_UserDBDebugger,init_core,duration,SrsService,EloService,ResponseProcessor,CardHydrationService,ItemQueue,CouchDBToStaticPacker,DEFAULT_MIGRATION_OPTIONS,FileSystemError,nodeFS2,nodeFS3,nodePath,StaticToCouchDBMigrator,QuotaRoundRobinMixer,MAX_RUNS2,runHistory2,mixerDebugAPI,activeSession,sessionHistory,MAX_HISTORY,sessionDebugAPI,SessionController,init_dist=__esmMin((()=>{init_defineProperty(),init_index_browser_es$5(),init_index_browser_es(),init_index_es(),import___vite_browser_external=__toESM$2(require___vite_browser_external(),1),import___vite_browser_external$1=__toESM$2(require___vite_browser_external(),1),import___vite_browser_external$2=__toESM$2(require___vite_browser_external(),1),init_moment(),init_dist$1(),init_esm_browser(),import_browser_ponyfill=__toESM$2(require_browser_ponyfill(),1),import_browser_ponyfill$1=__toESM$2(require_browser_ponyfill(),1),import_browser=__toESM$2(require_browser(),1),__defProp=Object.defineProperty,__getOwnPropNames=Object.getOwnPropertyNames,__glob=t=>c=>{var u=t[c];if(u)return u();throw Error(`Module not found in bundle: `+c)},__esm=(t,c)=>function __init(){return t&&(c=(0,t[__getOwnPropNames(t)[0]])(t=0)),c},__export=(t,c)=>{for(var u in c)__defProp(t,u,{get:c[u],enumerable:!0})},init_adminDB=__esm({"src/core/interfaces/adminDB.ts"(){"use strict";}}),init_classroomDB=__esm({"src/core/interfaces/classroomDB.ts"(){"use strict";}}),init_SyncStrategy=__esm({"src/impl/common/SyncStrategy.ts"(){"use strict";}}),init_logger=__esm({"src/util/logger.ts"(){"use strict";isDevelopment=typeof process<`u`&&process.env.NODE_ENV===`development`,logger={debug:(t,...c)=>{isDevelopment&&console.debug(`[DB:DEBUG] ${t}`,...c)},info:(t,...c)=>{console.info(`[DB:INFO] ${t}`,...c)},warn:(t,...c)=>{console.warn(`[DB:WARN] ${t}`,...c)},error:(t,...c)=>{console.error(`[DB:ERROR] ${t}`,...c)},log:(t,...c)=>{isDevelopment&&console.log(`[DB:LOG] ${t}`,...c)}}}}),init_types_legacy=__esm({"src/core/types/types-legacy.ts"(){"use strict";init_logger(),GuestUsername=`sk-guest-`,log=t=>{logger.log(t)},DocType=(t=>(t.DISPLAYABLE_DATA=`DISPLAYABLE_DATA`,t.CARD=`CARD`,t.DATASHAPE=`DATASHAPE`,t.QUESTIONTYPE=`QUESTION`,t.VIEW=`VIEW`,t.PEDAGOGY=`PEDAGOGY`,t.CARDRECORD=`CARDRECORD`,t.SCHEDULED_CARD=`SCHEDULED_CARD`,t.TAG=`TAG`,t.NAVIGATION_STRATEGY=`NAVIGATION_STRATEGY`,t.STRATEGY_STATE=`STRATEGY_STATE`,t.USER_OUTCOME=`USER_OUTCOME`,t.STRATEGY_LEARNING_STATE=`STRATEGY_LEARNING_STATE`,t))(DocType||{}),DocTypePrefixes={CARD:`c`,DISPLAYABLE_DATA:`dd`,TAG:`TAG`,CARDRECORD:`cardH`,SCHEDULED_CARD:`card_review_`,DATASHAPE:`DATASHAPE`,QUESTION:`QUESTION`,VIEW:`VIEW`,PEDAGOGY:`PEDAGOGY`,NAVIGATION_STRATEGY:`NAVIGATION_STRATEGY`,STRATEGY_STATE:`STRATEGY_STATE`,USER_OUTCOME:`USER_OUTCOME`,STRATEGY_LEARNING_STATE:`STRATEGY_LEARNING_STATE`}}}),init_util=__esm({"src/core/util/index.ts"(){"use strict";init_types_legacy()}}),init_pouchdb_setup=__esm({"src/impl/couch/pouchdb-setup.ts"(){"use strict";PouchDB.plugin(plugin$1),PouchDB.plugin(plugin),PouchDB.debug!==void 0&&PouchDB.debug.disable(),PouchDB.defaults({}),pouchdb_setup_default=PouchDB}}),init_dataDirectory=__esm({"src/util/dataDirectory.ts"(){"use strict";init_logger(),init_factory()}}),init_userDBHelpers=__esm({"src/impl/common/userDBHelpers.ts"(){"use strict";init_core(),init_logger(),init_pouchdb_setup(),init_dataDirectory(),REVIEW_TIME_FORMAT=`YYYY-MM-DD--kk:mm:ss-SSS`,log2=t=>{logger.info(t)}}}),init_Loggable=__esm({"src/util/Loggable.ts"(){"use strict";Loggable=class{log(...t){console.log(`LOG-${this._className}@${new Date}:`,...t)}error(...t){console.error(`ERROR-${this._className}@${new Date}:`,...t)}}}}),init_updateQueue=__esm({"src/impl/couch/updateQueue.ts"(){"use strict";init_Loggable(),init_logger(),UpdateQueue=class extends Loggable{update(t,c){return logger.debug(`Update requested on doc: ${t}`),this.pendingUpdates[t]?this.pendingUpdates[t].push(c):this.pendingUpdates[t]=[c],this.applyUpdates(t)}constructor(t,c){super(),_defineProperty$2(this,`_className`,`UpdateQueue`),_defineProperty$2(this,`pendingUpdates`,{}),_defineProperty$2(this,`inprogressUpdates`,{}),_defineProperty$2(this,`readDB`,void 0),_defineProperty$2(this,`writeDB`,void 0),this.readDB=t,this.writeDB=c||t,logger.debug(`UpdateQ initialized...`),this.readDB.info().then(t=>{logger.debug(`db info: ${JSON.stringify(t)}`)})}async applyUpdates(t){if(logger.debug(`Applying updates on doc: ${t}`),this.inprogressUpdates[t]){for(;this.inprogressUpdates[t];)await new Promise(t=>setTimeout(t,Math.random()*50));return this.applyUpdates(t)}else if(this.pendingUpdates[t]&&this.pendingUpdates[t].length>0){this.inprogressUpdates[t]=!0;let c=5;for(let c=0;c<5;c++)try{let c={...await this.readDB.get(t)},u=[...this.pendingUpdates[t]];for(let t of u)c=typeof t==`function`?{...c,...t(c)}:{...c,...t};if(await this.writeDB.put(c),this.pendingUpdates[t].splice(0,u.length),this.pendingUpdates[t].length===0)this.inprogressUpdates[t]=!1,delete this.inprogressUpdates[t];else return this.applyUpdates(t);return c}catch(u){if(u.name===`conflict`&&c<4)logger.warn(`Conflict on update for doc ${t}, retry #${c+1}`),await new Promise(t=>setTimeout(t,50*Math.random()));else if(u.name===`not_found`&&c===0)throw logger.warn(`Update failed for ${t} - does not exist. Throwing to caller.`),delete this.inprogressUpdates[t],u;else throw delete this.inprogressUpdates[t],this.pendingUpdates[t]&&delete this.pendingUpdates[t],logger.error(`Error on attemped update (retry ${c}): ${JSON.stringify(u)}`),u}throw Error(`UpdateQueue failed for doc ${t} after 5 retries.`)}else throw Error(`Empty Updates Queue Triggered`)}}}}),init_user_course_relDB=__esm({"src/impl/couch/user-course-relDB.ts"(){"use strict";init_logger(),UsrCrsData=class{constructor(t,c){_defineProperty$2(this,`user`,void 0),_defineProperty$2(this,`_courseId`,void 0),this.user=t,this._courseId=c}async getReviewsForcast(t){let c=hooks.utc().add(t,`days`);return this.getReviewstoDate(c)}async getPendingReviews(){let t=hooks.utc();return this.getReviewstoDate(t)}async getScheduledReviewCount(){return(await this.getPendingReviews()).length}async getCourseSettings(){let t=(await this.user.getCourseRegistrationsDoc()).courses.find(t=>t.courseID===this._courseId);return t&&t.settings?t.settings:(logger.warn(`no settings found during lookup on course ${this._courseId}`),{})}updateCourseSettings(t){`updateCourseSettings`in this.user&&this.user.updateCourseSettings(this._courseId,t)}async getStrategyState(t){return this.user.getStrategyState(this._courseId,t)}async putStrategyState(t,c){return this.user.putStrategyState(this._courseId,t,c)}async deleteStrategyState(t){return this.user.deleteStrategyState(this._courseId,t)}async getReviewstoDate(t){let c=await this.user.getPendingReviews(this._courseId);return logger.debug(`Fetching ${this.user.getUsername()}'s scheduled reviews for course ${this._courseId}.`),c.filter(c=>{let u=hooks.utc(c.reviewTime);return t.isAfter(u)})}}}}),init_clientCache=__esm({"src/impl/couch/clientCache.ts"(){"use strict";CLIENT_CACHE={}}}),init_courseAPI=__esm({"src/impl/couch/courseAPI.ts"(){"use strict";init_pouchdb_setup(),init_couch(),init_factory(),init_courseDB(),init_types_legacy(),init_common(),init_logger(),AlreadyTaggedErr=class extends Error{constructor(t){super(t),this.name=`AlreadyTaggedErr`}}}}),init_courseLookupDB=__esm({"src/impl/couch/courseLookupDB.ts"(){"use strict";var t;init_pouchdb_setup(),init_factory(),init_logger(),courseLookupDBTitle=`coursedb-lookup`,logger.debug(`COURSELOOKUP FILE RUNNING`),CourseLookup=(t=class _CourseLookup{static get _db(){if(this._dbInstance)return this._dbInstance;if(ENV.COUCHDB_SERVER_URL===`NOT_SET`||!ENV.COUCHDB_SERVER_URL)throw Error(`CourseLookup.db: COUCHDB_SERVER_URL is not set. Ensure initializeDataLayer has been called with valid configuration.`);if(ENV.COUCHDB_SERVER_PROTOCOL===`NOT_SET`||!ENV.COUCHDB_SERVER_PROTOCOL)throw Error(`CourseLookup.db: COUCHDB_SERVER_PROTOCOL is not set. Ensure initializeDataLayer has been called with valid configuration.`);let t=`${ENV.COUCHDB_SERVER_PROTOCOL}://${ENV.COUCHDB_SERVER_URL}/${courseLookupDBTitle}`,c={};ENV.COUCHDB_USERNAME&&ENV.COUCHDB_PASSWORD?(c.auth={username:ENV.COUCHDB_USERNAME,password:ENV.COUCHDB_PASSWORD},logger.info(`CourseLookup: Connecting to ${t} with authentication.`)):logger.info(`CourseLookup: Connecting to ${t} without authentication.`);try{return this._dbInstance=new pouchdb_setup_default(t,c),logger.info(`CourseLookup: Database instance created for ${courseLookupDBTitle}.`),this._dbInstance}catch(c){throw logger.error(`CourseLookup: Failed to create PouchDB instance for ${t}`,c),this._dbInstance=null,Error(`CourseLookup: Failed to initialize database connection: ${c instanceof Error?c.message:String(c)}`)}}static async add(t){return(await _CourseLookup._db.post({name:t})).id}static async addWithId(t,c,u){let d={_id:t,name:c};u&&(d.disambiguator=u),await _CourseLookup._db.put(d)}static async delete(t){let c=await _CourseLookup._db.get(t);return await _CourseLookup._db.remove(c)}static async allCourseWare(){return(await _CourseLookup._db.allDocs({include_docs:!0})).rows.map(t=>t.doc)}static async updateDisambiguator(t,c){let u=await _CourseLookup._db.get(t);return u.disambiguator=c,await _CourseLookup._db.put(u)}static async isCourse(t){try{return await _CourseLookup._db.get(t),!0}catch(t){return logger.info(`Courselookup failed:`,t),!1}}},_defineProperty$2(t,`_dbInstance`,null),t)}}),PipelineDebugger_exports={},__export(PipelineDebugger_exports,{buildRunReport:()=>buildRunReport,captureRun:()=>captureRun,clearRunHistory:()=>clearRunHistory,mountPipelineDebugger:()=>mountPipelineDebugger,pipelineDebugAPI:()=>pipelineDebugAPI,registerPipelineForDebug:()=>registerPipelineForDebug}),init_PipelineDebugger=__esm({"src/core/navigators/PipelineDebugger.ts"(){"use strict";init_navigators(),init_logger(),_activePipeline=null,MAX_RUNS=10,runHistory=[],DISCARDED_KEEP_TOP=25,_uiContainer=null,_selectedRunIndex=null,_cardSearchQuery=``,pipelineDebugAPI={get runs(){return[...runHistory]},showRun(t=0){if(runHistory.length===0){logger.info(`[Pipeline Debug] No runs captured yet.`);return}let c;if(typeof t==`number`){if(c=runHistory[t],!c){logger.info(`[Pipeline Debug] No run found at index ${t}. History length: ${runHistory.length}`);return}}else if(c=runHistory.find(c=>c.runId.endsWith(t)),!c){logger.info(`[Pipeline Debug] No run found matching ID '${t}'.`);return}printRunSummary(c)},showLastRun(){this.showRun(0)},showCard(t){for(let c of runHistory){let u=c.cards.find(c=>c.cardId===t);if(u){console.group(`\u{1F3B4} Card: ${t}`),logger.info(`Course: ${u.courseId}`),logger.info(`Origin: ${u.origin}`),logger.info(`Card ELO: ${u.cardElo??`unknown`} | User ELO: ${c.userElo??`unknown`}`),logger.info(`Final score: ${u.finalScore.toFixed(3)}`),logger.info(`Selected: ${u.selected?`Yes ✅`:`No ❌`}`),u.tags&&u.tags.length>0&&logger.info(`Tags (${u.tags.length}): ${u.tags.join(`, `)}`),logger.info(`Provenance:`),logger.info(formatProvenance(u.provenance)),console.groupEnd();return}}let c=runHistory.filter(t=>t.discardedTail&&t.discardedTail.count>0);c.length>0?logger.info(`[Pipeline Debug] Card '${t}' not found in retained cards. ${c.length} run(s) have discarded tails that were not retained \u2014 the card may have been a low-score candidate. See run.discardedTail for ranges.`):logger.info(`[Pipeline Debug] Card '${t}' not found in recent runs.`)},explainReviews(){if(runHistory.length===0){logger.info(`[Pipeline Debug] No runs captured yet.`);return}console.group(`📋 Review Selection Analysis`);for(let t of runHistory){console.group(`Run: ${t.courseId} @ ${t.timestamp.toLocaleTimeString()}`);let c=t.cards.filter(t=>t.origin===`review`),u=c.filter(t=>t.selected);if(c.length===0)logger.info(`❌ No reviews were generated. Check SRS logs for why.`);else if(u.length===0){logger.info(`\u26A0\uFE0F ${c.length} reviews generated but none selected.`),logger.info(`Possible reasons:`);let u=Math.max(...t.cards.filter(t=>t.origin===`new`&&t.selected).map(t=>t.finalScore),0),d=Math.max(...c.map(t=>t.finalScore),0);d<u&&logger.info(` - New cards scored higher (top new: ${u.toFixed(2)}, top review: ${d.toFixed(2)})`);let m=c.sort((t,c)=>c.finalScore-t.finalScore)[0];m&&(logger.info(` - Top review score: ${m.finalScore.toFixed(3)}`),logger.info(` - Its provenance:`),logger.info(formatProvenance(m.provenance)))}else{logger.info(`\u2705 ${u.length}/${c.length} reviews selected.`),logger.info(`Top selected review:`);let t=u.sort((t,c)=>c.finalScore-t.finalScore)[0];logger.info(formatProvenance(t.provenance))}console.groupEnd()}console.groupEnd()},showPrescribed(t){if(runHistory.length===0){logger.info(`[Pipeline Debug] No runs captured yet.`);return}let c=runHistory[0],u=c.cards.filter(t=>t.provenance.some(t=>t.strategy===`prescribed`));if(console.group(`\u{1F9ED} Prescribed Debug (${c.courseId})`),u.length===0){logger.info(`No prescribed-generated cards were present in the most recent run.`),console.groupEnd();return}let d=u.map(t=>{let c=t.provenance.find(t=>t.strategy===`prescribed`)?.reason??``,u=c.match(/group=([^;]+)/)?.[1]??`unknown`,d=c.match(/mode=([^;]+)/)?.[1]??`unknown`,m=c.match(/blocked=([^;]+)/)?.[1]??`unknown`,g=c.match(/blockedTargets=([^;]+)/)?.[1]??`none`,b=c.match(/supportCard=([^;]+)/)?.[1]??`none`,S=c.match(/supportTags=([^;]+)/)?.[1]??`none`,C=c.match(/multiplier=([^;]+)/)?.[1]??`unknown`;return{group:u,mode:d,supportSource:d===`discovered-support`?`discovered`:d===`support`?`authored`:`n/a`,cardId:t.cardId,selected:t.selected?`yes`:`no`,finalScore:t.finalScore.toFixed(3),blocked:m,blockedTargets:g,supportCard:b,supportTags:S,multiplier:C}}).filter(c=>!t||c.group===t).sort((t,c)=>Number(c.finalScore)-Number(t.finalScore));if(d.length===0){logger.info(`[Pipeline Debug] No prescribed cards matched group '${t}' in the most recent run.`),console.groupEnd();return}console.table(d);let m=d.filter(t=>t.selected===`yes`),g=new Set,b=new Set,S=new Set,C=new Set;for(let t of d)t.blockedTargets&&t.blockedTargets!==`none`&&t.blockedTargets.split(`|`).filter(Boolean).forEach(t=>g.add(t)),t.supportTags&&t.supportTags!==`none`&&t.supportTags.split(`|`).filter(Boolean).forEach(t=>b.add(t)),t.supportCard&&t.supportCard!==`none`&&(t.supportSource===`discovered`?C.add(t.supportCard):t.supportSource===`authored`&&S.add(t.supportCard));logger.info(`Prescribed cards in run: ${d.length}`),logger.info(`Selected prescribed cards: ${m.length}`),logger.info(`Blocked prescribed targets referenced: ${g.size>0?[...g].join(`, `):`none`}`),logger.info(`Resolved support tags referenced: ${b.size>0?[...b].join(`, `):`none`}`),logger.info(`Authored support cards emitted: ${S.size>0?[...S].join(`, `):`none`}`),logger.info(`Discovered support cards emitted: ${C.size>0?[...C].join(`, `):`none`}`),console.groupEnd()},listRuns(){if(runHistory.length===0){logger.info(`[Pipeline Debug] No runs captured yet.`);return}console.table(runHistory.map(t=>({id:t.runId.slice(-8),time:t.timestamp.toLocaleTimeString(),course:t.courseName||t.courseId.slice(0,8),generated:t.generatedCount,selected:t.finalCount,new:t.newSelected,reviews:t.reviewsSelected})))},export(){let t=JSON.stringify(runHistory,null,2);return logger.info(`[Pipeline Debug] Run history exported. Copy the returned string or use:`),logger.info(` copy(window.skuilder.pipeline.export())`),t},clear(){runHistory.length=0,logger.info(`[Pipeline Debug] Run history cleared.`)},showRegistry(){let t=getRegisteredNavigatorNames();if(t.length===0){logger.info(`[Pipeline Debug] Navigator registry is empty.`);return}console.group(`📦 Navigator Registry`),console.table(t.map(t=>{let c=getRegisteredNavigatorRole(t),u=NavigatorRoles[t];return{name:t,role:u||c||`⚠️ NONE`,source:u?`built-in`:c?`consumer`:`unclassified`,isGenerator:isGenerator(t),isFilter:isFilter(t)}})),console.groupEnd()},showStrategies(){if(this.showRegistry(),runHistory.length===0){logger.info(`[Pipeline Debug] No pipeline runs captured yet — cannot show strategy doc mapping.`);return}let t=runHistory[0];if(console.group(`🔌 Pipeline Strategy Mapping (last run)`),logger.info(`Generator: ${t.generatorName}`),t.generators&&t.generators.length>0)for(let c of t.generators)logger.info(` \u{1F4E5} ${c.name}: ${c.cardCount} cards (${c.newCount} new, ${c.reviewCount} reviews)`);if(t.filters.length>0){logger.info(`Filters:`);for(let c of t.filters)logger.info(` \u{1F538} ${c.name}: \u2191${c.boosted} \u2193${c.penalized} =${c.passed} \u2715${c.removed}`)}else logger.info(`Filters: (none)`);console.groupEnd()},async diagnoseCardSpace(t){return _activePipeline?_activePipeline.diagnoseCardSpace({threshold:t}):(logger.info(`[Pipeline Debug] No active pipeline. Run a session first.`),null)},async showTagElo(t){if(!_activePipeline){logger.info(`[Pipeline Debug] No active pipeline. Run a session first.`);return}let c=await _activePipeline.getTagEloStatus(t),u=Object.entries(c).sort(([t],[c])=>t.localeCompare(c));if(u.length===0){logger.info(`[Pipeline Debug] No tag ELO data found${t?` for pattern: ${t}`:``}.`);return}console.table(Object.fromEntries(u.map(([t,c])=>[t,{score:Math.round(c.score),count:c.count}])))},ui(){if(_uiContainer){document.body.removeChild(_uiContainer),_uiContainer=null;return}_uiContainer=document.createElement(`div`),_uiContainer.id=`sk-pipeline-debugger`,document.body.appendChild(_uiContainer),_selectedRunIndex===null&&runHistory.length>0&&(_selectedRunIndex=0),renderUI()},_selectRun(t){_selectedRunIndex=t,renderUI()},_setSearch(t){_cardSearchQuery=t,renderUI()},_copyConfig(t,c){let u=runHistory.find(c=>c.runId===t);if(!u)return;let d={runId:u.runId,timestamp:u.timestamp.toISOString(),courseId:u.courseId,courseName:u.courseName,hints:u.hints??null};copyTextToClipboard(JSON.stringify(d,null,2),c)},_copyResults(t,c){let u=runHistory.find(c=>c.runId===t);if(!u)return;let d=u.cards.filter(t=>t.selected).sort((t,c)=>c.finalScore-t.finalScore).map(t=>({cardId:t.cardId,generator:t.generator,origin:t.origin,score:Number(t.finalScore.toFixed(3)),topReason:t.provenance[0]?.reason??``})),m={runId:u.runId,label:u.hints?._label??null,finalCount:u.finalCount,newSelected:u.newSelected,reviewsSelected:u.reviewsSelected,selected:d};copyTextToClipboard(JSON.stringify(m,null,2),c)},help(){logger.info(`
324
+ \u26A0\uFE0F Detected clustering: max ${m} cards from same course in a row`),logger.info(`This suggests cards are sorted by score rather than round-robin by course.`)),console.groupEnd()}function mountSessionDebugger(){if(typeof window>`u`)return;let t=window;t.skuilder=t.skuilder||{},t.skuilder.session=sessionDebugAPI}var import___vite_browser_external,import___vite_browser_external$1,import___vite_browser_external$2,import_browser_ponyfill,import_browser_ponyfill$1,import_browser,_SessionController2,__defProp,__getOwnPropNames,__glob,__esm,__export,init_adminDB,init_classroomDB,init_SyncStrategy,isDevelopment,logger,init_logger,GuestUsername,log,DocType,DocTypePrefixes,init_types_legacy,init_util,pouchdb_setup_default,init_pouchdb_setup,init_dataDirectory,REVIEW_TIME_FORMAT,log2,init_userDBHelpers,Loggable,init_Loggable,UpdateQueue,init_updateQueue,UsrCrsData,init_user_course_relDB,CLIENT_CACHE,init_clientCache,AlreadyTaggedErr,init_courseAPI,courseLookupDBTitle,CourseLookup,init_courseLookupDB,PipelineDebugger_exports,_activePipeline,MAX_RUNS,runHistory,DISCARDED_KEEP_TOP,_uiContainer,_selectedRunIndex,_cardSearchQuery,pipelineDebugAPI,init_PipelineDebugger,CompositeGenerator_exports,AggregationMode,DEFAULT_AGGREGATION_MODE,FREQUENCY_BOOST_FACTOR,CompositeGenerator,init_CompositeGenerator,elo_exports,ELONavigator,init_elo,generators_exports,init_generators,prescribed_exports,DEFAULT_FRESHNESS_WINDOW,DEFAULT_MAX_DIRECT_PER_RUN,DEFAULT_MAX_SUPPORT_PER_RUN,DEFAULT_HIERARCHY_DEPTH,DEFAULT_MIN_COUNT,BASE_TARGET_SCORE,BASE_SUPPORT_SCORE,DISCOVERED_SUPPORT_SCORE,MAX_TARGET_MULTIPLIER,MAX_SUPPORT_MULTIPLIER,PRESCRIBED_DEBUG_VERSION,PrescribedCardsGenerator,init_prescribed,srs_exports,DEFAULT_HEALTHY_BACKLOG,MAX_BACKLOG_PRESSURE,SRSNavigator,init_srs,types_exports,init_types,globImport_generators,init_,DEFAULT_LEARNABLE_WEIGHT,init_contentNavigationStrategy,WeightedFilter_exports,WeightedFilter,init_WeightedFilter,eloDistance_exports,DEFAULT_HALF_LIFE,DEFAULT_MIN_MULTIPLIER,DEFAULT_MAX_MULTIPLIER,init_eloDistance,hierarchyDefinition_exports,DEFAULT_MIN_COUNT2,HierarchyDefinitionNavigator,init_hierarchyDefinition,userTagPreference_exports,UserTagPreferenceFilter,init_userTagPreference,filters_exports,init_filters,inferredPreferenceStub_exports,INFERRED_PREFERENCE_NAVIGATOR_STUB,init_inferredPreferenceStub,interferenceMitigator_exports,DEFAULT_MIN_COUNT3,DEFAULT_MIN_ELAPSED_DAYS,DEFAULT_INTERFERENCE_DECAY,InterferenceMitigatorNavigator,init_interferenceMitigator,relativePriority_exports,DEFAULT_PRIORITY,DEFAULT_PRIORITY_INFLUENCE,DEFAULT_COMBINE_MODE,RelativePriorityNavigator,init_relativePriority,types_exports2,init_types2,userGoalStub_exports,USER_GOAL_NAVIGATOR_STUB,init_userGoalStub,globImport_filters,init_2,init_gradient,MIN_OBSERVATIONS_FOR_UPDATE,LEARNING_RATE,MAX_WEIGHT_DELTA,MIN_R_SQUARED_FOR_GRADIENT,FLAT_GRADIENT_THRESHOLD,MAX_HISTORY_LENGTH,init_learning,init_signal,init_recording,MIN_SPREAD,MAX_SPREAD,MIN_WEIGHT,MAX_WEIGHT,init_orchestration,Pipeline_exports,VERBOSE_RESULTS,Pipeline,init_Pipeline,defaults_exports,init_defaults,PipelineAssembler_exports,PipelineAssembler,init_PipelineAssembler,globImport,init_3,navigators_exports,navigatorRegistry,Navigators,NavigatorRole,NavigatorRoles,ContentNavigator,init_navigators,CoursesDB,CourseDB,init_courseDB,classroomLookupDBTitle,CLASSROOM_CONFIG,ClassroomDBBase,StudentClassroomDB,TeacherClassroomDB,ClassroomLookupDB,init_classroomDB2,AdminDB,init_adminDB2,CourseSyncService_exports,DEFAULT_REPLICATION,CourseSyncService,init_CourseSyncService,init_auth,CouchDBSyncStrategy_exports,log3,CouchDBSyncStrategy,init_CouchDBSyncStrategy,isBrowser,GUEST_LOCAL_DB,localUserDB,pouchDBincludeCredentialsConfig,REVIEW_TIME_FORMAT2,init_couch,log4,BaseUser,userCoursesDoc,userClassroomsDoc,init_BaseUserDB,init_common,PouchDataLayerProvider_exports,CouchDataLayerProvider,init_PouchDataLayerProvider,pathUtils,nodeFS,StaticDataUnpacker,init_StaticDataUnpacker,StaticCourseDB,init_courseDB2,StaticCoursesDB,init_coursesDB,NoOpSyncStrategy,init_NoOpSyncStrategy,StaticDataLayerProvider_exports,StaticDataLayerProvider,init_StaticDataLayerProvider,NOT_SET,ENV,dataLayerInstance,init_factory,TagFilteredContentSource,init_TagFilteredContentSource,init_contentSource,init_courseDB3,init_dataLayerProvider,init_userDB,init_interfaces,init_user,init_strategyState,init_userOutcome,init_cardProcessor,init_types3,init_bulkImport,userDBDebugAPI,init_UserDBDebugger,init_core,duration,SrsService,EloService,ResponseProcessor,CardHydrationService,ItemQueue,CouchDBToStaticPacker,DEFAULT_MIGRATION_OPTIONS,FileSystemError,nodeFS2,nodeFS3,nodePath,StaticToCouchDBMigrator,QuotaRoundRobinMixer,MAX_RUNS2,runHistory2,mixerDebugAPI,activeController,OVERLAY_ID,POLL_MS,INLINE_THRESHOLD,SPINNER_FRAMES,spinnerFrame,overlayEl,pollHandle,expanded,activeSession,sessionHistory,MAX_HISTORY,sessionDebugAPI,SessionController,init_dist=__esmMin((()=>{init_defineProperty(),init_index_browser_es$5(),init_index_browser_es(),init_index_es(),import___vite_browser_external=__toESM$2(require___vite_browser_external(),1),import___vite_browser_external$1=__toESM$2(require___vite_browser_external(),1),import___vite_browser_external$2=__toESM$2(require___vite_browser_external(),1),init_moment(),init_dist$1(),init_esm_browser(),import_browser_ponyfill=__toESM$2(require_browser_ponyfill(),1),import_browser_ponyfill$1=__toESM$2(require_browser_ponyfill(),1),import_browser=__toESM$2(require_browser(),1),__defProp=Object.defineProperty,__getOwnPropNames=Object.getOwnPropertyNames,__glob=t=>c=>{var u=t[c];if(u)return u();throw Error(`Module not found in bundle: `+c)},__esm=(t,c)=>function __init(){return t&&(c=(0,t[__getOwnPropNames(t)[0]])(t=0)),c},__export=(t,c)=>{for(var u in c)__defProp(t,u,{get:c[u],enumerable:!0})},init_adminDB=__esm({"src/core/interfaces/adminDB.ts"(){"use strict";}}),init_classroomDB=__esm({"src/core/interfaces/classroomDB.ts"(){"use strict";}}),init_SyncStrategy=__esm({"src/impl/common/SyncStrategy.ts"(){"use strict";}}),init_logger=__esm({"src/util/logger.ts"(){"use strict";isDevelopment=typeof process<`u`&&process.env.NODE_ENV===`development`,logger={debug:(t,...c)=>{isDevelopment&&console.debug(`[DB:DEBUG] ${t}`,...c)},info:(t,...c)=>{console.info(`[DB:INFO] ${t}`,...c)},warn:(t,...c)=>{console.warn(`[DB:WARN] ${t}`,...c)},error:(t,...c)=>{console.error(`[DB:ERROR] ${t}`,...c)},log:(t,...c)=>{isDevelopment&&console.log(`[DB:LOG] ${t}`,...c)}}}}),init_types_legacy=__esm({"src/core/types/types-legacy.ts"(){"use strict";init_logger(),GuestUsername=`sk-guest-`,log=t=>{logger.log(t)},DocType=(t=>(t.DISPLAYABLE_DATA=`DISPLAYABLE_DATA`,t.CARD=`CARD`,t.DATASHAPE=`DATASHAPE`,t.QUESTIONTYPE=`QUESTION`,t.VIEW=`VIEW`,t.PEDAGOGY=`PEDAGOGY`,t.CARDRECORD=`CARDRECORD`,t.SCHEDULED_CARD=`SCHEDULED_CARD`,t.TAG=`TAG`,t.NAVIGATION_STRATEGY=`NAVIGATION_STRATEGY`,t.STRATEGY_STATE=`STRATEGY_STATE`,t.USER_OUTCOME=`USER_OUTCOME`,t.STRATEGY_LEARNING_STATE=`STRATEGY_LEARNING_STATE`,t))(DocType||{}),DocTypePrefixes={CARD:`c`,DISPLAYABLE_DATA:`dd`,TAG:`TAG`,CARDRECORD:`cardH`,SCHEDULED_CARD:`card_review_`,DATASHAPE:`DATASHAPE`,QUESTION:`QUESTION`,VIEW:`VIEW`,PEDAGOGY:`PEDAGOGY`,NAVIGATION_STRATEGY:`NAVIGATION_STRATEGY`,STRATEGY_STATE:`STRATEGY_STATE`,USER_OUTCOME:`USER_OUTCOME`,STRATEGY_LEARNING_STATE:`STRATEGY_LEARNING_STATE`}}}),init_util=__esm({"src/core/util/index.ts"(){"use strict";init_types_legacy()}}),init_pouchdb_setup=__esm({"src/impl/couch/pouchdb-setup.ts"(){"use strict";PouchDB.plugin(plugin$1),PouchDB.plugin(plugin),PouchDB.debug!==void 0&&PouchDB.debug.disable(),PouchDB.defaults({}),pouchdb_setup_default=PouchDB}}),init_dataDirectory=__esm({"src/util/dataDirectory.ts"(){"use strict";init_logger(),init_factory()}}),init_userDBHelpers=__esm({"src/impl/common/userDBHelpers.ts"(){"use strict";init_core(),init_logger(),init_pouchdb_setup(),init_dataDirectory(),REVIEW_TIME_FORMAT=`YYYY-MM-DD--kk:mm:ss-SSS`,log2=t=>{logger.info(t)}}}),init_Loggable=__esm({"src/util/Loggable.ts"(){"use strict";Loggable=class{log(...t){console.log(`LOG-${this._className}@${new Date}:`,...t)}error(...t){console.error(`ERROR-${this._className}@${new Date}:`,...t)}}}}),init_updateQueue=__esm({"src/impl/couch/updateQueue.ts"(){"use strict";init_Loggable(),init_logger(),UpdateQueue=class extends Loggable{update(t,c){return logger.debug(`Update requested on doc: ${t}`),this.pendingUpdates[t]?this.pendingUpdates[t].push(c):this.pendingUpdates[t]=[c],this.applyUpdates(t)}constructor(t,c){super(),_defineProperty$2(this,`_className`,`UpdateQueue`),_defineProperty$2(this,`pendingUpdates`,{}),_defineProperty$2(this,`inprogressUpdates`,{}),_defineProperty$2(this,`readDB`,void 0),_defineProperty$2(this,`writeDB`,void 0),this.readDB=t,this.writeDB=c||t,logger.debug(`UpdateQ initialized...`),this.readDB.info().then(t=>{logger.debug(`db info: ${JSON.stringify(t)}`)})}async applyUpdates(t){if(logger.debug(`Applying updates on doc: ${t}`),this.inprogressUpdates[t]){for(;this.inprogressUpdates[t];)await new Promise(t=>setTimeout(t,Math.random()*50));return this.applyUpdates(t)}else if(this.pendingUpdates[t]&&this.pendingUpdates[t].length>0){this.inprogressUpdates[t]=!0;let c=5;for(let c=0;c<5;c++)try{let c={...await this.readDB.get(t)},u=[...this.pendingUpdates[t]];for(let t of u)c=typeof t==`function`?{...c,...t(c)}:{...c,...t};if(await this.writeDB.put(c),this.pendingUpdates[t].splice(0,u.length),this.pendingUpdates[t].length===0)this.inprogressUpdates[t]=!1,delete this.inprogressUpdates[t];else return this.applyUpdates(t);return c}catch(u){if(u.name===`conflict`&&c<4)logger.warn(`Conflict on update for doc ${t}, retry #${c+1}`),await new Promise(t=>setTimeout(t,50*Math.random()));else if(u.name===`not_found`&&c===0)throw logger.warn(`Update failed for ${t} - does not exist. Throwing to caller.`),delete this.inprogressUpdates[t],u;else throw delete this.inprogressUpdates[t],this.pendingUpdates[t]&&delete this.pendingUpdates[t],logger.error(`Error on attemped update (retry ${c}): ${JSON.stringify(u)}`),u}throw Error(`UpdateQueue failed for doc ${t} after 5 retries.`)}else throw Error(`Empty Updates Queue Triggered`)}}}}),init_user_course_relDB=__esm({"src/impl/couch/user-course-relDB.ts"(){"use strict";init_logger(),UsrCrsData=class{constructor(t,c){_defineProperty$2(this,`user`,void 0),_defineProperty$2(this,`_courseId`,void 0),this.user=t,this._courseId=c}async getReviewsForcast(t){let c=hooks.utc().add(t,`days`);return this.getReviewstoDate(c)}async getPendingReviews(){let t=hooks.utc();return this.getReviewstoDate(t)}async getScheduledReviewCount(){return(await this.getPendingReviews()).length}async getCourseSettings(){let t=(await this.user.getCourseRegistrationsDoc()).courses.find(t=>t.courseID===this._courseId);return t&&t.settings?t.settings:(logger.warn(`no settings found during lookup on course ${this._courseId}`),{})}updateCourseSettings(t){`updateCourseSettings`in this.user&&this.user.updateCourseSettings(this._courseId,t)}async getStrategyState(t){return this.user.getStrategyState(this._courseId,t)}async putStrategyState(t,c){return this.user.putStrategyState(this._courseId,t,c)}async deleteStrategyState(t){return this.user.deleteStrategyState(this._courseId,t)}async getReviewstoDate(t){let c=await this.user.getPendingReviews(this._courseId);return logger.debug(`Fetching ${this.user.getUsername()}'s scheduled reviews for course ${this._courseId}.`),c.filter(c=>{let u=hooks.utc(c.reviewTime);return t.isAfter(u)})}}}}),init_clientCache=__esm({"src/impl/couch/clientCache.ts"(){"use strict";CLIENT_CACHE={}}}),init_courseAPI=__esm({"src/impl/couch/courseAPI.ts"(){"use strict";init_pouchdb_setup(),init_couch(),init_factory(),init_courseDB(),init_types_legacy(),init_common(),init_logger(),AlreadyTaggedErr=class extends Error{constructor(t){super(t),this.name=`AlreadyTaggedErr`}}}}),init_courseLookupDB=__esm({"src/impl/couch/courseLookupDB.ts"(){"use strict";var t;init_pouchdb_setup(),init_factory(),init_logger(),courseLookupDBTitle=`coursedb-lookup`,logger.debug(`COURSELOOKUP FILE RUNNING`),CourseLookup=(t=class _CourseLookup{static get _db(){if(this._dbInstance)return this._dbInstance;if(ENV.COUCHDB_SERVER_URL===`NOT_SET`||!ENV.COUCHDB_SERVER_URL)throw Error(`CourseLookup.db: COUCHDB_SERVER_URL is not set. Ensure initializeDataLayer has been called with valid configuration.`);if(ENV.COUCHDB_SERVER_PROTOCOL===`NOT_SET`||!ENV.COUCHDB_SERVER_PROTOCOL)throw Error(`CourseLookup.db: COUCHDB_SERVER_PROTOCOL is not set. Ensure initializeDataLayer has been called with valid configuration.`);let t=`${ENV.COUCHDB_SERVER_PROTOCOL}://${ENV.COUCHDB_SERVER_URL}/${courseLookupDBTitle}`,c={};ENV.COUCHDB_USERNAME&&ENV.COUCHDB_PASSWORD?(c.auth={username:ENV.COUCHDB_USERNAME,password:ENV.COUCHDB_PASSWORD},logger.info(`CourseLookup: Connecting to ${t} with authentication.`)):logger.info(`CourseLookup: Connecting to ${t} without authentication.`);try{return this._dbInstance=new pouchdb_setup_default(t,c),logger.info(`CourseLookup: Database instance created for ${courseLookupDBTitle}.`),this._dbInstance}catch(c){throw logger.error(`CourseLookup: Failed to create PouchDB instance for ${t}`,c),this._dbInstance=null,Error(`CourseLookup: Failed to initialize database connection: ${c instanceof Error?c.message:String(c)}`)}}static async add(t){return(await _CourseLookup._db.post({name:t})).id}static async addWithId(t,c,u){let d={_id:t,name:c};u&&(d.disambiguator=u),await _CourseLookup._db.put(d)}static async delete(t){let c=await _CourseLookup._db.get(t);return await _CourseLookup._db.remove(c)}static async allCourseWare(){return(await _CourseLookup._db.allDocs({include_docs:!0})).rows.map(t=>t.doc)}static async updateDisambiguator(t,c){let u=await _CourseLookup._db.get(t);return u.disambiguator=c,await _CourseLookup._db.put(u)}static async isCourse(t){try{return await _CourseLookup._db.get(t),!0}catch(t){return logger.info(`Courselookup failed:`,t),!1}}},_defineProperty$2(t,`_dbInstance`,null),t)}}),PipelineDebugger_exports={},__export(PipelineDebugger_exports,{buildRunReport:()=>buildRunReport,captureRun:()=>captureRun,clearRunHistory:()=>clearRunHistory,mountPipelineDebugger:()=>mountPipelineDebugger,pipelineDebugAPI:()=>pipelineDebugAPI,registerPipelineForDebug:()=>registerPipelineForDebug}),init_PipelineDebugger=__esm({"src/core/navigators/PipelineDebugger.ts"(){"use strict";init_navigators(),init_logger(),_activePipeline=null,MAX_RUNS=10,runHistory=[],DISCARDED_KEEP_TOP=25,_uiContainer=null,_selectedRunIndex=null,_cardSearchQuery=``,pipelineDebugAPI={get runs(){return[...runHistory]},showRun(t=0){if(runHistory.length===0){logger.info(`[Pipeline Debug] No runs captured yet.`);return}let c;if(typeof t==`number`){if(c=runHistory[t],!c){logger.info(`[Pipeline Debug] No run found at index ${t}. History length: ${runHistory.length}`);return}}else if(c=runHistory.find(c=>c.runId.endsWith(t)),!c){logger.info(`[Pipeline Debug] No run found matching ID '${t}'.`);return}printRunSummary(c)},showLastRun(){this.showRun(0)},showCard(t){for(let c of runHistory){let u=c.cards.find(c=>c.cardId===t);if(u){console.group(`\u{1F3B4} Card: ${t}`),logger.info(`Course: ${u.courseId}`),logger.info(`Origin: ${u.origin}`),logger.info(`Card ELO: ${u.cardElo??`unknown`} | User ELO: ${c.userElo??`unknown`}`),logger.info(`Final score: ${u.finalScore.toFixed(3)}`),logger.info(`Selected: ${u.selected?`Yes ✅`:`No ❌`}`),u.tags&&u.tags.length>0&&logger.info(`Tags (${u.tags.length}): ${u.tags.join(`, `)}`),logger.info(`Provenance:`),logger.info(formatProvenance(u.provenance)),console.groupEnd();return}}let c=runHistory.filter(t=>t.discardedTail&&t.discardedTail.count>0);c.length>0?logger.info(`[Pipeline Debug] Card '${t}' not found in retained cards. ${c.length} run(s) have discarded tails that were not retained \u2014 the card may have been a low-score candidate. See run.discardedTail for ranges.`):logger.info(`[Pipeline Debug] Card '${t}' not found in recent runs.`)},explainReviews(){if(runHistory.length===0){logger.info(`[Pipeline Debug] No runs captured yet.`);return}console.group(`📋 Review Selection Analysis`);for(let t of runHistory){console.group(`Run: ${t.courseId} @ ${t.timestamp.toLocaleTimeString()}`);let c=t.cards.filter(t=>t.origin===`review`),u=c.filter(t=>t.selected);if(c.length===0)logger.info(`❌ No reviews were generated. Check SRS logs for why.`);else if(u.length===0){logger.info(`\u26A0\uFE0F ${c.length} reviews generated but none selected.`),logger.info(`Possible reasons:`);let u=Math.max(...t.cards.filter(t=>t.origin===`new`&&t.selected).map(t=>t.finalScore),0),d=Math.max(...c.map(t=>t.finalScore),0);d<u&&logger.info(` - New cards scored higher (top new: ${u.toFixed(2)}, top review: ${d.toFixed(2)})`);let m=c.sort((t,c)=>c.finalScore-t.finalScore)[0];m&&(logger.info(` - Top review score: ${m.finalScore.toFixed(3)}`),logger.info(` - Its provenance:`),logger.info(formatProvenance(m.provenance)))}else{logger.info(`\u2705 ${u.length}/${c.length} reviews selected.`),logger.info(`Top selected review:`);let t=u.sort((t,c)=>c.finalScore-t.finalScore)[0];logger.info(formatProvenance(t.provenance))}console.groupEnd()}console.groupEnd()},showPrescribed(t){if(runHistory.length===0){logger.info(`[Pipeline Debug] No runs captured yet.`);return}let c=runHistory[0],u=c.cards.filter(t=>t.provenance.some(t=>t.strategy===`prescribed`));if(console.group(`\u{1F9ED} Prescribed Debug (${c.courseId})`),u.length===0){logger.info(`No prescribed-generated cards were present in the most recent run.`),console.groupEnd();return}let d=u.map(t=>{let c=t.provenance.find(t=>t.strategy===`prescribed`)?.reason??``,u=c.match(/group=([^;]+)/)?.[1]??`unknown`,d=c.match(/mode=([^;]+)/)?.[1]??`unknown`,m=c.match(/blocked=([^;]+)/)?.[1]??`unknown`,g=c.match(/blockedTargets=([^;]+)/)?.[1]??`none`,b=c.match(/supportCard=([^;]+)/)?.[1]??`none`,S=c.match(/supportTags=([^;]+)/)?.[1]??`none`,C=c.match(/multiplier=([^;]+)/)?.[1]??`unknown`;return{group:u,mode:d,supportSource:d===`discovered-support`?`discovered`:d===`support`?`authored`:`n/a`,cardId:t.cardId,selected:t.selected?`yes`:`no`,finalScore:t.finalScore.toFixed(3),blocked:m,blockedTargets:g,supportCard:b,supportTags:S,multiplier:C}}).filter(c=>!t||c.group===t).sort((t,c)=>Number(c.finalScore)-Number(t.finalScore));if(d.length===0){logger.info(`[Pipeline Debug] No prescribed cards matched group '${t}' in the most recent run.`),console.groupEnd();return}console.table(d);let m=d.filter(t=>t.selected===`yes`),g=new Set,b=new Set,S=new Set,C=new Set;for(let t of d)t.blockedTargets&&t.blockedTargets!==`none`&&t.blockedTargets.split(`|`).filter(Boolean).forEach(t=>g.add(t)),t.supportTags&&t.supportTags!==`none`&&t.supportTags.split(`|`).filter(Boolean).forEach(t=>b.add(t)),t.supportCard&&t.supportCard!==`none`&&(t.supportSource===`discovered`?C.add(t.supportCard):t.supportSource===`authored`&&S.add(t.supportCard));logger.info(`Prescribed cards in run: ${d.length}`),logger.info(`Selected prescribed cards: ${m.length}`),logger.info(`Blocked prescribed targets referenced: ${g.size>0?[...g].join(`, `):`none`}`),logger.info(`Resolved support tags referenced: ${b.size>0?[...b].join(`, `):`none`}`),logger.info(`Authored support cards emitted: ${S.size>0?[...S].join(`, `):`none`}`),logger.info(`Discovered support cards emitted: ${C.size>0?[...C].join(`, `):`none`}`),console.groupEnd()},listRuns(){if(runHistory.length===0){logger.info(`[Pipeline Debug] No runs captured yet.`);return}console.table(runHistory.map(t=>({id:t.runId.slice(-8),time:t.timestamp.toLocaleTimeString(),course:t.courseName||t.courseId.slice(0,8),generated:t.generatedCount,selected:t.finalCount,new:t.newSelected,reviews:t.reviewsSelected})))},export(){let t=JSON.stringify(runHistory,null,2);return logger.info(`[Pipeline Debug] Run history exported. Copy the returned string or use:`),logger.info(` copy(window.skuilder.pipeline.export())`),t},clear(){runHistory.length=0,logger.info(`[Pipeline Debug] Run history cleared.`)},showRegistry(){let t=getRegisteredNavigatorNames();if(t.length===0){logger.info(`[Pipeline Debug] Navigator registry is empty.`);return}console.group(`📦 Navigator Registry`),console.table(t.map(t=>{let c=getRegisteredNavigatorRole(t),u=NavigatorRoles[t];return{name:t,role:u||c||`⚠️ NONE`,source:u?`built-in`:c?`consumer`:`unclassified`,isGenerator:isGenerator(t),isFilter:isFilter(t)}})),console.groupEnd()},showStrategies(){if(this.showRegistry(),runHistory.length===0){logger.info(`[Pipeline Debug] No pipeline runs captured yet — cannot show strategy doc mapping.`);return}let t=runHistory[0];if(console.group(`🔌 Pipeline Strategy Mapping (last run)`),logger.info(`Generator: ${t.generatorName}`),t.generators&&t.generators.length>0)for(let c of t.generators)logger.info(` \u{1F4E5} ${c.name}: ${c.cardCount} cards (${c.newCount} new, ${c.reviewCount} reviews)`);if(t.filters.length>0){logger.info(`Filters:`);for(let c of t.filters)logger.info(` \u{1F538} ${c.name}: \u2191${c.boosted} \u2193${c.penalized} =${c.passed} \u2715${c.removed}`)}else logger.info(`Filters: (none)`);console.groupEnd()},async diagnoseCardSpace(t){return _activePipeline?_activePipeline.diagnoseCardSpace({threshold:t}):(logger.info(`[Pipeline Debug] No active pipeline. Run a session first.`),null)},async showTagElo(t){if(!_activePipeline){logger.info(`[Pipeline Debug] No active pipeline. Run a session first.`);return}let c=await _activePipeline.getTagEloStatus(t),u=Object.entries(c).sort(([t],[c])=>t.localeCompare(c));if(u.length===0){logger.info(`[Pipeline Debug] No tag ELO data found${t?` for pattern: ${t}`:``}.`);return}console.table(Object.fromEntries(u.map(([t,c])=>[t,{score:Math.round(c.score),count:c.count}])))},ui(){if(_uiContainer){document.body.removeChild(_uiContainer),_uiContainer=null;return}_uiContainer=document.createElement(`div`),_uiContainer.id=`sk-pipeline-debugger`,document.body.appendChild(_uiContainer),_selectedRunIndex===null&&runHistory.length>0&&(_selectedRunIndex=0),renderUI()},_selectRun(t){_selectedRunIndex=t,renderUI()},_setSearch(t){_cardSearchQuery=t,renderUI()},_copyConfig(t,c){let u=runHistory.find(c=>c.runId===t);if(!u)return;let d={runId:u.runId,timestamp:u.timestamp.toISOString(),courseId:u.courseId,courseName:u.courseName,hints:u.hints??null};copyTextToClipboard(JSON.stringify(d,null,2),c)},_copyResults(t,c){let u=runHistory.find(c=>c.runId===t);if(!u)return;let d=u.cards.filter(t=>t.selected).sort((t,c)=>c.finalScore-t.finalScore).map(t=>({cardId:t.cardId,generator:t.generator,origin:t.origin,score:Number(t.finalScore.toFixed(3)),topReason:t.provenance[0]?.reason??``})),m={runId:u.runId,label:u.hints?._label??null,finalCount:u.finalCount,newSelected:u.newSelected,reviewsSelected:u.reviewsSelected,selected:d};copyTextToClipboard(JSON.stringify(m,null,2),c)},help(){logger.info(`
325
325
  🔧 Pipeline Debug API
326
326
 
327
327
  Commands:
@@ -346,7 +346,7 @@ Example:
346
346
  window.skuilder.pipeline.showLastRun()
347
347
  window.skuilder.pipeline.showRun(1)
348
348
  await window.skuilder.pipeline.diagnoseCardSpace()
349
- `)}},mountPipelineDebugger()}}),CompositeGenerator_exports={},__export(CompositeGenerator_exports,{AggregationMode:()=>AggregationMode,default:()=>CompositeGenerator}),init_CompositeGenerator=__esm({"src/core/navigators/generators/CompositeGenerator.ts"(){"use strict";init_navigators(),init_logger(),AggregationMode=(t=>(t.MAX=`max`,t.AVERAGE=`average`,t.FREQUENCY_BOOST=`frequencyBoost`,t))(AggregationMode||{}),DEFAULT_AGGREGATION_MODE=`frequencyBoost`,FREQUENCY_BOOST_FACTOR=.1,CompositeGenerator=class _CompositeGenerator extends ContentNavigator{constructor(t,c=DEFAULT_AGGREGATION_MODE){if(super(),_defineProperty$2(this,`name`,`Composite Generator`),_defineProperty$2(this,`generators`,void 0),_defineProperty$2(this,`aggregationMode`,void 0),this.generators=t,this.aggregationMode=c,t.length===0)throw Error(`CompositeGenerator requires at least one generator`);logger.debug(`[CompositeGenerator] Created with ${t.length} generators, mode: ${c}`)}static async fromStrategies(t,c,u,d=DEFAULT_AGGREGATION_MODE){return new _CompositeGenerator(await Promise.all(u.map(u=>ContentNavigator.create(t,c,u))),d)}async getWeightedCards(t,c){if(!c)throw Error(`CompositeGenerator.getWeightedCards requires a GeneratorContext. It should be called via Pipeline, not directly.`);let u=await Promise.all(this.generators.map(u=>u.getWeightedCards(t,c))),d=[];u.forEach((t,c)=>{let u=t.cards,m=this.generators[c].name||`Generator ${c}`,g=u.filter(t=>t.provenance[0]?.reason?.includes(`new card`)),b=u.filter(t=>t.provenance[0]?.reason?.includes(`review`));if(u.length>0){let t=Math.max(...u.map(t=>t.score)).toFixed(2),c=[];g.length>0&&c.push(`${g.length} new`),b.length>0&&c.push(`${b.length} reviews`);let S=c.length>0?c.join(`, `):`${u.length} cards`;d.push(`${m}: ${S} (top: ${t})`)}else d.push(`${m}: 0 cards`)}),logger.info(`[Composite] Generator breakdown: ${d.join(` | `)}`);let m=new Map;u.forEach((t,u)=>{let d=t.cards,g=this.generators[u],b=g.learnable?.weight??1,S;if(g.learnable&&!g.staticWeight&&c.orchestration){let t=g.strategyId;t&&(b=c.orchestration.getEffectiveWeight(t,g.learnable),S=c.orchestration.getDeviation(t))}for(let t of d){t.provenance.length>0&&(t.provenance[0].effectiveWeight=b,t.provenance[0].deviation=S);let c=m.get(t.cardId)||[];c.push({card:t,weight:b}),m.set(t.cardId,c)}});let g=[];for(let[,t]of m){let c=t.map(t=>t.card),u=this.aggregateScores(t),d=Math.max(0,u),m=c.flatMap(t=>t.provenance),b=c[0].score,S=d>b?`boosted`:d<b?`penalized`:`passed`,C=this.buildAggregationReason(t,d);g.push({...c[0],score:d,provenance:[...m,{strategy:`composite`,strategyName:`Composite Generator`,strategyId:`COMPOSITE_GENERATOR`,action:S,score:d,reason:C}]})}return{cards:g.sort((t,c)=>c.score-t.score).slice(0,t),hints:mergeHints(u.map(t=>t.hints))}}buildAggregationReason(t,c){let u=t.map(t=>t.card),d=u.length,m=u.map(t=>t.score.toFixed(2)).join(`, `);if(d===1){let u=Math.abs(t[0].weight-1)>.001?` (w=${t[0].weight.toFixed(2)})`:``;return`Single generator, score ${c.toFixed(2)}${u}`}let g=u.map(t=>t.provenance[0]?.strategy||`unknown`).join(`, `);switch(this.aggregationMode){case`max`:return`Max of ${d} generators (${g}): scores [${m}] \u2192 ${c.toFixed(2)}`;case`average`:return`Weighted Avg of ${d} generators (${g}): scores [${m}] \u2192 ${c.toFixed(2)}`;case`frequencyBoost`:{let u=t.reduce((t,c)=>t+c.weight,0),m=t.reduce((t,c)=>t+c.card.score*c.weight,0),b=u>0?m/u:0,S=1+FREQUENCY_BOOST_FACTOR*(d-1);return`Frequency boost from ${d} generators (${g}): w-avg ${b.toFixed(2)} \xD7 ${S.toFixed(2)} \u2192 ${c.toFixed(2)}`}default:return`Aggregated from ${d} generators: ${c.toFixed(2)}`}}aggregateScores(t){let c=t.map(t=>t.card.score);switch(this.aggregationMode){case`max`:return Math.max(...c);case`average`:{let c=t.reduce((t,c)=>t+c.weight,0);return c===0?0:t.reduce((t,c)=>t+c.card.score*c.weight,0)/c}case`frequencyBoost`:{let c=t.reduce((t,c)=>t+c.weight,0),u=t.reduce((t,c)=>t+c.card.score*c.weight,0);return(c>0?u/c:0)*(1+FREQUENCY_BOOST_FACTOR*(t.length-1))}default:return c[0]}}}}}),elo_exports={},__export(elo_exports,{default:()=>ELONavigator}),init_elo=__esm({"src/core/navigators/generators/elo.ts"(){"use strict";init_navigators(),init_logger(),ELONavigator=class extends ContentNavigator{constructor(t,c,u){super(t,c,u),_defineProperty$2(this,`name`,void 0),this.name=u?.name||`ELO`}async getWeightedCards(t,c){let u;u=c?.userElo===void 0?toCourseElo((await this.user.getCourseRegDoc(this.course.getCourseID())).elo).global.score:c.userElo;let d=await this.user.getActiveCards(),m=(await this.course.getCardsCenteredAtELO({limit:t,elo:`user`},t=>!d.some(c=>t.cardID===c.cardID))).map(t=>({...t,status:`new`})).map(t=>{let c=t.elo??1e3,d=Math.abs(c-u),m=Math.max(0,1-d/500),g=m>0?Math.random()**(1/m):0;return{cardId:t.cardID,courseId:t.courseID,score:g,provenance:[{strategy:`elo`,strategyName:this.strategyName||this.name,strategyId:this.strategyId||`NAVIGATION_STRATEGY-ELO-default`,action:`generated`,score:g,reason:`ELO distance ${Math.round(d)} (card: ${Math.round(c)}, user: ${Math.round(u)}), raw ${m.toFixed(3)}, key ${g.toFixed(3)}`}]}});m.sort((t,c)=>c.score-t.score);let g=m.slice(0,t);if(g.length>0){let t=g.slice(0,3).map(t=>t.score.toFixed(2)).join(`, `);logger.info(`[ELO] Course ${this.course.getCourseID()}: ${g.length} new cards (top scores: ${t})`)}else logger.info(`[ELO] Course ${this.course.getCourseID()}: No new cards available`);return{cards:g}}}}}),generators_exports={},init_generators=__esm({"src/core/navigators/generators/index.ts"(){"use strict";}}),prescribed_exports={},__export(prescribed_exports,{default:()=>PrescribedCardsGenerator}),init_prescribed=__esm({"src/core/navigators/generators/prescribed.ts"(){"use strict";init_navigators(),init_logger(),DEFAULT_FRESHNESS_WINDOW=3,DEFAULT_MAX_DIRECT_PER_RUN=3,DEFAULT_MAX_SUPPORT_PER_RUN=3,DEFAULT_HIERARCHY_DEPTH=2,DEFAULT_MIN_COUNT=3,BASE_TARGET_SCORE=1,BASE_SUPPORT_SCORE=.8,DISCOVERED_SUPPORT_SCORE=12,MAX_TARGET_MULTIPLIER=8,MAX_SUPPORT_MULTIPLIER=4,PRESCRIBED_DEBUG_VERSION=`testversion-prescribed-v3`,PrescribedCardsGenerator=class extends ContentNavigator{constructor(t,c,u){super(t,c,u),_defineProperty$2(this,`name`,void 0),_defineProperty$2(this,`config`,void 0),this.name=u.name||`Prescribed Cards`,this.config=this.parseConfig(u.serializedData),logger.debug(`[Prescribed] Initialized with ${this.config.groups.length} groups and ${this.config.groups.reduce((t,c)=>t+c.targetCardIds.length,0)} targets`)}get strategyKey(){return`PrescribedProgress`}async getWeightedCards(t,c){if(this.config.groups.length===0||t<=0)return{cards:[]};let u=this.course.getCourseID(),d=await this.user.getActiveCards(),m=new Set(d.map(t=>t.cardID)),g=await this.user.getSeenCards(u).catch(()=>[]),b=new Set(g),S=await this.getStrategyState()??{updatedAt:isoNow(),groups:{}},C=await this.loadHierarchyConfigs(),w=await this.user.getCourseRegDoc(u).catch(()=>null),T=typeof w?.elo==`number`?w.elo:w?.elo?.global?.score??c?.userElo??1e3,E=typeof w?.elo==`number`?{}:w?.elo?.tags??{},D=dedupe(this.config.groups.flatMap(t=>t.targetCardIds)),O=dedupe(this.config.groups.flatMap(t=>t.supportCardIds??[])),Or=dedupe([...D,...O]),kr=Or.length>0?await this.course.getAppliedTagsBatch(Or):new Map,Ar=await this.course.getCourseTagStubs().catch(()=>({rows:[],offset:0,total_rows:0})),jr=new Map;for(let t of Ar.rows??[]){let c=t.doc;c?.name&&Array.isArray(c.taggedCards)&&jr.set(c.name,[...c.taggedCards])}let Mr={updatedAt:isoNow(),groups:{}},Nr=[],Pr=new Set,Fr=[];for(let t of this.config.groups){let c=this.buildGroupRuntimeState({group:t,priorState:S.groups[t.id],activeIds:m,seenIds:b,tagsByCard:kr,cardsByTag:jr,hierarchyConfigs:C,userTagElo:E,userGlobalElo:T});Fr.push(c),logger.info(`[Prescribed] Group '${t.id}': ${t.targetCardIds.length} targets total, ${c.encounteredTargets.size} encountered, ${c.pendingTargets.length} pending (${c.surfaceableTargets.length} surfaceable, ${c.blockedTargets.length} blocked), ${c.supportCandidates.length} authored support candidates, ${c.discoveredSupportCandidates.length} discovered support candidates, pressure=${c.pressureMultiplier.toFixed(2)}`),c.blockedTargets.length>0&&(logger.info(`[Prescribed] Group '${t.id}' blocked targets: ${c.blockedTargets.join(`, `)}`),logger.info(`[Prescribed] Group '${t.id}' support tags needed: ${c.supportTags.join(`, `)||`(none)`}`),logger.info(`[Prescribed] Group '${t.id}' escalation mode: `+(c.supportCandidates.length>0?`direct-support`:c.discoveredSupportCandidates.length>0?`inserted-support-candidates`:`boost-only`)),c.discoveredSupportCandidates.length>0&&logger.info(`[Prescribed] Group '${t.id}' discovered support candidates: ${c.discoveredSupportCandidates.join(`, `)}`)),Mr.groups[t.id]=this.buildNextGroupState(c,S.groups[t.id]);let d=this.buildDirectTargetCards(c,u,Pr),g=this.buildSupportCards(c,u,Pr),w=this.buildDiscoveredSupportCards(c,u,Pr);Nr.push(...d,...g,...w)}let Ir=this.buildSupportHintSummary(Fr),Lr=Object.keys(Ir.boostTags).length>0?{boostTags:Ir.boostTags,_label:`prescribed-support (${Ir.supportTags.length} tags; blocked=${Ir.blockedTargetIds.length}; testversion=${PRESCRIBED_DEBUG_VERSION})`}:void 0;if(Lr){let t=Object.entries(Lr.boostTags??{});logger.info(`[Prescribed] Emitting ${t.length} boost hint(s): `+t.map(([t,c])=>`${t}\xD7${c.toFixed(1)}`).join(`, `))}else logger.info(`[Prescribed] No hints to emit (no blocked targets or no support tags)`);if(Nr.length===0)return logger.info(`[Prescribed] 0 cards emitted (all targets blocked, authored/discovered support candidates exhausted)`+(Lr?` — boost hints emitted but may not survive filters`:``)),await this.putStrategyState(Mr).catch(t=>{logger.debug(`[Prescribed] Failed to persist empty-state update: ${t}`)}),Lr?{cards:[],hints:Lr}:{cards:[]};let Rr=pickTopByScore(Nr,t),zr=new Map;for(let t of Rr){let c=t.provenance[0],u=c?.reason.match(/group=([^;]+)/)?.[1],d=c?.reason.includes(`mode=support`)?`supportIds`:`targetIds`;u&&(zr.has(u)||zr.set(u,{targetIds:[],supportIds:[]}),zr.get(u)[d].push(t.cardId))}for(let t of this.config.groups){let c=Mr.groups[t.id],u=zr.get(t.id);u&&(u.targetIds.length>0||u.supportIds.length>0)&&(c.lastSurfacedAt=isoNow(),c.sessionsSinceSurfaced=0,u.supportIds.length>0&&(c.lastSupportAt=isoNow()))}return await this.putStrategyState(Mr).catch(t=>{logger.debug(`[Prescribed] Failed to persist prescribed progress: ${t}`)}),logger.info(`[Prescribed] Emitting ${Rr.length} cards (${Rr.filter(t=>t.provenance[0]?.reason.includes(`mode=target`)).length} target, ${Rr.filter(t=>t.provenance[0]?.reason.includes(`mode=support`)).length} support, ${Rr.filter(t=>t.provenance[0]?.reason.includes(`mode=discovered-support`)).length} discovered support)`),Lr?{cards:Rr,hints:Lr}:{cards:Rr}}buildSupportHintSummary(t){let c={},u=new Set,d=new Set;for(let m of t)if(!(m.blockedTargets.length===0||m.supportTags.length===0)){m.blockedTargets.forEach(t=>u.add(t));for(let t of m.supportTags)d.add(t),c[t]=(c[t]??1)*m.supportMultiplier}return{boostTags:c,blockedTargetIds:[...u].sort(),supportTags:[...d].sort()}}parseConfig(t){try{let c=JSON.parse(t);return{groups:(Array.isArray(c.groups)?c.groups:[]).map((t,c)=>({id:typeof t.id==`string`&&t.id.trim().length>0?t.id:`group-${c+1}`,targetCardIds:dedupe(Array.isArray(t.targetCardIds)?t.targetCardIds.filter(t=>typeof t==`string`):[]),supportCardIds:dedupe(Array.isArray(t.supportCardIds)?t.supportCardIds.filter(t=>typeof t==`string`):[]),supportTagPatterns:dedupe(Array.isArray(t.supportTagPatterns)?t.supportTagPatterns.filter(t=>typeof t==`string`):[]),freshnessWindowSessions:typeof t.freshnessWindowSessions==`number`?t.freshnessWindowSessions:DEFAULT_FRESHNESS_WINDOW,maxDirectTargetsPerRun:typeof t.maxDirectTargetsPerRun==`number`?t.maxDirectTargetsPerRun:DEFAULT_MAX_DIRECT_PER_RUN,maxSupportCardsPerRun:typeof t.maxSupportCardsPerRun==`number`?t.maxSupportCardsPerRun:DEFAULT_MAX_SUPPORT_PER_RUN,hierarchyWalk:{enabled:t.hierarchyWalk?.enabled!==!1,maxDepth:typeof t.hierarchyWalk?.maxDepth==`number`?t.hierarchyWalk.maxDepth:DEFAULT_HIERARCHY_DEPTH},retireOnEncounter:t.retireOnEncounter!==!1})).filter(t=>t.targetCardIds.length>0)}}catch{return{groups:[]}}}async loadHierarchyConfigs(){try{return(await this.course.getAllNavigationStrategies()).filter(t=>t.implementingClass===`hierarchyDefinition`).map(t=>{try{return{prerequisites:JSON.parse(t.serializedData).prerequisites||{}}}catch{return{prerequisites:{}}}})}catch(t){return logger.debug(`[Prescribed] Failed to load hierarchy configs: ${t}`),[]}}buildGroupRuntimeState(t){let{group:c,priorState:u,activeIds:d,seenIds:m,tagsByCard:g,cardsByTag:b,hierarchyConfigs:S,userTagElo:C,userGlobalElo:w}=t,T=new Set;for(let t of c.targetCardIds)(d.has(t)||m.has(t))&&T.add(t);if(u?.encounteredCardIds?.length)for(let t of u.encounteredCardIds)T.add(t);let E=c.targetCardIds.filter(t=>!T.has(t)),D=new Map;for(let t of E)D.set(t,g.get(t)??[]);let O=[],Or=[],kr=new Set;for(let t of E){let u=D.get(t)??[],d=this.resolveBlockedSupportTags(u,S,C,w,c.hierarchyWalk?.enabled!==!1,c.hierarchyWalk?.maxDepth??DEFAULT_HIERARCHY_DEPTH),m=u.filter(t=>t.startsWith(`gpc:intro:`)),g=new Set(u.filter(t=>t.startsWith(`gpc:expose:`)));for(let t of m){let c=t.slice(10);c&&g.add(`gpc:expose:${c}`)}let b=[...g].filter(t=>{let c=C[t];return!c||c.count<DEFAULT_MIN_COUNT});b.length>0&&b.forEach(t=>kr.add(t)),d.blocked||b.length>0?(O.push(t),d.supportTags.forEach(t=>kr.add(t))):Or.push(t)}let Ar=dedupe([...c.supportCardIds??[],...this.findSupportCardsByTags(c,g,[...kr])]).filter(t=>!d.has(t)&&!m.has(t)),jr=O.length>0&&kr.size>0&&Ar.length===0?this.findDiscoveredSupportCards({supportTags:[...kr],cardsByTag:b,activeIds:d,seenIds:m,excludedIds:new Set([...c.targetCardIds,...c.supportCardIds??[]]),limit:c.maxSupportCardsPerRun??DEFAULT_MAX_SUPPORT_PER_RUN}):[];O.length>0&&kr.size>0&&jr.length===0&&logger.info(`[Prescribed] Group '${c.id}' discovered 0 broader support candidates (blocked=${O.length}; authoredSupport=${Ar.length})`);let Mr=u?.sessionsSinceSurfaced??0,Nr=c.freshnessWindowSessions??DEFAULT_FRESHNESS_WINDOW,Pr=Math.max(0,Mr-Nr),Fr=E.length===0?1:clamp(1+Pr*.75+Math.min(2,E.length*.1),1,MAX_TARGET_MULTIPLIER),Ir=O.length===0?1:clamp(1+Pr*.5+Math.min(1.5,O.length*.15),1,MAX_SUPPORT_MULTIPLIER);return{group:c,encounteredTargets:T,pendingTargets:E,blockedTargets:O,surfaceableTargets:Or,targetTags:D,supportCandidates:Ar,discoveredSupportCandidates:jr,supportTags:[...kr],pressureMultiplier:Fr,supportMultiplier:Ir,debugVersion:PRESCRIBED_DEBUG_VERSION}}buildNextGroupState(t,c){let u=c?.sessionsSinceSurfaced??0,d=!1;return{encounteredCardIds:[...t.encounteredTargets].sort(),pendingTargetIds:[...t.pendingTargets].sort(),lastSurfacedAt:c?.lastSurfacedAt??null,sessionsSinceSurfaced:u+1,lastSupportAt:c?.lastSupportAt??null,blockedTargetIds:[...t.blockedTargets].sort(),lastResolvedSupportTags:[...t.supportTags].sort()}}buildDirectTargetCards(t,c,u){let d=t.group.maxDirectTargetsPerRun??DEFAULT_MAX_DIRECT_PER_RUN,m=t.surfaceableTargets.filter(t=>!u.has(t)).slice(0,d),g=[];for(let d of m)u.add(d),g.push({cardId:d,courseId:c,score:BASE_TARGET_SCORE*t.pressureMultiplier,provenance:[{strategy:`prescribed`,strategyName:this.strategyName||this.name,strategyId:this.strategyId||`NAVIGATION_STRATEGY-prescribed`,action:`generated`,score:BASE_TARGET_SCORE*t.pressureMultiplier,reason:`mode=target;group=${t.group.id};pending=${t.pendingTargets.length};surfaceable=${t.surfaceableTargets.length};blocked=${t.blockedTargets.length};blockedTargets=${t.blockedTargets.join(`|`)||`none`};supportTags=${t.supportTags.join(`|`)||`none`};multiplier=${t.pressureMultiplier.toFixed(2)};testversion=${t.debugVersion}`}]});return g}buildSupportCards(t,c,u){if(t.blockedTargets.length===0||t.supportCandidates.length===0)return[];let d=t.group.maxSupportCardsPerRun??DEFAULT_MAX_SUPPORT_PER_RUN,m=t.supportCandidates.filter(t=>!u.has(t)).slice(0,d),g=[];for(let d of m)u.add(d),g.push({cardId:d,courseId:c,score:BASE_SUPPORT_SCORE*t.supportMultiplier,provenance:[{strategy:`prescribed`,strategyName:this.strategyName||this.name,strategyId:this.strategyId||`NAVIGATION_STRATEGY-prescribed`,action:`generated`,score:BASE_SUPPORT_SCORE*t.supportMultiplier,reason:`mode=support;group=${t.group.id};pending=${t.pendingTargets.length};blocked=${t.blockedTargets.length};blockedTargets=${t.blockedTargets.join(`|`)||`none`};supportCard=${d};supportTags=${t.supportTags.join(`|`)||`none`};multiplier=${t.supportMultiplier.toFixed(2)};testversion=${t.debugVersion}`}]});return g}buildDiscoveredSupportCards(t,c,u){if(t.blockedTargets.length===0||t.discoveredSupportCandidates.length===0)return[];let d=t.group.maxSupportCardsPerRun??DEFAULT_MAX_SUPPORT_PER_RUN,m=t.discoveredSupportCandidates.filter(t=>!u.has(t)).slice(0,d),g=[];for(let d of m)u.add(d),g.push({cardId:d,courseId:c,score:DISCOVERED_SUPPORT_SCORE*t.supportMultiplier,provenance:[{strategy:`prescribed`,strategyName:this.strategyName||this.name,strategyId:this.strategyId||`NAVIGATION_STRATEGY-prescribed`,action:`generated`,score:DISCOVERED_SUPPORT_SCORE*t.supportMultiplier,reason:`mode=discovered-support;group=${t.group.id};pending=${t.pendingTargets.length};blocked=${t.blockedTargets.length};blockedTargets=${t.blockedTargets.join(`|`)||`none`};supportCard=${d};supportTags=${t.supportTags.join(`|`)||`none`};multiplier=${t.supportMultiplier.toFixed(2)};testversion=${t.debugVersion}`}]});return g}findSupportCardsByTags(t,c,u){if(u.length===0)return[];let d=t.supportCardIds??[],m=t.supportTagPatterns??[];if(d.length===0&&m.length===0)return[];let g=new Set;for(let t of d){let d=c.get(t)??[],b=u.some(t=>d.includes(t)),S=m.some(t=>d.some(c=>matchesTagPattern(c,t)));(b||S)&&g.add(t)}return[...g]}findDiscoveredSupportCards(t){let{supportTags:c,cardsByTag:u,activeIds:d,seenIds:m,excludedIds:g,limit:b}=t,S=new Map;for(let t of c){let c=u.get(t)??[];for(let t of c){if(d.has(t)||m.has(t)||g.has(t))continue;let c=S.get(t);c?c.matches+=1:S.set(t,{cardId:t,matches:1})}}let C=[...S.values()].sort((t,c)=>c.matches-t.matches||t.cardId.localeCompare(c.cardId)),w=new Set,T=[],E=[];for(let t of C){let c=extractWordStem(t.cardId);w.has(c)?E.push(t):(w.add(c),T.push(t))}return shuffleInPlace(T),shuffleInPlace(E),[...T,...E].slice(0,b).map(t=>t.cardId)}resolveBlockedSupportTags(t,c,u,d,m,g){let b=new Set,S=!1;for(let C of t){let t=c.map(t=>t.prerequisites[C]).filter(t=>Array.isArray(t)&&t.length>0);if(t.length!==0&&t.some(t=>t.some(t=>!this.isPrerequisiteMet(t,u[t.tag],d)))){if(S=!0,!m){for(let c of t)for(let t of c)this.isPrerequisiteMet(t,u[t.tag],d)||b.add(t.tag);continue}for(let m of t)for(let t of m)this.isPrerequisiteMet(t,u[t.tag],d)||this.collectSupportTagsRecursive(t.tag,c,u,d,g,new Set,b)}}return{blocked:S,supportTags:[...b]}}collectSupportTagsRecursive(t,c,u,d,m,g,b){if(m<0||g.has(t))return;g.add(t);let S=!1;for(let C of c){let w=C.prerequisites[t];if(!w||w.length===0)continue;let T=w.filter(t=>!this.isPrerequisiteMet(t,u[t.tag],d));if(T.length>0&&m>0){S=!0;for(let t of T)this.collectSupportTagsRecursive(t.tag,c,u,d,m-1,g,b)}}S||b.add(t)}isPrerequisiteMet(t,c,u){if(!c)return!1;let d=t.masteryThreshold?.minCount??DEFAULT_MIN_COUNT;return c.count<d?!1:t.masteryThreshold?.minElo===void 0?t.masteryThreshold?.minCount===void 0?c.score>=u:!0:c.score>=t.masteryThreshold.minElo}}}}),srs_exports={},__export(srs_exports,{default:()=>SRSNavigator}),init_srs=__esm({"src/core/navigators/generators/srs.ts"(){"use strict";init_navigators(),init_logger(),DEFAULT_HEALTHY_BACKLOG=20,MAX_BACKLOG_PRESSURE=.5,SRSNavigator=class extends ContentNavigator{constructor(t,c,u){super(t,c,u),_defineProperty$2(this,`name`,void 0),_defineProperty$2(this,`healthyBacklog`,void 0),this.name=u?.name||`SRS`,this.healthyBacklog=this.parseConfig(u?.serializedData).healthyBacklog??DEFAULT_HEALTHY_BACKLOG}parseConfig(t){if(!t)return{};try{return JSON.parse(t)}catch{return logger.warn(`[SRS] Failed to parse strategy config, using defaults`),{}}}async getWeightedCards(t,c){if(!this.user||!this.course)throw Error(`SRSNavigator requires user and course to be set`);let u=this.course.getCourseID(),d=await this.user.getPendingReviews(u),m=hooks.utc(),g=d.filter(t=>m.isAfter(hooks.utc(t.reviewTime)));if(g.length>0){let t=[...new Set(g.map(t=>t.cardId))],c=await this.course.getAppliedTagsBatch(t),u=[];if(g=g.filter(t=>(c.get(t.cardId)??[]).includes(`srs:skip`)?(u.push(t._id),!1):!0),u.length>0){logger.info(`[SRS] Removing ${u.length} scheduled reviews for srs:skip cards`);for(let t of u)this.user.removeScheduledCardReview(t)}}let b=this.computeBacklogPressure(g.length);if(g.length>0){let t=b>0?` [backlog pressure: +${b.toFixed(2)}]`:` [healthy backlog]`;logger.info(`[SRS] Course ${u}: ${g.length} reviews due now (of ${d.length} scheduled)${t}`)}else if(d.length>0){let t=[...d].sort((t,c)=>hooks.utc(t.reviewTime).diff(hooks.utc(c.reviewTime)))[0],c=hooks.utc(t.reviewTime),g=hooks.duration(c.diff(m)),b=g.asHours()<1?`${Math.round(g.asMinutes())}m`:g.asHours()<24?`${Math.round(g.asHours())}h`:`${Math.round(g.asDays())}d`;logger.info(`[SRS] Course ${u}: 0 reviews due now (${d.length} scheduled, next in ${b})`)}else logger.info(`[SRS] Course ${u}: No reviews scheduled`);return{cards:g.map(t=>{let{score:c,reason:u}=this.computeUrgencyScore(t,m,b);return{cardId:t.cardId,courseId:t.courseId,score:c,reviewID:t._id,provenance:[{strategy:`srs`,strategyName:this.strategyName||this.name,strategyId:this.strategyId||`NAVIGATION_STRATEGY-SRS-default`,action:`generated`,score:c,reason:u}]}}).sort((t,c)=>c.score-t.score).slice(0,t)}}computeBacklogPressure(t){if(t<=this.healthyBacklog)return 0;let c=(t-this.healthyBacklog)/this.healthyBacklog*(MAX_BACKLOG_PRESSURE/2);return Math.min(MAX_BACKLOG_PRESSURE,c)}computeUrgencyScore(t,c,u){let d=hooks.utc(t.scheduledAt),m=hooks.utc(t.reviewTime),g=Math.max(1,m.diff(d,`hours`)),b=c.diff(m,`hours`),S=b/g,C=.3+.7*Math.exp(-g/720),w=.5+(Math.min(1,Math.max(0,S))*.5+C*.5)*.45,T=Math.min(1,w+u),E=[`${Math.round(b)}h overdue`,`interval: ${Math.round(g)}h`,`relative: ${S.toFixed(2)}`,`recency: ${C.toFixed(2)}`];return u>0&&E.push(`backlog: +${u.toFixed(2)}`),E.push(`review`),{score:T,reason:E.join(`, `)}}}}}),types_exports={},init_types=__esm({"src/core/navigators/generators/types.ts"(){"use strict";}}),init_=__esm({'import("./generators/**/*") in src/core/navigators/index.ts'(){globImport_generators=__glob({"./generators/CompositeGenerator.ts":()=>Promise.resolve().then(()=>(init_CompositeGenerator(),CompositeGenerator_exports)),"./generators/elo.ts":()=>Promise.resolve().then(()=>(init_elo(),elo_exports)),"./generators/index.ts":()=>Promise.resolve().then(()=>(init_generators(),generators_exports)),"./generators/prescribed.ts":()=>Promise.resolve().then(()=>(init_prescribed(),prescribed_exports)),"./generators/srs.ts":()=>Promise.resolve().then(()=>(init_srs(),srs_exports)),"./generators/types.ts":()=>Promise.resolve().then(()=>(init_types(),types_exports))})}}),init_contentNavigationStrategy=__esm({"src/core/types/contentNavigationStrategy.ts"(){"use strict";DEFAULT_LEARNABLE_WEIGHT={weight:1,confidence:.1,sampleSize:0}}}),WeightedFilter_exports={},__export(WeightedFilter_exports,{WeightedFilter:()=>WeightedFilter}),init_WeightedFilter=__esm({"src/core/navigators/filters/WeightedFilter.ts"(){"use strict";init_contentNavigationStrategy(),WeightedFilter=class{constructor(t,c=DEFAULT_LEARNABLE_WEIGHT,u=!1,d){_defineProperty$2(this,`name`,void 0),_defineProperty$2(this,`inner`,void 0),_defineProperty$2(this,`learnable`,void 0),_defineProperty$2(this,`staticWeight`,void 0),_defineProperty$2(this,`strategyId`,void 0),this.inner=t,this.name=t.name,this.learnable=c,this.staticWeight=u,this.strategyId=d}async transform(t,c){let u=this.learnable.weight,d;if(!this.staticWeight&&c.orchestration){let t=this.strategyId||this.inner.strategyId||this.name;u=c.orchestration.getEffectiveWeight(t,this.learnable),d=c.orchestration.getDeviation(t)}if(Math.abs(u-1)<.001)return this.inner.transform(t,c);let m=new Map;for(let c of t)m.set(c.cardId,c.score);return(await this.inner.transform(t,c)).map(t=>{let c=m.get(t.cardId);if(c===void 0||c===0||t.score===0)return t;let g=t.score/c;if(Math.abs(g-1)<1e-4)return t;let b=c*g**+u,S=t.provenance.length-1,C=t.provenance[S];if(C){let c=[...t.provenance];return c[S]={...C,score:b,effectiveWeight:u,deviation:d},{...t,score:b,provenance:c}}return{...t,score:b}})}}}}),eloDistance_exports={},__export(eloDistance_exports,{DEFAULT_HALF_LIFE:()=>DEFAULT_HALF_LIFE,DEFAULT_MAX_MULTIPLIER:()=>DEFAULT_MAX_MULTIPLIER,DEFAULT_MIN_MULTIPLIER:()=>DEFAULT_MIN_MULTIPLIER,createEloDistanceFilter:()=>createEloDistanceFilter}),init_eloDistance=__esm({"src/core/navigators/filters/eloDistance.ts"(){"use strict";DEFAULT_HALF_LIFE=200,DEFAULT_MIN_MULTIPLIER=.3,DEFAULT_MAX_MULTIPLIER=1}}),hierarchyDefinition_exports={},__export(hierarchyDefinition_exports,{default:()=>HierarchyDefinitionNavigator}),init_hierarchyDefinition=__esm({"src/core/navigators/filters/hierarchyDefinition.ts"(){"use strict";init_navigators(),init_logger(),DEFAULT_MIN_COUNT2=3,HierarchyDefinitionNavigator=class extends ContentNavigator{constructor(t,c,u){super(t,c,u),_defineProperty$2(this,`config`,void 0),_defineProperty$2(this,`name`,void 0),this.config=this.parseConfig(u.serializedData),this.name=u.name||`Hierarchy Definition`}parseConfig(t){try{return{prerequisites:JSON.parse(t).prerequisites||{}}}catch{return{prerequisites:{}}}}isPrerequisiteMet(t,c,u){if(!c)return!1;let d=t.masteryThreshold?.minCount??DEFAULT_MIN_COUNT2;return c.count<d?!1:t.masteryThreshold?.minElo===void 0?t.masteryThreshold?.minCount===void 0?c.score>=u:!0:c.score>=t.masteryThreshold.minElo}async getMasteredTags(t){let c=new Set;try{let u=toCourseElo((await t.user.getCourseRegDoc(t.course.getCourseID())).elo);for(let t of Object.values(this.config.prerequisites))for(let d of t){let t=u.tags[d.tag];this.isPrerequisiteMet(d,t,u.global.score)&&c.add(d.tag)}}catch{}return c}getUnlockedTags(t){let c=new Set;for(let[u,d]of Object.entries(this.config.prerequisites))d.every(c=>t.has(c.tag))&&c.add(u);return c}hasPrerequisites(t){return t in this.config.prerequisites}async checkCardUnlock(t,c,u,d){try{let c=t.tags??[],m=c.filter(t=>this.hasPrerequisites(t)&&!u.has(t));return m.length===0?{isUnlocked:!0,reason:`Prerequisites met, tags: ${c.length>0?c.join(`, `):`none`}`}:{isUnlocked:!1,reason:`Blocked: missing prerequisites ${m.flatMap(t=>(this.config.prerequisites[t]||[]).filter(t=>!d.has(t.tag)).map(t=>t.tag)).join(`, `)} for tags ${m.join(`, `)}`}}catch{return{isUnlocked:!0,reason:`Prerequisites check skipped (tag lookup failed)`}}}getPreReqBoosts(t,c){let u=new Map;for(let[d,m]of Object.entries(this.config.prerequisites))if(!t.has(d))for(let t of m){if(!t.preReqBoost||t.preReqBoost<=1||c.has(t.tag))continue;let d=u.get(t.tag)??1;u.set(t.tag,Math.max(d,t.preReqBoost))}return u}getTargetBoosts(t){let c=new Map,u=Object.keys(this.config.prerequisites),d=[...t];logger.info(`[HierarchyDefinition:targetBoost:trace] ${this.name} | configKeys=${u.length}, unlocked=${d.length} (${d.slice(0,5).join(`, `)}${d.length>5?`...`:``})`);for(let[u,d]of Object.entries(this.config.prerequisites))if(t.has(u)){logger.info(`[HierarchyDefinition:targetBoost:trace] UNLOCKED ${u}: ${d.length} prereqs, raw=${JSON.stringify(d.map(t=>({tag:t.tag,tb:t.targetBoost})))}`);for(let t of d){if(!t.targetBoost||t.targetBoost<=1)continue;let d=c.get(u)??1;c.set(u,Math.max(d,t.targetBoost))}}return c.size>0?logger.info(`[HierarchyDefinition] targetBoosts active: ${[...c.entries()].map(([t,c])=>`${t}=\xD7${c}`).join(`, `)}`):logger.info(`[HierarchyDefinition:targetBoost:trace] no targetBoosts found despite ${d.length} unlocked tags`),c}async transform(t,c){let u=await this.getMasteredTags(c),d=this.getUnlockedTags(u),m=this.getPreReqBoosts(d,u),g=this.getTargetBoosts(d),b=[];for(let S of t){let{isUnlocked:t,reason:C}=await this.checkCardUnlock(S,c.course,d,u),w=t?S.score:S.score*.02,T=t?`passed`:`penalized`,E=C;if(t&&m.size>0){let t=S.tags??[],c=1,u=[];for(let d of t){let t=m.get(d);t&&t>c&&(c=t,u.push(d))}c>1&&(w*=c,T=`boosted`,E=`${C} | preReqBoost \xD7${c.toFixed(2)} for ${u.join(`, `)}`,logger.info(`[HierarchyDefinition] preReqBoost \xD7${c.toFixed(2)} applied to card ${S.cardId} via tags [${u.join(`, `)}] (score: ${S.score.toFixed(3)} \u2192 ${w.toFixed(3)})`))}if(t&&g.size>0){let t=S.tags??[],c=1,u=[];for(let d of t){let t=g.get(d);t&&t>c&&(c=t,u.push(d))}c>1&&(w*=c,T=`boosted`,E=`${E} | targetBoost \xD7${c.toFixed(2)} for ${u.join(`, `)}`,logger.info(`[HierarchyDefinition] targetBoost \xD7${c.toFixed(2)} applied to card ${S.cardId} via tags [${u.join(`, `)}] (score: ${S.score.toFixed(3)} \u2192 ${w.toFixed(3)})`))}b.push({...S,score:w,provenance:[...S.provenance,{strategy:`hierarchyDefinition`,strategyName:this.strategyName||this.name,strategyId:this.strategyId||`NAVIGATION_STRATEGY-hierarchy`,action:T,score:w,reason:E}]})}return b}async getWeightedCards(t){throw Error(`HierarchyDefinitionNavigator is a filter and should not be used as a generator. Use Pipeline with a generator and this filter via transform().`)}}}}),userTagPreference_exports={},__export(userTagPreference_exports,{default:()=>UserTagPreferenceFilter}),init_userTagPreference=__esm({"src/core/navigators/filters/userTagPreference.ts"(){"use strict";init_navigators(),UserTagPreferenceFilter=class extends ContentNavigator{constructor(t,c,u){super(t,c,u),_defineProperty$2(this,`_strategyData`,void 0),_defineProperty$2(this,`name`,void 0),this._strategyData=u,this.name=u.name||`User Tag Preferences`}computeMultiplier(t,c){let u=t.map(t=>c[t]).filter(t=>t!==void 0);return u.length===0?1:Math.max(...u)}buildReason(t,c,u){let d=t.filter(t=>c[t]===u);return u===0?`Excluded by user preference: ${d.join(`, `)} (${u}x)`:u<1?`Penalized by user preference: ${d.join(`, `)} (${u.toFixed(2)}x)`:u>1?`Boosted by user preference: ${d.join(`, `)} (${u.toFixed(2)}x)`:`No matching user preferences`}async transform(t,c){let u=await this.getStrategyState();return!u||Object.keys(u.boost).length===0?t.map(t=>({...t,provenance:[...t.provenance,{strategy:`userTagPreference`,strategyName:this.strategyName||this.name,strategyId:this.strategyId||this._strategyData._id,action:`passed`,score:t.score,reason:`No user tag preferences configured`}]})):await Promise.all(t.map(async t=>{let c=t.tags??[],d=this.computeMultiplier(c,u.boost),m=Math.min(1,t.score*d),g;return g=d===0||d<1?`penalized`:d>1?`boosted`:`passed`,{...t,score:m,provenance:[...t.provenance,{strategy:`userTagPreference`,strategyName:this.strategyName||this.name,strategyId:this.strategyId||this._strategyData._id,action:g,score:m,reason:this.buildReason(c,u.boost,d)}]}}))}async getWeightedCards(t){throw Error(`UserTagPreferenceFilter is a filter and should not be used as a generator. Use Pipeline with a generator and this filter via transform().`)}}}}),filters_exports={},__export(filters_exports,{UserTagPreferenceFilter:()=>UserTagPreferenceFilter,createEloDistanceFilter:()=>createEloDistanceFilter}),init_filters=__esm({"src/core/navigators/filters/index.ts"(){"use strict";init_eloDistance(),init_userTagPreference()}}),inferredPreferenceStub_exports={},__export(inferredPreferenceStub_exports,{INFERRED_PREFERENCE_NAVIGATOR_STUB:()=>INFERRED_PREFERENCE_NAVIGATOR_STUB}),init_inferredPreferenceStub=__esm({"src/core/navigators/filters/inferredPreferenceStub.ts"(){"use strict";INFERRED_PREFERENCE_NAVIGATOR_STUB=!0}}),interferenceMitigator_exports={},__export(interferenceMitigator_exports,{default:()=>InterferenceMitigatorNavigator}),init_interferenceMitigator=__esm({"src/core/navigators/filters/interferenceMitigator.ts"(){"use strict";init_navigators(),DEFAULT_MIN_COUNT3=10,DEFAULT_MIN_ELAPSED_DAYS=3,DEFAULT_INTERFERENCE_DECAY=.8,InterferenceMitigatorNavigator=class extends ContentNavigator{constructor(t,c,u){super(t,c,u),_defineProperty$2(this,`config`,void 0),_defineProperty$2(this,`name`,void 0),_defineProperty$2(this,`interferenceMap`,void 0),this.config=this.parseConfig(u.serializedData),this.interferenceMap=this.buildInterferenceMap(),this.name=u.name||`Interference Mitigator`}parseConfig(t){try{let c=JSON.parse(t),u=c.interferenceSets||[];return u.length>0&&Array.isArray(u[0])&&(u=u.map(t=>({tags:t}))),{interferenceSets:u,maturityThreshold:{minCount:c.maturityThreshold?.minCount??DEFAULT_MIN_COUNT3,minElo:c.maturityThreshold?.minElo,minElapsedDays:c.maturityThreshold?.minElapsedDays??DEFAULT_MIN_ELAPSED_DAYS},defaultDecay:c.defaultDecay??DEFAULT_INTERFERENCE_DECAY}}catch{return{interferenceSets:[],maturityThreshold:{minCount:DEFAULT_MIN_COUNT3,minElapsedDays:DEFAULT_MIN_ELAPSED_DAYS},defaultDecay:DEFAULT_INTERFERENCE_DECAY}}}buildInterferenceMap(){let t=new Map;for(let c of this.config.interferenceSets){let u=c.decay??this.config.defaultDecay??DEFAULT_INTERFERENCE_DECAY;for(let d of c.tags){t.has(d)||t.set(d,[]);let m=t.get(d);for(let t of c.tags)if(t!==d){let c=m.find(c=>c.partner===t);c?c.decay=Math.max(c.decay,u):m.push({partner:t,decay:u})}}}return t}async getImmatureTags(t){let c=new Set;try{let u=toCourseElo((await t.user.getCourseRegDoc(t.course.getCourseID())).elo),d=this.config.maturityThreshold?.minCount??DEFAULT_MIN_COUNT3,m=this.config.maturityThreshold?.minElo,g=(this.config.maturityThreshold?.minElapsedDays??DEFAULT_MIN_ELAPSED_DAYS)*2;for(let[t,b]of Object.entries(u.tags)){if(b.count===0)continue;let u=b.count<d,S=m!==void 0&&b.score<m,C=b.count<g;(u||S||C)&&c.add(t)}}catch{}return c}getTagsToAvoid(t){let c=new Map;for(let u of t){let d=this.interferenceMap.get(u);if(d){for(let{partner:u,decay:m}of d)if(!t.has(u)){let t=c.get(u)??0;c.set(u,Math.max(t,m))}}}return c}computeInterferenceEffect(t,c,u){if(c.size===0)return{multiplier:1,interferingTags:[],reason:`No interference detected`};let d=1,m=[];for(let u of t){let t=c.get(u);t!==void 0&&(m.push(u),d*=1-t)}if(m.length===0)return{multiplier:1,interferingTags:[],reason:`No interference detected`};let g=new Set;for(let t of m)for(let c of u)this.interferenceMap.get(c)?.some(c=>c.partner===t)&&g.add(c);let b=`Interferes with immature tags ${Array.from(g).join(`, `)} (tags: ${m.join(`, `)}, multiplier: ${d.toFixed(2)})`;return{multiplier:d,interferingTags:m,reason:b}}async transform(t,c){let u=await this.getImmatureTags(c),d=this.getTagsToAvoid(u),m=[];for(let c of t){let t=c.tags??[],{multiplier:g,reason:b}=this.computeInterferenceEffect(t,d,u),S=c.score*g,C=g<1?`penalized`:g>1?`boosted`:`passed`;m.push({...c,score:S,provenance:[...c.provenance,{strategy:`interferenceMitigator`,strategyName:this.strategyName||this.name,strategyId:this.strategyId||`NAVIGATION_STRATEGY-interference`,action:C,score:S,reason:b}]})}return m}async getWeightedCards(t){throw Error(`InterferenceMitigatorNavigator is a filter and should not be used as a generator. Use Pipeline with a generator and this filter via transform().`)}}}}),relativePriority_exports={},__export(relativePriority_exports,{default:()=>RelativePriorityNavigator}),init_relativePriority=__esm({"src/core/navigators/filters/relativePriority.ts"(){"use strict";init_navigators(),DEFAULT_PRIORITY=.5,DEFAULT_PRIORITY_INFLUENCE=.5,DEFAULT_COMBINE_MODE=`max`,RelativePriorityNavigator=class extends ContentNavigator{constructor(t,c,u){super(t,c,u),_defineProperty$2(this,`config`,void 0),_defineProperty$2(this,`name`,void 0),this.config=this.parseConfig(u.serializedData),this.name=u.name||`Relative Priority`}parseConfig(t){try{let c=JSON.parse(t);return{tagPriorities:c.tagPriorities||{},defaultPriority:c.defaultPriority??DEFAULT_PRIORITY,combineMode:c.combineMode??DEFAULT_COMBINE_MODE,priorityInfluence:c.priorityInfluence??DEFAULT_PRIORITY_INFLUENCE}}catch{return{tagPriorities:{},defaultPriority:DEFAULT_PRIORITY,combineMode:DEFAULT_COMBINE_MODE,priorityInfluence:DEFAULT_PRIORITY_INFLUENCE}}}getTagPriority(t){return this.config.tagPriorities[t]??this.config.defaultPriority??DEFAULT_PRIORITY}computeCardPriority(t){if(t.length===0)return this.config.defaultPriority??DEFAULT_PRIORITY;let c=t.map(t=>this.getTagPriority(t));switch(this.config.combineMode){case`max`:return Math.max(...c);case`min`:return Math.min(...c);case`average`:return c.reduce((t,c)=>t+c,0)/c.length;default:return Math.max(...c)}}computeBoostFactor(t){let c=this.config.priorityInfluence??DEFAULT_PRIORITY_INFLUENCE;return 1+(t-.5)*c}buildPriorityReason(t,c,u,d){if(t.length===0)return`No tags, neutral priority (${c.toFixed(2)})`;let m=t.slice(0,3).join(`, `),g=t.length>3?` (+${t.length-3} more)`:``;return u===1?`Neutral priority (${c.toFixed(2)}) for tags: ${m}${g}`:u>1?`High-priority tags: ${m}${g} (priority ${c.toFixed(2)} \u2192 boost ${u.toFixed(2)}x \u2192 ${d.toFixed(2)})`:`Low-priority tags: ${m}${g} (priority ${c.toFixed(2)} \u2192 reduce ${u.toFixed(2)}x \u2192 ${d.toFixed(2)})`}async transform(t,c){return await Promise.all(t.map(async t=>{let c=t.tags??[],u=this.computeCardPriority(c),d=this.computeBoostFactor(u),m=Math.max(0,t.score*d),g=d>1?`boosted`:d<1?`penalized`:`passed`,b=this.buildPriorityReason(c,u,d,m);return{...t,score:m,provenance:[...t.provenance,{strategy:`relativePriority`,strategyName:this.strategyName||this.name,strategyId:this.strategyId||`NAVIGATION_STRATEGY-priority`,action:g,score:m,reason:b}]}}))}async getWeightedCards(t){throw Error(`RelativePriorityNavigator is a filter and should not be used as a generator. Use Pipeline with a generator and this filter via transform().`)}}}}),types_exports2={},init_types2=__esm({"src/core/navigators/filters/types.ts"(){"use strict";}}),userGoalStub_exports={},__export(userGoalStub_exports,{USER_GOAL_NAVIGATOR_STUB:()=>USER_GOAL_NAVIGATOR_STUB}),init_userGoalStub=__esm({"src/core/navigators/filters/userGoalStub.ts"(){"use strict";USER_GOAL_NAVIGATOR_STUB=!0}}),init_2=__esm({'import("./filters/**/*") in src/core/navigators/index.ts'(){globImport_filters=__glob({"./filters/WeightedFilter.ts":()=>Promise.resolve().then(()=>(init_WeightedFilter(),WeightedFilter_exports)),"./filters/eloDistance.ts":()=>Promise.resolve().then(()=>(init_eloDistance(),eloDistance_exports)),"./filters/hierarchyDefinition.ts":()=>Promise.resolve().then(()=>(init_hierarchyDefinition(),hierarchyDefinition_exports)),"./filters/index.ts":()=>Promise.resolve().then(()=>(init_filters(),filters_exports)),"./filters/inferredPreferenceStub.ts":()=>Promise.resolve().then(()=>(init_inferredPreferenceStub(),inferredPreferenceStub_exports)),"./filters/interferenceMitigator.ts":()=>Promise.resolve().then(()=>(init_interferenceMitigator(),interferenceMitigator_exports)),"./filters/relativePriority.ts":()=>Promise.resolve().then(()=>(init_relativePriority(),relativePriority_exports)),"./filters/types.ts":()=>Promise.resolve().then(()=>(init_types2(),types_exports2)),"./filters/userGoalStub.ts":()=>Promise.resolve().then(()=>(init_userGoalStub(),userGoalStub_exports)),"./filters/userTagPreference.ts":()=>Promise.resolve().then(()=>(init_userTagPreference(),userTagPreference_exports))})}}),init_gradient=__esm({"src/core/orchestration/gradient.ts"(){"use strict";init_logger()}}),init_learning=__esm({"src/core/orchestration/learning.ts"(){"use strict";init_contentNavigationStrategy(),init_types_legacy(),init_logger(),MIN_OBSERVATIONS_FOR_UPDATE=10,LEARNING_RATE=.1,MAX_WEIGHT_DELTA=.3,MIN_R_SQUARED_FOR_GRADIENT=.05,FLAT_GRADIENT_THRESHOLD=.02,MAX_HISTORY_LENGTH=100}}),init_signal=__esm({"src/core/orchestration/signal.ts"(){"use strict";}}),init_recording=__esm({"src/core/orchestration/recording.ts"(){"use strict";init_signal(),init_types_legacy(),init_logger()}}),init_orchestration=__esm({"src/core/orchestration/index.ts"(){"use strict";init_logger(),init_gradient(),init_learning(),init_signal(),init_recording(),MIN_SPREAD=.1,MAX_SPREAD=.5,MIN_WEIGHT=.1,MAX_WEIGHT=3}}),Pipeline_exports={},__export(Pipeline_exports,{Pipeline:()=>Pipeline}),init_Pipeline=__esm({"src/core/navigators/Pipeline.ts"(){"use strict";init_navigators(),init_logger(),init_orchestration(),init_PipelineDebugger(),VERBOSE_RESULTS=!0,Pipeline=class extends ContentNavigator{constructor(t,c,u,d){super(),_defineProperty$2(this,`generator`,void 0),_defineProperty$2(this,`filters`,void 0),_defineProperty$2(this,`_cachedOrchestration`,null),_defineProperty$2(this,`_tagCache`,new Map),_defineProperty$2(this,`_ephemeralHints`,null),this.generator=t,this.filters=c,this.user=u,this.course=d,d.getCourseConfig().then(t=>{logger.debug(`[pipeline] Crated pipeline for ${t.name}`)}).catch(t=>{logger.error(`[pipeline] Failed to lookup courseCfg: ${t}`)}),logPipelineConfig(t,c),registerPipelineForDebug(this)}setEphemeralHints(t){this._ephemeralHints=t,logger.info(`[Pipeline] Ephemeral hints set: ${JSON.stringify(t)}`)}async getWeightedCards(t){let c=performance.now(),u=await this.buildContext(),d=performance.now(),m=500;logger.debug(`[Pipeline] Fetching 500 candidates from generator '${this.generator.name}'`);let g=await this.generator.getWeightedCards(500,u),b=g.cards,S=performance.now(),C=b.length;this._ephemeralHints=mergeHints2([this._ephemeralHints,g.hints])??null;let w;if(this.generator.generators){let t=new Map;for(let c of b){let u=c.provenance[0];if(u){let d=u.strategyName;t.has(d)||t.set(d,{cards:[]}),t.get(d).cards.push(c)}}w=Array.from(t.entries()).map(([t,c])=>{let u=c.cards.filter(t=>t.provenance[0]?.reason?.includes(`new card`)),d=c.cards.filter(t=>t.provenance[0]?.reason?.includes(`review`));return{name:t,cardCount:c.cards.length,newCount:u.length,reviewCount:d.length,topScore:Math.max(...c.cards.map(t=>t.score),0)}})}logger.debug(`[Pipeline] Generator returned ${C} candidates`),b=await this.hydrateTags(b);let T=performance.now(),E=[...b],D=this._ephemeralHints;if(D?.requireCards?.length){let t=new Set(E.map(t=>t.cardId)),c=D.requireCards.filter(c=>!c.includes(`*`)&&!t.has(c));if(c.length>0){let t=await this.course.getAppliedTagsBatch(c),u=this.course.getCourseID();for(let d of c)E.push({cardId:d,courseId:u,score:1,tags:t.get(d)??[],provenance:[]});logger.info(`[Pipeline] Pre-fetched ${c.length} required card(s) into pool: ${c.join(`, `)}`)}}let O=new Set(b.filter(t=>t.provenance.some(t=>t.strategy===`prescribed`)).map(t=>t.cardId)),Or=[];for(let t of this.filters){let c=b.length,d=new Map(b.map(t=>[t.cardId,t.score]));b=await t.transform(b,u);let m=0,g=0,S=0,C=c-b.length;for(let t of b){let c=d.get(t.cardId)??0;t.score>c?m++:t.score<c?g++:S++}if(Or.push({name:t.name,boosted:m,penalized:g,passed:S,removed:C}),O.size>0){let c=new Set(b.map(t=>t.cardId)),u=[...O].filter(t=>!c.has(t)),d=b.filter(t=>O.has(t.cardId)&&t.score===0).map(t=>t.cardId);(u.length>0||d.length>0)&&(logger.info(`[Pipeline] Filter '${t.name}' impact on prescribed cards: `+(u.length>0?`removed=[${u.join(`, `)}] `:``)+(d.length>0?`zeroed=[${d.join(`, `)}]`:``)),u.forEach(t=>O.delete(t)))}logger.debug(`[Pipeline] Filter '${t.name}': ${d.size} \u2192 ${b.length} cards (\u2191${m} \u2193${g} =${S})`)}b=b.filter(t=>t.score>0);let kr=this._ephemeralHints;kr&&(this._ephemeralHints=null,b=this.applyHints(b,kr,E)),b.sort((t,c)=>c.score-t.score);let Ar=performance.now(),jr=b.slice(0,t);logger.info(`[Pipeline:timing] total=${(Ar-c).toFixed(0)}ms (context=${(d-c).toFixed(0)} generate=${(S-d).toFixed(0)} hydrate=${(T-S).toFixed(0)} filter=${(Ar-T).toFixed(0)})`);let Mr=jr.slice(0,3).map(t=>t.score);logExecutionSummary(this.generator.name,C,this.filters.length,jr.length,Mr,Or),logResultCards(jr),logCardProvenance(jr,3);try{let t=await this.course?.getCourseConfig().then(t=>t.name).catch(()=>void 0);captureRun(buildRunReport(this.course?.getCourseID()||`unknown`,t,this.generator.name,w,C,Or,b,jr,u.userElo,kr??void 0))}catch(t){logger.debug(`[Pipeline] Failed to capture debug run: ${t}`)}return{cards:jr}}async hydrateTags(t){if(t.length===0)return t;let c=[];for(let u of t)this._tagCache.has(u.cardId)||c.push(u.cardId);if(c.length>0){let t=await this.course.getAppliedTagsBatch(c);for(let[c,u]of t)this._tagCache.set(c,u)}let u=new Map;for(let c of t)u.set(c.cardId,this._tagCache.get(c.cardId)??[]);return logTagHydration(t,u),t.map(t=>({...t,tags:this._tagCache.get(t.cardId)??[]}))}applyHints(t,c,u){let d=t.length;if(c.excludeCards?.length&&(t=t.filter(t=>!c.excludeCards.some(c=>globMatch(t.cardId,c)))),c.excludeTags?.length&&(t=t.filter(t=>!c.excludeTags.some(c=>cardMatchesTagPattern(t,c)))),c.boostTags)for(let[u,d]of Object.entries(c.boostTags))for(let m of t)cardMatchesTagPattern(m,u)&&(m.score*=d,m.provenance.push({strategy:`ephemeralHint`,strategyId:`ephemeral-hint`,strategyName:c._label?`Replan Hint (${c._label})`:`Replan Hint`,action:`boosted`,score:m.score,reason:`boostTag ${u} \xD7${d}`}));if(c.boostCards)for(let[u,d]of Object.entries(c.boostCards))for(let m of t)globMatch(m.cardId,u)&&(m.score*=d,m.provenance.push({strategy:`ephemeralHint`,strategyId:`ephemeral-hint`,strategyName:c._label?`Replan Hint (${c._label})`:`Replan Hint`,action:`boosted`,score:m.score,reason:`boostCard ${u} \xD7${d}`}));let m=new Set(t.map(t=>t.cardId)),g=new Map(t.map(t=>[t.cardId,t])),b=c._label?`Replan Hint (${c._label})`:`Replan Hint`,applyRequirement=(c,u)=>{let d=1/0,S=g.get(c.cardId);S?S.score<d&&(S.score=d,S.provenance.push({strategy:`ephemeralHint`,strategyId:`ephemeral-hint`,strategyName:b,action:`boosted`,score:d,reason:`${u} (upgrade to mandatory score)`})):(t.push({...c,score:d,provenance:[...c.provenance,{strategy:`ephemeralHint`,strategyId:`ephemeral-hint`,strategyName:b,action:`boosted`,score:d,reason:u}]}),m.add(c.cardId),g.set(c.cardId,t[t.length-1]))};if(c.requireCards?.length)for(let t of c.requireCards){for(let c of m)globMatch(c,t)&&applyRequirement(g.get(c),`requireCard ${t}`);for(let c of u)globMatch(c.cardId,t)&&applyRequirement(c,`requireCard ${t}`)}if(c.requireTags?.length)for(let t of c.requireTags){for(let c of m){let u=g.get(c);cardMatchesTagPattern(u,t)&&applyRequirement(u,`requireTag ${t}`)}for(let c of u)cardMatchesTagPattern(c,t)&&applyRequirement(c,`requireTag ${t}`)}return logger.info(`[Pipeline] Hints applied: ${d} \u2192 ${t.length} cards`),t}async buildContext(){let t=1e3;try{t=toCourseElo((await this.user.getCourseRegDoc(this.course.getCourseID())).elo).global.score}catch(t){logger.debug(`[Pipeline] Could not get user ELO, using default: ${t}`)}this._cachedOrchestration||(this._cachedOrchestration=await createOrchestrationContext(this.user,this.course));let c=this._cachedOrchestration;return{user:this.user,course:this.course,userElo:t,orchestration:c}}getCourseID(){return this.course.getCourseID()}async getOrchestrationContext(){return createOrchestrationContext(this.user,this.course)}getStrategyIds(){let t=[],extractId=t=>t.strategyId?t.strategyId:null,c=extractId(this.generator);c&&t.push(c),this.generator.generators&&Array.isArray(this.generator.generators)&&this.generator.generators.forEach(c=>{let u=extractId(c);u&&t.push(u)});for(let c of this.filters){let u=extractId(c);u&&t.push(u)}return[...new Set(t)]}async getTagEloStatus(t){let c=toCourseElo((await this.user.getCourseRegDoc(this.course.getCourseID())).elo),u={};if(t){let d=Array.isArray(t)?t:[t];for(let t of d){let d=globToRegex(t);for(let[t,m]of Object.entries(c.tags))d.test(t)&&(u[t]={score:m.score,count:m.count})}}else for(let[t,d]of Object.entries(c.tags))u[t]={score:d.score,count:d.count};return u}async diagnoseCardSpace(t){let c=t?.threshold??.1,u=performance.now(),d=await this.course.getAllCardIds(),m=d.map(t=>({cardId:t,courseId:this.course.getCourseID(),score:1,provenance:[]}));m=await this.hydrateTags(m);let g=await this.buildContext(),b=[];for(let t of this.filters){m=await t.transform(m,g);let u=m.filter(t=>t.score>=c).length;b.push({name:t.name,wellIndicated:u})}let S=m.filter(t=>t.score>=c),C=new Set(S.map(t=>t.cardId)),w;try{let t=this.course.getCourseID(),c=await this.user.getSeenCards(t);w=new Set(c)}catch{w=new Set}let T=S.filter(t=>!w.has(t.cardId)),E=new Map;for(let t of m){let u=t.cardId.split(`-`)[1]||`unknown`;E.has(u)||E.set(u,{total:0,wellIndicated:0,new:0});let d=E.get(u);d.total++,t.score>=c&&(d.wellIndicated++,w.has(t.cardId)||d.new++)}let D=performance.now()-u,O={totalCards:d.length,threshold:c,wellIndicated:C.size,encountered:w.size,wellIndicatedNew:T.length,byType:Object.fromEntries(E),filterBreakdown:b,elapsedMs:Math.round(D)};logger.info(`[Pipeline:diagnose] Card space scan (${O.elapsedMs}ms):`),logger.info(`[Pipeline:diagnose] Total cards: ${O.totalCards}`),logger.info(`[Pipeline:diagnose] Well-indicated (score >= ${c}): ${O.wellIndicated}`),logger.info(`[Pipeline:diagnose] Encountered: ${O.encountered}`),logger.info(`[Pipeline:diagnose] Well-indicated & new: ${O.wellIndicatedNew}`),logger.info(`[Pipeline:diagnose] By type:`);for(let[t,c]of E)logger.info(`[Pipeline:diagnose] ${t}: ${c.wellIndicated}/${c.total} well-indicated, ${c.new} new`);logger.info(`[Pipeline:diagnose] After each filter:`);for(let t of b)logger.info(`[Pipeline:diagnose] ${t.name}: ${t.wellIndicated} well-indicated`);return O}}}}),defaults_exports={},__export(defaults_exports,{createDefaultEloStrategy:()=>createDefaultEloStrategy,createDefaultPipeline:()=>createDefaultPipeline,createDefaultSrsStrategy:()=>createDefaultSrsStrategy}),init_defaults=__esm({"src/core/navigators/defaults.ts"(){"use strict";init_navigators(),init_Pipeline(),init_CompositeGenerator(),init_elo(),init_srs(),init_eloDistance(),init_types_legacy()}}),PipelineAssembler_exports={},__export(PipelineAssembler_exports,{PipelineAssembler:()=>PipelineAssembler}),init_PipelineAssembler=__esm({"src/core/navigators/PipelineAssembler.ts"(){"use strict";init_navigators(),init_WeightedFilter(),init_Pipeline(),init_logger(),init_CompositeGenerator(),init_defaults(),PipelineAssembler=class{async assemble(t){let{strategies:c,user:u,course:d}=t,m=[];if(c.length===0)return{pipeline:null,generatorStrategies:[],filterStrategies:[],warnings:m};let g=[],b=[];for(let t of c)isGenerator(t.implementingClass)?g.push(t):isFilter(t.implementingClass)?b.push(t):m.push(`Unknown strategy type '${t.implementingClass}', skipping: ${t.name}`);let S=d.getCourseID(),C=g.some(t=>t.implementingClass===`elo`),w=g.some(t=>t.implementingClass===`srs`);if(C||(logger.debug(`[PipelineAssembler] No ELO generator configured, adding default`),g.push(createDefaultEloStrategy(S))),w||(logger.debug(`[PipelineAssembler] No SRS generator configured, adding default`),g.push(createDefaultSrsStrategy(S))),g.length===0)return m.push(`No generator strategy found`),{pipeline:null,generatorStrategies:[],filterStrategies:[],warnings:m};let T;g.length===1?(T=await ContentNavigator.create(u,d,g[0]),logger.debug(`[PipelineAssembler] Using single generator: ${g[0].name}`)):(logger.debug(`[PipelineAssembler] Using CompositeGenerator for ${g.length} generators: ${g.map(t=>t.name).join(`, `)}`),T=await CompositeGenerator.fromStrategies(u,d,g));let E=[],D=[...b].sort((t,c)=>t.name.localeCompare(c.name));for(let t of D)try{let c=await ContentNavigator.create(u,d,t);if(`transform`in c&&typeof c.transform==`function`){let u=c;t.learnable&&(u=new WeightedFilter(u,t.learnable,t.staticWeight,t._id)),E.push(u),logger.debug(`[PipelineAssembler] Added filter: ${t.name}`)}else m.push(`Filter '${t.name}' does not implement CardFilter.transform(), skipping`)}catch(c){m.push(`Failed to instantiate filter '${t.name}': ${c}`)}let O=new Pipeline(T,E,u,d);return logger.debug(`[PipelineAssembler] Assembled pipeline with ${g.length} generator(s) and ${E.length} filter(s)`),{pipeline:O,generatorStrategies:g,filterStrategies:D,warnings:m}}}}}),init_3=__esm({'import("./**/*") in src/core/navigators/index.ts'(){globImport=__glob({"./Pipeline.ts":()=>Promise.resolve().then(()=>(init_Pipeline(),Pipeline_exports)),"./PipelineAssembler.ts":()=>Promise.resolve().then(()=>(init_PipelineAssembler(),PipelineAssembler_exports)),"./PipelineDebugger.ts":()=>Promise.resolve().then(()=>(init_PipelineDebugger(),PipelineDebugger_exports)),"./defaults.ts":()=>Promise.resolve().then(()=>(init_defaults(),defaults_exports)),"./filters/WeightedFilter.ts":()=>Promise.resolve().then(()=>(init_WeightedFilter(),WeightedFilter_exports)),"./filters/eloDistance.ts":()=>Promise.resolve().then(()=>(init_eloDistance(),eloDistance_exports)),"./filters/hierarchyDefinition.ts":()=>Promise.resolve().then(()=>(init_hierarchyDefinition(),hierarchyDefinition_exports)),"./filters/index.ts":()=>Promise.resolve().then(()=>(init_filters(),filters_exports)),"./filters/inferredPreferenceStub.ts":()=>Promise.resolve().then(()=>(init_inferredPreferenceStub(),inferredPreferenceStub_exports)),"./filters/interferenceMitigator.ts":()=>Promise.resolve().then(()=>(init_interferenceMitigator(),interferenceMitigator_exports)),"./filters/relativePriority.ts":()=>Promise.resolve().then(()=>(init_relativePriority(),relativePriority_exports)),"./filters/types.ts":()=>Promise.resolve().then(()=>(init_types2(),types_exports2)),"./filters/userGoalStub.ts":()=>Promise.resolve().then(()=>(init_userGoalStub(),userGoalStub_exports)),"./filters/userTagPreference.ts":()=>Promise.resolve().then(()=>(init_userTagPreference(),userTagPreference_exports)),"./generators/CompositeGenerator.ts":()=>Promise.resolve().then(()=>(init_CompositeGenerator(),CompositeGenerator_exports)),"./generators/elo.ts":()=>Promise.resolve().then(()=>(init_elo(),elo_exports)),"./generators/index.ts":()=>Promise.resolve().then(()=>(init_generators(),generators_exports)),"./generators/prescribed.ts":()=>Promise.resolve().then(()=>(init_prescribed(),prescribed_exports)),"./generators/srs.ts":()=>Promise.resolve().then(()=>(init_srs(),srs_exports)),"./generators/types.ts":()=>Promise.resolve().then(()=>(init_types(),types_exports)),"./index.ts":()=>Promise.resolve().then(()=>(init_navigators(),navigators_exports))})}}),navigators_exports={},__export(navigators_exports,{ContentNavigator:()=>ContentNavigator,NavigatorRole:()=>NavigatorRole,NavigatorRoles:()=>NavigatorRoles,Navigators:()=>Navigators,getCardOrigin:()=>getCardOrigin,getRegisteredNavigator:()=>getRegisteredNavigator,getRegisteredNavigatorNames:()=>getRegisteredNavigatorNames,getRegisteredNavigatorRole:()=>getRegisteredNavigatorRole,hasRegisteredNavigator:()=>hasRegisteredNavigator,initializeNavigatorRegistry:()=>initializeNavigatorRegistry,isFilter:()=>isFilter,isGenerator:()=>isGenerator,mountPipelineDebugger:()=>mountPipelineDebugger,pipelineDebugAPI:()=>pipelineDebugAPI,registerNavigator:()=>registerNavigator}),init_navigators=__esm({"src/core/navigators/index.ts"(){"use strict";init_PipelineDebugger(),init_logger(),init_(),init_2(),init_3(),navigatorRegistry=new Map,Navigators=(t=>(t.ELO=`elo`,t.SRS=`srs`,t.PRESCRIBED=`prescribed`,t.HIERARCHY=`hierarchyDefinition`,t.INTERFERENCE=`interferenceMitigator`,t.RELATIVE_PRIORITY=`relativePriority`,t.USER_TAG_PREFERENCE=`userTagPreference`,t))(Navigators||{}),NavigatorRole=(t=>(t.GENERATOR=`generator`,t.FILTER=`filter`,t))(NavigatorRole||{}),NavigatorRoles={elo:`generator`,srs:`generator`,prescribed:`generator`,hierarchyDefinition:`filter`,interferenceMitigator:`filter`,relativePriority:`filter`,userTagPreference:`filter`},ContentNavigator=class{constructor(t,c,u){_defineProperty$2(this,`user`,void 0),_defineProperty$2(this,`course`,void 0),_defineProperty$2(this,`strategyName`,void 0),_defineProperty$2(this,`strategyId`,void 0),_defineProperty$2(this,`learnable`,void 0),_defineProperty$2(this,`staticWeight`,void 0),this.user=t,this.course=c,u&&(this.strategyName=u.name,this.strategyId=u._id,this.learnable=u.learnable,this.staticWeight=u.staticWeight)}get strategyKey(){return this.constructor.name}async getStrategyState(){if(!this.user||!this.course)throw Error(`Cannot get strategy state: navigator not properly initialized. Ensure user and course are provided to constructor.`);return this.user.getStrategyState(this.course.getCourseID(),this.strategyKey)}async putStrategyState(t){if(!this.user||!this.course)throw Error(`Cannot put strategy state: navigator not properly initialized. Ensure user and course are provided to constructor.`);return this.user.putStrategyState(this.course.getCourseID(),this.strategyKey,t)}static async create(t,c,u){let d=u.implementingClass,m=getRegisteredNavigator(d);if(m)return logger.debug(`[ContentNavigator.create] Using registered navigator: ${d}`),new m(t,c,u);logger.debug(`[ContentNavigator.create] Navigator not in registry, attempting dynamic import: ${d}`);let g;for(let t of[`.ts`,`.js`,``]){try{if(g=(await globImport_generators(`./generators/${d}${t}`)).default,g)break}catch(c){logger.debug(`Failed to load generator ${d}${t}:`,c)}try{if(g=(await globImport_filters(`./filters/${d}${t}`)).default,g)break}catch(c){logger.debug(`Failed to load filter ${d}${t}:`,c)}try{if(g=(await globImport(`./${d}${t}`)).default,g)break}catch(c){logger.debug(`Failed to load legacy ${d}${t}:`,c)}if(g)break}if(!g)throw Error(`Could not load navigator implementation for: ${d}`);return new g(t,c,u)}async getWeightedCards(t){throw Error(`${this.constructor.name} must implement getWeightedCards(). `)}setEphemeralHints(t){}}}}),init_courseDB=__esm({"src/impl/couch/courseDB.ts"(){"use strict";init_couch(),init_updateQueue(),init_types_legacy(),init_logger(),init_clientCache(),init_courseAPI(),init_courseLookupDB(),init_navigators(),init_PipelineAssembler(),init_defaults(),CoursesDB=class{constructor(t){_defineProperty$2(this,`_courseIDs`,void 0),t&&t.length>0?this._courseIDs=t:this._courseIDs=void 0}async getCourseList(){let t=await CourseLookup.allCourseWare();return logger.debug(`AllCourses: ${t.map(t=>t.name+`, `+t._id+`
349
+ `)}},mountPipelineDebugger()}}),CompositeGenerator_exports={},__export(CompositeGenerator_exports,{AggregationMode:()=>AggregationMode,default:()=>CompositeGenerator}),init_CompositeGenerator=__esm({"src/core/navigators/generators/CompositeGenerator.ts"(){"use strict";init_navigators(),init_logger(),AggregationMode=(t=>(t.MAX=`max`,t.AVERAGE=`average`,t.FREQUENCY_BOOST=`frequencyBoost`,t))(AggregationMode||{}),DEFAULT_AGGREGATION_MODE=`frequencyBoost`,FREQUENCY_BOOST_FACTOR=.1,CompositeGenerator=class _CompositeGenerator extends ContentNavigator{constructor(t,c=DEFAULT_AGGREGATION_MODE){if(super(),_defineProperty$2(this,`name`,`Composite Generator`),_defineProperty$2(this,`generators`,void 0),_defineProperty$2(this,`aggregationMode`,void 0),this.generators=t,this.aggregationMode=c,t.length===0)throw Error(`CompositeGenerator requires at least one generator`);logger.debug(`[CompositeGenerator] Created with ${t.length} generators, mode: ${c}`)}static async fromStrategies(t,c,u,d=DEFAULT_AGGREGATION_MODE){return new _CompositeGenerator(await Promise.all(u.map(u=>ContentNavigator.create(t,c,u))),d)}async getWeightedCards(t,c){if(!c)throw Error(`CompositeGenerator.getWeightedCards requires a GeneratorContext. It should be called via Pipeline, not directly.`);let u=await Promise.all(this.generators.map(u=>u.getWeightedCards(t,c))),d=[];u.forEach((t,c)=>{let u=t.cards,m=this.generators[c].name||`Generator ${c}`,g=u.filter(t=>t.provenance[0]?.reason?.includes(`new card`)),b=u.filter(t=>t.provenance[0]?.reason?.includes(`review`));if(u.length>0){let t=Math.max(...u.map(t=>t.score)).toFixed(2),c=[];g.length>0&&c.push(`${g.length} new`),b.length>0&&c.push(`${b.length} reviews`);let S=c.length>0?c.join(`, `):`${u.length} cards`;d.push(`${m}: ${S} (top: ${t})`)}else d.push(`${m}: 0 cards`)}),logger.info(`[Composite] Generator breakdown: ${d.join(` | `)}`);let m=new Map;u.forEach((t,u)=>{let d=t.cards,g=this.generators[u],b=g.learnable?.weight??1,S;if(g.learnable&&!g.staticWeight&&c.orchestration){let t=g.strategyId;t&&(b=c.orchestration.getEffectiveWeight(t,g.learnable),S=c.orchestration.getDeviation(t))}for(let t of d){t.provenance.length>0&&(t.provenance[0].effectiveWeight=b,t.provenance[0].deviation=S);let c=m.get(t.cardId)||[];c.push({card:t,weight:b}),m.set(t.cardId,c)}});let g=[];for(let[,t]of m){let c=t.map(t=>t.card),u=this.aggregateScores(t),d=Math.max(0,u),m=c.flatMap(t=>t.provenance),b=c[0].score,S=d>b?`boosted`:d<b?`penalized`:`passed`,C=this.buildAggregationReason(t,d);g.push({...c[0],score:d,provenance:[...m,{strategy:`composite`,strategyName:`Composite Generator`,strategyId:`COMPOSITE_GENERATOR`,action:S,score:d,reason:C}]})}return{cards:g.sort((t,c)=>c.score-t.score).slice(0,t),hints:mergeHints(u.map(t=>t.hints))}}buildAggregationReason(t,c){let u=t.map(t=>t.card),d=u.length,m=u.map(t=>t.score.toFixed(2)).join(`, `);if(d===1){let u=Math.abs(t[0].weight-1)>.001?` (w=${t[0].weight.toFixed(2)})`:``;return`Single generator, score ${c.toFixed(2)}${u}`}let g=u.map(t=>t.provenance[0]?.strategy||`unknown`).join(`, `);switch(this.aggregationMode){case`max`:return`Max of ${d} generators (${g}): scores [${m}] \u2192 ${c.toFixed(2)}`;case`average`:return`Weighted Avg of ${d} generators (${g}): scores [${m}] \u2192 ${c.toFixed(2)}`;case`frequencyBoost`:{let u=t.reduce((t,c)=>t+c.weight,0),m=t.reduce((t,c)=>t+c.card.score*c.weight,0),b=u>0?m/u:0,S=1+FREQUENCY_BOOST_FACTOR*(d-1);return`Frequency boost from ${d} generators (${g}): w-avg ${b.toFixed(2)} \xD7 ${S.toFixed(2)} \u2192 ${c.toFixed(2)}`}default:return`Aggregated from ${d} generators: ${c.toFixed(2)}`}}aggregateScores(t){let c=t.map(t=>t.card.score);switch(this.aggregationMode){case`max`:return Math.max(...c);case`average`:{let c=t.reduce((t,c)=>t+c.weight,0);return c===0?0:t.reduce((t,c)=>t+c.card.score*c.weight,0)/c}case`frequencyBoost`:{let c=t.reduce((t,c)=>t+c.weight,0),u=t.reduce((t,c)=>t+c.card.score*c.weight,0);return(c>0?u/c:0)*(1+FREQUENCY_BOOST_FACTOR*(t.length-1))}default:return c[0]}}}}}),elo_exports={},__export(elo_exports,{default:()=>ELONavigator}),init_elo=__esm({"src/core/navigators/generators/elo.ts"(){"use strict";init_navigators(),init_logger(),ELONavigator=class extends ContentNavigator{constructor(t,c,u){super(t,c,u),_defineProperty$2(this,`name`,void 0),this.name=u?.name||`ELO`}async getWeightedCards(t,c){let u;u=c?.userElo===void 0?toCourseElo((await this.user.getCourseRegDoc(this.course.getCourseID())).elo).global.score:c.userElo;let d=await this.user.getActiveCards(),m=(await this.course.getCardsCenteredAtELO({limit:t,elo:`user`},t=>!d.some(c=>t.cardID===c.cardID))).map(t=>({...t,status:`new`})).map(t=>{let c=t.elo??1e3,d=Math.abs(c-u),m=Math.max(0,1-d/500),g=m>0?Math.random()**(1/m):0;return{cardId:t.cardID,courseId:t.courseID,score:g,provenance:[{strategy:`elo`,strategyName:this.strategyName||this.name,strategyId:this.strategyId||`NAVIGATION_STRATEGY-ELO-default`,action:`generated`,score:g,reason:`ELO distance ${Math.round(d)} (card: ${Math.round(c)}, user: ${Math.round(u)}), raw ${m.toFixed(3)}, key ${g.toFixed(3)}`}]}});m.sort((t,c)=>c.score-t.score);let g=m.slice(0,t);if(g.length>0){let t=g.slice(0,3).map(t=>t.score.toFixed(2)).join(`, `);logger.info(`[ELO] Course ${this.course.getCourseID()}: ${g.length} new cards (top scores: ${t})`)}else logger.info(`[ELO] Course ${this.course.getCourseID()}: No new cards available`);return{cards:g}}}}}),generators_exports={},init_generators=__esm({"src/core/navigators/generators/index.ts"(){"use strict";}}),prescribed_exports={},__export(prescribed_exports,{default:()=>PrescribedCardsGenerator}),init_prescribed=__esm({"src/core/navigators/generators/prescribed.ts"(){"use strict";init_navigators(),init_logger(),DEFAULT_FRESHNESS_WINDOW=3,DEFAULT_MAX_DIRECT_PER_RUN=3,DEFAULT_MAX_SUPPORT_PER_RUN=3,DEFAULT_HIERARCHY_DEPTH=2,DEFAULT_MIN_COUNT=3,BASE_TARGET_SCORE=1,BASE_SUPPORT_SCORE=.8,DISCOVERED_SUPPORT_SCORE=12,MAX_TARGET_MULTIPLIER=8,MAX_SUPPORT_MULTIPLIER=4,PRESCRIBED_DEBUG_VERSION=`testversion-prescribed-v3`,PrescribedCardsGenerator=class extends ContentNavigator{constructor(t,c,u){super(t,c,u),_defineProperty$2(this,`name`,void 0),_defineProperty$2(this,`config`,void 0),this.name=u.name||`Prescribed Cards`,this.config=this.parseConfig(u.serializedData),logger.debug(`[Prescribed] Initialized with ${this.config.groups.length} groups and ${this.config.groups.reduce((t,c)=>t+c.targetCardIds.length,0)} targets`)}get strategyKey(){return`PrescribedProgress`}async getWeightedCards(t,c){if(this.config.groups.length===0||t<=0)return{cards:[]};let u=this.course.getCourseID(),d=await this.user.getActiveCards(),m=new Set(d.map(t=>t.cardID)),g=await this.user.getSeenCards(u).catch(()=>[]),b=new Set(g),S=await this.getStrategyState()??{updatedAt:isoNow(),groups:{}},C=await this.loadHierarchyConfigs(),w=await this.user.getCourseRegDoc(u).catch(()=>null),T=typeof w?.elo==`number`?w.elo:w?.elo?.global?.score??c?.userElo??1e3,E=typeof w?.elo==`number`?{}:w?.elo?.tags??{},D=dedupe(this.config.groups.flatMap(t=>t.targetCardIds)),O=dedupe(this.config.groups.flatMap(t=>t.supportCardIds??[])),Or=dedupe([...D,...O]),kr=Or.length>0?await this.course.getAppliedTagsBatch(Or):new Map,Ar=await this.course.getCourseTagStubs().catch(()=>({rows:[],offset:0,total_rows:0})),jr=new Map;for(let t of Ar.rows??[]){let c=t.doc;c?.name&&Array.isArray(c.taggedCards)&&jr.set(c.name,[...c.taggedCards])}let Mr={updatedAt:isoNow(),groups:{}},Nr=[],Pr=new Set,Fr=[];for(let t of this.config.groups){let c=this.buildGroupRuntimeState({group:t,priorState:S.groups[t.id],activeIds:m,seenIds:b,tagsByCard:kr,cardsByTag:jr,hierarchyConfigs:C,userTagElo:E,userGlobalElo:T});Fr.push(c),logger.info(`[Prescribed] Group '${t.id}': ${t.targetCardIds.length} targets total, ${c.encounteredTargets.size} encountered, ${c.pendingTargets.length} pending (${c.surfaceableTargets.length} surfaceable, ${c.blockedTargets.length} blocked), ${c.supportCandidates.length} authored support candidates, ${c.discoveredSupportCandidates.length} discovered support candidates, pressure=${c.pressureMultiplier.toFixed(2)}`),c.blockedTargets.length>0&&(logger.info(`[Prescribed] Group '${t.id}' blocked targets: ${c.blockedTargets.join(`, `)}`),logger.info(`[Prescribed] Group '${t.id}' support tags needed: ${c.supportTags.join(`, `)||`(none)`}`),logger.info(`[Prescribed] Group '${t.id}' escalation mode: `+(c.supportCandidates.length>0?`direct-support`:c.discoveredSupportCandidates.length>0?`inserted-support-candidates`:`boost-only`)),c.discoveredSupportCandidates.length>0&&logger.info(`[Prescribed] Group '${t.id}' discovered support candidates: ${c.discoveredSupportCandidates.join(`, `)}`)),Mr.groups[t.id]=this.buildNextGroupState(c,S.groups[t.id]);let d=this.buildDirectTargetCards(c,u,Pr),g=this.buildSupportCards(c,u,Pr),w=this.buildDiscoveredSupportCards(c,u,Pr);Nr.push(...d,...g,...w)}let Ir=this.buildSupportHintSummary(Fr),Lr=Object.keys(Ir.boostTags).length>0?{boostTags:Ir.boostTags,_label:`prescribed-support (${Ir.supportTags.length} tags; blocked=${Ir.blockedTargetIds.length}; testversion=${PRESCRIBED_DEBUG_VERSION})`}:void 0;if(Lr){let t=Object.entries(Lr.boostTags??{});logger.info(`[Prescribed] Emitting ${t.length} boost hint(s): `+t.map(([t,c])=>`${t}\xD7${c.toFixed(1)}`).join(`, `))}else logger.info(`[Prescribed] No hints to emit (no blocked targets or no support tags)`);if(Nr.length===0)return logger.info(`[Prescribed] 0 cards emitted (all targets blocked, authored/discovered support candidates exhausted)`+(Lr?` — boost hints emitted but may not survive filters`:``)),await this.putStrategyState(Mr).catch(t=>{logger.debug(`[Prescribed] Failed to persist empty-state update: ${t}`)}),Lr?{cards:[],hints:Lr}:{cards:[]};let Rr=pickTopByScore(Nr,t),zr=new Map;for(let t of Rr){let c=t.provenance[0],u=c?.reason.match(/group=([^;]+)/)?.[1],d=c?.reason.includes(`mode=support`)?`supportIds`:`targetIds`;u&&(zr.has(u)||zr.set(u,{targetIds:[],supportIds:[]}),zr.get(u)[d].push(t.cardId))}for(let t of this.config.groups){let c=Mr.groups[t.id],u=zr.get(t.id);u&&(u.targetIds.length>0||u.supportIds.length>0)&&(c.lastSurfacedAt=isoNow(),c.sessionsSinceSurfaced=0,u.supportIds.length>0&&(c.lastSupportAt=isoNow()))}return await this.putStrategyState(Mr).catch(t=>{logger.debug(`[Prescribed] Failed to persist prescribed progress: ${t}`)}),logger.info(`[Prescribed] Emitting ${Rr.length} cards (${Rr.filter(t=>t.provenance[0]?.reason.includes(`mode=target`)).length} target, ${Rr.filter(t=>t.provenance[0]?.reason.includes(`mode=support`)).length} support, ${Rr.filter(t=>t.provenance[0]?.reason.includes(`mode=discovered-support`)).length} discovered support)`),Lr?{cards:Rr,hints:Lr}:{cards:Rr}}buildSupportHintSummary(t){let c={},u=new Set,d=new Set;for(let m of t)if(!(m.blockedTargets.length===0||m.supportTags.length===0)){m.blockedTargets.forEach(t=>u.add(t));for(let t of m.supportTags)d.add(t),c[t]=(c[t]??1)*m.supportMultiplier}return{boostTags:c,blockedTargetIds:[...u].sort(),supportTags:[...d].sort()}}parseConfig(t){try{let c=JSON.parse(t);return{groups:(Array.isArray(c.groups)?c.groups:[]).map((t,c)=>({id:typeof t.id==`string`&&t.id.trim().length>0?t.id:`group-${c+1}`,targetCardIds:dedupe(Array.isArray(t.targetCardIds)?t.targetCardIds.filter(t=>typeof t==`string`):[]),supportCardIds:dedupe(Array.isArray(t.supportCardIds)?t.supportCardIds.filter(t=>typeof t==`string`):[]),supportTagPatterns:dedupe(Array.isArray(t.supportTagPatterns)?t.supportTagPatterns.filter(t=>typeof t==`string`):[]),freshnessWindowSessions:typeof t.freshnessWindowSessions==`number`?t.freshnessWindowSessions:DEFAULT_FRESHNESS_WINDOW,maxDirectTargetsPerRun:typeof t.maxDirectTargetsPerRun==`number`?t.maxDirectTargetsPerRun:DEFAULT_MAX_DIRECT_PER_RUN,maxSupportCardsPerRun:typeof t.maxSupportCardsPerRun==`number`?t.maxSupportCardsPerRun:DEFAULT_MAX_SUPPORT_PER_RUN,hierarchyWalk:{enabled:t.hierarchyWalk?.enabled!==!1,maxDepth:typeof t.hierarchyWalk?.maxDepth==`number`?t.hierarchyWalk.maxDepth:DEFAULT_HIERARCHY_DEPTH},retireOnEncounter:t.retireOnEncounter!==!1})).filter(t=>t.targetCardIds.length>0)}}catch{return{groups:[]}}}async loadHierarchyConfigs(){try{return(await this.course.getAllNavigationStrategies()).filter(t=>t.implementingClass===`hierarchyDefinition`).map(t=>{try{return{prerequisites:JSON.parse(t.serializedData).prerequisites||{}}}catch{return{prerequisites:{}}}})}catch(t){return logger.debug(`[Prescribed] Failed to load hierarchy configs: ${t}`),[]}}buildGroupRuntimeState(t){let{group:c,priorState:u,activeIds:d,seenIds:m,tagsByCard:g,cardsByTag:b,hierarchyConfigs:S,userTagElo:C,userGlobalElo:w}=t,T=new Set;for(let t of c.targetCardIds)(d.has(t)||m.has(t))&&T.add(t);if(u?.encounteredCardIds?.length)for(let t of u.encounteredCardIds)T.add(t);let E=c.targetCardIds.filter(t=>!T.has(t)),D=new Map;for(let t of E)D.set(t,g.get(t)??[]);let O=[],Or=[],kr=new Set;for(let t of E){let u=D.get(t)??[],d=this.resolveBlockedSupportTags(u,S,C,w,c.hierarchyWalk?.enabled!==!1,c.hierarchyWalk?.maxDepth??DEFAULT_HIERARCHY_DEPTH),m=u.filter(t=>t.startsWith(`gpc:intro:`)),g=new Set(u.filter(t=>t.startsWith(`gpc:expose:`)));for(let t of m){let c=t.slice(10);c&&g.add(`gpc:expose:${c}`)}let b=[...g].filter(t=>{let c=C[t];return!c||c.count<DEFAULT_MIN_COUNT});b.length>0&&b.forEach(t=>kr.add(t)),d.blocked||b.length>0?(O.push(t),d.supportTags.forEach(t=>kr.add(t))):Or.push(t)}let Ar=dedupe([...c.supportCardIds??[],...this.findSupportCardsByTags(c,g,[...kr])]).filter(t=>!d.has(t)&&!m.has(t)),jr=O.length>0&&kr.size>0&&Ar.length===0?this.findDiscoveredSupportCards({supportTags:[...kr],cardsByTag:b,activeIds:d,seenIds:m,excludedIds:new Set([...c.targetCardIds,...c.supportCardIds??[]]),limit:c.maxSupportCardsPerRun??DEFAULT_MAX_SUPPORT_PER_RUN}):[];O.length>0&&kr.size>0&&jr.length===0&&logger.info(`[Prescribed] Group '${c.id}' discovered 0 broader support candidates (blocked=${O.length}; authoredSupport=${Ar.length})`);let Mr=u?.sessionsSinceSurfaced??0,Nr=c.freshnessWindowSessions??DEFAULT_FRESHNESS_WINDOW,Pr=Math.max(0,Mr-Nr),Fr=E.length===0?1:clamp(1+Pr*.75+Math.min(2,E.length*.1),1,MAX_TARGET_MULTIPLIER),Ir=O.length===0?1:clamp(1+Pr*.5+Math.min(1.5,O.length*.15),1,MAX_SUPPORT_MULTIPLIER);return{group:c,encounteredTargets:T,pendingTargets:E,blockedTargets:O,surfaceableTargets:Or,targetTags:D,supportCandidates:Ar,discoveredSupportCandidates:jr,supportTags:[...kr],pressureMultiplier:Fr,supportMultiplier:Ir,debugVersion:PRESCRIBED_DEBUG_VERSION}}buildNextGroupState(t,c){let u=c?.sessionsSinceSurfaced??0,d=!1;return{encounteredCardIds:[...t.encounteredTargets].sort(),pendingTargetIds:[...t.pendingTargets].sort(),lastSurfacedAt:c?.lastSurfacedAt??null,sessionsSinceSurfaced:u+1,lastSupportAt:c?.lastSupportAt??null,blockedTargetIds:[...t.blockedTargets].sort(),lastResolvedSupportTags:[...t.supportTags].sort()}}buildDirectTargetCards(t,c,u){let d=t.group.maxDirectTargetsPerRun??DEFAULT_MAX_DIRECT_PER_RUN,m=t.surfaceableTargets.filter(t=>!u.has(t)).slice(0,d),g=[];for(let d of m)u.add(d),g.push({cardId:d,courseId:c,score:BASE_TARGET_SCORE*t.pressureMultiplier,provenance:[{strategy:`prescribed`,strategyName:this.strategyName||this.name,strategyId:this.strategyId||`NAVIGATION_STRATEGY-prescribed`,action:`generated`,score:BASE_TARGET_SCORE*t.pressureMultiplier,reason:`mode=target;group=${t.group.id};pending=${t.pendingTargets.length};surfaceable=${t.surfaceableTargets.length};blocked=${t.blockedTargets.length};blockedTargets=${t.blockedTargets.join(`|`)||`none`};supportTags=${t.supportTags.join(`|`)||`none`};multiplier=${t.pressureMultiplier.toFixed(2)};testversion=${t.debugVersion}`}]});return g}buildSupportCards(t,c,u){if(t.blockedTargets.length===0||t.supportCandidates.length===0)return[];let d=t.group.maxSupportCardsPerRun??DEFAULT_MAX_SUPPORT_PER_RUN,m=t.supportCandidates.filter(t=>!u.has(t)).slice(0,d),g=[];for(let d of m)u.add(d),g.push({cardId:d,courseId:c,score:BASE_SUPPORT_SCORE*t.supportMultiplier,provenance:[{strategy:`prescribed`,strategyName:this.strategyName||this.name,strategyId:this.strategyId||`NAVIGATION_STRATEGY-prescribed`,action:`generated`,score:BASE_SUPPORT_SCORE*t.supportMultiplier,reason:`mode=support;group=${t.group.id};pending=${t.pendingTargets.length};blocked=${t.blockedTargets.length};blockedTargets=${t.blockedTargets.join(`|`)||`none`};supportCard=${d};supportTags=${t.supportTags.join(`|`)||`none`};multiplier=${t.supportMultiplier.toFixed(2)};testversion=${t.debugVersion}`}]});return g}buildDiscoveredSupportCards(t,c,u){if(t.blockedTargets.length===0||t.discoveredSupportCandidates.length===0)return[];let d=t.group.maxSupportCardsPerRun??DEFAULT_MAX_SUPPORT_PER_RUN,m=t.discoveredSupportCandidates.filter(t=>!u.has(t)).slice(0,d),g=[];for(let d of m)u.add(d),g.push({cardId:d,courseId:c,score:DISCOVERED_SUPPORT_SCORE*t.supportMultiplier,provenance:[{strategy:`prescribed`,strategyName:this.strategyName||this.name,strategyId:this.strategyId||`NAVIGATION_STRATEGY-prescribed`,action:`generated`,score:DISCOVERED_SUPPORT_SCORE*t.supportMultiplier,reason:`mode=discovered-support;group=${t.group.id};pending=${t.pendingTargets.length};blocked=${t.blockedTargets.length};blockedTargets=${t.blockedTargets.join(`|`)||`none`};supportCard=${d};supportTags=${t.supportTags.join(`|`)||`none`};multiplier=${t.supportMultiplier.toFixed(2)};testversion=${t.debugVersion}`}]});return g}findSupportCardsByTags(t,c,u){if(u.length===0)return[];let d=t.supportCardIds??[],m=t.supportTagPatterns??[];if(d.length===0&&m.length===0)return[];let g=new Set;for(let t of d){let d=c.get(t)??[],b=u.some(t=>d.includes(t)),S=m.some(t=>d.some(c=>matchesTagPattern(c,t)));(b||S)&&g.add(t)}return[...g]}findDiscoveredSupportCards(t){let{supportTags:c,cardsByTag:u,activeIds:d,seenIds:m,excludedIds:g,limit:b}=t,S=new Map;for(let t of c){let c=u.get(t)??[];for(let t of c){if(d.has(t)||m.has(t)||g.has(t))continue;let c=S.get(t);c?c.matches+=1:S.set(t,{cardId:t,matches:1})}}let C=[...S.values()].sort((t,c)=>c.matches-t.matches||t.cardId.localeCompare(c.cardId)),w=new Set,T=[],E=[];for(let t of C){let c=extractWordStem(t.cardId);w.has(c)?E.push(t):(w.add(c),T.push(t))}return shuffleInPlace(T),shuffleInPlace(E),[...T,...E].slice(0,b).map(t=>t.cardId)}resolveBlockedSupportTags(t,c,u,d,m,g){let b=new Set,S=!1;for(let C of t){let t=c.map(t=>t.prerequisites[C]).filter(t=>Array.isArray(t)&&t.length>0);if(t.length!==0&&t.some(t=>t.some(t=>!this.isPrerequisiteMet(t,u[t.tag],d)))){if(S=!0,!m){for(let c of t)for(let t of c)this.isPrerequisiteMet(t,u[t.tag],d)||b.add(t.tag);continue}for(let m of t)for(let t of m)this.isPrerequisiteMet(t,u[t.tag],d)||this.collectSupportTagsRecursive(t.tag,c,u,d,g,new Set,b)}}return{blocked:S,supportTags:[...b]}}collectSupportTagsRecursive(t,c,u,d,m,g,b){if(m<0||g.has(t))return;g.add(t);let S=!1;for(let C of c){let w=C.prerequisites[t];if(!w||w.length===0)continue;let T=w.filter(t=>!this.isPrerequisiteMet(t,u[t.tag],d));if(T.length>0&&m>0){S=!0;for(let t of T)this.collectSupportTagsRecursive(t.tag,c,u,d,m-1,g,b)}}S||b.add(t)}isPrerequisiteMet(t,c,u){if(!c)return!1;let d=t.masteryThreshold?.minCount??DEFAULT_MIN_COUNT;return c.count<d?!1:t.masteryThreshold?.minElo===void 0?t.masteryThreshold?.minCount===void 0?c.score>=u:!0:c.score>=t.masteryThreshold.minElo}}}}),srs_exports={},__export(srs_exports,{default:()=>SRSNavigator}),init_srs=__esm({"src/core/navigators/generators/srs.ts"(){"use strict";init_navigators(),init_logger(),DEFAULT_HEALTHY_BACKLOG=20,MAX_BACKLOG_PRESSURE=.5,SRSNavigator=class extends ContentNavigator{constructor(t,c,u){super(t,c,u),_defineProperty$2(this,`name`,void 0),_defineProperty$2(this,`healthyBacklog`,void 0),this.name=u?.name||`SRS`,this.healthyBacklog=this.parseConfig(u?.serializedData).healthyBacklog??DEFAULT_HEALTHY_BACKLOG}parseConfig(t){if(!t)return{};try{return JSON.parse(t)}catch{return logger.warn(`[SRS] Failed to parse strategy config, using defaults`),{}}}async getWeightedCards(t,c){if(!this.user||!this.course)throw Error(`SRSNavigator requires user and course to be set`);let u=this.course.getCourseID(),d=await this.user.getPendingReviews(u),m=hooks.utc(),g=d.filter(t=>m.isAfter(hooks.utc(t.reviewTime)));if(g.length>0){let t=[...new Set(g.map(t=>t.cardId))],c=await this.course.getAppliedTagsBatch(t),u=[];if(g=g.filter(t=>(c.get(t.cardId)??[]).includes(`srs:skip`)?(u.push(t._id),!1):!0),u.length>0){logger.info(`[SRS] Removing ${u.length} scheduled reviews for srs:skip cards`);for(let t of u)this.user.removeScheduledCardReview(t)}}let b=this.computeBacklogPressure(g.length);if(g.length>0){let t=b>0?` [backlog pressure: +${b.toFixed(2)}]`:` [healthy backlog]`;logger.info(`[SRS] Course ${u}: ${g.length} reviews due now (of ${d.length} scheduled)${t}`)}else if(d.length>0){let t=[...d].sort((t,c)=>hooks.utc(t.reviewTime).diff(hooks.utc(c.reviewTime)))[0],c=hooks.utc(t.reviewTime),g=hooks.duration(c.diff(m)),b=g.asHours()<1?`${Math.round(g.asMinutes())}m`:g.asHours()<24?`${Math.round(g.asHours())}h`:`${Math.round(g.asDays())}d`;logger.info(`[SRS] Course ${u}: 0 reviews due now (${d.length} scheduled, next in ${b})`)}else logger.info(`[SRS] Course ${u}: No reviews scheduled`);return{cards:g.map(t=>{let{score:c,reason:u}=this.computeUrgencyScore(t,m,b);return{cardId:t.cardId,courseId:t.courseId,score:c,reviewID:t._id,provenance:[{strategy:`srs`,strategyName:this.strategyName||this.name,strategyId:this.strategyId||`NAVIGATION_STRATEGY-SRS-default`,action:`generated`,score:c,reason:u}]}}).sort((t,c)=>c.score-t.score).slice(0,t)}}computeBacklogPressure(t){if(t<=this.healthyBacklog)return 0;let c=(t-this.healthyBacklog)/this.healthyBacklog*(MAX_BACKLOG_PRESSURE/2);return Math.min(MAX_BACKLOG_PRESSURE,c)}computeUrgencyScore(t,c,u){let d=hooks.utc(t.scheduledAt),m=hooks.utc(t.reviewTime),g=Math.max(1,m.diff(d,`hours`)),b=c.diff(m,`hours`),S=b/g,C=.3+.7*Math.exp(-g/720),w=.5+(Math.min(1,Math.max(0,S))*.5+C*.5)*.45,T=Math.min(1,w+u),E=[`${Math.round(b)}h overdue`,`interval: ${Math.round(g)}h`,`relative: ${S.toFixed(2)}`,`recency: ${C.toFixed(2)}`];return u>0&&E.push(`backlog: +${u.toFixed(2)}`),E.push(`review`),{score:T,reason:E.join(`, `)}}}}}),types_exports={},init_types=__esm({"src/core/navigators/generators/types.ts"(){"use strict";}}),init_=__esm({'import("./generators/**/*") in src/core/navigators/index.ts'(){globImport_generators=__glob({"./generators/CompositeGenerator.ts":()=>Promise.resolve().then(()=>(init_CompositeGenerator(),CompositeGenerator_exports)),"./generators/elo.ts":()=>Promise.resolve().then(()=>(init_elo(),elo_exports)),"./generators/index.ts":()=>Promise.resolve().then(()=>(init_generators(),generators_exports)),"./generators/prescribed.ts":()=>Promise.resolve().then(()=>(init_prescribed(),prescribed_exports)),"./generators/srs.ts":()=>Promise.resolve().then(()=>(init_srs(),srs_exports)),"./generators/types.ts":()=>Promise.resolve().then(()=>(init_types(),types_exports))})}}),init_contentNavigationStrategy=__esm({"src/core/types/contentNavigationStrategy.ts"(){"use strict";DEFAULT_LEARNABLE_WEIGHT={weight:1,confidence:.1,sampleSize:0}}}),WeightedFilter_exports={},__export(WeightedFilter_exports,{WeightedFilter:()=>WeightedFilter}),init_WeightedFilter=__esm({"src/core/navigators/filters/WeightedFilter.ts"(){"use strict";init_contentNavigationStrategy(),WeightedFilter=class{constructor(t,c=DEFAULT_LEARNABLE_WEIGHT,u=!1,d){_defineProperty$2(this,`name`,void 0),_defineProperty$2(this,`inner`,void 0),_defineProperty$2(this,`learnable`,void 0),_defineProperty$2(this,`staticWeight`,void 0),_defineProperty$2(this,`strategyId`,void 0),this.inner=t,this.name=t.name,this.learnable=c,this.staticWeight=u,this.strategyId=d}async transform(t,c){let u=this.learnable.weight,d;if(!this.staticWeight&&c.orchestration){let t=this.strategyId||this.inner.strategyId||this.name;u=c.orchestration.getEffectiveWeight(t,this.learnable),d=c.orchestration.getDeviation(t)}if(Math.abs(u-1)<.001)return this.inner.transform(t,c);let m=new Map;for(let c of t)m.set(c.cardId,c.score);return(await this.inner.transform(t,c)).map(t=>{let c=m.get(t.cardId);if(c===void 0||c===0||t.score===0)return t;let g=t.score/c;if(Math.abs(g-1)<1e-4)return t;let b=c*g**+u,S=t.provenance.length-1,C=t.provenance[S];if(C){let c=[...t.provenance];return c[S]={...C,score:b,effectiveWeight:u,deviation:d},{...t,score:b,provenance:c}}return{...t,score:b}})}}}}),eloDistance_exports={},__export(eloDistance_exports,{DEFAULT_HALF_LIFE:()=>DEFAULT_HALF_LIFE,DEFAULT_MAX_MULTIPLIER:()=>DEFAULT_MAX_MULTIPLIER,DEFAULT_MIN_MULTIPLIER:()=>DEFAULT_MIN_MULTIPLIER,createEloDistanceFilter:()=>createEloDistanceFilter}),init_eloDistance=__esm({"src/core/navigators/filters/eloDistance.ts"(){"use strict";DEFAULT_HALF_LIFE=200,DEFAULT_MIN_MULTIPLIER=.3,DEFAULT_MAX_MULTIPLIER=1}}),hierarchyDefinition_exports={},__export(hierarchyDefinition_exports,{default:()=>HierarchyDefinitionNavigator}),init_hierarchyDefinition=__esm({"src/core/navigators/filters/hierarchyDefinition.ts"(){"use strict";init_navigators(),init_logger(),DEFAULT_MIN_COUNT2=3,HierarchyDefinitionNavigator=class extends ContentNavigator{constructor(t,c,u){super(t,c,u),_defineProperty$2(this,`config`,void 0),_defineProperty$2(this,`name`,void 0),this.config=this.parseConfig(u.serializedData),this.name=u.name||`Hierarchy Definition`}parseConfig(t){try{return{prerequisites:JSON.parse(t).prerequisites||{}}}catch{return{prerequisites:{}}}}isPrerequisiteMet(t,c,u){if(!c)return!1;let d=t.masteryThreshold?.minCount??DEFAULT_MIN_COUNT2;return c.count<d?!1:t.masteryThreshold?.minElo===void 0?t.masteryThreshold?.minCount===void 0?c.score>=u:!0:c.score>=t.masteryThreshold.minElo}async getMasteredTags(t){let c=new Set;try{let u=toCourseElo((await t.user.getCourseRegDoc(t.course.getCourseID())).elo);for(let t of Object.values(this.config.prerequisites))for(let d of t){let t=u.tags[d.tag];this.isPrerequisiteMet(d,t,u.global.score)&&c.add(d.tag)}}catch{}return c}getUnlockedTags(t){let c=new Set;for(let[u,d]of Object.entries(this.config.prerequisites))d.every(c=>t.has(c.tag))&&c.add(u);return c}hasPrerequisites(t){return t in this.config.prerequisites}async checkCardUnlock(t,c,u,d){try{let c=t.tags??[],m=c.filter(t=>this.hasPrerequisites(t)&&!u.has(t));return m.length===0?{isUnlocked:!0,reason:`Prerequisites met, tags: ${c.length>0?c.join(`, `):`none`}`}:{isUnlocked:!1,reason:`Blocked: missing prerequisites ${m.flatMap(t=>(this.config.prerequisites[t]||[]).filter(t=>!d.has(t.tag)).map(t=>t.tag)).join(`, `)} for tags ${m.join(`, `)}`}}catch{return{isUnlocked:!0,reason:`Prerequisites check skipped (tag lookup failed)`}}}getPreReqBoosts(t,c){let u=new Map;for(let[d,m]of Object.entries(this.config.prerequisites))if(!t.has(d))for(let t of m){if(!t.preReqBoost||t.preReqBoost<=1||c.has(t.tag))continue;let d=u.get(t.tag)??1;u.set(t.tag,Math.max(d,t.preReqBoost))}return u}getTargetBoosts(t){let c=new Map,u=Object.keys(this.config.prerequisites),d=[...t];logger.info(`[HierarchyDefinition:targetBoost:trace] ${this.name} | configKeys=${u.length}, unlocked=${d.length} (${d.slice(0,5).join(`, `)}${d.length>5?`...`:``})`);for(let[u,d]of Object.entries(this.config.prerequisites))if(t.has(u)){logger.info(`[HierarchyDefinition:targetBoost:trace] UNLOCKED ${u}: ${d.length} prereqs, raw=${JSON.stringify(d.map(t=>({tag:t.tag,tb:t.targetBoost})))}`);for(let t of d){if(!t.targetBoost||t.targetBoost<=1)continue;let d=c.get(u)??1;c.set(u,Math.max(d,t.targetBoost))}}return c.size>0?logger.info(`[HierarchyDefinition] targetBoosts active: ${[...c.entries()].map(([t,c])=>`${t}=\xD7${c}`).join(`, `)}`):logger.info(`[HierarchyDefinition:targetBoost:trace] no targetBoosts found despite ${d.length} unlocked tags`),c}async transform(t,c){let u=await this.getMasteredTags(c),d=this.getUnlockedTags(u),m=this.getPreReqBoosts(d,u),g=this.getTargetBoosts(d),b=[];for(let S of t){let{isUnlocked:t,reason:C}=await this.checkCardUnlock(S,c.course,d,u),w=t?S.score:S.score*.02,T=t?`passed`:`penalized`,E=C;if(t&&m.size>0){let t=S.tags??[],c=1,u=[];for(let d of t){let t=m.get(d);t&&t>c&&(c=t,u.push(d))}c>1&&(w*=c,T=`boosted`,E=`${C} | preReqBoost \xD7${c.toFixed(2)} for ${u.join(`, `)}`,logger.info(`[HierarchyDefinition] preReqBoost \xD7${c.toFixed(2)} applied to card ${S.cardId} via tags [${u.join(`, `)}] (score: ${S.score.toFixed(3)} \u2192 ${w.toFixed(3)})`))}if(t&&g.size>0){let t=S.tags??[],c=1,u=[];for(let d of t){let t=g.get(d);t&&t>c&&(c=t,u.push(d))}c>1&&(w*=c,T=`boosted`,E=`${E} | targetBoost \xD7${c.toFixed(2)} for ${u.join(`, `)}`,logger.info(`[HierarchyDefinition] targetBoost \xD7${c.toFixed(2)} applied to card ${S.cardId} via tags [${u.join(`, `)}] (score: ${S.score.toFixed(3)} \u2192 ${w.toFixed(3)})`))}b.push({...S,score:w,provenance:[...S.provenance,{strategy:`hierarchyDefinition`,strategyName:this.strategyName||this.name,strategyId:this.strategyId||`NAVIGATION_STRATEGY-hierarchy`,action:T,score:w,reason:E}]})}return b}async getWeightedCards(t){throw Error(`HierarchyDefinitionNavigator is a filter and should not be used as a generator. Use Pipeline with a generator and this filter via transform().`)}}}}),userTagPreference_exports={},__export(userTagPreference_exports,{default:()=>UserTagPreferenceFilter}),init_userTagPreference=__esm({"src/core/navigators/filters/userTagPreference.ts"(){"use strict";init_navigators(),UserTagPreferenceFilter=class extends ContentNavigator{constructor(t,c,u){super(t,c,u),_defineProperty$2(this,`_strategyData`,void 0),_defineProperty$2(this,`name`,void 0),this._strategyData=u,this.name=u.name||`User Tag Preferences`}computeMultiplier(t,c){let u=t.map(t=>c[t]).filter(t=>t!==void 0);return u.length===0?1:Math.max(...u)}buildReason(t,c,u){let d=t.filter(t=>c[t]===u);return u===0?`Excluded by user preference: ${d.join(`, `)} (${u}x)`:u<1?`Penalized by user preference: ${d.join(`, `)} (${u.toFixed(2)}x)`:u>1?`Boosted by user preference: ${d.join(`, `)} (${u.toFixed(2)}x)`:`No matching user preferences`}async transform(t,c){let u=await this.getStrategyState();return!u||Object.keys(u.boost).length===0?t.map(t=>({...t,provenance:[...t.provenance,{strategy:`userTagPreference`,strategyName:this.strategyName||this.name,strategyId:this.strategyId||this._strategyData._id,action:`passed`,score:t.score,reason:`No user tag preferences configured`}]})):await Promise.all(t.map(async t=>{let c=t.tags??[],d=this.computeMultiplier(c,u.boost),m=Math.min(1,t.score*d),g;return g=d===0||d<1?`penalized`:d>1?`boosted`:`passed`,{...t,score:m,provenance:[...t.provenance,{strategy:`userTagPreference`,strategyName:this.strategyName||this.name,strategyId:this.strategyId||this._strategyData._id,action:g,score:m,reason:this.buildReason(c,u.boost,d)}]}}))}async getWeightedCards(t){throw Error(`UserTagPreferenceFilter is a filter and should not be used as a generator. Use Pipeline with a generator and this filter via transform().`)}}}}),filters_exports={},__export(filters_exports,{UserTagPreferenceFilter:()=>UserTagPreferenceFilter,createEloDistanceFilter:()=>createEloDistanceFilter}),init_filters=__esm({"src/core/navigators/filters/index.ts"(){"use strict";init_eloDistance(),init_userTagPreference()}}),inferredPreferenceStub_exports={},__export(inferredPreferenceStub_exports,{INFERRED_PREFERENCE_NAVIGATOR_STUB:()=>INFERRED_PREFERENCE_NAVIGATOR_STUB}),init_inferredPreferenceStub=__esm({"src/core/navigators/filters/inferredPreferenceStub.ts"(){"use strict";INFERRED_PREFERENCE_NAVIGATOR_STUB=!0}}),interferenceMitigator_exports={},__export(interferenceMitigator_exports,{default:()=>InterferenceMitigatorNavigator}),init_interferenceMitigator=__esm({"src/core/navigators/filters/interferenceMitigator.ts"(){"use strict";init_navigators(),DEFAULT_MIN_COUNT3=10,DEFAULT_MIN_ELAPSED_DAYS=3,DEFAULT_INTERFERENCE_DECAY=.8,InterferenceMitigatorNavigator=class extends ContentNavigator{constructor(t,c,u){super(t,c,u),_defineProperty$2(this,`config`,void 0),_defineProperty$2(this,`name`,void 0),_defineProperty$2(this,`interferenceMap`,void 0),this.config=this.parseConfig(u.serializedData),this.interferenceMap=this.buildInterferenceMap(),this.name=u.name||`Interference Mitigator`}parseConfig(t){try{let c=JSON.parse(t),u=c.interferenceSets||[];return u.length>0&&Array.isArray(u[0])&&(u=u.map(t=>({tags:t}))),{interferenceSets:u,maturityThreshold:{minCount:c.maturityThreshold?.minCount??DEFAULT_MIN_COUNT3,minElo:c.maturityThreshold?.minElo,minElapsedDays:c.maturityThreshold?.minElapsedDays??DEFAULT_MIN_ELAPSED_DAYS},defaultDecay:c.defaultDecay??DEFAULT_INTERFERENCE_DECAY}}catch{return{interferenceSets:[],maturityThreshold:{minCount:DEFAULT_MIN_COUNT3,minElapsedDays:DEFAULT_MIN_ELAPSED_DAYS},defaultDecay:DEFAULT_INTERFERENCE_DECAY}}}buildInterferenceMap(){let t=new Map;for(let c of this.config.interferenceSets){let u=c.decay??this.config.defaultDecay??DEFAULT_INTERFERENCE_DECAY;for(let d of c.tags){t.has(d)||t.set(d,[]);let m=t.get(d);for(let t of c.tags)if(t!==d){let c=m.find(c=>c.partner===t);c?c.decay=Math.max(c.decay,u):m.push({partner:t,decay:u})}}}return t}async getImmatureTags(t){let c=new Set;try{let u=toCourseElo((await t.user.getCourseRegDoc(t.course.getCourseID())).elo),d=this.config.maturityThreshold?.minCount??DEFAULT_MIN_COUNT3,m=this.config.maturityThreshold?.minElo,g=(this.config.maturityThreshold?.minElapsedDays??DEFAULT_MIN_ELAPSED_DAYS)*2;for(let[t,b]of Object.entries(u.tags)){if(b.count===0)continue;let u=b.count<d,S=m!==void 0&&b.score<m,C=b.count<g;(u||S||C)&&c.add(t)}}catch{}return c}getTagsToAvoid(t){let c=new Map;for(let u of t){let d=this.interferenceMap.get(u);if(d){for(let{partner:u,decay:m}of d)if(!t.has(u)){let t=c.get(u)??0;c.set(u,Math.max(t,m))}}}return c}computeInterferenceEffect(t,c,u){if(c.size===0)return{multiplier:1,interferingTags:[],reason:`No interference detected`};let d=1,m=[];for(let u of t){let t=c.get(u);t!==void 0&&(m.push(u),d*=1-t)}if(m.length===0)return{multiplier:1,interferingTags:[],reason:`No interference detected`};let g=new Set;for(let t of m)for(let c of u)this.interferenceMap.get(c)?.some(c=>c.partner===t)&&g.add(c);let b=`Interferes with immature tags ${Array.from(g).join(`, `)} (tags: ${m.join(`, `)}, multiplier: ${d.toFixed(2)})`;return{multiplier:d,interferingTags:m,reason:b}}async transform(t,c){let u=await this.getImmatureTags(c),d=this.getTagsToAvoid(u),m=[];for(let c of t){let t=c.tags??[],{multiplier:g,reason:b}=this.computeInterferenceEffect(t,d,u),S=c.score*g,C=g<1?`penalized`:g>1?`boosted`:`passed`;m.push({...c,score:S,provenance:[...c.provenance,{strategy:`interferenceMitigator`,strategyName:this.strategyName||this.name,strategyId:this.strategyId||`NAVIGATION_STRATEGY-interference`,action:C,score:S,reason:b}]})}return m}async getWeightedCards(t){throw Error(`InterferenceMitigatorNavigator is a filter and should not be used as a generator. Use Pipeline with a generator and this filter via transform().`)}}}}),relativePriority_exports={},__export(relativePriority_exports,{default:()=>RelativePriorityNavigator}),init_relativePriority=__esm({"src/core/navigators/filters/relativePriority.ts"(){"use strict";init_navigators(),DEFAULT_PRIORITY=.5,DEFAULT_PRIORITY_INFLUENCE=.5,DEFAULT_COMBINE_MODE=`max`,RelativePriorityNavigator=class extends ContentNavigator{constructor(t,c,u){super(t,c,u),_defineProperty$2(this,`config`,void 0),_defineProperty$2(this,`name`,void 0),this.config=this.parseConfig(u.serializedData),this.name=u.name||`Relative Priority`}parseConfig(t){try{let c=JSON.parse(t);return{tagPriorities:c.tagPriorities||{},defaultPriority:c.defaultPriority??DEFAULT_PRIORITY,combineMode:c.combineMode??DEFAULT_COMBINE_MODE,priorityInfluence:c.priorityInfluence??DEFAULT_PRIORITY_INFLUENCE}}catch{return{tagPriorities:{},defaultPriority:DEFAULT_PRIORITY,combineMode:DEFAULT_COMBINE_MODE,priorityInfluence:DEFAULT_PRIORITY_INFLUENCE}}}getTagPriority(t){return this.config.tagPriorities[t]??this.config.defaultPriority??DEFAULT_PRIORITY}computeCardPriority(t){if(t.length===0)return this.config.defaultPriority??DEFAULT_PRIORITY;let c=t.map(t=>this.getTagPriority(t));switch(this.config.combineMode){case`max`:return Math.max(...c);case`min`:return Math.min(...c);case`average`:return c.reduce((t,c)=>t+c,0)/c.length;default:return Math.max(...c)}}computeBoostFactor(t){let c=this.config.priorityInfluence??DEFAULT_PRIORITY_INFLUENCE;return 1+(t-.5)*c}buildPriorityReason(t,c,u,d){if(t.length===0)return`No tags, neutral priority (${c.toFixed(2)})`;let m=t.slice(0,3).join(`, `),g=t.length>3?` (+${t.length-3} more)`:``;return u===1?`Neutral priority (${c.toFixed(2)}) for tags: ${m}${g}`:u>1?`High-priority tags: ${m}${g} (priority ${c.toFixed(2)} \u2192 boost ${u.toFixed(2)}x \u2192 ${d.toFixed(2)})`:`Low-priority tags: ${m}${g} (priority ${c.toFixed(2)} \u2192 reduce ${u.toFixed(2)}x \u2192 ${d.toFixed(2)})`}async transform(t,c){return await Promise.all(t.map(async t=>{let c=t.tags??[],u=this.computeCardPriority(c),d=this.computeBoostFactor(u),m=Math.max(0,t.score*d),g=d>1?`boosted`:d<1?`penalized`:`passed`,b=this.buildPriorityReason(c,u,d,m);return{...t,score:m,provenance:[...t.provenance,{strategy:`relativePriority`,strategyName:this.strategyName||this.name,strategyId:this.strategyId||`NAVIGATION_STRATEGY-priority`,action:g,score:m,reason:b}]}}))}async getWeightedCards(t){throw Error(`RelativePriorityNavigator is a filter and should not be used as a generator. Use Pipeline with a generator and this filter via transform().`)}}}}),types_exports2={},init_types2=__esm({"src/core/navigators/filters/types.ts"(){"use strict";}}),userGoalStub_exports={},__export(userGoalStub_exports,{USER_GOAL_NAVIGATOR_STUB:()=>USER_GOAL_NAVIGATOR_STUB}),init_userGoalStub=__esm({"src/core/navigators/filters/userGoalStub.ts"(){"use strict";USER_GOAL_NAVIGATOR_STUB=!0}}),init_2=__esm({'import("./filters/**/*") in src/core/navigators/index.ts'(){globImport_filters=__glob({"./filters/WeightedFilter.ts":()=>Promise.resolve().then(()=>(init_WeightedFilter(),WeightedFilter_exports)),"./filters/eloDistance.ts":()=>Promise.resolve().then(()=>(init_eloDistance(),eloDistance_exports)),"./filters/hierarchyDefinition.ts":()=>Promise.resolve().then(()=>(init_hierarchyDefinition(),hierarchyDefinition_exports)),"./filters/index.ts":()=>Promise.resolve().then(()=>(init_filters(),filters_exports)),"./filters/inferredPreferenceStub.ts":()=>Promise.resolve().then(()=>(init_inferredPreferenceStub(),inferredPreferenceStub_exports)),"./filters/interferenceMitigator.ts":()=>Promise.resolve().then(()=>(init_interferenceMitigator(),interferenceMitigator_exports)),"./filters/relativePriority.ts":()=>Promise.resolve().then(()=>(init_relativePriority(),relativePriority_exports)),"./filters/types.ts":()=>Promise.resolve().then(()=>(init_types2(),types_exports2)),"./filters/userGoalStub.ts":()=>Promise.resolve().then(()=>(init_userGoalStub(),userGoalStub_exports)),"./filters/userTagPreference.ts":()=>Promise.resolve().then(()=>(init_userTagPreference(),userTagPreference_exports))})}}),init_gradient=__esm({"src/core/orchestration/gradient.ts"(){"use strict";init_logger()}}),init_learning=__esm({"src/core/orchestration/learning.ts"(){"use strict";init_contentNavigationStrategy(),init_types_legacy(),init_logger(),MIN_OBSERVATIONS_FOR_UPDATE=10,LEARNING_RATE=.1,MAX_WEIGHT_DELTA=.3,MIN_R_SQUARED_FOR_GRADIENT=.05,FLAT_GRADIENT_THRESHOLD=.02,MAX_HISTORY_LENGTH=100}}),init_signal=__esm({"src/core/orchestration/signal.ts"(){"use strict";}}),init_recording=__esm({"src/core/orchestration/recording.ts"(){"use strict";init_signal(),init_types_legacy(),init_logger()}}),init_orchestration=__esm({"src/core/orchestration/index.ts"(){"use strict";init_logger(),init_gradient(),init_learning(),init_signal(),init_recording(),MIN_SPREAD=.1,MAX_SPREAD=.5,MIN_WEIGHT=.1,MAX_WEIGHT=3}}),Pipeline_exports={},__export(Pipeline_exports,{Pipeline:()=>Pipeline,mergeHints:()=>mergeHints2}),init_Pipeline=__esm({"src/core/navigators/Pipeline.ts"(){"use strict";init_navigators(),init_logger(),init_orchestration(),init_PipelineDebugger(),VERBOSE_RESULTS=!0,Pipeline=class extends ContentNavigator{constructor(t,c,u,d){super(),_defineProperty$2(this,`generator`,void 0),_defineProperty$2(this,`filters`,void 0),_defineProperty$2(this,`_cachedOrchestration`,null),_defineProperty$2(this,`_tagCache`,new Map),_defineProperty$2(this,`_ephemeralHints`,null),this.generator=t,this.filters=c,this.user=u,this.course=d,d.getCourseConfig().then(t=>{logger.debug(`[pipeline] Crated pipeline for ${t.name}`)}).catch(t=>{logger.error(`[pipeline] Failed to lookup courseCfg: ${t}`)}),logPipelineConfig(t,c),registerPipelineForDebug(this)}setEphemeralHints(t){this._ephemeralHints=t,logger.info(`[Pipeline] Ephemeral hints set: ${JSON.stringify(t)}`)}async getWeightedCards(t){let c=performance.now(),u=await this.buildContext(),d=performance.now(),m=500;logger.debug(`[Pipeline] Fetching 500 candidates from generator '${this.generator.name}'`);let g=await this.generator.getWeightedCards(500,u),b=g.cards,S=performance.now(),C=b.length;this._ephemeralHints=mergeHints2([this._ephemeralHints,g.hints])??null;let w;if(this.generator.generators){let t=new Map;for(let c of b){let u=c.provenance[0];if(u){let d=u.strategyName;t.has(d)||t.set(d,{cards:[]}),t.get(d).cards.push(c)}}w=Array.from(t.entries()).map(([t,c])=>{let u=c.cards.filter(t=>t.provenance[0]?.reason?.includes(`new card`)),d=c.cards.filter(t=>t.provenance[0]?.reason?.includes(`review`));return{name:t,cardCount:c.cards.length,newCount:u.length,reviewCount:d.length,topScore:Math.max(...c.cards.map(t=>t.score),0)}})}logger.debug(`[Pipeline] Generator returned ${C} candidates`),b=await this.hydrateTags(b);let T=performance.now(),E=[...b],D=this._ephemeralHints;if(D?.requireCards?.length){let t=new Set(E.map(t=>t.cardId)),c=D.requireCards.filter(c=>!c.includes(`*`)&&!t.has(c));if(c.length>0){let t=await this.course.getAppliedTagsBatch(c),u=this.course.getCourseID();for(let d of c)E.push({cardId:d,courseId:u,score:1,tags:t.get(d)??[],provenance:[]});logger.info(`[Pipeline] Pre-fetched ${c.length} required card(s) into pool: ${c.join(`, `)}`)}}let O=new Set(b.filter(t=>t.provenance.some(t=>t.strategy===`prescribed`)).map(t=>t.cardId)),Or=[];for(let t of this.filters){let c=b.length,d=new Map(b.map(t=>[t.cardId,t.score]));b=await t.transform(b,u);let m=0,g=0,S=0,C=c-b.length;for(let t of b){let c=d.get(t.cardId)??0;t.score>c?m++:t.score<c?g++:S++}if(Or.push({name:t.name,boosted:m,penalized:g,passed:S,removed:C}),O.size>0){let c=new Set(b.map(t=>t.cardId)),u=[...O].filter(t=>!c.has(t)),d=b.filter(t=>O.has(t.cardId)&&t.score===0).map(t=>t.cardId);(u.length>0||d.length>0)&&(logger.info(`[Pipeline] Filter '${t.name}' impact on prescribed cards: `+(u.length>0?`removed=[${u.join(`, `)}] `:``)+(d.length>0?`zeroed=[${d.join(`, `)}]`:``)),u.forEach(t=>O.delete(t)))}logger.debug(`[Pipeline] Filter '${t.name}': ${d.size} \u2192 ${b.length} cards (\u2191${m} \u2193${g} =${S})`)}b=b.filter(t=>t.score>0);let kr=this._ephemeralHints;kr&&(this._ephemeralHints=null,b=this.applyHints(b,kr,E)),b.sort((t,c)=>c.score-t.score);let Ar=performance.now(),jr=b.slice(0,t);logger.info(`[Pipeline:timing] total=${(Ar-c).toFixed(0)}ms (context=${(d-c).toFixed(0)} generate=${(S-d).toFixed(0)} hydrate=${(T-S).toFixed(0)} filter=${(Ar-T).toFixed(0)})`);let Mr=jr.slice(0,3).map(t=>t.score);logExecutionSummary(this.generator.name,C,this.filters.length,jr.length,Mr,Or),logResultCards(jr),logCardProvenance(jr,3);try{let t=await this.course?.getCourseConfig().then(t=>t.name).catch(()=>void 0);captureRun(buildRunReport(this.course?.getCourseID()||`unknown`,t,this.generator.name,w,C,Or,b,jr,u.userElo,kr??void 0))}catch(t){logger.debug(`[Pipeline] Failed to capture debug run: ${t}`)}return{cards:jr}}async hydrateTags(t){if(t.length===0)return t;let c=[];for(let u of t)this._tagCache.has(u.cardId)||c.push(u.cardId);if(c.length>0){let t=await this.course.getAppliedTagsBatch(c);for(let[c,u]of t)this._tagCache.set(c,u)}let u=new Map;for(let c of t)u.set(c.cardId,this._tagCache.get(c.cardId)??[]);return logTagHydration(t,u),t.map(t=>({...t,tags:this._tagCache.get(t.cardId)??[]}))}applyHints(t,c,u){let d=t.length;if(c.excludeCards?.length&&(t=t.filter(t=>!c.excludeCards.some(c=>globMatch(t.cardId,c)))),c.excludeTags?.length&&(t=t.filter(t=>!c.excludeTags.some(c=>cardMatchesTagPattern(t,c)))),c.boostTags)for(let[u,d]of Object.entries(c.boostTags))for(let m of t)cardMatchesTagPattern(m,u)&&(m.score*=d,m.provenance.push({strategy:`ephemeralHint`,strategyId:`ephemeral-hint`,strategyName:c._label?`Replan Hint (${c._label})`:`Replan Hint`,action:`boosted`,score:m.score,reason:`boostTag ${u} \xD7${d}`}));if(c.boostCards)for(let[u,d]of Object.entries(c.boostCards))for(let m of t)globMatch(m.cardId,u)&&(m.score*=d,m.provenance.push({strategy:`ephemeralHint`,strategyId:`ephemeral-hint`,strategyName:c._label?`Replan Hint (${c._label})`:`Replan Hint`,action:`boosted`,score:m.score,reason:`boostCard ${u} \xD7${d}`}));let m=new Set(t.map(t=>t.cardId)),g=new Map(t.map(t=>[t.cardId,t])),b=c._label?`Replan Hint (${c._label})`:`Replan Hint`,applyRequirement=(c,u)=>{let d=1/0,S=g.get(c.cardId);S?S.score<d&&(S.score=d,S.provenance.push({strategy:`ephemeralHint`,strategyId:`ephemeral-hint`,strategyName:b,action:`boosted`,score:d,reason:`${u} (upgrade to mandatory score)`})):(t.push({...c,score:d,provenance:[...c.provenance,{strategy:`ephemeralHint`,strategyId:`ephemeral-hint`,strategyName:b,action:`boosted`,score:d,reason:u}]}),m.add(c.cardId),g.set(c.cardId,t[t.length-1]))};if(c.requireCards?.length)for(let t of c.requireCards){for(let c of m)globMatch(c,t)&&applyRequirement(g.get(c),`requireCard ${t}`);for(let c of u)globMatch(c.cardId,t)&&applyRequirement(c,`requireCard ${t}`)}if(c.requireTags?.length)for(let t of c.requireTags){for(let c of m){let u=g.get(c);cardMatchesTagPattern(u,t)&&applyRequirement(u,`requireTag ${t}`)}for(let c of u)cardMatchesTagPattern(c,t)&&applyRequirement(c,`requireTag ${t}`)}return logger.info(`[Pipeline] Hints applied: ${d} \u2192 ${t.length} cards`),t}async buildContext(){let t=1e3;try{t=toCourseElo((await this.user.getCourseRegDoc(this.course.getCourseID())).elo).global.score}catch(t){logger.debug(`[Pipeline] Could not get user ELO, using default: ${t}`)}this._cachedOrchestration||(this._cachedOrchestration=await createOrchestrationContext(this.user,this.course));let c=this._cachedOrchestration;return{user:this.user,course:this.course,userElo:t,orchestration:c}}getCourseID(){return this.course.getCourseID()}async getOrchestrationContext(){return createOrchestrationContext(this.user,this.course)}getStrategyIds(){let t=[],extractId=t=>t.strategyId?t.strategyId:null,c=extractId(this.generator);c&&t.push(c),this.generator.generators&&Array.isArray(this.generator.generators)&&this.generator.generators.forEach(c=>{let u=extractId(c);u&&t.push(u)});for(let c of this.filters){let u=extractId(c);u&&t.push(u)}return[...new Set(t)]}async getTagEloStatus(t){let c=toCourseElo((await this.user.getCourseRegDoc(this.course.getCourseID())).elo),u={};if(t){let d=Array.isArray(t)?t:[t];for(let t of d){let d=globToRegex(t);for(let[t,m]of Object.entries(c.tags))d.test(t)&&(u[t]={score:m.score,count:m.count})}}else for(let[t,d]of Object.entries(c.tags))u[t]={score:d.score,count:d.count};return u}async diagnoseCardSpace(t){let c=t?.threshold??.1,u=performance.now(),d=await this.course.getAllCardIds(),m=d.map(t=>({cardId:t,courseId:this.course.getCourseID(),score:1,provenance:[]}));m=await this.hydrateTags(m);let g=await this.buildContext(),b=[];for(let t of this.filters){m=await t.transform(m,g);let u=m.filter(t=>t.score>=c).length;b.push({name:t.name,wellIndicated:u})}let S=m.filter(t=>t.score>=c),C=new Set(S.map(t=>t.cardId)),w;try{let t=this.course.getCourseID(),c=await this.user.getSeenCards(t);w=new Set(c)}catch{w=new Set}let T=S.filter(t=>!w.has(t.cardId)),E=new Map;for(let t of m){let u=t.cardId.split(`-`)[1]||`unknown`;E.has(u)||E.set(u,{total:0,wellIndicated:0,new:0});let d=E.get(u);d.total++,t.score>=c&&(d.wellIndicated++,w.has(t.cardId)||d.new++)}let D=performance.now()-u,O={totalCards:d.length,threshold:c,wellIndicated:C.size,encountered:w.size,wellIndicatedNew:T.length,byType:Object.fromEntries(E),filterBreakdown:b,elapsedMs:Math.round(D)};logger.info(`[Pipeline:diagnose] Card space scan (${O.elapsedMs}ms):`),logger.info(`[Pipeline:diagnose] Total cards: ${O.totalCards}`),logger.info(`[Pipeline:diagnose] Well-indicated (score >= ${c}): ${O.wellIndicated}`),logger.info(`[Pipeline:diagnose] Encountered: ${O.encountered}`),logger.info(`[Pipeline:diagnose] Well-indicated & new: ${O.wellIndicatedNew}`),logger.info(`[Pipeline:diagnose] By type:`);for(let[t,c]of E)logger.info(`[Pipeline:diagnose] ${t}: ${c.wellIndicated}/${c.total} well-indicated, ${c.new} new`);logger.info(`[Pipeline:diagnose] After each filter:`);for(let t of b)logger.info(`[Pipeline:diagnose] ${t.name}: ${t.wellIndicated} well-indicated`);return O}}}}),defaults_exports={},__export(defaults_exports,{createDefaultEloStrategy:()=>createDefaultEloStrategy,createDefaultPipeline:()=>createDefaultPipeline,createDefaultSrsStrategy:()=>createDefaultSrsStrategy}),init_defaults=__esm({"src/core/navigators/defaults.ts"(){"use strict";init_navigators(),init_Pipeline(),init_CompositeGenerator(),init_elo(),init_srs(),init_eloDistance(),init_types_legacy()}}),PipelineAssembler_exports={},__export(PipelineAssembler_exports,{PipelineAssembler:()=>PipelineAssembler}),init_PipelineAssembler=__esm({"src/core/navigators/PipelineAssembler.ts"(){"use strict";init_navigators(),init_WeightedFilter(),init_Pipeline(),init_logger(),init_CompositeGenerator(),init_defaults(),PipelineAssembler=class{async assemble(t){let{strategies:c,user:u,course:d}=t,m=[];if(c.length===0)return{pipeline:null,generatorStrategies:[],filterStrategies:[],warnings:m};let g=[],b=[];for(let t of c)isGenerator(t.implementingClass)?g.push(t):isFilter(t.implementingClass)?b.push(t):m.push(`Unknown strategy type '${t.implementingClass}', skipping: ${t.name}`);let S=d.getCourseID(),C=g.some(t=>t.implementingClass===`elo`),w=g.some(t=>t.implementingClass===`srs`);if(C||(logger.debug(`[PipelineAssembler] No ELO generator configured, adding default`),g.push(createDefaultEloStrategy(S))),w||(logger.debug(`[PipelineAssembler] No SRS generator configured, adding default`),g.push(createDefaultSrsStrategy(S))),g.length===0)return m.push(`No generator strategy found`),{pipeline:null,generatorStrategies:[],filterStrategies:[],warnings:m};let T;g.length===1?(T=await ContentNavigator.create(u,d,g[0]),logger.debug(`[PipelineAssembler] Using single generator: ${g[0].name}`)):(logger.debug(`[PipelineAssembler] Using CompositeGenerator for ${g.length} generators: ${g.map(t=>t.name).join(`, `)}`),T=await CompositeGenerator.fromStrategies(u,d,g));let E=[],D=[...b].sort((t,c)=>t.name.localeCompare(c.name));for(let t of D)try{let c=await ContentNavigator.create(u,d,t);if(`transform`in c&&typeof c.transform==`function`){let u=c;t.learnable&&(u=new WeightedFilter(u,t.learnable,t.staticWeight,t._id)),E.push(u),logger.debug(`[PipelineAssembler] Added filter: ${t.name}`)}else m.push(`Filter '${t.name}' does not implement CardFilter.transform(), skipping`)}catch(c){m.push(`Failed to instantiate filter '${t.name}': ${c}`)}let O=new Pipeline(T,E,u,d);return logger.debug(`[PipelineAssembler] Assembled pipeline with ${g.length} generator(s) and ${E.length} filter(s)`),{pipeline:O,generatorStrategies:g,filterStrategies:D,warnings:m}}}}}),init_3=__esm({'import("./**/*") in src/core/navigators/index.ts'(){globImport=__glob({"./Pipeline.ts":()=>Promise.resolve().then(()=>(init_Pipeline(),Pipeline_exports)),"./PipelineAssembler.ts":()=>Promise.resolve().then(()=>(init_PipelineAssembler(),PipelineAssembler_exports)),"./PipelineDebugger.ts":()=>Promise.resolve().then(()=>(init_PipelineDebugger(),PipelineDebugger_exports)),"./defaults.ts":()=>Promise.resolve().then(()=>(init_defaults(),defaults_exports)),"./filters/WeightedFilter.ts":()=>Promise.resolve().then(()=>(init_WeightedFilter(),WeightedFilter_exports)),"./filters/eloDistance.ts":()=>Promise.resolve().then(()=>(init_eloDistance(),eloDistance_exports)),"./filters/hierarchyDefinition.ts":()=>Promise.resolve().then(()=>(init_hierarchyDefinition(),hierarchyDefinition_exports)),"./filters/index.ts":()=>Promise.resolve().then(()=>(init_filters(),filters_exports)),"./filters/inferredPreferenceStub.ts":()=>Promise.resolve().then(()=>(init_inferredPreferenceStub(),inferredPreferenceStub_exports)),"./filters/interferenceMitigator.ts":()=>Promise.resolve().then(()=>(init_interferenceMitigator(),interferenceMitigator_exports)),"./filters/relativePriority.ts":()=>Promise.resolve().then(()=>(init_relativePriority(),relativePriority_exports)),"./filters/types.ts":()=>Promise.resolve().then(()=>(init_types2(),types_exports2)),"./filters/userGoalStub.ts":()=>Promise.resolve().then(()=>(init_userGoalStub(),userGoalStub_exports)),"./filters/userTagPreference.ts":()=>Promise.resolve().then(()=>(init_userTagPreference(),userTagPreference_exports)),"./generators/CompositeGenerator.ts":()=>Promise.resolve().then(()=>(init_CompositeGenerator(),CompositeGenerator_exports)),"./generators/elo.ts":()=>Promise.resolve().then(()=>(init_elo(),elo_exports)),"./generators/index.ts":()=>Promise.resolve().then(()=>(init_generators(),generators_exports)),"./generators/prescribed.ts":()=>Promise.resolve().then(()=>(init_prescribed(),prescribed_exports)),"./generators/srs.ts":()=>Promise.resolve().then(()=>(init_srs(),srs_exports)),"./generators/types.ts":()=>Promise.resolve().then(()=>(init_types(),types_exports)),"./index.ts":()=>Promise.resolve().then(()=>(init_navigators(),navigators_exports))})}}),navigators_exports={},__export(navigators_exports,{ContentNavigator:()=>ContentNavigator,NavigatorRole:()=>NavigatorRole,NavigatorRoles:()=>NavigatorRoles,Navigators:()=>Navigators,getCardOrigin:()=>getCardOrigin,getRegisteredNavigator:()=>getRegisteredNavigator,getRegisteredNavigatorNames:()=>getRegisteredNavigatorNames,getRegisteredNavigatorRole:()=>getRegisteredNavigatorRole,hasRegisteredNavigator:()=>hasRegisteredNavigator,initializeNavigatorRegistry:()=>initializeNavigatorRegistry,isFilter:()=>isFilter,isGenerator:()=>isGenerator,mountPipelineDebugger:()=>mountPipelineDebugger,pipelineDebugAPI:()=>pipelineDebugAPI,registerNavigator:()=>registerNavigator}),init_navigators=__esm({"src/core/navigators/index.ts"(){"use strict";init_PipelineDebugger(),init_logger(),init_(),init_2(),init_3(),navigatorRegistry=new Map,Navigators=(t=>(t.ELO=`elo`,t.SRS=`srs`,t.PRESCRIBED=`prescribed`,t.HIERARCHY=`hierarchyDefinition`,t.INTERFERENCE=`interferenceMitigator`,t.RELATIVE_PRIORITY=`relativePriority`,t.USER_TAG_PREFERENCE=`userTagPreference`,t))(Navigators||{}),NavigatorRole=(t=>(t.GENERATOR=`generator`,t.FILTER=`filter`,t))(NavigatorRole||{}),NavigatorRoles={elo:`generator`,srs:`generator`,prescribed:`generator`,hierarchyDefinition:`filter`,interferenceMitigator:`filter`,relativePriority:`filter`,userTagPreference:`filter`},ContentNavigator=class{constructor(t,c,u){_defineProperty$2(this,`user`,void 0),_defineProperty$2(this,`course`,void 0),_defineProperty$2(this,`strategyName`,void 0),_defineProperty$2(this,`strategyId`,void 0),_defineProperty$2(this,`learnable`,void 0),_defineProperty$2(this,`staticWeight`,void 0),this.user=t,this.course=c,u&&(this.strategyName=u.name,this.strategyId=u._id,this.learnable=u.learnable,this.staticWeight=u.staticWeight)}get strategyKey(){return this.constructor.name}async getStrategyState(){if(!this.user||!this.course)throw Error(`Cannot get strategy state: navigator not properly initialized. Ensure user and course are provided to constructor.`);return this.user.getStrategyState(this.course.getCourseID(),this.strategyKey)}async putStrategyState(t){if(!this.user||!this.course)throw Error(`Cannot put strategy state: navigator not properly initialized. Ensure user and course are provided to constructor.`);return this.user.putStrategyState(this.course.getCourseID(),this.strategyKey,t)}static async create(t,c,u){let d=u.implementingClass,m=getRegisteredNavigator(d);if(m)return logger.debug(`[ContentNavigator.create] Using registered navigator: ${d}`),new m(t,c,u);logger.debug(`[ContentNavigator.create] Navigator not in registry, attempting dynamic import: ${d}`);let g;for(let t of[`.ts`,`.js`,``]){try{if(g=(await globImport_generators(`./generators/${d}${t}`)).default,g)break}catch(c){logger.debug(`Failed to load generator ${d}${t}:`,c)}try{if(g=(await globImport_filters(`./filters/${d}${t}`)).default,g)break}catch(c){logger.debug(`Failed to load filter ${d}${t}:`,c)}try{if(g=(await globImport(`./${d}${t}`)).default,g)break}catch(c){logger.debug(`Failed to load legacy ${d}${t}:`,c)}if(g)break}if(!g)throw Error(`Could not load navigator implementation for: ${d}`);return new g(t,c,u)}async getWeightedCards(t){throw Error(`${this.constructor.name} must implement getWeightedCards(). `)}setEphemeralHints(t){}}}}),init_courseDB=__esm({"src/impl/couch/courseDB.ts"(){"use strict";init_couch(),init_updateQueue(),init_types_legacy(),init_logger(),init_clientCache(),init_courseAPI(),init_courseLookupDB(),init_navigators(),init_PipelineAssembler(),init_defaults(),CoursesDB=class{constructor(t){_defineProperty$2(this,`_courseIDs`,void 0),t&&t.length>0?this._courseIDs=t:this._courseIDs=void 0}async getCourseList(){let t=await CourseLookup.allCourseWare();return logger.debug(`AllCourses: ${t.map(t=>t.name+`, `+t._id+`
350
350
  `)}`),this._courseIDs&&(t=t.filter(t=>this._courseIDs.includes(t._id))),logger.debug(`AllCourses.filtered: ${t.map(t=>t.name+`, `+t._id+`
351
351
  `)}`),(await Promise.all(t.map(async t=>{try{let c=await getCredentialledCourseConfig(t._id);return logger.debug(`Found cfg: ${JSON.stringify(c)}`),c}catch(c){logger.warn(`Error fetching cfg for course ${t.name}, ${t._id}: ${c}`);return}}))).filter(t=>!!t)}async getCourseConfig(t){if(this._courseIDs&&this._courseIDs.length&&!this._courseIDs.includes(t))throw Error(`Course ${t} not in course list`);let c=await getCredentialledCourseConfig(t);if(c===void 0)throw Error(`Error fetching cfg for course ${t}`);return c}async disambiguateCourse(t,c){await CourseLookup.updateDisambiguator(t,c)}},CourseDB=class{constructor(t,c,u){_defineProperty$2(this,`db`,void 0),_defineProperty$2(this,`remoteDB`,void 0),_defineProperty$2(this,`id`,void 0),_defineProperty$2(this,`_getCurrentUser`,void 0),_defineProperty$2(this,`updateQueue`,void 0),_defineProperty$2(this,`_pendingHints`,null),_defineProperty$2(this,`_eloPoolCache`,null),_defineProperty$2(this,`_eloPoolTtlMs`,300*1e3),_defineProperty$2(this,`_cachedNavigator`,null),_defineProperty$2(this,`_navigatorTtlMs`,300*1e3),this.id=t;let d=getCourseDB2(this.id);this.remoteDB=d,this.db=u??d,this._getCurrentUser=c,this.updateQueue=new UpdateQueue(this.remoteDB,this.remoteDB)}getCourseID(){return this.id}async getCourseInfo(){return{cardCount:(await this.db.find({selector:{docType:`CARD`},limit:1e3})).docs.length,registeredUsers:0}}async getInexperiencedCards(t=2){return(await this.db.query(`cardsByInexperience`,{limit:t})).rows.map(t=>({courseId:this.id,cardId:t.id,count:t.key,elo:t.value}))}async getCardsByEloLimits(t={low:0,high:-(2**53-1),limit:25,page:0}){return(await this.db.query(`elo`,{startkey:t.low,endkey:t.high,limit:t.limit,skip:t.limit*t.page})).rows.map(t=>`${this.id}-${t.id}-${t.key}`)}async getCardEloData(t){let c=await this.db.allDocs({keys:t,include_docs:!0}),u=[];return c.rows.forEach(t=>{isSuccessRow(t)?t.doc&&t.doc.elo?u.push(toCourseElo(t.doc.elo)):(logger.warn(`no elo data for card: `+t.id),u.push(blankCourseElo())):(logger.warn(`no elo data for card: `+JSON.stringify(t)),u.push(blankCourseElo()))}),u}async getELOBounds(){let[t,c]=await Promise.all([(await this.db.query(`elo`,{startkey:0,limit:1,include_docs:!1})).rows[0].key,(await this.db.query(`elo`,{limit:1,descending:!0,startkey:1e5})).rows[0].key]);return{low:t,high:c}}async removeCard(t){let c=await this.remoteDB.get(t);if(!c.docType||c.docType!==`CARD`)throw Error(`failed to remove ${t} from course ${this.id}. id does not point to a card`);try{let c=await this.getAppliedTags(t);(await Promise.allSettled(c.rows.map(async c=>{let u=c.id;await this.removeTagFromCard(t,u)}))).forEach((u,d)=>{if(u.status===`rejected`){let m=c.rows[d].id;logger.error(`Failed to remove card ${t} from tag ${m}: ${u.reason}`)}})}catch(c){logger.error(`Error removing card ${t} from tags: ${c}`)}return this.remoteDB.remove(c)}async getCardDisplayableDataIDs(t){logger.debug(t.join(`, `));let c=await this.db.allDocs({keys:t,include_docs:!0}),u={};return c.rows.forEach(t=>{isSuccessRow(t)&&(u[t.id]=t.doc.id_displayable_data)}),u}async getCardsByELO(t,c){t=parseInt(t);let u=c||25,d=await this.db.query(`elo`,{limit:Math.ceil(u/2),startkey:t,descending:!0}),m=u-d.rows.length,g=await this.db.query(`elo`,{limit:m,startkey:t+1}),b=d.rows;b=b.concat(g.rows);let S=b.sort((c,u)=>{let d=Math.abs(c.key-t)-Math.abs(u.key-t);return d===0?Math.random()-.5:d}).map(t=>({courseID:this.id,cardID:t.id,elo:t.key})),C=`below:
352
352
  ${d.rows.map(t=>` ${t.id}-${t.key}
@@ -404,7 +404,7 @@ Examples:
404
404
  User ELO update: ${S?`SUCCESS`:`FAILED`}
405
405
  Card ELO update: ${C?`SUCCESS`:`FAILED`}`),!S&&m[0].status===`rejected`&&logger.error(`[EloService] User ELO update error:`,m[0].reason),!C&&m[1].status===`rejected`&&logger.error(`[EloService] Card ELO update error:`,m[1].reason)}}},init_core(),init_logger(),ResponseProcessor=class{constructor(t,c){_defineProperty$2(this,`srsService`,void 0),_defineProperty$2(this,`eloService`,void 0),this.srsService=t,this.eloService=c}parsePerformance(t){return typeof t==`number`?{globalScore:t,taggedPerformance:null}:isTaggedPerformance(t)?{globalScore:t._global,taggedPerformance:t}:(logger.warn(`[ResponseProcessor] Unexpected performance structure, using neutral score`,{performance:t}),{globalScore:.5,taggedPerformance:null})}async processResponse(t,c,u,d,m,g,b,S,C,w){if(!isQuestionRecord(t))return{nextCardAction:`dismiss-success`,shouldLoadNextCard:!0,isCorrect:!0,shouldClearFeedbackShadow:!0};try{let T=await c,E;return E=t.isCorrect?this.processCorrectResponse(t,T,u,d,m,g,b):this.processIncorrectResponse(t,T,d,m,g,b,S,C,w),t.deferAdvance&&E.shouldLoadNextCard&&(logger.info(`[ResponseProcessor] deferAdvance requested — suppressing navigation, action stashed:`,{nextCardAction:E.nextCardAction}),E={...E,shouldLoadNextCard:!1,deferred:!0}),E}catch(t){throw logger.error(`[ResponseProcessor] Failed to load card history`,{e:t,cardId:b}),t}}processCorrectResponse(t,c,u,d,m,g,b){if(t.priorAttemps===0){m.card.tags.includes(`srs:skip`)||this.srsService.scheduleReview(c,u);let{globalScore:S,taggedPerformance:C}=this.parsePerformance(t.performance);if(C){let t=Object.keys(C).filter(t=>t!==`_global`),c=t.filter(t=>C[t]===null),u=t.filter(t=>C[t]!==null);logger.info(`[ResponseProcessor] per-tag ELO update for ${b}: scored=[${u.join(`, `)}] count-only=[${c.join(`, `)}]`),this.eloService.updateUserAndCardEloPerTag(C,g,b,d,m)}else{let t=.5+S/2;if(c.records.length===1)this.eloService.updateUserAndCardElo(t,g,b,d,m);else{let u=Math.ceil(32/c.records.length);this.eloService.updateUserAndCardElo(t,g,b,d,m,u)}logger.info(`[ResponseProcessor] Processed correct response with SRS scheduling and ELO update`)}return{nextCardAction:`dismiss-success`,shouldLoadNextCard:!0,isCorrect:!0,performanceScore:S,shouldClearFeedbackShadow:!0}}else{logger.info(`[ResponseProcessor] Processed correct response (retry attempt - no scheduling/ELO)`);let{globalScore:c}=this.parsePerformance(t.performance);return{nextCardAction:`marked-failed`,shouldLoadNextCard:!0,isCorrect:!0,performanceScore:c,shouldClearFeedbackShadow:!0}}}processIncorrectResponse(t,c,u,d,m,g,b,S,C){let{taggedPerformance:w}=this.parsePerformance(t.performance);return c.records.length!==1&&t.priorAttemps===0?w?(this.eloService.updateUserAndCardEloPerTag(w,m,g,u,d),logger.info(`[ResponseProcessor] Processed incorrect response with per-tag ELO update (${Object.keys(w).length-1} tags)`)):(this.eloService.updateUserAndCardElo(0,m,g,u,d),logger.info(`[ResponseProcessor] Processed incorrect response with ELO update`)):logger.info(`[ResponseProcessor] Processed incorrect response (no ELO update needed)`),d.records.length>=b?C>=S?(w?this.eloService.updateUserAndCardEloPerTag(w,m,g,u,d):this.eloService.updateUserAndCardElo(0,m,g,u,d),{nextCardAction:`dismiss-failed`,shouldLoadNextCard:!0,isCorrect:!1,shouldClearFeedbackShadow:!0}):{nextCardAction:`marked-failed`,shouldLoadNextCard:!0,isCorrect:!1,shouldClearFeedbackShadow:!0}:{nextCardAction:`none`,shouldLoadNextCard:!1,isCorrect:!1,shouldClearFeedbackShadow:!0}}},init_logger(),CardHydrationService=class{constructor(t,c,u){_defineProperty$2(this,`hydratedCards`,new Map),_defineProperty$2(this,`hydrationInFlight`,new Set),_defineProperty$2(this,`hydrationInProgress`,!1),this.getViewComponent=t,this.getCourseDB=c,this.getItemsToHydrate=u}getHydratedCard(t){return this.hydratedCards.get(t)??null}hasHydratedCard(t){return this.hydratedCards.has(t)}removeCard(t){this.hydratedCards.delete(t)}async ensureHydratedCards(){this.fillHydratedCards()}async waitForCard(t){if(this.hydratedCards.has(t))return this.hydratedCards.get(t);this.hydrationInProgress||this.fillHydratedCards();let c=1e4,u=25,d=0;for(;d<1e4;){if(this.hydratedCards.has(t))return this.hydratedCards.get(t);if(!this.hydrationInFlight.has(t)&&!this.hydrationInProgress)break;await new Promise(t=>setTimeout(t,25)),d+=25}return this.hydratedCards.get(t)??null}get hydratedCount(){return this.hydratedCards.size}getHydratedCardIds(){return Array.from(this.hydratedCards.keys())}async fillHydratedCards(){if(!this.hydrationInProgress){this.hydrationInProgress=!0;try{let t=this.getItemsToHydrate();for(let c of t)if(!(this.hydratedCards.has(c.cardID)||this.hydrationInFlight.has(c.cardID)))try{await this.hydrateCard(c)}catch(t){logger.error(`[CardHydrationService] Error hydrating card ${c.cardID}:`,t)}}finally{this.hydrationInProgress=!1}}}async hydrateCard(t){if(!(this.hydratedCards.has(t.cardID)||this.hydrationInFlight.has(t.cardID))){this.hydrationInFlight.add(t.cardID);try{let c=this.getCourseDB(t.courseID),[u,d]=await Promise.all([c.getCourseDoc(t.cardID),c.getAppliedTagsBatch([t.cardID])]);isCourseElo(u.elo)||(u.elo=toCourseElo(u.elo));let m=this.getViewComponent(u.id_view),g=await Promise.all(u.id_displayable_data.map(t=>c.getCourseDoc(t,{attachments:!0,binary:!0}))),b=[];g.forEach(t=>{t.data.forEach(t=>{b.push(...parseAudioURIs(t.data))})});let S=[...new Set(b)];S.length>0&&(logger.debug(`[CardHydrationService] Prefetching ${S.length} audio files for card ${t.cardID}`),await Promise.allSettled(S.map(prefetchAudio)));let C=g.map(displayableDataToViewData).reverse();this.hydratedCards.set(t.cardID,{item:t,view:m,data:C,tags:d.get(t.cardID)??[]}),logger.debug(`[CardHydrationService] Hydrated card ${t.cardID}`)}finally{this.hydrationInFlight.delete(t.cardID)}}}},ItemQueue=class{constructor(){_defineProperty$2(this,`q`,[]),_defineProperty$2(this,`seenCardIds`,[]),_defineProperty$2(this,`_dequeueCount`,0)}get dequeueCount(){return this._dequeueCount}add(t,c){this.seenCardIds.find(t=>t===c)||(this.seenCardIds.push(c),this.q.push(t))}addAll(t,c){t.forEach(t=>this.add(t,c(t)))}get length(){return this.q.length}peek(t){return this.q[t]}dequeue(t){if(this.q.length!==0){this._dequeueCount++;let c=this.q.splice(0,1)[0];if(t){let u=t(c),d=this.seenCardIds.indexOf(u);d>-1&&this.seenCardIds.splice(d,1)}return c}else return null}replaceAll(t,c){this.q=[],this.seenCardIds=[];for(let u of t){let t=c(u);this.seenCardIds.includes(t)||(this.seenCardIds.push(t),this.q.push(u))}}mergeToFront(t,c){let u=0,d=[];for(let m of t){let t=c(m);this.seenCardIds.includes(t)||(this.seenCardIds.push(t),d.push(m),u++)}return this.q.unshift(...d),u}get toString(){return`${typeof this.q[0]}:
406
406
  `+this.q.map(t=>` ${t.courseID}+${t.cardID}: ${t.status}`).join(`
407
- `)}},init_couch(),init_recording(),init_Loggable(),init_types_legacy(),init_logger(),CouchDBToStaticPacker=class{constructor(t={}){_defineProperty$2(this,`config`,void 0),_defineProperty$2(this,`sourceDB`,null),this.config={chunkSize:1e3,includeAttachments:!0,...t}}async packCourse(t,c){logger.info(`Starting static pack for course: ${c}`),this.sourceDB=t;let u={version:`1.0.0`,courseId:c,courseName:``,courseConfig:null,lastUpdated:new Date().toISOString(),documentCount:0,chunks:[],indices:[],designDocs:[]},d=await this.extractCourseConfig(t);u.courseName=d.name,u.courseConfig=d,u.designDocs=await this.extractDesignDocs(t);let m=await this.extractDocumentsByType(t),g=new Map;this.config.includeAttachments&&await this.extractAllAttachments(m,g);let b=new Map;for(let[t,c]of Object.entries(m)){let d=this.createChunks(c,t);u.chunks.push(...d),u.documentCount+=c.length,this.prepareChunkData(d,c,b)}let S=new Map;return u.indices=await this.buildIndices(m,u.designDocs,S),{manifest:u,chunks:b,indices:S,attachments:g}}async packCourseToFiles(t,c,u,d){logger.info(`Packing course ${c} to files in ${u}`);let m=await this.packCourse(t,c),g=await this.writePackedDataToFiles(m,u,d);return{manifest:m.manifest,filesWritten:g,attachmentsFound:m.attachments?m.attachments.size:0}}async writePackedDataToFiles(t,c,u){let d=0;await u.ensureDir(c);let m=u.joinPath(c,`manifest.json`);await u.writeJson(m,t.manifest,{spaces:2}),d++,logger.info(`Wrote manifest: ${m}`);let g=u.joinPath(c,`chunks`),b=u.joinPath(c,`indices`);await u.ensureDir(g),await u.ensureDir(b);for(let[c,m]of t.chunks){let t=u.joinPath(g,`${c}.json`);await u.writeJson(t,m),d++}logger.info(`Wrote ${t.chunks.size} chunk files`);for(let[c,m]of t.indices){let t=u.joinPath(b,`${c}.json`);await u.writeJson(t,m,{spaces:2}),d++}if(logger.info(`Wrote ${t.indices.size} index files`),t.attachments&&t.attachments.size>0){for(let[m,g]of t.attachments){let t=u.joinPath(c,m),b=u.dirname(t);await u.ensureDir(b),await u.writeFile(t,g.buffer),d++}logger.info(`Wrote ${t.attachments.size} attachment files`)}return d}async extractCourseConfig(t){try{return await t.get(`CourseConfig`)}catch(t){throw logger.error(`Failed to extract course config:`,t),Error(`Course config not found`)}}async extractDesignDocs(t){return(await t.allDocs({startkey:`_design/`,endkey:`_design/￰`,include_docs:!0})).rows.map(t=>({_id:t.id,views:t.doc.views||{}}))}async extractDocumentsByType(t){let c=await t.allDocs({include_docs:!0}),u={};for(let t of c.rows){if(t.id.startsWith(`_`))continue;let c=t.doc;c.docType&&(u[c.docType]||(u[c.docType]=[]),u[c.docType].push(c))}return u}createChunks(t,c){let u=[],d=t.sort((t,c)=>t._id.localeCompare(c._id));for(let t=0;t<d.length;t+=this.config.chunkSize){let m=d.slice(t,t+this.config.chunkSize),g=`${c}-${String(Math.floor(t/this.config.chunkSize)).padStart(4,`0`)}`;u.push({id:g,docType:c,startKey:m[0]._id,endKey:m[m.length-1]._id,documentCount:m.length,path:`chunks/${g}.json`})}return u}prepareChunkData(t,c,u){let d=c.sort((t,c)=>t._id.localeCompare(c._id));for(let c of t){let t=d.filter(t=>t._id>=c.startKey&&t._id<=c.endKey).map(t=>{let c={...t};return delete c._rev,this.config.includeAttachments&&c._attachments?c._attachments=this.transformAttachmentStubs(c._attachments,c._id):this.config.includeAttachments||delete c._attachments,c});u.set(c.id,t)}}async buildIndices(t,c,u){let d=[];if(t.CARD){let c=await this.buildEloIndex(t.CARD,u);d.push(c)}if(t.TAG){let c=await this.buildTagIndex(t.TAG,u);d.push(c)}for(let t of c)for(let[c,m]of Object.entries(t.views))if(m.map){logger.info(`Processing view: ${t._id}/${c}`);let m=await this.buildViewIndex(c,t,u);m?(d.push(m),logger.info(`Successfully built index: ${m.name}`)):logger.warn(`Skipped view index: ${t._id}/${c}`)}return d}async buildEloIndex(t,c){let u=[];for(let c of t)c.elo?.global?.score&&u.push({elo:c.elo.global.score,cardId:c._id});u.sort((t,c)=>t.elo-c.elo);let d={},m=50;for(let t of u){let c=Math.floor(t.elo/50)*50;d[c]||(d[c]=[]),d[c].push(t.cardId)}return c.set(`elo`,{sorted:u,buckets:d,stats:{min:u[0]?.elo||0,max:u[u.length-1]?.elo||0,count:u.length}}),{name:`elo`,type:`btree`,path:`indices/elo.json`}}async buildTagIndex(t,c){let u={};for(let c of t)u[c.name]={cardIds:c.taggedCards,snippet:c.snippet,count:c.taggedCards.length};let d={};for(let c of t)for(let t of c.taggedCards)d[t]||(d[t]=[]),d[t].push(c.name);return c.set(`tags`,{byTag:u,byCard:d}),{name:`tags`,type:`hash`,path:`indices/tags.json`}}async buildViewIndex(t,c,u){if(!this.sourceDB)return logger.error(`Source database not available for view querying`),null;try{let d=`${c._id.replace(`_design/`,``)}/${t}`;logger.info(`Querying CouchDB view: ${d}`);let m=await this.sourceDB.query(d,{include_docs:!1});if(!m.rows||m.rows.length===0)return logger.warn(`View ${d} returned no results`),null;logger.info(`Successfully queried view ${d}: ${m.rows.length} results`);let g=this.formatViewResults(t,m.rows,c),b=`view-${c._id.replace(`_design/`,``)}-${t}`;return u.set(b,g),{name:b,type:`view`,path:`indices/${b}.json`}}catch(u){return logger.error(`Failed to query view ${c._id}/${t}:`,u),null}}formatViewResults(t,c,u){let d={type:`couchdb-view`,viewName:t,designDoc:u._id,results:c,metadata:{resultCount:c.length,generatedAt:new Date().toISOString()}};switch(t){case`elo`:return this.formatEloViewIndex(c,d);case`getTags`:return this.formatTagsViewIndex(c,d);case`cardsByInexperience`:return this.formatInexperienceViewIndex(c,d);default:return this.formatGenericViewIndex(c,d)}}formatEloViewIndex(t,c){let u=t.sort((t,c)=>typeof t.key==`number`&&typeof c.key==`number`?t.key-c.key:0);return{...c,sorted:u,stats:{min:u[0]?.key||0,max:u[u.length-1]?.key||0,count:u.length}}}formatTagsViewIndex(t,c){let u={};for(let c of t){let t=c.key;typeof t==`string`&&(u[t]||(u[t]=[]),u[t].push(c.id))}return{...c,byTag:u,tagCount:Object.keys(u).length}}formatInexperienceViewIndex(t,c){let u=t.sort((t,c)=>typeof t.key==`number`&&typeof c.key==`number`?t.key-c.key:0);return{...c,sorted:u,stats:{minInexperience:u[0]?.key||0,maxInexperience:u[u.length-1]?.key||0,count:u.length}}}formatGenericViewIndex(t,c){return{...c}}async extractAllAttachments(t,c){logger.info(`Extracting attachments...`);let u=[];for(let c of Object.values(t))u.push(...c);let d=u.filter(t=>t._attachments&&Object.keys(t._attachments).length>0);if(d.length===0){logger.info(`No attachments found`);return}logger.info(`Found ${d.length} documents with attachments`);let m=d.map(t=>this.extractDocumentAttachments(t,c));await Promise.all(m),logger.info(`Extracted ${c.size} attachment files`)}async extractDocumentAttachments(t,c){if(!t._attachments||!this.sourceDB)return;let u=t._id;for(let[d,m]of Object.entries(t._attachments))try{let t=await this.sourceDB.getAttachment(u,d),g;if(t instanceof ArrayBuffer)g=Buffer.from(t);else if(Buffer.isBuffer(t))g=t;else{let c=t;g=Buffer.from(await c.arrayBuffer())}let b=`${d}${this.getFileExtension(m.content_type)}`,S=`attachments/${u}/${b}`;c.set(S,{docId:u,attachmentName:d,filename:b,path:S,contentType:m.content_type,length:m.length||g.length,digest:m.digest,buffer:g}),logger.debug(`Extracted attachment: ${S}`)}catch(t){throw logger.error(`Failed to extract attachment ${u}/${d}:`,t),Error(`Failed to extract attachment ${u}/${d}: ${t}`)}}transformAttachmentStubs(t,c){let u={};for(let[d,m]of Object.entries(t))u[d]={path:`attachments/${c}/${`${d}${this.getFileExtension(m.content_type)}`}`,content_type:m.content_type,length:m.length,digest:m.digest,stub:!1};return u}getFileExtension(t){return{"image/jpeg":`.jpg`,"image/jpg":`.jpg`,"image/png":`.png`,"image/gif":`.gif`,"image/webp":`.webp`,"audio/mpeg":`.mp3`,"audio/mp3":`.mp3`,"audio/wav":`.wav`,"audio/ogg":`.ogg`,"video/mp4":`.mp4`,"video/webm":`.webm`,"application/pdf":`.pdf`,"text/plain":`.txt`,"application/json":`.json`}[t]||``}},init_logger(),DEFAULT_MIGRATION_OPTIONS={chunkBatchSize:100,validateRoundTrip:!1,cleanupOnFailure:!0,timeout:3e5},init_logger(),FileSystemError=class extends Error{constructor(t,c,u,d){super(t),this.operation=c,this.filePath=u,this.cause=d,this.name=`FileSystemError`}},nodeFS2=null;try{typeof window>`u`&&typeof process<`u`&&process.versions?.node&&(nodeFS2=eval(`require`)(`fs`),nodeFS2.promises=nodeFS2.promises||eval(`require`)(`fs`).promises)}catch{}nodeFS3=null,nodePath=null;try{typeof window>`u`&&typeof process<`u`&&process.versions?.node&&(nodeFS3=eval(`require`)(`fs`),nodePath=eval(`require`)(`path`),nodeFS3.promises=nodeFS3.promises||eval(`require`)(`fs`).promises)}catch{}StaticToCouchDBMigrator=class{constructor(t={},c){_defineProperty$2(this,`options`,void 0),_defineProperty$2(this,`progressCallback`,void 0),_defineProperty$2(this,`fs`,void 0),this.options={...DEFAULT_MIGRATION_OPTIONS,...t},this.fs=c}setProgressCallback(t){this.progressCallback=t}async migrateCourse(t,c){let u=Date.now(),d={success:!1,documentsRestored:0,attachmentsRestored:0,designDocsRestored:0,courseConfigRestored:0,errors:[],warnings:[],migrationTime:0};try{logger.info(`Starting migration from ${t} to CouchDB`),this.reportProgress(`manifest`,0,1,`Validating static course...`);let m=await validateStaticCourse(t,this.fs);if(!m.valid)throw d.errors.push(...m.errors),Error(`Static course validation failed: ${m.errors.join(`, `)}`);d.warnings.push(...m.warnings),this.reportProgress(`manifest`,1,1,`Loading course manifest...`);let g=await this.loadManifest(t);logger.info(`Loaded manifest for course: ${g.courseId} (${g.courseName})`),this.reportProgress(`design_docs`,0,g.designDocs.length,`Restoring design documents...`);let b=await this.restoreDesignDocuments(g.designDocs,c);d.designDocsRestored=b.restored,d.errors.push(...b.errors),d.warnings.push(...b.warnings),this.reportProgress(`course_config`,0,1,`Restoring CourseConfig document...`);let S=await this.restoreCourseConfig(g,c);d.courseConfigRestored=S.restored,d.errors.push(...S.errors),d.warnings.push(...S.warnings),this.reportProgress(`course_config`,1,1,`CourseConfig document restored`);let C=this.calculateExpectedCounts(g);this.reportProgress(`documents`,0,g.documentCount,`Aggregating documents from chunks...`);let w=await this.aggregateDocuments(t,g),T=w.filter(t=>t._id!==`CourseConfig`);w.length!==T.length&&d.warnings.push(`Filtered out ${w.length-T.length} CourseConfig document(s) from chunks to prevent conflicts`),this.reportProgress(`documents`,T.length,g.documentCount,`Uploading documents to CouchDB...`);let E=await this.uploadDocuments(T,c);d.documentsRestored=E.restored,d.errors.push(...E.errors),d.warnings.push(...E.warnings);let D=w.filter(t=>t._attachments&&Object.keys(t._attachments).length>0);this.reportProgress(`attachments`,0,D.length,`Uploading attachments...`);let O=await this.uploadAttachments(t,D,c);if(d.attachmentsRestored=O.restored,d.errors.push(...O.errors),d.warnings.push(...O.warnings),this.options.validateRoundTrip){this.reportProgress(`validation`,0,1,`Validating migration...`);let t=await validateMigration(c,C,g);t.valid||(d.warnings.push(`Migration validation found issues`),t.issues.forEach(t=>{t.type===`error`?d.errors.push(`Validation: ${t.message}`):d.warnings.push(`Validation: ${t.message}`)})),this.reportProgress(`validation`,1,1,`Migration validation completed`)}d.success=d.errors.length===0,d.migrationTime=Date.now()-u,logger.info(`Migration completed in ${d.migrationTime}ms`),logger.info(`Documents restored: ${d.documentsRestored}`),logger.info(`Attachments restored: ${d.attachmentsRestored}`),logger.info(`Design docs restored: ${d.designDocsRestored}`),logger.info(`CourseConfig restored: ${d.courseConfigRestored}`),d.errors.length>0&&logger.error(`Migration completed with ${d.errors.length} errors`),d.warnings.length>0&&logger.warn(`Migration completed with ${d.warnings.length} warnings`)}catch(t){d.success=!1,d.migrationTime=Date.now()-u;let m=t instanceof Error?t.message:String(t);if(d.errors.push(`Migration failed: ${m}`),logger.error(`Migration failed:`,t),this.options.cleanupOnFailure)try{await this.cleanupFailedMigration(c)}catch(t){logger.error(`Failed to cleanup after migration failure:`,t),d.warnings.push(`Failed to cleanup after migration failure`)}}return d}async loadManifest(t){try{let c,u;if(this.fs)u=this.fs.joinPath(t,`manifest.json`),c=await this.fs.readFile(u);else if(u=nodeFS3&&nodePath?nodePath.join(t,`manifest.json`):`${t}/manifest.json`,nodeFS3&&this.isLocalPath(t))c=await nodeFS3.promises.readFile(u,`utf8`);else{let t=await fetch(u);if(!t.ok)throw Error(`Failed to fetch manifest: ${t.status} ${t.statusText}`);c=await t.text()}let d=JSON.parse(c);if(!d.version||!d.courseId||!d.chunks)throw Error(`Invalid manifest structure`);return d}catch(t){let c=t instanceof FileSystemError?t.message:`Failed to load manifest: ${t instanceof Error?t.message:String(t)}`;throw Error(c)}}async restoreDesignDocuments(t,c){let u={restored:0,errors:[],warnings:[]};for(let d=0;d<t.length;d++){let m=t[d];this.reportProgress(`design_docs`,d,t.length,`Restoring ${m._id}...`);try{let t;try{t=await c.get(m._id)}catch{}let d={_id:m._id,views:m.views};t?(d._rev=t._rev,logger.debug(`Updating existing design document: ${m._id}`)):logger.debug(`Creating new design document: ${m._id}`),await c.put(d),u.restored++}catch(t){let c=`Failed to restore design document ${m._id}: ${t instanceof Error?t.message:String(t)}`;u.errors.push(c),logger.error(c)}}return this.reportProgress(`design_docs`,t.length,t.length,`Restored ${u.restored} design documents`),u}async aggregateDocuments(t,c){let u=[],d=new Map;for(let m=0;m<c.chunks.length;m++){let g=c.chunks[m];this.reportProgress(`documents`,u.length,c.documentCount,`Loading chunk ${g.id}...`);try{let c=await this.loadChunk(t,g);for(let t of c){if(!t._id){logger.warn(`Document without _id found in chunk ${g.id}, skipping`);continue}d.has(t._id)&&logger.warn(`Duplicate document ID found: ${t._id}, using latest version`),d.set(t._id,t)}}catch(t){throw Error(`Failed to load chunk ${g.id}: ${t instanceof Error?t.message:String(t)}`)}}return u.push(...d.values()),logger.info(`Aggregated ${u.length} unique documents from ${c.chunks.length} chunks`),u}async loadChunk(t,c){try{let u,d;if(this.fs)d=this.fs.joinPath(t,c.path),u=await this.fs.readFile(d);else if(d=nodeFS3&&nodePath?nodePath.join(t,c.path):`${t}/${c.path}`,nodeFS3&&this.isLocalPath(t))u=await nodeFS3.promises.readFile(d,`utf8`);else{let t=await fetch(d);if(!t.ok)throw Error(`Failed to fetch chunk: ${t.status} ${t.statusText}`);u=await t.text()}let m=JSON.parse(u);if(!Array.isArray(m))throw Error(`Chunk file does not contain an array of documents`);return m}catch(t){let c=t instanceof FileSystemError?t.message:`Failed to load chunk: ${t instanceof Error?t.message:String(t)}`;throw Error(c)}}async uploadDocuments(t,c){let u={restored:0,errors:[],warnings:[]},d=this.options.chunkBatchSize;for(let m=0;m<t.length;m+=d){let g=t.slice(m,m+d);this.reportProgress(`documents`,m,t.length,`Uploading batch ${Math.floor(m/d)+1}...`);try{let t=g.map(t=>{let c={...t};return delete c._rev,delete c._attachments,c}),d=await c.bulkDocs(t);for(let t=0;t<d.length;t++){let c=d[t],m=g[t];if(`error`in c){let t=`Failed to upload document ${m._id}: ${c.error} - ${c.reason}`;u.errors.push(t),logger.error(t)}else u.restored++}}catch(t){let c;c=t instanceof Error||t&&typeof t==`object`&&`message`in t?`Failed to upload document batch starting at index ${m}: ${t.message}`:`Failed to upload document batch starting at index ${m}: ${JSON.stringify(t)}`,u.errors.push(c),logger.error(c)}}return this.reportProgress(`documents`,t.length,t.length,`Uploaded ${u.restored} documents`),u}async uploadAttachments(t,c,u){let d={restored:0,errors:[],warnings:[]},m=0;for(let g of c)if(this.reportProgress(`attachments`,m,c.length,`Processing attachments for ${g._id}...`),m++,g._attachments)for(let[c,m]of Object.entries(g._attachments))try{let b=await this.uploadSingleAttachment(t,g._id,c,m,u);b.success?d.restored++:d.errors.push(b.error||`Unknown attachment upload error`)}catch(t){let u=`Failed to upload attachment ${g._id}/${c}: ${t instanceof Error?t.message:String(t)}`;d.errors.push(u),logger.error(u)}return this.reportProgress(`attachments`,c.length,c.length,`Uploaded ${d.restored} attachments`),d}async uploadSingleAttachment(t,c,u,d,m){let g={success:!1,attachmentName:u,docId:c};try{if(!d.path)return g.error=`Attachment metadata missing file path`,g;let b,S;if(this.fs)S=this.fs.joinPath(t,d.path),b=await this.fs.readBinary(S);else if(S=nodeFS3&&nodePath?nodePath.join(t,d.path):`${t}/${d.path}`,nodeFS3&&this.isLocalPath(t))b=await nodeFS3.promises.readFile(S);else{let t=await fetch(S);if(!t.ok)return g.error=`Failed to fetch attachment: ${t.status} ${t.statusText}`,g;b=await t.arrayBuffer()}let C=await m.get(c);await m.putAttachment(c,u,C._rev,b,d.content_type),g.success=!0}catch(t){g.error=t instanceof Error?t.message:String(t)}return g}async restoreCourseConfig(t,c){let u={restored:0,errors:[],warnings:[]};try{if(!t.courseConfig)return u.warnings.push(`No courseConfig found in manifest, skipping CourseConfig document creation`),u;let d={_id:`CourseConfig`,...t.courseConfig,courseID:t.courseId};delete d._rev,await c.put(d),u.restored=1,logger.info(`CourseConfig document created for course: ${t.courseId}`)}catch(t){let c=t instanceof Error?t.message:JSON.stringify(t);u.errors.push(`Failed to restore CourseConfig: ${c}`),logger.error(`CourseConfig restoration failed:`,t)}return u}calculateExpectedCounts(t){let c={};for(let u of t.chunks)c[u.docType]=(c[u.docType]||0)+u.documentCount;return t.designDocs.length>0&&(c._design=t.designDocs.length),c}async cleanupFailedMigration(t){logger.info(`Cleaning up failed migration...`);try{let c=(await t.allDocs()).rows.map(t=>({_id:t.id,_rev:t.value.rev,_deleted:!0}));c.length>0&&(await t.bulkDocs(c),logger.info(`Cleaned up ${c.length} documents from failed migration`))}catch(t){throw logger.error(`Failed to cleanup documents:`,t),t}}reportProgress(t,c,u,d){this.progressCallback&&this.progressCallback({phase:t,current:c,total:u,message:d})}isLocalPath(t){return!t.startsWith(`http://`)&&!t.startsWith(`https://`)}},init_dataDirectory(),init_navigators(),QuotaRoundRobinMixer=class{mix(t,c){if(t.length===0)return[];let u=Math.ceil(c/t.length),d=t.map(t=>[...t.weighted].sort((t,c)=>c.score-t.score).slice(0,u));for(let t=d.length-1;t>0;t--){let c=Math.floor(Math.random()*(t+1));[d[t],d[c]]=[d[c],d[t]]}let m=[],g=0,b=Array(d.length).fill(0);for(;m.length<c&&g<d.length;){g=0;for(let t=0;t<d.length&&!(m.length>=c);t++)b[t]<d[t].length?(m.push(d[t][b[t]]),b[t]++):g++}return m}},init_logger(),init_navigators(),MAX_RUNS2=10,runHistory2=[],mixerDebugAPI={get runs(){return[...runHistory2]},showRun(t=0){if(runHistory2.length===0){logger.info(`[Mixer Debug] No runs captured yet.`);return}let c;if(typeof t==`number`){if(c=runHistory2[t],!c){logger.info(`[Mixer Debug] No run found at index ${t}. History length: ${runHistory2.length}`);return}}else if(c=runHistory2.find(c=>c.runId.endsWith(t)),!c){logger.info(`[Mixer Debug] No run found matching ID '${t}'.`);return}printMixerSummary(c)},showLastMix(){this.showRun(0)},explainSourceBalance(){if(runHistory2.length===0){logger.info(`[Mixer Debug] No runs captured yet.`);return}let t=runHistory2[0];console.group(`⚖️ Source Balance Analysis`),logger.info(`Mixer: ${t.mixerType}`),logger.info(`Requested limit: ${t.requestedLimit}`),t.quotaPerSource&&logger.info(`Quota per source: ${t.quotaPerSource}`),console.group(`Input Distribution:`);for(let c of t.sourceSummaries){let t=c.sourceName||c.sourceId;logger.info(`${t}:`),logger.info(` Provided: ${c.totalCards} cards (${c.reviewCount} reviews, ${c.newCount} new)`),logger.info(` Score range: [${c.scoreRange[0].toFixed(2)}, ${c.scoreRange[1].toFixed(2)}]`)}console.groupEnd(),console.group(`Selection Results:`);for(let c of t.sourceBreakdowns){let t=c.sourceName||c.sourceId;logger.info(`${t}:`),logger.info(` Selected: ${c.totalSelected}/${c.reviewsProvided+c.newProvided} (${c.selectionRate.toFixed(1)}%)`),logger.info(` Reviews: ${c.reviewsSelected}/${c.reviewsProvided}`),logger.info(` New: ${c.newSelected}/${c.newProvided}`),c.reviewsProvided>0&&c.reviewsSelected===0&&logger.info(` ⚠️ Had reviews but none selected!`),c.totalSelected===0&&c.reviewsProvided+c.newProvided>0&&logger.info(` ⚠️ Had cards but none selected!`)}console.groupEnd();let c=t.sourceBreakdowns.map(t=>t.selectionRate),u=c.reduce((t,c)=>t+c,0)/c.length,d=Math.max(...c.map(t=>Math.abs(t-u)));d>20&&(logger.info(`
407
+ `)}},init_couch(),init_core(),init_recording(),init_Loggable(),init_types_legacy(),init_logger(),CouchDBToStaticPacker=class{constructor(t={}){_defineProperty$2(this,`config`,void 0),_defineProperty$2(this,`sourceDB`,null),this.config={chunkSize:1e3,includeAttachments:!0,...t}}async packCourse(t,c){logger.info(`Starting static pack for course: ${c}`),this.sourceDB=t;let u={version:`1.0.0`,courseId:c,courseName:``,courseConfig:null,lastUpdated:new Date().toISOString(),documentCount:0,chunks:[],indices:[],designDocs:[]},d=await this.extractCourseConfig(t);u.courseName=d.name,u.courseConfig=d,u.designDocs=await this.extractDesignDocs(t);let m=await this.extractDocumentsByType(t),g=new Map;this.config.includeAttachments&&await this.extractAllAttachments(m,g);let b=new Map;for(let[t,c]of Object.entries(m)){let d=this.createChunks(c,t);u.chunks.push(...d),u.documentCount+=c.length,this.prepareChunkData(d,c,b)}let S=new Map;return u.indices=await this.buildIndices(m,u.designDocs,S),{manifest:u,chunks:b,indices:S,attachments:g}}async packCourseToFiles(t,c,u,d){logger.info(`Packing course ${c} to files in ${u}`);let m=await this.packCourse(t,c),g=await this.writePackedDataToFiles(m,u,d);return{manifest:m.manifest,filesWritten:g,attachmentsFound:m.attachments?m.attachments.size:0}}async writePackedDataToFiles(t,c,u){let d=0;await u.ensureDir(c);let m=u.joinPath(c,`manifest.json`);await u.writeJson(m,t.manifest,{spaces:2}),d++,logger.info(`Wrote manifest: ${m}`);let g=u.joinPath(c,`chunks`),b=u.joinPath(c,`indices`);await u.ensureDir(g),await u.ensureDir(b);for(let[c,m]of t.chunks){let t=u.joinPath(g,`${c}.json`);await u.writeJson(t,m),d++}logger.info(`Wrote ${t.chunks.size} chunk files`);for(let[c,m]of t.indices){let t=u.joinPath(b,`${c}.json`);await u.writeJson(t,m,{spaces:2}),d++}if(logger.info(`Wrote ${t.indices.size} index files`),t.attachments&&t.attachments.size>0){for(let[m,g]of t.attachments){let t=u.joinPath(c,m),b=u.dirname(t);await u.ensureDir(b),await u.writeFile(t,g.buffer),d++}logger.info(`Wrote ${t.attachments.size} attachment files`)}return d}async extractCourseConfig(t){try{return await t.get(`CourseConfig`)}catch(t){throw logger.error(`Failed to extract course config:`,t),Error(`Course config not found`)}}async extractDesignDocs(t){return(await t.allDocs({startkey:`_design/`,endkey:`_design/￰`,include_docs:!0})).rows.map(t=>({_id:t.id,views:t.doc.views||{}}))}async extractDocumentsByType(t){let c=await t.allDocs({include_docs:!0}),u={};for(let t of c.rows){if(t.id.startsWith(`_`))continue;let c=t.doc;c.docType&&(u[c.docType]||(u[c.docType]=[]),u[c.docType].push(c))}return u}createChunks(t,c){let u=[],d=t.sort((t,c)=>t._id.localeCompare(c._id));for(let t=0;t<d.length;t+=this.config.chunkSize){let m=d.slice(t,t+this.config.chunkSize),g=`${c}-${String(Math.floor(t/this.config.chunkSize)).padStart(4,`0`)}`;u.push({id:g,docType:c,startKey:m[0]._id,endKey:m[m.length-1]._id,documentCount:m.length,path:`chunks/${g}.json`})}return u}prepareChunkData(t,c,u){let d=c.sort((t,c)=>t._id.localeCompare(c._id));for(let c of t){let t=d.filter(t=>t._id>=c.startKey&&t._id<=c.endKey).map(t=>{let c={...t};return delete c._rev,this.config.includeAttachments&&c._attachments?c._attachments=this.transformAttachmentStubs(c._attachments,c._id):this.config.includeAttachments||delete c._attachments,c});u.set(c.id,t)}}async buildIndices(t,c,u){let d=[];if(t.CARD){let c=await this.buildEloIndex(t.CARD,u);d.push(c)}if(t.TAG){let c=await this.buildTagIndex(t.TAG,u);d.push(c)}for(let t of c)for(let[c,m]of Object.entries(t.views))if(m.map){logger.info(`Processing view: ${t._id}/${c}`);let m=await this.buildViewIndex(c,t,u);m?(d.push(m),logger.info(`Successfully built index: ${m.name}`)):logger.warn(`Skipped view index: ${t._id}/${c}`)}return d}async buildEloIndex(t,c){let u=[];for(let c of t)c.elo?.global?.score&&u.push({elo:c.elo.global.score,cardId:c._id});u.sort((t,c)=>t.elo-c.elo);let d={},m=50;for(let t of u){let c=Math.floor(t.elo/50)*50;d[c]||(d[c]=[]),d[c].push(t.cardId)}return c.set(`elo`,{sorted:u,buckets:d,stats:{min:u[0]?.elo||0,max:u[u.length-1]?.elo||0,count:u.length}}),{name:`elo`,type:`btree`,path:`indices/elo.json`}}async buildTagIndex(t,c){let u={};for(let c of t)u[c.name]={cardIds:c.taggedCards,snippet:c.snippet,count:c.taggedCards.length};let d={};for(let c of t)for(let t of c.taggedCards)d[t]||(d[t]=[]),d[t].push(c.name);return c.set(`tags`,{byTag:u,byCard:d}),{name:`tags`,type:`hash`,path:`indices/tags.json`}}async buildViewIndex(t,c,u){if(!this.sourceDB)return logger.error(`Source database not available for view querying`),null;try{let d=`${c._id.replace(`_design/`,``)}/${t}`;logger.info(`Querying CouchDB view: ${d}`);let m=await this.sourceDB.query(d,{include_docs:!1});if(!m.rows||m.rows.length===0)return logger.warn(`View ${d} returned no results`),null;logger.info(`Successfully queried view ${d}: ${m.rows.length} results`);let g=this.formatViewResults(t,m.rows,c),b=`view-${c._id.replace(`_design/`,``)}-${t}`;return u.set(b,g),{name:b,type:`view`,path:`indices/${b}.json`}}catch(u){return logger.error(`Failed to query view ${c._id}/${t}:`,u),null}}formatViewResults(t,c,u){let d={type:`couchdb-view`,viewName:t,designDoc:u._id,results:c,metadata:{resultCount:c.length,generatedAt:new Date().toISOString()}};switch(t){case`elo`:return this.formatEloViewIndex(c,d);case`getTags`:return this.formatTagsViewIndex(c,d);case`cardsByInexperience`:return this.formatInexperienceViewIndex(c,d);default:return this.formatGenericViewIndex(c,d)}}formatEloViewIndex(t,c){let u=t.sort((t,c)=>typeof t.key==`number`&&typeof c.key==`number`?t.key-c.key:0);return{...c,sorted:u,stats:{min:u[0]?.key||0,max:u[u.length-1]?.key||0,count:u.length}}}formatTagsViewIndex(t,c){let u={};for(let c of t){let t=c.key;typeof t==`string`&&(u[t]||(u[t]=[]),u[t].push(c.id))}return{...c,byTag:u,tagCount:Object.keys(u).length}}formatInexperienceViewIndex(t,c){let u=t.sort((t,c)=>typeof t.key==`number`&&typeof c.key==`number`?t.key-c.key:0);return{...c,sorted:u,stats:{minInexperience:u[0]?.key||0,maxInexperience:u[u.length-1]?.key||0,count:u.length}}}formatGenericViewIndex(t,c){return{...c}}async extractAllAttachments(t,c){logger.info(`Extracting attachments...`);let u=[];for(let c of Object.values(t))u.push(...c);let d=u.filter(t=>t._attachments&&Object.keys(t._attachments).length>0);if(d.length===0){logger.info(`No attachments found`);return}logger.info(`Found ${d.length} documents with attachments`);let m=d.map(t=>this.extractDocumentAttachments(t,c));await Promise.all(m),logger.info(`Extracted ${c.size} attachment files`)}async extractDocumentAttachments(t,c){if(!t._attachments||!this.sourceDB)return;let u=t._id;for(let[d,m]of Object.entries(t._attachments))try{let t=await this.sourceDB.getAttachment(u,d),g;if(t instanceof ArrayBuffer)g=Buffer.from(t);else if(Buffer.isBuffer(t))g=t;else{let c=t;g=Buffer.from(await c.arrayBuffer())}let b=`${d}${this.getFileExtension(m.content_type)}`,S=`attachments/${u}/${b}`;c.set(S,{docId:u,attachmentName:d,filename:b,path:S,contentType:m.content_type,length:m.length||g.length,digest:m.digest,buffer:g}),logger.debug(`Extracted attachment: ${S}`)}catch(t){throw logger.error(`Failed to extract attachment ${u}/${d}:`,t),Error(`Failed to extract attachment ${u}/${d}: ${t}`)}}transformAttachmentStubs(t,c){let u={};for(let[d,m]of Object.entries(t))u[d]={path:`attachments/${c}/${`${d}${this.getFileExtension(m.content_type)}`}`,content_type:m.content_type,length:m.length,digest:m.digest,stub:!1};return u}getFileExtension(t){return{"image/jpeg":`.jpg`,"image/jpg":`.jpg`,"image/png":`.png`,"image/gif":`.gif`,"image/webp":`.webp`,"audio/mpeg":`.mp3`,"audio/mp3":`.mp3`,"audio/wav":`.wav`,"audio/ogg":`.ogg`,"video/mp4":`.mp4`,"video/webm":`.webm`,"application/pdf":`.pdf`,"text/plain":`.txt`,"application/json":`.json`}[t]||``}},init_logger(),DEFAULT_MIGRATION_OPTIONS={chunkBatchSize:100,validateRoundTrip:!1,cleanupOnFailure:!0,timeout:3e5},init_logger(),FileSystemError=class extends Error{constructor(t,c,u,d){super(t),this.operation=c,this.filePath=u,this.cause=d,this.name=`FileSystemError`}},nodeFS2=null;try{typeof window>`u`&&typeof process<`u`&&process.versions?.node&&(nodeFS2=eval(`require`)(`fs`),nodeFS2.promises=nodeFS2.promises||eval(`require`)(`fs`).promises)}catch{}nodeFS3=null,nodePath=null;try{typeof window>`u`&&typeof process<`u`&&process.versions?.node&&(nodeFS3=eval(`require`)(`fs`),nodePath=eval(`require`)(`path`),nodeFS3.promises=nodeFS3.promises||eval(`require`)(`fs`).promises)}catch{}StaticToCouchDBMigrator=class{constructor(t={},c){_defineProperty$2(this,`options`,void 0),_defineProperty$2(this,`progressCallback`,void 0),_defineProperty$2(this,`fs`,void 0),this.options={...DEFAULT_MIGRATION_OPTIONS,...t},this.fs=c}setProgressCallback(t){this.progressCallback=t}async migrateCourse(t,c){let u=Date.now(),d={success:!1,documentsRestored:0,attachmentsRestored:0,designDocsRestored:0,courseConfigRestored:0,errors:[],warnings:[],migrationTime:0};try{logger.info(`Starting migration from ${t} to CouchDB`),this.reportProgress(`manifest`,0,1,`Validating static course...`);let m=await validateStaticCourse(t,this.fs);if(!m.valid)throw d.errors.push(...m.errors),Error(`Static course validation failed: ${m.errors.join(`, `)}`);d.warnings.push(...m.warnings),this.reportProgress(`manifest`,1,1,`Loading course manifest...`);let g=await this.loadManifest(t);logger.info(`Loaded manifest for course: ${g.courseId} (${g.courseName})`),this.reportProgress(`design_docs`,0,g.designDocs.length,`Restoring design documents...`);let b=await this.restoreDesignDocuments(g.designDocs,c);d.designDocsRestored=b.restored,d.errors.push(...b.errors),d.warnings.push(...b.warnings),this.reportProgress(`course_config`,0,1,`Restoring CourseConfig document...`);let S=await this.restoreCourseConfig(g,c);d.courseConfigRestored=S.restored,d.errors.push(...S.errors),d.warnings.push(...S.warnings),this.reportProgress(`course_config`,1,1,`CourseConfig document restored`);let C=this.calculateExpectedCounts(g);this.reportProgress(`documents`,0,g.documentCount,`Aggregating documents from chunks...`);let w=await this.aggregateDocuments(t,g),T=w.filter(t=>t._id!==`CourseConfig`);w.length!==T.length&&d.warnings.push(`Filtered out ${w.length-T.length} CourseConfig document(s) from chunks to prevent conflicts`),this.reportProgress(`documents`,T.length,g.documentCount,`Uploading documents to CouchDB...`);let E=await this.uploadDocuments(T,c);d.documentsRestored=E.restored,d.errors.push(...E.errors),d.warnings.push(...E.warnings);let D=w.filter(t=>t._attachments&&Object.keys(t._attachments).length>0);this.reportProgress(`attachments`,0,D.length,`Uploading attachments...`);let O=await this.uploadAttachments(t,D,c);if(d.attachmentsRestored=O.restored,d.errors.push(...O.errors),d.warnings.push(...O.warnings),this.options.validateRoundTrip){this.reportProgress(`validation`,0,1,`Validating migration...`);let t=await validateMigration(c,C,g);t.valid||(d.warnings.push(`Migration validation found issues`),t.issues.forEach(t=>{t.type===`error`?d.errors.push(`Validation: ${t.message}`):d.warnings.push(`Validation: ${t.message}`)})),this.reportProgress(`validation`,1,1,`Migration validation completed`)}d.success=d.errors.length===0,d.migrationTime=Date.now()-u,logger.info(`Migration completed in ${d.migrationTime}ms`),logger.info(`Documents restored: ${d.documentsRestored}`),logger.info(`Attachments restored: ${d.attachmentsRestored}`),logger.info(`Design docs restored: ${d.designDocsRestored}`),logger.info(`CourseConfig restored: ${d.courseConfigRestored}`),d.errors.length>0&&logger.error(`Migration completed with ${d.errors.length} errors`),d.warnings.length>0&&logger.warn(`Migration completed with ${d.warnings.length} warnings`)}catch(t){d.success=!1,d.migrationTime=Date.now()-u;let m=t instanceof Error?t.message:String(t);if(d.errors.push(`Migration failed: ${m}`),logger.error(`Migration failed:`,t),this.options.cleanupOnFailure)try{await this.cleanupFailedMigration(c)}catch(t){logger.error(`Failed to cleanup after migration failure:`,t),d.warnings.push(`Failed to cleanup after migration failure`)}}return d}async loadManifest(t){try{let c,u;if(this.fs)u=this.fs.joinPath(t,`manifest.json`),c=await this.fs.readFile(u);else if(u=nodeFS3&&nodePath?nodePath.join(t,`manifest.json`):`${t}/manifest.json`,nodeFS3&&this.isLocalPath(t))c=await nodeFS3.promises.readFile(u,`utf8`);else{let t=await fetch(u);if(!t.ok)throw Error(`Failed to fetch manifest: ${t.status} ${t.statusText}`);c=await t.text()}let d=JSON.parse(c);if(!d.version||!d.courseId||!d.chunks)throw Error(`Invalid manifest structure`);return d}catch(t){let c=t instanceof FileSystemError?t.message:`Failed to load manifest: ${t instanceof Error?t.message:String(t)}`;throw Error(c)}}async restoreDesignDocuments(t,c){let u={restored:0,errors:[],warnings:[]};for(let d=0;d<t.length;d++){let m=t[d];this.reportProgress(`design_docs`,d,t.length,`Restoring ${m._id}...`);try{let t;try{t=await c.get(m._id)}catch{}let d={_id:m._id,views:m.views};t?(d._rev=t._rev,logger.debug(`Updating existing design document: ${m._id}`)):logger.debug(`Creating new design document: ${m._id}`),await c.put(d),u.restored++}catch(t){let c=`Failed to restore design document ${m._id}: ${t instanceof Error?t.message:String(t)}`;u.errors.push(c),logger.error(c)}}return this.reportProgress(`design_docs`,t.length,t.length,`Restored ${u.restored} design documents`),u}async aggregateDocuments(t,c){let u=[],d=new Map;for(let m=0;m<c.chunks.length;m++){let g=c.chunks[m];this.reportProgress(`documents`,u.length,c.documentCount,`Loading chunk ${g.id}...`);try{let c=await this.loadChunk(t,g);for(let t of c){if(!t._id){logger.warn(`Document without _id found in chunk ${g.id}, skipping`);continue}d.has(t._id)&&logger.warn(`Duplicate document ID found: ${t._id}, using latest version`),d.set(t._id,t)}}catch(t){throw Error(`Failed to load chunk ${g.id}: ${t instanceof Error?t.message:String(t)}`)}}return u.push(...d.values()),logger.info(`Aggregated ${u.length} unique documents from ${c.chunks.length} chunks`),u}async loadChunk(t,c){try{let u,d;if(this.fs)d=this.fs.joinPath(t,c.path),u=await this.fs.readFile(d);else if(d=nodeFS3&&nodePath?nodePath.join(t,c.path):`${t}/${c.path}`,nodeFS3&&this.isLocalPath(t))u=await nodeFS3.promises.readFile(d,`utf8`);else{let t=await fetch(d);if(!t.ok)throw Error(`Failed to fetch chunk: ${t.status} ${t.statusText}`);u=await t.text()}let m=JSON.parse(u);if(!Array.isArray(m))throw Error(`Chunk file does not contain an array of documents`);return m}catch(t){let c=t instanceof FileSystemError?t.message:`Failed to load chunk: ${t instanceof Error?t.message:String(t)}`;throw Error(c)}}async uploadDocuments(t,c){let u={restored:0,errors:[],warnings:[]},d=this.options.chunkBatchSize;for(let m=0;m<t.length;m+=d){let g=t.slice(m,m+d);this.reportProgress(`documents`,m,t.length,`Uploading batch ${Math.floor(m/d)+1}...`);try{let t=g.map(t=>{let c={...t};return delete c._rev,delete c._attachments,c}),d=await c.bulkDocs(t);for(let t=0;t<d.length;t++){let c=d[t],m=g[t];if(`error`in c){let t=`Failed to upload document ${m._id}: ${c.error} - ${c.reason}`;u.errors.push(t),logger.error(t)}else u.restored++}}catch(t){let c;c=t instanceof Error||t&&typeof t==`object`&&`message`in t?`Failed to upload document batch starting at index ${m}: ${t.message}`:`Failed to upload document batch starting at index ${m}: ${JSON.stringify(t)}`,u.errors.push(c),logger.error(c)}}return this.reportProgress(`documents`,t.length,t.length,`Uploaded ${u.restored} documents`),u}async uploadAttachments(t,c,u){let d={restored:0,errors:[],warnings:[]},m=0;for(let g of c)if(this.reportProgress(`attachments`,m,c.length,`Processing attachments for ${g._id}...`),m++,g._attachments)for(let[c,m]of Object.entries(g._attachments))try{let b=await this.uploadSingleAttachment(t,g._id,c,m,u);b.success?d.restored++:d.errors.push(b.error||`Unknown attachment upload error`)}catch(t){let u=`Failed to upload attachment ${g._id}/${c}: ${t instanceof Error?t.message:String(t)}`;d.errors.push(u),logger.error(u)}return this.reportProgress(`attachments`,c.length,c.length,`Uploaded ${d.restored} attachments`),d}async uploadSingleAttachment(t,c,u,d,m){let g={success:!1,attachmentName:u,docId:c};try{if(!d.path)return g.error=`Attachment metadata missing file path`,g;let b,S;if(this.fs)S=this.fs.joinPath(t,d.path),b=await this.fs.readBinary(S);else if(S=nodeFS3&&nodePath?nodePath.join(t,d.path):`${t}/${d.path}`,nodeFS3&&this.isLocalPath(t))b=await nodeFS3.promises.readFile(S);else{let t=await fetch(S);if(!t.ok)return g.error=`Failed to fetch attachment: ${t.status} ${t.statusText}`,g;b=await t.arrayBuffer()}let C=await m.get(c);await m.putAttachment(c,u,C._rev,b,d.content_type),g.success=!0}catch(t){g.error=t instanceof Error?t.message:String(t)}return g}async restoreCourseConfig(t,c){let u={restored:0,errors:[],warnings:[]};try{if(!t.courseConfig)return u.warnings.push(`No courseConfig found in manifest, skipping CourseConfig document creation`),u;let d={_id:`CourseConfig`,...t.courseConfig,courseID:t.courseId};delete d._rev,await c.put(d),u.restored=1,logger.info(`CourseConfig document created for course: ${t.courseId}`)}catch(t){let c=t instanceof Error?t.message:JSON.stringify(t);u.errors.push(`Failed to restore CourseConfig: ${c}`),logger.error(`CourseConfig restoration failed:`,t)}return u}calculateExpectedCounts(t){let c={};for(let u of t.chunks)c[u.docType]=(c[u.docType]||0)+u.documentCount;return t.designDocs.length>0&&(c._design=t.designDocs.length),c}async cleanupFailedMigration(t){logger.info(`Cleaning up failed migration...`);try{let c=(await t.allDocs()).rows.map(t=>({_id:t.id,_rev:t.value.rev,_deleted:!0}));c.length>0&&(await t.bulkDocs(c),logger.info(`Cleaned up ${c.length} documents from failed migration`))}catch(t){throw logger.error(`Failed to cleanup documents:`,t),t}}reportProgress(t,c,u,d){this.progressCallback&&this.progressCallback({phase:t,current:c,total:u,message:d})}isLocalPath(t){return!t.startsWith(`http://`)&&!t.startsWith(`https://`)}},init_dataDirectory(),init_navigators(),init_Pipeline(),QuotaRoundRobinMixer=class{mix(t,c){if(t.length===0)return[];let u=Math.ceil(c/t.length),d=t.map(t=>[...t.weighted].sort((t,c)=>c.score-t.score).slice(0,u));for(let t=d.length-1;t>0;t--){let c=Math.floor(Math.random()*(t+1));[d[t],d[c]]=[d[c],d[t]]}let m=[],g=0,b=Array(d.length).fill(0);for(;m.length<c&&g<d.length;){g=0;for(let t=0;t<d.length&&!(m.length>=c);t++)b[t]<d[t].length?(m.push(d[t][b[t]]),b[t]++):g++}return m}},init_logger(),init_navigators(),MAX_RUNS2=10,runHistory2=[],mixerDebugAPI={get runs(){return[...runHistory2]},showRun(t=0){if(runHistory2.length===0){logger.info(`[Mixer Debug] No runs captured yet.`);return}let c;if(typeof t==`number`){if(c=runHistory2[t],!c){logger.info(`[Mixer Debug] No run found at index ${t}. History length: ${runHistory2.length}`);return}}else if(c=runHistory2.find(c=>c.runId.endsWith(t)),!c){logger.info(`[Mixer Debug] No run found matching ID '${t}'.`);return}printMixerSummary(c)},showLastMix(){this.showRun(0)},explainSourceBalance(){if(runHistory2.length===0){logger.info(`[Mixer Debug] No runs captured yet.`);return}let t=runHistory2[0];console.group(`⚖️ Source Balance Analysis`),logger.info(`Mixer: ${t.mixerType}`),logger.info(`Requested limit: ${t.requestedLimit}`),t.quotaPerSource&&logger.info(`Quota per source: ${t.quotaPerSource}`),console.group(`Input Distribution:`);for(let c of t.sourceSummaries){let t=c.sourceName||c.sourceId;logger.info(`${t}:`),logger.info(` Provided: ${c.totalCards} cards (${c.reviewCount} reviews, ${c.newCount} new)`),logger.info(` Score range: [${c.scoreRange[0].toFixed(2)}, ${c.scoreRange[1].toFixed(2)}]`)}console.groupEnd(),console.group(`Selection Results:`);for(let c of t.sourceBreakdowns){let t=c.sourceName||c.sourceId;logger.info(`${t}:`),logger.info(` Selected: ${c.totalSelected}/${c.reviewsProvided+c.newProvided} (${c.selectionRate.toFixed(1)}%)`),logger.info(` Reviews: ${c.reviewsSelected}/${c.reviewsProvided}`),logger.info(` New: ${c.newSelected}/${c.newProvided}`),c.reviewsProvided>0&&c.reviewsSelected===0&&logger.info(` ⚠️ Had reviews but none selected!`),c.totalSelected===0&&c.reviewsProvided+c.newProvided>0&&logger.info(` ⚠️ Had cards but none selected!`)}console.groupEnd();let c=t.sourceBreakdowns.map(t=>t.selectionRate),u=c.reduce((t,c)=>t+c,0)/c.length,d=Math.max(...c.map(t=>Math.abs(t-u)));d>20&&(logger.info(`
408
408
  \u26A0\uFE0F Significant imbalance detected (max deviation: ${d.toFixed(1)}%)`),logger.info(`Possible causes:`),logger.info(` - Score range differences between sources`),logger.info(` - One source has much better quality cards`),logger.info(` - Different card availability (reviews vs new)`)),console.groupEnd()},compareScores(){if(runHistory2.length===0){logger.info(`[Mixer Debug] No runs captured yet.`);return}let t=runHistory2[0];console.group(`📊 Score Distribution Comparison`),console.table(t.sourceSummaries.map(t=>({source:t.sourceName||t.sourceId,cards:t.totalCards,min:t.bottomScore.toFixed(3),max:t.topScore.toFixed(3),avg:t.avgScore.toFixed(3),range:(t.topScore-t.bottomScore).toFixed(3)})));let c=t.sourceSummaries.map(t=>t.topScore-t.bottomScore),u=t.sourceSummaries.map(t=>t.avgScore),d=Math.max(...c)-Math.min(...c),m=Math.max(...u)-Math.min(...u);(d>.3||m>.2)&&(logger.info(`
409
409
  ⚠️ Significant score distribution differences detected`),logger.info(`This may cause one source to dominate selection if using global sorting (not quota-based)`)),console.groupEnd()},showCard(t){for(let c of runHistory2){let u=c.cards.find(c=>c.cardId===t);if(u){let d=c.sourceSummaries.find(t=>t.sourceIndex===u.sourceIndex);console.group(`\u{1F3B4} Card: ${t}`),logger.info(`Course: ${u.courseId}`),logger.info(`Source: ${d?.sourceName||d?.sourceId||`unknown`}`),logger.info(`Origin: ${u.origin}`),logger.info(`Score: ${u.score.toFixed(3)}`),u.rankInSource&&logger.info(`Rank in source: #${u.rankInSource}`),u.rankInMix&&logger.info(`Rank in mixed results: #${u.rankInMix}`),logger.info(`Selected: ${u.selected?`Yes ✅`:`No ❌`}`),!u.selected&&u.rankInSource&&(logger.info(`
410
410
  Why not selected:`),c.quotaPerSource&&u.rankInSource>c.quotaPerSource&&logger.info(` - Ranked #${u.rankInSource} in source, but quota was ${c.quotaPerSource}`),logger.info(` - Check score compared to selected cards using .showRun()`)),console.groupEnd();return}}logger.info(`[Mixer Debug] Card '${t}' not found in recent runs.`)},listRuns(){if(runHistory2.length===0){logger.info(`[Mixer Debug] No runs captured yet.`);return}console.table(runHistory2.map(t=>({id:t.runId.slice(-8),time:t.timestamp.toLocaleTimeString(),mixer:t.mixerType,sources:t.sourceSummaries.length,selected:t.finalCount,reviews:t.reviewsSelected,new:t.newSelected})))},export(){let t=JSON.stringify(runHistory2,null,2);return logger.info(`[Mixer Debug] Run history exported. Copy the returned string or use:`),logger.info(` copy(window.skuilder.mixer.export())`),t},clear(){runHistory2.length=0,logger.info(`[Mixer Debug] Run history cleared.`)},help(){logger.info(`
@@ -426,10 +426,11 @@ Example:
426
426
  window.skuilder.mixer.showLastMix()
427
427
  window.skuilder.mixer.explainSourceBalance()
428
428
  window.skuilder.mixer.compareScores()
429
- `)}},mountMixerDebugger(),init_logger(),init_PipelineDebugger(),activeSession=null,sessionHistory=[],MAX_HISTORY=5,sessionDebugAPI={get sessions(){return[...sessionHistory]},get active(){return activeSession},showQueue(){showCurrentQueue()},showHistory(t=0){showPresentationHistory(t)},showInterleaving(t=0){showInterleaving(t)},listSessions(){if(activeSession&&logger.info(`Active session: ${activeSession.sessionId} (${activeSession.presentations.length} cards presented)`),sessionHistory.length===0){logger.info(`[Session Debug] No completed sessions in history.`);return}console.table(sessionHistory.map((t,c)=>({index:c,id:t.sessionId.slice(-8),started:t.startTime.toLocaleTimeString(),ended:t.endTime?.toLocaleTimeString()||`incomplete`,cards:t.presentations.length})))},export(){let t={active:activeSession,history:sessionHistory},c=JSON.stringify(t,null,2);return logger.info(`[Session Debug] Session data exported. Copy the returned string or use:`),logger.info(` copy(window.skuilder.session.export())`),c},clear(){sessionHistory.length=0,logger.info(`[Session Debug] Session history cleared.`)},help(){logger.info(`
429
+ `)}},mountMixerDebugger(),init_logger(),init_PipelineDebugger(),init_logger(),activeController=null,OVERLAY_ID=`skuilder-session-overlay`,POLL_MS=300,INLINE_THRESHOLD=5,SPINNER_FRAMES=[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`],spinnerFrame=0,overlayEl=null,pollHandle=null,expanded={reviewQ:!1,newQ:!1,failedQ:!1},activeSession=null,sessionHistory=[],MAX_HISTORY=5,sessionDebugAPI={get sessions(){return[...sessionHistory]},get active(){return activeSession},showQueue(){showCurrentQueue()},dbgOverlay(){toggleSessionOverlay()},showHistory(t=0){showPresentationHistory(t)},showInterleaving(t=0){showInterleaving(t)},listSessions(){if(activeSession&&logger.info(`Active session: ${activeSession.sessionId} (${activeSession.presentations.length} cards presented)`),sessionHistory.length===0){logger.info(`[Session Debug] No completed sessions in history.`);return}console.table(sessionHistory.map((t,c)=>({index:c,id:t.sessionId.slice(-8),started:t.startTime.toLocaleTimeString(),ended:t.endTime?.toLocaleTimeString()||`incomplete`,cards:t.presentations.length})))},export(){let t={active:activeSession,history:sessionHistory},c=JSON.stringify(t,null,2);return logger.info(`[Session Debug] Session data exported. Copy the returned string or use:`),logger.info(` copy(window.skuilder.session.export())`),c},clear(){sessionHistory.length=0,logger.info(`[Session Debug] Session history cleared.`)},help(){logger.info(`
430
430
  🎯 Session Debug API
431
431
 
432
432
  Commands:
433
+ .dbgOverlay() Toggle the pinned live overlay (queues, hints, timer)
433
434
  .showQueue() Show current queue state (active session only)
434
435
  .showHistory(index?) Show presentation history (0=current/last, 1=previous, etc)
435
436
  .showInterleaving(index?) Analyze course interleaving pattern
@@ -446,16 +447,16 @@ Example:
446
447
  window.skuilder.session.showQueue()
447
448
  `)}},mountSessionDebugger(),init_logger(),SessionController=(_SessionController2=class _SessionController extends Loggable{set sessionRecord(t){this._sessionRecord=t}get secondsRemaining(){return this._secondsRemaining}get hasCardGuarantee(){return this._minCardsGuarantee>0}get report(){let t=this.reviewQ.dequeueCount,c=this.newQ.dequeueCount;return`${t} ${t===1?`review`:`reviews`}, ${c} ${c===1?`new card`:`new cards`}`}get detailedReport(){return this.newQ.toString+`
448
449
  `+this.reviewQ.toString+`
449
- `+this.failedQ.toString}constructor(t,c,u,d,m,g){super(),_defineProperty$2(this,`_className`,`SessionController`),_defineProperty$2(this,`services`,void 0),_defineProperty$2(this,`srsService`,void 0),_defineProperty$2(this,`eloService`,void 0),_defineProperty$2(this,`hydrationService`,void 0),_defineProperty$2(this,`mixer`,void 0),_defineProperty$2(this,`dataLayer`,void 0),_defineProperty$2(this,`courseNameCache`,new Map),_defineProperty$2(this,`_defaultBatchLimit`,20),_defineProperty$2(this,`_initialReviewCap`,200),_defineProperty$2(this,`sources`,void 0),_defineProperty$2(this,`_sessionRecord`,[]),_defineProperty$2(this,`_currentCard`,null),_defineProperty$2(this,`reviewQ`,new ItemQueue),_defineProperty$2(this,`newQ`,new ItemQueue),_defineProperty$2(this,`failedQ`,new ItemQueue),_defineProperty$2(this,`_replanPromise`,null),_defineProperty$2(this,`_wellIndicatedRemaining`,0),_defineProperty$2(this,`_suppressQualityReplan`,!1),_defineProperty$2(this,`_minCardsGuarantee`,0),_defineProperty$2(this,`startTime`,void 0),_defineProperty$2(this,`endTime`,void 0),_defineProperty$2(this,`_secondsRemaining`,void 0),_defineProperty$2(this,`_intervalHandle`,void 0),this.dataLayer=u,this.mixer=m||new QuotaRoundRobinMixer,this.srsService=new SrsService(u.getUserDB()),this.eloService=new EloService(u,u.getUserDB()),this.hydrationService=new CardHydrationService(d,t=>u.getCourseDB(t),()=>this._getItemsToHydrate()),this.services={response:new ResponseProcessor(this.srsService,this.eloService)},this.sources=t,this.startTime=new Date,this._secondsRemaining=c,this.endTime=new Date(this.startTime.valueOf()+1e3*this._secondsRemaining),g?.defaultBatchLimit!==void 0&&(this._defaultBatchLimit=g.defaultBatchLimit),g?.initialReviewCap!==void 0&&(this._initialReviewCap=g.initialReviewCap),this.log(`Session constructed:
450
+ `+this.failedQ.toString}constructor(t,c,u,d,m,g){super(),_defineProperty$2(this,`_className`,`SessionController`),_defineProperty$2(this,`services`,void 0),_defineProperty$2(this,`srsService`,void 0),_defineProperty$2(this,`eloService`,void 0),_defineProperty$2(this,`hydrationService`,void 0),_defineProperty$2(this,`mixer`,void 0),_defineProperty$2(this,`dataLayer`,void 0),_defineProperty$2(this,`courseNameCache`,new Map),_defineProperty$2(this,`_defaultBatchLimit`,20),_defineProperty$2(this,`_initialReviewCap`,200),_defineProperty$2(this,`sources`,void 0),_defineProperty$2(this,`_sessionRecord`,[]),_defineProperty$2(this,`_currentCard`,null),_defineProperty$2(this,`reviewQ`,new ItemQueue),_defineProperty$2(this,`newQ`,new ItemQueue),_defineProperty$2(this,`failedQ`,new ItemQueue),_defineProperty$2(this,`_replanPromise`,null),_defineProperty$2(this,`_activeReplanLabel`,null),_defineProperty$2(this,`_wellIndicatedRemaining`,0),_defineProperty$2(this,`_suppressQualityReplan`,!1),_defineProperty$2(this,`_minCardsGuarantee`,0),_defineProperty$2(this,`_sessionHints`,null),_defineProperty$2(this,`_outcomeObservers`,[]),_defineProperty$2(this,`_sessionControls`,null),_defineProperty$2(this,`startTime`,void 0),_defineProperty$2(this,`endTime`,void 0),_defineProperty$2(this,`_secondsRemaining`,void 0),_defineProperty$2(this,`_intervalHandle`,void 0),this.dataLayer=u,this.mixer=m||new QuotaRoundRobinMixer,this.srsService=new SrsService(u.getUserDB()),this.eloService=new EloService(u,u.getUserDB()),this.hydrationService=new CardHydrationService(d,t=>u.getCourseDB(t),()=>this._getItemsToHydrate()),this.services={response:new ResponseProcessor(this.srsService,this.eloService)},this.sources=t,this.startTime=new Date,this._secondsRemaining=c,this.endTime=new Date(this.startTime.valueOf()+1e3*this._secondsRemaining),g?.defaultBatchLimit!==void 0&&(this._defaultBatchLimit=g.defaultBatchLimit),g?.initialReviewCap!==void 0&&(this._initialReviewCap=g.initialReviewCap),g?.outcomeObservers?.length&&(this._outcomeObservers=[...g.outcomeObservers]),this.log(`Session constructed:
450
451
  startTime: ${this.startTime}
451
452
  endTime: ${this.endTime}
452
453
  defaultBatchLimit: ${this._defaultBatchLimit}
453
- initialReviewCap: ${this._initialReviewCap}`)}tick(){this._secondsRemaining=Math.floor((this.endTime.valueOf()-Date.now())/1e3),this._secondsRemaining<=0&&clearInterval(this._intervalHandle)}estimateCleanupTime(){let t=0;for(let c=0;c<this.failedQ.length;c++){let u=this.failedQ.peek(c),d=this._sessionRecord.find(t=>t.item.cardID===u.cardID),m=0;if(d){for(let t=0;t<d.records.length;t++)m+=d.records[t].timeSpent;m/=d.records.length,t+=m}}let c=t/1e3;return this.log(`Failed card cleanup estimate: ${Math.round(c)}`),c}estimateReviewTime(){let t=5*this.reviewQ.length;return this.log(`Review card time estimate: ${t}`),t}async prepareSession(){if(this.sources.some(t=>typeof t.getWeightedCards!=`function`))throw Error(`[SessionController] All content sources must implement getWeightedCards().`);let t=await this.getWeightedContent();this._wellIndicatedRemaining=t,t>=0&&t<_SessionController.MIN_WELL_INDICATED&&this.log(`[Init] Only ${t}/${_SessionController.MIN_WELL_INDICATED} well-indicated cards in initial load`),await this.hydrationService.ensureHydratedCards(),startSessionTracking(this.reviewQ.length,this.newQ.length,this.failedQ.length),this._intervalHandle=setInterval(()=>{this.tick()},1e3)}async requestReplan(t){let c=this.normalizeReplanOptions(t),u=this._replanHasIntent(c);if(this._replanPromise){if(!u)return this.log(`Replan already in progress, coalescing unhinted auto-replan`),this._replanPromise;let t=c.label?` [${c.label}]`:``;this.log(`Replan in progress; queueing hint-bearing replan${t} behind in-flight run`);let d=this._replanPromise.catch(()=>void 0).then(()=>this._runReplan(c));return this._replanPromise=d.finally(()=>{this._replanPromise===d&&(this._replanPromise=null)}),d}let d=this._runReplan(c);this._replanPromise=d.finally(()=>{this._replanPromise===d&&(this._replanPromise=null)}),await d}_replanHasIntent(t){return!!(t.label||t.limit!==void 0||t.minFollowUpCards!==void 0||t.mode&&t.mode!==`replace`||t.hints&&Object.keys(t.hints).length>0)}async _runReplan(t){t.hints||(t.hints={});let c=t.hints,u=new Set(c.excludeCards??[]);this._currentCard?.item.cardID&&u.add(this._currentCard.item.cardID);for(let t of this._sessionRecord)u.add(t.card.card_id);if(this.newQ.length>0&&u.add(this.newQ.peek(0).cardID),c.excludeCards=[...u],t.hints){let c=t.label?{...t.hints,_label:t.label}:t.hints;for(let t of this.sources)t.setEphemeralHints?.(c)}let d=t.label?` [${t.label}]`:``;this.log(`Mid-session replan requested${d} (limit: ${t.limit??`default`}, mode: ${t.mode??`replace`}${t.hints?`, with hints`:``})`),t.minFollowUpCards!==void 0&&t.minFollowUpCards>0&&(this._minCardsGuarantee=Math.max(this._minCardsGuarantee,t.minFollowUpCards),this.log(`[Replan] Card guarantee set to ${this._minCardsGuarantee}`)),await this._executeReplan(t)}async _replanUncoalesced(t){let c=this._runReplan(t);this._replanPromise=c.finally(()=>{this._replanPromise===c&&(this._replanPromise=null)}),await c}normalizeReplanOptions(t){if(!t)return{};let c=[`hints`,`limit`,`mode`,`label`,`minFollowUpCards`];return Object.keys(t).some(t=>c.includes(t))?t:{hints:t}}async _executeReplan(t={}){let c=t.limit,u=t.mode??`replace`,d=await this.getWeightedContent({replan:!0,additive:u===`merge`,limit:c});this._wellIndicatedRemaining=d,c!==void 0&&c<this._defaultBatchLimit?(this._suppressQualityReplan=!0,this.log(`[Replan] Burst mode (limit=${c}): suppressing quality-based auto-replan`)):this._suppressQualityReplan=!1,d>=0&&d<_SessionController.MIN_WELL_INDICATED&&this.log(`[Replan] Only ${d}/${_SessionController.MIN_WELL_INDICATED} well-indicated cards after replan`),await this.hydrationService.ensureHydratedCards();let m=t.label?` [${t.label}]`:``;this.log(`Replan complete${m}: newQ now has ${this.newQ.length} cards (mode=${u})`),snapshotQueues(this.reviewQ.length,this.newQ.length,this.failedQ.length)}addTime(t){this.endTime=new Date(this.endTime.valueOf()+1e3*t)}get failedCount(){return this.failedQ.length}toString(){return`Session: ${this.reviewQ.length} Reviews, ${this.newQ.length} New, ${this.failedQ.length} failed`}reportString(){return`${this.reviewQ.dequeueCount} Reviews, ${this.newQ.dequeueCount} New, ${this.failedQ.dequeueCount} failed`}getDebugInfo(){let t=this.sources.some(t=>typeof t.getWeightedCards==`function`),extractQueueItems=(t,c=10)=>{let u=[];for(let d=0;d<Math.min(t.length,c);d++){let c=t.peek(d);u.push({courseID:c.courseID||`unknown`,cardID:c.cardID||`unknown`,status:c.status||`unknown`})}return u};return{api:{mode:t?`weighted`:`legacy`,description:t?`Using getWeightedCards() API with scored candidates`:`ERROR: getWeightedCards() not a function.`},reviewQueue:{length:this.reviewQ.length,dequeueCount:this.reviewQ.dequeueCount,items:extractQueueItems(this.reviewQ)},newQueue:{length:this.newQ.length,dequeueCount:this.newQ.dequeueCount,items:extractQueueItems(this.newQ)},failedQueue:{length:this.failedQ.length,dequeueCount:this.failedQ.dequeueCount,items:extractQueueItems(this.failedQ)},hydratedCache:{count:this.hydrationService.hydratedCount,cardIds:this.hydrationService.getHydratedCardIds()},replan:{inProgress:this._replanPromise!==null,suppressQualityReplan:this._suppressQualityReplan,defaultBatchLimit:this._defaultBatchLimit,minCardsGuarantee:this._minCardsGuarantee}}}async getWeightedContent(t){let c=t?.replan??!1,u=t?.additive??!1,d=t?.limit??this._defaultBatchLimit,m=c?d:d+this._initialReviewCap,g=[];for(let t=0;t<this.sources.length;t++){let c=this.sources[t];try{let u=(await c.getWeightedCards(m)).cards;g.push({sourceIndex:t,weighted:u})}catch(c){if(this.error(`Failed to get content from source ${t}:`,c),this.sources.length===1)throw Error(`Cannot start session: failed to load content from source ${t}`)}}if(g.length===0){if(c)return this.log(`Replan: no content from any source, keeping existing newQ`),-1;throw Error(`Cannot start session: failed to load content from all ${this.sources.length} source(s). Check logs for details.`)}let b=this.mixer.mix(g,m*this.sources.length),S=g.map(t=>t.weighted[0]?.courseId||`source-${t.sourceIndex}`);await Promise.all(S.map(async t=>{if(!this.courseNameCache.has(t))try{let c=await this.dataLayer.getCoursesDB().getCourseConfig(t);this.courseNameCache.set(t,c.name)}catch{}}));let C=S.map(t=>this.courseNameCache.get(t)),w=this.mixer instanceof QuotaRoundRobinMixer?Math.ceil(m*this.sources.length/g.length):void 0;captureMixerRun(this.mixer.constructor.name,g,S,C,m*this.sources.length,w,b);let T=b.filter(t=>getCardOrigin(t)===`review`).slice(0,this._initialReviewCap),E=b.filter(t=>getCardOrigin(t)===`new`).slice(0,d);logger.debug(`[reviews] got ${T.length} reviews from mixer`);let D=c?`Replan content:
454
+ initialReviewCap: ${this._initialReviewCap}`),registerActiveController(this)}tick(){this._secondsRemaining=Math.floor((this.endTime.valueOf()-Date.now())/1e3),this._secondsRemaining<=0&&clearInterval(this._intervalHandle)}estimateCleanupTime(){let t=0;for(let c=0;c<this.failedQ.length;c++){let u=this.failedQ.peek(c),d=this._sessionRecord.find(t=>t.item.cardID===u.cardID),m=0;if(d){for(let t=0;t<d.records.length;t++)m+=d.records[t].timeSpent;m/=d.records.length,t+=m}}let c=t/1e3;return this.log(`Failed card cleanup estimate: ${Math.round(c)}`),c}estimateReviewTime(){let t=5*this.reviewQ.length;return this.log(`Review card time estimate: ${t}`),t}async prepareSession(){if(this.sources.some(t=>typeof t.getWeightedCards!=`function`))throw Error(`[SessionController] All content sources must implement getWeightedCards().`);let t=await this.getWeightedContent();this._wellIndicatedRemaining=t,t>=0&&t<_SessionController.MIN_WELL_INDICATED&&this.log(`[Init] Only ${t}/${_SessionController.MIN_WELL_INDICATED} well-indicated cards in initial load`),await this.hydrationService.ensureHydratedCards(),startSessionTracking(this.reviewQ.length,this.newQ.length,this.failedQ.length),this._intervalHandle=setInterval(()=>{this.tick()},1e3)}async requestReplan(t){let c=this.normalizeReplanOptions(t),u=this._replanHasIntent(c);if(this._replanPromise){if(!u)return this.log(`Replan already in progress, coalescing unhinted auto-replan`),this._replanPromise;let t=c.label?` [${c.label}]`:``;this.log(`Replan in progress; queueing hint-bearing replan${t} behind in-flight run`);let d=this._replanPromise.catch(()=>void 0).then(()=>this._runReplan(c)),m=d.finally(()=>{this._replanPromise===m&&(this._replanPromise=null,this._activeReplanLabel=null)});return this._replanPromise=m,d}let d=this._runReplan(c),m=d.finally(()=>{this._replanPromise===m&&(this._replanPromise=null,this._activeReplanLabel=null)});this._replanPromise=m,await d}_replanHasIntent(t){return!!(t.limit!==void 0||t.minFollowUpCards!==void 0||t.mode&&t.mode!==`replace`||t.hints&&Object.keys(t.hints).length>0||t.sessionHints!==void 0)}async _runReplan(t){this._activeReplanLabel=t.label??`(auto)`,t.hints||(t.hints={});let c=t.hints,u=new Set(c.excludeCards??[]);this._currentCard?.item.cardID&&u.add(this._currentCard.item.cardID);for(let t of this._sessionRecord)u.add(t.card.card_id);this.newQ.length>0&&u.add(this.newQ.peek(0).cardID),c.excludeCards=[...u],t.sessionHints!==void 0&&(this._sessionHints=t.sessionHints,this.log(`[Replan] Session hints ${t.sessionHints?`set`:`cleared`}: ${JSON.stringify(t.sessionHints)}`)),this._applyHintsToSources(t.hints,t.label);let d=t.label?` [${t.label}]`:``;this.log(`Mid-session replan requested${d} (limit: ${t.limit??`default`}, mode: ${t.mode??`replace`}${t.hints?`, with hints`:``})`),t.minFollowUpCards!==void 0&&t.minFollowUpCards>0&&(this._minCardsGuarantee=Math.max(this._minCardsGuarantee,t.minFollowUpCards),this.log(`[Replan] Card guarantee set to ${this._minCardsGuarantee}`)),await this._executeReplan(t)}setSessionHints(t){this._sessionHints=t,this.log(`Session hints ${t?`set`:`cleared`}: ${JSON.stringify(t)}`)}getSessionHints(){return this._sessionHints}getDebugSnapshot(){let describe=t=>{let c=[];for(let u=0;u<t.length;u++)c.push(t.peek(u).cardID);return{length:t.length,dequeueCount:t.dequeueCount,cards:c}};return{secondsRemaining:this.secondsRemaining,hasCardGuarantee:this.hasCardGuarantee,minCardsGuarantee:this._minCardsGuarantee,wellIndicatedRemaining:this._wellIndicatedRemaining,currentCard:this._currentCard?.item.cardID??null,sessionHints:this._sessionHints,replanActive:this._replanPromise!==null,replanLabel:this._activeReplanLabel,reviewQ:describe(this.reviewQ),newQ:describe(this.newQ),failedQ:describe(this.failedQ)}}mergeSessionHints(t){this._sessionHints=mergeHints2([this._sessionHints,t])??null,this.log(`Session hints merged: ${JSON.stringify(this._sessionHints)}`)}_applyHintsToSources(t,c){let u=t&&c?{...t,_label:c}:t,d=mergeHints2([this._sessionHints,u]);if(d)for(let t of this.sources)t.setEphemeralHints?.(d)}_getSessionControls(){return this._sessionControls||(this._sessionControls={getSessionHints:()=>this.getSessionHints(),setSessionHints:t=>this.setSessionHints(t),mergeSessionHints:t=>this.mergeSessionHints(t),requestReplan:t=>this.requestReplan(t)}),this._sessionControls}async _notifyOutcomeObservers(t,c,u){if(this._outcomeObservers.length===0||!isQuestionRecord(t))return;let d={record:t,card:c.card,result:u},m=this._getSessionControls();for(let t of this._outcomeObservers)try{await t(d,m)}catch(t){this.error(`[OutcomeObserver] observer threw; ignoring`,t)}}async _replanUncoalesced(t){let c=this._runReplan(t),u=c.finally(()=>{this._replanPromise===u&&(this._replanPromise=null,this._activeReplanLabel=null)});this._replanPromise=u,await c}normalizeReplanOptions(t){if(!t)return{};let c=[`hints`,`sessionHints`,`limit`,`mode`,`label`,`minFollowUpCards`];return Object.keys(t).some(t=>c.includes(t))?t:{hints:t}}async _executeReplan(t={}){let c=t.limit,u=t.mode??`replace`,d=await this.getWeightedContent({replan:!0,additive:u===`merge`,limit:c});this._wellIndicatedRemaining=d,c!==void 0&&c<this._defaultBatchLimit?(this._suppressQualityReplan=!0,this.log(`[Replan] Burst mode (limit=${c}): suppressing quality-based auto-replan`)):this._suppressQualityReplan=!1,d>=0&&d<_SessionController.MIN_WELL_INDICATED&&this.log(`[Replan] Only ${d}/${_SessionController.MIN_WELL_INDICATED} well-indicated cards after replan`),await this.hydrationService.ensureHydratedCards();let m=t.label?` [${t.label}]`:``;this.log(`Replan complete${m}: newQ now has ${this.newQ.length} cards (mode=${u})`),snapshotQueues(this.reviewQ.length,this.newQ.length,this.failedQ.length)}addTime(t){this.endTime=new Date(this.endTime.valueOf()+1e3*t)}get failedCount(){return this.failedQ.length}toString(){return`Session: ${this.reviewQ.length} Reviews, ${this.newQ.length} New, ${this.failedQ.length} failed`}reportString(){return`${this.reviewQ.dequeueCount} Reviews, ${this.newQ.dequeueCount} New, ${this.failedQ.dequeueCount} failed`}getDebugInfo(){let t=this.sources.some(t=>typeof t.getWeightedCards==`function`),extractQueueItems=(t,c=10)=>{let u=[];for(let d=0;d<Math.min(t.length,c);d++){let c=t.peek(d);u.push({courseID:c.courseID||`unknown`,cardID:c.cardID||`unknown`,status:c.status||`unknown`})}return u};return{api:{mode:t?`weighted`:`legacy`,description:t?`Using getWeightedCards() API with scored candidates`:`ERROR: getWeightedCards() not a function.`},reviewQueue:{length:this.reviewQ.length,dequeueCount:this.reviewQ.dequeueCount,items:extractQueueItems(this.reviewQ)},newQueue:{length:this.newQ.length,dequeueCount:this.newQ.dequeueCount,items:extractQueueItems(this.newQ)},failedQueue:{length:this.failedQ.length,dequeueCount:this.failedQ.dequeueCount,items:extractQueueItems(this.failedQ)},hydratedCache:{count:this.hydrationService.hydratedCount,cardIds:this.hydrationService.getHydratedCardIds()},replan:{inProgress:this._replanPromise!==null,suppressQualityReplan:this._suppressQualityReplan,defaultBatchLimit:this._defaultBatchLimit,minCardsGuarantee:this._minCardsGuarantee}}}async getWeightedContent(t){let c=t?.replan??!1,u=t?.additive??!1,d=t?.limit??this._defaultBatchLimit,m=c?d:d+this._initialReviewCap;c||this._applyHintsToSources();let g=[];for(let t=0;t<this.sources.length;t++){let c=this.sources[t];try{let u=(await c.getWeightedCards(m)).cards;g.push({sourceIndex:t,weighted:u})}catch(c){if(this.error(`Failed to get content from source ${t}:`,c),this.sources.length===1)throw Error(`Cannot start session: failed to load content from source ${t}`)}}if(g.length===0){if(c)return this.log(`Replan: no content from any source, keeping existing newQ`),-1;throw Error(`Cannot start session: failed to load content from all ${this.sources.length} source(s). Check logs for details.`)}let b=this.mixer.mix(g,m*this.sources.length),S=g.map(t=>t.weighted[0]?.courseId||`source-${t.sourceIndex}`);await Promise.all(S.map(async t=>{if(!this.courseNameCache.has(t))try{let c=await this.dataLayer.getCoursesDB().getCourseConfig(t);this.courseNameCache.set(t,c.name)}catch{}}));let C=S.map(t=>this.courseNameCache.get(t)),w=this.mixer instanceof QuotaRoundRobinMixer?Math.ceil(m*this.sources.length/g.length):void 0;captureMixerRun(this.mixer.constructor.name,g,S,C,m*this.sources.length,w,b);let T=b.filter(t=>getCardOrigin(t)===`review`).slice(0,this._initialReviewCap),E=b.filter(t=>getCardOrigin(t)===`new`).slice(0,d);logger.debug(`[reviews] got ${T.length} reviews from mixer`);let D=c?`Replan content:
454
455
  `:`Mixed content session created with:
455
456
  `;if(!c)for(let t of T){let c={cardID:t.cardId,courseID:t.courseId,contentSourceType:`course`,contentSourceID:t.courseId,reviewID:t.reviewID,status:`review`};this.reviewQ.add(c,c.cardID),D+=`Review: ${t.courseId}::${t.cardId} (score: ${t.score.toFixed(2)})
456
457
  `}let O=E.filter(t=>t.score>=_SessionController.WELL_INDICATED_SCORE).length,Or=[];for(let t of E){let c={cardID:t.cardId,courseID:t.courseId,contentSourceType:`course`,contentSourceID:t.courseId,status:`new`};Or.push(c),D+=`New: ${t.courseId}::${t.cardId} (score: ${t.score.toFixed(2)})
457
458
  `}if(u){let t=this.newQ.mergeToFront(Or,t=>t.cardID);D+=`Additive merge: ${t} new cards added to front of newQ
458
- `}else if(c)this.newQ.replaceAll(Or,t=>t.cardID);else for(let t of Or)this.newQ.add(t,t.cardID);return this.log(D),O}_getItemsToHydrate(){let t=[],c=2;for(let c=0;c<Math.min(2,this.reviewQ.length);c++)t.push(this.reviewQ.peek(c));for(let c=0;c<Math.min(2,this.newQ.length);c++)t.push(this.newQ.peek(c));for(let c=0;c<Math.min(2,this.failedQ.length);c++)t.push(this.failedQ.peek(c));return t}_selectNextItemToHydrate(){let t=Math.random(),c=.1,u=.75;if(this.reviewQ.length===0&&this.failedQ.length===0&&this.newQ.length===0||this._secondsRemaining<2&&this.failedQ.length===0&&this._minCardsGuarantee<=0)return null;if(this._secondsRemaining<=0&&this._minCardsGuarantee<=0)return this.failedQ.length>0?this.failedQ.peek(0):null;if(this.newQ.dequeueCount<this.sources.length&&this.newQ.length)return this.newQ.peek(0);let d=this.estimateCleanupTime(),m=this.estimateReviewTime();return this._secondsRemaining-(d+m)>20?(c=.5,u=.9):this._secondsRemaining-d>20?(c=.05,u=.9):(c=.01,u=.1),this.failedQ.length===0&&(u=1),this.reviewQ.length===0&&(c=u),t<c&&this.newQ.length?this.newQ.peek(0):t<u&&this.reviewQ.length?this.reviewQ.peek(0):this.failedQ.length?this.failedQ.peek(0):(this.log(`No more cards available for the session!`),null)}async nextCard(t=`dismiss-success`){if(this.dismissCurrentCard(t),this._minCardsGuarantee>0&&(this._minCardsGuarantee--,this.log(`[CardGuarantee] ${this._minCardsGuarantee} guaranteed cards remaining`)),this._replanPromise&&this.newQ.length===0&&this.reviewQ.length===0&&this.failedQ.length===0&&(this.log(`nextCard: queues empty, awaiting in-flight replan before drawing`),await this._replanPromise),this.newQ.length<=_SessionController.DEPLETION_PREFETCH_THRESHOLD&&this._secondsRemaining>0&&!this._replanPromise){this._suppressQualityReplan=!1;let t=this.reviewQ.length+this.failedQ.length;this.log(`[AutoReplan:depletion] newQ has ${this.newQ.length} card(s) (${t} in other queues) with ${this._secondsRemaining}s remaining. Triggering background replan.`),this.requestReplan()}if(!this._suppressQualityReplan&&this._wellIndicatedRemaining<=3&&this.newQ.length>0&&!this._replanPromise&&(this.log(`[AutoReplan:quality] ${this._wellIndicatedRemaining} well-indicated cards remaining (newQ: ${this.newQ.length}). Triggering background replan.`),this.requestReplan()),this._secondsRemaining<=0&&this.failedQ.length===0&&this._minCardsGuarantee<=0)return this._currentCard=null,endSessionTracking(),null;let c=3,u=250,d=0;for(;this._secondsRemaining>0&&this.newQ.length===0&&this.reviewQ.length===0&&this.failedQ.length===0;)if(this.log(`[WedgeBreaker] All queues empty with ${this._secondsRemaining}s remaining. Running pipeline (attempt ${d+1}/3).`),await this._replanUncoalesced({label:`wedge-breaker`}),this.newQ.length===0&&this.reviewQ.length===0&&this.failedQ.length===0){if(d++,d>=3){this.log(`[WedgeBreaker] Pipeline returned no content 3 consecutive times. Giving up; session will end.`);break}await new Promise(t=>setTimeout(t,250))}else d=0;let m=20;for(let t=0;t<20;t++){let t=this._selectNextItemToHydrate();if(!t)return this._currentCard=null,endSessionTracking(),null;let c=this.hydrationService.getHydratedCard(t.cardID);if(c||(c=await this.hydrationService.waitForCard(t.cardID)),this.removeItemFromQueue(t),c){await this.hydrationService.ensureHydratedCards(),this._currentCard=c;let u=t.status===`review`||t.status===`failed-review`?`review`:t.status===`new`||t.status===`failed-new`?`new`:`failed`,d=t.status.startsWith(`failed`)?`failedQ`:t.status===`review`?`reviewQ`:`newQ`;return recordCardPresentation(t.cardID,t.courseID,this.courseNameCache.get(t.courseID),u,d),snapshotQueues(this.reviewQ.length,this.newQ.length,this.failedQ.length),c}this.log(`Skipping card ${t.cardID}: hydration failed, trying next`),isReview(t)&&this.srsService.removeReview(t.reviewID)}return this.log(`Exhausted 20 skip attempts finding a hydratable card`),this._currentCard=null,endSessionTracking(),null}async submitResponse(t,c,u,d,m,g,b,S,C){let w={...d.item};return await this.services.response.processResponse(t,c,w,u,d,m,g,b,S,C)}dismissCurrentCard(t=`dismiss-success`){if(this._currentCard)if(t===`dismiss-success`)this.hydrationService.removeCard(this._currentCard.item.cardID);else if(t===`marked-failed`){let t;t=isReview(this._currentCard.item)?{cardID:this._currentCard.item.cardID,courseID:this._currentCard.item.courseID,contentSourceID:this._currentCard.item.contentSourceID,contentSourceType:this._currentCard.item.contentSourceType,status:`failed-review`,reviewID:this._currentCard.item.reviewID}:{cardID:this._currentCard.item.cardID,courseID:this._currentCard.item.courseID,contentSourceID:this._currentCard.item.contentSourceID,contentSourceType:this._currentCard.item.contentSourceType,status:`failed-new`},this.failedQ.add(t,t.cardID)}else (t===`dismiss-error`||t===`dismiss-failed`)&&this.hydrationService.removeCard(this._currentCard.item.cardID)}removeItemFromQueue(t){this.reviewQ.peek(0)?.cardID===t.cardID?this.reviewQ.dequeue(t=>t.cardID):this.newQ.peek(0)?.cardID===t.cardID?(this.newQ.dequeue(t=>t.cardID),this._wellIndicatedRemaining>0&&this._wellIndicatedRemaining--):this.failedQ.peek(0)?.cardID===t.cardID&&this.failedQ.dequeue(t=>t.cardID)}async endSession(){if(!this._sessionRecord||this._sessionRecord.length===0)return;let t=this._sessionRecord.flatMap(t=>t.records).filter(t=>t.userAnswer!==void 0);if(t.length===0)return;let c=null,u=[];for(let t of this.sources)if(t.getOrchestrationContext){try{c=await t.getOrchestrationContext(),t.getStrategyIds&&u.push(...t.getStrategyIds())}catch(t){logger.warn(`[SessionController] Failed to get orchestration context: ${t}`)}if(c)break}if(!c){logger.debug(`[SessionController] No orchestration context available, skipping outcome recording`);return}let d=new Date().toISOString(),m=new Date(this.startTime).toISOString();await recordUserOutcome(c,m,d,t,u)}},_defineProperty$2(_SessionController2,`MIN_WELL_INDICATED`,5),_defineProperty$2(_SessionController2,`WELL_INDICATED_SCORE`,.1),_defineProperty$2(_SessionController2,`DEPLETION_PREFETCH_THRESHOLD`,3),_SessionController2),init_TagFilteredContentSource(),init_factory()}));function useRouter(){return inject(routerKey)}function useRoute(t){return inject(routeLocationKey)}var isArray,NavigationType,NavigationDirection,NavigationFailureSymbol,NavigationFailureType,matchedRouteKey,viewDepthKey,routerKey,routeLocationKey,routerViewLocationKey,init_vue_router=__esmMin((()=>{init_vue_runtime_esm_bundler(),Array.isArray,(function(t){t.pop=`pop`,t.push=`push`})(NavigationType||(NavigationType={})),(function(t){t.back=`back`,t.forward=`forward`,t.unknown=``})(NavigationDirection||(NavigationDirection={})),Symbol(process.env.NODE_ENV===`production`?``:`navigation failure`),(function(t){t[t.aborted=4]=`aborted`,t[t.cancelled=8]=`cancelled`,t[t.duplicated=16]=`duplicated`})(NavigationFailureType||(NavigationFailureType={})),Symbol(process.env.NODE_ENV===`production`?``:`router view location matched`),Symbol(process.env.NODE_ENV===`production`?``:`router view depth`),routerKey=Symbol(process.env.NODE_ENV===`production`?``:`router`),routeLocationKey=Symbol(process.env.NODE_ENV===`production`?``:`route location`),Symbol(process.env.NODE_ENV===`production`?``:`router view location`)})),init_style=__esmMin((()=>{}));function registerRuntimeHelpers(t){Object.getOwnPropertySymbols(t).forEach(c=>{helperNameMap[c]=t[c]})}function createRoot(t,c=``){return{type:0,source:c,children:t,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:[],temps:0,codegenNode:void 0,loc:locStub}}function createVNodeCall(t,c,u,d,m,g,b,S=!1,C=!1,w=!1,T=locStub){return t&&(S?(t.helper(OPEN_BLOCK),t.helper(getVNodeBlockHelper(t.inSSR,w))):t.helper(getVNodeHelper(t.inSSR,w)),b&&t.helper(WITH_DIRECTIVES)),{type:13,tag:c,props:u,children:d,patchFlag:m,dynamicProps:g,directives:b,isBlock:S,disableTracking:C,isComponent:w,loc:T}}function createArrayExpression(t,c=locStub){return{type:17,loc:c,elements:t}}function createObjectExpression(t,c=locStub){return{type:15,loc:c,properties:t}}function createObjectProperty(t,c){return{type:16,loc:locStub,key:isString$1(t)?createSimpleExpression(t,!0):t,value:c}}function createSimpleExpression(t,c=!1,u=locStub,d=0){return{type:4,loc:u,content:t,isStatic:c,constType:c?3:d}}function createInterpolation(t,c){return{type:5,loc:c,content:isString$1(t)?createSimpleExpression(t,!1,c):t}}function createCompoundExpression(t,c=locStub){return{type:8,loc:c,children:t}}function createCallExpression(t,c=[],u=locStub){return{type:14,loc:u,callee:t,arguments:c}}function createFunctionExpression(t,c=void 0,u=!1,d=!1,m=locStub){return{type:18,params:t,returns:c,newline:u,isSlot:d,loc:m}}function createConditionalExpression(t,c,u,d=!0){return{type:19,test:t,consequent:c,alternate:u,newline:d,loc:locStub}}function createCacheExpression(t,c,u=!1,d=!1){return{type:20,index:t,value:c,needPauseTracking:u,inVOnce:d,needArraySpread:!1,loc:locStub}}function createBlockStatement(t){return{type:21,body:t,loc:locStub}}function createTemplateLiteral(t){return{type:22,elements:t,loc:locStub}}function createIfStatement(t,c,u){return{type:23,test:t,consequent:c,alternate:u,loc:locStub}}function createAssignmentExpression(t,c){return{type:24,left:t,right:c,loc:locStub}}function createSequenceExpression(t){return{type:25,expressions:t,loc:locStub}}function createReturnStatement(t){return{type:26,returns:t,loc:locStub}}function getVNodeHelper(t,c){return t||c?CREATE_VNODE:CREATE_ELEMENT_VNODE}function getVNodeBlockHelper(t,c){return t||c?CREATE_BLOCK:CREATE_ELEMENT_BLOCK}function convertToBlock(t,{helper:c,removeHelper:u,inSSR:d}){t.isBlock||(t.isBlock=!0,u(getVNodeHelper(d,t.isComponent)),c(OPEN_BLOCK),c(getVNodeBlockHelper(d,t.isComponent)))}function isTagStartChar(t){return t>=97&&t<=122||t>=65&&t<=90}function isWhitespace(t){return t===32||t===10||t===9||t===12||t===13}function isEndOfTagSection(t){return t===47||t===62||isWhitespace(t)}function toCharCodes(t){let c=new Uint8Array(t.length);for(let u=0;u<t.length;u++)c[u]=t.charCodeAt(u);return c}function getCompatValue(t,{compatConfig:c}){let u=c&&c[t];return t===`MODE`?u||3:u}function isCompatEnabled(t,c){let u=getCompatValue(`MODE`,c),d=getCompatValue(t,c);return u===3?d===!0:d!==!1}function checkCompatEnabled(t,c,u,...d){let m=isCompatEnabled(t,c);return process.env.NODE_ENV!==`production`&&m&&warnDeprecation(t,c,u,...d),m}function warnDeprecation(t,c,u,...d){if(getCompatValue(t,c)===`suppress-warning`)return;let{message:m,link:g}=deprecationData[t],b=`(deprecation ${t}) ${typeof m==`function`?m(...d):m}${g?`
459
+ `}else if(c)this.newQ.replaceAll(Or,t=>t.cardID);else for(let t of Or)this.newQ.add(t,t.cardID);return this.log(D),O}_getItemsToHydrate(){let t=[],c=2;for(let c=0;c<Math.min(2,this.reviewQ.length);c++)t.push(this.reviewQ.peek(c));for(let c=0;c<Math.min(2,this.newQ.length);c++)t.push(this.newQ.peek(c));for(let c=0;c<Math.min(2,this.failedQ.length);c++)t.push(this.failedQ.peek(c));return t}_selectNextItemToHydrate(){let t=Math.random(),c=.1,u=.75;if(this.reviewQ.length===0&&this.failedQ.length===0&&this.newQ.length===0||this._secondsRemaining<2&&this.failedQ.length===0&&this._minCardsGuarantee<=0)return null;if(this._secondsRemaining<=0&&this._minCardsGuarantee<=0)return this.failedQ.length>0?this.failedQ.peek(0):null;if(this.newQ.dequeueCount<this.sources.length&&this.newQ.length)return this.newQ.peek(0);let d=this.estimateCleanupTime(),m=this.estimateReviewTime();return this._secondsRemaining-(d+m)>20?(c=.5,u=.9):this._secondsRemaining-d>20?(c=.05,u=.9):(c=.01,u=.1),this.failedQ.length===0&&(u=1),this.reviewQ.length===0&&(c=u),t<c&&this.newQ.length?this.newQ.peek(0):t<u&&this.reviewQ.length?this.reviewQ.peek(0):this.failedQ.length?this.failedQ.peek(0):(this.log(`No more cards available for the session!`),null)}async nextCard(t=`dismiss-success`){if(this.dismissCurrentCard(t),this._minCardsGuarantee>0&&(this._minCardsGuarantee--,this.log(`[CardGuarantee] ${this._minCardsGuarantee} guaranteed cards remaining`)),this._replanPromise&&this.newQ.length===0&&this.reviewQ.length===0&&this.failedQ.length===0&&(this.log(`nextCard: queues empty, awaiting in-flight replan before drawing`),await this._replanPromise),this.newQ.length<=_SessionController.DEPLETION_PREFETCH_THRESHOLD&&this._secondsRemaining>0&&!this._replanPromise){this._suppressQualityReplan=!1;let t=this.reviewQ.length+this.failedQ.length;this.log(`[AutoReplan:depletion] newQ has ${this.newQ.length} card(s) (${t} in other queues) with ${this._secondsRemaining}s remaining. Triggering background replan.`),this.requestReplan({label:`auto:depletion`})}if(!this._suppressQualityReplan&&this._wellIndicatedRemaining<=3&&this.newQ.length>0&&!this._replanPromise&&(this.log(`[AutoReplan:quality] ${this._wellIndicatedRemaining} well-indicated cards remaining (newQ: ${this.newQ.length}). Triggering background replan.`),this.requestReplan({label:`auto:quality`})),this._secondsRemaining<=0&&this.failedQ.length===0&&this._minCardsGuarantee<=0)return this._currentCard=null,endSessionTracking(),null;let c=3,u=250,d=0;for(;this._secondsRemaining>0&&this.newQ.length===0&&this.reviewQ.length===0&&this.failedQ.length===0;)if(this.log(`[WedgeBreaker] All queues empty with ${this._secondsRemaining}s remaining. Running pipeline (attempt ${d+1}/3).`),await this._replanUncoalesced({label:`wedge-breaker`}),this.newQ.length===0&&this.reviewQ.length===0&&this.failedQ.length===0){if(d++,d>=3){this.log(`[WedgeBreaker] Pipeline returned no content 3 consecutive times. Giving up; session will end.`);break}await new Promise(t=>setTimeout(t,250))}else d=0;let m=20;for(let t=0;t<20;t++){let t=this._selectNextItemToHydrate();if(!t)return this._currentCard=null,endSessionTracking(),null;let c=this.hydrationService.getHydratedCard(t.cardID);if(c||(c=await this.hydrationService.waitForCard(t.cardID)),this.removeItemFromQueue(t),c){await this.hydrationService.ensureHydratedCards(),this._currentCard=c;let u=t.status===`review`||t.status===`failed-review`?`review`:t.status===`new`||t.status===`failed-new`?`new`:`failed`,d=t.status.startsWith(`failed`)?`failedQ`:t.status===`review`?`reviewQ`:`newQ`;return recordCardPresentation(t.cardID,t.courseID,this.courseNameCache.get(t.courseID),u,d),snapshotQueues(this.reviewQ.length,this.newQ.length,this.failedQ.length),c}this.log(`Skipping card ${t.cardID}: hydration failed, trying next`),isReview(t)&&this.srsService.removeReview(t.reviewID)}return this.log(`Exhausted 20 skip attempts finding a hydratable card`),this._currentCard=null,endSessionTracking(),null}async submitResponse(t,c,u,d,m,g,b,S,C){let w={...d.item},T=await this.services.response.processResponse(t,c,w,u,d,m,g,b,S,C);return await this._notifyOutcomeObservers(t,d,T),T}dismissCurrentCard(t=`dismiss-success`){if(this._currentCard)if(t===`dismiss-success`)this.hydrationService.removeCard(this._currentCard.item.cardID);else if(t===`marked-failed`){let t;t=isReview(this._currentCard.item)?{cardID:this._currentCard.item.cardID,courseID:this._currentCard.item.courseID,contentSourceID:this._currentCard.item.contentSourceID,contentSourceType:this._currentCard.item.contentSourceType,status:`failed-review`,reviewID:this._currentCard.item.reviewID}:{cardID:this._currentCard.item.cardID,courseID:this._currentCard.item.courseID,contentSourceID:this._currentCard.item.contentSourceID,contentSourceType:this._currentCard.item.contentSourceType,status:`failed-new`},this.failedQ.add(t,t.cardID)}else (t===`dismiss-error`||t===`dismiss-failed`)&&this.hydrationService.removeCard(this._currentCard.item.cardID)}removeItemFromQueue(t){this.reviewQ.peek(0)?.cardID===t.cardID?this.reviewQ.dequeue(t=>t.cardID):this.newQ.peek(0)?.cardID===t.cardID?(this.newQ.dequeue(t=>t.cardID),this._wellIndicatedRemaining>0&&this._wellIndicatedRemaining--):this.failedQ.peek(0)?.cardID===t.cardID&&this.failedQ.dequeue(t=>t.cardID)}async endSession(){if(!this._sessionRecord||this._sessionRecord.length===0)return;let t=this._sessionRecord.flatMap(t=>t.records).filter(t=>t.userAnswer!==void 0);if(t.length===0)return;let c=null,u=[];for(let t of this.sources)if(t.getOrchestrationContext){try{c=await t.getOrchestrationContext(),t.getStrategyIds&&u.push(...t.getStrategyIds())}catch(t){logger.warn(`[SessionController] Failed to get orchestration context: ${t}`)}if(c)break}if(!c){logger.debug(`[SessionController] No orchestration context available, skipping outcome recording`);return}let d=new Date().toISOString(),m=new Date(this.startTime).toISOString();await recordUserOutcome(c,m,d,t,u)}},_defineProperty$2(_SessionController2,`MIN_WELL_INDICATED`,5),_defineProperty$2(_SessionController2,`WELL_INDICATED_SCORE`,.1),_defineProperty$2(_SessionController2,`DEPLETION_PREFETCH_THRESHOLD`,3),_SessionController2),init_TagFilteredContentSource(),init_factory()}));function useRouter(){return inject(routerKey)}function useRoute(t){return inject(routeLocationKey)}var isArray,NavigationType,NavigationDirection,NavigationFailureSymbol,NavigationFailureType,matchedRouteKey,viewDepthKey,routerKey,routeLocationKey,routerViewLocationKey,init_vue_router=__esmMin((()=>{init_vue_runtime_esm_bundler(),Array.isArray,(function(t){t.pop=`pop`,t.push=`push`})(NavigationType||(NavigationType={})),(function(t){t.back=`back`,t.forward=`forward`,t.unknown=``})(NavigationDirection||(NavigationDirection={})),Symbol(process.env.NODE_ENV===`production`?``:`navigation failure`),(function(t){t[t.aborted=4]=`aborted`,t[t.cancelled=8]=`cancelled`,t[t.duplicated=16]=`duplicated`})(NavigationFailureType||(NavigationFailureType={})),Symbol(process.env.NODE_ENV===`production`?``:`router view location matched`),Symbol(process.env.NODE_ENV===`production`?``:`router view depth`),routerKey=Symbol(process.env.NODE_ENV===`production`?``:`router`),routeLocationKey=Symbol(process.env.NODE_ENV===`production`?``:`route location`),Symbol(process.env.NODE_ENV===`production`?``:`router view location`)})),init_style=__esmMin((()=>{}));function registerRuntimeHelpers(t){Object.getOwnPropertySymbols(t).forEach(c=>{helperNameMap[c]=t[c]})}function createRoot(t,c=``){return{type:0,source:c,children:t,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:[],temps:0,codegenNode:void 0,loc:locStub}}function createVNodeCall(t,c,u,d,m,g,b,S=!1,C=!1,w=!1,T=locStub){return t&&(S?(t.helper(OPEN_BLOCK),t.helper(getVNodeBlockHelper(t.inSSR,w))):t.helper(getVNodeHelper(t.inSSR,w)),b&&t.helper(WITH_DIRECTIVES)),{type:13,tag:c,props:u,children:d,patchFlag:m,dynamicProps:g,directives:b,isBlock:S,disableTracking:C,isComponent:w,loc:T}}function createArrayExpression(t,c=locStub){return{type:17,loc:c,elements:t}}function createObjectExpression(t,c=locStub){return{type:15,loc:c,properties:t}}function createObjectProperty(t,c){return{type:16,loc:locStub,key:isString$1(t)?createSimpleExpression(t,!0):t,value:c}}function createSimpleExpression(t,c=!1,u=locStub,d=0){return{type:4,loc:u,content:t,isStatic:c,constType:c?3:d}}function createInterpolation(t,c){return{type:5,loc:c,content:isString$1(t)?createSimpleExpression(t,!1,c):t}}function createCompoundExpression(t,c=locStub){return{type:8,loc:c,children:t}}function createCallExpression(t,c=[],u=locStub){return{type:14,loc:u,callee:t,arguments:c}}function createFunctionExpression(t,c=void 0,u=!1,d=!1,m=locStub){return{type:18,params:t,returns:c,newline:u,isSlot:d,loc:m}}function createConditionalExpression(t,c,u,d=!0){return{type:19,test:t,consequent:c,alternate:u,newline:d,loc:locStub}}function createCacheExpression(t,c,u=!1,d=!1){return{type:20,index:t,value:c,needPauseTracking:u,inVOnce:d,needArraySpread:!1,loc:locStub}}function createBlockStatement(t){return{type:21,body:t,loc:locStub}}function createTemplateLiteral(t){return{type:22,elements:t,loc:locStub}}function createIfStatement(t,c,u){return{type:23,test:t,consequent:c,alternate:u,loc:locStub}}function createAssignmentExpression(t,c){return{type:24,left:t,right:c,loc:locStub}}function createSequenceExpression(t){return{type:25,expressions:t,loc:locStub}}function createReturnStatement(t){return{type:26,returns:t,loc:locStub}}function getVNodeHelper(t,c){return t||c?CREATE_VNODE:CREATE_ELEMENT_VNODE}function getVNodeBlockHelper(t,c){return t||c?CREATE_BLOCK:CREATE_ELEMENT_BLOCK}function convertToBlock(t,{helper:c,removeHelper:u,inSSR:d}){t.isBlock||(t.isBlock=!0,u(getVNodeHelper(d,t.isComponent)),c(OPEN_BLOCK),c(getVNodeBlockHelper(d,t.isComponent)))}function isTagStartChar(t){return t>=97&&t<=122||t>=65&&t<=90}function isWhitespace(t){return t===32||t===10||t===9||t===12||t===13}function isEndOfTagSection(t){return t===47||t===62||isWhitespace(t)}function toCharCodes(t){let c=new Uint8Array(t.length);for(let u=0;u<t.length;u++)c[u]=t.charCodeAt(u);return c}function getCompatValue(t,{compatConfig:c}){let u=c&&c[t];return t===`MODE`?u||3:u}function isCompatEnabled(t,c){let u=getCompatValue(`MODE`,c),d=getCompatValue(t,c);return u===3?d===!0:d!==!1}function checkCompatEnabled(t,c,u,...d){let m=isCompatEnabled(t,c);return process.env.NODE_ENV!==`production`&&m&&warnDeprecation(t,c,u,...d),m}function warnDeprecation(t,c,u,...d){if(getCompatValue(t,c)===`suppress-warning`)return;let{message:m,link:g}=deprecationData[t],b=`(deprecation ${t}) ${typeof m==`function`?m(...d):m}${g?`
459
460
  Details: ${g}`:``}`,S=SyntaxError(b);S.code=t,u&&(S.loc=u),c.onWarn(S)}function defaultOnError(t){throw t}function defaultOnWarn(t){process.env.NODE_ENV!==`production`&&console.warn(`[Vue warn] ${t.message}`)}function createCompilerError(t,c,u,d){let m=process.env.NODE_ENV===`production`?`https://vuejs.org/error-reference/#compiler-${t}`:(u||errorMessages)[t]+(d||``),g=SyntaxError(String(m));return g.code=t,g.loc=c,g}function walkIdentifiers(t,c,u=!1,d=[],m=Object.create(null)){}function isReferencedIdentifier(t,c,u){return!1}function isInDestructureAssignment(t,c){if(t&&(t.type===`ObjectProperty`||t.type===`ArrayPattern`)){let t=c.length;for(;t--;){let u=c[t];if(u.type===`AssignmentExpression`)return!0;if(u.type!==`ObjectProperty`&&!u.type.endsWith(`Pattern`))break}}return!1}function isInNewExpression(t){let c=t.length;for(;c--;){let u=t[c];if(u.type===`NewExpression`)return!0;if(u.type!==`MemberExpression`)break}return!1}function walkFunctionParams(t,c){for(let u of t.params)for(let t of extractIdentifiers(u))c(t)}function walkBlockDeclarations(t,c){for(let u of t.body)if(u.type===`VariableDeclaration`){if(u.declare)continue;for(let t of u.declarations)for(let u of extractIdentifiers(t.id))c(u)}else if(u.type===`FunctionDeclaration`||u.type===`ClassDeclaration`){if(u.declare||!u.id)continue;c(u.id)}else isForStatement(u)&&walkForStatement(u,!0,c)}function isForStatement(t){return t.type===`ForOfStatement`||t.type===`ForInStatement`||t.type===`ForStatement`}function walkForStatement(t,c,u){let d=t.type===`ForStatement`?t.init:t.left;if(d&&d.type===`VariableDeclaration`&&(d.kind===`var`?c:!c))for(let t of d.declarations)for(let c of extractIdentifiers(t.id))u(c)}function extractIdentifiers(t,c=[]){switch(t.type){case`Identifier`:c.push(t);break;case`MemberExpression`:let u=t;for(;u.type===`MemberExpression`;)u=u.object;c.push(u);break;case`ObjectPattern`:for(let u of t.properties)u.type===`RestElement`?extractIdentifiers(u.argument,c):extractIdentifiers(u.value,c);break;case`ArrayPattern`:t.elements.forEach(t=>{t&&extractIdentifiers(t,c)});break;case`RestElement`:extractIdentifiers(t.argument,c);break;case`AssignmentPattern`:extractIdentifiers(t.left,c);break}return c}function unwrapTSNode(t){return TS_NODE_TYPES.includes(t.type)?unwrapTSNode(t.expression):t}function isCoreComponent(t){switch(t){case`Teleport`:case`teleport`:return TELEPORT;case`Suspense`:case`suspense`:return SUSPENSE;case`KeepAlive`:case`keep-alive`:return KEEP_ALIVE;case`BaseTransition`:case`base-transition`:return BASE_TRANSITION}}function advancePositionWithClone(t,c,u=c.length){return advancePositionWithMutation({offset:t.offset,line:t.line,column:t.column},c,u)}function advancePositionWithMutation(t,c,u=c.length){let d=0,m=-1;for(let t=0;t<u;t++)c.charCodeAt(t)===10&&(d++,m=t);return t.offset+=u,t.line+=d,t.column=m===-1?t.column+u:u-m,t}function assert(t,c){if(!t)throw Error(c||`unexpected compiler condition`)}function findDir(t,c,u=!1){for(let d=0;d<t.props.length;d++){let m=t.props[d];if(m.type===7&&(u||m.exp)&&(isString$1(c)?m.name===c:c.test(m.name)))return m}}function findProp(t,c,u=!1,d=!1){for(let m=0;m<t.props.length;m++){let g=t.props[m];if(g.type===6){if(u)continue;if(g.name===c&&(g.value||d))return g}else if(g.name===`bind`&&(g.exp||d)&&isStaticArgOf(g.arg,c))return g}}function isStaticArgOf(t,c){return!!(t&&isStaticExp(t)&&t.content===c)}function hasDynamicKeyVBind(t){return t.props.some(t=>t.type===7&&t.name===`bind`&&(!t.arg||t.arg.type!==4||!t.arg.isStatic))}function isText$1(t){return t.type===5||t.type===2}function isVSlot(t){return t.type===7&&t.name===`slot`}function isTemplateNode(t){return t.type===1&&t.tagType===3}function isSlotOutlet(t){return t.type===1&&t.tagType===2}function getUnnormalizedProps(t,c=[]){if(t&&!isString$1(t)&&t.type===14){let u=t.callee;if(!isString$1(u)&&propsHelperSet.has(u))return getUnnormalizedProps(t.arguments[0],c.concat(t))}return[t,c]}function injectProp(t,c,u){let d,m=t.type===13?t.props:t.arguments[2],g=[],b;if(m&&!isString$1(m)&&m.type===14){let t=getUnnormalizedProps(m);m=t[0],g=t[1],b=g[g.length-1]}if(m==null||isString$1(m))d=createObjectExpression([c]);else if(m.type===14){let t=m.arguments[0];!isString$1(t)&&t.type===15?hasProp(c,t)||t.properties.unshift(c):m.callee===TO_HANDLERS?d=createCallExpression(u.helper(MERGE_PROPS),[createObjectExpression([c]),m]):m.arguments.unshift(createObjectExpression([c])),!d&&(d=m)}else m.type===15?(hasProp(c,m)||m.properties.unshift(c),d=m):(d=createCallExpression(u.helper(MERGE_PROPS),[createObjectExpression([c]),m]),b&&b.callee===GUARD_REACTIVE_PROPS&&(b=g[g.length-2]));t.type===13?b?b.arguments[0]=d:t.props=d:b?b.arguments[0]=d:t.arguments[2]=d}function hasProp(t,c){let u=!1;if(t.key.type===4){let d=t.key.content;u=c.properties.some(t=>t.key.type===4&&t.key.content===d)}return u}function toValidAssetId(t,c){return`_${c}_${t.replace(/[^\w]/g,(c,u)=>c===`-`?`_`:t.charCodeAt(u).toString())}`}function hasScopeRef(t,c){if(!t||Object.keys(c).length===0)return!1;switch(t.type){case 1:for(let u=0;u<t.props.length;u++){let d=t.props[u];if(d.type===7&&(hasScopeRef(d.arg,c)||hasScopeRef(d.exp,c)))return!0}return t.children.some(t=>hasScopeRef(t,c));case 11:return hasScopeRef(t.source,c)?!0:t.children.some(t=>hasScopeRef(t,c));case 9:return t.branches.some(t=>hasScopeRef(t,c));case 10:return hasScopeRef(t.condition,c)?!0:t.children.some(t=>hasScopeRef(t,c));case 4:return!t.isStatic&&isSimpleIdentifier(t.content)&&!!c[t.content];case 8:return t.children.some(t=>isObject$1(t)&&hasScopeRef(t,c));case 5:case 12:return hasScopeRef(t.content,c);case 2:case 3:case 20:return!1;default:return process.env.NODE_ENV,!1}}function getMemoedVNodeCall(t){return t.type===14&&t.callee===WITH_MEMO?t.arguments[1].returns:t}function parseForExpression(t){let c=t.loc,u=t.content,d=u.match(forAliasRE);if(!d)return;let[,m,g]=d,createAliasExpression=(t,u,d=!1)=>{let m=c.start.offset+u;return createExp(t,!1,getLoc(m,m+t.length),0,d?1:0)},b={source:createAliasExpression(g.trim(),u.indexOf(g,m.length)),value:void 0,key:void 0,index:void 0,finalized:!1},S=m.trim().replace(stripParensRE,``).trim(),C=m.indexOf(S),w=S.match(forIteratorRE);if(w){S=S.replace(forIteratorRE,``).trim();let t=w[1].trim(),c;if(t&&(c=u.indexOf(t,C+S.length),b.key=createAliasExpression(t,c,!0)),w[2]){let d=w[2].trim();d&&(b.index=createAliasExpression(d,u.indexOf(d,b.key?c+t.length:C+S.length),!0))}}return S&&(b.value=createAliasExpression(S,C,!0)),b}function getSlice(t,c){return currentInput.slice(t,c)}function endOpenTag(t){tokenizer.inSFCRoot&&(currentOpenTag.innerLoc=getLoc(t+1,t+1)),addNode(currentOpenTag);let{tag:c,ns:u}=currentOpenTag;u===0&&currentOptions.isPreTag(c)&&inPre++,currentOptions.isVoidTag(c)?onCloseTag(currentOpenTag,t):(stack.unshift(currentOpenTag),(u===1||u===2)&&(tokenizer.inXML=!0)),currentOpenTag=null}function onText(t,c,u){{let c=stack[0]&&stack[0].tag;c!==`script`&&c!==`style`&&t.includes(`&`)&&(t=currentOptions.decodeEntities(t,!1))}let d=stack[0]||currentRoot,m=d.children[d.children.length-1];m&&m.type===2?(m.content+=t,setLocEnd(m.loc,u)):d.children.push({type:2,content:t,loc:getLoc(c,u)})}function onCloseTag(t,c,u=!1){u?setLocEnd(t.loc,backTrack(c,60)):setLocEnd(t.loc,lookAhead(c,62)+1),tokenizer.inSFCRoot&&(t.children.length?t.innerLoc.end=extend$2({},t.children[t.children.length-1].loc.end):t.innerLoc.end=extend$2({},t.innerLoc.start),t.innerLoc.source=getSlice(t.innerLoc.start.offset,t.innerLoc.end.offset));let{tag:d,ns:m,children:g}=t;if(inVPre||(d===`slot`?t.tagType=2:isFragmentTemplate(t)?t.tagType=3:isComponent(t)&&(t.tagType=1)),tokenizer.inRCDATA||(t.children=condenseWhitespace(g)),m===0&&currentOptions.isIgnoreNewlineTag(d)){let t=g[0];t&&t.type===2&&(t.content=t.content.replace(/^\r?\n/,``))}m===0&&currentOptions.isPreTag(d)&&inPre--,currentVPreBoundary===t&&(inVPre=tokenizer.inVPre=!1,currentVPreBoundary=null),tokenizer.inXML&&(stack[0]?stack[0].ns:currentOptions.ns)===0&&(tokenizer.inXML=!1);{let c=t.props;if(process.env.NODE_ENV!==`production`&&isCompatEnabled(`COMPILER_V_IF_V_FOR_PRECEDENCE`,currentOptions)){let u=!1,d=!1;for(let m=0;m<c.length;m++){let g=c[m];if(g.type===7&&(g.name===`if`?u=!0:g.name===`for`&&(d=!0)),u&&d){warnDeprecation(`COMPILER_V_IF_V_FOR_PRECEDENCE`,currentOptions,t.loc);break}}}if(!tokenizer.inSFCRoot&&isCompatEnabled(`COMPILER_NATIVE_TEMPLATE`,currentOptions)&&t.tag===`template`&&!isFragmentTemplate(t)){process.env.NODE_ENV!==`production`&&warnDeprecation(`COMPILER_NATIVE_TEMPLATE`,currentOptions,t.loc);let c=stack[0]||currentRoot,u=c.children.indexOf(t);c.children.splice(u,1,...t.children)}let u=c.find(t=>t.type===6&&t.name===`inline-template`);u&&checkCompatEnabled(`COMPILER_INLINE_TEMPLATE`,currentOptions,u.loc)&&t.children.length&&(u.value={type:2,content:getSlice(t.children[0].loc.start.offset,t.children[t.children.length-1].loc.end.offset),loc:u.loc})}}function lookAhead(t,c){let u=t;for(;currentInput.charCodeAt(u)!==c&&u<currentInput.length-1;)u++;return u}function backTrack(t,c){let u=t;for(;currentInput.charCodeAt(u)!==c&&u>=0;)u--;return u}function isFragmentTemplate({tag:t,props:c}){if(t===`template`){for(let t=0;t<c.length;t++)if(c[t].type===7&&specialTemplateDir.has(c[t].name))return!0}return!1}function isComponent({tag:t,props:c}){if(currentOptions.isCustomElement(t))return!1;if(t===`component`||isUpperCase(t.charCodeAt(0))||isCoreComponent(t)||currentOptions.isBuiltInComponent&&currentOptions.isBuiltInComponent(t)||currentOptions.isNativeTag&&!currentOptions.isNativeTag(t))return!0;for(let t=0;t<c.length;t++){let u=c[t];if(u.type===6){if(u.name===`is`&&u.value&&(u.value.content.startsWith(`vue:`)||checkCompatEnabled(`COMPILER_IS_ON_ELEMENT`,currentOptions,u.loc)))return!0}else if(u.name===`bind`&&isStaticArgOf(u.arg,`is`)&&checkCompatEnabled(`COMPILER_IS_ON_ELEMENT`,currentOptions,u.loc))return!0}return!1}function isUpperCase(t){return t>64&&t<91}function condenseWhitespace(t,c){let u=currentOptions.whitespace!==`preserve`,d=!1;for(let c=0;c<t.length;c++){let m=t[c];if(m.type===2)if(inPre)m.content=m.content.replace(windowsNewlineRE,`
460
461
  `);else if(isAllWhitespace(m.content)){let g=t[c-1]&&t[c-1].type,b=t[c+1]&&t[c+1].type;!g||!b||u&&(g===3&&(b===3||b===1)||g===1&&(b===3||b===1&&hasNewlineChar(m.content)))?(d=!0,t[c]=null):m.content=` `}else u&&(m.content=condense(m.content))}return d?t.filter(Boolean):t}function isAllWhitespace(t){for(let c=0;c<t.length;c++)if(!isWhitespace(t.charCodeAt(c)))return!1;return!0}function hasNewlineChar(t){for(let c=0;c<t.length;c++){let u=t.charCodeAt(c);if(u===10||u===13)return!0}return!1}function condense(t){let c=``,u=!1;for(let d=0;d<t.length;d++)isWhitespace(t.charCodeAt(d))?u||(c+=` `,u=!0):(c+=t[d],u=!1);return c}function addNode(t){(stack[0]||currentRoot).children.push(t)}function getLoc(t,c){return{start:tokenizer.getPos(t),end:c==null?c:tokenizer.getPos(c),source:c==null?c:getSlice(t,c)}}function cloneLoc(t){return getLoc(t.start.offset,t.end.offset)}function setLocEnd(t,c){t.end=tokenizer.getPos(c),t.source=getSlice(t.start.offset,c)}function dirToAttr(t){let c={type:6,name:t.rawName,nameLoc:getLoc(t.loc.start.offset,t.loc.start.offset+t.rawName.length),value:void 0,loc:t.loc};if(t.exp){let u=t.exp.loc;u.end.offset<t.loc.end.offset&&(u.start.offset--,u.start.column--,u.end.offset++,u.end.column++),c.value={type:2,content:t.exp.content,loc:u}}return c}function createExp(t,c=!1,u,d=0,m=0){return createSimpleExpression(t,c,u,d)}function emitError(t,c,u){currentOptions.onError(createCompilerError(t,getLoc(c,c),void 0,u))}function reset(){tokenizer.reset(),currentOpenTag=null,currentProp=null,currentAttrValue=``,currentAttrStartIndex=-1,currentAttrEndIndex=-1,stack.length=0}function baseParse(t,c){if(reset(),currentInput=t,currentOptions=extend$2({},defaultParserOptions),c){let t;for(t in c)c[t]!=null&&(currentOptions[t]=c[t])}if(process.env.NODE_ENV!==`production`&&!currentOptions.decodeEntities)throw Error(`[@vue/compiler-core] decodeEntities option is required in browser builds.`);tokenizer.mode=currentOptions.parseMode===`html`?1:currentOptions.parseMode===`sfc`?2:0,tokenizer.inXML=currentOptions.ns===1||currentOptions.ns===2;let u=c&&c.delimiters;u&&(tokenizer.delimiterOpen=toCharCodes(u[0]),tokenizer.delimiterClose=toCharCodes(u[1]));let d=currentRoot=createRoot([],t);return tokenizer.parse(currentInput),d.loc=getLoc(0,t.length),d.children=condenseWhitespace(d.children),currentRoot=null,d}function cacheStatic(t,c){walk(t,void 0,c,isSingleElementRoot(t,t.children[0]))}function isSingleElementRoot(t,c){let{children:u}=t;return u.length===1&&c.type===1&&!isSlotOutlet(c)}function walk(t,c,u,d=!1,m=!1){let{children:g}=t,b=[];for(let c=0;c<g.length;c++){let S=g[c];if(S.type===1&&S.tagType===0){let t=d?0:getConstantType(S,u);if(t>0){if(t>=2){S.codegenNode.patchFlag=-1,b.push(S);continue}}else{let t=S.codegenNode;if(t.type===13){let c=t.patchFlag;if((c===void 0||c===512||c===1)&&getGeneratedPropsConstantType(S,u)>=2){let c=getNodeProps(S);c&&(t.props=u.hoist(c))}t.dynamicProps&&(t.dynamicProps=u.hoist(t.dynamicProps))}}}else if(S.type===12&&(d?0:getConstantType(S,u))>=2){b.push(S);continue}if(S.type===1){let c=S.tagType===1;c&&u.scopes.vSlot++,walk(S,t,u,!1,m),c&&u.scopes.vSlot--}else if(S.type===11)walk(S,t,u,S.children.length===1,!0);else if(S.type===9)for(let c=0;c<S.branches.length;c++)walk(S.branches[c],t,u,S.branches[c].children.length===1,m)}let S=!1;if(b.length===g.length&&t.type===1){if(t.tagType===0&&t.codegenNode&&t.codegenNode.type===13&&isArray$3(t.codegenNode.children))t.codegenNode.children=getCacheExpression(createArrayExpression(t.codegenNode.children)),S=!0;else if(t.tagType===1&&t.codegenNode&&t.codegenNode.type===13&&t.codegenNode.children&&!isArray$3(t.codegenNode.children)&&t.codegenNode.children.type===15){let c=getSlotNode(t.codegenNode,`default`);c&&(c.returns=getCacheExpression(createArrayExpression(c.returns)),S=!0)}else if(t.tagType===3&&c&&c.type===1&&c.tagType===1&&c.codegenNode&&c.codegenNode.type===13&&c.codegenNode.children&&!isArray$3(c.codegenNode.children)&&c.codegenNode.children.type===15){let u=findDir(t,`slot`,!0),d=u&&u.arg&&getSlotNode(c.codegenNode,u.arg);d&&(d.returns=getCacheExpression(createArrayExpression(d.returns)),S=!0)}}if(!S)for(let t of b)t.codegenNode=u.cache(t.codegenNode);function getCacheExpression(t){let c=u.cache(t);return m&&u.hmr&&(c.needArraySpread=!0),c}function getSlotNode(t,c){if(t.children&&!isArray$3(t.children)&&t.children.type===15){let u=t.children.properties.find(t=>t.key===c||t.key.content===c);return u&&u.value}}b.length&&u.transformHoist&&u.transformHoist(g,u,t)}function getConstantType(t,c){let{constantCache:u}=c;switch(t.type){case 1:if(t.tagType!==0)return 0;let d=u.get(t);if(d!==void 0)return d;let m=t.codegenNode;if(m.type!==13||m.isBlock&&t.tag!==`svg`&&t.tag!==`foreignObject`&&t.tag!==`math`)return 0;if(m.patchFlag===void 0){let d=3,g=getGeneratedPropsConstantType(t,c);if(g===0)return u.set(t,0),0;g<d&&(d=g);for(let m=0;m<t.children.length;m++){let g=getConstantType(t.children[m],c);if(g===0)return u.set(t,0),0;g<d&&(d=g)}if(d>1)for(let m=0;m<t.props.length;m++){let g=t.props[m];if(g.type===7&&g.name===`bind`&&g.exp){let m=getConstantType(g.exp,c);if(m===0)return u.set(t,0),0;m<d&&(d=m)}}if(m.isBlock){for(let c=0;c<t.props.length;c++)if(t.props[c].type===7)return u.set(t,0),0;c.removeHelper(OPEN_BLOCK),c.removeHelper(getVNodeBlockHelper(c.inSSR,m.isComponent)),m.isBlock=!1,c.helper(getVNodeHelper(c.inSSR,m.isComponent))}return u.set(t,d),d}else return u.set(t,0),0;case 2:case 3:return 3;case 9:case 11:case 10:return 0;case 5:case 12:return getConstantType(t.content,c);case 4:return t.constType;case 8:let g=3;for(let u=0;u<t.children.length;u++){let d=t.children[u];if(isString$1(d)||isSymbol(d))continue;let m=getConstantType(d,c);if(m===0)return 0;m<g&&(g=m)}return g;case 20:return 2;default:return process.env.NODE_ENV,0}}function getConstantTypeOfHelperCall(t,c){if(t.type===14&&!isString$1(t.callee)&&allowHoistedHelperSet.has(t.callee)){let u=t.arguments[0];if(u.type===4)return getConstantType(u,c);if(u.type===14)return getConstantTypeOfHelperCall(u,c)}return 0}function getGeneratedPropsConstantType(t,c){let u=3,d=getNodeProps(t);if(d&&d.type===15){let{properties:t}=d;for(let d=0;d<t.length;d++){let{key:m,value:g}=t[d],b=getConstantType(m,c);if(b===0)return b;b<u&&(u=b);let S;if(S=g.type===4?getConstantType(g,c):g.type===14?getConstantTypeOfHelperCall(g,c):0,S===0)return S;S<u&&(u=S)}}return u}function getNodeProps(t){let c=t.codegenNode;if(c.type===13)return c.props}function createTransformContext(t,{filename:c=``,prefixIdentifiers:u=!1,hoistStatic:d=!1,hmr:m=!1,cacheHandlers:g=!1,nodeTransforms:b=[],directiveTransforms:S={},transformHoist:C=null,isBuiltInComponent:w=NOOP,isCustomElement:T=NOOP,expressionPlugins:E=[],scopeId:D=null,slotted:O=!0,ssr:Or=!1,inSSR:kr=!1,ssrCssVars:Ar=``,bindingMetadata:jr=EMPTY_OBJ,inline:Mr=!1,isTS:Nr=!1,onError:Pr=defaultOnError,onWarn:Fr=defaultOnWarn,compatConfig:Ir}){let Lr=c.replace(/\?.*$/,``).match(/([^/\\]+)\.\w+$/),Rr={filename:c,selfName:Lr&&capitalize(camelize(Lr[1])),prefixIdentifiers:u,hoistStatic:d,hmr:m,cacheHandlers:g,nodeTransforms:b,directiveTransforms:S,transformHoist:C,isBuiltInComponent:w,isCustomElement:T,expressionPlugins:E,scopeId:D,slotted:O,ssr:Or,inSSR:kr,ssrCssVars:Ar,bindingMetadata:jr,inline:Mr,isTS:Nr,onError:Pr,onWarn:Fr,compatConfig:Ir,root:t,helpers:new Map,components:new Set,directives:new Set,hoists:[],imports:[],cached:[],constantCache:new WeakMap,temps:0,identifiers:Object.create(null),scopes:{vFor:0,vSlot:0,vPre:0,vOnce:0},parent:null,grandParent:null,currentNode:t,childIndex:0,inVOnce:!1,helper(t){let c=Rr.helpers.get(t)||0;return Rr.helpers.set(t,c+1),t},removeHelper(t){let c=Rr.helpers.get(t);if(c){let u=c-1;u?Rr.helpers.set(t,u):Rr.helpers.delete(t)}},helperString(t){return`_${helperNameMap[Rr.helper(t)]}`},replaceNode(t){if(process.env.NODE_ENV!==`production`){if(!Rr.currentNode)throw Error(`Node being replaced is already removed.`);if(!Rr.parent)throw Error(`Cannot replace root node.`)}Rr.parent.children[Rr.childIndex]=Rr.currentNode=t},removeNode(t){if(process.env.NODE_ENV!==`production`&&!Rr.parent)throw Error(`Cannot remove root node.`);let c=Rr.parent.children,u=t?c.indexOf(t):Rr.currentNode?Rr.childIndex:-1;if(process.env.NODE_ENV!==`production`&&u<0)throw Error(`node being removed is not a child of current parent`);!t||t===Rr.currentNode?(Rr.currentNode=null,Rr.onNodeRemoved()):Rr.childIndex>u&&(Rr.childIndex--,Rr.onNodeRemoved()),Rr.parent.children.splice(u,1)},onNodeRemoved:NOOP,addIdentifiers(t){},removeIdentifiers(t){},hoist(t){isString$1(t)&&(t=createSimpleExpression(t)),Rr.hoists.push(t);let c=createSimpleExpression(`_hoisted_${Rr.hoists.length}`,!1,t.loc,2);return c.hoisted=t,c},cache(t,c=!1,u=!1){let d=createCacheExpression(Rr.cached.length,t,c,u);return Rr.cached.push(d),d}};return Rr.filters=new Set,Rr}function transform(t,c){let u=createTransformContext(t,c);traverseNode(t,u),c.hoistStatic&&cacheStatic(t,u),c.ssr||createRootCodegen(t,u),t.helpers=new Set([...u.helpers.keys()]),t.components=[...u.components],t.directives=[...u.directives],t.imports=u.imports,t.hoists=u.hoists,t.temps=u.temps,t.cached=u.cached,t.transformed=!0,t.filters=[...u.filters]}function createRootCodegen(t,c){let{helper:u}=c,{children:d}=t;if(d.length===1){let u=d[0];if(isSingleElementRoot(t,u)&&u.codegenNode){let d=u.codegenNode;d.type===13&&convertToBlock(d,c),t.codegenNode=d}else t.codegenNode=u}else if(d.length>1){let m=64;process.env.NODE_ENV!==`production`&&d.filter(t=>t.type!==3).length===1&&(m|=2048),t.codegenNode=createVNodeCall(c,u(FRAGMENT),void 0,t.children,m,void 0,void 0,!0,void 0,!1)}}function traverseChildren(t,c){let u=0,nodeRemoved=()=>{u--};for(;u<t.children.length;u++){let d=t.children[u];isString$1(d)||(c.grandParent=c.parent,c.parent=t,c.childIndex=u,c.onNodeRemoved=nodeRemoved,traverseNode(d,c))}}function traverseNode(t,c){c.currentNode=t;let{nodeTransforms:u}=c,d=[];for(let m=0;m<u.length;m++){let g=u[m](t,c);if(g&&(isArray$3(g)?d.push(...g):d.push(g)),c.currentNode)t=c.currentNode;else return}switch(t.type){case 3:c.ssr||c.helper(CREATE_COMMENT);break;case 5:c.ssr||c.helper(TO_DISPLAY_STRING);break;case 9:for(let u=0;u<t.branches.length;u++)traverseNode(t.branches[u],c);break;case 10:case 11:case 1:case 0:traverseChildren(t,c);break}c.currentNode=t;let m=d.length;for(;m--;)d[m]()}function createStructuralDirectiveTransform(t,c){let u=isString$1(t)?c=>c===t:c=>t.test(c);return(t,d)=>{if(t.type===1){let{props:m}=t;if(t.tagType===3&&m.some(isVSlot))return;let g=[];for(let b=0;b<m.length;b++){let S=m[b];if(S.type===7&&u(S.name)){m.splice(b,1),b--;let u=c(t,S,d);u&&g.push(u)}}return g}}}function createCodegenContext(t,{mode:c=`function`,prefixIdentifiers:u=c===`module`,sourceMap:d=!1,filename:m=`template.vue.html`,scopeId:g=null,optimizeImports:b=!1,runtimeGlobalName:S=`Vue`,runtimeModuleName:C=`vue`,ssrRuntimeModuleName:w=`vue/server-renderer`,ssr:T=!1,isTS:E=!1,inSSR:D=!1}){let O={mode:c,prefixIdentifiers:u,sourceMap:d,filename:m,scopeId:g,optimizeImports:b,runtimeGlobalName:S,runtimeModuleName:C,ssrRuntimeModuleName:w,ssr:T,isTS:E,inSSR:D,source:t.source,code:``,column:1,line:1,offset:0,indentLevel:0,pure:!1,map:void 0,helper(t){return`_${helperNameMap[t]}`},push(t,c=-2,u){O.code+=t},indent(){newline(++O.indentLevel)},deindent(t=!1){t?--O.indentLevel:newline(--O.indentLevel)},newline(){newline(O.indentLevel)}};function newline(t){O.push(`
461
462
  `+` `.repeat(t),0)}return O}function generate(t,c={}){let u=createCodegenContext(t,c);c.onContextCreated&&c.onContextCreated(u);let{mode:d,push:m,prefixIdentifiers:g,indent:b,deindent:S,newline:C,scopeId:w,ssr:T}=u,E=Array.from(t.helpers),D=E.length>0,O=!g&&d!==`module`;if(genFunctionPreamble(t,u),m(`function ${T?`ssrRender`:`render`}(${(T?[`_ctx`,`_push`,`_parent`,`_attrs`]:[`_ctx`,`_cache`]).join(`, `)}) {`),b(),O&&(m(`with (_ctx) {`),b(),D&&(m(`const { ${E.map(aliasHelper).join(`, `)} } = _Vue
@@ -475,11 +476,11 @@ Displayable Constructor was called with no view Data.
475
476
  Card was displayed at ${t.timeStamp}
476
477
  User spent ${t.timeSpent} milliseconds with the card.
477
478
  `),this.$emit(`emitResponse`,t)}}}),__name(_sfc_render$17,`_sfc_render`),Q$1=F$3(ct$1,[[`render`,_sfc_render$17],[`__scopeId`,`data-v-2d892b82`]]),lt$1=defineComponent({name:`SessionControllerDebug`,props:{sessionController:{type:Object,required:!0}},setup(t){let c=ref(0),u=null;return onMounted(()=>{u=setInterval(()=>{c.value++},500)}),onUnmounted(()=>{u&&clearInterval(u)}),{debugInfo:computed(()=>(c.value,t.sessionController?t.sessionController.getDebugInfo():{reviewQueue:{length:0,dequeueCount:0,items:[]},newQueue:{length:0,dequeueCount:0,items:[]},failedQueue:{length:0,dequeueCount:0,items:[]},hydratedCache:{count:0,failedCacheSize:0,items:[]}}))}}}),ut$1={class:`debug-section`},dt$1={class:`debug-header`},ft$1={class:`debug-stats`},pt$1={class:`text-caption`},mt$1={class:`text-caption ml-2`},ht$1={key:0,class:`debug-items`},gt$1={class:`text-caption`},_t={class:`text-caption text-grey ml-1`},vt$1={key:0,class:`text-caption text-grey`},yt={key:1,class:`text-caption text-grey`},bt={class:`debug-section`},xt={class:`debug-header`},St={class:`debug-stats`},Ct={class:`text-caption`},wt={class:`text-caption ml-2`},Tt={key:0,class:`debug-items`},Et={class:`text-caption`},Dt={class:`text-caption text-grey ml-1`},Ot={key:0,class:`text-caption text-grey`},kt={key:1,class:`text-caption text-grey`},At={class:`debug-section`},jt={class:`debug-header`},Mt={class:`debug-stats`},Nt={class:`text-caption`},Pt={class:`text-caption ml-2`},Ft={key:0,class:`debug-items`},It={class:`text-caption`},Lt={class:`text-caption text-grey ml-1`},Rt={key:0,class:`text-caption text-grey`},zt={key:1,class:`text-caption text-grey`},Bt={class:`debug-section`},Vt={class:`debug-header`},Ht={class:`debug-stats`},Ut={class:`text-caption`},Wt={class:`text-caption ml-2`},Gt={key:0,class:`debug-items`},Kt={class:`text-caption`},qt={key:0,class:`text-caption text-grey`},Jt={key:1,class:`text-caption text-grey`},__name(_sfc_render$16,`_sfc_render`),Yt=F$3(lt$1,[[`render`,_sfc_render$16],[`__scopeId`,`data-v-1a6ac7a1`]]),Xt={},(function main(t,c,u,d){var m=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL),g=typeof Path2D==`function`&&typeof DOMMatrix==`function`,b=(function(){if(!t.OffscreenCanvas)return!1;var c=new OffscreenCanvas(1,1),u=c.getContext(`2d`);u.fillRect(0,0,1,1);var d=c.transferToImageBitmap();try{u.createPattern(d,`no-repeat`)}catch{return!1}return!0})();function noop(){}function promise(u){var d=c.exports.Promise,m=d===void 0?t.Promise:d;return typeof m==`function`?new m(u):(u(noop,noop),null)}var S=(function(t,c){return{transform:function(u){if(t)return u;if(c.has(u))return c.get(u);var d=new OffscreenCanvas(u.width,u.height);return d.getContext(`2d`).drawImage(u,0,0),c.set(u,d),d},clear:function(){c.clear()}}})(b,new Map),C=function(){var t=16,frame,cancel,c={},u=0;return typeof requestAnimationFrame==`function`&&typeof cancelAnimationFrame==`function`?(frame=function(d){var m=Math.random();return c[m]=requestAnimationFrame(function onFrame(g){u===g||u+t-1<g?(u=g,delete c[m],d()):c[m]=requestAnimationFrame(onFrame)}),m},cancel=function(t){c[t]&&cancelAnimationFrame(c[t])}):(frame=function(c){return setTimeout(c,t)},cancel=function(t){return clearTimeout(t)}),{frame,cancel}}(),w=(function(){var t,c,d={};function decorate(t){function execute(c,u){t.postMessage({options:c||{},callback:u})}t.init=function initWorker(c){var u=c.transferControlToOffscreen();t.postMessage({canvas:u},[u])},t.fire=function fireWorker(u,m,g){if(c)return execute(u,null),c;var b=Math.random().toString(36).slice(2);return c=promise(function(m){function workerDone(u){u.data.callback===b&&(delete d[b],t.removeEventListener(`message`,workerDone),c=null,S.clear(),g(),m())}t.addEventListener(`message`,workerDone),execute(u,b),d[b]=workerDone.bind(null,{data:{callback:b}})}),c},t.reset=function resetWorker(){for(var c in t.postMessage({reset:!0}),d)d[c](),delete d[c]}}return function(){if(t)return t;if(!u&&m){var c=[`var CONFETTI, SIZE = {}, module = {};`,`(`+main.toString()+`)(this, module, true, SIZE);`,`onmessage = function(msg) {`,` if (msg.data.options) {`,` CONFETTI(msg.data.options).then(function () {`,` if (msg.data.callback) {`,` postMessage({ callback: msg.data.callback });`,` }`,` });`,` } else if (msg.data.reset) {`,` CONFETTI && CONFETTI.reset();`,` } else if (msg.data.resize) {`,` SIZE.width = msg.data.resize.width;`,` SIZE.height = msg.data.resize.height;`,` } else if (msg.data.canvas) {`,` SIZE.width = msg.data.canvas.width;`,` SIZE.height = msg.data.canvas.height;`,` CONFETTI = module.exports.create(msg.data.canvas);`,` }`,`}`].join(`
478
- `);try{t=new Worker(URL.createObjectURL(new Blob([c])))}catch(t){return typeof console.warn==`function`&&console.warn(`🎊 Could not load worker`,t),null}decorate(t)}return t}})(),T={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:[`square`,`circle`],zIndex:100,colors:[`#26ccff`,`#a25afd`,`#ff5e7e`,`#88ff5a`,`#fcff42`,`#ffa62d`,`#ff36ff`],disableForReducedMotion:!1,scalar:1};function convert(t,c){return c?c(t):t}function isOk(t){return t!=null}function prop(t,c,u){return convert(t&&isOk(t[c])?t[c]:T[c],u)}function onlyPositiveInt(t){return t<0?0:Math.floor(t)}function randomInt(t,c){return Math.floor(Math.random()*(c-t))+t}function toDecimal(t){return parseInt(t,16)}function colorsToRgb(t){return t.map(hexToRgb)}function hexToRgb(t){var c=String(t).replace(/[^0-9a-f]/gi,``);return c.length<6&&(c=c[0]+c[0]+c[1]+c[1]+c[2]+c[2]),{r:toDecimal(c.substring(0,2)),g:toDecimal(c.substring(2,4)),b:toDecimal(c.substring(4,6))}}function getOrigin(t){var c=prop(t,`origin`,Object);return c.x=prop(c,`x`,Number),c.y=prop(c,`y`,Number),c}function setCanvasWindowSize(t){t.width=document.documentElement.clientWidth,t.height=document.documentElement.clientHeight}function setCanvasRectSize(t){var c=t.getBoundingClientRect();t.width=c.width,t.height=c.height}function getCanvas(t){var c=document.createElement(`canvas`);return c.style.position=`fixed`,c.style.top=`0px`,c.style.left=`0px`,c.style.pointerEvents=`none`,c.style.zIndex=t,c}function ellipse(t,c,u,d,m,g,b,S,C){t.save(),t.translate(c,u),t.rotate(g),t.scale(d,m),t.arc(0,0,1,b,S,C),t.restore()}function randomPhysics(t){var c=t.angle*(Math.PI/180),u=t.spread*(Math.PI/180);return{x:t.x,y:t.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:t.startVelocity*.5+Math.random()*t.startVelocity,angle2D:-c+(.5*u-Math.random()*u),tiltAngle:(Math.random()*.5+.25)*Math.PI,color:t.color,shape:t.shape,tick:0,totalTicks:t.ticks,decay:t.decay,drift:t.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:t.gravity*3,ovalScalar:.6,scalar:t.scalar,flat:t.flat}}function updateFetti(t,c){c.x+=Math.cos(c.angle2D)*c.velocity+c.drift,c.y+=Math.sin(c.angle2D)*c.velocity+c.gravity,c.velocity*=c.decay,c.flat?(c.wobble=0,c.wobbleX=c.x+10*c.scalar,c.wobbleY=c.y+10*c.scalar,c.tiltSin=0,c.tiltCos=0,c.random=1):(c.wobble+=c.wobbleSpeed,c.wobbleX=c.x+10*c.scalar*Math.cos(c.wobble),c.wobbleY=c.y+10*c.scalar*Math.sin(c.wobble),c.tiltAngle+=.1,c.tiltSin=Math.sin(c.tiltAngle),c.tiltCos=Math.cos(c.tiltAngle),c.random=Math.random()+2);var u=c.tick++/c.totalTicks,d=c.x+c.random*c.tiltCos,m=c.y+c.random*c.tiltSin,b=c.wobbleX+c.random*c.tiltCos,C=c.wobbleY+c.random*c.tiltSin;if(t.fillStyle=`rgba(`+c.color.r+`, `+c.color.g+`, `+c.color.b+`, `+(1-u)+`)`,t.beginPath(),g&&c.shape.type===`path`&&typeof c.shape.path==`string`&&Array.isArray(c.shape.matrix))t.fill(transformPath2D(c.shape.path,c.shape.matrix,c.x,c.y,Math.abs(b-d)*.1,Math.abs(C-m)*.1,Math.PI/10*c.wobble));else if(c.shape.type===`bitmap`){var w=Math.PI/10*c.wobble,T=Math.abs(b-d)*.1,E=Math.abs(C-m)*.1,D=c.shape.bitmap.width*c.scalar,O=c.shape.bitmap.height*c.scalar,Or=new DOMMatrix([Math.cos(w)*T,Math.sin(w)*T,-Math.sin(w)*E,Math.cos(w)*E,c.x,c.y]);Or.multiplySelf(new DOMMatrix(c.shape.matrix));var kr=t.createPattern(S.transform(c.shape.bitmap),`no-repeat`);kr.setTransform(Or),t.globalAlpha=1-u,t.fillStyle=kr,t.fillRect(c.x-D/2,c.y-O/2,D,O),t.globalAlpha=1}else if(c.shape===`circle`)t.ellipse?t.ellipse(c.x,c.y,Math.abs(b-d)*c.ovalScalar,Math.abs(C-m)*c.ovalScalar,Math.PI/10*c.wobble,0,2*Math.PI):ellipse(t,c.x,c.y,Math.abs(b-d)*c.ovalScalar,Math.abs(C-m)*c.ovalScalar,Math.PI/10*c.wobble,0,2*Math.PI);else if(c.shape===`star`)for(var Ar=Math.PI/2*3,jr=4*c.scalar,Mr=8*c.scalar,Nr=c.x,Pr=c.y,Fr=5,Ir=Math.PI/Fr;Fr--;)Nr=c.x+Math.cos(Ar)*Mr,Pr=c.y+Math.sin(Ar)*Mr,t.lineTo(Nr,Pr),Ar+=Ir,Nr=c.x+Math.cos(Ar)*jr,Pr=c.y+Math.sin(Ar)*jr,t.lineTo(Nr,Pr),Ar+=Ir;else t.moveTo(Math.floor(c.x),Math.floor(c.y)),t.lineTo(Math.floor(c.wobbleX),Math.floor(m)),t.lineTo(Math.floor(b),Math.floor(C)),t.lineTo(Math.floor(d),Math.floor(c.wobbleY));return t.closePath(),t.fill(),c.tick<c.totalTicks}function animate(t,c,m,g,b){var w=c.slice(),T=t.getContext(`2d`),E,D,O=promise(function(c){function onDone(){E=D=null,T.clearRect(0,0,g.width,g.height),S.clear(),b(),c()}function update(){u&&!(g.width===d.width&&g.height===d.height)&&(g.width=t.width=d.width,g.height=t.height=d.height),!g.width&&!g.height&&(m(t),g.width=t.width,g.height=t.height),T.clearRect(0,0,g.width,g.height),w=w.filter(function(t){return updateFetti(T,t)}),w.length?E=C.frame(update):onDone()}E=C.frame(update),D=onDone});return{addFettis:function(t){return w=w.concat(t),O},canvas:t,promise:O,reset:function(){E&&C.cancel(E),D&&D()}}}function confettiCannon(c,u){var d=!c,g=!!prop(u||{},`resize`),b=!1,S=prop(u,`disableForReducedMotion`,Boolean),C=m&&prop(u||{},`useWorker`)?w():null,T=d?setCanvasWindowSize:setCanvasRectSize,E=c&&C?!!c.__confetti_initialized:!1,D=typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion)`).matches,O;function fireLocal(t,u,d){for(var m=prop(t,`particleCount`,onlyPositiveInt),g=prop(t,`angle`,Number),b=prop(t,`spread`,Number),S=prop(t,`startVelocity`,Number),C=prop(t,`decay`,Number),w=prop(t,`gravity`,Number),E=prop(t,`drift`,Number),D=prop(t,`colors`,colorsToRgb),Or=prop(t,`ticks`,Number),kr=prop(t,`shapes`),Ar=prop(t,`scalar`),jr=!!prop(t,`flat`),Mr=getOrigin(t),Nr=m,Pr=[],Fr=c.width*Mr.x,Ir=c.height*Mr.y;Nr--;)Pr.push(randomPhysics({x:Fr,y:Ir,angle:g,spread:b,startVelocity:S,color:D[Nr%D.length],shape:kr[randomInt(0,kr.length)],ticks:Or,decay:C,gravity:w,drift:E,scalar:Ar,flat:jr}));return O?O.addFettis(Pr):(O=animate(c,Pr,T,u,d),O.promise)}function fire(u){var m=S||prop(u,`disableForReducedMotion`,Boolean),w=prop(u,`zIndex`,Number);if(m&&D)return promise(function(t){t()});d&&O?c=O.canvas:d&&!c&&(c=getCanvas(w),document.body.appendChild(c)),g&&!E&&T(c);var Or={width:c.width,height:c.height};C&&!E&&C.init(c),E=!0,C&&(c.__confetti_initialized=!0);function onResize(){if(C){var t={getBoundingClientRect:function(){if(!d)return c.getBoundingClientRect()}};T(t),C.postMessage({resize:{width:t.width,height:t.height}});return}Or.width=Or.height=null}function done(){O=null,g&&(b=!1,t.removeEventListener(`resize`,onResize)),d&&c&&(document.body.contains(c)&&document.body.removeChild(c),c=null,E=!1)}return g&&!b&&(b=!0,t.addEventListener(`resize`,onResize,!1)),C?C.fire(u,Or,done):fireLocal(u,Or,done)}return fire.reset=function(){C&&C.reset(),O&&O.reset()},fire}var E;function getDefaultFire(){return E||(E=confettiCannon(null,{useWorker:!0,resize:!0})),E}function transformPath2D(t,c,u,d,m,g,b){var S=new Path2D(t),C=new Path2D;C.addPath(S,new DOMMatrix(c));var w=new Path2D;return w.addPath(C,new DOMMatrix([Math.cos(b)*m,Math.sin(b)*m,-Math.sin(b)*g,Math.cos(b)*g,u,d])),w}function shapeFromPath(t){if(!g)throw Error(`path confetti are not supported in this browser`);var c,u;typeof t==`string`?c=t:(c=t.path,u=t.matrix);var d=new Path2D(c),m=document.createElement(`canvas`).getContext(`2d`);if(!u){for(var b=1e3,S=b,C=b,w=0,T=0,E,D,O=0;O<b;O+=2)for(var Or=0;Or<b;Or+=2)m.isPointInPath(d,O,Or,`nonzero`)&&(S=Math.min(S,O),C=Math.min(C,Or),w=Math.max(w,O),T=Math.max(T,Or));E=w-S,D=T-C;var kr=10,Ar=Math.min(kr/E,kr/D);u=[Ar,0,0,Ar,-Math.round(E/2+S)*Ar,-Math.round(D/2+C)*Ar]}return{type:`path`,path:c,matrix:u}}function shapeFromText(t){var c,u=1,d=`#000000`,m=`"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif`;typeof t==`string`?c=t:(c=t.text,u=`scalar`in t?t.scalar:u,m=`fontFamily`in t?t.fontFamily:m,d=`color`in t?t.color:d);var g=10*u,b=``+g+`px `+m,S=new OffscreenCanvas(g,g),C=S.getContext(`2d`);C.font=b;var w=C.measureText(c),T=Math.ceil(w.actualBoundingBoxRight+w.actualBoundingBoxLeft),E=Math.ceil(w.actualBoundingBoxAscent+w.actualBoundingBoxDescent),D=2,O=w.actualBoundingBoxLeft+D,Or=w.actualBoundingBoxAscent+D;T+=D+D,E+=D+D,S=new OffscreenCanvas(T,E),C=S.getContext(`2d`),C.font=b,C.fillStyle=d,C.fillText(c,O,Or);var kr=1/u;return{type:`bitmap`,bitmap:S.transferToImageBitmap(),matrix:[kr,0,0,kr,-T*kr/2,-E*kr/2]}}c.exports=function(){return getDefaultFire().apply(this,arguments)},c.exports.reset=function(){getDefaultFire().reset()},c.exports.create=confettiCannon,c.exports.shapeFromPath=shapeFromPath,c.exports.shapeFromText=shapeFromText})((function(){return typeof window<`u`?window:typeof self<`u`?self:this||{}})(),Xt,!1),Zt=Xt.exports,Xt.exports.create,Qt=defineComponent({name:`StudySession`,ref:{},components:{CardViewer:Q$1,StudySessionTimer:st$1,SkMouseTrap:Ne$1,HeatMap:Ae$1,SessionControllerDebug:Yt},props:{sessionTimeLimit:{type:Number,required:!0},contentSources:{type:Array,required:!0},user:{type:Object,required:!0},dataLayer:{type:Object,required:!0},sessionConfig:{type:Object,default:()=>({likesConfetti:!1})},getViewComponent:{type:Function,required:!0},frameless:{type:Boolean,default:!1},hideFooter:{type:Boolean,default:!1},transitionName:{type:String,default:`component-fade`},transitionMode:{type:String,default:`out-in`}},emits:[`session-finished`,`session-started`,`card-loaded`,`card-response`,`time-changed`,`session-prepared`,`session-error`,`replan-requested`],data(){return{cardID:``,view:null,data:[],courseID:``,card_elo:1e3,courseNames:{},cardCount:1,sessionController:null,sessionPrepared:!1,sessionFinished:!1,sessionRecord:[],percentageRemaining:100,timerIsActive:!0,loading:!1,userCourseRegDoc:null,sessionContentSources:[],timeRemaining:300,replanPending:!1,replanOptions:null,deferredNextCardAction:null,intervalHandler:null,cardType:``,debugMode:window.debugMode===!0}},computed:{currentCard(){return this.sessionRecord[this.sessionRecord.length-1]}},async created(){this.userCourseRegDoc=await this.user.getCourseRegistrationsDoc(),console.log(`[StudySession] Created lifecycle hook - starting initSession`),await this.initSession(),console.log(`[StudySession] InitSession completed in created hook`)},errorCaptured(t,c,u){return console.error(`[StudySession] Card render error (${u}), skipping card "${this.cardID}":`,t),this.sessionController&&this.sessionController.nextCard().then(t=>this.loadCard(t)),!1},methods:{async handleReadyToAdvance(){let t=this.deferredNextCardAction;if(!t){console.warn(`[StudySession] ready-to-advance received but no deferred action stashed — ignoring`);return}console.log(`[StudySession] ready-to-advance received — advancing with stashed action: ${t}`),this.deferredNextCardAction=null,this.loadCard(await this.sessionController.nextCard(t))},handleReplanRequest(t){if(this.sessionController){let c=t?.label,u=c?` [${c}]`:``;console.log(`[StudySession] Replan requested by card view${u}, deferring until after response processing`),this.replanPending=!0,this.replanOptions=t??null}},user_elo(t){let c=this.userCourseRegDoc.courses.find(c=>c.courseID===t);return toCourseElo(c?c.elo:void 0)},handleClassroomMessage(){return t=>(Z$2({text:this.user?.getUsername()||`[Unknown user]`,status:Status.ok}),console.log(`[StudySession] There was a change in the classroom DB:`),console.log(`[StudySession] change: ${t}`),console.log(`[StudySession] Stringified change: ${JSON.stringify(t)}`),{})},incrementSessionClock(){let t=60*this.sessionTimeLimit-this.timeRemaining;this.sessionController.addTime(Math.min(t,60)),this.tick()},tick(){this.timeRemaining=this.sessionController.secondsRemaining,this.percentageRemaining=this.timeRemaining>60?100*(this.timeRemaining/(60*this.sessionTimeLimit)):100*(this.timeRemaining/60),this.$emit(`time-changed`,this.timeRemaining),this.timeRemaining===0&&clearInterval(this.intervalHandler)},async initSession(){let t=[];try{console.log(`[StudySession] starting study session w/ sources: ${JSON.stringify(this.contentSources)}`),console.log(`[StudySession] Beginning preparation process`),this.sessionContentSources=markRaw((await Promise.all(this.contentSources.map(async t=>{try{return await getStudySource(t,this.user)}catch(c){return console.error(`Failed to load study source: ${t.type}/${t.id}`,c),null}}))).filter(t=>t!==null)),this.timeRemaining=this.sessionTimeLimit*60,t=await Promise.all(this.contentSources.filter(t=>t.type===`classroom`).map(async t=>await this.dataLayer.getClassroomDB(t.id,`student`))),t.forEach(t=>{});let c={};if(this.sessionConfig?.defaultBatchLimit!==void 0&&(c.defaultBatchLimit=this.sessionConfig.defaultBatchLimit),this.sessionConfig?.initialReviewCap!==void 0&&(c.initialReviewCap=this.sessionConfig.initialReviewCap),this.sessionController=markRaw(new SessionController(this.sessionContentSources,60*this.sessionTimeLimit,this.dataLayer,this.getViewComponent,void 0,c)),this.sessionController.sessionRecord=this.sessionRecord,this.sessionConfig?.initHints){for(let t of this.sessionContentSources)t.setEphemeralHints?.(this.sessionConfig.initHints);console.log(`[StudySession] Applied init hints to content sources`)}await this.sessionController.prepareSession(),this.intervalHandler=setInterval(this.tick,1e3),this.sessionPrepared=!0,console.log(`[StudySession] Session preparation complete, emitting session-prepared event`),this.$emit(`session-prepared`),console.log(`[StudySession] Event emission completed`)}catch(t){console.error(`[StudySession] Error during session preparation:`,t),this.$emit(`session-error`,{message:`Failed to prepare study session`,error:t})}try{this.contentSources.filter(t=>t.type===`course`).forEach(async t=>this.courseNames[t.id]=(await this.dataLayer.getCoursesDB().getCourseConfig(t.id)).name),console.log(`[StudySession] Session created:
479
+ `);try{t=new Worker(URL.createObjectURL(new Blob([c])))}catch(t){return typeof console.warn==`function`&&console.warn(`🎊 Could not load worker`,t),null}decorate(t)}return t}})(),T={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:[`square`,`circle`],zIndex:100,colors:[`#26ccff`,`#a25afd`,`#ff5e7e`,`#88ff5a`,`#fcff42`,`#ffa62d`,`#ff36ff`],disableForReducedMotion:!1,scalar:1};function convert(t,c){return c?c(t):t}function isOk(t){return t!=null}function prop(t,c,u){return convert(t&&isOk(t[c])?t[c]:T[c],u)}function onlyPositiveInt(t){return t<0?0:Math.floor(t)}function randomInt(t,c){return Math.floor(Math.random()*(c-t))+t}function toDecimal(t){return parseInt(t,16)}function colorsToRgb(t){return t.map(hexToRgb)}function hexToRgb(t){var c=String(t).replace(/[^0-9a-f]/gi,``);return c.length<6&&(c=c[0]+c[0]+c[1]+c[1]+c[2]+c[2]),{r:toDecimal(c.substring(0,2)),g:toDecimal(c.substring(2,4)),b:toDecimal(c.substring(4,6))}}function getOrigin(t){var c=prop(t,`origin`,Object);return c.x=prop(c,`x`,Number),c.y=prop(c,`y`,Number),c}function setCanvasWindowSize(t){t.width=document.documentElement.clientWidth,t.height=document.documentElement.clientHeight}function setCanvasRectSize(t){var c=t.getBoundingClientRect();t.width=c.width,t.height=c.height}function getCanvas(t){var c=document.createElement(`canvas`);return c.style.position=`fixed`,c.style.top=`0px`,c.style.left=`0px`,c.style.pointerEvents=`none`,c.style.zIndex=t,c}function ellipse(t,c,u,d,m,g,b,S,C){t.save(),t.translate(c,u),t.rotate(g),t.scale(d,m),t.arc(0,0,1,b,S,C),t.restore()}function randomPhysics(t){var c=t.angle*(Math.PI/180),u=t.spread*(Math.PI/180);return{x:t.x,y:t.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:t.startVelocity*.5+Math.random()*t.startVelocity,angle2D:-c+(.5*u-Math.random()*u),tiltAngle:(Math.random()*.5+.25)*Math.PI,color:t.color,shape:t.shape,tick:0,totalTicks:t.ticks,decay:t.decay,drift:t.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:t.gravity*3,ovalScalar:.6,scalar:t.scalar,flat:t.flat}}function updateFetti(t,c){c.x+=Math.cos(c.angle2D)*c.velocity+c.drift,c.y+=Math.sin(c.angle2D)*c.velocity+c.gravity,c.velocity*=c.decay,c.flat?(c.wobble=0,c.wobbleX=c.x+10*c.scalar,c.wobbleY=c.y+10*c.scalar,c.tiltSin=0,c.tiltCos=0,c.random=1):(c.wobble+=c.wobbleSpeed,c.wobbleX=c.x+10*c.scalar*Math.cos(c.wobble),c.wobbleY=c.y+10*c.scalar*Math.sin(c.wobble),c.tiltAngle+=.1,c.tiltSin=Math.sin(c.tiltAngle),c.tiltCos=Math.cos(c.tiltAngle),c.random=Math.random()+2);var u=c.tick++/c.totalTicks,d=c.x+c.random*c.tiltCos,m=c.y+c.random*c.tiltSin,b=c.wobbleX+c.random*c.tiltCos,C=c.wobbleY+c.random*c.tiltSin;if(t.fillStyle=`rgba(`+c.color.r+`, `+c.color.g+`, `+c.color.b+`, `+(1-u)+`)`,t.beginPath(),g&&c.shape.type===`path`&&typeof c.shape.path==`string`&&Array.isArray(c.shape.matrix))t.fill(transformPath2D(c.shape.path,c.shape.matrix,c.x,c.y,Math.abs(b-d)*.1,Math.abs(C-m)*.1,Math.PI/10*c.wobble));else if(c.shape.type===`bitmap`){var w=Math.PI/10*c.wobble,T=Math.abs(b-d)*.1,E=Math.abs(C-m)*.1,D=c.shape.bitmap.width*c.scalar,O=c.shape.bitmap.height*c.scalar,Or=new DOMMatrix([Math.cos(w)*T,Math.sin(w)*T,-Math.sin(w)*E,Math.cos(w)*E,c.x,c.y]);Or.multiplySelf(new DOMMatrix(c.shape.matrix));var kr=t.createPattern(S.transform(c.shape.bitmap),`no-repeat`);kr.setTransform(Or),t.globalAlpha=1-u,t.fillStyle=kr,t.fillRect(c.x-D/2,c.y-O/2,D,O),t.globalAlpha=1}else if(c.shape===`circle`)t.ellipse?t.ellipse(c.x,c.y,Math.abs(b-d)*c.ovalScalar,Math.abs(C-m)*c.ovalScalar,Math.PI/10*c.wobble,0,2*Math.PI):ellipse(t,c.x,c.y,Math.abs(b-d)*c.ovalScalar,Math.abs(C-m)*c.ovalScalar,Math.PI/10*c.wobble,0,2*Math.PI);else if(c.shape===`star`)for(var Ar=Math.PI/2*3,jr=4*c.scalar,Mr=8*c.scalar,Nr=c.x,Pr=c.y,Fr=5,Ir=Math.PI/Fr;Fr--;)Nr=c.x+Math.cos(Ar)*Mr,Pr=c.y+Math.sin(Ar)*Mr,t.lineTo(Nr,Pr),Ar+=Ir,Nr=c.x+Math.cos(Ar)*jr,Pr=c.y+Math.sin(Ar)*jr,t.lineTo(Nr,Pr),Ar+=Ir;else t.moveTo(Math.floor(c.x),Math.floor(c.y)),t.lineTo(Math.floor(c.wobbleX),Math.floor(m)),t.lineTo(Math.floor(b),Math.floor(C)),t.lineTo(Math.floor(d),Math.floor(c.wobbleY));return t.closePath(),t.fill(),c.tick<c.totalTicks}function animate(t,c,m,g,b){var w=c.slice(),T=t.getContext(`2d`),E,D,O=promise(function(c){function onDone(){E=D=null,T.clearRect(0,0,g.width,g.height),S.clear(),b(),c()}function update(){u&&!(g.width===d.width&&g.height===d.height)&&(g.width=t.width=d.width,g.height=t.height=d.height),!g.width&&!g.height&&(m(t),g.width=t.width,g.height=t.height),T.clearRect(0,0,g.width,g.height),w=w.filter(function(t){return updateFetti(T,t)}),w.length?E=C.frame(update):onDone()}E=C.frame(update),D=onDone});return{addFettis:function(t){return w=w.concat(t),O},canvas:t,promise:O,reset:function(){E&&C.cancel(E),D&&D()}}}function confettiCannon(c,u){var d=!c,g=!!prop(u||{},`resize`),b=!1,S=prop(u,`disableForReducedMotion`,Boolean),C=m&&prop(u||{},`useWorker`)?w():null,T=d?setCanvasWindowSize:setCanvasRectSize,E=c&&C?!!c.__confetti_initialized:!1,D=typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion)`).matches,O;function fireLocal(t,u,d){for(var m=prop(t,`particleCount`,onlyPositiveInt),g=prop(t,`angle`,Number),b=prop(t,`spread`,Number),S=prop(t,`startVelocity`,Number),C=prop(t,`decay`,Number),w=prop(t,`gravity`,Number),E=prop(t,`drift`,Number),D=prop(t,`colors`,colorsToRgb),Or=prop(t,`ticks`,Number),kr=prop(t,`shapes`),Ar=prop(t,`scalar`),jr=!!prop(t,`flat`),Mr=getOrigin(t),Nr=m,Pr=[],Fr=c.width*Mr.x,Ir=c.height*Mr.y;Nr--;)Pr.push(randomPhysics({x:Fr,y:Ir,angle:g,spread:b,startVelocity:S,color:D[Nr%D.length],shape:kr[randomInt(0,kr.length)],ticks:Or,decay:C,gravity:w,drift:E,scalar:Ar,flat:jr}));return O?O.addFettis(Pr):(O=animate(c,Pr,T,u,d),O.promise)}function fire(u){var m=S||prop(u,`disableForReducedMotion`,Boolean),w=prop(u,`zIndex`,Number);if(m&&D)return promise(function(t){t()});d&&O?c=O.canvas:d&&!c&&(c=getCanvas(w),document.body.appendChild(c)),g&&!E&&T(c);var Or={width:c.width,height:c.height};C&&!E&&C.init(c),E=!0,C&&(c.__confetti_initialized=!0);function onResize(){if(C){var t={getBoundingClientRect:function(){if(!d)return c.getBoundingClientRect()}};T(t),C.postMessage({resize:{width:t.width,height:t.height}});return}Or.width=Or.height=null}function done(){O=null,g&&(b=!1,t.removeEventListener(`resize`,onResize)),d&&c&&(document.body.contains(c)&&document.body.removeChild(c),c=null,E=!1)}return g&&!b&&(b=!0,t.addEventListener(`resize`,onResize,!1)),C?C.fire(u,Or,done):fireLocal(u,Or,done)}return fire.reset=function(){C&&C.reset(),O&&O.reset()},fire}var E;function getDefaultFire(){return E||(E=confettiCannon(null,{useWorker:!0,resize:!0})),E}function transformPath2D(t,c,u,d,m,g,b){var S=new Path2D(t),C=new Path2D;C.addPath(S,new DOMMatrix(c));var w=new Path2D;return w.addPath(C,new DOMMatrix([Math.cos(b)*m,Math.sin(b)*m,-Math.sin(b)*g,Math.cos(b)*g,u,d])),w}function shapeFromPath(t){if(!g)throw Error(`path confetti are not supported in this browser`);var c,u;typeof t==`string`?c=t:(c=t.path,u=t.matrix);var d=new Path2D(c),m=document.createElement(`canvas`).getContext(`2d`);if(!u){for(var b=1e3,S=b,C=b,w=0,T=0,E,D,O=0;O<b;O+=2)for(var Or=0;Or<b;Or+=2)m.isPointInPath(d,O,Or,`nonzero`)&&(S=Math.min(S,O),C=Math.min(C,Or),w=Math.max(w,O),T=Math.max(T,Or));E=w-S,D=T-C;var kr=10,Ar=Math.min(kr/E,kr/D);u=[Ar,0,0,Ar,-Math.round(E/2+S)*Ar,-Math.round(D/2+C)*Ar]}return{type:`path`,path:c,matrix:u}}function shapeFromText(t){var c,u=1,d=`#000000`,m=`"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif`;typeof t==`string`?c=t:(c=t.text,u=`scalar`in t?t.scalar:u,m=`fontFamily`in t?t.fontFamily:m,d=`color`in t?t.color:d);var g=10*u,b=``+g+`px `+m,S=new OffscreenCanvas(g,g),C=S.getContext(`2d`);C.font=b;var w=C.measureText(c),T=Math.ceil(w.actualBoundingBoxRight+w.actualBoundingBoxLeft),E=Math.ceil(w.actualBoundingBoxAscent+w.actualBoundingBoxDescent),D=2,O=w.actualBoundingBoxLeft+D,Or=w.actualBoundingBoxAscent+D;T+=D+D,E+=D+D,S=new OffscreenCanvas(T,E),C=S.getContext(`2d`),C.font=b,C.fillStyle=d,C.fillText(c,O,Or);var kr=1/u;return{type:`bitmap`,bitmap:S.transferToImageBitmap(),matrix:[kr,0,0,kr,-T*kr/2,-E*kr/2]}}c.exports=function(){return getDefaultFire().apply(this,arguments)},c.exports.reset=function(){getDefaultFire().reset()},c.exports.create=confettiCannon,c.exports.shapeFromPath=shapeFromPath,c.exports.shapeFromText=shapeFromText})((function(){return typeof window<`u`?window:typeof self<`u`?self:this||{}})(),Xt,!1),Zt=Xt.exports,Xt.exports.create,Qt=defineComponent({name:`StudySession`,ref:{},components:{CardViewer:Q$1,StudySessionTimer:st$1,SkMouseTrap:Ne$1,HeatMap:Ae$1,SessionControllerDebug:Yt},props:{sessionTimeLimit:{type:Number,required:!0},contentSources:{type:Array,required:!0},user:{type:Object,required:!0},dataLayer:{type:Object,required:!0},sessionConfig:{type:Object,default:()=>({likesConfetti:!1})},getViewComponent:{type:Function,required:!0},frameless:{type:Boolean,default:!1},hideFooter:{type:Boolean,default:!1},transitionName:{type:String,default:`component-fade`},transitionMode:{type:String,default:`out-in`}},emits:[`session-finished`,`session-started`,`card-loaded`,`card-response`,`time-changed`,`session-prepared`,`session-error`,`replan-requested`],data(){return{cardID:``,view:null,data:[],courseID:``,card_elo:1e3,courseNames:{},cardCount:1,sessionController:null,sessionPrepared:!1,sessionFinished:!1,sessionRecord:[],percentageRemaining:100,timerIsActive:!0,loading:!1,userCourseRegDoc:null,sessionContentSources:[],timeRemaining:300,replanPending:!1,replanOptions:null,deferredNextCardAction:null,intervalHandler:null,cardType:``,debugMode:window.debugMode===!0}},computed:{currentCard(){return this.sessionRecord[this.sessionRecord.length-1]}},async created(){this.userCourseRegDoc=await this.user.getCourseRegistrationsDoc(),console.log(`[StudySession] Created lifecycle hook - starting initSession`),await this.initSession(),console.log(`[StudySession] InitSession completed in created hook`)},errorCaptured(t,c,u){return console.error(`[StudySession] Card render error (${u}), skipping card "${this.cardID}":`,t),this.sessionController&&this.sessionController.nextCard().then(t=>this.loadCard(t)),!1},methods:{async handleReadyToAdvance(){let t=this.deferredNextCardAction;if(!t){console.warn(`[StudySession] ready-to-advance received but no deferred action stashed — ignoring`);return}console.log(`[StudySession] ready-to-advance received — advancing with stashed action: ${t}`),this.deferredNextCardAction=null,this.loadCard(await this.sessionController.nextCard(t))},handleReplanRequest(t){if(this.sessionController){let c=t?.label,u=c?` [${c}]`:``;console.log(`[StudySession] Replan requested by card view${u}, deferring until after response processing`),this.replanPending=!0,this.replanOptions=t??null}},user_elo(t){let c=this.userCourseRegDoc.courses.find(c=>c.courseID===t);return toCourseElo(c?c.elo:void 0)},handleClassroomMessage(){return t=>(Z$2({text:this.user?.getUsername()||`[Unknown user]`,status:Status.ok}),console.log(`[StudySession] There was a change in the classroom DB:`),console.log(`[StudySession] change: ${t}`),console.log(`[StudySession] Stringified change: ${JSON.stringify(t)}`),{})},incrementSessionClock(){let t=60*this.sessionTimeLimit-this.timeRemaining;this.sessionController.addTime(Math.min(t,60)),this.tick()},tick(){this.timeRemaining=this.sessionController.secondsRemaining,this.percentageRemaining=this.timeRemaining>60?100*(this.timeRemaining/(60*this.sessionTimeLimit)):100*(this.timeRemaining/60),this.$emit(`time-changed`,this.timeRemaining),this.timeRemaining===0&&clearInterval(this.intervalHandler)},async initSession(){let t=[];try{console.log(`[StudySession] starting study session w/ sources: ${JSON.stringify(this.contentSources)}`),console.log(`[StudySession] Beginning preparation process`),this.sessionContentSources=markRaw((await Promise.all(this.contentSources.map(async t=>{try{return await getStudySource(t,this.user)}catch(c){return console.error(`Failed to load study source: ${t.type}/${t.id}`,c),null}}))).filter(t=>t!==null)),this.timeRemaining=this.sessionTimeLimit*60,t=await Promise.all(this.contentSources.filter(t=>t.type===`classroom`).map(async t=>await this.dataLayer.getClassroomDB(t.id,`student`))),t.forEach(t=>{});let c={};this.sessionConfig?.defaultBatchLimit!==void 0&&(c.defaultBatchLimit=this.sessionConfig.defaultBatchLimit),this.sessionConfig?.initialReviewCap!==void 0&&(c.initialReviewCap=this.sessionConfig.initialReviewCap),this.sessionConfig?.outcomeObservers?.length&&(c.outcomeObservers=this.sessionConfig.outcomeObservers),this.sessionController=markRaw(new SessionController(this.sessionContentSources,60*this.sessionTimeLimit,this.dataLayer,this.getViewComponent,void 0,c)),this.sessionController.sessionRecord=this.sessionRecord,this.sessionConfig?.initHints&&(this.sessionController.setSessionHints(this.sessionConfig.initHints),console.log(`[StudySession] Applied init hints as session-durable hints`)),await this.sessionController.prepareSession(),this.intervalHandler=setInterval(this.tick,1e3),this.sessionPrepared=!0,console.log(`[StudySession] Session preparation complete, emitting session-prepared event`),this.$emit(`session-prepared`),console.log(`[StudySession] Event emission completed`)}catch(t){console.error(`[StudySession] Error during session preparation:`,t),this.$emit(`session-error`,{message:`Failed to prepare study session`,error:t})}try{this.contentSources.filter(t=>t.type===`course`).forEach(async t=>this.courseNames[t.id]=(await this.dataLayer.getCoursesDB().getCourseConfig(t.id)).name),console.log(`[StudySession] Session created:
479
480
  ${this.sessionController?.toString()||`Session controller not initialized`}
480
481
  User courses: ${this.contentSources.filter(t=>t.type===`course`).map(t=>t.id).toString()}
481
482
  User classrooms: ${t.map(t=>t._id).toString()||`No classrooms`}
482
- `)}catch(t){console.error(`[StudySession] Error during final session setup:`,t)}if(this.sessionController)try{this.$emit(`session-started`),this.loadCard(await this.sessionController.nextCard())}catch(t){console.error(`[StudySession] Error loading next card:`,t),this.$emit(`session-error`,{message:`Failed to load study card`,error:t})}else console.error(`[StudySession] Cannot load card: session controller not initialized`),this.$emit(`session-error`,{message:`Study session initialization failed`})},countCardViews(t,c){return this.sessionRecord.filter(u=>u.card.course_id===t&&u.card.card_id===c).length},async processResponse(t){this.$emit(`card-response`,t),this.timerIsActive=!0,t.cardID=this.cardID,t.courseID=this.courseID,this.currentCard.records.push(t),console.log(`[StudySession] StudySession.processResponse is running...`);let c=this.logCardRecord(t).catch(t=>{throw console.error(`[StudySession] putCardRecord failed:`,t),t}),u=1,d=1;if(isQuestionView(this.$refs.cardViewer?.$refs.activeView)){let t=this.$refs.cardViewer.$refs.activeView;u=t.maxAttemptsPerView,d=t.maxSessionViews}let m=this.countCardViews(this.courseID,this.cardID),g=await this.sessionController.submitResponse(t,c,this.userCourseRegDoc,this.currentCard,this.courseID,this.cardID,u,d,m);try{this.handleUIFeedback(g)}catch(t){console.error(`[StudySession] Error handling UI feedback: ${t}.\n\nResult: ${JSON.stringify(g)}`)}if(this.replanPending){let t=this.replanOptions,c=t?.label,u=c?` [${c}]`:``;console.log(`[StudySession] Firing deferred replan (post-submitResponse)${u}`),this.replanPending=!1,this.replanOptions=null,this.sessionController.requestReplan(t??void 0),this.$emit(`replan-requested`)}g.deferred?(console.log(`[StudySession] Deferred advance — stashing action: ${g.nextCardAction}`),this.deferredNextCardAction=g.nextCardAction):g.shouldLoadNextCard&&this.loadCard(await this.sessionController.nextCard(g.nextCardAction)),g.shouldClearFeedbackShadow&&this.clearFeedbackShadow()},handleUIFeedback(t){if(t.isCorrect){if(!this.frameless)try{this.$refs.shadowWrapper&&t.performanceScore!==void 0&&(this.$refs.shadowWrapper.setAttribute(`style`,`--r: ${255*(1-t.performanceScore)}; --g:255`),this.$refs.shadowWrapper.classList.add(`correct`))}catch(t){console.warn(`[StudySession] Error setting shadowWrapper style: ${t}`)}this.sessionConfig.likesConfetti&&Zt({origin:{y:1,x:.25+.5*Math.random()},disableForReducedMotion:!0,angle:60+60*Math.random()})}else if(!this.frameless)try{this.$refs.shadowWrapper&&this.$refs.shadowWrapper.classList.add(`incorrect`)}catch(t){console.warn(`[StudySession] Error setting shadowWrapper style: ${t}`)}},clearFeedbackShadow(){this.frameless||setTimeout(()=>{try{this.$refs.shadowWrapper&&this.$refs.shadowWrapper.classList.remove(`correct`,`incorrect`)}catch(t){console.warn(`[StudySession] Error clearing shadowWrapper style: ${t}`)}},1250)},async logCardRecord(t){console.log(`[StudySession] About to call user.putCardRecord...`);let c=await this.user.putCardRecord(t);return console.log(`[StudySession] user.putCardRecord completed`),c},async loadCard(t){if(this.loading){console.warn(`Attempted to load card while loading another...`);return}if(console.log(`[StudySession] loading: ${JSON.stringify(t)}`),t===null){this.sessionFinished=!0,this.$emit(`session-finished`,this.sessionRecord);return}this.cardType=t.item.status,this.loading=!0,this.cardCount++,this.data=t.data,this.view=markRaw(t.view),this.cardID=t.item.cardID,this.courseID=t.item.courseID,this.card_elo=t.item.elo||1e3,this.sessionRecord.push({card:{course_id:t.item.courseID,card_id:t.item.cardID,card_elo:this.card_elo,tags:t.tags??[]},item:t.item,records:[]}),this.$emit(`card-loaded`,{courseID:t.item.courseID,cardID:t.item.cardID,cardCount:this.cardCount}),this.loading=!1}}}),$t={key:0,class:`StudySession`},en={key:2},tn={key:3},nn={class:`text-h4`},rn={key:0},an={key:4,ref:`shadowWrapper`,class:`card-transition-container`},on={key:0},__name(_sfc_render$15,`_sfc_render`),sn=F$3(Qt,[[`render`,_sfc_render$15],[`__scopeId`,`data-v-bc445530`]]),cn=defineComponent({name:`MultipleChoiceOption`,components:{MarkdownRenderer:defineAsyncComponent(()=>Promise.resolve().then(()=>(init_MarkdownRenderer_DoVbFpA6(),MarkdownRenderer_DoVbFpA6_exports)).then(t=>t.n))},props:{content:{type:String,required:!0},selected:{type:Boolean,required:!0},number:{type:Number,required:!0},setSelection:{type:Function,required:!0},submit:{type:Function,required:!0},markedWrong:{type:Boolean,required:!0}},computed:{className(){let t;switch(this.number){case 0:t=`bg-red`;break;case 1:t=`bg-purple`;break;case 2:t=`bg-indigo`;break;case 3:t=`bg-light-blue`;break;case 4:t=`bg-teal`;break;case 5:t=`bg-deep-orange`;break;default:t=`bg-grey`;break}if(this.selected&&!this.markedWrong)return`choice selected ${t} lighten-3 elevation-8`;if(!this.selected&&!this.markedWrong)return`choice not-selected ${t} lighten-4 elevation-1`;if(this.selected&&this.markedWrong)return`choice selected grey lighten-2 elevation-8`;if(!this.selected&&this.markedWrong)return`choice not-selected grey lighten-2 elevation-0`;throw Error(`'selected' and 'markedWrong' props in MultipleChoiceOption are in an impossible configuration.`)}},methods:{select(){this.setSelection(this.number)},submitThisOption(){this.markedWrong||(this.select(),this.submit())}}}),__name(_sfc_render$14,`_sfc_render`),ln=F$3(cn,[[`render`,_sfc_render$14],[`__scopeId`,`data-v-96de7172`]]),un=defineComponent({name:`RadioMultipleChoice`,components:{MultipleChoiceOption:ln},extends:se$3,props:{choiceList:{type:Array,required:!0}},data(){return{currentSelection:-1,incorrectSelections:[],containerRef:null,_registeredHotkeys:[]}},watch:{choiceList:{immediate:!0,handler(t){t?.length&&this.bindKeys()}}},mounted(){this.containerRef&&this.containerRef.focus()},unmounted(){this.unbindKeys()},methods:{forwardSelection(){if(!this.choiceIsWrong(this.choiceList[this.currentSelection])&&this.currentSelection!==-1){let t={choiceList:this.choiceList,selection:this.currentSelection};this.submitAnswer(t).isCorrect||this.incorrectSelections.push(this.currentSelection)}},setSelection(t){t<this.choiceList.length&&(this.currentSelection=t)},incrementSelection(){this.currentSelection===-1?this.currentSelection=Math.ceil(this.choiceList.length/2):this.currentSelection=Math.min(this.choiceList.length-1,this.currentSelection+1)},decrementSelection(){this.currentSelection===-1?this.currentSelection=Math.floor(this.choiceList.length/2-1):this.currentSelection=Math.max(0,this.currentSelection-1)},choiceIsWrong(t){let c=!1;return this.incorrectSelections.forEach(u=>{this.choiceList[u]===t&&(c=!0)}),c},bindKeys(){let t=[{hotkey:`left`,callback:this.decrementSelection,command:`Move selection left`},{hotkey:`right`,callback:this.incrementSelection,command:`Move selection right`},{hotkey:`enter`,callback:this.forwardSelection,command:`Submit selection`},...Array.from({length:this.choiceList.length},(t,c)=>({hotkey:(c+1).toString(),callback:()=>this.setSelection(c),command:`Select ${(t=>{switch(t){case 0:return`first`;case 1:return`second`;case 2:return`third`;case 3:return`fourth`;case 4:return`fifth`;case 5:return`sixth`;default:return`${t+1}th`}})(c)} option`}))];I$2.addBinding(t),this._registeredHotkeys=t.map(t=>t.hotkey)},unbindKeys(){this._registeredHotkeys&&this._registeredHotkeys.forEach(t=>{I$2.removeBinding(t)})}}}),dn={ref:`containerRef`,class:`multipleChoice`},__name(_sfc_render$13,`_sfc_render`),fn=F$3(un,[[`render`,_sfc_render$13]]),pn=defineComponent({name:`TrueFalse`,components:{RadioMultipleChoice:fn},props:{MouseTrap:{type:Object,required:!0},submit:{type:Function,required:!0}}}),mn={"data-viewable":`TrueFalse`},__name(_sfc_render$12,`_sfc_render`),hn=F$3(pn,[[`render`,_sfc_render$12]]),gn=defineComponent({name:`UserInputNumber`,ref:{},extends:se$3,methods:{mounted(){this.$refs.input.focus()},isNumeric(t){return!isNaN(Number.parseFloat(t))},makeNumeric(t){if(typeof t==`string`)return Number.parseFloat(t);throw Error(`Expected a string, got `+typeof t)}}}),__name(_sfc_render$11,`_sfc_render`),_n=F$3(gn,[[`render`,_sfc_render$11],[`__scopeId`,`data-v-a56dcd1c`]]),vn=defineComponent({name:`CardLoader`,components:{CardViewer:Q$1},props:{sessionOrder:{type:Number,required:!1,default:0},qualified_id:{type:Object,required:!0},viewLookup:{type:Function,required:!0}},data(){return{loading:!0,view:null,data:[],courseID:``,cardID:``}},created(){this.loadCard()},watch:{qualified_id:{immediate:!0,handler(){this.loadCard()}}},methods:{processResponse(t){log$2(`
483
+ `)}catch(t){console.error(`[StudySession] Error during final session setup:`,t)}if(this.sessionController)try{this.$emit(`session-started`),this.loadCard(await this.sessionController.nextCard())}catch(t){console.error(`[StudySession] Error loading next card:`,t),this.$emit(`session-error`,{message:`Failed to load study card`,error:t})}else console.error(`[StudySession] Cannot load card: session controller not initialized`),this.$emit(`session-error`,{message:`Study session initialization failed`})},countCardViews(t,c){return this.sessionRecord.filter(u=>u.card.course_id===t&&u.card.card_id===c).length},async processResponse(t){this.$emit(`card-response`,t),this.timerIsActive=!0,t.cardID=this.cardID,t.courseID=this.courseID,this.currentCard.records.push(t),console.log(`[StudySession] StudySession.processResponse is running...`);let c=this.logCardRecord(t).catch(t=>{throw console.error(`[StudySession] putCardRecord failed:`,t),t}),u=1,d=1;if(isQuestionView(this.$refs.cardViewer?.$refs.activeView)){let t=this.$refs.cardViewer.$refs.activeView;u=t.maxAttemptsPerView,d=t.maxSessionViews}let m=this.countCardViews(this.courseID,this.cardID),g=await this.sessionController.submitResponse(t,c,this.userCourseRegDoc,this.currentCard,this.courseID,this.cardID,u,d,m);try{this.handleUIFeedback(g)}catch(t){console.error(`[StudySession] Error handling UI feedback: ${t}.\n\nResult: ${JSON.stringify(g)}`)}if(this.replanPending){let t=this.replanOptions,c=t?.label,u=c?` [${c}]`:``;console.log(`[StudySession] Firing deferred replan (post-submitResponse)${u}`),this.replanPending=!1,this.replanOptions=null,this.sessionController.requestReplan(t??void 0),this.$emit(`replan-requested`)}g.deferred?(console.log(`[StudySession] Deferred advance — stashing action: ${g.nextCardAction}`),this.deferredNextCardAction=g.nextCardAction):g.shouldLoadNextCard&&this.loadCard(await this.sessionController.nextCard(g.nextCardAction)),g.shouldClearFeedbackShadow&&this.clearFeedbackShadow()},handleUIFeedback(t){if(t.isCorrect){if(!this.frameless)try{this.$refs.shadowWrapper&&t.performanceScore!==void 0&&(this.$refs.shadowWrapper.setAttribute(`style`,`--r: ${255*(1-t.performanceScore)}; --g:255`),this.$refs.shadowWrapper.classList.add(`correct`))}catch(t){console.warn(`[StudySession] Error setting shadowWrapper style: ${t}`)}this.sessionConfig.likesConfetti&&Zt({origin:{y:1,x:.25+.5*Math.random()},disableForReducedMotion:!0,angle:60+60*Math.random()})}else if(!this.frameless)try{this.$refs.shadowWrapper&&this.$refs.shadowWrapper.classList.add(`incorrect`)}catch(t){console.warn(`[StudySession] Error setting shadowWrapper style: ${t}`)}},clearFeedbackShadow(){this.frameless||setTimeout(()=>{try{this.$refs.shadowWrapper&&this.$refs.shadowWrapper.classList.remove(`correct`,`incorrect`)}catch(t){console.warn(`[StudySession] Error clearing shadowWrapper style: ${t}`)}},1250)},async logCardRecord(t){console.log(`[StudySession] About to call user.putCardRecord...`);let c=await this.user.putCardRecord(t);return console.log(`[StudySession] user.putCardRecord completed`),c},async loadCard(t){if(this.loading){console.warn(`Attempted to load card while loading another...`);return}if(console.log(`[StudySession] loading: ${JSON.stringify(t)}`),t===null){this.sessionFinished=!0,this.$emit(`session-finished`,this.sessionRecord);return}this.cardType=t.item.status,this.loading=!0,this.cardCount++,this.data=t.data,this.view=markRaw(t.view),this.cardID=t.item.cardID,this.courseID=t.item.courseID,this.card_elo=t.item.elo||1e3,this.sessionRecord.push({card:{course_id:t.item.courseID,card_id:t.item.cardID,card_elo:this.card_elo,tags:t.tags??[]},item:t.item,records:[]}),this.$emit(`card-loaded`,{courseID:t.item.courseID,cardID:t.item.cardID,cardCount:this.cardCount}),this.loading=!1}}}),$t={key:0,class:`StudySession`},en={key:2},tn={key:3},nn={class:`text-h4`},rn={key:0},an={key:4,ref:`shadowWrapper`,class:`card-transition-container`},on={key:0},__name(_sfc_render$15,`_sfc_render`),sn=F$3(Qt,[[`render`,_sfc_render$15],[`__scopeId`,`data-v-de7119e9`]]),cn=defineComponent({name:`MultipleChoiceOption`,components:{MarkdownRenderer:defineAsyncComponent(()=>Promise.resolve().then(()=>(init_MarkdownRenderer_DoVbFpA6(),MarkdownRenderer_DoVbFpA6_exports)).then(t=>t.n))},props:{content:{type:String,required:!0},selected:{type:Boolean,required:!0},number:{type:Number,required:!0},setSelection:{type:Function,required:!0},submit:{type:Function,required:!0},markedWrong:{type:Boolean,required:!0}},computed:{className(){let t;switch(this.number){case 0:t=`bg-red`;break;case 1:t=`bg-purple`;break;case 2:t=`bg-indigo`;break;case 3:t=`bg-light-blue`;break;case 4:t=`bg-teal`;break;case 5:t=`bg-deep-orange`;break;default:t=`bg-grey`;break}if(this.selected&&!this.markedWrong)return`choice selected ${t} lighten-3 elevation-8`;if(!this.selected&&!this.markedWrong)return`choice not-selected ${t} lighten-4 elevation-1`;if(this.selected&&this.markedWrong)return`choice selected grey lighten-2 elevation-8`;if(!this.selected&&this.markedWrong)return`choice not-selected grey lighten-2 elevation-0`;throw Error(`'selected' and 'markedWrong' props in MultipleChoiceOption are in an impossible configuration.`)}},methods:{select(){this.setSelection(this.number)},submitThisOption(){this.markedWrong||(this.select(),this.submit())}}}),__name(_sfc_render$14,`_sfc_render`),ln=F$3(cn,[[`render`,_sfc_render$14],[`__scopeId`,`data-v-96de7172`]]),un=defineComponent({name:`RadioMultipleChoice`,components:{MultipleChoiceOption:ln},extends:se$3,props:{choiceList:{type:Array,required:!0}},data(){return{currentSelection:-1,incorrectSelections:[],containerRef:null,_registeredHotkeys:[]}},watch:{choiceList:{immediate:!0,handler(t){t?.length&&this.bindKeys()}}},mounted(){this.containerRef&&this.containerRef.focus()},unmounted(){this.unbindKeys()},methods:{forwardSelection(){if(!this.choiceIsWrong(this.choiceList[this.currentSelection])&&this.currentSelection!==-1){let t={choiceList:this.choiceList,selection:this.currentSelection};this.submitAnswer(t).isCorrect||this.incorrectSelections.push(this.currentSelection)}},setSelection(t){t<this.choiceList.length&&(this.currentSelection=t)},incrementSelection(){this.currentSelection===-1?this.currentSelection=Math.ceil(this.choiceList.length/2):this.currentSelection=Math.min(this.choiceList.length-1,this.currentSelection+1)},decrementSelection(){this.currentSelection===-1?this.currentSelection=Math.floor(this.choiceList.length/2-1):this.currentSelection=Math.max(0,this.currentSelection-1)},choiceIsWrong(t){let c=!1;return this.incorrectSelections.forEach(u=>{this.choiceList[u]===t&&(c=!0)}),c},bindKeys(){let t=[{hotkey:`left`,callback:this.decrementSelection,command:`Move selection left`},{hotkey:`right`,callback:this.incrementSelection,command:`Move selection right`},{hotkey:`enter`,callback:this.forwardSelection,command:`Submit selection`},...Array.from({length:this.choiceList.length},(t,c)=>({hotkey:(c+1).toString(),callback:()=>this.setSelection(c),command:`Select ${(t=>{switch(t){case 0:return`first`;case 1:return`second`;case 2:return`third`;case 3:return`fourth`;case 4:return`fifth`;case 5:return`sixth`;default:return`${t+1}th`}})(c)} option`}))];I$2.addBinding(t),this._registeredHotkeys=t.map(t=>t.hotkey)},unbindKeys(){this._registeredHotkeys&&this._registeredHotkeys.forEach(t=>{I$2.removeBinding(t)})}}}),dn={ref:`containerRef`,class:`multipleChoice`},__name(_sfc_render$13,`_sfc_render`),fn=F$3(un,[[`render`,_sfc_render$13]]),pn=defineComponent({name:`TrueFalse`,components:{RadioMultipleChoice:fn},props:{MouseTrap:{type:Object,required:!0},submit:{type:Function,required:!0}}}),mn={"data-viewable":`TrueFalse`},__name(_sfc_render$12,`_sfc_render`),hn=F$3(pn,[[`render`,_sfc_render$12]]),gn=defineComponent({name:`UserInputNumber`,ref:{},extends:se$3,methods:{mounted(){this.$refs.input.focus()},isNumeric(t){return!isNaN(Number.parseFloat(t))},makeNumeric(t){if(typeof t==`string`)return Number.parseFloat(t);throw Error(`Expected a string, got `+typeof t)}}}),__name(_sfc_render$11,`_sfc_render`),_n=F$3(gn,[[`render`,_sfc_render$11],[`__scopeId`,`data-v-a56dcd1c`]]),vn=defineComponent({name:`CardLoader`,components:{CardViewer:Q$1},props:{sessionOrder:{type:Number,required:!1,default:0},qualified_id:{type:Object,required:!0},viewLookup:{type:Function,required:!0}},data(){return{loading:!0,view:null,data:[],courseID:``,cardID:``}},created(){this.loadCard()},watch:{qualified_id:{immediate:!0,handler(){this.loadCard()}}},methods:{processResponse(t){log$2(`
483
484
  Card was displayed at ${t.timeStamp}
484
485
  User spent ${t.timeSpent} milliseconds with the card.
485
486
  `),this.$emit(`emitResponse`,t)},async loadCard(){let t=this.qualified_id;console.log(`Card Loader displaying: ${t.courseID}::${t.cardID}`),this.loading=!0;let c=t.courseID,u=t.cardID,d=getDataLayer().getCourseDB(c);try{let t=await d.getCourseDoc(u),m=this.viewLookup(t.id_view),g=t.id_displayable_data.map(t=>d.getCourseDoc(t,{attachments:!0,binary:!0})),b=[];for(let t of g){let c=await t;b.unshift(displayableDataToViewData(c))}this.data=b,this.view=markRaw(m),this.cardID=u,this.courseID=c}catch(t){throw Error(`[CardLoader] Error loading card: ${JSON.stringify(t)}, ${t}`)}finally{this.loading=!1,this.$emit(`card-loaded`)}}}}),__name(_sfc_render$10,`_sfc_render`),yn=F$3(vn,[[`render`,_sfc_render$10],[`__scopeId`,`data-v-93f758b5`]]),useAuthStore=()=>{let t=getPinia();return t&&setActivePinia(t),defineStore(`auth`,{state:()=>({_user:void 0,loginAndRegistration:{init:!1,loggedIn:!1,regDialogOpen:!1,loginDialogOpen:!1},onLoadComplete:!1}),actions:{async init(){try{this._user=getDataLayer().getUserDB(),this.loginAndRegistration.loggedIn=this._user?this._user.isLoggedIn():!1,this.onLoadComplete=!0,this.loginAndRegistration.init=!0}catch(t){console.error(`Failed to initialize auth store:`,t),this.loginAndRegistration.loggedIn=!1,this.onLoadComplete=!0,this.loginAndRegistration.init=!0}},setLoginDialog(t){this.loginAndRegistration.loginDialogOpen=t},setRegDialog(t){this.loginAndRegistration.regDialogOpen=t},async resetUserData(){try{if(!this._user)throw Error(`No user available for data reset`);let t=await this._user.resetUserData();if(t.status!==`ok`)throw Error(t.error||`Reset failed`);return console.log(`User data reset successfully`),t}catch(t){throw console.error(`Failed to reset user data:`,t),t}}},getters:{currentUser:async()=>getCurrentUser(),isLoggedIn:t=>t.loginAndRegistration.loggedIn,isInitialized:t=>t.loginAndRegistration.init,status:t=>({loggedIn:t.loginAndRegistration.loggedIn,init:t.loginAndRegistration.init,user:t._user})}})()},useConfigStore=()=>{let t=getPinia();return t&&setActivePinia(t),defineStore(`config`,{state:()=>({config:{darkMode:!1,likesConfetti:!1,sessionTimeLimit:5}}),actions:{updateConfig(t){this.config=t},async updateDarkMode(t){this.config.darkMode=t;let c=await getCurrentUser();c&&await c.setConfig({darkMode:t})},async updateLikesConfetti(t){this.config.likesConfetti=t;let c=await getCurrentUser();c&&await c.setConfig({likesConfetti:t})},async updateSessionTimeLimit(t){this.config.sessionTimeLimit=t;let c=await getCurrentUser();c&&await c.setConfig({sessionTimeLimit:t})},async hydrate(){try{let t=await getCurrentUser();if(t){let c=await t.getConfig();console.log(`user config: ${JSON.stringify(c)}`),this.updateConfig(c)}else console.log(`No user logged in, using default config`)}catch(t){console.warn(`Failed to hydrate config store, using defaults:`,t)}},async init(){await this.hydrate()},resetDefaults(){this.config={darkMode:!1,likesConfetti:!1,sessionTimeLimit:5}}}})()},bn=F$3(defineComponent({__name:`UserChip`,props:{showLoginButton:{type:Boolean},redirectToPath:{}},setup(t){let c=useRouter(),u=useAuthStore(),d=useConfigStore(),m=useAuthUI(),g=ref(``),b=ref([]),S=ref(!1),C=ref(``),w=computed(()=>C.value===`reset`),resetDialogState=()=>{C.value=``,S.value=!1},T=computed(()=>b.value.length>0),E=computed(()=>m.config.value||{showLoginRegistration:!0,showLogout:!0,showResetData:!1,logoutLabel:`Log out`,resetLabel:``});onMounted(async()=>{g.value=(await getCurrentUser()).getUsername(),await m.detectSyncStrategy()});let gotoSettings=async()=>{c.push(`/u/${(await getCurrentUser()).getUsername()}`)},gotoStats=async()=>{c.push(`/u/${(await getCurrentUser()).getUsername()}/stats`)},dismiss=t=>{let c=b.value.indexOf(t);b.value.splice(c,1)},logout=async()=>{(await u._user.logout()).ok&&(u.loginAndRegistration={init:!0,loggedIn:!1,regDialogOpen:!1,loginDialogOpen:!1},d.resetDefaults(),c.push(`/home`))},executeReset=async()=>{try{await u.resetUserData(),d.resetDefaults(),resetDialogState(),c.push(`/home`)}catch(t){console.error(`Failed to reset user data:`,t)}};return(t,c)=>{let u=resolveComponent(`v-icon`),d=resolveComponent(`v-avatar`),m=resolveComponent(`v-chip`),D=resolveComponent(`v-list-item-title`),O=resolveComponent(`v-list-item`),Or=resolveComponent(`v-divider`),kr=resolveComponent(`v-list`),Ar=resolveComponent(`v-menu`),jr=resolveComponent(`v-badge`),Mr=resolveComponent(`v-card-title`),Nr=resolveComponent(`v-text-field`),Pr=resolveComponent(`v-card-text`),Fr=resolveComponent(`v-spacer`),Ir=resolveComponent(`v-btn`),Lr=resolveComponent(`v-card-actions`),Rr=resolveComponent(`v-card`),zr=resolveComponent(`v-dialog`);return openBlock(),createElementBlock(Fragment,null,[createVNode(jr,{content:b.value.length,"model-value":T.value,color:`accent`,location:`end top`},{default:withCtx(()=>[createVNode(Ar,{location:`bottom end`,transition:`scale-transition`},{activator:withCtx(({props:t})=>[createVNode(m,mergeProps(t,{class:`ma-2`}),{default:withCtx(()=>[createVNode(d,{start:``,class:`bg-primary`},{default:withCtx(()=>[createVNode(u,null,{default:withCtx(()=>c[4]||(c[4]=[createTextVNode(`mdi-school`)])),_:1})]),_:1}),createTextVNode(` `+toDisplayString(g.value),1)]),_:2},1040)]),default:withCtx(()=>[createVNode(kr,null,{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(b.value,t=>(openBlock(),createBlock(O,{key:t,onClick:c=>dismiss(t)},{default:withCtx(()=>[createVNode(D,null,{default:withCtx(()=>[createTextVNode(toDisplayString(t),1)]),_:2},1024)]),_:2},1032,[`onClick`]))),128)),b.value.length?(openBlock(),createBlock(Or,{key:0})):createCommentVNode(``,!0),createVNode(O,{onClick:gotoStats},{prepend:withCtx(()=>[createVNode(u,null,{default:withCtx(()=>c[5]||(c[5]=[createTextVNode(`mdi-trending-up`)])),_:1})]),default:withCtx(()=>[createVNode(D,null,{default:withCtx(()=>c[6]||(c[6]=[createTextVNode(`Stats`)])),_:1})]),_:1}),createVNode(O,{onClick:gotoSettings},{prepend:withCtx(()=>[createVNode(u,null,{default:withCtx(()=>c[7]||(c[7]=[createTextVNode(`mdi-cog`)])),_:1})]),default:withCtx(()=>[createVNode(D,null,{default:withCtx(()=>c[8]||(c[8]=[createTextVNode(`Settings`)])),_:1})]),_:1}),E.value.showLogout?(openBlock(),createBlock(O,{key:1,onClick:logout},{prepend:withCtx(()=>[createVNode(u,null,{default:withCtx(()=>c[9]||(c[9]=[createTextVNode(`mdi-logout`)])),_:1})]),default:withCtx(()=>[createVNode(D,null,{default:withCtx(()=>[createTextVNode(toDisplayString(E.value.logoutLabel),1)]),_:1})]),_:1})):createCommentVNode(``,!0),E.value.showResetData?(openBlock(),createBlock(O,{key:2,onClick:c[0]||(c[0]=t=>S.value=!0)},{prepend:withCtx(()=>[createVNode(u,null,{default:withCtx(()=>c[10]||(c[10]=[createTextVNode(`mdi-delete-sweep`)])),_:1})]),default:withCtx(()=>[createVNode(D,null,{default:withCtx(()=>[createTextVNode(toDisplayString(E.value.resetLabel),1)]),_:1})]),_:1})):createCommentVNode(``,!0)]),_:1})]),_:1})]),_:1},8,[`content`,`model-value`]),createVNode(zr,{modelValue:S.value,"onUpdate:modelValue":c[3]||(c[3]=t=>S.value=t),"max-width":`500px`,persistent:``},{default:withCtx(()=>[createVNode(Rr,null,{default:withCtx(()=>[createVNode(Mr,{class:`text-h5 d-flex align-center`},{default:withCtx(()=>[createVNode(u,{color:`warning`,class:`mr-3`},{default:withCtx(()=>c[11]||(c[11]=[createTextVNode(`mdi-alert-circle`)])),_:1}),c[12]||(c[12]=createTextVNode(` Reset All User Data `))]),_:1}),createVNode(Pr,null,{default:withCtx(()=>[c[13]||(c[13]=createBaseVNode(`p`,{class:`mb-4`},`This will permanently delete:`,-1)),c[14]||(c[14]=createBaseVNode(`ul`,{class:`mb-4`},[createBaseVNode(`li`,null,`All course progress and history`),createBaseVNode(`li`,null,`Scheduled card reviews`),createBaseVNode(`li`,null,`Course registrations`),createBaseVNode(`li`,null,`User preferences`)],-1)),c[15]||(c[15]=createBaseVNode(`p`,{class:`mb-4 text-error font-weight-bold`},`This cannot be undone.`,-1)),createVNode(Nr,{modelValue:C.value,"onUpdate:modelValue":c[1]||(c[1]=t=>C.value=t),label:`Type "reset" to confirm`,outlined:``,dense:``,onKeyup:c[2]||(c[2]=withKeys(t=>w.value&&executeReset(),[`enter`]))},null,8,[`modelValue`])]),_:1}),createVNode(Lr,null,{default:withCtx(()=>[createVNode(Fr),createVNode(Ir,{text:``,onClick:resetDialogState},{default:withCtx(()=>c[16]||(c[16]=[createTextVNode(`Cancel`)])),_:1}),createVNode(Ir,{color:`error`,disabled:!w.value,onClick:executeReset},{default:withCtx(()=>c[17]||(c[17]=[createTextVNode(` Reset All Data `)])),_:1},8,[`disabled`])]),_:1})]),_:1})]),_:1},8,[`modelValue`])],64)}}}),[[`__scopeId`,`data-v-9a38a213`]]),xn={class:`d-flex flex-column align-start`},Sn={class:`mb-2`},Cn=F$3(defineComponent({__name:`UserLogin`,props:{redirectTo:{default:`/study`}},emits:[`toggle`,`loginSuccess`,`forgotPassword`],setup(t,{emit:c}){let u=t,d=c,m=useRouter(),g=useRoute(),b=useAuthStore(),S=useConfigStore(),C=ref(``),w=ref(``),T=ref(!1),E=ref(!1),D=ref(!1),O=ref(7e3),Or=ref(void 0),kr=computed(()=>g.name===`login`),Ar=computed(()=>({color:D.value?`error`:`success`,text:D.value?`Try again`:`Log In`})),initBadLogin=()=>{D.value=!0,Z$2({text:`Username or password was incorrect.`,status:Status.error,timeout:O.value}),setTimeout(()=>{D.value=!1},O.value)},login=async()=>{E.value=!0,log$2(`Starting login attempt`),log$2(`Login attempt for username: ${C.value}`);try{log$2(`Attempting to get User instance`),Or.value=await getCurrentUser(),log$2(`Got User instance, attempting login`),await Or.value.login(C.value,w.value),log$2(`Login successful`),log$2(`Initializing user config`),S.init(),log$2(`User config initialized`),log$2(`Setting authentication state`),b.loginAndRegistration.loggedIn=!0,log$2(`Authentication state set, redirecting to: ${u.redirectTo}`),d(`loginSuccess`,u.redirectTo),m.push(u.redirectTo),log$2(`Login and redirect complete`)}catch(t){log$2(`Login attempt failed`),log$2(`Login error details: ${JSON.stringify(t)}`),console.log(`login error: ${JSON.stringify(t)}`),log$2(`Initiating bad login feedback`),initBadLogin()}log$2(`Resetting awaiting response state`),E.value=!1},toggle=()=>{log$2(`Toggling registration / login forms.`),d(`toggle`)},handleForgotPassword=()=>{log$2(`Forgot password clicked`),kr.value?m.push(`/request-reset`):d(`forgotPassword`)};return(t,c)=>{let u=resolveComponent(`v-card-title`),d=resolveComponent(`v-text-field`),m=resolveComponent(`v-btn`),g=resolveComponent(`v-snackbar`),b=resolveComponent(`v-icon`),S=resolveComponent(`router-link`),Or=resolveComponent(`v-form`),jr=resolveComponent(`v-card-text`),Mr=resolveComponent(`v-card`);return openBlock(),createBlock(Mr,null,{default:withCtx(()=>[kr.value?createCommentVNode(``,!0):(openBlock(),createBlock(u,{key:0,class:`text-h5 bg-grey-lighten-2`},{default:withCtx(()=>c[5]||(c[5]=[createTextVNode(`Log In`)])),_:1})),createVNode(jr,null,{default:withCtx(()=>[createVNode(Or,{onsubmit:`return false;`,onSubmit:withModifiers(login,[`prevent`])},{default:withCtx(()=>[createVNode(d,{id:``,modelValue:C.value,"onUpdate:modelValue":c[0]||(c[0]=t=>C.value=t),autofocus:``,name:`username`,label:`Username`,"prepend-icon":`mdi-account-circle`},null,8,[`modelValue`]),createVNode(d,{modelValue:w.value,"onUpdate:modelValue":c[1]||(c[1]=t=>w.value=t),"prepend-icon":`mdi-lock`,name:`password`,hover:`Show password input`,label:`Enter your password`,hint:``,min:`0`,"append-icon":T.value?`mdi-eye-off`:`mdi-eye`,type:T.value?`text`:`password`,"onClick:append":c[2]||(c[2]=()=>T.value=!T.value)},null,8,[`modelValue`,`append-icon`,`type`]),createVNode(g,{modelValue:D.value,"onUpdate:modelValue":c[4]||(c[4]=t=>D.value=t),location:`bottom right`,timeout:O.value},{default:withCtx(()=>[c[7]||(c[7]=createTextVNode(` Username or password was incorrect. `)),createVNode(m,{color:`pink`,variant:`text`,onClick:c[3]||(c[3]=t=>D.value=!1)},{default:withCtx(()=>c[6]||(c[6]=[createTextVNode(`Close`)])),_:1})]),_:1},8,[`modelValue`,`timeout`]),createBaseVNode(`div`,xn,[createBaseVNode(`div`,Sn,[createVNode(m,{class:`mr-2`,type:`submit`,loading:E.value,color:Ar.value.color},{default:withCtx(()=>[createVNode(b,{start:``},{default:withCtx(()=>c[8]||(c[8]=[createTextVNode(`mdi-lock-open`)])),_:1}),c[9]||(c[9]=createTextVNode(` Log In `))]),_:1},8,[`loading`,`color`]),kr.value?(openBlock(),createBlock(S,{key:0,to:`signup`},{default:withCtx(()=>[createVNode(m,{variant:`text`},{default:withCtx(()=>c[10]||(c[10]=[createTextVNode(`Create New Account`)])),_:1})]),_:1})):(openBlock(),createBlock(m,{key:1,variant:`text`,onClick:toggle},{default:withCtx(()=>c[11]||(c[11]=[createTextVNode(`Create New Account`)])),_:1}))]),renderSlot(t.$slots,`forgot-password`,{},()=>[createBaseVNode(`a`,{href:`#`,class:`text-caption text-decoration-none`,onClick:withModifiers(handleForgotPassword,[`prevent`])},` Forgot password? `)],!0)])]),_:3})]),_:3})]),_:3})}}}),[[`__scopeId`,`data-v-563b0048`]]),wn=defineComponent({name:`UserRegistration`,props:{onSignupSuccess:{type:Function,required:!1}},emits:[`toggle`,`signup-success`],data(){return{email:``,username:``,password:``,retypedPassword:``,passwordVisible:!1,emailError:!1,emailHint:``,usernameValidationInProgress:!1,usernameError:!1,usernameHint:``,awaitingResponse:!1,badLoginAttempt:!1,userSecret:``,secret:`goons`,user:null,roles:[`Student`,`Teacher`,`Author`],student:!0,teacher:!1,author:!1,authStore:useAuthStore()}},computed:{registrationRoute(){return typeof this.$route.name==`string`&&this.$route.name.toLowerCase()===`signup`},buttonStatus(){return{color:this.badLoginAttempt?`error`:`success`,text:this.badLoginAttempt?`Try again`:`Log In`}},passwordError(){return validatePassword(this.password)},passwordRetypeError(){return console.log(`[RTE]`),this.password===this.retypedPassword?``:`Passwords must match.`}},async created(){this.user=await getCurrentUser()},methods:{toggle(){log$2(`Toggling registration / login forms.`),this.$emit(`toggle`)},validateEmail(){this.emailError=!1,this.email&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(this.email)?(this.emailError=!0,this.emailHint=`Please enter a valid email address`):this.emailHint=``},validateUsername(){this.usernameError=!1},async createUser(){if(this.awaitingResponse=!0,this.passwordError){Z$2({text:this.passwordError,status:Status.error}),this.awaitingResponse=!1;return}if(log$2(`