Files
red-valley/cache/files/t1ger_mechanic/resource.rpf

21055 lines
2.0 MiB
Plaintext
Raw Normal View History

2026-03-29 21:41:17 +03:00
RPF2K<00><00><00><00><00> <00> <00><00>
<00><00>
<00>?<00><00>A<00> G<00><00> <00> <00>/<00>A<00><00><00>J<00>_<00>w<00>$<00> (<00> 6<00>sP<00>sT<00>l~ 2  2<00><00>f8<00>f8$<00>,<00>-`<00>-5&<00>y*<00><00>-<00>+9<00><00>o<00>o<00><00>X<00><00><00>
x<00>
<00><00>
<00><00>
<00><00> <00><00> <00><00><00><00><00>d<00>d<00><00>
<00><00>
<00>0<00>#j#8j#>?)<00>?)L.<00>.]I1<00>I1f<00>:(<00>:<00><00>wh<00>w<00><00>U<00><00>U<00><00>E8<00>E<00> ~<00> ~<00><00><00><00><00>- <00>-<00>1<00><00>0P0<00><00><00><00><00><00>;<00><00>;<00><00> <00><00> <00>z<00>z00""<00>(<00>7<00>6H<00>6F<00>l<00><00>lTf<00>f]bXbj<Vh<Vu<00>
<00><00>
<00>cX<00>cX<00><00>^X<00>^<00><00>^<00><00>^<00><00> <00><00><00>)0 <00>)<00>^` ^<00>tx t<00><00>4<00> <00>4 I<00>9<00><00><00><00><><00> <00><>&<00>x<00>/.fxapbridgeconfig.luaframeworkclient.luagarageclient.luainit.luainventoryclient.luanotificationclient.luatargetclient.luaclientactionsflatbedtow.luaflipvehicle.luaimpoundvehicle.luamenu.luapropemotes.luapushvehicle.luaunlockvehicle.luacarjack.luacarliftsclass.luamain.luamain.luamissionsbreakdown.luacarscrapping.luamain.luaroadsiderepair.luarepairsbody.luafunctions.luamain.luashopadmin.luabilling.luamain.luamarkersboss.luaduty.luagarage.luagetoutfit.luamarkers.luastorage.luasupplier.luaworkbench.luavehicledatadiagnostic.luafunctions.luamain.luapatchkit.luarepair.luaservicehistory.luaworkflow.luafxmanifest.lualocalesen.jsonro.jsonsharedconfig.luamissions.luaparts.luashop.luasupplier.luaworkbench.luawebassetsindex-BFWVRtXt.jsindex-DD8EL8nh.cssindex.htmlFXAP
<EFBFBD>ek<1C><><EFBFBD>Ij<49>b<EFBFBD><62><EFBFBD><EFBFBD> <06>!<21>؅no<6E>1<EFBFBD>h<EFBFBD><68> VD@Snz<6E><7A><EFBFBD>ȵ7<C8B5>_0<5F><30>2^&<15>v2<76>|<03><><EFBFBD><EFBFBD>Q!Es<45>f<EFBFBD><66><13><>ʁ4S<34>
<17><><EFBFBD>H<EFBFBD><48>]O<><4F>z<EFBFBD>k<EFBFBD><6B>R@j<>n<EFBFBD>H<EFBFBD>ͪ<EFBFBD>Ӌ<EFBFBD><D38B><EFBFBD><EFBFBD><12>^<5E><><EFBFBD><EFBFBD>K<EFBFBD>@<40>ߡ0<06>yw|<7C><><EFBFBD><EFBFBD><EFBFBD>'8<><38><EFBFBD>j<EFBFBD>@<40><42><DF88><EFBFBD><EFBFBD><EFBFBD>xBridge = {
-- Framework Selection
Framework = "auto", -- "esx", "qbcore", "qbox", or "auto" (auto-detect)
-- Inventory System Selection
Inventory = "auto", -- "auto" (auto-detect) or one of:
-- "ox_inventory"
-- "qb-inventory"
-- "qs-inventory"
-- "core_inventory"
-- "codem-inventory"
-- "origen_inventory"
-- "ak47_inventory"
-- "ak47_qb_inventory"
-- "tgiann-inventory"
-- Targeting System Selection
Target = "auto", -- "ox_target", "qb-target", or "auto"
-- Society/Shared Account for Job
JobAccount = "auto", -- "auto" (auto-detect) or one of:
-- "esx_addonaccount"
-- "qb-banking"
-- "qb-management"
-- "Renewed-Banking"
-- "tgg-banking"
-- "okokBanking"
-- "wasabi_banking"
-- "fd_banking"
-- "crm-banking"
-- "snipe-banking"
-- "RxBanking"
-- Garage System Selection
Garage = "auto", -- "auto" (auto-detect) or one of:
-- "esx_garage"
-- "qbx_garages"
-- "qb-garages"
-- "jg-advancedgarages"
-- "cd_garage"
-- "okokGarage"
-- "codem-garage"
-- "rcore_garage"
-- "renzu_garage"
-- "qs-advancedgarages"
-- "ak47_garage"
-- "loaf_garage"
-- Vehicle Keys System Selection
VehicleKeys = "auto", -- "auto" (auto-detect) or one of:
-- "qbx_vehiclekeys"
-- "qb-vehiclekeys"
UseFrameworkVehicleProps = true, -- "uses my built-in improved vehicle properties, else use framework's vehicle properties"
TrimPlates = true, -- trimplates is default in ESX/QBCore/Qbox inside vehicle props.
-- Notifications System
Notification = "ox_lib", -- "ox_lib", "esx", "qbcore" or modify functions inside bridge/notification/
-- Debug Mode (Enables verbose logging)
Debug = false
}
-- List of pre-supported inventories. Add your inventory in here in case you are adding compatibility with an unsupported inventory system.
Bridge.CompatibleInventories = {
"ox_inventory",
"qb-inventory",
"qs-inventory",
"core_inventory",
"codem-inventory",
"origen_inventory",
"ak47_inventory",
"ak47_qb_inventory",
"tgiann-inventory"
}
-- List of pre-supported targeting systems. Add your targeting system in here in case you are adding compatibility with an unsupported targeting system.
Bridge.CompatibleTargets = {
"ox_target",
"qb-target"
}
-- List of pre-supported job account systems for given frameworks. Add your own for your framework below.
Bridge.CompatibleJobAccounts = {
esx = {"esx_addonaccount", "okokBanking", "wasabi_banking", "crm-banking", "snipe-banking", "RxBanking"},
qbox = {"Renewed-Banking", "tgg-banking", "fd_banking", "crm-banking", "RxBanking"},
qbcore = {"qb-banking", "qb-management", "okokBanking", "wasabi_banking", "fd_banking", "crm-banking", "snipe-banking", "RxBanking"}
}
-- List of pre-supported garage systems. Add your garage system in here in case you are adding compatibility with an unsupported garage system.
Bridge.CompatibleGarages = {
"esx_garage",
"qbx_garages",
"qb-garages",
"jg-advancedgarages",
"cd_garage",
"okokGarage",
"codem-garage",
"rcore_garage",
"renzu_garage",
"qs-advancedgarages",
"ak47_garage",
"loaf_garage"
}
Bridge.CompatibleVehicleKeys = {
"qbx_vehiclekeys",
"qb-vehiclekeys",
"t1ger_keys",
"qs-vehiclekeys"
}_API = {}
-- Player Class: Handles all player-related functions dynamically across frameworks.
Player = {}
Player.__index = Player
PlayerLoaded = false
function _API.GetPlayerData()
if Framework == "esx" or Framework == "qbox" then
return _FW[Framework]:GetPlayerData()
elseif Framework == "qbcore" then
return _FW[Framework].Functions.GetPlayerData()
end
end
--- Function to return item label for a specified item
---@param item string Name of the item
---@return table itemLabel label of the specifield item
function _API.GetItemLabel(item)
if type(item) ~= "string" or item == "" then
return error("[_API.GetItemLabel] Invalid item type. Expected a non-empty string!")
end
if Framework == "esx" then
local inventory = Player:GetInventory() -- ESX does not have a way to check items on clients, so checking user inventory
if not inventory or not inventory[item] then return end
return inventory[item].label
elseif Framework == "qbox" then
local itemInfo = exports["ox_inventory"]:Items(item)
if not itemInfo then return end
return itemInfo.label
elseif Framework == "qbcore" then
local itemInfo = _FW[Framework].Shared.Items[item]
if not itemInfo then return end
return itemInfo.label
end
end
--- Function to get player inventory & check for specified amount of item
---@param item string Name of the item
---@param count number Amount to check for
---@return boolean hasItem `true` if has specified amount of item. `false` otherwise
function _API.HasItem(item, count)
if type(item) ~= "string" or item == "" then
return error("[API.HasItem] Invalid item type. Expected a non-empty string!")
end
if type(count) ~= "number" then
return error("[API.HasItem] Invalid count type. Expected a number!")
end
local inventory = Player:GetInventory()
if not inventory[item] then return false end
return inventory[item].count >= count
end
--- Constructor: Initializes a Player object
function Player.new()
local self = setmetatable({}, Player)
self.data = {} -- Stores full player data from the framework
self.job = {} -- Stores a standardized job table
self.charId = nil -- Stores character ID (citizenid, steam ID, etc.)
self.charName = "" -- Stores player character name
self.isAdmin = false -- Stores whether player is admin or not
return self
end
--- Function to fetch player data dynamically
function Player:GetPlayerData()
while Framework == nil or _FW[Framework] == nil do
Wait(10)
end
while not _API.GetPlayerData() or not _API.GetPlayerData().job do
Wait(10)
end
self.data = _API.GetPlayerData()
self.isAdmin = lib.callback.await("t1ger_mechanic:server:isAdmin", false)
-- Update player properties
self:UpdatePlayerData(self.data)
end
--- Function to standardize and update player data across all frameworks
function Player:UpdatePlayerData(data)
if not data then return end
self.data = data
if Framework == "esx" then
self.charId = data.identifier
self.charName = ('%s %s'):format(data.firstName, data.lastName)
elseif Framework == "qbcore" or Framework == "qbox" then
self.charId = data.citizenid
self.charName = ('%s %s'):format(data.charinfo.firstname, data.charinfo.lastname)
end
-- Standardize Job Data
self:UpdateJob(data.job or {})
end
--- Function to update job data into a standardized format
function Player:UpdateJob(jobData, lastJob)
-- Extract job information
local grade, gradeLabel, onDuty = 0, "None", nil
if Framework == "esx" then
grade = tonumber(jobData.grade)
gradeLabel = jobData.grade_label
onDuty = jobData.onDuty or nil
elseif Framework == "qbcore" or Framework == "qbox" then
grade = tonumber(jobData.grade.level)
gradeLabel = jobData.grade.name
onDuty = jobData.onduty
end
-- Store standardized job data
self.job = {
name = jobData.name,
label = jobData.label,
grade = grade,
gradeLabel = gradeLabel,
onDuty = onDuty
}
end
--- Function to get the player's job
function Player:GetJob()
return self.job
end
-- Function to get the player's inventory/items
function Player:GetInventory()
local playerData = _API.GetPlayerData()
while not playerData.job do Wait(10) end
local items, inventory = {}, {}
if Framework == "esx" then
items = playerData.inventory
elseif Framework == "qbox" or Framework == "qbcore" then
items = playerData.items
end
for _,itemData in pairs(items) do
inventory[itemData.name] = {
name = itemData.name,
label = itemData.label,
count = itemData.amount or itemData.count or 0,
info = itemData.info or itemData.metadata or false
}
end
self.inventory = inventory
return inventory
end
-- Initialize Player Class Instance
_API.Player = Player.new()
--- Function called when a player fully loads into the game
local function OnPlayerLoaded()
_API.Player:GetPlayerData() -- Fetch updated player data
if _API.Player.data and next(_API.Player.data) then
PlayerLoaded = true
TriggerEvent("t1ger_mechanic:client:playerLoaded")
else
error("[OnPlayerLoaded] Player data failed to load!")
end
end
--- Function called when a player logs out/unloads
local function OnPlayerUnload()
PlayerLoaded = false
_API.Player = Player.new() -- Reset player object
end
--- Function called when a players job is updated
---@param job table Job information from framework
local function OnJobUpdate(job, lastJob)
_API.Player:UpdateJob(job, lastJob)
-- Wait
Wait(1000)
-- Trigger job update event
TriggerEvent('t1ger_mechanic:client:onJobUpdate', _API.Player:GetJob())
end
--- Function called when a framework updates the players data
---@param data table Updated player data from framework
local function OnPlayerDataUpdate(data)
if not data or next(data) == nil then
_API.Player:GetPlayerData()
else
_API.Player:UpdatePlayerData(data)
end
end
--- Function to handle resource restarts (checks if player is already loaded)
local function OnResourceStart(resourceName)
if GetCurrentResourceName() ~= resourceName then return end
while Framework == nil or _FW[Framework] == nil do
Wait(500)
end
Wait(1000) -- Allow time for framework to initialize
_API.Player:GetPlayerData()
if _API.Player.data and next(_API.Player.data) then
PlayerLoaded = true
TriggerEvent("t1ger_mechanic:client:playerLoaded")
else
error("[OnResourceStart] Player data failed to load!")
end
end
-- ## EVENTS ## --
RegisterNetEvent("esx:playerLoaded", function(xPlayer)
OnPlayerLoaded()
end)
RegisterNetEvent("esx:onPlayerLogout", function()
OnPlayerUnload()
end)
RegisterNetEvent("esx:setJob", function(job, lastJob)
OnJobUpdate(job, lastJob)
end)
RegisterNetEvent("esx:setPlayerData", function(key, value)
if _API.Player.data and key then
_API.Player.data[key] = value
_API.Player:UpdatePlayerData(_API.Player.data)
else
OnPlayerDataUpdate()
end
end)
RegisterNetEvent("QBCore:Client:OnPlayerLoaded", function()
OnPlayerLoaded()
end)
RegisterNetEvent("qbx_core:client:playerLoggedOut", function()
OnPlayerUnload()
end)
RegisterNetEvent("QBCore:Client:OnJobUpdate", function(job)
OnJobUpdate(job)
end)
RegisterNetEvent("QBCore:Player:SetPlayerData", function(val)
OnPlayerDataUpdate(val)
end)
RegisterNetEvent("QBCore:Client:OnPlayerUnload", function()
OnPlayerUnload()
end)
RegisterNetEvent("QBCore:Client:UpdateObject", function()
_FW[Framework] = exports["qb-core"]:GetCoreObject()
end)
--- event handler on resource start:
AddEventHandler("onResourceStart", function(resourceName)
OnResourceStart(resourceName)
end)
local gameBuild = GetGameBuildNumber()
--- Trims leading and trailing spaces from a plate string.
-- Ensures that plate numbers are formatted correctly to prevent inconsistencies in database lookups.
---@param input string The plate string to be trimmed.
---@return string trimmedPlate The trimmed plate string.
local function TrimPlate(input)
if type(input) ~= "string" or input == "" then
error("[TrimPlate] Invalid input type. Expected a non-empty string")
end
return string.gsub(input, "^%s*(.-)%s*$", "%1")
end
exports("TrimPlate", TrimPlate)
_API.VehicleWheels = {
["2"] = { -- Bike and cycle.
["0"] = {label = "Wheel Front", bone = "wheel_lf", index = 0, wheelId = 0},
["4"] = {label = "Wheel Rear", bone = "wheel_lr", index = 4, wheelId = 1},
},
["3"] = { -- Vehicle with 3 wheels (get for wheels because some 3 wheels vehicles have 2 wheels on front and one rear or the reverse).
["0"] = {label = "Wheel Front (L)", bone = "wheel_lf", index = 0, wheelId = 0},
["1"] = {label = "Wheel Front (R)", bone = "wheel_rf", index = 1, wheelId = 1},
["4"] = {label = "Wheel Rear (L)", bone = "wheel_lr", index = 4, wheelId = 2},
["5"] = {label = "Wheel Rear (R)", bone = "wheel_rr", index = 5, wheelId = 3},
},
["4"] = { -- Vehicle with 4 wheels.
["0"] = {label = "Wheel Front (L)", bone = "wheel_lf", index = 0, wheelId = 0},
["1"] = {label = "Wheel Front (R)", bone = "wheel_rf", index = 1, wheelId = 1},
["4"] = {label = "Wheel Rear (L)", bone = "wheel_lr", index = 4, wheelId = 2},
["5"] = {label = "Wheel Rear (R)", bone = "wheel_rr", index = 5, wheelId = 3},
},
["6"] = { -- Vehicle with 6 wheels.
["0"] = {label = "Wheel Front (L)", bone = "wheel_lf", index = 0, wheelId = 0},
["1"] = {label = "Wheel Front (R)", bone = "wheel_rf", index = 1, wheelId = 1},
["2"] = {label = "Wheel Middle (L)", bone = "wheel_lm1", index = 2, wheelId = 4},
["3"] = {label = "Wheel Middle (R)", bone = "wheel_rm1", index = 3, wheelId = 5},
["4"] = {label = "Wheel Rear (L)", bone = "wheel_lr", index = 4, wheelId = 2},
["5"] = {label = "Wheel Rear (R)", bone = "wheel_rr", index = 5, wheelId = 3},
},
["8"] = { -- Vehicle with 8 wheels.
["0"] = {label = "Wheel Front (L)", bone = "wheel_lf", index = 0, wheelId = 0},
["1"] = {label = "Wheel Front (R)", bone = "wheel_rf", index = 1, wheelId = 1},
["2"] = {label = "Wheel Middle (L)", bone = "wheel_lm1", index = 2, wheelId = 4},
["3"] = {label = "Wheel Middle (R)", bone = "wheel_rm1", index = 3, wheelId = 5},
["4"] = {label = "Wheel Rear (L)", bone = "wheel_lr", index = 4, wheelId = 2},
["5"] = {label = "Wheel Rear (R)", bone = "wheel_rr", index = 5, wheelId = 3},
},
}
_API.VehicleDoors = {
["0"] = {label = "Door Front (L)", bone = "door_dside_f", bone2 = "seat_dside_f", index = 0},
["1"] = {label = "Door Front (R)", bone = "door_pside_f", bone2 = "seat_pside_f", index = 1},
["2"] = {label = "Door Rear (L)", bone = "door_dside_r", bone2 = "seat_dside_r", index = 2},
["3"] = {label = "Door Rear (R)", bone = "door_pside_r", bone2 = "seat_pside_r", index = 3},
["4"] = {label = "Hood", bone = "bonnet", index = 4},
["5"] = {label = "Trunk", bone = "boot", index = 5},
}
_API.VehicleWindows = {
["0"] = {label = "Window Front (L)", bone = "window_lf", index = 0},
["1"] = {label = "Window Front (R)", bone = "window_rf", index = 1},
["2"] = {label = "Window Rear (L)", bone = "window_lr", index = 2},
["3"] = {label = "Window Rear (R)", bone = "window_rr", index = 3},
["6"] = {label = "Windscreen Front", bone = "windscreen", index = 6},
["7"] = {label = "Windscreen Rear", bone = "windscreen_r", index = 7},
}
--- Function to spawn vehicle
---@param model number The vehicle model
function _API.SpawnVehicle(model, vehicleCoords, heading, warp, cb, networked)
if Framework == "esx" then
_FW[Framework].Game.SpawnVehicle(model, vehicleCoords, heading, cb, networked)
elseif Framework == "qbox" then
local netId = lib.callback.await("t1ger_mechanic:server:spawnVehicle", false, model, vehicleCoords, heading, warp)
if not netId then cb(0) end
local vehicle = lib.waitFor(function()
if NetworkDoesEntityExistWithNetworkId(netId) then
return NetToVeh(netId)
end
end)
if cb then
cb(vehicle)
end
elseif Framework == "qbcore" then
_FW[Framework].Functions.SpawnVehicle(model, cb, coords, networked)
end
end
--- Function to delete vehicle
---@param vehicle number The vehicle handle
function _API.DeleteVehicle(vehicle)
if Framework == "esx" then
_FW[Framework].Game.DeleteVehicle(vehicle)
elseif Framework == "qbox" then
qbx.deleteVehicle(vehicle)
elseif Framework == "qbcore" then
_FW[Framework].Functions.DeleteVehicle(vehicle)
end
end
--- Adds keys to player for a given vehicle
--- @param vehicle number The vehicle entity handle
function _API.GiveVehicleKeys(vehicle)
local plate = GetVehicleNumberPlateText(vehicle)
if type(plate) ~= "string" or not plate:match("%S") then return end
if not _VehicleKeys then return end
if _VehicleKeys == "qbx_vehiclekeys" then
lib.callback.await("qbx_vehiclekeys:server:giveKeys", false, VehToNet(vehicle))
elseif _VehicleKeys == "qb-vehiclekeys" then
TriggerEvent("vehiclekeys:client:SetOwner", plate)
elseif _VehicleKeys == "t1ger_keys" then
TriggerServerEvent("t1ger_keys:updateOwnedKeys", plate, true)
elseif _VehicleKeys == "qs-vehiclekeys" then
local model = GetDisplayNameFromVehicleModel(GetEntityModel(vehicle))
exports["qs-vehiclekeys"]:GiveKeys(plate, model)
else
-- add your own custom vehicle keys export/event in here to add keys
end
end
--- Remove keys from a player for a given vehicle
--- @param vehicle number The vehicle entity handle
function _API.RemoveVehicleKeys(vehicle)
local plate = GetVehicleNumberPlateText(vehicle)
if type(plate) ~= "string" or not plate:match("%S") then return end
if not _VehicleKeys then return end
if _VehicleKeys == "t1ger_keys" then
TriggerServerEvent("t1ger_keys:updateOwnedKeys", plate, false)
elseif _VehicleKeys == "qs-vehiclekeys" then
local model = GetDisplayNameFromVehicleModel(GetEntityModel(vehicle))
exports["qs-vehiclekeys"]:RemoveKeys(plate, model)
else
-- add your own custom vehicle keys export/event in here to remove keys
end
end
--- Function to set vehicle properties
---@param vehicle number The vehicle handle
---@param props table The vehicle properties
function _API.SetVehicleProperties(vehicle, props)
if Bridge.UseFrameworkVehicleProps then
if Framework == "esx" then
_FW[Framework].Game.SetVehicleProperties(vehicle, props)
elseif Framework == "qbox" then
lib.setVehicleProperties(vehicle, props)
elseif Framework == "qbcore" then
_FW[Framework].Functions.SetVehicleProperties(vehicle, props)
end
else
local ent = Entity(vehicle).state
ent:set("t1ger_mechanic:setVehicleProps", props, true)
end
end
--- Function to get vehicle properties
---@param vehicle number The vehicle handle
---@return props table The vehicle properties
function _API.GetVehicleProperties(vehicle)
if Bridge.UseFrameworkVehicleProps then
if Framework == "esx" then
return _FW[Framework].Game.GetVehicleProperties(vehicle)
elseif Framework == "qbox" then
return lib.getVehicleProperties(vehicle)
elseif Framework == "qbcore" then
return _FW[Framework].Functions.GetVehicleProperties(vehicle)
end
else
return GetCustomVehicleProperties(vehicle)
end
end
--- Function to get vehicle fuel level
---@param vehicle number The vehicle handle
---@return fuelLevel number The fuel level
function _API.GetVehicleFuel(vehicle)
return GetVehicleFuelLevel(vehicle)
end
--- Function to set vehicle fuel level
---@param vehicle number The vehicle entity handle
---@param fuelLevel number The fuel level to set
function _API.SetVehicleFuel(vehicle, fuel)
SetVehicleFuelLevel(vehicle, fuel)
end
--- Function to impound a vehicle
---@param vehicle number The vehicle entity handle
function _API.ImpoundVehicle(vehicle)
local props = _API.GetVehicleProperties(vehicle)
-- if u have a custom client export/event, then use that and comment out this trigger server event
TriggerServerEvent("t1ger_mechanic:server:impoundVehicle", props.plate, props)
-- delete the vehicle? Comment out if your own export/event deletes a vehicle
_API.DeleteVehicle(vehicle)
end
--- Custom function to retrieve vehicle properties
---@param vehicle number the vehicle handle
---@return props table the properties of the vehicle
function GetCustomVehicleProperties(vehicle)
if DoesEntityExist(vehicle) then
---@type number | number[], number | number[]
local colorPrimary, colorSecondary = GetVehicleColours(vehicle)
local pearlescentColor, wheelColor = GetVehicleExtraColours(vehicle)
local paintType1 = GetVehicleModColor_1(vehicle)
local paintType2 = GetVehicleModColor_2(vehicle)
-- Custom Colors:
if GetIsVehiclePrimaryColourCustom(vehicle) then
colorPrimary = { GetVehicleCustomPrimaryColour(vehicle) }
end
if GetIsVehicleSecondaryColourCustom(vehicle) then
colorSecondary = { GetVehicleCustomSecondaryColour(vehicle) }
end
-- Custom Xenon (RGB):
local hasCustomXenon, customXenonR, customXenonG, customXenonB = GetVehicleXenonLightsCustomColor(vehicle)
local customXenon = nil
if hasCustomXenon then
customXenon = {customXenonR, customXenonG, customXenonB}
end
local extras = {}
for i = 0, 14 do
if DoesExtraExist(vehicle, i) then
extras[tostring(i)] = IsVehicleExtraTurnedOn(vehicle, i) and 0 or 1
end
end
local modLiveryCount = (GetVehicleLiveryCount(vehicle) - 1)
local modLivery = GetVehicleLivery(vehicle)
if modLiveryCount <= 0 or modLivery == -1 then
modLivery = GetVehicleMod(vehicle, 48)
end
local vehicleWindows = {}
for index = 0, 7 do
RollUpWindow(vehicle, index)
vehicleWindows[tostring(index)] = IsVehicleWindowIntact(vehicle, index) and 1 or 2
end
local vehicleDoors = {}
local numDoors = GetNumberOfVehicleDoors(vehicle)
if numDoors and numDoors > 0 then
for doorId = 0, numDoors do
vehicleDoors[tostring(doorId)] = IsVehicleDoorDamaged(vehicle, doorId) and 2 or 1
end
end
local vehicleTyres = {}
local numWheels = GetVehicleNumberOfWheels(vehicle)
if numWheels and numWheels > 0 then
for wheelIndex,v in pairs(_API.VehicleWheels[tostring(numWheels)]) do
vehicleTyres[wheelIndex] = IsVehicleTyreBurst(vehicle, v.index, false) and 2 or 1
end
end
local neons = {}
for i = 0, 3 do
neons[tostring(i)] = IsVehicleNeonLightEnabled(vehicle, i)
end
local plate = GetVehicleNumberPlateText(vehicle)
return {
model = GetEntityModel(vehicle),
plate = Bridge.TrimPlates and TrimPlate(plate) or plate,
plateIndex = GetVehicleNumberPlateTextIndex(vehicle),
bodyHealth = math.floor(GetVehicleBodyHealth(vehicle) + 0.5),
engineHealth = math.floor(GetVehicleEngineHealth(vehicle) + 0.5),
tankHealth = math.floor(GetVehiclePetrolTankHealth(vehicle) + 0.5),
fuelLevel = math.floor(GetVehicleFuelLevel(vehicle) + 0.5),
oilLevel = math.floor(GetVehicleOilLevel(vehicle) + 0.5),
dirtLevel = math.floor(GetVehicleDirtLevel(vehicle) + 0.5),
paintType1 = paintType1,
paintType2 = paintType2,
color1 = colorPrimary,
color2 = colorSecondary,
pearlescentColor = pearlescentColor,
interiorColor = GetVehicleInteriorColor(vehicle),
dashboardColor = GetVehicleDashboardColour(vehicle),
wheelColor = wheelColor,
wheelWidth = GetVehicleWheelWidth(vehicle),
wheelSize = GetVehicleWheelSize(vehicle),
wheels = GetVehicleWheelType(vehicle),
windowTint = GetVehicleWindowTint(vehicle),
xenonColor = GetVehicleXenonLightsColor(vehicle),
customXenon = customXenon,
neonEnabled = neons,
neonColor = { GetVehicleNeonLightsColour(vehicle) },
extras = extras,
tyreSmokeColor = { GetVehicleTyreSmokeColor(vehicle) },
modSpoilers = GetVehicleMod(vehicle, 0),
modFrontBumper = GetVehicleMod(vehicle, 1),
modRearBumper = GetVehicleMod(vehicle, 2),
modSideSkirt = GetVehicleMod(vehicle, 3),
modExhaust = GetVehicleMod(vehicle, 4),
modFrame = GetVehicleMod(vehicle, 5),
modGrille = GetVehicleMod(vehicle, 6),
modHood = GetVehicleMod(vehicle, 7),
modFender = GetVehicleMod(vehicle, 8),
modRightFender = GetVehicleMod(vehicle, 9),
modRoof = GetVehicleMod(vehicle, 10),
modEngine = GetVehicleMod(vehicle, 11),
modBrakes = GetVehicleMod(vehicle, 12),
modTransmission = GetVehicleMod(vehicle, 13),
modHorns = GetVehicleMod(vehicle, 14),
modSuspension = GetVehicleMod(vehicle, 15),
modArmor = GetVehicleMod(vehicle, 16),
modNitrous = GetVehicleMod(vehicle, 17),
modTurbo = IsToggleModOn(vehicle, 18),
modSubwoofer = GetVehicleMod(vehicle, 19),
modSmokeEnabled = IsToggleModOn(vehicle, 20),
modHydraulics = IsToggleModOn(vehicle, 21),
modXenon = IsToggleModOn(vehicle, 22),
modFrontWheels = GetVehicleMod(vehicle, 23),
modBackWheels = GetVehicleMod(vehicle, 24),
modCustomTiresF = GetVehicleModVariation(vehicle, 23),
modCustomTiresR = GetVehicleModVariation(vehicle, 24),
modPlateHolder = GetVehicleMod(vehicle, 25),
modVanityPlate = GetVehicleMod(vehicle, 26),
modTrimA = GetVehicleMod(vehicle, 27),
modOrnaments = GetVehicleMod(vehicle, 28),
modDashboard = GetVehicleMod(vehicle, 29),
modDial = GetVehicleMod(vehicle, 30),
modDoorSpeaker = GetVehicleMod(vehicle, 31),
modSeats = GetVehicleMod(vehicle, 32),
modSteeringWheel = GetVehicleMod(vehicle, 33),
modShifterLeavers = GetVehicleMod(vehicle, 34),
modAPlate = GetVehicleMod(vehicle, 35),
modSpeakers = GetVehicleMod(vehicle, 36),
modTrunk = GetVehicleMod(vehicle, 37),
modHydrolic = GetVehicleMod(vehicle, 38),
modEngineBlock = GetVehicleMod(vehicle, 39),
modAirFilter = GetVehicleMod(vehicle, 40),
modStruts = GetVehicleMod(vehicle, 41),
modArchCover = GetVehicleMod(vehicle, 42),
modAerials = GetVehicleMod(vehicle, 43),
modTrimB = GetVehicleMod(vehicle, 44),
modTank = GetVehicleMod(vehicle, 45),
modWindows = GetVehicleMod(vehicle, 46),
modDoorR = GetVehicleMod(vehicle, 47),
modLivery = modLivery,
modRoofLivery = GetVehicleRoofLivery(vehicle),
modLightbar = GetVehicleMod(vehicle, 49),
vehicleWindows = vehicleWindows,
vehicleDoors = vehicleDoors,
vehicleTyres = vehicleTyres,
bulletProofTyres = GetVehicleTyresCanBurst(vehicle),
driftTyres = gameBuild >= 2372 and GetDriftTyresEnabled(vehicle),
-- no setters?
-- leftHeadlight = GetIsLeftVehicleHeadlightDamaged(vehicle),
-- rightHeadlight = GetIsRightVehicleHeadlightDamaged(vehicle),
-- frontBumper = IsVehicleBumperBrokenOff(vehicle, true),
-- rearBumper = IsVehicleBumperBrokenOff(vehicle, false),
}
end
end
exports("GetCustomVehicleProperties", GetCustomVehicleProperties)
--- Custom function to set vehicle properties using statebag
---@param vehicle number the vehicle handle
---@param props table the properties of the vehicle
local function SetCustomVehicleProperties(vehicle, props)
local ent = Entity(vehicle).state
ent:set("t1ger_mechanic:setVehicleProps", props, true)
end
exports("SetCustomVehicleProperties", SetCustomVehicleProperties)
--- Custom function to set vehicle properties
---@param vehicle number the vehicle handle
---@param props table the properties of the vehicle
local function SetVehicleProperties(vehicle, props)
if not DoesEntityExist(vehicle) then
return
end
local colorPrimary, colorSecondary = GetVehicleColours(vehicle)
local pearlescentColor, wheelColor = GetVehicleExtraColours(vehicle)
SetVehicleModKit(vehicle, 0)
if props.extras then
for id, toggle in pairs(props.extras) do
local extraId = tonumber(id)
if type(toggle) == "boolean" then
if toggle then
SetVehicleExtra(vehicle, extraId, 0)
else
SetVehicleExtra(vehicle, extraId, 1)
end
else
SetVehicleExtra(vehicle, extraId, toggle)
end
end
end
if props.plate then
SetVehicleNumberPlateText(vehicle, props.plate)
end
if props.plateIndex then
SetVehicleNumberPlateTextIndex(vehicle, props.plateIndex)
end
if props.bodyHealth then
SetVehicleBodyHealth(vehicle, props.bodyHealth + 0.0)
end
if props.engineHealth then
SetVehicleEngineHealth(vehicle, props.engineHealth + 0.0)
end
if props.tankHealth then
SetVehiclePetrolTankHealth(vehicle, props.tankHealth + 0.0)
end
if props.fuelLevel then
SetVehicleFuelLevel(vehicle, props.fuelLevel + 0.0)
end
if props.oilLevel then
SetVehicleOilLevel(vehicle, props.oilLevel + 0.0)
end
if props.dirtLevel then
SetVehicleDirtLevel(vehicle, props.dirtLevel + 0.0)
end
if props.color1 then
if type(props.color1) == "number" then
ClearVehicleCustomPrimaryColour(vehicle)
SetVehicleModColor_1(vehicle, props.paintType1, props.color1, pearlescentColor)
SetVehicleColours(vehicle, props.color1, type(props.color2) == "number" and props.color2 or colorSecondary)
else
if props.paintType1 then
SetVehicleModColor_1(vehicle, props.paintType1, 0, pearlescentColor)
end
ClearVehicleCustomPrimaryColour(vehicle)
SetVehicleCustomPrimaryColour(vehicle, props.color1[1], props.color1[2], props.color1[3])
end
end
if props.color2 then
if type(props.color2) == "number" then
ClearVehicleCustomSecondaryColour(vehicle)
SetVehicleModColor_2(vehicle, props.paintType2, props.color2)
SetVehicleColours(vehicle, type(props.color1) == "number" and props.color1 or colorPrimary, props.color2)
if type(props.color1) ~= "number" then
SetVehicleModColor_1(vehicle, props.paintType1, 0, pearlescentColor)
end
else
if props.paintType2 then
SetVehicleModColor_2(vehicle, props.paintType2, 0)
end
SetVehicleCustomSecondaryColour(vehicle, props.color2[1], props.color2[2], props.color2[3])
end
end
if props.pearlescentColor or props.wheelColor then
SetVehicleExtraColours(vehicle, props.pearlescentColor or pearlescentColor, props.wheelColor or wheelColor)
end
if props.interiorColor then
SetVehicleInteriorColor(vehicle, props.interiorColor)
end
if props.dashboardColor then
SetVehicleDashboardColor(vehicle, props.dashboardColor)
end
if props.wheels then
SetVehicleWheelType(vehicle, props.wheels)
end
if props.wheelSize then
SetVehicleWheelSize(vehicle, props.wheelSize)
end
if props.wheelWidth then
SetVehicleWheelWidth(vehicle, props.wheelWidth)
end
if props.windowTint then
SetVehicleWindowTint(vehicle, props.windowTint)
end
if props.neonEnabled then
for k,v in pairs(props.neonEnabled) do
SetVehicleNeonLightEnabled(vehicle, tonumber(k), v)
end
end
if props.vehicleWindows then
for index, state in pairs(props.vehicleWindows) do
if state == 2 then
RemoveVehicleWindow(vehicle, tonumber(index))
end
end
end
if props.vehicleDoors then
for index, state in pairs(props.vehicleDoors) do
if state == 2 then
SetVehicleDoorBroken(vehicle, tonumber(index), true)
end
end
end
if props.vehicleTyres then
for index, state in pairs(props.vehicleTyres) do
if state == 2 then
SetVehicleTyreBurst(vehicle, tonumber(index), true, 1000.0)
end
end
end
if props.neonColor then
SetVehicleNeonLightsColour(vehicle, props.neonColor[1], props.neonColor[2], props.neonColor[3])
end
if props.modSmokeEnabled ~= nil then
ToggleVehicleMod(vehicle, 20, props.modSmokeEnabled)
end
if props.tyreSmokeColor then
SetVehicleTyreSmokeColor(vehicle, props.tyreSmokeColor[1], props.tyreSmokeColor[2], props.tyreSmokeColor[3])
end
if props.modSpoilers then
SetVehicleMod(vehicle, 0, props.modSpoilers, false)
end
if props.modFrontBumper then
SetVehicleMod(vehicle, 1, props.modFrontBumper, false)
end
if props.modRearBumper then
SetVehicleMod(vehicle, 2, props.modRearBumper, false)
end
if props.modSideSkirt then
SetVehicleMod(vehicle, 3, props.modSideSkirt, false)
end
if props.modExhaust then
SetVehicleMod(vehicle, 4, props.modExhaust, false)
end
if props.modFrame then
SetVehicleMod(vehicle, 5, props.modFrame, false)
end
if props.modGrille then
SetVehicleMod(vehicle, 6, props.modGrille, false)
end
if props.modHood then
SetVehicleMod(vehicle, 7, props.modHood, false)
end
if props.modFender then
SetVehicleMod(vehicle, 8, props.modFender, false)
end
if props.modRightFender then
SetVehicleMod(vehicle, 9, props.modRightFender, false)
end
if props.modRoof then
SetVehicleMod(vehicle, 10, props.modRoof, false)
end
if props.modEngine then
SetVehicleMod(vehicle, 11, props.modEngine, false)
end
if props.modBrakes then
SetVehicleMod(vehicle, 12, props.modBrakes, false)
end
if props.modTransmission then
SetVehicleMod(vehicle, 13, props.modTransmission, false)
end
if props.modHorns then
SetVehicleMod(vehicle, 14, props.modHorns, false)
end
if props.modSuspension then
SetVehicleMod(vehicle, 15, props.modSuspension, false)
end
if props.modArmor then
SetVehicleMod(vehicle, 16, props.modArmor, false)
end
if props.modNitrous then
SetVehicleMod(vehicle, 17, props.modNitrous, false)
end
if props.modTurbo ~= nil then
ToggleVehicleMod(vehicle, 18, props.modTurbo)
end
if props.modSubwoofer ~= nil then
ToggleVehicleMod(vehicle, 19, props.modSubwoofer)
end
if props.modHydraulics ~= nil then
ToggleVehicleMod(vehicle, 21, props.modHydraulics)
end
if props.modXenon ~= nil then
ToggleVehicleMod(vehicle, 22, props.modXenon)
end
if props.xenonColor then
if type(props.xenonColor) == "table" then
props.customXenon = {props.xenonColor[1], props.xenonColor[2], props.xenonColor[3]}
SetVehicleXenonLightsCustomColor(vehicle, props.customXenon[1], props.customXenon[2], props.customXenon[3])
else
ClearVehicleXenonLightsCustomColor(vehicle)
SetVehicleXenonLightsColor(vehicle, props.xenonColor)
end
end
if props.customXenon ~= nil or props.customXenonColor ~= nil then
props.customXenon = props.customXenonColor ~= nil and props.customXenonColor or props.customXenon
SetVehicleXenonLightsCustomColor(vehicle, props.customXenon[1], props.customXenon[2], props.customXenon[3])
end
if props.modFrontWheels then
SetVehicleMod(vehicle, 23, props.modFrontWheels, props.modCustomTiresF)
end
if props.modBackWheels then
SetVehicleMod(vehicle, 24, props.modBackWheels, props.modCustomTiresR)
end
if props.modPlateHolder then
SetVehicleMod(vehicle, 25, props.modPlateHolder, false)
end
if props.modVanityPlate then
SetVehicleMod(vehicle, 26, props.modVanityPlate, false)
end
if props.modTrimA then
SetVehicleMod(vehicle, 27, props.modTrimA, false)
end
if props.modOrnaments then
SetVehicleMod(vehicle, 28, props.modOrnaments, false)
end
if props.modDashboard then
SetVehicleMod(vehicle, 29, props.modDashboard, false)
end
if props.modDial then
SetVehicleMod(vehicle, 30, props.modDial, false)
end
if props.modDoorSpeaker then
SetVehicleMod(vehicle, 31, props.modDoorSpeaker, false)
end
if props.modSeats then
SetVehicleMod(vehicle, 32, props.modSeats, false)
end
if props.modSteeringWheel then
SetVehicleMod(vehicle, 33, props.modSteeringWheel, false)
end
if props.modShifterLeavers then
SetVehicleMod(vehicle, 34, props.modShifterLeavers, false)
end
if props.modAPlate then
SetVehicleMod(vehicle, 35, props.modAPlate, false)
end
if props.modSpeakers then
SetVehicleMod(vehicle, 36, props.modSpeakers, false)
end
if props.modTrunk then
SetVehicleMod(vehicle, 37, props.modTrunk, false)
end
if props.modHydrolic then
SetVehicleMod(vehicle, 38, props.modHydrolic, false)
end
if props.modEngineBlock then
SetVehicleMod(vehicle, 39, props.modEngineBlock, false)
end
if props.modAirFilter then
SetVehicleMod(vehicle, 40, props.modAirFilter, false)
end
if props.modStruts then
SetVehicleMod(vehicle, 41, props.modStruts, false)
end
if props.modArchCover then
SetVehicleMod(vehicle, 42, props.modArchCover, false)
end
if props.modAerials then
SetVehicleMod(vehicle, 43, props.modAerials, false)
end
if props.modTrimB then
SetVehicleMod(vehicle, 44, props.modTrimB, false)
end
if props.modTank then
SetVehicleMod(vehicle, 45, props.modTank, false)
end
if props.modWindows then
SetVehicleMod(vehicle, 46, props.modWindows, false)
end
if props.modDoorR then
SetVehicleMod(vehicle, 47, props.modDoorR, false)
end
if props.modLivery then
SetVehicleMod(vehicle, 48, props.modLivery, false)
SetVehicleLivery(vehicle, props.modLivery)
end
if props.modRoofLivery then
SetVehicleRoofLivery(vehicle, props.modRoofLivery)
end
if props.modLightbar then
SetVehicleMod(vehicle, 49, props.modLightbar, false)
end
if props.bulletProofTyres ~= nil then
SetVehicleTyresCanBurst(vehicle, props.bulletProofTyres)
end
if gameBuild >= 2372 and props.driftTyres ~= nil then
SetDriftTyresEnabled(vehicle, props.driftTyres)
if type(props.driftTyres) == "boolean" and props.driftTyres == true or props.driftTyres == 1 then
SetReduceDriftVehicleSuspension(vehicle, true)
else
SetReduceDriftVehicleSuspension(vehicle, false)
end
end
end
--- state bag change handler for setting vehicle props
AddStateBagChangeHandler("t1ger_mechanic:setVehicleProps" --[[key filter]], nil --[[bag filter]], function(bagName, key, value, _unused, replicated)
Wait(0)
if replicated then return end
if not value then return end
local net = tonumber(bagName:gsub("entity:", ""), 10)
local vehicle = net and NetworkGetEntityFromNetworkId(net)
if DoesEntityExist(vehicle) then
SetVehicleProperties(vehicle, value)
end
end)Framework, _Framework, _Inventory, _Target, _JobAccount, _Garage, _VehicleKeys = nil, nil, nil, nil, nil, nil, nil -- Global variables for framework, inventory, targeting, job account, garage and vehicle keys systems
_FW = {} -- Stores framework objects dynamically
_DB = nil -- global variables for framework's database table/column names
local qbx = nil
-- List of supported frameworks (DO NOT MODIFY)
local supportedFrameworks = {
{
name = "esx",
resource = "es_extended",
db = {playerTable = "users", playerColumn = "identifier", vehicleTable = "owned_vehicles", vehiclePropsColumn = "vehicle", vehicleOwnerColumn = "owner"},
getter = function() return exports["es_extended"]:getSharedObject() end
},
{
name = "qbox",
resource = "qbx_core",
db = {playerTable = "players", playerColumn = "citizenid", vehicleTable = "player_vehicles", vehiclePropsColumn = "mods", vehicleOwnerColumn = "citizenid"},
getter = function() return setmetatable({}, {
__index = function(_, key) return function(...) return exports["qbx_core"][key](...) end end
}) end
},
{
name = "qbcore",
resource = "qb-core",
db = {playerTable = "players", playerColumn = "citizenid", vehicleTable = "player_vehicles", vehiclePropsColumn = "mods", vehicleOwnerColumn = "citizenid"},
getter = function() return exports["qb-core"]:GetCoreObject() end
}
}
--- Function to Initialize the Framework
local function InitializeFramework()
if Bridge.Framework ~= "auto" then
for _, fw in ipairs(supportedFrameworks) do
if fw.name == Bridge.Framework and GetResourceState(fw.resource) == "started" then
_FW[fw.name] = fw.getter()
_DB = fw.db
if fw.name == "qbox" then
qbx = require("@qbx_core/modules/lib")
end
_Framework = fw.resource
return fw.name
end
end
return error(string.format("[InitializeFramework] Specified framework (%s) is not running!", Bridge.Framework))
end
for _, fw in ipairs(supportedFrameworks) do
if GetResourceState(fw.resource) == "started" then
_FW[fw.name] = fw.getter()
_DB = fw.db
local currentVersion = GetResourceMetadata(fw.resource, "version", 0)
if fw.name == "qbox" then
qbx = require("@qbx_core/modules/lib")
end
_Framework = fw.resource
return fw.name
end
end
error("[InitializeFramework] No supported framework detected. The script requires ESX, QBCore, or QBX to function.")
end
--- Function to Initialize the Inventory System
local function InitializeInventory()
if Bridge.Inventory ~= "auto" then
if GetResourceState(Bridge.Inventory) == "started" then
return Bridge.Inventory
else
error(string.format("[InitializeInventory] Specified inventory (%s) is not running!", Bridge.Inventory))
end
end
for _, inv in ipairs(Bridge.CompatibleInventories) do
if GetResourceState(inv) == "started" then
return inv
end
end
error("[InitializeInventory] No supported inventory system detected!")
end
--- Function to Initialize the Targeting System
local function InitializeTarget()
if Bridge.Target ~= "auto" then
if GetResourceState(Bridge.Target) == "started" then
return Bridge.Target
else
error(string.format("[InitializeTarget] Specified targeting system (%s) is not running!", Bridge.Target))
end
end
for _, target in ipairs(Bridge.CompatibleTargets) do
if GetResourceState(target) == "started" then
return target
end
end
error("[InitializeTarget] No supported targeting system detected. The script requires Ox Target or QB Target")
end
--- Function to Initialize the job account System
local function InitializeJobAccount()
if Bridge.JobAccount ~= "auto" then
if GetResourceState(Bridge.JobAccount) == "started" then
return Bridge.JobAccount
else
error(string.format("[InitializeJobAccount] Specified job account system (%s) is not running!", Bridge.JobAccount))
end
end
if not Bridge.CompatibleJobAccounts[Framework] then
error(string.format("[InitializeJobAccount] Unsupported framework detected: %s", Framework))
end
-- Loop through the prioritized list for the detected framework
for _, jobAccount in ipairs(Bridge.CompatibleJobAccounts[Framework]) do
if GetResourceState(jobAccount) == "started" then
return jobAccount
end
end
error("[InitializeJobAccount] No supported job account system detected.")
end
--- Function to Initialize the Garage System
local function InitializeGarage()
if Bridge.Garage ~= "auto" then
if GetResourceState(Bridge.Garage) == "started" then
return Bridge.Garage
else
error(string.format("[InitializeGarage] Specified garage system (%s) is not running!", Bridge.Garage))
end
end
for _, garage in ipairs(Bridge.CompatibleGarages) do
if GetResourceState(garage) == "started" then
return garage
end
end
return nil
end
--- Function to Initialize the Vehicle Keys System
local function InitializeVehicleKeys()
if Bridge.VehicleKeys ~= "auto" then
if GetResourceState(Bridge.VehicleKeys) == "started" then
return Bridge.VehicleKeys
else
error(string.format("[InitializeVehicleKeys] Specified vehicle keys system (%s) is not running!", Bridge.VehicleKeys))
end
end
for _, vehicleKey in ipairs(Bridge.CompatibleVehicleKeys) do
if GetResourceState(vehicleKey) == "started" then
return vehicleKey
end
end
return nil
end
CreateThread(function()
Wait(1000)
Framework = InitializeFramework()
_Inventory = InitializeInventory()
_Target = InitializeTarget()
_JobAccount = InitializeJobAccount()
_Garage = InitializeGarage()
_VehicleKeys = InitializeVehicleKeys()
-- print(string.format("^5[DETECTED SYSTEMS]^7 %s | %s | %s | %s", _Framework, _Inventory, _Target, _JobAccount))
if _Garage then
-- print(string.format("^5[DETECTED GARAGE SYSTEM]^7 %s", _Garage))
end
if _VehicleKeys then
-- print(string.format("^5[DETECTED VEHICLE KEYS SYSTEM]^7 %s", _VehicleKeys))
end
end)_API.Inventory = {}
_API.Stash = {}
--- Returns item label for a specified item name.
--- @param item string The name of the item to check. Must be a non-empty string.
--- @return string itemLabel The label of the specified item
function _API.Inventory.GetItemLabel(item)
if type(item) ~= "string" or item == "" then
return error("[_API.Inventory.GetItemLabel] Invalid item type. Expected a non-empty string!")
end
if _Inventory == "ox_inventory" then
local itemInfo = exports[_Inventory]:Items(item)
if not itemInfo then return end
return itemInfo.label
elseif _Inventory == "qb-inventory" then
local itemInfo = _FW[Framework].Shared.Items[item]
if not itemInfo then return end
return itemInfo.label
elseif _Inventory == "qs-inventory" then
local itemList = exports[_Inventory]:GetItemList()
if not itemList or not itemList[item] then return end
return itemList[item].label
elseif _Inventory == "core_inventory" then
-- no available exports
return _API.GetItemLabel(item)
elseif _Inventory == "origen_inventory" then
-- exports deprecated
return _API.GetItemLabel(item)
elseif _Inventory == "codem-inventory" then
local itemList = exports[_Inventory]:GetItemList()
if not itemList or not itemList[item] then return end
return itemList[item].label
elseif _Inventory == "ak47_inventory" or _Inventory == "ak47_qb_inventory" then
return exports[_Inventory]:GetItemLabel(item)
elseif _Inventory == "tgiann-inventory" then
return exports[_Inventory]:GetItemLabel(item)
elseif _Inventory == "custom" then
-- add custom function in here
else
-- fallback to framework method:
return _API.GetItemLabel(item)
end
end
--- Returns true/false on whether player has specified count of item.
--- @param item string The name of the item to check. Must be a non-empty string.
--- @param count number The amount of the item to check. Must be a number.
--- @return boolean hasItem `true` if has specified count of item. `false` otherwise
function _API.Inventory.HasItem(item, count)
if type(item) ~= "string" or item == "" then
return error("[_API.Inventory.HasItem] Invalid item type. Must be a non-empty string for the item name")
end
if type(count) ~= "number" then
return error("[_API.Inventory.HasItem] Invalid count type. Must be a number")
end
if _Inventory == "ox_inventory" then
return exports[_Inventory]:Search("count", item) >= count
elseif _Inventory == "qb-inventory" then
return exports[_Inventory]:HasItem(item, count)
elseif _Inventory == "qs-inventory" then
local quantity = exports[_Inventory]:Search(item) or 0
return quantity >= count
elseif _Inventory == "core_inventory" then
return exports[_Inventory]:hasItem(item, count)
elseif _Inventory == "origen_inventory" then
local quantity = exports[_Inventory]:Search("count", item) or 0
return quantity >= count
elseif _Inventory == "codem-inventory" then
local userInventory = exports[_Inventory]:getUserInventory()
local quantity = 0
for _, itemData in pairs(userInventory) do
if itemData.name == item then
quantity = quantity + (itemData.amount or itemData.count or 0)
end
end
return quantity >= count
elseif _Inventory == "ak47_inventory" or _Inventory == "ak47_qb_inventory" then
local hasItems, missingItems = exports[_Inventory]:HasItems({[tostring(item)] = count})
return hasItems
elseif _Inventory == "tgiann-inventory" then
return exports[_Inventory]:Search("count", item) >= count
elseif _Inventory == "custom" then
-- add custom function in here
else
-- fallback to framework method:
return _API.HasItem(item, count)
end
end
--- Function to open a stash inventory
--- @param id string The unique identifier for the stash
--- @param label string The label or name of the stash
--- @param slots number The number of slots available in the stash
--- @param weight number The maximum weight capacity of the stash
--- @param owner string|nil The owner of the stash (optional)
function _API.Stash.Open(id, label, slots, weight, owner)
if _Inventory == "ox_inventory" then
exports[_Inventory]:openInventory("stash", {id = id})
elseif _Inventory == "qb-inventory" then
TriggerServerEvent("t1ger_mechanic:server:openStash", id, label, slots, weight, owner)
-- if using old qb-inventory, then comment out the TriggerServerEvent and uncomment the below events:
--[[TriggerServerEvent("inventory:server:OpenInventory", "stash", id, {maxweight = weight, slots = slots})
TriggerEvent("inventory:client:SetCurrentStash", id)]]
elseif _Inventory == "qs-inventory" then
TriggerServerEvent("inventory:server:OpenInventory", "stash", "Stash_"..id, {maxweight = weight, slots = slots})
TriggerEvent("inventory:client:SetCurrentStash", "Stash_"..id)
elseif _Inventory == "core_inventory" then
TriggerServerEvent("core_inventory:server:openInventory", "stash-"..id:gsub("/",""):gsub(":",""):gsub("#",""), "stash", nil, nil)
elseif _Inventory == "codem-inventory" then
TriggerServerEvent("codem-inventory:server:openstash", id, slots, weight, label)
elseif _Inventory == "origen_inventory" then
exports[_Inventory]:openInventory('stash', id, {
label = label
})
elseif _Inventory == "ak47_inventory" or _Inventory == "ak47_qb_inventory" then
exports[_Inventory]:OpenInventory(id)
elseif _Inventory == "tgiann-inventory" then
exports[_Inventory]:OpenInventory("stash", id, {maxweight = weight, slots = slots})
else
-- add event/export in here to open stash
error("[OpenStash] No Inventory configured to open stash...")
end
end--- Validates and converts a notification type based on the configured notification system.
--- Ensures the given notification type is correctly mapped to the respective framework.
--- @param _type string The notification type to validate (e.g., "inform", "success", "error").
--- @return string The corresponding notification type for the selected framework.
local function ValidateNotifyType(_type)
--- Table defining allowed notification types for different frameworks.
local allowedTypes = {
["ox_lib"] = {
["inform"] = "inform",
["success"] = "success",
["error"] = "error"
},
["esx"] = {
["inform"] = "info",
["success"] = "success",
["error"] = "error"
},
["qbcore"] = {
["inform"] = "primary",
["success"] = "success",
["error"] = "error"
}
}
-- Check if the selected notification system exists in the allowed types table.
if allowedTypes[Bridge.Notification] then
-- Validate if the given notification type exists, otherwise return the default type.
if type(_type) == "string" and allowedTypes[Bridge.Notification][_type] then
return allowedTypes[Bridge.Notification][_type]
else
return allowedTypes[Bridge.Notification]["inform"] -- Default to "inform" type.
end
else
error("[ValidateNotifyType] Notification is not configured..")
end
end
--- Displays a notification using the configured notification framework.
--- Supports `ox_lib`, `esx`, and `qbcore` notification systems.
--- @param text string The message to be displayed in the notification.
--- @param type string The type of notification (e.g., "inform", "success", "error").
--- @param data table|nil Optional parameters (e.g., duration, title, position, style, icon, iconColor).
function _API.ShowNotification(text, type, data)
-- Validate and convert the notification type for the respective framework.
local notificationType = ValidateNotifyType(type)
local duration = data and data.duration or 3000 -- Default duration: 4000ms
if Bridge.Notification == "ox_lib" then
-- Display notification using ox_lib.
lib.notify({
title = data and data.title or nil,
description = text,
type = notificationType,
duration = duration,
position = data and data.position or 'top',
style = data and data.style or nil,
icon = data and data.icon or nil,
iconColor = data and data.iconColor or nil
})
elseif Bridge.Notification == "esx" and Framework == Bridge.Notification then
-- Display notification using ESX framework.
_FW[Framework].ShowNotification(text, notificationType, duration)
elseif Bridge.Notification == "qbcore" and Framework == Bridge.Notification then
-- Display notification using QB-Core framework.
_FW[Framework].Functions.Notify(text, notificationType, duration)
else
error("[_API.ShowNotification] Notification is not configured..")
end
end
--- Event handler for displaying notifications from the server.
--- Listens for the `t1ger_mechanic:client:notification` event and calls `_API.ShowNotification`.
--- @param text string The notification message.
--- @param type string The type of notification (e.g., "inform", "success", "error").
--- @param data table|nil Optional parameters for customizing the notification.
RegisterNetEvent('t1ger_mechanic:client:notification', function(text, type, data)
_API.ShowNotification(text, type, data)
end)
---Displays an advanced notification using with icon. Texture dictionary and texture name parameters are usually the same exact value.
---@param textureDict string The texture dictionary for the icon.
---@param textureName string The texture name for the icon.
---@param iconType number The icon type (1 : Chat Box, 2 : Email, 3 : Add Friend Request, 4 : Nothing, 5 : Nothing, 6 : Nothing, 7 : Right Jumping Arrow, 8 : RP Icon, 9 : $ Icon )
---@param title string The notification title (is the very top header)
---@param showInBrief boolean show the notification in brief
---@param subtitle string The notification subtitle (is the header under the sender)
---@param message string the notification message
function _API.ShowAdvancedNotification(textureDict, textureName, iconType, title, showInBrief, subtitle, message)
RequestStreamedTextureDict(textureDict)
BeginTextCommandThefeedPost("STRING")
AddTextComponentSubstringPlayerName(message)
EndTextCommandThefeedPostMessagetext(textureDict, textureName, false, iconType, title, subtitle)
EndTextCommandThefeedPostTicker(false, showInBrief)
end_API.Target = {}
---Creates new targetable options for all Object entity types
---@param options table A list of target options, where each option is a table containing:
--- - label (string): The text displayed for the option.
--- - name (string): A unique identifier for the target option (only for ox_target).
--- - icon (string): The icon associated with the target option.
--- - distance (number): The maximum interaction distance.
--- - canInteract (function): A function(entity, distance) that determines if interaction is allowed.
--- - onSelect (function): A function(entity) triggered when the option is selected.
--- - event (string | nil): The event triggered instead of onSelect (if applicable).
function _API.Target.AddGlobalObject(options)
if _Target == "ox_target" then
local formattedOptions = {}
for _, opt in ipairs(options) do
table.insert(formattedOptions, {
label = opt.label,
name = opt.name,
icon = opt.icon,
distance = opt.distance,
canInteract = function(entity, distance, coords, name, bone)
return opt.canInteract and opt.canInteract(entity, distance)
end,
onSelect = opt.onSelect and function(data)
opt.onSelect(data.entity)
end or nil,
event = opt.event or nil,
})
end
exports[_Target]:addGlobalObject(formattedOptions)
elseif _Target == "qb-target" then
local formattedOptions = {}
for _, opt in ipairs(options) do
table.insert(formattedOptions, {
event = opt.event or nil,
icon = opt.icon,
label = opt.label,
action = opt.onSelect and function(entity)
opt.onSelect(entity)
end or nil,
canInteract = function(entity, distance, data)
return opt.canInteract and opt.canInteract(entity, distance)
end,
})
end
exports[_Target]:AddGlobalObject({
options = formattedOptions,
distance = options[1].distance
})
end
end
---Creates new targetable options for all Vehicle entity types.
---@param options table A list of target options, where each option is a table containing:
--- - label (string): The text displayed for the option.
--- - name (string): A unique identifier for the target option (only for ox_target).
--- - icon (string): The icon associated with the target option.
--- - distance (number): The maximum interaction distance.
--- - canInteract (function): A function(entity, distance) that determines if interaction is allowed.
--- - onSelect (function): A function(entity) triggered when the option is selected.
--- - event (string | nil): The event triggered instead of onSelect (if applicable).
function _API.Target.AddGlobalVehicle(options)
if _Target == "ox_target" then
local formattedOptions = {}
for _, opt in ipairs(options) do
table.insert(formattedOptions, {
label = opt.label,
name = opt.name,
icon = opt.icon,
distance = opt.distance,
canInteract = function(entity, distance, coords, name, bone)
return opt.canInteract and opt.canInteract(entity, distance)
end,
onSelect = opt.onSelect and function(data)
opt.onSelect(data.entity)
end or nil,
event = opt.event or nil,
})
end
exports[_Target]:addGlobalVehicle(formattedOptions)
elseif _Target == "qb-target" then
local formattedOptions = {}
for _, opt in ipairs(options) do
table.insert(formattedOptions, {
event = opt.event or nil,
icon = opt.icon,
label = opt.label,
action = opt.onSelect and function(entity)
opt.onSelect(entity)
end or nil,
canInteract = function(entity, distance, data)
return opt.canInteract and opt.canInteract(entity, distance)
end,
})
end
exports[_Target]:AddGlobalVehicle({
options = formattedOptions,
distance = options[1].distance
})
end
end
---Creates new targetable options for all Ped entity types (excluding players).
---@param options table A list of target options, where each option is a table containing:
--- - label (string): The text displayed for the option.
--- - name (string): A unique identifier for the target option (only for ox_target).
--- - icon (string): The icon associated with the target option.
--- - distance (number): The maximum interaction distance.
--- - canInteract (function): A function(entity, distance) that determines if interaction is allowed.
--- - onSelect (function): A function(entity) triggered when the option is selected.
--- - event (string | nil): The event triggered instead of onSelect (if applicable).
function _API.Target.AddGlobalPed(options)
if _Target == "ox_target" then
local formattedOptions = {}
for _, opt in ipairs(options) do
table.insert(formattedOptions, {
label = opt.label,
name = opt.name,
icon = opt.icon,
distance = opt.distance,
canInteract = function(entity, distance, coords, name, bone)
return opt.canInteract and opt.canInteract(entity, distance)
end,
onSelect = opt.onSelect and function(data)
opt.onSelect(data.entity)
end or nil,
event = opt.event or nil,
})
end
exports[_Target]:addGlobalPed(formattedOptions)
elseif _Target == "qb-target" then
local formattedOptions = {}
for _, opt in ipairs(options) do
table.insert(formattedOptions, {
event = opt.event or nil,
icon = opt.icon,
label = opt.label,
action = opt.onSelect and function(entity)
opt.onSelect(entity)
end or nil,
canInteract = function(entity, distance, data)
return opt.canInteract and opt.canInteract(entity, distance)
end,
})
end
exports[_Target]:AddGlobalPed({
options = formattedOptions,
distance = options[1].distance
})
end
end
---Creates new targetable options for a specific model or list of models.
---@param models number|string|Array<number|string> specific model number/string or array of models
---@param options table A list of target options, where each option is a table containing:
--- - label (string): The text displayed for the option.
--- - name (string): A unique identifier for the target option (only for ox_target).
--- - icon (string): The icon associated with the target option.
--- - distance (number): The maximum interaction distance.
--- - canInteract (function): A function(entity, distance) that determines if interaction is allowed.
--- - onSelect (function): A function(entity) triggered when the option is selected.
--- - event (string | nil): The event triggered instead of onSelect (if applicable).
function _API.Target.AddModel(models, options)
if _Target == "ox_target" then
local formattedOptions = {}
for _, opt in ipairs(options) do
table.insert(formattedOptions, {
label = opt.label,
name = opt.name,
icon = opt.icon,
distance = opt.distance,
canInteract = function(entity, distance, coords, name, bone)
return opt.canInteract and opt.canInteract(entity, distance)
end,
onSelect = opt.onSelect and function(data)
opt.onSelect(data.entity)
end or nil,
event = opt.event or nil,
})
end
exports[_Target]:addModel(models, formattedOptions)
elseif _Target == "qb-target" then
local formattedOptions = {}
for _, opt in ipairs(options) do
table.insert(formattedOptions, {
event = opt.event or nil,
icon = opt.icon,
label = opt.label,
action = opt.onSelect and function(entity)
opt.onSelect(entity)
end or nil,
canInteract = function(entity, distance, data)
return opt.canInteract and opt.canInteract(entity, distance)
end,
})
end
exports[_Target]:AddTargetModel(models, {
options = formattedOptions,
distance = options[1].distance
})
end
end
---Removes all options from the models list using appropriate identifiers for each target system.
---@param models number|string|Array<number|string> Model(s) to remove target options from.
---@param options table A table containing option names (ox_target) and option labels (qb-target).
function _API.Target.RemoveModel(models, options)
if _Target == "ox_target" then
exports[_Target]:removeModel(models, options.names)
elseif _Target == "qb-target" then
exports[_Target]:RemoveTargetModel(models, options.labels)
end
end
---Creates new targetable options for a specific entity handle or list of entity handles
---@param entities number|number[] Specific entity handle or list of entity handles.
---@param options table A list of target options, where each option is a table containing:
--- - label (string): The text displayed for the option.
--- - name (string): A unique identifier for the target option (only for ox_target).
--- - icon (string): The icon associated with the target option.
--- - distance (number): The maximum interaction distance.
--- - canInteract (function): A function(entity, distance) that determines if interaction is allowed.
--- - onSelect (function): A function(entity) triggered when the option is selected.
--- - event (string | nil): The event triggered instead of onSelect (if applicable).
function _API.Target.AddLocalEntity(entities, options)
if _Target == "ox_target" then
local formattedOptions = {}
for _, opt in ipairs(options) do
table.insert(formattedOptions, {
label = opt.label,
name = opt.name,
icon = opt.icon,
distance = opt.distance,
canInteract = function(entity, distance, coords, name, bone)
return opt.canInteract and opt.canInteract(entity, distance)
end,
onSelect = opt.onSelect and function(data)
opt.onSelect(data.entity)
end or nil,
event = opt.event or nil,
})
end
exports[_Target]:addLocalEntity(entities, formattedOptions)
elseif _Target == "qb-target" then
local formattedOptions = {}
for _, opt in ipairs(options) do
table.insert(formattedOptions, {
event = opt.event or nil,
icon = opt.icon,
label = opt.label,
action = opt.onSelect and function(entity)
opt.onSelect(entity)
end or nil,
canInteract = function(entity, distance, data)
return opt.canInteract and opt.canInteract(entity, distance)
end,
})
end
exports[_Target]:AddTargetEntity(entities, {
options = formattedOptions,
distance = options[1].distance
})
end
end
---Removes all options from the entities list with the option names.
---@param entities number|number[] Specific entity handle or list of entity handles.
---@param options table A table containing option names (ox_target) and option labels (qb-target).
function _API.Target.RemoveLocalEntity(entities, options)
if _Target == "ox_target" then
exports[_Target]:removeLocalEntity(entities, options.names)
elseif _Target == "qb-target" then
exports[_Target]:RemoveTargetEntity(entities, options.labels)
end
endlocal towing = {inUse = false, truck = nil, target = nil}
---Returns whether the vehicle is a valid tow truck or not
---@param towtruck entity entity handle for the vehicle to check
---@return boolean IsVehicleTowTruck `true` if vehicle is a towtruck. `false` otherwise
local function IsVehicleTowTruck(towtruck)
-- check if entity exists
if not DoesEntityExist(towtruck) then return false end
-- check if entity is a vehicle
if not IsEntityAVehicle(towtruck) then return false end
-- loop config
for model, data in pairs(Config.FlatbedTowing.Trucks) do
if GetHashKey(model) == GetEntityModel(towtruck) then
return true
end
end
return false
end
exports("IsVehicleTowTruck", IsVehicleTowTruck)
---Returns data for a given towtruck specified in config
---@param towtruck entity entity handle for the vehicle to check
---@return table data returns offset and bonename for the flatbed truck
local function GetTowTruckData(towtruck)
for model, data in pairs(Config.FlatbedTowing.Trucks) do
if GetHashKey(model) == GetEntityModel(towtruck) then
return data
end
end
return
end
---Returns whether the vehicle is blacklisted from being attached to the towtruck
---@param vehicle entity entity handle for the vehicle to check
---@return boolean IsBlacklisted `true` if vehicle is blacklisted. `false` otherwise
local function VehicleIsBlacklistedForTowing(vehicle)
for k,v in pairs(Config.FlatbedTowing.Blacklisted) do
if GetHashKey(k) == GetEntityModel(vehicle) then
return true
end
end
return false
end
---Returns the closest towtruck vehicle
---@param dist number (optional) distance to check for closest towtruck, otherwise defaults to 4.0
---@return entity towtruck the entity handle for the towtruck
local function GetClosestTowTruck(dist)
-- get vehicle ped is in
local towtruck = GetVehiclePedIsIn(player, false)
-- if vehicle not found, get closest vehicle to player coords:
if not towtruck or towtruck == 0 then
towtruck, towtruckCoords = lib.getClosestVehicle(coords, dist or 4.0, false)
end
-- check if vehicle is a valid tow truck model
if not IsVehicleTowTruck(towtruck) then return end
-- return the found tow truck entity
return towtruck
end
---Tow function to attach a vehicle onto a flatbed/towtruck
function TowVehicle()
if not Config.FlatbedTowing.Enable then return end
-- check if isMechanic:
local isMechanic, shopId = IsPlayerMechanic()
if not isMechanic then return end
-- get towtruck:
local towtruck = GetClosestTowTruck(4.0)
if not towtruck then
return _API.ShowNotification(locale("notification.no_towtruck_nearby"), "inform", {})
end
-- assign attributes
towing.truck = towtruck
towing.model = GetEntityModel(towtruck)
towing.inUse = true
_API.ShowNotification(locale("notification.towtruck_ready_to_control"), "success", {})
while towing.inUse do
Wait(1)
local sleep = true
local min, max = GetModelDimensions(towing.model)
local attachCoords = GetOffsetFromEntityInWorldCoords(towtruck, 0.0, (min.y - 3.0), 0.0)
local truckCoords = GetOffsetFromEntityInWorldCoords(towtruck, (min.x-0.05), (min.y + 1.0), 0.0)
local truckDist = #(coords - vector3(truckCoords.x, truckCoords.y, truckCoords.z))
local direction = vector3(0.0, 0.0, 0.0)
local rotation = vector3(0.0, 0.0, 0.0)
local mk = Config.FlatbedTowing.Marker
if truckDist < 10.0 then
sleep = false
if not towing.vehicle then
local attachDist = #(coords - vector3(attachCoords.x, attachCoords.y, attachCoords.z))
if attachDist < 10.0 then
DrawMarker(
mk.type, attachCoords.x, attachCoords.y, attachCoords.z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, mk.scale.x, mk.scale.y, mk.scale.z, mk.color.r, mk.color.g, mk.color.b, mk.color.a, false, true, 2, false, false, false, false
)
end
if truckDist < 1.5 then
Draw3DText(truckCoords.x, truckCoords.y, truckCoords.z, locale("drawtext.tow_attach"))
if IsControlJustPressed(0, Config.FlatbedTowing.Keybind) then
towing.vehicle = AttachVehicle(attachCoords)
if towing.vehicle then
towing.inUse = false
end
end
end
else
if truckDist < 1.5 then
Draw3DText(truckCoords.x, truckCoords.y, truckCoords.z, locale("drawtext.tow_detach"))
if IsControlJustPressed(0, Config.FlatbedTowing.Keybind) then
DetachEntity(towing.vehicle)
SetEntityCoords(towing.vehicle, attachCoords.x, attachCoords.y, attachCoords.z, 1, 0, 0, 1)
SetVehicleOnGroundProperly(towing.vehicle)
towing.vehicle = nil
towing.inUse = false
end
end
end
end
-- cancel if distance too big
if truckDist > 20.0 then
towing.inUse = false
end
-- sleep
if sleep then
Wait(500)
end
end
end
---Attaches a vehicle onto the flatbed / tow truck
---@param attachCoords vector3 coords to check for vehicle to be attached
---@return vehicle entity returns the attached vehicle entity
function AttachVehicle(attachCoords)
if not towing.truck or not IsVehicleTowTruck(towing.truck) then
return print("could not find towtruck. Repeat process!")
end
if towing.vehicle then
return print("flatbed busy")
end
-- get vehicle to attach:
local vehicle, vehicleDist = lib.getClosestVehicle(attachCoords, 2.0, false)
if not vehicle or not DoesEntityExist(vehicle) or not IsEntityAVehicle(vehicle) then
return _API.ShowNotification(locale("notification.towtruck_park_vehicle_in_marker"), "inform", {})
end
-- check if vehicle is blacklisted:
if VehicleIsBlacklistedForTowing(vehicle) then
return _API.ShowNotification(locale("notification.towing_vehicle_blacklisted"), "inform", {})
end
-- get tow truck data:
local truckData = GetTowTruckData(towing.truck)
if not truckData then
return error("[AttachVehicle] Configuration invalid for the towtruck")
end
-- get boneIndex:
local boneIndex = GetEntityBoneIndexByName(towing.truck, truckData.boneName)
if not boneIndex or boneIndex == -1 then
return error("[AttachVehicle] Invalid boneIndex from given boneName: "..truckData.boneName)
end
-- attach vehicle to towtruck:
AttachEntityToEntity(vehicle, towing.truck, boneIndex, truckData.offset.x, truckData.offset.y, truckData.offset.z, 0, 0, 0, 1, 1, 0, 1, 0, 1)
-- return attached vehicle
return vehicle
end
--- Command to trigger towing feature
if type(Config.FlatbedTowing.Enable) == "boolean" and Config.FlatbedTowing.Enable == true then
RegisterCommand(Config.FlatbedTowing.Command, function(source, args)
if towing.inUse == false then
TowVehicle()
else
towing.inUse = false
end
end, false)
endif not Config.FlipVehicle.Enable then
return
end
--- Function to flip closest vehicle
function FlipVehicle()
if not Config.FlipVehicle.Enable then return end
local isMechanic, shopId = IsPlayerMechanic()
if not isMechanic then return end
-- ray cast:
local hit, entityHit, endCoords, surfaceNormal, materialHash = lib.raycast.fromCoords(coords, GetOffsetFromEntityInWorldCoords(player, 0.0, 5.0, 0.0), 2)
if not hit or GetEntityType(entityHit) ~= 2 or not IsEntityAVehicle(entityHit) or not DoesEntityExist(entityHit) then
return _API.ShowNotification(locale("notification.no_vehicle_in_direction"), "inform", {})
end
local flipped = false
local min, max = GetModelDimensions(GetEntityModel(entityHit))
local flipCoords = GetOffsetFromEntityInWorldCoords(entityHit, min.x-0.2,0.0,0.0)
while not flipped do
Wait(1)
local distance = #(coords - vector3(flipCoords.x, flipCoords.y, flipCoords.z))
if distance < Config.FlipVehicle.DrawDist then
-- draw text
Draw3DText(flipCoords.x, flipCoords.y, flipCoords.z, locale("drawtext.flip_vehicle"))
-- key press
if IsControlJustReleased(0, Config.FlipVehicle.Keybind) then
if distance <= 1.0 then
TaskTurnPedToFaceEntity(player, entityHit, 1.0)
Wait(500)
SetCurrentPedWeapon(player, GetHashKey("WEAPON_UNARMED"), true)
Wait(300)
if ProgressBar({
duration = Config.FlipVehicle.Duration,
label = locale("progressbar.flip_vehicle"),
useWhileDead = false,
canCancel = true,
anim = {
scenario = Config.FlipVehicle.Scenario
},
disable = {
move = true,
combat = true
}
}) then
ClearPedTasks(player)
flipped = true
break
end
else
_API.ShowNotification(locale("notification.move_closer_to_interact"), "inform", {})
end
end
end
end
-- complete?
if flipped then
SetVehicleOnGroundProperly(entityHit)
end
end
--- Command to flip closest vehicle
if Config.FlipVehicle.Command.enable == true then
RegisterCommand(Config.FlipVehicle.Command.name, function()
FlipVehicle()
end, false)
endif not Config.ImpoundVehicle.Enable then
return
end
-- function to impound closest vehicle:
function ImpoundVehicle()
if not Config.ImpoundVehicle.Enable then return end
local isMechanic, shopId = IsPlayerMechanic()
if not isMechanic then return end
-- ray cast:
local hit, entityHit, endCoords, surfaceNormal, materialHash = lib.raycast.fromCoords(coords, GetOffsetFromEntityInWorldCoords(player, 0.0, 5.0, 0.0), 2)
if not hit or GetEntityType(entityHit) ~= 2 or not IsEntityAVehicle(entityHit) or not DoesEntityExist(entityHit) then
return _API.ShowNotification(locale("notification.no_vehicle_in_direction"), "inform", {})
end
local impounded = false
local min, max = GetModelDimensions(GetEntityModel(entityHit))
local interactCoords = GetOffsetFromEntityInWorldCoords(entityHit, min.x-0.2,0.0,0.0)
while not impounded do
Wait(1)
local distance = #(coords - vector3(interactCoords.x, interactCoords.y, interactCoords.z))
if distance < Config.ImpoundVehicle.DrawDist then
-- draw text
Draw3DText(interactCoords.x, interactCoords.y, interactCoords.z, locale("drawtext.impound_vehicle"))
-- key press
if IsControlJustReleased(0, Config.ImpoundVehicle.Keybind) then
if distance <= 1.0 then
TaskTurnPedToFaceEntity(player, entityHit, 1.0)
Wait(500)
SetCurrentPedWeapon(player, GetHashKey("WEAPON_UNARMED"), true)
Wait(300)
if ProgressBar({
duration = Config.ImpoundVehicle.Duration,
label = locale("progressbar.impound_vehicle"),
useWhileDead = false,
canCancel = true,
anim = {
scenario = Config.ImpoundVehicle.Scenario
},
disable = {
move = true,
combat = true
}
}) then
ClearPedTasks(player)
impounded = true
break
end
else
_API.ShowNotification(locale("notification.move_closer_to_interact"), "inform", {})
end
end
end
end
-- complete?
if impounded then
_API.ImpoundVehicle(entityHit)
end
end
if Config.ImpoundVehicle.Command.enable == true then
RegisterCommand(Config.ImpoundVehicle.Command.str, function()
ImpoundVehicle()
end, false)
endif not Config.ActionMenu.Enable then
return
end
--- Command to open the mechanic action menu
if Config.ActionMenu.Command.enable then
RegisterCommand(Config.ActionMenu.Command.name, function()
MechanicActionMenu()
end)
end
--- keybind to access the mechanic action menu
if Config.ActionMenu.Keybind.enable then
RegisterCommand('MechanicActionMenu', function()
MechanicActionMenu()
end, false)
RegisterKeyMapping('MechanicActionMenu', Config.ActionMenu.Keybind.description, 'keyboard', Config.ActionMenu.Keybind.defaultMapping)
end
---Mechanic Action Menu
function MechanicActionMenu()
if not Config.ActionMenu.Enable then return end
local isMechanic, shopId = IsPlayerMechanic()
if not isMechanic then return end
if Config.Debug then
print("Hired in mechanic shop with id: "..shopId)
end
local menuOptions = {}
if Config.Shop.Billing.enable and Config.Shop.Billing.actionMenu.enable then
menuOptions[#menuOptions+1] = {title = locale("menu_title.billing_main"), icon = Config.Shop.Billing.actionMenu.icon, arrow = true, onSelect = function() BillingMain(true) end}
end
if Config.Missions.Enable and Config.Missions.ActionMenu.enable then
menuOptions[#menuOptions+1] = {title = locale("menu_title.missions_main"), icon = Config.Missions.ActionMenu.icon, arrow = true, onSelect = function() MissionsMainMenu(true) end}
end
if Config.FlatbedTowing.Enable and Config.FlatbedTowing.ActionMenu.enable then
menuOptions[#menuOptions+1] = {title = locale("menu_title.action_tow_vehicle"), icon = Config.FlatbedTowing.ActionMenu.icon, onSelect = function() TowVehicle() end}
end
if Config.PushVehicle.Enable and Config.PushVehicle.ActionMenu.enable then
menuOptions[#menuOptions+1] = {title = locale("menu_title.action_push_vehicle"), icon = Config.PushVehicle.ActionMenu.icon, onSelect = function() PushVehicle() end}
end
if Config.FlipVehicle.Enable and Config.FlipVehicle.ActionMenu.enable then
menuOptions[#menuOptions+1] = {title = locale("menu_title.action_flip_vehicle"), icon = Config.FlipVehicle.ActionMenu.icon, onSelect = function() FlipVehicle() end}
end
if Config.UnlockVehicle.Enable and Config.UnlockVehicle.ActionMenu.enable then
menuOptions[#menuOptions+1] = {title = locale("menu_title.action_unlock_vehicle"), icon = Config.UnlockVehicle.ActionMenu.icon, onSelect = function() UnlockVehicle() end}
end
if Config.ImpoundVehicle.Enable and Config.ImpoundVehicle.ActionMenu.enable then
menuOptions[#menuOptions+1] = {title = locale("menu_title.action_impound_vehicle"), icon = Config.ImpoundVehicle.ActionMenu.icon, onSelect = function() ImpoundVehicle() end}
end
-- return if no menu options
if #menuOptions <= 0 then
return
end
-- register context
lib.registerContext({
id = "mechanic_action_menu",
title = locale("menu_title.action_main"),
options = menuOptions
})
-- show context
lib.showContext("mechanic_action_menu")
endlocal holdingObject, carryModel = false, 0
---Returns the prop emote corresponding to item
---@param item string The name of the item
---@return table PropEmote the data for the prop emote
local function GetPropEmoteByItem(item)
for hash, emote in pairs(Config.Emotes.Props) do
if item == emote.item then
return emote
end
end
return nil
end
---Plays prop emote animation
---@param type string type of animation: `push` or `pickup`
local function PropEmoteAnimation(type)
local anim = Config.Emotes.Anim[type]
lib.requestAnimDict(anim.dict)
TaskPlayAnim(player, anim.dict, anim.clip, anim.blendIn, anim.blendOut, anim.duration, anim.flags, 0, 0, 0, 0)
end
---Attaches the emote object to the player
---@param emote table emote data
---@param object entity the object entity handle
local function AttachPropToPlayer(emote, object)
local boneIndex = GetPedBoneIndex(player, emote.bone)
AttachEntityToEntity(object, player, boneIndex, emote.pos[1], emote.pos[2], emote.pos[3], emote.rot[1], emote.rot[2], emote.rot[3], true, true, false, true, 2, 1)
end
---Thread when holding a prop emote
---@param emote table emote data
---@param object entity the object entity handle
local function PropEmoteHandle(emote, object)
while holdingObject do
Wait(1)
-- text ui
local isOpen, text = lib.isTextUIOpen()
if not isOpen or text ~= "[E] Place Prop" then
lib.showTextUI("[E] Place Prop")
end
-- keypress
if IsControlJustPressed(0, Config.Emotes.Keybind) then
lib.hideTextUI()
holdingObject = false
if emote.push == nil then
PropEmoteAnimation("pickup")
Wait(150)
end
Wait(250)
DetachEntity(object)
ClearPedTasks(player)
end
end
end
-- Event to use prop emote triggered by useable item
RegisterNetEvent("t1ger_mechanic:client:propEmote", function(item)
-- check if not inside vehicle
if IsPedInAnyVehicle(player, true) then
return _API.ShowNotification(locale("notification.cannot_be_inside_vehicle"), "inform", {})
end
-- check if emote exists:
local emote = GetPropEmoteByItem(item)
if not emote then
return error("could not find prop emote for given item: "..item.."! Check your item names in Config.Emotes.Props")
end
-- check if already holding an object
if holdingObject then
return _API.ShowNotification(locale("notification.is_carrying_prop_emote"), "inform", {})
end
-- remove item:
TriggerServerEvent("t1ger_mechanic:server:removeItem", emote.item, 1)
carryModel = 0
holdingObject = true
if type(emote.push) == "boolean" and emote.push == true then
PropEmoteAnimation("push")
Wait(250)
end
carryModel = CreateProp(emote.model, coords)
-- attach:
AttachPropToPlayer(emote, carryModel)
-- handle:
Wait(500)
PropEmoteHandle(emote, carryModel)
end)
---Returns whether the player can interact with an emote object
---@param entity number the entity handle
---@return boolean CanInteractPropEmote `true` can interact. `false` cannot interact
local function CanInteractPropEmote(entity)
if IsEntityValid(entity) and GetEntityType(entity) ~= 0 then
local modelHash = GetEntityModel(entity)
if modelHash and Config.Emotes.Props[tostring(modelHash)] then
local entityCoords = GetEntityCoords(entity)
if #(coords - entityCoords) < Config.Emotes.Distance then
return true
end
end
end
return false
end
-- Creates target options for prop emotes models
CreateThread(function()
while not _Target do Wait(100) end -- wait for target to initialize
-- insert models into one table
local models = {}
for hash, emote in pairs(Config.Emotes.Props) do
table.insert(models, emote.model)
end
-- target options:
local options = {
[1] = {
name = "t1ger_mechanic:propEmote:remove",
icon = Config.Emotes.Icons.remove,
label = locale("target.prop_emote_remove"),
canInteract = CanInteractPropEmote,
distance = 2.0,
onSelect = function(entity)
RemovePropEmote(entity)
end
},
[2] = {
name = "t1ger_mechanic:propEmote:carry",
icon = Config.Emotes.Icons.attach,
label = locale("target.prop_emote_attach"),
canInteract = CanInteractPropEmote,
distance = 2.0,
onSelect = function(entity)
CarryPropEmote(entity)
end
},
}
-- add target for models:
_API.Target.AddModel(models, options)
end)
---Removes an emote object and returns item to player
---@param entity number the object entity handle
function RemovePropEmote(entity)
local netId = NetworkGetNetworkIdFromEntity(entity)
-- request control of netId
NetworkRequestControlOfNetworkId(netId)
while not NetworkHasControlOfNetworkId(netId) do
NetworkRequestControlOfNetworkId(netId)
Wait(1)
end
local modelHash = GetEntityModel(entity)
local emote = Config.Emotes.Props[tostring(modelHash)]
TriggerServerEvent("t1ger_mechanic:server:deletePropEmoteObject", netId, emote)
end
---Function to carry/push emote objects
---@param entity number object entity handle
function CarryPropEmote(entity)
local modelHash = GetEntityModel(entity)
local emote = Config.Emotes.Props[tostring(modelHash)]
-- request control of entity
NetworkRequestControlOfEntity(entity)
while not NetworkHasControlOfEntity(entity) do
NetworkRequestControlOfEntity(entity)
Wait(1)
end
-- check if already holding an object
if holdingObject then
return _API.ShowNotification(locale("notification.is_carrying_prop_emote"), "inform", {})
end
holdingObject = true
carryModel = entity
-- animation:
if emote.push == nil then
PropEmoteAnimation("pickup")
Wait(250)
else
PropEmoteAnimation("push")
end
Wait(250)
-- attach:
AttachPropToPlayer(emote, entity)
Wait(500)
PropEmoteHandle(emote, entity)
endif not Config.PushVehicle.Enable then
return
end
local steer_angle = 0.0
---Returns whether player is allowed to push the vehicle
---@return boolean CanPushVehicle `true` if allowed. `false` otherwise
local function CanPushVehicle()
if Config.PushVehicle.AllowEveryone then
return true
else
-- check if isMechanic:
local isMechanic, shopId = IsPlayerMechanic()
if isMechanic then
return true
end
end
return false
end
---Function to push the closest vehicle in direction
function PushVehicle()
if not Config.PushVehicle.Enable then return end
-- is allowed?
if not CanPushVehicle() then return end
-- ray cast:
local hit, entityHit, endCoords, surfaceNormal, materialHash = lib.raycast.fromCoords(coords, GetOffsetFromEntityInWorldCoords(player, 0.0, 5.0, 0.0), 2)
if not hit or GetEntityType(entityHit) ~= 2 or not IsEntityAVehicle(entityHit) or not DoesEntityExist(entityHit) then
return _API.ShowNotification(locale("notification.no_vehicle_in_direction"), "inform", {})
end
local pushing, front, newDist = true, nil, 0
local anim = {dict = 'missfinale_c2ig_11', name = 'pushcar_offcliff_m', blendIn = 3.0, blendOut = 3.0, flag = 35}
-- thread
while pushing do
Wait(1)
-- vehicle dimensions
local min, max = GetModelDimensions(GetEntityModel(entityHit))
-- rear distance
local rearCoords = GetOffsetFromEntityInWorldCoords(entityHit, 0.0, min.y - 0.25, 0.0)
local rearDist = #(coords - vector3(rearCoords.x, rearCoords.y, rearCoords.z))
-- front distance
local frontCoords = GetOffsetFromEntityInWorldCoords(entityHit, 0.0, max.y + 0.25, 0.0)
local frontDist = #(coords - vector3(frontCoords.x, frontCoords.y, frontCoords.z))
-- distance from player to vehicle
local vehicleCoords = GetEntityCoords(entityHit)
local distance = #(coords - vector3(vehicleCoords.x, vehicleCoords.y, vehicleCoords.z))
if distance < Config.PushVehicle.DrawDist then
-- determine front or rear
if rearDist < Config.PushVehicle.DrawDist then
Draw3DText(rearCoords.x, rearCoords.y, rearCoords.z + 0.4, locale("drawtext.push_vehicle"))
Draw3DText(rearCoords.x, rearCoords.y, rearCoords.z + 0.30, locale("drawtext.stop_push"))
front = false
newDist = rearDist
elseif frontDist < Config.PushVehicle.DrawDist then
Draw3DText(frontCoords.x, frontCoords.y, frontCoords.z + 0.4, locale("drawtext.push_vehicle"))
Draw3DText(frontCoords.x, frontCoords.y, frontCoords.z + 0.30, locale("drawtext.stop_push"))
front = true
newDist = frontDist
end
-- stop pushing
if IsControlJustPressed(0, Config.PushVehicle.StopKey) then
steer_angle = 0.0
pushing = false
end
-- if pushing
if IsControlPressed(0, Config.PushVehicle.PushKey) and newDist <= 1.2 then
-- animation / attach
lib.requestAnimDict(anim.dict)
local boneIndex = GetPedBoneIndex(6286)
if front then
AttachEntityToEntity(player, entityHit, boneIndex, 0.0, (max.y + 0.25), (min.z + 1.0), 0.0, 0.0, 180.0, false, false, false, true, false, true)
else
AttachEntityToEntity(player, entityHit, boneIndex, 0.0, (min.y - 0.25), (min.z + 1.0), 0.0, 0.0, 0.0, false, false, false, true, false, true)
end
TaskPlayAnim(player, anim.dict, anim.name, anim.blendIn, anim.blendOut, -1, anim.flag, 1.0, 0, 0, 0)
Wait(300)
while true do
Wait(1)
-- textui
local isOpen, text = lib.isTextUIOpen()
if not isOpen or text ~= locale("textui.push_vehicle") then
lib.showTextUI(locale("textui.push_vehicle"))
end
-- forward speed
if front then
SetVehicleForwardSpeed(entityHit, -0.80)
else
SetVehicleForwardSpeed(entityHit, 0.80)
end
-- correction
if HasEntityCollidedWithAnything(entityHit) then
SetVehicleOnGroundProperly(entityHit)
end
-- set steering angle:
local vehicleSpeed = GetFrameTime() * 75
if IsDisabledControlPressed(0, Config.PushVehicle.LeftKey) then
SetVehicleSteeringAngle(entityHit, steer_angle)
steer_angle = steer_angle + vehicleSpeed
elseif IsDisabledControlPressed(0, Config.PushVehicle.RightKey) then
SetVehicleSteeringAngle(entityHit, steer_angle)
steer_angle = steer_angle - vehicleSpeed
else
SetVehicleSteeringAngle(entityHit, steer_angle)
if steer_angle < -0.7 then
steer_angle = steer_angle + vehicleSpeed
elseif steer_angle > 0.7 then
steer_angle = steer_angle - vehicleSpeed
else
steer_angle = 0.0
end
end
-- max steering angles:
if steer_angle > 25.0 then
steer_angle = 25.0
elseif steer_angle < -25.0 then
steer_angle = -25.0
end
-- cancel if stop pushing
if not IsDisabledControlPressed(0, Config.PushVehicle.PushKey) then
local isOpen, text = lib.isTextUIOpen()
if text == locale("textui.push_vehicle") then
lib.hideTextUI()
end
StopAnimTask(player, anim.dict, anim.name, 2.0)
DetachEntity(player, false, false)
break
end
end
end
end
end
end
--- Command to push vehicle
if Config.PushVehicle.Command.enable == true then
RegisterCommand(Config.PushVehicle.Command.name, function()
PushVehicle()
end, false)
endif not Config.UnlockVehicle.Enable then
return
end
-- Function to unlock closest vehicle:
function UnlockVehicle()
if not Config.UnlockVehicle.Enable then return end
local isMechanic, shopId = IsPlayerMechanic()
if not isMechanic then return end
-- ray cast:
local hit, entityHit, endCoords, surfaceNormal, materialHash = lib.raycast.fromCoords(coords, GetOffsetFromEntityInWorldCoords(player, 0.0, 5.0, 0.0), 2)
if not hit or GetEntityType(entityHit) ~= 2 or not IsEntityAVehicle(entityHit) or not DoesEntityExist(entityHit) then
return _API.ShowNotification(locale("notification.no_vehicle_in_direction"), "inform", {})
end
local unlocked = false
local min, max = GetModelDimensions(GetEntityModel(entityHit))
local unlockCoords = GetOffsetFromEntityInWorldCoords(entityHit, min.x-0.2,0.0,0.0)
while not unlocked do
Wait(1)
local distance = #(coords - vector3(unlockCoords.x, unlockCoords.y, unlockCoords.z))
if distance < Config.UnlockVehicle.DrawDist then
-- draw text
Draw3DText(unlockCoords.x, unlockCoords.y, unlockCoords.z, locale("drawtext.unlock_vehicle"))
-- key press
if IsControlJustReleased(0, Config.UnlockVehicle.Keybind) then
if distance <= 1.0 then
TaskTurnPedToFaceEntity(player, entityHit, 1.0)
Wait(500)
SetCurrentPedWeapon(player, GetHashKey("WEAPON_UNARMED"), true)
Wait(300)
if ProgressBar({
duration = Config.UnlockVehicle.Duration,
label = locale("progressbar.unlock_vehicle"),
useWhileDead = false,
canCancel = true,
anim = Config.UnlockVehicle.Anim,
disable = {
move = true,
combat = true
}
}) then
ClearPedTasks(player)
unlocked = true
break
end
else
_API.ShowNotification(locale("notification.move_closer_to_interact"), "inform", {})
end
end
end
end
-- if unlocked:
if unlocked then
PlayVehicleDoorOpenSound(entityHit, 0)
SetVehicleDoorsLockedForAllPlayers(entityHit, false)
SetVehicleDoorsLocked(entityHit, 1)
end
end
if Config.UnlockVehicle.Command.enable == true then
RegisterCommand(Config.UnlockVehicle.Command.name, function()
UnlockVehicle()
end, false)
endlocal isCarryingCarJack = false -- is player carrying car jack prop?
local carJackProp = nil -- car jack object entity handle
--- Returns whether the player is currently using a car jack
--- @return boolean
local function IsCarryingCarJack()
return isCarryingCarJack == true
end
--- Returns whether a given vehicle entity is on a carjack or not
--- @param vehicle number The vehicle entity handle
local function IsVehicleOnCarJack(vehicle)
if not vehicle or not DoesEntityExist(vehicle) or not IsEntityAVehicle(vehicle) then
return false
end
local vehState = Entity(vehicle).state
if vehState["t1ger_mechanic:onCarJack"] then
return true
end
return false
end
exports("IsVehicleOnCarJack", IsVehicleOnCarJack)
--- Play animation to carry the car jack
local function CarryPropAnimation()
local anim = {dict = "missfinale_c2ig_11", clip = "pushcar_offcliff_f", blendIn = 3.0, blendOut = 3.0, duration = -1, flags = 49}
lib.requestAnimDict(anim.dict)
TaskPlayAnim(player, anim.dict, anim.clip , anim.blendIn, anim.blendOut, anim.duration, anim.flags, 0, false, false, false)
end
--- Carry the car jack prop: play anim and attach prop to player
--- @param prop table Prop data
local function CarryCarJackProp()
-- carry prop anim:
CarryPropAnimation()
Wait(250)
carJackProp = CreateProp(Config.CarJack.Prop.model, coords)
-- attach prop to player:
local boneIndex = GetPedBoneIndex(player, Config.CarJack.Prop.boneId)
AttachEntityToEntity(carJackProp, player, boneIndex, Config.CarJack.Prop.pos.x, Config.CarJack.Prop.pos.y, Config.CarJack.Prop.pos.z, Config.CarJack.Prop.rot.x, Config.CarJack.Prop.rot.y, Config.CarJack.Prop.rot.z, true, true, false, true, 1, true)
end
--- Returns carjack attach points to be used with ox lib points
--- @param vehicle number The vehicle entity handle
--- @return table
local function GetCarJackAttachPoints(vehicle)
local attachPoints = {}
local vehicleWheels = GetVehicleWheels(vehicle)
if not vehicleWheels or next(vehicleWheels) == nil then return attachPoints end
local centerCoords = GetEntityCoords(vehicle)
local heading = GetEntityHeading(vehicle)
-- Define local-space offsets and facing directions
local offsetMap = {
[0] = {x = -0.10, y = -0.7, z = 0.0, h = heading + 90.0}, -- Front Left
[1] = {x = 0.10, y = -0.7, z = 0.0, h = heading - 90.0}, -- Front Right
[2] = {x = -0.10, y = 0.7, z = 0.0, h = heading + 90.0}, -- Rear Left
[3] = {x = 0.10, y = 0.7, z = 0.0, h = heading - 90.0}, -- Rear Right
}
-- loop found wheel with offset map
for wheelIndex, wheelData in pairs(vehicleWheels) do
local offset = offsetMap[wheelData.wheelId]
if offset then
-- Default wheel coords from centerOffset
local defaultWheelCoords = CalculateBoneWorldCoords(centerCoords, heading, wheelData.centerOffset)
-- Offset slightly inward and along the vehicle and on the ground
local attachCoords = GetOffsetFromCoordAndHeadingInWorldCoords(defaultWheelCoords.x, defaultWheelCoords.y, defaultWheelCoords.z, heading, offset.x, offset.y, offset.z)
local groundBool, groundZ = GetGroundZFor_3dCoord(attachCoords.x, attachCoords.y, attachCoords.z, false)
-- store into points
attachPoints[#attachPoints+1] = {
coords = vector3(attachCoords.x, attachCoords.y, groundZ + 0.02),
heading = offset.h,
distance = 5,
wheelId = wheelData.wheelId
}
end
end
return attachPoints
end
--- Triggers the useable car jack item handle
local function UseCarJack()
if not Config.CarJack.AllowEveryone and not IsPlayerMechanic() then return end
if IsCarryingCarJack() then
return _API.ShowNotification(locale("notification.carjack_carrying"), "inform", {})
end
-- Get the closest vehicle
local vehicle, vehicleDist = lib.getClosestVehicle(coords, 4.0, false)
if not vehicle or not DoesEntityExist(vehicle) or not IsEntityAVehicle(vehicle) then
return _API.ShowNotification(locale("notification.no_vehicle_nearby"), "inform", {})
end
-- get number of vehicle wheels
local numWheels = GetVehicleNumberOfWheels(vehicle)
if not numWheels or numWheels ~= 4 then
return _API.ShowNotification(locale("notification.carjack_4_wheels_only"), "inform", {})
end
-- Check if vehicle is attached to carjack
if IsVehicleOnCarJack(vehicle) then
return _API.ShowNotification(locale("notification.carjack_vehicle_attached"), "inform", {})
end
-- Create points/draw texts to on vehicle to attach the car jack
local attachPoints = GetCarJackAttachPoints(vehicle)
if type(attachPoints) ~= "table" or not next(attachPoints) then return end
-- Update state:
isCarryingCarJack = true
-- Create carjack object, play attached anim and return netId:
CarryCarJackProp()
--- Removes all ox lib points for carjack placement
local function RemoveCarJackPoints()
for index, value in pairs(attachPoints) do
if value.point and next(value.point) then
value.point.remove(value.point)
end
end
end
-- get vehicle netId:
local vehicleNetId = VehToNet(vehicle)
-- ox lib points
local mk = Config.CarJack.Marker
for index, value in pairs(attachPoints) do
attachPoints[index].point = lib.points.new({
coords = value.coords,
distance = value.distance,
heading = value.heading,
wheelId = value.wheelId,
nearby = function(point)
local carJackCoords = GetEntityCoords(carJackProp)
if #(carJackCoords - vector3(point.coords.x, point.coords.y, point.coords.z)) <= 0.5 then
DrawMarker(mk.type, point.coords.x, point.coords.y, point.coords.z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, mk.scale.x, mk.scale.y, mk.scale.z, mk.color.r, mk.color.g, mk.color.b, mk.color.a, false, true, 0, true, false, false, false)
if IsControlJustReleased(0, Config.CarJack.Keybind) then
-- removes all ox lib points
RemoveCarJackPoints()
-- Detach and place carjack prop on the ground properly with forced heading
DetachEntity(carJackProp, false, false)
FreezeEntityPosition(carJackProp, true)
FreezeEntityPosition(vehicle, true)
SetVehicleOnGroundProperly(vehicle, true)
SetEntityCoords(carJackProp, point.coords.x, point.coords.y, point.coords.z, 0.0, 0.0, 0.0, false)
PlaceObjectOnGroundProperly(carJackProp)
SetEntityHeading(carJackProp, point.heading)
-- statebag on carjack entity with vehicle netId and wheelId
local objState = Entity(carJackProp).state
objState:set("t1ger_mechanic:carJackInfo", {
vehicleNetId = vehicleNetId,
wheelId = point.wheelId,
busy = false
}, true)
-- statebag on vehicle:
local vehState = Entity(vehicle).state
vehState:set("t1ger_mechanic:onCarJack", true, true)
-- clear ped tasks
ClearPedTasks(player)
-- Remove item
TriggerServerEvent("t1ger_mechanic:server:removeItem", Config.CarJack.Item, 1)
-- update is carrying state
isCarryingCarJack = false
end
end
end
})
end
end
--- Event for using car jack item:
RegisterNetEvent("t1ger_mechanic:client:useCarJack", function()
UseCarJack()
end)
--- Animates vehicle on the car jack
--- @param vehicle number The vehicle entity handle
--- @param vehState table The vehicle statebag
--- @param wheelId number The wheelId the car jack is attached to
--- @param method string `"raise"` or `"lower"`
local function CarJackHandle(vehicle, vehState, wheelId, method)
if not vehicle or not DoesEntityExist(vehicle) then return end
if type(method) ~= "string" or type(wheelId) ~= "number" then return end
local vehicleCoords = GetEntityCoords(vehicle)
local vehicleRotation = GetEntityRotation(vehicle)
local vehicleHeading = GetEntityHeading(vehicle)
local leftSide = (wheelId == 1 or wheelId == 3)
local delta = (method == "raise") and 1.0 or -1.0
local pitch = vehicleRotation.y + (leftSide and -delta or delta)
-- Clamp limits
local outOfBounds =
(method == "raise" and ((leftSide and pitch <= -10.0) or (not leftSide and pitch >= 10.0))) or
(method == "lower" and ((leftSide and pitch >= 1.0) or (not leftSide and pitch <= -1.0)))
if outOfBounds then
local msg = (method == "raise") and locale("notification.carjack_fully_raised") or locale("notification.carjack_fully_lowered")
return _API.ShowNotification(msg, "error", {})
end
-- Slight vertical nudge to re-trigger ground collision
local zNudge = (method == "raise") and 0.01 or -0.01
vehicleCoords = vehicleCoords + vec3(0.0, 0.0, zNudge)
vehState:set("t1ger_mechanic:carJackControl", {
pitch = pitch,
heading = vehicleHeading,
coords = vehicleCoords
}, true)
end
--- Opens car jack handle menu to either "raise" or "lower" the vehicle
--- @param entity The car jack entity handle
local function CarJackMenu(entity)
local entState = Entity(entity).state
local carJack = entState["t1ger_mechanic:carJackInfo"]
if not carJack then return end
if carJack.busy then
return _API.ShowNotification(locale("notification.carjack_is_busy"), "error", {})
end
carJack.busy = true
entState:set("t1ger_mechanic:carJackInfo", carJack, true)
-- request control of carJack.vehicleNetId
NetworkRequestControlOfNetworkId(carJack.vehicleNetId)
while not NetworkHasControlOfNetworkId(carJack.vehicleNetId) do
NetworkRequestControlOfNetworkId(carJack.vehicleNetId)
Wait(1)
end
-- get vehicle
local vehicle = NetworkGetEntityFromNetworkId(carJack.vehicleNetId)
while not DoesEntityExist(vehicle) do
Wait(100)
vehicle = NetworkGetEntityFromNetworkId(carJack.vehicleNetId)
end
local vehState = Entity(vehicle).state
-- create menu options:
local menuOptions, methods = {}, {"raise", "lower"}
for i = 1, #methods do
menuOptions[i] = {
title = locale("menu_title.carjack_"..tostring(methods[i])),
icon = Config.CarJack.Icons.menu[methods[i]],
onSelect = function()
CarJackHandle(vehicle, vehState, carJack.wheelId, methods[i])
Wait(10)
lib.showContext("t1ger_mechanic:carJackHandle")
end
}
end
-- Register context
lib.registerContext({
id = "t1ger_mechanic:carJackHandle",
title = "Car Jack",
onExit = function()
carJack.busy = false
entState:set("t1ger_mechanic:carJackInfo", carJack, true)
end,
options = menuOptions
})
-- Show context menu
lib.showContext("t1ger_mechanic:carJackHandle")
end
-- Creates target options for car jack model
CreateThread(function()
while not _Target do Wait(100) end -- wait for target to initialize
-- insert models into one table
local models = {Config.CarJack.Prop.model}
local function CanInteractWithCarJack(entity)
if IsEntityValid(entity) and GetEntityType(entity) ~= 0 then
if GetEntityModel(entity) == GetHashKey(Config.CarJack.Prop.model) then
if not IsPedInAnyVehicle(player, false) and not IsPedInAnyVehicle(player, true) then
if Config.CarJack.AllowEveryone then
return true
else
if IsPlayerMechanic() then
return true
end
end
end
end
end
return false
end
-- target options:
local options = {
[1] = {
name = "t1ger_mechanic:carjack:remove",
icon = Config.CarJack.Icons.target.remove,
label = locale("target.carjack_remove"),
canInteract = CanInteractWithCarJack,
distance = 2.0,
onSelect = function(entity)
local netId = ObjToNet(entity)
local carjackCoords = GetEntityCoords(entity)
TriggerServerEvent("t1ger_mechanic:server:removeCarJack", netId, carjackCoords)
end
},
[2] = {
name = "t1ger_mechanic:carjack:handle",
icon = Config.CarJack.Icons.target.handle,
label = locale("target.carjack_handle"),
canInteract = CanInteractWithCarJack,
distance = 2.0,
onSelect = function(entity)
CarJackMenu(entity)
end
},
}
-- add target for models:
_API.Target.AddModel(models, options)
end)
-- Statebag for animation/handle car jack:
AddStateBagChangeHandler("t1ger_mechanic:carJackControl" --[[key filter]], nil --[[bag filter]], function(bagName, key, value, _unused, replicated)
Wait(0)
if not value then return end
if replicated then return end
local vehicle = GetEntityFromStateBagName(bagName)
if not vehicle or not DoesEntityExist(vehicle) then return end
SetEntityRotation(vehicle, 0.0, value.pitch, value.heading, 2, true)
SetEntityCoordsNoOffset(vehicle, value.coords.x, value.coords.y, value.coords.z, 0.0, 0.0, 0.0)
end)CarLiftHandle = {}
CarLiftHandle.__index = CarLiftHandle
---Creates a new CarLiftHandle instance
---@param id number carlift id
---@param data table carlift data (id, coords, rotation, baseNetId, armsNetId)
---@return CarLiftHandle table CarLiftHandle object
function CarLiftHandle:New(id, data)
local self = setmetatable({}, CarLiftHandle)
self.id = id
self.coords = data.coords
self.rotation = data.rotation
self.baseNetId = data.baseNetId
self.armNetId = data.armNetId
return self
end
---Controls the carlifts in terms of animations. Up, Down or Stop
---@param method string control method (up, down, stop)
function CarLiftHandle:Control(method)
local liftArms = NetworkGetEntityFromNetworkId(self.armNetId)
local ent = Entity(liftArms).state
ent:set("t1ger_mechanic:carLiftControl", {
id = self.id,
netId = self.baseNetId,
method = method
}, true)
end
---Delete a carlift. Optional param to delete permanently
---@param permanent boolean (optional) `true` deletes carlift permanently. `false` deletes for the session only
function CarLiftHandle:Delete()
TriggerServerEvent("t1ger_mechanic:server:deleteCarLift", self.id)
endCarLiftHandles = {} -- Global variable to store CarLiftHandle objects
local function CreateCarLift()
-- request model:
lib.requestModel(Config.CarLift.Model.base)
-- get pos & rot:
local position = GetEntityCoords(player)
local rotation = GetEntityRotation(player)
-- create object:
local baseObject = CreateObject(Config.CarLift.Model.base, position.x, position.y, position.z, false, false, false)
SetModelAsNoLongerNeeded(baseObject)
-- freeze & set rotation:
FreezeEntityPosition(baseObject, true)
PlaceObjectOnGroundProperly(baseObject)
SetEntityRotation(baseObject, rotation.x, rotation.y, rotation.z)
-- get updated coords & rotation:
local lift_coords = GetEntityCoords(baseObject)
local lift_rotation = GetEntityRotation(baseObject)
-- cleanup:
DeleteEntity(baseObject)
-- create/sync:
TriggerServerEvent("t1ger_mechanic:server:createCarLift", lift_coords, lift_rotation)
end
exports("CreateCarLift", CreateCarLift)
-- Event to load car lifts:
RegisterNetEvent("t1ger_mechanic:client:loadCarLifts", function(carlifts)
if type(carlifts) == "table" and next(carlifts) then
-- loop through carlifts:
for id, carlift in pairs(carlifts) do
if carlift.baseNetId then
-- instanciate CarLiftHandle object and store in CarLiftHandles table
CarLiftHandles[tostring(carlift.baseNetId)] = CarLiftHandle:New(id, carlift)
end
end
end
end)
-- Statebag for created car lift:
AddStateBagChangeHandler("t1ger_mechanic:carLiftCreated" --[[key filter]], nil --[[bag filter]], function(bagName, key, value, _unused, replicated)
if not value then return end
if replicated then return end
-- check the entity:
local lift_base = GetEntityFromStateBagName(bagName)
if lift_base == 0 then return end
-- get netId:
local netId = tonumber(bagName:gsub("entity:", ""), 10)
-- get arm entity:
local lift_arm = NetworkGetEntityFromNetworkId(value.armNetId)
-- set rotation:
SetEntityRotation(lift_base, value.rotation.x, value.rotation.y, value.rotation.z)
SetEntityRotation(lift_arm, value.rotation.x, value.rotation.y, value.rotation.z)
--validate base net id:
if value.baseNetId ~= netId then
value.baseNetId = netId
end
-- print:
if Config.Debug then
print("base entity: ", lift_base, "netId: ", value.baseNetId, "arm entity: ", NetworkGetEntityFromNetworkId(value.armNetId), "netId: ", value.armNetId)
end
-- instanciate CarLiftHandle object and store in CarLiftHandles table
CarLiftHandles[tostring(value.baseNetId)] = CarLiftHandle:New(value.id, value)
end)
-- Event to delete a car lift
RegisterNetEvent("t1ger_mechanic:client:carLiftDeleted", function(netId)
-- Remove from CarLifts table
if CarLiftHandles[tostring(netId)] then
-- check if arms exists:
local arm = NetworkGetEntityFromNetworkId(CarLiftHandles[tostring(netId)].armNetId)
if arm and DoesEntityExist(arm) then
DeleteEntity(arm)
end
-- check if base exists:
local base = NetworkGetEntityFromNetworkId(CarLiftHandles[tostring(netId)].baseNetId)
if base and DoesEntityExist(base) then
DeleteEntity(base)
end
-- Remove from table
CarLiftHandles[tostring(netId)] = nil
end
end)
-- Command to create a carlift:
RegisterCommand(Config.CarLift.Command, function(source, args, rawCommand)
if _API.Player.isAdmin then
CreateCarLift()
else
print("Only admins can use this command!")
end
end, false)
---Animates the carlift with up, down or stop
---@param entity number carlift arms entity handle
---@param id number carlift id
---@param method string animation method (up, down or stop)
local function AnimateLift(entity, id, netId, method)
local entityCoords = GetEntityCoords(entity)
-- get vehicle for physics:
local vehicle, vehicleCoords = lib.getClosestVehicle(GetEntityCoords(entity), 3.0, false)
-- enable physics?
local physics = false
if vehicle ~= nil and DoesEntityExist(vehicle) then
physics = true
end
-- animate lift arms:
for i = 1, 600, 1 do
-- activate physics:
if physics then
ActivatePhysics(vehicle)
end
-- if lift stopped:
if CarLiftHandles[tostring(netId)].stop == true then
CarLiftHandles[tostring(netId)].stop = false
break
end
-- get height:
local height = GetEntityHeightAboveGround(entity)
-- animate lift:
if method == "up" then
if height >= 2.1 then
break
end
entityCoords = GetEntityCoords(entity)
SetEntityCoords(entity, entityCoords.x, entityCoords.y, entityCoords.z + 0.005, 0.0, 0.0, 0.0, false)
elseif method == "down" then
if height <= 0.005 then
break
end
entityCoords = GetEntityCoords(entity)
SetEntityCoords(entity, entityCoords.x, entityCoords.y, entityCoords.z - 0.005, 0.0, 0.0, 0.0, false)
elseif method == "stop" then
CarLiftHandles[tostring(netId)].stop = true
break
end
Wait(10)
end
end
-- Statebag for animation/handle car lift:
AddStateBagChangeHandler("t1ger_mechanic:carLiftControl" --[[key filter]], nil --[[bag filter]], function(bagName, key, value, _unused, replicated)
-- we only want to cause an explosion when the value is set to true!
if not value then return end
if replicated then return end
local entity = GetEntityFromStateBagName(bagName)
-- the entity didn"t exist
if entity == 0 then return end
AnimateLift(entity, value.id, value.netId, value.method)
end)
--- Checks if player is near a car lift
--- @param entity number entity handle
--- @return boolean IsNearCarLift `true` if near carlift. `false` otherwise
local function IsNearCarLift(entity)
if IsEntityValid(entity) and GetEntityType(entity) ~= 0 then
if GetEntityModel(entity) == Config.CarLift.Model.base then
if not IsPedInAnyVehicle(player, false) and not IsPedInAnyVehicle(player, true) then
if IsPlayerMechanic() then
return true
end
end
end
end
return false
end
--- Checks if admin-player is near a car lift
--- @param entity number entity handle
--- @return boolean IsNearCarLift `true` if near carlift. `false` otherwise
local function IsAdminNearCarLift(entity)
if IsEntityValid(entity) and GetEntityType(entity) ~= 0 then
if GetEntityModel(entity) == Config.CarLift.Model.base then
if not IsPedInAnyVehicle(player, false) and not IsPedInAnyVehicle(player, true) then
if _API.Player.isAdmin then
return true
end
end
end
end
return false
end
-- Creates target options for car lift handles
CreateThread(function()
while not _Target do Wait(100) end -- wait for target to initialize
--- carlift target labels and icons
local carlift_target = {
["up"] = {label = locale("target.carlift_up"), icon = Config.CarLift.Icons["up"]},
["down"] = {label = locale("target.carlift_down"), icon = Config.CarLift.Icons["down"]},
["stop"] = {label = locale("target.carlift_stop"), icon = Config.CarLift.Icons["stop"]},
["delete"] = {label = locale("target.carlift_delete"), icon = Config.CarLift.Icons["delete"]},
}
local target_options = {}
local optionsOrder = {"up", "down", "stop", "delete"}
-- create options:
for i = 1, #optionsOrder, 1 do
local method = optionsOrder[i]
target_options[#target_options+1] = {
name = "t1ger_mechanic:carlift:"..method,
icon = carlift_target[method].icon,
label = carlift_target[method].label,
canInteract = method == "delete" and IsAdminNearCarLift or IsNearCarLift,
distance = 2.0,
onSelect = function(entity)
local netId = NetworkGetNetworkIdFromEntity(entity)
if CarLiftHandles[tostring(netId)] then
if method == "delete" then
CarLiftHandles[tostring(netId)]:Delete()
else
CarLiftHandles[tostring(netId)]:Control(method)
end
else
if Config.Debug then
print("no data on this lift")
end
end
end
}
end
-- add target:
_API.Target.AddGlobalObject(target_options)
end)player, coords = nil, {}
--- Table of currently synced owned vehicle plates.
---@type table<string, boolean>
OwnedPlates = {}
Citizen.CreateThread(function()
while true do
player = PlayerPedId()
coords = GetEntityCoords(player)
Wait(500)
end
end)
RegisterNetEvent("t1ger_mechanic:client:playerLoaded", function()
Wait(1000)
TriggerServerEvent("t1ger_mechanic:server:playerLoaded")
if Config.Debug then
print("Player Loaded:", json.encode(_API.Player:GetJob(), {indent = true}))
print("isAdmin: ", _API.Player.isAdmin)
end
CreateRepairStations()
end)
RegisterNetEvent("t1ger_mechanic:client:onJobUpdate", function(job, lastJob)
if Config.Debug then
print("Player Job updated:", json.encode(job, {indent = true}))
end
-- Check if player has a mechanic job
local isPlayerMechanic, shopId = IsPlayerMechanic()
if isPlayerMechanic then
print("Player has mechanic job for shop ID:", shopId)
-- Check if player is already hired in a mechanic shop
local isEmployee, hiredShopId = IsPlayerEmployee()
if isEmployee then
-- If already hired in the same shop, update job grade
if hiredShopId == shopId then
TriggerServerEvent("t1ger_mechanic:server:updateEmployee", shopId, job.grade, false)
else
-- Player is hired in another shop, remove from old shop first
TriggerServerEvent("t1ger_mechanic:server:removeEmployee", hiredShopId, false)
Wait(500)
TriggerServerEvent("t1ger_mechanic:server:addEmployee", shopId, job.grade, false)
end
else
-- Player is not an employee anywhere, add them directly
TriggerServerEvent("t1ger_mechanic:server:addEmployee", shopId, job.grade, false)
end
end
-- Tell server about updated job for mechanic tracking
TriggerServerEvent("t1ger_mechanic:server:onJobUpdate", job.name, job.onDuty)
-- Reload shop markers after job update to reflect changes
LoadAllMarkers()
-- Refresh repair stations:
RefreshRepairStations()
end)
--- Callback for skillcheck
--- @param difficulty table
--- @param inputs table
--- @return boolean?
function SkillCheck(difficulty, inputs)
local success = lib.skillCheck(difficulty, inputs)
return success
end
--- Callback for progress bar
--- @param options table
--- @return boolean?
function ProgressBar(options)
local success = lib.progressBar(options)
return success
end
---Check if entity is valid
---@param entity number handle for entity
function IsEntityValid(entity)
if not entity or entity == -1 then
return false
end
return DoesEntityExist(entity)
end
---Draws 3D text on given coords
---@param x number
---@param y number
---@param z number
---@param text string
function Draw3DText(x, y, z, text)
local boolean, _x, _y = GetScreenCoordFromWorldCoord(x, y, z)
SetTextScale(0.32, 0.32); SetTextFont(4); SetTextProportional(1)
SetTextColour(255, 255, 255, 255)
SetTextEntry("STRING"); SetTextCentre(1); AddTextComponentString(text)
DrawText(_x, _y)
local factor = (string.len(text) / 500)
DrawRect(_x, (_y + 0.0125), (0.015 + factor), 0.03, 0, 0, 0, 80)
end
--- Fixes vehicle deformation after inspection is complete.
--- @param vehicle number The vehicle entity handle
function FixVehicleDeformation(vehicle)
-- replace the following export with whatever deformation script export you have.
-- Currently supports this one: https://github.com/Kiminaze/VehicleDeformation
local hasDeformationScript = GetResourceState("VehicleDeformation") == "started"
if hasDeformationScript then
exports["VehicleDeformation"]:FixVehicleDeformation(vehicle)
end
end
--- Creates a prop/object and returns the entity handle
--- @param model string The prop/object model name
--- @param pos vector3 The coords to spawn the prop/model at
--- @return integer
function CreateProp(model, pos)
if Config.ServerSideProps then
-- create emote object on server
local netId = lib.callback.await("t1ger_mechanic:server:createNetworkedObj", false, model, pos)
if type(netId) ~= "number" and netId <= 0 then
return print("[t1ger_mechanic:client:propEmote] Could not create object")
end
-- Wait for netId to exist
while not NetworkDoesNetworkIdExist(netId) do
Wait(1)
end
SetNetworkIdExistsOnAllMachines(netId, true)
-- request control of netId
NetworkRequestControlOfNetworkId(netId)
while not NetworkHasControlOfNetworkId(netId) do
NetworkRequestControlOfNetworkId(netId)
Wait(1)
end
-- get entity from network id
local prop = NetworkGetEntityFromNetworkId(netId)
-- ensure prop exists:
while not DoesEntityExist(prop) do
Wait(1)
end
return prop
else
-- request model
lib.requestModel(model)
-- create prop
local prop = CreateObjectNoOffset(GetHashKey(model), pos.x, pos.y, pos.z, true, false, false)
-- ensure prop exists:
while not DoesEntityExist(prop) do
Wait(10)
end
return prop
end
end
--- Called when malfunction effects plays on a vehicle for degraded core parts
--- @param vehicle number The vehicle entity handle
--- @param part string The part id/name
--- @param health number The part's current health
--- @param condition table The condition stage table from Config.PartConditions.core_parts
function OnMalfunctcionEffect(vehicle, part, health, condition)
if not DoesEntityExist(vehicle) then return end
local partConfig = Config.CoreParts[part]
-- add kq_obd export to register fault on core parts
local T1GERCoreFaults = {
alternator = {
code = "T1011",
description = "Alternator voltage drop. Causes engine stutter or shutdown."
},
brakes = {
code = "T1012",
description = "Brake system underperforming. Hydraulic pressure or wear issue."
},
fuel_injector = {
code = "T1013",
description = "Fuel injector misfire or blockage. Causes sputtering and poor acceleration."
},
power_steering_pump = {
code = "T1014",
description = "Power steering resistance detected. Possible pump or fluid failure."
},
radiator = {
code = "T1015",
description = "Engine overheating. Coolant flow restricted or radiator damaged."
},
transmission = {
code = "T1016",
description = "Transmission delay or slip. Clutch or fluid system malfunction."
},
electric_motor = {
code = "T1017",
description = "Electric motor stutter or control fault. Temporary or full power loss."
},
ev_battery = {
code = "T1018",
description = "EV battery power drop detected. Limited acceleration or shutdown risk."
}
}
-- Add fault code to OBD
if GetResourceState("kq_obd") == "started" then
local fault = T1GERCoreFaults[part]
if fault then
local partConfig = Config.CoreParts[part]
exports["kq_obd"]:AddFaultCode(vehicle, {
name = fault.code .. " - " .. partConfig.label,
description = fault.description,
component = part
})
end
end
end
--- Called when a service part is overdue
--- @param vehicle number The vehicle entity handle
--- @param part string The service part name
--- @param currentMileage number The current mileage of the given service partt
function OnServicePartOverdue(vehicle, part, currentMileage)
if not DoesEntityExist(vehicle) then return end
local partConfig = Config.ServiceParts[part]
local T1GERServiceFaults = {
air_filter = {
code = "T1041",
description = "Air filter clogged. Reduces engine efficiency and airflow."
},
battery_coolant = {
code = "T1042",
description = "Battery coolant service overdue. May cause EV battery overheating."
},
brake_fluid = {
code = "T1043",
description = "Brake fluid degraded. Reduced braking performance likely."
},
brake_pad = {
code = "T1044",
description = "Brake pads worn. Increases stopping distance."
},
coolant = {
code = "T1045",
description = "Coolant needs replacement. Risk of engine overheating."
},
drive_belt = {
code = "T1046",
description = "Drive belt aging. May slip or snap under load."
},
fuel_filter = {
code = "T1047",
description = "Fuel filter clogged. Fuel delivery to engine may be impaired."
},
hv_wiring = {
code = "T1048",
description = "High-voltage wiring wear detected. EV motor efficiency at risk."
},
oil_filter = {
code = "T1049",
description = "Oil and filter replacement overdue. Increased engine wear."
},
spark_plugs = {
code = "T1050",
description = "Spark plugs degraded. Risk of misfiring and poor combustion."
},
steering_fluid = {
code = "T1051",
description = "Power steering fluid aging. Steering effort may increase."
},
tires = {
code = "T1052",
description = "Tire service needed. Reduced grip and safety."
},
transmission_fluid = {
code = "T1053",
description = "Transmission fluid degraded. May cause shift issues."
}
}
-- Add fault code to OBD
if GetResourceState("kq_obd") == "started" then
local fault = T1GERServiceFaults[part]
if fault then
local partConfig = Config.ServiceParts[part]
exports["kq_obd"]:AddFaultCode(vehicle, {
name = fault.code .. " - " .. partConfig.label,
description = fault.description,
component = part
})
end
end
end
--- Sync all owned vehicle plates from the server.
---@param serverPlates table<string, boolean>
RegisterNetEvent("t1ger_mechanic:client:syncOwnedPlates", function(serverPlates)
OwnedPlates = serverPlates
end)
--- Add a single owned vehicle plate to the local table.
---@param plate string
RegisterNetEvent("t1ger_mechanic:client:addOwnedPlate", function(plate)
OwnedPlates[plate] = true
end)
--- Remove a single owned vehicle plate from the local table.
---@param plate string
RegisterNetEvent("t1ger_mechanic:client:removeOwnedPlate", function(plate)
OwnedPlates[plate] = nil
end)
--- Check whether a vehicle entity is owned.
---@param entity number The vehicle entity handle.
---@return boolean
function IsOwnedVehicle(entity)
if not DoesEntityExist(entity) then return false end
local plate = exports["t1ger_mechanic"]:TrimPlate(GetVehicleNumberPlateText(entity))
return OwnedPlates[plate] == true
end
exports("IsOwnedVehicle", IsOwnedVehicle)--- Breakdown mission
function Breakdown()
local mission = Config.Missions.Types[curMission.type]
local location = Config.Missions.Locations[curMission.type][curMission.index]
local complete = false
-- create blip for npc vehicle:
curMission.blip = CreateMissionBlip(location.pos, mission.blip)
--- Checks if player is near the mission entity
--- @param entity number ped entity handle
--- @return boolean IsNearMissionPed `true` if near mission ped. `false` otherwise
local function IsNearMissionPed(entity)
if IsEntityValid(entity) and GetEntityType(entity) ~= 0 then
if not IsPedInAnyVehicle(player, false) and not IsPedInAnyVehicle(player, true) then
return true
end
end
return false
end
-- advanced notification:
if Config.Missions.UseAdvancedNotify then
local notifyIcon = Config.Missions.NotifyIcon
local title, subtitle, message = locale("advanced_notification.breakdown_title"), locale("advanced_notification.breakdown_subtitle"), locale("advanced_notification.breakdown_message")
_API.ShowAdvancedNotification(notifyIcon, notifyIcon, 6, title, false, subtitle, message)
else
local string = locale("advanced_notification.breakdown_title").."\n\n"..locale("advanced_notification.breakdown_subtitle").."\n\n"..locale("advanced_notification.breakdown_message")
-- Calculate dynamic duration (e.g., 50ms per character)
local perChar = 60
local minDuration = 3000
local maxDuration = 10000
local dynamicDuration = math.min(maxDuration, math.max(minDuration, #string * perChar))
_API.ShowNotification(string, "inform", {duration = dynamicDuration})
end
--- loop
while not complete do
Wait(1)
if Config.Missions.Locations[curMission.type][curMission.index].inUse then
local missionDist = #(coords - vector3(location.pos.x, location.pos.y, location.pos.z))
-- create mission npc vehicle:
if missionDist < 100.0 and not curMission.vehicle then
curMission.vehicle = CreateMissionVehicle(location.pos)
SetEntityAsMissionEntity(curMission.vehicle, true, true)
end
-- create mission npc ped:
if missionDist < 90.0 and not curMission.ped then
curMission.ped = CreateMissionPed(location.pedCoords, "WORLD_HUMAN_STAND_IMPATIENT")
SetEntityAsMissionEntity(curMission.ped, true, true)
local targetOptions = {}
targetOptions[#targetOptions+1] = {
name = "t1ger_mechanic:"..curMission.type..":ped",
icon = "fa-solid fa-comment",
label = locale("target.missions_ped_interact"),
canInteract = IsNearMissionPed,
distance = 2.0,
onSelect = function(entity)
TaskPedToEnterTowVehicle(entity, mission.blip)
end
}
_API.Target.AddLocalEntity(curMission.ped, targetOptions)
end
-- if vehicle attached and ped is inside towtruck:
if curMission.towtruck and IsEntityAttachedToEntity(curMission.vehicle, curMission.towtruck) and (GetPedInVehicleSeat(curMission.towtruck, 0) == curMission.ped) and not curMission.attached then
-- remove current blip:
RemoveBlip(curMission.blip)
-- create new blip:
curMission.blip = CreateMissionBlip(location.dropoff, mission.blip)
-- message:
_API.ShowNotification(locale("notification.breakdown_head_to_dropoff"), "inform", {})
-- marker settings:
local dropoffMarker = lib.marker.new({
type = 36,
coords = location.dropoff,
color = {r = 255, g = 0, b = 0, a = 200},
})
-- create drop off zone:
curMission.dropZone = lib.zones.sphere({
coords = location.dropoff,
radius = 15.0,
debug = false,
inside = function(zone)
if not IsEntityAttachedToAnyVehicle(curMission.vehicle) then
local vehicleCoords = GetEntityCoords(curMission.vehicle)
if curMission.dropZone:contains(vec3(vehicleCoords.x, vehicleCoords.y, vehicleCoords.z)) then
-- leave vehicle:
TaskLeaveVehicle(curMission.ped, curMission.towtruck, 0)
-- remove current blip:
RemoveBlip(curMission.blip)
-- add blip for ped:
curMission.blip = CreateMissionEntityBlip(curMission.ped, mission.blip, false)
-- remove zone/marker:
curMission.dropZone:remove()
-- create target:
local targetOptions = {}
targetOptions[#targetOptions+1] = {
name = "t1ger_mechanic:"..curMission.type..":ped",
icon = "fa-solid fa-comment",
label = locale("target.missions_ped_interact"),
canInteract = IsNearMissionPed,
distance = 2.0,
onSelect = function(entity)
local taskAnim = {dict = "mp_common", clip = "givetake2_a", flag = 49, blendIn = 4.0, blendOut = -4.0}
-- play anim on ped:
lib.requestAnimDict(taskAnim.dict)
TaskPlayAnim(entity, taskAnim.dict, taskAnim.clip, taskAnim.blendIn, taskAnim.blendOut, -1, taskAnim.flag, 1, 0, 0, 0)
-- progressbar callback:
local success = ProgressBar({
duration = 2000,
label = locale("progressbar.mission_reward"),
useWhileDead = false,
canCancel = true,
anim = taskAnim,
disable = {
move = true,
combat = true
}
})
if not success then return end
-- Remove Target
_API.Target.RemoveLocalEntity(entity, {names = {"t1ger_mechanic:"..curMission.type..":ped"}, labels = {locale("target.missions_ped_interact")}})
-- reward:
TriggerServerEvent("t1ger_mechanic:server:missionPayout", curMission.type, curMission.index, location.dropoff)
-- clean up:
RemoveBlip(curMission.blip)
ClearPedTasksImmediately(entity)
TaskWanderStandard(entity, 10.0, 10)
-- Delete entity:
DeleteEntity(curMission.vehicle)
-- Clean up:
Wait(10000)
curMission.cancel = true
end
}
_API.Target.AddLocalEntity(curMission.ped, targetOptions)
end
else
dropoffMarker:draw()
end
end
})
-- update attributed:
curMission.attached = true
end
end
if curMission.cancel then
complete = true
end
end
-- clean up entities and blip
if DoesEntityExist(curMission.vehicle) then DeleteVehicle(curMission.vehicle) end
if DoesEntityExist(curMission.ped) then DeleteEntity(curMission.ped) end
if DoesBlipExist(curMission.blip) then RemoveBlip(curMission.blip) end
-- sync inUse state:
TriggerServerEvent("t1ger_mechanic:server:missionInUse", curMission.type, curMission.index, false)
curMission = {}
end
---Tasks the ped to enter the tow truck vehicle
---@param ped entity the ped entity handle
function TaskPedToEnterTowVehicle(ped)
if not IsEntityAttachedToAnyVehicle(curMission.vehicle) then
return _API.ShowNotification(locale("notification.breakdown_vehicle_not_attached"), "inform", {})
end
-- validate towtruck:
curMission.towtruck = GetEntityAttachedTo(curMission.vehicle)
if not exports["t1ger_mechanic"]:IsVehicleTowTruck(curMission.towtruck) then
return _API.ShowNotification(locale("notification.breakdown_invalid_towtruck"), "inform", {})
end
-- check tow truck passenger seat:
if not IsVehicleSeatFree(curMission.towtruck, 0) then
return _API.ShowNotification(locale("notification.breakdown_passenger_seat_occupied"), "inform", {})
end
-- Remove Target
_API.Target.RemoveLocalEntity(ped, {names = {"t1ger_mechanic:"..curMission.type..":ped"}, labels = {locale("target.missions_ped_interact")}})
-- remove current blip:
RemoveBlip(curMission.blip)
-- add blip for ped:
curMission.blip = CreateMissionEntityBlip(ped, Config.Missions.Types[curMission.type].blip, false)
-- task for ped to enter towtruck vehicle
ClearPedTasksImmediately(ped)
FreezeEntityPosition(ped, false)
TaskEnterVehicle(ped, curMission.towtruck, 20000, 0, 1.0, 1, 0)
end---Creates target options for mission ped
---@param missionPed entity the entity handle for the mission ped
---@param missionType string type of mission
---@param missionData table mission data/config for the given type
local function CreateMissionPedTarget(missionPed, missionType, missionData)
--- Checks if player is near the mission entity
---@param entity number ped entity handle
---@return boolean IsNearMissionPed `true` if near mission ped. `false` otherwise
local function IsNearMissionPed(entity)
if IsEntityValid(entity) and GetEntityType(entity) ~= 0 then
if not IsPedInAnyVehicle(player, false) and not IsPedInAnyVehicle(player, true) then
return true
end
end
return false
end
local targetOptions = {
{
name = "t1ger_mechanic:"..missionType..":ped",
icon = "fa-solid fa-comment",
label = locale("target.missions_ped_interact"),
canInteract = IsNearMissionPed,
distance = 2.0,
onSelect = function(entity)
if curMission.collected then return end
-- check if vehicle is in zone:
if not curMission.vehicleInZone then
return _API.ShowNotification(locale("notification.carscrapping_veh_not_in_zone"), "inform", {})
end
-- check for npc is inspecting:
if curMission.inspecting then
return _API.ShowNotification(locale("notification.carscrapping_npc_is_inspecting"), "inform", {})
end
-- move npc to inspection coords:
if not curMission.inspected and not curMission.inspecting then
curMission.inspecting = true
-- task npc to the inspection point:
FreezeEntityPosition(entity, false)
SetEntityInvincible(entity, true)
TaskGoToCoordAnyMeans(entity, missionData.scrapyard.inspect.x, missionData.scrapyard.inspect.y, missionData.scrapyard.inspect.z, 1.0, 0, 0, 786603, 0xbf800000)
SetEntityHeading(entity, missionData.scrapyard.inspect.w)
Wait(6000)
FreezeEntityPosition(entity, true)
TaskStartScenarioInPlace(entity, missionData.scrapyard.scenarios["inspect"], 0, false)
Wait(5000)
-- update attributes:
curMission.inspected = true
curMission.inspecting = false
-- notify:
return _API.ShowNotification(locale("notification.carscrapping_inspect_complete"), "inform", {})
end
-- reward:
if curMission.inspected and not curMission.collected then
curMission.collected = true
local taskAnim = {dict = "mp_common", clip = "givetake2_a", flag = 49, blendIn = 4.0, blendOut = -4.0}
local pedCoords = GetEntityCoords(entity)
ClearPedTasksImmediately(entity)
ClearAreaOfObjects(pedCoords.x, pedCoords.y, pedCoords.z, 2.0, 0)
-- play anim on ped:
lib.requestAnimDict(taskAnim.dict)
TaskPlayAnim(entity, taskAnim.dict, taskAnim.clip, taskAnim.blendIn, taskAnim.blendOut, -1, taskAnim.flag, 1, 0, 0, 0)
-- progressbar callback:
local success = ProgressBar({
duration = 2000,
label = locale("progressbar.mission_reward"),
useWhileDead = false,
canCancel = true,
anim = taskAnim,
disable = {
move = true,
combat = true
}
})
if not success then
curMission.collected = false
return
end
-- Remove Target
_API.Target.RemoveLocalEntity(entity, {names = {"t1ger_mechanic:"..curMission.type..":ped"}, labels = {locale("target.missions_ped_interact")}})
-- reward:
TriggerServerEvent("t1ger_mechanic:server:missionScrap", curMission.type, NetworkGetNetworkIdFromEntity(entity), missionData.scrapyard.inspect)
-- clean up:
RemoveBlip(curMission.blip)
ClearPedTasksImmediately(entity)
FreezeEntityPosition(entity, false)
SetBlockingOfNonTemporaryEvents(entity, true)
Wait(500)
TaskGoToCoordAnyMeans(entity, missionData.scrapyard.ped.coords.x, missionData.scrapyard.ped.coords.y, missionData.scrapyard.ped.coords.z, 1.0, 0, 0, 786603, 0xbf800000)
SetEntityHeading(entity, missionData.scrapyard.ped.coords.w)
Citizen.Wait(5000)
DeleteEntity(entity)
curMission.cancel = true
end
end
},
}
_API.Target.AddLocalEntity(missionPed, targetOptions)
end
--- CarScrapping mission
function CarScrapping()
local mission = Config.Missions.Types[curMission.type]
local location = Config.Missions.Locations[curMission.type][curMission.index]
local complete = false
-- create blip for npc vehicle:
curMission.blip = CreateMissionBlip(location.pos, mission.blip)
-- advanced notification:
if Config.Missions.UseAdvancedNotify then
local notifyIcon = Config.Missions.NotifyIcon
local title, subtitle, message = locale("advanced_notification.carscrapping_title"), locale("advanced_notification.carscrapping_subtitle"), locale("advanced_notification.carscrapping_message")
_API.ShowAdvancedNotification(notifyIcon, notifyIcon, 6, title, false, subtitle, message)
else
local string = locale("advanced_notification.carscrapping_title").."\n\n"..locale("advanced_notification.carscrapping_subtitle").."\n\n"..locale("advanced_notification.carscrapping_message")
-- Calculate dynamic duration (e.g., 50ms per character)
local perChar = 60
local minDuration = 3000
local maxDuration = 10000
local dynamicDuration = math.min(maxDuration, math.max(minDuration, #string * perChar))
_API.ShowNotification(string, "inform", {duration = dynamicDuration})
end
--- loop
while not complete do
Wait(1)
if Config.Missions.Locations[curMission.type][curMission.index].inUse then
local missionDist = #(coords - vector3(location.pos.x, location.pos.y, location.pos.z))
-- create mission npc vehicle:
if missionDist < 100.0 and not curMission.vehicle then
curMission.vehicle = CreateMissionVehicle(location.pos)
SetEntityAsMissionEntity(curMission.vehicle, true, true)
-- remove current blip:
RemoveBlip(curMission.blip)
-- add blip for entity:
curMission.blip = CreateMissionEntityBlip(curMission.vehicle, mission.blip, true)
end
local dropoffDist = #(coords - mission.scrapyard.dropoff)
-- npc vehicle attached updater:
if curMission.vehicle ~= nil then
-- if attached:
if IsEntityAttachedToAnyVehicle(curMission.vehicle) and not curMission.attached then
curMission.attached = true
-- remove current blip:
RemoveBlip(curMission.blip)
-- create blip for npc vehicle:
curMission.blip = CreateMissionBlip(mission.scrapyard.dropoff, mission.blip)
-- message:
_API.ShowNotification(locale("notification.carscrapping_head_to_dropoff"), "inform", {})
end
-- if detached:
if not IsEntityAttachedToAnyVehicle(curMission.vehicle) and curMission.attached then
curMission.attached = false
-- remove current blip:
RemoveBlip(curMission.blip)
-- create blip for npc vehicle:
curMission.blip = CreateMissionEntityBlip(curMission.vehicle, mission.blip, true)
-- message:
if dropoffDist > 15.0 then
_API.ShowNotification(locale("notification.carscrapping_pickup_vehicle"), "inform", {})
end
end
end
if curMission.attached and dropoffDist <= 80.0 and not curMission.ped then
curMission.ped = CreateMissionPed(mission.scrapyard.ped.coords, mission.scrapyard.scenarios.idle)
SetEntityAsMissionEntity(curMission.ped, true, true)
-- create target:
CreateMissionPedTarget(curMission.ped, curMission.type, mission)
end
if curMission.attached and dropoffDist <= 80.0 and not curMission.dropZone then
-- marker settings:
local dropoffMarker = lib.marker.new({
type = 36,
coords = mission.scrapyard.dropoff,
color = {r = 255, g = 0, b = 0, a = 200},
})
-- create drop off zone:
curMission.dropZone = lib.zones.sphere({
coords = mission.scrapyard.dropoff,
radius = 15.0,
debug = false,
inside = function(zone)
dropoffMarker:draw()
if not IsEntityAttachedToAnyVehicle(curMission.vehicle) then
local vehicleCoords = GetEntityCoords(curMission.vehicle)
if #(vehicleCoords - mission.scrapyard.dropoff) <= 3.0 then
-- remove current blip:
RemoveBlip(curMission.blip)
-- create blip for scrapyard ped:
curMission.blip = CreateMissionEntityBlip(curMission.ped, mission.blip, false)
-- update attribute:
curMission.vehicleInZone = true
-- remove zone/marker:
curMission.dropZone:remove()
-- notify
_API.ShowNotification(locale("notification.carscrapping_start_inspection"), "inform", {})
end
end
end
})
end
end
if curMission.cancel then
complete = true
end
end
-- clean up entities and blip
if DoesEntityExist(curMission.vehicle) then DeleteVehicle(curMission.vehicle) end
if DoesEntityExist(curMission.ped) then DeleteEntity(curMission.ped) end
if DoesBlipExist(curMission.blip) then RemoveBlip(curMission.blip) end
-- sync inUse state:
TriggerServerEvent("t1ger_mechanic:server:missionInUse", curMission.type, curMission.index, false)
curMission = {}
endif not Config.Missions.Enable then
return
end
curMission = {}
---Opens the main menu for mechanic missions/jobs
---@param returnMenu boolean optional param. `true` returns to the mechanic action menu. `false` just closes menu
function MissionsMainMenu(returnMenu)
if not Config.Missions.Enable then return end
-- check if isMechanic:
local isMechanic, shopId = IsPlayerMechanic()
if not isMechanic then return end
local menuOptions = {}
-- populate menuOptions:
if curMission and next(curMission) then
menuOptions[#menuOptions+1] = {
title = locale("menu_title.missions_cancel"),
icon = Config.Missions.CancelIcon,
description = locale("menu_description.missions_cancel"),
onSelect = function()
curMission.cancel = true
end
}
else
if type(Config.Missions.Types) ~= "table" and next(Config.Missions.Types) == nil then return end
for missionType, mission in pairs(Config.Missions.Types) do
if mission.enable then
menuOptions[#menuOptions+1] = {
title = locale("menu_title.missions_"..missionType),
icon = mission.icon,
description = locale("menu_description.missions_"..missionType),
onSelect = function()
local missionIndex = GetMissionLocation(missionType)
if not missionIndex then return end
-- set data:
curMission = {type = missionType, index = missionIndex}
-- sync inUse state:
TriggerServerEvent("t1ger_mechanic:server:missionInUse", missionType, missionIndex, true)
-- start the mission:
if missionType == "breakdown" then
Breakdown()
elseif missionType == "roadsiderepair" then
RoadsideRepair()
elseif missionType == "carscrapping" then
CarScrapping()
end
end
}
end
end
end
-- check if menu options has data:
if not menuOptions or #menuOptions == 0 then
if returnMenu then
return lib.showContext("mechanic_action_menu")
end
return
end
-- sort options by title:
table.sort(menuOptions, function(a, b)
return a.title < b.title
end)
-- basic context menu settings:
local context = {
id = "mechanic_missions_main",
title = locale("menu_title.missions_main"),
options = menuOptions
}
-- return menu if true:
if returnMenu then
context.menu = "mechanic_action_menu"
end
-- register and show context:
lib.registerContext(context)
lib.showContext("mechanic_missions_main")
end
---Returns an available location for a given mission type
---@param missionType string the type of mission: `breakdown`, `roadsiderepair` or `carscrapping`
---@return missionIndex number the index of the mission location for the given mission type
function GetMissionLocation(missionType)
-- check if has ongoing mission:
if curMission and next(curMission) then
return _API.ShowNotification(locale("notification.have_ongoing_mission"), "inform", {})
end
-- validate locations for mission type:
if not Config.Missions.Locations[missionType] then
return error(string.format("[GetMissionLocation] the mission type '%s' does not exist in Config.Missions.Locations", missionType))
end
-- get random mission:
math.randomseed(GetGameTimer())
local missionIndex = math.random(1, #Config.Missions.Locations[missionType])
---Calculates travel distance between points and returns true/false on whether distance is greater than input distance
---@param pos vector4 coords to check travel distance for
---@param travelDistance number minimum required travel distance
---@return boolean ValidateTravelDistance `true` if travel distance is greater than input distance. `false` otherwise
local function ValidateTravelDistance(pos, travelDistance)
local distance = CalculateTravelDistanceBetweenPoints(coords.x, coords.y, coords.z, pos.x, pos.y, pos.z)
if distance > travelDistance then
return true
else
return false
end
end
-- check travel distance:
local travelDistance = ValidateTravelDistance(Config.Missions.Locations[missionType][missionIndex].pos, Config.Missions.Types[missionType].travelDistance)
local count = 0
-- find available location with valid travel distance:
while not travelDistance and count < 100 do
count = count + 1
missionIndex = math.random(1, #Config.Missions.Locations[missionType])
while Config.Missions.Locations[missionType].inUse and count < 100 do
missionIndex = math.random(1, #Config.Missions.Locations[missionType])
end
travelDistance = ValidateTravelDistance(Config.Missions.Locations[missionType][missionIndex].pos, Config.Missions.Types[missionType].travelDistance)
end
-- check if found available mission location:
if count == 100 then
_API.ShowNotification(locale("notification.no_missions_available"), "inform", {})
return
end
-- return mission index
return missionIndex
end
--- Event to update inUse state of mission location for given mission type:
RegisterNetEvent("t1ger_mechanic:client:missionInUse", function(missionType, missionIndex, inUse)
Config.Missions.Locations[missionType][missionIndex].inUse = inUse
end)
--- Command to open Missions Main Menu
if Config.Missions.Command.enable == true then
RegisterCommand(Config.Missions.Command.name, function()
MissionsMainMenu()
end, false)
end
---Creates a mission blip for the specific mission at given coords
---@param missionCoords vector3 coords of the mission
---@param missionBlip table mission blip settings
---@return integer blip the created blip handle
function CreateMissionBlip(missionCoords, missionBlip)
local blip = AddBlipForCoord(missionCoords.x, missionCoords.y, missionCoords.z)
SetBlipSprite(blip, missionBlip.sprite)
SetBlipColour(blip, missionBlip.color)
SetBlipScale(blip, missionBlip.scale)
SetBlipDisplay(blip, 4)
-- blip text:
AddTextEntry("MYBLIP", missionBlip.label)
BeginTextCommandSetBlipName("MYBLIP")
EndTextCommandSetBlipName(blip)
if missionBlip.route.enable then
SetBlipRoute(blip, true)
SetBlipRouteColour(blip, missionBlip.route.color)
end
return blip
end
---Creates a mission blip for the specific mission at given coords
---@param missionCoords vector3 coords of the mission
---@param missionBlip table mission blip settings
---@param routeEnable boolean enable/disable route to blip
---@return integer blip the created blip handle
function CreateMissionEntityBlip(missionEntity, missionBlip, routeEnable)
local blip = AddBlipForEntity(missionEntity)
SetBlipColour(blip, missionBlip.color)
SetBlipScale(blip, missionBlip.scale)
SetBlipDisplay(blip, 4)
-- blip text:
AddTextEntry("MYBLIP", missionBlip.label)
BeginTextCommandSetBlipName("MYBLIP")
EndTextCommandSetBlipName(blip)
-- route:
if routeEnable then
SetBlipRoute(blip, true)
SetBlipRouteColour(blip, missionBlip.color)
end
return blip
end
---Creates a mission vehicle with randomized vehicle model at given mission coords
---@param missionCoords vector4 coords & heading to spawn the vehicle
---@return vehicle entity the vehicle entity handle
function CreateMissionVehicle(missionCoords)
local missionVehicle = nil
ClearAreaOfVehicles(missionCoords.x, missionCoords.y, missionCoords.z, 5.0, false, false, false, false, false)
-- random vehicle
math.randomseed(GetGameTimer())
local index = math.random(#Config.Missions.RandomVehicles)
local vehicleModel = Config.Missions.RandomVehicles[index]
_API.SpawnVehicle(vehicleModel, vector3(missionCoords.x, missionCoords.y, missionCoords.z), missionCoords.w, false, function(spawnedVehicle)
SetEntityCoordsNoOffset(spawnedVehicle, missionCoords.x, missionCoords.y, missionCoords.z)
SetEntityHeading(spawnedVehicle, missionCoords.w)
SetVehicleOnGroundProperly(spawnedVehicle)
missionVehicle = spawnedVehicle
end, true)
while not DoesEntityExist(missionVehicle) do
Wait(10)
end
return missionVehicle
end
---Creates a mission ped with randomized ped models at given mission coords
---@param pedCoords vector4 coords and heading of the ped
---@param scenario string scenario for ped to play
---@return ped entity the ped entity handle
function CreateMissionPed(pedCoords, scenario)
-- ground coords:
local groundBool, groundZ = GetGroundZFor_3dCoord(pedCoords.x, pedCoords.y, pedCoords.z, false)
-- set relationship:
SetPedRelationshipGroupHash(player, GetHashKey("PLAYER"))
AddRelationshipGroup("NPC")
-- get random ped:
math.randomseed(GetGameTimer())
local index = math.random(#Config.Missions.RandomPeds)
local pedModel = Config.Missions.RandomPeds[index]
-- check if scrapyard:
if pedCoords == Config.Missions.Types["carscrapping"].scrapyard.ped.coords then
pedModel = Config.Missions.Types["carscrapping"].scrapyard.ped.model
end
-- request model:
lib.requestModel(pedModel)
-- create ped:
local missionPed = CreatePed(7, GetHashKey(pedModel), pedCoords.x, pedCoords.y, groundZ, pedCoords.w, 0, true, true)
-- networked:
NetworkRegisterEntityAsNetworked(missionPed)
SetNetworkIdCanMigrate(NetworkGetNetworkIdFromEntity(missionPed), true)
SetNetworkIdExistsOnAllMachines(NetworkGetNetworkIdFromEntity(missionPed), true)
-- settings:
SetPedDropsWeaponsWhenDead(missionPed, false)
SetEntityInvincible(missionPed, false)
SetEntityVisible(missionPed, true)
FreezeEntityPosition(missionPed, true)
-- scenario:
TaskStartScenarioInPlace(missionPed, scenario, 0, false)
SetPedKeepTask(missionPed, true)
TaskSetBlockingOfNonTemporaryEvents(missionPed, true)
-- apply relationship
SetPedRelationshipGroupHash(missionPed, GetHashKey("NPC"))
SetRelationshipBetweenGroups(0, GetHashKey("PLAYER"), GetHashKey("NPC"))
SetRelationshipBetweenGroups(0, GetHashKey("NPC"), GetHashKey("PLAYER"))
while not DoesEntityExist(missionPed) do
Wait(10)
end
-- return mission ped
return missionPed
end
---Creates a mission ped with randomized ped models inside given mission vehicle
---@param missionVehicle entity the entity handle of the mission vehicle
---@return ped entity the ped entity handle
function CreateMissionPedInsideVehicle(missionVehicle)
-- set relationship:
SetPedRelationshipGroupHash(player, GetHashKey("PLAYER"))
AddRelationshipGroup("NPC")
-- get random ped:
math.randomseed(GetGameTimer())
local index = math.random(#Config.Missions.RandomPeds)
local pedModel = Config.Missions.RandomPeds[index]
-- request model:
lib.requestModel(pedModel)
-- create ped:
local missionPed = CreatePedInsideVehicle(missionVehicle, 1, GetHashKey(pedModel), -1, true, true)
-- networked:
NetworkRegisterEntityAsNetworked(missionPed)
SetNetworkIdCanMigrate(NetworkGetNetworkIdFromEntity(missionPed), true)
SetNetworkIdExistsOnAllMachines(NetworkGetNetworkIdFromEntity(missionPed), true)
-- settings:
SetPedDropsWeaponsWhenDead(missionPed, false)
SetEntityInvincible(missionPed, false)
SetEntityVisible(missionPed, true)
SetPedKeepTask(missionPed, true)
TaskSetBlockingOfNonTemporaryEvents(missionPed, true)
-- apply relationship
SetPedRelationshipGroupHash(missionPed, GetHashKey("NPC"))
SetRelationshipBetweenGroups(0, GetHashKey("PLAYER"), GetHashKey("NPC"))
SetRelationshipBetweenGroups(0, GetHashKey("NPC"), GetHashKey("PLAYER"))
while not DoesEntityExist(missionPed) do
Wait(10)
end
-- return mission ped
return missionPed
end---Returns enabled repair types
---@param types table config table with repairTypes
---@return table repairTypes returns enabled repair types
local function GetEnabledRepairTypes(types)
local repairTypes = {}
for repairType, data in pairs(types) do
if data.enable then
repairTypes[#repairTypes+1] = tostring(repairType)
end
end
return repairTypes
end
--- Checks if player is near the mission ped entity
---@param entity number ped entity handle
---@return boolean IsNearMissionPed `true` if near mission ped. `false` otherwise
local function IsNearMissionPed(entity)
if IsEntityValid(entity) and GetEntityType(entity) ~= 0 then
local driver = GetPedInVehicleSeat(entity, -1)
if driver and driver ~= 0 then
if curMission.ped and DoesEntityExist(curMission.ped) and curMission.ped == driver then
local pedCoords = GetEntityCoords(curMission.ped)
if #(coords - pedCoords) < 1.4 then
return true
end
end
end
end
return false
end
---Returns if player is near the fuel tank of the vehicle
---@param entity vehicle the vehicle entity handle
---@return boolean IsNearFuelTank `true` if near fuel tank. `false` otherwise
local function IsNearFuelTank(entity)
local bones = {"petrolcap", "petroltank", "petroltank_l", "hub_lr", "engine"}
--- Gets vehicle fuel bone index
---@param vehicle entity the handle of the vehicle entity
---@return integer|nil boneIndex the index of the found bone or nil
local function GetVehicleFuelTankBoneIndex(vehicle)
-- loop bones and return boneIndex
for i = 1, #bones do
local boneIndex = GetEntityBoneIndexByName(vehicle, bones[i])
if boneIndex ~= -1 then
return boneIndex
end
end
end
-- get bone index:
local boneIndex = GetVehicleFuelTankBoneIndex(entity)
if not boneIndex or boneIndex == -1 then
print("this vehicle does not have a fuel bone. Please remove from your config...")
return false
end
-- get fuel cap position:
local fuelcapPosition = GetWorldPositionOfEntityBone(entity, boneIndex)
-- compare distance:
if fuelcapPosition and #(coords - fuelcapPosition) < 1.1 then
curMission.repairPosition = fuelcapPosition
return true
end
return false
end
---Returns if player is near the battery of the vehicle
---@param entity vehicle the vehicle entity handle
---@return boolean IsNearBattery `true` if near battery. `false` otherwise
local function IsNearBattery(entity)
-- get vehicle model dimensions
local min, max = GetModelDimensions(GetEntityModel(entity))
-- bonnet position:
local batteryPosition = GetOffsetFromEntityInWorldCoords(entity, 0.0, max.y + 0.10, 0.0)
-- compare distance:
if #(coords - batteryPosition) < 1.1 then
curMission.repairPosition = GetEntityCoords(entity)
return true
end
return false
end
---Returns if player is near the wheel/tire of the vehicle
---@param entity vehicle the vehicle entity handle
---@param wheelData table table containing the specific wheel data
---@return boolean IsNearTire `true` if near battery. `false` otherwise
local function IsNearTire(entity, wheelData)
-- get bone index:
local boneIndex = GetEntityBoneIndexByName(entity, wheelData.bone)
if not boneIndex or boneIndex == -1 then
print("this vehicle does not have a wheel bone. Please remove from your config...")
return false
end
-- get tire position:
local tirePosition = GetWorldPositionOfEntityBone(entity, boneIndex)
-- compare distance:
if tirePosition and #(coords - tirePosition) < 1.1 then
curMission.repairPosition = tirePosition
return true
end
return false
end
--- Checks if player is near the mission vehicle entity
---@param entity number vehicle entity handle
---@return boolean IsNearMissionVehicle `true` if near mission vehicle. `false` otherwise
local function IsNearMissionVehicle(entity)
if IsEntityValid(entity) and GetEntityType(entity) ~= 0 then
if curMission and curMission.repairType then
if curMission.repairType == "tire" then
if curMission.randomWheel and IsNearTire(entity, curMission.randomWheel) then
return true
end
elseif curMission.repairType == "battery" then
if IsNearBattery(entity) then
return true
end
elseif curMission.repairType == "fuel" then
if IsNearFuelTank(entity) then
return true
end
end
end
end
return false
end
---Creates target on the mission vehicle
---@param missionVehicle entity vehicle handle
---@param missionType string type of mission
local function CreateMissionVehicleTarget(missionVehicle, missionType)
local anims = {
fuel = {dict = "timetable@gardener@filling_can", clip = "gar_ig_5_filling_can", flag = 1, blendIn = 2.0, blendOut = 8.0},
battery = {dict = "mini@repair", clip = "fixing_a_player", flag = 1, blendIn = 1.0, blendOut = -1.0},
tire = {dict = "anim@amb@clubhouse@tutorial@bkr_tut_ig3@", clip = "machinic_loop_mechandplayer", flag = 1, blendIn = 8.0, blendOut = -2.0}
}
local targetOptions = {
{
name = "t1ger_mechanic:"..missionType..":vehicle",
icon = "fa-solid fa-toolbox",
label = locale("target.roadsiderepair_"..missionType),
canInteract = IsNearMissionVehicle,
distance = 2.0,
onSelect = function(entity)
if not curMission.repairPosition then
TaskTurnPedToFaceEntity(player, entity, 1000)
else
TaskTurnPedToFaceCoord(player, curMission.repairPosition.x, curMission.repairPosition.y, curMission.repairPosition.z, 1000)
end
Wait(1000)
if missionType == "battery" then
SetVehicleDoorOpen(entity, 4, 0, 0)
end
local success = ProgressBar({
duration = Config.Missions.Types["roadsiderepair"].duration,
label = locale("progressbar.roadsiderepair_"..missionType),
useWhileDead = false,
canCancel = true,
anim = anims[missionType],
disable = {
move = true,
combat = true
}
})
if not success then return end
-- remove item:
TriggerServerEvent("t1ger_mechanic:server:removeItem", curMission.repairItem, 1)
-- fix:
if missionType == "tire" then
SetVehicleTyreFixed(entity, curMission.randomWheel.index)
SetVehicleFixed(entity)
elseif missionType == "battery" then
SetVehicleEngineOn(entity, true, true, false)
SetVehicleDoorShut(entity, 4, 1, 1)
elseif missionType == "fuel" then
_API.SetVehicleFuel(entity, 100.0)
curMission.repaired = true
end
_API.Target.RemoveLocalEntity(entity, {names = {"t1ger_mechanic:"..missionType..":vehicle"}, labels = {locale("target.roadsiderepair_"..missionType)}})
curMission.repaired = true
-- notification
_API.ShowNotification(locale("notification.roadsiderepair_fixed"), "inform", {})
end
},
{
name = "t1ger_mechanic:"..missionType..":ped",
icon = "fa-solid fa-comment",
label = locale("target.missions_ped_interact"),
canInteract = IsNearMissionPed,
distance = 1.4,
onSelect = function(entity)
TaskTurnPedToFaceEntity(player, entity, -1)
Wait(1000)
if not curMission.repaired then
_API.ShowNotification(locale("notification.roadsiderepair_cannot_pay"), "inform", {})
ClearPedTasks(player)
else
if curMission.collected then return end
curMission.collected = true
-- play anim on player:
local taskAnim = {dict = "mp_common", clip = "givetake2_a", flag = 49, blendIn = 4.0, blendOut = -4.0}
lib.requestAnimDict(taskAnim.dict)
TaskPlayAnim(player, taskAnim.dict, taskAnim.clip, taskAnim.blendIn, taskAnim.blendOut, -1, taskAnim.flag, 1, 0, 0, 0)
Wait(2000)
-- remove target:
_API.Target.RemoveLocalEntity(curMission.vehicle, {names = {"t1ger_mechanic:"..missionType..":ped"}, labels = {locale("target.missions_ped_interact")}})
-- give money:
local vehicleCoords = GetEntityCoords(entity)
TriggerServerEvent("t1ger_mechanic:server:missionPayout", curMission.type, curMission.index, vehicleCoords)
ClearPedTasks(player)
-- remove blip:
if DoesBlipExist(curMission.blip) then
RemoveBlip(curMission.blip)
end
-- cleanup:
Wait(500)
SetVehicleCanBeUsedByFleeingPeds(curMission.vehicle, true)
TaskVehicleDriveWander(curMission.ped, curMission.vehicle, 80.0, 786603)
Wait(3000)
TaskSmartFleePed(curMission.ped, player, 40.0, 20000)
Wait(4000)
curMission.cancel = true
end
end
}
}
-- create target:
_API.Target.AddLocalEntity(missionVehicle, targetOptions)
end
--- RoadsideRepair mission
function RoadsideRepair()
local mission = Config.Missions.Types[curMission.type]
local location = Config.Missions.Locations[curMission.type][curMission.index]
local complete = false
-- create blip for npc vehicle:
curMission.blip = CreateMissionBlip(location.pos, mission.blip)
-- get enabled repair types:
local repairTypes = GetEnabledRepairTypes(mission.types)
if not repairTypes or next(repairTypes) == nil then
return error("[RoadsideRepair] No enabled repair types. Fix your Config.Missions!")
end
-- randomize repair type:
math.randomseed(GetGameTimer())
curMission.repairType = repairTypes[math.random(#repairTypes)]
-- required item:
curMission.repairItem = mission.types[curMission.repairType].item
local itemLabel = _API.Inventory.GetItemLabel(curMission.repairItem)
-- advanced notification:
if Config.Missions.UseAdvancedNotify then
local notifyIcon = Config.Missions.NotifyIcon
local title, subtitle, message = locale("advanced_notification.roadsiderepair_title"), mission.types[curMission.repairType].subtitle, locale("advanced_notification.roadsiderepair_message")
_API.ShowAdvancedNotification(notifyIcon, notifyIcon, 6, title, false, subtitle, message)
else
local string = locale("advanced_notification.roadsiderepair_title").."\n\n"..mission.types[curMission.repairType].subtitle.."\n\n"..locale("advanced_notification.roadsiderepair_message")
-- Calculate dynamic duration (e.g., 50ms per character)
local perChar = 60
local minDuration = 3000
local maxDuration = 10000
local dynamicDuration = math.min(maxDuration, math.max(minDuration, #string * perChar))
_API.ShowNotification(string, "inform", {duration = dynamicDuration})
end
--- loop
while not complete do
Wait(1)
if Config.Missions.Locations[curMission.type][curMission.index].inUse then
local missionDist = #(coords - vector3(location.pos.x, location.pos.y, location.pos.z))
-- create mission npc vehicle:
if missionDist < 100.0 and not curMission.vehicle then
curMission.vehicle = CreateMissionVehicle(location.pos)
SetEntityAsMissionEntity(curMission.vehicle, true, true)
-- set vehicle effects:
if curMission.repairType == "tire" then
curMission.randomWheel = BurstRandomTire(curMission.vehicle)
elseif curMission.repairType == "battery" then
SetVehicleEngineOn(curMission.vehicle, false, true, true)
elseif curMission.repairType == "fuel" then
_API.SetVehicleFuel(curMission.vehicle, 0.0)
end
end
-- create mission npc ped:
if missionDist < 90.0 and curMission.vehicle and DoesEntityExist(curMission.vehicle) and not curMission.ped then
curMission.ped = CreateMissionPedInsideVehicle(curMission.vehicle)
SetEntityAsMissionEntity(curMission.ped, true, true)
-- create target:
CreateMissionVehicleTarget(curMission.vehicle, curMission.repairType)
end
end
if curMission.cancel then
complete = true
end
end
-- clean up entities and blip
if DoesEntityExist(curMission.vehicle) then DeleteVehicle(curMission.vehicle) end
if DoesEntityExist(curMission.ped) then DeleteEntity(curMission.ped) end
if DoesBlipExist(curMission.blip) then RemoveBlip(curMission.blip) end
-- sync inUse state:
TriggerServerEvent("t1ger_mechanic:server:missionInUse", curMission.type, curMission.index, false)
curMission = {}
end
---Bursts a random tire on the vehicle and returns the affected random wheel data
---@param vehicle entity the entity handle
---@return table randomWheel returns the found random wheel data
function BurstRandomTire(vehicle)
-- get number of vehicle wheels:
local numWheels = tostring(GetVehicleNumberOfWheels(vehicle))
-- vehicle wheels data:
local vehicleWheels = _API.VehicleWheels[numWheels]
-- Convert keys to a simple array to pick a random one
local keys = {}
for k in pairs(vehicleWheels) do
table.insert(keys, k)
end
-- Pick a random wheel
math.randomseed(GetGameTimer())
local randomKey = keys[math.random(1, #keys)]
local randomWheel = vehicleWheels[randomKey]
-- burst tire
SetVehicleTyreBurst(vehicle, randomWheel.index, true, 1000.0)
return randomWheel
endlocal isCarryingBodyPart = false
local bodyPartProp = nil
local ptfxHandle = nil
local cancelInspection = false
local isInspecting = false
local isRepairing = false
local carryAnim = {dict = "anim@heists@box_carry@", clip = "idle", blendIn = 4.0, blendOut = 1.0, duration = -1, flags = 49}
--- Returns whether the player is currently carrying a body part prop
--- @return boolean
function IsCarryingBodyPart()
if isCarryingBodyPart or bodyPartProp ~= nil then
return true
else
return false
end
end
exports("IsCarryingBodyPart", IsCarryingBodyPart)
--- Play animation to carry the body part prop
local function CarryPropAnimation()
lib.requestAnimDict(carryAnim.dict)
TaskPlayAnim(player, carryAnim.dict, carryAnim.clip , carryAnim.blendIn, carryAnim.blendOut, carryAnim.duration, carryAnim.flags, 0, false, false, false)
end
--- Carry the body part prop: play anim and attach prop to player
--- @param prop table Prop data
local function CarryBodyPartProp(prop)
-- carry prop anim:
CarryPropAnimation(prop)
Wait(250)
bodyPartProp = CreateProp(prop.model, coords)
-- attach prop to player:
local boneIndex = GetPedBoneIndex(player, prop.boneId)
AttachEntityToEntity(bodyPartProp, player, boneIndex, prop.pos.x, prop.pos.y, prop.pos.z, prop.rot.x, prop.rot.y, prop.rot.z, true, true, false, true, 1, true)
end
--- Returns a table of all damaged or missing vehicle body parts grouped by type.
--- The top-level keys in the returned table match part names used in your item/config system:
--- "door", "hood", "trunk", "wheel", "window".
--- Each key maps to a table indexed by the parts native index (doorIndex, wheelIndex, or windowIndex).
--- Hood and trunk are included under their own keys and are indexed by their door index (usually 4 and 5).
--- @param vehicle number The vehicle entity handle.
--- @return table #Damaged parts grouped by part type and indexed by part index as string.
local function GetVehicleDamagedBodyParts(vehicle)
if not vehicle or not DoesEntityExist(vehicle) then return {} end
local damagedParts = {}
local doors = GetVehicleDoors(vehicle)
for doorIndex, doorData in pairs(doors) do
if doorData.isDamaged or doorData.isMissing then
local bodyType = "door"
if doorData.index == 4 then
bodyType = "hood"
elseif doorData.index == 5 then
bodyType = "trunk"
end
damagedParts[bodyType] = damagedParts[bodyType] or {}
damagedParts[bodyType][doorIndex] = doorData
end
end
local wheels = GetVehicleWheels(vehicle)
for wheelIndex, wheelData in pairs(wheels) do
if wheelData and (wheelData.isDamaged or wheelData.isMissing) then
damagedParts.wheel = damagedParts.wheel or {}
damagedParts.wheel[wheelIndex] = wheelData
end
end
local windows = GetVehicleWindows(vehicle)
for windowIndex, windowData in pairs(windows) do
if windowData and (windowData.isDamaged or windowData.isMissing) then
damagedParts.window = damagedParts.window or {}
damagedParts.window[windowIndex] = windowData
end
end
damagedParts.bodyHealth = GetVehicleBodyHealth(vehicle)
damagedParts.engineHealth = GetVehicleEngineHealth(vehicle)
return damagedParts
end
--- Returns whether damagedParts table has any entries
--- @param damagedParts table The table for damaged parts from the vehicle
--- @param filter? string Optional filter param to check for specific body part type: "door", "hood", "trunk", "wheel" or "window"
--- @return boolean
local function HasDamagedParts(damagedParts, filter)
if type(damagedParts) ~= "table" or next(damagedParts) == nil then
return false
end
if type(filter) == "string" and type(damagedParts[filter]) == "table" then
return next(damagedParts[filter]) ~= nil
end
for bodyType, parts in pairs(damagedParts) do
if type(parts) == "table" and next(parts) then
return true
end
end
return false
end
--- Returns whether player can use window part item
--- @param vehicle number The vehicle entity handle
--- @param damagedWindows table The damaged windows indexed by windowIndex
--- @return boolean
local function CanUseWindowPartItem(vehicle, damagedWindows)
if not vehicle or not DoesEntityExist(vehicle) then
return false
end
if type(damagedWindows) ~= "table" or next(damagedWindows) == nil then
return false
end
local doors = GetVehicleDoors(vehicle)
for windowIndex, windowData in pairs(damagedWindows) do
local correspondingDoor = doors[windowIndex]
if correspondingDoor then
if not correspondingDoor.isMissing then
return true -- Door exists and is intact
end
else
return true -- No door exists (e.g. windshields or rear windows on 2-door)
end
end
return false -- All windows either had missing doors or none passed validation
end
--- @param vehicle number The vehicle entity handle
--- @param bodyType string The type of body part: "door", "hood", "trunk", "wheel" or "window"
--- @param closestBodyPart table The closest body part data (label, boneName, boneIndex, index, wheelId etc.)
local function SetBodyPartFixed(vehicle, bodyType, closestBodyPart)
local vehState = Entity(vehicle).state
local damagedParts = vehState["t1ger_mechanic:damagedParts"]
local workflowTasks = vehState["t1ger_mechanic:workflowTasks"]
-- update task if matched
local taskUpdated = false
for taskId, task in pairs(workflowTasks or {}) do
if task.type == bodyType and task.index == closestBodyPart.index then
UpdateWorkflowTask(taskId, true)
task.completed = true
taskUpdated = true
end
end
if taskUpdated then
vehState:set("t1ger_mechanic:workflowTasks", workflowTasks, true)
end
-- clear from damaged parts
if damagedParts and damagedParts[bodyType] then
damagedParts[bodyType][tostring(closestBodyPart.index)] = nil
vehState:set("t1ger_mechanic:damagedParts", damagedParts, true)
end
-- full repair = reset health + clean workflowTasks
if not HasDamagedParts(damagedParts) then
damagedParts.bodyHealth = 1000.0
if Config.BodyRepair.FixEngineHealth then
damagedParts.engineHealth = 1000.0
end
if workflowTasks then
vehState:set("t1ger_mechanic:workflowTasks", nil, true)
end
_API.ShowNotification(locale("notification.body_repair_complete"), "success", {})
end
-- refresh vehicle body damage
vehState:set("t1ger_mechanic:refreshVehicleBody", {
damagedParts = damagedParts,
health = damagedParts.bodyHealth,
engineHealth = damagedParts.engineHealth,
wheelId = closestBodyPart.wheelId or nil
}, true)
end
--- Creates target on given vehicle for the repair of the body part
--- @param vehicle number The vehicle entity handle
--- @param bodyType string The type of body part: "door", "hood", "trunk", "wheel" or "window"
local function CreateBodyPartRepairTarget(vehicle, bodyType)
--- Returns whether the player is carrying body part prop and is near the repair vehicle
--- @param entity number The vehicle entity handle
--- @return boolean
local function IsNearRepairVehicle(entity)
if IsEntityValid(entity) and GetEntityType(entity) ~= 0 then
local vehCoords = GetEntityCoords(entity)
local vehDistance = #(coords - vehCoords)
if isRepairing then return false end
if vehDistance <= 7.0 and IsCarryingBodyPart() then
return true
end
end
return false
end
--- Returns cloest repair point and notification message (to be used if not found) for given body part
--- @param entity number The vehicle entity handle
--- @param partType string
--- @return table?
--- @return string
local function FindClosestBodyRepairPoint(entity, bodyType)
-- Define search radius per part type
local searchRadius = { door = 1.3, hood = 0.8, trunk = 0.8, window = 1.8, wheel = 1.3 }
-- Define corresponding function mappings
local partFunctions = {
door = GetVehicleClosestDoor,
hood = GetVehicleClosestHood,
trunk = GetVehicleClosestTrunk,
window = GetVehicleClosestWindow,
wheel = GetVehicleClosestWheel
}
-- Call the appropriate function if valid bodyType is provided
return partFunctions[bodyType] and partFunctions[bodyType](entity, searchRadius[bodyType], true) or nil
end
local partConfig = Config.BodyParts[bodyType]
-- Add target on the repair vehicle entity
_API.Target.AddLocalEntity(vehicle, {
{
name = "t1ger_mechanic:repair:body",
icon = Config.BodyRepair.TargetIcon,
label = string.format(locale("target.body_repair"), partConfig.label),
canInteract = IsNearRepairVehicle,
distance = 7.0,
onSelect = function(entity)
isRepairing = true
local closestBodyPart = FindClosestBodyRepairPoint(entity, bodyType)
if type(closestBodyPart) ~= "table" then
isRepairing = false
return _API.ShowNotification(locale("notification.body_repair_move_closer"), "inform", {})
end
-- Face vehicle
TaskTurnPedToFaceCoord(player, closestBodyPart.defaultBoneCoords.x, closestBodyPart.defaultBoneCoords.y, closestBodyPart.defaultBoneCoords.z, 1000.0)
Wait(1000)
-- Animation:
local anim = {}
if bodyType == "door" or bodyType == "wheel" then
anim = {dict = "anim@amb@clubhouse@tutorial@bkr_tut_ig3@", clip = "machinic_loop_mechandplayer", duration = -1, blendIn = 2.0, blendOut = 2.0, flag = 1}
elseif bodyType == "hood" or bodyType == "trunk" or bodyType == "window" then
anim = {dict = "mini@repair", clip = "fixing_a_player", duration = -1, blendIn = 2.0, blendOut = 2.0, flag = 1}
end
lib.requestAnimDict(anim.dict)
TaskPlayAnim(player, anim.dict, anim.clip, anim.blendIn, anim.blendOut, anim.duration, anim.flag, 0, 0, 0, 0)
Wait(500)
-- Start ptfx:
TriggerServerEvent("t1ger_mechanic:server:bodyRepairPtfx", "core", "ent_amb_foundry_arc_heat", closestBodyPart.defaultBoneCoords, vector3(0.0,0.0,0.0), 0.5)
-- Skillcheck
local skillcheck = false
if Config.BodyRepair.Skillcheck.enable then
skillcheck = SkillCheck(Config.BodyRepair.Skillcheck.difficulty, Config.BodyRepair.Skillcheck.inputs)
else
skillcheck = true
end
-- Return if not skillcheck success
if not skillcheck then
TriggerServerEvent("t1ger_mechanic:server:bodyRepairPtfx")
ClearPedTasks(player)
CarryPropAnimation(partConfig.prop)
isRepairing = false
return
end
-- Progressbar
local success = ProgressBar({
duration = Config.BodyRepair.Duration,
label = string.format(locale("progressbar.body_repair"), partConfig.label),
useWhileDead = false,
canCancel = true,
disable = {move = true, car = true, combat = true, sprint = true},
})
-- Return if not progressbar success
if not success then
TriggerServerEvent("t1ger_mechanic:server:bodyRepairPtfx")
ClearPedTasks(player)
CarryPropAnimation(partConfig.prop)
isRepairing = false
return
end
-- Remove ptfx
TriggerServerEvent("t1ger_mechanic:server:bodyRepairPtfx")
-- Remove Target
_API.Target.RemoveLocalEntity(entity, {names = {"t1ger_mechanic:repair:body"}, labels = {string.format(locale("target.body_repair"), partConfig.label)}})
-- Remove item
TriggerServerEvent("t1ger_mechanic:server:removeItem", partConfig.item, 1)
-- Set body part fixed if success
if success then
local ptfxData = {dict = "core", name = "sp_foundry_sparks"}
lib.requestNamedPtfxAsset(ptfxData.dict)
UseParticleFxAsset(ptfxData.dict)
local ptfx = StartNetworkedParticleFxNonLoopedAtCoord(ptfxData.name, closestBodyPart.defaultBoneCoords.x, closestBodyPart.defaultBoneCoords.y, closestBodyPart.defaultBoneCoords.z, 0.0, 0.0, 0.0, 0.5, 0, 0, 0)
SetBodyPartFixed(entity, bodyType, closestBodyPart)
end
-- Play repair sound
RepairSound()
-- Delete prop and clear tasks
DeleteEntity(bodyPartProp)
ClearPedTasks(player)
-- Cleanup
isCarryingBodyPart = false
bodyPartProp = nil
isRepairing = false
end
}
})
end
--- Function to trigger the useable item for the given body part
--- @param bodyType string The type of the used body part item ("door", "hood", "trunk", "wheel" or "window").
local function UseBodyPartItem(bodyType)
-- Only allow non-mechanics to use wheel repairs if allowed by config
if not IsPlayerMechanic() then
if Config.BodyRepair.AllowEveryoneToRepair or bodyType == "wheel" and Config.BodyRepair.AllowEveryoneForWheelRepair then
-- continue
else
return -- block use for non-mechanics
end
end
-- Check if the player is already carrying a body part prop
if IsCarryingBodyPart() then
return _API.ShowNotification(locale("notification.is_carrying_body_part"), "inform", {})
end
-- Get the closest vehicle
local vehicle, vehicleDist = lib.getClosestVehicle(coords, 5.0, false)
if not vehicle or not DoesEntityExist(vehicle) or not IsEntityAVehicle(vehicle) then
return _API.ShowNotification(locale("notification.no_vehicle_nearby"), "inform", {})
end
local partConfig = Config.BodyParts[bodyType]
-- Get damaged parts:
local damagedParts = GetVehicleDamagedBodyParts(vehicle)
if not HasDamagedParts(damagedParts) then
return _API.ShowNotification(string.format(locale("notification.no_body_repairs_required"), partConfig.label), "inform", {})
end
-- If the bodyType is a 'window', ensure that at least one valid, undamaged door exists
if bodyType == "window" and not CanUseWindowPartItem(vehicle, damagedParts[bodyType]) then
return _API.ShowNotification(locale("notification.body_repair_window_check"), "error", {})
end
-- Carry and attach the body part
isCarryingBodyPart = true
CarryBodyPartProp(partConfig.prop)
-- store damaged parts in statebag
local vehState = Entity(vehicle).state
vehState:set("t1ger_mechanic:damagedParts", damagedParts, true)
-- Create Target
CreateBodyPartRepairTarget(vehicle, bodyType)
while IsCarryingBodyPart() do
Wait(1000)
if not IsEntityPlayingAnim(player, carryAnim.dict, carryAnim.clip, 1) then
TaskPlayAnim(player, carryAnim.dict, carryAnim.clip , carryAnim.blendIn, carryAnim.blendOut, carryAnim.duration, carryAnim.flags, 0, false, false, false)
end
end
CancelBodyPartInstallation()
end
--- Cancels an ongoing body part installation
function CancelBodyPartInstallation()
ClearPedTasks(player)
if bodyPartProp and DoesEntityExist(bodyPartProp) then
DeleteEntity(bodyPartProp)
end
isCarryingBodyPart = false
bodyPartProp = nil
end
exports("CancelBodyPartInstallation", CancelBodyPartInstallation)
--- Event for using body part item:
RegisterNetEvent("t1ger_mechanic:client:useBodyPartItem", function(bodyType)
UseBodyPartItem(bodyType)
end)
--- Event for handling body repair ptfx:
RegisterNetEvent("t1ger_mechanic:client:bodyRepairPtfx", function(dict, name, pos, rot, scale)
if not dict then
StopParticleFxLooped(ptfxHandle, 0)
ptfxHandle = nil
else
lib.requestNamedPtfxAsset(dict)
UseParticleFxAsset(dict)
ptfxHandle = StartParticleFxLoopedAtCoord(name, pos.x, pos.y, pos.z, rot.x, rot.y, rot.z, scale, 0, 0, 0, 0)
end
end)
-- Statebag to refresh vehicle body & reapply damages:
AddStateBagChangeHandler("t1ger_mechanic:refreshVehicleBody" --[[key filter]], nil --[[bag filter]], function(bagName, key, value, _unused, replicated)
Wait(0)
local vehicle = GetEntityFromStateBagName(bagName)
if not vehicle or not DoesEntityExist(vehicle) then return end
if not value or replicated then return end
-- Set wheel health
if value.wheelId then
SetVehicleWheelHealth(vehicle, value.wheelId, 1000.0)
if GetResourceState("kq_wheeldamage") == "started" then
TriggerEvent("kq_wheeldamage:fixWheel", vehicle, value.wheelId)
end
end
-- Set vehicle fixed:
SetVehicleFixed(vehicle)
-- Reapply damages
for bodyType, parts in pairs(value.damagedParts or {}) do
if type(parts) == "table" and next(parts) then
for index, data in pairs(parts) do
if bodyType == "door" or bodyType == "hood" or bodyType == "trunk" then
SetVehicleDoorBroken(vehicle, data.index, true)
elseif bodyType == "wheel" then
BreakOffVehicleWheel(vehicle, data.wheelId, false, true, true, false)
elseif bodyType == "window" then
RemoveVehicleWindow(vehicle, data.index)
end
end
end
end
-- Set Body Health:
SetVehicleBodyHealth(vehicle, value.bodyHealth or 1000.0)
-- Set Engine Health:
SetVehicleEngineHealth(vehicle, value.engineHealth or 1000.0)
end)
--- Handles the body inspection process. Returns `true` if success otherwise `false`.
--- @param vehicle number The vehicle entity handle
--- @return boolean
local function VehicleInspectionHandle(vehicle)
local vehiclePoints = {
["front"] = {
anim = {dict = "mp_intro_seq@", clip = "mp_mech_fix", blendIn = 4.0, blendOut = 4.0, flag = 1},
inspected = false
},
["rear"] = {
anim = {dict = "anim@amb@clubhouse@tutorial@bkr_tut_ig3@", clip = "machinic_loop_mechandplayer", blendIn = 4.0, blendOut = 4.0, flag = 1, heading = 0.0},
inspected = false
},
["sideL"] = {
anim = {dict = "mp_car_bomb", clip = "car_bomb_mechanic", blendIn = 8.0, blendOut = 8.0, flag = 1, heading = -90.0},
inspected = false
},
["sideR"] = {
anim = {dict = "missmechanic", clip = "work2_base", blendIn = 4.0, blendOut = 4.0, flag = 1, heading = 90.0},
inspected = false
}
}
local function IsVehicleInspected(points)
for index, data in pairs(points) do
if not data.inspected then
return false
end
end
return true
end
local mk = Config.BodyRepair.Inspect.marker
local textUI = Config.BodyRepair.Inspect.textUI
local inspecting = false
_API.ShowNotification(locale("notification.body_inspect_start"), "inform", {})
cancelInspection = false
isInspecting = true
while isInspecting do
local sleep = true
Wait(1)
local vehicleCoords = GetEntityCoords(vehicle)
if #(coords - vehicleCoords) <= 20 then
local vehicleHeading = GetEntityHeading(vehicle)
local d1, d2 = GetModelDimensions(GetEntityModel(vehicle))
vehiclePoints["front"].coords = GetOffsetFromEntityInWorldCoords(vehicle, 0.0, (d2.y + 0.2), 0.0)
vehiclePoints["front"].heading = (vehicleHeading - 180.0)
vehiclePoints["rear"].coords = GetOffsetFromEntityInWorldCoords(vehicle, 0.0, (d1.y - 0.4), 0.0)
vehiclePoints["rear"].heading = vehicleHeading
vehiclePoints["sideL"].coords = GetOffsetFromEntityInWorldCoords(vehicle, (d1.x - 0.2), 0.0, 0.0)
vehiclePoints["sideL"].heading = (vehicleHeading - 90.0)
vehiclePoints["sideR"].coords = GetOffsetFromEntityInWorldCoords(vehicle, (d2.x + 0.3), 0.0, 0.0)
vehiclePoints["sideR"].heading = (vehicleHeading + 90.0)
for index, data in pairs(vehiclePoints) do
local dist = #(coords - data.coords)
if dist <= 5.0 and not data.inspected then
sleep = false
DrawMarker(mk.type, data.coords.x, data.coords.y, data.coords.z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, mk.scale.x, mk.scale.y, mk.scale.z, mk.color.r, mk.color.g, mk.color.b, mk.color.a, false, true, 0, true, false, false, false)
if dist <= 1.0 then
-- text ui:
if data.currentTextUIIndex ~= index then
lib.showTextUI(locale("textui.body_inspect"), {
position = textUI.position,
icon = textUI.icon,
style = textUI.style
})
data.currentTextUIIndex = index
end
-- keybind:
if IsControlJustReleased(0, Config.BodyRepair.Inspect.keybind) and not inspecting then
lib.hideTextUI()
inspecting = true
SetEntityHeading(player, data.heading)
local groundBool, groundZ = GetGroundZFor_3dCoord(data.coords.x, data.coords.y, data.coords.z, false)
SetEntityCoords(player, data.coords.x, data.coords.y, groundZ, 0.0, 0.0, 0.0, false)
if ProgressBar({
duration = Config.BodyRepair.Inspect.duration,
label = locale("progressbar.body_inspect"),
useWhileDead = false,
canCancel = true,
disable = { move = true, combat = true, car = true},
anim = data.anim
}) then
vehiclePoints[index].inspected = true
if IsVehicleInspected(vehiclePoints) then
isInspecting = false
break
end
end
inspecting = false
end
else
if data.currentTextUIIndex == index then
lib.hideTextUI()
data.currentTextUIIndex = nil
end
end
end
end
end
if cancelInspection then
break
end
if sleep then
Wait(1000)
end
end
local isOpen, text = lib.isTextUIOpen()
if isOpen and text == locale("textui.body_inspect") then
lib.hideTextUI()
end
SetPlayerDiagnosing(false)
if cancelInspection then
return false
end
return true
end
--- Cancels an ongoing vehicle body inspection
function CancelVehicleBodyInspection()
cancelInspection = true
end
exports("CancelInspection", CancelInspection)
--- Creates a table with workflow tasks indexed by taskId(number)
--- @param damagedParts table The damaged parts list of the vehicle
--- @return table
local function CreateWorkflowTasks(damagedParts)
local workflowTasks = {}
for bodyType, parts in pairs(damagedParts or {}) do
if type(parts) == "table" and next(parts) then
for index, data in pairs(parts) do
local taskId = (#workflowTasks + 1)
workflowTasks[taskId] = {
id = taskId,
name = string.format(Config.BodyRepair.WorkflowName, data.label),
completed = false,
label = data.label,
type = bodyType,
index = data.index
}
end
end
end
return workflowTasks
end
--- Inspect the vehicle body and initiate the workflow UI with damaged body parts if any
--- @param entity? number The vehicle entity handle
function InspectVehicleBody(entity)
if not IsPlayerMechanic() then return end
local vehicle = nil
if IsPlayerDiagnosing() then
return _API.ShowNotification(locale("notification.is_diagnosing"), "inform", {})
end
SetPlayerDiagnosing(true)
if type(entity) == "number" and DoesEntityExist(entity) and IsEntityAVehicle(entity) then
vehicle = entity
else
vehicle = lib.getClosestVehicle(coords, 4.0, false)
end
if not vehicle or not DoesEntityExist(vehicle) or not IsEntityAVehicle(vehicle) then
SetPlayerDiagnosing(false)
return _API.ShowNotification(locale("notification.no_vehicle_nearby"), "inform", {})
end
local vehicleInspected = VehicleInspectionHandle(vehicle)
isInspecting = false
if not vehicleInspected then
return _API.ShowNotification(locale("notification.body_inspect_cancelled"), "inform", {})
end
SetPlayerDiagnosing(false)
local vehState = Entity(vehicle).state
-- Get damaged parts:
local damagedParts = GetVehicleDamagedBodyParts(vehicle)
if not HasDamagedParts(damagedParts) then
-- refresh vehicle body damage
vehState:set("t1ger_mechanic:refreshVehicleBody", {
damagedParts = damagedParts,
health = 1000.0,
engineHealth = Config.BodyRepair.FixEngineHealth and 1000.0 or damagedParts.engineHealth,
wheelId = nil
}, true)
return _API.ShowNotification(locale("notification.body_repair_no_damage"), "inform", {})
end
-- Fix vehicle deformation
FixVehicleDeformation(vehicle)
_API.ShowNotification(locale("notification.body_inspection_complete"), "success", {})
-- Store in statebag for other mechanics/scripts
vehState:set("t1ger_mechanic:damagedParts", damagedParts, true)
-- Refresh vehicle body damage
vehState:set("t1ger_mechanic:refreshVehicleBody", {
damagedParts = damagedParts,
health = damagedParts.bodyHealth,
engineHealth = damagedParts.engineHealth,
wheelId = nil
}, true)
-- Store in statebag for other mechanics/scripts
local workflowTasks = CreateWorkflowTasks(damagedParts)
vehState:set("t1ger_mechanic:workflowTasks", workflowTasks, true)
-- trigger workflow UI
local plate = GetVehicleNumberPlateText(vehicle)
StartWorkflow(string.format(Config.BodyRepair.WorkflowTitle, plate), workflowTasks)
end
--- Command to trigger vehicle body inspection
if Config.BodyRepair.Inspect.command.enable then
RegisterCommand(Config.BodyRepair.Inspect.command.name, function(source, args, rawCommand)
InspectVehicleBody()
end)
end
--- Command to cancel vehicle body inspection
RegisterCommand(Config.BodyRepair.Inspect.cancel.command, function(source, args, rawCommand)
CancelVehicleBodyInspection()
end)
--- Command to cancel vehicle body part installation
RegisterCommand(Config.BodyRepair.CancelCommand, function(source, args, rawCommand)
CancelBodyPartInstallation()
end)
--- Target for inspect?
if Config.BodyRepair.Inspect.target.enable then
CreateThread(function()
while not _Target do Wait(100) end -- wait for target to initialize
--- Checks if player can use interact vehicle body
--- @param entity number entity handle
--- @return boolean
local function CanInteractVehicleBody(entity)
if IsEntityValid(entity) and GetEntityType(entity) ~= 0 then
if not IsCarryingBodyPart() and not IsCarryingComponent() and IsPlayerMechanic() then
if not Config.BodyRepair.Inspect.target.ownedVehiclesOnly then
return true
else
if IsOwnedVehicle(entity) then
return true
end
end
end
end
return false
end
-- target options
local options = {
{
name = "t1ger_mechanic:vehicle:bodyInspect",
icon = Config.BodyRepair.Inspect.target.icon,
label = locale("target.body_inspect"),
canInteract = CanInteractVehicleBody,
distance = 4.0,
onSelect = function(entity)
InspectVehicleBody(entity)
end
}
}
-- add global vehicle target:
_API.Target.AddGlobalVehicle(options)
end)
end--- Spawns an invisible, frozen duplicate of the given vehicle.
--- Useful for retrieving default bone positions without modifying the original vehicle.
--- @param originalVehicle number The entity handle of the vehicle to duplicate.
--- @return number # The entity handle of the duplicated vehicle.
local function SpawnDuplicateVehicle(originalVehicle)
local model = GetEntityModel(originalVehicle)
local coords = GetEntityCoords(originalVehicle)
local heading = GetEntityHeading(originalVehicle)
lib.requestModel(model)
local duplicateVehicle = CreateVehicle(model, coords, heading, false, false)
SetEntityVisible(duplicateVehicle, false, false) -- Make it invisible
FreezeEntityPosition(duplicateVehicle, true) -- Prevent it from moving
return duplicateVehicle
end
--- Calculates the offset from the vehicle center to the given bone.
--- @param vehicle number The vehicle entity handle
--- @param boneName string The bone name to calculate
--- @return vector3 # The relative offset of the bone from the vehicle center
local function GetBoneOffsetFromCenter(vehicle, boneName)
if not vehicle or not DoesEntityExist(vehicle) then return vector3(0, 0, 0) end
local boneIndex = GetEntityBoneIndexByName(vehicle, boneName)
if not boneIndex or boneIndex == -1 then return vector3(0, 0, 0) end
local vehicleCoords = GetEntityCoords(vehicle)
local boneCoords = GetEntityBonePosition_2(vehicle, boneIndex)
return (boneCoords - vehicleCoords)
end
--- Retrieves all doors of a given vehicle, indexed by doorIndex.
--- @param vehicle number The vehicle entity handle.
--- @return table<number, {label: string, boneName: string, boneIndex: number, index: number, coords: vector3, centerOffset: vector3, isDamaged: boolean, isMissing: boolean}>
function GetVehicleDoors(vehicle)
if not vehicle or not DoesEntityExist(vehicle) then return {} end
local vehicleDoors = {}
local centerCoords = GetEntityCoords(vehicle)
local heading = GetEntityHeading(vehicle)
-- Spawn invisible duplicate vehicle to get default bone positions
local duplicateVehicle = SpawnDuplicateVehicle(vehicle)
if not duplicateVehicle or not DoesEntityExist(duplicateVehicle) then
return {} -- fallback if duplicateVehicle failed somehow
end
local duplicateVehicleCoords = GetEntityCoords(duplicateVehicle)
-- Iterate vehicle doors
for doorIndex, doorData in pairs(_API.VehicleDoors or {}) do
if GetIsDoorValid(vehicle, doorData.index) then
local boneIndex = GetEntityBoneIndexByName(vehicle, doorData.bone)
local boneName = doorData.bone
-- Handle secondary bone if needed
if (not boneIndex or boneIndex == -1) and doorData.bone2 ~= nil then
boneIndex = GetEntityBoneIndexByName(vehicle, doorData.bone2)
boneName = doorData.bone2
end
if boneIndex and boneIndex ~= -1 then
local boneCoords = GetEntityBonePosition_2(vehicle, boneIndex)
vehicleDoors[doorIndex] = {
label = doorData.label,
bone = boneName,
boneIndex = boneIndex,
index = doorData.index,
coords = boneCoords,
centerOffset = GetBoneOffsetFromCenter(duplicateVehicle, boneName),
isDamaged = IsVehicleDoorDamaged(vehicle, doorData.index),
isMissing = (#(boneCoords - centerCoords) <= 0.1)
}
end
end
end
-- Cleanup
DeleteEntity(duplicateVehicle)
return vehicleDoors
end
--- Retrieves all wheels of a given vehicle, indexed by wheelIndex.
--- @param vehicle number The vehicle entity handle.
--- @return table<number, {label: string, boneName: string, boneIndex: number, index: number, wheelId: number, health: number, coords: vector3, centerOffset: vector3, isDamaged: boolean, isMissing: boolean}>
function GetVehicleWheels(vehicle)
if not vehicle or not DoesEntityExist(vehicle) then return {} end
local numWheels = GetVehicleNumberOfWheels(vehicle)
if not numWheels or numWheels <= 0 then return {} end
local vehicleWheels = {}
local centerCoords = GetEntityCoords(vehicle)
local heading = GetEntityHeading(vehicle)
-- Spawn invisible duplicate vehicle to get default bone positions
local duplicateVehicle = SpawnDuplicateVehicle(vehicle)
if not duplicateVehicle or not DoesEntityExist(duplicateVehicle) then
return {} -- fallback if duplicateVehicle failed somehow
end
local duplicateVehicleCoords = GetEntityCoords(duplicateVehicle)
-- Iterate vehicle wheels
for wheelIndex, wheelData in pairs(_API.VehicleWheels[tostring(numWheels)] or {}) do
local boneIndex = GetEntityBoneIndexByName(vehicle, wheelData.bone)
if boneIndex and boneIndex ~= -1 then
local boneCoords = GetEntityBonePosition_2(vehicle, boneIndex)
vehicleWheels[wheelIndex] = {
label = wheelData.label,
boneName = wheelData.bone,
boneIndex = boneIndex,
index = wheelData.index,
wheelId = wheelData.wheelId,
health = GetVehicleWheelHealth(vehicle, wheelData.wheelId),
coords = boneCoords,
centerOffset = GetBoneOffsetFromCenter(duplicateVehicle, wheelData.bone),
isDamaged = IsVehicleWheelDamaged(vehicle, wheelData.index),
isMissing = (#(boneCoords - centerCoords) <= 0.1)
}
end
end
-- Cleanup
DeleteEntity(duplicateVehicle)
return vehicleWheels
end
--- Retrieves all windows of a given vehicle, indexed by windowIndex.
--- @param vehicle number The vehicle entity handle.
--- @return table<number, {label: string, boneName: string, boneIndex: number, index: number, coords: vector3, centerOffset: vector3, isDamaged: boolean, isMissing: boolean}>
function GetVehicleWindows(vehicle)
if not vehicle or not DoesEntityExist(vehicle) then return {} end
local vehicleWindows = {}
local centerCoords = GetEntityCoords(vehicle)
local heading = GetEntityHeading(vehicle)
-- Spawn invisible duplicate vehicle to get default bone positions
local duplicateVehicle = SpawnDuplicateVehicle(vehicle)
if not duplicateVehicle or not DoesEntityExist(duplicateVehicle) then
return {} -- fallback if duplicateVehicle failed somehow
end
local duplicateVehicleCoords = GetEntityCoords(duplicateVehicle)
-- Iterate vehicle windows
for windowIndex, windowData in pairs(_API.VehicleWindows or {}) do
local boneIndex = GetEntityBoneIndexByName(vehicle, windowData.bone)
if boneIndex and boneIndex ~= -1 then
local boneCoords = GetEntityBonePosition_2(vehicle, boneIndex)
vehicleWindows[windowIndex] = {
label = windowData.label,
boneName = windowData.bone,
boneIndex = boneIndex,
index = windowData.index,
coords = boneCoords,
centerOffset = GetBoneOffsetFromCenter(duplicateVehicle, windowData.bone),
isDamaged = IsVehicleWindowDamaged(vehicle, windowData.index),
isMissing = (#(boneCoords - centerCoords) <= 0.1)
}
end
end
-- Cleanup
DeleteEntity(duplicateVehicle)
return vehicleWindows
end
--- Checks if a vehicle wheel is damaged, burst or broken off
--- @param vehicle number The vehicle entity handle
--- @param index number The wheel/tyre index (not wheelId)
--- @return boolean
function IsVehicleWheelDamaged(vehicle, index)
if type(index) ~= "number" and type(index) ~= "string" then return false end
if not vehicle or not DoesEntityExist(vehicle) then return false end
local numWheels = GetVehicleNumberOfWheels(vehicle)
if not numWheels or numWheels <= 0 then return false end
local vehicleWheels = _API.VehicleWheels[tostring(numWheels)]
if not vehicleWheels or not vehicleWheels[tostring(index)] then return false end
local wheelData = vehicleWheels[tostring(index)]
local isVehicleTyreBurst = IsVehicleTyreBurst(vehicle, wheelData.index, false)
local isVehicleWheelBrokenOff = IsVehicleWheelBrokenOff(vehicle, wheelData.bone)
local isVehicleWheelHealthLow = GetVehicleWheelHealth(vehicle, wheelData.wheelId) <= 100.0
return isVehicleTyreBurst or isVehicleWheelBrokenOff or isVehicleWheelHealthLow
end
--- Checks if a vehicle window is damaged (broken or missing)
--- @param vehicle number The vehicle entity handle
--- @param windowIndex number The window index
--- @return boolean
function IsVehicleWindowDamaged(vehicle, windowIndex)
if type(windowIndex) ~= "number" then
print("[IsVehicleWindowDamaged] Invalid type for windowIndex. Must be a number")
return false
end
if not vehicle or not DoesEntityExist(vehicle) then
return false
end
return not IsVehicleWindowIntact(vehicle, windowIndex)
end
--- Returns whether given wheel is broken off from the vehicle
--- @param vehicle number The vehicle entity handle.
--- @param wheelBone string The bone name of the given wheel
--- @return boolean
function IsVehicleWheelBrokenOff(vehicle, wheelBone)
if type(wheelBone) ~= "string" or wheelBone == "" then
print("[IsVehicleWheelBrokenOff] Invalid type for wheelBone. Must be a non-empty string")
return false
end
if not vehicle or not DoesEntityExist(vehicle) then return false end
local boneIndex = GetEntityBoneIndexByName(vehicle, wheelBone)
if not boneIndex or boneIndex == -1 then
print(string.format("[IsVehicleWheelBrokenOff] Boneindex for given wheel bone '%s' not found", wheelBone))
return false
end
local boneCoords = GetEntityBonePosition_2(vehicle, boneIndex)
local centerCoords = GetEntityCoords(vehicle)
if #(boneCoords - centerCoords) <= 0.1 then
return true -- Wheel is missing
end
return false
end
--- Calculates the real-time world position for a bone using centerCoords, heading, and centerOffset
--- @param centerCoords vector3 The center coords of the vehicle
--- @param heading number The heading of the vehicle
--- @param centerOffset vector3 The local offset of the bone from center
--- @return vector3
function CalculateBoneWorldCoords(centerCoords, heading, centerOffset)
return GetOffsetFromCoordAndHeadingInWorldCoords(centerCoords.x, centerCoords.y, centerCoords.z, heading, centerOffset.x, centerOffset.y, centerOffset.z)
end
--- Finds the closest vehicle wheel to the player
--- @param vehicle number The vehicle entity handle
--- @param maxDistance number The max distance to consider
--- @param checkDamage boolean? Only return wheels that are damaged or missing
--- @return table? #Returns nil if closestWheel not found
function GetVehicleClosestWheel(vehicle, maxDistance, checkDamage)
if not vehicle or not DoesEntityExist(vehicle) then return nil end
maxDistance = maxDistance or 2.5
local wheels = GetVehicleWheels(vehicle)
local closestWheel = nil
local closestDistance = maxDistance
local centerCoords = GetEntityCoords(vehicle)
local heading = GetEntityHeading(vehicle)
for wheelIndex, wheelData in pairs(wheels) do
if wheelData and wheelData.boneIndex and wheelData.coords then
-- if checking for damage, skip non-damaged/non-missing wheels
if checkDamage and not (wheelData.isDamaged or wheelData.isMissing) then
goto continue
end
-- get correct boneCoords
local defaultBoneCoords = CalculateBoneWorldCoords(centerCoords, heading, wheelData.centerOffset) or nil
local boneCoords = defaultBoneCoords or wheelData.coords
local dist = #(coords - boneCoords)
if dist < closestDistance then
closestDistance = dist
closestWheel = wheelData
closestWheel.defaultBoneCoords = defaultBoneCoords
end
end
::continue::
end
return closestWheel
end
--- Finds the closest vehicle window to the player.
--- Only returns a window if its corresponding door exists and is not missing.
--- @param vehicle number The vehicle entity handle
--- @param maxDistance number The max distance to consider
--- @param checkDamage boolean? Only return windows that are damaged or missing
--- @return table? #Returns nil if closestWindow not found
function GetVehicleClosestWindow(vehicle, maxDistance, checkDamage)
if not vehicle or not DoesEntityExist(vehicle) then return nil end
maxDistance = maxDistance or 2.5
local vehicleClass = GetVehicleClass(vehicle)
if vehicleClass == 10 or vehicleClass == 17 or vehicleClass == 20 then
maxDistance = (maxDistance * 1.8)
end
local windows = GetVehicleWindows(vehicle)
local doors = GetVehicleDoors(vehicle) -- cache all doors!
local closestWindow = nil
local closestDistance = maxDistance
local centerCoords = GetEntityCoords(vehicle)
local heading = GetEntityHeading(vehicle)
for windowIndex, windowData in pairs(windows) do
if windowData and windowData.boneIndex and windowData.coords then
-- Get corresponding door
local correspondingDoor = doors[windowIndex]
-- Check if door is missing
if correspondingDoor and correspondingDoor.isMissing then
goto continue
end
-- if checking for damage, skip non-damaged/non-missing windows
if checkDamage and not (windowData.isDamaged or windowData.isMissing) then
goto continue
end
-- get correct boneCoords
local defaultBoneCoords = CalculateBoneWorldCoords(centerCoords, heading, windowData.centerOffset) or nil
local boneCoords = defaultBoneCoords or windowData.coords
local dist = #(coords - boneCoords)
if dist < closestDistance then
closestDistance = dist
closestWindow = windowData
closestWindow.defaultBoneCoords = defaultBoneCoords
end
end
::continue::
end
return closestWindow
end
--- Finds the closest vehicle door (not hood or trunk) to the player.
--- @param vehicle number The vehicle entity handle
--- @param maxDistance number The max distance to consider
--- @param checkDamage boolean? Only return doors that are damaged or missing
--- @return table? #Returns nil if closestDoor not found
function GetVehicleClosestDoor(vehicle, maxDistance, checkDamage)
if not vehicle or not DoesEntityExist(vehicle) then return nil end
maxDistance = maxDistance or 2.5
-- Adjust max distance for certain vehicle classes
local vehicleClass = GetVehicleClass(vehicle)
if vehicleClass == 10 or vehicleClass == 17 or vehicleClass == 20 then
maxDistance = (maxDistance * 1.8)
end
local doors = GetVehicleDoors(vehicle)
local closestDoor = nil
local closestDistance = maxDistance
local centerCoords = GetEntityCoords(vehicle)
local heading = GetEntityHeading(vehicle)
for doorIndex, doorData in pairs(doors) do
-- if hood (4) or trunk (5) skip
if doorData.index == 4 or doorData.index == 5 then
goto continue
end
if doorData and doorData.boneIndex and doorData.coords then
-- if checking for damage, skip non-damaged/non-missing doors
if checkDamage and not (doorData.isDamaged or doorData.isMissing) then
goto continue
end
-- get correct boneCoords
local defaultBoneCoords = CalculateBoneWorldCoords(centerCoords, heading, doorData.centerOffset) or nil
local boneCoords = defaultBoneCoords or doorData.coords
local dist = #(coords - boneCoords)
if dist < closestDistance then
closestDistance = dist
closestDoor = doorData
closestDoor.defaultBoneCoords = defaultBoneCoords
end
end
::continue::
end
return closestDoor
end
--- Finds the closest vehicle hood to the player. Automatically detects if the hood is at the front or rear.
--- @param vehicle number The vehicle entity handle
--- @param maxDistance number The max distance to consider
--- @param checkDamage boolean? Only return hood if damaged or missing
--- @return table? #Returns nil if hood not found
function GetVehicleClosestHood(vehicle, maxDistance, checkDamage)
if not vehicle or not DoesEntityExist(vehicle) then return nil end
maxDistance = maxDistance or 2.5
local vehicleClass = GetVehicleClass(vehicle)
if vehicleClass == 10 or vehicleClass == 17 or vehicleClass == 20 then
maxDistance = maxDistance * 1.8
end
local centerCoords = GetEntityCoords(vehicle)
local heading = GetEntityHeading(vehicle)
local doors = GetVehicleDoors(vehicle)
local hood = doors and doors[tostring(4)] -- door index 4 = hood
local min, max = GetModelDimensions(GetEntityModel(vehicle))
local frontPos = GetOffsetFromEntityInWorldCoords(vehicle, 0.0, max.y, 0.3)
if hood and hood.boneIndex then
if checkDamage and not (hood.isDamaged or hood.isMissing) then
return nil
end
local hoodCoords = hood.isMissing and CalculateBoneWorldCoords(centerCoords, heading, hood.centerOffset) or hood.coords
local min, max = GetModelDimensions(GetEntityModel(vehicle))
local rearPos = GetOffsetFromEntityInWorldCoords(vehicle, 0.0, min.y, 0.3)
local distanceToFront = #(hoodCoords - frontPos)
local distanceToRear = #(hoodCoords - rearPos)
local correctBoneCoords = (distanceToFront < distanceToRear) and frontPos or rearPos
local coords = GetEntityCoords(PlayerPedId())
local dist = #(coords - correctBoneCoords)
if dist <= maxDistance then
hood.defaultBoneCoords = correctBoneCoords
return hood
end
else
-- Fallback: Use front position directly
local coords = GetEntityCoords(PlayerPedId())
local dist = #(coords - frontPos)
maxDistance = maxDistance + 0.2
if dist <= maxDistance then
return {
defaultBoneCoords = frontPos,
isFallback = true
}
end
end
return nil
end
--- Finds the closest vehicle trunk to the player. Automatically prefers rear side of vehicle.
--- @param vehicle number The vehicle entity handle
--- @param maxDistance number The max distance to consider
--- @param checkDamage boolean? Only return trunk if damaged or missing
--- @return table? #Returns nil if trunk not found
function GetVehicleClosestTrunk(vehicle, maxDistance, checkDamage)
if not vehicle or not DoesEntityExist(vehicle) then return nil end
maxDistance = maxDistance or 2.5
local vehicleClass = GetVehicleClass(vehicle)
if vehicleClass == 10 or vehicleClass == 17 or vehicleClass == 20 then
maxDistance = maxDistance * 1.8
end
local doors = GetVehicleDoors(vehicle)
local centerCoords = GetEntityCoords(vehicle)
local heading = GetEntityHeading(vehicle)
local trunk = doors[tostring(5)] -- door index 5 = trunk
if not trunk or not trunk.boneIndex then
return nil
end
if checkDamage and not (trunk.isDamaged or trunk.isMissing) then
return nil
end
-- If trunk is missing, fallback to centerOffset calculated world coords
local trunkCoords
if trunk.isMissing then
trunkCoords = CalculateBoneWorldCoords(centerCoords, heading, trunk.centerOffset)
else
trunkCoords = trunk.coords
end
-- Detect front or rear
local min, max = GetModelDimensions(GetEntityModel(vehicle))
local frontPos = GetOffsetFromEntityInWorldCoords(vehicle, 0.0, max.y, 0.3)
local rearPos = GetOffsetFromEntityInWorldCoords(vehicle, 0.0, min.y, 0.3)
local distanceToFront = #(trunkCoords - frontPos)
local distanceToRear = #(trunkCoords - rearPos)
local correctBoneCoords = (distanceToRear < distanceToFront) and rearPos or frontPos
-- Final distance check against player
local dist = #(coords - correctBoneCoords)
if dist <= maxDistance then
trunk.defaultBoneCoords = correctBoneCoords
return trunk
end
return nil
end
--- Plays repair sound
function RepairSound()
PlaySoundFromEntity(-1, 'Hydraulics_Down', player, 'Lowrider_Super_Mod_Garage_Sounds', true, 0)
Wait(100)
PlaySoundFromEntity(-1, "Bar_Unlock_And_Raise", player, "DLC_IND_ROLLERCOASTER_SOUNDS", true, 0)
Wait(200)
PlaySoundFromEntity(-1, "Ride_Stop", player, "DLC_IND_ROLLERCOASTER_SOUNDS", true, 0)
--PlaySoundFromEntity(-1, "Bar_Unlock_And_Raise", player, "DLC_IND_ROLLERCOASTER_SOUNDS", true, 0)
--PlaySoundFromEntity(-1, "Bar_Lower_And_Lock", player, "DLC_IND_ROLLERCOASTER_SOUNDS", true, 0)
--PlaySoundFromEntity(-1, "Engine_fail", player, "DLC_PILOT_ENGINE_FAILURE_SOUNDS", true, 0)
--PlaySoundFromEntity(-1, "Ride_Stop", player, "DLC_IND_ROLLERCOASTER_SOUNDS", true, 0)
endlocal repairStations = {}
usingHoodAnim = false
--- Fully repairs the vehicle ped is inside
local function QuickRepair()
local vehicle = GetVehiclePedIsIn(player, false)
if not vehicle or not DoesEntityExist(vehicle) then return end
SetVehicleFixed(vehicle)
SetVehicleBodyHealth(vehicle, 1000.0)
SetVehicleEngineHealth(vehicle, 1000.0)
if Config.AdminRepair.Refuel then
_API.SetVehicleFuel(vehicle, 100.0)
end
if Config.AdminRepair.Parts then
-- core parts:
SetAllCorePartsHealth(vehicle, 100.0)
-- service parts:
SetAllServicePartsMileage(vehicle, 0)
end
RepairSound()
end
exports("QuickRepair", QuickRepair)
--- Command to fix vehicle:
if Config.AdminRepair.Enable then
RegisterCommand(Config.AdminRepair.Command, function(source, args, rawCommand)
if _API.Player.isAdmin then
QuickRepair()
end
end, false)
end
--- Player animation to close vehicle hood
--- @param vehicle number The vehicle entity handle
--- @param close boolean If `true` closes hood, otherwise `false` opens hood
function VehicleHoodAnimation(vehicle, close)
usingHoodAnim = true
if close then
if GetIsDoorValid(vehicle, 4) and not IsVehicleDoorDamaged(vehicle, 4) then
local anim = { dict = 'anim@heists@fleeca_bank@scope_out@return_case', clip = 'trevor_action', rot = vector3(0.0, 0.0, GetEntityHeading(player)), blendIn = 2.0, blendOut = 2.0, duration = 1000, flags = 49, time = 0.25 }
lib.requestAnimDict(anim.dict)
TaskPlayAnimAdvanced(player, anim.dict, anim.clip, coords.x, coords.y, coords.z, anim.rot.x, anim.rot.y, anim.rot.z, anim.blendIn, anim.blendOut, anim.duration, anim.flags, anim.time, 0, 0)
Wait(1000)
SetVehicleDoorShut(vehicle, 4, false)
Wait(1000)
end
ClearPedTasks(player)
else
if GetIsDoorValid(vehicle, 4) and not IsVehicleDoorDamaged(vehicle, 4) and GetVehicleDoorAngleRatio(vehicle, 4) <= 0.05 and not IsVehicleDoorFullyOpen(vehicle, 4) then
local anim = { dict = 'anim@heists@fleeca_bank@scope_out@return_case', clip = 'trevor_action', rot = vector3(0.0, 0.0, GetEntityHeading(player)), blendIn = 2.0, blendOut = 2.0, duration = 1000, flags = 49, time = 0.25 }
lib.requestAnimDict(anim.dict)
TaskPlayAnimAdvanced(player, anim.dict, anim.clip, coords.x, coords.y, coords.z, anim.rot.x, anim.rot.y, anim.rot.z, anim.blendIn, anim.blendOut, anim.duration, anim.flags, anim.time, 0, 0)
Wait(200)
SetVehicleDoorOpen(vehicle, 4, false, false)
Wait(1000)
end
end
usingHoodAnim = false
end
--- Use repair kit with given repairType
--- @param repairType string `"basic"` or `"advanced"`
local function UseRepairKit(repairType)
local repairKit = Config.RepairKits.Types[repairType]
if not repairKit then return end
local function IsAllowedToUseRepairKit(mechanicOnly, whitelistedJobs)
if type(mechanicOnly) == "boolean" and mechanicOnly == true then
local isMechanic, shopId = IsPlayerMechanic()
if isMechanic then
return true
end
else
return true
end
if type(whitelistedJobs) == "table" then
local playerJob = _API.Player:GetJob()
for _, job in pairs(whitelistedJobs or {}) do
if playerJob.name == job then
return true
end
end
end
return false
end
-- check if allowed on advanced
if repairType == "advanced" and not IsAllowedToUseRepairKit(repairKit.mechanicOnly, repairKit.whitelitedJobs) then
return _API.ShowNotification(locale("notification.repairkit_advanced_not_allowed"), "inform", {})
end
-- Get the closest vehicle
local vehicle, vehicleDist = lib.getClosestVehicle(coords, 5.0, false)
if not vehicle or not DoesEntityExist(vehicle) or not IsEntityAVehicle(vehicle) then
return _API.ShowNotification(locale("notification.no_vehicle_nearby"), "inform", {})
end
-- Is near the hood/engine?
local hood = GetVehicleClosestHood(vehicle, 0.8, false)
if not hood then
return _API.ShowNotification(locale("notification.must_be_near_engine_hood"), "inform", {})
end
-- Face vehicle
TaskTurnPedToFaceEntity(player, vehicle, 1000)
-- Open hood if exists
VehicleHoodAnimation(vehicle, false)
-- Play anim:
local anim = {dict = "mini@repair", clip = "fixing_a_player", blendIn = 2.0, blendOut = 2.0, flag = 1}
lib.requestAnimDict(anim.dict)
TaskPlayAnim(player, anim.dict, anim.clip, anim.blendIn, anim.blendOut, -1, anim.flag, 0, 0, 0, 0)
-- Skillcheck
local skillcheck = false
if Config.RepairKits.Skillcheck.enable then
skillcheck = SkillCheck(Config.RepairKits.Skillcheck.difficulty, Config.RepairKits.Skillcheck.inputs)
else
skillcheck = true
end
if not skillcheck then
ClearPedTasks(player)
VehicleHoodAnimation(vehicle, true)
return
end
-- Progress bar
local success = ProgressBar({
duration = Config.RepairKits.Duration,
label = locale("progressbar.repair_kit_"..tostring(repairType)),
useWhileDead = false,
canCancel = true,
disable = { move = true, combat = true }
})
if not success then
ClearPedTasks(player)
VehicleHoodAnimation(vehicle, true)
return
end
-- Remove item
TriggerServerEvent("t1ger_mechanic:server:removeItem", repairKit.item, 1)
-- Fix engine
local engineHealth = math.clamp(repairKit.engineHealth, 250.0, 1000.0)
SetVehicleEngineHealth(vehicle, engineHealth)
-- Fix body
if repairKit.repairBody then
SetVehicleFixed(vehicle)
SetVehicleBodyHealth(vehicle, 1000.0)
SetVehicleDoorOpen(vehicle, 4, false, true)
end
-- Repair sounds
RepairSound()
-- Clear Tasks
ClearPedTasks(player)
VehicleHoodAnimation(vehicle, true)
-- Notification
_API.ShowNotification(locale("notification.repairkit_"..tostring(repairType).."_success"), "success", {})
end
--- Event for using repair kit item:
RegisterNetEvent("t1ger_mechanic:client:useRepairKit", function(repairType)
UseRepairKit(repairType)
end)
--- Refreshes all repair stations
function RefreshRepairStations()
if repairStations and next(repairStations) then
for id, station in pairs(repairStations) do
-- remove blip:
if station.blip and DoesBlipExist(station.blip) then
RemoveBlip(station.blip)
end
-- remove point:
if station.point then
station.point.remove(station.point)
end
end
end
CreateRepairStations()
end
--- Returns whether player has access to given repair station
--- @param jobs table|nil Required jobs to check for. If table empty or nil it will return true.
--- @return boolean #returns whether the player can access the repair station or not
local function HasAccessToRepairStation(jobs)
if not jobs or (type(jobs) == "table" and next(jobs) == nil) then return true end
local playerJob = _API.Player:GetJob()
if not playerJob or not playerJob.name then return false end
for _, jobName in pairs(jobs) do
if playerJob.name == jobName then
return true
end
end
return false
end
--- Creates a blip for the repair station
--- @param pos vector3 The coords to create the blip at
--- @return integer #Returns the blip handle
local function CreateRepairStationBlip(pos)
local blip = AddBlipForCoord(pos.x, pos.y, pos.z)
SetBlipSprite(blip, Config.RepairStations.Blip.sprite)
SetBlipDisplay(blip, 4)
SetBlipScale(blip, Config.RepairStations.Blip.scale)
SetBlipColour(blip, Config.RepairStations.Blip.color)
SetBlipAsShortRange(blip, true)
BeginTextCommandSetBlipName("STRING")
AddTextComponentString(Config.RepairStations.Blip.name)
EndTextCommandSetBlipName(blip)
return blip
end
--- Creates repair stations
function CreateRepairStations()
for id, station in ipairs(Config.RepairStations.Locations) do
-- check if has access
if HasAccessToRepairStation(station.jobs) then
repairStations[id] = {}
-- create blip
if type(station.blip) == "boolean" and station.blip == true then
repairStations[id].blip = CreateRepairStationBlip(station.coords)
end
local mk = Config.RepairStations.Marker
local textUI = Config.RepairStations.TextUi
-- create ox point:
repairStations[id].point = lib.points.new({
coords = station.coords,
distance = 5.0,
jobs = station.jobs,
price = station.price,
onExit = function(point)
local isOpen, text = lib.isTextUIOpen()
if isOpen and text == locale("textui.repair_station") then
lib.hideTextUI()
end
end,
nearby = function(point)
if cache.vehicle and cache.seat == -1 then
-- draw marker:
DrawMarker(mk.type, point.coords.x, point.coords.y, point.coords.z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, mk.scale.x, mk.scale.y, mk.scale.z, mk.color.r, mk.color.g, mk.color.b, mk.color.a, false, true, 0, true, false, false, false)
-- distance to interact:
if point.currentDistance <= 1.5 then
-- text ui:
local isOpen, currentText = lib.isTextUIOpen()
if isOpen and currentText ~= locale("textui.repair_station") then
lib.showTextUI(locale("textui.repair_station"), {position = textUI.position, icon = textUI.icon, style = textUI.style})
else
lib.showTextUI(locale("textui.repair_station"), {position = textUI.position, icon = textUI.icon, style = textUI.style})
end
-- keybind:
if IsControlJustReleased(0, Config.RepairStations.Keybind) then
lib.hideTextUI()
OpenRepairStation(station)
end
else
local isOpen, currentText = lib.isTextUIOpen()
if isOpen and currentText == locale("textui.repair_station") then
lib.hideTextUI()
end
end
end
end
})
end
end
end
--- Repairs specific parts of the vehicle based on the repair type
--- @param vehicle number The vehicle entity to repair
--- @param repairType string The type of repair to perform ("engine", "body", "core_parts", "service_parts")
--- @param repairValue number The repair value to apply (clamped internally if needed)
local function RepairStationFixVehicle(vehicle, repairType, repairValue)
if repairType == "engine" then
local engineHealth = math.clamp(repairValue, 400.0, 1000.0)
SetVehicleEngineHealth(vehicle, engineHealth)
elseif repairType == "body" then
SetVehicleFixed(vehicle)
local numWheels = GetVehicleNumberOfWheels(vehicle)
local vehicleWheels = _API.VehicleWheels[tostring(numWheels)]
for index, wheel in pairs(vehicleWheels or {}) do
SetVehicleWheelHealth(vehicle, wheel.wheelId, 1000.0)
end
local bodyHealth = math.clamp(repairValue, 900.0, 1000.0)
SetVehicleBodyHealth(vehicle, bodyHealth)
elseif repairType == "core_parts" then
SetAllCorePartsHealth(vehicle, repairValue)
elseif repairType == "service_parts" then
SetAllServicePartsMileage(vehicle, repairValue)
end
end
--- Handles repair payment, progressbar, and invokes a callback upon successful repair
--- @param vehicle number The vehicle entity being repaired
--- @param price number The repair cost to deduct from the player
--- @param duration number The duration (in ms) for the repair progressbar
--- @param label string The label text to display in the progressbar
--- @param cb function Callback function to execute upon successful repair
local function StationRepairHandle(vehicle, price, duration, label, cb)
SetVehicleUndriveable(vehicle, true)
-- check if needs to pay
if price > 0 then
local paid = lib.callback.await("t1ger_mechanic:server:repairStationPay", false, price)
if not paid then
SetVehicleUndriveable(vehicle, false)
return _API.ShowNotification(locale("notification.not_enough_bank_money"), "inform", {})
end
end
-- Progress bar
local success = ProgressBar({
duration = duration,
label = label,
useWhileDead = false,
canCancel = true,
disable = { move = true, combat = true }
})
if success and cb then
cb()
end
-- Always re-enable vehicle AFTER repair is done (or cancelled)
SetVehicleUndriveable(vehicle, false)
end
--- Opens the main repair station menu
--- @param currentStation table Current station data, parsed when open menu from marker
function OpenRepairStation(currentStation)
local skipMechanicOnlineCheck = false
if not cache.vehicle or cache.seat ~= -1 then
return
end
local vehicle = cache.vehicle
if not DoesEntityExist(vehicle) then return end
-- If station is whitelisted (has jobs) and RestrictOnWhitelistedStations is false, skip mechanic check
if (type(currentStation.jobs) == "table" and next(currentStation.jobs)) and not Config.RepairStations.RestrictOnWhitelistedStations then
skipMechanicOnlineCheck = true
end
-- if check mechanic online
if not skipMechanicOnlineCheck then
local mechanicsOnline = lib.callback.await("t1ger_mechanic:server:getOnlineMechanicCount", false)
if mechanicsOnline >= Config.RepairStations.AllowIfMechanicCountBelow then
return _API.ShowNotification(string.format(locale("notification.repair_station_closed"), mechanicsOnline), "error", {})
end
end
local menuOptions = {}
if Config.RepairStations.Mode == "full" then
local price = Config.RepairStations.FullRepairPrice
local menuTitle = locale("menu_title.repair_station_type_full").." - "..Config.Currency..tostring(math.groupdigits(price))
if type(currentStation.free) == "boolean" and currentStation.free == true then
menuTitle = locale("menu_title.repair_station_type_full")
price = 0
end
menuOptions[#menuOptions+1] = {
title = menuTitle,
description = string.format(locale("menu_description.repair_station_type"), Config.RepairStations.FullRepairDuration/1000),
icon = Config.RepairStations.FullRepairIcon,
onSelect = function()
StationRepairHandle(vehicle, price, Config.RepairStations.FullRepairDuration, locale("progressbar.repair_station_type_full"), function()
for repairType, repair in pairs(Config.RepairStations.Repairs) do
if repair.enable then
RepairStationFixVehicle(vehicle, repairType, repair.value)
end
end
RepairSound()
end)
end,
}
else
for repairType, repair in pairs(Config.RepairStations.Repairs) do
if repair.enable then
local price = repair.price
local menuTitle = locale("menu_title.repair_station_type_"..repairType).." - "..Config.Currency..tostring(math.groupdigits(price))
if type(currentStation.free) == "boolean" and currentStation.free == true then
menuTitle = locale("menu_title.repair_station_type_"..repairType)
price = 0
end
menuOptions[#menuOptions+1] = {
title = menuTitle,
description = string.format(locale("menu_description.repair_station_type"), repair.duration/1000),
icon = repair.icon,
onSelect = function()
StationRepairHandle(vehicle, price, repair.duration, locale("progressbar.repair_station_type_"..repairType), function()
RepairStationFixVehicle(vehicle, repairType, repair.value)
RepairSound()
end)
end,
}
end
end
end
-- sort options by title:
table.sort(menuOptions, function(a, b)
return a.title < b.title
end)
lib.registerContext({
id = "repair_station_main",
title = locale("menu_title.repair_station_main"),
options = menuOptions,
})
lib.showContext("repair_station_main")
end-- Registers the admin menu context for managing mechanic shops.
lib.registerContext({
id = "admin_mechanic_menu",
title = locale("menu_title.admin_menu"),
options = {
-- view shops:
{
title = locale("menu_title.view_shops"),
icon = "list",
onSelect = function()
ViewShops("admin_mechanic_menu")
end
},
{
title = locale("menu_title.create_shop"),
icon = "plus",
onSelect = function()
CreateShop("admin_mechanic_menu")
end
}
},
})
-- Enable or disable mechanic admin menu
RegisterCommand(Config.Shop.Admin.menu.command.str, function()
-- Check if feature is enabled
if not Config.Shop.Admin.menu.enable then return end
-- Check if player is admin
if not _API.Player.isAdmin then
print("Only admins can use this command!")
return
end
-- Show admin menu
lib.showContext("admin_mechanic_menu")
end, false)
-- Only register the keybind if enabled in config
if Config.Shop.Admin.menu.keybind.enable then
RegisterKeyMapping(Config.Shop.Admin.menu.command.str, Config.Shop.Admin.menu.keybind.description, "keyboard", Config.Shop.Admin.menu.keybind.default)
end
-- Enable / disable command to open shop creator interface:
if Config.Shop.Creation.command.enable then
RegisterCommand(Config.Shop.Creation.command.str, function(source, args, rawCommand)
if _API.Player.isAdmin then
CreateShop()
else
print("Only admins can use this command!")
end
end, false)
end
-- Enable / disable command to open shop management interface:
if Config.Shop.Management.command.enable then
RegisterCommand(Config.Shop.Management.command.str, function(source, args, rawCommand)
if _API.Player.isAdmin then
ViewShops()
else
print("Only admins can use this command!")
end
end, false)
end
--- Function to create a mechanic shop:
--- @param returnMenu string (optional) provide ox_lib context menuId to return
function CreateShop(returnMenu)
if not _API.Player.isAdmin then
return print("Only admins can create shop")
end
local ped = PlayerPedId()
local pedCoords = GetEntityCoords(ped)
local blipCoords = vector3(pedCoords.x, pedCoords.y, pedCoords.z)
-- Function to validate and sanitize job name
--- @param input string entered job name
local function SanitizeJobName(input)
-- Convert to lowercase
input = input:lower()
-- Remove any characters that are NOT letters or numbers (removes spaces, special characters, and underscores)
input = input:gsub("[^a-z0-9]", "")
return input
end
-- Define input fields for shop creation
local inputFields = {
{type = "input", label = locale("input_label.shop_name"), required = true, description = locale("input_description.shop_name")},
{type = "input", label = locale("input_label.job_name"), required = true, description = locale("input_description.job_name")},
{type = "input", label = locale("input_label.job_label"), required = true, description = locale("input_description.job_label")},
{type = "number", label = locale("input_label.account_start_balance"), required = true, default = 0, min = 0, description = locale("input_description.account_start_balance")},
}
-- blip enable?
table.insert(inputFields, {type = "checkbox", label = locale("input_label.create_blip"), checked = true})
-- blip input?
if Config.Shop.Creation.blip.input then
table.insert(inputFields, {type = "number", label = locale("input_label.blip_sprite"), required = true, default = Config.Shop.Creation.blip.sprite, min = 0, max = 826, description = locale("input_description.blip_sprite")})
table.insert(inputFields, {type = "number", label = locale("input_label.blip_color"), required = true, default = Config.Shop.Creation.blip.color, min = 0, max = 85, description = locale("input_description.blip_color")})
end
-- if shop sale is enabled
if Config.Shop.Sale then
table.insert(inputFields, {type = "number", label = locale("input_label.sale_price"), required = true, default = 0, min = 0, description = locale("input_description.sale_price")})
table.insert(inputFields, {type = "checkbox", label = locale("input_label.for_sale"), checked = true})
end
-- Open input dialog
local input = lib.inputDialog(locale("input_title.shop_creation"), inputFields)
-- If canceled, exit function
if not input then
if returnMenu then
return lib.showContext(returnMenu)
else
return
end
end
local sprite = Config.Shop.Creation.blip.input and input[6] or Config.Shop.Creation.blip.sprite
local color = Config.Shop.Creation.blip.input and input[7] or Config.Shop.Creation.blip.color
local sale_price = Config.Shop.Sale and input[8] or nil
local for_sale = Config.Shop.Sale and input[9] or false
-- Construct shop data payload
local shop = {
name = input[1],
job = {
name = SanitizeJobName(input[2]),
label = input[3]
},
account = input[4],
sale_price = sale_price,
for_sale = for_sale,
blip = {
enable = input[5],
coords = blipCoords,
sprite = sprite,
color = color,
scale = Config.Shop.Creation.blip.scale,
display = Config.Shop.Creation.blip.display
},
}
-- Trigger server event to create shop
TriggerServerEvent("t1ger_mechanic:server:createShop", shop)
end
exports("CreateShop", CreateShop)
-- Function to register context for viewing shops
function RegisterViewShopsContext(returnMenu)
-- Ensure Shops exists and is valid
if not Shops or not next(Shops) then return end
local menuOptions = {}
for id, shop in pairs(Shops) do
local ownerName = nil
-- Find the owners character name
if shop.employees then
for _, v in pairs(shop.employees) do
if v.identifier == shop.owner then
ownerName = v.name
break -- Stop searching once owner is found
end
end
end
-- Ensure shop.job exists before accessing label and name
local jobLabel = shop.job and shop.job.label or locale("menu_metadata.not_answered")
local jobName = shop.job and shop.job.name or locale("menu_metadata.not_answered")
local metadata = {
{label = locale("menu_metadata.id"), value = id},
{label = locale("menu_metadata.job"), value = ("%s [%s]"):format(jobLabel, jobName)},
}
if ownerName then
metadata[#metadata+1] = {label = locale("menu_metadata.owner"), value = ownerName}
metadata[#metadata+1] = {label = locale("menu_metadata.owner_id"), value = shop.owner or locale("menu_metadata.not_answered")}
end
-- Insert shop option into menu
table.insert(menuOptions, {
title = shop.name,
icon = "people-group",
args = shop.id,
metadata = metadata,
onSelect = function(args)
ManageShop(id, returnMenu)
end
})
end
-- Prepare context data
local context = {
id = "view_mechanic_shops",
title = locale("menu_title.view_shops"),
options = menuOptions
}
if returnMenu then
context.menu = returnMenu
end
-- Register the menu once
lib.registerContext(context)
end
--- Function to display the list of mechanic shops in a menu.
--- @param returnMenu (string) Menu ID to return to if entered from a menu.
function ViewShops(returnMenu)
if type(Shops) == 'table' and next(Shops) then
RegisterViewShopsContext(returnMenu)
lib.showContext("view_mechanic_shops")
else
_API.ShowNotification(locale("notification.no_mechanic_shops"), "inform", {})
if returnMenu then
lib.showContext(returnMenu)
end
end
end
exports("ViewShops", ViewShops)
-- Function to register context for manage shop:
function RegisterManageShopContext(shopId, returnMenu)
if not Shops[shopId] or not next(Shops[shopId]) then
print("[RegisterManageShopContext] Could not find shop data for shop id: ", shopId)
return lib.showContext("view_mechanic_shops")
end
-- get shop account
local shopAccount = lib.callback.await("t1ger_mechanic:server:getShopAccount", false, shopId)
-- menu options
local menuOptions = {
-- set owner:
{
title = locale("menu_title.set_owner"),
description = locale("menu_description.set_owner"),
icon = "crown",
onSelect = function()
SetOwner(shopId, returnMenu)
end
},
-- set account:
{
title = locale("menu_title.set_account_bal"),
description = locale("menu_description.set_account_bal"):format(math.groupdigits(shopAccount)),
icon = "dollar",
onSelect = function()
SetAccount(shopId, shopAccount, returnMenu)
end
},
-- marker management:
{
title = locale("menu_title.marker_management"),
description = locale("menu_description.marker_management"),
icon = "arrow-pointer",
arrow = true,
onSelect = function()
MarkerManagement(shopId, returnMenu)
end
},
-- delete shop:
{
title = locale("menu_title.delete_shop"),
description = locale("menu_description.delete_shop"),
icon = "trash",
onSelect = function()
DeleteShop(shopId, "manage_mechanic_shop")
end
},
}
if Config.Shop.Sale then
local optionTitle, optionDescription, canCancel = locale("menu_metadata.not_answered"), locale("menu_metadata.not_answered"), false
if Shops[shopId].for_sale and type(Shops[shopId].sale_price) == "number" then
optionTitle = locale("menu_title.cancel_sale")
optionDescription = string.format(locale("menu_description.cancel_sale"), Config.Currency..tostring(math.groupdigits(Shops[shopId].sale_price)))
canCancel = true
else
optionTitle = locale("menu_title.list_for_sale")
optionDescription = locale("menu_description.list_for_sale")
end
menuOptions[#menuOptions+1] = {
title = optionTitle,
icon = "tags",
description = optionDescription,
onSelect = function()
if canCancel then
TriggerServerEvent("t1ger_mechanic:server:cancelShopSale", shopId)
Shops[shopId].for_sale = false
Shops[shopId].sale_price = nil
Wait(100)
RegisterManageShopContext(shopId, returnMenu)
return lib.showContext("manage_mechanic_shop")
else
-- Show input dialog for setting shop account balance
local input = lib.inputDialog(locale("input_title.list_for_sale"), {
{type = "number", label = locale("input_label.sale_price"), icon = "money-bill", min = 0, default = 0, required = true, placeholder = 100, description = locale("input_description.sale_price")}
})
-- If the user closes or cancels the dialog
if not input then
return lib.showContext("manage_mechanic_shop")
end
-- Ensure the entered amount is a valid number and greater than 0
local amount = tonumber(input[1])
if not amount or amount < 0 then
_API.ShowNotification(locale("notification.min_sale_price"), "inform", {})
return lib.showContext("manage_mechanic_shop")
end
TriggerServerEvent("t1ger_mechanic:server:listShopForSale", shopId, amount)
Shops[shopId].for_sale = true
Shops[shopId].sale_price = amount
Wait(100)
RegisterManageShopContext(shopId, returnMenu)
return lib.showContext("manage_mechanic_shop")
end
end
}
end
local context = {
id = "manage_mechanic_shop",
title = locale("menu_title.manage_shop"):format(Shops[shopId].name, Shops[shopId].id),
menu = "view_mechanic_shops",
onBack = function()
RegisterViewShopsContext(returnMenu)
end,
options = menuOptions
}
--- Registers the admin menu context for managing mechanic shops.
lib.registerContext(context)
end
-- function to manage a shop
function ManageShop(shopId, returnMenu)
RegisterManageShopContext(shopId, returnMenu)
lib.showContext("manage_mechanic_shop")
end
--- Function to set or manage a shop owner.
--- @param shopId (number) The ID of the shop.
--- @param returnMenu (string) The menu to return to after selection.
function SetOwner(shopId, returnMenu)
local players = {}
-- If the shop already has a owner, allow removal
local ownerId = Shops[shopId].owner
if ownerId then
local ownerName = locale("menu_metadata.not_answered")
-- Find the owner character name (optimized loop)
if Shops[shopId].employees then
for _, v in pairs(Shops[shopId].employees) do
if v.identifier == ownerId then
ownerName = v.name
break -- Stop loop early once the owner is found
end
end
end
-- Add option to remove the current owner
players[1] = {
title = locale("menu_title.remove_current_owner"),
icon = "trash",
description = locale("menu_description.remove_current_owner"),
metadata = {
{label = locale("menu_metadata.owner"), value = ownerName},
{label = locale("menu_metadata.owner_id"), value = ownerId},
},
onSelect = function()
TriggerServerEvent("t1ger_mechanic:server:setOwner", shopId, ownerId, true)
Wait(100)
RegisterManageShopContext(shopId, returnMenu)
return lib.showContext("manage_mechanic_shop")
end
}
end
-- Fetch online players
local results = lib.callback.await("t1ger_mechanic:server:getOnlinePlayers", false)
if results and next(results) then
for _, player in pairs(results) do
table.insert(players, {
title = player.name,
icon = "user",
metadata = {
{label = locale("menu_metadata.player_id"), value = player.source},
{label = locale("menu_metadata.player_name"), value = player.name},
},
onSelect = function()
TriggerServerEvent("t1ger_mechanic:server:setOwner", shopId, player)
Wait(100)
RegisterManageShopContext(shopId, returnMenu)
return lib.showContext("manage_mechanic_shop")
end
})
end
end
if #players <= 0 then
_API.ShowNotification(locale("notification.no_online_players"), "inform", {})
return lib.showContext("manage_mechanic_shop")
end
-- Register and show the context menu for setting the owner
lib.registerContext({
id = "set_shop_owner",
title = locale("menu_title.set_owner"),
menu = "manage_mechanic_shop",
onBack = function()
RegisterManageShopContext(shopId, returnMenu)
end,
options = players
})
lib.showContext("set_shop_owner")
end
--- Function to set the mechanic shop"s account balance.
--- @param shopId number The ID of the shop.
--- @param shopAccount number the current shop account balance
--- @param returnMenu string The menu to return to after setting the balance.
function SetAccount(shopId, shopAccount, returnMenu)
-- Show input dialog for setting shop account balance
local input = lib.inputDialog(locale("input_title.set_account_balance"), {
{type = "input", label = locale("input_label.account_current_balance"), icon = "sack-dollar", disabled = true, default = tostring(math.groupdigits(shopAccount))},
{type = "number", label = locale("input_label.account_enter_amount"), icon = "money-bill-trend-up", min = 1, required = true, placeholder = 100, description = locale("input_description.account_enter_amount")}
})
-- If the user closes or cancels the dialog
if not input then
return lib.showContext("manage_mechanic_shop")
end
-- Ensure the entered amount is a valid number and greater than 0
local amount = tonumber(input[2])
if not amount or amount <= 0 then
_API.ShowNotification(locale("notification.input_amount_higher_0"), "success", {})
return lib.showContext("manage_mechanic_shop")
end
-- Send the updated balance to the server
TriggerServerEvent("t1ger_mechanic:server:setAccountMoney", shopId, amount)
RegisterManageShopContext(shopId, returnMenu)
return lib.showContext("manage_mechanic_shop")
end
--- Function to manage markers for a specific mechanic shop.
--- @param shopId number The ID of the shop for which markers are being managed.
--- @param returnMenu string The menu to return to after managing markers (optional).
function MarkerManagement(shopId, returnMenu)
-- Define menu options for marker management
local menuOptions = {
-- Create new marker option
{
title = locale("menu_title.create_marker"),
icon = "plus",
description = locale("menu_description.create_marker"),
onSelect = function()
CreateMarker(shopId, returnMenu)
end
}
}
-- Check if the shop has existing markers
if Shops[shopId].markers and next(Shops[shopId].markers) then
local hasMarkers = false
for class, _ in pairs(Config.Shop.Markers) do
if Shops[shopId].markers[class] and next(Shops[shopId].markers[class]) then
hasMarkers = true
break
end
end
-- If markers exist, provide the option to view/edit them
if hasMarkers then
table.insert(menuOptions, {
title = locale("menu_title.view_markers"),
icon = "list",
description = locale("menu_description.view_markers"),
onSelect = function()
ViewMarkers(shopId, returnMenu)
end
})
end
end
-- Register and display the marker management menu
lib.registerContext({
id = "marker_management",
title = locale("menu_title.marker_management"),
menu = "manage_mechanic_shop",
onBack = function()
RegisterManageShopContext(shopId, returnMenu)
end,
options = menuOptions
})
lib.showContext("marker_management")
end
-- Function to register view markers context options:
local function RegisterViewMarkersContext(shopId, returnMenu)
local menuOptions = {}
if not Shops[shopId].markers or not next(Shops[shopId].markers) then
return lib.showContext("marker_management")
end
for class,markers in pairs(Shops[shopId].markers) do
for markerId,marker in pairs(markers) do
menuOptions[#menuOptions + 1] = {
title = marker.name or marker.id,
icon = Config.Shop.Markers[class].icon,
onSelect = function()
ManageMarker(shopId, class, marker.id, marker, returnMenu)
end
}
end
end
if next(menuOptions) <= 0 then
return lib.showContext("marker_management")
end
lib.registerContext({
id = "view_shop_markers",
title = locale("menu_title.view_markers"),
menu = "marker_management",
options = menuOptions
})
end
--- Function to view markers for a given mechanic shop.
--- @param shopId (number) The ID of the shop whose markers are being viewed.
--- @param returnMenu (string) The menu to return to after viewing markers (optional).
function ViewMarkers(shopId, returnMenu)
-- Register the marker management context
RegisterViewMarkersContext(shopId, returnMenu)
-- Show the marker management menu
lib.showContext("view_shop_markers")
end
--- Function to edit an existing marker for a mechanic shop.
--- @param shopId (number) The ID of the shop to which the marker belongs.
--- @param class (string) The class/type of the marker (e.g., "storage", "workbench").
--- @param markerKey (number|string) The unique identifier of the marker.
--- @param marker (table) The existing marker data (coordinates, name, properties).
--- @param returnMenu (string) The menu to return to after editing the marker (optional).
local function EditMarker(shopId, class, markerKey, marker, returnMenu)
local ped = PlayerPedId()
local pedCoords = GetEntityCoords(ped)
local markerCoords = vector3(pedCoords.x, pedCoords.y, pedCoords.z)
local inputFields = {
{type = "select", label = locale("input_label.marker_class"), options = {{label = locale("menu_title."..tostring(class).."_main"), value = 1}}, disabled = true, default = 1, description = locale("input_description.marker_class")},
{type = "input", label = locale("input_label.marker_name"), required = true, description = locale("input_description.marker_name")},
{type = "number", label = locale("input_label.marker_type"), default = 20, required = true, description = locale("input_description.marker_type"), min = 0, max = 43},
{type = "color", label = locale("input_label.marker_color"), required = true, default = 'rgba(199, 30, 30, 1)', description = locale("input_description.marker_color"), format = "rgba"},
{type = "checkbox", label = locale("input_label.marker_bobupdown")},
{type = "checkbox", label = locale("input_label.marker_facecamera"), checked = true},
{type = "checkbox", label = locale("input_label.marker_createblip"), checked = true},
}
if class == "storage" then
table.insert(inputFields, {type = "number", label = locale("input_label.marker_stash_slots"), required = true, min = 1, max = Config.Shop.Storage.maxSlots, description = locale("input_description.marker_stash_slots")})
table.insert(inputFields, {type = "number", label = locale("input_label.marker_stash_weight"), required = true, min = 1, max = Config.Shop.Storage.maxWeight, description = locale("input_description.marker_stash_weight")})
end
local input = lib.inputDialog(locale("input_title.marker_edit"), inputFields)
if not input then
return lib.showContext("manage_marker")
end
local rgba = math.torgba(input[4])
-- Construct marker data payload
local data = {
class = class,
name = input[2],
coords = {x = math.round(markerCoords.x, 2), y =math.round(markerCoords.y, 2), z =math.round(markerCoords.z, 2)},
blip = {
enable = input[7],
sprite = Config.Shop.Markers[class].sprite,
color = Config.Shop.Markers[class].color,
scale = Config.Shop.Markers[class].scale,
display = Config.Shop.Markers[class].display
},
type = input[3],
color = {r = rgba.x, g = rgba.y, b = rgba.z, a = (rgba.w * 255)},
bobUpAndDown = input[5],
faceCamera = input[6],
markerId = marker.id
}
-- If the marker class is storage, assign stash inputs or fallback to default stash settings
if class == "storage" then
data.stash = {
slots = input[8] or Config.Shop.Storage.slots,
weight = input[9] or Config.Shop.Storage.weight
}
end
-- Trigger server event to save marker data
TriggerServerEvent("t1ger_mechanic:server:editMarker", shopId, class, marker.id, data)
-- Wait briefly to ensure the update is processed
Wait(250)
-- Return to the marker management menu
MarkerManagement(shopId, returnMenu)
end
--- Function to manage a specific marker within a mechanic shop.
--- @param shopId (number) The ID of the shop that owns the marker.
--- @param class (string) The class/type of the marker (e.g., "storage", "workbench").
--- @param markerKey (number|string) The unique identifier of the marker.
--- @param marker (table) The marker data (coordinates, name, properties).
--- @param returnMenu (string) The menu to return to after managing the marker (optional).
function ManageMarker(shopId, class, markerKey, marker, returnMenu)
local menuOptions = {}
-- Option to teleport to the marker (if enabled in config)
if Config.Shop.Management.markerTeleport then
menuOptions[#menuOptions + 1] = {
title = locale("menu_title.marker_teleport"),
icon = "plane",
description = locale("menu_description.marker_teleport"),
onSelect = function()
local player = PlayerPedId()
SetEntityCoords(player, marker.coords.x, marker.coords.y, marker.coords.z, 0.0, 0.0, 0.0, false)
Wait(100)
lib.showContext("manage_marker")
end
}
end
-- Option to edit the marker (if enabled in config)
if Config.Shop.Management.markerEdit then
menuOptions[#menuOptions + 1] = {
title = locale("menu_title.marker_edit"),
icon = "pen-to-square",
description = locale("menu_description.marker_edit"),
onSelect = function()
EditMarker(shopId, class, markerKey, marker, returnMenu)
end
}
end
-- Option to delete the marker
menuOptions[#menuOptions + 1] = {
title = locale("menu_title.marker_delete"),
icon = "trash",
description = locale("menu_description.marker_delete"),
onSelect = function()
TriggerServerEvent("t1ger_mechanic:server:deleteMarker", shopId, class, marker.id)
Wait(250)
MarkerManagement(shopId, returnMenu)
local isOpen, text = lib.isTextUIOpen()
if isOpen and text == locale("textui."..class.."_marker") then
lib.hideTextUI()
end
end
}
-- Register and display the marker management menu
lib.registerContext({
id = "manage_marker",
title = string.format(locale("menu_title.manage_marker", marker.name or markerKey)),
menu = "view_shop_markers",
onBack = function()
RegisterViewMarkersContext(shopId, returnMenu)
end,
options = menuOptions
})
lib.showContext("manage_marker")
end
--- Function to create a new marker for a mechanic shop.
--- @param shopId (number) The ID of the shop where the marker will be created.
function CreateMarker(shopId, returnMenu)
local ped = PlayerPedId()
local pedCoords = GetEntityCoords(ped)
local markerCoords = vector3(pedCoords.x, pedCoords.y, pedCoords.z)
-- Prepare available marker classes from Config.Shop.Markers
local markerClasses = {}
for class, marker in pairs(Config.Shop.Markers) do
if marker.enable then
table.insert(markerClasses, {label = marker.title, value = #markerClasses + 1, class = tostring(class)})
end
end
-- Open input dialog for marker creation
local input = lib.inputDialog(locale("input_title.marker_creation"), {
{type = "select", label = locale("input_label.marker_class"), required = true, clearable = true, options = markerClasses, description = locale("input_description.marker_class")},
{type = "input", label = locale("input_label.marker_name"), required = true, description = locale("input_description.marker_name")},
{type = "number", label = locale("input_label.marker_type"), default = 20, required = true, description = locale("input_description.marker_type"), min = 0, max = 43},
{type = "color", label = locale("input_label.marker_color"), required = true, default = 'rgba(199, 30, 30, 1)', description = locale("input_description.marker_color"), format = "rgba"},
{type = "checkbox", label = locale("input_label.marker_bobupdown")},
{type = "checkbox", label = locale("input_label.marker_facecamera"), checked = true},
{type = "checkbox", label = locale("input_label.marker_createblip"), checked = true},
})
-- If input is canceled, return to the previous menu
if not input then
return lib.showContext("marker_management")
end
-- Extract marker class from selected option
local class = markerClasses[input[1]].class
local rgba = math.torgba(input[4])
-- Construct marker data payload
local data = {
class = class,
name = input[2],
coords = {x = math.round(markerCoords.x, 2), y =math.round(markerCoords.y, 2), z =math.round(markerCoords.z, 2)},
blip = {
enable = input[7],
sprite = Config.Shop.Markers[class].sprite,
color = Config.Shop.Markers[class].color,
scale = Config.Shop.Markers[class].scale,
display = Config.Shop.Markers[class].display
},
type = input[3],
color = {r = rgba.x, g = rgba.y, b = rgba.z, a = (rgba.w * 255)},
bobUpAndDown = input[5],
faceCamera = input[6]
}
-- If the marker class is storage, assign default stash settings
if class == "storage" then
data.stash = {
slots = Config.Shop.Storage.slots,
weight = Config.Shop.Storage.weight
}
end
-- Trigger server event to save marker data
TriggerServerEvent("t1ger_mechanic:server:createMarker", shopId, data)
Wait(250)
MarkerManagement(shopId, returnMenu)
end
--- Function to delete a mechanic shop after admin confirmation.
--- @param shopId (number) The ID of the shop to be deleted.
--- @param returnMenu (string) The menu to return to if deletion is canceled (optional).
function DeleteShop(shopId, returnMenu)
-- Show confirmation dialog before deleting the shop
local alert = lib.alertDialog({
header = locale("alert.header.delete_shop"), -- Header text
content = string.format(locale("alert.content.delete_shop"), Shops[shopId].name, shopId), -- Confirmation message
centered = true, -- Centers the alert text
cancel = true -- Allows the user to cancel the action
})
-- If the user confirms, send a request to delete the shop on the server
if alert == "confirm" then
TriggerServerEvent("t1ger_mechanic:server:deleteShop", shopId)
else
-- If canceled, return to the previous menu
return lib.showContext(returnMenu or "manage_mechanic_shop")
end
endif not Config.Shop.Billing.enable then
return
end
---Main billing menu
---@param returnMenu? string (optional) return menu id
function BillingMain(returnMenu)
if not Config.Shop.Billing.enable then return end
-- check if isMechanic:
local isMechanic, shopId = IsPlayerMechanic()
if not isMechanic then return end
-- check shop id and bill data
if not Shops[shopId] or not Shops[shopId].billing then return end
local menuOptions = {}
-- if has bills
if type(Shops[shopId].billing) == "table" and next(Shops[shopId].billing) then
-- insert menu option into billing main
menuOptions[#menuOptions + 1] = {title = locale("menu_title.billing_view"), icon = "receipt", arrow = true, menu = "view_mechanic_bills"}
-- populate shopBills
local shopBills = {}
for billingNumber, bill in pairs(Shops[shopId].billing) do
shopBills[#shopBills+1] = {
title = string.format(locale("menu_title.billing_overview"), billingNumber, Config.Currency..tostring(math.groupdigits(bill.amount))),
icon = "file-invoice-dollar",
description = bill.note,
metadata = {
{label = locale("menu_metadata.billing_reference"), value = billingNumber},
{label = locale("menu_metadata.billing_sender"), value = bill.sender},
{label = locale("menu_metadata.billing_receiver"), value = bill.receiver},
{label = locale("menu_metadata.billing_amount"), value = Config.Currency..tostring(math.groupdigits(bill.amount))},
{label = locale("menu_metadata.billing_date"), value = bill.date},
{label = locale("menu_metadata.billing_time"), value = bill.time},
}
}
end
-- register context menu:
lib.registerContext({
id = "view_mechanic_bills",
title = locale("menu_title.billing_view"),
menu = "mechanic_billing_menu",
options = shopBills,
})
end
-- create bill menu option:
menuOptions[#menuOptions + 1] = {
title = locale("menu_title.billing_create"),
icon = "file-invoice-dollar",
onSelect = function()
local input = CreateBillingInput(locale("menu_title.billing_view"))
if not input then
return lib.showContext("mechanic_billing_menu")
else
local bill = { player = input[1], amount = input[2], note = input[3], date = input[4], time = input[5] }
TriggerServerEvent("t1ger_mechanic:server:createBill", shopId, bill)
end
end
}
-- register Billing Main Menu:
local context = {
id = "mechanic_billing_menu",
title = locale("menu_title.billing_main"),
options = menuOptions,
}
if returnMenu then
context.menu = type(returnMenu) == "string" and returnMenu or "mechanic_action_menu"
end
lib.registerContext(context)
-- show billing main context:
lib.showContext("mechanic_billing_menu")
end
exports("BillingMain", BillingMain)
---Billing input dialogue to create bills
---@return input|nil billingInput returns the input data of the bill
function CreateBillingInput()
-- get nearby players within 10.0 unit radius:
local players = lib.getNearbyPlayers(coords, 10.0)
if #players == 0 then
_API.ShowNotification(locale("notification.no_players_nearby"), "inform", {})
--return lib.showContext("mechanic_billing_menu")
end
-- insert players into options:
local playerOptions = {}
for i = 1, #players do
local player = players[i]
local playerSrc = GetPlayerServerId(player.id)
playerOptions[#playerOptions+1] = {
label = string.format("[%s] %s", playerSrc, GetPlayerName(player.id)),
value = playerSrc,
}
end
-- create input options
local inputOptions = {
{type = "select", label = locale("input_label.bill_player"), description = locale("input_description.bill_player"), icon = "person", options = playerOptions, required = true},
{type = "number", label = locale("input_label.bill_amount"), icon = "dollar-sign", required = true, min = 1},
{type = "textarea", label = locale("input_label.bill_note"), description = locale("input_description.bill_note"), icon = "note", autosize = true, required = true},
{type = "date", label = locale("input_label.bill_date"), icon = "calendar", default = true, disabled = true},
{type = "time", label = locale("input_label.bill_time"), icon = "clock", format = 24, default = true, disabled = true},
}
-- create input
local input = lib.inputDialog(locale("input_title.create_bill"), inputOptions)
-- return input
return input
end
-- Event to receive billing request on client
RegisterNetEvent("t1ger_mechanic:client:sendBill", function(shopId, bill, senderId)
---Function to accept the bill
---@param accepted boolean `true` if player accepted the bill. `false` otherwise
local function PayBill(accepted)
TriggerServerEvent("t1ger_mechanic:server:payBill", shopId, bill, senderId, accepted)
if accepted then
_API.ShowNotification(string.format(locale("notification.you_paid_bill"), Config.Currency..tostring(math.groupdigits(bill.amount)), Shops[shopId].name), "inform", {})
else
_API.ShowNotification(string.format(locale("notification.you_declined_bill"), Config.Currency..tostring(math.groupdigits(bill.amount)), Shops[shopId].name), "inform", {})
end
end
-- create menu options for yes/no
local menuOptions = {
[1] = {
title = locale("menu_title.yes"),
icon = "check",
onSelect = function()
PayBill(true)
end
},
[2] = {
title = locale("menu_title.no"),
icon = "ban",
onSelect = function()
PayBill(false)
end
},
}
-- display notes if added:
if bill.note then
menuOptions[#menuOptions+1] = {
title = locale("menu_title.billing_note"),
icon = "comment",
readOnly = true,
description = bill.note
}
end
-- register context:
lib.registerContext({
id = "pay_mechanic_bill",
title = string.format(locale("menu_title.billing_respond"), Config.Currency..tostring(math.groupdigits(bill.amount))),
canClose = false,
options = menuOptions
})
-- show context
lib.showContext("pay_mechanic_bill")
end)
--- command to open billing main
if Config.Shop.Billing.command.enable == true then
RegisterCommand(Config.Shop.Billing.command.name, function()
BillingMain()
end, false)
endShops = {}
shopBlips = {}
RegisterNetEvent("t1ger_mechanic:client:loadShops", function(shops)
Shops = shops
for k,v in pairs(Shops) do
-- create shop blip:
CreateShopBlip(v.id, v.blip, v.name)
-- load shop markers:
LoadMarkers(v.id)
end
end)
RegisterNetEvent("t1ger_mechanic:client:shopCreated", function(newShop)
-- sync data:
Shops[newShop.id] = newShop
-- create shop blip:
CreateShopBlip(newShop.id, newShop.blip, newShop.name)
end)
RegisterNetEvent("t1ger_mechanic:client:shopDeleted", function(shopId)
-- delete markers:
if Shops[shopId] and type(Shops[shopId].markers) == "table" then
for markerClass, markers in pairs(Shops[shopId].markers or {}) do
if type(markers) == "table" then
for markerId, markerData in pairs(markers or {}) do
RemoveMarker(shopId, markerClass, markerId)
end
end
end
end
-- remove shop blip:
RemoveShopBlip(shopId)
-- sync data:
Shops[shopId] = nil
end)
-- Event to update shop data on the client
RegisterNetEvent("t1ger_mechanic:client:updateShopData", function(shopId, key, value)
if not Shops[shopId] then return end
Shops[shopId][key] = value
if Config.Debug then
print(("Updated shop attribute %s for shop %d"):format(key, shopId))
end
end)
-- Event to update shop marker data on the client
RegisterNetEvent("t1ger_mechanic:client:updateMarkerData", function(shopId, class, markerId, value)
if not Shops[shopId] then return end -- Ensure shop exists
Shops[shopId].markers = Shops[shopId].markers or {} -- Ensure markers table exists
Shops[shopId].markers[class] = Shops[shopId].markers[class] or {} -- Ensure marker class exists
if value == nil then
-- Remove marker visuals first before deleting the data
RemoveMarker(shopId, class, markerId)
-- Now safely remove the marker from storage
Shops[shopId].markers[class][markerId] = nil
else
-- Remove current marker visuals before updating data
RemoveMarker(shopId, class, markerId)
-- Now update the marker data
Shops[shopId].markers[class][markerId] = value
-- Now add/update the marker visuals
AddMarker(shopId, class, markerId)
end
end)
-- Event to update shop's billing data on the client
RegisterNetEvent("t1ger_mechanic:client:updateBilling", function(shopId, billingNumber, data)
if not Shops[shopId] then return end
if not Shops[shopId].billing then Shops[shopId].billing = {} end
Shops[shopId].billing[billingNumber] = data
end)
--- Deletes a specific shop blip if it exists.
--- @param shopId (number) The unique ID of the shop blip to be deleted.
function RemoveShopBlip(shopId)
if shopBlips[shopId] then
if DoesBlipExist(shopBlips[shopId]) then
RemoveBlip(shopBlips[shopId])
end
shopBlips[shopId] = nil -- Remove reference from the table
end
end
--- Creates a blip for a shop if enabled.
--- Removes any existing blip for the same shop before creating a new one.
--- @param shopId (number) The unique ID of the shop.
--- @param shopBlip (table) Contains blip configuration (coords, sprite, display, scale, color, enable).
--- @param shopName (string) The name of the shop to be displayed on the blip.
function CreateShopBlip(shopId, shopBlip, shopName)
-- Remove existing blip
RemoveShopBlip(shopId)
-- Validate blip data and ensure blip is enabled
if not shopBlip or not shopBlip.enable then
return
end
-- Ensure coordinates exist
if not shopBlip.coords or not shopBlip.coords.x or not shopBlip.coords.y or not shopBlip.coords.z then
return error(("[CreateShopBlip] Invalid coordinates for shopId: %s"):format(shopId))
end
-- Create new blip
local blip = AddBlipForCoord(shopBlip.coords.x, shopBlip.coords.y, shopBlip.coords.z)
SetBlipSprite(blip, shopBlip.sprite or 1) -- Default sprite if none provided
SetBlipDisplay(blip, shopBlip.display or 4)
SetBlipScale(blip, shopBlip.scale or 1.0)
SetBlipColour(blip, shopBlip.color or 0)
SetBlipAsShortRange(blip, true)
-- Set blip name
BeginTextCommandSetBlipName("STRING")
AddTextComponentString(shopName or "Unknown Shop")
EndTextCommandSetBlipName(blip)
-- Store the blip for future reference
shopBlips[shopId] = blip
end
--- Checks if the local player is an employee of a specific shop or any shop.
---@param shopId number|nil (Optional) The ID of the shop to check. If nil, checks all shops.
---@return boolean isEmployee True if the player is an employee, false otherwise.
---@return number|nil foundShopId The ID of the shop the player is an employee of, or nil if not found.
function IsPlayerEmployee(shopId)
if not Shops or not _API.Player then return false end
local playerIdentifier = _API.Player.charId
if not playerIdentifier then return false end
if shopId then
-- Check only the specified shop
local shopData = Shops[shopId]
if shopData and type(shopData.employees) == "table" then
for _, emp in pairs(shopData.employees) do
if emp.identifier == playerIdentifier then
return true, shopId
end
end
end
else
-- Check all shops
for id, shopData in pairs(Shops) do
if type(shopData.employees) == "table" then
for _, emp in pairs(shopData.employees) do
if emp.identifier == playerIdentifier then
return true, id
end
end
end
end
end
return false
end
exports("IsPlayerEmployee", IsPlayerEmployee)
--- Checks if the local player has job matching any shop job.
---@param shopId number|nil (Optional) The ID of the shop to check. If nil, checks all shops.
---@return boolean hasJob True if the player has mechanic job, false otherwise.
---@return number|nil shopId The ID of the shop the player has job of, or nil if not found.
function IsPlayerMechanic(shopId)
if not Shops or not _API.Player then return false end
local playerJob = _API.Player:GetJob()
if not playerJob or not playerJob.name then return false end
if shopId then
-- Check only the specified shop
local shopData = Shops[shopId]
if shopData and shopData.job and shopData.job.name == playerJob.name then
return true, shopId
end
else
-- Check all shops
for id, shopData in pairs(Shops) do
if shopData.job and shopData.job.name == playerJob.name then
return true, id
end
end
end
return false
end
exports("IsPlayerMechanic", IsPlayerMechanic)
--- Retrieves the highest boss grade for a given shop.
---@param shopId number The ID of the shop to check.
---@return number|nil bossGrade Highest boss grade found, or nil if none exist.
function GetBossGrade(shopId)
local shopData = Shops and Shops[shopId]
if not shopData or not shopData.job or not shopData.job.grades then
return nil -- Invalid shop or no job data
end
local highestBossGrade = nil
local highestGrade = nil
for _, v in pairs(shopData.job.grades) do
if v.isboss then
if not highestBossGrade or v.grade > highestBossGrade then
highestBossGrade = v.grade
end
end
if not highestGrade or v.grade > highestGrade then
highestGrade = v.grade
end
end
return highestBossGrade or highestGrade or nil
end
--- Checks if the local player's job is a boss-grade mechanic in a specific shop or any shop.
---@param shopId number|nil (Optional) The ID of the shop to check. If nil, checks all shops.
---@return boolean isBoss True if the player has a boss mechanic job, false otherwise.
---@return number|nil foundShopId The ID of the shop where the player is a boss, or nil if not found.
function IsPlayerMechanicBoss(shopId)
if not Shops or not _API.Player then return false end
local playerJob = _API.Player:GetJob()
if not playerJob or not playerJob.name then return false end
if shopId then
-- Check only the specified shop
local shopData = Shops[shopId]
if shopData and shopData.job and shopData.job.name == playerJob.name then
local bossGrade = GetBossGrade(shopId)
if bossGrade and playerJob.grade >= bossGrade then
return true, shopId
end
end
else
-- Check all shops
for id, shopData in pairs(Shops) do
if shopData.job and shopData.job.name == playerJob.name then
local bossGrade = GetBossGrade(shopId)
if bossGrade and playerJob.grade >= bossGrade then
return true, id
end
end
end
end
return false
end
exports("IsPlayerMechanicBoss", IsPlayerMechanicBoss)
--- Checks if the local player is the owner of a specific shop or any shop.
---@param shopId number|nil (Optional) The ID of the shop to check. If nil, checks all shops.
---@return boolean isOwner True if the player is the owner, false otherwise.
---@return number|nil foundShopId The ID of the shop the player owns, or nil if not found.
function IsPlayerShopOwner(shopId)
if not Shops or not _API.Player then return false end
local playerIdentifier = _API.Player.charId
if not playerIdentifier then return false end
if shopId then
-- Check only the specified shop
local shopData = Shops[shopId]
if shopData and shopData.owner and shopData.owner == playerIdentifier then
return true, shopId
end
else
-- Check all shops
for id, shopData in pairs(Shops) do
if shopData.owner and shopData.owner == playerIdentifier then
return true, id
end
end
end
return false
end
exports("IsPlayerShopOwner", IsPlayerShopOwner)
--- Thread to buy shops that are for_sale
local buyingShop = false
Citizen.CreateThread(function()
while true do
local sleep = true
if Config.Shop.Sale then
for shopId, shopData in pairs(Shops or {}) do
if type(shopData.for_sale) == "boolean" and shopData.for_sale == true and type(shopData.sale_price) == "number" then
local saleCoords = vector3(shopData.blip.coords.x, shopData.blip.coords.y, shopData.blip.coords.z)
if #(coords - saleCoords) <= 2.0 then
sleep = false
local price = math.groupdigits(shopData.sale_price)
Draw3DText(saleCoords.x, saleCoords.y, saleCoords.z, "~r~[E]~s~ Buy Shop | ~g~"..Config.Currency..tostring(price).."~s~")
if IsControlJustPressed(0, 38) and not buyingShop then
buyingShop = true
TriggerServerEvent("t1ger_mechanic:server:buyShop", shopId)
Wait(1000)
buyingShop = false
end
end
end
end
end
if sleep then
Wait(1000)
else
Wait(5)
end
end
end)-- Opens the main boss menu for the mechanic shop
---@param shopId number unique shop identifier
---@param markerId string unique marker identifier
function BossMain(shopId, markerId)
lib.registerContext({
id = "mechanic_boss_menu",
title = locale("menu_title.boss_main"),
options = {
{
title = locale("menu_title.boss_account"),
icon = "sack-dollar",
arrow = true,
onSelect = function()
AccountMenu(shopId, markerId)
end
},
{
title = locale("menu_title.boss_employees"),
icon = "people-group",
arrow = true,
onSelect = function()
EmployeeMenu(shopId, markerId)
end
},
},
})
lib.showContext("mechanic_boss_menu")
end
-- Handles deposit or withdrawal actions for the shop account
---@param shopId number unique shop identifier
---@param method string ("deposit" or "withdraw")
---@param markerId string unique marker identifier
---@param shopAccount number the current account balance of the shop
local function AccountAction(shopId, method, markerId, shopAccount)
local input = lib.inputDialog(locale("input_title.boss_account"), {
{type = "input", label = locale("input_label.boss_current_account"), icon = "sack-dollar", disabled = true, default = shopAccount},
{type = "number", label = locale("input_label.boss_"..method.."_account"), icon = (method == "deposit" and "money-bill-trend-up" or method == "withdraw" and "money-bill-transfer"), placeholder = 100}
})
if not input then
return lib.showContext("mechanic_account")
end
local amount = tonumber(input[2])
if type(amount) ~= "number" or amount <= 0 then
_API.ShowNotification(locale("notification.input_amount_higher_0"), "inform", {})
return lib.showContext("mechanic_account")
end
if method == "withdraw" and amount > shopAccount then
_API.ShowNotification(locale("notification.account_withdraw_max"), "inform", {})
return lib.showContext("mechanic_account")
end
TriggerServerEvent("t1ger_mechanic:server:"..method.."Account", shopId, amount, markerId)
AccountMenu(shopId, markerId)
end
-- Opens the shop account menu for deposits and withdrawals
---@param shopId number unique shop identifier
---@param markerId string (unique marker identifier)
function AccountMenu(shopId, markerId)
-- get shop account
local shopAccount = lib.callback.await("t1ger_mechanic:server:getShopAccount", false, shopId)
-- register context
lib.registerContext({
id = "mechanic_account",
title = locale("menu_title.boss_account"),
menu = "mechanic_boss_menu",
options = {
{
title = string.format(locale("menu_title.boss_account_balance"), math.groupdigits(shopAccount)),
icon = "sack-dollar",
readOnly = true
},
{
title = locale("menu_title.boss_account_deposit"),
icon = "money-bill-trend-up",
onSelect = function()
AccountAction(shopId, "deposit", markerId, shopAccount)
end
},
{
title = locale("menu_title.boss_account_withdraw"),
icon = "money-bill-transfer",
onSelect = function()
AccountAction(shopId, "withdraw", markerId, shopAccount)
end
}
}
})
lib.showContext("mechanic_account")
end
-- Opens the shop employee menu for employee recruitment & management
---@param shopId number unique shop identifier
---@param markerId string (unique marker identifier)
function EmployeeMenu(shopId, markerId)
lib.registerContext({
id = "mechanic_employees",
title = locale("menu_title.boss_employees"),
menu = "mechanic_boss_menu",
options = {
{
title = locale("menu_title.boss_employees_recruit"),
icon = "user-plus",
onSelect = function()
RecruitEmployee(shopId, markerId)
end
},
{
title = locale("menu_title.boss_employees_view"),
icon = "users",
onSelect = function()
ViewEmployees(shopId)
end
}
}
})
lib.showContext("mechanic_employees")
end
-- Opens the shop employee menu for employee recruitment
---@param shopId number unique shop identifier
---@param markerId string (unique marker identifier)
function RecruitEmployee(shopId, markerId)
local menuOptions = {}
-- get nearby players within 10.0 unit radius:
local players = lib.getNearbyPlayers(coords, 10.0)
if #players == 0 then
_API.ShowNotification(locale("notification.no_players_nearby"), "inform", {})
return lib.showContext("mechanic_employees")
end
-- insert players into options:
for i = 1, #players do
local player = players[i]
local playerName = GetPlayerName(player.id)
local playerSrc = GetPlayerServerId(player.id)
menuOptions[#menuOptions+1] = {
title = string.format("[%s] %s", playerSrc, playerName),
icon = "user",
onSelect = function()
TriggerServerEvent("t1ger_mechanic:server:sendRecruitment", shopId, playerSrc)
Wait(100)
lib.showContext("mechanic_employees")
end,
}
end
-- validate menuOptions:
if #menuOptions == 0 then
_API.ShowNotification(locale("notification.no_players_nearby"), "inform", {})
return lib.showContext("mechanic_employees")
end
-- register context:
lib.registerContext({
id = "recruit_mechanic_employee",
title = locale("menu_title.boss_employees_recruit"),
menu = "mechanic_employees",
options = menuOptions,
})
-- show context:
lib.showContext("recruit_mechanic_employee")
end
---function to register view employees context menu
---@param shopId number unique identifier for the shop
local function RegisterViewEmployeesMenu(shopId)
if not Shops[shopId].employees or next(Shops[shopId].employees) == nil then
_API.ShowNotification(locale("notification.no_hired_employees"), "inform", {})
return lib.showContext("mechanic_employees")
end
local employeeList = {}
-- populate employee list table:
for _, emp in pairs(Shops[shopId].employees) do
employeeList[#employeeList+1] = {
title = emp.name,
icon = "user",
metadata = {
{label = locale("menu_metadata.job_grade"), value = Shops[shopId].job.grades[tostring(emp.grade)].label.." ["..emp.grade.."]"},
{label = locale("menu_metadata.player_identifier"), value = emp.identifier},
},
arrow = true,
onSelect = function()
print("manage selected employee")
ManageEmployee(shopId, emp)
end
}
end
-- register context:
lib.registerContext({
id = "view_mechanic_employees",
title = locale("menu_title.boss_employees_view"),
menu = "mechanic_employees",
options = employeeList,
})
end
---function to view view employees
---@param shopId number unique identifier for the shop
function ViewEmployees(shopId)
RegisterViewEmployeesMenu(shopId)
-- show context:
lib.showContext("view_mechanic_employees")
end
--- Manages a selected employee within a shop.
--- This function allows removing an employee from a shop or promoting/demoting job grades.
--- @param shopId number The unique identifier of the shop.
--- @param employee table The employee data.
--- @field name string The name of the employee.
--- @field identifier string The unique identifier of the employee.
--- @field grade number The job grade of the employee.
function ManageEmployee(shopId, employee)
-- register context:
lib.registerContext({
id = "manage_mechanic_employee",
title = locale("menu_title.boss_employee_manage"),
menu = "view_mechanic_employees",
onBack = function()
RegisterViewEmployeesMenu(shopId)
end,
options = {
{
title = locale("menu_title.boss_employee_remove"),
description = string.format(locale("menu_description.boss_employee_remove"), employee.name),
icon = "user-slash",
onSelect = function()
RemoveEmployee(shopId, employee)
end
},
{
title = locale("menu_title.boss_employee_update"),
description = string.format(locale("menu_description.boss_employee_update"), employee.name),
icon = "user-gear",
onSelect = function()
UpdateEmployee(shopId, employee)
end
},
},
})
-- show context:
lib.showContext("manage_mechanic_employee")
end
--- Remove an emplyoee from the shop
--- @param shopId number The unique identifier of the shop.
--- @param employee table The employee data.
function RemoveEmployee(shopId, employee)
-- check if employee is owner:
if employee.identifier == Shops[shopId].owner then
_API.ShowNotification(locale("notification.cannot_fire_owner"), "inform", {})
return ManageEmployee(shopId, employee)
end
-- remove employee:
TriggerServerEvent("t1ger_mechanic:server:fireEmployee", shopId, employee)
Wait(100)
-- open 'view employees' menu:
ViewEmployees(shopId)
end
--- Update an emplyoee from the shop
--- @param shopId number The unique identifier of the shop.
--- @param employee table The employee data.
function UpdateEmployee(shopId, employee)
-- check if employee is owner:
if employee.identifier == Shops[shopId].owner then
_API.ShowNotification(locale("notification.cannot_update_owner"), "inform", {})
return ManageEmployee(shopId, employee)
end
local job_grades = {}
for k,v in pairs(Shops[shopId].job.grades) do
if employee.grade ~= v.grade then
job_grades[#job_grades+1] = {
title = v.label,
icon = "ellipsis",
onSelect = function()
-- update employee:
TriggerServerEvent("t1ger_mechanic:server:promoteEmployee", shopId, employee, v.grade, v.label)
Wait(100)
employee.grade = v.grade
-- return menu:
return ManageEmployee(shopId, employee)
end
}
end
end
-- register context:
lib.registerContext({
id = "update_mechanic_employee",
title = locale("menu_title.boss_employee_update"),
menu = "manage_mechanic_employee",
options = job_grades,
})
-- show context:
lib.showContext("update_mechanic_employee")
end
--- Event to receive employee recruitment and respond:
RegisterNetEvent("t1ger_mechanic:client:receiveRecruitment", function(shopId, boss)
-- Recruitment Alert
local recruitment = lib.alertDialog({
header = locale("alert.header.recruit_employee"),
content = string.format(locale("alert.content.recruit_employee"), Shops[shopId].name),
centered = true,
cancel = true
})
-- If the user confirms, send reqruitment response
if recruitment == "confirm" then
TriggerServerEvent("t1ger_mechanic:server:respondRecruitment", shopId, true, boss)
else
TriggerServerEvent("t1ger_mechanic:server:respondRecruitment", shopId, false, boss)
end
end)-- Opens the main duty menu for the mechanic shop
---@param shopId number unique shop identifier
---@param markerId string unique marker identifier
-- Mechanic outfit data (same as Config.Outfits['mechanic'] in 17mov)
local mechanicOutfit = {
['pants'] = {item = 39, texture = 0},
['arms'] = {item = 1, texture = 0},
['t-shirt'] = {item = 15, texture = 0},
['vest'] = {item = 0, texture = 0},
['torso2'] = {item = 66, texture = 0},
['shoes'] = {item = 1, texture = 0},
['accessory'] = {item = 0, texture = 0},
['bag'] = {item = 0, texture = 0},
['hat'] = {item = 143, texture = 0},
['glass'] = {item = -1, texture = -1},
['mask'] = {item = 0, texture = 0},
}
-- Component ID mapping for GTA ped components
local componentMap = {
['mask'] = 1,
['arms'] = 3,
['pants'] = 4,
['bag'] = 5,
['shoes'] = 6,
['accessory'] = 7,
['t-shirt'] = 8,
['vest'] = 9,
['torso2'] = 11,
}
-- Prop ID mapping for GTA ped props
local propMap = {
['hat'] = 0,
['glass'] = 1,
}
-- Saved civilian outfit (before putting on uniform)
local savedCivilOutfit = nil
--- Save current ped clothing (so we can restore later)
local function SaveCurrentOutfit()
local ped = PlayerPedId()
local saved = {}
for name, compId in pairs(componentMap) do
saved[name] = {
item = GetPedDrawableVariation(ped, compId),
texture = GetPedTextureVariation(ped, compId)
}
end
for name, propId in pairs(propMap) do
saved[name] = {
item = GetPedPropIndex(ped, propId),
texture = GetPedPropTextureIndex(ped, propId)
}
end
return saved
end
--- Apply outfit data to ped
local function ApplyOutfit(outfitData)
local ped = PlayerPedId()
for name, data in pairs(outfitData) do
if componentMap[name] then
SetPedComponentVariation(ped, componentMap[name], data.item, data.texture, 0)
elseif propMap[name] then
if data.item == -1 then
ClearPedProp(ped, propMap[name])
else
SetPedPropIndex(ped, propMap[name], data.item, data.texture, true)
end
end
end
end
function DutyMain(shopId, markerId)
local onDuty, dutyLabel = false, locale("menu_title.no")
local shopData = Shops[shopId] -- get shop data
local playerJob = _API.Player:GetJob() -- get player job
-- check if on job or is on duty?
if playerJob.name == shopData.job.name then
onDuty = true
dutyLabel = locale("menu_title.yes")
end
-- register context:
lib.registerContext({
id = "mechanic_duty_menu",
title = locale("menu_title.duty_main"),
options = {
{
title = string.format(locale("menu_title.duty_state"), dutyLabel),
icon = "spinner",
disabled = true
},
{
title = locale("menu_title.duty_clock_in_out"),
icon = "toggle-on",
onSelect = function()
local wasOnDuty = onDuty
TriggerServerEvent("t1ger_mechanic:server:toggleDuty", onDuty, shopId)
Wait(100)
-- Auto outfit: going ON duty → save civils + apply uniform
if not wasOnDuty then
savedCivilOutfit = SaveCurrentOutfit()
ApplyOutfit(mechanicOutfit)
else
-- Going OFF duty → restore civilian clothes
if savedCivilOutfit then
ApplyOutfit(savedCivilOutfit)
savedCivilOutfit = nil
end
end
DutyMain(shopId, markerId)
end
}
}
})
-- show context:
lib.showContext("mechanic_duty_menu")
end
-- Track spawned job vehicles per player (client-side reference)
local activeJobVehicle = nil
--- One-time check on load: remove leftover keys from auto-despawned job vehicle
CreateThread(function()
Wait(5000) -- wait for player to fully load
local needsRemoval = lib.callback.await("t1ger_mechanic:server:checkPendingKeyRemoval", false)
if needsRemoval then
-- Remove keys for the MECANIC plate directly
if _VehicleKeys == "qs-vehiclekeys" then
exports["qs-vehiclekeys"]:RemoveKeys("MECANIC", "flatbed")
elseif _VehicleKeys == "qb-vehiclekeys" then
TriggerEvent("vehiclekeys:client:SetOwner", "MECANIC")
end
print("[JobVehicle] Removed leftover keys from auto-despawned job vehicle")
end
end)
--- Real-time key removal when admin deletes the job vehicle while player is online
RegisterNetEvent("t1ger_mechanic:client:removeJobVehicleKeys", function()
if _VehicleKeys == "qs-vehiclekeys" then
exports["qs-vehiclekeys"]:RemoveKeys("MECANIC", "flatbed")
elseif _VehicleKeys == "qb-vehiclekeys" then
TriggerEvent("vehiclekeys:client:SetOwner", "MECANIC")
end
activeJobVehicle = nil
print("[JobVehicle] Keys removed - job vehicle was deleted by admin")
end)
--- Checks if the player's active job vehicle still exists (client-side quick check)
local function HasActiveJobVehicle()
if activeJobVehicle and DoesEntityExist(activeJobVehicle) then
return true
end
activeJobVehicle = nil
return false
end
--- Checks if the given vehicle is a job vehicle owned by THIS player (via statebag)
local function IsMyJobVehicle(vehicle)
if not vehicle or vehicle == 0 then return false end
local ownerIdentifier = Entity(vehicle).state.jobVehicleOwner
if not ownerIdentifier then return false end
-- Compare with our own identifier from the server
local myIdentifier = lib.callback.await("t1ger_mechanic:server:getMyIdentifier", false)
return ownerIdentifier == myIdentifier
end
--- Checks if the given vehicle is ANY job vehicle (plate = "MECANIC")
local function IsJobVehicle(vehicle)
if not vehicle or vehicle == 0 then return false end
local plate = GetVehicleNumberPlateText(vehicle)
return plate and string.find(string.gsub(plate, "%s+", ""), "MECANIC")
end
-- Opens the main garage menu for the mechanic shop
---@param shopId number unique shop identifier
---@param markerId string unique marker identifier
function GarageMain(shopId, markerId)
local menuOption = {}
-- Option 1: Scoate Vehicul
table.insert(menuOption, {
title = locale("menu_title.garage_get_vehicle"),
icon = "car",
arrow = true,
onSelect = function()
ViewStoredVehicles(shopId, markerId)
end
})
-- Option 2: Parcheaza Vehicul
table.insert(menuOption, {
title = locale("menu_title.garage_store_vehicle"),
icon = "square-parking",
arrow = true,
onSelect = function()
ParkNearbyVehicles(shopId, markerId)
end
})
lib.registerContext({
id = "mechanic_garage_menu",
title = locale("menu_title.garage_main"),
options = menuOption
})
lib.showContext("mechanic_garage_menu")
end
-- Shows nearby vehicles (within 50m) that THIS player can park/despawn
---@param shopId number unique shop identifier
---@param markerId string unique marker identifier
function ParkNearbyVehicles(shopId, markerId)
local nearbyVehicles = {}
local playerCoords = GetEntityCoords(player)
-- Check for active job vehicle within 50m (only YOUR job vehicle via statebag)
if HasActiveJobVehicle() then
local vehCoords = GetEntityCoords(activeJobVehicle)
local dist = #(playerCoords - vehCoords)
if dist <= 50.0 and IsMyJobVehicle(activeJobVehicle) then
local modelName = GetLabelText(GetDisplayNameFromVehicleModel(GetEntityModel(activeJobVehicle)))
local plate = GetVehicleNumberPlateText(activeJobVehicle)
nearbyVehicles[#nearbyVehicles + 1] = {
title = "[JOB] " .. modelName .. " [" .. plate .. "]",
icon = "truck-pickup",
onSelect = function()
if GetVehiclePedIsIn(player, false) == activeJobVehicle then
TaskLeaveVehicle(player, activeJobVehicle, 0)
Wait(1500)
end
-- Remove keys and notify server to clean up tracking
_API.RemoveVehicleKeys(activeJobVehicle)
TriggerServerEvent("t1ger_mechanic:server:jobVehicleDespawned")
activeJobVehicle = nil
_API.ShowNotification("Vehicul parcat.", "success", {})
end
}
end
end
-- Also scan for nearby job vehicles that might not be tracked client-side
-- (e.g., if client restarted but vehicle still exists)
if not HasActiveJobVehicle() then
local vehicles = GetGamePool('CVehicle')
for _, vehicle in ipairs(vehicles) do
local vehCoords = GetEntityCoords(vehicle)
local dist = #(playerCoords - vehCoords)
if dist <= 50.0 and IsJobVehicle(vehicle) and IsMyJobVehicle(vehicle) then
local modelName = GetLabelText(GetDisplayNameFromVehicleModel(GetEntityModel(vehicle)))
local plate = GetVehicleNumberPlateText(vehicle)
nearbyVehicles[#nearbyVehicles + 1] = {
title = "[JOB] " .. modelName .. " [" .. plate .. "]",
icon = "truck-pickup",
onSelect = function()
if GetVehiclePedIsIn(player, false) == vehicle then
TaskLeaveVehicle(player, vehicle, 0)
Wait(1500)
end
_API.RemoveVehicleKeys(vehicle)
TriggerServerEvent("t1ger_mechanic:server:jobVehicleDespawned")
_API.ShowNotification("Vehicul parcat.", "success", {})
end
}
end
end
end
-- Check for owned personal vehicles nearby (within 50m)
local results = lib.callback.await("t1ger_mechanic:server:getOwnedVehicles", false)
if type(results) == "table" and #results > 0 then
local vehicles = GetGamePool('CVehicle')
for _, vehicle in ipairs(vehicles) do
local vehCoords = GetEntityCoords(vehicle)
local dist = #(playerCoords - vehCoords)
if dist <= 50.0 and not IsJobVehicle(vehicle) then
local plate = GetVehicleNumberPlateText(vehicle)
if plate then
plate = string.gsub(plate, "^%s*(.-)%s*$", "%1")
for _, ownedVeh in ipairs(results) do
if ownedVeh.plate == plate then
local props = _API.GetVehicleProperties(vehicle)
local modelName = GetLabelText(GetDisplayNameFromVehicleModel(GetEntityModel(vehicle)))
local makeName = GetLabelText(GetMakeNameFromVehicleModel(GetEntityModel(vehicle)))
nearbyVehicles[#nearbyVehicles + 1] = {
title = makeName .. " " .. modelName .. " [" .. plate .. "]",
icon = "car",
onSelect = function()
if GetVehiclePedIsIn(player, false) == vehicle then
TaskLeaveVehicle(player, vehicle, 0)
Wait(1500)
end
TriggerServerEvent("t1ger_mechanic:server:vehicleIn", markerId, props)
_API.RemoveVehicleKeys(vehicle)
Wait(250)
_API.DeleteVehicle(vehicle)
end
}
break
end
end
end
end
end
end
if #nearbyVehicles <= 0 then
_API.ShowNotification("Niciun vehicul in apropiere.", "inform", {})
return lib.showContext("mechanic_garage_menu")
end
lib.registerContext({
id = "mechanic_garage_park",
menu = "mechanic_garage_menu",
title = locale("menu_title.garage_store_vehicle"),
options = nearbyVehicles
})
lib.showContext("mechanic_garage_park")
end
-- Store an owned vehicle inside the mechanic garage
---@param shopId number unique shop identifier
---@param markerId string unique marker identifier
function StoreVehicle(shopId, markerId)
local vehicle = GetVehiclePedIsIn(player, false)
if not vehicle or vehicle == 0 then
_API.ShowNotification(locale("notification.must_be_inside_vehicle"), "inform", {})
return lib.showContext("mechanic_garage_menu")
end
local props = _API.GetVehicleProperties(vehicle)
local isOwned = lib.callback.await("t1ger_mechanic:server:doesVehiclePlateExist", false, props.plate)
if not isOwned then
_API.ShowNotification(locale("notification.vehicle_not_owned"), "inform", {})
return lib.showContext("mechanic_garage_menu")
end
TriggerServerEvent("t1ger_mechanic:server:vehicleIn", markerId, props)
_API.RemoveVehicleKeys(vehicle)
Wait(250)
_API.DeleteVehicle(vehicle)
end
-- View parked owned vehicles inside the mechanic garage
---@param shopId number unique shop identifier
---@param markerId string unique marker identifier
function ViewStoredVehicles(shopId, markerId)
local playerVehicles = {}
-- Add job vehicles at the top (available to all on-duty mechanics)
if Config.Shop.JobVehicles and #Config.Shop.JobVehicles > 0 then
-- Check server-side if player already has a job vehicle
local hasJobVehicle = lib.callback.await("t1ger_mechanic:server:hasJobVehicle", false)
local disabled = hasJobVehicle or HasActiveJobVehicle()
for _, jobVehicle in ipairs(Config.Shop.JobVehicles) do
playerVehicles[#playerVehicles + 1] = {
title = "[JOB] " .. jobVehicle.label,
icon = jobVehicle.icon or "car",
disabled = disabled,
onSelect = function()
-- Double-check server-side
local stillHas = lib.callback.await("t1ger_mechanic:server:hasJobVehicle", false)
if stillHas or HasActiveJobVehicle() then
_API.ShowNotification("Ai deja un vehicul de job activ!", "error", {})
return
end
local model = GetHashKey(jobVehicle.model)
lib.requestModel(model, 5000)
_API.SpawnVehicle(model, coords, GetEntityHeading(player), true, function(spawnedVehicle)
if spawnedVehicle and spawnedVehicle ~= 0 then
activeJobVehicle = spawnedVehicle
SetPedIntoVehicle(player, spawnedVehicle, -1)
SetVehicleNumberPlateText(spawnedVehicle, "MECANIC")
SetEntityAsMissionEntity(spawnedVehicle, true, true)
_API.GiveVehicleKeys(spawnedVehicle)
-- Register on server with netId
TriggerServerEvent("t1ger_mechanic:server:jobVehicleSpawned", VehToNet(spawnedVehicle))
end
end, true)
end
}
end
end
-- Add personal owned vehicles
local results = lib.callback.await("t1ger_mechanic:server:getOwnedVehicles", false)
if type(results) == "table" and #results > 0 then
for _, vehicle in ipairs(results) do
if vehicle.garage == markerId then
local isStored = false
if type(vehicle.stored) == "number" then
isStored = (vehicle.stored == 1)
elseif type(vehicle.stored) == "boolean" then
isStored = vehicle.stored
end
if isStored then
local props = json.decode(vehicle.props)
local modelName = GetLabelText(GetDisplayNameFromVehicleModel(props.model))
local makeName = GetLabelText(GetMakeNameFromVehicleModel(props.model))
local metaOptions = {
{label = locale("menu_metadata.vehicle_make"), value = makeName},
{label = locale("menu_metadata.vehicle_model"), value = modelName},
{label = locale("menu_metadata.vehicle_plate"), value = vehicle.plate},
}
if props.engineHealth ~= nil then
table.insert(metaOptions, {label = locale("menu_metadata.vehicle_engine"), value = (props.engineHealth/10).."%"})
end
if props.bodyHealth ~= nil then
table.insert(metaOptions, {label = locale("menu_metadata.vehicle_body"), value = (props.bodyHealth/10).."%"})
end
if props.fuelLevel ~= nil then
table.insert(metaOptions, {label = locale("menu_metadata.vehicle_fuel"), value = props.fuelLevel.."%"})
end
playerVehicles[#playerVehicles + 1] = {
title = makeName.." "..modelName.." ["..vehicle.plate.."]",
icon = "car",
metadata = metaOptions,
onSelect = function()
_API.SpawnVehicle(props.model, coords, GetEntityHeading(player), true, function(spawnedVehicle)
TriggerServerEvent("t1ger_mechanic:server:vehicleOut", markerId, props)
_API.SetVehicleProperties(spawnedVehicle, props)
SetPedIntoVehicle(player, spawnedVehicle, -1)
_API.GiveVehicleKeys(spawnedVehicle)
end, true)
end
}
end
end
end
end
if #playerVehicles <= 0 then
_API.ShowNotification(locale("notification.garage_no_vehicles"), "inform", {})
return lib.showContext("mechanic_garage_menu")
end
lib.registerContext({
id = "mechanic_garage_view",
menu = "mechanic_garage_menu",
title = locale("menu_title.garage_get_vehicle"),
options = playerVehicles
})
lib.showContext("mechanic_garage_view")
end-- Admin command to print current ped clothing component IDs
-- Usage: /getoutfit in-game (prints all component IDs to chat and F8 console)
RegisterCommand("getoutfit", function()
local ped = PlayerPedId()
local components = {
{name = "pants", id = 4},
{name = "arms", id = 3},
{name = "t-shirt", id = 8},
{name = "vest", id = 9},
{name = "torso2", id = 11},
{name = "shoes", id = 6},
{name = "accessory", id = 7},
{name = "bag", id = 5},
}
local props = {
{name = "hat", id = 0},
{name = "glass", id = 1},
{name = "mask", id = 1}, -- mask is component 1
}
print("=== CURRENT OUTFIT DATA ===")
TriggerEvent("chat:addMessage", {args = {"^2[GetOutfit]", "=== OUTFIT DATA ==="}})
for _, comp in ipairs(components) do
local drawable = GetPedDrawableVariation(ped, comp.id)
local texture = GetPedTextureVariation(ped, comp.id)
local line = string.format("['%s'] = {item = %d, texture = %d, defaultItem = 0, defaultTexture = 0},", comp.name, drawable, texture)
print(line)
TriggerEvent("chat:addMessage", {args = {"^3[Comp]", line}})
end
-- Hat (prop 0)
local hatDrawable = GetPedPropIndex(ped, 0)
local hatTexture = GetPedPropTextureIndex(ped, 0)
local hatLine = string.format("['hat'] = {item = %d, texture = %d, defaultItem = 0, defaultTexture = 0},", hatDrawable, hatTexture)
print(hatLine)
TriggerEvent("chat:addMessage", {args = {"^3[Prop]", hatLine}})
-- Glasses (prop 1)
local glassDrawable = GetPedPropIndex(ped, 1)
local glassTexture = GetPedPropTextureIndex(ped, 1)
local glassLine = string.format("['glass'] = {item = %d, texture = %d, defaultItem = 0, defaultTexture = 0},", glassDrawable, glassTexture)
print(glassLine)
TriggerEvent("chat:addMessage", {args = {"^3[Prop]", glassLine}})
-- Mask (component 1)
local maskDrawable = GetPedDrawableVariation(ped, 1)
local maskTexture = GetPedTextureVariation(ped, 1)
local maskLine = string.format("['mask'] = {item = %d, texture = %d, defaultItem = 0, defaultTexture = 0},", maskDrawable, maskTexture)
print(maskLine)
TriggerEvent("chat:addMessage", {args = {"^3[Comp]", maskLine}})
print("=== END OUTFIT DATA ===")
TriggerEvent("chat:addMessage", {args = {"^2[GetOutfit]", "=== Copiaza din F8 console ==="}})
end, false)
--- Loads all markers for a given shop.
---@param shopId number The ID of the shop.
function LoadMarkers(shopId)
if not Shops[shopId] or type(Shops[shopId].markers) ~= "table" then
return
end
for markerClass, markers in pairs(Shops[shopId].markers) do
for markerId, _ in pairs(markers) do
AddMarker(shopId, markerClass, markerId)
end
end
end
--- Loads all markers for all shops.
function LoadAllMarkers()
if not Shops or not next(Shops) then
return
end
for shopId, shopData in pairs(Shops) do
LoadMarkers(shopData.id)
end
end
--- Determines whether the local player can view a specific marker in a shop.
---@param shopId number The ID of the shop to check.
---@param class string The type of marker to check (e.g., "boss", "duty", or others).
---@return boolean canView True if the player can view the marker, false otherwise.
local function CanViewMarker(shopId, class)
if class == "boss" then
-- Check if player is the shop owner or has a boss-grade mechanic job.
if IsPlayerShopOwner(shopId) or IsPlayerMechanicBoss(shopId) then
return true
end
elseif class == "duty" then
-- Check if player is hired in the shop.
if IsPlayerEmployee(shopId) then
return true
end
else
-- All other markers require a mechanic job in the shop.
if IsPlayerMechanic(shopId) then
return true
end
end
return false
end
--- Removes the visuals (oxPoint and blip) for a marker.
---@param shopId number The ID of the shop.
---@param class string The marker class (e.g., "storage", "workbench").
---@param markerId string The unique identifier for the marker.
function RemoveMarker(shopId, class, markerId)
-- Ensure the shop and marker exist
if not Shops[shopId] or not Shops[shopId].markers[class] or not Shops[shopId].markers[class][markerId] then return end
local markerData = Shops[shopId].markers[class][markerId]
-- Remove oxPoint interaction
if markerData.oxPoint then
markerData.oxPoint:remove(markerData.oxPoint)
markerData.oxPoint = nil
end
-- Remove map blip
if markerData.mapBlip then
RemoveBlip(markerData.mapBlip)
markerData.mapBlip = nil
end
end
--- Creates or updates a marker for a shop.
--- This will first remove the existing marker visuals before creating a new one.
---@param shopId number The ID of the shop.
---@param class string The marker class (e.g., "storage", "workbench").
---@param markerId string The unique identifier for the marker.
function AddMarker(shopId, class, markerId)
-- Ensure the shop and marker exist
if not Shops[shopId] or not Shops[shopId].markers[class] or not Shops[shopId].markers[class][markerId] then return end
-- Get the latest marker data
local markerData = Shops[shopId].markers[class][markerId]
if not markerData then return end
-- Remove old marker visuals before creating the new one
RemoveMarker(shopId, class, markerId)
-- Ensure Config exists:
if not Config.Shop.Markers[class] then
return error(string.format("marker config for class: '%s' does not exist", class))
end
local cfg = Config.Shop.Markers[class]
-- check if can view/draw/access marker
-- duty checks if hired in shop. boss checks for owner or highest job grade. rest checks on job
if not CanViewMarker(shopId, class) then
return
end
-- Create map blip
if markerData.blip.enable then
markerData.mapBlip = AddBlipForCoord(markerData.coords.x, markerData.coords.y, markerData.coords.z)
SetBlipSprite(markerData.mapBlip, markerData.blip.sprite or cfg.blip.sprite)
SetBlipScale(markerData.mapBlip, markerData.blip.scale or cfg.blip.scale)
SetBlipColour(markerData.mapBlip, markerData.blip.color or cfg.blip.color)
SetBlipDisplay(markerData.mapBlip, markerData.blip.display or cfg.blip.display)
SetBlipAsShortRange(markerData.mapBlip, true)
BeginTextCommandSetBlipName("STRING")
AddTextComponentString(markerData.name)
EndTextCommandSetBlipName(markerData.mapBlip)
end
local textUI = Config.Shop.MarkerSettings.textUi
-- Create oxPoint interaction
markerData.oxPoint = lib.points.new({
coords = vector3(markerData.coords.x, markerData.coords.y, markerData.coords.z),
distance = Config.Shop.MarkerSettings.distance,
onExit = function(point)
local isOpen, text = lib.isTextUIOpen()
if isOpen and text == locale("textui."..class.."_marker") then
lib.hideTextUI()
end
end,
nearby = function(point)
-- draw marker:
DrawMarker(
markerData.type, point.coords.x, point.coords.y, point.coords.z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.35, 0.35, 0.35, markerData.color.r, markerData.color.g, markerData.color.b, markerData.color.a, markerData.bobUpAndDown, markerData.faceCamera, 0, true, false, false, false)
-- distance to interact:
if point.currentDistance <= 1.0 then
-- text ui:
local isOpen, currentText = lib.isTextUIOpen()
if isOpen and currentText ~= locale("textui."..class.."_marker") then
lib.showTextUI(locale("textui."..class.."_marker"), {position = textUI.position, icon = cfg.icon, style = textUI.style})
else
lib.showTextUI(locale("textui."..class.."_marker"), {position = textUI.position, icon = cfg.icon, style = textUI.style})
end
-- keybind:
if IsControlJustReleased(0, Config.Shop.MarkerSettings.keybind) then
lib.hideTextUI()
print("open marker: ", class, "markerId: ", markerId)
if class == "boss" then
BossMain(shopId, markerId)
elseif class == "duty" then
DutyMain(shopId, markerId)
elseif class == "garage" then
GarageMain(shopId, markerId)
elseif class == "storage" then
StorageMain(shopId, markerId, markerData.stash)
elseif class == "workbench" then
WorkbenchMain(shopId, markerId)
elseif class == "supplier" then
SupplierMain(shopId, markerId)
end
end
else
local isOpen, currentText = lib.isTextUIOpen()
if isOpen and currentText == locale("textui."..class.."_marker") then
lib.hideTextUI()
end
end
end
})
end-- Opens the storage/stash for the given storage marker in the mechanic shop
---@param shopId number unique shop identifier
---@param markerId string unique marker identifier
function StorageMain(shopId, markerId, stash)
_API.Stash.Open(stash.id, stash.label, stash.slots, stash.weight, nil)
end-- Opens the supplier menu for the mechanic shop
---@param shopId number unique shop identifier
---@param markerId string unique marker identifier
function SupplierMain(shopId, markerId)
local catalogue = {}
for categoryId, category in ipairs(Config.Shop.Supplier.catalogue) do
if type(category.items) == "table" and next(category.items) then
local items = {}
-- populate items table/options
for itemName, itemData in pairs(category.items) do
local itemLabel = _API.Inventory.GetItemLabel(itemName)
if itemLabel then
items[#items+1] = {
title = string.format("%s - %s%s", itemLabel, Config.Currency, math.groupdigits(itemData.price)),
icon = itemData.icon,
onSelect = function()
OrderSelectedItem(shopId, markerId, categoryId, itemName, itemLabel, itemData.price)
end
}
end
end
-- sort table by title
table.sort(items, function(a, b)
return a.title < b.title
end)
-- register context
lib.registerContext({
id = "mechanic_supplier_menu"..tostring(categoryId),
title = category.title,
menu = "mechanic_supplier_menu",
options = items,
})
-- populate catalogue options:
if type(items) == "table" and next(items) then
catalogue[#catalogue + 1] = {
title = category.title,
icon = category.icon,
arrow = true,
menu = "mechanic_supplier_menu"..tostring(categoryId)
}
end
end
end
-- register context:
lib.registerContext({
id = "mechanic_supplier_menu",
title = locale("menu_title.supplier_main"),
options = catalogue
})
-- show context:
lib.showContext("mechanic_supplier_menu")
end
---Function to order the selected item
---@param shopId number unique shop identifier
---@param markerId string unique marker identifier
---@param categoryId number index for category
---@param itemName string name of item to order
---@param itemLabel string label of item to order
---@param itemPrice number unit price of the item to order
function OrderSelectedItem(shopId, markerId, categoryId, itemName, itemLabel, itemPrice)
-- unit price:
local unitPrice = string.format("%s%s", Config.Currency, math.groupdigits(itemPrice))
-- input dialog:
local quantity = lib.inputDialog(string.format(locale("input_title.supplier_order", itemLabel, unitPrice)), {
{
type = "number",
label = locale("input_label.supplier_quantity"),
description = string.format(locale("input_description.supplier_quantity"), itemLabel),
placeholder = 1,
required = true,
min = 1,
max = Config.Shop.Supplier.maxQuantity or 20
}
})
-- validate input
if not quantity or type(quantity[1]) ~= "number" or quantity[1] <= 0 then
return lib.showContext("mechanic_supplier_menu"..tostring(categoryId))
end
-- calculate total price:
local totalPrice = (quantity[1] * itemPrice)
local formattedPrice = string.format("%s%s", Config.Currency, math.groupdigits(totalPrice))
-- confirm input dialogue:
local confirm = lib.inputDialog(string.format(locale("input_title.supplier_confirmation"), quantity[1], itemLabel, formattedPrice), {
{
type = "checkbox",
label = locale("input_label.supplier_confirm"),
checked = false,
required = true
}
})
-- validate input:
if not confirm or not confirm[1] then
return lib.showContext("mechanic_supplier_menu"..tostring(categoryId))
end
-- select storage (if enabled):
local storageId = nil
if Config.Shop.Supplier.receiveInStash then
local shopStorages = {}
-- populate shop storages:
for markerId, markerData in pairs(Shops[shopId].markers["storage"]) do
local index = #shopStorages + 1
shopStorages[index] = {label = markerData.name, value = index, markerId = markerId}
end
-- storage selection input dialogue:
local selectedStorage = lib.inputDialog(locale("input_title.supplier_storage"), {
{
type = "select",
label = locale("input_label.supplier_storage"),
description = locale("input_description.supplier_storage"),
required = true,
options = shopStorages,
clearable = true,
searchable = true
}
})
-- validate input:
if not selectedStorage or not selectedStorage[1] then
return lib.showContext("mechanic_supplier_menu"..tostring(categoryId))
end
-- store storageId:
storageId = shopStorages[selectedStorage[1]].markerId
end
print("place order: ", itemLabel, quantity[1], totalPrice, storageId)
TriggerServerEvent("t1ger_mechanic:server:supplierOrder", shopId, markerId, itemName, itemLabel, quantity[1], totalPrice, storageId)
-- show main context:
Wait(200)
lib.showContext("mechanic_supplier_menu")
end-- Opens the main workbench menu for the mechanic shop
---@param shopId number unique shop identifier
---@param markerId string unique marker identifier
function WorkbenchMain(shopId, markerId)
if not Config.Shop.Workbench.enable then
-- add export/event to open your own crafting stuff
else
local categories = {}
for category, cat in ipairs(Config.Shop.Workbench.categories) do
table.insert(categories, {
title = cat.label,
description = cat.description,
icon = cat.icon,
arrow = true,
onSelect = function()
local recipes = GetCraftingRecipes(cat, shopId, markerId)
table.sort(recipes, function(a, b)
return a.title < b.title
end)
-- register context for recipe:
lib.registerContext({
id = "mechanic_workbench_menu_recipes",
title = cat.label,
menu = "mechanic_workbench_menu",
options = recipes,
})
lib.showContext("mechanic_workbench_menu_recipes")
end
})
end
-- register context:
lib.registerContext({
id = "mechanic_workbench_menu",
title = locale("menu_title.workbench_main"),
options = categories
})
-- show context:
lib.showContext("mechanic_workbench_menu")
end
end
--- Returns crafting recipes for a given category
--- @param cat table
--- @param shopId number
--- @param markerId string
--- @return table
GetCraftingRecipes = function(cat, shopId, markerId)
local recipes = {}
for outputItem, recipe in pairs(cat.recipe) do
local materials = {}, {}
if type(recipe.materials) == "table" and next(recipe.materials) then
for inputItem, amount in pairs(recipe.materials) do
materials[#materials + 1] = {name = inputItem, label = Config.Materials[inputItem] or inputItem, amount = amount, value = amount.."x"}
end
end
local outputLabel = _API.Inventory.GetItemLabel(outputItem)
if outputLabel then
recipes[#recipes + 1] = {
title = outputLabel,
icon = recipe.icon,
metadata = materials,
args = {input = materials, output = {name = outputItem, label = outputLabel, icon = recipe.icon}},
onSelect = function(args)
-- input dialog:
local quantity = lib.inputDialog(string.format(locale("input_title.workbench_craft"), outputLabel), {
{
type = "number",
label = locale("input_label.workbench_amount"),
description = string.format(locale("input_description.workbench_amount"), outputLabel),
placeholder = 1,
default = 1,
required = true,
min = 1,
max = Config.Shop.Workbench.maxCraftAmount
}
})
-- validate input
if not quantity or type(quantity[1]) ~= "number" or quantity[1] <= 0 then
return lib.showContext("mechanic_workbench_menu_recipes")
end
quantity = quantity[1]
-- callback to check if has materials:
local hasMaterials, missingItems = lib.callback.await("t1ger_mechanic:server:hasMaterials", false, args.input, quantity)
-- if not has materials, notify items and return to menu
if not hasMaterials then
local lines = {}
for _, material in pairs(missingItems) do
local line = string.format("- %s: %d / %d pcs", material.label, material.invAmount, material.reqAmount)
table.insert(lines, line)
end
local message = locale("notification.workbench_missing_materials") .. " \n" .. table.concat(lines, "\n")
-- Calculate dynamic duration (e.g., 50ms per character)
local perChar = 60
local minDuration = 3000
local maxDuration = 10000
local dynamicDuration = math.min(maxDuration, math.max(minDuration, #message * perChar))
_API.ShowNotification(message, "inform", {duration = dynamicDuration})
Wait(100)
return lib.showContext("mechanic_workbench_menu_recipes")
end
-- Skillcheck logic
local success = not Config.Shop.Workbench.skillcheck.enable or SkillCheck(Config.Shop.Workbench.skillcheck.difficulty, Config.Shop.Workbench.skillcheck.inputs)
-- If skillcheck failed, return to menu
if not success then
return lib.showContext("mechanic_workbench_menu_recipes")
end
-- progress bar:
if lib.progressBar({
duration = Config.Shop.Workbench.duration,
label = string.format(locale("progressbar.crafting"), quantity, args.output.label),
useWhileDead = false,
canCancel = true,
anim = {
dict = Config.Shop.Workbench.anim.dict,
clip = Config.Shop.Workbench.anim.clip,
flag = Config.Shop.Workbench.anim.flag,
blendIn = Config.Shop.Workbench.anim.blendIn,
blendOut = Config.Shop.Workbench.anim.blendOut
},
disable = {
move = true,
combat = true
}
}) then
-- craft item event
TriggerServerEvent("t1ger_mechanic:server:craftItem", args.input, args.output, quantity, shopId, markerId)
end
Wait(100)
lib.showContext("mechanic_workbench_menu")
end,
}
end
end
return recipes
endlocal selectedParts = {} -- stores selected components
isDiagnosing = false
--- Returns whether the player is currently diagnosing or inspecting a vehicle.
--- @return boolean
function IsPlayerDiagnosing()
return isDiagnosing
end
exports("IsPlayerDiagnosing", IsPlayerDiagnosing)
--- Sets whether the player is currently diagnosing or inspecting a vehicle.
--- @param state boolean
function SetPlayerDiagnosing(state)
isDiagnosing = state
end
exports("SetDiagnosing", SetPlayerDiagnosing)
--- Returns string with vehicle system overview details
--- @param vehicle number The vehicle entity handle
--- @param mileage number The vehicle's current mileage
--- @return string?
local function GetVehicleSystemOverviewString(vehicle, mileage)
local GetOptionValue = function(veh, vehMileage, option) -- local function to get option value
local value = nil
if option == "engineHealth" then
value = GetVehicleEngineHealth(veh)/10
elseif option == "bodyHealth" then
value = GetVehicleBodyHealth(veh)/10
elseif option == "tankHealth" then
value = GetVehiclePetrolTankHealth(veh)/10
elseif option == "fuelLevel" then
value = _API.GetVehicleFuel(veh)
elseif option == "dirtLevel" then
value = GetVehicleDirtLevel(veh)
elseif option == "oilLevel" then
value = GetVehicleOilLevel(veh)
elseif option == "engineTemp" then
value = GetVehicleEngineTemperature(veh)
elseif option == "mileage" then
value = type(vehMileage) == "number" and vehMileage or 0.0
elseif option == "plate" then
value = GetVehicleNumberPlateText(veh)
end
-- round number:
if type(value) == "number" then
value = math.round(value, 2)
end
-- return:
return value
end
-- Initialize an empty string for the system overview
local overviewText = ""
-- Ordered list of keys to display in order
local orderedKeys = { "engineHealth", "bodyHealth", "tankHealth", "fuelLevel", "dirtLevel", "oilLevel", "engineTemp", "mileage", "plate" }
-- Loop through each system value and format the string
for _, option in ipairs(orderedKeys) do
local cfg = Config.Components.Diagnostic.systemOverview.options[option]
local overviewValue = GetOptionValue(vehicle, mileage, option)
if overviewValue then
-- Append formatted system data
overviewText = overviewText .. cfg.label .. " - " .. overviewValue .. cfg.symbol .. "\n"
end
end
-- Trim any trailing newline characters (optional)
overviewText = overviewText:match("^(.-)\n?$")
-- Return the final formatted system overview string
return overviewText
end
--- Creates a table with workflow tasks indexed by taskId(number)
--- @param components table The selected components
--- @return table
local function CreateWorkflowTasks(components)
local workflowTasks = {}
for partName, partInfo in pairs(components or {}) do
local taskId = (#workflowTasks + 1)
workflowTasks[taskId] = {
id = taskId,
name = string.format(Config.BodyRepair.WorkflowName, partInfo.label),
completed = false,
partLabel = partInfo.label,
partName = partName
}
end
return workflowTasks
end
--- Registers options for the vehicle diagnostics main menu
--- @param vehicle number The vehicle entity handle
local function RegisterVehicleDiagnosticsOptions(vehicle)
local vehicleData = GetVehicleData(vehicle)
--- Returns menu option for given component type
--- @param veh number The vehicle entity handle
--- @param vehData table The vehicleData statebag
--- @param partType string Type of component `"core_parts"` or `"service_parts"`
--- @return table
local function GetMenuOptionForComponentType(veh, vehData, partType)
return {
title = locale("menu_title.diagnostic_"..partType),
icon = Config.Components.Diagnostic.icons[partType],
description = locale("menu_description.diagnostic_"..partType),
onSelect = function()
ViewComponents(veh, vehData, partType)
end
}
end
local menuOptions = {}
-- Insert vehicle system overview
if Config.Components.Diagnostic.systemOverview.enable then
menuOptions[#menuOptions+1] = {
title = locale("menu_title.diagnostic_system_overview"),
icon = Config.Components.Diagnostic.icons.system_overview,
description = GetVehicleSystemOverviewString(vehicle, vehicleData.mileage),
}
end
-- Insert Core Parts
if vehicleData.core_parts and next(vehicleData.core_parts) then
menuOptions[#menuOptions+1] = GetMenuOptionForComponentType(vehicle, vehicleData, "core_parts")
end
-- Insert Service Parts
if vehicleData.service_parts and next(vehicleData.service_parts) then
menuOptions[#menuOptions+1] = GetMenuOptionForComponentType(vehicle, vehicleData, "service_parts")
end
-- Insert Button to start repair workflow
if type(selectedParts) == "table" and next(selectedParts) then
local menuDescription = locale("menu_description.diagnostic_workflow")
for partName, partInfo in pairs(selectedParts) do
local partString = string.format(locale("menu_description.diagnostic_workflow2"), partInfo.label, partInfo.condition.label, partInfo.health)
menuDescription = menuDescription..partString
end
menuOptions[#menuOptions+1] = {
title = locale("menu_title.diagnostic_workflow"),
icon = Config.Components.Diagnostic.icons.start_workflow,
description = menuDescription,
onSelect = function()
-- Store in statebag for other mechanics/scripts
local workflowTasks = CreateWorkflowTasks(selectedParts)
local vehState = Entity(vehicle).state
vehState:set("t1ger_mechanic:workflowTasks", workflowTasks, true)
-- trigger workflow UI
local plate = GetVehicleNumberPlateText(vehicle)
StartWorkflow(string.format(Config.Components.WorkflowTitle, plate), workflowTasks)
end
}
end
if #menuOptions <= 0 then
return
end
-- register context
lib.registerContext({
id = "component_diagnostic_main",
title = locale("menu_title.diagnostic_main"),
options = menuOptions,
})
end
--- Called when clicking on `Core Parts` or `Service Parts` in the vehicle diagnostic main menu
--- @param vehicle number The vehicle entity handle
--- @param vehicleData table The vehicleData statebag
--- @param componentType string Type of component `"core_parts"` or `"service_parts"`
function ViewComponents(vehicle, vehicleData, componentType)
if not vehicleData or not vehicleData[componentType] then return end
--- Returns the parts metadata
--- @param partData table The part's info/data
--- @param partType string The part type: `"core_parts"` or `"service_parts"`
--- @param partName string The part's name
--- @param veh number The vehicle entity handle
--- @return table
local function GetComponentMetadata(partData, partType, partName, veh)
local metadata = {
{label = locale("menu_metadata.component_condition"), value = partData.condition.label},
{label = locale("menu_metadata.component_health"), value = partData.health.."%"},
{label = locale("menu_metadata.component_associated"), value = partData.associatedList},
}
if type(partType) == "string" and partType == "service_parts" then
metadata[#metadata+1] = {label = locale("menu_metadata.component_next_service"), value = partData.remaining.." "..Config.Mileage.Unit}
metadata[#metadata+1] = {label = locale("menu_metadata.component_since_service"), value = partData.mileage.." "..Config.Mileage.Unit}
local serviceInterval = GetVehicleServiceInterval(veh, partName)
metadata[#metadata+1] = {label = locale("menu_metadata.component_service_interval"), value = serviceInterval.." "..Config.Mileage.Unit}
end
return metadata
end
local vehicleType = GetMechanicVehicleType(vehicle)
local partList = {}
for partName, value in pairs(vehicleData[componentType] or {}) do
local partInfo = componentType == "core_parts" and GetCorePartInfo(partName, value) or componentType == "service_parts" and GetServicePartInfo(vehicle, partName, value)
if partInfo and (partInfo.type == vehicleType or partInfo.type == "shared") then
partList[#partList+1] = {
title = partInfo.label.." - "..tostring(partInfo.health).."%",
icon = partInfo.icon,
metadata = GetComponentMetadata(partInfo, componentType, partName, vehicle),
onSelect = function()
UpdateDiagnosticsTasks(partName, partInfo)
Wait(200)
lib.showContext("component_diagnostic_"..componentType)
end,
}
end
end
-- sort options:
table.sort(partList, function(a, b)
return a.title < b.title
end)
-- register & show context
lib.registerContext({
id = "component_diagnostic_"..componentType,
menu = "component_diagnostic_main", -- return menu
onBack = function()
RegisterVehicleDiagnosticsOptions(vehicle)
end,
title = locale("menu_title.diagnostic_"..componentType),
canClose = false,
options = partList,
})
lib.showContext("component_diagnostic_"..componentType)
end
--- Updates diagnostics task list
--- @param partName string The part name
--- @param partInfo table The part data
function UpdateDiagnosticsTasks(partName, partInfo)
if type(selectedParts) ~= "table" then selectedParts = {} end
if not selectedParts[partName] then
-- add to selected parts
selectedParts[partName] = partInfo
_API.ShowNotification(string.format(locale("notification.component_tasklist_added"), partInfo.label), "inform", {duration = 4000})
else
-- remove from selected parts
selectedParts[partName] = nil
_API.ShowNotification(string.format(locale("notification.component_tasklist_removed"), partInfo.label), "error", {duration = 4000})
end
end
--- Called when using diagnostic tool item / command
local function UseDiagnosticTool()
if not IsPlayerMechanic() then
if Config.Components.Diagnostic.allowEveryone then
-- continue
else
return -- block use for non-mechanics
end
end
if IsPlayerDiagnosing() then
return _API.ShowNotification(locale("notification.is_diagnosing"), "inform", {})
end
local vehicle, vehicleDist = lib.getClosestVehicle(coords, 6.0, true) -- also gets vehiclel player is because of "true"
if not vehicle or not DoesEntityExist(vehicle) or not IsEntityAVehicle(vehicle) then
return _API.ShowNotification(locale("notification.component_no_vehicle"), "inform", {})
end
local taskAnim, openHood = {}, false
SetPlayerDiagnosing(true)
if cache.seat and cache.seat == -1 then
taskAnim = { dict = "anim@amb@clubhouse@tutorial@bkr_tut_ig3@", clip = "machinic_loop_mechandplayer", blendIn = 2.0, blendOut = 2.0, flag = 49}
SetVehicleUndriveable(vehicle, true)
else
-- Is near the hood/engine?
local hood = GetVehicleClosestHood(vehicle, 0.8, false)
if not hood then
if Config.BodyRepair.Inspect.diagnosticTool then
SetPlayerDiagnosing(false)
return InspectVehicleBody(vehicle)
else
SetPlayerDiagnosing(false)
return _API.ShowNotification(locale("notification.must_be_near_engine_hood"), "inform", {})
end
end
TaskTurnPedToFaceEntity(player, vehicle, 1000)
VehicleHoodAnimation(vehicle, false)
taskAnim = {dict = "mini@repair", clip = "fixing_a_player", blendIn = 2.0, blendOut = 2.0, flag = 1}
openHood = true
end
-- Progress bar
local success = ProgressBar({
duration = Config.Components.Diagnostic.duration, -- You can move this to Config if you want
label = locale("progressbar.component_diagnose"),
useWhileDead = false,
canCancel = true,
anim = next(taskAnim) and taskAnim or nil,
disable = { move = true, combat = true, car = true}
})
-- clear tasks
ClearPedTasks(player)
-- if success
if success then
selectedParts = {}
-- Register context
RegisterVehicleDiagnosticsOptions(vehicle)
-- Show context
lib.showContext("component_diagnostic_main")
end
if openHood then
VehicleHoodAnimation(vehicle, true)
else
SetVehicleUndriveable(vehicle, false)
end
SetPlayerDiagnosing(false)
end
--- Event for using diagnostic tool item:
RegisterNetEvent("t1ger_mechanic:client:useDiagnosticTool", function()
UseDiagnosticTool(partName, partType)
end)
--- Command to open diagnostics menu
if Config.Components.Diagnostic.command.enable then
RegisterCommand(Config.Components.Diagnostic.command.name, function(source, args, rawCommand)
UseDiagnosticTool()
end)
end--- Retrieves the stored vehicle data from the statebag.
--- @param vehicle integer The vehicle entity handle.
--- @return table|nil #The vehicle data table if found, otherwise nil.
function GetVehicleData(vehicle)
-- Validate that the vehicle entity exists
if not vehicle or not DoesEntityExist(vehicle) then
return nil -- Return nil if the vehicle is invalid
end
-- Access the entity's statebag and retrieve the vehicle data
local vehicleState = Entity(vehicle).state
local vehicleData = vehicleState["t1ger_mechanic:vehicleData"]
return vehicleData -- Return the retrieved vehicle data
end
exports("GetVehicleData", GetVehicleData)
--- Sets or updates vehicle data for a given vehicle using statebag
--- @param vehicle integer The vehicle entity handle.
--- @param data table The vehicle data to merge and set.
--- @param replicate boolean whether to replicate with server or not
function SetVehicleData(vehicle, data, replicate)
if not vehicle or not DoesEntityExist(vehicle) then return false end
if type(data) ~= "table" or next(data) == nil then
return error("[SetVehicleData] Invalid type for data. Must be a table containing: {mileage<number>, core_parts<table>, service_parts<table>}")
end
if type(data.mileage) ~= "number" then
return error("[SetVehicleData] Invalid type for mileage. Must be a number.")
end
if type(data["core_parts"]) ~= "table" or next(data["core_parts"]) == nil then
return error("[SetVehicleData] Invalid type for core_parts. Must be a table indexed by partName<string> with value being health<number>")
end
if type(data["service_parts"]) ~= "table" or next(data["service_parts"]) == nil then
return error("[SetVehicleData] Invalid type for service_parts. Must be a table indexed by partName<string> with value being mileage<number>")
end
-- Access the entity's statebag and set the vehicle data
local vehicleState = Entity(vehicle).state
vehicleState:set("t1ger_mechanic:vehicleData", data, replicate or true)
return true
end
exports("SetVehicleData", SetVehicleData)
--- Saves vehicle data client-side and sends it to the server for persistence.
--- Intended for use in garage scripts that delete the vehicle before the server can catch it.
--- @param vehicle number The vehicle entity to save (must exist and be a valid vehicle)
function SaveVehicleData(vehicle)
if not DoesEntityExist(vehicle) then return end
local plate = GetVehicleNumberPlateText(vehicle)
if type(plate) ~= "string" or not plate:match("%S") then return end
-- Retrieve the vehicle's synced statebag data
local vehicleData = GetVehicleData(vehicle)
if not vehicleData or type(vehicleData) ~= "table" then
if Config.Debug then
print("^3[SaveVehicleData]^7 Missing or invalid state data for vehicle plate:", plate)
end
return
end
-- Fire server event to save the data
TriggerServerEvent("t1ger_mechanic:server:saveVehicleData", plate, vehicleData)
end
exports("SaveVehicleData", SaveVehicleData)
--- Returns the current mileage of a given vehicle entity.
--- @param vehicle integer The vehicle entity handle.
--- @return number #The mileage of the vehicle in km or mi depending on config.
function GetVehicleMileage(vehicle)
if not DoesEntityExist(vehicle) then return 0 end
local vehicleData = GetVehicleData(vehicle)
return (vehicleData and tonumber(vehicleData.mileage)) or 0
end
exports("GetVehicleMileage", GetVehicleMileage)
--- Sets the vehicle's mileage safely
--- @param vehicle integer The vehicle entity handle
--- @param mileage number New mileage value (must be >= 0)
--- @return boolean success
function SetVehicleMileage(vehicle, mileage)
if not DoesEntityExist(vehicle) then return false end
if type(mileage) ~= "number" then
return error("[SetVehicleMileage] Invalid type for mileage. Must be a number.")
end
mileage = math.max(0, mileage) -- clamp to 0 if negative
local vehicleState = Entity(vehicle).state
local data = vehicleState["t1ger_mechanic:vehicleData"]
if not data then return false end
data.mileage = math.round(mileage, 2)
vehicleState:set("t1ger_mechanic:vehicleData", data, true)
return true
end
exports("SetVehicleMileage", SetVehicleMileage)
--- Returns the health of a core part on a given vehicle.
--- @param vehicle integer The vehicle entity handle
--- @param part string The name of the core part (e.g., `"radiator"`, `"brakes"`).
--- @return number #Returns the part health as a number, or -1 if the part is not found.
function GetCorePartHealth(vehicle, part)
if type(part) ~= "string" or part == "" then
return error("[GetCorePartHealth] Invalid type for 'part'. Must be a non-empty string")
end
if not Config.CoreParts[part] then
return error("[GetCorePartHealth] Part '%s' does not exist in Config.CoreParts")
end
if not vehicle or not DoesEntityExist(vehicle) then
return -1
end
-- Retrieve vehicle data from statebag
local vehicleData = GetVehicleData(vehicle)
-- Validate if vehicle data and the requested core part exist
if not vehicleData or not vehicleData.core_parts or not vehicleData.core_parts[part] then
return -1 -- Return -1 if part does not exist
end
return vehicleData.core_parts[part] -- Return the health value of the specified core part
end
exports("GetCorePartHealth", GetCorePartHealth)
--- Sets the health of a specific core part
--- @param vehicle integer The vehicle entity handle
--- @param part string Part name (must exist in Config.CoreParts)
--- @param health number New health value (clamped between 0 and 100)
--- @return boolean success
function SetCorePartHealth(vehicle, part, health)
if not vehicle or not DoesEntityExist(vehicle) then return false end
if type(part) ~= "string" or part == "" then
return error("[SetCorePartHealth] Invalid type for 'part'. Must be a non-empty string")
end
if type(health) ~= "number" then
return error("[SetCorePartHealth] Invalid type for 'health'. Must be a number between 0 and 100")
end
if not Config.CoreParts[part] then
return error("[SetCorePartHealth] Part '%s' does not exist in Config.CoreParts")
end
local clampedHealth = math.min(100.0, math.max(0.0, health))
local vehicleState = Entity(vehicle).state
local data = vehicleState["t1ger_mechanic:vehicleData"]
if not data or not data.core_parts then return false end
data.core_parts[part] = math.round(clampedHealth, 2)
vehicleState:set("t1ger_mechanic:vehicleData", data, true)
return true
end
exports("SetCorePartHealth", SetCorePartHealth)
--- Sets all core parts of the vehicle by setting their health to a specified value. Only parts with lower health than the given value are updated
--- @param vehicle integer The vehicle entity handle
--- @param value number New health value to apply (clamped between 0.0 and 100.0)
function SetAllCorePartsHealth(vehicle, value)
if not DoesEntityExist(vehicle) then return false end
if type(value) ~= "number" then
return error("[SetAllCorePartsHealth] Invalid type for 'value'. Must be a number between 0 and 100")
end
local vehicleState = Entity(vehicle).state
local data = vehicleState["t1ger_mechanic:vehicleData"]
if not data or not data.core_parts then return false end
for partName, health in pairs(data.core_parts) do
local newHealth = math.clamp(value, 0.0, 100.0)
if health < newHealth then
data.core_parts[partName] = math.round(newHealth, 2)
end
end
vehicleState:set("t1ger_mechanic:vehicleData", data, true)
return true
end
exports("SetAllCorePartsHealth", SetAllCorePartsHealth)
--- Returns the condition stage based on current core part health
--- @param currentHealth number The current health value of the core part
--- @return table #The condition stage (percent, label, index(1 = optimal, 2 = worn, 3 = critical, 4 = failed)
function GetCorePartCondition(currentHealth)
if type(currentHealth) ~= "number" then
return errpr("[GetCorePartCondition] Invalid type for currentHealth. Must be a number!")
end
local stages = Config.PartConditions["core_parts"]
if not stages then
return error("[GetCorePartCondition] Could not find core_parts conditions inside Config.PartConditions")
end
for i, stage in ipairs(stages) do
if currentHealth >= stage.percent then
stage.index = i
return stage
end
end
return nil
end
--- Returns table with core part info for a given part with current health.
--- @param partName string The name of the part
--- @param health number The current health of the part
--- @return table?
function GetCorePartInfo(partName, health)
if type(partName) ~= "string" then return nil end
if type(health) ~= "number" then return nil end
-- get part data from config
local partData = Config.CoreParts[partName]
if not partData then return nil end
-- get condition and stage/index
local condition = GetCorePartCondition(health)
if not condition then return end
-- associated parts in comma-separated list
local formatted = GetAssociatedPartsFormatted(partData.associated, "service_parts")
-- Return a table containing all relevant service part data
return {
label = partData.label, -- Display name of the core part (e.g., "Radiator")
icon = partData.icon, -- Icon URL for the core part
item = partData.item, -- Associated inventory item (used during replacements)
associated = partData.associated, -- The associated service parts
type = partData.type, -- The type of part "electric", "gas", "shared"
price = partData.price, -- The price of the part
associatedList = formatted, -- Comma-separated list of associated service parts
condition = condition, -- Condition status (e.g., "Optimal", "Worn", "Critical")
isFailured = condition.index == 4, -- Checks part condition stage and compares with failed (4)
isDegraded = condition.index > 1, -- Checks if part condition is degraded (index > 1 (worn, critical or failed))
health = health, -- The health in between 0.0 and 100.0
}
end
--- Returns the mileage of a service part on a given vehicle.
--- @param vehicle integer The vehicle entity handle
--- @param part string The name of the core part (e.g., `"oil_filter"`, `"brake_fluid"`).
--- @return integer #Returns the part mileage as a number, or -1 if the part is not found.
function GetServicePartMileage(vehicle, part)
if type(part) ~= "string" or part == "" then
return error("[GetServicePartMileage] part type must be a non-empty string")
end
if not Config.ServiceParts[part] then
return error("[GetServicePartMileage] part '%s' does not exist in Config.ServiceParts")
end
if not vehicle or not DoesEntityExist(vehicle) then
return -1
end
-- Retrieve vehicle data from statebag
local vehicleData = GetVehicleData(vehicle)
-- Validate if vehicle data and the requested service part exist
if not vehicleData or not vehicleData.service_parts or not vehicleData.service_parts[part] then
return -1 -- Return -1 if part does not exist
end
return vehicleData.service_parts[part] -- Return the mileage value of the specified service part
end
exports("GetServicePartMileage", GetServicePartMileage)
--- Sets the driven mileage of a specific service part
--- @param vehicle integer The vehicle entity handle
--- @param part string Part name (must exist in Config.ServiceParts)
--- @param mileage number New mileage value (negative values will be set to 0)
--- @return boolean success
function SetServicePartMileage(vehicle, part, mileage)
if not vehicle or not DoesEntityExist(vehicle) then return false end
if type(part) ~= "string" or part == "" then
return error("[SetServicePartMileage] Invalid type for 'part'. Must be a non-empty string")
end
if type(mileage) ~= "number" then
return error("[SetServicePartMileage] Invalid type for 'mileage'. Must be a non-negative number")
end
if not Config.ServiceParts[part] then
return error("[SetServicePartMileage] Part '%s' does not exist in Config.ServiceParts")
end
mileage = math.max(0, mileage) -- clamp to 0 if negative
local vehicleState = Entity(vehicle).state
local data = vehicleState["t1ger_mechanic:vehicleData"]
if not data or not data.service_parts then return false end
data.service_parts[part] = math.round(mileage, 2)
vehicleState:set("t1ger_mechanic:vehicleData", data, true)
return true
end
exports("SetServicePartMileage", SetServicePartMileage)
--- Sets all service parts of the vehicle by resetting their mileage to a specified value. Only parts with higher mileage than the given value are updated
--- @param vehicle integer The vehicle entity handle
--- @param value number New mileage value to apply (must be >= 0)
function SetAllServicePartsMileage(vehicle, value)
if not DoesEntityExist(vehicle) then return false end
if type(value) ~= "number" then
return error("[SetAllServicePartsMileage] Invalid type for 'value'. Must be a number between 0 and 100")
end
local vehicleState = Entity(vehicle).state
local data = vehicleState["t1ger_mechanic:vehicleData"]
if not data or not data.service_parts then return false end
for partName, mileage in pairs(data.service_parts) do
local newMileage = (value < 0) and 0 or value
if mileage > newMileage then
data.service_parts[partName] = math.round(newMileage, 2)
end
end
vehicleState:set("t1ger_mechanic:vehicleData", data, true)
return true
end
exports("SetAllServicePartsMileage", SetAllServicePartsMileage)
--- Returns the condition stage based on current service part mileage and interval
--- @param mileage number The current mileage driven for this service part
--- @param interval number The configured interval for this service part
--- @return table #The condition stage (percent, label, index(1 = OK, 2 = Due, 3 = Overdue)
function GetServicePartCondition(mileage, interval)
if type(interval) ~= "number" then
return errpr("[GetServicePartCondition] Invalid type for interval. Must be a number!")
end
local stages = Config.PartConditions["service_parts"]
if not stages then
return error("[GetServicePartCondition] Could not find service_parts conditions inside Config.PartConditions")
end
if not mileage or not interval or interval <= 0 then
return nil
end
-- Calculate remaining percent of lifespan
local remainingPercent = ((interval - mileage) / interval) * 100
for i, stage in ipairs(stages) do
if remainingPercent >= stage.percent then
stage.index = i
return stage
end
end
return nil
end
--- Returns table with service part info for a given part with current mileage.
--- @param vehicle number The vehicle entity handle
--- @param partName string The name of the part
--- @param mileage number The current mileage of the part
--- @return table?
function GetServicePartInfo(vehicle, partName, mileage)
if type(partName) ~= "string" then return nil end
if type(mileage) ~= "number" then return nil end
-- get part data from config
local partData = Config.ServiceParts[partName]
if not partData then return nil end
-- get condition and stage/index
local serviceInterval = GetVehicleServiceInterval(vehicle, partName)
local condition = GetServicePartCondition(mileage, serviceInterval)
if not condition then return end
-- Calculate the remaining mileage before the next service and the condition percentage
local remainingMileage = serviceInterval - mileage
local health = math.round(((remainingMileage / serviceInterval) * 100), 2) -- Allow negative percentages if overdue
-- associated parts in comma-separated list
local formatted = GetAssociatedPartsFormatted(partData.associated, "core_parts")
-- Return a table containing all relevant service part data
return {
label = partData.label, -- Display name of the service part (e.g., "Oil + Filter")
icon = partData.icon, -- Icon URL for the service part
item = partData.item, -- Associated inventory item (used during replacements)
interval = serviceInterval, -- The total mileage interval before the part needs servicing
associated = partData.associated, -- The associated core parts
type = partData.type, -- The type of part "electric", "gas", "shared"
price = partData.price, -- The price of the part
associatedList = formatted, -- Comma-separated list of associated core parts
condition = condition, -- The service status (e.g., "Service OK", "Service Due", "Service Overdue")
health = health, -- The percentage of the service interval remaining (negative if overdue)
mileage = mileage, -- The current mileage on the part (driven mileage)
remaining = remainingMileage -- The mileage left before the next service is due (negative if overdue)
}
end
--- Returns comma-separated list of associated parts
--- @param parts table Associated parts table
--- @param componentType string Component type: "core_parts" or "service_parts"
--- @return string
function GetAssociatedPartsFormatted(parts, componentType)
local labels = {}
for _, partName in ipairs(parts or {}) do
local partData = componentType == "core_parts" and Config.CoreParts[partName] or componentType == "service_parts" and Config.ServiceParts[partName]
if partData and partData.label then
table.insert(labels, partData.label)
end
end
if next(labels) then
return table.concat(labels, ", ")
else
return locale("menu_metadata.not_answered")
end
end
--- Returns whether a vehicle entity is electric operated or not. If gamebuild > 3258 uses native, else function looks up in config for defined electric vehicles.
--- @param vehicle integer The vehicle entity handle
--- @return boolean #Returns whether the given vehicle is electric operated or not.
function IsVehicleElectric(vehicle)
local vehicleModel = GetEntityModel(vehicle)
if GetGameBuildNumber() >= 3258 then
if GetIsVehicleElectric(vehicleModel) then
return true
end
else
for _,model in pairs(Config.ElectricVehicles) do
if vehicleModel == GetHashKey(model) then
return true
end
end
end
return false
end
exports("IsVehicleElectric", IsVehicleElectric)
--- Returns the mechanic-specific vehicle type: "gas" or "electric"
--- @param vehicle integer The vehicle entity handle
--- @return string #Returns "electric" or "gas"
function GetMechanicVehicleType(vehicle)
return IsVehicleElectric(vehicle) and "electric" or "gas"
end
exports("GetMechanicVehicleType", GetMechanicVehicleType)
--- Checks if a given vehicle is trackable for mileage, service, and degradation.
--- @param vehicle integer The vehicle entity handle
--- @return boolean #True if vehicle is trackable; false if it's excluded (e.g. boats, aircraft, trailers).
function IsTrackableVehicle(vehicle)
if not DoesEntityExist(vehicle) then return false end
local vehicleModel = GetEntityModel(vehicle)
for _, modelName in pairs(Config.BlacklistTracking) do
local hash = GetHashKey(modelName)
if vehicleModel == hash then
return false
end
end
local vehicleClass = GetVehicleClass(vehicle)
local allowedClasses = {
[0] = true, -- Compacts
[1] = true, -- Sedans
[2] = true, -- SUVs
[3] = true, -- Coupes
[4] = true, -- Muscle
[5] = true, -- Sports Classics
[6] = true, -- Sports
[7] = true, -- Super
[8] = true, -- Motorcycles
[9] = true, -- Off-road
[10] = true, -- Industrial
[11] = true, -- Utility
[12] = true, -- Vans
[13] = false, -- Cycles (bicycles)
[14] = false, -- Boats
[15] = false, -- Helicopters
[16] = false, -- Planes
[17] = true, -- Service
[18] = true, -- Emergency
[19] = true, -- Military
[20] = true, -- Commercial (e.g., large trucks)
[21] = false, -- Trains
[22] = true -- Open Wheel
}
return allowedClasses[vehicleClass] or false
end
exports("IsTrackableVehicle", IsTrackableVehicle)
--- Returns the mileage interval for service parts for given vehicle based on its class
--- @param vehicle integer The vehicle entity handle
--- @param partName string The service part name
--- @return number #The mileage interval
function GetVehicleServiceInterval(vehicle, partName)
if not Config.ServiceParts[partName] then
return error(string.format("[GetVehicleServiceInterval] partname: '%s' not found in Config.ServiceParts", partName))
end
local baseInterval = Config.ServiceParts[partName].interval
local vehicleClass = GetVehicleClass(vehicle)
local multiplier = Config.ServiceIntervalMultipliers[vehicleClass] or 1.0
-- Clamp multiplier
multiplier = math.max(0.1, math.min(multiplier, 3.0))
-- Calculate and floor the interval
return math.floor(baseInterval * multiplier)
end
--- Returns whether all core parts for a given vehicle are intact (health = 100%)
--- @param vehicle integer The vehiclel entity handle
--- @return boolean #Returns `true` if intact, otherwise `false`
function AreAllCorePartsIntact(vehicle)
if not DoesEntityExist(vehicle) then return false end
-- get vehicle state and vehicle data:
local vehicleState = Entity(vehicle).state
local vehicleData = vehicleState["t1ger_mechanic:vehicleData"]
if not vehicleData or type(vehicleData.core_parts) ~= "table" or next(vehicleData.core_parts) == nil then return false end
-- get vehicle type (gas / electric)
local vehicleType = GetMechanicVehicleType(vehicle)
-- loop core parts
for partName, health in pairs(vehicleData.core_parts) do
local partInfo = GetCorePartInfo(partName, health)
if partInfo and (partInfo.type == vehicleType or partInfo.type == "shared") then
if partInfo.health < 100 then
return false
end
end
end
-- return true if all core parts are >= 100.0 in health
return true
end
--- Check if a vehicle has any core parts in "failured" condition
--- @param vehicle integer The vehicle entity handle
--- @return boolean #Whether the vehicle has at least one failed core part
function DoesVehicleHaveFailuredParts(vehicle)
if not DoesEntityExist(vehicle) then return end
-- get vehicle state and vehicle data:
local vehicleState = Entity(vehicle).state
local vehicleData = vehicleState["t1ger_mechanic:vehicleData"]
if not vehicleData or type(vehicleData.core_parts) ~= "table" or next(vehicleData.core_parts) == nil then return end
-- get vehicle type (gas / electric)
local vehicleType = GetMechanicVehicleType(vehicle)
-- loop core parts
for partName, health in pairs(vehicleData.core_parts) do
local partInfo = GetCorePartInfo(partName, health)
if partInfo and (partInfo.type == vehicleType or partInfo.type == "shared") then
if partInfo.isFailured then
return true
end
end
end
-- return false if no failured parts
return false
end
exports("DoesVehicleHaveFailuredParts", DoesVehicleHaveFailuredParts)
if Config.Debug then
RegisterCommand("setparthealth", function(source, args, rawCommand)
if not _API.Player.isAdmin then return end
local vehicle = GetVehiclePedIsIn(player, false)
if type(vehicle) ~= "number" or vehicle == 0 then
vehicle = lib.getClosestVehicle(coords, 3.0, false)
end
if not DoesEntityExist(vehicle) then
return print("[setparthealth] No vehicle found nearby.")
end
local partName = args[1]
local newHealth = tonumber(args[2])
if not partName or not newHealth then
return print("[setparthealth] Usage: /setparthealth <partName> <newHealth>")
end
if not Config.CoreParts[partName] then
return print("[setparthealth] entered partname does not exist in Config.CoreParts")
end
exports["t1ger_mechanic"]:SetCorePartHealth(vehicle, partName, newHealth)
if Config.Debug then
print(("[setparthealth] Core part '%s' health set to %s."):format(partName, newHealth))
end
end, false)
RegisterCommand("setpartmileage", function(source, args, rawCommand)
if not _API.Player.isAdmin then return end
local vehicle = GetVehiclePedIsIn(player, false)
if type(vehicle) ~= "number" or vehicle == 0 then
vehicle = lib.getClosestVehicle(coords, 3.0, false)
end
if not DoesEntityExist(vehicle) then
return print("[setpartmileage] No vehicle found nearby.")
end
local partName = args[1]
local newMileage = tonumber(args[2])
if not partName or not newMileage then
return print("[setpartmileage] Usage: /setpartmileage <partName> <newMileage>")
end
if not Config.ServiceParts[partName] then
return print("[setpartmileage] entered partname does not exist in Config.ServiceParts")
end
exports["t1ger_mechanic"]:SetServicePartMileage(vehicle, partName, newMileage)
if Config.Debug then
print(("[setpartmileage] Service part '%s' mileage set to %s %s."):format(partName, newMileage, Config.Mileage.Unit))
end
end, false)
RegisterCommand("setvehiclemileage", function(source, args, rawCommand)
if not _API.Player.isAdmin then return end
local vehicle = GetVehiclePedIsIn(player, false)
if type(vehicle) ~= "number" or vehicle == 0 then
vehicle = lib.getClosestVehicle(coords, 3.0, false)
end
if not DoesEntityExist(vehicle) then
return print("[setvehiclemileage] No vehicle found nearby.")
end
local newMileage = tonumber(args[1])
if not newMileage then
return print("[setvehiclemileage] Usage: /setvehiclemileage <mileage>")
end
exports["t1ger_mechanic"]:SetVehicleMileage(vehicle, newMileage)
if Config.Debug then
print(("[setvehiclemileage] Vehicle mileage set to '%s' %s."):format(newMileage, Config.Mileage.Unit))
end
end, false)
endlocal lastVehicleSpeed = 0.0
local currentVehicleData = nil
--- Updates service part mileage and degrades associated core parts if overdue
--- @param vehicleType string The mechanic vehicle type ("gas" or "electric")
--- @param drivenMileage number The distance driven this tick
--- @param vehicleData table The vehicle's statebag data (must include service_parts and core_parts)
--- @param vehicle number The vehicle entity handle
local function DegradeServiceParts(vehicleType, drivenMileage, vehicleData, vehicle)
for servicePart, mileage in pairs(vehicleData.service_parts or {}) do
local sPart = Config.ServiceParts[servicePart]
-- if service part compatible with vehicle type
if sPart and (sPart.type == vehicleType or sPart.type == "shared") then
-- Add driven mileage to service part
local newMileage = math.round(mileage + drivenMileage, 2)
vehicleData.service_parts[servicePart] = newMileage
-- if associated wear enabled
if Config.AssociatedWear.Enabled then
-- if service part is overdue
local serviceInterval = GetVehicleServiceInterval(vehicle, servicePart)
if serviceInterval and vehicleData.service_parts[servicePart] > serviceInterval then
OnServicePartOverdue(vehicle, servicePart, vehicleData.service_parts[servicePart])
if type(sPart.associated) == "table" and next(sPart.associated) then
for _, corePart in pairs(sPart.associated) do
local cPart = Config.CoreParts[corePart]
-- is core part compatible with vehicle type
if cPart and (cPart.type == vehicleType or cPart.type == "shared") then
-- degrade core part health
if vehicleData.core_parts and vehicleData.core_parts[corePart] then
local currentHealth = vehicleData.core_parts[corePart]
local degradeAmount = currentHealth * (Config.AssociatedWear.Rate / 100)
vehicleData.core_parts[corePart] = math.round(math.max(0.0, currentHealth - degradeAmount), 2)
-- optional debug print
if Config.Debug then
print(("Core part '%s' degraded to %.2f due to overdue service part '%s'"):format(corePart, vehicleData.core_parts[corePart], servicePart))
end
end
end
end
end
end
end
end
end
end
--- Attempts to trigger a random malfunction effect based on degraded core parts
--- @param vehicle number The vehicle entity
--- @param vehicleState table The vehicle's statebag
--- @param vehicleData table The synced vehicle data (must include core_parts)
--- @param vehicleType string `"gas"` or `"electric"`
--- @return boolean didTrigger Whether a malfunction was triggered this tick
local function TriggerRandomMalfunctionEffect(vehicle, vehicleState, vehicleData, vehicleType)
local degradedParts = {}
-- numerically insert degraded parts in degradedParts cache
for partName, health in pairs(currentVehicleData.core_parts) do
local partInfo = GetCorePartInfo(partName, health)
if partInfo and (partInfo.type == vehicleType or partInfo.type == "shared") then
if partInfo.isDegraded then
table.insert(degradedParts, {
partName = partName,
partLabel = partInfo.label,
health = health,
condition = partInfo.condition
})
end
end
end
if #degradedParts == 0 then return false end
math.randomseed(GetGameTimer())
local selected = degradedParts[math.random(1, #degradedParts)]
if selected.condition.index == 4 then
vehicleState:set("t1ger_mechanic:engineDisabled", true, true)
if Config.MalfunctionEffects.Notify then
_API.ShowNotification(string.format(locale("notification.part_has_failed"), selected.partLabel), "error", {duration = 5000})
end
return true
else
if not vehicleState["t1ger_mechanic:malfunctionActive"] then
vehicleState:set("t1ger_mechanic:malfunctionActive", true, true)
vehicleState:set("t1ger_mechanic:malfunctionEffects", {
part = selected.partName,
health = vehicleData.core_parts[selected.partName] or selected.health,
condition = selected.condition,
tick = GetGameTimer()
}, true)
return true
end
end
return false
end
--- Tracks vehicle mileage, service part wear, and core part degradation while driving
--- Initializes vehicle data if not already loaded
--- Disables engine if any core parts have failed
local function IsDrivingVehicle()
if not cache.vehicle then return end
local vehicle = cache.vehicle
-- Get vehicle state:
local vehicleState = Entity(vehicle).state
-- load vehicle data
if not vehicleState["t1ger_mechanic:vehicleData"] then
local attempts = 10
local data = nil
while attempts > 0 do
local plate = GetVehicleNumberPlateText(vehicle)
data = lib.callback.await("t1ger_mechanic:server:loadVehicleData", false, VehToNet(vehicle))
-- If we got valid data, break out immediately
if data then
break
end
-- If vehicle no longer exists, stop trying
if not DoesEntityExist(vehicle) then
return print("Vehicle no longer exists, stopping load attempt.")
end
-- Retry after small wait
Wait(500) -- half a second between retries
attempts -= 1
end
if not data then
return print("Failed to load vehicle data after retries")
end
vehicleState:set("t1ger_mechanic:vehicleData", data, true)
end
-- Get vehicle type (gas / electric)
local vehicleType = GetMechanicVehicleType(vehicle)
-- Whether we should track degradation and parts on the given vehicle
local isTrackable = IsTrackableVehicle(vehicle)
-- Check if has failured parts
if DoesVehicleHaveFailuredParts(vehicle) then
vehicleState:set("t1ger_mechanic:engineDisabled", true, true)
end
-- Tracking setup
local lastCoords = GetEntityCoords(vehicle)
local unsyncedDistance = 0.0
local effectInterval = 0
while cache.seat == -1 do
if not DoesEntityExist(vehicle) then return end
-- Get vehicle data every tick
currentVehicleData = vehicleState["t1ger_mechanic:vehicleData"]
-- Get current speed & cache lastVehicleSpeed
local speed = GetEntitySpeed(vehicle)
lastVehicleSpeed = Config.Mileage.Metric and (speed * 3.6) or (speed * 2.236936)
-- Get distance moved and cache last coords
local currentCoords = GetEntityCoords(vehicle)
local distance = #(currentCoords - lastCoords)
lastCoords = currentCoords
if distance > 1.0 then -- Ignore micro movement
-- Convert to km or miles
local distanceKm = distance * 0.001
local drivenMileage = Config.Mileage.Metric and distanceKm or (distanceKm * 0.621371)
-- Add to mileage
currentVehicleData.mileage = math.round(((currentVehicleData.mileage or 0) + drivenMileage), 2)
-- Add to unsynced distance
unsyncedDistance += drivenMileage
-- Degrade service parts
if isTrackable then
DegradeServiceParts(vehicleType, drivenMileage, currentVehicleData, vehicle)
end
-- Update statebag value
if unsyncedDistance >= 0.25 then
vehicleState:set("t1ger_mechanic:vehicleData", currentVehicleData, true)
unsyncedDistance = 0.0
else
vehicleState:set("t1ger_mechanic:vehicleData", currentVehicleData, false)
end
-- Optional debug print
if Config.Debug then
print(("Mileage: %.2f %s"):format(currentVehicleData.mileage, Config.Mileage.Unit))
end
end
-- Malfunctions effects?
if currentVehicleData and Config.MalfunctionEffects and Config.MalfunctionEffects.Enabled and isTrackable then
effectInterval = effectInterval + 1
-- Reset malfunction interval if malfunction effects are playing
if vehicleState["t1ger_mechanic:malfunctionActive"] then
effectInterval = 0
end
-- Interval tick reached and not engine disabled
if effectInterval >= Config.MalfunctionEffects.Interval and not vehicleState["t1ger_mechanic:engineDisabled"] then
TriggerRandomMalfunctionEffect(vehicle, vehicleState, currentVehicleData, vehicleType)
-- Always reset interval after attempt (no matter success/fail)
effectInterval = 0
end
end
if currentVehicleData and vehicleState then
local hasFailures = DoesVehicleHaveFailuredParts(vehicle)
local isMalfunctionActive = vehicleState["t1ger_mechanic:malfunctionActive"]
if not hasFailures and not isMalfunctionActive and vehicleState["t1ger_mechanic:engineDisabled"] then
vehicleState:set("t1ger_mechanic:engineDisabled", false, true)
if Config.Debug then
print("[t1ger_mechanic] Engine re-enabled — no failed parts or active malfunctions (via IsDrivingVehicle).")
end
end
end
Wait(1000)
end
-- if not in driver's seat, set replicated statebag value:
if currentVehicleData then
vehicleState:set("t1ger_mechanic:vehicleData", currentVehicleData, true)
if Config.Debug then
print(("Final mileage sync on exit: %.2f %s"):format(currentVehicleData.mileage, Config.Mileage.Unit))
print(json.encode(currentVehicleData, {indent = true}))
end
currentVehicleData = nil
end
end
--- Handles forced engine disablement and driveability while the player is in the driver's seat
--- @return void
local function VehicleEngineHandle()
if not cache.vehicle then return end
local vehicle = cache.vehicle
-- get vehicle statebag
local vehicleState = Entity(vehicle).state
-- is electric?
local isElectric = IsVehicleElectric(vehicle)
-- while in driver's seat
while cache.seat == -1 do
if not DoesEntityExist(vehicle) then return end
-- if engine is disabled
if vehicleState["t1ger_mechanic:engineDisabled"] then
-- if engine is starting or running, then turn off
if IsVehicleEngineStarting(vehicle) or GetIsVehicleEngineRunning(vehicle) then
Wait(100)
SetVehicleEngineOn(vehicle, false, false, true)
end
-- if electric, then set vehicle undriveable
if isElectric then
SetVehicleUndriveable(vehicle, true)
end
else
Wait(800)
end
Wait(200)
end
end
--- check if driver when script (re)starts:
if cache.seat == -1 then
Wait(1000)
-- create threads
CreateThread(IsDrivingVehicle)
CreateThread(VehicleEngineHandle)
end
--- is seats changed:
lib.onCache("seat", function(seat)
-- if driver:
if seat == -1 then
SetTimeout(0, IsDrivingVehicle)
SetTimeout(0, VehicleEngineHandle)
end
end)
--- Applies degradation on random core parts on the vehicle on collisions
--- @param vehicle entity The vehicle entity handle
function ApplyCollisionDegradation(vehicle)
if not vehicle or not DoesEntityExist(vehicle) then return end
if not cache.vehicle or vehicle ~= cache.vehicle or cache.seat ~= -1 then return end
local vehicleType = GetMechanicVehicleType(vehicle)
local trackable = IsTrackableVehicle(vehicle)
if not trackable then return end
local vehicleState = Entity(vehicle).state
if type(currentVehicleData) ~= "table" or next(currentVehicleData) == nil or not currentVehicleData.core_parts then
return
end
local compatibleParts = {}
for part, health in pairs(currentVehicleData.core_parts) do
local partCfg = Config.CoreParts[part]
if partCfg and (partCfg.type == vehicleType or partCfg.type == "shared") then
table.insert(compatibleParts, part)
end
end
if #compatibleParts == 0 then return end
local degradeCount = math.min(Config.VehicleCollision.PartCount, #compatibleParts)
for i = 1, degradeCount do
local randIndex = math.random(1, #compatibleParts)
local selectedPart = table.remove(compatibleParts, randIndex)
local currentHealth = currentVehicleData.core_parts[selectedPart]
local degradePercent = math.random(Config.VehicleCollision.MinPercent, Config.VehicleCollision.MaxPercent)
local newHealth = math.max(0.0, currentHealth - (currentHealth * (degradePercent / 100)))
-- set core part health:
currentVehicleData.core_parts[selectedPart] = math.round(newHealth, 2)
if Config.Debug then
print(("[Collision] %s degraded by %d%% → New health: %.2f"):format(selectedPart, degradePercent, currentVehicleData.core_parts[selectedPart]))
end
end
vehicleState:set("t1ger_mechanic:vehicleData", currentVehicleData, true)
end
exports("ApplyCollisionDegradation", ApplyCollisionDegradation)
if Config.VehicleCollision.Enable then
local lastDamageTick = {} -- Table to store last damage timestamps
-- game event listener
AddEventHandler("gameEventTriggered", function(eventName, args)
-- check for entity damage
if eventName == "CEventNetworkEntityDamage" then
local damagedVehicle = args[1]
local entityHit = args[2]
-- return if no entity hit or vehicle not matching
if entityHit == -1 then return end
if not cache.vehicle or damagedVehicle ~= cache.vehicle or cache.seat ~= -1 then return end
-- return if not above required speed
if lastVehicleSpeed < Config.VehicleCollision.MinImpactSpeed then return end
-- get netId and current game timer
local netId = VehToNet(damagedVehicle)
local now = GetGameTimer()
-- if not cooldown, proceed:
if not lastDamageTick[netId] or now - lastDamageTick[netId] > Config.VehicleCollision.CooldownTime then
lastDamageTick[netId] = now
if Config.Debug then
print(("[Collision] Speed: %.2f %s"):format(lastVehicleSpeed, Config.Mileage.Unit))
print("[Collision] Degradation applied to vehicle Net ID:", netId)
end
-- Degradation logic
ApplyCollisionDegradation(damagedVehicle)
end
end
end)
end
-- Statebag Change Handler for engine disabled
AddStateBagChangeHandler("t1ger_mechanic:engineDisabled", --[[key filter]] nil --[[bag filter]], function(bagName, key, value, _unused, replicated)
Wait(0)
local vehicle = GetEntityFromStateBagName(bagName)
if vehicle == 0 or not DoesEntityExist(vehicle) then return end
if type(value) ~= "boolean" or replicated then return end
-- check if electric vehicle
local isElectric = IsVehicleElectric(vehicle)
if value == true then
-- Force the engine off and prevent auto-start
SetVehicleEngineOn(vehicle, false, true, true)
-- if electric set vehicle undriveable
if isElectric then
SetVehicleUndriveable(vehicle, true)
end
elseif value == false then
-- Optionally allow turning engine back on manually (based on config)
SetVehicleEngineOn(vehicle, true, false, Config.DisableAutoEngineStart)
-- if electric set vehicle driveable
if isElectric then
SetVehicleUndriveable(vehicle, false)
end
end
end)
--- Plays malfunction effects on a specific core part based on its condition. This function is triggered when a degraded core part meets the malfunction interval.
--- @param vehicle entity The vehicle entity handle
--- @param part string The name of the core part triggering the effect (e.g., "brakes", "radiator")
--- @param health number The current health value of the core part (0.0 - 100.0)
--- @param condition table The condition stage table from Config.PartConditions.core_parts
local function PlayMalfunctionEffects(vehicle, part, health, condition)
-- debug print
if Config.Debug then
print("[Malfunction] Part:", part, "Health:", health, "Condition:", condition.label)
end
-- get part config
local partConfig = Config.CoreParts[part]
-- notify if enabled
if Config.MalfunctionEffects.Notify then
_API.ShowNotification(string.format(locale("notification.part_malfunction"), partConfig.label, condition.label), "error", {duration = 5000})
end
-- Get vehicle state:
local vehicleState = Entity(vehicle).state
OnMalfunctcionEffect(vehicle, part, health, condition)
-- Alternator: cuts engine power temporarily
if part == "alternator" then
-- Worn: simulate stuttering (disable & re-enable engine a few times)
if condition.index == 2 then
local duration = 5000
local cycleTime = 1000 -- off time + on time
local cycleCount = math.floor(duration / cycleTime)
for i = 1, cycleCount do
SetVehicleEngineOn(vehicle, false, true, true)
Wait(700)
SetVehicleEngineOn(vehicle, true, true, Config.DisableAutoEngineStart)
Wait(300)
end
-- Critical: full shutdown for the entire duration
elseif condition.index == 3 then
vehicleState:set("t1ger_mechanic:engineDisabled", true, true)
Wait(10000)
vehicleState:set("t1ger_mechanic:engineDisabled", false, true)
end
-- Brakes: reduce braking power
elseif part == "brakes" then
local originalBrakeForce = GetVehicleHandlingFloat(vehicle, "CHandlingData", "fBrakeForce")
local duration, force = 5000, 0.2
if condition.index == 3 then
duration = 15000
force = 0.1
end
SetVehicleHandlingFloat(vehicle, "CHandlingData", "fBrakeForce", force)
Wait(duration)
SetVehicleHandlingFloat(vehicle, "CHandlingData", "fBrakeForce", originalBrakeForce)
-- Radiator: overheat with smoke and short engine disable
elseif part == "radiator" then
local currentTemp = GetVehicleEngineTemperature(vehicle)
local currentEngineHealth = GetVehicleEngineHealth(vehicle)
local duration = 5000
if condition.index == 3 then
duration = 15000
end
SetVehicleEngineTemperature(vehicle, 200.0)
SetVehicleEngineHealth(vehicle, 25.0)
SetVehicleEngineOn(vehicle, false, true, true)
Wait(1000)
SetVehicleEngineOn(vehicle, true, false, Config.DisableAutoEngineStart)
Wait(duration)
SetVehicleEngineTemperature(vehicle, currentTemp)
SetVehicleEngineHealth(vehicle, currentEngineHealth)
-- Transmission: mess with acceleration and shifting
elseif part == "transmission" then
local rateScaleUpShift = GetVehicleHandlingFloat(vehicle, "CHandlingData", "fClutchChangeRateScaleUpShift")
local rateScaleDownShift = GetVehicleHandlingFloat(vehicle, "CHandlingData", "fClutchChangeRateScaleDownShift")
local duration = 5000
if condition.index == 3 then
duration = 15000
end
SetVehicleHandlingFloat(vehicle, "CHandlingData", "fClutchChangeRateScaleUpShift", (rateScaleUpShift * 0.1))
SetVehicleHandlingFloat(vehicle, "CHandlingData", "fClutchChangeRateScaleDownShift", (rateScaleDownShift * 0.1))
local scale = GetVehicleSteeringScale(vehicle)
SetVehicleHandbrake(vehicle, true)
for i = 1, 200 do
SetVehicleSteeringScale(vehicle, i)
Citizen.Wait(1)
end
SetVehicleHandbrake(vehicle, false)
SetVehicleSteeringScale(vehicle, scale)
SetVehicleEnginePowerMultiplier(vehicle, -15.0)
Wait(duration)
SetVehicleEnginePowerMultiplier(vehicle, 0.0)
SetVehicleHandlingFloat(vehicle, "CHandlingData", "fClutchChangeRateScaleUpShift", rateScaleUpShift)
SetVehicleHandlingFloat(vehicle, "CHandlingData", "fClutchChangeRateScaleDownShift", rateScaleDownShift)
-- Fuel Injector: irregular fuel delivery / sputtering or misfiring
elseif part == "fuel_injector" then
local currentFuel = _API.GetVehicleFuel(vehicle)
local count = 5
if condition.index == 3 then
count = 15
end
for i = 1, count do
SetVehicleEnginePowerMultiplier(vehicle, -10.0)
_API.SetVehicleFuel(vehicle, 1.0)
Wait(math.random(200, 400))
_API.SetVehicleFuel(vehicle, currentFuel)
Wait(math.random(200, 400))
end
SetVehicleEnginePowerMultiplier(vehicle, 0.0)
_API.SetVehicleFuel(vehicle, currentFuel)
-- Power Steering Pump: reduced steering lock
elseif part == "power_steering_pump" then
local fSteeringLock = GetVehicleHandlingFloat(vehicle, "CHandlingData", "fSteeringLock")
local duration, force = 5000, 0.40
if condition.index == 3 then
duration = 15000
force = 0.25
end
SetVehicleHandlingFloat(vehicle, "CHandlingData", "fSteeringLock", fSteeringLock * force)
Wait(duration)
SetVehicleHandlingFloat(vehicle, "CHandlingData", "fSteeringLock", fSteeringLock)
-- Electric Motor: stuttering and full shut down
elseif part == "electric_motor" then
-- Worn: simulate stuttering (disable & re-enable engine a few times)
if condition.index == 2 then
local duration = 5000
local cycleTime = 1000 -- off time + on time
local cycleCount = math.floor(duration / cycleTime)
for i = 1, cycleCount do
SetVehicleEngineOn(vehicle, false, true, true)
Wait(700)
SetVehicleEngineOn(vehicle, true, true, Config.DisableAutoEngineStart)
Wait(300)
end
-- Critical: full shutdown for the entire duration
elseif condition.index == 3 then
local duration = 10000
local cycleTime = 1200
local cycleCount = math.floor(duration / cycleTime)
vehicleState:set("t1ger_mechanic:engineDisabled", true, true)
for i = 1, cycleCount do
-- Flash dashboard lights
SetVehicleLights(vehicle, 2)
PlaySoundFromEntity(-1, "Click", vehicle, "DLC_HEIST_HACKING_SNAKE_SOUNDS", false, 0)
Wait(400)
SetVehicleLights(vehicle, 0)
Wait(800)
end
vehicleState:set("t1ger_mechanic:engineDisabled", false, true)
end
-- EV Battery: low power
elseif part == "ev_battery" then
local duration, force = 5000, -50.0
if condition.index == 3 then
duration = 15000
force = -90.0
end
SetVehicleEnginePowerMultiplier(vehicle, force)
Wait(duration)
SetVehicleEnginePowerMultiplier(vehicle, 0.0)
end
-- reset malfunction active state
vehicleState:set("t1ger_mechanic:malfunctionActive", false, true)
end
-- Statebag Change Handler for malfunction effects
AddStateBagChangeHandler("t1ger_mechanic:malfunctionEffects", --[[key filter]] nil --[[bag filter]], function(bagName, key, value, _unused, replicated)
Wait(0)
local vehicle = GetEntityFromStateBagName(bagName)
if vehicle == 0 or not DoesEntityExist(vehicle) then return end
if value == nil or replicated then return end
local currentVehicle = GetVehiclePedIsIn(PlayerPedId(), false)
if currentVehicle == vehicle then
PlayMalfunctionEffects(vehicle, value.part, value.health, value.condition)
end
end)
--- Shows notification with current vehicle mileage
local function ShowCurrentVehicleMileage()
local vehicle = GetVehiclePedIsIn(player, false)
if not vehicle or not DoesEntityExist(vehicle) then return end
_API.ShowNotification(string.format("Mileage: %s %s", math.groupdigits(GetVehicleMileage(vehicle)), Config.Mileage.Unit), "inform", {})
end
if Config.Mileage.Command.enable then
RegisterCommand(Config.Mileage.Command.name, function(source, args, rawCommand)
ShowCurrentVehicleMileage()
end, false)
end--- Use a patch kit to temporarily repair core and service parts
local function UsePatchKit()
local patchKit = Config.PatchKit
if not patchKit then return end
-- Get the closest vehicle
local vehicle, vehicleDist = lib.getClosestVehicle(coords, 5.0, false)
if not vehicle or not DoesEntityExist(vehicle) or not IsEntityAVehicle(vehicle) then
return _API.ShowNotification(locale("notification.no_vehicle_nearby"), "inform", {})
end
-- Is near the hood/engine?
local hood = GetVehicleClosestHood(vehicle, 0.8, false)
if not hood then
return _API.ShowNotification(locale("notification.must_be_near_engine_hood"), "inform", {})
end
-- Face vehicle
TaskTurnPedToFaceEntity(player, vehicle, 1000)
-- Open hood if exists
VehicleHoodAnimation(vehicle, false)
-- Play animation
local anim = {dict = "mini@repair", clip = "fixing_a_player", blendIn = 2.0, blendOut = 2.0, flag = 1}
lib.requestAnimDict(anim.dict)
TaskPlayAnim(player, anim.dict, anim.clip, anim.blendIn, anim.blendOut, -1, anim.flag, 0, 0, 0, 0)
-- Skillcheck
local skillcheck = false
if patchKit.Skillcheck.enable then
skillcheck = SkillCheck(patchKit.Skillcheck.difficulty, patchKit.Skillcheck.inputs)
else
skillcheck = true
end
if not skillcheck then
ClearPedTasks(player)
VehicleHoodAnimation(vehicle, true)
return
end
-- Progress bar
local success = ProgressBar({
duration = patchKit.Duration, -- You can move this to Config if you want
label = locale("progressbar.patch_kit"),
useWhileDead = false,
canCancel = true,
disable = { move = true, combat = true }
})
if not success then
ClearPedTasks(player)
VehicleHoodAnimation(vehicle, true)
return
end
-- Remove item
TriggerServerEvent("t1ger_mechanic:server:removeItem", patchKit.Item, 1)
-- Get vehicle state data
local data = GetVehicleData(vehicle)
if data then
-- Patch core parts
if data.core_parts then
for partName, health in pairs(data.core_parts) do
if health < 1.0 then
local newHealth = math.clamp(patchKit.CorePartHealth, 1.0, 100.0)
data.core_parts[partName] = math.round(newHealth, 2)
end
end
end
-- Patch service parts
if data.service_parts then
for partName, mileage in pairs(data.service_parts) do
local sPart = Config.ServiceParts[partName]
if sPart then
local serviceInterval = GetVehicleServiceInterval(vehicle, partName)
if serviceInterval and mileage > serviceInterval then
local remaining = math.max(0.0, patchKit.ServicePartRemainingMileage or 10.0)
local newMileage = math.max(0.0, serviceInterval - remaining)
data.service_parts[partName] = math.round(newMileage, 2)
end
end
end
end
-- Update statebag
SetVehicleData(vehicle, data, true)
end
-- Repair sound
RepairSound()
-- Clear tasks
ClearPedTasks(player)
VehicleHoodAnimation(vehicle, true)
-- Notification
_API.ShowNotification(locale("notification.patchkit_success"), "success", {})
end
--- Event for using repair kit item:
RegisterNetEvent("t1ger_mechanic:client:usePatchKit", function()
UsePatchKit()
end)local isCarryingComponent = false
local componentProp = nil
local currentPropConfig = nil
local currentPropAnim = nil
local installingComponent = false
--- Returns whether the player is currently carrying a component prop
--- @return boolean #Is player carrying a component? `true` if carrying component. `false` otherwise
function IsCarryingComponent()
if isCarryingComponent or componentProp ~= nil then
return true
else
return false
end
end
exports("IsCarryingComponent", IsCarryingComponent)
--- Returns the part type (core/service) based on the given part name.
--- @param part string The name of the part (e.g., "radiator", "oil_filter").
--- @return string|nil #The component type: "core_parts" or "service_parts", or nil if not found.
local function GetComponentType(part)
if Config.CoreParts[part] then
return "core_parts"
elseif Config.ServiceParts[part] then
return "service_parts"
else
return nil
end
end
exports("GetComponentType", GetComponentType)
--- Play animation to carry the given prop model
--- @param prop table Prop data
local function CarryPropAnimation()
if currentPropConfig.boneId == 60309 then
currentPropAnim = {dict = "anim@heists@humane_labs@finale@keycards", clip = "ped_a_enter_loop", blendIn = 4.0, blendOut = 1.0, duration = -1, flags = 49}
elseif currentPropConfig.boneId == 28422 then
currentPropAnim = {dict = "anim@heists@box_carry@", clip = "idle", blendIn = 4.0, blendOut = 1.0, duration = -1, flags = 49}
if currentPropConfig.small ~= nil and currentPropConfig.small == true then
currentPropAnim = {dict = "anim@heists@narcotics@trash", clip = "idle", blendIn = 4.0, blendOut = 1.0, duration = -1, flags = 49}
end
end
local anim = currentPropAnim
lib.requestAnimDict(anim.dict)
TaskPlayAnim(player, anim.dict, anim.clip , anim.blendIn, anim.blendOut, anim.duration, anim.flags, 0, false, false, false)
end
--- Carry the component prop: play anim and attach prop to player
local function CarryComponentProp()
-- carry prop anim:
CarryPropAnimation()
Wait(250)
local propCfg = currentPropConfig
componentProp = CreateProp(propCfg.model, coords)
-- attach prop to player:
local boneIndex = GetPedBoneIndex(player, propCfg.boneId)
AttachEntityToEntity(componentProp, player, boneIndex, propCfg.pos.x, propCfg.pos.y, propCfg.pos.z, propCfg.rot.x, propCfg.rot.y, propCfg.rot.z, true, true, false, true, 1, true)
end
--- Updates the workflow task for given component replacement
--- @param vehicle number The vehicle entity handle
--- @param partName string The name of the part
--- @param partLabel string The label of the part
local function UpdateComponentWorkflowTask(vehicle, partName, partLabel)
local vehState = Entity(vehicle).state
local workflowTasks = vehState["t1ger_mechanic:workflowTasks"]
if not workflowTasks then return end
local taskUpdated = false
-- Mark the matching task as completed
for taskId, task in pairs(workflowTasks) do
if task.partName == partName and task.partLabel == partLabel and not task.completed then
task.completed = true
UpdateWorkflowTask(taskId, true)
taskUpdated = true
end
end
-- Save updated task list if any changes were made
if taskUpdated then
vehState:set("t1ger_mechanic:workflowTasks", workflowTasks, true)
end
-- Check if ALL tasks are completed
local allTasksDone = true
for _, task in pairs(workflowTasks or {}) do
if not task.completed then
allTasksDone = false
break
end
end
if allTasksDone then
vehState:set("t1ger_mechanic:workflowTasks", nil, true)
end
end
--- Fully restores a vehicle component by determining its type automatically.
--- - If the component is a **core part**, its health will be set to `100.0` via `SetCorePartHealth`.
--- - If it's a **service part**, its mileage will be reset to `0.0` using `SetServicePartMileage`.
--- - If `partType` is not provided, the function attempts to determine it using `GetComponentType`.
--- @param vehicle number The vehicle entity handle.
--- @param partName string The name of the part to restore (e.g., `"radiator"`, `"oil_filter"`).
--- @param partType? string Optionally specify `"core_parts"` or `"service_parts"`. If `nil`, it will be detected automatically.
local function SetComponentFixed(vehicle, partName, partType)
-- Determine the part type dynamically if not provided
local componentType = type(partType) == "string" and partType or GetComponentType(partName)
if not componentType then
return print("[SetComponentFixed] Could not determine part type for: " .. partName)
end
local plate = GetVehicleNumberPlateText(vehicle)
local vehicleMileage = GetVehicleMileage(vehicle)
-- Fully restore the component based on its type
if componentType == "core_parts" then
local success = SetCorePartHealth(vehicle, partName, 100.0)
if success then
local partLabel = Config.CoreParts[partName].label
UpdateComponentWorkflowTask(vehicle, partName, partLabel)
TriggerServerEvent("t1ger_mechanic:server:addServiceHistory", plate, partLabel, vehicleMileage)
_API.ShowNotification(string.format(locale("notification.component_replaced"), partLabel), "success", {duration = 5000})
end
elseif componentType == "service_parts" then
local success = SetServicePartMileage(vehicle, partName, 0.0)
if success then
local partLabel = Config.ServiceParts[partName].label
UpdateComponentWorkflowTask(vehicle, partName, partLabel)
TriggerServerEvent("t1ger_mechanic:server:addServiceHistory", plate, partLabel, vehicleMileage)
_API.ShowNotification(string.format(locale("notification.component_replaced"), partLabel), "success", {duration = 5000})
end
end
end
exports("SetComponentFixed", SetComponentFixed)
--- Returns table with salvaged materials when replacing a part.
--- Material amounts are scaled by part condition (0-100%) or randomized depending on config.
--- @param partName string The technical name of the part (e.g., "brakes", "coolant")
--- @param partType string The party type ("core_parts" or "service_parts")
--- @param condition number The current condition in % (0.0 to 100.0)
--- @return table<string, number> # Material name keys with amount values
local function GetReturnedMaterials(partName, partType, condition)
local partConfig, categoryIndex = nil, nil
-- get partConfig and recipe category index
if partType == "core_parts" then
partConfig = Config.CoreParts[partName]
categoryIndex = 2
elseif partType == "service_parts" then
partConfig = Config.ServiceParts[partName]
categoryIndex = 3
end
-- get part item recipe
local category = Config.Shop.Workbench.categories[categoryIndex]
local recipe = category and category.recipe and category.recipe[partConfig.item]
if not recipe or type(recipe.materials) ~= "table" then return {} end
local returnedMaterials = {}
-- Clamp condition here (0.0 - 100.0), just extra safety
local safeCondition = math.clamp(condition, 0.0, 100.0)
for material, recipeAmount in pairs(recipe.materials or {}) do
local amount = 0
if Config.Components.Repair.materialReturn.scaleWithCondition then
-- Divide by 100 to get 0.0-1.0 scale
amount = math.floor(recipeAmount * (safeCondition / 100.0))
else
local minAmount = Config.Components.Repair.materialReturn.minAmount or 0
local maxAmount = math.min(recipeAmount, Config.Components.Repair.materialReturn.maxAmount or recipeAmount)
amount = math.random(minAmount, maxAmount)
end
if amount > 0 then
returnedMaterials[material] = amount
end
end
return returnedMaterials, recipe
end
--- Creates target on given vehicle for the repair of the component
--- @param vehicle number The vehicle entity handle
--- @param partName string The name of the part (e.g., "radiator", "oil_filter").
--- @param partType string The type of part `core_parts` or `service_parts`
local function CreateComponentRepairTarget(vehicle, partName, partType)
--- Returns whether the player is carrying component and is near the repair vehicle
--- @param entity number The vehicle entity handle
--- @return boolean
local function IsNearRepairVehicle(entity)
if IsEntityValid(entity) and GetEntityType(entity) ~= 0 then
local vehCoords = GetEntityCoords(entity)
local vehDistance = #(coords - vehCoords)
if vehDistance <= 7.0 and IsCarryingComponent() then
return true
end
end
return false
end
--- Returns cloest repair point and notification message (to be used if not found) for given part
--- @param entity number The vehicle entity handle
--- @return table?
--- @return string
local function FindClosestComponentRepairPoint(entity, part)
if part == "brake_pad" or part == "brakes" or part == "tires" then
return GetVehicleClosestWheel(entity, 1.2, false), locale("notification.must_be_near_wheel")
else
return GetVehicleClosestHood(entity, 0.8, false), locale("notification.must_be_near_engine_hood")
end
end
--- Formats returned materials into a string for notifications
--- @param materials table<string, number> Table of {materialName = amount}
--- @return string
local function FormatReturnedMaterials(materials)
local parts = {}
for material, amount in pairs(materials) do
table.insert(parts, string.format("%dx %s", amount, Config.Materials[material] or material))
end
return table.concat(parts, ", ")
end
-- Add target on the repair vehicle entity
_API.Target.AddLocalEntity(vehicle, {
{
name = "t1ger_mechanic:repair:component",
icon = Config.Components.Repair.targetIcon,
label = locale("target.component_repair"),
canInteract = IsNearRepairVehicle,
distance = 7.0,
onSelect = function(entity)
local isWheelRepair = (partName == "brake_pad" or partName == "brakes" or partName == "tires")
local partConfig = partType == "core_parts" and Config.CoreParts or partType == "service_parts" and Config.ServiceParts
-- Get closest repair point
local point, notify = FindClosestComponentRepairPoint(entity, partName)
if not point then
return _API.ShowNotification(notify, "inform", {})
end
installingComponent = true
-- Face vehicle
if not point.isFallback then
TaskTurnPedToFaceCoord(player, point.defaultBoneCoords.x, point.defaultBoneCoords.y, point.defaultBoneCoords.z, 1000)
else
TaskTurnPedToFaceEntity(player, entity, 1000)
Wait(700)
end
if not isWheelRepair then
-- open hood
if not point.isFallback then
VehicleHoodAnimation(entity, false)
end
ClearPedTasks(player)
-- Play anim:
local anim = {dict = "mini@repair", clip = "fixing_a_player", blendIn = 2.0, blendOut = 2.0, flag = 1}
lib.requestAnimDict(anim.dict)
TaskPlayAnim(player, anim.dict, anim.clip, anim.blendIn, anim.blendOut, -1, anim.flag, 0, 0, 0, 0)
else
Wait(1000)
ClearPedTasks(player)
-- Play anim:
local anim = {dict = "anim@amb@clubhouse@tutorial@bkr_tut_ig3@", clip = "machinic_loop_mechandplayer", duration = -1, blendIn = 2.0, blendOut = 2.0, flag = 1}
lib.requestAnimDict(anim.dict)
TaskPlayAnim(player, anim.dict, anim.clip, anim.blendIn, anim.blendOut, -1, anim.flag, 0, 0, 0, 0)
end
-- Skillcheck
local skillcheck = false
if Config.Components.Repair.skillcheck.enable then
skillcheck = SkillCheck(Config.Components.Repair.skillcheck.difficulty, Config.Components.Repair.skillcheck.inputs)
else
skillcheck = true
end
-- Return if not skillcheck success
if not skillcheck then
ClearPedTasks(player)
if not isWheelRepair then
-- close hood
if not point.isFallback then
VehicleHoodAnimation(entity, true)
end
end
installingComponent = false
CarryPropAnimation()
return
end
-- Progressbar
local success = ProgressBar({
duration = Config.Components.Repair.duration,
label = locale("progressbar.component_repair"),
useWhileDead = false,
canCancel = true,
disable = {move = true, car = true, combat = true, sprint = true},
})
-- Return if not progressbar success
if not success then
ClearPedTasks(player)
if not isWheelRepair then
-- close hood
if not point.isFallback then
VehicleHoodAnimation(entity, true)
end
end
installingComponent = false
CarryPropAnimation()
return
end
-- Remove Target
_API.Target.RemoveLocalEntity(entity, {names = {"t1ger_mechanic:repair:component"}, labels = {locale("target.component_repair")}})
-- Remove item
TriggerServerEvent("t1ger_mechanic:server:removeItem", partConfig[partName].item, 1)
-- get current part value:
local currentPartValue = 0
if partType == "core_parts" then
currentPartValue = GetCorePartHealth(entity, partName)
elseif partType == "service_parts" then
currentPartValue = GetServicePartMileage(entity, partName)
end
-- get serivce interval
local serviceInterval = partType == "service_parts" and GetVehicleServiceInterval(entity, partName)
-- fallback to lowest value if not found
if not currentPartValue or currentPartValue == -1 then
currentPartValue = partType == "core_parts" and 0.0 or partType == "service_parts" and serviceInterval
end
-- get current condition in percentage
local conditionPercent = 0.0
if partType == "core_parts" then
conditionPercent = math.clamp(currentPartValue, 0.0, 100.0)
elseif partType == "service_parts" then
conditionPercent = math.clamp(100.0 - ((currentPartValue / serviceInterval) * 100.0), 0.0, 100.0)
end
-- Set component fixed if success
if success then
SetComponentFixed(entity, partName, partType)
end
-- fix engine if all components are fully functional:
if AreAllCorePartsIntact(vehicle) then
SetVehicleEngineHealth(vehicle, 1000.0)
end
-- Play repair sound
RepairSound()
-- Return materials from the replaced part
local returnedMaterials = GetReturnedMaterials(partName, partType, conditionPercent)
if returnedMaterials and next(returnedMaterials) then
local formattedText = FormatReturnedMaterials(returnedMaterials)
TriggerServerEvent("t1ger_mechanic:server:returnComponentMaterials", returnedMaterials, partName, partType, formattedText)
end
-- Delete prop and clear tasks
DeleteEntity(componentProp)
ClearPedTasks(player)
-- Close vehicle hood:
if not isWheelRepair then
-- close hood
if not point.isFallback then
VehicleHoodAnimation(entity, true)
end
end
installingComponent = false
-- Cleanup
isCarryingComponent = false
componentProp = nil
currentPropConfig = nil
currentPropAnim = nil
end
}
})
end
--- Function to trigger the useable item for the given part
--- @param partName string The name of the part (e.g., "radiator", "oil_filter").
--- @param partType? string (optional) the type of part: `"core_parts"` or `"service_parts"`
local function UseComponentItem(partName, partType)
if not IsPlayerMechanic() then
if Config.Components.Repair.allowEveryone then
-- continue
else
return -- block use for non-mechanics
end
end
-- Check if the player is already carrying a component
if IsCarryingComponent() then
return _API.ShowNotification(locale("notification.is_carrying_component"), "inform", {})
end
-- Get the closest vehicle
local vehicle, vehicleDist = lib.getClosestVehicle(coords, 5.0, false)
if not vehicle or not DoesEntityExist(vehicle) or not IsEntityAVehicle(vehicle) then
return _API.ShowNotification(locale("notification.no_vehicle_nearby"), "inform", {})
end
-- Get Part Type:
local componentType = (type(partType) == "string" and partType) or GetComponentType(partName)
if not componentType then
return print("[UseComponentItem] Could not determine part type for: " .. partName)
end
-- Config lookup for the part details
local partConfig = componentType == "core_parts" and Config.CoreParts[partName] or componentType == "service_parts" and Config.ServiceParts[partName] or nil
if not partConfig then
return print("[UseComponentItem] Part configuration (" .. componentType .. ") not found for: " .. partName)
end
-- is electric?
local vehicleType = exports["t1ger_mechanic"]:GetMechanicVehicleType(vehicle)
if partConfig.type ~= "shared" and partConfig.type ~= vehicleType then
return _API.ShowNotification(locale("notification.component_not_compat"), "inform", {})
end
-- Determine if the part is already in good condition
if componentType == "core_parts" then
local health = GetCorePartHealth(vehicle, partName)
if health and health ~= -1 and health >= 100.0 then
return _API.ShowNotification(string.format(locale("notification.component_is_new"), partConfig.label), "inform", {})
end
elseif componentType == "service_parts" then
local mileage = GetServicePartMileage(vehicle, partName)
if mileage and mileage ~= -1 and mileage <= 0.0 then
return _API.ShowNotification(string.format(locale("notification.component_is_new"), partConfig.label), "inform", {})
end
end
-- Carry and attach the body part
isCarryingComponent = true
currentPropConfig = partConfig.prop
CarryComponentProp()
CreateComponentRepairTarget(vehicle, partName, componentType)
while IsCarryingComponent() do
Wait(1000)
if currentPropAnim then
if not IsEntityPlayingAnim(player, currentPropAnim.dict, currentPropAnim.clip, 1) then
if not usingHoodAnim and not installingComponent then
TaskPlayAnim(player, currentPropAnim.dict, currentPropAnim.clip , currentPropAnim.blendIn, currentPropAnim.blendOut, currentPropAnim.duration, currentPropAnim.flags, 0, false, false, false)
end
end
end
end
CancelComponentRepair()
end
--- Cancels a component repair and removes prop and clears tasks
function CancelComponentRepair()
ClearPedTasks(player)
if componentProp and DoesEntityExist(componentProp) then
DeleteEntity(componentProp)
end
isCarryingComponent = false
componentProp = nil
currentPropConfig = nil
currentPropAnim = nil
installingComponent = false
end
exports("CancelComponentRepair", CancelComponentRepair)
--- Command if enabled to cancel a component repair
if Config.Components.Repair.cancelCommand.enable then
RegisterCommand(Config.Components.Repair.cancelCommand.name, function(source, args, rawCommand)
CancelComponentRepair()
end, false)
end
--- Event for using component (service/core) part item:
RegisterNetEvent("t1ger_mechanic:client:useComponentItem", function(partName, partType)
UseComponentItem(partName, partType)
end)--- Function called when using the service book item or command
local function UseServiceBook()
local vehicle = GetVehiclePedIsIn(player, false)
if not vehicle or not DoesEntityExist(vehicle) then return end
local plate = GetVehicleNumberPlateText(vehicle)
local serviceHistory = lib.callback.await("t1ger_mechanic:server:getVehicleServiceHistory", false, plate)
if not serviceHistory then return end
local grouped = {}
-- Step 1: Group by unique key (date + mileage)
for _, entry in ipairs(serviceHistory) do
local key = entry.date .. "_" .. entry.mileage
if not grouped[key] then
grouped[key] = {
id = entry.id, -- use ID for sorting
mileage = entry.mileage,
date = entry.date,
shop = entry.shop or entry.mechanic or locale("menu_metadata.not_answered"),
parts = {}
}
end
-- Update ID if this entry has a newer ID (so latest grouped set gets the highest one)
if entry.id > grouped[key].id then
grouped[key].id = entry.id
end
table.insert(grouped[key].parts, entry.part)
end
-- Step 2: Convert to list and sort by ID descending
local groupedList = {}
for _, entry in pairs(grouped) do
table.insert(groupedList, entry)
end
table.sort(groupedList, function(a, b)
if a.date == b.date then
-- Sort by mileage (converted to number) descending
return tonumber(a.mileage) > tonumber(b.mileage)
else
return a.date > b.date
end
end)
-- Step 3: Build menu options
local menuOptions = {}
for _, entry in ipairs(groupedList) do
menuOptions[#menuOptions+1] = {
title = string.format(locale("menu_title.service_book_log"), entry.date, math.groupdigits(entry.mileage), Config.Mileage.Unit),
description = string.format(locale("menu_description.service_book_log"), entry.shop),
icon = "screwdriver-wrench",
metadata = entry.parts
}
end
-- Register and show
lib.registerContext({
id = "service_book",
title = locale("menu_title.service_book_main"),
options = menuOptions
})
lib.showContext("service_book")
end
--- Command if enabled to open service book menu
if Config.ServiceHistory.Command.enable then
RegisterCommand(Config.ServiceHistory.Command.name, function(source, args, rawCommand)
UseServiceBook()
end, false)
end
--- Event for using service book item:
RegisterNetEvent("t1ger_mechanic:client:useServiceBook", function()
UseServiceBook()
end)local isWorkflowOpen, isFocusCursor = false, false
--- Returns whether the workflow is active and open
--- @return boolean
function IsWorkflowActive()
return isWorkflowOpen == true
end
exports("IsWorkflowActive", IsWorkflowActive)
--- Updates workflow UI focus:
local function UpdateFocus()
if isWorkflowOpen then
SetNuiFocus(true, true)
SetNuiFocusKeepInput(true)
else
SetNuiFocus(false, false)
SetNuiFocusKeepInput(true)
end
end
--- Updates workflow cursor focus
local function ToggleWorkflowCursor()
if isWorkflowOpen then
if isFocusCursor then
SetNuiFocus(false, false)
SetNuiFocusKeepInput(true)
isFocusCursor = false
else
SetNuiFocus(true, true)
SetNuiFocusKeepInput(true)
isFocusCursor = true
end
else
UpdateFocus()
isFocusCursor = false
end
end
--- Toggles the workflow UI. Opens the workflow UI if `true` and hides if `false`
--- @param enable boolean
function ToggleWorkflowUI(enable)
isWorkflowOpen = enable
if not enable then
UpdateFocus()
end
SendNUIMessage({
action = "t1ger_mechanic:workflow:toggle",
data = {
state = enable
}
})
end
--- Sets the title of the workflow
--- @param title string
function SetWorkflowTitle(title)
if type(title) ~= "string" or title == "" then
title = Config.WorkflowUI.DefaultTitle
end
SendNUIMessage({
action = "t1ger_mechanic:workflow:setTitle",
data = title
})
end
--- Sets data to the workflow
--- @param data table
function SetWorkflowData(data)
if type(data) ~= "table" then
return error("[SetWorkflowData] Invalid type for data. Must be a table containing entries")
end
SendNUIMessage({
action = "t1ger_mechanic:workflow:setData",
data = data
})
end
--- Updates a given task in the workflow
--- @param id number The task ID
--- @param completed boolean Whether the task should be marked as completed or not
function UpdateWorkflowTask(id, completed)
if type(id) ~= "number" or type(completed) ~= "boolean" then return end
SendNUIMessage({
action = "t1ger_mechanic:workflow:updateTask",
data = {
id = id,
completed = completed
}
})
end
--- Removes a given task from the workflow
--- @param id number The task ID
function RemoveWorkflowTask(id)
if type(id) ~= "number" then return end
SendNUIMessage({
action = "t1ger_mechanic:workflow:removeTask",
data = {
id = id
}
})
end
--- Clears all tasks from the workflow
function ClearWorkflowTasks()
SendNUIMessage({
action = "t1ger_mechanic:workflow:clearTasks"
})
end
--- Starts the workflow UI with given title and data
--- @param title string
--- @param data table
function StartWorkflow(title, data)
if IsWorkflowActive() then
ClearWorkflowTasks()
ToggleWorkflowUI(false)
end
-- Set title:
SetWorkflowTitle(title)
-- Set data:
SetWorkflowData(data)
-- Toggle workflow UI:
ToggleWorkflowUI(true)
end
--- Stops the workflow UI and resets title and data
function StopWorkflow()
-- Set title:
SetWorkflowTitle()
-- Clear All Tasks
ClearWorkflowTasks()
-- Toggle workflow UI:
ToggleWorkflowUI(false)
end
--- Callback function when closing the workflow UI
RegisterNUICallback("t1ger_mechanic:workflow:closeNUI", function()
isWorkflowOpen = false
UpdateFocus()
end)
-- Callback function to set workflow total progress:
RegisterNUICallback("t1ger_mechanic:workflow:progressUpdated", function(newValue, cb)
if newValue == 100 then
Wait(1000)
StopWorkflow()
end
cb("ok")
end)
--- Thread to disable control actions
CreateThread(function()
while true do
if isWorkflowOpen and isFocusCursor then
-- Active check with minimal delay for smooth control blocking
Wait(1)
DisableAllControlActions(0)
else
-- Sleep longer when cursor is not active to save resources
Wait(500)
end
end
end)
--- Comamnd to close workflow UI:
RegisterCommand(Config.WorkflowUI.Commands.close, function()
ToggleWorkflowUI(false)
end, false)
--- Comamnd to open workflow UI:
RegisterCommand(Config.WorkflowUI.Commands.open, function()
ToggleWorkflowUI(true)
end, false)
--- command to toggle workflow cursor:
RegisterCommand(Config.WorkflowUI.Commands.cursor, function()
ToggleWorkflowCursor()
end, false)
--- command to clear workflow:
RegisterCommand(Config.WorkflowUI.Commands.clear, function()
-- Set title:
SetWorkflowTitle()
-- Clear All Tasks
ClearWorkflowTasks()
end, false)
--- KeyMapping for enable/disable cursor for UI:
RegisterKeyMapping(Config.WorkflowUI.Commands.cursor, Config.WorkflowUI.CursorKeybind.description, "keyboard", Config.WorkflowUI.CursorKeybind.defaultKey)fx_version 'cerulean'
game 'gta5'
lua54 'yes'
use_experimental_fxv2_oal 'yes'
name 't1ger_mechanic'
author 'T1GER Scripts'
discord 'https://discord.gg/t1ger'
description 'T1GER Mechanic'
version '3.6.9'
dependencies {
'/server:7290', -- ⚠PLEASE READ⚠; Requires at least SERVER build 7290.
'/gameBuild:3258', -- ⚠PLEASE READ⚠; Requires at least GAME build 3095.
't1ger_carlift', -- ⚠PLEASE READ⚠; Requires t1ger_carlift.
't1ger_mechanicprops' -- ⚠PLEASE READ⚠; Requires t1ger_mechanicprops.
}
shared_scripts {
'@ox_lib/init.lua',
'bridge/config.lua',
'bridge/init.lua',
'shared/*.lua',
}
client_scripts {
'bridge/framework/client.lua', -- Framework
'bridge/target/client.lua', -- Target
'bridge/inventory/client.lua', -- Inventory
'bridge/garage/client.lua', -- Garage
'bridge/notification/client.lua', -- Notification
'client/main.lua', -- Main
'client/vehicledata/*.lua', -- Vehicle Data (mileage, components, degradation and so on)
'client/shop/**/*.lua', -- Shop & Markers
'client/carlifts/class.lua', -- CarLift Class
'client/carlifts/main.lua', -- CarLift
'client/actions/*.lua', -- Main
'client/missions/*.lua', -- Missions
'client/carjack.lua', -- Car Jack
'client/repairs/main.lua', -- Repairs - main
'client/repairs/functions.lua', -- Repairs - functions
'client/repairs/body.lua', -- Repairs - functions
'client/workflow.lua', -- Workflow UI
}
server_scripts {
'@oxmysql/lib/MySQL.lua', -- or '@oxmysql/lib/MySQL.lua' if using oxmysql
'bridge/framework/server.lua', -- Framework
'bridge/inventory/server.lua', -- Inventory
'bridge/jobaccount/server.lua', -- Job Account / Society Account
'bridge/garage/server.lua', -- Garage
'bridge/notification/server.lua', -- Notification
'server/functions.lua', -- Functions
'server/main.lua', -- Start main server logic
'server/shop/class.lua', -- Shop Class
'server/shop/handler.lua', -- Shop Handler
'server/shop/main.lua', -- Shops
'server/vehicledata.lua', -- Vehicle Data
'server/carlifts/class.lua', -- Car Lift Class
'server/carlifts/main.lua', -- Car Lifts
'server/billing.lua', -- Billing
'server/missions.lua', -- Missions
}
files {
'locales/*.json',
'web/index.html',
'web/assets/*.*'
}
ui_page 'web/index.html'
ox_libs {
'locale',
'math'
}
escrow_ignore {
-- Shared files
'shared/*.lua',
-- Bridge files
'bridge/**/*.lua',
-- Client files (Source-Available)
'client/**/*.lua',
-- Server files (Source-Available)
'server/**/*.lua',
}
dependency '/assetpacks'{
"notification": {
"no_mechanic_shops": "No mechanic shops available.",
"no_online_players": "No players are currently online.",
"input_amount_higher_0": "Enter an amount greater than zero.",
"shop_created": "Created Shop: '%s' with job: '%s'",
"owner_removed": "You removed the current owner from the shop.",
"owner_assigned": "New owner '%s' assigned to shop '%s'.",
"updated_shop_account": "Shop's account balance updated to: %s",
"shop_deleted": "Shop '%s' [%s] has been deleted.",
"min_sale_price": "Minimum sale price is 0.",
"marker_created": "Created Marker: '%s' with name: '%s'",
"marker_updated": "Updated Marker: '%s' with markerId: '%s'",
"marker_deleted": "Deleted Marker: '%s' with markerId: '%s'",
"account_withdraw_max": "You cannot withdraw more money than what's in the balance!",
"not_enough_money": "You do not have enough money on you.",
"not_enough_bank_money": "You do not have enough money in your bank account.",
"account_deposited": "You deposited $%s into the account",
"account_withdrew": "You withdrew $%s from the account",
"no_players_nearby": "No players are currently nearby.",
"player_already_hired_shop": "The player is already hired in the shop: '%s'",
"employee_recruitment_sent": "You sent a recruitment offer to [%s] %s. Await for their response.",
"player_declined_recruitment": "The player '%s' has declined your recruitment offer",
"player_accepted_recruitment": "The player '%s' has accepted your recruitment offer",
"you_have_been_hired": "You have been hired in the shop: '%s'",
"no_hired_employees": "There are currently no hired employees in this shop.",
"cannot_fire_owner": "You cannot fire the owner of the shop, dumbass!",
"you_fired_employee": "You have fired employee '%s' from the shop.",
"cannot_update_owner": "You cannot promote/demote the owner of the shop, idiot!",
"you_updated_employee": "You have updated employee '%s' to %s",
"must_be_inside_vehicle": "You must be inside a vehicle!",
"vehicle_not_owned": "The vehicle plate is not registered anywhere!",
"no_owned_vehicles": "You have no owned vehicles",
"garage_no_vehicles": "You have no parked vehicles in this garage.",
"you_clocked_on_duty": "You clocked on-duty",
"you_clocked_off_duty": "You clocked off-duty",
"workbench_missing_materials": "Missing Materials:",
"you_crafted_item": "You successfully crafted %s pcs. of %s.",
"shop_account_insufficient_balance": "Not enough money in the shop account!",
"order_delivered_to_storage": "Your order has been delivered to the storage.",
"supplier_order_success": "Order confirmation of %s for: %s x %s.",
"no_towtruck_nearby": "You must be inside or near a flatbed/towtruck!",
"towtruck_ready_to_control": "Head to the back of the towtruck to attach or detach.",
"towtruck_park_vehicle_in_marker": "You must ensure the vehicle is parked inside the marker",
"towing_vehicle_blacklisted": "The vehicle is blacklisted from towing!",
"have_ongoing_mission": "You already have an ongoing mission. Complete or cancel it!",
"no_missions_available": "There are no missions available currently. Please try again later!",
"breakdown_vehicle_not_attached": "The NPC vehicle must be attached to a flatbed/towtruck!",
"breakdown_invalid_towtruck": "Vehicle must be attached to a valid towtruck",
"breakdown_passenger_seat_occupied": "The passenger seat in the towtruck is occupied!",
"breakdown_head_to_dropoff": "Drop off the vehicle and the NPC at the updated GPS location.",
"roadsiderepair_cannot_pay": "I cannot pay you before you've completed your work!",
"roadsiderepair_fixed": "Task is done. Collect payment from the NPC",
"carscrapping_head_to_dropoff": "Transport the vehicle to the scrapyard for salvaging.",
"carscrapping_pickup_vehicle": "Attach the vehicle to your tow truck to begin transport.",
"carscrapping_veh_not_in_zone": "Vehicle must be parked in the marker!",
"carscrapping_start_inspection": "Interact with NPC to initiate the salvage inspection.",
"carscrapping_npc_is_inspecting": "Please hold. The NPC is inspecting the vehicle.",
"carscrapping_inspect_complete": "The NPC has completed the inspection. Collect your payout!",
"carscrapping_reward": "Here's your materials! Bring me more cars!",
"mission_cash_reward": "You received %s as payment for your service!",
"you_declined_bill": "You declined a bill of %s from shop: '%s'.",
"you_paid_bill": "You paid a bill of %s from shop: '%s'.",
"player_not_afford_bill": "%s could not afford to pay your bill of %s.",
"player_declined_bill": "%s has declined to pay your bill of %s.",
"player_paid_bill": "%s has paid your bill of %s.",
"no_vehicle_in_direction": "There's no vehicle in that direction. Maybe move closer?",
"move_closer_to_interact": "Move yourself closer to interact...",
"cannot_be_inside_vehicle": "You cannot be inside a vehicle to perform this.",
"is_carrying_prop_emote": "You are already carrying an object",
"part_has_failed": "The condition of your %s has failured entirely.",
"part_malfunction": "The %s in the vehicle is in %s condition!",
"repair_station_closed": "Too many mechanics are available (%s online). Please visit a mechanic shop.",
"no_vehicle_nearby": "There's no vehicle nearby...",
"must_be_near_engine_hood": "You must be standing near the engine/hood of the vehicle!",
"repairkit_advanced_not_allowed": "You do not have experience to utilize advanced repair kits.",
"repairkit_basic_success": "You repaired your vehicle's engine enough to keep driving.",
"repairkit_advanced_success": "You fully repaired your vehicle!",
"patchkit_success": "You patched up your vehicle — find a mechanic soon!",
"must_be_near_wheel": "You must be standing near a wheel",
"is_carrying_component": "You are already carrying a component, complete your task!",
"component_not_compat": "The used component is not compatible with this vehicle type.",
"component_is_new": "The '%s' part is in perfect condition!",
"component_replaced": "You successfully replaced the %s.",
"component_salvage": "You salvaged materials: %s",
"component_no_vehicle": "You must be inside or near a vehicle!",
"component_tasklist_added": "You added '%s' to your task list.",
"component_tasklist_removed": "You removed '%s' from your task list.",
"is_carrying_body_part": "You are already carrying a body part, complete your task!",
"no_body_repairs_required": "The vehicle does not require any %s body repairs!",
"body_repair_window_check": "You cannot install a window without its corresponding door in place.",
"body_repair_move_closer": "Move closer to the missing body part you want to repair.",
"body_inspect_start": "Inspect the vehicle body to generate a body damage report.",
"body_inspect_cancelled": "You cancelled the inspection of the vehicle body.",
"body_repair_no_damage": "The vehicle body does not need any parts repair",
"body_inspection_complete": "The body damage report is now ready!",
"body_repair_complete": "Vehicle body-repair has been completed successfully!",
"carjack_carrying": "You are already carrying a carjack. Please attach it.",
"carjack_vehicle_attached": "The vehicle already has a car jack attached...",
"carjack_is_busy": "This car jack is currently being used.",
"carjack_fully_raised": "Car jack is already fully raised.",
"carjack_fully_lowered": "Car jack is already fully lowered.",
"carjack_4_wheels_only": "Car jack only works with 4-wheel vehicles!",
"is_diagnosing": "You are already diagnosing/inspecting vehicle. Please complete tasks or cancel."
},
"advanced_notification": {
"breakdown_title": "Breakdown Response",
"breakdown_subtitle": "Tow Required",
"breakdown_message": "A local driver needs a tow. Load up the car, have the NPC hop in, and complete the transport job.",
"roadsiderepair_title": "Roadside Repair",
"roadsiderepair_message": "A driver is stranded due to a vehicle issue. Bring the correct tools and get them back on the road.",
"carscrapping_title": "Car Scrapping",
"carscrapping_subtitle": "Tow Required",
"carscrapping_message": "An abandoned vehicle was reported. Tow it to the scrapyard to complete the job and earn materials."
},
"menu_title": {
"yes": "Yes",
"no": "No",
"admin_menu": "Admin Main Menu",
"view_shops": "View Shops",
"create_shop": "Create Shop",
"manage_shop": "Manage %s [%s]",
"set_owner": "Set Owner",
"set_account_bal": "Set Account Balance",
"marker_management": "Marker Management",
"delete_shop": "Delete Shop",
"list_for_sale": "List for Sale",
"cancel_sale": "Cancel Sale",
"remove_current_owner": "Remove Current Owner",
"create_marker": "Create Marker",
"view_markers": "View Markers",
"manage_marker": "Manage Marker: %s",
"marker_teleport": "Teleport",
"marker_edit": "Edit",
"marker_delete": "Delete",
"boss_main": "Boss Menu",
"boss_account": "Account",
"boss_account_balance": "Balance: $%s",
"boss_account_deposit": "Deposit",
"boss_account_withdraw": "Withdraw",
"boss_employees": "Employees",
"boss_employees_recruit": "Recruit Employee",
"boss_employees_view": "View Employees",
"boss_employee_manage": "Manage Employee",
"boss_employee_remove": "Remove Employee",
"boss_employee_update": "Update Job Grade",
"storage_main": "Storage",
"garage_main": "Garage Menu",
"garage_get_vehicle": "Get Vehicle",
"garage_store_vehicle": "Store Vehicle",
"duty_main": "Duty Menu",
"duty_state": "On Duty: %s",
"duty_clock_in_out": "Clock In/Out",
"workbench_main": "Workbench Menu",
"supplier_main": "Supplier Menu",
"missions_main": "Mechanic Missions",
"missions_cancel": "Cancel Mission",
"missions_breakdown": "Breakdown",
"missions_roadsiderepair": "Roadside Repair",
"missions_carscrapping": "Car Scrapping",
"billing_main": "Billing",
"billing_create": "Create Bill",
"billing_view": "View Bills",
"billing_overview": "%s | %s",
"billing_respond": "Pay Bill: %s",
"billing_note": "Note",
"action_main": "Mechanic Action Menu",
"action_tow_vehicle": "Tow Vehicle",
"action_push_vehicle": "Push Vehicle",
"action_flip_vehicle": "Flip Vehicle",
"action_unlock_vehicle": "Unlock Vehicle",
"action_impound_vehicle": "Impound Vehicle",
"repair_station_main": "Repair Station",
"repair_station_type_full": "Repair Vehicle",
"repair_station_type_engine": "Engine Repair",
"repair_station_type_body": "Body Repair",
"repair_station_type_core_parts": "Core Parts Repair",
"repair_station_type_service_parts": "Service Parts Repair",
"diagnostic_main": "Vehicle Diagnostic",
"diagnostic_system_overview": "System Overview",
"diagnostic_core_parts": "Core Parts",
"diagnostic_service_parts": "Service Parts",
"diagnostic_workflow": "Start Workflow",
"carjack_raise": "Raise",
"carjack_lower": "Lower",
"service_ok": "Service OK",
"service_due": "Service Due",
"service_overdue": "Service Overdue",
"part_optimal": "Optimal",
"part_worn": "Worn",
"part_critical": "Critical",
"part_failed": "Failed",
"service_book_main": "Service Book",
"service_book_log": "%s @ %s %s"
},
"menu_description": {
"set_owner": "Assign a new owner - or remove the current owner",
"set_account_bal": "Current Balance: $%s",
"marker_management": "Manage shop markers - create, edit, teleport or delete",
"delete_shop": "Delete the shop from the game & database",
"list_for_sale": "List the shop for sale for other players to purchase and operate it",
"cancel_sale": "Currently for sale at: %s",
"remove_current_owner": "Delete the shop from the game & database",
"create_marker": "Create a new marker with a specified marker class",
"view_markers": "View created markers and manage them",
"marker_teleport": "Teleport to the marker",
"marker_edit": "Open the marker creation interface to edit all values, except the marker class",
"marker_delete": "Delete this marker permanently?",
"boss_employee_remove": "Do you want to fire '%s' from the shop?",
"boss_employee_update": "Promote or demote the job grade for '%s'",
"missions_cancel": "Cancel the current ongoing mission",
"missions_breakdown": "NPC vehicle has a breakdown and the vehicle cannot be repaired at scene. Bring a tow-truck and tow the vehicle to it's destination.",
"missions_roadsiderepair": "NPC vehicle may have a dead battery, ran out of fuel or a bursted tire. Bring your tools and make sure the NPC can get going again.",
"missions_carscrapping": "Pick up a junk car and drop it at the scrapyard to disassemble the vehicle and receive some materials.",
"repair_station_type": "Duration %s seconds",
"diagnostic_core_parts": "Conduct a diagnostic check of the core components. Assess their condition and identify any parts that may require immediate replacement due to wear or failure.",
"diagnostic_service_parts": "Perform a service check on the vehicle. Review the mileage of service parts and replace any that are due or nearing replacement.",
"diagnostic_workflow": "Generate a diagnostics report of the selected parts and begin to replace the following parts: \n\n",
"diagnostic_workflow2": "• %s - %s (%s%%)\n",
"service_book_log": "Performed at %s"
},
"input_title": {
"shop_creation": "Shop Creation",
"set_account_balance": "Set Account Balance",
"marker_creation": "Marker Creation",
"marker_edit": "Marker Update",
"boss_account": "Account",
"workbench_craft": "Craft: %s",
"supplier_order": "Order %s (Unit Price: %s)",
"supplier_confirmation": "Place Order: %sx of %s for: %s",
"supplier_storage": "Select Storage",
"create_bill": "Create Bill",
"list_for_sale": "List Shop For Sale"
},
"input_label": {
"shop_name": "Shop Name",
"job_name": "Job Name",
"job_label": "Job Label",
"account_start_balance": "Account Start Balance",
"sale_price": "Sale Price",
"for_sale": "For Sale?",
"blip_sprite": "Blip Sprite",
"blip_color": "Blip Color",
"create_blip": "Create Blip?",
"account_current_balance": "Current Balance",
"account_enter_amount": "Enter Account Amount",
"marker_class": "Class",
"marker_name": "Name",
"marker_type": "DrawMarker Type",
"marker_color": "DrawMarker Color",
"marker_bobupdown": "Bob Up And Down?",
"marker_facecamera": "Face Camera?",
"marker_createblip": "Create Blip?",
"marker_stash_slots": "Stash Slots",
"marker_stash_weight": "Stash Weight",
"boss_current_account": "Current Account Balance",
"boss_deposit_account": "Deposit Amount",
"boss_withdraw_account": "Withdraw Amount",
"workbench_amount": "Amount",
"supplier_quantity": "Quantity",
"supplier_confirm": "Confirm",
"supplier_storage": "Storage",
"bill_player": "Player",
"bill_amount": "Amount",
"bill_note": "Note",
"bill_date": "Date",
"bill_time": "Time"
},
"input_description": {
"shop_name": "A name for the created shop",
"job_name": "Use an existing job name or create a new job (example: t1mechanic)",
"job_label": "Job label for created job (example: T1GER Mechanic)",
"account_start_balance": "Should the shop start with some money?",
"sale_price": "A price to purchase the shop",
"blip_sprite": "Set Custom Blip Sprite",
"blip_color": "Set Custom Blip Color",
"account_enter_amount": "Enter desired amount to update the account balance with",
"marker_class": "Select a marker class(type) to create",
"marker_name": "Set a name for the marker, e.g. T1GER's Workbench.",
"marker_type": "Marker type that will be drawn in-game when nearby the marker.",
"marker_color": "Set RGBA color of the marker to be displayed.",
"marker_stash_slots": "Set maximum number of slots available in the stash.",
"marker_stash_weight": "Set maximum weight allowed in the stash.",
"workbench_amount": "Enter how many %s you want to craft",
"supplier_quantity": "Enter amount of %s parts to order.",
"supplier_storage": "Select which storage to receive the ordered parts in.",
"bill_player": "Select a player to bill",
"bill_note": "Enter details or notes for the bill"
},
"menu_metadata": {
"not_answered": "N/A",
"id": "ID",
"owner": "Owner",
"owner_id": "Owner ID",
"job": "Job",
"player_id": "Player ID",
"player_name": "Name",
"player_identifier": "Identifier",
"job_grade": "Job Grade",
"vehicle_make": "Make",
"vehicle_model": "Model",
"vehicle_plate": "Plate",
"vehicle_engine": "Engine",
"vehicle_body": "Body",
"vehicle_fuel": "Fuel",
"billing_reference": "Reference",
"billing_sender": "Sender",
"billing_receiver": "Receiver",
"billing_amount": "Amount",
"billing_date": "Date",
"billing_time": "Time",
"component_condition": "Condition",
"component_health": "Health",
"component_associated": "Associated Part(s)",
"component_next_service": "Next Service",
"component_since_service": "Since Service",
"component_service_interval": "Service Interval",
"diagnostic_engine_health": "Engine Health",
"diagnostic_body_health": "Body Health",
"diagnostic_tank_health": "Tank Health",
"diagnostic_fuel_level": "Fuel Level",
"diagnostic_dirt_level": "Dirt Level",
"diagnostic_oil_level": "Oil Level",
"diagnostic_engine_temp": "Engine Temperature",
"diagnostic_mileage": "Mileage",
"diagnostic_plate": "License Plate"
},
"alert": {
"header": {
"delete_shop": "Delete Shop?",
"recruit_employee": "Employee Recruitment Offer"
},
"content": {
"delete_shop": "Are you sure you want to delete the shop: \n\n %s (%s)?",
"recruit_employee": "You have been offered a position as employee in the shop: '%s'.\n\n Will you accept/decline the recruitment offer?"
}
},
"target": {
"carlift_up": "Lift Up",
"carlift_down": "Lift Down",
"carlift_stop": "Lift Stop",
"carlift_delete": "Lift Delete",
"missions_ped_interact": "Ped Interact",
"roadsiderepair_fuel": "Refuel Vehicle",
"roadsiderepair_battery": "Jumpstart Battery",
"roadsiderepair_tire": "Replace Tire",
"prop_emote_remove": "Remove Prop",
"prop_emote_attach": "Carry / Push",
"component_repair": "Replace Component",
"body_repair": "Install %s",
"body_inspect": "Inspect Body",
"carjack_remove": "Remove Car Jack",
"carjack_handle": "Use Car Jack"
},
"progressbar": {
"crafting": "Crafting: %sx %s",
"mission_reward": "Collecting Payment",
"roadsiderepair_fuel": "Refuelling Vehicle",
"roadsiderepair_battery": "Jumpstarting Battery",
"roadsiderepair_tire": "Replacing Tire",
"flip_vehicle": "Flipping Vehicle",
"unlock_vehicle": "Unlocking Vehicle",
"impound_vehicle": "Impounding Vehicle",
"repair_station_type_full": "Repairing Vehicle",
"repair_station_type_engine": "Repairing Engine",
"repair_station_type_body": "Repairing Body",
"repair_station_type_core_parts": "Repairing Core Parts",
"repair_station_type_service_parts": "Repairing Service Parts",
"repair_kit_basic": "Using Repair Kit",
"repair_kit_advanced": "Using Advanced Repair Kit",
"patch_kit": "Using Patch Kit",
"component_repair": "Replacing Component",
"component_diagnose": "Diagnosing Vehicle",
"body_repair": "Installing %s",
"body_inspect": "Inspecting Vehicle Body"
},
"textui": {
"duty_marker": "[E] Toggle Duty",
"boss_marker": "[E] Boss Menu",
"garage_marker": "[E] Garage",
"storage_marker": "[E] Storage",
"supplier_marker": "[E] Supplier",
"workbench_marker": "[E] Workbench",
"push_vehicle": "Steer vehicle with [A] and [D]",
"repair_station": "[E] Repair Station",
"body_inspect": "[E] Inspect Body"
},
"drawtext": {
"tow_attach": "~g~[G]~s~ Attach Vehicle",
"tow_detach": "~r~[G]~s~ Detach vehicle",
"push_vehicle": "Hold ~g~[LEFT SHIFT]~s~ to Push Vehicle",
"stop_push": "~r~[BACKSPACE]~s~ Stop Push",
"flip_vehicle": "~r~[E]~s~ Flip Vehicle",
"unlock_vehicle": "~r~[E]~s~ Unlock Vehicle",
"impound_vehicle": "~r~[E]~s~ Impound Vehicle"
}
}{
"notification": {
"no_mechanic_shops": "Nu exista ateliere de mecanica disponibile.",
"no_online_players": "Niciun jucator nu este online in acest moment.",
"input_amount_higher_0": "Introduceti o suma mai mare decat zero.",
"shop_created": "Atelier creat: '%s' cu meseria: '%s'",
"owner_removed": "Ai eliminat proprietarul actual din atelier.",
"owner_assigned": "Noul proprietar '%s' a fost atribuit atelierului '%s'.",
"updated_shop_account": "Soldul contului atelierului a fost actualizat la: %s",
"shop_deleted": "Atelierul '%s' [%s] a fost sters.",
"min_sale_price": "Pretul minim de vanzare este 0.",
"marker_created": "Marker creat: '%s' cu numele: '%s'",
"marker_updated": "Marker actualizat: '%s' cu markerId: '%s'",
"marker_deleted": "Marker sters: '%s' cu markerId: '%s'",
"account_withdraw_max": "Nu poti retrage mai multi bani decat ai in sold!",
"not_enough_money": "Nu ai suficienti bani la tine.",
"not_enough_bank_money": "Nu ai suficienti bani in contul bancar.",
"account_deposited": "Ai depus $%s in cont",
"account_withdrew": "Ai retras $%s din cont",
"no_players_nearby": "Niciun jucator nu este in apropiere.",
"player_already_hired_shop": "Jucatorul este deja angajat in atelierul: '%s'",
"employee_recruitment_sent": "Ai trimis o oferta de angajare catre [%s] %s. Asteapta raspunsul.",
"player_declined_recruitment": "Jucatorul '%s' a refuzat oferta ta de angajare",
"player_accepted_recruitment": "Jucatorul '%s' a acceptat oferta ta de angajare",
"you_have_been_hired": "Ai fost angajat in atelierul: '%s'",
"no_hired_employees": "Nu exista angajati in acest atelier in momentul de fata.",
"cannot_fire_owner": "Nu poti concedia proprietarul atelierului!",
"you_fired_employee": "Ai concediat angajatul '%s' din atelier.",
"cannot_update_owner": "Nu poti promova/retrograda proprietarul atelierului!",
"you_updated_employee": "Ai actualizat angajatul '%s' la %s",
"must_be_inside_vehicle": "Trebuie sa fii intr-un vehicul!",
"vehicle_not_owned": "Placuta vehiculului nu este inregistrata nicaieri!",
"no_owned_vehicles": "Nu ai vehicule detinute",
"garage_no_vehicles": "Nu ai vehicule parcate in acest garaj.",
"you_clocked_on_duty": "Ai intrat in tura",
"you_clocked_off_duty": "Ai iesit din tura",
"workbench_missing_materials": "Materiale lipsa:",
"you_crafted_item": "Ai fabricat cu succes %s buc. de %s.",
"shop_account_insufficient_balance": "Fonduri insuficiente in contul atelierului!",
"order_delivered_to_storage": "Comanda ta a fost livrata la depozit.",
"supplier_order_success": "Confirmare comanda de %s pentru: %s x %s.",
"no_towtruck_nearby": "Trebuie sa fii intr-o platforma/camion de tractare sau in apropierea unuia!",
"towtruck_ready_to_control": "Mergi in spatele camionului pentru a atasa sau detasa.",
"towtruck_park_vehicle_in_marker": "Trebuie sa te asiguri ca vehiculul este parcat in marker",
"towing_vehicle_blacklisted": "Vehiculul este pe lista neagra pentru tractare!",
"flatbed_lowered": "Platforma coborata. Gata de incarcare.",
"flatbed_raised": "Platforma ridicata si asigurata.",
"winch_attached": "Cablul troliului atasat la vehicul.",
"vehicle_sliding_off": "Se elibereaza vehiculul de pe platforma...",
"vehicle_loaded": "Vehicul incarcat si asigurat pe platforma!",
"vehicle_detached": "Vehiculul a fost descarcat de pe platforma.",
"have_ongoing_mission": "Ai deja o misiune in desfasurare. Finalizeaza-o sau anuleaz-o!",
"no_missions_available": "Nu sunt misiuni disponibile in acest moment. Incearca mai tarziu!",
"breakdown_vehicle_not_attached": "Vehiculul NPC trebuie atasat la o platforma/camion de tractare!",
"breakdown_invalid_towtruck": "Vehiculul trebuie atasat la un camion de tractare valid",
"breakdown_passenger_seat_occupied": "Locul pasagerului din camionul de tractare este ocupat!",
"breakdown_head_to_dropoff": "Preda vehiculul si NPC-ul la locatia GPS actualizata.",
"roadsiderepair_cannot_pay": "Nu te pot plati inainte sa-ti termini treaba!",
"roadsiderepair_fixed": "Treaba e gata. Colecteaza plata de la NPC",
"carscrapping_head_to_dropoff": "Transporta vehiculul la fierar pentru dezmembrare.",
"carscrapping_pickup_vehicle": "Ataseaza vehiculul la camionul de tractare pentru a incepe transportul.",
"carscrapping_veh_not_in_zone": "Vehiculul trebuie parcat in marker!",
"carscrapping_start_inspection": "Interactioneaza cu NPC-ul pentru a initia inspectia de dezmembrare.",
"carscrapping_npc_is_inspecting": "Te rog asteapta. NPC-ul inspecteaza vehiculul.",
"carscrapping_inspect_complete": "NPC-ul a finalizat inspectia. Colecteaza plata!",
"carscrapping_reward": "Iata materialele tale! Adu-mi mai multe masini!",
"mission_cash_reward": "Ai primit %s ca plata pentru serviciul tau!",
"you_declined_bill": "Ai refuzat o factura de %s de la atelierul: '%s'.",
"you_paid_bill": "Ai platit o factura de %s de la atelierul: '%s'.",
"player_not_afford_bill": "%s nu si-a putut permite sa plateasca factura ta de %s.",
"player_declined_bill": "%s a refuzat sa plateasca factura ta de %s.",
"player_paid_bill": "%s a platit factura ta de %s.",
"no_vehicle_in_direction": "Nu este niciun vehicul in directia aceea. Poate muta-te mai aproape?",
"move_closer_to_interact": "Muta-te mai aproape pentru a interactiona...",
"cannot_be_inside_vehicle": "Nu poti fi intr-un vehicul pentru a face acest lucru.",
"is_carrying_prop_emote": "Duci deja un obiect",
"part_has_failed": "Starea %s s-a deteriorat complet.",
"part_malfunction": "%s din vehicul este in stare %s!",
"repair_station_closed": "Prea multi mecanici sunt disponibili (%s online). Te rog viziteaza un atelier.",
"no_vehicle_nearby": "Nu este niciun vehicul in apropiere...",
"must_be_near_engine_hood": "Trebuie sa stai langa motorul/capota vehiculului!",
"repairkit_advanced_not_allowed": "Nu ai experienta necesara pentru a utiliza kituri de reparatie avansate.",
"repairkit_basic_success": "Ai reparat motorul vehiculului suficient pentru a continua drumul.",
"repairkit_advanced_success": "Ai reparat complet vehiculul!",
"patchkit_success": "Ai peticit vehiculul — gaseste un mecanic curand!",
"must_be_near_wheel": "Trebuie sa stai langa o roata",
"is_carrying_component": "Duci deja o componenta, finalizeaza sarcina!",
"component_not_compat": "Componenta utilizata nu este compatibila cu acest tip de vehicul.",
"component_is_new": "Piesa '%s' este in stare perfecta!",
"component_replaced": "Ai inlocuit cu succes %s.",
"component_salvage": "Ai recuperat materiale: %s",
"component_no_vehicle": "Trebuie sa fii intr-un vehicul sau langa unul!",
"component_tasklist_added": "Ai adaugat '%s' pe lista de sarcini.",
"component_tasklist_removed": "Ai eliminat '%s' de pe lista de sarcini.",
"is_carrying_body_part": "Duci deja o piesa de caroserie, finalizeaza sarcina!",
"no_body_repairs_required": "Vehiculul nu necesita reparatii de caroserie %s!",
"body_repair_window_check": "Nu poti instala un geam fara usa corespunzatoare la locul ei.",
"body_repair_move_closer": "Muta-te mai aproape de piesa de caroserie lipsa pe care vrei sa o repari.",
"body_inspect_start": "Inspecteaza caroseria vehiculului pentru a genera un raport de daune.",
"body_inspect_cancelled": "Ai anulat inspectia caroseriei vehiculului.",
"body_repair_no_damage": "Caroseria vehiculului nu necesita reparatii de piese",
"body_inspection_complete": "Raportul de daune ale caroseriei este gata!",
"body_repair_complete": "Reparatia caroseriei vehiculului a fost finalizata cu succes!",
"carjack_carrying": "Duci deja un cric. Te rog ataseaza-l.",
"carjack_vehicle_attached": "Vehiculul are deja un cric atasat...",
"carjack_is_busy": "Acest cric este utilizat in acest moment.",
"carjack_fully_raised": "Cricul este deja complet ridicat.",
"carjack_fully_lowered": "Cricul este deja complet coborat.",
"carjack_4_wheels_only": "Cricul functioneaza doar cu vehicule cu 4 roti!",
"is_diagnosing": "Deja diagnostichezi/inspectezi vehiculul. Finalizeaza sarcinile sau anuleaza."
},
"advanced_notification": {
"breakdown_title": "Interventie Defectiune",
"breakdown_subtitle": "Necesita Tractare",
"breakdown_message": "Un sofer local are nevoie de tractare. Incarca masina, pune NPC-ul in cabina si finalizeaza transportul.",
"roadsiderepair_title": "Reparatie pe Marginea Drumului",
"roadsiderepair_message": "Un sofer este blocat din cauza unei probleme la vehicul. Adu uneltele corecte si pune-l inapoi pe drum.",
"carscrapping_title": "Dezmembrare Auto",
"carscrapping_subtitle": "Necesita Tractare",
"carscrapping_message": "Un vehicul abandonat a fost raportat. Tracteaza-l la fierar pentru a finaliza misiunea si a primi materiale."
},
"menu_title": {
"yes": "Da",
"no": "Nu",
"admin_menu": "Meniu Principal Admin",
"view_shops": "Vezi Atelierele",
"create_shop": "Creeaza Atelier",
"manage_shop": "Administreaza %s [%s]",
"set_owner": "Seteaza Proprietar",
"set_account_bal": "Seteaza Soldul Contului",
"marker_management": "Administrare Markere",
"delete_shop": "Sterge Atelierul",
"list_for_sale": "Pune la Vanzare",
"cancel_sale": "Anuleaza Vanzarea",
"remove_current_owner": "Elimina Proprietarul Actual",
"create_marker": "Creeaza Marker",
"view_markers": "Vezi Markerele",
"manage_marker": "Administreaza Marker: %s",
"marker_teleport": "Teleportare",
"marker_edit": "Editare",
"marker_delete": "Stergere",
"boss_main": "Meniu Sef",
"boss_account": "Cont",
"boss_account_balance": "Sold: $%s",
"boss_account_deposit": "Depunere",
"boss_account_withdraw": "Retragere",
"boss_employees": "Angajati",
"boss_employees_recruit": "Recruteaza Angajat",
"boss_employees_view": "Vezi Angajatii",
"boss_employee_manage": "Administreaza Angajat",
"boss_employee_remove": "Concediaza Angajat",
"boss_employee_update": "Actualizeaza Gradul",
"storage_main": "Depozit",
"garage_main": "Meniu Garaj",
"garage_get_vehicle": "Scoate Vehicul",
"garage_store_vehicle": "Parcheaza Vehicul",
"duty_main": "Meniu Tura",
"duty_state": "In Tura: %s",
"duty_clock_in_out": "Intra/Iesi din Tura",
"workbench_main": "Meniu Banc de Lucru",
"supplier_main": "Meniu Furnizor",
"missions_main": "Misiuni Mecanic",
"missions_cancel": "Anuleaza Misiunea",
"missions_breakdown": "Defectiune",
"missions_roadsiderepair": "Reparatie pe Drum",
"missions_carscrapping": "Dezmembrare Auto",
"billing_main": "Facturare",
"billing_create": "Creeaza Factura",
"billing_view": "Vezi Facturile",
"billing_overview": "%s | %s",
"billing_respond": "Plateste Factura: %s",
"billing_note": "Nota",
"action_main": "Meniu Actiuni Mecanic",
"action_tow_vehicle": "Tracteaza Vehicul",
"action_push_vehicle": "Impinge Vehicul",
"action_flip_vehicle": "Intoarce Vehicul",
"action_unlock_vehicle": "Deblocheaza Vehicul",
"action_impound_vehicle": "Confisca Vehicul",
"repair_station_main": "Statie de Reparatii",
"repair_station_type_full": "Repara Vehiculul",
"repair_station_type_engine": "Reparatie Motor",
"repair_station_type_body": "Reparatie Caroserie",
"repair_station_type_core_parts": "Reparatie Piese Principale",
"repair_station_type_service_parts": "Reparatie Piese Service",
"diagnostic_main": "Diagnostic Vehicul",
"diagnostic_system_overview": "Prezentare Generala Sistem",
"diagnostic_core_parts": "Piese Principale",
"diagnostic_service_parts": "Piese Service",
"diagnostic_workflow": "Incepe Fluxul de Lucru",
"carjack_raise": "Ridica",
"carjack_lower": "Coboara",
"service_ok": "Service OK",
"service_due": "Service Necesar",
"service_overdue": "Service Intarziat",
"part_optimal": "Optim",
"part_worn": "Uzat",
"part_critical": "Critic",
"part_failed": "Defect",
"service_book_main": "Carte de Service",
"service_book_log": "%s @ %s %s"
},
"menu_description": {
"set_owner": "Atribuie un nou proprietar - sau elimina proprietarul actual",
"set_account_bal": "Sold curent: $%s",
"marker_management": "Administreaza markerele atelierului - creeaza, editeaza, teleporteaza sau sterge",
"delete_shop": "Sterge atelierul din joc si baza de date",
"list_for_sale": "Pune atelierul la vanzare pentru ca alti jucatori sa-l cumpere si opereze",
"cancel_sale": "In prezent la vanzare la: %s",
"remove_current_owner": "Sterge atelierul din joc si baza de date",
"create_marker": "Creeaza un marker nou cu o clasa specificata",
"view_markers": "Vezi markerele create si administreaza-le",
"marker_teleport": "Teleportare la marker",
"marker_edit": "Deschide interfata de creare marker pentru a edita toate valorile, cu exceptia clasei",
"marker_delete": "Stergi acest marker permanent?",
"boss_employee_remove": "Vrei sa concediezi pe '%s' din atelier?",
"boss_employee_update": "Promoveaza sau retrogradeaza gradul pentru '%s'",
"missions_cancel": "Anuleaza misiunea curenta",
"missions_breakdown": "Vehiculul NPC-ului are o defectiune si nu poate fi reparat la fata locului. Adu un camion de tractare si tracteaza vehiculul la destinatie.",
"missions_roadsiderepair": "Vehiculul NPC-ului poate avea bateria descarcata, fara combustibil sau o pana de cauciuc. Adu-ti uneltele si asigura-te ca NPC-ul poate pleca din nou.",
"missions_carscrapping": "Ridica o masina veche si du-o la fierar pentru dezmembrare si primire de materiale.",
"repair_station_type": "Durata %s secunde",
"diagnostic_core_parts": "Efectueaza o verificare diagnostic a componentelor principale. Evalueaza starea lor si identifica piesele care necesita inlocuire imediata.",
"diagnostic_service_parts": "Efectueaza o verificare service a vehiculului. Revizuieste kilometrajul pieselor service si inlocuieste-le pe cele care necesita interventie.",
"diagnostic_workflow": "Genereaza un raport diagnostic al pieselor selectate si incepe inlocuirea urmatoarelor piese: \n\n",
"diagnostic_workflow2": "• %s - %s (%s%%)\n",
"service_book_log": "Efectuat la %s"
},
"input_title": {
"shop_creation": "Creare Atelier",
"set_account_balance": "Setare Sold Cont",
"marker_creation": "Creare Marker",
"marker_edit": "Actualizare Marker",
"boss_account": "Cont",
"workbench_craft": "Fabrica: %s",
"supplier_order": "Comanda %s (Pret unitar: %s)",
"supplier_confirmation": "Plaseaza Comanda: %sx de %s pentru: %s",
"supplier_storage": "Selecteaza Depozitul",
"create_bill": "Creeaza Factura",
"list_for_sale": "Pune Atelierul la Vanzare"
},
"input_label": {
"shop_name": "Nume Atelier",
"job_name": "Nume Meserie",
"job_label": "Eticheta Meserie",
"account_start_balance": "Sold Initial Cont",
"sale_price": "Pret de Vanzare",
"for_sale": "De Vanzare?",
"blip_sprite": "Sprite Blip",
"blip_color": "Culoare Blip",
"create_blip": "Creeaza Blip?",
"account_current_balance": "Sold Curent",
"account_enter_amount": "Introdu Suma",
"marker_class": "Clasa",
"marker_name": "Nume",
"marker_type": "Tip DrawMarker",
"marker_color": "Culoare DrawMarker",
"marker_bobupdown": "Miscare Sus-Jos?",
"marker_facecamera": "Fata catre Camera?",
"marker_createblip": "Creeaza Blip?",
"marker_stash_slots": "Sloturi Depozit",
"marker_stash_weight": "Greutate Depozit",
"boss_current_account": "Sold Curent Cont",
"boss_deposit_account": "Suma Depunere",
"boss_withdraw_account": "Suma Retragere",
"workbench_amount": "Cantitate",
"supplier_quantity": "Cantitate",
"supplier_confirm": "Confirmare",
"supplier_storage": "Depozit",
"bill_player": "Jucator",
"bill_amount": "Suma",
"bill_note": "Nota",
"bill_date": "Data",
"bill_time": "Ora"
},
"input_description": {
"shop_name": "Un nume pentru atelierul creat",
"job_name": "Foloseste un nume de meserie existent sau creeaza unul nou (exemplu: t1mechanic)",
"job_label": "Eticheta meserie pentru meseria creata (exemplu: T1GER Mechanic)",
"account_start_balance": "Atelierul ar trebui sa inceapa cu niste bani?",
"sale_price": "Un pret pentru achizitionarea atelierului",
"blip_sprite": "Seteaza Sprite Blip Personalizat",
"blip_color": "Seteaza Culoare Blip Personalizata",
"account_enter_amount": "Introdu suma dorita pentru actualizarea soldului contului",
"marker_class": "Selecteaza o clasa(tip) de marker pentru creare",
"marker_name": "Seteaza un nume pentru marker, ex. Bancul de Lucru T1GER.",
"marker_type": "Tipul markerului care va fi afisat in joc cand esti aproape.",
"marker_color": "Seteaza culoarea RGBA a markerului afisat.",
"marker_stash_slots": "Seteaza numarul maxim de sloturi disponibile in depozit.",
"marker_stash_weight": "Seteaza greutatea maxima permisa in depozit.",
"workbench_amount": "Introdu cate %s vrei sa fabrici",
"supplier_quantity": "Introdu cantitatea de piese %s de comandat.",
"supplier_storage": "Selecteaza depozitul care va primi piesele comandate.",
"bill_player": "Selecteaza un jucator pentru facturare",
"bill_note": "Introdu detalii sau note pentru factura"
},
"menu_metadata": {
"not_answered": "N/A",
"id": "ID",
"owner": "Proprietar",
"owner_id": "ID Proprietar",
"job": "Meserie",
"player_id": "ID Jucator",
"player_name": "Nume",
"player_identifier": "Identificator",
"job_grade": "Grad Meserie",
"vehicle_make": "Marca",
"vehicle_model": "Model",
"vehicle_plate": "Numar",
"vehicle_engine": "Motor",
"vehicle_body": "Caroserie",
"vehicle_fuel": "Combustibil",
"billing_reference": "Referinta",
"billing_sender": "Expeditor",
"billing_receiver": "Destinatar",
"billing_amount": "Suma",
"billing_date": "Data",
"billing_time": "Ora",
"component_condition": "Stare",
"component_health": "Sanatate",
"component_associated": "Piese Asociate",
"component_next_service": "Urmatorul Service",
"component_since_service": "De la Ultimul Service",
"component_service_interval": "Interval Service",
"diagnostic_engine_health": "Sanatate Motor",
"diagnostic_body_health": "Sanatate Caroserie",
"diagnostic_tank_health": "Sanatate Rezervor",
"diagnostic_fuel_level": "Nivel Combustibil",
"diagnostic_dirt_level": "Nivel Murdarie",
"diagnostic_oil_level": "Nivel Ulei",
"diagnostic_engine_temp": "Temperatura Motor",
"diagnostic_mileage": "Kilometraj",
"diagnostic_plate": "Numar de Inmatriculare"
},
"alert": {
"header": {
"delete_shop": "Stergi Atelierul?",
"recruit_employee": "Oferta de Angajare"
},
"content": {
"delete_shop": "Esti sigur ca vrei sa stergi atelierul: \n\n %s (%s)?",
"recruit_employee": "Ti s-a oferit un post de angajat in atelierul: '%s'.\n\n Accepti/Refuzi oferta de angajare?"
}
},
"target": {
"carlift_up": "Ridicare Lift",
"carlift_down": "Coborare Lift",
"carlift_stop": "Oprire Lift",
"carlift_delete": "Stergere Lift",
"missions_ped_interact": "Interactiune NPC",
"roadsiderepair_fuel": "Alimentare Vehicul",
"roadsiderepair_battery": "Pornire Baterie",
"roadsiderepair_tire": "Inlocuire Cauciuc",
"prop_emote_remove": "Elimina Obiect",
"prop_emote_attach": "Cara / Impinge",
"component_repair": "Inlocuire Componenta",
"body_repair": "Instalare %s",
"body_inspect": "Inspectare Caroserie",
"carjack_remove": "Eliminare Cric",
"carjack_handle": "Folosire Cric"
},
"progressbar": {
"crafting": "Se fabrica: %sx %s",
"mission_reward": "Se colecteaza plata",
"roadsiderepair_fuel": "Se alimenteaza vehiculul",
"roadsiderepair_battery": "Se porneste bateria",
"roadsiderepair_tire": "Se inlocuieste cauciucul",
"flip_vehicle": "Se intoarce vehiculul",
"unlock_vehicle": "Se deblocheaza vehiculul",
"impound_vehicle": "Se confisca vehiculul",
"repair_station_type_full": "Se repara vehiculul",
"repair_station_type_engine": "Se repara motorul",
"repair_station_type_body": "Se repara caroseria",
"repair_station_type_core_parts": "Se repara piesele principale",
"repair_station_type_service_parts": "Se repara piesele service",
"repair_kit_basic": "Se foloseste kitul de reparatie",
"repair_kit_advanced": "Se foloseste kitul avansat de reparatie",
"patch_kit": "Se foloseste kitul de peticit",
"component_repair": "Se inlocuieste componenta",
"component_diagnose": "Se diagnosticheaza vehiculul",
"flatbed_lowering": "Se coboara platforma...",
"flatbed_raising": "Se ridica platforma...",
"winch_hooking": "Se ataseaza cablul troliului...",
"winch_pulling": "Se trage vehiculul pe platforma...",
"winch_unhooking": "Se detaseaza cablul troliului...",
"body_repair": "Se instaleaza %s",
"body_inspect": "Se inspecteaza caroseria vehiculului"
},
"textui": {
"duty_marker": "[E] Schimba Tura",
"boss_marker": "[E] Meniu Sef",
"garage_marker": "[E] Garaj",
"storage_marker": "[E] Depozit",
"supplier_marker": "[E] Furnizor",
"workbench_marker": "[E] Banc de Lucru",
"push_vehicle": "Directioneaza vehiculul cu [A] si [D]",
"repair_station": "[E] Statie Reparatii",
"body_inspect": "[E] Inspectare Caroserie"
},
"drawtext": {
"tow_attach": "~g~[G]~s~ Ataseaza Vehicul",
"tow_detach": "~r~[G]~s~ Detaseaza Vehicul",
"push_vehicle": "Tine apasat ~g~[LEFT SHIFT]~s~ pentru a Impinge Vehiculul",
"stop_push": "~r~[BACKSPACE]~s~ Opreste Impingerea",
"flip_vehicle": "~r~[E]~s~ Intoarce Vehiculul",
"unlock_vehicle": "~r~[E]~s~ Deblocheaza Vehiculul",
"impound_vehicle": "~r~[E]~s~ Confisca Vehiculul"
}
}
Config = {}
Config.Debug = false
Config.Currency = "$" -- currency used for pricing
Config.ServerSideProps = true -- create objects/props on server or client?
--- Mechanic Action Menu
Config.ActionMenu = {
Enable = true, -- set to false to disable mechanic action menu
Command = {enable = true, name = "mechanic"}, -- enable/disable command, set command string.
Keybind = {enable = true, defaultMapping = "F6", description = "Open Mechanic Action Menu"} -- enable/disable keybind, set default mapping (players edit button in-game inside GTA Settings)
}
--- Car Lifts settings
Config.CarLift = {
Model = {
base = `t1ger_carlift_base`, -- model for carlift base
arm = `t1ger_carlift_arms`, -- model for carlift arm
},
Command = "createlift", -- command to create a carlift
Icons = { -- icons for target options on carlift
["up"] = "fa-sharp fa-solid fa-arrow-up",
["down"] = "fa-sharp fa-solid fa-arrow-down",
["stop"] = "fa-regular fa-circle-stop",
["delete"] = "fa-solid fa-ban"
}
}
--- Car Jack
Config.CarJack = {
Item = "t1ger_carjack",
Marker = {type = 27, scale = vector3{0.35, 0.35, 0.35}, color = {r = 200, g = 100, b = 200, a = 100}},
Prop = {model = "imp_prop_car_jack_01a", pos = vector3(-0.40, -1.4, -0.8), rot = vector3(5.0, 0.0, -180.0), boneId = 28422},
Keybind = 38, -- Default [E] | Attaches carjack prop to vehicle
Icons = {
target = { -- target icons
remove = "fa-solid fa-trash",
handle = "fa-solid fa-gamepad"
},
menu = {
raise = "arrow-up",
lower = "arrow-down"
}
},
AllowEveryone = false, -- allow everyone with carjack to use on a vehicle?
}
--- Default random values when generating data for unowned vehicles (e.g. NPC vehicles, rental cars, etc.)
Config.RandomVehicleDefaults = {
MileageRange = {5000, 200000}, -- Min and max total vehicle mileage (in km or mi)
ServicePartRange = {0.0, 0.9}, -- Min and max percentage of the part's service interval used. Example: 0.9 = 90% of interval used. Values over 1.0 are allowed (e.g., 1.1 = 10% overdue).
CorePartHealthRange = {65, 100}, -- Min and max health (0100%) of core parts. Values outside 0-100 will be clamped safely.
}
--- Mileage settings
Config.Mileage = {-- 1:1 Real-World Mileage Tracking! There could be a maximum of 5% difference.
Metric = true, -- true is kilometers and false is miles
Unit = 'KM', -- or 'KM' or 'Mi' or whatever
Command = {enable = true, name = "mileage"}, -- enable command to view vehicle mileage?
}
--- Associated wear on core parts for service parts that are overdue
Config.AssociatedWear = { -- This simulates real-world mechanical wear caused by neglected maintenance on service parts.
Enabled = true, -- Enable or disable associated core part degradation
Rate = 0.5 -- % of health lost per second (1000 ms) for each affected core part
}
--- Malfunction Effects Settings
Config.MalfunctionEffects = {
Enabled = true, -- Enable or disable malfunction effects caused by degraded core parts.
Interval = 60, -- Delay between each malfunction effect in thread ticks (1 tick = 1 second). For example, 30 means one malfunction effect every 30 seconds (if any degraded core parts exist).
Notify = true, -- notify with part label and condition when malfunction effects plays?
}
--- Multiplier for service intervals by vehicle class. Lower = more frequent maintenance, higher = less frequent.
--- Applied to Config.ServiceParts[<partName>].interval based on the vehicle's class.
Config.ServiceIntervalMultipliers = {
[0] = 1.4, -- Compacts: lightweight, low-stress vehicles
[1] = 1.2, -- Sedans: everyday use, moderate wear
[2] = 1.0, -- SUVs: heavier, average wear
[3] = 1.1, -- Coupes: generally better maintained, moderate wear
[4] = 0.8, -- Muscle: powerful engines, driven hard = faster wear
[5] = 0.7, -- Sports Classics: older tech, higher maintenance needs
[6] = 0.85, -- Sports: performance use, more wear than average
[7] = 0.75, -- Super: high-performance, demanding servicing
[8] = 1.3, -- Motorcycles: light use but exposed components
[9] = 0.6, -- Off-road: harsh terrain = rapid degradation
[10] = 0.5, -- Industrial: heavy loads, constant strain
[11] = 0.6, -- Utility: work vehicles, rugged use
[12] = 0.9, -- Vans: often used commercially, moderate wear
[17] = 0.6, -- Service: fleet use, high uptime
[18] = 0.5, -- Emergency: aggressive use, high stress
[19] = 0.4, -- Military: off-road, rugged, heavy-duty
[20] = 0.5, -- Commercial: delivery/freight, long hours
[22] = 0.3 -- Open Wheel: race use, extreme servicing needs
}
--- Blacklist certain vehicle models from being tracked regarding degradation of parts on overdue and collisions
Config.BlacklistTracking = {
"mesa3",
"nightshark"
}
--- Disable Automatic Engine Start
Config.DisableAutoEngineStart = true -- If true, disables GTA's automatic engine start behavior when entering a vehicle.
--- Part Conditions
Config.PartConditions = {
-- Condition percent for service parts (based on used mileage compared with interval)
service_parts = {
{percent = 16, label = locale("menu_title.service_ok")}, -- The part has 16% or more of its service interval remaining.
{percent = 0, label = locale("menu_title.service_due")}, -- The part has between 0% and 15% of its service interval remaining. A service is recommended soon.
{percent = -math.huge, label = locale("menu_title.service_overdue")} -- The part has exceeded its service interval (negative remaining mileage), posing a risk of core part damage.
},
-- Condition percent for core parts (based on health)
core_parts = {
{percent = 51, label = locale("menu_title.part_optimal")}, -- No malfunctions. The part is in good condition, and the vehicle operates normally.
{percent = 21, label = locale("menu_title.part_worn")}, -- Minor malfunctions occur occasionally. Players will begin noticing small issues.
{percent = 1, label = locale("menu_title.part_critical")}, -- Frequent and sustained malfunctions. Players will experience major performance issues.
{percent = 0, label = locale("menu_title.part_failed")} -- The part has failed completely, causing constant effects or rendering the vehicle undriveable.
}
}
--- Vehicle Collision Settings
Config.VehicleCollision = {
Enable = true, -- Enable or disable collision-based part degradation
MinImpactSpeed = 40, -- Minimum vehicle speed (in KMH or MPH based on Config.Mileage) required for collision to cause degradation
CooldownTime = 5000, -- Cooldown (in milliseconds) between consecutive degradable collisions to avoid rapid triggering
PartCount = 2, -- How many core parts to degrade per collision
MinPercent = 5, -- Minimum % degradation per part
MaxPercent = 15 -- Maximum % degradation per part
}
--- Define Electric Vehicles
Config.ElectricVehicles = { -- if using gamebuild 3258+ then script will auto detect electric vehicles a using native
"surge",
"buffalo5",
"caddy",
"caddy2",
"caddy3",
"cyclone",
"dilettante",
"dilettante2",
"iwagen",
"imorgen",
"khamelion",
"neon",
"omnisegt",
"raiden",
"tezeract",
"voltic",
"voltic2",
"virtue"
}
--- Admin Vehicle Reapir
Config.AdminRepair = {
Enable = true, -- set to false to disable this command
Command = "fix", -- command name to quick fix a vehicle
Parts = true, -- repair core_parts and service_parts?
Refuel = true -- set to fuel to 100.0?
}
--- Repair Kits
Config.RepairKits = {
Skillcheck = {enable = true, difficulty = {"easy", "easy", "easy"}, inputs = {"w", "a", "s", "d"}}, -- skillcheck settings
Duration = 3000,
Types = {
-- basic repair kit
basic = {
item = "t1ger_repairkit",
engineHealth = 600.0, -- minimum health after repair (clamped 250.01000.0)
repairBody = false, -- repair body health?
},
-- advanced repair kit
advanced = {
item = "t1ger_repairkit_adv",
engineHealth = 1000.0, -- value to set the engine health to?
repairBody = true, -- repair body health?
mechanicOnly = false, -- only allow mechanics to use?
whitelitedJobs = {"police", "ems", "police2"}, -- always allow these jobs to use this kit. Set to nil or {} to ignore.
}
}
}
--- Patch Kit Configuration
Config.PatchKit = {
Item = "t1ger_patchkit", -- Item name required to use a patch kit
CorePartHealth = 5.0, -- Sets all failed core parts' health to this value. (Clamped between 1% and 100%)
ServicePartRemainingMileage = 10.0, -- if overdue, it reset the mileage to 10.0 km/mi before overdue
Skillcheck = {enable = true, difficulty = {"easy", "easy", "easy"}, inputs = {"w", "a", "s", "d"}}, -- skillcheck settings
Duration = 4000, -- Repair duration in miliseconds (MS)
}
--- Components (Service- and Core-Parts) related interactions
Config.Components = {
Repair = {
targetIcon = "fa-solid fa-hammer", -- icon for target when installing parts
skillcheck = {enable = true, difficulty = {"easy", "easy", "easy"}, inputs = {"w", "a", "s", "d"}}, -- enable skillcheck before installing part?
duration = 3000, -- Repair/replace duration in miliseconds (MS)
cancelCommand = {enable = true, name = "component:cancel"},
allowEveryone = false, -- allows everyone to use component items.
-- setting to return salvaged materials on part replacement
materialReturn = {
enable = true, -- Enable or disable material return
scaleWithCondition = true, -- If true: scale based on condition, if false: random between min/max
minAmount = 0, -- Random minimum (only if scaleWithCondition = false)
maxAmount = 5, -- Random maximum (but clamped to recipe material count requirement)
notify = true, -- Send notification of salvaged/returned materials?
}
},
Diagnostic = {
item = "t1ger_diagnostictool",
duration = 15000, -- duration to diagnose in miliseconds (MS)
icons = { -- menu icons for system overview, core parts and service parts
system_overview = "fa-tachometer-alt",
core_parts = "https://i.postimg.cc/X7GXytsj/t1ger-brakes.png",
service_parts = "https://i.postimg.cc/bNBb7QBJ/t1ger-oilfilter.png",
start_workflow = "fa-screwdriver-wrench",
},
command = {enable = true, name = "diagnose"},
allowEveryone = false, -- allows everyone to diagnose vehicle by command or item
systemOverview = {
enable = true, -- display system overview in diagnostic tool menu?
options = { -- options to show
engineHealth = {enable = true, label = locale("menu_metadata.diagnostic_engine_health"), icon = "kit-medical", symbol = "%"},
bodyHealth = {enable = true, label = locale("menu_metadata.diagnostic_body_health"), icon = "car", symbol = "%"},
tankHealth = {enable = true, label = locale("menu_metadata.diagnostic_tank_health"), icon = "gas-pump", symbol = "%"},
fuelLevel = {enable = true, label = locale("menu_metadata.diagnostic_fuel_level"), icon = "gauge", symbol = "%"},
dirtLevel = {enable = true, label = locale("menu_metadata.diagnostic_dirt_level"), icon = "shower", symbol = "%"},
oilLevel = {enable = true, label = locale("menu_metadata.diagnostic_oil_level"), icon = "oil-can", symbol = "L"},
engineTemp = {enable = true, label = locale("menu_metadata.diagnostic_engine_temp"), icon = "temperature-high", symbol = "°C"},
mileage = {enable = true, label = locale("menu_metadata.diagnostic_mileage"), icon = "road", symbol = " "..Config.Mileage.Unit},
plate = {enable = true, label = locale("menu_metadata.diagnostic_plate"), icon = "id-card", symbol = ""}
}
}
},
WorkflowTitle = "Workflow - %s", -- workflow title followed by plate
WorkflowName = "<strong>%s</strong>" -- work flow (body part label)
}
--- Service History
Config.ServiceHistory = {
Item = "t1ger_servicebook",
Command = {enable = true, name = "servicebook"}
}
--- Body Repair and Inspection
Config.BodyRepair = {
TargetIcon = "fa-solid fa-car", -- icon for target when installing parts
Skillcheck = {enable = true, difficulty = {"easy", "easy", "easy"}, inputs = {"w", "a", "s", "d"}}, -- enable skillcheck before installing part?
Duration = 3000, -- Repair/replace duration in miliseconds (MS)
AllowEveryoneForWheelRepair = false, -- allow everyone to use wheel to fix damaged wheels?
AllowEveryoneToRepair = false, -- allows everyone to use body part items to fix body. Overrides AllowEveryoneForWheelRepair
FixEngineHealth = true, -- sets engine health to 1000.0 once body repair is completed?
Inspect = { -- Inspect vehicle to get damage report and trigger workflow UI
diagnosticTool = true, -- allow inspection by using diagnostic tool when not inside or at engine?
command = {enable = true, name = "inspect:start"}, -- command to trigger inspection of body? command name
target = {enable = true, icon = "fa-solid fa-car", ownedVehiclesOnly = false}, -- target to trigger inspection of body? icon for target option
marker = {type = 20, scale = {x = 0.35, y = 0.35, z = 0.35}, color = {r = 217, g = 164, b = 61, a = 100}}, -- marker settings
textUI = {
icon = "magnifying-glass", -- textUI icon
position = "right-center", -- textUI position
style = {borderRadius = 0, backgroundColor = "#d9a43dcc", color = "white"} -- textUI style/css
},
keybind = 38, -- [E]
duration = 2000, -- duration in MS for each inspection point
cancel = {command = "inspect:cancel"}
},
CancelCommand = "body:cancel", -- command to cancel body part installation
WorkflowTitle = "Workflow - %s", -- workflow title followed by plate
WorkflowName = "<strong>%s</strong>" -- work flow (body part label)
}
--- Workflow UI
Config.WorkflowUI = {
Commands = {
open = "workflow:open",
close = "workflow:close",
cursor = "workflow:cursor",
clear = "workflow:clear"
},
CursorKeybind = {
description = "Toggle Workflow UI Cursor",
defaultKey = "J"
},
DefaultTitle = "Workflow UI", -- default workflow UI title (if u open with no data set)
}
--- Static / NPC repair stations
Config.RepairStations = {
Blip = {name = "Repair Station", sprite = 402, color = 7, scale = 1.0}, -- blip settings
Marker = {type = 20, scale = {x = 0.35, y = 0.35, z = 0.35}, color = {r = 162, g = 31, b = 224, a = 100}}, -- draw marker settings
Keybind = 38, -- Default [E] keybind
TextUi = {
icon = "wrench", -- textUi icon
position = "right-center", -- textUi position
style = {borderRadius = 0, backgroundColor = "#a21fe080", color = "white"} -- textUi style/css
},
Repairs = { -- allowed repairs
engine = {enable = true, value = 1000.0, duration = 2000, price = 1500, icon = "gauge-high"}, -- allow engine repair? Fixed engine health value?
body = {enable = true, value = 1000.0, duration = 3000, price = 1000, icon = "car-side"}, -- allow body repair? Fixed body health value?
core_parts = {enable = true, value = 100.0, duration = 4000, price = 2500, icon = "tools"}, -- allow core_parts repair? Fixed parts value (min = 0.0, max = 100.0)
service_parts = {enable = true, value = 0, duration = 5000, price = 3000, icon = "wrench"} -- allow service_parts mileage set? Reset mileage on service parts to value greater than 0.
},
Mode = "individual", -- "full" or "individual". Individual, select repair types in menu. Full repairs all enabled repair types above.
FullRepairIcon = "wrench", -- icon in menu for full repair
FullRepairDuration = 10000, -- repair duration if mode is set to "full"
FullRepairPrice = 8000, -- repair price if mode is set to "full"
RestrictWithOnlineMechanics = true, -- if true players cannot use repair station if mechanics are online
AllowIfMechanicCountBelow = 3, -- allow repair station usage if fewer than 3 mechanics online
RestrictOnWhitelistedStations = false, -- if false ignore online mechanics on repair stations with jobs defined. If true it checks for online count.
Locations = { -- repair locations. Coords for the point. Set jobs = nil to allow everyone. Enable/disable blip. Add free = true to allow free repairs.
[1] = {coords = vector3(433.62, -1018.28, 28.84), jobs = {"police", "police2"}, blip = true, free = true},
[2] = {coords = vector3(344.39, -553.79, 28.74), jobs = {"ambulance", "ems"}, blip = true, free = true},
[3] = {coords = vector3(548.18, -206.17, 54.15), jobs = nil, blip = true},
}
}
--- Flatbed Towing
Config.FlatbedTowing = {
Enable = true, -- set to false to disable
Command = "tow", -- command to use tow feature
ActionMenu = {enable = true, icon = "anchor"}, -- enable from action menu? icon for menu option
Trucks = { -- supported trucks index by modelname.
["flatbed"] = {offset = vector3(0.0, -2.0, 0.8), boneName = "bodyshell"},
-- add more
},
Blacklisted = {"flatbed", "towtruck", "cargobob"}, -- vehicles that cannot be attached to flatbed
Marker = {type = 20, scale = {x = 0.50, y = 0.50, z = 0.50}, color = {r = 240, g = 52, b = 52, a = 100}},
Keybind = 47, -- default G | Attach or detach vehicle from flatbed/towtruck
}
--- Push Vehicle
Config.PushVehicle = {
Enable = true, -- set to false to disable
Command = {enable = true, name = "pushvehicle"}, -- enable command to push vehicle?
ActionMenu = {enable = true, icon = "hand"}, -- enable from action menu? icon for menu option
AllowEveryone = false, -- if false only mechanics can push, else everyone can push
DrawDist = 4.0, -- istance to draw 3d text
PushKey = 21, -- DEFAULT KEY: [LEFT SHIFT]
StopKey = 177, -- DEFAULT KEY: [BACKSPACE]
LeftKey = 34, -- DEFAULT KEY: [A]
RightKey = 35, -- DEFAULT KEY: [D]
}
--- Flip Vehicle
Config.FlipVehicle = {
Enable = true, -- set to false to disable
Command = {enable = true, name = "flipvehicle"}, -- enable command to unlock vehicle?
ActionMenu = {enable = true, icon = "turn-up"}, -- enable from action menu? icon for menu option
DrawDist = 4.0, -- istance to draw 3d text
Keybind = 38, -- DEFAULT KEY: [E]
Scenario = "CODE_HUMAN_MEDIC_TEND_TO_DEAD",
Duration = 3000 -- progbar duration
}
--- Unlock Vehicle
Config.UnlockVehicle = {
Enable = true, -- set to false to disable
Command = {enable = true, name = "unlockvehicle"}, -- enable command to unlock vehicle?
ActionMenu = {enable = true, icon = "unlock"}, -- enable from action menu? icon for menu option
DrawDist = 4.0, -- istance to draw 3d text
Keybind = 38, -- DEFAULT KEY: [E]
Anim = {dict = "anim@amb@clubhouse@tutorial@bkr_tut_ig3@", clip = "machinic_loop_mechandplayer", blendIn = 3.0, blendOut = 3.0, flag = 31},
Duration = 3000 -- progbar duration
}
--- Impound Vehicle
Config.ImpoundVehicle = {
Enable = true, -- set to false to disable
Command = {enable = true, str = "impoundvehicle"}, -- enable command to unlock vehicle?
ActionMenu = {enable = true, icon = "square-parking"}, -- enable from action menu? icon for menu option
DrawDist = 4.0, -- istance to draw 3d text
Keybind = 38, -- DEFAULT KEY: [E]
Scenario = "CODE_HUMAN_MEDIC_TEND_TO_DEAD",
Duration = 3000 -- progbar duration
}
--- Prop Emotes
Config.Emotes = {
Keybind = 38, -- keybind to place prop,
Distance = 2.0, -- distance to interact with prop
Icons = { -- icons for taget
remove = "fa-solid fa-trash", -- remove icon
attach = "fa-solid fa-hand" -- attach (carry/push) icon
},
Anim = {
['push'] = {dict = 'anim@heists@box_carry@', clip = 'idle', blendIn = 4.0, blendOut = 1.0, duration = -1, flags = 49},
['pickup'] = {dict = 'random@domestic', clip = 'pickup_low', blendIn = 5.0, blendOut = 3.0, duration = -1, flags = 48}
},
Props = {
['-1036807324'] = {label = 'Road Cone', item = "t1ger_roadcone", model = 'prop_roadcone02a', bone = 28422, pos = {0.6,-0.15,-0.1}, rot = {315.0,288.0,0.0}},
['-1776497660'] = {label = 'Tools Trolley', item = "t1ger_toolstrolley", model = 'prop_cs_trolley_01', push = true, bone = 28422, pos = {-0.1,-0.6,-0.85}, rot = {-180.0,-165.0,90.0}},
['-1972842851'] = {label = 'Tool Box', item = "t1ger_toolbox", model = 'prop_tool_box_04', bone = 28422, pos = {0.4,-0.1,-0.1}, rot = {315.0,288.0,0.0}},
['-2146714905'] = {label = 'Con Sign', item = "t1ger_consign", model = 'prop_consign_02a', push = true, bone = 28422, pos = {0.0,0.2,-1.05}, rot = {-195.0,-180.0,180.0}},
['-205311355'] = {label = 'Road Barrier', item = "t1ger_roadbarrier", model = 'prop_mp_barrier_02b', push = true, bone = 28422, pos = {0.0,0.2,-1.05}, rot = {-195.0,-180.0,180.0}}
}
}
--- Mechanic NPC Missions / Jobs
Config.Missions = {
Enable = true, -- set to false to disable built in mechanic missions/jobs
Command = {enable = true, name = "missions"}, -- enable command to open missions menu?
ActionMenu = {enable = true, icon = "comment-dots"}, -- enable from action menu? icon for menu option
CancelIcon = "ban", -- icon menu to cancel job?
UseAdvancedNotify = true, -- set to false to use standard notification (in case u have HUD blocking etc.)
PayToSociety = false, -- pay mission rewards to society account?
Types = {
breakdown = {
enable = true, -- enable mission type
icon = "truck-pickup", -- icon in menu
travelDistance = 1000.0, -- minimum travel distance from players coords to the "fetched" mission location.
blip = {label = "Breakdown Mission", sprite = 1, color = 5, scale = 0.7, route = {enable = true, color = 5}}, -- blip settings
},
roadsiderepair = {
enable = true, -- enable mission type
icon = "screwdriver-wrench", -- icon in menu
travelDistance = 1000.0, -- minimum travel distance from players coords to the "fetched" mission location.
blip = {label = "Roadside Repair Mission", sprite = 1, color = 5, scale = 0.7, route = {enable = true, color = 5}}, -- blip settings
types = {
fuel = {enable = true, subtitle = "Out of Fuel", item = "t1ger_fuelcan"}, -- enable/disable fuel repair type, subtitle for notify and set required item
battery = {enable = true, subtitle = "Battery Failure", item = "t1ger_jumpstarter"}, -- enable/disable battery repair type subtitle for notify and set required item
tire = {enable = true, subtitle = "Flat Tire", item = "t1ger_repairkit_tire"} -- enable/disable tyre repair type subtitle for notify and set required item
},
duration = 5000, -- time in ms for anim duration
},
carscrapping = {
enable = true, -- enable mission type
icon = "recycle", -- icon in menu
travelDistance = 1000.0, -- minimum travel distance from players coords to the "fetched" mission location.
blip = {label = "Car Scrapping Mission", sprite = 1, color = 5, scale = 0.7, route = {enable = true, color = 5}}, -- blip settings
scrapyard = {
ped = {
model = "s_m_y_xmech_02_mp", -- scrapyard ped model
coords = vector4(-465.77,-1707.58,18.8,252.19), -- scrapyard ped coords
},
dropoff = vector3(-457.29,-1713.84,18.64), -- vehicle drop off coords
inspect = vector4(-459.98,-1712.81,18.67,240.04), -- inspect pos and heading
scenarios = {
idle = "WORLD_HUMAN_AA_SMOKE", -- ped idle scenario
inspect = "WORLD_HUMAN_CLIPBOARD" -- ped inspect scenario
}
},
reward = {
count = 4, -- how many types of random materials to receive, like alu, steel etc.
amount = {min = 1, max = 5} -- of selected material, how many to receive randomly from min-max
}
}
},
NotifyIcon = "CHAR_MP_MECHANIC", -- advanced notification icon
RandomPeds = {"s_m_y_dealer_01", "a_m_m_indian_01", "a_m_m_polynesian_01", "a_m_m_prolhost_01", "a_m_m_socenlat_01"}, -- randomized ped models used for the NPC missions
RandomVehicles = {"sultan", "blista", "glendale", "exemplar"}, -- randomized vehicle models used for the NPC missions
Locations = require("shared/missions") -- Load locations from the shared/missions.lua file index by mission type. DO NOT TOUCH!
}local locations = {}
locations["breakdown"] = {
[1] = {
pos = vector4(932.04, -62.5, 78.76, 85.98), -- npc vehicle spawn coords
inUse = false, -- do not touch
pedCoords = vector4(931.58, -59.92, 78.76, 135.83), -- npc ped spawn coords and model
dropoff = vector3(-366.25, -124.89, 38.7), -- vehicle dropoff location
payout = { min = 250, max = 400 } -- payout cash minimum amount and maximum amount
},
[2] = {
pos = vector4(99.43, 247.17, 108.19, 66.33), -- npc vehicle spawn coords
inUse = false, -- do not touch
pedCoords = vector4(97.83, 250.58, 108.38, 177.98), -- npc ped spawn coords and model
dropoff = vector3(-218.37,-1296.19,31.3), -- vehicle dropoff location
payout = { min = 250, max = 400 } -- payout cash minimum amount and maximum amount
},
[3] = {
pos = vector4(167.33, -1460.1, 29.14, 138.45), -- npc vehicle spawn coords
inUse = false, -- do not touch
pedCoords = vector4(171.92, -1458.62, 29.24, 126.2), -- npc ped spawn coords and model
dropoff = vector3(716.32, -1080.13, 22.28), -- vehicle dropoff location
payout = { min = 250, max = 400 } -- payout cash minimum amount and maximum amount
},
-- add more locations
}
locations["roadsiderepair"] = {
[1] = {pos = vector4(880.16, -34.66, 78.75, 240.94), inUse = false, payout = {min = 250, max = 400}},
[2] = {pos = vector4(1492.09, 758.45, 77.45, 288.26), inUse = false, payout = {min = 250, max = 400}},
[3] = {pos = vector4(387.67, -767.56, 29.29, 358.94), inUse = false, payout = {min = 250, max = 400}},
[4] = {pos = vector4(-583.75, -239.55, 36.08, 33.14), inUse = false, payout = {min = 250, max = 400}},
[5] = {pos = vector4(350.12, 345.60, 105.15, 73.70), inUse = false, payout = {min = 250, max = 400}},
[6] = {pos = vector4(106.11, 317.55, 112.13, 340.15), inUse = false, payout = {min = 250, max = 400}},
[7] = {pos = vector4(-250.24, 292.83, 91.79, 85.03), inUse = false, payout = {min = 250, max = 400}},
[8] = {pos = vector4(-1325.35, 275.32, 63.41, 215.43), inUse = false, payout = {min = 250, max = 400}},
[9] = {pos = vector4(-1622.20, -237.69, 53.93, 158.74), inUse = false, payout = {min = 250, max = 400}},
[10] = {pos = vector4(-1273.45, -1010.42, 9.34, 195.59), inUse = false, payout = {min = 250, max = 400}},
}
locations["carscrapping"] = {
[1] = {pos = vector4(-367.42, -1521.98, 26.72, 174.32), inUse = false},
[2] = {pos = vector4(-12.45, -1799.43, 26.4, 317.32), inUse = false},
[3] = {pos = vector4(587.51, -1791.45, 21.08, 172.84), inUse = false},
[4] = {pos = vector4(1043.62, -2130.04, 31.74, 262.95), inUse = false},
[5] = {pos = vector4(1160.78, -1651.02, 35.92, 203.69), inUse = false},
[6] = {pos = vector4(1118.26, -975.1, 45.49, 8.07), inUse = false},
[7] = {pos = vector4(1100.01, -332.12, 66.21, 124.12), inUse = false},
[8] = {pos = vector4(700.74, 254.74, 92.31, 237.35), inUse = false},
[9] = {pos = vector4(177.77, 380.25, 108.03, 356.36), inUse = false},
[10] = {pos = vector4(-1155.14, -228.36, 36.9, 314.13), inUse = false},
[11] = {pos = vector4(320.33, -2034.69, 20.17, -38.61), inUse = false},
[12] = {pos = vector4(-520.84, 574.89, 120.56, -78.21), inUse = false},
[13] = {pos = vector4(-1452.84, -51.61, 52.75, 73.59), inUse = false},
[14] = {pos = vector4(361.42, -2474.03, 5.90, -91.64), inUse = false},
[15] = {pos = vector4(815.73, -2144.15, 28.81, -172.18), inUse = false},
[16] = {pos = vector4(1300.98, -1736.43, 53.38, -159.24), inUse = false},
[17] = {pos = vector4(1260.82, -1739.77, 49.13, 116.28), inUse = false},
[18] = {pos = vector4(1228.02, -1606.06, 51.18, 35.05), inUse = false},
[19] = {pos = vector4(1201.94, -1387.29, 34.72, 19.94), inUse = false},
[20] = {pos = vector4(-1106.47, 791.78, 164.17, 13.24), inUse = false},
[21] = {pos = vector4(-683.99, 602.62, 143.10, -31.46), inUse = false},
[22] = {pos = vector4(318.58, 495.42, 152.24, -72.93), inUse = false},
[23] = {pos = vector4(-2165.52, -277.60, 12.22, 157.83), inUse = false},
[24] = {pos = vector4(-1539.14, -1004.59, 12.51, -104.60), inUse = false},
[25] = {pos = vector4(-996.22, -1262.95, 5.27, -61.32), inUse = false},
[26] = {pos = vector4(-135.45, -1971.81, 22.30, -61.32), inUse = false},
[27] = {pos = vector4(-177.49, -2022.95, 27.12, -106.34), inUse = false},
[28] = {pos = vector4(-3044.68, 112.43, 11.21, 138.63), inUse = false},
[29] = {pos = vector4(1364.97, -2065.10, 51.49, 117.16), inUse = false},
[30] = {pos = vector4(-1104.28, -1953.91, 12.65, 132.38), inUse = false}
}
return locationsConfig.BodyParts = {
door = {
item = "t1ger_vehicledoor",
label = "Vehicle Door",
icon = "https://i.postimg.cc/hvHDrP2S/t1ger-vehicledoor.png",
prop = {model = "imp_prop_impexp_car_door_04a", pos = vector3(-0.7, -0.2, 0.0), rot = vector3(0.0, -10.0, 90.0), boneId = 28422},
anim = {dict = "anim@amb@clubhouse@tutorial@bkr_tut_ig3@", clip = "machinic_loop_mechandplayer", duration = -1, blendIn = 2.0, blendOut = 2.0, flag = 1}
},
hood = {
item = "t1ger_vehiclehood",
label = "Vehicle Hood",
icon = "https://i.postimg.cc/5yH9LFq7/t1ger-vehiclehood.png",
prop = {model = "imp_prop_impexp_bonnet_04a", pos = vector3(0.0, 0.20, 0.12), rot = vector3(-20.0, 0.0, 180.0), boneId = 28422},
anim = {dict = "mini@repair", clip = "fixing_a_player", duration = -1, blendIn = 2.0, blendOut = 2.0, flag = 1}
},
trunk = {
item = "t1ger_vehicletrunk",
label = "Vehicle Trunk",
icon = "https://i.postimg.cc/WpK1jXTQ/t1ger-vehicletrunk.png",
prop = {model = "imp_prop_impexp_trunk_01a", pos = vector3(0.0, 0.15, 0.1), rot = vector3(30.0, 0.0, 0.0), boneId = 28422},
anim = {dict = "mini@repair", clip = "fixing_a_player", duration = -1, blendIn = 2.0, blendOut = 2.0, flag = 1}
},
wheel = {
item = "t1ger_vehiclewheel",
label = "Vehicle Wheel",
icon = "https://i.postimg.cc/15q5zwz4/t1ger-vehiclewheel.png",
prop = {model = "imp_prop_impexp_tyre_01c", pos = vector3(0.0, -0.1, 0.2), rot = vector3(0.0, 0.0, 0.0), boneId = 28422},
anim = {dict = "anim@amb@clubhouse@tutorial@bkr_tut_ig3@", clip = "machinic_loop_mechandplayer", duration = -1, blendIn = 2.0, blendOut = 2.0, flag = 1}
},
window = {
item = "t1ger_vehiclewindow",
label = "Vehicle Window",
icon = "https://i.postimg.cc/pLMV5r9C/t1ger-vehiclewindow.png",
prop = {model = "h4_prop_yacht_glass_04", pos = vector3(0.0, -0.1, 0.3), rot = vector3(0.0, 0.0, 0.0), boneId = 28422},
anim = {dict = "missmechanic", clip = "work_in", duration = -1, blendIn = 2.0, blendOut = 2.0, flag = 1}
},
}
Config.ServiceParts = {
air_filter = {
item = "t1ger_airfilter",
label = "Air Filter",
icon = "https://i.postimg.cc/hj1T66kW/t1ger-airfilter.png",
interval = 8000,
associated = {"fuel_injector"},
type = "gas",
prop = {model = "t1ger_airfilter", pos = vector3(0.0, 0.0, 0.0), rot = vector3(0.0, 120.0, 0.0), boneId = 60309},
},
battery_coolant = {
item = "t1ger_batterycoolant",
label = "Battery Coolant",
icon = "https://i.postimg.cc/26DnHrX7/t1ger-batterycoolant.png",
interval = 20000,
associated = {"ev_battery"},
type = "electric",
prop = {model = "t1ger_batterycoolant", pos = vector3(0.0, 0.0, -0.1), rot = vector3(0.0, 0.0, 25.0), boneId = 28422, small = true},
},
brake_fluid = {
item = "t1ger_brakefluid",
label = "Brake Fluid",
icon = "https://i.postimg.cc/jjNzQLvj/t1ger-brakefluid.png",
interval = 15000,
associated = {"brakes"},
type = "shared",
prop = {model = "t1ger_brakefluid", pos = vector3(-0.03, 0.03, 0.0), rot = vector3(-90.0, -40.0, -150.0), boneId = 60309},
},
brake_pad = {
item = "t1ger_brakepad",
label = "Brake Pads",
icon = "https://i.postimg.cc/jSBH7zH9/t1ger-brakepad.png",
interval = 10000,
associated = {"brakes"},
type = "gas",
prop = {model = "t1ger_brakepad", pos = vector3(0.0, 0.0, 0.0), rot = vector3(-40.0, 0.0, 0.0), boneId = 60309},
},
coolant = {
item = "t1ger_coolant",
label = "Coolant",
icon = "https://i.postimg.cc/Y02YH874/t1ger-coolant.png",
interval = 15000,
associated = {"radiator"},
type = "gas",
prop = {model = "t1ger_coolant", pos = vector3(0.0, 0.0, -0.1), rot = vector3(0.0, 0.0, 25.0), boneId = 28422, small = true},
},
drive_belt = {
item = "t1ger_drivebelt",
label = "Drive Belt",
icon = "https://i.postimg.cc/bYL1TX01/t1ger-drivebelt.png",
interval = 20000,
associated = {"alternator", "radiator"},
type = "gas",
prop = {model = "t1ger_drivebelt", pos = vector3(0.0, 0.0, 0.0), rot = vector3(0.0, 0.0, 0.0), boneId = 60309},
},
fuel_filter = {
item = "t1ger_fuelfilter",
label = "Fuel Filter",
icon = "https://i.postimg.cc/3NLpJprt/t1ger-fuelfilter.png",
interval = 12000,
associated = {"fuel_injector"},
type = "gas",
prop = {model = "t1ger_fuelfilter", pos = vector3(0.0, 0.0, 0.0), rot = vector3(0.0, 120.0, 0.0), boneId = 60309},
},
hv_wiring = {
item = "t1ger_hvwiring",
label = "High-Voltage Wiring",
icon = "https://i.postimg.cc/g09hJGdb/t1ger-hvwiring.png",
interval = 25000,
associated = {"electric_motor"},
type = "electric",
prop = {model = "t1ger_hvwiring", pos = vector3(0.0, 0.0, 0.0), rot = vector3(90.0, 0.0, 0.0), boneId = 60309},
},
oil_filter = {
item = "t1ger_oilfilter",
label = "Oil + Filter",
icon = "https://i.postimg.cc/bNBb7QBJ/t1ger-oilfilter.png",
interval = 5000,
associated = {"fuel_injector", "transmission"},
type = "gas",
prop = {model = "t1ger_oilfilter", pos = vector3(0.0, 0.0, 0.0), rot = vector3(90.0, 0.0, 0.0), boneId = 60309},
},
spark_plugs = {
item = "t1ger_sparkplugs",
label = "Spark Plugs",
icon = "https://i.postimg.cc/NfMmCNbS/t1ger-sparkplugs.png",
interval = 15000,
associated = {"fuel_injector"},
type = "gas",
prop = {model = "t1ger_sparkplugs", pos = vector3(-0.03, 0.0, 0.0), rot = vector3(0.0, 120.0, 0.0), boneId = 60309},
},
steering_fluid = {
item = "t1ger_steeringfluid",
label = "Power Steering Fluid",
icon = "https://i.postimg.cc/rwRWMKB9/t1ger-steeringfluid.png",
interval = 20000,
associated = {"power_steering_pump"},
type = "gas",
prop = {model = "t1ger_steeringfluid", pos = vector3(-0.03, 0.03, 0.0), rot = vector3(-90.0, -40.0, -150.0), boneId = 60309},
},
tires = {
item = "t1ger_tires",
label = "Tires",
icon = "https://i.postimg.cc/BvxKPRQL/t1ger-tires.png",
interval = 50000,
associated = {},
type = "shared",
prop = {model = "t1ger_tires", pos = vector3(0.0, -0.05, 0.0), rot = vector3(0.0, -90.0, -90.0), boneId = 28422},
},
transmission_fluid = {
item = "t1ger_transmissionfluid",
label = "Transmission Fluid",
icon = "https://i.postimg.cc/4dsh6wm8/t1ger-transmissionfluid.png",
interval = 25000,
associated = {"transmission"},
type = "gas",
prop = {model = "t1ger_transmissionfluid", pos = vector3(-0.03, 0.03, 0.0), rot = vector3(-90.0, -40.0, -150.0), boneId = 60309},
},
}
Config.CoreParts = {
alternator = {
item = "t1ger_alternator",
label = "Alternator",
icon = "https://i.postimg.cc/CM6z5wHr/t1ger-alternator.png",
associated = {"drive_belt"},
type = "gas",
prop = {model = "t1ger_alternator", pos = vector3(0.0, 0.0, 0.0), rot = vector3(90.0, 120.0, 0.0), boneId = 60309},
},
brakes = {
item = "t1ger_brakes",
label = "Brakes",
icon = "https://i.postimg.cc/X7GXytsj/t1ger-brakes.png",
associated = {"brake_fluid", "brake_pads"},
type = "shared",
prop = {model = "t1ger_brakes", pos = vector3(0.0, 0.0, 0.0), rot = vector3(0.0, 0.0, -90.0), boneId = 60309},
},
electric_motor = {
item = "t1ger_electricmotor",
label = "Electric Motor",
icon = "https://i.postimg.cc/J0gn2QzC/t1ger-electricmotor.png",
associated = {"hv_wiring"},
type = "electric",
prop = {model = "t1ger_electricmotor", pos = vector3(0.0, 0.0, -0.1), rot = vector3(90.0, 0.0, 0.0), boneId = 60309},
},
ev_battery = {
item = "t1ger_evbattery",
label = "EV Battery",
icon = "https://i.postimg.cc/ZKGnPjQr/t1ger-evbattery.png",
associated = {"battery_coolant"},
type = "electric",
prop = {model = "t1ger_evbattery", pos = vector3(-0.01, -0.1, -0.13), rot = vector3(0.0, -2.0, 0.0), boneId = 28422}, -- texture fix
},
fuel_injector = {
item = "t1ger_fuelinjector",
label = "Fuel Injector",
icon = "https://i.postimg.cc/Pqhq9JTJ/t1ger-fuelinjector.png",
associated = {"oil_filter", "air_filter", "fuel_filter", "spark_plugs"},
type = "gas",
prop = {model = "t1ger_fuelinjector", pos = vector3(0.0, 0.0, 0.0), rot = vector3(0.0, -90.0, 0.0), boneId = 60309},
},
power_steering_pump = {
item = "t1ger_powersteeringpump",
label = "Power Steering Pump",
icon = "https://i.postimg.cc/XY9JsdMt/t1ger-powersteeringpump.png",
associated = {"steering_fluid"},
type = "gas",
prop = {model = "t1ger_powersteeringpump", pos = vector3(0.0, -0.12, 0.10), rot = vector3(120.0, 0.0, 0.0), boneId = 60309},
},
radiator = {
item = "t1ger_radiator",
label = "Radiator",
icon = "https://i.postimg.cc/0NfNsvyf/t1ger-radiator.png",
associated = {"coolant", "drive_belt"},
type = "gas",
prop = {model = "t1ger_radiator", pos = vector3(0.0, -0.1, 0.1), rot = vector3(0.0, 0.0, 0.0), boneId = 28422},
},
transmission = {
item = "t1ger_transmission",
label = "Transmission",
icon = "https://i.postimg.cc/bJwwY5Gj/t1ger-transmission.png",
associated = {"oil_filter", "transmission_fluid"},
type = "gas",
prop = {model = "t1ger_transmission", pos = vector3(-0.1, -0.1, -0.03), rot = vector3(0.0, -10.0, -90.0), boneId = 28422},
}
}
Config.Materials = { -- index is item name and value is item label.
scrap_metal = "Scrap Metal",
steel = "Steel",
aluminium = "Aluminium",
plastic = "Plastic",
rubber = "Rubber",
electric_scrap = "Electric Scrap",
glass = "Glass",
copper = "Copper",
carbon_fiber = "Carbon Fiber",
brass = "Brass",
synthetic_oil = "Synthetic Oil",
acid = "Acid"
}Config.Shop = {}
Config.Shop.Job = { -- Job Settings
defaultGrades = {
[0] = {grade = 0, name = "recruit", label = "Recruit", salary = 50},
[1] = {grade = 1, name = "employee", label = "Employee", salary = 75},
[2] = {grade = 2, name = "boss", label = "Boss", salary = 100},
-- make sure boss grade is the very last one (higest grade)
},
defaultDuty = true, -- only qbcore/qbox
offDutyPay = false, -- only qbcore/qbox
}
Config.Shop.JobAccount = true -- true = Use JobAccount system for society/shared account | false = Use our integrated account system
Config.Shop.Sale = true -- allow buy shops? And admins to list shop for_sale or cancel sale?
Config.Shop.Admin = {
menu = {
enable = true, -- enable/disable admin mechanic menu?
command = {enable = true, str = "mechanic:admin"}, -- enable/disable command
keybind = {enable = true, default = "F7", description = "Mechanic Admin Menu"} -- enable/disable keybind
},
}
Config.Shop.Creation = {
command = {enable = true, str = "mechanic:create"}, -- enable/disable command to directly open creator interface?
blip = { -- blip settings for shop blips
input = true, -- allow admins to modify sprite & color in shop creator interface?
sprite = 446, -- default sprite
color = 5, -- default color
display = 4, -- default display
scale = 0.75 -- default scale
},
}
Config.Shop.Management = {
command = {enable = true, str = "mechanic:manage"}, -- enable/disable command for admins to directly open management interface?
markerEdit = true, -- set to false to disable option in admin management menu to edit marker.
markerTeleport = true, -- set to false to disable option in admin management menu to TP to marker.
}
Config.Shop.Storage = {
slots = 50, -- default slots for created storage/stash
weight = 100000, -- default weight for created storage/stash
maxSlots = 500, -- max slots for editing storage/stash
maxWeight = 999999 -- max weight for editing storage/stash
}
Config.Shop.MarkerSettings = {
keybind = 38, -- Keybind for interacting with the marker.
distance = 5.0, -- distance to load/draw marker
textUi = { -- UI settings for prompts.
position = 'right-center',
style = {borderRadius = 0, backgroundColor = '#48BB78', color = 'white'}
},
}
Config.Shop.Markers = {
duty = {
title = "Duty",
enable = true, -- Toggle this marker class on/off.
icon = 'briefcase', -- Icon used for text UI and/or menu.
blip = {sprite = 280, display = 4, scale = 0.65, color = 0} -- Blip settings.
},
boss = {
title = "Boss",
enable = true,
icon = 'user-tie',
blip = {sprite = 164, display = 4, scale = 0.65, color = 0}
},
garage = {
title = "Garage",
enable = true,
icon = 'square-parking',
blip = {sprite = 357, display = 4, scale = 0.65, color = 0}
},
storage = {
title = "Storage",
enable = true,
icon = 'box',
blip = {sprite = 587, display = 4, scale = 0.65, color = 0}
},
workbench = {
title = "Workbench",
enable = true,
icon = 'tools',
blip = {sprite = 566, display = 4, scale = 0.65, color = 0}
},
supplier = {
title = "Supplier",
enable = true,
icon = 'shopping-cart',
blip = {sprite = 521, display = 4, scale = 0.65, color = 0}
}
}
--- Job Vehicles: vehicles available to any on-duty mechanic from the garage (not personal vehicles)
Config.Shop.JobVehicles = {
{model = "flatbed", label = "Flatbed Tow Truck", icon = "truck-pickup"},
-- add more job vehicles here, e.g:
-- {model = "towtruck", label = "Tow Truck", icon = "truck"},
-- {model = "minivan", label = "Service Van", icon = "van-shuttle"},
}
Config.Shop.Workbench = {
enable = true, -- set to false to disable and add your own crafting export/event
duration = 2500, -- duration in ms for crafting
anim = {dict = 'mini@repair', clip = 'fixing_a_player', blendIn = 8.0, blendOut = -8.0, flag = 49},
skillcheck = {enable = true, difficulty = {'easy', 'easy'}, inputs = {'w', 'a', 's', 'd'}},
maxCraftAmount = 20, -- max allowed amount to craft of selected item.
categories = require("shared/workbench") -- Load categories from the shared/workbench.lua file
}
Config.Shop.Supplier = {
receiveInStash = true, -- `true` ordered items delivered to stash. `false` otherwise in player inventory
playerPay = false, -- `true` player/mechanic pays for items. `false` shop account pays for items
maxQuantity = 30, -- max quantity of an item that can be ordered.
catalogue = require("shared/supplier") -- Load catalogue from the shared/supplier.lua file
}
Config.Shop.Billing = {
enable = true, -- set to false to disable built in billing entirely
command = {enable = true, name = 'billing'}, -- enable command to open billing interface
actionMenu = {enable = true, icon = 'file-invoice-dollar'}, -- enable from action menu? icon for menu option
}return {
{
title = "Body Parts",
icon = "https://i.postimg.cc/hvHDrP2S/t1ger-vehicledoor.png",
items = {
["t1ger_vehicledoor"] = {price = 200, icon = "https://i.postimg.cc/hvHDrP2S/t1ger-vehicledoor.png"},
["t1ger_vehiclehood"] = {price = 500, icon = "https://i.postimg.cc/5yH9LFq7/t1ger-vehiclehood.png"},
["t1ger_vehicletrunk"] = {price = 400, icon = "https://i.postimg.cc/WpK1jXTQ/t1ger-vehicletrunk.png"},
["t1ger_vehiclewindow"] = {price = 100, icon = "https://i.postimg.cc/pLMV5r9C/t1ger-vehiclewindow.png"},
["t1ger_vehiclewheel"] = {price = 300, icon = "https://i.postimg.cc/15q5zwz4/t1ger-vehiclewheel.png"}
}
},
{
title = "Core Parts",
icon = "https://i.postimg.cc/CM6z5wHr/t1ger-alternator.png",
items = {
["t1ger_alternator"] = {price = 600, icon = "https://i.postimg.cc/CM6z5wHr/t1ger-alternator.png"},
["t1ger_brakes"] = {price = 400, icon = "https://i.postimg.cc/X7GXytsj/t1ger-brakes.png"},
["t1ger_electricmotor"] = {price = 1200, icon = "https://i.postimg.cc/J0gn2QzC/t1ger-electricmotor.png"},
["t1ger_evbattery"] = {price = 1800, icon = "https://i.postimg.cc/ZKGnPjQr/t1ger-evbattery.png"},
["t1ger_fuelinjector"] = {price = 750, icon = "https://i.postimg.cc/Pqhq9JTJ/t1ger-fuelinjector.png"},
["t1ger_powersteeringpump"] = {price = 900, icon = "https://i.postimg.cc/XY9JsdMt/t1ger-powersteeringpump.png"},
["t1ger_radiator"] = {price = 500, icon = "https://i.postimg.cc/0NfNsvyf/t1ger-radiator.png"},
["t1ger_transmission"] = {price = 1600, icon = "https://i.postimg.cc/bJwwY5Gj/t1ger-transmission.png"},
}
},
{
title = "Service Parts",
icon = "https://i.postimg.cc/Y02YH874/t1ger-coolant.png",
items = {
["t1ger_airfilter"] = {price = 150, icon = "https://i.postimg.cc/hj1T66kW/t1ger-airfilter.png"},
["t1ger_batterycoolant"] = {price = 70, icon = "https://i.postimg.cc/26DnHrX7/t1ger-batterycoolant.png"},
["t1ger_brakefluid"] = {price = 60, icon = "https://i.postimg.cc/jjNzQLvj/t1ger-brakefluid.png"},
["t1ger_brakepad"] = {price = 140, icon = "https://i.postimg.cc/jSBH7zH9/t1ger-brakepad.png"},
["t1ger_coolant"] = {price = 40, icon = "https://i.postimg.cc/Y02YH874/t1ger-coolant.png"},
["t1ger_drivebelt"] = {price = 200, icon = "https://i.postimg.cc/bYL1TX01/t1ger-drivebelt.png"},
["t1ger_fuelfilter"] = {price = 250, icon = "https://i.postimg.cc/3NLpJprt/t1ger-fuelfilter.png"},
["t1ger_hvwiring"] = {price = 420, icon = "https://i.postimg.cc/g09hJGdb/t1ger-hvwiring.png"},
["t1ger_oilfilter"] = {price = 200, icon = "https://i.postimg.cc/bNBb7QBJ/t1ger-oilfilter.png"},
["t1ger_sparkplugs"] = {price = 350, icon = "https://i.postimg.cc/NfMmCNbS/t1ger-sparkplugs.png"},
["t1ger_steeringfluid"] = {price = 80, icon = "https://i.postimg.cc/rwRWMKB9/t1ger-steeringfluid.png"},
["t1ger_tires"] = {price = 100, icon = "https://i.postimg.cc/BvxKPRQL/t1ger-tires.png"},
["t1ger_transmissionfluid"] = {price = 90, icon = "https://i.postimg.cc/4dsh6wm8/t1ger-transmissionfluid.png"}
}
},
{
title = "Kits",
icon = "https://i.postimg.cc/W4jRTJDR/t1ger-carjack.png",
items = {
["t1ger_repairkit"] = {price = 1500, icon = "https://i.postimg.cc/Tw7BV7tG/t1ger-repairkit.png"},
["t1ger_repairkit_adv"] = {price = 3000, icon = "https://i.postimg.cc/9Xkvzk4Y/t1ger-repairkit-adv.png"},
["t1ger_carjack"] = {price = 2500, icon = "https://i.postimg.cc/W4jRTJDR/t1ger-carjack.png"},
["t1ger_patchkit"] = {price = 2000, icon = "https://i.postimg.cc/NFKSp6nX/t1ger-patchkit.png"},
["t1ger_fuelcan"] = {price = 300, icon = "https://i.postimg.cc/528chm2q/t1ger-fuelcan.png"},
["t1ger_jumpstarter"] = {price = 400, icon = "https://i.postimg.cc/QtxRWGk0/t1ger-jumpstarter.png"},
["t1ger_repairkit_tire"] = {price = 500, icon = "https://i.postimg.cc/6qFSS7sm/t1ger-repairkit-tire.png"},
["t1ger_diagnostictool"] = {price = 1000, icon = "https://i.postimg.cc/P5zPyYYN/t1ger-diagnostictool.png"},
["t1ger_servicebook"] = {price = 100, icon = "https://i.postimg.cc/wxFCGD6f/t1ger-servicebook.png"}
}
},
{
title = "Props",
icon = "https://i.postimg.cc/xdksrf5r/t1ger-roadbarrier.png",
items = {
["t1ger_roadcone"] = {price = 50, icon = "https://i.postimg.cc/8zzKHBrz/t1ger-roadcone.png"},
["t1ger_toolstrolley"] = {price = 200, icon = "https://i.postimg.cc/pTzqTs3q/t1ger-toolstrolley.png"},
["t1ger_toolbox"] = {price = 100, icon = "https://i.postimg.cc/Jh9pMfYs/t1ger-toolbox.png"},
["t1ger_consign"] = {price = 150, icon = "https://i.postimg.cc/kgYjh6xF/t1ger-consign.png"},
["t1ger_roadbarrier"] = {price = 600, icon = "https://i.postimg.cc/xdksrf5r/t1ger-roadbarrier.png"}
}
}
}return {
{ -- BODY PARTS
label = "Body Parts",
description = "Body Parts are used by mechanics to repair visuals of the vehicle.",
icon = "https://i.postimg.cc/hvHDrP2S/t1ger-vehicledoor.png",
recipe = {
["t1ger_vehicledoor"] = { -- output item name
icon = "https://i.postimg.cc/hvHDrP2S/t1ger-vehicledoor.png", -- output item icon
materials = { -- materials to craft one piece
["steel"] = 5, -- item name and required amount
["plastic"] = 2, -- item name and required amount
["rubber"] = 2, -- item name and required amount
}
},
["t1ger_vehiclehood"] = {
icon = "https://i.postimg.cc/5yH9LFq7/t1ger-vehiclehood.png",
materials = {
["steel"] = 6,
["aluminium"] = 3,
["rubber"] = 1,
}
},
["t1ger_vehicletrunk"] = {
icon = "https://i.postimg.cc/WpK1jXTQ/t1ger-vehicletrunk.png",
materials = {
["steel"] = 5,
["aluminium"] = 2,
["plastic"] = 2,
["rubber"] = 1,
}
},
["t1ger_vehiclewheel"] = {
icon = "https://i.postimg.cc/15q5zwz4/t1ger-vehiclewheel.png",
materials = {
["steel"] = 4,
["rubber"] = 5,
["carbon_fiber"] = 2,
["brass"] = 1,
}
},
["t1ger_vehiclewindow"] = {
icon = "https://i.postimg.cc/pLMV5r9C/t1ger-vehiclewindow.png",
materials = {
["glass"] = 4,
}
},
}
},
{ -- CORE PARTS
label = "Core Parts",
description = "These parts are used by mechanics to repair worn, critical or failured parts.",
icon = "https://i.postimg.cc/XY9JsdMt/t1ger-powersteeringpump.png",
recipe = {
["t1ger_alternator"] = {
icon = "https://i.postimg.cc/CM6z5wHr/t1ger-alternator.png",
materials = {
["steel"] = 5,
["copper"] = 4,
["electric_scrap"] = 3,
}
},
["t1ger_brakes"] = {
icon = "https://i.postimg.cc/X7GXytsj/t1ger-brakes.png",
materials = {
["steel"] = 5,
["rubber"] = 3,
["brass"] = 2,
}
},
["t1ger_electricmotor"] = {
icon = "https://i.postimg.cc/J0gn2QzC/t1ger-electricmotor.png",
materials = {
["steel"] = 8,
["copper"] = 7,
["electric_scrap"] = 6,
["carbon_fiber"] = 4,
}
},
["t1ger_evbattery"] = {
icon = "https://i.postimg.cc/ZKGnPjQr/t1ger-evbattery.png",
materials = {
["aluminium"] = 6,
["copper"] = 5,
["electric_scrap"] = 7,
["acid"] = 5,
}
},
["t1ger_fuelinjector"] = {
icon = "https://i.postimg.cc/Pqhq9JTJ/t1ger-fuelinjector.png",
materials = {
["steel"] = 4,
["aluminium"] = 3,
["plastic"] = 2,
["electric_scrap"] = 2,
}
},
["t1ger_powersteeringpump"] = {
icon = "https://i.postimg.cc/XY9JsdMt/t1ger-powersteeringpump.png",
materials = {
["steel"] = 8,
["aluminium"] = 6,
["synthetic_oil"] = 2,
["electric_scrap"] = 3,
}
},
["t1ger_radiator"] = {
icon = "https://i.postimg.cc/0NfNsvyf/t1ger-radiator.png",
materials = {
["steel"] = 6,
["aluminium"] = 5,
["plastic"] = 3,
["synthetic_oil"] = 1,
}
},
["t1ger_transmission"] = {
icon = "https://i.postimg.cc/bJwwY5Gj/t1ger-transmission.png",
materials = {
["steel"] = 10,
["aluminium"] = 6,
["synthetic_oil"] = 3,
["brass"] = 2,
}
},
}
},
{ -- SERVICE PARTS
label = "Service Parts",
description = "These parts are used by mechanics to do service on vehicles.",
icon = "https://i.postimg.cc/Y02YH874/t1ger-coolant.png",
recipe = {
["t1ger_airfilter"] = {
icon = "https://i.postimg.cc/hj1T66kW/t1ger-airfilter.png",
materials = {
["plastic"] = 2,
["rubber"] = 1,
}
},
["t1ger_batterycoolant"] = {
icon = "https://i.postimg.cc/26DnHrX7/t1ger-batterycoolant.png",
materials = {
["acid"] = 2,
["plastic"] = 1,
}
},
["t1ger_brakefluid"] = {
icon = "https://i.postimg.cc/jjNzQLvj/t1ger-brakefluid.png",
materials = {
["acid"] = 2,
["synthetic_oil"] = 1,
}
},
["t1ger_brakepad"] = {
icon = "https://i.postimg.cc/jSBH7zH9/t1ger-brakepad.png",
materials = {
["steel"] = 3,
["rubber"] = 2,
}
},
["t1ger_coolant"] = {
icon = "https://i.postimg.cc/Y02YH874/t1ger-coolant.png",
materials = {
["acid"] = 2,
["plastic"] = 1,
}
},
["t1ger_drivebelt"] = {
icon = "https://i.postimg.cc/bYL1TX01/t1ger-drivebelt.png",
materials = {
["rubber"] = 3,
["steel"] = 2,
}
},
["t1ger_fuelfilter"] = {
icon = "https://i.postimg.cc/3NLpJprt/t1ger-fuelfilter.png",
materials = {
["steel"] = 2,
["plastic"] = 2,
["rubber"] = 1,
}
},
["t1ger_hvwiring"] = {
icon = "https://i.postimg.cc/g09hJGdb/t1ger-hvwiring.png",
materials = {
["copper"] = 5,
["electric_scrap"] = 4,
["carbon_fiber"] = 1,
}
},
["t1ger_oilfilter"] = {
icon = "https://i.postimg.cc/bNBb7QBJ/t1ger-oilfilter.png",
materials = {
["steel"] = 2,
["synthetic_oil"] = 1,
["rubber"] = 1,
}
},
["t1ger_sparkplugs"] = {
icon = "https://i.postimg.cc/NfMmCNbS/t1ger-sparkplugs.png",
materials = {
["steel"] = 2,
["copper"] = 2,
["electric_scrap"] = 1,
}
},
["t1ger_steeringfluid"] = {
icon = "https://i.postimg.cc/rwRWMKB9/t1ger-steeringfluid.png",
materials = {
["synthetic_oil"] = 2,
["acid"] = 1,
}
},
["t1ger_tires"] = {
icon = "https://i.postimg.cc/BvxKPRQL/t1ger-tires.png",
materials = {
["rubber"] = 5,
["steel"] = 2,
}
},
["t1ger_transmissionfluid"] = {
icon = "https://i.postimg.cc/4dsh6wm8/t1ger-transmissionfluid.png",
materials = {
["synthetic_oil"] = 3,
["acid"] = 1,
}
},
}
},
{ -- KITS
label = "Kits",
description = "Kits are used by mechanics for different stuff.",
icon = "https://i.postimg.cc/W4jRTJDR/t1ger-carjack.png",
recipe = {
["t1ger_repairkit"] = {
icon = "https://i.postimg.cc/Tw7BV7tG/t1ger-repairkit.png",
materials = {
["steel"] = 3,
["rubber"] = 2,
["plastic"] = 2,
["electric_scrap"] = 1,
}
},
["t1ger_repairkit_adv"] = {
icon = "https://i.postimg.cc/9Xkvzk4Y/t1ger-repairkit-adv.png",
materials = {
["steel"] = 5,
["rubber"] = 3,
["plastic"] = 3,
["electric_scrap"] = 2,
["carbon_fiber"] = 1,
}
},
["t1ger_carjack"] = {
icon = "https://i.postimg.cc/W4jRTJDR/t1ger-carjack.png",
materials = {
["steel"] = 8,
["rubber"] = 4,
["aluminium"] = 2,
}
},
["t1ger_patchkit"] = {
icon = "https://i.postimg.cc/NFKSp6nX/t1ger-patchkit.png",
materials = {
["rubber"] = 5,
["plastic"] = 2,
["synthetic_oil"] = 1,
}
},
["t1ger_fuelcan"] = {
icon = "https://i.postimg.cc/528chm2q/t1ger-fuelcan.png",
materials = {
["steel"] = 3,
["plastic"] = 2,
}
},
["t1ger_jumpstarter"] = {
icon = "https://i.postimg.cc/QtxRWGk0/t1ger-jumpstarter.png",
materials = {
["steel"] = 2,
["electric_scrap"] = 3,
["plastic"] = 2,
["copper"] = 1,
}
},
["t1ger_repairkit_tire"] = {
icon = "https://i.postimg.cc/6qFSS7sm/t1ger-repairkit-tire.png",
materials = {
["rubber"] = 4,
["steel"] = 2,
["synthetic_oil"] = 1,
}
},
["t1ger_diagnostictool"] = {
icon = "https://i.postimg.cc/P5zPyYYN/t1ger-diagnostictool.png",
materials = {
["plastic"] = 5,
["electric_scrap"] = 6,
["copper"] = 4,
["glass"] = 2,
["carbon_fiber"] = 1,
}
},
["t1ger_servicebook"] = {
icon = "https://i.postimg.cc/wxFCGD6f/t1ger-servicebook.png", -- placeholder image, replace if needed
materials = {
["plastic"] = 3, -- for binding or cover
["electric_scrap"] = 2, -- simulates digital storage or RFID
["glass"] = 1, -- maybe for display panel or screen
["scrap_metal"] = 2 -- for casing or internal structure
}
}
}
},
{ -- PROPS
label = "Props",
description = "Props are used by mechanics to do different prop emotes.",
icon = "https://i.postimg.cc/xdksrf5r/t1ger-roadbarrier.png",
recipe = {
["t1ger_roadcone"] = {
icon = "https://i.postimg.cc/8zzKHBrz/t1ger-roadcone.png",
materials = {
["plastic"] = 3,
["rubber"] = 1,
}
},
["t1ger_toolstrolley"] = {
icon = "https://i.postimg.cc/pTzqTs3q/t1ger-toolstrolley.png",
materials = {
["steel"] = 6,
["rubber"] = 2,
["plastic"] = 3,
}
},
["t1ger_toolbox"] = {
icon = "https://i.postimg.cc/Jh9pMfYs/t1ger-toolbox.png",
materials = {
["steel"] = 4,
["plastic"] = 2,
}
},
["t1ger_consign"] = {
icon = "https://i.postimg.cc/kgYjh6xF/t1ger-consign.png",
materials = {
["steel"] = 3,
["plastic"] = 2,
}
},
["t1ger_roadbarrier"] = {
icon = "https://i.postimg.cc/xdksrf5r/t1ger-roadbarrier.png",
materials = {
["steel"] = 5,
["plastic"] = 3,
["rubber"] = 1,
}
},
}
},
}var CP=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var MK=CP((Tn,$n)=>{(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function r(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(o){if(o.ep)return;o.ep=!0;const i=r(o);fetch(o.href,i)}})();/**
* @vue/shared v3.4.21
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/function Uh(e,t){const r=new Set(e.split(","));return n=>r.has(n)}const gr={},Na=[],Hn=()=>{},wP=()=>!1,oc=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Wh=e=>e.startsWith("onUpdate:"),Dr=Object.assign,Kh=(e,t)=>{const r=e.indexOf(t);r>-1&&e.splice(r,1)},SP=Object.prototype.hasOwnProperty,Xt=(e,t)=>SP.call(e,t),Mt=Array.isArray,La=e=>ic(e)==="[object Map]",k0=e=>ic(e)==="[object Set]",Ft=e=>typeof e=="function",Or=e=>typeof e=="string",nl=e=>typeof e=="symbol",fr=e=>e!==null&&typeof e=="object",R0=e=>(fr(e)||Ft(e))&&Ft(e.then)&&Ft(e.catch),P0=Object.prototype.toString,ic=e=>P0.call(e),kP=e=>ic(e).slice(8,-1),T0=e=>ic(e)==="[object Object]",qh=e=>Or(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,$l=Uh(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ac=e=>{const t=Object.create(null);return r=>t[r]||(t[r]=e(r))},RP=/-(\w)/g,po=ac(e=>e.replace(RP,(t,r)=>r?r.toUpperCase():"")),PP=/\B([A-Z])/g,ol=ac(e=>e.replace(PP,"-$1").toLowerCase()),lc=ac(e=>e.charAt(0).toUpperCase()+e.slice(1)),Zc=ac(e=>e?`on${lc(e)}`:""),gi=(e,t)=>!Object.is(e,t),Qc=(e,t)=>{for(let r=0;r<e.length;r++)e[r](t)},kd=(e,t,r)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:r})},TP=e=>{const t=parseFloat(e);return isNaN(t)?e:t},$P=e=>{const t=Or(e)?Number(e):NaN;return isNaN(t)?e:t};let Lg;const $0=()=>Lg||(Lg=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function ss(e){if(Mt(e)){const t={};for(let r=0;r<e.length;r++){const n=e[r],o=Or(n)?MP(n):ss(n);if(o)for(const i in o)t[i]=o[i]}return t}else if(Or(e)||fr(e))return e}const zP=/;(?![^(]*\))/g,OP=/:([^]+)/,_P=/\/\*[^]*?\*\//g;function MP(e){const t={};return e.replace(_P,"").split(zP).forEach(r=>{if(r){const n=r.split(OP);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function Yh(e){let t="";if(Or(e))t=e;else if(Mt(e))for(let r=0;r<e.length;r++){const n=Yh(e[r]);n&&(t+=n+" ")}else if(fr(e))for(const r in e)e[r]&&(t+=r+" ");return t.trim()}const IP="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",FP=Uh(IP);function z0(e){return!!e||e===""}const Hg=e=>Or(e)?e:e==null?"":Mt(e)||fr(e)&&(e.toString===P0||!Ft(e.toString))?JSON.stringify(e,O0,2):String(e),O0=(e,t)=>t&&t.__v_isRef?O0(e,t.value):La(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((r,[n,o],i)=>(r[Jc(n,i)+" =>"]=o,r),{})}:k0(t)?{[`Set(${t.size})`]:[...t.values()].map(r=>Jc(r))}:nl(t)?Jc(t):fr(t)&&!Mt(t)&&!T0(t)?String(t):t,Jc=(e,t="")=>{var r;return nl(e)?`Symbol(${(r=e.description)!=null?r:t})`:e};/**
* @vue/reactivity v3.4.21
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/let kn;class _0{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=kn,!t&&kn&&(this.index=(kn.scopes||(kn.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const r=kn;try{return kn=this,t()}finally{kn=r}}}on(){kn=this}off(){kn=this.parent}stop(t){if(this._active){let r,n;for(r=0,n=this.effects.length;r<n;r++)this.effects[r].stop();for(r=0,n=this.cleanups.length;r<n;r++)this.cleanups[r]();if(this.scopes)for(r=0,n=this.scopes.length;r<n;r++)this.scopes[r].stop(!0);if(!this.detached&&this.parent&&!t){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0,this._active=!1}}}function M0(e){return new _0(e)}function DP(e,t=kn){t&&t.active&&t.effects.push(e)}function I0(){return kn}function EP(e){kn&&kn.cleanups.push(e)}let qi;class Gh{constructor(t,r,n,o){this.fn=t,this.trigger=r,this.scheduler=n,this.active=!0,this.deps=[],this._dirtyLevel=4,this._trackId=0,this._runnings=0,this._shouldSchedule=!1,this._depsLength=0,DP(this,o)}get dirty(){if(this._dirtyLevel===2||this._dirtyLevel===3){this._dirtyLevel=1,da();for(let t=0;t<this._depsLength;t++){const r=this.deps[t];if(r.computed&&(AP(r.computed),this._dirtyLevel>=4))break}this._dirtyLevel===1&&(this._dirtyLevel=0),ca()}return this._dirtyLevel>=4}set dirty(t){this._dirtyLevel=t?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let t=ui,r=qi;try{return ui=!0,qi=this,this._runnings++,jg(this),this.fn()}finally{Vg(this),this._runnings--,qi=r,ui=t}}stop(){var t;this.active&&(jg(this),Vg(this),(t=this.onStop)==null||t.call(this),this.active=!1)}}function AP(e){return e.value}function jg(e){e._trackId++,e._depsLength=0}function Vg(e){if(e.deps.length>e._depsLength){for(let t=e._depsLength;t<e.deps.length;t++)F0(e.deps[t],e);e.deps.length=e._depsLength}}function F0(e,t){const r=e.get(t);r!==void 0&&t._trackId!==r&&(e.delete(t),e.size===0&&e.cleanup())}let ui=!0,Ju=0;const D0=[];function da(){D0.push(ui),ui=!1}function ca(){const e=D0.pop();ui=e===void 0?!0:e}function Xh(){Ju++}function Zh(){for(Ju--;!Ju&&ef.length;)ef.shift()()}function E0(e,t,r){if(t.get(e)!==e._trackId){t.set(e,e._trackId);const n=e.deps[e._depsLength];n!==t?(n&&F0(n,e),e.deps[e._depsLength++]=t):e._depsLength++}}const ef=[];function A0(e,t,r){Xh();for(const n of e.keys()){let o;n._dirtyLevel<t&&(o??(o=e.get(n)===n._trackId))&&(n._shouldSchedule||(n._shouldSchedule=n._dirtyLevel===0),n._dirtyLevel=t),n._shouldSchedule&&(o??(o=e.get(n)===n._trackId))&&(n.trigger(),(!n._runnings||n.allowRecurse)&&n._dirtyLevel!==2&&(n._shouldSchedule=!1,n.scheduler&&ef.push(n.scheduler)))}Zh()}const B0=(e,t)=>{const r=new Map;return r.cleanup=e,r.computed=t,r},Rd=new WeakMap,Yi=Symbol(""),tf=Symbol("");function pn(e,t,r){if(ui&&qi){let n=Rd.get(e);n||Rd.set(e,n=new Map);let o=n.get(r);o||n.set(r,o=B0(()=>n.delete(r))),E0(qi,o)}}function Mo(e,t,r,n,o,i){const a=Rd.get(e);if(!a)return;let l=[];if(t==="clear")l=[...a.values()];else if(r==="length"&&Mt(e)){const s=Number(n);a.forEach((d,u)=>{(u==="length"||!nl(u)&&u>=s)&&l.push(d)})}else switch(r!==void 0&&l.push(a.get(r)),t){case"add":Mt(e)?qh(r)&&l.push(a.get("length")):(l.push(a.get(Yi)),La(e)&&l.push(a.get(tf)));break;case"delete":Mt(e)||(l.push(a.get(Yi)),La(e)&&l.push(a.get(tf)));break;case"set":La(e)&&l.push(a.get(Yi));break}Xh();for(const s of l)s&&A0(s,4);Zh()}function BP(e,t){var r;return(r=Rd.get(e))==null?void 0:r.get(t)}const NP=Uh("__proto__,__v_isRef,__isVue"),N0=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(nl)),Ug=LP();function LP(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...r){const n=Lt(this);for(let i=0,a=this.length;i<a;i++)pn(n,"get",i+"");const o=n[t](...r);return o===-1||o===!1?n[t](...r.map(Lt)):o}}),["push","pop","shift","unshift","splice"].forEach(t=>{e[t]=function(...r){da(),Xh();const n=Lt(this)[t].apply(this,r);return Zh(),ca(),n}}),e}function HP(e){const t=Lt(this);return pn(t,"has",e),t.hasOwnProperty(e
* @vue/runtime-core v3.4.21
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/function fi(e,t,r,n){try{return n?e(...n):e()}catch(o){dc(o,t,r)}}function Un(e,t,r,n){if(Ft(e)){const i=fi(e,t,r,n);return i&&R0(i)&&i.catch(a=>{dc(a,t,r)}),i}const o=[];for(let i=0;i<e.length;i++)o.push(Un(e[i],t,r,n));return o}function dc(e,t,r,n=!0){const o=t?t.vnode:null;if(t){let i=t.parent;const a=t.proxy,l=`https://vuejs.org/error-reference/#runtime-${r}`;for(;i;){const d=i.ec;if(d){for(let u=0;u<d.length;u++)if(d[u](e,a,l)===!1)return}i=i.parent}const s=t.appContext.config.errorHandler;if(s){fi(s,null,10,[e,a,l]);return}}cT(e,r,o,n)}function cT(e,t,r,n=!0){console.error(e)}let Ul=!1,rf=!1;const en=[];let so=0;const Ha=[];let oi=null,Hi=0;const Z0=Promise.resolve();let rv=null;function Ot(e){const t=rv||Z0;return e?t.then(this?e.bind(this):e):t}function uT(e){let t=so+1,r=en.length;for(;t<r;){const n=t+r>>>1,o=en[n],i=Wl(o);i<e||i===e&&o.pre?t=n+1:r=n}return t}function nv(e){(!en.length||!en.includes(e,Ul&&e.allowRecurse?so+1:so))&&(e.id==null?en.push(e):en.splice(uT(e.id),0,e),Q0())}function Q0(){!Ul&&!rf&&(rf=!0,rv=Z0.then(ex))}function fT(e){const t=en.indexOf(e);t>so&&en.splice(t,1)}function hT(e){Mt(e)?Ha.push(...e):(!oi||!oi.includes(e,e.allowRecurse?Hi+1:Hi))&&Ha.push(e),Q0()}function Gg(e,t,r=Ul?so+1:0){for(;r<en.length;r++){const n=en[r];if(n&&n.pre){if(e&&n.id!==e.uid)continue;en.splice(r,1),r--,n()}}}function J0(e){if(Ha.length){const t=[...new Set(Ha)].sort((r,n)=>Wl(r)-Wl(n));if(Ha.length=0,oi){oi.push(...t);return}for(oi=t,Hi=0;Hi<oi.length;Hi++)oi[Hi]();oi=null,Hi=0}}const Wl=e=>e.id==null?1/0:e.id,vT=(e,t)=>{const r=Wl(e)-Wl(t);if(r===0){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return r};function ex(e){rf=!1,Ul=!0,en.sort(vT);try{for(so=0;so<en.length;so++){const t=en[so];t&&t.active!==!1&&fi(t,null,14)}}finally{so=0,en.length=0,J0(),Ul=!1,rv=null,(en.length||Ha.length)&&ex()}}function gT(e,t,...r){if(e.isUnmounted)return;const n=e.vnode.props||gr;let o=r;const i=t.startsWith("update:"),a=i&&t.slice(7);if(a&&a in n){const u=`${a==="modelValue"?"model":a}Modifiers`,{number:f,trim:h}=n[u]||gr;h&&(o=r.map(g=>Or(g)?g.trim():g)),f&&(o=r.map(TP))}let l,s=n[l=Zc(t)]||n[l=Zc(po(t))];!s&&i&&(s=n[l=Zc(ol(t))]),s&&Un(s,e,6,o);const d=n[l+"Once"];if(d){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,Un(d,e,6,o)}}function tx(e,t,r=!1){const n=t.emitsCache,o=n.get(e);if(o!==void 0)return o;const i=e.emits;let a={},l=!1;if(!Ft(e)){const s=d=>{const u=tx(d,t,!0);u&&(l=!0,Dr(a,u))};!r&&t.mixins.length&&t.mixins.forEach(s),e.extends&&s(e.extends),e.mixins&&e.mixins.forEach(s)}return!i&&!l?(fr(e)&&n.set(e,null),null):(Mt(i)?i.forEach(s=>a[s]=null):Dr(a,i),fr(e)&&n.set(e,a),a)}function cc(e,t){return!e||!oc(t)?!1:(t=t.slice(2).replace(/Once$/,""),Xt(e,t[0].toLowerCase()+t.slice(1))||Xt(e,ol(t))||Xt(e,t))}let Ir=null,rx=null;function Td(e){const t=Ir;return Ir=e,rx=e&&e.type.__scopeId||null,t}function Tr(e,t=Ir,r){if(!t||e._n)return e;const n=(...o)=>{n._d&&dp(-1);const i=Td(t);let a;try{a=e(...o)}finally{Td(i),n._d&&dp(1)}return a};return n._n=!0,n._c=!0,n._d=!0,n}function eu(e){const{type:t,vnode:r,proxy:n,withProxy:o,props:i,propsOptions:[a],slots:l,attrs:s,emit:d,render:u,renderCache:f,data:h,setupState:g,ctx:v,inheritAttrs:b}=e;let m,p;const x=Td(e);try{if(r.shapeFlag&4){const y=o||n,C=y;m=lo(u.call(C,y,f,i,g,h,v)),p=s}else{const y=t;m=lo(y.length>1?y(i,{attrs:s,slots:l,emit:d}):y(i,null)),p=t.props?s:pT(s)}}catch(y){Il.length=0,dc(y,e,1),m=rr(tn)}let S=m;if(p&&b!==!1){const y=Object.keys(p),{shapeFlag:C}=S;y.length&&C&7&&(a&&y.some(Wh)&&(p=mT(p,a)),S=ln(S,p))}return r.dirs&&(S=ln(S),S.dirs=S.dirs?S.dirs.concat(r.dirs):r.dirs),r.transition&&(S.transition=r.transition),m=S,Td(x),m}const pT=e=>{let t;for(const r in e)(r==="class"||r==="style"||oc(r))&&((t||(t={}))[r]=e[r]);return t},mT=(e,t)=>{const r={};for(const n in e)(!Wh(n)||!(n.slice(9)in t))&&(r[n]=e[n]);return r};function bT(e,t,r){const{props:n,children:o,component:i}=e,{props:a,children:l,patchFlag:s}=t,d=i.emitsOptions;if(t.dirs||t.transition)return!0;if(r&&s>=0){if(s&1024)return!0;if(s&16)return n?Xg(n,a,d):!!a;if(s
* @vue/runtime-dom v3.4.21
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/const g$="http://www.w3.org/2000/svg",p$="http://www.w3.org/1998/Math/MathML",li=typeof document<"u"?document:null,hp=li&&li.createElement("template"),m$={insert:(e,t,r)=>{t.insertBefore(e,r||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,r,n)=>{const o=t==="svg"?li.createElementNS(g$,e):t==="mathml"?li.createElementNS(p$,e):li.createElement(e,r?{is:r}:void 0);return e==="select"&&n&&n.multiple!=null&&o.setAttribute("multiple",n.multiple),o},createText:e=>li.createTextNode(e),createComment:e=>li.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>li.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,r,n,o,i){const a=r?r.previousSibling:t.lastChild;if(o&&(o===i||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),r),!(o===i||!(o=o.nextSibling)););else{hp.innerHTML=n==="svg"?`<svg>${e}</svg>`:n==="mathml"?`<math>${e}</math>`:e;const l=hp.content;if(n==="svg"||n==="mathml"){const s=l.firstChild;for(;s.firstChild;)l.appendChild(s.firstChild);l.removeChild(s)}t.insertBefore(l,r)}return[a?a.nextSibling:t.firstChild,r?r.previousSibling:t.lastChild]}},Zo="transition",hl="animation",Ya=Symbol("_vtc"),At=(e,{slots:t})=>c(zT,Rx(e),t);At.displayName="Transition";const kx={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},b$=At.props=Dr({},ix,kx),Ii=(e,t=[])=>{Mt(e)?e.forEach(r=>r(...t)):e&&e(...t)},vp=e=>e?Mt(e)?e.some(t=>t.length>1):e.length>1:!1;function Rx(e){const t={};for(const _ in e)_ in kx||(t[_]=e[_]);if(e.css===!1)return t;const{name:r="v",type:n,duration:o,enterFromClass:i=`${r}-enter-from`,enterActiveClass:a=`${r}-enter-active`,enterToClass:l=`${r}-enter-to`,appearFromClass:s=i,appearActiveClass:d=a,appearToClass:u=l,leaveFromClass:f=`${r}-leave-from`,leaveActiveClass:h=`${r}-leave-active`,leaveToClass:g=`${r}-leave-to`}=e,v=x$(o),b=v&&v[0],m=v&&v[1],{onBeforeEnter:p,onEnter:x,onEnterCancelled:S,onLeave:y,onLeaveCancelled:C,onBeforeAppear:k=p,onAppear:R=x,onAppearCancelled:$=S}=t,T=(_,N,j)=>{ti(_,N?u:l),ti(_,N?d:a),j&&j()},z=(_,N)=>{_._isLeaving=!1,ti(_,f),ti(_,g),ti(_,h),N&&N()},F=_=>(N,j)=>{const H=_?R:x,Y=()=>T(N,_,j);Ii(H,[N,Y]),gp(()=>{ti(N,_?s:i),_o(N,_?u:l),vp(H)||pp(N,n,b,Y)})};return Dr(t,{onBeforeEnter(_){Ii(p,[_]),_o(_,i),_o(_,a)},onBeforeAppear(_){Ii(k,[_]),_o(_,s),_o(_,d)},onEnter:F(!1),onAppear:F(!0),onLeave(_,N){_._isLeaving=!0;const j=()=>z(_,N);_o(_,f),Tx(),_o(_,h),gp(()=>{_._isLeaving&&(ti(_,f),_o(_,g),vp(y)||pp(_,n,m,j))}),Ii(y,[_,j])},onEnterCancelled(_){T(_,!1),Ii(S,[_])},onAppearCancelled(_){T(_,!0),Ii($,[_])},onLeaveCancelled(_){z(_),Ii(C,[_])}})}function x$(e){if(e==null)return null;if(fr(e))return[iu(e.enter),iu(e.leave)];{const t=iu(e);return[t,t]}}function iu(e){return $P(e)}function _o(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.add(r)),(e[Ya]||(e[Ya]=new Set)).add(t)}function ti(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.remove(n));const r=e[Ya];r&&(r.delete(t),r.size||(e[Ya]=void 0))}function gp(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let y$=0;function pp(e,t,r,n){const o=e._endId=++y$,i=()=>{o===e._endId&&n()};if(r)return setTimeout(i,r);const{type:a,timeout:l,propCount:s}=Px(e,t);if(!a)return n();const d=a+"end";let u=0;const f=()=>{e.removeEventListener(d,h),i()},h=g=>{g.target===e&&++u>=s&&f()};setTimeout(()=>{u<s&&f()},l+1),e.addEventListener(d,h)}function Px(e,t){const r=window.getComputedStyle(e),n=v=>(r[v]||"").split(", "),o=n(`${Zo}Delay`),i=n(`${Zo}Duration`),a=mp(o,i),l=n(`${hl}Delay`),s=n(`${hl}Duration`),d=mp(l,s);let u=null,f=0,h=0;t===Zo?a>0&&(u=Zo,f=a,h=i.length):t===hl?d>0&&(u=hl,f=d,h=s.length):(f=Math.max(a,d),u=f>0?a>d?Zo:hl:null,h=u?u===Zo?i.length:s.length:0);const g=u===Zo&&/\b(transform|all)(,|$)/.test(n(`${Zo}Property`).toString());return{type
* pinia v2.1.7
* (c) 2023 Eduardo San Martin Morote
* @license MIT
*/let Ix;const bc=e=>Ix=e,Fx=Symbol();function uf(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var Fl;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(Fl||(Fl={}));function Y$(){const e=M0(!0),t=e.run(()=>D({}));let r=[],n=[];const o=qa({install(i){bc(o),o._a=i,i.provide(Fx,o),i.config.globalProperties.$pinia=o,n.forEach(a=>r.push(a)),n=[]},use(i){return!this._a&&!q$?n.push(i):r.push(i),this},_p:r,_a:null,_e:e,_s:new Map,state:t});return o}const Dx=()=>{};function Tp(e,t,r,n=Dx){e.push(t);const o=()=>{const i=e.indexOf(t);i>-1&&(e.splice(i,1),n())};return!r&&I0()&&EP(o),o}function Sa(e,...t){e.slice().forEach(r=>{r(...t)})}const G$=e=>e();function ff(e,t){e instanceof Map&&t instanceof Map&&t.forEach((r,n)=>e.set(n,r)),e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const r in t){if(!t.hasOwnProperty(r))continue;const n=t[r],o=e[r];uf(o)&&uf(n)&&e.hasOwnProperty(r)&&!Er(n)&&!Io(n)?e[r]=ff(o,n):e[r]=n}return e}const X$=Symbol();function Z$(e){return!uf(e)||!e.hasOwnProperty(X$)}const{assign:ri}=Object;function Q$(e){return!!(Er(e)&&e.effect)}function J$(e,t,r,n){const{state:o,actions:i,getters:a}=t,l=r.state.value[e];let s;function d(){l||(r.state.value[e]=o?o():{});const u=lT(r.state.value[e]);return ri(u,i,Object.keys(a||{}).reduce((f,h)=>(f[h]=qa(P(()=>{bc(r);const g=r._s.get(e);return a[h].call(g,g)})),f),{}))}return s=Ex(e,d,t,r,n,!0),s}function Ex(e,t,r={},n,o,i){let a;const l=ri({actions:{}},r),s={deep:!0};let d,u,f=[],h=[],g;const v=n.state.value[e];!i&&!v&&(n.state.value[e]={}),D({});let b;function m($){let T;d=u=!1,typeof $=="function"?($(n.state.value[e]),T={type:Fl.patchFunction,storeId:e,events:g}):(ff(n.state.value[e],$),T={type:Fl.patchObject,payload:$,storeId:e,events:g});const z=b=Symbol();Ot().then(()=>{b===z&&(d=!0)}),u=!0,Sa(f,T,n.state.value[e])}const p=i?function(){const{state:T}=r,z=T?T():{};this.$patch(F=>{ri(F,z)})}:Dx;function x(){a.stop(),f=[],h=[],n._s.delete(e)}function S($,T){return function(){bc(n);const z=Array.from(arguments),F=[],_=[];function N(Y){F.push(Y)}function j(Y){_.push(Y)}Sa(h,{args:z,name:$,store:C,after:N,onError:j});let H;try{H=T.apply(this&&this.$id===e?this:C,z)}catch(Y){throw Sa(_,Y),Y}return H instanceof Promise?H.then(Y=>(Sa(F,Y),Y)).catch(Y=>(Sa(_,Y),Promise.reject(Y))):(Sa(F,H),H)}}const y={_p:n,$id:e,$onAction:Tp.bind(null,h),$patch:m,$reset:p,$subscribe($,T={}){const z=Tp(f,$,T.detached,()=>F()),F=a.run(()=>ft(()=>n.state.value[e],_=>{(T.flush==="sync"?u:d)&&$({storeId:e,type:Fl.direct,events:g},_)},ri({},s,T)));return z},$dispose:x},C=Bo(y);n._s.set(e,C);const R=(n._a&&n._a.runWithContext||G$)(()=>n._e.run(()=>(a=M0()).run(t)));for(const $ in R){const T=R[$];if(Er(T)&&!Q$(T)||Io(T))i||(v&&Z$(T)&&(Er(T)?T.value=v[$]:ff(T,v[$])),n.state.value[e][$]=T);else if(typeof T=="function"){const z=S($,T);R[$]=z,l.actions[$]=T}}return ri(C,R),ri(Lt(C),R),Object.defineProperty(C,"$state",{get:()=>n.state.value[e],set:$=>{m(T=>{ri(T,$)})}}),n._p.forEach($=>{ri(C,a.run(()=>$({store:C,app:n._a,pinia:n,options:l})))}),v&&i&&r.hydrate&&r.hydrate(C.$state,v),d=!0,u=!0,C}function e3(e,t,r){let n,o;const i=typeof t=="function";n=e,o=i?r:t;function a(l,s){const d=VT();return l=l||(d?De(Fx,null):null),l&&bc(l),l=Ix,l._s.has(n)||(i?Ex(n,t,o,l):J$(n,o,l)),l._s.get(n)}return a.$id=n,a}let Md=[];const Ax=new WeakMap;function t3(){Md.forEach(e=>e(...Ax.get(e))),Md=[]}function ta(e,...t){Ax.set(e,t),!Md.includes(e)&&Md.push(e)===1&&requestAnimationFrame(t3)}function r3(e){return e.nodeType===9?null:e.parentNode}function Bx(e){if(e===null)return null;const t=r3(e);if(t===null)return null;if(t.nodeType===9)return document.documentElement;if(t.nodeType===1){const{overflow:r,overflowX:n,overflowY:o}=getComputedStyle(t);if(/(auto|scroll|overlay)/.test(r+o+n))return t}return Bx(t)}function gv(e){return typeof e=="string"?document.querySelector(e):typeof e=="function"?e():e}function pr(e,t){let{target:r}=e;for(;r;){if(r.dataset&&r.dataset[t]!==void 0)return!0;r=r.parentElem
`+Object.entries(e).map(r=>t+` ${Ux(r[0])}: ${r[1]};`).join(`
`)+`
`+t+"}":`: ${e};`}function P3(e,t,r){return typeof e=="function"?e({context:t.context,props:r}):e}function Ip(e,t,r,n){if(!t)return"";const o=P3(t,r,n);if(!o)return"";if(typeof o=="string")return`${e} {
${o}
}`;const i=Object.keys(o);if(i.length===0)return r.config.keepEmptyBlock?e+` {
}`:"";const a=e?[e+" {"]:[];return i.forEach(l=>{const s=o[l];if(l==="raw"){a.push(`
`+s+`
`);return}l=Ux(l),s!=null&&a.push(` ${l}${R3(s)}`)}),e&&a.push("}"),a.join(`
`)}function wf(e,t,r){e&&e.forEach(n=>{if(Array.isArray(n))wf(n,t,r);else if(typeof n=="function"){const o=n(t);Array.isArray(o)?wf(o,t,r):o&&r(o)}else n&&r(n)})}function Wx(e,t,r,n,o){const i=e.$;let a="";if(!i||typeof i=="string")Ls(i)?a=i:t.push(i);else if(typeof i=="function"){const d=i({context:n.context,props:o});Ls(d)?a=d:t.push(d)}else if(i.before&&i.before(n.context),!i.$||typeof i.$=="string")Ls(i.$)?a=i.$:t.push(i.$);else if(i.$){const d=i.$({context:n.context,props:o});Ls(d)?a=d:t.push(d)}const l=w3(t),s=Ip(l,e.props,n,o);a?r.push(`${a} {`):s.length&&r.push(s),e.children&&wf(e.children,{context:n.context,props:o},d=>{if(typeof d=="string"){const u=Ip(l,{raw:d},n,o);r.push(u)}else Wx(d,t,r,n,o)}),t.pop(),a&&r.push("}"),i&&i.after&&i.after(n.context)}function T3(e,t,r){const n=[];return Wx(e,[],n,t,r),n.join(`
`)}function Xl(e){for(var t=0,r,n=0,o=e.length;o>=4;++n,o-=4)r=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}typeof window<"u"&&(window.__cssrContext={});function $3(e,t,r,n){const{els:o}=t;if(r===void 0)o.forEach(Mp),t.els=[];else{const i=xc(r,n);i&&o.includes(i)&&(Mp(i),t.els=o.filter(a=>a!==i))}}function Fp(e,t){e.push(t)}function z3(e,t,r,n,o,i,a,l,s){let d;if(r===void 0&&(d=t.render(n),r=Xl(d)),s){s.adapter(r,d??t.render(n));return}l===void 0&&(l=document.head);const u=xc(r,l);if(u!==null&&!i)return u;const f=u??S3(r);if(d===void 0&&(d=t.render(n)),f.textContent=d,u!==null)return u;if(a){const h=l.querySelector(`meta[name="${a}"]`);if(h)return l.insertBefore(f,h),Fp(t.els,f),f}return o?l.insertBefore(f,l.querySelector("style, link")):l.appendChild(f),Fp(t.els,f),f}function O3(e){return T3(this,this.instance,e)}function _3(e={}){const{id:t,ssr:r,props:n,head:o=!1,force:i=!1,anchorMetaName:a,parent:l}=e;return z3(this.instance,this,t,n,o,i,a,l,r)}function M3(e={}){const{id:t,parent:r}=e;$3(this.instance,this,t,r)}const Hs=function(e,t,r,n){return{instance:e,$:t,props:r,children:n,els:[],render:O3,mount:_3,unmount:M3}},I3=function(e,t,r,n){return Array.isArray(t)?Hs(e,{$:null},null,t):Array.isArray(r)?Hs(e,t,null,r):Array.isArray(n)?Hs(e,t,r,n):Hs(e,t,r,null)};function Kx(e={}){const t={c:(...r)=>I3(t,...r),use:(r,...n)=>r.install(t,...n),find:xc,context:{},config:e};return t}function F3(e,t){if(e===void 0)return!1;if(t){const{context:{ids:r}}=t;return r.has(e)}return xc(e)!==null}function D3(e){let t=".",r="__",n="--",o;if(e){let v=e.blockPrefix;v&&(t=v),v=e.elementPrefix,v&&(r=v),v=e.modifierPrefix,v&&(n=v)}const i={install(v){o=v.c;const b=v.context;b.bem={},b.bem.b=null,b.bem.els=null}};function a(v){let b,m;return{before(p){b=p.bem.b,m=p.bem.els,p.bem.els=null},after(p){p.bem.b=b,p.bem.els=m},$({context:p,props:x}){return v=typeof v=="string"?v:v({context:p,props:x}),p.bem.b=v,`${(x==null?void 0:x.bPrefix)||t}${p.bem.b}`}}}function l(v){let b;return{before(m){b=m.bem.els},after(m){m.bem.els=b},$({context:m,props:p}){return v=typeof v=="string"?v:v({context:m,props:p}),m.bem.els=v.split(",").map(x=>x.trim()),m.bem.els.map(x=>`${(p==null?void 0:p.bPrefix)||t}${m.bem.b}${r}${x}`).join(", ")}}}function s(v){return{$({context:b,props:m}){v=typeof v=="string"?v:v({context:b,props:m});const p=v.split(",").map(y=>y.trim());function x(y){return p.map(C=>`&${(m==null?void 0:m.bPrefix)||t}${b.bem.b}${y!==void 0?`${r}${y}`:""}${n}${C}`).join(", ")}const S=b.bem.els;return S!==null?x(S[0]):x()}}}function d(v){return{$({context:b,props:m}){v=typeof v=="string"?v:v({context:b,props:m});const p=b.bem.els;return`&:not(${(m==null?void 0:m.bPrefix)||t}${b.bem.b}${p!==null&&p.length>0?`${r}${p[0]}`:""}${n}${v})`}}}return Object.assign(i,{cB:(...v)=>o(a(v[0]),v[1],v[2]),cE:(...v)=>o(l(v[0]),v[1],v[2]),cM:(...v)=>o(s(v[0]),v[1],v[2]),cNotM:(...v)=>o(d(v[0]),v[1],v[2])}),i}const E3="n",Zl=`.${E3}-`,A3="__",B3="--",qx=Kx(),Yx=D3({blockPrefix:Zl,elementPrefix:A3,modifierPrefix:B3});qx.use(Yx);const{c:O,find:FK}=qx,{cB:w,cE:M,cM:I,cNotM:xt}=Yx;function So(e){return O(({props:{bPrefix:t}})=>`${t||Zl}modal, ${t||Zl}drawer`,[e])}function jo(e){return O(({props:{bPrefix:t}})=>`${t||Zl}popover`,[e])}function Gx(e){return O(({props:{bPrefix:t}})=>`&${t||Zl}modal`,e)}const N3=(...e)=>O(">",[w(...e)]);function Ce(e,t){return e+(t==="default"?"":t.replace(/^[a-z]/,r=>r.toUpperCase()))}let du;function L3(){return du===void 0&&(du=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),du}const dn=typeof document<"u"&&typeof window<"u",Xx=new WeakSet;function na(e){Xx.add(e)}function Zx(
${t}
</style>`}function cz(e,t,r){const{styles:n,ids:o}=r;o.has(e)||n!==null&&(o.add(e),n.push(dz(e,t)))}const uz=typeof document<"u";function Ti(){if(uz)return;const e=De(sz,null);if(e!==null)return{adapter:(t,r)=>cz(t,r,e),context:e}}function Hp(e,t){console.error(`[vueuc/${e}]: ${t}`)}const{c:fo}=Kx(),wc="vueuc-style";function jp(e){return e&-e}class fz{constructor(t,r){this.l=t,this.min=r;const n=new Array(t+1);for(let o=0;o<t+1;++o)n[o]=0;this.ft=n}add(t,r){if(r===0)return;const{l:n,ft:o}=this;for(t+=1;t<=n;)o[t]+=r,t+=jp(t)}get(t){return this.sum(t+1)-this.sum(t)}sum(t){if(t===void 0&&(t=this.l),t<=0)return 0;const{ft:r,min:n,l:o}=this;if(t>o)throw new Error("[FinweckTree.sum]: `i` is larger than length.");let i=t*n;for(;t>0;)i+=r[t],t-=jp(t);return i}getBound(t){let r=0,n=this.l;for(;n>r;){const o=Math.floor((r+n)/2),i=this.sum(o);if(i>t){n=o;continue}else if(i<t){if(r===o)return this.sum(r+1)<=t?r+1:o;r=o}else return o}return r}}function Vp(e){return typeof e=="string"?document.querySelector(e):e()}const bs=re({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(e){return{showTeleport:Qx(ve(e,"show")),mergedTo:P(()=>{const{to:t}=e;return t??"body"})}},render(){return this.showTeleport?this.disabled?Sf("lazy-teleport",this.$slots):c(cs,{disabled:this.disabled,to:this.mergedTo},Sf("lazy-teleport",this.$slots)):null}}),Us={top:"bottom",bottom:"top",left:"right",right:"left"},Up={start:"end",center:"center",end:"start"},fu={top:"height",bottom:"height",left:"width",right:"width"},hz={"bottom-start":"top left",bottom:"top center","bottom-end":"top right","top-start":"bottom left",top:"bottom center","top-end":"bottom right","right-start":"top left",right:"center left","right-end":"bottom left","left-start":"top right",left:"center right","left-end":"bottom right"},vz={"bottom-start":"bottom left",bottom:"bottom center","bottom-end":"bottom right","top-start":"top left",top:"top center","top-end":"top right","right-start":"top right",right:"center right","right-end":"bottom right","left-start":"top left",left:"center left","left-end":"bottom left"},gz={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},Wp={top:!0,bottom:!1,left:!0,right:!1},Kp={top:"end",bottom:"start",left:"end",right:"start"};function pz(e,t,r,n,o,i){if(!o||i)return{placement:e,top:0,left:0};const[a,l]=e.split("-");let s=l??"center",d={top:0,left:0};const u=(g,v,b)=>{let m=0,p=0;const x=r[g]-t[v]-t[g];return x>0&&n&&(b?p=Wp[v]?x:-x:m=Wp[v]?x:-x),{left:m,top:p}},f=a==="left"||a==="right";if(s!=="center"){const g=gz[e],v=Us[g],b=fu[g];if(r[b]>t[b]){if(t[g]+t[b]<r[b]){const m=(r[b]-t[b])/2;t[g]<m||t[v]<m?t[g]<t[v]?(s=Up[l],d=u(b,v,f)):d=u(b,g,f):s="center"}}else r[b]<t[b]&&t[v]<0&&t[g]>t[v]&&(s=Up[l])}else{const g=a==="bottom"||a==="top"?"left":"top",v=Us[g],b=fu[g],m=(r[b]-t[b])/2;(t[g]<m||t[v]<m)&&(t[g]>t[v]?(s=Kp[g],d=u(b,g,f)):(s=Kp[v],d=u(b,v,f)))}let h=a;return t[a]<r[fu[a]]&&t[a]<t[Us[a]]&&(h=Us[a]),{placement:s!=="center"?`${h}-${s}`:h,left:d.left,top:d.top}}function mz(e,t){return t?vz[e]:hz[e]}function bz(e,t,r,n,o,i){if(i)switch(e){case"bottom-start":return{top:`${Math.round(r.top-t.top+r.height)}px`,left:`${Math.round(r.left-t.left)}px`,transform:"translateY(-100%)"};case"bottom-end":return{top:`${Math.round(r.top-t.top+r.height)}px`,left:`${Math.round(r.left-t.left+r.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top-start":return{top:`${Math.round(r.top-t.top)}px`,left:`${Math.round(r.left-t.left)}px`,transform:""};case"top-end":return{top:`${Math.round(r.top-t.top)}px`,left:`${Math.round(r.left-t.left+r.width)}px`,transform:"translateX(-100%)"};case"right-start":return{top:`${Math.round(r.top-t.top)}px`,left:`${Math.round(r.left-t.left+r.width)}px`,transform:"translateX(-100%)"};case"right-end":return{top:`${Math.round(r.top-t.top+r.height)}px`,left:`${Math.round(r.left-t.left+r.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"lef
margin: 0;
font-size: ${SI};
font-family: ${kI};
line-height: ${RI};
-webkit-text-size-adjust: 100%;
-webkit-tap-highlight-color: transparent;
`,[O("input",`
font-family: inherit;
font-size: inherit;
`)]),In="n-config-provider",Xa="naive-ui-style";function ye(e,t,r,n,o,i){const a=Ti(),l=De(In,null);if(r){const d=()=>{const u=i==null?void 0:i.value;r.mount({id:u===void 0?t:u+t,head:!0,props:{bPrefix:u?`.${u}-`:void 0},anchorMetaName:Xa,ssr:a}),l!=null&&l.preflightStyleDisabled||l1.mount({id:"n-global",head:!0,anchorMetaName:Xa,ssr:a})};a?d():Lo(d)}return P(()=>{var d;const{theme:{common:u,self:f,peers:h={}}={},themeOverrides:g={},builtinThemeOverrides:v={}}=o,{common:b,peers:m}=g,{common:p=void 0,[e]:{common:x=void 0,self:S=void 0,peers:y={}}={}}=(l==null?void 0:l.mergedThemeRef.value)||{},{common:C=void 0,[e]:k={}}=(l==null?void 0:l.mergedThemeOverridesRef.value)||{},{common:R,peers:$={}}=k,T=Ba({},u||x||p||n.common,C,R,b),z=Ba((d=f||S||n.self)===null||d===void 0?void 0:d(T),v,k,g);return{common:T,self:z,peers:Ba({},n.peers,y,h),peerOverrides:Ba({},v.peers,$,m)}})}ye.props={theme:Object,themeOverrides:Object,builtinThemeOverrides:Object};const rs="n";function Ne(e={},t={defaultBordered:!0}){const r=De(In,null);return{inlineThemeDisabled:r==null?void 0:r.inlineThemeDisabled,mergedRtlRef:r==null?void 0:r.mergedRtlRef,mergedComponentPropsRef:r==null?void 0:r.mergedComponentPropsRef,mergedBreakpointsRef:r==null?void 0:r.mergedBreakpointsRef,mergedBorderedRef:P(()=>{var n,o;const{bordered:i}=e;return i!==void 0?i:(o=(n=r==null?void 0:r.mergedBorderedRef.value)!==null&&n!==void 0?n:t.defaultBordered)!==null&&o!==void 0?o:!0}),mergedClsPrefixRef:r?r.mergedClsPrefixRef:q0(rs),namespaceRef:P(()=>r==null?void 0:r.mergedNamespaceRef.value)}}function s1(){const e=De(In,null);return e?e.mergedClsPrefixRef:q0(rs)}const PI={name:"en-US",global:{undo:"Undo",redo:"Redo",confirm:"Confirm",clear:"Clear"},Popconfirm:{positiveText:"Confirm",negativeText:"Cancel"},Cascader:{placeholder:"Please Select",loading:"Loading",loadingRequiredMessage:e=>`Please load all ${e}'s descendants before checking it.`},Time:{dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss"},DatePicker:{yearFormat:"yyyy",monthFormat:"MMM",dayFormat:"eeeeee",yearTypeFormat:"yyyy",monthTypeFormat:"yyyy-MM",dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss",quarterFormat:"yyyy-qqq",weekFormat:"yyyy-w",clear:"Clear",now:"Now",confirm:"Confirm",selectTime:"Select Time",selectDate:"Select Date",datePlaceholder:"Select Date",datetimePlaceholder:"Select Date and Time",monthPlaceholder:"Select Month",yearPlaceholder:"Select Year",quarterPlaceholder:"Select Quarter",weekPlaceholder:"Select Week",startDatePlaceholder:"Start Date",endDatePlaceholder:"End Date",startDatetimePlaceholder:"Start Date and Time",endDatetimePlaceholder:"End Date and Time",startMonthPlaceholder:"Start Month",endMonthPlaceholder:"End Month",monthBeforeYear:!0,firstDayOfWeek:6,today:"Today"},DataTable:{checkTableAll:"Select all in the table",uncheckTableAll:"Unselect all in the table",confirm:"Confirm",clear:"Clear"},LegacyTransfer:{sourceTitle:"Source",targetTitle:"Target"},Transfer:{selectAll:"Select all",unselectAll:"Unselect all",clearAll:"Clear",total:e=>`Total ${e} items`,selected:e=>`${e} items selected`},Empty:{description:"No Data"},Select:{placeholder:"Please Select"},TimePicker:{placeholder:"Select Time",positiveText:"OK",negativeText:"Cancel",now:"Now",clear:"Clear"},Pagination:{goto:"Goto",selectionSuffix:"page"},DynamicTags:{add:"Add"},Log:{loading:"Loading"},Input:{placeholder:"Please Input"},InputNumber:{placeholder:"Please Input"},DynamicInput:{create:"Create"},ThemeEditor:{title:"Theme Editor",clearAllVars:"Clear All Variables",clearSearch:"Clear Search",filterCompName:"Filter Component Name",filterVarName:"Filter Variable Name",import:"Import",export:"Export",restore:"Reset to Default"},Image:{tipPrevious:"Previous picture (←)",tipNext:"Next picture (→)",tipCounterclockwise:"Counterclockwise",tipClockwise:"Clockwise",tipZoomOut:"Zoom out",tipZoomIn:"Zoom in",tipDownload:"Download",tipClose:"Close (Esc)",tipOriginalSize:"Zoom to original size"}};function yu(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.width?String(t.width):
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,a=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var d=r.next();return a=d.done,d},e:function(d){l=!0,i=d},f:function(){try{a||r.return==null||r.return()}finally{if(l)throw i}}}}function bt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Nf(e,t){return Nf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Nf(e,t)}function Qt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Nf(e,t)}function Gd(e){return Gd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Gd(e)}function p1(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(p1=function(){return!!e})()}function NF(e,t){if(t&&(yo(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return bt(e)}function Jt(e){var t=p1();return function(){var r,n=Gd(e);if(t){var o=Gd(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return NF(this,r)}}function qt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function LF(e,t){if(yo(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(yo(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function m1(e){var t=LF(e,"string");return yo(t)=="symbol"?t:t+""}function HF(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,m1(n.key),n)}}function Yt(e,t,r){return t&&HF(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function vt(e,t,r){return(t=m1(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var jF=10,b1=function(){function e(){qt(this,e),vt(this,"priority",void 0),vt(this,"subPriority",0)}return Yt(e,[{key:"validate",value:function(r,n){return!0}}]),e}(),VF=function(e){Qt(r,e);var t=Jt(r);function r(n,o,i,a,l){var s;return qt(this,r),s=t.call(this),s.value=n,s.validateValue=o,s.setValue=i,s.priority=a,l&&(s.subPriority=l),s}return Yt(r,[{key:"validate",value:function(o,i){return this.validateValue(o,this.value,i)}},{key:"set",value:function(o,i,a){return this.setValue(o,i,this.value,a)}}]),r}(b1),UF=function(e){Qt(r,e);var t=Jt(r);function r(){var n;qt(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),vt(bt(n),"priority",jF),vt(bt(n),"subPriority",-1),n}return Yt(r,[{key:"set",value:function(o,i){if(i.timestampIsSet)return o;var a=new Date(0);return a.setFullYear(o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate()),a.setHours(o.getUTCHours(),o.getUTCMinutes(),o.getUTCSeconds(),o.getUTCMilliseconds()),a}}]),r}(b1),ir=function(){function e(){qt(this,e),vt(this,"incompatibleTokens",void 0),vt(this,"priority",void 0),vt(this,"subPriority",void 0)}return Yt(e,[{key:"run",value:function(r,n,o,i){var a=this.parse(r,n,o,i);return a?{setter:new VF(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}},{key:"validate",value:function(r,n,o){return!0}}]),e}(),WF=function(e){Qt(r,e);var t=Jt(r);function r(){var n;qt(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),vt(bt(n),"priority",140),vt(bt(n),"incompatibleTokens",["R","u","t","T"]),n}return Yt(r,[{key:"parse",value:function(o,i,a){switch(i){case"G":case"GG":case"GGG":return a.era(o,{width:"abbreviated"})||a.era(o,{width:"narrow"});case"GGGGG":return a.era(o,{width:"narrow"});case"GGGG
fill: none;
stroke: currentColor;
stroke-linecap: round;
stroke-linejoin: round;
stroke-width: 32px;
`}))}}),O1=re({name:"Search",render(){return c("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",style:"enable-background: new 0 0 512 512"},c("path",{d:`M443.5,420.2L336.7,312.4c20.9-26.2,33.5-59.4,33.5-95.5c0-84.5-68.5-153-153.1-153S64,132.5,64,217s68.5,153,153.1,153
c36.6,0,70.1-12.8,96.5-34.2l106.1,107.1c3.2,3.4,7.6,5.1,11.9,5.1c4.1,0,8.2-1.5,11.3-4.5C449.5,437.2,449.7,426.8,443.5,420.2z
M217.1,337.1c-32.1,0-62.3-12.5-85-35.2c-22.7-22.7-35.2-52.9-35.2-84.9c0-32.1,12.5-62.3,35.2-84.9c22.7-22.7,52.9-35.2,85-35.2
c32.1,0,62.3,12.5,85,35.2c22.7,22.7,35.2,52.9,35.2,84.9c0,32.1-12.5,62.3-35.2,84.9C279.4,324.6,249.2,337.1,217.1,337.1z`}))}}),pa=Gr("success",c("svg",{viewBox:"0 0 48 48",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},c("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},c("g",{"fill-rule":"nonzero"},c("path",{d:"M24,4 C35.045695,4 44,12.954305 44,24 C44,35.045695 35.045695,44 24,44 C12.954305,44 4,35.045695 4,24 C4,12.954305 12.954305,4 24,4 Z M32.6338835,17.6161165 C32.1782718,17.1605048 31.4584514,17.1301307 30.9676119,17.5249942 L30.8661165,17.6161165 L20.75,27.732233 L17.1338835,24.1161165 C16.6457281,23.6279612 15.8542719,23.6279612 15.3661165,24.1161165 C14.9105048,24.5717282 14.8801307,25.2915486 15.2749942,25.7823881 L15.3661165,25.8838835 L19.8661165,30.3838835 C20.3217282,30.8394952 21.0415486,30.8698693 21.5323881,30.4750058 L21.6338835,30.3838835 L32.6338835,19.3838835 C33.1220388,18.8957281 33.1220388,18.1042719 32.6338835,17.6161165 Z"}))))),GD=re({name:"Switcher",render(){return c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},c("path",{d:"M12 8l10 8l-10 8z"}))}}),XD=Gr("time",c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},c("path",{d:"M256,64C150,64,64,150,64,256s86,192,192,192,192-86,192-192S362,64,256,64Z",style:`
fill: none;
stroke: currentColor;
stroke-miterlimit: 10;
stroke-width: 32px;
`}),c("polyline",{points:"256 128 256 272 352 272",style:`
fill: none;
stroke: currentColor;
stroke-linecap: round;
stroke-linejoin: round;
stroke-width: 32px;
`}))),zi=Gr("warning",c("svg",{viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},c("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},c("g",{"fill-rule":"nonzero"},c("path",{d:"M12,2 C17.523,2 22,6.478 22,12 C22,17.522 17.523,22 12,22 C6.477,22 2,17.522 2,12 C2,6.478 6.477,2 12,2 Z M12.0018002,15.0037242 C11.450254,15.0037242 11.0031376,15.4508407 11.0031376,16.0023869 C11.0031376,16.553933 11.450254,17.0010495 12.0018002,17.0010495 C12.5533463,17.0010495 13.0004628,16.553933 13.0004628,16.0023869 C13.0004628,15.4508407 12.5533463,15.0037242 12.0018002,15.0037242 Z M11.99964,7 C11.4868042,7.00018474 11.0642719,7.38637706 11.0066858,7.8837365 L11,8.00036004 L11.0018003,13.0012393 L11.00857,13.117858 C11.0665141,13.6151758 11.4893244,14.0010638 12.0021602,14.0008793 C12.514996,14.0006946 12.9375283,13.6145023 12.9951144,13.1171428 L13.0018002,13.0005193 L13,7.99964009 L12.9932303,7.8830214 C12.9352861,7.38570354 12.5124758,6.99981552 11.99964,7 Z"}))))),ZD=Gr("cancel",c("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},c("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},c("g",{fill:"currentColor","fill-rule":"nonzero"},c("path",{d:"M2.58859116,2.7156945 L2.64644661,2.64644661 C2.82001296,2.47288026 3.08943736,2.45359511 3.2843055,2.58859116 L3.35355339,2.64644661 L8,7.293 L12.6464466,2.64644661 C12.8417088,2.45118446 13.1582912,2.45118446 13.3535534,2.64644661 C13.5488155,2.84170876 13.5488155,3.15829124 13.3535534,3.35355339 L8.707,8 L13.3535534,12.6464466 C13.5271197,12.820013 13.5464049,13.0894374 13.4114088,13.2843055 L13.3535534,13.3535534 C13.179987,13.5271197 12.9105626,13.5464049 12.7156945,13.4114088 L12.6464466,13.3535534 L8,8.707 L3.35355339,13.3535534 C3.15829124,13.5488155 2.84170876,13.5488155 2.64644661,13.3535534 C2.45118446,13.1582912 2.45118446,12.8417088 2.64644661,12.6464466 L7.293,8 L2.64644661,3.35355339 C2.47288026,3.17998704 2.45359511,2.91056264 2.58859116,2.7156945 L2.64644661,2.64644661 L2.58859116,2.7156945 Z"}))))),_1=re({name:"ChevronDown",render(){return c("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},c("path",{d:"M3.14645 5.64645C3.34171 5.45118 3.65829 5.45118 3.85355 5.64645L8 9.79289L12.1464 5.64645C12.3417 5.45118 12.6583 5.45118 12.8536 5.64645C13.0488 5.84171 13.0488 6.15829 12.8536 6.35355L8.35355 10.8536C8.15829 11.0488 7.84171 11.0488 7.64645 10.8536L3.14645 6.35355C2.95118 6.15829 2.95118 5.84171 3.14645 5.64645Z",fill:"currentColor"}))}}),QD=Gr("clear",c("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},c("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},c("g",{fill:"currentColor","fill-rule":"nonzero"},c("path",{d:"M8,2 C11.3137085,2 14,4.6862915 14,8 C14,11.3137085 11.3137085,14 8,14 C4.6862915,14 2,11.3137085 2,8 C2,4.6862915 4.6862915,2 8,2 Z M6.5343055,5.83859116 C6.33943736,5.70359511 6.07001296,5.72288026 5.89644661,5.89644661 L5.89644661,5.89644661 L5.83859116,5.9656945 C5.70359511,6.16056264 5.72288026,6.42998704 5.89644661,6.60355339 L5.89644661,6.60355339 L7.293,8 L5.89644661,9.39644661 L5.83859116,9.4656945 C5.70359511,9.66056264 5.72288026,9.92998704 5.89644661,10.1035534 L5.89644661,10.1035534 L5.9656945,10.1614088 C6.16056264,10.2964049 6.42998704,10.2771197 6.60355339,10.1035534 L6.60355339,10.1035534 L8,8.707 L9.39644661,10.1035534 L9.4656945,10.1614088 C9.66056264,10.2964049 9.92998704,10.2771197 10.1035534,10.1035534 L10.1035534,10.1035534 L10.1614088,10.0343055 C10.2964049,9.83943736 10.2771197,9.57001296 10.1035534,9.39644661 L10.1035534,9.39644661 L8.707,8 L10.1035534,6.60355339 L10.1614088,6.5343055 C10.2964049,6.33943736 10.2771197,6.07001296 10.1035534,5.89644661 L10.1035534,5.89644661 L10.0343055,5.83859116 C9.83943736,5.70359511 9.57001296,5.72288026 9.39644661,5.89644661 L9.39644661,5.89644661 L8,7.293 L6.60355339,5.89644661 Z"}))))),JD=re({name:"ChevronDownFilled",render(){return c("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},c("path",{d:"M3.20041 5.73966C3.48
height: 1em;
width: 1em;
line-height: 1em;
text-align: center;
display: inline-block;
position: relative;
fill: currentColor;
transform: translateZ(0);
`,[O("svg",`
height: 1em;
width: 1em;
`)]),ut=re({name:"BaseIcon",props:{role:String,ariaLabel:String,ariaDisabled:{type:Boolean,default:void 0},ariaHidden:{type:Boolean,default:void 0},clsPrefix:{type:String,required:!0},onClick:Function,onMousedown:Function,onMouseup:Function},setup(e){Fn("-base-icon",s6,ve(e,"clsPrefix"))},render(){return c("i",{class:`${this.clsPrefix}-base-icon`,onClick:this.onClick,onMousedown:this.onMousedown,onMouseup:this.onMouseup,role:this.role,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,"aria-disabled":this.ariaDisabled},this.$slots)}}),d6=w("base-close",`
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
background-color: transparent;
color: var(--n-close-icon-color);
border-radius: var(--n-close-border-radius);
height: var(--n-close-size);
width: var(--n-close-size);
font-size: var(--n-close-icon-size);
outline: none;
border: none;
position: relative;
padding: 0;
`,[I("absolute",`
height: var(--n-close-icon-size);
width: var(--n-close-icon-size);
`),O("&::before",`
content: "";
position: absolute;
width: var(--n-close-size);
height: var(--n-close-size);
left: 50%;
top: 50%;
transform: translateY(-50%) translateX(-50%);
transition: inherit;
border-radius: inherit;
`),xt("disabled",[O("&:hover",`
color: var(--n-close-icon-color-hover);
`),O("&:hover::before",`
background-color: var(--n-close-color-hover);
`),O("&:focus::before",`
background-color: var(--n-close-color-hover);
`),O("&:active",`
color: var(--n-close-icon-color-pressed);
`),O("&:active::before",`
background-color: var(--n-close-color-pressed);
`)]),I("disabled",`
cursor: not-allowed;
color: var(--n-close-icon-color-disabled);
background-color: transparent;
`),I("round",[O("&::before",`
border-radius: 50%;
`)])]),Wo=re({name:"BaseClose",props:{isButtonTag:{type:Boolean,default:!0},clsPrefix:{type:String,required:!0},disabled:{type:Boolean,default:void 0},focusable:{type:Boolean,default:!0},round:Boolean,onClick:Function,absolute:Boolean},setup(e){return Fn("-base-close",d6,ve(e,"clsPrefix")),()=>{const{clsPrefix:t,disabled:r,absolute:n,round:o,isButtonTag:i}=e;return c(i?"button":"div",{type:i?"button":void 0,tabindex:r||!e.focusable?-1:0,"aria-disabled":r,"aria-label":"close",role:i?void 0:"button",disabled:r,class:[`${t}-base-close`,n&&`${t}-base-close--absolute`,r&&`${t}-base-close--disabled`,o&&`${t}-base-close--round`],onMousedown:l=>{e.focusable||l.preventDefault()},onClick:e.onClick},c(ut,{clsPrefix:t},{default:()=>c(Xv,null)}))}}}),Po=re({props:{onFocus:Function,onBlur:Function},setup(e){return()=>c("div",{style:"width: 0; height: 0",tabindex:0,onFocus:e.onFocus,onBlur:e.onBlur})}}),{cubicBezierEaseInOut:c6}=xn;function qr({originalTransform:e="",left:t=0,top:r=0,transition:n=`all .3s ${c6} !important`}={}){return[O("&.icon-switch-transition-enter-from, &.icon-switch-transition-leave-to",{transform:e+" scale(0.75)",left:t,top:r,opacity:0}),O("&.icon-switch-transition-enter-to, &.icon-switch-transition-leave-from",{transform:`scale(1) ${e}`,left:t,top:r,opacity:1}),O("&.icon-switch-transition-enter-active, &.icon-switch-transition-leave-active",{transformOrigin:"center",position:"absolute",left:t,top:r,transition:n})]}const u6=O([O("@keyframes rotator",`
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}`),w("base-loading",`
position: relative;
line-height: 0;
width: 1em;
height: 1em;
`,[M("transition-wrapper",`
position: absolute;
width: 100%;
height: 100%;
`,[qr()]),M("placeholder",`
position: absolute;
left: 50%;
top: 50%;
transform: translateX(-50%) translateY(-50%);
`,[qr({left:"50%",top:"50%",originalTransform:"translateX(-50%) translateY(-50%)"})]),M("container",`
animation: rotator 3s linear infinite both;
`,[M("icon",`
height: 1em;
width: 1em;
`)])])]),Su="1.6s",f6={strokeWidth:{type:Number,default:28},stroke:{type:String,default:void 0}},to=re({name:"BaseLoading",props:Object.assign({clsPrefix:{type:String,required:!0},show:{type:Boolean,default:!0},scale:{type:Number,default:1},radius:{type:Number,default:100}},f6),setup(e){Fn("-base-loading",u6,ve(e,"clsPrefix"))},render(){const{clsPrefix:e,radius:t,strokeWidth:r,stroke:n,scale:o}=this,i=t/o;return c("div",{class:`${e}-base-loading`,role:"img","aria-label":"loading"},c(ko,null,{default:()=>this.show?c("div",{key:"icon",class:`${e}-base-loading__transition-wrapper`},c("div",{class:`${e}-base-loading__container`},c("svg",{class:`${e}-base-loading__icon`,viewBox:`0 0 ${2*i} ${2*i}`,xmlns:"http://www.w3.org/2000/svg",style:{color:n}},c("g",null,c("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${i} ${i};270 ${i} ${i}`,begin:"0s",dur:Su,fill:"freeze",repeatCount:"indefinite"}),c("circle",{class:`${e}-base-loading__icon`,fill:"none",stroke:"currentColor","stroke-width":r,"stroke-linecap":"round",cx:i,cy:i,r:t-r/2,"stroke-dasharray":5.67*t,"stroke-dashoffset":18.48*t},c("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${i} ${i};135 ${i} ${i};450 ${i} ${i}`,begin:"0s",dur:Su,fill:"freeze",repeatCount:"indefinite"}),c("animate",{attributeName:"stroke-dashoffset",values:`${5.67*t};${1.42*t};${5.67*t}`,begin:"0s",dur:Su,fill:"freeze",repeatCount:"indefinite"})))))):c("div",{key:"placeholder",class:`${e}-base-loading__placeholder`},this.$slots)}))}});function Jm(e){return Array.isArray(e)?e:[e]}const Lf={STOP:"STOP"};function M1(e,t){const r=t(e);e.children!==void 0&&r!==Lf.STOP&&e.children.forEach(n=>M1(n,t))}function h6(e,t={}){const{preserveGroup:r=!1}=t,n=[],o=r?a=>{a.isLeaf||(n.push(a.key),i(a.children))}:a=>{a.isLeaf||(a.isGroup||n.push(a.key),i(a.children))};function i(a){a.forEach(o)}return i(e),n}function v6(e,t){const{isLeaf:r}=e;return r!==void 0?r:!t(e)}function g6(e){return e.children}function p6(e){return e.key}function m6(){return!1}function b6(e,t){const{isLeaf:r}=e;return!(r===!1&&!Array.isArray(t(e)))}function x6(e){return e.disabled===!0}function y6(e,t){return e.isLeaf===!1&&!Array.isArray(t(e))}function ku(e){var t;return e==null?[]:Array.isArray(e)?e:(t=e.checkedKeys)!==null&&t!==void 0?t:[]}function Ru(e){var t;return e==null||Array.isArray(e)?[]:(t=e.indeterminateKeys)!==null&&t!==void 0?t:[]}function C6(e,t){const r=new Set(e);return t.forEach(n=>{r.has(n)||r.add(n)}),Array.from(r)}function w6(e,t){const r=new Set(e);return t.forEach(n=>{r.has(n)&&r.delete(n)}),Array.from(r)}function S6(e){return(e==null?void 0:e.type)==="group"}function I1(e){const t=new Map;return e.forEach((r,n)=>{t.set(r.key,n)}),r=>{var n;return(n=t.get(r))!==null&&n!==void 0?n:null}}class F1 extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function k6(e,t,r,n){return Zd(t.concat(e),r,n,!1)}function R6(e,t){const r=new Set;return e.forEach(n=>{const o=t.treeNodeMap.get(n);if(o!==void 0){let i=o.parent;for(;i!==null&&!(i.disabled||r.has(i.key));)r.add(i.key),i=i.parent}}),r}function P6(e,t,r,n){const o=Zd(t,r,n,!1),i=Zd(e,r,n,!0),a=R6(e,r),l=[];return o.forEach(s=>{(i.has(s)||a.has(s))&&l.push(s)}),l.forEach(s=>o.delete(s)),o}function Pu(e,t){const{checkedKeys:r,keysToCheck:n,keysToUncheck:o,indeterminateKeys:i,cascade:a,leafOnly:l,checkStrategy:s,allowNotLoaded:d}=e;if(!a)return n!==void 0?{checkedKeys:C6(r,n),indeterminateKeys:Array.from(i)}:o!==void 0?{checkedKeys:w6(r,o),indeterminateKeys:Array.from(i)}:{checkedKeys:Array.from(r),indeterminateKeys:Array.from(i)};const{levelTreeNodeMap:u}=t;let f;o!==void 0?f=P6(o,r,t,d):n!==void 0?f=k6(n,r,t,d):f=Zd(r,t,d,!1);const h=s==="parent",g=s==="child"||l,v=f,b=new Set,m=Math.max.apply(null,Array.from(u.keys()));for(let p=m;p>=0;p-=1){const x=p===0,S=u.get(p);for(const y of S){if(y.isLeaf)continue;const{key:C,shallowLoaded:k}=y;if(g&&k&&y.children.forEach(z=>{!z.disabled&&!z.isLeaf&&z.shallowLoaded&&v.has(z.key)&&v.delete(z.key)}),y.disabled||!k)co
display: flex;
flex-direction: column;
align-items: center;
font-size: var(--n-font-size);
`,[M("icon",`
width: var(--n-icon-size);
height: var(--n-icon-size);
font-size: var(--n-icon-size);
line-height: var(--n-icon-size);
color: var(--n-icon-color);
transition:
color .3s var(--n-bezier);
`,[O("+",[M("description",`
margin-top: 8px;
`)])]),M("description",`
transition: color .3s var(--n-bezier);
color: var(--n-text-color);
`),M("extra",`
text-align: center;
transition: color .3s var(--n-bezier);
margin-top: 12px;
color: var(--n-extra-text-color);
`)]),N1=Object.assign(Object.assign({},ye.props),{description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:"medium"},renderIcon:Function}),Do=re({name:"Empty",props:N1,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:r}=Ne(e),n=ye("Empty","-empty",L6,Ko,e,t),{localeRef:o}=mr("Empty"),i=De(In,null),a=P(()=>{var u,f,h;return(u=e.description)!==null&&u!==void 0?u:(h=(f=i==null?void 0:i.mergedComponentPropsRef.value)===null||f===void 0?void 0:f.Empty)===null||h===void 0?void 0:h.description}),l=P(()=>{var u,f;return((f=(u=i==null?void 0:i.mergedComponentPropsRef.value)===null||u===void 0?void 0:u.Empty)===null||f===void 0?void 0:f.renderIcon)||(()=>c(qD,null))}),s=P(()=>{const{size:u}=e,{common:{cubicBezierEaseInOut:f},self:{[Ce("iconSize",u)]:h,[Ce("fontSize",u)]:g,textColor:v,iconColor:b,extraTextColor:m}}=n.value;return{"--n-icon-size":h,"--n-font-size":g,"--n-bezier":f,"--n-text-color":v,"--n-icon-color":b,"--n-extra-text-color":m}}),d=r?Qe("empty",P(()=>{let u="";const{size:f}=e;return u+=f[0],u}),s,e):void 0;return{mergedClsPrefix:t,mergedRenderIcon:l,localizedDescription:P(()=>a.value||o.value.description),cssVars:r?void 0:s,themeClass:d==null?void 0:d.themeClass,onRender:d==null?void 0:d.onRender}},render(){const{$slots:e,mergedClsPrefix:t,onRender:r}=this;return r==null||r(),c("div",{class:[`${t}-empty`,this.themeClass],style:this.cssVars},this.showIcon?c("div",{class:`${t}-empty__icon`},e.icon?e.icon():c(ut,{clsPrefix:t},{default:this.mergedRenderIcon})):null,this.showDescription?c("div",{class:`${t}-empty__description`},e.default?e.default():this.localizedDescription):null,e.extra?c("div",{class:`${t}-empty__extra`},e.extra()):null)}}),H6={railInsetHorizontal:"auto 2px 4px 2px",railInsetVertical:"2px 4px 2px auto",railColor:"transparent"},L1=e=>{const{scrollbarColor:t,scrollbarColorHover:r,scrollbarHeight:n,scrollbarWidth:o,scrollbarBorderRadius:i}=e;return Object.assign(Object.assign({},H6),{height:n,width:o,borderRadius:i,color:t,colorHover:r})},yn={name:"Scrollbar",common:tt,self:L1},Cn={name:"Scrollbar",common:et,self:L1},{cubicBezierEaseInOut:rb}=xn;function Eo({name:e="fade-in",enterDuration:t="0.2s",leaveDuration:r="0.2s",enterCubicBezier:n=rb,leaveCubicBezier:o=rb}={}){return[O(`&.${e}-transition-enter-active`,{transition:`all ${t} ${n}!important`}),O(`&.${e}-transition-leave-active`,{transition:`all ${r} ${o}!important`}),O(`&.${e}-transition-enter-from, &.${e}-transition-leave-to`,{opacity:0}),O(`&.${e}-transition-leave-from, &.${e}-transition-enter-to`,{opacity:1})]}const j6=w("scrollbar",`
overflow: hidden;
position: relative;
z-index: auto;
height: 100%;
width: 100%;
`,[O(">",[w("scrollbar-container",`
width: 100%;
overflow: scroll;
height: 100%;
min-height: inherit;
max-height: inherit;
scrollbar-width: none;
`,[O("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",`
width: 0;
height: 0;
display: none;
`),O(">",[w("scrollbar-content",`
box-sizing: border-box;
min-width: 100%;
`)])])]),O(">, +",[w("scrollbar-rail",`
position: absolute;
pointer-events: none;
user-select: none;
background: var(--n-scrollbar-rail-color);
-webkit-user-select: none;
`,[I("horizontal",`
inset: var(--n-scrollbar-rail-inset-horizontal);
height: var(--n-scrollbar-height);
`,[O(">",[M("scrollbar",`
height: var(--n-scrollbar-height);
border-radius: var(--n-scrollbar-border-radius);
right: 0;
`)])]),I("vertical",`
inset: var(--n-scrollbar-rail-inset-vertical);
width: var(--n-scrollbar-width);
`,[O(">",[M("scrollbar",`
width: var(--n-scrollbar-width);
border-radius: var(--n-scrollbar-border-radius);
bottom: 0;
`)])]),I("disabled",[O(">",[M("scrollbar","pointer-events: none;")])]),O(">",[M("scrollbar",`
z-index: 1;
position: absolute;
cursor: pointer;
pointer-events: all;
background-color: var(--n-scrollbar-color);
transition: background-color .2s var(--n-scrollbar-bezier);
`,[Eo(),O("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),V6=Object.assign(Object.assign({},ye.props),{duration:{type:Number,default:0},scrollable:{type:Boolean,default:!0},xScrollable:Boolean,trigger:{type:String,default:"hover"},useUnifiedContainer:Boolean,triggerDisplayManually:Boolean,container:Function,content:Function,containerClass:String,containerStyle:[String,Object],contentClass:[String,Array],contentStyle:[String,Object],horizontalRailStyle:[String,Object],verticalRailStyle:[String,Object],onScroll:Function,onWheel:Function,onResize:Function,internalOnUpdateScrollLeft:Function,internalHoistYRail:Boolean}),sr=re({name:"Scrollbar",props:V6,inheritAttrs:!1,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:r,mergedRtlRef:n}=Ne(e),o=Wt("Scrollbar",n,t),i=D(null),a=D(null),l=D(null),s=D(null),d=D(null),u=D(null),f=D(null),h=D(null),g=D(null),v=D(null),b=D(null),m=D(0),p=D(0),x=D(!1),S=D(!1);let y=!1,C=!1,k,R,$=0,T=0,z=0,F=0;const _=J3(),N=ye("Scrollbar","-scrollbar",j6,yn,e,t),j=P(()=>{const{value:G}=h,{value:q}=u,{value:xe}=v;return G===null||q===null||xe===null?0:Math.min(G,xe*G/q+jt(N.value.self.width)*1.5)}),H=P(()=>`${j.value}px`),Y=P(()=>{const{value:G}=g,{value:q}=f,{value:xe}=b;return G===null||q===null||xe===null?0:xe*G/q+jt(N.value.self.height)*1.5}),X=P(()=>`${Y.value}px`),le=P(()=>{const{value:G}=h,{value:q}=m,{value:xe}=u,{value:Ee}=v;if(G===null||xe===null||Ee===null)return 0;{const Ae=xe-G;return Ae?q/Ae*(Ee-j.value):0}}),ke=P(()=>`${le.value}px`),be=P(()=>{const{value:G}=g,{value:q}=p,{value:xe}=f,{value:Ee}=b;if(G===null||xe===null||Ee===null)return 0;{const Ae=xe-G;return Ae?q/Ae*(Ee-Y.value):0}}),Q=P(()=>`${be.value}px`),L=P(()=>{const{value:G}=h,{value:q}=u;return G!==null&&q!==null&&q>G}),A=P(()=>{const{value:G}=g,{value:q}=f;return G!==null&&q!==null&&q>G}),U=P(()=>{const{trigger:G}=e;return G==="none"||x.value}),ae=P(()=>{const{trigger:G}=e;return G==="none"||S.value}),he=P(()=>{const{container:G}=e;return G?G():a.value}),Re=P(()=>{const{content:G}=e;return G?G():l.value}),Oe=$v(()=>{e.container||Me({top:m.value,left:p.value})}),V=()=>{Oe.isDeactivated||te()},Te=G=>{if(Oe.isDeactivated)return;const{onResize:q}=e;q&&q(G),te()},Me=(G,q)=>{if(!e.scrollable)return;if(typeof G=="number"){E(G,q??0,0,!1,"auto");return}const{left:xe,top:Ee,index:Ae,elSize:ce,position:_e,behavior:se,el:$e,debounce:Xe=!0}=G;(xe!==void 0||Ee!==void 0)&&E(xe??0,Ee??0,0,!1,se),$e!==void 0?E(0,$e.offsetTop,$e.offsetHeight,Xe,se):Ae!==void 0&&ce!==void 0?E(0,Ae*ce,ce,Xe,se):_e==="bottom"?E(0,Number.MAX_SAFE_INTEGER,0,!1,se):_e==="top"&&E(0,0,0,!1,se)},Ve=(G,q)=>{if(!e.scrollable)return;const{value:xe}=he;xe&&(typeof G=="object"?xe.scrollBy(G):xe.scrollBy(G,q||0))};function E(G,q,xe,Ee,Ae){const{value:ce}=he;if(ce){if(Ee){const{scrollTop:_e,offsetHeight:se}=ce;if(q>_e){q+xe<=_e+se||ce.scrollTo({left:G,top:q+xe-se,behavior:Ae});return}}ce.scrollTo({left:G,top:q,behavior:Ae})}}function W(){me(),J(),te()}function ie(){ge()}function ge(){ne(),ee()}function ne(){R!==void 0&&window.clearTimeout(R),R=window.setTimeout(()=>{S.value=!1},e.duration)}function ee(){k!==void 0&&window.clearTimeout(k),k=window.setTimeout(()=>{x.value=!1},e.duration)}function me(){k!==void 0&&window.clearTimeout(k),x.value=!0}function J(){R!==void 0&&window.clearTimeout(R),S.value=!0}function oe(G){const{onScroll:q}=e;q&&q(G),de()}function de(){const{value:G}=he;G&&(m.value=G.scrollTop,p.value=G.scrollLeft*(o!=null&&o.value?-1:1))}function Z(){const{value:G}=Re;G&&(u.value=G.offsetHeight,f.value=G.offsetWidth);const{value:q}=he;q&&(h.value=q.offsetHeight,g.value=q.offsetWidth);const{value:xe}=d,{value:Ee}=s;xe&&(b.value=xe.offsetWidth),Ee&&(v.value=Ee.offsetHeight)}function B(){const{value:G}=he;G&&(m.value=G.scrollTop,p.value=G.scrollLeft*(o!=null&&o.value?-1:1),h.value=G.offsetHeight,g.value=G.offsetWidth,u.value=G.scrollHeight,f.value=G.scrollWidth);const{value:q}=d,{value:xe}=s;q&&(b.value=q.offsetWidth),xe&&(v.value=xe.offsetHeight)}function te(){e.scrollable&&(e.useUnifiedContainer?B():(Z(),de()))}function we(G){var q;
line-height: 1.5;
outline: none;
z-index: 0;
position: relative;
border-radius: var(--n-border-radius);
transition:
background-color .3s var(--n-bezier),
box-shadow .3s var(--n-bezier);
background-color: var(--n-color);
`,[w("scrollbar",`
max-height: var(--n-height);
`),w("virtual-list",`
max-height: var(--n-height);
`),w("base-select-option",`
min-height: var(--n-option-height);
font-size: var(--n-option-font-size);
display: flex;
align-items: center;
`,[M("content",`
z-index: 1;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
`)]),w("base-select-group-header",`
min-height: var(--n-option-height);
font-size: .93em;
display: flex;
align-items: center;
`),w("base-select-menu-option-wrapper",`
position: relative;
width: 100%;
`),M("loading, empty",`
display: flex;
padding: 12px 32px;
flex: 1;
justify-content: center;
`),M("loading",`
color: var(--n-loading-color);
font-size: var(--n-loading-size);
`),M("header",`
padding: 8px var(--n-option-padding-left);
font-size: var(--n-option-font-size);
transition:
color .3s var(--n-bezier),
border-color .3s var(--n-bezier);
border-bottom: 1px solid var(--n-action-divider-color);
color: var(--n-action-text-color);
`),M("action",`
padding: 8px var(--n-option-padding-left);
font-size: var(--n-option-font-size);
transition:
color .3s var(--n-bezier),
border-color .3s var(--n-bezier);
border-top: 1px solid var(--n-action-divider-color);
color: var(--n-action-text-color);
`),w("base-select-group-header",`
position: relative;
cursor: default;
padding: var(--n-option-padding);
color: var(--n-group-header-text-color);
`),w("base-select-option",`
cursor: pointer;
position: relative;
padding: var(--n-option-padding);
transition:
color .3s var(--n-bezier),
opacity .3s var(--n-bezier);
box-sizing: border-box;
color: var(--n-option-text-color);
opacity: 1;
`,[I("show-checkmark",`
padding-right: calc(var(--n-option-padding-right) + 20px);
`),O("&::before",`
content: "";
position: absolute;
left: 4px;
right: 4px;
top: 0;
bottom: 0;
border-radius: var(--n-border-radius);
transition: background-color .3s var(--n-bezier);
`),O("&:active",`
color: var(--n-option-text-color-pressed);
`),I("grouped",`
padding-left: calc(var(--n-option-padding-left) * 1.5);
`),I("pending",[O("&::before",`
background-color: var(--n-option-color-pending);
`)]),I("selected",`
color: var(--n-option-text-color-active);
`,[O("&::before",`
background-color: var(--n-option-color-active);
`),I("pending",[O("&::before",`
background-color: var(--n-option-color-active-pending);
`)])]),I("disabled",`
cursor: not-allowed;
`,[xt("selected",`
color: var(--n-option-text-color-disabled);
`),I("selected",`
opacity: var(--n-option-opacity-disabled);
`)]),M("check",`
font-size: 16px;
position: absolute;
right: calc(var(--n-option-padding-right) - 4px);
top: calc(50% - 7px);
color: var(--n-option-check-color);
transition: color .3s var(--n-bezier);
`,[Ar({enterScale:"0.5"})])])]),ws=re({name:"InternalSelectMenu",props:Object.assign(Object.assign({},ye.props),{clsPrefix:{type:String,required:!0},scrollable:{type:Boolean,default:!0},treeMate:{type:Object,required:!0},multiple:Boolean,size:{type:String,default:"medium"},value:{type:[String,Number,Array],default:null},autoPending:Boolean,virtualScroll:{type:Boolean,default:!0},show:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},loading:Boolean,focusable:Boolean,renderLabel:Function,renderOption:Function,nodeProps:Function,showCheckmark:{type:Boolean,default:!0},onMousedown:Function,onScroll:Function,onFocus:Function,onBlur:Function,onKeyup:Function,onKeydown:Function,onTabOut:Function,onMouseenter:Function,onMouseleave:Function,onResize:Function,resetMenuOnOptionsChange:{type:Boolean,default:!0},inlineThemeDisabled:Boolean,onToggle:Function}),setup(e){const{mergedClsPrefixRef:t,mergedRtlRef:r}=Ne(e),n=Wt("InternalSelectMenu",r,t),o=ye("InternalSelectMenu","-internal-select-menu",K6,sl,e,ve(e,"clsPrefix")),i=D(null),a=D(null),l=D(null),s=P(()=>e.treeMate.getFlattenedNodes()),d=P(()=>I1(s.value)),u=D(null);function f(){const{treeMate:L}=e;let A=null;const{value:U}=e;U===null?A=L.getFirstAvailableNode():(e.multiple?A=L.getNode((U||[])[(U||[]).length-1]):A=L.getNode(U),(!A||A.disabled)&&(A=L.getFirstAvailableNode())),j(A||null)}function h(){const{value:L}=u;L&&!e.treeMate.getNode(L.key)&&(u.value=null)}let g;ft(()=>e.show,L=>{L?g=ft(()=>e.treeMate,()=>{e.resetMenuOnOptionsChange?(e.autoPending?f():h(),Ot(H)):h()},{immediate:!0}):g==null||g()},{immediate:!0}),Ut(()=>{g==null||g()});const v=P(()=>jt(o.value.self[Ce("optionHeight",e.size)])),b=P(()=>Lr(o.value.self[Ce("padding",e.size)])),m=P(()=>e.multiple&&Array.isArray(e.value)?new Set(e.value):new Set),p=P(()=>{const L=s.value;return L&&L.length===0});function x(L){const{onToggle:A}=e;A&&A(L)}function S(L){const{onScroll:A}=e;A&&A(L)}function y(L){var A;(A=l.value)===null||A===void 0||A.sync(),S(L)}function C(){var L;(L=l.value)===null||L===void 0||L.sync()}function k(){const{value:L}=u;return L||null}function R(L,A){A.disabled||j(A,!1)}function $(L,A){A.disabled||x(A)}function T(L){var A;pr(L,"action")||(A=e.onKeyup)===null||A===void 0||A.call(e,L)}function z(L){var A;pr(L,"action")||(A=e.onKeydown)===null||A===void 0||A.call(e,L)}function F(L){var A;(A=e.onMousedown)===null||A===void 0||A.call(e,L),!e.focusable&&L.preventDefault()}function _(){const{value:L}=u;L&&j(L.getNext({loop:!0}),!0)}function N(){const{value:L}=u;L&&j(L.getPrev({loop:!0}),!0)}function j(L,A=!1){u.value=L,A&&H()}function H(){var L,A;const U=u.value;if(!U)return;const ae=d.value(U.key);ae!==null&&(e.virtualScroll?(L=a.value)===null||L===void 0||L.scrollTo({index:ae}):(A=l.value)===null||A===void 0||A.scrollTo({index:ae,elSize:v.value}))}function Y(L){var A,U;!((A=i.value)===null||A===void 0)&&A.contains(L.target)&&((U=e.onFocus)===null||U===void 0||U.call(e,L))}function X(L){var A,U;!((A=i.value)===null||A===void 0)&&A.contains(L.relatedTarget)||(U=e.onBlur)===null||U===void 0||U.call(e,L)}ot(wv,{handleOptionMouseEnter:R,handleOptionClick:$,valueSetRef:m,pendingTmNodeRef:u,nodePropsRef:ve(e,"nodeProps"),showCheckmarkRef:ve(e,"showCheckmark"),multipleRef:ve(e,"multiple"),valueRef:ve(e,"value"),renderLabelRef:ve(e,"renderLabel"),renderOptionRef:ve(e,"renderOption"),labelFieldRef:ve(e,"labelField"),valueFieldRef:ve(e,"valueField")}),ot(ey,i),Bt(()=>{const{value:L}=l;L&&L.sync()});const le=P(()=>{const{size:L}=e,{common:{cubicBezierEaseInOut:A},self:{height:U,borderRadius:ae,color:he,groupHeaderTextColor:Re,actionDividerColor:Oe,optionTextColorPressed:V,optionTextColor:Te,optionTextColorDisabled:Me,optionTextColorActive:Ve,optionOpacityDisabled:E,optionCheckColor:W,actionTextColor:ie,optionColorPending:ge,optionColorActive:ne,loadingColor:ee,loadingSize:me,optionColorActivePending:J,[Ce("optionFontSize",L)]:oe,[Ce("optionHeight",L)]:de,[Ce("optionPadding",L)]:Z}}=o.value;return{"--n-height":U,"--n-action-divider-color":Oe,"--n-action-text-co
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
border-radius: inherit;
`),j1=re({name:"BaseWave",props:{clsPrefix:{type:String,required:!0}},setup(e){Fn("-base-wave",q6,ve(e,"clsPrefix"));const t=D(null),r=D(!1);let n=null;return Ut(()=>{n!==null&&window.clearTimeout(n)}),{active:r,selfRef:t,play(){n!==null&&(window.clearTimeout(n),r.value=!1,n=null),Ot(()=>{var o;(o=t.value)===null||o===void 0||o.offsetHeight,r.value=!0,n=window.setTimeout(()=>{r.value=!1,n=null},1e3)})}}},render(){const{clsPrefix:e}=this;return c("div",{ref:"selfRef","aria-hidden":!0,class:[`${e}-base-wave`,this.active&&`${e}-base-wave--active`]})}}),Y6=w("base-menu-mask",`
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
padding: 14px;
overflow: hidden;
`,[Eo()]),G6=re({name:"BaseMenuMask",props:{clsPrefix:{type:String,required:!0}},setup(e){Fn("-base-menu-mask",Y6,ve(e,"clsPrefix"));const t=D(null);let r=null;const n=D(!1);return Ut(()=>{r!==null&&window.clearTimeout(r)}),Object.assign({message:t,show:n},{showOnce(i,a=1500){r&&window.clearTimeout(r),n.value=!0,t.value=i,r=window.setTimeout(()=>{n.value=!1,t.value=null},a)}})},render(){return c(At,{name:"fade-in-transition"},{default:()=>this.show?c("div",{class:`${this.clsPrefix}-base-menu-mask`},this.message):null})}}),X6={space:"6px",spaceArrow:"10px",arrowOffset:"10px",arrowOffsetVertical:"10px",arrowHeight:"6px",padding:"8px 14px"},V1=e=>{const{boxShadow2:t,popoverColor:r,textColor2:n,borderRadius:o,fontSize:i,dividerColor:a}=e;return Object.assign(Object.assign({},X6),{fontSize:i,borderRadius:o,color:r,dividerColor:a,textColor:n,boxShadow:t})},ba={name:"Popover",common:tt,self:V1},xa={name:"Popover",common:et,self:V1},Tu={top:"bottom",bottom:"top",left:"right",right:"left"},Br="var(--n-arrow-height) * 1.414",Z6=O([w("popover",`
transition:
box-shadow .3s var(--n-bezier),
background-color .3s var(--n-bezier),
color .3s var(--n-bezier);
position: relative;
font-size: var(--n-font-size);
color: var(--n-text-color);
box-shadow: var(--n-box-shadow);
word-break: break-word;
`,[O(">",[w("scrollbar",`
height: inherit;
max-height: inherit;
`)]),xt("raw",`
background-color: var(--n-color);
border-radius: var(--n-border-radius);
`,[xt("scrollable",[xt("show-header-or-footer","padding: var(--n-padding);")])]),M("header",`
padding: var(--n-padding);
border-bottom: 1px solid var(--n-divider-color);
transition: border-color .3s var(--n-bezier);
`),M("footer",`
padding: var(--n-padding);
border-top: 1px solid var(--n-divider-color);
transition: border-color .3s var(--n-bezier);
`),I("scrollable, show-header-or-footer",[M("content",`
padding: var(--n-padding);
`)])]),w("popover-shared",`
transform-origin: inherit;
`,[w("popover-arrow-wrapper",`
position: absolute;
overflow: hidden;
pointer-events: none;
`,[w("popover-arrow",`
transition: background-color .3s var(--n-bezier);
position: absolute;
display: block;
width: calc(${Br});
height: calc(${Br});
box-shadow: 0 0 8px 0 rgba(0, 0, 0, .12);
transform: rotate(45deg);
background-color: var(--n-color);
pointer-events: all;
`)]),O("&.popover-transition-enter-from, &.popover-transition-leave-to",`
opacity: 0;
transform: scale(.85);
`),O("&.popover-transition-enter-to, &.popover-transition-leave-from",`
transform: scale(1);
opacity: 1;
`),O("&.popover-transition-enter-active",`
transition:
box-shadow .3s var(--n-bezier),
background-color .3s var(--n-bezier),
color .3s var(--n-bezier),
opacity .15s var(--n-bezier-ease-out),
transform .15s var(--n-bezier-ease-out);
`),O("&.popover-transition-leave-active",`
transition:
box-shadow .3s var(--n-bezier),
background-color .3s var(--n-bezier),
color .3s var(--n-bezier),
opacity .15s var(--n-bezier-ease-in),
transform .15s var(--n-bezier-ease-in);
`)]),An("top-start",`
top: calc(${Br} / -2);
left: calc(${Oo("top-start")} - var(--v-offset-left));
`),An("top",`
top: calc(${Br} / -2);
transform: translateX(calc(${Br} / -2)) rotate(45deg);
left: 50%;
`),An("top-end",`
top: calc(${Br} / -2);
right: calc(${Oo("top-end")} + var(--v-offset-left));
`),An("bottom-start",`
bottom: calc(${Br} / -2);
left: calc(${Oo("bottom-start")} - var(--v-offset-left));
`),An("bottom",`
bottom: calc(${Br} / -2);
transform: translateX(calc(${Br} / -2)) rotate(45deg);
left: 50%;
`),An("bottom-end",`
bottom: calc(${Br} / -2);
right: calc(${Oo("bottom-end")} + var(--v-offset-left));
`),An("left-start",`
left: calc(${Br} / -2);
top: calc(${Oo("left-start")} - var(--v-offset-top));
`),An("left",`
left: calc(${Br} / -2);
transform: translateY(calc(${Br} / -2)) rotate(45deg);
top: 50%;
`),An("left-end",`
left: calc(${Br} / -2);
bottom: calc(${Oo("left-end")} + var(--v-offset-top));
`),An("right-start",`
right: calc(${Br} / -2);
top: calc(${Oo("right-start")} - var(--v-offset-top));
`),An("right",`
right: calc(${Br} / -2);
transform: translateY(calc(${Br} / -2)) rotate(45deg);
top: 50%;
`),An("right-end",`
right: calc(${Br} / -2);
bottom: calc(${Oo("right-end")} + var(--v-offset-top));
`),...yI({top:["right-start","left-start"],right:["top-end","bottom-end"],bottom:["right-end","left-end"],left:["top-start","bottom-start"]},(e,t)=>{const r=["right","left"].includes(t),n=r?"width":"height";return e.map(o=>{const i=o.split("-")[1]==="end",l=`calc((${`var(--v-target-${n}, 0px)`} - ${Br}) / 2)`,s=Oo(o);return O(`[v-placement="${o}"] >`,[w("popover-shared",[I("center-arrow",[w("popover-arrow",`${t}: calc(max(${l}, ${s}) ${i?"+":"-"} var(--v-offset-${r?"left":"top"}));`)])])])})})]);function Oo(e){return["top","bottom"].includes(e.split("-")[0])?"var(--n-arrow-offset)":"var(--n-arrow-offset-vertical)"}function An(e,t){const r=e.split("-")[0],n=["top","bottom"].includes(r)?"height: var(--n-space-arrow);":"width: var(--n-space-arrow);";return O(`[v-placement="${e}"] >`,[w("popover-shared",`
margin-${Tu[r]}: var(--n-space);
`,[I("show-arrow",`
margin-${Tu[r]}: var(--n-space-arrow);
`),I("overlap",`
margin: 0;
`),N3("popover-arrow-wrapper",`
right: 0;
left: 0;
top: 0;
bottom: 0;
${r}: 100%;
${Tu[r]}: auto;
${n}
`,[w("popover-arrow",t)])])])}const U1=Object.assign(Object.assign({},ye.props),{to:Kt.propTo,show:Boolean,trigger:String,showArrow:Boolean,delay:Number,duration:Number,raw:Boolean,arrowPointToCenter:Boolean,arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],displayDirective:String,x:Number,y:Number,flip:Boolean,overlap:Boolean,placement:String,width:[Number,String],keepAliveOnHover:Boolean,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],internalDeactivateImmediately:Boolean,animated:Boolean,onClickoutside:Function,internalTrapFocus:Boolean,internalOnAfterLeave:Function,minWidth:Number,maxWidth:Number}),W1=({arrowClass:e,arrowStyle:t,arrowWrapperClass:r,arrowWrapperStyle:n,clsPrefix:o})=>c("div",{key:"__popover-arrow__",style:n,class:[`${o}-popover-arrow-wrapper`,r]},c("div",{class:[`${o}-popover-arrow`,e],style:t})),Q6=re({name:"PopoverBody",inheritAttrs:!1,props:U1,setup(e,{slots:t,attrs:r}){const{namespaceRef:n,mergedClsPrefixRef:o,inlineThemeDisabled:i}=Ne(e),a=ye("Popover","-popover",Z6,ba,e,o),l=D(null),s=De("NPopover"),d=D(null),u=D(e.show),f=D(!1);Et(()=>{const{show:R}=e;R&&!L3()&&!e.internalDeactivateImmediately&&(f.value=!0)});const h=P(()=>{const{trigger:R,onClickoutside:$}=e,T=[],{positionManuallyRef:{value:z}}=s;return z||(R==="click"&&!$&&T.push([bn,y,void 0,{capture:!0}]),R==="hover"&&T.push([iy,S])),$&&T.push([bn,y,void 0,{capture:!0}]),(e.displayDirective==="show"||e.animated&&f.value)&&T.push([_n,e.show]),T}),g=P(()=>{const R=e.width==="trigger"?void 0:zt(e.width),$=[];R&&$.push({width:R});const{maxWidth:T,minWidth:z}=e;return T&&$.push({maxWidth:zt(T)}),z&&$.push({maxWidth:zt(z)}),i||$.push(v.value),$}),v=P(()=>{const{common:{cubicBezierEaseInOut:R,cubicBezierEaseIn:$,cubicBezierEaseOut:T},self:{space:z,spaceArrow:F,padding:_,fontSize:N,textColor:j,dividerColor:H,color:Y,boxShadow:X,borderRadius:le,arrowHeight:ke,arrowOffset:be,arrowOffsetVertical:Q}}=a.value;return{"--n-box-shadow":X,"--n-bezier":R,"--n-bezier-ease-in":$,"--n-bezier-ease-out":T,"--n-font-size":N,"--n-text-color":j,"--n-color":Y,"--n-divider-color":H,"--n-border-radius":le,"--n-arrow-height":ke,"--n-arrow-offset":be,"--n-arrow-offset-vertical":Q,"--n-padding":_,"--n-space":z,"--n-space-arrow":F}}),b=i?Qe("popover",void 0,v,e):void 0;s.setBodyInstance({syncPosition:m}),Ut(()=>{s.setBodyInstance(null)}),ft(ve(e,"show"),R=>{e.animated||(R?u.value=!0:u.value=!1)});function m(){var R;(R=l.value)===null||R===void 0||R.syncPosition()}function p(R){e.trigger==="hover"&&e.keepAliveOnHover&&e.show&&s.handleMouseEnter(R)}function x(R){e.trigger==="hover"&&e.keepAliveOnHover&&s.handleMouseLeave(R)}function S(R){e.trigger==="hover"&&!C().contains(mn(R))&&s.handleMouseMoveOutside(R)}function y(R){(e.trigger==="click"&&!C().contains(mn(R))||e.onClickoutside)&&s.handleClickOutside(R)}function C(){return s.getTriggerElement()}ot(al,d),ot(ps,null),ot(gs,null);function k(){if(b==null||b.onRender(),!(e.displayDirective==="show"||e.show||e.animated&&f.value))return null;let $;const T=s.internalRenderBodyRef.value,{value:z}=o;if(T)$=T([`${z}-popover-shared`,b==null?void 0:b.themeClass.value,e.overlap&&`${z}-popover-shared--overlap`,e.showArrow&&`${z}-popover-shared--show-arrow`,e.arrowPointToCenter&&`${z}-popover-shared--center-arrow`],d,g.value,p,x);else{const{value:F}=s.extraClassRef,{internalTrapFocus:_}=e,N=!Zi(t.header)||!Zi(t.footer),j=()=>{var H,Y;const X=N?c(It,null,Tt(t.header,be=>be?c("div",{class:[`${z}-popover__header`,e.headerClass],style:e.headerStyle},be):null),Tt(t.default,be=>be?c("div",{class:[`${z}-popover__content`,e.contentClass],style:e.contentStyle},t):null),Tt(t.footer,be=>be?c("div",{class:[`${z}-popover__footer`,e.footerClass],style:e.footerStyle},be):null)):e.scrollable?(H=t.default)===null||H===void 0?void 0:H.call(t):c("div",{class:[`${z}-popover__content`,e.contentClass],style:e.contentStyle},t),le=e.scrollable?c(el,{contentClass:N?void 0:`${z}-popover__content
--n-close-margin: var(--n-close-margin-top) var(--n-close-margin-right) var(--n-close-margin-bottom) var(--n-close-margin-left);
white-space: nowrap;
position: relative;
box-sizing: border-box;
cursor: default;
display: inline-flex;
align-items: center;
flex-wrap: nowrap;
padding: var(--n-padding);
border-radius: var(--n-border-radius);
color: var(--n-text-color);
background-color: var(--n-color);
transition:
border-color .3s var(--n-bezier),
background-color .3s var(--n-bezier),
color .3s var(--n-bezier),
box-shadow .3s var(--n-bezier),
opacity .3s var(--n-bezier);
line-height: 1;
height: var(--n-height);
font-size: var(--n-font-size);
`,[I("strong",`
font-weight: var(--n-font-weight-strong);
`),M("border",`
pointer-events: none;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
border-radius: inherit;
border: var(--n-border);
transition: border-color .3s var(--n-bezier);
`),M("icon",`
display: flex;
margin: 0 4px 0 0;
color: var(--n-text-color);
transition: color .3s var(--n-bezier);
font-size: var(--n-avatar-size-override);
`),M("avatar",`
display: flex;
margin: 0 6px 0 0;
`),M("close",`
margin: var(--n-close-margin);
transition:
background-color .3s var(--n-bezier),
color .3s var(--n-bezier);
`),I("round",`
padding: 0 calc(var(--n-height) / 3);
border-radius: calc(var(--n-height) / 2);
`,[M("icon",`
margin: 0 4px 0 calc((var(--n-height) - 8px) / -2);
`),M("avatar",`
margin: 0 6px 0 calc((var(--n-height) - 8px) / -2);
`),I("closable",`
padding: 0 calc(var(--n-height) / 4) 0 calc(var(--n-height) / 3);
`)]),I("icon, avatar",[I("round",`
padding: 0 calc(var(--n-height) / 3) 0 calc(var(--n-height) / 2);
`)]),I("disabled",`
cursor: not-allowed !important;
opacity: var(--n-opacity-disabled);
`),I("checkable",`
cursor: pointer;
box-shadow: none;
color: var(--n-text-color-checkable);
background-color: var(--n-color-checkable);
`,[xt("disabled",[O("&:hover","background-color: var(--n-color-hover-checkable);",[xt("checked","color: var(--n-text-color-hover-checkable);")]),O("&:active","background-color: var(--n-color-pressed-checkable);",[xt("checked","color: var(--n-text-color-pressed-checkable);")])]),I("checked",`
color: var(--n-text-color-checked);
background-color: var(--n-color-checked);
`,[xt("disabled",[O("&:hover","background-color: var(--n-color-checked-hover);"),O("&:active","background-color: var(--n-color-checked-pressed);")])])])]),Z1=Object.assign(Object.assign(Object.assign({},ye.props),X1),{bordered:{type:Boolean,default:void 0},checked:Boolean,checkable:Boolean,strong:Boolean,triggerClickOnClose:Boolean,onClose:[Array,Function],onMouseenter:Function,onMouseleave:Function,"onUpdate:checked":Function,onUpdateChecked:Function,internalCloseFocusable:{type:Boolean,default:!0},internalCloseIsButtonTag:{type:Boolean,default:!0},onCheckedChange:Function}),Q1="n-tag",Hl=re({name:"Tag",props:Z1,setup(e){const t=D(null),{mergedBorderedRef:r,mergedClsPrefixRef:n,inlineThemeDisabled:o,mergedRtlRef:i}=Ne(e),a=ye("Tag","-tag",nE,G1,e,n);ot(Q1,{roundRef:ve(e,"round")});function l(g){if(!e.disabled&&e.checkable){const{checked:v,onCheckedChange:b,onUpdateChecked:m,"onUpdate:checked":p}=e;m&&m(!v),p&&p(!v),b&&b(!v)}}function s(g){if(e.triggerClickOnClose||g.stopPropagation(),!e.disabled){const{onClose:v}=e;v&&ue(v,g)}}const d={setTextContent(g){const{value:v}=t;v&&(v.textContent=g)}},u=Wt("Tag",i,n),f=P(()=>{const{type:g,size:v,color:{color:b,textColor:m}={}}=e,{common:{cubicBezierEaseInOut:p},self:{padding:x,closeMargin:S,borderRadius:y,opacityDisabled:C,textColorCheckable:k,textColorHoverCheckable:R,textColorPressedCheckable:$,textColorChecked:T,colorCheckable:z,colorHoverCheckable:F,colorPressedCheckable:_,colorChecked:N,colorCheckedHover:j,colorCheckedPressed:H,closeBorderRadius:Y,fontWeightStrong:X,[Ce("colorBordered",g)]:le,[Ce("closeSize",v)]:ke,[Ce("closeIconSize",v)]:be,[Ce("fontSize",v)]:Q,[Ce("height",v)]:L,[Ce("color",g)]:A,[Ce("textColor",g)]:U,[Ce("border",g)]:ae,[Ce("closeIconColor",g)]:he,[Ce("closeIconColorHover",g)]:Re,[Ce("closeIconColorPressed",g)]:Oe,[Ce("closeColorHover",g)]:V,[Ce("closeColorPressed",g)]:Te}}=a.value,Me=Lr(S);return{"--n-font-weight-strong":X,"--n-avatar-size-override":`calc(${L} - 8px)`,"--n-bezier":p,"--n-border-radius":y,"--n-border":ae,"--n-close-icon-size":be,"--n-close-color-pressed":Te,"--n-close-color-hover":V,"--n-close-border-radius":Y,"--n-close-icon-color":he,"--n-close-icon-color-hover":Re,"--n-close-icon-color-pressed":Oe,"--n-close-icon-color-disabled":he,"--n-close-margin-top":Me.top,"--n-close-margin-right":Me.right,"--n-close-margin-bottom":Me.bottom,"--n-close-margin-left":Me.left,"--n-close-size":ke,"--n-color":b||(r.value?le:A),"--n-color-checkable":z,"--n-color-checked":N,"--n-color-checked-hover":j,"--n-color-checked-pressed":H,"--n-color-hover-checkable":F,"--n-color-pressed-checkable":_,"--n-font-size":Q,"--n-height":L,"--n-opacity-disabled":C,"--n-padding":x,"--n-text-color":m||U,"--n-text-color-checkable":k,"--n-text-color-checked":T,"--n-text-color-hover-checkable":R,"--n-text-color-pressed-checkable":$}}),h=o?Qe("tag",P(()=>{let g="";const{type:v,size:b,color:{color:m,textColor:p}={}}=e;return g+=v[0],g+=b[0],m&&(g+=`a${ra(m)}`),p&&(g+=`b${ra(p)}`),r.value&&(g+="c"),g}),f,e):void 0;return Object.assign(Object.assign({},d),{rtlEnabled:u,mergedClsPrefix:n,contentRef:t,mergedBordered:r,handleClick:l,handleCloseClick:s,cssVars:o?void 0:f,themeClass:h==null?void 0:h.themeClass,onRender:h==null?void 0:h.onRender})},render(){var e,t;const{mergedClsPrefix:r,rtlEnabled:n,closable:o,color:{borderColor:i}={},round:a,onRender:l,$slots:s}=this;l==null||l();const d=Tt(s.avatar,f=>f&&c("div",{class:`${r}-tag__avatar`},f)),u=Tt(s.icon,f=>f&&c("div",{class:`${r}-tag__icon`},f));return c("div",{class:[`${r}-tag`,this.themeClass,{[`${r}-tag--rtl`]:n,[`${r}-tag--strong`]:this.strong,[`${r}-tag--disabled`]:this.disabled,[`${r}-tag--checkable`]:this.checkable,[`${r}-tag--checked`]:this.checkable&&this.checked,[`${r}-tag--round`]:a,[`${r}-tag--avatar`]:d,[`${r}-tag--icon`]:u,[`${r}-tag--closable`]:o}],style:this.cssVars,onClick:this.handleClick,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},u||d,c("span",{class:`${r}-tag__content`,ref:"contentRef"},(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e)),!this.checkable&&o?c(Wo,{clsPrefix:r,
flex-shrink: 0;
height: 1em;
width: 1em;
position: relative;
`,[O(">",[M("clear",`
font-size: var(--n-clear-size);
height: 1em;
width: 1em;
cursor: pointer;
color: var(--n-clear-color);
transition: color .3s var(--n-bezier);
display: flex;
`,[O("&:hover",`
color: var(--n-clear-color-hover)!important;
`),O("&:active",`
color: var(--n-clear-color-pressed)!important;
`)]),M("placeholder",`
display: flex;
`),M("clear, placeholder",`
position: absolute;
left: 50%;
top: 50%;
transform: translateX(-50%) translateY(-50%);
`,[qr({originalTransform:"translateX(-50%) translateY(-50%)",left:"50%",top:"50%"})])])]),jf=re({name:"BaseClear",props:{clsPrefix:{type:String,required:!0},show:Boolean,onClear:Function},setup(e){return Fn("-base-clear",oE,ve(e,"clsPrefix")),{handleMouseDown(t){t.preventDefault()}}},render(){const{clsPrefix:e}=this;return c("div",{class:`${e}-base-clear`},c(ko,null,{default:()=>{var t,r;return this.show?c("div",{key:"dismiss",class:`${e}-base-clear__clear`,onClick:this.onClear,onMousedown:this.handleMouseDown,"data-clear":!0},yt(this.$slots.icon,()=>[c(ut,{clsPrefix:e},{default:()=>c(QD,null)})])):c("div",{key:"icon",class:`${e}-base-clear__placeholder`},(r=(t=this.$slots).placeholder)===null||r===void 0?void 0:r.call(t))}}))}}),J1=re({name:"InternalSelectionSuffix",props:{clsPrefix:{type:String,required:!0},showArrow:{type:Boolean,default:void 0},showClear:{type:Boolean,default:void 0},loading:{type:Boolean,default:!1},onClear:Function},setup(e,{slots:t}){return()=>{const{clsPrefix:r}=e;return c(to,{clsPrefix:r,class:`${r}-base-suffix`,strokeWidth:24,scale:.85,show:e.loading},{default:()=>e.showArrow?c(jf,{clsPrefix:r,show:e.showClear,onClear:e.onClear},{placeholder:()=>c(ut,{clsPrefix:r,class:`${r}-base-suffix__arrow`},{default:()=>yt(t.default,()=>[c(_1,null)])})}):null})}}}),eC={paddingSingle:"0 26px 0 12px",paddingMultiple:"3px 26px 0 12px",clearSize:"16px",arrowSize:"16px"},iE=e=>{const{borderRadius:t,textColor2:r,textColorDisabled:n,inputColor:o,inputColorDisabled:i,primaryColor:a,primaryColorHover:l,warningColor:s,warningColorHover:d,errorColor:u,errorColorHover:f,borderColor:h,iconColor:g,iconColorDisabled:v,clearColor:b,clearColorHover:m,clearColorPressed:p,placeholderColor:x,placeholderColorDisabled:S,fontSizeTiny:y,fontSizeSmall:C,fontSizeMedium:k,fontSizeLarge:R,heightTiny:$,heightSmall:T,heightMedium:z,heightLarge:F}=e;return Object.assign(Object.assign({},eC),{fontSizeTiny:y,fontSizeSmall:C,fontSizeMedium:k,fontSizeLarge:R,heightTiny:$,heightSmall:T,heightMedium:z,heightLarge:F,borderRadius:t,textColor:r,textColorDisabled:n,placeholderColor:x,placeholderColorDisabled:S,color:o,colorDisabled:i,colorActive:o,border:`1px solid ${h}`,borderHover:`1px solid ${l}`,borderActive:`1px solid ${a}`,borderFocus:`1px solid ${l}`,boxShadowHover:"none",boxShadowActive:`0 0 0 2px ${je(a,{alpha:.2})}`,boxShadowFocus:`0 0 0 2px ${je(a,{alpha:.2})}`,caretColor:a,arrowColor:g,arrowColorDisabled:v,loadingColor:a,borderWarning:`1px solid ${s}`,borderHoverWarning:`1px solid ${d}`,borderActiveWarning:`1px solid ${s}`,borderFocusWarning:`1px solid ${d}`,boxShadowHoverWarning:"none",boxShadowActiveWarning:`0 0 0 2px ${je(s,{alpha:.2})}`,boxShadowFocusWarning:`0 0 0 2px ${je(s,{alpha:.2})}`,colorActiveWarning:o,caretColorWarning:s,borderError:`1px solid ${u}`,borderHoverError:`1px solid ${f}`,borderActiveError:`1px solid ${u}`,borderFocusError:`1px solid ${f}`,boxShadowHoverError:"none",boxShadowActiveError:`0 0 0 2px ${je(u,{alpha:.2})}`,boxShadowFocusError:`0 0 0 2px ${je(u,{alpha:.2})}`,colorActiveError:o,caretColorError:u,clearColor:b,clearColorHover:m,clearColorPressed:p})},Oc={name:"InternalSelection",common:tt,peers:{Popover:ba},self:iE},Qv={name:"InternalSelection",common:et,peers:{Popover:xa},self(e){const{borderRadius:t,textColor2:r,textColorDisabled:n,inputColor:o,inputColorDisabled:i,primaryColor:a,primaryColorHover:l,warningColor:s,warningColorHover:d,errorColor:u,errorColorHover:f,iconColor:h,iconColorDisabled:g,clearColor:v,clearColorHover:b,clearColorPressed:m,placeholderColor:p,placeholderColorDisabled:x,fontSizeTiny:S,fontSizeSmall:y,fontSizeMedium:C,fontSizeLarge:k,heightTiny:R,heightSmall:$,heightMedium:T,heightLarge:z}=e;return Object.assign(Object.assign({},eC),{fontSizeTiny:S,fontSizeSmall:y,fontSizeMedium:C,fontSizeLarge:k,heightTiny:R,heightSmall:$,heightMedium:T,heightLarge:z,borderRadius:t,textColor:r,textColorDisabled:n,placeholderColor:p,placeholderColorDisabled:x,color:o,colorDisabled:i,colorActive:je(a,{alpha:.1}),border:"1px solid #0000",borderHover:`1px solid ${l}`,borderActive:`1px solid ${a}`,bo
--n-padding-single: var(--n-padding-single-top) var(--n-padding-single-right) var(--n-padding-single-bottom) var(--n-padding-single-left);
--n-padding-multiple: var(--n-padding-multiple-top) var(--n-padding-multiple-right) var(--n-padding-multiple-bottom) var(--n-padding-multiple-left);
position: relative;
z-index: auto;
box-shadow: none;
width: 100%;
max-width: 100%;
display: inline-block;
vertical-align: bottom;
border-radius: var(--n-border-radius);
min-height: var(--n-height);
line-height: 1.5;
font-size: var(--n-font-size);
`,[w("base-loading",`
color: var(--n-loading-color);
`),w("base-selection-tags","min-height: var(--n-height);"),M("border, state-border",`
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
pointer-events: none;
border: var(--n-border);
border-radius: inherit;
transition:
box-shadow .3s var(--n-bezier),
border-color .3s var(--n-bezier);
`),M("state-border",`
z-index: 1;
border-color: #0000;
`),w("base-suffix",`
cursor: pointer;
position: absolute;
top: 50%;
transform: translateY(-50%);
right: 10px;
`,[M("arrow",`
font-size: var(--n-arrow-size);
color: var(--n-arrow-color);
transition: color .3s var(--n-bezier);
`)]),w("base-selection-overlay",`
display: flex;
align-items: center;
white-space: nowrap;
pointer-events: none;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
padding: var(--n-padding-single);
transition: color .3s var(--n-bezier);
`,[M("wrapper",`
flex-basis: 0;
flex-grow: 1;
overflow: hidden;
text-overflow: ellipsis;
`)]),w("base-selection-placeholder",`
color: var(--n-placeholder-color);
`,[M("inner",`
max-width: 100%;
overflow: hidden;
`)]),w("base-selection-tags",`
cursor: pointer;
outline: none;
box-sizing: border-box;
position: relative;
z-index: auto;
display: flex;
padding: var(--n-padding-multiple);
flex-wrap: wrap;
align-items: center;
width: 100%;
vertical-align: bottom;
background-color: var(--n-color);
border-radius: inherit;
transition:
color .3s var(--n-bezier),
box-shadow .3s var(--n-bezier),
background-color .3s var(--n-bezier);
`),w("base-selection-label",`
height: var(--n-height);
display: inline-flex;
width: 100%;
vertical-align: bottom;
cursor: pointer;
outline: none;
z-index: auto;
box-sizing: border-box;
position: relative;
transition:
color .3s var(--n-bezier),
box-shadow .3s var(--n-bezier),
background-color .3s var(--n-bezier);
border-radius: inherit;
background-color: var(--n-color);
align-items: center;
`,[w("base-selection-input",`
font-size: inherit;
line-height: inherit;
outline: none;
cursor: pointer;
box-sizing: border-box;
border:none;
width: 100%;
padding: var(--n-padding-single);
background-color: #0000;
color: var(--n-text-color);
transition: color .3s var(--n-bezier);
caret-color: var(--n-caret-color);
`,[M("content",`
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
`)]),M("render-label",`
color: var(--n-text-color);
`)]),xt("disabled",[O("&:hover",[M("state-border",`
box-shadow: var(--n-box-shadow-hover);
border: var(--n-border-hover);
`)]),I("focus",[M("state-border",`
box-shadow: var(--n-box-shadow-focus);
border: var(--n-border-focus);
`)]),I("active",[M("state-border",`
box-shadow: var(--n-box-shadow-active);
border: var(--n-border-active);
`),w("base-selection-label","background-color: var(--n-color-active);"),w("base-selection-tags","background-color: var(--n-color-active);")])]),I("disabled","cursor: not-allowed;",[M("arrow",`
color: var(--n-arrow-color-disabled);
`),w("base-selection-label",`
cursor: not-allowed;
background-color: var(--n-color-disabled);
`,[w("base-selection-input",`
cursor: not-allowed;
color: var(--n-text-color-disabled);
`),M("render-label",`
color: var(--n-text-color-disabled);
`)]),w("base-selection-tags",`
cursor: not-allowed;
background-color: var(--n-color-disabled);
`),w("base-selection-placeholder",`
cursor: not-allowed;
color: var(--n-placeholder-color-disabled);
`)]),w("base-selection-input-tag",`
height: calc(var(--n-height) - 6px);
line-height: calc(var(--n-height) - 6px);
outline: none;
display: none;
position: relative;
margin-bottom: 3px;
max-width: 100%;
vertical-align: bottom;
`,[M("input",`
font-size: inherit;
font-family: inherit;
min-width: 1px;
padding: 0;
background-color: #0000;
outline: none;
border: none;
max-width: 100%;
overflow: hidden;
width: 1em;
line-height: inherit;
cursor: pointer;
color: var(--n-text-color);
caret-color: var(--n-caret-color);
`),M("mirror",`
position: absolute;
left: 0;
top: 0;
white-space: pre;
visibility: hidden;
user-select: none;
-webkit-user-select: none;
opacity: 0;
`)]),["warning","error"].map(e=>I(`${e}-status`,[M("state-border",`border: var(--n-border-${e});`),xt("disabled",[O("&:hover",[M("state-border",`
box-shadow: var(--n-box-shadow-hover-${e});
border: var(--n-border-hover-${e});
`)]),I("active",[M("state-border",`
box-shadow: var(--n-box-shadow-active-${e});
border: var(--n-border-active-${e});
`),w("base-selection-label",`background-color: var(--n-color-active-${e});`),w("base-selection-tags",`background-color: var(--n-color-active-${e});`)]),I("focus",[M("state-border",`
box-shadow: var(--n-box-shadow-focus-${e});
border: var(--n-border-focus-${e});
`)])])]))]),w("base-selection-popover",`
margin-bottom: -3px;
display: flex;
flex-wrap: wrap;
margin-right: -8px;
`),w("base-selection-tag-wrapper",`
max-width: 100%;
display: inline-flex;
padding: 0 7px 3px 0;
`,[O("&:last-child","padding-right: 0;"),w("tag",`
font-size: 14px;
max-width: 100%;
`,[M("content",`
line-height: 1.25;
text-overflow: ellipsis;
overflow: hidden;
`)])])]),Jv=re({name:"InternalSelection",props:Object.assign(Object.assign({},ye.props),{clsPrefix:{type:String,required:!0},bordered:{type:Boolean,default:void 0},active:Boolean,pattern:{type:String,default:""},placeholder:String,selectedOption:{type:Object,default:null},selectedOptions:{type:Array,default:null},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},multiple:Boolean,filterable:Boolean,clearable:Boolean,disabled:Boolean,size:{type:String,default:"medium"},loading:Boolean,autofocus:Boolean,showArrow:{type:Boolean,default:!0},inputProps:Object,focused:Boolean,renderTag:Function,onKeydown:Function,onClick:Function,onBlur:Function,onFocus:Function,onDeleteOption:Function,maxTagCount:[String,Number],ellipsisTagPopoverProps:Object,onClear:Function,onPatternInput:Function,onPatternFocus:Function,onPatternBlur:Function,renderLabel:Function,status:String,inlineThemeDisabled:Boolean,ignoreComposition:{type:Boolean,default:!0},onResize:Function}),setup(e){const{mergedClsPrefixRef:t,mergedRtlRef:r}=Ne(e),n=Wt("InternalSelection",r,t),o=D(null),i=D(null),a=D(null),l=D(null),s=D(null),d=D(null),u=D(null),f=D(null),h=D(null),g=D(null),v=D(!1),b=D(!1),m=D(!1),p=ye("InternalSelection","-internal-selection",aE,Oc,e,ve(e,"clsPrefix")),x=P(()=>e.clearable&&!e.disabled&&(m.value||e.active)),S=P(()=>e.selectedOption?e.renderTag?e.renderTag({option:e.selectedOption,handleClose:()=>{}}):e.renderLabel?e.renderLabel(e.selectedOption,!0):Zt(e.selectedOption[e.labelField],e.selectedOption,!0):e.placeholder),y=P(()=>{const B=e.selectedOption;if(B)return B[e.labelField]}),C=P(()=>e.multiple?!!(Array.isArray(e.selectedOptions)&&e.selectedOptions.length):e.selectedOption!==null);function k(){var B;const{value:te}=o;if(te){const{value:we}=i;we&&(we.style.width=`${te.offsetWidth}px`,e.maxTagCount!=="responsive"&&((B=h.value)===null||B===void 0||B.sync({showAllItemsBeforeCalculate:!1})))}}function R(){const{value:B}=g;B&&(B.style.display="none")}function $(){const{value:B}=g;B&&(B.style.display="inline-block")}ft(ve(e,"active"),B=>{B||R()}),ft(ve(e,"pattern"),()=>{e.multiple&&Ot(k)});function T(B){const{onFocus:te}=e;te&&te(B)}function z(B){const{onBlur:te}=e;te&&te(B)}function F(B){const{onDeleteOption:te}=e;te&&te(B)}function _(B){const{onClear:te}=e;te&&te(B)}function N(B){const{onPatternInput:te}=e;te&&te(B)}function j(B){var te;(!B.relatedTarget||!(!((te=a.value)===null||te===void 0)&&te.contains(B.relatedTarget)))&&T(B)}function H(B){var te;!((te=a.value)===null||te===void 0)&&te.contains(B.relatedTarget)||z(B)}function Y(B){_(B)}function X(){m.value=!0}function le(){m.value=!1}function ke(B){!e.active||!e.filterable||B.target!==i.value&&B.preventDefault()}function be(B){F(B)}function Q(B){if(B.key==="Backspace"&&!L.value&&!e.pattern.length){const{selectedOptions:te}=e;te!=null&&te.length&&be(te[te.length-1])}}const L=D(!1);let A=null;function U(B){const{value:te}=o;if(te){const we=B.target.value;te.textContent=we,k()}e.ignoreComposition&&L.value?A=B:N(B)}function ae(){L.value=!0}function he(){L.value=!1,e.ignoreComposition&&N(A),A=null}function Re(B){var te;b.value=!0,(te=e.onPatternFocus)===null||te===void 0||te.call(e,B)}function Oe(B){var te;b.value=!1,(te=e.onPatternBlur)===null||te===void 0||te.call(e,B)}function V(){var B,te;if(e.filterable)b.value=!1,(B=d.value)===null||B===void 0||B.blur(),(te=i.value)===null||te===void 0||te.blur();else if(e.multiple){const{value:we}=l;we==null||we.blur()}else{const{value:we}=s;we==null||we.blur()}}function Te(){var B,te,we;e.filterable?(b.value=!1,(B=d.value)===null||B===void 0||B.focus()):e.multiple?(te=l.value)===null||te===void 0||te.focus():(we=s.value)===null||we===void 0||we.focus()}function Me(){const{value:B}=i;B&&($(),B.focus())}function Ve(){const{value:B}=i;B&&B.blur()}function E(B){const{value:te}=u;te&&te.setTextContent(`+${B}`)}function W(){const{value:B}=f;return B}function ie(){return i.value}let ge=null;function ne(){ge!==null&&window.clearTimeout(ge)}function ee(){e.active||(ne(),ge=window.setTimeout(()=>{C.value&&(v.value=!0)},100))}function
opacity: 0!important;
margin-left: 0!important;
margin-right: 0!important;
`),O("&.fade-in-width-expand-transition-leave-active",`
overflow: hidden;
transition:
opacity ${e} ${ei},
max-width ${e} ${ei} ${t},
margin-left ${e} ${ei} ${t},
margin-right ${e} ${ei} ${t};
`),O("&.fade-in-width-expand-transition-enter-active",`
overflow: hidden;
transition:
opacity ${e} ${ei} ${t},
max-width ${e} ${ei},
margin-left ${e} ${ei},
margin-right ${e} ${ei};
`)]}const{cubicBezierEaseOut:Oa}=xn;function lE({duration:e=".2s"}={}){return[O("&.fade-up-width-expand-transition-leave-active",{transition:`
opacity ${e} ${Oa},
max-width ${e} ${Oa},
transform ${e} ${Oa}
`}),O("&.fade-up-width-expand-transition-enter-active",{transition:`
opacity ${e} ${Oa},
max-width ${e} ${Oa},
transform ${e} ${Oa}
`}),O("&.fade-up-width-expand-transition-enter-to",{opacity:1,transform:"translateX(0) translateY(0)"}),O("&.fade-up-width-expand-transition-enter-from",{maxWidth:"0 !important",opacity:0,transform:"translateY(60%)"}),O("&.fade-up-width-expand-transition-leave-from",{opacity:1,transform:"translateY(0)"}),O("&.fade-up-width-expand-transition-leave-to",{maxWidth:"0 !important",opacity:0,transform:"translateY(60%)"})]}const sE=O([O("@keyframes n-base-slot-machine-fade-up-in",`
from {
transform: translateY(60%);
opacity: 0;
}
to {
transform: translateY(0);
opacity: 1;
}
`),O("@keyframes n-base-slot-machine-fade-down-in",`
from {
transform: translateY(-60%);
opacity: 0;
}
to {
transform: translateY(0);
opacity: 1;
}
`),O("@keyframes n-base-slot-machine-fade-up-out",`
from {
transform: translateY(0%);
opacity: 1;
}
to {
transform: translateY(-60%);
opacity: 0;
}
`),O("@keyframes n-base-slot-machine-fade-down-out",`
from {
transform: translateY(0%);
opacity: 1;
}
to {
transform: translateY(60%);
opacity: 0;
}
`),w("base-slot-machine",`
overflow: hidden;
white-space: nowrap;
display: inline-block;
height: 18px;
line-height: 18px;
`,[w("base-slot-machine-number",`
display: inline-block;
position: relative;
height: 18px;
width: .6em;
max-width: .6em;
`,[lE({duration:".2s"}),tC({duration:".2s",delay:"0s"}),w("base-slot-machine-old-number",`
display: inline-block;
opacity: 0;
position: absolute;
left: 0;
right: 0;
`,[I("top",{transform:"translateY(-100%)"}),I("bottom",{transform:"translateY(100%)"}),I("down-scroll",{animation:"n-base-slot-machine-fade-down-out .2s cubic-bezier(0, 0, .2, 1)",animationIterationCount:1}),I("up-scroll",{animation:"n-base-slot-machine-fade-up-out .2s cubic-bezier(0, 0, .2, 1)",animationIterationCount:1})]),w("base-slot-machine-current-number",`
display: inline-block;
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
opacity: 1;
transform: translateY(0);
width: .6em;
`,[I("down-scroll",{animation:"n-base-slot-machine-fade-down-in .2s cubic-bezier(0, 0, .2, 1)",animationIterationCount:1}),I("up-scroll",{animation:"n-base-slot-machine-fade-up-in .2s cubic-bezier(0, 0, .2, 1)",animationIterationCount:1}),M("inner",`
display: inline-block;
position: absolute;
right: 0;
top: 0;
width: .6em;
`,[I("not-number",`
right: unset;
left: 0;
`)])])])])]),dE=re({name:"BaseSlotMachine",props:{clsPrefix:{type:String,required:!0},value:{type:[Number,String],default:0},max:{type:Number,default:void 0},appeared:{type:Boolean,required:!0}},setup(e){Fn("-base-slot-machine",sE,ve(e,"clsPrefix"));const t=D(),r=D(),n=P(()=>{if(typeof e.value=="string")return[];if(e.value<1)return[0];const o=[];let i=e.value;for(e.max!==void 0&&(i=Math.min(e.max,i));i>=1;)o.push(i%10),i/=10,i=Math.floor(i);return o.reverse(),o});return ft(ve(e,"value"),(o,i)=>{typeof o=="string"?(r.value=void 0,t.value=void 0):typeof i=="string"?(r.value=o,t.value=void 0):(r.value=o,t.value=i)}),()=>{const{value:o,clsPrefix:i}=e;return typeof o=="number"?c("span",{class:`${i}-base-slot-machine`},c(mc,{name:"fade-up-width-expand-transition",tag:"span"},{default:()=>n.value.map((a,l)=>c(lb,{clsPrefix:i,key:n.value.length-l-1,oldOriginalNumber:t.value,newOriginalNumber:r.value,value:a}))}),c(Ro,{key:"+",width:!0},{default:()=>e.max!==void 0&&e.max<o?c(lb,{clsPrefix:i,value:"+"}):null})):c("span",{class:`${i}-base-slot-machine`},o)}}}),rC={iconMargin:"11px 8px 0 12px",iconMarginRtl:"11px 12px 0 8px",iconSize:"24px",closeIconSize:"16px",closeSize:"20px",closeMargin:"13px 14px 0 0",closeMarginRtl:"13px 0 0 14px",padding:"13px"},cE={name:"Alert",common:et,self(e){const{lineHeight:t,borderRadius:r,fontWeightStrong:n,dividerColor:o,inputColor:i,textColor1:a,textColor2:l,closeColorHover:s,closeColorPressed:d,closeIconColor:u,closeIconColorHover:f,closeIconColorPressed:h,infoColorSuppl:g,successColorSuppl:v,warningColorSuppl:b,errorColorSuppl:m,fontSize:p}=e;return Object.assign(Object.assign({},rC),{fontSize:p,lineHeight:t,titleFontWeight:n,borderRadius:r,border:`1px solid ${o}`,color:i,titleTextColor:a,iconColor:l,contentTextColor:l,closeBorderRadius:r,closeColorHover:s,closeColorPressed:d,closeIconColor:u,closeIconColorHover:f,closeIconColorPressed:h,borderInfo:`1px solid ${je(g,{alpha:.35})}`,colorInfo:je(g,{alpha:.25}),titleTextColorInfo:a,iconColorInfo:g,contentTextColorInfo:l,closeColorHoverInfo:s,closeColorPressedInfo:d,closeIconColorInfo:u,closeIconColorHoverInfo:f,closeIconColorPressedInfo:h,borderSuccess:`1px solid ${je(v,{alpha:.35})}`,colorSuccess:je(v,{alpha:.25}),titleTextColorSuccess:a,iconColorSuccess:v,contentTextColorSuccess:l,closeColorHoverSuccess:s,closeColorPressedSuccess:d,closeIconColorSuccess:u,closeIconColorHoverSuccess:f,closeIconColorPressedSuccess:h,borderWarning:`1px solid ${je(b,{alpha:.35})}`,colorWarning:je(b,{alpha:.25}),titleTextColorWarning:a,iconColorWarning:b,contentTextColorWarning:l,closeColorHoverWarning:s,closeColorPressedWarning:d,closeIconColorWarning:u,closeIconColorHoverWarning:f,closeIconColorPressedWarning:h,borderError:`1px solid ${je(m,{alpha:.35})}`,colorError:je(m,{alpha:.25}),titleTextColorError:a,iconColorError:m,contentTextColorError:l,closeColorHoverError:s,closeColorPressedError:d,closeIconColorError:u,closeIconColorHoverError:f,closeIconColorPressedError:h})}},uE=e=>{const{lineHeight:t,borderRadius:r,fontWeightStrong:n,baseColor:o,dividerColor:i,actionColor:a,textColor1:l,textColor2:s,closeColorHover:d,closeColorPressed:u,closeIconColor:f,closeIconColorHover:h,closeIconColorPressed:g,infoColor:v,successColor:b,warningColor:m,errorColor:p,fontSize:x}=e;return Object.assign(Object.assign({},rC),{fontSize:x,lineHeight:t,titleFontWeight:n,borderRadius:r,border:`1px solid ${i}`,color:a,titleTextColor:l,iconColor:s,contentTextColor:s,closeBorderRadius:r,closeColorHover:d,closeColorPressed:u,closeIconColor:f,closeIconColorHover:h,closeIconColorPressed:g,borderInfo:`1px solid ${mt(o,je(v,{alpha:.25}))}`,colorInfo:mt(o,je(v,{alpha:.08})),titleTextColorInfo:l,iconColorInfo:v,contentTextColorInfo:s,closeColorHoverInfo:d,closeColorPressedInfo:u,closeIconColorInfo:f,closeIconColorHoverInfo:h,closeIconColorPressedInfo:g,borderSuccess:`1px solid ${mt(o,je(b,{alpha:.25}))}`,colorSuccess:mt(o,je(b,{alpha:.08})),titleTextColorSuccess:l,iconColorSuccess:b,contentTextColorSuccess:s,closeColorHoverSuccess:d,closeColorPressedSuccess:u,closeIconColorSuccess:f,closeIconColorHov
&.fade-in-height-expand-transition-${s}-to`,Object.assign(Object.assign({},i),{opacity:1})),O(`&.fade-in-height-expand-transition-${d}-to,
&.fade-in-height-expand-transition-${s}-from`,Object.assign(Object.assign({},a),{opacity:0,marginTop:"0 !important",marginBottom:"0 !important",paddingTop:o?"0 !important":void 0,paddingBottom:o?"0 !important":void 0})),O(`&.fade-in-height-expand-transition-${d}-active`,`
overflow: ${e};
transition:
max-height ${t} ${io} ${n},
opacity ${t} ${hE} ${n},
margin-top ${t} ${io} ${n},
margin-bottom ${t} ${io} ${n},
padding-top ${t} ${io} ${n},
padding-bottom ${t} ${io} ${n}
${r?","+r:""}
`),O(`&.fade-in-height-expand-transition-${s}-active`,`
overflow: ${e};
transition:
max-height ${t} ${io},
opacity ${t} ${vE},
margin-top ${t} ${io},
margin-bottom ${t} ${io},
padding-top ${t} ${io},
padding-bottom ${t} ${io}
${r?","+r:""}
`)]}const gE=w("alert",`
line-height: var(--n-line-height);
border-radius: var(--n-border-radius);
position: relative;
transition: background-color .3s var(--n-bezier);
background-color: var(--n-color);
text-align: start;
word-break: break-word;
`,[M("border",`
border-radius: inherit;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
transition: border-color .3s var(--n-bezier);
border: var(--n-border);
pointer-events: none;
`),I("closable",[w("alert-body",[M("title",`
padding-right: 24px;
`)])]),M("icon",{color:"var(--n-icon-color)"}),w("alert-body",{padding:"var(--n-padding)"},[M("title",{color:"var(--n-title-text-color)"}),M("content",{color:"var(--n-content-text-color)"})]),Ao({originalTransition:"transform .3s var(--n-bezier)",enterToProps:{transform:"scale(1)"},leaveToProps:{transform:"scale(0.9)"}}),M("icon",`
position: absolute;
left: 0;
top: 0;
align-items: center;
justify-content: center;
display: flex;
width: var(--n-icon-size);
height: var(--n-icon-size);
font-size: var(--n-icon-size);
margin: var(--n-icon-margin);
`),M("close",`
transition:
color .3s var(--n-bezier),
background-color .3s var(--n-bezier);
position: absolute;
right: 0;
top: 0;
margin: var(--n-close-margin);
`),I("show-icon",[w("alert-body",{paddingLeft:"calc(var(--n-icon-margin-left) + var(--n-icon-size) + var(--n-icon-margin-right))"})]),I("right-adjust",[w("alert-body",{paddingRight:"calc(var(--n-close-size) + var(--n-padding) + 2px)"})]),w("alert-body",`
border-radius: var(--n-border-radius);
transition: border-color .3s var(--n-bezier);
`,[M("title",`
transition: color .3s var(--n-bezier);
font-size: 16px;
line-height: 19px;
font-weight: var(--n-title-font-weight);
`,[O("& +",[M("content",{marginTop:"9px"})])]),M("content",{transition:"color .3s var(--n-bezier)",fontSize:"var(--n-font-size)"})]),M("icon",{transition:"color .3s var(--n-bezier)"})]),nC=Object.assign(Object.assign({},ye.props),{title:String,showIcon:{type:Boolean,default:!0},type:{type:String,default:"default"},bordered:{type:Boolean,default:!0},closable:Boolean,onClose:Function,onAfterLeave:Function,onAfterHide:Function}),pE=re({name:"Alert",inheritAttrs:!1,props:nC,setup(e){const{mergedClsPrefixRef:t,mergedBorderedRef:r,inlineThemeDisabled:n,mergedRtlRef:o}=Ne(e),i=ye("Alert","-alert",gE,fE,e,t),a=Wt("Alert",o,t),l=P(()=>{const{common:{cubicBezierEaseInOut:g},self:v}=i.value,{fontSize:b,borderRadius:m,titleFontWeight:p,lineHeight:x,iconSize:S,iconMargin:y,iconMarginRtl:C,closeIconSize:k,closeBorderRadius:R,closeSize:$,closeMargin:T,closeMarginRtl:z,padding:F}=v,{type:_}=e,{left:N,right:j}=Lr(y);return{"--n-bezier":g,"--n-color":v[Ce("color",_)],"--n-close-icon-size":k,"--n-close-border-radius":R,"--n-close-color-hover":v[Ce("closeColorHover",_)],"--n-close-color-pressed":v[Ce("closeColorPressed",_)],"--n-close-icon-color":v[Ce("closeIconColor",_)],"--n-close-icon-color-hover":v[Ce("closeIconColorHover",_)],"--n-close-icon-color-pressed":v[Ce("closeIconColorPressed",_)],"--n-icon-color":v[Ce("iconColor",_)],"--n-border":v[Ce("border",_)],"--n-title-text-color":v[Ce("titleTextColor",_)],"--n-content-text-color":v[Ce("contentTextColor",_)],"--n-line-height":x,"--n-border-radius":m,"--n-font-size":b,"--n-title-font-weight":p,"--n-icon-size":S,"--n-icon-margin":y,"--n-icon-margin-rtl":C,"--n-close-size":$,"--n-close-margin":T,"--n-close-margin-rtl":z,"--n-padding":F,"--n-icon-margin-left":N,"--n-icon-margin-right":j}}),s=n?Qe("alert",P(()=>e.type[0]),l,e):void 0,d=D(!0),u=()=>{const{onAfterLeave:g,onAfterHide:v}=e;g&&g(),v&&v()};return{rtlEnabled:a,mergedClsPrefix:t,mergedBordered:r,visible:d,handleCloseClick:()=>{var g;Promise.resolve((g=e.onClose)===null||g===void 0?void 0:g.call(e)).then(v=>{v!==!1&&(d.value=!1)})},handleAfterLeave:()=>{u()},mergedTheme:i,cssVars:n?void 0:l,themeClass:s==null?void 0:s.themeClass,onRender:s==null?void 0:s.onRender}},render(){var e;return(e=this.onRender)===null||e===void 0||e.call(this),c(Ro,{onAfterLeave:this.handleAfterLeave},{default:()=>{const{mergedClsPrefix:t,$slots:r}=this,n={class:[`${t}-alert`,this.themeClass,this.closable&&`${t}-alert--closable`,this.showIcon&&`${t}-alert--show-icon`,!this.title&&this.closable&&`${t}-alert--right-adjust`,this.rtlEnabled&&`${t}-alert--rtl`],style:this.cssVars,role:"alert"};return this.visible?c("div",Object.assign({},Hr(this.$attrs,n)),this.closable&&c(Wo,{clsPrefix:t,class:`${t}-alert__close`,onClick:this.handleCloseClick}),this.bordered&&c("div",{class:`${t}-alert__border`}),this.showIcon&&c("div",{class:`${t}-alert__icon`,"aria-hidden":"true"},yt(r.icon,()=>[c(ut,{clsPrefix:t},{default:()=>{switch(this.type){case"success":return c(pa,null);case"info":return c(Ri,null);case"warning":return c(zi,null);case"error":return c(ga,null);default:return null}}})])),c("div",{class:[`${t}-alert-body`,this.mergedBordered&&`${t}-alert-body--bordered`]},Tt(r.header,o=>{const i=o||this.title;return i?c("div",{class:`${t}-alert-body__title`},i):null}),r.default&&c("div",{class:`${t}-alert-body__content`},r))):null}})}}),mE={linkFontSize:"13px",linkPadding:"0 0 0 16px",railWidth:"4px"},oC=e=>{const{borderRadius:t,railColor:r,primaryColor:n,primaryColorHover:o,primaryColorPressed:i,textColor2:a}=e;return Object.assign(Object.assign({},mE),{borderRadius:t,railColor:r,railColorActive:n,linkColor:je(n,{alpha:.15}),linkTextColor:a,linkTextColorHover:o,linkTextColorPressed:i,linkTextColorActive:n})},bE={name:"Anchor",common:tt,self:oC},xE={name:"Anchor",common:et,self:oC},yE=w("anchor",`
position: relative;
`,[xt("block",`
padding-left: var(--n-rail-width);
`,[w("anchor-link",[O("+, >",[w("anchor-link",`
margin-top: .5em;
`)])]),w("anchor-link-background",`
max-width: 0;
border-top-right-radius: 10.5px;
border-bottom-right-radius: 10.5px;
`),xt("show-rail",[O(">",[w("anchor-link","padding-left: 0;")])])]),I("block",[w("anchor-link",`
margin-bottom: 4px;
padding: 2px 8px;
transition: background-color .3s var(--n-bezier);
background-color: transparent;
border-radius: var(--n-link-border-radius);
`,[I("active",`
background-color: var(--n-link-color);
`)])]),w("anchor-link-background",`
position: absolute;
left: calc(var(--n-rail-width) / 2);
width: 100%;
background-color: var(--n-link-color);
transition:
top .15s var(--n-bezier),
max-width .15s var(--n-bezier),
background-color .3s var(--n-bezier);
`),w("anchor-rail",`
position: absolute;
left: 0;
top: 0;
bottom: 0;
width: var(--n-rail-width);
border-radius: calc(var(--n-rail-width) / 2);
overflow: hidden;
transition: background-color .3s var(--n-bezier);
background-color: var(--n-rail-color);
`,[M("bar",`
position: absolute;
left: 0;
width: var(--n-rail-width);
height: 21px;
background-color: #0000;
transition:
top .15s var(--n-bezier),
background-color .3s var(--n-bezier);
`,[I("active",{backgroundColor:"var(--n-rail-color-active)"})])]),w("anchor-link",`
padding: var(--n-link-padding);
position: relative;
line-height: 1.5;
font-size: var(--n-link-font-size);
min-height: 1.5em;
display: flex;
flex-direction: column;
`,[I("active",[O(">",[M("title",`
color: var(--n-link-text-color-active);
`)])]),M("title",`
outline: none;
max-width: 100%;
text-decoration: none;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
cursor: pointer;
display: inline-block;
padding-right: 16px;
transition: color .3s var(--n-bezier);
color: var(--n-link-text-color);
`,[O("&:hover, &:focus",`
color: var(--n-link-text-color-hover);
`),O("&:active",`
color: var(--n-link-text-color-pressed);
`)])])]),yd="n-anchor",iC={title:String,href:String},CE=re({name:"AnchorLink",props:iC,setup(e,{slots:t}){const r=D(null),n=De(yd),o=ve(e,"href"),i=ct(()=>o.value&&o.value===n.activeHref.value);j3(yd,"collectedLinkHrefs",o),V3(yd,"titleEls",()=>r.value),ft(i,l=>{l&&r.value&&n.updateBarPosition(r.value)});function a(){e.href!==void 0&&n.setActiveHref(e.href)}return()=>{var l;const{value:s}=n.mergedClsPrefix;return c("div",{class:[`${s}-anchor-link`,i.value&&`${s}-anchor-link--active`]},c("a",{ref:r,class:[`${s}-anchor-link__title`],href:e.href,title:Ga(e.title),onClick:a},e.title),(l=t.default)===null||l===void 0?void 0:l.call(t))}}});function wE(e,t){const{top:r,height:n}=e.getBoundingClientRect(),o=t instanceof HTMLElement?t.getBoundingClientRect().top:0;return{top:r-o,height:n}}const eg={type:{type:String,default:"rail"},showRail:{type:Boolean,default:!0},showBackground:{type:Boolean,default:!0},bound:{type:Number,default:12},internalScrollable:Boolean,ignoreGap:Boolean,offsetTarget:[String,Object,Function]},SE=Yr(eg),kE=re({name:"BaseAnchor",props:Object.assign(Object.assign({},eg),{mergedClsPrefix:{type:String,required:!0}}),setup(e){const t=[],r=[],n=D(null),o=D(null),i=D(null),a=D(null),l=P(()=>e.type==="block"),s=P(()=>!l.value&&e.showRail);function d(){const{value:v}=i,{value:b}=o;v&&(v.style.transition="none"),b&&(b.style.transition="none"),r&&r.forEach(m=>{m.style.transition="none"}),Ot(()=>{const{value:m}=i,{value:p}=o;m&&(m.offsetWidth,m.style.transition=""),p&&(p.offsetWidth,p.style.transition=""),r&&r.forEach(x=>{x.offsetWidth,x.style.transition=""})})}function u(v,b=!0){const{value:m}=i,{value:p}=o,{value:x}=a;if(!x||!m)return;b||(m.style.transition="none",p&&(p.style.transition="none"));const{offsetHeight:S,offsetWidth:y}=v,{top:C,left:k}=v.getBoundingClientRect(),{top:R,left:$}=x.getBoundingClientRect(),T=C-R,z=k-$;m.style.top=`${T}px`,m.style.height=`${S}px`,p&&(p.style.top=`${T}px`,p.style.height=`${S}px`,p.style.maxWidth=`${y+z}px`),m.offsetHeight,p&&p.offsetHeight,b||(m.style.transition="",p&&(p.style.transition=""))}function f(v,b=!0){const m=/^#([^#]+)$/.exec(v);if(!m)return;const p=document.getElementById(m[1]);p&&(n.value=v,p.scrollIntoView(),b||d(),h())}const h=Ll(()=>{g(!0)},128);function g(v=!0){var b;const m=[],p=gv((b=e.offsetTarget)!==null&&b!==void 0?b:document);t.forEach(k=>{const R=/#([^#]+)$/.exec(k);if(!R)return;const $=document.getElementById(R[1]);if($&&p){const{top:T,height:z}=wE($,p);m.push({top:T,height:z,href:k})}}),m.sort((k,R)=>k.top>R.top?1:(k.top===R.top&&k.height<R.height,-1));const x=n.value,{bound:S,ignoreGap:y}=e,C=m.reduce((k,R)=>R.top+R.height<0?y?R:k:R.top<=S?k===null?R:R.top===k.top?R.href===x?R:k:R.top>k.top?R:k:k,null);v||d(),C?n.value=C.href:n.value=null}return ot(yd,{activeHref:n,mergedClsPrefix:ve(e,"mergedClsPrefix"),updateBarPosition:u,setActiveHref:f,collectedLinkHrefs:t,titleEls:r}),Bt(()=>{document.addEventListener("scroll",h,!0),f(window.location.hash),g(!1)}),Cc(()=>{f(window.location.hash),g(!1)}),Ut(()=>{document.removeEventListener("scroll",h,!0)}),ft(n,v=>{if(v===null){const{value:b}=o;b&&!l.value&&(b.style.maxWidth="0")}}),{selfRef:a,barRef:i,slotRef:o,setActiveHref:f,activeHref:n,isBlockType:l,mergedShowRail:s}},render(){var e;const{mergedClsPrefix:t,mergedShowRail:r,isBlockType:n,$slots:o}=this,i=c("div",{class:[`${t}-anchor`,n&&`${t}-anchor--block`,r&&`${t}-anchor--show-rail`],ref:"selfRef"},r&&this.showBackground?c("div",{ref:"slotRef",class:`${t}-anchor-link-background`}):null,r?c("div",{class:`${t}-anchor-rail`},c("div",{ref:"barRef",class:[`${t}-anchor-rail__bar`,this.activeHref!==null&&`${t}-anchor-rail__bar--active`]})):null,(e=o.default)===null||e===void 0?void 0:e.call(o));return this.internalScrollable?c(sr,null,{default:()=>i}):i}}),aC=Object.assign(Object.assign(Object.assign(Object.assign({},ye.props),{affix:Boolean}),zc),eg),RE=re({name:"Anchor",props:aC,setup(e,{slots:t}){const{mergedClsPrefixRef:r,inlineThemeDisabled:n}=Ne(e),o=ye("Anchor","-anchor",yE,bE,e,r),i=D(null),a=P(()=>{const{self:{railColor:s,linkColor:d,railColorActive:u
max-width: 100%;
cursor: text;
line-height: 1.5;
z-index: auto;
outline: none;
box-sizing: border-box;
position: relative;
display: inline-flex;
border-radius: var(--n-border-radius);
background-color: var(--n-color);
transition: background-color .3s var(--n-bezier);
font-size: var(--n-font-size);
--n-padding-vertical: calc((var(--n-height) - 1.5 * var(--n-font-size)) / 2);
`,[M("input, textarea",`
overflow: hidden;
flex-grow: 1;
position: relative;
`),M("input-el, textarea-el, input-mirror, textarea-mirror, separator, placeholder",`
box-sizing: border-box;
font-size: inherit;
line-height: 1.5;
font-family: inherit;
border: none;
outline: none;
background-color: #0000;
text-align: inherit;
transition:
-webkit-text-fill-color .3s var(--n-bezier),
caret-color .3s var(--n-bezier),
color .3s var(--n-bezier),
text-decoration-color .3s var(--n-bezier);
`),M("input-el, textarea-el",`
-webkit-appearance: none;
scrollbar-width: none;
width: 100%;
min-width: 0;
text-decoration-color: var(--n-text-decoration-color);
color: var(--n-text-color);
caret-color: var(--n-caret-color);
background-color: transparent;
`,[O("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",`
width: 0;
height: 0;
display: none;
`),O("&::placeholder",`
color: #0000;
-webkit-text-fill-color: transparent !important;
`),O("&:-webkit-autofill ~",[M("placeholder","display: none;")])]),I("round",[xt("textarea","border-radius: calc(var(--n-height) / 2);")]),M("placeholder",`
pointer-events: none;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
overflow: hidden;
color: var(--n-placeholder-color);
`,[O("span",`
width: 100%;
display: inline-block;
`)]),I("textarea",[M("placeholder","overflow: visible;")]),xt("autosize","width: 100%;"),I("autosize",[M("textarea-el, input-el",`
position: absolute;
top: 0;
left: 0;
height: 100%;
`)]),w("input-wrapper",`
overflow: hidden;
display: inline-flex;
flex-grow: 1;
position: relative;
padding-left: var(--n-padding-left);
padding-right: var(--n-padding-right);
`),M("input-mirror",`
padding: 0;
height: var(--n-height);
line-height: var(--n-height);
overflow: hidden;
visibility: hidden;
position: static;
white-space: pre;
pointer-events: none;
`),M("input-el",`
padding: 0;
height: var(--n-height);
line-height: var(--n-height);
`,[O("&[type=password]::-ms-reveal","display: none;"),O("+",[M("placeholder",`
display: flex;
align-items: center;
`)])]),xt("textarea",[M("placeholder","white-space: nowrap;")]),M("eye",`
display: flex;
align-items: center;
justify-content: center;
transition: color .3s var(--n-bezier);
`),I("textarea","width: 100%;",[w("input-word-count",`
position: absolute;
right: var(--n-padding-right);
bottom: var(--n-padding-vertical);
`),I("resizable",[w("input-wrapper",`
resize: vertical;
min-height: var(--n-height);
`)]),M("textarea-el, textarea-mirror, placeholder",`
height: 100%;
padding-left: 0;
padding-right: 0;
padding-top: var(--n-padding-vertical);
padding-bottom: var(--n-padding-vertical);
word-break: break-word;
display: inline-block;
vertical-align: bottom;
box-sizing: border-box;
line-height: var(--n-line-height-textarea);
margin: 0;
resize: none;
white-space: pre-wrap;
scroll-padding-block-end: var(--n-padding-vertical);
`),M("textarea-mirror",`
width: 100%;
pointer-events: none;
overflow: hidden;
visibility: hidden;
position: static;
white-space: pre-wrap;
overflow-wrap: break-word;
`)]),I("pair",[M("input-el, placeholder","text-align: center;"),M("separator",`
display: flex;
align-items: center;
transition: color .3s var(--n-bezier);
color: var(--n-text-color);
white-space: nowrap;
`,[w("icon",`
color: var(--n-icon-color);
`),w("base-icon",`
color: var(--n-icon-color);
`)])]),I("disabled",`
cursor: not-allowed;
background-color: var(--n-color-disabled);
`,[M("border","border: var(--n-border-disabled);"),M("input-el, textarea-el",`
cursor: not-allowed;
color: var(--n-text-color-disabled);
text-decoration-color: var(--n-text-color-disabled);
`),M("placeholder","color: var(--n-placeholder-color-disabled);"),M("separator","color: var(--n-text-color-disabled);",[w("icon",`
color: var(--n-icon-color-disabled);
`),w("base-icon",`
color: var(--n-icon-color-disabled);
`)]),w("input-word-count",`
color: var(--n-count-text-color-disabled);
`),M("suffix, prefix","color: var(--n-text-color-disabled);",[w("icon",`
color: var(--n-icon-color-disabled);
`),w("internal-icon",`
color: var(--n-icon-color-disabled);
`)])]),xt("disabled",[M("eye",`
color: var(--n-icon-color);
cursor: pointer;
`,[O("&:hover",`
color: var(--n-icon-color-hover);
`),O("&:active",`
color: var(--n-icon-color-pressed);
`)]),O("&:hover",[M("state-border","border: var(--n-border-hover);")]),I("focus","background-color: var(--n-color-focus);",[M("state-border",`
border: var(--n-border-focus);
box-shadow: var(--n-box-shadow-focus);
`)])]),M("border, state-border",`
box-sizing: border-box;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
pointer-events: none;
border-radius: inherit;
border: var(--n-border);
transition:
box-shadow .3s var(--n-bezier),
border-color .3s var(--n-bezier);
`),M("state-border",`
border-color: #0000;
z-index: 1;
`),M("prefix","margin-right: 4px;"),M("suffix",`
margin-left: 4px;
`),M("suffix, prefix",`
transition: color .3s var(--n-bezier);
flex-wrap: nowrap;
flex-shrink: 0;
line-height: var(--n-height);
white-space: nowrap;
display: inline-flex;
align-items: center;
justify-content: center;
color: var(--n-suffix-text-color);
`,[w("base-loading",`
font-size: var(--n-icon-size);
margin: 0 2px;
color: var(--n-loading-color);
`),w("base-clear",`
font-size: var(--n-icon-size);
`,[M("placeholder",[w("base-icon",`
transition: color .3s var(--n-bezier);
color: var(--n-icon-color);
font-size: var(--n-icon-size);
`)])]),O(">",[w("icon",`
transition: color .3s var(--n-bezier);
color: var(--n-icon-color);
font-size: var(--n-icon-size);
`)]),w("base-icon",`
font-size: var(--n-icon-size);
`)]),w("input-word-count",`
pointer-events: none;
line-height: 1.5;
font-size: .85em;
color: var(--n-count-text-color);
transition: color .3s var(--n-bezier);
margin-left: 4px;
font-variant: tabular-nums;
`),["warning","error"].map(e=>I(`${e}-status`,[xt("disabled",[w("base-loading",`
color: var(--n-loading-color-${e})
`),M("input-el, textarea-el",`
caret-color: var(--n-caret-color-${e});
`),M("state-border",`
border: var(--n-border-${e});
`),O("&:hover",[M("state-border",`
border: var(--n-border-hover-${e});
`)]),O("&:focus",`
background-color: var(--n-color-focus-${e});
`,[M("state-border",`
box-shadow: var(--n-box-shadow-focus-${e});
border: var(--n-border-focus-${e});
`)]),I("focus",`
background-color: var(--n-color-focus-${e});
`,[M("state-border",`
box-shadow: var(--n-box-shadow-focus-${e});
border: var(--n-border-focus-${e});
`)])])]))]),IE=w("input",[I("disabled",[M("input-el, textarea-el",`
-webkit-text-fill-color: var(--n-text-color-disabled);
`)])]),uC=Object.assign(Object.assign({},ye.props),{bordered:{type:Boolean,default:void 0},type:{type:String,default:"text"},placeholder:[Array,String],defaultValue:{type:[String,Array],default:null},value:[String,Array],disabled:{type:Boolean,default:void 0},size:String,rows:{type:[Number,String],default:3},round:Boolean,minlength:[String,Number],maxlength:[String,Number],clearable:Boolean,autosize:{type:[Boolean,Object],default:!1},pair:Boolean,separator:String,readonly:{type:[String,Boolean],default:!1},passivelyActivated:Boolean,showPasswordOn:String,stateful:{type:Boolean,default:!0},autofocus:Boolean,inputProps:Object,resizable:{type:Boolean,default:!0},showCount:Boolean,loading:{type:Boolean,default:void 0},allowInput:Function,renderCount:Function,onMousedown:Function,onKeydown:Function,onKeyup:[Function,Array],onInput:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onClick:[Function,Array],onChange:[Function,Array],onClear:[Function,Array],countGraphemes:Function,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],textDecoration:[String,Array],attrSize:{type:Number,default:20},onInputBlur:[Function,Array],onInputFocus:[Function,Array],onDeactivate:[Function,Array],onActivate:[Function,Array],onWrapperFocus:[Function,Array],onWrapperBlur:[Function,Array],internalDeactivateOnEnter:Boolean,internalForceFocus:Boolean,internalLoadingBeforeSuffix:{type:Boolean,default:!0},showPasswordToggle:Boolean}),jr=re({name:"Input",props:uC,setup(e){const{mergedClsPrefixRef:t,mergedBorderedRef:r,inlineThemeDisabled:n,mergedRtlRef:o}=Ne(e),i=ye("Input","-input",ME,Dn,e,t);sC&&Fn("-input-safari",IE,t);const a=D(null),l=D(null),s=D(null),d=D(null),u=D(null),f=D(null),h=D(null),g=_E(h),v=D(null),{localeRef:b}=mr("Input"),m=D(e.defaultValue),p=ve(e,"value"),x=$t(p,m),S=Rr(e),{mergedSizeRef:y,mergedDisabledRef:C,mergedStatusRef:k}=S,R=D(!1),$=D(!1),T=D(!1),z=D(!1);let F=null;const _=P(()=>{const{placeholder:fe,pair:Fe}=e;return Fe?Array.isArray(fe)?fe:fe===void 0?["",""]:[fe,fe]:fe===void 0?[b.value.placeholder]:[fe]}),N=P(()=>{const{value:fe}=T,{value:Fe}=x,{value:lt}=_;return!fe&&(Zs(Fe)||Array.isArray(Fe)&&Zs(Fe[0]))&&lt[0]}),j=P(()=>{const{value:fe}=T,{value:Fe}=x,{value:lt}=_;return!fe&&lt[1]&&(Zs(Fe)||Array.isArray(Fe)&&Zs(Fe[1]))}),H=ct(()=>e.internalForceFocus||R.value),Y=ct(()=>{if(C.value||e.readonly||!e.clearable||!H.value&&!$.value)return!1;const{value:fe}=x,{value:Fe}=H;return e.pair?!!(Array.isArray(fe)&&(fe[0]||fe[1]))&&($.value||Fe):!!fe&&($.value||Fe)}),X=P(()=>{const{showPasswordOn:fe}=e;if(fe)return fe;if(e.showPasswordToggle)return"click"}),le=D(!1),ke=P(()=>{const{textDecoration:fe}=e;return fe?Array.isArray(fe)?fe.map(Fe=>({textDecoration:Fe})):[{textDecoration:fe}]:["",""]}),be=D(void 0),Q=()=>{var fe,Fe;if(e.type==="textarea"){const{autosize:lt}=e;if(lt&&(be.value=(Fe=(fe=v.value)===null||fe===void 0?void 0:fe.$el)===null||Fe===void 0?void 0:Fe.offsetWidth),!l.value||typeof lt=="boolean")return;const{paddingTop:Se,paddingBottom:Ie,lineHeight:He}=window.getComputedStyle(l.value),st=Number(Se.slice(0,-2)),ht=Number(Ie.slice(0,-2)),Nt=Number(He.slice(0,-2)),{value:dr}=s;if(!dr)return;if(lt.minRows){const cr=Math.max(lt.minRows,1),Wr=`${st+ht+Nt*cr}px`;dr.style.minHeight=Wr}if(lt.maxRows){const cr=`${st+ht+Nt*lt.maxRows}px`;dr.style.maxHeight=cr}}},L=P(()=>{const{maxlength:fe}=e;return fe===void 0?void 0:Number(fe)});Bt(()=>{const{value:fe}=x;Array.isArray(fe)||$e(fe)});const A=Ho().proxy;function U(fe,Fe){const{onUpdateValue:lt,"onUpdate:value":Se,onInput:Ie}=e,{nTriggerFormInput:He}=S;lt&&ue(lt,fe,Fe),Se&&ue(Se,fe,Fe),Ie&&ue(Ie,fe,Fe),m.value=fe,He()}function ae(fe,Fe){const{onChange:lt}=e,{nTriggerFormChange:Se}=S;lt&&ue(lt,fe,Fe),m.value=fe,Se()}function he(fe){const{onBlur:Fe}=e,{nTriggerFormBlur:lt}=S;Fe&&ue(Fe,fe),lt()}function Re(fe){const{onFocus:Fe}=e,{nTriggerFormFocus:lt}=S;Fe&&ue(Fe,fe),lt()}function Oe(fe){const{onClear:Fe}=e;Fe&&ue(Fe,fe)}function V(fe){const{onInputBlur:Fe}=e;Fe&&ue(Fe,fe)}function Te(fe){const{onInputFocus:Fe}=e;Fe&&ue(Fe,fe)}function Me
`)}else{const{value:Ie}=d;Ie&&(fe?Ie.textContent=fe:Ie.innerHTML="&nbsp;")}}function Xe(){Q()}const Ge=D({top:"0"});function K(fe){var Fe;const{scrollTop:lt}=fe.target;Ge.value.top=`${-lt}px`,(Fe=v.value)===null||Fe===void 0||Fe.syncUnifiedContainer()}let pe=null;Et(()=>{const{autosize:fe,type:Fe}=e;fe&&Fe==="textarea"?pe=ft(x,lt=>{!Array.isArray(lt)&&lt!==F&&$e(lt)}):pe==null||pe()});let Pe=null;Et(()=>{e.type==="textarea"?Pe=ft(x,fe=>{var Fe;!Array.isArray(fe)&&fe!==F&&((Fe=v.value)===null||Fe===void 0||Fe.syncUnifiedContainer())}):Pe==null||Pe()}),ot(cC,{mergedValueRef:x,maxlengthRef:L,mergedClsPrefixRef:t,countGraphemesRef:ve(e,"countGraphemes")});const Ue={wrapperElRef:a,inputElRef:u,textareaElRef:l,isCompositing:T,clear:Je,focus:xe,blur:Ee,select:Ae,deactivate:_e,activate:ce,scrollTo:se},Ye=Wt("Input",o,t),dt=P(()=>{const{value:fe}=y,{common:{cubicBezierEaseInOut:Fe},self:{color:lt,borderRadius:Se,textColor:Ie,caretColor:He,caretColorError:st,caretColorWarning:ht,textDecorationColor:Nt,border:dr,borderDisabled:cr,borderHover:Wr,borderFocus:ze,placeholderColor:Ke,placeholderColorDisabled:Ze,lineHeightTextarea:Ht,colorDisabled:nr,colorFocus:Ct,textColorDisabled:ur,boxShadowFocus:rn,iconSize:un,colorFocusWarning:Yo,boxShadowFocusWarning:Go,borderWarning:$o,borderFocusWarning:Uc,borderHoverWarning:Wc,colorFocusError:Kc,boxShadowFocusError:qc,borderError:Yc,borderFocusError:Gc,borderHoverError:Xc,clearSize:rP,clearColor:nP,clearColorHover:oP,clearColorPressed:iP,iconColor:aP,iconColorDisabled:lP,suffixTextColor:sP,countTextColor:dP,countTextColorDisabled:cP,iconColorHover:uP,iconColorPressed:fP,loadingColor:hP,loadingColorError:vP,loadingColorWarning:gP,[Ce("padding",fe)]:pP,[Ce("fontSize",fe)]:mP,[Ce("height",fe)]:bP}}=i.value,{left:xP,right:yP}=Lr(pP);return{"--n-bezier":Fe,"--n-count-text-color":dP,"--n-count-text-color-disabled":cP,"--n-color":lt,"--n-font-size":mP,"--n-border-radius":Se,"--n-height":bP,"--n-padding-left":xP,"--n-padding-right":yP,"--n-text-color":Ie,"--n-caret-color":He,"--n-text-decoration-color":Nt,"--n-border":dr,"--n-border-disabled":cr,"--n-border-hover":Wr,"--n-border-focus":ze,"--n-placeholder-color":Ke,"--n-placeholder-color-disabled":Ze,"--n-icon-size":un,"--n-line-height-textarea":Ht,"--n-color-disabled":nr,"--n-color-focus":Ct,"--n-text-color-disabled":ur,"--n-box-shadow-focus":rn,"--n-loading-color":hP,"--n-caret-color-warning":ht,"--n-color-focus-warning":Yo,"--n-box-shadow-focus-warning":Go,"--n-border-warning":$o,"--n-border-focus-warning":Uc,"--n-border-hover-warning":Wc,"--n-loading-color-warning":gP,"--n-caret-color-error":st,"--n-color-focus-error":Kc,"--n-box-shadow-focus-error":qc,"--n-border-error":Yc,"--n-border-focus-error":Gc,"--n-border-hover-error":Xc,"--n-loading-color-error":vP,"--n-clear-color":nP,"--n-clear-size":rP,"--n-clear-color-hover":oP,"--n-clear-color-pressed":iP,"--n-icon-color":aP,"--n-icon-color-hover":uP,"--n-icon-color-pressed":fP,"--n-icon-color-disabled":lP,"--n-suffix-text-color":sP}}),pt=n?Qe("input",P(()=>{const{value:fe}=y;return fe[0]}),dt,e):void 0;return Object.assign(Object.assign({},Ue),{wrapperElRef:a,inputElRef:u,inputMirrorElRef:d,inputEl2Ref:f,textareaElRef:l,textareaMirrorElRef:s,textareaScrollbarInstRef:v,rtlEnabled:Ye,uncontrolledValue:m,mergedValue:x,passwordVisible:le,mergedPlaceholder:_,showPlaceholder1:N,showPlaceholder2:j,mergedFocus:H,isComposing:T,activated:z,showClearButton:Y,mergedSize:y,mergedDisabled:C,textDecorationStyle:ke,mergedClsPrefix:t,mergedBordered:r,mergedShowPasswordOn:X,placeholderStyle:Ge,mergedStatus:k,textAreaScrollContainerWidth:be,handleTextAreaScroll:K,handleCompositionStart:ge,handleCompositionEnd:ne,handleInput:ee,handleInputBlur:J,handleInputFocus:oe,handleWrapperBlur:de,handleWrapperFocus:Z,handleMouseEnter:Be,handleMouseLeave:We,handleMouseDown:rt,handleChange:te,handleClick:we,handleClear:Le,handlePasswordToggleClick:it,handlePasswordToggleMousedown:qe,handleWrapperKeydown:Pt,handleWrapperKeyup:at,handleTextAreaMirrorResize:Xe,getTextareaScrollContainer:()=>l.value,mergedTheme:i,cssVars:n?void 0:dt,the
display: inline-flex;
width: 100%;
flex-wrap: nowrap;
vertical-align: bottom;
`,[O(">",[w("input",[O("&:not(:last-child)",`
border-top-right-radius: 0!important;
border-bottom-right-radius: 0!important;
`),O("&:not(:first-child)",`
border-top-left-radius: 0!important;
border-bottom-left-radius: 0!important;
margin-left: -1px!important;
`)]),w("button",[O("&:not(:last-child)",`
border-top-right-radius: 0!important;
border-bottom-right-radius: 0!important;
`,[M("state-border, border",`
border-top-right-radius: 0!important;
border-bottom-right-radius: 0!important;
`)]),O("&:not(:first-child)",`
border-top-left-radius: 0!important;
border-bottom-left-radius: 0!important;
`,[M("state-border, border",`
border-top-left-radius: 0!important;
border-bottom-left-radius: 0!important;
`)])]),O("*",[O("&:not(:last-child)",`
border-top-right-radius: 0!important;
border-bottom-right-radius: 0!important;
`,[O(">",[w("input",`
border-top-right-radius: 0!important;
border-bottom-right-radius: 0!important;
`),w("base-selection",[w("base-selection-label",`
border-top-right-radius: 0!important;
border-bottom-right-radius: 0!important;
`),w("base-selection-tags",`
border-top-right-radius: 0!important;
border-bottom-right-radius: 0!important;
`),M("box-shadow, border, state-border",`
border-top-right-radius: 0!important;
border-bottom-right-radius: 0!important;
`)])])]),O("&:not(:first-child)",`
margin-left: -1px!important;
border-top-left-radius: 0!important;
border-bottom-left-radius: 0!important;
`,[O(">",[w("input",`
border-top-left-radius: 0!important;
border-bottom-left-radius: 0!important;
`),w("base-selection",[w("base-selection-label",`
border-top-left-radius: 0!important;
border-bottom-left-radius: 0!important;
`),w("base-selection-tags",`
border-top-left-radius: 0!important;
border-bottom-left-radius: 0!important;
`),M("box-shadow, border, state-border",`
border-top-left-radius: 0!important;
border-bottom-left-radius: 0!important;
`)])])])])])]),fC={},hC=re({name:"InputGroup",props:fC,setup(e){const{mergedClsPrefixRef:t}=Ne(e);return Fn("-input-group",FE,t),{mergedClsPrefix:t}},render(){const{mergedClsPrefix:e}=this;return c("div",{class:`${e}-input-group`},this.$slots)}}),DE=w("input-group-label",`
position: relative;
user-select: none;
-webkit-user-select: none;
box-sizing: border-box;
padding: 0 12px;
display: inline-block;
border-radius: var(--n-border-radius);
background-color: var(--n-group-label-color);
color: var(--n-group-label-text-color);
font-size: var(--n-font-size);
line-height: var(--n-height);
height: var(--n-height);
flex-shrink: 0;
white-space: nowrap;
transition:
color .3s var(--n-bezier),
background-color .3s var(--n-bezier),
box-shadow .3s var(--n-bezier);
`,[M("border",`
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
border-radius: inherit;
border: var(--n-group-label-border);
transition: border-color .3s var(--n-bezier);
`)]),vC=Object.assign(Object.assign({},ye.props),{size:{type:String,default:"medium"},bordered:{type:Boolean,default:void 0}}),EE=re({name:"InputGroupLabel",props:vC,setup(e){const{mergedBorderedRef:t,mergedClsPrefixRef:r,inlineThemeDisabled:n}=Ne(e),o=ye("Input","-input-group-label",DE,Dn,e,r),i=P(()=>{const{size:l}=e,{common:{cubicBezierEaseInOut:s},self:{groupLabelColor:d,borderRadius:u,groupLabelTextColor:f,lineHeight:h,groupLabelBorder:g,[Ce("fontSize",l)]:v,[Ce("height",l)]:b}}=o.value;return{"--n-bezier":s,"--n-group-label-color":d,"--n-group-label-border":g,"--n-border-radius":u,"--n-group-label-text-color":f,"--n-font-size":v,"--n-line-height":h,"--n-height":b}}),a=n?Qe("input-group-label",P(()=>e.size[0]),i,e):void 0;return{mergedClsPrefix:r,mergedBordered:t,cssVars:n?void 0:i,themeClass:a==null?void 0:a.themeClass,onRender:a==null?void 0:a.onRender}},render(){var e,t,r;const{mergedClsPrefix:n}=this;return(e=this.onRender)===null||e===void 0||e.call(this),c("div",{class:[`${n}-input-group-label`,this.themeClass],style:this.cssVars},(r=(t=this.$slots).default)===null||r===void 0?void 0:r.call(t),this.mergedBordered?c("div",{class:`${n}-input-group-label__border`}):null)}});function gC(e){const{boxShadow2:t}=e;return{menuBoxShadow:t}}const AE={name:"AutoComplete",common:tt,peers:{InternalSelectMenu:sl,Input:Dn},self:gC},BE={name:"AutoComplete",common:et,peers:{InternalSelectMenu:Cs,Input:Xn},self:gC};function NE(e){return e.map(pC)}function pC(e){var t,r;return typeof e=="string"?{label:e,value:e}:e.type==="group"?{type:"group",label:(t=e.label)!==null&&t!==void 0?t:e.name,value:(r=e.value)!==null&&r!==void 0?r:e.name,key:e.key||e.name,children:e.children.map(o=>pC(o))}:e}const LE=O([w("auto-complete",`
z-index: auto;
position: relative;
display: inline-flex;
width: 100%;
`),w("auto-complete-menu",`
margin: 4px 0;
box-shadow: var(--n-menu-box-shadow);
`,[Ar({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]),mC=Object.assign(Object.assign({},ye.props),{to:Kt.propTo,menuProps:Object,append:Boolean,bordered:{type:Boolean,default:void 0},clearable:{type:Boolean,default:void 0},defaultValue:{type:String,default:null},loading:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},placeholder:String,placement:{type:String,default:"bottom-start"},value:String,blurAfterSelect:Boolean,clearAfterSelect:Boolean,getShow:Function,showEmpty:Boolean,inputProps:Object,renderOption:Function,renderLabel:Function,size:String,options:{type:Array,default:()=>[]},zIndex:Number,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onSelect:[Function,Array],onBlur:[Function,Array],onFocus:[Function,Array],onInput:[Function,Array]}),HE=re({name:"AutoComplete",props:mC,setup(e){const{mergedBorderedRef:t,namespaceRef:r,mergedClsPrefixRef:n,inlineThemeDisabled:o}=Ne(e),i=Rr(e),{mergedSizeRef:a,mergedDisabledRef:l,mergedStatusRef:s}=i,d=D(null),u=D(null),f=D(e.defaultValue),h=ve(e,"value"),g=$t(h,f),v=D(!1),b=D(!1),m=ye("AutoComplete","-auto-complete",LE,AE,e,n),p=P(()=>NE(e.options)),x=P(()=>{const{getShow:U}=e;return U?U(g.value||""):!!g.value}),S=P(()=>x.value&&v.value&&(e.showEmpty?!0:!!p.value.length)),y=P(()=>On(p.value,_c("value","children")));function C(U){const{"onUpdate:value":ae,onUpdateValue:he,onInput:Re}=e,{nTriggerFormInput:Oe,nTriggerFormChange:V}=i;he&&ue(he,U),ae&&ue(ae,U),Re&&ue(Re,U),f.value=U,Oe(),V()}function k(U){const{onSelect:ae}=e,{nTriggerFormInput:he,nTriggerFormChange:Re}=i;ae&&ue(ae,U),he(),Re()}function R(U){const{onBlur:ae}=e,{nTriggerFormBlur:he}=i;ae&&ue(ae,U),he()}function $(U){const{onFocus:ae}=e,{nTriggerFormFocus:he}=i;ae&&ue(ae,U),he()}function T(){b.value=!0}function z(){window.setTimeout(()=>{b.value=!1},0)}function F(U){var ae,he,Re;switch(U.key){case"Enter":if(!b.value){const Oe=(ae=u.value)===null||ae===void 0?void 0:ae.getPendingTmNode();Oe&&(_(Oe.rawNode),U.preventDefault())}break;case"ArrowDown":(he=u.value)===null||he===void 0||he.next();break;case"ArrowUp":(Re=u.value)===null||Re===void 0||Re.prev();break}}function _(U){(U==null?void 0:U.value)!==void 0&&(k(U.value),e.clearAfterSelect?C(null):U.label!==void 0&&C(e.append?`${g.value}${U.label}`:U.label),v.value=!1,e.blurAfterSelect&&ke())}function N(){C(null)}function j(U){v.value=!0,$(U)}function H(U){v.value=!1,R(U)}function Y(U){v.value=!0,C(U)}function X(U){_(U.rawNode)}function le(U){var ae;!((ae=d.value)===null||ae===void 0)&&ae.contains(mn(U))||(v.value=!1)}function ke(){var U,ae;!((U=d.value)===null||U===void 0)&&U.contains(document.activeElement)&&((ae=document.activeElement)===null||ae===void 0||ae.blur())}const be=P(()=>{const{common:{cubicBezierEaseInOut:U},self:{menuBoxShadow:ae}}=m.value;return{"--n-menu-box-shadow":ae,"--n-bezier":U}}),Q=o?Qe("auto-complete",void 0,be,e):void 0,L=D(null),A={focus:()=>{var U;(U=L.value)===null||U===void 0||U.focus()},blur:()=>{var U;(U=L.value)===null||U===void 0||U.blur()}};return{focus:A.focus,blur:A.blur,inputInstRef:L,uncontrolledValue:f,mergedValue:g,isMounted:Ur(),adjustedTo:Kt(e),menuInstRef:u,triggerElRef:d,treeMate:y,mergedSize:a,mergedDisabled:l,active:S,mergedStatus:s,handleClear:N,handleFocus:j,handleBlur:H,handleInput:Y,handleToggle:X,handleClickOutsideMenu:le,handleCompositionStart:T,handleCompositionEnd:z,handleKeyDown:F,mergedTheme:m,cssVars:o?void 0:be,themeClass:Q==null?void 0:Q.themeClass,onRender:Q==null?void 0:Q.onRender,mergedBordered:t,namespace:r,mergedClsPrefix:n}},render(){const{mergedClsPrefix:e}=this;return c("div",{class:`${e}-auto-complete`,ref:"triggerElRef",onKeydown:this.handleKeyDown,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd},c(qn,null,{default:()=>[c(Yn,null,{default:()=>{if(this.$slots.default)return Id(this.$slots,"default",{handleInput:this.handleInput,handleFocus:this.handleFocus,handleBlur:this.handleBlur,value:this.mergedValue});const{mergedTheme:r}=this;return c(jr,{ref:"inputIns
width: var(--n-merged-size);
height: var(--n-merged-size);
color: #FFF;
font-size: var(--n-font-size);
display: inline-flex;
position: relative;
overflow: hidden;
text-align: center;
border: var(--n-border);
border-radius: var(--n-border-radius);
--n-merged-color: var(--n-color);
background-color: var(--n-merged-color);
transition:
border-color .3s var(--n-bezier),
background-color .3s var(--n-bezier),
color .3s var(--n-bezier);
`,[So(O("&","--n-merged-color: var(--n-color-modal);")),jo(O("&","--n-merged-color: var(--n-color-popover);")),O("img",`
width: 100%;
height: 100%;
`),M("text",`
white-space: nowrap;
display: inline-block;
position: absolute;
left: 50%;
top: 50%;
`),w("icon",`
vertical-align: bottom;
font-size: calc(var(--n-merged-size) - 6px);
`),M("text","line-height: 1.25")]),kC=Object.assign(Object.assign({},ye.props),{size:[String,Number],src:String,circle:{type:Boolean,default:void 0},objectFit:String,round:{type:Boolean,default:void 0},bordered:{type:Boolean,default:void 0},onError:Function,fallbackSrc:String,intersectionObserverOptions:Object,lazy:Boolean,onLoad:Function,renderPlaceholder:Function,renderFallback:Function,imgProps:Object,color:String}),Vf=re({name:"Avatar",props:kC,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:r}=Ne(e),n=D(!1);let o=null;const i=D(null),a=D(null),l=()=>{const{value:x}=i;if(x&&(o===null||o!==x.innerHTML)){o=x.innerHTML;const{value:S}=a;if(S){const{offsetWidth:y,offsetHeight:C}=S,{offsetWidth:k,offsetHeight:R}=x,$=.9,T=Math.min(y/k*$,C/R*$,1);x.style.transform=`translateX(-50%) translateY(-50%) scale(${T})`}}},s=De(SC,null),d=P(()=>{const{size:x}=e;if(x)return x;const{size:S}=s||{};return S||"medium"}),u=ye("Avatar","-avatar",VE,CC,e,t),f=De(Q1,null),h=P(()=>{if(s)return!0;const{round:x,circle:S}=e;return x!==void 0||S!==void 0?x||S:f?f.roundRef.value:!1}),g=P(()=>s?!0:e.bordered||!1),v=P(()=>{const x=d.value,S=h.value,y=g.value,{color:C}=e,{self:{borderRadius:k,fontSize:R,color:$,border:T,colorModal:z,colorPopover:F},common:{cubicBezierEaseInOut:_}}=u.value;let N;return typeof x=="number"?N=`${x}px`:N=u.value.self[Ce("height",x)],{"--n-font-size":R,"--n-border":y?T:"none","--n-border-radius":S?"50%":k,"--n-color":C||$,"--n-color-modal":C||z,"--n-color-popover":C||F,"--n-bezier":_,"--n-merged-size":`var(--n-avatar-size-override, ${N})`}}),b=r?Qe("avatar",P(()=>{const x=d.value,S=h.value,y=g.value,{color:C}=e;let k="";return x&&(typeof x=="number"?k+=`a${x}`:k+=x[0]),S&&(k+="b"),y&&(k+="c"),C&&(k+=ra(C)),k}),v,e):void 0,m=D(!e.lazy);Bt(()=>{if(e.lazy&&e.intersectionObserverOptions){let x;const S=Et(()=>{x==null||x(),x=void 0,e.lazy&&(x=xC(a.value,e.intersectionObserverOptions,m))});Ut(()=>{S(),x==null||x()})}}),ft(()=>{var x;return e.src||((x=e.imgProps)===null||x===void 0?void 0:x.src)},()=>{n.value=!1});const p=D(!e.lazy);return{textRef:i,selfRef:a,mergedRoundRef:h,mergedClsPrefix:t,fitTextTransform:l,cssVars:r?void 0:v,themeClass:b==null?void 0:b.themeClass,onRender:b==null?void 0:b.onRender,hasLoadError:n,shouldStartLoading:m,loaded:p,mergedOnError:x=>{if(!m.value)return;n.value=!0;const{onError:S,imgProps:{onError:y}={}}=e;S==null||S(x),y==null||y(x)},mergedOnLoad:x=>{const{onLoad:S,imgProps:{onLoad:y}={}}=e;S==null||S(x),y==null||y(x),p.value=!0}}},render(){var e,t;const{$slots:r,src:n,mergedClsPrefix:o,lazy:i,onRender:a,loaded:l,hasLoadError:s,imgProps:d={}}=this;a==null||a();let u;const f=!l&&!s&&(this.renderPlaceholder?this.renderPlaceholder():(t=(e=this.$slots).placeholder)===null||t===void 0?void 0:t.call(e));return this.hasLoadError?u=this.renderFallback?this.renderFallback():yt(r.fallback,()=>[c("img",{src:this.fallbackSrc,style:{objectFit:this.objectFit}})]):u=Tt(r.default,h=>{if(h)return c(gn,{onResize:this.fitTextTransform},{default:()=>c("span",{ref:"textRef",class:`${o}-avatar__text`},h)});if(n||d.src){const g=this.src||d.src;return c("img",Object.assign(Object.assign({},d),{loading:bC&&!this.intersectionObserverOptions&&i?"lazy":"eager",src:i&&this.intersectionObserverOptions?this.shouldStartLoading?g:void 0:g,"data-image-src":g,onLoad:this.mergedOnLoad,onError:this.mergedOnError,style:[d.style||"",{objectFit:this.objectFit},f?{height:"0",width:"0",visibility:"hidden",position:"absolute"}:""]}))}}),c("span",{ref:"selfRef",class:[`${o}-avatar`,this.themeClass],style:this.cssVars},u,i&&f)}}),UE=w("avatar-group",`
flex-wrap: nowrap;
display: inline-flex;
position: relative;
`,[I("expand-on-hover",[w("avatar",[O("&:not(:first-child)",`
transition: margin .3s var(--n-bezier);
`)]),O("&:hover",[xt("vertical",[w("avatar",[O("&:not(:first-child)",`
margin-left: 0 !important;
`)])]),I("vertical",[w("avatar",[O("&:not(:first-child)",`
margin-top: 0 !important;
`)])])])]),xt("vertical",`
flex-direction: row;
`,[w("avatar",[O("&:not(:first-child)",`
margin-left: var(--n-gap);
`)])]),I("vertical",`
flex-direction: column;
`,[w("avatar",[O("&:not(:first-child)",`
margin-top: var(--n-gap);
`)])])]),RC=()=>({gap:"-12px"}),WE={name:"AvatarGroup",common:tt,peers:{Avatar:CC},self:RC},KE={name:"AvatarGroup",common:et,peers:{Avatar:wC},self:RC},PC=Object.assign(Object.assign({},ye.props),{max:Number,maxStyle:[Object,String],options:{type:Array,default:()=>[]},vertical:Boolean,expandOnHover:Boolean,size:[String,Number]}),qE=re({name:"AvatarGroup",props:PC,setup(e){const{mergedClsPrefixRef:t,mergedRtlRef:r}=Ne(e),n=ye("AvatarGroup","-avatar-group",UE,WE,e,t);ot(SC,e);const o=Wt("AvatarGroup",r,t),i=P(()=>{const{max:l}=e;if(l===void 0)return;const{options:s}=e;return s.length>l?s.slice(l-1,s.length):[]}),a=P(()=>{const{options:l,max:s}=e;return s===void 0?l:l.length>s?l.slice(0,s-1):l.length===s?l.slice(0,s):l});return{mergedTheme:n,rtlEnabled:o,mergedClsPrefix:t,restOptions:i,displayedOptions:a,cssVars:P(()=>({"--n-gap":n.value.self.gap}))}},render(){const{mergedClsPrefix:e,displayedOptions:t,restOptions:r,mergedTheme:n,$slots:o}=this;return c("div",{class:[`${e}-avatar-group`,this.rtlEnabled&&`${e}-avatar-group--rtl`,this.vertical&&`${e}-avatar-group--vertical`,this.expandOnHover&&`${e}-avatar-group--expand-on-hover`],style:this.cssVars,role:"group"},t.map(i=>o.avatar?o.avatar({option:i}):c(Vf,{src:i.src,theme:n.peers.Avatar,themeOverrides:n.peerOverrides.Avatar})),r!==void 0&&r.length>0&&(o.rest?o.rest({options:r,rest:r.length}):c(Vf,{style:this.maxStyle,theme:n.peers.Avatar,themeOverrides:n.peerOverrides.Avatar},{default:()=>`+${r.length}`})))}}),TC={width:"44px",height:"44px",borderRadius:"22px",iconSize:"26px"},YE={name:"BackTop",common:et,self(e){const{popoverColor:t,textColor2:r,primaryColorHover:n,primaryColorPressed:o}=e;return Object.assign(Object.assign({},TC),{color:t,textColor:r,iconColor:r,iconColorHover:n,iconColorPressed:o,boxShadow:"0 2px 8px 0px rgba(0, 0, 0, .12)",boxShadowHover:"0 2px 12px 0px rgba(0, 0, 0, .18)",boxShadowPressed:"0 2px 12px 0px rgba(0, 0, 0, .18)"})}},GE=e=>{const{popoverColor:t,textColor2:r,primaryColorHover:n,primaryColorPressed:o}=e;return Object.assign(Object.assign({},TC),{color:t,textColor:r,iconColor:r,iconColorHover:n,iconColorPressed:o,boxShadow:"0 2px 8px 0px rgba(0, 0, 0, .12)",boxShadowHover:"0 2px 12px 0px rgba(0, 0, 0, .18)",boxShadowPressed:"0 2px 12px 0px rgba(0, 0, 0, .18)"})},XE={name:"BackTop",common:tt,self:GE},ZE=c("svg",{viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xlinkHref:"http://www.w3.org/1999/xlink"},c("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},c("g",{transform:"translate(-139.000000, -4423.000000)","fill-rule":"nonzero"},c("g",{transform:"translate(120.000000, 4285.000000)"},c("g",{transform:"translate(7.000000, 126.000000)"},c("g",{transform:"translate(24.000000, 24.000000) scale(1, -1) translate(-24.000000, -24.000000) translate(12.000000, 12.000000)"},c("g",{transform:"translate(4.000000, 2.000000)"},c("path",{d:"M8,0 C8.51283584,0 8.93550716,0.38604019 8.99327227,0.883378875 L9,1 L9,10.584 L12.2928932,7.29289322 C12.6834175,6.90236893 13.3165825,6.90236893 13.7071068,7.29289322 C14.0675907,7.65337718 14.0953203,8.22060824 13.7902954,8.61289944 L13.7071068,8.70710678 L8.70710678,13.7071068 L8.62544899,13.7803112 L8.618,13.784 L8.59530661,13.8036654 L8.4840621,13.8753288 L8.37133602,13.9287745 L8.22929083,13.9735893 L8.14346259,13.9897165 L8.03324678,13.9994506 L7.9137692,13.9962979 L7.77070917,13.9735893 L7.6583843,13.9401293 L7.57677845,13.9063266 L7.47929125,13.8540045 L7.4048407,13.8036865 L7.38131006,13.7856883 C7.35030318,13.7612383 7.32077858,13.7349921 7.29289322,13.7071068 L2.29289322,8.70710678 L2.20970461,8.61289944 C1.90467972,8.22060824 1.93240926,7.65337718 2.29289322,7.29289322 C2.65337718,6.93240926 3.22060824,6.90467972 3.61289944,7.20970461 L3.70710678,7.29289322 L7,10.585 L7,1 L7.00672773,0.883378875 C7.06449284,0.38604019 7.48716416,0 8,0 Z"}),c("path",{d:"M14.9333333,15.9994506 C15.5224371,15.9994506 16,16.4471659 16,16.9994506 C16,17.5122865 15.5882238,17.9349578 15.0577292,17.9927229 L14.9333333,17.9994506 L1.06666667,17.9994506 C0.477562934,17.9994506 0,17.5517354 0,16.9994506 C0
position: fixed;
right: 40px;
bottom: 40px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
color: var(--n-text-color);
transition:
color .3s var(--n-bezier),
box-shadow .3s var(--n-bezier),
background-color .3s var(--n-bezier);
border-radius: var(--n-border-radius);
height: var(--n-height);
min-width: var(--n-width);
box-shadow: var(--n-box-shadow);
background-color: var(--n-color);
`,[Ar(),I("transition-disabled",{transition:"none !important"}),w("base-icon",`
font-size: var(--n-icon-size);
color: var(--n-icon-color);
transition: color .3s var(--n-bezier);
`),O("svg",{pointerEvents:"none"}),O("&:hover",{boxShadow:"var(--n-box-shadow-hover)"},[w("base-icon",{color:"var(--n-icon-color-hover)"})]),O("&:active",{boxShadow:"var(--n-box-shadow-pressed)"},[w("base-icon",{color:"var(--n-icon-color-pressed)"})])]),$C=Object.assign(Object.assign({},ye.props),{show:{type:Boolean,default:void 0},right:{type:[Number,String],default:40},bottom:{type:[Number,String],default:40},to:{type:[String,Object],default:"body"},visibilityHeight:{type:Number,default:180},listenTo:[String,Object,Function],"onUpdate:show":{type:Function,default:()=>{}},target:Function,onShow:Function,onHide:Function}),JE=re({name:"BackTop",inheritAttrs:!1,props:$C,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:r}=Ne(e),n=D(null),o=D(!1);Et(()=>{const{value:y}=n;if(y===null){o.value=!1;return}o.value=y>=e.visibilityHeight});const i=D(!1);ft(o,y=>{var C;i.value&&((C=e["onUpdate:show"])===null||C===void 0||C.call(e,y))});const a=ve(e,"show"),l=$t(a,o),s=D(!0),d=D(null),u=P(()=>({right:`calc(${zt(e.right)} + ${Tf.value})`,bottom:zt(e.bottom)}));let f,h;ft(l,y=>{var C,k;i.value&&(y&&((C=e.onShow)===null||C===void 0||C.call(e)),(k=e.onHide)===null||k===void 0||k.call(e))});const g=ye("BackTop","-back-top",QE,XE,e,t);function v(){var y;if(h)return;h=!0;const C=((y=e.target)===null||y===void 0?void 0:y.call(e))||gv(e.listenTo)||Bx(d.value);if(!C)return;f=C===document.documentElement?document:C;const{to:k}=e;typeof k=="string"&&document.querySelector(k),f.addEventListener("scroll",m),m()}function b(){(dm(f)?document.documentElement:f).scrollTo({top:0,behavior:"smooth"})}function m(){n.value=(dm(f)?document.documentElement:f).scrollTop,i.value||Ot(()=>{i.value=!0})}function p(){s.value=!1}Bt(()=>{v(),s.value=l.value}),Ut(()=>{f&&f.removeEventListener("scroll",m)});const x=P(()=>{const{self:{color:y,boxShadow:C,boxShadowHover:k,boxShadowPressed:R,iconColor:$,iconColorHover:T,iconColorPressed:z,width:F,height:_,iconSize:N,borderRadius:j,textColor:H},common:{cubicBezierEaseInOut:Y}}=g.value;return{"--n-bezier":Y,"--n-border-radius":j,"--n-height":_,"--n-width":F,"--n-box-shadow":C,"--n-box-shadow-hover":k,"--n-box-shadow-pressed":R,"--n-color":y,"--n-icon-size":N,"--n-icon-color":$,"--n-icon-color-hover":T,"--n-icon-color-pressed":z,"--n-text-color":H}}),S=r?Qe("back-top",void 0,x,e):void 0;return{placeholderRef:d,style:u,mergedShow:l,isMounted:Ur(),scrollElement:D(null),scrollTop:n,DomInfoReady:i,transitionDisabled:s,mergedClsPrefix:t,handleAfterEnter:p,handleScroll:m,handleClick:b,cssVars:r?void 0:x,themeClass:S==null?void 0:S.themeClass,onRender:S==null?void 0:S.onRender}},render(){const{mergedClsPrefix:e}=this;return c("div",{ref:"placeholderRef",class:`${e}-back-top-placeholder`,style:"display: none","aria-hidden":!0},c(bs,{to:this.to,show:this.mergedShow},{default:()=>c(At,{name:"fade-in-scale-up-transition",appear:this.isMounted,onAfterEnter:this.handleAfterEnter},{default:()=>{var t;return(t=this.onRender)===null||t===void 0||t.call(this),this.mergedShow?c("div",Hr(this.$attrs,{class:[`${e}-back-top`,this.themeClass,this.transitionDisabled&&`${e}-back-top--transition-disabled`],style:[this.style,this.cssVars],onClick:this.handleClick}),yt(this.$slots.default,()=>[c(ut,{clsPrefix:e},{default:()=>ZE})])):null}})}))}}),eA={name:"Badge",common:et,self(e){const{errorColorSuppl:t,infoColorSuppl:r,successColorSuppl:n,warningColorSuppl:o,fontFamily:i}=e;return{color:t,colorInfo:r,colorSuccess:n,colorError:t,colorWarning:o,fontSize:"12px",fontFamily:i}}},tA=e=>{const{errorColor:t,infoColor:r,successColor:n,warningColor:o,fontFamily:i}=e;return{color:t,colorInfo:r,colorSuccess:n,colorError:t,colorWarning:o,fontSize:"12px",fontFamily:i}},rA={name:"Badge",common:tt,self:tA},nA=O([O("@keyframes badge-wave-spread",{from:{boxShadow:"0 0 0.5px 0px var(--n-ripple-color)",opacity:.6},to:{boxShadow:"0 0 0.5px 4.5px var(--n-ripple-color)",opacity:0}}),w("badge",`
display: inline-flex;
position: relative;
vertical-align: middle;
font-family: var(--n-font-family);
`,[I("as-is",[w("badge-sup",{position:"static",transform:"translateX(0)"},[Ar({transformOrigin:"left bottom",originalTransform:"translateX(0)"})])]),I("dot",[w("badge-sup",`
height: 8px;
width: 8px;
padding: 0;
min-width: 8px;
left: 100%;
bottom: calc(100% - 4px);
`,[O("::before","border-radius: 4px;")])]),w("badge-sup",`
background: var(--n-color);
transition:
background-color .3s var(--n-bezier),
color .3s var(--n-bezier);
color: #FFF;
position: absolute;
height: 18px;
line-height: 18px;
border-radius: 9px;
padding: 0 6px;
text-align: center;
font-size: var(--n-font-size);
transform: translateX(-50%);
left: 100%;
bottom: calc(100% - 9px);
font-variant-numeric: tabular-nums;
z-index: 1;
display: flex;
align-items: center;
`,[Ar({transformOrigin:"left bottom",originalTransform:"translateX(-50%)"}),w("base-wave",{zIndex:1,animationDuration:"2s",animationIterationCount:"infinite",animationDelay:"1s",animationTimingFunction:"var(--n-ripple-bezier)",animationName:"badge-wave-spread"}),O("&::before",`
opacity: 0;
transform: scale(1);
border-radius: 9px;
content: "";
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
`)])])]),zC=Object.assign(Object.assign({},ye.props),{value:[String,Number],max:Number,dot:Boolean,type:{type:String,default:"default"},show:{type:Boolean,default:!0},showZero:Boolean,processing:Boolean,color:String,offset:Array}),oA=re({name:"Badge",props:zC,setup(e,{slots:t}){const{mergedClsPrefixRef:r,inlineThemeDisabled:n,mergedRtlRef:o}=Ne(e),i=ye("Badge","-badge",nA,rA,e,r),a=D(!1),l=()=>{a.value=!0},s=()=>{a.value=!1},d=P(()=>e.show&&(e.dot||e.value!==void 0&&!(!e.showZero&&Number(e.value)<=0)||!Zi(t.value)));Bt(()=>{d.value&&(a.value=!0)});const u=Wt("Badge",o,r),f=P(()=>{const{type:v,color:b}=e,{common:{cubicBezierEaseInOut:m,cubicBezierEaseOut:p},self:{[Ce("color",v)]:x,fontFamily:S,fontSize:y}}=i.value;return{"--n-font-size":y,"--n-font-family":S,"--n-color":b||x,"--n-ripple-color":b||x,"--n-bezier":m,"--n-ripple-bezier":p}}),h=n?Qe("badge",P(()=>{let v="";const{type:b,color:m}=e;return b&&(v+=b[0]),m&&(v+=ra(m)),v}),f,e):void 0,g=P(()=>{const{offset:v}=e;if(!v)return;const[b,m]=v,p=typeof b=="number"?`${b}px`:b,x=typeof m=="number"?`${m}px`:m;return{transform:`translate(calc(${u!=null&&u.value?"50%":"-50%"} + ${p}), ${x})`}});return{rtlEnabled:u,mergedClsPrefix:r,appeared:a,showBadge:d,handleAfterEnter:l,handleAfterLeave:s,cssVars:n?void 0:f,themeClass:h==null?void 0:h.themeClass,onRender:h==null?void 0:h.onRender,offsetStyle:g}},render(){var e;const{mergedClsPrefix:t,onRender:r,themeClass:n,$slots:o}=this;r==null||r();const i=(e=o.default)===null||e===void 0?void 0:e.call(o);return c("div",{class:[`${t}-badge`,this.rtlEnabled&&`${t}-badge--rtl`,n,{[`${t}-badge--dot`]:this.dot,[`${t}-badge--as-is`]:!i}],style:this.cssVars},i,c(At,{name:"fade-in-scale-up-transition",onAfterEnter:this.handleAfterEnter,onAfterLeave:this.handleAfterLeave},{default:()=>this.showBadge?c("sup",{class:`${t}-badge-sup`,title:Ga(this.value),style:this.offsetStyle},yt(o.value,()=>[this.dot?null:c(dE,{clsPrefix:t,appeared:this.appeared,max:this.max,value:this.value})]),this.processing?c(j1,{clsPrefix:t}):null):null}))}}),iA={fontWeightActive:"400"},OC=e=>{const{fontSize:t,textColor3:r,textColor2:n,borderRadius:o,buttonColor2Hover:i,buttonColor2Pressed:a}=e;return Object.assign(Object.assign({},iA),{fontSize:t,itemLineHeight:"1.25",itemTextColor:r,itemTextColorHover:n,itemTextColorPressed:n,itemTextColorActive:n,itemBorderRadius:o,itemColorHover:i,itemColorPressed:a,separatorColor:r})},aA={name:"Breadcrumb",common:tt,self:OC},lA={name:"Breadcrumb",common:et,self:OC},sA=w("breadcrumb",`
white-space: nowrap;
cursor: default;
line-height: var(--n-item-line-height);
`,[O("ul",`
list-style: none;
padding: 0;
margin: 0;
`),O("a",`
color: inherit;
text-decoration: inherit;
`),w("breadcrumb-item",`
font-size: var(--n-font-size);
transition: color .3s var(--n-bezier);
display: inline-flex;
align-items: center;
`,[w("icon",`
font-size: 18px;
vertical-align: -.2em;
transition: color .3s var(--n-bezier);
color: var(--n-item-text-color);
`),O("&:not(:last-child)",[I("clickable",[M("link",`
cursor: pointer;
`,[O("&:hover",`
background-color: var(--n-item-color-hover);
`),O("&:active",`
background-color: var(--n-item-color-pressed);
`)])])]),M("link",`
padding: 4px;
border-radius: var(--n-item-border-radius);
transition:
background-color .3s var(--n-bezier),
color .3s var(--n-bezier);
color: var(--n-item-text-color);
position: relative;
`,[O("&:hover",`
color: var(--n-item-text-color-hover);
`,[w("icon",`
color: var(--n-item-text-color-hover);
`)]),O("&:active",`
color: var(--n-item-text-color-pressed);
`,[w("icon",`
color: var(--n-item-text-color-pressed);
`)])]),M("separator",`
margin: 0 8px;
color: var(--n-separator-color);
transition: color .3s var(--n-bezier);
user-select: none;
-webkit-user-select: none;
`),O("&:last-child",[M("link",`
font-weight: var(--n-font-weight-active);
cursor: unset;
color: var(--n-item-text-color-active);
`,[w("icon",`
color: var(--n-item-text-color-active);
`)]),M("separator",`
display: none;
`)])])]),_C="n-breadcrumb",MC=Object.assign(Object.assign({},ye.props),{separator:{type:String,default:"/"}}),dA=re({name:"Breadcrumb",props:MC,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:r}=Ne(e),n=ye("Breadcrumb","-breadcrumb",sA,aA,e,t);ot(_C,{separatorRef:ve(e,"separator"),mergedClsPrefixRef:t});const o=P(()=>{const{common:{cubicBezierEaseInOut:a},self:{separatorColor:l,itemTextColor:s,itemTextColorHover:d,itemTextColorPressed:u,itemTextColorActive:f,fontSize:h,fontWeightActive:g,itemBorderRadius:v,itemColorHover:b,itemColorPressed:m,itemLineHeight:p}}=n.value;return{"--n-font-size":h,"--n-bezier":a,"--n-item-text-color":s,"--n-item-text-color-hover":d,"--n-item-text-color-pressed":u,"--n-item-text-color-active":f,"--n-separator-color":l,"--n-item-color-hover":b,"--n-item-color-pressed":m,"--n-item-border-radius":v,"--n-font-weight-active":g,"--n-item-line-height":p}}),i=r?Qe("breadcrumb",void 0,o,e):void 0;return{mergedClsPrefix:t,cssVars:r?void 0:o,themeClass:i==null?void 0:i.themeClass,onRender:i==null?void 0:i.onRender}},render(){var e;return(e=this.onRender)===null||e===void 0||e.call(this),c("nav",{class:[`${this.mergedClsPrefix}-breadcrumb`,this.themeClass],style:this.cssVars,"aria-label":"Breadcrumb"},c("ul",null,this.$slots))}}),cA=(e=dn?window:null)=>{const t=()=>{const{hash:o,host:i,hostname:a,href:l,origin:s,pathname:d,port:u,protocol:f,search:h}=(e==null?void 0:e.location)||{};return{hash:o,host:i,hostname:a,href:l,origin:s,pathname:d,port:u,protocol:f,search:h}},r=()=>{n.value=t()},n=D(t());return Bt(()=>{e&&(e.addEventListener("popstate",r),e.addEventListener("hashchange",r))}),ds(()=>{e&&(e.removeEventListener("popstate",r),e.removeEventListener("hashchange",r))}),n},IC={separator:String,href:String,clickable:{type:Boolean,default:!0},onClick:Function},uA=re({name:"BreadcrumbItem",props:IC,setup(e,{slots:t}){const r=De(_C,null);if(!r)return()=>null;const{separatorRef:n,mergedClsPrefixRef:o}=r,i=cA(),a=P(()=>e.href?"a":"span"),l=P(()=>i.value.href===e.href?"location":null);return()=>{const{value:s}=o;return c("li",{class:[`${s}-breadcrumb-item`,e.clickable&&`${s}-breadcrumb-item--clickable`]},c(a.value,{class:`${s}-breadcrumb-item__link`,"aria-current":l.value,href:e.href,onClick:e.onClick},t),c("span",{class:`${s}-breadcrumb-item__separator`,"aria-hidden":"true"},yt(t.separator,()=>{var d;return[(d=e.separator)!==null&&d!==void 0?d:n.value]})))}}});function Di(e){return mt(e,[255,255,255,.16])}function Qs(e){return mt(e,[0,0,0,.12])}const FC="n-button-group",fA={paddingTiny:"0 6px",paddingSmall:"0 10px",paddingMedium:"0 14px",paddingLarge:"0 18px",paddingRoundTiny:"0 10px",paddingRoundSmall:"0 14px",paddingRoundMedium:"0 18px",paddingRoundLarge:"0 22px",iconMarginTiny:"6px",iconMarginSmall:"6px",iconMarginMedium:"6px",iconMarginLarge:"6px",iconSizeTiny:"14px",iconSizeSmall:"18px",iconSizeMedium:"18px",iconSizeLarge:"20px",rippleDuration:".6s"},DC=e=>{const{heightTiny:t,heightSmall:r,heightMedium:n,heightLarge:o,borderRadius:i,fontSizeTiny:a,fontSizeSmall:l,fontSizeMedium:s,fontSizeLarge:d,opacityDisabled:u,textColor2:f,textColor3:h,primaryColorHover:g,primaryColorPressed:v,borderColor:b,primaryColor:m,baseColor:p,infoColor:x,infoColorHover:S,infoColorPressed:y,successColor:C,successColorHover:k,successColorPressed:R,warningColor:$,warningColorHover:T,warningColorPressed:z,errorColor:F,errorColorHover:_,errorColorPressed:N,fontWeight:j,buttonColor2:H,buttonColor2Hover:Y,buttonColor2Pressed:X,fontWeightStrong:le}=e;return Object.assign(Object.assign({},fA),{heightTiny:t,heightSmall:r,heightMedium:n,heightLarge:o,borderRadiusTiny:i,borderRadiusSmall:i,borderRadiusMedium:i,borderRadiusLarge:i,fontSizeTiny:a,fontSizeSmall:l,fontSizeMedium:s,fontSizeLarge:d,opacityDisabled:u,colorOpacitySecondary:"0.16",colorOpacitySecondaryHover:"0.22",colorOpacitySecondaryPressed:"0.28",colorSecondary:H,colorSecondaryHover:Y,colorSecondaryPressed:X,colorTertiary:H,colorTertiaryHover:Y,colorTertiaryPressed:X,colorQuaternary:"#0000",colorQuaternaryHover:Y,colorQuaternaryPressed:X,color:"#0000",colorHover:"#000
margin: 0;
font-weight: var(--n-font-weight);
line-height: 1;
font-family: inherit;
padding: var(--n-padding);
height: var(--n-height);
font-size: var(--n-font-size);
border-radius: var(--n-border-radius);
color: var(--n-text-color);
background-color: var(--n-color);
width: var(--n-width);
white-space: nowrap;
outline: none;
position: relative;
z-index: auto;
border: none;
display: inline-flex;
flex-wrap: nowrap;
flex-shrink: 0;
align-items: center;
justify-content: center;
user-select: none;
-webkit-user-select: none;
text-align: center;
cursor: pointer;
text-decoration: none;
transition:
color .3s var(--n-bezier),
background-color .3s var(--n-bezier),
opacity .3s var(--n-bezier),
border-color .3s var(--n-bezier);
`,[I("color",[M("border",{borderColor:"var(--n-border-color)"}),I("disabled",[M("border",{borderColor:"var(--n-border-color-disabled)"})]),xt("disabled",[O("&:focus",[M("state-border",{borderColor:"var(--n-border-color-focus)"})]),O("&:hover",[M("state-border",{borderColor:"var(--n-border-color-hover)"})]),O("&:active",[M("state-border",{borderColor:"var(--n-border-color-pressed)"})]),I("pressed",[M("state-border",{borderColor:"var(--n-border-color-pressed)"})])])]),I("disabled",{backgroundColor:"var(--n-color-disabled)",color:"var(--n-text-color-disabled)"},[M("border",{border:"var(--n-border-disabled)"})]),xt("disabled",[O("&:focus",{backgroundColor:"var(--n-color-focus)",color:"var(--n-text-color-focus)"},[M("state-border",{border:"var(--n-border-focus)"})]),O("&:hover",{backgroundColor:"var(--n-color-hover)",color:"var(--n-text-color-hover)"},[M("state-border",{border:"var(--n-border-hover)"})]),O("&:active",{backgroundColor:"var(--n-color-pressed)",color:"var(--n-text-color-pressed)"},[M("state-border",{border:"var(--n-border-pressed)"})]),I("pressed",{backgroundColor:"var(--n-color-pressed)",color:"var(--n-text-color-pressed)"},[M("state-border",{border:"var(--n-border-pressed)"})])]),I("loading","cursor: wait;"),w("base-wave",`
pointer-events: none;
top: 0;
right: 0;
bottom: 0;
left: 0;
animation-iteration-count: 1;
animation-duration: var(--n-ripple-duration);
animation-timing-function: var(--n-bezier-ease-out), var(--n-bezier-ease-out);
`,[I("active",{zIndex:1,animationName:"button-wave-spread, button-wave-opacity"})]),dn&&"MozBoxSizing"in document.createElement("div").style?O("&::moz-focus-inner",{border:0}):null,M("border, state-border",`
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
border-radius: inherit;
transition: border-color .3s var(--n-bezier);
pointer-events: none;
`),M("border",{border:"var(--n-border)"}),M("state-border",{border:"var(--n-border)",borderColor:"#0000",zIndex:1}),M("icon",`
margin: var(--n-icon-margin);
margin-left: 0;
height: var(--n-icon-size);
width: var(--n-icon-size);
max-width: var(--n-icon-size);
font-size: var(--n-icon-size);
position: relative;
flex-shrink: 0;
`,[w("icon-slot",`
height: var(--n-icon-size);
width: var(--n-icon-size);
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
display: flex;
align-items: center;
justify-content: center;
`,[qr({top:"50%",originalTransform:"translateY(-50%)"})]),tC()]),M("content",`
display: flex;
align-items: center;
flex-wrap: nowrap;
min-width: 0;
`,[O("~",[M("icon",{margin:"var(--n-icon-margin)",marginRight:0})])]),I("block",`
display: flex;
width: 100%;
`),I("dashed",[M("border, state-border",{borderStyle:"dashed !important"})]),I("disabled",{cursor:"not-allowed",opacity:"var(--n-opacity-disabled)"})]),O("@keyframes button-wave-spread",{from:{boxShadow:"0 0 0.5px 0 var(--n-ripple-color)"},to:{boxShadow:"0 0 0.5px 4.5px var(--n-ripple-color)"}}),O("@keyframes button-wave-opacity",{from:{opacity:"var(--n-wave-opacity)"},to:{opacity:0}})]),EC=Object.assign(Object.assign({},ye.props),{color:String,textColor:String,text:Boolean,block:Boolean,loading:Boolean,disabled:Boolean,circle:Boolean,size:String,ghost:Boolean,round:Boolean,secondary:Boolean,tertiary:Boolean,quaternary:Boolean,strong:Boolean,focusable:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},tag:{type:String,default:"button"},type:{type:String,default:"default"},dashed:Boolean,renderIcon:Function,iconPlacement:{type:String,default:"left"},attrType:{type:String,default:"button"},bordered:{type:Boolean,default:!0},onClick:[Function,Array],nativeFocusBehavior:{type:Boolean,default:!sC}}),AC=re({name:"Button",props:EC,setup(e){const t=D(null),r=D(null),n=D(!1),o=ct(()=>!e.quaternary&&!e.tertiary&&!e.secondary&&!e.text&&(!e.color||e.ghost||e.dashed)&&e.bordered),i=De(FC,{}),{mergedSizeRef:a}=Rr({},{defaultSize:"medium",mergedSize:y=>{const{size:C}=e;if(C)return C;const{size:k}=i;if(k)return k;const{mergedSize:R}=y||{};return R?R.value:"medium"}}),l=P(()=>e.focusable&&!e.disabled),s=y=>{var C;l.value||y.preventDefault(),!e.nativeFocusBehavior&&(y.preventDefault(),!e.disabled&&l.value&&((C=t.value)===null||C===void 0||C.focus({preventScroll:!0})))},d=y=>{var C;if(!e.disabled&&!e.loading){const{onClick:k}=e;k&&ue(k,y),e.text||(C=r.value)===null||C===void 0||C.play()}},u=y=>{switch(y.key){case"Enter":if(!e.keyboard)return;n.value=!1}},f=y=>{switch(y.key){case"Enter":if(!e.keyboard||e.loading){y.preventDefault();return}n.value=!0}},h=()=>{n.value=!1},{inlineThemeDisabled:g,mergedClsPrefixRef:v,mergedRtlRef:b}=Ne(e),m=ye("Button","-button",hA,wn,e,v),p=Wt("Button",b,v),x=P(()=>{const y=m.value,{common:{cubicBezierEaseInOut:C,cubicBezierEaseOut:k},self:R}=y,{rippleDuration:$,opacityDisabled:T,fontWeight:z,fontWeightStrong:F}=R,_=a.value,{dashed:N,type:j,ghost:H,text:Y,color:X,round:le,circle:ke,textColor:be,secondary:Q,tertiary:L,quaternary:A,strong:U}=e,ae={"font-weight":U?F:z};let he={"--n-color":"initial","--n-color-hover":"initial","--n-color-pressed":"initial","--n-color-focus":"initial","--n-color-disabled":"initial","--n-ripple-color":"initial","--n-text-color":"initial","--n-text-color-hover":"initial","--n-text-color-pressed":"initial","--n-text-color-focus":"initial","--n-text-color-disabled":"initial"};const Re=j==="tertiary",Oe=j==="default",V=Re?"default":j;if(Y){const J=be||X;he={"--n-color":"#0000","--n-color-hover":"#0000","--n-color-pressed":"#0000","--n-color-focus":"#0000","--n-color-disabled":"#0000","--n-ripple-color":"#0000","--n-text-color":J||R[Ce("textColorText",V)],"--n-text-color-hover":J?Di(J):R[Ce("textColorTextHover",V)],"--n-text-color-pressed":J?Qs(J):R[Ce("textColorTextPressed",V)],"--n-text-color-focus":J?Di(J):R[Ce("textColorTextHover",V)],"--n-text-color-disabled":J||R[Ce("textColorTextDisabled",V)]}}else if(H||N){const J=be||X;he={"--n-color":"#0000","--n-color-hover":"#0000","--n-color-pressed":"#0000","--n-color-focus":"#0000","--n-color-disabled":"#0000","--n-ripple-color":X||R[Ce("rippleColor",V)],"--n-text-color":J||R[Ce("textColorGhost",V)],"--n-text-color-hover":J?Di(J):R[Ce("textColorGhostHover",V)],"--n-text-color-pressed":J?Qs(J):R[Ce("textColorGhostPressed",V)],"--n-text-color-focus":J?Di(J):R[Ce("textColorGhostHover",V)],"--n-text-color-disabled":J||R[Ce("textColorGhostDisabled",V)]}}else if(Q){const J=Oe?R.textColor:Re?R.textColorTertiary:R[Ce("color",V)],oe=X||J,de=j!=="default"&&j!=="tertiary";he={"--n-color":de?je(oe,{alpha:Number(R.colorOpacitySecondary)}):R.colorSecondary,"--n-color-hover":de?je(oe,{alpha:Number(R.colorOpacitySecondaryHover)}):R.colorSecondaryHover,"--n-color-pressed":de?je(oe,{alpha:Number(R.colorOpacitySecondaryPressed)}):R.colorSecondary
flex-wrap: nowrap;
display: inline-flex;
position: relative;
`,[xt("vertical",{flexDirection:"row"},[xt("rtl",[w("button",[O("&:first-child:not(:last-child)",`
margin-right: ${br};
border-top-right-radius: ${br};
border-bottom-right-radius: ${br};
`),O("&:last-child:not(:first-child)",`
margin-left: ${br};
border-top-left-radius: ${br};
border-bottom-left-radius: ${br};
`),O("&:not(:first-child):not(:last-child)",`
margin-left: ${br};
margin-right: ${br};
border-radius: ${br};
`),_a("default"),I("ghost",[_a("primary"),_a("info"),_a("success"),_a("warning"),_a("error")])])])]),I("vertical",{flexDirection:"column"},[w("button",[O("&:first-child:not(:last-child)",`
margin-bottom: ${br};
margin-left: ${br};
margin-right: ${br};
border-bottom-left-radius: ${br};
border-bottom-right-radius: ${br};
`),O("&:last-child:not(:first-child)",`
margin-top: ${br};
margin-left: ${br};
margin-right: ${br};
border-top-left-radius: ${br};
border-top-right-radius: ${br};
`),O("&:not(:first-child):not(:last-child)",`
margin: ${br};
border-radius: ${br};
`),Ma("default"),I("ghost",[Ma("primary"),Ma("info"),Ma("success"),Ma("warning"),Ma("error")])])])]),NC={size:{type:String,default:void 0},vertical:Boolean},tg=re({name:"ButtonGroup",props:NC,setup(e){const{mergedClsPrefixRef:t,mergedRtlRef:r}=Ne(e);return Fn("-button-group",vA,t),ot(FC,e),{rtlEnabled:Wt("ButtonGroup",r,t),mergedClsPrefix:t}},render(){const{mergedClsPrefix:e}=this;return c("div",{class:[`${e}-button-group`,this.rtlEnabled&&`${e}-button-group--rtl`,this.vertical&&`${e}-button-group--vertical`],role:"group"},this.$slots)}}),Jd=1901,sa=40,gA={date:hF,month:ys,year:S1,quarter:w1};function pA(e){return(t,r)=>{const n=(e+1)%7;return AD(t,r,{weekStartsOn:n})}}function on(e,t,r,n=0){return(r==="week"?pA(n):gA[r])(e,t)}function Mu(e,t,r,n,o,i){return o==="date"?mA(e,t,r,n):bA(e,t,r,n,i)}function mA(e,t,r,n){let o=!1,i=!1,a=!1;Array.isArray(r)&&(r[0]<e&&e<r[1]&&(o=!0),on(r[0],e,"date")&&(i=!0),on(r[1],e,"date")&&(a=!0));const l=r!==null&&(Array.isArray(r)?on(r[0],e,"date")||on(r[1],e,"date"):on(r,e,"date"));return{type:"date",dateObject:{date:Bn(e),month:er(e),year:ar(e)},inCurrentMonth:ys(e,t),isCurrentDate:on(n,e,"date"),inSpan:o,inSelectedWeek:!1,startOfSpan:i,endOfSpan:a,selected:l,ts:nt(e)}}function LC(e,t,r){const n=new Date(2e3,e,1).getTime();return tr(n,t,{locale:r})}function HC(e,t,r){const n=new Date(e,1,1).getTime();return tr(n,t,{locale:r})}function jC(e,t,r){const n=new Date(2e3,e*3-2,1).getTime();return tr(n,t,{locale:r})}function bA(e,t,r,n,o){let i=!1,a=!1,l=!1;Array.isArray(r)&&(r[0]<e&&e<r[1]&&(i=!0),on(r[0],e,"week",o)&&(a=!0),on(r[1],e,"week",o)&&(l=!0));const s=r!==null&&(Array.isArray(r)?on(r[0],e,"week",o)||on(r[1],e,"week",o):on(r,e,"week",o));return{type:"date",dateObject:{date:Bn(e),month:er(e),year:ar(e)},inCurrentMonth:ys(e,t),isCurrentDate:on(n,e,"date"),inSpan:i,startOfSpan:a,endOfSpan:l,selected:!1,inSelectedWeek:s,ts:nt(e)}}function xA(e,t,r,{monthFormat:n}){return{type:"month",monthFormat:n,dateObject:{month:er(e),year:ar(e)},isCurrent:ys(r,e),selected:t!==null&&on(t,e,"month"),ts:nt(e)}}function yA(e,t,r,{yearFormat:n}){return{type:"year",yearFormat:n,dateObject:{year:ar(e)},isCurrent:S1(r,e),selected:t!==null&&on(t,e,"year"),ts:nt(e)}}function CA(e,t,r,{quarterFormat:n}){return{type:"quarter",quarterFormat:n,dateObject:{quarter:gF(e),year:ar(e)},isCurrent:w1(r,e),selected:t!==null&&on(t,e,"quarter"),ts:nt(e)}}function ec(e,t,r,n,o=!1,i=!1){const a=i?"week":"date",l=er(e);let s=nt(Nn(e)),d=nt(Xs(s,-1));const u=[];let f=!o;for(;DF(d)!==n||f;)u.unshift(Mu(d,e,t,r,a,n)),d=nt(Xs(d,-1)),f=!1;for(;er(s)===l;)u.push(Mu(s,e,t,r,a,n)),s=nt(Xs(s,1));const h=o?u.length<=28?28:u.length<=35?35:42:42;for(;u.length<h;)u.push(Mu(s,e,t,r,a,n)),s=nt(Xs(s,1));return u}function Uf(e,t,r,n){const o=[],i=Hv(e);for(let a=0;a<12;a++)o.push(xA(nt(Nr(i,a)),t,r,n));return o}function Wf(e,t,r,n){const o=[],i=Hv(e);for(let a=0;a<4;a++)o.push(CA(nt(sF(i,a)),t,r,n));return o}function Kf(e,t,r){const n=[],o=new Date(Jd,0,1);for(let i=0;i<200;i++)n.push(yA(nt(Af(o,i)),e,t,r));return n}function vn(e,t,r,n){const o=FD(e,t,r,n);return Vn(o)?tr(o,t,n)===e?o:new Date(NaN):o}function Cd(e){if(e===void 0)return;if(typeof e=="number")return e;const[t,r,n]=e.split(":");return{hours:Number(t),minutes:Number(r),seconds:Number(n)}}function Ia(e,t){return Array.isArray(e)?e[t==="start"?0:1]:null}const wA={titleFontSize:"22px"},VC=e=>{const{borderRadius:t,fontSize:r,lineHeight:n,textColor2:o,textColor1:i,textColorDisabled:a,dividerColor:l,fontWeightStrong:s,primaryColor:d,baseColor:u,hoverColor:f,cardColor:h,modalColor:g,popoverColor:v}=e;return Object.assign(Object.assign({},wA),{borderRadius:t,borderColor:mt(h,l),borderColorModal:mt(g,l),borderColorPopover:mt(v,l),textColor:o,titleFontWeight:s,titleTextColor:i,dayTextColor:a,fontSize:r,lineHeight:n,dateColorCurrent:d,dateTextColorCurrent:u,cellColorHover:mt(h,f),cellColorHoverModal:mt(g,f),cellColorHoverPopover:mt(v,f),cellColor:h,cellColorModal:g,cellColorPopover:v,barColor:d})},SA={name:"Calendar",common:tt,peers:{Button:wn},self:VC},kA={name:"Calendar",common:et,peers:{
line-height: var(--n-line-height);
font-size: var(--n-font-size);
color: var(--n-text-color);
height: 720px;
display: flex;
flex-direction: column;
`,[w("calendar-prev-btn",`
cursor: pointer;
`),w("calendar-next-btn",`
cursor: pointer;
`),w("calendar-header",`
display: flex;
align-items: center;
line-height: 1;
font-size: var(--n-title-font-size);
padding: 0 0 18px 0;
justify-content: space-between;
`,[M("title",`
color: var(--n-title-text-color);
font-weight: var(--n-title-font-weight);
transition: color .3s var(--n-bezier);
`),M("extra",`
display: flex;
align-items: center;
`)]),w("calendar-dates",`
display: grid;
grid-template-columns: repeat(7, minmax(0, 1fr));
grid-auto-rows: 1fr;
border-radius: var(--n-border-radius);
flex: 1;
border-top: 1px solid;
border-left: 1px solid;
border-color: var(--n-border-color);
transition: border-color .3s var(--n-bezier);
`),w("calendar-cell",`
box-sizing: border-box;
padding: 10px;
border-right: 1px solid;
border-bottom: 1px solid;
border-color: var(--n-border-color);
cursor: pointer;
position: relative;
transition:
color .3s var(--n-bezier),
border-color .3s var(--n-bezier),
background-color .3s var(--n-bezier);
`,[O("&:nth-child(7)",`
border-top-right-radius: var(--n-border-radius);
`),O("&:nth-last-child(7)",`
border-bottom-left-radius: var(--n-border-radius);
`),O("&:last-child",`
border-bottom-right-radius: var(--n-border-radius);
`),O("&:hover",`
background-color: var(--n-cell-color-hover);
`),M("bar",`
position: absolute;
left: 0;
right: 0;
bottom: -1px;
height: 3px;
background-color: #0000;
transition: background-color .3s var(--n-bezier);
`),I("selected",[M("bar",`
background-color: var(--n-bar-color);
`)]),w("calendar-date",`
transition:
color .3s var(--n-bezier),
border-color .3s var(--n-bezier),
background-color .3s var(--n-bezier);
color: var(--n-text-color);
`,[M("date",`
color: var(--n-text-color);
`)]),I("disabled, other-month",`
color: var(--n-day-text-color);
`,[w("calendar-date",[M("date",`
color: var(--n-day-text-color);
`)])]),I("disabled",`
cursor: not-allowed;
`),I("current",[w("calendar-date",[M("date",`
color: var(--n-date-text-color-current);
background-color: var(--n-date-color-current);
`)])]),w("calendar-date",`
position: relative;
line-height: 1;
display: flex;
align-items: center;
height: 1em;
justify-content: space-between;
padding-bottom: .75em;
`,[M("date",`
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin-left: -0.4em;
width: 1.8em;
height: 1.8em;
transition:
color .3s var(--n-bezier),
background-color .3s var(--n-bezier);
`),M("day",`
color: var(--n-day-text-color);
transition: color .3s var(--n-bezier);
`)])])]),So(w("calendar",[w("calendar-dates",`
border-color: var(--n-border-color-modal);
`),w("calendar-cell",`
border-color: var(--n-border-color-modal);
`,[O("&:hover",`
background-color: var(--n-cell-color-hover-modal);
`)])])),jo(w("calendar",[w("calendar-dates",`
border-color: var(--n-border-color-popover);
`),w("calendar-cell",`
border-color: var(--n-border-color-popover);
`,[O("&:hover",`
background-color: var(--n-cell-color-hover-popover);
`)])]))]),UC=Object.assign(Object.assign({},ye.props),{isDateDisabled:Function,value:Number,defaultValue:{type:Number,default:null},onPanelChange:Function,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array]}),PA=re({name:"Calendar",props:UC,setup(e){var t;const{mergedClsPrefixRef:r,inlineThemeDisabled:n}=Ne(e),o=ye("Calendar","-calendar",RA,SA,e,r),{localeRef:i,dateLocaleRef:a}=mr("DatePicker"),l=Date.now(),s=D(Nn((t=e.defaultValue)!==null&&t!==void 0?t:l).valueOf()),d=D(e.defaultValue||null),u=$t(ve(e,"value"),d);function f(p,x){const{onUpdateValue:S,"onUpdate:value":y}=e;S&&ue(S,p,x),y&&ue(y,p,x),d.value=p}function h(){var p;const x=Nr(s.value,-1).valueOf();s.value=x,(p=e.onPanelChange)===null||p===void 0||p.call(e,{year:ar(x),month:er(x)+1})}function g(){var p;const x=Nr(s.value,1).valueOf();s.value=x,(p=e.onPanelChange)===null||p===void 0||p.call(e,{year:ar(x),month:er(x)+1})}function v(){var p;const{value:x}=s,S=ar(x),y=er(x),C=Nn(l).valueOf();s.value=C;const k=ar(C),R=er(C);(S!==k||y!==R)&&((p=e.onPanelChange)===null||p===void 0||p.call(e,{year:k,month:R+1}))}const b=P(()=>{const{common:{cubicBezierEaseInOut:p},self:{borderColor:x,borderColorModal:S,borderColorPopover:y,borderRadius:C,titleFontSize:k,textColor:R,titleFontWeight:$,titleTextColor:T,dayTextColor:z,fontSize:F,lineHeight:_,dateColorCurrent:N,dateTextColorCurrent:j,cellColorHover:H,cellColor:Y,cellColorModal:X,barColor:le,cellColorPopover:ke,cellColorHoverModal:be,cellColorHoverPopover:Q}}=o.value;return{"--n-bezier":p,"--n-border-color":x,"--n-border-color-modal":S,"--n-border-color-popover":y,"--n-border-radius":C,"--n-text-color":R,"--n-title-font-weight":$,"--n-title-font-size":k,"--n-title-text-color":T,"--n-day-text-color":z,"--n-font-size":F,"--n-line-height":_,"--n-date-color-current":N,"--n-date-text-color-current":j,"--n-cell-color":Y,"--n-cell-color-modal":X,"--n-cell-color-popover":ke,"--n-cell-color-hover":H,"--n-cell-color-hover-modal":be,"--n-cell-color-hover-popover":Q,"--n-bar-color":le}}),m=n?Qe("calendar",void 0,b,e):void 0;return{mergedClsPrefix:r,locale:i,dateLocale:a,now:l,mergedValue:u,monthTs:s,dateItems:P(()=>ec(s.value,u.value,l,i.value.firstDayOfWeek,!0)),doUpdateValue:f,handleTodayClick:v,handlePrevClick:h,handleNextClick:g,mergedTheme:o,cssVars:n?void 0:b,themeClass:m==null?void 0:m.themeClass,onRender:m==null?void 0:m.onRender}},render(){const{isDateDisabled:e,mergedClsPrefix:t,monthTs:r,cssVars:n,mergedValue:o,mergedTheme:i,$slots:a,locale:{monthBeforeYear:l,today:s},dateLocale:{locale:d},handleTodayClick:u,handlePrevClick:f,handleNextClick:h,onRender:g}=this;g==null||g();const v=o&&Za(o).valueOf(),b=ar(r),m=er(r)+1;return c("div",{class:[`${t}-calendar`,this.themeClass],style:n},c("div",{class:`${t}-calendar-header`},c("div",{class:`${t}-calendar-header__title`},mi(a.header,{year:b,month:m},()=>{const p=tr(r,"MMMM",{locale:d});return[l?`${p} ${b}`:`${b} ${p}`]})),c("div",{class:`${t}-calendar-header__extra`},c(tg,null,{default:()=>c(It,null,c(Dt,{size:"small",onClick:f,theme:i.peers.Button,themeOverrides:i.peerOverrides.Button},{icon:()=>c(ut,{clsPrefix:t,class:`${t}-calendar-prev-btn`},{default:()=>c(Gv,null)})}),c(Dt,{size:"small",onClick:u,theme:i.peers.Button,themeOverrides:i.peerOverrides.Button},{default:()=>s}),c(Dt,{size:"small",onClick:h,theme:i.peers.Button,themeOverrides:i.peerOverrides.Button},{icon:()=>c(ut,{clsPrefix:t,class:`${t}-calendar-next-btn`},{default:()=>c(va,null)})}))}))),c("div",{class:`${t}-calendar-dates`},this.dateItems.map(({dateObject:p,ts:x,inCurrentMonth:S,isCurrentDate:y},C)=>{var k;const{year:R,month:$,date:T}=p,z=tr(x,"yyyy-MM-dd"),F=!S,_=(e==null?void 0:e(x))===!0,N=v===Za(x).valueOf();return c("div",{key:`${m}-${C}`,class:[`${t}-calendar-cell`,_&&`${t}-calendar-cell--disabled`,F&&`${t}-calendar-cell--other-month`,_&&`${t}-calendar-cell--not-allowed`,y&&`${t}-calendar-cell--current`,N&&`${t}-calendar-cell--selected`],onClick:()=>{var j;if(_)return;const H=Nn(x).valueOf();this.monthTs=H,F&&((j=this.onPanelChange)===null||j===void 0||j.call(this,{year:ar(H),month:er(H)+1}))
display: inline-block;
box-sizing: border-box;
height: var(--n-height);
font-size: var(--n-font-size);
width: 100%;
position: relative;
`),w("color-picker-panel",`
margin: 4px 0;
width: 240px;
font-size: var(--n-panel-font-size);
color: var(--n-text-color);
background-color: var(--n-color);
transition:
box-shadow .3s var(--n-bezier),
color .3s var(--n-bezier),
background-color .3s var(--n-bezier);
border-radius: var(--n-border-radius);
box-shadow: var(--n-box-shadow);
`,[Ar(),w("input",`
text-align: center;
`)]),w("color-picker-checkboard",`
background: white;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
`,[O("&::after",`
background-image: linear-gradient(45deg, #DDD 25%, #0000 25%), linear-gradient(-45deg, #DDD 25%, #0000 25%), linear-gradient(45deg, #0000 75%, #DDD 75%), linear-gradient(-45deg, #0000 75%, #DDD 75%);
background-size: 12px 12px;
background-position: 0 0, 0 6px, 6px -6px, -6px 0px;
background-repeat: repeat;
content: "";
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
`)]),w("color-picker-slider",`
margin-bottom: 8px;
position: relative;
box-sizing: border-box;
`,[M("image",`
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
`),O("&::after",`
content: "";
position: absolute;
border-radius: inherit;
left: 0;
right: 0;
top: 0;
bottom: 0;
box-shadow: inset 0 0 2px 0 rgba(0, 0, 0, .24);
pointer-events: none;
`)]),w("color-picker-handle",`
z-index: 1;
box-shadow: 0 0 2px 0 rgba(0, 0, 0, .45);
position: absolute;
background-color: white;
overflow: hidden;
`,[M("fill",`
box-sizing: border-box;
border: 2px solid white;
`)]),w("color-picker-pallete",`
height: 180px;
position: relative;
margin-bottom: 8px;
cursor: crosshair;
`,[M("layer",`
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
`,[I("shadowed",`
box-shadow: inset 0 0 2px 0 rgba(0, 0, 0, .24);
`)])]),w("color-picker-preview",`
display: flex;
`,[M("sliders",`
flex: 1 0 auto;
`),M("preview",`
position: relative;
height: 30px;
width: 30px;
margin: 0 0 8px 6px;
border-radius: 50%;
box-shadow: rgba(0, 0, 0, .15) 0px 0px 0px 1px inset;
overflow: hidden;
`),M("fill",`
display: block;
width: 30px;
height: 30px;
`),M("input",`
position: absolute;
top: 0;
left: 0;
width: 30px;
height: 30px;
opacity: 0;
z-index: 1;
`)]),w("color-picker-input",`
display: flex;
align-items: center;
`,[w("input",`
flex-grow: 1;
flex-basis: 0;
`),M("mode",`
width: 72px;
text-align: center;
`)]),w("color-picker-control",`
padding: 12px;
`),w("color-picker-action",`
display: flex;
margin-top: -4px;
border-top: 1px solid var(--n-divider-color);
padding: 8px 12px;
justify-content: flex-end;
`,[w("button","margin-left: 8px;")]),w("color-picker-trigger",`
border: var(--n-border);
height: 100%;
box-sizing: border-box;
border-radius: var(--n-border-radius);
transition: border-color .3s var(--n-bezier);
cursor: pointer;
`,[M("value",`
white-space: nowrap;
position: relative;
`),M("fill",`
border-radius: var(--n-border-radius);
position: absolute;
display: flex;
align-items: center;
justify-content: center;
left: 4px;
right: 4px;
top: 4px;
bottom: 4px;
`),I("disabled","cursor: not-allowed"),w("color-picker-checkboard",`
border-radius: var(--n-border-radius);
`,[O("&::after",`
--n-block-size: calc((var(--n-height) - 8px) / 3);
background-size: calc(var(--n-block-size) * 2) calc(var(--n-block-size) * 2);
background-position: 0 0, 0 var(--n-block-size), var(--n-block-size) calc(-1 * var(--n-block-size)), calc(-1 * var(--n-block-size)) 0px;
`)])]),w("color-picker-swatches",`
display: grid;
grid-gap: 8px;
flex-wrap: wrap;
position: relative;
grid-template-columns: repeat(auto-fill, 18px);
margin-top: 10px;
`,[w("color-picker-swatch",`
width: 18px;
height: 18px;
background-image: linear-gradient(45deg, #DDD 25%, #0000 25%), linear-gradient(-45deg, #DDD 25%, #0000 25%), linear-gradient(45deg, #0000 75%, #DDD 75%), linear-gradient(-45deg, #0000 75%, #DDD 75%);
background-size: 8px 8px;
background-position: 0px 0, 0px 4px, 4px -4px, -4px 0px;
background-repeat: repeat;
`,[M("fill",`
position: relative;
width: 100%;
height: 100%;
border-radius: 3px;
box-shadow: rgba(0, 0, 0, .15) 0px 0px 0px 1px inset;
cursor: pointer;
`),O("&:focus",`
outline: none;
`,[M("fill",[O("&::after",`
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: inherit;
filter: blur(2px);
content: "";
`)])])])])]),qC=Object.assign(Object.assign({},ye.props),{value:String,show:{type:Boolean,default:void 0},defaultShow:Boolean,defaultValue:String,modes:{type:Array,default:()=>["rgb","hex","hsl"]},placement:{type:String,default:"bottom-start"},to:Kt.propTo,showAlpha:{type:Boolean,default:!0},showPreview:Boolean,swatches:Array,disabled:{type:Boolean,default:void 0},actions:{type:Array,default:null},internalActions:Array,size:String,renderLabel:Function,onComplete:Function,onConfirm:Function,"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array]}),JA=re({name:"ColorPicker",props:qC,setup(e,{slots:t}){const r=D(null);let n=null;const o=Rr(e),{mergedSizeRef:i,mergedDisabledRef:a}=o,{localeRef:l}=mr("global"),{mergedClsPrefixRef:s,namespaceRef:d,inlineThemeDisabled:u}=Ne(e),f=ye("ColorPicker","-color-picker",QA,TA,e,s);ot(rg,{themeRef:f,renderLabelRef:ve(e,"renderLabel"),colorPickerSlots:t});const h=D(e.defaultShow),g=$t(ve(e,"show"),h);function v(ee){const{onUpdateShow:me,"onUpdate:show":J}=e;me&&ue(me,ee),J&&ue(J,ee),h.value=ee}const{defaultValue:b}=e,m=D(b===void 0?zA(e.modes,e.showAlpha):b),p=$t(ve(e,"value"),m),x=D([p.value]),S=D(0),y=P(()=>os(p.value)),{modes:C}=e,k=D(os(p.value)||C[0]||"rgb");function R(){const{modes:ee}=e,{value:me}=k,J=ee.findIndex(oe=>oe===me);~J?k.value=ee[(J+1)%ee.length]:k.value="rgb"}let $,T,z,F,_,N,j,H;const Y=P(()=>{const{value:ee}=p;if(!ee)return null;switch(y.value){case"hsv":return Gi(ee);case"hsl":return[$,T,z,H]=Va(ee),[...Lx($,T,z),H];case"rgb":case"hex":return[_,N,j,H]=Mr(ee),[...hf(_,N,j),H]}}),X=P(()=>{const{value:ee}=p;if(!ee)return null;switch(y.value){case"rgb":case"hex":return Mr(ee);case"hsv":return[$,T,F,H]=Gi(ee),[...di($,T,F),H];case"hsl":return[$,T,z,H]=Va(ee),[...gf($,T,z),H]}}),le=P(()=>{const{value:ee}=p;if(!ee)return null;switch(y.value){case"hsl":return Va(ee);case"hsv":return[$,T,F,H]=Gi(ee),[...md($,T,F),H];case"rgb":case"hex":return[_,N,j,H]=Mr(ee),[...vf(_,N,j),H]}}),ke=P(()=>{switch(k.value){case"rgb":case"hex":return X.value;case"hsv":return Y.value;case"hsl":return le.value}}),be=D(0),Q=D(1),L=D([0,0]);function A(ee,me){const{value:J}=Y,oe=be.value,de=J?J[3]:1;L.value=[ee,me];const{showAlpha:Z}=e;switch(k.value){case"hsv":he((Z?Xi:bf)([oe,ee,me,de]),"cursor");break;case"hsl":he((Z?hi:xf)([...md(oe,ee,me),de]),"cursor");break;case"rgb":he((Z?vo:mf)([...di(oe,ee,me),de]),"cursor");break;case"hex":he((Z?vi:Dl)([...di(oe,ee,me),de]),"cursor");break}}function U(ee){be.value=ee;const{value:me}=Y;if(!me)return;const[,J,oe,de]=me,{showAlpha:Z}=e;switch(k.value){case"hsv":he((Z?Xi:bf)([ee,J,oe,de]),"cursor");break;case"rgb":he((Z?vo:mf)([...di(ee,J,oe),de]),"cursor");break;case"hex":he((Z?vi:Dl)([...di(ee,J,oe),de]),"cursor");break;case"hsl":he((Z?hi:xf)([...md(ee,J,oe),de]),"cursor");break}}function ae(ee){switch(k.value){case"hsv":[$,T,F]=Y.value,he(Xi([$,T,F,ee]),"cursor");break;case"rgb":[_,N,j]=X.value,he(vo([_,N,j,ee]),"cursor");break;case"hex":[_,N,j]=X.value,he(vi([_,N,j,ee]),"cursor");break;case"hsl":[$,T,z]=le.value,he(hi([$,T,z,ee]),"cursor");break}Q.value=ee}function he(ee,me){me==="cursor"?n=ee:n=null;const{nTriggerFormChange:J,nTriggerFormInput:oe}=o,{onUpdateValue:de,"onUpdate:value":Z}=e;de&&ue(de,ee),Z&&ue(Z,ee),J(),oe(),m.value=ee}function Re(ee){he(ee,"input"),Ot(Oe)}function Oe(ee=!0){const{value:me}=p;if(me){const{nTriggerFormChange:J,nTriggerFormInput:oe}=o,{onComplete:de}=e;de&&de(me);const{value:Z}=x,{value:B}=S;ee&&(Z.splice(B+1,Z.length,me),S.value=B+1),J(),oe()}}function V(){const{value:ee}=S;ee-1<0||(he(x.value[ee-1],"input"),Oe(!1),S.value=ee-1)}function Te(){const{value:ee}=S;ee<0||ee+1>=x.value.length||(he(x.value[ee+1],"input"),Oe(!1),S.value=ee+1)}function Me(){he(null,"input"),v(!1)}function Ve(){const{value:ee}=p,{onConfirm:me}=e;me&&me(ee),v(!1)}const E=P(()=>S.value>=1),W=P(()=>{const{value:ee}=x;return ee.length>1&&S.value<ee.length-1});ft(g,ee=>{ee||(x.value=[p.value],S.value=0)}),Et(()=>{if(!(n&&n===p.value)){const{value:ee}=Y;ee&&(be.value=ee[0],Q.value=ee[3]
font-size: var(--n-font-size);
line-height: var(--n-line-height);
display: flex;
flex-direction: column;
width: 100%;
box-sizing: border-box;
position: relative;
border-radius: var(--n-border-radius);
background-color: var(--n-color);
color: var(--n-text-color);
word-break: break-word;
transition:
color .3s var(--n-bezier),
background-color .3s var(--n-bezier),
box-shadow .3s var(--n-bezier),
border-color .3s var(--n-bezier);
`,[Gx({background:"var(--n-color-modal)"}),I("hoverable",[O("&:hover","box-shadow: var(--n-box-shadow);")]),I("content-segmented",[O(">",[M("content",{paddingTop:"var(--n-padding-bottom)"})])]),I("content-soft-segmented",[O(">",[M("content",`
margin: 0 var(--n-padding-left);
padding: var(--n-padding-bottom) 0;
`)])]),I("footer-segmented",[O(">",[M("footer",{paddingTop:"var(--n-padding-bottom)"})])]),I("footer-soft-segmented",[O(">",[M("footer",`
padding: var(--n-padding-bottom) 0;
margin: 0 var(--n-padding-left);
`)])]),O(">",[w("card-header",`
box-sizing: border-box;
display: flex;
align-items: center;
font-size: var(--n-title-font-size);
padding:
var(--n-padding-top)
var(--n-padding-left)
var(--n-padding-bottom)
var(--n-padding-left);
`,[M("main",`
font-weight: var(--n-title-font-weight);
transition: color .3s var(--n-bezier);
flex: 1;
min-width: 0;
color: var(--n-title-text-color);
`),M("extra",`
display: flex;
align-items: center;
font-size: var(--n-font-size);
font-weight: 400;
transition: color .3s var(--n-bezier);
color: var(--n-text-color);
`),M("close",`
margin: 0 0 0 8px;
transition:
background-color .3s var(--n-bezier),
color .3s var(--n-bezier);
`)]),M("action",`
box-sizing: border-box;
transition:
background-color .3s var(--n-bezier),
border-color .3s var(--n-bezier);
background-clip: padding-box;
background-color: var(--n-action-color);
`),M("content","flex: 1; min-width: 0;"),M("content, footer",`
box-sizing: border-box;
padding: 0 var(--n-padding-left) var(--n-padding-bottom) var(--n-padding-left);
font-size: var(--n-font-size);
`,[O("&:first-child",{paddingTop:"var(--n-padding-bottom)"})]),M("action",`
background-color: var(--n-action-color);
padding: var(--n-padding-bottom) var(--n-padding-left);
border-bottom-left-radius: var(--n-border-radius);
border-bottom-right-radius: var(--n-border-radius);
`)]),w("card-cover",`
overflow: hidden;
width: 100%;
border-radius: var(--n-border-radius) var(--n-border-radius) 0 0;
`,[O("img",`
display: block;
width: 100%;
`)]),I("bordered",`
border: 1px solid var(--n-border-color);
`,[O("&:target","border-color: var(--n-color-target);")]),I("action-segmented",[O(">",[M("action",[O("&:not(:first-child)",{borderTop:"1px solid var(--n-border-color)"})])])]),I("content-segmented, content-soft-segmented",[O(">",[M("content",{transition:"border-color 0.3s var(--n-bezier)"},[O("&:not(:first-child)",{borderTop:"1px solid var(--n-border-color)"})])])]),I("footer-segmented, footer-soft-segmented",[O(">",[M("footer",{transition:"border-color 0.3s var(--n-bezier)"},[O("&:not(:first-child)",{borderTop:"1px solid var(--n-border-color)"})])])]),I("embedded",`
background-color: var(--n-color-embedded);
`)]),So(w("card",`
background: var(--n-color-modal);
`,[I("embedded",`
background-color: var(--n-color-embedded-modal);
`)])),jo(w("card",`
background: var(--n-color-popover);
`,[I("embedded",`
background-color: var(--n-color-embedded-popover);
`)]))]),ng={title:[String,Function],contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],headerExtraClass:String,headerExtraStyle:[Object,String],footerClass:String,footerStyle:[Object,String],embedded:Boolean,segmented:{type:[Boolean,Object],default:!1},size:{type:String,default:"medium"},bordered:{type:Boolean,default:!0},closable:Boolean,hoverable:Boolean,role:String,onClose:[Function,Array],tag:{type:String,default:"div"},cover:Function,content:[String,Function],footer:Function,action:Function,headerExtra:Function},rB=Yr(ng),ZC=Object.assign(Object.assign({},ye.props),ng),QC=re({name:"Card",props:ZC,setup(e){const t=()=>{const{onClose:d}=e;d&&ue(d)},{inlineThemeDisabled:r,mergedClsPrefixRef:n,mergedRtlRef:o}=Ne(e),i=ye("Card","-card",tB,GC,e,n),a=Wt("Card",o,n),l=P(()=>{const{size:d}=e,{self:{color:u,colorModal:f,colorTarget:h,textColor:g,titleTextColor:v,titleFontWeight:b,borderColor:m,actionColor:p,borderRadius:x,lineHeight:S,closeIconColor:y,closeIconColorHover:C,closeIconColorPressed:k,closeColorHover:R,closeColorPressed:$,closeBorderRadius:T,closeIconSize:z,closeSize:F,boxShadow:_,colorPopover:N,colorEmbedded:j,colorEmbeddedModal:H,colorEmbeddedPopover:Y,[Ce("padding",d)]:X,[Ce("fontSize",d)]:le,[Ce("titleFontSize",d)]:ke},common:{cubicBezierEaseInOut:be}}=i.value,{top:Q,left:L,bottom:A}=Lr(X);return{"--n-bezier":be,"--n-border-radius":x,"--n-color":u,"--n-color-modal":f,"--n-color-popover":N,"--n-color-embedded":j,"--n-color-embedded-modal":H,"--n-color-embedded-popover":Y,"--n-color-target":h,"--n-text-color":g,"--n-line-height":S,"--n-action-color":p,"--n-title-text-color":v,"--n-title-font-weight":b,"--n-close-icon-color":y,"--n-close-icon-color-hover":C,"--n-close-icon-color-pressed":k,"--n-close-color-hover":R,"--n-close-color-pressed":$,"--n-border-color":m,"--n-box-shadow":_,"--n-padding-top":Q,"--n-padding-bottom":A,"--n-padding-left":L,"--n-font-size":le,"--n-title-font-size":ke,"--n-close-size":F,"--n-close-icon-size":z,"--n-close-border-radius":T}}),s=r?Qe("card",P(()=>e.size[0]),l,e):void 0;return{rtlEnabled:a,mergedClsPrefix:n,mergedTheme:i,handleCloseClick:t,cssVars:r?void 0:l,themeClass:s==null?void 0:s.themeClass,onRender:s==null?void 0:s.onRender}},render(){const{segmented:e,bordered:t,hoverable:r,mergedClsPrefix:n,rtlEnabled:o,onRender:i,embedded:a,tag:l,$slots:s}=this;return i==null||i(),c(l,{class:[`${n}-card`,this.themeClass,a&&`${n}-card--embedded`,{[`${n}-card--rtl`]:o,[`${n}-card--content${typeof e!="boolean"&&e.content==="soft"?"-soft":""}-segmented`]:e===!0||e!==!1&&e.content,[`${n}-card--footer${typeof e!="boolean"&&e.footer==="soft"?"-soft":""}-segmented`]:e===!0||e!==!1&&e.footer,[`${n}-card--action-segmented`]:e===!0||e!==!1&&e.action,[`${n}-card--bordered`]:t,[`${n}-card--hoverable`]:r}],style:this.cssVars,role:this.role},Tt(s.cover,d=>{const u=this.cover?Ln([this.cover()]):d;return u&&c("div",{class:`${n}-card-cover`,role:"none"},u)}),Tt(s.header,d=>{const{title:u}=this,f=u?Ln(typeof u=="function"?[u()]:[u]):d;return f||this.closable?c("div",{class:[`${n}-card-header`,this.headerClass],style:this.headerStyle,role:"heading"},c("div",{class:`${n}-card-header__main`,role:"heading"},f),Tt(s["header-extra"],h=>{const g=this.headerExtra?Ln([this.headerExtra()]):h;return g&&c("div",{class:[`${n}-card-header__extra`,this.headerExtraClass],style:this.headerExtraStyle},g)}),this.closable&&c(Wo,{clsPrefix:n,class:`${n}-card-header__close`,onClick:this.handleCloseClick,absolute:!0})):null}),Tt(s.default,d=>{const{content:u}=this,f=u?Ln(typeof u=="function"?[u()]:[u]):d;return f&&c("div",{class:[`${n}-card__content`,this.contentClass],style:this.contentStyle,role:"none"},f)}),Tt(s.footer,d=>{const u=this.footer?Ln([this.footer()]):d;return u&&c("div",{class:[`${n}-card__footer`,this.footerClass],style:this.footerStyle,role:"none"},u)}),Tt(s.action,d=>{const u=this.action?Ln([this.action()]):d;return u&&c("div",{class:`${n}-card__action`,role:"none"},u)}))}}),JC=e=>({dotSize:"8px",dotColor:"rgba(255, 255, 255, .3)",dotColorActive:"rgba(255, 255, 255
position: relative;
width: 100%;
height: 100%;
touch-action: pan-y;
overflow: hidden;
`,[M("slides",`
display: flex;
width: 100%;
height: 100%;
transition-timing-function: var(--n-bezier);
transition-property: transform;
`,[M("slide",`
flex-shrink: 0;
position: relative;
width: 100%;
height: 100%;
outline: none;
overflow: hidden;
`,[O("> img",`
display: block;
`)])]),M("dots",`
position: absolute;
display: flex;
flex-wrap: nowrap;
`,[I("dot",[M("dot",`
height: var(--n-dot-size);
width: var(--n-dot-size);
background-color: var(--n-dot-color);
border-radius: 50%;
cursor: pointer;
transition:
box-shadow .3s var(--n-bezier),
background-color .3s var(--n-bezier);
outline: none;
`,[O("&:focus",`
background-color: var(--n-dot-color-focus);
`),I("active",`
background-color: var(--n-dot-color-active);
`)])]),I("line",[M("dot",`
border-radius: 9999px;
width: var(--n-dot-line-width);
height: 4px;
background-color: var(--n-dot-color);
cursor: pointer;
transition:
width .3s var(--n-bezier),
box-shadow .3s var(--n-bezier),
background-color .3s var(--n-bezier);
outline: none;
`,[O("&:focus",`
background-color: var(--n-dot-color-focus);
`),I("active",`
width: var(--n-dot-line-width-active);
background-color: var(--n-dot-color-active);
`)])])]),M("arrow",`
transition: background-color .3s var(--n-bezier);
cursor: pointer;
height: 28px;
width: 28px;
display: flex;
align-items: center;
justify-content: center;
background-color: rgba(255, 255, 255, .2);
color: var(--n-arrow-color);
border-radius: 8px;
user-select: none;
-webkit-user-select: none;
font-size: 18px;
`,[O("svg",`
height: 1em;
width: 1em;
`),O("&:hover",`
background-color: rgba(255, 255, 255, .3);
`)]),I("vertical",`
touch-action: pan-x;
`,[M("slides",`
flex-direction: column;
`),I("fade",[M("slide",`
top: 50%;
left: unset;
transform: translateY(-50%);
`)]),I("card",[M("slide",`
top: 50%;
left: unset;
transform: translateY(-50%) translateZ(-400px);
`,[I("current",`
transform: translateY(-50%) translateZ(0);
`),I("prev",`
transform: translateY(-100%) translateZ(-200px);
`),I("next",`
transform: translateY(0%) translateZ(-200px);
`)])])]),I("usercontrol",[M("slides",[O(">",[O("div",`
position: absolute;
top: 50%;
left: 50%;
width: 100%;
height: 100%;
transform: translate(-50%, -50%);
`)])])]),I("left",[M("dots",`
transform: translateY(-50%);
top: 50%;
left: 12px;
flex-direction: column;
`,[I("line",[M("dot",`
width: 4px;
height: var(--n-dot-line-width);
margin: 4px 0;
transition:
height .3s var(--n-bezier),
box-shadow .3s var(--n-bezier),
background-color .3s var(--n-bezier);
outline: none;
`,[I("active",`
height: var(--n-dot-line-width-active);
`)])])]),M("dot",`
margin: 4px 0;
`)]),M("arrow-group",`
position: absolute;
display: flex;
flex-wrap: nowrap;
`),I("vertical",[M("arrow",`
transform: rotate(90deg);
`)]),I("show-arrow",[I("bottom",[M("dots",`
transform: translateX(0);
bottom: 18px;
left: 18px;
`)]),I("top",[M("dots",`
transform: translateX(0);
top: 18px;
left: 18px;
`)]),I("left",[M("dots",`
transform: translateX(0);
top: 18px;
left: 18px;
`)]),I("right",[M("dots",`
transform: translateX(0);
top: 18px;
right: 18px;
`)])]),I("left",[M("arrow-group",`
bottom: 12px;
left: 12px;
flex-direction: column;
`,[O("> *:first-child",`
margin-bottom: 12px;
`)])]),I("right",[M("dots",`
transform: translateY(-50%);
top: 50%;
right: 12px;
flex-direction: column;
`,[I("line",[M("dot",`
width: 4px;
height: var(--n-dot-line-width);
margin: 4px 0;
transition:
height .3s var(--n-bezier),
box-shadow .3s var(--n-bezier),
background-color .3s var(--n-bezier);
outline: none;
`,[I("active",`
height: var(--n-dot-line-width-active);
`)])])]),M("dot",`
margin: 4px 0;
`),M("arrow-group",`
bottom: 12px;
right: 12px;
flex-direction: column;
`,[O("> *:first-child",`
margin-bottom: 12px;
`)])]),I("top",[M("dots",`
transform: translateX(-50%);
top: 12px;
left: 50%;
`,[I("line",[M("dot",`
margin: 0 4px;
`)])]),M("dot",`
margin: 0 4px;
`),M("arrow-group",`
top: 12px;
right: 12px;
`,[O("> *:first-child",`
margin-right: 12px;
`)])]),I("bottom",[M("dots",`
transform: translateX(-50%);
bottom: 12px;
left: 50%;
`,[I("line",[M("dot",`
margin: 0 4px;
`)])]),M("dot",`
margin: 0 4px;
`),M("arrow-group",`
bottom: 12px;
right: 12px;
`,[O("> *:first-child",`
margin-right: 12px;
`)])]),I("fade",[M("slide",`
position: absolute;
opacity: 0;
transition-property: opacity;
pointer-events: none;
`,[I("current",`
opacity: 1;
pointer-events: auto;
`)])]),I("card",[M("slides",`
perspective: 1000px;
`),M("slide",`
position: absolute;
left: 50%;
opacity: 0;
transform: translateX(-50%) translateZ(-400px);
transition-property: opacity, transform;
`,[I("current",`
opacity: 1;
transform: translateX(-50%) translateZ(0);
z-index: 1;
`),I("prev",`
opacity: 0.4;
transform: translateX(-100%) translateZ(-200px);
`),I("next",`
opacity: 0.4;
transform: translateX(0%) translateZ(-200px);
`)])])]),bB=["transitionDuration","transitionTimingFunction"],rw=Object.assign(Object.assign({},ye.props),{defaultIndex:{type:Number,default:0},currentIndex:Number,showArrow:Boolean,dotType:{type:String,default:"dot"},dotPlacement:{type:String,default:"bottom"},slidesPerView:{type:[Number,String],default:1},spaceBetween:{type:Number,default:0},centeredSlides:Boolean,direction:{type:String,default:"horizontal"},autoplay:Boolean,interval:{type:Number,default:5e3},loop:{type:Boolean,default:!0},effect:{type:String,default:"slide"},showDots:{type:Boolean,default:!0},trigger:{type:String,default:"click"},transitionStyle:{type:Object,default:()=>({transitionDuration:"300ms"})},transitionProps:Object,draggable:Boolean,prevSlideStyle:[Object,String],nextSlideStyle:[Object,String],touchable:{type:Boolean,default:!0},mousewheel:Boolean,keyboard:Boolean,"onUpdate:currentIndex":Function,onUpdateCurrentIndex:Function});let Fu=!1;const xB=re({name:"Carousel",props:rw,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:r}=Ne(e),n=D(null),o=D(null),i=D([]),a={value:[]},l=P(()=>e.direction==="vertical"),s=P(()=>l.value?"height":"width"),d=P(()=>l.value?"bottom":"right"),u=P(()=>e.effect==="slide"),f=P(()=>e.loop&&e.slidesPerView===1&&u.value),h=P(()=>e.effect==="custom"),g=P(()=>!u.value||e.centeredSlides?1:e.slidesPerView),v=P(()=>h.value?1:e.slidesPerView),b=P(()=>g.value==="auto"||e.slidesPerView==="auto"&&e.centeredSlides),m=D({width:0,height:0}),p=P(()=>{const{value:K}=i;if(!K.length)return[];const{value:pe}=b;if(pe)return K.map(fe=>hb(fe));const{value:Pe}=v,{value:Ue}=m,{value:Ye}=s;let dt=Ue[Ye];if(Pe!=="auto"){const{spaceBetween:fe}=e,Fe=dt-(Pe-1)*fe,lt=1/Math.max(1,Pe);dt=Fe*lt}const pt=Object.assign(Object.assign({},Ue),{[Ye]:dt});return K.map(()=>pt)}),x=P(()=>{const{value:K}=p;if(!K.length)return[];const{centeredSlides:pe,spaceBetween:Pe}=e,{value:Ue}=s,{[Ue]:Ye}=m.value;let dt=0;return K.map(({[Ue]:pt})=>{let fe=dt;return pe&&(fe+=(pt-Ye)/2),dt+=pt+Pe,fe})}),S=D(!1),y=P(()=>{const{transitionStyle:K}=e;return K?Sr(K,bB):{}}),C=P(()=>h.value?0:dB(y.value.transitionDuration)),k=P(()=>{const{value:K}=i;if(!K.length)return[];const pe=!(b.value||v.value===1),Pe=pt=>{if(pe){const{value:fe}=s;return{[fe]:`${p.value[pt][fe]}px`}}};if(h.value)return K.map((pt,fe)=>Pe(fe));const{effect:Ue,spaceBetween:Ye}=e,{value:dt}=d;return K.reduce((pt,fe,Fe)=>{const lt=Object.assign(Object.assign({},Pe(Fe)),{[`margin-${dt}`]:`${Ye}px`});return pt.push(lt),S.value&&(Ue==="fade"||Ue==="card")&&Object.assign(lt,y.value),pt},[])}),R=P(()=>{const{value:K}=g,{length:pe}=i.value;if(K!=="auto")return Math.max(pe-K,0)+1;{const{value:Pe}=p,{length:Ue}=Pe;if(!Ue)return pe;const{value:Ye}=x,{value:dt}=s,pt=m.value[dt];let fe=Pe[Pe.length-1][dt],Fe=Ue;for(;Fe>1&&fe<pt;)Fe--,fe+=Ye[Fe]-Ye[Fe-1];return td(Fe+1,1,Ue)}}),$=P(()=>sB(R.value,f.value)),T=Iu(e.defaultIndex,f.value),z=D(ub(T,R.value,f.value)),F=$t(ve(e,"currentIndex"),z),_=P(()=>Iu(F.value,f.value));function N(K){var pe,Pe;K=td(K,0,R.value-1);const Ue=ub(K,R.value,f.value),{value:Ye}=F;Ue!==F.value&&(z.value=Ue,(pe=e["onUpdate:currentIndex"])===null||pe===void 0||pe.call(e,Ue,Ye),(Pe=e.onUpdateCurrentIndex)===null||Pe===void 0||Pe.call(e,Ue,Ye))}function j(K=_.value){return aB(K,R.value,e.loop)}function H(K=_.value){return lB(K,R.value,e.loop)}function Y(K){const pe=ee(K);return pe!==null&&j()===pe}function X(K){const pe=ee(K);return pe!==null&&H()===pe}function le(K){return _.value===ee(K)}function ke(K){return F.value===K}function be(){return j()===null}function Q(){return H()===null}function L(K){const pe=td(Iu(K,f.value),0,R.value);(K!==F.value||pe!==_.value)&&N(pe)}function A(){const K=j();K!==null&&N(K)}function U(){const K=H();K!==null&&N(K)}function ae(){(!Re||!f.value)&&A()}function he(){(!Re||!f.value)&&U()}let Re=!1,Oe=0;const V=D({});function Te(K,pe=0){V.value=Object.assign({},y.value,{transform:l.value?`translateY(${-K}px)`:`translateX(${-K}px)`,transitionDuration:`${pe}ms`})}function Me(K=0){u.value?Ve(_.value,K):Oe!==0&&(!Re&&K>0&&(Re=!0),Te(Oe=0,K))}function Ve(K,pe){const Pe=E(K
font-size: var(--n-font-size);
outline: none;
cursor: pointer;
display: inline-flex;
flex-wrap: nowrap;
align-items: flex-start;
word-break: break-word;
line-height: var(--n-size);
--n-merged-color-table: var(--n-color-table);
`,[I("show-label","line-height: var(--n-label-line-height);"),O("&:hover",[w("checkbox-box",[M("border","border: var(--n-border-checked);")])]),O("&:focus:not(:active)",[w("checkbox-box",[M("border",`
border: var(--n-border-focus);
box-shadow: var(--n-box-shadow-focus);
`)])]),I("inside-table",[w("checkbox-box",`
background-color: var(--n-merged-color-table);
`)]),I("checked",[w("checkbox-box",`
background-color: var(--n-color-checked);
`,[w("checkbox-icon",[O(".check-icon",`
opacity: 1;
transform: scale(1);
`)])])]),I("indeterminate",[w("checkbox-box",[w("checkbox-icon",[O(".check-icon",`
opacity: 0;
transform: scale(.5);
`),O(".line-icon",`
opacity: 1;
transform: scale(1);
`)])])]),I("checked, indeterminate",[O("&:focus:not(:active)",[w("checkbox-box",[M("border",`
border: var(--n-border-checked);
box-shadow: var(--n-box-shadow-focus);
`)])]),w("checkbox-box",`
background-color: var(--n-color-checked);
border-left: 0;
border-top: 0;
`,[M("border",{border:"var(--n-border-checked)"})])]),I("disabled",{cursor:"not-allowed"},[I("checked",[w("checkbox-box",`
background-color: var(--n-color-disabled-checked);
`,[M("border",{border:"var(--n-border-disabled-checked)"}),w("checkbox-icon",[O(".check-icon, .line-icon",{fill:"var(--n-check-mark-color-disabled-checked)"})])])]),w("checkbox-box",`
background-color: var(--n-color-disabled);
`,[M("border",`
border: var(--n-border-disabled);
`),w("checkbox-icon",[O(".check-icon, .line-icon",`
fill: var(--n-check-mark-color-disabled);
`)])]),M("label",`
color: var(--n-text-color-disabled);
`)]),w("checkbox-box-wrapper",`
position: relative;
width: var(--n-size);
flex-shrink: 0;
flex-grow: 0;
user-select: none;
-webkit-user-select: none;
`),w("checkbox-box",`
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
height: var(--n-size);
width: var(--n-size);
display: inline-block;
box-sizing: border-box;
border-radius: var(--n-border-radius);
background-color: var(--n-color);
transition: background-color 0.3s var(--n-bezier);
`,[M("border",`
transition:
border-color .3s var(--n-bezier),
box-shadow .3s var(--n-bezier);
border-radius: inherit;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
border: var(--n-border);
`),w("checkbox-icon",`
display: flex;
align-items: center;
justify-content: center;
position: absolute;
left: 1px;
right: 1px;
top: 1px;
bottom: 1px;
`,[O(".check-icon, .line-icon",`
width: 100%;
fill: var(--n-check-mark-color);
opacity: 0;
transform: scale(0.5);
transform-origin: center;
transition:
fill 0.3s var(--n-bezier),
transform 0.3s var(--n-bezier),
opacity 0.3s var(--n-bezier),
border-color 0.3s var(--n-bezier);
`),qr({left:"1px",top:"1px"})])]),M("label",`
color: var(--n-text-color);
transition: color .3s var(--n-bezier);
user-select: none;
-webkit-user-select: none;
padding: var(--n-label-padding);
font-weight: var(--n-label-font-weight);
`,[O("&:empty",{display:"none"})])]),So(w("checkbox",`
--n-merged-color-table: var(--n-color-table-modal);
`)),jo(w("checkbox",`
--n-merged-color-table: var(--n-color-table-popover);
`))]),sw=Object.assign(Object.assign({},ye.props),{size:String,checked:{type:[Boolean,String,Number],default:void 0},defaultChecked:{type:[Boolean,String,Number],default:!1},value:[String,Number],disabled:{type:Boolean,default:void 0},indeterminate:Boolean,label:String,focusable:{type:Boolean,default:!0},checkedValue:{type:[Boolean,String,Number],default:!0},uncheckedValue:{type:[Boolean,String,Number],default:!1},"onUpdate:checked":[Function,Array],onUpdateChecked:[Function,Array],privateInsideTable:Boolean,onChange:[Function,Array]}),qo=re({name:"Checkbox",props:sw,setup(e){const t=D(null),{mergedClsPrefixRef:r,inlineThemeDisabled:n,mergedRtlRef:o}=Ne(e),i=Rr(e,{mergedSize(k){const{size:R}=e;if(R!==void 0)return R;if(s){const{value:$}=s.mergedSizeRef;if($!==void 0)return $}if(k){const{mergedSize:$}=k;if($!==void 0)return $.value}return"medium"},mergedDisabled(k){const{disabled:R}=e;if(R!==void 0)return R;if(s){if(s.disabledRef.value)return!0;const{maxRef:{value:$},checkedCountRef:T}=s;if($!==void 0&&T.value>=$&&!h.value)return!0;const{minRef:{value:z}}=s;if(z!==void 0&&T.value<=z&&h.value)return!0}return k?k.disabled.value:!1}}),{mergedDisabledRef:a,mergedSizeRef:l}=i,s=De(iw,null),d=D(e.defaultChecked),u=ve(e,"checked"),f=$t(u,d),h=ct(()=>{if(s){const k=s.valueSetRef.value;return k&&e.value!==void 0?k.has(e.value):!1}else return f.value===e.checkedValue}),g=ye("Checkbox","-checkbox",TB,dl,e,r);function v(k){if(s&&e.value!==void 0)s.toggleCheckbox(!h.value,e.value);else{const{onChange:R,"onUpdate:checked":$,onUpdateChecked:T}=e,{nTriggerFormInput:z,nTriggerFormChange:F}=i,_=h.value?e.uncheckedValue:e.checkedValue;$&&ue($,_,k),T&&ue(T,_,k),R&&ue(R,_,k),z(),F(),d.value=_}}function b(k){a.value||v(k)}function m(k){if(!a.value)switch(k.key){case" ":case"Enter":v(k)}}function p(k){switch(k.key){case" ":k.preventDefault()}}const x={focus:()=>{var k;(k=t.value)===null||k===void 0||k.focus()},blur:()=>{var k;(k=t.value)===null||k===void 0||k.blur()}},S=Wt("Checkbox",o,r),y=P(()=>{const{value:k}=l,{common:{cubicBezierEaseInOut:R},self:{borderRadius:$,color:T,colorChecked:z,colorDisabled:F,colorTableHeader:_,colorTableHeaderModal:N,colorTableHeaderPopover:j,checkMarkColor:H,checkMarkColorDisabled:Y,border:X,borderFocus:le,borderDisabled:ke,borderChecked:be,boxShadowFocus:Q,textColor:L,textColorDisabled:A,checkMarkColorDisabledChecked:U,colorDisabledChecked:ae,borderDisabledChecked:he,labelPadding:Re,labelLineHeight:Oe,labelFontWeight:V,[Ce("fontSize",k)]:Te,[Ce("size",k)]:Me}}=g.value;return{"--n-label-line-height":Oe,"--n-label-font-weight":V,"--n-size":Me,"--n-bezier":R,"--n-border-radius":$,"--n-border":X,"--n-border-checked":be,"--n-border-focus":le,"--n-border-disabled":ke,"--n-border-disabled-checked":he,"--n-box-shadow-focus":Q,"--n-color":T,"--n-color-checked":z,"--n-color-table":_,"--n-color-table-modal":N,"--n-color-table-popover":j,"--n-color-disabled":F,"--n-color-disabled-checked":ae,"--n-text-color":L,"--n-text-color-disabled":A,"--n-check-mark-color":H,"--n-check-mark-color-disabled":Y,"--n-check-mark-color-disabled-checked":U,"--n-font-size":Te,"--n-label-padding":Re}}),C=n?Qe("checkbox",P(()=>l.value[0]),y,e):void 0;return Object.assign(i,x,{rtlEnabled:S,selfRef:t,mergedClsPrefix:r,mergedDisabled:a,renderedChecked:h,mergedTheme:g,labelId:sn(),handleClick:b,handleKeyUp:m,handleKeyDown:p,cssVars:n?void 0:y,themeClass:C==null?void 0:C.themeClass,onRender:C==null?void 0:C.onRender})},render(){var e;const{$slots:t,renderedChecked:r,mergedDisabled:n,indeterminate:o,privateInsideTable:i,cssVars:a,labelId:l,label:s,mergedClsPrefix:d,focusable:u,handleKeyUp:f,handleKeyDown:h,handleClick:g}=this;(e=this.onRender)===null||e===void 0||e.call(this);const v=Tt(t.default,b=>s||b?c("span",{class:`${d}-checkbox__label`,id:l},s||b):null);return c("div",{ref:"selfRef",class:[`${d}-checkbox`,this.themeClass,this.rtlEnabled&&`${d}-checkbox--rtl`,r&&`${d}-checkbox--checked`,n&&`${d}-checkbox--disabled`,o&&`${d}-checkbox--indeterminate`,i&&`${d}-checkbox--inside-table`,v&&`${d}-checkbox--show-label`],tabindex:n||!u?void 0:0,role:"ch
outline: none;
position: relative;
margin: 4px 0;
display: flex;
flex-flow: column nowrap;
border-radius: var(--n-menu-border-radius);
overflow: hidden;
box-shadow: var(--n-menu-box-shadow);
color: var(--n-option-text-color);
background-color: var(--n-menu-color);
`,[Ar({transformOrigin:"inherit",duration:"0.2s"}),M("empty",`
display: flex;
padding: 12px 32px;
flex: 1;
justify-content: center;
`),w("scrollbar",`
width: 100%;
`),w("base-menu-mask",`
background-color: var(--n-menu-mask-color);
`),w("base-loading",`
color: var(--n-loading-color);
`),w("cascader-submenu-wrapper",`
position: relative;
display: flex;
flex-wrap: nowrap;
`),w("cascader-submenu",`
height: var(--n-menu-height);
min-width: var(--n-column-width);
position: relative;
`,[I("virtual",`
width: var(--n-column-width);
`),w("scrollbar-content",`
position: relative;
`),O("&:first-child",`
border-top-left-radius: var(--n-menu-border-radius);
border-bottom-left-radius: var(--n-menu-border-radius);
`),O("&:last-child",`
border-top-right-radius: var(--n-menu-border-radius);
border-bottom-right-radius: var(--n-menu-border-radius);
`),O("&:not(:first-child)",`
border-left: 1px solid var(--n-menu-divider-color);
`)]),w("cascader-menu-action",`
box-sizing: border-box;
padding: 8px;
border-top: 1px solid var(--n-menu-divider-color);
`),w("cascader-option",`
height: var(--n-option-height);
line-height: var(--n-option-height);
font-size: var(--n-option-font-size);
padding: 0 0 0 18px;
box-sizing: border-box;
min-width: 182px;
background-color: #0000;
display: flex;
align-items: center;
white-space: nowrap;
position: relative;
cursor: pointer;
transition:
background-color .2s var(--n-bezier),
color 0.2s var(--n-bezier);
`,[I("show-prefix",`
padding-left: 0;
`),M("label",`
flex: 1 0 0;
overflow: hidden;
text-overflow: ellipsis;
`),M("prefix",`
min-width: 32px;
display: flex;
align-items: center;
justify-content: center;
`),M("suffix",`
min-width: 32px;
display: flex;
align-items: center;
justify-content: center;
`),w("cascader-option-icon-placeholder",`
line-height: 0;
position: relative;
width: 16px;
height: 16px;
font-size: 16px;
`,[w("cascader-option-icon",[I("checkmark",`
color: var(--n-option-check-mark-color);
`,[Ar({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})]),I("arrow",`
color: var(--n-option-arrow-color);
`)])]),I("selected",`
color: var(--n-option-text-color-active);
`),I("active",`
color: var(--n-option-text-color-active);
background-color: var(--n-option-color-hover);
`),I("pending",`
background-color: var(--n-option-color-hover);
`),O("&:hover",`
background-color: var(--n-option-color-hover);
`),I("disabled",`
color: var(--n-option-text-color-disabled);
background-color: #0000;
cursor: not-allowed;
`,[w("cascader-option-icon",[I("arrow",`
color: var(--n-option-text-color-disabled);
`)])])])]),w("cascader",`
z-index: auto;
position: relative;
width: 100%;
`)]),dw=Object.assign(Object.assign({},ye.props),{allowCheckingNotLoaded:Boolean,to:Kt.propTo,bordered:{type:Boolean,default:void 0},options:{type:Array,default:()=>[]},value:[String,Number,Array],defaultValue:{type:[String,Number,Array],default:null},placeholder:String,multiple:Boolean,size:String,filterable:Boolean,disabled:{type:Boolean,default:void 0},disabledField:{type:String,default:"disabled"},expandTrigger:{type:String,default:"click"},clearable:Boolean,clearFilterAfterSelect:{type:Boolean,default:!0},remote:Boolean,onLoad:Function,separator:{type:String,default:" / "},filter:Function,placement:{type:String,default:"bottom-start"},cascade:{type:Boolean,default:!0},leafOnly:Boolean,showPath:{type:Boolean,default:!0},show:{type:Boolean,default:void 0},maxTagCount:[String,Number],ellipsisTagPopoverProps:Object,menuProps:Object,filterMenuProps:Object,virtualScroll:{type:Boolean,default:!0},checkStrategy:{type:String,default:"all"},valueField:{type:String,default:"value"},labelField:{type:String,default:"label"},childrenField:{type:String,default:"children"},renderLabel:Function,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],onBlur:Function,onFocus:Function,getColumnStyle:Function,renderPrefix:Function,renderSuffix:Function,onChange:[Function,Array]}),MB=re({name:"Cascader",props:dw,setup(e,{slots:t}){const{mergedBorderedRef:r,mergedClsPrefixRef:n,namespaceRef:o,inlineThemeDisabled:i}=Ne(e),a=ye("Cascader","-cascader",_B,wB,e,n),{localeRef:l}=mr("Cascader"),s=D(e.defaultValue),d=P(()=>e.value),u=$t(d,s),f=P(()=>e.leafOnly?"child":e.checkStrategy),h=D(""),g=Rr(e),{mergedSizeRef:v,mergedDisabledRef:b,mergedStatusRef:m}=g,p=D(null),x=D(null),S=D(null),y=D(null),C=D(null),k=D(new Set),R=D(null),$=D(null),T=Kt(e),z=D(!1),F=se=>{k.value.add(se)},_=se=>{k.value.delete(se)},N=P(()=>{const{valueField:se,childrenField:$e,disabledField:Xe}=e;return On(e.options,{getDisabled(Ge){return Ge[Xe]},getKey(Ge){return Ge[se]},getChildren(Ge){return Ge[$e]}})}),j=P(()=>{const{cascade:se,multiple:$e}=e;return $e&&Array.isArray(u.value)?N.value.getCheckedKeys(u.value,{cascade:se,allowNotLoaded:e.allowCheckingNotLoaded}):{checkedKeys:[],indeterminateKeys:[]}}),H=P(()=>j.value.checkedKeys),Y=P(()=>j.value.indeterminateKeys),X=P(()=>{const{treeNodePath:se,treeNode:$e}=N.value.getPath(C.value);let Xe;return $e===null?Xe=[N.value.treeNodes]:(Xe=se.map(Ge=>Ge.siblings),!$e.isLeaf&&!k.value.has($e.key)&&$e.children&&Xe.push($e.children)),Xe}),le=P(()=>{const{keyPath:se}=N.value.getPath(C.value);return se}),ke=P(()=>a.value.self.optionHeight);Io(e.options)&&ft(e.options,(se,$e)=>{se!==$e&&(C.value=null,y.value=null)});function be(se){const{onUpdateShow:$e,"onUpdate:show":Xe}=e;$e&&ue($e,se),Xe&&ue(Xe,se),V.value=se}function Q(se,$e,Xe){const{onUpdateValue:Ge,"onUpdate:value":K,onChange:pe}=e,{nTriggerFormInput:Pe,nTriggerFormChange:Ue}=g;Ge&&ue(Ge,se,$e,Xe),K&&ue(K,se,$e,Xe),pe&&ue(pe,se,$e,Xe),s.value=se,Pe(),Ue()}function L(se){y.value=se}function A(se){C.value=se}function U(se){const{value:{getNode:$e}}=N;return se.map(Xe=>{var Ge;return((Ge=$e(Xe))===null||Ge===void 0?void 0:Ge.rawNode)||null})}function ae(se){var $e;const{cascade:Xe,multiple:Ge,filterable:K}=e,{value:{check:pe,getNode:Pe,getPath:Ue}}=N;if(Ge)try{const{checkedKeys:Ye}=pe(se,j.value.checkedKeys,{cascade:Xe,checkStrategy:f.value,allowNotLoaded:e.allowCheckingNotLoaded});Q(Ye,U(Ye),Ye.map(dt=>{var pt;return rd((pt=Ue(dt))===null||pt===void 0?void 0:pt.treeNodePath)})),K&&ge(),y.value=se,C.value=se}catch(Ye){if(Ye instanceof F1){if(p.value){const dt=Pe(se);dt!==null&&p.value.showErrorMessage(dt.rawNode[e.labelField])}}else throw Ye}else if(f.value==="child"){const Ye=Pe(se);if(Ye!=null&&Ye.isLeaf)Q(se,Ye.rawNode,rd(Ue(se).treeNodePath));else return!1}else{const Ye=Pe(se);Q(se,(Ye==null?void 0:Ye.rawNode)||null,rd(($e=Ue(se))===null||$e===void 0?void 0:$e.treeNodePath))}return!0}function he(se){const{cascade:$e,multiple:Xe}=e;if(Xe){const{value:{uncheck:Ge,getNode:K,getPath:pe}}=N,{che
font-size: var(--n-font-size);
font-family: var(--n-font-family);
`,[I("show-line-numbers",`
display: flex;
`),M("line-numbers",`
user-select: none;
padding-right: 12px;
text-align: right;
transition: color .3s var(--n-bezier);
color: var(--n-line-number-text-color);
`),I("word-wrap",[O("pre",`
white-space: pre-wrap;
word-break: break-all;
`)]),O("pre",`
margin: 0;
line-height: inherit;
font-size: inherit;
font-family: inherit;
`),O("[class^=hljs]",`
color: var(--n-text-color);
transition:
color .3s var(--n-bezier),
background-color .3s var(--n-bezier);
`)]),({props:e})=>{const t=`${e.bPrefix}code`;return[`${t} .hljs-comment,
${t} .hljs-quote {
color: var(--n-mono-3);
font-style: italic;
}`,`${t} .hljs-doctag,
${t} .hljs-keyword,
${t} .hljs-formula {
color: var(--n-hue-3);
}`,`${t} .hljs-section,
${t} .hljs-name,
${t} .hljs-selector-tag,
${t} .hljs-deletion,
${t} .hljs-subst {
color: var(--n-hue-5);
}`,`${t} .hljs-literal {
color: var(--n-hue-1);
}`,`${t} .hljs-string,
${t} .hljs-regexp,
${t} .hljs-addition,
${t} .hljs-attribute,
${t} .hljs-meta-string {
color: var(--n-hue-4);
}`,`${t} .hljs-built_in,
${t} .hljs-class .hljs-title {
color: var(--n-hue-6-2);
}`,`${t} .hljs-attr,
${t} .hljs-variable,
${t} .hljs-template-variable,
${t} .hljs-type,
${t} .hljs-selector-class,
${t} .hljs-selector-attr,
${t} .hljs-selector-pseudo,
${t} .hljs-number {
color: var(--n-hue-6);
}`,`${t} .hljs-symbol,
${t} .hljs-bullet,
${t} .hljs-link,
${t} .hljs-meta,
${t} .hljs-selector-id,
${t} .hljs-title {
color: var(--n-hue-2);
}`,`${t} .hljs-emphasis {
font-style: italic;
}`,`${t} .hljs-strong {
font-weight: var(--n-font-weight-strong);
}`,`${t} .hljs-link {
text-decoration: underline;
}`]}]),fw=Object.assign(Object.assign({},ye.props),{language:String,code:{type:String,default:""},trim:{type:Boolean,default:!0},hljs:Object,uri:Boolean,inline:Boolean,wordWrap:Boolean,showLineNumbers:Boolean,internalFontSize:Number,internalNoHighlight:Boolean}),hw=re({name:"Code",props:fw,setup(e,{slots:t}){const{internalNoHighlight:r}=e,{mergedClsPrefixRef:n,inlineThemeDisabled:o}=Ne(),i=D(null),a=r?{value:void 0}:k1(e),l=(g,v,b)=>{const{value:m}=a;return!m||!(g&&m.getLanguage(g))?null:m.highlight(b?v.trim():v,{language:g}).value},s=P(()=>e.inline||e.wordWrap?!1:e.showLineNumbers),d=()=>{if(t.default)return;const{value:g}=i;if(!g)return;const{language:v}=e,b=e.uri?window.decodeURIComponent(e.code):e.code;if(v){const p=l(v,b,e.trim);if(p!==null){if(e.inline)g.innerHTML=p;else{const x=g.querySelector(".__code__");x&&g.removeChild(x);const S=document.createElement("pre");S.className="__code__",S.innerHTML=p,g.appendChild(S)}return}}if(e.inline){g.textContent=b;return}const m=g.querySelector(".__code__");if(m)m.textContent=b;else{const p=document.createElement("pre");p.className="__code__",p.textContent=b,g.innerHTML="",g.appendChild(p)}};Bt(d),ft(ve(e,"language"),d),ft(ve(e,"code"),d),r||ft(a,d);const u=ye("Code","-code",FB,uw,e,n),f=P(()=>{const{common:{cubicBezierEaseInOut:g,fontFamilyMono:v},self:{textColor:b,fontSize:m,fontWeightStrong:p,lineNumberTextColor:x,"mono-3":S,"hue-1":y,"hue-2":C,"hue-3":k,"hue-4":R,"hue-5":$,"hue-5-2":T,"hue-6":z,"hue-6-2":F}}=u.value,{internalFontSize:_}=e;return{"--n-font-size":_?`${_}px`:m,"--n-font-family":v,"--n-font-weight-strong":p,"--n-bezier":g,"--n-text-color":b,"--n-mono-3":S,"--n-hue-1":y,"--n-hue-2":C,"--n-hue-3":k,"--n-hue-4":R,"--n-hue-5":$,"--n-hue-5-2":T,"--n-hue-6":z,"--n-hue-6-2":F,"--n-line-number-text-color":x}}),h=o?Qe("code",P(()=>`${e.internalFontSize||"a"}`),f,e):void 0;return{mergedClsPrefix:n,codeRef:i,mergedShowLineNumbers:s,lineNumbers:P(()=>{let g=1;const v=[];let b=!1;for(const m of e.code)m===`
`?(b=!0,v.push(g++)):b=!1;return b||v.push(g++),v.join(`
`)}),cssVars:o?void 0:f,themeClass:h==null?void 0:h.themeClass,onRender:h==null?void 0:h.onRender}},render(){var e,t;const{mergedClsPrefix:r,wordWrap:n,mergedShowLineNumbers:o,onRender:i}=this;return i==null||i(),c("code",{class:[`${r}-code`,this.themeClass,n&&`${r}-code--word-wrap`,o&&`${r}-code--show-line-numbers`],style:this.cssVars,ref:"codeRef"},o?c("pre",{class:`${r}-code__line-numbers`},this.lineNumbers):null,(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e))}}),vw=e=>{const{fontWeight:t,textColor1:r,textColor2:n,textColorDisabled:o,dividerColor:i,fontSize:a}=e;return{titleFontSize:a,titleFontWeight:t,dividerColor:i,titleTextColor:r,titleTextColorDisabled:o,fontSize:a,textColor:n,arrowColor:n,arrowColorDisabled:o,itemMargin:"16px 0 0 0",titlePadding:"16px 0 0 0"}},DB={name:"Collapse",common:tt,self:vw},EB={name:"Collapse",common:et,self:vw},AB=w("collapse","width: 100%;",[w("collapse-item",`
font-size: var(--n-font-size);
color: var(--n-text-color);
transition:
color .3s var(--n-bezier),
border-color .3s var(--n-bezier);
margin: var(--n-item-margin);
`,[I("disabled",[M("header","cursor: not-allowed;",[M("header-main",`
color: var(--n-title-text-color-disabled);
`),w("collapse-item-arrow",`
color: var(--n-arrow-color-disabled);
`)])]),w("collapse-item","margin-left: 32px;"),O("&:first-child","margin-top: 0;"),O("&:first-child >",[M("header","padding-top: 0;")]),I("left-arrow-placement",[M("header",[w("collapse-item-arrow","margin-right: 4px;")])]),I("right-arrow-placement",[M("header",[w("collapse-item-arrow","margin-left: 4px;")])]),M("content-wrapper",[M("content-inner","padding-top: 16px;"),Ao({duration:"0.15s"})]),I("active",[M("header",[I("active",[w("collapse-item-arrow","transform: rotate(90deg);")])])]),O("&:not(:first-child)","border-top: 1px solid var(--n-divider-color);"),xt("disabled",[I("trigger-area-main",[M("header",[M("header-main","cursor: pointer;"),w("collapse-item-arrow","cursor: default;")])]),I("trigger-area-arrow",[M("header",[w("collapse-item-arrow","cursor: pointer;")])]),I("trigger-area-extra",[M("header",[M("header-extra","cursor: pointer;")])])]),M("header",`
font-size: var(--n-title-font-size);
display: flex;
flex-wrap: nowrap;
align-items: center;
transition: color .3s var(--n-bezier);
position: relative;
padding: var(--n-title-padding);
color: var(--n-title-text-color);
`,[M("header-main",`
display: flex;
flex-wrap: nowrap;
align-items: center;
font-weight: var(--n-title-font-weight);
transition: color .3s var(--n-bezier);
flex: 1;
color: var(--n-title-text-color);
`),M("header-extra",`
display: flex;
align-items: center;
transition: color .3s var(--n-bezier);
color: var(--n-text-color);
`),w("collapse-item-arrow",`
display: flex;
transition:
transform .15s var(--n-bezier),
color .3s var(--n-bezier);
font-size: 18px;
color: var(--n-arrow-color);
`)])])]),gw=Object.assign(Object.assign({},ye.props),{defaultExpandedNames:{type:[Array,String],default:null},expandedNames:[Array,String],arrowPlacement:{type:String,default:"left"},accordion:{type:Boolean,default:!1},displayDirective:{type:String,default:"if"},triggerAreas:{type:Array,default:()=>["main","extra","arrow"]},onItemHeaderClick:[Function,Array],"onUpdate:expandedNames":[Function,Array],onUpdateExpandedNames:[Function,Array],onExpandedNamesChange:{type:[Function,Array],validator:()=>!0,default:void 0}}),pw="n-collapse",BB=re({name:"Collapse",props:gw,setup(e,{slots:t}){const{mergedClsPrefixRef:r,inlineThemeDisabled:n,mergedRtlRef:o}=Ne(e),i=D(e.defaultExpandedNames),a=P(()=>e.expandedNames),l=$t(a,i),s=ye("Collapse","-collapse",AB,DB,e,r);function d(b){const{"onUpdate:expandedNames":m,onUpdateExpandedNames:p,onExpandedNamesChange:x}=e;p&&ue(p,b),m&&ue(m,b),x&&ue(x,b),i.value=b}function u(b){const{onItemHeaderClick:m}=e;m&&ue(m,b)}function f(b,m,p){const{accordion:x}=e,{value:S}=l;if(x)b?(d([m]),u({name:m,expanded:!0,event:p})):(d([]),u({name:m,expanded:!1,event:p}));else if(!Array.isArray(S))d([m]),u({name:m,expanded:!0,event:p});else{const y=S.slice(),C=y.findIndex(k=>m===k);~C?(y.splice(C,1),d(y),u({name:m,expanded:!1,event:p})):(y.push(m),d(y),u({name:m,expanded:!0,event:p}))}}ot(pw,{props:e,mergedClsPrefixRef:r,expandedNamesRef:l,slots:t,toggleItem:f});const h=Wt("Collapse",o,r),g=P(()=>{const{common:{cubicBezierEaseInOut:b},self:{titleFontWeight:m,dividerColor:p,titlePadding:x,titleTextColor:S,titleTextColorDisabled:y,textColor:C,arrowColor:k,fontSize:R,titleFontSize:$,arrowColorDisabled:T,itemMargin:z}}=s.value;return{"--n-font-size":R,"--n-bezier":b,"--n-text-color":C,"--n-divider-color":p,"--n-title-padding":x,"--n-title-font-size":$,"--n-title-text-color":S,"--n-title-text-color-disabled":y,"--n-title-font-weight":m,"--n-arrow-color":k,"--n-arrow-color-disabled":T,"--n-item-margin":z}}),v=n?Qe("collapse",void 0,g,e):void 0;return{rtlEnabled:h,mergedTheme:s,mergedClsPrefix:r,cssVars:n?void 0:g,themeClass:v==null?void 0:v.themeClass,onRender:v==null?void 0:v.onRender}},render(){var e;return(e=this.onRender)===null||e===void 0||e.call(this),c("div",{class:[`${this.mergedClsPrefix}-collapse`,this.rtlEnabled&&`${this.mergedClsPrefix}-collapse--rtl`,this.themeClass],style:this.cssVars},this.$slots)}}),NB=re({name:"CollapseItemContent",props:{displayDirective:{type:String,required:!0},show:Boolean,clsPrefix:{type:String,required:!0}},setup(e){return{onceTrue:Qx(ve(e,"show"))}},render(){return c(Ro,null,{default:()=>{const{show:e,displayDirective:t,onceTrue:r,clsPrefix:n}=this,o=t==="show"&&r,i=c("div",{class:`${n}-collapse-item__content-wrapper`},c("div",{class:`${n}-collapse-item__content-inner`},this.$slots));return o?hr(i,[[_n,e]]):e?i:null}})}}),mw={title:String,name:[String,Number],disabled:Boolean,displayDirective:String},LB=re({name:"CollapseItem",props:mw,setup(e){const{mergedRtlRef:t}=Ne(e),r=sn(),n=ct(()=>{var f;return(f=e.name)!==null&&f!==void 0?f:r}),o=De(pw);o||_r("collapse-item","`n-collapse-item` must be placed inside `n-collapse`.");const{expandedNamesRef:i,props:a,mergedClsPrefixRef:l,slots:s}=o,d=P(()=>{const{value:f}=i;if(Array.isArray(f)){const{value:h}=n;return!~f.findIndex(g=>g===h)}else if(f){const{value:h}=n;return h!==f}return!0});return{rtlEnabled:Wt("Collapse",t,l),collapseSlots:s,randomName:r,mergedClsPrefix:l,collapsed:d,triggerAreas:ve(a,"triggerAreas"),mergedDisplayDirective:P(()=>{const{displayDirective:f}=e;return f||a.displayDirective}),arrowPlacement:P(()=>a.arrowPlacement),handleClick(f){let h="main";pr(f,"arrow")&&(h="arrow"),pr(f,"extra")&&(h="extra"),a.triggerAreas.includes(h)&&o&&!e.disabled&&o.toggleItem(d.value,n.value,f)}}},render(){const{collapseSlots:e,$slots:t,arrowPlacement:r,collapsed:n,mergedDisplayDirective:o,mergedClsPrefix:i,disabled:a,triggerAreas:l}=this,s=mi(t.header,{collapsed:n},()=>[this.title]),d=t["header-extra"]||e["header-extra"],u=t.arrow||e.arrow;return c("div",{class:[`${i}-collapse-item`,`${i}-collapse-item--${r}-arrow-placement`,a&&`${i}
box-shadow: var(--n-menu-box-shadow);
`),ag={multiple:Boolean,value:{type:[String,Number,Array],default:null},cancelable:Boolean,options:{type:Array,default:()=>[]},size:{type:String,default:"medium"},scrollable:Boolean,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onMouseenter:Function,onMouseleave:Function,renderLabel:Function,showCheckmark:{type:Boolean,default:void 0},nodeProps:Function,virtualScroll:Boolean,onChange:[Function,Array]},gb=Yr(ag),ZB=re({name:"PopselectPanel",props:ag,setup(e){const t=De(Rw),{mergedClsPrefixRef:r,inlineThemeDisabled:n}=Ne(e),o=ye("Popselect","-pop-select",XB,ig,t.props,r),i=P(()=>On(e.options,_c("value","children")));function a(h,g){const{onUpdateValue:v,"onUpdate:value":b,onChange:m}=e;v&&ue(v,h,g),b&&ue(b,h,g),m&&ue(m,h,g)}function l(h){d(h.key)}function s(h){!pr(h,"action")&&!pr(h,"empty")&&!pr(h,"header")&&h.preventDefault()}function d(h){const{value:{getNode:g}}=i;if(e.multiple)if(Array.isArray(e.value)){const v=[],b=[];let m=!0;e.value.forEach(p=>{if(p===h){m=!1;return}const x=g(p);x&&(v.push(x.key),b.push(x.rawNode))}),m&&(v.push(h),b.push(g(h).rawNode)),a(v,b)}else{const v=g(h);v&&a([h],[v.rawNode])}else if(e.value===h&&e.cancelable)a(null,null);else{const v=g(h);v&&a(h,v.rawNode);const{"onUpdate:show":b,onUpdateShow:m}=t.props;b&&ue(b,!1),m&&ue(m,!1),t.setShow(!1)}Ot(()=>{t.syncPosition()})}ft(ve(e,"options"),()=>{Ot(()=>{t.syncPosition()})});const u=P(()=>{const{self:{menuBoxShadow:h}}=o.value;return{"--n-menu-box-shadow":h}}),f=n?Qe("select",void 0,u,t.props):void 0;return{mergedTheme:t.mergedThemeRef,mergedClsPrefix:r,treeMate:i,handleToggle:l,handleMenuMousedown:s,cssVars:n?void 0:u,themeClass:f==null?void 0:f.themeClass,onRender:f==null?void 0:f.onRender}},render(){var e;return(e=this.onRender)===null||e===void 0||e.call(this),c(ws,{clsPrefix:this.mergedClsPrefix,focusable:!0,nodeProps:this.nodeProps,class:[`${this.mergedClsPrefix}-popselect-menu`,this.themeClass],style:this.cssVars,theme:this.mergedTheme.peers.InternalSelectMenu,themeOverrides:this.mergedTheme.peerOverrides.InternalSelectMenu,multiple:this.multiple,treeMate:this.treeMate,size:this.size,value:this.value,virtualScroll:this.virtualScroll,scrollable:this.scrollable,renderLabel:this.renderLabel,onToggle:this.handleToggle,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseenter,onMousedown:this.handleMenuMousedown,showCheckmark:this.showCheckmark},{header:()=>{var t,r;return((r=(t=this.$slots).header)===null||r===void 0?void 0:r.call(t))||[]},action:()=>{var t,r;return((r=(t=this.$slots).action)===null||r===void 0?void 0:r.call(t))||[]},empty:()=>{var t,r;return((r=(t=this.$slots).empty)===null||r===void 0?void 0:r.call(t))||[]}})}}),Pw=Object.assign(Object.assign(Object.assign(Object.assign({},ye.props),Pi(la,["showArrow","arrow"])),{placement:Object.assign(Object.assign({},la.placement),{default:"bottom"}),trigger:{type:String,default:"hover"}}),ag),Tw=re({name:"Popselect",props:Pw,inheritAttrs:!1,__popover__:!0,setup(e){const{mergedClsPrefixRef:t}=Ne(e),r=ye("Popselect","-popselect",void 0,ig,e,t),n=D(null);function o(){var l;(l=n.value)===null||l===void 0||l.syncPosition()}function i(l){var s;(s=n.value)===null||s===void 0||s.setShow(l)}return ot(Rw,{props:e,mergedThemeRef:r,syncPosition:o,setShow:i}),Object.assign(Object.assign({},{syncPosition:o,setShow:i}),{popoverInstRef:n,mergedTheme:r})},render(){const{mergedTheme:e}=this,t={theme:e.peers.Popover,themeOverrides:e.peerOverrides.Popover,builtinThemeOverrides:{padding:"0"},ref:"popoverInstRef",internalRenderBody:(r,n,o,i,a)=>{const{$attrs:l}=this;return c(ZB,Object.assign({},l,{class:[l.class,r],style:[l.style,...o]},Sr(this.$props,gb),{ref:jx(n),onMouseenter:El([i,l.onMouseenter]),onMouseleave:El([a,l.onMouseleave])}),{header:()=>{var s,d;return(d=(s=this.$slots).header)===null||d===void 0?void 0:d.call(s)},action:()=>{var s,d;return(d=(s=this.$slots).action)===null||d===void 0?void 0:d.call(s)},empty:()=>{var s,d;return(d=(s=this.$slots).empty)===null||d===void 0?void 0:d.call(s)}})}};return c(ya,Object.assign({},Pi(this.$props,gb),t,{internalDeactivateImmediately:
z-index: auto;
outline: none;
width: 100%;
position: relative;
`),w("select-menu",`
margin: 4px 0;
box-shadow: var(--n-menu-box-shadow);
`,[Ar({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]),_w=Object.assign(Object.assign({},ye.props),{to:Kt.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,clearFilterAfterSelect:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},defaultValue:{type:[String,Number,Array],default:null},keyboard:{type:Boolean,default:!0},value:[String,Number,Array],placeholder:String,menuProps:Object,multiple:Boolean,size:String,filterable:Boolean,disabled:{type:Boolean,default:void 0},remote:Boolean,loading:Boolean,filter:Function,placement:{type:String,default:"bottom-start"},widthMode:{type:String,default:"trigger"},tag:Boolean,onCreate:Function,fallbackOption:{type:[Function,Boolean],default:void 0},show:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:!0},maxTagCount:[Number,String],ellipsisTagPopoverProps:Object,consistentMenuWidth:{type:Boolean,default:!0},virtualScroll:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},childrenField:{type:String,default:"children"},renderLabel:Function,renderOption:Function,renderTag:Function,"onUpdate:value":[Function,Array],inputProps:Object,nodeProps:Function,ignoreComposition:{type:Boolean,default:!0},showOnFocus:Boolean,onUpdateValue:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onFocus:[Function,Array],onScroll:[Function,Array],onSearch:[Function,Array],onUpdateShow:[Function,Array],"onUpdate:show":[Function,Array],displayDirective:{type:String,default:"show"},resetMenuOnOptionsChange:{type:Boolean,default:!0},status:String,showCheckmark:{type:Boolean,default:!0},onChange:[Function,Array],items:Array}),Mw=re({name:"Select",props:_w,setup(e){const{mergedClsPrefixRef:t,mergedBorderedRef:r,namespaceRef:n,inlineThemeDisabled:o}=Ne(e),i=ye("Select","-select",QB,zw,e,t),a=D(e.defaultValue),l=ve(e,"value"),s=$t(l,a),d=D(!1),u=D(""),f=P(()=>{const{valueField:G,childrenField:q}=e,xe=_c(G,q);return On(_.value,xe)}),h=P(()=>TE(z.value,e.valueField,e.childrenField)),g=D(!1),v=$t(ve(e,"show"),g),b=D(null),m=D(null),p=D(null),{localeRef:x}=mr("Select"),S=P(()=>{var G;return(G=e.placeholder)!==null&&G!==void 0?G:x.value.placeholder}),y=bi(e,["items","options"]),C=[],k=D([]),R=D([]),$=D(new Map),T=P(()=>{const{fallbackOption:G}=e;if(G===void 0){const{labelField:q,valueField:xe}=e;return Ee=>({[q]:String(Ee),[xe]:Ee})}return G===!1?!1:q=>Object.assign(G(q),{value:q})}),z=P(()=>R.value.concat(k.value).concat(y.value)),F=P(()=>{const{filter:G}=e;if(G)return G;const{labelField:q,valueField:xe}=e;return(Ee,Ae)=>{if(!Ae)return!1;const ce=Ae[q];if(typeof ce=="string")return $u(Ee,ce);const _e=Ae[xe];return typeof _e=="string"?$u(Ee,_e):typeof _e=="number"?$u(Ee,String(_e)):!1}}),_=P(()=>{if(e.remote)return y.value;{const{value:G}=z,{value:q}=u;return!q.length||!e.filterable?G:PE(G,F.value,q,e.childrenField)}});function N(G){const q=e.remote,{value:xe}=$,{value:Ee}=h,{value:Ae}=T,ce=[];return G.forEach(_e=>{if(Ee.has(_e))ce.push(Ee.get(_e));else if(q&&xe.has(_e))ce.push(xe.get(_e));else if(Ae){const se=Ae(_e);se&&ce.push(se)}}),ce}const j=P(()=>{if(e.multiple){const{value:G}=s;return Array.isArray(G)?N(G):[]}return null}),H=P(()=>{const{value:G}=s;return!e.multiple&&!Array.isArray(G)?G===null?null:N([G])[0]||null:null}),Y=Rr(e),{mergedSizeRef:X,mergedDisabledRef:le,mergedStatusRef:ke}=Y;function be(G,q){const{onChange:xe,"onUpdate:value":Ee,onUpdateValue:Ae}=e,{nTriggerFormChange:ce,nTriggerFormInput:_e}=Y;xe&&ue(xe,G,q),Ae&&ue(Ae,G,q),Ee&&ue(Ee,G,q),a.value=G,ce(),_e()}function Q(G){const{onBlur:q}=e,{nTriggerFormBlur:xe}=Y;q&&ue(q,G),xe()}function L(){const{onClear:G}=e;G&&ue(G)}function A(G){const{onFocus:q,showOnFocus:xe}=e,{nTriggerFormFocus:Ee}=Y;q&&ue(q,G),Ee(),xe&&Oe()}function U(G){const{onSearch:q}=e;q&&ue(q,G)}function ae(G){const{onScroll:q}=e;q&&ue(q,G)}function he(){var G;const{remote:q,multiple:xe}=e;if(q){const{value:Ee}=$;if(xe){const{valueField:Ae}=e;(G=j.value)===null||G===void 0||G.forEach(ce=>{Ee.set(ce[Ae],ce)})}else{const Ae=H.value
background: var(--n-item-color-hover);
color: var(--n-item-text-color-hover);
border: var(--n-item-border-hover);
`,bb=[I("button",`
background: var(--n-button-color-hover);
border: var(--n-button-border-hover);
color: var(--n-button-icon-color-hover);
`)],t8=w("pagination",`
display: flex;
vertical-align: middle;
font-size: var(--n-item-font-size);
flex-wrap: nowrap;
`,[w("pagination-prefix",`
display: flex;
align-items: center;
margin: var(--n-prefix-margin);
`),w("pagination-suffix",`
display: flex;
align-items: center;
margin: var(--n-suffix-margin);
`),O("> *:not(:first-child)",`
margin: var(--n-item-margin);
`),w("select",`
width: var(--n-select-width);
`),O("&.transition-disabled",[w("pagination-item","transition: none!important;")]),w("pagination-quick-jumper",`
white-space: nowrap;
display: flex;
color: var(--n-jumper-text-color);
transition: color .3s var(--n-bezier);
align-items: center;
font-size: var(--n-jumper-font-size);
`,[w("input",`
margin: var(--n-input-margin);
width: var(--n-input-width);
`)]),w("pagination-item",`
position: relative;
cursor: pointer;
user-select: none;
-webkit-user-select: none;
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
min-width: var(--n-item-size);
height: var(--n-item-size);
padding: var(--n-item-padding);
background-color: var(--n-item-color);
color: var(--n-item-text-color);
border-radius: var(--n-item-border-radius);
border: var(--n-item-border);
fill: var(--n-button-icon-color);
transition:
color .3s var(--n-bezier),
border-color .3s var(--n-bezier),
background-color .3s var(--n-bezier),
fill .3s var(--n-bezier);
`,[I("button",`
background: var(--n-button-color);
color: var(--n-button-icon-color);
border: var(--n-button-border);
padding: 0;
`,[w("base-icon",`
font-size: var(--n-button-icon-size);
`)]),xt("disabled",[I("hover",mb,bb),O("&:hover",mb,bb),O("&:active",`
background: var(--n-item-color-pressed);
color: var(--n-item-text-color-pressed);
border: var(--n-item-border-pressed);
`,[I("button",`
background: var(--n-button-color-pressed);
border: var(--n-button-border-pressed);
color: var(--n-button-icon-color-pressed);
`)]),I("active",`
background: var(--n-item-color-active);
color: var(--n-item-text-color-active);
border: var(--n-item-border-active);
`,[O("&:hover",`
background: var(--n-item-color-active-hover);
`)])]),I("disabled",`
cursor: not-allowed;
color: var(--n-item-text-color-disabled);
`,[I("active, button",`
background-color: var(--n-item-color-disabled);
border: var(--n-item-border-disabled);
`)])]),I("disabled",`
cursor: not-allowed;
`,[w("pagination-quick-jumper",`
color: var(--n-jumper-text-color-disabled);
`)]),I("simple",`
display: flex;
align-items: center;
flex-wrap: nowrap;
`,[w("pagination-quick-jumper",[w("input",`
margin: 0;
`)])])]),Aw=Object.assign(Object.assign({},ye.props),{simple:Boolean,page:Number,defaultPage:{type:Number,default:1},itemCount:Number,pageCount:Number,defaultPageCount:{type:Number,default:1},showSizePicker:Boolean,pageSize:Number,defaultPageSize:Number,pageSizes:{type:Array,default(){return[10]}},showQuickJumper:Boolean,size:{type:String,default:"medium"},disabled:Boolean,pageSlot:{type:Number,default:9},selectProps:Object,prev:Function,next:Function,goto:Function,prefix:Function,suffix:Function,label:Function,displayOrder:{type:Array,default:["pages","size-picker","quick-jumper"]},to:Kt.propTo,showQuickJumpDropdown:{type:Boolean,default:!0},"onUpdate:page":[Function,Array],onUpdatePage:[Function,Array],"onUpdate:pageSize":[Function,Array],onUpdatePageSize:[Function,Array],onPageSizeChange:[Function,Array],onChange:[Function,Array]}),Bw=re({name:"Pagination",props:Aw,setup(e){const{mergedComponentPropsRef:t,mergedClsPrefixRef:r,inlineThemeDisabled:n,mergedRtlRef:o}=Ne(e),i=ye("Pagination","-pagination",t8,Fw,e,r),{localeRef:a}=mr("Pagination"),l=D(null),s=D(e.defaultPage),d=D(Ew(e)),u=$t(ve(e,"page"),s),f=$t(ve(e,"pageSize"),d),h=P(()=>{const{itemCount:V}=e;if(V!==void 0)return Math.max(1,Math.ceil(V/f.value));const{pageCount:Te}=e;return Te!==void 0?Math.max(Te,1):1}),g=D("");Et(()=>{e.simple,g.value=String(u.value)});const v=D(!1),b=D(!1),m=D(!1),p=D(!1),x=()=>{e.disabled||(v.value=!0,H())},S=()=>{e.disabled||(v.value=!1,H())},y=()=>{b.value=!0,H()},C=()=>{b.value=!1,H()},k=V=>{Y(V)},R=P(()=>e8(u.value,h.value,e.pageSlot,e.showQuickJumpDropdown));Et(()=>{R.value.hasFastBackward?R.value.hasFastForward||(v.value=!1,m.value=!1):(b.value=!1,p.value=!1)});const $=P(()=>{const V=a.value.selectionSuffix;return e.pageSizes.map(Te=>typeof Te=="number"?{label:`${Te} / ${V}`,value:Te}:Te)}),T=P(()=>{var V,Te;return((Te=(V=t==null?void 0:t.value)===null||V===void 0?void 0:V.Pagination)===null||Te===void 0?void 0:Te.inputSize)||yf(e.size)}),z=P(()=>{var V,Te;return((Te=(V=t==null?void 0:t.value)===null||V===void 0?void 0:V.Pagination)===null||Te===void 0?void 0:Te.selectSize)||yf(e.size)}),F=P(()=>(u.value-1)*f.value),_=P(()=>{const V=u.value*f.value-1,{itemCount:Te}=e;return Te!==void 0&&V>Te-1?Te-1:V}),N=P(()=>{const{itemCount:V}=e;return V!==void 0?V:(e.pageCount||1)*f.value}),j=Wt("Pagination",o,r),H=()=>{Ot(()=>{var V;const{value:Te}=l;Te&&(Te.classList.add("transition-disabled"),(V=l.value)===null||V===void 0||V.offsetWidth,Te.classList.remove("transition-disabled"))})};function Y(V){if(V===u.value)return;const{"onUpdate:page":Te,onUpdatePage:Me,onChange:Ve,simple:E}=e;Te&&ue(Te,V),Me&&ue(Me,V),Ve&&ue(Ve,V),s.value=V,E&&(g.value=String(V))}function X(V){if(V===f.value)return;const{"onUpdate:pageSize":Te,onUpdatePageSize:Me,onPageSizeChange:Ve}=e;Te&&ue(Te,V),Me&&ue(Me,V),Ve&&ue(Ve,V),d.value=V,h.value<u.value&&Y(h.value)}function le(){if(e.disabled)return;const V=Math.min(u.value+1,h.value);Y(V)}function ke(){if(e.disabled)return;const V=Math.max(u.value-1,1);Y(V)}function be(){if(e.disabled)return;const V=Math.min(R.value.fastForwardTo,h.value);Y(V)}function Q(){if(e.disabled)return;const V=Math.max(R.value.fastBackwardTo,1);Y(V)}function L(V){X(V)}function A(){const V=parseInt(g.value);Number.isNaN(V)||(Y(Math.max(1,Math.min(V,h.value))),e.simple||(g.value=""))}function U(){A()}function ae(V){if(!e.disabled)switch(V.type){case"page":Y(V.label);break;case"fast-backward":Q();break;case"fast-forward":be();break}}function he(V){g.value=V.replace(/\D+/g,"")}Et(()=>{u.value,f.value,H()});const Re=P(()=>{const{size:V}=e,{self:{buttonBorder:Te,buttonBorderHover:Me,buttonBorderPressed:Ve,buttonIconColor:E,buttonIconColorHover:W,buttonIconColorPressed:ie,itemTextColor:ge,itemTextColorHover:ne,itemTextColorPressed:ee,itemTextColorActive:me,itemTextColorDisabled:J,itemColor:oe,itemColorHover:de,itemColorPressed:Z,itemColorActive:B,itemColorActiveHover:te,itemColorDisabled:we,itemBorder:Le,itemBorderHover:Je,itemBorderPressed:rt,itemBorderActive:Be,itemBorderDisabled:We,itemBorderRadius:it,jumperTextColor:qe,jumperTextColorDisabled:a
white-space: nowrap;
display: inline-block;
vertical-align: bottom;
max-width: 100%;
`),I("line-clamp",`
display: -webkit-inline-box;
-webkit-box-orient: vertical;
`),I("cursor-pointer",`
cursor: pointer;
`)]);function Yf(e){return`${e}-ellipsis--line-clamp`}function Gf(e,t){return`${e}-ellipsis--cursor-${t}`}const cg=Object.assign(Object.assign({},ye.props),{expandTrigger:String,lineClamp:[Number,String],tooltip:{type:[Boolean,Object],default:!0}}),Dc=re({name:"Ellipsis",inheritAttrs:!1,props:cg,setup(e,{slots:t,attrs:r}){const n=s1(),o=ye("Ellipsis","-ellipsis",qw,Hw,e,n),i=D(null),a=D(null),l=D(null),s=D(!1),d=P(()=>{const{lineClamp:m}=e,{value:p}=s;return m!==void 0?{textOverflow:"","-webkit-line-clamp":p?"":m}:{textOverflow:p?"":"ellipsis","-webkit-line-clamp":""}});function u(){let m=!1;const{value:p}=s;if(p)return!0;const{value:x}=i;if(x){const{lineClamp:S}=e;if(g(x),S!==void 0)m=x.scrollHeight<=x.offsetHeight;else{const{value:y}=a;y&&(m=y.getBoundingClientRect().width<=x.getBoundingClientRect().width)}v(x,m)}return m}const f=P(()=>e.expandTrigger==="click"?()=>{var m;const{value:p}=s;p&&((m=l.value)===null||m===void 0||m.setShow(!1)),s.value=!p}:void 0);fc(()=>{var m;e.tooltip&&((m=l.value)===null||m===void 0||m.setShow(!1))});const h=()=>c("span",Object.assign({},Hr(r,{class:[`${n.value}-ellipsis`,e.lineClamp!==void 0?Yf(n.value):void 0,e.expandTrigger==="click"?Gf(n.value,"pointer"):void 0],style:d.value}),{ref:"triggerRef",onClick:f.value,onMouseenter:e.expandTrigger==="click"?u:void 0}),e.lineClamp?t:c("span",{ref:"triggerInnerRef"},t));function g(m){if(!m)return;const p=d.value,x=Yf(n.value);e.lineClamp!==void 0?b(m,x,"add"):b(m,x,"remove");for(const S in p)m.style[S]!==p[S]&&(m.style[S]=p[S])}function v(m,p){const x=Gf(n.value,"pointer");e.expandTrigger==="click"&&!p?b(m,x,"add"):b(m,x,"remove")}function b(m,p,x){x==="add"?m.classList.contains(p)||m.classList.add(p):m.classList.contains(p)&&m.classList.remove(p)}return{mergedTheme:o,triggerRef:i,triggerInnerRef:a,tooltipRef:l,handleClick:f,renderTrigger:h,getTooltipDisabled:u}},render(){var e;const{tooltip:t,renderTrigger:r,$slots:n}=this;if(t){const{mergedTheme:o}=this;return c(Fc,Object.assign({ref:"tooltipRef",placement:"top"},t,{getDisabled:this.getTooltipDisabled,theme:o.peers.Tooltip,themeOverrides:o.peerOverrides.Tooltip}),{trigger:r,default:(e=n.tooltip)!==null&&e!==void 0?e:n.default})}else return r()}}),Yw=re({name:"PerformantEllipsis",props:cg,inheritAttrs:!1,setup(e,{attrs:t,slots:r}){const n=D(!1),o=s1();return Fn("-ellipsis",qw,o),{mouseEntered:n,renderTrigger:()=>{const{lineClamp:a}=e,l=o.value;return c("span",Object.assign({},Hr(t,{class:[`${l}-ellipsis`,a!==void 0?Yf(l):void 0,e.expandTrigger==="click"?Gf(l,"pointer"):void 0],style:a===void 0?{textOverflow:"ellipsis"}:{"-webkit-line-clamp":a}}),{onMouseenter:()=>{n.value=!0}}),a?r:c("span",null,r))}}},render(){return this.mouseEntered?c(Dc,Hr({},this.$attrs,this.$props),this.$slots):this.renderTrigger()}}),s8=re({name:"DataTableRenderSorter",props:{render:{type:Function,required:!0},order:{type:[String,Boolean],default:!1}},render(){const{render:e,order:t}=this;return e({order:t})}}),Gw=Object.assign(Object.assign({},ye.props),{onUnstableColumnResize:Function,pagination:{type:[Object,Boolean],default:!1},paginateSinglePage:{type:Boolean,default:!0},minHeight:[Number,String],maxHeight:[Number,String],columns:{type:Array,default:()=>[]},rowClassName:[String,Function],rowProps:Function,rowKey:Function,summary:[Function],data:{type:Array,default:()=>[]},loading:Boolean,bordered:{type:Boolean,default:void 0},bottomBordered:{type:Boolean,default:void 0},striped:Boolean,scrollX:[Number,String],defaultCheckedRowKeys:{type:Array,default:()=>[]},checkedRowKeys:Array,singleLine:{type:Boolean,default:!0},singleColumn:Boolean,size:{type:String,default:"medium"},remote:Boolean,defaultExpandedRowKeys:{type:Array,default:[]},defaultExpandAll:Boolean,expandedRowKeys:Array,stickyExpandedRows:Boolean,virtualScroll:Boolean,tableLayout:{type:String,default:"auto"},allowCheckingNotLoaded:Boolean,cascade:{type:Boolean,default:!0},childrenKey:{type:String,default:"children"},indent:{type:Number,default:16},flexHeight:Boolean,summaryPlacement:{type:String,default:"bottom"},paginationBehaviorOnFilter:{type:String,d
line-height: var(--n-label-line-height);
outline: none;
position: relative;
user-select: none;
-webkit-user-select: none;
display: inline-flex;
align-items: flex-start;
flex-wrap: nowrap;
font-size: var(--n-font-size);
word-break: break-word;
`,[I("checked",[M("dot",`
background-color: var(--n-color-active);
`)]),M("dot-wrapper",`
position: relative;
flex-shrink: 0;
flex-grow: 0;
width: var(--n-radio-size);
`),w("radio-input",`
position: absolute;
border: 0;
border-radius: inherit;
left: 0;
right: 0;
top: 0;
bottom: 0;
opacity: 0;
z-index: 1;
cursor: pointer;
`),M("dot",`
position: absolute;
top: 50%;
left: 0;
transform: translateY(-50%);
height: var(--n-radio-size);
width: var(--n-radio-size);
background: var(--n-color);
box-shadow: var(--n-box-shadow);
border-radius: 50%;
transition:
background-color .3s var(--n-bezier),
box-shadow .3s var(--n-bezier);
`,[O("&::before",`
content: "";
opacity: 0;
position: absolute;
left: 4px;
top: 4px;
height: calc(100% - 8px);
width: calc(100% - 8px);
border-radius: 50%;
transform: scale(.8);
background: var(--n-dot-color-active);
transition:
opacity .3s var(--n-bezier),
background-color .3s var(--n-bezier),
transform .3s var(--n-bezier);
`),I("checked",{boxShadow:"var(--n-box-shadow-active)"},[O("&::before",`
opacity: 1;
transform: scale(1);
`)])]),M("label",`
color: var(--n-text-color);
padding: var(--n-label-padding);
font-weight: var(--n-label-font-weight);
display: inline-block;
transition: color .3s var(--n-bezier);
`),xt("disabled",`
cursor: pointer;
`,[O("&:hover",[M("dot",{boxShadow:"var(--n-box-shadow-hover)"})]),I("focus",[O("&:not(:active)",[M("dot",{boxShadow:"var(--n-box-shadow-focus)"})])])]),I("disabled",`
cursor: not-allowed;
`,[M("dot",{boxShadow:"var(--n-box-shadow-disabled)",backgroundColor:"var(--n-color-disabled)"},[O("&::before",{backgroundColor:"var(--n-dot-color-disabled)"}),I("checked",`
opacity: 1;
`)]),M("label",{color:"var(--n-text-color-disabled)"}),w("radio-input",`
cursor: not-allowed;
`)])]),Qw=Object.assign(Object.assign({},ye.props),ug),fg=re({name:"Radio",props:Qw,setup(e){const t=Zw(e),r=ye("Radio","-radio",u8,lg,e,t.mergedClsPrefix),n=P(()=>{const{mergedSize:{value:d}}=t,{common:{cubicBezierEaseInOut:u},self:{boxShadow:f,boxShadowActive:h,boxShadowDisabled:g,boxShadowFocus:v,boxShadowHover:b,color:m,colorDisabled:p,colorActive:x,textColor:S,textColorDisabled:y,dotColorActive:C,dotColorDisabled:k,labelPadding:R,labelLineHeight:$,labelFontWeight:T,[Ce("fontSize",d)]:z,[Ce("radioSize",d)]:F}}=r.value;return{"--n-bezier":u,"--n-label-line-height":$,"--n-label-font-weight":T,"--n-box-shadow":f,"--n-box-shadow-active":h,"--n-box-shadow-disabled":g,"--n-box-shadow-focus":v,"--n-box-shadow-hover":b,"--n-color":m,"--n-color-active":x,"--n-color-disabled":p,"--n-dot-color-active":C,"--n-dot-color-disabled":k,"--n-font-size":z,"--n-radio-size":F,"--n-text-color":S,"--n-text-color-disabled":y,"--n-label-padding":R}}),{inlineThemeDisabled:o,mergedClsPrefixRef:i,mergedRtlRef:a}=Ne(e),l=Wt("Radio",a,i),s=o?Qe("radio",P(()=>t.mergedSize.value[0]),n,e):void 0;return Object.assign(t,{rtlEnabled:l,cssVars:o?void 0:n,themeClass:s==null?void 0:s.themeClass,onRender:s==null?void 0:s.onRender})},render(){const{$slots:e,mergedClsPrefix:t,onRender:r,label:n}=this;return r==null||r(),c("label",{class:[`${t}-radio`,this.themeClass,this.rtlEnabled&&`${t}-radio--rtl`,this.mergedDisabled&&`${t}-radio--disabled`,this.renderSafeChecked&&`${t}-radio--checked`,this.focus&&`${t}-radio--focus`],style:this.cssVars},c("input",{ref:"inputRef",type:"radio",class:`${t}-radio-input`,value:this.value,name:this.mergedName,checked:this.renderSafeChecked,disabled:this.mergedDisabled,onChange:this.handleRadioInputChange,onFocus:this.handleRadioInputFocus,onBlur:this.handleRadioInputBlur}),c("div",{class:`${t}-radio__dot-wrapper`}," ",c("div",{class:[`${t}-radio__dot`,this.renderSafeChecked&&`${t}-radio__dot--checked`]})),Tt(e.default,o=>!o&&!n?null:c("div",{ref:"labelRef",class:`${t}-radio__label`},o||n)))}}),f8=w("radio-group",`
display: inline-block;
font-size: var(--n-font-size);
`,[M("splitor",`
display: inline-block;
vertical-align: bottom;
width: 1px;
transition:
background-color .3s var(--n-bezier),
opacity .3s var(--n-bezier);
background: var(--n-button-border-color);
`,[I("checked",{backgroundColor:"var(--n-button-border-color-active)"}),I("disabled",{opacity:"var(--n-opacity-disabled)"})]),I("button-group",`
white-space: nowrap;
height: var(--n-height);
line-height: var(--n-height);
`,[w("radio-button",{height:"var(--n-height)",lineHeight:"var(--n-height)"}),M("splitor",{height:"var(--n-height)"})]),w("radio-button",`
vertical-align: bottom;
outline: none;
position: relative;
user-select: none;
-webkit-user-select: none;
display: inline-block;
box-sizing: border-box;
padding-left: 14px;
padding-right: 14px;
white-space: nowrap;
transition:
background-color .3s var(--n-bezier),
opacity .3s var(--n-bezier),
border-color .3s var(--n-bezier),
color .3s var(--n-bezier);
background: var(--n-button-color);
color: var(--n-button-text-color);
border-top: 1px solid var(--n-button-border-color);
border-bottom: 1px solid var(--n-button-border-color);
`,[w("radio-input",`
pointer-events: none;
position: absolute;
border: 0;
border-radius: inherit;
left: 0;
right: 0;
top: 0;
bottom: 0;
opacity: 0;
z-index: 1;
`),M("state-border",`
z-index: 1;
pointer-events: none;
position: absolute;
box-shadow: var(--n-button-box-shadow);
transition: box-shadow .3s var(--n-bezier);
left: -1px;
bottom: -1px;
right: -1px;
top: -1px;
`),O("&:first-child",`
border-top-left-radius: var(--n-button-border-radius);
border-bottom-left-radius: var(--n-button-border-radius);
border-left: 1px solid var(--n-button-border-color);
`,[M("state-border",`
border-top-left-radius: var(--n-button-border-radius);
border-bottom-left-radius: var(--n-button-border-radius);
`)]),O("&:last-child",`
border-top-right-radius: var(--n-button-border-radius);
border-bottom-right-radius: var(--n-button-border-radius);
border-right: 1px solid var(--n-button-border-color);
`,[M("state-border",`
border-top-right-radius: var(--n-button-border-radius);
border-bottom-right-radius: var(--n-button-border-radius);
`)]),xt("disabled",`
cursor: pointer;
`,[O("&:hover",[M("state-border",`
transition: box-shadow .3s var(--n-bezier);
box-shadow: var(--n-button-box-shadow-hover);
`),xt("checked",{color:"var(--n-button-text-color-hover)"})]),I("focus",[O("&:not(:active)",[M("state-border",{boxShadow:"var(--n-button-box-shadow-focus)"})])])]),I("checked",`
background: var(--n-button-color-active);
color: var(--n-button-text-color-active);
border-color: var(--n-button-border-color-active);
`),I("disabled",`
cursor: not-allowed;
opacity: var(--n-opacity-disabled);
`)])]);function h8(e,t,r){var n;const o=[];let i=!1;for(let a=0;a<e.length;++a){const l=e[a],s=(n=l.type)===null||n===void 0?void 0:n.name;s==="RadioButton"&&(i=!0);const d=l.props;if(s!=="RadioButton"){o.push(l);continue}if(a===0)o.push(l);else{const u=o[o.length-1].props,f=t===u.value,h=u.disabled,g=t===d.value,v=d.disabled,b=(f?2:0)+(h?0:1),m=(g?2:0)+(v?0:1),p={[`${r}-radio-group__splitor--disabled`]:h,[`${r}-radio-group__splitor--checked`]:f},x={[`${r}-radio-group__splitor--disabled`]:v,[`${r}-radio-group__splitor--checked`]:g},S=b<m?x:p;o.push(c("div",{class:[`${r}-radio-group__splitor`,S]}),l)}}return{children:o,isButtonGroup:i}}const Jw=Object.assign(Object.assign({},ye.props),{name:String,value:[String,Number,Boolean],defaultValue:{type:[String,Number,Boolean],default:null},size:String,disabled:{type:Boolean,default:void 0},"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array]}),eS=re({name:"RadioGroup",props:Jw,setup(e){const t=D(null),{mergedSizeRef:r,mergedDisabledRef:n,nTriggerFormChange:o,nTriggerFormInput:i,nTriggerFormBlur:a,nTriggerFormFocus:l}=Rr(e),{mergedClsPrefixRef:s,inlineThemeDisabled:d,mergedRtlRef:u}=Ne(e),f=ye("Radio","-radio-group",f8,lg,e,s),h=D(e.defaultValue),g=ve(e,"value"),v=$t(g,h);function b(C){const{onUpdateValue:k,"onUpdate:value":R}=e;k&&ue(k,C),R&&ue(R,C),h.value=C,o(),i()}function m(C){const{value:k}=t;k&&(k.contains(C.relatedTarget)||l())}function p(C){const{value:k}=t;k&&(k.contains(C.relatedTarget)||a())}ot(Xw,{mergedClsPrefixRef:s,nameRef:ve(e,"name"),valueRef:v,disabledRef:n,mergedSizeRef:r,doUpdateValue:b});const x=Wt("Radio",u,s),S=P(()=>{const{value:C}=r,{common:{cubicBezierEaseInOut:k},self:{buttonBorderColor:R,buttonBorderColorActive:$,buttonBorderRadius:T,buttonBoxShadow:z,buttonBoxShadowFocus:F,buttonBoxShadowHover:_,buttonColor:N,buttonColorActive:j,buttonTextColor:H,buttonTextColorActive:Y,buttonTextColorHover:X,opacityDisabled:le,[Ce("buttonHeight",C)]:ke,[Ce("fontSize",C)]:be}}=f.value;return{"--n-font-size":be,"--n-bezier":k,"--n-button-border-color":R,"--n-button-border-color-active":$,"--n-button-border-radius":T,"--n-button-box-shadow":z,"--n-button-box-shadow-focus":F,"--n-button-box-shadow-hover":_,"--n-button-color":N,"--n-button-color-active":j,"--n-button-text-color":H,"--n-button-text-color-hover":X,"--n-button-text-color-active":Y,"--n-height":ke,"--n-opacity-disabled":le}}),y=d?Qe("radio-group",P(()=>r.value[0]),S,e):void 0;return{selfElRef:t,rtlEnabled:x,mergedClsPrefix:s,mergedValue:v,handleFocusout:p,handleFocusin:m,cssVars:d?void 0:S,themeClass:y==null?void 0:y.themeClass,onRender:y==null?void 0:y.onRender}},render(){var e;const{mergedValue:t,mergedClsPrefix:r,handleFocusin:n,handleFocusout:o}=this,{children:i,isButtonGroup:a}=h8(zn(il(this)),t,r);return(e=this.onRender)===null||e===void 0||e.call(this),c("div",{onFocusin:n,onFocusout:o,ref:"selfElRef",class:[`${r}-radio-group`,this.rtlEnabled&&`${r}-radio-group--rtl`,this.themeClass,a&&`${r}-radio-group--button-group`],style:this.cssVars},i)}}),v8=ug,g8=re({name:"RadioButton",props:ug,setup:Zw,render(){const{mergedClsPrefix:e}=this;return c("label",{class:[`${e}-radio-button`,this.mergedDisabled&&`${e}-radio-button--disabled`,this.renderSafeChecked&&`${e}-radio-button--checked`,this.focus&&[`${e}-radio-button--focus`]]},c("input",{ref:"inputRef",type:"radio",class:`${e}-radio-input`,value:this.value,name:this.mergedName,checked:this.renderSafeChecked,disabled:this.mergedDisabled,onChange:this.handleRadioInputChange,onFocus:this.handleRadioInputFocus,onBlur:this.handleRadioInputBlur}),c("div",{class:`${e}-radio-button__state-border`}),Tt(this.$slots.default,t=>!t&&!this.label?null:c("div",{ref:"labelRef",class:`${e}-radio__label`},t||this.label)))}}),tS=40,rS=40;function xb(e){if(e.type==="selection")return e.width===void 0?tS:jt(e.width);if(e.type==="expand")return e.width===void 0?rS:jt(e.width);if(!("children"in e))return typeof e.width=="string"?jt(e.width):e.width}function p8(e){var t,r;if(e.type==="selection")return zt((t=e.width)!==null&&t!==void 0?t:tS);if(e.type==="expand")return
`)}const k8=re({name:"DataTableFilterMenu",props:{column:{type:Object,required:!0},radioGroupName:{type:String,required:!0},multiple:{type:Boolean,required:!0},value:{type:[Array,String,Number],default:null},options:{type:Array,required:!0},onConfirm:{type:Function,required:!0},onClear:{type:Function,required:!0},onChange:{type:Function,required:!0}},setup(e){const{mergedClsPrefixRef:t,mergedRtlRef:r}=Ne(e),n=Wt("DataTable",r,t),{mergedClsPrefixRef:o,mergedThemeRef:i,localeRef:a}=De(ro),l=D(e.value),s=P(()=>{const{value:v}=l;return Array.isArray(v)?v:null}),d=P(()=>{const{value:v}=l;return Du(e.column)?Array.isArray(v)&&v.length&&v[0]||null:Array.isArray(v)?null:v});function u(v){e.onChange(v)}function f(v){e.multiple&&Array.isArray(v)?l.value=v:Du(e.column)&&!Array.isArray(v)?l.value=[v]:l.value=v}function h(){u(l.value),e.onConfirm()}function g(){e.multiple||Du(e.column)?u([]):u(null),e.onClear()}return{mergedClsPrefix:o,rtlEnabled:n,mergedTheme:i,locale:a,checkboxGroupValue:s,radioGroupValue:d,handleChange:f,handleConfirmClick:h,handleClearClick:g}},render(){const{mergedTheme:e,locale:t,mergedClsPrefix:r}=this;return c("div",{class:[`${r}-data-table-filter-menu`,this.rtlEnabled&&`${r}-data-table-filter-menu--rtl`]},c(sr,null,{default:()=>{const{checkboxGroupValue:n,handleChange:o}=this;return this.multiple?c(lw,{value:n,class:`${r}-data-table-filter-menu__group`,onUpdateValue:o},{default:()=>this.options.map(i=>c(qo,{key:i.value,theme:e.peers.Checkbox,themeOverrides:e.peerOverrides.Checkbox,value:i.value},{default:()=>i.label}))}):c(eS,{name:this.radioGroupName,class:`${r}-data-table-filter-menu__group`,value:this.radioGroupValue,onUpdateValue:this.handleChange},{default:()=>this.options.map(i=>c(fg,{key:i.value,value:i.value,theme:e.peers.Radio,themeOverrides:e.peerOverrides.Radio},{default:()=>i.label}))})}}),c("div",{class:`${r}-data-table-filter-menu__action`},c(Dt,{size:"tiny",theme:e.peers.Button,themeOverrides:e.peerOverrides.Button,onClick:this.handleClearClick},{default:()=>t.clear}),c(Dt,{theme:e.peers.Button,themeOverrides:e.peerOverrides.Button,type:"primary",size:"tiny",onClick:this.handleConfirmClick},{default:()=>t.confirm})))}});function R8(e,t,r){const n=Object.assign({},e);return n[t]=r,n}const P8=re({name:"DataTableFilterButton",props:{column:{type:Object,required:!0},options:{type:Array,default:()=>[]}},setup(e){const{mergedComponentPropsRef:t}=Ne(),{mergedThemeRef:r,mergedClsPrefixRef:n,mergedFilterStateRef:o,filterMenuCssVarsRef:i,paginationBehaviorOnFilterRef:a,doUpdatePage:l,doUpdateFilters:s}=De(ro),d=D(!1),u=o,f=P(()=>e.column.filterMultiple!==!1),h=P(()=>{const x=u.value[e.column.key];if(x===void 0){const{value:S}=f;return S?[]:null}return x}),g=P(()=>{const{value:x}=h;return Array.isArray(x)?x.length>0:x!==null}),v=P(()=>{var x,S;return((S=(x=t==null?void 0:t.value)===null||x===void 0?void 0:x.DataTable)===null||S===void 0?void 0:S.renderFilter)||e.column.renderFilter});function b(x){const S=R8(u.value,e.column.key,x);s(S,e.column),a.value==="first"&&l(1)}function m(){d.value=!1}function p(){d.value=!1}return{mergedTheme:r,mergedClsPrefix:n,active:g,showPopover:d,mergedRenderFilter:v,filterMultiple:f,mergedFilterValue:h,filterMenuCssVars:i,handleFilterChange:b,handleFilterMenuConfirm:p,handleFilterMenuCancel:m}},render(){const{mergedTheme:e,mergedClsPrefix:t,handleFilterMenuCancel:r}=this;return c(ya,{show:this.showPopover,onUpdateShow:n=>this.showPopover=n,trigger:"click",theme:e.peers.Popover,themeOverrides:e.peerOverrides.Popover,placement:"bottom",style:{padding:0}},{trigger:()=>{const{mergedRenderFilter:n}=this;if(n)return c(c8,{"data-data-table-filter":!0,render:n,active:this.active,show:this.showPopover});const{renderFilterIcon:o}=this.column;return c("div",{"data-data-table-filter":!0,class:[`${t}-data-table-filter`,{[`${t}-data-table-filter--active`]:this.active,[`${t}-data-table-filter--show`]:this.showPopover}]},o?o({active:this.active,show:this.showPopover}):c(ut,{clsPrefix:t},{default:()=>c(YD,null)}))},default:()=>{const{renderFilterMenu:n}=this.column;return n?n({hide:r}):c(
height: 1em;
width: 1em;
line-height: 1em;
text-align: center;
display: inline-block;
position: relative;
fill: currentColor;
transform: translateZ(0);
`,[I("color-transition",{transition:"color .3s var(--n-bezier)"}),I("depth",{color:"var(--n-color)"},[O("svg",{opacity:"var(--n-opacity)",transition:"opacity .3s var(--n-bezier)"})]),O("svg",{height:"1em",width:"1em"})]),lS=Object.assign(Object.assign({},ye.props),{depth:[String,Number],size:[Number,String],color:String,component:Object}),sS=re({_n_icon__:!0,name:"Icon",inheritAttrs:!1,props:lS,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:r}=Ne(e),n=ye("Icon","-icon",O8,$8,e,t),o=P(()=>{const{depth:a}=e,{common:{cubicBezierEaseInOut:l},self:s}=n.value;if(a!==void 0){const{color:d,[`opacity${a}Depth`]:u}=s;return{"--n-bezier":l,"--n-color":d,"--n-opacity":u}}return{"--n-bezier":l,"--n-color":"","--n-opacity":""}}),i=r?Qe("icon",P(()=>`${e.depth||"d"}`),o,e):void 0;return{mergedClsPrefix:t,mergedStyle:P(()=>{const{size:a,color:l}=e;return{fontSize:zt(a),color:l}}),cssVars:r?void 0:o,themeClass:i==null?void 0:i.themeClass,onRender:i==null?void 0:i.onRender}},render(){var e;const{$parent:t,depth:r,mergedClsPrefix:n,component:o,onRender:i,themeClass:a}=this;return!((e=t==null?void 0:t.$options)===null||e===void 0)&&e._n_icon__&&Qr("icon","don't wrap `n-icon` inside `n-icon`"),i==null||i(),c("i",Hr(this.$attrs,{role:"img",class:[`${n}-icon`,a,{[`${n}-icon--depth`]:r,[`${n}-icon--color-transition`]:r!==void 0}],style:[this.cssVars,this.mergedStyle]}),o?c(o):this.$slots)}}),hg="n-dropdown-menu",Ec="n-dropdown",Sb="n-dropdown-option";function Xf(e,t){return e.type==="submenu"||e.type===void 0&&e[t]!==void 0}function _8(e){return e.type==="group"}function dS(e){return e.type==="divider"}function M8(e){return e.type==="render"}const cS=re({name:"DropdownOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0},parentKey:{type:[String,Number],default:null},placement:{type:String,default:"right-start"},props:Object,scrollable:Boolean},setup(e){const t=De(Ec),{hoverKeyRef:r,keyboardKeyRef:n,lastToggledSubmenuKeyRef:o,pendingKeyPathRef:i,activeKeyPathRef:a,animatedRef:l,mergedShowRef:s,renderLabelRef:d,renderIconRef:u,labelFieldRef:f,childrenFieldRef:h,renderOptionRef:g,nodePropsRef:v,menuPropsRef:b}=t,m=De(Sb,null),p=De(hg),x=De(al),S=P(()=>e.tmNode.rawNode),y=P(()=>{const{value:X}=h;return Xf(e.tmNode.rawNode,X)}),C=P(()=>{const{disabled:X}=e.tmNode;return X}),k=P(()=>{if(!y.value)return!1;const{key:X,disabled:le}=e.tmNode;if(le)return!1;const{value:ke}=r,{value:be}=n,{value:Q}=o,{value:L}=i;return ke!==null?L.includes(X):be!==null?L.includes(X)&&L[L.length-1]!==X:Q!==null?L.includes(X):!1}),R=P(()=>n.value===null&&!l.value),$=U3(k,300,R),T=P(()=>!!(m!=null&&m.enteringSubmenuRef.value)),z=D(!1);ot(Sb,{enteringSubmenuRef:z});function F(){z.value=!0}function _(){z.value=!1}function N(){const{parentKey:X,tmNode:le}=e;le.disabled||s.value&&(o.value=X,n.value=null,r.value=le.key)}function j(){const{tmNode:X}=e;X.disabled||s.value&&r.value!==X.key&&N()}function H(X){if(e.tmNode.disabled||!s.value)return;const{relatedTarget:le}=X;le&&!pr({target:le},"dropdownOption")&&!pr({target:le},"scrollbarRail")&&(r.value=null)}function Y(){const{value:X}=y,{tmNode:le}=e;s.value&&!X&&!le.disabled&&(t.doSelect(le.key,le.rawNode),t.doUpdateShow(!1))}return{labelField:f,renderLabel:d,renderIcon:u,siblingHasIcon:p.showIconRef,siblingHasSubmenu:p.hasSubmenuRef,menuProps:b,popoverBody:x,animated:l,mergedShowSubmenu:P(()=>$.value&&!T.value),rawNode:S,hasSubmenu:y,pending:ct(()=>{const{value:X}=i,{key:le}=e.tmNode;return X.includes(le)}),childActive:ct(()=>{const{value:X}=a,{key:le}=e.tmNode,ke=X.findIndex(be=>le===be);return ke===-1?!1:ke<X.length-1}),active:ct(()=>{const{value:X}=a,{key:le}=e.tmNode,ke=X.findIndex(be=>le===be);return ke===-1?!1:ke===X.length-1}),mergedDisabled:C,renderOption:g,nodeProps:v,handleClick:Y,handleMouseMove:j,handleMouseEnter:N,handleMouseLeave:H,handleSubmenuBeforeEnter:F,handleSubmenuAfterEnter:_}},render(){var e,t;const{animated:r,rawNode:n,mergedShowSubmenu:o,clsPrefix:i,siblingHasIcon:a,siblingHasSubmenu:l,renderLabel:s,renderIcon:d,renderOption:u,nodeProps:f,props:h,scrollable:g}=this;le
transform-origin: var(--v-transform-origin);
background-color: var(--n-color);
border-radius: var(--n-border-radius);
box-shadow: var(--n-box-shadow);
position: relative;
transition:
background-color .3s var(--n-bezier),
box-shadow .3s var(--n-bezier);
`,[Ar(),w("dropdown-option",`
position: relative;
`,[O("a",`
text-decoration: none;
color: inherit;
outline: none;
`,[O("&::before",`
content: "";
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
`)]),w("dropdown-option-body",`
display: flex;
cursor: pointer;
position: relative;
height: var(--n-option-height);
line-height: var(--n-option-height);
font-size: var(--n-font-size);
color: var(--n-option-text-color);
transition: color .3s var(--n-bezier);
`,[O("&::before",`
content: "";
position: absolute;
top: 0;
bottom: 0;
left: 4px;
right: 4px;
transition: background-color .3s var(--n-bezier);
border-radius: var(--n-border-radius);
`),xt("disabled",[I("pending",`
color: var(--n-option-text-color-hover);
`,[M("prefix, suffix",`
color: var(--n-option-text-color-hover);
`),O("&::before","background-color: var(--n-option-color-hover);")]),I("active",`
color: var(--n-option-text-color-active);
`,[M("prefix, suffix",`
color: var(--n-option-text-color-active);
`),O("&::before","background-color: var(--n-option-color-active);")]),I("child-active",`
color: var(--n-option-text-color-child-active);
`,[M("prefix, suffix",`
color: var(--n-option-text-color-child-active);
`)])]),I("disabled",`
cursor: not-allowed;
opacity: var(--n-option-opacity-disabled);
`),I("group",`
font-size: calc(var(--n-font-size) - 1px);
color: var(--n-group-header-text-color);
`,[M("prefix",`
width: calc(var(--n-option-prefix-width) / 2);
`,[I("show-icon",`
width: calc(var(--n-option-icon-prefix-width) / 2);
`)])]),M("prefix",`
width: var(--n-option-prefix-width);
display: flex;
justify-content: center;
align-items: center;
color: var(--n-prefix-color);
transition: color .3s var(--n-bezier);
z-index: 1;
`,[I("show-icon",`
width: var(--n-option-icon-prefix-width);
`),w("icon",`
font-size: var(--n-option-icon-size);
`)]),M("label",`
white-space: nowrap;
flex: 1;
z-index: 1;
`),M("suffix",`
box-sizing: border-box;
flex-grow: 0;
flex-shrink: 0;
display: flex;
justify-content: flex-end;
align-items: center;
min-width: var(--n-option-suffix-width);
padding: 0 8px;
transition: color .3s var(--n-bezier);
color: var(--n-suffix-color);
z-index: 1;
`,[I("has-submenu",`
width: var(--n-option-icon-suffix-width);
`),w("icon",`
font-size: var(--n-option-icon-size);
`)]),w("dropdown-menu","pointer-events: all;")]),w("dropdown-offset-container",`
pointer-events: none;
position: absolute;
left: 0;
right: 0;
top: -4px;
bottom: -4px;
`)]),w("dropdown-divider",`
transition: background-color .3s var(--n-bezier);
background-color: var(--n-divider-color);
height: 1px;
margin: 4px 0;
`),w("dropdown-menu-wrapper",`
transform-origin: var(--v-transform-origin);
width: fit-content;
`),O(">",[w("scrollbar",`
height: inherit;
max-height: inherit;
`)]),xt("scrollable",`
padding: var(--n-padding);
`),I("scrollable",[M("content",`
padding: var(--n-padding);
`)])]),A8={animated:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},size:{type:String,default:"medium"},inverted:Boolean,placement:{type:String,default:"bottom"},onSelect:[Function,Array],options:{type:Array,default:()=>[]},menuProps:Function,showArrow:Boolean,renderLabel:Function,renderIcon:Function,renderOption:Function,nodeProps:Function,labelField:{type:String,default:"label"},keyField:{type:String,default:"key"},childrenField:{type:String,default:"children"},value:[String,Number]},B8=Object.keys(la),fS=Object.assign(Object.assign(Object.assign({},la),A8),ye.props),vg=re({name:"Dropdown",inheritAttrs:!1,props:fS,setup(e){const t=D(!1),r=$t(ve(e,"show"),t),n=P(()=>{const{keyField:_,childrenField:N}=e;return On(e.options,{getKey(j){return j[_]},getDisabled(j){return j.disabled===!0},getIgnored(j){return j.type==="divider"||j.type==="render"},getChildren(j){return j[N]}})}),o=P(()=>n.value.treeNodes),i=D(null),a=D(null),l=D(null),s=P(()=>{var _,N,j;return(j=(N=(_=i.value)!==null&&_!==void 0?_:a.value)!==null&&N!==void 0?N:l.value)!==null&&j!==void 0?j:null}),d=P(()=>n.value.getPath(s.value).keyPath),u=P(()=>n.value.getPath(e.value).keyPath),f=ct(()=>e.keyboard&&r.value);Cv({keydown:{ArrowUp:{prevent:!0,handler:C},ArrowRight:{prevent:!0,handler:y},ArrowDown:{prevent:!0,handler:k},ArrowLeft:{prevent:!0,handler:S},Enter:{prevent:!0,handler:R},Escape:x}},f);const{mergedClsPrefixRef:h,inlineThemeDisabled:g}=Ne(e),v=ye("Dropdown","-dropdown",E8,sg,e,h);ot(Ec,{labelFieldRef:ve(e,"labelField"),childrenFieldRef:ve(e,"childrenField"),renderLabelRef:ve(e,"renderLabel"),renderIconRef:ve(e,"renderIcon"),hoverKeyRef:i,keyboardKeyRef:a,lastToggledSubmenuKeyRef:l,pendingKeyPathRef:d,activeKeyPathRef:u,animatedRef:ve(e,"animated"),mergedShowRef:r,nodePropsRef:ve(e,"nodeProps"),renderOptionRef:ve(e,"renderOption"),menuPropsRef:ve(e,"menuProps"),doSelect:b,doUpdateShow:m}),ft(r,_=>{!e.animated&&!_&&p()});function b(_,N){const{onSelect:j}=e;j&&ue(j,_,N)}function m(_){const{"onUpdate:show":N,onUpdateShow:j}=e;N&&ue(N,_),j&&ue(j,_),t.value=_}function p(){i.value=null,a.value=null,l.value=null}function x(){m(!1)}function S(){T("left")}function y(){T("right")}function C(){T("up")}function k(){T("down")}function R(){const _=$();_!=null&&_.isLeaf&&r.value&&(b(_.key,_.rawNode),m(!1))}function $(){var _;const{value:N}=n,{value:j}=s;return!N||j===null?null:(_=N.getNode(j))!==null&&_!==void 0?_:null}function T(_){const{value:N}=s,{value:{getFirstAvailableNode:j}}=n;let H=null;if(N===null){const Y=j();Y!==null&&(H=Y.key)}else{const Y=$();if(Y){let X;switch(_){case"down":X=Y.getNext();break;case"up":X=Y.getPrev();break;case"right":X=Y.getChild();break;case"left":X=Y.getParent();break}X&&(H=X.key)}}H!==null&&(i.value=null,a.value=H)}const z=P(()=>{const{size:_,inverted:N}=e,{common:{cubicBezierEaseInOut:j},self:H}=v.value,{padding:Y,dividerColor:X,borderRadius:le,optionOpacityDisabled:ke,[Ce("optionIconSuffixWidth",_)]:be,[Ce("optionSuffixWidth",_)]:Q,[Ce("optionIconPrefixWidth",_)]:L,[Ce("optionPrefixWidth",_)]:A,[Ce("fontSize",_)]:U,[Ce("optionHeight",_)]:ae,[Ce("optionIconSize",_)]:he}=H,Re={"--n-bezier":j,"--n-font-size":U,"--n-padding":Y,"--n-border-radius":le,"--n-option-height":ae,"--n-option-prefix-width":A,"--n-option-icon-prefix-width":L,"--n-option-suffix-width":Q,"--n-option-icon-suffix-width":be,"--n-option-icon-size":he,"--n-divider-color":X,"--n-option-opacity-disabled":ke};return N?(Re["--n-color"]=H.colorInverted,Re["--n-option-color-hover"]=H.optionColorHoverInverted,Re["--n-option-color-active"]=H.optionColorActiveInverted,Re["--n-option-text-color"]=H.optionTextColorInverted,Re["--n-option-text-color-hover"]=H.optionTextColorHoverInverted,Re["--n-option-text-color-active"]=H.optionTextColorActiveInverted,Re["--n-option-text-color-child-active"]=H.optionTextColorChildActiveInverted,Re["--n-prefix-color"]=H.prefixColorInverted,Re["--n-suffix-color"]=H.suffixColorInverted,Re["--n-group-header-text-color"]=H.groupHeaderTextColorInverted):(Re["--n-color"]=H.color,Re["--n-option-color-hover"]=H.optionColorHover,Re["--n-opti
width: 100%;
font-size: var(--n-font-size);
display: flex;
flex-direction: column;
position: relative;
--n-merged-th-color: var(--n-th-color);
--n-merged-td-color: var(--n-td-color);
--n-merged-border-color: var(--n-border-color);
--n-merged-th-color-hover: var(--n-th-color-hover);
--n-merged-td-color-hover: var(--n-td-color-hover);
--n-merged-td-color-striped: var(--n-td-color-striped);
`,[w("data-table-wrapper",`
flex-grow: 1;
display: flex;
flex-direction: column;
`),I("flex-height",[O(">",[w("data-table-wrapper",[O(">",[w("data-table-base-table",`
display: flex;
flex-direction: column;
flex-grow: 1;
`,[O(">",[w("data-table-base-table-body","flex-basis: 0;",[O("&:last-child","flex-grow: 1;")])])])])])])]),O(">",[w("data-table-loading-wrapper",`
color: var(--n-loading-color);
font-size: var(--n-loading-size);
position: absolute;
left: 50%;
top: 50%;
transform: translateX(-50%) translateY(-50%);
transition: color .3s var(--n-bezier);
display: flex;
align-items: center;
justify-content: center;
`,[Ar({originalTransform:"translateX(-50%) translateY(-50%)"})])]),w("data-table-expand-placeholder",`
margin-right: 8px;
display: inline-block;
width: 16px;
height: 1px;
`),w("data-table-indent",`
display: inline-block;
height: 1px;
`),w("data-table-expand-trigger",`
display: inline-flex;
margin-right: 8px;
cursor: pointer;
font-size: 16px;
vertical-align: -0.2em;
position: relative;
width: 16px;
height: 16px;
color: var(--n-td-text-color);
transition: color .3s var(--n-bezier);
`,[I("expanded",[w("icon","transform: rotate(90deg);",[qr({originalTransform:"rotate(90deg)"})]),w("base-icon","transform: rotate(90deg);",[qr({originalTransform:"rotate(90deg)"})])]),w("base-loading",`
color: var(--n-loading-color);
transition: color .3s var(--n-bezier);
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
`,[qr()]),w("icon",`
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
`,[qr()]),w("base-icon",`
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
`,[qr()])]),w("data-table-thead",`
transition: background-color .3s var(--n-bezier);
background-color: var(--n-merged-th-color);
`),w("data-table-tr",`
box-sizing: border-box;
background-clip: padding-box;
transition: background-color .3s var(--n-bezier);
`,[w("data-table-expand",`
position: sticky;
left: 0;
overflow: hidden;
margin: calc(var(--n-th-padding) * -1);
padding: var(--n-th-padding);
box-sizing: border-box;
`),I("striped","background-color: var(--n-merged-td-color-striped);",[w("data-table-td","background-color: var(--n-merged-td-color-striped);")]),xt("summary",[O("&:hover","background-color: var(--n-merged-td-color-hover);",[O(">",[w("data-table-td","background-color: var(--n-merged-td-color-hover);")])])])]),w("data-table-th",`
padding: var(--n-th-padding);
position: relative;
text-align: start;
box-sizing: border-box;
background-color: var(--n-merged-th-color);
border-color: var(--n-merged-border-color);
border-bottom: 1px solid var(--n-merged-border-color);
color: var(--n-th-text-color);
transition:
border-color .3s var(--n-bezier),
color .3s var(--n-bezier),
background-color .3s var(--n-bezier);
font-weight: var(--n-th-font-weight);
`,[I("filterable",`
padding-right: 36px;
`,[I("sortable",`
padding-right: calc(var(--n-th-padding) + 36px);
`)]),Rb,I("selection",`
padding: 0;
text-align: center;
line-height: 0;
z-index: 3;
`),M("title-wrapper",`
display: flex;
align-items: center;
flex-wrap: nowrap;
max-width: 100%;
`,[M("title",`
flex: 1;
min-width: 0;
`)]),M("ellipsis",`
display: inline-block;
vertical-align: bottom;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
max-width: 100%;
`),I("hover",`
background-color: var(--n-merged-th-color-hover);
`),I("sortable",`
cursor: pointer;
`,[M("ellipsis",`
max-width: calc(100% - 18px);
`),O("&:hover",`
background-color: var(--n-merged-th-color-hover);
`)]),w("data-table-sorter",`
height: var(--n-sorter-size);
width: var(--n-sorter-size);
margin-left: 4px;
position: relative;
display: inline-flex;
align-items: center;
justify-content: center;
vertical-align: -0.2em;
color: var(--n-th-icon-color);
transition: color .3s var(--n-bezier);
`,[w("base-icon","transition: transform .3s var(--n-bezier)"),I("desc",[w("base-icon",`
transform: rotate(0deg);
`)]),I("asc",[w("base-icon",`
transform: rotate(-180deg);
`)]),I("asc, desc",`
color: var(--n-th-icon-color-active);
`)]),w("data-table-resize-button",`
width: var(--n-resizable-container-size);
position: absolute;
top: 0;
right: calc(var(--n-resizable-container-size) / 2);
bottom: 0;
cursor: col-resize;
user-select: none;
`,[O("&::after",`
width: var(--n-resizable-size);
height: 50%;
position: absolute;
top: 50%;
left: calc(var(--n-resizable-container-size) / 2);
bottom: 0;
background-color: var(--n-merged-border-color);
transform: translateY(-50%);
transition: background-color .3s var(--n-bezier);
z-index: 1;
content: '';
`),I("active",[O("&::after",`
background-color: var(--n-th-icon-color-active);
`)]),O("&:hover::after",`
background-color: var(--n-th-icon-color-active);
`)]),w("data-table-filter",`
position: absolute;
z-index: auto;
right: 0;
width: 36px;
top: 0;
bottom: 0;
cursor: pointer;
display: flex;
justify-content: center;
align-items: center;
transition:
background-color .3s var(--n-bezier),
color .3s var(--n-bezier);
font-size: var(--n-filter-size);
color: var(--n-th-icon-color);
`,[O("&:hover",`
background-color: var(--n-th-button-color-hover);
`),I("show",`
background-color: var(--n-th-button-color-hover);
`),I("active",`
background-color: var(--n-th-button-color-hover);
color: var(--n-th-icon-color-active);
`)])]),w("data-table-td",`
padding: var(--n-td-padding);
text-align: start;
box-sizing: border-box;
border: none;
background-color: var(--n-merged-td-color);
color: var(--n-td-text-color);
border-bottom: 1px solid var(--n-merged-border-color);
transition:
box-shadow .3s var(--n-bezier),
background-color .3s var(--n-bezier),
border-color .3s var(--n-bezier),
color .3s var(--n-bezier);
`,[I("expand",[w("data-table-expand-trigger",`
margin-right: 0;
`)]),I("last-row",`
border-bottom: 0 solid var(--n-merged-border-color);
`,[O("&::after",`
bottom: 0 !important;
`),O("&::before",`
bottom: 0 !important;
`)]),I("summary",`
background-color: var(--n-merged-th-color);
`),I("hover",`
background-color: var(--n-merged-td-color-hover);
`),M("ellipsis",`
display: inline-block;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
max-width: 100%;
vertical-align: bottom;
max-width: calc(100% - var(--indent-offset, -1.5) * 16px - 24px);
`),I("selection, expand",`
text-align: center;
padding: 0;
line-height: 0;
`),Rb]),w("data-table-empty",`
box-sizing: border-box;
padding: var(--n-empty-padding);
flex-grow: 1;
flex-shrink: 0;
opacity: 1;
display: flex;
align-items: center;
justify-content: center;
transition: opacity .3s var(--n-bezier);
`,[I("hide",`
opacity: 0;
`)]),M("pagination",`
margin: var(--n-pagination-margin);
display: flex;
justify-content: flex-end;
`),w("data-table-wrapper",`
position: relative;
opacity: 1;
transition: opacity .3s var(--n-bezier), border-color .3s var(--n-bezier);
border-top-left-radius: var(--n-border-radius);
border-top-right-radius: var(--n-border-radius);
line-height: var(--n-line-height);
`),I("loading",[w("data-table-wrapper",`
opacity: var(--n-opacity-loading);
pointer-events: none;
`)]),I("single-column",[w("data-table-td",`
border-bottom: 0 solid var(--n-merged-border-color);
`,[O("&::after, &::before",`
bottom: 0 !important;
`)])]),xt("single-line",[w("data-table-th",`
border-right: 1px solid var(--n-merged-border-color);
`,[I("last",`
border-right: 0 solid var(--n-merged-border-color);
`)]),w("data-table-td",`
border-right: 1px solid var(--n-merged-border-color);
`,[I("last-col",`
border-right: 0 solid var(--n-merged-border-color);
`)])]),I("bordered",[w("data-table-wrapper",`
border: 1px solid var(--n-merged-border-color);
border-bottom-left-radius: var(--n-border-radius);
border-bottom-right-radius: var(--n-border-radius);
overflow: hidden;
`)]),w("data-table-base-table",[I("transition-disabled",[w("data-table-th",[O("&::after, &::before","transition: none;")]),w("data-table-td",[O("&::after, &::before","transition: none;")])])]),I("bottom-bordered",[w("data-table-td",[I("last-row",`
border-bottom: 1px solid var(--n-merged-border-color);
`)])]),w("data-table-table",`
font-variant-numeric: tabular-nums;
width: 100%;
word-break: break-word;
transition: background-color .3s var(--n-bezier);
border-collapse: separate;
border-spacing: 0;
background-color: var(--n-merged-td-color);
`),w("data-table-base-table-header",`
border-top-left-radius: calc(var(--n-border-radius) - 1px);
border-top-right-radius: calc(var(--n-border-radius) - 1px);
z-index: 3;
overflow: scroll;
flex-shrink: 0;
transition: border-color .3s var(--n-bezier);
scrollbar-width: none;
`,[O("&::-webkit-scrollbar",`
width: 0;
height: 0;
`)]),w("data-table-check-extra",`
transition: color .3s var(--n-bezier);
color: var(--n-th-icon-color);
position: absolute;
font-size: 14px;
right: -4px;
top: 50%;
transform: translateY(-50%);
z-index: 1;
`)]),w("data-table-filter-menu",[w("scrollbar",`
max-height: 240px;
`),M("group",`
display: flex;
flex-direction: column;
padding: 12px 12px 0 12px;
`,[w("checkbox",`
margin-bottom: 12px;
margin-right: 0;
`),w("radio",`
margin-bottom: 12px;
margin-right: 0;
`)]),M("action",`
padding: var(--n-action-padding);
display: flex;
flex-wrap: nowrap;
justify-content: space-evenly;
border-top: 1px solid var(--n-action-divider-color);
`,[w("button",[O("&:not(:last-child)",`
margin: var(--n-action-button-margin);
`),O("&:last-child",`
margin-right: 0;
`)])]),w("divider",`
margin: 0 !important;
`)]),So(w("data-table",`
--n-merged-th-color: var(--n-th-color-modal);
--n-merged-td-color: var(--n-td-color-modal);
--n-merged-border-color: var(--n-border-color-modal);
--n-merged-th-color-hover: var(--n-th-color-hover-modal);
--n-merged-td-color-hover: var(--n-td-color-hover-modal);
--n-merged-td-color-striped: var(--n-td-color-striped-modal);
`)),jo(w("data-table",`
--n-merged-th-color: var(--n-th-color-popover);
--n-merged-td-color: var(--n-td-color-popover);
--n-merged-border-color: var(--n-border-color-popover);
--n-merged-th-color-hover: var(--n-th-color-hover-popover);
--n-merged-td-color-hover: var(--n-td-color-hover-popover);
--n-merged-td-color-striped: var(--n-td-color-striped-popover);
`))]);function aN(){return[I("fixed-left",`
left: 0;
position: sticky;
z-index: 2;
`,[O("&::after",`
pointer-events: none;
content: "";
width: 36px;
display: inline-block;
position: absolute;
top: 0;
bottom: -1px;
transition: box-shadow .2s var(--n-bezier);
right: -36px;
`)]),I("fixed-right",`
right: 0;
position: sticky;
z-index: 1;
`,[O("&::before",`
pointer-events: none;
content: "";
width: 36px;
display: inline-block;
position: absolute;
top: 0;
bottom: -1px;
transition: box-shadow .2s var(--n-bezier);
left: -36px;
`)])]}const lN=re({name:"DataTable",alias:["AdvancedTable"],props:Gw,setup(e,{slots:t}){const{mergedBorderedRef:r,mergedClsPrefixRef:n,inlineThemeDisabled:o,mergedRtlRef:i}=Ne(e),a=Wt("DataTable",i,n),l=P(()=>{const{bottomBordered:G}=e;return r.value?!1:G!==void 0?G:!0}),s=ye("DataTable","-data-table",iN,a8,e,n),d=D(null),u=D(null),{getResizableWidth:f,clearResizableWidth:h,doUpdateResizableWidth:g}=tN(),{rowsRef:v,colsRef:b,dataRelatedColsRef:m,hasEllipsisRef:p}=nN(e,f),x=G=>{const{fileName:q="data.csv",keepOriginalData:xe=!1}=G||{},Ee=xe?e.data:k.value,Ae=S8(e.columns,Ee),ce=new Blob([Ae],{type:"text/csv;charset=utf-8"}),_e=URL.createObjectURL(ce);zv(_e,q.endsWith(".csv")?q:`${q}.csv`),URL.revokeObjectURL(_e)},{treeMateRef:S,mergedCurrentPageRef:y,paginatedDataRef:C,rawPaginatedDataRef:k,selectionColumnRef:R,hoverKeyRef:$,mergedPaginationRef:T,mergedFilterStateRef:z,mergedSortStateRef:F,childTriggerColIndexRef:_,doUpdatePage:N,doUpdateFilters:j,onUnstableColumnResize:H,deriveNextSorter:Y,filter:X,filters:le,clearFilter:ke,clearFilters:be,clearSorter:Q,page:L,sort:A}=J8(e,{dataRelatedColsRef:m}),{doCheckAll:U,doUncheckAll:ae,doCheck:he,doUncheck:Re,headerCheckboxDisabledRef:Oe,someRowsCheckedRef:V,allRowsCheckedRef:Te,mergedCheckedRowKeySetRef:Me,mergedInderminateRowKeySetRef:Ve}=G8(e,{selectionColumnRef:R,treeMateRef:S,paginatedDataRef:C}),{stickyExpandedRowsRef:E,mergedExpandedRowKeysRef:W,renderExpandRef:ie,expandableRef:ge,doUpdateExpandedRowKeys:ne}=oN(e,S),{handleTableBodyScroll:ee,handleTableHeaderScroll:me,syncScrollState:J,setHeaderScrollLeft:oe,leftActiveFixedColKeyRef:de,leftActiveFixedChildrenColKeysRef:Z,rightActiveFixedColKeyRef:B,rightActiveFixedChildrenColKeysRef:te,leftFixedColumnsRef:we,rightFixedColumnsRef:Le,fixedColumnLeftMapRef:Je,fixedColumnRightMapRef:rt}=eN(e,{bodyWidthRef:d,mainTableInstRef:u,mergedCurrentPageRef:y}),{localeRef:Be}=mr("DataTable"),We=P(()=>e.virtualScroll||e.flexHeight||e.maxHeight!==void 0||p.value?"fixed":e.tableLayout);ot(ro,{props:e,treeMateRef:S,renderExpandIconRef:ve(e,"renderExpandIcon"),loadingKeySetRef:D(new Set),slots:t,indentRef:ve(e,"indent"),childTriggerColIndexRef:_,bodyWidthRef:d,componentId:sn(),hoverKeyRef:$,mergedClsPrefixRef:n,mergedThemeRef:s,scrollXRef:P(()=>e.scrollX),rowsRef:v,colsRef:b,paginatedDataRef:C,leftActiveFixedColKeyRef:de,leftActiveFixedChildrenColKeysRef:Z,rightActiveFixedColKeyRef:B,rightActiveFixedChildrenColKeysRef:te,leftFixedColumnsRef:we,rightFixedColumnsRef:Le,fixedColumnLeftMapRef:Je,fixedColumnRightMapRef:rt,mergedCurrentPageRef:y,someRowsCheckedRef:V,allRowsCheckedRef:Te,mergedSortStateRef:F,mergedFilterStateRef:z,loadingRef:ve(e,"loading"),rowClassNameRef:ve(e,"rowClassName"),mergedCheckedRowKeySetRef:Me,mergedExpandedRowKeysRef:W,mergedInderminateRowKeySetRef:Ve,localeRef:Be,expandableRef:ge,stickyExpandedRowsRef:E,rowKeyRef:ve(e,"rowKey"),renderExpandRef:ie,summaryRef:ve(e,"summary"),virtualScrollRef:ve(e,"virtualScroll"),rowPropsRef:ve(e,"rowProps"),stripedRef:ve(e,"striped"),checkOptionsRef:P(()=>{const{value:G}=R;return G==null?void 0:G.options}),rawPaginatedDataRef:k,filterMenuCssVarsRef:P(()=>{const{self:{actionDividerColor:G,actionPadding:q,actionButtonMargin:xe}}=s.value;return{"--n-action-padding":q,"--n-action-button-margin":xe,"--n-action-divider-color":G}}),onLoadRef:ve(e,"onLoad"),mergedTableLayoutRef:We,maxHeightRef:ve(e,"maxHeight"),minHeightRef:ve(e,"minHeight"),flexHeightRef:ve(e,"flexHeight"),headerCheckboxDisabledRef:Oe,paginationBehaviorOnFilterRef:ve(e,"paginationBehaviorOnFilter"),summaryPlacementRef:ve(e,"summaryPlacement"),scrollbarPropsRef:ve(e,"scrollbarProps"),syncScrollState:J,doUpdatePage:N,doUpdateFilters:j,getResizableWidth:f,onUnstableColumnResize:H,clearResizableWidth:h,doUpdateResizableWidth:g,deriveNextSorter:Y,doCheck:he,doUncheck:Re,doCheckAll:U,doUncheckAll:ae,doUpdateExpandedRowKeys:ne,handleTableHeaderScroll:me,handleTableBodyScroll:ee,setHeaderScrollLeft:oe,renderCell:ve(e,"renderCell")});const it={filter:X,filters:le,clearFilters:be,clearSorter:Q,page:L,sort:A,clearFilter:ke,downloadCsv:x
z-index: auto;
position: relative;
`,[w("time-picker-icon",`
color: var(--n-icon-color-override);
transition: color .3s var(--n-bezier);
`),I("disabled",[w("time-picker-icon",`
color: var(--n-icon-color-disabled-override);
`)])]),w("time-picker-panel",`
transition:
box-shadow .3s var(--n-bezier),
background-color .3s var(--n-bezier);
outline: none;
font-size: var(--n-item-font-size);
border-radius: var(--n-border-radius);
margin: 4px 0;
min-width: 104px;
overflow: hidden;
background-color: var(--n-panel-color);
box-shadow: var(--n-panel-box-shadow);
`,[Ar(),w("time-picker-actions",`
padding: var(--n-panel-action-padding);
align-items: center;
display: flex;
justify-content: space-evenly;
`),w("time-picker-cols",`
height: calc(var(--n-item-height) * 6);
display: flex;
position: relative;
transition: border-color .3s var(--n-bezier);
border-bottom: 1px solid var(--n-panel-divider-color);
`),w("time-picker-col",`
flex-grow: 1;
min-width: var(--n-item-width);
height: calc(var(--n-item-height) * 6);
flex-direction: column;
transition: box-shadow .3s var(--n-bezier);
`,[I("transition-disabled",[M("item","transition: none;",[O("&::before","transition: none;")])]),M("padding",`
height: calc(var(--n-item-height) * 5);
`),O("&:first-child","min-width: calc(var(--n-item-width) + 4px);",[M("item",[O("&::before","left: 4px;")])]),M("item",`
cursor: pointer;
height: var(--n-item-height);
display: flex;
align-items: center;
justify-content: center;
transition:
color .3s var(--n-bezier),
background-color .3s var(--n-bezier),
opacity .3s var(--n-bezier),
text-decoration-color .3s var(--n-bezier);
background: #0000;
text-decoration-color: #0000;
color: var(--n-item-text-color);
z-index: 0;
box-sizing: border-box;
padding-top: 4px;
position: relative;
`,[O("&::before",`
content: "";
transition: background-color .3s var(--n-bezier);
z-index: -1;
position: absolute;
left: 0;
right: 4px;
top: 4px;
bottom: 0;
border-radius: var(--n-item-border-radius);
`),xt("disabled",[O("&:hover::before",`
background-color: var(--n-item-color-hover);
`)]),I("active",`
color: var(--n-item-text-color-active);
`,[O("&::before",`
background-color: var(--n-item-color-hover);
`)]),I("disabled",`
opacity: var(--n-item-opacity-disabled);
cursor: not-allowed;
`)]),I("invalid",[M("item",[I("active",`
text-decoration: line-through;
text-decoration-color: var(--n-item-text-color-active);
`)])])])])]);function Uu(e,t){return e===void 0?!0:Array.isArray(e)?e.every(r=>r>=0&&r<=t):e>=0&&e<=t}const IS=Object.assign(Object.assign({},ye.props),{to:Kt.propTo,bordered:{type:Boolean,default:void 0},actions:Array,defaultValue:{type:Number,default:null},defaultFormattedValue:String,placeholder:String,placement:{type:String,default:"bottom-start"},value:Number,format:{type:String,default:"HH:mm:ss"},valueFormat:String,formattedValue:String,isHourDisabled:Function,size:String,isMinuteDisabled:Function,isSecondDisabled:Function,inputReadonly:Boolean,clearable:Boolean,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],onUpdateFormattedValue:[Function,Array],"onUpdate:formattedValue":[Function,Array],onBlur:[Function,Array],onConfirm:[Function,Array],onClear:Function,onFocus:[Function,Array],timeZone:String,showIcon:{type:Boolean,default:!0},disabled:{type:Boolean,default:void 0},show:{type:Boolean,default:void 0},hours:{type:[Number,Array],validator:e=>Uu(e,23)},minutes:{type:[Number,Array],validator:e=>Uu(e,59)},seconds:{type:[Number,Array],validator:e=>Uu(e,59)},use12Hours:Boolean,stateful:{type:Boolean,default:!0},onChange:[Function,Array]}),rc=re({name:"TimePicker",props:IS,setup(e){const{mergedBorderedRef:t,mergedClsPrefixRef:r,namespaceRef:n,inlineThemeDisabled:o}=Ne(e),{localeRef:i,dateLocaleRef:a}=mr("TimePicker"),l=Rr(e),{mergedSizeRef:s,mergedDisabledRef:d,mergedStatusRef:u}=l,f=ye("TimePicker","-time-picker",TL,mS,e,r),h=Cv(),g=D(null),v=D(null),b=P(()=>({locale:a.value.locale}));function m(K){return K===null?null:vn(K,e.valueFormat||e.format,new Date,b.value).getTime()}const{defaultValue:p,defaultFormattedValue:x}=e,S=D(x!==void 0?m(x):p),y=P(()=>{const{formattedValue:K}=e;if(K!==void 0)return m(K);const{value:pe}=e;return pe!==void 0?pe:S.value}),C=P(()=>{const{timeZone:K}=e;return K?(pe,Pe,Ue)=>_S(pe,K,Pe,Ue):(pe,Pe,Ue)=>tr(pe,Pe,Ue)}),k=D("");ft(()=>e.timeZone,()=>{const K=y.value;k.value=K===null?"":C.value(K,e.format,b.value)},{immediate:!0});const R=D(!1),$=ve(e,"show"),T=$t($,R),z=D(y.value),F=D(!1),_=P(()=>i.value.clear),N=P(()=>i.value.now),j=P(()=>e.placeholder!==void 0?e.placeholder:i.value.placeholder),H=P(()=>i.value.negativeText),Y=P(()=>i.value.positiveText),X=P(()=>/H|h|K|k/.test(e.format)),le=P(()=>e.format.includes("m")),ke=P(()=>e.format.includes("s")),be=P(()=>{const{isHourDisabled:K}=e;return he.value===null?!1:od(he.value,"hours",e.hours)?K?K(he.value):!1:!0}),Q=P(()=>{const{value:K}=Re,{value:pe}=he;if(K===null||pe===null)return!1;if(!od(K,"minutes",e.minutes))return!0;const{isMinuteDisabled:Pe}=e;return Pe?Pe(K,pe):!1}),L=P(()=>{const{value:K}=Re,{value:pe}=he,{value:Pe}=Oe;if(Pe===null||K===null||pe===null)return!1;if(!od(Pe,"seconds",e.seconds))return!0;const{isSecondDisabled:Ue}=e;return Ue?Ue(Pe,K,pe):!1}),A=P(()=>be.value||Q.value||L.value),U=P(()=>e.format.length+4),ae=P(()=>{const{value:K}=y;return K===null?null:ci(K)<12?"am":"pm"}),he=P(()=>{const{value:K}=y;return K===null?null:Number(C.value(K,"HH",b.value))}),Re=P(()=>{const{value:K}=y;return K===null?null:Number(C.value(K,"mm",b.value))}),Oe=P(()=>{const{value:K}=y;return K===null?null:Number(C.value(K,"ss",b.value))});function V(K,pe){const{onUpdateFormattedValue:Pe,"onUpdate:formattedValue":Ue}=e;Pe&&ue(Pe,K,pe),Ue&&ue(Ue,K,pe)}function Te(K){return K===null?null:C.value(K,e.valueFormat||e.format)}function Me(K){const{onUpdateValue:pe,"onUpdate:value":Pe,onChange:Ue}=e,{nTriggerFormChange:Ye,nTriggerFormInput:dt}=l,pt=Te(K);pe&&ue(pe,K,pt),Pe&&ue(Pe,K,pt),Ue&&ue(Ue,K,pt),V(pt,K),S.value=K,Ye(),dt()}function Ve(K){const{onFocus:pe}=e,{nTriggerFormFocus:Pe}=l;pe&&ue(pe,K),Pe()}function E(K){const{onBlur:pe}=e,{nTriggerFormBlur:Pe}=l;pe&&ue(pe,K),Pe()}function W(){const{onConfirm:K}=e;K&&ue(K,y.value,Te(y.value))}function ie(K){var pe;K.stopPropagation(),Me(null),we(null),(pe=e.onClear)===null||pe===void 0||pe.call(e)}function ge(){G({returnFocus:!0})}function ne(){Me(null),we(null),G({returnFocus:!0})}function ee(K){K.key==="Escape
position: relative;
z-index: auto;
`,[w("date-picker-icon",`
color: var(--n-icon-color-override);
transition: color .3s var(--n-bezier);
`),w("icon",`
color: var(--n-icon-color-override);
transition: color .3s var(--n-bezier);
`),I("disabled",[w("date-picker-icon",`
color: var(--n-icon-color-disabled-override);
`),w("icon",`
color: var(--n-icon-color-disabled-override);
`)])]),w("date-panel",`
width: fit-content;
outline: none;
margin: 4px 0;
display: grid;
grid-template-columns: 0fr;
border-radius: var(--n-panel-border-radius);
background-color: var(--n-panel-color);
color: var(--n-panel-text-color);
user-select: none;
`,[Ar(),I("shadow",`
box-shadow: var(--n-panel-box-shadow);
`),w("date-panel-calendar",{padding:"var(--n-calendar-left-padding)",display:"grid",gridTemplateColumns:"1fr",gridArea:"left-calendar"},[I("end",{padding:"var(--n-calendar-right-padding)",gridArea:"right-calendar"})]),w("date-panel-month-calendar",{display:"flex",gridArea:"left-calendar"},[M("picker-col",`
min-width: var(--n-scroll-item-width);
height: calc(var(--n-scroll-item-height) * 6);
user-select: none;
-webkit-user-select: none;
`,[O("&:first-child",`
min-width: calc(var(--n-scroll-item-width) + 4px);
`,[M("picker-col-item",[O("&::before","left: 4px;")])]),M("padding",`
height: calc(var(--n-scroll-item-height) * 5)
`)]),M("picker-col-item",`
z-index: 0;
cursor: pointer;
height: var(--n-scroll-item-height);
box-sizing: border-box;
padding-top: 4px;
display: flex;
align-items: center;
justify-content: center;
position: relative;
transition:
color .3s var(--n-bezier),
background-color .3s var(--n-bezier);
background: #0000;
color: var(--n-item-text-color);
`,[O("&::before",`
z-index: -1;
content: "";
position: absolute;
left: 0;
right: 4px;
top: 4px;
bottom: 0;
border-radius: var(--n-scroll-item-border-radius);
transition:
background-color .3s var(--n-bezier);
`),xt("disabled",[O("&:hover::before",`
background-color: var(--n-item-color-hover);
`),I("selected",`
color: var(--n-item-color-active);
`,[O("&::before","background-color: var(--n-item-color-hover);")])]),I("disabled",`
color: var(--n-item-text-color-disabled);
cursor: not-allowed;
`,[I("selected",[O("&::before",`
background-color: var(--n-item-color-disabled);
`)])])])]),I("date",{gridTemplateAreas:`
"left-calendar"
"footer"
"action"
`}),I("week",{gridTemplateAreas:`
"left-calendar"
"footer"
"action"
`}),I("daterange",{gridTemplateAreas:`
"left-calendar divider right-calendar"
"footer footer footer"
"action action action"
`}),I("datetime",{gridTemplateAreas:`
"header"
"left-calendar"
"footer"
"action"
`}),I("datetimerange",{gridTemplateAreas:`
"header header header"
"left-calendar divider right-calendar"
"footer footer footer"
"action action action"
`}),I("month",{gridTemplateAreas:`
"left-calendar"
"footer"
"action"
`}),w("date-panel-footer",{gridArea:"footer"}),w("date-panel-actions",{gridArea:"action"}),w("date-panel-header",{gridArea:"header"}),w("date-panel-header",`
box-sizing: border-box;
width: 100%;
align-items: center;
padding: var(--n-panel-header-padding);
display: flex;
justify-content: space-between;
border-bottom: 1px solid var(--n-panel-header-divider-color);
`,[O(">",[O("*:not(:last-child)",{marginRight:"10px"}),O("*",{flex:1,width:0}),w("time-picker",{zIndex:1})])]),w("date-panel-month",`
box-sizing: border-box;
display: grid;
grid-template-columns: var(--n-calendar-title-grid-template-columns);
align-items: center;
justify-items: center;
padding: var(--n-calendar-title-padding);
height: var(--n-calendar-title-height);
`,[M("prev, next, fast-prev, fast-next",`
line-height: 0;
cursor: pointer;
width: var(--n-arrow-size);
height: var(--n-arrow-size);
color: var(--n-arrow-color);
`),M("month-year",`
user-select: none;
-webkit-user-select: none;
flex-grow: 1;
position: relative;
`,[M("text",`
font-size: var(--n-calendar-title-font-size);
line-height: var(--n-calendar-title-font-size);
font-weight: var(--n-calendar-title-font-weight);
padding: 6px 8px;
text-align: center;
color: var(--n-calendar-title-text-color);
cursor: pointer;
transition: background-color .3s var(--n-bezier);
border-radius: var(--n-panel-border-radius);
`,[I("active",`
background-color: var(--n-calendar-title-color-hover);
`),O("&:hover",`
background-color: var(--n-calendar-title-color-hover);
`)])])]),w("date-panel-weekdays",`
display: grid;
margin: auto;
grid-template-columns: repeat(7, var(--n-item-cell-width));
grid-template-rows: repeat(1, var(--n-item-cell-height));
align-items: center;
justify-items: center;
margin-bottom: 4px;
border-bottom: 1px solid var(--n-calendar-days-divider-color);
`,[M("day",`
user-select: none;
-webkit-user-select: none;
line-height: 15px;
width: var(--n-item-size);
text-align: center;
font-size: var(--n-calendar-days-font-size);
color: var(--n-item-text-color);
`)]),w("date-panel-dates",`
margin: auto;
display: grid;
grid-template-columns: repeat(7, var(--n-item-cell-width));
grid-template-rows: repeat(6, var(--n-item-cell-height));
align-items: center;
justify-items: center;
flex-wrap: wrap;
`,[w("date-panel-date",`
user-select: none;
-webkit-user-select: none;
position: relative;
width: var(--n-item-size);
height: var(--n-item-size);
line-height: var(--n-item-size);
text-align: center;
font-size: var(--n-item-font-size);
border-radius: var(--n-item-border-radius);
z-index: 0;
cursor: pointer;
transition:
background-color .2s var(--n-bezier),
color .2s var(--n-bezier);
`,[M("trigger",`
position: absolute;
left: calc(var(--n-item-size) / 2 - var(--n-item-cell-width) / 2);
top: calc(var(--n-item-size) / 2 - var(--n-item-cell-height) / 2);
width: var(--n-item-cell-width);
height: var(--n-item-cell-height);
`),I("current",[M("sup",`
position: absolute;
top: 2px;
right: 2px;
content: "";
height: 4px;
width: 4px;
border-radius: 2px;
background-color: var(--n-item-color-active);
transition:
background-color .2s var(--n-bezier);
`)]),O("&::after",`
content: "";
z-index: -1;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
border-radius: inherit;
transition: background-color .3s var(--n-bezier);
`),I("covered, start, end",[xt("excluded",[O("&::before",`
content: "";
z-index: -2;
position: absolute;
left: calc((var(--n-item-size) - var(--n-item-cell-width)) / 2);
right: calc((var(--n-item-size) - var(--n-item-cell-width)) / 2);
top: 0;
bottom: 0;
background-color: var(--n-item-color-included);
`),O("&:nth-child(7n + 1)::before",{borderTopLeftRadius:"var(--n-item-border-radius)",borderBottomLeftRadius:"var(--n-item-border-radius)"}),O("&:nth-child(7n + 7)::before",{borderTopRightRadius:"var(--n-item-border-radius)",borderBottomRightRadius:"var(--n-item-border-radius)"})])]),I("selected",{color:"var(--n-item-text-color-active)"},[O("&::after",{backgroundColor:"var(--n-item-color-active)"}),I("start",[O("&::before",{left:"50%"})]),I("end",[O("&::before",{right:"50%"})]),M("sup",{backgroundColor:"var(--n-panel-color)"})]),I("excluded",{color:"var(--n-item-text-color-disabled)"},[I("selected",[O("&::after",{backgroundColor:"var(--n-item-color-disabled)"})])]),I("disabled",{cursor:"not-allowed",color:"var(--n-item-text-color-disabled)"},[I("covered",[O("&::before",{backgroundColor:"var(--n-item-color-disabled)"})]),I("selected",[O("&::before",{backgroundColor:"var(--n-item-color-disabled)"}),O("&::after",{backgroundColor:"var(--n-item-color-disabled)"})])]),I("week-hovered",[O("&::before",`
background-color: var(--n-item-color-included);
`),O("&:nth-child(7n + 1)::before",`
border-top-left-radius: var(--n-item-border-radius);
border-bottom-left-radius: var(--n-item-border-radius);
`),O("&:nth-child(7n + 7)::before",`
border-top-right-radius: var(--n-item-border-radius);
border-bottom-right-radius: var(--n-item-border-radius);
`)]),I("week-selected",`
color: var(--n-item-text-color-active)
`,[O("&::before",`
background-color: var(--n-item-color-active);
`),O("&:nth-child(7n + 1)::before",`
border-top-left-radius: var(--n-item-border-radius);
border-bottom-left-radius: var(--n-item-border-radius);
`),O("&:nth-child(7n + 7)::before",`
border-top-right-radius: var(--n-item-border-radius);
border-bottom-right-radius: var(--n-item-border-radius);
`)])])]),xt("week",[w("date-panel-dates",[w("date-panel-date",[xt("disabled",[xt("selected",[O("&:hover",`
background-color: var(--n-item-color-hover);
`)])])])])]),I("week",[w("date-panel-dates",[w("date-panel-date",[O("&::before",`
content: "";
z-index: -2;
position: absolute;
left: calc((var(--n-item-size) - var(--n-item-cell-width)) / 2);
right: calc((var(--n-item-size) - var(--n-item-cell-width)) / 2);
top: 0;
bottom: 0;
transition: background-color .3s var(--n-bezier);
`)])])]),M("vertical-divider",`
grid-area: divider;
height: 100%;
width: 1px;
background-color: var(--n-calendar-divider-color);
`),w("date-panel-footer",`
border-top: 1px solid var(--n-panel-action-divider-color);
padding: var(--n-panel-extra-footer-padding);
`),w("date-panel-actions",`
flex: 1;
padding: var(--n-panel-action-padding);
display: flex;
align-items: center;
justify-content: space-between;
border-top: 1px solid var(--n-panel-action-divider-color);
`,[M("prefix, suffix",`
display: flex;
margin-bottom: -8px;
`),M("suffix",`
align-self: flex-end;
`),M("prefix",`
flex-wrap: wrap;
`),w("button",`
margin-bottom: 8px;
`,[O("&:not(:last-child)",`
margin-right: 8px;
`)])])]),O("[data-n-date].transition-disabled",{transition:"none !important"},[O("&::before, &::after",{transition:"none !important"})])]),AS=Object.assign(Object.assign({},ye.props),{to:Kt.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,updateValueOnClose:Boolean,defaultValue:[Number,Array],defaultFormattedValue:[String,Array],defaultTime:[Number,String,Array],disabled:{type:Boolean,default:void 0},placement:{type:String,default:"bottom-start"},value:[Number,Array],formattedValue:[String,Array],size:String,type:{type:String,default:"date"},valueFormat:String,separator:String,placeholder:String,startPlaceholder:String,endPlaceholder:String,format:String,dateFormat:String,timerPickerFormat:String,actions:Array,shortcuts:Object,isDateDisabled:Function,isTimeDisabled:Function,show:{type:Boolean,default:void 0},panel:Boolean,ranges:Object,firstDayOfWeek:Number,inputReadonly:Boolean,closeOnSelect:Boolean,status:String,timePickerProps:[Object,Array],onClear:Function,onConfirm:Function,defaultCalendarStartTime:Number,defaultCalendarEndTime:Number,bindCalendarMonths:Boolean,monthFormat:{type:String,default:"M"},yearFormat:{type:String,default:"y"},quarterFormat:{type:String,default:"'Q'Q"},"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],"onUpdate:formattedValue":[Function,Array],onUpdateFormattedValue:[Function,Array],"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onNextMonth:Function,onPrevMonth:Function,onNextYear:Function,onPrevYear:Function,onChange:[Function,Array]}),DL=re({name:"DatePicker",props:AS,setup(e,{slots:t}){var r;const{localeRef:n,dateLocaleRef:o}=mr("DatePicker"),i=Rr(e),{mergedSizeRef:a,mergedDisabledRef:l,mergedStatusRef:s}=i,{mergedComponentPropsRef:d,mergedClsPrefixRef:u,mergedBorderedRef:f,namespaceRef:h,inlineThemeDisabled:g}=Ne(e),v=D(null),b=D(null),m=D(null),p=D(!1),x=ve(e,"show"),S=$t(x,p),y=P(()=>({locale:o.value.locale})),C=P(()=>{const{format:ce}=e;if(ce)return ce;switch(e.type){case"date":case"daterange":return n.value.dateFormat;case"datetime":case"datetimerange":return n.value.dateTimeFormat;case"year":case"yearrange":return n.value.yearTypeFormat;case"month":case"monthrange":return n.value.monthTypeFormat;case"quarter":case"quarterrange":return n.value.quarterFormat;case"week":return n.value.weekFormat}}),k=P(()=>{var ce;return(ce=e.valueFormat)!==null&&ce!==void 0?ce:C.value});function R(ce){if(ce===null)return null;const{value:_e}=k,{value:se}=y;return Array.isArray(ce)?[vn(ce[0],_e,new Date,se).getTime(),vn(ce[1],_e,new Date,se).getTime()]:vn(ce,_e,new Date,se).getTime()}const{defaultFormattedValue:$,defaultValue:T}=e,z=D((r=$!==void 0?R($):T)!==null&&r!==void 0?r:null),F=P(()=>{const{formattedValue:ce}=e;return ce!==void 0?R(ce):e.value}),_=$t(F,z),N=D(null);Et(()=>{N.value=_.value});const j=D(""),H=D(""),Y=D(""),X=ye("DatePicker","-date-picker",FL,cN,e,u),le=P(()=>{var ce,_e;return((_e=(ce=d==null?void 0:d.value)===null||ce===void 0?void 0:ce.DatePicker)===null||_e===void 0?void 0:_e.timePickerSize)||"small"}),ke=P(()=>["daterange","datetimerange","monthrange","quarterrange","yearrange"].includes(e.type)),be=P(()=>{const{placeholder:ce}=e;if(ce===void 0){const{type:_e}=e;switch(_e){case"date":return n.value.datePlaceholder;case"datetime":return n.value.datetimePlaceholder;case"month":return n.value.monthPlaceholder;case"year":return n.value.yearPlaceholder;case"quarter":return n.value.quarterPlaceholder;case"week":return n.value.weekPlaceholder;default:return""}}else return ce}),Q=P(()=>e.startPlaceholder===void 0?e.type==="daterange"?n.value.startDatePlaceholder:e.type==="datetimerange"?n.value.startDatetimePlaceholder:e.type==="monthrange"?n.value.startMonthPlaceholder:"":e.startPlaceholder),L=P(()=>e.endPlaceholder===void 0?e.type==="daterange"?n.value.endDatePlaceholder:e.type==="datetimerange"?n.value.endDatetimePlaceholder:e.type==="monthrange"?n.value.endMonthPlaceholder:"":e.endPlaceholder),A=P(()=>{const{actions:ce,type:_e,clearable:se}=e;if(ce===null)return[];if(ce!==void 0)return
display: inline-block;
margin: 0 8px 0 2px;
`),w("descriptions-table-wrapper",[w("descriptions-table",[w("descriptions-table-row",[w("descriptions-table-header",{padding:"var(--n-th-padding)"}),w("descriptions-table-content",{padding:"var(--n-td-padding)"})])])]),xt("bordered",[w("descriptions-table-wrapper",[w("descriptions-table",[w("descriptions-table-row",[O("&:last-child",[w("descriptions-table-content",{paddingBottom:0})])])])])]),I("left-label-placement",[w("descriptions-table-content",[O("> *",{verticalAlign:"top"})])]),I("left-label-align",[O("th",{textAlign:"left"})]),I("center-label-align",[O("th",{textAlign:"center"})]),I("right-label-align",[O("th",{textAlign:"right"})]),I("bordered",[w("descriptions-table-wrapper",`
border-radius: var(--n-border-radius);
overflow: hidden;
background: var(--n-merged-td-color);
border: 1px solid var(--n-merged-border-color);
`,[w("descriptions-table",[w("descriptions-table-row",[O("&:not(:last-child)",[w("descriptions-table-content",{borderBottom:"1px solid var(--n-merged-border-color)"}),w("descriptions-table-header",{borderBottom:"1px solid var(--n-merged-border-color)"})]),w("descriptions-table-header",`
font-weight: 400;
background-clip: padding-box;
background-color: var(--n-merged-th-color);
`,[O("&:not(:last-child)",{borderRight:"1px solid var(--n-merged-border-color)"})]),w("descriptions-table-content",[O("&:not(:last-child)",{borderRight:"1px solid var(--n-merged-border-color)"})])])])])]),w("descriptions-header",`
font-weight: var(--n-th-font-weight);
font-size: 18px;
transition: color .3s var(--n-bezier);
line-height: var(--n-line-height);
margin-bottom: 16px;
color: var(--n-title-text-color);
`),w("descriptions-table-wrapper",`
transition:
background-color .3s var(--n-bezier),
border-color .3s var(--n-bezier);
`,[w("descriptions-table",`
width: 100%;
border-collapse: separate;
border-spacing: 0;
box-sizing: border-box;
`,[w("descriptions-table-row",`
box-sizing: border-box;
transition: border-color .3s var(--n-bezier);
`,[w("descriptions-table-header",`
font-weight: var(--n-th-font-weight);
line-height: var(--n-line-height);
display: table-cell;
box-sizing: border-box;
color: var(--n-th-text-color);
transition:
color .3s var(--n-bezier),
background-color .3s var(--n-bezier),
border-color .3s var(--n-bezier);
`),w("descriptions-table-content",`
vertical-align: top;
line-height: var(--n-line-height);
display: table-cell;
box-sizing: border-box;
color: var(--n-td-text-color);
transition:
color .3s var(--n-bezier),
background-color .3s var(--n-bezier),
border-color .3s var(--n-bezier);
`,[M("content",`
transition: color .3s var(--n-bezier);
display: inline-block;
color: var(--n-td-text-color);
`)]),M("label",`
font-weight: var(--n-th-font-weight);
transition: color .3s var(--n-bezier);
display: inline-block;
margin-right: 14px;
color: var(--n-th-text-color);
`)])])])]),w("descriptions-table-wrapper",`
--n-merged-th-color: var(--n-th-color);
--n-merged-td-color: var(--n-td-color);
--n-merged-border-color: var(--n-border-color);
`),So(w("descriptions-table-wrapper",`
--n-merged-th-color: var(--n-th-color-modal);
--n-merged-td-color: var(--n-td-color-modal);
--n-merged-border-color: var(--n-border-color-modal);
`)),jo(w("descriptions-table-wrapper",`
--n-merged-th-color: var(--n-th-color-popover);
--n-merged-td-color: var(--n-td-color-popover);
--n-merged-border-color: var(--n-border-color-popover);
`))]),LS=Object.assign(Object.assign({},ye.props),{title:String,column:{type:Number,default:3},columns:Number,labelPlacement:{type:String,default:"top"},labelAlign:{type:String,default:"left"},separator:{type:String,default:":"},size:{type:String,default:"medium"},bordered:Boolean,labelClass:String,labelStyle:[Object,String],contentClass:String,contentStyle:[Object,String]}),HL=re({name:"Descriptions",props:LS,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:r}=Ne(e),n=ye("Descriptions","-descriptions",LL,AL,e,t),o=P(()=>{const{size:a,bordered:l}=e,{common:{cubicBezierEaseInOut:s},self:{titleTextColor:d,thColor:u,thColorModal:f,thColorPopover:h,thTextColor:g,thFontWeight:v,tdTextColor:b,tdColor:m,tdColorModal:p,tdColorPopover:x,borderColor:S,borderColorModal:y,borderColorPopover:C,borderRadius:k,lineHeight:R,[Ce("fontSize",a)]:$,[Ce(l?"thPaddingBordered":"thPadding",a)]:T,[Ce(l?"tdPaddingBordered":"tdPadding",a)]:z}}=n.value;return{"--n-title-text-color":d,"--n-th-padding":T,"--n-td-padding":z,"--n-font-size":$,"--n-bezier":s,"--n-th-font-weight":v,"--n-line-height":R,"--n-th-text-color":g,"--n-td-text-color":b,"--n-th-color":u,"--n-th-color-modal":f,"--n-th-color-popover":h,"--n-td-color":m,"--n-td-color-modal":p,"--n-td-color-popover":x,"--n-border-radius":k,"--n-border-color":S,"--n-border-color-modal":y,"--n-border-color-popover":C}}),i=r?Qe("descriptions",P(()=>{let a="";const{size:l,bordered:s}=e;return s&&(a+="a"),a+=l[0],a}),o,e):void 0;return{mergedClsPrefix:t,cssVars:r?void 0:o,themeClass:i==null?void 0:i.themeClass,onRender:i==null?void 0:i.onRender,compitableColumn:bi(e,["columns","column"]),inlineThemeDisabled:r}},render(){const e=this.$slots.default,t=e?zn(e()):[];t.length;const{contentClass:r,labelClass:n,compitableColumn:o,labelPlacement:i,labelAlign:a,size:l,bordered:s,title:d,cssVars:u,mergedClsPrefix:f,separator:h,onRender:g}=this;g==null||g();const v=t.filter(x=>NL(x)),b={span:0,row:[],secondRow:[],rows:[]},p=v.reduce((x,S,y)=>{const C=S.props||{},k=v.length-1===y,R=["label"in C?C.label:zp(S,"label")],$=[zp(S)],T=C.span||1,z=x.span;x.span+=T;const F=C.labelStyle||C["label-style"]||this.labelStyle,_=C.contentStyle||C["content-style"]||this.contentStyle;if(i==="left")s?x.row.push(c("th",{class:[`${f}-descriptions-table-header`,n],colspan:1,style:F},R),c("td",{class:[`${f}-descriptions-table-content`,r],colspan:k?(o-z)*2+1:T*2-1,style:_},$)):x.row.push(c("td",{class:`${f}-descriptions-table-content`,colspan:k?(o-z)*2:T*2},c("span",{class:[`${f}-descriptions-table-content__label`,n],style:F},[...R,h&&c("span",{class:`${f}-descriptions-separator`},h)]),c("span",{class:[`${f}-descriptions-table-content__content`,r],style:_},$)));else{const N=k?(o-z)*2:T*2;x.row.push(c("th",{class:[`${f}-descriptions-table-header`,n],colspan:N,style:F},R)),x.secondRow.push(c("td",{class:[`${f}-descriptions-table-content`,r],colspan:N,style:_},$))}return(x.span>=o||k)&&(x.span=0,x.row.length&&(x.rows.push(x.row),x.row=[]),i!=="left"&&x.secondRow.length&&(x.rows.push(x.secondRow),x.secondRow=[])),x},b).rows.map(x=>c("tr",{class:`${f}-descriptions-table-row`},x));return c("div",{style:u,class:[`${f}-descriptions`,this.themeClass,`${f}-descriptions--${i}-label-placement`,`${f}-descriptions--${a}-label-align`,`${f}-descriptions--${l}-size`,s&&`${f}-descriptions--bordered`]},d||this.$slots.header?c("div",{class:`${f}-descriptions-header`},d||il(this,"header")):null,c("div",{class:`${f}-descriptions-table-wrapper`},c("table",{class:`${f}-descriptions-table`},c("tbody",null,i==="top"&&c("tr",{class:`${f}-descriptions-table-row`,style:{visibility:"collapse"}},vs(o*2,c("td",null))),p))))}}),HS={label:String,span:{type:Number,default:1},labelClass:String,labelStyle:[Object,String],contentClass:String,contentStyle:[Object,String]},jL=re({name:"DescriptionsItem",[NS]:!0,props:HS,render(){return null}}),VL={titleFontSize:"18px",padding:"16px 28px 20px 28px",iconSize:"28px",actionSpace:"12px",contentMargin:"8px 0 16px 0",iconMargin:"0 4px 0 0",iconMarginIconTop:"4px 0 8px 0",closeSize:"22px",closeIconSize:"18px",closeMargin:"20px
--n-icon-margin: var(--n-icon-margin-top) var(--n-icon-margin-right) var(--n-icon-margin-bottom) var(--n-icon-margin-left);
word-break: break-word;
line-height: var(--n-line-height);
position: relative;
background: var(--n-color);
color: var(--n-text-color);
box-sizing: border-box;
margin: auto;
border-radius: var(--n-border-radius);
padding: var(--n-padding);
transition:
border-color .3s var(--n-bezier),
background-color .3s var(--n-bezier),
color .3s var(--n-bezier);
`,[M("icon",{color:"var(--n-icon-color)"}),I("bordered",{border:"var(--n-border)"}),I("icon-top",[M("close",{margin:"var(--n-close-margin)"}),M("icon",{margin:"var(--n-icon-margin)"}),M("content",{textAlign:"center"}),M("title",{justifyContent:"center"}),M("action",{justifyContent:"center"})]),I("icon-left",[M("icon",{margin:"var(--n-icon-margin)"}),I("closable",[M("title",`
padding-right: calc(var(--n-close-size) + 6px);
`)])]),M("close",`
position: absolute;
right: 0;
top: 0;
margin: var(--n-close-margin);
transition:
background-color .3s var(--n-bezier),
color .3s var(--n-bezier);
z-index: 1;
`),M("content",`
font-size: var(--n-font-size);
margin: var(--n-content-margin);
position: relative;
word-break: break-word;
`,[I("last","margin-bottom: 0;")]),M("action",`
display: flex;
justify-content: flex-end;
`,[O("> *:not(:last-child)",`
margin-right: var(--n-action-space);
`)]),M("icon",`
font-size: var(--n-icon-size);
transition: color .3s var(--n-bezier);
`),M("title",`
transition: color .3s var(--n-bezier);
display: flex;
align-items: center;
font-size: var(--n-title-font-size);
font-weight: var(--n-title-font-weight);
color: var(--n-title-text-color);
`),w("dialog-icon-container",`
display: flex;
justify-content: center;
`)]),So(w("dialog",`
width: 446px;
max-width: calc(100vw - 32px);
`)),w("dialog",[Gx(`
width: 446px;
max-width: calc(100vw - 32px);
`)])]),WL={default:()=>c(Ri,null),info:()=>c(Ri,null),success:()=>c(pa,null),warning:()=>c(zi,null),error:()=>c(ga,null)},wg=re({name:"Dialog",alias:["NimbusConfirmCard","Confirm"],props:Object.assign(Object.assign({},ye.props),Rs),setup(e){const{mergedComponentPropsRef:t,mergedClsPrefixRef:r,inlineThemeDisabled:n,mergedRtlRef:o}=Ne(e),i=Wt("Dialog",o,r),a=P(()=>{var g,v;const{iconPlacement:b}=e;return b||((v=(g=t==null?void 0:t.value)===null||g===void 0?void 0:g.Dialog)===null||v===void 0?void 0:v.iconPlacement)||"left"});function l(g){const{onPositiveClick:v}=e;v&&v(g)}function s(g){const{onNegativeClick:v}=e;v&&v(g)}function d(){const{onClose:g}=e;g&&g()}const u=ye("Dialog","-dialog",UL,VS,e,r),f=P(()=>{const{type:g}=e,v=a.value,{common:{cubicBezierEaseInOut:b},self:{fontSize:m,lineHeight:p,border:x,titleTextColor:S,textColor:y,color:C,closeBorderRadius:k,closeColorHover:R,closeColorPressed:$,closeIconColor:T,closeIconColorHover:z,closeIconColorPressed:F,closeIconSize:_,borderRadius:N,titleFontWeight:j,titleFontSize:H,padding:Y,iconSize:X,actionSpace:le,contentMargin:ke,closeSize:be,[v==="top"?"iconMarginIconTop":"iconMargin"]:Q,[v==="top"?"closeMarginIconTop":"closeMargin"]:L,[Ce("iconColor",g)]:A}}=u.value,U=Lr(Q);return{"--n-font-size":m,"--n-icon-color":A,"--n-bezier":b,"--n-close-margin":L,"--n-icon-margin-top":U.top,"--n-icon-margin-right":U.right,"--n-icon-margin-bottom":U.bottom,"--n-icon-margin-left":U.left,"--n-icon-size":X,"--n-close-size":be,"--n-close-icon-size":_,"--n-close-border-radius":k,"--n-close-color-hover":R,"--n-close-color-pressed":$,"--n-close-icon-color":T,"--n-close-icon-color-hover":z,"--n-close-icon-color-pressed":F,"--n-color":C,"--n-text-color":y,"--n-border-radius":N,"--n-padding":Y,"--n-line-height":p,"--n-border":x,"--n-content-margin":ke,"--n-title-font-size":H,"--n-title-font-weight":j,"--n-title-text-color":S,"--n-action-space":le}}),h=n?Qe("dialog",P(()=>`${e.type[0]}${a.value[0]}`),f,e):void 0;return{mergedClsPrefix:r,rtlEnabled:i,mergedIconPlacement:a,mergedTheme:u,handlePositiveClick:l,handleNegativeClick:s,handleCloseClick:d,cssVars:n?void 0:f,themeClass:h==null?void 0:h.themeClass,onRender:h==null?void 0:h.onRender}},render(){var e;const{bordered:t,mergedIconPlacement:r,cssVars:n,closable:o,showIcon:i,title:a,content:l,action:s,negativeText:d,positiveText:u,positiveButtonProps:f,negativeButtonProps:h,handlePositiveClick:g,handleNegativeClick:v,mergedTheme:b,loading:m,type:p,mergedClsPrefix:x}=this;(e=this.onRender)===null||e===void 0||e.call(this);const S=i?c(ut,{clsPrefix:x,class:`${x}-dialog__icon`},{default:()=>Tt(this.$slots.icon,C=>C||(this.icon?Zt(this.icon):WL[this.type]()))}):null,y=Tt(this.$slots.action,C=>C||u||d||s?c("div",{class:[`${x}-dialog__action`,this.actionClass],style:this.actionStyle},C||(s?[Zt(s)]:[this.negativeText&&c(Dt,Object.assign({theme:b.peers.Button,themeOverrides:b.peerOverrides.Button,ghost:!0,size:"small",onClick:v},h),{default:()=>Zt(this.negativeText)}),this.positiveText&&c(Dt,Object.assign({theme:b.peers.Button,themeOverrides:b.peerOverrides.Button,size:"small",type:p==="default"?"primary":p,disabled:m,loading:m,onClick:g},f),{default:()=>Zt(this.positiveText)})])):null);return c("div",{class:[`${x}-dialog`,this.themeClass,this.closable&&`${x}-dialog--closable`,`${x}-dialog--icon-${r}`,t&&`${x}-dialog--bordered`,this.rtlEnabled&&`${x}-dialog--rtl`],style:n,role:"dialog"},o?Tt(this.$slots.close,C=>{const k=[`${x}-dialog__close`,this.rtlEnabled&&`${x}-dialog--rtl`];return C?c("div",{class:k},C):c(Wo,{clsPrefix:x,class:k,onClick:this.handleCloseClick})}):null,i&&r==="top"?c("div",{class:`${x}-dialog-icon-container`},S):null,c("div",{class:[`${x}-dialog__title`,this.titleClass],style:this.titleStyle},i&&r==="left"?S:null,yt(this.$slots.header,()=>[Zt(a)])),c("div",{class:[`${x}-dialog__content`,y?"":`${x}-dialog__content--last`,this.contentClass],style:this.contentStyle},yt(this.$slots.default,()=>[Zt(l)])),y)}}),KS="n-dialog-provider",qS="n-dialog-api",YS="n-dialog-reactive-list",GS=e=>{const{modalColor:t,textColor2:r,boxShadow3:n}=e;return{c
position: fixed;
left: 0;
top: 0;
height: 0;
width: 0;
display: flex;
`),w("modal-mask",`
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
background-color: rgba(0, 0, 0, .4);
`,[Eo({enterDuration:".25s",leaveDuration:".25s",enterCubicBezier:"var(--n-bezier-ease-out)",leaveCubicBezier:"var(--n-bezier-ease-out)"})]),w("modal-body-wrapper",`
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
overflow: visible;
`,[w("modal-scroll-content",`
min-height: 100%;
display: flex;
position: relative;
`)]),w("modal",`
position: relative;
align-self: center;
color: var(--n-text-color);
margin: auto;
box-shadow: var(--n-box-shadow);
`,[Ar({duration:".25s",enterScale:".5"})])]),kg=Object.assign(Object.assign(Object.assign(Object.assign({},ye.props),{show:Boolean,unstableShowMask:{type:Boolean,default:!0},maskClosable:{type:Boolean,default:!0},preset:String,to:[String,Object],displayDirective:{type:String,default:"if"},transformOrigin:{type:String,default:"mouse"},zIndex:Number,autoFocus:{type:Boolean,default:!0},trapFocus:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},blockScroll:{type:Boolean,default:!0}}),Sg),{onEsc:Function,"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],onAfterEnter:Function,onBeforeLeave:Function,onAfterLeave:Function,onClose:Function,onPositiveClick:Function,onNegativeClick:Function,onMaskClick:Function,internalDialog:Boolean,internalModal:Boolean,internalAppear:{type:Boolean,default:void 0},overlayStyle:[String,Object],onBeforeHide:Function,onAfterHide:Function,onHide:Function}),Rg=re({name:"Modal",inheritAttrs:!1,props:kg,setup(e){const t=D(null),{mergedClsPrefixRef:r,namespaceRef:n,inlineThemeDisabled:o}=Ne(e),i=ye("Modal","-modal",XL,KL,e,r),a=Dd(64),l=Fd(),s=Ur(),d=e.internalDialog?De(KS,null):null,u=e.internalModal?De(nz,null):null,f=my();function h(k){const{onUpdateShow:R,"onUpdate:show":$,onHide:T}=e;R&&ue(R,k),$&&ue($,k),T&&!k&&T(k)}function g(){const{onClose:k}=e;k?Promise.resolve(k()).then(R=>{R!==!1&&h(!1)}):h(!1)}function v(){const{onPositiveClick:k}=e;k?Promise.resolve(k()).then(R=>{R!==!1&&h(!1)}):h(!1)}function b(){const{onNegativeClick:k}=e;k?Promise.resolve(k()).then(R=>{R!==!1&&h(!1)}):h(!1)}function m(){const{onBeforeLeave:k,onBeforeHide:R}=e;k&&ue(k),R&&R()}function p(){const{onAfterLeave:k,onAfterHide:R}=e;k&&ue(k),R&&R()}function x(k){var R;const{onMaskClick:$}=e;$&&$(k),e.maskClosable&&!((R=t.value)===null||R===void 0)&&R.contains(mn(k))&&h(!1)}function S(k){var R;(R=e.onEsc)===null||R===void 0||R.call(e),e.show&&e.closeOnEsc&&Zx(k)&&!f.value&&h(!1)}ot(ty,{getMousePosition:()=>{const k=d||u;if(k){const{clickedRef:R,clickedPositionRef:$}=k;if(R.value&&$.value)return $.value}return a.value?l.value:null},mergedClsPrefixRef:r,mergedThemeRef:i,isMountedRef:s,appearRef:ve(e,"internalAppear"),transformOriginRef:ve(e,"transformOrigin")});const y=P(()=>{const{common:{cubicBezierEaseOut:k},self:{boxShadow:R,color:$,textColor:T}}=i.value;return{"--n-bezier-ease-out":k,"--n-box-shadow":R,"--n-color":$,"--n-text-color":T}}),C=o?Qe("theme-class",void 0,y,e):void 0;return{mergedClsPrefix:r,namespace:n,isMounted:s,containerRef:t,presetProps:P(()=>Sr(e,YL)),handleEsc:S,handleAfterLeave:p,handleClickoutside:x,handleBeforeLeave:m,doUpdateShow:h,handleNegativeClick:b,handlePositiveClick:v,handleCloseClick:g,cssVars:o?void 0:y,themeClass:C==null?void 0:C.themeClass,onRender:C==null?void 0:C.onRender}},render(){const{mergedClsPrefix:e}=this;return c(bs,{to:this.to,show:this.show},{default:()=>{var t;(t=this.onRender)===null||t===void 0||t.call(this);const{unstableShowMask:r}=this;return hr(c("div",{role:"none",ref:"containerRef",class:[`${e}-modal-container`,this.themeClass,this.namespace],style:this.cssVars},c(GL,Object.assign({style:this.overlayStyle},this.$attrs,{ref:"bodyWrapper",displayDirective:this.displayDirective,show:this.show,preset:this.preset,autoFocus:this.autoFocus,trapFocus:this.trapFocus,blockScroll:this.blockScroll},this.presetProps,{onEsc:this.handleEsc,onClose:this.handleCloseClick,onNegativeClick:this.handleNegativeClick,onPositiveClick:this.handlePositiveClick,onBeforeLeave:this.handleBeforeLeave,onAfterEnter:this.onAfterEnter,onAfterLeave:this.handleAfterLeave,onClickoutside:r?void 0:this.handleClickoutside,renderMask:r?()=>{var n;return c(At,{name:"fade-in-transition",key:"mask",appear:(n=this.internalAppear)!==null&&n!==void 0?n:this.isMounted},{default:()=>this.show?c("div",{"aria-hidden":!0,ref:"containerRef",class:`${e}-modal-mask`,onClick:this.handleClickoutside}):null})}:void 0}),this.$slots)),[[ms,{zIndex:this.zIndex,enabled:this.show}]])}})}}),ZL=Object.assign(Object.assign({},Rs),{onAfterEnter:Function,onAfterLeave:Function,transformOrigin:String,blockScroll:{t
position: relative;
display: flex;
width: 100%;
box-sizing: border-box;
font-size: 16px;
color: var(--n-text-color);
transition:
color .3s var(--n-bezier),
background-color .3s var(--n-bezier);
`,[xt("vertical",`
margin-top: 24px;
margin-bottom: 24px;
`,[xt("no-title",`
display: flex;
align-items: center;
`)]),M("title",`
display: flex;
align-items: center;
margin-left: 12px;
margin-right: 12px;
white-space: nowrap;
font-weight: var(--n-font-weight);
`),I("title-position-left",[M("line",[I("left",{width:"28px"})])]),I("title-position-right",[M("line",[I("right",{width:"28px"})])]),I("dashed",[M("line",`
background-color: #0000;
height: 0px;
width: 100%;
border-style: dashed;
border-width: 1px 0 0;
`)]),I("vertical",`
display: inline-block;
height: 1em;
margin: 0 8px;
vertical-align: middle;
width: 1px;
`),M("line",`
border: none;
transition: background-color .3s var(--n-bezier), border-color .3s var(--n-bezier);
height: 1px;
width: 100%;
margin: 0;
`),xt("dashed",[M("line",{backgroundColor:"var(--n-color)"})]),I("dashed",[M("line",{borderColor:"var(--n-color)"})]),I("vertical",{backgroundColor:"var(--n-color)"})]),e2=Object.assign(Object.assign({},ye.props),{titlePlacement:{type:String,default:"center"},dashed:Boolean,vertical:Boolean}),n7=re({name:"Divider",props:e2,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:r}=Ne(e),n=ye("Divider","-divider",r7,e7,e,t),o=P(()=>{const{common:{cubicBezierEaseInOut:a},self:{color:l,textColor:s,fontWeight:d}}=n.value;return{"--n-bezier":a,"--n-color":l,"--n-text-color":s,"--n-font-weight":d}}),i=r?Qe("divider",void 0,o,e):void 0;return{mergedClsPrefix:t,cssVars:r?void 0:o,themeClass:i==null?void 0:i.themeClass,onRender:i==null?void 0:i.onRender}},render(){var e;const{$slots:t,titlePlacement:r,vertical:n,dashed:o,cssVars:i,mergedClsPrefix:a}=this;return(e=this.onRender)===null||e===void 0||e.call(this),c("div",{role:"separator",class:[`${a}-divider`,this.themeClass,{[`${a}-divider--vertical`]:n,[`${a}-divider--no-title`]:!t.default,[`${a}-divider--dashed`]:o,[`${a}-divider--title-position-${r}`]:t.default&&r}],style:i},n?null:c("div",{class:`${a}-divider__line ${a}-divider__line--left`}),!n&&t.default?c(It,null,c("div",{class:`${a}-divider__title`},this.$slots),c("div",{class:`${a}-divider__line ${a}-divider__line--right`})):null)}}),t2=e=>{const{modalColor:t,textColor1:r,textColor2:n,boxShadow3:o,lineHeight:i,fontWeightStrong:a,dividerColor:l,closeColorHover:s,closeColorPressed:d,closeIconColor:u,closeIconColorHover:f,closeIconColorPressed:h,borderRadius:g,primaryColorHover:v}=e;return{bodyPadding:"16px 24px",borderRadius:g,headerPadding:"16px 24px",footerPadding:"16px 24px",color:t,textColor:n,titleTextColor:r,titleFontSize:"18px",titleFontWeight:a,boxShadow:o,lineHeight:i,headerBorderBottom:`1px solid ${l}`,footerBorderTop:`1px solid ${l}`,closeIconColor:u,closeIconColorHover:f,closeIconColorPressed:h,closeSize:"22px",closeIconSize:"18px",closeColorHover:s,closeColorPressed:d,closeBorderRadius:g,resizableTriggerColorHover:v}},o7={name:"Drawer",common:tt,peers:{Scrollbar:yn},self:t2},i7={name:"Drawer",common:et,peers:{Scrollbar:Cn},self:t2},a7=re({name:"NDrawerContent",inheritAttrs:!1,props:{blockScroll:Boolean,show:{type:Boolean,default:void 0},displayDirective:{type:String,required:!0},placement:{type:String,required:!0},contentClass:String,contentStyle:[Object,String],nativeScrollbar:{type:Boolean,required:!0},scrollbarProps:Object,trapFocus:{type:Boolean,default:!0},autoFocus:{type:Boolean,default:!0},showMask:{type:[Boolean,String],required:!0},maxWidth:Number,maxHeight:Number,minWidth:Number,minHeight:Number,resizable:Boolean,onClickoutside:Function,onAfterLeave:Function,onAfterEnter:Function,onEsc:Function},setup(e){const t=D(!!e.show),r=D(null),n=De(Sv);let o=0,i="",a=null;const l=D(!1),s=D(!1),d=P(()=>e.placement==="top"||e.placement==="bottom"),{mergedClsPrefixRef:u,mergedRtlRef:f}=Ne(e),h=Wt("Drawer",f,u),g=T=>{s.value=!0,o=d.value?T.clientY:T.clientX,i=document.body.style.cursor,document.body.style.cursor=d.value?"ns-resize":"ew-resize",document.body.addEventListener("mousemove",y),document.body.addEventListener("mouseleave",k),document.body.addEventListener("mouseup",C)},v=()=>{a!==null&&(window.clearTimeout(a),a=null),s.value?l.value=!0:a=window.setTimeout(()=>{l.value=!0},300)},b=()=>{a!==null&&(window.clearTimeout(a),a=null),l.value=!1},{doUpdateHeight:m,doUpdateWidth:p}=n,x=T=>{const{maxWidth:z}=e;if(z&&T>z)return z;const{minWidth:F}=e;return F&&T<F?F:T},S=T=>{const{maxHeight:z}=e;if(z&&T>z)return z;const{minHeight:F}=e;return F&&T<F?F:T},y=T=>{var z,F;if(s.value)if(d.value){let _=((z=r.value)===null||z===void 0?void 0:z.offsetHeight)||0;const N=o-T.clientY;_+=e.placement==="bottom"?N:-N,_=S(_),m(_),o=T.clientY}else{let _=((F=r.value)===null||F===void 0?void 0:F.offsetWidth)||0;const N=o-T.clientX;_+=e.placement==="right"?N:-N,_=x(_),p(_),o=T.clientX}},C=()=>{s.value&&(o=0,s.value=!1,document.body.style.cursor=i,document.body.removeEventListener("mousemove",y),document.body.removeEventListener("mouseu
word-break: break-word;
line-height: var(--n-line-height);
position: absolute;
pointer-events: all;
box-shadow: var(--n-box-shadow);
transition:
background-color .3s var(--n-bezier),
color .3s var(--n-bezier);
background-color: var(--n-color);
color: var(--n-text-color);
box-sizing: border-box;
`,[d7(),f7(),g7(),b7(),I("unselectable",`
user-select: none;
-webkit-user-select: none;
`),I("native-scrollbar",[w("drawer-content-wrapper",`
overflow: auto;
height: 100%;
`)]),M("resize-trigger",`
position: absolute;
background-color: #0000;
transition: background-color .3s var(--n-bezier);
`,[I("hover",`
background-color: var(--n-resize-trigger-color-hover);
`)]),w("drawer-content-wrapper",`
box-sizing: border-box;
`),w("drawer-content",`
height: 100%;
display: flex;
flex-direction: column;
`,[I("native-scrollbar",[w("drawer-body-content-wrapper",`
height: 100%;
overflow: auto;
`)]),w("drawer-body",`
flex: 1 0 0;
overflow: hidden;
`),w("drawer-body-content-wrapper",`
box-sizing: border-box;
padding: var(--n-body-padding);
`),w("drawer-header",`
font-weight: var(--n-title-font-weight);
line-height: 1;
font-size: var(--n-title-font-size);
color: var(--n-title-text-color);
padding: var(--n-header-padding);
transition: border .3s var(--n-bezier);
border-bottom: 1px solid var(--n-divider-color);
border-bottom: var(--n-header-border-bottom);
display: flex;
justify-content: space-between;
align-items: center;
`,[M("close",`
margin-left: 6px;
transition:
background-color .3s var(--n-bezier),
color .3s var(--n-bezier);
`)]),w("drawer-footer",`
display: flex;
justify-content: flex-end;
border-top: var(--n-footer-border-top);
transition: border .3s var(--n-bezier);
padding: var(--n-footer-padding);
`)]),I("right-placement",`
top: 0;
bottom: 0;
right: 0;
border-top-left-radius: var(--n-border-radius);
border-bottom-left-radius: var(--n-border-radius);
`,[M("resize-trigger",`
width: 3px;
height: 100%;
top: 0;
left: 0;
transform: translateX(-1.5px);
cursor: ew-resize;
`)]),I("left-placement",`
top: 0;
bottom: 0;
left: 0;
border-top-right-radius: var(--n-border-radius);
border-bottom-right-radius: var(--n-border-radius);
`,[M("resize-trigger",`
width: 3px;
height: 100%;
top: 0;
right: 0;
transform: translateX(1.5px);
cursor: ew-resize;
`)]),I("top-placement",`
top: 0;
left: 0;
right: 0;
border-bottom-left-radius: var(--n-border-radius);
border-bottom-right-radius: var(--n-border-radius);
`,[M("resize-trigger",`
width: 100%;
height: 3px;
bottom: 0;
left: 0;
transform: translateY(1.5px);
cursor: ns-resize;
`)]),I("bottom-placement",`
left: 0;
bottom: 0;
right: 0;
border-top-left-radius: var(--n-border-radius);
border-top-right-radius: var(--n-border-radius);
`,[M("resize-trigger",`
width: 100%;
height: 3px;
top: 0;
left: 0;
transform: translateY(-1.5px);
cursor: ns-resize;
`)])]),O("body",[O(">",[w("drawer-container",`
position: fixed;
`)])]),w("drawer-container",`
position: relative;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
pointer-events: none;
`,[O("> *",`
pointer-events: all;
`)]),w("drawer-mask",`
background-color: rgba(0, 0, 0, .3);
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
`,[I("invisible",`
background-color: rgba(0, 0, 0, 0)
`),Eo({enterDuration:"0.2s",leaveDuration:"0.2s",enterCubicBezier:"var(--n-bezier-in)",leaveCubicBezier:"var(--n-bezier-out)"})])]),r2=Object.assign(Object.assign({},ye.props),{show:Boolean,width:[Number,String],height:[Number,String],placement:{type:String,default:"right"},maskClosable:{type:Boolean,default:!0},showMask:{type:[Boolean,String],default:!0},to:[String,Object],displayDirective:{type:String,default:"if"},nativeScrollbar:{type:Boolean,default:!0},zIndex:Number,onMaskClick:Function,scrollbarProps:Object,contentClass:String,contentStyle:[Object,String],trapFocus:{type:Boolean,default:!0},onEsc:Function,autoFocus:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},blockScroll:{type:Boolean,default:!0},maxWidth:Number,maxHeight:Number,minWidth:Number,minHeight:Number,resizable:Boolean,defaultWidth:{type:[Number,String],default:251},defaultHeight:{type:[Number,String],default:251},onUpdateWidth:[Function,Array],onUpdateHeight:[Function,Array],"onUpdate:width":[Function,Array],"onUpdate:height":[Function,Array],"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],onAfterEnter:Function,onAfterLeave:Function,drawerStyle:[String,Object],drawerClass:String,target:null,onShow:Function,onHide:Function}),y7=re({name:"Drawer",inheritAttrs:!1,props:r2,setup(e){const{mergedClsPrefixRef:t,namespaceRef:r,inlineThemeDisabled:n}=Ne(e),o=Ur(),i=ye("Drawer","-drawer",x7,o7,e,t),a=D(e.defaultWidth),l=D(e.defaultHeight),s=$t(ve(e,"width"),a),d=$t(ve(e,"height"),l),u=P(()=>{const{placement:k}=e;return k==="top"||k==="bottom"?"":zt(s.value)}),f=P(()=>{const{placement:k}=e;return k==="left"||k==="right"?"":zt(d.value)}),h=k=>{const{onUpdateWidth:R,"onUpdate:width":$}=e;R&&ue(R,k),$&&ue($,k),a.value=k},g=k=>{const{onUpdateHeight:R,"onUpdate:width":$}=e;R&&ue(R,k),$&&ue($,k),l.value=k},v=P(()=>[{width:u.value,height:f.value},e.drawerStyle||""]);function b(k){const{onMaskClick:R,maskClosable:$}=e;$&&S(!1),R&&R(k)}function m(k){b(k)}const p=my();function x(k){var R;(R=e.onEsc)===null||R===void 0||R.call(e),e.show&&e.closeOnEsc&&Zx(k)&&!p.value&&S(!1)}function S(k){const{onHide:R,onUpdateShow:$,"onUpdate:show":T}=e;$&&ue($,k),T&&ue(T,k),R&&!k&&ue(R,k)}ot(Sv,{isMountedRef:o,mergedThemeRef:i,mergedClsPrefixRef:t,doUpdateShow:S,doUpdateHeight:g,doUpdateWidth:h});const y=P(()=>{const{common:{cubicBezierEaseInOut:k,cubicBezierEaseIn:R,cubicBezierEaseOut:$},self:{color:T,textColor:z,boxShadow:F,lineHeight:_,headerPadding:N,footerPadding:j,borderRadius:H,bodyPadding:Y,titleFontSize:X,titleTextColor:le,titleFontWeight:ke,headerBorderBottom:be,footerBorderTop:Q,closeIconColor:L,closeIconColorHover:A,closeIconColorPressed:U,closeColorHover:ae,closeColorPressed:he,closeIconSize:Re,closeSize:Oe,closeBorderRadius:V,resizableTriggerColorHover:Te}}=i.value;return{"--n-line-height":_,"--n-color":T,"--n-border-radius":H,"--n-text-color":z,"--n-box-shadow":F,"--n-bezier":k,"--n-bezier-out":$,"--n-bezier-in":R,"--n-header-padding":N,"--n-body-padding":Y,"--n-footer-padding":j,"--n-title-text-color":le,"--n-title-font-size":X,"--n-title-font-weight":ke,"--n-header-border-bottom":be,"--n-footer-border-top":Q,"--n-close-icon-color":L,"--n-close-icon-color-hover":A,"--n-close-icon-color-pressed":U,"--n-close-size":Oe,"--n-close-color-hover":ae,"--n-close-color-pressed":he,"--n-close-icon-size":Re,"--n-close-border-radius":V,"--n-resize-trigger-color-hover":Te}}),C=n?Qe("drawer",void 0,y,e):void 0;return{mergedClsPrefix:t,namespace:r,mergedBodyStyle:v,handleOutsideClick:m,handleMaskClick:b,handleEsc:x,mergedTheme:i,cssVars:n?void 0:y,themeClass:C==null?void 0:C.themeClass,onRender:C==null?void 0:C.onRender,isMounted:o}},render(){const{mergedClsPrefix:e}=this;return c(bs,{to:this.to,show:this.show},{default:()=>{var t;return(t=this.onRender)===null||t===void 0||t.call(this),hr(c("div",{class:[`${e}-drawer-container`,this.namespace,this.themeClass],style:this.cssVars,role:"none"},this.showMask?c(At,{name:"fade-in-transition",appear:this.isMounted},{default:()=>this.show?c("div",{"aria-hidden":!0,class:[`${e}-drawer-mask`,this.showMask==="trans
margin-bottom: 10px;
display: flex;
flex-wrap: nowrap;
`,[w("dynamic-input-preset-input",{flex:1,alignItems:"center"}),w("dynamic-input-preset-pair",`
flex: 1;
display: flex;
align-items: center;
`,[w("dynamic-input-pair-input",[O("&:first-child",{"margin-right":"12px"})])]),M("action",`
align-self: flex-start;
display: flex;
justify-content: flex-end;
flex-shrink: 0;
flex-grow: 0;
margin: var(--action-margin);
`,[I("icon",{cursor:"pointer"})]),O("&:last-child",{marginBottom:0})]),w("form-item",`
padding-top: 0 !important;
margin-right: 0 !important;
`,[w("form-item-blank",{paddingTop:"0 !important"})])]),ad=new WeakMap,i2=Object.assign(Object.assign({},ye.props),{max:Number,min:{type:Number,default:0},value:Array,defaultValue:{type:Array,default:()=>[]},preset:{type:String,default:"input"},keyField:String,itemClass:String,itemStyle:[String,Object],keyPlaceholder:{type:String,default:""},valuePlaceholder:{type:String,default:""},placeholder:{type:String,default:""},disabled:Boolean,showSortButton:Boolean,createButtonProps:Object,onCreate:Function,onRemove:Function,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onClear:Function,onInput:[Function,Array]}),$7=re({name:"DynamicInput",props:i2,setup(e,{slots:t}){const{mergedComponentPropsRef:r,mergedClsPrefixRef:n,mergedRtlRef:o,inlineThemeDisabled:i}=Ne(),a=De(Ad,null),l=D(e.defaultValue),s=ve(e,"value"),d=$t(s,l),u=ye("DynamicInput","-dynamic-input",T7,k7,e,n),f=P(()=>{const{value:T}=d;if(Array.isArray(T)){const{max:z}=e;return z!==void 0&&T.length>=z}return!1}),h=P(()=>{const{value:T}=d;return Array.isArray(T)?T.length<=e.min:!0}),g=P(()=>{var T,z;return(z=(T=r==null?void 0:r.value)===null||T===void 0?void 0:T.DynamicInput)===null||z===void 0?void 0:z.buttonSize});function v(T){const{onInput:z,"onUpdate:value":F,onUpdateValue:_}=e;z&&ue(z,T),F&&ue(F,T),_&&ue(_,T),l.value=T}function b(T,z){if(T==null||typeof T!="object")return z;const F=zl(T)?Lt(T):T;let _=ad.get(F);return _===void 0&&ad.set(F,_=sn()),_}function m(T,z){const{value:F}=d,_=Array.from(F??[]),N=_[T];if(_[T]=z,N&&z&&typeof N=="object"&&typeof z=="object"){const j=zl(N)?Lt(N):N,H=zl(z)?Lt(z):z,Y=ad.get(j);Y!==void 0&&ad.set(H,Y)}v(_)}function p(){x(-1)}function x(T){const{value:z}=d,{onCreate:F}=e,_=Array.from(z??[]);if(F)_.splice(T+1,0,F(T+1)),v(_);else if(t.default)_.splice(T+1,0,null),v(_);else switch(e.preset){case"input":_.splice(T+1,0,""),v(_);break;case"pair":_.splice(T+1,0,{key:"",value:""}),v(_);break}}function S(T){const{value:z}=d;if(!Array.isArray(z))return;const{min:F}=e;if(z.length<=F)return;const{onRemove:_}=e;_&&_(T);const N=Array.from(z);N.splice(T,1),v(N)}function y(T,z,F){if(z<0||F<0||z>=T.length||F>=T.length||z===F)return;const _=T[z];T[z]=T[F],T[F]=_}function C(T,z){const{value:F}=d;if(!Array.isArray(F))return;const _=Array.from(F);T==="up"&&y(_,z,z-1),T==="down"&&y(_,z,z+1),v(_)}ot(Pg,{mergedThemeRef:u,keyPlaceholderRef:ve(e,"keyPlaceholder"),valuePlaceholderRef:ve(e,"valuePlaceholder"),placeholderRef:ve(e,"placeholder")});const k=Wt("DynamicInput",o,n),R=P(()=>{const{self:{actionMargin:T,actionMarginRtl:z}}=u.value;return{"--action-margin":T,"--action-margin-rtl":z}}),$=i?Qe("dynamic-input",void 0,R,e):void 0;return{locale:mr("DynamicInput").localeRef,rtlEnabled:k,buttonSize:g,mergedClsPrefix:n,NFormItem:a,uncontrolledValue:l,mergedValue:d,insertionDisabled:f,removeDisabled:h,handleCreateClick:p,ensureKey:b,handleValueChange:m,remove:S,move:C,createItem:x,mergedTheme:u,cssVars:i?void 0:R,themeClass:$==null?void 0:$.themeClass,onRender:$==null?void 0:$.onRender}},render(){const{$slots:e,itemClass:t,buttonSize:r,mergedClsPrefix:n,mergedValue:o,locale:i,mergedTheme:a,keyField:l,itemStyle:s,preset:d,showSortButton:u,NFormItem:f,ensureKey:h,handleValueChange:g,remove:v,createItem:b,move:m,onRender:p,disabled:x}=this;return p==null||p(),c("div",{class:[`${n}-dynamic-input`,this.rtlEnabled&&`${n}-dynamic-input--rtl`,this.themeClass],style:this.cssVars},!Array.isArray(o)||o.length===0?c(Dt,Object.assign({block:!0,ghost:!0,dashed:!0,size:r},this.createButtonProps,{disabled:this.insertionDisabled||x,theme:a.peers.Button,themeOverrides:a.peerOverrides.Button,onClick:this.handleCreateClick}),{default:()=>yt(e["create-button-default"],()=>[i.create]),icon:()=>yt(e["create-button-icon"],()=>[c(ut,{clsPrefix:n},{default:()=>c(Ja,null)})])}):o.map((S,y)=>c("div",{key:l?S[l]:h(S,y),"data-key":l?S[l]:h(S,y),class:[`${n}-dynamic-input-item`,t],style:s},mi(e.default,{value:o[y],index:y},()=>[d==="input"?c(R7,{disabled:x,clsPrefix:n,value:o[y],parentPath:f?f.path.value:void 0,path:f!=null&&f.path.value?`${f.path.value}[${y}]`:void 0,onUp
width: 100%;
display: inline-flex;
align-items: flex-start;
align-content: space-around;
`,[w("form-item",{width:"auto",marginRight:"18px"},[O("&:last-child",{marginRight:0})])])]),Ps="n-form",m2="n-form-item-insts";var U7=function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function l(u){try{d(n.next(u))}catch(f){a(f)}}function s(u){try{d(n.throw(u))}catch(f){a(f)}}function d(u){u.done?i(u.value):o(u.value).then(l,s)}d((n=n.apply(e,t||[])).next())})};const b2=Object.assign(Object.assign({},ye.props),{inline:Boolean,labelWidth:[Number,String],labelAlign:String,labelPlacement:{type:String,default:"top"},model:{type:Object,default:()=>{}},rules:Object,disabled:Boolean,size:String,showRequireMark:{type:Boolean,default:void 0},requireMarkPlacement:String,showFeedback:{type:Boolean,default:!0},onSubmit:{type:Function,default:e=>{e.preventDefault()}},showLabel:{type:Boolean,default:void 0},validateMessages:Object}),W7=re({name:"Form",props:b2,setup(e){const{mergedClsPrefixRef:t}=Ne(e);ye("Form","-form",V7,p2,e,t);const r={},n=D(void 0),o=s=>{const d=n.value;(d===void 0||s>=d)&&(n.value=s)};function i(s){return U7(this,arguments,void 0,function*(d,u=()=>!0){return yield new Promise((f,h)=>{const g=[];for(const v of Yr(r)){const b=r[v];for(const m of b)m.path&&g.push(m.internalValidate(null,u))}Promise.all(g).then(v=>{const b=v.some(x=>!x.valid),m=[],p=[];v.forEach(x=>{var S,y;!((S=x.errors)===null||S===void 0)&&S.length&&m.push(x.errors),!((y=x.warnings)===null||y===void 0)&&y.length&&p.push(x.warnings)}),d&&d(m.length?m:void 0,{warnings:p.length?p:void 0}),b?h(m.length?m:void 0):f({warnings:p.length?p:void 0})})})})}function a(){for(const s of Yr(r)){const d=r[s];for(const u of d)u.restoreValidation()}}return ot(Ps,{props:e,maxChildLabelWidthRef:n,deriveMaxChildLabelWidth:o}),ot(m2,{formItems:r}),Object.assign({validate:i,restoreValidation:a},{mergedClsPrefix:t})},render(){const{mergedClsPrefix:e}=this;return c("form",{class:[`${e}-form`,this.inline&&`${e}-form--inline`],onSubmit:this.onSubmit},this.$slots)}});function Ki(){return Ki=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ki.apply(this,arguments)}function K7(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,is(e,t)}function Ih(e){return Ih=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ih(e)}function is(e,t){return is=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},is(e,t)}function q7(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Sd(e,t,r){return q7()?Sd=Reflect.construct.bind():Sd=function(o,i,a){var l=[null];l.push.apply(l,i);var s=Function.bind.apply(o,l),d=new s;return a&&is(d,a.prototype),d},Sd.apply(null,arguments)}function Y7(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Fh(e){var t=typeof Map=="function"?new Map:void 0;return Fh=function(n){if(n===null||!Y7(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(n))return t.get(n);t.set(n,o)}function o(){return Sd(n,arguments,Ih(this).constructor)}return o.prototype=Object.create(n.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),is(o,n)},Fh(e)}var G7=/%[sdj%]/g,X7=function(){};function Dh(e){if(!e||!e.length)return null;var t={};return e.forEach(function(r){var n=r.field;t[n]=t[n]||[],t[n].push(r)}),t}function Pn(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var o=0,i=r.length;if(typeof e=="function")return e.apply(null,r);if(typeof e=="string"){var a=e.replace(G7,function(l){if(l==="%%")return"%";if(o>=i)return l;switch(l){case"%s":return String(r[o++]);case"%d":return Number(r[o++]);case"%j":try{return JSON.stringify(r[o+
(?:
(?:`+n+":){7}(?:"+n+`|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
(?:`+n+":){6}(?:"+r+"|:"+n+`|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4
(?:`+n+":){5}(?::"+r+"|(?::"+n+`){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4
(?:`+n+":){4}(?:(?::"+n+"){0,1}:"+r+"|(?::"+n+`){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4
(?:`+n+":){3}(?:(?::"+n+"){0,2}:"+r+"|(?::"+n+`){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4
(?:`+n+":){2}(?:(?::"+n+"){0,3}:"+r+"|(?::"+n+`){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4
(?:`+n+":){1}(?:(?::"+n+"){0,4}:"+r+"|(?::"+n+`){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4
(?::(?:(?::`+n+"){0,5}:"+r+"|(?::"+n+`){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4
)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1
`).replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),i=new RegExp("(?:^"+r+"$)|(?:^"+o+"$)"),a=new RegExp("^"+r+"$"),l=new RegExp("^"+o+"$"),s=function(y){return y&&y.exact?i:new RegExp("(?:"+t(y)+r+t(y)+")|(?:"+t(y)+o+t(y)+")","g")};s.v4=function(S){return S&&S.exact?a:new RegExp(""+t(S)+r+t(S),"g")},s.v6=function(S){return S&&S.exact?l:new RegExp(""+t(S)+o+t(S),"g")};var d="(?:(?:[a-z]+:)?//)",u="(?:\\S+(?::\\S*)?@)?",f=s.v4().source,h=s.v6().source,g="(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)",v="(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*",b="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",m="(?::\\d{2,5})?",p='(?:[/?#][^\\s"]*)?',x="(?:"+d+"|www\\.)"+u+"(?:localhost|"+f+"|"+h+"|"+g+v+b+")"+m+p;return ld=new RegExp("(?:^"+x+"$)","i"),ld},Hb={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},Tl={integer:function(t){return Tl.number(t)&&parseInt(t,10)===t},float:function(t){return Tl.number(t)&&!Tl.integer(t)},array:function(t){return Array.isArray(t)},regexp:function(t){if(t instanceof RegExp)return!0;try{return!!new RegExp(t)}catch{return!1}},date:function(t){return typeof t.getTime=="function"&&typeof t.getMonth=="function"&&typeof t.getYear=="function"&&!isNaN(t.getTime())},number:function(t){return isNaN(t)?!1:typeof t=="number"},object:function(t){return typeof t=="object"&&!Tl.array(t)},method:function(t){return typeof t=="function"},email:function(t){return typeof t=="string"&&t.length<=320&&!!t.match(Hb.email)},url:function(t){return typeof t=="string"&&t.length<=2048&&!!t.match(oH())},hex:function(t){return typeof t=="string"&&!!t.match(Hb.hex)}},iH=function(t,r,n,o,i){if(t.required&&r===void 0){x2(t,r,n,o,i);return}var a=["integer","float","array","regexp","object","method","email","number","date","url","hex"],l=t.type;a.indexOf(l)>-1?Tl[l](r)||o.push(Pn(i.messages.types[l],t.fullField,t.type)):l&&typeof r!==t.type&&o.push(Pn(i.messages.types[l],t.fullField,t.type))},aH=function(t,r,n,o,i){var a=typeof t.len=="number",l=typeof t.min=="number",s=typeof t.max=="number",d=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,u=r,f=null,h=typeof r=="number",g=typeof r=="string",v=Array.isArray(r);if(h?f="number":g?f="string":v&&(f="array"),!f)return!1;v&&(u=r.length),g&&(u=r.replace(d,"_").length),a?u!==t.len&&o.push(Pn(i.messages[f].len,t.fullField,t.len)):l&&!s&&u<t.min?o.push(Pn(i.messages[f].min,t.fullField,t.min)):s&&!l&&u>t.max?o.push(Pn(i.messages[f].max,t.fullField,t.max)):l&&s&&(u<t.min||u>t.max)&&o.push(Pn(i.messages[f].range,t.fullField,t.min,t.max))},Da="enum",lH=function(t,r,n,o,i){t[Da]=Array.isArray(t[Da])?t[Da]:[],t[Da].indexOf(r)===-1&&o.push(Pn(i.messages[Da],t.fullField,t[Da].join(", ")))},sH=function(t,r,n,o,i){if(t.pattern){if(t.pattern instanceof RegExp)t.pattern.lastIndex=0,t.pattern.test(r)||o.push(Pn(i.messages.pattern.mismatch,t.fullField,r,t.pattern));else if(typeof t.pattern=="string"){var a=new RegExp(t.pattern);a.test(r)||o.push(Pn(i.messages.pattern.mismatch,t.fullField,r,t.pattern))}}},Vt={required:x2,whitespace:nH,type:iH,range:aH,enum:lH,pattern:sH},dH=function(t,r,n,o,i){var a=[],l=t.required||!t.required&&o.hasOwnProperty(t.field);if(l){if(Vr(r,"string")&&!t.required)return n();Vt.required(t,r,o,a,i,"string"),Vr(r,"string")||(Vt.type(t,r,o,a,i),Vt.range(t,r,o,a,i),Vt.pattern(t,r,o,a,i),t.whitespace===!0&&Vt.whitespace(t,r,o,a,i))}n(a)},cH=function(t,r,n,o,i){var a=[],l=t.required||!t.required&&o.hasOwnProperty(t.field);if(l){if(Vr(r)&&!t.required)return n();Vt.required(t,r,o,a,i),r!==void 0&&Vt.type(t,r,o,a,i)}n(a)},uH=function(t,r,n,o,i){var a=[],l=t.required||!t.required&&o.hasOwnProperty(t.field);if(l){if(r===""&&(r=void 0),Vr(r)&&!t.required)return n();Vt.required(t,r,o,a,i),r!==void 0&&(Vt.type(t,r,o,a,i),Vt.range(t,r,o,a,i))}n(a)},fH=function(t,r,n,o,i){var a=[],l=t.required||!t.required&&o.hasOwnProperty(t.field);if(l){if(Vr(r)&&!t.requir
display: grid;
line-height: var(--n-line-height);
`,[w("form-item-label",`
grid-area: label;
align-items: center;
line-height: 1.25;
text-align: var(--n-label-text-align);
font-size: var(--n-label-font-size);
min-height: var(--n-label-height);
padding: var(--n-label-padding);
color: var(--n-label-text-color);
transition: color .3s var(--n-bezier);
box-sizing: border-box;
font-weight: var(--n-label-font-weight);
`,[M("asterisk",`
white-space: nowrap;
user-select: none;
-webkit-user-select: none;
color: var(--n-asterisk-color);
transition: color .3s var(--n-bezier);
`),M("asterisk-placeholder",`
grid-area: mark;
user-select: none;
-webkit-user-select: none;
visibility: hidden;
`)]),w("form-item-blank",`
grid-area: blank;
min-height: var(--n-blank-height);
`),I("auto-label-width",[w("form-item-label","white-space: nowrap;")]),I("left-labelled",`
grid-template-areas:
"label blank"
"label feedback";
grid-template-columns: auto minmax(0, 1fr);
grid-template-rows: auto 1fr;
align-items: flex-start;
`,[w("form-item-label",`
display: grid;
grid-template-columns: 1fr auto;
min-height: var(--n-blank-height);
height: auto;
box-sizing: border-box;
flex-shrink: 0;
flex-grow: 0;
`,[I("reverse-columns-space",`
grid-template-columns: auto 1fr;
`),I("left-mark",`
grid-template-areas:
"mark text"
". text";
`),I("right-mark",`
grid-template-areas:
"text mark"
"text .";
`),I("right-hanging-mark",`
grid-template-areas:
"text mark"
"text .";
`),M("text",`
grid-area: text;
`),M("asterisk",`
grid-area: mark;
align-self: end;
`)])]),I("top-labelled",`
grid-template-areas:
"label"
"blank"
"feedback";
grid-template-rows: minmax(var(--n-label-height), auto) 1fr;
grid-template-columns: minmax(0, 100%);
`,[I("no-label",`
grid-template-areas:
"blank"
"feedback";
grid-template-rows: 1fr;
`),w("form-item-label",`
display: flex;
align-items: flex-start;
justify-content: var(--n-label-text-align);
`)]),w("form-item-blank",`
box-sizing: border-box;
display: flex;
align-items: center;
position: relative;
`),w("form-item-feedback-wrapper",`
grid-area: feedback;
box-sizing: border-box;
min-height: var(--n-feedback-height);
font-size: var(--n-feedback-font-size);
line-height: 1.25;
transform-origin: top left;
`,[O("&:not(:empty)",`
padding: var(--n-feedback-padding);
`),w("form-item-feedback",{transition:"color .3s var(--n-bezier)",color:"var(--n-feedback-text-color)"},[I("warning",{color:"var(--n-feedback-text-color-warning)"}),I("error",{color:"var(--n-feedback-text-color-error)"}),TH({fromOffset:"-3px",enterDuration:".3s",leaveDuration:".2s"})])])]);var Vb=function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function l(u){try{d(n.next(u))}catch(f){a(f)}}function s(u){try{d(n.throw(u))}catch(f){a(f)}}function d(u){u.done?i(u.value):o(u.value).then(l,s)}d((n=n.apply(e,t||[])).next())})};const Ts=Object.assign(Object.assign({},ye.props),{label:String,labelWidth:[Number,String],labelStyle:[String,Object],labelAlign:String,labelPlacement:String,path:String,first:Boolean,rulePath:String,required:Boolean,showRequireMark:{type:Boolean,default:void 0},requireMarkPlacement:String,showFeedback:{type:Boolean,default:void 0},rule:[Object,Array],size:String,ignorePathChange:Boolean,validationStatus:String,feedback:String,feedbackClass:String,feedbackStyle:[String,Object],showLabel:{type:Boolean,default:void 0},labelProps:Object}),y2=Yr(Ts);function Ub(e,t){return(...r)=>{try{const n=e(...r);return!t&&(typeof n=="boolean"||n instanceof Error||Array.isArray(n))||n!=null&&n.then?n:(n===void 0||Qr("form-item/validate",`You return a ${typeof n} typed value in the validator method, which is not recommended. Please use `+(t?"`Promise`":"`boolean`, `Error` or `Promise`")+" typed value instead."),!0)}catch(n){Qr("form-item/validate","An error is catched in the validation, so the validation won't be done. Your callback in `validate` method of `n-form` or `n-form-item` won't be called in this validation."),console.error(n);return}}}const Tg=re({name:"FormItem",props:Ts,setup(e){H3(m2,"formItems",ve(e,"path"));const{mergedClsPrefixRef:t,inlineThemeDisabled:r}=Ne(e),n=De(Ps,null),o=kH(e),i=RH(e),{validationErrored:a,validationWarned:l}=i,{mergedRequired:s,mergedRules:d}=PH(e),{mergedSize:u}=o,{mergedLabelPlacement:f,mergedLabelAlign:h,mergedRequireMarkPlacement:g}=i,v=D([]),b=D(sn()),m=n?ve(n.props,"disabled"):D(!1),p=ye("Form","-form-item",$H,p2,e,t);ft(ve(e,"path"),()=>{e.ignorePathChange||x()});function x(){v.value=[],a.value=!1,l.value=!1,e.feedback&&(b.value=sn())}function S(){$("blur")}function y(){$("change")}function C(){$("focus")}function k(){$("input")}function R(j,H){return Vb(this,void 0,void 0,function*(){let Y,X,le,ke;return typeof j=="string"?(Y=j,X=H):j!==null&&typeof j=="object"&&(Y=j.trigger,X=j.callback,le=j.shouldRuleBeApplied,ke=j.options),yield new Promise((be,Q)=>{$(Y,le,ke).then(({valid:L,errors:A,warnings:U})=>{L?(X&&X(void 0,{warnings:U}),be({warnings:U})):(X&&X(A,{warnings:U}),Q(A))})})})}const $=(...j)=>Vb(this,[...j],void 0,function*(H=null,Y=()=>!0,X={suppressWarning:!0}){const{path:le}=e;X?X.first||(X.first=e.first):X={};const{value:ke}=d,be=n?ts(n.props.model,le||""):void 0,Q={},L={},A=(H?ke.filter(Ve=>Array.isArray(Ve.trigger)?Ve.trigger.includes(H):Ve.trigger===H):ke).filter(Y).map((Ve,E)=>{const W=Object.assign({},Ve);if(W.validator&&(W.validator=Ub(W.validator,!1)),W.asyncValidator&&(W.asyncValidator=Ub(W.asyncValidator,!0)),W.renderMessage){const ie=`__renderMessage__${E}`;L[ie]=W.message,W.message=ie,Q[ie]=W.renderMessage}return W}),U=A.filter(Ve=>Ve.level!=="warning"),ae=A.filter(Ve=>Ve.level==="warning"),he=le??"__n_no_path__",Re=new rl({[he]:U}),Oe=new rl({[he]:ae}),{validateMessages:V}=(n==null?void 0:n.props)||{};V&&(Re.messages(V),Oe.messages(V));const Te=Ve=>{v.value=Ve.map(E=>{const W=(E==null?void 0:E.message)||"";return{key:W,render:()=>W.startsWith("__renderMessage__")?Q[W]():W}}),Ve.forEach(E=>{var W;!((W=E.message)===null||W===void 0)&&W.startsWith("__renderMessage__")&&(E.message=L[E.message])})},Me={valid:!0,errors:void 0,warnings:void 0};if(U.length){const Ve=yield new Promise(E=>{Re.validate({[he]:be},X,E)});Ve!=null&&Ve.length&&(a.value=!0,Me.valid=!1,Me.errors=Ve,Te(Ve))}if(ae.length&&!Me.errors){const Ve=yield new Promise(E=>{Oe.validate({[he]:be},X,E)});Ve!=null&&Ve.length&&(Te(
position: relative;
`),I("square-shape",`
background-color: var(--n-color);
cursor: pointer;
display: flex;
width: fit-content;
align-items: center;
justify-content: center;
border-radius: var(--n-border-radius-square);
flex-direction: column;
box-shadow: var(--n-box-shadow);
transition:
color .3s var(--n-bezier),
box-shadow .3s var(--n-bezier),
background-color .3s var(--n-bezier);
`,[w("float-button",`
background-color: unset;
border-radius: 0;
box-shadow: none;
box-sizing: content-box;
`,[O("&:not(:last-child)",`
border-bottom: 1px solid var(--n-button-border-color);
`),O("&:first-child",`
border-top-left-radius: 4px;
border-top-right-radius: 4px;
`),O("&:last-child",`
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
`),M("fill","inset: 4px; border-radius: var(--n-border-radius-square);")])]),I("circle-shape",[O(">:not(:last-child)",`
margin-bottom: 16px;
`)])]),BH={closeMargin:"16px 12px",closeSize:"20px",closeIconSize:"16px",width:"365px",padding:"16px",titleFontSize:"16px",metaFontSize:"12px",descriptionFontSize:"12px"},T2=e=>{const{textColor2:t,successColor:r,infoColor:n,warningColor:o,errorColor:i,popoverColor:a,closeIconColor:l,closeIconColorHover:s,closeIconColorPressed:d,closeColorHover:u,closeColorPressed:f,textColor1:h,textColor3:g,borderRadius:v,fontWeightStrong:b,boxShadow2:m,lineHeight:p,fontSize:x}=e;return Object.assign(Object.assign({},BH),{borderRadius:v,lineHeight:p,fontSize:x,headerFontWeight:b,iconColor:t,iconColorSuccess:r,iconColorInfo:n,iconColorWarning:o,iconColorError:i,color:a,textColor:t,closeIconColor:l,closeIconColorHover:s,closeIconColorPressed:d,closeBorderRadius:v,closeColorHover:u,closeColorPressed:f,headerTextColor:h,descriptionTextColor:g,actionTextColor:t,boxShadow:m})},NH={name:"Notification",common:tt,peers:{Scrollbar:yn},self:T2},LH={name:"Notification",common:et,peers:{Scrollbar:Cn},self:T2},HH={margin:"0 0 8px 0",padding:"10px 20px",maxWidth:"720px",minWidth:"420px",iconMargin:"0 10px 0 0",closeMargin:"0 0 0 10px",closeSize:"20px",closeIconSize:"16px",iconSize:"20px",fontSize:"14px"},$2=e=>{const{textColor2:t,closeIconColor:r,closeIconColorHover:n,closeIconColorPressed:o,infoColor:i,successColor:a,errorColor:l,warningColor:s,popoverColor:d,boxShadow2:u,primaryColor:f,lineHeight:h,borderRadius:g,closeColorHover:v,closeColorPressed:b}=e;return Object.assign(Object.assign({},HH),{closeBorderRadius:g,textColor:t,textColorInfo:t,textColorSuccess:t,textColorError:t,textColorWarning:t,textColorLoading:t,color:d,colorInfo:d,colorSuccess:d,colorError:d,colorWarning:d,colorLoading:d,boxShadow:u,boxShadowInfo:u,boxShadowSuccess:u,boxShadowError:u,boxShadowWarning:u,boxShadowLoading:u,iconColor:t,iconColorInfo:i,iconColorSuccess:a,iconColorWarning:s,iconColorError:l,iconColorLoading:f,closeColorHover:v,closeColorPressed:b,closeIconColor:r,closeIconColorHover:n,closeIconColorPressed:o,closeColorHoverInfo:v,closeColorPressedInfo:b,closeIconColorInfo:r,closeIconColorHoverInfo:n,closeIconColorPressedInfo:o,closeColorHoverSuccess:v,closeColorPressedSuccess:b,closeIconColorSuccess:r,closeIconColorHoverSuccess:n,closeIconColorPressedSuccess:o,closeColorHoverError:v,closeColorPressedError:b,closeIconColorError:r,closeIconColorHoverError:n,closeIconColorPressedError:o,closeColorHoverWarning:v,closeColorPressedWarning:b,closeIconColorWarning:r,closeIconColorHoverWarning:n,closeIconColorPressedWarning:o,closeColorHoverLoading:v,closeColorPressedLoading:b,closeIconColorLoading:r,closeIconColorHoverLoading:n,closeIconColorPressedLoading:o,loadingColor:f,lineHeight:h,borderRadius:g})},jH={name:"Message",common:tt,self:$2},VH={name:"Message",common:et,self:$2},UH={name:"ButtonGroup",common:et},WH={name:"GradientText",common:et,self(e){const{primaryColor:t,successColor:r,warningColor:n,errorColor:o,infoColor:i,primaryColorSuppl:a,successColorSuppl:l,warningColorSuppl:s,errorColorSuppl:d,infoColorSuppl:u,fontWeightStrong:f}=e;return{fontWeight:f,rotate:"252deg",colorStartPrimary:t,colorEndPrimary:a,colorStartInfo:i,colorEndInfo:u,colorStartWarning:n,colorEndWarning:s,colorStartError:o,colorEndError:d,colorStartSuccess:r,colorEndSuccess:l}}},KH=e=>{const{primaryColor:t,successColor:r,warningColor:n,errorColor:o,infoColor:i,fontWeightStrong:a}=e;return{fontWeight:a,rotate:"252deg",colorStartPrimary:je(t,{alpha:.6}),colorEndPrimary:t,colorStartInfo:je(i,{alpha:.6}),colorEndInfo:i,colorStartWarning:je(n,{alpha:.6}),colorEndWarning:n,colorStartError:je(o,{alpha:.6}),colorEndError:o,colorStartSuccess:je(r,{alpha:.6}),colorEndSuccess:r}},qH={name:"GradientText",common:tt,self:KH},YH={name:"InputNumber",common:et,peers:{Button:Sn,Input:Xn},self(e){const{textColorDisabled:t}=e;return{iconColorDisabled:t}}},GH=e=>{const{textColorDisabled:t}=e;return{iconColorDisabled:t}},XH={name:"InputNumber",common:tt,peers:{Button:wn,Input:Dn},self:GH},ZH={name:"Layout",common:et,peers:{Scrollbar:Cn},self(e){const{textColor2:t,bodyColor:r,popoverColor:n,cardColor:o,dividerColor:i,s
user-select: none;
cursor: pointer;
color: var(--n-text-color);
background-color: var(--n-color);
font-size: 18px;
transition:
color .3s var(--n-bezier),
border-color .3s var(--n-bezier),
box-shadow .3s var(--n-bezier),
background-color .3s var(--n-bezier);
box-shadow: var(--n-box-shadow);
display: flex;
align-items: stretch;
box-sizing: border-box;
`,[I("circle-shape",`
border-radius: 4096px;
`),I("square-shape",`
border-radius: var(--n-border-radius-square);
`),M("fill",`
position: absolute;
inset: 0;
transition: background-color .3s var(--n-bezier);
border-radius: inherit;
`),M("body",`
position: relative;
flex-grow: 1;
display: flex;
align-items: center;
justify-content: center;
transition: transform .3s var(--n-bezier), opacity .3s var(--n-bezier);
border-radius: inherit;
flex-direction: column;
box-sizing: border-box;
padding: 2px 4px;
gap: 2px;
transform: scale(1);
`,[M("description",`
font-size: 12px;
text-align: center;
line-height: 14px;
`)]),O("&:hover","box-shadow: var(--n-box-shadow-hover);",[O(">",[M("fill",`
background-color: var(--n-color-hover);
`)])]),O("&:active","box-shadow: var(--n-box-shadow-pressed);",[O(">",[M("fill",`
background-color: var(--n-color-pressed);
`)])]),I("show-menu",[O(">",[M("menu",`
pointer-events: all;
bottom: 100%;
opacity: 1;
`),M("close",`
transform: scale(1);
opacity: 1;
`),M("body",`
transform: scale(0.75);
opacity: 0;
`)])]),M("close",`
opacity: 0;
transform: scale(0.75);
position: absolute;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
transition: transform .3s var(--n-bezier), opacity .3s var(--n-bezier);
`),M("menu",`
position: absolute;
bottom: calc(100% - 8px);
display: flex;
flex-direction: column;
opacity: 0;
pointer-events: none;
transition:
opacity .3s var(--n-bezier),
bottom .3s var(--n-bezier);
`,[O("> *",`
margin-bottom: 16px;
`),w("float-button",`
position: relative !important;
`)])]),ek=Object.assign(Object.assign({},ye.props),{width:{type:[Number,String],default:40},height:{type:[Number,String],default:40},left:[Number,String],right:[Number,String],top:[Number,String],bottom:[Number,String],shape:{type:String,default:"circle"},position:{type:String,default:"fixed"},type:{type:String,default:"default"},menuTrigger:String,showMenu:{type:Boolean,default:void 0},onUpdateShowMenu:{type:[Function,Array],default:void 0},"onUpdate:showMenu":{type:[Function,Array],default:void 0}}),gj=re({name:"FloatButton",props:ek,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:r}=Ne(e),n=ye("FloatButton","-float-button",vj,hj,e,t),o=De(J2,null),i=D(!1),a=ve(e,"showMenu"),l=$t(a,i);function s(m){const{onUpdateShowMenu:p,"onUpdate:showMenu":x}=e;i.value=m,p&&ue(p,m),x&&ue(x,m)}const d=P(()=>{const{self:{color:m,textColor:p,boxShadow:x,boxShadowHover:S,boxShadowPressed:y,colorHover:C,colorPrimary:k,colorPrimaryHover:R,textColorPrimary:$,borderRadiusSquare:T,colorPressed:z,colorPrimaryPressed:F},common:{cubicBezierEaseInOut:_}}=n.value,{type:N}=e;return{"--n-bezier":_,"--n-box-shadow":x,"--n-box-shadow-hover":S,"--n-box-shadow-pressed":y,"--n-color":N==="primary"?k:m,"--n-text-color":N==="primary"?$:p,"--n-color-hover":N==="primary"?R:C,"--n-color-pressed":N==="primary"?F:z,"--n-border-radius-square":T}}),u=P(()=>{const{width:m,height:p}=e;return Object.assign({position:o?void 0:e.position,width:zt(m),minHeight:zt(p)},o?null:{left:zt(e.left),right:zt(e.right),top:zt(e.top),bottom:zt(e.bottom)})}),f=P(()=>o?o.shapeRef.value:e.shape),h=()=>{e.menuTrigger==="hover"&&s(!0)},g=()=>{e.menuTrigger==="hover"&&l.value&&s(!1)},v=m=>{e.menuTrigger==="click"&&s(!l.value)},b=r?Qe("float-button",P(()=>e.type[0]),d,e):void 0;return{inlineStyle:u,cssVars:r?void 0:d,mergedClsPrefix:t,mergedShape:f,mergedShowMenu:l,themeClass:b==null?void 0:b.themeClass,onRender:b==null?void 0:b.onRender,Mouseenter:h,handleMouseleave:g,handleClick:v}},render(){var e;const{mergedClsPrefix:t,cssVars:r,mergedShape:n,type:o,menuTrigger:i,mergedShowMenu:a,themeClass:l,$slots:s,inlineStyle:d,onRender:u}=this,f=[[iy,this.handleMouseleave]];return u==null||u(),hr(c("div",{class:[`${t}-float-button`,`${t}-float-button--${n}-shape`,`${t}-float-button--${o}-type`,a&&`${t}-float-button--show-menu`,l],style:[r,d],onMouseenter:this.Mouseenter,onMouseleave:this.handleMouseleave,onClick:this.handleClick,role:"button"},c("div",{class:`${t}-float-button__fill`,"aria-hidden":!0}),c("div",{class:`${t}-float-button__body`},(e=s.default)===null||e===void 0?void 0:e.call(s),Tt(s.description,h=>h?c("div",{class:`${t}-float-button__description`},h):null)),i?c("div",{class:`${t}-float-button__close`},c(ut,{clsPrefix:t},{default:()=>c(Xv,null)})):null,i?c("div",{onClick:h=>{h.stopPropagation()},"data-float-button-menu":!0,class:`${t}-float-button__menu`},yt(s.menu,()=>[])):null),f)}}),pj=re({name:"GlobalStyle",setup(){if(typeof document>"u")return;const e=De(In,null),{body:t}=document,{style:r}=t;let n=!1,o=!0;Lo(()=>{Et(()=>{var i,a;const{textColor2:l,fontSize:s,fontFamily:d,bodyColor:u,cubicBezierEaseInOut:f,lineHeight:h}=e?Ba({},((i=e.mergedThemeRef.value)===null||i===void 0?void 0:i.common)||tt,(a=e.mergedThemeOverridesRef.value)===null||a===void 0?void 0:a.common):tt;if(n||!t.hasAttribute("n-styled")){r.setProperty("-webkit-text-size-adjust","100%"),r.setProperty("-webkit-tap-highlight-color","transparent"),r.padding="0",r.margin="0",r.backgroundColor=u,r.color=l,r.fontSize=s,r.fontFamily=d,r.lineHeight=h;const g=`color .3s ${f}, background-color .3s ${f}`;o?setTimeout(()=>{r.transition=g},0):r.transition=g,t.setAttribute("n-styled",""),n=!0,o=!1}})}),ds(()=>{n&&t.removeAttribute("n-styled")})},render(){return null}}),mj=w("gradient-text",`
display: inline-block;
font-weight: var(--n-font-weight);
-webkit-background-clip: text;
background-clip: text;
color: #0000;
white-space: nowrap;
background-image: linear-gradient(var(--n-rotate), var(--n-color-start) 0%, var(--n-color-end) 100%);
transition:
--n-color-start .3s var(--n-bezier),
--n-color-end .3s var(--n-bezier);
`),tk=Object.assign(Object.assign({},ye.props),{size:[String,Number],fontSize:[String,Number],type:{type:String,default:"primary"},color:[Object,String],gradient:[Object,String]}),bj=re({name:"GradientText",props:tk,setup(e){kv();const{mergedClsPrefixRef:t,inlineThemeDisabled:r}=Ne(e),n=P(()=>{const{type:d}=e;return d==="danger"?"error":d}),o=P(()=>{let d=e.size||e.fontSize;return d&&(d=zt(d)),d||void 0}),i=P(()=>{const d=e.color||e.gradient;if(typeof d=="string")return d;if(d){const u=d.deg||0,f=d.from,h=d.to;return`linear-gradient(${u}deg, ${f} 0%, ${h} 100%)`}}),a=ye("GradientText","-gradient-text",mj,qH,e,t),l=P(()=>{const{value:d}=n,{common:{cubicBezierEaseInOut:u},self:{rotate:f,[Ce("colorStart",d)]:h,[Ce("colorEnd",d)]:g,fontWeight:v}}=a.value;return{"--n-bezier":u,"--n-rotate":f,"--n-color-start":h,"--n-color-end":g,"--n-font-weight":v}}),s=r?Qe("gradient-text",P(()=>n.value[0]),l,e):void 0;return{mergedClsPrefix:t,compatibleType:n,styleFontSize:o,styleBgImage:i,cssVars:r?void 0:l,themeClass:s==null?void 0:s.themeClass,onRender:s==null?void 0:s.onRender}},render(){const{mergedClsPrefix:e,onRender:t}=this;return t==null||t(),c("span",{class:[`${e}-gradient-text`,`${e}-gradient-text--${this.compatibleType}-type`,this.themeClass],style:[{fontSize:this.styleFontSize,backgroundImage:this.styleBgImage},this.cssVars]},this.$slots)}}),xj={xs:0,s:640,m:1024,l:1280,xl:1536,xxl:1920},rk=24,qu="__ssr__",nk={layoutShiftDisabled:Boolean,responsive:{type:[String,Boolean],default:"self"},cols:{type:[Number,String],default:rk},itemResponsive:Boolean,collapsed:Boolean,collapsedRows:{type:Number,default:1},itemStyle:[Object,String],xGap:{type:[Number,String],default:0},yGap:{type:[Number,String],default:0}},yj=re({name:"Grid",inheritAttrs:!1,props:nk,setup(e){const{mergedClsPrefixRef:t,mergedBreakpointsRef:r}=Ne(e),n=/^\d+$/,o=D(void 0),i=rz((r==null?void 0:r.value)||xj),a=ct(()=>!!(e.itemResponsive||!n.test(e.cols.toString())||!n.test(e.xGap.toString())||!n.test(e.yGap.toString()))),l=P(()=>{if(a.value)return e.responsive==="self"?o.value:i.value}),s=ct(()=>{var p;return(p=Number(ka(e.cols.toString(),l.value)))!==null&&p!==void 0?p:rk}),d=ct(()=>ka(e.xGap.toString(),l.value)),u=ct(()=>ka(e.yGap.toString(),l.value)),f=p=>{o.value=p.contentRect.width},h=p=>{ta(f,p)},g=D(!1),v=P(()=>{if(e.responsive==="self")return h}),b=D(!1),m=D();return Bt(()=>{const{value:p}=m;p&&p.hasAttribute(qu)&&(p.removeAttribute(qu),b.value=!0)}),ot(C2,{layoutShiftDisabledRef:ve(e,"layoutShiftDisabled"),isSsrRef:b,itemStyleRef:ve(e,"itemStyle"),xGapRef:d,overflowRef:g}),{isSsr:!dn,contentEl:m,mergedClsPrefix:t,style:P(()=>e.layoutShiftDisabled?{width:"100%",display:"grid",gridTemplateColumns:`repeat(${e.cols}, minmax(0, 1fr))`,columnGap:yr(e.xGap),rowGap:yr(e.yGap)}:{width:"100%",display:"grid",gridTemplateColumns:`repeat(${s.value}, minmax(0, 1fr))`,columnGap:yr(d.value),rowGap:yr(u.value)}),isResponsive:a,responsiveQuery:l,responsiveCols:s,handleResize:v,overflow:g}},render(){if(this.layoutShiftDisabled)return c("div",Hr({ref:"contentEl",class:`${this.mergedClsPrefix}-grid`,style:this.style},this.$attrs),this.$slots);const e=()=>{var t,r,n,o,i,a,l;this.overflow=!1;const s=zn(il(this)),d=[],{collapsed:u,collapsedRows:f,responsiveCols:h,responsiveQuery:g}=this;s.forEach(x=>{var S,y,C,k,R;if(((S=x==null?void 0:x.type)===null||S===void 0?void 0:S.__GRID_ITEM__)!==!0)return;if(g3(x)){const z=ln(x);z.props?z.props.privateShow=!1:z.props={privateShow:!1},d.push({child:z,rawChildSpan:0});return}x.dirs=((y=x.dirs)===null||y===void 0?void 0:y.filter(({dir:z})=>z!==_n))||null,((C=x.dirs)===null||C===void 0?void 0:C.length)===0&&(x.dirs=null);const $=ln(x),T=Number((R=ka((k=$.props)===null||k===void 0?void 0:k.span,g))!==null&&R!==void 0?R:Wb);T!==0&&d.push({child:$,rawChildSpan:T})});let v=0;const b=(t=d[d.length-1])===null||t===void 0?void 0:t.child;if(b!=null&&b.props){const x=(r=b.props)===null||r===void 0?void 0:r.suffix;x!==void 0&&x!==!1&&(v=Number((o=ka((n=b.props)===null||n===void 0?void 0:n.span,g))!==null&&o!==void 0?o:Wb),b.props.privateSpan=v,b.props.pr
transition:
color .3s var(--n-bezier),
background-color .3s var(--n-bezier);
background-color: var(--n-color);
display: inline-flex;
align-items: center;
justify-content: center;
color: var(--n-icon-color);
`),ik=Object.assign(Object.assign({},ye.props),{size:{type:Number,default:24},borderRadius:{type:Number,default:6},color:String,iconColor:String}),kj=re({name:"IconWrapper",props:ik,setup(e,{slots:t}){const{mergedClsPrefixRef:r,inlineThemeDisabled:n}=Ne(e),o=ye("IconWrapper","-icon-wrapper",Sj,Cj,e,r),i=P(()=>{const{common:{cubicBezierEaseInOut:l},self:{color:s,iconColor:d}}=o.value;return{"--n-bezier":l,"--n-color":s,"--n-icon-color":d}}),a=n?Qe("icon-wrapper",void 0,i,e):void 0;return()=>{const l=zt(e.size);return a==null||a.onRender(),c("div",{class:[`${r.value}-icon-wrapper`,a==null?void 0:a.themeClass.value],style:[i==null?void 0:i.value,{height:l,width:l,borderRadius:zt(e.borderRadius),backgroundColor:e.color,color:e.iconColor}]},t)}}}),zg=Object.assign(Object.assign({},ye.props),{onPreviewPrev:Function,onPreviewNext:Function,showToolbar:{type:Boolean,default:!0},showToolbarTooltip:Boolean,renderToolbar:Function}),ak="n-image";function Rj(){return{toolbarIconColor:"rgba(255, 255, 255, .9)",toolbarColor:"rgba(0, 0, 0, .35)",toolbarBoxShadow:"none",toolbarBorderRadius:"24px"}}const Pj={name:"Image",common:tt,peers:{Tooltip:Ic},self:Rj},Tj={name:"Image",common:et,peers:{Tooltip:Mc},self:e=>{const{textColor2:t}=e;return{toolbarIconColor:t,toolbarColor:"rgba(0, 0, 0, .35)",toolbarBoxShadow:"none",toolbarBorderRadius:"24px"}}},$j=c("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},c("path",{d:"M6 5C5.75454 5 5.55039 5.17688 5.50806 5.41012L5.5 5.5V14.5C5.5 14.7761 5.72386 15 6 15C6.24546 15 6.44961 14.8231 6.49194 14.5899L6.5 14.5V5.5C6.5 5.22386 6.27614 5 6 5ZM13.8536 5.14645C13.68 4.97288 13.4106 4.9536 13.2157 5.08859L13.1464 5.14645L8.64645 9.64645C8.47288 9.82001 8.4536 10.0894 8.58859 10.2843L8.64645 10.3536L13.1464 14.8536C13.3417 15.0488 13.6583 15.0488 13.8536 14.8536C14.0271 14.68 14.0464 14.4106 13.9114 14.2157L13.8536 14.1464L9.70711 10L13.8536 5.85355C14.0488 5.65829 14.0488 5.34171 13.8536 5.14645Z",fill:"currentColor"})),zj=c("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},c("path",{d:"M13.5 5C13.7455 5 13.9496 5.17688 13.9919 5.41012L14 5.5V14.5C14 14.7761 13.7761 15 13.5 15C13.2545 15 13.0504 14.8231 13.0081 14.5899L13 14.5V5.5C13 5.22386 13.2239 5 13.5 5ZM5.64645 5.14645C5.82001 4.97288 6.08944 4.9536 6.28431 5.08859L6.35355 5.14645L10.8536 9.64645C11.0271 9.82001 11.0464 10.0894 10.9114 10.2843L10.8536 10.3536L6.35355 14.8536C6.15829 15.0488 5.84171 15.0488 5.64645 14.8536C5.47288 14.68 5.4536 14.4106 5.58859 14.2157L5.64645 14.1464L9.79289 10L5.64645 5.85355C5.45118 5.65829 5.45118 5.34171 5.64645 5.14645Z",fill:"currentColor"})),Oj=c("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},c("path",{d:"M4.089 4.216l.057-.07a.5.5 0 0 1 .638-.057l.07.057L10 9.293l5.146-5.147a.5.5 0 0 1 .638-.057l.07.057a.5.5 0 0 1 .057.638l-.057.07L10.707 10l5.147 5.146a.5.5 0 0 1 .057.638l-.057.07a.5.5 0 0 1-.638.057l-.07-.057L10 10.707l-5.146 5.147a.5.5 0 0 1-.638.057l-.07-.057a.5.5 0 0 1-.057-.638l.057-.07L9.293 10L4.146 4.854a.5.5 0 0 1-.057-.638l.057-.07l-.057.07z",fill:"currentColor"})),_j=O([O("body >",[w("image-container","position: fixed;")]),w("image-preview-container",`
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
display: flex;
`),w("image-preview-overlay",`
z-index: -1;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
background: rgba(0, 0, 0, .3);
`,[Eo()]),w("image-preview-toolbar",`
z-index: 1;
position: absolute;
left: 50%;
transform: translateX(-50%);
border-radius: var(--n-toolbar-border-radius);
height: 48px;
bottom: 40px;
padding: 0 12px;
background: var(--n-toolbar-color);
box-shadow: var(--n-toolbar-box-shadow);
color: var(--n-toolbar-icon-color);
transition: color .3s var(--n-bezier);
display: flex;
align-items: center;
`,[w("base-icon",`
padding: 0 8px;
font-size: 28px;
cursor: pointer;
`),Eo()]),w("image-preview-wrapper",`
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
display: flex;
pointer-events: none;
`,[Ar()]),w("image-preview",`
user-select: none;
-webkit-user-select: none;
pointer-events: all;
margin: auto;
max-height: calc(100vh - 32px);
max-width: calc(100vw - 32px);
transition: transform .3s var(--n-bezier);
`),w("image",`
display: inline-flex;
max-height: 100%;
max-width: 100%;
`,[xt("preview-disabled",`
cursor: pointer;
`),O("img",`
border-radius: inherit;
`)])]),sd=32,lk=re({name:"ImagePreview",props:Object.assign(Object.assign({},zg),{onNext:Function,onPrev:Function,clsPrefix:{type:String,required:!0}}),setup(e){const t=ye("Image","-image",_j,Pj,e,ve(e,"clsPrefix"));let r=null;const n=D(null),o=D(null),i=D(void 0),a=D(!1),l=D(!1),{localeRef:s}=mr("Image");function d(){const{value:E}=o;if(!r||!E)return;const{style:W}=E,ie=r.getBoundingClientRect(),ge=ie.left+ie.width/2,ne=ie.top+ie.height/2;W.transformOrigin=`${ge}px ${ne}px`}function u(E){var W,ie;switch(E.key){case" ":E.preventDefault();break;case"ArrowLeft":(W=e.onPrev)===null||W===void 0||W.call(e);break;case"ArrowRight":(ie=e.onNext)===null||ie===void 0||ie.call(e);break;case"Escape":he();break}}ft(a,E=>{E?_t("keydown",document,u):Rt("keydown",document,u)}),Ut(()=>{Rt("keydown",document,u)});let f=0,h=0,g=0,v=0,b=0,m=0,p=0,x=0,S=!1;function y(E){const{clientX:W,clientY:ie}=E;g=W-f,v=ie-h,ta(ae)}function C(E){const{mouseUpClientX:W,mouseUpClientY:ie,mouseDownClientX:ge,mouseDownClientY:ne}=E,ee=ge-W,me=ne-ie,J=`vertical${me>0?"Top":"Bottom"}`,oe=`horizontal${ee>0?"Left":"Right"}`;return{moveVerticalDirection:J,moveHorizontalDirection:oe,deltaHorizontal:ee,deltaVertical:me}}function k(E){const{value:W}=n;if(!W)return{offsetX:0,offsetY:0};const ie=W.getBoundingClientRect(),{moveVerticalDirection:ge,moveHorizontalDirection:ne,deltaHorizontal:ee,deltaVertical:me}=E||{};let J=0,oe=0;return ie.width<=window.innerWidth?J=0:ie.left>0?J=(ie.width-window.innerWidth)/2:ie.right<window.innerWidth?J=-(ie.width-window.innerWidth)/2:ne==="horizontalRight"?J=Math.min((ie.width-window.innerWidth)/2,b-(ee??0)):J=Math.max(-((ie.width-window.innerWidth)/2),b-(ee??0)),ie.height<=window.innerHeight?oe=0:ie.top>0?oe=(ie.height-window.innerHeight)/2:ie.bottom<window.innerHeight?oe=-(ie.height-window.innerHeight)/2:ge==="verticalBottom"?oe=Math.min((ie.height-window.innerHeight)/2,m-(me??0)):oe=Math.max(-((ie.height-window.innerHeight)/2),m-(me??0)),{offsetX:J,offsetY:oe}}function R(E){Rt("mousemove",document,y),Rt("mouseup",document,R);const{clientX:W,clientY:ie}=E;S=!1;const ge=C({mouseUpClientX:W,mouseUpClientY:ie,mouseDownClientX:p,mouseDownClientY:x}),ne=k(ge);g=ne.offsetX,v=ne.offsetY,ae()}const $=De(ak,null);function T(E){var W,ie;if((ie=(W=$==null?void 0:$.previewedImgPropsRef.value)===null||W===void 0?void 0:W.onMousedown)===null||ie===void 0||ie.call(W,E),E.button!==0)return;const{clientX:ge,clientY:ne}=E;S=!0,f=ge-g,h=ne-v,b=g,m=v,p=ge,x=ne,ae(),_t("mousemove",document,y),_t("mouseup",document,R)}function z(E){var W,ie;(ie=(W=$==null?void 0:$.previewedImgPropsRef.value)===null||W===void 0?void 0:W.onDblclick)===null||ie===void 0||ie.call(W,E);const ge=Q();N=N===ge?1:ge,ae()}const F=1.5;let _=0,N=1,j=0;function H(){N=1,_=0}function Y(){var E;H(),j=0,(E=e.onPrev)===null||E===void 0||E.call(e)}function X(){var E;H(),j=0,(E=e.onNext)===null||E===void 0||E.call(e)}function le(){j-=90,ae()}function ke(){j+=90,ae()}function be(){const{value:E}=n;if(!E)return 1;const{innerWidth:W,innerHeight:ie}=window,ge=Math.max(1,E.naturalHeight/(ie-sd)),ne=Math.max(1,E.naturalWidth/(W-sd));return Math.max(3,ge*2,ne*2)}function Q(){const{value:E}=n;if(!E)return 1;const{innerWidth:W,innerHeight:ie}=window,ge=E.naturalHeight/(ie-sd),ne=E.naturalWidth/(W-sd);return ge<1&&ne<1?1:Math.max(ge,ne)}function L(){const E=be();N<E&&(_+=1,N=Math.min(E,Math.pow(F,_)),ae())}function A(){if(N>.5){const E=N;_-=1,N=Math.max(.5,Math.pow(F,_));const W=E-N;ae(!1);const ie=k();N+=W,ae(!1),N-=W,g=ie.offsetX,v=ie.offsetY,ae()}}function U(){const E=i.value;E&&zv(E,void 0)}function ae(E=!0){var W;const{value:ie}=n;if(!ie)return;const{style:ge}=ie,ne=ss((W=$==null?void 0:$.previewedImgPropsRef.value)===null||W===void 0?void 0:W.style);let ee="";if(typeof ne=="string")ee=ne+";";else for(const J in ne)ee+=`${a1(J)}: ${ne[J]};`;const me=`transform-origin: center; transform: translateX(${g}px) translateY(${v}px) rotate(${j}deg) scale(${N});`;S?ge.cssText=ee+"cursor: grabbing; transition: none;"+me:ge.cssText=ee+"cursor: grab;"+me+(E?"":"transition: none;"),E||ie.offsetHeight}funct
display: inline-block;
margin-right: 10px;
`),w("input-number-prefix",`
display: inline-block;
margin-left: 10px;
`)]),Yb=800,Gb=100,hk=Object.assign(Object.assign({},ye.props),{autofocus:Boolean,loading:{type:Boolean,default:void 0},placeholder:String,defaultValue:{type:Number,default:null},value:Number,step:{type:[Number,String],default:1},min:[Number,String],max:[Number,String],size:String,disabled:{type:Boolean,default:void 0},validator:Function,bordered:{type:Boolean,default:void 0},showButton:{type:Boolean,default:!0},buttonPlacement:{type:String,default:"right"},inputProps:Object,readonly:Boolean,clearable:Boolean,keyboard:{type:Object,default:{}},updateValueOnInput:{type:Boolean,default:!0},parse:Function,format:Function,precision:Number,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onChange:[Function,Array]}),Dj=re({name:"InputNumber",props:hk,setup(e){const{mergedBorderedRef:t,mergedClsPrefixRef:r,mergedRtlRef:n}=Ne(e),o=ye("InputNumber","-input-number",Fj,XH,e,r),{localeRef:i}=mr("InputNumber"),a=Rr(e),{mergedSizeRef:l,mergedDisabledRef:s,mergedStatusRef:d}=a,u=D(null),f=D(null),h=D(null),g=D(e.defaultValue),v=ve(e,"value"),b=$t(v,g),m=D(""),p=ne=>{const ee=String(ne).split(".")[1];return ee?ee.length:0},x=ne=>{const ee=[e.min,e.max,e.step,ne].map(me=>me===void 0?0:p(me));return Math.max(...ee)},S=ct(()=>{const{placeholder:ne}=e;return ne!==void 0?ne:i.value.placeholder}),y=ct(()=>{const ne=Gu(e.step);return ne!==null?ne===0?1:Math.abs(ne):1}),C=ct(()=>{const ne=Gu(e.min);return ne!==null?ne:null}),k=ct(()=>{const ne=Gu(e.max);return ne!==null?ne:null}),R=ne=>{const{value:ee}=b;if(ne===ee){T();return}const{"onUpdate:value":me,onUpdateValue:J,onChange:oe}=e,{nTriggerFormInput:de,nTriggerFormChange:Z}=a;oe&&ue(oe,ne),J&&ue(J,ne),me&&ue(me,ne),g.value=ne,de(),Z()},$=({offset:ne,doUpdateIfValid:ee,fixPrecision:me,isInputing:J})=>{const{value:oe}=m;if(J&&Ij(oe))return!1;const de=(e.parse||Mj)(oe);if(de===null)return ee&&R(null),null;if(Yu(de)){const Z=p(de),{precision:B}=e;if(B!==void 0&&B<Z&&!me)return!1;let te=parseFloat((de+ne).toFixed(B??x(de)));if(Yu(te)){const{value:we}=k,{value:Le}=C;if(we!==null&&te>we){if(!ee||J)return!1;te=we}if(Le!==null&&te<Le){if(!ee||J)return!1;te=Le}return e.validator&&!e.validator(te)?!1:(ee&&R(te),te)}}return!1},T=()=>{const{value:ne}=b;if(Yu(ne)){const{format:ee,precision:me}=e;ee?m.value=ee(ne):ne===null||me===void 0||p(ne)>me?m.value=qb(ne,void 0):m.value=qb(ne,me)}else m.value=String(ne)};T();const z=ct(()=>$({offset:0,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})===!1),F=ct(()=>{const{value:ne}=b;if(e.validator&&ne===null)return!1;const{value:ee}=y;return $({offset:-ee,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})!==!1}),_=ct(()=>{const{value:ne}=b;if(e.validator&&ne===null)return!1;const{value:ee}=y;return $({offset:+ee,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})!==!1});function N(ne){const{onFocus:ee}=e,{nTriggerFormFocus:me}=a;ee&&ue(ee,ne),me()}function j(ne){var ee,me;if(ne.target===((ee=u.value)===null||ee===void 0?void 0:ee.wrapperElRef))return;const J=$({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0});if(J!==!1){const Z=(me=u.value)===null||me===void 0?void 0:me.inputElRef;Z&&(Z.value=String(J||"")),b.value===J&&T()}else T();const{onBlur:oe}=e,{nTriggerFormBlur:de}=a;oe&&ue(oe,ne),de(),Ot(()=>{T()})}function H(ne){const{onClear:ee}=e;ee&&ue(ee,ne)}function Y(){const{value:ne}=_;if(!ne){Re();return}const{value:ee}=b;if(ee===null)e.validator||R(be());else{const{value:me}=y;$({offset:me,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})}}function X(){const{value:ne}=F;if(!ne){he();return}const{value:ee}=b;if(ee===null)e.validator||R(be());else{const{value:me}=y;$({offset:-me,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})}}const le=N,ke=j;function be(){if(e.validator)return null;const{value:ne}=C,{value:ee}=k;return ne!==null?Math.max(0,ne):ee!==null?Math.min(0,ee):0}function Q(ne){H(ne),R(null)}function L(ne){var ee,me,J;!((ee=h.value)===null||ee===void 0)&&ee.$el.contains(ne.target)&&ne.preventDefault(),!((me=f.value)===null||me===void 0)&&me.
color: var(--n-text-color);
background-color: var(--n-color);
box-sizing: border-box;
position: relative;
z-index: auto;
flex: auto;
overflow: hidden;
transition:
box-shadow .3s var(--n-bezier),
background-color .3s var(--n-bezier),
color .3s var(--n-bezier);
`,[w("layout-scroll-container",`
overflow-x: hidden;
box-sizing: border-box;
height: 100%;
`),I("absolute-positioned",`
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
`)]),Lh={embedded:Boolean,position:jc,nativeScrollbar:{type:Boolean,default:!0},scrollbarProps:Object,onScroll:Function,contentClass:String,contentStyle:{type:[String,Object],default:""},hasSider:Boolean,siderPlacement:{type:String,default:"left"}},gk="n-layout";function pk(e){return re({name:e?"LayoutContent":"Layout",props:Object.assign(Object.assign({},ye.props),Lh),setup(t){const r=D(null),n=D(null),{mergedClsPrefixRef:o,inlineThemeDisabled:i}=Ne(t),a=ye("Layout","-layout",Ej,Hc,t,o);function l(b,m){if(t.nativeScrollbar){const{value:p}=r;p&&(m===void 0?p.scrollTo(b):p.scrollTo(b,m))}else{const{value:p}=n;p&&p.scrollTo(b,m)}}ot(gk,t);let s=0,d=0;const u=b=>{var m;const p=b.target;s=p.scrollLeft,d=p.scrollTop,(m=t.onScroll)===null||m===void 0||m.call(t,b)};$v(()=>{if(t.nativeScrollbar){const b=r.value;b&&(b.scrollTop=d,b.scrollLeft=s)}});const f={display:"flex",flexWrap:"nowrap",width:"100%",flexDirection:"row"},h={scrollTo:l},g=P(()=>{const{common:{cubicBezierEaseInOut:b},self:m}=a.value;return{"--n-bezier":b,"--n-color":t.embedded?m.colorEmbedded:m.color,"--n-text-color":m.textColor}}),v=i?Qe("layout",P(()=>t.embedded?"e":""),g,t):void 0;return Object.assign({mergedClsPrefix:o,scrollableElRef:r,scrollbarInstRef:n,hasSiderStyle:f,mergedTheme:a,handleNativeElScroll:u,cssVars:i?void 0:g,themeClass:v==null?void 0:v.themeClass,onRender:v==null?void 0:v.onRender},h)},render(){var t;const{mergedClsPrefix:r,hasSider:n}=this;(t=this.onRender)===null||t===void 0||t.call(this);const o=n?this.hasSiderStyle:void 0,i=[this.themeClass,e&&`${r}-layout-content`,`${r}-layout`,`${r}-layout--${this.position}-positioned`];return c("div",{class:i,style:this.cssVars},this.nativeScrollbar?c("div",{ref:"scrollableElRef",class:[`${r}-layout-scroll-container`,this.contentClass],style:[this.contentStyle,o],onScroll:this.handleNativeElScroll},this.$slots):c(sr,Object.assign({},this.scrollbarProps,{onScroll:this.onScroll,ref:"scrollbarInstRef",theme:this.mergedTheme.peers.Scrollbar,themeOverrides:this.mergedTheme.peerOverrides.Scrollbar,contentClass:this.contentClass,contentStyle:[this.contentStyle,o]}),this.$slots))}})}const Aj=pk(!1),Bj=pk(!0),Nj=w("layout-header",`
transition:
color .3s var(--n-bezier),
background-color .3s var(--n-bezier),
box-shadow .3s var(--n-bezier),
border-color .3s var(--n-bezier);
box-sizing: border-box;
width: 100%;
background-color: var(--n-color);
color: var(--n-text-color);
`,[I("absolute-positioned",`
position: absolute;
left: 0;
right: 0;
top: 0;
`),I("bordered",`
border-bottom: solid 1px var(--n-border-color);
`)]),mk={position:jc,inverted:Boolean,bordered:{type:Boolean,default:!1}},Lj=re({name:"LayoutHeader",props:Object.assign(Object.assign({},ye.props),mk),setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:r}=Ne(e),n=ye("Layout","-layout-header",Nj,Hc,e,t),o=P(()=>{const{common:{cubicBezierEaseInOut:a},self:l}=n.value,s={"--n-bezier":a};return e.inverted?(s["--n-color"]=l.headerColorInverted,s["--n-text-color"]=l.textColorInverted,s["--n-border-color"]=l.headerBorderColorInverted):(s["--n-color"]=l.headerColor,s["--n-text-color"]=l.textColor,s["--n-border-color"]=l.headerBorderColor),s}),i=r?Qe("layout-header",P(()=>e.inverted?"a":"b"),o,e):void 0;return{mergedClsPrefix:t,cssVars:r?void 0:o,themeClass:i==null?void 0:i.themeClass,onRender:i==null?void 0:i.onRender}},render(){var e;const{mergedClsPrefix:t}=this;return(e=this.onRender)===null||e===void 0||e.call(this),c("div",{class:[`${t}-layout-header`,this.themeClass,this.position&&`${t}-layout-header--${this.position}-positioned`,this.bordered&&`${t}-layout-header--bordered`],style:this.cssVars},this.$slots)}}),Hj=w("layout-footer",`
transition:
box-shadow .3s var(--n-bezier),
color .3s var(--n-bezier),
background-color .3s var(--n-bezier),
border-color .3s var(--n-bezier);
color: var(--n-text-color);
background-color: var(--n-color);
box-sizing: border-box;
`,[I("absolute-positioned",`
position: absolute;
left: 0;
right: 0;
bottom: 0;
`),I("bordered",`
border-top: solid 1px var(--n-border-color);
`)]),bk=Object.assign(Object.assign({},ye.props),{inverted:Boolean,position:jc,bordered:Boolean}),jj=re({name:"LayoutFooter",props:bk,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:r}=Ne(e),n=ye("Layout","-layout-footer",Hj,Hc,e,t),o=P(()=>{const{common:{cubicBezierEaseInOut:a},self:l}=n.value,s={"--n-bezier":a};return e.inverted?(s["--n-color"]=l.footerColorInverted,s["--n-text-color"]=l.textColorInverted,s["--n-border-color"]=l.footerBorderColorInverted):(s["--n-color"]=l.footerColor,s["--n-text-color"]=l.textColor,s["--n-border-color"]=l.footerBorderColor),s}),i=r?Qe("layout-footer",P(()=>e.inverted?"a":"b"),o,e):void 0;return{mergedClsPrefix:t,cssVars:r?void 0:o,themeClass:i==null?void 0:i.themeClass,onRender:i==null?void 0:i.onRender}},render(){var e;const{mergedClsPrefix:t}=this;return(e=this.onRender)===null||e===void 0||e.call(this),c("div",{class:[`${t}-layout-footer`,this.themeClass,this.position&&`${t}-layout-footer--${this.position}-positioned`,this.bordered&&`${t}-layout-footer--bordered`],style:this.cssVars},this.$slots)}}),Vj=w("layout-sider",`
flex-shrink: 0;
box-sizing: border-box;
position: relative;
z-index: 1;
color: var(--n-text-color);
transition:
color .3s var(--n-bezier),
border-color .3s var(--n-bezier),
min-width .3s var(--n-bezier),
max-width .3s var(--n-bezier),
transform .3s var(--n-bezier),
background-color .3s var(--n-bezier);
background-color: var(--n-color);
display: flex;
justify-content: flex-end;
`,[I("bordered",[M("border",`
content: "";
position: absolute;
top: 0;
bottom: 0;
width: 1px;
background-color: var(--n-border-color);
transition: background-color .3s var(--n-bezier);
`)]),M("left-placement",[I("bordered",[M("border",`
right: 0;
`)])]),I("right-placement",`
justify-content: flex-start;
`,[I("bordered",[M("border",`
left: 0;
`)]),I("collapsed",[w("layout-toggle-button",[w("base-icon",`
transform: rotate(180deg);
`)]),w("layout-toggle-bar",[O("&:hover",[M("top",{transform:"rotate(-12deg) scale(1.15) translateY(-2px)"}),M("bottom",{transform:"rotate(12deg) scale(1.15) translateY(2px)"})])])]),w("layout-toggle-button",`
left: 0;
transform: translateX(-50%) translateY(-50%);
`,[w("base-icon",`
transform: rotate(0);
`)]),w("layout-toggle-bar",`
left: -28px;
transform: rotate(180deg);
`,[O("&:hover",[M("top",{transform:"rotate(12deg) scale(1.15) translateY(-2px)"}),M("bottom",{transform:"rotate(-12deg) scale(1.15) translateY(2px)"})])])]),I("collapsed",[w("layout-toggle-bar",[O("&:hover",[M("top",{transform:"rotate(-12deg) scale(1.15) translateY(-2px)"}),M("bottom",{transform:"rotate(12deg) scale(1.15) translateY(2px)"})])]),w("layout-toggle-button",[w("base-icon",`
transform: rotate(0);
`)])]),w("layout-toggle-button",`
transition:
color .3s var(--n-bezier),
right .3s var(--n-bezier),
left .3s var(--n-bezier),
border-color .3s var(--n-bezier),
background-color .3s var(--n-bezier);
cursor: pointer;
width: 24px;
height: 24px;
position: absolute;
top: 50%;
right: 0;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 18px;
color: var(--n-toggle-button-icon-color);
border: var(--n-toggle-button-border);
background-color: var(--n-toggle-button-color);
box-shadow: 0 2px 4px 0px rgba(0, 0, 0, .06);
transform: translateX(50%) translateY(-50%);
z-index: 1;
`,[w("base-icon",`
transition: transform .3s var(--n-bezier);
transform: rotate(180deg);
`)]),w("layout-toggle-bar",`
cursor: pointer;
height: 72px;
width: 32px;
position: absolute;
top: calc(50% - 36px);
right: -28px;
`,[M("top, bottom",`
position: absolute;
width: 4px;
border-radius: 2px;
height: 38px;
left: 14px;
transition:
background-color .3s var(--n-bezier),
transform .3s var(--n-bezier);
`),M("bottom",`
position: absolute;
top: 34px;
`),O("&:hover",[M("top",{transform:"rotate(12deg) scale(1.15) translateY(-2px)"}),M("bottom",{transform:"rotate(-12deg) scale(1.15) translateY(2px)"})]),M("top, bottom",{backgroundColor:"var(--n-toggle-bar-color)"}),O("&:hover",[M("top, bottom",{backgroundColor:"var(--n-toggle-bar-color-hover)"})])]),M("border",`
position: absolute;
top: 0;
right: 0;
bottom: 0;
width: 1px;
transition: background-color .3s var(--n-bezier);
`),w("layout-sider-scroll-container",`
flex-grow: 1;
flex-shrink: 0;
box-sizing: border-box;
height: 100%;
opacity: 0;
transition: opacity .3s var(--n-bezier);
max-width: 100%;
`),I("show-content",[w("layout-sider-scroll-container",{opacity:1})]),I("absolute-positioned",`
position: absolute;
left: 0;
top: 0;
bottom: 0;
`)]),Uj=re({name:"LayoutToggleButton",props:{clsPrefix:{type:String,required:!0},onClick:Function},render(){const{clsPrefix:e}=this;return c("div",{class:`${e}-layout-toggle-button`,onClick:this.onClick},c(ut,{clsPrefix:e},{default:()=>c(va,null)}))}}),Wj=re({props:{clsPrefix:{type:String,required:!0},onClick:Function},render(){const{clsPrefix:e}=this;return c("div",{onClick:this.onClick,class:`${e}-layout-toggle-bar`},c("div",{class:`${e}-layout-toggle-bar__top`}),c("div",{class:`${e}-layout-toggle-bar__bottom`}))}}),xk={position:jc,bordered:Boolean,collapsedWidth:{type:Number,default:48},width:{type:[Number,String],default:272},contentClass:String,contentStyle:{type:[String,Object],default:""},collapseMode:{type:String,default:"transform"},collapsed:{type:Boolean,default:void 0},defaultCollapsed:Boolean,showCollapsedContent:{type:Boolean,default:!0},showTrigger:{type:[Boolean,String],default:!1},nativeScrollbar:{type:Boolean,default:!0},inverted:Boolean,scrollbarProps:Object,triggerClass:String,triggerStyle:[String,Object],collapsedTriggerClass:String,collapsedTriggerStyle:[String,Object],"onUpdate:collapsed":[Function,Array],onUpdateCollapsed:[Function,Array],onAfterEnter:Function,onAfterLeave:Function,onExpand:[Function,Array],onCollapse:[Function,Array],onScroll:Function},Kj=re({name:"LayoutSider",props:Object.assign(Object.assign({},ye.props),xk),setup(e){const t=De(gk),r=D(null),n=D(null),o=P(()=>zt(s.value?e.collapsedWidth:e.width)),i=P(()=>e.collapseMode!=="transform"?{}:{minWidth:zt(e.width)}),a=P(()=>t?t.siderPlacement:"left"),l=D(e.defaultCollapsed),s=$t(ve(e,"collapsed"),l);function d(C,k){if(e.nativeScrollbar){const{value:R}=r;R&&(k===void 0?R.scrollTo(C):R.scrollTo(C,k))}else{const{value:R}=n;R&&R.scrollTo(C,k)}}function u(){const{"onUpdate:collapsed":C,onUpdateCollapsed:k,onExpand:R,onCollapse:$}=e,{value:T}=s;k&&ue(k,!T),C&&ue(C,!T),l.value=!T,T?R&&ue(R):$&&ue($)}let f=0,h=0;const g=C=>{var k;const R=C.target;f=R.scrollLeft,h=R.scrollTop,(k=e.onScroll)===null||k===void 0||k.call(e,C)};$v(()=>{if(e.nativeScrollbar){const C=r.value;C&&(C.scrollTop=h,C.scrollLeft=f)}}),ot(vk,{collapsedRef:s,collapseModeRef:ve(e,"collapseMode")});const{mergedClsPrefixRef:v,inlineThemeDisabled:b}=Ne(e),m=ye("Layout","-layout-sider",Vj,Hc,e,v);function p(C){var k,R;C.propertyName==="max-width"&&(s.value?(k=e.onAfterLeave)===null||k===void 0||k.call(e):(R=e.onAfterEnter)===null||R===void 0||R.call(e))}const x={scrollTo:d},S=P(()=>{const{common:{cubicBezierEaseInOut:C},self:k}=m.value,{siderToggleButtonColor:R,siderToggleButtonBorder:$,siderToggleBarColor:T,siderToggleBarColorHover:z}=k,F={"--n-bezier":C,"--n-toggle-button-color":R,"--n-toggle-button-border":$,"--n-toggle-bar-color":T,"--n-toggle-bar-color-hover":z};return e.inverted?(F["--n-color"]=k.siderColorInverted,F["--n-text-color"]=k.textColorInverted,F["--n-border-color"]=k.siderBorderColorInverted,F["--n-toggle-button-icon-color"]=k.siderToggleButtonIconColorInverted,F.__invertScrollbar=k.__invertScrollbar):(F["--n-color"]=k.siderColor,F["--n-text-color"]=k.textColor,F["--n-border-color"]=k.siderBorderColor,F["--n-toggle-button-icon-color"]=k.siderToggleButtonIconColor),F}),y=b?Qe("layout-sider",P(()=>e.inverted?"a":"b"),S,e):void 0;return Object.assign({scrollableElRef:r,scrollbarInstRef:n,mergedClsPrefix:v,mergedTheme:m,styleMaxWidth:o,mergedCollapsed:s,scrollContainerStyle:i,siderPlacement:a,handleNativeElScroll:g,handleTransitionend:p,handleTriggerClick:u,inlineThemeDisabled:b,cssVars:S,themeClass:y==null?void 0:y.themeClass,onRender:y==null?void 0:y.onRender},x)},render(){var e;const{mergedClsPrefix:t,mergedCollapsed:r,showTrigger:n}=this;return(e=this.onRender)===null||e===void 0||e.call(this),c("aside",{class:[`${t}-layout-sider`,this.themeClass,`${t}-layout-sider--${this.position}-positioned`,`${t}-layout-sider--${this.siderPlacement}-placement`,this.bordered&&`${t}-layout-sider--bordered`,r&&`${t}-layout-sider--collapsed`,(!r||this.showCollapsedContent)&&`${t}-layout-sider--show-content`],onTransitionend:this.handleTransitionend,style:[this.inlineThemeDisabl
0% {
transform: translateX(-150%);
}
100% {
transform: translateX(0);
}
`),O("@keyframes legacy-transfer-slide-out-to-right",`
0% {
transform: translateX(0);
}
100% {
transform: translateX(150%);
}
`),O("@keyframes legacy-transfer-slide-in-from-right",`
0% {
transform: translateX(150%);
}
100% {
transform: translateX(0);
}
`),O("@keyframes legacy-transfer-slide-out-to-left",`
0% {
transform: translateX(0);
}
100% {
transform: translateX(-150%);
}
`),O("@keyframes legacy-transfer-height-collapse",`
0% {
max-height: var(--n-item-height);
}
100% {
max-height: 0;
}
`),O("@keyframes legacy-transfer-height-expand",`
0% {
max-height: 0;
}
100% {
max-height: var(--n-item-height);
}
`)]),Qj=O([w("legacy-transfer",`
display: flex;
width: var(--n-width);
font-size: var(--n-font-size);
height: 240px;
display: flex;
flex-wrap: nowrap;
`,[w("legacy-transfer-icon",`
color: var(--n-icon-color);
transition: color .3s var(--n-bezier);
`),I("disabled",[w("legacy-transfer-icon",{color:"var(--n-icon-color-disabled)"})]),w("legacy-transfer-list",`
height: inherit;
display: flex;
flex-direction: column;
background-clip: padding-box;
width: calc(50% - 36px);
position: relative;
transition: background-color .3s var(--n-bezier);
border-radius: var(--n-border-radius);
background-color: var(--n-list-color);
`,[M("border",`
border: 1px solid var(--n-border-color);
transition: border-color .3s var(--n-bezier);
pointer-events: none;
border-radius: inherit;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
`),w("legacy-transfer-list-header",`
height: calc(var(--n-item-height) + 4px);
box-sizing: border-box;
display: flex;
align-items: center;
background-clip: padding-box;
border-radius: inherit;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
background-color: var(--n-header-color);
transition:
border-color .3s var(--n-bezier),
background-color .3s var(--n-bezier);
`,[M("checkbox",`
display: flex;
align-items: center;
position: relative;
padding: 0 9px 0 14px;
`),M("header",`
flex: 1;
line-height: 1;
font-weight: var(--n-header-font-weight);
transition: color .3s var(--n-bezier);
color: var(--n-header-text-color);
`,[I("disabled",{color:"var(--n-header-text-color-disabled)"})]),M("extra",`
transition: color .3s var(--n-bezier);
font-size: var(--n-extra-font-size);
justify-self: flex-end;
margin-right: 14px;
white-space: nowrap;
color: var(--n-header-extra-text-color);
`)]),w("legacy-transfer-list-body",`
flex-basis: 0;
flex-grow: 1;
box-sizing: border-box;
position: relative;
display: flex;
flex-direction: column;
border-radius: inherit;
border-top-left-radius: 0;
border-top-right-radius: 0;
`,[w("legacy-transfer-filter",`
padding: 0 8px 8px 8px;
box-sizing: border-box;
background-color: var(--n-header-color);
transition:
border-color .3s var(--n-bezier),
background-color .3s var(--n-bezier);
border-bottom: 1px solid var(--n-filter-divider-color);
`),w("legacy-transfer-list-flex-container",`
flex: 1;
position: relative;
`,[w("scrollbar",`
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
height: unset;
`,[w("scrollbar-content",{width:"100%"})]),w("empty",`
position: absolute;
left: 50%;
top: 50%;
transform: translateY(-50%) translateX(-50%);
`,[Eo()]),w("legacy-transfer-list-content",`
padding: 0;
margin: 0;
position: relative;
`,[I("transition-disabled",[w("legacy-transfer-list-item",{animation:"none !important"})]),w("legacy-transfer-list-item",`
height: var(--n-item-height);
max-height: var(--n-item-height);
transition:
background-color .3s var(--n-bezier),
color .3s var(--n-bezier);
position: relative;
cursor: pointer;
display: flex;
align-items: center;
color: var(--n-item-text-color);
`,[xt("disabled",[O("&:hover",{backgroundColor:"var(--n-item-color-pending)"})]),M("extra",`
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
padding-right: 4px;
`),M("checkbox",`
display: flex;
align-items: center;
position: relative;
padding: 0 9px 0 14px;
`),I("disabled",`
cursor: not-allowed
background-color: #0000;
color: var(--n-item-text-color-disabled);
`),I("source",{animationFillMode:"forwards"},[O("&.item-enter-active",`
transform: translateX(150%);
animation-duration: .25s, .25s;
animation-timing-function: var(--n-bezier), var(--n-bezier-ease-out);
animation-delay: 0s, .25s;
animation-name: legacy-transfer-height-expand, legacy-transfer-slide-in-from-right;
`),O("&.item-leave-active",`
transform: translateX(-150%);
animation-duration: .25s, .25s;
animation-timing-function: var(--n-bezier), var(--n-bezier-ease-in);
animation-delay: .25s, 0s;
animation-name: legacy-transfer-height-collapse, legacy-transfer-slide-out-to-right;
`)]),I("target",{animationFillMode:"forwards"},[O("&.item-enter-active",`
transform: translateX(-150%);
animation-duration: .25s, .25s;
animation-timing-function: var(--n-bezier), var(--n-bezier-ease-out);
animation-delay: 0s, .25s;
animation-name: legacy-transfer-height-expand, legacy-transfer-slide-in-from-left;
`),O("&.item-leave-active",`
transform: translateX(150%);
animation-duration: .25s, .25s;
animation-timing-function: var(--n-bezier), var(--n-bezier-ease-in);
animation-delay: .25s, 0s;
animation-name: legacy-transfer-height-collapse, legacy-transfer-slide-out-to-left;
`)])])])])])]),w("legacy-transfer-gap",{width:"72px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"}),w("button",[O("&:first-child",{marginBottom:"12px"})])]),Zj]),Ck=Object.assign(Object.assign({},ye.props),{value:Array,defaultValue:{type:Array,default:null},options:{type:Array,default:()=>[]},disabled:{type:Boolean,default:void 0},virtualScroll:Boolean,sourceTitle:String,targetTitle:String,filterable:Boolean,sourceFilterPlaceholder:String,targetFilterPlaceholder:String,filter:{type:Function,default:(e,t)=>e?~(""+t.label).toLowerCase().indexOf((""+e).toLowerCase()):!0},size:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onChange:[Function,Array]}),Jj=re({name:"LegacyTransfer",props:Ck,setup(e){const{mergedClsPrefixRef:t}=Ne(e),r=ye("LegacyTransfer","-legacy-transfer",Qj,Gj,e,t),n=Rr(e),{mergedSizeRef:o,mergedDisabledRef:i}=n,a=P(()=>{const{value:be}=o,{self:{[Ce("itemHeight",be)]:Q}}=r.value;return jt(Q)}),{uncontrolledValue:l,mergedValue:s,avlSrcValueSet:d,avlTgtValueSet:u,tgtOpts:f,srcOpts:h,filteredSrcOpts:g,filteredTgtOpts:v,srcCheckedValues:b,tgtCheckedValues:m,srcCheckedStatus:p,tgtCheckedStatus:x,srcPattern:S,tgtPattern:y,isInputing:C,fromButtonDisabled:k,toButtonDisabled:R,handleInputFocus:$,handleInputBlur:T,handleTgtFilterUpdateValue:z,handleSrcFilterUpdateValue:F}=Xj(e,i);function _(be){const{onUpdateValue:Q,"onUpdate:value":L,onChange:A}=e,{nTriggerFormInput:U,nTriggerFormChange:ae}=n;Q&&ue(Q,be),L&&ue(L,be),A&&ue(A,be),l.value=be,U(),ae()}function N(be){const{value:{checked:Q,indeterminate:L}}=p;L||Q?b.value=[]:b.value=Array.from(d.value)}function j(){const{value:{checked:be,indeterminate:Q}}=x;Q||be?m.value=[]:m.value=Array.from(u.value)}function H(be,Q){if(be)m.value.push(Q);else{const L=m.value.findIndex(A=>A===Q);~L&&m.value.splice(L,1)}}function Y(be,Q){if(be)b.value.push(Q);else{const L=b.value.findIndex(A=>A===Q);~L&&b.value.splice(L,1)}}function X(){_(b.value.concat(s.value||[])),b.value=[]}function le(){const be=new Set(m.value);_((s.value||[]).filter(Q=>!be.has(Q))),m.value=[]}ot($s,{mergedClsPrefixRef:t,mergedSizeRef:o,disabledRef:i,mergedThemeRef:r,srcCheckedValuesRef:b,tgtCheckedValuesRef:m,srcOptsRef:h,tgtOptsRef:f,srcCheckedStatusRef:p,tgtCheckedStatusRef:x,handleSrcCheckboxClick:Y,handleTgtCheckboxClick:H});const{localeRef:ke}=mr("LegacyTransfer");return{locale:ke,mergedClsPrefix:t,mergedDisabled:i,itemSize:a,isMounted:Ur(),isInputing:C,mergedTheme:r,filteredSrcOpts:g,filteredTgtOpts:v,srcPattern:S,tgtPattern:y,toButtonDisabled:R,fromButtonDisabled:k,handleSrcHeaderCheck:N,handleTgtHeaderCheck:j,handleToSrcClick:le,handleToTgtClick:X,handleInputFocus:$,handleInputBlur:T,handleTgtFilterUpdateValue:z,handleSrcFilterUpdateValue:F,cssVars:P(()=>{const{value:be}=o,{common:{cubicBezierEaseInOut:Q,cubicBezierEaseIn:L,cubicBezierEaseOut:A},self:{width:U,borderRadius:ae,borderColor:he,listColor:Re,headerColor:Oe,titleTextColor:V,titleTextColorDisabled:Te,extraTextColor:Me,filterDividerColor:Ve,itemTextColor:E,itemColorPending:W,itemTextColorDisabled:ie,extraFontSize:ge,titleFontWeight:ne,iconColor:ee,iconColorDisabled:me,[Ce("fontSize",be)]:J,[Ce("itemHeight",be)]:oe}}=r.value;return{"--n-bezier":Q,"--n-bezier-ease-in":L,"--n-bezier-ease-out":A,"--n-border-color":he,"--n-border-radius":ae,"--n-extra-font-size":ge,"--n-filter-divider-color":Ve,"--n-font-size":J,"--n-header-color":Oe,"--n-header-extra-text-color":Me,"--n-header-font-weight":ne,"--n-header-text-color":V,"--n-header-text-color-disabled":Te,"--n-item-color-pending":W,"--n-item-height":oe,"--n-item-text-color":E,"--n-item-text-color-disabled":ie,"--n-list-color":Re,"--n-width":U,"--n-icon-color":ee,"--n-icon-color-disabled":me}})}},render(){const{mergedClsPrefix:e}=this;return c("div",{class:[`${e}-legacy-transfer`,this.mergedDisabled&&`${e}-legacy-transfer--disabled`,this.filterable&&`${e}-legacy-transfer--filterable`],style:this.cssVars},c("div",{class:`${e}-legacy-transfer-list`},c(Xb,{source:!0,onChange:this.handleSrcHeaderCheck,title:this.sourceTitle||this.locale.sourceTitl
--n-merged-border-color: var(--n-border-color);
--n-merged-color: var(--n-color);
--n-merged-color-hover: var(--n-color-hover);
margin: 0;
font-size: var(--n-font-size);
transition:
background-color .3s var(--n-bezier),
color .3s var(--n-bezier),
border-color .3s var(--n-bezier);
padding: 0;
list-style-type: none;
color: var(--n-text-color);
background-color: var(--n-merged-color);
`,[I("show-divider",[w("list-item",[O("&:not(:last-child)",[M("divider",`
background-color: var(--n-merged-border-color);
`)])])]),I("clickable",[w("list-item",`
cursor: pointer;
`)]),I("bordered",`
border: 1px solid var(--n-merged-border-color);
border-radius: var(--n-border-radius);
`),I("hoverable",[w("list-item",`
border-radius: var(--n-border-radius);
`,[O("&:hover",`
background-color: var(--n-merged-color-hover);
`,[M("divider",`
background-color: transparent;
`)])])]),I("bordered, hoverable",[w("list-item",`
padding: 12px 20px;
`),M("header, footer",`
padding: 12px 20px;
`)]),M("header, footer",`
padding: 12px 0;
box-sizing: border-box;
transition: border-color .3s var(--n-bezier);
`,[O("&:not(:last-child)",`
border-bottom: 1px solid var(--n-merged-border-color);
`)]),w("list-item",`
position: relative;
padding: 12px 0;
box-sizing: border-box;
display: flex;
flex-wrap: nowrap;
align-items: center;
transition:
background-color .3s var(--n-bezier),
border-color .3s var(--n-bezier);
`,[M("prefix",`
margin-right: 20px;
flex: 0;
`),M("suffix",`
margin-left: 20px;
flex: 0;
`),M("main",`
flex: 1;
`),M("divider",`
height: 1px;
position: absolute;
bottom: 0;
left: 0;
right: 0;
background-color: transparent;
transition: background-color .3s var(--n-bezier);
pointer-events: none;
`)])]),So(w("list",`
--n-merged-color-hover: var(--n-color-hover-modal);
--n-merged-color: var(--n-color-modal);
--n-merged-border-color: var(--n-border-color-modal);
`)),jo(w("list",`
--n-merged-color-hover: var(--n-color-hover-popover);
--n-merged-color: var(--n-color-popover);
--n-merged-border-color: var(--n-border-color-popover);
`))]),wk=Object.assign(Object.assign({},ye.props),{size:{type:String,default:"medium"},bordered:Boolean,clickable:Boolean,hoverable:Boolean,showDivider:{type:Boolean,default:!0}}),Sk="n-list",tV=re({name:"List",props:wk,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:r,mergedRtlRef:n}=Ne(e),o=Wt("List",n,t),i=ye("List","-list",eV,JH,e,t);ot(Sk,{showDividerRef:ve(e,"showDivider"),mergedClsPrefixRef:t});const a=P(()=>{const{common:{cubicBezierEaseInOut:s},self:{fontSize:d,textColor:u,color:f,colorModal:h,colorPopover:g,borderColor:v,borderColorModal:b,borderColorPopover:m,borderRadius:p,colorHover:x,colorHoverModal:S,colorHoverPopover:y}}=i.value;return{"--n-font-size":d,"--n-bezier":s,"--n-text-color":u,"--n-color":f,"--n-border-radius":p,"--n-border-color":v,"--n-border-color-modal":b,"--n-border-color-popover":m,"--n-color-modal":h,"--n-color-popover":g,"--n-color-hover":x,"--n-color-hover-modal":S,"--n-color-hover-popover":y}}),l=r?Qe("list",void 0,a,e):void 0;return{mergedClsPrefix:t,rtlEnabled:o,cssVars:r?void 0:a,themeClass:l==null?void 0:l.themeClass,onRender:l==null?void 0:l.onRender}},render(){var e;const{$slots:t,mergedClsPrefix:r,onRender:n}=this;return n==null||n(),c("ul",{class:[`${r}-list`,this.rtlEnabled&&`${r}-list--rtl`,this.bordered&&`${r}-list--bordered`,this.showDivider&&`${r}-list--show-divider`,this.hoverable&&`${r}-list--hoverable`,this.clickable&&`${r}-list--clickable`,this.themeClass],style:this.cssVars},t.header?c("div",{class:`${r}-list__header`},t.header()):null,(e=t.default)===null||e===void 0?void 0:e.call(t),t.footer?c("div",{class:`${r}-list__footer`},t.footer()):null)}}),rV=re({name:"ListItem",setup(){const e=De(Sk,null);return e||_r("list-item","`n-list-item` must be placed in `n-list`."),{showDivider:e.showDividerRef,mergedClsPrefix:e.mergedClsPrefixRef}},render(){const{$slots:e,mergedClsPrefix:t}=this;return c("li",{class:`${t}-list-item`},e.prefix?c("div",{class:`${t}-list-item__prefix`},e.prefix()):null,e.default?c("div",{class:`${t}-list-item__main`},e):null,e.suffix?c("div",{class:`${t}-list-item__suffix`},e.suffix()):null,this.showDivider&&c("div",{class:`${t}-list-item__divider`}))}}),kk="n-loading-bar",Rk="n-loading-bar-api",nV=w("loading-bar-container",`
z-index: 5999;
position: fixed;
top: 0;
left: 0;
right: 0;
height: 2px;
`,[Eo({enterDuration:"0.3s",leaveDuration:"0.8s"}),w("loading-bar",`
width: 100%;
transition:
max-width 4s linear,
background .2s linear;
height: var(--n-height);
`,[I("starting",`
background: var(--n-color-loading);
`),I("finishing",`
background: var(--n-color-loading);
transition:
max-width .2s linear,
background .2s linear;
`),I("error",`
background: var(--n-color-error);
transition:
max-width .2s linear,
background .2s linear;
`)])]);var dd=function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function l(u){try{d(n.next(u))}catch(f){a(f)}}function s(u){try{d(n.throw(u))}catch(f){a(f)}}function d(u){u.done?i(u.value):o(u.value).then(l,s)}d((n=n.apply(e,t||[])).next())})};function cd(e,t){return`${t}-loading-bar ${t}-loading-bar--${e}`}const oV=re({name:"LoadingBar",props:{containerClass:String,containerStyle:[String,Object]},setup(){const{inlineThemeDisabled:e}=Ne(),{props:t,mergedClsPrefixRef:r}=De(kk),n=D(null),o=D(!1),i=D(!1),a=D(!1),l=D(!1);let s=!1;const d=D(!1),u=P(()=>{const{loadingBarStyle:C}=t;return C?C[d.value?"error":"loading"]:""});function f(){return dd(this,void 0,void 0,function*(){o.value=!1,a.value=!1,s=!1,d.value=!1,l.value=!0,yield Ot(),l.value=!1})}function h(){return dd(this,arguments,void 0,function*(C=0,k=80,R="starting"){if(i.value=!0,yield f(),s)return;a.value=!0,yield Ot();const $=n.value;$&&($.style.maxWidth=`${C}%`,$.style.transition="none",$.offsetWidth,$.className=cd(R,r.value),$.style.transition="",$.style.maxWidth=`${k}%`)})}function g(){return dd(this,void 0,void 0,function*(){if(s||d.value)return;i.value&&(yield Ot()),s=!0;const C=n.value;C&&(C.className=cd("finishing",r.value),C.style.maxWidth="100%",C.offsetWidth,a.value=!1)})}function v(){if(!(s||d.value))if(!a.value)h(100,100,"error").then(()=>{d.value=!0;const C=n.value;C&&(C.className=cd("error",r.value),C.offsetWidth,a.value=!1)});else{d.value=!0;const C=n.value;if(!C)return;C.className=cd("error",r.value),C.style.maxWidth="100%",C.offsetWidth,a.value=!1}}function b(){o.value=!0}function m(){o.value=!1}function p(){return dd(this,void 0,void 0,function*(){yield f()})}const x=ye("LoadingBar","-loading-bar",nV,n9,t,r),S=P(()=>{const{self:{height:C,colorError:k,colorLoading:R}}=x.value;return{"--n-height":C,"--n-color-loading":R,"--n-color-error":k}}),y=e?Qe("loading-bar",void 0,S,t):void 0;return{mergedClsPrefix:r,loadingBarRef:n,started:i,loading:a,entering:o,transitionDisabled:l,start:h,error:v,finish:g,handleEnter:b,handleAfterEnter:m,handleAfterLeave:p,mergedLoadingBarStyle:u,cssVars:e?void 0:S,themeClass:y==null?void 0:y.themeClass,onRender:y==null?void 0:y.onRender}},render(){if(!this.started)return null;const{mergedClsPrefix:e}=this;return c(At,{name:"fade-in-transition",appear:!0,onEnter:this.handleEnter,onAfterEnter:this.handleAfterEnter,onAfterLeave:this.handleAfterLeave,css:!this.transitionDisabled},{default:()=>{var t;return(t=this.onRender)===null||t===void 0||t.call(this),hr(c("div",{class:[`${e}-loading-bar-container`,this.themeClass,this.containerClass],style:this.containerStyle},c("div",{ref:"loadingBarRef",class:[`${e}-loading-bar`],style:[this.cssVars,this.mergedLoadingBarStyle]})),[[_n,this.loading||!this.loading&&this.entering]])}})}}),Pk=Object.assign(Object.assign({},ye.props),{to:{type:[String,Object,Boolean],default:void 0},containerClass:String,containerStyle:[String,Object],loadingBarStyle:{type:Object}}),Tk=re({name:"LoadingBarProvider",props:Pk,setup(e){const t=Ur(),r=D(null),n={start(){var i;t.value?(i=r.value)===null||i===void 0||i.start():Ot(()=>{var a;(a=r.value)===null||a===void 0||a.start()})},error(){var i;t.value?(i=r.value)===null||i===void 0||i.error():Ot(()=>{var a;(a=r.value)===null||a===void 0||a.error()})},finish(){var i;t.value?(i=r.value)===null||i===void 0||i.finish():Ot(()=>{var a;(a=r.value)===null||a===void 0||a.finish()})}},{mergedClsPrefixRef:o}=Ne(e);return ot(Rk,n),ot(kk,{props:e,mergedClsPrefixRef:o}),Object.assign(n,{loadingBarRef:r})},render(){var e,t;return c(It,null,c(cs,{disabled:this.to===!1,to:this.to||"body"},c(oV,{ref:"loadingBarRef",containerStyle:this.containerStyle,containerClass:this.containerClass})),(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e))}});function $k(){const e=De(Rk,null);return e===null&&_r("use-loading-bar","No outer <n-loading-bar-provider /> founded."),e}const iV=re({name:"LogLoader",props:{clsPrefix:{type:String,required:!0}},setup(){return{locale:mr("Log").localeRef}},render(){const{cl
position: relative;
box-sizing: border-box;
transition: border-color .3s var(--n-bezier);
`,[O("pre",`
white-space: pre-wrap;
word-break: break-word;
margin: 0;
`),w("log-loader",`
transition:
color .3s var(--n-bezier),
background-color .3s var(--n-bezier),
border-color .3s var(--n-bezier);
box-sizing: border-box;
position: absolute;
right: 16px;
top: 8px;
height: 34px;
border-radius: 17px;
line-height: 34px;
white-space: nowrap;
overflow: hidden;
border: var(--n-loader-border);
color: var(--n-loader-text-color);
background-color: var(--n-loader-color);
font-size: var(--n-loader-font-size);
`,[Ar(),M("content",`
display: inline-block;
vertical-align: bottom;
line-height: 34px;
padding-left: 40px;
padding-right: 20px;
white-space: nowrap;
`),w("base-loading",`
color: var(--n-loading-color);
position: absolute;
left: 12px;
top: calc(50% - 10px);
font-size: 20px;
width: 20px;
height: 20px;
display: inline-block;
`)])]),Ok=Object.assign(Object.assign({},ye.props),{loading:Boolean,trim:Boolean,log:String,fontSize:{type:Number,default:14},lines:{type:Array,default:()=>[]},lineHeight:{type:Number,default:1.25},language:String,rows:{type:Number,default:15},offsetTop:{type:Number,default:0},offsetBottom:{type:Number,default:0},hljs:Object,onReachTop:Function,onReachBottom:Function,onRequireMore:Function}),sV=re({name:"Log",props:Ok,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:r}=Ne(e),n=D(!1),o=P(()=>e.language!==void 0),i=P(()=>`calc(${Math.round(e.rows*e.lineHeight*e.fontSize)}px)`),a=P(()=>{const{log:x}=e;return x?x.split(`
`):e.lines}),l=D(null),s=ye("Log","-log",lV,a9,e,t);function d(x){const S=x.target,y=S.firstElementChild;if(n.value){Ot(()=>{n.value=!1});return}const C=S.offsetHeight,k=S.scrollTop,R=y.offsetHeight,$=k,T=R-k-C;if($<=e.offsetTop){const{onReachTop:z,onRequireMore:F}=e;F&&F("top"),z&&z()}if(T<=e.offsetBottom){const{onReachBottom:z,onRequireMore:F}=e;F&&F("bottom"),z&&z()}}const u=Ll(f,300);function f(x){if(n.value){Ot(()=>{n.value=!1});return}if(l.value){const{containerRef:S,contentRef:y}=l.value;if(S&&y){const C=S.offsetHeight,k=S.scrollTop,R=y.offsetHeight,$=k,T=R-k-C,z=x.deltaY;if($===0&&z<0){const{onRequireMore:F}=e;F&&F("top")}if(T<=0&&z>0){const{onRequireMore:F}=e;F&&F("bottom")}}}}function h(x){const{value:S}=l;if(!S)return;const{silent:y,top:C,position:k}=x;y&&(n.value=!0),C!==void 0?S.scrollTo({left:0,top:C}):(k==="bottom"||k==="top")&&S.scrollTo({position:k})}function g(x=!1){Qr("log","`scrollToTop` is deprecated, please use `scrollTo({ position: 'top'})` instead."),h({position:"top",silent:x})}function v(x=!1){Qr("log","`scrollToTop` is deprecated, please use `scrollTo({ position: 'bottom'})` instead."),h({position:"bottom",silent:x})}ot(zk,{languageRef:ve(e,"language"),mergedHljsRef:k1(e),trimRef:ve(e,"trim"),highlightRef:o});const b={scrollTo:h},m=P(()=>{const{self:{loaderFontSize:x,loaderTextColor:S,loaderColor:y,loaderBorder:C,loadingColor:k},common:{cubicBezierEaseInOut:R}}=s.value;return{"--n-bezier":R,"--n-loader-font-size":x,"--n-loader-border":C,"--n-loader-color":y,"--n-loader-text-color":S,"--n-loading-color":k}}),p=r?Qe("log",void 0,m,e):void 0;return Object.assign(Object.assign({},b),{mergedClsPrefix:t,scrollbarRef:l,mergedTheme:s,styleHeight:i,mergedLines:a,scrollToTop:g,scrollToBottom:v,handleWheel:u,handleScroll:d,cssVars:r?void 0:m,themeClass:p==null?void 0:p.themeClass,onRender:p==null?void 0:p.onRender})},render(){const{mergedClsPrefix:e,mergedTheme:t,onRender:r}=this;return r==null||r(),c("div",{class:[`${e}-log`,this.themeClass],style:[{lineHeight:this.lineHeight,height:this.styleHeight},this.cssVars],onWheelPassive:this.handleWheel},[c(sr,{ref:"scrollbarRef",theme:t.peers.Scrollbar,themeOverrides:t.peerOverrides.Scrollbar,onScroll:this.handleScroll},{default:()=>c(hw,{internalNoHighlight:!0,internalFontSize:this.fontSize,theme:t.peers.Code,themeOverrides:t.peerOverrides.Code},{default:()=>this.mergedLines.map((n,o)=>c(aV,{key:o,line:n}))})}),c(At,{name:"fade-in-scale-up-transition"},{default:()=>this.loading?c(iV,{clsPrefix:e}):null})])}});var dV=function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function l(u){try{d(n.next(u))}catch(f){a(f)}}function s(u){try{d(n.throw(u))}catch(f){a(f)}}function d(u){u.done?i(u.value):o(u.value).then(l,s)}d((n=n.apply(e,t||[])).next())})};const _k={distance:{type:Number,default:0},onLoad:Function,scrollbarProps:Object},cV=re({name:"InfiniteScroll",props:_k,setup(e){const t=D(null);let r=!1;const n=()=>dV(this,void 0,void 0,function*(){var a;const{value:l}=t;if(l){const{containerRef:s,containerScrollTop:d}=l,u=s==null?void 0:s.scrollHeight,f=s==null?void 0:s.clientHeight;if(s&&u!==void 0&&f!==void 0&&d+f>=u-e.distance){r=!0;try{yield(a=e.onLoad)===null||a===void 0?void 0:a.call(e)}catch{}r=!1}}});return{scrollbarInstRef:t,handleScroll:()=>{r||n()},handleWheel:a=>{a.deltaY<=0||r||n()}}},render(){return c(el,Object.assign({},this.scrollbarProps,{ref:"scrollbarInstRef",onWheel:this.handleWheel,onScroll:this.handleScroll}),{default:()=>yt(this.$slots.default,()=>[])})}}),zs="n-menu",Og="n-submenu",_g="n-menu-item-group",ud=8;function Mg(e){const t=De(zs),{props:r,mergedCollapsedRef:n}=t,o=De(Og,null),i=De(_g,null),a=P(()=>r.mode==="horizontal"),l=P(()=>a.value?r.dropdownPlacement:"tmNodes"in e?"right-start":"right"),s=P(()=>{var h;return Math.max((h=r.collapsedIconSize)!==null&&h!==void 0?h:r.iconSize,r.iconSize)}),d=P(()=>{var h;return!a.value&&e.root&&n.value&&(h=r.collapsedIconSize)!==null&&h!==void 0?h:r.iconSize}),u=P(()=>{if(a.value)return;const{collapsedWidth:h,indent:g,rootIndent:v}
color: var(--n-arrow-color-hover);
`),M("icon",`
color: var(--n-item-icon-color-hover);
`),w("menu-item-content-header",`
color: var(--n-item-text-color-hover);
`,[O("a",`
color: var(--n-item-text-color-hover);
`),M("extra",`
color: var(--n-item-text-color-hover);
`)])],t0=[M("icon",`
color: var(--n-item-icon-color-hover-horizontal);
`),w("menu-item-content-header",`
color: var(--n-item-text-color-hover-horizontal);
`,[O("a",`
color: var(--n-item-text-color-hover-horizontal);
`),M("extra",`
color: var(--n-item-text-color-hover-horizontal);
`)])],bV=O([w("menu",`
background-color: var(--n-color);
color: var(--n-item-text-color);
overflow: hidden;
transition: background-color .3s var(--n-bezier);
box-sizing: border-box;
font-size: var(--n-font-size);
padding-bottom: 6px;
`,[I("horizontal",`
max-width: 100%;
width: 100%;
display: flex;
overflow: hidden;
padding-bottom: 0;
`,[w("submenu","margin: 0;"),w("menu-item","margin: 0;"),w("menu-item-content",`
padding: 0 20px;
border-bottom: 2px solid #0000;
`,[O("&::before","display: none;"),I("selected","border-bottom: 2px solid var(--n-border-color-horizontal)")]),w("menu-item-content",[I("selected",[M("icon","color: var(--n-item-icon-color-active-horizontal);"),w("menu-item-content-header",`
color: var(--n-item-text-color-active-horizontal);
`,[O("a","color: var(--n-item-text-color-active-horizontal);"),M("extra","color: var(--n-item-text-color-active-horizontal);")])]),I("child-active",`
border-bottom: 2px solid var(--n-border-color-horizontal);
`,[w("menu-item-content-header",`
color: var(--n-item-text-color-child-active-horizontal);
`,[O("a",`
color: var(--n-item-text-color-child-active-horizontal);
`),M("extra",`
color: var(--n-item-text-color-child-active-horizontal);
`)]),M("icon",`
color: var(--n-item-icon-color-child-active-horizontal);
`)]),xt("disabled",[xt("selected, child-active",[O("&:focus-within",t0)]),I("selected",[Bi(null,[M("icon","color: var(--n-item-icon-color-active-hover-horizontal);"),w("menu-item-content-header",`
color: var(--n-item-text-color-active-hover-horizontal);
`,[O("a","color: var(--n-item-text-color-active-hover-horizontal);"),M("extra","color: var(--n-item-text-color-active-hover-horizontal);")])])]),I("child-active",[Bi(null,[M("icon","color: var(--n-item-icon-color-child-active-hover-horizontal);"),w("menu-item-content-header",`
color: var(--n-item-text-color-child-active-hover-horizontal);
`,[O("a","color: var(--n-item-text-color-child-active-hover-horizontal);"),M("extra","color: var(--n-item-text-color-child-active-hover-horizontal);")])])]),Bi("border-bottom: 2px solid var(--n-border-color-horizontal);",t0)]),w("menu-item-content-header",[O("a","color: var(--n-item-text-color-horizontal);")])])]),xt("responsive",[w("menu-item-content-header",`
overflow: hidden;
text-overflow: ellipsis;
`)]),I("collapsed",[w("menu-item-content",[I("selected",[O("&::before",`
background-color: var(--n-item-color-active-collapsed) !important;
`)]),w("menu-item-content-header","opacity: 0;"),M("arrow","opacity: 0;"),M("icon","color: var(--n-item-icon-color-collapsed);")])]),w("menu-item",`
height: var(--n-item-height);
margin-top: 6px;
position: relative;
`),w("menu-item-content",`
box-sizing: border-box;
line-height: 1.75;
height: 100%;
display: grid;
grid-template-areas: "icon content arrow";
grid-template-columns: auto 1fr auto;
align-items: center;
cursor: pointer;
position: relative;
padding-right: 18px;
transition:
background-color .3s var(--n-bezier),
padding-left .3s var(--n-bezier),
border-color .3s var(--n-bezier);
`,[O("> *","z-index: 1;"),O("&::before",`
z-index: auto;
content: "";
background-color: #0000;
position: absolute;
left: 8px;
right: 8px;
top: 0;
bottom: 0;
pointer-events: none;
border-radius: var(--n-border-radius);
transition: background-color .3s var(--n-bezier);
`),I("disabled",`
opacity: .45;
cursor: not-allowed;
`),I("collapsed",[M("arrow","transform: rotate(0);")]),I("selected",[O("&::before","background-color: var(--n-item-color-active);"),M("arrow","color: var(--n-arrow-color-active);"),M("icon","color: var(--n-item-icon-color-active);"),w("menu-item-content-header",`
color: var(--n-item-text-color-active);
`,[O("a","color: var(--n-item-text-color-active);"),M("extra","color: var(--n-item-text-color-active);")])]),I("child-active",[w("menu-item-content-header",`
color: var(--n-item-text-color-child-active);
`,[O("a",`
color: var(--n-item-text-color-child-active);
`),M("extra",`
color: var(--n-item-text-color-child-active);
`)]),M("arrow",`
color: var(--n-arrow-color-child-active);
`),M("icon",`
color: var(--n-item-icon-color-child-active);
`)]),xt("disabled",[xt("selected, child-active",[O("&:focus-within",e0)]),I("selected",[Bi(null,[M("arrow","color: var(--n-arrow-color-active-hover);"),M("icon","color: var(--n-item-icon-color-active-hover);"),w("menu-item-content-header",`
color: var(--n-item-text-color-active-hover);
`,[O("a","color: var(--n-item-text-color-active-hover);"),M("extra","color: var(--n-item-text-color-active-hover);")])])]),I("child-active",[Bi(null,[M("arrow","color: var(--n-arrow-color-child-active-hover);"),M("icon","color: var(--n-item-icon-color-child-active-hover);"),w("menu-item-content-header",`
color: var(--n-item-text-color-child-active-hover);
`,[O("a","color: var(--n-item-text-color-child-active-hover);"),M("extra","color: var(--n-item-text-color-child-active-hover);")])])]),I("selected",[Bi(null,[O("&::before","background-color: var(--n-item-color-active-hover);")])]),Bi(null,e0)]),M("icon",`
grid-area: icon;
color: var(--n-item-icon-color);
transition:
color .3s var(--n-bezier),
font-size .3s var(--n-bezier),
margin-right .3s var(--n-bezier);
box-sizing: content-box;
display: inline-flex;
align-items: center;
justify-content: center;
`),M("arrow",`
grid-area: arrow;
font-size: 16px;
color: var(--n-arrow-color);
transform: rotate(180deg);
opacity: 1;
transition:
color .3s var(--n-bezier),
transform 0.2s var(--n-bezier),
opacity 0.2s var(--n-bezier);
`),w("menu-item-content-header",`
grid-area: content;
transition:
color .3s var(--n-bezier),
opacity .3s var(--n-bezier);
opacity: 1;
white-space: nowrap;
color: var(--n-item-text-color);
`,[O("a",`
outline: none;
text-decoration: none;
transition: color .3s var(--n-bezier);
color: var(--n-item-text-color);
`,[O("&::before",`
content: "";
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
`)]),M("extra",`
font-size: .93em;
color: var(--n-group-text-color);
transition: color .3s var(--n-bezier);
`)])]),w("submenu",`
cursor: pointer;
position: relative;
margin-top: 6px;
`,[w("menu-item-content",`
height: var(--n-item-height);
`),w("submenu-children",`
overflow: hidden;
padding: 0;
`,[Ao({duration:".2s"})])]),w("menu-item-group",[w("menu-item-group-title",`
margin-top: 6px;
color: var(--n-group-text-color);
cursor: default;
font-size: .93em;
height: 36px;
display: flex;
align-items: center;
transition:
padding-left .3s var(--n-bezier),
color .3s var(--n-bezier);
`)])]),w("menu-tooltip",[O("a",`
color: inherit;
text-decoration: none;
`)]),w("menu-divider",`
transition: background-color .3s var(--n-bezier);
background-color: var(--n-divider-color);
height: 1px;
margin: 6px 18px;
`)]);function Bi(e,t){return[I("hover",e,t),O("&:hover",e,t)]}const Ek=Object.assign(Object.assign({},ye.props),{options:{type:Array,default:()=>[]},collapsed:{type:Boolean,default:void 0},collapsedWidth:{type:Number,default:48},iconSize:{type:Number,default:20},collapsedIconSize:{type:Number,default:24},rootIndent:Number,indent:{type:Number,default:32},labelField:{type:String,default:"label"},keyField:{type:String,default:"key"},childrenField:{type:String,default:"children"},disabledField:{type:String,default:"disabled"},defaultExpandAll:Boolean,defaultExpandedKeys:Array,expandedKeys:Array,value:[String,Number],defaultValue:{type:[String,Number],default:null},mode:{type:String,default:"vertical"},watchProps:{type:Array,default:void 0},disabled:Boolean,show:{type:Boolean,default:!0},inverted:Boolean,"onUpdate:expandedKeys":[Function,Array],onUpdateExpandedKeys:[Function,Array],onUpdateValue:[Function,Array],"onUpdate:value":[Function,Array],expandIcon:Function,renderIcon:Function,renderLabel:Function,renderExtra:Function,dropdownProps:Object,accordion:Boolean,nodeProps:Function,dropdownPlacement:{type:String,default:"bottom"},responsive:Boolean,items:Array,onOpenNamesChange:[Function,Array],onSelect:[Function,Array],onExpandedNamesChange:[Function,Array],expandedNames:Array,defaultExpandedNames:Array}),xV=re({name:"Menu",props:Ek,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:r}=Ne(e),n=ye("Menu","-menu",bV,u9,e,t),o=De(vk,null),i=P(()=>{var Q;const{collapsed:L}=e;if(L!==void 0)return L;if(o){const{collapseModeRef:A,collapsedRef:U}=o;if(A.value==="width")return(Q=U.value)!==null&&Q!==void 0?Q:!1}return!1}),a=P(()=>{const{keyField:Q,childrenField:L,disabledField:A}=e;return On(e.items||e.options,{getIgnored(U){return jh(U)},getChildren(U){return U[L]},getDisabled(U){return U[A]},getKey(U){var ae;return(ae=U[Q])!==null&&ae!==void 0?ae:U.name}})}),l=P(()=>new Set(a.value.treeNodes.map(Q=>Q.key))),{watchProps:s}=e,d=D(null);s!=null&&s.includes("defaultValue")?Et(()=>{d.value=e.defaultValue}):d.value=e.defaultValue;const u=ve(e,"value"),f=$t(u,d),h=D([]),g=()=>{h.value=e.defaultExpandAll?a.value.getNonLeafKeys():e.defaultExpandedNames||e.defaultExpandedKeys||a.value.getPath(f.value,{includeSelf:!1}).keyPath};s!=null&&s.includes("defaultExpandedKeys")?Et(g):g();const v=bi(e,["expandedNames","expandedKeys"]),b=$t(v,h),m=P(()=>a.value.treeNodes),p=P(()=>a.value.getPath(f.value).keyPath);ot(zs,{props:e,mergedCollapsedRef:i,mergedThemeRef:n,mergedValueRef:f,mergedExpandedKeysRef:b,activePathRef:p,mergedClsPrefixRef:t,isHorizontalRef:P(()=>e.mode==="horizontal"),invertedRef:ve(e,"inverted"),doSelect:x,toggleExpand:y});function x(Q,L){const{"onUpdate:value":A,onUpdateValue:U,onSelect:ae}=e;U&&ue(U,Q,L),A&&ue(A,Q,L),ae&&ue(ae,Q,L),d.value=Q}function S(Q){const{"onUpdate:expandedKeys":L,onUpdateExpandedKeys:A,onExpandedNamesChange:U,onOpenNamesChange:ae}=e;L&&ue(L,Q),A&&ue(A,Q),U&&ue(U,Q),ae&&ue(ae,Q),h.value=Q}function y(Q){const L=Array.from(b.value),A=L.findIndex(U=>U===Q);if(~A)L.splice(A,1);else{if(e.accordion&&l.value.has(Q)){const U=L.findIndex(ae=>l.value.has(ae));U>-1&&L.splice(U,1)}L.push(Q)}S(L)}const C=Q=>{const L=a.value.getPath(Q??f.value,{includeSelf:!1}).keyPath;if(!L.length)return;const A=Array.from(b.value),U=new Set([...A,...L]);e.accordion&&l.value.forEach(ae=>{U.has(ae)&&!L.includes(ae)&&U.delete(ae)}),S(Array.from(U))},k=P(()=>{const{inverted:Q}=e,{common:{cubicBezierEaseInOut:L},self:A}=n.value,{borderRadius:U,borderColorHorizontal:ae,fontSize:he,itemHeight:Re,dividerColor:Oe}=A,V={"--n-divider-color":Oe,"--n-bezier":L,"--n-font-size":he,"--n-border-color-horizontal":ae,"--n-border-radius":U,"--n-item-height":Re};return Q?(V["--n-group-text-color"]=A.groupTextColorInverted,V["--n-color"]=A.colorInverted,V["--n-item-text-color"]=A.itemTextColorInverted,V["--n-item-text-color-hover"]=A.itemTextColorHoverInverted,V["--n-item-text-color-active"]=A.itemTextColorActiveInverted,V["--n-item-text-color-child-active"]=A.itemTextColorChildActiveInverted,V["--n-item-text-color-child-active-hover"]=A.itemTextColor
box-shadow: var(--n-menu-box-shadow);
`,[Ar({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]),Ak=Object.assign(Object.assign({},ye.props),{to:Kt.propTo,autosize:[Boolean,Object],options:{type:Array,default:[]},filter:{type:Function,default:(e,t)=>e?typeof t.label=="string"?t.label.startsWith(e):typeof t.value=="string"?t.value.startsWith(e):!1:!0},type:{type:String,default:"text"},separator:{type:String,validator:e=>e.length!==1?(Qr("mention","`separator`'s length must be 1."),!1):!0,default:" "},bordered:{type:Boolean,default:void 0},disabled:Boolean,value:String,defaultValue:{type:String,default:""},loading:Boolean,prefix:{type:[String,Array],default:"@"},placeholder:{type:String,default:""},placement:{type:String,default:"bottom-start"},size:String,renderLabel:Function,status:String,"onUpdate:show":[Array,Function],onUpdateShow:[Array,Function],"onUpdate:value":[Array,Function],onUpdateValue:[Array,Function],onSearch:Function,onSelect:Function,onFocus:Function,onBlur:Function,internalDebug:Boolean}),wV=re({name:"Mention",props:Ak,setup(e){const{namespaceRef:t,mergedClsPrefixRef:r,mergedBorderedRef:n,inlineThemeDisabled:o}=Ne(e),i=ye("Mention","-mention",CV,d9,e,r),a=Rr(e),l=D(null),s=D(null),d=D(null),u=D("");let f=null,h=null,g=null;const v=P(()=>{const{value:L}=u;return e.options.filter(A=>e.filter(L,A))}),b=P(()=>On(v.value,{getKey:L=>L.value})),m=D(null),p=D(!1),x=D(e.defaultValue),S=ve(e,"value"),y=$t(S,x),C=P(()=>{const{self:{menuBoxShadow:L}}=i.value;return{"--n-menu-box-shadow":L}}),k=o?Qe("mention",void 0,C,e):void 0;function R(L){if(e.disabled)return;const{onUpdateShow:A,"onUpdate:show":U}=e;A&&ue(A,L),U&&ue(U,L),L||(f=null,h=null,g=null),p.value=L}function $(L){const{onUpdateValue:A,"onUpdate:value":U}=e,{nTriggerFormChange:ae,nTriggerFormInput:he}=a;U&&ue(U,L),A&&ue(A,L),he(),ae(),x.value=L}function T(){return e.type==="text"?l.value.inputElRef:l.value.textareaElRef}function z(){var L;const A=T();if(document.activeElement!==A){R(!1);return}const{selectionEnd:U}=A;if(U===null){R(!1);return}const ae=A.value,{separator:he}=e,{prefix:Re}=e,Oe=typeof Re=="string"?[Re]:Re;for(let V=U-1;V>=0;--V){const Te=ae[V];if(Te===he||Te===`
`||Te==="\r"){R(!1);return}if(Oe.includes(Te)){const Me=ae.slice(V+1,U);R(!0),(L=e.onSearch)===null||L===void 0||L.call(e,Me,Te),u.value=Me,f=Te,h=V+1,g=U;return}}R(!1)}function F(){const{value:L}=s;if(!L)return;const A=T(),U=yV(A);U.left+=A.parentElement.offsetLeft,L.style.left=`${U.left}px`,L.style.top=`${U.top+U.height}px`}function _(){var L;p.value&&((L=d.value)===null||L===void 0||L.syncPosition())}function N(L){$(L),j()}function j(){setTimeout(()=>{F(),z(),Ot().then(_)},0)}function H(L){var A,U;if(L.key==="ArrowLeft"||L.key==="ArrowRight"){if(!((A=l.value)===null||A===void 0)&&A.isCompositing)return;j()}else if(L.key==="ArrowUp"||L.key==="ArrowDown"||L.key==="Enter"){if(!((U=l.value)===null||U===void 0)&&U.isCompositing)return;const{value:ae}=m;if(p.value){if(ae)if(L.preventDefault(),L.key==="ArrowUp")ae.prev();else if(L.key==="ArrowDown")ae.next();else{const he=ae.getPendingTmNode();he?be(he):R(!1)}}else j()}}function Y(L){const{onFocus:A}=e;A==null||A(L);const{nTriggerFormFocus:U}=a;U(),j()}function X(){var L;(L=l.value)===null||L===void 0||L.focus()}function le(){var L;(L=l.value)===null||L===void 0||L.blur()}function ke(L){const{onBlur:A}=e;A==null||A(L);const{nTriggerFormBlur:U}=a;U(),R(!1)}function be(L){var A;if(f===null||h===null||g===null)return;const{rawNode:{value:U=""}}=L,ae=T(),he=ae.value,{separator:Re}=e,Oe=he.slice(g),V=Oe.startsWith(Re),Te=`${U}${V?"":Re}`;$(he.slice(0,h)+Te+Oe),(A=e.onSelect)===null||A===void 0||A.call(e,L.rawNode,f);const Me=h+Te.length+(V?1:0);Ot().then(()=>{ae.selectionStart=Me,ae.selectionEnd=Me,z()})}function Q(){e.disabled||j()}return{namespace:t,mergedClsPrefix:r,mergedBordered:n,mergedSize:a.mergedSizeRef,mergedStatus:a.mergedStatusRef,mergedTheme:i,treeMate:b,selectMenuInstRef:m,inputInstRef:l,cursorRef:s,followerRef:d,showMenu:p,adjustedTo:Kt(e),isMounted:Ur(),mergedValue:y,handleInputFocus:Y,handleInputBlur:ke,handleInputUpdateValue:N,handleInputKeyDown:H,handleSelect:be,handleInputMouseDown:Q,focus:X,blur:le,cssVars:o?void 0:C,themeClass:k==null?void 0:k.themeClass,onRender:k==null?void 0:k.onRender}},render(){const{mergedTheme:e,mergedClsPrefix:t,$slots:r}=this;return c("div",{class:`${t}-mention`},c(jr,{status:this.mergedStatus,themeOverrides:e.peerOverrides.Input,theme:e.peers.Input,size:this.mergedSize,autosize:this.autosize,type:this.type,ref:"inputInstRef",placeholder:this.placeholder,onMousedown:this.handleInputMouseDown,onUpdateValue:this.handleInputUpdateValue,onKeydown:this.handleInputKeyDown,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur,bordered:this.mergedBordered,disabled:this.disabled,value:this.mergedValue}),c(qn,null,{default:()=>[c(Yn,null,{default:()=>c("div",{style:{position:"absolute",width:0,height:0},ref:"cursorRef"})}),c(Mn,{ref:"followerRef",placement:this.placement,show:this.showMenu,containerClass:this.namespace,to:this.adjustedTo,teleportDisabled:this.adjustedTo===Kt.tdkey},{default:()=>c(At,{name:"fade-in-scale-up-transition",appear:this.isMounted},{default:()=>{const{mergedTheme:n,onRender:o}=this;return o==null||o(),this.showMenu?c(ws,{clsPrefix:t,theme:n.peers.InternalSelectMenu,themeOverrides:n.peerOverrides.InternalSelectMenu,autoPending:!0,ref:"selectMenuInstRef",class:[`${t}-mention-menu`,this.themeClass],loading:this.loading,treeMate:this.treeMate,virtualScroll:!1,style:this.cssVars,onToggle:this.handleSelect,renderLabel:this.renderLabel},r):null}})})]}))}}),Bk={icon:Function,type:{type:String,default:"info"},content:[String,Number,Function],showIcon:{type:Boolean,default:!0},closable:Boolean,keepAliveOnHover:Boolean,onClose:Function,onMouseenter:Function,onMouseleave:Function},Nk="n-message-api",Lk="n-message-provider",SV=O([w("message-wrapper",`
margin: var(--n-margin);
z-index: 0;
transform-origin: top center;
display: flex;
`,[Ao({overflow:"visible",originalTransition:"transform .3s var(--n-bezier)",enterToProps:{transform:"scale(1)"},leaveToProps:{transform:"scale(0.85)"}})]),w("message",`
box-sizing: border-box;
display: flex;
align-items: center;
transition:
color .3s var(--n-bezier),
box-shadow .3s var(--n-bezier),
background-color .3s var(--n-bezier),
opacity .3s var(--n-bezier),
transform .3s var(--n-bezier),
margin-bottom .3s var(--n-bezier);
padding: var(--n-padding);
border-radius: var(--n-border-radius);
flex-wrap: nowrap;
overflow: hidden;
max-width: var(--n-max-width);
color: var(--n-text-color);
background-color: var(--n-color);
box-shadow: var(--n-box-shadow);
`,[M("content",`
display: inline-block;
line-height: var(--n-line-height);
font-size: var(--n-font-size);
`),M("icon",`
position: relative;
margin: var(--n-icon-margin);
height: var(--n-icon-size);
width: var(--n-icon-size);
font-size: var(--n-icon-size);
flex-shrink: 0;
`,[["default","info","success","warning","error","loading"].map(e=>I(`${e}-type`,[O("> *",`
color: var(--n-icon-color-${e});
transition: color .3s var(--n-bezier);
`)])),O("> *",`
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
`,[qr()])]),M("close",`
margin: var(--n-close-margin);
transition:
background-color .3s var(--n-bezier),
color .3s var(--n-bezier);
flex-shrink: 0;
`,[O("&:hover",`
color: var(--n-close-icon-color-hover);
`),O("&:active",`
color: var(--n-close-icon-color-pressed);
`)])]),w("message-container",`
z-index: 6000;
position: fixed;
height: 0;
overflow: visible;
display: flex;
flex-direction: column;
align-items: center;
`,[I("top",`
top: 12px;
left: 0;
right: 0;
`),I("top-left",`
top: 12px;
left: 12px;
right: 0;
align-items: flex-start;
`),I("top-right",`
top: 12px;
left: 0;
right: 12px;
align-items: flex-end;
`),I("bottom",`
bottom: 4px;
left: 0;
right: 0;
justify-content: flex-end;
`),I("bottom-left",`
bottom: 4px;
left: 12px;
right: 0;
justify-content: flex-end;
align-items: flex-start;
`),I("bottom-right",`
bottom: 4px;
left: 0;
right: 12px;
justify-content: flex-end;
align-items: flex-end;
`)])]),kV={info:()=>c(Ri,null),success:()=>c(pa,null),warning:()=>c(zi,null),error:()=>c(ga,null),default:()=>null},RV=re({name:"Message",props:Object.assign(Object.assign({},Bk),{render:Function}),setup(e){const{inlineThemeDisabled:t,mergedRtlRef:r}=Ne(e),{props:n,mergedClsPrefixRef:o}=De(Lk),i=Wt("Message",r,o),a=ye("Message","-message",SV,jH,n,o),l=P(()=>{const{type:d}=e,{common:{cubicBezierEaseInOut:u},self:{padding:f,margin:h,maxWidth:g,iconMargin:v,closeMargin:b,closeSize:m,iconSize:p,fontSize:x,lineHeight:S,borderRadius:y,iconColorInfo:C,iconColorSuccess:k,iconColorWarning:R,iconColorError:$,iconColorLoading:T,closeIconSize:z,closeBorderRadius:F,[Ce("textColor",d)]:_,[Ce("boxShadow",d)]:N,[Ce("color",d)]:j,[Ce("closeColorHover",d)]:H,[Ce("closeColorPressed",d)]:Y,[Ce("closeIconColor",d)]:X,[Ce("closeIconColorPressed",d)]:le,[Ce("closeIconColorHover",d)]:ke}}=a.value;return{"--n-bezier":u,"--n-margin":h,"--n-padding":f,"--n-max-width":g,"--n-font-size":x,"--n-icon-margin":v,"--n-icon-size":p,"--n-close-icon-size":z,"--n-close-border-radius":F,"--n-close-size":m,"--n-close-margin":b,"--n-text-color":_,"--n-color":j,"--n-box-shadow":N,"--n-icon-color-info":C,"--n-icon-color-success":k,"--n-icon-color-warning":R,"--n-icon-color-error":$,"--n-icon-color-loading":T,"--n-close-color-hover":H,"--n-close-color-pressed":Y,"--n-close-icon-color":X,"--n-close-icon-color-pressed":le,"--n-close-icon-color-hover":ke,"--n-line-height":S,"--n-border-radius":y}}),s=t?Qe("message",P(()=>e.type[0]),l,{}):void 0;return{mergedClsPrefix:o,rtlEnabled:i,messageProviderProps:n,handleClose(){var d;(d=e.onClose)===null||d===void 0||d.call(e)},cssVars:t?void 0:l,themeClass:s==null?void 0:s.themeClass,onRender:s==null?void 0:s.onRender,placement:n.placement}},render(){const{render:e,type:t,closable:r,content:n,mergedClsPrefix:o,cssVars:i,themeClass:a,onRender:l,icon:s,handleClose:d,showIcon:u}=this;l==null||l();let f;return c("div",{class:[`${o}-message-wrapper`,a],onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave,style:[{alignItems:this.placement.startsWith("top")?"flex-start":"flex-end"},i]},e?e(this.$props):c("div",{class:[`${o}-message ${o}-message--${t}-type`,this.rtlEnabled&&`${o}-message--rtl`]},(f=PV(s,t,o))&&u?c("div",{class:`${o}-message__icon ${o}-message__icon--${t}-type`},c(ko,null,{default:()=>f})):null,c("div",{class:`${o}-message__content`},Zt(n)),r?c(Wo,{clsPrefix:o,class:`${o}-message__close`,onClick:d,absolute:!0}):null))}});function PV(e,t,r){if(typeof e=="function")return e();{const n=t==="loading"?c(to,{clsPrefix:r,strokeWidth:24,scale:.85}):kV[t]();return n?c(ut,{clsPrefix:r,key:t},{default:()=>n}):null}}const TV=re({name:"MessageEnvironment",props:Object.assign(Object.assign({},Bk),{duration:{type:Number,default:3e3},onAfterLeave:Function,onLeave:Function,internalKey:{type:String,required:!0},onInternalAfterLeave:Function,onHide:Function,onAfterHide:Function}),setup(e){let t=null;const r=D(!0);Bt(()=>{n()});function n(){const{duration:u}=e;u&&(t=window.setTimeout(a,u))}function o(u){u.currentTarget===u.target&&t!==null&&(window.clearTimeout(t),t=null)}function i(u){u.currentTarget===u.target&&n()}function a(){const{onHide:u}=e;r.value=!1,t&&(window.clearTimeout(t),t=null),u&&u()}function l(){const{onClose:u}=e;u&&u(),a()}function s(){const{onAfterLeave:u,onInternalAfterLeave:f,onAfterHide:h,internalKey:g}=e;u&&u(),f&&f(g),h&&h()}function d(){a()}return{show:r,hide:a,handleClose:l,handleAfterLeave:s,handleMouseleave:i,handleMouseenter:o,deactivate:d}},render(){return c(Ro,{appear:!0,onAfterLeave:this.handleAfterLeave,onLeave:this.onLeave},{default:()=>[this.show?c(RV,{content:this.content,type:this.type,icon:this.icon,showIcon:this.showIcon,closable:this.closable,onClose:this.handleClose,onMouseenter:this.keepAliveOnHover?this.handleMouseenter:void 0,onMouseleave:this.keepAliveOnHover?this.handleMouseleave:void 0}):null]})}}),Hk=Object.assign(Object.assign({},ye.props),{to:[String,Object],duration:{type:Number,default:3e3},keepAliveOnHover:Boolean,max:Number,placement:{type:String,default:"top"},closable:Bo
z-index: 4000;
position: fixed;
overflow: visible;
display: flex;
flex-direction: column;
align-items: flex-end;
`,[O(">",[w("scrollbar",`
width: initial;
overflow: visible;
height: -moz-fit-content !important;
height: fit-content !important;
max-height: 100vh !important;
`,[O(">",[w("scrollbar-container",`
height: -moz-fit-content !important;
height: fit-content !important;
max-height: 100vh !important;
`,[w("scrollbar-content",`
padding-top: 12px;
padding-bottom: 33px;
`)])])])]),I("top, top-right, top-left",`
top: 12px;
`,[O("&.transitioning >",[w("scrollbar",[O(">",[w("scrollbar-container",`
min-height: 100vh !important;
`)])])])]),I("bottom, bottom-right, bottom-left",`
bottom: 12px;
`,[O(">",[w("scrollbar",[O(">",[w("scrollbar-container",[w("scrollbar-content",`
padding-bottom: 12px;
`)])])])]),w("notification-wrapper",`
display: flex;
align-items: flex-end;
margin-bottom: 0;
margin-top: 12px;
`)]),I("top, bottom",`
left: 50%;
transform: translateX(-50%);
`,[w("notification-wrapper",[O("&.notification-transition-enter-from, &.notification-transition-leave-to",`
transform: scale(0.85);
`),O("&.notification-transition-leave-from, &.notification-transition-enter-to",`
transform: scale(1);
`)])]),I("top",[w("notification-wrapper",`
transform-origin: top center;
`)]),I("bottom",[w("notification-wrapper",`
transform-origin: bottom center;
`)]),I("top-right, bottom-right",[w("notification",`
margin-left: 28px;
margin-right: 16px;
`)]),I("top-left, bottom-left",[w("notification",`
margin-left: 16px;
margin-right: 28px;
`)]),I("top-right",`
right: 0;
`,[fd("top-right")]),I("top-left",`
left: 0;
`,[fd("top-left")]),I("bottom-right",`
right: 0;
`,[fd("bottom-right")]),I("bottom-left",`
left: 0;
`,[fd("bottom-left")]),I("scrollable",[I("top-right",`
top: 0;
`),I("top-left",`
top: 0;
`),I("bottom-right",`
bottom: 0;
`),I("bottom-left",`
bottom: 0;
`)]),w("notification-wrapper",`
margin-bottom: 12px;
`,[O("&.notification-transition-enter-from, &.notification-transition-leave-to",`
opacity: 0;
margin-top: 0 !important;
margin-bottom: 0 !important;
`),O("&.notification-transition-leave-from, &.notification-transition-enter-to",`
opacity: 1;
`),O("&.notification-transition-leave-active",`
transition:
background-color .3s var(--n-bezier),
color .3s var(--n-bezier),
opacity .3s var(--n-bezier),
transform .3s var(--n-bezier-ease-in),
max-height .3s var(--n-bezier),
margin-top .3s linear,
margin-bottom .3s linear,
box-shadow .3s var(--n-bezier);
`),O("&.notification-transition-enter-active",`
transition:
background-color .3s var(--n-bezier),
color .3s var(--n-bezier),
opacity .3s var(--n-bezier),
transform .3s var(--n-bezier-ease-out),
max-height .3s var(--n-bezier),
margin-top .3s linear,
margin-bottom .3s linear,
box-shadow .3s var(--n-bezier);
`)]),w("notification",`
background-color: var(--n-color);
color: var(--n-text-color);
transition:
background-color .3s var(--n-bezier),
color .3s var(--n-bezier),
opacity .3s var(--n-bezier),
box-shadow .3s var(--n-bezier);
font-family: inherit;
font-size: var(--n-font-size);
font-weight: 400;
position: relative;
display: flex;
overflow: hidden;
flex-shrink: 0;
padding-left: var(--n-padding-left);
padding-right: var(--n-padding-right);
width: var(--n-width);
max-width: calc(100vw - 16px - 16px);
border-radius: var(--n-border-radius);
box-shadow: var(--n-box-shadow);
box-sizing: border-box;
opacity: 1;
`,[M("avatar",[w("icon",`
color: var(--n-icon-color);
`),w("base-icon",`
color: var(--n-icon-color);
`)]),I("show-avatar",[w("notification-main",`
margin-left: 40px;
width: calc(100% - 40px);
`)]),I("closable",[w("notification-main",[O("> *:first-child",`
padding-right: 20px;
`)]),M("close",`
position: absolute;
top: 0;
right: 0;
margin: var(--n-close-margin);
transition:
background-color .3s var(--n-bezier),
color .3s var(--n-bezier);
`)]),M("avatar",`
position: absolute;
top: var(--n-padding-top);
left: var(--n-padding-left);
width: 28px;
height: 28px;
font-size: 28px;
display: flex;
align-items: center;
justify-content: center;
`,[w("icon","transition: color .3s var(--n-bezier);")]),w("notification-main",`
padding-top: var(--n-padding-top);
padding-bottom: var(--n-padding-bottom);
box-sizing: border-box;
display: flex;
flex-direction: column;
margin-left: 8px;
width: calc(100% - 8px);
`,[w("notification-main-footer",`
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 12px;
`,[M("meta",`
font-size: var(--n-meta-font-size);
transition: color .3s var(--n-bezier-ease-out);
color: var(--n-description-text-color);
`),M("action",`
cursor: pointer;
transition: color .3s var(--n-bezier-ease-out);
color: var(--n-action-text-color);
`)]),M("header",`
font-weight: var(--n-title-font-weight);
font-size: var(--n-title-font-size);
transition: color .3s var(--n-bezier-ease-out);
color: var(--n-title-text-color);
`),M("description",`
margin-top: 8px;
font-size: var(--n-description-font-size);
white-space: pre-wrap;
word-wrap: break-word;
transition: color .3s var(--n-bezier-ease-out);
color: var(--n-description-text-color);
`),M("content",`
line-height: var(--n-line-height);
margin: 12px 0 0 0;
font-family: inherit;
white-space: pre-wrap;
word-wrap: break-word;
transition: color .3s var(--n-bezier-ease-out);
color: var(--n-text-color);
`,[O("&:first-child","margin: 0;")])])])])]);function fd(e){const r=e.split("-")[1]==="left"?"calc(-100%)":"calc(100%)";return w("notification-wrapper",[O("&.notification-transition-enter-from, &.notification-transition-leave-to",`
transform: translate(${r}, 0);
`),O("&.notification-transition-leave-from, &.notification-transition-enter-to",`
transform: translate(0, 0);
`)])}const Gk="n-notification-api",Xk=Object.assign(Object.assign({},ye.props),{containerClass:String,containerStyle:[String,Object],to:[String,Object],scrollable:{type:Boolean,default:!0},max:Number,placement:{type:String,default:"top-right"},keepAliveOnHover:Boolean}),Zk=re({name:"NotificationProvider",props:Xk,setup(e){const{mergedClsPrefixRef:t}=Ne(e),r=D([]),n={},o=new Set;function i(g){const v=sn(),b=()=>{o.add(v),n[v]&&n[v].hide()},m=Bo(Object.assign(Object.assign({},g),{key:v,destroy:b,hide:b,deactivate:b})),{max:p}=e;if(p&&r.value.length-o.size>=p){let x=!1,S=0;for(const y of r.value){if(!o.has(y.key)){n[y.key]&&(y.destroy(),x=!0);break}S++}x||r.value.splice(S,1)}return r.value.push(m),m}const a=["info","success","warning","error"].map(g=>v=>i(Object.assign(Object.assign({},v),{type:g})));function l(g){o.delete(g),r.value.splice(r.value.findIndex(v=>v.key===g),1)}const s=ye("Notification","-notification",EV,NH,e,t),d={create:i,info:a[0],success:a[1],warning:a[2],error:a[3],open:f,destroyAll:h},u=D(0);ot(Gk,d),ot(Vc,{props:e,mergedClsPrefixRef:t,mergedThemeRef:s,wipTransitionCountRef:u});function f(g){return i(g)}function h(){Object.values(r.value).forEach(g=>{g.hide()})}return Object.assign({mergedClsPrefix:t,notificationList:r,notificationRefs:n,handleAfterLeave:l},d)},render(){var e,t,r;const{placement:n}=this;return c(It,null,(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e),this.notificationList.length?c(cs,{to:(r=this.to)!==null&&r!==void 0?r:"body"},c(OV,{class:this.containerClass,style:this.containerStyle,scrollable:this.scrollable&&n!=="top"&&n!=="bottom",placement:n},{default:()=>this.notificationList.map(o=>c(DV,Object.assign({ref:i=>{const a=o.key;i===null?delete this.notificationRefs[a]:this.notificationRefs[a]=i}},Pi(o,["destroy","hide","deactivate"]),{internalKey:o.key,onInternalAfterLeave:this.handleAfterLeave,keepAliveOnHover:o.keepAliveOnHover===void 0?this.keepAliveOnHover:o.keepAliveOnHover})))})):null)}});function Qk(){const e=De(Gk,null);return e===null&&_r("use-notification","No outer `n-notification-provider` found."),e}const AV=O([w("page-header-header",`
margin-bottom: 20px;
`),w("page-header",`
display: flex;
align-items: center;
justify-content: space-between;
line-height: 1.5;
font-size: var(--n-font-size);
`,[M("main",`
display: flex;
flex-wrap: nowrap;
align-items: center;
`),M("back",`
display: flex;
margin-right: 16px;
font-size: var(--n-back-size);
cursor: pointer;
color: var(--n-back-color);
transition: color .3s var(--n-bezier);
`,[O("&:hover","color: var(--n-back-color-hover);"),O("&:active","color: var(--n-back-color-pressed);")]),M("avatar",`
display: flex;
margin-right: 12px
`),M("title",`
margin-right: 16px;
transition: color .3s var(--n-bezier);
font-size: var(--n-title-font-size);
font-weight: var(--n-title-font-weight);
color: var(--n-title-text-color);
`),M("subtitle",`
font-size: 14px;
transition: color .3s var(--n-bezier);
color: var(--n-subtitle-text-color);
`)]),w("page-header-content",`
font-size: var(--n-font-size);
`,[O("&:not(:first-child)","margin-top: 20px;")]),w("page-header-footer",`
font-size: var(--n-font-size);
`,[O("&:not(:first-child)","margin-top: 20px;")])]),Jk=Object.assign(Object.assign({},ye.props),{title:String,subtitle:String,extra:String,onBack:Function}),BV=re({name:"PageHeader",props:Jk,setup(e){const{mergedClsPrefixRef:t,mergedRtlRef:r,inlineThemeDisabled:n}=Ne(e),o=ye("PageHeader","-page-header",AV,v9,e,t),i=Wt("PageHeader",r,t),a=P(()=>{const{self:{titleTextColor:s,subtitleTextColor:d,backColor:u,fontSize:f,titleFontSize:h,backSize:g,titleFontWeight:v,backColorHover:b,backColorPressed:m},common:{cubicBezierEaseInOut:p}}=o.value;return{"--n-title-text-color":s,"--n-title-font-size":h,"--n-title-font-weight":v,"--n-font-size":f,"--n-back-size":g,"--n-subtitle-text-color":d,"--n-back-color":u,"--n-back-color-hover":b,"--n-back-color-pressed":m,"--n-bezier":p}}),l=n?Qe("page-header",void 0,a,e):void 0;return{rtlEnabled:i,mergedClsPrefix:t,cssVars:n?void 0:a,themeClass:l==null?void 0:l.themeClass,onRender:l==null?void 0:l.onRender}},render(){var e;const{onBack:t,title:r,subtitle:n,extra:o,mergedClsPrefix:i,cssVars:a,$slots:l}=this;(e=this.onRender)===null||e===void 0||e.call(this);const{title:s,subtitle:d,extra:u,default:f,header:h,avatar:g,footer:v,back:b}=l,m=t,p=r||s,x=n||d,S=o||u;return c("div",{style:a,class:[`${i}-page-header-wrapper`,this.themeClass,this.rtlEnabled&&`${i}-page-header-wrapper--rtl`]},h?c("div",{class:`${i}-page-header-header`,key:"breadcrumb"},h()):null,(m||g||p||x||S)&&c("div",{class:`${i}-page-header`,key:"header"},c("div",{class:`${i}-page-header__main`,key:"back"},m?c("div",{class:`${i}-page-header__back`,onClick:t},b?b():c(ut,{clsPrefix:i},{default:()=>c(r6,null)})):null,g?c("div",{class:`${i}-page-header__avatar`},g()):null,p?c("div",{class:`${i}-page-header__title`,key:"title"},r||s()):null,x?c("div",{class:`${i}-page-header__subtitle`,key:"subtitle"},n||d()):null),S?c("div",{class:`${i}-page-header__extra`},o||u()):null),f?c("div",{class:`${i}-page-header-content`,key:"content"},f()):null,v?c("div",{class:`${i}-page-header-footer`,key:"footer"},v()):null)}}),eR="n-popconfirm",tR={positiveText:String,negativeText:String,showIcon:{type:Boolean,default:!0},onPositiveClick:{type:Function,required:!0},onNegativeClick:{type:Function,required:!0}},n0=Yr(tR),NV=re({name:"NPopconfirmPanel",props:tR,setup(e){const{localeRef:t}=mr("Popconfirm"),{inlineThemeDisabled:r}=Ne(),{mergedClsPrefixRef:n,mergedThemeRef:o,props:i}=De(eR),a=P(()=>{const{common:{cubicBezierEaseInOut:s},self:{fontSize:d,iconSize:u,iconColor:f}}=o.value;return{"--n-bezier":s,"--n-font-size":d,"--n-icon-size":u,"--n-icon-color":f}}),l=r?Qe("popconfirm-panel",void 0,a,i):void 0;return Object.assign(Object.assign({},mr("Popconfirm")),{mergedClsPrefix:n,cssVars:r?void 0:a,localizedPositiveText:P(()=>e.positiveText||t.value.positiveText),localizedNegativeText:P(()=>e.negativeText||t.value.negativeText),positiveButtonProps:ve(i,"positiveButtonProps"),negativeButtonProps:ve(i,"negativeButtonProps"),handlePositiveClick(s){e.onPositiveClick(s)},handleNegativeClick(s){e.onNegativeClick(s)},themeClass:l==null?void 0:l.themeClass,onRender:l==null?void 0:l.onRender})},render(){var e;const{mergedClsPrefix:t,showIcon:r,$slots:n}=this,o=yt(n.action,()=>this.negativeText===null&&this.positiveText===null?[]:[this.negativeText!==null&&c(Dt,Object.assign({size:"small",onClick:this.handleNegativeClick},this.negativeButtonProps),{default:()=>this.localizedNegativeText}),this.positiveText!==null&&c(Dt,Object.assign({size:"small",type:"primary",onClick:this.handlePositiveClick},this.positiveButtonProps),{default:()=>this.localizedPositiveText})]);return(e=this.onRender)===null||e===void 0||e.call(this),c("div",{class:[`${t}-popconfirm__panel`,this.themeClass],style:this.cssVars},Tt(n.default,i=>r||i?c("div",{class:`${t}-popconfirm__body`},r?c("div",{class:`${t}-popconfirm__icon`},yt(n.icon,()=>[c(ut,{clsPrefix:t},{default:()=>c(zi,null)})])):null,i):null),o?c("div",{class:[`${t}-popconfirm__action`]},o):null)}}),LV=w("popconfirm",[M("body",`
font-size: var(--n-font-size);
display: flex;
align-items: center;
flex-wrap: nowrap;
position: relative;
`,[M("icon",`
display: flex;
font-size: var(--n-icon-size);
color: var(--n-icon-color);
transition: color .3s var(--n-bezier);
margin: 0 8px 0 0;
`)]),M("action",`
display: flex;
justify-content: flex-end;
`,[O("&:not(:first-child)","margin-top: 8px"),w("button",[O("&:not(:last-child)","margin-right: 8px;")])])]),rR=Object.assign(Object.assign(Object.assign({},ye.props),la),{positiveText:String,negativeText:String,showIcon:{type:Boolean,default:!0},trigger:{type:String,default:"click"},positiveButtonProps:Object,negativeButtonProps:Object,onPositiveClick:Function,onNegativeClick:Function}),HV=re({name:"Popconfirm",props:rR,__popover__:!0,setup(e){const{mergedClsPrefixRef:t}=Ne(),r=ye("Popconfirm","-popconfirm",LV,m9,e,t),n=D(null);function o(l){var s;if(!(!((s=n.value)===null||s===void 0)&&s.getMergedShow()))return;const{onPositiveClick:d,"onUpdate:show":u}=e;Promise.resolve(d?d(l):!0).then(f=>{var h;f!==!1&&((h=n.value)===null||h===void 0||h.setShow(!1),u&&ue(u,!1))})}function i(l){var s;if(!(!((s=n.value)===null||s===void 0)&&s.getMergedShow()))return;const{onNegativeClick:d,"onUpdate:show":u}=e;Promise.resolve(d?d(l):!0).then(f=>{var h;f!==!1&&((h=n.value)===null||h===void 0||h.setShow(!1),u&&ue(u,!1))})}return ot(eR,{mergedThemeRef:r,mergedClsPrefixRef:t,props:e}),{setShow(l){var s;(s=n.value)===null||s===void 0||s.setShow(l)},syncPosition(){var l;(l=n.value)===null||l===void 0||l.syncPosition()},mergedTheme:r,popoverInstRef:n,handlePositiveClick:o,handleNegativeClick:i}},render(){const{$slots:e,$props:t,mergedTheme:r}=this;return c(ya,Pi(t,n0,{theme:r.peers.Popover,themeOverrides:r.peerOverrides.Popover,internalExtraClass:["popconfirm"],ref:"popoverInstRef"}),{trigger:e.activator||e.trigger,default:()=>{const n=Sr(t,n0);return c(NV,Object.assign(Object.assign({},n),{onPositiveClick:this.handlePositiveClick,onNegativeClick:this.handleNegativeClick}),e)}})}}),jV=O([w("progress",{display:"inline-block"},[w("progress-icon",`
color: var(--n-icon-color);
transition: color .3s var(--n-bezier);
`),I("line",`
width: 100%;
display: block;
`,[w("progress-content",`
display: flex;
align-items: center;
`,[w("progress-graph",{flex:1})]),w("progress-custom-content",{marginLeft:"14px"}),w("progress-icon",`
width: 30px;
padding-left: 14px;
height: var(--n-icon-size-line);
line-height: var(--n-icon-size-line);
font-size: var(--n-icon-size-line);
`,[I("as-text",`
color: var(--n-text-color-line-outer);
text-align: center;
width: 40px;
font-size: var(--n-font-size);
padding-left: 4px;
transition: color .3s var(--n-bezier);
`)])]),I("circle, dashboard",{width:"120px"},[w("progress-custom-content",`
position: absolute;
left: 50%;
top: 50%;
transform: translateX(-50%) translateY(-50%);
display: flex;
align-items: center;
justify-content: center;
`),w("progress-text",`
position: absolute;
left: 50%;
top: 50%;
transform: translateX(-50%) translateY(-50%);
display: flex;
align-items: center;
color: inherit;
font-size: var(--n-font-size-circle);
color: var(--n-text-color-circle);
font-weight: var(--n-font-weight-circle);
transition: color .3s var(--n-bezier);
white-space: nowrap;
`),w("progress-icon",`
position: absolute;
left: 50%;
top: 50%;
transform: translateX(-50%) translateY(-50%);
display: flex;
align-items: center;
color: var(--n-icon-color);
font-size: var(--n-icon-size-circle);
`)]),I("multiple-circle",`
width: 200px;
color: inherit;
`,[w("progress-text",`
font-weight: var(--n-font-weight-circle);
color: var(--n-text-color-circle);
position: absolute;
left: 50%;
top: 50%;
transform: translateX(-50%) translateY(-50%);
display: flex;
align-items: center;
justify-content: center;
transition: color .3s var(--n-bezier);
`)]),w("progress-content",{position:"relative"}),w("progress-graph",{position:"relative"},[w("progress-graph-circle",[O("svg",{verticalAlign:"bottom"}),w("progress-graph-circle-fill",`
stroke: var(--n-fill-color);
transition:
opacity .3s var(--n-bezier),
stroke .3s var(--n-bezier),
stroke-dasharray .3s var(--n-bezier);
`,[I("empty",{opacity:0})]),w("progress-graph-circle-rail",`
transition: stroke .3s var(--n-bezier);
overflow: hidden;
stroke: var(--n-rail-color);
`)]),w("progress-graph-line",[I("indicator-inside",[w("progress-graph-line-rail",`
height: 16px;
line-height: 16px;
border-radius: 10px;
`,[w("progress-graph-line-fill",`
height: inherit;
border-radius: 10px;
`),w("progress-graph-line-indicator",`
background: #0000;
white-space: nowrap;
text-align: right;
margin-left: 14px;
margin-right: 14px;
height: inherit;
font-size: 12px;
color: var(--n-text-color-line-inner);
transition: color .3s var(--n-bezier);
`)])]),I("indicator-inside-label",`
height: 16px;
display: flex;
align-items: center;
`,[w("progress-graph-line-rail",`
flex: 1;
transition: background-color .3s var(--n-bezier);
`),w("progress-graph-line-indicator",`
background: var(--n-fill-color);
font-size: 12px;
transform: translateZ(0);
display: flex;
vertical-align: middle;
height: 16px;
line-height: 16px;
padding: 0 10px;
border-radius: 10px;
position: absolute;
white-space: nowrap;
color: var(--n-text-color-line-inner);
transition:
right .2s var(--n-bezier),
color .3s var(--n-bezier),
background-color .3s var(--n-bezier);
`)]),w("progress-graph-line-rail",`
position: relative;
overflow: hidden;
height: var(--n-rail-height);
border-radius: 5px;
background-color: var(--n-rail-color);
transition: background-color .3s var(--n-bezier);
`,[w("progress-graph-line-fill",`
background: var(--n-fill-color);
position: relative;
border-radius: 5px;
height: inherit;
width: 100%;
max-width: 0%;
transition:
background-color .3s var(--n-bezier),
max-width .2s var(--n-bezier);
`,[I("processing",[O("&::after",`
content: "";
background-image: var(--n-line-bg-processing);
animation: progress-processing-animation 2s var(--n-bezier) infinite;
`)])])])])])]),O("@keyframes progress-processing-animation",`
0% {
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 100%;
opacity: 1;
}
66% {
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
opacity: 0;
}
100% {
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
opacity: 0;
}
`)]),VV={success:c(pa,null),error:c(ga,null),warning:c(zi,null),info:c(Ri,null)},UV=re({name:"ProgressLine",props:{clsPrefix:{type:String,required:!0},percentage:{type:Number,default:0},railColor:String,railStyle:[String,Object],fillColor:String,status:{type:String,required:!0},indicatorPlacement:{type:String,required:!0},indicatorTextColor:String,unit:{type:String,default:"%"},processing:{type:Boolean,required:!0},showIndicator:{type:Boolean,required:!0},height:[String,Number],railBorderRadius:[String,Number],fillBorderRadius:[String,Number]},setup(e,{slots:t}){const r=P(()=>zt(e.height)),n=P(()=>e.railBorderRadius!==void 0?zt(e.railBorderRadius):e.height!==void 0?zt(e.height,{c:.5}):""),o=P(()=>e.fillBorderRadius!==void 0?zt(e.fillBorderRadius):e.railBorderRadius!==void 0?zt(e.railBorderRadius):e.height!==void 0?zt(e.height,{c:.5}):"");return()=>{const{indicatorPlacement:i,railColor:a,railStyle:l,percentage:s,unit:d,indicatorTextColor:u,status:f,showIndicator:h,fillColor:g,processing:v,clsPrefix:b}=e;return c("div",{class:`${b}-progress-content`,role:"none"},c("div",{class:`${b}-progress-graph`,"aria-hidden":!0},c("div",{class:[`${b}-progress-graph-line`,{[`${b}-progress-graph-line--indicator-${i}`]:!0}]},c("div",{class:`${b}-progress-graph-line-rail`,style:[{backgroundColor:a,height:r.value,borderRadius:n.value},l]},c("div",{class:[`${b}-progress-graph-line-fill`,v&&`${b}-progress-graph-line-fill--processing`],style:{maxWidth:`${e.percentage}%`,backgroundColor:g,height:r.value,lineHeight:r.value,borderRadius:o.value}},i==="inside"?c("div",{class:`${b}-progress-graph-line-indicator`,style:{color:u}},t.default?t.default():`${s}${d}`):null)))),h&&i==="outside"?c("div",null,t.default?c("div",{class:`${b}-progress-custom-content`,style:{color:u},role:"none"},t.default()):f==="default"?c("div",{role:"none",class:`${b}-progress-icon ${b}-progress-icon--as-text`,style:{color:u}},s,d):c("div",{class:`${b}-progress-icon`,"aria-hidden":!0},c(ut,{clsPrefix:b},{default:()=>VV[f]}))):null)}}}),WV={success:c(pa,null),error:c(ga,null),warning:c(zi,null),info:c(Ri,null)},KV=re({name:"ProgressCircle",props:{clsPrefix:{type:String,required:!0},status:{type:String,required:!0},strokeWidth:{type:Number,required:!0},fillColor:String,railColor:String,railStyle:[String,Object],percentage:{type:Number,default:0},offsetDegree:{type:Number,default:0},showIndicator:{type:Boolean,required:!0},indicatorTextColor:String,unit:String,viewBoxWidth:{type:Number,required:!0},gapDegree:{type:Number,required:!0},gapOffsetDegree:{type:Number,default:0}},setup(e,{slots:t}){function r(n,o,i){const{gapDegree:a,viewBoxWidth:l,strokeWidth:s}=e,d=50,u=0,f=d,h=0,g=2*d,v=50+s/2,b=`M ${v},${v} m ${u},${f}
a ${d},${d} 0 1 1 ${h},${-g}
a ${d},${d} 0 1 1 ${-h},${g}`,m=Math.PI*2*d,p={stroke:i,strokeDasharray:`${n/100*(m-a)}px ${l*8}px`,strokeDashoffset:`-${a/2}px`,transformOrigin:o?"center":void 0,transform:o?`rotate(${o}deg)`:void 0};return{pathString:b,pathStyle:p}}return()=>{const{fillColor:n,railColor:o,strokeWidth:i,offsetDegree:a,status:l,percentage:s,showIndicator:d,indicatorTextColor:u,unit:f,gapOffsetDegree:h,clsPrefix:g}=e,{pathString:v,pathStyle:b}=r(100,0,o),{pathString:m,pathStyle:p}=r(s,a,n),x=100+i;return c("div",{class:`${g}-progress-content`,role:"none"},c("div",{class:`${g}-progress-graph`,"aria-hidden":!0},c("div",{class:`${g}-progress-graph-circle`,style:{transform:h?`rotate(${h}deg)`:void 0}},c("svg",{viewBox:`0 0 ${x} ${x}`},c("g",null,c("path",{class:`${g}-progress-graph-circle-rail`,d:v,"stroke-width":i,"stroke-linecap":"round",fill:"none",style:b})),c("g",null,c("path",{class:[`${g}-progress-graph-circle-fill`,s===0&&`${g}-progress-graph-circle-fill--empty`],d:m,"stroke-width":i,"stroke-linecap":"round",fill:"none",style:p}))))),d?c("div",null,t.default?c("div",{class:`${g}-progress-custom-content`,role:"none"},t.default()):l!=="default"?c("div",{class:`${g}-progress-icon`,"aria-hidden":!0},c(ut,{clsPrefix:g},{default:()=>WV[l]})):c("div",{class:`${g}-progress-text`,style:{color:u},role:"none"},c("span",{class:`${g}-progress-text__percentage`},s),c("span",{class:`${g}-progress-text__unit`},f))):null)}}});function o0(e,t,r=100){return`m ${r/2} ${r/2-e} a ${e} ${e} 0 1 1 0 ${2*e} a ${e} ${e} 0 1 1 0 -${2*e}`}const qV=re({name:"ProgressMultipleCircle",props:{clsPrefix:{type:String,required:!0},viewBoxWidth:{type:Number,required:!0},percentage:{type:Array,default:[0]},strokeWidth:{type:Number,required:!0},circleGap:{type:Number,required:!0},showIndicator:{type:Boolean,required:!0},fillColor:{type:Array,default:()=>[]},railColor:{type:Array,default:()=>[]},railStyle:{type:Array,default:()=>[]}},setup(e,{slots:t}){const r=P(()=>e.percentage.map((o,i)=>`${Math.PI*o/100*(e.viewBoxWidth/2-e.strokeWidth/2*(1+2*i)-e.circleGap*i)*2}, ${e.viewBoxWidth*8}`));return()=>{const{viewBoxWidth:n,strokeWidth:o,circleGap:i,showIndicator:a,fillColor:l,railColor:s,railStyle:d,percentage:u,clsPrefix:f}=e;return c("div",{class:`${f}-progress-content`,role:"none"},c("div",{class:`${f}-progress-graph`,"aria-hidden":!0},c("div",{class:`${f}-progress-graph-circle`},c("svg",{viewBox:`0 0 ${n} ${n}`},u.map((h,g)=>c("g",{key:g},c("path",{class:`${f}-progress-graph-circle-rail`,d:o0(n/2-o/2*(1+2*g)-i*g,o,n),"stroke-width":o,"stroke-linecap":"round",fill:"none",style:[{strokeDashoffset:0,stroke:s[g]},d[g]]}),c("path",{class:[`${f}-progress-graph-circle-fill`,h===0&&`${f}-progress-graph-circle-fill--empty`],d:o0(n/2-o/2*(1+2*g)-i*g,o,n),"stroke-width":o,"stroke-linecap":"round",fill:"none",style:{strokeDasharray:r.value[g],strokeDashoffset:0,stroke:l[g]}})))))),a&&t.default?c("div",null,c("div",{class:`${f}-progress-text`},t.default())):null)}}}),nR=Object.assign(Object.assign({},ye.props),{processing:Boolean,type:{type:String,default:"line"},gapDegree:Number,gapOffsetDegree:Number,status:{type:String,default:"default"},railColor:[String,Array],railStyle:[String,Array],color:[String,Array],viewBoxWidth:{type:Number,default:100},strokeWidth:{type:Number,default:7},percentage:[Number,Array],unit:{type:String,default:"%"},showIndicator:{type:Boolean,default:!0},indicatorPosition:{type:String,default:"outside"},indicatorPlacement:{type:String,default:"outside"},indicatorTextColor:String,circleGap:{type:Number,default:1},height:Number,borderRadius:[String,Number],fillBorderRadius:[String,Number],offsetDegree:Number}),oR=re({name:"Progress",props:nR,setup(e){const t=P(()=>e.indicatorPlacement||e.indicatorPosition),r=P(()=>{if(e.gapDegree||e.gapDegree===0)return e.gapDegree;if(e.type==="dashboard")return 75}),{mergedClsPrefixRef:n,inlineThemeDisabled:o}=Ne(e),i=ye("Progress","-progress",jV,F2,e,n),a=P(()=>{const{status:s}=e,{common:{cubicBezierEaseInOut:d},self:{fontSize:u,fontSizeCircle:f,railColor:h,railHeight:g,iconSizeCircle:v,iconSizeLine:b,textColorCircle:m,t
background: #fff;
border-radius: var(--n-border-radius);
display: inline-flex;
`)]),GV={name:"QrCode",common:et,self:e=>({borderRadius:e.borderRadius})},XV=e=>({borderRadius:e.borderRadius}),ZV={name:"QrCode",common:tt,self:XV};var Jn;(function(e){class t{static encodeText(a,l){const s=e.QrSegment.makeSegments(a);return t.encodeSegments(s,l)}static encodeBinary(a,l){const s=e.QrSegment.makeBytes(a);return t.encodeSegments([s],l)}static encodeSegments(a,l,s=1,d=40,u=-1,f=!0){if(!(t.MIN_VERSION<=s&&s<=d&&d<=t.MAX_VERSION)||u<-1||u>7)throw new RangeError("Invalid value");let h,g;for(h=s;;h++){const p=t.getNumDataCodewords(h,l)*8,x=o.getTotalBits(a,h);if(x<=p){g=x;break}if(h>=d)throw new RangeError("Data too long")}for(const p of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])f&&g<=t.getNumDataCodewords(h,p)*8&&(l=p);const v=[];for(const p of a){r(p.mode.modeBits,4,v),r(p.numChars,p.mode.numCharCountBits(h),v);for(const x of p.getData())v.push(x)}const b=t.getNumDataCodewords(h,l)*8;r(0,Math.min(4,b-v.length),v),r(0,(8-v.length%8)%8,v);for(let p=236;v.length<b;p^=253)r(p,8,v);const m=[];for(;m.length*8<v.length;)m.push(0);return v.forEach((p,x)=>m[x>>>3]|=p<<7-(x&7)),new t(h,l,m,u)}constructor(a,l,s,d){if(this.version=a,this.errorCorrectionLevel=l,this.modules=[],this.isFunction=[],a<t.MIN_VERSION||a>t.MAX_VERSION)throw new RangeError("Version value out of range");if(d<-1||d>7)throw new RangeError("Mask value out of range");this.size=a*4+17;const u=[];for(let h=0;h<this.size;h++)u.push(!1);for(let h=0;h<this.size;h++)this.modules.push(u.slice()),this.isFunction.push(u.slice());this.drawFunctionPatterns();const f=this.addEccAndInterleave(s);if(this.drawCodewords(f),d===-1){let h=1e9;for(let g=0;g<8;g++){this.applyMask(g),this.drawFormatBits(g);const v=this.getPenaltyScore();v<h&&(d=g,h=v),this.applyMask(g)}}this.mask=d,this.applyMask(d),this.drawFormatBits(d),this.isFunction=[]}getModule(a,l){return a>=0&&a<this.size&&l>=0&&l<this.size&&this.modules[l][a]}getModules(){return this.modules}drawFunctionPatterns(){for(let s=0;s<this.size;s++)this.setFunctionModule(6,s,s%2===0),this.setFunctionModule(s,6,s%2===0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const a=this.getAlignmentPatternPositions(),l=a.length;for(let s=0;s<l;s++)for(let d=0;d<l;d++)s===0&&d===0||s===0&&d===l-1||s===l-1&&d===0||this.drawAlignmentPattern(a[s],a[d]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(a){const l=this.errorCorrectionLevel.formatBits<<3|a;let s=l;for(let u=0;u<10;u++)s=s<<1^(s>>>9)*1335;const d=(l<<10|s)^21522;for(let u=0;u<=5;u++)this.setFunctionModule(8,u,n(d,u));this.setFunctionModule(8,7,n(d,6)),this.setFunctionModule(8,8,n(d,7)),this.setFunctionModule(7,8,n(d,8));for(let u=9;u<15;u++)this.setFunctionModule(14-u,8,n(d,u));for(let u=0;u<8;u++)this.setFunctionModule(this.size-1-u,8,n(d,u));for(let u=8;u<15;u++)this.setFunctionModule(8,this.size-15+u,n(d,u));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let a=this.version;for(let s=0;s<12;s++)a=a<<1^(a>>>11)*7973;const l=this.version<<12|a;for(let s=0;s<18;s++){const d=n(l,s),u=this.size-11+s%3,f=Math.floor(s/3);this.setFunctionModule(u,f,d),this.setFunctionModule(f,u,d)}}drawFinderPattern(a,l){for(let s=-4;s<=4;s++)for(let d=-4;d<=4;d++){const u=Math.max(Math.abs(d),Math.abs(s)),f=a+d,h=l+s;f>=0&&f<this.size&&h>=0&&h<this.size&&this.setFunctionModule(f,h,u!==2&&u!==4)}}drawAlignmentPattern(a,l){for(let s=-2;s<=2;s++)for(let d=-2;d<=2;d++)this.setFunctionModule(a+d,l+s,Math.max(Math.abs(d),Math.abs(s))!==1)}setFunctionModule(a,l,s){this.modules[l][a]=s,this.isFunction[l][a]=!0}addEccAndInterleave(a){const l=this.version,s=this.errorCorrectionLevel;if(a.length!==t.getNumDataCodewords(l,s))throw new RangeError("Invalid argument");const d=t.NUM_ERROR_CORRECTION_BLOCKS[s.ordinal][l],u=t.ECC_CODEWORDS_PER_BLOCK[s.ordinal][l],f=Math.floor(t.getNumRawDataModules(l)/8),h=d-f%d,g=Math.floor(f/d),v=[],b=t.reedSolomonComputeDivisor(u);for(let p=0,x=0;p<d;p++){const S=a.slice(x,x+g-u+(p<h?0:1));x+=S.length;const y=t.reedSolomonComputeRemainder(S,b);p<h&&S.push(0),v.push(S.concat(y)
transition:
transform .1s var(--n-bezier),
color .3s var(--n-bezier);
`)]),M("item",`
position: relative;
display: flex;
transition:
transform .1s var(--n-bezier),
color .3s var(--n-bezier);
transform: scale(1);
font-size: var(--n-item-size);
color: var(--n-item-color);
`,[O("&:not(:first-child)",`
margin-left: 6px;
`),I("active",`
color: var(--n-item-color-active);
`)]),xt("readonly",`
cursor: pointer;
`,[M("item",[O("&:hover",`
transform: scale(1.05);
`),O("&:active",`
transform: scale(0.96);
`)])]),M("half",`
display: flex;
transition: inherit;
position: absolute;
top: 0;
left: 0;
bottom: 0;
width: 50%;
overflow: hidden;
color: rgba(255, 255, 255, 0);
`,[I("active",`
color: var(--n-item-color-active);
`)])]),aR=Object.assign(Object.assign({},ye.props),{allowHalf:Boolean,count:{type:Number,default:5},value:Number,defaultValue:{type:Number,default:null},readonly:Boolean,size:{type:[String,Number],default:"medium"},clearable:Boolean,color:String,onClear:Function,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array]}),rU=re({name:"Rate",props:aR,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:r}=Ne(e),n=ye("Rate","-rate",tU,C9,e,t),o=ve(e,"value"),i=D(e.defaultValue),a=D(null),l=Rr(e),s=$t(o,i);function d(S){const{"onUpdate:value":y,onUpdateValue:C}=e,{nTriggerFormChange:k,nTriggerFormInput:R}=l;y&&ue(y,S),C&&ue(C,S),i.value=S,k(),R()}function u(S,y){return e.allowHalf?y.offsetX>=Math.floor(y.currentTarget.offsetWidth/2)?S+1:S+.5:S+1}let f=!1;function h(S,y){f||(a.value=u(S,y))}function g(){a.value=null}function v(S,y){var C;const{clearable:k}=e,R=u(S,y);k&&R===s.value?(f=!0,(C=e.onClear)===null||C===void 0||C.call(e),a.value=null,d(null)):d(R)}function b(){f=!1}const m=P(()=>{const{size:S}=e,{self:y}=n.value;return typeof S=="number"?`${S}px`:y[Ce("size",S)]}),p=P(()=>{const{common:{cubicBezierEaseInOut:S},self:y}=n.value,{itemColor:C,itemColorActive:k}=y,{color:R}=e;return{"--n-bezier":S,"--n-item-color":C,"--n-item-color-active":R||k,"--n-item-size":m.value}}),x=r?Qe("rate",P(()=>{const S=m.value,{color:y}=e;let C="";return S&&(C+=S[0]),y&&(C+=ra(y)),C}),p,e):void 0;return{mergedClsPrefix:t,mergedValue:s,hoverIndex:a,handleMouseMove:h,handleClick:v,handleMouseLeave:g,handleMouseEnterSomeStar:b,cssVars:r?void 0:p,themeClass:x==null?void 0:x.themeClass,onRender:x==null?void 0:x.onRender}},render(){const{readonly:e,hoverIndex:t,mergedValue:r,mergedClsPrefix:n,onRender:o,$slots:{default:i}}=this;return o==null||o(),c("div",{class:[`${n}-rate`,{[`${n}-rate--readonly`]:e},this.themeClass],style:this.cssVars,onMouseleave:this.handleMouseLeave},sx(this.count,(a,l)=>{const s=i?i({index:l}):c(ut,{clsPrefix:n},{default:()=>eU}),d=t!==null?l+1<=t:l+1<=(r||0);return c("div",{key:l,class:[`${n}-rate__item`,d&&`${n}-rate__item--active`],onClick:e?void 0:u=>{this.handleClick(l,u)},onMouseenter:this.handleMouseEnterSomeStar,onMousemove:e?void 0:u=>{this.handleMouseMove(l,u)}},s,this.allowHalf?c("div",{class:[`${n}-rate__half`,{[`${n}-rate__half--active`]:!d&&t!==null?l+.5<=t:l+.5<=(r||0)}]},s):null)}))}}),nU=c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 36 36"},c("circle",{fill:"#FFCB4C",cx:"18",cy:"17.018",r:"17"}),c("path",{fill:"#65471B",d:"M14.524 21.036c-.145-.116-.258-.274-.312-.464-.134-.46.13-.918.59-1.021 4.528-1.021 7.577 1.363 7.706 1.465.384.306.459.845.173 1.205-.286.358-.828.401-1.211.097-.11-.084-2.523-1.923-6.182-1.098-.274.061-.554-.016-.764-.184z"}),c("ellipse",{fill:"#65471B",cx:"13.119",cy:"11.174",rx:"2.125",ry:"2.656"}),c("ellipse",{fill:"#65471B",cx:"24.375",cy:"12.236",rx:"2.125",ry:"2.656"}),c("path",{fill:"#F19020",d:"M17.276 35.149s1.265-.411 1.429-1.352c.173-.972-.624-1.167-.624-1.167s1.041-.208 1.172-1.376c.123-1.101-.861-1.363-.861-1.363s.97-.4 1.016-1.539c.038-.959-.995-1.428-.995-1.428s5.038-1.221 5.556-1.341c.516-.12 1.32-.615 1.069-1.694-.249-1.08-1.204-1.118-1.697-1.003-.494.115-6.744 1.566-8.9 2.068l-1.439.334c-.54.127-.785-.11-.404-.512.508-.536.833-1.129.946-2.113.119-1.035-.232-2.313-.433-2.809-.374-.921-1.005-1.649-1.734-1.899-1.137-.39-1.945.321-1.542 1.561.604 1.854.208 3.375-.833 4.293-2.449 2.157-3.588 3.695-2.83 6.973.828 3.575 4.377 5.876 7.952 5.048l3.152-.681z"}),c("path",{fill:"#65471B",d:"M9.296 6.351c-.164-.088-.303-.224-.391-.399-.216-.428-.04-.927.393-1.112 4.266-1.831 7.699-.043 7.843.034.433.231.608.747.391 1.154-.216.405-.74.546-1.173.318-.123-.063-2.832-1.432-6.278.047-.257.109-.547.085-.785-.042zm12.135 3.75c-.156-.098-.286-.243-.362-.424-.187-.442.023-.927.468-1.084 4.381-1.536 7.685.48 7.823.567.415.26.555.787.312 1.178-.242.39-.776.495-1.191.238-.12-.072-2.727-1.621-6.267-.379-.266.091-.553.046-.783-.096z"})),oU=c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 36 36"},c("path",{fill:"#FFCC4D",d:"M36 18c0 9.941-8.059 18-18 18-9.94 0-18-8
color: var(--n-text-color);
line-height: var(--n-line-height);
font-size: var(--n-font-size);
transition:
color .3s var(--n-bezier);
`,[w("result-icon",`
display: flex;
justify-content: center;
transition: color .3s var(--n-bezier);
`,[M("status-image",`
font-size: var(--n-icon-size);
width: 1em;
height: 1em;
`),w("base-icon",`
color: var(--n-icon-color);
font-size: var(--n-icon-size);
`)]),w("result-content",{marginTop:"24px"}),w("result-footer",`
margin-top: 24px;
text-align: center;
`),w("result-header",[M("title",`
margin-top: 16px;
font-weight: var(--n-title-font-weight);
transition: color .3s var(--n-bezier);
text-align: center;
color: var(--n-title-text-color);
font-size: var(--n-title-font-size);
`),M("description",`
margin-top: 4px;
text-align: center;
font-size: var(--n-font-size);
`)])]),sU={403:()=>aU,404:()=>nU,418:()=>iU,500:()=>oU,info:()=>c(Ri,null),success:()=>c(pa,null),warning:()=>c(zi,null),error:()=>c(ga,null)},lR=Object.assign(Object.assign({},ye.props),{size:{type:String,default:"medium"},status:{type:String,default:"info"},title:String,description:String}),dU=re({name:"Result",props:lR,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:r}=Ne(e),n=ye("Result","-result",lU,S9,e,t),o=P(()=>{const{size:a,status:l}=e,{common:{cubicBezierEaseInOut:s},self:{textColor:d,lineHeight:u,titleTextColor:f,titleFontWeight:h,[Ce("iconColor",l)]:g,[Ce("fontSize",a)]:v,[Ce("titleFontSize",a)]:b,[Ce("iconSize",a)]:m}}=n.value;return{"--n-bezier":s,"--n-font-size":v,"--n-icon-size":m,"--n-line-height":u,"--n-text-color":d,"--n-title-font-size":b,"--n-title-font-weight":h,"--n-title-text-color":f,"--n-icon-color":g||""}}),i=r?Qe("result",P(()=>{const{size:a,status:l}=e;let s="";return a&&(s+=a[0]),l&&(s+=l[0]),s}),o,e):void 0;return{mergedClsPrefix:t,cssVars:r?void 0:o,themeClass:i==null?void 0:i.themeClass,onRender:i==null?void 0:i.onRender}},render(){var e;const{status:t,$slots:r,mergedClsPrefix:n,onRender:o}=this;return o==null||o(),c("div",{class:[`${n}-result`,this.themeClass],style:this.cssVars},c("div",{class:`${n}-result-icon`},((e=r.icon)===null||e===void 0?void 0:e.call(r))||c(ut,{clsPrefix:n},{default:()=>sU[t]()})),c("div",{class:`${n}-result-header`},this.title?c("div",{class:`${n}-result-header__title`},this.title):null,this.description?c("div",{class:`${n}-result-header__description`},this.description):null),r.default&&c("div",{class:`${n}-result-content`},r),r.footer&&c("div",{class:`${n}-result-footer`},r.footer()))}}),sR=Object.assign(Object.assign({},ye.props),{trigger:String,xScrollable:Boolean,onScroll:Function,contentClass:String,contentStyle:[Object,String],size:Number}),cU=re({name:"Scrollbar",props:sR,setup(){const e=D(null);return Object.assign(Object.assign({},{scrollTo:(...r)=>{var n;(n=e.value)===null||n===void 0||n.scrollTo(r[0],r[1])},scrollBy:(...r)=>{var n;(n=e.value)===null||n===void 0||n.scrollBy(r[0],r[1])}}),{scrollbarInstRef:e})},render(){return c(sr,Object.assign({ref:"scrollbarInstRef"},this.$props),this.$slots)}}),uU=cU,fU={name:"Skeleton",common:et,self(e){const{heightSmall:t,heightMedium:r,heightLarge:n,borderRadius:o}=e;return{color:"rgba(255, 255, 255, 0.12)",colorEnd:"rgba(255, 255, 255, 0.18)",borderRadius:o,heightSmall:t,heightMedium:r,heightLarge:n}}},hU=e=>{const{heightSmall:t,heightMedium:r,heightLarge:n,borderRadius:o}=e;return{color:"#eee",colorEnd:"#ddd",borderRadius:o,heightSmall:t,heightMedium:r,heightLarge:n}},vU={name:"Skeleton",common:tt,self:hU},gU=O([w("skeleton",`
height: 1em;
width: 100%;
transition:
--n-color-start .3s var(--n-bezier),
--n-color-end .3s var(--n-bezier),
background-color .3s var(--n-bezier);
animation: 2s skeleton-loading infinite cubic-bezier(0.36, 0, 0.64, 1);
background-color: var(--n-color-start);
`),O("@keyframes skeleton-loading",`
0% {
background: var(--n-color-start);
}
40% {
background: var(--n-color-end);
}
80% {
background: var(--n-color-start);
}
100% {
background: var(--n-color-start);
}
`)]),dR=Object.assign(Object.assign({},ye.props),{text:Boolean,round:Boolean,circle:Boolean,height:[String,Number],width:[String,Number],size:String,repeat:{type:Number,default:1},animated:{type:Boolean,default:!0},sharp:{type:Boolean,default:!0}}),pU=re({name:"Skeleton",inheritAttrs:!1,props:dR,setup(e){kv();const{mergedClsPrefixRef:t}=Ne(e),r=ye("Skeleton","-skeleton",gU,vU,e,t);return{mergedClsPrefix:t,style:P(()=>{var n,o;const i=r.value,{common:{cubicBezierEaseInOut:a}}=i,l=i.self,{color:s,colorEnd:d,borderRadius:u}=l;let f;const{circle:h,sharp:g,round:v,width:b,height:m,size:p,text:x,animated:S}=e;p!==void 0&&(f=l[Ce("height",p)]);const y=h?(n=b??m)!==null&&n!==void 0?n:f:b,C=(o=h?b??m:m)!==null&&o!==void 0?o:f;return{display:x?"inline-block":"",verticalAlign:x?"-0.125em":"",borderRadius:h?"50%":v?"4096px":g?"":u,width:typeof y=="number"?yr(y):y,height:typeof C=="number"?yr(C):C,animation:S?"":"none","--n-bezier":a,"--n-color-start":s,"--n-color-end":d}})}},render(){const{repeat:e,style:t,mergedClsPrefix:r,$attrs:n}=this,o=c("div",Hr({class:`${r}-skeleton`,style:t},n));return e>1?c(It,null,vs(e,null).map(i=>[o,`
`])):o}});function i0(e){return window.TouchEvent&&e instanceof window.TouchEvent}function a0(){const e=new Map,t=r=>n=>{e.set(r,n)};return lv(()=>{e.clear()}),[e,t]}const mU=O([w("slider",`
display: block;
padding: calc((var(--n-handle-size) - var(--n-rail-height)) / 2) 0;
position: relative;
z-index: 0;
width: 100%;
cursor: pointer;
user-select: none;
-webkit-user-select: none;
`,[I("reverse",[w("slider-handles",[w("slider-handle-wrapper",`
transform: translate(50%, -50%);
`)]),w("slider-dots",[w("slider-dot",`
transform: translateX(50%, -50%);
`)]),I("vertical",[w("slider-handles",[w("slider-handle-wrapper",`
transform: translate(-50%, -50%);
`)]),w("slider-marks",[w("slider-mark",`
transform: translateY(calc(-50% + var(--n-dot-height) / 2));
`)]),w("slider-dots",[w("slider-dot",`
transform: translateX(-50%) translateY(0);
`)])])]),I("vertical",`
padding: 0 calc((var(--n-handle-size) - var(--n-rail-height)) / 2);
width: var(--n-rail-width-vertical);
height: 100%;
`,[w("slider-handles",`
top: calc(var(--n-handle-size) / 2);
right: 0;
bottom: calc(var(--n-handle-size) / 2);
left: 0;
`,[w("slider-handle-wrapper",`
top: unset;
left: 50%;
transform: translate(-50%, 50%);
`)]),w("slider-rail",`
height: 100%;
`,[M("fill",`
top: unset;
right: 0;
bottom: unset;
left: 0;
`)]),I("with-mark",`
width: var(--n-rail-width-vertical);
margin: 0 32px 0 8px;
`),w("slider-marks",`
top: calc(var(--n-handle-size) / 2);
right: unset;
bottom: calc(var(--n-handle-size) / 2);
left: 22px;
font-size: var(--n-mark-font-size);
`,[w("slider-mark",`
transform: translateY(50%);
white-space: nowrap;
`)]),w("slider-dots",`
top: calc(var(--n-handle-size) / 2);
right: unset;
bottom: calc(var(--n-handle-size) / 2);
left: 50%;
`,[w("slider-dot",`
transform: translateX(-50%) translateY(50%);
`)])]),I("disabled",`
cursor: not-allowed;
opacity: var(--n-opacity-disabled);
`,[w("slider-handle",`
cursor: not-allowed;
`)]),I("with-mark",`
width: 100%;
margin: 8px 0 32px 0;
`),O("&:hover",[w("slider-rail",{backgroundColor:"var(--n-rail-color-hover)"},[M("fill",{backgroundColor:"var(--n-fill-color-hover)"})]),w("slider-handle",{boxShadow:"var(--n-handle-box-shadow-hover)"})]),I("active",[w("slider-rail",{backgroundColor:"var(--n-rail-color-hover)"},[M("fill",{backgroundColor:"var(--n-fill-color-hover)"})]),w("slider-handle",{boxShadow:"var(--n-handle-box-shadow-hover)"})]),w("slider-marks",`
position: absolute;
top: 18px;
left: calc(var(--n-handle-size) / 2);
right: calc(var(--n-handle-size) / 2);
`,[w("slider-mark",`
position: absolute;
transform: translateX(-50%);
white-space: nowrap;
`)]),w("slider-rail",`
width: 100%;
position: relative;
height: var(--n-rail-height);
background-color: var(--n-rail-color);
transition: background-color .3s var(--n-bezier);
border-radius: calc(var(--n-rail-height) / 2);
`,[M("fill",`
position: absolute;
top: 0;
bottom: 0;
border-radius: calc(var(--n-rail-height) / 2);
transition: background-color .3s var(--n-bezier);
background-color: var(--n-fill-color);
`)]),w("slider-handles",`
position: absolute;
top: 0;
right: calc(var(--n-handle-size) / 2);
bottom: 0;
left: calc(var(--n-handle-size) / 2);
`,[w("slider-handle-wrapper",`
outline: none;
position: absolute;
top: 50%;
transform: translate(-50%, -50%);
cursor: pointer;
display: flex;
`,[w("slider-handle",`
height: var(--n-handle-size);
width: var(--n-handle-size);
border-radius: 50%;
overflow: hidden;
transition: box-shadow .2s var(--n-bezier), background-color .3s var(--n-bezier);
background-color: var(--n-handle-color);
box-shadow: var(--n-handle-box-shadow);
`,[O("&:hover",`
box-shadow: var(--n-handle-box-shadow-hover);
`)]),O("&:focus",[w("slider-handle",`
box-shadow: var(--n-handle-box-shadow-focus);
`,[O("&:hover",`
box-shadow: var(--n-handle-box-shadow-active);
`)])])])]),w("slider-dots",`
position: absolute;
top: 50%;
left: calc(var(--n-handle-size) / 2);
right: calc(var(--n-handle-size) / 2);
`,[I("transition-disabled",[w("slider-dot","transition: none;")]),w("slider-dot",`
transition:
border-color .3s var(--n-bezier),
box-shadow .3s var(--n-bezier),
background-color .3s var(--n-bezier);
position: absolute;
transform: translate(-50%, -50%);
height: var(--n-dot-height);
width: var(--n-dot-width);
border-radius: var(--n-dot-border-radius);
overflow: hidden;
box-sizing: border-box;
border: var(--n-dot-border);
background-color: var(--n-dot-color);
`,[I("active","border: var(--n-dot-border-active);")])])]),w("slider-handle-indicator",`
font-size: var(--n-font-size);
padding: 6px 10px;
border-radius: var(--n-indicator-border-radius);
color: var(--n-indicator-text-color);
background-color: var(--n-indicator-color);
box-shadow: var(--n-indicator-box-shadow);
`,[Ar()]),w("slider-handle-indicator",`
font-size: var(--n-font-size);
padding: 6px 10px;
border-radius: var(--n-indicator-border-radius);
color: var(--n-indicator-text-color);
background-color: var(--n-indicator-color);
box-shadow: var(--n-indicator-box-shadow);
`,[I("top",`
margin-bottom: 12px;
`),I("right",`
margin-left: 12px;
`),I("bottom",`
margin-top: 12px;
`),I("left",`
margin-right: 12px;
`),Ar()]),So(w("slider",[w("slider-dot","background-color: var(--n-dot-color-modal);")])),jo(w("slider",[w("slider-dot","background-color: var(--n-dot-color-popover);")]))]),bU=0,cR=Object.assign(Object.assign({},ye.props),{to:Kt.propTo,defaultValue:{type:[Number,Array],default:0},marks:Object,disabled:{type:Boolean,default:void 0},formatTooltip:Function,keyboard:{type:Boolean,default:!0},min:{type:Number,default:0},max:{type:Number,default:100},step:{type:[Number,String],default:1},range:Boolean,value:[Number,Array],placement:String,showTooltip:{type:Boolean,default:void 0},tooltip:{type:Boolean,default:!0},vertical:Boolean,reverse:Boolean,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onDragstart:[Function],onDragend:[Function]}),xU=re({name:"Slider",props:cR,setup(e){const{mergedClsPrefixRef:t,namespaceRef:r,inlineThemeDisabled:n}=Ne(e),o=ye("Slider","-slider",mU,T9,e,t),i=D(null),[a,l]=a0(),[s,d]=a0(),u=D(new Set),f=Rr(e),{mergedDisabledRef:h}=f,g=P(()=>{const{step:Z}=e;if(Number(Z)<=0||Z==="mark")return 0;const B=Z.toString();let te=0;return B.includes(".")&&(te=B.length-B.indexOf(".")-1),te}),v=D(e.defaultValue),b=ve(e,"value"),m=$t(b,v),p=P(()=>{const{value:Z}=m;return(e.range?Z:[Z]).map(L)}),x=P(()=>p.value.length>2),S=P(()=>e.placement===void 0?e.vertical?"right":"top":e.placement),y=P(()=>{const{marks:Z}=e;return Z?Object.keys(Z).map(parseFloat):null}),C=D(-1),k=D(-1),R=D(-1),$=D(!1),T=D(!1),z=P(()=>{const{vertical:Z,reverse:B}=e;return Z?B?"top":"bottom":B?"right":"left"}),F=P(()=>{if(x.value)return;const Z=p.value,B=A(e.range?Math.min(...Z):e.min),te=A(e.range?Math.max(...Z):Z[0]),{value:we}=z;return e.vertical?{[we]:`${B}%`,height:`${te-B}%`}:{[we]:`${B}%`,width:`${te-B}%`}}),_=P(()=>{const Z=[],{marks:B}=e;if(B){const te=p.value.slice();te.sort((Be,We)=>Be-We);const{value:we}=z,{value:Le}=x,{range:Je}=e,rt=Le?()=>!1:Be=>Je?Be>=te[0]&&Be<=te[te.length-1]:Be<=te[0];for(const Be of Object.keys(B)){const We=Number(Be);Z.push({active:rt(We),label:B[Be],style:{[we]:`${A(We)}%`}})}}return Z});function N(Z,B){const te=A(Z),{value:we}=z;return{[we]:`${te}%`,zIndex:B===C.value?1:0}}function j(Z){return e.showTooltip||R.value===Z||C.value===Z&&$.value}function H(Z){return $.value?!(C.value===Z&&k.value===Z):!0}function Y(Z){var B;~Z&&(C.value=Z,(B=a.get(Z))===null||B===void 0||B.focus())}function X(){s.forEach((Z,B)=>{j(B)&&Z.syncPosition()})}function le(Z){const{"onUpdate:value":B,onUpdateValue:te}=e,{nTriggerFormInput:we,nTriggerFormChange:Le}=f;te&&ue(te,Z),B&&ue(B,Z),v.value=Z,we(),Le()}function ke(Z){const{range:B}=e;if(B){if(Array.isArray(Z)){const{value:te}=p;Z.join()!==te.join()&&le(Z)}}else Array.isArray(Z)||p.value[0]!==Z&&le(Z)}function be(Z,B){if(e.range){const te=p.value.slice();te.splice(B,1,Z),ke(te)}else ke(Z)}function Q(Z,B,te){const we=te!==void 0;te||(te=Z-B>0?1:-1);const Le=y.value||[],{step:Je}=e;if(Je==="mark"){const We=he(Z,Le.concat(B),we?te:void 0);return We?We.value:B}if(Je<=0)return B;const{value:rt}=g;let Be;if(we){const We=Number((B/Je).toFixed(rt)),it=Math.floor(We),qe=We>it?it:it-1,at=We<it?it:it+1;Be=he(B,[Number((qe*Je).toFixed(rt)),Number((at*Je).toFixed(rt)),...Le],te)}else{const We=ae(Z);Be=he(Z,[...Le,We])}return Be?L(Be.value):B}function L(Z){return Math.min(e.max,Math.max(e.min,Z))}function A(Z){const{max:B,min:te}=e;return(Z-te)/(B-te)*100}function U(Z){const{max:B,min:te}=e;return te+(B-te)*Z}function ae(Z){const{step:B,min:te}=e;if(Number(B)<=0||B==="mark")return Z;const we=Math.round((Z-te)/B)*B+te;return Number(we.toFixed(g.value))}function he(Z,B=y.value,te){if(!(B!=null&&B.length))return null;let we=null,Le=-1;for(;++Le<B.length;){const Je=B[Le]-Z,rt=Math.abs(Je);(te===void 0||Je*te>0)&&(we===null||rt<we.distance)&&(we={index:Le,distance:rt,value:B[Le]})}return we}function Re(Z){const B=i.value;if(!B)return;const te=i0(Z)?Z.touches[0]:Z,we=B.getBoundingClientRect();let Le;return e.vertical?Le=(we.bottom-te.clientY)/we.height:Le=(te.clientX-we.left)/we.width,e.reverse&&(Le=1-Le),U(Le)}function Oe(Z){if(h.value||!e.keyboard)return;const{vertical:B,reverse
from {
transform: rotate(0);
}
to {
transform: rotate(360deg);
}
`),w("spin-container",`
position: relative;
`,[w("spin-body",`
position: absolute;
top: 50%;
left: 50%;
transform: translateX(-50%) translateY(-50%);
`,[Eo()])]),w("spin-body",`
display: inline-flex;
align-items: center;
justify-content: center;
flex-direction: column;
`),w("spin",`
display: inline-flex;
height: var(--n-size);
width: var(--n-size);
font-size: var(--n-size);
color: var(--n-color);
`,[I("rotate",`
animation: spin-rotate 2s linear infinite;
`)]),w("spin-description",`
display: inline-block;
font-size: var(--n-font-size);
color: var(--n-text-color);
transition: color .3s var(--n-bezier);
margin-top: 8px;
`),w("spin-content",`
opacity: 1;
transition: opacity .3s var(--n-bezier);
pointer-events: all;
`,[I("spinning",`
user-select: none;
-webkit-user-select: none;
pointer-events: none;
opacity: var(--n-opacity-spinning);
`)])]),CU={small:20,medium:18,large:16},uR=Object.assign(Object.assign({},ye.props),{contentClass:String,contentStyle:[Object,String],description:String,stroke:String,size:{type:[String,Number],default:"medium"},show:{type:Boolean,default:!0},strokeWidth:Number,rotate:{type:Boolean,default:!0},spinning:{type:Boolean,validator:()=>!0,default:void 0},delay:Number}),wU=re({name:"Spin",props:uR,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:r}=Ne(e),n=ye("Spin","-spin",yU,$9,e,t),o=P(()=>{const{size:s}=e,{common:{cubicBezierEaseInOut:d},self:u}=n.value,{opacitySpinning:f,color:h,textColor:g}=u,v=typeof s=="number"?yr(s):u[Ce("size",s)];return{"--n-bezier":d,"--n-opacity-spinning":f,"--n-size":v,"--n-color":h,"--n-text-color":g}}),i=r?Qe("spin",P(()=>{const{size:s}=e;return typeof s=="number"?String(s):s[0]}),o,e):void 0,a=bi(e,["spinning","show"]),l=D(!1);return Et(s=>{let d;if(a.value){const{delay:u}=e;if(u){d=window.setTimeout(()=>{l.value=!0},u),s(()=>{clearTimeout(d)});return}}l.value=a.value}),{mergedClsPrefix:t,active:l,mergedStrokeWidth:P(()=>{const{strokeWidth:s}=e;if(s!==void 0)return s;const{size:d}=e;return CU[typeof d=="number"?"medium":d]}),cssVars:r?void 0:o,themeClass:i==null?void 0:i.themeClass,onRender:i==null?void 0:i.onRender}},render(){var e,t;const{$slots:r,mergedClsPrefix:n,description:o}=this,i=r.icon&&this.rotate,a=(o||r.description)&&c("div",{class:`${n}-spin-description`},o||((e=r.description)===null||e===void 0?void 0:e.call(r))),l=r.icon?c("div",{class:[`${n}-spin-body`,this.themeClass]},c("div",{class:[`${n}-spin`,i&&`${n}-spin--rotate`],style:r.default?"":this.cssVars},r.icon()),a):c("div",{class:[`${n}-spin-body`,this.themeClass]},c(to,{clsPrefix:n,style:r.default?"":this.cssVars,stroke:this.stroke,"stroke-width":this.mergedStrokeWidth,class:`${n}-spin`}),a);return(t=this.onRender)===null||t===void 0||t.call(this),r.default?c("div",{class:[`${n}-spin-container`,this.themeClass],style:this.cssVars},c("div",{class:[`${n}-spin-content`,this.active&&`${n}-spin-content--spinning`,this.contentClass],style:this.contentStyle},r),c(At,{name:"fade-in-transition"},{default:()=>this.active?l:null})):l}}),SU=w("split",`
display: flex;
width: 100%;
height: 100%;
`,[I("horizontal",`
flex-direction: row;
`),I("vertical",`
flex-direction: column;
`),w("split-pane-1",`
overflow: hidden;
`),w("split-pane-2",`
overflow: hidden;
flex: 1;
`),M("resize-trigger",`
background-color: var(--n-resize-trigger-color);
transition: background-color .3s var(--n-bezier);
`,[I("hover",`
background-color: var(--n-resize-trigger-color-hover);
`),O("&:hover",`
background-color: var(--n-resize-trigger-color-hover);
`)])]),kU={name:"Split",common:et},RU=e=>{const{primaryColorHover:t,borderColor:r}=e;return{resizableTriggerColorHover:t,resizableTriggerColor:r}},PU={name:"Split",common:tt,self:RU},fR=Object.assign(Object.assign({},ye.props),{direction:{type:String,default:"horizontal"},resizeTriggerSize:{type:Number,default:3},disabled:Boolean,defaultSize:{type:[String,Number],default:.5},"onUpdate:size":[Function,Array],onUpdateSize:[Function,Array],size:[String,Number],min:{type:[String,Number],default:0},max:{type:[String,Number],default:1},pane1Class:String,pane1Style:[Object,String],pane2Class:String,pane2Style:[Object,String],onDragStart:Function,onDragMove:Function,onDragEnd:Function,watchProps:Array}),TU=re({name:"Split",props:fR,setup(e){var t;const{mergedClsPrefixRef:r,inlineThemeDisabled:n}=Ne(e),o=ye("Split","-split",SU,PU,e,r),i=P(()=>{const{common:{cubicBezierEaseInOut:S},self:{resizableTriggerColor:y,resizableTriggerColorHover:C}}=o.value;return{"--n-bezier":S,"--n-resize-trigger-color":y,"--n-resize-trigger-color-hover":C}}),a=D(null),l=D(!1),s=ve(e,"size"),d=D(e.defaultSize);!((t=e.watchProps)===null||t===void 0)&&t.includes("defaultSize")&&Et(()=>d.value=e.defaultSize);const u=S=>{const y=e["onUpdate:size"];e.onUpdateSize&&ue(e.onUpdateSize,S),y&&ue(y,S),d.value=S},f=$t(s,d),h=P(()=>{const S=f.value;if(typeof S=="string")return{flex:`0 0 ${S}`};if(typeof S=="number"){const y=S*100;return{flex:`0 0 calc(${y}% - ${e.resizeTriggerSize*y/100}px)`}}}),g=P(()=>e.direction==="horizontal"?{width:`${e.resizeTriggerSize}px`,height:"100%"}:{width:"100%",height:`${e.resizeTriggerSize}px`}),v=P(()=>{const S=e.direction==="horizontal";return{width:S?`${e.resizeTriggerSize}px`:"",height:S?"":`${e.resizeTriggerSize}px`,cursor:e.direction==="horizontal"?"col-resize":"row-resize"}});let b=0;const m=S=>{S.preventDefault(),l.value=!0,e.onDragStart&&e.onDragStart(S);const y="mousemove",C="mouseup",k=T=>{p(T),e.onDragMove&&e.onDragMove(T)},R=()=>{Rt(y,document,k),Rt(C,document,R),l.value=!1,e.onDragEnd&&e.onDragEnd(S),document.body.style.cursor=""};document.body.style.cursor=v.value.cursor,_t(y,document,k),_t(C,document,R);const $=a.value;if($){const T=$.getBoundingClientRect();e.direction==="horizontal"?b=S.clientX-T.left:b=T.top-S.clientY}p(S)},p=S=>{var y,C;const k=(C=(y=a.value)===null||y===void 0?void 0:y.parentElement)===null||C===void 0?void 0:C.getBoundingClientRect();if(!k)return;const{direction:R}=e,$=k.width-e.resizeTriggerSize,T=k.height-e.resizeTriggerSize,z=R==="horizontal"?$:T,F=R==="horizontal"?S.clientX-k.left-b:S.clientY-k.top+b,{min:_,max:N}=e,j=typeof _=="string"?jt(_):_*z,H=typeof N=="string"?jt(N):N*z;let Y=F;Y=Math.max(Y,j),Y=Math.min(Y,H,z),typeof f.value=="string"?u(`${Y}px`):u(Y/z)},x=n?Qe("split",void 0,i,e):void 0;return{themeClass:x==null?void 0:x.themeClass,onRender:x==null?void 0:x.onRender,cssVars:n?void 0:i,resizeTriggerElRef:a,isDragging:l,mergedClsPrefix:r,resizeTriggerWrapperStyle:v,resizeTriggerStyle:g,handleMouseDown:m,firstPaneStyle:h}},render(){var e,t,r,n,o;return(e=this.onRender)===null||e===void 0||e.call(this),c("div",{class:[`${this.mergedClsPrefix}-split`,`${this.mergedClsPrefix}-split--${this.direction}`,this.themeClass],style:this.cssVars},c("div",{class:[`${this.mergedClsPrefix}-split-pane-1`,this.pane1Class],style:[this.firstPaneStyle,this.pane1Style]},(r=(t=this.$slots)[1])===null||r===void 0?void 0:r.call(t)),!this.disabled&&c("div",{ref:"resizeTriggerElRef",class:`${this.mergedClsPrefix}-split__resize-trigger-wrapper`,style:this.resizeTriggerWrapperStyle,onMousedown:this.handleMouseDown},yt(this.$slots["resize-trigger"],()=>[c("div",{style:this.resizeTriggerStyle,class:[`${this.mergedClsPrefix}-split__resize-trigger`,this.isDragging&&`${this.mergedClsPrefix}-split__resize-trigger--hover`]})])),c("div",{class:[`${this.mergedClsPrefix}-split-pane-2`,this.pane2Class],style:this.pane2Style},(o=(n=this.$slots)[2])===null||o===void 0?void 0:o.call(n)))}}),$U=w("statistic",[M("label",`
font-weight: var(--n-label-font-weight);
transition: .3s color var(--n-bezier);
font-size: var(--n-label-font-size);
color: var(--n-label-text-color);
`),w("statistic-value",`
margin-top: 4px;
font-weight: var(--n-value-font-weight);
`,[M("prefix",`
margin: 0 4px 0 0;
font-size: var(--n-value-font-size);
transition: .3s color var(--n-bezier);
color: var(--n-value-prefix-text-color);
`,[w("icon",{verticalAlign:"-0.125em"})]),M("content",`
font-size: var(--n-value-font-size);
transition: .3s color var(--n-bezier);
color: var(--n-value-text-color);
`),M("suffix",`
margin: 0 0 0 4px;
font-size: var(--n-value-font-size);
transition: .3s color var(--n-bezier);
color: var(--n-value-suffix-text-color);
`,[w("icon",{verticalAlign:"-0.125em"})])])]),hR=Object.assign(Object.assign({},ye.props),{tabularNums:Boolean,label:String,value:[String,Number]}),zU=re({name:"Statistic",props:hR,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:r,mergedRtlRef:n}=Ne(e),o=ye("Statistic","-statistic",$U,O9,e,t),i=Wt("Statistic",n,t),a=P(()=>{const{self:{labelFontWeight:s,valueFontSize:d,valueFontWeight:u,valuePrefixTextColor:f,labelTextColor:h,valueSuffixTextColor:g,valueTextColor:v,labelFontSize:b},common:{cubicBezierEaseInOut:m}}=o.value;return{"--n-bezier":m,"--n-label-font-size":b,"--n-label-font-weight":s,"--n-label-text-color":h,"--n-value-font-weight":u,"--n-value-font-size":d,"--n-value-prefix-text-color":f,"--n-value-suffix-text-color":g,"--n-value-text-color":v}}),l=r?Qe("statistic",void 0,a,e):void 0;return{rtlEnabled:i,mergedClsPrefix:t,cssVars:r?void 0:a,themeClass:l==null?void 0:l.themeClass,onRender:l==null?void 0:l.onRender}},render(){var e;const{mergedClsPrefix:t,$slots:{default:r,label:n,prefix:o,suffix:i}}=this;return(e=this.onRender)===null||e===void 0||e.call(this),c("div",{class:[`${t}-statistic`,this.themeClass,this.rtlEnabled&&`${t}-statistic--rtl`],style:this.cssVars},Tt(n,a=>c("div",{class:`${t}-statistic__label`},this.label||a)),c("div",{class:`${t}-statistic-value`,style:{fontVariantNumeric:this.tabularNums?"tabular-nums":""}},Tt(o,a=>a&&c("span",{class:`${t}-statistic-value__prefix`},a)),this.value!==void 0?c("span",{class:`${t}-statistic-value__content`},this.value):Tt(r,a=>a&&c("span",{class:`${t}-statistic-value__content`},a)),Tt(i,a=>a&&c("span",{class:`${t}-statistic-value__suffix`},a))))}}),OU=w("steps",`
width: 100%;
display: flex;
`,[w("step",`
position: relative;
display: flex;
flex: 1;
`,[I("disabled","cursor: not-allowed"),I("clickable",`
cursor: pointer;
`),O("&:last-child",[w("step-splitor","display: none;")])]),w("step-splitor",`
background-color: var(--n-splitor-color);
margin-top: calc(var(--n-step-header-font-size) / 2);
height: 1px;
flex: 1;
align-self: flex-start;
margin-left: 12px;
margin-right: 12px;
transition:
color .3s var(--n-bezier),
background-color .3s var(--n-bezier);
`),w("step-content","flex: 1;",[w("step-content-header",`
color: var(--n-header-text-color);
margin-top: calc(var(--n-indicator-size) / 2 - var(--n-step-header-font-size) / 2);
line-height: var(--n-step-header-font-size);
font-size: var(--n-step-header-font-size);
position: relative;
display: flex;
font-weight: var(--n-step-header-font-weight);
margin-left: 9px;
transition:
color .3s var(--n-bezier),
background-color .3s var(--n-bezier);
`,[M("title",`
white-space: nowrap;
flex: 0;
`)]),M("description",`
color: var(--n-description-text-color);
margin-top: 12px;
margin-left: 9px;
transition:
color .3s var(--n-bezier),
background-color .3s var(--n-bezier);
`)]),w("step-indicator",`
background-color: var(--n-indicator-color);
box-shadow: 0 0 0 1px var(--n-indicator-border-color);
height: var(--n-indicator-size);
width: var(--n-indicator-size);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
transition:
background-color .3s var(--n-bezier),
box-shadow .3s var(--n-bezier);
`,[w("step-indicator-slot",`
position: relative;
width: var(--n-indicator-icon-size);
height: var(--n-indicator-icon-size);
font-size: var(--n-indicator-icon-size);
line-height: var(--n-indicator-icon-size);
`,[M("index",`
display: inline-block;
text-align: center;
position: absolute;
left: 0;
top: 0;
white-space: nowrap;
font-size: var(--n-indicator-index-font-size);
width: var(--n-indicator-icon-size);
height: var(--n-indicator-icon-size);
line-height: var(--n-indicator-icon-size);
color: var(--n-indicator-text-color);
transition: color .3s var(--n-bezier);
`,[qr()]),w("icon",`
color: var(--n-indicator-text-color);
transition: color .3s var(--n-bezier);
`,[qr()]),w("base-icon",`
color: var(--n-indicator-text-color);
transition: color .3s var(--n-bezier);
`,[qr()])])]),I("vertical","flex-direction: column;",[xt("show-description",[O(">",[w("step","padding-bottom: 8px;")])]),O(">",[w("step","margin-bottom: 16px;",[O("&:last-child","margin-bottom: 0;"),O(">",[w("step-indicator",[O(">",[w("step-splitor",`
position: absolute;
bottom: -8px;
width: 1px;
margin: 0 !important;
left: calc(var(--n-indicator-size) / 2);
height: calc(100% - var(--n-indicator-size));
`)])]),w("step-content",[M("description","margin-top: 8px;")])])])])])]);function _U(e,t){return typeof e!="object"||e===null||Array.isArray(e)?null:(e.props||(e.props={}),e.props.internalIndex=t+1,e)}function MU(e){return e.map((t,r)=>_U(t,r))}const vR=Object.assign(Object.assign({},ye.props),{current:Number,status:{type:String,default:"process"},size:{type:String,default:"medium"},vertical:Boolean,"onUpdate:current":[Function,Array],onUpdateCurrent:[Function,Array]}),gR="n-steps",IU=re({name:"Steps",props:vR,setup(e,{slots:t}){const{mergedClsPrefixRef:r,mergedRtlRef:n}=Ne(e),o=Wt("Steps",n,r),i=ye("Steps","-steps",OU,I9,e,r);return ot(gR,{props:e,mergedThemeRef:i,mergedClsPrefixRef:r,stepsSlots:t}),{mergedClsPrefix:r,rtlEnabled:o}},render(){const{mergedClsPrefix:e}=this;return c("div",{class:[`${e}-steps`,this.rtlEnabled&&`${e}-steps--rtl`,this.vertical&&`${e}-steps--vertical`]},MU(zn(il(this))))}}),pR={status:String,title:String,description:String,disabled:Boolean,internalIndex:{type:Number,default:0}},FU=re({name:"Step",props:pR,setup(e){const t=De(gR,null);t||_r("step","`n-step` must be placed inside `n-steps`.");const{inlineThemeDisabled:r}=Ne(),{props:n,mergedThemeRef:o,mergedClsPrefixRef:i,stepsSlots:a}=t,l=P(()=>n.vertical),s=P(()=>{const{status:h}=e;if(h)return h;{const{internalIndex:g}=e,{current:v}=n;if(v===void 0)return"process";if(g<v)return"finish";if(g===v)return n.status||"process";if(g>v)return"wait"}return"process"}),d=P(()=>{const{value:h}=s,{size:g}=n,{common:{cubicBezierEaseInOut:v},self:{stepHeaderFontWeight:b,[Ce("stepHeaderFontSize",g)]:m,[Ce("indicatorIndexFontSize",g)]:p,[Ce("indicatorSize",g)]:x,[Ce("indicatorIconSize",g)]:S,[Ce("indicatorTextColor",h)]:y,[Ce("indicatorBorderColor",h)]:C,[Ce("headerTextColor",h)]:k,[Ce("splitorColor",h)]:R,[Ce("indicatorColor",h)]:$,[Ce("descriptionTextColor",h)]:T}}=o.value;return{"--n-bezier":v,"--n-description-text-color":T,"--n-header-text-color":k,"--n-indicator-border-color":C,"--n-indicator-color":$,"--n-indicator-icon-size":S,"--n-indicator-index-font-size":p,"--n-indicator-size":x,"--n-indicator-text-color":y,"--n-splitor-color":R,"--n-step-header-font-size":m,"--n-step-header-font-weight":b}}),u=r?Qe("step",P(()=>{const{value:h}=s,{size:g}=n;return`${h[0]}${g[0]}`}),d,n):void 0,f=P(()=>{if(e.disabled)return;const{onUpdateCurrent:h,"onUpdate:current":g}=n;return h||g?()=>{h&&ue(h,e.internalIndex),g&&ue(g,e.internalIndex)}:void 0});return{stepsSlots:a,mergedClsPrefix:i,vertical:l,mergedStatus:s,handleStepClick:f,cssVars:r?void 0:d,themeClass:u==null?void 0:u.themeClass,onRender:u==null?void 0:u.onRender}},render(){const{mergedClsPrefix:e,onRender:t,handleStepClick:r,disabled:n}=this,o=Tt(this.$slots.default,i=>{const a=i||this.description;return a?c("div",{class:`${e}-step-content__description`},a):null});return t==null||t(),c("div",{class:[`${e}-step`,n&&`${e}-step--disabled`,!n&&r&&`${e}-step--clickable`,this.themeClass,o&&`${e}-step--show-description`,`${e}-step--${this.mergedStatus}-status`],style:this.cssVars,onClick:r},c("div",{class:`${e}-step-indicator`},c("div",{class:`${e}-step-indicator-slot`},c(ko,null,{default:()=>Tt(this.$slots.icon,i=>{const{mergedStatus:a,stepsSlots:l}=this;return a==="finish"||a==="error"?a==="finish"?c(ut,{clsPrefix:e,key:"finish"},{default:()=>yt(l["finish-icon"],()=>[c(Yv,null)])}):a==="error"?c(ut,{clsPrefix:e,key:"error"},{default:()=>yt(l["error-icon"],()=>[c(Xv,null)])}):null:i||c("div",{key:this.internalIndex,class:`${e}-step-indicator-slot__index`},this.internalIndex)})})),this.vertical?c("div",{class:`${e}-step-splitor`}):null),c("div",{class:`${e}-step-content`},c("div",{class:`${e}-step-content-header`},c("div",{class:`${e}-step-content-header__title`},yt(this.$slots.title,()=>[this.title])),this.vertical?null:c("div",{class:`${e}-step-splitor`})),o))}}),DU=w("switch",`
height: var(--n-height);
min-width: var(--n-width);
vertical-align: middle;
user-select: none;
-webkit-user-select: none;
display: inline-flex;
outline: none;
justify-content: center;
align-items: center;
`,[M("children-placeholder",`
height: var(--n-rail-height);
display: flex;
flex-direction: column;
overflow: hidden;
pointer-events: none;
visibility: hidden;
`),M("rail-placeholder",`
display: flex;
flex-wrap: none;
`),M("button-placeholder",`
width: calc(1.75 * var(--n-rail-height));
height: var(--n-rail-height);
`),w("base-loading",`
position: absolute;
top: 50%;
left: 50%;
transform: translateX(-50%) translateY(-50%);
font-size: calc(var(--n-button-width) - 4px);
color: var(--n-loading-color);
transition: color .3s var(--n-bezier);
`,[qr({left:"50%",top:"50%",originalTransform:"translateX(-50%) translateY(-50%)"})]),M("checked, unchecked",`
transition: color .3s var(--n-bezier);
color: var(--n-text-color);
box-sizing: border-box;
position: absolute;
white-space: nowrap;
top: 0;
bottom: 0;
display: flex;
align-items: center;
line-height: 1;
`),M("checked",`
right: 0;
padding-right: calc(1.25 * var(--n-rail-height) - var(--n-offset));
`),M("unchecked",`
left: 0;
justify-content: flex-end;
padding-left: calc(1.25 * var(--n-rail-height) - var(--n-offset));
`),O("&:focus",[M("rail",`
box-shadow: var(--n-box-shadow-focus);
`)]),I("round",[M("rail","border-radius: calc(var(--n-rail-height) / 2);",[M("button","border-radius: calc(var(--n-button-height) / 2);")])]),xt("disabled",[xt("icon",[I("rubber-band",[I("pressed",[M("rail",[M("button","max-width: var(--n-button-width-pressed);")])]),M("rail",[O("&:active",[M("button","max-width: var(--n-button-width-pressed);")])]),I("active",[I("pressed",[M("rail",[M("button","left: calc(100% - var(--n-offset) - var(--n-button-width-pressed));")])]),M("rail",[O("&:active",[M("button","left: calc(100% - var(--n-offset) - var(--n-button-width-pressed));")])])])])])]),I("active",[M("rail",[M("button","left: calc(100% - var(--n-button-width) - var(--n-offset))")])]),M("rail",`
overflow: hidden;
height: var(--n-rail-height);
min-width: var(--n-rail-width);
border-radius: var(--n-rail-border-radius);
cursor: pointer;
position: relative;
transition:
opacity .3s var(--n-bezier),
background .3s var(--n-bezier),
box-shadow .3s var(--n-bezier);
background-color: var(--n-rail-color);
`,[M("button-icon",`
color: var(--n-icon-color);
transition: color .3s var(--n-bezier);
font-size: calc(var(--n-button-height) - 4px);
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
display: flex;
justify-content: center;
align-items: center;
line-height: 1;
`,[qr()]),M("button",`
align-items: center;
top: var(--n-offset);
left: var(--n-offset);
height: var(--n-button-height);
width: var(--n-button-width-pressed);
max-width: var(--n-button-width);
border-radius: var(--n-button-border-radius);
background-color: var(--n-button-color);
box-shadow: var(--n-button-box-shadow);
box-sizing: border-box;
cursor: inherit;
content: "";
position: absolute;
transition:
background-color .3s var(--n-bezier),
left .3s var(--n-bezier),
opacity .3s var(--n-bezier),
max-width .3s var(--n-bezier),
box-shadow .3s var(--n-bezier);
`)]),I("active",[M("rail","background-color: var(--n-rail-color-active);")]),I("loading",[M("rail",`
cursor: wait;
`)]),I("disabled",[M("rail",`
cursor: not-allowed;
opacity: .5;
`)])]),mR=Object.assign(Object.assign({},ye.props),{size:{type:String,default:"medium"},value:{type:[String,Number,Boolean],default:void 0},loading:Boolean,defaultValue:{type:[String,Number,Boolean],default:!1},disabled:{type:Boolean,default:void 0},round:{type:Boolean,default:!0},"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],checkedValue:{type:[String,Number,Boolean],default:!0},uncheckedValue:{type:[String,Number,Boolean],default:!1},railStyle:Function,rubberBand:{type:Boolean,default:!0},onChange:[Function,Array]});let wl;const EU=re({name:"Switch",props:mR,setup(e){wl===void 0&&(typeof CSS<"u"?typeof CSS.supports<"u"?wl=CSS.supports("width","max(1px)"):wl=!1:wl=!0);const{mergedClsPrefixRef:t,inlineThemeDisabled:r}=Ne(e),n=ye("Switch","-switch",DU,A9,e,t),o=Rr(e),{mergedSizeRef:i,mergedDisabledRef:a}=o,l=D(e.defaultValue),s=ve(e,"value"),d=$t(s,l),u=P(()=>d.value===e.checkedValue),f=D(!1),h=D(!1),g=P(()=>{const{railStyle:$}=e;if($)return $({focused:h.value,checked:u.value})});function v($){const{"onUpdate:value":T,onChange:z,onUpdateValue:F}=e,{nTriggerFormInput:_,nTriggerFormChange:N}=o;T&&ue(T,$),F&&ue(F,$),z&&ue(z,$),l.value=$,_(),N()}function b(){const{nTriggerFormFocus:$}=o;$()}function m(){const{nTriggerFormBlur:$}=o;$()}function p(){e.loading||a.value||(d.value!==e.checkedValue?v(e.checkedValue):v(e.uncheckedValue))}function x(){h.value=!0,b()}function S(){h.value=!1,m(),f.value=!1}function y($){e.loading||a.value||$.key===" "&&(d.value!==e.checkedValue?v(e.checkedValue):v(e.uncheckedValue),f.value=!1)}function C($){e.loading||a.value||$.key===" "&&($.preventDefault(),f.value=!0)}const k=P(()=>{const{value:$}=i,{self:{opacityDisabled:T,railColor:z,railColorActive:F,buttonBoxShadow:_,buttonColor:N,boxShadowFocus:j,loadingColor:H,textColor:Y,iconColor:X,[Ce("buttonHeight",$)]:le,[Ce("buttonWidth",$)]:ke,[Ce("buttonWidthPressed",$)]:be,[Ce("railHeight",$)]:Q,[Ce("railWidth",$)]:L,[Ce("railBorderRadius",$)]:A,[Ce("buttonBorderRadius",$)]:U},common:{cubicBezierEaseInOut:ae}}=n.value;let he,Re,Oe;return wl?(he=`calc((${Q} - ${le}) / 2)`,Re=`max(${Q}, ${le})`,Oe=`max(${L}, calc(${L} + ${le} - ${Q}))`):(he=yr((jt(Q)-jt(le))/2),Re=yr(Math.max(jt(Q),jt(le))),Oe=jt(Q)>jt(le)?L:yr(jt(L)+jt(le)-jt(Q))),{"--n-bezier":ae,"--n-button-border-radius":U,"--n-button-box-shadow":_,"--n-button-color":N,"--n-button-width":ke,"--n-button-width-pressed":be,"--n-button-height":le,"--n-height":Re,"--n-offset":he,"--n-opacity-disabled":T,"--n-rail-border-radius":A,"--n-rail-color":z,"--n-rail-color-active":F,"--n-rail-height":Q,"--n-rail-width":L,"--n-width":Oe,"--n-box-shadow-focus":j,"--n-loading-color":H,"--n-text-color":Y,"--n-icon-color":X}}),R=r?Qe("switch",P(()=>i.value[0]),k,e):void 0;return{handleClick:p,handleBlur:S,handleFocus:x,handleKeyup:y,handleKeydown:C,mergedRailStyle:g,pressed:f,mergedClsPrefix:t,mergedValue:d,checked:u,mergedDisabled:a,cssVars:r?void 0:k,themeClass:R==null?void 0:R.themeClass,onRender:R==null?void 0:R.onRender}},render(){const{mergedClsPrefix:e,mergedDisabled:t,checked:r,mergedRailStyle:n,onRender:o,$slots:i}=this;o==null||o();const{checked:a,unchecked:l,icon:s,"checked-icon":d,"unchecked-icon":u}=i,f=!(Zi(s)&&Zi(d)&&Zi(u));return c("div",{role:"switch","aria-checked":r,class:[`${e}-switch`,this.themeClass,f&&`${e}-switch--icon`,r&&`${e}-switch--active`,t&&`${e}-switch--disabled`,this.round&&`${e}-switch--round`,this.loading&&`${e}-switch--loading`,this.pressed&&`${e}-switch--pressed`,this.rubberBand&&`${e}-switch--rubber-band`],tabindex:this.mergedDisabled?void 0:0,style:this.cssVars,onClick:this.handleClick,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeyup:this.handleKeyup,onKeydown:this.handleKeydown},c("div",{class:`${e}-switch__rail`,"aria-hidden":"true",style:n},Tt(a,h=>Tt(l,g=>h||g?c("div",{"aria-hidden":!0,class:`${e}-switch__children-placeholder`},c("div",{class:`${e}-switch__rail-placeholder`},c("div",{class:`${e}-switch__button-placeholder`}),h),c("div",{class:`${e}-switch__rail-placeholder`},c("div",{class:`${e}-switch__button-placeholder`}),g)):null)),c("div",{cla
font-size: var(--n-font-size);
font-variant-numeric: tabular-nums;
line-height: var(--n-line-height);
width: 100%;
border-radius: var(--n-border-radius) var(--n-border-radius) 0 0;
text-align: left;
border-collapse: separate;
border-spacing: 0;
overflow: hidden;
background-color: var(--n-td-color);
border-color: var(--n-merged-border-color);
transition:
background-color .3s var(--n-bezier),
border-color .3s var(--n-bezier),
color .3s var(--n-bezier);
--n-merged-border-color: var(--n-border-color);
`,[O("th",`
white-space: nowrap;
transition:
background-color .3s var(--n-bezier),
border-color .3s var(--n-bezier),
color .3s var(--n-bezier);
text-align: inherit;
padding: var(--n-th-padding);
vertical-align: inherit;
text-transform: none;
border: 0px solid var(--n-merged-border-color);
font-weight: var(--n-th-font-weight);
color: var(--n-th-text-color);
background-color: var(--n-th-color);
border-bottom: 1px solid var(--n-merged-border-color);
border-right: 1px solid var(--n-merged-border-color);
`,[O("&:last-child",`
border-right: 0px solid var(--n-merged-border-color);
`)]),O("td",`
transition:
background-color .3s var(--n-bezier),
border-color .3s var(--n-bezier),
color .3s var(--n-bezier);
padding: var(--n-td-padding);
color: var(--n-td-text-color);
background-color: var(--n-td-color);
border: 0px solid var(--n-merged-border-color);
border-right: 1px solid var(--n-merged-border-color);
border-bottom: 1px solid var(--n-merged-border-color);
`,[O("&:last-child",`
border-right: 0px solid var(--n-merged-border-color);
`)]),I("bordered",`
border: 1px solid var(--n-merged-border-color);
border-radius: var(--n-border-radius);
`,[O("tr",[O("&:last-child",[O("td",`
border-bottom: 0 solid var(--n-merged-border-color);
`)])])]),I("single-line",[O("th",`
border-right: 0px solid var(--n-merged-border-color);
`),O("td",`
border-right: 0px solid var(--n-merged-border-color);
`)]),I("single-column",[O("tr",[O("&:not(:last-child)",[O("td",`
border-bottom: 0px solid var(--n-merged-border-color);
`)])])]),I("striped",[O("tr:nth-of-type(even)",[O("td","background-color: var(--n-td-color-striped)")])]),xt("bottom-bordered",[O("tr",[O("&:last-child",[O("td",`
border-bottom: 0px solid var(--n-merged-border-color);
`)])])])]),So(w("table",`
background-color: var(--n-td-color-modal);
--n-merged-border-color: var(--n-border-color-modal);
`,[O("th",`
background-color: var(--n-th-color-modal);
`),O("td",`
background-color: var(--n-td-color-modal);
`)])),jo(w("table",`
background-color: var(--n-td-color-popover);
--n-merged-border-color: var(--n-border-color-popover);
`,[O("th",`
background-color: var(--n-th-color-popover);
`),O("td",`
background-color: var(--n-td-color-popover);
`)]))]),bR=Object.assign(Object.assign({},ye.props),{bordered:{type:Boolean,default:!0},bottomBordered:{type:Boolean,default:!0},singleLine:{type:Boolean,default:!0},striped:Boolean,singleColumn:Boolean,size:{type:String,default:"medium"}}),BU=re({name:"Table",props:bR,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:r,mergedRtlRef:n}=Ne(e),o=ye("Table","-table",AU,N9,e,t),i=Wt("Table",n,t),a=P(()=>{const{size:s}=e,{self:{borderColor:d,tdColor:u,tdColorModal:f,tdColorPopover:h,thColor:g,thColorModal:v,thColorPopover:b,thTextColor:m,tdTextColor:p,borderRadius:x,thFontWeight:S,lineHeight:y,borderColorModal:C,borderColorPopover:k,tdColorStriped:R,tdColorStripedModal:$,tdColorStripedPopover:T,[Ce("fontSize",s)]:z,[Ce("tdPadding",s)]:F,[Ce("thPadding",s)]:_},common:{cubicBezierEaseInOut:N}}=o.value;return{"--n-bezier":N,"--n-td-color":u,"--n-td-color-modal":f,"--n-td-color-popover":h,"--n-td-text-color":p,"--n-border-color":d,"--n-border-color-modal":C,"--n-border-color-popover":k,"--n-border-radius":x,"--n-font-size":z,"--n-th-color":g,"--n-th-color-modal":v,"--n-th-color-popover":b,"--n-th-font-weight":S,"--n-th-text-color":m,"--n-line-height":y,"--n-td-padding":F,"--n-th-padding":_,"--n-td-color-striped":R,"--n-td-color-striped-modal":$,"--n-td-color-striped-popover":T}}),l=r?Qe("table",P(()=>e.size[0]),a,e):void 0;return{rtlEnabled:i,mergedClsPrefix:t,cssVars:r?void 0:a,themeClass:l==null?void 0:l.themeClass,onRender:l==null?void 0:l.onRender}},render(){var e;const{mergedClsPrefix:t}=this;return(e=this.onRender)===null||e===void 0||e.call(this),c("table",{class:[`${t}-table`,this.themeClass,{[`${t}-table--rtl`]:this.rtlEnabled,[`${t}-table--bottom-bordered`]:this.bottomBordered,[`${t}-table--bordered`]:this.bordered,[`${t}-table--single-line`]:this.singleLine,[`${t}-table--single-column`]:this.singleColumn,[`${t}-table--striped`]:this.striped}],style:this.cssVars},this.$slots)}}),NU=re({name:"Th",render(){return c("th",null,this.$slots)}}),LU=re({name:"Tr",render(){return c("tr",null,this.$slots)}}),HU=re({name:"Td",render(){return c("td",null,this.$slots)}}),jU=re({name:"Thead",render(){return c("thead",null,this.$slots)}}),VU=re({name:"Tbody",render(){return c("tbody",null,this.$slots)}}),Eg="n-tabs",Ag={tab:[String,Number,Object,Function],name:{type:[String,Number],required:!0},disabled:Boolean,displayDirective:{type:String,default:"if"},closable:{type:Boolean,default:void 0},tabProps:Object,label:[String,Number,Object,Function]},UU=re({__TAB_PANE__:!0,name:"TabPane",alias:["TabPanel"],props:Ag,setup(e){const t=De(Eg,null);return t||_r("tab-pane","`n-tab-pane` must be placed inside `n-tabs`."),{style:t.paneStyleRef,class:t.paneClassRef,mergedClsPrefix:t.mergedClsPrefixRef}},render(){return c("div",{class:[`${this.mergedClsPrefix}-tab-pane`,this.class],style:this.style},this.$slots)}}),xR=Object.assign({internalLeftPadded:Boolean,internalAddable:Boolean,internalCreatedByPane:Boolean},Pi(Ag,["displayDirective"])),nc=re({__TAB__:!0,inheritAttrs:!1,name:"Tab",props:xR,setup(e){const{mergedClsPrefixRef:t,valueRef:r,typeRef:n,closableRef:o,tabStyleRef:i,addTabStyleRef:a,tabClassRef:l,addTabClassRef:s,tabChangeIdRef:d,onBeforeLeaveRef:u,triggerRef:f,handleAdd:h,activateTab:g,handleClose:v}=De(Eg);return{trigger:f,mergedClosable:P(()=>{if(e.internalAddable)return!1;const{closable:b}=e;return b===void 0?o.value:b}),style:i,addStyle:a,tabClass:l,addTabClass:s,clsPrefix:t,value:r,type:n,handleClose(b){b.stopPropagation(),!e.disabled&&v(e.name)},activateTab(){if(e.disabled)return;if(e.internalAddable){h();return}const{name:b}=e,m=++d.id;if(b!==r.value){const{value:p}=u;p?Promise.resolve(p(e.name,r.value)).then(x=>{x&&d.id===m&&g(b)}):g(b)}}}},render(){const{internalAddable:e,clsPrefix:t,name:r,disabled:n,label:o,tab:i,value:a,mergedClosable:l,trigger:s,$slots:{default:d}}=this,u=o??i;return c("div",{class:`${t}-tabs-tab-wrapper`},this.internalLeftPadded?c("div",{class:`${t}-tabs-tab-pad`}):null,c("div",Object.assign({key:r,"data-name":r,"data-disabled":n?!0:void 0},Hr({class:[`${t}-tabs-tab`,a===r&&`${t}-tabs-tab--active`
box-sizing: border-box;
width: 100%;
display: flex;
flex-direction: column;
transition:
background-color .3s var(--n-bezier),
border-color .3s var(--n-bezier);
`,[I("segment-type",[w("tabs-rail",[O("&.transition-disabled",[w("tabs-capsule",`
transition: none;
`)])])]),I("top",[w("tab-pane",`
padding: var(--n-pane-padding-top) var(--n-pane-padding-right) var(--n-pane-padding-bottom) var(--n-pane-padding-left);
`)]),I("left",[w("tab-pane",`
padding: var(--n-pane-padding-right) var(--n-pane-padding-bottom) var(--n-pane-padding-left) var(--n-pane-padding-top);
`)]),I("left, right",`
flex-direction: row;
`,[w("tabs-bar",`
width: 2px;
right: 0;
transition:
top .2s var(--n-bezier),
max-height .2s var(--n-bezier),
background-color .3s var(--n-bezier);
`),w("tabs-tab",`
padding: var(--n-tab-padding-vertical);
`)]),I("right",`
flex-direction: row-reverse;
`,[w("tab-pane",`
padding: var(--n-pane-padding-left) var(--n-pane-padding-top) var(--n-pane-padding-right) var(--n-pane-padding-bottom);
`),w("tabs-bar",`
left: 0;
`)]),I("bottom",`
flex-direction: column-reverse;
justify-content: flex-end;
`,[w("tab-pane",`
padding: var(--n-pane-padding-bottom) var(--n-pane-padding-right) var(--n-pane-padding-top) var(--n-pane-padding-left);
`),w("tabs-bar",`
top: 0;
`)]),w("tabs-rail",`
position: relative;
padding: 3px;
border-radius: var(--n-tab-border-radius);
width: 100%;
background-color: var(--n-color-segment);
transition: background-color .3s var(--n-bezier);
display: flex;
align-items: center;
`,[w("tabs-capsule",`
border-radius: var(--n-tab-border-radius);
position: absolute;
pointer-events: none;
background-color: var(--n-tab-color-segment);
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .08);
transition: transform 0.3s var(--n-bezier);
`),w("tabs-tab-wrapper",`
flex-basis: 0;
flex-grow: 1;
display: flex;
align-items: center;
justify-content: center;
`,[w("tabs-tab",`
overflow: hidden;
border-radius: var(--n-tab-border-radius);
width: 100%;
display: flex;
align-items: center;
justify-content: center;
`,[I("active",`
font-weight: var(--n-font-weight-strong);
color: var(--n-tab-text-color-active);
`),O("&:hover",`
color: var(--n-tab-text-color-hover);
`)])])]),I("flex",[w("tabs-nav",`
width: 100%;
position: relative;
`,[w("tabs-wrapper",`
width: 100%;
`,[w("tabs-tab",`
margin-right: 0;
`)])])]),w("tabs-nav",`
box-sizing: border-box;
line-height: 1.5;
display: flex;
transition: border-color .3s var(--n-bezier);
`,[M("prefix, suffix",`
display: flex;
align-items: center;
`),M("prefix","padding-right: 16px;"),M("suffix","padding-left: 16px;")]),I("top, bottom",[w("tabs-nav-scroll-wrapper",[O("&::before",`
top: 0;
bottom: 0;
left: 0;
width: 20px;
`),O("&::after",`
top: 0;
bottom: 0;
right: 0;
width: 20px;
`),I("shadow-start",[O("&::before",`
box-shadow: inset 10px 0 8px -8px rgba(0, 0, 0, .12);
`)]),I("shadow-end",[O("&::after",`
box-shadow: inset -10px 0 8px -8px rgba(0, 0, 0, .12);
`)])])]),I("left, right",[w("tabs-nav-scroll-content",`
flex-direction: column;
`),w("tabs-nav-scroll-wrapper",[O("&::before",`
top: 0;
left: 0;
right: 0;
height: 20px;
`),O("&::after",`
bottom: 0;
left: 0;
right: 0;
height: 20px;
`),I("shadow-start",[O("&::before",`
box-shadow: inset 0 10px 8px -8px rgba(0, 0, 0, .12);
`)]),I("shadow-end",[O("&::after",`
box-shadow: inset 0 -10px 8px -8px rgba(0, 0, 0, .12);
`)])])]),w("tabs-nav-scroll-wrapper",`
flex: 1;
position: relative;
overflow: hidden;
`,[w("tabs-nav-y-scroll",`
height: 100%;
width: 100%;
overflow-y: auto;
scrollbar-width: none;
`,[O("&::-webkit-scrollbar",`
width: 0;
height: 0;
`)]),O("&::before, &::after",`
transition: box-shadow .3s var(--n-bezier);
pointer-events: none;
content: "";
position: absolute;
z-index: 1;
`)]),w("tabs-nav-scroll-content",`
display: flex;
position: relative;
min-width: 100%;
min-height: 100%;
width: fit-content;
box-sizing: border-box;
`),w("tabs-wrapper",`
display: inline-flex;
flex-wrap: nowrap;
position: relative;
`),w("tabs-tab-wrapper",`
display: flex;
flex-wrap: nowrap;
flex-shrink: 0;
flex-grow: 0;
`),w("tabs-tab",`
cursor: pointer;
white-space: nowrap;
flex-wrap: nowrap;
display: inline-flex;
align-items: center;
color: var(--n-tab-text-color);
font-size: var(--n-tab-font-size);
background-clip: padding-box;
padding: var(--n-tab-padding);
transition:
box-shadow .3s var(--n-bezier),
color .3s var(--n-bezier),
background-color .3s var(--n-bezier),
border-color .3s var(--n-bezier);
`,[I("disabled",{cursor:"not-allowed"}),M("close",`
margin-left: 6px;
transition:
background-color .3s var(--n-bezier),
color .3s var(--n-bezier);
`),M("label",`
display: flex;
align-items: center;
z-index: 1;
`)]),w("tabs-bar",`
position: absolute;
bottom: 0;
height: 2px;
border-radius: 1px;
background-color: var(--n-bar-color);
transition:
left .2s var(--n-bezier),
max-width .2s var(--n-bezier),
opacity .3s var(--n-bezier),
background-color .3s var(--n-bezier);
`,[O("&.transition-disabled",`
transition: none;
`),I("disabled",`
background-color: var(--n-tab-text-color-disabled)
`)]),w("tabs-pane-wrapper",`
position: relative;
overflow: hidden;
transition: max-height .2s var(--n-bezier);
`),w("tab-pane",`
color: var(--n-pane-text-color);
width: 100%;
transition:
color .3s var(--n-bezier),
background-color .3s var(--n-bezier),
opacity .2s var(--n-bezier);
left: 0;
right: 0;
top: 0;
`,[O("&.next-transition-leave-active, &.prev-transition-leave-active, &.next-transition-enter-active, &.prev-transition-enter-active",`
transition:
color .3s var(--n-bezier),
background-color .3s var(--n-bezier),
transform .2s var(--n-bezier),
opacity .2s var(--n-bezier);
`),O("&.next-transition-leave-active, &.prev-transition-leave-active",`
position: absolute;
`),O("&.next-transition-enter-from, &.prev-transition-leave-to",`
transform: translateX(32px);
opacity: 0;
`),O("&.next-transition-leave-to, &.prev-transition-enter-from",`
transform: translateX(-32px);
opacity: 0;
`),O("&.next-transition-leave-from, &.next-transition-enter-to, &.prev-transition-leave-from, &.prev-transition-enter-to",`
transform: translateX(0);
opacity: 1;
`)]),w("tabs-tab-pad",`
box-sizing: border-box;
width: var(--n-tab-gap);
flex-grow: 0;
flex-shrink: 0;
`),I("line-type, bar-type",[w("tabs-tab",`
font-weight: var(--n-tab-font-weight);
box-sizing: border-box;
vertical-align: bottom;
`,[O("&:hover",{color:"var(--n-tab-text-color-hover)"}),I("active",`
color: var(--n-tab-text-color-active);
font-weight: var(--n-tab-font-weight-active);
`),I("disabled",{color:"var(--n-tab-text-color-disabled)"})])]),w("tabs-nav",[I("line-type",[I("top",[M("prefix, suffix",`
border-bottom: 1px solid var(--n-tab-border-color);
`),w("tabs-nav-scroll-content",`
border-bottom: 1px solid var(--n-tab-border-color);
`),w("tabs-bar",`
bottom: -1px;
`)]),I("left",[M("prefix, suffix",`
border-right: 1px solid var(--n-tab-border-color);
`),w("tabs-nav-scroll-content",`
border-right: 1px solid var(--n-tab-border-color);
`),w("tabs-bar",`
right: -1px;
`)]),I("right",[M("prefix, suffix",`
border-left: 1px solid var(--n-tab-border-color);
`),w("tabs-nav-scroll-content",`
border-left: 1px solid var(--n-tab-border-color);
`),w("tabs-bar",`
left: -1px;
`)]),I("bottom",[M("prefix, suffix",`
border-top: 1px solid var(--n-tab-border-color);
`),w("tabs-nav-scroll-content",`
border-top: 1px solid var(--n-tab-border-color);
`),w("tabs-bar",`
top: -1px;
`)]),M("prefix, suffix",`
transition: border-color .3s var(--n-bezier);
`),w("tabs-nav-scroll-content",`
transition: border-color .3s var(--n-bezier);
`),w("tabs-bar",`
border-radius: 0;
`)]),I("card-type",[M("prefix, suffix",`
transition: border-color .3s var(--n-bezier);
border-bottom: 1px solid var(--n-tab-border-color);
`),w("tabs-pad",`
flex-grow: 1;
transition: border-color .3s var(--n-bezier);
`),w("tabs-tab-pad",`
transition: border-color .3s var(--n-bezier);
`),w("tabs-tab",`
font-weight: var(--n-tab-font-weight);
border: 1px solid var(--n-tab-border-color);
background-color: var(--n-tab-color);
box-sizing: border-box;
position: relative;
vertical-align: bottom;
display: flex;
justify-content: space-between;
font-size: var(--n-tab-font-size);
color: var(--n-tab-text-color);
`,[I("addable",`
padding-left: 8px;
padding-right: 8px;
font-size: 16px;
`,[M("height-placeholder",`
width: 0;
font-size: var(--n-tab-font-size);
`),xt("disabled",[O("&:hover",`
color: var(--n-tab-text-color-hover);
`)])]),I("closable","padding-right: 8px;"),I("active",`
background-color: #0000;
font-weight: var(--n-tab-font-weight-active);
color: var(--n-tab-text-color-active);
`),I("disabled","color: var(--n-tab-text-color-disabled);")]),w("tabs-scroll-padding","border-bottom: 1px solid var(--n-tab-border-color);")]),I("left, right",[w("tabs-wrapper",`
flex-direction: column;
`,[w("tabs-tab-wrapper",`
flex-direction: column;
`,[w("tabs-tab-pad",`
height: var(--n-tab-gap-vertical);
width: 100%;
`)])])]),I("top",[I("card-type",[w("tabs-tab",`
border-top-left-radius: var(--n-tab-border-radius);
border-top-right-radius: var(--n-tab-border-radius);
`,[I("active",`
border-bottom: 1px solid #0000;
`)]),w("tabs-tab-pad",`
border-bottom: 1px solid var(--n-tab-border-color);
`),w("tabs-pad",`
border-bottom: 1px solid var(--n-tab-border-color);
`)])]),I("left",[I("card-type",[w("tabs-tab",`
border-top-left-radius: var(--n-tab-border-radius);
border-bottom-left-radius: var(--n-tab-border-radius);
`,[I("active",`
border-right: 1px solid #0000;
`)]),w("tabs-tab-pad",`
border-right: 1px solid var(--n-tab-border-color);
`),w("tabs-pad",`
border-right: 1px solid var(--n-tab-border-color);
`)])]),I("right",[I("card-type",[w("tabs-tab",`
border-top-right-radius: var(--n-tab-border-radius);
border-bottom-right-radius: var(--n-tab-border-radius);
`,[I("active",`
border-left: 1px solid #0000;
`)]),w("tabs-tab-pad",`
border-left: 1px solid var(--n-tab-border-color);
`),w("tabs-pad",`
border-left: 1px solid var(--n-tab-border-color);
`)])]),I("bottom",[I("card-type",[w("tabs-tab",`
border-bottom-left-radius: var(--n-tab-border-radius);
border-bottom-right-radius: var(--n-tab-border-radius);
`,[I("active",`
border-top: 1px solid #0000;
`)]),w("tabs-tab-pad",`
border-top: 1px solid var(--n-tab-border-color);
`),w("tabs-pad",`
border-top: 1px solid var(--n-tab-border-color);
`)])])])]),yR=Object.assign(Object.assign({},ye.props),{value:[String,Number],defaultValue:[String,Number],trigger:{type:String,default:"click"},type:{type:String,default:"bar"},closable:Boolean,justifyContent:String,size:{type:String,default:"medium"},placement:{type:String,default:"top"},tabStyle:[String,Object],tabClass:String,addTabStyle:[String,Object],addTabClass:String,barWidth:Number,paneClass:String,paneStyle:[String,Object],paneWrapperClass:String,paneWrapperStyle:[String,Object],addable:[Boolean,Object],tabsPadding:{type:Number,default:0},animated:Boolean,onBeforeLeave:Function,onAdd:Function,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onClose:[Function,Array],labelSize:String,activeName:[String,Number],onActiveNameChange:[Function,Array]}),KU=re({name:"Tabs",props:yR,setup(e,{slots:t}){var r,n,o,i;const{mergedClsPrefixRef:a,inlineThemeDisabled:l}=Ne(e),s=ye("Tabs","-tabs",WU,j9,e,a),d=D(null),u=D(null),f=D(null),h=D(null),g=D(null),v=D(null),b=D(!0),m=D(!0),p=bi(e,["labelSize","size"]),x=bi(e,["activeName","value"]),S=D((n=(r=x.value)!==null&&r!==void 0?r:e.defaultValue)!==null&&n!==void 0?n:t.default?(i=(o=zn(t.default())[0])===null||o===void 0?void 0:o.props)===null||i===void 0?void 0:i.name:null),y=$t(x,S),C={id:0},k=P(()=>{if(!(!e.justifyContent||e.type==="card"))return{display:"flex",justifyContent:e.justifyContent}});ft(y,()=>{C.id=0,F(),_()});function R(){var J;const{value:oe}=y;return oe===null?null:(J=d.value)===null||J===void 0?void 0:J.querySelector(`[data-name="${oe}"]`)}function $(J){if(e.type==="card")return;const{value:oe}=u;if(!oe)return;const de=oe.style.opacity==="0";if(J){const Z=`${a.value}-tabs-bar--disabled`,{barWidth:B,placement:te}=e;if(J.dataset.disabled==="true"?oe.classList.add(Z):oe.classList.remove(Z),["top","bottom"].includes(te)){if(z(["top","maxHeight","height"]),typeof B=="number"&&J.offsetWidth>=B){const we=Math.floor((J.offsetWidth-B)/2)+J.offsetLeft;oe.style.left=`${we}px`,oe.style.maxWidth=`${B}px`}else oe.style.left=`${J.offsetLeft}px`,oe.style.maxWidth=`${J.offsetWidth}px`;oe.style.width="8192px",de&&(oe.style.transition="none"),oe.offsetWidth,de&&(oe.style.transition="",oe.style.opacity="1")}else{if(z(["left","maxWidth","width"]),typeof B=="number"&&J.offsetHeight>=B){const we=Math.floor((J.offsetHeight-B)/2)+J.offsetTop;oe.style.top=`${we}px`,oe.style.maxHeight=`${B}px`}else oe.style.top=`${J.offsetTop}px`,oe.style.maxHeight=`${J.offsetHeight}px`;oe.style.height="8192px",de&&(oe.style.transition="none"),oe.offsetHeight,de&&(oe.style.transition="",oe.style.opacity="1")}}}function T(){if(e.type==="card")return;const{value:J}=u;J&&(J.style.opacity="0")}function z(J){const{value:oe}=u;if(oe)for(const de of J)oe.style[de]=""}function F(){if(e.type==="card")return;const J=R();J?$(J):T()}function _(J){var oe;const de=(oe=g.value)===null||oe===void 0?void 0:oe.$el;if(!de)return;const Z=R();if(!Z)return;const{scrollLeft:B,offsetWidth:te}=de,{offsetLeft:we,offsetWidth:Le}=Z;B>we?de.scrollTo({top:0,left:we,behavior:"smooth"}):we+Le>B+te&&de.scrollTo({top:0,left:we+Le-te,behavior:"smooth"})}const N=D(null);let j=0,H=null;function Y(J){const oe=N.value;if(oe){j=J.getBoundingClientRect().height;const de=`${j}px`,Z=()=>{oe.style.height=de,oe.style.maxHeight=de};H?(Z(),H(),H=null):H=Z}}function X(J){const oe=N.value;if(oe){const de=J.getBoundingClientRect().height,Z=()=>{document.body.offsetHeight,oe.style.maxHeight=`${de}px`,oe.style.height=`${Math.max(j,de)}px`};H?(H(),H=null,Z()):H=Z}}function le(){const J=N.value;if(J){J.style.maxHeight="",J.style.height="";const{paneWrapperStyle:oe}=e;if(typeof oe=="string")J.style.cssText=oe;else if(oe){const{maxHeight:de,height:Z}=oe;de!==void 0&&(J.style.maxHeight=de),Z!==void 0&&(J.style.height=Z)}}}const ke={value:[]},be=D("next");function Q(J){const oe=y.value;let de="next";for(const Z of ke.value){if(Z===oe)break;if(Z===J){de="prev";break}}be.value=de,L(J)}function L(J){const{onActiveNameChange:oe,onUpdateValue:de,"onUpdate:value":Z}=e;oe&&ue(oe,J),de&&ue(de,J),Z&&ue(Z,J),S.value=J}function A(J){const{onClose:oe}=e;o
display: flex;
transition: color .3s var(--n-bezier);
font-size: var(--n-font-size);
color: var(--n-text-color);
`,[w("thing-avatar",`
margin-right: 12px;
margin-top: 2px;
`),w("thing-avatar-header-wrapper",`
display: flex;
flex-wrap: nowrap;
`,[w("thing-header-wrapper",`
flex: 1;
`)]),w("thing-main",`
flex-grow: 1;
`,[w("thing-header",`
display: flex;
margin-bottom: 4px;
justify-content: space-between;
align-items: center;
`,[M("title",`
font-size: 16px;
font-weight: var(--n-title-font-weight);
transition: color .3s var(--n-bezier);
color: var(--n-title-text-color);
`)]),M("description",[O("&:not(:last-child)",`
margin-bottom: 4px;
`)]),M("content",[O("&:not(:first-child)",`
margin-top: 12px;
`)]),M("footer",[O("&:not(:first-child)",`
margin-top: 12px;
`)]),M("action",[O("&:not(:first-child)",`
margin-top: 12px;
`)])])]),CR=Object.assign(Object.assign({},ye.props),{title:String,titleExtra:String,description:String,descriptionClass:String,descriptionStyle:[String,Object],content:String,contentClass:String,contentStyle:[String,Object],contentIndented:Boolean}),YU=re({name:"Thing",props:CR,setup(e,{slots:t}){const{mergedClsPrefixRef:r,inlineThemeDisabled:n,mergedRtlRef:o}=Ne(e),i=ye("Thing","-thing",qU,U9,e,r),a=Wt("Thing",o,r),l=P(()=>{const{self:{titleTextColor:d,textColor:u,titleFontWeight:f,fontSize:h},common:{cubicBezierEaseInOut:g}}=i.value;return{"--n-bezier":g,"--n-font-size":h,"--n-text-color":u,"--n-title-font-weight":f,"--n-title-text-color":d}}),s=n?Qe("thing",void 0,l,e):void 0;return()=>{var d;const{value:u}=r,f=a?a.value:!1;return(d=s==null?void 0:s.onRender)===null||d===void 0||d.call(s),c("div",{class:[`${u}-thing`,s==null?void 0:s.themeClass,f&&`${u}-thing--rtl`],style:n?void 0:l.value},t.avatar&&e.contentIndented?c("div",{class:`${u}-thing-avatar`},t.avatar()):null,c("div",{class:`${u}-thing-main`},!e.contentIndented&&(t.header||e.title||t["header-extra"]||e.titleExtra||t.avatar)?c("div",{class:`${u}-thing-avatar-header-wrapper`},t.avatar?c("div",{class:`${u}-thing-avatar`},t.avatar()):null,t.header||e.title||t["header-extra"]||e.titleExtra?c("div",{class:`${u}-thing-header-wrapper`},c("div",{class:`${u}-thing-header`},t.header||e.title?c("div",{class:`${u}-thing-header__title`},t.header?t.header():e.title):null,t["header-extra"]||e.titleExtra?c("div",{class:`${u}-thing-header__extra`},t["header-extra"]?t["header-extra"]():e.titleExtra):null),t.description||e.description?c("div",{class:[`${u}-thing-main__description`,e.descriptionClass],style:e.descriptionStyle},t.description?t.description():e.description):null):null):c(It,null,t.header||e.title||t["header-extra"]||e.titleExtra?c("div",{class:`${u}-thing-header`},t.header||e.title?c("div",{class:`${u}-thing-header__title`},t.header?t.header():e.title):null,t["header-extra"]||e.titleExtra?c("div",{class:`${u}-thing-header__extra`},t["header-extra"]?t["header-extra"]():e.titleExtra):null):null,t.description||e.description?c("div",{class:[`${u}-thing-main__description`,e.descriptionClass],style:e.descriptionStyle},t.description?t.description():e.description):null),t.default||e.content?c("div",{class:[`${u}-thing-main__content`,e.contentClass],style:e.contentStyle},t.default?t.default():e.content):null,t.footer?c("div",{class:`${u}-thing-main__footer`},t.footer()):null,t.action?c("div",{class:`${u}-thing-main__action`},t.action()):null))}}}),wR={time:{type:[Number,Date],default:void 0},type:{type:String,default:"datetime"},to:{type:[Number,Date],default:void 0},unix:Boolean,format:String,text:Boolean,timeZone:String},GU=re({name:"Time",props:wR,setup(e){const t=Date.now(),{localeRef:r,dateLocaleRef:n}=mr("Time"),o=P(()=>{const{timeZone:d}=e;return d?(u,f,h)=>_S(u,d,f,h):tr}),i=P(()=>({locale:n.value.locale})),a=P(()=>{const{time:d}=e;return e.unix?d===void 0?t:qm(typeof d=="number"?d:d.valueOf()):d??t}),l=P(()=>{const{to:d}=e;return e.unix?d===void 0?t:qm(typeof d=="number"?d:d.valueOf()):d??t});return{renderedTime:P(()=>e.format?o.value(a.value,e.format,i.value):e.type==="date"?o.value(a.value,r.value.dateFormat,i.value):e.type==="datetime"?o.value(a.value,r.value.dateTimeFormat,i.value):FF(a.value,l.value,{addSuffix:!0,locale:n.value.locale}))}},render(){return this.text?ea(this.renderedTime):c("time",[this.renderedTime])}}),c0=1.25,XU=w("timeline",`
position: relative;
width: 100%;
display: flex;
flex-direction: column;
line-height: ${c0};
`,[I("horizontal",`
flex-direction: row;
`,[O(">",[w("timeline-item",`
flex-shrink: 0;
padding-right: 40px;
`,[I("dashed-line-type",[O(">",[w("timeline-item-timeline",[M("line",`
background-image: linear-gradient(90deg, var(--n-color-start), var(--n-color-start) 50%, transparent 50%, transparent 100%);
background-size: 10px 1px;
`)])])]),O(">",[w("timeline-item-content",`
margin-top: calc(var(--n-icon-size) + 12px);
`,[O(">",[M("meta",`
margin-top: 6px;
margin-bottom: unset;
`)])]),w("timeline-item-timeline",`
width: 100%;
height: calc(var(--n-icon-size) + 12px);
`,[M("line",`
left: var(--n-icon-size);
top: calc(var(--n-icon-size) / 2 - 1px);
right: 0px;
width: unset;
height: 2px;
`)])])])])]),I("right-placement",[w("timeline-item",[w("timeline-item-content",`
text-align: right;
margin-right: calc(var(--n-icon-size) + 12px);
`),w("timeline-item-timeline",`
width: var(--n-icon-size);
right: 0;
`)])]),I("left-placement",[w("timeline-item",[w("timeline-item-content",`
margin-left: calc(var(--n-icon-size) + 12px);
`),w("timeline-item-timeline",`
left: 0;
`)])]),w("timeline-item",`
position: relative;
`,[O("&:last-child",[w("timeline-item-timeline",[M("line",`
display: none;
`)]),w("timeline-item-content",[M("meta",`
margin-bottom: 0;
`)])]),w("timeline-item-content",[M("title",`
margin: var(--n-title-margin);
font-size: var(--n-title-font-size);
transition: color .3s var(--n-bezier);
font-weight: var(--n-title-font-weight);
color: var(--n-title-text-color);
`),M("content",`
transition: color .3s var(--n-bezier);
font-size: var(--n-content-font-size);
color: var(--n-content-text-color);
`),M("meta",`
transition: color .3s var(--n-bezier);
font-size: 12px;
margin-top: 6px;
margin-bottom: 20px;
color: var(--n-meta-text-color);
`)]),I("dashed-line-type",[w("timeline-item-timeline",[M("line",`
--n-color-start: var(--n-line-color);
transition: --n-color-start .3s var(--n-bezier);
background-color: transparent;
background-image: linear-gradient(180deg, var(--n-color-start), var(--n-color-start) 50%, transparent 50%, transparent 100%);
background-size: 1px 10px;
`)])]),w("timeline-item-timeline",`
width: calc(var(--n-icon-size) + 12px);
position: absolute;
top: calc(var(--n-title-font-size) * ${c0} / 2 - var(--n-icon-size) / 2);
height: 100%;
`,[M("circle",`
border: var(--n-circle-border);
transition:
background-color .3s var(--n-bezier),
border-color .3s var(--n-bezier);
width: var(--n-icon-size);
height: var(--n-icon-size);
border-radius: var(--n-icon-size);
box-sizing: border-box;
`),M("icon",`
color: var(--n-icon-color);
font-size: var(--n-icon-size);
height: var(--n-icon-size);
width: var(--n-icon-size);
display: flex;
align-items: center;
justify-content: center;
`),M("line",`
transition: background-color .3s var(--n-bezier);
position: absolute;
top: var(--n-icon-size);
left: calc(var(--n-icon-size) / 2 - 1px);
bottom: 0px;
width: 2px;
background-color: var(--n-line-color);
`)])])]),SR=Object.assign(Object.assign({},ye.props),{horizontal:Boolean,itemPlacement:{type:String,default:"left"},size:{type:String,default:"medium"},iconSize:Number}),kR="n-timeline",ZU=re({name:"Timeline",props:SR,setup(e,{slots:t}){const{mergedClsPrefixRef:r}=Ne(e),n=ye("Timeline","-timeline",XU,Y9,e,r);return ot(kR,{props:e,mergedThemeRef:n,mergedClsPrefixRef:r}),()=>{const{value:o}=r;return c("div",{class:[`${o}-timeline`,e.horizontal&&`${o}-timeline--horizontal`,`${o}-timeline--${e.size}-size`,!e.horizontal&&`${o}-timeline--${e.itemPlacement}-placement`]},t)}}}),RR={time:[String,Number],title:String,content:String,color:String,lineType:{type:String,default:"default"},type:{type:String,default:"default"}},QU=re({name:"TimelineItem",props:RR,setup(e){const t=De(kR);t||_r("timeline-item","`n-timeline-item` must be placed inside `n-timeline`."),kv();const{inlineThemeDisabled:r}=Ne(),n=P(()=>{const{props:{size:i,iconSize:a},mergedThemeRef:l}=t,{type:s}=e,{self:{titleTextColor:d,contentTextColor:u,metaTextColor:f,lineColor:h,titleFontWeight:g,contentFontSize:v,[Ce("iconSize",i)]:b,[Ce("titleMargin",i)]:m,[Ce("titleFontSize",i)]:p,[Ce("circleBorder",s)]:x,[Ce("iconColor",s)]:S},common:{cubicBezierEaseInOut:y}}=l.value;return{"--n-bezier":y,"--n-circle-border":x,"--n-icon-color":S,"--n-content-font-size":v,"--n-content-text-color":u,"--n-line-color":h,"--n-meta-text-color":f,"--n-title-font-size":p,"--n-title-font-weight":g,"--n-title-margin":m,"--n-title-text-color":d,"--n-icon-size":zt(a)||b}}),o=r?Qe("timeline-item",P(()=>{const{props:{size:i,iconSize:a}}=t,{type:l}=e;return`${i[0]}${a||"a"}${l[0]}`}),n,t.props):void 0;return{mergedClsPrefix:t.mergedClsPrefixRef,cssVars:r?void 0:n,themeClass:o==null?void 0:o.themeClass,onRender:o==null?void 0:o.onRender}},render(){const{mergedClsPrefix:e,color:t,onRender:r,$slots:n}=this;return r==null||r(),c("div",{class:[`${e}-timeline-item`,this.themeClass,`${e}-timeline-item--${this.type}-type`,`${e}-timeline-item--${this.lineType}-line-type`],style:this.cssVars},c("div",{class:`${e}-timeline-item-timeline`},c("div",{class:`${e}-timeline-item-timeline__line`}),Tt(n.icon,o=>o?c("div",{class:`${e}-timeline-item-timeline__icon`,style:{color:t}},o):c("div",{class:`${e}-timeline-item-timeline__circle`,style:{borderColor:t}}))),c("div",{class:`${e}-timeline-item-content`},Tt(n.header,o=>o||this.title?c("div",{class:`${e}-timeline-item-content__title`},o||this.title):null),c("div",{class:`${e}-timeline-item-content__content`},yt(n.default,()=>[this.content])),c("div",{class:`${e}-timeline-item-content__meta`},yt(n.footer,()=>[this.time]))))}}),Os="n-transfer",u0=re({name:"TransferHeader",props:{size:{type:String,required:!0},selectAllText:String,clearText:String,source:Boolean,onCheckedAll:Function,onClearAll:Function,title:String},setup(e){const{targetOptionsRef:t,canNotSelectAnythingRef:r,canBeClearedRef:n,allCheckedRef:o,mergedThemeRef:i,disabledRef:a,mergedClsPrefixRef:l,srcOptionsLengthRef:s}=De(Os),{localeRef:d}=mr("Transfer");return()=>{const{source:u,onClearAll:f,onCheckedAll:h,selectAllText:g,clearText:v}=e,{value:b}=i,{value:m}=l,{value:p}=d,x=e.size==="large"?"small":"tiny",{title:S}=e;return c("div",{class:`${m}-transfer-list-header`},S&&c("div",{class:`${m}-transfer-list-header__title`},S),u&&c(Dt,{class:`${m}-transfer-list-header__button`,theme:b.peers.Button,themeOverrides:b.peerOverrides.Button,size:x,tertiary:!0,onClick:o.value?f:h,disabled:r.value||a.value},{default:()=>o.value?v||p.unselectAll:g||p.selectAll}),!u&&n.value&&c(Dt,{class:`${m}-transfer-list-header__button`,theme:b.peers.Button,themeOverrides:b.peerOverrides.Button,size:x,tertiary:!0,onClick:f,disabled:a.value},{default:()=>p.clearAll}),c("div",{class:`${m}-transfer-list-header__extra`},u?p.total(s.value):p.selected(t.value.length)))}}}),f0=re({name:"NTransferListItem",props:{source:Boolean,label:{type:String,required:!0},value:{type:[String,Number],required:!0},disabled:Boolean,option:{type:Object,required:!0}},setup(e){const{targetValueSetRef:t,mergedClsPrefixRef:r,mergedThemeRef:n,handleItemCheck:o,re
width: 100%;
font-size: var(--n-font-size);
height: 300px;
display: flex;
flex-wrap: nowrap;
word-break: break-word;
`,[I("disabled",[w("transfer-list",[w("transfer-list-header",[M("title",`
color: var(--n-header-text-color-disabled);
`),M("extra",`
color: var(--n-header-extra-text-color-disabled);
`)])])]),w("transfer-list",`
flex: 1;
min-width: 0;
height: inherit;
display: flex;
flex-direction: column;
background-clip: padding-box;
position: relative;
transition: background-color .3s var(--n-bezier);
background-color: var(--n-list-color);
`,[I("source",`
border-top-left-radius: var(--n-border-radius);
border-bottom-left-radius: var(--n-border-radius);
`,[M("border","border-right: 1px solid var(--n-divider-color);")]),I("target",`
border-top-right-radius: var(--n-border-radius);
border-bottom-right-radius: var(--n-border-radius);
`,[M("border","border-left: none;")]),M("border",`
padding: 0 12px;
border: 1px solid var(--n-border-color);
transition: border-color .3s var(--n-bezier);
pointer-events: none;
border-radius: inherit;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
`),w("transfer-list-header",`
min-height: var(--n-header-height);
box-sizing: border-box;
display: flex;
padding: 12px 12px 10px 12px;
align-items: center;
background-clip: padding-box;
border-radius: inherit;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
line-height: 1.5;
transition:
border-color .3s var(--n-bezier),
background-color .3s var(--n-bezier);
`,[O("> *:not(:first-child)",`
margin-left: 8px;
`),M("title",`
flex: 1;
min-width: 0;
line-height: 1.5;
font-size: var(--n-header-font-size);
font-weight: var(--n-header-font-weight);
transition: color .3s var(--n-bezier);
color: var(--n-header-text-color);
`),M("button",`
position: relative;
`),M("extra",`
transition: color .3s var(--n-bezier);
font-size: var(--n-extra-font-size);
margin-right: 0;
white-space: nowrap;
color: var(--n-header-extra-text-color);
`)]),w("transfer-list-body",`
flex-basis: 0;
flex-grow: 1;
box-sizing: border-box;
position: relative;
display: flex;
flex-direction: column;
border-radius: inherit;
border-top-left-radius: 0;
border-top-right-radius: 0;
`,[w("transfer-filter",`
padding: 4px 12px 8px 12px;
box-sizing: border-box;
transition:
border-color .3s var(--n-bezier),
background-color .3s var(--n-bezier);
`),w("transfer-list-flex-container",`
flex: 1;
position: relative;
`,[w("scrollbar",`
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
height: unset;
`),w("empty",`
position: absolute;
left: 50%;
top: 50%;
transform: translateY(-50%) translateX(-50%);
`),w("transfer-list-content",`
padding: 0;
margin: 0;
position: relative;
`,[w("transfer-list-item",`
padding: 0 12px;
min-height: var(--n-item-height);
display: flex;
align-items: center;
color: var(--n-item-text-color);
position: relative;
transition: color .3s var(--n-bezier);
`,[M("background",`
position: absolute;
left: 4px;
right: 4px;
top: 0;
bottom: 0;
border-radius: var(--n-border-radius);
transition: background-color .3s var(--n-bezier);
`),M("checkbox",`
position: relative;
margin-right: 8px;
`),M("close",`
opacity: 0;
pointer-events: none;
position: relative;
transition:
opacity .3s var(--n-bezier),
background-color .3s var(--n-bezier),
color .3s var(--n-bezier);
`),M("label",`
position: relative;
min-width: 0;
flex-grow: 1;
`),I("source","cursor: pointer;"),I("disabled",`
cursor: not-allowed;
color: var(--n-item-text-color-disabled);
`),xt("disabled",[O("&:hover",[M("background","background-color: var(--n-item-color-pending);"),M("close",`
opacity: 1;
pointer-events: all;
`)])])])])])])])]),PR=Object.assign(Object.assign({},ye.props),{value:Array,defaultValue:{type:Array,default:null},options:{type:Array,default:()=>[]},disabled:{type:Boolean,default:void 0},virtualScroll:Boolean,sourceTitle:String,selectAllText:String,clearText:String,targetTitle:String,filterable:{type:Boolean,default:void 0},sourceFilterable:Boolean,targetFilterable:Boolean,showSelected:{type:Boolean,default:!0},sourceFilterPlaceholder:String,targetFilterPlaceholder:String,filter:{type:Function,default:(e,t)=>e?~(""+t.label).toLowerCase().indexOf((""+e).toLowerCase()):!0},size:String,renderSourceLabel:Function,renderTargetLabel:Function,renderSourceList:Function,renderTargetList:Function,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onChange:[Function,Array]}),tW=re({name:"Transfer",props:PR,setup(e){const{mergedClsPrefixRef:t}=Ne(e),r=ye("Transfer","-transfer",eW,Z9,e,t),n=Rr(e),{mergedSizeRef:o,mergedDisabledRef:i}=n,a=P(()=>{const{value:j}=o,{self:{[Ce("itemHeight",j)]:H}}=r.value;return jt(H)}),{uncontrolledValueRef:l,mergedValueRef:s,targetValueSetRef:d,valueSetForCheckAllRef:u,valueSetForUncheckAllRef:f,valueSetForClearRef:h,filteredTgtOptionsRef:g,filteredSrcOptionsRef:v,targetOptionsRef:b,canNotSelectAnythingRef:m,canBeClearedRef:p,allCheckedRef:x,srcPatternRef:S,tgtPatternRef:y,mergedSrcFilterableRef:C,handleSrcFilterUpdateValue:k,handleTgtFilterUpdateValue:R}=JU(e);function $(j){const{onUpdateValue:H,"onUpdate:value":Y,onChange:X}=e,{nTriggerFormInput:le,nTriggerFormChange:ke}=n;H&&ue(H,j),Y&&ue(Y,j),X&&ue(X,j),l.value=j,le(),ke()}function T(){$([...u.value])}function z(){$([...f.value])}function F(){$([...h.value])}function _(j,H){$(j?(s.value||[]).concat(H):(s.value||[]).filter(Y=>Y!==H))}function N(j){$(j)}return ot(Os,{targetValueSetRef:d,mergedClsPrefixRef:t,disabledRef:i,mergedThemeRef:r,targetOptionsRef:b,canNotSelectAnythingRef:m,canBeClearedRef:p,allCheckedRef:x,srcOptionsLengthRef:P(()=>e.options.length),handleItemCheck:_,renderSourceLabelRef:ve(e,"renderSourceLabel"),renderTargetLabelRef:ve(e,"renderTargetLabel"),showSelectedRef:ve(e,"showSelected")}),{mergedClsPrefix:t,mergedDisabled:i,itemSize:a,isMounted:Ur(),mergedTheme:r,filteredSrcOpts:v,filteredTgtOpts:g,srcPattern:S,tgtPattern:y,mergedSize:o,mergedSrcFilterable:C,handleSrcFilterUpdateValue:k,handleTgtFilterUpdateValue:R,handleSourceCheckAll:T,handleSourceUncheckAll:z,handleTargetClearAll:F,handleItemCheck:_,handleChecked:N,cssVars:P(()=>{const{value:j}=o,{common:{cubicBezierEaseInOut:H},self:{borderRadius:Y,borderColor:X,listColor:le,titleTextColor:ke,titleTextColorDisabled:be,extraTextColor:Q,itemTextColor:L,itemColorPending:A,itemTextColorDisabled:U,titleFontWeight:ae,closeColorHover:he,closeColorPressed:Re,closeIconColor:Oe,closeIconColorHover:V,closeIconColorPressed:Te,closeIconSize:Me,closeSize:Ve,dividerColor:E,extraTextColorDisabled:W,[Ce("extraFontSize",j)]:ie,[Ce("fontSize",j)]:ge,[Ce("titleFontSize",j)]:ne,[Ce("itemHeight",j)]:ee,[Ce("headerHeight",j)]:me}}=r.value;return{"--n-bezier":H,"--n-border-color":X,"--n-border-radius":Y,"--n-extra-font-size":ie,"--n-font-size":ge,"--n-header-font-size":ne,"--n-header-extra-text-color":Q,"--n-header-extra-text-color-disabled":W,"--n-header-font-weight":ae,"--n-header-text-color":ke,"--n-header-text-color-disabled":be,"--n-item-color-pending":A,"--n-item-height":ee,"--n-item-text-color":L,"--n-item-text-color-disabled":U,"--n-list-color":le,"--n-header-height":me,"--n-close-size":Ve,"--n-close-icon-size":Me,"--n-close-color-hover":he,"--n-close-color-pressed":Re,"--n-close-icon-color":Oe,"--n-close-icon-color-hover":V,"--n-close-icon-color-pressed":Te,"--n-divider-color":E}})}},render(){const{mergedClsPrefix:e,renderSourceList:t,renderTargetList:r,mergedTheme:n,mergedSrcFilterable:o,targetFilterable:i}=this;return c("div",{class:[`${e}-transfer`,this.mergedDisabled&&`${e}-transfer--disabled`],style:this.cssVars},c("div",{class:`${e}-transfer-list ${e}-transfer-list--source`},c(u0,{source:!0,selectAllText:this.selectAllText,clearText:this.clearText,title:this.sourceTitle
font-size: var(--n-font-size);
outline: none;
`,[O("ul, li",`
margin: 0;
padding: 0;
list-style: none;
`),O(">",[w("tree-node",[O("&:first-child","margin-top: 0;")])]),w("tree-motion-wrapper",[I("expand",[Ao({duration:"0.2s"})]),I("collapse",[Ao({duration:"0.2s",reverse:!0})])]),w("tree-node-wrapper",`
box-sizing: border-box;
padding: var(--n-node-wrapper-padding);
`),w("tree-node",`
transform: translate3d(0,0,0);
position: relative;
display: flex;
border-radius: var(--n-node-border-radius);
transition: background-color .3s var(--n-bezier);
`,[I("highlight",[w("tree-node-content",[M("text","border-bottom-color: var(--n-node-text-color-disabled);")])]),I("disabled",[w("tree-node-content",`
color: var(--n-node-text-color-disabled);
cursor: not-allowed;
`)]),xt("disabled",[I("clickable",[w("tree-node-content",`
cursor: pointer;
`)])])]),I("block-node",[w("tree-node-content",`
flex: 1;
min-width: 0;
`)]),xt("block-line",[w("tree-node",[xt("disabled",[w("tree-node-content",[O("&:hover","background: var(--n-node-color-hover);")]),I("selectable",[w("tree-node-content",[O("&:active","background: var(--n-node-color-pressed);")])]),I("pending",[w("tree-node-content",`
background: var(--n-node-color-hover);
`)]),I("selected",[w("tree-node-content","background: var(--n-node-color-active);")])]),I("selected",[w("tree-node-content","background: var(--n-node-color-active);")])])]),I("block-line",[w("tree-node",[xt("disabled",[O("&:hover","background: var(--n-node-color-hover);"),I("pending",`
background: var(--n-node-color-hover);
`),I("selectable",[xt("selected",[O("&:active","background: var(--n-node-color-pressed);")])]),I("selected","background: var(--n-node-color-active);")]),I("selected","background: var(--n-node-color-active);"),I("disabled",`
cursor: not-allowed;
`)])]),w("tree-node-indent",`
flex-grow: 0;
flex-shrink: 0;
`,[I("show-line","position: relative",[O("&::before",`
position: absolute;
left: 50%;
border-left: 1px solid var(--n-line-color);
transition: border-color .3s var(--n-bezier);
transform: translate(-50%);
content: "";
top: var(--n-line-offset-top);
bottom: var(--n-line-offset-bottom);
`),I("last-child",[O("&::before",`
bottom: 50%;
`)]),I("is-leaf",[O("&::after",`
position: absolute;
content: "";
left: calc(50% + 0.5px);
right: 0;
bottom: 50%;
transition: border-color .3s var(--n-bezier);
border-bottom: 1px solid var(--n-line-color);
`)])]),xt("show-line","height: 0;")]),w("tree-node-switcher",`
cursor: pointer;
display: inline-flex;
flex-shrink: 0;
height: var(--n-node-content-height);
align-items: center;
justify-content: center;
transition: transform .15s var(--n-bezier);
vertical-align: bottom;
`,[M("icon",`
position: relative;
height: 14px;
width: 14px;
display: flex;
color: var(--n-arrow-color);
transition: color .3s var(--n-bezier);
font-size: 14px;
`,[w("icon",[Qu]),w("base-loading",`
color: var(--n-loading-color);
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
`,[Qu]),w("base-icon",[Qu])]),I("hide","visibility: hidden;"),I("expanded","transform: rotate(90deg);")]),w("tree-node-checkbox",`
display: inline-flex;
height: var(--n-node-content-height);
vertical-align: bottom;
align-items: center;
justify-content: center;
`),w("tree-node-content",`
user-select: none;
position: relative;
display: inline-flex;
align-items: center;
min-height: var(--n-node-content-height);
box-sizing: border-box;
line-height: var(--n-line-height);
vertical-align: bottom;
padding: 0 6px 0 4px;
cursor: default;
border-radius: var(--n-node-border-radius);
color: var(--n-node-text-color);
transition:
color .3s var(--n-bezier),
background-color .3s var(--n-bezier),
border-color .3s var(--n-bezier);
`,[O("&:last-child","margin-bottom: 0;"),M("prefix",`
display: inline-flex;
margin-right: 8px;
`),M("text",`
border-bottom: 1px solid #0000;
transition: border-color .3s var(--n-bezier);
flex-grow: 1;
max-width: 100%;
`),M("suffix",`
display: inline-flex;
`)]),M("empty","margin: auto;")]);var fW=function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function l(u){try{d(n.next(u))}catch(f){a(f)}}function s(u){try{d(n.throw(u))}catch(f){a(f)}}function d(u){u.done?i(u.value):o(u.value).then(l,s)}d((n=n.apply(e,[])).next())})};function OR(e,t,r,n){return{getIsGroup(){return!1},getKey(i){return i[e]},getChildren:n||(i=>i[t]),getDisabled(i){return!!(i[r]||i.checkboxDisabled)}}}const _R={allowCheckingNotLoaded:Boolean,filter:Function,defaultExpandAll:Boolean,expandedKeys:Array,keyField:{type:String,default:"key"},labelField:{type:String,default:"label"},childrenField:{type:String,default:"children"},disabledField:{type:String,default:"disabled"},defaultExpandedKeys:{type:Array,default:()=>[]},indeterminateKeys:Array,renderSwitcherIcon:Function,onUpdateIndeterminateKeys:[Function,Array],"onUpdate:indeterminateKeys":[Function,Array],onUpdateExpandedKeys:[Function,Array],"onUpdate:expandedKeys":[Function,Array],overrideDefaultNodeClickBehavior:Function},MR=Object.assign(Object.assign(Object.assign(Object.assign({},ye.props),{accordion:Boolean,showIrrelevantNodes:{type:Boolean,default:!0},data:{type:Array,default:()=>[]},expandOnDragenter:{type:Boolean,default:!0},expandOnClick:Boolean,checkOnClick:{type:[Boolean,Function],default:!1},cancelable:{type:Boolean,default:!0},checkable:Boolean,draggable:Boolean,blockNode:Boolean,blockLine:Boolean,showLine:Boolean,disabled:Boolean,checkedKeys:Array,defaultCheckedKeys:{type:Array,default:()=>[]},selectedKeys:Array,defaultSelectedKeys:{type:Array,default:()=>[]},multiple:Boolean,pattern:{type:String,default:""},onLoad:Function,cascade:Boolean,selectable:{type:Boolean,default:!0},scrollbarProps:Object,indent:{type:Number,default:24},allowDrop:{type:Function,default:iW},animated:{type:Boolean,default:!0},checkboxPlacement:{type:String,default:"left"},virtualScroll:Boolean,watchProps:Array,renderLabel:Function,renderPrefix:Function,renderSuffix:Function,nodeProps:Function,keyboard:{type:Boolean,default:!0},getChildren:Function,onDragenter:[Function,Array],onDragleave:[Function,Array],onDragend:[Function,Array],onDragstart:[Function,Array],onDragover:[Function,Array],onDrop:[Function,Array],onUpdateCheckedKeys:[Function,Array],"onUpdate:checkedKeys":[Function,Array],onUpdateSelectedKeys:[Function,Array],"onUpdate:selectedKeys":[Function,Array]}),_R),{internalTreeSelect:Boolean,internalScrollable:Boolean,internalScrollablePadding:String,internalRenderEmpty:Function,internalHighlightKeySet:Object,internalUnifySelectCheck:Boolean,internalCheckboxFocusable:{type:Boolean,default:!0},internalFocusable:{type:Boolean,default:!0},checkStrategy:{type:String,default:"all"},leafOnly:Boolean}),IR=re({name:"Tree",props:MR,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:r,mergedRtlRef:n}=Ne(e),o=Wt("Tree",n,t),i=ye("Tree","-tree",uW,Y2,e,t),a=D(null),l=D(null),s=D(null);function d(){var Se;return(Se=s.value)===null||Se===void 0?void 0:Se.listElRef}function u(){var Se;return(Se=s.value)===null||Se===void 0?void 0:Se.itemsElRef}const f=P(()=>{const{filter:Se}=e;if(Se)return Se;const{labelField:Ie}=e;return(He,st)=>{if(!He.length)return!0;const ht=st[Ie];return typeof ht=="string"?ht.toLowerCase().includes(He.toLowerCase()):!1}}),h=P(()=>{const{pattern:Se}=e;return Se?!Se.length||!f.value?{filteredTree:e.data,highlightKeySet:null,expandedKeys:void 0}:lW(e.data,f.value,Se,e.keyField,e.childrenField):{filteredTree:e.data,highlightKeySet:null,expandedKeys:void 0}}),g=P(()=>On(e.showIrrelevantNodes?e.data:h.value.filteredTree,OR(e.keyField,e.childrenField,e.disabledField,e.getChildren))),v=De(Bg,null),b=e.internalTreeSelect?v.dataTreeMate:g,{watchProps:m}=e,p=D([]);m!=null&&m.includes("defaultCheckedKeys")?Et(()=>{p.value=e.defaultCheckedKeys}):p.value=e.defaultCheckedKeys;const x=ve(e,"checkedKeys"),S=$t(x,p),y=P(()=>b.value.getCheckedKeys(S.value,{cascade:e.cascade,allowNotLoaded:e.allowCheckingNotLoaded})),C=TR(e),k=P(()=>y.value.checkedKeys),R=P(()=>{const{indeterminateKeys:Se}=e;return
z-index: auto;
outline: none;
width: 100%;
position: relative;
`),w("tree-select-menu",`
position: relative;
overflow: hidden;
margin: 4px 0;
transition: box-shadow .3s var(--n-bezier), background-color .3s var(--n-bezier);
border-radius: var(--n-menu-border-radius);
box-shadow: var(--n-menu-box-shadow);
background-color: var(--n-menu-color);
outline: none;
`,[w("tree","max-height: var(--n-menu-height);"),M("empty",`
display: flex;
padding: 12px 32px;
flex: 1;
justify-content: center;
`),M("action",`
padding: var(--n-action-padding);
transition:
color .3s var(--n-bezier);
border-color .3s var(--n-bezier);
border-top: 1px solid var(--n-action-divider-color);
color: var(--n-action-text-color);
`),Ar()])]),FR=Object.assign(Object.assign(Object.assign(Object.assign({},ye.props),{bordered:{type:Boolean,default:!0},cascade:Boolean,checkable:Boolean,clearable:Boolean,clearFilterAfterSelect:{type:Boolean,default:!0},consistentMenuWidth:{type:Boolean,default:!0},defaultShow:Boolean,defaultValue:{type:[String,Number,Array],default:null},disabled:{type:Boolean,default:void 0},filterable:Boolean,checkStrategy:{type:String,default:"all"},loading:Boolean,maxTagCount:[String,Number],multiple:Boolean,showPath:Boolean,separator:{type:String,default:" / "},options:{type:Array,default:()=>[]},placeholder:String,placement:{type:String,default:"bottom-start"},show:{type:Boolean,default:void 0},size:String,value:[String,Number,Array],to:Kt.propTo,menuProps:Object,virtualScroll:{type:Boolean,default:!0},status:String,renderTag:Function,ellipsisTagPopoverProps:Object}),_R),{renderLabel:Function,renderPrefix:Function,renderSuffix:Function,nodeProps:Function,watchProps:Array,getChildren:Function,onBlur:Function,onFocus:Function,onLoad:Function,onUpdateShow:[Function,Array],onUpdateValue:[Function,Array],"onUpdate:value":[Function,Array],"onUpdate:show":[Function,Array],leafOnly:Boolean}),vW=re({name:"TreeSelect",props:FR,setup(e){const t=D(null),r=D(null),n=D(null),o=D(null),{mergedClsPrefixRef:i,namespaceRef:a,inlineThemeDisabled:l}=Ne(e),{localeRef:s}=mr("Select"),{mergedSizeRef:d,mergedDisabledRef:u,mergedStatusRef:f,nTriggerFormBlur:h,nTriggerFormChange:g,nTriggerFormFocus:v,nTriggerFormInput:b}=Rr(e),m=D(e.defaultValue),p=ve(e,"value"),x=$t(p,m),S=D(e.defaultShow),y=ve(e,"show"),C=$t(y,S),k=D(""),R=P(()=>{const{filter:q}=e;if(q)return q;const{labelField:xe}=e;return(Ee,Ae)=>Ee.length?Ae[xe].toLowerCase().includes(Ee.toLowerCase()):!0}),$=P(()=>On(e.options,OR(e.keyField,e.childrenField,e.disabledField,void 0))),{value:T}=x,z=D(e.checkable?null:Array.isArray(T)&&T.length?T[T.length-1]:null),F=P(()=>e.multiple&&e.cascade&&e.checkable),_=D(e.defaultExpandAll?void 0:e.defaultExpandedKeys||e.expandedKeys),N=ve(e,"expandedKeys"),j=$t(N,_),H=D(!1),Y=P(()=>{const{placeholder:q}=e;return q!==void 0?q:s.value.placeholder}),X=P(()=>e.checkable?[]:le.value),le=P(()=>{const{value:q}=x;return e.multiple?Array.isArray(q)?q:[]:q===null||Array.isArray(q)?[]:[q]}),ke=P(()=>{const{multiple:q,showPath:xe,separator:Ee,labelField:Ae}=e;if(q)return null;const{value:ce}=x;if(!Array.isArray(ce)&&ce!==null){const{value:_e}=$,se=_e.getNode(ce);if(se!==null)return xe?m0(se,_e.getPath(ce).treeNodePath,Ee,Ae):p0(se,Ae)}return null}),be=P(()=>{const{multiple:q,showPath:xe,separator:Ee}=e;if(!q)return null;const{value:Ae}=x;if(Array.isArray(Ae)){const ce=[],{value:_e}=$,{checkedKeys:se}=_e.getCheckedKeys(Ae,{checkStrategy:e.checkStrategy,cascade:F.value,allowNotLoaded:e.allowCheckingNotLoaded}),{labelField:$e}=e;return se.forEach(Xe=>{const Ge=_e.getNode(Xe);Ge!==null&&ce.push(xe?m0(Ge,_e.getPath(Xe).treeNodePath,Ee,$e):p0(Ge,$e))}),ce}return[]}),Q=P(()=>{const{self:{menuPadding:q}}=at.value;return q});function L(){var q;(q=r.value)===null||q===void 0||q.focus()}function A(){var q;(q=r.value)===null||q===void 0||q.focusInput()}function U(q){const{onUpdateShow:xe,"onUpdate:show":Ee}=e;xe&&ue(xe,q),Ee&&ue(Ee,q),S.value=q}function ae(q,xe,Ee){const{onUpdateValue:Ae,"onUpdate:value":ce}=e;Ae&&ue(Ae,q,xe,Ee),ce&&ue(ce,q,xe,Ee),m.value=q,b(),g()}function he(q,xe){const{onUpdateIndeterminateKeys:Ee,"onUpdate:indeterminateKeys":Ae}=e;Ee&&ue(Ee,q,xe),Ae&&ue(Ae,q,xe)}function Re(q,xe,Ee){const{onUpdateExpandedKeys:Ae,"onUpdate:expandedKeys":ce}=e;Ae&&ue(Ae,q,xe,Ee),ce&&ue(ce,q,xe,Ee),_.value=q}function Oe(q){const{onFocus:xe}=e;xe&&xe(q),v()}function V(q){Te();const{onBlur:xe}=e;xe&&xe(q),h()}function Te(){U(!1)}function Me(){u.value||(k.value="",U(!0),e.filterable&&A())}function Ve(){k.value=""}function E(q){var xe;C.value&&(!((xe=r.value)===null||xe===void 0)&&xe.$el.contains(mn(q))||Te())}function W(){u.value||(C.value?e.filterable||Te():Me())}function ie(q){const{value:{getNode:xe}}=$;return q.map(Ee=>{var Ae;return((Ae=xe(Ee))===null||Ae===void 0?void 0:Ae.rawNod
font-size: var(--n-font-size);
font-weight: var(--n-font-weight);
margin: var(--n-margin);
transition: color .3s var(--n-bezier);
color: var(--n-text-color);
`,[O("&:first-child",{marginTop:0}),I("prefix-bar",{position:"relative",paddingLeft:"var(--n-prefix-width)"},[I("align-text",{paddingLeft:0},[O("&::before",{left:"calc(-1 * var(--n-prefix-width))"})]),O("&::before",`
content: "";
width: var(--n-bar-width);
border-radius: calc(var(--n-bar-width) / 2);
transition: background-color .3s var(--n-bezier);
left: 0;
top: 0;
bottom: 0;
position: absolute;
`),O("&::before",{backgroundColor:"var(--n-bar-color)"})])]),Li=Object.assign(Object.assign({},ye.props),{type:{type:String,default:"default"},prefix:String,alignText:Boolean}),ul=e=>re({name:`H${e}`,props:Li,setup(t){const{mergedClsPrefixRef:r,inlineThemeDisabled:n}=Ne(t),o=ye("Typography","-h",gW,Oi,t,r),i=P(()=>{const{type:l}=t,{common:{cubicBezierEaseInOut:s},self:{headerFontWeight:d,headerTextColor:u,[Ce("headerPrefixWidth",e)]:f,[Ce("headerFontSize",e)]:h,[Ce("headerMargin",e)]:g,[Ce("headerBarWidth",e)]:v,[Ce("headerBarColor",l)]:b}}=o.value;return{"--n-bezier":s,"--n-font-size":h,"--n-margin":g,"--n-bar-color":b,"--n-bar-width":v,"--n-font-weight":d,"--n-text-color":u,"--n-prefix-width":f}}),a=n?Qe(`h${e}`,P(()=>t.type[0]),i,t):void 0;return{mergedClsPrefix:r,cssVars:n?void 0:i,themeClass:a==null?void 0:a.themeClass,onRender:a==null?void 0:a.onRender}},render(){var t;const{prefix:r,alignText:n,mergedClsPrefix:o,cssVars:i,$slots:a}=this;return(t=this.onRender)===null||t===void 0||t.call(this),c(`h${e}`,{class:[`${o}-h`,`${o}-h${e}`,this.themeClass,{[`${o}-h--prefix-bar`]:r,[`${o}-h--align-text`]:n}],style:i},a)}}),pW=ul("1"),mW=ul("2"),bW=ul("3"),xW=ul("4"),yW=ul("5"),CW=ul("6"),wW=w("a",`
cursor: pointer;
transition:
color .3s var(--n-bezier),
text-decoration-color .3s var(--n-bezier);
text-decoration-color: var(--n-text-color);
color: var(--n-text-color);
`),DR=Object.assign({},ye.props),SW=re({name:"A",props:DR,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:r}=Ne(e),n=ye("Typography","-a",wW,Oi,e,t),o=P(()=>{const{common:{cubicBezierEaseInOut:a},self:{aTextColor:l}}=n.value;return{"--n-text-color":l,"--n-bezier":a}}),i=r?Qe("a",void 0,o,e):void 0;return{mergedClsPrefix:t,cssVars:r?void 0:o,themeClass:i==null?void 0:i.themeClass,onRender:i==null?void 0:i.onRender}},render(){var e;return(e=this.onRender)===null||e===void 0||e.call(this),c("a",{class:[`${this.mergedClsPrefix}-a`,this.themeClass],style:this.cssVars},this.$slots)}}),kW=w("p",`
box-sizing: border-box;
transition: color .3s var(--n-bezier);
margin: var(--n-margin);
font-size: var(--n-font-size);
line-height: var(--n-line-height);
color: var(--n-text-color);
`,[O("&:first-child","margin-top: 0;"),O("&:last-child","margin-bottom: 0;")]),ER=Object.assign(Object.assign({},ye.props),{depth:[String,Number]}),RW=re({name:"P",props:ER,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:r}=Ne(e),n=ye("Typography","-p",kW,Oi,e,t),o=P(()=>{const{depth:a}=e,l=a||"1",{common:{cubicBezierEaseInOut:s},self:{pFontSize:d,pLineHeight:u,pMargin:f,pTextColor:h,[`pTextColor${l}Depth`]:g}}=n.value;return{"--n-bezier":s,"--n-font-size":d,"--n-line-height":u,"--n-margin":f,"--n-text-color":a===void 0?h:g}}),i=r?Qe("p",P(()=>`${e.depth||""}`),o,e):void 0;return{mergedClsPrefix:t,cssVars:r?void 0:o,themeClass:i==null?void 0:i.themeClass,onRender:i==null?void 0:i.onRender}},render(){var e;return(e=this.onRender)===null||e===void 0||e.call(this),c("p",{class:[`${this.mergedClsPrefix}-p`,this.themeClass],style:this.cssVars},this.$slots)}}),PW=w("blockquote",`
font-size: var(--n-font-size);
line-height: var(--n-line-height);
margin: 0;
margin-top: 12px;
margin-bottom: 12px;
box-sizing: border-box;
padding-left: 12px;
border-left: 4px solid var(--n-prefix-color);
color: var(--n-text-color);
transition:
color .3s var(--n-bezier),
border-color .3s var(--n-bezier);
`,[O("&:first-child",{marginTop:0}),O("&:last-child",{marginBottom:0}),I("align-text",{marginLeft:"-16px"})]),AR=Object.assign(Object.assign({},ye.props),{alignText:Boolean}),TW=re({name:"Blockquote",props:AR,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:r}=Ne(e),n=ye("Typography","-blockquote",PW,Oi,e,t),o=P(()=>{const{common:{cubicBezierEaseInOut:a},self:{blockquoteTextColor:l,blockquotePrefixColor:s,blockquoteLineHeight:d,blockquoteFontSize:u}}=n.value;return{"--n-bezier":a,"--n-font-size":u,"--n-line-height":d,"--n-prefix-color":s,"--n-text-color":l}}),i=r?Qe("blockquote",void 0,o,e):void 0;return{mergedClsPrefix:t,cssVars:r?void 0:o,themeClass:i==null?void 0:i.themeClass,onRender:i==null?void 0:i.onRender}},render(){var e;const{mergedClsPrefix:t}=this;return(e=this.onRender)===null||e===void 0||e.call(this),c("blockquote",{class:[`${t}-blockquote`,this.themeClass,this.alignText&&`${t}-blockquote--align-text`],style:this.cssVars},this.$slots)}}),$W=w("hr",`
margin: 12px 0;
transition: border-color .3s var(--n-bezier);
border-left: none;
border-right: none;
border-bottom: none;
border-top: 1px solid var(--n-color);
`),zW=re({name:"Hr",props:Object.assign({},ye.props),setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:r}=Ne(e),n=ye("Typography","-hr",$W,Oi,e,t),o=P(()=>{const{common:{cubicBezierEaseInOut:a},self:{hrColor:l}}=n.value;return{"--n-bezier":a,"--n-color":l}}),i=r?Qe("hr",void 0,o,e):void 0;return{mergedClsPrefix:t,cssVars:r?void 0:o,themeClass:i==null?void 0:i.themeClass,onRender:i==null?void 0:i.onRender}},render(){var e;return(e=this.onRender)===null||e===void 0||e.call(this),c("hr",{class:[`${this.mergedClsPrefix}-hr`,this.themeClass],style:this.cssVars})}}),b0=O("li",{transition:"color .3s var(--n-bezier)",lineHeight:"var(--n-line-height)",margin:"var(--n-li-margin)",marginBottom:0,color:"var(--n-text-color)"}),x0=[O("&:first-child",`
margin-top: 0;
`),O("&:last-child",`
margin-bottom: 0;
`)],BR=O([w("ol",{fontSize:"var(--n-font-size)",padding:"var(--n-ol-padding)"},[I("align-text",{paddingLeft:0}),b0,x0]),w("ul",{fontSize:"var(--n-font-size)",padding:"var(--n-ul-padding)"},[I("align-text",{paddingLeft:0}),b0,x0])]),NR=Object.assign(Object.assign({},ye.props),{alignText:Boolean}),OW=re({name:"Ul",props:NR,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:r}=Ne(e),n=ye("Typography","-xl",BR,Oi,e,t),o=P(()=>{const{common:{cubicBezierEaseInOut:a},self:{olPadding:l,ulPadding:s,liMargin:d,liTextColor:u,liLineHeight:f,liFontSize:h}}=n.value;return{"--n-bezier":a,"--n-font-size":h,"--n-line-height":f,"--n-text-color":u,"--n-li-margin":d,"--n-ol-padding":l,"--n-ul-padding":s}}),i=r?Qe("ul",void 0,o,e):void 0;return{mergedClsPrefix:t,cssVars:r?void 0:o,themeClass:i==null?void 0:i.themeClass,onRender:i==null?void 0:i.onRender}},render(){var e;const{mergedClsPrefix:t}=this;return(e=this.onRender)===null||e===void 0||e.call(this),c("ul",{class:[`${t}-ul`,this.themeClass,this.alignText&&`${t}-ul--align-text`],style:this.cssVars},this.$slots)}}),LR=Object.assign(Object.assign({},ye.props),{alignText:Boolean}),_W=re({name:"Ol",props:LR,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:r}=Ne(e),n=ye("Typography","-xl",BR,Oi,e,t),o=P(()=>{const{common:{cubicBezierEaseInOut:a},self:{olPadding:l,ulPadding:s,liMargin:d,liTextColor:u,liLineHeight:f,liFontSize:h}}=n.value;return{"--n-bezier":a,"--n-font-size":h,"--n-line-height":f,"--n-text-color":u,"--n-li-margin":d,"--n-ol-padding":l,"--n-ul-padding":s}}),i=r?Qe("ol",void 0,o,e):void 0;return{mergedClsPrefix:t,cssVars:r?void 0:o,themeClass:i==null?void 0:i.themeClass,onRender:i==null?void 0:i.onRender}},render(){var e;const{mergedClsPrefix:t}=this;return(e=this.onRender)===null||e===void 0||e.call(this),c("ol",{class:[`${t}-ol`,this.themeClass,this.alignText&&`${t}-ol--align-text`],style:this.cssVars},this.$slots)}}),MW=re({name:"Li",render(){return c("li",null,this.$slots)}}),IW=w("text",`
transition: color .3s var(--n-bezier);
color: var(--n-text-color);
`,[I("strong",`
font-weight: var(--n-font-weight-strong);
`),I("italic",{fontStyle:"italic"}),I("underline",{textDecoration:"underline"}),I("code",`
line-height: 1.4;
display: inline-block;
font-family: var(--n-font-famliy-mono);
transition:
color .3s var(--n-bezier),
border-color .3s var(--n-bezier),
background-color .3s var(--n-bezier);
box-sizing: border-box;
padding: .05em .35em 0 .35em;
border-radius: var(--n-code-border-radius);
font-size: .9em;
color: var(--n-code-text-color);
background-color: var(--n-code-color);
border: var(--n-code-border);
`)]),HR=Object.assign(Object.assign({},ye.props),{code:Boolean,type:{type:String,default:"default"},delete:Boolean,strong:Boolean,italic:Boolean,underline:Boolean,depth:[String,Number],tag:String,as:{type:String,validator:()=>!0,default:void 0}}),FW=re({name:"Text",props:HR,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:r}=Ne(e),n=ye("Typography","-text",IW,Oi,e,t),o=P(()=>{const{depth:a,type:l}=e,s=l==="default"?a===void 0?"textColor":`textColor${a}Depth`:Ce("textColor",l),{common:{fontWeightStrong:d,fontFamilyMono:u,cubicBezierEaseInOut:f},self:{codeTextColor:h,codeBorderRadius:g,codeColor:v,codeBorder:b,[s]:m}}=n.value;return{"--n-bezier":f,"--n-text-color":m,"--n-font-weight-strong":d,"--n-font-famliy-mono":u,"--n-code-border-radius":g,"--n-code-text-color":h,"--n-code-color":v,"--n-code-border":b}}),i=r?Qe("text",P(()=>`${e.type[0]}${e.depth||""}`),o,e):void 0;return{mergedClsPrefix:t,compitableTag:bi(e,["as","tag"]),cssVars:r?void 0:o,themeClass:i==null?void 0:i.themeClass,onRender:i==null?void 0:i.onRender}},render(){var e,t,r;const{mergedClsPrefix:n}=this;(e=this.onRender)===null||e===void 0||e.call(this);const o=[`${n}-text`,this.themeClass,{[`${n}-text--code`]:this.code,[`${n}-text--delete`]:this.delete,[`${n}-text--strong`]:this.strong,[`${n}-text--italic`]:this.italic,[`${n}-text--underline`]:this.underline}],i=(r=(t=this.$slots).default)===null||r===void 0?void 0:r.call(t);return this.code?c("code",{class:o,style:this.cssVars},this.delete?c("del",null,i):i):this.delete?c("del",{class:o,style:this.cssVars},i):c(this.compitableTag||"span",{class:o,style:this.cssVars},i)}}),fl="n-upload",jR="__UPLOAD_DRAGGER__",VR=re({name:"UploadDragger",[jR]:!0,setup(e,{slots:t}){const r=De(fl,null);return r||_r("upload-dragger","`n-upload-dragger` must be placed inside `n-upload`."),()=>{const{mergedClsPrefixRef:{value:n},mergedDisabledRef:{value:o},maxReachedRef:{value:i}}=r;return c("div",{class:[`${n}-upload-dragger`,(o||i)&&`${n}-upload-dragger--disabled`]},t)}}});var Vh=function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function l(u){try{d(n.next(u))}catch(f){a(f)}}function s(u){try{d(n.throw(u))}catch(f){a(f)}}function d(u){u.done?i(u.value):o(u.value).then(l,s)}d((n=n.apply(e,t||[])).next())})};const UR=e=>e.includes("image/"),y0=(e="")=>{const t=e.split("/"),n=t[t.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(n)||[""])[0]},C0=/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico)$/i,WR=e=>{if(e.type)return UR(e.type);const t=y0(e.name||"");if(C0.test(t))return!0;const r=e.thumbnailUrl||e.url||"",n=y0(r);return!!(/^data:image\//.test(r)||C0.test(n))};function DW(e){return Vh(this,void 0,void 0,function*(){return yield new Promise(t=>{if(!e.type||!UR(e.type)){t("");return}t(window.URL.createObjectURL(e))})})}const EW=dn&&window.FileReader&&window.File;function AW(e){return e.isDirectory}function BW(e){return e.isFile}function NW(e,t){return Vh(this,void 0,void 0,function*(){const r=[];function n(o){return Vh(this,void 0,void 0,function*(){for(const i of o)if(i){if(t&&AW(i)){const a=i.createReader();try{const l=yield new Promise((s,d)=>{a.readEntries(s,d)});yield n(l)}catch{}}else if(BW(i))try{const a=yield new Promise((l,s)=>{i.file(l,s)});r.push({file:a,entry:i,source:"dnd"})}catch{}}})}return yield n(e),r})}function ls(e){const{id:t,name:r,percentage:n,status:o,url:i,file:a,thumbnailUrl:l,type:s,fullPath:d,batchId:u}=e;return{id:t,name:r,percentage:n??null,status:o,url:i??null,file:a??null,thumbnailUrl:l??null,type:s??null,fullPath:d??null,batchId:u??null}}function LW(e,t,r){return e=e.toLowerCase(),t=t.toLocaleLowerCase(),r=r.toLocaleLowerCase(),r.split(",").map(o=>o.trim()).filter(Boolean).some(o=>{if(o.startsWith(".")){if(e.endsWith(o))return!0}else if(o.includes("/")){const[i,a]=t.split("/"),[l,s]=o.split("/");if((l==="*"||i&&l&&l===i)&&(s==="*"||a&&s&&s===a))return!0}else return!0;return!1})}const Ng=re({name:"UploadTrigger",props:{abstract:Boolean},setup(e,{slots:t}){const r=De(fl,null);r||_r("upload-trigger","`n-upload-trigger` mus
display: block;
`)]),I("drag-over",[w("upload-dragger",`
border: var(--n-dragger-border-hover);
`)])]),w("upload-dragger",`
cursor: pointer;
box-sizing: border-box;
width: 100%;
text-align: center;
border-radius: var(--n-border-radius);
padding: 24px;
opacity: 1;
transition:
opacity .3s var(--n-bezier),
border-color .3s var(--n-bezier),
background-color .3s var(--n-bezier);
background-color: var(--n-dragger-color);
border: var(--n-dragger-border);
`,[O("&:hover",`
border: var(--n-dragger-border-hover);
`),I("disabled",`
cursor: not-allowed;
`)]),w("upload-trigger",`
display: inline-block;
box-sizing: border-box;
opacity: 1;
transition: opacity .3s var(--n-bezier);
`,[O("+",[w("upload-file-list","margin-top: 8px;")]),I("disabled",`
opacity: var(--n-item-disabled-opacity);
cursor: not-allowed;
`),I("image-card",`
width: 96px;
height: 96px;
`,[w("base-icon",`
font-size: 24px;
`),w("upload-dragger",`
padding: 0;
height: 100%;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
`)])]),w("upload-file-list",`
line-height: var(--n-line-height);
opacity: 1;
transition: opacity .3s var(--n-bezier);
`,[O("a, img","outline: none;"),I("disabled",`
opacity: var(--n-item-disabled-opacity);
cursor: not-allowed;
`,[w("upload-file","cursor: not-allowed;")]),I("grid",`
display: grid;
grid-template-columns: repeat(auto-fill, 96px);
grid-gap: 8px;
margin-top: 0;
`),w("upload-file",`
display: block;
box-sizing: border-box;
cursor: default;
padding: 0px 12px 0 6px;
transition: background-color .3s var(--n-bezier);
border-radius: var(--n-border-radius);
`,[Ao(),w("progress",[Ao({foldPadding:!0})]),O("&:hover",`
background-color: var(--n-item-color-hover);
`,[w("upload-file-info",[M("action",`
opacity: 1;
`)])]),I("image-type",`
border-radius: var(--n-border-radius);
text-decoration: underline;
text-decoration-color: #0000;
`,[w("upload-file-info",`
padding-top: 0px;
padding-bottom: 0px;
width: 100%;
height: 100%;
display: flex;
justify-content: space-between;
align-items: center;
padding: 6px 0;
`,[w("progress",`
padding: 2px 0;
margin-bottom: 0;
`),M("name",`
padding: 0 8px;
`),M("thumbnail",`
width: 32px;
height: 32px;
font-size: 28px;
display: flex;
justify-content: center;
align-items: center;
`,[O("img",`
width: 100%;
`)])])]),I("text-type",[w("progress",`
box-sizing: border-box;
padding-bottom: 6px;
margin-bottom: 6px;
`)]),I("image-card-type",`
position: relative;
width: 96px;
height: 96px;
border: var(--n-item-border-image-card);
border-radius: var(--n-border-radius);
padding: 0;
display: flex;
align-items: center;
justify-content: center;
transition: border-color .3s var(--n-bezier), background-color .3s var(--n-bezier);
border-radius: var(--n-border-radius);
overflow: hidden;
`,[w("progress",`
position: absolute;
left: 8px;
bottom: 8px;
right: 8px;
width: unset;
`),w("upload-file-info",`
padding: 0;
width: 100%;
height: 100%;
`,[M("thumbnail",`
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 36px;
`,[O("img",`
width: 100%;
`)])]),O("&::before",`
position: absolute;
z-index: 1;
left: 0;
right: 0;
top: 0;
bottom: 0;
border-radius: inherit;
opacity: 0;
transition: opacity .2s var(--n-bezier);
content: "";
`),O("&:hover",[O("&::before","opacity: 1;"),w("upload-file-info",[M("thumbnail","opacity: .12;")])])]),I("error-status",[O("&:hover",`
background-color: var(--n-item-color-hover-error);
`),w("upload-file-info",[M("name","color: var(--n-item-text-color-error);"),M("thumbnail","color: var(--n-item-text-color-error);")]),I("image-card-type",`
border: var(--n-item-border-image-card-error);
`)]),I("with-url",`
cursor: pointer;
`,[w("upload-file-info",[M("name",`
color: var(--n-item-text-color-success);
text-decoration-color: var(--n-item-text-color-success);
`,[O("a",`
text-decoration: underline;
`)])])]),w("upload-file-info",`
position: relative;
padding-top: 6px;
padding-bottom: 6px;
display: flex;
flex-wrap: nowrap;
`,[M("thumbnail",`
font-size: 18px;
opacity: 1;
transition: opacity .2s var(--n-bezier);
color: var(--n-item-icon-color);
`,[w("base-icon",`
margin-right: 2px;
vertical-align: middle;
transition: color .3s var(--n-bezier);
`)]),M("action",`
padding-top: inherit;
padding-bottom: inherit;
position: absolute;
right: 0;
top: 0;
bottom: 0;
width: 80px;
display: flex;
align-items: center;
transition: opacity .2s var(--n-bezier);
justify-content: flex-end;
opacity: 0;
`,[w("button",[O("&:not(:last-child)",{marginRight:"4px"}),w("base-icon",[O("svg",[qr()])])]),I("image-type",`
position: relative;
max-width: 80px;
width: auto;
`),I("image-card-type",`
z-index: 2;
position: absolute;
width: 100%;
height: 100%;
left: 0;
right: 0;
bottom: 0;
top: 0;
display: flex;
justify-content: center;
align-items: center;
`)]),M("name",`
color: var(--n-item-text-color);
flex: 1;
display: flex;
justify-content: center;
text-overflow: ellipsis;
overflow: hidden;
flex-direction: column;
text-decoration-color: #0000;
font-size: var(--n-font-size);
transition:
color .3s var(--n-bezier),
text-decoration-color .3s var(--n-bezier);
`,[O("a",`
color: inherit;
text-decoration: underline;
`)])])])]),w("upload-file-input",`
display: none;
width: 0;
height: 0;
opacity: 0;
`)]);var w0=function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function l(u){try{d(n.next(u))}catch(f){a(f)}}function s(u){try{d(n.throw(u))}catch(f){a(f)}}function d(u){u.done?i(u.value):o(u.value).then(l,s)}d((n=n.apply(e,t||[])).next())})};function qW(e,t,r){const{doChange:n,xhrMap:o}=e;let i=0;function a(s){var d;let u=Object.assign({},t,{status:"error",percentage:i});o.delete(t.id),u=ls(((d=e.onError)===null||d===void 0?void 0:d.call(e,{file:u,event:s}))||u),n(u,s)}function l(s){var d;if(e.isErrorState){if(e.isErrorState(r)){a(s);return}}else if(r.status<200||r.status>=300){a(s);return}let u=Object.assign({},t,{status:"finished",percentage:i});o.delete(t.id),u=ls(((d=e.onFinish)===null||d===void 0?void 0:d.call(e,{file:u,event:s}))||u),n(u,s)}return{handleXHRLoad:l,handleXHRError:a,handleXHRAbort(s){const d=Object.assign({},t,{status:"removed",file:null,percentage:i});o.delete(t.id),n(d,s)},handleXHRProgress(s){const d=Object.assign({},t,{status:"uploading"});if(s.lengthComputable){const u=Math.ceil(s.loaded/s.total*100);d.percentage=u,i=u}n(d,s)}}}function YW(e){const{inst:t,file:r,data:n,headers:o,withCredentials:i,action:a,customRequest:l}=e,{doChange:s}=e.inst;let d=0;l({file:r,data:n,headers:o,withCredentials:i,action:a,onProgress(u){const f=Object.assign({},r,{status:"uploading"}),h=u.percent;f.percentage=h,d=h,s(f)},onFinish(){var u;let f=Object.assign({},r,{status:"finished",percentage:d});f=ls(((u=t.onFinish)===null||u===void 0?void 0:u.call(t,{file:f}))||f),s(f)},onError(){var u;let f=Object.assign({},r,{status:"error",percentage:d});f=ls(((u=t.onError)===null||u===void 0?void 0:u.call(t,{file:f}))||f),s(f)}})}function GW(e,t,r){const n=qW(e,t,r);r.onabort=n.handleXHRAbort,r.onerror=n.handleXHRError,r.onload=n.handleXHRLoad,r.upload&&(r.upload.onprogress=n.handleXHRProgress)}function qR(e,t){return typeof e=="function"?e({file:t}):e||{}}function XW(e,t,r){const n=qR(t,r);n&&Object.keys(n).forEach(o=>{e.setRequestHeader(o,n[o])})}function ZW(e,t,r){const n=qR(t,r);n&&Object.keys(n).forEach(o=>{e.append(o,n[o])})}function QW(e,t,r,{method:n,action:o,withCredentials:i,responseType:a,headers:l,data:s}){const d=new XMLHttpRequest;d.responseType=a,e.xhrMap.set(r.id,d),d.withCredentials=i;const u=new FormData;if(ZW(u,s,r),r.file!==null&&u.append(t,r.file),GW(e,r,d),o!==void 0){d.open(n.toUpperCase(),o),XW(d,l,r),d.send(u);const f=Object.assign({},r,{status:"uploading"});e.doChange(f)}}const YR=Object.assign(Object.assign({},ye.props),{name:{type:String,default:"file"},accept:String,action:String,customRequest:Function,directory:Boolean,directoryDnd:{type:Boolean,default:void 0},method:{type:String,default:"POST"},multiple:Boolean,showFileList:{type:Boolean,default:!0},data:[Object,Function],headers:[Object,Function],withCredentials:Boolean,responseType:{type:String,default:""},disabled:{type:Boolean,default:void 0},onChange:Function,onRemove:Function,onFinish:Function,onError:Function,onBeforeUpload:Function,isErrorState:Function,onDownload:Function,defaultUpload:{type:Boolean,default:!0},fileList:Array,"onUpdate:fileList":[Function,Array],onUpdateFileList:[Function,Array],fileListClass:String,fileListStyle:[String,Object],defaultFileList:{type:Array,default:()=>[]},showCancelButton:{type:Boolean,default:!0},showRemoveButton:{type:Boolean,default:!0},showDownloadButton:Boolean,showRetryButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},listType:{type:String,default:"text"},onPreview:Function,shouldUseThumbnailUrl:{type:Function,default:e=>EW?WR(e):!1},createThumbnailUrl:Function,abstract:Boolean,max:Number,showTrigger:{type:Boolean,default:!0},imageGroupProps:Object,inputProps:Object,triggerClass:String,triggerStyle:[String,Object],renderIcon:Function}),JW=re({name:"Upload",props:YR,setup(e){e.abstract&&e.listType==="image-card"&&_r("upload","when the list-type is image-card, abstract is not supported.");const{mergedClsPrefixRef:t,inlineThemeDisabled:r}=Ne(e),n=ye("Upload","-upload",KW,nj,e,t),o=Rr(e),i=P(()=>{const
position: relative;
`,[xt("selectable",`
user-select: none;
-webkit-user-select: none;
`),I("global-rotate",`
overflow: hidden;
`),I("fullscreen",`
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
position: fixed;
`)]),w("watermark",`
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
background-repeat: repeat;
`,[I("fullscreen",`
position: fixed;
`),I("global-rotate",`
position: absolute;
height: max(284vh, 284vw);
width: max(284vh, 284vw);
`)])]);function rK(e){if(!e)return 1;const t=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/t}const XR=Object.assign(Object.assign({},ye.props),{debug:Boolean,cross:Boolean,fullscreen:Boolean,width:{type:Number,default:32},height:{type:Number,default:32},zIndex:{type:Number,default:10},xGap:{type:Number,default:0},yGap:{type:Number,default:0},yOffset:{type:Number,default:0},xOffset:{type:Number,default:0},rotate:{type:Number,default:0},textAlign:{type:String,default:"left"},image:String,imageOpacity:{type:Number,default:1},imageHeight:Number,imageWidth:Number,content:String,selectable:{type:Boolean,default:!0},fontSize:{type:Number,default:14},fontFamily:String,fontStyle:{type:String,default:"normal"},fontVariant:{type:String,default:""},fontWeight:{type:Number,default:400},fontColor:{type:String,default:"rgba(128, 128, 128, .3)"},fontStretch:{type:String,default:""},lineHeight:{type:Number,default:14},globalRotate:{type:Number,default:0}}),nK=re({name:"Watermark",props:XR,setup(e,{slots:t}){const{mergedClsPrefixRef:r}=Ne(e),n=ye("Watermark","-watermark",tK,aj,e,r),o=D(""),i=dn?document.createElement("canvas"):null,a=i?i.getContext("2d"):null,l=D(!1);return Cc(()=>l.value=!0),Et(()=>{if(!i)return;l.value;const s=rK(a),{xGap:d,yGap:u,width:f,height:h,yOffset:g,xOffset:v,rotate:b,image:m,content:p,fontColor:x,fontStyle:S,fontVariant:y,fontStretch:C,fontWeight:k,fontFamily:R,fontSize:$,lineHeight:T,debug:z}=e,F=(d+f)*s,_=(u+h)*s,N=v*s,j=g*s;if(i.width=F,i.height=_,a){a.translate(0,0);const H=f*s,Y=h*s;if(z&&(a.strokeStyle="grey",a.strokeRect(0,0,H,Y)),a.rotate(b*(Math.PI/180)),m){const X=new Image;X.crossOrigin="anonymous",X.referrerPolicy="no-referrer",X.src=m,X.onload=()=>{a.globalAlpha=e.imageOpacity;const{imageWidth:le,imageHeight:ke}=e;a.drawImage(X,N,j,(e.imageWidth||(ke?X.width*ke/X.height:X.width))*s,(e.imageHeight||(le?X.height*le/X.width:X.height))*s),o.value=i.toDataURL()}}else if(p){z&&(a.strokeStyle="green",a.strokeRect(0,0,H,Y)),a.font=`${S} ${y} ${k} ${C} ${$*s}px/${T*s}px ${R||n.value.self.fontFamily}`,a.fillStyle=x;let X=0;const{textAlign:le}=e;p.split(`
`).map(ke=>{const be=a.measureText(ke).width;return X=Math.max(X,be),{width:be,line:ke}}).forEach(({line:ke,width:be},Q)=>{const L=le==="left"?0:le==="center"?(X-be)/2:X-be;a.fillText(ke,N+L,j+T*s*(Q+1))}),o.value=i.toDataURL()}else p||(a.clearRect(0,0,i.width,i.height),o.value=i.toDataURL())}else h3("watermark","Canvas is not supported in the browser.")}),()=>{var s;const{globalRotate:d,fullscreen:u,zIndex:f}=e,h=r.value,g=d!==0&&u,v="max(142vh, 142vw)",b=c("div",{class:[`${h}-watermark`,d!==0&&`${h}-watermark--global-rotate`,u&&`${h}-watermark--fullscreen`],style:{transform:d?`translateX(-50%) translateY(-50%) rotate(${d}deg)`:void 0,zIndex:g?void 0:f,backgroundSize:`${e.xGap+e.width}px`,backgroundPosition:d===0?e.cross?`${e.width/2}px ${e.height/2}px, 0 0`:"":e.cross?`calc(${v} + ${e.width/2}px) calc(${v} + ${e.height/2}px), ${v} ${v}`:v,backgroundImage:e.cross?`url(${o.value}), url(${o.value})`:`url(${o.value})`}});return e.fullscreen&&!d?b:c("div",{class:[`${h}-watermark-container`,d!==0&&`${h}-watermark-container--global-rotate`,u&&`${h}-watermark-container--fullscreen`,e.selectable&&`${h}-watermark-container--selectable`],style:{zIndex:g?f:void 0}},(s=t.default)===null||s===void 0?void 0:s.call(t),b)}}}),oK=re({name:"InjectionExtractor",props:{onSetup:Function},setup(e,{slots:t}){var r;return(r=e.onSetup)===null||r===void 0||r.call(e),()=>{var n;return(n=t.default)===null||n===void 0?void 0:n.call(t)}}}),iK={message:Vk,notification:Qk,loadingBar:$k,dialog:QS,modal:Yk};function aK({providersAndProps:e,configProviderProps:t}){let n=Mx(()=>c(Cw,ao(t),{default:()=>e.map(({type:l,Provider:s,props:d})=>c(s,ao(d),{default:()=>c(oK,{onSetup:()=>o[l]=iK[l]()})}))}));const o={app:n};let i;return dn&&(i=document.createElement("div"),document.body.appendChild(i),n.mount(i)),Object.assign({unmount:()=>{var l;if(n===null||i===null){Qr("discrete","unmount call no need because discrete app has been unmounted");return}n.unmount(),(l=i.parentNode)===null||l===void 0||l.removeChild(i),i=null,n=null}},o)}function lK(e,{configProviderProps:t,messageProviderProps:r,dialogProviderProps:n,notificationProviderProps:o,loadingBarProviderProps:i,modalProviderProps:a}={}){const l=[];return e.forEach(d=>{switch(d){case"message":l.push({type:d,Provider:jk,props:r});break;case"notification":l.push({type:d,Provider:Zk,props:o});break;case"dialog":l.push({type:d,Provider:ZS,props:n});break;case"loadingBar":l.push({type:d,Provider:Tk,props:i});break;case"modal":l.push({type:d,Provider:qk,props:a})}}),aK({providersAndProps:l,configProviderProps:t})}const ZR={value:String,katex:Object,katexOptions:Object},sK=re({name:"Equation",props:ZR,setup(e){const t=De(In),r=P(()=>{var n;const o=((n=e.katex||(t==null?void 0:t.mergedKatexRef.value))===null||n===void 0?void 0:n.renderToString(e.value||"",Object.assign({throwOnError:!1},e.katexOptions)))||"no katex provided",i=o.match(/^<([a-z]+)[^>]+class="([^"]+)"[^>]*>/),a=(i==null?void 0:i[1])||"span",l=i==null?void 0:i[2],s=o.replace(/^<[a-z]+[^>]*>/,"").replace(/<\/[a-z]+>$/,"");return{wrapperTag:a,innerHtml:s,wrapperClass:l}});return()=>{const{innerHtml:n,wrapperClass:o,wrapperTag:i}=r.value;return c(i,{class:o,innerHTML:n})}}}),S0=Object.freeze(Object.defineProperty({__proto__:null,NA:SW,NAffix:R1,NAlert:pE,NAnchor:RE,NAnchorLink:CE,NAutoComplete:HE,NAvatar:Vf,NAvatarGroup:qE,NBackTop:JE,NBadge:oA,NBlockquote:TW,NBreadcrumb:dA,NBreadcrumbItem:uA,NButton:Dt,NButtonGroup:tg,NCalendar:PA,NCard:QC,NCarousel:xB,NCarouselItem:tw,NCascader:MB,NCheckbox:qo,NCheckboxGroup:lw,NCode:hw,NCol:R2,NCollapse:BB,NCollapseItem:LB,NCollapseTransition:UB,NColorPicker:JA,NConfigProvider:Cw,NCountdown:WB,NDataTable:lN,NDatePicker:DL,NDescriptions:HL,NDescriptionsItem:jL,NDialog:wg,NDialogProvider:ZS,NDivider:n7,NDrawer:y7,NDrawerContent:C7,NDropdown:vg,NDynamicInput:$7,NDynamicTags:F7,NEl:Eb,NElement:Eb,NEllipsis:Dc,NEmpty:Do,NEquation:sK,NFlex:L7,NFloatButton:gj,NFloatButtonGroup:cj,NForm:W7,NFormItem:Tg,NFormItemCol:P2,NFormItemGi:Kb,NFormItemGridItem:Kb,NFormItemRow:EH,NGi:Bh,NGlobalStyle:pj,NGradientText:bj,NGrid:yj,NGridIte
*,*:before,*:after{box-sizing:border-box;margin:0}h1,h2,h3,h4,h5,h6,p{margin:0;padding:0;font-weight:400}body{overflow-x:hidden}.layout__container{position:absolute;inset:0 1rem 0 auto;margin:auto;width:20rem;height:30vh}.layout__container .header__layout{height:3rem;padding:.5rem}.layout__container .content__layout{top:3rem;bottom:3rem;padding:.5rem 0}.layout__container .content__layout .content__container{padding:0 1rem}.layout__container .content__layout .content__container .n-thing-main__content{margin-top:0}.layout__container .content__layout .content__container .n-list-item{padding:0 .5rem}.layout__container .footer__layout{height:3rem;padding:.5rem}.slide-fade-enter-active[data-v-b8fa0db1]{transition:all .3s ease-out}.slide-fade-leave-active[data-v-b8fa0db1]{transition:all .3s cubic-bezier(1,.5,.8,1)}.slide-fade-enter-from[data-v-b8fa0db1],.slide-fade-leave-to[data-v-b8fa0db1]{transform:translate(100%);opacity:0}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" href="./favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>T1GER WORKFLOW</title>
<script type="module" crossorigin src="./assets/index-BFWVRtXt.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-DD8EL8nh.css">
</head>
<body>
<div id="app"></div>
</body>
</html>