{"version":3,"sources":["../../src/decorators/RoomDecorator.ts","../../src/managers/NavigatorManager.ts","../../src/decorators/QuestDecorator.ts","../../src/managers/QuestManager.ts","../../src/decorators/CommitmentDecorator.ts","../../src/managers/RoutineManager.ts","../../src/constants.ts","../../src/managers/TimeManagerSettings.ts","../../src/managers/TimeManager.ts","../../src/managers/index.ts"],"names":["registeredRooms","getRoomById","id","room","CURRENT_ROOM_MEMORY_KEY","NavigatorManager","result","roomId","storage","_","registeredQuests","getQuestById","quest","QuestManager","props","registeredCommitments","fixedCommitments","getCommitmentById","commitment","TEMPORARY_COMMITMENT_CATEGORY_MEMORY_KEY","RoutineManager","commitments","c","commitmentsIds","currentCommitments","character_commitments","ch","navigator","character","TIME_DATA_KEY","TimeManagerSettings","TimeManager","settings","minDayHours","maxDayHours","defaultTimeSpent","timeSlots","weekLength","weekendStartDay","weekDaysNames","data","value","weekDayNumber","index","slot","timeSpent","newHour","newDayHour","days","newDay","fromHour","toHour","currentHour","timeTracker","routine","questsNotebook"],"mappings":"sCAEO,IAAMA,EAAmD,EAAC,CA2B1D,SAASC,CAAAA,CAAYC,CAAuC,CAAA,CAClE,GAAI,CACH,IAAIC,CAAOH,CAAAA,CAAAA,CAAgBE,CAAE,CAAA,CAC7B,GAAI,CAACC,CAAM,CAAA,CACV,QAAQ,KAAM,CAAA,CAAA,YAAA,EAAeD,CAAE,CAAA,UAAA,CAAY,CAC3C,CAAA,MACD,CACA,OAAOC,CACR,CAAS,MAAA,CAAA,CAAG,CACX,OAAA,CAAQ,KAAM,CAAA,CAAA,gCAAA,EAAmCD,CAAE,CAAA,CAAA,CAAI,CAAC,CACxD,CAAA,MACD,CACD,CCrCA,IAAME,CAAAA,CAA0B,gCACXC,CAAAA,CAAAA,CAArB,KAAsC,CAClC,IAAI,KAAQ,EAAA,CACR,OAAO,MAAA,CAAO,MAAOL,CAAAA,CAAe,CACxC,CACA,IAAI,SAAY,EAAA,CACZ,IAAIM,CAA8C,CAAA,EAClD,CAAA,OAA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MAAA,CAAS,CACnC,CAQA,aAAaE,CAAoB,CAAA,IAAA,CAAK,gBAA0B,CAAA,CAC5D,IAAIC,CAAAA,CAAU,IAAK,CAAA,WAAA,CAAcD,EACjC,OAAIC,CAAAA,EAAW,IAAK,CAAA,WAAA,GAChB,KAAK,WAAY,EAAA,CACjBA,CAAU,CAAA,IAAA,CAAK,aAAeA,CAAU,CAAA,IAAA,CAAK,WAEjD,CAAA,CAAA,CAAA,IAAA,CAAK,WAAcA,CAAAA,CAAAA,CACZ,IAAK,CAAA,WAChB,CAQA,WAAYC,CAAAA,CAAAA,CAAqB,IAAK,CAAA,WAAA,CAAaC,CAAe,CAAA,CAAA,CAAW,CACzE,IAAIC,EAAS,IAAK,CAAA,UAAA,CAAaD,CAC/B,CAAA,OAAA,IAAA,CAAK,UAAaC,CAAAA,CAAAA,CAClB,IAAK,CAAA,WAAA,CAAcF,EACZ,IAAK,CAAA,UAChB,CAQA,YAAA,CAAaG,EAA8BC,CAAqC,CAAA,CACxED,CAAa,GAAA,SAAA,GACbA,EAAW,IAAK,CAAA,WAAA,CAAc,CAE9BC,CAAAA,CAAAA,CAAAA,GAAW,SACXA,GAAAA,CAAAA,CAAS,IAAK,CAAA,WAAA,CAAc,GAEhC,IAAIC,CAAAA,CAAc,IAAK,CAAA,WAAA,CACvB,OAAIF,CAAAA,CAAWC,CACJC,CAAAA,CAAAA,EAAeF,GAAYE,CAAcD,CAAAA,CAAAA,CAE7CC,CAAeF,EAAAA,CAAAA,EAAYE,CAAcD,CAAAA,CACpD,CACJ,CAAA,KChMME,CAAc,CAAA,IAAItB,CAClBJ,CAAAA,CAAAA,CAAY,IAAItB,CAChBiD,CAAAA,CAAAA,CAAU,IAAIlC,CAAAA,CACdmC,EAAiB,IAAI1C","file":"index.mjs","sourcesContent":["import { RoomInterface } from \"../interface\";\n\nexport const registeredRooms: { [id: string]: RoomInterface } = {};\n\n/**\n * Save a room in the registered rooms. If the room already exists, it will be overwritten.\n * @param room The room to save.\n * @returns\n * @example\n * ```ts\n * saveRoom([mcRoom, aliceRoom, annRoom, bathroom, lounge, terrace, gymRoom]);\n * ```\n */\nexport function saveRoom(room: RoomInterface | RoomInterface[]) {\n\tif (Array.isArray(room)) {\n\t\troom.forEach((c) => saveRoom(c));\n\t\treturn;\n\t}\n\tif (registeredRooms[room.id]) {\n\t\tconsole.warn(`[NQTR] Room id ${room.id} already exists, it will be overwritten`);\n\t}\n\tregisteredRooms[room.id] = room;\n}\n\n/**\n * Get a room by its id.\n * @param id The id of the room.\n * @returns The room or undefined if not found.\n */\nexport function getRoomById(id: string): RoomInterface | undefined {\n\ttry {\n\t\tlet room = registeredRooms[id];\n\t\tif (!room) {\n\t\t\tconsole.error(`[NQTR] Room ${id} not found`);\n\t\t\treturn;\n\t\t}\n\t\treturn room;\n\t} catch (e) {\n\t\tconsole.error(`[NQTR] Error while getting Room ${id}`, e);\n\t\treturn;\n\t}\n}\n","import { storage } from \"@drincs/pixi-vn\";\nimport { getRoomById, registeredRooms } from \"../decorators/RoomDecorator\";\nimport { LocationInterface, MapInterface, RoomInterface } from \"../interface\";\n\nconst CURRENT_ROOM_MEMORY_KEY = \"___nqtr-current_room_memory___\";\nexport default class NavigatorManager {\n    get rooms() {\n        return Object.values(registeredRooms);\n    }\n    get locations() {\n        let result: { [id: string]: LocationInterface } = {};\n        Object.values(registeredRooms).forEach((room) => {\n            result[room.location.id] = room.location;\n        });\n        return Object.values(result);\n    }\n    get maps() {\n        let result: { [id: string]: MapInterface } = {};\n        Object.values(registeredRooms).forEach((room) => {\n            result[room.location.map.id] = room.location.map;\n        });\n        return Object.values(result);\n    }\n    get currentRoom(): RoomInterface | undefined {\n        let roomId = storage.getVariable<string>(CURRENT_ROOM_MEMORY_KEY);\n        if (!roomId) {\n            console.error(`[NQTR] The current room has not yet been set`);\n            return;\n        }\n        let room = getRoomById(roomId);\n        if (!room) {\n            console.error(`[NQTR] Current room ${roomId} not found`);\n            return;\n        }\n        return room;\n    }\n    set currentRoom(room: RoomInterface | string) {\n        if (typeof room !== \"string\") {\n            room = room.id;\n        }\n        let roomRegistrated = getRoomById(room);\n        if (!roomRegistrated) {\n            console.error(`[NQTR] The room ${room} is not registered, so it can't be set as current room`);\n            return;\n        }\n        storage.setVariable(CURRENT_ROOM_MEMORY_KEY, room);\n    }\n    get currentLocation(): LocationInterface | undefined {\n        return this.currentRoom?.location;\n    }\n    get currentMap(): MapInterface | undefined {\n        return this.currentRoom?.location.map;\n    }\n    /**\n     * Clear all the expired activities.\n     */\n    clearExpiredActivities() {\n        Object.entries(registeredRooms).forEach(([_, room]) => {\n            room.clearExpiredActivities();\n        });\n    }\n}\n","import { QuestInterface } from \"../interface\";\n\nexport const registeredQuests: { [id: string]: QuestInterface } = {};\n\n/**\n * Save a quest in the registered quests. If the quest already exists, it will be overwritten.\n * @param id The id of the quest, it must be unique\n * @param stages The stages of the quest\n * @param props The quest properties\n * @returns The created quest\n */\nexport function saveQuest(quest: QuestInterface | QuestInterface[]) {\n\tif (Array.isArray(quest)) {\n\t\tquest.forEach((c) => saveQuest(c));\n\t\treturn;\n\t}\n\tif (registeredQuests[quest.id]) {\n\t\tconsole.warn(`[NQTR] Quest id ${quest.id} already exists, it will be overwritten`);\n\t}\n\tregisteredQuests[quest.id] = quest;\n}\n\n/**\n * Get a quest by its id.\n * @param id The id of the quest.\n * @returns The quest or undefined if not found.\n */\nexport function getQuestById(id: string): QuestInterface | undefined {\n\ttry {\n\t\tlet quest = registeredQuests[id];\n\t\tif (!quest) {\n\t\t\tconsole.error(`[NQTR] Quest ${id} not found`);\n\t\t\treturn;\n\t\t}\n\t\treturn quest;\n\t} catch (e) {\n\t\tconsole.error(`[NQTR] Error while getting Quest ${id}`, e);\n\t\treturn;\n\t}\n}\n","import { OnRunProps } from \"@drincs/nqtr\";\nimport { getQuestById, registeredQuests } from \"../decorators/QuestDecorator\";\nimport { QuestInterface } from \"../interface\";\n\nexport default class QuestManager {\n    get quests(): QuestInterface[] {\n        return Object.values(registeredQuests);\n    }\n    get startedQuests(): QuestInterface[] {\n        return this.quests.filter((quest) => quest.started);\n    }\n    get completedQuests(): QuestInterface[] {\n        return this.quests.filter((quest) => quest.completed);\n    }\n    get failedQuests(): QuestInterface[] {\n        return this.quests.filter((quest) => quest.failed);\n    }\n    get notStartedQuests(): QuestInterface[] {\n        return this.quests.filter((quest) => !quest.started);\n    }\n\n    find(id: string): QuestInterface | undefined {\n        return getQuestById(id);\n    }\n\n    /**\n     * Start the quests that must start on the current stage.\n     */\n    startsStageMustBeStarted(props: OnRunProps) {\n        Object.values(registeredQuests).forEach((quest) => {\n            if (quest.currentStageMustStart) {\n                quest.startCurrentStage(props);\n            }\n        });\n    }\n}\n","import { CommitmentInterface } from \"../interface\";\n\nexport const registeredCommitments: { [id: string]: CommitmentInterface } = {};\nexport const fixedCommitments: { [id: string]: CommitmentInterface } = {};\n\n/**\n * Save a commitment in the registered commitments. If the commitment already exists, it will be overwritten.\n * @param commitment The commitment or commitments to save.\n * @returns\n */\nexport function saveCommitment(commitment: CommitmentInterface | CommitmentInterface[]) {\n\tif (Array.isArray(commitment)) {\n\t\tcommitment.forEach((c) => saveCommitment(c));\n\t\treturn;\n\t}\n\tif (registeredCommitments[commitment.id]) {\n\t\tconsole.warn(`[NQTR] Commitment id ${commitment.id} already exists, it will be overwritten`);\n\t}\n\tregisteredCommitments[commitment.id] = commitment;\n}\n\n/**\n * Get a commitment by its id.\n * @param id The id of the commitment.\n * @returns The commitment or undefined if not found.\n */\nexport function getCommitmentById(id: string): CommitmentInterface | undefined {\n\ttry {\n\t\tlet commitment = registeredCommitments[id];\n\t\tif (!commitment) {\n\t\t\tconsole.error(`[NQTR] Commitment ${id} not found`);\n\t\t\treturn;\n\t\t}\n\t\treturn commitment;\n\t} catch (e) {\n\t\tconsole.error(`[NQTR] Error while getting Commitment ${id}`, e);\n\t\treturn;\n\t}\n}\n","import { CharacterInterface, storage } from \"@drincs/pixi-vn\";\nimport { navigator } from \".\";\nimport { fixedCommitments, getCommitmentById, registeredCommitments } from \"../decorators/CommitmentDecorator\";\nimport { CommitmentInterface } from \"../interface\";\n\nconst TEMPORARY_COMMITMENT_CATEGORY_MEMORY_KEY = \"___nqtr-temporary_commitment___\";\nexport default class RoutineManager {\n\tget fixedRoutine(): CommitmentInterface[] {\n\t\treturn Object.values(fixedCommitments);\n\t}\n\t/**\n\t * Set a commitment as fixed, it will be always available. They cannot be deleted or edit during the game session.\n\t */\n\tset fixedRoutine(commitments: CommitmentInterface[]) {\n\t\tcommitments.forEach((c) => {\n\t\t\tif (fixedCommitments[c.id]) {\n\t\t\t\tconsole.warn(`[NQTR] Commitment id ${c.id} already exists, it will be overwritten`);\n\t\t\t}\n\t\t\tfixedCommitments[c.id] = c;\n\t\t});\n\t}\n\n\t/**\n\t * Get the temporary commitments by its id.\n\t * @returns The temporary commitments.\n\t */\n\tget temporaryRoutine(): CommitmentInterface[] {\n\t\tlet commitmentsIds = storage.getVariable<string[]>(TEMPORARY_COMMITMENT_CATEGORY_MEMORY_KEY);\n\t\tif (!commitmentsIds) {\n\t\t\treturn [];\n\t\t}\n\t\tlet commitments = commitmentsIds\n\t\t\t.map((id) => getCommitmentById(id))\n\t\t\t.filter((commitment) => commitment !== undefined);\n\t\treturn commitments;\n\t}\n\n\tget allRoutine(): CommitmentInterface[] {\n\t\treturn [...this.fixedRoutine, ...this.temporaryRoutine];\n\t}\n\n\t/**\n\t * This feature adds the commitments during the game session.\n\t * @param commitment The commitment or commitments to add.\n\t */\n\tadd(commitment: CommitmentInterface[] | CommitmentInterface) {\n\t\tif (!Array.isArray(commitment)) {\n\t\t\tcommitment = [commitment];\n\t\t}\n\t\tlet commitmentsIds = commitment\n\t\t\t.map((commitment) => {\n\t\t\t\tlet commitmentTest = getCommitmentById(commitment.id);\n\t\t\t\tif (!commitmentTest) {\n\t\t\t\t\tconsole.warn(`[NQTR] Commitment ${commitment.id} not found, it will be ignored`);\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\treturn commitment.id;\n\t\t\t})\n\t\t\t.filter((id) => id !== undefined);\n\n\t\tstorage.setVariable(TEMPORARY_COMMITMENT_CATEGORY_MEMORY_KEY, commitmentsIds);\n\t}\n\n\t/**\n\t * Get the commitments added during the game session.\n\t * @param id The id of the commitment.\n\t * @returns The commitment or undefined if not found.\n\t */\n\tfind(id: string): CommitmentInterface | undefined {\n\t\treturn getCommitmentById(id);\n\t}\n\n\t/**\n\t * Remove the commitments added during the game session.\n\t * @param commitment The commitment or commitments to remove.\n\t */\n\tremove(commitment: CommitmentInterface[] | CommitmentInterface) {\n\t\tif (!Array.isArray(commitment)) {\n\t\t\tcommitment = [commitment];\n\t\t}\n\t\tlet commitmentsIds = commitment.map((commitment) => {\n\t\t\treturn commitment.id;\n\t\t});\n\n\t\tlet currentCommitments = storage.getVariable<string[]>(TEMPORARY_COMMITMENT_CATEGORY_MEMORY_KEY);\n\t\tif (!currentCommitments) {\n\t\t\treturn;\n\t\t}\n\t\tcurrentCommitments = currentCommitments.filter((id) => !commitmentsIds.includes(id));\n\t\tstorage.setVariable(TEMPORARY_COMMITMENT_CATEGORY_MEMORY_KEY, currentCommitments);\n\t}\n\n\t/**\n\t * Clear all the expired commitments.\n\t */\n\tclearExpiredRoutine() {\n\t\tObject.values(registeredCommitments).forEach((commitment) => {\n\t\t\tif (commitment.expired) {\n\t\t\t\tdelete registeredCommitments[commitment.id];\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Get the current commitments. The hidden commitments are not included.\n\t * In case there is a character who has two or more commitments at the same time, will be selected the commitment with the highest priority.\n\t * Higher priority commitments are calculated using the following steps:\n\t * 1. The commitments that have Commitments BaseModel.priority set to a higher value will be selected first.\n\t * 2. If there are commitments with the same priority, the commitments that are not fixed will be selected first.\n\t * 3. If there are commitments with the same priority and the same fixed status, priority will be given to the commitment with a lower index.\n\t * @returns The current commitments.\n\t */\n\tget currentRoutine(): CommitmentInterface[] {\n\t\tlet character_commitments: { [character: string]: CommitmentInterface } = {};\n\t\t[...this.temporaryRoutine, ...this.fixedRoutine].reverse().forEach((c) => {\n\t\t\tif (c.isActive) {\n\t\t\t\tif (c.characters.length > 0) {\n\t\t\t\t\t// all the characters don't already have commitments or the commitment has a higher priority\n\t\t\t\t\tlet allAvailable = c.characters.every(\n\t\t\t\t\t\t(ch) => !character_commitments[ch.id] || c.priority > character_commitments[ch.id].priority\n\t\t\t\t\t);\n\t\t\t\t\tif (allAvailable) {\n\t\t\t\t\t\tc.characters.forEach((ch) => {\n\t\t\t\t\t\t\tcharacter_commitments[ch.id] = c;\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconsole.error(`[NQTR] The commitment ${c.id} has no characters assigned`);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn Object.values(character_commitments);\n\t}\n\n\tget currentRoomRoutine(): CommitmentInterface[] {\n\t\treturn navigator.currentRoom?.routine || [];\n\t}\n\n\t/**\n\t * Get the character commitment.\n\t * @param character The character.\n\t * @returns The commitment or undefined if not found.\n\t */\n\tgetCommitmentByCharacter(character: CharacterInterface): CommitmentInterface | undefined {\n\t\tthis.currentRoutine.forEach((c) => {\n\t\t\tif (c.characters.map((ch) => ch.id).includes(character.id)) {\n\t\t\t\treturn c;\n\t\t\t}\n\t\t});\n\t\treturn undefined;\n\t}\n}\n","export const TIME_SETTINGS_KEY = '___nqtr-time_manager_settings___';\nexport const TIME_DATA_KEY = '___nqtr-time_manager_data___';\n\n","import { ITimeStlot, TimeSettings } from \"../types/TimeSettings\";\n\nexport default class TimeManagerSettings implements TimeSettings {\n    static minDayHours: number = 0\n    static maxDayHours: number = 24\n    static defaultTimeSpent: number = 1\n    static timeSlots: ITimeStlot[] = []\n    static weekLength: number = 7\n    static weekendStartDay: number = this.weekLength - 1\n    static weekDaysNames: string[] = []\n}\n","import { storage } from \"@drincs/pixi-vn\";\nimport { TIME_DATA_KEY } from \"../constants\";\nimport TimeDataType from \"../types/TimeDataType\";\nimport { ITimeStlot, TimeSettings } from \"../types/TimeSettings\";\nimport TimeManagerSettings from \"./TimeManagerSettings\";\n\nexport default class TimeManager {\n    initialize(settings: TimeSettings) {\n        const {\n            minDayHours = 0,\n            maxDayHours = 24,\n            defaultTimeSpent = 1,\n            timeSlots = [],\n            weekLength = 7,\n            weekendStartDay = weekLength - 1,\n            weekDaysNames = [],\n        } = settings;\n        TimeManagerSettings.minDayHours = minDayHours;\n        TimeManagerSettings.maxDayHours = maxDayHours;\n        TimeManagerSettings.defaultTimeSpent = defaultTimeSpent;\n        TimeManagerSettings.timeSlots = timeSlots;\n        TimeManagerSettings.weekLength = weekLength;\n        if (weekendStartDay >= TimeManagerSettings.weekLength) {\n            console.warn(`[NQTR] Weekend start day should be less than week length ${weekLength}, so will be ignored`);\n        } else {\n            TimeManagerSettings.weekendStartDay = weekendStartDay;\n        }\n        if (weekDaysNames.length !== weekLength) {\n            console.warn(`[NQTR] Week days names should be equal to week length ${weekLength}, so will be ignored`);\n        } else {\n            TimeManagerSettings.weekDaysNames = weekDaysNames;\n        }\n    }\n    get minDayHours(): number {\n        return TimeManagerSettings.minDayHours;\n    }\n    get maxDayHours(): number {\n        return TimeManagerSettings.maxDayHours;\n    }\n    get defaultTimeSpent(): number {\n        return TimeManagerSettings.defaultTimeSpent;\n    }\n    get timeSlots(): ITimeStlot[] {\n        return TimeManagerSettings.timeSlots;\n    }\n    get weekLength(): number {\n        return TimeManagerSettings.weekLength;\n    }\n    get weekendStartDay(): number {\n        return TimeManagerSettings.weekendStartDay;\n    }\n    get weekDaysNames(): string[] {\n        return TimeManagerSettings.weekDaysNames;\n    }\n\n    /**\n     * Get the current hour\n     */\n    get currentHour(): number {\n        let data = storage.getVariable<TimeDataType>(TIME_DATA_KEY) || {};\n        if (data.hasOwnProperty(\"currentHour\") && typeof data.currentHour === \"number\") {\n            return data.currentHour;\n        }\n        return this.minDayHours;\n    }\n    set currentHour(value: number | undefined) {\n        let data = storage.getVariable<TimeDataType>(TIME_DATA_KEY) || {};\n        if (typeof value === \"number\") {\n            data.currentHour = value;\n        } else {\n            delete data.currentHour;\n        }\n        storage.setVariable(TIME_DATA_KEY, data);\n    }\n    /**\n     * Get the current day\n     */\n    get currentDay(): number {\n        let data = storage.getVariable<TimeDataType>(TIME_DATA_KEY) || {};\n        if (data.hasOwnProperty(\"currentDay\") && typeof data.currentDay === \"number\") {\n            return data.currentDay;\n        }\n        return 0;\n    }\n    set currentDay(value: number | undefined) {\n        let data = storage.getVariable<TimeDataType>(TIME_DATA_KEY) || {};\n        if (typeof value === \"number\") {\n            data.currentDay = value;\n        } else {\n            delete data.currentDay;\n        }\n        storage.setVariable(TIME_DATA_KEY, data);\n    }\n    /**\n     * If the current day is greater than or equal to the weekend start day, then it will return true.\n     */\n    get isWeekend(): boolean {\n        return this.currentWeekDayNumber >= this.weekendStartDay;\n    }\n    /**\n     * Get the current week day number (1 - {@link weekLength}).\n     * For example, if the week length is 7 and the current day is 10, then the result will be 4.\n     */\n    get currentWeekDayNumber(): number {\n        let result = this.currentDay % this.weekLength;\n        return result + 1;\n    }\n    /**\n     * Get the current week day name. If the week days names are not defined, then it will return undefined.\n     * For example, if the week days names are ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] and the current day is 10, then the result will be 'Thursday'.\n     * @default \"\"\n     */\n    get currentDayName(): string {\n        let weekDayNumber = this.currentWeekDayNumber - 1;\n        if (weekDayNumber >= this.weekDaysNames.length) {\n            console.warn(`[NQTR] Week day name is not defined for day ${weekDayNumber}`, this.weekDaysNames);\n            return \"\";\n        }\n        return this.weekDaysNames[weekDayNumber];\n    }\n    /**\n     * Get the current {@link timeSlots} index.\n     * You can use this property to create \"Image that changes based on the time period\":\n     * @example\n     * ```tsx\n     * import { weekLength } from '@drincs/nqtr';\n     *\n     * function changeBackground() {\n     *     return (\n     *         <img src={`background-currentTimeSlot.currentTimeSlot.png`} />\n     *     )\n     * }\n     */\n    get currentTimeSlot(): number {\n        if (this.timeSlots.length === 0) {\n            console.warn(\"[NQTR] Time slots are not defined\");\n            return 0;\n        }\n        for (let index = 0; index < this.timeSlots.length; index++) {\n            let slot = this.timeSlots[index];\n            if (this.timeSlots.length > index + 1) {\n                if (this.nowIsBetween(slot.startHour, this.timeSlots[index + 1].startHour)) {\n                    return index;\n                }\n            }\n        }\n        return this.timeSlots.length - 1;\n    }\n\n    /**\n     * This function will increase the current hour by the given time spent.\n     * If the new hour is greater than or equal to the max day hours, then it will increase the day and set the new hour.\n     * @param timeSpent is the time spent in hours (default: {@link defaultTimeSpent})\n     * @returns currentTimeSlot.currentHour\n     */\n    increaseHour(timeSpent: number = this.defaultTimeSpent): number {\n        let newHour = this.currentHour + timeSpent;\n        if (newHour >= this.maxDayHours) {\n            this.increaseDay();\n            newHour = this.minDayHours + (newHour - this.maxDayHours);\n        }\n        this.currentHour = newHour;\n        return this.currentHour;\n    }\n\n    /**\n     * This function will increase the current day by the given days.\n     * @param newDayHour is the hour of the new day (default: {@link minDayHours})\n     * @param days is the number of days to increase (default: 1)\n     * @returns timeTracker.currentDay\n     */\n    increaseDay(newDayHour: number = this.minDayHours, days: number = 1): number {\n        let newDay = this.currentDay + days;\n        this.currentDay = newDay;\n        this.currentHour = newDayHour;\n        return this.currentDay;\n    }\n\n    /**\n     * This function will check if the current hour is between the given hours.\n     * @param fromHour the starting hour. If the {@link currentHour} is equal to this hour, the function will return true.\n     * @param toHour the ending hour.\n     * @returns true if the current hour is between the given hours, otherwise false.\n     */\n    nowIsBetween(fromHour: number | undefined, toHour: number | undefined): boolean {\n        if (fromHour === undefined) {\n            fromHour = this.minDayHours - 1;\n        }\n        if (toHour === undefined) {\n            toHour = this.maxDayHours + 1;\n        }\n        let currentHour = this.currentHour;\n        if (fromHour < toHour) {\n            return currentHour >= fromHour && currentHour < toHour;\n        }\n        return currentHour >= fromHour || currentHour < toHour;\n    }\n}\n","import NavigatorManager from \"./NavigatorManager\";\nimport QuestManager from \"./QuestManager\";\nimport RoutineManager from \"./RoutineManager\";\nimport { default as TimeManager } from \"./TimeManager\";\n\nconst timeTracker = new TimeManager();\nconst navigator = new NavigatorManager();\nconst routine = new RoutineManager();\nconst questsNotebook = new QuestManager();\n\nexport { navigator, questsNotebook, routine, timeTracker };\n"]}