diff --git a/resources/[tools]/Codem-BlackHUDV2/.fxap b/resources/[tools]/Codem-BlackHUDV2/.fxap
deleted file mode 100644
index 19f6167d6..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/.fxap and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/GetFrameworkObject.lua b/resources/[tools]/Codem-BlackHUDV2/GetFrameworkObject.lua
deleted file mode 100644
index 2c2ef9e88..000000000
--- a/resources/[tools]/Codem-BlackHUDV2/GetFrameworkObject.lua
+++ /dev/null
@@ -1,24 +0,0 @@
-function GetFrameworkObject()
- local object = nil
- if Config.Framework == "esx" then
- while object == nil do
- if Config.NewESX then
- object = exports['es_extended']:getSharedObject()
- else
- TriggerEvent('esx:getSharedObject', function(obj) object = obj end)
- end
-
- Citizen.Wait(0)
- end
- end
- if Config.Framework == "newqb" then
- object = exports["qb-core"]:GetCoreObject()
- end
- if Config.Framework == "oldqb" then
- while object == nil do
- TriggerEvent('QBCore:GetObject', function(obj) object = obj end)
- Citizen.Wait(200)
- end
- end
- return object
-end
\ No newline at end of file
diff --git a/resources/[tools]/Codem-BlackHUDV2/client/UpdateMoney.lua b/resources/[tools]/Codem-BlackHUDV2/client/UpdateMoney.lua
deleted file mode 100644
index 1ccdbdbc5..000000000
--- a/resources/[tools]/Codem-BlackHUDV2/client/UpdateMoney.lua
+++ /dev/null
@@ -1,273 +0,0 @@
-local lastCash = nil
-local lastBlackMoney = nil
-local lastBank = nil
-function loadESXMoneyAndJob()
- local breakLoop = false
- while true do
- if frameworkObject ~= nil then
- if frameworkObject.GetPlayerData() then
- while frameworkObject.GetPlayerData().job == nil do
- Citizen.Wait(0)
- end
- SendNUIMessage({
- type = "update_job",
- joblabel = frameworkObject.GetPlayerData().job.label,
- grade_label = frameworkObject.GetPlayerData().job.grade_label
- })
- frameworkObject.TriggerServerCallback("codem-blvckhudv2:GetMoney", function(cash)
- SendNUIMessage({
- type = "update_money",
- money = cash
- })
- lastCash = cash
- end, "cash")
-
- frameworkObject.TriggerServerCallback("codem-blvckhudv2:GetMoney", function(blackmoney)
- SendNUIMessage({
- type = "SetBlackMoney",
- money = blackmoney
- })
- lastBlackMoney = blackmoney
- end, "black_money")
-
- local gradeName = 'boss'
- if Config.BossGradeNames[frameworkObject.GetPlayerData().job.name] then
- gradeName = Config.BossGradeNames[frameworkObject.GetPlayerData().job.name]
- end
-
- if frameworkObject.GetPlayerData().job.grade_name == gradeName then
- frameworkObject.TriggerServerCallback('esx_society:getSocietyMoney', function(money)
- SendNUIMessage({
- type = "SetBossMoney",
- money = money
- })
-
- SendNUIMessage({type = 'SetIsBoss', value = true})
- end, frameworkObject.GetPlayerData().job.name)
- else
- SendNUIMessage({type = 'SetIsBoss', value = false})
- end
-
- frameworkObject.TriggerServerCallback("codem-blvckhudv2:GetMoney", function(bank)
- SendNUIMessage({
- type = "update_bank",
- money = bank
- })
- lastBank = bank
- breakLoop = true
- end, "bank")
- if breakLoop then
- return
- end
- end
- end
- Citizen.Wait(0)
- end
-end
-
-Citizen.CreateThread(function()
- while not response do
- Citizen.Wait(0)
- end
- if Config.Framework == "esx" then
- Citizen.Wait(1000)
- loadESXMoneyAndJob()
- else
- Citizen.Wait(1000)
- local breakLoop = false
- while true do
- Citizen.Wait(0)
- if frameworkObject ~= nil then
- local Player = frameworkObject.Functions.GetPlayerData()
- if Player then
- if Player.job ~= nil then
- SendNUIMessage({
- type = "update_job",
- joblabel = Player.job.label,
- grade_label = Player.job.grade.name
- })
- end
- if Player.money ~= nil then
- SendNUIMessage({
- type = "update_money",
- money = Player.money.cash
- })
- lastCash = Player.money.cash
- SendNUIMessage({
- type = "update_bank",
- money = Player.money.bank
- })
- lastBank = Player.money.bank
-
- breakLoop = true
- end
-
- if breakLoop then
- break
- end
- end
- end
- end
- end
-end)
-
-RegisterNetEvent("es:addedMoney")
-AddEventHandler("es:addedMoney", function(a, b, m)
- SendNUIMessage({
- type = "update_money",
- money = m
- })
- if Config.EnableWatermarkCash then
- TriggerEvent('codem-blvckhudv2:OnAddedMoney', m - lastCash, false, "cash")
- lastCash = m
- end
-end)
-
-RegisterNetEvent("es:removedMoney")
-AddEventHandler("es:removedMoney", function(a, b, m)
- SendNUIMessage({
- type = "update_money",
- money = m
- })
- if Config.EnableWatermarkCash then
- TriggerEvent('codem-blvckhudv2:OnAddedMoney', (m - lastCash) * -1, true, "cash")
- lastCash = m
- end
-end)
-
-RegisterNetEvent("esx:setJob")
-AddEventHandler("esx:setJob", function(job)
- SendNUIMessage({
- type = "update_job",
- joblabel =job.label,
- grade_label = job.grade_label
- })
- local gradeName = 'boss'
- if Config.BossGradeNames[job.name] then
- gradeName = Config.BossGradeNames[job.name]
- end
- if job.grade_name == gradeName then
- frameworkObject.TriggerServerCallback('esx_society:getSocietyMoney', function(money)
- SendNUIMessage({
- type = "SetBossMoney",
- money = money
- })
- SendNUIMessage({type = 'SetIsBoss', value = true})
- end, job.name)
- else
- SendNUIMessage({type = 'SetIsBoss', value = false})
- end
-end)
-
-RegisterNetEvent('esx_addonaccount:setMoney')
-AddEventHandler('esx_addonaccount:setMoney', function(society, money)
- local gradeName = 'boss'
- if Config.BossGradeNames[frameworkObject.GetPlayerData().job.name] then
- gradeName = Config.BossGradeNames[frameworkObject.GetPlayerData().job.name]
- end
- if frameworkObject.GetPlayerData().job and frameworkObject.GetPlayerData().job.grade_name == gradeName and 'society_' .. frameworkObject.GetPlayerData().job.name == society then
- SendNUIMessage({
- type = "SetBossMoney",
- money = money
- })
- end
-end)
-
-RegisterNetEvent("QBCore:Player:SetPlayerData")
-AddEventHandler("QBCore:Player:SetPlayerData", function(data)
- SendNUIMessage({
- type = "update_money",
- money = data.money.cash
-
- })
- SendNUIMessage({
- type = "update_bank",
- money = data.money.bank
- })
-
- SendNUIMessage({
- type = "update_job",
- joblabel = data.job.label,
- grade_label = data.job.grade.name
- })
- if Config.EnableWatermarkCash then
- if lastCash ~= nil and lastCash ~= data.money.cash then
- if data.money.cash > lastCash then
- TriggerEvent('codem-blvckhudv2:OnAddedMoney', data.money.cash - lastCash, false , "cash")
- else
- TriggerEvent('codem-blvckhudv2:OnAddedMoney', (data.money.cash - lastCash) * -1, true , "cash")
- end
- lastCash = data.money.cash
- end
-
- end
- if Config.EnableWatermarkBankMoney then
- if lastBank ~= nil and lastBank ~= data.money.bank then
- if data.money.bank > lastBank then
- TriggerEvent('codem-blvckhudv2:OnAddedMoney', data.money.bank - lastBank, false, "bank")
- else
- TriggerEvent('codem-blvckhudv2:OnAddedMoney', (data.money.bank - lastBank)* -1, true, "bank")
- end
- lastBank = data.money.bank
- end
- end
-end)
-
-RegisterNetEvent('esx:setAccountMoney')
-AddEventHandler('esx:setAccountMoney', function(account)
- if account.name == "bank" then
- local money = account.money
- SendNUIMessage({
- type = "update_bank",
- money = money
- })
- if Config.EnableWatermarkBankMoney then
- if lastBank ~= nil and lastBank ~= money then
- if money > lastBank then
- TriggerEvent('codem-blvckhudv2:OnAddedMoney',money - lastBank, false, "bank")
- else
- TriggerEvent('codem-blvckhudv2:OnAddedMoney', (money - lastBank) * -1, true, "bank")
- end
- lastBank = money
- end
- end
- end
-
- if account.name == 'black_money' then
- local money = account.money
- SendNUIMessage({
- type = "SetBlackMoney",
- money = money
- })
- if Config.EnableWatermarkBlackMoney then
- if lastBlackMoney ~= nil and lastBlackMoney ~= money then
- if money > lastBlackMoney then
- TriggerEvent('codem-blvckhudv2:OnAddedMoney', money - lastBlackMoney, false, "black_money")
- else
- TriggerEvent('codem-blvckhudv2:OnAddedMoney', (money - lastBlackMoney ) * -1, true, "black_money")
- end
- lastBlackMoney = money
- end
- end
- end
-
- if account.name == 'money' then
- local money = account.money
- SendNUIMessage({
- type = "update_money",
- money = money
- })
-
- if Config.EnableWatermarkCash then
- if lastCash ~= nil and lastCash ~= money then
- if money > lastCash then
-
- TriggerEvent('codem-blvckhudv2:OnAddedMoney',money - lastCash, false, "cash")
- else
- TriggerEvent('codem-blvckhudv2:OnAddedMoney', (money - lastCash ) * -1, true, "cash")
- end
- lastCash = money
- end
- end
- end
-end)
\ No newline at end of file
diff --git a/resources/[tools]/Codem-BlackHUDV2/client/client.lua b/resources/[tools]/Codem-BlackHUDV2/client/client.lua
deleted file mode 100644
index f2bed0274..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/client/client.lua and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/client/nitro.lua b/resources/[tools]/Codem-BlackHUDV2/client/nitro.lua
deleted file mode 100644
index 273fe3346..000000000
--- a/resources/[tools]/Codem-BlackHUDV2/client/nitro.lua
+++ /dev/null
@@ -1,269 +0,0 @@
-nitro = {}
-local vehicles = {}
-local particles = {}
-local vehicles2 = {}
-local particles2 = {}
-if Config.EnableNitro then
-
- function CreateVehicleExhaustBackfire(vehicle, scale)
- local exhaustNames = {
- "exhaust", "exhaust_2", "exhaust_3", "exhaust_4",
- "exhaust_5", "exhaust_6", "exhaust_7", "exhaust_8",
- "exhaust_9", "exhaust_10", "exhaust_11", "exhaust_12",
- "exhaust_13", "exhaust_14", "exhaust_15", "exhaust_16"
- }
-
- for _, exhaustName in ipairs(exhaustNames) do
- local boneIndex = GetEntityBoneIndexByName(vehicle, exhaustName)
-
- if boneIndex ~= -1 then
- local pos = GetWorldPositionOfEntityBone(vehicle, boneIndex)
- local off = GetOffsetFromEntityGivenWorldCoords(vehicle, pos.x, pos.y, pos.z)
-
- UseParticleFxAssetNextCall('core')
- StartParticleFxNonLoopedOnEntity('veh_backfire', vehicle, off.x, off.y, off.z, 0.0, 0.0, 0.0, scale, false, false, false)
- end
- end
- end
-
- function CreateVehiclePurgeSpray(vehicle, xOffset, yOffset, zOffset, xRot, yRot, zRot, scale)
- UseParticleFxAssetNextCall('core')
- return StartParticleFxLoopedOnEntity('ent_sht_steam', vehicle, xOffset, yOffset, zOffset, xRot, yRot, zRot, scale, false, false, false)
- end
-
- function CreateVehicleLightTrail(vehicle, bone, scale)
- UseParticleFxAssetNextCall('core')
- local ptfx = StartParticleFxLoopedOnEntityBone('veh_light_red_trail', vehicle, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, bone, scale, false, false, false)
- SetParticleFxLoopedEvolution(ptfx, "speed", 1.0, false)
- return ptfx
- end
-
- function StopVehicleLightTrail(ptfx, duration)
- Citizen.CreateThread(function()
- local startTime = GetGameTimer()
- local endTime = GetGameTimer() + duration
- while GetGameTimer() < endTime do
- Citizen.Wait(0)
- local now = GetGameTimer()
- local scale = (endTime - now) / duration
- SetParticleFxLoopedScale(ptfx, scale)
- SetParticleFxLoopedAlpha(ptfx, scale)
- end
- StopParticleFxLooped(ptfx)
- end)
- end
-
- function IsVehicleLightTrailEnabled(vehicle)
- return vehicles2[vehicle] == true
- end
-
- function SetVehicleLightTrailEnabled(vehicle, enabled)
- if IsVehicleLightTrailEnabled(vehicle) == enabled then
- return
- end
-
- if enabled then
- local ptfxs = {}
-
- local leftTrail = CreateVehicleLightTrail(vehicle, GetEntityBoneIndexByName(vehicle, "taillight_l"), 1.0)
- local rightTrail = CreateVehicleLightTrail(vehicle, GetEntityBoneIndexByName(vehicle, "taillight_r"), 1.0)
-
- table.insert(ptfxs, leftTrail)
- table.insert(ptfxs, rightTrail)
-
- vehicles2[vehicle] = true
- particles2[vehicle] = ptfxs
- else
- if particles2[vehicle] and #particles2[vehicle] > 0 then
- for _, particleId in ipairs(particles2[vehicle]) do
- StopVehicleLightTrail(particleId, 500)
- end
- end
-
- vehicles2[vehicle] = nil
- particles2[vehicle] = nil
- end
- end
- function SetVehicleNitroBoostEnabled(vehicle, enabled)
-
-
- if IsPedInVehicle(PlayerPedId(), vehicle) then
- SetNitroBoostScreenEffectsEnabled(enabled)
- end
-
- SetVehicleBoostActive(vehicle, enabled)
- end
- function IsVehicleNitroPurgeEnabled(vehicle)
- return vehicles[vehicle] == true
- end
- function SetVehicleNitroPurgeEnabled(vehicle, enabled)
- if IsVehicleNitroPurgeEnabled(vehicle) == enabled then
- return
- end
- if enabled then
- local bone = GetEntityBoneIndexByName(vehicle, 'bonnet')
- local pos = GetWorldPositionOfEntityBone(vehicle, bone)
- local off = GetOffsetFromEntityGivenWorldCoords(vehicle, pos.x, pos.y, pos.z)
- local ptfxs = {}
-
- for i=0,3 do
- local leftPurge = CreateVehiclePurgeSpray(vehicle, off.x - 0.5, off.y + 0.05, off.z, 40.0, -20.0, 0.0, 0.5)
- local rightPurge = CreateVehiclePurgeSpray(vehicle, off.x + 0.5, off.y + 0.05, off.z, 40.0, 20.0, 0.0, 0.5)
-
- table.insert(ptfxs, leftPurge)
- table.insert(ptfxs, rightPurge)
- end
-
- vehicles[vehicle] = true
- particles[vehicle] = ptfxs
- else
- if particles[vehicle] and #particles[vehicle] > 0 then
- for _, particleId in ipairs(particles[vehicle]) do
- StopParticleFxLooped(particleId)
- end
- end
-
- vehicles[vehicle] = nil
- particles[vehicle] = nil
- end
- end
-
- function SetNitroBoostScreenEffectsEnabled(enabled)
- if enabled then
- StartScreenEffect('RaceTurbo', 0, false)
- SetTimecycleModifier('rply_motionblur')
- ShakeGameplayCam('SKY_DIVING_SHAKE', 0.30)
- TriggerServerEvent("InteractSound_SV:PlayOnSource", "nitro", 0.5)
- else
- StopScreenEffect('RaceTurbo')
- StopGameplayCamShaking(true)
- SetTransitionTimecycleModifier('default', 0.35)
- end
- end
- function GetVehicleInDirection()
-
- local playerCoords = GetEntityCoords(playerPed)
- local inDirection = GetOffsetFromEntityInWorldCoords(playerPed, 0.0, 5.0, 0.0)
- local rayHandle = StartShapeTestRay(playerCoords, inDirection, 10, playerPed, 0)
- local numRayHandle, hit, endCoords, surfaceNormal, entityHit = GetShapeTestResult(rayHandle)
-
- if hit == 1 and GetEntityType(entityHit) == 2 then
- return entityHit
- end
-
- return nil
- end
- RegisterNetEvent('codem-blvckhudv2:SetupNitro')
- AddEventHandler('codem-blvckhudv2:SetupNitro', function()
- local vehicle = GetVehicleInDirection()
- if IsPedSittingInAnyVehicle(playerPed) then
- Config.Notification(Config.Notifications["cant_install_nitro"]["message"], Config.Notifications["cant_install_nitro"]["type"])
- else
- if vehicle ~= nil and DoesEntityExist(vehicle) and IsPedOnFoot(playerPed) then
- TaskStartScenarioInPlace(playerPed, 'PROP_HUMAN_BUM_BIN', 0, true)
- Citizen.CreateThread(function()
- Citizen.Wait(5000)
- ClearPedTasksImmediately(playerPed)
- TriggerServerEvent('codem-blvckhudv2:RemoveItem',Config.NitroItem, 1)
- TriggerServerEvent('codem-blvckhudv2:InstallNitro', GetVehicleNumberPlateText(vehicle))
- end)
- else
- Config.Notification(Config.Notifications["no_veh_nearby"]["message"], Config.Notifications["no_veh_nearby"]["type"])
- end
- end
- end)
- RegisterNetEvent('codem-blvckhudv2:UpdateNitroData')
- AddEventHandler('codem-blvckhudv2:UpdateNitroData', function(nitroData)
- while not response do
- Citizen.Wait(0)
- end
- nitro = nitroData
-
- local playerVeh = GetVehiclePedIsIn(playerPed, false)
- if playerVeh ~= 0 and nitro[GetVehicleNumberPlateText(playerVeh)] ~= nil then
- SendNUIMessage({ type="set_status", statustype = "nitro", value = nitro[GetVehicleNumberPlateText(playerVeh)]})
- end
- end)
-
- local isPressing = false
- RegisterCommand('+nitro', function()
- local playerVeh = GetVehiclePedIsIn(playerPed, false)
- isPressing = true
- if playerVeh ~= 0 and nitro[GetVehicleNumberPlateText(playerVeh)] ~= nil then
- if tonumber(nitro[GetVehicleNumberPlateText(playerVeh)]) > 0 then
- if GetPedInVehicleSeat(playerVeh, -1) == playerPed then
- while isPressing do
- playerVeh = GetVehiclePedIsIn(playerPed, false)
- if tonumber(nitro[GetVehicleNumberPlateText(playerVeh)]) <= 0 then
- if tonumber(nitro[GetVehicleNumberPlateText(playerVeh)]) < 0 then
- nitro[GetVehicleNumberPlateText(playerVeh)] = 0
- end
- isPressing = false
- SetVehicleNitroBoostEnabled(playerVeh, false)
- SetVehicleLightTrailEnabled(playerVeh, false)
- SetVehicleNitroPurgeEnabled(playerVeh, false)
- SetVehicleEnginePowerMultiplier(playerVeh,1.0)
-
- TriggerServerEvent('codem-blvckhudv2:UpdateNitro', GetVehicleNumberPlateText(playerVeh), nitro[GetVehicleNumberPlateText(playerVeh)])
- break
-
- end
- if playerVeh == 0 then
- isPressing = false
- SetVehicleEnginePowerMultiplier(playerVeh,1.0)
-
- SetVehicleNitroBoostEnabled(playerVeh, false)
- SetVehicleLightTrailEnabled(playerVeh, false)
- SetVehicleNitroPurgeEnabled(playerVeh, false)
- TriggerServerEvent('codem-blvckhudv2:UpdateNitro', GetVehicleNumberPlateText(playerVeh), nitro[GetVehicleNumberPlateText(playerVeh)])
- break
- end
- if GetPedInVehicleSeat(playerVeh, -1) == playerPed then
- local force = Config.NitroForce
- nitro[GetVehicleNumberPlateText(playerVeh)] = nitro[GetVehicleNumberPlateText(playerVeh)] - Config.RemoveNitroOnpress
- SendNUIMessage({ type="set_status", statustype = "nitro", value = nitro[GetVehicleNumberPlateText(playerVeh)]})
-
- SetVehicleNitroBoostEnabled(playerVeh, true)
- SetVehicleLightTrailEnabled(playerVeh, true)
- SetVehicleNitroPurgeEnabled(playerVeh, true)
- CreateVehicleExhaustBackfire(playerVeh, 1.25)
- SetVehicleEnginePowerMultiplier(playerVeh,55.0)
- else
- SetVehicleNitroBoostEnabled(playerVeh, false)
- SetVehicleLightTrailEnabled(playerVeh, false)
- SetVehicleNitroPurgeEnabled(playerVeh, false)
- SetVehicleEnginePowerMultiplier(playerVeh,1.0)
-
- isPressing = false
- TriggerServerEvent('codem-blvckhudv2:UpdateNitro', GetVehicleNumberPlateText(playerVeh), nitro[GetVehicleNumberPlateText(playerVeh)])
-
- break
- end
- Citizen.Wait(400)
- end
- end
- end
- end
- end)
- RegisterCommand('-nitro', function()
- local playerVeh = GetVehiclePedIsIn(playerPed, false)
- if playerVeh ~= 0 and nitro[GetVehicleNumberPlateText(playerVeh)] ~= nil then
- if GetPedInVehicleSeat(playerVeh, -1) == playerPed then
- isPressing = false
- SetVehicleNitroBoostEnabled(playerVeh, false)
- SetVehicleLightTrailEnabled(playerVeh, false)
- SetVehicleNitroPurgeEnabled(playerVeh, false)
- SetVehicleEnginePowerMultiplier(playerVeh,1.0)
-
- SendNUIMessage({ type="set_status", statustype = "nitro", value = nitro[GetVehicleNumberPlateText(playerVeh)]})
- TriggerServerEvent('codem-blvckhudv2:UpdateNitro', GetVehicleNumberPlateText(playerVeh), nitro[GetVehicleNumberPlateText(playerVeh)])
- end
- else
- SendNUIMessage({ type="set_status", statustype = "nitro", value = 0})
- end
- end)
-
- RegisterKeyMapping('+nitro', 'Toggle Nitro', 'keyboard', Config.NitroKey)
-
-
-end
diff --git a/resources/[tools]/Codem-BlackHUDV2/client/seatbelt.lua b/resources/[tools]/Codem-BlackHUDV2/client/seatbelt.lua
deleted file mode 100644
index b1097f0b6..000000000
--- a/resources/[tools]/Codem-BlackHUDV2/client/seatbelt.lua
+++ /dev/null
@@ -1,254 +0,0 @@
-seatbeltOn = false
-if Config.EnableSeatbelt then
- lastSpeed = 0
- function CheckVehicleHasSeatbelt(vehicle)
- if DoesEntityExist(vehicle) then
- local model = GetEntityModel(vehicle)
- local modelName = GetDisplayNameFromVehicleModel(model):lower()
-
- -- Liste der Polizeimotorräder, die ausgeschlossen werden sollen
- local policeBikes = {
- "policeb",
- "policeb2",
- "sheriff2",
- "mbu3rb",
- "mbu2rb",
- "mbu1flagrb",
- "bomberbike"
- -- Fügen Sie hier weitere Polizeimotorrad-Spawnnames hinzu, falls nötig
- }
-
- -- Prüfe, ob das Fahrzeug ein Polizeimotorrad ist
- for _, bikeName in ipairs(policeBikes) do
- if modelName == bikeName then
- return false
- end
- end
-
- local class = GetVehicleClass(vehicle)
- -- Exclude motorcycles (8)
- if class == 8 then return false end
- -- Cars (0-7), Industrial vehicles (9), SUVs (2), Service vehicles (17),
- -- Military vehicles (19), Commercial vehicles (20)
- return class >= 0 and class <= 7 or class == 9 or class == 17 or class == 18 or class == 19 or class == 20
- end
- return false
- end
-
- if Config.SeatbeltSound then
- CreateThread(function()
- while true do
- local ped = playerPed
- local car = GetVehiclePedIsIn(ped)
- if DoesEntityExist(car) and CheckVehicleHasSeatbelt(car) then
- if not seatbeltOn then
- local speed = GetEntitySpeed(car) * 3.6
- if speed > 100.0 then -- Alarm nur über 100 km/h
- SendNUIMessage({
- type="PLAY_SEATBELT_SOUND",
- })
- end
- end
- end
- Wait(2800)
- end
- end)
- end
-
- local seatbeltSpam = 0
- function playSound(action)
- local ped = playerPed
- local car = GetVehiclePedIsIn(ped)
- local seatPlayerId = {}
- if IsCar(car) then
- for i=1, GetVehicleModelNumberOfSeats(GetEntityModel(car)) do
- if not IsVehicleSeatFree(car, i-2) then
- local otherPlayerId = GetPedInVehicleSeat(car, i-2)
- local playerHandle = NetworkGetPlayerIndexFromPed(otherPlayerId)
- local playerServerId = GetPlayerServerId(playerHandle)
- table.insert(seatPlayerId, playerServerId)
- end
- end
- if #seatPlayerId > 0 then TriggerServerEvent("seatbelt:server:PlaySound", action, seatPlayerId) end
- end
- end
-
- RegisterNetEvent('seatbelt:client:PlaySound')
- AddEventHandler('seatbelt:client:PlaySound', function(action, volume)
- SendNUIMessage({type = action, volume = volume})
- end)
-
- RegisterKeyMapping('seatbelt', 'Toggle Seatbelt', 'keyboard', Config.DefaultSeatbeltControlKey)
- Citizen.CreateThread(function()
- while true do
- Citizen.Wait(1500)
- if seatbeltSpam > 0 then
- Citizen.Wait(3500)
- seatbeltSpam = 0
- end
- end
- end)
-
- RegisterNetEvent('codem-blackhudv2:seatbelt:toggle')
- AddEventHandler('codem-blackhudv2:seatbelt:toggle', function(toggle)
- local car = GetVehiclePedIsIn(playerPed)
- if car ~= 0 and IsCar(car) then
- if seatbeltSpam >= 3 then
- if Config.EnableSpamNotification then
- Config.Notification(Config.Notifications["spam"]["message"], Config.Notifications["spam"]["type"])
- end
- return
- end
- seatbeltOn = toggle
- if seatbeltOn then
- SendNUIMessage({
- type="update_seatbelt",
- toggle = true
- })
- playSound("buckle")
- Config.Notification(Config.Notifications["took_seatbelt"]["message"], Config.Notifications["took_seatbelt"]["type"])
- else
- SendNUIMessage({
- type="update_seatbelt",
- toggle = false
- })
- playSound("unbuckle")
- Config.Notification(Config.Notifications["took_off_seatbelt"]["message"], Config.Notifications["took_off_seatbelt"]["type"])
- end
- end
- end)
-
- RegisterCommand('seatbelt', function()
- if IsPedHangingOnToVehicle(playerPed) then
- return
- end
- local car = GetVehiclePedIsIn(playerPed)
- if car ~= 0 and IsCar(car) then
- if seatbeltSpam >= 3 then
- if Config.EnableSpamNotification then
- Config.Notification(Config.Notifications["spam"]["message"], Config.Notifications["spam"]["type"])
- end
- return
- end
- seatbeltOn = not seatbeltOn
- if seatbeltOn then
- SendNUIMessage({
- type="update_seatbelt",
- toggle = true
- })
- playSound("buckle")
- Config.Notification(Config.Notifications["took_seatbelt"]["message"], Config.Notifications["took_seatbelt"]["type"])
- else
- SendNUIMessage({
- type="update_seatbelt",
- toggle = false
- })
- playSound("unbuckle")
- Config.Notification(Config.Notifications["took_off_seatbelt"]["message"], Config.Notifications["took_off_seatbelt"]["type"])
- end
- end
- end, false)
-
- function Fwv(entity)
- local hr = GetEntityHeading(entity) + 90.0
- if hr < 0.0 then hr = 360.0 + hr end
- hr = hr * 0.0174533
- return { x = math.cos(hr) * 2.0, y = math.sin(hr) * 2.0 }
- end
-
- function IsCar(veh)
- if DoesEntityExist(veh) then
- local model = GetEntityModel(veh)
- local modelName = GetDisplayNameFromVehicleModel(model):lower()
-
- -- Liste der Polizeimotorräder
- local policeBikes = {
- "policeb",
- "policeb2",
- "sheriff2",
- "mbu3rb",
- "mbu2rb",
- "mbu1flagrb",
- "bomberbike"
- -- Fügen Sie hier weitere Polizeimotorrad-Spawnnames hinzu, falls nötig
- }
-
- -- Prüfe, ob das Fahrzeug ein Polizeimotorrad ist
- for _, bikeName in ipairs(policeBikes) do
- if modelName == bikeName then
- return false
- end
- end
-
- local vc = GetVehicleClass(veh)
- if vc == 8 then return false end
- return (vc >= 0 and vc <= 7) or vc == 9 or vc == 17 or vc == 18 or vc == 19 or vc == 20
- end
- return false
- end
-
- RegisterNetEvent('codem-blackhud-v2:client:EjectPlayer')
- AddEventHandler('codem-blackhud-v2:client:EjectPlayer', function(velocity)
- print("Ejecting player")
- if not seatbeltOn then
- local ped = PlayerPedId()
- local coords = GetEntityCoords(ped)
- local fw = Fwv(ped)
- lastSpeed = 0
- SetEntityCoords(ped, coords.x + fw.x, coords.y + fw.y, coords.z - .47, true, true, true)
- SetEntityVelocity(ped, lastVelocity.x, lastVelocity.y, lastVelocity.z)
- Wait(500)
- ApplyDamageToPed(ped, math.random(10, 30), false)
- SetPedToRagdoll(ped, 1000, 1000, 0, 0, 0, 0)
- seatbeltOn = false
- SendNUIMessage({
- type="update_seatbelt",
- toggle = false
- })
- end
- end)
-
- CreateThread(function()
- while true do
- local ped = PlayerPedId()
- local Vehicle = GetVehiclePedIsIn(ped)
- if IsPedInAnyVehicle(ped) and CheckVehicleHasSeatbelt(Vehicle) then
- local vehicle = Vehicle
- local speed = GetEntitySpeed(vehicle) * 3.6
- if lastSpeed > (Config.SeatBeltFlySpeed) and (lastSpeed - speed) > (speed * 1.7) then
- if not seatbeltOn then
- print("Ejecting player", lastSpeed, speed)
- local seatPlayerId = {}
- for i=1, GetVehicleModelNumberOfSeats(GetEntityModel(vehicle)) do
- if not IsVehicleSeatFree(vehicle, i-2) then
- local otherPlayerId = GetPedInVehicleSeat(vehicle, i-2)
- local playerHandle = NetworkGetPlayerIndexFromPed(otherPlayerId)
- local playerServerId = GetPlayerServerId(playerHandle)
- table.insert(seatPlayerId, playerServerId)
- end
- end
- seatbeltOn = false
- SendNUIMessage({
- type="update_seatbelt",
- toggle = false
- })
- if #seatPlayerId > 0 then TriggerServerEvent("codem-blackhud-v2:server:EjectPlayer", seatPlayerId) end
- end
- end
- lastSpeed = speed
- lastVelocity = GetEntityVelocity(vehicle)
- else
- if seatbeltOn then
- seatbeltOn = false
- SendNUIMessage({
- type="update_seatbelt",
- toggle = false
- })
- lastSpeed = 0
- end
- Wait(2000)
- end
- Wait(150)
- end
- end)
-end
diff --git a/resources/[tools]/Codem-BlackHUDV2/client/status.lua b/resources/[tools]/Codem-BlackHUDV2/client/status.lua
deleted file mode 100644
index e754ba7d7..000000000
--- a/resources/[tools]/Codem-BlackHUDV2/client/status.lua
+++ /dev/null
@@ -1,314 +0,0 @@
-speedMultiplier = Config.DefaultSpeedUnit == "kmh" and 3.6 or 2.23694
-
-
-Citizen.CreateThread(function()
- while true do
- HideHudComponentThisFrame(6) -- VEHICLE_NAME
- HideHudComponentThisFrame(7) -- AREA_NAME
- HideHudComponentThisFrame(8) -- VEHICLE_CLASS
- HideHudComponentThisFrame(9) -- STREET_NAME
- HideHudComponentThisFrame(3) -- CASH
- HideHudComponentThisFrame(4) -- MP_CASH
- HideHudComponentThisFrame(21) -- 21 : HUD_COMPONENTS
- HideHudComponentThisFrame(22) -- 22 : HUD_WEAPONS
-
- DisplayAmmoThisFrame(false)
- Citizen.Wait(4)
-
- end
-end)
-
-RegisterNetEvent('esx:playerLoaded')
-AddEventHandler('esx:playerLoaded', function(xPlayer)
- TriggerServerEvent('codem-blackhudv2:LoadHud')
- Citizen.CreateThread(function()
- loadESXMoneyAndJob()
- end)
-end)
-
-RegisterNetEvent('QBCore:Client:OnPlayerLoaded')
-AddEventHandler('QBCore:Client:OnPlayerLoaded', function()
- TriggerServerEvent('codem-blackhudv2:LoadHud')
-end)
-
-
-Citizen.CreateThread(function()
- WaitPlayer()
- Citizen.Wait(2500)
- while true do
- Citizen.Wait(4000)
- if Config.Framework == "esx" then
- TriggerEvent('esx_status:getStatus', 'hunger', function(hunger)
- TriggerEvent('esx_status:getStatus', 'thirst', function(thirst)
- local myhunger = hunger.getPercent()
- local mythirst = thirst.getPercent()
- SendNUIMessage({
- type = "set_status",
- statustype = "hunger",
- value = myhunger,
- })
- SendNUIMessage({
- type = "set_status",
- statustype = "thirst",
- value = mythirst,
- })
- end)
- end)
- else
- local myhunger = frameworkObject.Functions.GetPlayerData().metadata["hunger"]
- local mythirst = frameworkObject.Functions.GetPlayerData().metadata["thirst"]
-
- SendNUIMessage({
- type = "set_status",
- statustype = "hunger",
- value = myhunger,
- })
- SendNUIMessage({
- type = "set_status",
- statustype = "thirst",
- value = mythirst,
- })
-
- end
- end
-end)
-
-
-
-Citizen.CreateThread(function()
- while true do
- Citizen.Wait(1)
- if GetEntityMaxHealth(PlayerPedId()) ~= 200 then
- SetEntityMaxHealth(PlayerPedId(), 200)
- SetEntityHealth(PlayerPedId(), 200)
- end
- end
-end)
-
-function LoadRectMinimap(hud)
-
- local defaultAspectRatio = 1920/1080 -- Don't change this.
- local resolutionX, resolutionY = GetActiveScreenResolution()
- local aspectRatio = resolutionX/resolutionY
- local minimapOffset = 0
- if aspectRatio > defaultAspectRatio then
- minimapOffset = ((defaultAspectRatio-aspectRatio)/3.6)-0.008
- end
- RequestStreamedTextureDict("squaremap", false)
- while not HasStreamedTextureDictLoaded("squaremap") do
- Wait(150)
- end
-
- SetMinimapClipType(0)
- AddReplaceTexture("platform:/textures/graphics", "radarmasksm", "squaremap", "radarmasksm")
- AddReplaceTexture("platform:/textures/graphics", "radarmask1g", "squaremap", "radarmasksm")
- -- 0.0 = nav symbol and icons left
- -- 0.1638 = nav symbol and icons stretched
- -- 0.216 = nav symbol and icons raised up
- SetMinimapComponentPosition("minimap", "L", "B", 0.0 + minimapOffset, -0.047, 0.1638, 0.183)
-
- -- icons within map
- SetMinimapComponentPosition("minimap_mask", "L", "B", 0.0 + minimapOffset, 0.0, 0.128, 0.20)
-
- -- -0.01 = map pulled left
- -- 0.025 = map raised up
- -- 0.262 = map stretched
- -- 0.315 = map shorten
-
- SetMinimapComponentPosition('minimap_blur', 'L', 'B', -0.01 + minimapOffset, 0.025, 0.262, 0.300)
-
- SetBlipAlpha(GetNorthRadarBlip(), 0)
- SetRadarBigmapEnabled(true, false)
- SetMinimapClipType(0)
- Wait(0)
- SetRadarBigmapEnabled(false, false)
-end
-
-function LoadRadialMap(hud)
- local defaultAspectRatio = 1920/1080 -- Don't change this.
- local resolutionX, resolutionY = GetActiveScreenResolution()
- local aspectRatio = resolutionX/resolutionY
- local minimapOffset = 0
- if aspectRatio > defaultAspectRatio then
- minimapOffset = ((defaultAspectRatio-aspectRatio)/3.6)-0.008
- end
- RequestStreamedTextureDict("circlemap", false)
- while not HasStreamedTextureDictLoaded("circlemap") do
- Wait(150)
- end
- SetMinimapClipType(1)
-
- AddReplaceTexture("platform:/textures/graphics", "radarmasksm", "circlemap", "radarmasksm")
- AddReplaceTexture("platform:/textures/graphics", "radarmask1g", "circlemap", "radarmasksm")
- -- -0.0100 = nav symbol and icons left
- -- 0.180 = nav symbol and icons stretched
- -- 0.258 = nav symbol and icons raised up
- SetMinimapComponentPosition("minimap", "L", "B", -0.0100 + minimapOffset, -0.030, 0.180, 0.258)
-
- -- icons within map
- SetMinimapComponentPosition("minimap_mask", "L", "B", 0.200 + minimapOffset, 0.0, 0.065, 0.20)
-
- -- -0.00 = map pulled left
- -- 0.015 = map raised up
- -- 0.252 = map stretched
- -- 0.338 = map shorten
- SetMinimapComponentPosition('minimap_blur', 'L', 'B', -0.00 + minimapOffset, 0.015, 0.252, 0.338)
- SetBlipAlpha(GetNorthRadarBlip(), 0)
- SetMinimapClipType(1)
- SetRadarBigmapEnabled(true, false)
- Wait(0)
- SetRadarBigmapEnabled(false, false)
-end
-
-
-
-Citizen.CreateThread(function()
- local ped = PlayerPedId()
- while true do
- Citizen.Wait(100)
- SetRadarZoom(1100)
- end
-end)
-
-Citizen.CreateThread(function()
- while true do
- Citizen.Wait(100)
- SetBigmapActive(false, false)
- end
-end)
-
-
-Citizen.CreateThread(function()
- if Config.Framework == "esx" then
- WaitPlayer()
- Citizen.Wait(2500)
- TriggerEvent('esx_status:getStatus', 'hunger', function(hunger)
- TriggerEvent('esx_status:getStatus', 'thirst', function(thirst)
- local myhunger = hunger.getPercent()
- local mythirst = thirst.getPercent()
- SendNUIMessage({
- type = "set_status",
- statustype = "hunger",
- value = myhunger,
- })
- SendNUIMessage({
- type = "set_status",
- statustype = "thirst",
- value = mythirst,
- })
- end)
- end)
- else
- WaitPlayer()
- local myhunger = frameworkObject.Functions.GetPlayerData().metadata["hunger"]
- local mythirst = frameworkObject.Functions.GetPlayerData().metadata["thirst"]
- Citizen.Wait(2500)
-
- SendNUIMessage({
- type = "set_status",
- statustype = "hunger",
- value = myhunger,
- })
- SendNUIMessage({
- type = "set_status",
- statustype = "thirst",
- value = mythirst,
- })
-
- end
- local playerPed = playerPed
- local health = GetEntityHealth(playerPed)
- local val = health-100
-
-
- SendNUIMessage({
- type = "set_status",
- statustype = "health",
- value = val,
- })
-end)
-
-local lastHealth = nil
-Citizen.CreateThread(function()
- while true do
- Citizen.Wait(1250)
- local playerPed = playerPed
- local health = GetEntityHealth(playerPed)
- if lastHealth ~= health then
- local val = health-100
-
- SendNUIMessage({
- type = "set_status",
- statustype = "health",
- value = val,
- })
-
- lastHealth = health
- end
- end
-end)
-
-RegisterNUICallback('ResetHudPositions', function(data, cb)
- local data = {}
-
- for _, v in pairs(Config.DefaultHudPositions) do
- if type(v) == 'string' and Config.AvaliablePositions[v] then
- data[_] = Config.AvaliablePositions[v]
- end
- end
- TriggerServerEvent('codem-blvckhudv2:UpdateData', "positionsData", data)
- cb("ok")
-
-end)
-
-
-RegisterNUICallback('hudselected', function(data, cb)
- local hudtype = data.type
- local defaultAspectRatio = 1920/1080 -- Don't change this.
- local resolutionX, resolutionY = GetActiveScreenResolution()
- local aspectRatio = resolutionX/resolutionY
- local minimapOffset = 0
- if aspectRatio > defaultAspectRatio then
- minimapOffset = ((defaultAspectRatio-aspectRatio)/3.6)-0.008
- end
- TriggerServerEvent('codem-blvckhudv2:UpdateData', data.settingstype, data.val)
- if data.settingstype == "hud" then
-
- if data.val == "radial" then
- local playerPed = playerPed
- local armour = GetPedArmour(playerPed)
- SendNUIMessage({
- type = "armour_update",
- armour = armour,
- })
- if Config.Framework == "esx" then
-
- else
- local myhunger = frameworkObject.Functions.GetPlayerData().metadata["hunger"]
- local mythirst = frameworkObject.Functions.GetPlayerData().metadata["thirst"]
- SendNUIMessage({
- type = "set_status",
- statustype = "hunger",
- value = myhunger,
- })
- SendNUIMessage({
- type = "set_status",
- statustype = "thirst",
- value = mythirst,
- })
- end
-
-
- local health = GetEntityHealth(playerPed)
- local val = health-100
-
- SendNUIMessage({
- type = "set_status",
- statustype = "health",
- value = val,
- })
- end
- end
- cb("ok")
-
-end)
\ No newline at end of file
diff --git a/resources/[tools]/Codem-BlackHUDV2/client/stress.lua b/resources/[tools]/Codem-BlackHUDV2/client/stress.lua
deleted file mode 100644
index 6f229d1e4..000000000
--- a/resources/[tools]/Codem-BlackHUDV2/client/stress.lua
+++ /dev/null
@@ -1,273 +0,0 @@
-if Config.UseStress then
- local stress = 0
- RegisterNetEvent('hud:client:UpdateStress', function(newStress) -- Add this event with adding stress elsewhere
- stress = newStress
- SendNUIMessage({ type="set_status", statustype = "stress", value = newStress})
- end)
- function IsWhitelistedWeaponStress(weapon)
- if weapon then
- for _, v in pairs(Config.WhitelistedWeaponStress) do
- if weapon == v then
- return true
- end
- end
- end
- return false
- end
- CreateThread(function() -- Speeding
- if Config.AddStress["on_fastdrive"].enable then
- while true do
- local ped = playerPed
- if IsPedInAnyVehicle(ped, false) then
- local speed = GetEntitySpeed(GetVehiclePedIsIn(ped, false)) * speedMultiplier
- local stressSpeed = 110
- if speed >= stressSpeed then
- TriggerServerEvent('hud:server:GainStress', math.random(Config.AddStress["on_fastdrive"].min, Config.AddStress["on_fastdrive"].max))
- end
- end
- Wait(10000)
- end
- end
-
- end)
-
- CreateThread(function() -- Shooting
- if Config.AddStress["on_shoot"].enable then
- while true do
- local ped = playerPed
- local weapon = GetSelectedPedWeapon(ped)
- if weapon ~= `WEAPON_UNARMED` then
- if IsPedShooting(ped) then
- if math.random() < 0.15 and not IsWhitelistedWeaponStress(weapon) then
- TriggerServerEvent('hud:server:GainStress', math.random(Config.AddStress["on_shoot"].min, Config.AddStress["on_shoot"].max))
- end
- end
- else
- Wait(900)
- end
- Wait(8)
- end
-
- end
-
- end)
-
- CreateThread(function()
- while true do
- local ped = playerPed
- if stress >= 100 then
-
- local ShakeIntensity = GetShakeIntensity(stress)
- local FallRepeat = math.random(2, 4)
- local RagdollTimeout = (FallRepeat * 1750)
- ShakeGameplayCam('SMALL_EXPLOSION_SHAKE', ShakeIntensity)
- SetFlash(0, 0, 500, 3000, 500)
-
- if not IsPedRagdoll(ped) and IsPedOnFoot(ped) and not IsPedSwimming(ped) then
- SetPedToRagdollWithFall(ped, RagdollTimeout, RagdollTimeout, 1, GetEntityForwardVector(ped), 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
- end
-
- Wait(500)
- for i=1, FallRepeat, 1 do
- Wait(750)
- DoScreenFadeOut(200)
- Wait(1000)
- DoScreenFadeIn(200)
- ShakeGameplayCam('SMALL_EXPLOSION_SHAKE', ShakeIntensity)
- SetFlash(0, 0, 200, 750, 200)
- end
- elseif stress >= 50 then
- local ShakeIntensity = GetShakeIntensity(stress)
- ShakeGameplayCam('SMALL_EXPLOSION_SHAKE', ShakeIntensity)
- SetFlash(0, 0, 500, 2500, 500)
- end
- Wait(GetEffectInterval(stress))
- end
- end)
-
- function GetShakeIntensity(stresslevel)
- local retval = 0.05
- local Intensity = {
- ["shake"] = {
- [1] = {
- min = 50,
- max = 60,
- intensity = 0.12,
- },
- [2] = {
- min = 60,
- max = 70,
- intensity = 0.17,
- },
- [3] = {
- min = 70,
- max = 80,
- intensity = 0.22,
- },
- [4] = {
- min = 80,
- max = 90,
- intensity = 0.28,
- },
- [5] = {
- min = 90,
- max = 100,
- intensity = 0.32,
- },
- }
- }
- for k, v in pairs(Intensity['shake']) do
- if stresslevel >= v.min and stresslevel <= v.max then
- retval = v.intensity
- break
- end
- end
- return retval
- end
-
- function GetEffectInterval(stresslevel)
- local EffectInterval = {
- [1] = {
- min = 50,
- max = 60,
- timeout = math.random(14000, 15000)
- },
- [2] = {
- min = 60,
- max = 70,
- timeout = math.random(12000, 13000)
- },
- [3] = {
- min = 70,
- max = 80,
- timeout = math.random(10000, 11000)
- },
- [4] = {
- min = 80,
- max = 90,
- timeout = math.random(8000, 9000)
- },
- [5] = {
- min = 90,
- max = 100,
- timeout = math.random(6000, 7000)
- }
- }
- local retval = 10000
- for k, v in pairs(EffectInterval) do
- if stresslevel >= v.min and stresslevel <= v.max then
- retval = v.timeout
- break
- end
- end
- return retval
- end
-
-end
-
-
-RegisterNetEvent('esx_basicneeds:onEat')
-AddEventHandler('esx_basicneeds:onEat', function()
- if Config.RemoveStress["on_eat"].enable then
- local val = math.random(Config.RemoveStress["on_eat"].min, Config.RemoveStress["on_eat"].max)
- TriggerServerEvent('hud:server:RelieveStress', val)
- end
-end)
-
-RegisterNetEvent('consumables:client:Eat')
-AddEventHandler('consumables:client:Eat', function()
- if Config.RemoveStress["on_eat"].enable then
- local val = math.random(Config.RemoveStress["on_eat"].min, Config.RemoveStress["on_eat"].max)
- TriggerServerEvent('hud:server:RelieveStress', val)
- end
-end)
-
-
-RegisterNetEvent('consumables:client:Drink')
-AddEventHandler('consumables:client:Drink', function()
- if Config.RemoveStress["on_drink"].enable then
- local val = math.random(Config.RemoveStress["on_drink"].min, Config.RemoveStress["on_drink"].max)
- TriggerServerEvent('hud:server:RelieveStress', val)
- end
-end)
-RegisterNetEvent('consumables:client:DrinkAlcohol')
-AddEventHandler('consumables:client:DrinkAlcohol', function()
- if Config.RemoveStress["on_drink"].enable then
- local val = math.random(Config.RemoveStress["on_drink"].min, Config.RemoveStress["on_drink"].max)
- TriggerServerEvent('hud:server:RelieveStress', val)
- end
-end)
-
-RegisterNetEvent('devcore_needs:client:StartEat')
-AddEventHandler('devcore_needs:client:StartEat', function()
- if Config.RemoveStress["on_eat"].enable then
- local val = math.random(Config.RemoveStress["on_eat"].min, Config.RemoveStress["on_eat"].max)
- TriggerServerEvent('hud:server:RelieveStress', val)
- end
-end)
-RegisterNetEvent('devcore_needs:client:DrinkShot')
-AddEventHandler('devcore_needs:client:DrinkShot', function()
- if Config.RemoveStress["on_drink"].enable then
- local val = math.random(Config.RemoveStress["on_drink"].min, Config.RemoveStress["on_drink"].max)
- TriggerServerEvent('hud:server:RelieveStress', val)
- end
-end)
-
-RegisterNetEvent('devcore_needs:client:StartDrink')
-AddEventHandler('devcore_needs:client:StartDrink', function()
- if Config.RemoveStress["on_drink"].enable then
- local val = math.random(Config.RemoveStress["on_drink"].min, Config.RemoveStress["on_drink"].max)
- TriggerServerEvent('hud:server:RelieveStress', val)
- end
-end)
-
-RegisterNetEvent('esx_optionalneeds:onDrink')
-AddEventHandler('esx_optionalneeds:onDrink', function()
- if Config.RemoveStress["on_drink"].enable then
- local val = math.random(Config.RemoveStress["on_drink"].min, Config.RemoveStress["on_drink"].max)
- TriggerServerEvent('hud:server:RelieveStress', val)
- end
-end)
-
-
-RegisterNetEvent('esx_basicneeds:onDrink')
-AddEventHandler('esx_basicneeds:onDrink', function()
- if Config.RemoveStress["on_drink"].enable then
- local val = math.random(Config.RemoveStress["on_drink"].min, Config.RemoveStress["on_drink"].max)
- TriggerServerEvent('hud:server:RelieveStress', val)
- end
-end)
-
-AddEventHandler('esx:onPlayerDeath', function()
- TriggerServerEvent('hud:server:RelieveStress', 10000)
-end)
-
-RegisterNetEvent('hospital:client:RespawnAtHospital')
-AddEventHandler('hospital:client:RespawnAtHospital', function()
- TriggerServerEvent('hud:server:RelieveStress', 10000)
-end)
-
-Citizen.CreateThread(function()
- if Config.RemoveStress["on_swimming"].enable then
- while true do
- Citizen.Wait(10000)
- if IsPedSwimming(playerPed) then
- local val = math.random(Config.RemoveStress["on_swimming"].min, Config.RemoveStress["on_swimming"].max)
- TriggerServerEvent('hud:server:RelieveStress', val)
- end
- end
- end
-end)
-
-Citizen.CreateThread(function()
- if Config.RemoveStress["on_running"].enable then
- while true do
- Citizen.Wait(10000)
- if IsPedRunning(playerPed) then
- local val = math.random(Config.RemoveStress["on_running"].min, Config.RemoveStress["on_running"].max)
- TriggerServerEvent('hud:server:RelieveStress', val)
- end
- end
- end
-end)
-
diff --git a/resources/[tools]/Codem-BlackHUDV2/config.lua b/resources/[tools]/Codem-BlackHUDV2/config.lua
deleted file mode 100644
index f18ca03ce..000000000
--- a/resources/[tools]/Codem-BlackHUDV2/config.lua
+++ /dev/null
@@ -1,408 +0,0 @@
-
--------------------------------------------- General --------------------------------------------
-Config = {}
-Config.Framework = "newqb" -- newqb, oldqb, esx
-Config.NewESX = false
-Config.Mysql = "oxmysql" -- mysql-async, ghmattimysql, oxmysql
-Config.MysqlTableName = "codem_hud_data" -- Don't change if you don't know what you're doing
-Config.Voice = "saltychat" -- mumble, saltychat, pma
-Config.DefaultHud = "radial" -- Default hud when player first login avaliable huds [radial, classic, text]
-Config.EnableDynamicStatusFirstJoin = false -- Enable dynamic status first join
-Config.DefaultSpeedUnit = "kmh" -- Default speed unit when player first login avaliable speed units [kmh, mph]
-Config.HudSettingsCommand = 'hudsettings' -- Command for open hud settings
-Config.DisplayMapOnWalk = true -- true - Show map when walking | false - Hide map when walking
-Config.DisplayRealTime = true -- if you set this to true will show the real time according to player local time | if false it will show the game time
-Config.EnableSpamNotification = true -- Spam preventation for seatbelt, cruise etc.
-Config.EnableDateDisplay = true -- Determines if display date or nor
-Config.DefaultMap = "rectangle" -- rectangle, radial
-Config.DefaultSpeedometerSize = 1.2 -- 0.5 - 1.3
-Config.DefaultHudSize = 1.0 -- 0.5 - 1.3
-Config.EnableAmmoHud = true -- Determines if display ammo hud or nor
-Config.DefaultRefreshRate = 200 -- Refresh rate for vehicle hud
-Config.EnableCompass = true
-Config.EnableHealth = true
-Config.EnableHunger = true
-Config.EnableThirst = true
-Config.EnableHud = true
-Config.EnableArmor = true
-Config.EnableStamina = true
-Config.EnableSpeedometer = true
-Config.EnableToggleMapButton = true -- true | enables the toggle minimap button from the hud settings menu | -- false | disables the toggle minimap button from the hud settings menu
-Config.LocationUpdateTime = 2000 -- if you reduce wait time resmon could increase
-Config.SeatBeltFlySpeed = 150 -- Determines at what speed player will be ejected from vehicle when he/she doesn't have seatbelt on
-Config.SeatbeltSound = true
-Config.SeatbeltSoundSpeedLimit = 30
-
--- 1 means smallest and 4 biggest size
-Config.AccountSize = {
- cash = 4,
- bank = 3,
- black_money = 2,
- boss_money = 1,
-}
-
-Config.AvaliablePositions = {
- ["bottom-center"] = {
- left = '48.75rem',
- bottom = '1rem',
- right = 'unset',
- },
- ["bottom-right"] = {
- right = '1rem',
- bottom = '1rem',
- left = 'unset',
- },
- ["top-center"] = {
- left = '48.75rem',
- top = '1rem',
- right = 'unset',
- },
- ["top-left"] = {
- left = '1rem',
- top = '1rem',
- right = 'unset',
- },
-}
-
--- This option sets the default hud positions for players who do not set their own positions from hud settings
-Config.DefaultHudPositions = {
- -- TEXT HUD
- ["text-main"] = 'default', -- avaliable options are [default, bottom-center, bottom-right, top-center, top-left]
- -- RADIAL HUD
- ["radial-hudall"] = 'default', -- avaliable options are [default, bottom-center, bottom-right, top-center, top-left]
- -- CLASSIC HUD
- ["classic-container"] = 'default', -- avaliable options are [default, bottom-center, bottom-right, top-center, top-left]
- -- RADIAL HUD'S COMPASS
- ["radial-compass"] = 'default', -- avaliable options are [default, bottom-center, bottom-right, top-center, top-left]
- -- TEXT HUD'S COMPASS
- ["text-compass"] = 'default', -- avaliable options are [default, bottom-center, bottom-right, top-center, top-left]
- -- CLASSIC HUD'S COMPASS
- ["classic-compass"] = 'default', -- avaliable options are [default, bottom-center, bottom-right, top-center, top-left]
-}
-
-Config.DefaultHudColors = {
- ["radial"] = {
- ["health"] = "#FF4848ac",
- ["armor"] = "#FFFFFFac",
- ["hunger"] = "#FFA048ac",
- ["thirst"] = "#4886FFac",
- ["stress"] = "#48A7FFac",
- ["stamina"] = "#C4FF48ac",
- ["oxy"] = "#48A7FFac",
- ["parachute"] = "#48FFBDac",
- ["nitro"] = "#AFFF48ac",
- ["altitude"] = "#00FFF0ac",
- },
- ["text"] = {
- ["health"] = "#FF4848ac",
- ["armor"] = "#FFFFFFac",
- ["hunger"] = "#FFA048ac",
- ["thirst"] = "#4886FFac",
- ["stress"] = "#48A7FFac",
- ["stamina"] = "#C4FF48ac",
- ["parachute"] = "#48FFBDac",
- ["oxy"] = "#48A7FFac",
- ["nitro"] = "#AFFF48ac",
- ["altitude"] = "#00FFF0ac",
- },
- ["classic"] = {
- ["health"] = "#9F2929",
- ["armor"] = "#2E3893",
- ["hunger"] = "#B3743A",
- ["thirst"] = "#2F549C",
- ["stress"] = "#AA35A6",
- ["oxy"] = "#48A7FFac",
- ["stamina"] = "#c4ff48",
- ["parachute"] = "#48ffde",
- ["nitro"] = "#8eff48",
- ["altitude"] = "#48deff",
- },
-}
-
-
--------------------------------------------- Watermark hud --------------------------------------------
-Config.DisableWaterMarkTextAndLogo = false -- true - Disable watermark text and logo
-Config.UseWaterMarkText = false -- if true text will be shown | if false logo will be shown
-Config.WaterMarkText1 = "CODEM" -- Top right server text
-Config.WaterMarkText2 = "SCRiPTS" -- Top right server text
-Config.WaterMarkLogo = "https://cdn.discordapp.com/attachments/862018783391252500/967359920703942686/Frame_303.png" -- Logo url
-Config.LogoWidth = "11.875rem"
-Config.LogoHeight = "3.313rem"
-Config.EnableId = true -- Determines if display server id or nor
-Config.EnableWatermarkCash = true -- Determines if display cash or nor
-Config.EnableWatermarkBlackMoney = true -- Determines if display black_money or nor (only esx)
-Config.EnableWatermarkBossMoney = true -- Determines if display boss money or nor (only esx)
-Config.BossGradeNames = { -- you can set custom boss grade names here otherwise hud gets grade name as boss
- ["police"] = 'boss',
- ["ambulance"] = 'boss',
-}
-
-Config.EnableWatermarkBankMoney = true -- Determines if display bank money or nor
-Config.EnableWatermarkJob = true -- Determines if display job or nor
-Config.EnableWatermarkWeaponImage = true -- Determines if display weapon image or nor
-Config.EnableWaterMarkHud = true -- Determines if right-top hud is enabled or not
-
-Config.EnableWaterMarkHudHideButtons = true
-
-Config.Text1Style = {
- ["color"] = '#e960c7',
- ["text-shadow"] = "0px 0.38rem 2.566rem rgba(116, 5, 147, 0.55)",
-}
-
-Config.Text2Style = {
- ["color"] = "#ffffff",
-}
-
--------------------------------------------- Keys --------------------------------------------
-Config.DefaultCruiseControlKey = "p" -- Default control key for cruise. Players can change the key according to their desire
-Config.DefaultSeatbeltControlKey = "b" -- Default control key for seatbelt. Players can change the key according to their desire
-Config.VehicleEngineToggleKey = "o" -- Default control key for toggle engine. Players can change the key according to their desire
-Config.NitroKey = "n" -- Default control key for use nitro. Players can change the key according to their desire
-
--------------------------------------------- Nitro --------------------------------------------
-Config.RemoveNitroOnpress = 2 -- Determines of how much you want to remove nitro when player press nitro key
-Config.NitroItem = "nitrous" -- item to install nitro to a vehicle
-Config.EnableNitro = true -- Determines if nitro system is enabled or not
-Config.NitroForce = 40.0 -- Nitro force when player using nitro
-
--------------------------------------------- Money commands --------------------------------------------
-Config.EnableCashAndBankCommands = true -- Determines if money commands are enabled or not
-Config.CashCommand = "cash" -- command to see cash
-Config.BankCommand = "bank" -- command to see bank money
-
--------------------------------------------- Engine Toggle --------------------------------------------
-Config.EnableEngineToggle = true -- Determines if engine toggle is enabled or not
-
--------------------------------------------- Vehicle Functionality --------------------------------------------
-Config.EnableCruise = true -- Determines if cruise mode is active
-Config.EnableSeatbelt = true -- Determines if seatbelt is active
-
--------------------------------------------- Settings text --------------------------------------------
-Config.SettingsLocale = { -- Settings texts
- ["text_hud_1"] = "text",
- ["text_hud_2"] = "hud",
- ["classic_hud_1"] = "classic",
- ["classic_hud_2"] = "hud",
- ["radial_hud_1"] = "radial",
- ["radial_hud_2"] = "hud",
- ["hide_hud"] = "Hide Hud",
- ["health"] = "Health",
- ["armor"] = "Armor",
- ["thirst"] = "Thirst",
- ["stress"] = "Stress",
- ["oxy"] = "Oxygen",
- ["hunger"] = "Hunger",
- ["show_hud"] = "Show Hud",
- ["stamina"] = "Stamina",
- ["nitro"] = "Nitro",
- ["Altitude"] = "Altitude",
- ["Parachute"] = "Parachute",
- ["enable_cinematicmode"] = "Cinematic Mode",
- ["disable_cinematicmode"] = "Disable Cinematic",
-
- ["speedometer"] = "SPEEDOMETER",
- ["map"] = "MAP",
- ["show_compass"] = "Show Compass",
- ["hide_compass"] = "Hide Compass",
- ["rectangle"] = "Rectangle",
- ["radial"] = "Radial",
- ["dynamic"] = "DYNAMiC",
- ["status"] = "STATUS",
- ["enable"] = "Enable",
- ["hud_size"] = "Status size",
- ["disable"] = "Disable",
- ["hide_at"] = "Hide at",
- ["and_above"] = "and above",
- ["and_below"] = "and below",
- ["enable_edit_mode"] = "Drag HUD (One by one)",
- ["enable_edit_mode_2"] = "Drag HUD (All)",
- ["change_status_size"] = "Change status size",
- ["change_color"] = "Change color of selected hud ",
- ["disable_edit_mode"] = "Disable Edit Mode",
- ["reset_hud_positions"] = "Reset Hud Positions",
- ["info_text"] = "Be aware decraising refresh rate may decrease your in game performance!",
- ["speedometer_size"] = "Speedometer Size",
- ["refresh_rate"] = "Refresh Rate",
- ["esc_to_exit"] = "PRESS ESC TO EXIT EDIT MODE",
- ["toggle_minimap"] = "Toggle Minimap",
- ["currency"] = '$',
- ["hide_id"] = 'Hide ID',
- ["hide_logo"] = 'Hide Logo',
- ["hide_cash"] = 'Hide Cash Money',
- ["hide_bank"] = 'Hide Bank Money',
- ["hide_boss_money"] = 'Hide Boss Money',
- ["hide_black_money"] = 'Hide Black Money',
- ["hide_weapon"] = 'Hide Weapon',
- ["hide_ammo"] = 'Hide Ammo',
- ["hide_job"] = 'Hide Job',
- ["hide_all"] = 'Hide All',
-
-
- ["show_id"] = 'Show ID',
- ["show_logo"] = 'Show Logo',
- ["show_cash"] = 'Show Cash Money',
- ["show_bank"] = 'Show Bank Money',
- ["show_boss_money"] = 'Show Boss Money',
- ["show_black_money"] = 'Show Black Money',
- ["show_weapon"] = 'Show Weapon',
- ["show_ammo"] = 'Show Ammo',
- ["show_job"] = 'Show Job',
- ["show_all"] = 'Show All'
-}
-
--------------------------------------------- Fuel --------------------------------------------
--------------------------------------------- Fuel --------------------------------------------
-Config.EnableFuel = true -- Do NOT Touch if you have any fuel system
-Config.FuelSystem = 'lc_fuel' -- LegacyFuel / ox-fuel / nd-fuel / frfuel / cdn-fuel
-
-Config.GetVehicleFuel = function(vehicle)
- if Config.EnableFuel then
- if DoesEntityExist(vehicle) then
- if Config.FuelSystem == 'LegacyFuel' then
- return exports["LegacyFuel"]:GetFuel(vehicle)
- elseif Config.FuelSystem == 'ox-fuel' then
- return GetVehicleFuelLevel(vehicle)
- elseif Config.FuelSystem == 'cdn_fuel' then
- return exports["nd-fuel"]:GetFuel(vehicle)
- elseif Config.FuelSystem == 'frfuel' then
- return exports.frfuel:getCurrentFuelLevel(vehicle)
- elseif Config.FuelSystem == 'cdn_fuel' then
- return exports['cdn-fuel']:GetFuel(vehicle)
- elseif Config.FuelSystem == 'lc_fuel' then
- return exports["lc_fuel"]:GetFuel(vehicle)
- else
- -- You can added export if you want it
- end
- end
- else
- return GetVehicleFuelLevel(vehicle)
- end
-end
-
--------------------------------------------- Stress --------------------------------------------
-
-Config.UseStress = false -- if you set this to false the stress hud will be removed
-Config.StressWhitelistJobs = { -- Add here jobs you want to disable stress
- 'police', 'ambulance'
-}
-
-Config.WhitelistedWeaponStress = {
- 'weapon_petrolcan',
- 'weapon_hazardcan',
- 'weapon_fireextinguisher'
-}
-
-Config.AddStress = {
- ["on_shoot"] = {
- min = 1,
- max = 3,
- enable = true,
- },
- ["on_fastdrive"] = {
- min = 1,
- max = 3,
- enable = true,
- },
-}
-
-Config.RemoveStress = { -- You can set here amounts by your desire
- ["on_eat"] = {
- min = 5,
- max = 10,
- enable = true,
-
- },
- ["on_drink"] = {
- min = 5,
- max = 10,
- enable = true,
-
- },
- ["on_swimming"] = {
- min = 5,
- max = 10,
- enable = true,
-
- },
- ["on_running"] = {
- min = 5,
- max = 10,
- enable = true,
- },
-
-}
-
-
-
--------------------------------------------- Notifications --------------------------------------------
-
-Config.Notifications = { -- Notifications
- ["stress_gained"] = {
- message = 'Getting Stressed',
- type = "error",
- },
- ["stress_relive"] = {
- message = 'You Are Relaxing',
- type = "success",
- },
- ["took_off_seatbelt"] = {
- type = "error",
- message = "Du hast dich abgeschnallt.",
- },
- ["took_seatbelt"] = {
- type = "success",
- message = "Du hast dich angeschnallt.",
- },
- ["cruise_actived"] = {
- type = "success",
- message = "Cruise actived.",
- },
- ["cruise_disabled"] = {
- type = "error",
- message = "Cruise disabled.",
- },
- ["spam"] = {
- type = "error",
- message = "Please wait for a few seconds.",
- },
- ["engine_on"] = {
- type = "success",
- message = "Motor an",
- },
- ["engine_off"] = {
- type = "success",
- message = "Motor aus",
- },
- ["cant_install_nitro"] = {
- type = "error",
- message = "You can't install nitro inside vehicle.",
- },
- ["no_veh_nearby"] = {
- type = "error",
- message = "No vehicle nearby.",
- },
- ["cash_display"] = {
- type = "success",
- message = "You have $%s in your pocket.",
- },
- ["bank_display"] = {
- type = "success",
- message = "You have $%s in your bank.",
- },
-}
-
-Config.Notification = function(message, type, isServer, src) -- You can change here events for notifications
- if isServer then
- if Config.Framework == "esx" then
- TriggerClientEvent("esx:showNotification", src, message)
- else
- TriggerClientEvent('QBCore:Notify', src, message, type, 1500)
- end
- else
- if Config.Framework == "esx" then
- TriggerEvent("esx:showNotification", message)
- else
- TriggerEvent('QBCore:Notify', message, type, 1500)
- end
- end
-end
\ No newline at end of file
diff --git a/resources/[tools]/Codem-BlackHUDV2/fxmanifest.lua b/resources/[tools]/Codem-BlackHUDV2/fxmanifest.lua
deleted file mode 100644
index 49d7f4c73..000000000
--- a/resources/[tools]/Codem-BlackHUDV2/fxmanifest.lua
+++ /dev/null
@@ -1,63 +0,0 @@
-fx_version 'cerulean'
-game 'gta5'
-author 'Lucid#3604'
-
-
-shared_scripts {
- 'config.lua'
-}
-
-
-client_scripts {
- 'GetFrameworkObject.lua',
- 'client/client.lua',
- 'client/nitro.lua',
- 'client/seatbelt.lua',
- 'client/stress.lua',
- 'client/UpdateMoney.lua',
- 'client/status.lua',
-}
-server_scripts {
- '@mysql-async/lib/MySQL.lua',
- '@oxmysql/lib/MySQL.lua',
- 'GetFrameworkObject.lua',
- 'server/server.lua',
- 'server/seatbelt.lua',
- 'server/PlayerLoaded.lua',
- 'server/stress.lua',
- 'server/nitro.lua',
-}
-
-ui_page {
- 'html/index.html',
-}
-
-files {
- 'html/assets/fonts/*.otf',
- 'html/assets/images/*.png',
- 'html/assets/weapons/*.png',
-
- 'html/lib/*.js',
- 'html/script/*.js',
- 'html/index.html',
- 'html/*.ogg',
- 'html/style/*.css',
-}
-
-lua54 'on'
-
-
-escrow_ignore {
- 'config.lua',
- 'GetFrameworkObject.lua',
- 'server/PlayerLoaded.lua',
- 'server/stress.lua',
- 'server/nitro.lua',
- 'client/nitro.lua',
- 'server/seatbelt.lua',
- 'client/seatbelt.lua',
- 'client/stress.lua',
- 'client/UpdateMoney.lua',
- 'client/status.lua'
-}
-dependency '/assetpacks'
\ No newline at end of file
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/fonts/Gilroy-ExtraBold.otf b/resources/[tools]/Codem-BlackHUDV2/html/assets/fonts/Gilroy-ExtraBold.otf
deleted file mode 100644
index 7413e3d4a..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/fonts/Gilroy-ExtraBold.otf and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/fonts/Gilroy-Light.otf b/resources/[tools]/Codem-BlackHUDV2/html/assets/fonts/Gilroy-Light.otf
deleted file mode 100644
index dbc05129b..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/fonts/Gilroy-Light.otf and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/fonts/Joyride-Extended.otf b/resources/[tools]/Codem-BlackHUDV2/html/assets/fonts/Joyride-Extended.otf
deleted file mode 100644
index fc654944a..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/fonts/Joyride-Extended.otf and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/fonts/Joyride-Regular.otf b/resources/[tools]/Codem-BlackHUDV2/html/assets/fonts/Joyride-Regular.otf
deleted file mode 100644
index a34e408ec..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/fonts/Joyride-Regular.otf and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/fonts/Joyride-Round.otf b/resources/[tools]/Codem-BlackHUDV2/html/assets/fonts/Joyride-Round.otf
deleted file mode 100644
index c10e60e16..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/fonts/Joyride-Round.otf and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/activeCircle.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/activeCircle.png
deleted file mode 100644
index f541c75dc..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/activeCircle.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/activeRectangle.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/activeRectangle.png
deleted file mode 100644
index 1ea0c71e1..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/activeRectangle.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/activeSpeedunit.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/activeSpeedunit.png
deleted file mode 100644
index 1ea0c71e1..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/activeSpeedunit.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/altitude.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/altitude.png
deleted file mode 100644
index cda83ad8d..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/altitude.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/altitudeText.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/altitudeText.png
deleted file mode 100644
index 27eb64271..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/altitudeText.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/ammo-icon.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/ammo-icon.png
deleted file mode 100644
index 005b9eb11..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/ammo-icon.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/armouricon.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/armouricon.png
deleted file mode 100644
index 227591e87..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/armouricon.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/arrow.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/arrow.png
deleted file mode 100644
index 9f879f1fa..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/arrow.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/bank_icon.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/bank_icon.png
deleted file mode 100644
index e999590dc..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/bank_icon.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/bg-black.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/bg-black.png
deleted file mode 100644
index bb03c5295..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/bg-black.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/black_money_icon.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/black_money_icon.png
deleted file mode 100644
index d81cff7fe..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/black_money_icon.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/boss_money_icon.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/boss_money_icon.png
deleted file mode 100644
index 75e70ceca..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/boss_money_icon.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/brain.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/brain.png
deleted file mode 100644
index 87d110ee6..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/brain.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/briefcase_1.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/briefcase_1.png
deleted file mode 100644
index 8c361bb11..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/briefcase_1.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/cash_icon.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/cash_icon.png
deleted file mode 100644
index efc2bbe35..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/cash_icon.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/change-color-container.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/change-color-container.png
deleted file mode 100644
index fe7431f57..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/change-color-container.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/change-size-container.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/change-size-container.png
deleted file mode 100644
index 90940df0c..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/change-size-container.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/disabledCircle.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/disabledCircle.png
deleted file mode 100644
index e155148ab..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/disabledCircle.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/disabledRectangle.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/disabledRectangle.png
deleted file mode 100644
index 2bb0d17a1..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/disabledRectangle.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/healthIcon.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/healthIcon.png
deleted file mode 100644
index 09a74ecc9..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/healthIcon.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/heart-size-big.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/heart-size-big.png
deleted file mode 100644
index 434a872ad..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/heart-size-big.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/heart-size-small.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/heart-size-small.png
deleted file mode 100644
index 6eac9bcb0..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/heart-size-small.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/heart.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/heart.png
deleted file mode 100644
index e1b561382..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/heart.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/hunger.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/hunger.png
deleted file mode 100644
index 3e5bc2cb3..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/hunger.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/infoBox.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/infoBox.png
deleted file mode 100644
index 2cd5c753b..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/infoBox.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/left.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/left.png
deleted file mode 100644
index ab07cfdb0..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/left.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/lungs-blue.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/lungs-blue.png
deleted file mode 100644
index 607dd64a9..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/lungs-blue.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/lungs-white.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/lungs-white.png
deleted file mode 100644
index ed62f7370..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/lungs-white.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/mapBottom.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/mapBottom.png
deleted file mode 100644
index 356c8ceba..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/mapBottom.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/mapTop.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/mapTop.png
deleted file mode 100644
index 137eae79f..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/mapTop.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/nitro.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/nitro.png
deleted file mode 100644
index 185cbee5c..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/nitro.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/nitroText.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/nitroText.png
deleted file mode 100644
index d8fb5d8f5..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/nitroText.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/parachute.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/parachute.png
deleted file mode 100644
index fc94ade4e..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/parachute.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/parachuteText.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/parachuteText.png
deleted file mode 100644
index 8c9026910..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/parachuteText.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/radialContainer.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/radialContainer.png
deleted file mode 100644
index e085645c5..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/radialContainer.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/right.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/right.png
deleted file mode 100644
index 0752537f3..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/right.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/run.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/run.png
deleted file mode 100644
index 48d2b35b1..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/run.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/settingsBg.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/settingsBg.png
deleted file mode 100644
index e5dd32e7c..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/settingsBg.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/settingsMap.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/settingsMap.png
deleted file mode 100644
index 69f6aa049..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/settingsMap.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/speedometer.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/speedometer.png
deleted file mode 100644
index 699c8a9ed..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/speedometer.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/stamina.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/stamina.png
deleted file mode 100644
index fd528ad7c..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/stamina.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/stress.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/stress.png
deleted file mode 100644
index 3bfe89613..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/stress.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/textHudWrapper.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/textHudWrapper.png
deleted file mode 100644
index 5df64849b..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/textHudWrapper.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/thirst.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/images/thirst.png
deleted file mode 100644
index 419dea98d..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/images/thirst.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/advancedrifle.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/advancedrifle.png
deleted file mode 100644
index 282aa8286..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/advancedrifle.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/appistol.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/appistol.png
deleted file mode 100644
index 7be776102..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/appistol.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/assaultrifle.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/assaultrifle.png
deleted file mode 100644
index 40c4beef6..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/assaultrifle.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/assaultrifle_mk2.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/assaultrifle_mk2.png
deleted file mode 100644
index b9b75178d..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/assaultrifle_mk2.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/assaultshotgun.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/assaultshotgun.png
deleted file mode 100644
index 822d832e0..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/assaultshotgun.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/assaultsmg.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/assaultsmg.png
deleted file mode 100644
index d787be577..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/assaultsmg.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/autoshotgun.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/autoshotgun.png
deleted file mode 100644
index a27c19571..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/autoshotgun.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/ball.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/ball.png
deleted file mode 100644
index aa66e2609..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/ball.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/bat.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/bat.png
deleted file mode 100644
index f21503823..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/bat.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/battleaxe.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/battleaxe.png
deleted file mode 100644
index 99542b3f9..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/battleaxe.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/bottle.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/bottle.png
deleted file mode 100644
index 2743bc6ae..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/bottle.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/bullpuprifle.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/bullpuprifle.png
deleted file mode 100644
index ddc065702..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/bullpuprifle.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/bullpuprifle_mk2.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/bullpuprifle_mk2.png
deleted file mode 100644
index a7a168199..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/bullpuprifle_mk2.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/bullpupshotgun.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/bullpupshotgun.png
deleted file mode 100644
index 285a48768..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/bullpupshotgun.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/bzgas.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/bzgas.png
deleted file mode 100644
index 49cc6a5f0..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/bzgas.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/carbinerifle.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/carbinerifle.png
deleted file mode 100644
index 7f5f2134e..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/carbinerifle.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/carbinerifle_mk2.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/carbinerifle_mk2.png
deleted file mode 100644
index 63368f2d2..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/carbinerifle_mk2.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/combatmg.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/combatmg.png
deleted file mode 100644
index 81fd9bcdc..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/combatmg.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/combatmg_mk2.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/combatmg_mk2.png
deleted file mode 100644
index 0799024fe..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/combatmg_mk2.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/combatpdw.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/combatpdw.png
deleted file mode 100644
index 89b8dffe3..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/combatpdw.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/combatpistol.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/combatpistol.png
deleted file mode 100644
index e586f69da..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/combatpistol.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/compactlauncher.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/compactlauncher.png
deleted file mode 100644
index b879d34d3..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/compactlauncher.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/compactrifle.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/compactrifle.png
deleted file mode 100644
index 6897cd449..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/compactrifle.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/crowbar.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/crowbar.png
deleted file mode 100644
index 13e474584..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/crowbar.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/dagger.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/dagger.png
deleted file mode 100644
index e270fdbc9..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/dagger.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/dbshotgun.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/dbshotgun.png
deleted file mode 100644
index 932cbbe5e..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/dbshotgun.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/doubleaction.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/doubleaction.png
deleted file mode 100644
index bdbb07616..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/doubleaction.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/firework.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/firework.png
deleted file mode 100644
index f27bee3aa..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/firework.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/flare.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/flare.png
deleted file mode 100644
index 890cc51e4..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/flare.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/flaregun.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/flaregun.png
deleted file mode 100644
index a163d80fb..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/flaregun.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/flashlight.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/flashlight.png
deleted file mode 100644
index 4bfd7d483..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/flashlight.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/golfclub.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/golfclub.png
deleted file mode 100644
index a59906295..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/golfclub.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/grenade.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/grenade.png
deleted file mode 100644
index 81863d760..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/grenade.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/grenadelauncher.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/grenadelauncher.png
deleted file mode 100644
index cca0001b2..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/grenadelauncher.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/grenadelauncher_smoke.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/grenadelauncher_smoke.png
deleted file mode 100644
index cca0001b2..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/grenadelauncher_smoke.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/gusenberg.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/gusenberg.png
deleted file mode 100644
index 1fcb2cb4f..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/gusenberg.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/hammer.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/hammer.png
deleted file mode 100644
index 6a1980edc..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/hammer.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/hatchet.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/hatchet.png
deleted file mode 100644
index 1611d000c..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/hatchet.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/heavypistol.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/heavypistol.png
deleted file mode 100644
index fc2fd7dbe..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/heavypistol.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/heavyshotgun.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/heavyshotgun.png
deleted file mode 100644
index 6cb1a5e5e..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/heavyshotgun.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/heavysniper.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/heavysniper.png
deleted file mode 100644
index 4d6c52214..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/heavysniper.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/heavysniper_mk2.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/heavysniper_mk2.png
deleted file mode 100644
index 8a7899a16..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/heavysniper_mk2.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/hominglauncher.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/hominglauncher.png
deleted file mode 100644
index 825fc6290..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/hominglauncher.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/knife.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/knife.png
deleted file mode 100644
index 37d4efcbe..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/knife.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/knuckle.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/knuckle.png
deleted file mode 100644
index 2b96f5b9d..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/knuckle.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/machete.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/machete.png
deleted file mode 100644
index c1ad67608..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/machete.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/machinepistol.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/machinepistol.png
deleted file mode 100644
index 0219843d2..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/machinepistol.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/marksmanpistol.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/marksmanpistol.png
deleted file mode 100644
index 586bc20f5..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/marksmanpistol.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/marksmanrifle.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/marksmanrifle.png
deleted file mode 100644
index 6df75b646..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/marksmanrifle.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/marksmanrifle_mk2.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/marksmanrifle_mk2.png
deleted file mode 100644
index 9348d13a0..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/marksmanrifle_mk2.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/mg.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/mg.png
deleted file mode 100644
index 113bd193c..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/mg.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/microsmg.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/microsmg.png
deleted file mode 100644
index 9a5b739f8..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/microsmg.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/minigun.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/minigun.png
deleted file mode 100644
index 5c214599a..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/minigun.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/minismg.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/minismg.png
deleted file mode 100644
index 35cb80952..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/minismg.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/molotov.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/molotov.png
deleted file mode 100644
index ef7845590..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/molotov.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/musket.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/musket.png
deleted file mode 100644
index 846f0ea0a..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/musket.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/nightstick.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/nightstick.png
deleted file mode 100644
index 2f4b83315..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/nightstick.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/petrolcan.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/petrolcan.png
deleted file mode 100644
index 4cc086322..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/petrolcan.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/pipebomb.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/pipebomb.png
deleted file mode 100644
index aef7e97cf..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/pipebomb.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/pistol.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/pistol.png
deleted file mode 100644
index 596cd6f48..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/pistol.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/pistol50.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/pistol50.png
deleted file mode 100644
index d55b730d8..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/pistol50.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/pistol_mk2.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/pistol_mk2.png
deleted file mode 100644
index fcbbfa29d..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/pistol_mk2.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/poolcue.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/poolcue.png
deleted file mode 100644
index ec5743f39..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/poolcue.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/proxmine.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/proxmine.png
deleted file mode 100644
index 669140e8a..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/proxmine.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/pumpshotgun.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/pumpshotgun.png
deleted file mode 100644
index bb3feaa4c..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/pumpshotgun.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/pumpshotgun_mk2.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/pumpshotgun_mk2.png
deleted file mode 100644
index b936ba928..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/pumpshotgun_mk2.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/railgun.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/railgun.png
deleted file mode 100644
index a5611404f..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/railgun.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/raycarbine.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/raycarbine.png
deleted file mode 100644
index 709ffc0d7..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/raycarbine.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/rayminigun.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/rayminigun.png
deleted file mode 100644
index 140c97f8f..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/rayminigun.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/raypistol.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/raypistol.png
deleted file mode 100644
index b9e56d642..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/raypistol.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/revolver.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/revolver.png
deleted file mode 100644
index a5e529f83..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/revolver.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/revolver_mk2.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/revolver_mk2.png
deleted file mode 100644
index 500f9c1f5..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/revolver_mk2.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/rpg.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/rpg.png
deleted file mode 100644
index f108bd475..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/rpg.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/sawnoffshotgun.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/sawnoffshotgun.png
deleted file mode 100644
index b722a4408..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/sawnoffshotgun.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/smg.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/smg.png
deleted file mode 100644
index 69380b2e7..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/smg.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/smg_mk2.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/smg_mk2.png
deleted file mode 100644
index fb90422e1..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/smg_mk2.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/smokegrenade.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/smokegrenade.png
deleted file mode 100644
index 49cc6a5f0..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/smokegrenade.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/sniperrifle.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/sniperrifle.png
deleted file mode 100644
index 0093806bf..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/sniperrifle.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/snowball.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/snowball.png
deleted file mode 100644
index 01157fd11..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/snowball.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/snspistol.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/snspistol.png
deleted file mode 100644
index 0991add73..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/snspistol.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/snspistol_mk2.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/snspistol_mk2.png
deleted file mode 100644
index 7b11a7856..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/snspistol_mk2.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/specialcarbine.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/specialcarbine.png
deleted file mode 100644
index e8982f593..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/specialcarbine.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/specialcarbine_mk2.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/specialcarbine_mk2.png
deleted file mode 100644
index b69bdd1f6..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/specialcarbine_mk2.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/stickybomb.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/stickybomb.png
deleted file mode 100644
index 06f718fb2..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/stickybomb.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/stone_hatchet.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/stone_hatchet.png
deleted file mode 100644
index a24ca958b..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/stone_hatchet.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/stungun.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/stungun.png
deleted file mode 100644
index 3b36f8ef2..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/stungun.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/switchblade.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/switchblade.png
deleted file mode 100644
index e4675c8bc..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/switchblade.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/unarmed.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/unarmed.png
deleted file mode 100644
index 1e6ad2397..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/unarmed.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/vintagepistol.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/vintagepistol.png
deleted file mode 100644
index e9a3d8c59..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/vintagepistol.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/wrench.png b/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/wrench.png
deleted file mode 100644
index f3a75fd26..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/assets/weapons/wrench.png and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/buckle.ogg b/resources/[tools]/Codem-BlackHUDV2/html/buckle.ogg
deleted file mode 100644
index 209f7cc15..000000000
Binary files a/resources/[tools]/Codem-BlackHUDV2/html/buckle.ogg and /dev/null differ
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/index.html b/resources/[tools]/Codem-BlackHUDV2/html/index.html
deleted file mode 100644
index f937e3f7d..000000000
--- a/resources/[tools]/Codem-BlackHUDV2/html/index.html
+++ /dev/null
@@ -1,1421 +0,0 @@
-
-
-
-
-
-
-
- Document
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
{{locales['dynamic']}}
-
{{locales['status']}}
-
-
-
-
-
-
-
{{locales['hide_at']}}
-
-
{{locales['and_above']}}
-
-
-
-
-
-
{{locales['hide_at']}}
-
-
{{locales['and_below']}}
-
-
-
-
-
-
{{locales['hide_at']}}
-
-
{{locales['and_above']}}
-
-
-
-
-
-
-
{{locales['hide_at']}}
-
-
{{locales['and_above']}}
-
-
-
-
{{locales['hide_at']}}
-
-
{{locales['and_below']}}
-
-
-
-
{{locales['hide_at']}}
-
-
{{locales['and_above']}}
-
-
-
-
-
-
-
-
-
- {{waterMarkHudVisibleData['id'] ? locales['hide_id'] : locales['show_id']}}
-
-
- {{waterMarkHudVisibleData['logo'] ? locales['hide_logo'] : locales['show_logo']}}
-
-
-
- {{waterMarkHudVisibleData['cash'] ? locales['hide_cash'] : locales['show_cash']}}
-
-
- {{waterMarkHudVisibleData['bank_money'] ? locales['hide_bank'] : locales['show_bank']}}
-
-
- {{waterMarkHudVisibleData['boss_money'] ? locales['hide_boss_money'] :
- locales['show_boss_money']}}
-
-
- {{waterMarkHudVisibleData['black_money'] ? locales['hide_black_money'] :
- locales['show_black_money']}}
-
-
- {{waterMarkHudVisibleData['weapon'] ? locales['hide_weapon'] : locales['show_weapon']}}
-
-
- {{waterMarkHudVisibleData['ammo'] ? locales['hide_ammo'] : locales['show_ammo']}}
-
-
- {{waterMarkHudVisibleData['job'] ? locales['hide_job'] : locales['show_job']}}
-
-
- {{waterMarkHudVisibleData['all'] ? locales['hide_all'] : locales['show_all']}}
-
-
-
-
-
-
-
-
-
-
{{locales['map']}}
-
-
-
-
-
-
-
-
-
-
-
-
-

-
{{locales['info_text']}}
-
-
-
{{locales['refresh_rate']}}
-
-
{{locales['speedometer']}}
-
-
-
{{locales['speedometer_size']}}
-
0.5
-
1.3
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{locales['text_hud_1']}}
-
{{locales['text_hud_2']}}
-
-
-
-
-
-
-
-
-
- {{locales['classic_hud_1']}}
-
{{locales['classic_hud_2']}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{locales['radial_hud_1']}}
-
{{locales['radial_hud_2']}}
-
-
-
-
-
-
-
-
-
{{locales['change_status_size']}}
-
-

-

-
-
-
-
-
{{locales['hud_size']}}
-
0.5
-
1.3
-
-
-
-
-
-
{{locales['change_color']}}
-
-
-
-
-
-
-
-
-
-
{{locales['health']}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
{{locales['thirst']}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
{{locales['stress']}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
{{locales['oxy']}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
{{locales['armor']}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
{{locales['hunger']}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
{{locales['stamina']}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
{{locales['nitro']}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
{{locales['Altitude']}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
{{locales['Parachute']}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
{{zone}}
-
{{street}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
{{statusData.health}}%
-
-
-
-
-
-
{{statusData.armour}}%
-
-
-
-
-
-
{{statusData.hunger}}%
-
-
-
-
-
-
{{statusData.thirst}}%
-
-
-
-
-
-
{{statusData.stress}}%
-
-
-
-
-
-
{{statusData.oxy}}%
-
-
-
-
-
-
-
{{statusData.stamina}}%
-
-
-
-
-
-
-
-
-
{{statusData.altitude}}ft
-
-
-
-
-
-
-
-
{{statusData.altitude}}ft
-
-
-
-
-
-
-
-
{{statusData.nitro}}%
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{text1}}
- {{text2}}
-
-
-
![]()
-
-
-
-
-
-
-
-
-
- {{locales['currency']}}{{numberWithSpaces(0)}}
-
-
-
-
-
-
{{isMinus ? '-' :
- '+'}}{{locales['currency']}}{{numberWithSpaces(addedMoney)}}
-
-
-
-
-
-
-
- {{locales['currency']}}{{numberWithSpaces(cash.toFixed(0))}}
-
-
-
-
- {{locales['currency']}}{{numberWithSpaces(bankMoney.toFixed(0))}}
-
-
-
- {{locales['currency']}}{{numberWithSpaces(blackMoney.toFixed(0))}}
-
-
-
- {{locales['currency']}}{{numberWithSpaces(bossMoney.toFixed(0))}}
-
-
-
-
-

-
{{ammo}}
-
{{max_ammo}}
-
-
-
![]()
-

-
-
-
-
{{joblabel}}
-
{{grade_label}}
-
-

-
-
-
-
-
-
-
-
-
-
-
-
-
{{selectSpeedUnit == 'kmh' ? 'KM/H' : 'MPH'}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 0
-
-
- 20
-
-
- 40
-
-
- 60
-
-
- 80
-
-
- 100
-
-
- 120
-
-
- 140
-
-
- 160
-
-
- 180
-
-
- 200
-
-
- 220
-
-
- 240
-
-
- 260
-
-
- 300
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/lib/progressbar.js b/resources/[tools]/Codem-BlackHUDV2/html/lib/progressbar.js
deleted file mode 100644
index 4b6494100..000000000
--- a/resources/[tools]/Codem-BlackHUDV2/html/lib/progressbar.js
+++ /dev/null
@@ -1,894 +0,0 @@
-(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.ProgressBar = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;il?l:n,p=a-(l-h);h>=l?(c(f,e,p),t.stop(!0)):(t._applyFilter("beforeTween"),h1&&void 0!==arguments[1]?arguments[1]:"linear",e={},r=u(n);if("string"===r||"function"===r)for(var i in t)e[i]=n;else for(var o in t)e[o]=n[o]||"linear";return e},g=function(t){if(t===h)(h=t._next)?h._previous=null:p=null;else if(t===p)(p=t._previous)?p._next=null:h=null;else{var n=t._previous,e=t._next;n._next=e,e._previous=n}t._previous=t._next=null},b=function(){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this._currentState=n,this._configured=!1,this._filters=[],this._timestamp=null,this._next=null,this._previous=null,e&&this.setConfig(e)}var n,e,r;return n=t,(e=[{key:"_applyFilter",value:function(t){var n=!0,e=!1,r=void 0;try{for(var i,u=this._filters[Symbol.iterator]();!(n=(i=u.next()).done);n=!0){var o=i.value[t];o&&o(this)}}catch(t){e=!0,r=t}finally{try{n||null==u.return||u.return()}finally{if(e)throw r}}}},{key:"tween",value:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,e=this._attachment,r=this._configured;return!n&&r||this.setConfig(n),this._pausedAtTime=null,this._timestamp=t.now(),this._start(this.get(),e),this.resume()}},{key:"setConfig",value:function(){var n=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.attachment,i=e.delay,u=void 0===i?0:i,o=e.duration,c=void 0===o?500:o,f=e.easing,s=e.from,h=e.promise,p=void 0===h?Promise:h,d=e.start,v=void 0===d?l:d,y=e.step,_=void 0===y?l:y,g=e.to;this._configured=!0,this._attachment=r,this._isPlaying=!1,this._pausedAtTime=null,this._scheduleId=null,this._delay=u,this._start=v,this._step=_,this._duration=c,this._currentState=a({},s||this.get()),this._originalState=this.get(),this._targetState=a({},g||this.get());var b=this._currentState;this._targetState=a({},b,{},this._targetState),this._easing=m(b,f);var w=t.filters;for(var O in this._filters.length=0,w)w[O].doesApply(this)&&this._filters.push(w[O]);return this._applyFilter("tweenCreated"),this._promise=new p((function(t,e){n._resolve=t,n._reject=e})),this._promise.catch(l),this}},{key:"get",value:function(){return a({},this._currentState)}},{key:"set",value:function(t){this._currentState=t}},{key:"pause",value:function(){if(this._isPlaying)return this._pausedAtTime=t.now(),this._isPlaying=!1,g(this),this}},{key:"resume",value:function(){if(null===this._timestamp)return this.tween();if(this._isPlaying)return this._promise;var n=t.now();return this._pausedAtTime&&(this._timestamp+=n-this._pausedAtTime,this._pausedAtTime=null),this._isPlaying=!0,null===h?(h=this,p=this,function t(){h&&(s.call(f,t,1e3/60),_())}()):(this._previous=p,p._next=this,p=this),this._promise}},{key:"seek",value:function(n){n=Math.max(n,0);var e=t.now();return this._timestamp+n===0?this:(this._timestamp=e-n,this._isPlaying||y(this,e),this)}},{key:"stop",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this._attachment,e=this._currentState,r=this._easing,i=this._originalState,u=this._targetState;if(this._isPlaying)return this._isPlaying=!1,g(this),t?(this._applyFilter("beforeTween"),v(1,e,i,u,1,0,r),this._applyFilter("afterTween"),this._applyFilter("afterTweenEnd"),this._resolve(e,n)):this._reject(e,n),this}},{key:"isPlaying",value:function(){return this._isPlaying}},{key:"setScheduleFunction",value:function(n){t.setScheduleFunction(n)}},{key:"dispose",value:function(){for(var t in this)delete this[t]}}])&&i(n.prototype,e),r&&i(n,r),t}();function w(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=new b,e=n.tween(t);return e.tweenable=n,e}b.setScheduleFunction=function(t){return s=t},b.formulas=d,b.filters={},b.now=Date.now||function(){return+new Date}}).call(this,e(2))},function(t,n,e){"use strict";e.r(n),e.d(n,"linear",(function(){return r})),e.d(n,"easeInQuad",(function(){return i})),e.d(n,"easeOutQuad",(function(){return u})),e.d(n,"easeInOutQuad",(function(){return o})),e.d(n,"easeInCubic",(function(){return a})),e.d(n,"easeOutCubic",(function(){return c})),e.d(n,"easeInOutCubic",(function(){return f})),e.d(n,"easeInQuart",(function(){return s})),e.d(n,"easeOutQuart",(function(){return l})),e.d(n,"easeInOutQuart",(function(){return h})),e.d(n,"easeInQuint",(function(){return p})),e.d(n,"easeOutQuint",(function(){return d})),e.d(n,"easeInOutQuint",(function(){return v})),e.d(n,"easeInSine",(function(){return y})),e.d(n,"easeOutSine",(function(){return _})),e.d(n,"easeInOutSine",(function(){return m})),e.d(n,"easeInExpo",(function(){return g})),e.d(n,"easeOutExpo",(function(){return b})),e.d(n,"easeInOutExpo",(function(){return w})),e.d(n,"easeInCirc",(function(){return O})),e.d(n,"easeOutCirc",(function(){return S})),e.d(n,"easeInOutCirc",(function(){return j})),e.d(n,"easeOutBounce",(function(){return M})),e.d(n,"easeInBack",(function(){return k})),e.d(n,"easeOutBack",(function(){return P})),e.d(n,"easeInOutBack",(function(){return x})),e.d(n,"elastic",(function(){return T})),e.d(n,"swingFromTo",(function(){return E})),e.d(n,"swingFrom",(function(){return F})),e.d(n,"swingTo",(function(){return A})),e.d(n,"bounce",(function(){return I})),e.d(n,"bouncePast",(function(){return C})),e.d(n,"easeFromTo",(function(){return D})),e.d(n,"easeFrom",(function(){return q})),e.d(n,"easeTo",(function(){return Q}));
-/*!
- * All equations are adapted from Thomas Fuchs'
- * [Scripty2](https://github.com/madrobby/scripty2/blob/master/src/effects/transitions/penner.js).
- *
- * Based on Easing Equations (c) 2003 [Robert
- * Penner](http://www.robertpenner.com/), all rights reserved. This work is
- * [subject to terms](http://www.robertpenner.com/easing_terms_of_use.html).
- */
-/*!
- * TERMS OF USE - EASING EQUATIONS
- * Open source under the BSD License.
- * Easing Equations (c) 2003 Robert Penner, all rights reserved.
- */
-var r=function(t){return t},i=function(t){return Math.pow(t,2)},u=function(t){return-(Math.pow(t-1,2)-1)},o=function(t){return(t/=.5)<1?.5*Math.pow(t,2):-.5*((t-=2)*t-2)},a=function(t){return Math.pow(t,3)},c=function(t){return Math.pow(t-1,3)+1},f=function(t){return(t/=.5)<1?.5*Math.pow(t,3):.5*(Math.pow(t-2,3)+2)},s=function(t){return Math.pow(t,4)},l=function(t){return-(Math.pow(t-1,4)-1)},h=function(t){return(t/=.5)<1?.5*Math.pow(t,4):-.5*((t-=2)*Math.pow(t,3)-2)},p=function(t){return Math.pow(t,5)},d=function(t){return Math.pow(t-1,5)+1},v=function(t){return(t/=.5)<1?.5*Math.pow(t,5):.5*(Math.pow(t-2,5)+2)},y=function(t){return 1-Math.cos(t*(Math.PI/2))},_=function(t){return Math.sin(t*(Math.PI/2))},m=function(t){return-.5*(Math.cos(Math.PI*t)-1)},g=function(t){return 0===t?0:Math.pow(2,10*(t-1))},b=function(t){return 1===t?1:1-Math.pow(2,-10*t)},w=function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))},O=function(t){return-(Math.sqrt(1-t*t)-1)},S=function(t){return Math.sqrt(1-Math.pow(t-1,2))},j=function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},M=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},k=function(t){var n=1.70158;return t*t*((n+1)*t-n)},P=function(t){var n=1.70158;return(t-=1)*t*((n+1)*t+n)+1},x=function(t){var n=1.70158;return(t/=.5)<1?t*t*((1+(n*=1.525))*t-n)*.5:.5*((t-=2)*t*((1+(n*=1.525))*t+n)+2)},T=function(t){return-1*Math.pow(4,-8*t)*Math.sin((6*t-1)*(2*Math.PI)/2)+1},E=function(t){var n=1.70158;return(t/=.5)<1?t*t*((1+(n*=1.525))*t-n)*.5:.5*((t-=2)*t*((1+(n*=1.525))*t+n)+2)},F=function(t){var n=1.70158;return t*t*((n+1)*t-n)},A=function(t){var n=1.70158;return(t-=1)*t*((n+1)*t+n)+1},I=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},C=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?2-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?2-(7.5625*(t-=2.25/2.75)*t+.9375):2-(7.5625*(t-=2.625/2.75)*t+.984375)},D=function(t){return(t/=.5)<1?.5*Math.pow(t,4):-.5*((t-=2)*Math.pow(t,3)-2)},q=function(t){return Math.pow(t,4)},Q=function(t){return Math.pow(t,.25)}},function(t,n){var e;e=function(){return this}();try{e=e||new Function("return this")()}catch(t){"object"==typeof window&&(e=window)}t.exports=e},function(t,n,e){"use strict";e.r(n);var r={};e.r(r),e.d(r,"doesApply",(function(){return x})),e.d(r,"tweenCreated",(function(){return T})),e.d(r,"beforeTween",(function(){return E})),e.d(r,"afterTween",(function(){return F}));var i,u,o=e(0),a=/(\d|-|\.)/,c=/([^\-0-9.]+)/g,f=/[0-9.-]+/g,s=(i=f.source,u=/,\s*/.source,new RegExp("rgb\\(".concat(i).concat(u).concat(i).concat(u).concat(i,"\\)"),"g")),l=/^.*\(/,h=/#([0-9]|[a-f]){3,6}/gi,p=function(t,n){return t.map((function(t,e){return"_".concat(n,"_").concat(e)}))};function d(t){return parseInt(t,16)}var v=function(t){return"rgb(".concat((n=t,3===(n=n.replace(/#/,"")).length&&(n=(n=n.split(""))[0]+n[0]+n[1]+n[1]+n[2]+n[2]),[d(n.substr(0,2)),d(n.substr(2,2)),d(n.substr(4,2))]).join(","),")");var n},y=function(t,n,e){var r=n.match(t),i=n.replace(t,"VAL");return r&&r.forEach((function(t){return i=i.replace("VAL",e(t))})),i},_=function(t){for(var n in t){var e=t[n];"string"==typeof e&&e.match(h)&&(t[n]=y(h,e,v))}},m=function(t){var n=t.match(f).map(Math.floor),e=t.match(l)[0];return"".concat(e).concat(n.join(","),")")},g=function(t){return t.match(f)},b=function(t){var n,e,r={};for(var i in t){var u=t[i];"string"==typeof u&&(r[i]={formatString:(n=u,e=void 0,e=n.match(c),e?(1===e.length||n.charAt(0).match(a))&&e.unshift(""):e=["",""],e.join("VAL")),chunkNames:p(g(u),i)})}return r},w=function(t,n){var e=function(e){g(t[e]).forEach((function(r,i){return t[n[e].chunkNames[i]]=+r})),delete t[e]};for(var r in n)e(r)},O=function(t,n){var e={};return n.forEach((function(n){e[n]=t[n],delete t[n]})),e},S=function(t,n){return n.map((function(n){return t[n]}))},j=function(t,n){return n.forEach((function(n){return t=t.replace("VAL",+n.toFixed(4))})),t},M=function(t,n){for(var e in n){var r=n[e],i=r.chunkNames,u=r.formatString,o=j(u,S(O(t,i),i));t[e]=y(s,o,m)}},k=function(t,n){var e=function(e){var r=n[e].chunkNames,i=t[e];if("string"==typeof i){var u=i.split(" "),o=u[u.length-1];r.forEach((function(n,e){return t[n]=u[e]||o}))}else r.forEach((function(n){return t[n]=i}));delete t[e]};for(var r in n)e(r)},P=function(t,n){for(var e in n){var r=n[e].chunkNames,i=t[r[0]];t[e]="string"==typeof i?r.map((function(n){var e=t[n];return delete t[n],e})).join(" "):i}},x=function(t){var n=t._currentState;return Object.keys(n).some((function(t){return"string"==typeof n[t]}))};function T(t){var n=t._currentState;[n,t._originalState,t._targetState].forEach(_),t._tokenData=b(n)}function E(t){var n=t._currentState,e=t._originalState,r=t._targetState,i=t._easing,u=t._tokenData;k(i,u),[n,e,r].forEach((function(t){return w(t,u)}))}function F(t){var n=t._currentState,e=t._originalState,r=t._targetState,i=t._easing,u=t._tokenData;[n,e,r].forEach((function(t){return M(t,u)})),P(i,u)}function A(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r)}return e}function I(t){for(var n=1;n4&&void 0!==arguments[4]?arguments[4]:0,u=I({},t),a=Object(o.b)(t,r);for(var c in D._filters.length=0,D.set({}),D._currentState=u,D._originalState=t,D._targetState=n,D._easing=a,q)q[c].doesApply(D)&&D._filters.push(q[c]);D._applyFilter("tweenCreated"),D._applyFilter("beforeTween");var f=Object(o.e)(e,u,t,n,1,i,a);return D._applyFilter("afterTween"),f};function B(t){return function(t){if(Array.isArray(t)){for(var n=0,e=new Array(t.length);n=0?t:0-t};return c=1-(s=3*n)-(f=3*(r-n)-s),l=1-(p=3*e)-(h=3*(i-e)-p),o=t,a=function(t){return 1/(200*t)}(u),function(t){return((l*t+h)*t+p)*t}(function(t,n){var e,r,i,u,o,a;for(i=t,a=0;a<8;a++){if(u=d(i)-t,y(u)(r=1))return r;for(;eu?e=i:r=i,i=.5*(r-e)+e}return i}(o,a))}var W=function(t,n,e,r,i){var u=function(t,n,e,r){return function(i){return V(i,t,n,e,r,1)}}(n,e,r,i);return u.displayName=t,u.x1=n,u.y1=e,u.x2=r,u.y2=i,o.a.formulas[t]=u},G=function(t){return delete o.a.formulas[t]};e.d(n,"processTweens",(function(){return o.c})),e.d(n,"Tweenable",(function(){return o.a})),e.d(n,"tween",(function(){return o.d})),e.d(n,"interpolate",(function(){return Q})),e.d(n,"Scene",(function(){return z})),e.d(n,"setBezierFunction",(function(){return W})),e.d(n,"unsetBezierFunction",(function(){return G})),o.a.filters.token=r}])}));
-
-},{}],2:[function(require,module,exports){
-// Circle shaped progress bar
-
-var Shape = require('./shape');
-var utils = require('./utils');
-
-var Circle = function Circle(container, options) {
- // Use two arcs to form a circle
- // See this answer http://stackoverflow.com/a/10477334/1446092
- this._pathTemplate =
- 'M 50,50 m 0,-{radius}' +
- ' a {radius},{radius} 0 1 1 0,{2radius}' +
- ' a {radius},{radius} 0 1 1 0,-{2radius}';
-
- this.containerAspectRatio = 1;
-
- Shape.apply(this, arguments);
-};
-
-Circle.prototype = new Shape();
-Circle.prototype.constructor = Circle;
-
-Circle.prototype._pathString = function _pathString(opts) {
- var widthOfWider = opts.strokeWidth;
- if (opts.trailWidth && opts.trailWidth > opts.strokeWidth) {
- widthOfWider = opts.trailWidth;
- }
-
- var r = 50 - widthOfWider / 2;
-
- return utils.render(this._pathTemplate, {
- radius: r,
- '2radius': r * 2
- });
-};
-
-Circle.prototype._trailString = function _trailString(opts) {
- return this._pathString(opts);
-};
-
-module.exports = Circle;
-
-},{"./shape":7,"./utils":9}],3:[function(require,module,exports){
-// Line shaped progress bar
-
-var Shape = require('./shape');
-var utils = require('./utils');
-
-var Line = function Line(container, options) {
- this._pathTemplate = options.vertical
- ? 'M {center},100 L {center},0'
- : 'M 0,{center} L 100,{center}';
- Shape.apply(this, arguments);
-};
-
-Line.prototype = new Shape();
-Line.prototype.constructor = Line;
-
-Line.prototype._initializeSvg = function _initializeSvg(svg, opts) {
- var viewBoxStr = opts.vertical
- ? '0 0 ' + opts.strokeWidth + ' 100'
- : '0 0 100 ' + opts.strokeWidth;
- svg.setAttribute('viewBox', viewBoxStr);
- svg.setAttribute('preserveAspectRatio', 'none');
-};
-
-Line.prototype._pathString = function _pathString(opts) {
- return utils.render(this._pathTemplate, {
- center: opts.strokeWidth / 2
- });
-};
-
-Line.prototype._trailString = function _trailString(opts) {
- return this._pathString(opts);
-};
-
-module.exports = Line;
-
-},{"./shape":7,"./utils":9}],4:[function(require,module,exports){
-module.exports = {
- // Higher level API, different shaped progress bars
- Line: require('./line'),
- Circle: require('./circle'),
- SemiCircle: require('./semicircle'),
- Square: require('./square'),
-
- // Lower level API to use any SVG path
- Path: require('./path'),
-
- // Base-class for creating new custom shapes
- // to be in line with the API of built-in shapes
- // Undocumented.
- Shape: require('./shape'),
-
- // Internal utils, undocumented.
- utils: require('./utils')
-};
-
-},{"./circle":2,"./line":3,"./path":5,"./semicircle":6,"./shape":7,"./square":8,"./utils":9}],5:[function(require,module,exports){
-// Lower level API to animate any kind of svg path
-
-var shifty = require('shifty');
-var utils = require('./utils');
-
-var Tweenable = shifty.Tweenable;
-
-var EASING_ALIASES = {
- easeIn: 'easeInCubic',
- easeOut: 'easeOutCubic',
- easeInOut: 'easeInOutCubic'
-};
-
-var Path = function Path(path, opts) {
- // Throw a better error if not initialized with `new` keyword
- if (!(this instanceof Path)) {
- throw new Error('Constructor was called without new keyword');
- }
-
- // Default parameters for animation
- opts = utils.extend({
- delay: 0,
- duration: 800,
- easing: 'linear',
- from: {},
- to: {},
- step: function() {}
- }, opts);
-
- var element;
- if (utils.isString(path)) {
- element = document.querySelector(path);
- } else {
- element = path;
- }
-
- // Reveal .path as public attribute
- this.path = element;
- this._opts = opts;
- this._tweenable = null;
-
- // Set up the starting positions
- var length = this.path.getTotalLength();
- this.path.style.strokeDasharray = length + ' ' + length;
- this.set(0);
-};
-
-Path.prototype.value = function value() {
- var offset = this._getComputedDashOffset();
- var length = this.path.getTotalLength();
-
- var progress = 1 - offset / length;
- // Round number to prevent returning very small number like 1e-30, which
- // is practically 0
- return parseFloat(progress.toFixed(6), 10);
-};
-
-Path.prototype.set = function set(progress) {
- this.stop();
-
- this.path.style.strokeDashoffset = this._progressToOffset(progress);
-
- var step = this._opts.step;
- if (utils.isFunction(step)) {
- var easing = this._easing(this._opts.easing);
- var values = this._calculateTo(progress, easing);
- var reference = this._opts.shape || this;
- step(values, reference, this._opts.attachment);
- }
-};
-
-Path.prototype.stop = function stop() {
- this._stopTween();
- this.path.style.strokeDashoffset = this._getComputedDashOffset();
-};
-
-// Method introduced here:
-// http://jakearchibald.com/2013/animated-line-drawing-svg/
-Path.prototype.animate = function animate(progress, opts, cb) {
- opts = opts || {};
-
- if (utils.isFunction(opts)) {
- cb = opts;
- opts = {};
- }
-
- var passedOpts = utils.extend({}, opts);
-
- // Copy default opts to new object so defaults are not modified
- var defaultOpts = utils.extend({}, this._opts);
- opts = utils.extend(defaultOpts, opts);
-
- var shiftyEasing = this._easing(opts.easing);
- var values = this._resolveFromAndTo(progress, shiftyEasing, passedOpts);
-
- this.stop();
-
- // Trigger a layout so styles are calculated & the browser
- // picks up the starting position before animating
- this.path.getBoundingClientRect();
-
- var offset = this._getComputedDashOffset();
- var newOffset = this._progressToOffset(progress);
-
- var self = this;
- this._tweenable = new Tweenable();
- this._tweenable.tween({
- from: utils.extend({ offset: offset }, values.from),
- to: utils.extend({ offset: newOffset }, values.to),
- duration: opts.duration,
- delay: opts.delay,
- easing: shiftyEasing,
- step: function(state) {
- self.path.style.strokeDashoffset = state.offset;
- var reference = opts.shape || self;
- opts.step(state, reference, opts.attachment);
- }
- }).then(function(state) {
- if (utils.isFunction(cb)) {
- cb();
- }
- }).catch(function(err) {
- console.error('Error in tweening:', err);
- throw err;
- });
-};
-
-Path.prototype._getComputedDashOffset = function _getComputedDashOffset() {
- var computedStyle = window.getComputedStyle(this.path, null);
- return parseFloat(computedStyle.getPropertyValue('stroke-dashoffset'), 10);
-};
-
-Path.prototype._progressToOffset = function _progressToOffset(progress) {
- var length = this.path.getTotalLength();
- return length - progress * length;
-};
-
-// Resolves from and to values for animation.
-Path.prototype._resolveFromAndTo = function _resolveFromAndTo(progress, easing, opts) {
- if (opts.from && opts.to) {
- return {
- from: opts.from,
- to: opts.to
- };
- }
-
- return {
- from: this._calculateFrom(easing),
- to: this._calculateTo(progress, easing)
- };
-};
-
-// Calculate `from` values from options passed at initialization
-Path.prototype._calculateFrom = function _calculateFrom(easing) {
- return shifty.interpolate(this._opts.from, this._opts.to, this.value(), easing);
-};
-
-// Calculate `to` values from options passed at initialization
-Path.prototype._calculateTo = function _calculateTo(progress, easing) {
- return shifty.interpolate(this._opts.from, this._opts.to, progress, easing);
-};
-
-Path.prototype._stopTween = function _stopTween() {
- if (this._tweenable !== null) {
- this._tweenable.stop(true);
- this._tweenable = null;
- }
-};
-
-Path.prototype._easing = function _easing(easing) {
- if (EASING_ALIASES.hasOwnProperty(easing)) {
- return EASING_ALIASES[easing];
- }
-
- return easing;
-};
-
-module.exports = Path;
-
-},{"./utils":9,"shifty":1}],6:[function(require,module,exports){
-// Semi-SemiCircle shaped progress bar
-
-var Shape = require('./shape');
-var Circle = require('./circle');
-var utils = require('./utils');
-
-var SemiCircle = function SemiCircle(container, options) {
- // Use one arc to form a SemiCircle
- // See this answer http://stackoverflow.com/a/10477334/1446092
- this._pathTemplate =
- 'M 50,50 m -{radius},0' +
- ' a {radius},{radius} 0 1 1 {2radius},0';
-
- this.containerAspectRatio = 2;
-
- Shape.apply(this, arguments);
-};
-
-SemiCircle.prototype = new Shape();
-SemiCircle.prototype.constructor = SemiCircle;
-
-SemiCircle.prototype._initializeSvg = function _initializeSvg(svg, opts) {
- svg.setAttribute('viewBox', '0 0 100 50');
-};
-
-SemiCircle.prototype._initializeTextContainer = function _initializeTextContainer(
- opts,
- container,
- textContainer
-) {
- if (opts.text.style) {
- // Reset top style
- textContainer.style.top = 'auto';
- textContainer.style.bottom = '0';
-
- if (opts.text.alignToBottom) {
- utils.setStyle(textContainer, 'transform', 'translate(-50%, 0)');
- } else {
- utils.setStyle(textContainer, 'transform', 'translate(-50%, 50%)');
- }
- }
-};
-
-// Share functionality with Circle, just have different path
-SemiCircle.prototype._pathString = Circle.prototype._pathString;
-SemiCircle.prototype._trailString = Circle.prototype._trailString;
-
-module.exports = SemiCircle;
-
-},{"./circle":2,"./shape":7,"./utils":9}],7:[function(require,module,exports){
-// Base object for different progress bar shapes
-
-var Path = require('./path');
-var utils = require('./utils');
-
-var DESTROYED_ERROR = 'Object is destroyed';
-
-var Shape = function Shape(container, opts) {
- // Throw a better error if progress bars are not initialized with `new`
- // keyword
- if (!(this instanceof Shape)) {
- throw new Error('Constructor was called without new keyword');
- }
-
- // Prevent calling constructor without parameters so inheritance
- // works correctly. To understand, this is how Shape is inherited:
- //
- // Line.prototype = new Shape();
- //
- // We just want to set the prototype for Line.
- if (arguments.length === 0) {
- return;
- }
-
- // Default parameters for progress bar creation
- this._opts = utils.extend({
- color: '#555',
- strokeWidth: 1.0,
- trailColor: null,
- trailWidth: null,
- fill: null,
- text: {
- style: {
- color: null,
- position: 'absolute',
- left: '50%',
- top: '50%',
- padding: 0,
- margin: 0,
- transform: {
- prefix: true,
- value: 'translate(-50%, -50%)'
- }
- },
- autoStyleContainer: true,
- alignToBottom: true,
- value: null,
- className: 'progressbar-text'
- },
- svgStyle: {
- display: 'block',
- width: '100%'
- },
- warnings: false
- }, opts, true); // Use recursive extend
-
- // If user specifies e.g. svgStyle or text style, the whole object
- // should replace the defaults to make working with styles easier
- if (utils.isObject(opts) && opts.svgStyle !== undefined) {
- this._opts.svgStyle = opts.svgStyle;
- }
- if (utils.isObject(opts) && utils.isObject(opts.text) && opts.text.style !== undefined) {
- this._opts.text.style = opts.text.style;
- }
-
- var svgView = this._createSvgView(this._opts);
-
- var element;
- if (utils.isString(container)) {
- element = document.querySelector(container);
- } else {
- element = container;
- }
-
- if (!element) {
- throw new Error('Container does not exist: ' + container);
- }
-
- this._container = element;
- this._container.appendChild(svgView.svg);
- if (this._opts.warnings) {
- this._warnContainerAspectRatio(this._container);
- }
-
- if (this._opts.svgStyle) {
- utils.setStyles(svgView.svg, this._opts.svgStyle);
- }
-
- // Expose public attributes before Path initialization
- this.svg = svgView.svg;
- this.path = svgView.path;
- this.trail = svgView.trail;
- this.text = null;
-
- var newOpts = utils.extend({
- attachment: undefined,
- shape: this
- }, this._opts);
- this._progressPath = new Path(svgView.path, newOpts);
-
- if (utils.isObject(this._opts.text) && this._opts.text.value !== null) {
- this.setText(this._opts.text.value);
- }
-};
-
-Shape.prototype.animate = function animate(progress, opts, cb) {
- if (this._progressPath === null) {
- throw new Error(DESTROYED_ERROR);
- }
-
- this._progressPath.animate(progress, opts, cb);
-};
-
-Shape.prototype.stop = function stop() {
- if (this._progressPath === null) {
- throw new Error(DESTROYED_ERROR);
- }
-
- // Don't crash if stop is called inside step function
- if (this._progressPath === undefined) {
- return;
- }
-
- this._progressPath.stop();
-};
-
-Shape.prototype.pause = function pause() {
- if (this._progressPath === null) {
- throw new Error(DESTROYED_ERROR);
- }
-
- if (this._progressPath === undefined) {
- return;
- }
-
- if (!this._progressPath._tweenable) {
- // It seems that we can't pause this
- return;
- }
-
- this._progressPath._tweenable.pause();
-};
-
-Shape.prototype.resume = function resume() {
- if (this._progressPath === null) {
- throw new Error(DESTROYED_ERROR);
- }
-
- if (this._progressPath === undefined) {
- return;
- }
-
- if (!this._progressPath._tweenable) {
- // It seems that we can't resume this
- return;
- }
-
- this._progressPath._tweenable.resume();
-};
-
-Shape.prototype.destroy = function destroy() {
- if (this._progressPath === null) {
- throw new Error(DESTROYED_ERROR);
- }
-
- this.stop();
- this.svg.parentNode.removeChild(this.svg);
- this.svg = null;
- this.path = null;
- this.trail = null;
- this._progressPath = null;
-
- if (this.text !== null) {
- this.text.parentNode.removeChild(this.text);
- this.text = null;
- }
-};
-
-Shape.prototype.set = function set(progress) {
- if (this._progressPath === null) {
- throw new Error(DESTROYED_ERROR);
- }
-
- this._progressPath.set(progress);
-};
-
-Shape.prototype.value = function value() {
- if (this._progressPath === null) {
- throw new Error(DESTROYED_ERROR);
- }
-
- if (this._progressPath === undefined) {
- return 0;
- }
-
- return this._progressPath.value();
-};
-
-Shape.prototype.setText = function setText(newText) {
- if (this._progressPath === null) {
- throw new Error(DESTROYED_ERROR);
- }
-
- if (this.text === null) {
- // Create new text node
- this.text = this._createTextContainer(this._opts, this._container);
- this._container.appendChild(this.text);
- }
-
- // Remove previous text and add new
- if (utils.isObject(newText)) {
- utils.removeChildren(this.text);
- this.text.appendChild(newText);
- } else {
- this.text.innerHTML = newText;
- }
-};
-
-Shape.prototype._createSvgView = function _createSvgView(opts) {
- var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
- this._initializeSvg(svg, opts);
-
- var trailPath = null;
- // Each option listed in the if condition are 'triggers' for creating
- // the trail path
- if (opts.trailColor || opts.trailWidth) {
- trailPath = this._createTrail(opts);
- svg.appendChild(trailPath);
- }
-
- var path = this._createPath(opts);
- svg.appendChild(path);
-
- return {
- svg: svg,
- path: path,
- trail: trailPath
- };
-};
-
-Shape.prototype._initializeSvg = function _initializeSvg(svg, opts) {
- svg.setAttribute('viewBox', '0 0 100 100');
-};
-
-Shape.prototype._createPath = function _createPath(opts) {
- var pathString = this._pathString(opts);
- return this._createPathElement(pathString, opts);
-};
-
-Shape.prototype._createTrail = function _createTrail(opts) {
- // Create path string with original passed options
- var pathString = this._trailString(opts);
-
- // Prevent modifying original
- var newOpts = utils.extend({}, opts);
-
- // Defaults for parameters which modify trail path
- if (!newOpts.trailColor) {
- newOpts.trailColor = '#eee';
- }
- if (!newOpts.trailWidth) {
- newOpts.trailWidth = newOpts.strokeWidth;
- }
-
- newOpts.color = newOpts.trailColor;
- newOpts.strokeWidth = newOpts.trailWidth;
-
- // When trail path is set, fill must be set for it instead of the
- // actual path to prevent trail stroke from clipping
- newOpts.fill = null;
-
- return this._createPathElement(pathString, newOpts);
-};
-
-Shape.prototype._createPathElement = function _createPathElement(pathString, opts) {
- var path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
- path.setAttribute('d', pathString);
- path.setAttribute('stroke', opts.color);
- path.setAttribute('stroke-width', opts.strokeWidth);
-
- if (opts.fill) {
- path.setAttribute('fill', opts.fill);
- } else {
- path.setAttribute('fill-opacity', '0');
- }
-
- return path;
-};
-
-Shape.prototype._createTextContainer = function _createTextContainer(opts, container) {
- var textContainer = document.createElement('div');
- textContainer.className = opts.text.className;
-
- var textStyle = opts.text.style;
- if (textStyle) {
- if (opts.text.autoStyleContainer) {
- container.style.position = 'relative';
- }
-
- utils.setStyles(textContainer, textStyle);
- // Default text color to progress bar's color
- if (!textStyle.color) {
- textContainer.style.color = opts.color;
- }
- }
-
- this._initializeTextContainer(opts, container, textContainer);
- return textContainer;
-};
-
-// Give custom shapes possibility to modify text element
-Shape.prototype._initializeTextContainer = function(opts, container, element) {
- // By default, no-op
- // Custom shapes should respect API options, such as text.style
-};
-
-Shape.prototype._pathString = function _pathString(opts) {
- throw new Error('Override this function for each progress bar');
-};
-
-Shape.prototype._trailString = function _trailString(opts) {
- throw new Error('Override this function for each progress bar');
-};
-
-Shape.prototype._warnContainerAspectRatio = function _warnContainerAspectRatio(container) {
- if (!this.containerAspectRatio) {
- return;
- }
-
- var computedStyle = window.getComputedStyle(container, null);
- var width = parseFloat(computedStyle.getPropertyValue('width'), 10);
- var height = parseFloat(computedStyle.getPropertyValue('height'), 10);
- if (!utils.floatEquals(this.containerAspectRatio, width / height)) {
- console.warn(
- 'Incorrect aspect ratio of container',
- '#' + container.id,
- 'detected:',
- computedStyle.getPropertyValue('width') + '(width)',
- '/',
- computedStyle.getPropertyValue('height') + '(height)',
- '=',
- width / height
- );
-
- console.warn(
- 'Aspect ratio of should be',
- this.containerAspectRatio
- );
- }
-};
-
-module.exports = Shape;
-
-},{"./path":5,"./utils":9}],8:[function(require,module,exports){
-// Square shaped progress bar
-// Note: Square is not core part of API anymore. It's left here
-// for reference. square is not included to the progressbar
-// build anymore
-
-var Shape = require('./shape');
-var utils = require('./utils');
-
-var Square = function Square(container, options) {
- this._pathTemplate =
- 'M 0,{halfOfStrokeWidth}' +
- ' L {width},{halfOfStrokeWidth}' +
- ' L {width},{width}' +
- ' L {halfOfStrokeWidth},{width}' +
- ' L {halfOfStrokeWidth},{strokeWidth}';
-
- this._trailTemplate =
- 'M {startMargin},{halfOfStrokeWidth}' +
- ' L {width},{halfOfStrokeWidth}' +
- ' L {width},{width}' +
- ' L {halfOfStrokeWidth},{width}' +
- ' L {halfOfStrokeWidth},{halfOfStrokeWidth}';
-
- Shape.apply(this, arguments);
-};
-
-Square.prototype = new Shape();
-Square.prototype.constructor = Square;
-
-Square.prototype._pathString = function _pathString(opts) {
- var w = 100 - opts.strokeWidth / 2;
-
- return utils.render(this._pathTemplate, {
- width: w,
- strokeWidth: opts.strokeWidth,
- halfOfStrokeWidth: opts.strokeWidth / 2
- });
-};
-
-Square.prototype._trailString = function _trailString(opts) {
- var w = 100 - opts.strokeWidth / 2;
-
- return utils.render(this._trailTemplate, {
- width: w,
- strokeWidth: opts.strokeWidth,
- halfOfStrokeWidth: opts.strokeWidth / 2,
- startMargin: opts.strokeWidth / 2 - opts.trailWidth / 2
- });
-};
-
-module.exports = Square;
-
-},{"./shape":7,"./utils":9}],9:[function(require,module,exports){
-// Utility functions
-
-var PREFIXES = 'Webkit Moz O ms'.split(' ');
-var FLOAT_COMPARISON_EPSILON = 0.001;
-
-// Copy all attributes from source object to destination object.
-// destination object is mutated.
-function extend(destination, source, recursive) {
- destination = destination || {};
- source = source || {};
- recursive = recursive || false;
-
- for (var attrName in source) {
- if (source.hasOwnProperty(attrName)) {
- var destVal = destination[attrName];
- var sourceVal = source[attrName];
- if (recursive && isObject(destVal) && isObject(sourceVal)) {
- destination[attrName] = extend(destVal, sourceVal, recursive);
- } else {
- destination[attrName] = sourceVal;
- }
- }
- }
-
- return destination;
-}
-
-// Renders templates with given variables. Variables must be surrounded with
-// braces without any spaces, e.g. {variable}
-// All instances of variable placeholders will be replaced with given content
-// Example:
-// render('Hello, {message}!', {message: 'world'})
-function render(template, vars) {
- var rendered = template;
-
- for (var key in vars) {
- if (vars.hasOwnProperty(key)) {
- var val = vars[key];
- var regExpString = '\\{' + key + '\\}';
- var regExp = new RegExp(regExpString, 'g');
-
- rendered = rendered.replace(regExp, val);
- }
- }
-
- return rendered;
-}
-
-function setStyle(element, style, value) {
- var elStyle = element.style; // cache for performance
-
- for (var i = 0; i < PREFIXES.length; ++i) {
- var prefix = PREFIXES[i];
- elStyle[prefix + capitalize(style)] = value;
- }
-
- elStyle[style] = value;
-}
-
-function setStyles(element, styles) {
- forEachObject(styles, function(styleValue, styleName) {
- // Allow disabling some individual styles by setting them
- // to null or undefined
- if (styleValue === null || styleValue === undefined) {
- return;
- }
-
- // If style's value is {prefix: true, value: '50%'},
- // Set also browser prefixed styles
- if (isObject(styleValue) && styleValue.prefix === true) {
- setStyle(element, styleName, styleValue.value);
- } else {
- element.style[styleName] = styleValue;
- }
- });
-}
-
-function capitalize(text) {
- return text.charAt(0).toUpperCase() + text.slice(1);
-}
-
-function isString(obj) {
- return typeof obj === 'string' || obj instanceof String;
-}
-
-function isFunction(obj) {
- return typeof obj === 'function';
-}
-
-function isArray(obj) {
- return Object.prototype.toString.call(obj) === '[object Array]';
-}
-
-// Returns true if `obj` is object as in {a: 1, b: 2}, not if it's function or
-// array
-function isObject(obj) {
- if (isArray(obj)) {
- return false;
- }
-
- var type = typeof obj;
- return type === 'object' && !!obj;
-}
-
-function forEachObject(object, callback) {
- for (var key in object) {
- if (object.hasOwnProperty(key)) {
- var val = object[key];
- callback(val, key);
- }
- }
-}
-
-function floatEquals(a, b) {
- return Math.abs(a - b) < FLOAT_COMPARISON_EPSILON;
-}
-
-// https://coderwall.com/p/nygghw/don-t-use-innerhtml-to-empty-dom-elements
-function removeChildren(el) {
- while (el.firstChild) {
- el.removeChild(el.firstChild);
- }
-}
-
-module.exports = {
- extend: extend,
- render: render,
- setStyle: setStyle,
- setStyles: setStyles,
- capitalize: capitalize,
- isString: isString,
- isFunction: isFunction,
- isObject: isObject,
- forEachObject: forEachObject,
- floatEquals: floatEquals,
- removeChildren: removeChildren
-};
-
-},{}]},{},[4])(4)
-});
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/script/coloris.min.js b/resources/[tools]/Codem-BlackHUDV2/html/script/coloris.min.js
deleted file mode 100644
index 96b8d7e1c..000000000
--- a/resources/[tools]/Codem-BlackHUDV2/html/script/coloris.min.js
+++ /dev/null
@@ -1,6 +0,0 @@
-/*!
- * Copyright (c) 2021 Momo Bassit.
- * Licensed under the MIT License (MIT)
- * https://github.com/mdbassit/Coloris
- */
-!function(u,d,s){var p,h,f,c,v,b,i,y,l,m,g,w,k,t,a=d.createElement("canvas").getContext("2d"),x={r:0,g:0,b:0,h:0,s:0,v:0,a:1},E={el:"[data-coloris]",parent:null,theme:"default",themeMode:"light",wrap:!0,margin:2,format:"hex",formatToggle:!1,swatches:[],swatchesOnly:!1,alpha:!0,focusInput:!0,autoClose:!1,inline:!1,defaultColor:"#000000",clearButton:{show:!1,label:"Clear"},a11y:{open:"Open color picker",close:"Close color picker",marker:"Saturation: {s}. Brightness: {v}.",hueSlider:"Hue slider",alphaSlider:"Opacity slider",input:"Color value field",format:"Color format",swatch:"Color swatch",instruction:"Saturation and brightness selector. Use up, down, left and right arrow keys to select."}};function n(e){if("object"==typeof e)for(var t in e)switch(t){case"el":L(e.el),!1!==e.wrap&&C(e.el);break;case"parent":E.parent=d.querySelector(e.parent),E.parent&&E.parent.appendChild(p);break;case"themeMode":E.themeMode=e.themeMode,"auto"===e.themeMode&&u.matchMedia&&u.matchMedia("(prefers-color-scheme: dark)").matches&&(E.themeMode="dark");case"theme":e.theme&&(E.theme=e.theme),p.className="clr-picker clr-"+E.theme+" clr-"+E.themeMode,E.inline&&S();break;case"margin":e.margin*=1,E.margin=(isNaN(e.margin)?E:e).margin;break;case"wrap":e.el&&e.wrap&&C(e.el);break;case"formatToggle":O("clr-format").style.display=e.formatToggle?"block":"none",e.formatToggle&&(E.format="auto");break;case"swatches":Array.isArray(e.swatches)&&function(){var a=[];e.swatches.forEach(function(e,t){a.push('")}),O("clr-swatches").innerHTML=a.length?""+a.join("")+"
":""}();break;case"swatchesOnly":E.swatchesOnly=!!e.swatchesOnly,p.setAttribute("data-minimal",E.swatchesOnly),E.swatchesOnly&&(E.autoClose=!0);break;case"alpha":E.alpha=!!e.alpha,p.setAttribute("data-alpha",E.alpha);break;case"inline":E.inline=!!e.inline,p.setAttribute("data-inline",E.inline),E.inline&&(l=e.defaultColor||E.defaultColor,S(),T(l));break;case"clearButton":var a="none";e.clearButton.show&&(a="block"),e.clearButton.label&&(i.innerHTML=e.clearButton.label),i.style.display=a;break;case"a11y":var l,r=e.a11y,n=!1;if("object"==typeof r)for(var o in r)r[o]&&E.a11y[o]&&(E.a11y[o]=r[o],n=!0);n&&(l=O("clr-open-label"),a=O("clr-swatch-label"),l.innerHTML=E.a11y.open,a.innerHTML=E.a11y.swatch,v.setAttribute("aria-label",E.a11y.close),y.setAttribute("aria-label",E.a11y.hueSlider),m.setAttribute("aria-label",E.a11y.alphaSlider),b.setAttribute("aria-label",E.a11y.input),h.setAttribute("aria-label",E.a11y.instruction));default:E[t]=e[t]}}function L(e){D(d,"click",e,function(e){E.inline||(w=e.target,t=w.value,k=function(e){e=e.substring(0,3).toLowerCase();return"rgb"!==e&&"hsl"!==e?"hex":e}(t),p.classList.add("clr-open"),S(),T(t),E.focusInput&&b.focus({preventScroll:!0}),w.dispatchEvent(new Event("open",{bubbles:!0})))}),D(d,"input",e,function(e){var t=e.target.parentNode;t.classList.contains("clr-field")&&(t.style.color=e.target.value)})}function S(){var e,t,a,l,r=E.parent,n=u.scrollY,o=p.offsetWidth,i=p.offsetHeight,c={left:!1,top:!1},s={x:0,y:0};r&&(a=u.getComputedStyle(r),e=parseFloat(a.marginTop),l=parseFloat(a.borderTopWidth),(s=r.getBoundingClientRect()).y+=l+n),E.inline||(a=(t=w.getBoundingClientRect()).x,l=n+t.y+t.height+E.margin,r?(a-=s.x,l-=s.y,a+o>r.clientWidth&&(a+=t.width-o,c.left=!0),l+i>r.clientHeight-e&&(l-=t.height+i+2*E.margin,c.top=!0),l+=r.scrollTop):(a+o>d.documentElement.clientWidth&&(a+=t.width-o,c.left=!0),l+i-n>d.documentElement.clientHeight&&(l=n+t.y-i-E.margin,c.top=!0)),p.classList.toggle("clr-left",c.left),p.classList.toggle("clr-top",c.top),p.style.left=a+"px",p.style.top=l+"px"),f={width:h.offsetWidth,height:h.offsetHeight,x:p.offsetLeft+h.offsetLeft+s.x,y:p.offsetTop+h.offsetTop+s.y}}function C(e){d.querySelectorAll(e).forEach(function(e){var t,a=e.parentNode;a.classList.contains("clr-field")||((t=d.createElement("div")).innerHTML='',a.insertBefore(t,e),t.setAttribute("class","clr-field"),t.style.color=e.value,t.appendChild(e))})}function o(e){w&&!E.inline&&(e&&t!==w.value&&(w.value=t,w.dispatchEvent(new Event("input",{bubbles:!0}))),t!==w.value&&w.dispatchEvent(new Event("change",{bubbles:!0})),p.classList.remove("clr-open"),w.dispatchEvent(new Event("close",{bubbles:!0})),E.focusInput&&w.focus({preventScroll:!0}),w=null)}function T(e){var t=function(e){var t;a.fillStyle="#000",a.fillStyle=e,(e=/^((rgba)|rgb)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i.exec(a.fillStyle))?(t={r:+e[3],g:+e[4],b:+e[5],a:+e[6]}).a=+t.a.toFixed(2):(e=a.fillStyle.replace("#","").match(/.{2}/g).map(function(e){return parseInt(e,16)}),t={r:e[0],g:e[1],b:e[2],a:1});return t}(e),e=function(e){var t=e.r/255,a=e.g/255,l=e.b/255,r=s.max(t,a,l),n=s.min(t,a,l),o=r-n,i=r,c=0,n=0;o&&(r===t&&(c=(a-l)/o),r===a&&(c=2+(l-t)/o),r===l&&(c=4+(t-a)/o),r&&(n=o/r));return{h:(c=s.floor(60*c))<0?c+360:c,s:s.round(100*n),v:s.round(100*i),a:e.a}}(t);M(e.s,e.v),B(t,e),y.value=e.h,p.style.color="hsl("+e.h+", 100%, 50%)",l.style.left=e.h/360*100+"%",c.style.left=f.width*e.s/100+"px",c.style.top=f.height-f.height*e.v/100+"px",m.value=100*e.a,g.style.left=100*e.a+"%"}function r(e){e=void 0!==e?e:b.value,w&&(w.value=e,w.dispatchEvent(new Event("input",{bubbles:!0}))),d.dispatchEvent(new CustomEvent("coloris:pick",{detail:{color:e}}))}function A(e,t){e={h:+y.value,s:e/f.width*100,v:100-t/f.height*100,a:m.value/100},t=function(e){var t=e.s/100,a=e.v/100,l=t*a,r=e.h/60,n=l*(1-s.abs(r%2-1)),o=a-l;l+=o,n+=o;t=s.floor(r)%6,a=[l,n,o,o,n,l][t],r=[n,l,l,n,o,o][t],t=[o,o,n,l,l,n][t];return{r:s.round(255*a),g:s.round(255*r),b:s.round(255*t),a:e.a}}(e);M(e.s,e.v),B(t,e),r()}function M(e,t){var a=E.a11y.marker;e=+e.toFixed(1),t=+t.toFixed(1),a=(a=a.replace("{s}",e)).replace("{v}",t),c.setAttribute("aria-label",a)}function H(e){var t={pageX:((a=e).changedTouches?a.changedTouches[0]:a).pageX,pageY:(a.changedTouches?a.changedTouches[0]:a).pageY},a=t.pageX-f.x,t=t.pageY-f.y;E.parent&&(t+=E.parent.scrollTop),a=a<0?0:a>f.width?f.width:a,t=t<0?0:t>f.height?f.height:t,c.style.left=a+"px",c.style.top=t+"px",A(a,t),e.preventDefault(),e.stopPropagation()}function B(e,t){void 0===t&&(t={});var a,l,r=E.format;for(a in e=void 0===e?{}:e)x[a]=e[a];for(l in t)x[l]=t[l];var n,o=function(e){var t=e.r.toString(16),a=e.g.toString(16),l=e.b.toString(16),r="";e.r<16&&(t="0"+t);e.g<16&&(a="0"+a);e.b<16&&(l="0"+l);E.alpha&&e.a<1&&(e=255*e.a|0,r=e.toString(16),e<16&&(r="0"+r));return"#"+t+a+l+r}(x),i=o.substring(0,7);switch(c.style.color=i,g.parentNode.style.color=i,g.style.color=o,v.style.color=o,h.style.display="none",h.offsetHeight,h.style.display="",g.nextElementSibling.style.display="none",g.nextElementSibling.offsetHeight,g.nextElementSibling.style.display="","mixed"===r?r=1===x.a?"hex":"rgb":"auto"===r&&(r=k),r){case"hex":b.value=o;break;case"rgb":b.value=(n=x,E.alpha&&1!==n.a?"rgba("+n.r+", "+n.g+", "+n.b+", "+n.a+")":"rgb("+n.r+", "+n.g+", "+n.b+")");break;case"hsl":b.value=(n=function(e){var t,a=e.v/100,l=a*(1-e.s/100/2);0'+E.a11y.open+''+E.a11y.swatch+"",d.body.appendChild(p),h=O("clr-color-area"),c=O("clr-color-marker"),i=O("clr-clear"),v=O("clr-color-preview"),b=O("clr-color-value"),y=O("clr-hue-slider"),l=O("clr-hue-marker"),m=O("clr-alpha-slider"),g=O("clr-alpha-marker"),L(E.el),C(E.el),D(p,"mousedown",function(e){p.classList.remove("clr-keyboard-nav"),e.stopPropagation()}),D(h,"mousedown",function(e){D(d,"mousemove",H)}),D(h,"touchstart",function(e){d.addEventListener("touchmove",H,{passive:!1})}),D(c,"mousedown",function(e){D(d,"mousemove",H)}),D(c,"touchstart",function(e){d.addEventListener("touchmove",H,{passive:!1})}),D(b,"change",function(e){T(b.value),r()}),D(i,"click",function(e){r(""),o()}),D(v,"click",function(e){r(),o()}),D(d,"click",".clr-format input",function(e){k=e.target.value,B(),r()}),D(p,"click",".clr-swatches button",function(e){T(e.target.textContent),r(),E.autoClose&&o()}),D(d,"mouseup",function(e){d.removeEventListener("mousemove",H)}),D(d,"touchend",function(e){d.removeEventListener("touchmove",H)}),D(d,"mousedown",function(e){p.classList.remove("clr-keyboard-nav"),o()}),D(d,"keydown",function(e){"Escape"===e.key?o(!0):"Tab"===e.key&&p.classList.add("clr-keyboard-nav")}),D(d,"click",".clr-field button",function(e){e.target.nextElementSibling.dispatchEvent(new Event("click",{bubbles:!0}))}),D(c,"keydown",function(e){var t={ArrowUp:[0,-1],ArrowDown:[0,1],ArrowLeft:[-1,0],ArrowRight:[1,0]};-1!==Object.keys(t).indexOf(e.key)&&(!function(e,t){e=+c.style.left.replace("px","")+e,t=+c.style.top.replace("px","")+t,c.style.left=e+"px",c.style.top=t+"px",A(e,t)}.apply(void 0,t[e.key]),e.preventDefault())}),D(h,"click",H),D(y,"input",e),D(m,"input",N)})}(window,document,Math);
\ No newline at end of file
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/script/hudProgressbar.js b/resources/[tools]/Codem-BlackHUDV2/html/script/hudProgressbar.js
deleted file mode 100644
index 2e9856a9b..000000000
--- a/resources/[tools]/Codem-BlackHUDV2/html/script/hudProgressbar.js
+++ /dev/null
@@ -1,168 +0,0 @@
-const SetupProgressBar = () =>{
- //var bar = new ProgressBar.Path('#path-2', {
- // easing: 'easeInOut',
- // duration: 1400
- //});
- //
- //bar.set(0);
- //bar.animate(0.33)
-
- // var bar4 = new ProgressBar.Path('#healthText', {
- // easing: 'easeInOut',
- // duration: 1400
- // });
- // bar4.set(0)
- // bar4.animate(0.7)
-//
- // var bar5 = new ProgressBar.Path('#waterText', {
- // easing: 'easeInOut',
- // duration: 1400
- // });
- // bar5.set(0)
- // bar5.animate(0.7)
-//
- // var bar6 = new ProgressBar.Path('#armorText', {
- // easing: 'easeInOut',
- // duration: 1400
- // });
- // bar6.set(0)
- // bar6.animate(0.7)
- // var bar7 = new ProgressBar.Path('#hungerText', {
- // easing: 'easeInOut',
- // duration: 1400
- // });
- // bar7.set(0)
- // bar7.animate(0.7)
- // var bar8 = new ProgressBar.Path('#staminaText', {
- // easing: 'easeInOut',
- // duration: 1400
- //});
- //bar8.set(0)
- //bar8.animate(0.7)
-// var bar9 = new ProgressBar.Path('#stressText', {
-// easing: 'easeInOut',
-// duration: 1400
-//});
-//bar9.set(0)
-//bar9.animate(0.7)
-}
-
-/*! SVG Pie Progress Indicator | Ryan Detert | MIT License */
-/*! based on SVG Pie Timer 0.9.1 | Anders Grimsrud, grint.no | github.com/agrimsrud/svgPieTimer.js */
-
-// Date.now fix by Ari Fuchs, afuchs.tumblr.com/post/23550124774/date-now-in-ie8
-Date.now = Date.now || function() { return +new Date };
-
-function svgPieProgress(props){
-
- 'use strict';
-
- var element = props.element,
- duration = props.duration || 1000,
- endTime = 0,
- totalDuration = 0,
- lastTotalProgress, totalProgress, endProgress,
- currentAngle = 0;
-
- if(!element) throw "SVG Pie Progress: Error - element required"
-
- this.progress = (props.progress) ? props.progress : 0.0;
-
- this.updateProgress = function(progress){
-
- // We need to keep track of the current angle in case the progress gets updated
- // before the previous progress animation finishes
- lastTotalProgress = currentAngle / 360;
- var delta = progress - lastTotalProgress;
-
- // this is how much extra we have to go for this progress update
- // progress will contain the new value
- // this.progress will contain the saved value from last time
- var segmentDuration = Math.floor(duration * (progress - this.progress));
-
- // this is how much we still have left from the previous time (if necessary)
- var timeLeft = Math.floor(duration * ( this.progress - lastTotalProgress ));
- totalDuration = segmentDuration + timeLeft;
-
- endTime = Date.now() + totalDuration;
-
- this.progress = endProgress = progress;
- frame();
- }
-
- function draw(element, angle) {
- var count = element.length;
-
- var rad = (angle * Math.PI / 180),
- x = Math.sin(rad) * 125,
- y = Math.cos(rad) * -125,
- mid = (angle > 180) ? 1 : 0,
- shape = 'M 0 0 v -125 A 125 125 1 '
- + mid + ' 1 '
- + x + ' '
- + y + ' z';
-
- // If array of elements, draw each one
-
- if(element instanceof Array)
- while(count--)
- element[count].setAttribute('d', shape)
- else
- element.setAttribute('d', shape)
- }
-
-
- function frame() {
-
- var currentTime = Date.now(),
- remaining = endTime - currentTime;
-
- var currentSegmentProgress = ( 1 - remaining / totalDuration );
- var totalProgress = lastTotalProgress + currentSegmentProgress;
- var newAngle = 360 * totalProgress;
-
- // make sure no small jump backwards due to rounding, etc
- if ( newAngle > currentAngle )
- currentAngle = newAngle;
-
-
- if ( totalProgress >= endProgress ) {
-
- currentAngle = 360 * endProgress;
- lastTotalProgress = endProgress;
-
- // 360 degrees is the same as 0 degress so it won't look finished if we don't
- // set it back a little
- currentAngle = (endProgress >= 0.999) ? 359.999 : currentAngle;
-
- draw(element, currentAngle);
-
- return;
-
- }
-
- draw(element, currentAngle);
-
- requestAnimationFrame(frame);
- };
-
-
-};
-
-
-
-var progress = {}
-
-function init(loaderEl, border, val){
- var loader = document.getElementById(loaderEl),
- border = document.getElementById(border);
- if(progress[loaderEl] == undefined){
- progress[loaderEl] = new svgPieProgress({
- element: [loader, border],
- duration: 400 // total time it would take without stopping from 0-100%
- });
- }
-
- progress[loaderEl].updateProgress(val+.0)
-}
-
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/script/script.js b/resources/[tools]/Codem-BlackHUDV2/html/script/script.js
deleted file mode 100644
index 4910dd293..000000000
--- a/resources/[tools]/Codem-BlackHUDV2/html/script/script.js
+++ /dev/null
@@ -1,2137 +0,0 @@
-var bar
-
-const app = new Vue({
- el: '#app',
- data: {
- playerId: 0,
- bankMoney: 0,
- blackMoney: 0,
- bossMoney: 0,
- cash: 0,
- joblabel: '',
- seatbeltaudio: false,
-
- grade_label: '',
- isMuted: false,
- svg: [],
- weaponImage: '',
- currentHud: 'classic',
- selectSpeedUnit: 'kmh',
- selectedMap: 'radial',
- showCompass: true,
- showOxy: false,
- engineHealth: 1000,
- hide: false,
- indicatorDegree: 0,
- enableCinematic: false,
- speed: 0,
- rpm: 0,
- toggleMapButtonEnabled: false,
- fuel: 0,
- settingsOpen: false,
- showSpeedometer: false,
- speedometerSize: 1.1,
- hudSize: 1.0,
- showHideBox: true,
- isBoss: false,
- hideBoxData: {
- health: 100,
- armor: 100,
- water: 100,
- stress: 100,
- hunger: 100,
- stamina: 100,
- },
- hideBoxDataDisplay: {
- health: 100,
- armor: 100,
- water: 100,
- stress: 100,
- hunger: 100,
- stamina: 100,
- },
- heading: '',
- statusData: {
- health: 0,
- hunger: 0,
- thirst: 0,
- stamina: 0,
- stress: 0,
- armour: 0,
- altitude: 0,
- oxy: 0,
- nitro: 0,
- mic_level: 1,
- talking: false,
- },
- bars: {
- bar_1: null,
- bar_2: null,
- bar_3: null,
- bar_4: null,
- bar_5: null,
- bar_6: null,
- bar_7: false,
- bat_8: null,
- bat_9: null,
-
- bar_1_set: false,
- bar_2_set: false,
- bar_3_set: false,
- bar_4_set: false,
- bar_5_set: false,
- bar_6_set: false,
- bar_7_set: false,
- bar_8_set: false,
- bar_9_set: false,
-
- },
- text1: '',
- text2: '',
- addedMoney: null,
- isMinus: false,
- street: '',
- zone: '',
- clock: '',
- date: '',
- forceHide: true,
- DisplayRealTime: true,
- displayOnWalk: false,
- useStress: true,
- cruiseIsOn: false,
- engineIsOn: false,
- sealtBeltIsOn: false,
- lightsOn: false,
- locales: {},
- showParachute: false,
- showAltitude: false,
- altitude: 0,
- enableWaterMarkHud: true,
- useNitro: true,
- hudColors: {},
- moneyType: 'cash',
- dateDisplay: true,
- seatbeltDisplayActive: false,
- cruiseDisplayActive: false,
- resourceName: 'Test',
- UseWaterMarkText: true,
- WaterMarkLogo: '',
- text1Style: {},
- text2Style: {},
- logoWidth: 0,
- logoHeight: 0,
- enableAmmoHud: true,
- displayAmmoHud: false,
- ammo: 0,
- max_ammo: 0,
- refreshRate: 0,
- enableHunger: true,
- enableThirst: true,
- enableStamina: true,
- enableArmor: true,
- enableHealth: true,
- positionsData: {},
- displayRefreshRate: 0,
- editModeActive: false,
- editAllModeActive: false,
- enableHud: false,
- enableWaterMarkId: true,
- enableSpeedometer: true,
- disableWaterMarkTextAndLogo: false,
- enableWaterMarkCash: true,
- enableWaterMarkBank: true,
- enableWaterMarkBlackMoney: false,
- enableWaterMarkBossMoney: false,
- enableWatermarkJob: true,
- enableCompass: true,
- framework: '',
- enableWatermarkWeaponImage: true,
- waterMarkHudVisibleData: {},
- enableWaterMarkHudHideButtons: false,
- accountSizes: {
- cash: 4,
- bank: 3,
- black_money: 2,
- boss_money: 1,
- },
-
- },
-
- watch: {
- refreshRate(newD, old) {
- if (newD <= 135) {
- $.post(`https://${this.resourceName}/hudselected`, JSON.stringify({ settingstype: 'refreshRate', val: 135 }));
- }
- },
- hideBoxData: {
- handler(val) {
- // do stuff
- if (val.stamina > 100) {
- $.post(`https://${this.resourceName}/hudselected`, JSON.stringify({
- settingstype: "hideBoxData", val: {
- ...this.hideBoxData,
- ["stamina"]: 100
- }
- }));
- }
- if (val.health > 100) {
- $.post(`https://${this.resourceName}/hudselected`, JSON.stringify({
- settingstype: "hideBoxData", val: {
- ...this.hideBoxData,
- ["health"]: 100
- }
- }));
- }
- if (val.stress > 100) {
- $.post(`https://${this.resourceName}/hudselected`, JSON.stringify({
- settingstype: "hideBoxData", val: {
- ...this.hideBoxData,
- ["stress"]: 100
- }
- }));
- }
- if (val.water > 100) {
- $.post(`https://${this.resourceName}/hudselected`, JSON.stringify({
- settingstype: "hideBoxData", val: {
- ...this.hideBoxData,
- ["water"]: 100
- }
- }));
- }
- if (val.armor > 100) {
- $.post(`https://${this.resourceName}/hudselected`, JSON.stringify({
- settingstype: "hideBoxData", val: {
- ...this.hideBoxData,
- ["armor"]: 100
- }
- }));
- }
- if (val.hunger > 100) {
- $.post(`https://${this.resourceName}/hudselected`, JSON.stringify({
- settingstype: "hideBoxData", val: {
- ...this.hideBoxData,
- ["hunger"]: 100
- }
- }));
- }
- },
- deep: true
- }
- },
- methods: {
- EnableCompass(val) {
- this.enableCompass = val
- },
- GetAccountSize(type) {
- let val = this.accountSizes[type]
- return 'account-size-' + val
- },
- SetAccountSizes(val) {
- this.accountSizes = val
- },
- SetIsBoss(val) {
- this.isBoss = val
- },
- EnableWaterMarkHudHideButtons(val) {
- this.enableWaterMarkHudHideButtons = val
- },
- SetBlackMoney(val) {
- this.blackMoney = val
- },
- SetBossMoney(val) {
- this.bossMoney = val
- },
- SetFramework(val) {
- this.framework = val
- },
- SetEnableWatermarkBlackMoney(val) {
- if (this.framework == 'esx') {
- this.enableWaterMarkBlackMoney = val
- } else {
- this.enableWaterMarkBlackMoney = false
- this.waterMarkHudVisibleData['black_money'] = false
- }
- },
- SetEnableWatermarkBossMoney(val) {
- if (this.framework == 'esx') {
- this.enableWaterMarkBossMoney = val
- } else {
- this.enableWaterMarkBossMoney = false
- this.waterMarkHudVisibleData['boss_money'] = false
- }
- },
- ColorInput(e) {
- $(e.currentTarget).parent().find('.colorinput').click()
- },
- EnableToggleMapButton(value) {
- this.toggleMapButtonEnabled = value
- },
- ToggleMinimap() {
- $.post(`https://${this.resourceName}/ToggleMinimap`, JSON.stringify({}));
- },
- LoadSettingsBox() {
- let val = 100
- if (document.querySelector('#healthLoader2')) {
- if (val <= 0) {
- val = 0
- }
- init('healthLoader2', 'healthBorder2', val / 100);
- let bar = new ProgressBar.Path('#healthText2', {
- easing: 'easeInOut',
- duration: 400
- });
-
- bar.set(0)
-
- bar.animate(val / 100)
- }
- if (document.querySelector('#healthLoader3')) {
- if (val <= 0) {
- val = 0
- }
- init('healthLoader3', 'healthBorder3', val / 100);
- let bar = new ProgressBar.Path('#healthText3', {
- easing: 'easeInOut',
- duration: 400
- });
-
- bar.set(0)
-
- bar.animate(val / 100)
- }
- if (document.querySelector('#waterLoader2')) {
- if (val <= 0) {
- val = 0
- }
- init('waterLoader2', 'waterBorder2', val / 100);
- let bar = new ProgressBar.Path('#waterText2', {
- easing: 'easeInOut',
- duration: 400
- });
-
- bar.set(0)
-
- bar.animate(val / 100)
- }
- if (document.querySelector('#waterLoader3')) {
- if (val <= 0) {
- val = 0
- }
- init('waterLoader3', 'waterBorder3', val / 100);
- let bar = new ProgressBar.Path('#waterText3', {
- easing: 'easeInOut',
- duration: 400
- });
-
- bar.set(0)
-
- bar.animate(val / 100)
- }
- if (document.querySelector('#stressLoader2')) {
- if (val <= 0) {
- val = 0
- }
- init('stressLoader2', 'stressBorder2', val / 100);
- let bar = new ProgressBar.Path('#stressText2', {
- easing: 'easeInOut',
- duration: 400
- });
-
- bar.set(0)
-
- bar.animate(val / 100)
- }
- if (document.querySelector('#stressLoader3')) {
- if (val <= 0) {
- val = 0
- }
- init('stressLoader3', 'stressBorder3', val / 100);
- let bar = new ProgressBar.Path('#stressText3', {
- easing: 'easeInOut',
- duration: 400
- });
-
- bar.set(0)
-
- bar.animate(val / 100)
- }
- if (document.querySelector('#armorLoader2')) {
- if (val <= 0) {
- val = 0
- }
- init('armorLoader2', 'armorBorder2', val / 100);
- let bar = new ProgressBar.Path('#armorText2', {
- easing: 'easeInOut',
- duration: 400
- });
-
- bar.set(0)
-
- bar.animate(val / 100)
- }
- if (document.querySelector('#armorLoader3')) {
- if (val <= 0) {
- val = 0
- }
- init('armorLoader3', 'armorBorder3', val / 100);
- let bar = new ProgressBar.Path('#armorText3', {
- easing: 'easeInOut',
- duration: 400
- });
-
- bar.set(0)
-
- bar.animate(val / 100)
- }
- if (document.querySelector('#hungerLoader2')) {
- if (val <= 0) {
- val = 0
- }
- init('hungerLoader2', 'hungerBorder2', val / 100);
- let bar = new ProgressBar.Path('#hungerText2', {
- easing: 'easeInOut',
- duration: 400
- });
-
- bar.set(0)
-
- bar.animate(val / 100)
- }
- if (document.querySelector('#hungerLoader3')) {
- if (val <= 0) {
- val = 0
- }
- init('hungerLoader3', 'hungerBorder3', val / 100);
- let bar = new ProgressBar.Path('#hungerText3', {
- easing: 'easeInOut',
- duration: 400
- });
-
- bar.set(0)
-
- bar.animate(val / 100)
- }
- if (document.querySelector('#staminaLoader2')) {
- if (val <= 0) {
- val = 0
- }
- init('staminaLoader2', 'staminaBorder2', val / 100);
- let bar = new ProgressBar.Path('#staminaText2', {
- easing: 'easeInOut',
- duration: 400
- });
-
- bar.set(0)
-
- bar.animate(val / 100)
- }
- if (document.querySelector('#staminaLoader3')) {
- if (val <= 0) {
- val = 0
- }
- init('staminaLoader3', 'staminaBorder3', val / 100);
- let bar = new ProgressBar.Path('#staminaText3', {
- easing: 'easeInOut',
- duration: 400
- });
-
- bar.set(0)
-
- bar.animate(val / 100)
- }
- if (document.querySelector('#nitroLoader2')) {
- if (val <= 0) {
- val = 0
- }
- init('nitroLoader2', 'nitroBorder2', val / 100);
- let bar = new ProgressBar.Path('#nitroText2', {
- easing: 'easeInOut',
- duration: 400
- });
-
- bar.set(0)
-
- bar.animate(val / 100)
- }
- if (document.querySelector('#nitroLoader3')) {
- if (val <= 0) {
- val = 0
- }
- init('nitroLoader3', 'nitroBorder3', val / 100);
- let bar = new ProgressBar.Path('#nitroText3', {
- easing: 'easeInOut',
- duration: 400
- });
-
- bar.set(0)
-
- bar.animate(val / 100)
- }
- if (document.querySelector('#altitudeLoader2')) {
- if (val <= 0) {
- val = 0
- }
- init('altitudeLoader2', 'altitudeBorder2', val / 100);
- let bar = new ProgressBar.Path('#altitudeText2', {
- easing: 'easeInOut',
- duration: 400
- });
-
- bar.set(0)
-
- bar.animate(val / 100)
- }
- if (document.querySelector('#altitudeLoader3')) {
- if (val <= 0) {
- val = 0
- }
- init('altitudeLoader3', 'altitudeBorder3', val / 100);
- let bar = new ProgressBar.Path('#altitudeText3', {
- easing: 'easeInOut',
- duration: 400
- });
-
- bar.set(0)
-
- bar.animate(val / 100)
- }
- if (document.querySelector('#parachuteLoader2')) {
- if (val <= 0) {
- val = 0
- }
- init('parachuteLoader2', 'parachuteBorder2', val / 100);
- let bar = new ProgressBar.Path('#parachuteText2', {
- easing: 'easeInOut',
- duration: 400
- });
-
- bar.set(0)
-
- bar.animate(val / 100)
- }
- if (document.querySelector('#parachuteLoader3')) {
- if (val <= 0) {
- val = 0
- }
- init('parachuteLoader3', 'parachuteBorder3', val / 100);
- let bar = new ProgressBar.Path('#parachuteText3', {
- easing: 'easeInOut',
- duration: 400
- });
-
- bar.set(0)
-
- bar.animate(val / 100)
- }
- if (document.querySelector('#oxyLoader2')) {
- if (val <= 0) {
- val = 0
- }
- init('oxyLoader2', 'oxyBorder2', val / 100);
- let bar = new ProgressBar.Path('#oxyText2', {
- easing: 'easeInOut',
- duration: 400
- });
-
- bar.set(0)
-
- bar.animate(val / 100)
- }
- if (document.querySelector('#oxyLoader3')) {
- if (val <= 0) {
- val = 0
- }
- init('oxyLoader3', 'oxyBorder3', val / 100);
- let bar = new ProgressBar.Path('#oxyText3', {
- easing: 'easeInOut',
- duration: 400
- });
-
- bar.set(0)
-
- bar.animate(val / 100)
- }
-
- },
- SetEnableWatermarkId(val) {
- this.enableWaterMarkId = val
- },
- SetDisableWaterMarkTextAndLogo(val) {
- this.disableWaterMarkTextAndLogo = val
- },
- GetVisibleStatusWaterMarkHud(type) {
- let status = false
- if (type == 'logo') {
- if (this.enableWaterMarkHudHideButtons) {
- status = !this.disableWaterMarkTextAndLogo && this.waterMarkHudVisibleData['logo'] || ((this.editAllModeActive || this.editModeActive) && !this.disableWaterMarkTextAndLogo)
- } else {
- status = !this.disableWaterMarkTextAndLogo
- }
- }
- if (type == 'id') {
- if (this.enableWaterMarkHudHideButtons) {
- status = this.enableWaterMarkId && this.waterMarkHudVisibleData['id'] || ((this.editAllModeActive || this.editModeActive) && this.enableWaterMarkId)
- } else {
- status = this.enableWaterMarkId
- }
- }
-
- if (type == 'weapon') {
- if (this.enableWaterMarkHudHideButtons) {
- status = (this.weaponImage != '' && this.enableWatermarkWeaponImage && this.waterMarkHudVisibleData['weapon']) || ((this.editAllModeActive || this.editModeActive) && this.enableWatermarkWeaponImage)
- } else {
- status = (this.weaponImage != '' && this.enableWatermarkWeaponImage) || ((this.editAllModeActive || this.editModeActive) && this.enableWatermarkWeaponImage)
- }
- }
-
- if (type == 'job') {
- if (this.enableWaterMarkHudHideButtons) {
- status = this.enableWatermarkJob && this.waterMarkHudVisibleData['job'] || ((this.editAllModeActive || this.editModeActive) && this.enableWatermarkJob)
- } else {
- status = this.enableWatermarkJob
- }
- }
- if (type == 'ammo') {
- if (this.enableWaterMarkHudHideButtons) {
- status = this.displayAmmoHud && this.enableAmmoHud && this.waterMarkHudVisibleData['ammo'] || ((this.editAllModeActive || this.editModeActive) && this.enableAmmoHud)
- } else {
- status = this.displayAmmoHud && this.enableAmmoHud || ((this.editAllModeActive || this.editModeActive) && this.enableAmmoHud)
- }
- }
- if (type == 'boss_money') {
- if (this.enableWaterMarkHudHideButtons) {
- status = this.enableWaterMarkBossMoney && this.waterMarkHudVisibleData['boss_money'] && this.framework == 'esx' && this.isBoss || ((this.editAllModeActive || this.editModeActive) && this.enableWaterMarkBossMoney)
-
- } else {
- status = this.enableWaterMarkBossMoney && this.isBoss && this.framework == 'esx' || ((this.editAllModeActive || this.editModeActive) && this.enableWaterMarkBossMoney)
- }
- }
- if (type == 'black_money') {
- if (this.enableWaterMarkHudHideButtons) {
- status = this.enableWaterMarkBlackMoney && this.waterMarkHudVisibleData['black_money'] && this.framework == 'esx' || ((this.editAllModeActive || this.editModeActive) && this.enableWaterMarkBlackMoney)
-
- } else {
- status = this.enableWaterMarkBlackMoney && this.framework == 'esx' || ((this.editAllModeActive || this.editModeActive) && this.enableWaterMarkBlackMoney)
- }
- }
-
- if (type == 'bank_money') {
- if (this.enableWaterMarkHudHideButtons) {
- status = this.enableWaterMarkBank && this.waterMarkHudVisibleData['bank_money'] || ((this.editAllModeActive || this.editModeActive) && this.enableWaterMarkBank)
-
- } else {
- status = this.enableWaterMarkBank || ((this.editAllModeActive || this.editModeActive) && this.enableWaterMarkBank)
- }
- }
- if (type == 'bank_money') {
- if (this.enableWaterMarkHudHideButtons) {
- status = this.enableWaterMarkBank && this.waterMarkHudVisibleData['bank_money'] || ((this.editAllModeActive || this.editModeActive) && this.enableWaterMarkBank)
-
- } else {
- status = this.enableWaterMarkBank || ((this.editAllModeActive || this.editModeActive) && this.enableWaterMarkBank)
- }
- }
- if (type == 'cash') {
- if (this.enableWaterMarkHudHideButtons) {
- status = this.enableWaterMarkCash && this.waterMarkHudVisibleData['cash'] || ((this.editAllModeActive || this.editModeActive) && this.enableWaterMarkCash)
-
- } else {
- status = this.enableWaterMarkCash || ((this.editAllModeActive || this.editModeActive) && this.enableWaterMarkCash)
- }
- }
- if (type == 'money-add') {
- status = (this.addedMoney != null || (this.editAllModeActive || this.editModeActive)) && (this.enableWaterMarkCash || this.enableWaterMarkBank || this.enableWaterMarkBlackMoney)
- }
- return status
- },
- SetEnableWatermarkCash(val) {
- this.enableWaterMarkCash = val
- },
- SetEnableWatermarkBankMoney(val) {
- this.enableWaterMarkBank = val
- },
- SetEnableWatermarkJob(val) {
- this.enableWatermarkJob = val
- },
- SetEnableWatermarkWeaponImage(val) {
- this.enableWatermarkWeaponImage = val
- },
- SetEngineHealth(val) {
- this.engineHealth = val
- },
- SetWeaponImage(val) {
- this.weaponImage = val
- },
- SetIsMuted(toggle) {
- this.isMuted = toggle
- },
- OnChangeInput(e) {
- // $('#radialHealth radialGradient stop').attr('stop-color', e.target.value)
- // $('#radialHealth2 radialGradient stop').attr('stop-color', e.target.value)
- // $('#radialHealth3 radialGradient stop').attr('stop-color', e.target.value)
- // $('#healthText').attr('stroke', e.target.value)
- // $('#healthText2').attr('stroke', e.target.value)
- // $('#healthText3').attr('stroke', e.target.value)
-
- },
- OnChangeColor(e) {
- $.post(`https://${this.resourceName}/hudselected`, JSON.stringify({ settingstype: 'hudColors', val: { color: e.target.value, type: e.target.getAttribute('data-type') } }));
- },
- ResetHudPositions() {
- $.post(`https://${this.resourceName}/ResetHudPositions`, JSON.stringify({}));
-
- },
- SetShowOxy(toggle) {
- this.showOxy = toggle
- },
- set_EnableSpeedometer(toggle) {
- this.enableSpeedometer = toggle
- },
- set_EnableHUD(toggle) {
- this.enableHud = toggle
- },
- SetAllEditMode(toggle) {
- this.editAllModeActive = toggle
- if (toggle) {
- this.ExitSettings()
- $.post(`https://${this.resourceName}/editModeActive`, JSON.stringify({ toggle: true }));
- SetProgressBar(0)
- setTimeout(() => {
- this.InitDrag()
-
- }, 200)
- } else {
- $.post(`https://${this.resourceName}/editModeActive`, JSON.stringify({ toggle: false }));
- }
- },
-
- SetEditMode(toggle) {
- this.editModeActive = toggle
- if (toggle) {
- this.ExitSettings()
- $.post(`https://${this.resourceName}/editModeActive`, JSON.stringify({ toggle: true }));
- SetProgressBar(0)
- setTimeout(() => {
- this.InitDrag()
-
- }, 200)
- } else {
- $.post(`https://${this.resourceName}/editModeActive`, JSON.stringify({ toggle: false }));
-
- }
- },
- SetHideData(type, e) {
- let val = e.target.value
- if (val > 0 && val <= 100) {
- $.post(`https://${this.resourceName}/hudselected`, JSON.stringify({
- settingstype: "hideBoxData", val: {
- ...this.hideBoxData,
- [type]: val
- }
- }));
- }
- },
- GetPositionsData(type) {
- if (this.positionsData[type]) {
- this.position[type].position = "absolute"
- return this.positionsData[type]
- }
- },
- SetHideShowBox(toggle) {
- $.post(`https://${this.resourceName}/hudselected`, JSON.stringify({ settingstype: 'showHideBox', val: toggle }));
- },
- SetEnableHealth(toggle) {
- this.enableHealth = toggle
- },
- SetEnableHunger(toggle) {
- this.enableHunger = toggle
- },
- SetEnableThirst(toggle) {
- this.enableThirst = toggle
- },
- SetEnableStamina(toggle) {
- this.enableStamina = toggle
- },
- SetEnableArmor(toggle) {
- this.enableArmor = toggle
- },
- SetRefreshRate(e) {
- $.post(`https://${this.resourceName}/hudselected`, JSON.stringify({ settingstype: 'refreshRate', val: e.target.value }));
-
- },
- SetEnableAmmoHUD(val) {
- this.enableAmmoHud = val
- },
- DisplayWeaponAmmo(toggle) {
- this.displayAmmoHud = toggle
- },
-
- SetAmmos(ammo, max_ammo) {
- this.ammo = ammo
- this.max_ammo = max_ammo
-
- },
- SetLogoSize(width, height) {
- this.logoWidth = width
- this.logoHeight = height
-
- },
- HideWaterMarkElement(type) {
- $.post(`https://${this.resourceName}/HideWaterMarkElement`, JSON.stringify({ type }));
-
- },
- SetSpeedometerSize() {
- $.post(`https://${this.resourceName}/hudselected`, JSON.stringify({ settingstype: 'speedometerSize', val: this.speedometerSize }));
- },
- SetHudSize() {
- $.post(`https://${this.resourceName}/hudselected`, JSON.stringify({ settingstype: 'hudSize', val: this.hudSize }));
-
- },
- SetStyles(val, val2) {
-
-
- this.text2Style = val2
- this.text1Style = val
-
-
- },
- SetSelectedMap(map) {
- $.post(`https://${this.resourceName}/hudselected`, JSON.stringify({ settingstype: 'maptype', val: map }));
-
- },
- SetShowCompass(val) {
- $.post(`https://${this.resourceName}/hudselected`, JSON.stringify({ settingstype: 'showCompass', val }));
-
- },
- SetUseWaterMarkText(val) {
- this.UseWaterMarkText = val
- },
- SetWaterMarkLogo(val) {
- this.WaterMarkLogo = val
- },
- GetResponse(resourceName) {
- this.resourceName = resourceName
- $.post(`https://${this.resourceName}/SendResponse`, JSON.stringify({}));
-
- },
- SetCruiseDisplay(val) {
- this.cruiseDisplayActive = val
- },
- SetSeatbeltDisplay(val) {
- this.seatbeltDisplayActive = val
- },
- SetDateDisplay(val) {
- this.dateDisplay = val
- },
- SetWaterMarkHud(val) {
- this.enableWaterMarkHud = val
- },
- SetUseNitro(val) {
- this.useNitro = val
- },
- UpdateAltitude(val) {
- this.showAltitude = val
- },
- UpdateParachute(val) {
- this.showParachute = val
- },
- UpdateJob(joblabel, gradelabel) {
- this.joblabel = joblabel
- this.grade_label = gradelabel
- },
- SetLocales(val) {
- this.locales = val
- },
- UpdateLights(val) {
- this.lightsOn = val
- },
- UpdateSeatbelt(val) {
- this.sealtBeltIsOn = val
- },
- ToggleCruise(val) {
- this.cruiseIsOn = val
- },
- ToggleEngine(val) {
- this.engineIsOn = val
- },
- UseStress(useStress) {
- this.useStress = useStress
- },
- SetDisplayRealTime(val) {
- this.DisplayRealTime = val
- },
- SetDate(clock, date) {
- this.clock = clock
- this.date = date
-
- },
- SetId(val) {
- this.playerId = val
- },
- SetBankMoney(val) {
- this.bankMoney = val
- },
- SetCash(val) {
- this.cash = val
- },
- deepEqual(x, y) {
- return (x && y && typeof x === 'object' && typeof y === 'object') ?
- (Object.keys(x).length === Object.keys(y).length) &&
- Object.keys(x).reduce((isEqual, key) => {
- return isEqual && this.deepEqual(x[key], y[key]);
- }, true) : (x === y);
- },
- UpdateSettings(data) {
- if (data.showHideBox != null && data.showHideBox != undefined) {
- this.showHideBox = data.showHideBox
- }
- if (data.waterMarkHudVisibleData != null && data.waterMarkHudVisibleData != undefined) {
- this.waterMarkHudVisibleData = data.waterMarkHudVisibleData
- }
- if (data.speedtype) {
- this.selectSpeedUnit = data.speedtype
- }
-
- if (data.maptype) {
- this.selectedMap = data.maptype
- }
- if (data.showCompass != null && data.showCompass != undefined) {
- this.showCompass = data.showCompass
- }
- if (data.hudColors) {
- let prev = this.hudColors[this.currentHud]
- this.hudColors = data.hudColors
- if (prev) {
- if (JSON.stringify(prev) !== JSON.stringify(this.hudColors[data.hud])) {
- progress = {}
- this.bars.bar_1 = null
- this.bars.bar_2 = null
- this.bars.bar_3 = null
- this.bars.bar_4 = null
- this.bars.bar_5 = null
- this.bars.bar_6 = null
- this.bars.bar_7 = null
- this.bars.bar_8 = null
- this.bars.bar_9 = null
- this.bars.bar_1_set = false
- this.bars.bar_2_set = false
- this.bars.bar_3_set = false
- this.bars.bar_4_set = false
- this.bars.bar_5_set = false
- this.bars.bar_6_set = false
- this.bars.bar_7_set = false
- this.bars.bar_8_set = false
- this.bars.bar_9_set = false
- onLoad(this.hudColors, data.hud)
- setTimeout(() => {
- this.LoadSettingsBox()
- }, 300)
- }
- } else {
- progress = {}
- this.bars.bar_1 = null
- this.bars.bar_2 = null
- this.bars.bar_3 = null
- this.bars.bar_4 = null
- this.bars.bar_5 = null
- this.bars.bar_6 = null
- this.bars.bar_7 = null
- this.bars.bar_8 = null
- this.bars.bar_9 = null
- this.bars.bar_1_set = false
- this.bars.bar_2_set = false
- this.bars.bar_3_set = false
- this.bars.bar_4_set = false
- this.bars.bar_5_set = false
- this.bars.bar_6_set = false
- this.bars.bar_7_set = false
- this.bars.bar_8_set = false
- this.bars.bar_9_set = false
- onLoad(this.hudColors, data.hud)
- setTimeout(() => {
- this.LoadSettingsBox()
- }, 300)
- }
-
- }
- if (data.hud) {
- this.currentHud = data.hud
- }
-
- if (data.forceHide != null && data.forceHide != undefined) {
- this.forceHide = data.forceHide
- }
- if (data.refreshRate != null && data.refreshRate != undefined) {
- this.refreshRate = data.refreshRate
- this.displayRefreshRate = data.refreshRate
-
-
- }
-
- if (data.positionsData != null && data.positionsData != undefined) {
- this.positionsData = data.positionsData
- }
-
- if (data.hideBoxData != null && data.hideBoxData != undefined) {
- this.hideBoxData = data.hideBoxData
- this.hideBoxDataDisplay = data.hideBoxData
-
- }
- if (data.hide != null && data.hide != undefined) {
- this.hide = data.hide
- }
-
- if (data.speedometerSize != null && data.speedometerSize != undefined) {
- this.speedometerSize = data.speedometerSize
- }
- if (data.hudSize != null && data.hudSize != undefined) {
- this.hudSize = data.hudSize
- }
-
- },
- InitDrag() {
- var click = {
- x: 0,
- y: 0
- };
- $('.textHudDrag').draggable({
- helper: "clone",
- revertDuration: 0,
- revert: "invalid",
- cancel: ".item-nodrag",
- scroll: false,
- start: function (event, ui) {
-
-
- },
- drag: (event, ui) => {
-
- },
- stop: (event, ui) => {
- //$(event.target).css('position', "absolute")
- //$(event.target).css('left', ui.position.left)
- //$(event.target).css('top', ui.position.top)
- let left = ui.position.left
- let top = ui.position.top
- let type = $(event.target).attr('data-type')
- $.post(`https://${this.resourceName}/hudselected`, JSON.stringify({
- settingstype: "positionsData", val: {
- ...this.positionsData,
- [type]: {
- position: 'absolute',
- left: left + 'px',
- top: top + 'px',
- }
- }
- }));
- SetProgressBar(0)
-
- },
- });
- $('.classicHudWrapper').draggable({
- helper: "clone",
- revertDuration: 0,
- revert: "invalid",
- cancel: ".item-nodrag",
- containment: "body",
- scroll: false,
- start: function (event, ui) {
-
-
- },
- drag: (event, ui) => {
-
- },
- stop: (event, ui) => {
- //$(event.target).css('position', "absolute")
- //$(event.target).css('left', ui.position.left)
- //$(event.target).css('top', ui.position.top)
- let left = ui.position.left
- let top = ui.position.top
- let type = $(event.target).attr('data-type')
- $.post(`https://${this.resourceName}/hudselected`, JSON.stringify({
- settingstype: "positionsData", val: {
- ...this.positionsData,
- [type]: {
- position: 'absolute',
- left: left + 'px',
- top: top + 'px',
- }
- }
- }));
- SetProgressBar(0)
-
- },
- });
- $('.textHudWrapper').draggable({
- helper: "clone",
- revertDuration: 0,
- revert: "invalid",
- cancel: ".item-nodrag",
- containment: "body",
- scroll: false,
- start: function (event, ui) {
-
-
- },
- drag: (event, ui) => {
-
- },
- stop: (event, ui) => {
- //$(event.target).css('position', "absolute")
- //$(event.target).css('left', ui.position.left)
- //$(event.target).css('top', ui.position.top)
- let left = ui.position.left
- let top = ui.position.top
- let type = $(event.target).attr('data-type')
- $.post(`https://${this.resourceName}/hudselected`, JSON.stringify({
- settingstype: "positionsData", val: {
- ...this.positionsData,
- [type]: {
- position: 'absolute',
- left: left + 'px',
- top: top + 'px',
- }
- }
- }));
- SetProgressBar(0)
-
- },
- });
-
-
- $('.textHudMicrophone').draggable({
- helper: "clone",
- revertDuration: 0,
- revert: "invalid",
- cancel: ".item-nodrag",
- containment: "body",
- scroll: false,
- start: function (event, ui) {
- click.x = event.clientX;
- click.y = event.clientY;
-
- },
- drag: (event, ui) => {
- var zoom = this.hudSize;
-
- var original = ui.originalPosition;
-
- // jQuery will simply use the same object we alter here
- ui.position = {
- left: (event.clientX - click.x + original.left) / zoom,
- top: (event.clientY - click.y + original.top) / zoom
- };
- },
- stop: (event, ui) => {
- //$(event.target).css('position', "absolute")
- //$(event.target).css('left', ui.position.left)
- //$(event.target).css('top', ui.position.top)
- let left = ui.position.left
- let top = ui.position.top
- let type = $(event.target).attr('data-type')
- $.post(`https://${this.resourceName}/hudselected`, JSON.stringify({
- settingstype: "positionsData", val: {
- ...this.positionsData,
- [type]: {
- position: 'absolute',
- left: left + 'px',
- top: top + 'px',
- }
- }
- }));
- SetProgressBar(0)
-
- },
- });
- $('.hud-topRight').draggable({
- helper: "clone",
- revertDuration: 0,
- revert: "invalid",
- cancel: ".item-nodrag",
- scroll: false,
- start: function (event, ui) {
-
-
- },
- drag: (event, ui) => {
-
- },
- stop: (event, ui) => {
- //$(event.target).css('position', "absolute")
- //$(event.target).css('left', ui.position.left)
- //$(event.target).css('top', ui.position.top)
- let left = ui.position.left
- let top = ui.position.top
- let type = $(event.target).attr('data-type')
- $.post(`https://${this.resourceName}/hudselected`, JSON.stringify({
- settingstype: "positionsData", val: {
- ...this.positionsData,
- [type]: {
- position: 'absolute',
- left: left + 'px',
- top: top + 'px',
- }
- }
- }));
- SetProgressBar(0)
-
- },
- });
-
- $('.HudCompassDrag').draggable({
- helper: "clone",
- revertDuration: 0,
- revert: "invalid",
- cancel: ".item-nodrag",
- scroll: false,
- start: function (event, ui) {
-
-
- },
- drag: (event, ui) => {
-
- },
- stop: (event, ui) => {
- //$(event.target).css('position', "absolute")
- //$(event.target).css('left', ui.position.left)
- //$(event.target).css('top', ui.position.top)
- let left = ui.position.left
- let top = ui.position.top
- let type = $(event.target).attr('data-type')
- $.post(`https://${this.resourceName}/hudselected`, JSON.stringify({
- settingstype: "positionsData", val: {
- ...this.positionsData,
- [type]: {
- position: 'absolute',
- left: left + 'px',
- top: top + 'px',
- }
- }
- }));
- SetProgressBar(0)
- },
- });
- $('.watermarkHudDrag').draggable({
- helper: "clone",
- revertDuration: 0,
- revert: "invalid",
- cancel: ".item-nodrag",
- scroll: false,
- start: function (event, ui) {
-
-
- },
- drag: (event, ui) => {
-
- },
- stop: (event, ui) => {
- //$(event.target).css('position', "absolute")
- //$(event.target).css('left', ui.position.left)
- //$(event.target).css('top', ui.position.top)
- let left = ui.position.left
- let top = ui.position.top
- let type = $(event.target).attr('data-type')
- $.post(`https://${this.resourceName}/hudselected`, JSON.stringify({
- settingstype: "positionsData", val: {
- ...this.positionsData,
- [type]: {
- position: 'absolute',
- left: left + 'px',
- top: top + 'px',
- }
- }
- }));
- SetProgressBar(0)
- },
- });
- $('.classicHudDrag').draggable({
- helper: "clone",
- revertDuration: 0,
- revert: "invalid",
- cancel: ".item-nodrag",
- scroll: false,
- start: function (event, ui) {
- click.x = event.clientX;
- click.y = event.clientY;
-
- },
- drag: (event, ui) => {
- var zoom = this.hudSize;
-
- var original = ui.originalPosition;
-
- // jQuery will simply use the same object we alter here
- ui.position = {
- left: (event.clientX - click.x + original.left) / zoom,
- top: (event.clientY - click.y + original.top) / zoom
- };
- },
- stop: (event, ui) => {
- //$(event.target).css('position', "absolute")
- //$(event.target).css('left', ui.position.left)
- //$(event.target).css('top', ui.position.top)
- let left = ui.position.left
- let top = ui.position.top
- let type = $(event.target).attr('data-type')
- $.post(`https://${this.resourceName}/hudselected`, JSON.stringify({
- settingstype: "positionsData", val: {
- ...this.positionsData,
- [type]: {
- position: 'absolute',
- left: left + 'px',
- top: top + 'px',
- }
- }
- }));
- SetProgressBar(0)
- },
- });
-
-
- $('.speedometerDrag').draggable({
- helper: "clone",
- revertDuration: 0,
- revert: "invalid",
- cancel: ".item-nodrag",
- containment: "body",
- scroll: false,
- start: function (event, ui) {
- click.x = event.clientX;
- click.y = event.clientY;
- },
- drag: (event, ui) => {
- var zoom = this.speedometerSize;
-
- var original = ui.originalPosition;
-
- // jQuery will simply use the same object we alter here
- ui.position = {
- left: (event.clientX - click.x + original.left) / zoom,
- top: (event.clientY - click.y + original.top) / zoom
- };
- },
- stop: (event, ui) => {
- //$(event.target).css('position', "absolute")
- //$(event.target).css('left', ui.position.left)
- //$(event.target).css('top', ui.position.top)
- let left = ui.position.left
- let top = ui.position.top
- let type = $(event.target).attr('data-type')
- $.post(`https://${this.resourceName}/hudselected`, JSON.stringify({
- settingstype: "positionsData", val: {
- ...this.positionsData,
- [type]: {
- position: 'absolute',
- left: left + 'px',
- top: top + 'px',
- }
- }
- }));
- SetProgressBar(0)
-
- },
- });
-
- $('.textHudIcons').draggable({
- helper: "clone",
- revertDuration: 0,
- revert: "invalid",
- cancel: ".item-nodrag",
- containment: "body",
- scroll: false,
- start: function (event, ui) {
- click.x = event.clientX;
- click.y = event.clientY;
-
- },
- drag: (event, ui) => {
- var zoom = this.hudSize;
-
- var original = ui.originalPosition;
-
- // jQuery will simply use the same object we alter here
- ui.position = {
- left: (event.clientX - click.x + original.left) / zoom,
- top: (event.clientY - click.y + original.top) / zoom
- };
- },
- stop: (event, ui) => {
- //$(event.target).css('position', "absolute")
- //$(event.target).css('left', ui.position.left)
- //$(event.target).css('top', ui.position.top)
- let left = ui.position.left
- let top = ui.position.top
- let type = $(event.target).attr('data-type')
- $.post(`https://${this.resourceName}/hudselected`, JSON.stringify({
- settingstype: "positionsData", val: {
- ...this.positionsData,
- [type]: {
- position: 'absolute',
- left: left + 'px',
- top: top + 'px',
- }
- }
- }));
- SetProgressBar(0)
-
- },
- });
-
- if (this.editAllModeActive) {
- $('.classicHudDrag').draggable('destroy');
- $('.textHudIcons').draggable('destroy');
- $('.textHudMicrophone').draggable('destroy')
- } else {
- $('.classicHudWrapper').draggable('destroy')
- $('.textHudWrapper').draggable('destroy')
- $('.hud-topRight').draggable('destroy')
-
-
- }
-
- },
- SetForceHide(val) {
- this.forceHide = val
- },
- DisplayMapOnWalk(displayOnWalk) {
- this.displayOnWalk = displayOnWalk
- },
- SetSpeedometerVisibility(visibility, displayOnWalk) {
- this.showSpeedometer = visibility
- this.displayOnWalk = displayOnWalk
- },
- SetHudSettingsVisibilty(visibility) {
- this.settingsOpen = visibility
- if (visibility) {
- this.bars.bar_1 = null
- this.bars.bar_2 = null
- this.bars.bar_3 = null
- this.bars.bar_4 = null
- this.bars.bar_5 = null
- this.bars.bar_6 = null
- this.bars.bar_7 = null
- this.bars.bar_8 = null
- this.bars.bar_9 = null
- this.LoadSettingsBox()
- this.bars.bar_1_set = false
- this.bars.bar_2_set = false
- this.bars.bar_3_set = false
- this.bars.bar_4_set = false
- this.bars.bar_5_set = false
- this.bars.bar_6_set = false
- this.bars.bar_7_set = false
- this.bars.bar_8_set = false
- this.bars.bar_9_set = false
-
-
- }
- },
- SetStatusData(type, val) {
- if (type == "altitude") {
- if (val >= 2483) {
- val = 2483
- } else if (val <= 0) {
- val = 0
- }
-
- }
- if (type == 'health') {
- if (val < 0) {
- val = 0
- }
- }
- if (typeof (val) == 'boolean') {
- this.statusData[type] = val
-
- } else {
-
- this.statusData[type] = val.toFixed(0)
- }
-
- if (type == "nitro") {
- if (val <= 0) {
- val = 0
- }
- if (document.querySelector('#nitroLoader')) {
- init('nitroLoader', 'nitroBorder', val / 100);
- if (this.bars.bar_8 == null) {
- this.bars.bar_8 = new ProgressBar.Path('#nitroText', {
- easing: 'easeInOut',
- duration: 400
- });
- }
-
- if (this.bars.bar_8 && !this.bars.bar_8_set) {
- this.bars.bar_8.set(0)
- this.bars.bar_8_set = true
- }
- this.bars.bar_8.animate(val / 100)
-
- }
-
- }
- if (type == "altitude") {
- if (document.querySelector('#altitudeLoader')) {
-
-
- init('altitudeLoader', 'altitudeBorder', 1.0 - (val / 2483));
- if (this.bars.bar_7 == null) {
- this.bars.bar_7 = new ProgressBar.Path('#altitudeText', {
- easing: 'easeInOut',
- duration: 400
- });
- }
-
- if (this.bars.bar_7 && !this.bars.bar_7_set) {
- this.bars.bar_7.set(0)
- this.bars.bar_7_set = true
- }
- this.bars.bar_7.animate(1.0 - (val / 2483))
- }
- if (document.querySelector('#parachuteLoader')) {
-
- init('parachuteLoader', 'parachuteBorder', 1.0 - (val / 2483));
- if (this.bars.bar_9 == null) {
- this.bars.bar_9 = new ProgressBar.Path('#parachuteText', {
- easing: 'easeInOut',
- duration: 400
- });
- }
-
- if (this.bar_9 && !this.bar_9_set) {
- this.bars.bar_9.set(0)
- this.bars.bar_9_set = true
- }
- this.bars.bar_9.animate(1.0 - (val / 2483))
- }
- }
- if (type == "health") {
- if (document.querySelector('#healthLoader')) {
- if (val <= 0) {
- val = 0
- }
- init('healthLoader', 'healthBorder', val / 100);
- if (this.bars.bar_1 == null) {
- this.bars.bar_1 = new ProgressBar.Path('#healthText', {
- easing: 'easeInOut',
- duration: 400
- });
- }
-
- if (this.bars.bar_1 && !this.bars.bar_1_set) {
- this.bars.bar_1.set(0)
- this.bars.bar_1_set = true
- }
- this.bars.bar_1.animate(val / 100)
- }
- }
- if (type == "oxy") {
- if (document.querySelector('#oxyLoader')) {
- if (val <= 0) {
- val = 0
- }
- init('oxyLoader', 'oxyBorder', val / 100);
- if (this.bars.bar_8 == null) {
- this.bars.bar_8 = new ProgressBar.Path('#oxyText', {
- easing: 'easeInOut',
- duration: 400
- });
- }
-
- if (this.bars.bar_8 && !this.bars.bar_8_set) {
- this.bars.bar_8.set(0)
- this.bars.bar_8_set = true
- }
- this.bars.bar_8.animate(val / 100)
- }
- }
-
- if (type == "hunger") {
-
- if (document.querySelector('#hungerLoader')) {
- init('hungerLoader', 'hungerBorder', val / 100);
- if (this.bars.bar_2 == null) {
- this.bars.bar_2 = new ProgressBar.Path('#hungerText', {
- easing: 'easeInOut',
- duration: 400
- });
- }
-
- if (this.bars.bar_2 && !this.bars.bar_2_set) {
- this.bars.bar_2.set(0)
- this.bars.bar_2_set = true
- }
- this.bars.bar_2.animate(val / 100)
- }
- }
- if (type == "thirst") {
- if (document.querySelector('#waterLoader')) {
- init('waterLoader', 'waterBorder', val / 100);
- if (this.bars.bar_3 == null) {
- this.bars.bar_3 = new ProgressBar.Path('#waterText', {
- easing: 'easeInOut',
- duration: 400
- });
- }
-
- if (this.bars.bar_3 && !this.bars.bar_3_set) {
- this.bars.bar_3.set(0)
- this.bars.bar_3_set = true
- }
- this.bars.bar_3.animate(val / 100)
- }
- }
- if (type == "stamina") {
-
- if (document.querySelector('#staminaLoader')) {
- init('staminaLoader', 'staminaBorder', val / 100);
- if (this.bars.bar_4 == null) {
- this.bars.bar_4 = new ProgressBar.Path('#staminaText', {
- easing: 'easeInOut',
- duration: 400
- });
- }
-
- if (this.bars.bar_4 && !this.bars.bar_4_set) {
- this.bars.bar_4.set(0)
- this.bars.bar_4_set = true
- }
- this.bars.bar_4.animate(val / 100)
- }
- }
- if (type == "armour") {
- if (document.querySelector('#armorLoader')) {
- init('armorLoader', 'armorBorder', val / 100);
- if (this.bars.bar_5 == null) {
- this.bars.bar_5 = new ProgressBar.Path('#armorText', {
- easing: 'easeInOut',
- duration: 400
- });
- }
-
- if (this.bars.bar_5 && !this.bars.bar_5_set) {
- this.bars.bar_5.set(0)
- this.bars.bar_5_set = true
- }
- this.bars.bar_5.animate(val / 100)
- }
- }
- if (type == "stress" && this.useStress) {
- if (document.querySelector('#stressLoader')) {
- init('stressLoader', 'stressBorder', val / 100);
- if (this.bars.bar_6 == null) {
- this.bars.bar_6 = new ProgressBar.Path('#stressText', {
- easing: 'easeInOut',
- duration: 400
- });
- }
-
- if (this.bars.bar_6 && !this.bars.bar_6_set) {
- this.bars.bar_6.set(0)
- this.bars.bar_6_set = true
- }
- this.bars.bar_6.animate(val / 100)
- }
- }
-
- },
- LocationUpdate(zone, street, heading) {
- this.street = street
- this.zone = zone
- this.heading = heading
- },
- OnAddedMoney(amount, minus, moneyType) {
- this.addedMoney = amount
- this.moneyType = moneyType
- this.isMinus = minus
- setTimeout(() => {
- this.addedMoney = null
- }, 1500)
- },
- numberWithSpaces(x) {
- return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " ");
- },
- SetCurrentHud(hud) {
- $.post(`https://${this.resourceName}/hudselected`, JSON.stringify({ settingstype: 'hud', val: hud }));
- },
-
- SetSelectSpeedUnit(val) {
- $.post(`https://${this.resourceName}/hudselected`, JSON.stringify({ settingstype: 'speedtype', val }));
-
- },
- ToggleHud() {
- $.post(`https://${this.resourceName}/hudselected`, JSON.stringify({ settingstype: 'hide', val: !this.hide }));
- },
- ToggleCinematic() {
- $.post(`https://${this.resourceName}/toggleCinematic`, JSON.stringify({}), (val) => {
- this.enableCinematic = val
- });
- },
- ExitSettings() {
- this.SetHudSettingsVisibilty(false)
-
- $.post(`https://${this.resourceName}/ExitSettings`, JSON.stringify({}));
- },
- SetFuel(fuel) {
- this.fuel = fuel
- },
- GetSvg(type) {
- let data = this.svg.filter((s) => s.type == type)
- return data[0] ? data[0].svg : ''
- },
- SetIndicatorDegree(val, rpm) {
- this.speed = val
- this.rpm = rpm
- if (val >= 100) {
- if (val >= 240) {
- this.indicatorDegree = 240 - 140
- } else {
- this.indicatorDegree = val - 140
- }
- } else {
- this.indicatorDegree = val - 124
-
- }
- },
- AddSvg(type, svg) {
- let alreadyExist = this.svg.filter((s) => s.type == type)
- if (alreadyExist[0]) {
- alreadyExist[0].svg = svg
- }
- this.svg.push({
- svg,
- type
- })
- },
- SetWaterMarkText(text1, text2) {
- this.text1 = text1
- this.text2 = text2
-
- }
- },
- computed: {
- GetCompassStyle() {
- if (this.positionsData[this.currentHud + '-compass']) {
- return { ...this.positionsData[this.currentHud + '-compass'], transform: 'scale(' + this.hudSize + ')' }
- } else {
- let bottom = '6rem'
- if (this.showSpeedometer || this.displayOnWalk) {
- if (this.selectedMap == 'rectangle') {
- bottom = '17.5rem'
- } else {
- bottom = '21rem'
- }
- }
-
- return { left: '1.7rem', bottom, transform: 'scale(' + this.hudSize + ')' }
- }
-
- },
- GetSpeedometerSize() {
- return {
- transform: `scale(${this.speedometerSize})`
- }
- },
- GetMphButton() {
- return this.selectSpeedUnit == 'mph' ? 'MPH
' : 'MPH
'
- },
- GetKmhButton() {
- return this.selectSpeedUnit == 'kmh' ? 'KMH
' : 'KMH
'
-
- },
-
- GetCircleButton() {
- return this.selectedMap == 'radial' ? `${this.locales['radial']}
` : `${this.locales['radial']}
`
- },
- GetRectangleButton() {
- return this.selectedMap == 'rectangle' ? `${this.locales['rectangle']}
` : `${this.locales['rectangle']}
`
-
- },
-
- GetSpeed() {
- if (this.speed.length >= 3) {
- return `${this.speed}`
- } else if (this.speed.length == 2) {
- return `0${this.speed}`
- } else if (this.speed.length == 1 && this.speed != 0) {
- return `00${this.speed}`
- } else {
- return `000`
-
- }
- },
- style() {
- return { transform: 'translate(-50%, -95%) rotate(' + this.indicatorDegree + 'deg)' }
- }
- },
- mounted() {
-
- $.post(`https://${this.resourceName}/NuiReady`, JSON.stringify({}));
- this.InitDrag()
-
- }
-})
-
-
-if (app.DisplayRealTime) {
- let interval = setInterval(() => {
- const date = new Date()
- let minutes = date.getMinutes()
- let seconds = date.getSeconds()
- if (minutes < 10) {
- minutes = "0" + minutes
- }
- if (seconds < 10) {
- seconds = "0" + seconds
- }
- if (!app.DisplayRealTime) {
- clearInterval(interval)
- }
-
- const time = date.getHours() + ":" + minutes + ":" + seconds;
-
- app.SetDate(time, GetDateFormat())
-
- }, 1000)
- const date = new Date()
- let minutes = date.getMinutes()
- let seconds = date.getSeconds()
- if (minutes < 10) {
- minutes = "0" + minutes
- }
- if (seconds < 10) {
- seconds = "0" + seconds
- }
- const time = date.getHours() + ":" + minutes + ":" + seconds;
-
- app.SetDate(time, GetDateFormat())
-}
-
-var fuel
-
-
-if (document.querySelector('#fuel')) {
- fuel = new ProgressBar.Path('#fuel', {
- easing: 'easeInOut',
- duration: 150
- });
- fuel.set(1);
-}
-
-
-function SetProgressBar(val) {
- if (bar) {
- if (val >= 240) {
- bar.animate(240 / 550)
- } else {
- if (val >= 100) {
- bar.animate(val / 550)
- } else {
- bar.animate(val / 500)
- }
- }
- } else {
- if (document.querySelector('#path-2')) {
- bar = new ProgressBar.Path('#path-2', {
- duration: 300
- });
- }
- }
-}
-
-function GetDateFormat() {
- const date = new Date();
- let month = date.getMonth() + 1
- let day = date.getDate()
- if (month < 10) {
- month = '0' + month
- }
- if (day < 10) {
- day = '0' + day
- }
-
- const dateD = date.getFullYear() + '/' + month + '/' + day;
- return dateD
-}
-
-window.addEventListener("message", function (event) {
- var item = event.data;
- switch (item.type) {
-
- case "speed_update":
- let rpm = (item.rpm - 0.20) / 1.83;
- if (rpm < 0) {
- rpm = 0
- }
- if (bar) {
- bar.animate(rpm)
- } else {
- if (document.querySelector('#path-2')) {
- bar = new ProgressBar.Path('#path-2', {
- duration: 300
- });
- }
- }
-
- app.SetIndicatorDegree(item.speed, rpm)
- break
- case "fuel_update":
- if (fuel) {
- fuel.animate(item.fuel / 100)
-
- } else {
- if (document.querySelector('#fuel')) {
- fuel = new ProgressBar.Path('#fuel', {
- easing: 'easeInOut',
- duration: 150
- });
- fuel.set(1);
- }
- }
- app.SetFuel(item.fuel.toFixed(0))
- break
- case "open_hudsettings":
- app.SetHudSettingsVisibilty(true)
- break
- case "show_speedometer":
-
- app.SetSpeedometerVisibility(true, item.displayOnWalk)
-
- break
- case "hide_speedometer":
-
- app.SetSpeedometerVisibility(false, item.displayOnWalk)
- if (this.seatbeltaudio) {
- this.seatbeltaudio.pause();
- }
- break
- case "set_status":
-
- app.SetStatusData(item.statustype, item.value)
- break
- case "EnableWatermarkJob":
- app.SetEnableWatermarkJob(item.value)
- break
- case "update_settings":
- app.UpdateSettings(item.val)
- break
- case "set_id":
- app.SetId(item.value)
- break
- case "set_EnableAmmohud":
-
- app.SetEnableAmmoHUD(item.value)
- break
- case "update_bank":
- app.SetBankMoney(item.money)
- break
- case "update_money":
- app.SetCash(item.money)
- break
- case "watermark_text":
- app.SetWaterMarkText(item.text1, item.text2)
- break
- case "on_added_money":
- app.OnAddedMoney(item.amount, item.minus, item.moneyType)
- break
- case "location_update":
- app.LocationUpdate(item.street, item.zone, item.heading)
- break
- case "UseStress":
- app.UseStress(item.value)
- break
- case "DisplayRealTime":
-
- app.SetDisplayRealTime(item.value)
- break
- case "clock_update":
-
- app.SetDate(item.hours + ":" + item.minutes, GetDateFormat())
- break
- case "SetIsBoss":
- app.SetIsBoss(item.value)
- break
- case "toggle_cruise":
- app.ToggleCruise(item.toggle)
- break
- case "toggle_engine":
- app.ToggleEngine(item.toggle)
- break
- case "EnableWatermarkCash":
- app.SetEnableWatermarkCash(item.value)
- break
- case "EnableWatermarkBlackMoney":
- app.SetEnableWatermarkBlackMoney(item.value)
- break
-
- case "EnableWatermarkBossMoney":
- app.SetEnableWatermarkBossMoney(item.value)
- break
- case "update_seatbelt":
- app.UpdateSeatbelt(item.toggle)
- if (item.toggle) {
- if (this.seatbeltaudio) {
- this.seatbeltaudio.pause();
- }
- }
- break
- case "unbuckle":
- const unbuckle = document.querySelector('#unbuckle')
- unbuckle.volume = event.data.volume;
- unbuckle.play();
- break;
- case "EnableWatermarkId":
- app.SetEnableWatermarkId(item.value)
- break
- case "buckle":
- const buckle = document.querySelector('#buckle')
- buckle.volume = event.data.volume;
- buckle.play();
- break;
- case "update_ligths":
- app.UpdateLights(item.state)
- break
- case "set_locales":
- app.SetLocales(item.value)
- break
- case "EnableWaterMarkHudHideButtons":
- app.EnableWaterMarkHudHideButtons(item.value)
- break
- case "set_force_hide":
- app.SetForceHide(item.value)
- break
- case "SetBlackMoney":
- app.SetBlackMoney(item.money)
- break
- case "SetBossMoney":
- app.SetBossMoney(item.money)
- break
- case "update_job":
- app.UpdateJob(item.joblabel, item.grade_label)
- break
- case "DisableWaterMarkTextAndLogo":
- app.SetDisableWaterMarkTextAndLogo(item.value)
- break
- case "update_parachute":
- app.UpdateParachute(item.val)
- break
- case "update_altitude":
- app.UpdateAltitude(item.val)
- break
- case "set_watermarkhud":
- app.SetWaterMarkHud(item.value)
- break
- case "set_useNitro":
- app.SetUseNitro(item.value)
- break
- case "EnableCompass":
- app.EnableCompass(item.value)
- break
- case "set_DateDisplay":
- app.SetDateDisplay(item.value)
- break
- case "set_cruiseDisplay":
- app.SetCruiseDisplay(item.value)
- break
- case "EnableWatermarkWeaponImage":
- app.SetEnableWatermarkWeaponImage(item.value)
- break
- case "set_seatbeltDisplay":
- app.SetSeatbeltDisplay(item.value)
- break
- case "SetAccountSizes":
- app.SetAccountSizes(item.value)
- break
- case "send_response":
- app.GetResponse(item.resourceName)
- break
- case "UseWaterMarkText":
- app.SetUseWaterMarkText(item.value)
- break
- case "EnableWatermarkBankMoney":
-
- app.SetEnableWatermarkBankMoney(item.value)
- break
- case "WaterMarkLogo":
- app.SetWaterMarkLogo(item.value)
- break
- case "SetStyles":
- app.SetStyles(item.text1, item.text2)
- break
- case "SetLogoSize":
- app.SetLogoSize(item.width, item.height)
- break
- case "display_weapon_ammo":
- app.DisplayWeaponAmmo(item.toggle)
- break
- case "update_weapon_ammo":
- app.SetAmmos(item.ammo, item.maxammo)
- break
- case "set_EnableArmor":
- app.SetEnableArmor(item.value)
- break
- case "set_EnableHealth":
- app.SetEnableHealth(item.value)
- break
- case "set_EnableStamina":
- app.SetEnableStamina(item.value)
- break
- case "set_EnableHunger":
- app.SetEnableHunger(item.value)
- break
- case "set_EnableThirst":
- app.SetEnableThirst(item.value)
- break
- case "set_EnableSpeedometer":
- app.set_EnableSpeedometer(item.value)
- break
- case "set_EnableHUD":
- app.set_EnableHUD(item.value)
- break
- case "toggle_oxy":
- app.SetShowOxy(item.toggle)
- break
- case "toggle_muted":
- app.SetIsMuted(item.toggle)
- break
- case "SetEngineHealth":
- app.SetEngineHealth(item.value)
- break
- case "SetWeaponImage":
- app.SetWeaponImage(item.value)
- break
- case "EnableToggleMapButton":
- app.EnableToggleMapButton(item.value)
- break
- case "DisplayMapOnWalk":
- app.DisplayMapOnWalk(item.value)
- break
- case "SetFramework":
- app.SetFramework(item.value)
- break
- case "PLAY_SEATBELT_SOUND":
- if (this.seatbeltaudio) {
- this.seatbeltaudio.setAttribute('src', 'seatbeltbeep.ogg'); //change the source
- this.seatbeltaudio.load();
- this.seatbeltaudio.play();
- }
- this.seatbeltaudio = document.querySelector('#seatbeltbeep')
- this.seatbeltaudio.play();
- this.seatbeltaudio.volume = 0.1;
-
- break
- default:
- break
-
- }
-})
-
-const handleEsc = (event) => {
- if (event.keyCode === 27) {
- app.ExitSettings()
- app.SetEditMode(false)
- app.SetAllEditMode(false)
- }
-};
-window.addEventListener('keydown', handleEsc);
\ No newline at end of file
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/script/svgProvider.js b/resources/[tools]/Codem-BlackHUDV2/html/script/svgProvider.js
deleted file mode 100644
index eb95d26e3..000000000
--- a/resources/[tools]/Codem-BlackHUDV2/html/script/svgProvider.js
+++ /dev/null
@@ -1,1714 +0,0 @@
-let loaded = false
-function onLoad(hudColors, currentHud) {
- app.AddSvg('textHudHealthInner', `
-
-`)
-
- app.AddSvg('textHudHealthInner2', `
-
-`)
- app.AddSvg('textHudHealthInner3', `
-
-`)
- app.AddSvg('textHudOxyInner', `
-
-`)
- app.AddSvg('textHudOxyRadial', `
-
-
-`)
- app.AddSvg('textHudOxyInner2', `
-
-`)
- app.AddSvg('textHudOxyRadial2', `
-
-
-`)
-
- app.AddSvg('textHudOxyInner3', `
-
-`)
-
- app.AddSvg('textHudOxyRadial3', `
-
-
-`)
-
-
- app.AddSvg('oxyIcon', `
-
-
-
-`)
-
-
-
- app.AddSvg('textHudHealthRadial', `
-
-
-`)
-
- app.AddSvg('colorPickerIcon', `
-
-
-`)
-
- app.AddSvg('textHudHealthRadial2', `
-
-
-`)
-
-
- app.AddSvg('textHudHealthRadial3', `
-
-
-`)
- app.AddSvg('ammo-hud', `
-
-
-`)
-
-
-
-
- app.AddSvg('textHudHeartIcon', `
-
-`)
-
- app.AddSvg('textHudHeartIcon2', `
-
-`)
- app.AddSvg('textHudHeartIconText', `
-
-`)
-
- app.AddSvg('textHudWaterInner', `
-
-`)
-
- app.AddSvg('textHudWaterInner2', `
-
-`)
-
- app.AddSvg('textHudWaterInner3', `
-
-`)
-
-
- app.AddSvg('textHudWaterhRadial', `
-
-
-`)
- app.AddSvg('textHudWaterRadial2', `
-
-
-`)
-
- app.AddSvg('textHudWaterRadial3', `
-
-
-`)
- app.AddSvg('textHudWaterIcon', `
-
-`)
-
- app.AddSvg('textHudWaterIconText', `
-
-`)
-
-
-
- app.AddSvg('textHudMicrophonelow', `
-
-
-`)
-
- app.AddSvg('textHudMicrophonemid', `
-
-
-
-`)
-
- app.AddSvg('textHudMicrophonehigh', `
-
-`)
- app.AddSvg('textHudMicrophone2', `
-
-
-
-
-
-`)
-
- app.AddSvg('textHudMicrophone', `
-
-
-
-`)
-
- app.AddSvg('textHudTextMicrophonelow2', `
-
-
-
-
-`)
-
- app.AddSvg('textHudTextMicrophonemid', `
-
-
-
-
-
-`)
-
- app.AddSvg('textHudTextMicrophonelow', `
-
-
-
-
-`)
-
- app.AddSvg('textHudTextMicrophonemid2', `
-
-
-
-
-
-`)
-
- app.AddSvg('bank-icon', `
-
-
-`)
-
- app.AddSvg('money-icon', `
-
-
-`)
-
-
- app.AddSvg('mic-muted', `
-
-
-
-`)
-
- app.AddSvg('mic-muted-text', `
->
-
-
-
-`)
-
-
-
-
- app.AddSvg('textHudTextMicrophonehigh', `
-
-
-
-
-`)
- app.AddSvg('textHudTextMicrophonehigh2', `
-
-
-
-
-`)
-
-
- app.AddSvg('textHudArmorInner', `
-
-`)
-
- app.AddSvg('textHudArmorRadial', `
-
-
-`)
- app.AddSvg('textHudArmorInner2', `
-
-`)
-
- app.AddSvg('textHudArmorRadial2', `
-
-
-`)
-
- app.AddSvg('textHudArmorInner3', `
-
-`)
-
- app.AddSvg('textHudArmorRadial3', `
-
-
-`)
- app.AddSvg('textHudArmorIcon', `
-
-`)
- app.AddSvg('textHudArmorIconText', `
-
-`)
-
-
- app.AddSvg('textHudHungerInner', `
-
-`)
-
- app.AddSvg('textHudHungerRadial', `
-
-
-`)
-
-
- app.AddSvg('textHudHungerInner2', `
-
-`)
-
- app.AddSvg('textHudHungerRadial2', `
-
-
-`)
- app.AddSvg('textHudHungerInner3', `
-
-`)
-
- app.AddSvg('textHudHungerRadial3', `
-
-
-`)
-
-
- app.AddSvg('textHudHungerIcon', `
-
-
-`)
-
- app.AddSvg('textHudHungerIconText', `
-
-
-
-`)
-
- app.AddSvg('textHudStaminaInner', `
-
-`)
-
- app.AddSvg('textHudStaminaRadial', `
-
-
-`)
-
- app.AddSvg('textHudStaminaInner2', `
-
-`)
-
- app.AddSvg('textHudStaminaRadial2', `
-
-
-`)
-
- app.AddSvg('textHudStaminaInner3', `
-
-`)
-
- app.AddSvg('textHudStaminaRadial3', `
-
-
-`)
-
-
- app.AddSvg('textHudStaminaIcon', `
-
-`)
- app.AddSvg('textHudStaminaIconText', `
-
-`)
-
-
-
- app.AddSvg('textHudStressInner', `
-
-`)
-
- app.AddSvg('textHudStressInner2', `
-
-`)
-
- app.AddSvg('textHudStressInner3', `
-
-`)
-
- app.AddSvg('textHudNitroInner', `
-
-`)
-
- app.AddSvg('textHudNitroRadial', `
-
-
-`)
-
- app.AddSvg('textHudNitroInner2', `
-
-`)
-
- app.AddSvg('textHudNitroRadial2', `
-
-
-`)
-
- app.AddSvg('textHudNitroInner3', `
-
-`)
-
- app.AddSvg('textHudNitroRadial3', `
-
-
-`)
-
-
- app.AddSvg('textHudAltitudeInner', `
-
-`)
-
- app.AddSvg('textHudAltitudeRadial', `
-
-
-`)
-
- app.AddSvg('textHudAltitudeInner2', `
-
-`)
-
- app.AddSvg('textHudAltitudeRadial2', `
-
-
-`)
- app.AddSvg('textHudAltitudeInner3', `
-
-`)
-
- app.AddSvg('textHudAltitudeRadial3', `
-
-
-`)
-
- app.AddSvg('textHudParachuteInner', `
-
-`)
-
- app.AddSvg('textHudParachuteRadial', `
-
-
-`)
-
- app.AddSvg('textHudParachuteInner2', `
-
-`)
-
- app.AddSvg('textHudParachuteRadial2', `
-
-
-`)
- app.AddSvg('textHudParachuteInner3', `
-
-`)
-
- app.AddSvg('textHudParachuteRadial3', `
-
-
-`)
-
- app.AddSvg('textHudStressRadial', `
-
-
-`)
-
- app.AddSvg('textHudStressRadial2', `
-
-
-`)
- app.AddSvg('textHudStressRadial3', `
-
-
-`)
- app.AddSvg('textHudStressIcon', `
-
-`)
-
-
- app.AddSvg('textHudParachuteIcon', `
-
-
-`)
- app.AddSvg('textHudParachuteIconText', `
-
-
-
-`)
- app.AddSvg('textHudNitroIconText', `
-
-
-
-`)
-
- app.AddSvg('textHudAltitudeIconText', `
-
-
-
-`)
- app.AddSvg('textHudAltitudeIcon', `
-
-
-`)
-
-
- app.AddSvg('textHudNitroIcon', `
-
-
-`)
- app.AddSvg('textHudStressIconText', `
-
-
-`)
-
- app.AddSvg('textHudOxyIconText', `
-
-
-
-`)
-
- app.AddSvg('muted-classic', `
-
-
-
-`)
-
- app.AddSvg('clock', `
-
-
-`)
- app.AddSvg('fuel', `
-
-`)
- app.AddSvg('indicator', `
-
-`)
-
-
- app.AddSvg('gps', `
-
-
-`)
- app.AddSvg('gps2', `
-
-`)
-
- app.AddSvg('belt-unactive', `
-
-
-`)
-
- app.AddSvg('belt-active', `
-
-
-`)
-
- app.AddSvg('lights-unactive', `
-
-
-`)
-
-
- app.AddSvg('lights-active', `
-
-
-`)
-
- app.AddSvg('door-active', `
-
-
-
-
-`)
- app.AddSvg('door-unactive', `
-
-
-
-
-`)
- app.AddSvg('engine-active', `
-
-
-
-`)
-
- app.AddSvg('engine-middamaged', `
-
-`)
-
- app.AddSvg('engine-damaged', `
-
-`)
-
- app.AddSvg('engine-unactive', `
-
-
-`)
-
- app.AddSvg('classichud-health', `
-
-
-`)
- app.AddSvg('classichud-armor', `
-
-`)
-
- app.AddSvg('classichud-thirsty', `
-
-`)
-
- app.AddSvg('classichud-hunger', `
-
-`)
-
- app.AddSvg('classichud-stress', `
-
-`)
-
- app.AddSvg('classichud-oxy', `
-
-
-
-`)
-
- app.AddSvg('classichud-stamina', `
-
-`)
-
- app.AddSvg('classichud-parachute', `
-
-`)
-
- app.AddSvg('classichud-nitro', `
-
-`)
-
- app.AddSvg('classichud-altitude', `
-
-`)
-
- app.AddSvg('classichud-mic', `
-
-`)
- app.AddSvg('classichud-mic-low', `
-
-`)
-
- app.AddSvg('classichud-mic-mid', `
-
-
-`)
-
- app.AddSvg('classichud-mic-high', `
-
-
-
-`)
-
- app.AddSvg('job-briefcase', `
-
-
-`)
-
-
-
-}
diff --git a/resources/[tools]/Codem-BlackHUDV2/html/script/vue.js b/resources/[tools]/Codem-BlackHUDV2/html/script/vue.js
deleted file mode 100644
index 4ada213ce..000000000
--- a/resources/[tools]/Codem-BlackHUDV2/html/script/vue.js
+++ /dev/null
@@ -1,11967 +0,0 @@
-/*!
- * Vue.js v2.6.12
- * (c) 2014-2020 Evan You
- * Released under the MIT License.
- */
-(function (global, factory) {
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
- typeof define === 'function' && define.amd ? define(factory) :
- (global = global || self, global.Vue = factory());
- }(this, function () { 'use strict';
-
- /* */
-
- var emptyObject = Object.freeze({});
-
- // These helpers produce better VM code in JS engines due to their
- // explicitness and function inlining.
- function isUndef (v) {
- return v === undefined || v === null
- }
-
- function isDef (v) {
- return v !== undefined && v !== null
- }
-
- function isTrue (v) {
- return v === true
- }
-
- function isFalse (v) {
- return v === false
- }
-
- /**
- * Check if value is primitive.
- */
- function isPrimitive (value) {
- return (
- typeof value === 'string' ||
- typeof value === 'number' ||
- // $flow-disable-line
- typeof value === 'symbol' ||
- typeof value === 'boolean'
- )
- }
-
- /**
- * Quick object check - this is primarily used to tell
- * Objects from primitive values when we know the value
- * is a JSON-compliant type.
- */
- function isObject (obj) {
- return obj !== null && typeof obj === 'object'
- }
-
- /**
- * Get the raw type string of a value, e.g., [object Object].
- */
- var _toString = Object.prototype.toString;
-
- function toRawType (value) {
- return _toString.call(value).slice(8, -1)
- }
-
- /**
- * Strict object type check. Only returns true
- * for plain JavaScript objects.
- */
- function isPlainObject (obj) {
- return _toString.call(obj) === '[object Object]'
- }
-
- function isRegExp (v) {
- return _toString.call(v) === '[object RegExp]'
- }
-
- /**
- * Check if val is a valid array index.
- */
- function isValidArrayIndex (val) {
- var n = parseFloat(String(val));
- return n >= 0 && Math.floor(n) === n && isFinite(val)
- }
-
- function isPromise (val) {
- return (
- isDef(val) &&
- typeof val.then === 'function' &&
- typeof val.catch === 'function'
- )
- }
-
- /**
- * Convert a value to a string that is actually rendered.
- */
- function toString (val) {
- return val == null
- ? ''
- : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
- ? JSON.stringify(val, null, 2)
- : String(val)
- }
-
- /**
- * Convert an input value to a number for persistence.
- * If the conversion fails, return original string.
- */
- function toNumber (val) {
- var n = parseFloat(val);
- return isNaN(n) ? val : n
- }
-
- /**
- * Make a map and return a function for checking if a key
- * is in that map.
- */
- function makeMap (
- str,
- expectsLowerCase
- ) {
- var map = Object.create(null);
- var list = str.split(',');
- for (var i = 0; i < list.length; i++) {
- map[list[i]] = true;
- }
- return expectsLowerCase
- ? function (val) { return map[val.toLowerCase()]; }
- : function (val) { return map[val]; }
- }
-
- /**
- * Check if a tag is a built-in tag.
- */
- var isBuiltInTag = makeMap('slot,component', true);
-
- /**
- * Check if an attribute is a reserved attribute.
- */
- var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
-
- /**
- * Remove an item from an array.
- */
- function remove (arr, item) {
- if (arr.length) {
- var index = arr.indexOf(item);
- if (index > -1) {
- return arr.splice(index, 1)
- }
- }
- }
-
- /**
- * Check whether an object has the property.
- */
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- function hasOwn (obj, key) {
- return hasOwnProperty.call(obj, key)
- }
-
- /**
- * Create a cached version of a pure function.
- */
- function cached (fn) {
- var cache = Object.create(null);
- return (function cachedFn (str) {
- var hit = cache[str];
- return hit || (cache[str] = fn(str))
- })
- }
-
- /**
- * Camelize a hyphen-delimited string.
- */
- var camelizeRE = /-(\w)/g;
- var camelize = cached(function (str) {
- return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
- });
-
- /**
- * Capitalize a string.
- */
- var capitalize = cached(function (str) {
- return str.charAt(0).toUpperCase() + str.slice(1)
- });
-
- /**
- * Hyphenate a camelCase string.
- */
- var hyphenateRE = /\B([A-Z])/g;
- var hyphenate = cached(function (str) {
- return str.replace(hyphenateRE, '-$1').toLowerCase()
- });
-
- /**
- * Simple bind polyfill for environments that do not support it,
- * e.g., PhantomJS 1.x. Technically, we don't need this anymore
- * since native bind is now performant enough in most browsers.
- * But removing it would mean breaking code that was able to run in
- * PhantomJS 1.x, so this must be kept for backward compatibility.
- */
-
- /* istanbul ignore next */
- function polyfillBind (fn, ctx) {
- function boundFn (a) {
- var l = arguments.length;
- return l
- ? l > 1
- ? fn.apply(ctx, arguments)
- : fn.call(ctx, a)
- : fn.call(ctx)
- }
-
- boundFn._length = fn.length;
- return boundFn
- }
-
- function nativeBind (fn, ctx) {
- return fn.bind(ctx)
- }
-
- var bind = Function.prototype.bind
- ? nativeBind
- : polyfillBind;
-
- /**
- * Convert an Array-like object to a real Array.
- */
- function toArray (list, start) {
- start = start || 0;
- var i = list.length - start;
- var ret = new Array(i);
- while (i--) {
- ret[i] = list[i + start];
- }
- return ret
- }
-
- /**
- * Mix properties into target object.
- */
- function extend (to, _from) {
- for (var key in _from) {
- to[key] = _from[key];
- }
- return to
- }
-
- /**
- * Merge an Array of Objects into a single Object.
- */
- function toObject (arr) {
- var res = {};
- for (var i = 0; i < arr.length; i++) {
- if (arr[i]) {
- extend(res, arr[i]);
- }
- }
- return res
- }
-
- /* eslint-disable no-unused-vars */
-
- /**
- * Perform no operation.
- * Stubbing args to make Flow happy without leaving useless transpiled code
- * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
- */
- function noop (a, b, c) {}
-
- /**
- * Always return false.
- */
- var no = function (a, b, c) { return false; };
-
- /* eslint-enable no-unused-vars */
-
- /**
- * Return the same value.
- */
- var identity = function (_) { return _; };
-
- /**
- * Generate a string containing static keys from compiler modules.
- */
- function genStaticKeys (modules) {
- return modules.reduce(function (keys, m) {
- return keys.concat(m.staticKeys || [])
- }, []).join(',')
- }
-
- /**
- * Check if two values are loosely equal - that is,
- * if they are plain objects, do they have the same shape?
- */
- function looseEqual (a, b) {
- if (a === b) { return true }
- var isObjectA = isObject(a);
- var isObjectB = isObject(b);
- if (isObjectA && isObjectB) {
- try {
- var isArrayA = Array.isArray(a);
- var isArrayB = Array.isArray(b);
- if (isArrayA && isArrayB) {
- return a.length === b.length && a.every(function (e, i) {
- return looseEqual(e, b[i])
- })
- } else if (a instanceof Date && b instanceof Date) {
- return a.getTime() === b.getTime()
- } else if (!isArrayA && !isArrayB) {
- var keysA = Object.keys(a);
- var keysB = Object.keys(b);
- return keysA.length === keysB.length && keysA.every(function (key) {
- return looseEqual(a[key], b[key])
- })
- } else {
- /* istanbul ignore next */
- return false
- }
- } catch (e) {
- /* istanbul ignore next */
- return false
- }
- } else if (!isObjectA && !isObjectB) {
- return String(a) === String(b)
- } else {
- return false
- }
- }
-
- /**
- * Return the first index at which a loosely equal value can be
- * found in the array (if value is a plain object, the array must
- * contain an object of the same shape), or -1 if it is not present.
- */
- function looseIndexOf (arr, val) {
- for (var i = 0; i < arr.length; i++) {
- if (looseEqual(arr[i], val)) { return i }
- }
- return -1
- }
-
- /**
- * Ensure a function is called only once.
- */
- function once (fn) {
- var called = false;
- return function () {
- if (!called) {
- called = true;
- fn.apply(this, arguments);
- }
- }
- }
-
- var SSR_ATTR = 'data-server-rendered';
-
- var ASSET_TYPES = [
- 'component',
- 'directive',
- 'filter'
- ];
-
- var LIFECYCLE_HOOKS = [
- 'beforeCreate',
- 'created',
- 'beforeMount',
- 'mounted',
- 'beforeUpdate',
- 'updated',
- 'beforeDestroy',
- 'destroyed',
- 'activated',
- 'deactivated',
- 'errorCaptured',
- 'serverPrefetch'
- ];
-
- /* */
-
-
-
- var config = ({
- /**
- * Option merge strategies (used in core/util/options)
- */
- // $flow-disable-line
- optionMergeStrategies: Object.create(null),
-
- /**
- * Whether to suppress warnings.
- */
- silent: false,
-
- /**
- * Show production mode tip message on boot?
- */
- productionTip: "development" !== 'production',
-
- /**
- * Whether to enable devtools
- */
- devtools: "development" !== 'production',
-
- /**
- * Whether to record perf
- */
- performance: false,
-
- /**
- * Error handler for watcher errors
- */
- errorHandler: null,
-
- /**
- * Warn handler for watcher warns
- */
- warnHandler: null,
-
- /**
- * Ignore certain custom elements
- */
- ignoredElements: [],
-
- /**
- * Custom user key aliases for v-on
- */
- // $flow-disable-line
- keyCodes: Object.create(null),
-
- /**
- * Check if a tag is reserved so that it cannot be registered as a
- * component. This is platform-dependent and may be overwritten.
- */
- isReservedTag: no,
-
- /**
- * Check if an attribute is reserved so that it cannot be used as a component
- * prop. This is platform-dependent and may be overwritten.
- */
- isReservedAttr: no,
-
- /**
- * Check if a tag is an unknown element.
- * Platform-dependent.
- */
- isUnknownElement: no,
-
- /**
- * Get the namespace of an element
- */
- getTagNamespace: noop,
-
- /**
- * Parse the real tag name for the specific platform.
- */
- parsePlatformTagName: identity,
-
- /**
- * Check if an attribute must be bound using property, e.g. value
- * Platform-dependent.
- */
- mustUseProp: no,
-
- /**
- * Perform updates asynchronously. Intended to be used by Vue Test Utils
- * This will significantly reduce performance if set to false.
- */
- async: true,
-
- /**
- * Exposed for legacy reasons
- */
- _lifecycleHooks: LIFECYCLE_HOOKS
- });
-
- /* */
-
- /**
- * unicode letters used for parsing html tags, component names and property paths.
- * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
- * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
- */
- var unicodeRegExp = /a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;
-
- /**
- * Check if a string starts with $ or _
- */
- function isReserved (str) {
- var c = (str + '').charCodeAt(0);
- return c === 0x24 || c === 0x5F
- }
-
- /**
- * Define a property.
- */
- function def (obj, key, val, enumerable) {
- Object.defineProperty(obj, key, {
- value: val,
- enumerable: !!enumerable,
- writable: true,
- configurable: true
- });
- }
-
- /**
- * Parse simple path.
- */
- var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
- function parsePath (path) {
- if (bailRE.test(path)) {
- return
- }
- var segments = path.split('.');
- return function (obj) {
- for (var i = 0; i < segments.length; i++) {
- if (!obj) { return }
- obj = obj[segments[i]];
- }
- return obj
- }
- }
-
- /* */
-
- // can we use __proto__?
- var hasProto = '__proto__' in {};
-
- // Browser environment sniffing
- var inBrowser = typeof window !== 'undefined';
- var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
- var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
- var UA = inBrowser && window.navigator.userAgent.toLowerCase();
- var isIE = UA && /msie|trident/.test(UA);
- var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
- var isEdge = UA && UA.indexOf('edge/') > 0;
- var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
- var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
- var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
- var isPhantomJS = UA && /phantomjs/.test(UA);
- var isFF = UA && UA.match(/firefox\/(\d+)/);
-
- // Firefox has a "watch" function on Object.prototype...
- var nativeWatch = ({}).watch;
-
- var supportsPassive = false;
- if (inBrowser) {
- try {
- var opts = {};
- Object.defineProperty(opts, 'passive', ({
- get: function get () {
- /* istanbul ignore next */
- supportsPassive = true;
- }
- })); // https://github.com/facebook/flow/issues/285
- window.addEventListener('test-passive', null, opts);
- } catch (e) {}
- }
-
- // this needs to be lazy-evaled because vue may be required before
- // vue-server-renderer can set VUE_ENV
- var _isServer;
- var isServerRendering = function () {
- if (_isServer === undefined) {
- /* istanbul ignore if */
- if (!inBrowser && !inWeex && typeof global !== 'undefined') {
- // detect presence of vue-server-renderer and avoid
- // Webpack shimming the process
- _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
- } else {
- _isServer = false;
- }
- }
- return _isServer
- };
-
- // detect devtools
- var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
-
- /* istanbul ignore next */
- function isNative (Ctor) {
- return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
- }
-
- var hasSymbol =
- typeof Symbol !== 'undefined' && isNative(Symbol) &&
- typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
-
- var _Set;
- /* istanbul ignore if */ // $flow-disable-line
- if (typeof Set !== 'undefined' && isNative(Set)) {
- // use native Set when available.
- _Set = Set;
- } else {
- // a non-standard Set polyfill that only works with primitive keys.
- _Set = /*@__PURE__*/(function () {
- function Set () {
- this.set = Object.create(null);
- }
- Set.prototype.has = function has (key) {
- return this.set[key] === true
- };
- Set.prototype.add = function add (key) {
- this.set[key] = true;
- };
- Set.prototype.clear = function clear () {
- this.set = Object.create(null);
- };
-
- return Set;
- }());
- }
-
- /* */
-
- var warn = noop;
- var tip = noop;
- var generateComponentTrace = (noop); // work around flow check
- var formatComponentName = (noop);
-
- {
- var hasConsole = typeof console !== 'undefined';
- var classifyRE = /(?:^|[-_])(\w)/g;
- var classify = function (str) { return str
- .replace(classifyRE, function (c) { return c.toUpperCase(); })
- .replace(/[-_]/g, ''); };
-
- warn = function (msg, vm) {
- var trace = vm ? generateComponentTrace(vm) : '';
-
- if (config.warnHandler) {
- config.warnHandler.call(null, msg, vm, trace);
- } else if (hasConsole && (!config.silent)) {
- console.error(("[Vue warn]: " + msg + trace));
- }
- };
-
- tip = function (msg, vm) {
- if (hasConsole && (!config.silent)) {
- console.warn("[Vue tip]: " + msg + (
- vm ? generateComponentTrace(vm) : ''
- ));
- }
- };
-
- formatComponentName = function (vm, includeFile) {
- if (vm.$root === vm) {
- return ''
- }
- var options = typeof vm === 'function' && vm.cid != null
- ? vm.options
- : vm._isVue
- ? vm.$options || vm.constructor.options
- : vm;
- var name = options.name || options._componentTag;
- var file = options.__file;
- if (!name && file) {
- var match = file.match(/([^/\\]+)\.vue$/);
- name = match && match[1];
- }
-
- return (
- (name ? ("<" + (classify(name)) + ">") : "") +
- (file && includeFile !== false ? (" at " + file) : '')
- )
- };
-
- var repeat = function (str, n) {
- var res = '';
- while (n) {
- if (n % 2 === 1) { res += str; }
- if (n > 1) { str += str; }
- n >>= 1;
- }
- return res
- };
-
- generateComponentTrace = function (vm) {
- if (vm._isVue && vm.$parent) {
- var tree = [];
- var currentRecursiveSequence = 0;
- while (vm) {
- if (tree.length > 0) {
- var last = tree[tree.length - 1];
- if (last.constructor === vm.constructor) {
- currentRecursiveSequence++;
- vm = vm.$parent;
- continue
- } else if (currentRecursiveSequence > 0) {
- tree[tree.length - 1] = [last, currentRecursiveSequence];
- currentRecursiveSequence = 0;
- }
- }
- tree.push(vm);
- vm = vm.$parent;
- }
- return '\n\nfound in\n\n' + tree
- .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
- ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
- : formatComponentName(vm))); })
- .join('\n')
- } else {
- return ("\n\n(found in " + (formatComponentName(vm)) + ")")
- }
- };
- }
-
- /* */
-
- var uid = 0;
-
- /**
- * A dep is an observable that can have multiple
- * directives subscribing to it.
- */
- var Dep = function Dep () {
- this.id = uid++;
- this.subs = [];
- };
-
- Dep.prototype.addSub = function addSub (sub) {
- this.subs.push(sub);
- };
-
- Dep.prototype.removeSub = function removeSub (sub) {
- remove(this.subs, sub);
- };
-
- Dep.prototype.depend = function depend () {
- if (Dep.target) {
- Dep.target.addDep(this);
- }
- };
-
- Dep.prototype.notify = function notify () {
- // stabilize the subscriber list first
- var subs = this.subs.slice();
- if (!config.async) {
- // subs aren't sorted in scheduler if not running async
- // we need to sort them now to make sure they fire in correct
- // order
- subs.sort(function (a, b) { return a.id - b.id; });
- }
- for (var i = 0, l = subs.length; i < l; i++) {
- subs[i].update();
- }
- };
-
- // The current target watcher being evaluated.
- // This is globally unique because only one watcher
- // can be evaluated at a time.
- Dep.target = null;
- var targetStack = [];
-
- function pushTarget (target) {
- targetStack.push(target);
- Dep.target = target;
- }
-
- function popTarget () {
- targetStack.pop();
- Dep.target = targetStack[targetStack.length - 1];
- }
-
- /* */
-
- var VNode = function VNode (
- tag,
- data,
- children,
- text,
- elm,
- context,
- componentOptions,
- asyncFactory
- ) {
- this.tag = tag;
- this.data = data;
- this.children = children;
- this.text = text;
- this.elm = elm;
- this.ns = undefined;
- this.context = context;
- this.fnContext = undefined;
- this.fnOptions = undefined;
- this.fnScopeId = undefined;
- this.key = data && data.key;
- this.componentOptions = componentOptions;
- this.componentInstance = undefined;
- this.parent = undefined;
- this.raw = false;
- this.isStatic = false;
- this.isRootInsert = true;
- this.isComment = false;
- this.isCloned = false;
- this.isOnce = false;
- this.asyncFactory = asyncFactory;
- this.asyncMeta = undefined;
- this.isAsyncPlaceholder = false;
- };
-
- var prototypeAccessors = { child: { configurable: true } };
-
- // DEPRECATED: alias for componentInstance for backwards compat.
- /* istanbul ignore next */
- prototypeAccessors.child.get = function () {
- return this.componentInstance
- };
-
- Object.defineProperties( VNode.prototype, prototypeAccessors );
-
- var createEmptyVNode = function (text) {
- if ( text === void 0 ) text = '';
-
- var node = new VNode();
- node.text = text;
- node.isComment = true;
- return node
- };
-
- function createTextVNode (val) {
- return new VNode(undefined, undefined, undefined, String(val))
- }
-
- // optimized shallow clone
- // used for static nodes and slot nodes because they may be reused across
- // multiple renders, cloning them avoids errors when DOM manipulations rely
- // on their elm reference.
- function cloneVNode (vnode) {
- var cloned = new VNode(
- vnode.tag,
- vnode.data,
- // #7975
- // clone children array to avoid mutating original in case of cloning
- // a child.
- vnode.children && vnode.children.slice(),
- vnode.text,
- vnode.elm,
- vnode.context,
- vnode.componentOptions,
- vnode.asyncFactory
- );
- cloned.ns = vnode.ns;
- cloned.isStatic = vnode.isStatic;
- cloned.key = vnode.key;
- cloned.isComment = vnode.isComment;
- cloned.fnContext = vnode.fnContext;
- cloned.fnOptions = vnode.fnOptions;
- cloned.fnScopeId = vnode.fnScopeId;
- cloned.asyncMeta = vnode.asyncMeta;
- cloned.isCloned = true;
- return cloned
- }
-
- /*
- * not type checking this file because flow doesn't play well with
- * dynamically accessing methods on Array prototype
- */
-
- var arrayProto = Array.prototype;
- var arrayMethods = Object.create(arrayProto);
-
- var methodsToPatch = [
- 'push',
- 'pop',
- 'shift',
- 'unshift',
- 'splice',
- 'sort',
- 'reverse'
- ];
-
- /**
- * Intercept mutating methods and emit events
- */
- methodsToPatch.forEach(function (method) {
- // cache original method
- var original = arrayProto[method];
- def(arrayMethods, method, function mutator () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- var result = original.apply(this, args);
- var ob = this.__ob__;
- var inserted;
- switch (method) {
- case 'push':
- case 'unshift':
- inserted = args;
- break
- case 'splice':
- inserted = args.slice(2);
- break
- }
- if (inserted) { ob.observeArray(inserted); }
- // notify change
- ob.dep.notify();
- return result
- });
- });
-
- /* */
-
- var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
-
- /**
- * In some cases we may want to disable observation inside a component's
- * update computation.
- */
- var shouldObserve = true;
-
- function toggleObserving (value) {
- shouldObserve = value;
- }
-
- /**
- * Observer class that is attached to each observed
- * object. Once attached, the observer converts the target
- * object's property keys into getter/setters that
- * collect dependencies and dispatch updates.
- */
- var Observer = function Observer (value) {
- this.value = value;
- this.dep = new Dep();
- this.vmCount = 0;
- def(value, '__ob__', this);
- if (Array.isArray(value)) {
- if (hasProto) {
- protoAugment(value, arrayMethods);
- } else {
- copyAugment(value, arrayMethods, arrayKeys);
- }
- this.observeArray(value);
- } else {
- this.walk(value);
- }
- };
-
- /**
- * Walk through all properties and convert them into
- * getter/setters. This method should only be called when
- * value type is Object.
- */
- Observer.prototype.walk = function walk (obj) {
- var keys = Object.keys(obj);
- for (var i = 0; i < keys.length; i++) {
- defineReactive$$1(obj, keys[i]);
- }
- };
-
- /**
- * Observe a list of Array items.
- */
- Observer.prototype.observeArray = function observeArray (items) {
- for (var i = 0, l = items.length; i < l; i++) {
- observe(items[i]);
- }
- };
-
- // helpers
-
- /**
- * Augment a target Object or Array by intercepting
- * the prototype chain using __proto__
- */
- function protoAugment (target, src) {
- /* eslint-disable no-proto */
- target.__proto__ = src;
- /* eslint-enable no-proto */
- }
-
- /**
- * Augment a target Object or Array by defining
- * hidden properties.
- */
- /* istanbul ignore next */
- function copyAugment (target, src, keys) {
- for (var i = 0, l = keys.length; i < l; i++) {
- var key = keys[i];
- def(target, key, src[key]);
- }
- }
-
- /**
- * Attempt to create an observer instance for a value,
- * returns the new observer if successfully observed,
- * or the existing observer if the value already has one.
- */
- function observe (value, asRootData) {
- if (!isObject(value) || value instanceof VNode) {
- return
- }
- var ob;
- if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
- ob = value.__ob__;
- } else if (
- shouldObserve &&
- !isServerRendering() &&
- (Array.isArray(value) || isPlainObject(value)) &&
- Object.isExtensible(value) &&
- !value._isVue
- ) {
- ob = new Observer(value);
- }
- if (asRootData && ob) {
- ob.vmCount++;
- }
- return ob
- }
-
- /**
- * Define a reactive property on an Object.
- */
- function defineReactive$$1 (
- obj,
- key,
- val,
- customSetter,
- shallow
- ) {
- var dep = new Dep();
-
- var property = Object.getOwnPropertyDescriptor(obj, key);
- if (property && property.configurable === false) {
- return
- }
-
- // cater for pre-defined getter/setters
- var getter = property && property.get;
- var setter = property && property.set;
- if ((!getter || setter) && arguments.length === 2) {
- val = obj[key];
- }
-
- var childOb = !shallow && observe(val);
- Object.defineProperty(obj, key, {
- enumerable: true,
- configurable: true,
- get: function reactiveGetter () {
- var value = getter ? getter.call(obj) : val;
- if (Dep.target) {
- dep.depend();
- if (childOb) {
- childOb.dep.depend();
- if (Array.isArray(value)) {
- dependArray(value);
- }
- }
- }
- return value
- },
- set: function reactiveSetter (newVal) {
- var value = getter ? getter.call(obj) : val;
- /* eslint-disable no-self-compare */
- if (newVal === value || (newVal !== newVal && value !== value)) {
- return
- }
- /* eslint-enable no-self-compare */
- if (customSetter) {
- customSetter();
- }
- // #7981: for accessor properties without setter
- if (getter && !setter) { return }
- if (setter) {
- setter.call(obj, newVal);
- } else {
- val = newVal;
- }
- childOb = !shallow && observe(newVal);
- dep.notify();
- }
- });
- }
-
- /**
- * Set a property on an object. Adds the new property and
- * triggers change notification if the property doesn't
- * already exist.
- */
- function set (target, key, val) {
- if (isUndef(target) || isPrimitive(target)
- ) {
- warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
- }
- if (Array.isArray(target) && isValidArrayIndex(key)) {
- target.length = Math.max(target.length, key);
- target.splice(key, 1, val);
- return val
- }
- if (key in target && !(key in Object.prototype)) {
- target[key] = val;
- return val
- }
- var ob = (target).__ob__;
- if (target._isVue || (ob && ob.vmCount)) {
- warn(
- 'Avoid adding reactive properties to a Vue instance or its root $data ' +
- 'at runtime - declare it upfront in the data option.'
- );
- return val
- }
- if (!ob) {
- target[key] = val;
- return val
- }
- defineReactive$$1(ob.value, key, val);
- ob.dep.notify();
- return val
- }
-
- /**
- * Delete a property and trigger change if necessary.
- */
- function del (target, key) {
- if (isUndef(target) || isPrimitive(target)
- ) {
- warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
- }
- if (Array.isArray(target) && isValidArrayIndex(key)) {
- target.splice(key, 1);
- return
- }
- var ob = (target).__ob__;
- if (target._isVue || (ob && ob.vmCount)) {
- warn(
- 'Avoid deleting properties on a Vue instance or its root $data ' +
- '- just set it to null.'
- );
- return
- }
- if (!hasOwn(target, key)) {
- return
- }
- delete target[key];
- if (!ob) {
- return
- }
- ob.dep.notify();
- }
-
- /**
- * Collect dependencies on array elements when the array is touched, since
- * we cannot intercept array element access like property getters.
- */
- function dependArray (value) {
- for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
- e = value[i];
- e && e.__ob__ && e.__ob__.dep.depend();
- if (Array.isArray(e)) {
- dependArray(e);
- }
- }
- }
-
- /* */
-
- /**
- * Option overwriting strategies are functions that handle
- * how to merge a parent option value and a child option
- * value into the final value.
- */
- var strats = config.optionMergeStrategies;
-
- /**
- * Options with restrictions
- */
- {
- strats.el = strats.propsData = function (parent, child, vm, key) {
- if (!vm) {
- warn(
- "option \"" + key + "\" can only be used during instance " +
- 'creation with the `new` keyword.'
- );
- }
- return defaultStrat(parent, child)
- };
- }
-
- /**
- * Helper that recursively merges two data objects together.
- */
- function mergeData (to, from) {
- if (!from) { return to }
- var key, toVal, fromVal;
-
- var keys = hasSymbol
- ? Reflect.ownKeys(from)
- : Object.keys(from);
-
- for (var i = 0; i < keys.length; i++) {
- key = keys[i];
- // in case the object is already observed...
- if (key === '__ob__') { continue }
- toVal = to[key];
- fromVal = from[key];
- if (!hasOwn(to, key)) {
- set(to, key, fromVal);
- } else if (
- toVal !== fromVal &&
- isPlainObject(toVal) &&
- isPlainObject(fromVal)
- ) {
- mergeData(toVal, fromVal);
- }
- }
- return to
- }
-
- /**
- * Data
- */
- function mergeDataOrFn (
- parentVal,
- childVal,
- vm
- ) {
- if (!vm) {
- // in a Vue.extend merge, both should be functions
- if (!childVal) {
- return parentVal
- }
- if (!parentVal) {
- return childVal
- }
- // when parentVal & childVal are both present,
- // we need to return a function that returns the
- // merged result of both functions... no need to
- // check if parentVal is a function here because
- // it has to be a function to pass previous merges.
- return function mergedDataFn () {
- return mergeData(
- typeof childVal === 'function' ? childVal.call(this, this) : childVal,
- typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
- )
- }
- } else {
- return function mergedInstanceDataFn () {
- // instance merge
- var instanceData = typeof childVal === 'function'
- ? childVal.call(vm, vm)
- : childVal;
- var defaultData = typeof parentVal === 'function'
- ? parentVal.call(vm, vm)
- : parentVal;
- if (instanceData) {
- return mergeData(instanceData, defaultData)
- } else {
- return defaultData
- }
- }
- }
- }
-
- strats.data = function (
- parentVal,
- childVal,
- vm
- ) {
- if (!vm) {
- if (childVal && typeof childVal !== 'function') {
- warn(
- 'The "data" option should be a function ' +
- 'that returns a per-instance value in component ' +
- 'definitions.',
- vm
- );
-
- return parentVal
- }
- return mergeDataOrFn(parentVal, childVal)
- }
-
- return mergeDataOrFn(parentVal, childVal, vm)
- };
-
- /**
- * Hooks and props are merged as arrays.
- */
- function mergeHook (
- parentVal,
- childVal
- ) {
- var res = childVal
- ? parentVal
- ? parentVal.concat(childVal)
- : Array.isArray(childVal)
- ? childVal
- : [childVal]
- : parentVal;
- return res
- ? dedupeHooks(res)
- : res
- }
-
- function dedupeHooks (hooks) {
- var res = [];
- for (var i = 0; i < hooks.length; i++) {
- if (res.indexOf(hooks[i]) === -1) {
- res.push(hooks[i]);
- }
- }
- return res
- }
-
- LIFECYCLE_HOOKS.forEach(function (hook) {
- strats[hook] = mergeHook;
- });
-
- /**
- * Assets
- *
- * When a vm is present (instance creation), we need to do
- * a three-way merge between constructor options, instance
- * options and parent options.
- */
- function mergeAssets (
- parentVal,
- childVal,
- vm,
- key
- ) {
- var res = Object.create(parentVal || null);
- if (childVal) {
- assertObjectType(key, childVal, vm);
- return extend(res, childVal)
- } else {
- return res
- }
- }
-
- ASSET_TYPES.forEach(function (type) {
- strats[type + 's'] = mergeAssets;
- });
-
- /**
- * Watchers.
- *
- * Watchers hashes should not overwrite one
- * another, so we merge them as arrays.
- */
- strats.watch = function (
- parentVal,
- childVal,
- vm,
- key
- ) {
- // work around Firefox's Object.prototype.watch...
- if (parentVal === nativeWatch) { parentVal = undefined; }
- if (childVal === nativeWatch) { childVal = undefined; }
- /* istanbul ignore if */
- if (!childVal) { return Object.create(parentVal || null) }
- {
- assertObjectType(key, childVal, vm);
- }
- if (!parentVal) { return childVal }
- var ret = {};
- extend(ret, parentVal);
- for (var key$1 in childVal) {
- var parent = ret[key$1];
- var child = childVal[key$1];
- if (parent && !Array.isArray(parent)) {
- parent = [parent];
- }
- ret[key$1] = parent
- ? parent.concat(child)
- : Array.isArray(child) ? child : [child];
- }
- return ret
- };
-
- /**
- * Other object hashes.
- */
- strats.props =
- strats.methods =
- strats.inject =
- strats.computed = function (
- parentVal,
- childVal,
- vm,
- key
- ) {
- if (childVal && "development" !== 'production') {
- assertObjectType(key, childVal, vm);
- }
- if (!parentVal) { return childVal }
- var ret = Object.create(null);
- extend(ret, parentVal);
- if (childVal) { extend(ret, childVal); }
- return ret
- };
- strats.provide = mergeDataOrFn;
-
- /**
- * Default strategy.
- */
- var defaultStrat = function (parentVal, childVal) {
- return childVal === undefined
- ? parentVal
- : childVal
- };
-
- /**
- * Validate component names
- */
- function checkComponents (options) {
- for (var key in options.components) {
- validateComponentName(key);
- }
- }
-
- function validateComponentName (name) {
- if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
- warn(
- 'Invalid component name: "' + name + '". Component names ' +
- 'should conform to valid custom element name in html5 specification.'
- );
- }
- if (isBuiltInTag(name) || config.isReservedTag(name)) {
- warn(
- 'Do not use built-in or reserved HTML elements as component ' +
- 'id: ' + name
- );
- }
- }
-
- /**
- * Ensure all props option syntax are normalized into the
- * Object-based format.
- */
- function normalizeProps (options, vm) {
- var props = options.props;
- if (!props) { return }
- var res = {};
- var i, val, name;
- if (Array.isArray(props)) {
- i = props.length;
- while (i--) {
- val = props[i];
- if (typeof val === 'string') {
- name = camelize(val);
- res[name] = { type: null };
- } else {
- warn('props must be strings when using array syntax.');
- }
- }
- } else if (isPlainObject(props)) {
- for (var key in props) {
- val = props[key];
- name = camelize(key);
- res[name] = isPlainObject(val)
- ? val
- : { type: val };
- }
- } else {
- warn(
- "Invalid value for option \"props\": expected an Array or an Object, " +
- "but got " + (toRawType(props)) + ".",
- vm
- );
- }
- options.props = res;
- }
-
- /**
- * Normalize all injections into Object-based format
- */
- function normalizeInject (options, vm) {
- var inject = options.inject;
- if (!inject) { return }
- var normalized = options.inject = {};
- if (Array.isArray(inject)) {
- for (var i = 0; i < inject.length; i++) {
- normalized[inject[i]] = { from: inject[i] };
- }
- } else if (isPlainObject(inject)) {
- for (var key in inject) {
- var val = inject[key];
- normalized[key] = isPlainObject(val)
- ? extend({ from: key }, val)
- : { from: val };
- }
- } else {
- warn(
- "Invalid value for option \"inject\": expected an Array or an Object, " +
- "but got " + (toRawType(inject)) + ".",
- vm
- );
- }
- }
-
- /**
- * Normalize raw function directives into object format.
- */
- function normalizeDirectives (options) {
- var dirs = options.directives;
- if (dirs) {
- for (var key in dirs) {
- var def$$1 = dirs[key];
- if (typeof def$$1 === 'function') {
- dirs[key] = { bind: def$$1, update: def$$1 };
- }
- }
- }
- }
-
- function assertObjectType (name, value, vm) {
- if (!isPlainObject(value)) {
- warn(
- "Invalid value for option \"" + name + "\": expected an Object, " +
- "but got " + (toRawType(value)) + ".",
- vm
- );
- }
- }
-
- /**
- * Merge two option objects into a new one.
- * Core utility used in both instantiation and inheritance.
- */
- function mergeOptions (
- parent,
- child,
- vm
- ) {
- {
- checkComponents(child);
- }
-
- if (typeof child === 'function') {
- child = child.options;
- }
-
- normalizeProps(child, vm);
- normalizeInject(child, vm);
- normalizeDirectives(child);
-
- // Apply extends and mixins on the child options,
- // but only if it is a raw options object that isn't
- // the result of another mergeOptions call.
- // Only merged options has the _base property.
- if (!child._base) {
- if (child.extends) {
- parent = mergeOptions(parent, child.extends, vm);
- }
- if (child.mixins) {
- for (var i = 0, l = child.mixins.length; i < l; i++) {
- parent = mergeOptions(parent, child.mixins[i], vm);
- }
- }
- }
-
- var options = {};
- var key;
- for (key in parent) {
- mergeField(key);
- }
- for (key in child) {
- if (!hasOwn(parent, key)) {
- mergeField(key);
- }
- }
- function mergeField (key) {
- var strat = strats[key] || defaultStrat;
- options[key] = strat(parent[key], child[key], vm, key);
- }
- return options
- }
-
- /**
- * Resolve an asset.
- * This function is used because child instances need access
- * to assets defined in its ancestor chain.
- */
- function resolveAsset (
- options,
- type,
- id,
- warnMissing
- ) {
- /* istanbul ignore if */
- if (typeof id !== 'string') {
- return
- }
- var assets = options[type];
- // check local registration variations first
- if (hasOwn(assets, id)) { return assets[id] }
- var camelizedId = camelize(id);
- if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
- var PascalCaseId = capitalize(camelizedId);
- if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
- // fallback to prototype chain
- var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
- if (warnMissing && !res) {
- warn(
- 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
- options
- );
- }
- return res
- }
-
- /* */
-
-
-
- function validateProp (
- key,
- propOptions,
- propsData,
- vm
- ) {
- var prop = propOptions[key];
- var absent = !hasOwn(propsData, key);
- var value = propsData[key];
- // boolean casting
- var booleanIndex = getTypeIndex(Boolean, prop.type);
- if (booleanIndex > -1) {
- if (absent && !hasOwn(prop, 'default')) {
- value = false;
- } else if (value === '' || value === hyphenate(key)) {
- // only cast empty string / same name to boolean if
- // boolean has higher priority
- var stringIndex = getTypeIndex(String, prop.type);
- if (stringIndex < 0 || booleanIndex < stringIndex) {
- value = true;
- }
- }
- }
- // check default value
- if (value === undefined) {
- value = getPropDefaultValue(vm, prop, key);
- // since the default value is a fresh copy,
- // make sure to observe it.
- var prevShouldObserve = shouldObserve;
- toggleObserving(true);
- observe(value);
- toggleObserving(prevShouldObserve);
- }
- {
- assertProp(prop, key, value, vm, absent);
- }
- return value
- }
-
- /**
- * Get the default value of a prop.
- */
- function getPropDefaultValue (vm, prop, key) {
- // no default, return undefined
- if (!hasOwn(prop, 'default')) {
- return undefined
- }
- var def = prop.default;
- // warn against non-factory defaults for Object & Array
- if (isObject(def)) {
- warn(
- 'Invalid default value for prop "' + key + '": ' +
- 'Props with type Object/Array must use a factory function ' +
- 'to return the default value.',
- vm
- );
- }
- // the raw prop value was also undefined from previous render,
- // return previous default value to avoid unnecessary watcher trigger
- if (vm && vm.$options.propsData &&
- vm.$options.propsData[key] === undefined &&
- vm._props[key] !== undefined
- ) {
- return vm._props[key]
- }
- // call factory function for non-Function types
- // a value is Function if its prototype is function even across different execution context
- return typeof def === 'function' && getType(prop.type) !== 'Function'
- ? def.call(vm)
- : def
- }
-
- /**
- * Assert whether a prop is valid.
- */
- function assertProp (
- prop,
- name,
- value,
- vm,
- absent
- ) {
- if (prop.required && absent) {
- warn(
- 'Missing required prop: "' + name + '"',
- vm
- );
- return
- }
- if (value == null && !prop.required) {
- return
- }
- var type = prop.type;
- var valid = !type || type === true;
- var expectedTypes = [];
- if (type) {
- if (!Array.isArray(type)) {
- type = [type];
- }
- for (var i = 0; i < type.length && !valid; i++) {
- var assertedType = assertType(value, type[i]);
- expectedTypes.push(assertedType.expectedType || '');
- valid = assertedType.valid;
- }
- }
-
- if (!valid) {
- warn(
- getInvalidTypeMessage(name, value, expectedTypes),
- vm
- );
- return
- }
- var validator = prop.validator;
- if (validator) {
- if (!validator(value)) {
- warn(
- 'Invalid prop: custom validator check failed for prop "' + name + '".',
- vm
- );
- }
- }
- }
-
- var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
-
- function assertType (value, type) {
- var valid;
- var expectedType = getType(type);
- if (simpleCheckRE.test(expectedType)) {
- var t = typeof value;
- valid = t === expectedType.toLowerCase();
- // for primitive wrapper objects
- if (!valid && t === 'object') {
- valid = value instanceof type;
- }
- } else if (expectedType === 'Object') {
- valid = isPlainObject(value);
- } else if (expectedType === 'Array') {
- valid = Array.isArray(value);
- } else {
- valid = value instanceof type;
- }
- return {
- valid: valid,
- expectedType: expectedType
- }
- }
-
- /**
- * Use function string name to check built-in types,
- * because a simple equality check will fail when running
- * across different vms / iframes.
- */
- function getType (fn) {
- var match = fn && fn.toString().match(/^\s*function (\w+)/);
- return match ? match[1] : ''
- }
-
- function isSameType (a, b) {
- return getType(a) === getType(b)
- }
-
- function getTypeIndex (type, expectedTypes) {
- if (!Array.isArray(expectedTypes)) {
- return isSameType(expectedTypes, type) ? 0 : -1
- }
- for (var i = 0, len = expectedTypes.length; i < len; i++) {
- if (isSameType(expectedTypes[i], type)) {
- return i
- }
- }
- return -1
- }
-
- function getInvalidTypeMessage (name, value, expectedTypes) {
- var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
- " Expected " + (expectedTypes.map(capitalize).join(', '));
- var expectedType = expectedTypes[0];
- var receivedType = toRawType(value);
- var expectedValue = styleValue(value, expectedType);
- var receivedValue = styleValue(value, receivedType);
- // check if we need to specify expected value
- if (expectedTypes.length === 1 &&
- isExplicable(expectedType) &&
- !isBoolean(expectedType, receivedType)) {
- message += " with value " + expectedValue;
- }
- message += ", got " + receivedType + " ";
- // check if we need to specify received value
- if (isExplicable(receivedType)) {
- message += "with value " + receivedValue + ".";
- }
- return message
- }
-
- function styleValue (value, type) {
- if (type === 'String') {
- return ("\"" + value + "\"")
- } else if (type === 'Number') {
- return ("" + (Number(value)))
- } else {
- return ("" + value)
- }
- }
-
- function isExplicable (value) {
- var explicitTypes = ['string', 'number', 'boolean'];
- return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
- }
-
- function isBoolean () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
- }
-
- /* */
-
- function handleError (err, vm, info) {
- // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
- // See: https://github.com/vuejs/vuex/issues/1505
- pushTarget();
- try {
- if (vm) {
- var cur = vm;
- while ((cur = cur.$parent)) {
- var hooks = cur.$options.errorCaptured;
- if (hooks) {
- for (var i = 0; i < hooks.length; i++) {
- try {
- var capture = hooks[i].call(cur, err, vm, info) === false;
- if (capture) { return }
- } catch (e) {
- globalHandleError(e, cur, 'errorCaptured hook');
- }
- }
- }
- }
- }
- globalHandleError(err, vm, info);
- } finally {
- popTarget();
- }
- }
-
- function invokeWithErrorHandling (
- handler,
- context,
- args,
- vm,
- info
- ) {
- var res;
- try {
- res = args ? handler.apply(context, args) : handler.call(context);
- if (res && !res._isVue && isPromise(res) && !res._handled) {
- res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
- // issue #9511
- // avoid catch triggering multiple times when nested calls
- res._handled = true;
- }
- } catch (e) {
- handleError(e, vm, info);
- }
- return res
- }
-
- function globalHandleError (err, vm, info) {
- if (config.errorHandler) {
- try {
- return config.errorHandler.call(null, err, vm, info)
- } catch (e) {
- // if the user intentionally throws the original error in the handler,
- // do not log it twice
- if (e !== err) {
- logError(e, null, 'config.errorHandler');
- }
- }
- }
- logError(err, vm, info);
- }
-
- function logError (err, vm, info) {
- {
- warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
- }
- /* istanbul ignore else */
- if ((inBrowser || inWeex) && typeof console !== 'undefined') {
- console.error(err);
- } else {
- throw err
- }
- }
-
- /* */
-
- var isUsingMicroTask = false;
-
- var callbacks = [];
- var pending = false;
-
- function flushCallbacks () {
- pending = false;
- var copies = callbacks.slice(0);
- callbacks.length = 0;
- for (var i = 0; i < copies.length; i++) {
- copies[i]();
- }
- }
-
- // Here we have async deferring wrappers using microtasks.
- // In 2.5 we used (macro) tasks (in combination with microtasks).
- // However, it has subtle problems when state is changed right before repaint
- // (e.g. #6813, out-in transitions).
- // Also, using (macro) tasks in event handler would cause some weird behaviors
- // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
- // So we now use microtasks everywhere, again.
- // A major drawback of this tradeoff is that there are some scenarios
- // where microtasks have too high a priority and fire in between supposedly
- // sequential events (e.g. #4521, #6690, which have workarounds)
- // or even between bubbling of the same event (#6566).
- var timerFunc;
-
- // The nextTick behavior leverages the microtask queue, which can be accessed
- // via either native Promise.then or MutationObserver.
- // MutationObserver has wider support, however it is seriously bugged in
- // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
- // completely stops working after triggering a few times... so, if native
- // Promise is available, we will use it:
- /* istanbul ignore next, $flow-disable-line */
- if (typeof Promise !== 'undefined' && isNative(Promise)) {
- var p = Promise.resolve();
- timerFunc = function () {
- p.then(flushCallbacks);
- // In problematic UIWebViews, Promise.then doesn't completely break, but
- // it can get stuck in a weird state where callbacks are pushed into the
- // microtask queue but the queue isn't being flushed, until the browser
- // needs to do some other work, e.g. handle a timer. Therefore we can
- // "force" the microtask queue to be flushed by adding an empty timer.
- if (isIOS) { setTimeout(noop); }
- };
- isUsingMicroTask = true;
- } else if (!isIE && typeof MutationObserver !== 'undefined' && (
- isNative(MutationObserver) ||
- // PhantomJS and iOS 7.x
- MutationObserver.toString() === '[object MutationObserverConstructor]'
- )) {
- // Use MutationObserver where native Promise is not available,
- // e.g. PhantomJS, iOS7, Android 4.4
- // (#6466 MutationObserver is unreliable in IE11)
- var counter = 1;
- var observer = new MutationObserver(flushCallbacks);
- var textNode = document.createTextNode(String(counter));
- observer.observe(textNode, {
- characterData: true
- });
- timerFunc = function () {
- counter = (counter + 1) % 2;
- textNode.data = String(counter);
- };
- isUsingMicroTask = true;
- } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
- // Fallback to setImmediate.
- // Technically it leverages the (macro) task queue,
- // but it is still a better choice than setTimeout.
- timerFunc = function () {
- setImmediate(flushCallbacks);
- };
- } else {
- // Fallback to setTimeout.
- timerFunc = function () {
- setTimeout(flushCallbacks, 0);
- };
- }
-
- function nextTick (cb, ctx) {
- var _resolve;
- callbacks.push(function () {
- if (cb) {
- try {
- cb.call(ctx);
- } catch (e) {
- handleError(e, ctx, 'nextTick');
- }
- } else if (_resolve) {
- _resolve(ctx);
- }
- });
- if (!pending) {
- pending = true;
- timerFunc();
- }
- // $flow-disable-line
- if (!cb && typeof Promise !== 'undefined') {
- return new Promise(function (resolve) {
- _resolve = resolve;
- })
- }
- }
-
- /* */
-
- var mark;
- var measure;
-
- {
- var perf = inBrowser && window.performance;
- /* istanbul ignore if */
- if (
- perf &&
- perf.mark &&
- perf.measure &&
- perf.clearMarks &&
- perf.clearMeasures
- ) {
- mark = function (tag) { return perf.mark(tag); };
- measure = function (name, startTag, endTag) {
- perf.measure(name, startTag, endTag);
- perf.clearMarks(startTag);
- perf.clearMarks(endTag);
- // perf.clearMeasures(name)
- };
- }
- }
-
- /* not type checking this file because flow doesn't play well with Proxy */
-
- var initProxy;
-
- {
- var allowedGlobals = makeMap(
- 'Infinity,undefined,NaN,isFinite,isNaN,' +
- 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
- 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
- 'require' // for Webpack/Browserify
- );
-
- var warnNonPresent = function (target, key) {
- warn(
- "Property or method \"" + key + "\" is not defined on the instance but " +
- 'referenced during render. Make sure that this property is reactive, ' +
- 'either in the data option, or for class-based components, by ' +
- 'initializing the property. ' +
- 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
- target
- );
- };
-
- var warnReservedPrefix = function (target, key) {
- warn(
- "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
- 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
- 'prevent conflicts with Vue internals. ' +
- 'See: https://vuejs.org/v2/api/#data',
- target
- );
- };
-
- var hasProxy =
- typeof Proxy !== 'undefined' && isNative(Proxy);
-
- if (hasProxy) {
- var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
- config.keyCodes = new Proxy(config.keyCodes, {
- set: function set (target, key, value) {
- if (isBuiltInModifier(key)) {
- warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
- return false
- } else {
- target[key] = value;
- return true
- }
- }
- });
- }
-
- var hasHandler = {
- has: function has (target, key) {
- var has = key in target;
- var isAllowed = allowedGlobals(key) ||
- (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
- if (!has && !isAllowed) {
- if (key in target.$data) { warnReservedPrefix(target, key); }
- else { warnNonPresent(target, key); }
- }
- return has || !isAllowed
- }
- };
-
- var getHandler = {
- get: function get (target, key) {
- if (typeof key === 'string' && !(key in target)) {
- if (key in target.$data) { warnReservedPrefix(target, key); }
- else { warnNonPresent(target, key); }
- }
- return target[key]
- }
- };
-
- initProxy = function initProxy (vm) {
- if (hasProxy) {
- // determine which proxy handler to use
- var options = vm.$options;
- var handlers = options.render && options.render._withStripped
- ? getHandler
- : hasHandler;
- vm._renderProxy = new Proxy(vm, handlers);
- } else {
- vm._renderProxy = vm;
- }
- };
- }
-
- /* */
-
- var seenObjects = new _Set();
-
- /**
- * Recursively traverse an object to evoke all converted
- * getters, so that every nested property inside the object
- * is collected as a "deep" dependency.
- */
- function traverse (val) {
- _traverse(val, seenObjects);
- seenObjects.clear();
- }
-
- function _traverse (val, seen) {
- var i, keys;
- var isA = Array.isArray(val);
- if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
- return
- }
- if (val.__ob__) {
- var depId = val.__ob__.dep.id;
- if (seen.has(depId)) {
- return
- }
- seen.add(depId);
- }
- if (isA) {
- i = val.length;
- while (i--) { _traverse(val[i], seen); }
- } else {
- keys = Object.keys(val);
- i = keys.length;
- while (i--) { _traverse(val[keys[i]], seen); }
- }
- }
-
- /* */
-
- var normalizeEvent = cached(function (name) {
- var passive = name.charAt(0) === '&';
- name = passive ? name.slice(1) : name;
- var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
- name = once$$1 ? name.slice(1) : name;
- var capture = name.charAt(0) === '!';
- name = capture ? name.slice(1) : name;
- return {
- name: name,
- once: once$$1,
- capture: capture,
- passive: passive
- }
- });
-
- function createFnInvoker (fns, vm) {
- function invoker () {
- var arguments$1 = arguments;
-
- var fns = invoker.fns;
- if (Array.isArray(fns)) {
- var cloned = fns.slice();
- for (var i = 0; i < cloned.length; i++) {
- invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
- }
- } else {
- // return handler return value for single handlers
- return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
- }
- }
- invoker.fns = fns;
- return invoker
- }
-
- function updateListeners (
- on,
- oldOn,
- add,
- remove$$1,
- createOnceHandler,
- vm
- ) {
- var name, def$$1, cur, old, event;
- for (name in on) {
- def$$1 = cur = on[name];
- old = oldOn[name];
- event = normalizeEvent(name);
- if (isUndef(cur)) {
- warn(
- "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
- vm
- );
- } else if (isUndef(old)) {
- if (isUndef(cur.fns)) {
- cur = on[name] = createFnInvoker(cur, vm);
- }
- if (isTrue(event.once)) {
- cur = on[name] = createOnceHandler(event.name, cur, event.capture);
- }
- add(event.name, cur, event.capture, event.passive, event.params);
- } else if (cur !== old) {
- old.fns = cur;
- on[name] = old;
- }
- }
- for (name in oldOn) {
- if (isUndef(on[name])) {
- event = normalizeEvent(name);
- remove$$1(event.name, oldOn[name], event.capture);
- }
- }
- }
-
- /* */
-
- function mergeVNodeHook (def, hookKey, hook) {
- if (def instanceof VNode) {
- def = def.data.hook || (def.data.hook = {});
- }
- var invoker;
- var oldHook = def[hookKey];
-
- function wrappedHook () {
- hook.apply(this, arguments);
- // important: remove merged hook to ensure it's called only once
- // and prevent memory leak
- remove(invoker.fns, wrappedHook);
- }
-
- if (isUndef(oldHook)) {
- // no existing hook
- invoker = createFnInvoker([wrappedHook]);
- } else {
- /* istanbul ignore if */
- if (isDef(oldHook.fns) && isTrue(oldHook.merged)) {
- // already a merged invoker
- invoker = oldHook;
- invoker.fns.push(wrappedHook);
- } else {
- // existing plain hook
- invoker = createFnInvoker([oldHook, wrappedHook]);
- }
- }
-
- invoker.merged = true;
- def[hookKey] = invoker;
- }
-
- /* */
-
- function extractPropsFromVNodeData (
- data,
- Ctor,
- tag
- ) {
- // we are only extracting raw values here.
- // validation and default values are handled in the child
- // component itself.
- var propOptions = Ctor.options.props;
- if (isUndef(propOptions)) {
- return
- }
- var res = {};
- var attrs = data.attrs;
- var props = data.props;
- if (isDef(attrs) || isDef(props)) {
- for (var key in propOptions) {
- var altKey = hyphenate(key);
- {
- var keyInLowerCase = key.toLowerCase();
- if (
- key !== keyInLowerCase &&
- attrs && hasOwn(attrs, keyInLowerCase)
- ) {
- tip(
- "Prop \"" + keyInLowerCase + "\" is passed to component " +
- (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
- " \"" + key + "\". " +
- "Note that HTML attributes are case-insensitive and camelCased " +
- "props need to use their kebab-case equivalents when using in-DOM " +
- "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
- );
- }
- }
- checkProp(res, props, key, altKey, true) ||
- checkProp(res, attrs, key, altKey, false);
- }
- }
- return res
- }
-
- function checkProp (
- res,
- hash,
- key,
- altKey,
- preserve
- ) {
- if (isDef(hash)) {
- if (hasOwn(hash, key)) {
- res[key] = hash[key];
- if (!preserve) {
- delete hash[key];
- }
- return true
- } else if (hasOwn(hash, altKey)) {
- res[key] = hash[altKey];
- if (!preserve) {
- delete hash[altKey];
- }
- return true
- }
- }
- return false
- }
-
- /* */
-
- // The template compiler attempts to minimize the need for normalization by
- // statically analyzing the template at compile time.
- //
- // For plain HTML markup, normalization can be completely skipped because the
- // generated render function is guaranteed to return Array. There are
- // two cases where extra normalization is needed:
-
- // 1. When the children contains components - because a functional component
- // may return an Array instead of a single root. In this case, just a simple
- // normalization is needed - if any child is an Array, we flatten the whole
- // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
- // because functional components already normalize their own children.
- function simpleNormalizeChildren (children) {
- for (var i = 0; i < children.length; i++) {
- if (Array.isArray(children[i])) {
- return Array.prototype.concat.apply([], children)
- }
- }
- return children
- }
-
- // 2. When the children contains constructs that always generated nested Arrays,
- // e.g. , , v-for, or when the children is provided by user
- // with hand-written render functions / JSX. In such cases a full normalization
- // is needed to cater to all possible types of children values.
- function normalizeChildren (children) {
- return isPrimitive(children)
- ? [createTextVNode(children)]
- : Array.isArray(children)
- ? normalizeArrayChildren(children)
- : undefined
- }
-
- function isTextNode (node) {
- return isDef(node) && isDef(node.text) && isFalse(node.isComment)
- }
-
- function normalizeArrayChildren (children, nestedIndex) {
- var res = [];
- var i, c, lastIndex, last;
- for (i = 0; i < children.length; i++) {
- c = children[i];
- if (isUndef(c) || typeof c === 'boolean') { continue }
- lastIndex = res.length - 1;
- last = res[lastIndex];
- // nested
- if (Array.isArray(c)) {
- if (c.length > 0) {
- c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
- // merge adjacent text nodes
- if (isTextNode(c[0]) && isTextNode(last)) {
- res[lastIndex] = createTextVNode(last.text + (c[0]).text);
- c.shift();
- }
- res.push.apply(res, c);
- }
- } else if (isPrimitive(c)) {
- if (isTextNode(last)) {
- // merge adjacent text nodes
- // this is necessary for SSR hydration because text nodes are
- // essentially merged when rendered to HTML strings
- res[lastIndex] = createTextVNode(last.text + c);
- } else if (c !== '') {
- // convert primitive to vnode
- res.push(createTextVNode(c));
- }
- } else {
- if (isTextNode(c) && isTextNode(last)) {
- // merge adjacent text nodes
- res[lastIndex] = createTextVNode(last.text + c.text);
- } else {
- // default key for nested array children (likely generated by v-for)
- if (isTrue(children._isVList) &&
- isDef(c.tag) &&
- isUndef(c.key) &&
- isDef(nestedIndex)) {
- c.key = "__vlist" + nestedIndex + "_" + i + "__";
- }
- res.push(c);
- }
- }
- }
- return res
- }
-
- /* */
-
- function initProvide (vm) {
- var provide = vm.$options.provide;
- if (provide) {
- vm._provided = typeof provide === 'function'
- ? provide.call(vm)
- : provide;
- }
- }
-
- function initInjections (vm) {
- var result = resolveInject(vm.$options.inject, vm);
- if (result) {
- toggleObserving(false);
- Object.keys(result).forEach(function (key) {
- /* istanbul ignore else */
- {
- defineReactive$$1(vm, key, result[key], function () {
- warn(
- "Avoid mutating an injected value directly since the changes will be " +
- "overwritten whenever the provided component re-renders. " +
- "injection being mutated: \"" + key + "\"",
- vm
- );
- });
- }
- });
- toggleObserving(true);
- }
- }
-
- function resolveInject (inject, vm) {
- if (inject) {
- // inject is :any because flow is not smart enough to figure out cached
- var result = Object.create(null);
- var keys = hasSymbol
- ? Reflect.ownKeys(inject)
- : Object.keys(inject);
-
- for (var i = 0; i < keys.length; i++) {
- var key = keys[i];
- // #6574 in case the inject object is observed...
- if (key === '__ob__') { continue }
- var provideKey = inject[key].from;
- var source = vm;
- while (source) {
- if (source._provided && hasOwn(source._provided, provideKey)) {
- result[key] = source._provided[provideKey];
- break
- }
- source = source.$parent;
- }
- if (!source) {
- if ('default' in inject[key]) {
- var provideDefault = inject[key].default;
- result[key] = typeof provideDefault === 'function'
- ? provideDefault.call(vm)
- : provideDefault;
- } else {
- warn(("Injection \"" + key + "\" not found"), vm);
- }
- }
- }
- return result
- }
- }
-
- /* */
-
-
-
- /**
- * Runtime helper for resolving raw children VNodes into a slot object.
- */
- function resolveSlots (
- children,
- context
- ) {
- if (!children || !children.length) {
- return {}
- }
- var slots = {};
- for (var i = 0, l = children.length; i < l; i++) {
- var child = children[i];
- var data = child.data;
- // remove slot attribute if the node is resolved as a Vue slot node
- if (data && data.attrs && data.attrs.slot) {
- delete data.attrs.slot;
- }
- // named slots should only be respected if the vnode was rendered in the
- // same context.
- if ((child.context === context || child.fnContext === context) &&
- data && data.slot != null
- ) {
- var name = data.slot;
- var slot = (slots[name] || (slots[name] = []));
- if (child.tag === 'template') {
- slot.push.apply(slot, child.children || []);
- } else {
- slot.push(child);
- }
- } else {
- (slots.default || (slots.default = [])).push(child);
- }
- }
- // ignore slots that contains only whitespace
- for (var name$1 in slots) {
- if (slots[name$1].every(isWhitespace)) {
- delete slots[name$1];
- }
- }
- return slots
- }
-
- function isWhitespace (node) {
- return (node.isComment && !node.asyncFactory) || node.text === ' '
- }
-
- /* */
-
- function normalizeScopedSlots (
- slots,
- normalSlots,
- prevSlots
- ) {
- var res;
- var hasNormalSlots = Object.keys(normalSlots).length > 0;
- var isStable = slots ? !!slots.$stable : !hasNormalSlots;
- var key = slots && slots.$key;
- if (!slots) {
- res = {};
- } else if (slots._normalized) {
- // fast path 1: child component re-render only, parent did not change
- return slots._normalized
- } else if (
- isStable &&
- prevSlots &&
- prevSlots !== emptyObject &&
- key === prevSlots.$key &&
- !hasNormalSlots &&
- !prevSlots.$hasNormal
- ) {
- // fast path 2: stable scoped slots w/ no normal slots to proxy,
- // only need to normalize once
- return prevSlots
- } else {
- res = {};
- for (var key$1 in slots) {
- if (slots[key$1] && key$1[0] !== '$') {
- res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
- }
- }
- }
- // expose normal slots on scopedSlots
- for (var key$2 in normalSlots) {
- if (!(key$2 in res)) {
- res[key$2] = proxyNormalSlot(normalSlots, key$2);
- }
- }
- // avoriaz seems to mock a non-extensible $scopedSlots object
- // and when that is passed down this would cause an error
- if (slots && Object.isExtensible(slots)) {
- (slots)._normalized = res;
- }
- def(res, '$stable', isStable);
- def(res, '$key', key);
- def(res, '$hasNormal', hasNormalSlots);
- return res
- }
-
- function normalizeScopedSlot(normalSlots, key, fn) {
- var normalized = function () {
- var res = arguments.length ? fn.apply(null, arguments) : fn({});
- res = res && typeof res === 'object' && !Array.isArray(res)
- ? [res] // single vnode
- : normalizeChildren(res);
- return res && (
- res.length === 0 ||
- (res.length === 1 && res[0].isComment) // #9658
- ) ? undefined
- : res
- };
- // this is a slot using the new v-slot syntax without scope. although it is
- // compiled as a scoped slot, render fn users would expect it to be present
- // on this.$slots because the usage is semantically a normal slot.
- if (fn.proxy) {
- Object.defineProperty(normalSlots, key, {
- get: normalized,
- enumerable: true,
- configurable: true
- });
- }
- return normalized
- }
-
- function proxyNormalSlot(slots, key) {
- return function () { return slots[key]; }
- }
-
- /* */
-
- /**
- * Runtime helper for rendering v-for lists.
- */
- function renderList (
- val,
- render
- ) {
- var ret, i, l, keys, key;
- if (Array.isArray(val) || typeof val === 'string') {
- ret = new Array(val.length);
- for (i = 0, l = val.length; i < l; i++) {
- ret[i] = render(val[i], i);
- }
- } else if (typeof val === 'number') {
- ret = new Array(val);
- for (i = 0; i < val; i++) {
- ret[i] = render(i + 1, i);
- }
- } else if (isObject(val)) {
- if (hasSymbol && val[Symbol.iterator]) {
- ret = [];
- var iterator = val[Symbol.iterator]();
- var result = iterator.next();
- while (!result.done) {
- ret.push(render(result.value, ret.length));
- result = iterator.next();
- }
- } else {
- keys = Object.keys(val);
- ret = new Array(keys.length);
- for (i = 0, l = keys.length; i < l; i++) {
- key = keys[i];
- ret[i] = render(val[key], key, i);
- }
- }
- }
- if (!isDef(ret)) {
- ret = [];
- }
- (ret)._isVList = true;
- return ret
- }
-
- /* */
-
- /**
- * Runtime helper for rendering
- */
- function renderSlot (
- name,
- fallback,
- props,
- bindObject
- ) {
- var scopedSlotFn = this.$scopedSlots[name];
- var nodes;
- if (scopedSlotFn) { // scoped slot
- props = props || {};
- if (bindObject) {
- if (!isObject(bindObject)) {
- warn(
- 'slot v-bind without argument expects an Object',
- this
- );
- }
- props = extend(extend({}, bindObject), props);
- }
- nodes = scopedSlotFn(props) || fallback;
- } else {
- nodes = this.$slots[name] || fallback;
- }
-
- var target = props && props.slot;
- if (target) {
- return this.$createElement('template', { slot: target }, nodes)
- } else {
- return nodes
- }
- }
-
- /* */
-
- /**
- * Runtime helper for resolving filters
- */
- function resolveFilter (id) {
- return resolveAsset(this.$options, 'filters', id, true) || identity
- }
-
- /* */
-
- function isKeyNotMatch (expect, actual) {
- if (Array.isArray(expect)) {
- return expect.indexOf(actual) === -1
- } else {
- return expect !== actual
- }
- }
-
- /**
- * Runtime helper for checking keyCodes from config.
- * exposed as Vue.prototype._k
- * passing in eventKeyName as last argument separately for backwards compat
- */
- function checkKeyCodes (
- eventKeyCode,
- key,
- builtInKeyCode,
- eventKeyName,
- builtInKeyName
- ) {
- var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
- if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
- return isKeyNotMatch(builtInKeyName, eventKeyName)
- } else if (mappedKeyCode) {
- return isKeyNotMatch(mappedKeyCode, eventKeyCode)
- } else if (eventKeyName) {
- return hyphenate(eventKeyName) !== key
- }
- }
-
- /* */
-
- /**
- * Runtime helper for merging v-bind="object" into a VNode's data.
- */
- function bindObjectProps (
- data,
- tag,
- value,
- asProp,
- isSync
- ) {
- if (value) {
- if (!isObject(value)) {
- warn(
- 'v-bind without argument expects an Object or Array value',
- this
- );
- } else {
- if (Array.isArray(value)) {
- value = toObject(value);
- }
- var hash;
- var loop = function ( key ) {
- if (
- key === 'class' ||
- key === 'style' ||
- isReservedAttribute(key)
- ) {
- hash = data;
- } else {
- var type = data.attrs && data.attrs.type;
- hash = asProp || config.mustUseProp(tag, type, key)
- ? data.domProps || (data.domProps = {})
- : data.attrs || (data.attrs = {});
- }
- var camelizedKey = camelize(key);
- var hyphenatedKey = hyphenate(key);
- if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
- hash[key] = value[key];
-
- if (isSync) {
- var on = data.on || (data.on = {});
- on[("update:" + key)] = function ($event) {
- value[key] = $event;
- };
- }
- }
- };
-
- for (var key in value) loop( key );
- }
- }
- return data
- }
-
- /* */
-
- /**
- * Runtime helper for rendering static trees.
- */
- function renderStatic (
- index,
- isInFor
- ) {
- var cached = this._staticTrees || (this._staticTrees = []);
- var tree = cached[index];
- // if has already-rendered static tree and not inside v-for,
- // we can reuse the same tree.
- if (tree && !isInFor) {
- return tree
- }
- // otherwise, render a fresh tree.
- tree = cached[index] = this.$options.staticRenderFns[index].call(
- this._renderProxy,
- null,
- this // for render fns generated for functional component templates
- );
- markStatic(tree, ("__static__" + index), false);
- return tree
- }
-
- /**
- * Runtime helper for v-once.
- * Effectively it means marking the node as static with a unique key.
- */
- function markOnce (
- tree,
- index,
- key
- ) {
- markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
- return tree
- }
-
- function markStatic (
- tree,
- key,
- isOnce
- ) {
- if (Array.isArray(tree)) {
- for (var i = 0; i < tree.length; i++) {
- if (tree[i] && typeof tree[i] !== 'string') {
- markStaticNode(tree[i], (key + "_" + i), isOnce);
- }
- }
- } else {
- markStaticNode(tree, key, isOnce);
- }
- }
-
- function markStaticNode (node, key, isOnce) {
- node.isStatic = true;
- node.key = key;
- node.isOnce = isOnce;
- }
-
- /* */
-
- function bindObjectListeners (data, value) {
- if (value) {
- if (!isPlainObject(value)) {
- warn(
- 'v-on without argument expects an Object value',
- this
- );
- } else {
- var on = data.on = data.on ? extend({}, data.on) : {};
- for (var key in value) {
- var existing = on[key];
- var ours = value[key];
- on[key] = existing ? [].concat(existing, ours) : ours;
- }
- }
- }
- return data
- }
-
- /* */
-
- function resolveScopedSlots (
- fns, // see flow/vnode
- res,
- // the following are added in 2.6
- hasDynamicKeys,
- contentHashKey
- ) {
- res = res || { $stable: !hasDynamicKeys };
- for (var i = 0; i < fns.length; i++) {
- var slot = fns[i];
- if (Array.isArray(slot)) {
- resolveScopedSlots(slot, res, hasDynamicKeys);
- } else if (slot) {
- // marker for reverse proxying v-slot without scope on this.$slots
- if (slot.proxy) {
- slot.fn.proxy = true;
- }
- res[slot.key] = slot.fn;
- }
- }
- if (contentHashKey) {
- (res).$key = contentHashKey;
- }
- return res
- }
-
- /* */
-
- function bindDynamicKeys (baseObj, values) {
- for (var i = 0; i < values.length; i += 2) {
- var key = values[i];
- if (typeof key === 'string' && key) {
- baseObj[values[i]] = values[i + 1];
- } else if (key !== '' && key !== null) {
- // null is a special value for explicitly removing a binding
- warn(
- ("Invalid value for dynamic directive argument (expected string or null): " + key),
- this
- );
- }
- }
- return baseObj
- }
-
- // helper to dynamically append modifier runtime markers to event names.
- // ensure only append when value is already string, otherwise it will be cast
- // to string and cause the type check to miss.
- function prependModifier (value, symbol) {
- return typeof value === 'string' ? symbol + value : value
- }
-
- /* */
-
- function installRenderHelpers (target) {
- target._o = markOnce;
- target._n = toNumber;
- target._s = toString;
- target._l = renderList;
- target._t = renderSlot;
- target._q = looseEqual;
- target._i = looseIndexOf;
- target._m = renderStatic;
- target._f = resolveFilter;
- target._k = checkKeyCodes;
- target._b = bindObjectProps;
- target._v = createTextVNode;
- target._e = createEmptyVNode;
- target._u = resolveScopedSlots;
- target._g = bindObjectListeners;
- target._d = bindDynamicKeys;
- target._p = prependModifier;
- }
-
- /* */
-
- function FunctionalRenderContext (
- data,
- props,
- children,
- parent,
- Ctor
- ) {
- var this$1 = this;
-
- var options = Ctor.options;
- // ensure the createElement function in functional components
- // gets a unique context - this is necessary for correct named slot check
- var contextVm;
- if (hasOwn(parent, '_uid')) {
- contextVm = Object.create(parent);
- // $flow-disable-line
- contextVm._original = parent;
- } else {
- // the context vm passed in is a functional context as well.
- // in this case we want to make sure we are able to get a hold to the
- // real context instance.
- contextVm = parent;
- // $flow-disable-line
- parent = parent._original;
- }
- var isCompiled = isTrue(options._compiled);
- var needNormalization = !isCompiled;
-
- this.data = data;
- this.props = props;
- this.children = children;
- this.parent = parent;
- this.listeners = data.on || emptyObject;
- this.injections = resolveInject(options.inject, parent);
- this.slots = function () {
- if (!this$1.$slots) {
- normalizeScopedSlots(
- data.scopedSlots,
- this$1.$slots = resolveSlots(children, parent)
- );
- }
- return this$1.$slots
- };
-
- Object.defineProperty(this, 'scopedSlots', ({
- enumerable: true,
- get: function get () {
- return normalizeScopedSlots(data.scopedSlots, this.slots())
- }
- }));
-
- // support for compiled functional template
- if (isCompiled) {
- // exposing $options for renderStatic()
- this.$options = options;
- // pre-resolve slots for renderSlot()
- this.$slots = this.slots();
- this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
- }
-
- if (options._scopeId) {
- this._c = function (a, b, c, d) {
- var vnode = createElement(contextVm, a, b, c, d, needNormalization);
- if (vnode && !Array.isArray(vnode)) {
- vnode.fnScopeId = options._scopeId;
- vnode.fnContext = parent;
- }
- return vnode
- };
- } else {
- this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
- }
- }
-
- installRenderHelpers(FunctionalRenderContext.prototype);
-
- function createFunctionalComponent (
- Ctor,
- propsData,
- data,
- contextVm,
- children
- ) {
- var options = Ctor.options;
- var props = {};
- var propOptions = options.props;
- if (isDef(propOptions)) {
- for (var key in propOptions) {
- props[key] = validateProp(key, propOptions, propsData || emptyObject);
- }
- } else {
- if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
- if (isDef(data.props)) { mergeProps(props, data.props); }
- }
-
- var renderContext = new FunctionalRenderContext(
- data,
- props,
- children,
- contextVm,
- Ctor
- );
-
- var vnode = options.render.call(null, renderContext._c, renderContext);
-
- if (vnode instanceof VNode) {
- return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
- } else if (Array.isArray(vnode)) {
- var vnodes = normalizeChildren(vnode) || [];
- var res = new Array(vnodes.length);
- for (var i = 0; i < vnodes.length; i++) {
- res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
- }
- return res
- }
- }
-
- function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
- // #7817 clone node before setting fnContext, otherwise if the node is reused
- // (e.g. it was from a cached normal slot) the fnContext causes named slots
- // that should not be matched to match.
- var clone = cloneVNode(vnode);
- clone.fnContext = contextVm;
- clone.fnOptions = options;
- {
- (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
- }
- if (data.slot) {
- (clone.data || (clone.data = {})).slot = data.slot;
- }
- return clone
- }
-
- function mergeProps (to, from) {
- for (var key in from) {
- to[camelize(key)] = from[key];
- }
- }
-
- /* */
-
- /* */
-
- /* */
-
- /* */
-
- // inline hooks to be invoked on component VNodes during patch
- var componentVNodeHooks = {
- init: function init (vnode, hydrating) {
- if (
- vnode.componentInstance &&
- !vnode.componentInstance._isDestroyed &&
- vnode.data.keepAlive
- ) {
- // kept-alive components, treat as a patch
- var mountedNode = vnode; // work around flow
- componentVNodeHooks.prepatch(mountedNode, mountedNode);
- } else {
- var child = vnode.componentInstance = createComponentInstanceForVnode(
- vnode,
- activeInstance
- );
- child.$mount(hydrating ? vnode.elm : undefined, hydrating);
- }
- },
-
- prepatch: function prepatch (oldVnode, vnode) {
- var options = vnode.componentOptions;
- var child = vnode.componentInstance = oldVnode.componentInstance;
- updateChildComponent(
- child,
- options.propsData, // updated props
- options.listeners, // updated listeners
- vnode, // new parent vnode
- options.children // new children
- );
- },
-
- insert: function insert (vnode) {
- var context = vnode.context;
- var componentInstance = vnode.componentInstance;
- if (!componentInstance._isMounted) {
- componentInstance._isMounted = true;
- callHook(componentInstance, 'mounted');
- }
- if (vnode.data.keepAlive) {
- if (context._isMounted) {
- // vue-router#1212
- // During updates, a kept-alive component's child components may
- // change, so directly walking the tree here may call activated hooks
- // on incorrect children. Instead we push them into a queue which will
- // be processed after the whole patch process ended.
- queueActivatedComponent(componentInstance);
- } else {
- activateChildComponent(componentInstance, true /* direct */);
- }
- }
- },
-
- destroy: function destroy (vnode) {
- var componentInstance = vnode.componentInstance;
- if (!componentInstance._isDestroyed) {
- if (!vnode.data.keepAlive) {
- componentInstance.$destroy();
- } else {
- deactivateChildComponent(componentInstance, true /* direct */);
- }
- }
- }
- };
-
- var hooksToMerge = Object.keys(componentVNodeHooks);
-
- function createComponent (
- Ctor,
- data,
- context,
- children,
- tag
- ) {
- if (isUndef(Ctor)) {
- return
- }
-
- var baseCtor = context.$options._base;
-
- // plain options object: turn it into a constructor
- if (isObject(Ctor)) {
- Ctor = baseCtor.extend(Ctor);
- }
-
- // if at this stage it's not a constructor or an async component factory,
- // reject.
- if (typeof Ctor !== 'function') {
- {
- warn(("Invalid Component definition: " + (String(Ctor))), context);
- }
- return
- }
-
- // async component
- var asyncFactory;
- if (isUndef(Ctor.cid)) {
- asyncFactory = Ctor;
- Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
- if (Ctor === undefined) {
- // return a placeholder node for async component, which is rendered
- // as a comment node but preserves all the raw information for the node.
- // the information will be used for async server-rendering and hydration.
- return createAsyncPlaceholder(
- asyncFactory,
- data,
- context,
- children,
- tag
- )
- }
- }
-
- data = data || {};
-
- // resolve constructor options in case global mixins are applied after
- // component constructor creation
- resolveConstructorOptions(Ctor);
-
- // transform component v-model data into props & events
- if (isDef(data.model)) {
- transformModel(Ctor.options, data);
- }
-
- // extract props
- var propsData = extractPropsFromVNodeData(data, Ctor, tag);
-
- // functional component
- if (isTrue(Ctor.options.functional)) {
- return createFunctionalComponent(Ctor, propsData, data, context, children)
- }
-
- // extract listeners, since these needs to be treated as
- // child component listeners instead of DOM listeners
- var listeners = data.on;
- // replace with listeners with .native modifier
- // so it gets processed during parent component patch.
- data.on = data.nativeOn;
-
- if (isTrue(Ctor.options.abstract)) {
- // abstract components do not keep anything
- // other than props & listeners & slot
-
- // work around flow
- var slot = data.slot;
- data = {};
- if (slot) {
- data.slot = slot;
- }
- }
-
- // install component management hooks onto the placeholder node
- installComponentHooks(data);
-
- // return a placeholder vnode
- var name = Ctor.options.name || tag;
- var vnode = new VNode(
- ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
- data, undefined, undefined, undefined, context,
- { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
- asyncFactory
- );
-
- return vnode
- }
-
- function createComponentInstanceForVnode (
- vnode, // we know it's MountedComponentVNode but flow doesn't
- parent // activeInstance in lifecycle state
- ) {
- var options = {
- _isComponent: true,
- _parentVnode: vnode,
- parent: parent
- };
- // check inline-template render functions
- var inlineTemplate = vnode.data.inlineTemplate;
- if (isDef(inlineTemplate)) {
- options.render = inlineTemplate.render;
- options.staticRenderFns = inlineTemplate.staticRenderFns;
- }
- return new vnode.componentOptions.Ctor(options)
- }
-
- function installComponentHooks (data) {
- var hooks = data.hook || (data.hook = {});
- for (var i = 0; i < hooksToMerge.length; i++) {
- var key = hooksToMerge[i];
- var existing = hooks[key];
- var toMerge = componentVNodeHooks[key];
- if (existing !== toMerge && !(existing && existing._merged)) {
- hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
- }
- }
- }
-
- function mergeHook$1 (f1, f2) {
- var merged = function (a, b) {
- // flow complains about extra args which is why we use any
- f1(a, b);
- f2(a, b);
- };
- merged._merged = true;
- return merged
- }
-
- // transform component v-model info (value and callback) into
- // prop and event handler respectively.
- function transformModel (options, data) {
- var prop = (options.model && options.model.prop) || 'value';
- var event = (options.model && options.model.event) || 'input'
- ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
- var on = data.on || (data.on = {});
- var existing = on[event];
- var callback = data.model.callback;
- if (isDef(existing)) {
- if (
- Array.isArray(existing)
- ? existing.indexOf(callback) === -1
- : existing !== callback
- ) {
- on[event] = [callback].concat(existing);
- }
- } else {
- on[event] = callback;
- }
- }
-
- /* */
-
- var SIMPLE_NORMALIZE = 1;
- var ALWAYS_NORMALIZE = 2;
-
- // wrapper function for providing a more flexible interface
- // without getting yelled at by flow
- function createElement (
- context,
- tag,
- data,
- children,
- normalizationType,
- alwaysNormalize
- ) {
- if (Array.isArray(data) || isPrimitive(data)) {
- normalizationType = children;
- children = data;
- data = undefined;
- }
- if (isTrue(alwaysNormalize)) {
- normalizationType = ALWAYS_NORMALIZE;
- }
- return _createElement(context, tag, data, children, normalizationType)
- }
-
- function _createElement (
- context,
- tag,
- data,
- children,
- normalizationType
- ) {
- if (isDef(data) && isDef((data).__ob__)) {
- warn(
- "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
- 'Always create fresh vnode data objects in each render!',
- context
- );
- return createEmptyVNode()
- }
- // object syntax in v-bind
- if (isDef(data) && isDef(data.is)) {
- tag = data.is;
- }
- if (!tag) {
- // in case of component :is set to falsy value
- return createEmptyVNode()
- }
- // warn against non-primitive key
- if (isDef(data) && isDef(data.key) && !isPrimitive(data.key)
- ) {
- {
- warn(
- 'Avoid using non-primitive value as key, ' +
- 'use string/number value instead.',
- context
- );
- }
- }
- // support single function children as default scoped slot
- if (Array.isArray(children) &&
- typeof children[0] === 'function'
- ) {
- data = data || {};
- data.scopedSlots = { default: children[0] };
- children.length = 0;
- }
- if (normalizationType === ALWAYS_NORMALIZE) {
- children = normalizeChildren(children);
- } else if (normalizationType === SIMPLE_NORMALIZE) {
- children = simpleNormalizeChildren(children);
- }
- var vnode, ns;
- if (typeof tag === 'string') {
- var Ctor;
- ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
- if (config.isReservedTag(tag)) {
- // platform built-in elements
- if (isDef(data) && isDef(data.nativeOn)) {
- warn(
- ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
- context
- );
- }
- vnode = new VNode(
- config.parsePlatformTagName(tag), data, children,
- undefined, undefined, context
- );
- } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
- // component
- vnode = createComponent(Ctor, data, context, children, tag);
- } else {
- // unknown or unlisted namespaced elements
- // check at runtime because it may get assigned a namespace when its
- // parent normalizes children
- vnode = new VNode(
- tag, data, children,
- undefined, undefined, context
- );
- }
- } else {
- // direct component options / constructor
- vnode = createComponent(tag, data, context, children);
- }
- if (Array.isArray(vnode)) {
- return vnode
- } else if (isDef(vnode)) {
- if (isDef(ns)) { applyNS(vnode, ns); }
- if (isDef(data)) { registerDeepBindings(data); }
- return vnode
- } else {
- return createEmptyVNode()
- }
- }
-
- function applyNS (vnode, ns, force) {
- vnode.ns = ns;
- if (vnode.tag === 'foreignObject') {
- // use default namespace inside foreignObject
- ns = undefined;
- force = true;
- }
- if (isDef(vnode.children)) {
- for (var i = 0, l = vnode.children.length; i < l; i++) {
- var child = vnode.children[i];
- if (isDef(child.tag) && (
- isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
- applyNS(child, ns, force);
- }
- }
- }
- }
-
- // ref #5318
- // necessary to ensure parent re-render when deep bindings like :style and
- // :class are used on slot nodes
- function registerDeepBindings (data) {
- if (isObject(data.style)) {
- traverse(data.style);
- }
- if (isObject(data.class)) {
- traverse(data.class);
- }
- }
-
- /* */
-
- function initRender (vm) {
- vm._vnode = null; // the root of the child tree
- vm._staticTrees = null; // v-once cached trees
- var options = vm.$options;
- var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
- var renderContext = parentVnode && parentVnode.context;
- vm.$slots = resolveSlots(options._renderChildren, renderContext);
- vm.$scopedSlots = emptyObject;
- // bind the createElement fn to this instance
- // so that we get proper render context inside it.
- // args order: tag, data, children, normalizationType, alwaysNormalize
- // internal version is used by render functions compiled from templates
- vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
- // normalization is always applied for the public version, used in
- // user-written render functions.
- vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
-
- // $attrs & $listeners are exposed for easier HOC creation.
- // they need to be reactive so that HOCs using them are always updated
- var parentData = parentVnode && parentVnode.data;
-
- /* istanbul ignore else */
- {
- defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
- !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
- }, true);
- defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
- !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
- }, true);
- }
- }
-
- var currentRenderingInstance = null;
-
- function renderMixin (Vue) {
- // install runtime convenience helpers
- installRenderHelpers(Vue.prototype);
-
- Vue.prototype.$nextTick = function (fn) {
- return nextTick(fn, this)
- };
-
- Vue.prototype._render = function () {
- var vm = this;
- var ref = vm.$options;
- var render = ref.render;
- var _parentVnode = ref._parentVnode;
-
- if (_parentVnode) {
- vm.$scopedSlots = normalizeScopedSlots(
- _parentVnode.data.scopedSlots,
- vm.$slots,
- vm.$scopedSlots
- );
- }
-
- // set parent vnode. this allows render functions to have access
- // to the data on the placeholder node.
- vm.$vnode = _parentVnode;
- // render self
- var vnode;
- try {
- // There's no need to maintain a stack because all render fns are called
- // separately from one another. Nested component's render fns are called
- // when parent component is patched.
- currentRenderingInstance = vm;
- vnode = render.call(vm._renderProxy, vm.$createElement);
- } catch (e) {
- handleError(e, vm, "render");
- // return error render result,
- // or previous vnode to prevent render error causing blank component
- /* istanbul ignore else */
- if (vm.$options.renderError) {
- try {
- vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
- } catch (e) {
- handleError(e, vm, "renderError");
- vnode = vm._vnode;
- }
- } else {
- vnode = vm._vnode;
- }
- } finally {
- currentRenderingInstance = null;
- }
- // if the returned array contains only a single node, allow it
- if (Array.isArray(vnode) && vnode.length === 1) {
- vnode = vnode[0];
- }
- // return empty vnode in case the render function errored out
- if (!(vnode instanceof VNode)) {
- if (Array.isArray(vnode)) {
- warn(
- 'Multiple root nodes returned from render function. Render function ' +
- 'should return a single root node.',
- vm
- );
- }
- vnode = createEmptyVNode();
- }
- // set parent
- vnode.parent = _parentVnode;
- return vnode
- };
- }
-
- /* */
-
- function ensureCtor (comp, base) {
- if (
- comp.__esModule ||
- (hasSymbol && comp[Symbol.toStringTag] === 'Module')
- ) {
- comp = comp.default;
- }
- return isObject(comp)
- ? base.extend(comp)
- : comp
- }
-
- function createAsyncPlaceholder (
- factory,
- data,
- context,
- children,
- tag
- ) {
- var node = createEmptyVNode();
- node.asyncFactory = factory;
- node.asyncMeta = { data: data, context: context, children: children, tag: tag };
- return node
- }
-
- function resolveAsyncComponent (
- factory,
- baseCtor
- ) {
- if (isTrue(factory.error) && isDef(factory.errorComp)) {
- return factory.errorComp
- }
-
- if (isDef(factory.resolved)) {
- return factory.resolved
- }
-
- var owner = currentRenderingInstance;
- if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
- // already pending
- factory.owners.push(owner);
- }
-
- if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
- return factory.loadingComp
- }
-
- if (owner && !isDef(factory.owners)) {
- var owners = factory.owners = [owner];
- var sync = true;
- var timerLoading = null;
- var timerTimeout = null
-
- ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
-
- var forceRender = function (renderCompleted) {
- for (var i = 0, l = owners.length; i < l; i++) {
- (owners[i]).$forceUpdate();
- }
-
- if (renderCompleted) {
- owners.length = 0;
- if (timerLoading !== null) {
- clearTimeout(timerLoading);
- timerLoading = null;
- }
- if (timerTimeout !== null) {
- clearTimeout(timerTimeout);
- timerTimeout = null;
- }
- }
- };
-
- var resolve = once(function (res) {
- // cache resolved
- factory.resolved = ensureCtor(res, baseCtor);
- // invoke callbacks only if this is not a synchronous resolve
- // (async resolves are shimmed as synchronous during SSR)
- if (!sync) {
- forceRender(true);
- } else {
- owners.length = 0;
- }
- });
-
- var reject = once(function (reason) {
- warn(
- "Failed to resolve async component: " + (String(factory)) +
- (reason ? ("\nReason: " + reason) : '')
- );
- if (isDef(factory.errorComp)) {
- factory.error = true;
- forceRender(true);
- }
- });
-
- var res = factory(resolve, reject);
-
- if (isObject(res)) {
- if (isPromise(res)) {
- // () => Promise
- if (isUndef(factory.resolved)) {
- res.then(resolve, reject);
- }
- } else if (isPromise(res.component)) {
- res.component.then(resolve, reject);
-
- if (isDef(res.error)) {
- factory.errorComp = ensureCtor(res.error, baseCtor);
- }
-
- if (isDef(res.loading)) {
- factory.loadingComp = ensureCtor(res.loading, baseCtor);
- if (res.delay === 0) {
- factory.loading = true;
- } else {
- timerLoading = setTimeout(function () {
- timerLoading = null;
- if (isUndef(factory.resolved) && isUndef(factory.error)) {
- factory.loading = true;
- forceRender(false);
- }
- }, res.delay || 200);
- }
- }
-
- if (isDef(res.timeout)) {
- timerTimeout = setTimeout(function () {
- timerTimeout = null;
- if (isUndef(factory.resolved)) {
- reject(
- "timeout (" + (res.timeout) + "ms)"
- );
- }
- }, res.timeout);
- }
- }
- }
-
- sync = false;
- // return in case resolved synchronously
- return factory.loading
- ? factory.loadingComp
- : factory.resolved
- }
- }
-
- /* */
-
- function isAsyncPlaceholder (node) {
- return node.isComment && node.asyncFactory
- }
-
- /* */
-
- function getFirstComponentChild (children) {
- if (Array.isArray(children)) {
- for (var i = 0; i < children.length; i++) {
- var c = children[i];
- if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
- return c
- }
- }
- }
- }
-
- /* */
-
- /* */
-
- function initEvents (vm) {
- vm._events = Object.create(null);
- vm._hasHookEvent = false;
- // init parent attached events
- var listeners = vm.$options._parentListeners;
- if (listeners) {
- updateComponentListeners(vm, listeners);
- }
- }
-
- var target;
-
- function add (event, fn) {
- target.$on(event, fn);
- }
-
- function remove$1 (event, fn) {
- target.$off(event, fn);
- }
-
- function createOnceHandler (event, fn) {
- var _target = target;
- return function onceHandler () {
- var res = fn.apply(null, arguments);
- if (res !== null) {
- _target.$off(event, onceHandler);
- }
- }
- }
-
- function updateComponentListeners (
- vm,
- listeners,
- oldListeners
- ) {
- target = vm;
- updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
- target = undefined;
- }
-
- function eventsMixin (Vue) {
- var hookRE = /^hook:/;
- Vue.prototype.$on = function (event, fn) {
- var vm = this;
- if (Array.isArray(event)) {
- for (var i = 0, l = event.length; i < l; i++) {
- vm.$on(event[i], fn);
- }
- } else {
- (vm._events[event] || (vm._events[event] = [])).push(fn);
- // optimize hook:event cost by using a boolean flag marked at registration
- // instead of a hash lookup
- if (hookRE.test(event)) {
- vm._hasHookEvent = true;
- }
- }
- return vm
- };
-
- Vue.prototype.$once = function (event, fn) {
- var vm = this;
- function on () {
- vm.$off(event, on);
- fn.apply(vm, arguments);
- }
- on.fn = fn;
- vm.$on(event, on);
- return vm
- };
-
- Vue.prototype.$off = function (event, fn) {
- var vm = this;
- // all
- if (!arguments.length) {
- vm._events = Object.create(null);
- return vm
- }
- // array of events
- if (Array.isArray(event)) {
- for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
- vm.$off(event[i$1], fn);
- }
- return vm
- }
- // specific event
- var cbs = vm._events[event];
- if (!cbs) {
- return vm
- }
- if (!fn) {
- vm._events[event] = null;
- return vm
- }
- // specific handler
- var cb;
- var i = cbs.length;
- while (i--) {
- cb = cbs[i];
- if (cb === fn || cb.fn === fn) {
- cbs.splice(i, 1);
- break
- }
- }
- return vm
- };
-
- Vue.prototype.$emit = function (event) {
- var vm = this;
- {
- var lowerCaseEvent = event.toLowerCase();
- if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
- tip(
- "Event \"" + lowerCaseEvent + "\" is emitted in component " +
- (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
- "Note that HTML attributes are case-insensitive and you cannot use " +
- "v-on to listen to camelCase events when using in-DOM templates. " +
- "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
- );
- }
- }
- var cbs = vm._events[event];
- if (cbs) {
- cbs = cbs.length > 1 ? toArray(cbs) : cbs;
- var args = toArray(arguments, 1);
- var info = "event handler for \"" + event + "\"";
- for (var i = 0, l = cbs.length; i < l; i++) {
- invokeWithErrorHandling(cbs[i], vm, args, vm, info);
- }
- }
- return vm
- };
- }
-
- /* */
-
- var activeInstance = null;
- var isUpdatingChildComponent = false;
-
- function setActiveInstance(vm) {
- var prevActiveInstance = activeInstance;
- activeInstance = vm;
- return function () {
- activeInstance = prevActiveInstance;
- }
- }
-
- function initLifecycle (vm) {
- var options = vm.$options;
-
- // locate first non-abstract parent
- var parent = options.parent;
- if (parent && !options.abstract) {
- while (parent.$options.abstract && parent.$parent) {
- parent = parent.$parent;
- }
- parent.$children.push(vm);
- }
-
- vm.$parent = parent;
- vm.$root = parent ? parent.$root : vm;
-
- vm.$children = [];
- vm.$refs = {};
-
- vm._watcher = null;
- vm._inactive = null;
- vm._directInactive = false;
- vm._isMounted = false;
- vm._isDestroyed = false;
- vm._isBeingDestroyed = false;
- }
-
- function lifecycleMixin (Vue) {
- Vue.prototype._update = function (vnode, hydrating) {
- var vm = this;
- var prevEl = vm.$el;
- var prevVnode = vm._vnode;
- var restoreActiveInstance = setActiveInstance(vm);
- vm._vnode = vnode;
- // Vue.prototype.__patch__ is injected in entry points
- // based on the rendering backend used.
- if (!prevVnode) {
- // initial render
- vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
- } else {
- // updates
- vm.$el = vm.__patch__(prevVnode, vnode);
- }
- restoreActiveInstance();
- // update __vue__ reference
- if (prevEl) {
- prevEl.__vue__ = null;
- }
- if (vm.$el) {
- vm.$el.__vue__ = vm;
- }
- // if parent is an HOC, update its $el as well
- if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
- vm.$parent.$el = vm.$el;
- }
- // updated hook is called by the scheduler to ensure that children are
- // updated in a parent's updated hook.
- };
-
- Vue.prototype.$forceUpdate = function () {
- var vm = this;
- if (vm._watcher) {
- vm._watcher.update();
- }
- };
-
- Vue.prototype.$destroy = function () {
- var vm = this;
- if (vm._isBeingDestroyed) {
- return
- }
- callHook(vm, 'beforeDestroy');
- vm._isBeingDestroyed = true;
- // remove self from parent
- var parent = vm.$parent;
- if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
- remove(parent.$children, vm);
- }
- // teardown watchers
- if (vm._watcher) {
- vm._watcher.teardown();
- }
- var i = vm._watchers.length;
- while (i--) {
- vm._watchers[i].teardown();
- }
- // remove reference from data ob
- // frozen object may not have observer.
- if (vm._data.__ob__) {
- vm._data.__ob__.vmCount--;
- }
- // call the last hook...
- vm._isDestroyed = true;
- // invoke destroy hooks on current rendered tree
- vm.__patch__(vm._vnode, null);
- // fire destroyed hook
- callHook(vm, 'destroyed');
- // turn off all instance listeners.
- vm.$off();
- // remove __vue__ reference
- if (vm.$el) {
- vm.$el.__vue__ = null;
- }
- // release circular reference (#6759)
- if (vm.$vnode) {
- vm.$vnode.parent = null;
- }
- };
- }
-
- function mountComponent (
- vm,
- el,
- hydrating
- ) {
- vm.$el = el;
- if (!vm.$options.render) {
- vm.$options.render = createEmptyVNode;
- {
- /* istanbul ignore if */
- if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
- vm.$options.el || el) {
- warn(
- 'You are using the runtime-only build of Vue where the template ' +
- 'compiler is not available. Either pre-compile the templates into ' +
- 'render functions, or use the compiler-included build.',
- vm
- );
- } else {
- warn(
- 'Failed to mount component: template or render function not defined.',
- vm
- );
- }
- }
- }
- callHook(vm, 'beforeMount');
-
- var updateComponent;
- /* istanbul ignore if */
- if (config.performance && mark) {
- updateComponent = function () {
- var name = vm._name;
- var id = vm._uid;
- var startTag = "vue-perf-start:" + id;
- var endTag = "vue-perf-end:" + id;
-
- mark(startTag);
- var vnode = vm._render();
- mark(endTag);
- measure(("vue " + name + " render"), startTag, endTag);
-
- mark(startTag);
- vm._update(vnode, hydrating);
- mark(endTag);
- measure(("vue " + name + " patch"), startTag, endTag);
- };
- } else {
- updateComponent = function () {
- vm._update(vm._render(), hydrating);
- };
- }
-
- // we set this to vm._watcher inside the watcher's constructor
- // since the watcher's initial patch may call $forceUpdate (e.g. inside child
- // component's mounted hook), which relies on vm._watcher being already defined
- new Watcher(vm, updateComponent, noop, {
- before: function before () {
- if (vm._isMounted && !vm._isDestroyed) {
- callHook(vm, 'beforeUpdate');
- }
- }
- }, true /* isRenderWatcher */);
- hydrating = false;
-
- // manually mounted instance, call mounted on self
- // mounted is called for render-created child components in its inserted hook
- if (vm.$vnode == null) {
- vm._isMounted = true;
- callHook(vm, 'mounted');
- }
- return vm
- }
-
- function updateChildComponent (
- vm,
- propsData,
- listeners,
- parentVnode,
- renderChildren
- ) {
- {
- isUpdatingChildComponent = true;
- }
-
- // determine whether component has slot children
- // we need to do this before overwriting $options._renderChildren.
-
- // check if there are dynamic scopedSlots (hand-written or compiled but with
- // dynamic slot names). Static scoped slots compiled from template has the
- // "$stable" marker.
- var newScopedSlots = parentVnode.data.scopedSlots;
- var oldScopedSlots = vm.$scopedSlots;
- var hasDynamicScopedSlot = !!(
- (newScopedSlots && !newScopedSlots.$stable) ||
- (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
- (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
- );
-
- // Any static slot children from the parent may have changed during parent's
- // update. Dynamic scoped slots may also have changed. In such cases, a forced
- // update is necessary to ensure correctness.
- var needsForceUpdate = !!(
- renderChildren || // has new static slots
- vm.$options._renderChildren || // has old static slots
- hasDynamicScopedSlot
- );
-
- vm.$options._parentVnode = parentVnode;
- vm.$vnode = parentVnode; // update vm's placeholder node without re-render
-
- if (vm._vnode) { // update child tree's parent
- vm._vnode.parent = parentVnode;
- }
- vm.$options._renderChildren = renderChildren;
-
- // update $attrs and $listeners hash
- // these are also reactive so they may trigger child update if the child
- // used them during render
- vm.$attrs = parentVnode.data.attrs || emptyObject;
- vm.$listeners = listeners || emptyObject;
-
- // update props
- if (propsData && vm.$options.props) {
- toggleObserving(false);
- var props = vm._props;
- var propKeys = vm.$options._propKeys || [];
- for (var i = 0; i < propKeys.length; i++) {
- var key = propKeys[i];
- var propOptions = vm.$options.props; // wtf flow?
- props[key] = validateProp(key, propOptions, propsData, vm);
- }
- toggleObserving(true);
- // keep a copy of raw propsData
- vm.$options.propsData = propsData;
- }
-
- // update listeners
- listeners = listeners || emptyObject;
- var oldListeners = vm.$options._parentListeners;
- vm.$options._parentListeners = listeners;
- updateComponentListeners(vm, listeners, oldListeners);
-
- // resolve slots + force update if has children
- if (needsForceUpdate) {
- vm.$slots = resolveSlots(renderChildren, parentVnode.context);
- vm.$forceUpdate();
- }
-
- {
- isUpdatingChildComponent = false;
- }
- }
-
- function isInInactiveTree (vm) {
- while (vm && (vm = vm.$parent)) {
- if (vm._inactive) { return true }
- }
- return false
- }
-
- function activateChildComponent (vm, direct) {
- if (direct) {
- vm._directInactive = false;
- if (isInInactiveTree(vm)) {
- return
- }
- } else if (vm._directInactive) {
- return
- }
- if (vm._inactive || vm._inactive === null) {
- vm._inactive = false;
- for (var i = 0; i < vm.$children.length; i++) {
- activateChildComponent(vm.$children[i]);
- }
- callHook(vm, 'activated');
- }
- }
-
- function deactivateChildComponent (vm, direct) {
- if (direct) {
- vm._directInactive = true;
- if (isInInactiveTree(vm)) {
- return
- }
- }
- if (!vm._inactive) {
- vm._inactive = true;
- for (var i = 0; i < vm.$children.length; i++) {
- deactivateChildComponent(vm.$children[i]);
- }
- callHook(vm, 'deactivated');
- }
- }
-
- function callHook (vm, hook) {
- // #7573 disable dep collection when invoking lifecycle hooks
- pushTarget();
- var handlers = vm.$options[hook];
- var info = hook + " hook";
- if (handlers) {
- for (var i = 0, j = handlers.length; i < j; i++) {
- invokeWithErrorHandling(handlers[i], vm, null, vm, info);
- }
- }
- if (vm._hasHookEvent) {
- vm.$emit('hook:' + hook);
- }
- popTarget();
- }
-
- /* */
-
- var MAX_UPDATE_COUNT = 100;
-
- var queue = [];
- var activatedChildren = [];
- var has = {};
- var circular = {};
- var waiting = false;
- var flushing = false;
- var index = 0;
-
- /**
- * Reset the scheduler's state.
- */
- function resetSchedulerState () {
- index = queue.length = activatedChildren.length = 0;
- has = {};
- {
- circular = {};
- }
- waiting = flushing = false;
- }
-
- // Async edge case #6566 requires saving the timestamp when event listeners are
- // attached. However, calling performance.now() has a perf overhead especially
- // if the page has thousands of event listeners. Instead, we take a timestamp
- // every time the scheduler flushes and use that for all event listeners
- // attached during that flush.
- var currentFlushTimestamp = 0;
-
- // Async edge case fix requires storing an event listener's attach timestamp.
- var getNow = Date.now;
-
- // Determine what event timestamp the browser is using. Annoyingly, the
- // timestamp can either be hi-res (relative to page load) or low-res
- // (relative to UNIX epoch), so in order to compare time we have to use the
- // same timestamp type when saving the flush timestamp.
- // All IE versions use low-res event timestamps, and have problematic clock
- // implementations (#9632)
- if (inBrowser && !isIE) {
- var performance = window.performance;
- if (
- performance &&
- typeof performance.now === 'function' &&
- getNow() > document.createEvent('Event').timeStamp
- ) {
- // if the event timestamp, although evaluated AFTER the Date.now(), is
- // smaller than it, it means the event is using a hi-res timestamp,
- // and we need to use the hi-res version for event listener timestamps as
- // well.
- getNow = function () { return performance.now(); };
- }
- }
-
- /**
- * Flush both queues and run the watchers.
- */
- function flushSchedulerQueue () {
- currentFlushTimestamp = getNow();
- flushing = true;
- var watcher, id;
-
- // Sort queue before flush.
- // This ensures that:
- // 1. Components are updated from parent to child. (because parent is always
- // created before the child)
- // 2. A component's user watchers are run before its render watcher (because
- // user watchers are created before the render watcher)
- // 3. If a component is destroyed during a parent component's watcher run,
- // its watchers can be skipped.
- queue.sort(function (a, b) { return a.id - b.id; });
-
- // do not cache length because more watchers might be pushed
- // as we run existing watchers
- for (index = 0; index < queue.length; index++) {
- watcher = queue[index];
- if (watcher.before) {
- watcher.before();
- }
- id = watcher.id;
- has[id] = null;
- watcher.run();
- // in dev build, check and stop circular updates.
- if (has[id] != null) {
- circular[id] = (circular[id] || 0) + 1;
- if (circular[id] > MAX_UPDATE_COUNT) {
- warn(
- 'You may have an infinite update loop ' + (
- watcher.user
- ? ("in watcher with expression \"" + (watcher.expression) + "\"")
- : "in a component render function."
- ),
- watcher.vm
- );
- break
- }
- }
- }
-
- // keep copies of post queues before resetting state
- var activatedQueue = activatedChildren.slice();
- var updatedQueue = queue.slice();
-
- resetSchedulerState();
-
- // call component updated and activated hooks
- callActivatedHooks(activatedQueue);
- callUpdatedHooks(updatedQueue);
-
- // devtool hook
- /* istanbul ignore if */
- if (devtools && config.devtools) {
- devtools.emit('flush');
- }
- }
-
- function callUpdatedHooks (queue) {
- var i = queue.length;
- while (i--) {
- var watcher = queue[i];
- var vm = watcher.vm;
- if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
- callHook(vm, 'updated');
- }
- }
- }
-
- /**
- * Queue a kept-alive component that was activated during patch.
- * The queue will be processed after the entire tree has been patched.
- */
- function queueActivatedComponent (vm) {
- // setting _inactive to false here so that a render function can
- // rely on checking whether it's in an inactive tree (e.g. router-view)
- vm._inactive = false;
- activatedChildren.push(vm);
- }
-
- function callActivatedHooks (queue) {
- for (var i = 0; i < queue.length; i++) {
- queue[i]._inactive = true;
- activateChildComponent(queue[i], true /* true */);
- }
- }
-
- /**
- * Push a watcher into the watcher queue.
- * Jobs with duplicate IDs will be skipped unless it's
- * pushed when the queue is being flushed.
- */
- function queueWatcher (watcher) {
- var id = watcher.id;
- if (has[id] == null) {
- has[id] = true;
- if (!flushing) {
- queue.push(watcher);
- } else {
- // if already flushing, splice the watcher based on its id
- // if already past its id, it will be run next immediately.
- var i = queue.length - 1;
- while (i > index && queue[i].id > watcher.id) {
- i--;
- }
- queue.splice(i + 1, 0, watcher);
- }
- // queue the flush
- if (!waiting) {
- waiting = true;
-
- if (!config.async) {
- flushSchedulerQueue();
- return
- }
- nextTick(flushSchedulerQueue);
- }
- }
- }
-
- /* */
-
-
-
- var uid$2 = 0;
-
- /**
- * A watcher parses an expression, collects dependencies,
- * and fires callback when the expression value changes.
- * This is used for both the $watch() api and directives.
- */
- var Watcher = function Watcher (
- vm,
- expOrFn,
- cb,
- options,
- isRenderWatcher
- ) {
- this.vm = vm;
- if (isRenderWatcher) {
- vm._watcher = this;
- }
- vm._watchers.push(this);
- // options
- if (options) {
- this.deep = !!options.deep;
- this.user = !!options.user;
- this.lazy = !!options.lazy;
- this.sync = !!options.sync;
- this.before = options.before;
- } else {
- this.deep = this.user = this.lazy = this.sync = false;
- }
- this.cb = cb;
- this.id = ++uid$2; // uid for batching
- this.active = true;
- this.dirty = this.lazy; // for lazy watchers
- this.deps = [];
- this.newDeps = [];
- this.depIds = new _Set();
- this.newDepIds = new _Set();
- this.expression = expOrFn.toString();
- // parse expression for getter
- if (typeof expOrFn === 'function') {
- this.getter = expOrFn;
- } else {
- this.getter = parsePath(expOrFn);
- if (!this.getter) {
- this.getter = noop;
- warn(
- "Failed watching path: \"" + expOrFn + "\" " +
- 'Watcher only accepts simple dot-delimited paths. ' +
- 'For full control, use a function instead.',
- vm
- );
- }
- }
- this.value = this.lazy
- ? undefined
- : this.get();
- };
-
- /**
- * Evaluate the getter, and re-collect dependencies.
- */
- Watcher.prototype.get = function get () {
- pushTarget(this);
- var value;
- var vm = this.vm;
- try {
- value = this.getter.call(vm, vm);
- } catch (e) {
- if (this.user) {
- handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
- } else {
- throw e
- }
- } finally {
- // "touch" every property so they are all tracked as
- // dependencies for deep watching
- if (this.deep) {
- traverse(value);
- }
- popTarget();
- this.cleanupDeps();
- }
- return value
- };
-
- /**
- * Add a dependency to this directive.
- */
- Watcher.prototype.addDep = function addDep (dep) {
- var id = dep.id;
- if (!this.newDepIds.has(id)) {
- this.newDepIds.add(id);
- this.newDeps.push(dep);
- if (!this.depIds.has(id)) {
- dep.addSub(this);
- }
- }
- };
-
- /**
- * Clean up for dependency collection.
- */
- Watcher.prototype.cleanupDeps = function cleanupDeps () {
- var i = this.deps.length;
- while (i--) {
- var dep = this.deps[i];
- if (!this.newDepIds.has(dep.id)) {
- dep.removeSub(this);
- }
- }
- var tmp = this.depIds;
- this.depIds = this.newDepIds;
- this.newDepIds = tmp;
- this.newDepIds.clear();
- tmp = this.deps;
- this.deps = this.newDeps;
- this.newDeps = tmp;
- this.newDeps.length = 0;
- };
-
- /**
- * Subscriber interface.
- * Will be called when a dependency changes.
- */
- Watcher.prototype.update = function update () {
- /* istanbul ignore else */
- if (this.lazy) {
- this.dirty = true;
- } else if (this.sync) {
- this.run();
- } else {
- queueWatcher(this);
- }
- };
-
- /**
- * Scheduler job interface.
- * Will be called by the scheduler.
- */
- Watcher.prototype.run = function run () {
- if (this.active) {
- var value = this.get();
- if (
- value !== this.value ||
- // Deep watchers and watchers on Object/Arrays should fire even
- // when the value is the same, because the value may
- // have mutated.
- isObject(value) ||
- this.deep
- ) {
- // set new value
- var oldValue = this.value;
- this.value = value;
- if (this.user) {
- try {
- this.cb.call(this.vm, value, oldValue);
- } catch (e) {
- handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
- }
- } else {
- this.cb.call(this.vm, value, oldValue);
- }
- }
- }
- };
-
- /**
- * Evaluate the value of the watcher.
- * This only gets called for lazy watchers.
- */
- Watcher.prototype.evaluate = function evaluate () {
- this.value = this.get();
- this.dirty = false;
- };
-
- /**
- * Depend on all deps collected by this watcher.
- */
- Watcher.prototype.depend = function depend () {
- var i = this.deps.length;
- while (i--) {
- this.deps[i].depend();
- }
- };
-
- /**
- * Remove self from all dependencies' subscriber list.
- */
- Watcher.prototype.teardown = function teardown () {
- if (this.active) {
- // remove self from vm's watcher list
- // this is a somewhat expensive operation so we skip it
- // if the vm is being destroyed.
- if (!this.vm._isBeingDestroyed) {
- remove(this.vm._watchers, this);
- }
- var i = this.deps.length;
- while (i--) {
- this.deps[i].removeSub(this);
- }
- this.active = false;
- }
- };
-
- /* */
-
- var sharedPropertyDefinition = {
- enumerable: true,
- configurable: true,
- get: noop,
- set: noop
- };
-
- function proxy (target, sourceKey, key) {
- sharedPropertyDefinition.get = function proxyGetter () {
- return this[sourceKey][key]
- };
- sharedPropertyDefinition.set = function proxySetter (val) {
- this[sourceKey][key] = val;
- };
- Object.defineProperty(target, key, sharedPropertyDefinition);
- }
-
- function initState (vm) {
- vm._watchers = [];
- var opts = vm.$options;
- if (opts.props) { initProps(vm, opts.props); }
- if (opts.methods) { initMethods(vm, opts.methods); }
- if (opts.data) {
- initData(vm);
- } else {
- observe(vm._data = {}, true /* asRootData */);
- }
- if (opts.computed) { initComputed(vm, opts.computed); }
- if (opts.watch && opts.watch !== nativeWatch) {
- initWatch(vm, opts.watch);
- }
- }
-
- function initProps (vm, propsOptions) {
- var propsData = vm.$options.propsData || {};
- var props = vm._props = {};
- // cache prop keys so that future props updates can iterate using Array
- // instead of dynamic object key enumeration.
- var keys = vm.$options._propKeys = [];
- var isRoot = !vm.$parent;
- // root instance props should be converted
- if (!isRoot) {
- toggleObserving(false);
- }
- var loop = function ( key ) {
- keys.push(key);
- var value = validateProp(key, propsOptions, propsData, vm);
- /* istanbul ignore else */
- {
- var hyphenatedKey = hyphenate(key);
- if (isReservedAttribute(hyphenatedKey) ||
- config.isReservedAttr(hyphenatedKey)) {
- warn(
- ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
- vm
- );
- }
- defineReactive$$1(props, key, value, function () {
- if (!isRoot && !isUpdatingChildComponent) {
- warn(
- "Avoid mutating a prop directly since the value will be " +
- "overwritten whenever the parent component re-renders. " +
- "Instead, use a data or computed property based on the prop's " +
- "value. Prop being mutated: \"" + key + "\"",
- vm
- );
- }
- });
- }
- // static props are already proxied on the component's prototype
- // during Vue.extend(). We only need to proxy props defined at
- // instantiation here.
- if (!(key in vm)) {
- proxy(vm, "_props", key);
- }
- };
-
- for (var key in propsOptions) loop( key );
- toggleObserving(true);
- }
-
- function initData (vm) {
- var data = vm.$options.data;
- data = vm._data = typeof data === 'function'
- ? getData(data, vm)
- : data || {};
- if (!isPlainObject(data)) {
- data = {};
- warn(
- 'data functions should return an object:\n' +
- 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
- vm
- );
- }
- // proxy data on instance
- var keys = Object.keys(data);
- var props = vm.$options.props;
- var methods = vm.$options.methods;
- var i = keys.length;
- while (i--) {
- var key = keys[i];
- {
- if (methods && hasOwn(methods, key)) {
- warn(
- ("Method \"" + key + "\" has already been defined as a data property."),
- vm
- );
- }
- }
- if (props && hasOwn(props, key)) {
- warn(
- "The data property \"" + key + "\" is already declared as a prop. " +
- "Use prop default value instead.",
- vm
- );
- } else if (!isReserved(key)) {
- proxy(vm, "_data", key);
- }
- }
- // observe data
- observe(data, true /* asRootData */);
- }
-
- function getData (data, vm) {
- // #7573 disable dep collection when invoking data getters
- pushTarget();
- try {
- return data.call(vm, vm)
- } catch (e) {
- handleError(e, vm, "data()");
- return {}
- } finally {
- popTarget();
- }
- }
-
- var computedWatcherOptions = { lazy: true };
-
- function initComputed (vm, computed) {
- // $flow-disable-line
- var watchers = vm._computedWatchers = Object.create(null);
- // computed properties are just getters during SSR
- var isSSR = isServerRendering();
-
- for (var key in computed) {
- var userDef = computed[key];
- var getter = typeof userDef === 'function' ? userDef : userDef.get;
- if (getter == null) {
- warn(
- ("Getter is missing for computed property \"" + key + "\"."),
- vm
- );
- }
-
- if (!isSSR) {
- // create internal watcher for the computed property.
- watchers[key] = new Watcher(
- vm,
- getter || noop,
- noop,
- computedWatcherOptions
- );
- }
-
- // component-defined computed properties are already defined on the
- // component prototype. We only need to define computed properties defined
- // at instantiation here.
- if (!(key in vm)) {
- defineComputed(vm, key, userDef);
- } else {
- if (key in vm.$data) {
- warn(("The computed property \"" + key + "\" is already defined in data."), vm);
- } else if (vm.$options.props && key in vm.$options.props) {
- warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
- }
- }
- }
- }
-
- function defineComputed (
- target,
- key,
- userDef
- ) {
- var shouldCache = !isServerRendering();
- if (typeof userDef === 'function') {
- sharedPropertyDefinition.get = shouldCache
- ? createComputedGetter(key)
- : createGetterInvoker(userDef);
- sharedPropertyDefinition.set = noop;
- } else {
- sharedPropertyDefinition.get = userDef.get
- ? shouldCache && userDef.cache !== false
- ? createComputedGetter(key)
- : createGetterInvoker(userDef.get)
- : noop;
- sharedPropertyDefinition.set = userDef.set || noop;
- }
- if (sharedPropertyDefinition.set === noop) {
- sharedPropertyDefinition.set = function () {
- warn(
- ("Computed property \"" + key + "\" was assigned to but it has no setter."),
- this
- );
- };
- }
- Object.defineProperty(target, key, sharedPropertyDefinition);
- }
-
- function createComputedGetter (key) {
- return function computedGetter () {
- var watcher = this._computedWatchers && this._computedWatchers[key];
- if (watcher) {
- if (watcher.dirty) {
- watcher.evaluate();
- }
- if (Dep.target) {
- watcher.depend();
- }
- return watcher.value
- }
- }
- }
-
- function createGetterInvoker(fn) {
- return function computedGetter () {
- return fn.call(this, this)
- }
- }
-
- function initMethods (vm, methods) {
- var props = vm.$options.props;
- for (var key in methods) {
- {
- if (typeof methods[key] !== 'function') {
- warn(
- "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
- "Did you reference the function correctly?",
- vm
- );
- }
- if (props && hasOwn(props, key)) {
- warn(
- ("Method \"" + key + "\" has already been defined as a prop."),
- vm
- );
- }
- if ((key in vm) && isReserved(key)) {
- warn(
- "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
- "Avoid defining component methods that start with _ or $."
- );
- }
- }
- vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
- }
- }
-
- function initWatch (vm, watch) {
- for (var key in watch) {
- var handler = watch[key];
- if (Array.isArray(handler)) {
- for (var i = 0; i < handler.length; i++) {
- createWatcher(vm, key, handler[i]);
- }
- } else {
- createWatcher(vm, key, handler);
- }
- }
- }
-
- function createWatcher (
- vm,
- expOrFn,
- handler,
- options
- ) {
- if (isPlainObject(handler)) {
- options = handler;
- handler = handler.handler;
- }
- if (typeof handler === 'string') {
- handler = vm[handler];
- }
- return vm.$watch(expOrFn, handler, options)
- }
-
- function stateMixin (Vue) {
- // flow somehow has problems with directly declared definition object
- // when using Object.defineProperty, so we have to procedurally build up
- // the object here.
- var dataDef = {};
- dataDef.get = function () { return this._data };
- var propsDef = {};
- propsDef.get = function () { return this._props };
- {
- dataDef.set = function () {
- warn(
- 'Avoid replacing instance root $data. ' +
- 'Use nested data properties instead.',
- this
- );
- };
- propsDef.set = function () {
- warn("$props is readonly.", this);
- };
- }
- Object.defineProperty(Vue.prototype, '$data', dataDef);
- Object.defineProperty(Vue.prototype, '$props', propsDef);
-
- Vue.prototype.$set = set;
- Vue.prototype.$delete = del;
-
- Vue.prototype.$watch = function (
- expOrFn,
- cb,
- options
- ) {
- var vm = this;
- if (isPlainObject(cb)) {
- return createWatcher(vm, expOrFn, cb, options)
- }
- options = options || {};
- options.user = true;
- var watcher = new Watcher(vm, expOrFn, cb, options);
- if (options.immediate) {
- try {
- cb.call(vm, watcher.value);
- } catch (error) {
- handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
- }
- }
- return function unwatchFn () {
- watcher.teardown();
- }
- };
- }
-
- /* */
-
- var uid$3 = 0;
-
- function initMixin (Vue) {
- Vue.prototype._init = function (options) {
- var vm = this;
- // a uid
- vm._uid = uid$3++;
-
- var startTag, endTag;
- /* istanbul ignore if */
- if (config.performance && mark) {
- startTag = "vue-perf-start:" + (vm._uid);
- endTag = "vue-perf-end:" + (vm._uid);
- mark(startTag);
- }
-
- // a flag to avoid this being observed
- vm._isVue = true;
- // merge options
- if (options && options._isComponent) {
- // optimize internal component instantiation
- // since dynamic options merging is pretty slow, and none of the
- // internal component options needs special treatment.
- initInternalComponent(vm, options);
- } else {
- vm.$options = mergeOptions(
- resolveConstructorOptions(vm.constructor),
- options || {},
- vm
- );
- }
- /* istanbul ignore else */
- {
- initProxy(vm);
- }
- // expose real self
- vm._self = vm;
- initLifecycle(vm);
- initEvents(vm);
- initRender(vm);
- callHook(vm, 'beforeCreate');
- initInjections(vm); // resolve injections before data/props
- initState(vm);
- initProvide(vm); // resolve provide after data/props
- callHook(vm, 'created');
-
- /* istanbul ignore if */
- if (config.performance && mark) {
- vm._name = formatComponentName(vm, false);
- mark(endTag);
- measure(("vue " + (vm._name) + " init"), startTag, endTag);
- }
-
- if (vm.$options.el) {
- vm.$mount(vm.$options.el);
- }
- };
- }
-
- function initInternalComponent (vm, options) {
- var opts = vm.$options = Object.create(vm.constructor.options);
- // doing this because it's faster than dynamic enumeration.
- var parentVnode = options._parentVnode;
- opts.parent = options.parent;
- opts._parentVnode = parentVnode;
-
- var vnodeComponentOptions = parentVnode.componentOptions;
- opts.propsData = vnodeComponentOptions.propsData;
- opts._parentListeners = vnodeComponentOptions.listeners;
- opts._renderChildren = vnodeComponentOptions.children;
- opts._componentTag = vnodeComponentOptions.tag;
-
- if (options.render) {
- opts.render = options.render;
- opts.staticRenderFns = options.staticRenderFns;
- }
- }
-
- function resolveConstructorOptions (Ctor) {
- var options = Ctor.options;
- if (Ctor.super) {
- var superOptions = resolveConstructorOptions(Ctor.super);
- var cachedSuperOptions = Ctor.superOptions;
- if (superOptions !== cachedSuperOptions) {
- // super option changed,
- // need to resolve new options.
- Ctor.superOptions = superOptions;
- // check if there are any late-modified/attached options (#4976)
- var modifiedOptions = resolveModifiedOptions(Ctor);
- // update base extend options
- if (modifiedOptions) {
- extend(Ctor.extendOptions, modifiedOptions);
- }
- options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
- if (options.name) {
- options.components[options.name] = Ctor;
- }
- }
- }
- return options
- }
-
- function resolveModifiedOptions (Ctor) {
- var modified;
- var latest = Ctor.options;
- var sealed = Ctor.sealedOptions;
- for (var key in latest) {
- if (latest[key] !== sealed[key]) {
- if (!modified) { modified = {}; }
- modified[key] = latest[key];
- }
- }
- return modified
- }
-
- function Vue (options) {
- if (!(this instanceof Vue)
- ) {
- warn('Vue is a constructor and should be called with the `new` keyword');
- }
- this._init(options);
- }
-
- initMixin(Vue);
- stateMixin(Vue);
- eventsMixin(Vue);
- lifecycleMixin(Vue);
- renderMixin(Vue);
-
- /* */
-
- function initUse (Vue) {
- Vue.use = function (plugin) {
- var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
- if (installedPlugins.indexOf(plugin) > -1) {
- return this
- }
-
- // additional parameters
- var args = toArray(arguments, 1);
- args.unshift(this);
- if (typeof plugin.install === 'function') {
- plugin.install.apply(plugin, args);
- } else if (typeof plugin === 'function') {
- plugin.apply(null, args);
- }
- installedPlugins.push(plugin);
- return this
- };
- }
-
- /* */
-
- function initMixin$1 (Vue) {
- Vue.mixin = function (mixin) {
- this.options = mergeOptions(this.options, mixin);
- return this
- };
- }
-
- /* */
-
- function initExtend (Vue) {
- /**
- * Each instance constructor, including Vue, has a unique
- * cid. This enables us to create wrapped "child
- * constructors" for prototypal inheritance and cache them.
- */
- Vue.cid = 0;
- var cid = 1;
-
- /**
- * Class inheritance
- */
- Vue.extend = function (extendOptions) {
- extendOptions = extendOptions || {};
- var Super = this;
- var SuperId = Super.cid;
- var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
- if (cachedCtors[SuperId]) {
- return cachedCtors[SuperId]
- }
-
- var name = extendOptions.name || Super.options.name;
- if (name) {
- validateComponentName(name);
- }
-
- var Sub = function VueComponent (options) {
- this._init(options);
- };
- Sub.prototype = Object.create(Super.prototype);
- Sub.prototype.constructor = Sub;
- Sub.cid = cid++;
- Sub.options = mergeOptions(
- Super.options,
- extendOptions
- );
- Sub['super'] = Super;
-
- // For props and computed properties, we define the proxy getters on
- // the Vue instances at extension time, on the extended prototype. This
- // avoids Object.defineProperty calls for each instance created.
- if (Sub.options.props) {
- initProps$1(Sub);
- }
- if (Sub.options.computed) {
- initComputed$1(Sub);
- }
-
- // allow further extension/mixin/plugin usage
- Sub.extend = Super.extend;
- Sub.mixin = Super.mixin;
- Sub.use = Super.use;
-
- // create asset registers, so extended classes
- // can have their private assets too.
- ASSET_TYPES.forEach(function (type) {
- Sub[type] = Super[type];
- });
- // enable recursive self-lookup
- if (name) {
- Sub.options.components[name] = Sub;
- }
-
- // keep a reference to the super options at extension time.
- // later at instantiation we can check if Super's options have
- // been updated.
- Sub.superOptions = Super.options;
- Sub.extendOptions = extendOptions;
- Sub.sealedOptions = extend({}, Sub.options);
-
- // cache constructor
- cachedCtors[SuperId] = Sub;
- return Sub
- };
- }
-
- function initProps$1 (Comp) {
- var props = Comp.options.props;
- for (var key in props) {
- proxy(Comp.prototype, "_props", key);
- }
- }
-
- function initComputed$1 (Comp) {
- var computed = Comp.options.computed;
- for (var key in computed) {
- defineComputed(Comp.prototype, key, computed[key]);
- }
- }
-
- /* */
-
- function initAssetRegisters (Vue) {
- /**
- * Create asset registration methods.
- */
- ASSET_TYPES.forEach(function (type) {
- Vue[type] = function (
- id,
- definition
- ) {
- if (!definition) {
- return this.options[type + 's'][id]
- } else {
- /* istanbul ignore if */
- if (type === 'component') {
- validateComponentName(id);
- }
- if (type === 'component' && isPlainObject(definition)) {
- definition.name = definition.name || id;
- definition = this.options._base.extend(definition);
- }
- if (type === 'directive' && typeof definition === 'function') {
- definition = { bind: definition, update: definition };
- }
- this.options[type + 's'][id] = definition;
- return definition
- }
- };
- });
- }
-
- /* */
-
-
-
- function getComponentName (opts) {
- return opts && (opts.Ctor.options.name || opts.tag)
- }
-
- function matches (pattern, name) {
- if (Array.isArray(pattern)) {
- return pattern.indexOf(name) > -1
- } else if (typeof pattern === 'string') {
- return pattern.split(',').indexOf(name) > -1
- } else if (isRegExp(pattern)) {
- return pattern.test(name)
- }
- /* istanbul ignore next */
- return false
- }
-
- function pruneCache (keepAliveInstance, filter) {
- var cache = keepAliveInstance.cache;
- var keys = keepAliveInstance.keys;
- var _vnode = keepAliveInstance._vnode;
- for (var key in cache) {
- var cachedNode = cache[key];
- if (cachedNode) {
- var name = getComponentName(cachedNode.componentOptions);
- if (name && !filter(name)) {
- pruneCacheEntry(cache, key, keys, _vnode);
- }
- }
- }
- }
-
- function pruneCacheEntry (
- cache,
- key,
- keys,
- current
- ) {
- var cached$$1 = cache[key];
- if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
- cached$$1.componentInstance.$destroy();
- }
- cache[key] = null;
- remove(keys, key);
- }
-
- var patternTypes = [String, RegExp, Array];
-
- var KeepAlive = {
- name: 'keep-alive',
- abstract: true,
-
- props: {
- include: patternTypes,
- exclude: patternTypes,
- max: [String, Number]
- },
-
- created: function created () {
- this.cache = Object.create(null);
- this.keys = [];
- },
-
- destroyed: function destroyed () {
- for (var key in this.cache) {
- pruneCacheEntry(this.cache, key, this.keys);
- }
- },
-
- mounted: function mounted () {
- var this$1 = this;
-
- this.$watch('include', function (val) {
- pruneCache(this$1, function (name) { return matches(val, name); });
- });
- this.$watch('exclude', function (val) {
- pruneCache(this$1, function (name) { return !matches(val, name); });
- });
- },
-
- render: function render () {
- var slot = this.$slots.default;
- var vnode = getFirstComponentChild(slot);
- var componentOptions = vnode && vnode.componentOptions;
- if (componentOptions) {
- // check pattern
- var name = getComponentName(componentOptions);
- var ref = this;
- var include = ref.include;
- var exclude = ref.exclude;
- if (
- // not included
- (include && (!name || !matches(include, name))) ||
- // excluded
- (exclude && name && matches(exclude, name))
- ) {
- return vnode
- }
-
- var ref$1 = this;
- var cache = ref$1.cache;
- var keys = ref$1.keys;
- var key = vnode.key == null
- // same constructor may get registered as different local components
- // so cid alone is not enough (#3269)
- ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
- : vnode.key;
- if (cache[key]) {
- vnode.componentInstance = cache[key].componentInstance;
- // make current key freshest
- remove(keys, key);
- keys.push(key);
- } else {
- cache[key] = vnode;
- keys.push(key);
- // prune oldest entry
- if (this.max && keys.length > parseInt(this.max)) {
- pruneCacheEntry(cache, keys[0], keys, this._vnode);
- }
- }
-
- vnode.data.keepAlive = true;
- }
- return vnode || (slot && slot[0])
- }
- };
-
- var builtInComponents = {
- KeepAlive: KeepAlive
- };
-
- /* */
-
- function initGlobalAPI (Vue) {
- // config
- var configDef = {};
- configDef.get = function () { return config; };
- {
- configDef.set = function () {
- warn(
- 'Do not replace the Vue.config object, set individual fields instead.'
- );
- };
- }
- Object.defineProperty(Vue, 'config', configDef);
-
- // exposed util methods.
- // NOTE: these are not considered part of the public API - avoid relying on
- // them unless you are aware of the risk.
- Vue.util = {
- warn: warn,
- extend: extend,
- mergeOptions: mergeOptions,
- defineReactive: defineReactive$$1
- };
-
- Vue.set = set;
- Vue.delete = del;
- Vue.nextTick = nextTick;
-
- // 2.6 explicit observable API
- Vue.observable = function (obj) {
- observe(obj);
- return obj
- };
-
- Vue.options = Object.create(null);
- ASSET_TYPES.forEach(function (type) {
- Vue.options[type + 's'] = Object.create(null);
- });
-
- // this is used to identify the "base" constructor to extend all plain-object
- // components with in Weex's multi-instance scenarios.
- Vue.options._base = Vue;
-
- extend(Vue.options.components, builtInComponents);
-
- initUse(Vue);
- initMixin$1(Vue);
- initExtend(Vue);
- initAssetRegisters(Vue);
- }
-
- initGlobalAPI(Vue);
-
- Object.defineProperty(Vue.prototype, '$isServer', {
- get: isServerRendering
- });
-
- Object.defineProperty(Vue.prototype, '$ssrContext', {
- get: function get () {
- /* istanbul ignore next */
- return this.$vnode && this.$vnode.ssrContext
- }
- });
-
- // expose FunctionalRenderContext for ssr runtime helper installation
- Object.defineProperty(Vue, 'FunctionalRenderContext', {
- value: FunctionalRenderContext
- });
-
- Vue.version = '2.6.12';
-
- /* */
-
- // these are reserved for web because they are directly compiled away
- // during template compilation
- var isReservedAttr = makeMap('style,class');
-
- // attributes that should be using props for binding
- var acceptValue = makeMap('input,textarea,option,select,progress');
- var mustUseProp = function (tag, type, attr) {
- return (
- (attr === 'value' && acceptValue(tag)) && type !== 'button' ||
- (attr === 'selected' && tag === 'option') ||
- (attr === 'checked' && tag === 'input') ||
- (attr === 'muted' && tag === 'video')
- )
- };
-
- var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');
-
- var isValidContentEditableValue = makeMap('events,caret,typing,plaintext-only');
-
- var convertEnumeratedValue = function (key, value) {
- return isFalsyAttrValue(value) || value === 'false'
- ? 'false'
- // allow arbitrary string value for contenteditable
- : key === 'contenteditable' && isValidContentEditableValue(value)
- ? value
- : 'true'
- };
-
- var isBooleanAttr = makeMap(
- 'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +
- 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
- 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +
- 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +
- 'required,reversed,scoped,seamless,selected,sortable,translate,' +
- 'truespeed,typemustmatch,visible'
- );
-
- var xlinkNS = 'http://www.w3.org/1999/xlink';
-
- var isXlink = function (name) {
- return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink'
- };
-
- var getXlinkProp = function (name) {
- return isXlink(name) ? name.slice(6, name.length) : ''
- };
-
- var isFalsyAttrValue = function (val) {
- return val == null || val === false
- };
-
- /* */
-
- function genClassForVnode (vnode) {
- var data = vnode.data;
- var parentNode = vnode;
- var childNode = vnode;
- while (isDef(childNode.componentInstance)) {
- childNode = childNode.componentInstance._vnode;
- if (childNode && childNode.data) {
- data = mergeClassData(childNode.data, data);
- }
- }
- while (isDef(parentNode = parentNode.parent)) {
- if (parentNode && parentNode.data) {
- data = mergeClassData(data, parentNode.data);
- }
- }
- return renderClass(data.staticClass, data.class)
- }
-
- function mergeClassData (child, parent) {
- return {
- staticClass: concat(child.staticClass, parent.staticClass),
- class: isDef(child.class)
- ? [child.class, parent.class]
- : parent.class
- }
- }
-
- function renderClass (
- staticClass,
- dynamicClass
- ) {
- if (isDef(staticClass) || isDef(dynamicClass)) {
- return concat(staticClass, stringifyClass(dynamicClass))
- }
- /* istanbul ignore next */
- return ''
- }
-
- function concat (a, b) {
- return a ? b ? (a + ' ' + b) : a : (b || '')
- }
-
- function stringifyClass (value) {
- if (Array.isArray(value)) {
- return stringifyArray(value)
- }
- if (isObject(value)) {
- return stringifyObject(value)
- }
- if (typeof value === 'string') {
- return value
- }
- /* istanbul ignore next */
- return ''
- }
-
- function stringifyArray (value) {
- var res = '';
- var stringified;
- for (var i = 0, l = value.length; i < l; i++) {
- if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
- if (res) { res += ' '; }
- res += stringified;
- }
- }
- return res
- }
-
- function stringifyObject (value) {
- var res = '';
- for (var key in value) {
- if (value[key]) {
- if (res) { res += ' '; }
- res += key;
- }
- }
- return res
- }
-
- /* */
-
- var namespaceMap = {
- svg: 'http://www.w3.org/2000/svg',
- math: 'http://www.w3.org/1998/Math/MathML'
- };
-
- var isHTMLTag = makeMap(
- 'html,body,base,head,link,meta,style,title,' +
- 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +
- 'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' +
- 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +
- 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +
- 'embed,object,param,source,canvas,script,noscript,del,ins,' +
- 'caption,col,colgroup,table,thead,tbody,td,th,tr,' +
- 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +
- 'output,progress,select,textarea,' +
- 'details,dialog,menu,menuitem,summary,' +
- 'content,element,shadow,template,blockquote,iframe,tfoot'
- );
-
- // this map is intentionally selective, only covering SVG elements that may
- // contain child elements.
- var isSVG = makeMap(
- 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' +
- 'foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
- 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',
- true
- );
-
- var isPreTag = function (tag) { return tag === 'pre'; };
-
- var isReservedTag = function (tag) {
- return isHTMLTag(tag) || isSVG(tag)
- };
-
- function getTagNamespace (tag) {
- if (isSVG(tag)) {
- return 'svg'
- }
- // basic support for MathML
- // note it doesn't support other MathML elements being component roots
- if (tag === 'math') {
- return 'math'
- }
- }
-
- var unknownElementCache = Object.create(null);
- function isUnknownElement (tag) {
- /* istanbul ignore if */
- if (!inBrowser) {
- return true
- }
- if (isReservedTag(tag)) {
- return false
- }
- tag = tag.toLowerCase();
- /* istanbul ignore if */
- if (unknownElementCache[tag] != null) {
- return unknownElementCache[tag]
- }
- var el = document.createElement(tag);
- if (tag.indexOf('-') > -1) {
- // http://stackoverflow.com/a/28210364/1070244
- return (unknownElementCache[tag] = (
- el.constructor === window.HTMLUnknownElement ||
- el.constructor === window.HTMLElement
- ))
- } else {
- return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()))
- }
- }
-
- var isTextInputType = makeMap('text,number,password,search,email,tel,url');
-
- /* */
-
- /**
- * Query an element selector if it's not an element already.
- */
- function query (el) {
- if (typeof el === 'string') {
- var selected = document.querySelector(el);
- if (!selected) {
- warn(
- 'Cannot find element: ' + el
- );
- return document.createElement('div')
- }
- return selected
- } else {
- return el
- }
- }
-
- /* */
-
- function createElement$1 (tagName, vnode) {
- var elm = document.createElement(tagName);
- if (tagName !== 'select') {
- return elm
- }
- // false or null will remove the attribute but undefined will not
- if (vnode.data && vnode.data.attrs && vnode.data.attrs.multiple !== undefined) {
- elm.setAttribute('multiple', 'multiple');
- }
- return elm
- }
-
- function createElementNS (namespace, tagName) {
- return document.createElementNS(namespaceMap[namespace], tagName)
- }
-
- function createTextNode (text) {
- return document.createTextNode(text)
- }
-
- function createComment (text) {
- return document.createComment(text)
- }
-
- function insertBefore (parentNode, newNode, referenceNode) {
- parentNode.insertBefore(newNode, referenceNode);
- }
-
- function removeChild (node, child) {
- node.removeChild(child);
- }
-
- function appendChild (node, child) {
- node.appendChild(child);
- }
-
- function parentNode (node) {
- return node.parentNode
- }
-
- function nextSibling (node) {
- return node.nextSibling
- }
-
- function tagName (node) {
- return node.tagName
- }
-
- function setTextContent (node, text) {
- node.textContent = text;
- }
-
- function setStyleScope (node, scopeId) {
- node.setAttribute(scopeId, '');
- }
-
- var nodeOps = /*#__PURE__*/Object.freeze({
- createElement: createElement$1,
- createElementNS: createElementNS,
- createTextNode: createTextNode,
- createComment: createComment,
- insertBefore: insertBefore,
- removeChild: removeChild,
- appendChild: appendChild,
- parentNode: parentNode,
- nextSibling: nextSibling,
- tagName: tagName,
- setTextContent: setTextContent,
- setStyleScope: setStyleScope
- });
-
- /* */
-
- var ref = {
- create: function create (_, vnode) {
- registerRef(vnode);
- },
- update: function update (oldVnode, vnode) {
- if (oldVnode.data.ref !== vnode.data.ref) {
- registerRef(oldVnode, true);
- registerRef(vnode);
- }
- },
- destroy: function destroy (vnode) {
- registerRef(vnode, true);
- }
- };
-
- function registerRef (vnode, isRemoval) {
- var key = vnode.data.ref;
- if (!isDef(key)) { return }
-
- var vm = vnode.context;
- var ref = vnode.componentInstance || vnode.elm;
- var refs = vm.$refs;
- if (isRemoval) {
- if (Array.isArray(refs[key])) {
- remove(refs[key], ref);
- } else if (refs[key] === ref) {
- refs[key] = undefined;
- }
- } else {
- if (vnode.data.refInFor) {
- if (!Array.isArray(refs[key])) {
- refs[key] = [ref];
- } else if (refs[key].indexOf(ref) < 0) {
- // $flow-disable-line
- refs[key].push(ref);
- }
- } else {
- refs[key] = ref;
- }
- }
- }
-
- /**
- * Virtual DOM patching algorithm based on Snabbdom by
- * Simon Friis Vindum (@paldepind)
- * Licensed under the MIT License
- * https://github.com/paldepind/snabbdom/blob/master/LICENSE
- *
- * modified by Evan You (@yyx990803)
- *
- * Not type-checking this because this file is perf-critical and the cost
- * of making flow understand it is not worth it.
- */
-
- var emptyNode = new VNode('', {}, []);
-
- var hooks = ['create', 'activate', 'update', 'remove', 'destroy'];
-
- function sameVnode (a, b) {
- return (
- a.key === b.key && (
- (
- a.tag === b.tag &&
- a.isComment === b.isComment &&
- isDef(a.data) === isDef(b.data) &&
- sameInputType(a, b)
- ) || (
- isTrue(a.isAsyncPlaceholder) &&
- a.asyncFactory === b.asyncFactory &&
- isUndef(b.asyncFactory.error)
- )
- )
- )
- }
-
- function sameInputType (a, b) {
- if (a.tag !== 'input') { return true }
- var i;
- var typeA = isDef(i = a.data) && isDef(i = i.attrs) && i.type;
- var typeB = isDef(i = b.data) && isDef(i = i.attrs) && i.type;
- return typeA === typeB || isTextInputType(typeA) && isTextInputType(typeB)
- }
-
- function createKeyToOldIdx (children, beginIdx, endIdx) {
- var i, key;
- var map = {};
- for (i = beginIdx; i <= endIdx; ++i) {
- key = children[i].key;
- if (isDef(key)) { map[key] = i; }
- }
- return map
- }
-
- function createPatchFunction (backend) {
- var i, j;
- var cbs = {};
-
- var modules = backend.modules;
- var nodeOps = backend.nodeOps;
-
- for (i = 0; i < hooks.length; ++i) {
- cbs[hooks[i]] = [];
- for (j = 0; j < modules.length; ++j) {
- if (isDef(modules[j][hooks[i]])) {
- cbs[hooks[i]].push(modules[j][hooks[i]]);
- }
- }
- }
-
- function emptyNodeAt (elm) {
- return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm)
- }
-
- function createRmCb (childElm, listeners) {
- function remove$$1 () {
- if (--remove$$1.listeners === 0) {
- removeNode(childElm);
- }
- }
- remove$$1.listeners = listeners;
- return remove$$1
- }
-
- function removeNode (el) {
- var parent = nodeOps.parentNode(el);
- // element may have already been removed due to v-html / v-text
- if (isDef(parent)) {
- nodeOps.removeChild(parent, el);
- }
- }
-
- function isUnknownElement$$1 (vnode, inVPre) {
- return (
- !inVPre &&
- !vnode.ns &&
- !(
- config.ignoredElements.length &&
- config.ignoredElements.some(function (ignore) {
- return isRegExp(ignore)
- ? ignore.test(vnode.tag)
- : ignore === vnode.tag
- })
- ) &&
- config.isUnknownElement(vnode.tag)
- )
- }
-
- var creatingElmInVPre = 0;
-
- function createElm (
- vnode,
- insertedVnodeQueue,
- parentElm,
- refElm,
- nested,
- ownerArray,
- index
- ) {
- if (isDef(vnode.elm) && isDef(ownerArray)) {
- // This vnode was used in a previous render!
- // now it's used as a new node, overwriting its elm would cause
- // potential patch errors down the road when it's used as an insertion
- // reference node. Instead, we clone the node on-demand before creating
- // associated DOM element for it.
- vnode = ownerArray[index] = cloneVNode(vnode);
- }
-
- vnode.isRootInsert = !nested; // for transition enter check
- if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {
- return
- }
-
- var data = vnode.data;
- var children = vnode.children;
- var tag = vnode.tag;
- if (isDef(tag)) {
- {
- if (data && data.pre) {
- creatingElmInVPre++;
- }
- if (isUnknownElement$$1(vnode, creatingElmInVPre)) {
- warn(
- 'Unknown custom element: <' + tag + '> - did you ' +
- 'register the component correctly? For recursive components, ' +
- 'make sure to provide the "name" option.',
- vnode.context
- );
- }
- }
-
- vnode.elm = vnode.ns
- ? nodeOps.createElementNS(vnode.ns, tag)
- : nodeOps.createElement(tag, vnode);
- setScope(vnode);
-
- /* istanbul ignore if */
- {
- createChildren(vnode, children, insertedVnodeQueue);
- if (isDef(data)) {
- invokeCreateHooks(vnode, insertedVnodeQueue);
- }
- insert(parentElm, vnode.elm, refElm);
- }
-
- if (data && data.pre) {
- creatingElmInVPre--;
- }
- } else if (isTrue(vnode.isComment)) {
- vnode.elm = nodeOps.createComment(vnode.text);
- insert(parentElm, vnode.elm, refElm);
- } else {
- vnode.elm = nodeOps.createTextNode(vnode.text);
- insert(parentElm, vnode.elm, refElm);
- }
- }
-
- function createComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
- var i = vnode.data;
- if (isDef(i)) {
- var isReactivated = isDef(vnode.componentInstance) && i.keepAlive;
- if (isDef(i = i.hook) && isDef(i = i.init)) {
- i(vnode, false /* hydrating */);
- }
- // after calling the init hook, if the vnode is a child component
- // it should've created a child instance and mounted it. the child
- // component also has set the placeholder vnode's elm.
- // in that case we can just return the element and be done.
- if (isDef(vnode.componentInstance)) {
- initComponent(vnode, insertedVnodeQueue);
- insert(parentElm, vnode.elm, refElm);
- if (isTrue(isReactivated)) {
- reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);
- }
- return true
- }
- }
- }
-
- function initComponent (vnode, insertedVnodeQueue) {
- if (isDef(vnode.data.pendingInsert)) {
- insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);
- vnode.data.pendingInsert = null;
- }
- vnode.elm = vnode.componentInstance.$el;
- if (isPatchable(vnode)) {
- invokeCreateHooks(vnode, insertedVnodeQueue);
- setScope(vnode);
- } else {
- // empty component root.
- // skip all element-related modules except for ref (#3455)
- registerRef(vnode);
- // make sure to invoke the insert hook
- insertedVnodeQueue.push(vnode);
- }
- }
-
- function reactivateComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
- var i;
- // hack for #4339: a reactivated component with inner transition
- // does not trigger because the inner node's created hooks are not called
- // again. It's not ideal to involve module-specific logic in here but
- // there doesn't seem to be a better way to do it.
- var innerNode = vnode;
- while (innerNode.componentInstance) {
- innerNode = innerNode.componentInstance._vnode;
- if (isDef(i = innerNode.data) && isDef(i = i.transition)) {
- for (i = 0; i < cbs.activate.length; ++i) {
- cbs.activate[i](emptyNode, innerNode);
- }
- insertedVnodeQueue.push(innerNode);
- break
- }
- }
- // unlike a newly created component,
- // a reactivated keep-alive component doesn't insert itself
- insert(parentElm, vnode.elm, refElm);
- }
-
- function insert (parent, elm, ref$$1) {
- if (isDef(parent)) {
- if (isDef(ref$$1)) {
- if (nodeOps.parentNode(ref$$1) === parent) {
- nodeOps.insertBefore(parent, elm, ref$$1);
- }
- } else {
- nodeOps.appendChild(parent, elm);
- }
- }
- }
-
- function createChildren (vnode, children, insertedVnodeQueue) {
- if (Array.isArray(children)) {
- {
- checkDuplicateKeys(children);
- }
- for (var i = 0; i < children.length; ++i) {
- createElm(children[i], insertedVnodeQueue, vnode.elm, null, true, children, i);
- }
- } else if (isPrimitive(vnode.text)) {
- nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(String(vnode.text)));
- }
- }
-
- function isPatchable (vnode) {
- while (vnode.componentInstance) {
- vnode = vnode.componentInstance._vnode;
- }
- return isDef(vnode.tag)
- }
-
- function invokeCreateHooks (vnode, insertedVnodeQueue) {
- for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
- cbs.create[i$1](emptyNode, vnode);
- }
- i = vnode.data.hook; // Reuse variable
- if (isDef(i)) {
- if (isDef(i.create)) { i.create(emptyNode, vnode); }
- if (isDef(i.insert)) { insertedVnodeQueue.push(vnode); }
- }
- }
-
- // set scope id attribute for scoped CSS.
- // this is implemented as a special case to avoid the overhead
- // of going through the normal attribute patching process.
- function setScope (vnode) {
- var i;
- if (isDef(i = vnode.fnScopeId)) {
- nodeOps.setStyleScope(vnode.elm, i);
- } else {
- var ancestor = vnode;
- while (ancestor) {
- if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {
- nodeOps.setStyleScope(vnode.elm, i);
- }
- ancestor = ancestor.parent;
- }
- }
- // for slot content they should also get the scopeId from the host instance.
- if (isDef(i = activeInstance) &&
- i !== vnode.context &&
- i !== vnode.fnContext &&
- isDef(i = i.$options._scopeId)
- ) {
- nodeOps.setStyleScope(vnode.elm, i);
- }
- }
-
- function addVnodes (parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {
- for (; startIdx <= endIdx; ++startIdx) {
- createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm, false, vnodes, startIdx);
- }
- }
-
- function invokeDestroyHook (vnode) {
- var i, j;
- var data = vnode.data;
- if (isDef(data)) {
- if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); }
- for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); }
- }
- if (isDef(i = vnode.children)) {
- for (j = 0; j < vnode.children.length; ++j) {
- invokeDestroyHook(vnode.children[j]);
- }
- }
- }
-
- function removeVnodes (vnodes, startIdx, endIdx) {
- for (; startIdx <= endIdx; ++startIdx) {
- var ch = vnodes[startIdx];
- if (isDef(ch)) {
- if (isDef(ch.tag)) {
- removeAndInvokeRemoveHook(ch);
- invokeDestroyHook(ch);
- } else { // Text node
- removeNode(ch.elm);
- }
- }
- }
- }
-
- function removeAndInvokeRemoveHook (vnode, rm) {
- if (isDef(rm) || isDef(vnode.data)) {
- var i;
- var listeners = cbs.remove.length + 1;
- if (isDef(rm)) {
- // we have a recursively passed down rm callback
- // increase the listeners count
- rm.listeners += listeners;
- } else {
- // directly removing
- rm = createRmCb(vnode.elm, listeners);
- }
- // recursively invoke hooks on child component root node
- if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) {
- removeAndInvokeRemoveHook(i, rm);
- }
- for (i = 0; i < cbs.remove.length; ++i) {
- cbs.remove[i](vnode, rm);
- }
- if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) {
- i(vnode, rm);
- } else {
- rm();
- }
- } else {
- removeNode(vnode.elm);
- }
- }
-
- function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {
- var oldStartIdx = 0;
- var newStartIdx = 0;
- var oldEndIdx = oldCh.length - 1;
- var oldStartVnode = oldCh[0];
- var oldEndVnode = oldCh[oldEndIdx];
- var newEndIdx = newCh.length - 1;
- var newStartVnode = newCh[0];
- var newEndVnode = newCh[newEndIdx];
- var oldKeyToIdx, idxInOld, vnodeToMove, refElm;
-
- // removeOnly is a special flag used only by
- // to ensure removed elements stay in correct relative positions
- // during leaving transitions
- var canMove = !removeOnly;
-
- {
- checkDuplicateKeys(newCh);
- }
-
- while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
- if (isUndef(oldStartVnode)) {
- oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left
- } else if (isUndef(oldEndVnode)) {
- oldEndVnode = oldCh[--oldEndIdx];
- } else if (sameVnode(oldStartVnode, newStartVnode)) {
- patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
- oldStartVnode = oldCh[++oldStartIdx];
- newStartVnode = newCh[++newStartIdx];
- } else if (sameVnode(oldEndVnode, newEndVnode)) {
- patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
- oldEndVnode = oldCh[--oldEndIdx];
- newEndVnode = newCh[--newEndIdx];
- } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right
- patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
- canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));
- oldStartVnode = oldCh[++oldStartIdx];
- newEndVnode = newCh[--newEndIdx];
- } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left
- patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
- canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);
- oldEndVnode = oldCh[--oldEndIdx];
- newStartVnode = newCh[++newStartIdx];
- } else {
- if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); }
- idxInOld = isDef(newStartVnode.key)
- ? oldKeyToIdx[newStartVnode.key]
- : findIdxInOld(newStartVnode, oldCh, oldStartIdx, oldEndIdx);
- if (isUndef(idxInOld)) { // New element
- createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
- } else {
- vnodeToMove = oldCh[idxInOld];
- if (sameVnode(vnodeToMove, newStartVnode)) {
- patchVnode(vnodeToMove, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
- oldCh[idxInOld] = undefined;
- canMove && nodeOps.insertBefore(parentElm, vnodeToMove.elm, oldStartVnode.elm);
- } else {
- // same key but different element. treat as new element
- createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
- }
- }
- newStartVnode = newCh[++newStartIdx];
- }
- }
- if (oldStartIdx > oldEndIdx) {
- refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
- addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
- } else if (newStartIdx > newEndIdx) {
- removeVnodes(oldCh, oldStartIdx, oldEndIdx);
- }
- }
-
- function checkDuplicateKeys (children) {
- var seenKeys = {};
- for (var i = 0; i < children.length; i++) {
- var vnode = children[i];
- var key = vnode.key;
- if (isDef(key)) {
- if (seenKeys[key]) {
- warn(
- ("Duplicate keys detected: '" + key + "'. This may cause an update error."),
- vnode.context
- );
- } else {
- seenKeys[key] = true;
- }
- }
- }
- }
-
- function findIdxInOld (node, oldCh, start, end) {
- for (var i = start; i < end; i++) {
- var c = oldCh[i];
- if (isDef(c) && sameVnode(node, c)) { return i }
- }
- }
-
- function patchVnode (
- oldVnode,
- vnode,
- insertedVnodeQueue,
- ownerArray,
- index,
- removeOnly
- ) {
- if (oldVnode === vnode) {
- return
- }
-
- if (isDef(vnode.elm) && isDef(ownerArray)) {
- // clone reused vnode
- vnode = ownerArray[index] = cloneVNode(vnode);
- }
-
- var elm = vnode.elm = oldVnode.elm;
-
- if (isTrue(oldVnode.isAsyncPlaceholder)) {
- if (isDef(vnode.asyncFactory.resolved)) {
- hydrate(oldVnode.elm, vnode, insertedVnodeQueue);
- } else {
- vnode.isAsyncPlaceholder = true;
- }
- return
- }
-
- // reuse element for static trees.
- // note we only do this if the vnode is cloned -
- // if the new node is not cloned it means the render functions have been
- // reset by the hot-reload-api and we need to do a proper re-render.
- if (isTrue(vnode.isStatic) &&
- isTrue(oldVnode.isStatic) &&
- vnode.key === oldVnode.key &&
- (isTrue(vnode.isCloned) || isTrue(vnode.isOnce))
- ) {
- vnode.componentInstance = oldVnode.componentInstance;
- return
- }
-
- var i;
- var data = vnode.data;
- if (isDef(data) && isDef(i = data.hook) && isDef(i = i.prepatch)) {
- i(oldVnode, vnode);
- }
-
- var oldCh = oldVnode.children;
- var ch = vnode.children;
- if (isDef(data) && isPatchable(vnode)) {
- for (i = 0; i < cbs.update.length; ++i) { cbs.update[i](oldVnode, vnode); }
- if (isDef(i = data.hook) && isDef(i = i.update)) { i(oldVnode, vnode); }
- }
- if (isUndef(vnode.text)) {
- if (isDef(oldCh) && isDef(ch)) {
- if (oldCh !== ch) { updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); }
- } else if (isDef(ch)) {
- {
- checkDuplicateKeys(ch);
- }
- if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }
- addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
- } else if (isDef(oldCh)) {
- removeVnodes(oldCh, 0, oldCh.length - 1);
- } else if (isDef(oldVnode.text)) {
- nodeOps.setTextContent(elm, '');
- }
- } else if (oldVnode.text !== vnode.text) {
- nodeOps.setTextContent(elm, vnode.text);
- }
- if (isDef(data)) {
- if (isDef(i = data.hook) && isDef(i = i.postpatch)) { i(oldVnode, vnode); }
- }
- }
-
- function invokeInsertHook (vnode, queue, initial) {
- // delay insert hooks for component root nodes, invoke them after the
- // element is really inserted
- if (isTrue(initial) && isDef(vnode.parent)) {
- vnode.parent.data.pendingInsert = queue;
- } else {
- for (var i = 0; i < queue.length; ++i) {
- queue[i].data.hook.insert(queue[i]);
- }
- }
- }
-
- var hydrationBailed = false;
- // list of modules that can skip create hook during hydration because they
- // are already rendered on the client or has no need for initialization
- // Note: style is excluded because it relies on initial clone for future
- // deep updates (#7063).
- var isRenderedModule = makeMap('attrs,class,staticClass,staticStyle,key');
-
- // Note: this is a browser-only function so we can assume elms are DOM nodes.
- function hydrate (elm, vnode, insertedVnodeQueue, inVPre) {
- var i;
- var tag = vnode.tag;
- var data = vnode.data;
- var children = vnode.children;
- inVPre = inVPre || (data && data.pre);
- vnode.elm = elm;
-
- if (isTrue(vnode.isComment) && isDef(vnode.asyncFactory)) {
- vnode.isAsyncPlaceholder = true;
- return true
- }
- // assert node match
- {
- if (!assertNodeMatch(elm, vnode, inVPre)) {
- return false
- }
- }
- if (isDef(data)) {
- if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode, true /* hydrating */); }
- if (isDef(i = vnode.componentInstance)) {
- // child component. it should have hydrated its own tree.
- initComponent(vnode, insertedVnodeQueue);
- return true
- }
- }
- if (isDef(tag)) {
- if (isDef(children)) {
- // empty element, allow client to pick up and populate children
- if (!elm.hasChildNodes()) {
- createChildren(vnode, children, insertedVnodeQueue);
- } else {
- // v-html and domProps: innerHTML
- if (isDef(i = data) && isDef(i = i.domProps) && isDef(i = i.innerHTML)) {
- if (i !== elm.innerHTML) {
- /* istanbul ignore if */
- if (typeof console !== 'undefined' &&
- !hydrationBailed
- ) {
- hydrationBailed = true;
- console.warn('Parent: ', elm);
- console.warn('server innerHTML: ', i);
- console.warn('client innerHTML: ', elm.innerHTML);
- }
- return false
- }
- } else {
- // iterate and compare children lists
- var childrenMatch = true;
- var childNode = elm.firstChild;
- for (var i$1 = 0; i$1 < children.length; i$1++) {
- if (!childNode || !hydrate(childNode, children[i$1], insertedVnodeQueue, inVPre)) {
- childrenMatch = false;
- break
- }
- childNode = childNode.nextSibling;
- }
- // if childNode is not null, it means the actual childNodes list is
- // longer than the virtual children list.
- if (!childrenMatch || childNode) {
- /* istanbul ignore if */
- if (typeof console !== 'undefined' &&
- !hydrationBailed
- ) {
- hydrationBailed = true;
- console.warn('Parent: ', elm);
- console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children);
- }
- return false
- }
- }
- }
- }
- if (isDef(data)) {
- var fullInvoke = false;
- for (var key in data) {
- if (!isRenderedModule(key)) {
- fullInvoke = true;
- invokeCreateHooks(vnode, insertedVnodeQueue);
- break
- }
- }
- if (!fullInvoke && data['class']) {
- // ensure collecting deps for deep class bindings for future updates
- traverse(data['class']);
- }
- }
- } else if (elm.data !== vnode.text) {
- elm.data = vnode.text;
- }
- return true
- }
-
- function assertNodeMatch (node, vnode, inVPre) {
- if (isDef(vnode.tag)) {
- return vnode.tag.indexOf('vue-component') === 0 || (
- !isUnknownElement$$1(vnode, inVPre) &&
- vnode.tag.toLowerCase() === (node.tagName && node.tagName.toLowerCase())
- )
- } else {
- return node.nodeType === (vnode.isComment ? 8 : 3)
- }
- }
-
- return function patch (oldVnode, vnode, hydrating, removeOnly) {
- if (isUndef(vnode)) {
- if (isDef(oldVnode)) { invokeDestroyHook(oldVnode); }
- return
- }
-
- var isInitialPatch = false;
- var insertedVnodeQueue = [];
-
- if (isUndef(oldVnode)) {
- // empty mount (likely as component), create new root element
- isInitialPatch = true;
- createElm(vnode, insertedVnodeQueue);
- } else {
- var isRealElement = isDef(oldVnode.nodeType);
- if (!isRealElement && sameVnode(oldVnode, vnode)) {
- // patch existing root node
- patchVnode(oldVnode, vnode, insertedVnodeQueue, null, null, removeOnly);
- } else {
- if (isRealElement) {
- // mounting to a real element
- // check if this is server-rendered content and if we can perform
- // a successful hydration.
- if (oldVnode.nodeType === 1 && oldVnode.hasAttribute(SSR_ATTR)) {
- oldVnode.removeAttribute(SSR_ATTR);
- hydrating = true;
- }
- if (isTrue(hydrating)) {
- if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {
- invokeInsertHook(vnode, insertedVnodeQueue, true);
- return oldVnode
- } else {
- warn(
- 'The client-side rendered virtual DOM tree is not matching ' +
- 'server-rendered content. This is likely caused by incorrect ' +
- 'HTML markup, for example nesting block-level elements inside ' +
- ', or missing
. Bailing hydration and performing ' +
- 'full client-side render.'
- );
- }
- }
- // either not server-rendered, or hydration failed.
- // create an empty node and replace it
- oldVnode = emptyNodeAt(oldVnode);
- }
-
- // replacing existing element
- var oldElm = oldVnode.elm;
- var parentElm = nodeOps.parentNode(oldElm);
-
- // create new node
- createElm(
- vnode,
- insertedVnodeQueue,
- // extremely rare edge case: do not insert if old element is in a
- // leaving transition. Only happens when combining transition +
- // keep-alive + HOCs. (#4590)
- oldElm._leaveCb ? null : parentElm,
- nodeOps.nextSibling(oldElm)
- );
-
- // update parent placeholder node element, recursively
- if (isDef(vnode.parent)) {
- var ancestor = vnode.parent;
- var patchable = isPatchable(vnode);
- while (ancestor) {
- for (var i = 0; i < cbs.destroy.length; ++i) {
- cbs.destroy[i](ancestor);
- }
- ancestor.elm = vnode.elm;
- if (patchable) {
- for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
- cbs.create[i$1](emptyNode, ancestor);
- }
- // #6513
- // invoke insert hooks that may have been merged by create hooks.
- // e.g. for directives that uses the "inserted" hook.
- var insert = ancestor.data.hook.insert;
- if (insert.merged) {
- // start at index 1 to avoid re-invoking component mounted hook
- for (var i$2 = 1; i$2 < insert.fns.length; i$2++) {
- insert.fns[i$2]();
- }
- }
- } else {
- registerRef(ancestor);
- }
- ancestor = ancestor.parent;
- }
- }
-
- // destroy old node
- if (isDef(parentElm)) {
- removeVnodes([oldVnode], 0, 0);
- } else if (isDef(oldVnode.tag)) {
- invokeDestroyHook(oldVnode);
- }
- }
- }
-
- invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);
- return vnode.elm
- }
- }
-
- /* */
-
- var directives = {
- create: updateDirectives,
- update: updateDirectives,
- destroy: function unbindDirectives (vnode) {
- updateDirectives(vnode, emptyNode);
- }
- };
-
- function updateDirectives (oldVnode, vnode) {
- if (oldVnode.data.directives || vnode.data.directives) {
- _update(oldVnode, vnode);
- }
- }
-
- function _update (oldVnode, vnode) {
- var isCreate = oldVnode === emptyNode;
- var isDestroy = vnode === emptyNode;
- var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context);
- var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context);
-
- var dirsWithInsert = [];
- var dirsWithPostpatch = [];
-
- var key, oldDir, dir;
- for (key in newDirs) {
- oldDir = oldDirs[key];
- dir = newDirs[key];
- if (!oldDir) {
- // new directive, bind
- callHook$1(dir, 'bind', vnode, oldVnode);
- if (dir.def && dir.def.inserted) {
- dirsWithInsert.push(dir);
- }
- } else {
- // existing directive, update
- dir.oldValue = oldDir.value;
- dir.oldArg = oldDir.arg;
- callHook$1(dir, 'update', vnode, oldVnode);
- if (dir.def && dir.def.componentUpdated) {
- dirsWithPostpatch.push(dir);
- }
- }
- }
-
- if (dirsWithInsert.length) {
- var callInsert = function () {
- for (var i = 0; i < dirsWithInsert.length; i++) {
- callHook$1(dirsWithInsert[i], 'inserted', vnode, oldVnode);
- }
- };
- if (isCreate) {
- mergeVNodeHook(vnode, 'insert', callInsert);
- } else {
- callInsert();
- }
- }
-
- if (dirsWithPostpatch.length) {
- mergeVNodeHook(vnode, 'postpatch', function () {
- for (var i = 0; i < dirsWithPostpatch.length; i++) {
- callHook$1(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode);
- }
- });
- }
-
- if (!isCreate) {
- for (key in oldDirs) {
- if (!newDirs[key]) {
- // no longer present, unbind
- callHook$1(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy);
- }
- }
- }
- }
-
- var emptyModifiers = Object.create(null);
-
- function normalizeDirectives$1 (
- dirs,
- vm
- ) {
- var res = Object.create(null);
- if (!dirs) {
- // $flow-disable-line
- return res
- }
- var i, dir;
- for (i = 0; i < dirs.length; i++) {
- dir = dirs[i];
- if (!dir.modifiers) {
- // $flow-disable-line
- dir.modifiers = emptyModifiers;
- }
- res[getRawDirName(dir)] = dir;
- dir.def = resolveAsset(vm.$options, 'directives', dir.name, true);
- }
- // $flow-disable-line
- return res
- }
-
- function getRawDirName (dir) {
- return dir.rawName || ((dir.name) + "." + (Object.keys(dir.modifiers || {}).join('.')))
- }
-
- function callHook$1 (dir, hook, vnode, oldVnode, isDestroy) {
- var fn = dir.def && dir.def[hook];
- if (fn) {
- try {
- fn(vnode.elm, dir, vnode, oldVnode, isDestroy);
- } catch (e) {
- handleError(e, vnode.context, ("directive " + (dir.name) + " " + hook + " hook"));
- }
- }
- }
-
- var baseModules = [
- ref,
- directives
- ];
-
- /* */
-
- function updateAttrs (oldVnode, vnode) {
- var opts = vnode.componentOptions;
- if (isDef(opts) && opts.Ctor.options.inheritAttrs === false) {
- return
- }
- if (isUndef(oldVnode.data.attrs) && isUndef(vnode.data.attrs)) {
- return
- }
- var key, cur, old;
- var elm = vnode.elm;
- var oldAttrs = oldVnode.data.attrs || {};
- var attrs = vnode.data.attrs || {};
- // clone observed objects, as the user probably wants to mutate it
- if (isDef(attrs.__ob__)) {
- attrs = vnode.data.attrs = extend({}, attrs);
- }
-
- for (key in attrs) {
- cur = attrs[key];
- old = oldAttrs[key];
- if (old !== cur) {
- setAttr(elm, key, cur);
- }
- }
- // #4391: in IE9, setting type can reset value for input[type=radio]
- // #6666: IE/Edge forces progress value down to 1 before setting a max
- /* istanbul ignore if */
- if ((isIE || isEdge) && attrs.value !== oldAttrs.value) {
- setAttr(elm, 'value', attrs.value);
- }
- for (key in oldAttrs) {
- if (isUndef(attrs[key])) {
- if (isXlink(key)) {
- elm.removeAttributeNS(xlinkNS, getXlinkProp(key));
- } else if (!isEnumeratedAttr(key)) {
- elm.removeAttribute(key);
- }
- }
- }
- }
-
- function setAttr (el, key, value) {
- if (el.tagName.indexOf('-') > -1) {
- baseSetAttr(el, key, value);
- } else if (isBooleanAttr(key)) {
- // set attribute for blank value
- // e.g.
- if (isFalsyAttrValue(value)) {
- el.removeAttribute(key);
- } else {
- // technically allowfullscreen is a boolean attribute for