{"version":3,"sources":["../src/classes/index.ts","../src/constants.ts","../src/managers/index.ts","../src/decorators/index.ts","../src/utils/log-utility.ts","../src/decorators/RegisteredActivities.ts","../src/decorators/RegisteredCommitments.ts","../src/decorators/RegisteredLocations.ts","../src/decorators/RegisteredMaps.ts","../src/decorators/RegisteredQuests.ts","../src/decorators/RegisteredRooms.ts","../src/managers/NavigatorManager.ts","../src/managers/QuestManager.ts","../src/managers/RoutineManager.ts","../src/managers/TimeManagerSettings.ts","../src/managers/TimeManager.ts","../src/functions/tracking-changes.ts","../src/classes/ActivityStoredClass.ts","../src/classes/ActivityBaseModel.ts","../src/classes/CommitmentStoredClass.ts","../src/classes/CommitmentBaseModel.ts","../src/classes/navigation/NavigationAbstractClass.ts","../src/classes/navigation/LocationStoredClass.ts","../src/classes/navigation/LocationBaseModel.ts","../src/classes/navigation/MapStoredClass.ts","../src/classes/navigation/MapBaseModel.ts","../src/classes/navigation/RoomStoredClass.ts","../src/classes/navigation/RoomBaseModel.ts","../src/classes/quest/QuestStoredClass.ts","../src/classes/quest/QuestBaseModel.ts","../src/classes/quest/StageStoredClass.ts","../src/classes/quest/StageBaseModel.ts","../src/interface/index.ts","../src/types/index.ts","../src/index.ts"],"names":["classes_exports","__export","ActivityBaseModel","ActivityStoredClass","CommitmentBaseModel","CommitmentStoredClass","LocationBaseModel","LocationStoredClass","MapBaseModel","MapStoredClass","QuestBaseModel","QuestStoredClass","RoomBaseModel","RoomStoredClass","StageBaseModel","StageStoredClass","TIME_DATA_KEY","CURRENT_ROOM_MEMORY_KEY","LATEST_EVENT_MEMORY_KEY","managers_exports","navigator","questsNotebook","routine","timeTracker","decorators_exports","RegisteredActivities_default","RegisteredCommitments_default","RegisteredLocations_default","RegisteredMaps_default","RegisteredQuests_default","RegisteredRooms_default","logger","message","optionalParams","registeredActivities","CachedMap","RegisteredActivities","add","activities","activity","get","id","e","values","has","registeredCommitments","fixedCommitments","RegisteredCommitments","commitments","commitment","registeredLocations","RegisteredLocations","location","c","registeredMaps","RegisteredMaps","map","registeredQuests","RegisteredQuest","quests","quest","registeredRooms","RegisteredRooms","room","NavigatorManager","storage","roomId","prevRoom","setLastEvent","QuestManager","props","promises","TEMPORARY_COMMITMENT_CATEGORY_MEMORY_KEY","RoutineManager","commitmentsIds","currentCommitments","character_commitments","ch","character","TimeManagerSettings","TimeManager","settings","minDayHours","maxDayHours","defaultTimeSpent","timeSlots","weekLength","weekendStartDay","weekDaysNames","data","value","prev","weekDayNumber","index","slot","timeSpent","newHour","newDayHour","days","newDay","fromHour","toHour","currentHour","event","getLastEvent","addTempHistoryItem","lastEvent","currentRoom","narration","currentTime","ACTIVITY_CATEGORY","StoredClassModel","_onRun","category","onRun","COMMITMENT_CATEGORY","_characters","_room","NavigationAbstractClass","categoryId","defaultActivities","activityId","activeActivityScheduling","excludedActivitiesScheduling","scheduling","options","hours","fromDay","toDay","additionalActivitiesIds","excludedActivitiesIds","res","a","LOCATION_CATEGORY","_map","MAP_CATEGORY","ROOM_CATEGORY","_location","characters","run","QUEST_CATEGORY","_stages","currentStage","prevStage","currentStageIndex","nextCurrentStage","newCurrentStage","stages","STAGE_CATEGORY","prevStageEndDay","daysRequired","q","flag","interface_exports","types_exports","nqtr","index_default"],"mappings":"2EAAA,IAAA,EAAA,CAAA,MAAA,CAAA,cAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,IAAA,IAAA,CAAA,IAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,UAAA,CAAA,IAAA,CAAA,EAAA,CAAA,CAAA,IAAAA,EAAAA,CAAA,EAAA,CAAAC,CAAAA,CAAAD,EAAAA,CAAA,uBAAAE,CAAAA,CAAA,mBAAA,CAAA,IAAAC,CAAAA,CAAA,mBAAA,CAAA,IAAAC,CAAAA,CAAA,qBAAA,CAAA,IAAAC,CAAAA,CAAA,iBAAA,CAAA,I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,CACA,IAAa,SAAA,CAAU9D,CAAAA,CAAgB,CACnC,MAAM,SAAA,CAAYA,EACtB,CACA,IAAa,UAAoB,CAC7B,OACI,IAAA,CAAK,oBAAA,CAAqB,OAAS,CAAA,EACnC,CAAC,IAAA,CAAK,oBAAA,CAAqB,KAAA,CAAO8D,CAAAA,EAASvF,OAAAA,CAAQ,OAAA,CAAQuF,EAAK,IAAI,CAAC,CAAA,CAE9D,KAAA,CAEJ,KAAA,CAAM,QACjB,CACJ,ECtGA,IAAAC,EAAAA,CAAA,EAAA,CCAA,IAAAC,EAAAA,CAAA,EAAA,CCYA,IAAMC,EAAAA,CAAO,CACT,GAAG3J,EAAAA,CACH,GAAGwB,EAAAA,CACH,GAAGiI,GACH,GAAGtI,EAAAA,CACH,GAAGuI,EACP,EACOE,EAAAA,CAAQD","file":"index.mjs","sourcesContent":["export { default as ActivityBaseModel } from \"./ActivityBaseModel\";\nexport { default as ActivityStoredClass } from \"./ActivityStoredClass\";\nexport { default as CommitmentBaseModel } from \"./CommitmentBaseModel\";\nexport { default as CommitmentStoredClass } from \"./CommitmentStoredClass\";\nexport { default as LocationBaseModel } from \"./navigation/LocationBaseModel\";\nexport { default as LocationStoredClass } from \"./navigation/LocationStoredClass\";\nexport { default as MapBaseModel } from \"./navigation/MapBaseModel\";\nexport { default as MapStoredClass } from \"./navigation/MapStoredClass\";\nexport { default as RoomBaseModel } from \"./navigation/RoomBaseModel\";\nexport { default as RoomStoredClass } from \"./navigation/RoomStoredClass\";\nexport { default as QuestBaseModel } from \"./quest/QuestBaseModel\";\nexport { default as QuestStoredClass } from \"./quest/QuestStoredClass\";\nexport { default as StageBaseModel } from \"./quest/StageBaseModel\";\nexport { default as StageStoredClass } from \"./quest/StageStoredClass\";\n","export const TIME_SETTINGS_KEY = \"___nqtr-time_manager_settings___\";\nexport const TIME_DATA_KEY = \"___nqtr-time_manager_data___\";\n\nexport const CURRENT_ROOM_MEMORY_KEY = \"___nqtr-current_room_memory___\";\nexport const LATEST_EVENT_MEMORY_KEY = \"___nqtr-last_event_memory___\";\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","export { default as RegisteredActivities } from \"./RegisteredActivities\";\nexport { default as RegisteredCommitments } from \"./RegisteredCommitments\";\nexport { default as RegisteredLocations } from \"./RegisteredLocations\";\nexport { default as RegisteredMaps } from \"./RegisteredMaps\";\nexport { default as RegisteredQuests } from \"./RegisteredQuests\";\nexport { default as RegisteredRooms } from \"./RegisteredRooms\";\n","export namespace logger {\n    export const log = (message?: any, ...optionalParams: any[]) => console.log(`[NQTR] ${message}`, ...optionalParams);\n    export const warn = (message?: any, ...optionalParams: any[]) =>\n        console.warn(`[NQTR] ${message}`, ...optionalParams);\n    export const error = (message?: any, ...optionalParams: any[]) =>\n        console.error(`[NQTR] ${message}`, ...optionalParams);\n    export const info = (message?: any, ...optionalParams: any[]) =>\n        console.info(`[NQTR] ${message}`, ...optionalParams);\n}\n","import { CachedMap } from \"@drincs/pixi-vn\";\nimport { ActivityInterface } from \"../interface\";\nimport { logger } from \"../utils/log-utility\";\n\n/**\n * A Map that contains all activities registered and available to be used.\n * The key is the id of the activity and the value is the activity itself.\n */\nconst registeredActivities = new CachedMap<string, ActivityInterface>({ cacheSize: 20 });\n\nnamespace RegisteredActivities {\n    /**\n     * Save an activity in the registered activities. If the activity already exists, it will be overwritten.\n     * @param activity The activity to save.\n     * @returns\n     */\n    export function add(activities: ActivityInterface | ActivityInterface[]) {\n        if (Array.isArray(activities)) {\n            activities.forEach((activity) => RegisteredActivities.add(activity));\n            return;\n        }\n        registeredActivities.set(activities.id, activities);\n    }\n\n    /**\n     * Get an activity by its id.\n     * @param id The id of the activity.\n     * @returns The activity or undefined if not found.\n     */\n    export function get(id: string): ActivityInterface | undefined {\n        try {\n            let activity = registeredActivities.get(id);\n            if (!activity) {\n                console.warn(`[NQTR] Activity ${id} not found, you should register it first`);\n                return;\n            }\n            return activity;\n        } catch (e) {\n            logger.error(`Error while getting Activity ${id}`, e);\n            return;\n        }\n    }\n\n    /**\n     * Get a list of all activities registered.\n     * @returns An array of activities.\n     */\n    export function values(): ActivityInterface[] {\n        return Array.from(registeredActivities.values());\n    }\n\n    /**\n     * Check if an activity is registered.\n     * @param id The id of the activity.\n     * @returns True if the activity is registered, false otherwise.\n     */\n    export function has(id: string): boolean {\n        return registeredActivities.has(id);\n    }\n}\nexport default RegisteredActivities;\n","import { CachedMap } from \"@drincs/pixi-vn\";\nimport { CommitmentInterface } from \"../interface\";\nimport { logger } from \"../utils/log-utility\";\n\n/**\n * A Map that contains all commitments registered and available to be used.\n * The key is the id of the commitment and the value is the commitment itself.\n */\nexport const registeredCommitments = new CachedMap<string, CommitmentInterface>({ cacheSize: 20 });\nexport const fixedCommitments = new CachedMap<string, CommitmentInterface>({ cacheSize: 20 });\n\nnamespace RegisteredCommitments {\n    /**\n     * Save a commitment in the registered commitments. If the commitment already exists, it will be overwritten.\n     * @param commitment The commitment to save.\n     * @returns\n     */\n    export function add(commitments: CommitmentInterface | CommitmentInterface[]) {\n        if (Array.isArray(commitments)) {\n            commitments.forEach((commitment) => RegisteredCommitments.add(commitment));\n            return;\n        }\n        console.warn(`[NQTR] Registering commitment ${commitments.id}`, commitments);\n        registeredCommitments.set(commitments.id, commitments);\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     */\n    export function get(id: string): CommitmentInterface | undefined {\n        try {\n            let commitment = registeredCommitments.get(id);\n            if (!commitment) {\n                console.warn(`[NQTR] Commitment ${id} not found, you should register it first`);\n                return;\n            }\n            return commitment;\n        } catch (e) {\n            logger.error(`Error while getting Commitment ${id}`, e);\n            return;\n        }\n    }\n    /**\n     * Get a list of all commitments registered.\n     * @returns An array of commitments.\n     */\n    export function values(): CommitmentInterface[] {\n        return Array.from(registeredCommitments.values());\n    }\n    /**\n     * Check if a commitment is registered.\n     * @param id The id of the commitment.\n     * @returns True if the commitment is registered, false otherwise.\n     */\n    export function has(id: string): boolean {\n        return registeredCommitments.has(id);\n    }\n}\nexport default RegisteredCommitments;\n","import { CachedMap } from \"@drincs/pixi-vn\";\nimport { LocationInterface } from \"../interface\";\nimport { logger } from \"../utils/log-utility\";\n\n/**\n * A Map that contains all locations registered and available to be used.\n * The key is the id of the location and the value is the location itself.\n */\nconst registeredLocations = new CachedMap<string, LocationInterface>({ cacheSize: 20 });\n\nnamespace RegisteredLocations {\n    /**\n     * Save a location in the registered locations. If the location already exists, it will be overwritten.\n     * @param location The location to save.\n     * @returns\n     */\n    export function add(location: LocationInterface | LocationInterface[]) {\n        if (Array.isArray(location)) {\n            location.forEach((c) => add(c));\n            return;\n        }\n        if (registeredLocations.has(location.id)) {\n            console.warn(`[NQTR] Location id ${location.id} already exists, it will be overwritten`);\n        }\n        registeredLocations.set(location.id, location);\n    }\n\n    /**\n     * Get a location by its id.\n     * @param id The id of the location.\n     * @returns The location or undefined if not found.\n     */\n    export function get(id: string): LocationInterface | undefined {\n        try {\n            let location = registeredLocations.get(id);\n            if (!location) {\n                console.warn(`[NQTR] Location ${id} not found, you should register it first`);\n                return;\n            }\n            return location;\n        } catch (e) {\n            logger.error(`Error while getting Location ${id}`, e);\n            return;\n        }\n    }\n\n    /**\n     * Get a list of all locations registered.\n     * @returns An array of locations.\n     */\n    export function values(): LocationInterface[] {\n        return Array.from(registeredLocations.values());\n    }\n\n    /**\n     * Check if a location is registered.\n     * @param id The id of the location.\n     * @returns True if the location is registered, false otherwise.\n     */\n    export function has(id: string): boolean {\n        return registeredLocations.has(id);\n    }\n}\nexport default RegisteredLocations;\n","import { CachedMap } from \"@drincs/pixi-vn\";\nimport { MapInterface } from \"../interface\";\nimport { logger } from \"../utils/log-utility\";\n\n/**\n * A Map that contains all maps registered and available to be used.\n * The key is the id of the map and the value is the map itself.\n */\nconst registeredMaps = new CachedMap<string, MapInterface>({ cacheSize: 20 });\n\nnamespace RegisteredMaps {\n    /**\n     * Save a map in the registered maps. If the map already exists, it will be overwritten.\n     * @param map The map to save.\n     * @returns\n     */\n    export function add(map: MapInterface | MapInterface[]) {\n        if (Array.isArray(map)) {\n            map.forEach((c) => add(c));\n            return;\n        }\n        if (registeredMaps.has(map.id)) {\n            console.warn(`[NQTR] Map id ${map.id} already exists, it will be overwritten`);\n        }\n        registeredMaps.set(map.id, map);\n    }\n\n    /**\n     * Get a map by its id.\n     * @param id The id of the map.\n     * @returns The map or undefined if not found.\n     */\n    export function get(id: string): MapInterface | undefined {\n        try {\n            let map = registeredMaps.get(id);\n            if (!map) {\n                console.warn(`[NQTR] Map ${id} not found, you should register it first`);\n                return;\n            }\n            return map;\n        } catch (e) {\n            logger.error(`Error while getting Map ${id}`, e);\n            return;\n        }\n    }\n\n    /**\n     * Get a list of all maps registered.\n     * @returns An array of maps.\n     */\n    export function values(): MapInterface[] {\n        return Array.from(registeredMaps.values());\n    }\n\n    /**\n     * Check if a map is registered.\n     * @param id The id of the map.\n     * @returns True if the map is registered, false otherwise.\n     */\n    export function has(id: string): boolean {\n        return registeredMaps.has(id);\n    }\n}\nexport default RegisteredMaps;\n","import { CachedMap } from \"@drincs/pixi-vn\";\nimport { QuestInterface } from \"../interface\";\nimport { logger } from \"../utils/log-utility\";\n\n/**\n * A Map that contains all quests registered and available to be used.\n * The key is the id of the quest and the value is the quest itself.\n */\nconst registeredQuests = new CachedMap<string, QuestInterface>({ cacheSize: 5 });\n\nnamespace RegisteredQuest {\n    /**\n     * Save a quest in the registered quests. If the quest already exists, it will be overwritten.\n     * @param quest The quest to save.\n     * @returns\n     */\n    export function add(quests: QuestInterface | QuestInterface[]) {\n        if (Array.isArray(quests)) {\n            quests.forEach((quest) => RegisteredQuest.add(quest));\n            return;\n        }\n        registeredQuests.set(quests.id, quests);\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     */\n    export function get(id: string): QuestInterface | undefined {\n        try {\n            let quest = registeredQuests.get(id);\n            if (!quest) {\n                console.warn(`[NQTR] Quest ${id} not found, you should register it first`);\n                return;\n            }\n            return quest;\n        } catch (e) {\n            logger.error(`Error while getting Quest ${id}`, e);\n            return;\n        }\n    }\n    /**\n     * Get a list of all quests registered.\n     * @returns An array of quests.\n     */\n    export function values(): QuestInterface[] {\n        return Array.from(registeredQuests.values());\n    }\n    /**\n     * Check if a quest is registered.\n     * @param id The id of the quest.\n     * @returns True if the quest is registered, false otherwise.\n     */\n    export function has(id: string): boolean {\n        return registeredQuests.has(id);\n    }\n}\nexport default RegisteredQuest;\n","import { CachedMap } from \"@drincs/pixi-vn\";\nimport { RoomInterface } from \"../interface\";\nimport { logger } from \"../utils/log-utility\";\nimport RegisteredLocations from \"./RegisteredLocations\";\nimport RegisteredMaps from \"./RegisteredMaps\";\n\n/**\n * A Map that contains all rooms registered and available to be used.\n * The key is the id of the room and the value is the room itself.\n */\nconst registeredRooms = new CachedMap<string, RoomInterface>({ cacheSize: 20 });\n\nnamespace RegisteredRooms {\n    /**\n     * Save a room in the registered rooms, and their location and map if they are not already registered.\n     * If the room already exists, it will be overwritten.\n     * @param room The room to save.\n     * @returns\n     */\n    export function add(room: RoomInterface | RoomInterface[]) {\n        if (Array.isArray(room)) {\n            room.forEach((c) => add(c));\n            return;\n        }\n        registeredRooms.set(room.id, room);\n        let location = room.location;\n        RegisteredLocations.add(location);\n        let map = location?.map;\n        if (map) {\n            RegisteredMaps.add(map);\n        }\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     */\n    export function get(id: string): RoomInterface | undefined {\n        try {\n            let room = registeredRooms.get(id);\n            if (!room) {\n                console.warn(`[NQTR] Room ${id} not found, you should register it first`);\n                return;\n            }\n            return room;\n        } catch (e) {\n            logger.error(`Error while getting Room ${id}`, e);\n            return;\n        }\n    }\n\n    /**\n     * Get a list of all rooms registered.\n     * @returns An array of rooms.\n     */\n    export function values(): RoomInterface[] {\n        return Array.from(registeredRooms.values());\n    }\n\n    /**\n     * Check if a room is registered.\n     * @param id The id of the room.\n     * @returns True if the room is registered, false otherwise.\n     */\n    export function has(id: string): boolean {\n        return registeredRooms.has(id);\n    }\n}\nexport default RegisteredRooms;\n","import { storage } from \"@drincs/pixi-vn\";\nimport { CURRENT_ROOM_MEMORY_KEY } from \"../constants\";\nimport { RegisteredLocations, RegisteredMaps, RegisteredRooms } from \"../decorators\";\nimport { setLastEvent } from \"../functions/tracking-changes\";\nimport { LocationInterface, MapInterface, RoomInterface } from \"../interface\";\nimport { logger } from \"../utils/log-utility\";\n\nexport default class NavigatorManager {\n    get rooms() {\n        return RegisteredRooms.values();\n    }\n    get locations() {\n        return RegisteredLocations.values();\n    }\n    get maps() {\n        return RegisteredMaps.values();\n    }\n    get currentRoomId(): string | undefined {\n        return storage.getVariable<string>(CURRENT_ROOM_MEMORY_KEY);\n    }\n    get currentRoom(): RoomInterface | undefined {\n        let roomId = this.currentRoomId;\n        if (!roomId) {\n            logger.error(`The current room has not yet been set`);\n            return;\n        }\n        let room = RegisteredRooms.get(roomId);\n        if (!room) {\n            logger.error(`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 = RegisteredRooms.get(room);\n        if (!roomRegistrated) {\n            logger.error(`The room ${room} is not registered, so it can't be set as current room`);\n            return;\n        }\n        let prevRoom = storage.getVariable<string>(CURRENT_ROOM_MEMORY_KEY);\n        if (prevRoom === room) {\n            return;\n        }\n\n        setLastEvent({\n            type: \"editroom\",\n            prev: prevRoom,\n            value: room,\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        RegisteredRooms.values().forEach((room) => {\n            room.clearExpiredActivities();\n        });\n    }\n}\n","import { OnRunProps } from \"@drincs/nqtr\";\nimport RegisteredQuest from \"../decorators/RegisteredQuests\";\nimport { QuestInterface } from \"../interface\";\n\nexport default class QuestManager {\n    /**\n     * The quests registered in the game.\n     */\n    get quests(): QuestInterface[] {\n        return RegisteredQuest.values();\n    }\n    /**\n     * The quests that are started, so they are in progress or completed or failed.\n     */\n    get startedQuests(): QuestInterface[] {\n        return this.quests.filter((quest) => quest.started);\n    }\n    /**\n     * The quests that are in progress.\n     */\n    get inProgressQuests(): QuestInterface[] {\n        return this.quests.filter((quest) => quest.inProgress);\n    }\n    /**\n     * The quests that are completed.\n     */\n    get completedQuests(): QuestInterface[] {\n        return this.quests.filter((quest) => quest.completed);\n    }\n    /**\n     * The quests that are failed.\n     */\n    get failedQuests(): QuestInterface[] {\n        return this.quests.filter((quest) => quest.failed);\n    }\n    /**\n     * The quests that are not started.\n     */\n    get notStartedQuests(): QuestInterface[] {\n        return this.quests.filter((quest) => !quest.started);\n    }\n    /**\n     * Get the quest by the id.\n     * @param id The id of the quest.\n     * @returns The quest with the id.\n     */\n    find(id: string): QuestInterface | undefined {\n        return RegisteredQuest.get(id);\n    }\n\n    /**\n     * Start the quests that must start on the current stage.\n     */\n    async startsStageMustBeStarted(props: OnRunProps) {\n        let promises: Promise<void>[] = this.quests.map((quest) => {\n            if (quest.currentStageMustStart) {\n                return quest.startCurrentStage(props);\n            }\n            return Promise.resolve();\n        });\n        await Promise.all(promises);\n    }\n}\n","import { CharacterInterface, storage } from \"@drincs/pixi-vn\";\nimport { navigator } from \".\";\nimport RegisteredCommitments, { fixedCommitments, registeredCommitments } from \"../decorators/RegisteredCommitments\";\nimport { CommitmentInterface } from \"../interface\";\nimport { logger } from \"../utils/log-utility\";\n\nconst TEMPORARY_COMMITMENT_CATEGORY_MEMORY_KEY = \"___nqtr-temporary_commitment___\";\nexport default class RoutineManager {\n    get fixedRoutine(): CommitmentInterface[] {\n        return [...fixedCommitments.values()];\n    }\n    /**\n     * Set a commitment as fixed, it will be always available. They cannot be deleted or edit during the game session.\n     */\n    set fixedRoutine(commitments: CommitmentInterface[]) {\n        commitments.forEach((c) => {\n            if (fixedCommitments.has(c.id)) {\n                console.warn(`[NQTR] Commitment id ${c.id} already exists, it will be overwritten`);\n            }\n            fixedCommitments.set(c.id, c);\n        });\n    }\n\n    /**\n     * Get the temporary commitments by its id.\n     * @returns The temporary commitments.\n     */\n    get temporaryRoutine(): CommitmentInterface[] {\n        let commitmentsIds = storage.getVariable<string[]>(TEMPORARY_COMMITMENT_CATEGORY_MEMORY_KEY);\n        if (!commitmentsIds) {\n            return [];\n        }\n        let commitments = commitmentsIds\n            .map((id) => RegisteredCommitments.get(id))\n            .filter((commitment) => commitment !== undefined);\n        return commitments;\n    }\n\n    get allRoutine(): CommitmentInterface[] {\n        return [...this.fixedRoutine, ...this.temporaryRoutine];\n    }\n\n    /**\n     * This feature adds the commitments during the game session.\n     * @param commitment The commitment or commitments to add.\n     */\n    add(commitment: CommitmentInterface[] | CommitmentInterface) {\n        if (!Array.isArray(commitment)) {\n            commitment = [commitment];\n        }\n        let commitmentsIds = commitment\n            .map((commitment) => {\n                let commitmentTest = RegisteredCommitments.get(commitment.id);\n                if (!commitmentTest) {\n                    console.warn(`[NQTR] Commitment ${commitment.id} not found, it will be ignored`);\n                    return undefined;\n                }\n                return commitment.id;\n            })\n            .filter((id) => id !== undefined);\n\n        storage.setVariable(TEMPORARY_COMMITMENT_CATEGORY_MEMORY_KEY, commitmentsIds);\n    }\n\n    /**\n     * Get the commitments added during the game session.\n     * @param id The id of the commitment.\n     * @returns The commitment or undefined if not found.\n     */\n    find(id: string): CommitmentInterface | undefined {\n        return RegisteredCommitments.get(id);\n    }\n\n    /**\n     * Remove the commitments added during the game session.\n     * @param commitment The commitment or commitments to remove.\n     */\n    remove(commitment: CommitmentInterface[] | CommitmentInterface) {\n        if (!Array.isArray(commitment)) {\n            commitment = [commitment];\n        }\n        let commitmentsIds = commitment.map((commitment) => {\n            return commitment.id;\n        });\n\n        let currentCommitments = storage.getVariable<string[]>(TEMPORARY_COMMITMENT_CATEGORY_MEMORY_KEY);\n        if (!currentCommitments) {\n            return;\n        }\n        currentCommitments = currentCommitments.filter((id) => !commitmentsIds.includes(id));\n        storage.setVariable(TEMPORARY_COMMITMENT_CATEGORY_MEMORY_KEY, currentCommitments);\n    }\n\n    /**\n     * Clear all the expired commitments.\n     */\n    clearExpiredRoutine() {\n        RegisteredCommitments.values().forEach((commitment) => {\n            if (commitment.expired) {\n                registeredCommitments.delete(commitment.id);\n            }\n        });\n    }\n\n    /**\n     * Get the current commitments. The hidden commitments are not included.\n     * 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     * Higher priority commitments are calculated using the following steps:\n     * 1. The commitments that have Commitments BaseModel.priority set to a higher value will be selected first.\n     * 2. If there are commitments with the same priority, the commitments that are not fixed will be selected first.\n     * 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     * @returns The current commitments.\n     */\n    get currentRoutine(): CommitmentInterface[] {\n        let character_commitments: { [character: string]: CommitmentInterface } = {};\n        [...this.fixedRoutine, ...this.temporaryRoutine].forEach((c) => {\n            if (c.isActive) {\n                if (c.characters.length > 0) {\n                    // all the characters don't already have commitments or the commitment has a higher priority\n                    let allAvailable = c.characters.every(\n                        (ch) => !character_commitments[ch.id] || c.priority > character_commitments[ch.id].priority\n                    );\n                    if (allAvailable) {\n                        c.characters.forEach((ch) => {\n                            character_commitments[ch.id] = c;\n                        });\n                    }\n                } else {\n                    logger.error(`The commitment ${c.id} has no characters assigned`);\n                }\n            }\n        });\n        return Object.values(character_commitments);\n    }\n\n    get currentRoomRoutine(): CommitmentInterface[] {\n        return navigator.currentRoom?.routine || [];\n    }\n\n    /**\n     * Get the character commitment.\n     * @param character The character.\n     * @returns The commitment or undefined if not found.\n     */\n    getCommitmentByCharacter(character: CharacterInterface): CommitmentInterface | undefined {\n        this.currentRoutine.forEach((c) => {\n            if (c.characters.map((ch) => ch.id).includes(character.id)) {\n                return c;\n            }\n        });\n        return undefined;\n    }\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 { setLastEvent } from \"../functions/tracking-changes\";\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 prev = storage.getVariable<TimeDataType>(TIME_DATA_KEY) || {};\n        let data = { ...prev };\n        if (typeof value === \"number\") {\n            data.currentHour = value;\n        } else {\n            delete data.currentHour;\n        }\n        setLastEvent({\n            type: \"edittime\",\n            prev: prev,\n            value: data,\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 prev = storage.getVariable<TimeDataType>(TIME_DATA_KEY) || {};\n        let data = { ...prev };\n        if (typeof value === \"number\") {\n            data.currentDay = value;\n        } else {\n            delete data.currentDay;\n        }\n        setLastEvent({\n            type: \"edittime\",\n            prev: prev,\n            value: data,\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 { narration, storage } from \"@drincs/pixi-vn\";\nimport { CURRENT_ROOM_MEMORY_KEY, LATEST_EVENT_MEMORY_KEY, TIME_DATA_KEY } from \"../constants\";\nimport { navigator } from \"../managers\";\nimport LastEventType from \"../types/LastEventType\";\nimport TimeDataType from \"../types/TimeDataType\";\n\nexport function setLastEvent(event: LastEventType) {\n    storage.setVariable(LATEST_EVENT_MEMORY_KEY, event);\n}\nexport function getLastEvent() {\n    return storage.getVariable<LastEventType>(LATEST_EVENT_MEMORY_KEY);\n}\nexport function addTempHistoryItem() {\n    let lastEvent = getLastEvent();\n    let currentRoom = navigator.currentRoom;\n    if (!currentRoom || !currentRoom.automaticFunction) {\n        narration.addCurrentStepToHistory();\n        return;\n    }\n    switch (lastEvent?.type) {\n        case \"editroom\":\n            storage.setVariable(CURRENT_ROOM_MEMORY_KEY, lastEvent.prev);\n            narration.addCurrentStepToHistory();\n            storage.setVariable(CURRENT_ROOM_MEMORY_KEY, currentRoom.id);\n            break;\n        case \"edittime\":\n            let currentTime = storage.getVariable<TimeDataType>(TIME_DATA_KEY) || {};\n            storage.setVariable(TIME_DATA_KEY, lastEvent.prev);\n            narration.addCurrentStepToHistory();\n            storage.setVariable(TIME_DATA_KEY, currentTime);\n            break;\n    }\n}\n","import { StoredClassModel } from \"@drincs/pixi-vn\";\nimport { addTempHistoryItem } from \"../functions/tracking-changes\";\nimport { ActivityInterface } from \"../interface\";\nimport { ActivityBaseInternalInterface } from \"../interface/ActivityInterface\";\nimport { timeTracker } from \"../managers\";\nimport { OnRunAsyncFunction, OnRunEvent } from \"../types\";\n\nconst ACTIVITY_CATEGORY = \"__nqtr-activity__\";\nexport default class ActivityStoredClass<OnRunEventType = ActivityInterface>\n    extends StoredClassModel\n    implements ActivityBaseInternalInterface\n{\n    constructor(\n        id: string,\n        private readonly _onRun: OnRunEvent<OnRunEventType>,\n        props: {\n            fromHour?: number;\n            toHour?: number;\n            fromDay?: number;\n            toDay?: number;\n        },\n        category: string = ACTIVITY_CATEGORY\n    ) {\n        super(category, id);\n        this._fromHour = props.fromHour;\n        this._toHour = props.toHour;\n        this._fromDay = props.fromDay;\n        this._toDay = props.toDay;\n    }\n\n    private _fromHour?: number;\n    get fromHour(): number | undefined {\n        return this._fromHour;\n    }\n\n    private _toHour?: number;\n    get toHour(): number | undefined {\n        return this._toHour;\n    }\n\n    private _fromDay?: number;\n    get fromDay(): number | undefined {\n        return this._fromDay;\n    }\n\n    private _toDay?: number;\n    get toDay(): number | undefined {\n        return this._toDay;\n    }\n\n    get run(): OnRunAsyncFunction {\n        return async (props) => {\n            addTempHistoryItem();\n            return await this._onRun(this as any, props);\n        };\n    }\n\n    get expired(): boolean {\n        if (this.toDay && this.toDay <= timeTracker.currentDay) {\n            return true;\n        }\n        return false;\n    }\n\n    get isActive(): boolean {\n        if (this.fromDay && this.fromDay > timeTracker.currentDay) {\n            return false;\n        }\n        if (this.toDay && this.toDay < timeTracker.currentDay) {\n            return false;\n        }\n        if (!timeTracker.nowIsBetween(this.fromHour, this.toHour)) {\n            return false;\n        }\n        return true;\n    }\n}\n","import { storage } from \"@drincs/pixi-vn\";\nimport { ActivityInterface, ActivityProps } from \"../interface\";\nimport { OnRunEvent } from \"../types/OnRunEvent\";\nimport ActivityStoredClass from \"./ActivityStoredClass\";\n\n/**\n * The activity model. It is used to create an activity.\n * @example\n * ```tsx\n * export const nap = new ActivityModel(\"nap\",\n *     (_, event) => {\n *         if (event) {\n *             event.navigate(\"/game\")\n *             callLabelWithGoNavigationCallBack(napLabel, event)\n *         }\n *         else {\n *             console.error(\"Event is undefined\")\n *         }\n *     },\n *     {\n *         name: \"Nap\",\n *         fromHour: 5,\n *         toHour: 23,\n *         icon: \"https://icon.jpg\",\n *     }\n * )\n * ```\n */\nexport default class ActivityBaseModel extends ActivityStoredClass<ActivityInterface> {\n    /**\n     * @param id The activity id, that must be unique.\n     * @param onRun The function that is called when the activity is runned. Have 2 parameters: the runned activity and the yourParams object, that is an object with the parameters that you want to pass to the onRun function.\n     * @param props The activity properties.\n     */\n    constructor(id: string, onRun: OnRunEvent<ActivityInterface>, props: ActivityProps) {\n        super(id, onRun, {\n            fromHour: props.fromHour,\n            toHour: props.toHour,\n            fromDay: props.fromDay,\n            toDay: props.toDay,\n        });\n        this.defaultName = props.name || \"\";\n        this.defaultDisabled = props.disabled || false;\n        this.defaultHidden = props.hidden || false;\n        this._icon = props.renderIcon;\n    }\n\n    private defaultName: string;\n    /**\n     * The name of the activity.\n     */\n    get name(): string {\n        return this.getStorageProperty<string>(\"name\") || this.defaultName;\n    }\n    set name(value: string | undefined) {\n        this.setStorageProperty(\"name\", value);\n    }\n\n    private defaultDisabled: boolean | string;\n    /**\n     * Whether is disabled. If it is a string, it is a Pixi'VN flag name.\n     */\n    get disabled(): boolean {\n        let value = this.getStorageProperty<boolean>(\"disabled\") || this.defaultDisabled;\n        if (typeof value === \"string\") {\n            return storage.getFlag(value);\n        }\n        return value;\n    }\n    set disabled(value: boolean | string) {\n        this.setStorageProperty(\"disabled\", value);\n    }\n\n    private defaultHidden: boolean | string;\n    /**\n     * Whether is hidden. If it is a string, it is a Pixi'VN flag name.\n     */\n    get hidden(): boolean {\n        let value = this.getStorageProperty<boolean>(\"hidden\") || this.defaultHidden;\n        if (typeof value === \"string\") {\n            return storage.getFlag(value);\n        }\n        return value;\n    }\n    set hidden(value: boolean | string) {\n        this.setStorageProperty(\"hidden\", value);\n    }\n\n    private _icon?: string;\n    /**\n     * The icon of the activity.\n     */\n    get icon(): string | undefined {\n        return this._icon;\n    }\n}\n","import { CharacterInterface } from \"@drincs/pixi-vn\";\nimport { CommitmentInterface, RoomInterface } from \"../interface\";\nimport { CommitmentBaseInternalInterface } from \"../interface/CommitmentInterface\";\nimport { ExecutionType } from \"../types\";\nimport { OnRunEvent } from \"../types/OnRunEvent\";\nimport ActivityStoredClass from \"./ActivityStoredClass\";\n\nconst COMMITMENT_CATEGORY = \"__nqtr-commitment__\";\nexport default class CommitmentStoredClass\n    extends ActivityStoredClass<CommitmentInterface>\n    implements CommitmentBaseInternalInterface\n{\n    constructor(\n        id: string,\n        private readonly _characters: CharacterInterface[],\n        private readonly _room: RoomInterface,\n        onRun: OnRunEvent<CommitmentInterface> | undefined,\n        props: {\n            executionType?: ExecutionType;\n            priority?: number;\n            fromHour?: number;\n            toHour?: number;\n            fromDay?: number;\n            toDay?: number;\n        }\n    ) {\n        onRun = onRun || (() => {});\n        super(id, onRun, props, COMMITMENT_CATEGORY);\n        this.defaultExecutionType = props.executionType || \"interaction\";\n        this.defaultPriority = props.priority;\n    }\n    private readonly defaultExecutionType: ExecutionType;\n    private readonly defaultPriority?: number;\n\n    get characters(): CharacterInterface[] {\n        return this._characters;\n    }\n\n    get room(): RoomInterface {\n        return this._room;\n    }\n\n    get executionType(): ExecutionType {\n        return this.getStorageProperty<ExecutionType>(\"executionType\") || this.defaultExecutionType;\n    }\n    set executionType(value: ExecutionType) {\n        this.setStorageProperty(\"executionType\", value);\n    }\n\n    get priority(): number {\n        return this.getStorageProperty<number>(\"priority\") || this.defaultPriority || 0;\n    }\n    set priority(value: number) {\n        this.setStorageProperty(\"priority\", value);\n    }\n}\n","import { CharacterInterface, storage } from \"@drincs/pixi-vn\";\nimport { CommitmentProps, RoomInterface } from \"../interface\";\nimport { timeTracker } from \"../managers\";\nimport CommitmentStoredClass from \"./CommitmentStoredClass\";\n\n/**\n * The base model of a commitment. I suggest you extend this class to create your own commitment model.\n * You must use the saveRoom function to save the commitment in the registered commitments.\n * @example\n * ```ts\n * export const mcRoom = new CommitmentBaseModel(\"test\", character, room, {\n *     name: \"Test\",\n *     image: \"https://image.jpg\",\n *     executionType: ExecutionTypeEnum.INTERACTION,\n *     onRun: (commitment) => {\n *         // Do something\n *     }\n * })\n * saveCommitment(mcRoom)\n * ```\n */\nexport default class CommitmentBaseModel extends CommitmentStoredClass {\n    /**\n     * @param id The id of the commitment, it must be unique.\n     * @param character The character or characters that are in the commitment and so in the room.\n     * @param room The room where the commitment is.\n     * @param props The properties of the commitment.\n     */\n    constructor(\n        id: string,\n        character: CharacterInterface | CharacterInterface[] | undefined,\n        room: RoomInterface,\n        props: CommitmentProps\n    ) {\n        super(id, character ? (Array.isArray(character) ? character : [character]) : [], room, props.onRun, {\n            executionType: props.executionType,\n            priority: props.priority,\n            fromHour: props.fromHour,\n            toHour: props.toHour,\n            fromDay: props.fromDay,\n            toDay: props.toDay,\n        });\n        this._name = props.name || \"\";\n        this._image = props.image;\n        this.defaultDisabled = props.disabled || false;\n        this.defaultHidden = props.hidden || false;\n        this._icon = props.icon;\n    }\n\n    private _name: string;\n    /**\n     * The name of the commitment.\n     */\n    get name(): string {\n        return this._name;\n    }\n\n    private _image?: string;\n    /**\n     * The image of the commitment.\n     */\n    get image(): string | undefined {\n        return this._image;\n    }\n\n    private _icon?: string;\n    /**\n     * The icon of the commitment.\n     */\n    get icon(): string | undefined {\n        return this._icon;\n    }\n\n    private defaultDisabled: boolean | string;\n    /**\n     * Whether is disabled. You can also pass a Pixi'VN flag name.\n     */\n    get disabled(): boolean {\n        let value = this.getStorageProperty<boolean>(\"disabled\") || this.defaultDisabled;\n        if (typeof value === \"string\") {\n            return storage.getFlag(value);\n        }\n        return value;\n    }\n    set disabled(value: boolean | string) {\n        this.setStorageProperty(\"disabled\", value);\n    }\n\n    private defaultHidden: boolean | string;\n    /**\n     * Whether is hidden. You can also pass a Pixi'VN flag name.\n     */\n    get hidden(): boolean {\n        if (this.fromDay && this.fromDay > timeTracker.currentDay) {\n            return true;\n        }\n        if (!timeTracker.nowIsBetween(this.fromHour, this.toHour)) {\n            return true;\n        }\n        if (!this.expired) {\n            return true;\n        }\n        let value = this.getStorageProperty<boolean>(\"hidden\") || this.defaultHidden;\n        if (typeof value === \"string\") {\n            return storage.getFlag(value);\n        }\n        return value;\n    }\n    set hidden(value: boolean | string) {\n        this.setStorageProperty(\"hidden\", value);\n    }\n}\n","import { StoredClassModel } from \"@drincs/pixi-vn\";\nimport { RegisteredActivities } from \"../../decorators\";\nimport { ActivityInterface } from \"../../interface\";\nimport NavigationAbstractInterface from \"../../interface/navigation/NavigationAbstractClass\";\nimport { timeTracker } from \"../../managers\";\n\ntype ActiveScheduling = {\n    fromHour?: number;\n    toHour?: number;\n    fromDay?: number;\n    toDay?: number;\n};\ntype ExcludedScheduling = {\n    toDay?: number;\n};\n\nexport default abstract class NavigationAbstractClass extends StoredClassModel implements NavigationAbstractInterface {\n    constructor(categoryId: string, id: string, private defaultActivities: ActivityInterface[] = []) {\n        super(categoryId, id);\n    }\n    private get defaultActivitiesIds(): string[] {\n        return this.defaultActivities.map((activity) => activity.id);\n    }\n    private get activeActivityScheduling(): { [activityId: string]: ActiveScheduling } {\n        return this.getStorageProperty<{ [activityId: string]: ActiveScheduling }>(`activeActivityScheduling`) || {};\n    }\n    private get excludedActivitiesScheduling(): { [activityId: string]: ExcludedScheduling } {\n        return (\n            this.getStorageProperty<{ [activityId: string]: ExcludedScheduling }>(`excludedActivitiesScheduling`) || {}\n        );\n    }\n    private removeActivityScheduling(activityId: string) {\n        let activeActivityScheduling = this.activeActivityScheduling;\n        delete activeActivityScheduling[activityId];\n        this.setStorageProperty(`activeActivityScheduling`, activeActivityScheduling);\n        let excludedActivitiesScheduling = this.excludedActivitiesScheduling;\n        delete excludedActivitiesScheduling[activityId];\n        this.setStorageProperty(`excludedActivitiesScheduling`, excludedActivitiesScheduling);\n    }\n    private editActivityScheduling(activityId: string, scheduling: ActiveScheduling) {\n        this.removeActivityScheduling(activityId);\n        let activeActivityScheduling = this.activeActivityScheduling;\n        activeActivityScheduling[activityId] = scheduling;\n        this.setStorageProperty(`activeActivityScheduling`, activeActivityScheduling);\n    }\n    private editExcludedActivityScheduling(activityId: string, scheduling: ExcludedScheduling) {\n        this.removeActivityScheduling(activityId);\n        let excludedActivitiesScheduling = this.excludedActivitiesScheduling;\n        excludedActivitiesScheduling[activityId] = scheduling;\n        this.setStorageProperty(`excludedActivitiesScheduling`, excludedActivitiesScheduling);\n    }\n    private get additionalActivitiesIds(): string[] {\n        return this.getStorageProperty<string[]>(`additionalActivitiesIds`) || [];\n    }\n    private get excludedActivitiesIds(): string[] {\n        return this.getStorageProperty<string[]>(`excludedActivitiesIds`) || [];\n    }\n    addActivity(\n        activity: ActivityInterface,\n        options: {\n            /**\n             * the activity will be associated with this class only for the specified hours.\n             * If you set from 3 and to 5, the activity will be associated with this class only for hours 3, 4 and 5. soSo at 2 or 6 it will not be associated with this class.\n             */\n            hours?: {\n                from: number;\n                to: number;\n            };\n            /**\n             * the activity will be associated with this class from the specified day.\n             * If you set 3, the activity will be associated with this class from day 3. So at day 2 it will not be associated with this class.\n             */\n            fromDay?: number;\n            /**\n             * the activity will be associated with this class to the specified day.\n             * If you set 3, the activity will be associated with this class until day 3. So at day 4 it will not be associated with this class.\n             */\n            toDay?: number;\n        } = {}\n    ) {\n        const { hours, fromDay, toDay } = options;\n        let scheduling: ActiveScheduling = {};\n        if (hours) {\n            if (hours.from >= hours.to) {\n                throw new Error(`[NQTR] The from hour must be less than the to hour.`);\n            }\n            scheduling.fromHour = hours.from;\n        }\n        if (fromDay === 0) {\n            console.warn(`[NQTR] The from day must be greater than 0, so it will be ignored.`);\n        }\n        if (toDay === 0) {\n            console.warn(`[NQTR] The to day must be greater than 0, so it will be ignored.`);\n        }\n        if (fromDay && toDay && fromDay >= toDay) {\n            throw new Error(`[NQTR] The from day must be less than the to day.`);\n        }\n        if (fromDay) {\n            scheduling.fromDay = fromDay;\n        }\n        if (toDay) {\n            scheduling.toDay = toDay;\n        }\n\n        if (this.defaultActivitiesIds.includes(activity.id)) {\n            console.warn(`[NQTR] Activity with id ${activity.id} already exists, so it will be ignored.`);\n            return;\n        }\n        let additionalActivitiesIds = this.additionalActivitiesIds;\n        if (additionalActivitiesIds.includes(activity.id)) {\n            if (Object.keys(scheduling).length) {\n                this.editActivityScheduling(activity.id, scheduling);\n                return;\n            } else if (this.excludedActivitiesIds.includes(activity.id)) {\n                this.removeActivityScheduling(activity.id);\n                console.log(\n                    `[NQTR] Activity with id ${activity.id} was excluded, so it will be associated with this class again.`\n                );\n                return;\n            }\n            console.warn(`[NQTR] Activity with id ${activity.id} already exists, so it will be ignored.`);\n            return;\n        }\n        additionalActivitiesIds.push(activity.id);\n        this.setStorageProperty(`additionalActivitiesIds`, additionalActivitiesIds);\n        if (Object.keys(scheduling).length) {\n            this.editActivityScheduling(activity.id, scheduling);\n        }\n    }\n    removeActivity(\n        activity: ActivityInterface,\n        options: {\n            /**\n             * The activity will be excluded from this class only for the specified days.\n             * If to 3, the activity will be excluded from this class only for days 1, 2 and 3. So at day 4 it will be associated with this class.\n             */\n            toDay?: number;\n        } = {}\n    ) {\n        const { toDay } = options;\n        let scheduling: ExcludedScheduling = {};\n        if (toDay === 0) {\n            console.warn(`[NQTR] The to day must be greater than 0, so it will be ignored.`);\n        }\n        if (toDay) {\n            scheduling.toDay = toDay;\n        }\n\n        let additionalActivitiesIds = this.additionalActivitiesIds;\n        if (additionalActivitiesIds.includes(activity.id)) {\n            if (Object.keys(scheduling).length) {\n                this.editExcludedActivityScheduling(activity.id, scheduling);\n                return;\n            }\n            additionalActivitiesIds = additionalActivitiesIds.filter((id) => id !== activity.id);\n            this.setStorageProperty(`additionalActivitiesIds`, additionalActivitiesIds);\n        } else if (this.defaultActivitiesIds.includes(activity.id)) {\n            if (Object.keys(scheduling).length) {\n                this.editExcludedActivityScheduling(activity.id, scheduling);\n                return;\n            }\n            let excludedActivitiesIds = this.excludedActivitiesIds;\n            excludedActivitiesIds.push(activity.id);\n            this.setStorageProperty(`excludedActivitiesIds`, excludedActivitiesIds);\n        } else {\n            console.warn(`[NQTR] Activity with id ${activity.id} not found, so it will be ignored.`);\n        }\n    }\n    clearExpiredActivities() {\n        let activeActivityScheduling = this.activeActivityScheduling;\n        let excludedActivitiesScheduling = this.excludedActivitiesScheduling;\n        let additionalActivitiesIds = this.additionalActivitiesIds;\n        let excludedActivitiesIds = this.excludedActivitiesIds;\n\n        additionalActivitiesIds.forEach((activityId) => {\n            if (activityId in activeActivityScheduling) {\n                let { toDay } = activeActivityScheduling[activityId];\n                if (toDay && toDay < timeTracker.currentDay) {\n                    this.removeActivityScheduling(activityId);\n                    additionalActivitiesIds = additionalActivitiesIds.filter((id) => id !== activityId);\n                }\n            }\n        });\n        excludedActivitiesIds.forEach((activityId) => {\n            if (activityId in excludedActivitiesScheduling) {\n                let { toDay } = excludedActivitiesScheduling[activityId];\n                if (toDay && toDay < timeTracker.currentDay) {\n                    this.removeActivityScheduling(activityId);\n                    excludedActivitiesIds = excludedActivitiesIds.filter((id) => id !== activityId);\n                }\n            }\n        });\n    }\n\n    get activities(): ActivityInterface[] {\n        let res: ActivityInterface[] = [];\n        let activeActivityScheduling = this.activeActivityScheduling;\n        this.additionalActivitiesIds.concat(this.defaultActivitiesIds).forEach((activityId) => {\n            let activity = RegisteredActivities.get(activityId);\n            const {\n                fromDay = activity?.fromDay,\n                fromHour = activity?.fromHour,\n                toDay = activity?.toDay,\n                toHour = activity?.toHour,\n            } = activeActivityScheduling[activityId] || {};\n            if (\n                activity &&\n                timeTracker.nowIsBetween(fromHour, toHour) &&\n                !(fromDay && fromDay > timeTracker.currentDay) &&\n                !(toDay && toDay < timeTracker.currentDay)\n            ) {\n                res.push(activity);\n            }\n        });\n        Object.entries(this.excludedActivitiesScheduling).forEach(([activityId, scheduling]) => {\n            let activity = RegisteredActivities.get(activityId);\n            if (activity && activity.isActive && !(scheduling.toDay && scheduling.toDay >= timeTracker.currentDay)) {\n                res.push(activity);\n            }\n        });\n        this.defaultActivities.forEach((activity) => {\n            if (activity.isActive && !res.find((a) => a.id === activity.id)) {\n                res.push(activity);\n            }\n        });\n        return res;\n    }\n}\n","import { ActivityInterface, MapInterface, RoomInterface } from \"../../interface\";\nimport { LocationInternalInterface } from \"../../interface/navigation/LocationInterface\";\nimport { navigator } from \"../../managers\";\nimport NavigationAbstractClass from \"./NavigationAbstractClass\";\n\nconst LOCATION_CATEGORY = \"__nqtr-location__\";\nexport default class LocationStoredClass extends NavigationAbstractClass implements LocationInternalInterface {\n\tconstructor(\n\t\tid: string,\n\t\t/**\n\t\t * The map where the location is.\n\t\t */\n\t\tprivate readonly _map: MapInterface,\n\t\tactivities: ActivityInterface[] = []\n\t) {\n\t\tsuper(LOCATION_CATEGORY, id, activities);\n\t}\n\n\tget map(): MapInterface {\n\t\treturn this._map;\n\t}\n\n\tget rooms(): RoomInterface[] {\n\t\treturn navigator.rooms.filter((room) => room.location.id === this.id);\n\t}\n}\n","import { storage } from \"@drincs/pixi-vn\";\nimport { LocationBaseModelProps, MapInterface } from \"../../interface\";\nimport { LocationInternalInterface } from \"../../interface/navigation/LocationInterface\";\nimport LocationStoredClass from \"./LocationStoredClass\";\n\n/**\n * The base model of a location. I suggest you extend this class to create your own location model.\n * @example\n * ```typescript\n * export const mcHome = new LocationBaseModel('mc_home', mainMap, {\n *     name: 'MC Home',\n *     icon: \"https://icon.jpg\",\n * });\n * ```\n */\nexport default class LocationBaseModel extends LocationStoredClass implements LocationInternalInterface {\n    /**\n     * @param id The id of the location, it must be unique.\n     * @param map The map where the location is.\n     * @param props The properties of the location.\n     */\n    constructor(id: string, map: MapInterface, props: LocationBaseModelProps = {}) {\n        super(id, map, props.activities || []);\n        this.defaultName = props.name || \"\";\n        this.defaultDisabled = props.disabled || false;\n        this.defaultHidden = props.hidden || false;\n        this._icon = props.icon;\n    }\n\n    private defaultName: string;\n    /**\n     * The name of the location.\n     * If you set undefined, it will return the initial value of name.\n     */\n    get name(): string {\n        return this.getStorageProperty<string>(\"name\") || this.defaultName;\n    }\n    set name(value: string | undefined) {\n        this.setStorageProperty(\"name\", value);\n    }\n\n    private defaultDisabled: boolean | string;\n    /**\n     * Whether is disabled. If it is a string, it is a Pixi'VN flag name.\n     */\n    get disabled(): boolean {\n        let value = this.getStorageProperty<boolean>(\"disabled\") || this.defaultDisabled;\n        if (typeof value === \"string\") {\n            return storage.getFlag(value);\n        }\n        return value;\n    }\n    set disabled(value: boolean | string) {\n        this.setStorageProperty(\"disabled\", value);\n    }\n\n    private defaultHidden: boolean | string;\n    /**\n     * Whether is hidden. If it is a string, it is a Pixi'VN flag name.\n     */\n    get hidden(): boolean {\n        let value = this.getStorageProperty<boolean>(\"hidden\") || this.defaultHidden;\n        if (typeof value === \"string\") {\n            return storage.getFlag(value);\n        }\n        return value;\n    }\n    set hidden(value: boolean | string) {\n        this.setStorageProperty(\"hidden\", value);\n    }\n\n    private _icon?: string;\n    /**\n     * The icon of the location.\n     */\n    get icon(): string | undefined {\n        return this._icon;\n    }\n}\n","import { ActivityInterface, LocationInterface } from \"../../interface\";\nimport { MapBaseInternalInterface } from \"../../interface/navigation/MapInterface\";\nimport { navigator } from \"../../managers\";\nimport NavigationAbstractClass from \"./NavigationAbstractClass\";\n\nconst MAP_CATEGORY = \"__nqtr-map__\";\nexport default class MapStoredClass extends NavigationAbstractClass implements MapBaseInternalInterface {\n\tconstructor(id: string, activities: ActivityInterface[] = []) {\n\t\tsuper(MAP_CATEGORY, id, activities);\n\t}\n\n\tget locations(): LocationInterface[] {\n\t\treturn navigator.locations.filter((location) => location.map.id === this.id);\n\t}\n}\n","import { MapBaseModelProps } from \"../../interface\"\nimport { MapBaseInternalInterface } from \"../../interface/navigation/MapInterface\"\nimport MapStoredClass from \"./MapStoredClass\"\n\n/**\n * The base model of a map. I suggest you extend this class to create your own map model.\n * @example\n * ```typescript\n * export const mainMap = new MapBaseModel('main_map', {\n *     name: 'Main Map',\n *     image: \"https://image.jpg\",\n * });\n * ```\n */\nexport default class MapBaseModel extends MapStoredClass implements MapBaseInternalInterface {\n    /**\n     * @param id The id of the map, it must be unique.\n     * @param props The properties of the map. \n     */\n    constructor(id: string, props: MapBaseModelProps = {}) {\n        super(id, props.activities || [])\n        this.defaultName = props.name || \"\"\n        this._image = props.image\n    }\n\n    private defaultName: string\n    /**\n     * The name of the map.\n     * If you set undefined, it will return the initial value of name.\n     */\n    get name(): string {\n        return this.getStorageProperty<string>(\"name\") || this.defaultName\n    }\n    set name(value: string | undefined) {\n        this.setStorageProperty(\"name\", value)\n    }\n\n    private _image?: string\n    /**\n     * The image of the map.\n     */\n    get image(): string | undefined {\n        return this._image\n    }\n}\n","import { CharacterInterface } from \"@drincs/pixi-vn\";\nimport { ActivityInterface, CommitmentInterface, LocationInterface } from \"../../interface\";\nimport { RoomBaseInternalInterface } from \"../../interface/navigation/RoomInterface\";\nimport { routine } from \"../../managers\";\nimport { OnRunAsyncFunction } from \"../../types\";\nimport NavigationAbstractClass from \"./NavigationAbstractClass\";\n\nconst ROOM_CATEGORY = \"__nqtr-room__\";\nexport default class RoomStoredClass extends NavigationAbstractClass implements RoomBaseInternalInterface {\n    constructor(\n        id: string,\n        /**\n         * The location where the room is.\n         */\n        private readonly _location: LocationInterface,\n        activities: ActivityInterface[] = []\n    ) {\n        super(ROOM_CATEGORY, id, activities);\n    }\n    get routine(): CommitmentInterface[] {\n        return routine.currentRoutine.filter((c) => c.room.id === this.id);\n    }\n\n    get location(): LocationInterface {\n        return this._location;\n    }\n\n    get characters(): CharacterInterface[] {\n        let characters: CharacterInterface[] = [];\n        this.routine.forEach((commitment) => {\n            characters.push(...commitment.characters);\n        });\n        return characters;\n    }\n\n    get automaticFunction(): OnRunAsyncFunction | undefined {\n        let run = this.routine.find((commitment) => commitment.executionType === \"automatic\")?.run;\n        if (run) {\n            return async (props) => {\n                await run(props);\n            };\n        }\n        return undefined;\n    }\n}\n","import { storage } from \"@drincs/pixi-vn\";\nimport { RegisteredRooms } from \"../../decorators\";\nimport { CommitmentInterface, LocationInterface, RoomBaseModelProps } from \"../../interface\";\nimport { routine } from \"../../managers\";\nimport RoomStoredClass from \"./RoomStoredClass\";\n\n/**\n * The base model of a room. I suggest you extend this class to create your own room model.\n * **You must use the {@link RegisteredRooms.add} function to save the room in the registered rooms.**\n * @example\n * ```ts\n * export const mcRoom = new RoomBaseModel('mc_room', mcHome, {\n *     name: \"MC Room\",\n *     icon: \"https://icon.jpg\",\n *     image: \"https://image.jpg\",\n * })\n * RegisteredRooms.add(mcRoom)\n * ```\n */\nexport default class RoomBaseModel extends RoomStoredClass {\n    /**\n     * @param id The id of the room, it must be unique.\n     * @param location The location where the room is.\n     * @param props The properties of the room.\n     */\n    constructor(id: string, location: LocationInterface, props: RoomBaseModelProps = {}) {\n        super(id, location, props.activities || []);\n        this.defaultName = props.name || \"\";\n        this._image = props.image;\n        this.defaultDisabled = props.disabled || false;\n        this.defaultHidden = props.hidden || false;\n        this._icon = props.icon;\n    }\n\n    private defaultName: string;\n    /**\n     * The name.\n     * If you set undefined, it will return the initial value of name.\n     */\n    get name(): string {\n        return this.getStorageProperty<string>(\"name\") || this.defaultName;\n    }\n    set name(value: string | undefined) {\n        this.setStorageProperty(\"name\", value);\n    }\n\n    private _image?: string;\n    /**\n     * The image of the room.\n     */\n    get image(): string | undefined {\n        return this._image;\n    }\n\n    private defaultDisabled: boolean | string;\n    /**\n     * Whether is disabled. If it is a string, it is a Pixi'VN flag name.\n     */\n    get disabled(): boolean {\n        let value = this.getStorageProperty<boolean>(\"disabled\") || this.defaultDisabled;\n        if (typeof value === \"string\") {\n            return storage.getFlag(value);\n        }\n        return value;\n    }\n    set disabled(value: boolean | string) {\n        this.setStorageProperty(\"disabled\", value);\n    }\n\n    private defaultHidden: boolean | string;\n    /**\n     * Whether is hidden. If it is a string, it is a Pixi'VN flag name.\n     */\n    get hidden(): boolean {\n        let value = this.getStorageProperty<boolean>(\"hidden\") || this.defaultHidden;\n        if (typeof value === \"string\") {\n            return storage.getFlag(value);\n        }\n        return value;\n    }\n    set hidden(value: boolean | string) {\n        this.setStorageProperty(\"hidden\", value);\n    }\n\n    private _icon?: string;\n    /**\n     * The function for rendering the icon of the room.\n     */\n    get icon(): string | undefined {\n        return this._icon;\n    }\n\n    /**\n     * Get the character commitments of the room.\n     * @returns The character commitments of the room.\n     */\n    get routine(): CommitmentInterface[] {\n        return routine.currentRoutine.filter((c) => c.room.id === this.id);\n    }\n}\n","import { OnRunProps } from \"@drincs/nqtr\";\nimport { StoredClassModel } from \"@drincs/pixi-vn\";\nimport { QuestInterface, StageInterface } from \"../../interface\";\nimport { QuestBaseInternalInterface } from \"../../interface/quest/QuestInterface\";\nimport { OnRunEvent } from \"../../types\";\nimport { logger } from \"../../utils/log-utility\";\nimport StageStoredClass from \"./StageStoredClass\";\n\nconst QUEST_CATEGORY = \"__nqtr-quest__\";\nexport default class QuestStoredClass extends StoredClassModel implements QuestBaseInternalInterface {\n    constructor(\n        id: string,\n        private readonly _stages: StageInterface[],\n        props: {\n            /**\n             * The function that will be executed when the quest starts.\n             */\n            onStart?: OnRunEvent<QuestInterface>;\n            /**\n             * The function that will be executed when a stage end in the quest.\n             */\n            onNextStage?: OnRunEvent<QuestInterface>;\n        } = {}\n    ) {\n        super(QUEST_CATEGORY, id);\n        this._onStart = props.onStart;\n        this._onNextStage = props.onNextStage;\n    }\n\n    get stages(): StageInterface[] {\n        return this._stages;\n    }\n\n    get currentStageIndex(): number | undefined {\n        return this.getStorageProperty<number>(\"currentStageIndex\");\n    }\n    private set currentStageIndex(value: number | undefined) {\n        this.setStorageProperty(\"currentStageIndex\", value);\n    }\n\n    get currentStage(): StageInterface | undefined {\n        let index = this.currentStageIndex;\n        if (index === undefined || index >= this.stages.length) {\n            return undefined;\n        }\n        return this.stages[index];\n    }\n\n    get started(): boolean {\n        return this.currentStageIndex !== undefined;\n    }\n\n    get completed(): boolean {\n        if (this.currentStageIndex === undefined) {\n            return false;\n        }\n        return this.currentStageIndex > this.stages.length - 1;\n    }\n\n    get inProgress() {\n        if (this.completed) {\n            return false;\n        }\n        if (this.failed) {\n            return false;\n        }\n        return this.started;\n    }\n\n    get failed(): boolean {\n        return this.getStorageProperty<boolean>(\"failed\") || false;\n    }\n    set failed(value: boolean) {\n        this.setStorageProperty(\"failed\", value);\n    }\n\n    private _onStart?: OnRunEvent<QuestInterface>;\n    get onStart(): undefined | OnRunEvent<QuestInterface> {\n        return this._onStart;\n    }\n\n    private _onNextStage?: OnRunEvent<QuestInterface>;\n    get onNextStage(): undefined | OnRunEvent<QuestInterface> {\n        return this._onNextStage;\n    }\n\n    async start(props: OnRunProps): Promise<void> {\n        if (this.started) {\n            console.warn(`[NQTR] Quest ${this.id} is already started`);\n            return;\n        }\n        if (this.stages.length === 0) {\n            logger.error(`Quest ${this.id} has no stages`);\n            return;\n        }\n        this.currentStageIndex = 0;\n        let currentStage = this.currentStage;\n        if (currentStage && currentStage.start) {\n            this.onStart && (await this.onStart(this as any as QuestInterface, props));\n            return await currentStage.start(props);\n        } else {\n            logger.error(`Quest ${this.id} has no start stage`);\n        }\n    }\n\n    async tryToGoNextStage(props: OnRunProps): Promise<boolean> {\n        if (!this.inProgress) {\n            return false;\n        }\n        let currentStage = this.currentStage;\n        if (!currentStage) {\n            logger.error(`Quest ${this.id} has no current stage`);\n            return false;\n        }\n        if (currentStage.completed) {\n            return await this.goNextStage(props);\n        }\n        return false;\n    }\n\n    async completeCurrentStageAndGoNext(props: OnRunProps): Promise<boolean> {\n        let currentStage = this.currentStage;\n        if (!currentStage) {\n            logger.error(`Quest ${this.id} has no current stage`);\n            return false;\n        }\n        currentStage.completed = true;\n        return await this.goNextStage(props);\n    }\n\n    async goNextStage(props: OnRunProps): Promise<boolean> {\n        if (!this.inProgress) {\n            console.warn(`[NQTR] Quest ${this.id} is not in progress`);\n            return false;\n        }\n        let prevStage = this.currentStage;\n        let currentStageIndex = this.currentStageIndex;\n        if (!prevStage || currentStageIndex === undefined) {\n            logger.error(`Quest ${this.id} has no current stage`);\n            return false;\n        }\n        this.currentStageIndex = currentStageIndex + 1;\n        this.onNextStage && (await this.onNextStage(this as any as QuestInterface, props));\n        if (prevStage && prevStage.onEnd) {\n            await prevStage.onEnd(prevStage, props);\n        }\n        let nextCurrentStage = this.currentStage;\n        if (nextCurrentStage) {\n            (nextCurrentStage as any as StageStoredClass).inizialize();\n            if (this.currentStageMustStart) {\n                await this.startCurrentStage(props);\n            }\n        }\n\n        return true;\n    }\n\n    get currentStageMustStart(): boolean {\n        let currentStage = this.currentStage;\n        if (!currentStage) {\n            return false;\n        }\n        return !currentStage.started && currentStage.canStart && !currentStage.completed;\n    }\n\n    async startCurrentStage(props: OnRunProps): Promise<void> {\n        let newCurrentStage = this.currentStage;\n        if (newCurrentStage && this.currentStageMustStart) {\n            await newCurrentStage.start(props);\n        } else {\n            console.warn(`[NQTR] Quest ${this.id} can't start the current stage`);\n        }\n    }\n}\n","import { QuestProps, StageInterface } from \"../../interface\";\r\nimport QuestStoredClass from \"./QuestStoredClass\";\r\n\r\nexport default class QuestBaseModel extends QuestStoredClass {\r\n\tconstructor(id: string, stages: StageInterface[], props: QuestProps) {\r\n\t\tsuper(id, stages, { onStart: props.onStart, onNextStage: props.onNextStage });\r\n\t\tthis._name = props.name || \"\";\r\n\t\tthis._description = props.description || \"\";\r\n\t\tthis._icon = props.icon;\r\n\t\tthis._image = props.image;\r\n\t\tthis._inDevelopment = props.inDevelopment || false;\r\n\t}\r\n\r\n\tprivate _name: string;\r\n\t/**\r\n\t * The name of the quest.\r\n\t */\r\n\tget name(): string {\r\n\t\treturn this._name;\r\n\t}\r\n\r\n\tprivate _description: string;\r\n\t/**\r\n\t * The description of the quest.\r\n\t */\r\n\tget description(): string {\r\n\t\treturn this._description;\r\n\t}\r\n\r\n\tprivate _icon?: string;\r\n\t/**\r\n\t * Icon of the quest.\r\n\t */\r\n\tget icon(): string | undefined {\r\n\t\treturn this._icon;\r\n\t}\r\n\r\n\tprivate _image?: string;\r\n\t/**\r\n\t * Image of the quest.\r\n\t */\r\n\tget image(): string | undefined {\r\n\t\treturn this._image;\r\n\t}\r\n\r\n\tprivate _inDevelopment: boolean;\r\n\t/**\r\n\t * If the quest is in development.\r\n\t */\r\n\tget inDevelopment(): boolean {\r\n\t\treturn this._inDevelopment;\r\n\t}\r\n}\r\n","import { OnRunProps } from \"@drincs/nqtr\";\nimport { StoredClassModel } from \"@drincs/pixi-vn\";\nimport { StageInterface } from \"../../interface\";\nimport { StageBaseInternalInterface } from \"../../interface/quest/StageInterface\";\nimport { timeTracker } from \"../../managers\";\nimport { OnRunEvent, QuestsRequiredType } from \"../../types\";\n\nconst STAGE_CATEGORY = \"__nqtr-stage__\";\nexport default class StageStoredClass extends StoredClassModel implements StageBaseInternalInterface {\n    constructor(\n        id: string,\n        options: {\n            /**\n             * The function that will be executed when the stage starts.\n             */\n            onStart?: OnRunEvent<StageInterface>;\n            /**\n             * The function that will be executed when the stage ends.\n             */\n            onEnd?: OnRunEvent<StageInterface>;\n            /**\n             * The day required to start the stage.\n             * @example If the value is 3, and the previous stage ends on day 1, the stage will start on day 4.\n             */\n            daysRequiredToStart?: number;\n            /**\n             * The quests required to start the stage.\n             * @default []\n             */\n            questsRequiredToStart?: QuestsRequiredType[];\n        } = {}\n    ) {\n        super(STAGE_CATEGORY, id);\n        this._onStart = options.onStart;\n        this._onEnd = options.onEnd;\n        this._daysRequiredToStart = options.daysRequiredToStart;\n        this._questsRequiredToStart = options.questsRequiredToStart || [];\n    }\n\n    private _onStart?: OnRunEvent<StageInterface>;\n    get onStart(): undefined | OnRunEvent<StageInterface> {\n        return this._onStart;\n    }\n\n    private _onEnd?: OnRunEvent<StageInterface>;\n    get onEnd(): undefined | OnRunEvent<StageInterface> {\n        return this._onEnd;\n    }\n\n    get completed(): boolean {\n        return this.getStorageProperty<boolean>(\"completed\") || false;\n    }\n    set completed(value: boolean) {\n        this.setStorageProperty(\"completed\", value);\n    }\n\n    get started(): boolean {\n        return this.getStorageProperty<boolean>(\"started\") || false;\n    }\n    set started(value: boolean) {\n        this.setStorageProperty(\"started\", value);\n    }\n\n    private get prevStageEndDay(): number | undefined {\n        return this.getStorageProperty<number>(\"prevStageEndDay\");\n    }\n    private set prevStageEndDay(value: number | undefined) {\n        this.setStorageProperty(\"prevStageEndDay\", value);\n    }\n\n    get startDay(): number | undefined {\n        let prevStageEndDay = this.prevStageEndDay;\n        if (prevStageEndDay === undefined) {\n            return undefined;\n        }\n        return prevStageEndDay + this.daysRequiredToStart;\n    }\n\n    get canStart(): boolean {\n        let daysRequired = this.daysRequiredToStart;\n        if (daysRequired > 0) {\n            let prevStageEndDay = this.prevStageEndDay;\n            if (prevStageEndDay === undefined) {\n                return false;\n            }\n            if (prevStageEndDay + daysRequired > timeTracker.currentDay) {\n                return false;\n            }\n        }\n        if (\n            this.questsRequiredToStart.length > 0 &&\n            !this.questsRequiredToStart.every(\n                (q) => q.quest.currentStageIndex && q.quest.currentStageIndex >= q.stageNumber\n            )\n        ) {\n            return false;\n        }\n        return true;\n    }\n\n    inizialize() {\n        if (this.daysRequiredToStart > 0) {\n            this.prevStageEndDay = timeTracker.currentDay;\n            console.log(`[NQTR] Stage ${this.id} will start on day ${this.startDay}`);\n        }\n    }\n\n    async start(props: OnRunProps) {\n        if (this.canStart) {\n            this.started = true;\n            if (this.onStart) {\n                await this.onStart(this as any as StageInterface, props);\n            }\n        } else {\n            console.warn(`[NQTR] Stage ${this.id} can't start`);\n        }\n    }\n\n    private _daysRequiredToStart?: number;\n    get daysRequiredToStart(): number {\n        return this._daysRequiredToStart || 0;\n    }\n\n    private _questsRequiredToStart: QuestsRequiredType[];\n    get questsRequiredToStart(): QuestsRequiredType[] {\n        return this._questsRequiredToStart || [];\n    }\n}\n","import { storage } from \"@drincs/pixi-vn\";\nimport { StageProps } from \"../../interface\";\nimport StageFlags from \"../../interface/quest/StageFlags\";\nimport StageStoredClass from \"./StageStoredClass\";\n\nexport default class StageBaseModel extends StageStoredClass {\n    constructor(id: string, props: StageProps) {\n        super(id, {\n            onStart: props.onStart,\n            onEnd: props.onEnd,\n            daysRequiredToStart: props.daysRequiredToStart,\n            questsRequiredToStart: props.questsRequiredToStart,\n        });\n        this._name = props.name || \"\";\n        this._flags = props.flags || [];\n        this._description = props.description || \"\";\n        this._adviceDescription = props.adviceDescription || \"\";\n        this._image = props.image;\n        this._flagsRequiredToStart = props.flagsRequiredToStart || [];\n        this._requestDescriptionToStart = props.requestDescriptionToStart || \"\";\n    }\n\n    private _name: string;\n    /**\n     * The name of the stage.\n     */\n    get name(): string {\n        return this._name;\n    }\n\n    private _description: string;\n    /**\n     * The description of the stage.\n     */\n    get description(): string {\n        return this._description;\n    }\n\n    private _adviceDescription: string;\n    /**\n     * The advice description of the stage.\n     */\n    get adviceDescription(): string {\n        return this._adviceDescription;\n    }\n\n    private _image?: string;\n    /**\n     * The image of the stage.\n     */\n    get image(): string | undefined {\n        return this._image;\n    }\n\n    private _flags: StageFlags[];\n    /**\n     * The list of flags that the player must complete to finish the stage.\n     */\n    get flags(): StageFlags[] {\n        return this._flags;\n    }\n\n    private _flagsRequiredToStart: StageFlags[];\n    /**\n     * The list of flags required to start the stage.\n     */\n    get flagsRequiredToStart(): StageFlags[] {\n        return this._flagsRequiredToStart;\n    }\n\n    private _requestDescriptionToStart: string;\n    /**\n     * The description of the request to start the stage.\n     */\n    get requestDescriptionToStart(): string {\n        return this._requestDescriptionToStart;\n    }\n\n    override get completed(): boolean {\n        if (super.completed) {\n            return true;\n        }\n        if (this.flags.length > 0) {\n            if (!this.flags.every((flag) => storage.getFlag(flag.flag))) {\n                return false;\n            }\n            return true;\n        }\n        return false;\n    }\n    override set completed(value: boolean) {\n        super.completed = value;\n    }\n    override get canStart(): boolean {\n        if (\n            this.flagsRequiredToStart.length > 0 &&\n            !this.flagsRequiredToStart.every((flag) => storage.getFlag(flag.flag))\n        ) {\n            return false;\n        }\n        return super.canStart;\n    }\n}\n","export type { default as ActivityInterface } from \"./ActivityInterface\";\nexport type { default as ActivityProps } from \"./ActivityProps\";\nexport type { default as CommitmentInterface } from \"./CommitmentInterface\";\nexport type { default as CommitmentProps } from \"./CommitmentProps\";\nexport type { default as LocationBaseModelProps } from \"./navigation/LocationBaseModelProps\";\nexport type { default as LocationInterface } from \"./navigation/LocationInterface\";\nexport type { default as MapBaseModelProps } from \"./navigation/MapBaseModelProps\";\nexport type { default as MapInterface } from \"./navigation/MapInterface\";\nexport type { default as RoomBaseModelProps } from \"./navigation/RoomBaseModelProps\";\nexport type { default as RoomInterface } from \"./navigation/RoomInterface\";\nexport type { default as QuestInterface } from \"./quest/QuestInterface\";\nexport type { default as QuestProps } from \"./quest/QuestProps\";\nexport type { default as StageInterface } from \"./quest/StageInterface\";\nexport type { default as StageProps } from \"./quest/StageProps\";\n","export type { default as ExecutionType } from \"./ExecutionType\";\nexport type { OnRunAsyncFunction, OnRunEvent, OnRunFunction, OnRunProps } from \"./OnRunEvent\";\nexport type { QuestsRequiredType } from \"./QuestsRequired\";\nexport type { ITimeStlot, TimeSettings } from \"./TimeSettings\";\n","export * from \"./classes\";\nexport * from \"./decorators\";\nexport * from \"./interface\";\nexport * from \"./managers\";\nexport * from \"./types\";\n\nimport * as classes from \"./classes\";\nimport * as decorators from \"./decorators\";\nimport * as interfaceNqtr from \"./interface\";\nimport * as managers from \"./managers\";\nimport * as types from \"./types\";\n\nconst nqtr = {\n    ...classes,\n    ...decorators,\n    ...interfaceNqtr,\n    ...managers,\n    ...types,\n};\nexport default nqtr;\n"]}