{"version":3,"file":"CDq607O5.mjs","sources":["../../../../../../node_modules/txstate-utils/lib-esm/object/equal.js","../../../../../../node_modules/txstate-utils/lib-esm/object/omit.js","../../../../../../node_modules/txstate-utils/lib-esm/object/pick.js","../../../../../../node_modules/txstate-utils/lib-esm/array/toarray.js","../../../../../../node_modules/txstate-utils/lib-esm/stringify.js","../../../../../../node_modules/txstate-utils/lib-esm/async.js","../../../../../../node_modules/txstate-utils/lib-esm/queue.js","../../../../../../node_modules/txstate-utils/lib-esm/cache.js","../../../../../../node_modules/@txstate-mws/svelte-store/dist/activestore.js","../../../../../../node_modules/@txstate-mws/svelte-store/dist/store.js","../../../../../../node_modules/@txstate-mws/svelte-components/dist/stores/toasts.js","../../../../../../node_modules/@sveltejs/kit/src/exports/index.js","../../../../../../node_modules/@txstate-mws/sveltekit-utils/dist/unifiedauth.js","../../../../../../node_modules/@txstate-mws/sveltekit-utils/dist/api.js","../../../../../../src/lib/queries/college.ts","../../../../../../src/lib/queries/profile.ts","../../../../../../src/lib/queries/search.ts","../../../../../../src/lib/api.ts"],"sourcesContent":["export function equal(a, b, compared) {\n    if (a === b)\n        return true;\n    if (a && b && typeof a === 'object' && typeof b === 'object') {\n        if (a.constructor !== b.constructor)\n            return false;\n        compared ??= { a: new Set(), b: new Set() };\n        if (compared.a.has(a) && compared.b.has(b))\n            return true;\n        compared.a.add(a);\n        compared.b.add(b);\n        let length, i;\n        if (Array.isArray(a)) {\n            length = a.length;\n            if (length !== b.length)\n                return false;\n            for (i = length; i-- !== 0;) {\n                if (!equal(a[i], b[i], compared))\n                    return false;\n            }\n            return true;\n        }\n        if ((a instanceof Map) && (b instanceof Map)) {\n            if (a.size !== b.size)\n                return false;\n            for (i of a.entries()) {\n                if (!b.has(i[0]))\n                    return false;\n            }\n            for (i of a.entries()) {\n                if (!equal(i[1], b.get(i[0]), compared))\n                    return false;\n            }\n            return true;\n        }\n        if ((a instanceof Set) && (b instanceof Set)) {\n            if (a.size !== b.size)\n                return false;\n            for (i of a.entries()) {\n                if (!b.has(i[0]))\n                    return false;\n            }\n            return true;\n        }\n        if (typeof File !== 'undefined' && a instanceof File && b instanceof File) {\n            if (a.name !== b.name)\n                return false;\n            if (a.size !== b.size)\n                return false;\n            if (a.type !== b.type)\n                return false;\n            return true;\n        }\n        else if (typeof Blob !== 'undefined' && a instanceof Blob && b instanceof Blob) {\n            if (a.size !== b.size)\n                return false;\n            if (a.type !== b.type)\n                return false;\n            return true;\n        }\n        if (a.constructor === RegExp)\n            return a.source === b.source && a.flags === b.flags;\n        if (a.valueOf !== Object.prototype.valueOf)\n            return a.valueOf() === b.valueOf();\n        if (a.toString !== Object.prototype.toString)\n            return a.toString() === b.toString();\n        const keys = nonNullKeys(a);\n        length = keys.length;\n        const bkeys = nonNullKeys(b);\n        if (length !== bkeys.length)\n            return false;\n        for (i = length; i-- !== 0;) {\n            if (!Object.prototype.hasOwnProperty.call(b, keys[i]))\n                return false;\n        }\n        for (i = length; i-- !== 0;) {\n            const key = keys[i];\n            if (!equal(a[key], b[key], compared))\n                return false;\n        }\n        return true;\n    }\n    // true if both NaN, false otherwise\n    return a !== a && b !== b;\n}\nfunction nonNullKeys(a) {\n    const ret = [];\n    for (const k of Object.keys(a))\n        if (a[k] != null)\n            ret.push(k);\n    return ret;\n}\n","export function omit(obj, ...props) {\n    const ret = { ...obj };\n    for (const prop of props)\n        delete ret[prop];\n    return ret;\n}\n","export function pick(obj, ...props) {\n    const ret = {};\n    for (const prop of props)\n        if (obj[prop] != null)\n            ret[prop] = obj[prop];\n    return ret;\n}\n","export function toArray(val) {\n    val ??= [];\n    return Array.isArray(val) ? val : [val];\n}\n","/**\n * A stable stringify function that sorts object keys before stringifying\n * so that identical objects with different key ordering will stringify to identical\n * strings.\n *\n * If the object being stringified contains cycles, the deeper appearance\n * of the cycled object will be replaced with the string '__cycle__'\n */\nexport function stringify(data, replacer) {\n    if (typeof data === 'undefined')\n        return 'null';\n    const seen = [];\n    return (function stringify(node) {\n        if (typeof node?.toJSON === 'function') {\n            node = node.toJSON();\n        }\n        if (node === undefined)\n            return;\n        if (typeof node === 'number')\n            return isFinite(node) ? '' + node : 'null';\n        if (typeof node !== 'object')\n            return JSON.stringify(node, replacer);\n        let i, out;\n        if (Array.isArray(node)) {\n            out = '[';\n            for (i = 0; i < node.length; i++) {\n                if (i)\n                    out += ',';\n                out += stringify(node[i]) ?? 'null';\n            }\n            return out + ']';\n        }\n        if (node === null)\n            return 'null';\n        if (seen.includes(node)) {\n            return JSON.stringify('__cycle__');\n        }\n        const seenIndex = seen.push(node) - 1;\n        const keys = Object.keys(node).sort();\n        out = '';\n        for (i = 0; i < keys.length; i++) {\n            const key = keys[i];\n            const value = stringify(node[key]);\n            if (!value)\n                continue;\n            if (out)\n                out += ',';\n            out += JSON.stringify(key) + ':' + value;\n        }\n        seen.splice(seenIndex, 1);\n        return '{' + out + '}';\n    })(data);\n}\nexport function ensureString(data) {\n    return typeof data === 'string' ? data : stringify(data);\n}\n","/**\n * works like Array.filter but expects a Promise<boolean> from each element\n * instead of a synchronous boolean\n *\n * Uses Promise.all; if you need an in-flight limit, use filterConcurrent\n * instead\n */\nexport async function filterAsync(items, callback) {\n    const bools = await Promise.all(items.map(callback));\n    return items.filter((_, index) => bools[index]);\n}\n/**\n * works like Array.some but expects a Promise<boolean> from each element\n * instead of a synchronous boolean\n *\n * Uses Promise.all; if you need an in-flight limit, use someConcurrent\n * instead\n */\nexport async function someAsync(items, callback) {\n    const bools = await Promise.all(items.map(callback));\n    return items.some((_, index) => bools[index]);\n}\nexport async function rescue(promise, defaultValueOrOptions) {\n    if (typeof defaultValueOrOptions !== 'object' || (!('condition' in defaultValueOrOptions) && !('defaultValue' in defaultValueOrOptions))) {\n        defaultValueOrOptions = { defaultValue: defaultValueOrOptions };\n    }\n    try {\n        return await promise;\n    }\n    catch (e) {\n        if (!defaultValueOrOptions.condition || defaultValueOrOptions.condition(e)) {\n            await defaultValueOrOptions.logRescue?.(e);\n            return defaultValueOrOptions.defaultValue;\n        }\n        throw e;\n    }\n}\n","var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n    if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n    if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n    return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n    if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n    if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n    if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n    return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar _Queue_head, _Queue_tail, _Queue_size;\nclass Node {\n    constructor(value) {\n        this.value = value;\n    }\n}\nexport class Queue {\n    constructor() {\n        _Queue_head.set(this, void 0);\n        _Queue_tail.set(this, void 0);\n        _Queue_size.set(this, 0);\n    }\n    enqueue(value) {\n        var _a;\n        const node = new Node(value);\n        if (__classPrivateFieldGet(this, _Queue_head, \"f\")) {\n            __classPrivateFieldGet(this, _Queue_tail, \"f\").next = node;\n            __classPrivateFieldSet(this, _Queue_tail, node, \"f\");\n        }\n        else {\n            __classPrivateFieldSet(this, _Queue_head, node, \"f\");\n            __classPrivateFieldSet(this, _Queue_tail, node, \"f\");\n        }\n        __classPrivateFieldSet(this, _Queue_size, (_a = __classPrivateFieldGet(this, _Queue_size, \"f\"), _a++, _a), \"f\");\n    }\n    dequeue() {\n        var _a;\n        if (!__classPrivateFieldGet(this, _Queue_head, \"f\"))\n            return;\n        const current = __classPrivateFieldGet(this, _Queue_head, \"f\");\n        __classPrivateFieldSet(this, _Queue_head, __classPrivateFieldGet(this, _Queue_head, \"f\").next, \"f\");\n        __classPrivateFieldSet(this, _Queue_size, (_a = __classPrivateFieldGet(this, _Queue_size, \"f\"), _a--, _a), \"f\");\n        return current.value;\n    }\n    peek() {\n        return __classPrivateFieldGet(this, _Queue_head, \"f\")?.value;\n    }\n    clear() {\n        __classPrivateFieldSet(this, _Queue_head, undefined, \"f\");\n        __classPrivateFieldSet(this, _Queue_tail, undefined, \"f\");\n        __classPrivateFieldSet(this, _Queue_size, 0, \"f\");\n    }\n    get size() {\n        return __classPrivateFieldGet(this, _Queue_size, \"f\");\n    }\n    *[(_Queue_head = new WeakMap(), _Queue_tail = new WeakMap(), _Queue_size = new WeakMap(), Symbol.iterator)]() {\n        let current = __classPrivateFieldGet(this, _Queue_head, \"f\");\n        while (current) {\n            yield current.value;\n            current = current.next;\n        }\n    }\n}\n","import { Queue } from './queue.js';\nimport { ensureString } from './stringify.js';\nconst newerThan = (dt, seconds) => new Date().getTime() - dt.getTime() < (seconds * 1000);\nclass SimpleStorage {\n    constructor(maxAge) {\n        this.maxAge = maxAge;\n        this.storage = {};\n    }\n    get(keystr) {\n        return this.storage[keystr]?.data;\n    }\n    set(keystr, data) {\n        this.del(keystr);\n        const expires = new Date(new Date().getTime() + (this.maxAge * 1000));\n        const curr = { keystr, data, expires };\n        if (this.newest) {\n            this.newest.next = curr;\n            curr.prev = this.newest;\n        }\n        else {\n            this.oldest = curr;\n        }\n        this.newest = curr;\n        this.storage[keystr] = curr;\n        this.prune();\n    }\n    del(keystr) {\n        const curr = this.storage[keystr];\n        if (curr) {\n            // remove from linked list and repair list\n            if (curr.prev)\n                curr.prev.next = curr.next;\n            if (curr.next)\n                curr.next.prev = curr.prev;\n            // repair oldest/newest links\n            if (this.newest === curr)\n                this.newest = curr.prev;\n            if (this.oldest === curr)\n                this.oldest = curr.next;\n            // delete from map\n            delete this.storage[keystr];\n        }\n    }\n    clear() {\n        this.storage = {};\n        this.newest = undefined;\n        this.oldest = undefined;\n    }\n    prune() {\n        const now = new Date();\n        while (this.oldest && this.oldest.expires < now) {\n            this.del(this.oldest.keystr);\n        }\n    }\n}\nclass MemcacheWrapper {\n    constructor(client, maxAge) {\n        this.client = client;\n        this.maxAge = maxAge;\n    }\n    async get(keystr) {\n        return await new Promise((resolve, reject) => {\n            this.client.get(keystr, (err, data) => {\n                if (err)\n                    reject(err);\n                else\n                    resolve(data);\n            });\n        });\n    }\n    async set(keystr, data) {\n        await new Promise((resolve, reject) => {\n            this.client.set(keystr, data, this.maxAge, (err) => {\n                if (err)\n                    reject(err);\n                else\n                    resolve();\n            });\n        });\n    }\n    async del(keystr) {\n        await new Promise((resolve, reject) => {\n            this.client.del(keystr, (err) => {\n                if (err)\n                    reject(err);\n                else\n                    resolve();\n            });\n        });\n    }\n    async clear() {\n        await new Promise((resolve, reject) => {\n            this.client.flush((err) => {\n                if (err)\n                    reject(err);\n                else\n                    resolve();\n            });\n        });\n    }\n}\nclass MemcacheClientWrapper {\n    constructor(client, maxAge) {\n        this.client = client;\n        this.maxAge = maxAge;\n        this.client = client;\n        this.maxAge = maxAge;\n    }\n    async get(keystr) {\n        return await this.client.get(keystr);\n    }\n    async set(keystr, data) {\n        await this.client.set(keystr, data, { lifetime: this.maxAge });\n    }\n    async del(keystr) {\n        await this.client.delete(keystr);\n    }\n    async clear() {\n        await this.client.cmd('flush_all');\n    }\n}\nclass LRUWrapper {\n    constructor(lru, maxAge = 0) {\n        this.lru = lru;\n        this.maxAge = maxAge;\n        this.ttlQueue = new Queue();\n        this.lruDelete = this.lru.delete?.bind(this.lru) ?? this.lru.del.bind(this.lru);\n    }\n    get(keystr) {\n        return this.lru.get(keystr);\n    }\n    set(keystr, data) {\n        this.prune();\n        this.ttlQueue.enqueue({ fetched: data.fetched, key: keystr });\n        this.lru.set(keystr, data);\n    }\n    del(keystr) {\n        this.lruDelete(keystr);\n    }\n    clear() {\n        this.lru.clear();\n        this.ttlQueue.clear();\n    }\n    prune() {\n        if (this.ttlQueue.size) {\n            const expiredLimit = new Date(new Date().getTime() - (this.maxAge * 1000));\n            while (this.ttlQueue.peek()?.fetched != null && this.ttlQueue.peek().fetched < expiredLimit) {\n                const entry = this.ttlQueue.dequeue();\n                const lruEntry = this.lru.get(entry.key);\n                if (lruEntry != null && lruEntry.fetched < expiredLimit)\n                    this.lruDelete(entry.key);\n            }\n        }\n    }\n}\nexport class Cache {\n    constructor(fetcher, options = {}) {\n        this.activeWork = new Map();\n        this.activeGets = new Map();\n        this.fetcher = fetcher;\n        const freshseconds = options.freshseconds ?? 5 * 60;\n        this.options = {\n            freshseconds,\n            staleseconds: (options.staleseconds ?? (freshseconds * 2)) || Infinity\n        };\n        const storageClass = options.storageClass ?? {};\n        if (storageClass.clear && storageClass.dump) {\n            // lru-cache instance\n            this.storage = new LRUWrapper(storageClass, this.options.staleseconds);\n        }\n        else if (storageClass.flush) {\n            // memcached client\n            this.storage = new MemcacheWrapper(storageClass, this.options.staleseconds);\n        }\n        else if (storageClass.cmd) {\n            // memcache-client client\n            this.storage = new MemcacheClientWrapper(storageClass, this.options.staleseconds);\n        }\n        else if (storageClass.get && storageClass.set && storageClass.del && storageClass.clear) {\n            // custom storage engine\n            this.storage = storageClass;\n        }\n        else {\n            this.storage = new SimpleStorage(this.options.staleseconds);\n        }\n        this.onRefresh = options.onRefresh;\n    }\n    async get(...params) {\n        const key = params[0];\n        const keystr = ensureString(key);\n        let stored;\n        if (!this.activeGets.has(keystr)) {\n            const storedMaybePromise = this.storage.get(keystr);\n            if (storedMaybePromise && 'then' in storedMaybePromise) {\n                this.activeGets.set(keystr, storedMaybePromise);\n                try {\n                    stored = await storedMaybePromise;\n                    // this line CANNOT be moved to a `finally` block\n                    // because that would do it in a later tick which would lead to other \"threads\"\n                    // sometimes getting old data\n                    this.activeGets.delete(keystr);\n                }\n                catch {\n                    this.activeGets.delete(keystr);\n                }\n            }\n            else {\n                stored = storedMaybePromise;\n            }\n        }\n        else {\n            stored = await this.activeGets.get(keystr);\n        }\n        if (stored) {\n            if (this.fresh(stored)) {\n                return stored.data;\n            }\n            else if (this.valid(stored)) {\n                // background task - do NOT await the refresh\n                this.refresh(...params).catch(error => {\n                    // since this is a background refresh, errors are invisible to\n                    // the cache client\n                    // client will receive errors normally on the first call or\n                    // after the stored value goes invalid\n                    console.error(error);\n                });\n                return stored.data;\n            }\n        }\n        return await this.refresh(...params);\n    }\n    async set(...params) {\n        const key = params.length > 1 ? params[0] : undefined;\n        const data = (params.length > 1 ? params[1] : params[0]);\n        const keystr = ensureString(key);\n        await this.storage.set(keystr, { fetched: new Date(), data });\n    }\n    async invalidate(key) {\n        if (!key) {\n            await this.storage.clear();\n            return;\n        }\n        const keystr = ensureString(key);\n        await this.storage.del(keystr);\n    }\n    async clear() {\n        await this.storage.clear();\n    }\n    async refresh(...params) {\n        const key = params[0];\n        const helper = params[1];\n        const keystr = ensureString(key);\n        if (this.activeWork.has(keystr))\n            return await this.activeWork.get(keystr);\n        this.activeWork.set(keystr, this.fetcher(key, helper));\n        try {\n            const data = await this.activeWork.get(keystr);\n            const refreshPromise = this.onRefresh?.(key, data);\n            if (refreshPromise)\n                refreshPromise.catch?.(e => { console.error(e); });\n            // @ts-expect-error OptionalArgBoth was a bit voodoo; it makes this impossible to generically type\n            await this.set(key, data);\n            return data;\n        }\n        finally {\n            this.activeWork.delete(keystr);\n        }\n    }\n    fresh(stored) {\n        return newerThan(stored.fetched, this.options.freshseconds);\n    }\n    valid(stored) {\n        return newerThan(stored.fetched, this.options.staleseconds);\n    }\n}\n","export function isUsable(value) {\n    return !!value && typeof value.subscribe === 'function';\n}\nexport function isWritable(value) {\n    return isUsable(value) && typeof value.update === 'function';\n}\nexport function isSettable(value) {\n    return isWritable(value) && typeof value.set === 'function';\n}\n/**\n * An alternative to svelte's \"writable\" that does not check equality before notifying\n * subscribers. A writable will notify subscribers after a shallow equality check, which\n * does not work with mutated states:\n * store.update(v => { v.someprop = 'newvalue'; return v })\n *\n * With a writable, this line would NOT notify subscribers because the state will be compared\n * against itself and always found to be equal.\n *\n * An alternative to this store type is SafeStore, which will do a deep equality check but\n * clone data so that it is safe against mutations. It costs more CPU cycles but results in\n * fewer notifications to subscribers which could be an overall win.\n */\nexport class ActiveStore {\n    constructor(value) {\n        this.cleanups = [];\n        this.sourceInits = [];\n        this.sourcesInitialized = 0;\n        this.subscribers = new Map();\n        this.value = this.clone(value);\n    }\n    // this is here to support SafeStore: the regular store makes this a null-op, but\n    // SafeStore overrides the implementation to a deep clone operation\n    clone(value) {\n        return value;\n    }\n    // always returns false so that subscribers are notified on every `set` or `update`.\n    // Subclasses can override this for shallow or deep equality checks.\n    equal(a, b) {\n        return false;\n    }\n    set(value) {\n        if (!this.equal(value, this.value)) {\n            this.value = this.clone(value);\n            for (const [id, run] of this.subscribers) {\n                run(value);\n            }\n        }\n    }\n    update(updater) {\n        // we have to send the user's updater function a cloned value, because they might mutate it\n        this.set(updater(this.clone(this.value)));\n    }\n    subscribe(run) {\n        // if we previously had no listeners, then we will have unsubscribed from our sources\n        // and we need to re-subscribe so our new listener will get updates\n        if (this.subscribers.size === 0)\n            this.subscribeToSources();\n        // generate a random id for this subscriber, it makes unsubscription O(1) instead of O(n)\n        let id;\n        do {\n            id = Math.random().toString(32);\n        } while (this.subscribers.has(id));\n        // register our new subscriber to receive updates\n        this.subscribers.set(id, run);\n        // immediately send the current value to our new subscriber\n        run(this.clone(this.value));\n        // return an unsubscribe function\n        return () => {\n            this.subscribers.delete(id);\n            // if we have no listeners, stop listening to our sources for updates\n            // this makes it possible for us to be properly garbage collected\n            if (this.subscribers.size === 0)\n                this.unsubscribeFromSources();\n        };\n    }\n    /**\n     * Provided as a last ditch avenue to clean up memory after rogue subscribers forget\n     * to unsubscribe themselves. For example, in an SSR environment one could clear out\n     * global stores anytime a request finishes and no other requests are being processed.\n     */\n    clearSubscribers() {\n        this.subscribers.clear();\n        this.unsubscribeFromSources();\n    }\n    /**\n     * Stores that subscribe to external events should set it up with a start/stop mentality\n     * so that the external events can be unsubscribed when the store itself has no listeners\n     * to notify. This helps ensure unused stores can be garbage collected.\n     *\n     * To do this, pass registerSource a function that initializes the subscription to the external\n     * event, and returns a function that can unsubscribe from the external event. This parent\n     * class will take care of running those functions at appropriate times.\n     */\n    registerSource(fn) {\n        if (this.subscribers.size)\n            this.cleanups.push(fn());\n        this.sourceInits.push(fn);\n    }\n    /**\n     * Provided in case a child class has a need to change out the external resources\n     */\n    unregisterSources() {\n        this.unsubscribeFromSources();\n        this.sourceInits = [];\n    }\n    subscribeToSources() {\n        this.sourcesInitialized = 0;\n        for (const fn of this.sourceInits) {\n            this.sourcesInitialized++;\n            this.cleanups.push(fn());\n        }\n    }\n    unsubscribeFromSources() {\n        for (const fn of this.cleanups)\n            fn();\n        this.cleanups = [];\n    }\n}\n","import { equal as deepEqual } from 'txstate-utils';\nimport { ActiveStore } from './activestore.js';\n/**\n * An alternative to svelte's \"writable\" that also checks deep equality (fast-deep-equal) before\n * notifying subscribers. A writable will notify subscribers after a shallow equality check, which\n * only works for scalars.\n *\n * Note that this strategy is weak against mutable state updates:\n * store.update(v => { v.someprop = 'newvalue'; return v })\n *\n * This line would NOT notify subscribers because the state will be compared against\n * itself and always found to be equal. If you are making updates in a mutable fashion,\n * use a SafeStore instead.\n */\nexport class Store extends ActiveStore {\n    equal(a, b) {\n        return deepEqual(a, b);\n    }\n}\n","import { Store } from '@txstate-mws/svelte-store';\nimport { randomid } from 'txstate-utils';\nexport class ToastStore extends Store {\n    add(msgOrToast, type, ttlMs) {\n        const toast = typeof msgOrToast === 'string'\n            ? {\n                message: msgOrToast,\n                type,\n                ttlMs\n            }\n            : msgOrToast;\n        const resolvedType = toast.type ?? 'error';\n        const id = randomid();\n        const stored = {\n            id,\n            stamp: new Date(),\n            title: toast.title,\n            message: toast.message,\n            type: resolvedType,\n            suspended: false,\n            ttlMs: toast.ttlMs ?? (['error', 'warning'].includes(resolvedType) ? 8000 : 5000)\n        };\n        this.update(v => [...v.filter(t => t.message !== stored.message || t.title !== stored.title), stored]);\n        setTimeout(() => { this.clean(); }, stored.ttlMs);\n    }\n    close(id) {\n        this.update(v => v.filter(t => t.id !== id));\n    }\n    suspend(id) {\n        this.update(v => v.map(t => t.id !== id ? t : { ...t, suspended: true }));\n    }\n    resume(id) {\n        this.update(v => v.map(t => t.id !== id ? t : { ...t, suspended: false }));\n        setTimeout(() => { this.clean(); }, 100);\n    }\n    clean() {\n        const now = new Date().getTime();\n        this.update(v => v.some(t => t.suspended) ? v : v.filter(t => now - t.stamp.getTime() <= t.ttlMs));\n    }\n}\nexport const toasts = new ToastStore([]);\n","/** @import { StandardSchemaV1 } from '@standard-schema/spec' */\n\nimport { HttpError, Redirect, ActionFailure, ValidationError } from './internal/index.js';\nimport { BROWSER, DEV } from 'esm-env';\nimport {\n\tadd_data_suffix,\n\tadd_resolution_suffix,\n\thas_data_suffix,\n\thas_resolution_suffix,\n\tstrip_data_suffix,\n\tstrip_resolution_suffix\n} from '../runtime/pathname.js';\nimport { text_encoder } from '../runtime/utils.js';\n\nexport { VERSION } from '../version.js';\n\n// TODO 3.0: remove these types as they are not used anymore (we can't remove them yet because that would be a breaking change)\n/**\n * @template {number} TNumber\n * @template {any[]} [TArray=[]]\n * @typedef {TNumber extends TArray['length'] ? TArray[number] : LessThan<TNumber, [...TArray, TArray['length']]>} LessThan\n */\n\n/**\n * @template {number} TStart\n * @template {number} TEnd\n * @typedef {Exclude<TEnd | LessThan<TEnd>, LessThan<TStart>>} NumericRange\n */\n\n// Keep the status codes as `number` because restricting to certain numbers makes it unnecessarily hard to use compared to the benefits\n// (we have runtime errors already to check for invalid codes). Also see https://github.com/sveltejs/kit/issues/11780\n\n// we have to repeat the JSDoc because the display for function overloads is broken\n// see https://github.com/microsoft/TypeScript/issues/55056\n\n/**\n * Throws an error with a HTTP status code and an optional message.\n * When called during request handling, this will cause SvelteKit to\n * return an error response without invoking `handleError`.\n * Make sure you're not catching the thrown error, which would prevent SvelteKit from handling it.\n * @param {number} status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses). Must be in the range 400-599.\n * @param {App.Error} body An object that conforms to the App.Error type. If a string is passed, it will be used as the message property.\n * @overload\n * @param {number} status\n * @param {App.Error} body\n * @return {never}\n * @throws {HttpError} This error instructs SvelteKit to initiate HTTP error handling.\n * @throws {Error} If the provided status is invalid (not between 400 and 599).\n */\n/**\n * Throws an error with a HTTP status code and an optional message.\n * When called during request handling, this will cause SvelteKit to\n * return an error response without invoking `handleError`.\n * Make sure you're not catching the thrown error, which would prevent SvelteKit from handling it.\n * @param {number} status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses). Must be in the range 400-599.\n * @param {{ message: string } extends App.Error ? App.Error | string | undefined : never} [body] An object that conforms to the App.Error type. If a string is passed, it will be used as the message property.\n * @overload\n * @param {number} status\n * @param {{ message: string } extends App.Error ? App.Error | string | undefined : never} [body]\n * @return {never}\n * @throws {HttpError} This error instructs SvelteKit to initiate HTTP error handling.\n * @throws {Error} If the provided status is invalid (not between 400 and 599).\n */\n/**\n * Throws an error with a HTTP status code and an optional message.\n * When called during request handling, this will cause SvelteKit to\n * return an error response without invoking `handleError`.\n * Make sure you're not catching the thrown error, which would prevent SvelteKit from handling it.\n * @param {number} status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses). Must be in the range 400-599.\n * @param {{ message: string } extends App.Error ? App.Error | string | undefined : never} body An object that conforms to the App.Error type. If a string is passed, it will be used as the message property.\n * @return {never}\n * @throws {HttpError} This error instructs SvelteKit to initiate HTTP error handling.\n * @throws {Error} If the provided status is invalid (not between 400 and 599).\n */\nexport function error(status, body) {\n\tif ((!BROWSER || DEV) && (isNaN(status) || status < 400 || status > 599)) {\n\t\tthrow new Error(`HTTP error status codes must be between 400 and 599 — ${status} is invalid`);\n\t}\n\n\tthrow new HttpError(status, body);\n}\n\n/**\n * Checks whether this is an error thrown by {@link error}.\n * @template {number} T\n * @param {unknown} e\n * @param {T} [status] The status to filter for.\n * @return {e is (HttpError & { status: T extends undefined ? never : T })}\n */\nexport function isHttpError(e, status) {\n\tif (!(e instanceof HttpError)) return false;\n\treturn !status || e.status === status;\n}\n\n/**\n * Redirect a request. When called during request handling, SvelteKit will return a redirect response.\n * Make sure you're not catching the thrown redirect, which would prevent SvelteKit from handling it.\n *\n * Most common status codes:\n *  * `303 See Other`: redirect as a GET request (often used after a form POST request)\n *  * `307 Temporary Redirect`: redirect will keep the request method\n *  * `308 Permanent Redirect`: redirect will keep the request method, SEO will be transferred to the new page\n *\n * [See all redirect status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#redirection_messages)\n *\n * @param {300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | ({} & number)} status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#redirection_messages). Must be in the range 300-308.\n * @param {string | URL} location The location to redirect to.\n * @throws {Redirect} This error instructs SvelteKit to redirect to the specified location.\n * @throws {Error} If the provided status is invalid or the location cannot be used as a header value.\n * @return {never}\n */\nexport function redirect(status, location) {\n\tif ((!BROWSER || DEV) && (isNaN(status) || status < 300 || status > 308)) {\n\t\tthrow new Error('Invalid status code');\n\t}\n\n\tthrow new Redirect(\n\t\t// @ts-ignore\n\t\tstatus,\n\t\tlocation.toString()\n\t);\n}\n\n/**\n * Checks whether this is a redirect thrown by {@link redirect}.\n * @param {unknown} e The object to check.\n * @return {e is Redirect}\n */\nexport function isRedirect(e) {\n\treturn e instanceof Redirect;\n}\n\n/**\n * Create a JSON `Response` object from the supplied data.\n * @param {any} data The value that will be serialized as JSON.\n * @param {ResponseInit} [init] Options such as `status` and `headers` that will be added to the response. `Content-Type: application/json` and `Content-Length` headers will be added automatically.\n */\nexport function json(data, init) {\n\t// TODO deprecate this in favour of `Response.json` when it's\n\t// more widely supported\n\tconst body = JSON.stringify(data);\n\n\t// we can't just do `text(JSON.stringify(data), init)` because\n\t// it will set a default `content-type` header. duplicated code\n\t// means less duplicated work\n\tconst headers = new Headers(init?.headers);\n\tif (!headers.has('content-length')) {\n\t\theaders.set('content-length', text_encoder.encode(body).byteLength.toString());\n\t}\n\n\tif (!headers.has('content-type')) {\n\t\theaders.set('content-type', 'application/json');\n\t}\n\n\treturn new Response(body, {\n\t\t...init,\n\t\theaders\n\t});\n}\n\n/**\n * Create a `Response` object from the supplied body.\n * @param {string} body The value that will be used as-is.\n * @param {ResponseInit} [init] Options such as `status` and `headers` that will be added to the response. A `Content-Length` header will be added automatically.\n */\nexport function text(body, init) {\n\tconst headers = new Headers(init?.headers);\n\tif (!headers.has('content-length')) {\n\t\tconst encoded = text_encoder.encode(body);\n\t\theaders.set('content-length', encoded.byteLength.toString());\n\t\treturn new Response(encoded, {\n\t\t\t...init,\n\t\t\theaders\n\t\t});\n\t}\n\n\treturn new Response(body, {\n\t\t...init,\n\t\theaders\n\t});\n}\n\n/**\n * Create an `ActionFailure` object. Call when form submission fails.\n * @param {number} status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses). Must be in the range 400-599.\n * @overload\n * @param {number} status\n * @returns {import('./public.js').ActionFailure<undefined>}\n */\n/**\n * Create an `ActionFailure` object. Call when form submission fails.\n * @template [T=undefined]\n * @param {number} status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses). Must be in the range 400-599.\n * @param {T} data Data associated with the failure (e.g. validation errors)\n * @overload\n * @param {number} status\n * @param {T} data\n * @returns {import('./public.js').ActionFailure<T>}\n */\n/**\n * Create an `ActionFailure` object. Call when form submission fails.\n * @param {number} status\n * @param {any} [data]\n * @returns {import('./public.js').ActionFailure<any>}\n */\nexport function fail(status, data) {\n\t// @ts-expect-error unique symbol missing\n\treturn new ActionFailure(status, data);\n}\n\n/**\n * Checks whether this is an action failure thrown by {@link fail}.\n * @param {unknown} e The object to check.\n * @return {e is import('./public.js').ActionFailure}\n */\nexport function isActionFailure(e) {\n\treturn e instanceof ActionFailure;\n}\n\n/**\n * Use this to throw a validation error to imperatively fail form validation.\n * Can be used in combination with `issue` passed to form actions to create field-specific issues.\n *\n * @example\n * ```ts\n * import { invalid } from '@sveltejs/kit';\n * import { form } from '$app/server';\n * import { tryLogin } from '$lib/server/auth';\n * import * as v from 'valibot';\n *\n * export const login = form(\n *   v.object({ name: v.string(), _password: v.string() }),\n *   async ({ name, _password }) => {\n *     const success = tryLogin(name, _password);\n *     if (!success) {\n *       invalid('Incorrect username or password');\n *     }\n *\n *     // ...\n *   }\n * );\n * ```\n * @param  {...(StandardSchemaV1.Issue | string)} issues\n * @returns {never}\n * @since 2.47.3\n */\nexport function invalid(...issues) {\n\tthrow new ValidationError(\n\t\tissues.map((issue) => (typeof issue === 'string' ? { message: issue } : issue))\n\t);\n}\n\n/**\n * Checks whether this is an validation error thrown by {@link invalid}.\n * @param {unknown} e The object to check.\n * @return {e is import('./public.js').ActionFailure}\n * @since 2.47.3\n */\nexport function isValidationError(e) {\n\treturn e instanceof ValidationError;\n}\n\n/**\n * Strips possible SvelteKit-internal suffixes and trailing slashes from the URL pathname.\n * Returns the normalized URL as well as a method for adding the potential suffix back\n * based on a new pathname (possibly including search) or URL.\n * ```js\n * import { normalizeUrl } from '@sveltejs/kit';\n *\n * const { url, denormalize } = normalizeUrl('/blog/post/__data.json');\n * console.log(url.pathname); // /blog/post\n * console.log(denormalize('/blog/post/a')); // /blog/post/a/__data.json\n * ```\n * @param {URL | string} url\n * @returns {{ url: URL, wasNormalized: boolean, denormalize: (url?: string | URL) => URL }}\n * @since 2.18.0\n */\nexport function normalizeUrl(url) {\n\turl = new URL(url, 'a://a');\n\n\tconst is_route_resolution = has_resolution_suffix(url.pathname);\n\tconst is_data_request = has_data_suffix(url.pathname);\n\tconst has_trailing_slash = url.pathname !== '/' && url.pathname.endsWith('/');\n\n\tif (is_route_resolution) {\n\t\turl.pathname = strip_resolution_suffix(url.pathname);\n\t} else if (is_data_request) {\n\t\turl.pathname = strip_data_suffix(url.pathname);\n\t} else if (has_trailing_slash) {\n\t\turl.pathname = url.pathname.slice(0, -1);\n\t}\n\n\treturn {\n\t\turl,\n\t\twasNormalized: is_data_request || is_route_resolution || has_trailing_slash,\n\t\tdenormalize: (new_url = url) => {\n\t\t\tnew_url = new URL(new_url, url);\n\t\t\tif (is_route_resolution) {\n\t\t\t\tnew_url.pathname = add_resolution_suffix(new_url.pathname);\n\t\t\t} else if (is_data_request) {\n\t\t\t\tnew_url.pathname = add_data_suffix(new_url.pathname);\n\t\t\t} else if (has_trailing_slash && !new_url.pathname.endsWith('/')) {\n\t\t\t\tnew_url.pathname += '/';\n\t\t\t}\n\t\t\treturn new_url;\n\t\t}\n\t};\n}\n","import { redirect } from '@sveltejs/kit';\nimport { isBlank, Cache } from 'txstate-utils';\nimport { decodeJwt } from 'jose';\nimport { invalidateAll } from '$app/navigation';\nconst mayImpersonateAnyCache = new Cache(async (token, api) => {\n    const authUrl = new URL(api.authRedirect);\n    const mayImpersonateUrl = new URL('/mayImpersonate', authUrl.origin);\n    try {\n        const resp = await fetch(mayImpersonateUrl, {\n            method: 'POST',\n            headers: {\n                'Authorization': `Bearer ${token}`,\n                'Content-Type': 'application/json'\n            },\n            body: JSON.stringify({})\n        });\n        if (!resp.ok)\n            return false;\n        const { authorized } = await resp.json();\n        return !!authorized;\n    }\n    catch {\n        return false;\n    }\n});\nconst mayImpersonateNetidCache = new Cache(async ({ token, netid }, api) => {\n    const authUrl = new URL(api.authRedirect);\n    const mayImpersonateUrl = new URL('/mayImpersonate', authUrl.origin);\n    try {\n        const resp = await fetch(mayImpersonateUrl, {\n            method: 'POST',\n            headers: {\n                'Authorization': `Bearer ${token}`,\n                'Content-Type': 'application/json'\n            },\n            body: JSON.stringify({ netid })\n        });\n        if (!resp.ok)\n            return false;\n        const { authorized } = await resp.json();\n        return !!authorized;\n    }\n    catch {\n        return false;\n    }\n});\nexport const unifiedAuth = {\n    /**\n     * Your root +layout.ts' load function should call this method to ensure that it\n     * handles authentication from Unified Auth. By default it will redirect unauthenticated\n     * users to Unified Auth without a screen flash.\n     *\n     * If you set allowUnauthenticated: true and wait for the API to send a 401, there\n     * will often be a screen flash.\n     */\n    async handle(api, input, opts) {\n        const unifiedJwt = input.url.searchParams.get('unifiedJwt') ?? undefined;\n        await api.init(unifiedJwt);\n        if (unifiedJwt) {\n            let redirectUrl = input.url.searchParams.get('requestedUrl') ?? undefined;\n            if (!redirectUrl) {\n                const currentUrl = new URL(input.url);\n                currentUrl.searchParams.delete('unifiedJwt');\n                redirectUrl = currentUrl.toString();\n            }\n            throw redirect(302, redirectUrl);\n        }\n        window.addEventListener('pageshow', (event) => {\n            if (event.persisted && isBlank(sessionStorage.getItem('token'))) {\n                api.token = undefined;\n                invalidateAll();\n            }\n        });\n        if (!opts?.allowUnauthenticated)\n            this.requireAuth(api, input);\n    },\n    loginRedirect(api, currentUrl) {\n        const loginRedirect = new URL(api.authRedirect);\n        loginRedirect.searchParams.set('requestedUrl', currentUrl);\n        return loginRedirect;\n    },\n    logout(api) {\n        if (isBlank(api.token))\n            return;\n        // If impersonating, use the original token for logout\n        const originalToken = sessionStorage.getItem('originalToken');\n        const token = originalToken ?? api.token;\n        const authRedirect = new URL(api.authRedirect);\n        authRedirect.pathname = [...authRedirect.pathname.split('/').slice(0, -1), 'logout'].join('/');\n        authRedirect.searchParams.set('unifiedJwt', token);\n        api.token = undefined;\n        sessionStorage.removeItem('token');\n        sessionStorage.removeItem('originalToken');\n        location.href = authRedirect.toString();\n    },\n    requireAuth(api, input) {\n        if (!api.token) {\n            throw redirect(302, this.loginRedirect(api, input.url.toString()));\n        }\n    },\n    /**\n     * Start impersonating a user. This will store the current token and replace it with\n     * an impersonation token obtained from Unified Auth.\n     *\n     * The impersonation token will expire in 1 hour.\n     */\n    async impersonate(api, netid) {\n        if (isBlank(api.token))\n            throw new Error('Must be authenticated to impersonate.');\n        // Store original token before impersonating\n        const originalToken = api.token;\n        sessionStorage.setItem('originalToken', originalToken);\n        // Get impersonation token from unified-auth\n        const authUrl = new URL(api.authRedirect);\n        const impersonateUrl = new URL('/impersonate', authUrl.origin);\n        const resp = await fetch(impersonateUrl, {\n            method: 'POST',\n            headers: {\n                'Authorization': `Bearer ${originalToken}`,\n                'Content-Type': 'application/json'\n            },\n            body: JSON.stringify({ netid })\n        });\n        if (!resp.ok) {\n            const error = await resp.text();\n            throw new Error(`Failed to impersonate: ${error}`);\n        }\n        const { token } = await resp.json();\n        // Replace current token with impersonation token\n        api.token = token;\n        sessionStorage.setItem('token', token);\n    },\n    /**\n     * Exit impersonation and restore the original token.\n     */\n    exitImpersonation(api) {\n        const originalToken = sessionStorage.getItem('originalToken');\n        if (!originalToken) {\n            throw new Error('No original token found. Not currently impersonating.');\n        }\n        api.token = originalToken;\n        sessionStorage.setItem('token', originalToken);\n        sessionStorage.removeItem('originalToken');\n    },\n    /**\n     * Check if the current token is an impersonation token.\n     * Returns { isImpersonating: false } if not impersonating.\n     * Returns { isImpersonating: true, impersonatedUser: string, impersonatedBy: string } if impersonating.\n     */\n    getImpersonationStatus(api) {\n        if (isBlank(api.token))\n            return { isImpersonating: false };\n        try {\n            const payload = decodeJwt(api.token);\n            if (payload.act && payload.act.sub) {\n                return {\n                    isImpersonating: true,\n                    impersonatedUser: payload.sub,\n                    impersonatedBy: payload.act.sub\n                };\n            }\n        }\n        catch (e) {\n            // Invalid token, treat as not impersonating\n        }\n        return { isImpersonating: false };\n    },\n    /**\n     * Check if the current user is authorized to impersonate anyone.\n     * Results are cached to avoid repeated requests.\n     *\n     * @param api The API instance\n     * @returns A promise that resolves to true if authorized to impersonate, false otherwise\n     */\n    async mayImpersonateAny(api) {\n        if (isBlank(api.token))\n            return false;\n        return await mayImpersonateAnyCache.get(api.token, api);\n    },\n    /**\n     * Check if the current user is authorized to impersonate a specific user.\n     * Results are cached to avoid repeated requests.\n     *\n     * @param api The API instance\n     * @param netid The netid to check authorization for\n     * @returns A promise that resolves to true if authorized, false otherwise\n     */\n    async mayImpersonate(api, netid) {\n        if (isBlank(api.token))\n            return false;\n        return await mayImpersonateNetidCache.get({ token: api.token, netid }, api);\n    }\n};\n","import { toasts } from '@txstate-mws/svelte-components';\nimport { error } from '@sveltejs/kit';\nimport { get } from 'svelte/store';\nimport { isNotBlank, isNull, omit, pick, rescue, toArray } from 'txstate-utils';\nimport { page } from '$app/stores';\nimport { afterNavigate } from '$app/navigation';\nimport { unifiedAuth } from './unifiedauth.js';\n/**\n * Provided for convenience in case you are not using APIBase but still want to record navigations\n *\n * If you are using or extending APIBase, call `api.recordNavigations` instead.\n *\n * Must be called from a svelte component. Should usually be your root +layout.svelte.\n */\nexport function recordNavigations(callback) {\n    let timer = 0;\n    let from;\n    afterNavigate(navigation => {\n        // save off the navigation.from in case we're debouncing a redirect\n        if (timer === 0)\n            from = navigation.from;\n        clearTimeout(timer); // we are debouncing because sometimes afterNavigate gets called twice\n        timer = setTimeout(() => {\n            callback({ eventType: 'sveltekit-utils-navigation', screen: (from ?? navigation.to)?.route.id, target: navigation.to?.url.pathname, action: 'navigation', additionalProperties: { fullPageLoad: String(!from) } });\n            timer = 0;\n        }, 10);\n    });\n}\n/**\n * A non-mutating function that will replace all File objects in the variables with an APIUploadInfo\n * object, and put the original File object into the files array so it can be appended to the multipart\n * upload.\n *\n * When I say non-mutating, I mean it will not modify the original variables object. It will mutate the\n * files parameter, which should be passed an empty array.\n */\nfunction replaceFiles(variables, files) {\n    let newVariables;\n    for (const key in variables) {\n        const val = variables[key];\n        if (val instanceof File) {\n            files.push(val);\n            newVariables ??= Array.isArray(variables) ? [...variables] : { ...variables };\n            newVariables[key] = { _type: 'APIUploadInfo', multipartIndex: files.length - 1, name: val.name, mime: val.type, size: val.size };\n        }\n        else if (val instanceof Object) {\n            const newVal = replaceFiles(val, files);\n            if (newVal !== val) {\n                newVariables ??= Array.isArray(variables) ? [...variables] : { ...variables };\n                newVariables[key] = newVal;\n            }\n        }\n    }\n    return newVariables ?? variables;\n}\nexport class APIBase {\n    apiBase;\n    authRedirect;\n    loginRedirect;\n    token;\n    fetch;\n    ready;\n    readyPromise;\n    constructor(apiBase, authRedirect, loginRedirect = unifiedAuth.loginRedirect) {\n        this.apiBase = apiBase;\n        this.authRedirect = authRedirect;\n        this.loginRedirect = loginRedirect;\n        this.readyPromise = new Promise(resolve => { this.ready = resolve; });\n    }\n    async init(token, fetch) {\n        this.fetch = fetch ?? this.fetch;\n        if (token) {\n            this.token = token;\n            sessionStorage.setItem('token', token);\n        }\n        else {\n            this.token ??= sessionStorage.getItem('token') ?? undefined;\n        }\n        if (typeof document !== 'undefined') {\n            document.addEventListener(\"visibilitychange\", () => {\n                if (document.visibilityState === \"hidden\") {\n                    this.sendBatchedAnalytics().catch(console.error);\n                }\n            });\n        }\n        this.ready();\n    }\n    stringifyQuery(query) {\n        if (query == null)\n            return '';\n        if (typeof query === 'string')\n            return query.startsWith('?') ? query : '?' + query;\n        const p = new URLSearchParams();\n        for (const [key, val] of Object.entries(query)) {\n            for (const v of toArray(val))\n                p.append(key, String(v));\n        }\n        return '?' + p.toString();\n    }\n    async request(path, method, opts) {\n        await this.readyPromise;\n        try {\n            const resp = await this.fetch(this.apiBase + path + this.stringifyQuery(opts?.query), {\n                method,\n                keepalive: opts?.keepalive,\n                headers: {\n                    Authorization: `Bearer ${this.token ?? ''}`,\n                    Accept: 'application/json',\n                    ...(opts?.body ? { 'Content-Type': 'application/json' } : {})\n                },\n                body: opts?.body ? JSON.stringify(opts.body) : undefined\n            });\n            const contentType = resp.headers.get(\"content-type\");\n            const isJsonResponse = contentType && contentType.indexOf(\"application/json\") !== -1;\n            if (!resp.ok && !(resp.status === 422 && opts?.inlineValidation)) {\n                if (resp.status === 401) {\n                    location.href = this.loginRedirect(this, location.href).toString();\n                    throw error(401);\n                }\n                else {\n                    const body = (isJsonResponse ? (await rescue(resp.json())) : await rescue(resp.text())) ?? resp.statusText;\n                    let message = '';\n                    if (typeof body === 'string')\n                        message = body;\n                    else if (body.message)\n                        message = body.message;\n                    else if (body[0]?.message)\n                        message = body[0].message;\n                    throw error(resp.status, message);\n                }\n            }\n            return ((isJsonResponse) ? await resp.json() : await resp.text());\n        }\n        catch (e) {\n            toasts.add(e.body?.message ?? e.message);\n            throw e;\n        }\n    }\n    async uploadWithProgress(path, formData, progress) {\n        await this.readyPromise;\n        try {\n            return await new Promise((resolve, reject) => {\n                try {\n                    progress({ loaded: 0, total: 0, ratio: 0 });\n                    const request = new XMLHttpRequest();\n                    request.open('POST', this.apiBase + path);\n                    if (this.token)\n                        request.setRequestHeader('Authorization', `Bearer ${this.token}`);\n                    request.setRequestHeader('Accept', 'application/json');\n                    request.upload.addEventListener('progress', e => progress({ ...pick(e, 'loaded', 'total'), ratio: e.lengthComputable ? e.loaded / e.total : 0.1 }));\n                    // request finished\n                    request.addEventListener('load', e => {\n                        if (request.status >= 400)\n                            reject(new Error(request.responseText));\n                        else {\n                            try {\n                                resolve(JSON.parse(request.responseText));\n                            }\n                            catch (e) {\n                                reject(e);\n                            }\n                        }\n                    });\n                    request.addEventListener('abort', e => reject(new Error('Upload aborted.')));\n                    request.addEventListener('error', e => reject(new Error('An error occurred during transfer. Upload not completed.')));\n                    request.send(formData);\n                }\n                catch (e) {\n                    reject(e);\n                }\n            });\n        }\n        finally {\n            progress(undefined);\n        }\n    }\n    async get(path, query) {\n        return await this.request(path, 'GET', { query });\n    }\n    /**\n     * Remember to use validatedPost when the user is interacting with a form. That way they\n     * will get inline errors.\n     */\n    async post(path, body, query) {\n        return await this.request(path, 'POST', { body, query });\n    }\n    /**\n     * Remember to use validatedPut when the user is interacting with a form. That way they\n     * will get inline errors.\n     */\n    async put(path, body, query) {\n        return await this.request(path, 'PUT', { body, query });\n    }\n    /**\n     * Remember to use validatedPatch when the user is interacting with a form. That way they\n     * will get inline errors.\n     */\n    async patch(path, body, query) {\n        return await this.request(path, 'PATCH', { body, query });\n    }\n    /**\n     * Use this method when the user is interacting with a form. You should expect a ValidatedResponse,\n     * e.g. { success: false, messages: [{ type: 'error', message: 'That name is already taken.', path: 'name' }] }\n     */\n    async validatedPost(path, body, query) {\n        return await this.request(path, 'POST', { body, query, inlineValidation: true });\n    }\n    /**\n     * Use this method when the user is interacting with a form. You should expect a ValidatedResponse,\n     * e.g. { success: false, messages: [{ type: 'error', message: 'That name is already taken.', path: 'name' }] }\n     */\n    async validatedPut(path, body, query) {\n        return await this.request(path, 'PUT', { body, query, inlineValidation: true });\n    }\n    /**\n     * Use this method when the user is interacting with a form. You should expect a ValidatedResponse,\n     * e.g. { success: false, messages: [{ type: 'error', message: 'That name is already taken.', path: 'name' }] }\n     */\n    async validatedPatch(path, body, query) {\n        return await this.request(path, 'PATCH', { body, query, inlineValidation: true });\n    }\n    /**\n     * Sending a JSON body with an HTTP DELETE is not recommended\n     */\n    async delete(path, query, body) {\n        return await this.request(path, 'DELETE', { body, query });\n    }\n    async graphql(query, variables, querySignature) {\n        const gqlresponse = await this.request('/graphql', 'POST', { body: {\n                query,\n                variables,\n                extensions: {\n                    querySignature\n                }\n            } });\n        if (gqlresponse.errors?.length) {\n            toasts.add(gqlresponse.errors[0].message);\n            throw new Error(JSON.stringify(gqlresponse.errors));\n        }\n        return gqlresponse.data;\n    }\n    /**\n     * This is a special graphql request method that allows you to upload files. It will\n     * find all the File objects in the variables and replace them with an APIUploadInfo object.\n     *\n     * Then it will send a multipart/form-data request instead of a standard JSON body, and all\n     * the file data will be included in later parts.\n     */\n    async graphqlWithUploads(query, variables, options) {\n        const files = [];\n        variables = replaceFiles(variables, files);\n        // If we are only validating, we don't need to upload files\n        const omitUploads = options?.omitUploads != null ? options.omitUploads : !!variables.validateOnly;\n        if (omitUploads || !files.length)\n            return this.graphql(query, variables, options?.querySignature);\n        const form = new FormData();\n        form.set('body', JSON.stringify({\n            query,\n            variables,\n            extensions: {\n                querySignature: options?.querySignature\n            }\n        }));\n        for (let i = 0; i < files.length; i++)\n            form.set(`file${i}`, files[i]);\n        const gqlresponse = await this.uploadWithProgress('/graphql', form, options?.progress ?? (() => { }));\n        if (gqlresponse.errors?.length) {\n            toasts.add(gqlresponse.errors[0].message);\n            throw new Error(JSON.stringify(gqlresponse.errors));\n        }\n        return gqlresponse.data;\n    }\n    lastAnalyticsSent = new Date().getTime();\n    analyticsQueue = [];\n    analyticsTimer;\n    recordInteraction(evt) {\n        evt.screen ??= get(page).route.id;\n        this.analyticsQueue.push(evt);\n        clearTimeout(this.analyticsTimer);\n        // If the last analytics was sent more than 2 seconds ago, send immediately\n        if (new Date().getTime() - this.lastAnalyticsSent > 2000)\n            this.sendBatchedAnalytics().catch(console.error);\n        // Otherwise, collect more analytics for up to 2 seconds\n        else\n            this.analyticsTimer = setTimeout(() => this.sendBatchedAnalytics().catch(console.error), 2000);\n    }\n    async sendBatchedAnalytics() {\n        const events = [...this.analyticsQueue];\n        this.analyticsQueue.length = 0;\n        if (events.length) {\n            this.lastAnalyticsSent = new Date().getTime();\n            // keepalive true means the request will not be cancelled even if the user navigates away\n            await this.request('/analytics', 'POST', { body: events, keepalive: true });\n        }\n    }\n    /**\n     * Due to the mechanics of sveltekit, this function cannot be fully automatic and must\n     * be called in your global +layout.svelte\n     */\n    recordNavigations() {\n        recordNavigations(this.recordInteraction.bind(this));\n    }\n    /**\n     * This function is used to convert MutationMessageType[] that comes from our standard\n     * graphql servers into the Feedback[] type expected by svelte-forms.\n     *\n     * It will also remove a prefix from the arg property if you pass one in. This is useful\n     * because your graphql service should always be creating paths relative to the mutation's\n     * argument root, but the UI may not care how that's done.\n     *\n     * For example, consider the difference between `{ updateUser(id: ID!, name: String!, email: String!) {...} }`\n     * and `{ updateUser(id: ID!, user: UserInfo!) {...} }`. The first one should be sending back messages\n     * with `arg` like `name` or `email`, while the second one should be sending back messages with `arg`\n     * like `user.name` or `user.email` - because any user of the GraphQL API should expect that format after\n     * seeing the mutation signature.\n     *\n     * If your UI form for editing the user uses paths like `name` and `email`, you can pass `user` as the\n     * prefix to the second example and this function will remove it from the `arg` property when it creates\n     * the `path` property.\n     */\n    messageForDialog(messages, prefix) {\n        return messages.map(m => {\n            return { ...omit(m, 'arg'), path: isNull(m.arg) ? null : isNotBlank(prefix) ? m.arg.replace(RegExp('^' + prefix + '\\\\.'), '') : m.arg };\n        });\n    }\n    mutationForDialog(resp, { prefix, dataName } = {}) {\n        return { success: resp.success, messages: this.messageForDialog(resp.messages, prefix), data: (dataName ? resp[dataName] : undefined) };\n    }\n}\n","export interface College {\n  name: string\n  departments: Department[]\n}\n\nexport interface Department {\n  name: string\n}\n\nexport interface CollegeFilter {\n  names?: string[]\n}\n\nexport interface GetCollegesResponse {\n  colleges: College[]\n}\n\nexport const GET_COLLEGES = `\n    query GetColleges($filter: CollegeFilter) {\n      colleges(filter: $filter) {\n        name\n        departments {\n          name\n        }\n      }\n    }\n  `\n","export interface ContractGrant {\n  __typename: 'ContractGrant'\n  id: number\n  description?: string\n  time_range?: string\n  dateStarted?: {\n    year?: number\n    month?: number\n    day?: number\n  }\n  dateCompleted?: {\n    year?: number\n    month?: number\n    day?: number\n  }\n}\nexport interface IntellectualContribution {\n  __typename: 'IntellectualContribution'\n  id: number\n  description?: string\n  time_range?: string\n}\nexport interface CompositionArt {\n  __typename: 'CompositionArt'\n  id: number\n  description?: string\n  time_range?: string\n}\nexport interface ProductionArt {\n  __typename: 'ProductionArt'\n  id: number\n  description?: string\n  time_range?: string\n}\nexport interface CollectionArt {\n  __typename: 'CollectionArt'\n  id: number\n  description?: string\n  time_range?: string\n}\nexport interface ResidenciesArt {\n  __typename: 'ResidenciesArt'\n  id: number\n  description?: string\n  time_range?: string\n}\nexport interface ArtReview {\n  __typename: 'ArtReview'\n  id: number\n  description?: string\n  time_range?: string\n}\n\nexport interface Collaborator {\n  FNAME?: string\n  LNAME?: string\n}\n\nexport interface SimpleDate {\n  year?: number\n  month?: number\n  day?: number\n}\n\nexport interface IntellectualProperty {\n  __typename: 'IntellectualProperty'\n  id: number\n  description?: string\n  time_range?: string\n  FORMAT?: string\n  STATUS?: string\n  TITLE?: string\n  ID_NUMBER?: string\n  NATIONALITY?: string\n  TYPE?: string\n  dateApplication?: SimpleDate\n  dateApproved?: SimpleDate\n  dateRenewal?: SimpleDate\n  collaborators?: Collaborator[]\n}\n\nexport interface AwardHonor {\n  __typename: 'AwardHonor'\n  id: number\n  description?: string\n  time_range?: string\n  dateStarted?: {\n    year?: number\n    month?: number\n    day?: number\n  }\n  dateCompleted?: {\n    year?: number\n    month?: number\n    day?: number\n  }\n}\n\nexport interface ProfessionalService {\n  __typename: 'ProfessionalService'\n  id: number\n  description?: string\n  ROLE?: string\n  ORG?: string\n  time_range?: string\n  featured?: boolean\n  dateStarted?: {\n    year?: number\n    month?: number\n    day?: number\n  }\n  dateCompleted?: {\n    year?: number\n    month?: number\n    day?: number\n  }\n}\n\nexport interface InstitutionalService {\n  __typename: 'InstitutionalService'\n  id: number\n  description?: string\n  ROLE?: string\n  ORG?: string\n  time_range?: string\n  featured?: boolean\n  dateStarted?: {\n    year?: number\n    month?: number\n    day?: number\n  }\n  dateCompleted?: {\n    year?: number\n    month?: number\n    day?: number\n  }\n}\n\nexport interface PublicService {\n  __typename: 'PublicService'\n  id: number\n  description?: string\n  ROLE?: string\n  ORG?: string\n  time_range?: string\n  featured?: boolean\n  dateStarted?: {\n    year?: number\n    month?: number\n    day?: number\n  }\n  dateCompleted?: {\n    year?: number\n    month?: number\n    day?: number\n  }\n}\n\nexport type Activity = ContractGrant | IntellectualContribution | CompositionArt | ProductionArt | CollectionArt | ResidenciesArt | ArtReview | IntellectualProperty | AwardHonor | ProfessionalService | InstitutionalService | PublicService\n\nexport interface Education {\n  id: number\n  DEG?: string\n  SCHOOL?: string\n  MAJOR?: string\n  SUPPAREA?: string\n  DEGREE_TYPE?: string\n  DTY_COMP?: number\n}\n\nexport interface Faculty {\n  fullname: string\n  EMAIL?: string\n  WEBSITE?: string\n  LINK?: string\n  positions: Position[]\n  UPLOAD_VITA?: string\n  UPLOAD_PHOTO?: string\n  officePhone?: string\n  officeLocation?: OfficeLocation\n  profile?: ProfileSection\n  user_id: number\n  portrait?: Portrait\n  activities?: (Activity | null)[]\n  education?: Education[]\n}\n\nexport interface Position {\n  college?: string\n  department?: string\n  title?: string\n  academic?: boolean\n}\n\nexport interface OfficeLocation {\n  building?: string\n  room?: string\n}\n\nexport interface ProfileSection {\n  bio?: string\n  research?: string\n  teaching?: string\n}\n\nexport interface FaceInfo {\n  x: number\n  y: number\n  height: number\n  width: number\n  imgH: number\n  imgW: number\n}\n\nexport interface CropInfo {\n  detected: boolean\n  aspect: null | number\n  left: number\n  top: number\n  width: number\n}\n\nexport interface Portrait {\n  filename?: string\n  info?: FaceInfo\n  crop?: CropInfo\n  user_id?: number\n  version?: number\n}\n\n// Query for fetching scholarly/creative activities by faculty user ID\nexport const GET_FACULTY_SCHOLARLY_CREATIVE_ACTIVITIES = `\n  query GetFacultyScholarlyCreativeActivities($userId: Int!) {\n    activities(\n      filter: {\n        user_ids: [$userId],\n        doc_types: [\n          IntellectualContribution,\n          CompositionArt,\n          ProductionArt,\n          CollectionArt,\n          ResidenciesArt,\n          ArtReview\n        ]\n      }\n    ) {\n      ... on IntellectualContribution {\n        __typename\n        id\n        description\n        time_range\n      }\n      ... on CompositionArt {\n        __typename\n        id\n        description\n        time_range\n      }\n      ... on ProductionArt {\n        __typename\n        id\n        description\n        time_range\n      }\n      ... on CollectionArt {\n        __typename\n        id\n        description\n        time_range\n      }\n      ... on ResidenciesArt {\n        __typename\n        id\n        description\n        time_range\n      }\n      ... on ArtReview {\n        __typename\n        id\n        description\n        time_range\n      }\n    }\n  }\n`\n\n// Query for fetching activities by faculty user ID\nexport const GET_FACULTY_ACTIVITIES = `\n  query GetFacultyActivities($userId: Int!) {\n    activities(\n      filter: {\n        user_ids: [$userId],\n        doc_types: [\n          ContractGrant,\n          AwardHonor,\n          ProfessionalService,\n          InstitutionalService,\n          PublicService\n        ]\n      }\n    ) {\n      ... on ContractGrant {\n        __typename\n        id\n        description\n        time_range\n        dateStarted {\n          year\n          month\n          day\n        }\n        dateCompleted {\n          year\n          month\n          day\n        }\n      }\n      ... on AwardHonor {\n        __typename\n        id\n        description\n        time_range\n        dateStarted {\n          year\n          month\n          day\n        }\n        dateCompleted {\n          year\n          month\n          day\n        }\n      }\n      ... on ProfessionalService {\n        __typename\n        id\n        ROLE\n        ORG\n        time_range\n        description\n        featured\n        dateStarted {\n          year\n          month\n          day\n        }\n        dateCompleted {\n          year\n          month\n          day\n        }\n      }\n      ... on InstitutionalService {\n        __typename\n        id\n        ROLE\n        ORG\n        time_range\n        description\n        featured\n        dateStarted {\n          year\n          month\n          day\n        }\n        dateCompleted {\n          year\n          month\n          day\n        }\n      }\n      ... on PublicService {\n        __typename\n        id\n        ROLE\n        ORG\n        time_range\n        description\n        featured\n        dateStarted {\n          year\n          month\n          day\n        }\n        dateCompleted {\n          year\n          month\n          day\n        }\n      }\n    }\n  }\n`\n\n// Query for fetching awards by faculty user ID\nexport const GET_FACULTY_AWARDS = `\n  query GetFacultyAwards($userId: Int!) {\n    activities(\n      filter: {\n        user_ids: [$userId],\n        doc_types: [AwardHonor]\n      }\n    ) {\n      ... on AwardHonor {\n        __typename\n        id\n        description\n        time_range\n      }\n    }\n  }\n`\n\n// Query for fetching grants by faculty user ID\nexport const GET_FACULTY_GRANTS = `\n  query GetFacultyGrants($userId: Int!) {\n    activities(\n      filter: {\n        user_ids: [$userId],\n        doc_types: [ContractGrant]\n      }\n    ) {\n      ... on ContractGrant {\n        __typename\n        id\n        description\n        time_range\n      }\n    }\n  }\n`\n\n// Query for fetching scholarly/creative works by faculty user ID\nexport const GET_FACULTY_SCHOLARLY = `\n  query GetFacultyScholarly($userId: Int!) {\n    activities(\n      filter: {\n        user_ids: [$userId],\n        doc_types: [IntellectualContribution]\n      }\n    ) {\n      ... on IntellectualContribution {\n        __typename\n        id\n        description\n        time_range\n      }\n    }\n  }\n`\n\n// Query for fetching service activities by faculty user ID\nexport const GET_FACULTY_SERVICE = `\n  query GetFacultyService($userId: Int!) {\n    activities(\n      filter: {\n        user_ids: [$userId],\n        doc_types: [ProfessionalService, InstitutionalService, PublicService]\n      }\n    ) {\n      ... on ProfessionalService {\n        __typename\n        id\n        ROLE\n        ORG\n        time_range\n        description\n        featured\n        dateStarted {\n          year\n          month\n          day\n        }\n        dateCompleted {\n          year\n          month\n          day\n        }\n      }\n      ... on InstitutionalService {\n        __typename\n        id\n        ROLE\n        ORG\n        time_range\n        description\n        featured\n        dateStarted {\n          year\n          month\n          day\n        }\n        dateCompleted {\n          year\n          month\n          day\n        }\n      }\n      ... on PublicService {\n        __typename\n        id\n        ROLE\n        ORG\n        time_range\n        description\n        featured\n        dateStarted {\n          year\n          month\n          day\n        }\n        dateCompleted {\n          year\n          month\n          day\n        }\n      }\n    }\n  }\n`\n\n// Query for fetching intellectual property (copyrights/patents/trademarks) by faculty user ID\nexport const GET_FACULTY_INTELLECTUAL_PROPERTY = `\n  query GetFacultyIntellectualProperty($userId: Int!) {\n    activities(\n      filter: {\n        user_ids: [$userId],\n        doc_types: [IntellectualProperty]\n      }\n    ) {\n      ... on IntellectualProperty {\n        __typename\n        id\n        description\n        time_range\n        FORMAT\n        STATUS\n        TITLE\n        ID_NUMBER\n        NATIONALITY\n        TYPE\n        dateApplication {\n          year\n          month\n          day\n        }\n        dateApproved {\n          year\n          month\n          day\n        }\n        dateRenewal {\n          year\n          month\n          day\n        }\n        collaborators {\n          FNAME\n          LNAME\n        }\n      }\n    }\n  }\n`\n\n// Updated GraphQL query for fetching faculty profile by user id\nexport const GET_PERSON_BY_USER_ID = `\n  query GetPersonByUserId($userId: Int!) {\n    faculty(filter: { user_ids: [$userId] }) {\n      fullname\n      user_id\n      EMAIL\n      WEBSITE\n      LINK\n      positions {\n        college\n        department\n        title\n        academic\n      }\n      UPLOAD_VITA\n      UPLOAD_PHOTO\n      officePhone\n      officeLocation {\n        room\n        building\n      }\n      profile {\n        bio (filter: { html: true })\n        research (filter: { html: true })\n        teaching (filter: { html: true })\n      }\n      education {\n        id\n        DEG\n        SCHOOL\n        MAJOR\n        SUPPAREA\n        DEGREE_TYPE\n        DTY_COMP\n      }\n      portrait {\n        filename\n        info {\n          x\n          y\n          height\n          width\n          imgH\n          imgW\n        }\n        crop {\n          detected\n          aspect\n          left\n          top\n          width\n        }\n        user_id\n        version\n      }\n    }\n  }\n`\n","// Faculty result interface used for displaying faculty cards\nexport interface FacultyResult {\n  user_id: number\n  fullname: string\n  positions: {\n    department: string\n    title: string\n  }[]\n}\n\n// Common search parameters\nexport interface SearchParams {\n  departments?: string[]\n  colleges?: string[]\n  query?: string\n  page?: number\n  perPage?: number\n}\n\n// Faculty search specific parameters\nexport interface FacultySearchParams extends SearchParams {}\n\n// Activity search specific parameters\nexport interface ActivitySearchParams extends SearchParams {\n  docTypes?: string[]\n}\n\n// Profile search specific parameters\nexport interface ProfileSearchParams extends SearchParams {}\n\n// Response interfaces for various queries\nexport interface GetFacultySearchResponse {\n  faculty: FacultyResult[]\n  pageInfo?: {\n    faculty: {\n      totalItems: number\n      currentPage: number\n      perPage: number\n      hasNextPage: boolean\n    }\n  }\n}\n\nexport interface ActivityResult {\n  id: string\n  user_id: number\n  description: string\n  __typename?: string\n}\n\nexport interface GetActivitySearchResponse {\n  activities: ActivityResult[]\n  pageInfo?: {\n    activities: {\n      totalItems: number\n      currentPage: number\n      perPage: number\n      hasNextPage: boolean\n    }\n  }\n}\n\nexport interface ProfileResult {\n  id: string\n  user_id: number\n  bio?: string\n  research?: string\n  teaching?: string\n}\n\nexport interface GetProfileSearchResponse {\n  profiles: ProfileResult[]\n  pageInfo?: {\n    profiles: {\n      totalItems: number\n      currentPage: number\n      perPage: number\n      hasNextPage: boolean\n    }\n  }\n}\n\n// GraphQL queries\nexport const SEARCH_FACULTY = `\n  query SearchFaculty($filter: FacultyFilter, $paged: Pagination, $sortby: [FacultySortInstruction!]) {\n    faculty(filter: $filter, paged: $paged, sortby: $sortby) {\n      user_id\n      fullname\n      positions {\n        department\n        title\n      }\n    }\n    pageInfo {\n      faculty {\n        totalItems\n        currentPage\n        perPage\n        hasNextPage\n      }\n    }\n  }\n`\n\nexport const SEARCH_ACTIVITIES = `\n  query SearchActivities($filter: ActivityFilter, $paged: Pagination) {\n    activities(\n      filter: $filter,\n      paged: $paged,\n      sortby: [{ field: TIME_RANGE, descending: true }]\n    ) {\n      ... on IntellectualContribution {\n        id\n        user_id\n        description\n        __typename\n      }\n      ... on CompositionArt {\n        id\n        user_id\n        description\n        __typename\n      }\n      ... on ProductionArt {\n        id\n        user_id\n        description\n        __typename\n      }\n      ... on CollectionArt {\n        id\n        user_id\n        description\n        __typename\n      }\n      ... on ResidenciesArt {\n        id\n        user_id\n        description\n        __typename\n      }\n      ... on ArtReview {\n        id\n        user_id\n        description\n        __typename\n      }\n      ... on AwardHonor {\n        id\n        user_id\n        description\n        __typename\n      }\n      ... on IntellectualProperty {\n        id\n        user_id\n        description\n        __typename\n      }\n      ... on ContractGrant {\n        id\n        user_id\n        description\n        __typename\n      }\n      ... on ProfessionalService {\n        id\n        user_id\n        description\n        __typename\n      }\n      ... on InstitutionalService {\n        id\n        user_id\n        description\n        __typename\n      }\n      ... on PublicService {\n        id\n        user_id\n        description\n        __typename\n      }\n    }\n    pageInfo {\n      activities {\n        totalItems\n        currentPage\n        perPage\n        hasNextPage\n      }\n    }\n  }\n`\n\nexport const SEARCH_PROFILES = `\n  query SearchProfiles($filter: ProfileFilter, $paged: Pagination) {\n    profiles(\n      filter: $filter,\n      paged: $paged\n    ) {\n      id\n      user_id\n      bio\n      research\n      teaching\n    }\n    pageInfo {\n      profiles {\n        totalItems\n        currentPage\n        perPage\n        hasNextPage\n      }\n    }\n  }\n`\n\nexport const GET_FACULTY_BY_ID = `\n  query GetFacultyById($filter: FacultyFilter) {\n    faculty(filter: $filter) {\n      user_id\n      fullname\n      positions {\n        title\n        department\n      }\n    }\n  }\n`\n","import { env } from '$env/dynamic/public'\nimport { APIBase } from '@txstate-mws/sveltekit-utils'\nimport { browser } from '$app/environment'\nimport { GET_COLLEGES, type CollegeFilter, type GetCollegesResponse } from './queries/college'\nimport {\n  GET_PERSON_BY_USER_ID,\n  GET_FACULTY_ACTIVITIES,\n  GET_FACULTY_SCHOLARLY_CREATIVE_ACTIVITIES,\n  GET_FACULTY_INTELLECTUAL_PROPERTY,\n  type Faculty,\n  type Activity\n} from './queries/profile'\nimport {\n  SEARCH_FACULTY,\n  SEARCH_ACTIVITIES,\n  SEARCH_PROFILES,\n  GET_FACULTY_BY_ID,\n  type FacultySearchParams,\n  type ActivitySearchParams,\n  type ProfileSearchParams,\n  type GetFacultySearchResponse,\n  type GetActivitySearchResponse,\n  type GetProfileSearchResponse,\n  type FacultyResult\n} from './queries/search'\n\nclass API extends APIBase {\n  /**\n   * We are overriding this method from APIBase because we are running in SSR and APIBase wants\n   * to automatically use sessionStorage, which is not available in SSR.\n   */\n  async init () {\n    this.token = ''\n    this.ready()\n  }\n\n  async getColleges (filter?: CollegeFilter): Promise<GetCollegesResponse> {\n    return await this.graphql<GetCollegesResponse>(GET_COLLEGES, { filter })\n  }\n\n  async getPersonByUserId (userId: number): Promise<{ faculty: Faculty[] }> {\n    return await this.graphql<{ faculty: Faculty[] }>(GET_PERSON_BY_USER_ID, { userId })\n  }\n\n  async getFacultyActivities (userId: number): Promise<{ activities: (Activity | null)[] }> {\n    return await this.graphql<{ activities: (Activity | null)[] }>(GET_FACULTY_ACTIVITIES, { userId })\n  }\n\n  async getFacultyScholarlyCreativeActivities (userId: number): Promise<{ activities: (Activity | null)[] }> {\n    return await this.graphql<{ activities: (Activity | null)[] }>(GET_FACULTY_SCHOLARLY_CREATIVE_ACTIVITIES, { userId })\n  }\n\n  async getFacultyIntellectualProperty (userId: number): Promise<{ activities: (Activity | null)[] }> {\n    return await this.graphql<{ activities: (Activity | null)[] }>(GET_FACULTY_INTELLECTUAL_PROPERTY, { userId })\n  }\n\n  async searchFaculty (params: FacultySearchParams): Promise<GetFacultySearchResponse> {\n    const { page, perPage, query, departments, colleges, ...otherParams } = params\n\n    // Build filter object only if we have search criteria\n    const filter: Record<string, any> = {}\n\n    if (query) {\n      filter.names = query\n    }\n\n    if (departments?.length) {\n      filter.departments = departments\n    }\n\n    if (colleges?.length) {\n      filter.colleges = colleges\n    }\n\n    // Add any other parameters\n    Object.assign(filter, otherParams)\n\n    // Only pass filter if it has properties\n    const hasFilter = Object.keys(filter).length > 0\n\n    return await this.graphql<GetFacultySearchResponse>(SEARCH_FACULTY, {\n      ...(hasFilter && { filter }),\n      paged: {\n        page: Math.max(1, Number(page) || 1),\n        perPage: Math.max(1, Number(perPage) || 10)\n      },\n      sortby: [{ field: 'NAME', descending: false }]\n    })\n  }\n\n  async searchActivities (params: ActivitySearchParams): Promise<GetActivitySearchResponse> {\n    const { page, perPage, query, departments, colleges, docTypes, ...otherParams } = params\n\n    const filter: Record<string, any> = {\n      ...(query && { search: query }),\n      ...(departments?.length && { departments }),\n      ...(colleges?.length && { colleges }),\n      ...(docTypes?.length && { doc_types: docTypes }),\n      ...otherParams\n    }\n\n    return await this.graphql<GetActivitySearchResponse>(SEARCH_ACTIVITIES, {\n      ...(Object.keys(filter).length > 0 && { filter }),\n      paged: {\n        page: Math.max(1, Number(page) || 1),\n        perPage: Math.max(1, Number(perPage) || 10)\n      }\n    })\n  }\n\n  async searchProfiles (params: ProfileSearchParams): Promise<GetProfileSearchResponse> {\n    const { page, perPage, query, departments, colleges, ...otherParams } = params\n\n    const filter: Record<string, any> = {\n      ...(query && { search: query }),\n      ...(departments?.length && { departments }),\n      ...(colleges?.length && { colleges }),\n      ...otherParams\n    }\n\n    return await this.graphql<GetProfileSearchResponse>(SEARCH_PROFILES, {\n      ...(Object.keys(filter).length > 0 && { filter }),\n      paged: {\n        page: Math.max(1, Number(page) || 1),\n        perPage: Math.max(1, Number(perPage) || 10)\n      }\n    })\n  }\n\n  async getFacultyById (userId: number): Promise<{ faculty: FacultyResult[] }> {\n    return await this.graphql<{ faculty: FacultyResult[] }>(GET_FACULTY_BY_ID, {\n      filter: {\n        user_ids: [userId]\n      }\n    })\n  }\n\n  async getFacultyByIds (userIds: number[]): Promise<{ faculty: FacultyResult[] }> {\n    if (!userIds.length) return { faculty: [] }\n\n    return await this.graphql<{ faculty: FacultyResult[] }>(GET_FACULTY_BY_ID, {\n      filter: {\n        user_ids: userIds\n      }\n    })\n  }\n}\n\nexport const api = new API(\n  (browser ? env.PUBLIC_PROXY_API_BASE : env.PUBLIC_API_BASE) ?? env.PUBLIC_API_BASE,\n  'PUBLIC_AUTH_REDIRECT'\n)\n"],"names":["equal","a","b","compared","length","i","keys","nonNullKeys","bkeys","key","ret","k","omit","obj","props","prop","pick","toArray","val","stringify","data","replacer","seen","node","out","seenIndex","value","ensureString","rescue","promise","defaultValueOrOptions","e","_a","__classPrivateFieldGet","receiver","state","kind","f","__classPrivateFieldSet","_Queue_head","_Queue_tail","_Queue_size","Node","Queue","current","newerThan","dt","seconds","SimpleStorage","maxAge","keystr","expires","curr","now","MemcacheWrapper","client","resolve","reject","err","MemcacheClientWrapper","LRUWrapper","lru","expiredLimit","entry","lruEntry","Cache","fetcher","options","freshseconds","storageClass","params","stored","storedMaybePromise","error","helper","refreshPromise","_b","ActiveStore","id","run","updater","fn","Store","deepEqual","ToastStore","msgOrToast","type","ttlMs","toast","resolvedType","randomid","v","t","toasts","status","body","HttpError","token","api","authUrl","mayImpersonateUrl","resp","authorized","netid","unifiedAuth","currentUrl","loginRedirect","recordNavigations","callback","timer","from","afterNavigate","navigation","replaceFiles","variables","files","newVariables","newVal","APIBase","apiBase","authRedirect","__publicField","fetch","query","p","path","method","opts","contentType","isJsonResponse","message","formData","progress","request","querySignature","gqlresponse","form","evt","get","page","events","messages","prefix","m","isNull","isNotBlank","dataName","GET_COLLEGES","GET_FACULTY_SCHOLARLY_CREATIVE_ACTIVITIES","GET_FACULTY_ACTIVITIES","GET_FACULTY_INTELLECTUAL_PROPERTY","GET_PERSON_BY_USER_ID","SEARCH_FACULTY","SEARCH_ACTIVITIES","SEARCH_PROFILES","GET_FACULTY_BY_ID","API","filter","userId","perPage","departments","colleges","otherParams","hasFilter","docTypes","userIds","env"],"mappings":"gYAAO,SAASA,EAAMC,EAAGC,EAAGC,EAAU,CAClC,GA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