{"version":3,"sources":["../../src/constants.ts","../../src/managers/TimeManagerSettings.ts","../../src/managers/TimeManager.ts","../../src/managers/index.ts","../../src/classes/ActivityStoredClass.ts","../../src/classes/CommitmentStoredClass.ts"],"names":["TIME_DATA_KEY","TimeManagerSettings","TimeManager","settings","minDayHours","maxDayHours","defaultTimeSpent","timeSlots","weekLength","weekendStartDay","weekDaysNames","data","storage","value","weekDayNumber","index","slot","timeSpent","newHour","newDayHour","days","newDay","fromHour","toHour","currentHour","timeTracker","navigator","ACTIVITY_CATEGORY","ActivityStoredClass","StoredClassModel","id","_onRun","props","category","COMMITMENT_CATEGORY","CommitmentStoredClass","_characters","_room","onRun"],"mappings":"uDACO,IAAMA,CAAgB,CAAA,8BAAA,CCC7B,IAAqBC,CAArB,CAAA,KAAiE,CAC7D,OAAO,WAAA,CAAsB,CAC7B,CAAA,OAAO,YAAsB,EAC7B,CAAA,OAAO,iBAA2B,CAClC,CAAA,OAAO,UAA0B,EAAC,CAClC,OAAO,UAAA,CAAqB,EAC5B,OAAO,eAAA,CAA0B,IAAK,CAAA,UAAA,CAAa,EACnD,OAAO,aAAA,CAA0B,EACrC,ECJA,IAAqBC,CAAAA,CAArB,KAAiC,CAC7B,UAAA,CAAWC,EAAwB,CAC/B,GAAM,CACF,WAAA,CAAAC,EAAc,CACd,CAAA,WAAA,CAAAC,EAAc,EACd,CAAA,gBAAA,CAAAC,EAAmB,CACnB,CAAA,SAAA,CAAAC,CAAY,CAAA,GACZ,UAAAC,CAAAA,CAAAA,CAAa,EACb,eAAAC,CAAAA,CAAAA,CAAkBD,EAAa,CAC/B,CAAA,aAAA,CAAAE,CAAgB,CAAA,EACpB,CAAIP,CAAAA,CAAAA,CACJF,CAAoB,CAAA,WAAA,CAAcG,EAClCH,CAAoB,CAAA,WAAA,CAAcI,CAClCJ,CAAAA,CAAAA,CAAoB,iBAAmBK,CACvCL,CAAAA,CAAAA,CAAoB,UAAYM,CAChCN,CAAAA,CAAAA,CAAoB,WAAaO,CAC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OE,CAAAA,CAAmB,EAb1B,IAAAE,CAAAA,WAAAA,CAAAA,CAAAA,CACA,WAAAC,CAajB,CAAA,IAAA,CAAK,qBAAuBL,CAAM,CAAA,aAAA,EAAiB,aACnD,CAAA,IAAA,CAAK,gBAAkBA,CAAM,CAAA,SACjC,CACiB,oBACA,CAAA,eAAA,CAEjB,IAAI,UAAmC,EAAA,CACnC,OAAO,IAAA,CAAK,WAChB,CAEA,IAAI,MAAsB,CACtB,OAAO,KAAK,KAChB,CAEA,IAAI,aAAA,EAA+B,CAC/B,OAAO,IAAA,CAAK,mBAAkC,eAAe,CAAA,EAAK,KAAK,oBAC3E,CACA,IAAI,aAAA,CAAcnB,EAAsB,CACpC,IAAA,CAAK,mBAAmB,eAAiBA,CAAAA,CAAK,EAClD,CAEA,IAAI,QAAmB,EAAA,CACnB,OAAO,IAAK,CAAA,kBAAA,CAA2B,UAAU,CAAK,EAAA,IAAA,CAAK,iBAAmB,CAClF,CACA,IAAI,QAAA,CAASA,EAAe,CACxB,IAAA,CAAK,mBAAmB,UAAYA,CAAAA,CAAK,EAC7C,CACJ","file":"CommitmentStoredClass.mjs","sourcesContent":["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","import { StoredClassModel } from \"@drincs/pixi-vn\";\nimport { ActivityInterface } from \"../interface\";\nimport { ActivityBaseInternalInterface } from \"../interface/ActivityInterface\";\nimport { timeTracker } from \"../managers\";\nimport { OnRunEvent, OnRunProps } from \"../types/OnRunEvent\";\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(): (props: OnRunProps) => void {\n        return (props) => this._onRun(this as any, props);\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 { 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"]}