diff --git a/server-data/resources/[bpt_addons]/bpt_policejob/client/main.lua b/server-data/resources/[bpt_addons]/bpt_policejob/client/main.lua index 9fcc1af94..14251c797 100644 --- a/server-data/resources/[bpt_addons]/bpt_policejob/client/main.lua +++ b/server-data/resources/[bpt_addons]/bpt_policejob/client/main.lua @@ -1,3 +1,5 @@ +---@diagnostic disable: undefined-global + local CurrentActionData, handcuffTimer, dragStatus, blipsCops, currentTask = {}, {}, {}, {}, {} local HasAlreadyEnteredMarker, isDead, isHandcuffed, hasAlreadyJoined, playerInService = false, false, false, false, false local LastStation, LastPart, LastPartNum, LastEntity, CurrentAction, CurrentActionMsg diff --git a/server-data/resources/[esx]/esx_menu_default/client/main.lua b/server-data/resources/[esx]/esx_menu_default/client/main.lua index 873b5a9e0..76cef8d35 100644 --- a/server-data/resources/[esx]/esx_menu_default/client/main.lua +++ b/server-data/resources/[esx]/esx_menu_default/client/main.lua @@ -1,3 +1,5 @@ +---@diagnostic disable: undefined-global + local GUI, MenuType, OpenedMenus, CurrentNameSpace = {}, "default", 0, nil GUI.Time = 0 diff --git a/server-data/resources/[esx_addons]/esx-qalle-jail/client/client.lua b/server-data/resources/[esx_addons]/esx-qalle-jail/client/client.lua index b84a5c126..8e974dab6 100644 --- a/server-data/resources/[esx_addons]/esx-qalle-jail/client/client.lua +++ b/server-data/resources/[esx_addons]/esx-qalle-jail/client/client.lua @@ -367,7 +367,7 @@ function OpenJailMenu() }) end - ESX.UI.Menu.Open("default", GetCurrentResourceName(), "jailTranslateCapnjail_menu", { + ESX.UI.Menu.Open("default", GetCurrentResourceName(), "jail", TranslateCap("jail_menu"), { title = "Unjail Player", align = "center", elements = elements, diff --git a/server-data/resources/[esx_addons]/esx_scoreboard/client/main.lua b/server-data/resources/[esx_addons]/esx_scoreboard/client/main.lua index 922a1ec6e..98f655c3a 100644 --- a/server-data/resources/[esx_addons]/esx_scoreboard/client/main.lua +++ b/server-data/resources/[esx_addons]/esx_scoreboard/client/main.lua @@ -155,8 +155,6 @@ Citizen.CreateThread(function() if IsControlJustReleased(0, Keys["F10"]) and IsInputDisabled(0) then ToggleScoreBoard() Citizen.Wait(200) - - -- D-pad up on controllers works, too! elseif IsControlJustReleased(0, 172) and not IsInputDisabled(0) then ToggleScoreBoard() Citizen.Wait(200) diff --git a/server-data/resources/[esx_addons]/esx_scoreboard/server/main.lua b/server-data/resources/[esx_addons]/esx_scoreboard/server/main.lua index 8020c41a8..4e2ee8a68 100644 --- a/server-data/resources/[esx_addons]/esx_scoreboard/server/main.lua +++ b/server-data/resources/[esx_addons]/esx_scoreboard/server/main.lua @@ -3,150 +3,146 @@ local connectedPlayers = {} ESX = exports["es_extended"]:getSharedObject() ESX.RegisterServerCallback("esx_scoreboard:getConnectedPlayers", function(_, cb) - cb(connectedPlayers) + cb(connectedPlayers) end) AddEventHandler("esx:playerLoaded", function(_, xPlayer) - AddPlayerToScoreboard(xPlayer, true) + AddPlayerToScoreboard(xPlayer, true) end) AddEventHandler("esx:playerDropped", function(playerId) - connectedPlayers[playerId] = nil + connectedPlayers[playerId] = nil - TriggerClientEvent("esx_scoreboard:updateConnectedPlayers", -1, connectedPlayers) + TriggerClientEvent("esx_scoreboard:updateConnectedPlayers", -1, connectedPlayers) end) Citizen.CreateThread(function() - while true do - Citizen.Wait(5000) - UpdatePing() - end + while true do + Citizen.Wait(5000) + UpdatePing() + end end) AddEventHandler("onResourceStart", function(resource) - if resource == GetCurrentResourceName() then - Citizen.CreateThread(function() - Citizen.Wait(1000) - AddPlayersToScoreboard() - end) - end + if resource == GetCurrentResourceName() then + Citizen.CreateThread(function() + Citizen.Wait(1000) + AddPlayersToScoreboard() + end) + end end) function AddPlayerToScoreboard(xPlayer, update) - local playerId = xPlayer.source - - connectedPlayers[playerId] = {} - connectedPlayers[playerId].ping = GetPlayerPing(playerId) - connectedPlayers[playerId].id = playerId - connectedPlayers[playerId].name = GetPlayerName(playerId) - - if update then - TriggerClientEvent("esx_scoreboard:updateConnectedPlayers", -1, connectedPlayers) - end - - if xPlayer.permission_level == 0 then - Citizen.CreateThread(function() - Citizen.Wait(3000) - TriggerClientEvent("esx_scoreboard:toggleID", playerId, false) - end) - end + local playerId = xPlayer.source + + connectedPlayers[playerId] = {} + connectedPlayers[playerId].ping = GetPlayerPing(playerId) + connectedPlayers[playerId].id = playerId + connectedPlayers[playerId].name = GetPlayerName(playerId) + + if update then + TriggerClientEvent("esx_scoreboard:updateConnectedPlayers", -1, connectedPlayers) + end + + if xPlayer.permission_level == 0 then + Citizen.CreateThread(function() + Citizen.Wait(3000) + TriggerClientEvent("esx_scoreboard:toggleID", playerId, false) + end) + end end function AddPlayersToScoreboard() - local players = ESX.GetPlayers() + local players = ESX.GetPlayers() - for i = 1, #players, 1 do - local xPlayer = ESX.GetPlayerFromId(players[i]) - AddPlayerToScoreboard(xPlayer, false) - end + for i = 1, #players, 1 do + local xPlayer = ESX.GetPlayerFromId(players[i]) + AddPlayerToScoreboard(xPlayer, false) + end - TriggerClientEvent("esx_scoreboard:updateConnectedPlayers", -1, connectedPlayers) + TriggerClientEvent("esx_scoreboard:updateConnectedPlayers", -1, connectedPlayers) end function UpdatePing() - for k, v in pairs(connectedPlayers) do - v.ping = GetPlayerPing(k) - TriggerClientEvent("status:updatePing", k, v.ping) - end - TriggerClientEvent("esx_scoreboard:updatePing", -1, connectedPlayers) + for k, v in pairs(connectedPlayers) do + v.ping = GetPlayerPing(k) + TriggerClientEvent("status:updatePing", k, v.ping) + end + TriggerClientEvent("esx_scoreboard:updatePing", -1, connectedPlayers) end RegisterCommand("screfresh", function(source) - local xPlayer = ESX.GetPlayerFromId(source) + local xPlayer = ESX.GetPlayerFromId(source) - if xPlayer.getGroup() == "admin" or xPlayer.getGroup() == "admin" then - AddPlayersToScoreboard() - else - TriggerClientEvent("chatMessage", source, "[CONSOLE]", { 255, 0, 0 }, " ^0Shoma ^1Admin ^0nistid!") - end + if xPlayer.getGroup() == "admin" or xPlayer.getGroup() == "admin" then + AddPlayersToScoreboard() + else + TriggerClientEvent("chatMessage", source, "[CONSOLE]", { 255, 0, 0 }, " ^0Shoma ^1Admin ^0nistid!") + end end, false) RegisterCommand("sctoggle", function(source) - local xPlayer = ESX.GetPlayerFromId(source) + local xPlayer = ESX.GetPlayerFromId(source) - if xPlayer.getGroup() == "admin" or xPlayer.getGroup() == "admin" then - TriggerClientEvent("esx_scoreboard:toggleID", source) - else - TriggerClientEvent("chatMessage", source, "[CONSOLE]", { 255, 0, 0 }, " ^0Shoma ^1Admin ^0nistid!") - end + if xPlayer.getGroup() == "admin" or xPlayer.getGroup() == "admin" then + TriggerClientEvent("esx_scoreboard:toggleID", source) + else + TriggerClientEvent("chatMessage", source, "[CONSOLE]", { 255, 0, 0 }, " ^0Shoma ^1Admin ^0nistid!") + end end, false) -- Ping Kick -local limit = GetConvarInt("pingkick", 200) +local limit = GetConvarInt("pingkick", 600) local checkInterval = GetConvarInt("pingkick_interval", 5000) -local warningStr = GetConvar("pingkick_warning", "Your ping is too high. Fix it. (%dms, Warning: %d/3)") -local reasonStr = GetConvar("pingkick_reason", "You were kicked for having a high ping. (%dms)") +local warningStr = GetConvar("pingkick_warning", "Il tuo ping è troppo alto. (%dms, Warning: %d/3)") +local reasonStr = GetConvar("pingkick_reason", "Sei stato espulso perché avevi un ping alto. (%dms)") local pingHits = {} print("Limit set to " .. limit) local function CheckPing(player) - CreateThread(function() - if GetPlayerPed(player) == 0 then - return - end -- Don't do anything if player doesn't have a ped yet - - local name = GetPlayerName(player) - local ping = GetPlayerPing(player) - - if pingHits[player] == nil then - pingHits[player] = 0 - end - - if ping >= limit then - pingHits[player] = pingHits[player] + 1 - - print(name .. " was warned. (Ping: " .. ping .. "ms, Warning: " .. pingHits[player] .. "/3)") - TriggerClientEvent( - "chat:addMessage", - player, - { args = { "Ping", warningStr:format(ping, pingHits[player]) } } - ) - elseif pingHits[player] > 0 then - pingHits[player] = pingHits[player] - 1 - end - - if pingHits[player] == 3 then - pingHits[player] = 0 - - print(name .. " was kicked. (Ping: " .. ping .. "ms)") - - DropPlayer(player, reasonStr:format(ping)) - end - end) + CreateThread(function() + if GetPlayerPed(player) == 0 then + return + end -- Don't do anything if player doesn't have a ped yet + + local name = GetPlayerName(player) + local ping = GetPlayerPing(player) + + if pingHits[player] == nil then + pingHits[player] = 0 + end + + if ping >= limit then + pingHits[player] = pingHits[player] + 1 + + print(name .. " was warned. (Ping: " .. ping .. "ms, Warning: " .. pingHits[player] .. "/3)") + TriggerClientEvent("chat:addMessage", player, { args = { "Ping", warningStr:format(ping, pingHits[player]) } }) + elseif pingHits[player] > 0 then + pingHits[player] = pingHits[player] - 1 + end + + if pingHits[player] == 3 then + pingHits[player] = 0 + + print(name .. " was kicked. (Ping: " .. ping .. "ms)") + + DropPlayer(player, reasonStr:format(ping)) + end + end) end CreateThread(function() -- Loop trough all players and check their pings - while true do - for _, player in ipairs(GetPlayers()) do - CheckPing(player) - end + while true do + for _, player in ipairs(GetPlayers()) do + CheckPing(player) + end - Wait(checkInterval) - end + Wait(checkInterval) + end end) AddEventHandler("playerDropped", function() - pingHits[source] = 0 + pingHits[source] = 0 end) diff --git a/server-data/resources/[maps]/int_prisonfull/client.lua b/server-data/resources/[maps]/int_prisonfull/client.lua new file mode 100644 index 000000000..c65f40723 --- /dev/null +++ b/server-data/resources/[maps]/int_prisonfull/client.lua @@ -0,0 +1,27 @@ +RegisterCommand("alarm_on", function(source, args, rawCommand) + local alarmIpl = GetInteriorAtCoordsWithType(1787.004,2593.1984,45.7978,"int_prison_main") + + RefreshInterior(alarmIpl) + EnableInteriorProp(alarmIpl, "prison_alarm") + + Citizen.CreateThread(function() + while not PrepareAlarm("PRISON_ALARMS") do + Citizen.Wait(100) + end + StartAlarm("PRISON_ALARMS", true) + end) +end, false) + +RegisterCommand("alarm_off", function(source, args, rawCommand) + local alarmIpl = GetInteriorAtCoordsWithType(1787.004,2593.1984,45.7978,"int_prison_main") + + RefreshInterior(alarmIpl) + DisableInteriorProp(alarmIpl, "prison_alarm") + + Citizen.CreateThread(function() + while not PrepareAlarm("PRISON_ALARMS") do + Citizen.Wait(100) + end + StopAllAlarms(true) + end) +end, false) \ No newline at end of file diff --git a/server-data/resources/[maps]/int_prisonfull/fxmanifest.lua b/server-data/resources/[maps]/int_prisonfull/fxmanifest.lua new file mode 100644 index 000000000..5344da5c9 --- /dev/null +++ b/server-data/resources/[maps]/int_prisonfull/fxmanifest.lua @@ -0,0 +1,5 @@ +fx_version("adamant") +game("gta5") +this_is_a_map("yes") +version("1.0.2") +client_script 'client.lua' \ No newline at end of file diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/_int_prison_first.ymf b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/_int_prison_first.ymf new file mode 100644 index 000000000..fd0932517 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/_int_prison_first.ymf differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/int_prison_first.ybn b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/int_prison_first.ybn new file mode 100644 index 000000000..188ebe1d4 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/int_prison_first.ybn differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/int_prison_first.ytyp b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/int_prison_first.ytyp new file mode 100644 index 000000000..225dd8218 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/int_prison_first.ytyp differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prison_first_shell.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prison_first_shell.ydr new file mode 100644 index 000000000..90fd91ec4 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prison_first_shell.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prison_first_txd.ytd b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prison_first_txd.ytd new file mode 100644 index 000000000..83ea698d1 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prison_first_txd.ytd differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prisonf_limbo.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prisonf_limbo.ydr new file mode 100644 index 000000000..e9ca4e32d Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prisonf_limbo.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prisonf_limbo_room1.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prisonf_limbo_room1.ydr new file mode 100644 index 000000000..6da92b53f Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prisonf_limbo_room1.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prisonf_prop_mud_room11_a.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prisonf_prop_mud_room11_a.ydr new file mode 100644 index 000000000..5a583df4a Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prisonf_prop_mud_room11_a.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prisonf_prop_mud_room11_b.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prisonf_prop_mud_room11_b.ydr new file mode 100644 index 000000000..59f8a328d Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prisonf_prop_mud_room11_b.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prisonf_prop_room1.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prisonf_prop_room1.ydr new file mode 100644 index 000000000..1801db8ff Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prisonf_prop_room1.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prisonf_prop_room2.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prisonf_prop_room2.ydr new file mode 100644 index 000000000..6eb17f204 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prisonf_prop_room2.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prisonf_prop_room3.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prisonf_prop_room3.ydr new file mode 100644 index 000000000..49f6e57d3 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prisonf_prop_room3.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prisonm_prop_room11_a.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prisonm_prop_room11_a.ydr new file mode 100644 index 000000000..3b74bd157 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prisonm_prop_room11_a.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prisonm_prop_room11_b.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prisonm_prop_room11_b.ydr new file mode 100644 index 000000000..249e35d9e Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prisonm_prop_room11_b.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prisonm_prop_room11_c.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prisonm_prop_room11_c.ydr new file mode 100644 index 000000000..0fcc28cd1 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prisonm_prop_room11_c.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prisonm_prop_room11_d.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prisonm_prop_room11_d.ydr new file mode 100644 index 000000000..72bee9e70 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prisonm_prop_room11_d.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prisonm_prop_room11_e.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prisonm_prop_room11_e.ydr new file mode 100644 index 000000000..966bb7c09 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_first/prisonm_prop_room11_e.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/_int_prison_main.ymf b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/_int_prison_main.ymf new file mode 100644 index 000000000..6fdd2e038 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/_int_prison_main.ymf differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/int_prison_main.ybn b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/int_prison_main.ybn new file mode 100644 index 000000000..4ee6e133a Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/int_prison_main.ybn differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/int_prison_main.ytyp b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/int_prison_main.ytyp new file mode 100644 index 000000000..20a0509b3 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/int_prison_main.ytyp differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prison_main5_txd.ytd b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prison_main5_txd.ytd new file mode 100644 index 000000000..ec60a933e Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prison_main5_txd.ytd differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prison_main_shell.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prison_main_shell.ydr new file mode 100644 index 000000000..8602b3f83 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prison_main_shell.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prison_main_txd.ytd b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prison_main_txd.ytd new file mode 100644 index 000000000..bc949e257 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prison_main_txd.ytd differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_limbo_room12.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_limbo_room12.ydr new file mode 100644 index 000000000..7932b1ccd Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_limbo_room12.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_limbo_room2.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_limbo_room2.ydr new file mode 100644 index 000000000..2023ecb2d Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_limbo_room2.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_mud_room5.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_mud_room5.ydr new file mode 100644 index 000000000..766bed3a3 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_mud_room5.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room1.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room1.ydr new file mode 100644 index 000000000..6f25134d0 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room1.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room10.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room10.ydr new file mode 100644 index 000000000..1c296c20c Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room10.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room10_b.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room10_b.ydr new file mode 100644 index 000000000..226a50a46 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room10_b.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room2.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room2.ydr new file mode 100644 index 000000000..f3227519d Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room2.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room3.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room3.ydr new file mode 100644 index 000000000..511f1818e Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room3.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room4_a.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room4_a.ydr new file mode 100644 index 000000000..aa499c7cf Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room4_a.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room4_b.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room4_b.ydr new file mode 100644 index 000000000..8ab1987ee Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room4_b.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room5_a.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room5_a.ydr new file mode 100644 index 000000000..4d794b374 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room5_a.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room5_b.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room5_b.ydr new file mode 100644 index 000000000..f681671ce Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room5_b.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room5_c.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room5_c.ydr new file mode 100644 index 000000000..9eb1a7ee8 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room5_c.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room5_d.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room5_d.ydr new file mode 100644 index 000000000..21bbfd118 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room5_d.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room5_e.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room5_e.ydr new file mode 100644 index 000000000..95aa83cb2 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room5_e.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room5_l.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room5_l.ydr new file mode 100644 index 000000000..165aa3905 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room5_l.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room6.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room6.ydr new file mode 100644 index 000000000..79d40aeb1 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room6.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room7.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room7.ydr new file mode 100644 index 000000000..10730875c Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room7.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room8.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room8.ydr new file mode 100644 index 000000000..02b0cebd3 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room8.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room9.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room9.ydr new file mode 100644 index 000000000..5d3df8b45 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_main/prisonm_prop_room9.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_recep/_int_prison_recep.ymf b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_recep/_int_prison_recep.ymf new file mode 100644 index 000000000..a6a9f9f48 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_recep/_int_prison_recep.ymf differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_recep/int_prison_recep.ybn b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_recep/int_prison_recep.ybn new file mode 100644 index 000000000..ead58c830 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_recep/int_prison_recep.ybn differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_recep/int_prison_recep.ytyp b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_recep/int_prison_recep.ytyp new file mode 100644 index 000000000..96bca99bb Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_recep/int_prison_recep.ytyp differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_recep/prison_shell.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_recep/prison_shell.ydr new file mode 100644 index 000000000..684c307a1 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_recep/prison_shell.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/_int_prison_second.ymf b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/_int_prison_second.ymf new file mode 100644 index 000000000..eaa8a20ce Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/_int_prison_second.ymf differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/int_prison_second.ybn b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/int_prison_second.ybn new file mode 100644 index 000000000..a59a5fcc2 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/int_prison_second.ybn differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/int_prison_second.ytyp b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/int_prison_second.ytyp new file mode 100644 index 000000000..8001edd3c Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/int_prison_second.ytyp differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/prison_second_shell.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/prison_second_shell.ydr new file mode 100644 index 000000000..a37c15688 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/prison_second_shell.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/prison_second_txd.ytd b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/prison_second_txd.ytd new file mode 100644 index 000000000..9b412c76b Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/prison_second_txd.ytd differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/prisons_limbo.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/prisons_limbo.ydr new file mode 100644 index 000000000..cfa74383d Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/prisons_limbo.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/prisons_limbo2.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/prisons_limbo2.ydr new file mode 100644 index 000000000..f36010f3d Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/prisons_limbo2.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/prisons_prop_room1.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/prisons_prop_room1.ydr new file mode 100644 index 000000000..4cd215b16 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/prisons_prop_room1.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/prisons_prop_room2.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/prisons_prop_room2.ydr new file mode 100644 index 000000000..0bf910cc8 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/prisons_prop_room2.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/prisons_prop_room3.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/prisons_prop_room3.ydr new file mode 100644 index 000000000..159e78ec8 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/prisons_prop_room3.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/prisons_prop_room4.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/prisons_prop_room4.ydr new file mode 100644 index 000000000..7f01145f6 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/prisons_prop_room4.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/prisons_prop_room5.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/prisons_prop_room5.ydr new file mode 100644 index 000000000..6f8b5bd59 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/prisons_prop_room5.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/prisons_prop_room7.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/prisons_prop_room7.ydr new file mode 100644 index 000000000..fb9299402 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/prisons_prop_room7.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/prisons_prop_room8.ydr b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/prisons_prop_room8.ydr new file mode 100644 index 000000000..76e20a809 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/[interiors]/prison_second/prisons_prop_room8.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/build/cs6_04_canmod014.ydr b/server-data/resources/[maps]/int_prisonfull/stream/build/cs6_04_canmod014.ydr new file mode 100644 index 000000000..f8291bc5e Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/build/cs6_04_canmod014.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/build/cs6_04_canmod08.ydr b/server-data/resources/[maps]/int_prisonfull/stream/build/cs6_04_canmod08.ydr new file mode 100644 index 000000000..20b229ada Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/build/cs6_04_canmod08.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/build/cs6_04_emissive.ydr b/server-data/resources/[maps]/int_prisonfull/stream/build/cs6_04_emissive.ydr new file mode 100644 index 000000000..d91048f1f Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/build/cs6_04_emissive.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/build/cs6_04_emissive_lod.ydr b/server-data/resources/[maps]/int_prisonfull/stream/build/cs6_04_emissive_lod.ydr new file mode 100644 index 000000000..46d802264 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/build/cs6_04_emissive_lod.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/build/cs6_04_pris_dec04.ydr b/server-data/resources/[maps]/int_prisonfull/stream/build/cs6_04_pris_dec04.ydr new file mode 100644 index 000000000..2954e88d4 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/build/cs6_04_pris_dec04.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/build/cs6_04_pris_dec06.ydr b/server-data/resources/[maps]/int_prisonfull/stream/build/cs6_04_pris_dec06.ydr new file mode 100644 index 000000000..775a010e3 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/build/cs6_04_pris_dec06.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/build/cs6_04_props_prop10_slod_children.ydd b/server-data/resources/[maps]/int_prisonfull/stream/build/cs6_04_props_prop10_slod_children.ydd new file mode 100644 index 000000000..c47f047f8 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/build/cs6_04_props_prop10_slod_children.ydd differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/build/cs6_04_pwalkway04.ydr b/server-data/resources/[maps]/int_prisonfull/stream/build/cs6_04_pwalkway04.ydr new file mode 100644 index 000000000..5102262c1 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/build/cs6_04_pwalkway04.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/build/cs6_04_reception.ydr b/server-data/resources/[maps]/int_prisonfull/stream/build/cs6_04_reception.ydr new file mode 100644 index 000000000..441d5d7e4 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/build/cs6_04_reception.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/build/cs6_04_road01.ydr b/server-data/resources/[maps]/int_prisonfull/stream/build/cs6_04_road01.ydr new file mode 100644 index 000000000..e91abfc9f Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/build/cs6_04_road01.ydr differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/build/cs6_04_slod1_children.ydd b/server-data/resources/[maps]/int_prisonfull/stream/build/cs6_04_slod1_children.ydd new file mode 100644 index 000000000..2d16fcc9a Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/build/cs6_04_slod1_children.ydd differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/build/cs6_occl_02.ymap b/server-data/resources/[maps]/int_prisonfull/stream/build/cs6_occl_02.ymap new file mode 100644 index 000000000..5af076dc1 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/build/cs6_occl_02.ymap differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/build/hei_ch3_occl_03.ymap b/server-data/resources/[maps]/int_prisonfull/stream/build/hei_ch3_occl_03.ymap new file mode 100644 index 000000000..ad78c32d7 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/build/hei_ch3_occl_03.ymap differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/build/hi@lr_cs6_04_1.ybn b/server-data/resources/[maps]/int_prisonfull/stream/build/hi@lr_cs6_04_1.ybn new file mode 100644 index 000000000..4bfc33df9 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/build/hi@lr_cs6_04_1.ybn differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/build/lr_cs6_04_0.ybn b/server-data/resources/[maps]/int_prisonfull/stream/build/lr_cs6_04_0.ybn new file mode 100644 index 000000000..e9091a2fa Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/build/lr_cs6_04_0.ybn differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/build/lr_cs6_04_critical_0.ymap b/server-data/resources/[maps]/int_prisonfull/stream/build/lr_cs6_04_critical_0.ymap new file mode 100644 index 000000000..e20ee590d Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/build/lr_cs6_04_critical_0.ymap differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/build/lr_cs6_04_strm_3.ymap b/server-data/resources/[maps]/int_prisonfull/stream/build/lr_cs6_04_strm_3.ymap new file mode 100644 index 000000000..65ab3b116 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/build/lr_cs6_04_strm_3.ymap differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/build/lr_cs6_lod_slod2_07_children.ydd b/server-data/resources/[maps]/int_prisonfull/stream/build/lr_cs6_lod_slod2_07_children.ydd new file mode 100644 index 000000000..0c6d43197 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/build/lr_cs6_lod_slod2_07_children.ydd differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/build/prison_windows.ymap b/server-data/resources/[maps]/int_prisonfull/stream/build/prison_windows.ymap new file mode 100644 index 000000000..a32075612 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/build/prison_windows.ymap differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/metadata/_manifest.ymf b/server-data/resources/[maps]/int_prisonfull/stream/metadata/_manifest.ymf new file mode 100644 index 000000000..8c715c0f8 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/metadata/_manifest.ymf differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/metadata/int_prison_first_milo_.ymap b/server-data/resources/[maps]/int_prisonfull/stream/metadata/int_prison_first_milo_.ymap new file mode 100644 index 000000000..9936bd9a2 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/metadata/int_prison_first_milo_.ymap differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/metadata/int_prison_main_milo_.ymap b/server-data/resources/[maps]/int_prisonfull/stream/metadata/int_prison_main_milo_.ymap new file mode 100644 index 000000000..8e8434e49 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/metadata/int_prison_main_milo_.ymap differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/metadata/int_prison_recep_milo_.ymap b/server-data/resources/[maps]/int_prisonfull/stream/metadata/int_prison_recep_milo_.ymap new file mode 100644 index 000000000..cf3c0f2f5 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/metadata/int_prison_recep_milo_.ymap differ diff --git a/server-data/resources/[maps]/int_prisonfull/stream/metadata/int_prison_second_milo_.ymap b/server-data/resources/[maps]/int_prisonfull/stream/metadata/int_prison_second_milo_.ymap new file mode 100644 index 000000000..c955ecc55 Binary files /dev/null and b/server-data/resources/[maps]/int_prisonfull/stream/metadata/int_prison_second_milo_.ymap differ diff --git a/server-data/resources/[maps]/prisonprops/fxmanifest.lua b/server-data/resources/[maps]/prisonprops/fxmanifest.lua new file mode 100644 index 000000000..982450522 --- /dev/null +++ b/server-data/resources/[maps]/prisonprops/fxmanifest.lua @@ -0,0 +1,6 @@ +fx_version("adamant") +game("gta5") +this_is_a_map("yes") +version("1.0.2") +data_file('DLC_ITYP_REQUEST')('stream/prison_props.ytyp') + diff --git a/server-data/resources/[maps]/prisonprops/stream/prison_jailroom_prop_1.ydr b/server-data/resources/[maps]/prisonprops/stream/prison_jailroom_prop_1.ydr new file mode 100644 index 000000000..e50b0d0d6 Binary files /dev/null and b/server-data/resources/[maps]/prisonprops/stream/prison_jailroom_prop_1.ydr differ diff --git a/server-data/resources/[maps]/prisonprops/stream/prison_jailroom_prop_2.ydr b/server-data/resources/[maps]/prisonprops/stream/prison_jailroom_prop_2.ydr new file mode 100644 index 000000000..24e46af06 Binary files /dev/null and b/server-data/resources/[maps]/prisonprops/stream/prison_jailroom_prop_2.ydr differ diff --git a/server-data/resources/[maps]/prisonprops/stream/prison_jailroom_prop_3.ydr b/server-data/resources/[maps]/prisonprops/stream/prison_jailroom_prop_3.ydr new file mode 100644 index 000000000..b05fc5ee4 Binary files /dev/null and b/server-data/resources/[maps]/prisonprops/stream/prison_jailroom_prop_3.ydr differ diff --git a/server-data/resources/[maps]/prisonprops/stream/prison_jailroom_prop_4.ydr b/server-data/resources/[maps]/prisonprops/stream/prison_jailroom_prop_4.ydr new file mode 100644 index 000000000..2cecf505a Binary files /dev/null and b/server-data/resources/[maps]/prisonprops/stream/prison_jailroom_prop_4.ydr differ diff --git a/server-data/resources/[maps]/prisonprops/stream/prison_prop_door1.ydr b/server-data/resources/[maps]/prisonprops/stream/prison_prop_door1.ydr new file mode 100644 index 000000000..d6700e79f Binary files /dev/null and b/server-data/resources/[maps]/prisonprops/stream/prison_prop_door1.ydr differ diff --git a/server-data/resources/[maps]/prisonprops/stream/prison_prop_door1a.ydr b/server-data/resources/[maps]/prisonprops/stream/prison_prop_door1a.ydr new file mode 100644 index 000000000..ca8c1c1d4 Binary files /dev/null and b/server-data/resources/[maps]/prisonprops/stream/prison_prop_door1a.ydr differ diff --git a/server-data/resources/[maps]/prisonprops/stream/prison_prop_door2.ydr b/server-data/resources/[maps]/prisonprops/stream/prison_prop_door2.ydr new file mode 100644 index 000000000..eaa707f2a Binary files /dev/null and b/server-data/resources/[maps]/prisonprops/stream/prison_prop_door2.ydr differ diff --git a/server-data/resources/[maps]/prisonprops/stream/prison_prop_framedoor.ydr b/server-data/resources/[maps]/prisonprops/stream/prison_prop_framedoor.ydr new file mode 100644 index 000000000..07047fc1d Binary files /dev/null and b/server-data/resources/[maps]/prisonprops/stream/prison_prop_framedoor.ydr differ diff --git a/server-data/resources/[maps]/prisonprops/stream/prison_prop_framedoor1.ydr b/server-data/resources/[maps]/prisonprops/stream/prison_prop_framedoor1.ydr new file mode 100644 index 000000000..b5eba2d73 Binary files /dev/null and b/server-data/resources/[maps]/prisonprops/stream/prison_prop_framedoor1.ydr differ diff --git a/server-data/resources/[maps]/prisonprops/stream/prison_prop_framedoor2.ydr b/server-data/resources/[maps]/prisonprops/stream/prison_prop_framedoor2.ydr new file mode 100644 index 000000000..cbb07d81c Binary files /dev/null and b/server-data/resources/[maps]/prisonprops/stream/prison_prop_framedoor2.ydr differ diff --git a/server-data/resources/[maps]/prisonprops/stream/prison_prop_framedoor3.ydr b/server-data/resources/[maps]/prisonprops/stream/prison_prop_framedoor3.ydr new file mode 100644 index 000000000..8a7d01854 Binary files /dev/null and b/server-data/resources/[maps]/prisonprops/stream/prison_prop_framedoor3.ydr differ diff --git a/server-data/resources/[maps]/prisonprops/stream/prison_prop_framedoor4.ydr b/server-data/resources/[maps]/prisonprops/stream/prison_prop_framedoor4.ydr new file mode 100644 index 000000000..881e61931 Binary files /dev/null and b/server-data/resources/[maps]/prisonprops/stream/prison_prop_framedoor4.ydr differ diff --git a/server-data/resources/[maps]/prisonprops/stream/prison_prop_jaildoor.ydr b/server-data/resources/[maps]/prisonprops/stream/prison_prop_jaildoor.ydr new file mode 100644 index 000000000..0800aa946 Binary files /dev/null and b/server-data/resources/[maps]/prisonprops/stream/prison_prop_jaildoor.ydr differ diff --git a/server-data/resources/[maps]/prisonprops/stream/prison_prop_jailframe.ydr b/server-data/resources/[maps]/prisonprops/stream/prison_prop_jailframe.ydr new file mode 100644 index 000000000..1d327bc49 Binary files /dev/null and b/server-data/resources/[maps]/prisonprops/stream/prison_prop_jailframe.ydr differ diff --git a/server-data/resources/[maps]/prisonprops/stream/prison_prop_jailframe2.ydr b/server-data/resources/[maps]/prisonprops/stream/prison_prop_jailframe2.ydr new file mode 100644 index 000000000..61877d3df Binary files /dev/null and b/server-data/resources/[maps]/prisonprops/stream/prison_prop_jailframe2.ydr differ diff --git a/server-data/resources/[maps]/prisonprops/stream/prison_prop_jailframe3.ydr b/server-data/resources/[maps]/prisonprops/stream/prison_prop_jailframe3.ydr new file mode 100644 index 000000000..14d8e017a Binary files /dev/null and b/server-data/resources/[maps]/prisonprops/stream/prison_prop_jailframe3.ydr differ diff --git a/server-data/resources/[maps]/prisonprops/stream/prison_props.ytyp b/server-data/resources/[maps]/prisonprops/stream/prison_props.ytyp new file mode 100644 index 000000000..96248df7f Binary files /dev/null and b/server-data/resources/[maps]/prisonprops/stream/prison_props.ytyp differ diff --git a/server-data/resources/[maps]/prisonprops/stream/prison_props_txd.ytd b/server-data/resources/[maps]/prisonprops/stream/prison_props_txd.ytd new file mode 100644 index 000000000..5e151b31a Binary files /dev/null and b/server-data/resources/[maps]/prisonprops/stream/prison_props_txd.ytd differ diff --git a/server-data/resources/[maps]/prisonprops/stream/prison_trolley_01a.ydr b/server-data/resources/[maps]/prisonprops/stream/prison_trolley_01a.ydr new file mode 100644 index 000000000..774a05f11 Binary files /dev/null and b/server-data/resources/[maps]/prisonprops/stream/prison_trolley_01a.ydr differ diff --git a/server-data/resources/[maps]/prisonprops/stream/prison_trolley_01b.ydr b/server-data/resources/[maps]/prisonprops/stream/prison_trolley_01b.ydr new file mode 100644 index 000000000..edb7c4073 Binary files /dev/null and b/server-data/resources/[maps]/prisonprops/stream/prison_trolley_01b.ydr differ diff --git a/server-data/resources/[maps]/prisonprops/stream/prison_trolley_02a.ydr b/server-data/resources/[maps]/prisonprops/stream/prison_trolley_02a.ydr new file mode 100644 index 000000000..ed146dfbc Binary files /dev/null and b/server-data/resources/[maps]/prisonprops/stream/prison_trolley_02a.ydr differ diff --git a/server-data/resources/[maps]/prisonprops/stream/prisonm_window.ydr b/server-data/resources/[maps]/prisonprops/stream/prisonm_window.ydr new file mode 100644 index 000000000..958034f65 Binary files /dev/null and b/server-data/resources/[maps]/prisonprops/stream/prisonm_window.ydr differ diff --git a/server-data/resources/[maps]/prisonprops/stream/prisons_window.ydr b/server-data/resources/[maps]/prisonprops/stream/prisons_window.ydr new file mode 100644 index 000000000..3e990c0a4 Binary files /dev/null and b/server-data/resources/[maps]/prisonprops/stream/prisons_window.ydr differ diff --git a/server-data/resources/[maps]/prisonprops/stream/prop_justvent_1.ydr b/server-data/resources/[maps]/prisonprops/stream/prop_justvent_1.ydr new file mode 100644 index 000000000..7f85e4a1d Binary files /dev/null and b/server-data/resources/[maps]/prisonprops/stream/prop_justvent_1.ydr differ diff --git a/server-data/resources/[maps]/prisonprops/stream/prop_justvent_2.ydr b/server-data/resources/[maps]/prisonprops/stream/prop_justvent_2.ydr new file mode 100644 index 000000000..a5433cebf Binary files /dev/null and b/server-data/resources/[maps]/prisonprops/stream/prop_justvent_2.ydr differ diff --git a/server-data/resources/[maps]/prisonprops/stream/pshirurg_bath.ydr b/server-data/resources/[maps]/prisonprops/stream/pshirurg_bath.ydr new file mode 100644 index 000000000..2428d595a Binary files /dev/null and b/server-data/resources/[maps]/prisonprops/stream/pshirurg_bath.ydr differ diff --git a/server-data/resources/[maps]/prisonprops/stream/xm_cellgate.ydr b/server-data/resources/[maps]/prisonprops/stream/xm_cellgate.ydr new file mode 100644 index 000000000..6c1252142 Binary files /dev/null and b/server-data/resources/[maps]/prisonprops/stream/xm_cellgate.ydr differ diff --git a/server-data/resources/[ox]/ox_inventory/data/items.lua b/server-data/resources/[ox]/ox_inventory/data/items.lua index 94ecb27c4..8eb79d2a2 100644 --- a/server-data/resources/[ox]/ox_inventory/data/items.lua +++ b/server-data/resources/[ox]/ox_inventory/data/items.lua @@ -434,13 +434,13 @@ return { ["potato"] = { label = "Patate", - weight = 100, + weight = 20, stack = true, }, ["chips"] = { label = "Patatine fritte", - weight = 100, + weight = 25, stack = true, }, @@ -547,7 +547,7 @@ return { ["grain"] = { label = "grano", - weight = 100, + weight = 5, stack = true, }, diff --git a/server-data/resources/[ox]/ox_lib/fxmanifest.lua b/server-data/resources/[ox]/ox_lib/fxmanifest.lua index 91ebe1246..467275339 100644 --- a/server-data/resources/[ox]/ox_lib/fxmanifest.lua +++ b/server-data/resources/[ox]/ox_lib/fxmanifest.lua @@ -6,7 +6,7 @@ rdr3_warning 'I acknowledge that this is a prerelease build of RedM, and I am aw name 'ox_lib' author 'Overextended' -version '3.26.0' +version '3.27.0' license 'LGPL-3.0-or-later' repository 'https://github.com/overextended/ox_lib' description 'A library of shared functions to utilise in other resources.' diff --git a/server-data/resources/[ox]/ox_lib/imports/array/shared.lua b/server-data/resources/[ox]/ox_lib/imports/array/shared.lua index 778cc3e49..f95b55d68 100644 --- a/server-data/resources/[ox]/ox_lib/imports/array/shared.lua +++ b/server-data/resources/[ox]/ox_lib/imports/array/shared.lua @@ -19,15 +19,20 @@ function lib.array:__newindex(index, value) rawset(self, index, value) end ----Create a new array containing the elements from two arrays. ----@param arr ArrayLike -function lib.array:merge(arr) +---Create a new array containing the elements of two or more arrays. +---@param ... ArrayLike +function lib.array:merge(...) local newArr = table.clone(self) local length = #self + local arrays = { ... } - for i = 1, #arr do - length += 1 - newArr[length] = arr[i] + for i = 1, #arrays do + local arr = arrays[i] + + for j = 1, #arr do + length += 1 + newArr[length] = arr[j] + end end return lib.array:new(table.unpack(newArr)) @@ -122,12 +127,35 @@ function lib.array:forEach(cb) end end +---Determines if a given element exists inside an array. +---@param element unknown The value to find in the array. +---@param fromIndex? number The position in the array to begin searching from. +function lib.array:includes(element, fromIndex) + for i = (fromIndex or 1), #self do + if self[i] == element then return true end + end + + return false +end + ---Concatenates all array elements into a string, seperated by commas or the specified seperator. ---@param seperator? string function lib.array:join(seperator) return table.concat(self, seperator or ',') end +---Create a new array containing the results from calling the provided function on every element in an array. +---@param cb fun(element: unknown, index: number, array: self): unknown +function lib.array:map(cb) + local arr = {} + + for i = 1, #self do + arr[i] = cb(self[i], i, self) + end + + return lib.array:new(table.unpack(arr)) +end + ---Removes the last element from an array and returns the removed element. function lib.array:pop() return table.remove(self) @@ -147,11 +175,6 @@ function lib.array:push(...) return length end ----Removes the first element from an array and returns the removed element. -function lib.array:shift() - return table.remove(self, 1) -end - ---The "reducer" function is applied to every element within an array, with the previous element's result serving as the accumulator.\ ---If an initial value is provided, it's used as the accumulator for index 1; otherwise, index 1 itself serves as the initial value, and iteration begins from index 2. ---@generic T @@ -169,14 +192,43 @@ function lib.array:reduce(reducer, initialValue) return accumulator end +---Reverses the elements inside an array. +function lib.array:reverse() + local i, j = 1, #self + + while i < j do + self[i], self[j] = self[j], self[i] + i += 1 + j -= 1 + end + + return self +end + +---Removes the first element from an array and returns the removed element. +function lib.array:shift() + return table.remove(self, 1) +end + +---Creates a new array with reversed elements from the given array. +function lib.array:toReversed() + local reversed = lib.array:new() + + for i = #self, 1, -1 do + reversed:push(self[i]) + end + + return reversed +end + ---Returns true if the given table is an instance of array or an array-like table. ---@param tbl ArrayLike ---@return boolean function lib.array.isArray(tbl) - if not type(tbl) == 'table' then return false end - local tableType = table.type(tbl) + if not tableType then return false end + if tableType == 'array' or tableType == 'empty' or lib.array.instanceOf(tbl, lib.array) then return true end diff --git a/server-data/resources/[ox]/ox_lib/imports/dui/client.lua b/server-data/resources/[ox]/ox_lib/imports/dui/client.lua new file mode 100644 index 000000000..6d464df3d --- /dev/null +++ b/server-data/resources/[ox]/ox_lib/imports/dui/client.lua @@ -0,0 +1,87 @@ +---@class DuiProperties +---@field url string +---@field width number +---@field height number +---@field debug? boolean + +---@class Dui : OxClass +---@field private private { id: string, debug: boolean } +---@field url string +---@field duiObject number +---@field duiHandle string +---@field runtimeTxd number +---@field txdObject number +---@field dictName string +---@field txtName string +lib.dui = lib.class('Dui') + +---@type table +local duis = {} + +local currentId = 0 + +---@param data DuiProperties +function lib.dui:constructor(data) + local time = GetGameTimer() + local id = ("%s_%s_%s"):format(cache.resource, time, currentId) + currentId = currentId + 1 + local dictName = ('ox_lib_dui_dict_%s'):format(id) + local txtName = ('ox_lib_dui_txt_%s'):format(id) + local duiObject = CreateDui(data.url, data.width, data.height) + local duiHandle = GetDuiHandle(duiObject) + local runtimeTxd = CreateRuntimeTxd(dictName) + local txdObject = CreateRuntimeTextureFromDuiHandle(runtimeTxd, txtName, duiHandle) + self.private.id = id + self.private.debug = data.debug or false + self.url = data.url + self.duiObject = duiObject + self.duiHandle = duiHandle + self.runtimeTxd = runtimeTxd + self.txdObject = txdObject + self.dictName = dictName + self.txtName = txtName + duis[id] = self + + if self.private.debug then + print(('Dui %s created'):format(id)) + end +end + +function lib.dui:remove() + SetDuiUrl(self.duiObject, 'about:blank') + DestroyDui(self.duiObject) + duis[self.private.id] = nil + + if self.private.debug then + print(('Dui %s removed'):format(self.private.id)) + end +end + +---@param url string +function lib.dui:setUrl(url) + self.url = url + SetDuiUrl(self.duiObject, url) + + if self.private.debug then + print(('Dui %s url set to %s'):format(self.private.id, url)) + end +end + +---@param message table +function lib.dui:sendMessage(message) + SendDuiMessage(self.duiObject, json.encode(message)) + + if self.private.debug then + print(('Dui %s message sent with data :'):format(self.private.id), json.encode(message, { indent = true })) + end +end + +AddEventHandler('onResourceStop', function(resourceName) + if cache.resource ~= resourceName then return end + + for _, dui in pairs(duis) do + dui:remove() + end +end) + +return lib.dui diff --git a/server-data/resources/[ox]/ox_lib/imports/requestAudioBank/client.lua b/server-data/resources/[ox]/ox_lib/imports/requestAudioBank/client.lua index b5fbb8cf7..419681dae 100644 --- a/server-data/resources/[ox]/ox_lib/imports/requestAudioBank/client.lua +++ b/server-data/resources/[ox]/ox_lib/imports/requestAudioBank/client.lua @@ -5,7 +5,7 @@ function lib.requestAudioBank(audioBank, timeout) return lib.waitFor(function() if RequestScriptAudioBank(audioBank, false) then return audioBank end - end, ("failed to load audiobank '%s'"):format(audioBank), timeout or 500) + end, ("failed to load audiobank '%s' - this may be caused by\n- too many loaded assets\n- oversized, invalid, or corrupted assets"):format(audioBank), timeout or 30000) end return lib.requestAudioBank diff --git a/server-data/resources/[ox]/ox_lib/imports/streamingRequest/client.lua b/server-data/resources/[ox]/ox_lib/imports/streamingRequest/client.lua index 1238b77f7..0a72b1216 100644 --- a/server-data/resources/[ox]/ox_lib/imports/streamingRequest/client.lua +++ b/server-data/resources/[ox]/ox_lib/imports/streamingRequest/client.lua @@ -12,12 +12,10 @@ function lib.streamingRequest(request, hasLoaded, assetType, asset, timeout, ... request(asset, ...) - -- i hate fivem developers - lib.print.verbose(("Loading %s '%s' - remember to release it when done."):format(assetType, asset)) - return lib.waitFor(function() - if hasLoaded(asset) then return asset end - end, ("failed to load %s '%s' - this is likely caused by unreleased assets"):format(assetType, asset), timeout or 10000) + if hasLoaded(asset) then return asset end + end, ("failed to load %s '%s' - this may be caused by\n- too many loaded assets\n- oversized, invalid, or corrupted assets"):format(assetType, asset), + timeout or 30000) end return lib.streamingRequest diff --git a/server-data/resources/[ox]/ox_lib/imports/table/shared.lua b/server-data/resources/[ox]/ox_lib/imports/table/shared.lua index 0e1b53f91..bf5ea7671 100644 --- a/server-data/resources/[ox]/ox_lib/imports/table/shared.lua +++ b/server-data/resources/[ox]/ox_lib/imports/table/shared.lua @@ -9,24 +9,29 @@ local pairs = pairs ---@return boolean ---Checks if tbl contains the given values. Only intended for simple values and unnested tables. local function contains(tbl, value) - if type(value) ~= 'table' then - for _, v in pairs(tbl) do - if v == value then return true end - end - else - local matched_values = 0 - local values = 0 - for _, v1 in pairs(value) do - values += 1 - - for _, v2 in pairs(tbl) do - if v1 == v2 then matched_values += 1 end - end - end - if matched_values == values then return true end - end - - return false + if type(value) ~= 'table' then + for _, v in pairs(tbl) do + if v == value then + return true + end + end + + return false + else + local set = {} + + for _, v in pairs(tbl) do + set[v] = true + end + + for _, v in pairs(value) do + if not set[v] then + return false + end + end + + return true + end end ---@param t1 any @@ -34,22 +39,28 @@ end ---@return boolean ---Compares if two values are equal, iterating over tables and matching both keys and values. local function table_matches(t1, t2) - local type1, type2 = type(t1), type(t2) + local tabletype1 = table.type(t1) + + if not tabletype1 then return t1 == t2 end - if type1 ~= type2 then return false end - if type1 ~= 'table' and type2 ~= 'table' then return t1 == t2 end + if tabletype1 ~= table.type(t2) or (tabletype1 == 'array' and #t1 ~= #t2) then + return false + end - for k1,v1 in pairs(t1) do - local v2 = t2[k1] - if v2 == nil or not table_matches(v1,v2) then return false end - end + for k, v1 in pairs(t1) do + local v2 = t2[k] + if v2 == nil or not table_matches(v1, v2) then + return false + end + end - for k2,v2 in pairs(t2) do - local v1 = t1[k2] - if v1 == nil or not table_matches(v1,v2) then return false end - end + for k in pairs(t2) do + if t1[k] == nil then + return false + end + end - return true + return true end ---@generic T @@ -57,15 +68,15 @@ end ---@return T ---Recursively clones a table to ensure no table references. local function table_deepclone(tbl) - tbl = table.clone(tbl) + tbl = table.clone(tbl) - for k, v in pairs(tbl) do - if type(v) == 'table' then - tbl[k] = table_deepclone(v) - end - end + for k, v in pairs(tbl) do + if type(v) == 'table' then + tbl[k] = table_deepclone(v) + end + end - return tbl + return tbl end ---@param t1 table @@ -74,17 +85,18 @@ end ---@return table ---Merges two tables together. Defaults to adding duplicate keys together if they are numbers, otherwise they are overriden. local function table_merge(t1, t2, addDuplicateNumbers) - if addDuplicateNumbers == nil then addDuplicateNumbers = true end - for k, v in pairs(t2) do - local type1 = type(t1[k]) - local type2 = type(v) - - if type1 == 'table' and type2 == 'table' then - table_merge(t1[k], v, addDuplicateNumbers) + addDuplicateNumbers = addDuplicateNumbers ~= nil and addDuplicateNumbers or true + for k, v2 in pairs(t2) do + local v1 = t1[k] + local type1 = type(v1) + local type2 = type(v2) + + if type1 == 'table' and type2 == 'table' then + table_merge(v1, v2, addDuplicateNumbers) elseif addDuplicateNumbers and (type1 == 'number' and type2 == 'number') then - t1[k] += v - else - t1[k] = v + t1[k] = v1 + v2 + else + t1[k] = v2 end end diff --git a/server-data/resources/[ox]/ox_lib/init.lua b/server-data/resources/[ox]/ox_lib/init.lua index 83eda560f..9032055b3 100644 --- a/server-data/resources/[ox]/ox_lib/init.lua +++ b/server-data/resources/[ox]/ox_lib/init.lua @@ -96,11 +96,6 @@ local lib = setmetatable({ __call = call, }) -_ENV.lib = lib - --- Override standard Lua require with our own. -require = lib.require - local intervals = {} --- Dream of a world where this PR gets accepted. ---@param callback function | number @@ -215,7 +210,9 @@ function lib.onCache(key, cb) table.insert(cacheEvents[key], cb) end +_ENV.lib = lib _ENV.cache = cache +_ENV.require = lib.require local notifyEvent = ('__ox_notify_%s'):format(cache.resource) diff --git a/server-data/resources/[ox]/oxmysql/dist/build.js b/server-data/resources/[ox]/oxmysql/dist/build.js index 3f980512e..323fa9da3 100644 --- a/server-data/resources/[ox]/oxmysql/dist/build.js +++ b/server-data/resources/[ox]/oxmysql/dist/build.js @@ -9,7 +9,6 @@ var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol. var __typeError = (msg) => { throw TypeError(msg); }; -var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); var __esm = (fn, res) => function __init() { return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; @@ -37,20 +36,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); -var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); -var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method); -var __privateWrapper = (obj, member, setter, getter) => ({ - set _(value) { - __privateSet(obj, member, value, setter); - }, - get _() { - return __privateGet(obj, member, getter); - } -}); var __using = (stack, value, async) => { if (value != null) { if (typeof value !== "object" && typeof value !== "function") __typeError("Object expected"); @@ -1649,1413 +1638,385 @@ var require_denque = __commonJS({ } i2 = this._head - 1 + len & this._capacityMask; while (del_count > 0) { - this._list[i2 = i2 - 1 + len & this._capacityMask] = void 0; - del_count--; - } - if (index < 0) this._tail = i2; - } else { - this._tail = i2; - i2 = i2 + count + len & this._capacityMask; - for (k = size - (count + index); k > 0; k--) { - this.push(this._list[i2++]); - } - i2 = this._tail; - while (del_count > 0) { - this._list[i2 = i2 + 1 + len & this._capacityMask] = void 0; - del_count--; - } - } - if (this._head < 2 && this._tail > 1e4 && this._tail <= len >>> 2) this._shrinkArray(); - return removed; - }, "remove"); - Denque.prototype.splice = /* @__PURE__ */ __name(function splice(index, count) { - var i2 = index; - if (i2 !== (i2 | 0)) { - return void 0; - } - var size = this.size(); - if (i2 < 0) i2 += size; - if (i2 > size) return void 0; - if (arguments.length > 2) { - var k; - var temp; - var removed; - var arg_len = arguments.length; - var len = this._list.length; - var arguments_index = 2; - if (!size || i2 < size / 2) { - temp = new Array(i2); - for (k = 0; k < i2; k++) { - temp[k] = this._list[this._head + k & this._capacityMask]; - } - if (count === 0) { - removed = []; - if (i2 > 0) { - this._head = this._head + i2 + len & this._capacityMask; - } - } else { - removed = this.remove(i2, count); - this._head = this._head + i2 + len & this._capacityMask; - } - while (arg_len > arguments_index) { - this.unshift(arguments[--arg_len]); - } - for (k = i2; k > 0; k--) { - this.unshift(temp[k - 1]); - } - } else { - temp = new Array(size - (i2 + count)); - var leng = temp.length; - for (k = 0; k < leng; k++) { - temp[k] = this._list[this._head + i2 + count + k & this._capacityMask]; - } - if (count === 0) { - removed = []; - if (i2 != size) { - this._tail = this._head + i2 + len & this._capacityMask; - } - } else { - removed = this.remove(i2, count); - this._tail = this._tail - leng + len & this._capacityMask; - } - while (arguments_index < arg_len) { - this.push(arguments[arguments_index++]); - } - for (k = 0; k < leng; k++) { - this.push(temp[k]); - } - } - return removed; - } else { - return this.remove(i2, count); - } - }, "splice"); - Denque.prototype.clear = /* @__PURE__ */ __name(function clear() { - this._list = new Array(this._list.length); - this._head = 0; - this._tail = 0; - }, "clear"); - Denque.prototype.isEmpty = /* @__PURE__ */ __name(function isEmpty() { - return this._head === this._tail; - }, "isEmpty"); - Denque.prototype.toArray = /* @__PURE__ */ __name(function toArray() { - return this._copyArray(false); - }, "toArray"); - Denque.prototype._fromArray = /* @__PURE__ */ __name(function _fromArray(array) { - var length = array.length; - var capacity = this._nextPowerOf2(length); - this._list = new Array(capacity); - this._capacityMask = capacity - 1; - this._tail = length; - for (var i2 = 0; i2 < length; i2++) this._list[i2] = array[i2]; - }, "_fromArray"); - Denque.prototype._copyArray = /* @__PURE__ */ __name(function _copyArray(fullCopy, size) { - var src = this._list; - var capacity = src.length; - var length = this.length; - size = size | length; - if (size == length && this._head < this._tail) { - return this._list.slice(this._head, this._tail); - } - var dest = new Array(size); - var k = 0; - var i2; - if (fullCopy || this._head > this._tail) { - for (i2 = this._head; i2 < capacity; i2++) dest[k++] = src[i2]; - for (i2 = 0; i2 < this._tail; i2++) dest[k++] = src[i2]; - } else { - for (i2 = this._head; i2 < this._tail; i2++) dest[k++] = src[i2]; - } - return dest; - }, "_copyArray"); - Denque.prototype._growArray = /* @__PURE__ */ __name(function _growArray() { - if (this._head != 0) { - var newList = this._copyArray(true, this._list.length << 1); - this._tail = this._list.length; - this._head = 0; - this._list = newList; - } else { - this._tail = this._list.length; - this._list.length <<= 1; - } - this._capacityMask = this._capacityMask << 1 | 1; - }, "_growArray"); - Denque.prototype._shrinkArray = /* @__PURE__ */ __name(function _shrinkArray() { - this._list.length >>>= 1; - this._capacityMask >>>= 1; - }, "_shrinkArray"); - Denque.prototype._nextPowerOf2 = /* @__PURE__ */ __name(function _nextPowerOf2(num) { - var log2 = Math.log(num) / Math.log(2); - var nextPow2 = 1 << log2 + 1; - return Math.max(nextPow2, 4); - }, "_nextPowerOf2"); - module2.exports = Denque; - } -}); - -// node_modules/.pnpm/lru-cache@8.0.5/node_modules/lru-cache/dist/cjs/index.js -var require_cjs = __commonJS({ - "node_modules/.pnpm/lru-cache@8.0.5/node_modules/lru-cache/dist/cjs/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.LRUCache = void 0; - var perf = typeof performance === "object" && performance && typeof performance.now === "function" ? performance : Date; - var warned = /* @__PURE__ */ new Set(); - var emitWarning = /* @__PURE__ */ __name((msg, type, code, fn) => { - typeof process === "object" && process && typeof process.emitWarning === "function" ? process.emitWarning(msg, type, code, fn) : console.error(`[${code}] ${type}: ${msg}`); - }, "emitWarning"); - var shouldWarn = /* @__PURE__ */ __name((code) => !warned.has(code), "shouldWarn"); - var TYPE = Symbol("type"); - var isPosInt = /* @__PURE__ */ __name((n) => n && n === Math.floor(n) && n > 0 && isFinite(n), "isPosInt"); - var getUintArray = /* @__PURE__ */ __name((max) => !isPosInt(max) ? null : max <= Math.pow(2, 8) ? Uint8Array : max <= Math.pow(2, 16) ? Uint16Array : max <= Math.pow(2, 32) ? Uint32Array : max <= Number.MAX_SAFE_INTEGER ? ZeroArray : null, "getUintArray"); - var _ZeroArray = class _ZeroArray extends Array { - constructor(size) { - super(size); - this.fill(0); - } - }; - __name(_ZeroArray, "ZeroArray"); - var ZeroArray = _ZeroArray; - var _constructing; - var _Stack = class _Stack { - heap; - length; - static create(max) { - const HeapCls = getUintArray(max); - if (!HeapCls) - return []; - __privateSet(_Stack, _constructing, true); - const s2 = new _Stack(max, HeapCls); - __privateSet(_Stack, _constructing, false); - return s2; - } - constructor(max, HeapCls) { - if (!__privateGet(_Stack, _constructing)) { - throw new TypeError("instantiate Stack using Stack.create(n)"); - } - this.heap = new HeapCls(max); - this.length = 0; - } - push(n) { - this.heap[this.length++] = n; - } - pop() { - return this.heap[--this.length]; - } - }; - _constructing = new WeakMap(); - __name(_Stack, "Stack"); - // private constructor - __privateAdd(_Stack, _constructing, false); - var Stack = _Stack; - var _max, _maxSize, _dispose, _disposeAfter, _fetchMethod, _size2, _calculatedSize, _keyMap, _keyList, _valList, _next, _prev, _head, _tail, _free, _disposed, _sizes, _starts, _ttls, _hasDispose, _hasFetchMethod, _hasDisposeAfter, _LRUCache_instances, initializeTTLTracking_fn, _updateItemAge, _statusTTL, _setItemTTL, _isStale, initializeSizeTracking_fn, _removeItemSize, _addItemSize, _requireSize, indexes_fn, rindexes_fn, isValidIndex_fn, evict_fn, backgroundFetch_fn, isBackgroundFetch_fn, connect_fn, moveToTail_fn; - var _LRUCache = class _LRUCache { - constructor(options) { - __privateAdd(this, _LRUCache_instances); - // properties coming in from the options of these, only max and maxSize - // really *need* to be protected. The rest can be modified, as they just - // set defaults for various methods. - __privateAdd(this, _max); - __privateAdd(this, _maxSize); - __privateAdd(this, _dispose); - __privateAdd(this, _disposeAfter); - __privateAdd(this, _fetchMethod); - /** - * {@link LRUCache.OptionsBase.ttl} - */ - __publicField(this, "ttl"); - /** - * {@link LRUCache.OptionsBase.ttlResolution} - */ - __publicField(this, "ttlResolution"); - /** - * {@link LRUCache.OptionsBase.ttlAutopurge} - */ - __publicField(this, "ttlAutopurge"); - /** - * {@link LRUCache.OptionsBase.updateAgeOnGet} - */ - __publicField(this, "updateAgeOnGet"); - /** - * {@link LRUCache.OptionsBase.updateAgeOnHas} - */ - __publicField(this, "updateAgeOnHas"); - /** - * {@link LRUCache.OptionsBase.allowStale} - */ - __publicField(this, "allowStale"); - /** - * {@link LRUCache.OptionsBase.noDisposeOnSet} - */ - __publicField(this, "noDisposeOnSet"); - /** - * {@link LRUCache.OptionsBase.noUpdateTTL} - */ - __publicField(this, "noUpdateTTL"); - /** - * {@link LRUCache.OptionsBase.maxEntrySize} - */ - __publicField(this, "maxEntrySize"); - /** - * {@link LRUCache.OptionsBase.sizeCalculation} - */ - __publicField(this, "sizeCalculation"); - /** - * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} - */ - __publicField(this, "noDeleteOnFetchRejection"); - /** - * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} - */ - __publicField(this, "noDeleteOnStaleGet"); - /** - * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} - */ - __publicField(this, "allowStaleOnFetchAbort"); - /** - * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} - */ - __publicField(this, "allowStaleOnFetchRejection"); - /** - * {@link LRUCache.OptionsBase.ignoreFetchAbort} - */ - __publicField(this, "ignoreFetchAbort"); - // computed properties - __privateAdd(this, _size2); - __privateAdd(this, _calculatedSize); - __privateAdd(this, _keyMap); - __privateAdd(this, _keyList); - __privateAdd(this, _valList); - __privateAdd(this, _next); - __privateAdd(this, _prev); - __privateAdd(this, _head); - __privateAdd(this, _tail); - __privateAdd(this, _free); - __privateAdd(this, _disposed); - __privateAdd(this, _sizes); - __privateAdd(this, _starts); - __privateAdd(this, _ttls); - __privateAdd(this, _hasDispose); - __privateAdd(this, _hasFetchMethod); - __privateAdd(this, _hasDisposeAfter); - // conditionally set private methods related to TTL - __privateAdd(this, _updateItemAge, /* @__PURE__ */ __name(() => { - }, "#updateItemAge")); - __privateAdd(this, _statusTTL, /* @__PURE__ */ __name(() => { - }, "#statusTTL")); - __privateAdd(this, _setItemTTL, /* @__PURE__ */ __name(() => { - }, "#setItemTTL")); - /* c8 ignore stop */ - __privateAdd(this, _isStale, /* @__PURE__ */ __name(() => false, "#isStale")); - __privateAdd(this, _removeItemSize, /* @__PURE__ */ __name((_i) => { - }, "#removeItemSize")); - __privateAdd(this, _addItemSize, /* @__PURE__ */ __name((_i, _s, _st) => { - }, "#addItemSize")); - __privateAdd(this, _requireSize, /* @__PURE__ */ __name((_k, _v, size, sizeCalculation) => { - if (size || sizeCalculation) { - throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache"); - } - return 0; - }, "#requireSize")); - const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort } = options; - if (max !== 0 && !isPosInt(max)) { - throw new TypeError("max option must be a nonnegative integer"); - } - const UintArray = max ? getUintArray(max) : Array; - if (!UintArray) { - throw new Error("invalid max value: " + max); - } - __privateSet(this, _max, max); - __privateSet(this, _maxSize, maxSize); - this.maxEntrySize = maxEntrySize || __privateGet(this, _maxSize); - this.sizeCalculation = sizeCalculation; - if (this.sizeCalculation) { - if (!__privateGet(this, _maxSize) && !this.maxEntrySize) { - throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize"); - } - if (typeof this.sizeCalculation !== "function") { - throw new TypeError("sizeCalculation set to non-function"); - } - } - if (fetchMethod !== void 0 && typeof fetchMethod !== "function") { - throw new TypeError("fetchMethod must be a function if specified"); - } - __privateSet(this, _fetchMethod, fetchMethod); - __privateSet(this, _hasFetchMethod, !!fetchMethod); - __privateSet(this, _keyMap, /* @__PURE__ */ new Map()); - __privateSet(this, _keyList, new Array(max).fill(void 0)); - __privateSet(this, _valList, new Array(max).fill(void 0)); - __privateSet(this, _next, new UintArray(max)); - __privateSet(this, _prev, new UintArray(max)); - __privateSet(this, _head, 0); - __privateSet(this, _tail, 0); - __privateSet(this, _free, Stack.create(max)); - __privateSet(this, _size2, 0); - __privateSet(this, _calculatedSize, 0); - if (typeof dispose === "function") { - __privateSet(this, _dispose, dispose); - } - if (typeof disposeAfter === "function") { - __privateSet(this, _disposeAfter, disposeAfter); - __privateSet(this, _disposed, []); - } else { - __privateSet(this, _disposeAfter, void 0); - __privateSet(this, _disposed, void 0); - } - __privateSet(this, _hasDispose, !!__privateGet(this, _dispose)); - __privateSet(this, _hasDisposeAfter, !!__privateGet(this, _disposeAfter)); - this.noDisposeOnSet = !!noDisposeOnSet; - this.noUpdateTTL = !!noUpdateTTL; - this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection; - this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection; - this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort; - this.ignoreFetchAbort = !!ignoreFetchAbort; - if (this.maxEntrySize !== 0) { - if (__privateGet(this, _maxSize) !== 0) { - if (!isPosInt(__privateGet(this, _maxSize))) { - throw new TypeError("maxSize must be a positive integer if specified"); - } - } - if (!isPosInt(this.maxEntrySize)) { - throw new TypeError("maxEntrySize must be a positive integer if specified"); - } - __privateMethod(this, _LRUCache_instances, initializeSizeTracking_fn).call(this); - } - this.allowStale = !!allowStale; - this.noDeleteOnStaleGet = !!noDeleteOnStaleGet; - this.updateAgeOnGet = !!updateAgeOnGet; - this.updateAgeOnHas = !!updateAgeOnHas; - this.ttlResolution = isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1; - this.ttlAutopurge = !!ttlAutopurge; - this.ttl = ttl || 0; - if (this.ttl) { - if (!isPosInt(this.ttl)) { - throw new TypeError("ttl must be a positive integer if specified"); - } - __privateMethod(this, _LRUCache_instances, initializeTTLTracking_fn).call(this); - } - if (__privateGet(this, _max) === 0 && this.ttl === 0 && __privateGet(this, _maxSize) === 0) { - throw new TypeError("At least one of max, maxSize, or ttl is required"); - } - if (!this.ttlAutopurge && !__privateGet(this, _max) && !__privateGet(this, _maxSize)) { - const code = "LRU_CACHE_UNBOUNDED"; - if (shouldWarn(code)) { - warned.add(code); - const msg = "TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption."; - emitWarning(msg, "UnboundedCacheWarning", code, _LRUCache); - } - } - } - /** - * Do not call this method unless you need to inspect the - * inner workings of the cache. If anything returned by this - * object is modified in any way, strange breakage may occur. - * - * These fields are private for a reason! - * - * @internal - */ - static unsafeExposeInternals(c) { - return { - // properties - starts: __privateGet(c, _starts), - ttls: __privateGet(c, _ttls), - sizes: __privateGet(c, _sizes), - keyMap: __privateGet(c, _keyMap), - keyList: __privateGet(c, _keyList), - valList: __privateGet(c, _valList), - next: __privateGet(c, _next), - prev: __privateGet(c, _prev), - get head() { - return __privateGet(c, _head); - }, - get tail() { - return __privateGet(c, _tail); - }, - free: __privateGet(c, _free), - // methods - isBackgroundFetch: /* @__PURE__ */ __name((p) => { - var _a4; - return __privateMethod(_a4 = c, _LRUCache_instances, isBackgroundFetch_fn).call(_a4, p); - }, "isBackgroundFetch"), - backgroundFetch: /* @__PURE__ */ __name((k, index, options, context) => { - var _a4; - return __privateMethod(_a4 = c, _LRUCache_instances, backgroundFetch_fn).call(_a4, k, index, options, context); - }, "backgroundFetch"), - moveToTail: /* @__PURE__ */ __name((index) => { - var _a4; - return __privateMethod(_a4 = c, _LRUCache_instances, moveToTail_fn).call(_a4, index); - }, "moveToTail"), - indexes: /* @__PURE__ */ __name((options) => { - var _a4; - return __privateMethod(_a4 = c, _LRUCache_instances, indexes_fn).call(_a4, options); - }, "indexes"), - rindexes: /* @__PURE__ */ __name((options) => { - var _a4; - return __privateMethod(_a4 = c, _LRUCache_instances, rindexes_fn).call(_a4, options); - }, "rindexes"), - isStale: /* @__PURE__ */ __name((index) => { - var _a4; - return __privateGet(_a4 = c, _isStale).call(_a4, index); - }, "isStale") - }; - } - // Protected read-only members - /** - * {@link LRUCache.OptionsBase.max} (read-only) - */ - get max() { - return __privateGet(this, _max); - } - /** - * {@link LRUCache.OptionsBase.maxSize} (read-only) - */ - get maxSize() { - return __privateGet(this, _maxSize); - } - /** - * The total computed size of items in the cache (read-only) - */ - get calculatedSize() { - return __privateGet(this, _calculatedSize); - } - /** - * The number of items stored in the cache (read-only) - */ - get size() { - return __privateGet(this, _size2); - } - /** - * {@link LRUCache.OptionsBase.fetchMethod} (read-only) - */ - get fetchMethod() { - return __privateGet(this, _fetchMethod); - } - /** - * {@link LRUCache.OptionsBase.dispose} (read-only) - */ - get dispose() { - return __privateGet(this, _dispose); - } - /** - * {@link LRUCache.OptionsBase.disposeAfter} (read-only) - */ - get disposeAfter() { - return __privateGet(this, _disposeAfter); - } - /** - * Return the remaining TTL time for a given entry key - */ - getRemainingTTL(key) { - return __privateGet(this, _keyMap).has(key) ? Infinity : 0; - } - /** - * Return a generator yielding `[key, value]` pairs, - * in order from most recently used to least recently used. - */ - *entries() { - for (const i2 of __privateMethod(this, _LRUCache_instances, indexes_fn).call(this)) { - if (__privateGet(this, _valList)[i2] !== void 0 && __privateGet(this, _keyList)[i2] !== void 0 && !__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, __privateGet(this, _valList)[i2])) { - yield [__privateGet(this, _keyList)[i2], __privateGet(this, _valList)[i2]]; - } - } - } - /** - * Inverse order version of {@link LRUCache.entries} - * - * Return a generator yielding `[key, value]` pairs, - * in order from least recently used to most recently used. - */ - *rentries() { - for (const i2 of __privateMethod(this, _LRUCache_instances, rindexes_fn).call(this)) { - if (__privateGet(this, _valList)[i2] !== void 0 && __privateGet(this, _keyList)[i2] !== void 0 && !__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, __privateGet(this, _valList)[i2])) { - yield [__privateGet(this, _keyList)[i2], __privateGet(this, _valList)[i2]]; - } - } - } - /** - * Return a generator yielding the keys in the cache, - * in order from most recently used to least recently used. - */ - *keys() { - for (const i2 of __privateMethod(this, _LRUCache_instances, indexes_fn).call(this)) { - const k = __privateGet(this, _keyList)[i2]; - if (k !== void 0 && !__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, __privateGet(this, _valList)[i2])) { - yield k; - } - } - } - /** - * Inverse order version of {@link LRUCache.keys} - * - * Return a generator yielding the keys in the cache, - * in order from least recently used to most recently used. - */ - *rkeys() { - for (const i2 of __privateMethod(this, _LRUCache_instances, rindexes_fn).call(this)) { - const k = __privateGet(this, _keyList)[i2]; - if (k !== void 0 && !__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, __privateGet(this, _valList)[i2])) { - yield k; - } - } - } - /** - * Return a generator yielding the values in the cache, - * in order from most recently used to least recently used. - */ - *values() { - for (const i2 of __privateMethod(this, _LRUCache_instances, indexes_fn).call(this)) { - const v = __privateGet(this, _valList)[i2]; - if (v !== void 0 && !__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, __privateGet(this, _valList)[i2])) { - yield __privateGet(this, _valList)[i2]; - } - } - } - /** - * Inverse order version of {@link LRUCache.values} - * - * Return a generator yielding the values in the cache, - * in order from least recently used to most recently used. - */ - *rvalues() { - for (const i2 of __privateMethod(this, _LRUCache_instances, rindexes_fn).call(this)) { - const v = __privateGet(this, _valList)[i2]; - if (v !== void 0 && !__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, __privateGet(this, _valList)[i2])) { - yield __privateGet(this, _valList)[i2]; - } - } - } - /** - * Iterating over the cache itself yields the same results as - * {@link LRUCache.entries} - */ - [Symbol.iterator]() { - return this.entries(); - } - /** - * Find a value for which the supplied fn method returns a truthy value, - * similar to Array.find(). fn is called as fn(value, key, cache). - */ - find(fn, getOptions = {}) { - for (const i2 of __privateMethod(this, _LRUCache_instances, indexes_fn).call(this)) { - const v = __privateGet(this, _valList)[i2]; - const value = __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v) ? v.__staleWhileFetching : v; - if (value === void 0) - continue; - if (fn(value, __privateGet(this, _keyList)[i2], this)) { - return this.get(__privateGet(this, _keyList)[i2], getOptions); - } - } - } - /** - * Call the supplied function on each item in the cache, in order from - * most recently used to least recently used. fn is called as - * fn(value, key, cache). Does not update age or recenty of use. - * Does not iterate over stale values. - */ - forEach(fn, thisp = this) { - for (const i2 of __privateMethod(this, _LRUCache_instances, indexes_fn).call(this)) { - const v = __privateGet(this, _valList)[i2]; - const value = __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v) ? v.__staleWhileFetching : v; - if (value === void 0) - continue; - fn.call(thisp, value, __privateGet(this, _keyList)[i2], this); - } - } - /** - * The same as {@link LRUCache.forEach} but items are iterated over in - * reverse order. (ie, less recently used items are iterated over first.) - */ - rforEach(fn, thisp = this) { - for (const i2 of __privateMethod(this, _LRUCache_instances, rindexes_fn).call(this)) { - const v = __privateGet(this, _valList)[i2]; - const value = __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v) ? v.__staleWhileFetching : v; - if (value === void 0) - continue; - fn.call(thisp, value, __privateGet(this, _keyList)[i2], this); - } - } - /** - * Delete any stale entries. Returns true if anything was removed, - * false otherwise. - */ - purgeStale() { - let deleted = false; - for (const i2 of __privateMethod(this, _LRUCache_instances, rindexes_fn).call(this, { allowStale: true })) { - if (__privateGet(this, _isStale).call(this, i2)) { - this.delete(__privateGet(this, _keyList)[i2]); - deleted = true; - } - } - return deleted; - } - /** - * Return an array of [key, {@link LRUCache.Entry}] tuples which can be - * passed to cache.load() - */ - dump() { - const arr = []; - for (const i2 of __privateMethod(this, _LRUCache_instances, indexes_fn).call(this, { allowStale: true })) { - const key = __privateGet(this, _keyList)[i2]; - const v = __privateGet(this, _valList)[i2]; - const value = __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v) ? v.__staleWhileFetching : v; - if (value === void 0 || key === void 0) - continue; - const entry = { value }; - if (__privateGet(this, _ttls) && __privateGet(this, _starts)) { - entry.ttl = __privateGet(this, _ttls)[i2]; - const age = perf.now() - __privateGet(this, _starts)[i2]; - entry.start = Math.floor(Date.now() - age); - } - if (__privateGet(this, _sizes)) { - entry.size = __privateGet(this, _sizes)[i2]; - } - arr.unshift([key, entry]); - } - return arr; - } - /** - * Reset the cache and load in the items in entries in the order listed. - * Note that the shape of the resulting cache may be different if the - * same options are not used in both caches. - */ - load(arr) { - this.clear(); - for (const [key, entry] of arr) { - if (entry.start) { - const age = Date.now() - entry.start; - entry.start = perf.now() - age; - } - this.set(key, entry.value, entry); - } - } - /** - * Add a value to the cache. - */ - set(k, v, setOptions = {}) { - var _a4, _b, _c; - const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status } = setOptions; - let { noUpdateTTL = this.noUpdateTTL } = setOptions; - const size = __privateGet(this, _requireSize).call(this, k, v, setOptions.size || 0, sizeCalculation); - if (this.maxEntrySize && size > this.maxEntrySize) { - if (status) { - status.set = "miss"; - status.maxEntrySizeExceeded = true; - } - this.delete(k); - return this; - } - let index = __privateGet(this, _size2) === 0 ? void 0 : __privateGet(this, _keyMap).get(k); - if (index === void 0) { - index = __privateGet(this, _size2) === 0 ? __privateGet(this, _tail) : __privateGet(this, _free).length !== 0 ? __privateGet(this, _free).pop() : __privateGet(this, _size2) === __privateGet(this, _max) ? __privateMethod(this, _LRUCache_instances, evict_fn).call(this, false) : __privateGet(this, _size2); - __privateGet(this, _keyList)[index] = k; - __privateGet(this, _valList)[index] = v; - __privateGet(this, _keyMap).set(k, index); - __privateGet(this, _next)[__privateGet(this, _tail)] = index; - __privateGet(this, _prev)[index] = __privateGet(this, _tail); - __privateSet(this, _tail, index); - __privateWrapper(this, _size2)._++; - __privateGet(this, _addItemSize).call(this, index, size, status); - if (status) - status.set = "add"; - noUpdateTTL = false; - } else { - __privateMethod(this, _LRUCache_instances, moveToTail_fn).call(this, index); - const oldVal = __privateGet(this, _valList)[index]; - if (v !== oldVal) { - if (__privateGet(this, _hasFetchMethod) && __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, oldVal)) { - oldVal.__abortController.abort(new Error("replaced")); - } else if (!noDisposeOnSet) { - if (__privateGet(this, _hasDispose)) { - (_a4 = __privateGet(this, _dispose)) == null ? void 0 : _a4.call(this, oldVal, k, "set"); - } - if (__privateGet(this, _hasDisposeAfter)) { - (_b = __privateGet(this, _disposed)) == null ? void 0 : _b.push([oldVal, k, "set"]); - } - } - __privateGet(this, _removeItemSize).call(this, index); - __privateGet(this, _addItemSize).call(this, index, size, status); - __privateGet(this, _valList)[index] = v; - if (status) { - status.set = "replace"; - const oldValue = oldVal && __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, oldVal) ? oldVal.__staleWhileFetching : oldVal; - if (oldValue !== void 0) - status.oldValue = oldValue; - } - } else if (status) { - status.set = "update"; - } - } - if (ttl !== 0 && !__privateGet(this, _ttls)) { - __privateMethod(this, _LRUCache_instances, initializeTTLTracking_fn).call(this); - } - if (__privateGet(this, _ttls)) { - if (!noUpdateTTL) { - __privateGet(this, _setItemTTL).call(this, index, ttl, start); - } - if (status) - __privateGet(this, _statusTTL).call(this, status, index); - } - if (!noDisposeOnSet && __privateGet(this, _hasDisposeAfter) && __privateGet(this, _disposed)) { - const dt = __privateGet(this, _disposed); - let task; - while (task = dt == null ? void 0 : dt.shift()) { - (_c = __privateGet(this, _disposeAfter)) == null ? void 0 : _c.call(this, ...task); - } - } - return this; - } - /** - * Evict the least recently used item, returning its value or - * `undefined` if cache is empty. - */ - pop() { - var _a4; - try { - while (__privateGet(this, _size2)) { - const val = __privateGet(this, _valList)[__privateGet(this, _head)]; - __privateMethod(this, _LRUCache_instances, evict_fn).call(this, true); - if (__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, val)) { - if (val.__staleWhileFetching) { - return val.__staleWhileFetching; - } - } else if (val !== void 0) { - return val; - } - } - } finally { - if (__privateGet(this, _hasDisposeAfter) && __privateGet(this, _disposed)) { - const dt = __privateGet(this, _disposed); - let task; - while (task = dt == null ? void 0 : dt.shift()) { - (_a4 = __privateGet(this, _disposeAfter)) == null ? void 0 : _a4.call(this, ...task); - } - } - } - } - /** - * Check if a key is in the cache, without updating the recency of use. - * Will return false if the item is stale, even though it is technically - * in the cache. - * - * Will not update item age unless - * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. - */ - has(k, hasOptions = {}) { - const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions; - const index = __privateGet(this, _keyMap).get(k); - if (index !== void 0) { - const v = __privateGet(this, _valList)[index]; - if (__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v) && v.__staleWhileFetching === void 0) { - return false; - } - if (!__privateGet(this, _isStale).call(this, index)) { - if (updateAgeOnHas) { - __privateGet(this, _updateItemAge).call(this, index); - } - if (status) { - status.has = "hit"; - __privateGet(this, _statusTTL).call(this, status, index); - } - return true; - } else if (status) { - status.has = "stale"; - __privateGet(this, _statusTTL).call(this, status, index); - } - } else if (status) { - status.has = "miss"; - } - return false; - } - /** - * Like {@link LRUCache#get} but doesn't update recency or delete stale - * items. - * - * Returns `undefined` if the item is stale, unless - * {@link LRUCache.OptionsBase.allowStale} is set. - */ - peek(k, peekOptions = {}) { - const { allowStale = this.allowStale } = peekOptions; - const index = __privateGet(this, _keyMap).get(k); - if (index !== void 0 && (allowStale || !__privateGet(this, _isStale).call(this, index))) { - const v = __privateGet(this, _valList)[index]; - return __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v) ? v.__staleWhileFetching : v; - } - } - async fetch(k, fetchOptions = {}) { - const { - // get options - allowStale = this.allowStale, - updateAgeOnGet = this.updateAgeOnGet, - noDeleteOnStaleGet = this.noDeleteOnStaleGet, - // set options - ttl = this.ttl, - noDisposeOnSet = this.noDisposeOnSet, - size = 0, - sizeCalculation = this.sizeCalculation, - noUpdateTTL = this.noUpdateTTL, - // fetch exclusive options - noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, - allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, - ignoreFetchAbort = this.ignoreFetchAbort, - allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, - context, - forceRefresh = false, - status, - signal - } = fetchOptions; - if (!__privateGet(this, _hasFetchMethod)) { - if (status) - status.fetch = "get"; - return this.get(k, { - allowStale, - updateAgeOnGet, - noDeleteOnStaleGet, - status - }); - } - const options = { - allowStale, - updateAgeOnGet, - noDeleteOnStaleGet, - ttl, - noDisposeOnSet, - size, - sizeCalculation, - noUpdateTTL, - noDeleteOnFetchRejection, - allowStaleOnFetchRejection, - allowStaleOnFetchAbort, - ignoreFetchAbort, - status, - signal - }; - let index = __privateGet(this, _keyMap).get(k); - if (index === void 0) { - if (status) - status.fetch = "miss"; - const p = __privateMethod(this, _LRUCache_instances, backgroundFetch_fn).call(this, k, index, options, context); - return p.__returned = p; - } else { - const v = __privateGet(this, _valList)[index]; - if (__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v)) { - const stale = allowStale && v.__staleWhileFetching !== void 0; - if (status) { - status.fetch = "inflight"; - if (stale) - status.returnedStale = true; - } - return stale ? v.__staleWhileFetching : v.__returned = v; - } - const isStale = __privateGet(this, _isStale).call(this, index); - if (!forceRefresh && !isStale) { - if (status) - status.fetch = "hit"; - __privateMethod(this, _LRUCache_instances, moveToTail_fn).call(this, index); - if (updateAgeOnGet) { - __privateGet(this, _updateItemAge).call(this, index); - } - if (status) - __privateGet(this, _statusTTL).call(this, status, index); - return v; - } - const p = __privateMethod(this, _LRUCache_instances, backgroundFetch_fn).call(this, k, index, options, context); - const hasStale = p.__staleWhileFetching !== void 0; - const staleVal = hasStale && allowStale; - if (status) { - status.fetch = isStale ? "stale" : "refresh"; - if (staleVal && isStale) - status.returnedStale = true; - } - return staleVal ? p.__staleWhileFetching : p.__returned = p; - } - } - /** - * Return a value from the cache. Will update the recency of the cache - * entry found. - * - * If the key is not found, get() will return `undefined`. - */ - get(k, getOptions = {}) { - const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status } = getOptions; - const index = __privateGet(this, _keyMap).get(k); - if (index !== void 0) { - const value = __privateGet(this, _valList)[index]; - const fetching = __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, value); - if (status) - __privateGet(this, _statusTTL).call(this, status, index); - if (__privateGet(this, _isStale).call(this, index)) { - if (status) - status.get = "stale"; - if (!fetching) { - if (!noDeleteOnStaleGet) { - this.delete(k); - } - if (status && allowStale) - status.returnedStale = true; - return allowStale ? value : void 0; - } else { - if (status && allowStale && value.__staleWhileFetching !== void 0) { - status.returnedStale = true; - } - return allowStale ? value.__staleWhileFetching : void 0; - } - } else { - if (status) - status.get = "hit"; - if (fetching) { - return value.__staleWhileFetching; - } - __privateMethod(this, _LRUCache_instances, moveToTail_fn).call(this, index); - if (updateAgeOnGet) { - __privateGet(this, _updateItemAge).call(this, index); - } - return value; - } - } else if (status) { - status.get = "miss"; - } - } - /** - * Deletes a key out of the cache. - * Returns true if the key was deleted, false otherwise. - */ - delete(k) { - var _a4, _b, _c, _d2; - let deleted = false; - if (__privateGet(this, _size2) !== 0) { - const index = __privateGet(this, _keyMap).get(k); - if (index !== void 0) { - deleted = true; - if (__privateGet(this, _size2) === 1) { - this.clear(); - } else { - __privateGet(this, _removeItemSize).call(this, index); - const v = __privateGet(this, _valList)[index]; - if (__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v)) { - v.__abortController.abort(new Error("deleted")); - } else if (__privateGet(this, _hasDispose) || __privateGet(this, _hasDisposeAfter)) { - if (__privateGet(this, _hasDispose)) { - (_a4 = __privateGet(this, _dispose)) == null ? void 0 : _a4.call(this, v, k, "delete"); - } - if (__privateGet(this, _hasDisposeAfter)) { - (_b = __privateGet(this, _disposed)) == null ? void 0 : _b.push([v, k, "delete"]); - } - } - __privateGet(this, _keyMap).delete(k); - __privateGet(this, _keyList)[index] = void 0; - __privateGet(this, _valList)[index] = void 0; - if (index === __privateGet(this, _tail)) { - __privateSet(this, _tail, __privateGet(this, _prev)[index]); - } else if (index === __privateGet(this, _head)) { - __privateSet(this, _head, __privateGet(this, _next)[index]); - } else { - __privateGet(this, _next)[__privateGet(this, _prev)[index]] = __privateGet(this, _next)[index]; - __privateGet(this, _prev)[__privateGet(this, _next)[index]] = __privateGet(this, _prev)[index]; - } - __privateWrapper(this, _size2)._--; - __privateGet(this, _free).push(index); - } - } - } - if (__privateGet(this, _hasDisposeAfter) && ((_c = __privateGet(this, _disposed)) == null ? void 0 : _c.length)) { - const dt = __privateGet(this, _disposed); - let task; - while (task = dt == null ? void 0 : dt.shift()) { - (_d2 = __privateGet(this, _disposeAfter)) == null ? void 0 : _d2.call(this, ...task); - } - } - return deleted; - } - /** - * Clear the cache entirely, throwing away all values. - */ - clear() { - var _a4, _b, _c; - for (const index of __privateMethod(this, _LRUCache_instances, rindexes_fn).call(this, { allowStale: true })) { - const v = __privateGet(this, _valList)[index]; - if (__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v)) { - v.__abortController.abort(new Error("deleted")); - } else { - const k = __privateGet(this, _keyList)[index]; - if (__privateGet(this, _hasDispose)) { - (_a4 = __privateGet(this, _dispose)) == null ? void 0 : _a4.call(this, v, k, "delete"); - } - if (__privateGet(this, _hasDisposeAfter)) { - (_b = __privateGet(this, _disposed)) == null ? void 0 : _b.push([v, k, "delete"]); - } - } - } - __privateGet(this, _keyMap).clear(); - __privateGet(this, _valList).fill(void 0); - __privateGet(this, _keyList).fill(void 0); - if (__privateGet(this, _ttls) && __privateGet(this, _starts)) { - __privateGet(this, _ttls).fill(0); - __privateGet(this, _starts).fill(0); + this._list[i2 = i2 - 1 + len & this._capacityMask] = void 0; + del_count--; } - if (__privateGet(this, _sizes)) { - __privateGet(this, _sizes).fill(0); + if (index < 0) this._tail = i2; + } else { + this._tail = i2; + i2 = i2 + count + len & this._capacityMask; + for (k = size - (count + index); k > 0; k--) { + this.push(this._list[i2++]); } - __privateSet(this, _head, 0); - __privateSet(this, _tail, 0); - __privateGet(this, _free).length = 0; - __privateSet(this, _calculatedSize, 0); - __privateSet(this, _size2, 0); - if (__privateGet(this, _hasDisposeAfter) && __privateGet(this, _disposed)) { - const dt = __privateGet(this, _disposed); - let task; - while (task = dt == null ? void 0 : dt.shift()) { - (_c = __privateGet(this, _disposeAfter)) == null ? void 0 : _c.call(this, ...task); - } + i2 = this._tail; + while (del_count > 0) { + this._list[i2 = i2 + 1 + len & this._capacityMask] = void 0; + del_count--; } } - }; - _max = new WeakMap(); - _maxSize = new WeakMap(); - _dispose = new WeakMap(); - _disposeAfter = new WeakMap(); - _fetchMethod = new WeakMap(); - _size2 = new WeakMap(); - _calculatedSize = new WeakMap(); - _keyMap = new WeakMap(); - _keyList = new WeakMap(); - _valList = new WeakMap(); - _next = new WeakMap(); - _prev = new WeakMap(); - _head = new WeakMap(); - _tail = new WeakMap(); - _free = new WeakMap(); - _disposed = new WeakMap(); - _sizes = new WeakMap(); - _starts = new WeakMap(); - _ttls = new WeakMap(); - _hasDispose = new WeakMap(); - _hasFetchMethod = new WeakMap(); - _hasDisposeAfter = new WeakMap(); - _LRUCache_instances = new WeakSet(); - initializeTTLTracking_fn = /* @__PURE__ */ __name(function() { - const ttls = new ZeroArray(__privateGet(this, _max)); - const starts = new ZeroArray(__privateGet(this, _max)); - __privateSet(this, _ttls, ttls); - __privateSet(this, _starts, starts); - __privateSet(this, _setItemTTL, (index, ttl, start = perf.now()) => { - starts[index] = ttl !== 0 ? start : 0; - ttls[index] = ttl; - if (ttl !== 0 && this.ttlAutopurge) { - const t2 = setTimeout(() => { - if (__privateGet(this, _isStale).call(this, index)) { - this.delete(__privateGet(this, _keyList)[index]); - } - }, ttl + 1); - if (t2.unref) { - t2.unref(); + if (this._head < 2 && this._tail > 1e4 && this._tail <= len >>> 2) this._shrinkArray(); + return removed; + }, "remove"); + Denque.prototype.splice = /* @__PURE__ */ __name(function splice(index, count) { + var i2 = index; + if (i2 !== (i2 | 0)) { + return void 0; + } + var size = this.size(); + if (i2 < 0) i2 += size; + if (i2 > size) return void 0; + if (arguments.length > 2) { + var k; + var temp; + var removed; + var arg_len = arguments.length; + var len = this._list.length; + var arguments_index = 2; + if (!size || i2 < size / 2) { + temp = new Array(i2); + for (k = 0; k < i2; k++) { + temp[k] = this._list[this._head + k & this._capacityMask]; } - } - }); - __privateSet(this, _updateItemAge, (index) => { - starts[index] = ttls[index] !== 0 ? perf.now() : 0; - }); - __privateSet(this, _statusTTL, (status, index) => { - if (ttls[index]) { - const ttl = ttls[index]; - const start = starts[index]; - status.ttl = ttl; - status.start = start; - status.now = cachedNow || getNow(); - status.remainingTTL = status.now + ttl - start; - } - }); - let cachedNow = 0; - const getNow = /* @__PURE__ */ __name(() => { - const n = perf.now(); - if (this.ttlResolution > 0) { - cachedNow = n; - const t2 = setTimeout(() => cachedNow = 0, this.ttlResolution); - if (t2.unref) { - t2.unref(); - } - } - return n; - }, "getNow"); - this.getRemainingTTL = (key) => { - const index = __privateGet(this, _keyMap).get(key); - if (index === void 0) { - return 0; - } - return ttls[index] === 0 || starts[index] === 0 ? Infinity : starts[index] + ttls[index] - (cachedNow || getNow()); - }; - __privateSet(this, _isStale, (index) => { - return ttls[index] !== 0 && starts[index] !== 0 && (cachedNow || getNow()) - starts[index] > ttls[index]; - }); - }, "#initializeTTLTracking"); - _updateItemAge = new WeakMap(); - _statusTTL = new WeakMap(); - _setItemTTL = new WeakMap(); - _isStale = new WeakMap(); - initializeSizeTracking_fn = /* @__PURE__ */ __name(function() { - const sizes = new ZeroArray(__privateGet(this, _max)); - __privateSet(this, _calculatedSize, 0); - __privateSet(this, _sizes, sizes); - __privateSet(this, _removeItemSize, (index) => { - __privateSet(this, _calculatedSize, __privateGet(this, _calculatedSize) - sizes[index]); - sizes[index] = 0; - }); - __privateSet(this, _requireSize, (k, v, size, sizeCalculation) => { - if (__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v)) { - return 0; - } - if (!isPosInt(size)) { - if (sizeCalculation) { - if (typeof sizeCalculation !== "function") { - throw new TypeError("sizeCalculation must be a function"); - } - size = sizeCalculation(v, k); - if (!isPosInt(size)) { - throw new TypeError("sizeCalculation return invalid (expect positive integer)"); + if (count === 0) { + removed = []; + if (i2 > 0) { + this._head = this._head + i2 + len & this._capacityMask; } } else { - throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set."); + removed = this.remove(i2, count); + this._head = this._head + i2 + len & this._capacityMask; } - } - return size; - }); - __privateSet(this, _addItemSize, (index, size, status) => { - sizes[index] = size; - if (__privateGet(this, _maxSize)) { - const maxSize = __privateGet(this, _maxSize) - sizes[index]; - while (__privateGet(this, _calculatedSize) > maxSize) { - __privateMethod(this, _LRUCache_instances, evict_fn).call(this, true); + while (arg_len > arguments_index) { + this.unshift(arguments[--arg_len]); } - } - __privateSet(this, _calculatedSize, __privateGet(this, _calculatedSize) + sizes[index]); - if (status) { - status.entrySize = size; - status.totalCalculatedSize = __privateGet(this, _calculatedSize); - } - }); - }, "#initializeSizeTracking"); - _removeItemSize = new WeakMap(); - _addItemSize = new WeakMap(); - _requireSize = new WeakMap(); - indexes_fn = /* @__PURE__ */ __name(function* ({ allowStale = this.allowStale } = {}) { - if (__privateGet(this, _size2)) { - for (let i2 = __privateGet(this, _tail); true; ) { - if (!__privateMethod(this, _LRUCache_instances, isValidIndex_fn).call(this, i2)) { - break; + for (k = i2; k > 0; k--) { + this.unshift(temp[k - 1]); } - if (allowStale || !__privateGet(this, _isStale).call(this, i2)) { - yield i2; + } else { + temp = new Array(size - (i2 + count)); + var leng = temp.length; + for (k = 0; k < leng; k++) { + temp[k] = this._list[this._head + i2 + count + k & this._capacityMask]; } - if (i2 === __privateGet(this, _head)) { - break; + if (count === 0) { + removed = []; + if (i2 != size) { + this._tail = this._head + i2 + len & this._capacityMask; + } } else { - i2 = __privateGet(this, _prev)[i2]; - } - } - } - }, "#indexes"); - rindexes_fn = /* @__PURE__ */ __name(function* ({ allowStale = this.allowStale } = {}) { - if (__privateGet(this, _size2)) { - for (let i2 = __privateGet(this, _head); true; ) { - if (!__privateMethod(this, _LRUCache_instances, isValidIndex_fn).call(this, i2)) { - break; + removed = this.remove(i2, count); + this._tail = this._tail - leng + len & this._capacityMask; } - if (allowStale || !__privateGet(this, _isStale).call(this, i2)) { - yield i2; + while (arguments_index < arg_len) { + this.push(arguments[arguments_index++]); } - if (i2 === __privateGet(this, _tail)) { - break; - } else { - i2 = __privateGet(this, _next)[i2]; - } - } - } - }, "#rindexes"); - isValidIndex_fn = /* @__PURE__ */ __name(function(index) { - return index !== void 0 && __privateGet(this, _keyMap).get(__privateGet(this, _keyList)[index]) === index; - }, "#isValidIndex"); - evict_fn = /* @__PURE__ */ __name(function(free) { - var _a4, _b; - const head = __privateGet(this, _head); - const k = __privateGet(this, _keyList)[head]; - const v = __privateGet(this, _valList)[head]; - if (__privateGet(this, _hasFetchMethod) && __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v)) { - v.__abortController.abort(new Error("evicted")); - } else if (__privateGet(this, _hasDispose) || __privateGet(this, _hasDisposeAfter)) { - if (__privateGet(this, _hasDispose)) { - (_a4 = __privateGet(this, _dispose)) == null ? void 0 : _a4.call(this, v, k, "evict"); - } - if (__privateGet(this, _hasDisposeAfter)) { - (_b = __privateGet(this, _disposed)) == null ? void 0 : _b.push([v, k, "evict"]); - } - } - __privateGet(this, _removeItemSize).call(this, head); - if (free) { - __privateGet(this, _keyList)[head] = void 0; - __privateGet(this, _valList)[head] = void 0; - __privateGet(this, _free).push(head); - } - if (__privateGet(this, _size2) === 1) { - __privateSet(this, _head, __privateSet(this, _tail, 0)); - __privateGet(this, _free).length = 0; - } else { - __privateSet(this, _head, __privateGet(this, _next)[head]); - } - __privateGet(this, _keyMap).delete(k); - __privateWrapper(this, _size2)._--; - return head; - }, "#evict"); - backgroundFetch_fn = /* @__PURE__ */ __name(function(k, index, options, context) { - const v = index === void 0 ? void 0 : __privateGet(this, _valList)[index]; - if (__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v)) { - return v; - } - const ac = new AbortController(); - const { signal } = options; - signal == null ? void 0 : signal.addEventListener("abort", () => ac.abort(signal.reason), { - signal: ac.signal - }); - const fetchOpts = { - signal: ac.signal, - options, - context - }; - const cb = /* @__PURE__ */ __name((v2, updateCache = false) => { - const { aborted } = ac.signal; - const ignoreAbort = options.ignoreFetchAbort && v2 !== void 0; - if (options.status) { - if (aborted && !updateCache) { - options.status.fetchAborted = true; - options.status.fetchError = ac.signal.reason; - if (ignoreAbort) - options.status.fetchAbortIgnored = true; - } else { - options.status.fetchResolved = true; + for (k = 0; k < leng; k++) { + this.push(temp[k]); } } - if (aborted && !ignoreAbort && !updateCache) { - return fetchFail(ac.signal.reason); - } - const bf2 = p; - if (__privateGet(this, _valList)[index] === p) { - if (v2 === void 0) { - if (bf2.__staleWhileFetching) { - __privateGet(this, _valList)[index] = bf2.__staleWhileFetching; - } else { - this.delete(k); - } - } else { - if (options.status) - options.status.fetchUpdated = true; - this.set(k, v2, fetchOpts.options); - } - } - return v2; - }, "cb"); - const eb = /* @__PURE__ */ __name((er) => { - if (options.status) { - options.status.fetchRejected = true; - options.status.fetchError = er; - } - return fetchFail(er); - }, "eb"); - const fetchFail = /* @__PURE__ */ __name((er) => { - const { aborted } = ac.signal; - const allowStaleAborted = aborted && options.allowStaleOnFetchAbort; - const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection; - const noDelete = allowStale || options.noDeleteOnFetchRejection; - const bf2 = p; - if (__privateGet(this, _valList)[index] === p) { - const del = !noDelete || bf2.__staleWhileFetching === void 0; - if (del) { - this.delete(k); - } else if (!allowStaleAborted) { - __privateGet(this, _valList)[index] = bf2.__staleWhileFetching; - } - } - if (allowStale) { - if (options.status && bf2.__staleWhileFetching !== void 0) { - options.status.returnedStale = true; - } - return bf2.__staleWhileFetching; - } else if (bf2.__returned === bf2) { - throw er; - } - }, "fetchFail"); - const pcall = /* @__PURE__ */ __name((res, rej) => { - var _a4; - const fmp = (_a4 = __privateGet(this, _fetchMethod)) == null ? void 0 : _a4.call(this, k, v, fetchOpts); - if (fmp && fmp instanceof Promise) { - fmp.then((v2) => res(v2), rej); - } - ac.signal.addEventListener("abort", () => { - if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) { - res(); - if (options.allowStaleOnFetchAbort) { - res = /* @__PURE__ */ __name((v2) => cb(v2, true), "res"); - } - } - }); - }, "pcall"); - if (options.status) - options.status.fetchDispatched = true; - const p = new Promise(pcall).then(cb, eb); - const bf = Object.assign(p, { - __abortController: ac, - __staleWhileFetching: v, - __returned: void 0 - }); - if (index === void 0) { - this.set(k, bf, { ...fetchOpts.options, status: void 0 }); - index = __privateGet(this, _keyMap).get(k); + return removed; } else { - __privateGet(this, _valList)[index] = bf; + return this.remove(i2, count); } - return bf; - }, "#backgroundFetch"); - isBackgroundFetch_fn = /* @__PURE__ */ __name(function(p) { - if (!__privateGet(this, _hasFetchMethod)) - return false; - const b = p; - return !!b && b instanceof Promise && b.hasOwnProperty("__staleWhileFetching") && b.__abortController instanceof AbortController; - }, "#isBackgroundFetch"); - connect_fn = /* @__PURE__ */ __name(function(p, n) { - __privateGet(this, _prev)[n] = p; - __privateGet(this, _next)[p] = n; - }, "#connect"); - moveToTail_fn = /* @__PURE__ */ __name(function(index) { - if (index !== __privateGet(this, _tail)) { - if (index === __privateGet(this, _head)) { - __privateSet(this, _head, __privateGet(this, _next)[index]); - } else { - __privateMethod(this, _LRUCache_instances, connect_fn).call(this, __privateGet(this, _prev)[index], __privateGet(this, _next)[index]); - } - __privateMethod(this, _LRUCache_instances, connect_fn).call(this, __privateGet(this, _tail), index); - __privateSet(this, _tail, index); + }, "splice"); + Denque.prototype.clear = /* @__PURE__ */ __name(function clear() { + this._list = new Array(this._list.length); + this._head = 0; + this._tail = 0; + }, "clear"); + Denque.prototype.isEmpty = /* @__PURE__ */ __name(function isEmpty() { + return this._head === this._tail; + }, "isEmpty"); + Denque.prototype.toArray = /* @__PURE__ */ __name(function toArray() { + return this._copyArray(false); + }, "toArray"); + Denque.prototype._fromArray = /* @__PURE__ */ __name(function _fromArray(array) { + var length = array.length; + var capacity = this._nextPowerOf2(length); + this._list = new Array(capacity); + this._capacityMask = capacity - 1; + this._tail = length; + for (var i2 = 0; i2 < length; i2++) this._list[i2] = array[i2]; + }, "_fromArray"); + Denque.prototype._copyArray = /* @__PURE__ */ __name(function _copyArray(fullCopy, size) { + var src = this._list; + var capacity = src.length; + var length = this.length; + size = size | length; + if (size == length && this._head < this._tail) { + return this._list.slice(this._head, this._tail); } - }, "#moveToTail"); - __name(_LRUCache, "LRUCache"); - var LRUCache = _LRUCache; - exports2.LRUCache = LRUCache; - exports2.default = LRUCache; + var dest = new Array(size); + var k = 0; + var i2; + if (fullCopy || this._head > this._tail) { + for (i2 = this._head; i2 < capacity; i2++) dest[k++] = src[i2]; + for (i2 = 0; i2 < this._tail; i2++) dest[k++] = src[i2]; + } else { + for (i2 = this._head; i2 < this._tail; i2++) dest[k++] = src[i2]; + } + return dest; + }, "_copyArray"); + Denque.prototype._growArray = /* @__PURE__ */ __name(function _growArray() { + if (this._head != 0) { + var newList = this._copyArray(true, this._list.length << 1); + this._tail = this._list.length; + this._head = 0; + this._list = newList; + } else { + this._tail = this._list.length; + this._list.length <<= 1; + } + this._capacityMask = this._capacityMask << 1 | 1; + }, "_growArray"); + Denque.prototype._shrinkArray = /* @__PURE__ */ __name(function _shrinkArray() { + this._list.length >>>= 1; + this._capacityMask >>>= 1; + }, "_shrinkArray"); + Denque.prototype._nextPowerOf2 = /* @__PURE__ */ __name(function _nextPowerOf2(num) { + var log2 = Math.log(num) / Math.log(2); + var nextPow2 = 1 << log2 + 1; + return Math.max(nextPow2, 4); + }, "_nextPowerOf2"); + module2.exports = Denque; } }); -// node_modules/.pnpm/lru-cache@8.0.5/node_modules/lru-cache/dist/cjs/index-cjs.js -var require_index_cjs = __commonJS({ - "node_modules/.pnpm/lru-cache@8.0.5/node_modules/lru-cache/dist/cjs/index-cjs.js"(exports2, module2) { +// node_modules/.pnpm/lru.min@1.1.1/node_modules/lru.min/lib/index.js +var require_lib = __commonJS({ + "node_modules/.pnpm/lru.min@1.1.1/node_modules/lru.min/lib/index.js"(exports2) { "use strict"; - var __importDefault = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - var index_js_1 = __importDefault(require_cjs()); - module2.exports = Object.assign(index_js_1.default, { default: index_js_1.default, LRUCache: index_js_1.default }); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.createLRU = void 0; + var createLRU = /* @__PURE__ */ __name((options) => { + let { max, onEviction } = options; + if (!(Number.isInteger(max) && max > 0)) + throw new TypeError("`max` must be a positive integer"); + let size = 0; + let head = 0; + let tail = 0; + let free = []; + const keyMap = /* @__PURE__ */ new Map(); + const keyList = new Array(max).fill(void 0); + const valList = new Array(max).fill(void 0); + const next = new Array(max).fill(0); + const prev = new Array(max).fill(0); + const setTail = /* @__PURE__ */ __name((index, type) => { + if (index === tail) + return; + const nextIndex = next[index]; + const prevIndex = prev[index]; + if (index === head) + head = nextIndex; + else if (type === "get" || prevIndex !== 0) + next[prevIndex] = nextIndex; + if (nextIndex !== 0) + prev[nextIndex] = prevIndex; + next[tail] = index; + prev[index] = tail; + next[index] = 0; + tail = index; + }, "setTail"); + const _evict = /* @__PURE__ */ __name(() => { + const evictHead = head; + const key = keyList[evictHead]; + onEviction === null || onEviction === void 0 ? void 0 : onEviction(key, valList[evictHead]); + keyMap.delete(key); + keyList[evictHead] = void 0; + valList[evictHead] = void 0; + head = next[evictHead]; + if (head !== 0) + prev[head] = 0; + size--; + if (size === 0) + head = tail = 0; + free.push(evictHead); + return evictHead; + }, "_evict"); + return { + /** Adds a key-value pair to the cache. Updates the value if the key already exists. */ + set(key, value) { + if (key === void 0) + return; + let index = keyMap.get(key); + if (index === void 0) { + index = size === max ? _evict() : free.length > 0 ? free.pop() : size; + keyMap.set(key, index); + keyList[index] = key; + size++; + } else + onEviction === null || onEviction === void 0 ? void 0 : onEviction(key, valList[index]); + valList[index] = value; + if (size === 1) + head = tail = index; + else + setTail(index, "set"); + }, + /** Retrieves the value for a given key and moves the key to the most recent position. */ + get(key) { + const index = keyMap.get(key); + if (index === void 0) + return; + if (index !== tail) + setTail(index, "get"); + return valList[index]; + }, + /** Retrieves the value for a given key without changing its position. */ + peek: /* @__PURE__ */ __name((key) => { + const index = keyMap.get(key); + return index !== void 0 ? valList[index] : void 0; + }, "peek"), + /** Checks if a key exists in the cache. */ + has: /* @__PURE__ */ __name((key) => keyMap.has(key), "has"), + /** Iterates over all keys in the cache, from most recent to least recent. */ + *keys() { + let current = tail; + for (let i2 = 0; i2 < size; i2++) { + yield keyList[current]; + current = prev[current]; + } + }, + /** Iterates over all values in the cache, from most recent to least recent. */ + *values() { + let current = tail; + for (let i2 = 0; i2 < size; i2++) { + yield valList[current]; + current = prev[current]; + } + }, + /** Iterates over `[key, value]` pairs in the cache, from most recent to least recent. */ + *entries() { + let current = tail; + for (let i2 = 0; i2 < size; i2++) { + yield [keyList[current], valList[current]]; + current = prev[current]; + } + }, + /** Iterates over each value-key pair in the cache, from most recent to least recent. */ + forEach: /* @__PURE__ */ __name((callback) => { + let current = tail; + for (let i2 = 0; i2 < size; i2++) { + const key = keyList[current]; + const value = valList[current]; + callback(value, key); + current = prev[current]; + } + }, "forEach"), + /** Deletes a key-value pair from the cache. */ + delete(key) { + const index = keyMap.get(key); + if (index === void 0) + return false; + onEviction === null || onEviction === void 0 ? void 0 : onEviction(key, valList[index]); + keyMap.delete(key); + free.push(index); + keyList[index] = void 0; + valList[index] = void 0; + const prevIndex = prev[index]; + const nextIndex = next[index]; + if (prevIndex !== 0) + next[prevIndex] = nextIndex; + if (nextIndex !== 0) + prev[nextIndex] = prevIndex; + if (index === head) + head = nextIndex; + if (index === tail) + tail = prevIndex; + size--; + return true; + }, + /** Evicts the oldest item or the specified number of the oldest items from the cache. */ + evict: /* @__PURE__ */ __name((number) => { + let toPrune = Math.min(number, size); + while (toPrune > 0) { + _evict(); + toPrune--; + } + }, "evict"), + /** Clears all key-value pairs from the cache. */ + clear() { + if (typeof onEviction === "function") { + const iterator = keyMap.values(); + for (let result = iterator.next(); !result.done; result = iterator.next()) + onEviction(keyList[result.value], valList[result.value]); + } + keyMap.clear(); + keyList.fill(void 0); + valList.fill(void 0); + free = []; + size = 0; + head = tail = 0; + }, + /** Resizes the cache to a new maximum size, evicting items if necessary. */ + resize: /* @__PURE__ */ __name((newMax) => { + if (!(Number.isInteger(newMax) && newMax > 0)) + throw new TypeError("`max` must be a positive integer"); + if (newMax === max) + return; + if (newMax < max) { + let current = tail; + const preserve = Math.min(size, newMax); + const remove = size - preserve; + const newKeyList = new Array(newMax); + const newValList = new Array(newMax); + const newNext = new Array(newMax); + const newPrev = new Array(newMax); + for (let i2 = 1; i2 <= remove; i2++) + onEviction === null || onEviction === void 0 ? void 0 : onEviction(keyList[i2], valList[i2]); + for (let i2 = preserve - 1; i2 >= 0; i2--) { + newKeyList[i2] = keyList[current]; + newValList[i2] = valList[current]; + newNext[i2] = i2 + 1; + newPrev[i2] = i2 - 1; + keyMap.set(newKeyList[i2], i2); + current = prev[current]; + } + head = 0; + tail = preserve - 1; + size = preserve; + keyList.length = newMax; + valList.length = newMax; + next.length = newMax; + prev.length = newMax; + for (let i2 = 0; i2 < preserve; i2++) { + keyList[i2] = newKeyList[i2]; + valList[i2] = newValList[i2]; + next[i2] = newNext[i2]; + prev[i2] = newPrev[i2]; + } + free = []; + for (let i2 = preserve; i2 < newMax; i2++) + free.push(i2); + } else { + const fill = newMax - max; + keyList.push(...new Array(fill).fill(void 0)); + valList.push(...new Array(fill).fill(void 0)); + next.push(...new Array(fill).fill(0)); + prev.push(...new Array(fill).fill(0)); + } + max = newMax; + }, "resize"), + /** Returns the maximum number of items that can be stored in the cache. */ + get max() { + return max; + }, + /** Returns the number of items currently stored in the cache. */ + get size() { + return size; + }, + /** Returns the number of currently available slots in the cache before reaching the maximum size. */ + get available() { + return max - size; + } + }; + }, "createLRU"); + exports2.createLRU = createLRU; } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/constants/errors.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/constants/errors.js var require_errors = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/constants/errors.js"(exports2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/constants/errors.js"(exports2) { "use strict"; exports2.EE_CANTCREATEFILE = 1; exports2.EE_READ = 2; @@ -11097,7 +10058,7 @@ var require_streams = __commonJS({ }); // node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/lib/index.js -var require_lib = __commonJS({ +var require_lib2 = __commonJS({ "node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/lib/index.js"(exports2, module2) { "use strict"; var Buffer4 = require_safer().Buffer; @@ -11216,13 +10177,13 @@ var require_lib = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/parsers/string.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/parsers/string.js var require_string = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/parsers/string.js"(exports2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/parsers/string.js"(exports2) { "use strict"; - var Iconv = require_lib(); - var LRU = require_index_cjs().default; - var decoderCache = new LRU({ + var Iconv = require_lib2(); + var { createLRU } = require_lib(); + var decoderCache = createLRU({ max: 500 }); exports2.decode = function(buffer, encoding, start, end, options) { @@ -11261,9 +10222,9 @@ var require_string = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/packet.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/packet.js var require_packet = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/packet.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/packet.js"(exports2, module2) { "use strict"; var ErrorCodeToName = require_errors(); var NativeBuffer = require("buffer").Buffer; @@ -12048,9 +11009,9 @@ var require_packet = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packet_parser.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packet_parser.js var require_packet_parser = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packet_parser.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packet_parser.js"(exports2, module2) { "use strict"; var Packet = require_packet(); var MAX_PACKET_LENGTH = 16777215; @@ -12218,9 +11179,9 @@ var require_packet_parser = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/auth_next_factor.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/auth_next_factor.js var require_auth_next_factor = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/auth_next_factor.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/auth_next_factor.js"(exports2, module2) { "use strict"; var Packet = require_packet(); var _AuthNextFactor = class _AuthNextFactor { @@ -12254,9 +11215,9 @@ var require_auth_next_factor = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/auth_switch_request.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/auth_switch_request.js var require_auth_switch_request = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/auth_switch_request.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/auth_switch_request.js"(exports2, module2) { "use strict"; var Packet = require_packet(); var _AuthSwitchRequest = class _AuthSwitchRequest { @@ -12290,9 +11251,9 @@ var require_auth_switch_request = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/auth_switch_request_more_data.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/auth_switch_request_more_data.js var require_auth_switch_request_more_data = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/auth_switch_request_more_data.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/auth_switch_request_more_data.js"(exports2, module2) { "use strict"; var Packet = require_packet(); var _AuthSwitchRequestMoreData = class _AuthSwitchRequestMoreData { @@ -12323,9 +11284,9 @@ var require_auth_switch_request_more_data = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/auth_switch_response.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/auth_switch_response.js var require_auth_switch_response = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/auth_switch_response.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/auth_switch_response.js"(exports2, module2) { "use strict"; var Packet = require_packet(); var _AuthSwitchResponse = class _AuthSwitchResponse { @@ -12354,9 +11315,9 @@ var require_auth_switch_response = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/constants/types.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/constants/types.js var require_types = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/constants/types.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/constants/types.js"(exports2, module2) { "use strict"; module2.exports = { 0: "DECIMAL", @@ -12447,9 +11408,9 @@ var require_types = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/binary_row.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/binary_row.js var require_binary_row = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/binary_row.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/binary_row.js"(exports2, module2) { "use strict"; var Types = require_types(); var Packet = require_packet(); @@ -12535,9 +11496,9 @@ var require_binary_row = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/constants/commands.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/constants/commands.js var require_commands = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/constants/commands.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/constants/commands.js"(exports2, module2) { "use strict"; module2.exports = { SLEEP: 0, @@ -12583,9 +11544,9 @@ var require_commands = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/binlog_dump.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/binlog_dump.js var require_binlog_dump = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/binlog_dump.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/binlog_dump.js"(exports2, module2) { "use strict"; var Packet = require_packet(); var CommandCodes = require_commands(); @@ -12615,9 +11576,9 @@ var require_binlog_dump = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/constants/client.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/constants/client.js var require_client = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/constants/client.js"(exports2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/constants/client.js"(exports2) { "use strict"; exports2.LONG_PASSWORD = 1; exports2.FOUND_ROWS = 2; @@ -12650,9 +11611,9 @@ var require_client = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/auth_41.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/auth_41.js var require_auth_41 = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/auth_41.js"(exports2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/auth_41.js"(exports2) { "use strict"; var crypto = require("crypto"); function sha1(msg, msg1, msg2) { @@ -12713,9 +11674,9 @@ var require_auth_41 = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/constants/charset_encodings.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/constants/charset_encodings.js var require_charset_encodings = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/constants/charset_encodings.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/constants/charset_encodings.js"(exports2, module2) { "use strict"; module2.exports = [ "utf8", @@ -13031,9 +11992,9 @@ var require_charset_encodings = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/change_user.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/change_user.js var require_change_user = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/change_user.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/change_user.js"(exports2, module2) { "use strict"; var CommandCode = require_commands(); var ClientConstants = require_client(); @@ -13128,9 +12089,9 @@ var require_change_user = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/close_statement.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/close_statement.js var require_close_statement = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/close_statement.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/close_statement.js"(exports2, module2) { "use strict"; var Packet = require_packet(); var CommandCodes = require_commands(); @@ -13153,9 +12114,9 @@ var require_close_statement = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/constants/field_flags.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/constants/field_flags.js var require_field_flags = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/constants/field_flags.js"(exports2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/constants/field_flags.js"(exports2) { "use strict"; exports2.NOT_NULL = 1; exports2.PRI_KEY = 2; @@ -13175,9 +12136,9 @@ var require_field_flags = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/column_definition.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/column_definition.js var require_column_definition = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/column_definition.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/column_definition.js"(exports2, module2) { "use strict"; var Packet = require_packet(); var StringParser = require_string(); @@ -13420,9 +12381,9 @@ var require_column_definition = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/constants/cursor.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/constants/cursor.js var require_cursor = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/constants/cursor.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/constants/cursor.js"(exports2, module2) { "use strict"; module2.exports = { NO_CURSOR: 0, @@ -13433,9 +12394,9 @@ var require_cursor = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/execute.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/execute.js var require_execute = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/execute.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/execute.js"(exports2, module2) { "use strict"; var CursorType = require_cursor(); var CommandCodes = require_commands(); @@ -13603,9 +12564,9 @@ var require_execute = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/handshake.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/handshake.js var require_handshake = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/handshake.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/handshake.js"(exports2, module2) { "use strict"; var Packet = require_packet(); var ClientConstants = require_client(); @@ -13707,9 +12668,9 @@ var require_handshake = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/handshake_response.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/handshake_response.js var require_handshake_response = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/handshake_response.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/handshake_response.js"(exports2, module2) { "use strict"; var ClientConstants = require_client(); var CharsetToEncoding = require_charset_encodings(); @@ -13850,9 +12811,9 @@ var require_handshake_response = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/prepare_statement.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/prepare_statement.js var require_prepare_statement = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/prepare_statement.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/prepare_statement.js"(exports2, module2) { "use strict"; var Packet = require_packet(); var CommandCodes = require_commands(); @@ -13881,9 +12842,9 @@ var require_prepare_statement = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/prepared_statement_header.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/prepared_statement_header.js var require_prepared_statement_header = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/prepared_statement_header.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/prepared_statement_header.js"(exports2, module2) { "use strict"; var _PreparedStatementHeader = class _PreparedStatementHeader { constructor(packet) { @@ -13901,9 +12862,9 @@ var require_prepared_statement_header = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/query.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/query.js var require_query = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/query.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/query.js"(exports2, module2) { "use strict"; var Packet = require_packet(); var CommandCode = require_commands(); @@ -13932,9 +12893,9 @@ var require_query = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/register_slave.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/register_slave.js var require_register_slave = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/register_slave.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/register_slave.js"(exports2, module2) { "use strict"; var Packet = require_packet(); var CommandCodes = require_commands(); @@ -13974,9 +12935,9 @@ var require_register_slave = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/constants/server_status.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/constants/server_status.js var require_server_status = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/constants/server_status.js"(exports2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/constants/server_status.js"(exports2) { "use strict"; exports2.SERVER_STATUS_IN_TRANS = 1; exports2.SERVER_STATUS_AUTOCOMMIT = 2; @@ -13995,9 +12956,9 @@ var require_server_status = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/constants/encoding_charset.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/constants/encoding_charset.js var require_encoding_charset = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/constants/encoding_charset.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/constants/encoding_charset.js"(exports2, module2) { "use strict"; module2.exports = { big5: 1, @@ -14046,9 +13007,9 @@ var require_encoding_charset = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/constants/session_track.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/constants/session_track.js var require_session_track = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/constants/session_track.js"(exports2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/constants/session_track.js"(exports2) { "use strict"; exports2.SYSTEM_VARIABLES = 0; exports2.SCHEMA = 1; @@ -14061,9 +13022,9 @@ var require_session_track = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/resultset_header.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/resultset_header.js var require_resultset_header = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/resultset_header.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/resultset_header.js"(exports2, module2) { "use strict"; var Packet = require_packet(); var ClientConstants = require_client(); @@ -14173,9 +13134,9 @@ var require_resultset_header = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/ssl_request.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/ssl_request.js var require_ssl_request = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/ssl_request.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/ssl_request.js"(exports2, module2) { "use strict"; var ClientConstants = require_client(); var Packet = require_packet(); @@ -14202,9 +13163,9 @@ var require_ssl_request = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/text_row.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/text_row.js var require_text_row = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/text_row.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/text_row.js"(exports2, module2) { "use strict"; var Packet = require_packet(); var _TextRow = class _TextRow { @@ -14251,9 +13212,9 @@ var require_text_row = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/index.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/index.js var require_packets = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/index.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/index.js"(exports2, module2) { "use strict"; var process2 = require("process"); var AuthNextFactor = require_auth_next_factor(); @@ -14387,9 +13348,9 @@ var require_packets = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/commands/command.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/commands/command.js var require_command = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/commands/command.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/commands/command.js"(exports2, module2) { "use strict"; var EventEmitter = require("events").EventEmitter; var Timers = require("timers"); @@ -14443,9 +13404,9 @@ var require_command = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/auth_plugins/sha256_password.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/auth_plugins/sha256_password.js var require_sha256_password = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/auth_plugins/sha256_password.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/auth_plugins/sha256_password.js"(exports2, module2) { "use strict"; var PLUGIN_NAME = "sha256_password"; var crypto = require("crypto"); @@ -14498,9 +13459,9 @@ var require_sha256_password = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/auth_plugins/caching_sha2_password.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/auth_plugins/caching_sha2_password.js var require_caching_sha2_password = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/auth_plugins/caching_sha2_password.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/auth_plugins/caching_sha2_password.js"(exports2, module2) { "use strict"; var PLUGIN_NAME = "caching_sha2_password"; var crypto = require("crypto"); @@ -14592,9 +13553,9 @@ var require_caching_sha2_password = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/auth_plugins/mysql_native_password.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/auth_plugins/mysql_native_password.js var require_mysql_native_password = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/auth_plugins/mysql_native_password.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/auth_plugins/mysql_native_password.js"(exports2, module2) { "use strict"; var auth41 = require_auth_41(); module2.exports = (pluginOptions) => ({ connection, command }) => { @@ -14623,9 +13584,9 @@ var require_mysql_native_password = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/auth_plugins/mysql_clear_password.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/auth_plugins/mysql_clear_password.js var require_mysql_clear_password = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/auth_plugins/mysql_clear_password.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/auth_plugins/mysql_clear_password.js"(exports2, module2) { "use strict"; function bufferFromStr(str) { return Buffer.from(`${str}\0`); @@ -14641,9 +13602,9 @@ var require_mysql_clear_password = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/commands/auth_switch.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/commands/auth_switch.js var require_auth_switch = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/commands/auth_switch.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/commands/auth_switch.js"(exports2, module2) { "use strict"; var Packets = require_packets(); var sha256_password = require_sha256_password(); @@ -14857,9 +13818,9 @@ var require_seq_queue2 = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/compressed_protocol.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/compressed_protocol.js var require_compressed_protocol = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/compressed_protocol.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/compressed_protocol.js"(exports2, module2) { "use strict"; var zlib2 = require("zlib"); var PacketParser = require_packet_parser(); @@ -14962,9 +13923,9 @@ var require_compressed_protocol = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/commands/client_handshake.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/commands/client_handshake.js var require_client_handshake = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/commands/client_handshake.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/commands/client_handshake.js"(exports2, module2) { "use strict"; var Command = require_command(); var Packets = require_packets(); @@ -15151,9 +14112,9 @@ var require_client_handshake = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/commands/server_handshake.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/commands/server_handshake.js var require_server_handshake = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/commands/server_handshake.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/commands/server_handshake.js"(exports2, module2) { "use strict"; var CommandCode = require_commands(); var Errors = require_errors(); @@ -15303,9 +14264,9 @@ var require_server_handshake = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/constants/charsets.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/constants/charsets.js var require_charsets = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/constants/charsets.js"(exports2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/constants/charsets.js"(exports2) { "use strict"; exports2.BIG5_CHINESE_CI = 1; exports2.LATIN2_CZECH_CS = 2; @@ -15623,9 +14584,9 @@ var require_charsets = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/helpers.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/helpers.js var require_helpers = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/helpers.js"(exports2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/helpers.js"(exports2) { "use strict"; function srcEscape(str) { return JSON.stringify({ @@ -15857,12 +14818,12 @@ var require_generate_function = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/parsers/parser_cache.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/parsers/parser_cache.js var require_parser_cache = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/parsers/parser_cache.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/parsers/parser_cache.js"(exports2, module2) { "use strict"; - var LRU = require_index_cjs().default; - var parserCache = new LRU({ + var { createLRU } = require_lib(); + var parserCache = createLRU({ max: 15e3 }); function keyFromFields(type, fields, options, config) { @@ -15905,7 +14866,7 @@ var require_parser_cache = __commonJS({ } __name(getParser, "getParser"); function setMaxCache(max) { - parserCache = new LRU({ max }); + parserCache.resize(max); } __name(setMaxCache, "setMaxCache"); function clearCache() { @@ -15921,9 +14882,9 @@ var require_parser_cache = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/parsers/text_parser.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/parsers/text_parser.js var require_text_parser = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/parsers/text_parser.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/parsers/text_parser.js"(exports2, module2) { "use strict"; var Types = require_types(); var Charsets = require_charsets(); @@ -16109,9 +15070,9 @@ var require_text_parser = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/commands/query.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/commands/query.js var require_query2 = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/commands/query.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/commands/query.js"(exports2, module2) { "use strict"; var process2 = require("process"); var Timers = require("timers"); @@ -16402,9 +15363,9 @@ var require_query2 = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/commands/close_statement.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/commands/close_statement.js var require_close_statement2 = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/commands/close_statement.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/commands/close_statement.js"(exports2, module2) { "use strict"; var Command = require_command(); var Packets = require_packets(); @@ -16424,9 +15385,9 @@ var require_close_statement2 = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/parsers/binary_parser.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/parsers/binary_parser.js var require_binary_parser = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/parsers/binary_parser.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/parsers/binary_parser.js"(exports2, module2) { "use strict"; var FieldFlags = require_field_flags(); var Charsets = require_charsets(); @@ -16621,9 +15582,9 @@ var require_binary_parser = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/commands/execute.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/commands/execute.js var require_execute2 = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/commands/execute.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/commands/execute.js"(exports2, module2) { "use strict"; var Command = require_command(); var Query = require_query2(); @@ -16714,9 +15675,9 @@ var require_execute2 = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/commands/prepare.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/commands/prepare.js var require_prepare = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/commands/prepare.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/commands/prepare.js"(exports2, module2) { "use strict"; var Packets = require_packets(); var Command = require_command(); @@ -16850,9 +15811,9 @@ var require_prepare = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/commands/ping.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/commands/ping.js var require_ping = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/commands/ping.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/commands/ping.js"(exports2, module2) { "use strict"; var Command = require_command(); var CommandCode = require_commands(); @@ -16885,9 +15846,9 @@ var require_ping = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/commands/register_slave.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/commands/register_slave.js var require_register_slave2 = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/commands/register_slave.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/commands/register_slave.js"(exports2, module2) { "use strict"; var Command = require_command(); var Packets = require_packets(); @@ -16915,9 +15876,9 @@ var require_register_slave2 = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/binlog_query_statusvars.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/binlog_query_statusvars.js var require_binlog_query_statusvars = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/packets/binlog_query_statusvars.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/packets/binlog_query_statusvars.js"(exports2, module2) { "use strict"; var keys = { FLAGS2: 0, @@ -17027,9 +15988,9 @@ var require_binlog_query_statusvars = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/commands/binlog_dump.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/commands/binlog_dump.js var require_binlog_dump2 = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/commands/binlog_dump.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/commands/binlog_dump.js"(exports2, module2) { "use strict"; var Command = require_command(); var Packets = require_packets(); @@ -17136,9 +16097,9 @@ var require_binlog_dump2 = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/commands/change_user.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/commands/change_user.js var require_change_user2 = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/commands/change_user.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/commands/change_user.js"(exports2, module2) { "use strict"; var Command = require_command(); var Packets = require_packets(); @@ -17193,9 +16154,9 @@ var require_change_user2 = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/commands/quit.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/commands/quit.js var require_quit = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/commands/quit.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/commands/quit.js"(exports2, module2) { "use strict"; var Command = require_command(); var CommandCode = require_commands(); @@ -17226,9 +16187,9 @@ var require_quit = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/commands/index.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/commands/index.js var require_commands2 = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/commands/index.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/commands/index.js"(exports2, module2) { "use strict"; var ClientHandshake = require_client_handshake(); var ServerHandshake = require_server_handshake(); @@ -17257,12 +16218,12 @@ var require_commands2 = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/package.json +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/package.json var require_package = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/package.json"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/package.json"(exports2, module2) { module2.exports = { name: "mysql2", - version: "3.11.0", + version: "3.11.3", description: "fast mysql driver. Implements core protocol, prepared statements, ssl and compression in native JS", main: "index.js", typings: "typings/mysql/index", @@ -17325,13 +16286,13 @@ var require_package = __commonJS({ "generate-function": "^2.3.1", "iconv-lite": "^0.6.3", long: "^5.2.1", - "lru-cache": "^8.0.0", + "lru.min": "^1.0.0", "named-placeholders": "^1.1.3", "seq-queue": "^0.0.5", sqlstring: "^2.3.2" }, devDependencies: { - "@types/node": "^20.0.0", + "@types/node": "^22.0.0", "@typescript-eslint/eslint-plugin": "^5.42.1", "@typescript-eslint/parser": "^5.42.1", "assert-diff": "^3.0.2", @@ -17353,9 +16314,9 @@ var require_package = __commonJS({ } }); -// node_modules/.pnpm/aws-ssl-profiles@1.1.1/node_modules/aws-ssl-profiles/lib/profiles/ca/defaults.js +// node_modules/.pnpm/aws-ssl-profiles@1.1.2/node_modules/aws-ssl-profiles/lib/profiles/ca/defaults.js var require_defaults = __commonJS({ - "node_modules/.pnpm/aws-ssl-profiles@1.1.1/node_modules/aws-ssl-profiles/lib/profiles/ca/defaults.js"(exports2) { + "node_modules/.pnpm/aws-ssl-profiles@1.1.2/node_modules/aws-ssl-profiles/lib/profiles/ca/defaults.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.defaults = void 0; @@ -17479,9 +16440,9 @@ var require_defaults = __commonJS({ } }); -// node_modules/.pnpm/aws-ssl-profiles@1.1.1/node_modules/aws-ssl-profiles/lib/profiles/ca/proxies.js +// node_modules/.pnpm/aws-ssl-profiles@1.1.2/node_modules/aws-ssl-profiles/lib/profiles/ca/proxies.js var require_proxies = __commonJS({ - "node_modules/.pnpm/aws-ssl-profiles@1.1.1/node_modules/aws-ssl-profiles/lib/profiles/ca/proxies.js"(exports2) { + "node_modules/.pnpm/aws-ssl-profiles@1.1.2/node_modules/aws-ssl-profiles/lib/profiles/ca/proxies.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.proxies = void 0; @@ -17495,9 +16456,9 @@ var require_proxies = __commonJS({ } }); -// node_modules/.pnpm/aws-ssl-profiles@1.1.1/node_modules/aws-ssl-profiles/lib/index.js -var require_lib2 = __commonJS({ - "node_modules/.pnpm/aws-ssl-profiles@1.1.1/node_modules/aws-ssl-profiles/lib/index.js"(exports2, module2) { +// node_modules/.pnpm/aws-ssl-profiles@1.1.2/node_modules/aws-ssl-profiles/lib/index.js +var require_lib3 = __commonJS({ + "node_modules/.pnpm/aws-ssl-profiles@1.1.2/node_modules/aws-ssl-profiles/lib/index.js"(exports2, module2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var defaults_js_1 = require_defaults(); @@ -17508,26 +16469,26 @@ var require_lib2 = __commonJS({ var profiles = { ca: [...defaults_js_1.defaults, ...proxies_js_1.proxies] }; - exports2.default = profiles; module2.exports = profiles; module2.exports.proxyBundle = proxyBundle; + module2.exports.default = profiles; } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/constants/ssl_profiles.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/constants/ssl_profiles.js var require_ssl_profiles = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/constants/ssl_profiles.js"(exports2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/constants/ssl_profiles.js"(exports2) { "use strict"; - var awsCaBundle = require_lib2(); + var awsCaBundle = require_lib3(); exports2["Amazon RDS"] = { ca: awsCaBundle.ca }; } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/connection_config.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/connection_config.js var require_connection_config = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/connection_config.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/connection_config.js"(exports2, module2) { "use strict"; var { URL: URL2 } = require("url"); var ClientConstants = require_client(); @@ -17767,9 +16728,9 @@ var require_connection_config = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/connection.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/connection.js var require_connection = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/connection.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/connection.js"(exports2, module2) { "use strict"; var Net = require("net"); var Tls = require("tls"); @@ -17778,7 +16739,7 @@ var require_connection = __commonJS({ var Readable = require("stream").Readable; var Queue = require_denque(); var SqlString = require_sqlstring(); - var LRU = require_index_cjs().default; + var { createLRU } = require_lib(); var PacketParser = require_packet_parser(); var Packets = require_packets(); var Commands = require_commands2(); @@ -17814,11 +16775,11 @@ var require_connection = __commonJS({ this._command = null; this._paused = false; this._paused_packets = new Queue(); - this._statements = new LRU({ + this._statements = createLRU({ max: this.config.maxPreparedStatements, - dispose: /* @__PURE__ */ __name(function(statement) { + onEviction: /* @__PURE__ */ __name(function(_, statement) { statement.close(); - }, "dispose") + }, "onEviction") }); this.serverCapabilityFlags = 0; this.authorized = false; @@ -18531,9 +17492,9 @@ var require_connection = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/pool_connection.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/pool_connection.js var require_pool_connection = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/pool_connection.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/pool_connection.js"(exports2, module2) { "use strict"; var Connection = require_mysql2().Connection; var _PoolConnection = class _PoolConnection extends Connection { @@ -18588,9 +17549,9 @@ var require_pool_connection = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/pool.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/pool.js var require_pool = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/pool.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/pool.js"(exports2, module2) { "use strict"; var process2 = require("process"); var mysql = require_mysql2(); @@ -18768,7 +17729,7 @@ var require_pool = __commonJS({ } this._removeIdleTimeoutConnectionsTimer = setTimeout(() => { try { - while (this._freeConnections.length > this.config.maxIdle && Date.now() - this._freeConnections.get(0).lastActiveTime > this.config.idleTimeout) { + while (this._freeConnections.length > this.config.maxIdle || this._freeConnections.length > 0 && Date.now() - this._freeConnections.get(0).lastActiveTime > this.config.idleTimeout) { this._freeConnections.get(0).destroy(); } } finally { @@ -18801,9 +17762,9 @@ var require_pool = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/pool_config.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/pool_config.js var require_pool_config = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/pool_config.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/pool_config.js"(exports2, module2) { "use strict"; var ConnectionConfig = require_connection_config(); var _PoolConfig = class _PoolConfig { @@ -18825,9 +17786,9 @@ var require_pool_config = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/pool_cluster.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/pool_cluster.js var require_pool_cluster = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/pool_cluster.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/pool_cluster.js"(exports2, module2) { "use strict"; var process2 = require("process"); var Pool = require_pool(); @@ -19079,9 +18040,9 @@ var require_pool_cluster = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/server.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/server.js var require_server = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/server.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/server.js"(exports2, module2) { "use strict"; var net = require("net"); var EventEmitter = require("events").EventEmitter; @@ -19116,9 +18077,9 @@ var require_server = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/auth_plugins/index.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/auth_plugins/index.js var require_auth_plugins = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/lib/auth_plugins/index.js"(exports2, module2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/lib/auth_plugins/index.js"(exports2, module2) { "use strict"; module2.exports = { caching_sha2_password: require_caching_sha2_password(), @@ -19129,9 +18090,9 @@ var require_auth_plugins = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/index.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/index.js var require_mysql2 = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/index.js"(exports2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/index.js"(exports2) { "use strict"; var SqlString = require_sqlstring(); var Connection = require_connection(); @@ -19200,9 +18161,9 @@ var require_mysql2 = __commonJS({ } }); -// node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/promise.js +// node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/promise.js var require_promise = __commonJS({ - "node_modules/.pnpm/mysql2@3.11.0/node_modules/mysql2/promise.js"(exports2) { + "node_modules/.pnpm/mysql2@3.11.3/node_modules/mysql2/promise.js"(exports2) { "use strict"; var core = require_mysql2(); var EventEmitter = require("events").EventEmitter; @@ -19610,10 +18571,10 @@ var require_promise = __commonJS({ this.Promise = thePromise || Promise; inheritEvents(poolCluster, this, ["warn", "remove"]); } - getConnection() { + getConnection(pattern, selector) { const corePoolCluster = this.poolCluster; return new this.Promise((resolve, reject) => { - corePoolCluster.getConnection((err, coreConnection) => { + corePoolCluster.getConnection(pattern, selector, (err, coreConnection) => { if (err) { reject(err); } else { @@ -26728,6 +25689,34 @@ __name(sleep, "sleep"); // src/database/pool.ts var import_promise = __toESM(require_promise(), 1); +var pool; +var dbVersion = ""; +async function createConnectionPool() { + const config = getConnectionOptions(); + try { + const dbPool = (0, import_promise.createPool)(config); + dbPool.on("connection", (connection) => { + connection.query(mysql_transaction_isolation_level); + }); + const [result] = await dbPool.query("SELECT VERSION() as version"); + dbVersion = `^5[${result[0].version}]`; + console.log(`${dbVersion} ^2Database server connection established!^0`); + if (config.multipleStatements) { + console.warn(`multipleStatements is enabled. Used incorrectly, this option may cause SQL injection.`); + } + pool = dbPool; + } catch (err) { + const message = err.message.includes("auth_gssapi_client") ? `Requested authentication using unknown plugin auth_gssapi_client.` : err.message; + console.log( + `^3Unable to establish a connection to the database (${err.code})! +^1Error${err.errno ? ` ${err.errno}` : ""}: ${message}^0` + ); + console.log(`See https://github.com/overextended/oxmysql/issues/154 for more information.`); + if (config.password) config.password = "******"; + console.log(config); + } +} +__name(createConnectionPool, "createConnectionPool"); // src/utils/scheduleTick.ts var resourceName = GetCurrentResourceName(); @@ -26785,71 +25774,34 @@ async function getConnection(connectionId) { } __name(getConnection, "getConnection"); -// src/database/pool.ts -var pool; -var dbVersion = ""; -async function createConnectionPool() { - const config = getConnectionOptions(); - try { - var _stack = []; - try { - pool = (0, import_promise.createPool)(config); - pool.on("connection", (connection) => { - connection.query(mysql_transaction_isolation_level); - }); - const conn = __using(_stack, await getConnection()); - const result = await conn.query("SELECT VERSION() as version"); - dbVersion = `^5[${result[0].version}]`; - console.log(`${dbVersion} ^2Database server connection established!^0`); - if (config.multipleStatements) { - console.warn(`multipleStatements is enabled. Used incorrectly, this option may cause SQL injection. -See https://github.com/overextended/oxmysql/issues/102)`); - } - } catch (_) { - var _error = _, _hasError = true; - } finally { - __callDispose(_stack, _error, _hasError); - } - } catch (err) { - const message = err.message.includes("auth_gssapi_client") ? `Server requests authentication using unknown plugin auth_gssapi_client. -See https://github.com/overextended/oxmysql/issues/213.` : err.message; - console.log( - `^3Unable to establish a connection to the database (${err.code})! -^1Error${err.errno ? ` ${err.errno}` : ""}: ${message}^0` - ); - if (config.password) config.password = "******"; - console.log(config); - } -} -__name(createConnectionPool, "createConnectionPool"); - // src/utils/parseArguments.ts var parseArguments = /* @__PURE__ */ __name((query, parameters) => { + var _a4; if (typeof query !== "string") throw new Error(`Expected query to be a string but received ${typeof query} instead.`); if (convertNamedPlaceholders && parameters && typeof parameters === "object" && !Array.isArray(parameters)) { if (query.includes(":") || query.includes("@")) { - const placeholders = convertNamedPlaceholders(query, parameters); - query = placeholders[0]; - parameters = placeholders[1]; + [query, parameters] = convertNamedPlaceholders(query, parameters); } } if (!parameters || typeof parameters === "function") parameters = []; + const placeholders = ((_a4 = query.match(/\?(?!\?)/g)) == null ? void 0 : _a4.length) ?? 0; if (parameters && !Array.isArray(parameters)) { let arr = []; - Object.entries(parameters).forEach((entry) => arr[parseInt(entry[0]) - 1] = entry[1]); + for (let i2 = 0; i2 < placeholders; i2++) { + arr[i2] = parameters[i2 + 1] ?? null; + } parameters = arr; } else { - const queryParams = query.match(/\?(?!\?)/g); - if (queryParams !== null) { + if (placeholders) { if (parameters.length === 0) { - for (let i2 = 0; i2 < queryParams.length; i2++) parameters[i2] = null; + for (let i2 = 0; i2 < placeholders; i2++) parameters[i2] = null; return [query, parameters]; } - const diff = queryParams.length - parameters.length; + const diff = placeholders - parameters.length; if (diff > 0) { - for (let i2 = 0; i2 < diff; i2++) parameters[queryParams.length + i2] = null; + for (let i2 = 0; i2 < diff; i2++) parameters[placeholders + i2] = null; } else if (diff < 0) { - throw new Error(`Expected ${queryParams.length} parameters, but received ${parameters.length}.`); + throw new Error(`Expected ${placeholders} parameters, but received ${parameters.length}.`); } } } @@ -26880,8 +25832,18 @@ var parseResponse = /* @__PURE__ */ __name((type, result) => { }, "parseResponse"); // src/logger/index.ts +var loggerResource = ""; var loggerService = GetConvar("mysql_logger_service", ""); -var logger = new Function(LoadResourceFile("oxmysql", `logger/${loggerService}.js`))() || (() => { +if (loggerService) { + if (loggerService.startsWith("@")) { + const [resource, ...path] = loggerService.slice(1).split("/"); + if (resource && path) { + loggerResource = resource; + loggerService = path.join("/"); + } + } else loggerService = `logger/${loggerService}`; +} +var logger = loggerService && new Function(LoadResourceFile(loggerResource || GetCurrentResourceName(), `${loggerService}.js`))() || (() => { }); function logError(invokingResource, cb, isPromise, err = "", query, parameters, includeParameters) { const message = typeof err === "object" ? err.message : err.replace(/SCRIPT ERROR: citizen:[\w\/\.]+:\d+[:\s]+/, ""); @@ -26903,7 +25865,13 @@ ${message}`; message, metadata: err }); - if (cb && isPromise) return cb(null, output); + if (cb && isPromise) { + try { + return cb(null, output); + } catch (e2) { + } + return; + } console.error(output); } __name(logError, "logError"); @@ -27407,12 +26375,10 @@ MySQL.insert = (query, parameters, cb, invokingResource = GetInvokingResource(), MySQL.transaction = (queries, parameters, cb, invokingResource = GetInvokingResource(), isPromise) => { rawTransaction(invokingResource, queries, parameters, cb, isPromise); }; -global.exports( - "experimentalTransaction", - async (transactions, cb, invokingResource = GetInvokingResource(), isPromise) => { - return await startTransaction(invokingResource, transactions, cb, isPromise); - } -); +MySQL.startTransaction = (transactions, invokingResource = GetInvokingResource()) => { + console.warn(`MySQL.startTransaction is "experimental" and may receive breaking changes.`); + return startTransaction(invokingResource, transactions, void 0, true); +}; MySQL.prepare = (query, parameters, cb, invokingResource = GetInvokingResource(), isPromise) => { rawExecute(invokingResource, query, parameters, cb, isPromise, true); }; diff --git a/server-data/resources/[ox]/oxmysql/fxmanifest.lua b/server-data/resources/[ox]/oxmysql/fxmanifest.lua index ce33650df..9e8d554a3 100644 --- a/server-data/resources/[ox]/oxmysql/fxmanifest.lua +++ b/server-data/resources/[ox]/oxmysql/fxmanifest.lua @@ -5,7 +5,7 @@ lua54 'yes' name 'oxmysql' author 'Overextended' -version '2.11.2' +version '2.12.0' license 'LGPL-3.0-or-later' repository 'https://github.com/overextended/oxmysql.git' description 'FXServer to MySQL communication via node-mysql2' diff --git a/server-data/resources/[ox]/oxmysql/lib/MySQL.lua b/server-data/resources/[ox]/oxmysql/lib/MySQL.lua index e6677e4f7..0de5f20d5 100644 --- a/server-data/resources/[ox]/oxmysql/lib/MySQL.lua +++ b/server-data/resources/[ox]/oxmysql/lib/MySQL.lua @@ -1,17 +1,28 @@ local promise = promise local Await = Citizen.Await -local GetCurrentResourceName = GetCurrentResourceName() +local resourceName = GetCurrentResourceName() local GetResourceState = GetResourceState +local options = { + return_callback_errors = false +} + +for i = 1, GetNumResourceMetadata(resourceName, 'mysql_option') do + local option = GetResourceMetadata(resourceName, 'mysql_option', i - 1) + options[option] = true +end + local function await(fn, query, parameters) local p = promise.new() + fn(nil, query, parameters, function(result, error) if error then return p:reject(error) end p:resolve(result) - end, GetCurrentResourceName, true) + end, resourceName, true) + return Await(p) end @@ -23,6 +34,7 @@ local function safeArgs(query, parameters, cb, transaction) if queryType == 'number' then query = queryStore[query] + assert(query, "First argument received invalid query store reference") elseif transaction then if queryType ~= 'table' then error(("First argument expected table, received '%s'"):format(query)) @@ -60,7 +72,7 @@ local oxmysql = exports.oxmysql local mysql_method_mt = { __call = function(self, query, parameters, cb) query, parameters, cb = safeArgs(query, parameters, cb, self.method == 'transaction') - return oxmysql[self.method](nil, query, parameters, cb, GetCurrentResourceName, false) + return oxmysql[self.method](nil, query, parameters, cb, resourceName, options.return_callback_errors) end } @@ -136,4 +148,8 @@ MySQL.ready = setmetatable({ end, }) +function MySQL.startTransaction(cb) + return oxmysql:startTransaction(cb, resourceName) +end + _ENV.MySQL = MySQL diff --git a/server-data/resources/[ox]/oxmysql/web/build/assets/index-28ac31ac.css b/server-data/resources/[ox]/oxmysql/web/build/assets/index-28ac31ac.css deleted file mode 100644 index 499fa0785..000000000 --- a/server-data/resources/[ox]/oxmysql/web/build/assets/index-28ac31ac.css +++ /dev/null @@ -1 +0,0 @@ -@import"https://use.typekit.net/qgr5ebd.css";*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.visible{visibility:visible}.absolute{position:absolute}.m-4{margin:1rem}.mb-4{margin-bottom:1rem}.mt-0{margin-top:0}.mt-6{margin-top:1.5rem}.flex{display:flex}.table{display:table}.grid{display:grid}.h-\[700px\]{height:700px}.h-full{height:100%}.w-1\/3{width:33.333333%}.w-1\/4{width:25%}.w-12{width:3rem}.w-2\/3{width:66.666667%}.w-3\/4{width:75%}.w-\[1200px\]{width:1200px}.w-full{width:100%}.max-w-\[200px\]{max-width:200px}.max-w-xl{max-width:36rem}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.grid-flow-col{grid-auto-flow:column}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-6{gap:1.5rem}.self-center{align-self:center}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rounded-md{border-radius:.375rem}.border-\[1px\]{border-width:1px}.border-transparent{border-color:transparent}.bg-dark-50{--tw-bg-opacity: 1;background-color:rgb(193 194 197 / var(--tw-bg-opacity))}.bg-dark-600{--tw-bg-opacity: 1;background-color:rgb(37 38 43 / var(--tw-bg-opacity))}.bg-dark-700{--tw-bg-opacity: 1;background-color:rgb(26 27 30 / var(--tw-bg-opacity))}.bg-dark-800{--tw-bg-opacity: 1;background-color:rgb(20 21 23 / var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.px-4{padding-left:1rem;padding-right:1rem}.pb-5{padding-bottom:1.25rem}.pr-0{padding-right:0}.pr-2{padding-right:.5rem}.pr-4{padding-right:1rem}.text-left{text-align:left}.text-center{text-align:center}.text-end{text-align:end}.font-main{font-family:Roboto}.text-2xl{font-size:1.5rem;line-height:2rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.text-dark-100{--tw-text-opacity: 1;color:rgb(166 167 171 / var(--tw-text-opacity))}.text-dark-300{--tw-text-opacity: 1;color:rgb(92 95 102 / var(--tw-text-opacity))}.text-dark-400{--tw-text-opacity: 1;color:rgb(55 58 64 / var(--tw-text-opacity))}.text-dark-50{--tw-text-opacity: 1;color:rgb(193 194 197 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity))}.outline-none{outline:2px solid transparent;outline-offset:2px}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-100{transition-duration:.1s}*{margin:0;padding:0}#app{width:100vw;height:100vh}::-webkit-scrollbar{width:2px}::-webkit-scrollbar-track{background:#25262b}::-webkit-scrollbar-thumb{background:#909296}::-webkit-scrollbar-thumb:hover{background:#a6a7ab}.focus-within\:border-cyan-600:focus-within{--tw-border-opacity: 1;border-color:rgb(8 145 178 / var(--tw-border-opacity))}.hover\:bg-dark-400:hover{--tw-bg-opacity: 1;background-color:rgb(55 58 64 / var(--tw-bg-opacity))}.hover\:bg-dark-500:hover{--tw-bg-opacity: 1;background-color:rgb(44 46 51 / var(--tw-bg-opacity))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.focus-visible\:border-cyan-600:focus-visible{--tw-border-opacity: 1;border-color:rgb(8 145 178 / var(--tw-border-opacity))}.focus-visible\:text-white:focus-visible{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.active\:translate-y-\[3px\]:active{--tw-translate-y: 3px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-dark-300:disabled{--tw-bg-opacity: 1;background-color:rgb(92 95 102 / var(--tw-bg-opacity))}.disabled\:text-dark-400:disabled{--tw-text-opacity: 1;color:rgb(55 58 64 / var(--tw-text-opacity))} diff --git a/server-data/resources/[ox]/oxmysql/web/build/assets/index-37a4a4fa.css b/server-data/resources/[ox]/oxmysql/web/build/assets/index-37a4a4fa.css new file mode 100644 index 000000000..8801c726c --- /dev/null +++ b/server-data/resources/[ox]/oxmysql/web/build/assets/index-37a4a4fa.css @@ -0,0 +1 @@ +@import"https://use.typekit.net/qgr5ebd.css";*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}.visible{visibility:visible}.absolute{position:absolute}.m-4{margin:1rem}.mb-4{margin-bottom:1rem}.mt-0{margin-top:0}.mt-6{margin-top:1.5rem}.flex{display:flex}.table{display:table}.grid{display:grid}.h-\[700px\]{height:700px}.h-full{height:100%}.w-1\/3{width:33.333333%}.w-1\/4{width:25%}.w-12{width:3rem}.w-2\/3{width:66.666667%}.w-3\/4{width:75%}.w-\[1200px\]{width:1200px}.w-full{width:100%}.max-w-\[200px\]{max-width:200px}.max-w-xl{max-width:36rem}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.grid-flow-col{grid-auto-flow:column}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-6{gap:1.5rem}.self-center{align-self:center}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rounded-md{border-radius:.375rem}.border-\[1px\]{border-width:1px}.border-transparent{border-color:transparent}.bg-dark-50{--tw-bg-opacity: 1;background-color:rgb(193 194 197 / var(--tw-bg-opacity))}.bg-dark-600{--tw-bg-opacity: 1;background-color:rgb(37 38 43 / var(--tw-bg-opacity))}.bg-dark-700{--tw-bg-opacity: 1;background-color:rgb(26 27 30 / var(--tw-bg-opacity))}.bg-dark-800{--tw-bg-opacity: 1;background-color:rgb(20 21 23 / var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.px-4{padding-left:1rem;padding-right:1rem}.pb-5{padding-bottom:1.25rem}.pr-0{padding-right:0}.pr-2{padding-right:.5rem}.pr-4{padding-right:1rem}.text-left{text-align:left}.text-center{text-align:center}.text-end{text-align:end}.font-main{font-family:Roboto}.text-2xl{font-size:1.5rem;line-height:2rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.text-dark-100{--tw-text-opacity: 1;color:rgb(166 167 171 / var(--tw-text-opacity))}.text-dark-300{--tw-text-opacity: 1;color:rgb(92 95 102 / var(--tw-text-opacity))}.text-dark-400{--tw-text-opacity: 1;color:rgb(55 58 64 / var(--tw-text-opacity))}.text-dark-50{--tw-text-opacity: 1;color:rgb(193 194 197 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity))}.outline-none{outline:2px solid transparent;outline-offset:2px}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-100{transition-duration:.1s}*{margin:0;padding:0}#app{width:100vw;height:100vh}::-webkit-scrollbar{width:2px}::-webkit-scrollbar-track{background:#25262b}::-webkit-scrollbar-thumb{background:#909296}::-webkit-scrollbar-thumb:hover{background:#a6a7ab}.focus-within\:border-cyan-600:focus-within{--tw-border-opacity: 1;border-color:rgb(8 145 178 / var(--tw-border-opacity))}.hover\:bg-dark-400:hover{--tw-bg-opacity: 1;background-color:rgb(55 58 64 / var(--tw-bg-opacity))}.hover\:bg-dark-500:hover{--tw-bg-opacity: 1;background-color:rgb(44 46 51 / var(--tw-bg-opacity))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.focus-visible\:border-cyan-600:focus-visible{--tw-border-opacity: 1;border-color:rgb(8 145 178 / var(--tw-border-opacity))}.focus-visible\:text-white:focus-visible{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.active\:translate-y-\[3px\]:active{--tw-translate-y: 3px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-dark-300:disabled{--tw-bg-opacity: 1;background-color:rgb(92 95 102 / var(--tw-bg-opacity))}.disabled\:text-dark-400:disabled{--tw-text-opacity: 1;color:rgb(55 58 64 / var(--tw-text-opacity))} diff --git a/server-data/resources/[ox]/oxmysql/web/build/assets/index-95a76ebf.js b/server-data/resources/[ox]/oxmysql/web/build/assets/index-95a76ebf.js new file mode 100644 index 000000000..23c3d4bec --- /dev/null +++ b/server-data/resources/[ox]/oxmysql/web/build/assets/index-95a76ebf.js @@ -0,0 +1,46 @@ +var Hl=Object.defineProperty;var Nl=(e,t,n)=>t in e?Hl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var A=(e,t,n)=>(Nl(e,typeof t!="symbol"?t+"":t,n),n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&i(r)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();function ht(){}const ha=e=>e;function z(e,t){for(const n in t)e[n]=t[n];return e}function ga(e){return e()}function hs(){return Object.create(null)}function Zt(e){e.forEach(ga)}function le(e){return typeof e=="function"}function U(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}function Bl(e){return Object.keys(e).length===0}function Ns(e,...t){if(e==null)return ht;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function jl(e){let t;return Ns(e,n=>t=n)(),t}function gt(e,t,n){e.$$.on_destroy.push(Ns(t,n))}function At(e,t,n,i){if(e){const s=pa(e,t,n,i);return e[0](s)}}function pa(e,t,n,i){return e[1]&&i?z(n.ctx.slice(),e[1](i(t))):n.ctx}function Pt(e,t,n,i){if(e[2]&&i){const s=e[2](i(n));if(t.dirty===void 0)return s;if(typeof s=="object"){const o=[],r=Math.max(t.dirty.length,s.length);for(let a=0;a32){const t=[],n=e.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),js=ma?e=>requestAnimationFrame(e):ht;const Ye=new Set;function _a(e){Ye.forEach(t=>{t.c(e)||(Ye.delete(t),t.f())}),Ye.size!==0&&js(_a)}function Gl(e){let t;return Ye.size===0&&js(_a),{promise:new Promise(n=>{Ye.add(t={c:e,f:n})}),abort(){Ye.delete(t)}}}let Ei=!1;function ql(){Ei=!0}function Yl(){Ei=!1}function Ul(e,t,n,i){for(;e>1);n(s)<=i?e=s+1:t=s}return e}function Xl(e){if(e.hydrate_init)return;e.hydrate_init=!0;let t=e.childNodes;if(e.nodeName==="HEAD"){const l=[];for(let c=0;c0&&t[n[s]].claim_order<=c?s+1:Ul(1,s,d=>t[n[d]].claim_order,c))-1;i[l]=n[u]+1;const f=u+1;n[f]=l,s=Math.max(f,s)}const o=[],r=[];let a=t.length-1;for(let l=n[s]+1;l!=0;l=i[l-1]){for(o.push(t[l-1]);a>=l;a--)r.push(t[a]);a--}for(;a>=0;a--)r.push(t[a]);o.reverse(),r.sort((l,c)=>l.claim_order-c.claim_order);for(let l=0,c=0;l=o[c].claim_order;)c++;const u=ce.removeEventListener(t,n,i)}function F(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}const tc=["width","height"];function ec(e,t){const n=Object.getOwnPropertyDescriptors(e.__proto__);for(const i in t)t[i]==null?e.removeAttribute(i):i==="style"?e.style.cssText=t[i]:i==="__value"?e.value=e[i]=t[i]:n[i]&&n[i].set&&tc.indexOf(i)===-1?e[i]=t[i]:F(e,i,t[i])}function li(e,t){for(const n in t)F(e,n,t[n])}function nc(e){return Array.from(e.childNodes)}function ic(e){e.claim_info===void 0&&(e.claim_info={last_index:0,total_claimed:0})}function sc(e,t,n,i,s=!1){ic(e);const o=(()=>{for(let r=e.claim_info.last_index;r=0;r--){const a=e[r];if(t(a)){const l=n(a);return l===void 0?e.splice(r,1):e[r]=l,s?l===void 0&&e.claim_info.last_index--:e.claim_info.last_index=r,a}}return i()})();return o.claim_order=e.claim_info.total_claimed,e.claim_info.total_claimed+=1,o}function oc(e,t){return sc(e,n=>n.nodeType===3,n=>{const i=""+t;if(n.data.startsWith(i)){if(n.data.length!==i.length)return n.splitText(i.length)}else n.data=i},()=>Z(t),!0)}function Wt(e,t){t=""+t,e.data!==t&&(e.data=t)}function ci(e,t){e.value=t??""}function Tn(e,t,n){e.classList[n?"add":"remove"](t)}function rc(e,t,{bubbles:n=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(e,n,i,t),s}function be(e,t){return new e(t)}const ui=new Map;let fi=0;function ac(e){let t=5381,n=e.length;for(;n--;)t=(t<<5)-t^e.charCodeAt(n);return t>>>0}function lc(e,t){const n={stylesheet:Kl(t),rules:{}};return ui.set(e,n),n}function _o(e,t,n,i,s,o,r,a=0){const l=16.666/i;let c=`{ +`;for(let m=0;m<=1;m+=l){const _=t+(n-t)*o(m);c+=m*100+`%{${r(_,1-_)}} +`}const u=c+`100% {${r(n,1-n)}} +}`,f=`__svelte_${ac(u)}_${a}`,d=ba(e),{stylesheet:h,rules:g}=ui.get(d)||lc(d,e);g[f]||(g[f]=!0,h.insertRule(`@keyframes ${f} ${u}`,h.cssRules.length));const p=e.style.animation||"";return e.style.animation=`${p?`${p}, `:""}${f} ${i}ms linear ${s}ms 1 both`,fi+=1,f}function cc(e,t){const n=(e.style.animation||"").split(", "),i=n.filter(t?o=>o.indexOf(t)<0:o=>o.indexOf("__svelte")===-1),s=n.length-i.length;s&&(e.style.animation=i.join(", "),fi-=s,fi||uc())}function uc(){js(()=>{fi||(ui.forEach(e=>{const{ownerNode:t}=e.stylesheet;t&&X(t)}),ui.clear())})}let Fe;function Pe(e){Fe=e}function on(){if(!Fe)throw new Error("Function called outside component initialization");return Fe}function Li(e){on().$$.on_mount.push(e)}function fc(e){on().$$.after_update.push(e)}function rn(e){on().$$.on_destroy.push(e)}function dc(e,t){return on().$$.context.set(e,t),t}function Ws(e){return on().$$.context.get(e)}function hc(e){return on().$$.context.has(e)}function gc(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach(i=>i.call(this,t))}const We=[],Ze=[];let Ue=[];const gs=[],xa=Promise.resolve();let ps=!1;function va(){ps||(ps=!0,xa.then(Sa))}function Gs(){return va(),xa}function Je(e){Ue.push(e)}function wa(e){gs.push(e)}const Gi=new Set;let He=0;function Sa(){if(He!==0)return;const e=Fe;do{try{for(;Hee.indexOf(i)===-1?t.push(i):n.push(i)),n.forEach(i=>i()),Ue=t}let ln;function _c(){return ln||(ln=Promise.resolve(),ln.then(()=>{ln=null})),ln}function qi(e,t,n){e.dispatchEvent(rc(`${t?"intro":"outro"}${n}`))}const ni=new Set;let ae;function kt(){ae={r:0,c:[],p:ae}}function Rt(){ae.r||Zt(ae.c),ae=ae.p}function S(e,t){e&&e.i&&(ni.delete(e),e.i(t))}function C(e,t,n,i){if(e&&e.o){if(ni.has(e))return;ni.add(e),ae.c.push(()=>{ni.delete(e),i&&(n&&e.d(1),i())}),e.o(t)}else i&&i()}const bc={duration:0};function di(e,t,n,i){const s={direction:"both"};let o=t(e,n,s),r=i?0:1,a=null,l=null,c=null;function u(){c&&cc(e,c)}function f(h,g){const p=h.b-r;return g*=Math.abs(p),{a:r,b:h.b,d:p,duration:g,start:h.start,end:h.start+g,group:h.group}}function d(h){const{delay:g=0,duration:p=300,easing:m=ha,tick:_=ht,css:b}=o||bc,x={start:Wl()+g,b:h};h||(x.group=ae,ae.r+=1),a||l?l=x:(b&&(u(),c=_o(e,r,h,p,g,m,b)),h&&_(0,1),a=f(x,p),Je(()=>qi(e,h,"start")),Gl(v=>{if(l&&v>l.start&&(a=f(l,p),l=null,qi(e,a.b,"start"),b&&(u(),c=_o(e,r,a.b,a.duration,0,m,o.css))),a){if(v>=a.end)_(r=a.b,1-r),qi(e,a.b,"end"),l||(a.b?u():--a.group.r||Zt(a.group.c)),a=null;else if(v>=a.start){const y=v-a.start;r=a.a+a.d*m(y/a.duration),_(r,1-r)}}return!!(a||l)}))}return{run(h){le(o)?_c().then(()=>{o=o(s),d(h)}):d(h)},end(){u(),a=l=null}}}function zt(e,t){const n={},i={},s={$$scope:1};let o=e.length;for(;o--;){const r=e[o],a=t[o];if(a){for(const l in r)l in a||(i[l]=1);for(const l in a)s[l]||(n[l]=a[l],s[l]=1);e[o]=a}else for(const l in r)s[l]=1}for(const r in i)r in n||(n[r]=void 0);return n}function Jt(e){return typeof e=="object"&&e!==null?e:{}}const yc=/[&"]/g,xc=/[&<]/g;function vc(e,t=!1){const n=String(e),i=t?yc:xc;i.lastIndex=0;let s="",o=0;for(;i.test(n);){const r=i.lastIndex-1,a=n[r];s+=n.substring(o,r)+(a==="&"?"&":a==='"'?""":"<"),o=r+1}return s+n.substring(o)}function wc(e,t){if(!e||!e.$$render)throw t==="svelte:component"&&(t+=" this={...}"),new Error(`<${t}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules. Otherwise you may need to fix a <${t}>.`);return e}let Yi;function Ca(e){function t(n,i,s,o,r){const a=Fe,l={on_destroy:Yi,context:new Map(r||(a?a.$$.context:[])),on_mount:[],before_update:[],after_update:[],callbacks:hs()};Pe({$$:l});const c=e(n,i,s,o);return Pe(a),c}return{render:(n={},{$$slots:i={},context:s=new Map}={})=>{Yi=[];const o={title:"",head:"",css:new Set},r=t(o,n,{},i,s);return Zt(Yi),{html:r,css:{code:Array.from(o.css).map(a=>a.code).join(` +`),map:null},head:o.title+o.head}},$$render:t}}function Ma(e,t,n){const i=e.$$.props[t];i!==void 0&&(e.$$.bound[i]=n,n(e.$$.ctx[i]))}function I(e){e&&e.c()}function Sc(e,t){e&&e.l(t)}function E(e,t,n,i){const{fragment:s,after_update:o}=e.$$;s&&s.m(t,n),i||Je(()=>{const r=e.$$.on_mount.map(ga).filter(le);e.$$.on_destroy?e.$$.on_destroy.push(...r):Zt(r),e.$$.on_mount=[]}),o.forEach(Je)}function L(e,t){const n=e.$$;n.fragment!==null&&(mc(n.after_update),Zt(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Cc(e,t){e.$$.dirty[0]===-1&&(We.push(e),va(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const g=h.length?h[0]:d;return c.ctx&&s(c.ctx[f],c.ctx[f]=g)&&(!c.skip_bound&&c.bound[f]&&c.bound[f](g),u&&Cc(e,f)),d}):[],c.update(),u=!0,Zt(c.before_update),c.fragment=i?i(c.ctx):!1,t.target){if(t.hydrate){ql();const f=nc(t.target);c.fragment&&c.fragment.l(f),f.forEach(X)}else c.fragment&&c.fragment.c();t.intro&&S(e.$$.fragment),E(e,t.target,t.anchor,t.customElement),Yl(),Sa()}Pe(l)}class K{$destroy(){L(this,1),this.$destroy=ht}$on(t,n){if(!le(n))return ht;const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(n),()=>{const s=i.indexOf(n);s!==-1&&i.splice(s,1)}}$set(t){this.$$set&&!Bl(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Ne=[];function ms(e,t){return{subscribe:Ft(e,t).subscribe}}function Ft(e,t=ht){let n;const i=new Set;function s(a){if(U(e,a)&&(e=a,n)){const l=!Ne.length;for(const c of i)c[1](),Ne.push(c,e);if(l){for(let c=0;c{i.delete(c),i.size===0&&n&&(n(),n=null)}}return{set:s,update:o,subscribe:r}}function qs(e,t,n){const i=!Array.isArray(e),s=i?[e]:e,o=t.length<2;return ms(n,r=>{let a=!1;const l=[];let c=0,u=ht;const f=()=>{if(c)return;u();const h=t(i?l[0]:l,r);o?r(h):u=le(h)?h:ht},d=s.map((h,g)=>Ns(h,p=>{l[g]=p,c&=~(1<{c|=1<a.startsWith(":")?(n.push(a.slice(1)),"([^\\/]+)"):a).join("\\/"),r=t.match(new RegExp(`^${o}$`));return r||(s=!1,r=t.match(new RegExp(`^${o}`))),r?(n.forEach((a,l)=>i[a]=r[l+1]),{exact:s,params:i,part:r[0].slice(0,-1)}):null}function ka(e,t,n){if(n==="")return e;if(n[0]==="/")return n;let i=r=>r.split("/").filter(a=>a!==""),s=i(e);return"/"+(t?i(t):[]).map((r,a)=>s[a]).join("/")+"/"+n}function bo(e,t,n,i){let s=[t,"data-"+t].reduce((o,r)=>{let a=e.getAttribute(r);return n&&e.removeAttribute(r),a===null?o:a},!1);return!i&&s===""?!0:s||i||!1}function kc(e){let t=e.split("&").map(n=>n.split("=")).reduce((n,i)=>{let s=i[0];if(!s)return n;let o=i.length>1?i[i.length-1]:!0;return typeof o=="string"&&o.includes(",")&&(o=o.split(",")),n[s]===void 0?n[s]=[o]:n[s].push(o),n},{});return Object.entries(t).reduce((n,i)=>(n[i[0]]=i[1].length>1?i[1]:i[1][0],n),{})}function Rc(e){return Object.entries(e).map(([t,n])=>n?n===!0?t:`${t}=${Array.isArray(n)?n.join(","):n}`:null).filter(t=>t).join("&")}function yo(e,t){return e?t+e:""}function Ra(e){throw new Error("[Tinro] "+e)}var Nt={HISTORY:1,HASH:2,MEMORY:3,OFF:4,run(e,t,n,i){return e===this.HISTORY?t&&t():e===this.HASH?n&&n():i&&i()},getDefault(){return!window||window.location.pathname==="srcdoc"?this.MEMORY:this.HISTORY}},Ys,$a,Aa,hi="",Ht=$c();function $c(){let e=Nt.getDefault(),t,n=r=>window.onhashchange=window.onpopstate=Ys=null,i=r=>t&&t(Ui(e)),s=r=>{r&&(e=r),n(),e!==Nt.OFF&&Nt.run(e,a=>window.onpopstate=i,a=>window.onhashchange=i)&&i()},o=r=>{let a=Object.assign(Ui(e),r);return a.path+yo(Rc(a.query),"?")+yo(a.hash,"#")};return{mode:s,get:r=>Ui(e),go(r,a){Ac(e,r,a),i()},start(r){t=r,s()},stop(){t=null,s(Nt.OFF)},set(r){this.go(o(r),!r.path)},methods(){return Pc(this)},base:r=>hi=r}}function Ac(e,t,n){!n&&($a=Aa);let i=s=>history[`${n?"replace":"push"}State`]({},"",s);Nt.run(e,s=>i(hi+t),s=>i(`#${t}`),s=>Ys=t)}function Ui(e){let t=window.location,n=Nt.run(e,s=>(hi?t.pathname.replace(hi,""):t.pathname)+t.search+t.hash,s=>String(t.hash.slice(1)||"/"),s=>Ys||"/"),i=n.match(/^([^?#]+)(?:\?([^#]+))?(?:\#(.+))?$/);return Aa=n,{url:n,from:$a,path:i[1]||"",query:kc(i[2]||""),hash:i[3]||""}}function Pc(e){let t=()=>e.get().query,n=r=>e.set({query:r}),i=r=>n(r(t())),s=()=>e.get().hash,o=r=>e.set({hash:r});return{hash:{get:s,set:o,clear:()=>o("")},query:{replace:n,clear:()=>n(""),get(r){return r?t()[r]:t()},set(r,a){i(l=>(l[r]=a,l))},delete(r){i(a=>(a[r]&&delete a[r],a))}}}}var Ee=Dc();function Dc(){let{subscribe:e}=Ft(Ht.get(),t=>{Ht.start(t);let n=Oc(Ht.go);return()=>{Ht.stop(),n()}});return{subscribe:e,goto:Ht.go,params:Fc,meta:Us,useHashNavigation:t=>Ht.mode(t?Nt.HASH:Nt.HISTORY),mode:{hash:()=>Ht.mode(Nt.HASH),history:()=>Ht.mode(Nt.HISTORY),memory:()=>Ht.mode(Nt.MEMORY)},base:Ht.base,location:Ht.methods()}}function Oc(e){let t=n=>{let i=n.target.closest("a[href]"),s=i&&bo(i,"target",!1,"_self"),o=i&&bo(i,"tinro-ignore"),r=n.ctrlKey||n.metaKey||n.altKey||n.shiftKey;if(s=="_self"&&!o&&!r&&i){let a=i.getAttribute("href").replace(/^\/#/,"");/^\/\/|^#|^[a-zA-Z]+:/.test(a)||(n.preventDefault(),e(a.startsWith("/")?a:i.href.replace(window.location.origin,"")))}};return addEventListener("click",t),()=>removeEventListener("click",t)}function Fc(){return Ws("tinro").meta.params}var gi="tinro",Ec=Pa({pattern:"",matched:!0});function Lc(e){let t=Ws(gi)||Ec;(t.exact||t.fallback)&&Ra(`${e.fallback?"":``} can't be inside ${t.fallback?"":` with exact path`}`);let n=e.fallback?"fallbacks":"childs",i=Ft({}),s=Pa({fallback:e.fallback,parent:t,update(o){s.exact=!o.path.endsWith("/*"),s.pattern=_s(`${s.parent.pattern||""}${o.path}`),s.redirect=o.redirect,s.firstmatch=o.firstmatch,s.breadcrumb=o.breadcrumb,s.match()},register:()=>(s.parent[n].add(s),async()=>{s.parent[n].delete(s),s.parent.activeChilds.delete(s),s.router.un&&s.router.un(),s.parent.match()}),show:()=>{e.onShow(),!s.fallback&&s.parent.activeChilds.add(s)},hide:()=>{e.onHide(),s.parent.activeChilds.delete(s)},match:async()=>{s.matched=!1;let{path:o,url:r,from:a,query:l}=s.router.location,c=Mc(s.pattern,o);if(!s.fallback&&c&&s.redirect&&(!s.exact||s.exact&&c.exact)){let u=ka(o,s.parent.pattern,s.redirect);return Ee.goto(u,!0)}s.meta=c&&{from:a,url:r,query:l,match:c.part,pattern:s.pattern,breadcrumbs:s.parent.meta&&s.parent.meta.breadcrumbs.slice()||[],params:c.params,subscribe:i.subscribe},s.breadcrumb&&s.meta&&s.meta.breadcrumbs.push({name:s.breadcrumb,path:c.part}),i.set(s.meta),c&&!s.fallback&&(!s.exact||s.exact&&c.exact)&&(!s.parent.firstmatch||!s.parent.matched)?(e.onMeta(s.meta),s.parent.matched=!0,s.show()):s.hide(),c&&s.showFallbacks()}});return dc(gi,s),Li(()=>s.register()),s}function Us(){return hc(gi)?Ws(gi).meta:Ra("meta() function must be run inside any `` child component only")}function Pa(e){let t={router:{},exact:!1,pattern:null,meta:null,parent:null,fallback:!1,redirect:!1,firstmatch:!1,breadcrumb:null,matched:!1,childs:new Set,activeChilds:new Set,fallbacks:new Set,async showFallbacks(){if(!this.fallback&&(await Gs(),this.childs.size>0&&this.activeChilds.size==0||this.childs.size==0&&this.fallbacks.size>0)){let n=this;for(;n.fallbacks.size==0;)if(n=n.parent,!n)return;n&&n.fallbacks.forEach(i=>{if(i.redirect){let s=ka("/",i.parent.pattern,i.redirect);Ee.goto(s,!0)}else i.show()})}},start(){this.router.un||(this.router.un=Ee.subscribe(n=>{this.router.location=n,this.pattern!==null&&this.match()}))},match(){this.showFallbacks()}};return Object.assign(t,e),t.start(),t}const Tc=e=>({params:e&2,meta:e&4}),xo=e=>({params:e[1],meta:e[2]});function vo(e){let t;const n=e[9].default,i=At(n,e,e[8],xo);return{c(){i&&i.c()},m(s,o){i&&i.m(s,o),t=!0},p(s,o){i&&i.p&&(!t||o&262)&&Dt(i,n,s,s[8],t?Pt(n,s[8],o,Tc):Ot(s[8]),xo)},i(s){t||(S(i,s),t=!0)},o(s){C(i,s),t=!1},d(s){i&&i.d(s)}}}function Ic(e){let t,n,i=e[0]&&vo(e);return{c(){i&&i.c(),t=Pn()},m(s,o){i&&i.m(s,o),nt(s,t,o),n=!0},p(s,[o]){s[0]?i?(i.p(s,o),o&1&&S(i,1)):(i=vo(s),i.c(),S(i,1),i.m(t.parentNode,t)):i&&(kt(),C(i,1,1,()=>{i=null}),Rt())},i(s){n||(S(i),n=!0)},o(s){C(i),n=!1},d(s){i&&i.d(s),s&&X(t)}}}function Vc(e,t,n){let{$$slots:i={},$$scope:s}=t,{path:o="/*"}=t,{fallback:r=!1}=t,{redirect:a=!1}=t,{firstmatch:l=!1}=t,{breadcrumb:c=null}=t,u=!1,f={},d={};const h=Lc({fallback:r,onShow(){n(0,u=!0)},onHide(){n(0,u=!1)},onMeta(g){n(2,d=g),n(1,f=d.params)}});return e.$$set=g=>{"path"in g&&n(3,o=g.path),"fallback"in g&&n(4,r=g.fallback),"redirect"in g&&n(5,a=g.redirect),"firstmatch"in g&&n(6,l=g.firstmatch),"breadcrumb"in g&&n(7,c=g.breadcrumb),"$$scope"in g&&n(8,s=g.$$scope)},e.$$.update=()=>{e.$$.dirty&232&&h.update({path:o,redirect:a,firstmatch:l,breadcrumb:c})},[u,f,d,o,r,a,l,c,s,i]}class wo extends K{constructor(t){super(),Q(this,t,Vc,Ic,U,{path:3,fallback:4,redirect:5,firstmatch:6,breadcrumb:7})}}async function Da(e,t={}){const n={method:"post",headers:{"Content-Type":"application/json; charset=UTF-8"},body:JSON.stringify(t)},i=window.GetParentResourceName?window.GetParentResourceName():"nui-frame-app";return await(await fetch(`https://${i}/${e}`,n)).json()}var So={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};function Co(e,t,n){const i=e.slice();return i[9]=t[n][0],i[10]=t[n][1],i}function Xi(e){let t,n=[e[10]],i={};for(let s=0;s{n(6,t=z(z({},t),et(d))),n(5,s=mo(t,i)),"name"in d&&n(0,a=d.name),"color"in d&&n(1,l=d.color),"size"in d&&n(2,c=d.size),"stroke"in d&&n(3,u=d.stroke),"iconNode"in d&&n(4,f=d.iconNode),"$$scope"in d&&n(7,r=d.$$scope)},t=et(t),[a,l,c,u,f,s,t,r,o]}class Nc extends K{constructor(t){super(),Q(this,t,Hc,zc,U,{name:0,color:1,size:2,stroke:3,iconNode:4})}}const ce=Nc;function Bc(e){let t;const n=e[2].default,i=At(n,e,e[3],null);return{c(){i&&i.c()},m(s,o){i&&i.m(s,o),t=!0},p(s,o){i&&i.p&&(!t||o&8)&&Dt(i,n,s,s[3],t?Pt(n,s[3],o,null):Ot(s[3]),null)},i(s){t||(S(i,s),t=!0)},o(s){C(i,s),t=!1},d(s){i&&i.d(s)}}}function jc(e){let t,n;const i=[{name:"chevron-left"},e[1],{iconNode:e[0]}];let s={$$slots:{default:[Bc]},$$scope:{ctx:e}};for(let o=0;o{n(1,t=z(z({},t),et(r))),"$$scope"in r&&n(3,s=r.$$scope)},t=et(t),[o,t,i,s]}class Gc extends K{constructor(t){super(),Q(this,t,Wc,jc,U,{})}}const Oa=Gc;function qc(e){let t;const n=e[2].default,i=At(n,e,e[3],null);return{c(){i&&i.c()},m(s,o){i&&i.m(s,o),t=!0},p(s,o){i&&i.p&&(!t||o&8)&&Dt(i,n,s,s[3],t?Pt(n,s[3],o,null):Ot(s[3]),null)},i(s){t||(S(i,s),t=!0)},o(s){C(i,s),t=!1},d(s){i&&i.d(s)}}}function Yc(e){let t,n;const i=[{name:"chevron-right"},e[1],{iconNode:e[0]}];let s={$$slots:{default:[qc]},$$scope:{ctx:e}};for(let o=0;o{n(1,t=z(z({},t),et(r))),"$$scope"in r&&n(3,s=r.$$scope)},t=et(t),[o,t,i,s]}class Xc extends K{constructor(t){super(),Q(this,t,Uc,Yc,U,{})}}const Kc=Xc;function Qc(e){let t;const n=e[2].default,i=At(n,e,e[3],null);return{c(){i&&i.c()},m(s,o){i&&i.m(s,o),t=!0},p(s,o){i&&i.p&&(!t||o&8)&&Dt(i,n,s,s[3],t?Pt(n,s[3],o,null):Ot(s[3]),null)},i(s){t||(S(i,s),t=!0)},o(s){C(i,s),t=!1},d(s){i&&i.d(s)}}}function Zc(e){let t,n;const i=[{name:"chevrons-left"},e[1],{iconNode:e[0]}];let s={$$slots:{default:[Qc]},$$scope:{ctx:e}};for(let o=0;o{n(1,t=z(z({},t),et(r))),"$$scope"in r&&n(3,s=r.$$scope)},t=et(t),[o,t,i,s]}class tu extends K{constructor(t){super(),Q(this,t,Jc,Zc,U,{})}}const eu=tu;function nu(e){let t;const n=e[2].default,i=At(n,e,e[3],null);return{c(){i&&i.c()},m(s,o){i&&i.m(s,o),t=!0},p(s,o){i&&i.p&&(!t||o&8)&&Dt(i,n,s,s[3],t?Pt(n,s[3],o,null):Ot(s[3]),null)},i(s){t||(S(i,s),t=!0)},o(s){C(i,s),t=!1},d(s){i&&i.d(s)}}}function iu(e){let t,n;const i=[{name:"chevrons-right"},e[1],{iconNode:e[0]}];let s={$$slots:{default:[nu]},$$scope:{ctx:e}};for(let o=0;o{n(1,t=z(z({},t),et(r))),"$$scope"in r&&n(3,s=r.$$scope)},t=et(t),[o,t,i,s]}class ou extends K{constructor(t){super(),Q(this,t,su,iu,U,{})}}const ru=ou,Ki=Ft(!1),bs=Ft("");let ko;const au=qs(bs,(e,t)=>(ko=setTimeout(()=>t(e),500),()=>clearTimeout(ko))),ys=Ft([]),lu=qs([ys,au],([e,t],n)=>{if(t===""||!t)return n(e);const i=t.toLowerCase();return n(e.filter(s=>s.toLowerCase().includes(i)))}),xs=Ft({queries:0,timeQuerying:0,slowQueries:0}),vs=Ft({labels:[],data:[]}),ii=Ft([]),ws=Ft({resourceQueriesCount:0,resourceSlowQueries:0,resourceTime:0}),Bt=Ft({search:"",page:0});function cu(e){let t,n,i,s,o,r,a,l,c,u,f,d=e[1].page+1+"",h,g,p,m,_,b,x,v,y,M,k,$,P,O;return i=new eu({}),a=new Oa({}),b=new Kc({}),M=new ru({}),{c(){t=D("div"),n=D("button"),I(i.$$.fragment),o=Y(),r=D("button"),I(a.$$.fragment),c=Y(),u=D("p"),f=Z("Page "),h=Z(d),g=Z(" of "),p=Z(e[0]),m=Y(),_=D("button"),I(b.$$.fragment),v=Y(),y=D("button"),I(M.$$.fragment),n.disabled=s=e[1].page===0,F(n,"class","bg-dark-600 disabled:bg-dark-300 disabled:text-dark-400 text-dark-100 hover:bg-dark-500 rounded-md border-[1px] border-transparent p-2 outline-none hover:text-white focus-visible:border-cyan-600 focus-visible:text-white active:translate-y-[3px] disabled:cursor-not-allowed"),r.disabled=l=e[1].page===0,F(r,"class","bg-dark-600 disabled:bg-dark-300 disabled:text-dark-400 text-dark-100 hover:bg-dark-500 rounded-md border-[1px] border-transparent p-2 outline-none hover:text-white focus-visible:border-cyan-600 focus-visible:text-white active:translate-y-[3px] disabled:cursor-not-allowed"),_.disabled=x=e[1].page>=e[0]-1,F(_,"class","bg-dark-600 disabled:bg-dark-300 disabled:text-dark-400 text-dark-100 hover:bg-dark-500 rounded-md border-[1px] border-transparent p-2 outline-none hover:text-white focus-visible:border-cyan-600 focus-visible:text-white active:translate-y-[3px] disabled:cursor-not-allowed"),y.disabled=k=e[1].page===e[0]-1,F(y,"class","bg-dark-600 disabled:bg-dark-300 disabled:text-dark-400 text-dark-100 hover:bg-dark-500 rounded-md border-[1px] border-transparent p-2 outline-none hover:text-white focus-visible:border-cyan-600 focus-visible:text-white active:translate-y-[3px] disabled:cursor-not-allowed"),F(t,"class","flex items-center justify-center gap-6 pb-5")},m(R,V){nt(R,t,V),w(t,n),E(i,n,null),w(t,o),w(t,r),E(a,r,null),w(t,c),w(t,u),w(u,f),w(u,h),w(u,g),w(u,p),w(t,m),w(t,_),E(b,_,null),w(t,v),w(t,y),E(M,y,null),$=!0,P||(O=[It(n,"click",e[2]),It(r,"click",e[3]),It(_,"click",e[4]),It(y,"click",e[5])],P=!0)},p(R,[V]){(!$||V&2&&s!==(s=R[1].page===0))&&(n.disabled=s),(!$||V&2&&l!==(l=R[1].page===0))&&(r.disabled=l),(!$||V&2)&&d!==(d=R[1].page+1+"")&&Wt(h,d),(!$||V&1)&&Wt(p,R[0]),(!$||V&3&&x!==(x=R[1].page>=R[0]-1))&&(_.disabled=x),(!$||V&3&&k!==(k=R[1].page===R[0]-1))&&(y.disabled=k)},i(R){$||(S(i.$$.fragment,R),S(a.$$.fragment,R),S(b.$$.fragment,R),S(M.$$.fragment,R),$=!0)},o(R){C(i.$$.fragment,R),C(a.$$.fragment,R),C(b.$$.fragment,R),C(M.$$.fragment,R),$=!1},d(R){R&&X(t),L(i),L(a),L(b),L(M),P=!1,Zt(O)}}}function uu(e,t,n){let i;gt(e,Bt,c=>n(1,i=c));let{maxPage:s}=t;rn(()=>n(0,s=0));const o=()=>mt(Bt,i.page=0,i),r=()=>mt(Bt,i.page--,i),a=()=>mt(Bt,i.page++,i),l=()=>mt(Bt,i.page=s-1,i);return e.$$set=c=>{"maxPage"in c&&n(0,s=c.maxPage)},[s,i,o,r,a,l]}let fu=class extends K{constructor(t){super(),Q(this,t,uu,cu,U,{maxPage:0})}};function du(e){let t;const n=e[2].default,i=At(n,e,e[3],null);return{c(){i&&i.c()},m(s,o){i&&i.m(s,o),t=!0},p(s,o){i&&i.p&&(!t||o&8)&&Dt(i,n,s,s[3],t?Pt(n,s[3],o,null):Ot(s[3]),null)},i(s){t||(S(i,s),t=!0)},o(s){C(i,s),t=!1},d(s){i&&i.d(s)}}}function hu(e){let t,n;const i=[{name:"chevron-down"},e[1],{iconNode:e[0]}];let s={$$slots:{default:[du]},$$scope:{ctx:e}};for(let o=0;o{n(1,t=z(z({},t),et(r))),"$$scope"in r&&n(3,s=r.$$scope)},t=et(t),[o,t,i,s]}class pu extends K{constructor(t){super(),Q(this,t,gu,hu,U,{})}}const mu=pu;function _u(e){let t;const n=e[2].default,i=At(n,e,e[3],null);return{c(){i&&i.c()},m(s,o){i&&i.m(s,o),t=!0},p(s,o){i&&i.p&&(!t||o&8)&&Dt(i,n,s,s[3],t?Pt(n,s[3],o,null):Ot(s[3]),null)},i(s){t||(S(i,s),t=!0)},o(s){C(i,s),t=!1},d(s){i&&i.d(s)}}}function bu(e){let t,n;const i=[{name:"chevron-up"},e[1],{iconNode:e[0]}];let s={$$slots:{default:[_u]},$$scope:{ctx:e}};for(let o=0;o{n(1,t=z(z({},t),et(r))),"$$scope"in r&&n(3,s=r.$$scope)},t=et(t),[o,t,i,s]}class xu extends K{constructor(t){super(),Q(this,t,yu,bu,U,{})}}const vu=xu;/** + * table-core + * + * Copyright (c) TanStack + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function he(e,t){return typeof e=="function"?e(t):e}function Vt(e,t){return n=>{t.setState(i=>({...i,[e]:he(n,i[e])}))}}function pi(e){return e instanceof Function}function wu(e,t){const n=[],i=s=>{s.forEach(o=>{n.push(o);const r=t(o);r!=null&&r.length&&i(r)})};return i(e),n}function T(e,t,n){let i=[],s;return()=>{let o;n.key&&n.debug&&(o=Date.now());const r=e();if(!(r.length!==i.length||r.some((c,u)=>i[u]!==c)))return s;i=r;let l;if(n.key&&n.debug&&(l=Date.now()),s=t(...r),n==null||n.onChange==null||n.onChange(s),n.key&&n.debug&&n!=null&&n.debug()){const c=Math.round((Date.now()-o)*100)/100,u=Math.round((Date.now()-l)*100)/100,f=u/16,d=(h,g)=>{for(h=String(h);h.length{let h=d;for(const p of l.split(".")){var g;h=(g=h)==null?void 0:g[p]}return h}:u=d=>d[a.accessorKey]),!c)throw new Error;let f={id:`${String(c)}`,accessorFn:u,parent:i,depth:n,columnDef:a,columns:[],getFlatColumns:T(()=>[!0],()=>{var d;return[f,...(d=f.columns)==null?void 0:d.flatMap(h=>h.getFlatColumns())]},{key:"column.getFlatColumns",debug:()=>{var d;return(d=e.options.debugAll)!=null?d:e.options.debugColumns}}),getLeafColumns:T(()=>[e._getOrderColumnsFn()],d=>{var h;if((h=f.columns)!=null&&h.length){let g=f.columns.flatMap(p=>p.getLeafColumns());return d(g)}return[f]},{key:"column.getLeafColumns",debug:()=>{var d;return(d=e.options.debugAll)!=null?d:e.options.debugColumns}})};return f=e._features.reduce((d,h)=>Object.assign(d,h.createColumn==null?void 0:h.createColumn(f,e)),f),f}function Ro(e,t,n){var i;let o={id:(i=n.id)!=null?i:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const r=[],a=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(a),r.push(l)};return a(o),r},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach(r=>{Object.assign(o,r.createHeader==null?void 0:r.createHeader(o,e))}),o}const Cu={createTable:e=>({getHeaderGroups:T(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,i,s)=>{var o,r;const a=(o=i==null?void 0:i.map(f=>n.find(d=>d.id===f)).filter(Boolean))!=null?o:[],l=(r=s==null?void 0:s.map(f=>n.find(d=>d.id===f)).filter(Boolean))!=null?r:[],c=n.filter(f=>!(i!=null&&i.includes(f.id))&&!(s!=null&&s.includes(f.id)));return In(t,[...a,...c,...l],e)},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getCenterHeaderGroups:T(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,i,s)=>(n=n.filter(o=>!(i!=null&&i.includes(o.id))&&!(s!=null&&s.includes(o.id))),In(t,n,e,"center")),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getLeftHeaderGroups:T(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,i)=>{var s;const o=(s=i==null?void 0:i.map(r=>n.find(a=>a.id===r)).filter(Boolean))!=null?s:[];return In(t,o,e,"left")},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getRightHeaderGroups:T(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,i)=>{var s;const o=(s=i==null?void 0:i.map(r=>n.find(a=>a.id===r)).filter(Boolean))!=null?s:[];return In(t,o,e,"right")},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getFooterGroups:T(()=>[e.getHeaderGroups()],t=>[...t].reverse(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getLeftFooterGroups:T(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getCenterFooterGroups:T(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getRightFooterGroups:T(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getFlatHeaders:T(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getLeftFlatHeaders:T(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getCenterFlatHeaders:T(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getRightFlatHeaders:T(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getCenterLeafHeaders:T(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var i;return!((i=n.subHeaders)!=null&&i.length)}),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getLeftLeafHeaders:T(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var i;return!((i=n.subHeaders)!=null&&i.length)}),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getRightLeafHeaders:T(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var i;return!((i=n.subHeaders)!=null&&i.length)}),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getLeafHeaders:T(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,i)=>{var s,o,r,a,l,c;return[...(s=(o=t[0])==null?void 0:o.headers)!=null?s:[],...(r=(a=n[0])==null?void 0:a.headers)!=null?r:[],...(l=(c=i[0])==null?void 0:c.headers)!=null?l:[]].map(u=>u.getLeafHeaders()).flat()},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}})})};function In(e,t,n,i){var s,o;let r=0;const a=function(d,h){h===void 0&&(h=1),r=Math.max(r,h),d.filter(g=>g.getIsVisible()).forEach(g=>{var p;(p=g.columns)!=null&&p.length&&a(g.columns,h+1)},0)};a(e);let l=[];const c=(d,h)=>{const g={depth:h,id:[i,`${h}`].filter(Boolean).join("_"),headers:[]},p=[];d.forEach(m=>{const _=[...p].reverse()[0],b=m.column.depth===g.depth;let x,v=!1;if(b&&m.column.parent?x=m.column.parent:(x=m.column,v=!0),_&&(_==null?void 0:_.column)===x)_.subHeaders.push(m);else{const y=Ro(n,x,{id:[i,h,x.id,m==null?void 0:m.id].filter(Boolean).join("_"),isPlaceholder:v,placeholderId:v?`${p.filter(M=>M.column===x).length}`:void 0,depth:h,index:p.length});y.subHeaders.push(m),p.push(y)}g.headers.push(m),m.headerGroup=g}),l.push(g),h>0&&c(p,h-1)},u=t.map((d,h)=>Ro(n,d,{depth:r,index:h}));c(u,r-1),l.reverse();const f=d=>d.filter(g=>g.column.getIsVisible()).map(g=>{let p=0,m=0,_=[0];g.subHeaders&&g.subHeaders.length?(_=[],f(g.subHeaders).forEach(x=>{let{colSpan:v,rowSpan:y}=x;p+=v,_.push(y)})):p=1;const b=Math.min(..._);return m=m+b,g.colSpan=p,g.rowSpan=m,{colSpan:p,rowSpan:m}});return f((s=(o=l[0])==null?void 0:o.headers)!=null?s:[]),l}const Vn={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Qi=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Mu={getDefaultColumnDef:()=>Vn,getInitialState:e=>({columnSizing:{},columnSizingInfo:Qi(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",onColumnSizingChange:Vt("columnSizing",e),onColumnSizingInfoChange:Vt("columnSizingInfo",e)}),createColumn:(e,t)=>({getSize:()=>{var n,i,s;const o=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Vn.minSize,(i=o??e.columnDef.size)!=null?i:Vn.size),(s=e.columnDef.maxSize)!=null?s:Vn.maxSize)},getStart:n=>{const i=n?n==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns(),s=i.findIndex(o=>o.id===e.id);if(s>0){const o=i[s-1];return o.getStart(n)+o.getSize()}return 0},resetSize:()=>{t.setColumnSizing(n=>{let{[e.id]:i,...s}=n;return s})},getCanResize:()=>{var n,i;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((i=t.options.enableColumnResizing)!=null?i:!0)},getIsResizing:()=>t.getState().columnSizingInfo.isResizingColumn===e.id}),createHeader:(e,t)=>({getSize:()=>{let n=0;const i=s=>{if(s.subHeaders.length)s.subHeaders.forEach(i);else{var o;n+=(o=s.column.getSize())!=null?o:0}};return i(e),n},getStart:()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},getResizeHandler:()=>{const n=t.getColumn(e.column.id),i=n==null?void 0:n.getCanResize();return s=>{if(!n||!i||(s.persist==null||s.persist(),Zi(s)&&s.touches&&s.touches.length>1))return;const o=e.getSize(),r=e?e.getLeafHeaders().map(p=>[p.column.id,p.column.getSize()]):[[n.id,n.getSize()]],a=Zi(s)?Math.round(s.touches[0].clientX):s.clientX,l={},c=(p,m)=>{typeof m=="number"&&(t.setColumnSizingInfo(_=>{var b,x;const v=m-((b=_==null?void 0:_.startOffset)!=null?b:0),y=Math.max(v/((x=_==null?void 0:_.startSize)!=null?x:0),-.999999);return _.columnSizingStart.forEach(M=>{let[k,$]=M;l[k]=Math.round(Math.max($+$*y,0)*100)/100}),{..._,deltaOffset:v,deltaPercentage:y}}),(t.options.columnResizeMode==="onChange"||p==="end")&&t.setColumnSizing(_=>({..._,...l})))},u=p=>c("move",p),f=p=>{c("end",p),t.setColumnSizingInfo(m=>({...m,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},d={moveHandler:p=>u(p.clientX),upHandler:p=>{document.removeEventListener("mousemove",d.moveHandler),document.removeEventListener("mouseup",d.upHandler),f(p.clientX)}},h={moveHandler:p=>(p.cancelable&&(p.preventDefault(),p.stopPropagation()),u(p.touches[0].clientX),!1),upHandler:p=>{var m;document.removeEventListener("touchmove",h.moveHandler),document.removeEventListener("touchend",h.upHandler),p.cancelable&&(p.preventDefault(),p.stopPropagation()),f((m=p.touches[0])==null?void 0:m.clientX)}},g=ku()?{passive:!1}:!1;Zi(s)?(document.addEventListener("touchmove",h.moveHandler,g),document.addEventListener("touchend",h.upHandler,g)):(document.addEventListener("mousemove",d.moveHandler,g),document.addEventListener("mouseup",d.upHandler,g)),t.setColumnSizingInfo(p=>({...p,startOffset:a,startSize:o,deltaOffset:0,deltaPercentage:0,columnSizingStart:r,isResizingColumn:n.id}))}}}),createTable:e=>({setColumnSizing:t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),setColumnSizingInfo:t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),resetColumnSizing:t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},resetHeaderSizeInfo:t=>{var n;e.setColumnSizingInfo(t?Qi():(n=e.initialState.columnSizingInfo)!=null?n:Qi())},getTotalSize:()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((i,s)=>i+s.getSize(),0))!=null?t:0},getLeftTotalSize:()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((i,s)=>i+s.getSize(),0))!=null?t:0},getCenterTotalSize:()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((i,s)=>i+s.getSize(),0))!=null?t:0},getRightTotalSize:()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((i,s)=>i+s.getSize(),0))!=null?t:0}})};let zn=null;function ku(){if(typeof zn=="boolean")return zn;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return zn=e,zn}function Zi(e){return e.type==="touchstart"}const Ru={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Vt("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;return{_autoResetExpanded:()=>{var i,s;if(!t){e._queue(()=>{t=!0});return}if((i=(s=e.options.autoResetAll)!=null?s:e.options.autoResetExpanded)!=null?i:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},setExpanded:i=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(i),toggleAllRowsExpanded:i=>{i??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},resetExpanded:i=>{var s,o;e.setExpanded(i?{}:(s=(o=e.initialState)==null?void 0:o.expanded)!=null?s:{})},getCanSomeRowsExpand:()=>e.getRowModel().flatRows.some(i=>i.getCanExpand()),getToggleAllRowsExpandedHandler:()=>i=>{i.persist==null||i.persist(),e.toggleAllRowsExpanded()},getIsSomeRowsExpanded:()=>{const i=e.getState().expanded;return i===!0||Object.values(i).some(Boolean)},getIsAllRowsExpanded:()=>{const i=e.getState().expanded;return typeof i=="boolean"?i===!0:!(!Object.keys(i).length||e.getRowModel().flatRows.some(s=>!s.getIsExpanded()))},getExpandedDepth:()=>{let i=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(o=>{const r=o.split(".");i=Math.max(i,r.length)}),i},getPreExpandedRowModel:()=>e.getSortedRowModel(),getExpandedRowModel:()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())}},createRow:(e,t)=>({toggleExpanded:n=>{t.setExpanded(i=>{var s;const o=i===!0?!0:!!(i!=null&&i[e.id]);let r={};if(i===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{r[a]=!0}):r=i,n=(s=n)!=null?s:!o,!o&&n)return{...r,[e.id]:!0};if(o&&!n){const{[e.id]:a,...l}=r;return l}return i})},getIsExpanded:()=>{var n;const i=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:i===!0||i!=null&&i[e.id])},getCanExpand:()=>{var n,i,s;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((i=t.options.enableExpanding)!=null?i:!0)&&!!((s=e.subRows)!=null&&s.length)},getToggleExpandedHandler:()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}})},Fa=(e,t,n)=>{var i;const s=n.toLowerCase();return!!((i=e.getValue(t))!=null&&i.toLowerCase().includes(s))};Fa.autoRemove=e=>Gt(e);const Ea=(e,t,n)=>{var i;return!!((i=e.getValue(t))!=null&&i.includes(n))};Ea.autoRemove=e=>Gt(e);const La=(e,t,n)=>{var i;return((i=e.getValue(t))==null?void 0:i.toLowerCase())===n.toLowerCase()};La.autoRemove=e=>Gt(e);const Ta=(e,t,n)=>{var i;return(i=e.getValue(t))==null?void 0:i.includes(n)};Ta.autoRemove=e=>Gt(e)||!(e!=null&&e.length);const Ia=(e,t,n)=>!n.some(i=>{var s;return!((s=e.getValue(t))!=null&&s.includes(i))});Ia.autoRemove=e=>Gt(e)||!(e!=null&&e.length);const Va=(e,t,n)=>n.some(i=>{var s;return(s=e.getValue(t))==null?void 0:s.includes(i)});Va.autoRemove=e=>Gt(e)||!(e!=null&&e.length);const za=(e,t,n)=>e.getValue(t)===n;za.autoRemove=e=>Gt(e);const Ha=(e,t,n)=>e.getValue(t)==n;Ha.autoRemove=e=>Gt(e);const Xs=(e,t,n)=>{let[i,s]=n;const o=e.getValue(t);return o>=i&&o<=s};Xs.resolveFilterValue=e=>{let[t,n]=e,i=typeof t!="number"?parseFloat(t):t,s=typeof n!="number"?parseFloat(n):n,o=t===null||Number.isNaN(i)?-1/0:i,r=n===null||Number.isNaN(s)?1/0:s;if(o>r){const a=o;o=r,r=a}return[o,r]};Xs.autoRemove=e=>Gt(e)||Gt(e[0])&&Gt(e[1]);const ne={includesString:Fa,includesStringSensitive:Ea,equalsString:La,arrIncludes:Ta,arrIncludesAll:Ia,arrIncludesSome:Va,equals:za,weakEquals:Ha,inNumberRange:Xs};function Gt(e){return e==null||e===""}const $u={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:Vt("columnFilters",e),onGlobalFilterChange:Vt("globalFilter",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100,globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n,i;const s=(n=e.getCoreRowModel().flatRows[0])==null||(i=n._getAllCellsByColumnId()[t.id])==null?void 0:i.getValue();return typeof s=="string"||typeof s=="number"}}),createColumn:(e,t)=>({getAutoFilterFn:()=>{const n=t.getCoreRowModel().flatRows[0],i=n==null?void 0:n.getValue(e.id);return typeof i=="string"?ne.includesString:typeof i=="number"?ne.inNumberRange:typeof i=="boolean"||i!==null&&typeof i=="object"?ne.equals:Array.isArray(i)?ne.arrIncludes:ne.weakEquals},getFilterFn:()=>{var n,i;return pi(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(i=t.options.filterFns)==null?void 0:i[e.columnDef.filterFn])!=null?n:ne[e.columnDef.filterFn]},getCanFilter:()=>{var n,i,s;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((i=t.options.enableColumnFilters)!=null?i:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&!!e.accessorFn},getCanGlobalFilter:()=>{var n,i,s,o;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((i=t.options.enableGlobalFilter)!=null?i:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&((o=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?o:!0)&&!!e.accessorFn},getIsFiltered:()=>e.getFilterIndex()>-1,getFilterValue:()=>{var n,i;return(n=t.getState().columnFilters)==null||(i=n.find(s=>s.id===e.id))==null?void 0:i.value},getFilterIndex:()=>{var n,i;return(n=(i=t.getState().columnFilters)==null?void 0:i.findIndex(s=>s.id===e.id))!=null?n:-1},setFilterValue:n=>{t.setColumnFilters(i=>{const s=e.getFilterFn(),o=i==null?void 0:i.find(u=>u.id===e.id),r=he(n,o?o.value:void 0);if($o(s,r,e)){var a;return(a=i==null?void 0:i.filter(u=>u.id!==e.id))!=null?a:[]}const l={id:e.id,value:r};if(o){var c;return(c=i==null?void 0:i.map(u=>u.id===e.id?l:u))!=null?c:[]}return i!=null&&i.length?[...i,l]:[l]})},_getFacetedRowModel:t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),getFacetedRowModel:()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),_getFacetedUniqueValues:t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),getFacetedUniqueValues:()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,_getFacetedMinMaxValues:t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),getFacetedMinMaxValues:()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}),createRow:(e,t)=>({columnFilters:{},columnFiltersMeta:{}}),createTable:e=>({getGlobalAutoFilterFn:()=>ne.includesString,getGlobalFilterFn:()=>{var t,n;const{globalFilterFn:i}=e.options;return pi(i)?i:i==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[i])!=null?t:ne[i]},setColumnFilters:t=>{const n=e.getAllLeafColumns(),i=s=>{var o;return(o=he(t,s))==null?void 0:o.filter(r=>{const a=n.find(l=>l.id===r.id);if(a){const l=a.getFilterFn();if($o(l,r.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(i)},setGlobalFilter:t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},resetGlobalFilter:t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)},resetColumnFilters:t=>{var n,i;e.setColumnFilters(t?[]:(n=(i=e.initialState)==null?void 0:i.columnFilters)!=null?n:[])},getPreFilteredRowModel:()=>e.getCoreRowModel(),getFilteredRowModel:()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel()),_getGlobalFacetedRowModel:e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),getGlobalFacetedRowModel:()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),_getGlobalFacetedUniqueValues:e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),getGlobalFacetedUniqueValues:()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,_getGlobalFacetedMinMaxValues:e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),getGlobalFacetedMinMaxValues:()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}})};function $o(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const Au=(e,t,n)=>n.reduce((i,s)=>{const o=s.getValue(e);return i+(typeof o=="number"?o:0)},0),Pu=(e,t,n)=>{let i;return n.forEach(s=>{const o=s.getValue(e);o!=null&&(i>o||i===void 0&&o>=o)&&(i=o)}),i},Du=(e,t,n)=>{let i;return n.forEach(s=>{const o=s.getValue(e);o!=null&&(i=o)&&(i=o)}),i},Ou=(e,t,n)=>{let i,s;return n.forEach(o=>{const r=o.getValue(e);r!=null&&(i===void 0?r>=r&&(i=s=r):(i>r&&(i=r),s{let n=0,i=0;if(t.forEach(s=>{let o=s.getValue(e);o!=null&&(o=+o)>=o&&(++n,i+=o)}),n)return i/n},Eu=(e,t)=>{if(!t.length)return;let n=0,i=0;return t.forEach(s=>{let o=s.getValue(e);typeof o=="number"&&(n=Math.min(n,o),i=Math.max(i,o))}),(n+i)/2},Lu=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),Tu=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,Iu=(e,t)=>t.length,Ji={sum:Au,min:Pu,max:Du,extent:Ou,mean:Fu,median:Eu,unique:Lu,uniqueCount:Tu,count:Iu},Vu={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Vt("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>({toggleGrouping:()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(i=>i!==e.id):[...n??[],e.id])},getCanGroup:()=>{var n,i,s,o;return(n=(i=(s=(o=e.columnDef.enableGrouping)!=null?o:!0)!=null?s:t.options.enableGrouping)!=null?i:!0)!=null?n:!!e.accessorFn},getIsGrouped:()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},getGroupedIndex:()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},getToggleGroupingHandler:()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},getAutoAggregationFn:()=>{const n=t.getCoreRowModel().flatRows[0],i=n==null?void 0:n.getValue(e.id);if(typeof i=="number")return Ji.sum;if(Object.prototype.toString.call(i)==="[object Date]")return Ji.extent},getAggregationFn:()=>{var n,i;if(!e)throw new Error;return pi(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(i=t.options.aggregationFns)==null?void 0:i[e.columnDef.aggregationFn])!=null?n:Ji[e.columnDef.aggregationFn]}}),createTable:e=>({setGrouping:t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),resetGrouping:t=>{var n,i;e.setGrouping(t?[]:(n=(i=e.initialState)==null?void 0:i.grouping)!=null?n:[])},getPreGroupedRowModel:()=>e.getFilteredRowModel(),getGroupedRowModel:()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())}),createRow:e=>({getIsGrouped:()=>!!e.groupingColumnId,_groupingValuesCache:{}}),createCell:(e,t,n,i)=>({getIsGrouped:()=>t.getIsGrouped()&&t.id===n.groupingColumnId,getIsPlaceholder:()=>!e.getIsGrouped()&&t.getIsGrouped(),getIsAggregated:()=>{var s;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((s=n.subRows)!=null&&s.length)}})};function zu(e,t,n){if(!(t!=null&&t.length)||!n)return e;const i=e.filter(o=>!t.includes(o.id));return n==="remove"?i:[...t.map(o=>e.find(r=>r.id===o)).filter(Boolean),...i]}const Hu={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Vt("columnOrder",e)}),createTable:e=>({setColumnOrder:t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),resetColumnOrder:t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},_getOrderColumnsFn:T(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,i)=>s=>{let o=[];if(!(t!=null&&t.length))o=s;else{const r=[...t],a=[...s];for(;a.length&&r.length;){const l=r.shift(),c=a.findIndex(u=>u.id===l);c>-1&&o.push(a.splice(c,1)[0])}o=[...o,...a]}return zu(o,n,i)},{key:!1})})},Ss=0,Cs=10,ts=()=>({pageIndex:Ss,pageSize:Cs}),Nu={getInitialState:e=>({...e,pagination:{...ts(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Vt("pagination",e)}),createTable:e=>{let t=!1,n=!1;return{_autoResetPageIndex:()=>{var i,s;if(!t){e._queue(()=>{t=!0});return}if((i=(s=e.options.autoResetAll)!=null?s:e.options.autoResetPageIndex)!=null?i:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},setPagination:i=>{const s=o=>he(i,o);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(s)},resetPagination:i=>{var s;e.setPagination(i?ts():(s=e.initialState.pagination)!=null?s:ts())},setPageIndex:i=>{e.setPagination(s=>{let o=he(i,s.pageIndex);const r=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,r)),{...s,pageIndex:o}})},resetPageIndex:i=>{var s,o,r;e.setPageIndex(i?Ss:(s=(o=e.initialState)==null||(r=o.pagination)==null?void 0:r.pageIndex)!=null?s:Ss)},resetPageSize:i=>{var s,o,r;e.setPageSize(i?Cs:(s=(o=e.initialState)==null||(r=o.pagination)==null?void 0:r.pageSize)!=null?s:Cs)},setPageSize:i=>{e.setPagination(s=>{const o=Math.max(1,he(i,s.pageSize)),r=s.pageSize*s.pageIndex,a=Math.floor(r/o);return{...s,pageIndex:a,pageSize:o}})},setPageCount:i=>e.setPagination(s=>{var o;let r=he(i,(o=e.options.pageCount)!=null?o:-1);return typeof r=="number"&&(r=Math.max(-1,r)),{...s,pageCount:r}}),getPageOptions:T(()=>[e.getPageCount()],i=>{let s=[];return i&&i>0&&(s=[...new Array(i)].fill(null).map((o,r)=>r)),s},{key:!1,debug:()=>{var i;return(i=e.options.debugAll)!=null?i:e.options.debugTable}}),getCanPreviousPage:()=>e.getState().pagination.pageIndex>0,getCanNextPage:()=>{const{pageIndex:i}=e.getState().pagination,s=e.getPageCount();return s===-1?!0:s===0?!1:ie.setPageIndex(i=>i-1),nextPage:()=>e.setPageIndex(i=>i+1),getPrePaginationRowModel:()=>e.getExpandedRowModel(),getPaginationRowModel:()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),getPageCount:()=>{var i;return(i=e.options.pageCount)!=null?i:Math.ceil(e.getPrePaginationRowModel().rows.length/e.getState().pagination.pageSize)}}}},es=()=>({left:[],right:[]}),Bu={getInitialState:e=>({columnPinning:es(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Vt("columnPinning",e)}),createColumn:(e,t)=>({pin:n=>{const i=e.getLeafColumns().map(s=>s.id).filter(Boolean);t.setColumnPinning(s=>{var o,r;if(n==="right"){var a,l;return{left:((a=s==null?void 0:s.left)!=null?a:[]).filter(f=>!(i!=null&&i.includes(f))),right:[...((l=s==null?void 0:s.right)!=null?l:[]).filter(f=>!(i!=null&&i.includes(f))),...i]}}if(n==="left"){var c,u;return{left:[...((c=s==null?void 0:s.left)!=null?c:[]).filter(f=>!(i!=null&&i.includes(f))),...i],right:((u=s==null?void 0:s.right)!=null?u:[]).filter(f=>!(i!=null&&i.includes(f)))}}return{left:((o=s==null?void 0:s.left)!=null?o:[]).filter(f=>!(i!=null&&i.includes(f))),right:((r=s==null?void 0:s.right)!=null?r:[]).filter(f=>!(i!=null&&i.includes(f)))}})},getCanPin:()=>e.getLeafColumns().some(i=>{var s,o;return((s=i.columnDef.enablePinning)!=null?s:!0)&&((o=t.options.enablePinning)!=null?o:!0)}),getIsPinned:()=>{const n=e.getLeafColumns().map(a=>a.id),{left:i,right:s}=t.getState().columnPinning,o=n.some(a=>i==null?void 0:i.includes(a)),r=n.some(a=>s==null?void 0:s.includes(a));return o?"left":r?"right":!1},getPinnedIndex:()=>{var n,i,s;const o=e.getIsPinned();return o?(n=(i=t.getState().columnPinning)==null||(s=i[o])==null?void 0:s.indexOf(e.id))!=null?n:-1:0}}),createRow:(e,t)=>({getCenterVisibleCells:T(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,i,s)=>{const o=[...i??[],...s??[]];return n.filter(r=>!o.includes(r.column.id))},{key:"row.getCenterVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),getLeftVisibleCells:T(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,,],(n,i)=>(i??[]).map(o=>n.find(r=>r.column.id===o)).filter(Boolean).map(o=>({...o,position:"left"})),{key:"row.getLeftVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),getRightVisibleCells:T(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,i)=>(i??[]).map(o=>n.find(r=>r.column.id===o)).filter(Boolean).map(o=>({...o,position:"right"})),{key:"row.getRightVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}})}),createTable:e=>({setColumnPinning:t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),resetColumnPinning:t=>{var n,i;return e.setColumnPinning(t?es():(n=(i=e.initialState)==null?void 0:i.columnPinning)!=null?n:es())},getIsSomeColumnsPinned:t=>{var n;const i=e.getState().columnPinning;if(!t){var s,o;return!!((s=i.left)!=null&&s.length||(o=i.right)!=null&&o.length)}return!!((n=i[t])!=null&&n.length)},getLeftLeafColumns:T(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(i=>t.find(s=>s.id===i)).filter(Boolean),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}}),getRightLeafColumns:T(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(i=>t.find(s=>s.id===i)).filter(Boolean),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}}),getCenterLeafColumns:T(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,i)=>{const s=[...n??[],...i??[]];return t.filter(o=>!s.includes(o.id))},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}})})},ju={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Vt("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>({setRowSelection:t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),resetRowSelection:t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},toggleAllRowsSelected:t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const i={...n},s=e.getPreGroupedRowModel().flatRows;return t?s.forEach(o=>{o.getCanSelect()&&(i[o.id]=!0)}):s.forEach(o=>{delete i[o.id]}),i})},toggleAllPageRowsSelected:t=>e.setRowSelection(n=>{const i=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),s={...n};return e.getRowModel().rows.forEach(o=>{Ms(s,o.id,i,e)}),s}),getPreSelectedRowModel:()=>e.getCoreRowModel(),getSelectedRowModel:T(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?ns(e,n):{rows:[],flatRows:[],rowsById:{}},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),getFilteredSelectedRowModel:T(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?ns(e,n):{rows:[],flatRows:[],rowsById:{}},{key:"getFilteredSelectedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),getGroupedSelectedRowModel:T(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?ns(e,n):{rows:[],flatRows:[],rowsById:{}},{key:"getGroupedSelectedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),getIsAllRowsSelected:()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let i=!!(t.length&&Object.keys(n).length);return i&&t.some(s=>s.getCanSelect()&&!n[s.id])&&(i=!1),i},getIsAllPageRowsSelected:()=>{const t=e.getPaginationRowModel().flatRows,{rowSelection:n}=e.getState();let i=!!t.length;return i&&t.some(s=>s.getCanSelect()&&!n[s.id])&&(i=!1),i},getIsSomeRowsSelected:()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.some(n=>n.getIsSelected()||n.getIsSomeSelected())},getToggleAllRowsSelectedHandler:()=>t=>{e.toggleAllRowsSelected(t.target.checked)},getToggleAllPageRowsSelectedHandler:()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}}),createRow:(e,t)=>({toggleSelected:n=>{const i=e.getIsSelected();t.setRowSelection(s=>{if(n=typeof n<"u"?n:!i,i===n)return s;const o={...s};return Ms(o,e.id,n,t),o})},getIsSelected:()=>{const{rowSelection:n}=t.getState();return Ks(e,n)},getIsSomeSelected:()=>{const{rowSelection:n}=t.getState();return Ao(e,n)==="some"},getIsAllSubRowsSelected:()=>{const{rowSelection:n}=t.getState();return Ao(e,n)==="all"},getCanSelect:()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},getCanSelectSubRows:()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},getCanMultiSelect:()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},getToggleSelectedHandler:()=>{const n=e.getCanSelect();return i=>{var s;n&&e.toggleSelected((s=i.target)==null?void 0:s.checked)}}})},Ms=(e,t,n,i)=>{var s;const o=i.getRow(t);n?(o.getCanMultiSelect()||Object.keys(e).forEach(r=>delete e[r]),o.getCanSelect()&&(e[t]=!0)):delete e[t],(s=o.subRows)!=null&&s.length&&o.getCanSelectSubRows()&&o.subRows.forEach(r=>Ms(e,r.id,n,i))};function ns(e,t){const n=e.getState().rowSelection,i=[],s={},o=function(r,a){return r.map(l=>{var c;const u=Ks(l,n);if(u&&(i.push(l),s[l.id]=l),(c=l.subRows)!=null&&c.length&&(l={...l,subRows:o(l.subRows)}),u)return l}).filter(Boolean)};return{rows:o(t.rows),flatRows:i,rowsById:s}}function Ks(e,t){var n;return(n=t[e.id])!=null?n:!1}function Ao(e,t,n){if(e.subRows&&e.subRows.length){let i=!0,s=!1;return e.subRows.forEach(o=>{s&&!i||(Ks(o,t)?s=!0:i=!1)}),i?"all":s?"some":!1}return!1}const ks=/([0-9]+)/gm,Wu=(e,t,n)=>Na(ye(e.getValue(n)).toLowerCase(),ye(t.getValue(n)).toLowerCase()),Gu=(e,t,n)=>Na(ye(e.getValue(n)),ye(t.getValue(n))),qu=(e,t,n)=>Qs(ye(e.getValue(n)).toLowerCase(),ye(t.getValue(n)).toLowerCase()),Yu=(e,t,n)=>Qs(ye(e.getValue(n)),ye(t.getValue(n))),Uu=(e,t,n)=>{const i=e.getValue(n),s=t.getValue(n);return i>s?1:iQs(e.getValue(n),t.getValue(n));function Qs(e,t){return e===t?0:e>t?1:-1}function ye(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Na(e,t){const n=e.split(ks).filter(Boolean),i=t.split(ks).filter(Boolean);for(;n.length&&i.length;){const s=n.shift(),o=i.shift(),r=parseInt(s,10),a=parseInt(o,10),l=[r,a].sort();if(isNaN(l[0])){if(s>o)return 1;if(o>s)return-1;continue}if(isNaN(l[1]))return isNaN(r)?-1:1;if(r>a)return 1;if(a>r)return-1}return n.length-i.length}const cn={alphanumeric:Wu,alphanumericCaseSensitive:Gu,text:qu,textCaseSensitive:Yu,datetime:Uu,basic:Xu},Ku={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto"}),getDefaultOptions:e=>({onSortingChange:Vt("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>({getAutoSortingFn:()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let i=!1;for(const s of n){const o=s==null?void 0:s.getValue(e.id);if(Object.prototype.toString.call(o)==="[object Date]")return cn.datetime;if(typeof o=="string"&&(i=!0,o.split(ks).length>1))return cn.alphanumeric}return i?cn.text:cn.basic},getAutoSortDir:()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},getSortingFn:()=>{var n,i;if(!e)throw new Error;return pi(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(i=t.options.sortingFns)==null?void 0:i[e.columnDef.sortingFn])!=null?n:cn[e.columnDef.sortingFn]},toggleSorting:(n,i)=>{const s=e.getNextSortingOrder(),o=typeof n<"u"&&n!==null;t.setSorting(r=>{const a=r==null?void 0:r.find(h=>h.id===e.id),l=r==null?void 0:r.findIndex(h=>h.id===e.id);let c=[],u,f=o?n:s==="desc";if(r!=null&&r.length&&e.getCanMultiSort()&&i?a?u="toggle":u="add":r!=null&&r.length&&l!==r.length-1?u="replace":a?u="toggle":u="replace",u==="toggle"&&(o||s||(u="remove")),u==="add"){var d;c=[...r,{id:e.id,desc:f}],c.splice(0,c.length-((d=t.options.maxMultiSortColCount)!=null?d:Number.MAX_SAFE_INTEGER))}else u==="toggle"?c=r.map(h=>h.id===e.id?{...h,desc:f}:h):u==="remove"?c=r.filter(h=>h.id!==e.id):c=[{id:e.id,desc:f}];return c})},getFirstSortDir:()=>{var n,i;return((n=(i=e.columnDef.sortDescFirst)!=null?i:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},getNextSortingOrder:n=>{var i,s;const o=e.getFirstSortDir(),r=e.getIsSorted();return r?r!==o&&((i=t.options.enableSortingRemoval)==null||i)&&(!(n&&(s=t.options.enableMultiRemove)!=null)||s)?!1:r==="desc"?"asc":"desc":o},getCanSort:()=>{var n,i;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((i=t.options.enableSorting)!=null?i:!0)&&!!e.accessorFn},getCanMultiSort:()=>{var n,i;return(n=(i=e.columnDef.enableMultiSort)!=null?i:t.options.enableMultiSort)!=null?n:!!e.accessorFn},getIsSorted:()=>{var n;const i=(n=t.getState().sorting)==null?void 0:n.find(s=>s.id===e.id);return i?i.desc?"desc":"asc":!1},getSortIndex:()=>{var n,i;return(n=(i=t.getState().sorting)==null?void 0:i.findIndex(s=>s.id===e.id))!=null?n:-1},clearSorting:()=>{t.setSorting(n=>n!=null&&n.length?n.filter(i=>i.id!==e.id):[])},getToggleSortingHandler:()=>{const n=e.getCanSort();return i=>{n&&(i.persist==null||i.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(i):!1))}}}),createTable:e=>({setSorting:t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),resetSorting:t=>{var n,i;e.setSorting(t?[]:(n=(i=e.initialState)==null?void 0:i.sorting)!=null?n:[])},getPreSortedRowModel:()=>e.getGroupedRowModel(),getSortedRowModel:()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())})},Qu={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Vt("columnVisibility",e)}),createColumn:(e,t)=>({toggleVisibility:n=>{e.getCanHide()&&t.setColumnVisibility(i=>({...i,[e.id]:n??!e.getIsVisible()}))},getIsVisible:()=>{var n,i;return(n=(i=t.getState().columnVisibility)==null?void 0:i[e.id])!=null?n:!0},getCanHide:()=>{var n,i;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((i=t.options.enableHiding)!=null?i:!0)},getToggleVisibilityHandler:()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}}),createRow:(e,t)=>({_getAllVisibleCells:T(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(i=>i.column.getIsVisible()),{key:"row._getAllVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),getVisibleCells:T(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,i,s)=>[...n,...i,...s],{key:!1,debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}})}),createTable:e=>{const t=(n,i)=>T(()=>[i(),i().filter(s=>s.getIsVisible()).map(s=>s.id).join("_")],s=>s.filter(o=>o.getIsVisible==null?void 0:o.getIsVisible()),{key:n,debug:()=>{var s;return(s=e.options.debugAll)!=null?s:e.options.debugColumns}});return{getVisibleFlatColumns:t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),getVisibleLeafColumns:t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),getLeftVisibleLeafColumns:t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),getRightVisibleLeafColumns:t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),getCenterVisibleLeafColumns:t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),setColumnVisibility:n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),resetColumnVisibility:n=>{var i;e.setColumnVisibility(n?{}:(i=e.initialState.columnVisibility)!=null?i:{})},toggleAllColumnsVisible:n=>{var i;n=(i=n)!=null?i:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((s,o)=>({...s,[o.id]:n||!(o.getCanHide!=null&&o.getCanHide())}),{}))},getIsAllColumnsVisible:()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),getIsSomeColumnsVisible:()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),getToggleAllColumnsVisibilityHandler:()=>n=>{var i;e.toggleAllColumnsVisible((i=n.target)==null?void 0:i.checked)}}}},Po=[Cu,Qu,Hu,Bu,$u,Ku,Vu,Ru,Nu,ju,Mu];function Zu(e){var t;(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");let n={_features:Po};const i=n._features.reduce((u,f)=>Object.assign(u,f.getDefaultOptions==null?void 0:f.getDefaultOptions(n)),{}),s=u=>n.options.mergeOptions?n.options.mergeOptions(i,u):{...i,...u};let r={...{},...(t=e.initialState)!=null?t:{}};n._features.forEach(u=>{var f;r=(f=u.getInitialState==null?void 0:u.getInitialState(r))!=null?f:r});const a=[];let l=!1;const c={_features:Po,options:{...i,...e},initialState:r,_queue:u=>{a.push(u),l||(l=!0,Promise.resolve().then(()=>{for(;a.length;)a.shift()();l=!1}).catch(f=>setTimeout(()=>{throw f})))},reset:()=>{n.setState(n.initialState)},setOptions:u=>{const f=he(u,n.options);n.options=s(f)},getState:()=>n.options.state,setState:u=>{n.options.onStateChange==null||n.options.onStateChange(u)},_getRowId:(u,f,d)=>{var h;return(h=n.options.getRowId==null?void 0:n.options.getRowId(u,f,d))!=null?h:`${d?[d.id,f].join("."):f}`},getCoreRowModel:()=>(n._getCoreRowModel||(n._getCoreRowModel=n.options.getCoreRowModel(n)),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:u=>{const f=n.getRowModel().rowsById[u];if(!f)throw new Error;return f},_getDefaultColumnDef:T(()=>[n.options.defaultColumn],u=>{var f;return u=(f=u)!=null?f:{},{header:d=>{const h=d.header.column.columnDef;return h.accessorKey?h.accessorKey:h.accessorFn?h.id:null},cell:d=>{var h,g;return(h=(g=d.renderValue())==null||g.toString==null?void 0:g.toString())!=null?h:null},...n._features.reduce((d,h)=>Object.assign(d,h.getDefaultColumnDef==null?void 0:h.getDefaultColumnDef()),{}),...u}},{debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns},key:!1}),_getColumnDefs:()=>n.options.columns,getAllColumns:T(()=>[n._getColumnDefs()],u=>{const f=function(d,h,g){return g===void 0&&(g=0),d.map(p=>{const m=Su(n,p,g,h),_=p;return m.columns=_.columns?f(_.columns,m,g+1):[],m})};return f(u)},{key:!1,debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),getAllFlatColumns:T(()=>[n.getAllColumns()],u=>u.flatMap(f=>f.getFlatColumns()),{key:!1,debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),_getAllFlatColumnsById:T(()=>[n.getAllFlatColumns()],u=>u.reduce((f,d)=>(f[d.id]=d,f),{}),{key:!1,debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),getAllLeafColumns:T(()=>[n.getAllColumns(),n._getOrderColumnsFn()],(u,f)=>{let d=u.flatMap(h=>h.getLeafColumns());return f(d)},{key:!1,debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),getColumn:u=>n._getAllFlatColumnsById()[u]};return Object.assign(n,c),n._features.forEach(u=>Object.assign(n,u.createTable==null?void 0:u.createTable(n))),n}function Ju(e,t,n,i){const s=()=>{var r;return(r=o.getValue())!=null?r:e.options.renderFallbackValue},o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(i),renderValue:s,getContext:T(()=>[e,n,t,o],(r,a,l,c)=>({table:r,column:a,row:l,cell:c,getValue:c.getValue,renderValue:c.renderValue}),{key:!1,debug:()=>e.options.debugAll})};return e._features.forEach(r=>{Object.assign(o,r.createCell==null?void 0:r.createCell(o,n,t,e))},{}),o}const tf=(e,t,n,i,s,o,r)=>{let a={id:t,index:i,original:n,depth:s,parentRow:r,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(a._valuesCache.hasOwnProperty(l))return a._valuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return a._valuesCache[l]=c.accessorFn(a.original,i),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=c.columnDef.getUniqueValues(a.original,i),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var c;return(c=a.getValue(l))!=null?c:e.options.renderFallbackValue},subRows:o??[],getLeafRows:()=>wu(a.subRows,l=>l.subRows),getAllCells:T(()=>[e.getAllLeafColumns()],l=>l.map(c=>Ju(e,a,c,c.id)),{key:!1,debug:()=>{var l;return(l=e.options.debugAll)!=null?l:e.options.debugRows}}),_getAllCellsByColumnId:T(()=>[a.getAllCells()],l=>l.reduce((c,u)=>(c[u.column.id]=u,c),{}),{key:"row.getAllCellsByColumnId",debug:()=>{var l;return(l=e.options.debugAll)!=null?l:e.options.debugRows}})};for(let l=0;lT(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},i=function(s,o,r){o===void 0&&(o=0);const a=[];for(let c=0;c{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}/** + * svelte-table + * + * Copyright (c) TanStack + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function nf(e){let t;return{c(){t=Z(e[0])},l(n){t=oc(n,e[0])},m(n,i){Jl(n,t,i)},p(n,[i]){i&1&&Wt(t,n[0])},i:ht,o:ht,d(n){n&&X(t)}}}function sf(e,t,n){let{content:i}=t;return e.$$set=s=>{"content"in s&&n(0,i=s.content)},[i]}class of extends K{constructor(t){super(),Q(this,t,sf,nf,U,{content:0})}}const rf=Ca((e,t,n,i)=>`${vc(t.content)}`);var af=typeof document>"u"?rf:of;function lf(e,t,n){let i,s;return i=new t({props:n,$$inline:!0}),{c(){I(i.$$.fragment)},l(o){Sc(i.$$.fragment,o)},m(o,r){E(i,o,r),s=!0},p:ht,i(o){s||(S(i.$$.fragment,o),s=!0)},o(o){C(i.$$.fragment,o),s=!1},d(o){L(i,o)}}}function cf(e,t){return class extends K{constructor(i){super(),Q(this,i,null,s=>lf(s,e,t),U,{},void 0)}}}function uf(e,t){return Ca((i,s,o,r)=>`${wc(e,"TableComponent").$$render(i,t,{},{})}`)}const Ba=typeof window>"u"?uf:cf;function ff(e){return typeof e=="object"&&typeof e.$$render=="function"&&typeof e.render=="function"}function df(e){var t,n;let i="__SVELTE_HMR"in window;return e.prototype instanceof K||i&&((t=e.name)==null?void 0:t.startsWith("Proxy<"))&&((n=e.name)==null?void 0:n.endsWith(">"))}function Do(e){return typeof document>"u"?ff(e):df(e)}function Oo(e){return Ba(af,{content:e})}function mi(e,t){if(!e)return null;if(Do(e))return Ba(e,t);if(typeof e=="function"){const n=e(t);return Do(n)?n:Oo(n)}return Oo(e)}function hf(e){let t;"subscribe"in e?t=e:t=ms(e);let n={state:{},onStateChange:()=>{},renderFallbackValue:null,...jl(t)},i=Zu(n),s=Ft(i.initialState),o=qs([s,t],a=>a);return ms(i,function(l){const c=o.subscribe(u=>{let[f,d]=u;i.setOptions(h=>({...h,...d,state:{...f,...d.state},onStateChange:g=>{g instanceof Function?s.update(g):s.set(g),n.onStateChange==null||n.onStateChange(g)}})),l(i)});return function(){c()}})}const _i=Math.min,De=Math.max,bi=Math.round,Hn=Math.floor,xe=e=>({x:e,y:e}),gf={left:"right",right:"left",bottom:"top",top:"bottom"},pf={start:"end",end:"start"};function Fo(e,t,n){return De(e,_i(t,n))}function Ti(e,t){return typeof e=="function"?e(t):e}function Le(e){return e.split("-")[0]}function Ii(e){return e.split("-")[1]}function ja(e){return e==="x"?"y":"x"}function Wa(e){return e==="y"?"height":"width"}function tn(e){return["top","bottom"].includes(Le(e))?"y":"x"}function Ga(e){return ja(tn(e))}function mf(e,t,n){n===void 0&&(n=!1);const i=Ii(e),s=Ga(e),o=Wa(s);let r=s==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(r=yi(r)),[r,yi(r)]}function _f(e){const t=yi(e);return[Rs(e),t,Rs(t)]}function Rs(e){return e.replace(/start|end/g,t=>pf[t])}function bf(e,t,n){const i=["left","right"],s=["right","left"],o=["top","bottom"],r=["bottom","top"];switch(e){case"top":case"bottom":return n?t?s:i:t?i:s;case"left":case"right":return t?o:r;default:return[]}}function yf(e,t,n,i){const s=Ii(e);let o=bf(Le(e),n==="start",i);return s&&(o=o.map(r=>r+"-"+s),t&&(o=o.concat(o.map(Rs)))),o}function yi(e){return e.replace(/left|right|bottom|top/g,t=>gf[t])}function xf(e){return{top:0,right:0,bottom:0,left:0,...e}}function vf(e){return typeof e!="number"?xf(e):{top:e,right:e,bottom:e,left:e}}function xi(e){const{x:t,y:n,width:i,height:s}=e;return{width:i,height:s,top:n,left:t,right:t+i,bottom:n+s,x:t,y:n}}function Eo(e,t,n){let{reference:i,floating:s}=e;const o=tn(t),r=Ga(t),a=Wa(r),l=Le(t),c=o==="y",u=i.x+i.width/2-s.width/2,f=i.y+i.height/2-s.height/2,d=i[a]/2-s[a]/2;let h;switch(l){case"top":h={x:u,y:i.y-s.height};break;case"bottom":h={x:u,y:i.y+i.height};break;case"right":h={x:i.x+i.width,y:f};break;case"left":h={x:i.x-s.width,y:f};break;default:h={x:i.x,y:i.y}}switch(Ii(t)){case"start":h[r]-=d*(n&&c?-1:1);break;case"end":h[r]+=d*(n&&c?-1:1);break}return h}const wf=async(e,t,n)=>{const{placement:i="bottom",strategy:s="absolute",middleware:o=[],platform:r}=n,a=o.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(t));let c=await r.getElementRects({reference:e,floating:t,strategy:s}),{x:u,y:f}=Eo(c,i,l),d=i,h={},g=0;for(let p=0;pit<=0)){var R,V;const it=(((R=o.flip)==null?void 0:R.index)||0)+1,H=k[it];if(H)return{data:{index:it,overflows:O},reset:{placement:H}};let B=(V=O.filter(N=>N.overflows[0]<=0).sort((N,st)=>N.overflows[1]-st.overflows[1])[0])==null?void 0:V.placement;if(!B)switch(h){case"bestFit":{var ct;const N=(ct=O.filter(st=>{if(M){const G=tn(st.placement);return G===b||G==="y"}return!0}).map(st=>[st.placement,st.overflows.filter(G=>G>0).reduce((G,Et)=>G+Et,0)]).sort((st,G)=>st[1]-G[1])[0])==null?void 0:ct[0];N&&(B=N);break}case"initialPlacement":B=a;break}if(s!==B)return{reset:{placement:B}}}return{}}}};async function Cf(e,t){const{placement:n,platform:i,elements:s}=e,o=await(i.isRTL==null?void 0:i.isRTL(s.floating)),r=Le(n),a=Ii(n),l=tn(n)==="y",c=["left","top"].includes(r)?-1:1,u=o&&l?-1:1,f=Ti(t,e);let{mainAxis:d,crossAxis:h,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),l?{x:h*u,y:d*c}:{x:d*c,y:h*u}}const Mf=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,i;const{x:s,y:o,placement:r,middlewareData:a}=t,l=await Cf(t,e);return r===((n=a.offset)==null?void 0:n.placement)&&(i=a.arrow)!=null&&i.alignmentOffset?{}:{x:s+l.x,y:o+l.y,data:{...l,placement:r}}}}},kf=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:i,placement:s}=t,{mainAxis:o=!0,crossAxis:r=!1,limiter:a={fn:m=>{let{x:_,y:b}=m;return{x:_,y:b}}},...l}=Ti(e,t),c={x:n,y:i},u=await qa(t,l),f=tn(Le(s)),d=ja(f);let h=c[d],g=c[f];if(o){const m=d==="y"?"top":"left",_=d==="y"?"bottom":"right",b=h+u[m],x=h-u[_];h=Fo(b,h,x)}if(r){const m=f==="y"?"top":"left",_=f==="y"?"bottom":"right",b=g+u[m],x=g-u[_];g=Fo(b,g,x)}const p=a.fn({...t,[d]:h,[f]:g});return{...p,data:{x:p.x-n,y:p.y-i,enabled:{[d]:o,[f]:r}}}}}};function Vi(){return typeof window<"u"}function an(e){return Ya(e)?(e.nodeName||"").toLowerCase():"#document"}function Mt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function te(e){var t;return(t=(Ya(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ya(e){return Vi()?e instanceof Node||e instanceof Mt(e).Node:!1}function qt(e){return Vi()?e instanceof Element||e instanceof Mt(e).Element:!1}function Qt(e){return Vi()?e instanceof HTMLElement||e instanceof Mt(e).HTMLElement:!1}function Lo(e){return!Vi()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Mt(e).ShadowRoot}function Dn(e){const{overflow:t,overflowX:n,overflowY:i,display:s}=Yt(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&!["inline","contents"].includes(s)}function Rf(e){return["table","td","th"].includes(an(e))}function zi(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Zs(e){const t=Js(),n=qt(e)?Yt(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(i=>(n.willChange||"").includes(i))||["paint","layout","strict","content"].some(i=>(n.contain||"").includes(i))}function $f(e){let t=ve(e);for(;Qt(t)&&!en(t);){if(Zs(t))return t;if(zi(t))return null;t=ve(t)}return null}function Js(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function en(e){return["html","body","#document"].includes(an(e))}function Yt(e){return Mt(e).getComputedStyle(e)}function Hi(e){return qt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ve(e){if(an(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Lo(e)&&e.host||te(e);return Lo(t)?t.host:t}function Ua(e){const t=ve(e);return en(t)?e.ownerDocument?e.ownerDocument.body:e.body:Qt(t)&&Dn(t)?t:Ua(t)}function Cn(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=Ua(e),o=s===((i=e.ownerDocument)==null?void 0:i.body),r=Mt(s);if(o){const a=$s(r);return t.concat(r,r.visualViewport||[],Dn(s)?s:[],a&&n?Cn(a):[])}return t.concat(s,Cn(s,[],n))}function $s(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Xa(e){const t=Yt(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const s=Qt(e),o=s?e.offsetWidth:n,r=s?e.offsetHeight:i,a=bi(n)!==o||bi(i)!==r;return a&&(n=o,i=r),{width:n,height:i,$:a}}function to(e){return qt(e)?e:e.contextElement}function Xe(e){const t=to(e);if(!Qt(t))return xe(1);const n=t.getBoundingClientRect(),{width:i,height:s,$:o}=Xa(t);let r=(o?bi(n.width):n.width)/i,a=(o?bi(n.height):n.height)/s;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const Af=xe(0);function Ka(e){const t=Mt(e);return!Js()||!t.visualViewport?Af:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Pf(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Mt(e)?!1:t}function Te(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=to(e);let r=xe(1);t&&(i?qt(i)&&(r=Xe(i)):r=Xe(e));const a=Pf(o,n,i)?Ka(o):xe(0);let l=(s.left+a.x)/r.x,c=(s.top+a.y)/r.y,u=s.width/r.x,f=s.height/r.y;if(o){const d=Mt(o),h=i&&qt(i)?Mt(i):i;let g=d,p=$s(g);for(;p&&i&&h!==g;){const m=Xe(p),_=p.getBoundingClientRect(),b=Yt(p),x=_.left+(p.clientLeft+parseFloat(b.paddingLeft))*m.x,v=_.top+(p.clientTop+parseFloat(b.paddingTop))*m.y;l*=m.x,c*=m.y,u*=m.x,f*=m.y,l+=x,c+=v,g=Mt(p),p=$s(g)}}return xi({width:u,height:f,x:l,y:c})}function Df(e){let{elements:t,rect:n,offsetParent:i,strategy:s}=e;const o=s==="fixed",r=te(i),a=t?zi(t.floating):!1;if(i===r||a&&o)return n;let l={scrollLeft:0,scrollTop:0},c=xe(1);const u=xe(0),f=Qt(i);if((f||!f&&!o)&&((an(i)!=="body"||Dn(r))&&(l=Hi(i)),Qt(i))){const d=Te(i);c=Xe(i),u.x=d.x+i.clientLeft,u.y=d.y+i.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}}function Of(e){return Array.from(e.getClientRects())}function As(e,t){const n=Hi(e).scrollLeft;return t?t.left+n:Te(te(e)).left+n}function Ff(e){const t=te(e),n=Hi(e),i=e.ownerDocument.body,s=De(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),o=De(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let r=-n.scrollLeft+As(e);const a=-n.scrollTop;return Yt(i).direction==="rtl"&&(r+=De(t.clientWidth,i.clientWidth)-s),{width:s,height:o,x:r,y:a}}function Ef(e,t){const n=Mt(e),i=te(e),s=n.visualViewport;let o=i.clientWidth,r=i.clientHeight,a=0,l=0;if(s){o=s.width,r=s.height;const c=Js();(!c||c&&t==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:o,height:r,x:a,y:l}}function Lf(e,t){const n=Te(e,!0,t==="fixed"),i=n.top+e.clientTop,s=n.left+e.clientLeft,o=Qt(e)?Xe(e):xe(1),r=e.clientWidth*o.x,a=e.clientHeight*o.y,l=s*o.x,c=i*o.y;return{width:r,height:a,x:l,y:c}}function To(e,t,n){let i;if(t==="viewport")i=Ef(e,n);else if(t==="document")i=Ff(te(e));else if(qt(t))i=Lf(t,n);else{const s=Ka(e);i={...t,x:t.x-s.x,y:t.y-s.y}}return xi(i)}function Qa(e,t){const n=ve(e);return n===t||!qt(n)||en(n)?!1:Yt(n).position==="fixed"||Qa(n,t)}function Tf(e,t){const n=t.get(e);if(n)return n;let i=Cn(e,[],!1).filter(a=>qt(a)&&an(a)!=="body"),s=null;const o=Yt(e).position==="fixed";let r=o?ve(e):e;for(;qt(r)&&!en(r);){const a=Yt(r),l=Zs(r);!l&&a.position==="fixed"&&(s=null),(o?!l&&!s:!l&&a.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||Dn(r)&&!l&&Qa(e,r))?i=i.filter(u=>u!==r):s=a,r=ve(r)}return t.set(e,i),i}function If(e){let{element:t,boundary:n,rootBoundary:i,strategy:s}=e;const r=[...n==="clippingAncestors"?zi(t)?[]:Tf(t,this._c):[].concat(n),i],a=r[0],l=r.reduce((c,u)=>{const f=To(t,u,s);return c.top=De(f.top,c.top),c.right=_i(f.right,c.right),c.bottom=_i(f.bottom,c.bottom),c.left=De(f.left,c.left),c},To(t,a,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Vf(e){const{width:t,height:n}=Xa(e);return{width:t,height:n}}function zf(e,t,n){const i=Qt(t),s=te(t),o=n==="fixed",r=Te(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=xe(0);if(i||!i&&!o)if((an(t)!=="body"||Dn(s))&&(a=Hi(t)),i){const h=Te(t,!0,o,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else s&&(l.x=As(s));let c=0,u=0;if(s&&!i&&!o){const h=s.getBoundingClientRect();u=h.top+a.scrollTop,c=h.left+a.scrollLeft-As(s,h)}const f=r.left+a.scrollLeft-l.x-c,d=r.top+a.scrollTop-l.y-u;return{x:f,y:d,width:r.width,height:r.height}}function is(e){return Yt(e).position==="static"}function Io(e,t){if(!Qt(e)||Yt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return te(e)===n&&(n=n.ownerDocument.body),n}function Za(e,t){const n=Mt(e);if(zi(e))return n;if(!Qt(e)){let s=ve(e);for(;s&&!en(s);){if(qt(s)&&!is(s))return s;s=ve(s)}return n}let i=Io(e,t);for(;i&&Rf(i)&&is(i);)i=Io(i,t);return i&&en(i)&&is(i)&&!Zs(i)?n:i||$f(e)||n}const Hf=async function(e){const t=this.getOffsetParent||Za,n=this.getDimensions,i=await n(e.floating);return{reference:zf(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Nf(e){return Yt(e).direction==="rtl"}const Bf={convertOffsetParentRelativeRectToViewportRelativeRect:Df,getDocumentElement:te,getClippingRect:If,getOffsetParent:Za,getElementRects:Hf,getClientRects:Of,getDimensions:Vf,getScale:Xe,isElement:qt,isRTL:Nf};function jf(e,t){let n=null,i;const s=te(e);function o(){var a;clearTimeout(i),(a=n)==null||a.disconnect(),n=null}function r(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const{left:c,top:u,width:f,height:d}=e.getBoundingClientRect();if(a||t(),!f||!d)return;const h=Hn(u),g=Hn(s.clientWidth-(c+f)),p=Hn(s.clientHeight-(u+d)),m=Hn(c),b={rootMargin:-h+"px "+-g+"px "+-p+"px "+-m+"px",threshold:De(0,_i(1,l))||1};let x=!0;function v(y){const M=y[0].intersectionRatio;if(M!==l){if(!x)return r();M?r(!1,M):i=setTimeout(()=>{r(!1,1e-7)},1e3)}x=!1}try{n=new IntersectionObserver(v,{...b,root:s.ownerDocument})}catch{n=new IntersectionObserver(v,b)}n.observe(e)}return r(!0),o}function Wf(e,t,n,i){i===void 0&&(i={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,c=to(e),u=s||o?[...c?Cn(c):[],...Cn(t)]:[];u.forEach(_=>{s&&_.addEventListener("scroll",n,{passive:!0}),o&&_.addEventListener("resize",n)});const f=c&&a?jf(c,n):null;let d=-1,h=null;r&&(h=new ResizeObserver(_=>{let[b]=_;b&&b.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let g,p=l?Te(e):null;l&&m();function m(){const _=Te(e);p&&(_.x!==p.x||_.y!==p.y||_.width!==p.width||_.height!==p.height)&&n(),p=_,g=requestAnimationFrame(m)}return n(),()=>{var _;u.forEach(b=>{s&&b.removeEventListener("scroll",n),o&&b.removeEventListener("resize",n)}),f==null||f(),(_=h)==null||_.disconnect(),h=null,l&&cancelAnimationFrame(g)}}const Gf=Mf,qf=kf,Yf=Sf,Uf=(e,t,n)=>{const i=new Map,s={platform:Bf,...n},o={...s.platform,_c:i};return wf(e,t,{...s,platform:o})};function Xf(e){let t,n;const i={autoUpdate:!0};let s=e;const o=u=>({...i,...e||{},...u||{}}),r=u=>{t&&n&&(s=o(u),Uf(t,n,s).then(f=>{Object.assign(n.style,{position:f.strategy,left:`${f.x}px`,top:`${f.y}px`}),s!=null&&s.onComputed&&s.onComputed(f)}))},a=u=>{if("subscribe"in u)return c(u),{};t=u,r()},l=(u,f)=>{let d;n=u,s=o(f),setTimeout(()=>r(f),0),r(f);const h=()=>{d&&(d(),d=void 0)},g=({autoUpdate:p}=s||{})=>{h(),p!==!1&&Gs().then(()=>Wf(t,n,()=>r(s),p===!0?{}:p))};return d=g(),{update(p){r(p),d=g(p)},destroy(){h()}}},c=u=>{const f=u.subscribe(d=>{t===void 0?(t=d,r()):(Object.assign(t,d),r())});rn(f)};return[a,l,r]}function Kf(e){const t=e-1;return t*t*t+1}function Vo(e,{delay:t=0,duration:n=400,easing:i=ha}={}){const s=+getComputedStyle(e).opacity;return{delay:t,duration:n,easing:i,css:o=>`opacity: ${o*s}`}}function zo(e,{delay:t=0,duration:n=400,easing:i=Kf,start:s=0,opacity:o=0}={}){const r=getComputedStyle(e),a=+r.opacity,l=r.transform==="none"?"":r.transform,c=1-s,u=a*(1-o);return{delay:t,duration:n,easing:i,css:(f,d)=>` + transform: ${l} scale(${1-c*d}); + opacity: ${a-u*d} + `}}function Qf(e){let t,n,i,s,o;const r=e[2].default,a=At(r,e,e[1],null);return{c(){t=D("div"),a&&a.c(),t.hidden=!0},m(l,c){nt(l,t,c),a&&a.m(t,null),i=!0,s||(o=Bs(n=Zf.call(null,t,e[0])),s=!0)},p(l,[c]){a&&a.p&&(!i||c&2)&&Dt(a,r,l,l[1],i?Pt(r,l[1],c,null):Ot(l[1]),null),n&&le(n.update)&&c&1&&n.update.call(null,l[0])},i(l){i||(S(a,l),i=!0)},o(l){C(a,l),i=!1},d(l){l&&X(t),a&&a.d(l),s=!1,o()}}}function Zf(e,t="body"){let n;async function i(o){if(t=o,typeof t=="string"){if(n=document.querySelector(t),n===null&&(await Gs(),n=document.querySelector(t)),n===null)throw new Error(`No element found matching css selector: "${t}"`)}else if(t instanceof HTMLElement)n=t;else throw new TypeError(`Unknown portal target type: ${t===null?"null":typeof t}. Allowed types: string (CSS selector) or HTMLElement.`);n.appendChild(e),e.hidden=!1}function s(){e.parentNode&&e.parentNode.removeChild(e)}return i(t),{update:i,destroy:s}}function Jf(e,t,n){let{$$slots:i={},$$scope:s}=t,{target:o="body"}=t;return e.$$set=r=>{"target"in r&&n(0,o=r.target),"$$scope"in r&&n(1,s=r.$$scope)},[o,s,i]}class td extends K{constructor(t){super(),Q(this,t,Jf,Qf,U,{target:0})}}const ed=e=>({}),Ho=e=>({floatingRef:e[3],displayTooltip:e[5],hideTooltip:e[6]});function No(e){let t,n;return t=new td({props:{target:"body",$$slots:{default:[nd]},$$scope:{ctx:e}}}),{c(){I(t.$$.fragment)},m(i,s){E(t,i,s),n=!0},p(i,s){const o={};s&257&&(o.$$scope={dirty:s,ctx:i}),t.$set(o)},i(i){n||(S(t.$$.fragment,i),n=!0)},o(i){C(t.$$.fragment,i),n=!1},d(i){L(t,i)}}}function nd(e){let t,n,i,s,o,r;return{c(){t=D("div"),n=Z(e[0]),F(t,"class","absolute p-2 text-sm bg-dark-50 text-dark-400 rounded-md max-w-xl font-main")},m(a,l){nt(a,t,l),w(t,n),s=!0,o||(r=Bs(e[4].call(null,t)),o=!0)},p(a,l){(!s||l&1)&&Wt(n,a[0])},i(a){s||(Je(()=>{s&&(i||(i=di(t,Vo,{duration:150},!0)),i.run(1))}),s=!0)},o(a){i||(i=di(t,Vo,{duration:150},!1)),i.run(0),s=!1},d(a){a&&X(t),a&&i&&i.end(),o=!1,r()}}}function id(e){let t,n,i;const s=e[7].default,o=At(s,e,e[8],Ho);let r=e[2]&&!e[1]&&No(e);return{c(){o&&o.c(),t=Y(),r&&r.c(),n=Pn()},m(a,l){o&&o.m(a,l),nt(a,t,l),r&&r.m(a,l),nt(a,n,l),i=!0},p(a,[l]){o&&o.p&&(!i||l&256)&&Dt(o,s,a,a[8],i?Pt(s,a[8],l,ed):Ot(a[8]),Ho),a[2]&&!a[1]?r?(r.p(a,l),l&6&&S(r,1)):(r=No(a),r.c(),S(r,1),r.m(n.parentNode,n)):r&&(kt(),C(r,1,1,()=>{r=null}),Rt())},i(a){i||(S(o,a),S(r),i=!0)},o(a){C(o,a),C(r),i=!1},d(a){o&&o.d(a),a&&X(t),r&&r.d(a),a&&X(n)}}}function sd(e,t,n){let{$$slots:i={},$$scope:s}=t,{content:o}=t,{disabled:r}=t;const[a,l]=Xf({strategy:"absolute",placement:"top",middleware:[Gf(6),Yf(),qf()]});let c=!1,u;const f=()=>{r||(clearTimeout(u),u=setTimeout(()=>{n(2,c=!0)},300))},d=()=>{r||(clearTimeout(u),n(2,c=!1))};return e.$$set=h=>{"content"in h&&n(0,o=h.content),"disabled"in h&&n(1,r=h.disabled),"$$scope"in h&&n(8,s=h.$$scope)},[o,r,c,a,l,f,d,i,s]}class od extends K{constructor(t){super(),Q(this,t,sd,id,U,{content:0,disabled:1})}}function Bo(e,t,n){const i=e.slice();return i[10]=t[n],i}function jo(e,t,n){const i=e.slice();return i[13]=t[n],i}function Wo(e,t,n){const i=e.slice();return i[19]=t[n],i}function Go(e,t,n){const i=e.slice();return i[22]=t[n],i}function qo(e){let t,n,i,s,o,r,a,l,c,u;var f=mi(e[22].column.columnDef.header,e[22].getContext());function d(m){return{}}f&&(n=be(f,d()));const h=[ad,rd],g=[];function p(m,_){return _&1&&(s=null),_&1&&(o=null),s==null&&(s=m[22].column.getIsSorted()==="asc"),s?0:(o==null&&(o=m[22].column.getIsSorted()==="desc"),o?1:-1)}return~(r=p(e,-1))&&(a=g[r]=h[r](e)),{c(){t=D("button"),n&&I(n.$$.fragment),i=Y(),a&&a.c(),F(t,"class","flex w-full items-center justify-center gap-1"),Tn(t,"cursor-pointer",e[22].column.getCanSort()),Tn(t,"select-none",e[22].column.getCanSort())},m(m,_){nt(m,t,_),n&&E(n,t,null),w(t,i),~r&&g[r].m(t,null),l=!0,c||(u=It(t,"click",function(){le(e[22].column.getToggleSortingHandler())&&e[22].column.getToggleSortingHandler().apply(this,arguments)}),c=!0)},p(m,_){if(e=m,_&1&&f!==(f=mi(e[22].column.columnDef.header,e[22].getContext()))){if(n){kt();const x=n;C(x.$$.fragment,1,0,()=>{L(x,1)}),Rt()}f?(n=be(f,d()),I(n.$$.fragment),S(n.$$.fragment,1),E(n,t,i)):n=null}let b=r;r=p(e,_),r!==b&&(a&&(kt(),C(g[b],1,1,()=>{g[b]=null}),Rt()),~r?(a=g[r],a||(a=g[r]=h[r](e),a.c()),S(a,1),a.m(t,null)):a=null),(!l||_&1)&&Tn(t,"cursor-pointer",e[22].column.getCanSort()),(!l||_&1)&&Tn(t,"select-none",e[22].column.getCanSort())},i(m){l||(n&&S(n.$$.fragment,m),S(a),l=!0)},o(m){n&&C(n.$$.fragment,m),C(a),l=!1},d(m){m&&X(t),n&&L(n),~r&&g[r].d(),c=!1,u()}}}function rd(e){let t,n;return t=new mu({}),{c(){I(t.$$.fragment)},m(i,s){E(t,i,s),n=!0},i(i){n||(S(t.$$.fragment,i),n=!0)},o(i){C(t.$$.fragment,i),n=!1},d(i){L(t,i)}}}function ad(e){let t,n;return t=new vu({}),{c(){I(t.$$.fragment)},m(i,s){E(t,i,s),n=!0},i(i){n||(S(t.$$.fragment,i),n=!0)},o(i){C(t.$$.fragment,i),n=!1},d(i){L(t,i)}}}function Yo(e){let t,n,i,s=!e[22].isPlaceholder&&qo(e);return{c(){t=D("th"),s&&s.c(),F(t,"class",n=`bg-dark-600 select-none p-1 ${e[22].id==="executionTime"?"w-1/4":"w-3/4"}`)},m(o,r){nt(o,t,r),s&&s.m(t,null),i=!0},p(o,r){o[22].isPlaceholder?s&&(kt(),C(s,1,1,()=>{s=null}),Rt()):s?(s.p(o,r),r&1&&S(s,1)):(s=qo(o),s.c(),S(s,1),s.m(t,null)),(!i||r&1&&n!==(n=`bg-dark-600 select-none p-1 ${o[22].id==="executionTime"?"w-1/4":"w-3/4"}`))&&F(t,"class",n)},i(o){i||(S(s),i=!0)},o(o){C(s),i=!1},d(o){o&&X(t),s&&s.d()}}}function Uo(e){let t,n,i,s=e[19].headers,o=[];for(let a=0;aC(o[a],1,1,()=>{o[a]=null});return{c(){t=D("tr");for(let a=0;a{L(f,1)}),Rt()}a?(n=be(a,l()),I(n.$$.fragment),S(n.$$.fragment,1),E(n,t,null)):n=null}(!s||u&1&&i!==(i=`${e[13].column.id==="executionTime"&&"text-center"} bg-dark-700 p-2 ${e[10].original.slow&&"text-yellow-500"} max-w-[200px] truncate`))&&F(t,"class",i)},i(c){s||(n&&S(n.$$.fragment,c),s=!0)},o(c){n&&C(n.$$.fragment,c),s=!1},d(c){c&&X(t),n&&L(n),o=!1,Zt(r)}}}function Xo(e){let t,n;return t=new od({props:{content:e[13].getValue(),disabled:e[13].column.id!=="query",$$slots:{default:[ld,({floatingRef:i,displayTooltip:s,hideTooltip:o})=>({16:i,17:s,18:o}),({floatingRef:i,displayTooltip:s,hideTooltip:o})=>(i?65536:0)|(s?131072:0)|(o?262144:0)]},$$scope:{ctx:e}}}),{c(){I(t.$$.fragment)},m(i,s){E(t,i,s),n=!0},p(i,s){const o={};s&1&&(o.content=i[13].getValue()),s&1&&(o.disabled=i[13].column.id!=="query"),s&33947649&&(o.$$scope={dirty:s,ctx:i}),t.$set(o)},i(i){n||(S(t.$$.fragment,i),n=!0)},o(i){C(t.$$.fragment,i),n=!1},d(i){L(t,i)}}}function Ko(e){let t,n,i,s=e[10].getVisibleCells(),o=[];for(let a=0;aC(o[a],1,1,()=>{o[a]=null});return{c(){t=D("tr");for(let a=0;aC(l[h],1,1,()=>{l[h]=null});let u=e[0].getRowModel().rows,f=[];for(let h=0;hC(f[h],1,1,()=>{f[h]=null});return{c(){t=D("div"),n=D("table"),i=D("thead");for(let h=0;hn(4,i=h)),gt(e,ii,h=>n(5,s=h));const r=Us(),a=[{accessorKey:"query",header:"Query",cell:h=>h.getValue(),enableSorting:!0},{accessorKey:"executionTime",header:"Time (ms)",cell:h=>h.getValue().toFixed(4),enableSorting:!0}];let l=[];const c=h=>{h instanceof Function?n(2,l=h(l)):n(2,l=h),u.update(g=>({...g,state:{...g.state,sorting:l}}))},u=Ft({data:s,columns:a,manualPagination:!0,manualSorting:!0,pageCount:-1,getCoreRowModel:ef(),onSortingChange:c,state:{sorting:l}}),f=hf(u);gt(e,f,h=>n(0,o=h));let d;return e.$$.update=()=>{e.$$.dirty&32&&u.update(h=>({...h,data:s})),e.$$.dirty&28&&(clearTimeout(d),n(3,d=setTimeout(()=>{Da("fetchResource",{resource:r.params.resource,pageIndex:i.page,search:i.search,sortBy:l})},300)))},[o,f,l,d,i,s]}class fd extends K{constructor(t){super(),Q(this,t,ud,cd,U,{})}}function dd(e){let t,n,i,s,o,r,a,l,c,u=e[0].resourceQueriesCount+"",f,d,h,g,p=e[0].resourceTime.toFixed(4)+"",m,_,b,x,v,y=e[0].resourceSlowQueries+"",M,k,$,P;return i=new Oa({}),{c(){t=D("div"),n=D("button"),I(i.$$.fragment),s=Y(),o=D("p"),o.textContent=`${e[1].params.resource}`,r=Y(),a=D("div"),l=D("p"),c=Z("Queries: "),f=Z(u),d=Y(),h=D("p"),g=Z("Time: "),m=Z(p),_=Z(" ms"),b=Y(),x=D("p"),v=Z("Slow queries: "),M=Z(y),F(n,"class","flex p-2 w-12 bg-dark-600 text-dark-100 hover:text-white rounded-md justify-center items-center hover:bg-dark-500 outline-none border-[1px] border-transparent focus-visible:border-cyan-600"),F(o,"class","text-center text-lg"),F(x,"class","text-yellow-500"),F(a,"class","text-end text-dark-100 flex flex-col text-xs"),F(t,"class","p-4 grid grid-flow-col grid-cols-3 items-center ")},m(O,R){nt(O,t,R),w(t,n),E(i,n,null),w(t,s),w(t,o),w(t,r),w(t,a),w(a,l),w(l,c),w(l,f),w(a,d),w(a,h),w(h,g),w(h,m),w(h,_),w(a,b),w(a,x),w(x,v),w(x,M),k=!0,$||(P=It(n,"click",e[2]),$=!0)},p(O,[R]){(!k||R&1)&&u!==(u=O[0].resourceQueriesCount+"")&&Wt(f,u),(!k||R&1)&&p!==(p=O[0].resourceTime.toFixed(4)+"")&&Wt(m,p),(!k||R&1)&&y!==(y=O[0].resourceSlowQueries+"")&&Wt(M,y)},i(O){k||(S(i.$$.fragment,O),k=!0)},o(O){C(i.$$.fragment,O),k=!1},d(O){O&&X(t),L(i),$=!1,P()}}}function hd(e,t,n){let i;gt(e,ws,r=>n(0,i=r));const s=Us();return[i,s,()=>Ee.goto("/")]}class gd extends K{constructor(t){super(),Q(this,t,hd,dd,U,{})}}function Ja(e,t){const n=i=>{const{action:s,data:o}=i.data;s===e&&t(o)};Li(()=>window.addEventListener("message",n)),rn(()=>window.removeEventListener("message",n))}const tl=()=>!window.invokeNative,el=(e,t=1e3)=>{if(tl())for(const n of e)setTimeout(()=>{window.dispatchEvent(new MessageEvent("message",{data:{action:n.action,data:n.data}}))},t)};function pd(e){let t,n,i,s,o,r,a,l;var c=e[0];function u(f){return{props:{class:"text-dark-300"}}}return c&&(i=be(c,u())),{c(){t=D("div"),n=D("div"),i&&I(i.$$.fragment),s=Y(),o=D("input"),F(n,"class","pr-2"),F(o,"type","text"),F(o,"class","w-full bg-transparent outline-none"),F(o,"placeholder","Search queries..."),F(t,"class","bg-dark-600 m-4 mt-0 flex items-center rounded-md border-[1px] border-transparent p-2 outline-none transition-all duration-100 focus-within:border-cyan-600")},m(f,d){nt(f,t,d),w(t,n),i&&E(i,n,null),w(t,s),w(t,o),ci(o,e[1]),r=!0,a||(l=It(o,"input",e[2]),a=!0)},p(f,[d]){if(d&1&&c!==(c=f[0])){if(i){kt();const h=i;C(h.$$.fragment,1,0,()=>{L(h,1)}),Rt()}c?(i=be(c,u()),I(i.$$.fragment),S(i.$$.fragment,1),E(i,n,null)):i=null}d&2&&o.value!==f[1]&&ci(o,f[1])},i(f){r||(i&&S(i.$$.fragment,f),r=!0)},o(f){i&&C(i.$$.fragment,f),r=!1},d(f){f&&X(t),i&&L(i),a=!1,l()}}}function md(e,t,n){let i;gt(e,Bt,a=>n(3,i=a));let s="",{icon:o}=t;function r(){s=this.value,n(1,s)}return e.$$set=a=>{"icon"in a&&n(0,o=a.icon)},e.$$.update=()=>{e.$$.dirty&2&&(mt(Bt,i.search=s,i),mt(Bt,i.page=0,i))},[o,s,r]}class _d extends K{constructor(t){super(),Q(this,t,md,pd,U,{icon:0})}}function bd(e){let t;const n=e[2].default,i=At(n,e,e[3],null);return{c(){i&&i.c()},m(s,o){i&&i.m(s,o),t=!0},p(s,o){i&&i.p&&(!t||o&8)&&Dt(i,n,s,s[3],t?Pt(n,s[3],o,null):Ot(s[3]),null)},i(s){t||(S(i,s),t=!0)},o(s){C(i,s),t=!1},d(s){i&&i.d(s)}}}function yd(e){let t,n;const i=[{name:"search"},e[1],{iconNode:e[0]}];let s={$$slots:{default:[bd]},$$scope:{ctx:e}};for(let o=0;o{n(1,t=z(z({},t),et(r))),"$$scope"in r&&n(3,s=r.$$scope)},t=et(t),[o,t,i,s]}class vd extends K{constructor(t){super(),Q(this,t,xd,yd,U,{})}}const nl=vd;function wd(e){let t,n,i,s,o,r,a,l,c,u;return i=new gd({}),o=new _d({props:{icon:nl}}),a=new fd({}),c=new fu({props:{maxPage:e[0]}}),{c(){t=D("div"),n=D("div"),I(i.$$.fragment),s=Y(),I(o.$$.fragment),r=Y(),I(a.$$.fragment),l=Y(),I(c.$$.fragment),F(t,"class","flex w-full flex-col justify-between")},m(f,d){nt(f,t,d),w(t,n),E(i,n,null),w(n,s),E(o,n,null),w(n,r),E(a,n,null),w(t,l),E(c,t,null),u=!0},p(f,[d]){const h={};d&1&&(h.maxPage=f[0]),c.$set(h)},i(f){u||(S(i.$$.fragment,f),S(o.$$.fragment,f),S(a.$$.fragment,f),S(c.$$.fragment,f),u=!0)},o(f){C(i.$$.fragment,f),C(o.$$.fragment,f),C(a.$$.fragment,f),C(c.$$.fragment,f),u=!1},d(f){f&&X(t),L(i),L(o),L(a),L(c)}}}function Sd(e,t,n){let i,s,o;gt(e,ws,a=>n(1,i=a)),gt(e,ii,a=>n(2,s=a)),gt(e,Bt,a=>n(3,o=a));let r=0;return rn(()=>{mt(ii,s=[],s),mt(Bt,o.page=0,o)}),el([{action:"loadResource",data:{queries:[{query:"SELECT * FROM users WHERE ID = 1",executionTime:3,slow:!1,date:Date.now()},{query:"SELECT * FROM users WHERE ID = 1",executionTime:23,slow:!0,date:Date.now()},{query:"SELECT * FROM users WHERE ID = 1",executionTime:15,slow:!1,date:Date.now()},{query:"SELECT * FROM users WHERE ID = 1",executionTime:122,slow:!0,date:Date.now()}],resourceQueriesCount:3,resourceSlowQueries:2,resourceTime:1342,pageCount:3}}]),Ja("loadResource",a=>{n(0,r=a.pageCount),mt(ii,s=a.queries,s),mt(ws,i={resourceQueriesCount:a.resourceQueriesCount,resourceSlowQueries:a.resourceSlowQueries,resourceTime:a.resourceTime},i)}),[r]}class Cd extends K{constructor(t){super(),Q(this,t,Sd,wd,U,{})}}function Md(e){let t,n,i,s,o,r,a,l;var c=e[1];function u(f){return{props:{class:"text-dark-300"}}}return c&&(i=be(c,u())),{c(){t=D("div"),n=D("div"),i&&I(i.$$.fragment),s=Y(),o=D("input"),F(n,"class","pr-2"),F(o,"type","text"),F(o,"class","bg-transparent outline-none w-full"),F(o,"placeholder","Search resources..."),F(t,"class","p-2 flex items-center outline-none border-[1px] border-transparent transition-all duration-100 focus-within:border-cyan-600 rounded-md bg-dark-600")},m(f,d){nt(f,t,d),w(t,n),i&&E(i,n,null),w(t,s),w(t,o),ci(o,e[0]),r=!0,a||(l=It(o,"input",e[2]),a=!0)},p(f,[d]){if(d&2&&c!==(c=f[1])){if(i){kt();const h=i;C(h.$$.fragment,1,0,()=>{L(h,1)}),Rt()}c?(i=be(c,u()),I(i.$$.fragment),S(i.$$.fragment,1),E(i,n,null)):i=null}d&1&&o.value!==f[0]&&ci(o,f[0])},i(f){r||(i&&S(i.$$.fragment,f),r=!0)},o(f){i&&C(i.$$.fragment,f),r=!1},d(f){f&&X(t),i&&L(i),a=!1,l()}}}function kd(e,t,n){let{icon:i}=t,{value:s}=t;function o(){s=this.value,n(0,s)}return e.$$set=r=>{"icon"in r&&n(1,i=r.icon),"value"in r&&n(0,s=r.value)},[s,i,o]}class Rd extends K{constructor(t){super(),Q(this,t,kd,Md,U,{icon:1,value:0})}}function $d(e){let t;const n=e[2].default,i=At(n,e,e[3],null);return{c(){i&&i.c()},m(s,o){i&&i.m(s,o),t=!0},p(s,o){i&&i.p&&(!t||o&8)&&Dt(i,n,s,s[3],t?Pt(n,s[3],o,null):Ot(s[3]),null)},i(s){t||(S(i,s),t=!0)},o(s){C(i,s),t=!1},d(s){i&&i.d(s)}}}function Ad(e){let t,n;const i=[{name:"file-analytics"},e[1],{iconNode:e[0]}];let s={$$slots:{default:[$d]},$$scope:{ctx:e}};for(let o=0;o{n(1,t=z(z({},t),et(r))),"$$scope"in r&&n(3,s=r.$$scope)},t=et(t),[o,t,i,s]}class Dd extends K{constructor(t){super(),Q(this,t,Pd,Ad,U,{})}}const Od=Dd;function Fd(e){let t;const n=e[2].default,i=At(n,e,e[3],null);return{c(){i&&i.c()},m(s,o){i&&i.m(s,o),t=!0},p(s,o){i&&i.p&&(!t||o&8)&&Dt(i,n,s,s[3],t?Pt(n,s[3],o,null):Ot(s[3]),null)},i(s){t||(S(i,s),t=!0)},o(s){C(i,s),t=!1},d(s){i&&i.d(s)}}}function Ed(e){let t,n;const i=[{name:"source-code"},e[1],{iconNode:e[0]}];let s={$$slots:{default:[Fd]},$$scope:{ctx:e}};for(let o=0;o{n(1,t=z(z({},t),et(r))),"$$scope"in r&&n(3,s=r.$$scope)},t=et(t),[o,t,i,s]}class Td extends K{constructor(t){super(),Q(this,t,Ld,Ed,U,{})}}const Id=Td;/*! + * @kurkle/color v0.3.2 + * https://github.com/kurkle/color#readme + * (c) 2023 Jukka Kurkela + * Released under the MIT License + */function On(e){return e+.5|0}const ge=(e,t,n)=>Math.max(Math.min(e,n),t);function pn(e){return ge(On(e*2.55),0,255)}function _e(e){return ge(On(e*255),0,255)}function re(e){return ge(On(e/2.55)/100,0,1)}function Qo(e){return ge(On(e*100),0,100)}const Tt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Ps=[..."0123456789ABCDEF"],Vd=e=>Ps[e&15],zd=e=>Ps[(e&240)>>4]+Ps[e&15],Nn=e=>(e&240)>>4===(e&15),Hd=e=>Nn(e.r)&&Nn(e.g)&&Nn(e.b)&&Nn(e.a);function Nd(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&Tt[e[1]]*17,g:255&Tt[e[2]]*17,b:255&Tt[e[3]]*17,a:t===5?Tt[e[4]]*17:255}:(t===7||t===9)&&(n={r:Tt[e[1]]<<4|Tt[e[2]],g:Tt[e[3]]<<4|Tt[e[4]],b:Tt[e[5]]<<4|Tt[e[6]],a:t===9?Tt[e[7]]<<4|Tt[e[8]]:255})),n}const Bd=(e,t)=>e<255?t(e):"";function jd(e){var t=Hd(e)?Vd:zd;return e?"#"+t(e.r)+t(e.g)+t(e.b)+Bd(e.a,t):void 0}const Wd=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function il(e,t,n){const i=t*Math.min(n,1-n),s=(o,r=(o+e/30)%12)=>n-i*Math.max(Math.min(r-3,9-r,1),-1);return[s(0),s(8),s(4)]}function Gd(e,t,n){const i=(s,o=(s+e/60)%6)=>n-n*t*Math.max(Math.min(o,4-o,1),0);return[i(5),i(3),i(1)]}function qd(e,t,n){const i=il(e,1,.5);let s;for(t+n>1&&(s=1/(t+n),t*=s,n*=s),s=0;s<3;s++)i[s]*=1-t-n,i[s]+=t;return i}function Yd(e,t,n,i,s){return e===s?(t-n)/i+(t.5?u/(2-o-r):u/(o+r),l=Yd(n,i,s,u,o),l=l*60+.5),[l|0,c||0,a]}function no(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(_e)}function io(e,t,n){return no(il,e,t,n)}function Ud(e,t,n){return no(qd,e,t,n)}function Xd(e,t,n){return no(Gd,e,t,n)}function sl(e){return(e%360+360)%360}function Kd(e){const t=Wd.exec(e);let n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?pn(+t[5]):_e(+t[5]));const s=sl(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?i=Ud(s,o,r):t[1]==="hsv"?i=Xd(s,o,r):i=io(s,o,r),{r:i[0],g:i[1],b:i[2],a:n}}function Qd(e,t){var n=eo(e);n[0]=sl(n[0]+t),n=io(n),e.r=n[0],e.g=n[1],e.b=n[2]}function Zd(e){if(!e)return;const t=eo(e),n=t[0],i=Qo(t[1]),s=Qo(t[2]);return e.a<255?`hsla(${n}, ${i}%, ${s}%, ${re(e.a)})`:`hsl(${n}, ${i}%, ${s}%)`}const Zo={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Jo={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function Jd(){const e={},t=Object.keys(Jo),n=Object.keys(Zo);let i,s,o,r,a;for(i=0;i>16&255,o>>8&255,o&255]}return e}let Bn;function th(e){Bn||(Bn=Jd(),Bn.transparent=[0,0,0,0]);const t=Bn[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const eh=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function nh(e){const t=eh.exec(e);let n=255,i,s,o;if(t){if(t[7]!==i){const r=+t[7];n=t[8]?pn(r):ge(r*255,0,255)}return i=+t[1],s=+t[3],o=+t[5],i=255&(t[2]?pn(i):ge(i,0,255)),s=255&(t[4]?pn(s):ge(s,0,255)),o=255&(t[6]?pn(o):ge(o,0,255)),{r:i,g:s,b:o,a:n}}}function ih(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${re(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const ss=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Be=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function sh(e,t,n){const i=Be(re(e.r)),s=Be(re(e.g)),o=Be(re(e.b));return{r:_e(ss(i+n*(Be(re(t.r))-i))),g:_e(ss(s+n*(Be(re(t.g))-s))),b:_e(ss(o+n*(Be(re(t.b))-o))),a:e.a+n*(t.a-e.a)}}function jn(e,t,n){if(e){let i=eo(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=io(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function ol(e,t){return e&&Object.assign(t||{},e)}function tr(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=_e(e[3]))):(t=ol(e,{r:0,g:0,b:0,a:1}),t.a=_e(t.a)),t}function oh(e){return e.charAt(0)==="r"?nh(e):Kd(e)}class Mn{constructor(t){if(t instanceof Mn)return t;const n=typeof t;let i;n==="object"?i=tr(t):n==="string"&&(i=Nd(t)||th(t)||oh(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=ol(this._rgb);return t&&(t.a=re(t.a)),t}set rgb(t){this._rgb=tr(t)}rgbString(){return this._valid?ih(this._rgb):void 0}hexString(){return this._valid?jd(this._rgb):void 0}hslString(){return this._valid?Zd(this._rgb):void 0}mix(t,n){if(t){const i=this.rgb,s=t.rgb;let o;const r=n===o?.5:n,a=2*r-1,l=i.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,i.r=255&c*i.r+o*s.r+.5,i.g=255&c*i.g+o*s.g+.5,i.b=255&c*i.b+o*s.b+.5,i.a=r*i.a+(1-r)*s.a,this.rgb=i}return this}interpolate(t,n){return t&&(this._rgb=sh(this._rgb,t._rgb,n)),this}clone(){return new Mn(this.rgb)}alpha(t){return this._rgb.a=_e(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=On(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return jn(this._rgb,2,t),this}darken(t){return jn(this._rgb,2,-t),this}saturate(t){return jn(this._rgb,1,t),this}desaturate(t){return jn(this._rgb,1,-t),this}rotate(t){return Qd(this._rgb,t),this}}/*! + * Chart.js v4.4.4 + * https://www.chartjs.org + * (c) 2024 Chart.js Contributors + * Released under the MIT License + */function ie(){}const rh=(()=>{let e=0;return()=>e++})();function J(e){return e===null||typeof e>"u"}function ot(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function W(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function dt(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function St(e,t){return dt(e)?e:t}function tt(e,t){return typeof e>"u"?t:e}const ah=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,rl=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function at(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function q(e,t,n,i){let s,o,r;if(ot(e))if(o=e.length,i)for(s=o-1;s>=0;s--)t.call(n,e[s],s);else for(s=0;se,x:e=>e.x,y:e=>e.y};function uh(e){const t=e.split("."),n=[];let i="";for(const s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function fh(e){const t=uh(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function nn(e,t){return(er[t]||(er[t]=fh(t)))(e)}function so(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Si=e=>typeof e<"u",we=e=>typeof e=="function",nr=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function dh(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const rt=Math.PI,lt=2*rt,Ci=Number.POSITIVE_INFINITY,hh=rt/180,ut=rt/2,Me=rt/4,ir=rt*2/3,pe=Math.log10,Mi=Math.sign;function si(e,t,n){return Math.abs(e-t)s-o).pop(),t}function ki(e){return!isNaN(parseFloat(e))&&isFinite(e)}function ph(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function ll(e,t,n){let i,s,o;for(i=0,s=e.length;il&&c=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function ro(e,t,n){n=n||(r=>e[r]1;)o=s+i>>1,n(o)?s=o:i=o;return{lo:s,hi:i}}const Ds=(e,t,n,i)=>ro(e,n,i?s=>{const o=e[s][t];return oe[s][t]ro(e,n,i=>e[i][t]>=n);function xh(e,t,n){let i=0,s=e.length;for(;ii&&e[s-1]>n;)s--;return i>0||s{const i="_onData"+so(n),s=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...o){const r=s.apply(this,o);return e._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...o)}),r}})})}function rr(e,t){const n=e._chartjs;if(!n)return;const i=n.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(ul.forEach(o=>{delete e[o]}),delete e._chartjs)}function wh(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const fl=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function dl(e,t){let n=[],i=!1;return function(...s){n=s,i||(i=!0,fl.call(window,()=>{i=!1,e.apply(t,n)}))}}function Sh(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const hl=e=>e==="start"?"left":e==="end"?"right":"center",xn=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,Wn=e=>e===0||e===1,ar=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*lt/n)),lr=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*lt/n)+1,vn={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*ut)+1,easeOutSine:e=>Math.sin(e*ut),easeInOutSine:e=>-.5*(Math.cos(rt*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>Wn(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>Wn(e)?e:ar(e,.075,.3),easeOutElastic:e=>Wn(e)?e:lr(e,.075,.3),easeInOutElastic(e){return Wn(e)?e:e<.5?.5*ar(e*2,.1125,.45):.5+.5*lr(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-vn.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?vn.easeInBounce(e*2)*.5:vn.easeOutBounce(e*2-1)*.5+.5};function gl(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function cr(e){return gl(e)?e:new Mn(e)}function os(e){return gl(e)?e:new Mn(e).saturate(.5).darken(.1).hexString()}const Ch=["x","y","borderWidth","radius","tension"],Mh=["color","borderColor","backgroundColor"];function kh(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:Mh},numbers:{type:"number",properties:Ch}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function Rh(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const ur=new Map;function $h(e,t){t=t||{};const n=e+JSON.stringify(t);let i=ur.get(n);return i||(i=new Intl.NumberFormat(e,t),ur.set(n,i)),i}function Fn(e,t,n){return $h(t,n).format(e)}const pl={values(e){return ot(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const i=this.chart.options.locale;let s,o=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=Ah(e,n)}const r=pe(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Fn(e,i,l)},logarithmic(e,t,n){if(e===0)return"0";const i=n[t].significand||e/Math.pow(10,Math.floor(pe(e)));return[1,2,3,5,10,15].includes(i)||t>.8*n.length?pl.numeric.call(this,e,t,n):""}};function Ah(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var Ni={formatters:pl};function Ph(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Ni.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Ie=Object.create(null),Os=Object.create(null);function wn(e,t){if(!t)return e;const n=t.split(".");for(let i=0,s=n.length;ii.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,s)=>os(s.backgroundColor),this.hoverBorderColor=(i,s)=>os(s.borderColor),this.hoverColor=(i,s)=>os(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return rs(this,t,n)}get(t){return wn(this,t)}describe(t,n){return rs(Os,t,n)}override(t,n){return rs(Ie,t,n)}route(t,n,i,s){const o=wn(this,t),r=wn(this,i),a="_"+n;Object.defineProperties(o,{[a]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=r[s];return W(l)?Object.assign({},c,l):tt(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var ft=new Dh({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[kh,Rh,Ph]);function Oh(e){return!e||J(e.size)||J(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function $i(e,t,n,i,s){let o=t[s];return o||(o=t[s]=e.measureText(s).width,n.push(s)),o>i&&(i=o),i}function Fh(e,t,n,i){i=i||{};let s=i.data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},o=i.garbageCollect=[],i.font=t),e.save(),e.font=t;let r=0;const a=n.length;let l,c,u,f,d;for(l=0;ln.length){for(l=0;l0&&e.stroke()}}function Ge(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.xt.top-n&&e.y0&&o.strokeColor!=="";let l,c;for(e.save(),e.font=s.string,Lh(e,o),l=0;l+e||0;function ao(e,t){const n={},i=W(t),s=i?Object.keys(t):t,o=W(e)?i?r=>tt(e[r],e[t[r]]):r=>e[r]:()=>e;for(const r of s)n[r]=Nh(o(r));return n}function Bh(e){return ao(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Sn(e){return ao(e,["topLeft","topRight","bottomLeft","bottomRight"])}function $t(e){const t=Bh(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function _t(e,t){e=e||{},t=t||ft.font;let n=tt(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=tt(e.style,t.style);i&&!(""+i).match(zh)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:tt(e.family,t.family),lineHeight:Hh(tt(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:tt(e.weight,t.weight),string:""};return s.string=Oh(s),s}function Gn(e,t,n,i){let s=!0,o,r,a;for(o=0,r=e.length;on&&a===0?0:a+l;return{min:r(i,-Math.abs(o)),max:r(s,o)}}function Ve(e,t){return Object.assign(Object.create(e),t)}function lo(e,t=[""],n,i,s=()=>e[0]){const o=n||e;typeof i>"u"&&(i=vl("_fallback",e));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:i,_getTarget:s,override:a=>lo([a,...e],t,o,i)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return yl(a,l,()=>Qh(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return gr(a).includes(l)},ownKeys(a){return gr(a)},set(a,l,c){const u=a._storage||(a._storage=s());return a[l]=u[l]=c,delete a._keys,!0}})}function sn(e,t,n,i){const s={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:bl(e,i),setContext:o=>sn(e,o,n,i),override:o=>sn(e.override(o),t,n,i)};return new Proxy(s,{deleteProperty(o,r){return delete o[r],delete e[r],!0},get(o,r,a){return yl(o,r,()=>Gh(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(e,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,r)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(o,r){return Reflect.has(e,r)},ownKeys(){return Reflect.ownKeys(e)},set(o,r,a){return e[r]=a,delete o[r],!0}})}function bl(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=e;return{allKeys:s,scriptable:n,indexable:i,isScriptable:we(n)?n:()=>n,isIndexable:we(i)?i:()=>i}}const Wh=(e,t)=>e?e+so(t):t,co=(e,t)=>W(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function yl(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const i=n();return e[t]=i,i}function Gh(e,t,n){const{_proxy:i,_context:s,_subProxy:o,_descriptors:r}=e;let a=i[t];return we(a)&&r.isScriptable(t)&&(a=qh(t,a,e,n)),ot(a)&&a.length&&(a=Yh(t,a,e,r.isIndexable)),co(t,a)&&(a=sn(a,s,o&&o[t],r)),a}function qh(e,t,n,i){const{_proxy:s,_context:o,_subProxy:r,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(o,r||i);return a.delete(e),co(e,l)&&(l=uo(s._scopes,s,e,l)),l}function Yh(e,t,n,i){const{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=n;if(typeof o.index<"u"&&i(e))return t[o.index%t.length];if(W(t[0])){const l=t,c=s._scopes.filter(u=>u!==l);t=[];for(const u of l){const f=uo(c,s,e,u);t.push(sn(f,o,r&&r[e],a))}}return t}function xl(e,t,n){return we(e)?e(t,n):e}const Uh=(e,t)=>e===!0?t:typeof e=="string"?nn(t,e):void 0;function Xh(e,t,n,i,s){for(const o of t){const r=Uh(n,o);if(r){e.add(r);const a=xl(r._fallback,n,s);if(typeof a<"u"&&a!==n&&a!==i)return a}else if(r===!1&&typeof i<"u"&&n!==i)return null}return!1}function uo(e,t,n,i){const s=t._rootScopes,o=xl(t._fallback,n,i),r=[...e,...s],a=new Set;a.add(i);let l=hr(a,r,n,o||n,i);return l===null||typeof o<"u"&&o!==n&&(l=hr(a,r,o,l,i),l===null)?!1:lo(Array.from(a),[""],s,o,()=>Kh(t,n,i))}function hr(e,t,n,i,s){for(;n;)n=Xh(e,t,n,i,s);return n}function Kh(e,t,n){const i=e._getTarget();t in i||(i[t]={});const s=i[t];return ot(s)&&W(n)?n:s||{}}function Qh(e,t,n,i){let s;for(const o of t)if(s=vl(Wh(o,e),n),typeof s<"u")return co(e,s)?uo(n,i,e,s):s}function vl(e,t){for(const n of t){if(!n)continue;const i=n[e];if(typeof i<"u")return i}}function gr(e){let t=e._keys;return t||(t=e._keys=Zh(e._scopes)),t}function Zh(e){const t=new Set;for(const n of e)for(const i of Object.keys(n).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function Jh(e,t,n,i){const{iScale:s}=e,{key:o="r"}=this._parsing,r=new Array(i);let a,l,c,u;for(a=0,l=i;ae.ownerDocument.defaultView.getComputedStyle(e,null);function tg(e,t){return Bi(e).getPropertyValue(t)}const eg=["top","right","bottom","left"];function Oe(e,t,n){const i={};n=n?"-"+n:"";for(let s=0;s<4;s++){const o=eg[s];i[o]=parseFloat(e[t+"-"+o+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const ng=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function ig(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:s,offsetY:o}=i;let r=!1,a,l;if(ng(s,o,e.target))a=s,l=o;else{const c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function Ae(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:i}=t,s=Bi(n),o=s.boxSizing==="border-box",r=Oe(s,"padding"),a=Oe(s,"border","width"),{x:l,y:c,box:u}=ig(e,n),f=r.left+(u&&a.left),d=r.top+(u&&a.top);let{width:h,height:g}=t;return o&&(h-=r.width+a.width,g-=r.height+a.height),{x:Math.round((l-f)/h*n.width/i),y:Math.round((c-d)/g*n.height/i)}}function sg(e,t,n){let i,s;if(t===void 0||n===void 0){const o=e&&ho(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{const r=o.getBoundingClientRect(),a=Bi(o),l=Oe(a,"border","width"),c=Oe(a,"padding");t=r.width-c.width-l.width,n=r.height-c.height-l.height,i=Ai(a.maxWidth,o,"clientWidth"),s=Ai(a.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:i||Ci,maxHeight:s||Ci}}const qn=e=>Math.round(e*10)/10;function og(e,t,n,i){const s=Bi(e),o=Oe(s,"margin"),r=Ai(s.maxWidth,e,"clientWidth")||Ci,a=Ai(s.maxHeight,e,"clientHeight")||Ci,l=sg(e,t,n);let{width:c,height:u}=l;if(s.boxSizing==="content-box"){const d=Oe(s,"border","width"),h=Oe(s,"padding");c-=h.width+d.width,u-=h.height+d.height}return c=Math.max(0,c-o.width),u=Math.max(0,i?c/i:u-o.height),c=qn(Math.min(c,r,l.maxWidth)),u=qn(Math.min(u,a,l.maxHeight)),c&&!u&&(u=qn(c/2)),(t!==void 0||n!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=qn(Math.floor(u*i))),{width:c,height:u}}function pr(e,t,n){const i=t||1,s=Math.floor(e.height*i),o=Math.floor(e.width*i);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const r=e.canvas;return r.style&&(n||!r.style.height&&!r.style.width)&&(r.style.height=`${e.height}px`,r.style.width=`${e.width}px`),e.currentDevicePixelRatio!==i||r.height!==s||r.width!==o?(e.currentDevicePixelRatio=i,r.height=s,r.width=o,e.ctx.setTransform(i,0,0,i,0,0),!0):!1}const rg=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};fo()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function mr(e,t){const n=tg(e,t),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}const ag=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,i){return n-i},leftForLtr(n,i){return n-i}}},lg=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function as(e,t,n){return e?ag(t,n):lg()}function cg(e,t){let n,i;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=i)}function ug(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}/*! + * Chart.js v4.4.4 + * https://www.chartjs.org + * (c) 2024 Chart.js Contributors + * Released under the MIT License + */class fg{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,i,s){const o=n.listeners[s],r=n.duration;o.forEach(a=>a({chart:t,initial:n.initial,numSteps:r,currentStep:Math.min(i-n.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=fl.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const o=i.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),o.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),n+=o.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let i=n.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,i)),i}listen(t,n,i){this._getAnims(t).listeners[n].push(i)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const i=n.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var se=new fg;const _r="transparent",dg={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=cr(e||_r),s=i.valid&&cr(t||_r);return s&&s.valid?s.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class hg{constructor(t,n,i,s){const o=n[i];s=Gn([t.to,s,o,t.from]);const r=Gn([t.from,o,s]);this._active=!0,this._fn=t.fn||dg[t.type||typeof r],this._easing=vn[t.easing]||vn.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=i,this._from=r,this._to=s,this._promises=void 0}active(){return this._active}update(t,n,i){if(this._active){this._notify(!1);const s=this._target[this._prop],o=i-this._start,r=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Gn([t.to,n,s,t.from]),this._from=Gn([t.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,i=this._duration,s=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||n1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,i)=>{t.push({res:n,rej:i})})}_notify(t){const n=t?"res":"rej",i=this._promises||[];for(let s=0;s{const o=t[s];if(!W(o))return;const r={};for(const a of n)r[a]=o[a];(ot(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,r)})})}_animateOptions(t,n){const i=n.options,s=pg(t,i);if(!s)return[];const o=this._createAnimations(s,i);return i.$shared&&gg(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,n){const i=this._properties,s=[],o=t.$animations||(t.$animations={}),r=Object.keys(n),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,n));continue}const u=n[c];let f=o[c];const d=i.get(c);if(f)if(d&&f.active()){f.update(d,u,a);continue}else f.cancel();if(!d||!d.duration){t[c]=u;continue}o[c]=f=new hg(d,t,c,u),s.push(f)}return s}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const i=this._createAnimations(t,n);if(i.length)return se.add(this._chart,i),!0}}function gg(e,t){const n=[],i=Object.keys(t);for(let s=0;s0||!n&&o<0)return s.index}return null}function wr(e,t){const{chart:n,_cachedMeta:i}=e,s=n._stacks||(n._stacks={}),{iScale:o,vScale:r,index:a}=i,l=o.axis,c=r.axis,u=yg(o,r,i),f=t.length;let d;for(let h=0;hn[i].axis===t).shift()}function wg(e,t){return Ve(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Sg(e,t,n){return Ve(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function un(e,t){const n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(const s of t){const o=s._stacks;if(!o||o[i]===void 0||o[i][n]===void 0)return;delete o[i][n],o[i]._visualValues!==void 0&&o[i]._visualValues[n]!==void 0&&delete o[i]._visualValues[n]}}}const cs=e=>e==="reset"||e==="none",Sr=(e,t)=>t?e:Object.assign({},e),Cg=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Sl(n,!0),values:null};class Ke{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=xr(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&un(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,i=this.getDataset(),s=(f,d,h,g)=>f==="x"?d:f==="r"?g:h,o=n.xAxisID=tt(i.xAxisID,ls(t,"x")),r=n.yAxisID=tt(i.yAxisID,ls(t,"y")),a=n.rAxisID=tt(i.rAxisID,ls(t,"r")),l=n.indexAxis,c=n.iAxisID=s(l,o,r,a),u=n.vAxisID=s(l,r,o,a);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(r),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&rr(this._data,this),t._stacked&&un(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(W(n)){const s=this._cachedMeta;this._data=bg(n,s)}else if(i!==n){if(i){rr(i,this);const s=this._cachedMeta;un(s),s._parsed=[]}n&&Object.isExtensible(n)&&vh(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const o=n._stacked;n._stacked=xr(n.vScale,n),n.stack!==i.stack&&(s=!0,un(n),n.stack=i.stack),this._resyncElements(t),(s||o!==n._stacked)&&wr(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:i,_data:s}=this,{iScale:o,_stacked:r}=i,a=o.axis;let l=t===0&&n===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,f,d;if(this._parsing===!1)i._parsed=s,i._sorted=!0,d=s;else{ot(s[t])?d=this.parseArrayData(i,s,t,n):W(s[t])?d=this.parseObjectData(i,s,t,n):d=this.parsePrimitiveData(i,s,t,n);const h=()=>f[a]===null||c&&f[a]p||f=0;--d)if(!g()){this.updateRangeFromParsed(c,t,h,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,i=[];let s,o,r;for(s=0,o=n.length;s=0&&tthis.getContext(i,s,n),p=c.resolveNamedOptions(d,h,g,f);return p.$shared&&(p.$shared=l,o[r]=Object.freeze(Sr(p,l))),p}_resolveAnimations(t,n,i){const s=this.chart,o=this._cachedDataOpts,r=`animation-${n}`,a=o[r];if(a)return a;let l;if(s.options.animation!==!1){const u=this.chart.config,f=u.datasetAnimationScopeKeys(this._type,n),d=u.getOptionScopes(this.getDataset(),f);l=u.createResolver(d,this.getContext(t,i,n))}const c=new wl(s,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||cs(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const i=this.resolveDataElementOptions(t,n),s=this._sharedOptions,o=this.getSharedOptions(i),r=this.includeOptions(n,o)||o!==s;return this.updateSharedOptions(o,n,i),{sharedOptions:o,includeOptions:r}}updateElement(t,n,i,s){cs(s)?Object.assign(t,i):this._resolveAnimations(n,s).update(t,i)}updateSharedOptions(t,n,i){t&&!cs(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,s){t.active=s;const o=this.getStyle(n,s);this._resolveAnimations(n,i,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,n,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,n,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,i=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=i.length,o=n.length,r=Math.min(o,s);r&&this.parse(0,r),o>s?this._insertElements(s,o-s,t):o{for(c.length+=n,a=c.length-1;a>=r;a--)c[a]=c[a-n]};for(l(o),a=t;aRi(x,a,l,!0)?1:Math.max(v,v*n,y,y*n),g=(x,v,y)=>Ri(x,a,l,!0)?-1:Math.min(v,v*n,y,y*n),p=h(0,c,f),m=h(ut,u,d),_=g(rt,c,f),b=g(rt+ut,u,d);i=(p-_)/2,s=(m-b)/2,o=-(p+_)/2,r=-(m+b)/2}return{ratioX:i,ratioY:s,offsetX:o,offsetY:r}}class qe extends Ke{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let o=l=>+i[l];if(W(i[t])){const{key:l="value"}=this._parsing;o=c=>+nn(i[c],l)}let r,a;for(r=t,a=t+n;r0&&!isNaN(t)?lt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=Fn(n._parsed[t],i.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let n=0;const i=this.chart;let s,o,r,a,l;if(!t){for(s=0,o=i.data.datasets.length;st!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),A(qe,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return n.labels.map((o,r)=>{const l=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}}});class oi extends Ke{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=Fn(n._parsed[t].r,i.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,n,i,s){return Jh.bind(this)(t,n,i,s)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{const o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(on.max&&(n.max=o))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,i=t.options,s=Math.min(n.right-n.left,n.bottom-n.top),o=Math.max(s/2,0),r=Math.max(i.cutoutPercentage?o/100*i.cutoutPercentage:1,0),a=(o-r)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,i,s){const o=s==="reset",r=this.chart,l=r.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,f=c.yCenter,d=c.getIndexAngle(0)-.5*rt;let h=d,g;const p=360/this.countVisibleElements();for(g=0;g{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&n++}),n}_computeAngle(t,n,i){return this.chart.getDataVisibility(t)?jt(this.resolveDataElementOptions(t,n).angle||i):0}}A(oi,"id","polarArea"),A(oi,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),A(oi,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return n.labels.map((o,r)=>{const l=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Es extends qe{}A(Es,"id","pie"),A(Es,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});function Re(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class go{constructor(t){A(this,"options");this.options=t||{}}static override(t){Object.assign(go.prototype,t)}init(){}formats(){return Re()}parse(){return Re()}format(){return Re()}add(){return Re()}diff(){return Re()}startOf(){return Re()}endOf(){return Re()}}var kg={_date:go};function Rg(e,t,n,i){const{controller:s,data:o,_sorted:r}=e,a=s._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const l=a._reversePixels?yh:Ds;if(i){if(s._sharedOptions){const c=o[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const f=l(o,t,n-u),d=l(o,t,n+u);return{lo:f.lo,hi:d.hi}}}}else return l(o,t,n)}return{lo:0,hi:o.length-1}}function En(e,t,n,i,s){const o=e.getSortedVisibleDatasetMetas(),r=n[t];for(let a=0,l=o.length;a{l[r]&&l[r](t[n],s)&&(o.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,s))}),i&&!a?[]:o}var Dg={evaluateInteractionItems:En,modes:{index(e,t,n,i){const s=Ae(t,e),o=n.axis||"x",r=n.includeInvisible||!1,a=n.intersect?us(e,s,o,i,r):fs(e,s,o,!1,i,r),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,f=c.data[u];f&&!f.skip&&l.push({element:f,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,i){const s=Ae(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;let a=n.intersect?us(e,s,o,i,r):fs(e,s,o,!1,i,r);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;un.pos===t)}function Mr(e,t){return e.filter(n=>Cl.indexOf(n.pos)===-1&&n.box.axis===t)}function dn(e,t){return e.sort((n,i)=>{const s=t?i:n,o=t?n:i;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function Og(e){const t=[];let n,i,s,o,r,a;for(n=0,i=(e||[]).length;nc.box.fullSize),!0),i=dn(fn(t,"left"),!0),s=dn(fn(t,"right")),o=dn(fn(t,"top"),!0),r=dn(fn(t,"bottom")),a=Mr(t,"x"),l=Mr(t,"y");return{fullSize:n,leftAndTop:i.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:fn(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}function kr(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function Ml(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Tg(e,t,n,i){const{pos:s,box:o}=n,r=e.maxPadding;if(!W(s)){n.size&&(e[s]-=n.size);const f=i[n.stack]||{size:0,count:1};f.size=Math.max(f.size,n.horizontal?o.height:o.width),n.size=f.size/f.count,e[s]+=n.size}o.getPadding&&Ml(r,o.getPadding());const a=Math.max(0,t.outerWidth-kr(r,e,"left","right")),l=Math.max(0,t.outerHeight-kr(r,e,"top","bottom")),c=a!==e.w,u=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function Ig(e){const t=e.maxPadding;function n(i){const s=Math.max(t[i]-e[i],0);return e[i]+=s,s}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function Vg(e,t){const n=t.maxPadding;function i(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(r=>{o[r]=Math.max(t[r],n[r])}),o}return i(e?["left","right"]:["top","bottom"])}function mn(e,t,n,i){const s=[];let o,r,a,l,c,u;for(o=0,r=e.length,c=0;o{typeof p.beforeLayout=="function"&&p.beforeLayout()});const u=l.reduce((p,m)=>m.box.options&&m.box.options.display===!1?p:p+1,0)||1,f=Object.freeze({outerWidth:t,outerHeight:n,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/u,hBoxMaxHeight:r/2}),d=Object.assign({},s);Ml(d,$t(i));const h=Object.assign({maxPadding:d,w:o,h:r,x:s.left,y:s.top},s),g=Eg(l.concat(c),f);mn(a.fullSize,h,f,g),mn(l,h,f,g),mn(c,h,f,g)&&mn(l,h,f,g),Ig(h),Rr(a.leftAndTop,h,f,g),h.x+=h.w,h.y+=h.h,Rr(a.rightAndBottom,h,f,g),e.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},q(a.chartArea,p=>{const m=p.box;Object.assign(m,e.chartArea),m.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class kl{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,i){}removeEventListener(t,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,i,s){return n=Math.max(0,n||t.width),i=i||t.height,{width:n,height:Math.max(0,s?Math.floor(n/s):i)}}isAttached(t){return!0}updateConfig(t){}}class zg extends kl{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const ri="$chartjs",Hg={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},$r=e=>e===null||e==="";function Ng(e,t){const n=e.style,i=e.getAttribute("height"),s=e.getAttribute("width");if(e[ri]={initial:{height:i,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",$r(s)){const o=mr(e,"width");o!==void 0&&(e.width=o)}if($r(i))if(e.style.height==="")e.height=e.width/(t||2);else{const o=mr(e,"height");o!==void 0&&(e.height=o)}return e}const Rl=rg?{passive:!0}:!1;function Bg(e,t,n){e&&e.addEventListener(t,n,Rl)}function jg(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,Rl)}function Wg(e,t){const n=Hg[e.type]||e.type,{x:i,y:s}=Ae(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Pi(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function Gg(e,t,n){const i=e.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Pi(a.addedNodes,i),r=r&&!Pi(a.removedNodes,i);r&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function qg(e,t,n){const i=e.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Pi(a.removedNodes,i),r=r&&!Pi(a.addedNodes,i);r&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const $n=new Map;let Ar=0;function $l(){const e=window.devicePixelRatio;e!==Ar&&(Ar=e,$n.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function Yg(e,t){$n.size||window.addEventListener("resize",$l),$n.set(e,t)}function Ug(e){$n.delete(e),$n.size||window.removeEventListener("resize",$l)}function Xg(e,t,n){const i=e.canvas,s=i&&ho(i);if(!s)return;const o=dl((a,l)=>{const c=s.clientWidth;n(a,l),c{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||o(c,u)});return r.observe(s),Yg(e,o),r}function ds(e,t,n){n&&n.disconnect(),t==="resize"&&Ug(e)}function Kg(e,t,n){const i=e.canvas,s=dl(o=>{e.ctx!==null&&n(Wg(o,e))},e);return Bg(i,t,s),s}class Qg extends kl{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Ng(t,n),i):null}releaseContext(t){const n=t.canvas;if(!n[ri])return!1;const i=n[ri].initial;["height","width"].forEach(o=>{const r=i[o];J(r)?n.removeAttribute(o):n.setAttribute(o,r)});const s=i.style||{};return Object.keys(s).forEach(o=>{n.style[o]=s[o]}),n.width=n.width,delete n[ri],!0}addEventListener(t,n,i){this.removeEventListener(t,n);const s=t.$proxies||(t.$proxies={}),r={attach:Gg,detach:qg,resize:Xg}[n]||Kg;s[n]=r(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),s=i[n];if(!s)return;({attach:ds,detach:ds,resize:ds}[n]||jg)(t,n,s),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,s){return og(t,n,i,s)}isAttached(t){const n=t&&ho(t);return!!(n&&n.isConnected)}}function Zg(e){return!fo()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?zg:Qg}var ei;let Ln=(ei=class{constructor(){A(this,"x");A(this,"y");A(this,"active",!1);A(this,"options");A(this,"$animations")}tooltipPosition(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}hasValue(){return ki(this.x)&&ki(this.y)}getProps(t,n){const i=this.$animations;if(!n||!i)return this;const s={};return t.forEach(o=>{s[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),s}},A(ei,"defaults",{}),A(ei,"defaultRoutes"),ei);function Jg(e,t){const n=e.options.ticks,i=tp(e),s=Math.min(n.maxTicksLimit||i,i),o=n.major.enabled?np(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>s)return ip(t,c,o,r/s),c;const u=ep(o,t,s);if(r>0){let f,d;const h=r>1?Math.round((l-a)/(r-1)):null;for(Un(t,c,u,J(h)?0:a-h,a),f=0,d=r-1;fs)return l}return Math.max(s,1)}function np(e){const t=[];let n,i;for(n=0,i=e.length;ne==="left"?"right":e==="right"?"left":e,Pr=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Dr=(e,t)=>Math.min(t||e,e);function Or(e,t){const n=[],i=e.length/t,s=e.length;let o=0;for(;or+a)))return l}function ap(e,t){q(e,n=>{const i=n.gc,s=i.length/2;let o;if(s>t){for(o=0;oi?i:n,i=s&&n>i?n:i,{min:St(n,St(i,n)),max:St(i,St(n,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){at(this.options.beforeUpdate,[this])}update(t,n,i){const{beginAtZero:s,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=jh(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a=o||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),f=u.widest.width,d=u.highest.height,h=Ct(this.chart.width-f,0,this.maxWidth);a=t.offset?this.maxWidth/i:h/(i-1),f+6>a&&(a=h/(i-(t.offset?.5:1)),l=this.maxHeight-hn(t.grid)-n.padding-Fr(t.title,this.chart.options.font),c=Math.sqrt(f*f+d*d),r=oo(Math.min(Math.asin(Ct((u.highest.height+6)/a,-1,1)),Math.asin(Ct(l/c,-1,1))-Math.asin(Ct(d/c,-1,1)))),r=Math.max(s,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){at(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){at(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:i,title:s,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=Fr(s,n.options.font);if(a?(t.width=this.maxWidth,t.height=hn(o)+l):(t.height=this.maxHeight,t.width=hn(o)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:f,highest:d}=this._getLabelSizes(),h=i.padding*2,g=jt(this.labelRotation),p=Math.cos(g),m=Math.sin(g);if(a){const _=i.mirror?0:m*f.width+p*d.height;t.height=Math.min(this.maxHeight,t.height+_+h)}else{const _=i.mirror?0:p*f.width+m*d.height;t.width=Math.min(this.maxWidth,t.width+_+h)}this._calculatePadding(c,u,m,p)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,i,s){const{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,h=0;l?c?(d=s*t.width,h=i*n.height):(d=i*t.height,h=s*n.width):o==="start"?h=n.width:o==="end"?d=t.width:o!=="inner"&&(d=t.width/2,h=n.width/2),this.paddingLeft=Math.max((d-u+r)*this.width/(this.width-u),0),this.paddingRight=Math.max((h-f+r)*this.width/(this.width-f),0)}else{let u=n.height/2,f=t.height/2;o==="start"?(u=0,f=t.height):o==="end"&&(u=n.height,f=0),this.paddingTop=u+r,this.paddingBottom=f+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){at(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,i;for(n=0,i=t.length;n({width:r[P]||0,height:a[P]||0});return{first:$(0),last:$(n-1),widest:$(M),highest:$(k),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return _h(this._alignToPixels?ke(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&ta*s?a/i:l/s:l*s0}_computeGridLineItems(t){const n=this.axis,i=this.chart,s=this.options,{grid:o,position:r,border:a}=s,l=o.offset,c=this.isHorizontal(),f=this.ticks.length+(l?1:0),d=hn(o),h=[],g=a.setContext(this.getContext()),p=g.display?g.width:0,m=p/2,_=function(B){return ke(i,B,p)};let b,x,v,y,M,k,$,P,O,R,V,ct;if(r==="top")b=_(this.bottom),k=this.bottom-d,P=b-m,R=_(t.top)+m,ct=t.bottom;else if(r==="bottom")b=_(this.top),R=t.top,ct=_(t.bottom)-m,k=b+m,P=this.top+d;else if(r==="left")b=_(this.right),M=this.right-d,$=b-m,O=_(t.left)+m,V=t.right;else if(r==="right")b=_(this.left),O=t.left,V=_(t.right)-m,M=b+m,$=this.left+d;else if(n==="x"){if(r==="center")b=_((t.top+t.bottom)/2+.5);else if(W(r)){const B=Object.keys(r)[0],N=r[B];b=_(this.chart.scales[B].getPixelForValue(N))}R=t.top,ct=t.bottom,k=b+m,P=k+d}else if(n==="y"){if(r==="center")b=_((t.left+t.right)/2);else if(W(r)){const B=Object.keys(r)[0],N=r[B];b=_(this.chart.scales[B].getPixelForValue(N))}M=b-m,$=M-d,O=t.left,V=t.right}const it=tt(s.ticks.maxTicksLimit,f),H=Math.max(1,Math.ceil(f/it));for(x=0;x0&&(bt-=ee/2);break}Se={left:bt,top:ue,width:ee+vt.width,height:wt+vt.height,color:H.backdropColor}}m.push({label:v,font:P,textOffset:V,options:{rotation:p,color:N,strokeColor:st,strokeWidth:G,textAlign:Et,textBaseline:ct,translation:[y,M],backdrop:Se}})}return m}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-jt(this.labelRotation))return t==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:i,mirror:s,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width;let c,u;return n==="left"?s?(u=this.right+o,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?s?(u=this.left+o,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:i,top:s,width:o,height:r}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(i,s,o,r),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const n=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(n.display)for(o=0,r=s.length;o{this.draw(o)}}]:[{z:i,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let o,r;for(o=0,r=n.length;o{const i=n.split("."),s=i.pop(),o=[e].concat(i).join("."),r=t[n].split("."),a=r.pop(),l=r.join(".");ft.route(o,s,l,a)})}function gp(e){return"id"in e&&"defaults"in e}class pp{constructor(){this.controllers=new Xn(Ke,"datasets",!0),this.elements=new Xn(Ln,"elements"),this.plugins=new Xn(Object,"plugins"),this.scales=new Xn(ze,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,i){[...n].forEach(s=>{const o=i||this._getRegistryForType(s);i||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):q(s,r=>{const a=i||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,n,i){const s=so(t);at(i["before"+s],[],i),n[t](i),at(i["after"+s],[],i)}_getRegistryForType(t){for(let n=0;no.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(s(n,i),t,"stop"),this._notify(s(i,n),t,"start")}}function _p(e){const t={},n=[],i=Object.keys(Xt.plugins.items);for(let o=0;o1&&Er(e[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Lr(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function Cp(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(i=>i.xAxisID===e||i.yAxisID===e);if(n.length)return Lr(e,"x",n[0])||Lr(e,"y",n[0])}return{}}function Mp(e,t){const n=Ie[e.type]||{scales:{}},i=t.scales||{},s=Ls(e.type,t),o=Object.create(null);return Object.keys(i).forEach(r=>{const a=i[r];if(!W(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const l=Ts(r,a,Cp(r,e),ft.scales[a.type]),c=wp(l,s),u=n.scales||{};o[r]=yn(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(r=>{const a=r.type||e.type,l=r.indexAxis||Ls(a,t),u=(Ie[a]||{}).scales||{};Object.keys(u).forEach(f=>{const d=vp(f,l),h=r[d+"AxisID"]||d;o[h]=o[h]||Object.create(null),yn(o[h],[{axis:d},i[h],u[f]])})}),Object.keys(o).forEach(r=>{const a=o[r];yn(a,[ft.scales[a.type],ft.scale])}),o}function Al(e){const t=e.options||(e.options={});t.plugins=tt(t.plugins,{}),t.scales=Mp(e,t)}function Pl(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function kp(e){return e=e||{},e.data=Pl(e.data),Al(e),e}const Tr=new Map,Dl=new Set;function Kn(e,t){let n=Tr.get(e);return n||(n=t(),Tr.set(e,n),Dl.add(n)),n}const gn=(e,t,n)=>{const i=nn(t,n);i!==void 0&&e.add(i)};class Rp{constructor(t){this._config=kp(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Pl(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Al(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Kn(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return Kn(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return Kn(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return Kn(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const i=this._scopeCache;let s=i.get(t);return(!s||n)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,n,i){const{options:s,type:o}=this,r=this._cachedScopes(t,i),a=r.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(f=>gn(l,t,f))),u.forEach(f=>gn(l,s,f)),u.forEach(f=>gn(l,Ie[o]||{},f)),u.forEach(f=>gn(l,ft,f)),u.forEach(f=>gn(l,Os,f))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Dl.has(n)&&r.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Ie[n]||{},ft.datasets[n]||{},{type:n},ft,Os]}resolveNamedOptions(t,n,i,s=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=Ir(this._resolverCache,t,s);let l=r;if(Ap(r,n)){o.$shared=!1,i=we(i)?i():i;const c=this.createResolver(t,i,a);l=sn(r,i,c)}for(const c of n)o[c]=l[c];return o}createResolver(t,n,i=[""],s){const{resolver:o}=Ir(this._resolverCache,t,i);return W(n)?sn(o,n,void 0,s):o}}function Ir(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));const s=n.join();let o=i.get(s);return o||(o={resolver:lo(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,o)),o}const $p=e=>W(e)&&Object.getOwnPropertyNames(e).some(t=>we(e[t]));function Ap(e,t){const{isScriptable:n,isIndexable:i}=bl(e);for(const s of t){const o=n(s),r=i(s),a=(r||o)&&e[s];if(o&&(we(a)||$p(a))||r&&ot(a))return!0}return!1}var Pp="4.4.4";const Dp=["top","bottom","left","right","chartArea"];function Vr(e,t){return e==="top"||e==="bottom"||Dp.indexOf(e)===-1&&t==="x"}function zr(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function Hr(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),at(n&&n.onComplete,[e],t)}function Op(e){const t=e.chart,n=t.options.animation;at(n&&n.onProgress,[e],t)}function Ol(e){return fo()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const ai={},Nr=e=>{const t=Ol(e);return Object.values(ai).filter(n=>n.canvas===t).pop()};function Fp(e,t,n){const i=Object.keys(e);for(const s of i){const o=+s;if(o>=t){const r=e[s];delete e[s],(n>0||o>t)&&(e[o+n]=r)}}}function Ep(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}function Qn(e,t,n){return e.options.clip?e[n]:t[n]}function Lp(e,t){const{xScale:n,yScale:i}=e;return n&&i?{left:Qn(n,t,"left"),right:Qn(n,t,"right"),top:Qn(i,t,"top"),bottom:Qn(i,t,"bottom")}:t}var de;let ji=(de=class{static register(...t){Xt.add(...t),Br()}static unregister(...t){Xt.remove(...t),Br()}constructor(t,n){const i=this.config=new Rp(n),s=Ol(t),o=Nr(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Zg(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=rh(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new mp,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Sh(f=>this.update(f),r.resizeDelay||0),this._dataChanges=[],ai[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}se.listen(this,"complete",Hr),se.listen(this,"progress",Op),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:s,_aspectRatio:o}=this;return J(t)?n&&o?o:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Xt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():pr(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return fr(this.canvas,this.ctx),this}stop(){return se.stop(this),this}resize(t,n){se.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const i=this.options,s=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(s,t,n,o),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,pr(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),at(i.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};q(n,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,n=t.scales,i=this.scales,s=Object.keys(i).reduce((r,a)=>(r[a]=!1,r),{});let o=[];n&&(o=o.concat(Object.keys(n).map(r=>{const a=n[r],l=Ts(r,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),q(o,r=>{const a=r.options,l=a.id,c=Ts(l,a),u=tt(a.type,r.dtype);(a.position===void 0||Vr(a.position,c)!==Vr(r.dposition))&&(a.position=r.dposition),s[l]=!0;let f=null;if(l in i&&i[l].type===u)f=i[l];else{const d=Xt.getScale(u);f=new d({id:l,type:u,ctx:this.ctx,chart:this}),i[f.id]=f}f.init(a,t)}),q(s,(r,a)=>{r||delete i[a]}),q(i,r=>{me.configure(this,r,r.options),me.addBox(this,r)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,i=t.length;if(t.sort((s,o)=>s.index-o.index),i>n){for(let s=n;sn.length&&delete this._stacks,t.forEach((i,s)=>{n.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=n.length;i{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const i=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,u=this.data.datasets.length;c{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(zr("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){q(this.scales,t=>{me.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!nr(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:o}of n){const r=i==="_removeElements"?-o:o;Fp(t,s,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,i=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),s=i(0);for(let o=1;oo.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;me.update(this,this.width,this.height,t);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],q(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,i=this.data.datasets.length;n=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,i=t._clip,s=!i.disabled,o=Lp(t,this.chartArea),r={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(s&&ml(n,{left:i.left===!1?0:o.left-i.left,right:i.right===!1?this.width:o.right+i.right,top:i.top===!1?0:o.top-i.top,bottom:i.bottom===!1?this.height:o.bottom+i.bottom}),t.controller.draw(),s&&_l(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return Ge(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,s){const o=Dg.modes[n];return typeof o=="function"?o(this,t,i,s):[]}getDatasetMeta(t){const n=this.data.datasets[t],i=this._metasets;let s=i.filter(o=>o&&o._dataset===n).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Ve(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){const i=this.getDatasetMeta(t);i.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,i){const s=i?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,s);Si(n)?(o.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),r.update(o,{visible:i}),this.update(a=>a.datasetIndex===t?s:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),se.remove(this),t=0,n=this.data.datasets.length;t{n.addEventListener(this,o,r),t[o]=r},s=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};q(this.options.events,o=>i(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,i=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let r;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",o),i("detach",r)};r=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),i("attach",a)},n.isAttached(this.canvas)?a():r()}unbindEvents(){q(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},q(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){const s=i?"set":"remove";let o,r,a,l;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!vi(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(t,n,i){return this._plugins.notify(this,t,n,i)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,i){const s=this.options.hover,o=(l,c)=>l.filter(u=>!c.some(f=>u.datasetIndex===f.datasetIndex&&u.index===f.index)),r=o(n,t),a=i?t:o(t,n);r.length&&this.updateHoverStyle(r,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,n){const i={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},s=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const o=this._handleEvent(t,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(o||i.changed)&&this.render(),this}_handleEvent(t,n,i){const{_active:s=[],options:o}=this,r=n,a=this._getActiveElements(t,s,i,r),l=dh(t),c=Ep(t,this._lastEvent,i,l);i&&(this._lastEvent=null,at(o.onHover,[t,a,this],this),l&&at(o.onClick,[t,a,this],this));const u=!vi(a,s);return(u||n)&&(this._active=a,this._updateHoverStyles(a,s,n)),this._lastEvent=c,u}_getActiveElements(t,n,i,s){if(t.type==="mouseout")return[];if(!i)return n;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}},A(de,"defaults",ft),A(de,"instances",ai),A(de,"overrides",Ie),A(de,"registry",Xt),A(de,"version",Pp),A(de,"getChart",Nr),de);function Br(){return q(ji.instances,e=>e._plugins.invalidate())}function Tp(e,t,n){const{startAngle:i,pixelMargin:s,x:o,y:r,outerRadius:a,innerRadius:l}=t;let c=s/a;e.beginPath(),e.arc(o,r,a,i-c,n+c),l>s?(c=s/l,e.arc(o,r,l,n+c,i-c,!0)):e.arc(o,r,s,n+ut,i-ut),e.closePath(),e.clip()}function Ip(e){return ao(e,["outerStart","outerEnd","innerStart","innerEnd"])}function Vp(e,t,n,i){const s=Ip(e.options.borderRadius),o=(n-t)/2,r=Math.min(o,i*t/2),a=l=>{const c=(n-Math.min(o,l))*i/2;return Ct(l,0,Math.min(o,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:Ct(s.innerStart,0,r),innerEnd:Ct(s.innerEnd,0,r)}}function je(e,t,n,i){return{x:n+e*Math.cos(t),y:i+e*Math.sin(t)}}function Di(e,t,n,i,s,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,f=Math.max(t.outerRadius+i+n-c,0),d=u>0?u+i+n+c:0;let h=0;const g=s-l;if(i){const H=u>0?u-i:0,B=f>0?f-i:0,N=(H+B)/2,st=N!==0?g*N/(N+i):g;h=(g-st)/2}const p=Math.max(.001,g*f-n/rt)/f,m=(g-p)/2,_=l+m+h,b=s-m-h,{outerStart:x,outerEnd:v,innerStart:y,innerEnd:M}=Vp(t,d,f,b-_),k=f-x,$=f-v,P=_+x/k,O=b-v/$,R=d+y,V=d+M,ct=_+y/R,it=b-M/V;if(e.beginPath(),o){const H=(P+O)/2;if(e.arc(r,a,f,P,H),e.arc(r,a,f,H,O),v>0){const G=je($,O,r,a);e.arc(G.x,G.y,v,O,b+ut)}const B=je(V,b,r,a);if(e.lineTo(B.x,B.y),M>0){const G=je(V,it,r,a);e.arc(G.x,G.y,M,b+ut,it+Math.PI)}const N=(b-M/d+(_+y/d))/2;if(e.arc(r,a,d,b-M/d,N,!0),e.arc(r,a,d,N,_+y/d,!0),y>0){const G=je(R,ct,r,a);e.arc(G.x,G.y,y,ct+Math.PI,_-ut)}const st=je(k,_,r,a);if(e.lineTo(st.x,st.y),x>0){const G=je(k,P,r,a);e.arc(G.x,G.y,x,_-ut,P)}}else{e.moveTo(r,a);const H=Math.cos(P)*f+r,B=Math.sin(P)*f+a;e.lineTo(H,B);const N=Math.cos(O)*f+r,st=Math.sin(O)*f+a;e.lineTo(N,st)}e.closePath()}function zp(e,t,n,i,s){const{fullCircles:o,startAngle:r,circumference:a}=t;let l=t.endAngle;if(o){Di(e,t,n,i,l,s);for(let c=0;c=lt||p,_=bh(a,u+h,f+h);return m&&_}getCenterPoint(n){const{x:i,y:s,startAngle:o,endAngle:r,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:u}=this.options,f=(o+r)/2,d=(a+l+u+c)/2;return{x:i+Math.cos(f)*d,y:s+Math.sin(f)*d}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:i,circumference:s}=this,o=(i.offset||0)/4,r=(i.spacing||0)/2,a=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=s>lt?Math.floor(s/lt):0,s===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*o,Math.sin(l)*o);const c=1-Math.sin(Math.min(rt,s||0)),u=o*c;n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,zp(n,this,u,r,a),Hp(n,this,u,r,a),n.restore()}}A(_n,"id","arc"),A(_n,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),A(_n,"defaultRoutes",{backgroundColor:"backgroundColor"}),A(_n,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});const Is=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],jr=Is.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function Fl(e){return Is[e%Is.length]}function El(e){return jr[e%jr.length]}function Np(e,t){return e.borderColor=Fl(t),e.backgroundColor=El(t),++t}function Bp(e,t){return e.backgroundColor=e.data.map(()=>Fl(t++)),t}function jp(e,t){return e.backgroundColor=e.data.map(()=>El(t++)),t}function Wp(e){let t=0;return(n,i)=>{const s=e.getDatasetMeta(i).controller;s instanceof qe?t=Bp(n,t):s instanceof oi?t=jp(n,t):s&&(t=Np(n,t))}}function Wr(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function Gp(e){return e&&(e.borderColor||e.backgroundColor)}var qp={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:i},options:s}=e.config,{elements:o}=s;if(!n.forceOverride&&(Wr(i)||Gp(s)||o&&Wr(o)))return;const r=Wp(e);i.forEach(r)}};class Ll extends Ln{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const s=ot(i.text)?i.text.length:1;this._padding=$t(i.padding);const o=s*_t(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:i,bottom:s,right:o,options:r}=this,a=r.align;let l=0,c,u,f;return this.isHorizontal()?(u=xn(a,i,o),f=n+t,c=o-i):(r.position==="left"?(u=i+t,f=xn(a,s,n),l=rt*-.5):(u=o-t,f=xn(a,n,s),l=rt*.5),c=s-n),{titleX:u,titleY:f,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const i=_t(n.font),o=i.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);Rn(t,n.text,0,0,i,{color:n.color,maxWidth:l,rotation:c,textAlign:hl(n.align),textBaseline:"middle",translation:[r,a]})}}function Yp(e,t){const n=new Ll({ctx:e.ctx,options:t,chart:e});me.configure(e,n,t),me.addBox(e,n),e.titleBlock=n}var Up={id:"title",_element:Ll,start(e,t,n){Yp(e,n)},stop(e){const t=e.titleBlock;me.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const i=e.titleBlock;me.configure(e,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const bn={average(e){if(!e.length)return!1;let t,n,i=new Set,s=0,o=0;for(t=0,n=e.length;ta+l)/i.size,y:s/o}},nearest(e,t){if(!e.length)return!1;let n=t.x,i=t.y,s=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=e.length;o-1?e.split(` +`):e}function Xp(e,t){const{element:n,datasetIndex:i,index:s}=t,o=e.getDatasetMeta(i).controller,{label:r,value:a}=o.getLabelAndValue(s);return{chart:e,label:r,parsed:o.getParsed(s),raw:e.data.datasets[i].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:i,element:n}}function Gr(e,t){const n=e.chart.ctx,{body:i,footer:s,title:o}=e,{boxWidth:r,boxHeight:a}=t,l=_t(t.bodyFont),c=_t(t.titleFont),u=_t(t.footerFont),f=o.length,d=s.length,h=i.length,g=$t(t.padding);let p=g.height,m=0,_=i.reduce((v,y)=>v+y.before.length+y.lines.length+y.after.length,0);if(_+=e.beforeBody.length+e.afterBody.length,f&&(p+=f*c.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),_){const v=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;p+=h*v+(_-h)*l.lineHeight+(_-1)*t.bodySpacing}d&&(p+=t.footerMarginTop+d*u.lineHeight+(d-1)*t.footerSpacing);let b=0;const x=function(v){m=Math.max(m,n.measureText(v).width+b)};return n.save(),n.font=c.string,q(e.title,x),n.font=l.string,q(e.beforeBody.concat(e.afterBody),x),b=t.displayColors?r+2+t.boxPadding:0,q(i,v=>{q(v.before,x),q(v.lines,x),q(v.after,x)}),b=0,n.font=u.string,q(e.footer,x),n.restore(),m+=g.width,{width:m,height:p}}function Kp(e,t){const{y:n,height:i}=t;return ne.height-i/2?"bottom":"center"}function Qp(e,t,n,i){const{x:s,width:o}=i,r=n.caretSize+n.caretPadding;if(e==="left"&&s+o+r>t.width||e==="right"&&s-o-r<0)return!0}function Zp(e,t,n,i){const{x:s,width:o}=n,{width:r,chartArea:{left:a,right:l}}=e;let c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),Qp(c,e,t,n)&&(c="center"),c}function qr(e,t,n){const i=n.yAlign||t.yAlign||Kp(e,n);return{xAlign:n.xAlign||t.xAlign||Zp(e,t,n,i),yAlign:i}}function Jp(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function tm(e,t,n){let{y:i,height:s}=e;return t==="top"?i+=n:t==="bottom"?i-=s+n:i-=s/2,i}function Yr(e,t,n,i){const{caretSize:s,caretPadding:o,cornerRadius:r}=e,{xAlign:a,yAlign:l}=n,c=s+o,{topLeft:u,topRight:f,bottomLeft:d,bottomRight:h}=Sn(r);let g=Jp(t,a);const p=tm(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(u,d)+s:a==="right"&&(g+=Math.max(f,h)+s),{x:Ct(g,0,i.width-t.width),y:Ct(p,0,i.height-t.height)}}function Zn(e,t,n){const i=$t(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function Ur(e){return Ut([],oe(e))}function em(e,t,n){return Ve(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function Xr(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const Tl={beforeTitle:ie,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,i=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex"u"?Tl[t].call(n,i):s}class Vs extends Ln{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&n.options.animation&&i.animations,o=new wl(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=em(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,s=yt(i,"beforeTitle",this,t),o=yt(i,"title",this,t),r=yt(i,"afterTitle",this,t);let a=[];return a=Ut(a,oe(s)),a=Ut(a,oe(o)),a=Ut(a,oe(r)),a}getBeforeBody(t,n){return Ur(yt(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,s=[];return q(t,o=>{const r={before:[],lines:[],after:[]},a=Xr(i,o);Ut(r.before,oe(yt(a,"beforeLabel",this,o))),Ut(r.lines,yt(a,"label",this,o)),Ut(r.after,oe(yt(a,"afterLabel",this,o))),s.push(r)}),s}getAfterBody(t,n){return Ur(yt(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:i}=n,s=yt(i,"beforeFooter",this,t),o=yt(i,"footer",this,t),r=yt(i,"afterFooter",this,t);let a=[];return a=Ut(a,oe(s)),a=Ut(a,oe(o)),a=Ut(a,oe(r)),a}_createItems(t){const n=this._active,i=this.chart.data,s=[],o=[],r=[];let a=[],l,c;for(l=0,c=n.length;lt.filter(u,f,d,i))),t.itemSort&&(a=a.sort((u,f)=>t.itemSort(u,f,i))),q(a,u=>{const f=Xr(t.callbacks,u);s.push(yt(f,"labelColor",this,u)),o.push(yt(f,"labelPointStyle",this,u)),r.push(yt(f,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,n){const i=this.options.setContext(this.getContext()),s=this._active;let o,r=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const a=bn[i.position].call(this,s,this._eventPosition);r=this._createItems(i),this.title=this.getTitle(r,i),this.beforeBody=this.getBeforeBody(r,i),this.body=this.getBody(r,i),this.afterBody=this.getAfterBody(r,i),this.footer=this.getFooter(r,i);const l=this._size=Gr(this,i),c=Object.assign({},a,l),u=qr(this.chart,i,c),f=Yr(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:f.x,y:f.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,i,s){const o=this.getCaretPosition(t,i,s);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,i){const{xAlign:s,yAlign:o}=this,{caretSize:r,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:f}=Sn(a),{x:d,y:h}=t,{width:g,height:p}=n;let m,_,b,x,v,y;return o==="center"?(v=h+p/2,s==="left"?(m=d,_=m-r,x=v+r,y=v-r):(m=d+g,_=m+r,x=v-r,y=v+r),b=m):(s==="left"?_=d+Math.max(l,u)+r:s==="right"?_=d+g-Math.max(c,f)-r:_=this.caretX,o==="top"?(x=h,v=x-r,m=_-r,b=_+r):(x=h+p,v=x+r,m=_+r,b=_-r),y=x),{x1:m,x2:_,x3:b,y1:x,y2:v,y3:y}}drawTitle(t,n,i){const s=this.title,o=s.length;let r,a,l;if(o){const c=as(i.rtl,this.x,this.width);for(t.x=Zn(this,i.titleAlign,i),n.textAlign=c.textAlign(i.titleAlign),n.textBaseline="middle",r=_t(i.titleFont),a=i.titleSpacing,n.fillStyle=i.titleColor,n.font=r.string,l=0;lb!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Fs(t,{x:p,y:g,w:c,h:l,radius:_}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),Fs(t,{x:m,y:g+1,w:c-2,h:l-2,radius:_}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(p,g,c,l),t.strokeRect(p,g,c,l),t.fillStyle=r.backgroundColor,t.fillRect(m,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){const{body:s}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,f=_t(i.bodyFont);let d=f.lineHeight,h=0;const g=as(i.rtl,this.x,this.width),p=function($){n.fillText($,g.x(t.x+h),t.y+d/2),t.y+=d+o},m=g.textAlign(r);let _,b,x,v,y,M,k;for(n.textAlign=r,n.textBaseline="middle",n.font=f.string,t.x=Zn(this,m,i),n.fillStyle=i.bodyColor,q(this.beforeBody,p),h=a&&m!=="right"?r==="center"?c/2+u:c+2+u:0,v=0,M=s.length;v0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,i=this.$animations,s=i&&i.x,o=i&&i.y;if(s||o){const r=bn[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=Gr(this,t),l=Object.assign({},r,this._size),c=qr(n,t,l),u=Yr(t,l,c,n);(s._to!==u.x||o._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const r=$t(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,s,n),cg(t,n.textDirection),o.y+=r.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),ug(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const i=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!vi(i,s),r=this._positionChanged(s,n);(o||r)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],r=this._getActiveElements(t,o,n,i),a=this._positionChanged(r,t),l=n||!vi(r,o)||a;return l&&(this._active=r,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,i,s){const o=this.options;if(t.type==="mouseout")return[];if(!s)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const r=this.chart.getElementsAtEventForMode(t,o.mode,o,i);return o.reverse&&r.reverse(),r}_positionChanged(t,n){const{caretX:i,caretY:s,options:o}=this,r=bn[o.position].call(this,t,n);return r!==!1&&(i!==r.x||s!==r.y)}}A(Vs,"positioners",bn);var nm={id:"tooltip",_element:Vs,positioners:bn,afterInit(e,t,n){n&&(e.tooltip=new Vs({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Tl},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const im=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function sm(e,t,n,i){const s=e.indexOf(t);if(s===-1)return im(e,t,n,i);const o=e.lastIndexOf(t);return s!==o?n:s}const om=(e,t)=>e===null?null:Ct(Math.round(e),0,t);function Kr(e){const t=this.getLabels();return e>=0&&en.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}A(zs,"id","category"),A(zs,"defaults",{ticks:{callback:Kr}});function rm(e,t){const n=[],{bounds:s,step:o,min:r,max:a,precision:l,count:c,maxTicks:u,maxDigits:f,includeBounds:d}=e,h=o||1,g=u-1,{min:p,max:m}=t,_=!J(r),b=!J(a),x=!J(c),v=(m-p)/(f+1);let y=sr((m-p)/g/h)*h,M,k,$,P;if(y<1e-14&&!_&&!b)return[{value:p},{value:m}];P=Math.ceil(m/y)-Math.floor(p/y),P>g&&(y=sr(P*y/g/h)*h),J(l)||(M=Math.pow(10,l),y=Math.ceil(y*M)/M),s==="ticks"?(k=Math.floor(p/y)*y,$=Math.ceil(m/y)*y):(k=p,$=m),_&&b&&o&&ph((a-r)/o,y/1e3)?(P=Math.round(Math.min((a-r)/y,u)),y=(a-r)/P,k=r,$=a):x?(k=_?r:k,$=b?a:$,P=c-1,y=($-k)/P):(P=($-k)/y,si(P,Math.round(P),y/1e3)?P=Math.round(P):P=Math.ceil(P));const O=Math.max(or(y),or(k));M=Math.pow(10,J(l)?O:l),k=Math.round(k*M)/M,$=Math.round($*M)/M;let R=0;for(_&&(d&&k!==r?(n.push({value:r}),ka)break;n.push({value:V})}return b&&d&&$!==a?n.length&&si(n[n.length-1].value,a,Qr(a,v,e))?n[n.length-1].value=a:n.push({value:a}):(!b||$===a)&&n.push({value:$}),n}function Qr(e,t,{horizontal:n,minRotation:i}){const s=jt(i),o=(n?Math.sin(s):Math.cos(s))||.001,r=.75*t*(""+e).length;return Math.min(t/o,r)}class Oi extends ze{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return J(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds();let{min:s,max:o}=this;const r=l=>s=n?s:l,a=l=>o=i?o:l;if(t){const l=Mi(s),c=Mi(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(s===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||r(s-l)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,r=rm(s,o);return t.bounds==="ticks"&&ll(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let n=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-n)/Math.max(t.length-1,1)/2;n-=s,i+=s}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(t){return Fn(t,this.chart.options.locale,this.options.ticks.format)}}class Zr extends Oi{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=dt(t)?t:0,this.max=dt(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,i=jt(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}A(Zr,"id","linear"),A(Zr,"defaults",{ticks:{callback:Ni.formatters.numeric}});const An=e=>Math.floor(pe(e)),$e=(e,t)=>Math.pow(10,An(e)+t);function Jr(e){return e/Math.pow(10,An(e))===1}function ta(e,t,n){const i=Math.pow(10,n),s=Math.floor(e/i);return Math.ceil(t/i)-s}function am(e,t){const n=t-e;let i=An(n);for(;ta(e,t,i)>10;)i++;for(;ta(e,t,i)<10;)i--;return Math.min(i,An(e))}function lm(e,{min:t,max:n}){t=St(e.min,t);const i=[],s=An(t);let o=am(t,n),r=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((t-l)*r)/r,u=Math.floor((t-l)/a/10)*a*10;let f=Math.floor((c-u)/Math.pow(10,o)),d=St(e.min,Math.round((l+u+f*Math.pow(10,o))*r)/r);for(;d=10?f=f<15?15:20:f++,f>=20&&(o++,f=2,r=o>=0?1:r),d=Math.round((l+u+f*Math.pow(10,o))*r)/r;const h=St(e.max,d);return i.push({value:h,major:Jr(h),significand:f}),i}class ea extends ze{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const i=Oi.prototype.parse.apply(this,[t,n]);if(i===0){this._zero=!0;return}return dt(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=dt(t)?Math.max(0,t):null,this.max=dt(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!dt(this._userMin)&&(this.min=t===$e(this.min,0)?$e(this.min,-1):$e(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let i=this.min,s=this.max;const o=a=>i=t?i:a,r=a=>s=n?s:a;i===s&&(i<=0?(o(1),r(10)):(o($e(i,-1)),r($e(s,1)))),i<=0&&o($e(s,-1)),s<=0&&r($e(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},i=lm(n,this);return t.bounds==="ticks"&&ll(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":Fn(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=pe(t),this._valueRange=pe(this.max)-pe(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(pe(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}A(ea,"id","logarithmic"),A(ea,"defaults",{ticks:{callback:Ni.formatters.logarithmic,major:{enabled:!0}}});function Hs(e){const t=e.ticks;if(t.display&&e.display){const n=$t(t.backdropPadding);return tt(t.font&&t.font.size,ft.font.size)+n.height}return 0}function cm(e,t,n){return n=ot(n)?n:[n],{w:Fh(e,t.string,n),h:n.length*t.lineHeight}}function na(e,t,n,i,s){return e===i||e===s?{start:t-n/2,end:t+n/2}:es?{start:t-n,end:t}:{start:t,end:t+n}}function um(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),i=[],s=[],o=e._pointLabels.length,r=e.options.pointLabels,a=r.centerPointLabels?rt/o:0;for(let l=0;lt.r&&(a=(i.end-t.r)/o,e.r=Math.max(e.r,t.r+a)),s.startt.b&&(l=(s.end-t.b)/r,e.b=Math.max(e.b,t.b+l))}function dm(e,t,n){const i=e.drawingArea,{extra:s,additionalAngle:o,padding:r,size:a}=n,l=e.getPointPosition(t,i+s+r,o),c=Math.round(oo(Kt(l.angle+ut))),u=_m(l.y,a.h,c),f=pm(c),d=mm(l.x,a.w,f);return{visible:!0,x:l.x,y:u,textAlign:f,left:d,top:u,right:d+a.w,bottom:u+a.h}}function hm(e,t){if(!t)return!0;const{left:n,top:i,right:s,bottom:o}=e;return!(Ge({x:n,y:i},t)||Ge({x:n,y:o},t)||Ge({x:s,y:i},t)||Ge({x:s,y:o},t))}function gm(e,t,n){const i=[],s=e._pointLabels.length,o=e.options,{centerPointLabels:r,display:a}=o.pointLabels,l={extra:Hs(o)/2,additionalAngle:r?rt/s:0};let c;for(let u=0;u270||n<90)&&(e-=t),e}function bm(e,t,n){const{left:i,top:s,right:o,bottom:r}=n,{backdropColor:a}=t;if(!J(a)){const l=Sn(t.borderRadius),c=$t(t.backdropPadding);e.fillStyle=a;const u=i-c.left,f=s-c.top,d=o-i+c.width,h=r-s+c.height;Object.values(l).some(g=>g!==0)?(e.beginPath(),Fs(e,{x:u,y:f,w:d,h,radius:l}),e.fill()):e.fillRect(u,f,d,h)}}function ym(e,t){const{ctx:n,options:{pointLabels:i}}=e;for(let s=t-1;s>=0;s--){const o=e._pointLabelItems[s];if(!o.visible)continue;const r=i.setContext(e.getPointLabelContext(s));bm(n,r,o);const a=_t(r.font),{x:l,y:c,textAlign:u}=o;Rn(n,e._pointLabels[s],l,c+a.lineHeight/2,a,{color:r.color,textAlign:u,textBaseline:"middle"})}}function Il(e,t,n,i){const{ctx:s}=e;if(n)s.arc(e.xCenter,e.yCenter,t,0,lt);else{let o=e.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let r=1;r{const s=at(this.options.pointLabels.callback,[n,i],this);return s||s===0?s:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?um(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,i,s){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,i,s))}getIndexAngle(t){const n=lt/(this._pointLabels.length||1),i=this.options.startAngle||0;return Kt(t*n+jt(i))}getDistanceFromCenterForValue(t){if(J(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(J(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t{if(f!==0||f===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const d=this.getContext(f),h=s.setContext(d),g=o.setContext(d);xm(this,h,l,r,g)}}),i.display){for(t.save(),a=r-1;a>=0;a--){const u=i.setContext(this.getPointLabelContext(a)),{color:f,lineWidth:d}=u;!d||!f||(t.lineWidth=d,t.strokeStyle=f,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const c=i.setContext(this.getContext(l)),u=_t(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,r=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const f=$t(c.backdropPadding);t.fillRect(-r/2-f.left,-o-u.size/2-f.top,r+f.width,u.size+f.height)}Rn(t,a.label,0,-o,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}A(Jn,"id","radialLinear"),A(Jn,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ni.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),A(Jn,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),A(Jn,"descriptors",{angleLines:{_fallback:"grid"}});const Wi={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},xt=Object.keys(Wi);function ia(e,t){return e-t}function sa(e,t){if(J(t))return null;const n=e._adapter,{parser:i,round:s,isoWeekday:o}=e._parseOpts;let r=t;return typeof i=="function"&&(r=i(r)),dt(r)||(r=typeof i=="string"?n.parse(r,i):n.parse(r)),r===null?null:(s&&(r=s==="week"&&(ki(o)||o===!0)?n.startOf(r,"isoWeek",o):n.startOf(r,s)),+r)}function oa(e,t,n,i){const s=xt.length;for(let o=xt.indexOf(e);o=xt.indexOf(n);o--){const r=xt[o];if(Wi[r].common&&e._adapter.diff(s,i,r)>=t-1)return r}return xt[n?xt.indexOf(n):0]}function Sm(e){for(let t=xt.indexOf(e)+1,n=xt.length;t=t?n[i]:n[s];e[o]=!0}}function Cm(e,t,n,i){const s=e._adapter,o=+s.startOf(t[0].value,i),r=t[t.length-1].value;let a,l;for(a=o;a<=r;a=+s.add(a,1,i))l=n[a],l>=0&&(t[l].major=!0);return t}function aa(e,t,n){const i=[],s={},o=t.length;let r,a;for(r=0;r+t.value))}initOffsets(t=[]){let n=0,i=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?n=1-s:n=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?i=o:i=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;n=Ct(n,0,r),i=Ct(i,0,r),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const t=this._adapter,n=this.min,i=this.max,s=this.options,o=s.time,r=o.unit||oa(o.minUnit,n,i,this._getLabelCapacity(n)),a=tt(s.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=ki(l)||l===!0,u={};let f=n,d,h;if(c&&(f=+t.startOf(f,"isoWeek",l)),f=+t.startOf(f,c?"day":r),t.diff(i,n,r)>1e5*a)throw new Error(n+" and "+i+" are too far apart with stepSize of "+a+" "+r);const g=s.ticks.source==="data"&&this.getDataTimestamps();for(d=f,h=0;d+p)}getLabelForValue(t){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}format(t,n){const s=this.options.time.displayFormats,o=this._unit,r=n||s[o];return this._adapter.format(t,r)}_tickFormatFunction(t,n,i,s){const o=this.options,r=o.ticks.callback;if(r)return at(r,[t,n,i],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],f=c&&a[c],d=i[n],h=c&&f&&d&&d.major;return this._adapter.format(t,s||(h?f:u))}generateTickLabels(t){let n,i,s;for(n=0,i=t.length;n0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,i=s.length;n=e[i].pos&&t<=e[s].pos&&({lo:i,hi:s}=Ds(e,"pos",t)),{pos:o,time:a}=e[i],{pos:r,time:l}=e[s]):(t>=e[i].time&&t<=e[s].time&&({lo:i,hi:s}=Ds(e,"time",t)),{time:o,pos:a}=e[i],{time:r,pos:l}=e[s]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class la extends Fi{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=ti(n,this.min),this._tableRange=ti(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:i}=this,s=[],o=[];let r,a,l,c,u;for(r=0,a=t.length;r=n&&c<=i&&s.push(c);if(s.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(r=0,a=s.length;rs-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),i=this.getLabelTimestamps();return n.length&&i.length?t=this.normalize(n.concat(i)):t=n.length?n:i,t=this._cache.all=t,t}getDecimalForValue(t){return(ti(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return ti(this._table,i*this._tableRange+this._minPos,!0)}}A(la,"id","timeseries"),A(la,"defaults",Fi.defaults);const ca=/^on/,Vl=[];Object.keys(globalThis).forEach(e=>{ca.test(e)&&Vl.push(e.replace(ca,""))});function zl(e){const t=Fe,n=[];function i(s){gc(t,s)}Li(()=>{const s=e();Vl.forEach(s instanceof Element?o=>n.push(It(s,o,i)):o=>n.push(s.$on(o,i)))}),rn(()=>{for(;n.length;)n.pop()()})}function Mm(e){let t,n=[e[1]],i={};for(let s=0;s{n(2,l=new ji(c,{type:i,data:s,options:o,plugins:r}))}),fc(()=>{l&&(n(2,l.data=s,l),Object.assign(l.options,o),l.update(a))}),rn(()=>{l&&l.destroy(),n(2,l=null)}),zl(()=>c);function f(d){Ze[d?"unshift":"push"](()=>{c=d,n(0,c)})}return e.$$set=d=>{n(9,t=z(z({},t),et(d))),"type"in d&&n(3,i=d.type),"data"in d&&n(4,s=d.data),"options"in d&&n(5,o=d.options),"plugins"in d&&n(6,r=d.plugins),"updateMode"in d&&n(7,a=d.updateMode),"chart"in d&&n(2,l=d.chart)},t=et(t),[c,u,l,i,s,o,r,a,f]}let $m=class extends K{constructor(t){super(),Q(this,t,Rm,Mm,U,{type:3,data:4,options:5,plugins:6,updateMode:7,chart:2})}};function Am(e){let t,n,i;const s=[{type:"pie"},e[1]];function o(a){e[4](a)}let r={};for(let a=0;aMa(t,"chart",o)),{c(){I(t.$$.fragment)},m(a,l){E(t,a,l),i=!0},p(a,[l]){const c=l&2?zt(s,[s[0],Jt(a[1])]):{};!n&&l&1&&(n=!0,c.chart=a[0],wa(()=>n=!1)),t.$set(c)},i(a){i||(S(t.$$.fragment,a),i=!0)},o(a){C(t.$$.fragment,a),i=!1},d(a){e[3](null),L(t,a)}}}function Pm(e,t,n){ji.register(Es);let{chart:i=null}=t,s,o;zl(()=>o);function r(l){Ze[l?"unshift":"push"](()=>{o=l,n(2,o)})}function a(l){i=l,n(0,i)}return e.$$set=l=>{n(5,t=z(z({},t),et(l))),"chart"in l&&n(0,i=l.chart)},e.$$.update=()=>{n(1,s=t)},t=et(t),[i,s,o,r,a]}class Dm extends K{constructor(t){super(),Q(this,t,Pm,Am,U,{chart:0})}}function Om(e){let t,n;return t=new Dm({props:{class:"self-center",width:256,height:256,data:{labels:e[0].labels,datasets:[{data:e[0].data}]},options:{maintainAspectRatio:!1,responsive:!1,parsing:{key:"time"},animation:!1,plugins:{tooltip:{callbacks:{label:Fm}}}}}}),{c(){I(t.$$.fragment)},m(i,s){E(t,i,s),n=!0},p(i,[s]){const o={};s&1&&(o.data={labels:i[0].labels,datasets:[{data:i[0].data}]}),t.$set(o)},i(i){n||(S(t.$$.fragment,i),n=!0)},o(i){C(t.$$.fragment,i),n=!1},d(i){L(t,i)}}}const Fm=e=>`Queries: ${e.raw.queries}, Time: ${e.raw.time.toFixed(4)} ms`;function Em(e,t,n){let i;return gt(e,vs,s=>n(0,i=s)),ji.register(Up,nm,_n,zs,qp),[i]}class Lm extends K{constructor(t){super(),Q(this,t,Em,Om,U,{})}}function ua(e,t,n){const i=e.slice();return i[5]=t[n],i}function fa(e){let t,n=e[5]+"",i,s,o,r;function a(){return e[4](e[5])}return{c(){t=D("button"),i=Z(n),s=Y(),F(t,"class","bg-dark-600 p-3 border-[1px] outline-none border-transparent focus-visible:border-cyan-600 text-left hover:bg-dark-400 rounded-md")},m(l,c){nt(l,t,c),w(t,i),w(t,s),o||(r=It(t,"click",a),o=!0)},p(l,c){e=l,c&2&&n!==(n=e[5]+"")&&Wt(i,n)},d(l){l&&X(t),o=!1,r()}}}function Tm(e){let t,n,i,s,o,r,a,l,c,u,f,d,h,g,p,m,_,b,x,v,y,M,k,$=e[2].queries+"",P,O,R,V,ct=e[2].timeQuerying.toFixed(4)+"",it,H,B,N,st,G=e[2].slowQueries+"",Et,Se,vt,wt;a=new Id({});function ee(j){e[3](j)}let ue={icon:nl};e[0]!==void 0&&(ue.value=e[0]),c=new Rd({props:ue}),Ze.push(()=>Ma(c,"value",ee));let bt=e[1],pt=[];for(let j=0;ju=!1)),c.$set(Ce),fe&2){bt=j[1];let Lt;for(Lt=0;Ltn(0,i=l)),gt(e,lu,l=>n(1,s=l)),gt(e,xs,l=>n(2,o=l));function r(l){i=l,bs.set(i)}return[i,s,o,r,l=>Ee.goto(`/${l}`)]}class Vm extends K{constructor(t){super(),Q(this,t,Im,Tm,U,{})}}function da(e){let t,n,i,s,o,r,a;return i=new wo({props:{path:"/",$$slots:{default:[zm]},$$scope:{ctx:e}}}),o=new wo({props:{path:"/:resource",$$slots:{default:[Hm]},$$scope:{ctx:e}}}),{c(){t=D("main"),n=D("div"),I(i.$$.fragment),s=Y(),I(o.$$.fragment),F(n,"class","bg-dark-800 flex h-[700px] w-[1200px] rounded-md text-white"),F(t,"class","font-main flex h-full w-full items-center justify-center")},m(l,c){nt(l,t,c),w(t,n),E(i,n,null),w(n,s),E(o,n,null),a=!0},i(l){a||(S(i.$$.fragment,l),S(o.$$.fragment,l),Je(()=>{a&&(r||(r=di(t,zo,{start:.95,duration:150},!0)),r.run(1))}),a=!0)},o(l){C(i.$$.fragment,l),C(o.$$.fragment,l),r||(r=di(t,zo,{start:.95,duration:150},!1)),r.run(0),a=!1},d(l){l&&X(t),L(i),L(o),l&&r&&r.end()}}}function zm(e){let t,n;return t=new Vm({}),{c(){I(t.$$.fragment)},m(i,s){E(t,i,s),n=!0},i(i){n||(S(t.$$.fragment,i),n=!0)},o(i){C(t.$$.fragment,i),n=!1},d(i){L(t,i)}}}function Hm(e){let t,n;return t=new Cd({}),{c(){I(t.$$.fragment)},m(i,s){E(t,i,s),n=!0},i(i){n||(S(t.$$.fragment,i),n=!0)},o(i){C(t.$$.fragment,i),n=!1},d(i){L(t,i)}}}function Nm(e){let t,n,i=e[0]&&da(e);return{c(){i&&i.c(),t=Pn()},m(s,o){i&&i.m(s,o),nt(s,t,o),n=!0},p(s,[o]){s[0]?i?o&1&&S(i,1):(i=da(s),i.c(),S(i,1),i.m(t.parentNode,t)):i&&(kt(),C(i,1,1,()=>{i=null}),Rt())},i(s){n||(S(i),n=!0)},o(s){C(i),n=!1},d(s){i&&i.d(s),s&&X(t)}}}function Bm(e,t,n){let i,s,o,r;gt(e,Ki,l=>n(0,i=l)),gt(e,vs,l=>n(1,s=l)),gt(e,xs,l=>n(2,o=l)),gt(e,ys,l=>n(3,r=l)),Ee.mode.hash(),Ee.goto("/"),Ja("openUI",l=>{mt(Ki,i=!0,i),mt(ys,r=l.resources,r),mt(xs,o={queries:l.totalQueries,slowQueries:l.slowQueries,timeQuerying:l.totalTime},o),mt(vs,s={labels:l.chartData.labels,data:l.chartData.data},s)}),el([{action:"openUI",data:{resources:["ox_core","oxmysql","ox_inventory","ox_doorlock","ox_lib","ox_vehicleshop","ox_target"],slowQueries:13,totalQueries:332,totalTime:230123,chartData:{labels:["oxmysql","ox_core","ox_inventory","ox_doorlock"],data:[{queries:25,time:133},{queries:5,time:12},{queries:3,time:2},{queries:72,time:133}]}}}]);const a=l=>{l.key==="Escape"&&(mt(Ki,i=!1,i),Da("exit"))};return e.$$.update=()=>{e.$$.dirty&1&&(i?window.addEventListener("keydown",a):window.removeEventListener("keydown",a))},[i]}class jm extends K{constructor(t){super(),Q(this,t,Bm,Nm,U,{})}}new jm({target:document.getElementById("app")});if(tl()){const e=document.getElementById("app");e.style.backgroundImage='url("https://i.imgur.com/3pzRj9n.png")',e.style.backgroundSize="cover",e.style.backgroundRepeat="no-repeat",e.style.backgroundPosition="center"} diff --git a/server-data/resources/[ox]/oxmysql/web/build/assets/index-d38ffbb2.js b/server-data/resources/[ox]/oxmysql/web/build/assets/index-d38ffbb2.js deleted file mode 100644 index 39e0c0c91..000000000 --- a/server-data/resources/[ox]/oxmysql/web/build/assets/index-d38ffbb2.js +++ /dev/null @@ -1,46 +0,0 @@ -var $l=Object.defineProperty;var Al=(e,t,n)=>t in e?$l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var H=(e,t,n)=>(Al(e,typeof t!="symbol"?t+"":t,n),n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&i(r)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();function ht(){}const ta=e=>e;function N(e,t){for(const n in t)e[n]=t[n];return e}function ea(e){return e()}function rs(){return Object.create(null)}function te(e){e.forEach(ea)}function le(e){return typeof e=="function"}function Y(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}function Pl(e){return Object.keys(e).length===0}function Ds(e,...t){if(e==null)return ht;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function Fl(e){let t;return Ds(e,n=>t=n)(),t}function gt(e,t,n){e.$$.on_destroy.push(Ds(t,n))}function At(e,t,n,i){if(e){const s=na(e,t,n,i);return e[0](s)}}function na(e,t,n,i){return e[1]&&i?N(n.ctx.slice(),e[1](i(t))):n.ctx}function Pt(e,t,n,i){if(e[2]&&i){const s=e[2](i(n));if(t.dirty===void 0)return s;if(typeof s=="object"){const o=[],r=Math.max(t.dirty.length,s.length);for(let a=0;a32){const t=[],n=e.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),Es=ia?e=>requestAnimationFrame(e):ht;const Ge=new Set;function sa(e){Ge.forEach(t=>{t.c(e)||(Ge.delete(t),t.f())}),Ge.size!==0&&Es(sa)}function Ol(e){let t;return Ge.size===0&&Es(sa),{promise:new Promise(n=>{Ge.add(t={c:e,f:n})}),abort(){Ge.delete(t)}}}let $i=!1;function El(){$i=!0}function Ll(){$i=!1}function Tl(e,t,n,i){for(;e>1);n(s)<=i?e=s+1:t=s}return e}function Il(e){if(e.hydrate_init)return;e.hydrate_init=!0;let t=e.childNodes;if(e.nodeName==="HEAD"){const l=[];for(let c=0;c0&&t[n[s]].claim_order<=c?s+1:Tl(1,s,d=>t[n[d]].claim_order,c))-1;i[l]=n[u]+1;const f=u+1;n[f]=l,s=Math.max(f,s)}const o=[],r=[];let a=t.length-1;for(let l=n[s]+1;l!=0;l=i[l-1]){for(o.push(t[l-1]);a>=l;a--)r.push(t[a]);a--}for(;a>=0;a--)r.push(t[a]);o.reverse(),r.sort((l,c)=>l.claim_order-c.claim_order);for(let l=0,c=0;l=o[c].claim_order;)c++;const u=ce.removeEventListener(t,n,i)}function D(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function Bl(e,t){const n=Object.getOwnPropertyDescriptors(e.__proto__);for(const i in t)t[i]==null?e.removeAttribute(i):i==="style"?e.style.cssText=t[i]:i==="__value"?e.value=e[i]=t[i]:n[i]&&n[i].set?e[i]=t[i]:D(e,i,t[i])}function ii(e,t){for(const n in t)D(e,n,t[n])}function jl(e){return Array.from(e.childNodes)}function Wl(e){e.claim_info===void 0&&(e.claim_info={last_index:0,total_claimed:0})}function Gl(e,t,n,i,s=!1){Wl(e);const o=(()=>{for(let r=e.claim_info.last_index;r=0;r--){const a=e[r];if(t(a)){const l=n(a);return l===void 0?e.splice(r,1):e[r]=l,s?l===void 0&&e.claim_info.last_index--:e.claim_info.last_index=r,a}}return i()})();return o.claim_order=e.claim_info.total_claimed,e.claim_info.total_claimed+=1,o}function ql(e,t){return Gl(e,n=>n.nodeType===3,n=>{const i=""+t;if(n.data.startsWith(i)){if(n.data.length!==i.length)return n.splitText(i.length)}else n.data=i},()=>J(t),!0)}function Wt(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function si(e,t){e.value=t??""}function Fn(e,t,n){e.classList[n?"add":"remove"](t)}function Yl(e,t,{bubbles:n=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(e,n,i,t),s}function ye(e,t){return new e(t)}const oi=new Map;let ri=0;function Ul(e){let t=5381,n=e.length;for(;n--;)t=(t<<5)-t^e.charCodeAt(n);return t>>>0}function Xl(e,t){const n={stylesheet:Vl(t),rules:{}};return oi.set(e,n),n}function so(e,t,n,i,s,o,r,a=0){const l=16.666/i;let c=`{ -`;for(let m=0;m<=1;m+=l){const _=t+(n-t)*o(m);c+=m*100+`%{${r(_,1-_)}} -`}const u=c+`100% {${r(n,1-n)}} -}`,f=`__svelte_${Ul(u)}_${a}`,d=oa(e),{stylesheet:h,rules:g}=oi.get(d)||Xl(d,e);g[f]||(g[f]=!0,h.insertRule(`@keyframes ${f} ${u}`,h.cssRules.length));const p=e.style.animation||"";return e.style.animation=`${p?`${p}, `:""}${f} ${i}ms linear ${s}ms 1 both`,ri+=1,f}function Kl(e,t){const n=(e.style.animation||"").split(", "),i=n.filter(t?o=>o.indexOf(t)<0:o=>o.indexOf("__svelte")===-1),s=n.length-i.length;s&&(e.style.animation=i.join(", "),ri-=s,ri||Ql())}function Ql(){Es(()=>{ri||(oi.forEach(e=>{const{ownerNode:t}=e.stylesheet;t&&U(t)}),oi.clear())})}let Oe;function Pe(e){Oe=e}function tn(){if(!Oe)throw new Error("Function called outside component initialization");return Oe}function Ai(e){tn().$$.on_mount.push(e)}function Zl(e){tn().$$.after_update.push(e)}function en(e){tn().$$.on_destroy.push(e)}function Jl(e,t){return tn().$$.context.set(e,t),t}function Ls(e){return tn().$$.context.get(e)}function tc(e){return tn().$$.context.has(e)}function ec(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach(i=>i.call(this,t))}const je=[],Ke=[];let qe=[];const as=[],aa=Promise.resolve();let ls=!1;function la(){ls||(ls=!0,aa.then(ua))}function Ts(){return la(),aa}function Qe(e){qe.push(e)}function ca(e){as.push(e)}const Vi=new Set;let ze=0;function ua(){if(ze!==0)return;const e=Oe;do{try{for(;zee.indexOf(i)===-1?t.push(i):n.push(i)),n.forEach(i=>i()),qe=t}let nn;function sc(){return nn||(nn=Promise.resolve(),nn.then(()=>{nn=null})),nn}function zi(e,t,n){e.dispatchEvent(Yl(`${t?"intro":"outro"}${n}`))}const Kn=new Set;let ae;function kt(){ae={r:0,c:[],p:ae}}function Rt(){ae.r||te(ae.c),ae=ae.p}function S(e,t){e&&e.i&&(Kn.delete(e),e.i(t))}function C(e,t,n,i){if(e&&e.o){if(Kn.has(e))return;Kn.add(e),ae.c.push(()=>{Kn.delete(e),i&&(n&&e.d(1),i())}),e.o(t)}else i&&i()}const oc={duration:0};function ai(e,t,n,i){const s={direction:"both"};let o=t(e,n,s),r=i?0:1,a=null,l=null,c=null;function u(){c&&Kl(e,c)}function f(h,g){const p=h.b-r;return g*=Math.abs(p),{a:r,b:h.b,d:p,duration:g,start:h.start,end:h.start+g,group:h.group}}function d(h){const{delay:g=0,duration:p=300,easing:m=ta,tick:_=ht,css:b}=o||oc,y={start:Dl()+g,b:h};h||(y.group=ae,ae.r+=1),a||l?l=y:(b&&(u(),c=so(e,r,h,p,g,m,b)),h&&_(0,1),a=f(y,p),Qe(()=>zi(e,h,"start")),Ol(x=>{if(l&&x>l.start&&(a=f(l,p),l=null,zi(e,a.b,"start"),b&&(u(),c=so(e,r,a.b,a.duration,0,m,o.css))),a){if(x>=a.end)_(r=a.b,1-r),zi(e,a.b,"end"),l||(a.b?u():--a.group.r||te(a.group.c)),a=null;else if(x>=a.start){const v=x-a.start;r=a.a+a.d*m(v/a.duration),_(r,1-r)}}return!!(a||l)}))}return{run(h){le(o)?sc().then(()=>{o=o(s),d(h)}):d(h)},end(){u(),a=l=null}}}function zt(e,t){const n={},i={},s={$$scope:1};let o=e.length;for(;o--;){const r=e[o],a=t[o];if(a){for(const l in r)l in a||(i[l]=1);for(const l in a)s[l]||(n[l]=a[l],s[l]=1);e[o]=a}else for(const l in r)s[l]=1}for(const r in i)r in n||(n[r]=void 0);return n}function ee(e){return typeof e=="object"&&e!==null?e:{}}const rc=/[&"]/g,ac=/[&<]/g;function lc(e,t=!1){const n=String(e),i=t?rc:ac;i.lastIndex=0;let s="",o=0;for(;i.test(n);){const r=i.lastIndex-1,a=n[r];s+=n.substring(o,r)+(a==="&"?"&":a==='"'?""":"<"),o=r+1}return s+n.substring(o)}function cc(e,t){if(!e||!e.$$render)throw t==="svelte:component"&&(t+=" this={...}"),new Error(`<${t}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules. Otherwise you may need to fix a <${t}>.`);return e}let Hi;function fa(e){function t(n,i,s,o,r){const a=Oe,l={on_destroy:Hi,context:new Map(r||(a?a.$$.context:[])),on_mount:[],before_update:[],after_update:[],callbacks:rs()};Pe({$$:l});const c=e(n,i,s,o);return Pe(a),c}return{render:(n={},{$$slots:i={},context:s=new Map}={})=>{Hi=[];const o={title:"",head:"",css:new Set},r=t(o,n,{},i,s);return te(Hi),{html:r,css:{code:Array.from(o.css).map(a=>a.code).join(` -`),map:null},head:o.title+o.head}},$$render:t}}function da(e,t,n){const i=e.$$.props[t];i!==void 0&&(e.$$.bound[i]=n,n(e.$$.ctx[i]))}function V(e){e&&e.c()}function uc(e,t){e&&e.l(t)}function E(e,t,n,i){const{fragment:s,after_update:o}=e.$$;s&&s.m(t,n),i||Qe(()=>{const r=e.$$.on_mount.map(ea).filter(le);e.$$.on_destroy?e.$$.on_destroy.push(...r):te(r),e.$$.on_mount=[]}),o.forEach(Qe)}function L(e,t){const n=e.$$;n.fragment!==null&&(ic(n.after_update),te(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function fc(e,t){e.$$.dirty[0]===-1&&(je.push(e),la(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const g=h.length?h[0]:d;return c.ctx&&s(c.ctx[f],c.ctx[f]=g)&&(!c.skip_bound&&c.bound[f]&&c.bound[f](g),u&&fc(e,f)),d}):[],c.update(),u=!0,te(c.before_update),c.fragment=i?i(c.ctx):!1,t.target){if(t.hydrate){El();const f=jl(t.target);c.fragment&&c.fragment.l(f),f.forEach(U)}else c.fragment&&c.fragment.c();t.intro&&S(e.$$.fragment),E(e,t.target,t.anchor,t.customElement),Ll(),ua()}Pe(l)}class X{$destroy(){L(this,1),this.$destroy=ht}$on(t,n){if(!le(n))return ht;const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(n),()=>{const s=i.indexOf(n);s!==-1&&i.splice(s,1)}}$set(t){this.$$set&&!Pl(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const He=[];function cs(e,t){return{subscribe:Ot(e,t).subscribe}}function Ot(e,t=ht){let n;const i=new Set;function s(a){if(Y(e,a)&&(e=a,n)){const l=!He.length;for(const c of i)c[1](),He.push(c,e);if(l){for(let c=0;c{i.delete(c),i.size===0&&n&&(n(),n=null)}}return{set:s,update:o,subscribe:r}}function Is(e,t,n){const i=!Array.isArray(e),s=i?[e]:e,o=t.length<2;return cs(n,r=>{let a=!1;const l=[];let c=0,u=ht;const f=()=>{if(c)return;u();const h=t(i?l[0]:l,r);o?r(h):u=le(h)?h:ht},d=s.map((h,g)=>Ds(h,p=>{l[g]=p,c&=~(1<{c|=1<a.startsWith(":")?(n.push(a.slice(1)),"([^\\/]+)"):a).join("\\/"),r=t.match(new RegExp(`^${o}$`));return r||(s=!1,r=t.match(new RegExp(`^${o}`))),r?(n.forEach((a,l)=>i[a]=r[l+1]),{exact:s,params:i,part:r[0].slice(0,-1)}):null}function ha(e,t,n){if(n==="")return e;if(n[0]==="/")return n;let i=r=>r.split("/").filter(a=>a!==""),s=i(e);return"/"+(t?i(t):[]).map((r,a)=>s[a]).join("/")+"/"+n}function oo(e,t,n,i){let s=[t,"data-"+t].reduce((o,r)=>{let a=e.getAttribute(r);return n&&e.removeAttribute(r),a===null?o:a},!1);return!i&&s===""?!0:s||i||!1}function hc(e){let t=e.split("&").map(n=>n.split("=")).reduce((n,i)=>{let s=i[0];if(!s)return n;let o=i.length>1?i[i.length-1]:!0;return typeof o=="string"&&o.includes(",")&&(o=o.split(",")),n[s]===void 0?n[s]=[o]:n[s].push(o),n},{});return Object.entries(t).reduce((n,i)=>(n[i[0]]=i[1].length>1?i[1]:i[1][0],n),{})}function gc(e){return Object.entries(e).map(([t,n])=>n?n===!0?t:`${t}=${Array.isArray(n)?n.join(","):n}`:null).filter(t=>t).join("&")}function ro(e,t){return e?t+e:""}function ga(e){throw new Error("[Tinro] "+e)}var Nt={HISTORY:1,HASH:2,MEMORY:3,OFF:4,run(e,t,n,i){return e===this.HISTORY?t&&t():e===this.HASH?n&&n():i&&i()},getDefault(){return!window||window.location.pathname==="srcdoc"?this.MEMORY:this.HISTORY}},Vs,pa,ma,li="",Ht=pc();function pc(){let e=Nt.getDefault(),t,n=r=>window.onhashchange=window.onpopstate=Vs=null,i=r=>t&&t(Ni(e)),s=r=>{r&&(e=r),n(),e!==Nt.OFF&&Nt.run(e,a=>window.onpopstate=i,a=>window.onhashchange=i)&&i()},o=r=>{let a=Object.assign(Ni(e),r);return a.path+ro(gc(a.query),"?")+ro(a.hash,"#")};return{mode:s,get:r=>Ni(e),go(r,a){mc(e,r,a),i()},start(r){t=r,s()},stop(){t=null,s(Nt.OFF)},set(r){this.go(o(r),!r.path)},methods(){return _c(this)},base:r=>li=r}}function mc(e,t,n){!n&&(pa=ma);let i=s=>history[`${n?"replace":"push"}State`]({},"",s);Nt.run(e,s=>i(li+t),s=>i(`#${t}`),s=>Vs=t)}function Ni(e){let t=window.location,n=Nt.run(e,s=>(li?t.pathname.replace(li,""):t.pathname)+t.search+t.hash,s=>String(t.hash.slice(1)||"/"),s=>Vs||"/"),i=n.match(/^([^?#]+)(?:\?([^#]+))?(?:\#(.+))?$/);return ma=n,{url:n,from:pa,path:i[1]||"",query:hc(i[2]||""),hash:i[3]||""}}function _c(e){let t=()=>e.get().query,n=r=>e.set({query:r}),i=r=>n(r(t())),s=()=>e.get().hash,o=r=>e.set({hash:r});return{hash:{get:s,set:o,clear:()=>o("")},query:{replace:n,clear:()=>n(""),get(r){return r?t()[r]:t()},set(r,a){i(l=>(l[r]=a,l))},delete(r){i(a=>(a[r]&&delete a[r],a))}}}}var Ee=bc();function bc(){let{subscribe:e}=Ot(Ht.get(),t=>{Ht.start(t);let n=yc(Ht.go);return()=>{Ht.stop(),n()}});return{subscribe:e,goto:Ht.go,params:vc,meta:zs,useHashNavigation:t=>Ht.mode(t?Nt.HASH:Nt.HISTORY),mode:{hash:()=>Ht.mode(Nt.HASH),history:()=>Ht.mode(Nt.HISTORY),memory:()=>Ht.mode(Nt.MEMORY)},base:Ht.base,location:Ht.methods()}}function yc(e){let t=n=>{let i=n.target.closest("a[href]"),s=i&&oo(i,"target",!1,"_self"),o=i&&oo(i,"tinro-ignore"),r=n.ctrlKey||n.metaKey||n.altKey||n.shiftKey;if(s=="_self"&&!o&&!r&&i){let a=i.getAttribute("href").replace(/^\/#/,"");/^\/\/|^#|^[a-zA-Z]+:/.test(a)||(n.preventDefault(),e(a.startsWith("/")?a:i.href.replace(window.location.origin,"")))}};return addEventListener("click",t),()=>removeEventListener("click",t)}function vc(){return Ls("tinro").meta.params}var ci="tinro",xc=_a({pattern:"",matched:!0});function wc(e){let t=Ls(ci)||xc;(t.exact||t.fallback)&&ga(`${e.fallback?"":``} can't be inside ${t.fallback?"":` with exact path`}`);let n=e.fallback?"fallbacks":"childs",i=Ot({}),s=_a({fallback:e.fallback,parent:t,update(o){s.exact=!o.path.endsWith("/*"),s.pattern=us(`${s.parent.pattern||""}${o.path}`),s.redirect=o.redirect,s.firstmatch=o.firstmatch,s.breadcrumb=o.breadcrumb,s.match()},register:()=>(s.parent[n].add(s),async()=>{s.parent[n].delete(s),s.parent.activeChilds.delete(s),s.router.un&&s.router.un(),s.parent.match()}),show:()=>{e.onShow(),!s.fallback&&s.parent.activeChilds.add(s)},hide:()=>{e.onHide(),s.parent.activeChilds.delete(s)},match:async()=>{s.matched=!1;let{path:o,url:r,from:a,query:l}=s.router.location,c=dc(s.pattern,o);if(!s.fallback&&c&&s.redirect&&(!s.exact||s.exact&&c.exact)){let u=ha(o,s.parent.pattern,s.redirect);return Ee.goto(u,!0)}s.meta=c&&{from:a,url:r,query:l,match:c.part,pattern:s.pattern,breadcrumbs:s.parent.meta&&s.parent.meta.breadcrumbs.slice()||[],params:c.params,subscribe:i.subscribe},s.breadcrumb&&s.meta&&s.meta.breadcrumbs.push({name:s.breadcrumb,path:c.part}),i.set(s.meta),c&&!s.fallback&&(!s.exact||s.exact&&c.exact)&&(!s.parent.firstmatch||!s.parent.matched)?(e.onMeta(s.meta),s.parent.matched=!0,s.show()):s.hide(),c&&s.showFallbacks()}});return Jl(ci,s),Ai(()=>s.register()),s}function zs(){return tc(ci)?Ls(ci).meta:ga("meta() function must be run inside any `` child component only")}function _a(e){let t={router:{},exact:!1,pattern:null,meta:null,parent:null,fallback:!1,redirect:!1,firstmatch:!1,breadcrumb:null,matched:!1,childs:new Set,activeChilds:new Set,fallbacks:new Set,async showFallbacks(){if(!this.fallback&&(await Ts(),this.childs.size>0&&this.activeChilds.size==0||this.childs.size==0&&this.fallbacks.size>0)){let n=this;for(;n.fallbacks.size==0;)if(n=n.parent,!n)return;n&&n.fallbacks.forEach(i=>{if(i.redirect){let s=ha("/",i.parent.pattern,i.redirect);Ee.goto(s,!0)}else i.show()})}},start(){this.router.un||(this.router.un=Ee.subscribe(n=>{this.router.location=n,this.pattern!==null&&this.match()}))},match(){this.showFallbacks()}};return Object.assign(t,e),t.start(),t}const Sc=e=>({params:e&2,meta:e&4}),ao=e=>({params:e[1],meta:e[2]});function lo(e){let t;const n=e[9].default,i=At(n,e,e[8],ao);return{c(){i&&i.c()},m(s,o){i&&i.m(s,o),t=!0},p(s,o){i&&i.p&&(!t||o&262)&&Ft(i,n,s,s[8],t?Pt(n,s[8],o,Sc):Dt(s[8]),ao)},i(s){t||(S(i,s),t=!0)},o(s){C(i,s),t=!1},d(s){i&&i.d(s)}}}function Cc(e){let t,n,i=e[0]&&lo(e);return{c(){i&&i.c(),t=kn()},m(s,o){i&&i.m(s,o),it(s,t,o),n=!0},p(s,[o]){s[0]?i?(i.p(s,o),o&1&&S(i,1)):(i=lo(s),i.c(),S(i,1),i.m(t.parentNode,t)):i&&(kt(),C(i,1,1,()=>{i=null}),Rt())},i(s){n||(S(i),n=!0)},o(s){C(i),n=!1},d(s){i&&i.d(s),s&&U(t)}}}function Mc(e,t,n){let{$$slots:i={},$$scope:s}=t,{path:o="/*"}=t,{fallback:r=!1}=t,{redirect:a=!1}=t,{firstmatch:l=!1}=t,{breadcrumb:c=null}=t,u=!1,f={},d={};const h=wc({fallback:r,onShow(){n(0,u=!0)},onHide(){n(0,u=!1)},onMeta(g){n(2,d=g),n(1,f=d.params)}});return e.$$set=g=>{"path"in g&&n(3,o=g.path),"fallback"in g&&n(4,r=g.fallback),"redirect"in g&&n(5,a=g.redirect),"firstmatch"in g&&n(6,l=g.firstmatch),"breadcrumb"in g&&n(7,c=g.breadcrumb),"$$scope"in g&&n(8,s=g.$$scope)},e.$$.update=()=>{e.$$.dirty&232&&h.update({path:o,redirect:a,firstmatch:l,breadcrumb:c})},[u,f,d,o,r,a,l,c,s,i]}class co extends X{constructor(t){super(),Q(this,t,Mc,Cc,Y,{path:3,fallback:4,redirect:5,firstmatch:6,breadcrumb:7})}}async function ba(e,t={}){const n={method:"post",headers:{"Content-Type":"application/json; charset=UTF-8"},body:JSON.stringify(t)},i=window.GetParentResourceName?window.GetParentResourceName():"nui-frame-app";return await(await fetch(`https://${i}/${e}`,n)).json()}var uo={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};function fo(e,t,n){const i=e.slice();return i[9]=t[n][0],i[10]=t[n][1],i}function Bi(e){let t,n=[e[10]],i={};for(let s=0;s{n(6,t=N(N({},t),nt(d))),n(5,s=io(t,i)),"name"in d&&n(0,a=d.name),"color"in d&&n(1,l=d.color),"size"in d&&n(2,c=d.size),"stroke"in d&&n(3,u=d.stroke),"iconNode"in d&&n(4,f=d.iconNode),"$$scope"in d&&n(7,r=d.$$scope)},t=nt(t),[a,l,c,u,f,s,t,r,o]}class $c extends X{constructor(t){super(),Q(this,t,Rc,kc,Y,{name:0,color:1,size:2,stroke:3,iconNode:4})}}const ce=$c;function Ac(e){let t;const n=e[2].default,i=At(n,e,e[3],null);return{c(){i&&i.c()},m(s,o){i&&i.m(s,o),t=!0},p(s,o){i&&i.p&&(!t||o&8)&&Ft(i,n,s,s[3],t?Pt(n,s[3],o,null):Dt(s[3]),null)},i(s){t||(S(i,s),t=!0)},o(s){C(i,s),t=!1},d(s){i&&i.d(s)}}}function Pc(e){let t,n;const i=[{name:"chevron-left"},e[1],{iconNode:e[0]}];let s={$$slots:{default:[Ac]},$$scope:{ctx:e}};for(let o=0;o{n(1,t=N(N({},t),nt(r))),"$$scope"in r&&n(3,s=r.$$scope)},t=nt(t),[o,t,i,s]}class Dc extends X{constructor(t){super(),Q(this,t,Fc,Pc,Y,{})}}const ya=Dc;function Oc(e){let t;const n=e[2].default,i=At(n,e,e[3],null);return{c(){i&&i.c()},m(s,o){i&&i.m(s,o),t=!0},p(s,o){i&&i.p&&(!t||o&8)&&Ft(i,n,s,s[3],t?Pt(n,s[3],o,null):Dt(s[3]),null)},i(s){t||(S(i,s),t=!0)},o(s){C(i,s),t=!1},d(s){i&&i.d(s)}}}function Ec(e){let t,n;const i=[{name:"chevron-right"},e[1],{iconNode:e[0]}];let s={$$slots:{default:[Oc]},$$scope:{ctx:e}};for(let o=0;o{n(1,t=N(N({},t),nt(r))),"$$scope"in r&&n(3,s=r.$$scope)},t=nt(t),[o,t,i,s]}class Tc extends X{constructor(t){super(),Q(this,t,Lc,Ec,Y,{})}}const Ic=Tc;function Vc(e){let t;const n=e[2].default,i=At(n,e,e[3],null);return{c(){i&&i.c()},m(s,o){i&&i.m(s,o),t=!0},p(s,o){i&&i.p&&(!t||o&8)&&Ft(i,n,s,s[3],t?Pt(n,s[3],o,null):Dt(s[3]),null)},i(s){t||(S(i,s),t=!0)},o(s){C(i,s),t=!1},d(s){i&&i.d(s)}}}function zc(e){let t,n;const i=[{name:"chevrons-left"},e[1],{iconNode:e[0]}];let s={$$slots:{default:[Vc]},$$scope:{ctx:e}};for(let o=0;o{n(1,t=N(N({},t),nt(r))),"$$scope"in r&&n(3,s=r.$$scope)},t=nt(t),[o,t,i,s]}class Nc extends X{constructor(t){super(),Q(this,t,Hc,zc,Y,{})}}const Bc=Nc;function jc(e){let t;const n=e[2].default,i=At(n,e,e[3],null);return{c(){i&&i.c()},m(s,o){i&&i.m(s,o),t=!0},p(s,o){i&&i.p&&(!t||o&8)&&Ft(i,n,s,s[3],t?Pt(n,s[3],o,null):Dt(s[3]),null)},i(s){t||(S(i,s),t=!0)},o(s){C(i,s),t=!1},d(s){i&&i.d(s)}}}function Wc(e){let t,n;const i=[{name:"chevrons-right"},e[1],{iconNode:e[0]}];let s={$$slots:{default:[jc]},$$scope:{ctx:e}};for(let o=0;o{n(1,t=N(N({},t),nt(r))),"$$scope"in r&&n(3,s=r.$$scope)},t=nt(t),[o,t,i,s]}class qc extends X{constructor(t){super(),Q(this,t,Gc,Wc,Y,{})}}const Yc=qc,ji=Ot(!1),fs=Ot("");let go;const Uc=Is(fs,(e,t)=>(go=setTimeout(()=>t(e),500),()=>clearTimeout(go))),ds=Ot([]),Xc=Is([ds,Uc],([e,t],n)=>{if(t===""||!t)return n(e);const i=t.toLowerCase();return n(e.filter(s=>s.toLowerCase().includes(i)))}),hs=Ot({queries:0,timeQuerying:0,slowQueries:0}),gs=Ot({labels:[],data:[]}),Qn=Ot([]),ps=Ot({resourceQueriesCount:0,resourceSlowQueries:0,resourceTime:0}),Bt=Ot({search:"",page:0});function Kc(e){let t,n,i,s,o,r,a,l,c,u,f,d=e[1].page+1+"",h,g,p,m,_,b,y,x,v,R,k,$,P,F;return i=new Bc({}),a=new ya({}),b=new Ic({}),R=new Yc({}),{c(){t=A("div"),n=A("button"),V(i.$$.fragment),o=q(),r=A("button"),V(a.$$.fragment),c=q(),u=A("p"),f=J("Page "),h=J(d),g=J(" of "),p=J(e[0]),m=q(),_=A("button"),V(b.$$.fragment),x=q(),v=A("button"),V(R.$$.fragment),n.disabled=s=e[1].page===0,D(n,"class","bg-dark-600 disabled:bg-dark-300 disabled:text-dark-400 text-dark-100 hover:bg-dark-500 rounded-md border-[1px] border-transparent p-2 outline-none hover:text-white focus-visible:border-cyan-600 focus-visible:text-white active:translate-y-[3px] disabled:cursor-not-allowed"),r.disabled=l=e[1].page===0,D(r,"class","bg-dark-600 disabled:bg-dark-300 disabled:text-dark-400 text-dark-100 hover:bg-dark-500 rounded-md border-[1px] border-transparent p-2 outline-none hover:text-white focus-visible:border-cyan-600 focus-visible:text-white active:translate-y-[3px] disabled:cursor-not-allowed"),_.disabled=y=e[1].page>=e[0]-1,D(_,"class","bg-dark-600 disabled:bg-dark-300 disabled:text-dark-400 text-dark-100 hover:bg-dark-500 rounded-md border-[1px] border-transparent p-2 outline-none hover:text-white focus-visible:border-cyan-600 focus-visible:text-white active:translate-y-[3px] disabled:cursor-not-allowed"),v.disabled=k=e[1].page===e[0]-1,D(v,"class","bg-dark-600 disabled:bg-dark-300 disabled:text-dark-400 text-dark-100 hover:bg-dark-500 rounded-md border-[1px] border-transparent p-2 outline-none hover:text-white focus-visible:border-cyan-600 focus-visible:text-white active:translate-y-[3px] disabled:cursor-not-allowed"),D(t,"class","flex items-center justify-center gap-6 pb-5")},m(M,O){it(M,t,O),w(t,n),E(i,n,null),w(t,o),w(t,r),E(a,r,null),w(t,c),w(t,u),w(u,f),w(u,h),w(u,g),w(u,p),w(t,m),w(t,_),E(b,_,null),w(t,x),w(t,v),E(R,v,null),$=!0,P||(F=[It(n,"click",e[2]),It(r,"click",e[3]),It(_,"click",e[4]),It(v,"click",e[5])],P=!0)},p(M,[O]){(!$||O&2&&s!==(s=M[1].page===0))&&(n.disabled=s),(!$||O&2&&l!==(l=M[1].page===0))&&(r.disabled=l),(!$||O&2)&&d!==(d=M[1].page+1+"")&&Wt(h,d),(!$||O&1)&&Wt(p,M[0]),(!$||O&3&&y!==(y=M[1].page>=M[0]-1))&&(_.disabled=y),(!$||O&3&&k!==(k=M[1].page===M[0]-1))&&(v.disabled=k)},i(M){$||(S(i.$$.fragment,M),S(a.$$.fragment,M),S(b.$$.fragment,M),S(R.$$.fragment,M),$=!0)},o(M){C(i.$$.fragment,M),C(a.$$.fragment,M),C(b.$$.fragment,M),C(R.$$.fragment,M),$=!1},d(M){M&&U(t),L(i),L(a),L(b),L(R),P=!1,te(F)}}}function Qc(e,t,n){let i;gt(e,Bt,c=>n(1,i=c));let{maxPage:s}=t;en(()=>n(0,s=0));const o=()=>bt(Bt,i.page=0,i),r=()=>bt(Bt,i.page--,i),a=()=>bt(Bt,i.page++,i),l=()=>bt(Bt,i.page=s-1,i);return e.$$set=c=>{"maxPage"in c&&n(0,s=c.maxPage)},[s,i,o,r,a,l]}let Zc=class extends X{constructor(t){super(),Q(this,t,Qc,Kc,Y,{maxPage:0})}};function Jc(e){let t;const n=e[2].default,i=At(n,e,e[3],null);return{c(){i&&i.c()},m(s,o){i&&i.m(s,o),t=!0},p(s,o){i&&i.p&&(!t||o&8)&&Ft(i,n,s,s[3],t?Pt(n,s[3],o,null):Dt(s[3]),null)},i(s){t||(S(i,s),t=!0)},o(s){C(i,s),t=!1},d(s){i&&i.d(s)}}}function tu(e){let t,n;const i=[{name:"chevron-down"},e[1],{iconNode:e[0]}];let s={$$slots:{default:[Jc]},$$scope:{ctx:e}};for(let o=0;o{n(1,t=N(N({},t),nt(r))),"$$scope"in r&&n(3,s=r.$$scope)},t=nt(t),[o,t,i,s]}class nu extends X{constructor(t){super(),Q(this,t,eu,tu,Y,{})}}const iu=nu;function su(e){let t;const n=e[2].default,i=At(n,e,e[3],null);return{c(){i&&i.c()},m(s,o){i&&i.m(s,o),t=!0},p(s,o){i&&i.p&&(!t||o&8)&&Ft(i,n,s,s[3],t?Pt(n,s[3],o,null):Dt(s[3]),null)},i(s){t||(S(i,s),t=!0)},o(s){C(i,s),t=!1},d(s){i&&i.d(s)}}}function ou(e){let t,n;const i=[{name:"chevron-up"},e[1],{iconNode:e[0]}];let s={$$slots:{default:[su]},$$scope:{ctx:e}};for(let o=0;o{n(1,t=N(N({},t),nt(r))),"$$scope"in r&&n(3,s=r.$$scope)},t=nt(t),[o,t,i,s]}class au extends X{constructor(t){super(),Q(this,t,ru,ou,Y,{})}}const lu=au;/** - * table-core - * - * Copyright (c) TanStack - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function he(e,t){return typeof e=="function"?e(t):e}function Vt(e,t){return n=>{t.setState(i=>({...i,[e]:he(n,i[e])}))}}function ui(e){return e instanceof Function}function cu(e,t){const n=[],i=s=>{s.forEach(o=>{n.push(o);const r=t(o);r!=null&&r.length&&i(r)})};return i(e),n}function I(e,t,n){let i=[],s;return()=>{let o;n.key&&n.debug&&(o=Date.now());const r=e();if(!(r.length!==i.length||r.some((c,u)=>i[u]!==c)))return s;i=r;let l;if(n.key&&n.debug&&(l=Date.now()),s=t(...r),n==null||n.onChange==null||n.onChange(s),n.key&&n.debug&&n!=null&&n.debug()){const c=Math.round((Date.now()-o)*100)/100,u=Math.round((Date.now()-l)*100)/100,f=u/16,d=(h,g)=>{for(h=String(h);h.length{let h=d;for(const p of l.split(".")){var g;h=(g=h)==null?void 0:g[p]}return h}:u=d=>d[a.accessorKey]),!c)throw new Error;let f={id:`${String(c)}`,accessorFn:u,parent:i,depth:n,columnDef:a,columns:[],getFlatColumns:I(()=>[!0],()=>{var d;return[f,...(d=f.columns)==null?void 0:d.flatMap(h=>h.getFlatColumns())]},{key:"column.getFlatColumns",debug:()=>{var d;return(d=e.options.debugAll)!=null?d:e.options.debugColumns}}),getLeafColumns:I(()=>[e._getOrderColumnsFn()],d=>{var h;if((h=f.columns)!=null&&h.length){let g=f.columns.flatMap(p=>p.getLeafColumns());return d(g)}return[f]},{key:"column.getLeafColumns",debug:()=>{var d;return(d=e.options.debugAll)!=null?d:e.options.debugColumns}})};return f=e._features.reduce((d,h)=>Object.assign(d,h.createColumn==null?void 0:h.createColumn(f,e)),f),f}function po(e,t,n){var i;let o={id:(i=n.id)!=null?i:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const r=[],a=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(a),r.push(l)};return a(o),r},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach(r=>{Object.assign(o,r.createHeader==null?void 0:r.createHeader(o,e))}),o}const fu={createTable:e=>({getHeaderGroups:I(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,i,s)=>{var o,r;const a=(o=i==null?void 0:i.map(f=>n.find(d=>d.id===f)).filter(Boolean))!=null?o:[],l=(r=s==null?void 0:s.map(f=>n.find(d=>d.id===f)).filter(Boolean))!=null?r:[],c=n.filter(f=>!(i!=null&&i.includes(f.id))&&!(s!=null&&s.includes(f.id)));return Dn(t,[...a,...c,...l],e)},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getCenterHeaderGroups:I(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,i,s)=>(n=n.filter(o=>!(i!=null&&i.includes(o.id))&&!(s!=null&&s.includes(o.id))),Dn(t,n,e,"center")),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getLeftHeaderGroups:I(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,i)=>{var s;const o=(s=i==null?void 0:i.map(r=>n.find(a=>a.id===r)).filter(Boolean))!=null?s:[];return Dn(t,o,e,"left")},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getRightHeaderGroups:I(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,i)=>{var s;const o=(s=i==null?void 0:i.map(r=>n.find(a=>a.id===r)).filter(Boolean))!=null?s:[];return Dn(t,o,e,"right")},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getFooterGroups:I(()=>[e.getHeaderGroups()],t=>[...t].reverse(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getLeftFooterGroups:I(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getCenterFooterGroups:I(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getRightFooterGroups:I(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getFlatHeaders:I(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getLeftFlatHeaders:I(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getCenterFlatHeaders:I(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getRightFlatHeaders:I(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getCenterLeafHeaders:I(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var i;return!((i=n.subHeaders)!=null&&i.length)}),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getLeftLeafHeaders:I(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var i;return!((i=n.subHeaders)!=null&&i.length)}),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getRightLeafHeaders:I(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var i;return!((i=n.subHeaders)!=null&&i.length)}),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getLeafHeaders:I(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,i)=>{var s,o,r,a,l,c;return[...(s=(o=t[0])==null?void 0:o.headers)!=null?s:[],...(r=(a=n[0])==null?void 0:a.headers)!=null?r:[],...(l=(c=i[0])==null?void 0:c.headers)!=null?l:[]].map(u=>u.getLeafHeaders()).flat()},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}})})};function Dn(e,t,n,i){var s,o;let r=0;const a=function(d,h){h===void 0&&(h=1),r=Math.max(r,h),d.filter(g=>g.getIsVisible()).forEach(g=>{var p;(p=g.columns)!=null&&p.length&&a(g.columns,h+1)},0)};a(e);let l=[];const c=(d,h)=>{const g={depth:h,id:[i,`${h}`].filter(Boolean).join("_"),headers:[]},p=[];d.forEach(m=>{const _=[...p].reverse()[0],b=m.column.depth===g.depth;let y,x=!1;if(b&&m.column.parent?y=m.column.parent:(y=m.column,x=!0),_&&(_==null?void 0:_.column)===y)_.subHeaders.push(m);else{const v=po(n,y,{id:[i,h,y.id,m==null?void 0:m.id].filter(Boolean).join("_"),isPlaceholder:x,placeholderId:x?`${p.filter(R=>R.column===y).length}`:void 0,depth:h,index:p.length});v.subHeaders.push(m),p.push(v)}g.headers.push(m),m.headerGroup=g}),l.push(g),h>0&&c(p,h-1)},u=t.map((d,h)=>po(n,d,{depth:r,index:h}));c(u,r-1),l.reverse();const f=d=>d.filter(g=>g.column.getIsVisible()).map(g=>{let p=0,m=0,_=[0];g.subHeaders&&g.subHeaders.length?(_=[],f(g.subHeaders).forEach(y=>{let{colSpan:x,rowSpan:v}=y;p+=x,_.push(v)})):p=1;const b=Math.min(..._);return m=m+b,g.colSpan=p,g.rowSpan=m,{colSpan:p,rowSpan:m}});return f((s=(o=l[0])==null?void 0:o.headers)!=null?s:[]),l}const On={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Wi=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),du={getDefaultColumnDef:()=>On,getInitialState:e=>({columnSizing:{},columnSizingInfo:Wi(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",onColumnSizingChange:Vt("columnSizing",e),onColumnSizingInfoChange:Vt("columnSizingInfo",e)}),createColumn:(e,t)=>({getSize:()=>{var n,i,s;const o=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:On.minSize,(i=o??e.columnDef.size)!=null?i:On.size),(s=e.columnDef.maxSize)!=null?s:On.maxSize)},getStart:n=>{const i=n?n==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns(),s=i.findIndex(o=>o.id===e.id);if(s>0){const o=i[s-1];return o.getStart(n)+o.getSize()}return 0},resetSize:()=>{t.setColumnSizing(n=>{let{[e.id]:i,...s}=n;return s})},getCanResize:()=>{var n,i;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((i=t.options.enableColumnResizing)!=null?i:!0)},getIsResizing:()=>t.getState().columnSizingInfo.isResizingColumn===e.id}),createHeader:(e,t)=>({getSize:()=>{let n=0;const i=s=>{if(s.subHeaders.length)s.subHeaders.forEach(i);else{var o;n+=(o=s.column.getSize())!=null?o:0}};return i(e),n},getStart:()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},getResizeHandler:()=>{const n=t.getColumn(e.column.id),i=n==null?void 0:n.getCanResize();return s=>{if(!n||!i||(s.persist==null||s.persist(),Gi(s)&&s.touches&&s.touches.length>1))return;const o=e.getSize(),r=e?e.getLeafHeaders().map(p=>[p.column.id,p.column.getSize()]):[[n.id,n.getSize()]],a=Gi(s)?Math.round(s.touches[0].clientX):s.clientX,l={},c=(p,m)=>{typeof m=="number"&&(t.setColumnSizingInfo(_=>{var b,y;const x=m-((b=_==null?void 0:_.startOffset)!=null?b:0),v=Math.max(x/((y=_==null?void 0:_.startSize)!=null?y:0),-.999999);return _.columnSizingStart.forEach(R=>{let[k,$]=R;l[k]=Math.round(Math.max($+$*v,0)*100)/100}),{..._,deltaOffset:x,deltaPercentage:v}}),(t.options.columnResizeMode==="onChange"||p==="end")&&t.setColumnSizing(_=>({..._,...l})))},u=p=>c("move",p),f=p=>{c("end",p),t.setColumnSizingInfo(m=>({...m,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},d={moveHandler:p=>u(p.clientX),upHandler:p=>{document.removeEventListener("mousemove",d.moveHandler),document.removeEventListener("mouseup",d.upHandler),f(p.clientX)}},h={moveHandler:p=>(p.cancelable&&(p.preventDefault(),p.stopPropagation()),u(p.touches[0].clientX),!1),upHandler:p=>{var m;document.removeEventListener("touchmove",h.moveHandler),document.removeEventListener("touchend",h.upHandler),p.cancelable&&(p.preventDefault(),p.stopPropagation()),f((m=p.touches[0])==null?void 0:m.clientX)}},g=hu()?{passive:!1}:!1;Gi(s)?(document.addEventListener("touchmove",h.moveHandler,g),document.addEventListener("touchend",h.upHandler,g)):(document.addEventListener("mousemove",d.moveHandler,g),document.addEventListener("mouseup",d.upHandler,g)),t.setColumnSizingInfo(p=>({...p,startOffset:a,startSize:o,deltaOffset:0,deltaPercentage:0,columnSizingStart:r,isResizingColumn:n.id}))}}}),createTable:e=>({setColumnSizing:t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),setColumnSizingInfo:t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),resetColumnSizing:t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},resetHeaderSizeInfo:t=>{var n;e.setColumnSizingInfo(t?Wi():(n=e.initialState.columnSizingInfo)!=null?n:Wi())},getTotalSize:()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((i,s)=>i+s.getSize(),0))!=null?t:0},getLeftTotalSize:()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((i,s)=>i+s.getSize(),0))!=null?t:0},getCenterTotalSize:()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((i,s)=>i+s.getSize(),0))!=null?t:0},getRightTotalSize:()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((i,s)=>i+s.getSize(),0))!=null?t:0}})};let En=null;function hu(){if(typeof En=="boolean")return En;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return En=e,En}function Gi(e){return e.type==="touchstart"}const gu={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Vt("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;return{_autoResetExpanded:()=>{var i,s;if(!t){e._queue(()=>{t=!0});return}if((i=(s=e.options.autoResetAll)!=null?s:e.options.autoResetExpanded)!=null?i:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},setExpanded:i=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(i),toggleAllRowsExpanded:i=>{i??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},resetExpanded:i=>{var s,o;e.setExpanded(i?{}:(s=(o=e.initialState)==null?void 0:o.expanded)!=null?s:{})},getCanSomeRowsExpand:()=>e.getRowModel().flatRows.some(i=>i.getCanExpand()),getToggleAllRowsExpandedHandler:()=>i=>{i.persist==null||i.persist(),e.toggleAllRowsExpanded()},getIsSomeRowsExpanded:()=>{const i=e.getState().expanded;return i===!0||Object.values(i).some(Boolean)},getIsAllRowsExpanded:()=>{const i=e.getState().expanded;return typeof i=="boolean"?i===!0:!(!Object.keys(i).length||e.getRowModel().flatRows.some(s=>!s.getIsExpanded()))},getExpandedDepth:()=>{let i=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(o=>{const r=o.split(".");i=Math.max(i,r.length)}),i},getPreExpandedRowModel:()=>e.getSortedRowModel(),getExpandedRowModel:()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())}},createRow:(e,t)=>({toggleExpanded:n=>{t.setExpanded(i=>{var s;const o=i===!0?!0:!!(i!=null&&i[e.id]);let r={};if(i===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{r[a]=!0}):r=i,n=(s=n)!=null?s:!o,!o&&n)return{...r,[e.id]:!0};if(o&&!n){const{[e.id]:a,...l}=r;return l}return i})},getIsExpanded:()=>{var n;const i=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:i===!0||i!=null&&i[e.id])},getCanExpand:()=>{var n,i,s;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((i=t.options.enableExpanding)!=null?i:!0)&&!!((s=e.subRows)!=null&&s.length)},getToggleExpandedHandler:()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}})},va=(e,t,n)=>{var i;const s=n.toLowerCase();return!!((i=e.getValue(t))!=null&&i.toLowerCase().includes(s))};va.autoRemove=e=>Gt(e);const xa=(e,t,n)=>{var i;return!!((i=e.getValue(t))!=null&&i.includes(n))};xa.autoRemove=e=>Gt(e);const wa=(e,t,n)=>{var i;return((i=e.getValue(t))==null?void 0:i.toLowerCase())===n.toLowerCase()};wa.autoRemove=e=>Gt(e);const Sa=(e,t,n)=>{var i;return(i=e.getValue(t))==null?void 0:i.includes(n)};Sa.autoRemove=e=>Gt(e)||!(e!=null&&e.length);const Ca=(e,t,n)=>!n.some(i=>{var s;return!((s=e.getValue(t))!=null&&s.includes(i))});Ca.autoRemove=e=>Gt(e)||!(e!=null&&e.length);const Ma=(e,t,n)=>n.some(i=>{var s;return(s=e.getValue(t))==null?void 0:s.includes(i)});Ma.autoRemove=e=>Gt(e)||!(e!=null&&e.length);const ka=(e,t,n)=>e.getValue(t)===n;ka.autoRemove=e=>Gt(e);const Ra=(e,t,n)=>e.getValue(t)==n;Ra.autoRemove=e=>Gt(e);const Hs=(e,t,n)=>{let[i,s]=n;const o=e.getValue(t);return o>=i&&o<=s};Hs.resolveFilterValue=e=>{let[t,n]=e,i=typeof t!="number"?parseFloat(t):t,s=typeof n!="number"?parseFloat(n):n,o=t===null||Number.isNaN(i)?-1/0:i,r=n===null||Number.isNaN(s)?1/0:s;if(o>r){const a=o;o=r,r=a}return[o,r]};Hs.autoRemove=e=>Gt(e)||Gt(e[0])&&Gt(e[1]);const ne={includesString:va,includesStringSensitive:xa,equalsString:wa,arrIncludes:Sa,arrIncludesAll:Ca,arrIncludesSome:Ma,equals:ka,weakEquals:Ra,inNumberRange:Hs};function Gt(e){return e==null||e===""}const pu={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:Vt("columnFilters",e),onGlobalFilterChange:Vt("globalFilter",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100,globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n,i;const s=(n=e.getCoreRowModel().flatRows[0])==null||(i=n._getAllCellsByColumnId()[t.id])==null?void 0:i.getValue();return typeof s=="string"||typeof s=="number"}}),createColumn:(e,t)=>({getAutoFilterFn:()=>{const n=t.getCoreRowModel().flatRows[0],i=n==null?void 0:n.getValue(e.id);return typeof i=="string"?ne.includesString:typeof i=="number"?ne.inNumberRange:typeof i=="boolean"||i!==null&&typeof i=="object"?ne.equals:Array.isArray(i)?ne.arrIncludes:ne.weakEquals},getFilterFn:()=>{var n,i;return ui(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(i=t.options.filterFns)==null?void 0:i[e.columnDef.filterFn])!=null?n:ne[e.columnDef.filterFn]},getCanFilter:()=>{var n,i,s;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((i=t.options.enableColumnFilters)!=null?i:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&!!e.accessorFn},getCanGlobalFilter:()=>{var n,i,s,o;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((i=t.options.enableGlobalFilter)!=null?i:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&((o=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?o:!0)&&!!e.accessorFn},getIsFiltered:()=>e.getFilterIndex()>-1,getFilterValue:()=>{var n,i;return(n=t.getState().columnFilters)==null||(i=n.find(s=>s.id===e.id))==null?void 0:i.value},getFilterIndex:()=>{var n,i;return(n=(i=t.getState().columnFilters)==null?void 0:i.findIndex(s=>s.id===e.id))!=null?n:-1},setFilterValue:n=>{t.setColumnFilters(i=>{const s=e.getFilterFn(),o=i==null?void 0:i.find(u=>u.id===e.id),r=he(n,o?o.value:void 0);if(mo(s,r,e)){var a;return(a=i==null?void 0:i.filter(u=>u.id!==e.id))!=null?a:[]}const l={id:e.id,value:r};if(o){var c;return(c=i==null?void 0:i.map(u=>u.id===e.id?l:u))!=null?c:[]}return i!=null&&i.length?[...i,l]:[l]})},_getFacetedRowModel:t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),getFacetedRowModel:()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),_getFacetedUniqueValues:t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),getFacetedUniqueValues:()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,_getFacetedMinMaxValues:t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),getFacetedMinMaxValues:()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}),createRow:(e,t)=>({columnFilters:{},columnFiltersMeta:{}}),createTable:e=>({getGlobalAutoFilterFn:()=>ne.includesString,getGlobalFilterFn:()=>{var t,n;const{globalFilterFn:i}=e.options;return ui(i)?i:i==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[i])!=null?t:ne[i]},setColumnFilters:t=>{const n=e.getAllLeafColumns(),i=s=>{var o;return(o=he(t,s))==null?void 0:o.filter(r=>{const a=n.find(l=>l.id===r.id);if(a){const l=a.getFilterFn();if(mo(l,r.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(i)},setGlobalFilter:t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},resetGlobalFilter:t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)},resetColumnFilters:t=>{var n,i;e.setColumnFilters(t?[]:(n=(i=e.initialState)==null?void 0:i.columnFilters)!=null?n:[])},getPreFilteredRowModel:()=>e.getCoreRowModel(),getFilteredRowModel:()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel()),_getGlobalFacetedRowModel:e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),getGlobalFacetedRowModel:()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),_getGlobalFacetedUniqueValues:e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),getGlobalFacetedUniqueValues:()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,_getGlobalFacetedMinMaxValues:e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),getGlobalFacetedMinMaxValues:()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}})};function mo(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const mu=(e,t,n)=>n.reduce((i,s)=>{const o=s.getValue(e);return i+(typeof o=="number"?o:0)},0),_u=(e,t,n)=>{let i;return n.forEach(s=>{const o=s.getValue(e);o!=null&&(i>o||i===void 0&&o>=o)&&(i=o)}),i},bu=(e,t,n)=>{let i;return n.forEach(s=>{const o=s.getValue(e);o!=null&&(i=o)&&(i=o)}),i},yu=(e,t,n)=>{let i,s;return n.forEach(o=>{const r=o.getValue(e);r!=null&&(i===void 0?r>=r&&(i=s=r):(i>r&&(i=r),s{let n=0,i=0;if(t.forEach(s=>{let o=s.getValue(e);o!=null&&(o=+o)>=o&&(++n,i+=o)}),n)return i/n},xu=(e,t)=>{if(!t.length)return;let n=0,i=0;return t.forEach(s=>{let o=s.getValue(e);typeof o=="number"&&(n=Math.min(n,o),i=Math.max(i,o))}),(n+i)/2},wu=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),Su=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,Cu=(e,t)=>t.length,qi={sum:mu,min:_u,max:bu,extent:yu,mean:vu,median:xu,unique:wu,uniqueCount:Su,count:Cu},Mu={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Vt("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>({toggleGrouping:()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(i=>i!==e.id):[...n??[],e.id])},getCanGroup:()=>{var n,i,s,o;return(n=(i=(s=(o=e.columnDef.enableGrouping)!=null?o:!0)!=null?s:t.options.enableGrouping)!=null?i:!0)!=null?n:!!e.accessorFn},getIsGrouped:()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},getGroupedIndex:()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},getToggleGroupingHandler:()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},getAutoAggregationFn:()=>{const n=t.getCoreRowModel().flatRows[0],i=n==null?void 0:n.getValue(e.id);if(typeof i=="number")return qi.sum;if(Object.prototype.toString.call(i)==="[object Date]")return qi.extent},getAggregationFn:()=>{var n,i;if(!e)throw new Error;return ui(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(i=t.options.aggregationFns)==null?void 0:i[e.columnDef.aggregationFn])!=null?n:qi[e.columnDef.aggregationFn]}}),createTable:e=>({setGrouping:t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),resetGrouping:t=>{var n,i;e.setGrouping(t?[]:(n=(i=e.initialState)==null?void 0:i.grouping)!=null?n:[])},getPreGroupedRowModel:()=>e.getFilteredRowModel(),getGroupedRowModel:()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())}),createRow:e=>({getIsGrouped:()=>!!e.groupingColumnId,_groupingValuesCache:{}}),createCell:(e,t,n,i)=>({getIsGrouped:()=>t.getIsGrouped()&&t.id===n.groupingColumnId,getIsPlaceholder:()=>!e.getIsGrouped()&&t.getIsGrouped(),getIsAggregated:()=>{var s;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((s=n.subRows)!=null&&s.length)}})};function ku(e,t,n){if(!(t!=null&&t.length)||!n)return e;const i=e.filter(o=>!t.includes(o.id));return n==="remove"?i:[...t.map(o=>e.find(r=>r.id===o)).filter(Boolean),...i]}const Ru={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Vt("columnOrder",e)}),createTable:e=>({setColumnOrder:t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),resetColumnOrder:t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},_getOrderColumnsFn:I(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,i)=>s=>{let o=[];if(!(t!=null&&t.length))o=s;else{const r=[...t],a=[...s];for(;a.length&&r.length;){const l=r.shift(),c=a.findIndex(u=>u.id===l);c>-1&&o.push(a.splice(c,1)[0])}o=[...o,...a]}return ku(o,n,i)},{key:!1})})},ms=0,_s=10,Yi=()=>({pageIndex:ms,pageSize:_s}),$u={getInitialState:e=>({...e,pagination:{...Yi(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Vt("pagination",e)}),createTable:e=>{let t=!1,n=!1;return{_autoResetPageIndex:()=>{var i,s;if(!t){e._queue(()=>{t=!0});return}if((i=(s=e.options.autoResetAll)!=null?s:e.options.autoResetPageIndex)!=null?i:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},setPagination:i=>{const s=o=>he(i,o);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(s)},resetPagination:i=>{var s;e.setPagination(i?Yi():(s=e.initialState.pagination)!=null?s:Yi())},setPageIndex:i=>{e.setPagination(s=>{let o=he(i,s.pageIndex);const r=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,r)),{...s,pageIndex:o}})},resetPageIndex:i=>{var s,o,r;e.setPageIndex(i?ms:(s=(o=e.initialState)==null||(r=o.pagination)==null?void 0:r.pageIndex)!=null?s:ms)},resetPageSize:i=>{var s,o,r;e.setPageSize(i?_s:(s=(o=e.initialState)==null||(r=o.pagination)==null?void 0:r.pageSize)!=null?s:_s)},setPageSize:i=>{e.setPagination(s=>{const o=Math.max(1,he(i,s.pageSize)),r=s.pageSize*s.pageIndex,a=Math.floor(r/o);return{...s,pageIndex:a,pageSize:o}})},setPageCount:i=>e.setPagination(s=>{var o;let r=he(i,(o=e.options.pageCount)!=null?o:-1);return typeof r=="number"&&(r=Math.max(-1,r)),{...s,pageCount:r}}),getPageOptions:I(()=>[e.getPageCount()],i=>{let s=[];return i&&i>0&&(s=[...new Array(i)].fill(null).map((o,r)=>r)),s},{key:!1,debug:()=>{var i;return(i=e.options.debugAll)!=null?i:e.options.debugTable}}),getCanPreviousPage:()=>e.getState().pagination.pageIndex>0,getCanNextPage:()=>{const{pageIndex:i}=e.getState().pagination,s=e.getPageCount();return s===-1?!0:s===0?!1:ie.setPageIndex(i=>i-1),nextPage:()=>e.setPageIndex(i=>i+1),getPrePaginationRowModel:()=>e.getExpandedRowModel(),getPaginationRowModel:()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),getPageCount:()=>{var i;return(i=e.options.pageCount)!=null?i:Math.ceil(e.getPrePaginationRowModel().rows.length/e.getState().pagination.pageSize)}}}},Ui=()=>({left:[],right:[]}),Au={getInitialState:e=>({columnPinning:Ui(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Vt("columnPinning",e)}),createColumn:(e,t)=>({pin:n=>{const i=e.getLeafColumns().map(s=>s.id).filter(Boolean);t.setColumnPinning(s=>{var o,r;if(n==="right"){var a,l;return{left:((a=s==null?void 0:s.left)!=null?a:[]).filter(f=>!(i!=null&&i.includes(f))),right:[...((l=s==null?void 0:s.right)!=null?l:[]).filter(f=>!(i!=null&&i.includes(f))),...i]}}if(n==="left"){var c,u;return{left:[...((c=s==null?void 0:s.left)!=null?c:[]).filter(f=>!(i!=null&&i.includes(f))),...i],right:((u=s==null?void 0:s.right)!=null?u:[]).filter(f=>!(i!=null&&i.includes(f)))}}return{left:((o=s==null?void 0:s.left)!=null?o:[]).filter(f=>!(i!=null&&i.includes(f))),right:((r=s==null?void 0:s.right)!=null?r:[]).filter(f=>!(i!=null&&i.includes(f)))}})},getCanPin:()=>e.getLeafColumns().some(i=>{var s,o;return((s=i.columnDef.enablePinning)!=null?s:!0)&&((o=t.options.enablePinning)!=null?o:!0)}),getIsPinned:()=>{const n=e.getLeafColumns().map(a=>a.id),{left:i,right:s}=t.getState().columnPinning,o=n.some(a=>i==null?void 0:i.includes(a)),r=n.some(a=>s==null?void 0:s.includes(a));return o?"left":r?"right":!1},getPinnedIndex:()=>{var n,i,s;const o=e.getIsPinned();return o?(n=(i=t.getState().columnPinning)==null||(s=i[o])==null?void 0:s.indexOf(e.id))!=null?n:-1:0}}),createRow:(e,t)=>({getCenterVisibleCells:I(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,i,s)=>{const o=[...i??[],...s??[]];return n.filter(r=>!o.includes(r.column.id))},{key:"row.getCenterVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),getLeftVisibleCells:I(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,,],(n,i)=>(i??[]).map(o=>n.find(r=>r.column.id===o)).filter(Boolean).map(o=>({...o,position:"left"})),{key:"row.getLeftVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),getRightVisibleCells:I(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,i)=>(i??[]).map(o=>n.find(r=>r.column.id===o)).filter(Boolean).map(o=>({...o,position:"right"})),{key:"row.getRightVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}})}),createTable:e=>({setColumnPinning:t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),resetColumnPinning:t=>{var n,i;return e.setColumnPinning(t?Ui():(n=(i=e.initialState)==null?void 0:i.columnPinning)!=null?n:Ui())},getIsSomeColumnsPinned:t=>{var n;const i=e.getState().columnPinning;if(!t){var s,o;return!!((s=i.left)!=null&&s.length||(o=i.right)!=null&&o.length)}return!!((n=i[t])!=null&&n.length)},getLeftLeafColumns:I(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(i=>t.find(s=>s.id===i)).filter(Boolean),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}}),getRightLeafColumns:I(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(i=>t.find(s=>s.id===i)).filter(Boolean),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}}),getCenterLeafColumns:I(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,i)=>{const s=[...n??[],...i??[]];return t.filter(o=>!s.includes(o.id))},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}})})},Pu={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Vt("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>({setRowSelection:t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),resetRowSelection:t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},toggleAllRowsSelected:t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const i={...n},s=e.getPreGroupedRowModel().flatRows;return t?s.forEach(o=>{o.getCanSelect()&&(i[o.id]=!0)}):s.forEach(o=>{delete i[o.id]}),i})},toggleAllPageRowsSelected:t=>e.setRowSelection(n=>{const i=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),s={...n};return e.getRowModel().rows.forEach(o=>{bs(s,o.id,i,e)}),s}),getPreSelectedRowModel:()=>e.getCoreRowModel(),getSelectedRowModel:I(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Xi(e,n):{rows:[],flatRows:[],rowsById:{}},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),getFilteredSelectedRowModel:I(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Xi(e,n):{rows:[],flatRows:[],rowsById:{}},{key:"getFilteredSelectedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),getGroupedSelectedRowModel:I(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Xi(e,n):{rows:[],flatRows:[],rowsById:{}},{key:"getGroupedSelectedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),getIsAllRowsSelected:()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let i=!!(t.length&&Object.keys(n).length);return i&&t.some(s=>s.getCanSelect()&&!n[s.id])&&(i=!1),i},getIsAllPageRowsSelected:()=>{const t=e.getPaginationRowModel().flatRows,{rowSelection:n}=e.getState();let i=!!t.length;return i&&t.some(s=>s.getCanSelect()&&!n[s.id])&&(i=!1),i},getIsSomeRowsSelected:()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.some(n=>n.getIsSelected()||n.getIsSomeSelected())},getToggleAllRowsSelectedHandler:()=>t=>{e.toggleAllRowsSelected(t.target.checked)},getToggleAllPageRowsSelectedHandler:()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}}),createRow:(e,t)=>({toggleSelected:n=>{const i=e.getIsSelected();t.setRowSelection(s=>{if(n=typeof n<"u"?n:!i,i===n)return s;const o={...s};return bs(o,e.id,n,t),o})},getIsSelected:()=>{const{rowSelection:n}=t.getState();return Ns(e,n)},getIsSomeSelected:()=>{const{rowSelection:n}=t.getState();return _o(e,n)==="some"},getIsAllSubRowsSelected:()=>{const{rowSelection:n}=t.getState();return _o(e,n)==="all"},getCanSelect:()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},getCanSelectSubRows:()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},getCanMultiSelect:()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},getToggleSelectedHandler:()=>{const n=e.getCanSelect();return i=>{var s;n&&e.toggleSelected((s=i.target)==null?void 0:s.checked)}}})},bs=(e,t,n,i)=>{var s;const o=i.getRow(t);n?(o.getCanMultiSelect()||Object.keys(e).forEach(r=>delete e[r]),o.getCanSelect()&&(e[t]=!0)):delete e[t],(s=o.subRows)!=null&&s.length&&o.getCanSelectSubRows()&&o.subRows.forEach(r=>bs(e,r.id,n,i))};function Xi(e,t){const n=e.getState().rowSelection,i=[],s={},o=function(r,a){return r.map(l=>{var c;const u=Ns(l,n);if(u&&(i.push(l),s[l.id]=l),(c=l.subRows)!=null&&c.length&&(l={...l,subRows:o(l.subRows)}),u)return l}).filter(Boolean)};return{rows:o(t.rows),flatRows:i,rowsById:s}}function Ns(e,t){var n;return(n=t[e.id])!=null?n:!1}function _o(e,t,n){if(e.subRows&&e.subRows.length){let i=!0,s=!1;return e.subRows.forEach(o=>{s&&!i||(Ns(o,t)?s=!0:i=!1)}),i?"all":s?"some":!1}return!1}const ys=/([0-9]+)/gm,Fu=(e,t,n)=>$a(ve(e.getValue(n)).toLowerCase(),ve(t.getValue(n)).toLowerCase()),Du=(e,t,n)=>$a(ve(e.getValue(n)),ve(t.getValue(n))),Ou=(e,t,n)=>Bs(ve(e.getValue(n)).toLowerCase(),ve(t.getValue(n)).toLowerCase()),Eu=(e,t,n)=>Bs(ve(e.getValue(n)),ve(t.getValue(n))),Lu=(e,t,n)=>{const i=e.getValue(n),s=t.getValue(n);return i>s?1:iBs(e.getValue(n),t.getValue(n));function Bs(e,t){return e===t?0:e>t?1:-1}function ve(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function $a(e,t){const n=e.split(ys).filter(Boolean),i=t.split(ys).filter(Boolean);for(;n.length&&i.length;){const s=n.shift(),o=i.shift(),r=parseInt(s,10),a=parseInt(o,10),l=[r,a].sort();if(isNaN(l[0])){if(s>o)return 1;if(o>s)return-1;continue}if(isNaN(l[1]))return isNaN(r)?-1:1;if(r>a)return 1;if(a>r)return-1}return n.length-i.length}const sn={alphanumeric:Fu,alphanumericCaseSensitive:Du,text:Ou,textCaseSensitive:Eu,datetime:Lu,basic:Tu},Iu={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto"}),getDefaultOptions:e=>({onSortingChange:Vt("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>({getAutoSortingFn:()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let i=!1;for(const s of n){const o=s==null?void 0:s.getValue(e.id);if(Object.prototype.toString.call(o)==="[object Date]")return sn.datetime;if(typeof o=="string"&&(i=!0,o.split(ys).length>1))return sn.alphanumeric}return i?sn.text:sn.basic},getAutoSortDir:()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},getSortingFn:()=>{var n,i;if(!e)throw new Error;return ui(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(i=t.options.sortingFns)==null?void 0:i[e.columnDef.sortingFn])!=null?n:sn[e.columnDef.sortingFn]},toggleSorting:(n,i)=>{const s=e.getNextSortingOrder(),o=typeof n<"u"&&n!==null;t.setSorting(r=>{const a=r==null?void 0:r.find(h=>h.id===e.id),l=r==null?void 0:r.findIndex(h=>h.id===e.id);let c=[],u,f=o?n:s==="desc";if(r!=null&&r.length&&e.getCanMultiSort()&&i?a?u="toggle":u="add":r!=null&&r.length&&l!==r.length-1?u="replace":a?u="toggle":u="replace",u==="toggle"&&(o||s||(u="remove")),u==="add"){var d;c=[...r,{id:e.id,desc:f}],c.splice(0,c.length-((d=t.options.maxMultiSortColCount)!=null?d:Number.MAX_SAFE_INTEGER))}else u==="toggle"?c=r.map(h=>h.id===e.id?{...h,desc:f}:h):u==="remove"?c=r.filter(h=>h.id!==e.id):c=[{id:e.id,desc:f}];return c})},getFirstSortDir:()=>{var n,i;return((n=(i=e.columnDef.sortDescFirst)!=null?i:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},getNextSortingOrder:n=>{var i,s;const o=e.getFirstSortDir(),r=e.getIsSorted();return r?r!==o&&((i=t.options.enableSortingRemoval)==null||i)&&(!(n&&(s=t.options.enableMultiRemove)!=null)||s)?!1:r==="desc"?"asc":"desc":o},getCanSort:()=>{var n,i;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((i=t.options.enableSorting)!=null?i:!0)&&!!e.accessorFn},getCanMultiSort:()=>{var n,i;return(n=(i=e.columnDef.enableMultiSort)!=null?i:t.options.enableMultiSort)!=null?n:!!e.accessorFn},getIsSorted:()=>{var n;const i=(n=t.getState().sorting)==null?void 0:n.find(s=>s.id===e.id);return i?i.desc?"desc":"asc":!1},getSortIndex:()=>{var n,i;return(n=(i=t.getState().sorting)==null?void 0:i.findIndex(s=>s.id===e.id))!=null?n:-1},clearSorting:()=>{t.setSorting(n=>n!=null&&n.length?n.filter(i=>i.id!==e.id):[])},getToggleSortingHandler:()=>{const n=e.getCanSort();return i=>{n&&(i.persist==null||i.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(i):!1))}}}),createTable:e=>({setSorting:t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),resetSorting:t=>{var n,i;e.setSorting(t?[]:(n=(i=e.initialState)==null?void 0:i.sorting)!=null?n:[])},getPreSortedRowModel:()=>e.getGroupedRowModel(),getSortedRowModel:()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())})},Vu={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Vt("columnVisibility",e)}),createColumn:(e,t)=>({toggleVisibility:n=>{e.getCanHide()&&t.setColumnVisibility(i=>({...i,[e.id]:n??!e.getIsVisible()}))},getIsVisible:()=>{var n,i;return(n=(i=t.getState().columnVisibility)==null?void 0:i[e.id])!=null?n:!0},getCanHide:()=>{var n,i;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((i=t.options.enableHiding)!=null?i:!0)},getToggleVisibilityHandler:()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}}),createRow:(e,t)=>({_getAllVisibleCells:I(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(i=>i.column.getIsVisible()),{key:"row._getAllVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),getVisibleCells:I(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,i,s)=>[...n,...i,...s],{key:!1,debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}})}),createTable:e=>{const t=(n,i)=>I(()=>[i(),i().filter(s=>s.getIsVisible()).map(s=>s.id).join("_")],s=>s.filter(o=>o.getIsVisible==null?void 0:o.getIsVisible()),{key:n,debug:()=>{var s;return(s=e.options.debugAll)!=null?s:e.options.debugColumns}});return{getVisibleFlatColumns:t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),getVisibleLeafColumns:t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),getLeftVisibleLeafColumns:t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),getRightVisibleLeafColumns:t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),getCenterVisibleLeafColumns:t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),setColumnVisibility:n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),resetColumnVisibility:n=>{var i;e.setColumnVisibility(n?{}:(i=e.initialState.columnVisibility)!=null?i:{})},toggleAllColumnsVisible:n=>{var i;n=(i=n)!=null?i:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((s,o)=>({...s,[o.id]:n||!(o.getCanHide!=null&&o.getCanHide())}),{}))},getIsAllColumnsVisible:()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),getIsSomeColumnsVisible:()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),getToggleAllColumnsVisibilityHandler:()=>n=>{var i;e.toggleAllColumnsVisible((i=n.target)==null?void 0:i.checked)}}}},bo=[fu,Vu,Ru,Au,pu,Iu,Mu,gu,$u,Pu,du];function zu(e){var t;(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");let n={_features:bo};const i=n._features.reduce((u,f)=>Object.assign(u,f.getDefaultOptions==null?void 0:f.getDefaultOptions(n)),{}),s=u=>n.options.mergeOptions?n.options.mergeOptions(i,u):{...i,...u};let r={...{},...(t=e.initialState)!=null?t:{}};n._features.forEach(u=>{var f;r=(f=u.getInitialState==null?void 0:u.getInitialState(r))!=null?f:r});const a=[];let l=!1;const c={_features:bo,options:{...i,...e},initialState:r,_queue:u=>{a.push(u),l||(l=!0,Promise.resolve().then(()=>{for(;a.length;)a.shift()();l=!1}).catch(f=>setTimeout(()=>{throw f})))},reset:()=>{n.setState(n.initialState)},setOptions:u=>{const f=he(u,n.options);n.options=s(f)},getState:()=>n.options.state,setState:u=>{n.options.onStateChange==null||n.options.onStateChange(u)},_getRowId:(u,f,d)=>{var h;return(h=n.options.getRowId==null?void 0:n.options.getRowId(u,f,d))!=null?h:`${d?[d.id,f].join("."):f}`},getCoreRowModel:()=>(n._getCoreRowModel||(n._getCoreRowModel=n.options.getCoreRowModel(n)),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:u=>{const f=n.getRowModel().rowsById[u];if(!f)throw new Error;return f},_getDefaultColumnDef:I(()=>[n.options.defaultColumn],u=>{var f;return u=(f=u)!=null?f:{},{header:d=>{const h=d.header.column.columnDef;return h.accessorKey?h.accessorKey:h.accessorFn?h.id:null},cell:d=>{var h,g;return(h=(g=d.renderValue())==null||g.toString==null?void 0:g.toString())!=null?h:null},...n._features.reduce((d,h)=>Object.assign(d,h.getDefaultColumnDef==null?void 0:h.getDefaultColumnDef()),{}),...u}},{debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns},key:!1}),_getColumnDefs:()=>n.options.columns,getAllColumns:I(()=>[n._getColumnDefs()],u=>{const f=function(d,h,g){return g===void 0&&(g=0),d.map(p=>{const m=uu(n,p,g,h),_=p;return m.columns=_.columns?f(_.columns,m,g+1):[],m})};return f(u)},{key:!1,debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),getAllFlatColumns:I(()=>[n.getAllColumns()],u=>u.flatMap(f=>f.getFlatColumns()),{key:!1,debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),_getAllFlatColumnsById:I(()=>[n.getAllFlatColumns()],u=>u.reduce((f,d)=>(f[d.id]=d,f),{}),{key:!1,debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),getAllLeafColumns:I(()=>[n.getAllColumns(),n._getOrderColumnsFn()],(u,f)=>{let d=u.flatMap(h=>h.getLeafColumns());return f(d)},{key:!1,debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),getColumn:u=>n._getAllFlatColumnsById()[u]};return Object.assign(n,c),n._features.forEach(u=>Object.assign(n,u.createTable==null?void 0:u.createTable(n))),n}function Hu(e,t,n,i){const s=()=>{var r;return(r=o.getValue())!=null?r:e.options.renderFallbackValue},o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(i),renderValue:s,getContext:I(()=>[e,n,t,o],(r,a,l,c)=>({table:r,column:a,row:l,cell:c,getValue:c.getValue,renderValue:c.renderValue}),{key:!1,debug:()=>e.options.debugAll})};return e._features.forEach(r=>{Object.assign(o,r.createCell==null?void 0:r.createCell(o,n,t,e))},{}),o}const Nu=(e,t,n,i,s,o,r)=>{let a={id:t,index:i,original:n,depth:s,parentRow:r,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(a._valuesCache.hasOwnProperty(l))return a._valuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return a._valuesCache[l]=c.accessorFn(a.original,i),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=c.columnDef.getUniqueValues(a.original,i),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var c;return(c=a.getValue(l))!=null?c:e.options.renderFallbackValue},subRows:o??[],getLeafRows:()=>cu(a.subRows,l=>l.subRows),getAllCells:I(()=>[e.getAllLeafColumns()],l=>l.map(c=>Hu(e,a,c,c.id)),{key:!1,debug:()=>{var l;return(l=e.options.debugAll)!=null?l:e.options.debugRows}}),_getAllCellsByColumnId:I(()=>[a.getAllCells()],l=>l.reduce((c,u)=>(c[u.column.id]=u,c),{}),{key:"row.getAllCellsByColumnId",debug:()=>{var l;return(l=e.options.debugAll)!=null?l:e.options.debugRows}})};for(let l=0;lI(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},i=function(s,o,r){o===void 0&&(o=0);const a=[];for(let c=0;c{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}/** - * svelte-table - * - * Copyright (c) TanStack - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function ju(e){let t;return{c(){t=J(e[0])},l(n){t=ql(n,e[0])},m(n,i){Nl(n,t,i)},p(n,[i]){i&1&&Wt(t,n[0])},i:ht,o:ht,d(n){n&&U(t)}}}function Wu(e,t,n){let{content:i}=t;return e.$$set=s=>{"content"in s&&n(0,i=s.content)},[i]}class Gu extends X{constructor(t){super(),Q(this,t,Wu,ju,Y,{content:0})}}const qu=fa((e,t,n,i)=>`${lc(t.content)}`);var Yu=typeof document>"u"?qu:Gu;function Uu(e,t,n){let i,s;return i=new t({props:n,$$inline:!0}),{c(){V(i.$$.fragment)},l(o){uc(i.$$.fragment,o)},m(o,r){E(i,o,r),s=!0},p:ht,i(o){s||(S(i.$$.fragment,o),s=!0)},o(o){C(i.$$.fragment,o),s=!1},d(o){L(i,o)}}}function Xu(e,t){return class extends X{constructor(i){super(),Q(this,i,null,s=>Uu(s,e,t),Y,{},void 0)}}}function Ku(e,t){return fa((i,s,o,r)=>`${cc(e,"TableComponent").$$render(i,t,{},{})}`)}const Aa=typeof window>"u"?Ku:Xu;function Qu(e){return typeof e=="object"&&typeof e.$$render=="function"&&typeof e.render=="function"}function Zu(e){var t,n;let i="__SVELTE_HMR"in window;return e.prototype instanceof X||i&&((t=e.name)==null?void 0:t.startsWith("Proxy<"))&&((n=e.name)==null?void 0:n.endsWith(">"))}function yo(e){return typeof document>"u"?Qu(e):Zu(e)}function vo(e){return Aa(Yu,{content:e})}function fi(e,t){if(!e)return null;if(yo(e))return Aa(e,t);if(typeof e=="function"){const n=e(t);return yo(n)?n:vo(n)}return vo(e)}function Ju(e){let t;"subscribe"in e?t=e:t=cs(e);let n={state:{},onStateChange:()=>{},renderFallbackValue:null,...Fl(t)},i=zu(n),s=Ot(i.initialState),o=Is([s,t],a=>a);return cs(i,function(l){const c=o.subscribe(u=>{let[f,d]=u;i.setOptions(h=>({...h,...d,state:{...f,...d.state},onStateChange:g=>{g instanceof Function?s.update(g):s.set(g),n.onStateChange==null||n.onStateChange(g)}})),l(i)});return function(){c()}})}function Pi(e){return e.split("-")[1]}function Pa(e){return e==="y"?"height":"width"}function Fe(e){return e.split("-")[0]}function Fi(e){return["top","bottom"].includes(Fe(e))?"x":"y"}function xo(e,t,n){let{reference:i,floating:s}=e;const o=i.x+i.width/2-s.width/2,r=i.y+i.height/2-s.height/2,a=Fi(t),l=Pa(a),c=i[l]/2-s[l]/2,u=a==="x";let f;switch(Fe(t)){case"top":f={x:o,y:i.y-s.height};break;case"bottom":f={x:o,y:i.y+i.height};break;case"right":f={x:i.x+i.width,y:r};break;case"left":f={x:i.x-s.width,y:r};break;default:f={x:i.x,y:i.y}}switch(Pi(t)){case"start":f[a]-=c*(n&&u?-1:1);break;case"end":f[a]+=c*(n&&u?-1:1)}return f}const tf=async(e,t,n)=>{const{placement:i="bottom",strategy:s="absolute",middleware:o=[],platform:r}=n,a=o.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(t));let c=await r.getElementRects({reference:e,floating:t,strategy:s}),{x:u,y:f}=xo(c,i,l),d=i,h={},g=0;for(let p=0;pe.concat(t,t+"-start",t+"-end"),[]);const rf={left:"right",right:"left",bottom:"top",top:"bottom"};function hi(e){return e.replace(/left|right|bottom|top/g,t=>rf[t])}function af(e,t,n){n===void 0&&(n=!1);const i=Pi(e),s=Fi(e),o=Pa(s);let r=s==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(r=hi(r)),{main:r,cross:hi(r)}}const lf={start:"end",end:"start"};function Ki(e){return e.replace(/start|end/g,t=>lf[t])}const cf=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:i,middlewareData:s,rects:o,initialPlacement:r,platform:a,elements:l}=t,{mainAxis:c=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...p}=e,m=Fe(i),_=Fe(r)===r,b=await(a.isRTL==null?void 0:a.isRTL(l.floating)),y=f||(_||!g?[hi(r)]:function(M){const O=hi(M);return[Ki(M),O,Ki(O)]}(r));f||h==="none"||y.push(...function(M,O,K,Z){const T=Pi(M);let z=function(B,ft,st){const wt=["left","right"],Xt=["right","left"],pt=["top","bottom"],mt=["bottom","top"];switch(B){case"top":case"bottom":return st?ft?Xt:wt:ft?wt:Xt;case"left":case"right":return ft?pt:mt;default:return[]}}(Fe(M),K==="start",Z);return T&&(z=z.map(B=>B+"-"+T),O&&(z=z.concat(z.map(Ki)))),z}(r,g,h,b));const x=[r,...y],v=await Fa(t,p),R=[];let k=((n=s.flip)==null?void 0:n.overflows)||[];if(c&&R.push(v[m]),u){const{main:M,cross:O}=af(i,o,b);R.push(v[M],v[O])}if(k=[...k,{placement:i,overflows:R}],!R.every(M=>M<=0)){var $,P;const M=((($=s.flip)==null?void 0:$.index)||0)+1,O=x[M];if(O)return{data:{index:M,overflows:k},reset:{placement:O}};let K=(P=k.filter(Z=>Z.overflows[0]<=0).sort((Z,T)=>Z.overflows[1]-T.overflows[1])[0])==null?void 0:P.placement;if(!K)switch(d){case"bestFit":{var F;const Z=(F=k.map(T=>[T.placement,T.overflows.filter(z=>z>0).reduce((z,B)=>z+B,0)]).sort((T,z)=>T[1]-z[1])[0])==null?void 0:F[0];Z&&(K=Z);break}case"initialPlacement":K=r}if(i!==K)return{reset:{placement:K}}}return{}}}},uf=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:i}=t,s=await async function(o,r){const{placement:a,platform:l,elements:c}=o,u=await(l.isRTL==null?void 0:l.isRTL(c.floating)),f=Fe(a),d=Pi(a),h=Fi(a)==="x",g=["left","top"].includes(f)?-1:1,p=u&&h?-1:1,m=typeof r=="function"?r(o):r;let{mainAxis:_,crossAxis:b,alignmentAxis:y}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...m};return d&&typeof y=="number"&&(b=d==="end"?-1*y:y),h?{x:b*p,y:_*g}:{x:_*g,y:b*p}}(t,e);return{x:n+s.x,y:i+s.y,data:s}}}};function ff(e){return e==="x"?"y":"x"}const df=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:i,placement:s}=t,{mainAxis:o=!0,crossAxis:r=!1,limiter:a={fn:m=>{let{x:_,y:b}=m;return{x:_,y:b}}},...l}=e,c={x:n,y:i},u=await Fa(t,l),f=Fi(Fe(s)),d=ff(f);let h=c[f],g=c[d];if(o){const m=f==="y"?"bottom":"right";h=wo(h+u[f==="y"?"top":"left"],h,h-u[m])}if(r){const m=d==="y"?"bottom":"right";g=wo(g+u[d==="y"?"top":"left"],g,g-u[m])}const p=a.fn({...t,[f]:h,[d]:g});return{...p,data:{x:p.x-n,y:p.y-i}}}}};function Ct(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Jt(e){return Ct(e).getComputedStyle(e)}function Da(e){return e instanceof Ct(e).Node}function xe(e){return Da(e)?(e.nodeName||"").toLowerCase():""}let Ln;function Oa(){if(Ln)return Ln;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(Ln=e.brands.map(t=>t.brand+"/"+t.version).join(" "),Ln):navigator.userAgent}function Yt(e){return e instanceof Ct(e).HTMLElement}function qt(e){return e instanceof Ct(e).Element}function So(e){return typeof ShadowRoot>"u"?!1:e instanceof Ct(e).ShadowRoot||e instanceof ShadowRoot}function Di(e){const{overflow:t,overflowX:n,overflowY:i,display:s}=Jt(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&!["inline","contents"].includes(s)}function hf(e){return["table","td","th"].includes(xe(e))}function vs(e){const t=/firefox/i.test(Oa()),n=Jt(e),i=n.backdropFilter||n.WebkitBackdropFilter;return n.transform!=="none"||n.perspective!=="none"||!!i&&i!=="none"||t&&n.willChange==="filter"||t&&!!n.filter&&n.filter!=="none"||["transform","perspective"].some(s=>n.willChange.includes(s))||["paint","layout","strict","content"].some(s=>{const o=n.contain;return o!=null&&o.includes(s)})}function xs(){return/^((?!chrome|android).)*safari/i.test(Oa())}function js(e){return["html","body","#document"].includes(xe(e))}const Co=Math.min,hn=Math.max,gi=Math.round;function Ea(e){const t=Jt(e);let n=parseFloat(t.width),i=parseFloat(t.height);const s=Yt(e),o=s?e.offsetWidth:n,r=s?e.offsetHeight:i,a=gi(n)!==o||gi(i)!==r;return a&&(n=o,i=r),{width:n,height:i,fallback:a}}function La(e){return qt(e)?e:e.contextElement}const Ta={x:1,y:1};function Ye(e){const t=La(e);if(!Yt(t))return Ta;const n=t.getBoundingClientRect(),{width:i,height:s,fallback:o}=Ea(t);let r=(o?gi(n.width):n.width)/i,a=(o?gi(n.height):n.height)/s;return r&&Number.isFinite(r)||(r=1),a&&Number.isFinite(a)||(a=1),{x:r,y:a}}function Le(e,t,n,i){var s,o;t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),a=La(e);let l=Ta;t&&(i?qt(i)&&(l=Ye(i)):l=Ye(e));const c=a?Ct(a):window,u=xs()&&n;let f=(r.left+(u&&((s=c.visualViewport)==null?void 0:s.offsetLeft)||0))/l.x,d=(r.top+(u&&((o=c.visualViewport)==null?void 0:o.offsetTop)||0))/l.y,h=r.width/l.x,g=r.height/l.y;if(a){const p=Ct(a),m=i&&qt(i)?Ct(i):i;let _=p.frameElement;for(;_&&i&&m!==p;){const b=Ye(_),y=_.getBoundingClientRect(),x=getComputedStyle(_);y.x+=(_.clientLeft+parseFloat(x.paddingLeft))*b.x,y.y+=(_.clientTop+parseFloat(x.paddingTop))*b.y,f*=b.x,d*=b.y,h*=b.x,g*=b.y,f+=y.x,d+=y.y,_=Ct(_).frameElement}}return di({width:h,height:g,x:f,y:d})}function _e(e){return((Da(e)?e.ownerDocument:e.document)||window.document).documentElement}function Oi(e){return qt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Ia(e){return Le(_e(e)).left+Oi(e).scrollLeft}function vn(e){if(xe(e)==="html")return e;const t=e.assignedSlot||e.parentNode||So(e)&&e.host||_e(e);return So(t)?t.host:t}function Va(e){const t=vn(e);return js(t)?t.ownerDocument.body:Yt(t)&&Di(t)?t:Va(t)}function gn(e,t){var n;t===void 0&&(t=[]);const i=Va(e),s=i===((n=e.ownerDocument)==null?void 0:n.body),o=Ct(i);return s?t.concat(o,o.visualViewport||[],Di(i)?i:[]):t.concat(i,gn(i))}function Mo(e,t,n){let i;if(t==="viewport")i=function(r,a){const l=Ct(r),c=_e(r),u=l.visualViewport;let f=c.clientWidth,d=c.clientHeight,h=0,g=0;if(u){f=u.width,d=u.height;const p=xs();(!p||p&&a==="fixed")&&(h=u.offsetLeft,g=u.offsetTop)}return{width:f,height:d,x:h,y:g}}(e,n);else if(t==="document")i=function(r){const a=_e(r),l=Oi(r),c=r.ownerDocument.body,u=hn(a.scrollWidth,a.clientWidth,c.scrollWidth,c.clientWidth),f=hn(a.scrollHeight,a.clientHeight,c.scrollHeight,c.clientHeight);let d=-l.scrollLeft+Ia(r);const h=-l.scrollTop;return Jt(c).direction==="rtl"&&(d+=hn(a.clientWidth,c.clientWidth)-u),{width:u,height:f,x:d,y:h}}(_e(e));else if(qt(t))i=function(r,a){const l=Le(r,!0,a==="fixed"),c=l.top+r.clientTop,u=l.left+r.clientLeft,f=Yt(r)?Ye(r):{x:1,y:1};return{width:r.clientWidth*f.x,height:r.clientHeight*f.y,x:u*f.x,y:c*f.y}}(t,n);else{const r={...t};if(xs()){var s,o;const a=Ct(e);r.x-=((s=a.visualViewport)==null?void 0:s.offsetLeft)||0,r.y-=((o=a.visualViewport)==null?void 0:o.offsetTop)||0}i=r}return di(i)}function ko(e,t){return Yt(e)&&Jt(e).position!=="fixed"?t?t(e):e.offsetParent:null}function Ro(e,t){const n=Ct(e);if(!Yt(e))return n;let i=ko(e,t);for(;i&&hf(i)&&Jt(i).position==="static";)i=ko(i,t);return i&&(xe(i)==="html"||xe(i)==="body"&&Jt(i).position==="static"&&!vs(i))?n:i||function(s){let o=vn(s);for(;Yt(o)&&!js(o);){if(vs(o))return o;o=vn(o)}return null}(e)||n}function gf(e,t,n){const i=Yt(t),s=_e(t),o=Le(e,!0,n==="fixed",t);let r={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(i||!i&&n!=="fixed")if((xe(t)!=="body"||Di(s))&&(r=Oi(t)),Yt(t)){const l=Le(t,!0);a.x=l.x+t.clientLeft,a.y=l.y+t.clientTop}else s&&(a.x=Ia(s));return{x:o.left+r.scrollLeft-a.x,y:o.top+r.scrollTop-a.y,width:o.width,height:o.height}}const pf={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:i,strategy:s}=e;const o=n==="clippingAncestors"?function(c,u){const f=u.get(c);if(f)return f;let d=gn(c).filter(m=>qt(m)&&xe(m)!=="body"),h=null;const g=Jt(c).position==="fixed";let p=g?vn(c):c;for(;qt(p)&&!js(p);){const m=Jt(p),_=vs(p);m.position==="fixed"?h=null:(g?_||h:_||m.position!=="static"||!h||!["absolute","fixed"].includes(h.position))?h=m:d=d.filter(b=>b!==p),p=vn(p)}return u.set(c,d),d}(t,this._c):[].concat(n),r=[...o,i],a=r[0],l=r.reduce((c,u)=>{const f=Mo(t,u,s);return c.top=hn(f.top,c.top),c.right=Co(f.right,c.right),c.bottom=Co(f.bottom,c.bottom),c.left=hn(f.left,c.left),c},Mo(t,a,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:i}=e;const s=Yt(n),o=_e(n);if(n===o)return t;let r={scrollLeft:0,scrollTop:0},a={x:1,y:1};const l={x:0,y:0};if((s||!s&&i!=="fixed")&&((xe(n)!=="body"||Di(o))&&(r=Oi(n)),Yt(n))){const c=Le(n);a=Ye(n),l.x=c.x+n.clientLeft,l.y=c.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-r.scrollLeft*a.x+l.x,y:t.y*a.y-r.scrollTop*a.y+l.y}},isElement:qt,getDimensions:function(e){return Ea(e)},getOffsetParent:Ro,getDocumentElement:_e,getScale:Ye,async getElementRects(e){let{reference:t,floating:n,strategy:i}=e;const s=this.getOffsetParent||Ro,o=this.getDimensions;return{reference:gf(t,await s(n),i),floating:{x:0,y:0,...await o(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>Jt(e).direction==="rtl"};function mf(e,t,n,i){i===void 0&&(i={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:r=!0,animationFrame:a=!1}=i,l=s&&!a,c=l||o?[...qt(e)?gn(e):e.contextElement?gn(e.contextElement):[],...gn(t)]:[];c.forEach(h=>{l&&h.addEventListener("scroll",n,{passive:!0}),o&&h.addEventListener("resize",n)});let u,f=null;r&&(f=new ResizeObserver(()=>{n()}),qt(e)&&!a&&f.observe(e),qt(e)||!e.contextElement||a||f.observe(e.contextElement),f.observe(t));let d=a?Le(e):null;return a&&function h(){const g=Le(e);!d||g.x===d.x&&g.y===d.y&&g.width===d.width&&g.height===d.height||n(),d=g,u=requestAnimationFrame(h)}(),n(),()=>{var h;c.forEach(g=>{l&&g.removeEventListener("scroll",n),o&&g.removeEventListener("resize",n)}),(h=f)==null||h.disconnect(),f=null,a&&cancelAnimationFrame(u)}}const _f=(e,t,n)=>{const i=new Map,s={platform:pf,...n},o={...s.platform,_c:i};return tf(e,t,{...s,platform:o})};function bf(e){let t,n;const i={autoUpdate:!0};let s=e;const o=u=>({...i,...e||{},...u||{}}),r=u=>{t&&n&&(s=o(u),_f(t,n,s).then(f=>{Object.assign(n.style,{position:f.strategy,left:`${f.x}px`,top:`${f.y}px`}),s!=null&&s.onComputed&&s.onComputed(f)}))},a=u=>{if("subscribe"in u)return c(u),{};t=u,r()},l=(u,f)=>{let d;n=u,s=o(f),setTimeout(()=>r(f),0),r(f);const h=()=>{d&&(d(),d=void 0)},g=({autoUpdate:p}=s||{})=>{h(),p!==!1&&Ts().then(()=>mf(t,n,()=>r(s),p===!0?{}:p))};return d=g(),{update(p){r(p),d=g(p)},destroy(){h()}}},c=u=>{const f=u.subscribe(d=>{t===void 0?(t=d,r()):(Object.assign(t,d),r())});en(f)};return[a,l,r]}function yf(e){const t=e-1;return t*t*t+1}function $o(e,{delay:t=0,duration:n=400,easing:i=ta}={}){const s=+getComputedStyle(e).opacity;return{delay:t,duration:n,easing:i,css:o=>`opacity: ${o*s}`}}function Ao(e,{delay:t=0,duration:n=400,easing:i=yf,start:s=0,opacity:o=0}={}){const r=getComputedStyle(e),a=+r.opacity,l=r.transform==="none"?"":r.transform,c=1-s,u=a*(1-o);return{delay:t,duration:n,easing:i,css:(f,d)=>` - transform: ${l} scale(${1-c*d}); - opacity: ${a-u*d} - `}}function vf(e){let t,n,i,s,o;const r=e[2].default,a=At(r,e,e[1],null);return{c(){t=A("div"),a&&a.c(),t.hidden=!0},m(l,c){it(l,t,c),a&&a.m(t,null),i=!0,s||(o=Os(n=xf.call(null,t,e[0])),s=!0)},p(l,[c]){a&&a.p&&(!i||c&2)&&Ft(a,r,l,l[1],i?Pt(r,l[1],c,null):Dt(l[1]),null),n&&le(n.update)&&c&1&&n.update.call(null,l[0])},i(l){i||(S(a,l),i=!0)},o(l){C(a,l),i=!1},d(l){l&&U(t),a&&a.d(l),s=!1,o()}}}function xf(e,t="body"){let n;async function i(o){if(t=o,typeof t=="string"){if(n=document.querySelector(t),n===null&&(await Ts(),n=document.querySelector(t)),n===null)throw new Error(`No element found matching css selector: "${t}"`)}else if(t instanceof HTMLElement)n=t;else throw new TypeError(`Unknown portal target type: ${t===null?"null":typeof t}. Allowed types: string (CSS selector) or HTMLElement.`);n.appendChild(e),e.hidden=!1}function s(){e.parentNode&&e.parentNode.removeChild(e)}return i(t),{update:i,destroy:s}}function wf(e,t,n){let{$$slots:i={},$$scope:s}=t,{target:o="body"}=t;return e.$$set=r=>{"target"in r&&n(0,o=r.target),"$$scope"in r&&n(1,s=r.$$scope)},[o,s,i]}class Sf extends X{constructor(t){super(),Q(this,t,wf,vf,Y,{target:0})}}const Cf=e=>({}),Po=e=>({floatingRef:e[3],displayTooltip:e[5],hideTooltip:e[6]});function Fo(e){let t,n;return t=new Sf({props:{target:"body",$$slots:{default:[Mf]},$$scope:{ctx:e}}}),{c(){V(t.$$.fragment)},m(i,s){E(t,i,s),n=!0},p(i,s){const o={};s&257&&(o.$$scope={dirty:s,ctx:i}),t.$set(o)},i(i){n||(S(t.$$.fragment,i),n=!0)},o(i){C(t.$$.fragment,i),n=!1},d(i){L(t,i)}}}function Mf(e){let t,n,i,s,o,r;return{c(){t=A("div"),n=J(e[0]),D(t,"class","absolute p-2 text-sm bg-dark-50 text-dark-400 rounded-md max-w-xl font-main")},m(a,l){it(a,t,l),w(t,n),s=!0,o||(r=Os(e[4].call(null,t)),o=!0)},p(a,l){(!s||l&1)&&Wt(n,a[0])},i(a){s||(Qe(()=>{s&&(i||(i=ai(t,$o,{duration:150},!0)),i.run(1))}),s=!0)},o(a){i||(i=ai(t,$o,{duration:150},!1)),i.run(0),s=!1},d(a){a&&U(t),a&&i&&i.end(),o=!1,r()}}}function kf(e){let t,n,i;const s=e[7].default,o=At(s,e,e[8],Po);let r=e[2]&&!e[1]&&Fo(e);return{c(){o&&o.c(),t=q(),r&&r.c(),n=kn()},m(a,l){o&&o.m(a,l),it(a,t,l),r&&r.m(a,l),it(a,n,l),i=!0},p(a,[l]){o&&o.p&&(!i||l&256)&&Ft(o,s,a,a[8],i?Pt(s,a[8],l,Cf):Dt(a[8]),Po),a[2]&&!a[1]?r?(r.p(a,l),l&6&&S(r,1)):(r=Fo(a),r.c(),S(r,1),r.m(n.parentNode,n)):r&&(kt(),C(r,1,1,()=>{r=null}),Rt())},i(a){i||(S(o,a),S(r),i=!0)},o(a){C(o,a),C(r),i=!1},d(a){o&&o.d(a),a&&U(t),r&&r.d(a),a&&U(n)}}}function Rf(e,t,n){let{$$slots:i={},$$scope:s}=t,{content:o}=t,{disabled:r}=t;const[a,l]=bf({strategy:"absolute",placement:"top",middleware:[uf(6),cf(),df()]});let c=!1,u;const f=()=>{r||(clearTimeout(u),u=setTimeout(()=>{n(2,c=!0)},300))},d=()=>{r||(clearTimeout(u),n(2,c=!1))};return e.$$set=h=>{"content"in h&&n(0,o=h.content),"disabled"in h&&n(1,r=h.disabled),"$$scope"in h&&n(8,s=h.$$scope)},[o,r,c,a,l,f,d,i,s]}class $f extends X{constructor(t){super(),Q(this,t,Rf,kf,Y,{content:0,disabled:1})}}function Do(e,t,n){const i=e.slice();return i[10]=t[n],i}function Oo(e,t,n){const i=e.slice();return i[13]=t[n],i}function Eo(e,t,n){const i=e.slice();return i[19]=t[n],i}function Lo(e,t,n){const i=e.slice();return i[22]=t[n],i}function To(e){let t,n,i,s,o,r,a,l,c,u;var f=fi(e[22].column.columnDef.header,e[22].getContext());function d(m){return{}}f&&(n=ye(f,d()));const h=[Pf,Af],g=[];function p(m,_){return _&1&&(s=null),_&1&&(o=null),s==null&&(s=m[22].column.getIsSorted()==="asc"),s?0:(o==null&&(o=m[22].column.getIsSorted()==="desc"),o?1:-1)}return~(r=p(e,-1))&&(a=g[r]=h[r](e)),{c(){t=A("button"),n&&V(n.$$.fragment),i=q(),a&&a.c(),D(t,"class","flex w-full items-center justify-center gap-1"),Fn(t,"cursor-pointer",e[22].column.getCanSort()),Fn(t,"select-none",e[22].column.getCanSort())},m(m,_){it(m,t,_),n&&E(n,t,null),w(t,i),~r&&g[r].m(t,null),l=!0,c||(u=It(t,"click",function(){le(e[22].column.getToggleSortingHandler())&&e[22].column.getToggleSortingHandler().apply(this,arguments)}),c=!0)},p(m,_){if(e=m,_&1&&f!==(f=fi(e[22].column.columnDef.header,e[22].getContext()))){if(n){kt();const y=n;C(y.$$.fragment,1,0,()=>{L(y,1)}),Rt()}f?(n=ye(f,d()),V(n.$$.fragment),S(n.$$.fragment,1),E(n,t,i)):n=null}let b=r;r=p(e,_),r!==b&&(a&&(kt(),C(g[b],1,1,()=>{g[b]=null}),Rt()),~r?(a=g[r],a||(a=g[r]=h[r](e),a.c()),S(a,1),a.m(t,null)):a=null),(!l||_&1)&&Fn(t,"cursor-pointer",e[22].column.getCanSort()),(!l||_&1)&&Fn(t,"select-none",e[22].column.getCanSort())},i(m){l||(n&&S(n.$$.fragment,m),S(a),l=!0)},o(m){n&&C(n.$$.fragment,m),C(a),l=!1},d(m){m&&U(t),n&&L(n),~r&&g[r].d(),c=!1,u()}}}function Af(e){let t,n;return t=new iu({}),{c(){V(t.$$.fragment)},m(i,s){E(t,i,s),n=!0},i(i){n||(S(t.$$.fragment,i),n=!0)},o(i){C(t.$$.fragment,i),n=!1},d(i){L(t,i)}}}function Pf(e){let t,n;return t=new lu({}),{c(){V(t.$$.fragment)},m(i,s){E(t,i,s),n=!0},i(i){n||(S(t.$$.fragment,i),n=!0)},o(i){C(t.$$.fragment,i),n=!1},d(i){L(t,i)}}}function Io(e){let t,n,i,s=!e[22].isPlaceholder&&To(e);return{c(){t=A("th"),s&&s.c(),D(t,"class",n=`bg-dark-600 select-none p-1 ${e[22].id==="executionTime"?"w-1/4":"w-3/4"}`)},m(o,r){it(o,t,r),s&&s.m(t,null),i=!0},p(o,r){o[22].isPlaceholder?s&&(kt(),C(s,1,1,()=>{s=null}),Rt()):s?(s.p(o,r),r&1&&S(s,1)):(s=To(o),s.c(),S(s,1),s.m(t,null)),(!i||r&1&&n!==(n=`bg-dark-600 select-none p-1 ${o[22].id==="executionTime"?"w-1/4":"w-3/4"}`))&&D(t,"class",n)},i(o){i||(S(s),i=!0)},o(o){C(s),i=!1},d(o){o&&U(t),s&&s.d()}}}function Vo(e){let t,n,i,s=e[19].headers,o=[];for(let a=0;aC(o[a],1,1,()=>{o[a]=null});return{c(){t=A("tr");for(let a=0;a{L(f,1)}),Rt()}a?(n=ye(a,l()),V(n.$$.fragment),S(n.$$.fragment,1),E(n,t,null)):n=null}(!s||u&1&&i!==(i=`${e[13].column.id==="executionTime"&&"text-center"} bg-dark-700 p-2 ${e[10].original.slow&&"text-yellow-500"} max-w-[200px] truncate`))&&D(t,"class",i)},i(c){s||(n&&S(n.$$.fragment,c),s=!0)},o(c){n&&C(n.$$.fragment,c),s=!1},d(c){c&&U(t),n&&L(n),o=!1,te(r)}}}function zo(e){let t,n;return t=new $f({props:{content:e[13].getValue(),disabled:e[13].column.id!=="query",$$slots:{default:[Ff,({floatingRef:i,displayTooltip:s,hideTooltip:o})=>({16:i,17:s,18:o}),({floatingRef:i,displayTooltip:s,hideTooltip:o})=>(i?65536:0)|(s?131072:0)|(o?262144:0)]},$$scope:{ctx:e}}}),{c(){V(t.$$.fragment)},m(i,s){E(t,i,s),n=!0},p(i,s){const o={};s&1&&(o.content=i[13].getValue()),s&1&&(o.disabled=i[13].column.id!=="query"),s&33947649&&(o.$$scope={dirty:s,ctx:i}),t.$set(o)},i(i){n||(S(t.$$.fragment,i),n=!0)},o(i){C(t.$$.fragment,i),n=!1},d(i){L(t,i)}}}function Ho(e){let t,n,i,s=e[10].getVisibleCells(),o=[];for(let a=0;aC(o[a],1,1,()=>{o[a]=null});return{c(){t=A("tr");for(let a=0;aC(l[h],1,1,()=>{l[h]=null});let u=e[0].getRowModel().rows,f=[];for(let h=0;hC(f[h],1,1,()=>{f[h]=null});return{c(){t=A("div"),n=A("table"),i=A("thead");for(let h=0;hn(4,i=h)),gt(e,Qn,h=>n(5,s=h));const r=zs(),a=[{accessorKey:"query",header:"Query",cell:h=>h.getValue(),enableSorting:!0},{accessorKey:"executionTime",header:"Time (ms)",cell:h=>h.getValue().toFixed(4),enableSorting:!0}];let l=[];const c=h=>{h instanceof Function?n(2,l=h(l)):n(2,l=h),u.update(g=>({...g,state:{...g.state,sorting:l}}))},u=Ot({data:s,columns:a,manualPagination:!0,manualSorting:!0,pageCount:-1,getCoreRowModel:Bu(),onSortingChange:c,state:{sorting:l}}),f=Ju(u);gt(e,f,h=>n(0,o=h));let d;return e.$$.update=()=>{e.$$.dirty&32&&u.update(h=>({...h,data:s})),e.$$.dirty&28&&(clearTimeout(d),n(3,d=setTimeout(()=>{ba("fetchResource",{resource:r.params.resource,pageIndex:i.page,search:i.search,sortBy:l})},300)))},[o,f,l,d,i,s]}class Ef extends X{constructor(t){super(),Q(this,t,Of,Df,Y,{})}}function Lf(e){let t,n,i,s,o,r,a,l,c,u=e[0].resourceQueriesCount+"",f,d,h,g,p=e[0].resourceTime.toFixed(4)+"",m,_,b,y,x,v=e[0].resourceSlowQueries+"",R,k,$,P;return i=new ya({}),{c(){t=A("div"),n=A("button"),V(i.$$.fragment),s=q(),o=A("p"),o.textContent=`${e[1].params.resource}`,r=q(),a=A("div"),l=A("p"),c=J("Queries: "),f=J(u),d=q(),h=A("p"),g=J("Time: "),m=J(p),_=J(" ms"),b=q(),y=A("p"),x=J("Slow queries: "),R=J(v),D(n,"class","flex p-2 w-12 bg-dark-600 text-dark-100 hover:text-white rounded-md justify-center items-center hover:bg-dark-500 outline-none border-[1px] border-transparent focus-visible:border-cyan-600"),D(o,"class","text-center text-lg"),D(y,"class","text-yellow-500"),D(a,"class","text-end text-dark-100 flex flex-col text-xs"),D(t,"class","p-4 grid grid-flow-col grid-cols-3 items-center ")},m(F,M){it(F,t,M),w(t,n),E(i,n,null),w(t,s),w(t,o),w(t,r),w(t,a),w(a,l),w(l,c),w(l,f),w(a,d),w(a,h),w(h,g),w(h,m),w(h,_),w(a,b),w(a,y),w(y,x),w(y,R),k=!0,$||(P=It(n,"click",e[2]),$=!0)},p(F,[M]){(!k||M&1)&&u!==(u=F[0].resourceQueriesCount+"")&&Wt(f,u),(!k||M&1)&&p!==(p=F[0].resourceTime.toFixed(4)+"")&&Wt(m,p),(!k||M&1)&&v!==(v=F[0].resourceSlowQueries+"")&&Wt(R,v)},i(F){k||(S(i.$$.fragment,F),k=!0)},o(F){C(i.$$.fragment,F),k=!1},d(F){F&&U(t),L(i),$=!1,P()}}}function Tf(e,t,n){let i;gt(e,ps,r=>n(0,i=r));const s=zs();return[i,s,()=>Ee.goto("/")]}class If extends X{constructor(t){super(),Q(this,t,Tf,Lf,Y,{})}}function za(e,t){const n=i=>{const{action:s,data:o}=i.data;s===e&&t(o)};Ai(()=>window.addEventListener("message",n)),en(()=>window.removeEventListener("message",n))}const Ha=()=>!window.invokeNative,Na=(e,t=1e3)=>{if(Ha())for(const n of e)setTimeout(()=>{window.dispatchEvent(new MessageEvent("message",{data:{action:n.action,data:n.data}}))},t)};function Vf(e){let t,n,i,s,o,r,a,l;var c=e[0];function u(f){return{props:{class:"text-dark-300"}}}return c&&(i=ye(c,u())),{c(){t=A("div"),n=A("div"),i&&V(i.$$.fragment),s=q(),o=A("input"),D(n,"class","pr-2"),D(o,"type","text"),D(o,"class","w-full bg-transparent outline-none"),D(o,"placeholder","Search queries..."),D(t,"class","bg-dark-600 m-4 mt-0 flex items-center rounded-md border-[1px] border-transparent p-2 outline-none transition-all duration-100 focus-within:border-cyan-600")},m(f,d){it(f,t,d),w(t,n),i&&E(i,n,null),w(t,s),w(t,o),si(o,e[1]),r=!0,a||(l=It(o,"input",e[2]),a=!0)},p(f,[d]){if(d&1&&c!==(c=f[0])){if(i){kt();const h=i;C(h.$$.fragment,1,0,()=>{L(h,1)}),Rt()}c?(i=ye(c,u()),V(i.$$.fragment),S(i.$$.fragment,1),E(i,n,null)):i=null}d&2&&o.value!==f[1]&&si(o,f[1])},i(f){r||(i&&S(i.$$.fragment,f),r=!0)},o(f){i&&C(i.$$.fragment,f),r=!1},d(f){f&&U(t),i&&L(i),a=!1,l()}}}function zf(e,t,n){let i;gt(e,Bt,a=>n(3,i=a));let s="",{icon:o}=t;function r(){s=this.value,n(1,s)}return e.$$set=a=>{"icon"in a&&n(0,o=a.icon)},e.$$.update=()=>{e.$$.dirty&2&&(bt(Bt,i.search=s,i),bt(Bt,i.page=0,i))},[o,s,r]}class Hf extends X{constructor(t){super(),Q(this,t,zf,Vf,Y,{icon:0})}}function Nf(e){let t;const n=e[2].default,i=At(n,e,e[3],null);return{c(){i&&i.c()},m(s,o){i&&i.m(s,o),t=!0},p(s,o){i&&i.p&&(!t||o&8)&&Ft(i,n,s,s[3],t?Pt(n,s[3],o,null):Dt(s[3]),null)},i(s){t||(S(i,s),t=!0)},o(s){C(i,s),t=!1},d(s){i&&i.d(s)}}}function Bf(e){let t,n;const i=[{name:"search"},e[1],{iconNode:e[0]}];let s={$$slots:{default:[Nf]},$$scope:{ctx:e}};for(let o=0;o{n(1,t=N(N({},t),nt(r))),"$$scope"in r&&n(3,s=r.$$scope)},t=nt(t),[o,t,i,s]}class Wf extends X{constructor(t){super(),Q(this,t,jf,Bf,Y,{})}}const Ba=Wf;function Gf(e){let t,n,i,s,o,r,a,l,c,u;return i=new If({}),o=new Hf({props:{icon:Ba}}),a=new Ef({}),c=new Zc({props:{maxPage:e[0]}}),{c(){t=A("div"),n=A("div"),V(i.$$.fragment),s=q(),V(o.$$.fragment),r=q(),V(a.$$.fragment),l=q(),V(c.$$.fragment),D(t,"class","flex w-full flex-col justify-between")},m(f,d){it(f,t,d),w(t,n),E(i,n,null),w(n,s),E(o,n,null),w(n,r),E(a,n,null),w(t,l),E(c,t,null),u=!0},p(f,[d]){const h={};d&1&&(h.maxPage=f[0]),c.$set(h)},i(f){u||(S(i.$$.fragment,f),S(o.$$.fragment,f),S(a.$$.fragment,f),S(c.$$.fragment,f),u=!0)},o(f){C(i.$$.fragment,f),C(o.$$.fragment,f),C(a.$$.fragment,f),C(c.$$.fragment,f),u=!1},d(f){f&&U(t),L(i),L(o),L(a),L(c)}}}function qf(e,t,n){let i,s,o;gt(e,ps,a=>n(1,i=a)),gt(e,Qn,a=>n(2,s=a)),gt(e,Bt,a=>n(3,o=a));let r=0;return en(()=>{bt(Qn,s=[],s),bt(Bt,o.page=0,o)}),Na([{action:"loadResource",data:{queries:[{query:"SELECT * FROM users WHERE ID = 1",executionTime:3,slow:!1,date:Date.now()},{query:"SELECT * FROM users WHERE ID = 1",executionTime:23,slow:!0,date:Date.now()},{query:"SELECT * FROM users WHERE ID = 1",executionTime:15,slow:!1,date:Date.now()},{query:"SELECT * FROM users WHERE ID = 1",executionTime:122,slow:!0,date:Date.now()}],resourceQueriesCount:3,resourceSlowQueries:2,resourceTime:1342,pageCount:3}}]),za("loadResource",a=>{n(0,r=a.pageCount),bt(Qn,s=a.queries,s),bt(ps,i={resourceQueriesCount:a.resourceQueriesCount,resourceSlowQueries:a.resourceSlowQueries,resourceTime:a.resourceTime},i)}),[r]}class Yf extends X{constructor(t){super(),Q(this,t,qf,Gf,Y,{})}}function Uf(e){let t,n,i,s,o,r,a,l;var c=e[1];function u(f){return{props:{class:"text-dark-300"}}}return c&&(i=ye(c,u())),{c(){t=A("div"),n=A("div"),i&&V(i.$$.fragment),s=q(),o=A("input"),D(n,"class","pr-2"),D(o,"type","text"),D(o,"class","bg-transparent outline-none w-full"),D(o,"placeholder","Search resources..."),D(t,"class","p-2 flex items-center outline-none border-[1px] border-transparent transition-all duration-100 focus-within:border-cyan-600 rounded-md bg-dark-600")},m(f,d){it(f,t,d),w(t,n),i&&E(i,n,null),w(t,s),w(t,o),si(o,e[0]),r=!0,a||(l=It(o,"input",e[2]),a=!0)},p(f,[d]){if(d&2&&c!==(c=f[1])){if(i){kt();const h=i;C(h.$$.fragment,1,0,()=>{L(h,1)}),Rt()}c?(i=ye(c,u()),V(i.$$.fragment),S(i.$$.fragment,1),E(i,n,null)):i=null}d&1&&o.value!==f[0]&&si(o,f[0])},i(f){r||(i&&S(i.$$.fragment,f),r=!0)},o(f){i&&C(i.$$.fragment,f),r=!1},d(f){f&&U(t),i&&L(i),a=!1,l()}}}function Xf(e,t,n){let{icon:i}=t,{value:s}=t;function o(){s=this.value,n(0,s)}return e.$$set=r=>{"icon"in r&&n(1,i=r.icon),"value"in r&&n(0,s=r.value)},[s,i,o]}class Kf extends X{constructor(t){super(),Q(this,t,Xf,Uf,Y,{icon:1,value:0})}}function Qf(e){let t;const n=e[2].default,i=At(n,e,e[3],null);return{c(){i&&i.c()},m(s,o){i&&i.m(s,o),t=!0},p(s,o){i&&i.p&&(!t||o&8)&&Ft(i,n,s,s[3],t?Pt(n,s[3],o,null):Dt(s[3]),null)},i(s){t||(S(i,s),t=!0)},o(s){C(i,s),t=!1},d(s){i&&i.d(s)}}}function Zf(e){let t,n;const i=[{name:"file-analytics"},e[1],{iconNode:e[0]}];let s={$$slots:{default:[Qf]},$$scope:{ctx:e}};for(let o=0;o{n(1,t=N(N({},t),nt(r))),"$$scope"in r&&n(3,s=r.$$scope)},t=nt(t),[o,t,i,s]}class td extends X{constructor(t){super(),Q(this,t,Jf,Zf,Y,{})}}const ed=td;function nd(e){let t;const n=e[2].default,i=At(n,e,e[3],null);return{c(){i&&i.c()},m(s,o){i&&i.m(s,o),t=!0},p(s,o){i&&i.p&&(!t||o&8)&&Ft(i,n,s,s[3],t?Pt(n,s[3],o,null):Dt(s[3]),null)},i(s){t||(S(i,s),t=!0)},o(s){C(i,s),t=!1},d(s){i&&i.d(s)}}}function id(e){let t,n;const i=[{name:"source-code"},e[1],{iconNode:e[0]}];let s={$$slots:{default:[nd]},$$scope:{ctx:e}};for(let o=0;o{n(1,t=N(N({},t),nt(r))),"$$scope"in r&&n(3,s=r.$$scope)},t=nt(t),[o,t,i,s]}class od extends X{constructor(t){super(),Q(this,t,sd,id,Y,{})}}const rd=od;/*! - * @kurkle/color v0.3.2 - * https://github.com/kurkle/color#readme - * (c) 2023 Jukka Kurkela - * Released under the MIT License - */function Rn(e){return e+.5|0}const ge=(e,t,n)=>Math.max(Math.min(e,n),t);function un(e){return ge(Rn(e*2.55),0,255)}function be(e){return ge(Rn(e*255),0,255)}function re(e){return ge(Rn(e/2.55)/100,0,1)}function No(e){return ge(Rn(e*100),0,100)}const Tt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ws=[..."0123456789ABCDEF"],ad=e=>ws[e&15],ld=e=>ws[(e&240)>>4]+ws[e&15],Tn=e=>(e&240)>>4===(e&15),cd=e=>Tn(e.r)&&Tn(e.g)&&Tn(e.b)&&Tn(e.a);function ud(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&Tt[e[1]]*17,g:255&Tt[e[2]]*17,b:255&Tt[e[3]]*17,a:t===5?Tt[e[4]]*17:255}:(t===7||t===9)&&(n={r:Tt[e[1]]<<4|Tt[e[2]],g:Tt[e[3]]<<4|Tt[e[4]],b:Tt[e[5]]<<4|Tt[e[6]],a:t===9?Tt[e[7]]<<4|Tt[e[8]]:255})),n}const fd=(e,t)=>e<255?t(e):"";function dd(e){var t=cd(e)?ad:ld;return e?"#"+t(e.r)+t(e.g)+t(e.b)+fd(e.a,t):void 0}const hd=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function ja(e,t,n){const i=t*Math.min(n,1-n),s=(o,r=(o+e/30)%12)=>n-i*Math.max(Math.min(r-3,9-r,1),-1);return[s(0),s(8),s(4)]}function gd(e,t,n){const i=(s,o=(s+e/60)%6)=>n-n*t*Math.max(Math.min(o,4-o,1),0);return[i(5),i(3),i(1)]}function pd(e,t,n){const i=ja(e,1,.5);let s;for(t+n>1&&(s=1/(t+n),t*=s,n*=s),s=0;s<3;s++)i[s]*=1-t-n,i[s]+=t;return i}function md(e,t,n,i,s){return e===s?(t-n)/i+(t.5?u/(2-o-r):u/(o+r),l=md(n,i,s,u,o),l=l*60+.5),[l|0,c||0,a]}function Gs(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(be)}function qs(e,t,n){return Gs(ja,e,t,n)}function _d(e,t,n){return Gs(pd,e,t,n)}function bd(e,t,n){return Gs(gd,e,t,n)}function Wa(e){return(e%360+360)%360}function yd(e){const t=hd.exec(e);let n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?un(+t[5]):be(+t[5]));const s=Wa(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?i=_d(s,o,r):t[1]==="hsv"?i=bd(s,o,r):i=qs(s,o,r),{r:i[0],g:i[1],b:i[2],a:n}}function vd(e,t){var n=Ws(e);n[0]=Wa(n[0]+t),n=qs(n),e.r=n[0],e.g=n[1],e.b=n[2]}function xd(e){if(!e)return;const t=Ws(e),n=t[0],i=No(t[1]),s=No(t[2]);return e.a<255?`hsla(${n}, ${i}%, ${s}%, ${re(e.a)})`:`hsl(${n}, ${i}%, ${s}%)`}const Bo={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},jo={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function wd(){const e={},t=Object.keys(jo),n=Object.keys(Bo);let i,s,o,r,a;for(i=0;i>16&255,o>>8&255,o&255]}return e}let In;function Sd(e){In||(In=wd(),In.transparent=[0,0,0,0]);const t=In[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Cd=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Md(e){const t=Cd.exec(e);let n=255,i,s,o;if(t){if(t[7]!==i){const r=+t[7];n=t[8]?un(r):ge(r*255,0,255)}return i=+t[1],s=+t[3],o=+t[5],i=255&(t[2]?un(i):ge(i,0,255)),s=255&(t[4]?un(s):ge(s,0,255)),o=255&(t[6]?un(o):ge(o,0,255)),{r:i,g:s,b:o,a:n}}}function kd(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${re(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const Qi=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Ne=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function Rd(e,t,n){const i=Ne(re(e.r)),s=Ne(re(e.g)),o=Ne(re(e.b));return{r:be(Qi(i+n*(Ne(re(t.r))-i))),g:be(Qi(s+n*(Ne(re(t.g))-s))),b:be(Qi(o+n*(Ne(re(t.b))-o))),a:e.a+n*(t.a-e.a)}}function Vn(e,t,n){if(e){let i=Ws(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=qs(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function Ga(e,t){return e&&Object.assign(t||{},e)}function Wo(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=be(e[3]))):(t=Ga(e,{r:0,g:0,b:0,a:1}),t.a=be(t.a)),t}function $d(e){return e.charAt(0)==="r"?Md(e):yd(e)}class xn{constructor(t){if(t instanceof xn)return t;const n=typeof t;let i;n==="object"?i=Wo(t):n==="string"&&(i=ud(t)||Sd(t)||$d(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Ga(this._rgb);return t&&(t.a=re(t.a)),t}set rgb(t){this._rgb=Wo(t)}rgbString(){return this._valid?kd(this._rgb):void 0}hexString(){return this._valid?dd(this._rgb):void 0}hslString(){return this._valid?xd(this._rgb):void 0}mix(t,n){if(t){const i=this.rgb,s=t.rgb;let o;const r=n===o?.5:n,a=2*r-1,l=i.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,i.r=255&c*i.r+o*s.r+.5,i.g=255&c*i.g+o*s.g+.5,i.b=255&c*i.b+o*s.b+.5,i.a=r*i.a+(1-r)*s.a,this.rgb=i}return this}interpolate(t,n){return t&&(this._rgb=Rd(this._rgb,t._rgb,n)),this}clone(){return new xn(this.rgb)}alpha(t){return this._rgb.a=be(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=Rn(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Vn(this._rgb,2,t),this}darken(t){return Vn(this._rgb,2,-t),this}saturate(t){return Vn(this._rgb,1,t),this}desaturate(t){return Vn(this._rgb,1,-t),this}rotate(t){return vd(this._rgb,t),this}}/*! - * Chart.js v4.2.1 - * https://www.chartjs.org - * (c) 2023 Chart.js Contributors - * Released under the MIT License - */function ie(){}const Ad=(()=>{let e=0;return()=>e++})();function tt(e){return e===null||typeof e>"u"}function ot(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function W(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function dt(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function St(e,t){return dt(e)?e:t}function et(e,t){return typeof e>"u"?t:e}const Pd=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,qa=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function rt(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function G(e,t,n,i){let s,o,r;if(ot(e))if(o=e.length,i)for(s=o-1;s>=0;s--)t.call(n,e[s],s);else for(s=0;se,x:e=>e.x,y:e=>e.y};function Od(e){const t=e.split("."),n=[];let i="";for(const s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function Ed(e){const t=Od(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function Ze(e,t){return(Go[t]||(Go[t]=Ed(t)))(e)}function Ys(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Ut=e=>typeof e<"u",we=e=>typeof e=="function",qo=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function Ld(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const ct=Math.PI,at=2*ct,_i=Number.POSITIVE_INFINITY,Td=ct/180,lt=ct/2,Me=ct/4,Yo=ct*2/3,pe=Math.log10,bi=Math.sign;function Zn(e,t,n){return Math.abs(e-t)s-o).pop(),t}function yi(e){return!isNaN(parseFloat(e))&&isFinite(e)}function Vd(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function Ua(e,t,n){let i,s,o;for(i=0,s=e.length;il&&c=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function Xs(e,t,n){n=n||(r=>e[r]1;)o=s+i>>1,n(o)?s=o:i=o;return{lo:s,hi:i}}const Ss=(e,t,n,i)=>Xs(e,n,i?s=>{const o=e[s][t];return oe[s][t]Xs(e,n,i=>e[i][t]>=n);function jd(e,t,n){let i=0,s=e.length;for(;ii&&e[s-1]>n;)s--;return i>0||s{const i="_onData"+Ys(n),s=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...o){const r=s.apply(this,o);return e._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...o)}),r}})})}function Ko(e,t){const n=e._chartjs;if(!n)return;const i=n.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(Ka.forEach(o=>{delete e[o]}),delete e._chartjs)}function Gd(e){const t=new Set;let n,i;for(n=0,i=e.length;n"u"?function(e){return e()}:window.requestAnimationFrame}();function Za(e,t){let n=[],i=!1;return function(...s){n=s,i||(i=!0,Qa.call(window,()=>{i=!1,e.apply(t,n)}))}}function qd(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const Ja=e=>e==="start"?"left":e==="end"?"right":"center",mn=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,zn=e=>e===0||e===1,Qo=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*at/n)),Zo=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*at/n)+1,_n={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*lt)+1,easeOutSine:e=>Math.sin(e*lt),easeInOutSine:e=>-.5*(Math.cos(ct*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>zn(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>zn(e)?e:Qo(e,.075,.3),easeOutElastic:e=>zn(e)?e:Zo(e,.075,.3),easeInOutElastic(e){return zn(e)?e:e<.5?.5*Qo(e*2,.1125,.45):.5+.5*Zo(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-_n.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?_n.easeInBounce(e*2)*.5:_n.easeOutBounce(e*2-1)*.5+.5};function tl(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Jo(e){return tl(e)?e:new xn(e)}function Zi(e){return tl(e)?e:new xn(e).saturate(.5).darken(.1).hexString()}const Yd=["x","y","borderWidth","radius","tension"],Ud=["color","borderColor","backgroundColor"];function Xd(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:Ud},numbers:{type:"number",properties:Yd}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function Kd(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const tr=new Map;function Qd(e,t){t=t||{};const n=e+JSON.stringify(t);let i=tr.get(n);return i||(i=new Intl.NumberFormat(e,t),tr.set(n,i)),i}function $n(e,t,n){return Qd(t,n).format(e)}const el={values(e){return ot(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const i=this.chart.options.locale;let s,o=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=Zd(e,n)}const r=pe(Math.abs(o)),a=Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),$n(e,i,l)},logarithmic(e,t,n){if(e===0)return"0";const i=n[t].significand||e/Math.pow(10,Math.floor(pe(e)));return[1,2,3,5,10,15].includes(i)||t>.8*n.length?el.numeric.call(this,e,t,n):""}};function Zd(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var Ei={formatters:el};function Jd(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Ei.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Te=Object.create(null),Cs=Object.create(null);function bn(e,t){if(!t)return e;const n=t.split(".");for(let i=0,s=n.length;ii.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,s)=>Zi(s.backgroundColor),this.hoverBorderColor=(i,s)=>Zi(s.borderColor),this.hoverColor=(i,s)=>Zi(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return Ji(this,t,n)}get(t){return bn(this,t)}describe(t,n){return Ji(Cs,t,n)}override(t,n){return Ji(Te,t,n)}route(t,n,i,s){const o=bn(this,t),r=bn(this,i),a="_"+n;Object.defineProperties(o,{[a]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=r[s];return W(l)?Object.assign({},c,l):et(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var ut=new th({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Xd,Kd,Jd]);function eh(e){return!e||tt(e.size)||tt(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function xi(e,t,n,i,s){let o=t[s];return o||(o=t[s]=e.measureText(s).width,n.push(s)),o>i&&(i=o),i}function nh(e,t,n,i){i=i||{};let s=i.data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},o=i.garbageCollect=[],i.font=t),e.save(),e.font=t;let r=0;const a=n.length;let l,c,u,f,d;for(l=0;ln.length){for(l=0;l0&&e.stroke()}}function nl(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.xt.top-n&&e.y0&&o.strokeColor!=="";let l,c;for(e.save(),e.font=s.string,sh(e,o),l=0;l+e||0;function Ks(e,t){const n={},i=W(t),s=i?Object.keys(t):t,o=W(e)?i?r=>et(e[r],e[t[r]]):r=>e[r]:()=>e;for(const r of s)n[r]=uh(o(r));return n}function fh(e){return Ks(e,{top:"y",right:"x",bottom:"y",left:"x"})}function yn(e){return Ks(e,["topLeft","topRight","bottomLeft","bottomRight"])}function $t(e){const t=fh(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function yt(e,t){e=e||{},t=t||ut.font;let n=et(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=et(e.style,t.style);i&&!(""+i).match(lh)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:et(e.family,t.family),lineHeight:ch(et(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:et(e.weight,t.weight),string:""};return s.string=eh(s),s}function Hn(e,t,n,i){let s=!0,o,r,a;for(o=0,r=e.length;on&&a===0?0:a+l;return{min:r(i,-Math.abs(o)),max:r(s,o)}}function Ie(e,t){return Object.assign(Object.create(e),t)}function Qs(e,t=[""],n=e,i,s=()=>e[0]){Ut(i)||(i=ll("_fallback",e));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:n,_fallback:i,_getTarget:s,override:r=>Qs([r,...e],t,n,i)};return new Proxy(o,{deleteProperty(r,a){return delete r[a],delete r._keys,delete e[0][a],!0},get(r,a){return rl(r,a,()=>vh(a,t,e,r))},getOwnPropertyDescriptor(r,a){return Reflect.getOwnPropertyDescriptor(r._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(r,a){return sr(r).includes(a)},ownKeys(r){return sr(r)},set(r,a,l){const c=r._storage||(r._storage=s());return r[a]=c[a]=l,delete r._keys,!0}})}function Je(e,t,n,i){const s={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:ol(e,i),setContext:o=>Je(e,o,n,i),override:o=>Je(e.override(o),t,n,i)};return new Proxy(s,{deleteProperty(o,r){return delete o[r],delete e[r],!0},get(o,r,a){return rl(o,r,()=>gh(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(e,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,r)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(o,r){return Reflect.has(e,r)},ownKeys(){return Reflect.ownKeys(e)},set(o,r,a){return e[r]=a,delete o[r],!0}})}function ol(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=e;return{allKeys:s,scriptable:n,indexable:i,isScriptable:we(n)?n:()=>n,isIndexable:we(i)?i:()=>i}}const hh=(e,t)=>e?e+Ys(t):t,Zs=(e,t)=>W(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function rl(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];const i=n();return e[t]=i,i}function gh(e,t,n){const{_proxy:i,_context:s,_subProxy:o,_descriptors:r}=e;let a=i[t];return we(a)&&r.isScriptable(t)&&(a=ph(t,a,e,n)),ot(a)&&a.length&&(a=mh(t,a,e,r.isIndexable)),Zs(t,a)&&(a=Je(a,s,o&&o[t],r)),a}function ph(e,t,n,i){const{_proxy:s,_context:o,_subProxy:r,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);return a.add(e),t=t(o,r||i),a.delete(e),Zs(e,t)&&(t=Js(s._scopes,s,e,t)),t}function mh(e,t,n,i){const{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=n;if(Ut(o.index)&&i(e))t=t[o.index%t.length];else if(W(t[0])){const l=t,c=s._scopes.filter(u=>u!==l);t=[];for(const u of l){const f=Js(c,s,e,u);t.push(Je(f,o,r&&r[e],a))}}return t}function al(e,t,n){return we(e)?e(t,n):e}const _h=(e,t)=>e===!0?t:typeof e=="string"?Ze(t,e):void 0;function bh(e,t,n,i,s){for(const o of t){const r=_h(n,o);if(r){e.add(r);const a=al(r._fallback,n,s);if(Ut(a)&&a!==n&&a!==i)return a}else if(r===!1&&Ut(i)&&n!==i)return null}return!1}function Js(e,t,n,i){const s=t._rootScopes,o=al(t._fallback,n,i),r=[...e,...s],a=new Set;a.add(i);let l=ir(a,r,n,o||n,i);return l===null||Ut(o)&&o!==n&&(l=ir(a,r,o,l,i),l===null)?!1:Qs(Array.from(a),[""],s,o,()=>yh(t,n,i))}function ir(e,t,n,i,s){for(;n;)n=bh(e,t,n,i,s);return n}function yh(e,t,n){const i=e._getTarget();t in i||(i[t]={});const s=i[t];return ot(s)&&W(n)?n:s||{}}function vh(e,t,n,i){let s;for(const o of t)if(s=ll(hh(o,e),n),Ut(s))return Zs(e,s)?Js(n,i,e,s):s}function ll(e,t){for(const n of t){if(!n)continue;const i=n[e];if(Ut(i))return i}}function sr(e){let t=e._keys;return t||(t=e._keys=xh(e._scopes)),t}function xh(e){const t=new Set;for(const n of e)for(const i of Object.keys(n).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function wh(e,t,n,i){const{iScale:s}=e,{key:o="r"}=this._parsing,r=new Array(i);let a,l,c,u;for(a=0,l=i;ae.ownerDocument.defaultView.getComputedStyle(e,null);function Sh(e,t){return Li(e).getPropertyValue(t)}const Ch=["top","right","bottom","left"];function De(e,t,n){const i={};n=n?"-"+n:"";for(let s=0;s<4;s++){const o=Ch[s];i[o]=parseFloat(e[t+"-"+o+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Mh=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function kh(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:s,offsetY:o}=i;let r=!1,a,l;if(Mh(s,o,e.target))a=s,l=o;else{const c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function Ae(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:i}=t,s=Li(n),o=s.boxSizing==="border-box",r=De(s,"padding"),a=De(s,"border","width"),{x:l,y:c,box:u}=kh(e,n),f=r.left+(u&&a.left),d=r.top+(u&&a.top);let{width:h,height:g}=t;return o&&(h-=r.width+a.width,g-=r.height+a.height),{x:Math.round((l-f)/h*n.width/i),y:Math.round((c-d)/g*n.height/i)}}function Rh(e,t,n){let i,s;if(t===void 0||n===void 0){const o=to(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{const r=o.getBoundingClientRect(),a=Li(o),l=De(a,"border","width"),c=De(a,"padding");t=r.width-c.width-l.width,n=r.height-c.height-l.height,i=wi(a.maxWidth,o,"clientWidth"),s=wi(a.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:i||_i,maxHeight:s||_i}}const Nn=e=>Math.round(e*10)/10;function $h(e,t,n,i){const s=Li(e),o=De(s,"margin"),r=wi(s.maxWidth,e,"clientWidth")||_i,a=wi(s.maxHeight,e,"clientHeight")||_i,l=Rh(e,t,n);let{width:c,height:u}=l;if(s.boxSizing==="content-box"){const d=De(s,"border","width"),h=De(s,"padding");c-=h.width+d.width,u-=h.height+d.height}return c=Math.max(0,c-o.width),u=Math.max(0,i?c/i:u-o.height),c=Nn(Math.min(c,r,l.maxWidth)),u=Nn(Math.min(u,a,l.maxHeight)),c&&!u&&(u=Nn(c/2)),(t!==void 0||n!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=Nn(Math.floor(u*i))),{width:c,height:u}}function or(e,t,n){const i=t||1,s=Math.floor(e.height*i),o=Math.floor(e.width*i);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const r=e.canvas;return r.style&&(n||!r.style.height&&!r.style.width)&&(r.style.height=`${e.height}px`,r.style.width=`${e.width}px`),e.currentDevicePixelRatio!==i||r.height!==s||r.width!==o?(e.currentDevicePixelRatio=i,r.height=s,r.width=o,e.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Ah=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return e}();function rr(e,t){const n=Sh(e,t),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}const Ph=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,i){return n-i},leftForLtr(n,i){return n-i}}},Fh=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function ts(e,t,n){return e?Ph(t,n):Fh()}function Dh(e,t){let n,i;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=i)}function Oh(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}/*! - * Chart.js v4.2.1 - * https://www.chartjs.org - * (c) 2023 Chart.js Contributors - * Released under the MIT License - */class Eh{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,i,s){const o=n.listeners[s],r=n.duration;o.forEach(a=>a({chart:t,initial:n.initial,numSteps:r,currentStep:Math.min(i-n.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=Qa.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const o=i.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),o.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),n+=o.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let i=n.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,i)),i}listen(t,n,i){this._getAnims(t).listeners[n].push(i)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const i=n.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var se=new Eh;const ar="transparent",Lh={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=Jo(e||ar),s=i.valid&&Jo(t||ar);return s&&s.valid?s.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class Th{constructor(t,n,i,s){const o=n[i];s=Hn([t.to,s,o,t.from]);const r=Hn([t.from,o,s]);this._active=!0,this._fn=t.fn||Lh[t.type||typeof r],this._easing=_n[t.easing]||_n.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=i,this._from=r,this._to=s,this._promises=void 0}active(){return this._active}update(t,n,i){if(this._active){this._notify(!1);const s=this._target[this._prop],o=i-this._start,r=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Hn([t.to,n,s,t.from]),this._from=Hn([t.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,i=this._duration,s=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||n1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,i)=>{t.push({res:n,rej:i})})}_notify(t){const n=t?"res":"rej",i=this._promises||[];for(let s=0;s{const o=t[s];if(!W(o))return;const r={};for(const a of n)r[a]=o[a];(ot(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,r)})})}_animateOptions(t,n){const i=n.options,s=Vh(t,i);if(!s)return[];const o=this._createAnimations(s,i);return i.$shared&&Ih(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,n){const i=this._properties,s=[],o=t.$animations||(t.$animations={}),r=Object.keys(n),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,n));continue}const u=n[c];let f=o[c];const d=i.get(c);if(f)if(d&&f.active()){f.update(d,u,a);continue}else f.cancel();if(!d||!d.duration){t[c]=u;continue}o[c]=f=new Th(d,t,c,u),s.push(f)}return s}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const i=this._createAnimations(t,n);if(i.length)return se.add(this._chart,i),!0}}function Ih(e,t){const n=[],i=Object.keys(t);for(let s=0;s0||!n&&o<0)return s.index}return null}function dr(e,t){const{chart:n,_cachedMeta:i}=e,s=n._stacks||(n._stacks={}),{iScale:o,vScale:r,index:a}=i,l=o.axis,c=r.axis,u=Bh(o,r,i),f=t.length;let d;for(let h=0;hn[i].axis===t).shift()}function Gh(e,t){return Ie(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function qh(e,t,n){return Ie(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function on(e,t){const n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(const s of t){const o=s._stacks;if(!o||o[i]===void 0||o[i][n]===void 0)return;delete o[i][n],o[i]._visualValues!==void 0&&o[i]._visualValues[n]!==void 0&&delete o[i]._visualValues[n]}}}const ns=e=>e==="reset"||e==="none",hr=(e,t)=>t?e:Object.assign({},e),Yh=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:fl(n,!0),values:null};class Ue{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=ur(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&on(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,i=this.getDataset(),s=(f,d,h,g)=>f==="x"?d:f==="r"?g:h,o=n.xAxisID=et(i.xAxisID,es(t,"x")),r=n.yAxisID=et(i.yAxisID,es(t,"y")),a=n.rAxisID=et(i.rAxisID,es(t,"r")),l=n.indexAxis,c=n.iAxisID=s(l,o,r,a),u=n.vAxisID=s(l,r,o,a);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(r),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Ko(this._data,this),t._stacked&&on(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(W(n))this._data=Nh(n);else if(i!==n){if(i){Ko(i,this);const s=this._cachedMeta;on(s),s._parsed=[]}n&&Object.isExtensible(n)&&Wd(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const o=n._stacked;n._stacked=ur(n.vScale,n),n.stack!==i.stack&&(s=!0,on(n),n.stack=i.stack),this._resyncElements(t),(s||o!==n._stacked)&&dr(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:i,_data:s}=this,{iScale:o,_stacked:r}=i,a=o.axis;let l=t===0&&n===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,f,d;if(this._parsing===!1)i._parsed=s,i._sorted=!0,d=s;else{ot(s[t])?d=this.parseArrayData(i,s,t,n):W(s[t])?d=this.parseObjectData(i,s,t,n):d=this.parsePrimitiveData(i,s,t,n);const h=()=>f[a]===null||c&&f[a]p||f=0;--d)if(!g()){this.updateRangeFromParsed(c,t,h,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,i=[];let s,o,r;for(s=0,o=n.length;s=0&&tthis.getContext(i,s,n),p=c.resolveNamedOptions(d,h,g,f);return p.$shared&&(p.$shared=l,o[r]=Object.freeze(hr(p,l))),p}_resolveAnimations(t,n,i){const s=this.chart,o=this._cachedDataOpts,r=`animation-${n}`,a=o[r];if(a)return a;let l;if(s.options.animation!==!1){const u=this.chart.config,f=u.datasetAnimationScopeKeys(this._type,n),d=u.getOptionScopes(this.getDataset(),f);l=u.createResolver(d,this.getContext(t,i,n))}const c=new ul(s,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||ns(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const i=this.resolveDataElementOptions(t,n),s=this._sharedOptions,o=this.getSharedOptions(i),r=this.includeOptions(n,o)||o!==s;return this.updateSharedOptions(o,n,i),{sharedOptions:o,includeOptions:r}}updateElement(t,n,i,s){ns(s)?Object.assign(t,i):this._resolveAnimations(n,s).update(t,i)}updateSharedOptions(t,n,i){t&&!ns(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,s){t.active=s;const o=this.getStyle(n,s);this._resolveAnimations(n,i,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,n,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,n,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,i=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=i.length,o=n.length,r=Math.min(o,s);r&&this.parse(0,r),o>s?this._insertElements(s,o-s,t):o{for(c.length+=n,a=c.length-1;a>=r;a--)c[a]=c[a-n]};for(l(o),a=t;avi(y,a,l,!0)?1:Math.max(x,x*n,v,v*n),g=(y,x,v)=>vi(y,a,l,!0)?-1:Math.min(x,x*n,v,v*n),p=h(0,c,f),m=h(lt,u,d),_=g(ct,c,f),b=g(ct+lt,u,d);i=(p-_)/2,s=(m-b)/2,o=-(p+_)/2,r=-(m+b)/2}return{ratioX:i,ratioY:s,offsetX:o,offsetY:r}}class We extends Ue{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let o=l=>+i[l];if(W(i[t])){const{key:l="value"}=this._parsing;o=c=>+Ze(i[c],l)}let r,a;for(r=t,a=t+n;r0&&!isNaN(t)?at*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=$n(n._parsed[t],i.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let n=0;const i=this.chart;let s,o,r,a,l;if(!t){for(s=0,o=i.data.datasets.length;st!=="spacing",_indexable:t=>t!=="spacing"}),H(We,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return n.labels.map((o,r)=>{const l=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}}});class Jn extends Ue{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=$n(n._parsed[t].r,i.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,n,i,s){return wh.bind(this)(t,n,i,s)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{const o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(on.max&&(n.max=o))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,i=t.options,s=Math.min(n.right-n.left,n.bottom-n.top),o=Math.max(s/2,0),r=Math.max(i.cutoutPercentage?o/100*i.cutoutPercentage:1,0),a=(o-r)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,i,s){const o=s==="reset",r=this.chart,l=r.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,f=c.yCenter,d=c.getIndexAngle(0)-.5*ct;let h=d,g;const p=360/this.countVisibleElements();for(g=0;g{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&n++}),n}_computeAngle(t,n,i){return this.chart.getDataVisibility(t)?jt(this.resolveDataElementOptions(t,n).angle||i):0}}H(Jn,"id","polarArea"),H(Jn,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),H(Jn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return n.labels.map((o,r)=>{const l=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class ks extends We{}H(ks,"id","pie"),H(ks,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});function Re(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class eo{static override(t){Object.assign(eo.prototype,t)}constructor(t){this.options=t||{}}init(){}formats(){return Re()}parse(){return Re()}format(){return Re()}add(){return Re()}diff(){return Re()}startOf(){return Re()}endOf(){return Re()}}var Xh={_date:eo};function Kh(e,t,n,i){const{controller:s,data:o,_sorted:r}=e,a=s._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const l=a._reversePixels?Bd:Ss;if(i){if(s._sharedOptions){const c=o[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const f=l(o,t,n-u),d=l(o,t,n+u);return{lo:f.lo,hi:d.hi}}}}else return l(o,t,n)}return{lo:0,hi:o.length-1}}function An(e,t,n,i,s){const o=e.getSortedVisibleDatasetMetas(),r=n[t];for(let a=0,l=o.length;a{l[r](t[n],s)&&(o.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,s))}),i&&!a?[]:o}var tg={evaluateInteractionItems:An,modes:{index(e,t,n,i){const s=Ae(t,e),o=n.axis||"x",r=n.includeInvisible||!1,a=n.intersect?is(e,s,o,i,r):ss(e,s,o,!1,i,r),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,f=c.data[u];f&&!f.skip&&l.push({element:f,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,i){const s=Ae(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;let a=n.intersect?is(e,s,o,i,r):ss(e,s,o,!1,i,r);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;un.pos===t)}function pr(e,t){return e.filter(n=>dl.indexOf(n.pos)===-1&&n.box.axis===t)}function an(e,t){return e.sort((n,i)=>{const s=t?i:n,o=t?n:i;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function eg(e){const t=[];let n,i,s,o,r,a;for(n=0,i=(e||[]).length;nc.box.fullSize),!0),i=an(rn(t,"left"),!0),s=an(rn(t,"right")),o=an(rn(t,"top"),!0),r=an(rn(t,"bottom")),a=pr(t,"x"),l=pr(t,"y");return{fullSize:n,leftAndTop:i.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:rn(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}function mr(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function hl(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function og(e,t,n,i){const{pos:s,box:o}=n,r=e.maxPadding;if(!W(s)){n.size&&(e[s]-=n.size);const f=i[n.stack]||{size:0,count:1};f.size=Math.max(f.size,n.horizontal?o.height:o.width),n.size=f.size/f.count,e[s]+=n.size}o.getPadding&&hl(r,o.getPadding());const a=Math.max(0,t.outerWidth-mr(r,e,"left","right")),l=Math.max(0,t.outerHeight-mr(r,e,"top","bottom")),c=a!==e.w,u=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function rg(e){const t=e.maxPadding;function n(i){const s=Math.max(t[i]-e[i],0);return e[i]+=s,s}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function ag(e,t){const n=t.maxPadding;function i(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(r=>{o[r]=Math.max(t[r],n[r])}),o}return i(e?["left","right"]:["top","bottom"])}function fn(e,t,n,i){const s=[];let o,r,a,l,c,u;for(o=0,r=e.length,c=0;o{typeof p.beforeLayout=="function"&&p.beforeLayout()});const u=l.reduce((p,m)=>m.box.options&&m.box.options.display===!1?p:p+1,0)||1,f=Object.freeze({outerWidth:t,outerHeight:n,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/u,hBoxMaxHeight:r/2}),d=Object.assign({},s);hl(d,$t(i));const h=Object.assign({maxPadding:d,w:o,h:r,x:s.left,y:s.top},s),g=ig(l.concat(c),f);fn(a.fullSize,h,f,g),fn(l,h,f,g),fn(c,h,f,g)&&fn(l,h,f,g),rg(h),_r(a.leftAndTop,h,f,g),h.x+=h.w,h.y+=h.h,_r(a.rightAndBottom,h,f,g),e.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},G(a.chartArea,p=>{const m=p.box;Object.assign(m,e.chartArea),m.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class gl{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,i){}removeEventListener(t,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,i,s){return n=Math.max(0,n||t.width),i=i||t.height,{width:n,height:Math.max(0,s?Math.floor(n/s):i)}}isAttached(t){return!0}updateConfig(t){}}class lg extends gl{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const ti="$chartjs",cg={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},br=e=>e===null||e==="";function ug(e,t){const n=e.style,i=e.getAttribute("height"),s=e.getAttribute("width");if(e[ti]={initial:{height:i,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",br(s)){const o=rr(e,"width");o!==void 0&&(e.width=o)}if(br(i))if(e.style.height==="")e.height=e.width/(t||2);else{const o=rr(e,"height");o!==void 0&&(e.height=o)}return e}const pl=Ah?{passive:!0}:!1;function fg(e,t,n){e.addEventListener(t,n,pl)}function dg(e,t,n){e.canvas.removeEventListener(t,n,pl)}function hg(e,t){const n=cg[e.type]||e.type,{x:i,y:s}=Ae(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Si(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function gg(e,t,n){const i=e.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Si(a.addedNodes,i),r=r&&!Si(a.removedNodes,i);r&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function pg(e,t,n){const i=e.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Si(a.removedNodes,i),r=r&&!Si(a.addedNodes,i);r&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const Cn=new Map;let yr=0;function ml(){const e=window.devicePixelRatio;e!==yr&&(yr=e,Cn.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function mg(e,t){Cn.size||window.addEventListener("resize",ml),Cn.set(e,t)}function _g(e){Cn.delete(e),Cn.size||window.removeEventListener("resize",ml)}function bg(e,t,n){const i=e.canvas,s=i&&to(i);if(!s)return;const o=Za((a,l)=>{const c=s.clientWidth;n(a,l),c{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||o(c,u)});return r.observe(s),mg(e,o),r}function os(e,t,n){n&&n.disconnect(),t==="resize"&&_g(e)}function yg(e,t,n){const i=e.canvas,s=Za(o=>{e.ctx!==null&&n(hg(o,e))},e);return fg(i,t,s),s}class vg extends gl{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(ug(t,n),i):null}releaseContext(t){const n=t.canvas;if(!n[ti])return!1;const i=n[ti].initial;["height","width"].forEach(o=>{const r=i[o];tt(r)?n.removeAttribute(o):n.setAttribute(o,r)});const s=i.style||{};return Object.keys(s).forEach(o=>{n.style[o]=s[o]}),n.width=n.width,delete n[ti],!0}addEventListener(t,n,i){this.removeEventListener(t,n);const s=t.$proxies||(t.$proxies={}),r={attach:gg,detach:pg,resize:bg}[n]||yg;s[n]=r(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),s=i[n];if(!s)return;({attach:os,detach:os,resize:os}[n]||dg)(t,n,s),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,s){return $h(t,n,i,s)}isAttached(t){const n=to(t);return!!(n&&n.isConnected)}}function xg(e){return!cl()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?lg:vg}var Xn;let Pn=(Xn=class{constructor(){H(this,"active",!1)}tooltipPosition(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}hasValue(){return yi(this.x)&&yi(this.y)}getProps(t,n){const i=this.$animations;if(!n||!i)return this;const s={};return t.forEach(o=>{s[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),s}},H(Xn,"defaults",{}),H(Xn,"defaultRoutes"),Xn);function wg(e,t){const n=e.options.ticks,i=Sg(e),s=Math.min(n.maxTicksLimit||i,i),o=n.major.enabled?Mg(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>s)return kg(t,c,o,r/s),c;const u=Cg(o,t,s);if(r>0){let f,d;const h=r>1?Math.round((l-a)/(r-1)):null;for(jn(t,c,u,tt(h)?0:a-h,a),f=0,d=r-1;fs)return l}return Math.max(s,1)}function Mg(e){const t=[];let n,i;for(n=0,i=e.length;ne==="left"?"right":e==="right"?"left":e,vr=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,xr=(e,t)=>Math.min(t||e,e);function wr(e,t){const n=[],i=e.length/t,s=e.length;let o=0;for(;or+a)))return l}function Pg(e,t){G(e,n=>{const i=n.gc,s=i.length/2;let o;if(s>t){for(o=0;oi?i:n,i=s&&n>i?n:i,{min:St(n,St(i,n)),max:St(i,St(n,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){rt(this.options.beforeUpdate,[this])}update(t,n,i){const{beginAtZero:s,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=dh(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a=o||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),f=u.widest.width,d=u.highest.height,h=Mt(this.chart.width-f,0,this.maxWidth);a=t.offset?this.maxWidth/i:h/(i-1),f+6>a&&(a=h/(i-(t.offset?.5:1)),l=this.maxHeight-ln(t.grid)-n.padding-Sr(t.title,this.chart.options.font),c=Math.sqrt(f*f+d*d),r=Us(Math.min(Math.asin(Mt((u.highest.height+6)/a,-1,1)),Math.asin(Mt(l/c,-1,1))-Math.asin(Mt(d/c,-1,1)))),r=Math.max(s,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){rt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){rt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:i,title:s,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=Sr(s,n.options.font);if(a?(t.width=this.maxWidth,t.height=ln(o)+l):(t.height=this.maxHeight,t.width=ln(o)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:f,highest:d}=this._getLabelSizes(),h=i.padding*2,g=jt(this.labelRotation),p=Math.cos(g),m=Math.sin(g);if(a){const _=i.mirror?0:m*f.width+p*d.height;t.height=Math.min(this.maxHeight,t.height+_+h)}else{const _=i.mirror?0:p*f.width+m*d.height;t.width=Math.min(this.maxWidth,t.width+_+h)}this._calculatePadding(c,u,m,p)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,i,s){const{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,h=0;l?c?(d=s*t.width,h=i*n.height):(d=i*t.height,h=s*n.width):o==="start"?h=n.width:o==="end"?d=t.width:o!=="inner"&&(d=t.width/2,h=n.width/2),this.paddingLeft=Math.max((d-u+r)*this.width/(this.width-u),0),this.paddingRight=Math.max((h-f+r)*this.width/(this.width-f),0)}else{let u=n.height/2,f=t.height/2;o==="start"?(u=0,f=t.height):o==="end"&&(u=n.height,f=0),this.paddingTop=u+r,this.paddingBottom=f+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){rt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,i;for(n=0,i=t.length;n({width:r[P]||0,height:a[P]||0});return{first:$(0),last:$(n-1),widest:$(R),highest:$(k),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return Hd(this._alignToPixels?ke(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&ta*s?a/i:l/s:l*s0}_computeGridLineItems(t){const n=this.axis,i=this.chart,s=this.options,{grid:o,position:r,border:a}=s,l=o.offset,c=this.isHorizontal(),f=this.ticks.length+(l?1:0),d=ln(o),h=[],g=a.setContext(this.getContext()),p=g.display?g.width:0,m=p/2,_=function(z){return ke(i,z,p)};let b,y,x,v,R,k,$,P,F,M,O,K;if(r==="top")b=_(this.bottom),k=this.bottom-d,P=b-m,M=_(t.top)+m,K=t.bottom;else if(r==="bottom")b=_(this.top),M=t.top,K=_(t.bottom)-m,k=b+m,P=this.top+d;else if(r==="left")b=_(this.right),R=this.right-d,$=b-m,F=_(t.left)+m,O=t.right;else if(r==="right")b=_(this.left),F=t.left,O=_(t.right)-m,R=b+m,$=this.left+d;else if(n==="x"){if(r==="center")b=_((t.top+t.bottom)/2+.5);else if(W(r)){const z=Object.keys(r)[0],B=r[z];b=_(this.chart.scales[z].getPixelForValue(B))}M=t.top,K=t.bottom,k=b+m,P=k+d}else if(n==="y"){if(r==="center")b=_((t.left+t.right)/2);else if(W(r)){const z=Object.keys(r)[0],B=r[z];b=_(this.chart.scales[z].getPixelForValue(B))}R=b-m,$=R-d,F=t.left,O=t.right}const Z=et(s.ticks.maxTicksLimit,f),T=Math.max(1,Math.ceil(f/Z));for(y=0;yo.value===t);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const n=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(n.display)for(o=0,r=s.length;o{this.draw(o)}}]:[{z:i,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let o,r;for(o=0,r=n.length;o{const i=n.split("."),s=i.pop(),o=[e].concat(i).join("."),r=t[n].split("."),a=r.pop(),l=r.join(".");ut.route(o,s,l,a)})}function Ig(e){return"id"in e&&"defaults"in e}class Vg{constructor(){this.controllers=new Wn(Ue,"datasets",!0),this.elements=new Wn(Pn,"elements"),this.plugins=new Wn(Object,"plugins"),this.scales=new Wn(Ve,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,i){[...n].forEach(s=>{const o=i||this._getRegistryForType(s);i||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):G(s,r=>{const a=i||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,n,i){const s=Ys(t);rt(i["before"+s],[],i),n[t](i),rt(i["after"+s],[],i)}_getRegistryForType(t){for(let n=0;no.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(s(n,i),t,"stop"),this._notify(s(i,n),t,"start")}}function Hg(e){const t={},n=[],i=Object.keys(Qt.plugins.items);for(let o=0;o1&&Ci(e[0].toLowerCase(),t),e))return e;throw new Error(`Cannot determine type of '${name}' axis. Please provide 'axis' or 'position' option.`)}function Yg(e,t){const n=Te[e.type]||{scales:{}},i=t.scales||{},s=Rs(e.type,t),o=Object.create(null);return Object.keys(i).forEach(r=>{const a=i[r];if(!W(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const l=Ci(r,a),c=Gg(l,s),u=n.scales||{};o[r]=pn(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(r=>{const a=r.type||e.type,l=r.indexAxis||Rs(a,t),u=(Te[a]||{}).scales||{};Object.keys(u).forEach(f=>{const d=Wg(f,l),h=r[d+"AxisID"]||d;o[h]=o[h]||Object.create(null),pn(o[h],[{axis:d},i[h],u[f]])})}),Object.keys(o).forEach(r=>{const a=o[r];pn(a,[ut.scales[a.type],ut.scale])}),o}function _l(e){const t=e.options||(e.options={});t.plugins=et(t.plugins,{}),t.scales=Yg(e,t)}function bl(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function Ug(e){return e=e||{},e.data=bl(e.data),_l(e),e}const Cr=new Map,yl=new Set;function Gn(e,t){let n=Cr.get(e);return n||(n=t(),Cr.set(e,n),yl.add(n)),n}const cn=(e,t,n)=>{const i=Ze(t,n);i!==void 0&&e.add(i)};class Xg{constructor(t){this._config=Ug(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=bl(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),_l(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Gn(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return Gn(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return Gn(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return Gn(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const i=this._scopeCache;let s=i.get(t);return(!s||n)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,n,i){const{options:s,type:o}=this,r=this._cachedScopes(t,i),a=r.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(f=>cn(l,t,f))),u.forEach(f=>cn(l,s,f)),u.forEach(f=>cn(l,Te[o]||{},f)),u.forEach(f=>cn(l,ut,f)),u.forEach(f=>cn(l,Cs,f))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),yl.has(n)&&r.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Te[n]||{},ut.datasets[n]||{},{type:n},ut,Cs]}resolveNamedOptions(t,n,i,s=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=Mr(this._resolverCache,t,s);let l=r;if(Qg(r,n)){o.$shared=!1,i=we(i)?i():i;const c=this.createResolver(t,i,a);l=Je(r,i,c)}for(const c of n)o[c]=l[c];return o}createResolver(t,n,i=[""],s){const{resolver:o}=Mr(this._resolverCache,t,i);return W(n)?Je(o,n,void 0,s):o}}function Mr(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));const s=n.join();let o=i.get(s);return o||(o={resolver:Qs(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,o)),o}const Kg=e=>W(e)&&Object.getOwnPropertyNames(e).reduce((t,n)=>t||we(e[n]),!1);function Qg(e,t){const{isScriptable:n,isIndexable:i}=ol(e);for(const s of t){const o=n(s),r=i(s),a=(r||o)&&e[s];if(o&&(we(a)||Kg(a))||r&&ot(a))return!0}return!1}var Zg="4.2.1";const Jg=["top","bottom","left","right","chartArea"];function kr(e,t){return e==="top"||e==="bottom"||Jg.indexOf(e)===-1&&t==="x"}function Rr(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function $r(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),rt(n&&n.onComplete,[e],t)}function tp(e){const t=e.chart,n=t.options.animation;rt(n&&n.onProgress,[e],t)}function vl(e){return cl()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const ei={},Ar=e=>{const t=vl(e);return Object.values(ei).filter(n=>n.canvas===t).pop()};function ep(e,t,n){const i=Object.keys(e);for(const s of i){const o=+s;if(o>=t){const r=e[s];delete e[s],(n>0||o>t)&&(e[o+n]=r)}}}function np(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}function ip(e){const{xScale:t,yScale:n}=e;if(t&&n)return{left:t.left,right:t.right,top:n.top,bottom:n.bottom}}var de;let Ti=(de=class{static register(...t){Qt.add(...t),Pr()}static unregister(...t){Qt.remove(...t),Pr()}constructor(t,n){const i=this.config=new Xg(n),s=vl(t),o=Ar(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||xg(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=Ad(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new zg,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=qd(f=>this.update(f),r.resizeDelay||0),this._dataChanges=[],ei[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}se.listen(this,"complete",$r),se.listen(this,"progress",tp),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:s,_aspectRatio:o}=this;return tt(t)?n&&o?o:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Qt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():or(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return er(this.canvas,this.ctx),this}stop(){return se.stop(this),this}resize(t,n){se.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const i=this.options,s=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(s,t,n,o),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,or(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),rt(i.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};G(n,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,n=t.scales,i=this.scales,s=Object.keys(i).reduce((r,a)=>(r[a]=!1,r),{});let o=[];n&&(o=o.concat(Object.keys(n).map(r=>{const a=n[r],l=Ci(r,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),G(o,r=>{const a=r.options,l=a.id,c=Ci(l,a),u=et(a.type,r.dtype);(a.position===void 0||kr(a.position,c)!==kr(r.dposition))&&(a.position=r.dposition),s[l]=!0;let f=null;if(l in i&&i[l].type===u)f=i[l];else{const d=Qt.getScale(u);f=new d({id:l,type:u,ctx:this.ctx,chart:this}),i[f.id]=f}f.init(a,t)}),G(s,(r,a)=>{r||delete i[a]}),G(i,r=>{me.configure(this,r,r.options),me.addBox(this,r)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,i=t.length;if(t.sort((s,o)=>s.index-o.index),i>n){for(let s=n;sn.length&&delete this._stacks,t.forEach((i,s)=>{n.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=n.length;i{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const i=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,u=this.data.datasets.length;c{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Rr("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){G(this.scales,t=>{me.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!qo(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:o}of n){const r=i==="_removeElements"?-o:o;ep(t,s,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,i=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),s=i(0);for(let o=1;oo.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;me.update(this,this.width,this.height,t);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],G(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,i=this.data.datasets.length;n=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,i=t._clip,s=!i.disabled,o=ip(t)||this.chartArea,r={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(s&&il(n,{left:i.left===!1?0:o.left-i.left,right:i.right===!1?this.width:o.right+i.right,top:i.top===!1?0:o.top-i.top,bottom:i.bottom===!1?this.height:o.bottom+i.bottom}),t.controller.draw(),s&&sl(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return nl(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,s){const o=tg.modes[n];return typeof o=="function"?o(this,t,i,s):[]}getDatasetMeta(t){const n=this.data.datasets[t],i=this._metasets;let s=i.filter(o=>o&&o._dataset===n).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Ie(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){const i=this.getDatasetMeta(t);i.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,i){const s=i?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,s);Ut(n)?(o.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),r.update(o,{visible:i}),this.update(a=>a.datasetIndex===t?s:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),se.remove(this),t=0,n=this.data.datasets.length;t{n.addEventListener(this,o,r),t[o]=r},s=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};G(this.options.events,o=>i(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,i=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let r;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",o),i("detach",r)};r=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),i("attach",a)},n.isAttached(this.canvas)?a():r()}unbindEvents(){G(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},G(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){const s=i?"set":"remove";let o,r,a,l;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!pi(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(t,n,i){return this._plugins.notify(this,t,n,i)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,i){const s=this.options.hover,o=(l,c)=>l.filter(u=>!c.some(f=>u.datasetIndex===f.datasetIndex&&u.index===f.index)),r=o(n,t),a=i?t:o(t,n);r.length&&this.updateHoverStyle(r,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,n){const i={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},s=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const o=this._handleEvent(t,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(o||i.changed)&&this.render(),this}_handleEvent(t,n,i){const{_active:s=[],options:o}=this,r=n,a=this._getActiveElements(t,s,i,r),l=Ld(t),c=np(t,this._lastEvent,i,l);i&&(this._lastEvent=null,rt(o.onHover,[t,a,this],this),l&&rt(o.onClick,[t,a,this],this));const u=!pi(a,s);return(u||n)&&(this._active=a,this._updateHoverStyles(a,s,n)),this._lastEvent=c,u}_getActiveElements(t,n,i,s){if(t.type==="mouseout")return[];if(!i)return n;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}},H(de,"defaults",ut),H(de,"instances",ei),H(de,"overrides",Te),H(de,"registry",Qt),H(de,"version",Zg),H(de,"getChart",Ar),de);function Pr(){return G(Ti.instances,e=>e._plugins.invalidate())}function sp(e,t,n){const{startAngle:i,pixelMargin:s,x:o,y:r,outerRadius:a,innerRadius:l}=t;let c=s/a;e.beginPath(),e.arc(o,r,a,i-c,n+c),l>s?(c=s/l,e.arc(o,r,l,n+c,i-c,!0)):e.arc(o,r,s,n+lt,i-lt),e.closePath(),e.clip()}function op(e){return Ks(e,["outerStart","outerEnd","innerStart","innerEnd"])}function rp(e,t,n,i){const s=op(e.options.borderRadius),o=(n-t)/2,r=Math.min(o,i*t/2),a=l=>{const c=(n-Math.min(o,l))*i/2;return Mt(l,0,Math.min(o,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:Mt(s.innerStart,0,r),innerEnd:Mt(s.innerEnd,0,r)}}function Be(e,t,n,i){return{x:n+e*Math.cos(t),y:i+e*Math.sin(t)}}function Mi(e,t,n,i,s,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,f=Math.max(t.outerRadius+i+n-c,0),d=u>0?u+i+n+c:0;let h=0;const g=s-l;if(i){const T=u>0?u-i:0,z=f>0?f-i:0,B=(T+z)/2,ft=B!==0?g*B/(B+i):g;h=(g-ft)/2}const p=Math.max(.001,g*f-n/ct)/f,m=(g-p)/2,_=l+m+h,b=s-m-h,{outerStart:y,outerEnd:x,innerStart:v,innerEnd:R}=rp(t,d,f,b-_),k=f-y,$=f-x,P=_+y/k,F=b-x/$,M=d+v,O=d+R,K=_+v/M,Z=b-R/O;if(e.beginPath(),o){const T=(P+F)/2;if(e.arc(r,a,f,P,T),e.arc(r,a,f,T,F),x>0){const st=Be($,F,r,a);e.arc(st.x,st.y,x,F,b+lt)}const z=Be(O,b,r,a);if(e.lineTo(z.x,z.y),R>0){const st=Be(O,Z,r,a);e.arc(st.x,st.y,R,b+lt,Z+Math.PI)}const B=(b-R/d+(_+v/d))/2;if(e.arc(r,a,d,b-R/d,B,!0),e.arc(r,a,d,B,_+v/d,!0),v>0){const st=Be(M,K,r,a);e.arc(st.x,st.y,v,K+Math.PI,_-lt)}const ft=Be(k,_,r,a);if(e.lineTo(ft.x,ft.y),y>0){const st=Be(k,P,r,a);e.arc(st.x,st.y,y,_-lt,P)}}else{e.moveTo(r,a);const T=Math.cos(P)*f+r,z=Math.sin(P)*f+a;e.lineTo(T,z);const B=Math.cos(F)*f+r,ft=Math.sin(F)*f+a;e.lineTo(B,ft)}e.closePath()}function ap(e,t,n,i,s){const{fullCircles:o,startAngle:r,circumference:a}=t;let l=t.endAngle;if(o){Mi(e,t,n,i,l,s);for(let c=0;c=at||vi(o,a,l),p=Nd(r,c+d,u+d);return g&&p}getCenterPoint(t){const{x:n,y:i,startAngle:s,endAngle:o,innerRadius:r,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:l,spacing:c}=this.options,u=(s+o)/2,f=(r+a+c+l)/2;return{x:n+Math.cos(u)*f,y:i+Math.sin(u)*f}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:n,circumference:i}=this,s=(n.offset||0)/4,o=(n.spacing||0)/2,r=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=i>at?Math.floor(i/at):0,i===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const a=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(a)*s,Math.sin(a)*s);const l=1-Math.sin(Math.min(ct,i||0)),c=s*l;t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,ap(t,this,c,o,r),lp(t,this,c,o,r),t.restore()}}H(ni,"id","arc"),H(ni,"defaults",{borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),H(ni,"defaultRoutes",{backgroundColor:"backgroundColor"});const $s=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],Fr=$s.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function xl(e){return $s[e%$s.length]}function wl(e){return Fr[e%Fr.length]}function cp(e,t){return e.borderColor=xl(t),e.backgroundColor=wl(t),++t}function up(e,t){return e.backgroundColor=e.data.map(()=>xl(t++)),t}function fp(e,t){return e.backgroundColor=e.data.map(()=>wl(t++)),t}function dp(e){let t=0;return(n,i)=>{const s=e.getDatasetMeta(i).controller;s instanceof We?t=up(n,t):s instanceof Jn?t=fp(n,t):s&&(t=cp(n,t))}}function Dr(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function hp(e){return e&&(e.borderColor||e.backgroundColor)}var gp={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:i},options:s}=e.config,{elements:o}=s;if(!n.forceOverride&&(Dr(i)||hp(s)||o&&Dr(o)))return;const r=dp(e);i.forEach(r)}};class Sl extends Pn{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const s=ot(i.text)?i.text.length:1;this._padding=$t(i.padding);const o=s*yt(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:i,bottom:s,right:o,options:r}=this,a=r.align;let l=0,c,u,f;return this.isHorizontal()?(u=mn(a,i,o),f=n+t,c=o-i):(r.position==="left"?(u=i+t,f=mn(a,s,n),l=ct*-.5):(u=o-t,f=mn(a,n,s),l=ct*.5),c=s-n),{titleX:u,titleY:f,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const i=yt(n.font),o=i.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);Sn(t,n.text,0,0,i,{color:n.color,maxWidth:l,rotation:c,textAlign:Ja(n.align),textBaseline:"middle",translation:[r,a]})}}function pp(e,t){const n=new Sl({ctx:e.ctx,options:t,chart:e});me.configure(e,n,t),me.addBox(e,n),e.titleBlock=n}var mp={id:"title",_element:Sl,start(e,t,n){pp(e,n)},stop(e){const t=e.titleBlock;me.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const i=e.titleBlock;me.configure(e,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const dn={average(e){if(!e.length)return!1;let t,n,i=0,s=0,o=0;for(t=0,n=e.length;t-1?e.split(` -`):e}function _p(e,t){const{element:n,datasetIndex:i,index:s}=t,o=e.getDatasetMeta(i).controller,{label:r,value:a}=o.getLabelAndValue(s);return{chart:e,label:r,parsed:o.getParsed(s),raw:e.data.datasets[i].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:i,element:n}}function Or(e,t){const n=e.chart.ctx,{body:i,footer:s,title:o}=e,{boxWidth:r,boxHeight:a}=t,l=yt(t.bodyFont),c=yt(t.titleFont),u=yt(t.footerFont),f=o.length,d=s.length,h=i.length,g=$t(t.padding);let p=g.height,m=0,_=i.reduce((x,v)=>x+v.before.length+v.lines.length+v.after.length,0);if(_+=e.beforeBody.length+e.afterBody.length,f&&(p+=f*c.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),_){const x=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;p+=h*x+(_-h)*l.lineHeight+(_-1)*t.bodySpacing}d&&(p+=t.footerMarginTop+d*u.lineHeight+(d-1)*t.footerSpacing);let b=0;const y=function(x){m=Math.max(m,n.measureText(x).width+b)};return n.save(),n.font=c.string,G(e.title,y),n.font=l.string,G(e.beforeBody.concat(e.afterBody),y),b=t.displayColors?r+2+t.boxPadding:0,G(i,x=>{G(x.before,y),G(x.lines,y),G(x.after,y)}),b=0,n.font=u.string,G(e.footer,y),n.restore(),m+=g.width,{width:m,height:p}}function bp(e,t){const{y:n,height:i}=t;return ne.height-i/2?"bottom":"center"}function yp(e,t,n,i){const{x:s,width:o}=i,r=n.caretSize+n.caretPadding;if(e==="left"&&s+o+r>t.width||e==="right"&&s-o-r<0)return!0}function vp(e,t,n,i){const{x:s,width:o}=n,{width:r,chartArea:{left:a,right:l}}=e;let c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),yp(c,e,t,n)&&(c="center"),c}function Er(e,t,n){const i=n.yAlign||t.yAlign||bp(e,n);return{xAlign:n.xAlign||t.xAlign||vp(e,t,n,i),yAlign:i}}function xp(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function wp(e,t,n){let{y:i,height:s}=e;return t==="top"?i+=n:t==="bottom"?i-=s+n:i-=s/2,i}function Lr(e,t,n,i){const{caretSize:s,caretPadding:o,cornerRadius:r}=e,{xAlign:a,yAlign:l}=n,c=s+o,{topLeft:u,topRight:f,bottomLeft:d,bottomRight:h}=yn(r);let g=xp(t,a);const p=wp(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(u,d)+s:a==="right"&&(g+=Math.max(f,h)+s),{x:Mt(g,0,i.width-t.width),y:Mt(p,0,i.height-t.height)}}function qn(e,t,n){const i=$t(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function Tr(e){return Kt([],oe(e))}function Sp(e,t,n){return Ie(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function Ir(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const Cl={beforeTitle:ie,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,i=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex"u"?Cl[t].call(n,i):s}class As extends Pn{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&n.options.animation&&i.animations,o=new ul(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Sp(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,s=vt(i,"beforeTitle",this,t),o=vt(i,"title",this,t),r=vt(i,"afterTitle",this,t);let a=[];return a=Kt(a,oe(s)),a=Kt(a,oe(o)),a=Kt(a,oe(r)),a}getBeforeBody(t,n){return Tr(vt(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,s=[];return G(t,o=>{const r={before:[],lines:[],after:[]},a=Ir(i,o);Kt(r.before,oe(vt(a,"beforeLabel",this,o))),Kt(r.lines,vt(a,"label",this,o)),Kt(r.after,oe(vt(a,"afterLabel",this,o))),s.push(r)}),s}getAfterBody(t,n){return Tr(vt(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:i}=n,s=vt(i,"beforeFooter",this,t),o=vt(i,"footer",this,t),r=vt(i,"afterFooter",this,t);let a=[];return a=Kt(a,oe(s)),a=Kt(a,oe(o)),a=Kt(a,oe(r)),a}_createItems(t){const n=this._active,i=this.chart.data,s=[],o=[],r=[];let a=[],l,c;for(l=0,c=n.length;lt.filter(u,f,d,i))),t.itemSort&&(a=a.sort((u,f)=>t.itemSort(u,f,i))),G(a,u=>{const f=Ir(t.callbacks,u);s.push(vt(f,"labelColor",this,u)),o.push(vt(f,"labelPointStyle",this,u)),r.push(vt(f,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,n){const i=this.options.setContext(this.getContext()),s=this._active;let o,r=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const a=dn[i.position].call(this,s,this._eventPosition);r=this._createItems(i),this.title=this.getTitle(r,i),this.beforeBody=this.getBeforeBody(r,i),this.body=this.getBody(r,i),this.afterBody=this.getAfterBody(r,i),this.footer=this.getFooter(r,i);const l=this._size=Or(this,i),c=Object.assign({},a,l),u=Er(this.chart,i,c),f=Lr(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:f.x,y:f.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,i,s){const o=this.getCaretPosition(t,i,s);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,i){const{xAlign:s,yAlign:o}=this,{caretSize:r,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:f}=yn(a),{x:d,y:h}=t,{width:g,height:p}=n;let m,_,b,y,x,v;return o==="center"?(x=h+p/2,s==="left"?(m=d,_=m-r,y=x+r,v=x-r):(m=d+g,_=m+r,y=x-r,v=x+r),b=m):(s==="left"?_=d+Math.max(l,u)+r:s==="right"?_=d+g-Math.max(c,f)-r:_=this.caretX,o==="top"?(y=h,x=y-r,m=_-r,b=_+r):(y=h+p,x=y+r,m=_+r,b=_-r),v=y),{x1:m,x2:_,x3:b,y1:y,y2:x,y3:v}}drawTitle(t,n,i){const s=this.title,o=s.length;let r,a,l;if(o){const c=ts(i.rtl,this.x,this.width);for(t.x=qn(this,i.titleAlign,i),n.textAlign=c.textAlign(i.titleAlign),n.textBaseline="middle",r=yt(i.titleFont),a=i.titleSpacing,n.fillStyle=i.titleColor,n.font=r.string,l=0;ly!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Ms(t,{x:m,y:p,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),Ms(t,{x:_,y:p+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(m,p,c,l),t.strokeRect(m,p,c,l),t.fillStyle=r.backgroundColor,t.fillRect(_,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){const{body:s}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,f=yt(i.bodyFont);let d=f.lineHeight,h=0;const g=ts(i.rtl,this.x,this.width),p=function($){n.fillText($,g.x(t.x+h),t.y+d/2),t.y+=d+o},m=g.textAlign(r);let _,b,y,x,v,R,k;for(n.textAlign=r,n.textBaseline="middle",n.font=f.string,t.x=qn(this,m,i),n.fillStyle=i.bodyColor,G(this.beforeBody,p),h=a&&m!=="right"?r==="center"?c/2+u:c+2+u:0,x=0,R=s.length;x0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,i=this.$animations,s=i&&i.x,o=i&&i.y;if(s||o){const r=dn[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=Or(this,t),l=Object.assign({},r,this._size),c=Er(n,t,l),u=Lr(t,l,c,n);(s._to!==u.x||o._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const r=$t(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,s,n),Dh(t,n.textDirection),o.y+=r.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),Oh(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const i=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!pi(i,s),r=this._positionChanged(s,n);(o||r)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],r=this._getActiveElements(t,o,n,i),a=this._positionChanged(r,t),l=n||!pi(r,o)||a;return l&&(this._active=r,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,i,s){const o=this.options;if(t.type==="mouseout")return[];if(!s)return n;const r=this.chart.getElementsAtEventForMode(t,o.mode,o,i);return o.reverse&&r.reverse(),r}_positionChanged(t,n){const{caretX:i,caretY:s,options:o}=this,r=dn[o.position].call(this,t,n);return r!==!1&&(i!==r.x||s!==r.y)}}H(As,"positioners",dn);var Cp={id:"tooltip",_element:As,positioners:dn,afterInit(e,t,n){n&&(e.tooltip=new As({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Cl},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const Mp=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function kp(e,t,n,i){const s=e.indexOf(t);if(s===-1)return Mp(e,t,n,i);const o=e.lastIndexOf(t);return s!==o?n:s}const Rp=(e,t)=>e===null?null:Mt(Math.round(e),0,t);function Vr(e){const t=this.getLabels();return e>=0&&en.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}H(Ps,"id","category"),H(Ps,"defaults",{ticks:{callback:Vr}});function $p(e,t){const n=[],{bounds:s,step:o,min:r,max:a,precision:l,count:c,maxTicks:u,maxDigits:f,includeBounds:d}=e,h=o||1,g=u-1,{min:p,max:m}=t,_=!tt(r),b=!tt(a),y=!tt(c),x=(m-p)/(f+1);let v=Uo((m-p)/g/h)*h,R,k,$,P;if(v<1e-14&&!_&&!b)return[{value:p},{value:m}];P=Math.ceil(m/v)-Math.floor(p/v),P>g&&(v=Uo(P*v/g/h)*h),tt(l)||(R=Math.pow(10,l),v=Math.ceil(v*R)/R),s==="ticks"?(k=Math.floor(p/v)*v,$=Math.ceil(m/v)*v):(k=p,$=m),_&&b&&o&&Vd((a-r)/o,v/1e3)?(P=Math.round(Math.min((a-r)/v,u)),v=(a-r)/P,k=r,$=a):y?(k=_?r:k,$=b?a:$,P=c-1,v=($-k)/P):(P=($-k)/v,Zn(P,Math.round(P),v/1e3)?P=Math.round(P):P=Math.ceil(P));const F=Math.max(Xo(v),Xo(k));R=Math.pow(10,tt(l)?F:l),k=Math.round(k*R)/R,$=Math.round($*R)/R;let M=0;for(_&&(d&&k!==r?(n.push({value:r}),ks=n?s:l,a=l=>o=i?o:l;if(t){const l=bi(s),c=bi(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(s===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||r(s-l)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,r=$p(s,o);return t.bounds==="ticks"&&Ua(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let n=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-n)/Math.max(t.length-1,1)/2;n-=s,i+=s}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(t){return $n(t,this.chart.options.locale,this.options.ticks.format)}}class Hr extends ki{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=dt(t)?t:0,this.max=dt(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,i=jt(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}H(Hr,"id","linear"),H(Hr,"defaults",{ticks:{callback:Ei.formatters.numeric}});const Mn=e=>Math.floor(pe(e)),$e=(e,t)=>Math.pow(10,Mn(e)+t);function Nr(e){return e/Math.pow(10,Mn(e))===1}function Br(e,t,n){const i=Math.pow(10,n),s=Math.floor(e/i);return Math.ceil(t/i)-s}function Ap(e,t){const n=t-e;let i=Mn(n);for(;Br(e,t,i)>10;)i++;for(;Br(e,t,i)<10;)i--;return Math.min(i,Mn(e))}function Pp(e,{min:t,max:n}){t=St(e.min,t);const i=[],s=Mn(t);let o=Ap(t,n),r=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((t-l)*r)/r,u=Math.floor((t-l)/a/10)*a*10;let f=Math.floor((c-u)/Math.pow(10,o)),d=St(e.min,Math.round((l+u+f*Math.pow(10,o))*r)/r);for(;d=10?f=f<15?15:20:f++,f>=20&&(o++,f=2,r=o>=0?1:r),d=Math.round((l+u+f*Math.pow(10,o))*r)/r;const h=St(e.max,d);return i.push({value:h,major:Nr(h),significand:f}),i}class jr extends Ve{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const i=ki.prototype.parse.apply(this,[t,n]);if(i===0){this._zero=!0;return}return dt(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=dt(t)?Math.max(0,t):null,this.max=dt(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!dt(this._userMin)&&(this.min=t===$e(this.min,0)?$e(this.min,-1):$e(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let i=this.min,s=this.max;const o=a=>i=t?i:a,r=a=>s=n?s:a;i===s&&(i<=0?(o(1),r(10)):(o($e(i,-1)),r($e(s,1)))),i<=0&&o($e(s,-1)),s<=0&&r($e(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},i=Pp(n,this);return t.bounds==="ticks"&&Ua(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":$n(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=pe(t),this._valueRange=pe(this.max)-pe(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(pe(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}H(jr,"id","logarithmic"),H(jr,"defaults",{ticks:{callback:Ei.formatters.logarithmic,major:{enabled:!0}}});function Fs(e){const t=e.ticks;if(t.display&&e.display){const n=$t(t.backdropPadding);return et(t.font&&t.font.size,ut.font.size)+n.height}return 0}function Fp(e,t,n){return n=ot(n)?n:[n],{w:nh(e,t.string,n),h:n.length*t.lineHeight}}function Wr(e,t,n,i,s){return e===i||e===s?{start:t-n/2,end:t+n/2}:es?{start:t-n,end:t}:{start:t,end:t+n}}function Dp(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),i=[],s=[],o=e._pointLabels.length,r=e.options.pointLabels,a=r.centerPointLabels?ct/o:0;for(let l=0;lt.r&&(a=(i.end-t.r)/o,e.r=Math.max(e.r,t.r+a)),s.startt.b&&(l=(s.end-t.b)/r,e.b=Math.max(e.b,t.b+l))}function Ep(e,t,n){const i=[],s=e._pointLabels.length,o=e.options,r=Fs(o)/2,a=e.drawingArea,l=o.pointLabels.centerPointLabels?ct/s:0;for(let c=0;c270||n<90)&&(e-=t),e}function Vp(e,t){const{ctx:n,options:{pointLabels:i}}=e;for(let s=t-1;s>=0;s--){const o=i.setContext(e.getPointLabelContext(s)),r=yt(o.font),{x:a,y:l,textAlign:c,left:u,top:f,right:d,bottom:h}=e._pointLabelItems[s],{backdropColor:g}=o;if(!tt(g)){const p=yn(o.borderRadius),m=$t(o.backdropPadding);n.fillStyle=g;const _=u-m.left,b=f-m.top,y=d-u+m.width,x=h-f+m.height;Object.values(p).some(v=>v!==0)?(n.beginPath(),Ms(n,{x:_,y:b,w:y,h:x,radius:p}),n.fill()):n.fillRect(_,b,y,x)}Sn(n,e._pointLabels[s],a,l+r.lineHeight/2,r,{color:o.color,textAlign:c,textBaseline:"middle"})}}function Ml(e,t,n,i){const{ctx:s}=e;if(n)s.arc(e.xCenter,e.yCenter,t,0,at);else{let o=e.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let r=1;r{const s=rt(this.options.pointLabels.callback,[n,i],this);return s||s===0?s:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?Dp(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,i,s){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,i,s))}getIndexAngle(t){const n=at/(this._pointLabels.length||1),i=this.options.startAngle||0;return Zt(t*n+jt(i))}getDistanceFromCenterForValue(t){if(tt(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(tt(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t{if(f!==0){l=this.getDistanceFromCenterForValue(u.value);const d=this.getContext(f),h=s.setContext(d),g=o.setContext(d);zp(this,h,l,r,g)}}),i.display){for(t.save(),a=r-1;a>=0;a--){const u=i.setContext(this.getPointLabelContext(a)),{color:f,lineWidth:d}=u;!d||!f||(t.lineWidth=d,t.strokeStyle=f,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&!n.reverse)return;const c=i.setContext(this.getContext(l)),u=yt(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,r=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const f=$t(c.backdropPadding);t.fillRect(-r/2-f.left,-o-u.size/2-f.top,r+f.width,u.size+f.height)}Sn(t,a.label,0,-o,u,{color:c.color})}),t.restore()}drawTitle(){}}H(Yn,"id","radialLinear"),H(Yn,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ei.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),H(Yn,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),H(Yn,"descriptors",{angleLines:{_fallback:"grid"}});const Ii={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},xt=Object.keys(Ii);function Np(e,t){return e-t}function Gr(e,t){if(tt(t))return null;const n=e._adapter,{parser:i,round:s,isoWeekday:o}=e._parseOpts;let r=t;return typeof i=="function"&&(r=i(r)),dt(r)||(r=typeof i=="string"?n.parse(r,i):n.parse(r)),r===null?null:(s&&(r=s==="week"&&(yi(o)||o===!0)?n.startOf(r,"isoWeek",o):n.startOf(r,s)),+r)}function qr(e,t,n,i){const s=xt.length;for(let o=xt.indexOf(e);o=xt.indexOf(n);o--){const r=xt[o];if(Ii[r].common&&e._adapter.diff(s,i,r)>=t-1)return r}return xt[n?xt.indexOf(n):0]}function jp(e){for(let t=xt.indexOf(e)+1,n=xt.length;t=t?n[i]:n[s];e[o]=!0}}function Wp(e,t,n,i){const s=e._adapter,o=+s.startOf(t[0].value,i),r=t[t.length-1].value;let a,l;for(a=o;a<=r;a=+s.add(a,1,i))l=n[a],l>=0&&(t[l].major=!0);return t}function Ur(e,t,n){const i=[],s={},o=t.length;let r,a;for(r=0;r+t.value))}initOffsets(t=[]){let n=0,i=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?n=1-s:n=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?i=o:i=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;n=Mt(n,0,r),i=Mt(i,0,r),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const t=this._adapter,n=this.min,i=this.max,s=this.options,o=s.time,r=o.unit||qr(o.minUnit,n,i,this._getLabelCapacity(n)),a=et(s.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=yi(l)||l===!0,u={};let f=n,d,h;if(c&&(f=+t.startOf(f,"isoWeek",l)),f=+t.startOf(f,c?"day":r),t.diff(i,n,r)>1e5*a)throw new Error(n+" and "+i+" are too far apart with stepSize of "+a+" "+r);const g=s.ticks.source==="data"&&this.getDataTimestamps();for(d=f,h=0;dp-m).map(p=>+p)}getLabelForValue(t){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}format(t,n){const s=this.options.time.displayFormats,o=this._unit,r=n||s[o];return this._adapter.format(t,r)}_tickFormatFunction(t,n,i,s){const o=this.options,r=o.ticks.callback;if(r)return rt(r,[t,n,i],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],f=c&&a[c],d=i[n],h=c&&f&&d&&d.major;return this._adapter.format(t,s||(h?f:u))}generateTickLabels(t){let n,i,s;for(n=0,i=t.length;n0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,i=s.length;n=e[i].pos&&t<=e[s].pos&&({lo:i,hi:s}=Ss(e,"pos",t)),{pos:o,time:a}=e[i],{pos:r,time:l}=e[s]):(t>=e[i].time&&t<=e[s].time&&({lo:i,hi:s}=Ss(e,"time",t)),{time:o,pos:a}=e[i],{time:r,pos:l}=e[s]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class Xr extends Ri{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=Un(n,this.min),this._tableRange=Un(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:i}=this,s=[],o=[];let r,a,l,c,u;for(r=0,a=t.length;r=n&&c<=i&&s.push(c);if(s.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(r=0,a=s.length;r{Kr.test(e)&&kl.push(e.replace(Kr,""))});function Rl(e){const t=Oe,n=[];function i(s){ec(t,s)}Ai(()=>{const s=e();kl.forEach(s instanceof Element?o=>n.push(It(s,o,i)):o=>n.push(s.$on(o,i)))}),en(()=>{for(;n.length;)n.pop()()})}function Gp(e){let t,n=[e[1]],i={};for(let s=0;s{n(2,l=new Ti(c,{type:i,data:s,options:o,plugins:r}))}),Zl(()=>{l&&(n(2,l.data=s,l),Object.assign(l.options,o),l.update(a))}),en(()=>{l&&l.destroy(),n(2,l=null)}),Rl(()=>c);function f(d){Ke[d?"unshift":"push"](()=>{c=d,n(0,c)})}return e.$$set=d=>{n(9,t=N(N({},t),nt(d))),"type"in d&&n(3,i=d.type),"data"in d&&n(4,s=d.data),"options"in d&&n(5,o=d.options),"plugins"in d&&n(6,r=d.plugins),"updateMode"in d&&n(7,a=d.updateMode),"chart"in d&&n(2,l=d.chart)},t=nt(t),[c,u,l,i,s,o,r,a,f]}let Up=class extends X{constructor(t){super(),Q(this,t,Yp,Gp,Y,{type:3,data:4,options:5,plugins:6,updateMode:7,chart:2})}};function Xp(e){let t,n,i;const s=[{type:"pie"},e[1]];function o(a){e[4](a)}let r={};for(let a=0;ada(t,"chart",o)),{c(){V(t.$$.fragment)},m(a,l){E(t,a,l),i=!0},p(a,[l]){const c=l&2?zt(s,[s[0],ee(a[1])]):{};!n&&l&1&&(n=!0,c.chart=a[0],ca(()=>n=!1)),t.$set(c)},i(a){i||(S(t.$$.fragment,a),i=!0)},o(a){C(t.$$.fragment,a),i=!1},d(a){e[3](null),L(t,a)}}}function Kp(e,t,n){Ti.register(ks);let{chart:i=null}=t,s,o;Rl(()=>o);function r(l){Ke[l?"unshift":"push"](()=>{o=l,n(2,o)})}function a(l){i=l,n(0,i)}return e.$$set=l=>{n(5,t=N(N({},t),nt(l))),"chart"in l&&n(0,i=l.chart)},e.$$.update=()=>{n(1,s=t)},t=nt(t),[i,s,o,r,a]}class Qp extends X{constructor(t){super(),Q(this,t,Kp,Xp,Y,{chart:0})}}function Zp(e){let t,n;return t=new Qp({props:{class:"self-center",width:256,height:256,data:{labels:e[0].labels,datasets:[{data:e[0].data}]},options:{maintainAspectRatio:!1,responsive:!1,parsing:{key:"time"},animation:!1,plugins:{tooltip:{callbacks:{label:Jp}}}}}}),{c(){V(t.$$.fragment)},m(i,s){E(t,i,s),n=!0},p(i,[s]){const o={};s&1&&(o.data={labels:i[0].labels,datasets:[{data:i[0].data}]}),t.$set(o)},i(i){n||(S(t.$$.fragment,i),n=!0)},o(i){C(t.$$.fragment,i),n=!1},d(i){L(t,i)}}}const Jp=e=>`Queries: ${e.raw.queries}, Time: ${e.raw.time.toFixed(4)} ms`;function tm(e,t,n){let i;return gt(e,gs,s=>n(0,i=s)),Ti.register(mp,Cp,ni,Ps,gp),[i]}class em extends X{constructor(t){super(),Q(this,t,tm,Zp,Y,{})}}function Qr(e,t,n){const i=e.slice();return i[5]=t[n],i}function Zr(e){let t,n=e[5]+"",i,s,o,r;function a(){return e[4](e[5])}return{c(){t=A("button"),i=J(n),s=q(),D(t,"class","bg-dark-600 p-3 border-[1px] outline-none border-transparent focus-visible:border-cyan-600 text-left hover:bg-dark-400 rounded-md")},m(l,c){it(l,t,c),w(t,i),w(t,s),o||(r=It(t,"click",a),o=!0)},p(l,c){e=l,c&2&&n!==(n=e[5]+"")&&Wt(i,n)},d(l){l&&U(t),o=!1,r()}}}function nm(e){let t,n,i,s,o,r,a,l,c,u,f,d,h,g,p,m,_,b,y,x,v,R,k,$=e[2].queries+"",P,F,M,O,K=e[2].timeQuerying.toFixed(4)+"",Z,T,z,B,ft,st=e[2].slowQueries+"",wt,Xt,pt,mt;a=new rd({});function Se(j){e[3](j)}let ue={icon:Ba};e[0]!==void 0&&(ue.value=e[0]),c=new Kf({props:ue}),Ke.push(()=>da(c,"value",Se));let Et=e[1],_t=[];for(let j=0;ju=!1)),c.$set(Ce),fe&2){Et=j[1];let Lt;for(Lt=0;Ltn(0,i=l)),gt(e,Xc,l=>n(1,s=l)),gt(e,hs,l=>n(2,o=l));function r(l){i=l,fs.set(i)}return[i,s,o,r,l=>Ee.goto(`/${l}`)]}class sm extends X{constructor(t){super(),Q(this,t,im,nm,Y,{})}}function Jr(e){let t,n,i,s,o,r,a;return i=new co({props:{path:"/",$$slots:{default:[om]},$$scope:{ctx:e}}}),o=new co({props:{path:"/:resource",$$slots:{default:[rm]},$$scope:{ctx:e}}}),{c(){t=A("main"),n=A("div"),V(i.$$.fragment),s=q(),V(o.$$.fragment),D(n,"class","bg-dark-800 flex h-[700px] w-[1200px] rounded-md text-white"),D(t,"class","font-main flex h-full w-full items-center justify-center")},m(l,c){it(l,t,c),w(t,n),E(i,n,null),w(n,s),E(o,n,null),a=!0},i(l){a||(S(i.$$.fragment,l),S(o.$$.fragment,l),Qe(()=>{a&&(r||(r=ai(t,Ao,{start:.95,duration:150},!0)),r.run(1))}),a=!0)},o(l){C(i.$$.fragment,l),C(o.$$.fragment,l),r||(r=ai(t,Ao,{start:.95,duration:150},!1)),r.run(0),a=!1},d(l){l&&U(t),L(i),L(o),l&&r&&r.end()}}}function om(e){let t,n;return t=new sm({}),{c(){V(t.$$.fragment)},m(i,s){E(t,i,s),n=!0},i(i){n||(S(t.$$.fragment,i),n=!0)},o(i){C(t.$$.fragment,i),n=!1},d(i){L(t,i)}}}function rm(e){let t,n;return t=new Yf({}),{c(){V(t.$$.fragment)},m(i,s){E(t,i,s),n=!0},i(i){n||(S(t.$$.fragment,i),n=!0)},o(i){C(t.$$.fragment,i),n=!1},d(i){L(t,i)}}}function am(e){let t,n,i=e[0]&&Jr(e);return{c(){i&&i.c(),t=kn()},m(s,o){i&&i.m(s,o),it(s,t,o),n=!0},p(s,[o]){s[0]?i?o&1&&S(i,1):(i=Jr(s),i.c(),S(i,1),i.m(t.parentNode,t)):i&&(kt(),C(i,1,1,()=>{i=null}),Rt())},i(s){n||(S(i),n=!0)},o(s){C(i),n=!1},d(s){i&&i.d(s),s&&U(t)}}}function lm(e,t,n){let i,s,o,r;gt(e,ji,l=>n(0,i=l)),gt(e,gs,l=>n(1,s=l)),gt(e,hs,l=>n(2,o=l)),gt(e,ds,l=>n(3,r=l)),Ee.mode.hash(),Ee.goto("/"),za("openUI",l=>{bt(ji,i=!0,i),bt(ds,r=l.resources,r),bt(hs,o={queries:l.totalQueries,slowQueries:l.slowQueries,timeQuerying:l.totalTime},o),bt(gs,s={labels:l.chartData.labels,data:l.chartData.data},s)}),Na([{action:"openUI",data:{resources:["ox_core","oxmysql","ox_inventory","ox_doorlock","ox_lib","ox_vehicleshop","ox_target"],slowQueries:13,totalQueries:332,totalTime:230123,chartData:{labels:["oxmysql","ox_core","ox_inventory","ox_doorlock"],data:[{queries:25,time:133},{queries:5,time:12},{queries:3,time:2},{queries:72,time:133}]}}}]);const a=l=>{l.key==="Escape"&&(bt(ji,i=!1,i),ba("exit"))};return e.$$.update=()=>{e.$$.dirty&1&&(i?window.addEventListener("keydown",a):window.removeEventListener("keydown",a))},[i]}class cm extends X{constructor(t){super(),Q(this,t,lm,am,Y,{})}}new cm({target:document.getElementById("app")});if(Ha()){const e=document.getElementById("app");e.style.backgroundImage='url("https://i.imgur.com/3pzRj9n.png")',e.style.backgroundSize="cover",e.style.backgroundRepeat="no-repeat",e.style.backgroundPosition="center"} diff --git a/server-data/resources/[ox]/oxmysql/web/build/index.html b/server-data/resources/[ox]/oxmysql/web/build/index.html index 0258dae0f..2a9417da5 100644 --- a/server-data/resources/[ox]/oxmysql/web/build/index.html +++ b/server-data/resources/[ox]/oxmysql/web/build/index.html @@ -5,8 +5,8 @@ Vite + Svelte + TS - - + +
diff --git a/server-data/resources/[wasabi]/wasabi_fishing/client/client.lua b/server-data/resources/[wasabi]/wasabi_fishing/client/client.lua index 09368ed95..87c3fc36c 100644 --- a/server-data/resources/[wasabi]/wasabi_fishing/client/client.lua +++ b/server-data/resources/[wasabi]/wasabi_fishing/client/client.lua @@ -1,54 +1,6 @@ ---@diagnostic disable: undefined-global local fishing = false -if Config.sellShop.enabled then - CreateThread(function() - local ped, textUI - CreateBlip(Config.sellShop.coords, 356, 1, Strings.sell_shop_blip, 0.80) - local point = lib.points.new({ - coords = Config.sellShop.coords, - distance = 30, - }) - - function point:nearby() - if self.currentDistance < self.distance then - if not ped then - lib.requestAnimDict("mini@strip_club@idles@bouncer@base", 100) - lib.requestModel(Config.sellShop.ped, 100) - ped = CreatePed(28, Config.sellShop.ped, Config.sellShop.coords.x, Config.sellShop.coords.y, Config.sellShop.coords.z, Config.sellShop.heading, false, false) - FreezeEntityPosition(ped, true) - SetEntityInvincible(ped, true) - SetBlockingOfNonTemporaryEvents(ped, true) - TaskPlayAnim(ped, "mini@strip_club@idles@bouncer@base", "base", 8.0, 0.0, -1, 1, 0, 0, 0, 0) - end - if self.currentDistance <= 1.8 then - if not textUI then - lib.showTextUI(Strings.sell_fish) - textUI = true - end - if IsControlJustReleased(0, 38) then - FishingSellItems() - end - elseif self.currentDistance >= 1.9 and textUI then - lib.hideTextUI() - textUI = nil - end - end - end - - function point:onExit() - if ped then - local model = GetEntityModel(ped) - SetModelAsNoLongerNeeded(model) - DeletePed(ped) - SetPedAsNoLongerNeeded(ped) - RemoveAnimDict("mini@strip_club@idles@bouncer@base") - ped = nil - end - end - end) -end - RegisterNetEvent("wasabi_fishing:startFishing", function() if IsPedInAnyVehicle(cache.ped) or IsPedSwimming(cache.ped) then TriggerEvent("wasabi_fishing:notify", Strings.cannot_perform, Strings.cannot_perform_desc, "error") diff --git a/server-data/resources/[wasabi]/wasabi_fishing/client/functions.lua b/server-data/resources/[wasabi]/wasabi_fishing/client/functions.lua index c365904ad..3391e10b0 100644 --- a/server-data/resources/[wasabi]/wasabi_fishing/client/functions.lua +++ b/server-data/resources/[wasabi]/wasabi_fishing/client/functions.lua @@ -1,3 +1,5 @@ +---@diagnostic disable: undefined-global, missing-parameter + ShowHelp = function(msg) BeginTextCommandDisplayHelp("STRING") AddTextComponentSubstringPlayerName(msg) diff --git a/server-data/resources/[wasabi]/wasabi_fishing/configuration/config.lua b/server-data/resources/[wasabi]/wasabi_fishing/configuration/config.lua index da5c50ad0..34ef91ca8 100644 --- a/server-data/resources/[wasabi]/wasabi_fishing/configuration/config.lua +++ b/server-data/resources/[wasabi]/wasabi_fishing/configuration/config.lua @@ -1,3 +1,4 @@ +---@diagnostic disable: undefined-global local seconds, minutes = 1000, 60000 Config = {} diff --git a/server-data/resources/[wasabi]/wasabi_fishing/server/server.lua b/server-data/resources/[wasabi]/wasabi_fishing/server/server.lua index a8af35788..fd5bbeba7 100644 --- a/server-data/resources/[wasabi]/wasabi_fishing/server/server.lua +++ b/server-data/resources/[wasabi]/wasabi_fishing/server/server.lua @@ -1,3 +1,4 @@ +---@diagnostic disable: undefined-global local addCommas = function(n) return tostring(math.floor(n)):reverse():gsub("(%d%d%d)", "%1,"):gsub(",(%-?)$", "%1"):reverse() end diff --git a/server-data/resources/[wasabi]/wasabi_fishing/server/updater.lua b/server-data/resources/[wasabi]/wasabi_fishing/server/updater.lua deleted file mode 100644 index 41ac9e7bb..000000000 --- a/server-data/resources/[wasabi]/wasabi_fishing/server/updater.lua +++ /dev/null @@ -1,59 +0,0 @@ -local curVersion = GetResourceMetadata(GetCurrentResourceName(), "version") -local resourceName = "wasabi_fishing" - -if Config.checkForUpdates then - CreateThread(function() - if GetCurrentResourceName() ~= "wasabi_fishing" then - resourceName = "wasabi_fishing (" .. GetCurrentResourceName() .. ")" - end - end) - - CreateThread(function() - while true do - PerformHttpRequest("https://api.github.com/repos/wasabirobby/wasabi_fishing/releases/latest", CheckVersion, "GET") - Wait(3600000) - end - end) - - CheckVersion = function(err, responseText, headers) - local repoVersion, repoURL, repoBody = GetRepoInformations() - - CreateThread(function() - if curVersion ~= repoVersion then - Wait(4000) - print("^0[^3WARNING^0] " .. resourceName .. " is ^1NOT ^0up to date!") - print("^0[^3WARNING^0] Your Version: ^2" .. curVersion .. "^0") - print("^0[^3WARNING^0] Latest Version: ^2" .. repoVersion .. "^0") - print("^0[^3WARNING^0] Get the latest Version from: ^2" .. repoURL .. "^0") - print("^0[^3WARNING^0] Changelog:^0") - print("^1" .. repoBody .. "^0") - else - Wait(4000) - print("^0[^2INFO^0] " .. resourceName .. " is up to date! (^2" .. curVersion .. "^0)") - end - end) - end - - GetRepoInformations = function() - local repoVersion, repoURL, repoBody = nil, nil, nil - - PerformHttpRequest("https://api.github.com/repos/wasabirobby/wasabi_fishing/releases/latest", function(err, response, headers) - if err == 200 then - local data = json.decode(response) - - repoVersion = data.tag_name - repoURL = data.html_url - repoBody = data.body - else - repoVersion = curVersion - repoURL = "https://github.com/wasabirobby/wasabi_fishing" - end - end, "GET") - - repeat - Wait(50) - until repoVersion and repoURL and repoBody - - return repoVersion, repoURL, repoBody - end -end