Definition
-- @/=[C]:-1
function format(...)
Callers
@/lua/ge/extensions/editor/flowgraph/main.lua
ui_flowgraph_editor.setViewState(graph.viewPos, graph.viewZoom)
--print(string.format(graph.name.. " Restoring View to: %d %d / %0.2f", graph.viewPos[0].x, graph.viewPos[1].y, graph.viewZoom[0]))
else
--if o1 ~= graph.viewPos[0].x or o2 ~= graph.viewPos[0].y or o3 ~= graph.viewZoom[0] then
-- print(string.format(graph.name.." Saved View to: %d %d / %0.2f", graph.viewPos[0].x, graph.viewPos[1].y, graph.viewZoom[0]))
--end
graph.viewZoom[0] = 1
print(string.format("Restoring to: %d %d / %0.2f", graph.viewPos[0].x, graph.viewPos[1].y, graph.viewZoom[0]))
ui_flowgraph_editor.setViewState(graph.viewPos, graph.viewZoom)
local txt = n
if editor.getPreference("flowgraph.debug.displayIds") then txt = string.format("[%d] " .. n, lIds[i]) end
local cursor = im.GetCursorPos()
local txt = sib.name
if editor.getPreference("flowgraph.debug.displayIds") then txt = string.format("[%d] " .. sib.name, sib.id) end
if im.Selectable1(txt) then
im.Text(string.format("Lows: %d/%d | Highs: %d", self.mgr.__graphNodeOffset or 0, self.mgr.__nextFreeGraphNodeStart or 0, -1*((2^29) - (self.mgr.__nextFreePinLinkStart or 2^29))))
if im.IsItemClicked() then
table.sort(nIds[b])
dump(string.format("%ders: %s", (b-1)*100, table.concat(nIds[b],", ")))
end
@/lua/ge/extensions/editor/rendererComponents.lua
else
return string.format('%f', tempFloatPtr[0])
end
else
return string.format('%f %f %f', tempFloatArr3[0], tempFloatArr3[1], tempFloatArr3[2])
end
else
return string.format('%f %f %f %f', tempFloatArr4[0], tempFloatArr4[1], tempFloatArr4[2], tempFloatArr4[3])
end
if field.format then
im.TextUnformatted(string.format(field.format, value))
else
local inFocusWidth = (aperture / math.max(steepness, 0.01))
im.TextUnformatted(string.format("Estimated In-Focus Width: %.2f units", inFocusWidth))
if im.Button("Reset to defaults") then
@/lua/ge/extensions/flowgraph/nodes/ui/endScreen.lua
local seconds = statsData.time - (minutes * 60)
statsData.time = string.format("%02.0f:%05.2f", minutes, seconds)
end
if type(c.new) == 'number' then
statsData.text = statsData.text .. string.format("%s: %0.2d -> %0.2d", c.key, c.old, c.new)
else
else
statsData.text = statsData.text .. string.format("%s: %s -> %s", c.key, c.old, c.new)
end
@/lua/ge/extensions/util/procTrack.lua
end
--log("I",logTag,"Total length of track is " ..string.format("%.2f", length).." meters.")
--log("I",logTag,"Track has "..#nodes .. " keypoints: " .. straights .. " straights ("..gates.." gates), " .. (lefts+rights) .. " curves ("..lefts.." left, ".. rights.. " right), of which "..loops .. " are looped.")
@/lua/ge/extensions/editor/drivePathEditor.lua
if vehicle then
im.Text(string.format('Linked To Vehicle: [%s]', vehicle.name))
else
im.SameLine()
im.Text(string.format('[%s]', linkedSpline.name))
else
im.SameLine()
im.Text(string.format('[time: %.2fs]', record.getRecordingTime()))
elseif isPlaying then
im.SameLine()
im.Text(string.format('[time: %.2fs]', playback.getPlaybackTime()))
else
@/inspector/Views/ConsoleSession.js
let timestamp = data.timestamp || Date.now();
header.textContent = headerText.format(new Date(timestamp).toLocaleTimeString());
element.append(header);
@/lua/common/jsonDebug.lua
if curlen >= i then
error(string.format("%s near line %d, '%s'",msg, n, w:match'^%s*(.*%S)' or ''))
end
if curlen >= i then
table.insert(warnings, string.format("%s: %s near line %d, '%s'", ctx, msg, n, w:match'^%s*(.*%S)' or ''))
return
local pm = byte(s, si - 1)
jsonError(string.format("Invalid number: '%s'", sub(s, si - ((pm == 45 or pm == 43) and 1 or 0), infend)), si)
end
local pm = byte(s, si - 1)
jsonError(string.format("Invalid number: '%s'", sub(s, si - ((pm == 45 or pm == 43) and 1 or 0), i-1)), si)
end
if i < si then
jsonError(string.format("Expected dictionary key"), i)
end
if c ~= 58 and c ~= 61 then -- : =
jsonError(string.format("Expected dictionary separator ':' or '=' instead of: '%s'", string.char(c)), i - 1)
end
if result[key] then
jsonWarning(string.format("Duplicate key found: '%s'", key), i)
end
if result[key] then
jsonWarning(string.format("Duplicate key found: '%s'", key), i)
end
@/lua/ge/extensions/gameplay/drag/times.lua
local function velocityInAllUnits(speed)
return string.format("%0.2fmph | %0.2fkm/h", speed * 2.23694, speed * 3.6)
end
if addFrameHistoryDebug[timerName] and not timer.isSet and timer.type == "distanceTimer" then
--print(string.format("Tracking times for racer: %d for timer: %s", racer.vehId, timerName))
timer.frameHistory[#timer.frameHistory+1] = string.format("Racer: %d Frame %d: %0.5fs after start. Distance: %0.4fm (before: %0.4fm). Frame duration: %0.5fs", racer.vehId, #timer.frameHistory+1, timerValue, distanceFromOrigin, prevDistance, dtSim)
--print(string.format("Tracking times for racer: %d for timer: %s", racer.vehId, timerName))
timer.frameHistory[#timer.frameHistory+1] = string.format("Racer: %d Frame %d: %0.5fs after start. Distance: %0.4fm (before: %0.4fm). Frame duration: %0.5fs", racer.vehId, #timer.frameHistory+1, timerValue, distanceFromOrigin, prevDistance, dtSim)
end
if addFrameHistoryDebug[timerName] and timer.type == "distanceTimer" then
timer.frameHistory[#timer.frameHistory+1] = string.format("Racer: %d Went over threshold at %0.5fs (%d%% of this frames duration plus the previous frames) (so between frame %d and %d)", racer.vehId, timer.value, t*100, #timer.frameHistory-1, #timer.frameHistory)
-- for _, frame in pairs(timer.frameHistory) do
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/vePartTree.lua
beamCenterPos:setAdd(p1)
local text = string.format("%s - %s", node1.name or node1.cid, node2.name or node2.cid)
debugDrawer:drawTextAdvanced(beamCenterPos, text, textCol, true, false, textBgCol, false, false)
-- Highlight beam
local text = string.format("%s - %s", chosenBeamNode1.name or chosenBeamNode1.cid, chosenBeamNode2.name or chosenBeamNode2.cid)
@/lua/ge/extensions/editor/dynamicDecals/layerTypes/path.lua
if editor.uiInputText(
string.format("##%s_%s_%s", layer.uid, guiId, "layerName"),
editor.getTempCharPtr(layer.name),
im.NextColumn()
if im.Checkbox(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_enabled"), editor.getTempBool_BoolBool(layer.enabled)) then
layer.enabled = editor.getTempBool_BoolBool()
im.NextColumn()
im.TextUnformatted(string.format("%s layer", api.layerTypesMap[layer.type]))
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.InputFloat3(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_camPosition"), editor.getTempFloatArray3_Vec3Vec3(layer.camPosition), "%.6f") then
layer.camPosition = editor.getTempFloatArray3_Vec3Vec3()
im.PushItemWidth(im.GetContentRegionAvailWidth() - ((layer.colorPaletteMapId > 0) and (im.GetStyle().ItemSpacing.x + math.ceil(im.GetFontSize()) + 2 * im.GetStyle().FramePadding.y) or 0))
if im.Combo2(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_colorpalettemapid"), editor.getTempInt_NumberNumber(layer.colorPaletteMapId), "zero\0one\0two\0three\0\0") then
layer.colorPaletteMapId = editor.getTempInt_NumberNumber()
im.SameLine()
im.ColorButton(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_colorpalettemapidbutton"), editor.getTempImVec4_TableTable(col))
im.tooltip("Vehicle color palette color")
im.NextColumn()
if im.Checkbox(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_decalUseGradientColor"), editor.getTempBool_BoolBool(layer.decalUseGradientColor)) then
layer.decalUseGradientColor = editor.getTempBool_BoolBool()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiColorEdit4(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_color"), editor.getTempFloatArray4_TableTable(layer.color:toTable()), nil, editor.getTempBool_BoolBool(false)) then
layer.color = Point4F.fromTable(editor.getTempFloatArray4_TableTable())
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat3(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_decalScale"), editor.getTempFloatArray3_Vec3Vec3(layer.decalScale), 0.05, 6.0, nil, nil, editor.getTempBool_BoolBool(false)) then
layer.decalScale = editor.getTempFloatArray3_Vec3Vec3()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_decalRotation"), editor.getTempFloat_NumberNumber(layer.decalRotation * 180 / math.pi), 0, 360, nil, nil, editor.getTempBool_BoolBool(false)) then
layer.decalRotation = (editor.getTempFloat_NumberNumber() / 180 * math.pi)
im.NextColumn()
if im.Checkbox(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_orientPathDecals"), editor.getTempBool_BoolBool(layer.orientDecals)) then
layer.orientDecals = editor.getTempBool_BoolBool()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.Combo2(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_pathType"), editor.getTempInt_NumberNumber(layer.pathType), "Linear\0Bezier\0\0") then
layer.pathType = editor.getTempInt_NumberNumber()
if editor.uiInputText(
string.format("##%s_%s_%s", layer.uid, guiId, "inspector_pathLayerText"),
editor.getTempCharPtr(layer.text),
im.SameLine()
if editor.uiIconImageButton(editor.icons.folder, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("##%s_%s_%s", layer.uid, guiId, "pathLayerFontPath_fileDialog")) then
editor_fileDialog.openFile(
im.SameLine()
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("##%s_%s_%s", layer.uid, guiId, "pathLayerFontPath_removeButton")) then
layer.fontPath = editor.getTempCharPtr()
if #layer.text > 0 then im.BeginDisabled() end
if editor.uiInputInt(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_interpolationSteps"), editor.getTempInt_NumberNumber(layer.interpolationSteps), 1, 2) then
local value = editor.getTempInt_NumberNumber()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat2(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_decalSkew"), editor.getTempFloatArray2_TableTable({layer.decalSkew.x, layer.decalSkew.y}), -2.0, 2.0, nil, nil, editor.getTempBool_BoolBool(false)) then
local value = editor.getTempFloatArray2_TableTable()
im.NextColumn()
if im.Checkbox(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_mirrored"), editor.getTempBool_BoolBool(layer.mirrored)) then
layer.mirrored = editor.getTempBool_BoolBool()
im.NextColumn()
if im.Checkbox(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_flipMirroredDecal"), editor.getTempBool_BoolBool(layer.flipMirroredDecal)) then
layer.flipMirroredDecal = editor.getTempBool_BoolBool()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat2(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_colorTextureScale"), editor.getTempFloatArray2_TableTable({layer.colorTextureScale.x, layer.colorTextureScale.y}), 0.01, 6.0, nil, nil, editor.getTempBool_BoolBool(false)) then
local value = editor.getTempFloatArray2_TableTable()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.Combo2(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_alphaMaskChannel"), editor.getTempInt_NumberNumber(layer.alphaMaskChannel), "red\0green\0blue\0alpha\0\0") then
layer.alphaMaskChannel = editor.getTempInt_NumberNumber()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.Combo2(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_alphaMaskBlendMode"), editor.getTempInt_NumberNumber(layer.alphaMaskBlendMode), "multiply\0add\0\0") then
layer.alphaMaskBlendMode = editor.getTempInt_NumberNumber()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat2(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_alphaMaskScale"), editor.getTempFloatArray2_TableTable({layer.alphaMaskScale.x, layer.alphaMaskScale.y}), 0.01, 6.0, nil, nil, editor.getTempBool_BoolBool(false)) then
local value = editor.getTempFloatArray2_TableTable()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_alphaMaskRotation"), editor.getTempFloat_NumberNumber(layer.alphaMaskRotation * 180 / math.pi), 0, 360, nil, nil, editor.getTempBool_BoolBool(false)) then
layer.alphaMaskRotation = (editor.getTempFloat_NumberNumber() / 180 * math.pi)
local val = 0
if editor.uiSliderFloat(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_alphaMaskIntensity"), editor.getTempFloat_NumberNumber(layer.alphaMaskIntensity), 0.0, 2.0, "%.2f", nil, editor.getTempBool_BoolBool(false)) then
layer.alphaMaskIntensity = editor.getTempFloat_NumberNumber()
im.NextColumn()
if im.Checkbox(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_wrapAlphaMaskX"), editor.getTempBool_BoolBool(layer.wrapAlphaMaskX)) then
layer.wrapAlphaMaskX = editor.getTempBool_BoolBool()
im.NextColumn()
if im.Checkbox(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_wrapAlphaMaskY"), editor.getTempBool_BoolBool(layer.wrapAlphaMaskY)) then
layer.wrapAlphaMaskY = editor.getTempBool_BoolBool()
im.NextColumn()
if im.Checkbox(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_wrapColorTextureX"), editor.getTempBool_BoolBool(layer.wrapColorTextureX)) then
layer.wrapColorTextureX = editor.getTempBool_BoolBool()
im.NextColumn()
if im.Checkbox(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_wrapColorTextureY"), editor.getTempBool_BoolBool(layer.wrapColorTextureY)) then
layer.wrapColorTextureY = editor.getTempBool_BoolBool()
im.NextColumn()
if im.Checkbox(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_alphaMaskInvert"), editor.getTempBool_BoolBool(layer.alphaMaskInvert)) then
layer.alphaMaskInvert = editor.getTempBool_BoolBool()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_sdfThickness"), editor.getTempFloat_NumberNumber(layer.sdfThickness), 0.0, 1.0, "%.2f", nil, editor.getTempBool_BoolBool(false)) then
layer.sdfThickness = editor.getTempFloat_NumberNumber()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_sdfSoftness"), editor.getTempFloat_NumberNumber(layer.sdfSoftness), 0.0, 1.0, "%.2f", nil, editor.getTempBool_BoolBool(false)) then
layer.sdfSoftness = editor.getTempFloat_NumberNumber()
local sdfOutlineColorTbl = layer.sdfOutlineColor:toTable()
if editor.uiColorEdit4(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_sdfOutlineColor"), editor.getTempFloatArray3_TableTable({sdfOutlineColorTbl[1]/255, sdfOutlineColorTbl[2]/255, sdfOutlineColorTbl[3]/255}), nil, editor.getTempBool_BoolBool(false)) then
local value = editor.getTempFloatArray3_TableTable()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_sdfOutlineThickness"), editor.getTempFloat_NumberNumber(layer.sdfOutlineThickness), 0.0, 1.0, "%.2f", nil, editor.getTempBool_BoolBool(false)) then
layer.sdfOutlineThickness = editor.getTempFloat_NumberNumber()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_sdfOutlineSoftness"), editor.getTempFloat_NumberNumber(layer.sdfOutlineSoftness), 0.0, 1.0, "%.2f", nil, editor.getTempBool_BoolBool(false)) then
layer.sdfOutlineSoftness = editor.getTempFloat_NumberNumber()
-- im.NextColumn()
-- if editor.uiInputInt(string.format("##%s_%s_%s", layer.uid, guiId, "interpolationSteps"), editor.getTempInt_NumberNumber(layer.interpolationSteps), 1, 2) then
-- local value = editor.getTempInt_NumberNumber()
im.PushItemWidth(im.GetContentRegionAvailWidth() - (tool.getIconSize() + im.GetStyle().ItemSpacing.x))
if editor.uiSliderFloat(string.format("##%s_%s_%s_%d", layer.uid, guiId, "textCharacterPositions", k), editor.getTempFloat_NumberNumber(v), 0, 1, nil, nil, editor.getTempBool_BoolBool(false)) then
-- Clamp value between 0 and 1
im.SameLine()
if editor.uiIconImageButton(editor.icons.replay, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("##%s_%s_%s_%d", layer.uid, guiId, "textCharacterPositions_resetValue", k)) then
local val = (1.0 / (#layer.text - 1) * (k-1))
local count = #layer.dataPoints
if im.Button(string.format("Reverse data points##%s", layer.uid)) then
local newDataPoints = {}
im.Button(string.format("Show data points##%s", layer.uid))
if im.IsItemHovered() then
debugDrawer:drawSphere(pos, editor.getPreference("dynamicDecalsTool.general.dataPointSphereSize"), ColorF(col[1], col[2], col[3], col[4]), col[4] < 0.99 and true or false)
debugDrawer:drawTextAdvanced(pos, String(string.format(" %d ", i)), ColorF(1,1,0,1), true, false, ColorI(40, 40, 40, 0.75*255))
end
im.TextUnformatted(string.format("count: %d", count))
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("##%s_%s_%s_%d", layer.uid, guiId, "interpolationSteps_removeDataPointsEntry", k)) then
table.remove(layer.dataPoints, k)
if k == count then im.BeginDisabled() end
if editor.uiIconImageButton(editor.icons.content_copy, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("##%s_%s_%s_%d", layer.uid, guiId, "interpolationSteps_insertDataPointsEntry", k)) then
local nextPoint = layer.dataPoints[k + 1]
if editor.uiIconImageButton(editor.icons.move, im.ImVec2(tool.getIconSize(), tool.getIconSize()), (gizmo.data.uid == layer.uid and gizmo.data.dataPointIndex == k) and editor.color.beamng.Value or nil, nil, nil, string.format("MovePathPoint_%s_%d", layer.uid, k)) then
local layerData = deepcopy(layer)
debugDrawer:drawSphere(pos, editor.getPreference("dynamicDecalsTool.general.dataPointSphereSize"), ColorF(col[1], col[2], col[3], col[4]), col[4] < 0.99 and true or false)
debugDrawer:drawTextAdvanced(pos, String(string.format(" %d ", k)), ColorF(1,1,0,1), true, false, ColorI(40, 40, 40, 0.75*255))
end
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat2(string.format("##%s_%s_%s_%d", layer.uid, guiId, "brushDataPoints_cursorPosScreenUv", k), editor.getTempFloatArray2_TableTable({data.x, data.y}), 0.0, 1.0, nil, nil, editor.getTempBool_BoolBool(false)) then
local value = editor.getTempFloatArray2_TableTable()
im.TableNextColumn()
if im.Button(string.format("Highlight##DecalPropertiesTable_%s", property.name)) then
tool.setSectionOpenState("Decal Properties", true)
tool.setSectionOpenState("Decal Properties", true)
widgets.highlight(string.format("##Decal Properties_section_%s", property.id), 5)
end
@/inspector/Views/ResourceSizesContentView.js
let compressionRate = decodedSize / encodedSize;
let compressionString = compressionRate > 0 && isFinite(compressionRate) ? WI.UIString("%.2f\u00d7").format(compressionRate) : WI.UIString("None");
@/lua/ge/extensions/editor/missionStartPositionEditor.lua
if startPos then
im.Text(string.format("Start Position: %.2f, %.2f, %.2f", startPos.x, startPos.y, startPos.z))
end
im.BeginTooltip()
im.Text(string.format("%d missions within 10m", #nearbyMissions))
im.EndTooltip()
@/lua/ge/extensions/flowgraph/nodes/ui/genericMissionDataText.lua
if self.pinIn.style.value == "time" then
data.txt = string.format("%02d:%02d", math.floor(self.pinIn.txt.value / 60), math.floor(self.pinIn.txt.value % 60))
data.minutes = string.format("%02d", math.floor(self.pinIn.txt.value / 60))
data.txt = string.format("%02d:%02d", math.floor(self.pinIn.txt.value / 60), math.floor(self.pinIn.txt.value % 60))
data.minutes = string.format("%02d", math.floor(self.pinIn.txt.value / 60))
data.seconds = string.format("%02d", math.floor(self.pinIn.txt.value % 60))
data.minutes = string.format("%02d", math.floor(self.pinIn.txt.value / 60))
data.seconds = string.format("%02d", math.floor(self.pinIn.txt.value % 60))
data.style = "text"
elseif self.pinIn.style.value == "timemillis" then
data.txt = string.format("%02d:%02d.%03d", math.floor(self.pinIn.txt.value / 60), math.floor(self.pinIn.txt.value % 60), math.floor((self.pinIn.txt.value % 1) * 1000))
data.minutes = string.format("%02d", math.floor(self.pinIn.txt.value / 60))
data.txt = string.format("%02d:%02d.%03d", math.floor(self.pinIn.txt.value / 60), math.floor(self.pinIn.txt.value % 60), math.floor((self.pinIn.txt.value % 1) * 1000))
data.minutes = string.format("%02d", math.floor(self.pinIn.txt.value / 60))
data.seconds = string.format("%02d", math.floor(self.pinIn.txt.value % 60))
data.minutes = string.format("%02d", math.floor(self.pinIn.txt.value / 60))
data.seconds = string.format("%02d", math.floor(self.pinIn.txt.value % 60))
data.milliseconds = string.format("%03d", math.floor((self.pinIn.txt.value % 1) * 1000))
data.seconds = string.format("%02d", math.floor(self.pinIn.txt.value % 60))
data.milliseconds = string.format("%03d", math.floor((self.pinIn.txt.value % 1) * 1000))
data.style = "text"
@/lua/ge/extensions/editor/meshEditor.lua
end
debugDrawer:drawTextAdvanced(pos, String(M.niceName .. " Width: " .. string.format("%.2f", mesh:getNodeWidth(tempNodeIndex)) .. ". Change width by dragging."), whiteF, true, false, blackI)
end
local middlePos = (pos + nextNodePos) / 2
debugDrawer:drawTextAdvanced(middlePos, String(string.format("%.2f m", nextNodePos.z - pos.z)), whiteF, true, false, blackI)
debugDrawer:drawSphere(focusPointNoMesh, editor.getPreference(M.preferencesName .. ".general.defaultWidth")/2, roadRiverGui.highlightColors.nodeTransparent, false)
debugDrawer:drawTextAdvanced(focusPointNoMesh, String(M.niceName .. " Width: " .. string.format("%.2f", editor.getPreference(M.preferencesName .. ".general.defaultWidth")) .. (editor.getPreference(M.preferencesName .. ".general.dragWidth") and ". Change width by dragging." or "")), ColorF(1.0,1.0,1.0,1), true, false, blackI)
end
@/lua/common/libs/lua-websockets/websocket/sync.lua
local msg = 'Websocket Handshake failed: Invalid Sec-Websocket-Accept (expected %s got %s)'
return nil,msg:format(expected_accept,headers['sec-websocket-accept'] or 'nil'),headers
end
@/lua/ge/extensions/tech/capturePlayer.lua
-- For some responses (camera data for example), we want to convert the data into a nice format.
-- These are the handlers which convert the data to a better readable format (defined below).
local ResponseCallbacks = {}
local vid = captureState.portToVid[port]
local serializedData = string.format("tech_techCapture.injectMessage(lpack.decode(%q))", lpack.encode(payload))
be:queueObjectLua(vid, serializedData)
@/lua/ge/extensions/scenario/speedGoal.lua
if minutes > 0 then
timeStr = string.format("%02.0f:%05.2f", minutes, seconds)
else
else
timeStr = string.format("%0.2f", seconds) .. 's'
end
@/lua/ge/extensions/editor/api/core.lua
folderName = string.format("%04d", counter)
local path = "/settings/editor/autosaves/" .. editor.getLevelName() .. "/" .. folderName
@/lua/vehicle/controller/nitrousOxideInjection.lua
extensions.ui_simplePowertrainControl.setButton(M.name, "N2O", "powertrain_n2o", color, n2oData.tankRatio, string.format("controller.getController(%q).toggleActive()", M.name))
end
@/lua/ge/extensions/gameplay/missions/missionManager.lua
for i, step in ipairs(taskData.steps) do
im.TextWrapped(string.format("%s%d - %s",taskData.currentStep == i and "ACTIVE " or "", i, step.name or "Unnamed Step"))
im.Text(dumps(step))
if stepToHandle.complete then
log("I", logTag, string.format("Completed Step: %s", stepToHandle.name or "Unnamed Task"))
taskData.currentStep = taskData.currentStep + 1
@/lua/ge/extensions/editor/util/plotHelperUtil.lua
-- Method to set graph data
-- Must be in this format (multiple y values for one x allowed):
-- {{x0, y0, ...}, {x1, y1, ...}, ...}
-- Method to set graph data
-- Must be in this format (multiple y values for one x allowed):
-- {{x0, y0, ...}, {x1, y1, ...}, ...}
else
txt = string.format("%.3e", graphX)
end
else
txt = string.format("%.3e", graphY)
end
local strX = string.format(self.formatX, ptX)
local strY = string.format(self.formatY, ptY)
local strX = string.format(self.formatX, ptX)
local strY = string.format(self.formatY, ptY)
@/lua/ge/extensions/editor/flowgraph/garbageDebug.lua
im.SameLine()
im.Text(string.format("[%d]", entry.activeCount))
end
plotHelperUtil:draw(im.GetContentRegionAvailWidth(),250, im.GetIO().DeltaTime)
im.Text(string.format("Change | Avg: %d | Q25: %d | Q75: %d | Q90: %d | (only active)", entry.averageChange or -1, entry.q25 or -1, entry.q50 or -1, entry.q75 or -1))
table.clear(plot)
if node then
local nLabel = string.format("%s (%d)", node.name, node.id, entry.value or -1)
self:drawStats(nLabel, entry)
@/lua/ge/extensions/flowgraph/nodes/types/getVariable.lua
if not var then
log("I","GetVariable", string.format("Variable %s not found. own id, graph id: %s, %s", name, self.id, self.graph.id))
return
@/lua/ge/extensions/editor/dynamicDecals/selection.lua
local function selectLayer(uid, addToSelection)
if not uid then editor.logWarn(string.format("%s.selectLayer(): 'uid' argument must not be empty.", logTag)) return end
if not addToSelection then
@/lua/ge/extensions/ui/gridSelectorUtils/filterModule.lua
if currentMin > defaultMin and currentMax < defaultMax then
displayText = string.format("%s %s - %s", propName, currentMin, currentMax)
propValue = string.format("%s,%s", currentMin, currentMax)
displayText = string.format("%s %s - %s", propName, currentMin, currentMax)
propValue = string.format("%s,%s", currentMin, currentMax)
elseif currentMin > defaultMin then
elseif currentMin > defaultMin then
displayText = string.format("%s > %s", propName, currentMin)
propValue = string.format("> %s", currentMin)
displayText = string.format("%s > %s", propName, currentMin)
propValue = string.format("> %s", currentMin)
else
else
displayText = string.format("%s < %s", propName, currentMax)
propValue = string.format("< %s", currentMax)
displayText = string.format("%s < %s", propName, currentMax)
propValue = string.format("< %s", currentMax)
end
propValue = 'all',
displayText = string.format("%s: None!", propName),
isActive = false,
if #enabledOptions > #disabledOptions then
displayText = string.format("%s %s", propName, table.concat(disabledOptions, ', '))
propValue = table.concat(disabledOptions, ',')
-- If more elements are disabled than enabled, show the enabled names in green
displayText = string.format("%s %s", propName, table.concat(enabledOptions, ', '))
propValue = table.concat(enabledOptions, ',')
local function toggleFilter(propName, option)
log("D","",string.format("Toggling filter: %s, option: %s", propName, option))
if isFilterLocked(propName, option) then
log("W","",string.format("Cannot toggle locked filter: %s, option: %s", propName, option))
return
local function updateRangeFilter(propName, min, max)
log("D","",string.format("Updating range filter: %s, min: %s, max: %s", propName, min, max))
if isFilterLocked(propName) then
log("W","",string.format("Cannot update locked range filter: %s", propName))
return
local function resetRangeFilter(propName)
log("D","",string.format("Resetting range filter: %s", propName))
if isFilterLocked(propName) then
log("W","",string.format("Cannot reset locked range filter: %s", propName))
return
local function resetSetFilter(propName)
log("D","",string.format("Resetting set filter: %s", propName))
if isFilterLocked(propName) then
log("W","",string.format("Cannot reset locked set filter: %s", propName))
return
local function lockFilter(propName, options)
log("D","",string.format("Locking filter: %s", propName))
local function unlockFilter(propName, options)
log("D","",string.format("Unlocking filter: %s", propName))
local function lockFilterMode(propName, options)
log("D","",string.format("Locking filter mode: %s", propName))
local function lockFilterModeExclusive(propName, allowedOptions)
log("D","",string.format("Locking filter mode exclusive: %s", propName))
if filter.type ~= 'set' then
log("W","",string.format("lockFilterModeExclusive only works with set filters, got: %s", filter.type))
return
local function clearLockedFilters()
log("D","",string.format("Clearing all locked filters"))
lockedFiltersByProp = {}
@/lua/ge/suspensionFrequencyTester.lua
if imgui.BeginTable("CategoryTable_"..node.name, 3, imgui.TableFlags_Borders + imgui.TableFlags_SizingFixedFit) then
imgui.TableSetupColumn(string.format("%s Suspension", node.name), imgui.TableColumnFlags_WidthFixed, 160)
imgui.TableSetupColumn("Freq", imgui.TableColumnFlags_WidthFixed, 60)
imgui.TableNextColumn()
imgui.Text(string.format("%.1f Hz", entry[2]))
imgui.TableNextColumn()
local b = 0.4
imgui.TextColored(imgui.ImVec4(r, g, b, 1), string.format("%i m/Hz", sumPerHz))
end
local color = (i % 2 == 0) and imgui.ImVec4(1, 1, 1, 1) or imgui.ImVec4(0.6, 0.6, 0.6, 1)
imgui.TextColored(color, string.format("%.2fHz", freq))
end
@/lua/vehicle/bdebugImpl.lua
local beam = v.data.beams[id]
log("I", "bdebug.beamBroken", string.format("beam %d broke: %s [%d] -> %s [%d]", id, (v.data.nodes[beam.id1].name or "unnamed"), beam.id1, (v.data.nodes[beam.id2].name or "unnamed"), beam.id2))
guihooks.message({txt = "vehicle.beamstate.beamBroke", context = {id = id, id1 = beam.id1, id2 = beam.id2, id1name = v.data.nodes[beam.id1].name, id2name = v.data.nodes[beam.id2].name}})
local beam = v.data.beams[id]
log("I", "bdebug.beamDeformed", string.format("beam %d deformed: %s [%d] -> %s [%d]", id, (v.data.nodes[beam.id1].name or "unnamed"), beam.id1, (v.data.nodes[beam.id2].name or "unnamed"), beam.id2))
end
local beam = v.data.beams[beamID]
log("I", "bdebug.beamDeformed", string.format("deformgroup triggered: %s beam %d, %s [%d] -> %s [%d]", deformGroup, beamID, (v.data.nodes[beam.id1].name or "unnamed"), beam.id1, (v.data.nodes[beam.id2].name or "unnamed"), beam.id2))
end
obj.debugDrawProxy:drawNodeSphere(wd.node2, 0.04, ironbowColor((wheelCoreTemp - baseTemp) * 0.004))
obj.debugDrawProxy:drawNodeText(wd.node1, ironbowColor((wheelCoreTemp - baseTemp) * 0.004), string.format("%s%.1f %s%.1f %s%.1f", "tT:", wheelAvgTemp - 273.15, "tC:", wheelCoreTemp - 273.15, "psi:", wheelAirPressure*0.000145038-14.5), 0)
-- TODO: temporary solution to draw from GE Lua side
obj:queueGameEngineLua(string.format('debugDrawer:drawLine(%s,%s,ColorF(1,0,0,1),false)', -dir * lineLen * 0.5 + midPos, dir * lineLen * 0.5 + midPos))
obj.debugDrawProxy:drawCylinder(-dir * lineLen * 0.5 + midPos, dir * lineLen * 0.5 + midPos, 0.01, color(255, 0, 0, 255))
obj.debugDrawProxy:drawSphere(0.1, p, color(255, 0, 0, 255))
obj.debugDrawProxy:drawText(p + vec3(0, 0, 0.3), color(255, 0, 0, 255), string.format("COG (%0.3f, %0.3f, %0.3f)", relCOGPos.x, relCOGPos.y, relCOGPos.z))
if playerInfo.firstPlayerSeated then
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 100, 0), color(0, 0, 0, 255), "COG distance above ground: " .. string.format("%0.3f m", obj:getDistanceFromTerrainPoint(p)))
end
local nodeWeight = obj:getNodeMass(node.cid)
local nodeText = getNodeText(node, string.format("%.2fkg", nodeWeight))
text = k ~= tblSize and text .. nodeText .. ', ' or text .. nodeText
if playerInfo.firstPlayerSeated then
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 60, 0), color(0, 0, 0, 255), "Weight: " .. string.format("%.2f kg", totalWeight))
end
local nodeText = getNodeText(node, string.format("%0.1f N", frc_length))
text = k ~= tblSize and text .. nodeText .. ', ' or text .. nodeText
end
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 60, 0), color(0, 0, 0, 255), "Average force: " .. string.format("%0.1f N", textNodeForceAvg))
textNodeForceAvg = forcesSum / (currNodesCount + 1e-30)
tempVec2:setAdd(initRefNodePos)
local nodeText = getNodeText(node, string.format("(%0.3f, %0.3f, %0.3f)", tempVec2.x, tempVec2.y, tempVec2.z))
text = k ~= tblSize and text .. nodeText .. ', ' or text .. nodeText
tempVec2:setAdd2(tempVec, obj:getNodePosition(node.cid))
local nodeText = getNodeText(node, string.format("(%0.3f, %0.3f, %0.3f)", tempVec2.x, tempVec2.y, tempVec2.z))
text = k ~= tblSize and text .. nodeText .. ', ' or text .. nodeText
local beam = v.data.beams[i]
local beamText = string.format("%d: %.3f m", beam.cid, obj:getBeamRefLength(beam.cid))
text = k ~= tblSize and text .. beamText .. ', ' or text .. beamText
local beam = v.data.beams[i]
local beamText = string.format("%d: %.3f m", beam.cid, obj:getBeamLength(beam.cid))
text = k ~= tblSize and text .. beamText .. ', ' or text .. beamText
-- TODO: temporary solution to draw from GE Lua side
--obj:queueGameEngineLua(string.format('debugDrawer:drawCylinder(%s,%s,%f,ColorF(%f,%f,%f,%f),false)', -dir * len * 0.5 + midPos, dir * len * 0.5 + midPos, radius * 0.5, r/255,g/255,b/255,a/255))
obj.debugDrawProxy:drawCylinder(-dir * len * 0.5 + midPos, dir * len * 0.5 + midPos, radius, col)
obj.debugDrawProxy:drawBeam3d(beam.cid, radius, col)
-- obj:queueGameEngineLua(string.format('debugDrawer:drawCylinder(%s,%s,%f,ColorF(%f,%f,%f,%f),false)', node1Pos, node2Pos, radius, r/255,g/255,b/255,a/255))
-- obj.debugDrawProxy:drawCylinder(node1Pos, node2Pos, radius, col)
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(0, 0, 255, 255), "Extension")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 140, 0), color(255, 255, 255, 255), string.format("Range Min: %.2f", rangeMin))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 160, 0), color(255, 255, 255, 255), string.format("Range Max: %.2f", rangeMax))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 140, 0), color(255, 255, 255, 255), string.format("Range Min: %.2f", rangeMin))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 160, 0), color(255, 255, 255, 255), string.format("Range Max: %.2f", rangeMax))
end
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(0, 0, 255, 255), "Extension")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 140, 0), color(255, 255, 255, 255), string.format("Range Min: %.2f", rangeMin))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 160, 0), color(255, 255, 255, 255), string.format("Range Max: %.2f", rangeMax))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 140, 0), color(255, 255, 255, 255), string.format("Range Min: %.2f", rangeMin))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 160, 0), color(255, 255, 255, 255), string.format("Range Max: %.2f", rangeMax))
end
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(0, 0, 255, 255), "Extension")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 140, 0), color(255, 255, 255, 255), string.format("Range Min: %.2f", rangeMin))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 160, 0), color(255, 255, 255, 255), string.format("Range Max: %.2f", rangeMax))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 140, 0), color(255, 255, 255, 255), string.format("Range Min: %.2f", rangeMin))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 160, 0), color(255, 255, 255, 255), string.format("Range Max: %.2f", rangeMax))
end
if playerInfo.firstPlayerSeated then
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 100, 0), color(0, 0, 0, 255), string.format("%.2f Hz", freq))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(0, 0, 0, 255), string.format("Max Amplitude: %.2f m", ampMax))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 100, 0), color(0, 0, 0, 255), string.format("%.2f Hz", freq))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(0, 0, 0, 255), string.format("Max Amplitude: %.2f m", ampMax))
end
if playerInfo.firstPlayerSeated then
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 100, 0), color(255, 255, 255, 255), string.format("Range Min: %.2f", rangeMin))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(255, 0, 0, 255), string.format("Range Max: %.2f", rangeMax))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 100, 0), color(255, 255, 255, 255), string.format("Range Min: %.2f", rangeMin))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(255, 0, 0, 255), string.format("Range Max: %.2f", rangeMax))
if mode.showInfinity then
if playerInfo.firstPlayerSeated then
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 100, 0), color(255, 255, 255, 255), string.format("Range Min: %.2f", rangeMin))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(255, 0, 0, 255), string.format("Range Max: %.2f", rangeMax))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 100, 0), color(255, 255, 255, 255), string.format("Range Min: %.2f", rangeMin))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(255, 0, 0, 255), string.format("Range Max: %.2f", rangeMax))
if mode.showInfinity then
-- INTENTIONALLY CALLING FROM GAME ENGINE LUA TO WORKAROUND A BUG
obj:queueGameEngineLua(string.format("guihooks.trigger('BdebugUpdate',%s,%s)", serialize(M.state), serialize(M.stateNoReset)))
-- This is fine though
obj:queueGameEngineLua(string.format("extensions.hook('onBDebugUpdate',%s,%s)", serialize(M.state), serialize(M.stateNoReset)))
end
if not beamsBroken[id] and obj:beamIsBroken(id) then
log("I", "bdebug.beamBroken", string.format("beam %d broke: %s [%d] -> %s [%d]", id, (v.data.nodes[beam.id1].name or "unnamed"), beam.id1, (v.data.nodes[beam.id2].name or "unnamed"), beam.id2))
guihooks.message({txt = "vehicle.beamstate.beamBroke", context = {id = id, id1 = beam.id1, id2 = beam.id2, id1name = v.data.nodes[beam.id1].name, id2name = v.data.nodes[beam.id2].name}})
if not M.state then return
log('E', 'bdebugImpl.setNodeDebugText', string.format('bdebugImpl.setNodeDebugText(%s, %d, %s) not successful because bdebugImpl.lua is not fully initialized!', type, nodeCID, text))
end
@/lua/vehicle/beamstate.lua
local tooManyBreakGroupsBroken = breakGroupCount > 0 and (brokenBreakGroupCount > 1 or (brokenBreakGroupCount == breakGroupCount))
--print(string.format("%q: Breakgroups: %s, broken beams: %s/%s, deformed beams: %s/%s", partId, brokenBreakGroupCount, brokenBeamCount, #damageableBeams, deformedBeamCount, #damageableBeams))
local function sendObjectCouplingChange()
obj:queueGameEngineLua(string.format("onObjectCouplingChange(%s,%s)", objectId, serialize(attachedCouplers)))
end
obj:detachCoupler(val.cid, 0)
obj:queueGameEngineLua(string.format("onCouplerDetach(%s,%s)", obj:getId(), val.cid))
end
local function couplerFound(nodeId, obj2id, obj2nodeId)
--print(string.format("coupler found %s.%s->%s.%s", obj:getId(), nodeId, obj2id, obj2nodeId))
end
--print(string.format("coupler attached %s.%s->%s.%s", obj:getId(),nodeId,obj2id, obj2nodeId))
if objectId < obj2id then
if objectId < obj2id then
obj:queueGameEngineLua(string.format("onCouplerAttached(%s,%s,%s,%s)", objectId, obj2id, nodeId, obj2nodeId))
end
local function onCouplerDetached(nodeId, obj2id, obj2nodeId)
--print(string.format("coupler detached %s.%s->%s.%s", obj:getId(),nodeId,obj2id, obj2nodeId))
attachedCouplers[nodeId] = nil
if objectId < obj2id then
obj:queueGameEngineLua(string.format("onCouplerDetached(%s,%s,%s,%s)", objectId, obj2id, nodeId, obj2nodeId))
end
if damageSum > lastDisplayedDamage * 1.05 then
--guihooks.message(string.format("Car Damage: $%.2f", damageSum), 5, "vehicle.damageSum")
lastDisplayedDamage = damageSum
end
obj:queueObjectLuaCommand(coupler.obj2id, string.format("beamstate.importCouplerData(%s, %s)", coupler.obj2nodeId, serialize(data)))
end
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veFlexbodyDebug.lua
--debugDrawer:drawTextAdvanced(chosenVertPos, chosenVertID, textColor, true, false, textBackgroundColor)
debugDrawer:drawTextAdvanced(chosenVertPos, string.format("pos: (%.2f, %.2f, %.2f)", vertPosLocal.x, vertPosLocal.y, vertPosLocal.z), textColor, true, false, textBackgroundColor)
end
local locCoords = vertLoc.coords
local coords = string.format("(%.2f, %.2f, %.2f)", locCoords.x, locCoords.y, locCoords.z)
im.Text("Potential Spiking Vertices Count: " .. string.format("%d / %d", state.verticesOOBCoordsData.count, totalVertices))
im.Text("Problematic Locators Count (NX,NY,NZ): " .. dumps(state.verticesOOBCoordsData.countVec))
local locCoords = vertData.locCoords
local text = string.format("%d: (%.2f, %.2f, %.2f)", vertID, locCoords.x, locCoords.y, locCoords.z)
im.Text("Problematic Vertices Count: " .. string.format("%d / %d", state.verticesLackingNodesData.count, totalVertices))
im.Separator()
@/lua/vehicle/controller/esc.lua
if isDebugMode and config.escEnabled then
log("D", "ESC", string.format("Calculated EG: %s --> %.6f", config.name, eg))
log("D", "ESC", string.format("Calculated characteristic speed: %s --> %.2f m/s", config.name, characteristicSpeed))
log("D", "ESC", string.format("Calculated EG: %s --> %.6f", config.name, eg))
log("D", "ESC", string.format("Calculated characteristic speed: %s --> %.2f m/s", config.name, characteristicSpeed))
if eg < 0 then
if eg < 0 then
log("W", "ESC", string.format("Calculated EG (%s) is lower than 0 (oversteery car setup), ESC might not work perfectly!", config.name))
end
@/lua/ge/extensions/gameplay/forceField.lua
local command = string.format('obj:setPlanets({%f, %f, %f, %d, %f})', center.x, center.y, center.z, planetRadius, mass * vehicleSizeFactor * forceMultiplier)
@/lua/ge/extensions/career/modules/delivery/precisionParking.lua
if precisionData then
--log("I", "", string.format("Precision Parking Debug - Level: %s, Score: %d, Angle: %.1f° (Adj: %.1f°), Side: %.2fm, Forward: %.2fm",
-- precisionData.precisionLevel, precisionData.totalScore, precisionData.angle, precisionData.adjustedAngle, precisionData.sideDist, precisionData.forwardDist))
@/lua/ge/extensions/editor/util/editorElementHelper.lua
-- Check for old vehicleFilters format (array of vehicle configs) that should be cleaned up
local function vehicleFilterCheckContainer(e, ctd, c)
if ctd[e.fieldName] and type(ctd[e.fieldName]) == "table" and #ctd[e.fieldName] > 0 then
-- Check if it's the old format (array with model/config) or new format (object with baseFilter)
local first = ctd[e.fieldName][1]
if ctd[e.fieldName] and type(ctd[e.fieldName]) == "table" and #ctd[e.fieldName] > 0 then
-- Check if it's the old format (array with model/config) or new format (object with baseFilter)
local first = ctd[e.fieldName][1]
if ctd[val.fieldName] ~= nil and val.value ~= nil and (type(ctd[val.fieldName]) ~= type(val.value)) then
table.insert(issues, {label = 'Mismatched '.. self.typeDataFieldName .. ' Value: ' .. val.fieldName .. string.format(" (%s, should be %s)", type(ctd[val.fieldName]), type(val.value)), data=val, severity='error', fixable=true})
end
im.BeginDisabled()
im.Text(string.format("%0.2f m/s = %0.2f %s",e.ptr[0],translateVelocity(e.ptr[0], true)))
im.EndDisabled()
im.BeginDisabled()
im.Text(string.format("%0.2f m = %0.2f %s",e.ptr[0],translateDistance(e.ptr[0], true)))
im.EndDisabled()
local t = e.ptr[0]
im.Text(string.format("%0.2f s = %d:%02d.%02d mm:ss.mmm",t,(t-(t%60))/60, math.floor(t%60), 100*(t%1)))
im.EndDisabled()
field.type = ui_flowgraph_editor.getAutoTypeFromName(field.label)
--print(string.format("%s (%s) from %s", field.fieldName, field.type, field.elemLabel))
end
@/lua/ge/extensions/core/vehicleBridge.lua
end
local cmd = string.format("extensions.gameplayInterface.getSystemData(0, %d, %s)", id, table.concat(params, ", "))
M.logCommand(veh, cmd)
M.vehicleData[vehicleId].registeredCallbacks[electricsKey] = id
local cmd = string.format("extensions.gameplayInterface.registerValueChangeNotification(0,%d,'%s')", id, electricsKey)
log("D","","Registering for value change notification: " .. cmd)
if id then
local cmd = string.format("extensions.gameplayInterface.unregisterValueChangeNotification(0,%d,'%s')", id, electricsKey)
log("D","","Unregistering for value change notification: " .. cmd)
--end
local cmd = string.format("extensions.gameplayInterface.executeAction(0,%d, %s)", id, table.concat(params, ", "))
M.logCommand(veh, cmd)
@/lua/ge/extensions/career/modules/loanerVehicles.lua
if not loanedVehiclesInfo[inventoryId] and playerPos:distance(vehPos) > walkAwayRadius then
ui_message(string.format("You are leaving a loaned vehicle behind. After %d seconds, it will be returned to the owner.", walkAwayTimeLimit), 5, "loanedVehicleTime")
loanedVehiclesInfo[inventoryId] = {time = walkAwayTimeLimit}
if not loanedVehInfo.warningShown and loanedVehInfo.time < walkAwayWarningTime then
ui_message(string.format("After %d more seconds of not returning to the loaned vehicle, it will be returned to the owner.", walkAwayWarningTime), 5, "loanedVehicleTime")
loanedVehInfo.warningShown = true
icon = career_modules_delivery_parcelMods.getModifierIcon(cap.type),
labelShort = string.format("%dL", cap.amount),
labelLong = string.format("Fluids: %dL", cap.amount),
labelShort = string.format("%dL", cap.amount),
labelLong = string.format("Fluids: %dL", cap.amount),
})
type = "locked", icon = "peopleOutline", level = rentalVehicleInfo.reputationLvl,
label = string.format("Requires Reputation '%s' with %s", organization.reputationLevels[rentalVehicleInfo.reputationLvl+2].label, organization.name)
}
unlockInfo = {
type = "minLevel", icon = "peopleOutline", longLabel = string.format("Requires Reputation '%s' with %s", organization.reputationLevels[rentalVehicleInfo.reputationLvl+2].label, organization.name), shortLabel = string.format("%s (lvl %d)", organization.reputationLevels[rentalVehicleInfo.reputationLvl+2].label, rentalVehicleInfo.reputationLvl)
}
unlockInfo = {
type = "minLevel", icon = "peopleOutline", longLabel = string.format("Requires Reputation '%s' with %s", organization.reputationLevels[rentalVehicleInfo.reputationLvl+2].label, organization.name), shortLabel = string.format("%s (lvl %d)", organization.reputationLevels[rentalVehicleInfo.reputationLvl+2].label, rentalVehicleInfo.reputationLvl)
}
type = "locked", icon = "cardboardBox", level = rentalVehicleInfo.deliveryLvl,
label = string.format("Requires Skill 'Cargo Delivery' lvl %d", rentalVehicleInfo.deliveryLvl )
}
unlockInfo = {
type = "minLevel", icon = "cardboardBox", longLabel = string.format("Requires Skill 'Cargo Delivery' lvl %d", rentalVehicleInfo.deliveryLvl ), shortLabel = string.format("lvl %d", rentalVehicleInfo.deliveryLvl )
}
unlockInfo = {
type = "minLevel", icon = "cardboardBox", longLabel = string.format("Requires Skill 'Cargo Delivery' lvl %d", rentalVehicleInfo.deliveryLvl ), shortLabel = string.format("lvl %d", rentalVehicleInfo.deliveryLvl )
}
local id = string.format("%s-%d", organizationId, idx)
icon = career_modules_delivery_parcelMods.getModifierIcon(cap.type),
labelShort = string.format("%dL", cap.amount),
labelLong = string.format("Fluids: %dL", cap.amount),
labelShort = string.format("%dL", cap.amount),
labelLong = string.format("Fluids: %dL", cap.amount),
})
if enabled then
local repLabel = string.format("%s (lvl %d)", organization.reputationLevels[rentalVehicleInfo.reputationLvl+2].label, rentalVehicleInfo.reputationLvl)
item.unlockInfo = {
item.unlockInfo = {
type = "minLevel", icon = "peopleOutline", longLabel = string.format("Requires reputation: %s",repLabel), shortLabel = repLabel
}
@/inspector/Views/TimelineTabContentView.js
let toolTip = WI.UIString("Start recording (%s)\nCreate new recording (%s)").format(this._toggleRecordingShortcut.displayName, this._toggleNewRecordingShortcut.displayName);
let altToolTip = WI.UIString("Stop recording (%s)").format(this._toggleRecordingShortcut.displayName);
let toolTip = WI.UIString("Start recording (%s)\nCreate new recording (%s)").format(this._toggleRecordingShortcut.displayName, this._toggleNewRecordingShortcut.displayName);
let altToolTip = WI.UIString("Stop recording (%s)").format(this._toggleRecordingShortcut.displayName);
this._recordButton = new WI.ToggleButtonNavigationItem("record-start-stop", toolTip, altToolTip, "Images/Record.svg", "Images/Stop.svg", 13, 13);
case WI.TimelineRecord.Type.RenderingFrame:
return WI.UIString("Frame %d").format(timelineRecord.frameNumber);
case WI.TimelineRecord.Type.HeapAllocations:
if (timelineRecord.heapSnapshot.imported)
return WI.UIString("Imported \u2014 %s").format(timelineRecord.heapSnapshot.title);
if (timelineRecord.heapSnapshot.title)
if (timelineRecord.heapSnapshot.title)
return WI.UIString("Snapshot %d \u2014 %s").format(timelineRecord.heapSnapshot.identifier, timelineRecord.heapSnapshot.title);
return WI.UIString("Snapshot %d").format(timelineRecord.heapSnapshot.identifier);
return WI.UIString("Snapshot %d \u2014 %s").format(timelineRecord.heapSnapshot.identifier, timelineRecord.heapSnapshot.title);
return WI.UIString("Snapshot %d").format(timelineRecord.heapSnapshot.identifier);
case WI.TimelineRecord.Type.Media:
@/inspector/Views/CPUUsageCombinedView.js
this._legendMainThreadElement.textContent = WI.UIString("Main: %s").format(Number.percentageString(mainThreadUsage / 100));
this._legendWorkerThreadsElement.textContent = WI.UIString("Worker: %s").format(Number.percentageString(workerThreadUsage / 100));
this._legendMainThreadElement.textContent = WI.UIString("Main: %s").format(Number.percentageString(mainThreadUsage / 100));
this._legendWorkerThreadsElement.textContent = WI.UIString("Worker: %s").format(Number.percentageString(workerThreadUsage / 100));
this._legendOtherThreadsElement.textContent = WI.UIString("Other: %s").format(Number.percentageString((webkitThreadUsage + unknownThreadUsage) / 100));
this._legendWorkerThreadsElement.textContent = WI.UIString("Worker: %s").format(Number.percentageString(workerThreadUsage / 100));
this._legendOtherThreadsElement.textContent = WI.UIString("Other: %s").format(Number.percentageString((webkitThreadUsage + unknownThreadUsage) / 100));
this._legendTotalThreadsElement.textContent = WI.UIString("Total: %s").format(Number.percentageString(usage / 100));
this._legendOtherThreadsElement.textContent = WI.UIString("Other: %s").format(Number.percentageString((webkitThreadUsage + unknownThreadUsage) / 100));
this._legendTotalThreadsElement.textContent = WI.UIString("Total: %s").format(Number.percentageString(usage / 100));
}
this._detailsAverageElement.textContent = WI.UIString("Average: %s").format(Number.isFinite(maxSize) ? Number.percentageString(averageSize / 100) : emDash);
this._detailsMaxElement.textContent = WI.UIString("Highest: %s").format(Number.isFinite(maxSize) ? Number.percentageString(maxSize / 100) : emDash);
this._detailsAverageElement.textContent = WI.UIString("Average: %s").format(Number.isFinite(maxSize) ? Number.percentageString(averageSize / 100) : emDash);
this._detailsMaxElement.textContent = WI.UIString("Highest: %s").format(Number.isFinite(maxSize) ? Number.percentageString(maxSize / 100) : emDash);
}
@/lua/vehicle/wheels.lua
state = "measuring"
guihooks.message({txt = string.format("Measuring braking distance from %dkm/h...", targetSpeed * 3.6), context = {}}, 1, "vehicle.brakingdistance")
end
local avgDeceleration = -(square(airspeed) - square(targetSpeed)) / (2 * distance)
guihooks.message({txt = string.format("Brakingdistance from %dkm/h: %.2fm, G: %.2f", targetSpeed * 3.6, distance, avgDeceleration / -powertrain.currentGravity), context = {}}, 5, "vehicle.brakingdistance")
startPosition = nil
@/lua/ge/extensions/core/multiSpawn.lua
for i, data in ipairs(spawnData) do
log('I', logTag, string.format('Vehicle group spawning in progress (%d / %d)', i, #spawnData))
local veh = spawn.spawnVehicle(data.model, data.config, data.pos, data.rot, data)
spawningBusy = false
log('I', logTag, string.format('Vehicle group spawning completed: %s', spawnOptions.name or ''))
extensions.hook('onVehicleGroupSpawned', vehIds, groupId, spawnOptions.name)
if randomPaints and randomPaints.paintName1 then
log('I', logTag, string.format('Applying random paints for this vehicle: %s', options.model or ''))
options.paintName = randomPaints.paintName1
else
log('W', logTag, string.format('Failed to get random paints for vehicle: %s (config: %s), using default paints', options.model or '', options.config or ''))
options.paintName = modelData.model.defaultPaintName1 or 'White'
else
log('E', logTag, string.format('Vehicle model not found: %s', options.model or ''))
spawnData[i] = deepcopy(defaultOptions)
spawningBusy = true
log('I', logTag, string.format('Spawning vehicle group with %d vehicles: %s', amount, options.name or ''))
return spawnProcessedGroup(setVehicleSpawnData(group, amount), options) -- returns unique group id
@/lua/ge/extensions/tech/sensors.lua
}
local serializedData = string.format("extensions.tech_advancedIMU.create(%q)", lpack.encode(data))
be:queueObjectLua(vid, serializedData)
local data = { sensorId = sensorId, isUsingGravity = isUsingGravity }
local serialisedData = string.format("extensions.tech_advancedIMU.setIsUsingGravity(%q)", lpack.encode(data))
be:queueObjectLua(scenetree.findObject(vid):getID(), serialisedData)
local data = { sensorId = sensorId, isVisualised = isVisualised }
local serialisedData = string.format("extensions.tech_advancedIMU.setIsVisualised(%q)", lpack.encode(data))
be:queueObjectLua(scenetree.findObject(vid):getID(), serialisedData)
}
local serializedData = string.format("extensions.tech_GPS.create(%q)", lpack.encode(data))
be:queueObjectLua(vid, serializedData)
local data = { sensorId = sensorId, isVisualised = isVisualised }
local serialisedData = string.format("extensions.tech_GPS.setIsVisualised(%q)", lpack.encode(data))
be:queueObjectLua(scenetree.findObject(vid):getID(), serialisedData)
local data = { sensorId = sensorId, GFXUpdateTime = args.GFXUpdateTime, physicsUpdateTime = args.physicsUpdateTime }
local serializedData = string.format("extensions.tech_powertrainSensor.create(%q)", lpack.encode(data))
be:queueObjectLua(vid, serializedData)
local data = { sensorId = sensorId, GFXUpdateTime = args.GFXUpdateTime, physicsUpdateTime = args.physicsUpdateTime }
local serializedData = string.format("extensions.tech_idealRADARSensor.create(%q)", lpack.encode(data))
be:queueObjectLua(vid, serializedData)
local data = { sensorId = sensorId, GFXUpdateTime = args.GFXUpdateTime, physicsUpdateTime = args.physicsUpdateTime }
local serializedData = string.format("extensions.tech_roadsSensor.create(%q)", lpack.encode(data))
be:queueObjectLua(vid, serializedData)
local data = { sensorId = sensorId, GFXUpdateTime = args.GFXUpdateTime }
local serializedData = string.format("extensions.tech_mesh.create(%q)", lpack.encode(data))
be:queueObjectLua(vid, serializedData)
}
local serializedData = string.format("extensions.tech_validation.create(%q)", lpack.encode(data))
be:queueObjectLua(vid, serializedData)
}
local serializedData = string.format("extensions.tech_tyreBarrier.create(%q)", lpack.encode(data))
be:queueObjectLua(vid, serializedData)
@/lua/ge/extensions/career/modules/testDrive.lua
local logBookLabel = "Didn't return the test drive vehicle."
local label = string.format("Fee for not returning the test drive vehicle : -%i$", testDriveInfo.abandonFees)
ui_message(label, 5, 'test1')
if testDriveInfo == nil or not active or not testDriveInfo.endParkingSpot or not testDriveInfo.endParkingSpotCreated then return end
id = string.format("testDrive-%s-%s-parkingEnd",testDriveInfo.dealershipName, testDriveInfo.route)
local eps = testDriveInfo.endParkingSpot
@/lua/ge/extensions/core/groundMarkers.lua
if not deprecationWarningDone[oldFunction] then
log('W', logTag, string.format('function "%s" is deprecated. Please use function "%s" instead', oldFunction, newFunction))
deprecationWarningDone[oldFunction] = true
markers = {},
color = string.format("#%02X%02X%02XFF", M.color[1]*255, M.color[2]*255, M.color[3]*255)
}
@/lua/ge/extensions/editor/dynamicDecals/colorPresets.lua
if im.ColorEdit4(string.format("##colorPresetColorWidget_%s_%d", guiId, k), editor.getTempFloatArray4_TableTable(color.value), im.flags(im.ColorEditFlags_NoInputs, im.ColorEditFlags_AlphaPreview)) then
data[k].value = editor.getTempFloatArray4_TableTable()
im.SameLine()
if editor.uiInputText(string.format("##colorPresetColorNameWidget_%s_%d", guiId, k), editor.getTempCharPtr(color.name or ""), nil, nil, nil, nil, editor.getTempBool_BoolBool(false)) then
color.name = editor.getTempCharPtr()
im.SameLine()
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(uiIconSize, uiIconSize), nil, nil, nil, string.format("remove##ColorPreset_%s_%d", guiId, k)) then
table.remove(data, k)
im.SameLine()
if editor.uiIconImageButton(editor.icons.border_color, im.ImVec2(uiIconSize, uiIconSize), nil, nil, nil, string.format("setAsDecalColorIconButton##ColorPreset_%s_%d", guiId, k)) then
api.setDecalColor(Point4F(color.value[1], color.value[2], color.value[3], color.value[4]))
im.SameLine()
if editor.uiIconImageButton(editor.icons.format_color_fill, im.ImVec2(uiIconSize, uiIconSize), nil, nil, nil, string.format("setAsFillColorIconButton##ColorPreset_%s_%d", guiId, k)) then
api.setFillLayerColor(Point4F(color.value[1], color.value[2], color.value[3], color.value[4]))
if im.Button(string.format("Add color preset##colorPreset_%s", guiId), im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
table.insert(data, {value = newPreset.value})
-- if im.ColorPicker4(string.format("##NewPresetColor"), editor.getTempFloatArray4_TableTable(newPreset.value), nil, nil) then
-- newPreset.value = editor.getTempFloatArray4_TableTable()
-- if im.Button(string.format("Add color preset##colorPreset_%s", guiId), im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
-- table.insert(data, {value = newPreset.value})
@/lua/ge/extensions/flowgraph/nodes/string/format.lua
if self.count == 1 then
self.pinOut.value.value = string.format(self.data.pattern, self.pinIn.value_1.value)
elseif self.count == 2 then
elseif self.count == 2 then
self.pinOut.value.value = string.format(self.data.pattern, self.pinIn.value_1.value, self.pinIn.value_2.value)
elseif self.count == 3 then
elseif self.count == 3 then
self.pinOut.value.value = string.format(self.data.pattern, self.pinIn.value_1.value, self.pinIn.value_2.value,
self.pinIn.value_3.value)
elseif self.count == 4 then
self.pinOut.value.value = string.format(self.data.pattern, self.pinIn.value_1.value, self.pinIn.value_2.value,
self.pinIn.value_3.value, self.pinIn.value_4.value)
elseif self.count == 5 then
self.pinOut.value.value = string.format(self.data.pattern, self.pinIn.value_1.value, self.pinIn.value_2.value,
self.pinIn.value_3.value, self.pinIn.value_4.value, self.pinIn.value_5.value)
elseif self.count == 6 then
self.pinOut.value.value = string.format(self.data.pattern, self.pinIn.value_1.value, self.pinIn.value_2.value,
self.pinIn.value_3.value, self.pinIn.value_4.value, self.pinIn.value_5.value, self.pinIn.value_6.value)
elseif self.count == 7 then
self.pinOut.value.value = string.format(self.data.pattern, self.pinIn.value_1.value, self.pinIn.value_2.value,
self.pinIn.value_3.value, self.pinIn.value_4.value, self.pinIn.value_5.value, self.pinIn.value_6.value,
elseif self.count == 8 then
self.pinOut.value.value = string.format(self.data.pattern, self.pinIn.value_1.value, self.pinIn.value_2.value,
self.pinIn.value_3.value, self.pinIn.value_4.value, self.pinIn.value_5.value, self.pinIn.value_6.value,
elseif self.count == 9 then
self.pinOut.value.value = string.format(self.data.pattern, self.pinIn.value_1.value, self.pinIn.value_2.value,
self.pinIn.value_3.value, self.pinIn.value_4.value, self.pinIn.value_5.value, self.pinIn.value_6.value,
elseif self.count == 10 then
self.pinOut.value.value = string.format(self.data.pattern, self.pinIn.value_1.value, self.pinIn.value_2.value,
self.pinIn.value_3.value, self.pinIn.value_4.value, self.pinIn.value_5.value, self.pinIn.value_6.value,
elseif self.count == 11 then
self.pinOut.value.value = string.format(self.data.pattern, self.pinIn.value_1.value, self.pinIn.value_2.value,
self.pinIn.value_3.value, self.pinIn.value_4.value, self.pinIn.value_5.value, self.pinIn.value_6.value,
elseif self.count == 12 then
self.pinOut.value.value = string.format(self.data.pattern, self.pinIn.value_1.value, self.pinIn.value_2.value,
self.pinIn.value_3.value, self.pinIn.value_4.value, self.pinIn.value_5.value, self.pinIn.value_6.value,
elseif self.count == 13 then
self.pinOut.value.value = string.format(self.data.pattern, self.pinIn.value_1.value, self.pinIn.value_2.value,
self.pinIn.value_3.value, self.pinIn.value_4.value, self.pinIn.value_5.value, self.pinIn.value_6.value,
elseif self.count == 14 then
self.pinOut.value.value = string.format(self.data.pattern, self.pinIn.value_1.value, self.pinIn.value_2.value,
self.pinIn.value_3.value, self.pinIn.value_4.value, self.pinIn.value_5.value, self.pinIn.value_6.value,
elseif self.count == 15 then
self.pinOut.value.value = string.format(self.data.pattern, self.pinIn.value_1.value, self.pinIn.value_2.value,
self.pinIn.value_3.value, self.pinIn.value_4.value, self.pinIn.value_5.value, self.pinIn.value_6.value,
elseif self.count == 16 then
self.pinOut.value.value = string.format(self.data.pattern, self.pinIn.value_1.value, self.pinIn.value_2.value,
self.pinIn.value_3.value, self.pinIn.value_4.value, self.pinIn.value_5.value, self.pinIn.value_6.value,
@/inspector/Models/SourceCodeLocation.js
var tooltip = WI.UIString("Located at %s").format(this.displayLocationString(WI.SourceCodeLocation.ColumnStyle.Shown, WI.SourceCodeLocation.NameStyle.Full));
tooltip += "\n" + WI.UIString("Originally %s").format(this.originalLocationString(WI.SourceCodeLocation.ColumnStyle.Shown, WI.SourceCodeLocation.NameStyle.Full));
var tooltip = WI.UIString("Located at %s").format(this.displayLocationString(WI.SourceCodeLocation.ColumnStyle.Shown, WI.SourceCodeLocation.NameStyle.Full));
tooltip += "\n" + WI.UIString("Originally %s").format(this.originalLocationString(WI.SourceCodeLocation.ColumnStyle.Shown, WI.SourceCodeLocation.NameStyle.Full));
return tooltip;
return prefix + name;
var lineSuffix = displayURL ? ":" + lineString : WI.UIString(" (line %s)").format(lineString);
return prefix + name + lineSuffix;
@/lua/ge/extensions/ui/vehicleSelector/general.lua
if not config then
log("W","",string.format("No config found for model: %s, config: %s", itemData.model, itemData.config))
end
@/lua/ge/extensions/ui/liveryEditor/utils.lua
-- return math.floor(value + 0.5)
-- local truncated = string.format("%.1f", value)
-- return tonumber(truncated)
local radians = degrees * (math.pi / 180)
local truncated = string.format("%.14f", radians)
return tonumber(truncated)
@/lua/vehicle/extensions/performanceLogger.lua
local display = tostring(showMin and minimums[name] or result)
log("I", "performanceLogger.measureAverage", string.format("%s: %.5f ms (avg over %i measurements)", name, display, stopCount))
end
@/lua/ge/extensions/editor/drivePathEditor/record.lua
local spline = splines[#splines]
spline.name = string.format("Recorded_%s", recordingVehicleName)
@/inspector/Views/AuditTestContentView.js
this._exportButtonNavigationItem = new WI.ButtonNavigationItem("audit-export", WI.UIString("Export"), "Images/Export.svg", 15, 15);
this._exportButtonNavigationItem.tooltip = WI.UIString("Export result (%s)").format(WI.saveKeyboardShortcut.displayName);
this._exportButtonNavigationItem.buttonStyle = WI.ButtonNavigationItem.Style.ImageAndText;
if (!this.placeholderElement || !this.placeholderElement.__placeholderStopping) {
this.placeholderElement = WI.createMessageTextView(WI.UIString("Stopping the \u201C%s\u201D audit").format(this.representedObject.name));
this.placeholderElement.__placeholderStopping = true;
this.placeholderElement = WI.createMessageTextView(message.format(this.representedObject.name), result.didError);
this.placeholderElement.__placeholderNoResultData = true;
@/lua/ge/extensions/editor/crawlEditor/trails.lua
for i, prefabFileName in ipairs(trail.prefabs) do
im.Text(string.format("Prefab %d:", i))
im.SameLine()
@/ui/ui-vue/src/bridge/libs/UIUnits.js
maximumFractionDigits: numDecs
}).format(helper.val)
return formattedVal + ' ' + helper.unit
minimumFractionDigits: 2
}).format(+x)
}
@/lua/common/libs/inspect/inspect.lua
shortControlCharEscapes[ch] = "\\"..i
longControlCharEscapes[ch] = string.format("\\%03d", i)
end
@/lua/vehicle/powertrain/turbocharger.lua
-- streams.drawGraph('spin pitch', {value = spindlePitch, max = 1})
-- if spindlePitch > 0 then print(string.format(" hiss volum = %0.2f / spin volum %.2f / spin pitch %.3f)", hissVolume, spindleVolume, spindlePitch)); end
end
-- Audio Debug
-- print (string.format(" BOV Volume(pressure) = %0.2f (= relativePressure %.2f * turboSizeCoef %.2f) :::: color(bovSoundVolumeCoef) = %0.2f ", relativePressure * turboSizeCoef, relativePressure, turboSizeCoef, bovSoundVolumeCoef).." :::: "..turbo.bovSoundFileName)
bovSound = bovSound or obj:createSFXSource2(turbo.bovSoundFileName or "event:>Vehicle>Forced_Induction>Turbo_01>turbo_bov", "AudioDefaultLoop3D", "Bov", assignedEngine.engineNodeID, 0)
-- Audio Debug
-- print (string.format("FLUT Volume(pressure) = %0.2f (= relativePressure %.2f * turboSizeCoef %.2f) :::: color(flutterSoundVolumeCoef) = %0.2f", relativePressure * turboSizeCoef, relativePressure, turboSizeCoef, flutterSoundVolumeCoef).." :::: "..turbo.flutterSoundFileName)
flutterSound = flutterSound or obj:createSFXSource2(turbo.flutterSoundFileName or "event:>Vehicle>Forced_Induction>Turbo_02>turbo_bov", "AudioDefaultLoop3D", "Flutter", assignedEngine.engineNodeID, 0)
-- Audio Debug
-- print (string.format("Turbo Hiss and Whine", turbo.hissLoopEvent).." : "..turbo.hissLoopEvent.." : "..turbo.whineLoopEvent)
-- print (string.format("turbo.hissVolumePerPSI = %.3f : turbo.whineVolumePer10kRPM = %.3f : turbo.whinePitchPer10kRPM = %.3f", turbo.hissVolumePerPSI, turbo.whineVolumePer10kRPM, turbo.whinePitchPer10kRPM))
-- print (string.format("Turbo Hiss and Whine", turbo.hissLoopEvent).." : "..turbo.hissLoopEvent.." : "..turbo.whineLoopEvent)
-- print (string.format("turbo.hissVolumePerPSI = %.3f : turbo.whineVolumePer10kRPM = %.3f : turbo.whinePitchPer10kRPM = %.3f", turbo.hissVolumePerPSI, turbo.whineVolumePer10kRPM, turbo.whinePitchPer10kRPM))
end
@/lua/common/tech/techCommunication.lua
local length = #message
local stringLength = string.format('%016d', length)
message = stringLength .. message
Try to restart BeamNG and use a different port number.]]
log('E', logTag, string.format(msg, port))
end
@/lua/common/utils/dateUtils.lua
if year == nil then
log('E', 'parseIso8601', string.format('Cannot parse datetime \'%s\'. Using current time instead.', datetime))
return os.time()
@/lua/ge/extensions/core/metrics.lua
if M.currentMode == 1 then
lineText = string.format("FPS: %5.1f [Avg %5.1f | Min %5.1f | Max %5.1f%s]", getConsoleNumber("fps::instantaneous"), getConsoleNumber("fps::avg"), getConsoleNumber("fps::min"), getConsoleNumber("fps::max"), rnd == 0 and "" or ", randomness "..rnd.."%")
im.TextUnformatted(lineText)
im.TableNextColumn()
columnText = string.format("FPS:")
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("%5.1f fps [Unmanaged: %5.1f fps]", getConsoleNumber("fps::instantaneous"), getConsoleNumber("fps::instantaneousUncap"))
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("Avg")
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("%5.1f fps", getConsoleNumber("fps::avg"))
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("10%% Below")
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("%5.1f fps",getConsoleNumber("fps::p90"))
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("5%% Below")
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("%5.1f fps", getConsoleNumber("fps::p95"))
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("1%% Below")
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("%5.1f fps", getConsoleNumber("fps::p99"))
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("Min")
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("%5.1f fps", getConsoleNumber("fps::min"))
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("Max")
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("%5.1f fps", getConsoleNumber("fps::max"))
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("DT:")
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("%5.2f ms [Unmanaged: %5.1f ms]", 1000 / getConsoleNumber("fps::instantaneous"), 1000 / getConsoleNumber("fps::instantaneousUncap"))
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("%5.2f ms", 1000 / (getConsoleNumber("fps::avg")))
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("%5.2f ms", 1000 / (getConsoleNumber("fps::p90")))
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("%5.2f ms", 1000 / (getConsoleNumber("fps::p95")))
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("%5.2f ms", 1000 / (getConsoleNumber("fps::p99")))
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("%5.2f ms", 1000 / (getConsoleNumber("fps::min")))
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("%5.2f ms", 1000 / (getConsoleNumber("fps::max")))
if not imguiVisible then table.insert(lineTexts, columnText) end
lineText = string.format("WaitforGPU: %4.2f ms%s", getConsoleNumber("fps::waitForGPU"), rnd == 0 and "" or ", WARNING: RANDOMNESS="..rnd.."%")
local managers = {}
if M.currentMode > 2 then
lineText = string.format("GFX: PolyCount: %d DrawCalls: %d StateChanges: %d RTChanges: %d",
getConsoleNumber("$GFXDeviceStatistics::polyCount"), getConsoleNumber("$GFXDeviceStatistics::drawCalls"), getConsoleNumber("$GFXDeviceStatistics::drawStateChanges"), getConsoleNumber("$GFXDeviceStatistics::renderTargetChanges"))
lineText = string.format("Terrain: Cells: %d Override Cells: %d DrawCalls: %d",
getConsoleNumber("$TerrainBlock::cellsRendered"), getConsoleNumber("$TerrainBlock::overrideCells"), getConsoleNumber("$TerrainBlock::drawCalls"))
lineText = string.format("GroundCover: Cells: %d Billboards: %d Batches: %d Shapes: %d",
getConsoleNumber("$GroundCover::renderedCells"), getConsoleNumber("$GroundCover::renderedBillboards"), getConsoleNumber("$GroundCover::renderedBatches"), getConsoleNumber("GroundCover::renderedShapes"))
lineText = string.format("Forest: Cells: %d Cells Meshed: %d Cells Billboarded: %d Meshes: %d Billboards: %d",
getConsoleNumber("$Forest::totalCells"), getConsoleNumber("$Forest::cellsRendered"), getConsoleNumber("$Forest::cellsBatched"), getConsoleNumber("$Forest::cellItemsRendered"), getConsoleNumber("$Forest::cellItemsBatched"))
lineText = string.format("Shadow: Active: %d Updated: %d PolyCount: %d DrawCalls: %d StateChanges: %d RTChanges: %d",
getConsoleNumber("$ShadowStats::activeMaps"), getConsoleNumber("$ShadowStats::updatedMaps"), getConsoleNumber("$ShadowStats::polyCount"), getConsoleNumber("$ShadowStats::drawCalls"), getConsoleNumber("$ShadowStats::drawStateChanges"), getConsoleNumber("$ShadowStats::rtChanges"))
lineText = string.format("LightManager: Active: %d Updated: %d Elapsed Ms: %5.2f",
getConsoleNumber("$BasicLightManagerStats::activePlugins"), getConsoleNumber("$BasicLightManagerStats::shadowsUpdated"), getConsoleNumber("$BasicLightManagerStats::elapsedUpdateTime") * 1000)
lineText = string.format("Deferred Lights: Active: %d Culled: %d",
getConsoleNumber("$lightMetrics::activeLights"), getConsoleNumber("$lightMetrics::culledLights"))
@/lua/vehicle/mapmgr.lua
local function requestMap()
obj:queueGameEngineLua(string.format('map.request(%s,%s)', objectId, mapBuildSerial))
end
@/inspector/Views/SourcesNavigationSidebarPanel.js
identifier: "debugger-breakpoints",
defaultToolTip: WI.UIString("Enable all breakpoints (%s)").format(WI.toggleBreakpointsKeyboardShortcut.displayName),
activatedToolTip: WI.UIString("Disable all breakpoints (%s)").format(WI.toggleBreakpointsKeyboardShortcut.displayName),
defaultToolTip: WI.UIString("Enable all breakpoints (%s)").format(WI.toggleBreakpointsKeyboardShortcut.displayName),
activatedToolTip: WI.UIString("Disable all breakpoints (%s)").format(WI.toggleBreakpointsKeyboardShortcut.displayName),
image: "Images/Breakpoints.svg",
identifier: "debugger-pause-resume",
defaultToolTip: WI.UIString("Pause script execution (%s or %s)").format(WI.pauseOrResumeKeyboardShortcut.displayName, WI.pauseOrResumeAlternateKeyboardShortcut.displayName),
alternateToolTip: WI.UIString("Continue script execution (%s or %s)").format(WI.pauseOrResumeKeyboardShortcut.displayName, WI.pauseOrResumeAlternateKeyboardShortcut.displayName),
defaultToolTip: WI.UIString("Pause script execution (%s or %s)").format(WI.pauseOrResumeKeyboardShortcut.displayName, WI.pauseOrResumeAlternateKeyboardShortcut.displayName),
alternateToolTip: WI.UIString("Continue script execution (%s or %s)").format(WI.pauseOrResumeKeyboardShortcut.displayName, WI.pauseOrResumeAlternateKeyboardShortcut.displayName),
defaultImage: "Images/Pause.svg",
identifier: "debugger-step-over",
toolTipOrLabel: WI.UIString("Step over (%s or %s)").format(WI.stepOverKeyboardShortcut.displayName, WI.stepOverAlternateKeyboardShortcut.displayName),
image: "Images/StepOver.svg",
identifier: "debugger-step-into",
toolTipOrLabel: WI.UIString("Step into (%s or %s)").format(WI.stepIntoKeyboardShortcut.displayName, WI.stepIntoAlternateKeyboardShortcut.displayName),
image: "Images/StepInto.svg",
identifier: "debugger-step-out",
toolTipOrLabel: WI.UIString("Step out (%s or %s)").format(WI.stepOutKeyboardShortcut.displayName, WI.stepOutAlternateKeyboardShortcut.displayName),
image: "Images/StepOut.svg",
className: "breakpoint-paused-icon",
title: WI.UIString("%s Fired").format(pauseData.eventName),
});
if (pauseData && pauseData.message)
this._pauseReasonTextRow.text = WI.UIString("Assertion with message: %s").format(pauseData.message);
else
// COMPATIBILITY (iOS 8): 'directive' was 'directiveText'.
this._pauseReasonTextRow.text = WI.UIString("Content Security Policy violation of directive: %s").format(pauseData.directive || pauseData.directiveText);
this._pauseReasonGroup.rows = [this._pauseReasonTextRow];
className: "breakpoint-paused-icon",
title: WI.UIString("\u201C%s\u201D Event Fired").format(pauseData.eventName),
});
let data = WI.RemoteObject.fromPayload(pauseData, target);
this._pauseReasonTextRow.text = WI.UIString("Exception with thrown value: %s").format(data.description);
this._pauseReasonGroup.rows = [this._pauseReasonTextRow];
className: "breakpoint-paused-icon",
title: WI.UIString("%s Fired").format(pauseData.eventName),
});
console.assert(pauseData.breakpointURL === "", "Should be the All Requests breakpoint which has an empty URL");
this._pauseReasonTextRow.text = WI.UIString("Requesting: %s").format(pauseData.url);
this._pauseReasonGroup.rows = [this._pauseReasonTextRow];
@/lua/ge/extensions/gameplay/drift/scoring.lua
if im.Begin("Drift score") then
im.Text(string.format("Score : %i", driftScore.score))
im.Text(string.format("Cached score : %i", driftScore.cachedScore))
im.Text(string.format("Score : %i", driftScore.score))
im.Text(string.format("Cached score : %i", driftScore.cachedScore))
im.Text(string.format("Potential score : %i", driftScore.potentialScore))
im.Text(string.format("Cached score : %i", driftScore.cachedScore))
im.Text(string.format("Potential score : %i", driftScore.potentialScore))
im.Text(string.format("Combo : %0.2f Combo creep up : %d", driftScore.combo, driftScore.comboCreepup))
im.Text(string.format("Potential score : %i", driftScore.potentialScore))
im.Text(string.format("Combo : %0.2f Combo creep up : %d", driftScore.combo, driftScore.comboCreepup))
im.Text(string.format("Current perfomance factor : %0.2f (%i) | Very good drift score : %0.2f", performanceFactor, steppedPerformanceFactor, veryGoodScore))
im.Text(string.format("Combo : %0.2f Combo creep up : %d", driftScore.combo, driftScore.comboCreepup))
im.Text(string.format("Current perfomance factor : %0.2f (%i) | Very good drift score : %0.2f", performanceFactor, steppedPerformanceFactor, veryGoodScore))
im.Text(string.format("Score added this frame : %0.2f", scoreAddedThisFrame))
im.Text(string.format("Wall multi this frame : %0.2f", wallMulti))
im.Text(string.format("Score added this frame : %0.2f", scoreAddedThisFrame))
im.Text(string.format("Wall multi this frame : %0.2f", wallMulti))
im.Text(string.format("Speed multi this frame : %0.2f", speedMulti))
im.Text(string.format("Wall multi this frame : %0.2f", wallMulti))
im.Text(string.format("Speed multi this frame : %0.2f", speedMulti))
im.Text(string.format("Angle multi this frame : %0.2f", angleMulti))
im.Text(string.format("Speed multi this frame : %0.2f", speedMulti))
im.Text(string.format("Angle multi this frame : %0.2f", angleMulti))
else
@/lua/ge/extensions/editor/decalSpline/populate.lua
local newFolder = createObject("SimGroup")
newFolder:registerObject(string.format("%s - %s", uniqueName, folderNameId))
scenetree.MissionGroup:addObject(newFolder)
@/lua/ge/extensions/flowgraph/nodes/gameplay/dragRace/setRacerDial.lua
if expectedFailedCount > 0 then
self:__setNodeError('partial', string.format('Failed to set %d dial(s), succeeded: %d', expectedFailedCount, expectedSuccessCount))
else
@/lua/ge/extensions/gameplay/rally/tools/rallyToolbox.lua
local txt = '['..waypointTypes.shortenWaypointType(self.selectedPacenoteWaypoint.waypointType)..']'
im.Text(string.format("Selected PacenoteWaypoint: %s%s", self.selectedPacenote.name, txt))
else
local distStr = string.format("%s %.2fkm | veh->%.1fm", pnType, distKm, distToSplit)
-- local distStr = string.format("split %.8f", distFromStart)
local distStr = string.format("%s %.2fkm | veh->%.1fm", pnType, distKm, distToSplit)
-- local distStr = string.format("split %.8f", distFromStart)
debugDrawer:drawTextAdvanced(point.pos, distStr, ColorF(0,0,0,1), true, false, ColorI(255,128,0,255), false, false)
debugDrawer:drawSquarePrism(from.pos, to.pos, Point2F(2,4), Point2F(0,0), ColorF(segClr[1],segClr[2],segClr[3],alpha))
debugDrawer:drawTextAdvanced(from.pos, String(string.format("%s [%s FROM]", fromName, seg.name)), textFg, true, false, ColorI(segClr[1]*255,segClr[2]*255,segClr[3]*255,255))
debugDrawer:drawTextAdvanced(to.pos, String(string.format("%s [%s TO]", toName, seg.name)), textFg, true, false, ColorI(segClr[1]*255,segClr[2]*255,segClr[3]*255,255))
debugDrawer:drawTextAdvanced(from.pos, String(string.format("%s [%s FROM]", fromName, seg.name)), textFg, true, false, ColorI(segClr[1]*255,segClr[2]*255,segClr[3]*255,255))
debugDrawer:drawTextAdvanced(to.pos, String(string.format("%s [%s TO]", toName, seg.name)), textFg, true, false, ColorI(segClr[1]*255,segClr[2]*255,segClr[3]*255,255))
debugDrawer:drawTextAdvanced(projPos,
String(string.format("minSqDist to segment: %.2fm^2", self.lineSegState.minDistSq)),
ColorF(0,0,0,1), true, false,
debugDrawer:drawTextAdvanced(item,
String(string.format("closest route point to wp %.2fm", dist)),
ColorF(0,0,0,1), true, false,
local clrIBg = ColorI(clr[1] * 255, clr[2] * 255, clr[3] * 255, 255)
debugDrawer:drawTextAdvanced(txtPos, String(string.format("%s[%s]%s", pacenoteName, wpType, pacenoteText)), clrFg, true, false, clrIBg)
end
debugDrawer:drawTextAdvanced(item,
String(string.format("closest wp to veh %.2fm", self.kdStatePacenoteWaypoints.dist)),
ColorF(1,1,1,1), true, false,
debugDrawer:drawTextAdvanced(item.pos,
String(string.format("closest route point to veh %.2fm", self.kdStateDrivelineRoute.dist)),
ColorF(0,0,0,1), true, false,
debugDrawer:drawTextAdvanced(wpRp.pos,
String(string.format("next pacenoteWP: %s[%s]", pnName, wpType)),
ColorF(0,0,0,1), true, false,
debugDrawer:drawTextAdvanced(pos,
String(string.format("%0.1f mph", speed * 2.23694)), -- convert m/s to mph
ColorF(1,1,1,1), true, false,
-- debugDrawer:drawTextAdvanced(point.pos,
-- String(string.format("pre_%d", i)),
-- ColorF(i < 10 and 1 or 0, i < 10 and 1 or 0, i < 10 and 1 or 0, 1), true, false,
debugDrawer:drawTextAdvanced(wpRp.pos,
String(string.format("driveline.nextPacenoteWpFromRecalc: %s[%s]", pnName, wpType)),
ColorF(0,0,0,1), true, false,
debugDrawer:drawTextAdvanced(pos,
String(string.format("driveline.lastRecalculateVehiclePos")),
ColorF(0,0,0,1), true, false,
debugDrawer:drawTextAdvanced(point.pos,
String(string.format("driveline.debugNearestRecalcPoint")),
ColorF(0,0,0,1), true, false,
debugDrawer:drawTextAdvanced(wpRp.pos,
String(string.format("driveline.nextRacePathnodeFromRecalc: %s", dr.nextRacePathnodeFromRecalc.name)),
ColorF(0,0,0,1), true, false,
-- debugDrawer:drawTextAdvanced(pos,
-- String(string.format("%dm", completionData.distM)),
-- ColorF(1,1,1,1), true, false, ColorI(0,0,0,255))
-- ColorF(1,1,1,1), true, false, ColorI(0,0,0,255))
local dataStr = string.format("%.3fkm | %.1f%%", completionData.distM / 1000, completionData.distPct * 100)
debugDrawer:drawTextAdvanced(pos,
-- debugDrawer:drawTextAdvanced(point.pos + vec3(0,0,2),
-- String(string.format("recce_driveline_point_%d", i)),
-- ColorF(1,1,1,1), true, false, ColorI(0,0,0,255))
-- debugDrawer:drawTextAdvanced(point.pos + vec3(0,0,2),
-- String(string.format("finalPreRouteInput_%d", i)),
-- ColorF(1,1,1,1), true, false, ColorI(128,0,128,255))
-- debugDrawer:drawTextAdvanced(debugFixStartEnd_p.pos,
-- String(string.format("xnorm: %.2f", debugFixStartEnd_xnorm)),
-- ColorF(0,0,0,1), true, false, ColorI(255,255,0,255))
@/lua/ge/extensions/gameplay/markerInteraction.lua
showMarker = showMarker and (not cluster.visibleBySetting or markerVisibilityBySetting[cluster.visibleBySetting] or cluster.focus)
--dump(string.format("cluster %s, is nearby: %s, marker focus: %s, cluster focus: %s", cluster.id, nearbyIds[cluster.id], marker.focus, cluster.focus))
--dump(string.format("cluster %s, is showMarker: %s", cluster.id, showMarker))
--dump(string.format("cluster %s, is nearby: %s, marker focus: %s, cluster focus: %s", cluster.id, nearbyIds[cluster.id], marker.focus, cluster.focus))
--dump(string.format("cluster %s, is showMarker: %s", cluster.id, showMarker))
if showMarker then
@/inspector/Views/CPUTimelineView.js
let p1 = this._energyInfoPopoverContentElement.appendChild(document.createElement("p"));
p1.textContent = WI.UIString("Periods of high CPU utilization will rapidly drain battery. Strive to keep idle pages under %s average CPU utilization.").format(lowPercent);
let millisecondsStringNoDecimal = WI.UIString("%.0fms").format(nonIdleSamplesCount);
samplesElement.textContent = millisecondsStringNoDecimal;
for (let [key, entry] of sorted) {
let numberValue = entry.repeating ? WI.UIString("~%s", "Approximate Number", "Approximate count of events").format(entry.count) : entry.count;
let sourceCodeLocation = entry.callFrame ? entry.callFrame.sourceCodeLocation : entry.sourceCodeLocation;
this._energyImpactNumberElement.textContent = WI.UIString("Average CPU: %s").format(Number.percentageString(average / 100));
let durationDisplayString = Math.floor(visibleDuration);
this._energyImpactDurationElement.textContent = WI.UIString("Duration: %ss", "The duration of the Timeline recording in seconds (s).").format(durationDisplayString);
}
@/inspector/Debug/Bootstrap.js
let inspectionLevel = InspectorFrontendHost.inspectionLevel();
const inspectInspectorToolTip = WI.unlocalizedString("Open Web Inspector [%d]").format(inspectionLevel + 1);
let inspectInspectorToolbarItem = new WI.ButtonToolbarItem("inspect-inspector", inspectInspectorToolTip);
@/inspector/External/three.js/three.js
// film not completely covered in portrait format (aspect < 1)
return this.filmGauge * Math.min( this.aspect, 1 );
// film not completely covered in landscape format (aspect > 1)
return this.filmGauge / Math.max( this.aspect, 1 );
@/ui/lib/ext/angular-ui-router.min.js
*/
"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="ui.router"),function(a,b,c){"use strict";function d(a,b){return S(new(S(function(){},{prototype:a})),b)}function e(a){return R(arguments,function(b){b!==a&&R(b,function(b,c){a.hasOwnProperty(c)||(a[c]=b)})}),a}function f(a,b){var c=[];for(var d in a.path){if(a.path[d]!==b.path[d])break;c.push(a.path[d])}return c}function g(a){if(Object.keys)return Object.keys(a);var b=[];return R(a,function(a,c){b.push(c)}),b}function h(a,b){if(Array.prototype.indexOf)return a.indexOf(b,Number(arguments[2])||0);var c=a.length>>>0,d=Number(arguments[2])||0;for(d=d<0?Math.ceil(d):Math.floor(d),d<0&&(d+=c);d=0||(k.push(e[m]),j[e[m]]=a[e[m]]);return S({},j,b)}function j(a,b,c){if(!c){c=[];for(var d in a)c.push(d)}for(var e=0;e "));if(s[c]=d,O(a))q.push(c,[function(){return b.get(a)}],j);else{var e=b.annotate(a);R(e,function(a){a!==c&&i.hasOwnProperty(a)&&n(i[a],a)}),q.push(c,a,e)}r.pop(),s[c]=f}}function o(a){return P(a)&&a.then&&a.$$promises}if(!P(i))throw new Error("'invocables' must be an object");var p=g(i||{}),q=[],r=[],s={};return R(i,n),i=r=s=null,function(d,f,g){function h(){--u||(v||e(t,f.$$values),r.$$values=t,r.$$promises=r.$$promises||!0,delete r.$$inheritedValues,n.resolve(t))}function i(a){r.$$failure=a,n.reject(a)}function j(c,e,f){function j(a){l.reject(a),i(a)}function k(){if(!M(r.$$failure))try{l.resolve(b.invoke(e,g,t)),l.promise.then(function(a){t[c]=a,h()},j)}catch(a){j(a)}}var l=a.defer(),m=0;R(f,function(a){s.hasOwnProperty(a)&&!d.hasOwnProperty(a)&&(m++,s[a].then(function(b){t[a]=b,--m||k()},j))}),m||k(),s[c]=l.promise}if(o(d)&&g===c&&(g=f,f=d,d=null),d){if(!P(d))throw new Error("'locals' must be an object")}else d=k;if(f){if(!o(f))throw new Error("'parent' must be a promise returned by $resolve.resolve()")}else f=l;var n=a.defer(),r=n.promise,s=r.$$promises={},t=S({},d),u=1+q.length/3,v=!1;if(M(f.$$failure))return i(f.$$failure),r;f.$$inheritedValues&&e(t,m(f.$$inheritedValues,p)),S(s,f.$$promises),f.$$values?(v=e(t,m(f.$$values,p)),r.$$inheritedValues=m(f.$$values,p),h()):(f.$$inheritedValues&&(r.$$inheritedValues=m(f.$$inheritedValues,p)),f.then(h,i));for(var w=0,x=q.length;w=0));)s=f(r.id,r.type,r.cfg,"path"),l+=g(r.segment,s.type.pattern.source,s.squash,s.isOptional),n.push(r.segment),m=j.lastIndex;t=a.substring(m);var u=t.indexOf("?");if(u>=0){var v=this.sourceSearch=t.substring(u);if(t=t.substring(0,u),this.sourcePath=a.substring(0,m+u),v.length>0)for(m=0;i=k.exec(v);)r=h(i,!0),s=f(r.id,r.type,r.cfg,"search"),m=j.lastIndex}else this.sourcePath=a,this.sourceSearch="";l+=g(t)+(b.strict===!1?"/?":"")+"$",n.push(t),this.regexp=new RegExp(l,b.caseInsensitive?"i":c),this.prefix=n[0],this.$$paramNames=q}function t(a){S(this,a)}function u(){function a(a){return null!=a?a.toString().replace(/(~|\/)/g,function(a){return{"~":"~~","/":"~2F"}[a]}):a}function e(a){return null!=a?a.toString().replace(/(~~|~2F)/g,function(a){return{"~~":"~","~2F":"/"}[a]}):a}function f(){return{strict:p,caseInsensitive:m}}function i(a){return N(a)||Q(a)&&N(a[a.length-1])}function j(){for(;w.length;){var a=w.shift();if(a.pattern)throw new Error("You cannot override a type's .pattern at runtime.");b.extend(r[a.name],l.invoke(a.def))}}function k(a){S(this,a||{})}V=this;var l,m=!1,p=!0,q=!1,r={},v=!0,w=[],x={string:{encode:a,decode:e,is:function(a){return null==a||!M(a)||"string"==typeof a},pattern:/[^\/]*/},int:{encode:a,decode:function(a){return parseInt(a,10)},is:function(a){return M(a)&&this.decode(a.toString())===a},pattern:/\d+/},bool:{encode:function(a){return a?1:0},decode:function(a){return 0!==parseInt(a,10)},is:function(a){return a===!0||a===!1},pattern:/0|1/},date:{encode:function(a){return this.is(a)?[a.getFullYear(),("0"+(a.getMonth()+1)).slice(-2),("0"+a.getDate()).slice(-2)].join("-"):c},decode:function(a){if(this.is(a))return a;var b=this.capture.exec(a);return b?new Date(b[1],b[2]-1,b[3]):c},is:function(a){return a instanceof Date&&!isNaN(a.valueOf())},equals:function(a,b){return this.is(a)&&this.is(b)&&a.toISOString()===b.toISOString()},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/},json:{encode:b.toJson,decode:b.fromJson,is:b.isObject,equals:b.equals,pattern:/[^\/]*/},any:{encode:b.identity,decode:b.identity,equals:b.equals,pattern:/.*/}};u.$$getDefaultValue=function(a){if(!i(a.value))return a.value;if(!l)throw new Error("Injectable functions cannot be called at configuration time");return l.invoke(a.value)},this.caseInsensitive=function(a){return M(a)&&(m=a),m},this.strictMode=function(a){return M(a)&&(p=a),p},this.defaultSquashPolicy=function(a){if(!M(a))return q;if(a!==!0&&a!==!1&&!O(a))throw new Error("Invalid squash policy: "+a+". Valid policies: false, true, arbitrary-string");return q=a,a},this.compile=function(a,b){return new s(a,S(f(),b))},this.isMatcher=function(a){if(!P(a))return!1;var b=!0;return R(s.prototype,function(c,d){N(c)&&(b=b&&M(a[d])&&N(a[d]))}),b},this.type=function(a,b,c){if(!M(b))return r[a];if(r.hasOwnProperty(a))throw new Error("A type named '"+a+"' has already been defined.");return r[a]=new t(S({name:a},b)),c&&(w.push({name:a,def:c}),v||j()),this},R(x,function(a,b){r[b]=new t(S({name:b},a))}),r=d(r,{}),this.$get=["$injector",function(a){return l=a,v=!1,j(),R(x,function(a,b){r[b]||(r[b]=new t(a))}),this}],this.Param=function(a,d,e,f){function j(a){var b=P(a)?g(a):[],c=h(b,"value")===-1&&h(b,"type")===-1&&h(b,"squash")===-1&&h(b,"array")===-1;return c&&(a={value:a}),a.$$fn=i(a.value)?a.value:function(){return a.value},a}function k(c,d,e){if(c.type&&d)throw new Error("Param '"+a+"' has two type configurations.");return d?d:c.type?b.isString(c.type)?r[c.type]:c.type instanceof t?c.type:new t(c.type):"config"===e?r.any:r.string}function m(){var b={array:"search"===f&&"auto"},c=a.match(/\[\]$/)?{array:!0}:{};return S(b,c,e).array}function p(a,b){var c=a.squash;if(!b||c===!1)return!1;if(!M(c)||null==c)return q;if(c===!0||O(c))return c;throw new Error("Invalid squash policy: '"+c+"'. Valid policies: false, true, or arbitrary string")}function s(a,b,d,e){var f,g,i=[{from:"",to:d||b?c:""},{from:null,to:d||b?c:""}];return f=Q(a.replace)?a.replace:[],O(e)&&f.push({from:e,to:c}),g=o(f,function(a){return a.from}),n(i,function(a){return h(g,a.from)===-1}).concat(f)}function u(){if(!l)throw new Error("Injectable functions cannot be called at configuration time");var a=l.invoke(e.$$fn);if(null!==a&&a!==c&&!x.type.is(a))throw new Error("Default value ("+a+") for parameter '"+x.id+"' is not an instance of Type ("+x.type.name+")");return a}function v(a){function b(a){return function(b){return b.from===a}}function c(a){var c=o(n(x.replace,b(a)),function(a){return a.to});return c.length?c[0]:a}return a=c(a),M(a)?x.type.$normalize(a):u()}function w(){return"{Param:"+a+" "+d+" squash: '"+A+"' optional: "+z+"}"}var x=this;e=j(e),d=k(e,d,f);var y=m();d=y?d.$asArray(y,"search"===f):d,"string"!==d.name||y||"path"!==f||e.value!==c||(e.value="");var z=e.value!==c,A=p(e,z),B=s(e,y,z,A);S(this,{id:a,type:d,location:f,array:y,squash:A,replace:B,isOptional:z,value:v,dynamic:c,config:e,toString:w})},k.prototype={$$new:function(){return d(this,S(new k,{$$parent:this}))},$$keys:function(){for(var a=[],b=[],c=this,d=g(k.prototype);c;)b.push(c),c=c.$$parent;return b.reverse(),R(b,function(b){R(g(b),function(b){h(a,b)===-1&&h(d,b)===-1&&a.push(b)})}),a},$$values:function(a){var b={},c=this;return R(c.$$keys(),function(d){b[d]=c[d].value(a&&a[d])}),b},$$equals:function(a,b){var c=!0,d=this;return R(d.$$keys(),function(e){var f=a&&a[e],g=b&&b[e];d[e].type.equals(f,g)||(c=!1)}),c},$$validates:function(a){var d,e,f,g,h,i=this.$$keys();for(d=0;d=0)throw new Error("State must have a valid name");if(A.hasOwnProperty(c))throw new Error("State '"+c+"' is already defined");var e=c.indexOf(".")!==-1?c.substring(0,c.lastIndexOf(".")):O(b.parent)?b.parent:P(b.parent)&&O(b.parent.name)?b.parent.name:"";if(e&&!A[e])return n(e,b.self);for(var f in D)N(D[f])&&(b[f]=D[f](b,D.$delegates[f]));return A[c]=b,!b[C]&&b.url&&a.when(b.url,["$match","$stateParams",function(a,c){z.$current.navigable==b&&j(a,c)||z.transitionTo(b,a,{inherit:!0,location:!1})}]),q(c),b}function s(a){return a.indexOf("*")>-1}function t(a){for(var b=a.split("."),c=z.$current.name.split("."),d=0,e=b.length;d=A;d--)g=o[d],g.self.onExit&&h.invoke(g.self.onExit,g.self,g.locals.globals),g.locals=null;for(d=A;d2?k.enter(a,null,c).then(d):k.enter(a,null,c,d)},leave:function(a,c){b.version.minor>2?k.leave(a).then(c):k.leave(a,c)}};if(j){var e=j&&j(c,a);return{enter:function(a,b,c){e.enter(a,null,b),c()},leave:function(a,b){e.leave(a),b()}}}return d()}var i=g(),j=i("$animator"),k=i("$animate"),l={restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(c,g,i){return function(c,g,j){function k(){if(m&&(m.remove(),m=null),o&&(o.$destroy(),o=null),n){var a=n.data("$uiViewAnim");s.leave(n,function(){a.$$animLeave.resolve(),m=null}),m=n,n=null}}function l(h){var l,m=B(c,j,g,e),t=m&&a.$current&&a.$current.locals[m];if(h||t!==p){l=c.$new(),p=a.$current.locals[m],l.$emit("$viewContentLoading",m);var u=i(l,function(a){var e=f.defer(),h=f.defer(),i={$animEnter:e.promise,$animLeave:h.promise,$$animLeave:h};a.data("$uiViewAnim",i),s.enter(a,g,function(){e.resolve(),o&&o.$emit("$viewContentAnimationEnded"),(b.isDefined(r)&&!r||c.$eval(r))&&d(a)}),k()});n=u,o=l,o.$emit("$viewContentLoaded",m),o.$eval(q)}}var m,n,o,p,q=j.onload||"",r=j.autoscroll,s=h(j,c);g.inheritedData("$uiView");c.$on("$stateChangeSuccess",function(){l(!1)}),l(!0)}}};return l}function A(a,c,d,e){return{restrict:"ECA",priority:-400,compile:function(f){var g=f.html();return function(f,h,i){var j=d.$current,k=B(f,i,h,e),l=j&&j.locals[k];if(l){h.data("$uiView",{name:k,state:l.$$state}),h.html(l.$template?l.$template:g);var m=b.extend({},l);f[l.$$resolveAs]=m;var n=a(h.contents());if(l.$$controller){l.$scope=f,l.$element=h;var o=c(l.$$controller,l);l.$$controllerAs&&(f[l.$$controllerAs]=o,f[l.$$controllerAs][l.$$resolveAs]=m),N(o.$onInit)&&o.$onInit(),h.data("$ngControllerController",o),h.children().data("$ngControllerController",o)}n(f)}}}}}function B(a,b,c,d){var e=d(b.uiView||b.name||"")(a),f=c.inheritedData("$uiView");return e.indexOf("@")>=0?e:e+"@"+(f?f.state.name:"")}function C(a,b){var c,d=a.match(/^\s*({[^}]*})\s*$/);if(d&&(a=b+"("+d[1]+")"),c=a.replace(/\n/g," ").match(/^([^(]+?)\s*(\((.*)\))?$/),!c||4!==c.length)throw new Error("Invalid state ref '"+a+"'");return{state:c[1],paramExpr:c[3]||null}}function D(a){var b=a.parent().inheritedData("$uiView");if(b&&b.state&&b.state.name)return b.state}function E(a){var b="[object SVGAnimatedString]"===Object.prototype.toString.call(a.prop("href")),c="FORM"===a[0].nodeName;return{attr:c?"action":b?"xlink:href":"href",isAnchor:"A"===a.prop("tagName").toUpperCase(),clickable:!c}}function F(a,b,c,d,e){return function(f){var g=f.which||f.button,h=e();if(!(g>1||f.ctrlKey||f.metaKey||f.shiftKey||a.attr("target"))){var i=c(function(){b.go(h.state,h.params,h.options)});f.preventDefault();var j=d.isAnchor&&!h.href?1:0;f.preventDefault=function(){j--<=0&&c.cancel(i)}}}}function G(a,b){return{relative:D(a)||b.$current,inherit:!0}}function H(a,c){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(d,e,f,g){var h,i=C(f.uiSref,a.current.name),j={state:i.state,href:null,params:null},k=E(e),l=g[1]||g[0],m=null;j.options=S(G(e,a),f.uiSrefOpts?d.$eval(f.uiSrefOpts):{});var n=function(c){c&&(j.params=b.copy(c)),j.href=a.href(i.state,j.params,j.options),m&&m(),l&&(m=l.$$addStateInfo(i.state,j.params)),null!==j.href&&f.$set(k.attr,j.href)};i.paramExpr&&(d.$watch(i.paramExpr,function(a){a!==j.params&&n(a)},!0),j.params=b.copy(d.$eval(i.paramExpr))),n(),k.clickable&&(h=F(e,a,c,k,function(){return j}),e[e.on?"on":"bind"]("click",h),d.$on("$destroy",function(){e[e.off?"off":"unbind"]("click",h)}))}}}function I(a,b){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(c,d,e,f){function g(b){m.state=b[0],m.params=b[1],m.options=b[2],m.href=a.href(m.state,m.params,m.options),n&&n(),j&&(n=j.$$addStateInfo(m.state,m.params)),m.href&&e.$set(i.attr,m.href)}var h,i=E(d),j=f[1]||f[0],k=[e.uiState,e.uiStateParams||null,e.uiStateOpts||null],l="["+k.map(function(a){return a||"null"}).join(", ")+"]",m={state:null,params:null,options:null,href:null},n=null;c.$watch(l,g,!0),g(c.$eval(l)),i.clickable&&(h=F(d,a,b,i,function(){return m}),d[d.on?"on":"bind"]("click",h),c.$on("$destroy",function(){d[d.off?"off":"unbind"]("click",h)}))}}}function J(a,b,c){return{restrict:"A",controller:["$scope","$element","$attrs","$timeout",function(b,d,e,f){function g(b,c,e){var f=a.get(b,D(d)),g=h(b,c),i={state:f||{name:b},params:c,hash:g};return p.push(i),q[g]=e,function(){var a=p.indexOf(i);a!==-1&&p.splice(a,1)}}function h(a,c){if(!O(a))throw new Error("state should be a string");return P(c)?a+U(c):(c=b.$eval(c),P(c)?a+U(c):a)}function i(){for(var a=0;a0)){var c=g(a,b,o);return i(),c}},b.$on("$stateChangeSuccess",i),i()}]}}function K(a){var b=function(b,c){return a.is(b,c)};return b.$stateful=!0,b}function L(a){var b=function(b,c,d){return a.includes(b,c,d)};return b.$stateful=!0,b}var M=b.isDefined,N=b.isFunction,O=b.isString,P=b.isObject,Q=b.isArray,R=b.forEach,S=b.extend,T=b.copy,U=b.toJson;b.module("ui.router.util",["ng"]),b.module("ui.router.router",["ui.router.util"]),b.module("ui.router.state",["ui.router.router","ui.router.util"]),b.module("ui.router",["ui.router.state"]),b.module("ui.router.compat",["ui.router"]),q.$inject=["$q","$injector"],b.module("ui.router.util").service("$resolve",q),r.$inject=["$http","$templateCache","$injector"],b.module("ui.router.util").service("$templateFactory",r);var V;s.prototype.concat=function(a,b){var c={caseInsensitive:V.caseInsensitive(),strict:V.strictMode(),squash:V.defaultSquashPolicy()};return new s(this.sourcePath+a+this.sourceSearch,S(c,b),this)},s.prototype.toString=function(){return this.source},s.prototype.exec=function(a,b){function c(a){function b(a){return a.split("").reverse().join("")}function c(a){return a.replace(/\\-/g,"-")}var d=b(a).split(/-(?!\\)/),e=o(d,b);return o(e,c).reverse()}var d=this.regexp.exec(a);if(!d)return null;b=b||{};var e,f,g,h=this.parameters(),i=h.length,j=this.segments.length-1,k={};if(j!==d.length-1)throw new Error("Unbalanced capture group in route '"+this.source+"'");var l,m;for(e=0;e
*/
"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="ui.router"),function(a,b,c){"use strict";function d(a,b){return S(new(S(function(){},{prototype:a})),b)}function e(a){return R(arguments,function(b){b!==a&&R(b,function(b,c){a.hasOwnProperty(c)||(a[c]=b)})}),a}function f(a,b){var c=[];for(var d in a.path){if(a.path[d]!==b.path[d])break;c.push(a.path[d])}return c}function g(a){if(Object.keys)return Object.keys(a);var b=[];return R(a,function(a,c){b.push(c)}),b}function h(a,b){if(Array.prototype.indexOf)return a.indexOf(b,Number(arguments[2])||0);var c=a.length>>>0,d=Number(arguments[2])||0;for(d=d<0?Math.ceil(d):Math.floor(d),d<0&&(d+=c);d=0||(k.push(e[m]),j[e[m]]=a[e[m]]);return S({},j,b)}function j(a,b,c){if(!c){c=[];for(var d in a)c.push(d)}for(var e=0;e "));if(s[c]=d,O(a))q.push(c,[function(){return b.get(a)}],j);else{var e=b.annotate(a);R(e,function(a){a!==c&&i.hasOwnProperty(a)&&n(i[a],a)}),q.push(c,a,e)}r.pop(),s[c]=f}}function o(a){return P(a)&&a.then&&a.$$promises}if(!P(i))throw new Error("'invocables' must be an object");var p=g(i||{}),q=[],r=[],s={};return R(i,n),i=r=s=null,function(d,f,g){function h(){--u||(v||e(t,f.$$values),r.$$values=t,r.$$promises=r.$$promises||!0,delete r.$$inheritedValues,n.resolve(t))}function i(a){r.$$failure=a,n.reject(a)}function j(c,e,f){function j(a){l.reject(a),i(a)}function k(){if(!M(r.$$failure))try{l.resolve(b.invoke(e,g,t)),l.promise.then(function(a){t[c]=a,h()},j)}catch(a){j(a)}}var l=a.defer(),m=0;R(f,function(a){s.hasOwnProperty(a)&&!d.hasOwnProperty(a)&&(m++,s[a].then(function(b){t[a]=b,--m||k()},j))}),m||k(),s[c]=l.promise}if(o(d)&&g===c&&(g=f,f=d,d=null),d){if(!P(d))throw new Error("'locals' must be an object")}else d=k;if(f){if(!o(f))throw new Error("'parent' must be a promise returned by $resolve.resolve()")}else f=l;var n=a.defer(),r=n.promise,s=r.$$promises={},t=S({},d),u=1+q.length/3,v=!1;if(M(f.$$failure))return i(f.$$failure),r;f.$$inheritedValues&&e(t,m(f.$$inheritedValues,p)),S(s,f.$$promises),f.$$values?(v=e(t,m(f.$$values,p)),r.$$inheritedValues=m(f.$$values,p),h()):(f.$$inheritedValues&&(r.$$inheritedValues=m(f.$$inheritedValues,p)),f.then(h,i));for(var w=0,x=q.length;w=0));)s=f(r.id,r.type,r.cfg,"path"),l+=g(r.segment,s.type.pattern.source,s.squash,s.isOptional),n.push(r.segment),m=j.lastIndex;t=a.substring(m);var u=t.indexOf("?");if(u>=0){var v=this.sourceSearch=t.substring(u);if(t=t.substring(0,u),this.sourcePath=a.substring(0,m+u),v.length>0)for(m=0;i=k.exec(v);)r=h(i,!0),s=f(r.id,r.type,r.cfg,"search"),m=j.lastIndex}else this.sourcePath=a,this.sourceSearch="";l+=g(t)+(b.strict===!1?"/?":"")+"$",n.push(t),this.regexp=new RegExp(l,b.caseInsensitive?"i":c),this.prefix=n[0],this.$$paramNames=q}function t(a){S(this,a)}function u(){function a(a){return null!=a?a.toString().replace(/(~|\/)/g,function(a){return{"~":"~~","/":"~2F"}[a]}):a}function e(a){return null!=a?a.toString().replace(/(~~|~2F)/g,function(a){return{"~~":"~","~2F":"/"}[a]}):a}function f(){return{strict:p,caseInsensitive:m}}function i(a){return N(a)||Q(a)&&N(a[a.length-1])}function j(){for(;w.length;){var a=w.shift();if(a.pattern)throw new Error("You cannot override a type's .pattern at runtime.");b.extend(r[a.name],l.invoke(a.def))}}function k(a){S(this,a||{})}V=this;var l,m=!1,p=!0,q=!1,r={},v=!0,w=[],x={string:{encode:a,decode:e,is:function(a){return null==a||!M(a)||"string"==typeof a},pattern:/[^\/]*/},int:{encode:a,decode:function(a){return parseInt(a,10)},is:function(a){return M(a)&&this.decode(a.toString())===a},pattern:/\d+/},bool:{encode:function(a){return a?1:0},decode:function(a){return 0!==parseInt(a,10)},is:function(a){return a===!0||a===!1},pattern:/0|1/},date:{encode:function(a){return this.is(a)?[a.getFullYear(),("0"+(a.getMonth()+1)).slice(-2),("0"+a.getDate()).slice(-2)].join("-"):c},decode:function(a){if(this.is(a))return a;var b=this.capture.exec(a);return b?new Date(b[1],b[2]-1,b[3]):c},is:function(a){return a instanceof Date&&!isNaN(a.valueOf())},equals:function(a,b){return this.is(a)&&this.is(b)&&a.toISOString()===b.toISOString()},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/},json:{encode:b.toJson,decode:b.fromJson,is:b.isObject,equals:b.equals,pattern:/[^\/]*/},any:{encode:b.identity,decode:b.identity,equals:b.equals,pattern:/.*/}};u.$$getDefaultValue=function(a){if(!i(a.value))return a.value;if(!l)throw new Error("Injectable functions cannot be called at configuration time");return l.invoke(a.value)},this.caseInsensitive=function(a){return M(a)&&(m=a),m},this.strictMode=function(a){return M(a)&&(p=a),p},this.defaultSquashPolicy=function(a){if(!M(a))return q;if(a!==!0&&a!==!1&&!O(a))throw new Error("Invalid squash policy: "+a+". Valid policies: false, true, arbitrary-string");return q=a,a},this.compile=function(a,b){return new s(a,S(f(),b))},this.isMatcher=function(a){if(!P(a))return!1;var b=!0;return R(s.prototype,function(c,d){N(c)&&(b=b&&M(a[d])&&N(a[d]))}),b},this.type=function(a,b,c){if(!M(b))return r[a];if(r.hasOwnProperty(a))throw new Error("A type named '"+a+"' has already been defined.");return r[a]=new t(S({name:a},b)),c&&(w.push({name:a,def:c}),v||j()),this},R(x,function(a,b){r[b]=new t(S({name:b},a))}),r=d(r,{}),this.$get=["$injector",function(a){return l=a,v=!1,j(),R(x,function(a,b){r[b]||(r[b]=new t(a))}),this}],this.Param=function(a,d,e,f){function j(a){var b=P(a)?g(a):[],c=h(b,"value")===-1&&h(b,"type")===-1&&h(b,"squash")===-1&&h(b,"array")===-1;return c&&(a={value:a}),a.$$fn=i(a.value)?a.value:function(){return a.value},a}function k(c,d,e){if(c.type&&d)throw new Error("Param '"+a+"' has two type configurations.");return d?d:c.type?b.isString(c.type)?r[c.type]:c.type instanceof t?c.type:new t(c.type):"config"===e?r.any:r.string}function m(){var b={array:"search"===f&&"auto"},c=a.match(/\[\]$/)?{array:!0}:{};return S(b,c,e).array}function p(a,b){var c=a.squash;if(!b||c===!1)return!1;if(!M(c)||null==c)return q;if(c===!0||O(c))return c;throw new Error("Invalid squash policy: '"+c+"'. Valid policies: false, true, or arbitrary string")}function s(a,b,d,e){var f,g,i=[{from:"",to:d||b?c:""},{from:null,to:d||b?c:""}];return f=Q(a.replace)?a.replace:[],O(e)&&f.push({from:e,to:c}),g=o(f,function(a){return a.from}),n(i,function(a){return h(g,a.from)===-1}).concat(f)}function u(){if(!l)throw new Error("Injectable functions cannot be called at configuration time");var a=l.invoke(e.$$fn);if(null!==a&&a!==c&&!x.type.is(a))throw new Error("Default value ("+a+") for parameter '"+x.id+"' is not an instance of Type ("+x.type.name+")");return a}function v(a){function b(a){return function(b){return b.from===a}}function c(a){var c=o(n(x.replace,b(a)),function(a){return a.to});return c.length?c[0]:a}return a=c(a),M(a)?x.type.$normalize(a):u()}function w(){return"{Param:"+a+" "+d+" squash: '"+A+"' optional: "+z+"}"}var x=this;e=j(e),d=k(e,d,f);var y=m();d=y?d.$asArray(y,"search"===f):d,"string"!==d.name||y||"path"!==f||e.value!==c||(e.value="");var z=e.value!==c,A=p(e,z),B=s(e,y,z,A);S(this,{id:a,type:d,location:f,array:y,squash:A,replace:B,isOptional:z,value:v,dynamic:c,config:e,toString:w})},k.prototype={$$new:function(){return d(this,S(new k,{$$parent:this}))},$$keys:function(){for(var a=[],b=[],c=this,d=g(k.prototype);c;)b.push(c),c=c.$$parent;return b.reverse(),R(b,function(b){R(g(b),function(b){h(a,b)===-1&&h(d,b)===-1&&a.push(b)})}),a},$$values:function(a){var b={},c=this;return R(c.$$keys(),function(d){b[d]=c[d].value(a&&a[d])}),b},$$equals:function(a,b){var c=!0,d=this;return R(d.$$keys(),function(e){var f=a&&a[e],g=b&&b[e];d[e].type.equals(f,g)||(c=!1)}),c},$$validates:function(a){var d,e,f,g,h,i=this.$$keys();for(d=0;d=0)throw new Error("State must have a valid name");if(A.hasOwnProperty(c))throw new Error("State '"+c+"' is already defined");var e=c.indexOf(".")!==-1?c.substring(0,c.lastIndexOf(".")):O(b.parent)?b.parent:P(b.parent)&&O(b.parent.name)?b.parent.name:"";if(e&&!A[e])return n(e,b.self);for(var f in D)N(D[f])&&(b[f]=D[f](b,D.$delegates[f]));return A[c]=b,!b[C]&&b.url&&a.when(b.url,["$match","$stateParams",function(a,c){z.$current.navigable==b&&j(a,c)||z.transitionTo(b,a,{inherit:!0,location:!1})}]),q(c),b}function s(a){return a.indexOf("*")>-1}function t(a){for(var b=a.split("."),c=z.$current.name.split("."),d=0,e=b.length;d=A;d--)g=o[d],g.self.onExit&&h.invoke(g.self.onExit,g.self,g.locals.globals),g.locals=null;for(d=A;d2?k.enter(a,null,c).then(d):k.enter(a,null,c,d)},leave:function(a,c){b.version.minor>2?k.leave(a).then(c):k.leave(a,c)}};if(j){var e=j&&j(c,a);return{enter:function(a,b,c){e.enter(a,null,b),c()},leave:function(a,b){e.leave(a),b()}}}return d()}var i=g(),j=i("$animator"),k=i("$animate"),l={restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(c,g,i){return function(c,g,j){function k(){if(m&&(m.remove(),m=null),o&&(o.$destroy(),o=null),n){var a=n.data("$uiViewAnim");s.leave(n,function(){a.$$animLeave.resolve(),m=null}),m=n,n=null}}function l(h){var l,m=B(c,j,g,e),t=m&&a.$current&&a.$current.locals[m];if(h||t!==p){l=c.$new(),p=a.$current.locals[m],l.$emit("$viewContentLoading",m);var u=i(l,function(a){var e=f.defer(),h=f.defer(),i={$animEnter:e.promise,$animLeave:h.promise,$$animLeave:h};a.data("$uiViewAnim",i),s.enter(a,g,function(){e.resolve(),o&&o.$emit("$viewContentAnimationEnded"),(b.isDefined(r)&&!r||c.$eval(r))&&d(a)}),k()});n=u,o=l,o.$emit("$viewContentLoaded",m),o.$eval(q)}}var m,n,o,p,q=j.onload||"",r=j.autoscroll,s=h(j,c);g.inheritedData("$uiView");c.$on("$stateChangeSuccess",function(){l(!1)}),l(!0)}}};return l}function A(a,c,d,e){return{restrict:"ECA",priority:-400,compile:function(f){var g=f.html();return function(f,h,i){var j=d.$current,k=B(f,i,h,e),l=j&&j.locals[k];if(l){h.data("$uiView",{name:k,state:l.$$state}),h.html(l.$template?l.$template:g);var m=b.extend({},l);f[l.$$resolveAs]=m;var n=a(h.contents());if(l.$$controller){l.$scope=f,l.$element=h;var o=c(l.$$controller,l);l.$$controllerAs&&(f[l.$$controllerAs]=o,f[l.$$controllerAs][l.$$resolveAs]=m),N(o.$onInit)&&o.$onInit(),h.data("$ngControllerController",o),h.children().data("$ngControllerController",o)}n(f)}}}}}function B(a,b,c,d){var e=d(b.uiView||b.name||"")(a),f=c.inheritedData("$uiView");return e.indexOf("@")>=0?e:e+"@"+(f?f.state.name:"")}function C(a,b){var c,d=a.match(/^\s*({[^}]*})\s*$/);if(d&&(a=b+"("+d[1]+")"),c=a.replace(/\n/g," ").match(/^([^(]+?)\s*(\((.*)\))?$/),!c||4!==c.length)throw new Error("Invalid state ref '"+a+"'");return{state:c[1],paramExpr:c[3]||null}}function D(a){var b=a.parent().inheritedData("$uiView");if(b&&b.state&&b.state.name)return b.state}function E(a){var b="[object SVGAnimatedString]"===Object.prototype.toString.call(a.prop("href")),c="FORM"===a[0].nodeName;return{attr:c?"action":b?"xlink:href":"href",isAnchor:"A"===a.prop("tagName").toUpperCase(),clickable:!c}}function F(a,b,c,d,e){return function(f){var g=f.which||f.button,h=e();if(!(g>1||f.ctrlKey||f.metaKey||f.shiftKey||a.attr("target"))){var i=c(function(){b.go(h.state,h.params,h.options)});f.preventDefault();var j=d.isAnchor&&!h.href?1:0;f.preventDefault=function(){j--<=0&&c.cancel(i)}}}}function G(a,b){return{relative:D(a)||b.$current,inherit:!0}}function H(a,c){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(d,e,f,g){var h,i=C(f.uiSref,a.current.name),j={state:i.state,href:null,params:null},k=E(e),l=g[1]||g[0],m=null;j.options=S(G(e,a),f.uiSrefOpts?d.$eval(f.uiSrefOpts):{});var n=function(c){c&&(j.params=b.copy(c)),j.href=a.href(i.state,j.params,j.options),m&&m(),l&&(m=l.$$addStateInfo(i.state,j.params)),null!==j.href&&f.$set(k.attr,j.href)};i.paramExpr&&(d.$watch(i.paramExpr,function(a){a!==j.params&&n(a)},!0),j.params=b.copy(d.$eval(i.paramExpr))),n(),k.clickable&&(h=F(e,a,c,k,function(){return j}),e[e.on?"on":"bind"]("click",h),d.$on("$destroy",function(){e[e.off?"off":"unbind"]("click",h)}))}}}function I(a,b){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(c,d,e,f){function g(b){m.state=b[0],m.params=b[1],m.options=b[2],m.href=a.href(m.state,m.params,m.options),n&&n(),j&&(n=j.$$addStateInfo(m.state,m.params)),m.href&&e.$set(i.attr,m.href)}var h,i=E(d),j=f[1]||f[0],k=[e.uiState,e.uiStateParams||null,e.uiStateOpts||null],l="["+k.map(function(a){return a||"null"}).join(", ")+"]",m={state:null,params:null,options:null,href:null},n=null;c.$watch(l,g,!0),g(c.$eval(l)),i.clickable&&(h=F(d,a,b,i,function(){return m}),d[d.on?"on":"bind"]("click",h),c.$on("$destroy",function(){d[d.off?"off":"unbind"]("click",h)}))}}}function J(a,b,c){return{restrict:"A",controller:["$scope","$element","$attrs","$timeout",function(b,d,e,f){function g(b,c,e){var f=a.get(b,D(d)),g=h(b,c),i={state:f||{name:b},params:c,hash:g};return p.push(i),q[g]=e,function(){var a=p.indexOf(i);a!==-1&&p.splice(a,1)}}function h(a,c){if(!O(a))throw new Error("state should be a string");return P(c)?a+U(c):(c=b.$eval(c),P(c)?a+U(c):a)}function i(){for(var a=0;a0)){var c=g(a,b,o);return i(),c}},b.$on("$stateChangeSuccess",i),i()}]}}function K(a){var b=function(b,c){return a.is(b,c)};return b.$stateful=!0,b}function L(a){var b=function(b,c,d){return a.includes(b,c,d)};return b.$stateful=!0,b}var M=b.isDefined,N=b.isFunction,O=b.isString,P=b.isObject,Q=b.isArray,R=b.forEach,S=b.extend,T=b.copy,U=b.toJson;b.module("ui.router.util",["ng"]),b.module("ui.router.router",["ui.router.util"]),b.module("ui.router.state",["ui.router.router","ui.router.util"]),b.module("ui.router",["ui.router.state"]),b.module("ui.router.compat",["ui.router"]),q.$inject=["$q","$injector"],b.module("ui.router.util").service("$resolve",q),r.$inject=["$http","$templateCache","$injector"],b.module("ui.router.util").service("$templateFactory",r);var V;s.prototype.concat=function(a,b){var c={caseInsensitive:V.caseInsensitive(),strict:V.strictMode(),squash:V.defaultSquashPolicy()};return new s(this.sourcePath+a+this.sourceSearch,S(c,b),this)},s.prototype.toString=function(){return this.source},s.prototype.exec=function(a,b){function c(a){function b(a){return a.split("").reverse().join("")}function c(a){return a.replace(/\\-/g,"-")}var d=b(a).split(/-(?!\\)/),e=o(d,b);return o(e,c).reverse()}var d=this.regexp.exec(a);if(!d)return null;b=b||{};var e,f,g,h=this.parameters(),i=h.length,j=this.segments.length-1,k={};if(j!==d.length-1)throw new Error("Unbalanced capture group in route '"+this.source+"'");var l,m;for(e=0;e
*/
"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="ui.router"),function(a,b,c){"use strict";function d(a,b){return S(new(S(function(){},{prototype:a})),b)}function e(a){return R(arguments,function(b){b!==a&&R(b,function(b,c){a.hasOwnProperty(c)||(a[c]=b)})}),a}function f(a,b){var c=[];for(var d in a.path){if(a.path[d]!==b.path[d])break;c.push(a.path[d])}return c}function g(a){if(Object.keys)return Object.keys(a);var b=[];return R(a,function(a,c){b.push(c)}),b}function h(a,b){if(Array.prototype.indexOf)return a.indexOf(b,Number(arguments[2])||0);var c=a.length>>>0,d=Number(arguments[2])||0;for(d=d<0?Math.ceil(d):Math.floor(d),d<0&&(d+=c);d=0||(k.push(e[m]),j[e[m]]=a[e[m]]);return S({},j,b)}function j(a,b,c){if(!c){c=[];for(var d in a)c.push(d)}for(var e=0;e "));if(s[c]=d,O(a))q.push(c,[function(){return b.get(a)}],j);else{var e=b.annotate(a);R(e,function(a){a!==c&&i.hasOwnProperty(a)&&n(i[a],a)}),q.push(c,a,e)}r.pop(),s[c]=f}}function o(a){return P(a)&&a.then&&a.$$promises}if(!P(i))throw new Error("'invocables' must be an object");var p=g(i||{}),q=[],r=[],s={};return R(i,n),i=r=s=null,function(d,f,g){function h(){--u||(v||e(t,f.$$values),r.$$values=t,r.$$promises=r.$$promises||!0,delete r.$$inheritedValues,n.resolve(t))}function i(a){r.$$failure=a,n.reject(a)}function j(c,e,f){function j(a){l.reject(a),i(a)}function k(){if(!M(r.$$failure))try{l.resolve(b.invoke(e,g,t)),l.promise.then(function(a){t[c]=a,h()},j)}catch(a){j(a)}}var l=a.defer(),m=0;R(f,function(a){s.hasOwnProperty(a)&&!d.hasOwnProperty(a)&&(m++,s[a].then(function(b){t[a]=b,--m||k()},j))}),m||k(),s[c]=l.promise}if(o(d)&&g===c&&(g=f,f=d,d=null),d){if(!P(d))throw new Error("'locals' must be an object")}else d=k;if(f){if(!o(f))throw new Error("'parent' must be a promise returned by $resolve.resolve()")}else f=l;var n=a.defer(),r=n.promise,s=r.$$promises={},t=S({},d),u=1+q.length/3,v=!1;if(M(f.$$failure))return i(f.$$failure),r;f.$$inheritedValues&&e(t,m(f.$$inheritedValues,p)),S(s,f.$$promises),f.$$values?(v=e(t,m(f.$$values,p)),r.$$inheritedValues=m(f.$$values,p),h()):(f.$$inheritedValues&&(r.$$inheritedValues=m(f.$$inheritedValues,p)),f.then(h,i));for(var w=0,x=q.length;w=0));)s=f(r.id,r.type,r.cfg,"path"),l+=g(r.segment,s.type.pattern.source,s.squash,s.isOptional),n.push(r.segment),m=j.lastIndex;t=a.substring(m);var u=t.indexOf("?");if(u>=0){var v=this.sourceSearch=t.substring(u);if(t=t.substring(0,u),this.sourcePath=a.substring(0,m+u),v.length>0)for(m=0;i=k.exec(v);)r=h(i,!0),s=f(r.id,r.type,r.cfg,"search"),m=j.lastIndex}else this.sourcePath=a,this.sourceSearch="";l+=g(t)+(b.strict===!1?"/?":"")+"$",n.push(t),this.regexp=new RegExp(l,b.caseInsensitive?"i":c),this.prefix=n[0],this.$$paramNames=q}function t(a){S(this,a)}function u(){function a(a){return null!=a?a.toString().replace(/(~|\/)/g,function(a){return{"~":"~~","/":"~2F"}[a]}):a}function e(a){return null!=a?a.toString().replace(/(~~|~2F)/g,function(a){return{"~~":"~","~2F":"/"}[a]}):a}function f(){return{strict:p,caseInsensitive:m}}function i(a){return N(a)||Q(a)&&N(a[a.length-1])}function j(){for(;w.length;){var a=w.shift();if(a.pattern)throw new Error("You cannot override a type's .pattern at runtime.");b.extend(r[a.name],l.invoke(a.def))}}function k(a){S(this,a||{})}V=this;var l,m=!1,p=!0,q=!1,r={},v=!0,w=[],x={string:{encode:a,decode:e,is:function(a){return null==a||!M(a)||"string"==typeof a},pattern:/[^\/]*/},int:{encode:a,decode:function(a){return parseInt(a,10)},is:function(a){return M(a)&&this.decode(a.toString())===a},pattern:/\d+/},bool:{encode:function(a){return a?1:0},decode:function(a){return 0!==parseInt(a,10)},is:function(a){return a===!0||a===!1},pattern:/0|1/},date:{encode:function(a){return this.is(a)?[a.getFullYear(),("0"+(a.getMonth()+1)).slice(-2),("0"+a.getDate()).slice(-2)].join("-"):c},decode:function(a){if(this.is(a))return a;var b=this.capture.exec(a);return b?new Date(b[1],b[2]-1,b[3]):c},is:function(a){return a instanceof Date&&!isNaN(a.valueOf())},equals:function(a,b){return this.is(a)&&this.is(b)&&a.toISOString()===b.toISOString()},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/},json:{encode:b.toJson,decode:b.fromJson,is:b.isObject,equals:b.equals,pattern:/[^\/]*/},any:{encode:b.identity,decode:b.identity,equals:b.equals,pattern:/.*/}};u.$$getDefaultValue=function(a){if(!i(a.value))return a.value;if(!l)throw new Error("Injectable functions cannot be called at configuration time");return l.invoke(a.value)},this.caseInsensitive=function(a){return M(a)&&(m=a),m},this.strictMode=function(a){return M(a)&&(p=a),p},this.defaultSquashPolicy=function(a){if(!M(a))return q;if(a!==!0&&a!==!1&&!O(a))throw new Error("Invalid squash policy: "+a+". Valid policies: false, true, arbitrary-string");return q=a,a},this.compile=function(a,b){return new s(a,S(f(),b))},this.isMatcher=function(a){if(!P(a))return!1;var b=!0;return R(s.prototype,function(c,d){N(c)&&(b=b&&M(a[d])&&N(a[d]))}),b},this.type=function(a,b,c){if(!M(b))return r[a];if(r.hasOwnProperty(a))throw new Error("A type named '"+a+"' has already been defined.");return r[a]=new t(S({name:a},b)),c&&(w.push({name:a,def:c}),v||j()),this},R(x,function(a,b){r[b]=new t(S({name:b},a))}),r=d(r,{}),this.$get=["$injector",function(a){return l=a,v=!1,j(),R(x,function(a,b){r[b]||(r[b]=new t(a))}),this}],this.Param=function(a,d,e,f){function j(a){var b=P(a)?g(a):[],c=h(b,"value")===-1&&h(b,"type")===-1&&h(b,"squash")===-1&&h(b,"array")===-1;return c&&(a={value:a}),a.$$fn=i(a.value)?a.value:function(){return a.value},a}function k(c,d,e){if(c.type&&d)throw new Error("Param '"+a+"' has two type configurations.");return d?d:c.type?b.isString(c.type)?r[c.type]:c.type instanceof t?c.type:new t(c.type):"config"===e?r.any:r.string}function m(){var b={array:"search"===f&&"auto"},c=a.match(/\[\]$/)?{array:!0}:{};return S(b,c,e).array}function p(a,b){var c=a.squash;if(!b||c===!1)return!1;if(!M(c)||null==c)return q;if(c===!0||O(c))return c;throw new Error("Invalid squash policy: '"+c+"'. Valid policies: false, true, or arbitrary string")}function s(a,b,d,e){var f,g,i=[{from:"",to:d||b?c:""},{from:null,to:d||b?c:""}];return f=Q(a.replace)?a.replace:[],O(e)&&f.push({from:e,to:c}),g=o(f,function(a){return a.from}),n(i,function(a){return h(g,a.from)===-1}).concat(f)}function u(){if(!l)throw new Error("Injectable functions cannot be called at configuration time");var a=l.invoke(e.$$fn);if(null!==a&&a!==c&&!x.type.is(a))throw new Error("Default value ("+a+") for parameter '"+x.id+"' is not an instance of Type ("+x.type.name+")");return a}function v(a){function b(a){return function(b){return b.from===a}}function c(a){var c=o(n(x.replace,b(a)),function(a){return a.to});return c.length?c[0]:a}return a=c(a),M(a)?x.type.$normalize(a):u()}function w(){return"{Param:"+a+" "+d+" squash: '"+A+"' optional: "+z+"}"}var x=this;e=j(e),d=k(e,d,f);var y=m();d=y?d.$asArray(y,"search"===f):d,"string"!==d.name||y||"path"!==f||e.value!==c||(e.value="");var z=e.value!==c,A=p(e,z),B=s(e,y,z,A);S(this,{id:a,type:d,location:f,array:y,squash:A,replace:B,isOptional:z,value:v,dynamic:c,config:e,toString:w})},k.prototype={$$new:function(){return d(this,S(new k,{$$parent:this}))},$$keys:function(){for(var a=[],b=[],c=this,d=g(k.prototype);c;)b.push(c),c=c.$$parent;return b.reverse(),R(b,function(b){R(g(b),function(b){h(a,b)===-1&&h(d,b)===-1&&a.push(b)})}),a},$$values:function(a){var b={},c=this;return R(c.$$keys(),function(d){b[d]=c[d].value(a&&a[d])}),b},$$equals:function(a,b){var c=!0,d=this;return R(d.$$keys(),function(e){var f=a&&a[e],g=b&&b[e];d[e].type.equals(f,g)||(c=!1)}),c},$$validates:function(a){var d,e,f,g,h,i=this.$$keys();for(d=0;d=0)throw new Error("State must have a valid name");if(A.hasOwnProperty(c))throw new Error("State '"+c+"' is already defined");var e=c.indexOf(".")!==-1?c.substring(0,c.lastIndexOf(".")):O(b.parent)?b.parent:P(b.parent)&&O(b.parent.name)?b.parent.name:"";if(e&&!A[e])return n(e,b.self);for(var f in D)N(D[f])&&(b[f]=D[f](b,D.$delegates[f]));return A[c]=b,!b[C]&&b.url&&a.when(b.url,["$match","$stateParams",function(a,c){z.$current.navigable==b&&j(a,c)||z.transitionTo(b,a,{inherit:!0,location:!1})}]),q(c),b}function s(a){return a.indexOf("*")>-1}function t(a){for(var b=a.split("."),c=z.$current.name.split("."),d=0,e=b.length;d=A;d--)g=o[d],g.self.onExit&&h.invoke(g.self.onExit,g.self,g.locals.globals),g.locals=null;for(d=A;d2?k.enter(a,null,c).then(d):k.enter(a,null,c,d)},leave:function(a,c){b.version.minor>2?k.leave(a).then(c):k.leave(a,c)}};if(j){var e=j&&j(c,a);return{enter:function(a,b,c){e.enter(a,null,b),c()},leave:function(a,b){e.leave(a),b()}}}return d()}var i=g(),j=i("$animator"),k=i("$animate"),l={restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(c,g,i){return function(c,g,j){function k(){if(m&&(m.remove(),m=null),o&&(o.$destroy(),o=null),n){var a=n.data("$uiViewAnim");s.leave(n,function(){a.$$animLeave.resolve(),m=null}),m=n,n=null}}function l(h){var l,m=B(c,j,g,e),t=m&&a.$current&&a.$current.locals[m];if(h||t!==p){l=c.$new(),p=a.$current.locals[m],l.$emit("$viewContentLoading",m);var u=i(l,function(a){var e=f.defer(),h=f.defer(),i={$animEnter:e.promise,$animLeave:h.promise,$$animLeave:h};a.data("$uiViewAnim",i),s.enter(a,g,function(){e.resolve(),o&&o.$emit("$viewContentAnimationEnded"),(b.isDefined(r)&&!r||c.$eval(r))&&d(a)}),k()});n=u,o=l,o.$emit("$viewContentLoaded",m),o.$eval(q)}}var m,n,o,p,q=j.onload||"",r=j.autoscroll,s=h(j,c);g.inheritedData("$uiView");c.$on("$stateChangeSuccess",function(){l(!1)}),l(!0)}}};return l}function A(a,c,d,e){return{restrict:"ECA",priority:-400,compile:function(f){var g=f.html();return function(f,h,i){var j=d.$current,k=B(f,i,h,e),l=j&&j.locals[k];if(l){h.data("$uiView",{name:k,state:l.$$state}),h.html(l.$template?l.$template:g);var m=b.extend({},l);f[l.$$resolveAs]=m;var n=a(h.contents());if(l.$$controller){l.$scope=f,l.$element=h;var o=c(l.$$controller,l);l.$$controllerAs&&(f[l.$$controllerAs]=o,f[l.$$controllerAs][l.$$resolveAs]=m),N(o.$onInit)&&o.$onInit(),h.data("$ngControllerController",o),h.children().data("$ngControllerController",o)}n(f)}}}}}function B(a,b,c,d){var e=d(b.uiView||b.name||"")(a),f=c.inheritedData("$uiView");return e.indexOf("@")>=0?e:e+"@"+(f?f.state.name:"")}function C(a,b){var c,d=a.match(/^\s*({[^}]*})\s*$/);if(d&&(a=b+"("+d[1]+")"),c=a.replace(/\n/g," ").match(/^([^(]+?)\s*(\((.*)\))?$/),!c||4!==c.length)throw new Error("Invalid state ref '"+a+"'");return{state:c[1],paramExpr:c[3]||null}}function D(a){var b=a.parent().inheritedData("$uiView");if(b&&b.state&&b.state.name)return b.state}function E(a){var b="[object SVGAnimatedString]"===Object.prototype.toString.call(a.prop("href")),c="FORM"===a[0].nodeName;return{attr:c?"action":b?"xlink:href":"href",isAnchor:"A"===a.prop("tagName").toUpperCase(),clickable:!c}}function F(a,b,c,d,e){return function(f){var g=f.which||f.button,h=e();if(!(g>1||f.ctrlKey||f.metaKey||f.shiftKey||a.attr("target"))){var i=c(function(){b.go(h.state,h.params,h.options)});f.preventDefault();var j=d.isAnchor&&!h.href?1:0;f.preventDefault=function(){j--<=0&&c.cancel(i)}}}}function G(a,b){return{relative:D(a)||b.$current,inherit:!0}}function H(a,c){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(d,e,f,g){var h,i=C(f.uiSref,a.current.name),j={state:i.state,href:null,params:null},k=E(e),l=g[1]||g[0],m=null;j.options=S(G(e,a),f.uiSrefOpts?d.$eval(f.uiSrefOpts):{});var n=function(c){c&&(j.params=b.copy(c)),j.href=a.href(i.state,j.params,j.options),m&&m(),l&&(m=l.$$addStateInfo(i.state,j.params)),null!==j.href&&f.$set(k.attr,j.href)};i.paramExpr&&(d.$watch(i.paramExpr,function(a){a!==j.params&&n(a)},!0),j.params=b.copy(d.$eval(i.paramExpr))),n(),k.clickable&&(h=F(e,a,c,k,function(){return j}),e[e.on?"on":"bind"]("click",h),d.$on("$destroy",function(){e[e.off?"off":"unbind"]("click",h)}))}}}function I(a,b){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(c,d,e,f){function g(b){m.state=b[0],m.params=b[1],m.options=b[2],m.href=a.href(m.state,m.params,m.options),n&&n(),j&&(n=j.$$addStateInfo(m.state,m.params)),m.href&&e.$set(i.attr,m.href)}var h,i=E(d),j=f[1]||f[0],k=[e.uiState,e.uiStateParams||null,e.uiStateOpts||null],l="["+k.map(function(a){return a||"null"}).join(", ")+"]",m={state:null,params:null,options:null,href:null},n=null;c.$watch(l,g,!0),g(c.$eval(l)),i.clickable&&(h=F(d,a,b,i,function(){return m}),d[d.on?"on":"bind"]("click",h),c.$on("$destroy",function(){d[d.off?"off":"unbind"]("click",h)}))}}}function J(a,b,c){return{restrict:"A",controller:["$scope","$element","$attrs","$timeout",function(b,d,e,f){function g(b,c,e){var f=a.get(b,D(d)),g=h(b,c),i={state:f||{name:b},params:c,hash:g};return p.push(i),q[g]=e,function(){var a=p.indexOf(i);a!==-1&&p.splice(a,1)}}function h(a,c){if(!O(a))throw new Error("state should be a string");return P(c)?a+U(c):(c=b.$eval(c),P(c)?a+U(c):a)}function i(){for(var a=0;a0)){var c=g(a,b,o);return i(),c}},b.$on("$stateChangeSuccess",i),i()}]}}function K(a){var b=function(b,c){return a.is(b,c)};return b.$stateful=!0,b}function L(a){var b=function(b,c,d){return a.includes(b,c,d)};return b.$stateful=!0,b}var M=b.isDefined,N=b.isFunction,O=b.isString,P=b.isObject,Q=b.isArray,R=b.forEach,S=b.extend,T=b.copy,U=b.toJson;b.module("ui.router.util",["ng"]),b.module("ui.router.router",["ui.router.util"]),b.module("ui.router.state",["ui.router.router","ui.router.util"]),b.module("ui.router",["ui.router.state"]),b.module("ui.router.compat",["ui.router"]),q.$inject=["$q","$injector"],b.module("ui.router.util").service("$resolve",q),r.$inject=["$http","$templateCache","$injector"],b.module("ui.router.util").service("$templateFactory",r);var V;s.prototype.concat=function(a,b){var c={caseInsensitive:V.caseInsensitive(),strict:V.strictMode(),squash:V.defaultSquashPolicy()};return new s(this.sourcePath+a+this.sourceSearch,S(c,b),this)},s.prototype.toString=function(){return this.source},s.prototype.exec=function(a,b){function c(a){function b(a){return a.split("").reverse().join("")}function c(a){return a.replace(/\\-/g,"-")}var d=b(a).split(/-(?!\\)/),e=o(d,b);return o(e,c).reverse()}var d=this.regexp.exec(a);if(!d)return null;b=b||{};var e,f,g,h=this.parameters(),i=h.length,j=this.segments.length-1,k={};if(j!==d.length-1)throw new Error("Unbalanced capture group in route '"+this.source+"'");var l,m;for(e=0;e
@/inspector/Models/AuditTestGroup.js
if (typeof payload.name !== "string") {
WI.AuditManager.synthesizeError(WI.UIString("\u0022%s\u0022 has a non-string \u0022%s\u0022 value").format(payload.name, WI.unlocalizedString("name")));
return null;
if (!Array.isArray(payload.tests)) {
WI.AuditManager.synthesizeError(WI.UIString("\u0022%s\u0022 has a non-array \u0022%s\u0022 value").format(payload.name, WI.unlocalizedString("tests")));
return null;
else if ("description" in payload)
WI.AuditManager.synthesizeWarning(WI.UIString("\u0022%s\u0022 has a non-string \u0022%s\u0022 value").format(payload.name, WI.unlocalizedString("description")));
else if ("supports" in payload)
WI.AuditManager.synthesizeWarning(WI.UIString("\u0022%s\u0022 has a non-number \u0022%s\u0022 value").format(payload.name, WI.unlocalizedString("supports")));
else if ("setup" in payload)
WI.AuditManager.synthesizeWarning(WI.UIString("\u0022%s\u0022 has a non-string \u0022%s\u0022 value").format(payload.name, WI.unlocalizedString("setup")));
@/lua/ge/extensions/gameplay/rally/notebook/pacenoteWaypoint.lua
function C:setRoutePoint(rp)
-- print(string.format("setRoutePoint for %s -> %s", self.name, tostring(not not rp)))
self.routePoint = rp
local shortWpType = waypointTypes.shortenWaypointType(self.waypointType)
return string.format("%s[%s]", self.pacenote.name, shortWpType)
end
@/lua/vehicle/extensions/test/ffbCalibration.lua
if safetyCountdown < 0 then
log("I", "", string.format(" >>> VLUA FFB calibration: finished due to safety timeout"))
data.FFB.endReason = "timeout"
speedMin = speedTarget * 0.6
log("W", "", string.format(" >>> VLUA FFB calibration: cruise control taking too long to reach speed. Falling back to reachable speeds: %5.1f kmh, %5.1f kmh", speedMin*3.6, speedTarget*3.6))
data.FFB.cruiseControlFailures = data.FFB.cruiseControlFailures + 1
if logCountdown < 0 then
log("I", "", string.format("VLUA FFB calibration: gradual turning in progress: %4.0f kmh (%i%%), %5.3f st (%i%%)", airspeed*3.6, math.min(1, airspeed / speedMin)*100, gradualInput, 100*clamp(gradualInput/lastSteeringInput, 0, 1)))
logCountdown = 0.5
-- turning finished progress
log("I", "", string.format(" >>> VLUA FFB calibration: finished gradual turning"))
logCountdown = 0
-- just started a gradual input to reach lastSteeringInput
log("I", "", string.format(" >>> VLUA FFB calibration: cruise control reached target speed. Beginning gradual turning"))
logCountdown = 0
if logCountdown < 0 then
log("I", "", string.format("VLUA FFB calibration: cruise control in progress: %4.0f kmh (%i%%, %i%%)", airspeed*3.6, math.min(1, airspeed / speedMin)*100, math.min(1, airspeed / speedTarget)*100))
logCountdown = 0.5
if logCountdown < 0 then
log("I", "", string.format("VLUA FFB calibration: data being logged: %4.0f kmh (%i%%), %5.3f st (%i%%), %7.3f ffb", airspeed*3.6, math.min(1, airspeed / speedMin)*100, lastSteeringInput, 100*lastSteeringInput, hydros.forceAtWheelNorm))
logCountdown = 0.5
-- we've lost too much speed
log("I", "", string.format(" >>> VLUA FFB calibration: cruise control has lost too much speed: %4.0f kmh (%i%%)", airspeed*3.6, math.min(1, airspeed / speedMin)*100))
logCountdown = 0
if safetyCountdown < 0 then
log("I", "", string.format(" >>> VLUA FFB calibration: finished succesfull"))
data.FFB.endReason = "noIssues"
if logCountdown < 0 then
log("I", "", string.format("VLUA FFB calibration: data being logged: %4.0f kmh (%i%%), %5.3f st (%i%%), %7.3f ffb", airspeed*3.6, math.min(1, airspeed / speedMin)*100, lastSteeringInput, 100*lastSteeringInput, hydros.forceAtWheelNorm))
logCountdown = 0.5
end
obj:queueGameEngineLua(string.format("test_ffbCalibration.onFFBCalibrationFinished(%q)", lpack.encode(data)))
data = nil
@/lua/ge/extensions/gameplay/drag/debug.lua
for vehId, _ in pairs(dragData.racers or {}) do
if im.Selectable1(string.format("Racer ID: %d Lane: %d", vehId, dragData.racers[vehId].lane), vehId == selectedVehicle) then
selectElement(vehId)
@/lua/common/jsonPrettyEncoderCustom.lua
local vtype = type(v)
if vtype == 'string' then return string.format('"%s"', jsonEscapeString(v)) end
if vtype == 'number' then
if numberPrecision == nil then
return string.format('%.10g', v) -- .10g is needed for time
else
if v ~= math.floor(v) then
return string.format('%' .. numberPrecision .. '.' .. numberPrecision .. 'f', v)
else
else
return string.format('%d', v)
end
if not fold then
return string.format('[\n'..indent .. '%s\n'.. indentPrev ..']', table.concat(tmp, ',\n' .. indent))
end
end
return string.format('[%s]', table.concat(tmp, ', '))
else
local cv = encode(vv, lvl + 1, numberPrecision, tableWeights, foldingCallback, _levelPath .. '/' .. tostring(kk))
if cv ~= nil then table.insert(tmp, string.format('"%s":%s', jsonEscapeString(tostring(kk)), cv)) end
end
if not fold then
return string.format('{\n'..indent .. '%s\n'.. indentPrev ..'}', table.concat(tmp, ',\n' .. indent))
end
end
return string.format('{%s}', table.concat(tmp, ', '))
end
if ffi.offsetof(v, 'w') ~= nil then
return string.format('{"x":%.10g,"y":%.10g,"z":%.10g,"w":%.10g}', v.x, v.y, v.z, v.w)
else
else
return string.format('{"x":%.10g,"y":%.10g,"z":%.10g}', v.x, v.y, v.z)
end
@/lua/common/luaBinding.lua
if not mt then
--log('E', '', string.format("property '%s.%s' is not found", origmt.___type, k))
return
if not mt then
--log('E', '', string.format("property '%s.%s' is not found", origmt.___type, k))
return
if not mt then
--log('E', '', string.format("property '%s.%s' is not found or not writable: %s", getmetatable(t).___type, k, debug.traceback()))
return
if not mt then
--log('E', '', string.format("property '%s.%s' is not found or not writable: %s", getmetatable(t).___type, k, debug.traceback()))
return
@/inspector/Views/JSONResourceContentView.js
} catch (e) {
this.showMessage(WI.UIString("Unable to parse as JSON: %s").format(e.message));
return;
if (error || wasThrown) {
this.showMessage(WI.UIString("Unable to parse as JSON: %s").format(result.description));
return;
@/lua/ge/extensions/editor/dynamicDecals/layerStack.lua
if k == #parentStack then im.BeginDisabled() end
if editor.uiIconImageButton(editor.icons.keyboard_arrow_up, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("moveup##%s_%d", guiId, k)) then
api.moveLayer(k, parentUid, k+1, parentUid)
if k == 1 then im.BeginDisabled() end
if editor.uiIconImageButton(editor.icons.keyboard_arrow_down, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("movedown##%s_%d", guiId, k)) then
api.moveLayer(k, parentUid, k-1, parentUid)
if k == 1 then im.BeginDisabled() end
if editor.uiIconImageButton(editor.icons.keyboard_arrow_up, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("moveup##%s_%d", guiId, k)) then
api.moveLayer(k, parentUid, k-1, parentUid)
if k == #parentStack then im.BeginDisabled() end
if editor.uiIconImageButton(editor.icons.keyboard_arrow_down, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("movedown##%s_%d", guiId, k)) then
api.moveLayer(k, parentUid, k+1, parentUid)
if editor.getPreference("dynamicDecalsTool.general.debug") then
im.TextUnformatted(string.format("%s_%s_%s_%d", name, layer.uid, guiId, id))
layerElementDragDropTargetDebug(dbgColor or {1,1,1,1})
end
im.BeginChild1(string.format("%s_%s_%s_%d", name, layer.uid, guiId, id), im.ImVec2(0, layerDropHeight), true)
im.EndChild()
if editor.getPreference("dynamicDecalsTool.general.debug") then
print(string.format("layerElementDragDropTargetDebug before\nfrom: %d\nfromParentUid: %s\nto: %d\ntoParentUid: %s", from or -1, fromParentUid or "nil", to or -1, toParentUid or "nil"))
end
if editor.getPreference("dynamicDecalsTool.general.debug") then
print(string.format("layerElementDragDropTargetDebug after\nfrom: %d\nfromParentUid: %s\nto: %d\ntoParentUid: %s", from or -1, fromParentUid or "nil", to or -1, toParentUid or "nil"))
end
if editor.getPreference("dynamicDecalsTool.general.debug") then
print(string.format("drag drop: %s, from: %d, fromParentUid: %s, to: %d, toParentUid: %s", name, from or -1, fromParentUid or "nil", to or -1, toParentUid or "nil"))
end
local function layerElement(k, layer, guiId, parentUid, parentStack, layerLevel)
editor.uiIconImageButton(editor.icons.menu, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("%s_%s_%s", "layerdrag##", guiId, layer.uid))
im.tooltip("LMB + drag to move layer")
if editor.getPreference("dynamicDecalsTool.general.debug") then
im.TextUnformatted(string.format("%d", k))
im.SameLine()
editor.uiInputText(
string.format("%s_%s_%s", "##LayerName", guiId, layer.uid),
editor.getTempCharPtr(layer.name),
im.SetCursorPosX(im.GetCursorPosX() + (im.GetContentRegionAvailWidth() - (tool.getIconSize() * im.uiscale[0])))
if editor.uiIconImageButton(layer.enabled and editor.icons.visibility or editor.icons.visibility_off, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("##enabled_%s_%s", guiId, layer.uid)) then
layer.enabled = not layer.enabled
if selectionData and selectionData[layer.uid] then
if editor.uiIconImageButton(editor.icons.near_me, im.ImVec2(tool.getIconSize(), tool.getIconSize()), editor.color.beamng.Value, nil, nil, string.format("select##%s_%s", guiId, layer.uid)) then
selection.deselectLayer(im.IsKeyDown(im.GetKeyIndex(im.Key_ReservedForModCtrl)) and layer.uid or nil)
else
if editor.uiIconImageButton(editor.icons.near_me, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("select##%s_%s", guiId, layer.uid)) then
selection.selectLayer(layer.uid, im.IsKeyDown(im.GetKeyIndex(im.Key_ReservedForModCtrl)))
im.SameLine()
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("remove##%s_%s", guiId, layer.uid)) then
removeLayer(k, layer.uid, parentUid)
im.SameLine()
if editor.uiIconImageButton(editor.icons.content_copy, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("duplicate##%s_%s", guiId, layer.uid)) then
api.duplicateLayer(k, parentUid)
im.SameLine()
if editor.uiIconImageButton(editor.icons.content_copy, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("duplicateAndMirror##%s_%s", guiId, layer.uid)) then
api.duplicateAndMirrorLayer(k, parentUid, true) -- args: id, parentUid, mirrorChildren
-- LAYER MASK EDITING + COPY/PASTE
local layerMaskContextMenuPopupName = string.format("CopyLayerMask_%s_%d_%d", layer.uid, layerLevel, k)
if im.BeginPopup(layerMaskContextMenuPopupName) then
layerMaskCopyData = deepcopy(layer.mask)
editor.logInfo(string.format("%s: %s", logTag, "Copied layer mask"))
im.CloseCurrentPopup()
api.setLayer(layerCopy, true)
editor.logInfo(string.format("%s: %s", logTag, layer.mask and "Replaced Layer Mask" or "Pasted Layer Mask"))
im.CloseCurrentPopup()
api.setLayer(layerCopy, true)
editor.logInfo(string.format("%s: %s", logTag, "Appended Layer Mask"))
im.CloseCurrentPopup()
if im.Button("Export layer mask") then
-- api.exportLayerMask(layer, string.format("%sexport/masks/", tool.directoryPath), "niceexport", "png")
im.CloseCurrentPopup()
false,
string.format("%sexport/masks/", tool.directoryPath),
"File already exists.\nOverwrite?"
im.SameLine()
if editor.uiIconImageButton(editor.icons.ab_asset_material, im.ImVec2(tool.getIconSize(), tool.getIconSize()), editor.color.beamng.Value, nil, nil, string.format("disable_mask##%s_%s", guiId, layer.uid)) then
tool.setCurrentMaskEditingLayerUid(nil)
im.SameLine()
if editor.uiIconImageButton(editor.icons.ab_asset_material, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("enable_mask##%s_%s", guiId, layer.uid)) then
tool.setCurrentMaskEditingLayerUid(layer.uid)
im.ImVec2(tool.getIconSize(), tool.getIconSize()),
isHighlighted and editor.color.beamng.Value or nil, nil, nil, string.format("highlightLayerButton##%s_%s", guiId, layer.uid)
) then
im.SameLine()
if im.Button(string.format("dump##%s", layer.uid)) then
dump(layer)
im.SameLine()
editor.uiIconImageButton(editor.icons.warning, im.ImVec2(tool.getIconSize(), tool.getIconSize()), editor.color.warning.Value, nil, nil, string.format("missingTextureFiles", guiId, layer.uid))
im.tooltip("Missing texture files: " .. dumps(layer.status.missingTextureFiles))
im.SameLine()
editor.uiIconImageButton(editor.icons.warning, im.ImVec2(tool.getIconSize(), tool.getIconSize()), editor.color.warning.Value, nil, nil, string.format("missingFontFile", guiId, layer.uid))
im.tooltip("Missing font file: " .. layer.status.missingFontFile.path)
im.SameLine()
local text = string.format("%.4fs", layer.status.bakingTime or -99)
local textWidth = im.CalcTextSize(text).x
im.SetCursorPosX(indentedCursorPosX)
if im.Checkbox(string.format("##%s_%s_%s", layer.uid, guiId, "layerMaskEnabled"), editor.getTempBool_BoolBool(layer.mask.enabled)) then
if editor.getTempBool_BoolBool() then
im.SameLine()
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("%s_%s", layer.uid, "removeLayerMask")) then
local layerCopy = deepcopy(layer)
im.SameLine()
if im.TreeNodeEx1(string.format("Layer Mask##%s_%s", layer.uid, guiId)) then
for k, maskLayer in ipairs(layer.mask.layers) do
im.Indent(indentWidth)
if im.Checkbox(string.format("##%s_%s_%s_%d", layer.uid, guiId, "layerMaskLayerEnabled", k), editor.getTempBool_BoolBool(maskLayer.enabled)) then
local layerCopy = deepcopy(layer)
if selectionData and selectionData[maskLayer.uid] then
if editor.uiIconImageButton(editor.icons.near_me, im.ImVec2(tool.getIconSize(), tool.getIconSize()), editor.color.beamng.Value, nil, nil, string.format("select##%s_%s", guiId, layer.uid)) then
selection.deselectLayer(maskLayer.uid)
else
if editor.uiIconImageButton(editor.icons.near_me, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("select##%s_%s", guiId, layer.uid)) then
selection.selectLayer(maskLayer.uid)
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("%s_%d_%s", layer.uid, k, "removeLayerMaskLayer")) then
local layerCopy = deepcopy(layer)
im.TextUnformatted(string.format("type: %s", api.layerTypesMap[maskLayer.type]))
im.SameLine()
if im.Button(string.format("Dump##%s_%s_%s_%d", layer.uid, guiId, "layerMaskLayerDumbButton", k)) then
dump(maskLayer)
im.ImVec2(tool.getIconSize(), tool.getIconSize()),
isHighlighted and editor.color.beamng.Value or nil, nil, nil, string.format("highlightLayerMaskButton##%s_%s_%s_%d", layer.uid, guiId, "layerMaskLayerHighlightButton", k)) then
if layer.children and #layer.children > 0 then
if im.TreeNodeEx1(string.format("Children##%s_%s", layer.uid, guiId), im.TreeNodeFlags_DefaultOpen) then
im.SameLine()
local layerCountText = string.format("Layer count: %d", api.getLayerCount())
end
im.BeginChild1(string.format("##%s_%s_%s", guiId, layer.uid, "before"), im.ImVec2(0, layerDropHeight), true)
im.EndChild()
if editor.getPreference("dynamicDecalsTool.general.debug") then
print(string.format("drag drop: before 1, from: %d, fromParentUid: %s, to: %d, toParentUid: %s", from or -1, fromParentUid or "nil", to or -1, toParentUid or "nil"))
end
if editor.getPreference("dynamicDecalsTool.general.debug") then
print(string.format("drag drop: before 2, from: %d, fromParentUid: %s, to: %d, toParentUid: %s", from or -1, fromParentUid or "nil", to or -1, toParentUid or "nil"))
end
end
im.BeginChild1(string.format("##%s_%s_%s", guiId, "XXXX-XXXX", "after_last"), im.ImVec2(0, layerDropHeight), true)
im.EndChild()
if editor.getPreference("dynamicDecalsTool.general.debug") then
print(string.format("drag drop: after_last, from: %d, fromParentUid: %s, to: %d, toParentUid: %s", from or -1, fromParentUid or "nil", to or -1, toParentUid or "nil"))
end
@/lua/ge/extensions/freeroam/levelStats.lua
s.lastUsed = now
log('D', '', string.format("Saving stats for level %q, spawnpoint %q, to file: %q", levelName, spawnPointName, statsFilePath))
jsonWriteFile(statsFilePath, stats, true)
@/lua/ge/extensions/career/modules/milestones/general.lua
if not milestones.saveData.general[milestone.id].claimedStep then
log("W","",string.format("Milestone %s has no 'claimedStep' in its savedata. Please addd it you make custom savedata!", dumps(milestone.id)))
end
sumChange[reward.attributeKey] = (sumChange[reward.attributeKey] or 0) + reward.rewardAmount
table.insert(rewardsLabel, string.format("%s: +%d", reward.attributeKey, reward.rewardAmount))
end
@/lua/ge/extensions/ui/gameplaySelector/tileGenerators/missionTiles.lua
local function getKeyFromDetails(details)
return string.format("mission_%s", details.missionId)
end
@/lua/ge/extensions/gameplay/police.lua
if gameplay_traffic.showMessages and policePlayer and not policePlayer.role.flags.busy then
ui_message(string.format('%s %s', translateLanguage('ui.traffic.suspectFlee', 'A suspect is fleeing from you! Vehicle:'), targetVeh.modelName), 5, 'traffic', 'traffic')
end
for _, v in ipairs(veh.pursuit.offensesList) do
table.insert(offensesTranslated, translateLanguage(string.format('ui.traffic.infractions.%s', v), v))
end
ui_message(string.format('%s %s', translateLanguage('ui.traffic.infractions.title', 'Offenses:'), table.concat(offensesTranslated, ', ')), 5, 'trafficInfractions', 'traffic')
end
else
log('W', logTag, string.format('Failed to start pursuit gameplay, suspect vehicle not found: %d', suspectId))
return false
if policeAmount > 0 or propAmount > 0 then
log('I', logTag, string.format('Activated %d police vehicles and %d police props', policeAmount, propAmount))
end
@/lua/ge/extensions/gameplay/missions/missions.lua
end
log(severityToLog[mission._issueList.highestSeverity] or 'I', "", string.format("Mission %s has %d issues:", mission.id, #(mission._issueList.list or {})))
for _, i in ipairs(mission._issueList.list or {}) do
@/lua/ge/extensions/gameplay/crashTest/crashTestScoring.lua
local precision = damageLocationData.damageStateDiff.damagedLocations[damageLocationData.damageStateDiff.mostDamagedLocation].totalDamage / totalDamageNonLocationGoal * 100
return {score = math.ceil(score), scoreName = "Impact Accuracy Score", maxScore = scoreParameters.maxDamageLocationScore, requiredImpactLocation = {text = "Required impact location", value = damageLocationGoal}, actualImpactLocation = {text = "Majority of impact location", value = damageLocationData.mostDamagedLocation, precision = string.format("at %i %%", precision)}}
end
@/lua/vehicle/extensions/tech/vehicleSearcher.lua
local cData = { wheels = whData, electrics = elData, powertrain = pProc }
obj:queueGameEngineLua(string.format("editor_cosimulationSignalEditor.updateCollectedVehicleData(%q)", lpack.encode(cData)))
end
@/lua/ge/extensions/editor/rallyEditor/pacenotes.lua
-- local styleData = recce.settings:getCornerCallStyle()
-- log('D', logTag, string.format('_loadSnaproadRoute missionId=%s missionDir=%s missionName=%s', missionId, missionDir, missionName))
-- local rallyManager = RallyManager(missionDir, missionId)
log('D', logTag, string.format('generateElevationProfile missionId=%s missionDir=%s', missionId, missionDir))
if elevationProfile and #elevationProfile > 0 then
log('I', logTag, string.format('generated elevation profile with %d points', #elevationProfile))
else
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veAdjustableTechCarTuner.lua
im.SetCursorPos(im.ImVec2(5, 50))
im.Text(string.format("Mouse Pos: %0.2f, %0.2f", im.GetMousePos().x - wndPos.x, im.GetMousePos().y - wndPos.y))
local x, y = im.GetMousePos().x - wndPos.x - viewToDebug.imgPos.x, im.GetMousePos().y - wndPos.y - viewToDebug.imgPos.y
local x, y = im.GetMousePos().x - wndPos.x - viewToDebug.imgPos.x, im.GetMousePos().y - wndPos.y - viewToDebug.imgPos.y
im.Text(string.format("Mouse Pos Rel Img: %0.3f, %0.3f", x / viewToDebug.imgSize.x, y / viewToDebug.imgSize.y))
end
@/lua/ge/extensions/util/precompileVehicles.lua
local v = vehicles[vehicleToLoad]
log('I', logTag, string.format('Loading vehicle %s (%d/%d).', v, vehicleToLoad, #vehicles))
core_vehicles.replaceVehicle(v, {})
log('I', logTag, string.format('Will precompile data for %d vehicles.', #vehicles))
freeroam_freeroam.startFreeroam(path.getPathLevelMain('smallgrid'))
@/lua/ge/extensions/ui/vehiclePaint.lua
local function dataToString(data)
return string.format("%s %s %s %s", data[1], data[2], data[3], data[4])
end
@/lua/console/bananabench-csv.lua
local nDynCol = test.res[2]
local line = string.format(row,
vecname,
print(line)
local line = string.format(row,
vecname,
@/lua/ge/extensions/editor/meshSpline/splineMgr.lua
local folderNameId = Engine.generateUUID()
newFolder:registerObject(string.format("%s - %s", uniqueName, folderNameId))
newFolder.cansave = true
-- Main mesh component properties.
spline.mainComponentPath = string.format('main_%s', preset.meshPath)
spline.extentsW_Center = mesh_extentsW_Center
spline.alias1MeshName = preset.alias1MeshName
spline.alias1ComponentPath = string.format('alias1_%s', preset.alias1MeshPath)
spline.alias2MeshName = preset.alias2MeshName
spline.alias2ComponentPath = string.format('alias2_%s', preset.alias2MeshPath)
spline.alias3MeshName = preset.alias3MeshName
spline.alias3ComponentPath = string.format('alias3_%s', preset.alias3MeshPath)
spline.startCapMeshName = preset.startCapMeshName
spline.startCapComponentPath = string.format('startCap_%s', preset.startCapMeshPath)
spline.endCapMeshName = preset.endCapMeshName
spline.endCapComponentPath = string.format('endCap_%s', preset.endCapMeshPath)
end
-- Ensure we have a unique mesh spline name.
local baseName = string.format(toolPrefixStr .. " %d", #meshSplines + 1)
local uniqueName = util.generateUniqueName(baseName, toolPrefixStr)
local newFolder = createObject("SimGroup")
newFolder:registerObject(string.format("%s - %s", uniqueName, id))
newFolder.cansave = true
-- Ensure we have a unique mesh spline name.
local baseName = string.format(toolPrefixStr .. " %d", #meshSplines + 1)
local uniqueName = util.generateUniqueName(baseName, toolPrefixStr)
local newFolder = createObject("SimGroup")
newFolder:registerObject(string.format("%s - %s", uniqueName, spline.id))
newFolder.cansave = true
end
log('I', logTag, string.format("Converted %d traced paths to mesh splines. %d paths were too small to import.", #paths, #paths - #meshSplines))
end
@/inspector/Views/LayerDetailsSidebarPanel.js
this._layersCountLabel.textContent = WI.UIString("Layer Count: %d").format(newLayers.length);
let totalMemory = newLayers.reduce((total, layer) => total + (layer.memory || 0), 0);
this._layersMemoryLabel.textContent = WI.UIString("Memory: %s").format(Number.bytesToString(totalMemory));
}
@/lua/vehicle/ve_utils.lua
elseif type(d) == "number" then
return string.format("%g", d)
else
@/inspector/Models/Resource.js
{
let errorString = WI.UIString("Unable to show certificate for \u201C%s\u201D").format(this.url);
@/lua/ge/extensions/gameplay/missions/missionTypes/editorHelper.lua
if not foundFile then
return {{label = string.format('File does not exist: %s - fieldName %s does not exist: %s', e.fieldName, dumps(file)), severity = 'error'}}
end
if mtd[val.fieldName] ~= nil and element.defaultValue ~= nil and (type(mtd[val.fieldName]) ~= type(element.defaultValue)) then
table.insert(issues, {label = 'Mismatched Missiontype Value: ' .. val.fieldName .. string.format(" (%s, should be %s)", type(mtd[val.fieldName]), type(element.defaultValue)), data=val, severity='error', fixable=true})
end
im.BeginDisabled()
im.Text(string.format("%0.2f m/s = %0.2f %s",e.ptr[0],translateVelocity(e.ptr[0], true)))
im.EndDisabled()
im.BeginDisabled()
im.Text(string.format("%0.2f m = %0.2f %s",e.ptr[0],translateDistance(e.ptr[0], true)))
im.EndDisabled()
local t = e.ptr[0]
im.Text(string.format("%0.2f s = %d:%02d.%02d mm:ss.mmm",t,(t-(t%60))/60, math.floor(t%60), 100*(t%1)))
im.EndDisabled()
--local budgets = career_career.getBudgets(e.ptr[0])
--im.TextDisabled(string.format("%0.2f Reward = %0.2f B$ and %d Reputation", e.ptr[0], budgets.moneyBudget, budgets.reputationBudget))
return ret
editEnded[0] = false
--im.Text(string.format("%d - %s", index, dumps(element.hidden)))
if not element.hidden and (drawFunctions[element.type] or nop)(element, self.mission.missionTypeData, self.mission, self.mouseInfo) then
field.type = ui_flowgraph_editor.getAutoTypeFromName(field.label)
--print(string.format("%s (%s) from %s", field.fieldName, field.type, field.elemLabel))
end
@/lua/ge/extensions/ui/uiNavi.lua
targetVeh:queueJSUITexture(dashboard, string.format("%s(%s)", initmap or "map.setData", jsonEncode(mapTable)))
end
@/lua/ge/extensions/util/nodeBeamExport.lua
local nextIdx = maxIdx + 1
return string.format('%sexport_%d.nbexport.json', dir, nextIdx)
end
@/lua/ge/extensions/editor/dynamicDecals/notification.lua
if im.CollapsingHeader1(string.format("%s##NotificationSection", sectionName), im.TreeNodeFlags_DefaultOpen) then
for k, notification in ipairs(sectionData) do
for k, notification in ipairs(sectionData) do
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("%s_%d", sectionName, k)) then
table.remove(notifications[sectionName], k)
if msgtype == 'string' then
im.TextColored(colors[notification.level].Value, string.format("%s - %s", notification.title, notification.msg))
elseif msgtype == 'function' then
@/lua/common/libs/luasocket/socket/smtp.lua
seqno = seqno + 1
return string.format('%s%05d==%05u', os.date('%d%m%Y%H%M%S'),
math.random(0, 99999), seqno)
@/lua/ge/extensions/gameplay/rally/rallyManager.lua
local minutes = totalMinutes % 60
return string.format("%dh %dm", hours, minutes)
end
if gameplay_rally and gameplay_rally.getDebugLogging() then
log('D', logTag, string.format('triggerShowVisualPacenote name=%s, serialNo=%s', pacenote.name, pacenote.visualSerialNo))
end
profilerPushEvent("rallyManager:triggerClearVisualPacenote")
if gameplay_rally and gameplay_rally.getDebugLogging() then log('D', logTag, string.format('triggerClearVisualPacenote name=%s, serialNo=%s', pacenote.name, pacenote.visualSerialNo)) end
guihooks.trigger('clearOneVisualPacenote', pacenote.visualSerialNo)
if gameplay_rally and gameplay_rally.getDebugLogging() then
log('D', logTag, string.format('processPacenoteQueue: got pacenote name=%s', tostring(qPacenote.name)))
end
if gameplay_rally and gameplay_rally.getDebugLogging() then
log('E', logTag, string.format('processPacenoteQueue: unknown peek value: %s', tostring(peekValue)))
end
if not pacenote.audioFname then
log('E', logTag, string.format('enqueueRandomSystemPacenote: no audioFname for system pacenote %s', name))
return
if not basename then
log('E', logTag, string.format('enqueueRandomSystemPacenote: could not extract basename from %s', pacenote.audioFname))
return
if not metadataVal then
log('E', logTag, string.format('enqueueRandomSystemPacenote: no metadata entry found for %s', basename))
return
-- log('D', logTag, string.format('enqueueRandomSystemPacenote: %s - raw audioLen value: %s (type: %s)', basename, tostring(metadataVal.audioLen), type(metadataVal.audioLen)))
if not audioLen then
log('E', logTag, string.format('enqueueRandomSystemPacenote: invalid audioLen for %s: %s (type: %s)', basename, tostring(metadataVal.audioLen), type(metadataVal.audioLen)))
return
-- log('D', logTag, string.format('enqueueRandomSystemPacenote: %s - converted audioLen: %f', basename, audioLen))
@/lua/ge/extensions/flowgraph/modules/uiModule.lua
local isBest = lap.lapTime == bestLapTime
local differenceText = isBest and "Best" or string.format("+%d:%02d:%03d",
math.floor((lap.lapTime - bestLapTime) / 60),
{ text = i },
{ format = "detailledTime", detailledTime = lap.lapTime, text = string.format("%d:%02d:%03d",
math.floor(lap.lapTime / 60),
@/lua/ge/extensions/gameplay/drift/destination.lua
else
im.Text(string.format("Dist. remaining before fail : %i m", maxWrongWayDist - currWrongWayDist))
im.Text("Going the wrong way : " .. tostring(goingWrongWay))
im.Text("Reversed race path : " .. tostring(reversedFlag))
im.Text(string.format("Dist to intended road : %i m", distToIntendedRoad))
end
@/lua/ge/extensions/ui/freeroamSelector/general.lua
local filterValue = groupName
title = string.format("%s", filterValue)
else
else
title = string.format("%s", clusterKey, groupKey, groupName)
end
@/lua/vehicle/controller/powertrainControl/activeCenterDiff.lua
--print(string.format("Desired Lock: %.2f ", desiredLock) .. string.format("Slip: %.2f ", slip))
centerDiff.activeLockCoef = desiredLock
--print(string.format("Desired Lock: %.2f ", desiredLock) .. string.format("Slip: %.2f ", slip))
centerDiff.activeLockCoef = desiredLock
@/lua/ge/extensions/editor/flowgraph/missionVariableHelper.lua
log("D", logTag, string.format("Found %s mission variables to apply from Mission to Flowgraph", tableSize(missionTypeData)))
applied = applied + 1
log("D", logTag, string.format(" [+] %s -> set to %s", name, dumps(value, 2)))
else
else
log("W", logTag, string.format(" [!] %s -> failed to set", name))
end
notFound = notFound + 1
log("D", logTag, string.format(" [x] %s -> skipped since it doesn't exist in flowgraph", name))
end
injected = injected + 1
log("D", logTag, string.format(" [#] %s -> injected player vehicle ID = %s", varName, tostring(vehicleId)))
end
if applied > 0 or injected > 0 then
log("D", logTag, string.format("Successfully applied %s variables from mission: %s", applied, selectedMission.id))
if injected > 0 then
if injected > 0 then
log("D", logTag, string.format(" (+ %s vehicle ID variables injected)", injected))
end
if notFound > 0 then
log("D", logTag, string.format(" (%s variables skipped - not defined in flowgraph)", notFound))
end
else
log("D", logTag, string.format("No variables were applied (found %s undefined variables)", notFound))
return false
@/inspector/Views/TimelineRecordingContentView.js
this._exportButtonNavigationItem = new WI.ButtonNavigationItem("export", WI.UIString("Export"), "Images/Export.svg", 15, 15);
this._exportButtonNavigationItem.toolTip = WI.UIString("Export (%s)").format(WI.saveKeyboardShortcut.displayName);
this._exportButtonNavigationItem.buttonStyle = WI.ButtonNavigationItem.Style.ImageAndText;
this._clearTimelineNavigationItem = new WI.ButtonNavigationItem("clear-timeline", WI.UIString("Clear Timeline (%s)").format(WI.clearKeyboardShortcut.displayName), "Images/NavigationItemTrash.svg", 15, 15);
this._clearTimelineNavigationItem.visibilityPriority = WI.NavigationItem.VisibilityPriority.Low;
if (startValue < epsilon)
displayName = WI.UIString("%s \u2013 %s").format(selectionStart, selectionEnd);
else {
let duration = Number.secondsToString(endValue - startValue, higherResolution);
displayName = WI.UIString("%s \u2013 %s (%s)").format(selectionStart, selectionEnd, duration);
}
if (startValue === endValue)
displayName = WI.UIString("Frame %d").format(startValue);
else
else
displayName = WI.UIString("Frames %d \u2013 %d").format(startValue, endValue);
}
@/gameplay/missionTypes/precisionParking/customNodes/parkingPointsNode.lua
local score = round(math.min(20,(angleScore+sideScore+forwardScore) * 6 + 2))
log("D","",string.format("Parking Score: %d (angle: %0.2fpts (%0.2f°) | side: %0.2fpts (%0.2fm) | forw: %0.2fpts (%0.2fm) | +2pts by default)",score, angleScore*6, angle, sideScore*6, self.pinIn.sideDist.value, forwardScore*6, self.pinIn.forwardDist.value ))
if score >= 20 then
@/inspector/Views/LayerTreeDetailsSidebarPanel.js
this._layersCountLabel.textContent = WI.UIString("Layer Count: %d").format(layerCount);
this._layersMemoryLabel.textContent = WI.UIString("Memory: %s").format(Number.bytesToString(totalMemory));
this._layersCountLabel.textContent = WI.UIString("Layer Count: %d").format(layerCount);
this._layersMemoryLabel.textContent = WI.UIString("Memory: %s").format(Number.bytesToString(totalMemory));
}
@/lua/vehicle/energyStorage.lua
else
log("D", "energyStorage.getStorageSafe", string.format("Didn't find storage '%s', returning nilStorage.", name))
--log("D", "energyStorage.getStorageSafe", debug.traceback())
@/lua/vehicle/powertrain/combustionEngineThermals.lua
-- Audio Debug
-- print (string.format(" AF Trig Insta %.3f/%.3f Eng InstVolCoef %.2f Exh VolCoef %.2f EngExh Vol TOTL %.2f Exh Color %.2f", parentEngine.instantAfterFireCoef, parentEngine.instantAfterFireCoef * n.afterFireAudioCoef, afterFire.instantVolumeCoef, n.afterFireVolumeCoef, afterFire.instantVolumeCoef * n.afterFireVolumeCoef, 1 - n.afterFireMufflingCoef))
end
-- Audio Debug
-- print (string.format(" AF Trig Shift %.3f/%.3f Eng InstVolCoef %.2f Exh VolCoef %.2f EngExh Vol TOTL %.2f Exh Color %.2f", parentEngine.shiftAfterFireCoef, parentEngine.shiftAfterFireCoef * n.afterFireAudioCoef, afterFire.shiftVolumeCoef, n.afterFireVolumeCoef, afterFire.shiftVolumeCoef * n.afterFireVolumeCoef, 1 - n.afterFireMufflingCoef))
end
obj:playSFXOnceCT(afterFire.sustainedAudioSample, n.finish, n.afterFireVolumeCoef * afterFire.sustainedVolumeCoef, 1.0, 1 - n.afterFireMufflingCoef, 0)
--print (string.format(" AF Trig Sustd %.3f/%.3f Eng InstVolCoef %.2f Exh VolCoef %.2f EngExh Vol TOTL %.2f Exh Color %.2f", parentEngine.sustainedAfterFireCoef, parentEngine.sustainedAfterFireCoef * n.afterFireAudioCoef, afterFire.sustainedVolumeCoef, n.afterFireVolumeCoef, afterFire.sustainedVolumeCoef * n.afterFireVolumeCoef, 1 - n.afterFireMufflingCoef))
end
-- Audio Debug
-- print (string.format("instantAfterFire coef %.2f / sustainedAfterFire coef %.2f / shiftVolumeCoef %.2f", jbeamData.instantAfterFireVolumeCoef, jbeamData.sustainedAfterFireVolumeCoef, jbeamData.shiftAfterFireVolumeCoef))
-- print (string.format("audibleThresholdInstant %.2f / audibleThresholdSustained %.2f / audibleThresholdShift %.2f", jbeamData.afterFireAudibleThresholdInstant, jbeamData.afterFireAudibleThresholdSustained, jbeamData.afterFireAudibleThresholdShift))
-- print (string.format("instantAfterFire coef %.2f / sustainedAfterFire coef %.2f / shiftVolumeCoef %.2f", jbeamData.instantAfterFireVolumeCoef, jbeamData.sustainedAfterFireVolumeCoef, jbeamData.shiftAfterFireVolumeCoef))
-- print (string.format("audibleThresholdInstant %.2f / audibleThresholdSustained %.2f / audibleThresholdShift %.2f", jbeamData.afterFireAudibleThresholdInstant, jbeamData.afterFireAudibleThresholdSustained, jbeamData.afterFireAudibleThresholdShift))
if radiatorFanTemperature > radiatorFanTemperatureDesired then
log("W", "engine.initThermals", string.format("Increased desired radiator fan temperature from '%dC' to '%dC' to prevent fan trigger issues with thermostat at '%dC'.", radiatorFanTemperatureDesired, radiatorFanTemperature, thermostatTemperature))
end
@/lua/ge/extensions/editor/drivePathEditor/playback.lua
local n = nodes[i]
table.insert(scriptParts, string.format(
"{ x = %f, y = %f, z = %f, r = %f, v = %f, vl = %f }",
-- Create the command for vLua, then execute it.
local command = string.format(
[[
-- Create the command for vlua, then execute it.
local luaCmd = string.format(
[[
@/lua/common/libs/lua-websockets/websocket/handshake.lua
local lines = {
format('GET %s HTTP/1.1',req.uri or ''),
format('Host: %s',req.host),
format('GET %s HTTP/1.1',req.uri or ''),
format('Host: %s',req.host),
'Upgrade: websocket',
'Connection: Upgrade',
format('Sec-WebSocket-Key: %s',req.key),
format('Sec-WebSocket-Protocol: %s',table.concat(req.protocols,', ')),
format('Sec-WebSocket-Key: %s',req.key),
format('Sec-WebSocket-Protocol: %s',table.concat(req.protocols,', ')),
'Sec-WebSocket-Version: 13',
for k,v in pairs(req.extra_headers) do
tinsert(lines, string.format('%s: %s',k,v))
end
if req.origin then
tinsert(lines,string.format('Origin: %s',req.origin))
end
if req.port and req.port ~= 80 then
lines[2] = format('Host: %s:%d',req.host,req.port)
end
'Connection: '..headers['connection'],
string.format('Sec-WebSocket-Accept: %s',sec_websocket_accept(headers['sec-websocket-key'])),
}
if prot then
tinsert(lines,string.format('Sec-WebSocket-Protocol: %s',prot))
end
@/inspector/Controllers/AuditManager.js
{
message = WI.UIString("Audit Warning: %s").format(message);
{
message = WI.UIString("Audit Error: %s").format(message);
&& json.type !== WI.AuditTestCaseResult.TypeIdentifier && json.type !== WI.AuditTestGroupResult.TypeIdentifier) {
WI.AuditManager.synthesizeError(WI.UIString("unknown %s \u0022%s\u0022").format(WI.unlocalizedString("type"), json.type));
return;
if (object instanceof WI.AuditTestResultBase)
filename = WI.UIString("%s Result").format(filename);
new WI.AuditTestCase("getElementsByComputedRole", removeWhitespace(getElementsByComputedRole), {description: WI.UIString("This test will pass with all DOM nodes that have a computed role of \u0022link\u0022."), supports: 1}),
new WI.AuditTestCase("getActiveDescendant", removeWhitespace(getActiveDescendant), {description: WI.UIString("This test will pass with the active descendant (\u0022%s\u0022) of the element, if it exists.").format(WI.unlocalizedString("aria-activedescendant")), supports: 1}),
new WI.AuditTestCase("getChildNodes", removeWhitespace(getChildNodes), {description: WI.UIString("This test will pass with all of the child nodes of the element in the accessibility tree."), supports: 1}),
new WI.AuditTestCase("getComputedProperties", removeWhitespace(getComputedProperties), {description: WI.UIString("This test will pass with a variety of accessibility information about the element."), supports: 3}),
new WI.AuditTestCase("getControlledNodes", removeWhitespace(getControlledNodes), {description: WI.UIString("This test will pass with all nodes controlled (\u0022%s\u0022) by the element, if any exist.").format(WI.unlocalizedString("aria-controls")), supports: 1}),
new WI.AuditTestCase("getFlowedNodes", removeWhitespace(getFlowedNodes), {description: WI.UIString("This test will pass with all nodes flowed to (\u0022%s\u0022) from the element, if any exist.").format(WI.unlocalizedString("aria-flowto")), supports: 1}),
new WI.AuditTestCase("getControlledNodes", removeWhitespace(getControlledNodes), {description: WI.UIString("This test will pass with all nodes controlled (\u0022%s\u0022) by the element, if any exist.").format(WI.unlocalizedString("aria-controls")), supports: 1}),
new WI.AuditTestCase("getFlowedNodes", removeWhitespace(getFlowedNodes), {description: WI.UIString("This test will pass with all nodes flowed to (\u0022%s\u0022) from the element, if any exist.").format(WI.unlocalizedString("aria-flowto")), supports: 1}),
new WI.AuditTestCase("getMouseEventNode", removeWhitespace(getMouseEventNode), {description: WI.UIString("This test will pass with the node that would handle mouse events for the element, if applicable."), supports: 1}),
new WI.AuditTestCase("getMouseEventNode", removeWhitespace(getMouseEventNode), {description: WI.UIString("This test will pass with the node that would handle mouse events for the element, if applicable."), supports: 1}),
new WI.AuditTestCase("getOwnedNodes", removeWhitespace(getOwnedNodes), {description: WI.UIString("This test will pass with all nodes owned (\u0022%s\u0022) by the element, if any exist.").format(WI.unlocalizedString("aria-owns")), supports: 1}),
new WI.AuditTestCase("getParentNode", removeWhitespace(getParentNode), {description: WI.UIString("This test will pass with the parent node of the element in the accessibility tree."), supports: 1}),
new WI.AuditTestCase("getParentNode", removeWhitespace(getParentNode), {description: WI.UIString("This test will pass with the parent node of the element in the accessibility tree."), supports: 1}),
new WI.AuditTestCase("getSelectedChildNodes", removeWhitespace(getSelectedChildNodes), {description: WI.UIString("This test will pass with all child nodes that are selected (\u0022%s\u0022) of the element in the accessibility tree.").format(WI.unlocalizedString("aria-selected")), supports: 1}),
], {description: WI.UIString("These tests demonstrate how to use %s to get information about the accessibility tree.").format(WI.unlocalizedString("WebInspectorAudit.Accessibility")), supports: 1}),
new WI.AuditTestCase("getSelectedChildNodes", removeWhitespace(getSelectedChildNodes), {description: WI.UIString("This test will pass with all child nodes that are selected (\u0022%s\u0022) of the element in the accessibility tree.").format(WI.unlocalizedString("aria-selected")), supports: 1}),
], {description: WI.UIString("These tests demonstrate how to use %s to get information about the accessibility tree.").format(WI.unlocalizedString("WebInspectorAudit.Accessibility")), supports: 1}),
new WI.AuditTestGroup(WI.UIString("DOM"), [
new WI.AuditTestCase("hasEventListeners-click", removeWhitespace(hasEventListenersClick), {description: WI.UIString("This test will pass with data indicating whether the element has any click event listeners."), supports: 3}),
], {description: WI.UIString("These tests demonstrate how to use %s to get information about DOM nodes.").format(WI.unlocalizedString("WebInspectorAudit.DOM")), supports: 1}),
new WI.AuditTestGroup(WI.UIString("Resources"), [
new WI.AuditTestCase("getResourceContent", removeWhitespace(getResourceContent), {description: WI.UIString("This test will pass with the contents of the main resource."), supports: 3}),
], {description: WI.UIString("These tests demonstrate how to use %s to get information about loaded resources.").format(WI.unlocalizedString("WebInspectorAudit.Resources")), supports: 2}),
], {description: WI.UIString("These tests demonstrate how to use %s to access information not normally available to JavaScript.").format(WI.unlocalizedString("WebInspectorAudit")), supports: 1}),
], {description: WI.UIString("These tests demonstrate how to use %s to get information about loaded resources.").format(WI.unlocalizedString("WebInspectorAudit.Resources")), supports: 2}),
], {description: WI.UIString("These tests demonstrate how to use %s to access information not normally available to JavaScript.").format(WI.unlocalizedString("WebInspectorAudit")), supports: 1}),
], {description: WI.UIString("These tests serve as a demonstration of the functionality and structure of audits.")}),
new WI.AuditTestGroup(WI.UIString("Accessibility"), [
new WI.AuditTestCase("testMenuRoleForRequiredChidren", removeWhitespace(testMenuRoleForRequiredChidren), {description: WI.UIString("Ensure that element of role \u0022%s\u0022 and \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("menu"), WI.unlocalizedString("menubar")), supports: 1}),
new WI.AuditTestCase("testGridRoleForRequiredChidren", removeWhitespace(testGridRoleForRequiredChidren), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("grid")), supports: 1}),
new WI.AuditTestCase("testMenuRoleForRequiredChidren", removeWhitespace(testMenuRoleForRequiredChidren), {description: WI.UIString("Ensure that element of role \u0022%s\u0022 and \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("menu"), WI.unlocalizedString("menubar")), supports: 1}),
new WI.AuditTestCase("testGridRoleForRequiredChidren", removeWhitespace(testGridRoleForRequiredChidren), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("grid")), supports: 1}),
new WI.AuditTestCase("testForAriaLabelledBySpelling", removeWhitespace(testForAriaLabelledBySpelling), {description: WI.UIString("Ensure that \u0022%s\u0022 is spelled correctly.").format(WI.unlocalizedString("aria-labelledby")), supports: 1}),
new WI.AuditTestCase("testGridRoleForRequiredChidren", removeWhitespace(testGridRoleForRequiredChidren), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("grid")), supports: 1}),
new WI.AuditTestCase("testForAriaLabelledBySpelling", removeWhitespace(testForAriaLabelledBySpelling), {description: WI.UIString("Ensure that \u0022%s\u0022 is spelled correctly.").format(WI.unlocalizedString("aria-labelledby")), supports: 1}),
new WI.AuditTestCase("testForMultipleBanners", removeWhitespace(testForMultipleBanners), {description: WI.UIString("Ensure that only one banner is used on the page."), supports: 1}),
new WI.AuditTestCase("testForLinkLabels", removeWhitespace(testForLinkLabels), {description: WI.UIString("Ensure that links have accessible labels for assistive technology."), supports: 1}),
new WI.AuditTestCase("testRowGroupRoleForRequiredChidren", removeWhitespace(testRowGroupRoleForRequiredChidren), {description: WI.UIString("Ensure that element of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("rowgroup")), supports: 1}),
new WI.AuditTestCase("testTableRoleForRequiredChidren", removeWhitespace(testTableRoleForRequiredChidren), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("table")), supports: 1}),
new WI.AuditTestCase("testRowGroupRoleForRequiredChidren", removeWhitespace(testRowGroupRoleForRequiredChidren), {description: WI.UIString("Ensure that element of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("rowgroup")), supports: 1}),
new WI.AuditTestCase("testTableRoleForRequiredChidren", removeWhitespace(testTableRoleForRequiredChidren), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("table")), supports: 1}),
new WI.AuditTestCase("testForMultipleLiveRegions", removeWhitespace(testForMultipleLiveRegions), {description: WI.UIString("Ensure that only one live region is used on the page."), supports: 1}),
new WI.AuditTestCase("testForMultipleLiveRegions", removeWhitespace(testForMultipleLiveRegions), {description: WI.UIString("Ensure that only one live region is used on the page."), supports: 1}),
new WI.AuditTestCase("testListBoxRoleForRequiredChidren", removeWhitespace(testListBoxRoleForRequiredChidren), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("listbox")), supports: 1}),
new WI.AuditTestCase("testImageLabels", removeWhitespace(testImageLabels), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have accessible labels for assistive technology.").format(WI.unlocalizedString("img")), supports: 1}),
new WI.AuditTestCase("testListBoxRoleForRequiredChidren", removeWhitespace(testListBoxRoleForRequiredChidren), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("listbox")), supports: 1}),
new WI.AuditTestCase("testImageLabels", removeWhitespace(testImageLabels), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have accessible labels for assistive technology.").format(WI.unlocalizedString("img")), supports: 1}),
new WI.AuditTestCase("testForAriaHiddenFalse", removeWhitespace(testForAriaHiddenFalse), {description: WI.UIString("Ensure aria-hidden=\u0022%s\u0022 is not used.").format(WI.unlocalizedString("false")), supports: 1}),
new WI.AuditTestCase("testImageLabels", removeWhitespace(testImageLabels), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have accessible labels for assistive technology.").format(WI.unlocalizedString("img")), supports: 1}),
new WI.AuditTestCase("testForAriaHiddenFalse", removeWhitespace(testForAriaHiddenFalse), {description: WI.UIString("Ensure aria-hidden=\u0022%s\u0022 is not used.").format(WI.unlocalizedString("false")), supports: 1}),
new WI.AuditTestCase("testTreeRoleForRequiredChidren", removeWhitespace(testTreeRoleForRequiredChidren), {description: WI.UIString("Ensure that element of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("tree")), supports: 1}),
new WI.AuditTestCase("testForAriaHiddenFalse", removeWhitespace(testForAriaHiddenFalse), {description: WI.UIString("Ensure aria-hidden=\u0022%s\u0022 is not used.").format(WI.unlocalizedString("false")), supports: 1}),
new WI.AuditTestCase("testTreeRoleForRequiredChidren", removeWhitespace(testTreeRoleForRequiredChidren), {description: WI.UIString("Ensure that element of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("tree")), supports: 1}),
new WI.AuditTestCase("testRadioGroupRoleForRequiredChidren", removeWhitespace(testRadioGroupRoleForRequiredChidren), {description: WI.UIString("Ensure that element of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("radiogroup")), supports: 1}),
new WI.AuditTestCase("testTreeRoleForRequiredChidren", removeWhitespace(testTreeRoleForRequiredChidren), {description: WI.UIString("Ensure that element of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("tree")), supports: 1}),
new WI.AuditTestCase("testRadioGroupRoleForRequiredChidren", removeWhitespace(testRadioGroupRoleForRequiredChidren), {description: WI.UIString("Ensure that element of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("radiogroup")), supports: 1}),
new WI.AuditTestCase("testFeedRoleForRequiredChidren", removeWhitespace(testFeedRoleForRequiredChidren), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("feed")), supports: 1}),
new WI.AuditTestCase("testRadioGroupRoleForRequiredChidren", removeWhitespace(testRadioGroupRoleForRequiredChidren), {description: WI.UIString("Ensure that element of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("radiogroup")), supports: 1}),
new WI.AuditTestCase("testFeedRoleForRequiredChidren", removeWhitespace(testFeedRoleForRequiredChidren), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("feed")), supports: 1}),
new WI.AuditTestCase("testTabListRoleForRequiredChidren", removeWhitespace(testTabListRoleForRequiredChidren), {description: WI.UIString("Ensure that element of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("tablist")), supports: 1}),
new WI.AuditTestCase("testFeedRoleForRequiredChidren", removeWhitespace(testFeedRoleForRequiredChidren), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("feed")), supports: 1}),
new WI.AuditTestCase("testTabListRoleForRequiredChidren", removeWhitespace(testTabListRoleForRequiredChidren), {description: WI.UIString("Ensure that element of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("tablist")), supports: 1}),
new WI.AuditTestCase("testButtonLabels", removeWhitespace(testButtonLabels), {description: WI.UIString("Ensure that buttons have accessible labels for assistive technology."), supports: 1}),
new WI.AuditTestCase("testButtonLabels", removeWhitespace(testButtonLabels), {description: WI.UIString("Ensure that buttons have accessible labels for assistive technology."), supports: 1}),
new WI.AuditTestCase("testRowRoleForRequiredChidren", removeWhitespace(testRowRoleForRequiredChidren), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("row")), supports: 1}),
new WI.AuditTestCase("testListRoleForRequiredChidren", removeWhitespace(testListRoleForRequiredChidren), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("list")), supports: 1}),
new WI.AuditTestCase("testRowRoleForRequiredChidren", removeWhitespace(testRowRoleForRequiredChidren), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("row")), supports: 1}),
new WI.AuditTestCase("testListRoleForRequiredChidren", removeWhitespace(testListRoleForRequiredChidren), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("list")), supports: 1}),
new WI.AuditTestCase("testComboBoxRoleForRequiredChidren", removeWhitespace(testComboBoxRoleForRequiredChidren), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("combobox")), supports: 1}),
new WI.AuditTestCase("testListRoleForRequiredChidren", removeWhitespace(testListRoleForRequiredChidren), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("list")), supports: 1}),
new WI.AuditTestCase("testComboBoxRoleForRequiredChidren", removeWhitespace(testComboBoxRoleForRequiredChidren), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("combobox")), supports: 1}),
new WI.AuditTestCase("testForMultipleMainContentSections", removeWhitespace(testForMultipleMainContentSections), {description: WI.UIString("Ensure that only one main content section is used on the page."), supports: 1}),
new WI.AuditTestCase("testDialogsForLabels", removeWhitespace(testDialogsForLabels), {description: WI.UIString("Ensure that dialogs have accessible labels for assistive technology."), supports: 1}),
new WI.AuditTestCase("testForInvalidAriaHiddenValue", removeWhitespace(testForInvalidAriaHiddenValue), {description: WI.UIString("Ensure that values for \u0022%s\u0022 are valid.").format(WI.unlocalizedString("aria-hidden")), supports: 1})
], {description: WI.UIString("Diagnoses common accessibility problems affecting screen readers and other assistive technology.")}),
@/lua/ge/extensions/ui/gameplaySelector/tiles.lua
--print(string.format("handleDetailGameplayPath: clusterMode: %s, clusterKey: %s, groupKey: %s, groupName: %s, pathKeys: %s", clusterMode, clusterKey, groupKey, groupName, pathKeys))
table.insert(groups, {
--label = string.format("%s (%s is %s)", clusterKey, groupKey, groupName),
tiles = filteredItems
@/lua/ge/extensions/core/settings/settings.lua
removeConsoleVariable("$pref::Video::mode") -- deprecated flag
TorqueScript.eval(string.format('export("$pref::*", "%s" , False);', settings.impl.pathTorquescript))
else
log("E", "", string.format("Unable to parse setting '%s': it should be a %s, but is a %s. The ignored value is: %s", k, type(CppSettings[k]), type(value), dumps(value)))
end
-- a setter was already defined, cannot add a setter to propagate value to C++ side
log("E", "", string.format("Unable to propagate setting '%s' to C++ side, since it already has a custom setter in LUA side: this is likely a conflict of intentions that requires bugfixing", k))
end
@/lua/ge/extensions/career/modules/log.lua
local function addLog(message, origin, severity)
table.insert(logList, string.format("%d|%s|%s|%s", os.time(), severity or "I", origin or "", message))
end
addLog(string.format("Save game to %s", currentSavePath), "log")
local saveSlot, savePath = career_saveSystem.getCurrentSaveSlot()
addLog(string.format("Loaded game %s", savePath), "log")
end
@/lua/ge/extensions/career/modules/vehicleClassGrouping.lua
local group = { -- this group is usable for the core_multiSpawn system
name = string.format("Class %s", class),
type = "custom",
for _, config in pairs(core_vehicles.getModel(model.key).configs) do
local modelConfigKey = string.format("%s/%s", model.key, config.key)
if not checkFilter(configFilter, modelConfigKey, invertedFilters.configFilter) then
@/inspector/Base/Main.js
if (WI.sharedApp.debuggableType === WI.DebuggableType.JavaScript)
reloadToolTip = WI.UIString("Restart (%s)").format(WI._reloadPageKeyboardShortcut.displayName);
else
else
reloadToolTip = WI.UIString("Reload page (%s)\nReload page ignoring cache (%s)").format(WI._reloadPageKeyboardShortcut.displayName, WI._reloadPageFromOriginKeyboardShortcut.displayName);
WI._reloadToolbarButton = new WI.ButtonToolbarItem("reload", reloadToolTip, "Images/ReloadToolbar.svg");
let elementSelectionToolTip = WI.UIString("Start element selection (%s)").format(WI._inspectModeKeyboardShortcut.displayName);
let activatedElementSelectionToolTip = WI.UIString("Stop element selection (%s)").format(WI._inspectModeKeyboardShortcut.displayName);
let elementSelectionToolTip = WI.UIString("Start element selection (%s)").format(WI._inspectModeKeyboardShortcut.displayName);
let activatedElementSelectionToolTip = WI.UIString("Stop element selection (%s)").format(WI._inspectModeKeyboardShortcut.displayName);
WI._inspectModeToolbarButton = new WI.ActivateButtonToolbarItem("inspect", elementSelectionToolTip, activatedElementSelectionToolTip, "Images/Crosshair.svg");
{
name: WI.UIString("%s:").format(WI.unlocalizedString("WebRTC")),
columns: [
String.format(formatString, [wrapperElement], String.standardFormatters, containerElement, append);
return containerElement;
@/lua/vehicle/powertrain/manualGearbox.lua
-- print(string.format("volIn - %0.2f / volOut - %0.2f / ptchIn - %0.2f / ptchOut - %0.2f / inLoad - %0.2f / outLoad - %0.2f", volumeInput, volumeOutput, pitchInput, pitchOutput, inputLoad, outputLoad))
end
if doDisplayDamageMessage then
guihooks.message({txt = string.format("Synchronizer damage (Gear %g): %d%%", wornGearIndex, clamp(device.synchroWear[wornGearIndex] * 100, 1, 100)), context = {}}, 5, "vehicle.damage.synchros")
device.previouslyReportedSynchroWear[wornGearIndex] = device.synchroWear[wornGearIndex]
-- device:setGearIndex(0)
-- guihooks.message({txt = string.format("Gear popped out, too much transmission damage"), context = {}}, 5, "vehicle.damage.synchros")
-- end
local absAVDifference = abs(avDifference)
--print(string.format("AV difference: %.2f", avDifference))
local synchroWearCoef = linearScale(device.synchroWear[newDesiredIndex], 0.1, 1, 1, 0.4)
--shift succeeded without using the clutch
--print(string.format("AV difference is minimal, shift succeeded without clutch usage. Allowed AV difference: %.2f", device.shiftAllowedNonClutchAVDifference[newDesiredIndex]))
else
if absAVDifference > device.shiftMaxSynchroAVCapability[newDesiredIndex] * synchroWearCoef then
--print(string.format("AV difference too high to sync. Max: %.2f, actual: %.2f", device.shiftMaxSynchroAVCapability[newDesiredIndex], avDifference))
isSuccessfulShift = false
if not clutchPressedEnough then
--print(string.format("Not enough clutch input. Required: %.2f, actual: ", device.shiftRequiredClutchInput[newDesiredIndex], (1 - device.parent.clutchRatio)))
isSuccessfulShift = false
if availableSyncTime * maxSyncSpeed < absAVDifference then
--print(string.format("Available sync time too small. Required: %.4fs, actual: %.4fs", absAVDifference / maxSyncSpeed, availableSyncTime))
--print(string.format("Hypothetical sync rate required for this shift: %.2f rad/s", (absAVDifference / availableSyncTime)))
--print(string.format("Available sync time too small. Required: %.4fs, actual: %.4fs", absAVDifference / maxSyncSpeed, availableSyncTime))
--print(string.format("Hypothetical sync rate required for this shift: %.2f rad/s", (absAVDifference / availableSyncTime)))
isSuccessfulShift = false
else
--print(string.format("Good shift, perfection: %.1f%%", (absAVDifference / maxSyncSpeed) / availableSyncTime * 100))
end
@/lua/ge/extensions/editor/decalEditor.lua
debugDrawer:drawTextAdvanced(inst.position, String('ID: ' .. tostring(inst.id)), ColorF(1,1,1,1), true, false, ColorI(0,0,0,192))
debugDrawer:drawTextAdvanced(inst.position, String('Dist: ' .. string.format("%0.1f", dist) .. ' m'), ColorF(1,1,1,1), true, false, ColorI(0,0,0,192))
end
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiDragFloat3(string.format("##pos_%d_%s", selectedInstance.id, label), position, 0.1, minFloatValue, maxFloatValue,
"%0." .. editor.getPreference("ui.general.floatDigitCount") .. "f", 1, positionSliderEditEnded) then
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiInputFloat3(string.format("##rot_%d_%s", selectedInstance.id, label), input4FloatValue, "%.1f", im.InputTextFlags_EnterReturnsTrue, nil) then
local decalRot = quatFromEuler(degToRad(input4FloatValue[0]), degToRad(input4FloatValue[1]), degToRad(input4FloatValue[2]))
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiInputFloat(string.format("##size_%d_%s", selectedInstance.id, label), size, 0.1, 1.0, "%0." .. editor.getPreference("ui.general.floatDigitCount") .. "f", nil) then
local oldSizes = {}
@/inspector/Views/ConsoleDrawer.js
{
this._toggleDrawerButton.defaultToolTip = WI.UIString("Hide Console (%s)").format(keyboardShortcut.displayName);
}
@/lua/ge/extensions/ui/vehicleSelector/tileClustering.lua
return {
key = string.format("%s_%s_%s", group.key, model.model.key .. (subModel or ""), previewConfig or ""),
name = name,
return {
key = string.format("%s_%s_%s", group.key, model.model.key, previewConfig or ""),
name = name,
@/lua/ge/extensions/core/versionUpdate.lua
local lastMajor = getMajorVersion(lastVersion)
log("D", "", string.format("Current version: '%s' ('%s'), last version: '%s' ('%s'), newInstall: '%s'", dumps(beamng_version), dumps(currentMajor), dumps(lastVersion), dumps(lastMajor), dumps(newInstall)))
if newInstall or (currentMajor == lastMajor) then
M.updateBackupPath = FS:folderCleanup(M.lastVersion)
log("I", "", string.format("Folder cleanup done. Destination backup path: %s", dumps(M.updateBackupPath)))
end
extensions.hookUpdate("onUpdate")
log("D", "", string.format("Saving lastVersion to disk: %s", dumps(beamng_version)))
settings.setValue('lastVersion', beamng_version)
@/gameplay/missionTypes/scatterPickup/customNodes/scatterAnimatorNode.lua
--debugDrawer:drawTextAdvanced(icon.pos, String(string.format("%d / %d", icon.remaining, icon.points)), ColorF(1,1,1,1), true, false, ColorI(0,0,0,192))
if icon.visible then
@/lua/vehicle/controller/lineLock.lua
local inputPercentage = ceil(electrics.values.brake * 100)
guihooks.message(string.format("Linelock: Enabled (%s brake lines locked at %d%%)", wheelNamesString, inputPercentage), 3, "vehicle.linelock.status")
else
@/lua/ge/extensions/flowgraph/nodes/environment/directionalGravity.lua
local grav = C.gConst * (self.planet.mass / (h*h))
debugDrawer:drawText(veh:getPosition(), String("Force: " .. string.format('%0.2E', grav)), ColorF(0,0,0,1))
end
@/inspector/Views/HeapSnapshotInstanceDataGridNode.js
node.shortestGCRootPath((gcRootPath) => {
let text = WI.UIString("Heap Snapshot Object (%s)").format("@" + node.id);
let addSpecialUserLogClass = !gcRootPath.length;
title.classList.add("title");
let localizedString = WI.UIString("Shortest property path to %s").format("@@@");
let [before, after] = localizedString.split(/\s*@@@\s*/);
@/lua/vehicle/extensions/dynamicVehicleData.lua
if relativeDifference > threshold then
log("W", logTag, string.format("Old and new '%s' differ by %.2f%% for vehicle: '%s->%s'. Old/New: %f/%f", k, relativeDifference * 100, model_key, config_key, oldData[k], v))
end
local function saveInfo(newData, whiteList)
log("I", logTag, (string.format("Got data (%s/%s):", model_key, config_key)) .. " = " .. dumps(newData))
local filepath = "vehicles/" .. model_key .. "/info_" .. config_key .. ".json"
else
layout = string.format("%dx%d", wheelCount, propulsedWheelsCount)
end
else
layout = string.format("%dx%d", wheelCount, propulsedWheelsCount)
end
if not centerDiff then
layout = string.format("%dx%d", wheelCount, propulsedWheelsCount)
else
else
layout = string.format("%dx%d", wheelCount, propulsedWheelsCount)
end
else
layout = string.format("%dx%d", wheelCount, propulsedWheelsCount)
end
elseif propulsedWheelsCount > 0 then
return string.format("%dx%d", wheelCount, propulsedWheelsCount)
end
config_key = _config_key
log("I", logTag, string.format(" *** testing car: %s->%s ***", model_key, config_key))
@/lua/ge/extensions/gameplay/markers/parkingMarker.lua
local playModeIconName = self.cluster.icon or "poi_parking_rect"
local iconId = iconRendererObj:addIcon(string.format("%s-psIcon",self.numId), playModeIconName, self.pos)
self.iconInfo = iconRendererObj:getIconById(iconId)
--simpleDebugText3d(string.format("%0.1f %0.1f %0.1f %0.1f",lineColorF.r, lineColorF.g, lineColorF.b, lineColorF.alpha), self.pos + vec3(0,0,iconHeight), 0.25)
@/lua/vehicle/input.lua
long = long or string.match(wheelName, "^([FR]+)")
--print(string.format("/ Splitting '%10s' into long: '%5s', side: '%5s' .", wheelName, long, side))
long = long and long:sub(1, 1) or long
side = side and side:sub(1, 1) or side
--print(string.format("\\_ Splitting '%10s' into long: '%5s', side: '%5s' .", wheelName, long, side))
return long, side
if debug then
print(string.format("----- '%s' = %s, %s", wd1.name, long1, side1))
end
if debug then
print(string.format(" * '%s' = %s, %s", wd2.name, long2, side2))
end
if debug then
print(string.format(" - '%s' = %s, %s", wd2.name, long2, side2))
end
end
print(string.format("front wheel '%s' has these rear wheels: %s", namef, dumps(namesr)))
end
if filter ~= M.lastFilterType then
obj:queueGameEngineLua(string.format('extensions.telemetry_core.startActivity("controlsUsed", {method = "%s"})', FILTER_NAME[filter]))
M.lastFilterType = filter
@/inspector/Views/SpreadsheetCSSStyleDeclarationSection.js
let specificity = selector.specificity.map((number) => number.toLocaleString());
let tooltip = WI.UIString("Specificity: (%d, %d, %d)").format(...specificity);
if (selector.dynamic) {
@/lua/ge/extensions/gameplay/rally/notebook/test/testNotebook.lua
message = message or "assertion failed"
log('E', logTag, string.format("%s: expected '%s' but got '%s'", message, tostring(expected), tostring(actual)))
error("test failed: "..message)
@/lua/ge/extensions/gameplay/drag/general.lua
customGrav = math.abs(core_environment.getGravity() - 9.81) > 0.01,
gravity = string.format("%0.2f m/s²", math.abs(core_environment.getGravity())),
}
for _, timeLabel in ipairs(timerKeys) do
timers[timeLabel] = string.format("%0.3f", racer.timers[timeLabel].value)
end
for _, velLabel in ipairs(velocityKeys) do
velocities[velLabel..'_km/h'] = string.format("%0.3f", racer.timers[velLabel].value * 3.6)
velocities[velLabel..'_mph'] = string.format("%0.3f", racer.timers[velLabel].value * 2.23694)
velocities[velLabel..'_km/h'] = string.format("%0.3f", racer.timers[velLabel].value * 3.6)
velocities[velLabel..'_mph'] = string.format("%0.3f", racer.timers[velLabel].value * 2.23694)
end
local poi = {
id = string.format("drag##%s-%s", data._fnWithoutExt or "unknown", lane.shortName or "lane" .. i),
markerInfo = {
@/lua/ge/extensions/editor/trafficManager.lua
im.TextColored(imColors.inactive, string.format("%0.2f %s", convertSpeed(aiData.speed, speedUnits[1]), speedUnits[1]))
im.SameLine()
im.SameLine()
im.TextColored(imColors.inactive, string.format("%0.2f %s", convertSpeed(aiData.speed, speedUnits[2]), speedUnits[2]))
end
local speed = mapVehData.vel and mapVehData.vel:length() or 0
im.TextUnformatted(string.format("%0.2f", convertSpeed(speed, speedUnits[options.speedUnits[0]])))
im.SameLine()
im.NextColumn()
im.TextUnformatted(string.format("%0.2f", convertDistance(sessionData.stats.distance, distanceUnits[options.distanceUnits[0]])))
im.SameLine()
im.NextColumn()
im.TextUnformatted(string.format("%0.2f G", sessionData.stats.gForce))
im.NextColumn()
im.NextColumn()
im.TextUnformatted(string.format("%0.1f", sessionData.stats.timer))
im.NextColumn()
im.NextColumn()
im.TextUnformatted(string.format("%0.2f %s", convertSpeed(sessionData.stats.avgSpeed, speedUnits[options.speedUnits[0]]), speedUnits[options.speedUnits[0]]))
im.NextColumn()
im.NextColumn()
im.TextUnformatted(string.format("%0.2f %s", convertSpeed(sessionData.stats.maxSpeed, speedUnits[options.speedUnits[0]]), speedUnits[options.speedUnits[0]]))
im.NextColumn()
local seqDesc = seq.description or "(Custom)"
currInstance.description = string.format("Sequence %s %s / Phase %s %s", seqStr, seqDesc, ctrlStr, ctrlDesc)
end
local seqDesc = seq.description or "(Custom)"
local description = string.format("Sequence %s %s / Phase %s %s", seqStr, seqDesc, ctrlStr, ctrlDesc)
im.TextColored(imColors.inactive, string.format("Phase Duration: %0.2f s", currController.totalDuration))
im.TextColored(imColors.inactive, string.format("Sequence Duration: %0.2f s", currSequence.totalDuration))
im.TextColored(imColors.inactive, string.format("Phase Duration: %0.2f s", currController.totalDuration))
im.TextColored(imColors.inactive, string.format("Sequence Duration: %0.2f s", currSequence.totalDuration))
@/inspector/Views/DebuggerDashboardView.js
var tooltip = WI.UIString("Continue script execution (%s or %s)").format(WI.pauseOrResumeKeyboardShortcut.displayName, WI.pauseOrResumeAlternateKeyboardShortcut.displayName);
this._debuggerResumeButtonItem = new WI.ActivateButtonNavigationItem("debugger-dashboard-pause", tooltip, tooltip, "Images/Resume.svg", 15, 15);
@/lua/ge/extensions/editor/assemblySpline/molecule.lua
else
log('W', logtag, string.format("Anchor point [%s] not found in mesh: [%s]", anchorName, meshPath))
end
else
log('W', logtag, string.format("Invalid point type [%s] in anchor: [%s]", pointType, anchorName))
end
else
log('W', logtag, string.format("Invalid anchor point format: [%s]", anchorName))
end
else
log('W', logtag, string.format("Nail and aux vectors are collinear in join [%s] in mesh: [%s]", joinName, meshPath))
end
else
log('W', logtag, string.format("Invalid vectors in three-point join [%s] in mesh: [%s]", joinName, meshPath))
end
else
log('W', logtag, string.format("Three-point join [%s] missing 'head' anchor in mesh: [%s]", joinName, meshPath))
end
else
log('W', logtag, string.format("Nail vector too short in join [%s] in mesh: [%s]", joinName, meshPath))
end
else
log('W', logtag, string.format("Join [%s] missing required 'point' anchor in mesh: [%s]", joinName, meshPath))
end
if sourceMatchCtr ~= targetMatchCtr then -- Validation of source and target matches.
log('W', logtag, string.format("Bridge [%s] has different number of source and target matches: [%d] vs [%d]",
bridge.mesh.fileName, sourceMatchCtr, targetMatchCtr))
@/lua/common/libs/xlsxlib/tests/tests.lua
local content = string.format('// Test args: %s\r\n', serialize(queryArgs))
content = content .. jsonEncodePretty({data}, 1)
@/lua/ge/extensions/editor/sitesEditor.lua
for _, spot in ipairs(list) do
spot.name = string.format("%s%0"..l.."d", name, c)
c = c+1
@/lua/ge/extensions/util/richPresence.lua
local function onRaceLap(data)
local timeStr = string.format("%.2d:%.2d.%.3d", (data.time)/60, (data.time)%60, (data.time%1)*1000)
if Steam then
local function onRaceResult(data)
local timeStr = string.format("%.2d:%.2d.%.3d", (data.finalTime)/60, (data.finalTime)%60, data.finalTime%1*1000)
if Steam then
@/inspector/Views/HeapSnapshotInstanceFetchMoreDataGridNode.js
buttonElement.classList.add("more");
buttonElement.textContent = WI.UIString("Show %d More").format(this._batchCount);
buttonElement.addEventListener("click", (event) => { this._fetchCallback(this._batchCount); });
buttonElement.classList.add("more");
buttonElement.textContent = WI.UIString("Show Remaining (%d)").format(this._remainingCount);
buttonElement.addEventListener("click", (event) => { this._fetchCallback(this._remainingCount); });
@/lua/ge/extensions/ui/console.lua
if l then
txt = txt..string.format("%s|%s|%s|%s\n",l[1],l[2],l[3],l[4])
end
if l then
txt = txt..string.format("%s|%s|%s|%s\n",l[1],l[2],l[3],l[4])
end
im.tooltip("Clear console")
-- im.TextUnformatted(string.format("upd=%.3fms add=%.3fms", rollAvgCalc(rollAvgUpdate), rollAvgCalc(rollAvgAdd)) )
elseif type(timer) == "number" then
t = string.format("%.3f", timer)
else
-- if not l then
-- -- print( string.format("head = %d\ttail=%d\ti=%d",logsHead,logsTail , i ))
-- goto continue_skipline
if not l then
-- print( string.format("head = %d\ttail=%d\ti=%d",logsHead,logsTail , i ))
-- if viewColumn.time[0] then
if v ~= 2 and im.GetContentRegionAvailWidth() < txtwidth then
im.TextColored(lcol,string.format("%s", tostring(v):sub(1,256) ))
txtwidth = txtwidth * (1/fontConsoleFact[0])
dump = dump .. hex .. asc .. "\n"
hex = string.format( "%04x: ", i - 1 )
asc = ""
local ord = string.byte( str, i )
hex = hex .. string.format( "%02x ", ord )
if ord >= 32 and ord <= 126 then
@/lua/ge/extensions/editor/missionEditor/setupModules.lua
local secs = math.floor(seconds - hours * 3600 - mins * 60)
return string.format("%02d:%02d:%02d", hours, mins, secs)
end
@/lua/vehicle/controller/powertrainControl/combustionEngineGovenor.lua
if not controlledEngine then
log("E", "powertrainControl.throttleGovenor", string.format("Engine '%s' not found, govenor not active.", controlledEngineName))
return
@/lua/vehicle/extensions/tech/powertrainSensor.lua
obj:queueGameEngineLua(string.format("tech_sensors.updatePowertrainLastReadings(%q)", lpack.encode(readingsData)))
local adHocData = { requestId = adHocRequestId, reading = data.readings }
obj:queueGameEngineLua(string.format("tech_sensors.updatePowertrainAdHocRequest(%q)", lpack.encode(adHocData)))
end
@/lua/ge/extensions/flowgraph/nodes/ui/raceRecoveriesUsed.lua
if self.pinIn.max.value then
guihooks.trigger('RaceRecoveryCounterSet', string.format("Recoveries Used: %d / %d",self.pinIn.cur.value, self.pinIn.max.value))
else
else
guihooks.trigger('RaceRecoveryCounterSet', string.format("Recoveries Used: %d",self.pinIn.cur.value))
end
@/inspector/Models/TimelineRecording.js
let {startTime, endTime, discontinuities, instrumentTypes, records, markers, memoryPressureEvents, sampleStackTraces, sampleDurations} = json;
let importedDisplayName = WI.UIString("Imported - %s").format(displayName);
let instruments = instrumentTypes.map((type) => WI.Instrument.createForTimelineType(type));
@/lua/common/libs/slaxml/slaxml.lua
pi = function(target,content)
print(string.format("%s %s?>",target,content))
end,
comment = function(content)
print(string.format("",content))
end,
if nsPrefix then io.write(nsPrefix,":") end
io.write(name,'=',string.format('%q',value))
if nsURI then io.write(" (ns='",nsURI,"')") end
text = function(text,cdata)
print(string.format(" %s: %q",cdata and 'cdata' or 'text',text))
end,
for i=#nsStack,1,-1 do if nsStack[i][prefix] then return nsStack[i][prefix] end end
error(("Cannot find namespace for prefix %s"):format(prefix))
end
if current==doc then
if doc.root then error(("Encountered element '%s' when the document already has a root '%s' element"):format(name,doc.root.name)) end
doc.root = el
attribute = function(name,value,nsURI)
if not current or current.type~="element" then error(("Encountered an attribute %s=%s but I wasn't inside an element"):format(name,value)) end
local attr = {type='attribute',name=name,nsURI=nsURI,value=value,parent=rich and current or nil}
closeElement = function(name)
if current.name~=name or current.type~="element" then error(("Received a close element notification for '%s' but was inside a '%s' %s"):format(name,current.name,current.type)) end
pop(stack)
if current.type~='document' then
if current.type~="element" then error(("Received a text notification '%s' but was inside a %s"):format(value,current.type)) end
push(current.kids,{type='text',name='#text',value=value,parent=rich and current or nil})
@/inspector/Views/CanvasSidebarPanel.js
{
let folder = new WI.FolderTreeElement(WI.UIString("Frame %d").format((index + 1).toLocaleString()), frame);
@/lua/ge/extensions/editor/flowgraph/search.lua
im.SameLine()
im.Text(string.format(" | %d%%%% Match" ,100*result.score))
if result.frecency and result.frecency > 0 then
im.SameLine()
im.Text(string.format(" | %d%%%% Frecency", result.frecency *100))
end
@/lua/ge/extensions/gameplay/rally/notebook/structured/visualCompositor.lua
for i,vp in ipairs(visualPacenotes) do
vp.id = string.format("%s_%d", string.gsub(pacenote.name, ' ', '_'), i)
vp.pnId = pacenote.id
@/lua/ge/extensions/flowgraph/modules/aiRecordingModule.lua
local dir = mission.missionFolder.."/tests/"
local fn = string.format("recording_%s.missionTestData.json", os.date("%Y-%m-%d %H_%M_%S"))
print("Saving script AI recording to "..dir..fn)
@/lua/vehicle/electricsCustomValueParser.lua
customElectricsEnv.logValue = function(value, label)
print(string.format("Custom Electric: %s = %s", label or "", tostring(value)))
return value
else
log("D", "electricsCustomValueParser.compileCustomValueUpdates", string.format("No default value for custom electrics value: %s", customValue.electricsName))
end
if #customValueUpdateStrings[i + 1] > 0 then
table.insert(customValueUpdates, string.format("electrics.%s = %s", customValueUpdateStrings[i], customValueUpdateStrings[i + 1]))
end
@/lua/ge/extensions/editor/crawlEditor.lua
dump(string.format('[CRAWL_EDITOR] Found files - Trails: %d, Paths: %d, Boundaries: %d, Starting Positions: %d',
#trailFiles, #pathFiles, #boundaryFiles, #startingPositionFiles))
dump(string.format('[CRAWL_EDITOR] Loaded %d trails, %d mission trails, %d paths, %d mission paths, %d boundaries, %d mission boundaries, %d starting positions', #allTrails, #missionTrails, #allPaths, #missionPaths, #allBoundaries, #missionBoundaries, #allStartingPositions))
end
return string.format("%03d", maxNumber + 1)
end
else
log('E', 'crawl_editor', string.format('Unknown object type: %s', type))
return false
log('D', 'crawl_editor', string.format('Successfully created and saved new %s to: %s', type, filePath))
else
else
log('E', 'crawl_editor', string.format('Failed to create and save new %s to: %s', type, filePath))
end
movedCount = movedCount + 1
log('D', 'crawl_editor', string.format('Moved trail (%s) to mission', trail._fileName or 'unnamed'))
end
trail._dirty = false
log('D', 'crawl_editor', string.format('Marked trail (%s) as clean after Save All', trail._fileName or 'unnamed'))
end
movedCount = movedCount + 1
log('D', 'crawl_editor', string.format('Moved trail (%s) to level', trail._fileName or 'unnamed'))
end
trail._dirty = false
log('D', 'crawl_editor', string.format('Marked mission trail (%s) as clean after Save All', trail._fileName or 'unnamed'))
end
path._dirty = false
log('D', 'crawl_editor', string.format('Marked path (%s) as clean after Save All', path._fileName or 'unnamed'))
end
path._dirty = false
log('D', 'crawl_editor', string.format('Marked mission path (%s) as clean after Save All', path._fileName or 'unnamed'))
end
boundary._dirty = false
log('D', 'crawl_editor', string.format('Marked boundary (%s) as clean after Save All', boundary._fileName or 'unnamed'))
end
boundary._dirty = false
log('D', 'crawl_editor', string.format('Marked mission boundary (%s) as clean after Save All', boundary._fileName or 'unnamed'))
end
startingPosition._dirty = false
log('D', 'crawl_editor', string.format('Marked starting position (%s) as clean after Save All', startingPosition._fileName or 'unnamed'))
end
@/lua/common/jit/p.lua
if not prof_raw then
out:write(format("%s%2d%% %s\n", indent, pct, k))
elseif prof_raw == "r" then
elseif prof_raw == "r" then
out:write(format("%s%5d %s\n", indent, v, k))
else
else
out:write(format("%s %d\n", k, v))
end
if f0 == 40 or f0 == 91 then
out:write(format("\n====== %s ======\n[Cannot annotate non-file]\n", file))
break
if not fp then
out:write(format("====== ERROR: %s: %s\n", file, err))
break
end
out:write(format("\n====== %s ======\n", file))
local fl = files[file]
show = n+ann
out:write(format("@@ %d @@\n", n))
end
if v then
out:write(format(fmtv, v, line))
else
else
out:write(format(fmtn, line))
end
@/lua/ge/extensions/editor/terrainEditor.lua
if value then
local softSelectFilterString = string.format( "%.6f %.6f %.6f %.6f %.6f %.6f %.6f", value[1], value[2], value[3], value[4], value[5], value[6], value[7])
terrainEditor:setField('softSelectFilter', 0, softSelectFilterString)
else
prev = matProxy.material:getField(string.format("%sDetailTex", 'baseColor'), 0)
end
if im.IsItemHovered() and not var.sc_dragId then
im.tooltip(string.format("%.2f", var.softSelectFilter[i]))
if im.IsMouseClicked(0) then
@/lua/ge/extensions/gameplay/rally/tools/loopToolbox.lua
local translatedName = translateLanguage(mission.name, mission.name, true)
local displayName = string.format("%s (%s)", translatedName, mission.id)
table.insert(self.missionDropdownItems, displayName)
if hours > 0 then
return string.format("%d:%02d:%04.1f", hours, minutes, secondsWithDecimal)
else
else
return string.format("%d:%04.1f", minutes, secondsWithDecimal)
end
if hours > 0 then
return string.format("%d:%02d:%02d", hours, minutes, secs)
else
else
return string.format("%d:%02d", minutes, secs)
end
local statusColor = proximityData.isNear and colorGreen or colorRed
im.TextColored(statusColor, string.format("Near: %s | Dist: %.2fm | Frozen: %s", tostring(proximityData.isNear), proximityData.distance or 0, tostring(proximityData.isFrozen or false)))
local progress = (proximityData.timer or 0) / math.max(1e-12, proximityData.duration or 1)
local progress = (proximityData.timer or 0) / math.max(1e-12, proximityData.duration or 1)
im.ProgressBar(progress, im.ImVec2(200, 0), string.format("%.1f/%.1fs", proximityData.timer or 0, proximityData.duration or 0))
end
-- -- local splitTimeStr = self:formatDuration(split.time, true)
-- -- im.Text(string.format(" %s: %s", split.name, splitTimeStr))
-- -- end
local totalKm = manager:getTotalDistanceKm()
im.Text(string.format(" SS Distance: %.2f km", totalSSKm))
im.Text(string.format(" Liaison Distance: %.2f km", totalRoadSectionKm))
im.Text(string.format(" SS Distance: %.2f km", totalSSKm))
im.Text(string.format(" Liaison Distance: %.2f km", totalRoadSectionKm))
im.Text(string.format(" Total Distance: %.2f km", totalKm))
im.Text(string.format(" Liaison Distance: %.2f km", totalRoadSectionKm))
im.Text(string.format(" Total Distance: %.2f km", totalKm))
im.SetWindowFontScale(1.3)
im.TextColored(colorRed, string.format(" Total Penalty: +%ds", totalPenalty))
im.SetWindowFontScale(1.0)
if entry.distanceKm then
displayName = displayName .. string.format(" | %.2f km", entry.distanceKm)
end
if event.rescheduleCount and event.rescheduleCount > 0 then
eventText = eventText .. string.format(" (rescheduled %dx)", event.rescheduleCount)
end
if timingResult.totalPenalty > 0 then
statusText = statusText .. string.format(", would be +%ds penalty", timingResult.totalPenalty)
end
if timingResult.totalPenalty > 0 then
timecardText = timecardText .. string.format(" +%ds penalty", timingResult.totalPenalty)
end
im.SameLine()
im.TextColored(colorRed, string.format(" +%ds false start", falseStartPenalty))
end
@/lua/ge/extensions/ui/gameplaySelector/tileClustering.lua
return {
key = string.format("%s_%s", group.key, level),
name = name,
return {
key = string.format("%s_%s", group.key, typeName),
name = name,
return {
key = string.format("%s_%s_%s", group.key, system, name),
name = name,
@/lua/ge/extensions/editor/roadSpline/groupMgr.lua
-- Ensure we have a unique group name.
local baseName = group.name or string.format(toolPrefixStr .. " %d", #groups + 1)
local uniqueName = util.generateUniqueName(baseName, toolPrefixStr)
local folderNameId = Engine.generateUUID()
newFolder:registerObject(string.format("%s - %s", uniqueName, folderNameId))
scenetree.MissionGroup:addObject(newFolder)
-- Ensure we have a unique group name.
local baseName = name or string.format(toolPrefixStr .. " %d", #groups + 1)
local uniqueName = util.generateUniqueName(baseName, toolPrefixStr)
local newFolder = createObject("SimGroup")
newFolder:registerObject(string.format("%s - %s", uniqueName, id))
scenetree.MissionGroup:addObject(newFolder)
end
log('I', logTag, string.format("Converted %d traced paths to Road Splines. %d paths were too small to import.", #paths, #paths - #groups))
end
local newFolder = createObject("SimGroup")
newFolder:registerObject(string.format("%s - %s", group.name, group.id))
newFolder.cansave = true
@/inspector/Views/StyleOriginView.js
this.element.title = WI.UIString("%s cannot be modified").format(styleTitle);
}
@/lua/ge/extensions/editor/gen/network.lua
road:setField("material", 0, mat)
road:setField('distanceFade', 0, string.format("%f %f", 0, 200))
groupEdit:add(road)
road:setField("material", 0, mat)
road:setField('distanceFade', 0, string.format("%f %f", 0, 200))
groupEdit:add(road)
@/lua/ge/extensions/editor/assetBrowser.lua
end
return string.format((index > 1) and "%0.1f %s" or "%0.0f %s", filesize, var.fileSizeAbbreviations[index])
end
newObj.useInstanceRenderData = true
newObj:setField('instanceColor', 0, string.format("%g %g %g %g", 1, 1, 1, 1))
newObj:setField('collisionType', 0, "Collision Mesh")
var.dragDropMesh.useInstanceRenderData = true
var.dragDropMesh:setField('instanceColor', 0, string.format("%g %g %g %g", 1, 1, 1, 1))
var.dragDropMesh:setField('collisionType', 0, "Collision Mesh")
var.dragDropRotation = var.dragDropRotation + (var.io.MouseWheel * var.options.dragDropRotationMultiplier)
var.dragDropMesh:setField('rotation', '0', string.format( "%f %f %f %f", 0, 0, 1, var.dragDropRotation))
end
im.TextUnformatted("Loading assets (" .. tostring(var.assetsProcessed) .. "/" .. tostring(var.numberOfAllAssetsAndDirs) ..")")
im.TextUnformatted(string.format("%0.2f",(var.assetsProcessed/var.numberOfAllAssetsAndDirs)*100) .. '%')
end
-- Displayed text and their width
local numberOfDirsText = string.format('Folders: %d', var.filteredDirsCount)
local numberOfDirsTextWidth = im.CalcTextSize(string.format('Folders: %d', var.filteredDirsCount)).x
local numberOfDirsText = string.format('Folders: %d', var.filteredDirsCount)
local numberOfDirsTextWidth = im.CalcTextSize(string.format('Folders: %d', var.filteredDirsCount)).x
local numberOfDirsTextTruncated = string.format('F: %d', var.filteredDirsCount)
local numberOfDirsTextWidth = im.CalcTextSize(string.format('Folders: %d', var.filteredDirsCount)).x
local numberOfDirsTextTruncated = string.format('F: %d', var.filteredDirsCount)
local numberOfDirsTextTruncatedWidth = im.CalcTextSize(string.format('F: %d', var.filteredDirsCount)).x
local numberOfDirsTextTruncated = string.format('F: %d', var.filteredDirsCount)
local numberOfDirsTextTruncatedWidth = im.CalcTextSize(string.format('F: %d', var.filteredDirsCount)).x
local numberOfAssetsText = string.format('Assets: %d', var.filteredAssetsCount)
local numberOfAssetsTextWidth = im.CalcTextSize(string.format('Assets: %d', var.filteredAssetsCount)).x
local numberOfAssetsText = string.format('Assets: %d', var.filteredAssetsCount)
local numberOfAssetsTextWidth = im.CalcTextSize(string.format('Assets: %d', var.filteredAssetsCount)).x
local numberOfAssetsTextTruncated = string.format('A: %d', var.filteredAssetsCount)
local numberOfAssetsTextWidth = im.CalcTextSize(string.format('Assets: %d', var.filteredAssetsCount)).x
local numberOfAssetsTextTruncated = string.format('A: %d', var.filteredAssetsCount)
local numberOfAssetsTextTruncatedWidth = im.CalcTextSize(string.format('A: %d', var.filteredAssetsCount)).x
local numberOfAssetsTextTruncated = string.format('A: %d', var.filteredAssetsCount)
local numberOfAssetsTextTruncatedWidth = im.CalcTextSize(string.format('A: %d', var.filteredAssetsCount)).x
local numberOfTextureSetsText = string.format('Sets: %d', var.filteredTextureSetsCount)
local numberOfTextureSetsTextWidth = im.CalcTextSize(string.format('Sets: %d', var.filteredTextureSetsCount)).x
local numberOfTextureSetsText = string.format('Sets: %d', var.filteredTextureSetsCount)
local numberOfTextureSetsTextWidth = im.CalcTextSize(string.format('Sets: %d', var.filteredTextureSetsCount)).x
local numberOfTextureSetsTextTruncated = string.format('S: %d', var.filteredTextureSetsCount)
local numberOfTextureSetsTextWidth = im.CalcTextSize(string.format('Sets: %d', var.filteredTextureSetsCount)).x
local numberOfTextureSetsTextTruncated = string.format('S: %d', var.filteredTextureSetsCount)
local numberOfTextureSetsTextTruncatedWidth = im.CalcTextSize(string.format('S: %d', var.filteredTextureSetsCount)).x
local numberOfTextureSetsTextTruncated = string.format('S: %d', var.filteredTextureSetsCount)
local numberOfTextureSetsTextTruncatedWidth = im.CalcTextSize(string.format('S: %d', var.filteredTextureSetsCount)).x
im.NextColumn()
im.TextUnformatted(string.format("%0.0fkb", inspector_selectedAsset.filesize/1024))
im.NextColumn()
@/lua/ge/server/commands.lua
local rot = core_camera.getQuat()
return string.format('[%0.2f, %0.2f, %0.2f, %g, %g, %g, %g]', pos.x, pos.y, pos.z, rot.x, rot.y, rot.z, rot.w)
end
if not deprecationWarningDone[oldFunction] then
log('W', logTag, string.format('function "%s" is deprecated. Please use function "%s" instead', oldFunction, newFunction))
deprecationWarningDone[oldFunction] = true
@/inspector/Views/TimelineTreeElement.js
{
let tooltip = WI.UIString("Close %s timeline view").format(this.mainTitle);
let button = new WI.TreeElementStatusButton(WI.ImageUtilities.useSVGSymbol("Images/CloseLarge.svg", "close-button", tooltip));
@/lua/ge/extensions/gameplay/rally/loop/stagedCountdownTest.lua
self.environmentStartTimeSecs = adjustedHours * 3600 -- Convert to seconds
log('D', logTag, string.format('Test mode: environment start time: %.0f seconds', self.environmentStartTimeSecs))
else
log('D', logTag, string.format('Test mode: scheduled event at epoch %.2f (wall clock %.2f, in %.2f seconds)',
self.scheduledEventTime, targetWallClockSecs, self.scheduledEventTime - self.epoch))
log('D', logTag, string.format('Test mode: Rescheduled from %.2f to %.2f (attempt %d/%d)',
oldTime, self.scheduledEventTime, rescheduleCount + 1, maxReschedules))
@/lua/ge/extensions/editor/masterSpline/layerMgr.lua
spline.layers[#spline.layers + 1] = {
name = string.format("New Layer %d", #spline.layers + 1),
id = Engine.generateUUID(),
@/lua/ge/extensions/gameplay/rally/driveline/drivelineV3.lua
local reductionPercent = 100.0 * (1.0 - simplifiedCount / originalPointCount)
log('I', logTag, string.format('Simplified %d driveline points to %d spline nodes (%.1f%% reduction)',
originalPointCount, simplifiedCount, reductionPercent))
@/inspector/Views/ScopeChainDetailsSidebarPanel.js
if (scope.__baseClosureScope && scope.name)
title = WI.UIString("Closure Variables (%s)").format(scope.name);
else
@/lua/ge/extensions/ui/apps.lua
jsonWriteFile(userFilePath, userLayout, true)
log("I","",string.format("User layout was updated. File: %s", userFilePath))
end
@/lua/ge/extensions/editor/api/gui.lua
end
imgui.Button(string.format("Metal: %0.1f | Rough: %0.1f | Coat: %0.1f | CoatRough: %0.1f", col.pbr[1][0], col.pbr[2][0], col.pbr[3][0], col.pbr[4][0]))
if imgui.IsItemClicked() then
else
val = string.format(format, v[v_index])
end
end
imgui.tooltip(string.format("Decrease by %.2f\nDecrease by %.2f while holding ctrl", step, step_fast))
imgui.SameLine()
end
imgui.tooltip(string.format("Increase by %.2f\nIncrease by %.2f while holding ctrl", step, step_fast))
end
if not id then lbl = label end
id = string.format("##%s_%s", label or "", id or "")
if not id then lbl = label end
id = string.format("##%s_%s", label or "", id or "")
if not id then lbl = label end
id = string.format("##%s_%s", label or "", id or "")
if not id then lbl = label end
id = string.format("##%s_%s", label or "", id or "")
else
return string.format('%i', tempIntPtr[0])
end
else
return string.format('%d %d', tempIntArr2[0], tempIntArr2[1])
end
else
return string.format('%f', tempFloatPtr[0])
end
else
return string.format('%f %f', tempFloatArr2[0], tempFloatArr2[1])
end
else
return string.format('%f %f %f %f', tempFloatArr4[0], tempFloatArr4[1], tempFloatArr4[2], tempFloatArr4[3])
end
@/lua/vehicle/protocols.lua
for _,protocol in ipairs(protocols) do
log("D", "", string.format("Shutdown of protocol %q for vehicle "..objectId.." ("..vehiclePath..") at %s:%d with an update rate of %d Hz (%s)", protocol.name, protocol.ip, protocol.port, protocol.updateRate, tostring(protocol)))
if protocol.udpSocket then
table.insert(protocols, protocol)
log("D", "", string.format("Protocol %q active for vehicle "..objectId.." ("..vehiclePath..") at %s:%d with an update rate of %d Hz (%s)", protocol.name, protocol.ip, protocol.port, protocol.updateRate, tostring(protocol)))
end
@/lua/ge/extensions/career/modules/inspectVehicle.lua
core_vehicleBridge.executeAction(newVeh, 'setFreeze', true)
newVeh:queueLuaCommand(string.format("partCondition.initConditions(nil, %d, nil, %f)", vehicleInfo.Mileage, career_modules_vehicleShopping.getVisualValueFromMileage(vehicleInfo.Mileage)))
return newVeh
if career_career.isActive() and testDriveInfo then
local id = string.format("inspectVehicle-%s-%s-parkingEnd",testDriveInfo.dealershipName, testDriveInfo.route)
local poi = {
@/lua/ge/extensions/tech/sumoExporter.lua
for _, node in ipairs(nodes) do
file:write(string.format('\t\n',
tostring(node.id), node.x, node.y, node.z))
local id1 = "e" .. tostring(ctr)
file:write(string.format('\t\n',
id1, edge.from, edge.to, PRIORITY, NUM_LANES, SPEED))
local id2 = "e" .. tostring(ctr)
file:write(string.format('\t\n',
id2, edge.to, edge.from, PRIORITY, NUM_LANES, SPEED))
@/lua/vehicle/extensions/tech/CANBus/ButtonBox.lua
end
obj:queueGameEngineLua(string.format("core_input_virtualInput.emit(%d, %q, %d, %q, %.3f)", virtualInputDeviceInstance, objType, objInstance, action, value))
end
local id = objectId
local cmdString = string.format(cmdStringTemplate, virtualInputVidPid, id)
log("I", "ButtonBox.requestExistingVirtualInput", "Requesting existing virtual input device for vidpid: " .. virtualInputVidPid)
local id = objectId
local cmdString = string.format(cmdStringTemplate, virtualInputDeviceName, virtualInputVidPid, virtualInputNumberOfAxes, virtualInputNumberOfButtons, virtualInputNumberOfPOVs, id)
log("I", "ButtonBox.registerNewVirtualInput", "Registering new virtual input device for vidpid: " .. virtualInputVidPid)
]]
local cmdString = string.format(cmdStringTemplate, deviceInstance)
obj:queueGameEngineLua(cmdString)
local function virtualInputCallback(deviceInstance, deviceInfo)
log("I", "ButtonBox.virtualInputCallback", string.format("Received virtual input callback with deviceInstance %d and device info %s", deviceInstance or -1, dumps(deviceInfo)))
@/lua/ge/extensions/flowgraph/nodes/environment/randomTimeOfDay.lua
if use24Hour then
return string.format("%02d:%02d", hour, minute)
else
local ampm = hour < 12 and "AM" or "PM"
return string.format("%d:%02d %s", hour12, minute, ampm)
end
@/lua/ge/extensions/gameplay/drift/drift.lua
if isBeingDebugged then
debugDrawer:drawTextAdvanced(center, string.format("Smoothed accel : %0.2f", accelerationSmoothed or 0), ColorF(1,1,1,1), true, false, ColorI(0,0,0,255), false, false)
debugDrawer:drawLine(center, velocityTip, ColorF(1,0.3,0,1))
debugDrawer:drawTextAdvanced(center, string.format("Yaw : %d ° (min req:%d)", currDegAngle, driftOptions.minAngle), ColorF(1,1,1,1), true, false, ColorI(0,0,0,255), false, false)
end
im.Text("Is in the air : " .. ((isInTheAir and "Yes") or "No"))
im.Text(string.format("Air speed : %d(%d) kph", kphAirSpeed or 0, avrgRefPointsKphSpeed or 0))
im.Text(string.format("Min required angle : %0.2f", driftOptions.minAngle or 0))
im.Text(string.format("Air speed : %d(%d) kph", kphAirSpeed or 0, avrgRefPointsKphSpeed or 0))
im.Text(string.format("Min required angle : %0.2f", driftOptions.minAngle or 0))
im.Text(string.format("Drift complete time : %0.2f", currDriftCompleteTime or 0))
im.Text(string.format("Min required angle : %0.2f", driftOptions.minAngle or 0))
im.Text(string.format("Drift complete time : %0.2f", currDriftCompleteTime or 0))
im.Text(string.format("Time to confirmation : %0.2f", currDriftCompletedTimer))
im.Text(string.format("Drift complete time : %0.2f", currDriftCompleteTime or 0))
im.Text(string.format("Time to confirmation : %0.2f", currDriftCompletedTimer))
im.Text(string.format("Acceleration : %0.2f", accelerationSmoothed or 0))
im.Text(string.format("Time to confirmation : %0.2f", currDriftCompletedTimer))
im.Text(string.format("Acceleration : %0.2f", accelerationSmoothed or 0))
local avgDriftAngle = driftActiveData.totalAngles / driftActiveData.totalSteps
im.Text(string.format("Angle : %d °", currDegAngle))
im.Text(string.format("Total drift distance : %d", driftChainActiveData.totalDriftDistance))
im.Text(string.format("Angle : %d °", currDegAngle))
im.Text(string.format("Total drift distance : %d", driftChainActiveData.totalDriftDistance))
im.Text(string.format("Average drift angle : %d", avgDriftAngle))
im.Text(string.format("Total drift distance : %d", driftChainActiveData.totalDriftDistance))
im.Text(string.format("Average drift angle : %d", avgDriftAngle))
im.Text(string.format("Wall distance front : %f", driftActiveData.closestWallDistanceFront))
im.Text(string.format("Average drift angle : %d", avgDriftAngle))
im.Text(string.format("Wall distance front : %f", driftActiveData.closestWallDistanceFront))
im.Text(string.format("Wall distance rear : %f", driftActiveData.closestWallDistanceRear))
im.Text(string.format("Wall distance front : %f", driftActiveData.closestWallDistanceFront))
im.Text(string.format("Wall distance rear : %f", driftActiveData.closestWallDistanceRear))
end
if debugToggleSmothnessGraph[0] then
im.Text(string.format("Drift smoothness : %0.2f", driftSmoothnessData and driftSmoothnessData.smoothness or 0))
im.SameLine()
@/lua/ge/extensions/gameplay/sites/zone.lua
debugDrawer:drawTextAdvanced(((v.pos + self.vertices[v.next])/2),
String(string.format("t=%0.1f | u=%s",v.t,tostring(v.u))),
ColorF(1,1,1,1),true, false,
--print("from: " .. dumps(cur) .. " to " .. dumps(nex))
--print(string.format("Distance: %0.2f, steps: %d", dist, steps))
for i = 0, steps-1 do
@/lua/common/testFramework/TestManager.lua
local func = tests[name]
local displayName = string.format("%-60s", name:gsub('_shouldFail$', ''))
@/lua/ge/extensions/editor/scriptAIEditor.lua
-- Rounding functions.
local function round1(n) return tonumber(string.format("%.1f", n)) end
local function round2(n) return tonumber(string.format("%.2f", n)) end
local function round1(n) return tonumber(string.format("%.1f", n)) end
local function round2(n) return tonumber(string.format("%.2f", n)) end
local nodes = {}
-- Check if data is already in pointer format (has .x[0] structure) or value format (has .x structure).
if d[1] and d[1].x and type(d[1].x) == "table" and d[1].x[0] ~= nil then -- Data is already in pointer format.
local nodes = {}
-- Check if data is already in pointer format (has .x[0] structure) or value format (has .x structure).
if d[1] and d[1].x and type(d[1].x) == "table" and d[1].x[0] ~= nil then -- Data is already in pointer format.
@/lua/ge/extensions/tech/pythonExport.lua
if ffi.offsetof(value, 'w') ~= nil then -- quat
return string.format('(%.4g, %.4g, %.4g, %.4g)', value.x, value.y, value.z, value.w)
end
end
return string.format('(%.4g, %.4g, %.4g)', value.x, value.y, value.z)
end
if math.floor(value) ~= value then
return string.format("%.4g", value)
end
local function getScenarioConfig(buffer, vehicle, vehData)
local line = string.format("scenario = Scenario('%s', 'we_export')\n", getCurrentLevelIdentifier())
buffer:put(line)
local vehModel = vehicle:getJBeamFilename()
line = string.format("%s = Vehicle('%s', '%s')\n", vehName, vehName, vehModel)
buffer:put(line)
local vehPos = vehicle:getPosition()
line = string.format("scenario.add_vehicle(%s, pos=%s", vehName, formatValueAsPython(vehPos))
buffer:put(line)
obj:queueGameEngineLua(
string.format('extensions.tech_pythonExport.getFullConfigVehicleCallback(%d, %q)', obj:getID(), lpack.encode(data))
)
@/lua/ge/extensions/career/modules/painting.lua
if not career_modules_payment.canPay(price) then return end
career_modules_payment.pay(price, {label = string.format("Repainted the vehicle"), tags = {"vehiclePainting", "buying"}})
Engine.Audio.playOnce('AudioGui', 'event:>UI>Career>Buy_01')
if partName then
vehicleObject:queueLuaCommand(string.format("partCondition.setPartPaints(%s, %s, 0)", partName, serialize(chosenPaints)))
else
else
vehicleObject:queueLuaCommand(string.format("partCondition.setAllPartPaints(%s, 0)", serialize(chosenPaints)))
end
@/lua/ge/extensions/gameplay/race/race.lua
}
print(string.format("T: %0.6f", finishedSegmentT))
-- get correct startTime for this segment
local millis = (time - minutes*60 - seconds)*1000
return string.format("%02d:%02d.%03d",minutes, seconds, millis)
end
return sign .. string.format("%02d:%02d.%03d", minutes, seconds, millis)
end
@/lua/ge/extensions/tech/techCore.lua
if filename:find('/scenarios/') and filename:find('.json') then
log('D', logTag, string.format('Scenario file \'%s\' changed, refreshing scenario cache.', v.filename))
refreshScenarioList()
if request.protocolVersion ~= tcom.protocolVersion then
log('E', logTag, string.format([[Mismatching BeamNGpy protocol versions. Please ensure both BeamNG.tech and BeamNGpy are using the desired versions. BeamNGpy's is: %s, BeamNG.tech's is: %s]],
tostring(request.protocolVersion), tostring(tcom.protocolVersion)))
]]
veh:queueLuaCommand(string.format(command, lpack.encode(tech_techCapture.export())))
end
local skipServer = server == nil
command = string.format('tech_techCore.startConnection(\'%s\', %s)', tcomParams.ip, tostring(skipServer))
veh:queueLuaCommand(command)
if scenario == nil then
request:sendBNGValueError(string.format('Scenario \'%s\' not found.', sourceFile))
return false
sensors[sensorType][sensorName] = sensorId
log('D', logTag, string.format('Created sensor %d of type \'%s\' with name \'%s\'', sensorId, sensorType, sensorName))
end
sensorsOfType[name] = nil
log('D', logTag, string.format('Removed sensor %d of type \'%s\' with name \'%s\'', sensorId, sensorType, name))
return
@/lua/vehicle/controller/tech/vehicleSystemsCoupling.lua
unanswered = math.ceil(pingTime / simulinkTime)
log('I', logTag, 'Ping time = ' .. pingTime .. ' , Simulink fixed step size = ' .. string.format("%.6g", (sendSkips + 1) * physicsDt))
@/lua/ge/extensions/editor/assemblySpline/populate.lua
local id = Engine.generateUUID()
obj:registerObject(string.format('Mesh_%s', id))
folder:addObject(obj.obj)
@/lua/ge/extensions/editor/dynamicDecals/textures.lua
if im.ImTextureHandlerIsCached(filePath) then
if im.ImageButton(string.format("##textures_imageButton_%s", filePath), editor.getTempTextureObj(filePath).texId, im.ImVec2(thumbnailSize, thumbnailSize), im.ImVec2Zero, im.ImVec2One, (sel and tableContains(sel, filePath)) and selectedTextureCol.Value or nil) then
handleTextureImageTileClicked(filePath, textureFilePaths)
im.PushID1("Texture_" .. tostring(k))
if im.ImageButton(string.format("##textures_imageButton_%s", filePath), editor.getTempTextureObj(filePath).texId, im.ImVec2(thumbnailSize, thumbnailSize), im.ImVec2Zero, im.ImVec2One, (sel and tableContains(sel, filePath)) and selectedTextureCol.Value or nil) then
handleTextureImageTileClicked(filePath, textureFilePaths)
if im.ImTextureHandlerIsCached(filePath) then
if im.ImageButton(string.format("##textures_imageButton_%s", filePath), editor.getTempTextureObj(filePath).texId, im.ImVec2(thumbnailSize, thumbnailSize), im.ImVec2Zero, im.ImVec2One, (sel and tableContains(sel, filePath)) and selectedTextureCol.Value or nil) then
handleTextureImageTileClicked(filePath, textureFilePaths)
im.PushID1("Texture_" .. tostring(k))
if im.ImageButton(string.format("##textures_imageButton_%s", filePath), editor.getTempTextureObj(filePath).texId, im.ImVec2(thumbnailSize, thumbnailSize), im.ImVec2Zero, im.ImVec2One, (sel and tableContains(sel, filePath)) and selectedTextureCol.Value or nil) then
handleTextureImageTileClicked(filePath, textureFilePaths)
end
im.tooltip(string.format("%s\nDouble-click to set texture as color texture\nLMB to select texture\nCtrl+LMB Add texture to selection\nRMB to open context menu", fileName))
im.SameLine()
-- for _, tag in ipairs(tags) do
-- im.TextUnformatted(string.format("%s [%d]", tag, #tagsWithReferences[tag]))
-- end
for _, tag in ipairs(tags) do
if im.TreeNodeEx1(string.format("%s [%d]##BrowserTagsTab", tag, #tagsWithReferences[tag])) then
drawTextureTiles(tagsWithReferences[tag], nil, true)
im.NextColumn()
im.TextUnformatted(string.format("x: %d y: %d", img.size.x, img.size.y))
im.NextColumn()
@/inspector/Views/RecordingStateDetailsSidebarPanel.js
else {
section.title = WI.UIString("Save %d").format(index + 1);
sourceElement.classList.add("source");
sourceElement.textContent = WI.UIString("(Action %s)").format(sourceIndex);
}
@/lua/ge/extensions/editor/tech/roadArchitect/decals.lua
dRoad:setField("material", 0, road.overlayMat or lightTreadMaterial)
dRoad:setField('startEndFade', 0, string.format("%f %f", 5.0, 5.0))
dRoad:registerObject("")
layerDecal:setField("textureLength", 0, layer.texLen[0])
layerDecal:setField('startEndFade', 0, string.format("%f %f", layer.fadeS[0], layer.fadeE[0]))
layerDecal:setField("material", 0, layer.mat)
layerDecal:setField("textureLength", 0, layer.texLen[0])
layerDecal:setField('startEndFade', 0, string.format("%f %f", layer.fadeS[0], layer.fadeE[0]))
layerDecal:setField("material", 0, layer.mat)
@/lua/ge/extensions/editor/drivePathEditor/splineMgr.lua
-- Ensure we have a unique drive path spline name.
local baseName = string.format(toolPrefixStr .. " %d", #drivePathSplines + 1)
local uniqueName = util.generateUniqueName(baseName, toolPrefixStr)
end
log('I', logTag, string.format("Converted %d traced paths to drive path splines. %d paths were too small to import.", #paths, #paths - #drivePathSplines))
end
@/lua/ge/extensions/gameplay/rally/geometry.lua
local levelName = core_levels.getLevelName(getMissionFilename())
return string.format("temp/rally_route_%s.json", level, map)
end
else
pacenote.name = string.format("%i", floor(0.5+pacenote.length/10)*10)
end
end
--pacenote.name = string.format("[%.1fs] %s", pacenote.time, pacenote.name)
end
local distanceThresholdStraight = 0.5
log("I", "", string.format("Simplifying %d pacenotes:", #pacenotes))
for i=1, 10 do
n = n + simplifyStraightsConsecutive(pacenotes)
log("I", "", string.format(" - Phase %d: %d pacenotes (%d nodes reassigned)", i, #pacenotes, n))
if n == 0 then break end -- nothing left to do
simplifyPacenotes(pacenotes)
log("I", "", string.format("Generated a rally route from '%s' with %d pacenotes", prevPacenoteSource, #pacenotes))
return pacenotes
--rlcolor = color
local txt = string.format("%.0fkmh, %.0fm, %.0fdeg, %.1fm/ss", vel, node.length, node.angle, node.accel or 0)
--local txt = string.format("%.0fkmh, %0.1fs", vel, node.time)
local txt = string.format("%.0fkmh, %.0fm, %.0fdeg, %.1fm/ss", vel, node.length, node.angle, node.accel or 0)
--local txt = string.format("%.0fkmh, %0.1fs", vel, node.time)
tagPos:set(node.pos)
local opens = slowestNode.severityId ~= straightId and (firstNode.vel / lastNode.vel < 1/tightensThreshold)
return string.format("%s%s%s%s%s%s" -- %.0fdeg"
,pacenote.name
prevPacenoteSource = 'groundMarkers'
log("I", "", string.format("Generating rally pacenotes from '%s'", prevPacenoteSource))
local waypoints = getWaypointsFromGroundMarkers()
prevPacenoteSource = 'fileCache'
log("I", "", string.format("Generating rally pacenotes from '%s'", prevPacenoteSource))
local route = lpack.decode(readFile(getRouteJsonPath()))
@/lua/common/libs/resty/template/microbenchmark.lua
print(format("Running %d iterations in each test", iterations))
local z = clock() - x
print(format(" Parsing Time: %.6f", z))
total = total + z
z = clock() - x
print(format("Compilation Time: %.6f (template)", z))
total = total + z
z = clock() - x
print(format("Compilation Time: %.6f (template, cached)", z))
total = total + z
z = clock() - x
print(format(" Execution Time: %.6f (same template)", z))
total = total + z
z = clock() - x
print(format(" Execution Time: %.6f (same template, cached)", z))
total = total + z
z = clock() - x
print(format(" Execution Time: %.6f (different template)", z))
total = total + z
z = clock() - x
print(format(" Execution Time: %.6f (different template, cached)", z))
total = total + z
z = clock() - x
print(format(" Execution Time: %.6f (different template, different context)", z))
total = total + z
z = clock() - x
print(format(" Execution Time: %.6f (different template, different context, cached)", z))
total = total + z
total = total + z
print(format(" Total Time: %.6f", total))
end
@/lua/ge/extensions/career/branches.lua
heading="New Challenges",
description=string.format("%d new challenges available.", #missions)
})
@/lua/ge/extensions/gameplay/drift/freeroam/driftSpots.lua
local highestScore = getHighestScoreData()
local label = highestScore.score > 0 and string.format("Highest score by \"".. highestScore.licensePlate .. "\": %i", highestScore.score) or "No highscore yet, rip it!"
guihooks.trigger("SetTasklistTask", {
if spot.saveData.scores[1] then
poi.markerInfo.bigmapMarker.description = poi.markerInfo.bigmapMarker.description .. "\n" .. string.format("Current Highscore: %d by %s.", spot.saveData.scores[1].score, spot.saveData.scores[1].licensePlate)
end
@/lua/ge/extensions/ui/gameplaySelector/tileGenerators/levelTiles.lua
local function getKeyFromDetails(details)
return string.format("spawnPoint_%s_%s", details.levelName, details.spawnPointObjectName)
end
levelTitle = translate(levelTitle)
name = string.format("%s (%s)", name, levelTitle)
end
if defaultSpawnPointCount > 1 then
log("E", "levelTiles", string.format("Default spawnpoint count is greater than 1 for level %s", level.levelName))
end
label = translate("ui.levelselect.size"),
value = string.format("%0.2f%s x %0.2f%s (%0.2f%s)", convertedSize1, unit, convertedSize2, unit, convertedArea, areaUnit),
icon = "scale"
if level.title then
name = string.format("%s (%s)", name, translate(level.title))
end
@/gameplay/missionTypes/timeTrial/constructor.lua
if self.missionTypeData.allowRollingStart then rolling = false end
self.defaultProgressKey = string.format("%d-%s-%s",self.missionTypeData.defaultLaps, reverse, rolling)
self.defaultAggregateValues = {
end
log("D","", string.format("%s - %s dynamically adjusted for %d laps", self.id, key, laps))
return baseList
end
log("D","", string.format("%s - %s dynamically adjusted for having used %s %d x %d times before", self.id, key, originKey, originId, vehicleUsedForStarTimes))
return baseList
function C:getProgressKeyForUserSetting(userSettings)
return string.format("%d-%s-%s",userSettings.laps or self.missionTypeData.defaultLaps, (userSettings.reverse or false) and self.missionTypeData.reversible, (userSettings.rolling or false) and self.missionTypeData.allowRollingStart)
end
self:processCommonSettings(settings)
self.currentProgressKey = string.format("%d-%s-%s",settings.laps or self.missionTypeData.defaultLaps, (settings.reverse or false) and self.missionTypeData.reversible, (settings.rolling or false) and self.missionTypeData.allowRollingStart)
end
@/lua/common/guihooks.lua
sendStreamsToGELua = function(streams)
local command = string.format('extensions.hook("onGeLuaStreamsFromVehicleTest", %q)', lpack.encode(streams))
obj:queueGameEngineLua(command)
for i,v in ipairs(values) do
v[1] = v[1] or string.format("#%i", i) -- key
v[2] = v[2] or 0 -- value
for _,v in ipairs(values) do
table.insert(keys, string.format(v[4]=="" and "%s%s" or "%s (%s)", v[1], v[4]))
end
csvfile = require('csvlib').newCSV(unpack(keys))
csvfilename = filename or string.format("graphcsv.%s.csv", os.date("%Y-%d-%mT%H_%M_%S"))
end
@/lua/vehicle/extensions/telemetryLogger.lua
local pos = obj:getPosition()
local position = string.format("(%s,%s,%s)", pos.x, pos.y, pos.z)
timeStamp = timeStamp + dt
@/lua/vehicle/controller/vehicleController/shiftLogic/dctGearbox.lua
M.shiftingAggression = shiftAggression
--print(string.format("GR: %.2f, AG: %.2f, IN: %.2f -> %.2f", gearRatioCoef, aggressionCoef, inertiaCoef, shiftAggression))
end
end
--print(string.format("Clutch1: %.2f, Clutch 2: %.2f",electrics.values.clutchRatio1,electrics.values.clutchRatio2))
@/ui/ui-vue/src/services/watchdog.js
const format = obj => Object.entries(obj).sort((a, b) => b[1] - a[1]).map(([key, value]) => `${key}: ${value}`.replace("\\", "\\\\")).join("\n")
console.log("Types:\n" + format(stats.types))
console.log("Files:\n" + format(stats.files))
console.log("Types:\n" + format(stats.types))
console.log("Files:\n" + format(stats.files))
},
@/inspector/Views/TimelineRecordTreeElement.js
if (timelineRecord.details.repeating)
alternateSubtitle.textContent = WI.UIString("%s interval").format(timeoutString);
else
else
alternateSubtitle.textContent = WI.UIString("%s delay").format(timeoutString);
}
@/lua/vehicle/controller/couplings/fifthwheel.lua
local cmdString = "for _,kingpin in ipairs(controller.getControllersByType('couplings/kingpin')) do kingpin.setKingpinVisibility(%q,%s) end"
BeamEngine:queueAllObjectLua(string.format(cmdString, fifthwheelKey, visible))
end
--print("request kingpin data for id: " .. obj2Id)
local kingpinCmd = string.format([[
local kingpins = controller.getControllersByType("couplings/kingpin")
@/lua/ge/extensions/editor/dynamicDecals/inspector.lua
local function inspectLayerGui(layer, guiId)
if im.Button(string.format("Dump##%s_%s", layer.uid, guiId)) then dump(layer) end
if editor.getPreference("dynamicDecalsTool.general.debug") then
im.SameLine()
if im.Button(string.format("Dumpz 3##%s_%s", layer.uid, guiId)) then dumpz(layer, 3) end
end
local widgetId = string.format("%s_%s", layer.uid, guiId)
im.TextUnformatted("uid")
im.PushItemWidth(im.GetContentRegionAvailWidth())
im.InputText(string.format("##uid_%s", widgetId), editor.getTempCharPtr(layer.uid), nil, im.InputTextFlags_ReadOnly)
im.tooltip("Read-only type")
im.PushItemWidth(im.GetContentRegionAvailWidth())
im.InputText(string.format("##type_%s", widgetId), editor.getTempCharPtr(string.format("%s Layer", helper.splitAndCapitalizeCamelCase(api.layerTypesMap[layer.type]))), nil, im.InputTextFlags_ReadOnly)
im.tooltip("Read-only type")
im.PushItemWidth(im.GetContentRegionAvailWidth())
im.InputText(string.format("##type_%s", widgetId), editor.getTempCharPtr(string.format("%s Layer", helper.splitAndCapitalizeCamelCase(api.layerTypesMap[layer.type]))), nil, im.InputTextFlags_ReadOnly)
im.tooltip("Read-only type")
if multiSelect then
if im.TreeNode1(string.format("%s - %s", layerData.uid, layerData.name)) then
inspectLayerGui(layerData, "inspector")
for layerType, layerTypeId in pairs(api.layerTypes) do
layerGui[layerTypeId] = function() im.TextUnformatted(string.format("No layerGui available for '%s'", layerType)) end
end
@/lua/common/libs/lunajson/lunajson/encoder.lua
if tiny < n and n < huge then
local s = format("%.17g", n)
if radixordelim then
__index = function(_, c)
return format('\\u00%02X', byte(c))
end
@/lua/common/libs/luasec/options.lua
local function printf(str, ...)
print(string.format(str, ...))
end
local name = string.lower(string.sub(option, 8))
print(string.format([[#if defined(%s)]], option))
print(string.format([[ {"%s", %s},]], name, option))
print(string.format([[#if defined(%s)]], option))
print(string.format([[ {"%s", %s},]], name, option))
print([[#endif]])
@/lua/ge/extensions/trackbuilder/trackBuilder.lua
im.TextUnformatted(tex.path)
im.TextUnformatted(string.format("%d x %d", tex.size.x, tex.size.y))
im.PopTextWrapPos()
local function setColor(mat, color)
local value = string.format('%f %f %f %f', color[0], color[1], color[2], color[3])
if mat == 'center_base' then
im.TextColored(style.textColor,string.format(translateLanguage("ui.trackBuilder.base.banking", "Banking") .. ": %.1f°", modifierValues.bank.value[0]))
im.TextColored(style.textColor,string.format(translateLanguage("ui.trackBuilder.base.height", "Height") .. ": %.1fm", modifierValues.height.value[0]))
im.Spacing()
im.TextColored(style.textColor,string.format(translateLanguage("ui.trackbuilder.base.banking", "Banking") .. ": %.1f°", modifierValues.bank.value[0]))
mainModifiers('bank','tb_bank_left','tb_bank_right',15,1,60,-720,720)
im.TextColored(style.textColor,string.format(translateLanguage("ui.trackBuilder.base.height", "Height") .. ": %.1fm", modifierValues.height.value[0]))
mainModifiers('height','tb_height_lower','tb_height_higher',1,5,25,-50000,50000)
@/lua/ge/extensions/editor/crawlEditor/missionPortTool.lua
node.flags.isRecoveryCheckpoint = true
log('D', logTag, string.format("Marked pathnode %d (%s) as recovery checkpoint", i, node.name))
end
if not startPosData and #raceData.startPositions > 0 then
log('W', logTag, string.format("Could not find startPosition with oldId %d, using first entry", defaultStartOldId or -1))
startPosData = raceData.startPositions[1]
rotation = quatFromDir(direction, vec3(0, 0, 1))
log('D', logTag, string.format("Calculated start rotation pointing to first checkpoint (distance: %.2f)", direction:length()))
else
log('I', logTag, string.format("Successfully ported mission %s (starting position: %s)", missionName, startingPositionId and "yes" or "no"))
return true
@/lua/vehicle/controller/beamNavigator.lua
htmlTexture.create(screenMaterialName, htmlFilePath, textureWidth, textureHeight, textureFPS, "automatic")
obj:queueGameEngineLua(string.format("extensions.ui_uinavi.requestVehicleDashboardMap(%q, nil, %d)", screenMaterialName, obj:getID()))
if jbeamData.bootscreenImage then
@/lua/ge/extensions/gameplay/traffic.lua
fileData = core_multiSpawn.fitGroup(fileData, policeAmount)
log('I', logTag, string.format('Loaded police group from file: %s', fileName or ''))
end
fileData = core_multiSpawn.fitGroup(fileData, amount)
log('I', logTag, string.format('Loaded traffic group from file: %s', fileName or ''))
end
if veh.debugText then
debugDrawer:drawTextAdvanced(veh.pos, string.format('[%d]: %d m, %d km/h', veh.id, math.floor(veh.focusDist), math.floor((veh.speed or 0) * 3.6)), txtColor, true, false, bgColor)
end
local amount, activeAmount = getTrafficAmount(), getTrafficAmount(true)
log('I', logTag, string.format('Traffic system started with %d active / %d total vehicles', activeAmount, amount))
if not next(mapNodes) then
@/gameplay/missionTypes/rallyLoop/editor.lua
local translatedName = translateLanguage(mission.name, mission.name, true)
local displayName = string.format("%s (%s)", translatedName, mission.id)
table.insert(missionIds, displayName)
@/lua/ge/extensions/scenario/raceMarkers/sideMarker.lua
--debugDrawer:drawText(self.pos, String(string.format("%0.3f %s",t, self.blendState or "non")), ColorF(0, 0, 0, 1))
local a = 1
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veGeneralData.lua
local formatStringZ = (sign(z) ~= -1 and " " or "") .. "%.4f"
return string.format(formatStringX .. ", " .. formatStringY .. ", " .. formatStringZ, x, y, z)
end
im.Separator()
imguiUtils.cell("Speed (m/s)", string.format("%.4f", vel:length()))
im.Separator()
im.Separator()
imguiUtils.cell('Airspeed (m/s)', string.format("%.4f", vEditor.generalData.airflowSpeed))
im.Separator()
im.Separator()
imguiUtils.cell('Groundspeed (m/s)', string.format("%.4f", vEditor.generalData.groundSpeed))
im.Separator()
im.Separator()
imguiUtils.cell('Air Temp (C)', string.format("%.4f", vEditor.generalData.envTemperature - 273.15))
im.Separator()
im.Separator()
imguiUtils.cell('Air Pressure (kPa)', string.format("%.4f", vEditor.generalData.envPressure * 0.001))
im.Separator()
im.Separator()
imguiUtils.cell('Air Density (kg/m^3)', string.format("%.4f", vEditor.generalData.airDensity))
im.Separator()
im.Separator()
imguiUtils.cell("Vehicle Damage ($)" ,string.format("%.2f", vEditor.generalData.damage))
im.Columns(1)
@/lua/ge/extensions/editor/missionPlaybook/attributeViewer.lua
if data.attributes[key].level then
local txt = string.format("%d (%d / %d)", data.attributes[key].level, data.attributes[key].curLvlProgress or 0, data.attributes[key].neededForNext or 0)
@/lua/ge/extensions/core/input/bindings.lua
if not isMenuActionMap then
log("E", "", string.format("Failed to run setMenuActionEnabled(%q, %q, %q): the action map name '%q' isn't related to menus", enabled, actionName, actionMapName, actionMapName, prefix))
return
if not isMenuIndependentValid then
log("E", "", string.format("Failed to run setMenuActionEnabled(%q, %q, %q): the %q action map name '%q' isn't recognized", enabled, actionName, actionMapName, prefix, actionMapName))
return
if not am then
log("E", "", string.format("Failed to run setMenuActionEnabled(%q, %q, %q): the action map '%q' does not exist", enabled, actionName, actionMapName, actionMapName))
return
@/lua/ge/extensions/editor/flowgraph/events.lua
local function formatTime(time)
return string.format("%d:%02d:%03d",time/60, time%60, (time%1)*1000)
end
@/lua/ge/client/postFx.lua
for key, obj in pairs(preset) do
local flag = string.format("$PostFXManager::Settings::%s", key)
if type(obj) ~= "table" then
for field, value in pairs(obj) do
local fullFlag = string.format("%s::%s", flag, field)
TorqueScriptLua.setVar(fullFlag, value)
@/lua/common/libs/ezSVG/EzSVG.lua
local pre = string.format("<%s ", tbl["__tag"])
local post = "/>"
if tbl["__content"] then
post = string.format(">%s%s>", tbl["__content"]:__generate(run), tbl["__tag"])
end
if v ~= "" and v ~= nil then
ret = string.format("%s%s=%q ", ret, k, tostring(v))
end
if v ~= "" and v ~= nil and tbl[k] == nil then
ret = string.format("%s%s=%q ", ret, k, tostring(v))
end
if tbl["__lastRunID"] ~= run["id"] and tbl["__id"] then
ret = string.format("%sid=%q", ret, tbl["__id"])
end
for i, vv in pairs(v) do
if i == 1 then func = string.format("%s%s(", func, vv)
elseif i == 2 then func = func .. vv
elseif i == 2 then func = func .. vv
else func = string.format("%s, %s", func, vv) end
end
end
ret = string.format("%s%s%s)", ret, seperator, func)
seperator = " "
function EzSVG.rgb(r, g, b)
return string.format("rgb(%d, %d, %d)", math.floor(r), math.floor(g), math.floor(b))
end
@/lua/ge/extensions/editor/dragRaceEditor/lanes.lua
local isSelected = i == selectedLaneIndex
local label = string.format("%s (%s)", lane.name or "Unnamed", lane.color or "unknown")
if im.IsItemHovered() then
im.tooltip(string.format("ID: %s\nShort Name: %s\nLong Name: %s\nOrder: %d",
lane.id or "N/A",
@/lua/ge/extensions/career/modules/milestones/generalMilestones/missions.lua
end,
getLabel = function(step, displayValue, target) return string.format("Star Collector") end,
getDescription = function(step, displayValue, target) return string.format("Collect %d stars from any challenge.", target) end,
getLabel = function(step, displayValue, target) return string.format("Star Collector") end,
getDescription = function(step, displayValue, target) return string.format("Collect %d stars from any challenge.", target) end,
getProgressLabel = function(step, current, target) return string.format("%d Stars / %d Stars", current, target) end,
getDescription = function(step, displayValue, target) return string.format("Collect %d stars from any challenge.", target) end,
getProgressLabel = function(step, current, target) return string.format("%d Stars / %d Stars", current, target) end,
getTarget = function(step) return step == 0 and 0 or math.ceil(stepPercent[step]*totalStarCount) end,
end,
getLabel = function(step, displayValue, target) return string.format("Challenge Passer") end,
getDescription = function(step, displayValue, target) return string.format("To pass a challenge, you need to get at least one default star.", target) end,
getLabel = function(step, displayValue, target) return string.format("Challenge Passer") end,
getDescription = function(step, displayValue, target) return string.format("To pass a challenge, you need to get at least one default star.", target) end,
getProgressLabel = function(step, current, target) return string.format("%d Challenges / %d Challenges", current, target) end,
getDescription = function(step, displayValue, target) return string.format("To pass a challenge, you need to get at least one default star.", target) end,
getProgressLabel = function(step, current, target) return string.format("%d Challenges / %d Challenges", current, target) end,
getTarget = function(step) return step == 0 and 0 or math.ceil(stepPercent[step]*missionCount) end,
end,
getLabel = function(step, displayValue, target) return string.format("Challenge Completionist", step) end,
getDescription = function(step, displayValue, target) return string.format("To complete a challenge, you need to get at all default and all bonus stars.", target) end,
getLabel = function(step, displayValue, target) return string.format("Challenge Completionist", step) end,
getDescription = function(step, displayValue, target) return string.format("To complete a challenge, you need to get at all default and all bonus stars.", target) end,
getProgressLabel = function(step, current, target) return string.format("%d Challenges / %d Challenges", current, target) end,
getDescription = function(step, displayValue, target) return string.format("To complete a challenge, you need to get at all default and all bonus stars.", target) end,
getProgressLabel = function(step, current, target) return string.format("%d Challenges / %d Challenges", current, target) end,
getTarget = function(step) return step == 0 and 0 or math.ceil(stepPercent[step]*missionCount) end,
end,
getLabel = function(step, displayValue, target) return string.format("%s Star Collector", branchName) end,
getDescription = function(step, displayValue, target) return string.format("Collect %d stars from challenges in the %s %s.", target, branchName, career_branches.getBranchById(branchKey).isSkill and "Skill" or "Branch" ) end,
getLabel = function(step, displayValue, target) return string.format("%s Star Collector", branchName) end,
getDescription = function(step, displayValue, target) return string.format("Collect %d stars from challenges in the %s %s.", target, branchName, career_branches.getBranchById(branchKey).isSkill and "Skill" or "Branch" ) end,
getProgressLabel = function(step, current, target) return string.format("%d Stars / %d Stars", current, target) end,
getDescription = function(step, displayValue, target) return string.format("Collect %d stars from challenges in the %s %s.", target, branchName, career_branches.getBranchById(branchKey).isSkill and "Skill" or "Branch" ) end,
getProgressLabel = function(step, current, target) return string.format("%d Stars / %d Stars", current, target) end,
getTarget = function(step) return step == 0 and 0 or math.ceil(stepPercent[step]*totalStarCount) end,
end,
getLabel = function(step, displayValue, target) return string.format("%s Challenge Passer", branchName) end,
getDescription = function(step, displayValue, target) return string.format("To pass a challenge, you need to get at least one default star.", target) end,
getLabel = function(step, displayValue, target) return string.format("%s Challenge Passer", branchName) end,
getDescription = function(step, displayValue, target) return string.format("To pass a challenge, you need to get at least one default star.", target) end,
getProgressLabel = function(step, current, target) return string.format("%d Challenges / %d Challenges", current, target) end,
getDescription = function(step, displayValue, target) return string.format("To pass a challenge, you need to get at least one default star.", target) end,
getProgressLabel = function(step, current, target) return string.format("%d Challenges / %d Challenges", current, target) end,
getTarget = function(step) return step == 0 and 0 or math.ceil(stepPercent[step]*missionCount) end,
end,
getLabel = function(step, displayValue, target) return string.format("%s Challenge Completionist", branchName) end,
getDescription = function(step, displayValue, target) return string.format("To complete a challenge, you need to get at all default and all bonus stars.", target) end,
getLabel = function(step, displayValue, target) return string.format("%s Challenge Completionist", branchName) end,
getDescription = function(step, displayValue, target) return string.format("To complete a challenge, you need to get at all default and all bonus stars.", target) end,
getProgressLabel = function(step, current, target) return string.format("%d Challenges / %d Challenges", current, target) end,
getDescription = function(step, displayValue, target) return string.format("To complete a challenge, you need to get at all default and all bonus stars.", target) end,
getProgressLabel = function(step, current, target) return string.format("%d Challenges / %d Challenges", current, target) end,
getTarget = function(step) return step == 0 and 0 or math.ceil(stepPercent[step]*missionCount) end,
getValue = function() return milestones.saveData.general['mission_unlockMissions'].unlockedCount end,
getLabel = function(step, displayValue, target) return string.format("Challenge Unlocker %d", step) end,
getDescription = function(step, displayValue, target) return string.format("Unlock new challenges by completing challenges and gaining branch levels.", target) end,
getLabel = function(step, displayValue, target) return string.format("Challenge Unlocker %d", step) end,
getDescription = function(step, displayValue, target) return string.format("Unlock new challenges by completing challenges and gaining branch levels.", target) end,
getProgressLabel = function(step, current, target) return string.format("%d Challenges / %d Challenges", current, target) end,
getDescription = function(step, displayValue, target) return string.format("Unlock new challenges by completing challenges and gaining branch levels.", target) end,
getProgressLabel = function(step, current, target) return string.format("%d Challenges / %d Challenges", current, target) end,
getTarget = function(step) return (step+1)*1 end,
@/lua/ge/extensions/career/modules/delivery/pages.lua
fac.progress.itemsDeliveredFromHere.count > 0
and string.format("%d Items, %0.2f$",fac.progress.itemsDeliveredFromHere.count, fac.progress.itemsDeliveredFromHere.moneySum)
or "-",
fac.progress.itemsDeliveredToHere.count > 0
and string.format("%d Items, %0.2f$",fac.progress.itemsDeliveredToHere.count, fac.progress.itemsDeliveredToHere.moneySum)
or "-"
local facText = string.format('Below is an overview of all facilities you have delivered an item to or from.- You have unlocked %d/%d facilities that send out cargo. To unlock a facility and be able to deliver items for them, first deliver an item there.
- You delivered a total of %d items and earned a total of %0.2f$ with deliveries. You can see a more detailled list of delivered items in the Delivery History.
',unlockedCount, providingFacilitiesCount, progress.itemsDeliveredTotal or 0, progress.rewardFromAllDeliveries.money or 0 )
for _, key in ipairs(career_branches.orderAttributeKeysByBranchOrder(tableKeys(change.attributeChange))) do
changeText = changeText .. string.format('%s: %s%0.2f
', key, change.attributeChange[key] > 0 and "+" or "", change.attributeChange[key])
end
if not progress.timedFlag then
deliveriesText = deliveriesText .. string.format("Urgent Delivieries are still locked. Deliver %d items in total to unlock them. (%d / %d).", dProgress.getModifierRequirements().itemsDeliveredTotalToUnlockTimed, progress.itemsDeliveredTotal, dProgress.getModifierRequirements().itemsDeliveredTotalToUnlockTimed)
else
else
deliveriesText = deliveriesText .. string.format("You have delivered a total of %d Urgent Cargo items. Of those, %d were delivered on time, %d were delayed and %d were late.",progress.timedDeliveries, progress.onTimeDeliveries, progress.delayedDeliveries, progress.lateDeliveries)
end
if not progress.fragileFlag then
deliveriesText = deliveriesText .. string.format("Precious Cargo Deliveries are still locked. Deliver %d items with the Urgent Cargo modifier on time to unlock them. (%d / %d)", dProgress.getModifierRequirements().onTimeDeliveriesToUnlockFragile, progress.onTimeDeliveries, dProgress.getModifierRequirements().onTimeDeliveriesToUnlockFragile)
else
else
deliveriesText = deliveriesText .. string.format("You have delivered a total of %d Precious Cargo items. Of those, %d were delivered intact, %d were damaged and %d were destroyed.",progress.fragileDeliveries, progress.noDamageDeliveries, progress.damagedDeliveries, progress.brokenDeliveries)
end
if not progress.timedFragileFlag then
deliveriesText = deliveriesText .. string.format("Urgent and Precious Cargo Deliveries are still locked. Deliver %d items with the Precious Cargo modifier intact to unlock them. (%d / %d)", dProgress.getModifierRequirements().noDamageDeliveriesToUnlockTimedFragile, progress.noDamageDeliveries, dProgress.getModifierRequirements().noDamageDeliveriesToUnlockTimedFragile)
else
@/lua/ge/extensions/editor/sidewalkSpline/splineMgr.lua
local folderNameId = Engine.generateUUID()
newFolder:registerObject(string.format("%s - %s", uniqueName, folderNameId))
scenetree.MissionGroup:addObject(newFolder)
-- Ensure we have a unique sidewalk spline name.
local baseName = string.format(toolPrefixStr .. " %d", #sidewalkSplines + 1)
local uniqueName = util.generateUniqueName(baseName, toolPrefixStr)
local newFolder = createObject("SimGroup")
newFolder:registerObject(string.format("%s - %s", uniqueName, id))
scenetree.MissionGroup:addObject(newFolder)
local newFolder = createObject("SimGroup")
newFolder:registerObject(string.format("%s - %s", uniqueName, spline.id))
scenetree.MissionGroup:addObject(newFolder)
@/lua/ge/extensions/core/checkpoints.lua
-- Queued for round trip to allow setpositionrotation to take effect
local callbackCommand = string.format('obj:queueGameEngineLua("if getObjectByID('..vehId..') then getObjectByID('..vehId..'):autoplace(false); core_checkpoints.completeReset(%u,%s) end")', vehId, "'"..vehicleName.."'")
vehicle:queueLuaCommand(callbackCommand)
vehicle:queueLuaCommand(callbackCommand)
local command = string.format("recovery.clear()")
vehicle:queueLuaCommand(command)
@/lua/ge/extensions/editor/flowgraph/nodelibrary.lua
im.SameLine()
im.Text(string.format(" | %d%%%% Match" ,100*result.score))
if result.frecency then
im.SameLine()
im.Text(string.format(" | %d%%%% Frecency", result.frecency *100))
end
@/lua/ge/extensions/core/remoteController.lua
--log('D', logTag, "Orientation: "..floor(orientation.x * 100)..", "..floor(orientation.y*100)..", "..floor(orientation.z*100))
--log('D', logTag, string.format("Orientation: %0.2f, %0.2f, %0.2f", orientation.x, orientation.y, orientation.z))
@/lua/ge/extensions/ui/gameplaySelector/general.lua
end
title = string.format("%s", filterValue)
else
else
title = string.format("%s", clusterKey, groupKey, groupName)
end
@/lua/common/libs/StackTracePlus/StackTracePlus.lua
local ok, err = pcall(tostring, value)
if ok then return err else return (": '%s'"):format(err) end
end
function Dumper:add_f (fmt, ...)
self:add(fmt:format(...))
end
@/lua/common/libs/copas/copas/http.lua
if not chunk then return sock:send("0\r\n\r\n") end
local size = string.format("%X\r\n", string.len(chunk))
return sock:send(size .. chunk .. "\r\n")
function metat.__index:sendrequestline(method, uri)
local reqline = string.format("%s %s HTTP/1.1\r\n", method or "GET", uri)
return self.try(self.c:send(reqline))
@/lua/ge/client/postFx/lightRay.lua
local resolutionScale = TorqueScriptLua.getVar("$LightRayPostFX::resolutionScale")
local targetScale = string.format("%s %s", resolutionScale, resolutionScale)
lightRayPostFX:setField("targetScale", 0, targetScale)
@/lua/ge/extensions/editor/dynamicDecals/settings.lua
local changed = false
if im.SliderFloat(string.format("##%s_x", widgetId), editor.getTempFloat_NumberNumber(cursorPosition.x), 0, 1, "%.3f") then
local newVal = editor.getTempFloat_NumberNumber()
im.PushItemWidth(width)
if im.SliderFloat(string.format("##%s_y", widgetId), editor.getTempFloat_NumberNumber(cursorPosition.y), 0, 1, "%.3f") then
local newVal = editor.getTempFloat_NumberNumber()
if im.TreeNodeEx1(string.format("Materials##VehicleLiveryEditor_Settings_%s", widgetId), im.TreeNodeFlags_DefaultOpen) then
editor.uiInputSearchTextFilter("Materials Filter", materialsFilter, im.GetContentRegionAvailWidth())
editor.uiInputSearchTextFilter("Materials Filter", materialsFilter, im.GetContentRegionAvailWidth())
im.BeginChild1(string.format("MaterialsChild_VehicleLiveryEditor_Settings_%s", widgetId), im.ImVec2(0, 280), true)
local enabled = tableContains(materialIndices, id)
if im.Checkbox(string.format("##%s_material_%d_checkbox", widgetId, id), editor.getTempBool_BoolBool(enabled)) then
local newValue = editor.getTempBool_BoolBool()
im.SameLine()
if im.Selectable1(string.format("%s##%s_material_%d_selectable", name, widgetId, id), enabled) then
if enabled == false then
if im.TreeNodeEx1(string.format("Meshes##VehicleLiveryEditor_Settings_%s", widgetId), im.TreeNodeFlags_DefaultOpen) then
local sMeshes = api.getShapeMeshes()
if im.Button(string.format("Enable all##Meshes_%s", widgetId)) then
api.enableAllMeshes()
im.SameLine()
if im.Button(string.format("Disable all##Meshes_%s", widgetId)) then
api.disableAllMeshes()
im.SameLine()
editor.uiInputSearchTextFilter(string.format("Meshes Filter##%s", widgetId), meshesFilter, im.GetContentRegionAvailWidth())
im.BeginChild1(string.format("MeshesChild_VehicleLiveryEditor_Settings_%s", widgetId), im.ImVec2(0, 280), true)
editor.uiInputSearchTextFilter(string.format("Meshes Filter##%s", widgetId), meshesFilter, im.GetContentRegionAvailWidth())
im.BeginChild1(string.format("MeshesChild_VehicleLiveryEditor_Settings_%s", widgetId), im.ImVec2(0, 280), true)
local i = 0
if im.ImGuiTextFilter_PassFilter(meshesFilter, name) then
if im.Checkbox(string.format("##%s_shapeMesh_%d_checkbox", widgetId, i), editor.getTempBool_BoolBool(enabled)) then
api.setMeshEnable(name, not enabled)
im.SameLine()
if im.Selectable1(string.format("%s##%s_shapeMesh_%d_selectable", name, widgetId, i), enabled) then
api.setMeshEnable(name, not enabled)
local textureResolution = api.getTextureResolution()
im.TextUnformatted(string.format("Current x: %d y: %d", textureResolution.x, textureResolution.y))
@/lua/ge/extensions/flowgraph/nodes/mission/UpdateDisplayDragRace.lua
-- Three decimal points for time
for num in string.gmatch(string.format("%.3f", finishTime), "%d") do
table.insert(timeDisplayValue, num)
-- Two decimal points for speed
for num in string.gmatch(string.format("%.2f", finishSpeed), "%d") do
table.insert(speedDisplayValue, num)
@/lua/ge/extensions/flowgraph/nodes/ui/convertUnit.lua
if self.pinIn.format.value then
self.pinOut.full.value = string.format(self.pinIn.format.value, value, unit)
else
else
self.pinOut.full.value = string.format("%0.2f%s", value, unit)
end
@/lua/ge/extensions/util/groundModelDebug.lua
im.PushItemWidth(120)
if im.SliderInt("Render area", colDensityTileCount, 3, 100, string.format("%d x %d (%d tiles)", colDensityTileCount[0], colDensityTileCount[0], colDensityTileCount[0]*colDensityTileCount[0])) then
serializeSettings()
-- -- then the text on top and the other columns
-- im.Text(string.format("%d (%0.2f%%%%)", body.tris, (body.tris / c.worlds[1].tris) * 100))
-- im.NextColumn()
@/lua/vehicle/controller/twoStepLaunch.lua
local function displayState()
guihooks.message(string.format("Two-Step: %s (%d RPM)", (twoStepState ~= "deactivated" and "Active" or "Inactive"), tempRevLimiterRPM), 2, "vehicle.twoStep.status")
end
@/lua/ge/extensions/editor/dynamicDecals/news.lua
helper.textUnformattedCentered("Welcome to the world of skin customization in BeamNG!")
helper.textUnformattedCentered(string.format("v %d.%d.%d", tool.version[1], tool.version[2], tool.version[3]))
for _, version in pairs(news) do
if im.CollapsingHeader1(string.format("%s", version.title), i == 1 and im.TreeNodeFlags_DefaultOpen or nil) then
version.guiFn()
@/lua/ge/extensions/editor/raceEditor.lua
if string.match(pn.name, "^Pathnode ") then
pn.name = string.format("Pathnode %d", i)
end
local pn2ShortName = string.match(pn2.name, "(%d+)$")
seg.name = string.format("Segment %s->%s", pn1ShortName or pn1.name, pn2ShortName or pn2.name)
else
else
seg.name = string.format("Segment %d", i)
end
local distKm = cachedRaceDistance / 1000
return string.format("Distance: %.2fkm", distKm)
end
@/lua/ge/extensions/gameplay/route/raceRoute.lua
-- log('D', logTag, string.format("RaceRoute:init with removeFirst=%s useMapPathfinding=%s closeDistSquared=%s", tostring(self.removeFirst), tostring(self.useMapPathfinding), tostring(self.closeDistSquared)))
-- if last.metadata and cur.metadata then
-- log('D', '', string.format("merging last.stableId=%s cur.stableId=%s", last.metadata and last.metadata.stableId or 'nil', cur.metadata and cur.metadata.stableId or 'nil'))
-- else
-- else
-- log('D', '', string.format("merging last.wp=%s cur.wp=%s", tostring(last.wp), tostring(cur.wp)))
-- end
-- if stableId then
-- msg = string.format('callbackResult=%s source="%s" stableId="%s"', tostring(callbackResult), source, stableId)
-- else
-- end
-- log('D', '', string.format('recalculateRouteWithOriginalPositions i=%d %s', i, msg))
end
-- debugDrawer:drawSquarePrism(p1, p2, Point2F(0.2, 0.2), Point2F(0.2, 0.2), ColorF(1,0,0,0.5))
-- debugDrawer:drawTextAdvanced(p1, string.format("i=%d", i), ColorF(0,0,0,1), true, false, ColorI(255,0,0,255), false, false)
-- debugDrawer:drawTextAdvanced(p2, string.format("j=%d", j), ColorF(0,0,0,1), true, false, ColorI(255,0,0,255), false, false)
-- debugDrawer:drawTextAdvanced(p1, string.format("i=%d", i), ColorF(0,0,0,1), true, false, ColorI(255,0,0,255), false, false)
-- debugDrawer:drawTextAdvanced(p2, string.format("j=%d", j), ColorF(0,0,0,1), true, false, ColorI(255,0,0,255), false, false)
-- local d = math.sqrt(distSq)
-- debugDrawer:drawTextAdvanced(currentPos, string.format("CURR i=%d d=%0.2f", i, d), ColorF(0,0,0,1), true, false, ColorI(0,255,0,255), false, false)
-- end
local idx, minDistance = self:getPositionOffset(pos)
-- debugDrawer:drawTextAdvanced(pos, string.format("idx=%d minD=%0.2f", idx, minDistance), ColorF(1,1,1,1), true, false, ColorI(0,0,255,255), false, false)
@/lua/ge/extensions/editor/missionEditor/progressSingle.lua
if self.formattedSaveData.unlockedStars and not self.formattedSaveData.unlockedStars.disabled then
im.Text(string.format("Default Stars unlocked: %d / 3",self.formattedSaveData.unlockedStars.defaultUnlockedStarCount))
im.Text(string.format("Total Stars unlocked: %d / %d",self.formattedSaveData.unlockedStars.totalUnlockedStarCount, self.formattedSaveData.unlockedStars.totalStars))
im.Text(string.format("Default Stars unlocked: %d / 3",self.formattedSaveData.unlockedStars.defaultUnlockedStarCount))
im.Text(string.format("Total Stars unlocked: %d / %d",self.formattedSaveData.unlockedStars.totalUnlockedStarCount, self.formattedSaveData.unlockedStars.totalStars))
for _, star in ipairs(self.formattedSaveData.unlockedStars.stars) do
@/lua/vehicle/extensions/tech/mesh.lua
local adHocData = { requestId = adHocRequestId, reading = latestReading }
obj:queueGameEngineLua(string.format("tech_sensors.updateMeshAdHocRequest(%q)", lpack.encode(adHocData)))
end
@/lua/vehicle/extensions/tech/CANBus/ProjectBavariaShifter.lua
end
--print(string.format("Lever: %s, Park: %s", leverStateLookup[leverState], parkButtonLookup[parkButtonState]))
lastLeverState = leverState
@/lua/ge/extensions/career/modules/delivery/generator.lua
if loc2.type == "facilityParkingspot" then
local distanceKey = string.format("%s-%s-%s-%s", loc1.facId, loc1.psPath, loc2.facId, loc2.psPath)
distanceCache[distanceKey] = distanceCache[distanceKey] or distanceBetween(getLocationCoordinates(loc1), getLocationCoordinates(loc2))
end
log("I","",string.format("Loaded %d item templates from %d files.", #tableKeys(parcelItemTemplates), #files))
end
if not destinationFac then
log("W","",string.format("Could not find target facility to deliver from %s with type %s", fac.id, logisticType))
return
templateId = -1,
name = string.format("%s from %s",materialData.name, fac.name),
type = materialData.type,
local facName = translateLanguage(fac.name, fac.name, true)
log("I","",string.format("Moved %d %s from %s (%d -> %d)", change, materialType, facName, storage.storedVolume, storage.storedVolume + change))
if storage.storedVolume > storage.capacity then
log("W","",string.format("Stored too much %s in %s (from %d, added %d, maximum %d) : %d too much", materialType, facName, storage.storedVolume-change, change, storage.capacity, storage.storedVolume+change-storage.capacity))
if storage.storedVolume < 0 then
log("W","",string.format("Took too much %s from %s (from %d, removed %d) : %d too much", materialType, facName, storage.storedVolume-change, -change, -change-storage.storedVolume))
storage.storedVolume = 0
for _, item in ipairs(generator.validTemplates) do
-- print(string.format(" - %02d%% %s",100 * item.chance / generator.sumChance, item.item.id))
for amount, amountChance in ipairs(item.item.duplicationChance) do
for amount, amountChance in ipairs(item.item.duplicationChance) do
print(string.format(" - %02d%% Group of %d %s (%s slots)",100 * item.chance / generator.sumChance * amountChance / item.item.duplicationChanceSum, amount, item.item.id, table.concat(item.item.slots, ", ")))
end
for i, generator in ipairs(fac.logisticGenerators) do
generator.name = string.format("%s %d %s %d", fac.name, i, generator.type, generator.interval)
generator.nextGenerationTimestamp = dGeneral.time() + (generator.interval) * math.random()
if missing then
log("E","",string.format("Fix Facility %s provided types: [\"%s\"]", fac.id, table.concat(tableKeysSorted(fac.logisticTypesProvidedLookup),'", "') )
)
)
log("E","",string.format("Fix Facility %s received types: [\"%s\"]", fac.id, table.concat(tableKeysSorted(fac.logisticTypesReceivedLookup),'", "') )
)
end
--print(string.format("Facility: %s provides systems: %s", fac.name, table.concat(tableKeys(fac.providedSystemsLookup),", " )))
--print(string.format("Facility: %s receives systems: %s", fac.name, table.concat(tableKeys(fac.receivedSystemsLookup),", " )))
--print(string.format("Facility: %s provides systems: %s", fac.name, table.concat(tableKeys(fac.providedSystemsLookup),", " )))
--print(string.format("Facility: %s receives systems: %s", fac.name, table.concat(tableKeys(fac.receivedSystemsLookup),", " )))
end
for _, key in ipairs(tableKeysSorted(allTypes)) do
--print(string.format("%s -> %s", key, dumps(logisticTypeToSystem(key))))
end
print(key)
print(string.format("Total IN: %0.2f/min", materialRatesProvided[key].total*60))
for _, facId in ipairs(tableKeysSorted(materialRatesProvided[key])) do
if facId ~= "total" then
print(string.format(" - IN : %0.2f/min (%s)", materialRatesProvided[key][facId]*60, facId))
print(string.format(" - real capacity: %d (%d min)",facilitiesById[facId].materialStorages[key].target, facilitiesById[facId].materialStorages[key].target / (materialRatesProvided[key][facId]*60)))
print(string.format(" - IN : %0.2f/min (%s)", materialRatesProvided[key][facId]*60, facId))
print(string.format(" - real capacity: %d (%d min)",facilitiesById[facId].materialStorages[key].target, facilitiesById[facId].materialStorages[key].target / (materialRatesProvided[key][facId]*60)))
end
end
print(string.format("Total OUT: %0.2f/min", materialRatesReceived[key].total*60))
for _, facId in ipairs(tableKeysSorted(materialRatesReceived[key])) do
if facId ~= "total" then
print(string.format(" - OUT: %0.2f/min (%s)", materialRatesReceived[key][facId]*60, facId))
print(string.format(" - real capacity: %d (%d min)",facilitiesById[facId].materialStorages[key].capacity - facilitiesById[facId].materialStorages[key].target, (facilitiesById[facId].materialStorages[key].capacity - facilitiesById[facId].materialStorages[key].target) / (materialRatesReceived[key][facId]*60)))
print(string.format(" - OUT: %0.2f/min (%s)", materialRatesReceived[key][facId]*60, facId))
print(string.format(" - real capacity: %d (%d min)",facilitiesById[facId].materialStorages[key].capacity - facilitiesById[facId].materialStorages[key].target, (facilitiesById[facId].materialStorages[key].capacity - facilitiesById[facId].materialStorages[key].target) / (materialRatesReceived[key][facId]*60)))
end
log("I","",string.format("Setup Logistics Facilities: %d Facilities (%d only provide, %d mixed, %d only receive), %d Parking spots", #tableKeys(facilitiesById), countProviders, countMixed, countReceivers, #tableKeys(parkingSpotsByPath)))
facilitiesSetup = true
@/lua/ge/extensions/career/modules/vehicleShopping.lua
newVeh:queueLuaCommand(string.format("partCondition.initConditions(nil, %d, nil, %f) obj:queueGameEngineLua('career_modules_vehicleShopping.onVehicleSpawnFinished(%d)')", vehicleInfo.Mileage, getVisualValueFromMileage(vehicleInfo.Mileage), newVeh:getID()))
return newVeh
local function payForVehicle()
local label = string.format("Bought a vehicle: %s", purchaseData.vehicleInfo.niceName)
if purchaseData.tradeInVehicleInfo then
if purchaseData.tradeInVehicleInfo then
label = label .. string.format(" and traded in vehicle id %d: %s", purchaseData.tradeInVehicleInfo.id, purchaseData.tradeInVehicleInfo.niceName)
end
local insuranceInfo = career_modules_insurance_insurance.getInsuranceDataById(purchaseData.insuranceId)
purchaseData.insuranceOptions.spendingReason = string.format("Insurance Policy: \"%s\"", insuranceInfo.name)
purchaseData.insuranceOptions.priceMoney = career_modules_insurance_insurance.calculateAddVehiclePrice(purchaseData.insuranceId, purchaseData.vehicleInfo.Value)
if buyVehicleOptions.licensePlateText then
career_modules_playerAttributes.addAttributes({money=-purchaseData.prices.customLicensePlate}, {tags={"buying"}, label=string.format("Bought custom license plate for new vehicle")})
end
vehicleWatchlist[shopId] = "sold"
guihooks.trigger("toastrMsg", {type="info", title="A vehicle you were interested in has been sold.", msg = vehicleInfo.Name .. " for $" .. string.format("%.2f", vehicleInfo.soldFor)})
break
@/lua/vehicle/controller/couplings/kingpin.lua
local data = {nodeId = kingpinNodeCid, nodePosition = position + nodePosition}
local fifthwheelCmd = string.format([[
controller.getControllerSafe(%q).kingpinDataCallback(%d, %s)
@/inspector/Controllers/Formatter.js
format(from, to)
{
@/lua/ge/extensions/editor/rallyEditor/measurementsTab.lua
local measurementLabelPos = pos + vec3(0, 0, 4) -- higher up for visibility
local distanceText = string.format("%s | %.2fm", measurement.name, measurement.totalDistance)
if diff > 3600*24 then
im.Text(string.format("saved %dd ago", math.floor(diff / (3600*24))))
elseif diff > 3600 then
elseif diff > 3600 then
im.Text(string.format("saved %dh ago", math.floor(diff / 3600)))
elseif diff > 60 then
elseif diff > 60 then
im.Text(string.format("saved %dm ago", math.floor(diff / 60)))
else
else
im.Text(string.format("saved %ds ago", diff))
end
local isSelected = measurement.id == self.selectedMeasurementId
local displayText = string.format("%s (%.2fm, %d points)",
measurement.name,
im.Text(string.format("Total Distance: %.2f meters", selectedMeasurement.totalDistance))
im.Text(string.format("Number of Points: %d", #selectedMeasurement.points))
im.Text(string.format("Total Distance: %.2f meters", selectedMeasurement.totalDistance))
im.Text(string.format("Number of Points: %d", #selectedMeasurement.points))
local isPointSelected = i == self.selectedPointIndex
local pointText = string.format("Point %d: (%.1f, %.1f, %.1f)",
i, point.x, point.y, point.z)
@/lua/common/libs/luasocket/socket/http.lua
if not chunk then return sock:send("0\r\n\r\n") end
local size = string.format("%X\r\n", string.len(chunk))
return sock:send(size .. chunk .. "\r\n")
function metat.__index:sendrequestline(method, uri)
local reqline = string.format("%s %s HTTP/1.1\r\n", method or "GET", uri)
return self.try(self.c:send(reqline))
@/lua/ge/extensions/editor/dynamicDecals/camera.lua
for name, val in pairs(presets) do
if im.Button(string.format("%s##%s_%s", name:gsub("^%l", string.upper), "Generate Materials", guiId), im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
setCamera(vec3(val[1], val[2], val[3]))
if im.Button(string.format("%s##%s", "Show Preferences", guiId), im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
editor.showPreferences("dynamicDecalsTool")
for name, val in pairs(presets) do
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("##dynDecals_camera_presets_remove_%d", i)) then
presets[name] = nil
editor.uiInputText(string.format("##dynDecals_camera_presets_name_%d", i), editor.getTempCharPtr(name), nil, nil, nil, nil, editor.getTempBool_BoolBool(false))
if editor.getTempBool_BoolBool() == true then
editor.uiInputFloat3(string.format("##dynDecals_camera_presets_val_%d", i), editor.getTempFloatArray3_TableTable(val), "%.1f", nil, editor.getTempBool_BoolBool(false))
if editor.getTempBool_BoolBool() == true then
local i = 0
local name = string.format("preset_%d", i)
i = i + 1
name = string.format("preset_%d", i)
end
@/lua/vehicle/extensions/tech/roadsSensor.lua
obj:queueGameEngineLua(string.format("tech_sensors.updateRoadsSensorLastReadings(%q)", lpack.encode(readingsData)))
local adHocData = { requestId = adHocRequestId, reading = data.readings }
obj:queueGameEngineLua(string.format("tech_sensors.updateRoadsSensorAdHocRequest(%q)", lpack.encode(adHocData)))
end
@/lua/ge/extensions/flowgraph/nodes/environment/setWind.lua
if not self.pinIn.vehId.value or self.pinIn.vehId.value == veh:getId() then
veh:queueLuaCommand('obj:setWind('..string.format('%6f, %6f, %6f', windVec.x, windVec.y, windVec.z)..')')
end
@/lua/ge/extensions/scenario/raceUI.lua
local curTime = string.format("%.3f", data.time) .. 's'
--guihooks.trigger('ScenarioFlashMessage', {{'Lap ' ..tostring(data.lap) .. ' time: ' .. curTime, 3}} )
@/lua/common/libs/luasocket/socket/ftp.lua
self.pasvt = {
ip = string.format("%d.%d.%d.%d", a, b, c, d),
port = p1*256 + p2
local ph = (port - pl)/256
local arg = string.gsub(string.format("%s,%d,%d", ip, ph, pl), "%.", ",")
self.try(self.tp:command("port", arg))
@/lua/vehicle/extensions/profiling/p.lua
if not prof_raw then
out:write(format("%s%2d%% %s\n", indent, pct, k))
elseif prof_raw == "r" then
elseif prof_raw == "r" then
out:write(format("%s%5d %s\n", indent, v, k))
else
else
out:write(format("%s %d\n", k, v))
end
if f0 == 40 or f0 == 91 then
out:write(format("\n====== %s ======\n[Cannot annotate non-file]\n", file))
--break
if not fp then
out:write(format("====== ERROR: %s: %s\n", file, err))
break
end
out:write(format("\n====== %s ======\n", file))
local fl = files[file]
show = n+ann
out:write(format("@@ %d @@\n", n))
end
if v then
out:write(format(fmtv, v, line))
else
else
out:write(format(fmtn, line))
end
@/lua/ge/extensions/core/repository.lua
--log('I', 'repository', 'request progress: ' .. dumps(r))
--log('D', 'repository', 'request progress: ' .. string.format('% 4.2f', r.dlnow / r.dltotal * 100) .. ' %. Speed: ' .. string.format('%2.2f kB/s', r.dlspeed / 1024))
--log('I', 'repository', 'request progress: ' .. dumps(r))
--log('D', 'repository', 'request progress: ' .. string.format('% 4.2f', r.dlnow / r.dltotal * 100) .. ' %. Speed: ' .. string.format('%2.2f kB/s', r.dlspeed / 1024))
@/lua/ge/extensions/flowgraph/nodes/ui/customUiLayout.lua
im.Text(self.storedLayout and string.format("Stored Layout (%d Elements)", #self.storedLayout) or "No Layout!")
if im.BeginCombo("loadlayout","Copy Layout from...") then
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veJBeamPicker.lua
local absVal = math.abs(val)
local strVal = string.format("%.4f", absVal)
strVal = (val < 0 and " -" or "+") .. strVal
local absAvgVal = math.abs(avgVal)
local strAvgVal = string.format("%.4f", absAvgVal)
strAvgVal = (val < 0 and " -" or "+") .. strAvgVal
im.TextColored(im.ImVec4(v.color[1],v.color[2],v.color[3],v.color[4]), string.format("%s (live / avg) = %s / %s %s", name, strVal, strAvgVal, units))
--im.Text(string.format("%s = %.2f %s", name, val, units))
im.TextColored(im.ImVec4(v.color[1],v.color[2],v.color[3],v.color[4]), string.format("%s (live / avg) = %s / %s %s", name, strVal, strAvgVal, units))
--im.Text(string.format("%s = %.2f %s", name, val, units))
if showGraphs[0] then
local absVal = math.abs(val)
local strVal = string.format("%.4f", absVal)
strVal = (val < 0 and " -" or "+") .. strVal
local absAvgVal = math.abs(avgVal)
local strAvgVal = string.format("%.4f", absAvgVal)
strAvgVal = (val < 0 and " -" or "+") .. strAvgVal
im.TextColored(im.ImVec4(v.color[1],v.color[2],v.color[3],v.color[4]), string.format("%s (live / avg) = %s / %s %s", name, strVal, strAvgVal, units))
--im.Text(string.format("%s = %.2f %s", name, val, units))
im.TextColored(im.ImVec4(v.color[1],v.color[2],v.color[3],v.color[4]), string.format("%s (live / avg) = %s / %s %s", name, strVal, strAvgVal, units))
--im.Text(string.format("%s = %.2f %s", name, val, units))
if showGraphs[0] then
--im.Text("Length = " .. string.format("%.2f", beamLength) .. " m")
@/lua/ge/extensions/scenario/raceMarkers/sideColumnMarker.lua
local sideHeight = clamp(inverseLerp(60,180,distanceFromMarker),0,20)+1 +clamp(inverseLerp(1800,2040,distanceFromMarker),0,20)
--debugDrawer:drawTextAdvanced(self.pos, String(string.format("%0.2f -> %0.2f / %0.2f / %0.2f", distanceFromMarker, sideRadius, sideHeight, baseHeight)), ColorF(1,1,1,1), true, false, ColorI(0,0,0,192))
left = scenetree.findObjectById(self.leftId)
@/lua/ge/extensions/ui/gameplaySelector/tileGenerators/campaignTiles.lua
local function getKeyFromDetails(details)
return string.format("campaign_%s", details.campaignSourceFile)
end
if campaign.maxPlayers and campaign.maxPlayers > 1 then
local playersValue = string.format("From %d up to %d local players", campaign.minPlayers or 1, campaign.maxPlayers)
table.insert(specifications, {
label = translate("ui.common.property.scenarios"),
value = string.format("%d scenarios", scenarioCount)
})
@/lua/common/libs/luasocket/socket/url.lua
return (string.gsub(s, "([^A-Za-z0-9_])", function(c)
return string.format("%%%02x", string.byte(c))
end))
if segment_set[c] then return c
else return string.format("%%%02x", string.byte(c)) end
end)
@/lua/common/luaProfiler.lua
local function format(value, decimals, pad, decimalSeparator)
local factor = 10^decimals
if decimals > 0 then
return lpad(string.format("%." .. decimals .. "f", result), pad or 0, ' ')
else
local garbage = currTotalGarbage
local msg = format(garbage, 0, 8) .. " bytes"
msg = msg .." " .. format(time, 2, 8)
local msg = format(garbage, 0, 8) .. " bytes"
msg = msg .." " .. format(time, 2, 8)
if detectPeaks then msg = msg.." ms vs "..format(self.stats.total.average, 2, 8).." ms (+"..format(self.stats.total.deltaRel*100, 0, 5).."%)"
msg = msg .." " .. format(time, 2, 8)
if detectPeaks then msg = msg.." ms vs "..format(self.stats.total.average, 2, 8).." ms (+"..format(self.stats.total.deltaRel*100, 0, 5).."%)"
else msg = msg.." ms" end
msg = msg .." " .. format(time, 2, 8)
if detectPeaks then msg = msg.." ms vs "..format(self.stats.total.average, 2, 8).." ms (+"..format(self.stats.total.deltaRel*100, 0, 5).."%)"
else msg = msg.." ms" end
if (not detectPeaks) or (detectPeaks and localPeakDetected) then
--local msg = rpad(title, width, " ").." = "..format(time, 3, 8)
local msg = format(garbage, 0, 8) .. " bytes"
--local msg = rpad(title, width, " ").." = "..format(time, 3, 8)
local msg = format(garbage, 0, 8) .. " bytes"
msg = msg .." " .. format(time, 2, 8)
local msg = format(garbage, 0, 8) .. " bytes"
msg = msg .." " .. format(time, 2, 8)
if detectPeaks then msg = msg.." ms vs "..format(self.stats[t.section].average, 2, 8).." ms (+"..format(self.stats[t.section].deltaRel*100, 0, 5).."%)"
msg = msg .." " .. format(time, 2, 8)
if detectPeaks then msg = msg.." ms vs "..format(self.stats[t.section].average, 2, 8).." ms (+"..format(self.stats[t.section].deltaRel*100, 0, 5).."%)"
else msg = msg.." ms" end
msg = msg .." " .. format(time, 2, 8)
if detectPeaks then msg = msg.." ms vs "..format(self.stats[t.section].average, 2, 8).." ms (+"..format(self.stats[t.section].deltaRel*100, 0, 5).."%)"
else msg = msg.." ms" end
@/lua/vehicle/powertrain/compressor.lua
if device.engaged then
--log("D", "compressor.updateVelocity", ("playing %q at %d"):format(device.purgeSoundEvent, device.purgeSoundNodeId))
obj:playSFXOnce(device.purgeSoundEvent, device.purgeSoundNodeId, device.purgeSoundVolume, 1)
if storage.energyType ~= device.requiredEnergyType then
log("E", "compressor.registerStorage", ("provided energyStorage for compressor %q has wrong energyType (compressor wants %q, storage is %q)"):format(device.name, device.requiredEnergyType, storage.energyType))
return
device.purgeSoundNodeId = purgeSoundNode or device.parent.engineNodeID or 0
--log("D", "compressor.initSounds", ("purgeSoundNode: %q | purgeSoundNodeId: %d"):format(purgeSoundNode, device.purgeSoundNodeId))
device.purgeSoundEvent = jbeamData.pumpPurgeEvent or "event:>Vehicle>Pneumatics>Air_Dryer_Purge"
@/lua/ge/extensions/editor/crawlEditor/boundaries.lua
local area = boundary:zoneArea()
im.Text("Area: " .. string.format("%.2f m²", area))
end
im.SameLine()
im.Text("Height: " .. string.format("%.2f", boundary.top.pos.z))
self.currentPlane = boundary.top
im.SameLine()
im.Text("Height: " .. string.format("%.2f", boundary.bot.pos.z))
self.currentPlane = boundary.bot
local inside = boundary:containsPoint2D(pos)
im.Text("Mouse Position: " .. string.format("%.2f, %.2f, %.2f", pos.x, pos.y, pos.z))
im.Text("Inside Boundary: " .. (inside and "Yes" or "No"))
@/lua/ge/extensions/career/modules/milestones/generalMilestones/money.lua
getLabel = function(step, displayValue, target) return modeConfig.label end,
getDescription = function(step, displayValue, target) return string.format(modeConfig.description, target) end,
getProgressLabel = function(step, current, target) return string.format("%0.2f / %0.2f", current, target) end,
getDescription = function(step, displayValue, target) return string.format(modeConfig.description, target) end,
getProgressLabel = function(step, current, target) return string.format("%0.2f / %0.2f", current, target) end,
getTarget = function(step) return values[step] end,
@/lua/ge/extensions/gameplay/markers/driftLineMarker.lua
debugDrawer:drawLine(self.pos, data.vehPos, ColorF(0.91,0.05,0.48,0.5))
simpleDebugText3d(String(string.format("%0.2fm", data.vehPos:distance(self.pos))), (self.pos + data.vehPos)*0.5)
end
@/lua/ge/extensions/editor/dynamicDecals/inspector/utils.lua
im.PushItemWidth(im.GetContentRegionAvailWidth() - 2 * tool.getIconSize() - 2 * im.GetStyle().ItemSpacing.x)
im.InputText(string.format("##%s_%s_%s_%s", layer.uid, guiId, propert, "texturePath"), editor.getTempCharPtr(layer[property]), nil, im.InputTextFlags_ReadOnly)
im.PopItemWidth()
im.SameLine()
if editor.uiIconImageButton(editor.icons.folder, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("##%s_%s_%s_%s", layer.uid, guiId, propert, "button")) then
editor_fileDialog.openFile(
im.SameLine()
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("##%s_%s_%s_%s", layer.uid, guiId, propert, "removeButton")) then
layer[property] = removeTextureOverridePath or "/"
im.SetCursorPos(im.ImVec2(cursorPos.x, cursorPos.y + size - 20))
if editor.uiColorEdit4(string.format("##%s_%s_%s", layer.uid, guiId, "gradientColorBottomLeft"), editor.getTempFloatArray4_TableTable(gradientColorBottomLeft), im.flags(im.ColorEditFlags_AlphaPreview, im.ColorEditFlags_NoInputs), editor.getTempBool_BoolBool(false)) then
local value = editor.getTempFloatArray4_TableTable()
im.SetCursorPos(cursorPos)
if editor.uiColorEdit4(string.format("##%s_%s_%s", layer.uid, guiId, "gradientColorTopLeft"), editor.getTempFloatArray4_TableTable(gradientColorTopLeft), im.flags(im.ColorEditFlags_AlphaPreview, im.ColorEditFlags_NoInputs), editor.getTempBool_BoolBool(false)) then
local value = editor.getTempFloatArray4_TableTable()
im.SetCursorPos(im.ImVec2(cursorPos.x, cursorPos.y + size - 20))
if editor.uiColorEdit4(string.format("##%s_%s_%s", layer.uid, guiId, "gradientColorBottomRight"), editor.getTempFloatArray4_TableTable(gradientColorBottomRight), im.flags(im.ColorEditFlags_AlphaPreview, im.ColorEditFlags_NoInputs), editor.getTempBool_BoolBool(false)) then
local value = editor.getTempFloatArray4_TableTable()
im.SetCursorPos(cursorPos)
if editor.uiColorEdit4(string.format("##%s_%s_%s", layer.uid, guiId, "gradientColorTopRight"), editor.getTempFloatArray4_TableTable(gradientColorTopRight), im.flags(im.ColorEditFlags_AlphaPreview, im.ColorEditFlags_NoInputs), editor.getTempBool_BoolBool(false)) then
local value = editor.getTempFloatArray4_TableTable()
@/lua/ge/extensions/gameplay/rally/notebook/structured/textCompositor.lua
-- print(string.format("Enumerating from %d to %d with step %d", self.min, self.max, self.step))
local out = {}
log('I', logTag, string.format('Enumerated %d phrases (%d chars) for compositor "%s"',
out.stats.totalPhrases, out.stats.totalChars, self.compositorName))
out.stats.totalPhrases, out.stats.totalChars, self.compositorName))
log('I', logTag, string.format('Details: %d distance calls, %d pacenotes, %d system pacenotes',
out.stats.distancePhrases, out.stats.notePhrases, out.stats.systemPhrases))
@/lua/ge/extensions/editor/fileDialog.lua
im.NextColumn()
im.TextUnformatted(string.format("%d x %d", imgSize.x, imgSize.y))
im.Columns(1, "FilePreviewColumns")
@/lua/vehicle/controller/pneumatics/actuators.lua
-- Create an implicit cross-flow group, as this group did not reference an explicitly-defined one
log("W", "actuators", ("Creating implicit cross-flow group %q for beam group %q"):format(g.crossFlowTag, g.name))
crossFlowGroup = {
if g.enableDebug then
log("W", "actuators", ("[%s] starting increasing sound, fr = %f"):format(g.name, flowRate))
end
if g.enableDebug then
log("W", "actuators", ("[%s] starting decreasing sound, fr = %f"):format(g.name, flowRate))
end
if g.enableDebug and (g.isPlayingIncrease or g.isPlayingDecrease) then
log("W", "actuators", ("[%s] stopping all sound, fr = %f"):format(g.name, flowRate))
end
--log("D", "actuators.init", ("beam %q volume: %f"):format(name, beamVolume))
@/lua/ge/extensions/editor/dynamicDecals/layerTypes/brushStroke.lua
if editor.uiInputText(
string.format("##%s_%s_%s", layer.uid, guiId, "layerName"),
editor.getTempCharPtr(layer.name),
im.NextColumn()
if im.Checkbox(string.format("##%s_%s_%s", layer.uid, guiId, "enabled"), editor.getTempBool_BoolBool(layer.enabled)) then
layer.enabled = editor.getTempBool_BoolBool()
im.NextColumn()
im.TextUnformatted(string.format("%s layer", api.layerTypesMap[layer.type]))
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.InputFloat3(string.format("##%s_%s_%s", layer.uid, guiId, "camPosition"), editor.getTempFloatArray3_Vec3Vec3(layer.camPosition), "%.6f") then
layer.camPosition = editor.getTempFloatArray3_Vec3Vec3()
im.PushItemWidth(im.GetContentRegionAvailWidth() - ((layer.colorPaletteMapId > 0) and (im.GetStyle().ItemSpacing.x + math.ceil(im.GetFontSize()) + 2 * im.GetStyle().FramePadding.y) or 0))
if im.Combo2(string.format("##%s_%s_%s", layer.uid, guiId, "colorpalettemapid"), editor.getTempInt_NumberNumber(layer.colorPaletteMapId), "zero\0one\0two\0three\0\0") then
layer.colorPaletteMapId = editor.getTempInt_NumberNumber()
im.SameLine()
im.ColorButton(string.format("##%s_%s_%s", layer.uid, guiId, "colorpalettemapidbutton"), editor.getTempImVec4_TableTable(col))
im.tooltip("Vehicle color palette color")
im.NextColumn()
if im.Checkbox(string.format("##%s_%s_%s", layer.uid, guiId, "decalUseGradientColor"), editor.getTempBool_BoolBool(layer.decalUseGradientColor)) then
layer.decalUseGradientColor = editor.getTempBool_BoolBool()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiColorEdit4(string.format("##%s_%s_%s", layer.uid, guiId, "color"), editor.getTempFloatArray4_TableTable(layer.color:toTable()), nil, editor.getTempBool_BoolBool(false)) then
layer.color = Point4F.fromTable(editor.getTempFloatArray4_TableTable())
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat3(string.format("##%s_%s_%s", layer.uid, guiId, "decalScale"), editor.getTempFloatArray3_Vec3Vec3(layer.decalScale), 0.05, 6.0, nil, nil, editor.getTempBool_BoolBool(false)) then
layer.decalScale = editor.getTempFloatArray3_Vec3Vec3()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##%s_%s_%s", layer.uid, guiId, "decalRotation"), editor.getTempFloat_NumberNumber(layer.decalRotation * 180 / math.pi), 0, 360, nil, nil, editor.getTempBool_BoolBool(false)) then
layer.decalRotation = (editor.getTempFloat_NumberNumber() / 180 * math.pi)
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat2(string.format("##%s_%s_%s", layer.uid, guiId, "decalSkew"), editor.getTempFloatArray2_TableTable({layer.decalSkew.x, layer.decalSkew.y}), -2.0, 2.0, nil, nil, editor.getTempBool_BoolBool(false)) then
local value = editor.getTempFloatArray2_TableTable()
im.NextColumn()
if im.Checkbox(string.format("##%s_%s_%s", layer.uid, guiId, "mirrored"), editor.getTempBool_BoolBool(layer.mirrored)) then
layer.mirrored = editor.getTempBool_BoolBool()
im.NextColumn()
if im.Checkbox(string.format("##%s_%s_%s", layer.uid, guiId, "flipMirroredDecal"), editor.getTempBool_BoolBool(layer.flipMirroredDecal)) then
layer.flipMirroredDecal = editor.getTempBool_BoolBool()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat2(string.format("##%s_%s_%s", layer.uid, guiId, "colorTextureScale"), editor.getTempFloatArray2_TableTable({layer.colorTextureScale.x, layer.colorTextureScale.y}), 0.01, 6.0, nil, nil, editor.getTempBool_BoolBool(false)) then
local value = editor.getTempFloatArray2_TableTable()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.Combo2(string.format("##%s_%s_%s", layer.uid, guiId, "alphaMaskChannel"), editor.getTempInt_NumberNumber(layer.alphaMaskChannel), "red\0green\0blue\0alpha\0\0") then
layer.alphaMaskChannel = editor.getTempInt_NumberNumber()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.Combo2(string.format("##%s_%s_%s", layer.uid, guiId, "alphaMaskBlendMode"), editor.getTempInt_NumberNumber(layer.alphaMaskBlendMode), "multiply\0add\0\0") then
layer.alphaMaskBlendMode = editor.getTempInt_NumberNumber()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat2(string.format("##%s_%s_%s", layer.uid, guiId, "alphaMaskScale"), editor.getTempFloatArray2_TableTable({layer.alphaMaskScale.x, layer.alphaMaskScale.y}), 0.01, 6.0, nil, nil, editor.getTempBool_BoolBool(false)) then
local value = editor.getTempFloatArray2_TableTable()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##%s_%s_%s", layer.uid, guiId, "alphaMaskRotation"), editor.getTempFloat_NumberNumber(layer.alphaMaskRotation * 180 / math.pi), 0, 360, nil, nil, editor.getTempBool_BoolBool(false)) then
layer.alphaMaskRotation = (editor.getTempFloat_NumberNumber() / 180 * math.pi)
local val = 0
if editor.uiSliderFloat(string.format("##%s_%s_%s", layer.uid, guiId, "alphaMaskIntensity"), editor.getTempFloat_NumberNumber(layer.alphaMaskIntensity), 0.0, 2.0, "%.2f", nil, editor.getTempBool_BoolBool(false)) then
layer.alphaMaskIntensity = editor.getTempFloat_NumberNumber()
im.NextColumn()
if im.Checkbox(string.format("##%s_%s_%s", layer.uid, guiId, "wrapAlphaMaskX"), editor.getTempBool_BoolBool(layer.wrapAlphaMaskX)) then
layer.wrapAlphaMaskX = editor.getTempBool_BoolBool()
im.NextColumn()
if im.Checkbox(string.format("##%s_%s_%s", layer.uid, guiId, "wrapAlphaMaskY"), editor.getTempBool_BoolBool(layer.wrapAlphaMaskY)) then
layer.wrapAlphaMaskY = editor.getTempBool_BoolBool()
im.NextColumn()
if im.Checkbox(string.format("##%s_%s_%s", layer.uid, guiId, "wrapColorTextureX"), editor.getTempBool_BoolBool(layer.wrapColorTextureX)) then
layer.wrapColorTextureX = editor.getTempBool_BoolBool()
im.NextColumn()
if im.Checkbox(string.format("##%s_%s_%s", layer.uid, guiId, "wrapColorTextureY"), editor.getTempBool_BoolBool(layer.wrapColorTextureY)) then
layer.wrapColorTextureY = editor.getTempBool_BoolBool()
im.NextColumn()
if im.Checkbox(string.format("##%s_%s_%s", layer.uid, guiId, "alphaMaskInvert"), editor.getTempBool_BoolBool(layer.alphaMaskInvert)) then
layer.alphaMaskInvert = editor.getTempBool_BoolBool()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiInputInt(string.format("##%s_%s_%s", layer.uid, guiId, "interpolationSteps"), editor.getTempInt_NumberNumber(layer.interpolationSteps), 1, 2) then
local value = editor.getTempInt_NumberNumber()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##%s_%s_%s", layer.uid, guiId, "sdfThickness"), editor.getTempFloat_NumberNumber(layer.sdfThickness), 0.0, 1.0, "%.2f", nil, editor.getTempBool_BoolBool(false)) then
layer.sdfThickness = editor.getTempFloat_NumberNumber()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##%s_%s_%s", layer.uid, guiId, "sdfSoftness"), editor.getTempFloat_NumberNumber(layer.sdfSoftness), 0.0, 1.0, "%.2f", nil, editor.getTempBool_BoolBool(false)) then
layer.sdfSoftness = editor.getTempFloat_NumberNumber()
local sdfOutlineColorTbl = layer.sdfOutlineColor:toTable()
if editor.uiColorEdit4(string.format("##%s_%s_%s", layer.uid, guiId, "sdfOutlineColor"), editor.getTempFloatArray3_TableTable({sdfOutlineColorTbl[1]/255, sdfOutlineColorTbl[2]/255, sdfOutlineColorTbl[3]/255}), nil, editor.getTempBool_BoolBool(false)) then
local value = editor.getTempFloatArray3_TableTable()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##%s_%s_%s", layer.uid, guiId, "sdfOutlineThickness"), editor.getTempFloat_NumberNumber(layer.sdfOutlineThickness), 0.0, 1.0, "%.2f", nil, editor.getTempBool_BoolBool(false)) then
layer.sdfOutlineThickness = editor.getTempFloat_NumberNumber()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##%s_%s_%s", layer.uid, guiId, "sdfOutlineSoftness"), editor.getTempFloat_NumberNumber(layer.sdfOutlineSoftness), 0.0, 1.0, "%.2f", nil, editor.getTempBool_BoolBool(false)) then
layer.sdfOutlineSoftness = editor.getTempFloat_NumberNumber()
local count = #layer.dataPoints
im.TextUnformatted(string.format("count: %d", count))
editor.uiButtonRightAlign(string.format("Show data points##%s", layer.uid), nil, true)
if im.IsItemHovered() then
debugDrawer:drawSphere(pos, editor.getPreference("dynamicDecalsTool.general.dataPointSphereSize"), ColorF(col[1], col[2], col[3], col[4]), col[4] < 0.99 and true or false)
debugDrawer:drawTextAdvanced(pos, String(string.format(" %d ", i)), ColorF(1,1,0,1), true, false, ColorI(40, 40, 40, 0.75*255))
end
im.SameLine()
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("##%s_%s_%s_%d", layer.uid, guiId, "interpolationSteps_removedataPointsEntry", k)) then
table.remove(layer.dataPoints, k)
if k == count then im.BeginDisabled() end
if editor.uiIconImageButton(editor.icons.content_copy, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("##%s_%s_%s_%d", layer.uid, guiId, "interpolationSteps_insertdataPointsEntry", k)) then
local nextPoint = layer.dataPoints[k + 1]
if editor.uiIconImageButton(editor.icons.move, im.ImVec2(tool.getIconSize(), tool.getIconSize()), (gizmo.data.uid == layer.uid and gizmo.data.dataPointIndex == k) and editor.color.beamng.Value or nil, nil, nil, string.format("MoveBrushStrokePoint_%s_%d", layer.uid, k)) then
local layerData = deepcopy(layer)
debugDrawer:drawSphere(pos, editor.getPreference("dynamicDecalsTool.general.dataPointSphereSize"), ColorF(col[1], col[2], col[3], col[4]), col[4] < 0.99 and true or false)
debugDrawer:drawTextAdvanced(pos, String(string.format(" %d ", k)), ColorF(1,1,0,1), true, false, ColorI(40, 40, 40, 0.75*255))
end
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat2(string.format("##%s_%s_%s_%d", layer.uid, guiId, "brushdataPoints_cursorPosScreenUv", k), editor.getTempFloatArray2_TableTable({data.x, data.y}), 0.0, 1.0, nil, nil, editor.getTempBool_BoolBool(false)) then
local value = editor.getTempFloatArray2_TableTable()
im.TableNextColumn()
if im.Button(string.format("Highlight##DecalPropertiesTable_%s", property.name)) then
tool.setSectionOpenState("Decal Properties", true)
tool.setSectionOpenState("Decal Properties", true)
widgets.highlight(string.format("##Decal Properties_section_%s", property.id), 5)
end
@/lua/ge/server/server.lua
ldgCtx.tileTransform = mat
log('I', string.format('### Global level offset set to (%.2f, %.2f, %.2f)', x, y, z))
i = i + 4 -- Skip the consumed arguments
local timeTotal = timerFunc:stopAndReset() / 1000
log('I', 'levelLoading', string.format("Level loaded in %.3fs: init %.3fs + datablocks %.3fs + materials %.3fs + objects %.3fs + ai.map %.3fs + decals %.3fs + physics %.3fs + cam %.3fs + player %.3fs + fade %.3fs", timeTotal, timeInit, timeDatablocks, timeMat, timeObjects, timeAIMap, timeDecals, timePhysics, timeCam, timePlayer, timeFade))
end
extensions.hook("onLoadingScreenFadeout")
log('I', 'levelLoading', 'Loading screen disabled after ' .. string.format('%5.3fs', timer2:stopAndReset() / 1000))
--Engine.Profiler.stopCapture()
@/lua/ge/extensions/gameplay/crawl/general.lua
local poi = {
id = string.format("crawl##%s", trail._fileName or "trail"),
data = { type = "crawl", trailId = trail._filePath },
if trailStats and trailStats.bestPenaltyPoints < math.huge then
poi.markerInfo.bigmapMarker.description = poi.markerInfo.bigmapMarker.description .. "\n" .. string.format("Best Penalty Points: %d", trailStats.bestPenaltyPoints)
end
keyLabel = "Distance",
valueLabel = string.format("%.1f m", pathStats.totalDistance)
})
keyLabel = "Elevation Gain",
valueLabel = string.format("%.1f m", pathStats.elevationGain)
})
keyLabel = "Elevation Loss",
valueLabel = string.format("%.1f m", pathStats.elevationLoss)
})
keyLabel = "Best Penalty Points",
valueLabel = string.format("%d", trailStats.bestPenaltyPoints)
})
keyLabel = "Best Time",
valueLabel = string.format("%.2fs", trailStats.bestTime)
})
@/lua/ge/extensions/editor/roadDecorations.lua
objName = objName[#objName]
objName = string.format('decoration.%s.%s.%s', roadName, objName, idx)
local groupName = string.format('decorations.%d', tostring(roadName))
local group = scenetree.findObject(groupName)
@/lua/ge/extensions/gameplay/markers/gasStationMarker.lua
end
local iconId = iconRendererObj:addIcon(string.format("%s-gsIcon-%d",cluster.clusterId, idx), playModeIconName, iconPos)
local iconInfo = iconRendererObj:getIconById(iconId)
@/inspector/Views/ConsoleMessageView.js
if (this._message.parameters[0].type === "string") {
var prefixedFormatString = WI.UIString("Trace: %s").format(this._message.parameters[0].description);
args = [prefixedFormatString].concat(this._message.parameters.slice(1));
if (this._message.parameters[0].type === "string") {
var prefixedFormatString = WI.UIString("Assertion Failed: %s").format(this._message.parameters[0].description);
args = [prefixedFormatString].concat(this._message.parameters.slice(1));
// String.format does treat formattedResult like a Builder, result is an object.
return String.format(parameters[0].description, parameters.slice(1), formatters, formattedResult, append);
}
@/lua/ge/extensions/flowgraph/nodes/util/timedSequence.lua
if self.time then
im.Text(string.format("%0.1fs", self.time))
end
@/lua/ge/extensions/editor/dynamicDecals/brushes.lua
if not prop then
editor.logWarn(string.format("%s : No property found for '%s'", logTag, propertyName))
return value
im.NextColumn()
im.TextUnformatted(string.format("%d (%s)", brush.alphaMaskBlendMode or 0, alphaMaskBlendModes[brush.alphaMaskBlendMode or 0]))
im.NextColumn()
im.NextColumn()
im.TextUnformatted(string.format("%d (%s)", brush.alphaMaskChannel or 0, alphaMaskChannels[brush.alphaMaskChannel or 0]))
im.NextColumn()
im.NextColumn()
im.TextUnformatted(string.format("%.2f", brush.alphaMaskRotation or 0.0))
im.NextColumn()
im.NextColumn()
im.TextUnformatted(string.format("[%.2f, %.2f]", brush.alphaMaskScale[1], brush.alphaMaskScale[2]))
im.NextColumn()
im.NextColumn()
im.TextUnformatted(string.format("%s", ((brush.alphaMaskInvert or false) and "true" or "false")))
im.NextColumn()
im.NextColumn()
im.TextUnformatted(string.format("%d (%s)", brush.blendMode, api.blendModes[brush.blendMode + 1].name))
im.NextColumn()
im.NextColumn()
im.TextUnformatted(string.format("[%.2f, %.2f]", brush.colorTextureScale[1], brush.colorTextureScale[2]))
im.NextColumn()
im.NextColumn()
im.TextUnformatted(string.format("%.2f", brush.decalRotation))
im.NextColumn()
im.NextColumn()
im.TextUnformatted(string.format("[%.2f, %.2f, %.2f]", brush.decalScale[1], brush.decalScale[2], brush.decalScale[3]))
im.NextColumn()
im.NextColumn()
im.TextUnformatted(string.format("[%.2f, %.2f]", brush.decalSkew[1], brush.decalSkew[2]))
im.NextColumn()
im.NextColumn()
im.TextUnformatted(string.format("[%.1f, %.1f]", brush.decalUv[1], brush.decalUv[2]))
im.NextColumn()
im.NextColumn()
im.TextUnformatted(string.format("%s", (brush.alphaMaskInvert and "true" or "false")))
im.NextColumn()
im.NextColumn()
im.TextUnformatted(string.format("%s", (brush.mirrored or false) and "true" or "false"))
im.NextColumn()
im.NextColumn()
im.TextUnformatted(string.format("%s", (brush.flipMirroredDecal or false) and "true" or "false"))
im.NextColumn()
im.NextColumn()
im.TextUnformatted(string.format("%.2f", brush.metallicIntensity or 1.0))
im.NextColumn()
im.NextColumn()
im.TextUnformatted(string.format("%.2f", brush.normalIntensity or 1.0))
im.NextColumn()
im.NextColumn()
im.TextUnformatted(string.format("%.2f", brush.roughnessIntensity or 1.0))
im.NextColumn()
im.NextColumn()
im.TextUnformatted(string.format("%s", (brush.wrapAlphaMaskX and "true" or "false")))
im.NextColumn()
im.NextColumn()
im.TextUnformatted(string.format("%s", (brush.wrapAlphaMaskY and "true" or "false")))
im.NextColumn()
im.NextColumn()
im.TextUnformatted(string.format("%s", (brush.wrapColorTextureX and "true" or "false")))
im.NextColumn()
im.NextColumn()
im.TextUnformatted(string.format("%s", (brush.wrapColorTextureY and "true" or "false")))
im.NextColumn()
@/ui/ui-vue/dist/index.js
Parent:`,parent$1,`
Child:`,prioNode),warnPrioNesting=!0)}let active=document.activeElement;(!active||!prioNode.contains(active))&&(rectNode=prioNode)}let rect=rectNode.getBoundingClientRect();if(rect.right<0||rect.bottom<0||rect.left>screen.width||rect.top>screen.height){node.classList.remove(MENU_NAVIGATION_CLASS);continue}node.classList.add(MENU_NAVIGATION_CLASS),node.tabIndex=0;let lnk={dom:node,rect};links.up&&links.up.push(lnk),links.down&&links.down.push(lnk),links.left&&links.left.push(lnk),links.right&&links.right.push(lnk)}return links.up&&links.up.sort((a$1,b)=>a$1.rect.top-b.rect.top),links.down&&links.down.sort((a$1,b)=>a$1.rect.bottom-b.rect.bottom),links.left&&links.left.sort((a$1,b)=>a$1.rect.left-b.rect.left),links.right&&links.right.sort((a$1,b)=>a$1.rect.right-b.rect.right),links}function isAvailable(node){if(!isVisibleFast(node))return!1;let style=document.defaultView.getComputedStyle(node,null);return style[`pointer-events`]===`none`||!isVisible(node,style)?!1:!isOccluded(node)}function isOccluded(node,dontIgnoreOffscreen=!1){let rects=node.getClientRects();for(let rect of rects)if(!isOccluded$1(node,rect,dontIgnoreOffscreen))return!1;return!0}function getDistanceFast(curr,goal,direction$1,usePerpendicular=!1){let dx=Math.min(goal.right,curr.right)-Math.max(goal.left,curr.left),dy=Math.min(goal.bottom,curr.bottom)-Math.max(goal.top,curr.top);dx===goal.right-goal.left&&(dx=curr.right-goal.left),dy===goal.bottom-goal.top&&(dy=curr.bottom-goal.top);let res=1/0;if(direction$1===DIR.DOWN&&goal.bottom>curr.bottom?res=Math.max(0,goal.bottom-curr.top)-dx:direction$1===DIR.UP&&goal.topcurr.right?res=Math.max(0,goal.left-curr.right)-dy:direction$1===DIR.LEFT&&goal.left{let firstLink=null,firstElementDistance=2**53-1;for(let link of links){let distance=link.rect.top*link.rect.top+link.rect.left*link.rect.left;distance>firstElementDistance||(firstElementDistance=distance,firstLink=link)}if(!firstLink){console.log(`Couldn't locate any button anywhere. Menu navigation won't work`);return}focusOnElement(firstLink.dom),scrollFix(firstLink,direction$1)}),!0;if(active.nodeName===`MD-SLIDER`&&(direction$1===DIR.LEFT||direction$1===DIR.RIGHT)||active.nodeName===`MD-OPTION`&&(direction$1===DIR.UP||direction$1===DIR.DOWN)||active.nodeName===`INPUT`&&active.type===`range`&&(direction$1===DIR.LEFT||direction$1===DIR.RIGHT))return fireKey(active,direction$1),!0;let{nearestLink,fixScroll}=findNext(links,direction$1,active);if(nearestLink)return focusOnElement(nearestLink.dom),fixScroll?.(),nearestLink.dom;if(links.length===0){let mdBackdrops=[...document.querySelectorAll(`md-backdrop, .md-scroll-mask`)];if(mdBackdrops.length>0){for(let el of mdBackdrops)try{el.parentNode.removeChild(el)}catch{}return navigateNext(links,direction$1,activeOverride)}}return!1}function findNext(links,direction$1,activeOverride=null){let active=activeOverride||document.activeElement,activeRect=active.getBoundingClientRect(),fixScroll=!0;if(isScrolling(direction$1)&&isOccluded(active,activeRect,!0)){let axis,boundsame,boundchange;switch(direction$1){case DIR.UP:case DIR.DOWN:axis=`vertical`,boundsame=[`left`,`right`],boundchange=[`top`,`bottom`];break;case DIR.LEFT:case DIR.RIGHT:axis=`horizontal`,boundsame=[`top`,`bottom`],boundchange=[`left`,`right`];break}if(navScrolling[axis].area){let bounds=navScrolling[axis].area.bounds,axisBound=activeRect[boundchange[1]]scrollFix(nearestLink,direction$1):null}}var navScrolling={running:!1,listening:{vertical:!1,horizontal:!1},dom:null,rect:null,vertical:{active:!1,amount:0,area:null},horizontal:{active:!1,amount:0,area:null},hint:{show:!1}};function drawScrollHint(){let show=isScrolling();if(navScrolling.hint.show===show)return;navScrolling.hint.show=show;let elem=document.getElementById(`xf_scroll`);elem&&(elem.style.display=show?``:`none`)}function navigateScroll(axis,amount){if(axis===AXIS_V&&(amount=-amount),navScrolling[axis].amount=amount*15,Math.abs(navScrolling[axis].amount)<1){navScrolling[axis].active=!1;return}navScrolling[axis].active=!0;let dom=document.activeElement;navScrolling.dom!==dom&&(navScrolling.dom=dom,navScrolling.rect=dom.getBoundingClientRect(),navScrolling[axis===AXIS_H?AXIS_V:AXIS_H].active=!1);let area=findScrollable(navScrolling,axis,!0);if(navScrolling[axis].area=area,!area){navScrolling[axis].active=!1;return}return navScrolling.running||window.requestAnimationFrame(function scrl(){let set={};for(let axis$1 of[AXIS_V,AXIS_H]){let cur=navScrolling[axis$1];if(!cur.active||!cur.area)continue;let pos=cur.area.parent[cur.area.readby]+navScrolling[axis$1].amount;pos>cur.area.fullsize?cur.active=!1:set[cur.area.moveby]=pos}navScrolling.running=Object.keys(set).length>0,navScrolling.running&&(area.parent.scrollTo({...set,behavior:`instant`}),document.dispatchEvent(new CustomEvent(`mdtooltiphide`)),window.requestAnimationFrame(scrl))}),!0}function scrollCatch(axis,enable){if(navScrolling.listening[axis]===enable)return;let cur=isScrolling();navScrolling.listening[axis]=enable,cur!==isScrolling()&&(bngApi.engineLua(`local o = scenetree.findObject("MenuScrollActionMap"); if o then o:${enable?`push`:`pop`}() end`),window.bngVue.uiNavTracker&&(enable?window.bngVue.uiNavTracker.addEvent(UI_SCROLL_ACTION_EVENTS[axis],TRACKER_ID):window.bngVue.uiNavTracker.removeEvent(UI_SCROLL_ACTION_EVENTS[axis],TRACKER_ID)))}function isScrolling(direction$1=void 0){let scrolling=!1;return direction$1?direction$1===DIR.UP||direction$1===DIR.DOWN?scrolling=navScrolling.listening.vertical:(direction$1===DIR.LEFT||direction$1===DIR.RIGHT)&&(scrolling=navScrolling.listening.horizontal):scrolling=navScrolling.listening.horizontal||navScrolling.listening.vertical,scrolling}function isScrollListening(axis=void 0){let listening=!1;return listening=axis?navScrolling.listening[axis]:navScrolling.listening.horizontal||navScrolling.listening.vertical,listening}function findScrollable(link,axis,thumbstick){axis!==AXIS_V&&axis!==AXIS_H&&(axis=AXIS_V);let opts=axis===AXIS_H?{moveby:`left`,readby:`scrollLeft`,size:`width`,scroll:`scrollWidth`,client:`clientWidth`,overflow:`overflow-x`}:{moveby:`top`,readby:`scrollTop`,size:`height`,scroll:`scrollHeight`,client:`clientHeight`,overflow:`overflow-y`},forced=!1,parent,fullsize,size$3,node=link.dom?.parentNode;function setParent(node$1){if(!node$1)return;if(thumbstick){let noNav=node$1.attributes.getNamedItem(SCROLL_ATTR);if(noNav&&noNav.value===`false`)return}let styles$1=document.defaultView.getComputedStyle(node$1,null);(styles$1[opts.overflow]===`auto`||styles$1[opts.overflow]===`scroll`)&&(fullsize=node$1[opts.scroll],size$3=node$1[opts.client],fullsize>size$3&&(parent=node$1))}for(;node&&node.isConnected&&node.nodeType===Node.ELEMENT_NODE&&!((!thumbstick||node.attributes.getNamedItem(`bng-nav-scroll`))&&(setParent(node),parent));)node=node.parentNode;if(!parent){let elems$2=document.querySelectorAll(`[${SCROLL_FORCE_ATTR}]`);for(let elem of elems$2)if(setParent(elem),parent){forced=!0;break}}if(scrollCatch(axis,!!parent),drawScrollHint(),!parent)return null;let start=0,styles=document.defaultView.getComputedStyle(parent,null);[`relative`,`absolute`,`static`,`fixed`].includes(styles.position)&&(start+=parent.getBoundingClientRect()[opts.moveby]);let pad=link.rect?Math.max(size$3/4,link.rect[opts.size]):size$3/4,bounds=[start+pad,start+size$3-pad];return{parent,moveby:opts.moveby,readby:opts.readby,bounds,fullsize,start:0,finish:fullsize-size$3,forced}}function scrollFix(link,direction$1){let area=findScrollable(link,direction$1===DIR.UP||direction$1===DIR.DOWN?AXIS_V:AXIS_H);if(!area){document.querySelector(`[bng-nav-scroll], [bng-nav-scroll-force]`)&&findScrollable(link,direction$1===DIR.LEFT||direction$1===DIR.RIGHT?AXIS_V:AXIS_H);return}if(area.forced)return;let mov=-1;direction$1===DIR.UP||direction$1===DIR.DOWN?link.rect.toparea.bounds[1]&&(mov=Math.min(area.parent.scrollTop-area.bounds[1]+link.rect.bottom,area.finish)):link.rect.leftarea.bounds[1]&&(mov=Math.min(area.parent.scrollLeft-area.bounds[1]+link.rect.right,area.finish)),mov>-1&&area.parent.scrollTo({[area.moveby]:mov,behavior:`instant`})}function fireKey(element,direction$1){let key=DIR_KEYS[direction$1];key&&dispatchKey(key,element)}function handleUINavEvent(e,restrictTo=void 0){let d=e.detail,handled=!1;if(d.name in UI_SCALAR_EVENT_ACTIONS){let axis=UI_SCALAR_EVENT_ACTIONS[d.name],value=d.value;if(value!==0&&THUMBSTICK_DEADZONE>0&&Math.abs(value)>THUMBSTICK_DEADZONE){let adjustedValue=(axis===AXIS_V?-value:value)>0?1:-1,direction$1=axis===AXIS_H?adjustedValue>0?DIR.RIGHT:DIR.LEFT:adjustedValue>0?DIR.DOWN:DIR.UP;lastScalarValue[axis]!==adjustedValue&&(lastScalarValue[axis]=adjustedValue,navigate(collectRects(direction$1,restrictTo),direction$1))}else lastScalarValue[axis]=0;handled=!0}if(d.name in UI_NAV_EVENT_ACTIONS){let action=UI_NAV_EVENT_ACTIONS[d.name];switch(action){case`up`:case`down`:case`left`:case`right`:d.value==1&&(navigate(collectRects(action,restrictTo),action),handled=!0);break;case`confirm`:if(d.value==1){let activeEl=document.activeElement;isNavigable$1(activeEl)&&(typeof activeEl.click==`function`?activeEl.click():activeEl.dispatchEvent(new CustomEvent(`click`))),handled=!0}break}}else if(d.name in UI_SCROLL_EVENT_ACTIONS){let axis=UI_SCROLL_EVENT_ACTIONS[d.name];navigateScroll(axis,d.value),handled=isScrollListening(axis)}handled&&e.preventDefault()}var SCOPED_NAV_ATTR$1=`bng-scoped-nav`,UI_NAV_ACTION_GROUP$1=`UINavActions`,GAME_UI_NAVIGATION_EVENT$1=`UINavigation`,GAME_UI_NAV_MAP_ENABLED_EVENT$1=`MenuActionMapEnabled`,DOM_UI_NAVIGATION_EVENT$1=`ui_nav`,UI_SCOPE_ATTR$3=`bng-ui-scope`,UI_EVENT_ATTR$1=`ui-nav-event`,ACTIONS_BY_UI_EVENT$1={focus_u:`menu_item_up`,focus_r:`menu_item_right`,focus_d:`menu_item_down`,focus_l:`menu_item_left`,menu:`toggleMenues`,back:`menu_item_back`,details:`cui_details`,advanced:`cui_advanced`,camera:`cui_camera`,logs:`cui_logs`,tab_l:`menu_tab_left`,tab_r:`menu_tab_right`,modifier:`cui_modifier`,action_4:`cui_action_4`,focus_ud:`menu_item_focus_ud`,focus_lr:`menu_item_focus_lr`,rotate_h_cam:`menu_item_radial_right_x`,rotate_v_cam:`menu_item_radial_right_y`,ok:`menu_item_select`,cancel:`cui_cancel`,action_2:`cui_action_2`,action_3:`cui_action_3`,gameplay_interact:`cui_gameplay_interact`,context:`cui_context`},UI_EVENTS_BY_ACTION$1=Object.assign({},...Object.entries(ACTIONS_BY_UI_EVENT$1).map(([k,v])=>({[v]:k}))),UI_EVENTS$1={focus_u:`focus_u`,focus_r:`focus_r`,focus_d:`focus_d`,focus_l:`focus_l`,pause:`pause`,menu:`menu`,back:`back`,details:`details`,advanced:`advanced`,camera:`camera`,logs:`logs`,tab_l:`tab_l`,tab_r:`tab_r`,modifier:`modifier`,zoom_out:`zoom_out`,zoom_in:`zoom_in`,subtab_l:`subtab_l`,subtab_r:`subtab_r`,center_cam:`center_cam`,action_4:`action_4`,move_ud:`move_ud`,move_lr:`move_lr`,focus_ud:`focus_ud`,focus_lr:`focus_lr`,rotate_h_cam:`rotate_h_cam`,rotate_v_cam:`rotate_v_cam`,ok:`ok`,cancel:`cancel`,action_2:`action_2`,action_3:`action_3`,gameplay_interact:`gameplay_interact`,context:`context`},UI_EVENT_GROUPS$1={focusMove:[UI_EVENTS$1.focus_u,UI_EVENTS$1.focus_d,UI_EVENTS$1.focus_l,UI_EVENTS$1.focus_r],focusMoveScalar:[UI_EVENTS$1.focus_ud,UI_EVENTS$1.focus_lr],moveScalar:[UI_EVENTS$1.move_ud,UI_EVENTS$1.move_lr],navigation:[UI_EVENTS$1.focus_u,UI_EVENTS$1.focus_d,UI_EVENTS$1.focus_l,UI_EVENTS$1.focus_r,UI_EVENTS$1.focus_ud,UI_EVENTS$1.focus_lr,UI_EVENTS$1.move_ud,UI_EVENTS$1.move_lr],allEvents:Object.keys(ACTIONS_BY_UI_EVENT$1)},setFilteredEvents=(...events$3)=>{clearFilteredEvents();let actionsToFilter=[...new Set(events$3.flat(1/0))].map(event=>ACTIONS_BY_UI_EVENT$1[event]);Lua_default.extensions.core_input_actionFilter.setGroup(UI_NAV_ACTION_GROUP$1,actionsToFilter),Lua_default.extensions.core_input_actionFilter.addAction(0,UI_NAV_ACTION_GROUP$1,!0)};setFilteredEvents.allExcept=(...events$3)=>{let eventsToNotFilter=[...new Set(events$3.flat(1/0))];setFilteredEvents(UI_EVENT_GROUPS$1.allEvents.filter(ev=>!eventsToNotFilter.includes(ev)))};var clearFilteredEvents=()=>{Lua_default.extensions.core_input_actionFilter.addAction(0,UI_NAV_ACTION_GROUP$1,!1),Lua_default.extensions.core_input_actionFilter.setGroup(UI_NAV_ACTION_GROUP$1,[])};const clamp=(val,min$1,max$1)=>Math.min(Math.max(val,min$1),max$1),round=(val,step=1)=>{if(val===void 0)throw Error(`The function at least needs a value`);return Math.round(val/step+2**-52)*step},roundDec=(val,dec=0)=>{if(val===void 0)throw Error(`The function at least needs a value`);if(dec>15)throw Error(`Floating point won't be precise after 15th decimal`);if(val===0)return 0;if(!Number.isInteger(dec))throw Error(`Decimal point must be an integer`);let pow=10**dec;return Math.round(val*pow+2**-52)/pow},roundDecSample=(val,sample=0)=>{let dec=getDecimalPlaces(sample);return dec===0?round(val):roundDec(val,dec)},getDecimalPlaces=num=>{if(Number.isInteger(num)||!Number.isFinite(num))return 0;let dec=0;for(;!Number.isInteger(num)&&Number.isFinite(num)&&(num*=10,dec++,!(dec>15)););return dec};var UIUnits_default=class{uiUnits={uiUnitLength:`metric`,uiUnitTemperature:`f`,uiUnitWeight:`lb`,uiUnitConsumptionRate:`imperial`,uiUnitTorque:`imperial`,uiUnitEnergy:`imperial`,uiUnitDate:`us`,uiUnitPower:`bhp`,uiUnitVolume:`gal`,uiUnitPressure:`psi`};mapping={length:`uiUnitLength`,speed:`uiUnitLength`,temperature:`uiUnitTemperature`,weight:`uiUnitWeight`,consumptionRate:`uiUnitConsumptionRate`,torque:`uiUnitTorque`,energy:`uiUnitEnergy`,date:`uiUnitDate`,power:`uiUnitPower`,volume:`uiUnitVolume`,pressure:`uiUnitPressure`,lengthMinor:`uiUnitLength`};userSettings={uiLanguage:`en-US`};eventBus={};api={};constructor(eventBus$1,api$1){this.eventBus=eventBus$1,this.api=api$1,this.beamBucks=this.beamBucks.bind(this),this.eventBus.on(`SettingsChanged`,data=>this.onSettingsChanged(data)),api$1.engineLua(`settings.notifyUI()`)}onSettingsChanged(data){for(let name in this.uiUnits)data.values[name]!==void 0&&(this.uiUnits[name]=data.values[name]);for(let name in this.userSettings)data.values[name]!==void 0&&(this.userSettings[name]=data.values[name].replace(/_/g,`-`))}buildString(func,val,numDecs,system){if([`division`,`buildString`,`date`].includes(func)||typeof this[func]!=`function`)throw Error(`Cannot use this function to build a string`);this.mapping[func]!==void 0&&system===void 0&&(system=this.uiUnits[this.mapping[func]]);let helper=this[func](val,system);return helper===null?``:typeof helper.val==`string`?helper.val:typeof helper.val==`number`?(helper.val<0&&helper.val>-(10**-numDecs)&&(helper.val=0),Intl.NumberFormat(this.userSettings.uiLanguage,{style:`decimal`,minimumFractionDigits:numDecs,maximumFractionDigits:numDecs}).format(helper.val)+` `+helper.unit):``}division(func1,func2,val1,val2,numDecs,system1,system2){let unsupported=[`division`,`weightPower`,`buildString`,`date`];if(unsupported.includes(func1)||typeof this[func1]!=`function`||unsupported.includes(func2)||typeof this[func2]!=`function`)throw Error(`Cannot use these functions`);let helper1=this[func1](val1,system1),helper2=this[func2](val2,system2);if(helper1!==null&&helper2!==null){let newVal=helper1.val/helper2.val;return{val:numDecs===void 0?newVal:roundDec(newVal,numDecs),unit:`${helper1.unit}/${helper2.unit}`}}else return console.error(`got null`,arguments),null}weightPower(x){let helper=this.division(`weight`,`power`,1,1);return helper===null?null:{val:helper.val*x,unit:helper.unit}}length(meters,system=this.uiUnits.uiUnitLength){if(system===`metric`)return meters<.01?{val:meters*1e3,unit:`mm`}:meters<1?{val:meters*100,unit:`cm`}:meters<1e3?{val:meters,unit:`m`}:{val:meters*.001,unit:`km`};if(system===`imperial`){let yd=meters*1.0936;return yd<1?{val:yd*36,unit:`in`}:yd<3?{val:yd*3,unit:`ft`}:{val:yd*568182e-9,unit:`mi`}}return null}distance=this.length;lengthMinor(meters,system=this.uiUnits.uiUnitLength){return system===`metric`?{val:meters*1,unit:`m`}:system===`imperial`?{val:meters*1.0936*3,unit:`ft`}:null}area(squareMeters,system=this.uiUnits.uiUnitLength){if(system===`metric`)return squareMeters<1e3?{val:squareMeters,unit:`sq m`}:{val:squareMeters*.001*.001,unit:`sq km`};if(system===`imperial`){let sqrYards=squareMeters*1.0936*1.0936;return sqrYards<1760?{val:sqrYards,unit:`sq yd`}:{val:sqrYards*568182e-9*568182e-9,unit:`sq mi`}}return null}temperature(x,system=this.uiUnits.uiUnitTemperature){switch(system){case`c`:return{val:x,unit:`°C`};case`f`:return{val:x*1.8+32,unit:`°F`};case`k`:return{val:x+273.15,unit:`K`};default:return null}}volume(x,system=this.uiUnits.uiUnitVolume){switch(system){case`l`:return{val:x,unit:`L`};case`gal`:return{val:x*.2642,unit:`gal`};default:return null}}pressure(x,system=this.uiUnits.uiUnitPressure){switch(system){case`inHg`:return{val:x*.2953,unit:`in.Hg`};case`bar`:return{val:x*.01,unit:`Bar`};case`psi`:return{val:x*.145038,unit:`PSI`};case`kPa`:return{val:x,unit:`kPa`};default:return null}}weight(x,system=this.uiUnits.uiUnitWeight){switch(system){case`kg`:return{val:x,unit:`kg`};case`lb`:return{val:2.20462262*x,unit:`lbs`};default:return null}}consumptionRate(x,system=this.uiUnits.uiUnitConsumptionRate){switch(system){case`metric`:return{val:1e5*x>5e4?`n/a`:1e5*x,unit:`L/100km`};case`imperial`:return{val:x===0?0:235*1e-5/x,unit:`MPG`};default:return null}}speed(x,system=this.uiUnits.uiUnitLength){switch(system){case`metric`:return{val:3.6*x,unit:`km/h`};case`imperial`:return{val:2.23693629*x,unit:`mph`};default:return null}}power(x,system=this.uiUnits.uiUnitPower){switch(system){case`kw`:return{val:.735499*x,unit:`kW`};case`hp`:return{val:x,unit:`PS`};case`bhp`:return{val:.98632*x,unit:`bhp`};default:return null}}torque(x,system=this.uiUnits.uiUnitTorque){switch(system===`metric`?system=`kg`:system===`imperial`&&(system=`lb`),system){case`kg`:return{val:x,unit:`Nm`};case`lb`:return{val:.7375621495*x,unit:`lb-ft`};default:return null}}energy(x,system=this.uiUnits.uiUnitEnergy){switch(system===`metric`?system=`j`:system===`imperial`&&(system=`ft lb`),system){case`j`:return{val:x,unit:`J`};case`ft lb`:return{val:.7375621495*x,unit:`ft lb`};default:return null}}date(x,system=this.uiUnits.uiUnitDate){switch(system){case`ger`:return x.toLocaleDateString(`de-DE`);case`uk`:return x.toLocaleDateString(`en-GB`);case`us`:return x.toLocaleDateString(`en-US`);default:return null}}beamBucks(x){return Intl.NumberFormat(this.userSettings.uiLanguage,{style:`decimal`,maximumFractionDigits:2,minimumFractionDigits:2}).format(+x)}},lite_default=class{constructor(){this.processing=!1,this.pending=0,this.finishCallback=null,this.angularRootScope=window.globalAngularRootScope,this.angularTimeout=null,this.angularTimeoutRetry=null,this.angularTimeoutWarned=!1,this.safetyTimeout=2e3,this.safetyTimer=null,this.warned=!1}setAngularRootScope(rootScope){this.angularRootScope=rootScope,this.angularTimeout=null,this.angularTimeoutRetry&&=(clearTimeout(this.angularTimeoutRetry),null)}getAngularTimeout(){if(this.angularTimeout!==null)return typeof this.angularTimeout==`function`?this.angularTimeout:null;let code;this.angularTimeoutRetry&&(code=`retry`,clearTimeout(this.angularTimeoutRetry));try{if(window.angular!==void 0&&window.angular.element){let injector=window.angular.element(document).injector();if(injector)return this.angularTimeout=injector.get(`$timeout`),this.angularTimeoutWarned&&console.log(`Stream Coordinator: Angular $timeout service resolved after retry`),this.angularTimeout;code=`no-injector`}else code=`no-angular`}catch{code=`error`}return this.angularTimeout=!1,this.angularTimeoutRetry||=setTimeout(()=>{this.angularTimeout||=null},5e3),console.warn(`Stream Coordinator: Angular $timeout service not available (${code})`),this.angularTimeoutWarned=!0,null}beforeBroadcast(){this.processing||(this.processing=!0,this.finishCallback=null,this.pending=0,this.safetyTimer&&clearTimeout(this.safetyTimer),this.safetyTimer=setTimeout(()=>{this.processing&&this.forceComplete()},this.safetyTimeout))}afterBroadcast(callback){if(callback&&typeof callback==`function`?this.finishCallback=()=>{this.finishCallback=void 0,Promise.resolve().then(callback)}:this.finishCallback=void 0,!this.processing){this.finishCallback?.();return}this.startDeferredWork()}startDeferredWork(){this.pending=0;let angularTimeout=this.getAngularTimeout();angularTimeout&&(this.angularRootScope||=window.globalAngularRootScope,this.angularRootScope&&(this.pending++,angularTimeout(()=>this.onOperationComplete(),0))),window.Vue?.nextTick&&(this.pending++,window.Vue.nextTick(()=>this.onOperationComplete())),this.pending===0&&(this.warned||(this.warned=!0,console.warn(`Stream Coordinator: No Angular $timeout() nor Vue.nextTick() detected, using only Promise microtask instead`)),this.complete())}onOperationComplete(){this.processing&&(this.pending--,this.pending<=0&&this.complete())}complete(){this.processing&&(this.safetyTimer&&=(clearTimeout(this.safetyTimer),null),Promise.resolve().then(()=>{this.processing=!1,window.beamng?.uiFrameCallback?.(),this.finishCallback?.()}))}forceComplete(){this.complete()}},dependencies,bridge$3;const useBridge=()=>{if(bridge$3)return bridge$3;if(window.bridge)return bridge$3=window.bridge;let events$3=new dependencies.Emitter,coordinator=new lite_default(events$3);Hooks_default.setStreamCoordinator(coordinator);let api$1=dependencies.overrideAPI||new BeamNGAPI_default(events$3,dependencies.beamng);return bridge$3={api:api$1,lua:Lua_default,events:events$3,streams:new StreamManager_default(api$1),coordinator,hooks:Hooks_default,units:new UIUnits_default(events$3,api$1),gameBlurrer:GameBlurrer_default,beamNG:dependencies.beamng},bridge$3},setBridgeDependencies=deps$1=>dependencies=deps$1;var DEBUG=1,INFO=2,WARN=4,ERROR=8,consoleLogMethods={[DEBUG]:`log`,[INFO]:`info`,[WARN]:`warn`,[ERROR]:`error`},consoleLogProvider={log(level$1,...msgs){level$1 in consoleLogMethods&&console[consoleLogMethods[level$1]](...msgs)}},level=14,providersInUse=[consoleLogProvider],STACK_TRACE=Symbol(`Stack trace`),_stackTrace=()=>`
`+Error().stack,_log=(lvl,...msgs)=>{level&lvl&&(msgs=msgs.map(msg=>msg===STACK_TRACE?_stackTrace():msg),providersInUse.forEach(p$1=>p$1.log&&p$1.log(lvl,...msgs)))},_assert=async(lvl,cond,...msgs)=>{level&lvl&&(cond?cond instanceof Promise?cond.then(res=>!res&&_log(lvl,...msgs)):typeof cond==`function`&&!await cond()&&_log(lvl,...msgs):_log(lvl,...msgs))},logger={DEBUG,INFO,WARN,ERROR,setProviders:(...providers)=>providersInUse=providers,set level(val){return level=val},get level(){return level},STACK_TRACE,log:(...msgs)=>_log(DEBUG,...msgs),debug:(...msgs)=>_log(DEBUG,...msgs),info:(...msgs)=>_log(INFO,...msgs),warn:(...msgs)=>_log(WARN,...msgs),error:(...msgs)=>_log(ERROR,...msgs),assert:(cond,...msgs)=>_assert(DEBUG,cond,...msgs),assertDebug:(cond,...msgs)=>_assert(DEBUG,cond,...msgs),assertInfo:(cond,...msgs)=>_assert(INFO,cond,...msgs),assertWarn:(cond,...msgs)=>_assert(WARN,cond,...msgs),assertError:(cond,...msgs)=>_assert(ERROR,cond,...msgs)};window.BNG_Logger=logger;var logger_default=logger;function warn(msg,err){typeof console<`u`&&(console.warn(`[intlify] `+msg),err&&console.warn(err.stack))}var inBrowser=typeof window<`u`,makeSymbol=(name,shareable=!1)=>shareable?Symbol.for(name):Symbol(name),generateFormatCacheKey=(locale,key,source)=>friendlyJSONstringify({l:locale,k:key,s:source}),friendlyJSONstringify=json=>JSON.stringify(json).replace(/\u2028/g,`\\u2028`).replace(/\u2029/g,`\\u2029`).replace(/\u0027/g,`\\u0027`),isNumber=val=>typeof val==`number`&&isFinite(val),isRegExp=val=>toTypeString(val)===`[object RegExp]`,isEmptyObject=val=>isPlainObject(val)&&Object.keys(val).length===0,assign$1=Object.assign,_create=Object.create,create=(obj=null)=>_create(obj),_globalThis,getGlobalThis=()=>_globalThis||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:create();function escapeHtml(rawText){return rawText.replace(/&/g,`&`).replace(//g,`>`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/\//g,`/`).replace(/=/g,`=`)}function escapeAttributeValue(value){return value.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,`&`).replace(/"/g,`"`).replace(/'/g,`'`).replace(//g,`>`)}function sanitizeTranslatedHtml(html){return html=html.replace(/(\w+)\s*=\s*"([^"]*)"/g,(_,attrName,attrValue)=>`${attrName}="${escapeAttributeValue(attrValue)}"`),html=html.replace(/(\w+)\s*=\s*'([^']*)'/g,(_,attrName,attrValue)=>`${attrName}='${escapeAttributeValue(attrValue)}'`),/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(html)&&(html=html.replace(/(\s+)(on)(\w+\s*=)/gi,`$1on$3`)),[/(\s+(?:href|src|action|formaction)\s*=\s*["']?)\s*javascript:/gi,/(style\s*=\s*["'][^"']*url\s*\(\s*)javascript:/gi].forEach(pattern=>{html=html.replace(pattern,`$1javascript:`)}),html}var hasOwnProperty=Object.prototype.hasOwnProperty;function hasOwn(obj,key){return hasOwnProperty.call(obj,key)}var isArray$1=Array.isArray,isFunction=val=>typeof val==`function`,isString=val=>typeof val==`string`,isBoolean=val=>typeof val==`boolean`,isObject=val=>typeof val==`object`&&!!val,isPromise=val=>isObject(val)&&isFunction(val.then)&&isFunction(val.catch),objectToString=Object.prototype.toString,toTypeString=value=>objectToString.call(value),isPlainObject=val=>toTypeString(val)===`[object Object]`,toDisplayString$1=val=>val==null?``:isArray$1(val)||isPlainObject(val)&&val.toString===objectToString?JSON.stringify(val,null,2):String(val);function join(items$2,separator=``){return items$2.reduce((str,item,index)=>index===0?str+item:str+separator+item,``)}var isNotObjectOrIsArray=val=>!isObject(val)||isArray$1(val);function deepCopy(src,des){if(isNotObjectOrIsArray(src)||isNotObjectOrIsArray(des))throw Error(`Invalid value`);let stack$2=[{src,des}];for(;stack$2.length;){let{src:src$1,des:des$1}=stack$2.pop();Object.keys(src$1).forEach(key=>{key!==`__proto__`&&(isObject(src$1[key])&&!isObject(des$1[key])&&(des$1[key]=Array.isArray(src$1[key])?[]:create()),isNotObjectOrIsArray(des$1[key])||isNotObjectOrIsArray(src$1[key])?des$1[key]=src$1[key]:stack$2.push({src:src$1[key],des:des$1[key]}))})}}function createPosition(line,column,offset$2){return{line,column,offset:offset$2}}function createLocation(start,end,source){let loc={start,end};return source!=null&&(loc.source=source),loc}var CompileErrorCodes={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16},COMPILE_ERROR_CODES_EXTEND_POINT=17,errorMessages={[CompileErrorCodes.EXPECTED_TOKEN]:`Expected token: '{0}'`,[CompileErrorCodes.INVALID_TOKEN_IN_PLACEHOLDER]:`Invalid token in placeholder: '{0}'`,[CompileErrorCodes.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]:`Unterminated single quote in placeholder`,[CompileErrorCodes.UNKNOWN_ESCAPE_SEQUENCE]:`Unknown escape sequence: \\{0}`,[CompileErrorCodes.INVALID_UNICODE_ESCAPE_SEQUENCE]:`Invalid unicode escape sequence: {0}`,[CompileErrorCodes.UNBALANCED_CLOSING_BRACE]:`Unbalanced closing brace`,[CompileErrorCodes.UNTERMINATED_CLOSING_BRACE]:`Unterminated closing brace`,[CompileErrorCodes.EMPTY_PLACEHOLDER]:`Empty placeholder`,[CompileErrorCodes.NOT_ALLOW_NEST_PLACEHOLDER]:`Not allowed nest placeholder`,[CompileErrorCodes.INVALID_LINKED_FORMAT]:`Invalid linked format`,[CompileErrorCodes.MUST_HAVE_MESSAGES_IN_PLURAL]:`Plural must have messages`,[CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_MODIFIER]:`Unexpected empty linked modifier`,[CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_KEY]:`Unexpected empty linked key`,[CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS]:`Unexpected lexical analysis in token: '{0}'`,[CompileErrorCodes.UNHANDLED_CODEGEN_NODE_TYPE]:`unhandled codegen node type: '{0}'`,[CompileErrorCodes.UNHANDLED_MINIFIER_NODE_TYPE]:`unhandled mimifier node type: '{0}'`};function createCompileError(code,loc,options={}){let{domain,messages,args}=options,msg=code,error=SyntaxError(String(msg));return error.code=code,loc&&(error.location=loc),error.domain=domain,error}function defaultOnError(error){throw error}var CHAR_SP=` `,CHAR_CR=`\r`,CHAR_LF=`
Parent:`,parent$1,`
Child:`,prioNode),warnPrioNesting=!0)}let active=document.activeElement;(!active||!prioNode.contains(active))&&(rectNode=prioNode)}let rect=rectNode.getBoundingClientRect();if(rect.right<0||rect.bottom<0||rect.left>screen.width||rect.top>screen.height){node.classList.remove(MENU_NAVIGATION_CLASS);continue}node.classList.add(MENU_NAVIGATION_CLASS),node.tabIndex=0;let lnk={dom:node,rect};links.up&&links.up.push(lnk),links.down&&links.down.push(lnk),links.left&&links.left.push(lnk),links.right&&links.right.push(lnk)}return links.up&&links.up.sort((a$1,b)=>a$1.rect.top-b.rect.top),links.down&&links.down.sort((a$1,b)=>a$1.rect.bottom-b.rect.bottom),links.left&&links.left.sort((a$1,b)=>a$1.rect.left-b.rect.left),links.right&&links.right.sort((a$1,b)=>a$1.rect.right-b.rect.right),links}function isAvailable(node){if(!isVisibleFast(node))return!1;let style=document.defaultView.getComputedStyle(node,null);return style[`pointer-events`]===`none`||!isVisible(node,style)?!1:!isOccluded(node)}function isOccluded(node,dontIgnoreOffscreen=!1){let rects=node.getClientRects();for(let rect of rects)if(!isOccluded$1(node,rect,dontIgnoreOffscreen))return!1;return!0}function getDistanceFast(curr,goal,direction$1,usePerpendicular=!1){let dx=Math.min(goal.right,curr.right)-Math.max(goal.left,curr.left),dy=Math.min(goal.bottom,curr.bottom)-Math.max(goal.top,curr.top);dx===goal.right-goal.left&&(dx=curr.right-goal.left),dy===goal.bottom-goal.top&&(dy=curr.bottom-goal.top);let res=1/0;if(direction$1===DIR.DOWN&&goal.bottom>curr.bottom?res=Math.max(0,goal.bottom-curr.top)-dx:direction$1===DIR.UP&&goal.topcurr.right?res=Math.max(0,goal.left-curr.right)-dy:direction$1===DIR.LEFT&&goal.left{let firstLink=null,firstElementDistance=2**53-1;for(let link of links){let distance=link.rect.top*link.rect.top+link.rect.left*link.rect.left;distance>firstElementDistance||(firstElementDistance=distance,firstLink=link)}if(!firstLink){console.log(`Couldn't locate any button anywhere. Menu navigation won't work`);return}focusOnElement(firstLink.dom),scrollFix(firstLink,direction$1)}),!0;if(active.nodeName===`MD-SLIDER`&&(direction$1===DIR.LEFT||direction$1===DIR.RIGHT)||active.nodeName===`MD-OPTION`&&(direction$1===DIR.UP||direction$1===DIR.DOWN)||active.nodeName===`INPUT`&&active.type===`range`&&(direction$1===DIR.LEFT||direction$1===DIR.RIGHT))return fireKey(active,direction$1),!0;let{nearestLink,fixScroll}=findNext(links,direction$1,active);if(nearestLink)return focusOnElement(nearestLink.dom),fixScroll?.(),nearestLink.dom;if(links.length===0){let mdBackdrops=[...document.querySelectorAll(`md-backdrop, .md-scroll-mask`)];if(mdBackdrops.length>0){for(let el of mdBackdrops)try{el.parentNode.removeChild(el)}catch{}return navigateNext(links,direction$1,activeOverride)}}return!1}function findNext(links,direction$1,activeOverride=null){let active=activeOverride||document.activeElement,activeRect=active.getBoundingClientRect(),fixScroll=!0;if(isScrolling(direction$1)&&isOccluded(active,activeRect,!0)){let axis,boundsame,boundchange;switch(direction$1){case DIR.UP:case DIR.DOWN:axis=`vertical`,boundsame=[`left`,`right`],boundchange=[`top`,`bottom`];break;case DIR.LEFT:case DIR.RIGHT:axis=`horizontal`,boundsame=[`top`,`bottom`],boundchange=[`left`,`right`];break}if(navScrolling[axis].area){let bounds=navScrolling[axis].area.bounds,axisBound=activeRect[boundchange[1]]scrollFix(nearestLink,direction$1):null}}var navScrolling={running:!1,listening:{vertical:!1,horizontal:!1},dom:null,rect:null,vertical:{active:!1,amount:0,area:null},horizontal:{active:!1,amount:0,area:null},hint:{show:!1}};function drawScrollHint(){let show=isScrolling();if(navScrolling.hint.show===show)return;navScrolling.hint.show=show;let elem=document.getElementById(`xf_scroll`);elem&&(elem.style.display=show?``:`none`)}function navigateScroll(axis,amount){if(axis===AXIS_V&&(amount=-amount),navScrolling[axis].amount=amount*15,Math.abs(navScrolling[axis].amount)<1){navScrolling[axis].active=!1;return}navScrolling[axis].active=!0;let dom=document.activeElement;navScrolling.dom!==dom&&(navScrolling.dom=dom,navScrolling.rect=dom.getBoundingClientRect(),navScrolling[axis===AXIS_H?AXIS_V:AXIS_H].active=!1);let area=findScrollable(navScrolling,axis,!0);if(navScrolling[axis].area=area,!area){navScrolling[axis].active=!1;return}return navScrolling.running||window.requestAnimationFrame(function scrl(){let set={};for(let axis$1 of[AXIS_V,AXIS_H]){let cur=navScrolling[axis$1];if(!cur.active||!cur.area)continue;let pos=cur.area.parent[cur.area.readby]+navScrolling[axis$1].amount;pos>cur.area.fullsize?cur.active=!1:set[cur.area.moveby]=pos}navScrolling.running=Object.keys(set).length>0,navScrolling.running&&(area.parent.scrollTo({...set,behavior:`instant`}),document.dispatchEvent(new CustomEvent(`mdtooltiphide`)),window.requestAnimationFrame(scrl))}),!0}function scrollCatch(axis,enable){if(navScrolling.listening[axis]===enable)return;let cur=isScrolling();navScrolling.listening[axis]=enable,cur!==isScrolling()&&(bngApi.engineLua(`local o = scenetree.findObject("MenuScrollActionMap"); if o then o:${enable?`push`:`pop`}() end`),window.bngVue.uiNavTracker&&(enable?window.bngVue.uiNavTracker.addEvent(UI_SCROLL_ACTION_EVENTS[axis],TRACKER_ID):window.bngVue.uiNavTracker.removeEvent(UI_SCROLL_ACTION_EVENTS[axis],TRACKER_ID)))}function isScrolling(direction$1=void 0){let scrolling=!1;return direction$1?direction$1===DIR.UP||direction$1===DIR.DOWN?scrolling=navScrolling.listening.vertical:(direction$1===DIR.LEFT||direction$1===DIR.RIGHT)&&(scrolling=navScrolling.listening.horizontal):scrolling=navScrolling.listening.horizontal||navScrolling.listening.vertical,scrolling}function isScrollListening(axis=void 0){let listening=!1;return listening=axis?navScrolling.listening[axis]:navScrolling.listening.horizontal||navScrolling.listening.vertical,listening}function findScrollable(link,axis,thumbstick){axis!==AXIS_V&&axis!==AXIS_H&&(axis=AXIS_V);let opts=axis===AXIS_H?{moveby:`left`,readby:`scrollLeft`,size:`width`,scroll:`scrollWidth`,client:`clientWidth`,overflow:`overflow-x`}:{moveby:`top`,readby:`scrollTop`,size:`height`,scroll:`scrollHeight`,client:`clientHeight`,overflow:`overflow-y`},forced=!1,parent,fullsize,size$3,node=link.dom?.parentNode;function setParent(node$1){if(!node$1)return;if(thumbstick){let noNav=node$1.attributes.getNamedItem(SCROLL_ATTR);if(noNav&&noNav.value===`false`)return}let styles$1=document.defaultView.getComputedStyle(node$1,null);(styles$1[opts.overflow]===`auto`||styles$1[opts.overflow]===`scroll`)&&(fullsize=node$1[opts.scroll],size$3=node$1[opts.client],fullsize>size$3&&(parent=node$1))}for(;node&&node.isConnected&&node.nodeType===Node.ELEMENT_NODE&&!((!thumbstick||node.attributes.getNamedItem(`bng-nav-scroll`))&&(setParent(node),parent));)node=node.parentNode;if(!parent){let elems$2=document.querySelectorAll(`[${SCROLL_FORCE_ATTR}]`);for(let elem of elems$2)if(setParent(elem),parent){forced=!0;break}}if(scrollCatch(axis,!!parent),drawScrollHint(),!parent)return null;let start=0,styles=document.defaultView.getComputedStyle(parent,null);[`relative`,`absolute`,`static`,`fixed`].includes(styles.position)&&(start+=parent.getBoundingClientRect()[opts.moveby]);let pad=link.rect?Math.max(size$3/4,link.rect[opts.size]):size$3/4,bounds=[start+pad,start+size$3-pad];return{parent,moveby:opts.moveby,readby:opts.readby,bounds,fullsize,start:0,finish:fullsize-size$3,forced}}function scrollFix(link,direction$1){let area=findScrollable(link,direction$1===DIR.UP||direction$1===DIR.DOWN?AXIS_V:AXIS_H);if(!area){document.querySelector(`[bng-nav-scroll], [bng-nav-scroll-force]`)&&findScrollable(link,direction$1===DIR.LEFT||direction$1===DIR.RIGHT?AXIS_V:AXIS_H);return}if(area.forced)return;let mov=-1;direction$1===DIR.UP||direction$1===DIR.DOWN?link.rect.toparea.bounds[1]&&(mov=Math.min(area.parent.scrollTop-area.bounds[1]+link.rect.bottom,area.finish)):link.rect.leftarea.bounds[1]&&(mov=Math.min(area.parent.scrollLeft-area.bounds[1]+link.rect.right,area.finish)),mov>-1&&area.parent.scrollTo({[area.moveby]:mov,behavior:`instant`})}function fireKey(element,direction$1){let key=DIR_KEYS[direction$1];key&&dispatchKey(key,element)}function handleUINavEvent(e,restrictTo=void 0){let d=e.detail,handled=!1;if(d.name in UI_SCALAR_EVENT_ACTIONS){let axis=UI_SCALAR_EVENT_ACTIONS[d.name],value=d.value;if(value!==0&&THUMBSTICK_DEADZONE>0&&Math.abs(value)>THUMBSTICK_DEADZONE){let adjustedValue=(axis===AXIS_V?-value:value)>0?1:-1,direction$1=axis===AXIS_H?adjustedValue>0?DIR.RIGHT:DIR.LEFT:adjustedValue>0?DIR.DOWN:DIR.UP;lastScalarValue[axis]!==adjustedValue&&(lastScalarValue[axis]=adjustedValue,navigate(collectRects(direction$1,restrictTo),direction$1))}else lastScalarValue[axis]=0;handled=!0}if(d.name in UI_NAV_EVENT_ACTIONS){let action=UI_NAV_EVENT_ACTIONS[d.name];switch(action){case`up`:case`down`:case`left`:case`right`:d.value==1&&(navigate(collectRects(action,restrictTo),action),handled=!0);break;case`confirm`:if(d.value==1){let activeEl=document.activeElement;isNavigable$1(activeEl)&&(typeof activeEl.click==`function`?activeEl.click():activeEl.dispatchEvent(new CustomEvent(`click`))),handled=!0}break}}else if(d.name in UI_SCROLL_EVENT_ACTIONS){let axis=UI_SCROLL_EVENT_ACTIONS[d.name];navigateScroll(axis,d.value),handled=isScrollListening(axis)}handled&&e.preventDefault()}var SCOPED_NAV_ATTR$1=`bng-scoped-nav`,UI_NAV_ACTION_GROUP$1=`UINavActions`,GAME_UI_NAVIGATION_EVENT$1=`UINavigation`,GAME_UI_NAV_MAP_ENABLED_EVENT$1=`MenuActionMapEnabled`,DOM_UI_NAVIGATION_EVENT$1=`ui_nav`,UI_SCOPE_ATTR$3=`bng-ui-scope`,UI_EVENT_ATTR$1=`ui-nav-event`,ACTIONS_BY_UI_EVENT$1={focus_u:`menu_item_up`,focus_r:`menu_item_right`,focus_d:`menu_item_down`,focus_l:`menu_item_left`,menu:`toggleMenues`,back:`menu_item_back`,details:`cui_details`,advanced:`cui_advanced`,camera:`cui_camera`,logs:`cui_logs`,tab_l:`menu_tab_left`,tab_r:`menu_tab_right`,modifier:`cui_modifier`,action_4:`cui_action_4`,focus_ud:`menu_item_focus_ud`,focus_lr:`menu_item_focus_lr`,rotate_h_cam:`menu_item_radial_right_x`,rotate_v_cam:`menu_item_radial_right_y`,ok:`menu_item_select`,cancel:`cui_cancel`,action_2:`cui_action_2`,action_3:`cui_action_3`,gameplay_interact:`cui_gameplay_interact`,context:`cui_context`},UI_EVENTS_BY_ACTION$1=Object.assign({},...Object.entries(ACTIONS_BY_UI_EVENT$1).map(([k,v])=>({[v]:k}))),UI_EVENTS$1={focus_u:`focus_u`,focus_r:`focus_r`,focus_d:`focus_d`,focus_l:`focus_l`,pause:`pause`,menu:`menu`,back:`back`,details:`details`,advanced:`advanced`,camera:`camera`,logs:`logs`,tab_l:`tab_l`,tab_r:`tab_r`,modifier:`modifier`,zoom_out:`zoom_out`,zoom_in:`zoom_in`,subtab_l:`subtab_l`,subtab_r:`subtab_r`,center_cam:`center_cam`,action_4:`action_4`,move_ud:`move_ud`,move_lr:`move_lr`,focus_ud:`focus_ud`,focus_lr:`focus_lr`,rotate_h_cam:`rotate_h_cam`,rotate_v_cam:`rotate_v_cam`,ok:`ok`,cancel:`cancel`,action_2:`action_2`,action_3:`action_3`,gameplay_interact:`gameplay_interact`,context:`context`},UI_EVENT_GROUPS$1={focusMove:[UI_EVENTS$1.focus_u,UI_EVENTS$1.focus_d,UI_EVENTS$1.focus_l,UI_EVENTS$1.focus_r],focusMoveScalar:[UI_EVENTS$1.focus_ud,UI_EVENTS$1.focus_lr],moveScalar:[UI_EVENTS$1.move_ud,UI_EVENTS$1.move_lr],navigation:[UI_EVENTS$1.focus_u,UI_EVENTS$1.focus_d,UI_EVENTS$1.focus_l,UI_EVENTS$1.focus_r,UI_EVENTS$1.focus_ud,UI_EVENTS$1.focus_lr,UI_EVENTS$1.move_ud,UI_EVENTS$1.move_lr],allEvents:Object.keys(ACTIONS_BY_UI_EVENT$1)},setFilteredEvents=(...events$3)=>{clearFilteredEvents();let actionsToFilter=[...new Set(events$3.flat(1/0))].map(event=>ACTIONS_BY_UI_EVENT$1[event]);Lua_default.extensions.core_input_actionFilter.setGroup(UI_NAV_ACTION_GROUP$1,actionsToFilter),Lua_default.extensions.core_input_actionFilter.addAction(0,UI_NAV_ACTION_GROUP$1,!0)};setFilteredEvents.allExcept=(...events$3)=>{let eventsToNotFilter=[...new Set(events$3.flat(1/0))];setFilteredEvents(UI_EVENT_GROUPS$1.allEvents.filter(ev=>!eventsToNotFilter.includes(ev)))};var clearFilteredEvents=()=>{Lua_default.extensions.core_input_actionFilter.addAction(0,UI_NAV_ACTION_GROUP$1,!1),Lua_default.extensions.core_input_actionFilter.setGroup(UI_NAV_ACTION_GROUP$1,[])};const clamp=(val,min$1,max$1)=>Math.min(Math.max(val,min$1),max$1),round=(val,step=1)=>{if(val===void 0)throw Error(`The function at least needs a value`);return Math.round(val/step+2**-52)*step},roundDec=(val,dec=0)=>{if(val===void 0)throw Error(`The function at least needs a value`);if(dec>15)throw Error(`Floating point won't be precise after 15th decimal`);if(val===0)return 0;if(!Number.isInteger(dec))throw Error(`Decimal point must be an integer`);let pow=10**dec;return Math.round(val*pow+2**-52)/pow},roundDecSample=(val,sample=0)=>{let dec=getDecimalPlaces(sample);return dec===0?round(val):roundDec(val,dec)},getDecimalPlaces=num=>{if(Number.isInteger(num)||!Number.isFinite(num))return 0;let dec=0;for(;!Number.isInteger(num)&&Number.isFinite(num)&&(num*=10,dec++,!(dec>15)););return dec};var UIUnits_default=class{uiUnits={uiUnitLength:`metric`,uiUnitTemperature:`f`,uiUnitWeight:`lb`,uiUnitConsumptionRate:`imperial`,uiUnitTorque:`imperial`,uiUnitEnergy:`imperial`,uiUnitDate:`us`,uiUnitPower:`bhp`,uiUnitVolume:`gal`,uiUnitPressure:`psi`};mapping={length:`uiUnitLength`,speed:`uiUnitLength`,temperature:`uiUnitTemperature`,weight:`uiUnitWeight`,consumptionRate:`uiUnitConsumptionRate`,torque:`uiUnitTorque`,energy:`uiUnitEnergy`,date:`uiUnitDate`,power:`uiUnitPower`,volume:`uiUnitVolume`,pressure:`uiUnitPressure`,lengthMinor:`uiUnitLength`};userSettings={uiLanguage:`en-US`};eventBus={};api={};constructor(eventBus$1,api$1){this.eventBus=eventBus$1,this.api=api$1,this.beamBucks=this.beamBucks.bind(this),this.eventBus.on(`SettingsChanged`,data=>this.onSettingsChanged(data)),api$1.engineLua(`settings.notifyUI()`)}onSettingsChanged(data){for(let name in this.uiUnits)data.values[name]!==void 0&&(this.uiUnits[name]=data.values[name]);for(let name in this.userSettings)data.values[name]!==void 0&&(this.userSettings[name]=data.values[name].replace(/_/g,`-`))}buildString(func,val,numDecs,system){if([`division`,`buildString`,`date`].includes(func)||typeof this[func]!=`function`)throw Error(`Cannot use this function to build a string`);this.mapping[func]!==void 0&&system===void 0&&(system=this.uiUnits[this.mapping[func]]);let helper=this[func](val,system);return helper===null?``:typeof helper.val==`string`?helper.val:typeof helper.val==`number`?(helper.val<0&&helper.val>-(10**-numDecs)&&(helper.val=0),Intl.NumberFormat(this.userSettings.uiLanguage,{style:`decimal`,minimumFractionDigits:numDecs,maximumFractionDigits:numDecs}).format(helper.val)+` `+helper.unit):``}division(func1,func2,val1,val2,numDecs,system1,system2){let unsupported=[`division`,`weightPower`,`buildString`,`date`];if(unsupported.includes(func1)||typeof this[func1]!=`function`||unsupported.includes(func2)||typeof this[func2]!=`function`)throw Error(`Cannot use these functions`);let helper1=this[func1](val1,system1),helper2=this[func2](val2,system2);if(helper1!==null&&helper2!==null){let newVal=helper1.val/helper2.val;return{val:numDecs===void 0?newVal:roundDec(newVal,numDecs),unit:`${helper1.unit}/${helper2.unit}`}}else return console.error(`got null`,arguments),null}weightPower(x){let helper=this.division(`weight`,`power`,1,1);return helper===null?null:{val:helper.val*x,unit:helper.unit}}length(meters,system=this.uiUnits.uiUnitLength){if(system===`metric`)return meters<.01?{val:meters*1e3,unit:`mm`}:meters<1?{val:meters*100,unit:`cm`}:meters<1e3?{val:meters,unit:`m`}:{val:meters*.001,unit:`km`};if(system===`imperial`){let yd=meters*1.0936;return yd<1?{val:yd*36,unit:`in`}:yd<3?{val:yd*3,unit:`ft`}:{val:yd*568182e-9,unit:`mi`}}return null}distance=this.length;lengthMinor(meters,system=this.uiUnits.uiUnitLength){return system===`metric`?{val:meters*1,unit:`m`}:system===`imperial`?{val:meters*1.0936*3,unit:`ft`}:null}area(squareMeters,system=this.uiUnits.uiUnitLength){if(system===`metric`)return squareMeters<1e3?{val:squareMeters,unit:`sq m`}:{val:squareMeters*.001*.001,unit:`sq km`};if(system===`imperial`){let sqrYards=squareMeters*1.0936*1.0936;return sqrYards<1760?{val:sqrYards,unit:`sq yd`}:{val:sqrYards*568182e-9*568182e-9,unit:`sq mi`}}return null}temperature(x,system=this.uiUnits.uiUnitTemperature){switch(system){case`c`:return{val:x,unit:`°C`};case`f`:return{val:x*1.8+32,unit:`°F`};case`k`:return{val:x+273.15,unit:`K`};default:return null}}volume(x,system=this.uiUnits.uiUnitVolume){switch(system){case`l`:return{val:x,unit:`L`};case`gal`:return{val:x*.2642,unit:`gal`};default:return null}}pressure(x,system=this.uiUnits.uiUnitPressure){switch(system){case`inHg`:return{val:x*.2953,unit:`in.Hg`};case`bar`:return{val:x*.01,unit:`Bar`};case`psi`:return{val:x*.145038,unit:`PSI`};case`kPa`:return{val:x,unit:`kPa`};default:return null}}weight(x,system=this.uiUnits.uiUnitWeight){switch(system){case`kg`:return{val:x,unit:`kg`};case`lb`:return{val:2.20462262*x,unit:`lbs`};default:return null}}consumptionRate(x,system=this.uiUnits.uiUnitConsumptionRate){switch(system){case`metric`:return{val:1e5*x>5e4?`n/a`:1e5*x,unit:`L/100km`};case`imperial`:return{val:x===0?0:235*1e-5/x,unit:`MPG`};default:return null}}speed(x,system=this.uiUnits.uiUnitLength){switch(system){case`metric`:return{val:3.6*x,unit:`km/h`};case`imperial`:return{val:2.23693629*x,unit:`mph`};default:return null}}power(x,system=this.uiUnits.uiUnitPower){switch(system){case`kw`:return{val:.735499*x,unit:`kW`};case`hp`:return{val:x,unit:`PS`};case`bhp`:return{val:.98632*x,unit:`bhp`};default:return null}}torque(x,system=this.uiUnits.uiUnitTorque){switch(system===`metric`?system=`kg`:system===`imperial`&&(system=`lb`),system){case`kg`:return{val:x,unit:`Nm`};case`lb`:return{val:.7375621495*x,unit:`lb-ft`};default:return null}}energy(x,system=this.uiUnits.uiUnitEnergy){switch(system===`metric`?system=`j`:system===`imperial`&&(system=`ft lb`),system){case`j`:return{val:x,unit:`J`};case`ft lb`:return{val:.7375621495*x,unit:`ft lb`};default:return null}}date(x,system=this.uiUnits.uiUnitDate){switch(system){case`ger`:return x.toLocaleDateString(`de-DE`);case`uk`:return x.toLocaleDateString(`en-GB`);case`us`:return x.toLocaleDateString(`en-US`);default:return null}}beamBucks(x){return Intl.NumberFormat(this.userSettings.uiLanguage,{style:`decimal`,maximumFractionDigits:2,minimumFractionDigits:2}).format(+x)}},lite_default=class{constructor(){this.processing=!1,this.pending=0,this.finishCallback=null,this.angularRootScope=window.globalAngularRootScope,this.angularTimeout=null,this.angularTimeoutRetry=null,this.angularTimeoutWarned=!1,this.safetyTimeout=2e3,this.safetyTimer=null,this.warned=!1}setAngularRootScope(rootScope){this.angularRootScope=rootScope,this.angularTimeout=null,this.angularTimeoutRetry&&=(clearTimeout(this.angularTimeoutRetry),null)}getAngularTimeout(){if(this.angularTimeout!==null)return typeof this.angularTimeout==`function`?this.angularTimeout:null;let code;this.angularTimeoutRetry&&(code=`retry`,clearTimeout(this.angularTimeoutRetry));try{if(window.angular!==void 0&&window.angular.element){let injector=window.angular.element(document).injector();if(injector)return this.angularTimeout=injector.get(`$timeout`),this.angularTimeoutWarned&&console.log(`Stream Coordinator: Angular $timeout service resolved after retry`),this.angularTimeout;code=`no-injector`}else code=`no-angular`}catch{code=`error`}return this.angularTimeout=!1,this.angularTimeoutRetry||=setTimeout(()=>{this.angularTimeout||=null},5e3),console.warn(`Stream Coordinator: Angular $timeout service not available (${code})`),this.angularTimeoutWarned=!0,null}beforeBroadcast(){this.processing||(this.processing=!0,this.finishCallback=null,this.pending=0,this.safetyTimer&&clearTimeout(this.safetyTimer),this.safetyTimer=setTimeout(()=>{this.processing&&this.forceComplete()},this.safetyTimeout))}afterBroadcast(callback){if(callback&&typeof callback==`function`?this.finishCallback=()=>{this.finishCallback=void 0,Promise.resolve().then(callback)}:this.finishCallback=void 0,!this.processing){this.finishCallback?.();return}this.startDeferredWork()}startDeferredWork(){this.pending=0;let angularTimeout=this.getAngularTimeout();angularTimeout&&(this.angularRootScope||=window.globalAngularRootScope,this.angularRootScope&&(this.pending++,angularTimeout(()=>this.onOperationComplete(),0))),window.Vue?.nextTick&&(this.pending++,window.Vue.nextTick(()=>this.onOperationComplete())),this.pending===0&&(this.warned||(this.warned=!0,console.warn(`Stream Coordinator: No Angular $timeout() nor Vue.nextTick() detected, using only Promise microtask instead`)),this.complete())}onOperationComplete(){this.processing&&(this.pending--,this.pending<=0&&this.complete())}complete(){this.processing&&(this.safetyTimer&&=(clearTimeout(this.safetyTimer),null),Promise.resolve().then(()=>{this.processing=!1,window.beamng?.uiFrameCallback?.(),this.finishCallback?.()}))}forceComplete(){this.complete()}},dependencies,bridge$3;const useBridge=()=>{if(bridge$3)return bridge$3;if(window.bridge)return bridge$3=window.bridge;let events$3=new dependencies.Emitter,coordinator=new lite_default(events$3);Hooks_default.setStreamCoordinator(coordinator);let api$1=dependencies.overrideAPI||new BeamNGAPI_default(events$3,dependencies.beamng);return bridge$3={api:api$1,lua:Lua_default,events:events$3,streams:new StreamManager_default(api$1),coordinator,hooks:Hooks_default,units:new UIUnits_default(events$3,api$1),gameBlurrer:GameBlurrer_default,beamNG:dependencies.beamng},bridge$3},setBridgeDependencies=deps$1=>dependencies=deps$1;var DEBUG=1,INFO=2,WARN=4,ERROR=8,consoleLogMethods={[DEBUG]:`log`,[INFO]:`info`,[WARN]:`warn`,[ERROR]:`error`},consoleLogProvider={log(level$1,...msgs){level$1 in consoleLogMethods&&console[consoleLogMethods[level$1]](...msgs)}},level=14,providersInUse=[consoleLogProvider],STACK_TRACE=Symbol(`Stack trace`),_stackTrace=()=>`
`+Error().stack,_log=(lvl,...msgs)=>{level&lvl&&(msgs=msgs.map(msg=>msg===STACK_TRACE?_stackTrace():msg),providersInUse.forEach(p$1=>p$1.log&&p$1.log(lvl,...msgs)))},_assert=async(lvl,cond,...msgs)=>{level&lvl&&(cond?cond instanceof Promise?cond.then(res=>!res&&_log(lvl,...msgs)):typeof cond==`function`&&!await cond()&&_log(lvl,...msgs):_log(lvl,...msgs))},logger={DEBUG,INFO,WARN,ERROR,setProviders:(...providers)=>providersInUse=providers,set level(val){return level=val},get level(){return level},STACK_TRACE,log:(...msgs)=>_log(DEBUG,...msgs),debug:(...msgs)=>_log(DEBUG,...msgs),info:(...msgs)=>_log(INFO,...msgs),warn:(...msgs)=>_log(WARN,...msgs),error:(...msgs)=>_log(ERROR,...msgs),assert:(cond,...msgs)=>_assert(DEBUG,cond,...msgs),assertDebug:(cond,...msgs)=>_assert(DEBUG,cond,...msgs),assertInfo:(cond,...msgs)=>_assert(INFO,cond,...msgs),assertWarn:(cond,...msgs)=>_assert(WARN,cond,...msgs),assertError:(cond,...msgs)=>_assert(ERROR,cond,...msgs)};window.BNG_Logger=logger;var logger_default=logger;function warn(msg,err){typeof console<`u`&&(console.warn(`[intlify] `+msg),err&&console.warn(err.stack))}var inBrowser=typeof window<`u`,makeSymbol=(name,shareable=!1)=>shareable?Symbol.for(name):Symbol(name),generateFormatCacheKey=(locale,key,source)=>friendlyJSONstringify({l:locale,k:key,s:source}),friendlyJSONstringify=json=>JSON.stringify(json).replace(/\u2028/g,`\\u2028`).replace(/\u2029/g,`\\u2029`).replace(/\u0027/g,`\\u0027`),isNumber=val=>typeof val==`number`&&isFinite(val),isRegExp=val=>toTypeString(val)===`[object RegExp]`,isEmptyObject=val=>isPlainObject(val)&&Object.keys(val).length===0,assign$1=Object.assign,_create=Object.create,create=(obj=null)=>_create(obj),_globalThis,getGlobalThis=()=>_globalThis||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:create();function escapeHtml(rawText){return rawText.replace(/&/g,`&`).replace(//g,`>`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/\//g,`/`).replace(/=/g,`=`)}function escapeAttributeValue(value){return value.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,`&`).replace(/"/g,`"`).replace(/'/g,`'`).replace(//g,`>`)}function sanitizeTranslatedHtml(html){return html=html.replace(/(\w+)\s*=\s*"([^"]*)"/g,(_,attrName,attrValue)=>`${attrName}="${escapeAttributeValue(attrValue)}"`),html=html.replace(/(\w+)\s*=\s*'([^']*)'/g,(_,attrName,attrValue)=>`${attrName}='${escapeAttributeValue(attrValue)}'`),/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(html)&&(html=html.replace(/(\s+)(on)(\w+\s*=)/gi,`$1on$3`)),[/(\s+(?:href|src|action|formaction)\s*=\s*["']?)\s*javascript:/gi,/(style\s*=\s*["'][^"']*url\s*\(\s*)javascript:/gi].forEach(pattern=>{html=html.replace(pattern,`$1javascript:`)}),html}var hasOwnProperty=Object.prototype.hasOwnProperty;function hasOwn(obj,key){return hasOwnProperty.call(obj,key)}var isArray$1=Array.isArray,isFunction=val=>typeof val==`function`,isString=val=>typeof val==`string`,isBoolean=val=>typeof val==`boolean`,isObject=val=>typeof val==`object`&&!!val,isPromise=val=>isObject(val)&&isFunction(val.then)&&isFunction(val.catch),objectToString=Object.prototype.toString,toTypeString=value=>objectToString.call(value),isPlainObject=val=>toTypeString(val)===`[object Object]`,toDisplayString$1=val=>val==null?``:isArray$1(val)||isPlainObject(val)&&val.toString===objectToString?JSON.stringify(val,null,2):String(val);function join(items$2,separator=``){return items$2.reduce((str,item,index)=>index===0?str+item:str+separator+item,``)}var isNotObjectOrIsArray=val=>!isObject(val)||isArray$1(val);function deepCopy(src,des){if(isNotObjectOrIsArray(src)||isNotObjectOrIsArray(des))throw Error(`Invalid value`);let stack$2=[{src,des}];for(;stack$2.length;){let{src:src$1,des:des$1}=stack$2.pop();Object.keys(src$1).forEach(key=>{key!==`__proto__`&&(isObject(src$1[key])&&!isObject(des$1[key])&&(des$1[key]=Array.isArray(src$1[key])?[]:create()),isNotObjectOrIsArray(des$1[key])||isNotObjectOrIsArray(src$1[key])?des$1[key]=src$1[key]:stack$2.push({src:src$1[key],des:des$1[key]}))})}}function createPosition(line,column,offset$2){return{line,column,offset:offset$2}}function createLocation(start,end,source){let loc={start,end};return source!=null&&(loc.source=source),loc}var CompileErrorCodes={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16},COMPILE_ERROR_CODES_EXTEND_POINT=17,errorMessages={[CompileErrorCodes.EXPECTED_TOKEN]:`Expected token: '{0}'`,[CompileErrorCodes.INVALID_TOKEN_IN_PLACEHOLDER]:`Invalid token in placeholder: '{0}'`,[CompileErrorCodes.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]:`Unterminated single quote in placeholder`,[CompileErrorCodes.UNKNOWN_ESCAPE_SEQUENCE]:`Unknown escape sequence: \\{0}`,[CompileErrorCodes.INVALID_UNICODE_ESCAPE_SEQUENCE]:`Invalid unicode escape sequence: {0}`,[CompileErrorCodes.UNBALANCED_CLOSING_BRACE]:`Unbalanced closing brace`,[CompileErrorCodes.UNTERMINATED_CLOSING_BRACE]:`Unterminated closing brace`,[CompileErrorCodes.EMPTY_PLACEHOLDER]:`Empty placeholder`,[CompileErrorCodes.NOT_ALLOW_NEST_PLACEHOLDER]:`Not allowed nest placeholder`,[CompileErrorCodes.INVALID_LINKED_FORMAT]:`Invalid linked format`,[CompileErrorCodes.MUST_HAVE_MESSAGES_IN_PLURAL]:`Plural must have messages`,[CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_MODIFIER]:`Unexpected empty linked modifier`,[CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_KEY]:`Unexpected empty linked key`,[CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS]:`Unexpected lexical analysis in token: '{0}'`,[CompileErrorCodes.UNHANDLED_CODEGEN_NODE_TYPE]:`unhandled codegen node type: '{0}'`,[CompileErrorCodes.UNHANDLED_MINIFIER_NODE_TYPE]:`unhandled mimifier node type: '{0}'`};function createCompileError(code,loc,options={}){let{domain,messages,args}=options,msg=code,error=SyntaxError(String(msg));return error.code=code,loc&&(error.location=loc),error.domain=domain,error}function defaultOnError(error){throw error}var CHAR_SP=` `,CHAR_CR=`\r`,CHAR_LF=`
`,overlayDiv.textContent=count$1.toString(),overlayElement.appendChild(overlayDiv),overlayDivs.set(element,overlayDiv)}catch{}}function updateOverlayText(){if(!overlayActive||overlayDivs.size===0)return;let appsStats=getUIAppsStats(),counts=appsStats.sortedList.map(item=>item.count),maxCount=Math.max(...counts,1),minCount=Math.min(...counts,0);for(let{element,count:count$1}of appsStats.sortedList){let overlayDiv=overlayDivs.get(element);overlayDiv&&(overlayDiv.textContent=count$1.toString(),overlayDiv.style.opacity=getOverlayOpacity(count$1,minCount,maxCount))}}function destroyOverlay(){overlayUpdateTimer&&=(clearInterval(overlayUpdateTimer),null),overlayDivs.forEach(overlayDiv=>overlayDiv.remove()),overlayDivs.clear(),overlayElement&&=(overlayElement.remove(),null),overlayActive=!1}function toggleOverlay(){return overlayActive?(destroyOverlay(),!1):(overlayActive=!0,createOverlay(),updateOverlayDivs(),overlayUpdateTimer=setInterval(updateOverlayText,500),!0)}function refreshOverlay(){overlayActive&&updateOverlayDivs()}var isBrowser=typeof document<`u`;function isRouteComponent(component){return typeof component==`object`||`displayName`in component||`props`in component||`__vccOpts`in component}function isESModule(obj){return obj.__esModule||obj[Symbol.toStringTag]===`Module`||obj.default&&isRouteComponent(obj.default)}var assign=Object.assign;function applyToParams(fn,params){let newParams={};for(let key in params){let value=params[key];newParams[key]=isArray(value)?value.map(fn):fn(value)}return newParams}var noop$1=()=>{},isArray=Array.isArray;function mergeOptions(defaults,partialOptions){let options={};for(let key in defaults)options[key]=key in partialOptions?partialOptions[key]:defaults[key];return options}var HASH_RE=/#/g,AMPERSAND_RE=/&/g,SLASH_RE=/\//g,EQUAL_RE=/=/g,IM_RE=/\?/g,PLUS_RE=/\+/g,ENC_BRACKET_OPEN_RE=/%5B/g,ENC_BRACKET_CLOSE_RE=/%5D/g,ENC_CARET_RE=/%5E/g,ENC_BACKTICK_RE=/%60/g,ENC_CURLY_OPEN_RE=/%7B/g,ENC_PIPE_RE=/%7C/g,ENC_CURLY_CLOSE_RE=/%7D/g,ENC_SPACE_RE=/%20/g;function commonEncode(text){return text==null?``:encodeURI(``+text).replace(ENC_PIPE_RE,`|`).replace(ENC_BRACKET_OPEN_RE,`[`).replace(ENC_BRACKET_CLOSE_RE,`]`)}function encodeHash(text){return commonEncode(text).replace(ENC_CURLY_OPEN_RE,`{`).replace(ENC_CURLY_CLOSE_RE,`}`).replace(ENC_CARET_RE,`^`)}function encodeQueryValue(text){return commonEncode(text).replace(PLUS_RE,`%2B`).replace(ENC_SPACE_RE,`+`).replace(HASH_RE,`%23`).replace(AMPERSAND_RE,`%26`).replace(ENC_BACKTICK_RE,"`").replace(ENC_CURLY_OPEN_RE,`{`).replace(ENC_CURLY_CLOSE_RE,`}`).replace(ENC_CARET_RE,`^`)}function encodeQueryKey(text){return encodeQueryValue(text).replace(EQUAL_RE,`%3D`)}function encodePath(text){return commonEncode(text).replace(HASH_RE,`%23`).replace(IM_RE,`%3F`)}function encodeParam(text){return encodePath(text).replace(SLASH_RE,`%2F`)}function decode(text){if(text==null)return null;try{return decodeURIComponent(``+text)}catch{}return``+text}var TRAILING_SLASH_RE=/\/$/,removeTrailingSlash=path=>path.replace(TRAILING_SLASH_RE,``);function parseURL(parseQuery$1,location$1,currentLocation=`/`){let path,query={},searchString=``,hash=``,hashPos=location$1.indexOf(`#`),searchPos=location$1.indexOf(`?`);return searchPos=hashPos>=0&&searchPos>hashPos?-1:searchPos,searchPos>=0&&(path=location$1.slice(0,searchPos),searchString=location$1.slice(searchPos,hashPos>0?hashPos:location$1.length),query=parseQuery$1(searchString.slice(1))),hashPos>=0&&(path||=location$1.slice(0,hashPos),hash=location$1.slice(hashPos,location$1.length)),path=resolveRelativePath(path??location$1,currentLocation),{fullPath:path+searchString+hash,path,query,hash:decode(hash)}}function stringifyURL(stringifyQuery$1,location$1){let query=location$1.query?stringifyQuery$1(location$1.query):``;return location$1.path+(query&&`?`)+query+(location$1.hash||``)}function stripBase(pathname,base){return!base||!pathname.toLowerCase().startsWith(base.toLowerCase())?pathname:pathname.slice(base.length)||`/`}function isSameRouteLocation(stringifyQuery$1,a$1,b){let aLastIndex=a$1.matched.length-1,bLastIndex=b.matched.length-1;return aLastIndex>-1&&aLastIndex===bLastIndex&&isSameRouteRecord(a$1.matched[aLastIndex],b.matched[bLastIndex])&&isSameRouteLocationParams(a$1.params,b.params)&&stringifyQuery$1(a$1.query)===stringifyQuery$1(b.query)&&a$1.hash===b.hash}function isSameRouteRecord(a$1,b){return(a$1.aliasOf||a$1)===(b.aliasOf||b)}function isSameRouteLocationParams(a$1,b){if(Object.keys(a$1).length!==Object.keys(b).length)return!1;for(let key in a$1)if(!isSameRouteLocationParamsValue(a$1[key],b[key]))return!1;return!0}function isSameRouteLocationParamsValue(a$1,b){return isArray(a$1)?isEquivalentArray(a$1,b):isArray(b)?isEquivalentArray(b,a$1):a$1===b}function isEquivalentArray(a$1,b){return isArray(b)?a$1.length===b.length&&a$1.every((value,i)=>value===b[i]):a$1.length===1&&a$1[0]===b}function resolveRelativePath(to,from){if(to.startsWith(`/`))return to;if(!to)return from;let fromSegments=from.split(`/`),toSegments=to.split(`/`),lastToSegment=toSegments[toSegments.length-1];(lastToSegment===`..`||lastToSegment===`.`)&&toSegments.push(``);let position=fromSegments.length-1,toPosition,segment;for(toPosition=0;toPosition1&&position--;else break;return fromSegments.slice(0,position).join(`/`)+`/`+toSegments.slice(toPosition).join(`/`)}var START_LOCATION_NORMALIZED={path:`/`,name:void 0,params:{},query:{},hash:``,fullPath:`/`,matched:[],meta:{},redirectedFrom:void 0},NavigationType=function(NavigationType$1){return NavigationType$1.pop=`pop`,NavigationType$1.push=`push`,NavigationType$1}({}),NavigationDirection=function(NavigationDirection$1){return NavigationDirection$1.back=`back`,NavigationDirection$1.forward=`forward`,NavigationDirection$1.unknown=``,NavigationDirection$1}({});function normalizeBase(base){if(!base)if(isBrowser){let baseEl=document.querySelector(`base`);base=baseEl&&baseEl.getAttribute(`href`)||`/`,base=base.replace(/^\w+:\/\/[^\/]+/,``)}else base=`/`;return base[0]!==`/`&&base[0]!==`#`&&(base=`/`+base),removeTrailingSlash(base)}var BEFORE_HASH_RE=/^[^#]+#/;function createHref(base,location$1){return base.replace(BEFORE_HASH_RE,`#`)+location$1}function getElementPosition(el,offset$2){let docRect=document.documentElement.getBoundingClientRect(),elRect=el.getBoundingClientRect();return{behavior:offset$2.behavior,left:elRect.left-docRect.left-(offset$2.left||0),top:elRect.top-docRect.top-(offset$2.top||0)}}var computeScrollPosition=()=>({left:window.scrollX,top:window.scrollY});function scrollToPosition(position){let scrollToOptions;if(`el`in position){let positionEl=position.el,isIdSelector=typeof positionEl==`string`&&positionEl.startsWith(`#`),el=typeof positionEl==`string`?isIdSelector?document.getElementById(positionEl.slice(1)):document.querySelector(positionEl):positionEl;if(!el)return;scrollToOptions=getElementPosition(el,position)}else scrollToOptions=position;`scrollBehavior`in document.documentElement.style?window.scrollTo(scrollToOptions):window.scrollTo(scrollToOptions.left==null?window.scrollX:scrollToOptions.left,scrollToOptions.top==null?window.scrollY:scrollToOptions.top)}function getScrollKey(path,delta){return(history.state?history.state.position-delta:-1)+path}var scrollPositions=new Map;function saveScrollPosition(key,scrollPosition){scrollPositions.set(key,scrollPosition)}function getSavedScrollPosition(key){let scroll$1=scrollPositions.get(key);return scrollPositions.delete(key),scroll$1}function isRouteLocation(route){return typeof route==`string`||route&&typeof route==`object`}function isRouteName(name){return typeof name==`string`||typeof name==`symbol`}var ErrorTypes=function(ErrorTypes$1){return ErrorTypes$1[ErrorTypes$1.MATCHER_NOT_FOUND=1]=`MATCHER_NOT_FOUND`,ErrorTypes$1[ErrorTypes$1.NAVIGATION_GUARD_REDIRECT=2]=`NAVIGATION_GUARD_REDIRECT`,ErrorTypes$1[ErrorTypes$1.NAVIGATION_ABORTED=4]=`NAVIGATION_ABORTED`,ErrorTypes$1[ErrorTypes$1.NAVIGATION_CANCELLED=8]=`NAVIGATION_CANCELLED`,ErrorTypes$1[ErrorTypes$1.NAVIGATION_DUPLICATED=16]=`NAVIGATION_DUPLICATED`,ErrorTypes$1}({}),NavigationFailureSymbol=Symbol(``);ErrorTypes.MATCHER_NOT_FOUND,ErrorTypes.NAVIGATION_GUARD_REDIRECT,ErrorTypes.NAVIGATION_ABORTED,ErrorTypes.NAVIGATION_CANCELLED,ErrorTypes.NAVIGATION_DUPLICATED;function createRouterError(type,params){return assign(Error(),{type,[NavigationFailureSymbol]:!0},params)}function isNavigationFailure(error,type){return error instanceof Error&&NavigationFailureSymbol in error&&(type==null||!!(error.type&type))}function parseQuery(search$1){let query={};if(search$1===``||search$1===`?`)return query;let searchParams=(search$1[0]===`?`?search$1.slice(1):search$1).split(`&`);for(let i=0;iv&&encodeQueryValue(v)):[value&&encodeQueryValue(value)]).forEach(value$1=>{value$1!==void 0&&(search$1+=(search$1.length?`&`:``)+key,value$1!=null&&(search$1+=`=`+value$1))})}return search$1}function normalizeQuery(query){let normalizedQuery={};for(let key in query){let value=query[key];value!==void 0&&(normalizedQuery[key]=isArray(value)?value.map(v=>v==null?null:``+v):value==null?value:``+value)}return normalizedQuery}var matchedRouteKey=Symbol(``),viewDepthKey=Symbol(``),routerKey=Symbol(``),routeLocationKey=Symbol(``),routerViewLocationKey=Symbol(``);function useCallbacks(){let handlers$1=[];function add$2(handler$1){return handlers$1.push(handler$1),()=>{let i=handlers$1.indexOf(handler$1);i>-1&&handlers$1.splice(i,1)}}function reset$1(){handlers$1=[]}return{add:add$2,list:()=>handlers$1.slice(),reset:reset$1}}function guardToPromiseFn(guard,to,from,record,name,runWithContext=fn=>fn()){let enterCallbackArray=record&&(record.enterCallbacks[name]=record.enterCallbacks[name]||[]);return()=>new Promise((resolve$1,reject)=>{let next=valid=>{valid===!1?reject(createRouterError(ErrorTypes.NAVIGATION_ABORTED,{from,to})):valid instanceof Error?reject(valid):isRouteLocation(valid)?reject(createRouterError(ErrorTypes.NAVIGATION_GUARD_REDIRECT,{from:to,to:valid})):(enterCallbackArray&&record.enterCallbacks[name]===enterCallbackArray&&typeof valid==`function`&&enterCallbackArray.push(valid),resolve$1())},guardReturn=runWithContext(()=>guard.call(record&&record.instances[name],to,from,next)),guardCall=Promise.resolve(guardReturn);guard.length<3&&(guardCall=guardCall.then(next)),guardCall.catch(err=>reject(err))})}function extractComponentsGuards(matched,guardType,to,from,runWithContext=fn=>fn()){let guards=[];for(let record of matched)for(let name in record.components){let rawComponent=record.components[name];if(!(guardType!==`beforeRouteEnter`&&!record.instances[name]))if(isRouteComponent(rawComponent)){let guard=(rawComponent.__vccOpts||rawComponent)[guardType];guard&&guards.push(guardToPromiseFn(guard,to,from,record,name,runWithContext))}else{let componentPromise=rawComponent();guards.push(()=>componentPromise.then(resolved=>{if(!resolved)throw Error(`Couldn't resolve component "${name}" at "${record.path}"`);let resolvedComponent=isESModule(resolved)?resolved.default:resolved;record.mods[name]=resolved,record.components[name]=resolvedComponent;let guard=(resolvedComponent.__vccOpts||resolvedComponent)[guardType];return guard&&guardToPromiseFn(guard,to,from,record,name,runWithContext)()}))}}return guards}function extractChangingRecords(to,from){let leavingRecords=[],updatingRecords=[],enteringRecords=[],len=Math.max(from.matched.length,to.matched.length);for(let i=0;iisSameRouteRecord(record,recordFrom))?updatingRecords.push(recordFrom):leavingRecords.push(recordFrom));let recordTo=to.matched[i];recordTo&&(from.matched.find(record=>isSameRouteRecord(record,recordTo))||enteringRecords.push(recordTo))}return[leavingRecords,updatingRecords,enteringRecords]}var createBaseLocation=()=>location.protocol+`//`+location.host;function createCurrentLocation(base,location$1){let{pathname,search:search$1,hash}=location$1,hashPos=base.indexOf(`#`);if(hashPos>-1){let slicePos=hash.includes(base.slice(hashPos))?base.slice(hashPos).length:1,pathFromHash=hash.slice(slicePos);return pathFromHash[0]!==`/`&&(pathFromHash=`/`+pathFromHash),stripBase(pathFromHash,``)}return stripBase(pathname,base)+search$1+hash}function useHistoryListeners(base,historyState,currentLocation,replace){let listeners=[],teardowns=[],pauseState=null,popStateHandler=({state})=>{let to=createCurrentLocation(base,location),from=currentLocation.value,fromState=historyState.value,delta=0;if(state){if(currentLocation.value=to,historyState.value=state,pauseState&&pauseState===from){pauseState=null;return}delta=fromState?state.position-fromState.position:0}else replace(to);listeners.forEach(listener=>{listener(currentLocation.value,from,{delta,type:NavigationType.pop,direction:delta?delta>0?NavigationDirection.forward:NavigationDirection.back:NavigationDirection.unknown})})};function pauseListeners(){pauseState=currentLocation.value}function listen(callback){listeners.push(callback);let teardown=()=>{let index=listeners.indexOf(callback);index>-1&&listeners.splice(index,1)};return teardowns.push(teardown),teardown}function beforeUnloadListener(){if(document.visibilityState===`hidden`){let{history:history$1}=window;if(!history$1.state)return;history$1.replaceState(assign({},history$1.state,{scroll:computeScrollPosition()}),``)}}function destroy$1(){for(let teardown of teardowns)teardown();teardowns=[],window.removeEventListener(`popstate`,popStateHandler),window.removeEventListener(`pagehide`,beforeUnloadListener),document.removeEventListener(`visibilitychange`,beforeUnloadListener)}return window.addEventListener(`popstate`,popStateHandler),window.addEventListener(`pagehide`,beforeUnloadListener),document.addEventListener(`visibilitychange`,beforeUnloadListener),{pauseListeners,listen,destroy:destroy$1}}function buildState(back,current,forward,replaced=!1,computeScroll=!1){return{back,current,forward,replaced,position:window.history.length,scroll:computeScroll?computeScrollPosition():null}}function useHistoryStateNavigation(base){let{history:history$1,location:location$1}=window,currentLocation={value:createCurrentLocation(base,location$1)},historyState={value:history$1.state};historyState.value||changeLocation(currentLocation.value,{back:null,current:currentLocation.value,forward:null,position:history$1.length-1,replaced:!0,scroll:null},!0);function changeLocation(to,state,replace$1){let hashIndex=base.indexOf(`#`),url=hashIndex>-1?(location$1.host&&document.querySelector(`base`)?base:base.slice(hashIndex))+to:createBaseLocation()+base+to;try{history$1[replace$1?`replaceState`:`pushState`](state,``,url),historyState.value=state}catch(err){console.error(err),location$1[replace$1?`replace`:`assign`](url)}}function replace(to,data){changeLocation(to,assign({},history$1.state,buildState(historyState.value.back,to,historyState.value.forward,!0),data,{position:historyState.value.position}),!0),currentLocation.value=to}function push(to,data){let currentState=assign({},historyState.value,history$1.state,{forward:to,scroll:computeScrollPosition()});changeLocation(currentState.current,currentState,!0),changeLocation(to,assign({},buildState(currentLocation.value,to,null),{position:currentState.position+1},data),!1),currentLocation.value=to}return{location:currentLocation,state:historyState,push,replace}}function createWebHistory(base){base=normalizeBase(base);let historyNavigation=useHistoryStateNavigation(base),historyListeners=useHistoryListeners(base,historyNavigation.state,historyNavigation.location,historyNavigation.replace);function go(delta,triggerListeners=!0){triggerListeners||historyListeners.pauseListeners(),history.go(delta)}let routerHistory=assign({location:``,base,go,createHref:createHref.bind(null,base)},historyNavigation,historyListeners);return Object.defineProperty(routerHistory,`location`,{enumerable:!0,get:()=>historyNavigation.location.value}),Object.defineProperty(routerHistory,`state`,{enumerable:!0,get:()=>historyNavigation.state.value}),routerHistory}function createWebHashHistory(base){return base=location.host?base||location.pathname+location.search:``,base.includes(`#`)||(base+=`#`),createWebHistory(base)}var TokenType=function(TokenType$1){return TokenType$1[TokenType$1.Static=0]=`Static`,TokenType$1[TokenType$1.Param=1]=`Param`,TokenType$1[TokenType$1.Group=2]=`Group`,TokenType$1}({}),TokenizerState=function(TokenizerState$1){return TokenizerState$1[TokenizerState$1.Static=0]=`Static`,TokenizerState$1[TokenizerState$1.Param=1]=`Param`,TokenizerState$1[TokenizerState$1.ParamRegExp=2]=`ParamRegExp`,TokenizerState$1[TokenizerState$1.ParamRegExpEnd=3]=`ParamRegExpEnd`,TokenizerState$1[TokenizerState$1.EscapeNext=4]=`EscapeNext`,TokenizerState$1}(TokenizerState||{}),ROOT_TOKEN={type:TokenType.Static,value:``},VALID_PARAM_RE=/[a-zA-Z0-9_]/;function tokenizePath(path){if(!path)return[[]];if(path===`/`)return[[ROOT_TOKEN]];if(!path.startsWith(`/`))throw Error(`Invalid path "${path}"`);function crash(message){throw Error(`ERR (${state})/"${buffer$1}": ${message}`)}let state=TokenizerState.Static,previousState=state,tokens=[],segment;function finalizeSegment(){segment&&tokens.push(segment),segment=[]}let i=0,char,buffer$1=``,customRe=``;function consumeBuffer(){buffer$1&&=(state===TokenizerState.Static?segment.push({type:TokenType.Static,value:buffer$1}):state===TokenizerState.Param||state===TokenizerState.ParamRegExp||state===TokenizerState.ParamRegExpEnd?(segment.length>1&&(char===`*`||char===`+`)&&crash(`A repeatable param (${buffer$1}) must be alone in its segment. eg: '/:ids+.`),segment.push({type:TokenType.Param,value:buffer$1,regexp:customRe,repeatable:char===`*`||char===`+`,optional:char===`*`||char===`?`})):crash(`Invalid state to consume buffer`),``)}function addCharToBuffer(){buffer$1+=char}for(;ib.length?b.length===1&&b[0]===PathScore.Static+PathScore.Segment?1:-1:0}function comparePathParserScore(a$1,b){let i=0,aScore=a$1.score,bScore=b.score;for(;i0&&last[last.length-1]<0}var PATH_PARSER_OPTIONS_DEFAULTS={strict:!1,end:!0,sensitive:!1};function createRouteRecordMatcher(record,parent,options){let matcher=assign(tokensToParser(tokenizePath(record.path),options),{record,parent,children:[],alias:[]});return parent&&!matcher.record.aliasOf==!parent.record.aliasOf&&parent.children.push(matcher),matcher}function createRouterMatcher(routes,globalOptions){let matchers=[],matcherMap=new Map;globalOptions=mergeOptions(PATH_PARSER_OPTIONS_DEFAULTS,globalOptions);function getRecordMatcher(name){return matcherMap.get(name)}function addRoute(record,parent,originalRecord){let isRootAdd=!originalRecord,mainNormalizedRecord=normalizeRouteRecord(record);mainNormalizedRecord.aliasOf=originalRecord&&originalRecord.record;let options=mergeOptions(globalOptions,record),normalizedRecords=[mainNormalizedRecord];if(`alias`in record){let aliases=typeof record.alias==`string`?[record.alias]:record.alias;for(let alias of aliases)normalizedRecords.push(normalizeRouteRecord(assign({},mainNormalizedRecord,{components:originalRecord?originalRecord.record.components:mainNormalizedRecord.components,path:alias,aliasOf:originalRecord?originalRecord.record:mainNormalizedRecord})))}let matcher,originalMatcher;for(let normalizedRecord of normalizedRecords){let{path}=normalizedRecord;if(parent&&path[0]!==`/`){let parentPath=parent.record.path,connectingSlash=parentPath[parentPath.length-1]===`/`?``:`/`;normalizedRecord.path=parent.record.path+(path&&connectingSlash+path)}if(matcher=createRouteRecordMatcher(normalizedRecord,parent,options),originalRecord?originalRecord.alias.push(matcher):(originalMatcher||=matcher,originalMatcher!==matcher&&originalMatcher.alias.push(matcher),isRootAdd&&record.name&&!isAliasRecord(matcher)&&removeRoute(record.name)),isMatchable(matcher)&&insertMatcher(matcher),mainNormalizedRecord.children){let children=mainNormalizedRecord.children;for(let i=0;i{removeRoute(originalMatcher)}:noop$1}function removeRoute(matcherRef){if(isRouteName(matcherRef)){let matcher=matcherMap.get(matcherRef);matcher&&(matcherMap.delete(matcherRef),matchers.splice(matchers.indexOf(matcher),1),matcher.children.forEach(removeRoute),matcher.alias.forEach(removeRoute))}else{let index=matchers.indexOf(matcherRef);index>-1&&(matchers.splice(index,1),matcherRef.record.name&&matcherMap.delete(matcherRef.record.name),matcherRef.children.forEach(removeRoute),matcherRef.alias.forEach(removeRoute))}}function getRoutes(){return matchers}function insertMatcher(matcher){let index=findInsertionIndex(matcher,matchers);matchers.splice(index,0,matcher),matcher.record.name&&!isAliasRecord(matcher)&&matcherMap.set(matcher.record.name,matcher)}function resolve$1(location$1,currentLocation){let matcher,params={},path,name;if(`name`in location$1&&location$1.name){if(matcher=matcherMap.get(location$1.name),!matcher)throw createRouterError(ErrorTypes.MATCHER_NOT_FOUND,{location:location$1});name=matcher.record.name,params=assign(pickParams(currentLocation.params,matcher.keys.filter(k=>!k.optional).concat(matcher.parent?matcher.parent.keys.filter(k=>k.optional):[]).map(k=>k.name)),location$1.params&&pickParams(location$1.params,matcher.keys.map(k=>k.name))),path=matcher.stringify(params)}else if(location$1.path!=null)path=location$1.path,matcher=matchers.find(m=>m.re.test(path)),matcher&&(params=matcher.parse(path),name=matcher.record.name);else{if(matcher=currentLocation.name?matcherMap.get(currentLocation.name):matchers.find(m=>m.re.test(currentLocation.path)),!matcher)throw createRouterError(ErrorTypes.MATCHER_NOT_FOUND,{location:location$1,currentLocation});name=matcher.record.name,params=assign({},currentLocation.params,location$1.params),path=matcher.stringify(params)}let matched=[],parentMatcher=matcher;for(;parentMatcher;)matched.unshift(parentMatcher.record),parentMatcher=parentMatcher.parent;return{name,path,params,matched,meta:mergeMetaFields(matched)}}routes.forEach(route=>addRoute(route));function clearRoutes(){matchers.length=0,matcherMap.clear()}return{addRoute,resolve:resolve$1,removeRoute,clearRoutes,getRoutes,getRecordMatcher}}function pickParams(params,keys){let newParams={};for(let key of keys)key in params&&(newParams[key]=params[key]);return newParams}function normalizeRouteRecord(record){let normalized={path:record.path,redirect:record.redirect,name:record.name,meta:record.meta||{},aliasOf:record.aliasOf,beforeEnter:record.beforeEnter,props:normalizeRecordProps(record),children:record.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:`components`in record?record.components||null:record.component&&{default:record.component}};return Object.defineProperty(normalized,`mods`,{value:{}}),normalized}function normalizeRecordProps(record){let propsObject={},props=record.props||!1;if(`component`in record)propsObject.default=props;else for(let name in record.components)propsObject[name]=typeof props==`object`?props[name]:props;return propsObject}function isAliasRecord(record){for(;record;){if(record.record.aliasOf)return!0;record=record.parent}return!1}function mergeMetaFields(matched){return matched.reduce((meta,record)=>assign(meta,record.meta),{})}function findInsertionIndex(matcher,matchers){let lower=0,upper=matchers.length;for(;lower!==upper;){let mid=lower+upper>>1;comparePathParserScore(matcher,matchers[mid])<0?upper=mid:lower=mid+1}let insertionAncestor=getInsertionAncestor(matcher);return insertionAncestor&&(upper=matchers.lastIndexOf(insertionAncestor,upper-1)),upper}function getInsertionAncestor(matcher){let ancestor=matcher;for(;ancestor=ancestor.parent;)if(isMatchable(ancestor)&&comparePathParserScore(matcher,ancestor)===0)return ancestor}function isMatchable({record}){return!!(record.name||record.components&&Object.keys(record.components).length||record.redirect)}function useLink(props){let router$1=inject(routerKey),currentRoute=inject(routeLocationKey),route=computed(()=>{let to=unref(props.to);return router$1.resolve(to)}),activeRecordIndex=computed(()=>{let{matched}=route.value,{length}=matched,routeMatched=matched[length-1],currentMatched=currentRoute.matched;if(!routeMatched||!currentMatched.length)return-1;let index=currentMatched.findIndex(isSameRouteRecord.bind(null,routeMatched));if(index>-1)return index;let parentRecordPath=getOriginalPath(matched[length-2]);return length>1&&getOriginalPath(routeMatched)===parentRecordPath&¤tMatched[currentMatched.length-1].path!==parentRecordPath?currentMatched.findIndex(isSameRouteRecord.bind(null,matched[length-2])):index}),isActive=computed(()=>activeRecordIndex.value>-1&&includesParams(currentRoute.params,route.value.params)),isExactActive=computed(()=>activeRecordIndex.value>-1&&activeRecordIndex.value===currentRoute.matched.length-1&&isSameRouteLocationParams(currentRoute.params,route.value.params));function navigate$1(e={}){if(guardEvent(e)){let p$1=router$1[unref(props.replace)?`replace`:`push`](unref(props.to)).catch(noop$1);return props.viewTransition&&typeof document<`u`&&`startViewTransition`in document&&document.startViewTransition(()=>p$1),p$1}return Promise.resolve()}return{route,href:computed(()=>route.value.href),isActive,isExactActive,navigate:navigate$1}}function preferSingleVNode(vnodes){return vnodes.length===1?vnodes[0]:vnodes}var RouterLink=defineComponent({name:`RouterLink`,compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:`page`},viewTransition:Boolean},useLink,setup(props,{slots}){let link=reactive(useLink(props)),{options}=inject(routerKey),elClass=computed(()=>({[getLinkClass(props.activeClass,options.linkActiveClass,`router-link-active`)]:link.isActive,[getLinkClass(props.exactActiveClass,options.linkExactActiveClass,`router-link-exact-active`)]:link.isExactActive}));return()=>{let children=slots.default&&preferSingleVNode(slots.default(link));return props.custom?children:h(`a`,{"aria-current":link.isExactActive?props.ariaCurrentValue:null,href:link.href,onClick:link.navigate,class:elClass.value},children)}}});function guardEvent(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){let target=e.currentTarget.getAttribute(`target`);if(/\b_blank\b/i.test(target))return}return e.preventDefault&&e.preventDefault(),!0}}function includesParams(outer,inner){for(let key in inner){let innerValue=inner[key],outerValue=outer[key];if(typeof innerValue==`string`){if(innerValue!==outerValue)return!1}else if(!isArray(outerValue)||outerValue.length!==innerValue.length||innerValue.some((value,i)=>value!==outerValue[i]))return!1}return!0}function getOriginalPath(record){return record?record.aliasOf?record.aliasOf.path:record.path:``}var getLinkClass=(propClass,globalClass,defaultClass)=>propClass??globalClass??defaultClass,RouterViewImpl=defineComponent({name:`RouterView`,inheritAttrs:!1,props:{name:{type:String,default:`default`},route:Object},compatConfig:{MODE:3},setup(props,{attrs,slots}){let injectedRoute=inject(routerViewLocationKey),routeToDisplay=computed(()=>props.route||injectedRoute.value),injectedDepth=inject(viewDepthKey,0),depth=computed(()=>{let initialDepth=unref(injectedDepth),{matched}=routeToDisplay.value,matchedRoute;for(;(matchedRoute=matched[initialDepth])&&!matchedRoute.components;)initialDepth++;return initialDepth}),matchedRouteRef=computed(()=>routeToDisplay.value.matched[depth.value]);provide(viewDepthKey,computed(()=>depth.value+1)),provide(matchedRouteKey,matchedRouteRef),provide(routerViewLocationKey,routeToDisplay);let viewRef=ref();return watch(()=>[viewRef.value,matchedRouteRef.value,props.name],([instance$1,to,name],[oldInstance,from,oldName])=>{to&&(to.instances[name]=instance$1,from&&from!==to&&instance$1&&instance$1===oldInstance&&(to.leaveGuards.size||(to.leaveGuards=from.leaveGuards),to.updateGuards.size||(to.updateGuards=from.updateGuards))),instance$1&&to&&(!from||!isSameRouteRecord(to,from)||!oldInstance)&&(to.enterCallbacks[name]||[]).forEach(callback=>callback(instance$1))},{flush:`post`}),()=>{let route=routeToDisplay.value,currentName=props.name,matchedRoute=matchedRouteRef.value,ViewComponent=matchedRoute&&matchedRoute.components[currentName];if(!ViewComponent)return normalizeSlot(slots.default,{Component:ViewComponent,route});let routePropsOption=matchedRoute.props[currentName],component=h(ViewComponent,assign({},routePropsOption?routePropsOption===!0?route.params:typeof routePropsOption==`function`?routePropsOption(route):routePropsOption:null,attrs,{onVnodeUnmounted:vnode=>{vnode.component.isUnmounted&&(matchedRoute.instances[currentName]=null)},ref:viewRef}));return normalizeSlot(slots.default,{Component:component,route})||component}}});function normalizeSlot(slot,data){if(!slot)return null;let slotContent=slot(data);return slotContent.length===1?slotContent[0]:slotContent}var RouterView=RouterViewImpl;function createRouter(options){let matcher=createRouterMatcher(options.routes,options),parseQuery$1=options.parseQuery||parseQuery,stringifyQuery$1=options.stringifyQuery||stringifyQuery,routerHistory=options.history,beforeGuards=useCallbacks(),beforeResolveGuards=useCallbacks(),afterGuards=useCallbacks(),currentRoute=shallowRef(START_LOCATION_NORMALIZED),pendingLocation=START_LOCATION_NORMALIZED;isBrowser&&options.scrollBehavior&&`scrollRestoration`in history&&(history.scrollRestoration=`manual`);let normalizeParams=applyToParams.bind(null,paramValue=>``+paramValue),encodeParams=applyToParams.bind(null,encodeParam),decodeParams=applyToParams.bind(null,decode);function addRoute(parentOrRoute,route){let parent,record;return isRouteName(parentOrRoute)?(parent=matcher.getRecordMatcher(parentOrRoute),record=route):record=parentOrRoute,matcher.addRoute(record,parent)}function removeRoute(name){let recordMatcher=matcher.getRecordMatcher(name);recordMatcher&&matcher.removeRoute(recordMatcher)}function getRoutes(){return matcher.getRoutes().map(routeMatcher=>routeMatcher.record)}function hasRoute(name){return!!matcher.getRecordMatcher(name)}function resolve$1(rawLocation,currentLocation){if(currentLocation=assign({},currentLocation||currentRoute.value),typeof rawLocation==`string`){let locationNormalized=parseURL(parseQuery$1,rawLocation,currentLocation.path),matchedRoute$1=matcher.resolve({path:locationNormalized.path},currentLocation),href$1=routerHistory.createHref(locationNormalized.fullPath);return assign(locationNormalized,matchedRoute$1,{params:decodeParams(matchedRoute$1.params),hash:decode(locationNormalized.hash),redirectedFrom:void 0,href:href$1})}let matcherLocation;if(rawLocation.path!=null)matcherLocation=assign({},rawLocation,{path:parseURL(parseQuery$1,rawLocation.path,currentLocation.path).path});else{let targetParams=assign({},rawLocation.params);for(let key in targetParams)targetParams[key]??delete targetParams[key];matcherLocation=assign({},rawLocation,{params:encodeParams(targetParams)}),currentLocation.params=encodeParams(currentLocation.params)}let matchedRoute=matcher.resolve(matcherLocation,currentLocation),hash=rawLocation.hash||``;matchedRoute.params=normalizeParams(decodeParams(matchedRoute.params));let fullPath=stringifyURL(stringifyQuery$1,assign({},rawLocation,{hash:encodeHash(hash),path:matchedRoute.path})),href=routerHistory.createHref(fullPath);return assign({fullPath,hash,query:stringifyQuery$1===stringifyQuery?normalizeQuery(rawLocation.query):rawLocation.query||{}},matchedRoute,{redirectedFrom:void 0,href})}function locationAsObject(to){return typeof to==`string`?parseURL(parseQuery$1,to,currentRoute.value.path):assign({},to)}function checkCanceledNavigation(to,from){if(pendingLocation!==to)return createRouterError(ErrorTypes.NAVIGATION_CANCELLED,{from,to})}function push(to){return pushWithRedirect(to)}function replace(to){return push(assign(locationAsObject(to),{replace:!0}))}function handleRedirectRecord(to,from){let lastMatched=to.matched[to.matched.length-1];if(lastMatched&&lastMatched.redirect){let{redirect}=lastMatched,newTargetLocation=typeof redirect==`function`?redirect(to,from):redirect;return typeof newTargetLocation==`string`&&(newTargetLocation=newTargetLocation.includes(`?`)||newTargetLocation.includes(`#`)?newTargetLocation=locationAsObject(newTargetLocation):{path:newTargetLocation},newTargetLocation.params={}),assign({query:to.query,hash:to.hash,params:newTargetLocation.path==null?to.params:{}},newTargetLocation)}}function pushWithRedirect(to,redirectedFrom){let targetLocation=pendingLocation=resolve$1(to),from=currentRoute.value,data=to.state,force=to.force,replace$1=to.replace===!0,shouldRedirect=handleRedirectRecord(targetLocation,from);if(shouldRedirect)return pushWithRedirect(assign(locationAsObject(shouldRedirect),{state:typeof shouldRedirect==`object`?assign({},data,shouldRedirect.state):data,force,replace:replace$1}),redirectedFrom||targetLocation);let toLocation=targetLocation;toLocation.redirectedFrom=redirectedFrom;let failure;return!force&&isSameRouteLocation(stringifyQuery$1,from,targetLocation)&&(failure=createRouterError(ErrorTypes.NAVIGATION_DUPLICATED,{to:toLocation,from}),handleScroll(from,from,!0,!1)),(failure?Promise.resolve(failure):navigate$1(toLocation,from)).catch(error=>isNavigationFailure(error)?isNavigationFailure(error,ErrorTypes.NAVIGATION_GUARD_REDIRECT)?error:markAsReady(error):triggerError(error,toLocation,from)).then(failure$1=>{if(failure$1){if(isNavigationFailure(failure$1,ErrorTypes.NAVIGATION_GUARD_REDIRECT))return pushWithRedirect(assign({replace:replace$1},locationAsObject(failure$1.to),{state:typeof failure$1.to==`object`?assign({},data,failure$1.to.state):data,force}),redirectedFrom||toLocation)}else failure$1=finalizeNavigation(toLocation,from,!0,replace$1,data);return triggerAfterEach(toLocation,from,failure$1),failure$1})}function checkCanceledNavigationAndReject(to,from){let error=checkCanceledNavigation(to,from);return error?Promise.reject(error):Promise.resolve()}function runWithContext(fn){let app$1=installedApps.values().next().value;return app$1&&typeof app$1.runWithContext==`function`?app$1.runWithContext(fn):fn()}function navigate$1(to,from){let guards,[leavingRecords,updatingRecords,enteringRecords]=extractChangingRecords(to,from);guards=extractComponentsGuards(leavingRecords.reverse(),`beforeRouteLeave`,to,from);for(let record of leavingRecords)record.leaveGuards.forEach(guard=>{guards.push(guardToPromiseFn(guard,to,from))});let canceledNavigationCheck=checkCanceledNavigationAndReject.bind(null,to,from);return guards.push(canceledNavigationCheck),runGuardQueue(guards).then(()=>{guards=[];for(let guard of beforeGuards.list())guards.push(guardToPromiseFn(guard,to,from));return guards.push(canceledNavigationCheck),runGuardQueue(guards)}).then(()=>{guards=extractComponentsGuards(updatingRecords,`beforeRouteUpdate`,to,from);for(let record of updatingRecords)record.updateGuards.forEach(guard=>{guards.push(guardToPromiseFn(guard,to,from))});return guards.push(canceledNavigationCheck),runGuardQueue(guards)}).then(()=>{guards=[];for(let record of enteringRecords)if(record.beforeEnter)if(isArray(record.beforeEnter))for(let beforeEnter of record.beforeEnter)guards.push(guardToPromiseFn(beforeEnter,to,from));else guards.push(guardToPromiseFn(record.beforeEnter,to,from));return guards.push(canceledNavigationCheck),runGuardQueue(guards)}).then(()=>(to.matched.forEach(record=>record.enterCallbacks={}),guards=extractComponentsGuards(enteringRecords,`beforeRouteEnter`,to,from,runWithContext),guards.push(canceledNavigationCheck),runGuardQueue(guards))).then(()=>{guards=[];for(let guard of beforeResolveGuards.list())guards.push(guardToPromiseFn(guard,to,from));return guards.push(canceledNavigationCheck),runGuardQueue(guards)}).catch(err=>isNavigationFailure(err,ErrorTypes.NAVIGATION_CANCELLED)?err:Promise.reject(err))}function triggerAfterEach(to,from,failure){afterGuards.list().forEach(guard=>runWithContext(()=>guard(to,from,failure)))}function finalizeNavigation(toLocation,from,isPush,replace$1,data){let error=checkCanceledNavigation(toLocation,from);if(error)return error;let isFirstNavigation=from===START_LOCATION_NORMALIZED,state=isBrowser?history.state:{};isPush&&(replace$1||isFirstNavigation?routerHistory.replace(toLocation.fullPath,assign({scroll:isFirstNavigation&&state&&state.scroll},data)):routerHistory.push(toLocation.fullPath,data)),currentRoute.value=toLocation,handleScroll(toLocation,from,isPush,isFirstNavigation),markAsReady()}let removeHistoryListener;function setupListeners(){removeHistoryListener||=routerHistory.listen((to,_from,info)=>{if(!router$1.listening)return;let toLocation=resolve$1(to),shouldRedirect=handleRedirectRecord(toLocation,router$1.currentRoute.value);if(shouldRedirect){pushWithRedirect(assign(shouldRedirect,{replace:!0,force:!0}),toLocation).catch(noop$1);return}pendingLocation=toLocation;let from=currentRoute.value;isBrowser&&saveScrollPosition(getScrollKey(from.fullPath,info.delta),computeScrollPosition()),navigate$1(toLocation,from).catch(error=>isNavigationFailure(error,ErrorTypes.NAVIGATION_ABORTED|ErrorTypes.NAVIGATION_CANCELLED)?error:isNavigationFailure(error,ErrorTypes.NAVIGATION_GUARD_REDIRECT)?(pushWithRedirect(assign(locationAsObject(error.to),{force:!0}),toLocation).then(failure=>{isNavigationFailure(failure,ErrorTypes.NAVIGATION_ABORTED|ErrorTypes.NAVIGATION_DUPLICATED)&&!info.delta&&info.type===NavigationType.pop&&routerHistory.go(-1,!1)}).catch(noop$1),Promise.reject()):(info.delta&&routerHistory.go(-info.delta,!1),triggerError(error,toLocation,from))).then(failure=>{failure||=finalizeNavigation(toLocation,from,!1),failure&&(info.delta&&!isNavigationFailure(failure,ErrorTypes.NAVIGATION_CANCELLED)?routerHistory.go(-info.delta,!1):info.type===NavigationType.pop&&isNavigationFailure(failure,ErrorTypes.NAVIGATION_ABORTED|ErrorTypes.NAVIGATION_DUPLICATED)&&routerHistory.go(-1,!1)),triggerAfterEach(toLocation,from,failure)}).catch(noop$1)})}let readyHandlers=useCallbacks(),errorListeners=useCallbacks(),ready;function triggerError(error,to,from){markAsReady(error);let list=errorListeners.list();return list.length?list.forEach(handler$1=>handler$1(error,to,from)):console.error(error),Promise.reject(error)}function isReady(){return ready&¤tRoute.value!==START_LOCATION_NORMALIZED?Promise.resolve():new Promise((resolve$1$1,reject)=>{readyHandlers.add([resolve$1$1,reject])})}function markAsReady(err){return ready||(ready=!err,setupListeners(),readyHandlers.list().forEach(([resolve$1$1,reject])=>err?reject(err):resolve$1$1()),readyHandlers.reset()),err}function handleScroll(to,from,isPush,isFirstNavigation){let{scrollBehavior}=options;if(!isBrowser||!scrollBehavior)return Promise.resolve();let scrollPosition=!isPush&&getSavedScrollPosition(getScrollKey(to.fullPath,0))||(isFirstNavigation||!isPush)&&history.state&&history.state.scroll||null;return nextTick().then(()=>scrollBehavior(to,from,scrollPosition)).then(position=>position&&scrollToPosition(position)).catch(err=>triggerError(err,to,from))}let go=delta=>routerHistory.go(delta),started,installedApps=new Set,router$1={currentRoute,listening:!0,addRoute,removeRoute,clearRoutes:matcher.clearRoutes,hasRoute,getRoutes,resolve:resolve$1,options,push,replace,go,back:()=>go(-1),forward:()=>go(1),beforeEach:beforeGuards.add,beforeResolve:beforeResolveGuards.add,afterEach:afterGuards.add,onError:errorListeners.add,isReady,install(app$1){app$1.component(`RouterLink`,RouterLink),app$1.component(`RouterView`,RouterView),app$1.config.globalProperties.$router=router$1,Object.defineProperty(app$1.config.globalProperties,`$route`,{enumerable:!0,get:()=>unref(currentRoute)}),isBrowser&&!started&¤tRoute.value===START_LOCATION_NORMALIZED&&(started=!0,push(routerHistory.location).catch(err=>{}));let reactiveRoute={};for(let key in START_LOCATION_NORMALIZED)Object.defineProperty(reactiveRoute,key,{get:()=>currentRoute.value[key],enumerable:!0});app$1.provide(routerKey,router$1),app$1.provide(routeLocationKey,shallowReactive(reactiveRoute)),app$1.provide(routerViewLocationKey,currentRoute);let unmountApp=app$1.unmount;installedApps.add(app$1),app$1.unmount=function(){installedApps.delete(app$1),installedApps.size<1&&(pendingLocation=START_LOCATION_NORMALIZED,removeHistoryListener&&removeHistoryListener(),removeHistoryListener=null,currentRoute.value=START_LOCATION_NORMALIZED,started=!1,ready=!1),unmountApp()}}};function runGuardQueue(guards){return guards.reduce((promise,guard)=>promise.then(()=>runWithContext(guard)),Promise.resolve())}return router$1}function useRouter(){return inject(routerKey)}function useRoute(_name){return inject(routeLocationKey)}function spawnUiApp(appName,appId,params,apps){let props=params?params.props:null,appKey=`${appName}${appId}`;apps.push({name:appName,appId,appKey,comp:appName,props,teleport:`#${appName+appId}`})}function destroyUiApp(appName,apps){let index=apps.findIndex(x=>x.name===appName);index>-1&&apps.splice(index,1)}function registerApps(app$1,componentsMap){Object.keys(componentsMap).forEach(key=>app$1.component(key,componentsMap[key]))}var _sfc_main$325={};function _sfc_render$5(_ctx,_cache){return null}var layoutEmpty_default=__plugin_vue_export_helper_default(_sfc_main$325,[[`render`,_sfc_render$5]]);const LAYOUT_ALIGNMENTS={left:`flex-start`,right:`flex-end`,center:`center`};var _sfc_main$324={},_hoisted_1$287={class:`layout-wrapper layout-safezones`},_hoisted_2$235={class:`layout-content`};function _sfc_render$4(_ctx,_cache,$props,$setup,$data,$options){return openBlock(),createElementBlock(`div`,_hoisted_1$287,[createBaseVNode(`div`,_hoisted_2$235,[renderSlot(_ctx.$slots,`default`,{},()=>[_cache[0]||=createTextVNode(`Content here`,-1)])])])}var layoutSingle_default=__plugin_vue_export_helper_default(_sfc_main$324,[[`render`,_sfc_render$4]]);const useEvents=(onDispose=onBeforeUnmount)=>{let bridge$4=useBridge(),events$3={_on:{},_once:{},on(name,func){name in events$3._on||(events$3._on[name]=[]),events$3._on[name].indexOf(func)===-1&&(bridge$4.events.on(name,func),events$3._on[name].push(func))},once(name,func){name in events$3._once||(events$3._once[name]=[]),events$3._once[name].indexOf(func)===-1&&(bridge$4.events.once(name,()=>{let idx=events$3._once[name].indexOf(func);idx>-1&&events$3._once[name].splice(idx,1)}),bridge$4.events.once(name,func),events$3._once[name].push(func))},off(name=void 0,func=void 0){if(!name){for(let name$1 in events$3._on){for(let func$1 of events$3._on[name$1])bridge$4.events.off(name$1,func$1);delete events$3._on[name$1]}return}if(name in events$3._on)if(func){let idx=events$3._on[name].indexOf(func);idx>-1&&(bridge$4.events.off(name,func),events$3._on[name].splice(idx,1)),events$3._on[name].length===0&&delete events$3._on[name]}else{for(let func$1 of events$3._on[name])bridge$4.events.off(name,func$1);delete events$3._on[name]}},emit(name,...values){bridge$4.events.emit(name,...values)}};return onDispose(()=>{for(let type of[`_on`,`_once`])for(let name in events$3[type]){for(let func of events$3[type][name])bridge$4.events.off(name,func);delete events$3[type][name]}}),events$3},useStreams=(names,callback,onDispose=onBeforeUnmount)=>{let bridge$4=useBridge(),enabled=!1,streams={on(){enabled||(enabled=!0,bridge$4.streams.add(names),bridge$4.events.on(`onStreamsUpdate`,callback))},off(){enabled&&(enabled=!1,bridge$4.streams.remove(names),bridge$4.events.off(`onStreamsUpdate`,callback))}};return streams.on(),onDispose(streams.off),streams};var hints_default=`ui.hints.quickSteerResponse,ui.hints.raceBrakesEffectiveness,ui.hints.quickCameraMovement,ui.hints.grabVehicleParts,ui.hints.funStabilityControl,ui.hints.recoverVehicle,ui.hints.oldCarsBurn,ui.hints.smokingWheels,ui.hints.carsBurnFuel,ui.hints.delicateCars,ui.hints.stabilityControlPresent,ui.hints.absWasOptional,ui.hints.installRollCage,ui.hints.spatialNavigation,ui.hints.repairHood,ui.hints.slowMotionPhysics,ui.hints.removeRearSeats,ui.hints.tuning,ui.hints.customLicensePlate,ui.hints.driveAtNight,ui.hints.moonGravity,ui.hints.unlockExtraFunctionality,ui.hints.playMultiseat,ui.hints.increaseGroundClearance,ui.hints.tiresBurstOnBumps,ui.hints.blueSmokeIsPistonDamage,ui.hints.keepTheEngineUpright,ui.hints.thermalDebugApp,ui.hints.rollPitchApps,ui.hints.cruiseControlApp,ui.hints.driveTheCanon,ui.hints.vehicleSkins,ui.hints.toggleMods,ui.hints.importveFramerate,ui.hints.photoModeMenu,ui.hints.publishScreenshots,ui.hints.towTrailer,ui.hints.brakesAndSteeringVary,ui.hints.countersteerEarly,ui.hints.startSlow,ui.hints.parkingbrakeForTurning,ui.hints.carefulWithOldSportsCars,ui.hints.corneringWithKeyboard,ui.hints.adaptToBadRoads,ui.hints.notAllCarsCanRace,ui.hints.changeBrakePads,ui.hints.useTurnSignals,ui.hints.showStandalonePcs,ui.hints.tweakFOV,ui.hints.driveWithMouse,ui.hints.liftOffOversteer,ui.hints.snapOversteer,ui.hints.slideBackWithParkingBrake,ui.hints.customizeSpecializedBindings,ui.hints.toggleFogLights,ui.hints.toggleLightBars,ui.hints.TrackIRSupported,ui.hints.chooseShiftingMode,ui.hints.saveRestoreVehicleHome,ui.hints.switchVehicle,ui.hints.coolantVaporizes,ui.hints.dontRunIntoTheCar`.split(`,`),_hoisted_1$286={key:0,class:`progress-box`},_hoisted_2$234={class:`progress-icon-group`},_hoisted_3$208={class:`progress-bar-container`},_hoisted_4$178={class:`progress-status`},_hoisted_5$153={class:`progress-history`},_hoisted_6$132={class:`custom-left-container`},_hoisted_7$118={key:0,class:`custom-text-panel`},_hoisted_8$99={key:1,class:`text`},_hoisted_9$89={key:1,class:`custom-indeterminate-panel`},_hoisted_10$77={class:`custom-right-container`},_hoisted_11$69={key:2,class:`tips-bar`},_hoisted_12$57={class:`tips-bar-title`},_hoisted_13$49={class:`tips-bar-tip`},_hoisted_14$44={key:0,class:`loading-cache`},_hoisted_15$42=[`src`],imagesAmount=18,activeRepeatTime=1e4,fadeInDefault=1e3,fadeOutDefault=2e3,_sfc_main$323={__name:`LoadingScreen`,setup(__props){useCssVars(_ctx=>({v79c091d8:fadeInTimeVar.value,v07559aed:fadeOutTimeVar.value}));let events$3=useEvents(),{lua}=useBridge(),navBlocker=useUINavBlocker(),lastImageNum=-1,repeatTimer=null,customTimer=null,iconsList=[{id:`terrain`,icon:icons.terrain},{id:`environment`,icon:icons.water},{id:`forest`,icon:icons.trafficCone},{id:`meshes`,icon:icons.garage01},{id:`roads`,icon:icons.road},{id:`beamng`,icon:icons.beamNG}],state=reactive({active:!1,visible:!1,fading:!1,shown:!1,autoActivate:!0,highSeas:!1,mode:`progress`,image:null,iconState:{},currentEntries:[],historyEntriesDisplay:[],customContent:null,fadeInTime:fadeInDefault,fadeOutTime:fadeOutDefault,customPause:-1});function resetState(){state.mode=`progress`,state.customContent=null,state.iconState={},state.currentEntries=[],state.historyEntriesDisplay=[],state.fadeInTime=fadeInDefault,state.fadeOutTime=fadeOutDefault,state.customPause=-1}let tip=ref(``),setTip=(txt=void 0,_retrying=!1)=>{let idx=~~(Math.random()*hints_default.length);tip.value=txt||hints_default[idx],(!tip.value||tip.value===`undefined`)&&(logger_default.debug(`Loading Screen tip is undefined!\nARG: ${JSON.stringify(txt)} TIP: ${JSON.stringify(tip.value)} IDX: ${idx}/${hints_default.length}`),_retrying?tip.value=``:setTip(void 0,!0))},fadeInTimeVar=computed(()=>state.fadeInTime+`ms`),fadeOutTimeVar=computed(()=>state.fadeOutTime+`ms`),progressValue=computed(()=>state.currentEntries[0]?.progress||0),currentStatus=computed(()=>state.currentEntries[0]?.message||``);events$3.on(`LoadingScreen`,data=>{if(window.beamng?.ingame){if((!data||typeof data!=`object`)&&(data={}),state.autoActivate=!1,state.active=!!data.active,data.custom&&(state.mode=`custom`,state.fadeInTime=data.custom.fadeIn>0?data.custom.fadeIn*1e3:state.fadeInTime||0,state.fadeOutTime=data.custom.fadeOut>0?data.custom.fadeOut*1e3:state.fadeOutTime||0),state.active)data.custom?(state.customPause=data.custom.pause?data.custom.pause*1e3:-1,state.customContent=data.custom.data,state.customContent?.image&&(state.image=state.customContent.image)):(resetState(),window.bngVue.gotoAngularState(`blank`)),setTip(state.customContent?.tips);else if(state.mode===`progress`&&`gotoMainMenu`in data){let args=[];data.gotoMainMenu?args.push(`menu.mainmenu`):args.push(`menu`,[`loading`]),window.globalAngularRootScope?.$broadcast(`ChangeState`,...args),window.vueEventBus?.emit(`onChangeState`,...args)}}}),events$3.on(`UpdateLoadingProgressV2`,data=>{if(!window.beamng?.ingame||!state.autoActivate&&!state.active)return;let{currentEntries,historyEntries}=data;(!currentEntries||!Array.isArray(currentEntries))&&(currentEntries=[]),(!historyEntries||!Array.isArray(historyEntries))&&(historyEntries=[]),state.currentEntries=currentEntries,state.historyEntriesDisplay=historyEntries.slice(Math.max(historyEntries.length-3,1)),state.iconState={};for(let{name,progress}of currentEntries)state.iconState[name.toLowerCase()]=progress;for(let{name}of historyEntries)state.iconState[name.toLowerCase()]=100;state.autoActivate&&(state.active=currentEntries.length>0||historyEntries.length>0)});let onFadeIn=()=>{state.fading=!1,state.mode===`progress`?(lua.core_gamestate.loadingScreenActive(),repeatTimer=setTimeout(()=>{lua.core_gamestate.loadingScreenActive()},activeRepeatTime)):state.mode===`custom`&&(lua.extensions.ui_fadeScreen.onScreenFadeStateDelayed(1),state.customPause!==-1&&(customTimer=setTimeout(()=>{lua.extensions.ui_fadeScreen.onScreenFadeStateDelayed(2)},state.customPause*1e3)))},onFadeOut=()=>{state.fading=!1,state.shown=!1,state.mode===`custom`&&lua.extensions.ui_fadeScreen.onScreenFadeStateDelayed(3),resetState(),loadNextImage()};watch(()=>state.active,(newActive,oldActive)=>{window.beamng?.ingame&&(newActive&&!oldActive?activateLoading():!newActive&&oldActive&&deactivateLoading())});let activateLoading=()=>{state.active&&(deactivateLoading.cancel(),navBlocker.allowOnly([]),nextTick(()=>{state.visible=!0,state.fading=!0,state.shown=!0}))},deactivateLoading=debounce(()=>{state.active||(clearTimers(),navBlocker.clear(),nextTick(()=>{state.visible=!1,state.fading=!0}))},100),getRandomImageNum=()=>{let rnd=~~(Math.random()*imagesAmount)+1;return rnd===lastImageNum?getRandomImageNum():(lastImageNum=rnd,rnd)},getNextImageUrl=()=>{let url;return url=state.highSeas?`images/mainmenu/unofficial_version.jpg`:`images/loading/drive/${getRandomImageNum()}.jpg`,getAssetURL(url)},loadNextImage=async()=>{let url=getNextImageUrl();state.image!==url&&(await loadImage$1(url),state.image=url)},loadImage$1=url=>new Promise((resolve$1,reject)=>{let img=new Image;img.onload=()=>resolve$1(url),img.onerror=()=>reject(url),img.src=url}),clearTimers=()=>{repeatTimer&&=(clearTimeout(repeatTimer),null),customTimer&&=(clearTimeout(customTimer),null)},initLoadingScreen=()=>bngApi.engineLua(`sailingTheHighSeas`,async ahoy=>{state.highSeas=ahoy===!0,await loadNextImage(),setTip(),lua.core_gamestate.loadingScreenActive(),window.loadingTest=active=>{events$3.emit(`LoadingScreen`,{active})}});return onMounted(()=>{linkLoadingScreenState(state),initLoadingScreen()}),onUnmounted(()=>clearTimers()),(_ctx,_cache)=>(openBlock(),createElementBlock(Fragment,null,[createVNode(Transition,{name:`loading-fade`,onAfterEnter:onFadeIn,onAfterLeave:onFadeOut},{default:withCtx(()=>[state.visible?(openBlock(),createElementBlock(`dialog`,{key:0,open:``,class:normalizeClass([`loading-screen`,`loading-screen-${state.mode}`])},[createBaseVNode(`div`,{class:`loading-background`,style:normalizeStyle({backgroundImage:state.image?`url('${state.image}')`:`none`})},null,4),state.mode===`progress`?(openBlock(),createElementBlock(`div`,_hoisted_1$286,[createBaseVNode(`div`,_hoisted_2$234,[(openBlock(),createElementBlock(Fragment,null,renderList(iconsList,iconInfo=>createBaseVNode(`div`,{key:iconInfo.id,class:`progress-icon-box`,style:normalizeStyle({backgroundPosition:`0 ${state.iconState[iconInfo.id]||0}%`})},[createVNode(unref(bngIcon_default),{type:iconInfo.icon,color:`#fff`,class:`progress-icon`},null,8,[`type`])],4)),64))]),createBaseVNode(`div`,_hoisted_3$208,[createVNode(unref(bngProgressBar_default),{class:`progress-bar`,gradient:``,"show-value-label":!1,min:0,max:100,value:progressValue.value},null,8,[`value`])]),createBaseVNode(`div`,_hoisted_4$178,toDisplayString(currentStatus.value||_ctx.$tt(`ui.common.loading`)),1),createBaseVNode(`div`,_hoisted_5$153,[(openBlock(!0),createElementBlock(Fragment,null,renderList(state.historyEntriesDisplay,(item,idx)=>(openBlock(),createElementBlock(`div`,{key:idx},toDisplayString(item.message),1))),128))])])):createCommentVNode(``,!0),state.mode===`custom`?(openBlock(),createElementBlock(`div`,{key:1,class:normalizeClass([`custom-box`,{"custom-with-tips":state.customContent?.tips}])},[createBaseVNode(`div`,_hoisted_6$132,[state.customContent&&(state.customContent.title||state.customContent.text)?(openBlock(),createElementBlock(`div`,_hoisted_7$118,[state.customContent.title?(openBlock(),createBlock(unref(bngScreenHeading_default),{key:0,preheadings:[_ctx.$tt(state.customContent.subtitle)]},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(state.customContent.title)),1)]),_:1},8,[`preheadings`])):createCommentVNode(``,!0),state.customContent.text?(openBlock(),createElementBlock(`p`,_hoisted_8$99,[createVNode(unref(dynamicComponent_default),{"translate-id":state.customContent.text,bbcode:``,"translate-context":``},null,8,[`translate-id`])])):createCommentVNode(``,!0)])):(openBlock(),createElementBlock(`div`,_hoisted_9$89,[createVNode(unref(bngScreenHeading_default),null,{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(`ui.common.loading.short`)),1)]),_:1}),createVNode(unref(bngProgressBar_default),{class:`progress-bar`,gradient:``,"show-value-label":!1,min:0,max:100,indeterminate:``})]))]),createBaseVNode(`div`,_hoisted_10$77,[state.customContent&&state.customContent.image?(openBlock(),createElementBlock(`div`,{key:0,class:`custom-image-panel`,style:normalizeStyle({backgroundImage:`url('${state.customContent.image}')`})},null,4)):createCommentVNode(``,!0)])],2)):createCommentVNode(``,!0),state.mode===`progress`||state.customContent?.tips?(openBlock(),createElementBlock(`div`,_hoisted_11$69,[createBaseVNode(`div`,_hoisted_12$57,toDisplayString(_ctx.$tt(`ui.loadingScreen.tips`))+`:`,1),createBaseVNode(`div`,_hoisted_13$49,[createVNode(unref(dynamicComponent_default),{"translate-id":tip.value,bbcode:``},null,8,[`translate-id`])])])):createCommentVNode(``,!0)],2)):createCommentVNode(``,!0)]),_:1}),state.image?(openBlock(),createElementBlock(`div`,_hoisted_14$44,[createBaseVNode(`img`,{src:state.image,alt:``},null,8,_hoisted_15$42)])):createCommentVNode(``,!0)],64))}},LoadingScreen_default=__plugin_vue_export_helper_default(_sfc_main$323,[[`__scopeId`,`data-v-2f135df0`]]),_hoisted_1$285={class:`pause-button-wrapper`},_sfc_main$322={__name:`pauseButton`,props:{teleportTo:[String,Object]},setup(__props){let route=useRoute(),events$3=useEvents(),gameContext=useGameContextStore(),isGamePaused=ref(!1),physicsMaybePaused=ref(!1),replayActive=ref(!1),replayPaused=ref(!1);events$3.on(`physicsStateChanged`,state=>{physicsMaybePaused.value=!state}),events$3.on(`replayStateChanged`,core_replay=>{replayActive.value=core_replay.state===`playback`,replayPaused.value=replayActive.value&&core_replay.paused}),events$3.on(`simTimeAuthority.pauseStateChanged`,data=>{isGamePaused.value=data.paused});let isInMenu=computed(()=>route.name?.startsWith(`menu`)&&!gameContext.activities?.length&&sysInfo_default.gameState.value!==void 0&&sysInfo_default.gameState.value!==`loading`),isPhysicsPaused=computed(()=>physicsMaybePaused.value),isReplayPaused=computed(()=>replayActive.value&&replayPaused.value),showPauseButton=computed(()=>isInMenu.value||isPhysicsPaused.value||isReplayPaused.value),isPaused=computed(()=>isGamePaused.value||isPhysicsPaused.value||isReplayPaused.value),buttonState=computed(()=>isInMenu.value&&isPaused.value?`menu-paused`:isInMenu.value?`menu`:isPaused.value?`paused`:`default`),togglePause=()=>{Lua_default.simTimeAuthority.togglePause()};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$285,[(openBlock(),createBlock(Teleport,{disabled:!__props.teleportTo,to:__props.teleportTo},[withDirectives((openBlock(),createBlock(unref(bngButton_default),{class:normalizeClass([`pause-button`,buttonState.value]),accent:unref(ACCENTS).custom,"no-sound":``,onClick:togglePause,"bng-no-nav":``},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{class:`pause-button-binding-bg`,action:`pause`}),createVNode(unref(bngIcon_default),{class:`pause-button-icon`,type:isPaused.value?unref(icons).pause:unref(icons).play},null,8,[`type`])]),_:1},8,[`class`,`accent`])),[[vShow,showPauseButton.value],[unref(BngTooltip_default),_ctx.$tt(`ui.inputActions.general.pause.title`),void 0,{bottom:!0}]])],8,[`disabled`,`to`]))]))}},pauseButton_default=__plugin_vue_export_helper_default(_sfc_main$322,[[`__scopeId`,`data-v-ea9a26b4`]]),UIAppStorage,setupDone;const useUIApps=()=>(setupDone||setup(),service);var setup=()=>{UIAppStorage||=window.UIAppStorage,setupDone=!!UIAppStorage},setLayout=layoutName=>{layoutName==`blank`?_broadcast(`appContainer:clear`):_broadcast(`appContainer:loadLayoutByType`,layoutName)},setVisible=state=>{_broadcast(`ShowApps`,!!state)},service={setLayout,setVisible,get currentLayout(){return UIAppStorage.currentLayout}},_broadcast=(...params)=>{window.globalAngularRootScope&&window.globalAngularRootScope.$broadcast(...params)},_sfc_main$321={};function _sfc_render$3(_ctx,_cache){return openBlock(),createElementBlock(`span`)}var NotFound_default=__plugin_vue_export_helper_default(_sfc_main$321,[[`render`,_sfc_render$3]]);function useGridSelector(backendName=`gridSelector`,defaultPath={keys:[`missions`]},defaultDetailsMode=`detail`){let currentPath=ref(defaultPath),previousPath=ref(null),groups=ref([]),filterList=ref([]),filterByProp=ref([]),commonFilters=ref([]),lockedFiltersByProp=ref([]),activeFilters=ref([]),onlyCommonFilters=ref(!0),detailsMode=ref(defaultDetailsMode),selectedItem=ref(null),selectedItemDetails=ref(null),prevSelectedItem=ref(null),previewItem=ref(null),previewItemDetails=ref(null),managementDetails=ref(null),autoFocusKey=ref(null),showScreenHeader=ref(!0),screenHeaderTitle=ref(`Grid Selector`),screenHeaderPath=ref([{text:`Menu`,gotoAngularState:`menu`}]),{events:events$3}=useBridge(),backFromDetailsCallback=null,refreshAllHandler=backendName$1=>{backendName$1===backendName$1&&(logger_default.debug(`gridSelectorRefreshAll`),loadTiles(),loadFilters(),loadManagementDetails())},refreshCurrentItemDetailsHandler=backendName$1=>{backendName$1===backendName$1&&(logger_default.debug(`gridSelectorRefreshCurrentItemDetails`),setSelectedItem(selectedItem.value))};events$3.on(`gridSelectorRefreshAll`,refreshAllHandler),events$3.on(`gridSelectorRefreshCurrentItemDetails`,refreshCurrentItemDetailsHandler);let log=(...args)=>{},displayData=ref([]),searchText$1=ref(``);async function getSearchText(){try{let data=await Lua_default.ui_gridSelector.getSearchText(backendName);return searchText$1.value=data||``,data||``}catch(error){return logger_default.error(`Failed to get search text:`,error),``}}async function setSearchText(value){try{await Lua_default.ui_gridSelector.setSearchText(backendName,value),searchText$1.value=value||``,await loadTiles(),await loadFilters(),await updateScreenHeaderData()}catch(error){logger_default.error(`Failed to set search text:`,error)}}let isInitializing=ref(!1),safeArray=arr=>Array.isArray(arr)?arr:[];async function setCurrentPath(path){currentPath.value=path,await loadTiles()}async function loadTiles(){currentPath.value;try{let data=await Lua_default.ui_gridSelector.getTiles(backendName,currentPath.value,previousPath.value!==currentPath.value);if(Lua_default.ui_gridSelector.profilerFinish(backendName,`received lua data on UI`),groups.value=safeArray(data),groups.value,!selectedItem.value&&(detailsMode.value===`advanced`||detailsMode.value===`detail`)&&previousPath.value!==currentPath.value)for(let group of groups.value)for(let tile of group.tiles)tile.isDefaultSelected&&(autoFocusKey.value=tile.key,tile.name,tile.forceAutoFocus&&backFromDetailsCallback());previousPath.value=currentPath.value,Lua_default.ui_gridSelector.profilerFinish(backendName,`loaded tiles into reactive state`)}catch(error){logger_default.error(`Failed to load tiles:`,error)}}async function loadFilters(){try{let data=await Lua_default.ui_gridSelector.getFilters(backendName);filterList.value=safeArray(data.filterList),filterByProp.value=data.filterByProp,commonFilters.value=safeArray(data.commonFilters)||[],lockedFiltersByProp.value=data.lockedFiltersByProp||[],activeFilters.value=safeArray(data.activeFilters),onlyCommonFilters.value=data.onlyCommonFilters,filterList.value,filterByProp.value,activeFilters.value,onlyCommonFilters.value}catch(error){logger_default.error(`Failed to load filters:`,error)}}async function loadManagementDetails(){try{managementDetails.value=await Lua_default.ui_gridSelector.getManagementDetails(backendName),managementDetails.value}catch(error){logger_default.error(`Failed to load management details:`,error)}}async function toggleFilter(propName,option){try{await Lua_default.ui_gridSelector.toggleFilter(backendName,propName,option),await loadFilters(),await loadTiles(),await updateScreenHeaderData()}catch(error){logger_default.error(`Failed to toggle filter:`,error)}}async function updateRangeFilter(propName,min$1,max$1){try{await Lua_default.ui_gridSelector.updateRangeFilter(backendName,propName,min$1,max$1),await loadFilters(),await loadTiles(),await updateScreenHeaderData()}catch(error){logger_default.error(`Failed to update range filter:`,error)}}async function resetRangeFilter(propName){console.log(`Resetting range filter:`,propName);try{await Lua_default.ui_gridSelector.resetRangeFilter(backendName,propName),await loadFilters(),await loadTiles(),await updateScreenHeaderData()}catch(error){logger_default.error(`Failed to reset range filter:`,error)}}async function resetSetFilter(propName){try{await Lua_default.ui_gridSelector.resetSetFilter(backendName,propName),await loadFilters(),await loadTiles(),await updateScreenHeaderData()}catch(error){logger_default.error(`Failed to reset set filter:`,error)}}async function loadDisplayData(){try{displayData.value=safeArray(await Lua_default.ui_gridSelector.getDisplayDataOptions(backendName));let searchOption=displayData.value.find(option=>option.key===`searchText`);searchOption&&(searchText$1.value=searchOption.value||``),displayData.value}catch(error){logger_default.error(`Failed to load display data:`,error)}}async function updateDisplayData(key,value){try{await Lua_default.ui_gridSelector.setDisplayDataOption(backendName,key,value),await loadDisplayData(),await loadTiles(),await updateScreenHeaderData()}catch(error){logger_default.error(`Failed to update display data:`,error)}}async function resetDisplayDataToDefaults(){try{await Lua_default.ui_gridSelector.resetDisplayDataToDefaults(backendName),await loadDisplayData(),await loadTiles(),await updateScreenHeaderData()}catch(error){logger_default.error(`Failed to reset display data to defaults:`,error)}}function setDetailsMode(mode){detailsMode.value=mode}async function setSelectedItem(item){if(!item||!item.showDetails){autoFocusKey.value=null,selectedItem.value=null,selectedItemDetails.value=null,await loadManagementDetails();return}try{item.showDetails;let details=await Lua_default.ui_gridSelector.getDetails(backendName,item.showDetails);autoFocusKey.value=item.key,selectedItem.value=item,selectedItemDetails.value=details,details?.paintData&&details?.paints&&selectedItemDetails.value?.paints&&(selectedItemDetails.value.paints.multiPaintSetups=safeArray(selectedItemDetails.value.paints.multiPaintSetups),selectedItemDetails.value.paints.factoryPaints=safeArray(selectedItemDetails.value.paints.factoryPaints)),setDetailsMode(`detail`)}catch(error){logger_default.error(`Failed to get item details:`,error),autoFocusKey.value=null,selectedItem.value=item,selectedItemDetails.value=null}}async function clearSelectedItem(){selectedItem.value=null,selectedItemDetails.value=null,await loadManagementDetails()}async function setPreviewItem(item){if(!item||!item.showDetails){previewItem.value=null,previewItemDetails.value=null;return}try{let details=await Lua_default.ui_gridSelector.getDetails(backendName,item.showDetails);previewItem.value=item,previewItemDetails.value=details,setDetailsMode(`detail`)}catch{previewItem.value=item,previewItemDetails.value=null}}function clearPreviewItem(){previewItem.value=null,previewItemDetails.value=null}let activeItem=computed(()=>selectedItem.value||previewItem.value),activeItemDetails=computed(()=>selectedItem.value?selectedItemDetails.value:previewItemDetails.value);async function executeButton(buttonId,additionalData){try{if(additionalData?.waitForLoadingScreen)window.vueEventBus?.emit(`LoadingScreen`,{active:!0}),await startLoading(async()=>{await waitForLoadingScreenFadeIn();let data=await Lua_default.ui_gridSelector.executeButton(backendName,buttonId,additionalData);data&&data.gotoPath&&setCurrentPath(data.gotoPath)});else{let data=await Lua_default.ui_gridSelector.executeButton(backendName,buttonId,additionalData);data&&data.gotoPath&&setCurrentPath(data.gotoPath)}}catch(error){logger_default.error(`Failed to execute button:`,error)}}let executeButtonHandler=(backendName$1,buttonId,additionalData)=>{backendName$1===backendName$1&&executeButton(buttonId,additionalData)};events$3.on(`gridSelectorExecuteButton`,executeButtonHandler);async function toggleFavourite(item){await Lua_default.ui_gridSelector.toggleFavourite(backendName,item.showDetails);let details=await Lua_default.ui_gridSelector.getDetails(backendName,item.showDetails);selectedItem.value=item,selectedItemDetails.value=details,await loadTiles()}function clearSearch(){setSearchText(``)}function updateSearch(newSearchText){setSearchText(newSearchText||``)}function commitSearch(){setSearchText(searchText$1.value||``)}function isFilterLocked(propName,option=null){return lockedFiltersByProp.value[propName]?option?lockedFiltersByProp.value[propName][option]!==void 0:Object.keys(lockedFiltersByProp.value[propName]).length>0:!1}async function updateScreenHeaderData(){try{let headerData=await Lua_default.ui_gridSelector.getScreenHeaderTitleAndPath(backendName,currentPath.value);screenHeaderTitle.value=headerData.title||`Grid Selector`,screenHeaderPath.value=headerData.pathSegments}catch(error){logger_default.error(`Failed to update screen header title:`,error),screenHeaderTitle.value=`Grid Selector`,screenHeaderPath.value=[{text:`Menu`,gotoAngularState:`menu`}]}}function isFilterOptionLocked(propName,option){return isFilterLocked(propName,option)}function isRangeFilterLocked(propName){return isFilterLocked(propName)}watch(currentPath,()=>{clearSelectedItem(),clearPreviewItem(),updateScreenHeaderData()}),watch([filterByProp,activeFilters],()=>{clearSelectedItem(),clearPreviewItem(),updateScreenHeaderData()}),watch(displayData,()=>{updateScreenHeaderData()},{deep:!0});function notifyUIReady(tag){Lua_default.ui_gridSelector.profilerFinish(backendName,tag)}function setOnBackFromDetailsCallback(callback){backFromDetailsCallback=callback}async function initialize(){if(!isInitializing.value)try{isInitializing.value=!0,await Promise.all([loadFilters(),loadDisplayData(),loadManagementDetails(),getSearchText()])}catch(error){logger_default.error(`Failed to initialize GridSelector composable:`,error)}finally{isInitializing.value=!1}}return onUnmounted(()=>{logger_default.debug(`GridSelector composable unmounting`),events$3.off(`gridSelectorRefreshAll`,refreshAllHandler),events$3.off(`gridSelectorRefreshCurrentItemDetails`,refreshCurrentItemDetailsHandler),events$3.off(`gridSelectorExecuteButton`,executeButtonHandler)}),{groups,filterList,filterByProp,lockedFiltersByProp,commonFilters,activeFilters,onlyCommonFilters,displayData,currentPath,detailsMode,selectedItem,selectedItemDetails,prevSelectedItem,previewItem,previewItemDetails,activeItem,activeItemDetails,managementDetails,isInitializing,searchText:searchText$1,getSearchText,setSearchText,autoFocusKey,showScreenHeader,screenHeaderTitle,screenHeaderPath,initialize,setCurrentPath,loadTiles,loadFilters,loadManagementDetails,toggleFilter,updateRangeFilter,resetRangeFilter,resetSetFilter,loadDisplayData,updateDisplayData,resetDisplayDataToDefaults,setDetailsMode,setSelectedItem,clearSelectedItem,setPreviewItem,clearPreviewItem,executeButton,notifyUIReady,isFilterLocked,isFilterOptionLocked,isRangeFilterLocked,toggleFavourite,clearSearch,updateSearch,commitSearch,updateScreenHeaderData,exploreFolder:function(path){Lua_default.ui_gridSelector.exploreFolder(backendName,path)},goToMod:function(modId){Lua_default.ui_gridSelector.goToMod(backendName,modId)},setOnBackFromDetailsCallback}}var _hoisted_1$284=[`bng-scoped-nav-autofocus`],_hoisted_2$233={class:`image-container`},_hoisted_3$207={key:0,class:`sub-element-count-badge`},_hoisted_4$177={class:`item-label`},_hoisted_5$152={class:`item-name`},_hoisted_6$131={class:`icons-container`},_hoisted_7$117=[`src`],_hoisted_8$98={key:0,class:`sub-element-count-badge`},_hoisted_9$88={key:1},sizes={tiny:{width:7.5,margin:.5,fontSize:.8},small:{width:9.5,margin:.5,fontSize:1},medium:{width:12,margin:.5,fontSize:1},large:{width:16,margin:.5,fontSize:1},huge:{width:20,margin:.5,fontSize:1.5},list:{width:22,height:3,margin:.5,fontSize:.9}},thumbAspectRatio=16/9.5,captionHeightEm=2,getSizeCalc=displaySize=>ctx=>{let size$3=sizes[displaySize]||sizes.medium;if(displaySize===`list`)return{width:size$3.width,height:size$3.height,margin:size$3.margin};let height$1=size$3.width/thumbAspectRatio+size$3.fontSize*captionHeightEm-size$3.margin*2;return{width:size$3.width,height:height$1,margin:size$3.margin}},__default__$6={getSizeCalc},_sfc_main$320=Object.assign(__default__$6,{__name:`Tile`,props:{tile:{type:Object,required:!0},isFavourite:Boolean,isConfig:Boolean,displaySize:String,tileImagesTopAligned:{type:Boolean,default:!1}},emits:[`focus`,`blur`,`click`,`dblclick`],setup(__props,{expose:__expose,emit:__emit}){let{showIfController}=storeToRefs(controls_default()),props=__props,gridSelectionState=inject(`gridSelectionState`,null),state=computed(()=>{let res={selected:!1,dimmed:!1,isAutoFocused:!1};return gridSelectionState&&gridSelectionState.value&&(res.selected=gridSelectionState.value.inDetails&&gridSelectionState.value.activeItemKey===props.tile.key,res.dimmed=showIfController.value&&gridSelectionState.value.inDetails&&gridSelectionState.value.activeItemKey!==props.tile.key,res.isAutoFocused=gridSelectionState.value.autoFocusKey===props.tile.key),res}),emit$1=__emit,elTile=ref(null);__expose({getElement:()=>elTile.value});let isListItem=computed(()=>props.displaySize===`list`);function onClick(){emit$1(`click`)}function onFocus(){emit$1(`focus`)}function onBlur(){emit$1(`blur`)}return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`tile-wrapper`,`tile-size-${__props.displaySize}`]),style:normalizeStyle({"--tile-font-size":sizes[__props.displaySize].fontSize+`em`})},[_cache[0]||=createBaseVNode(`div`,{class:`tile-bg`},null,-1),withDirectives((openBlock(),createElementBlock(`div`,{ref_key:`elTile`,ref:elTile,"bng-scoped-nav-autofocus":state.value.isAutoFocused,class:normalizeClass({tile:!0,selected:state.value.selected,dimmed:state.value.dimmed,auxiliary:__props.tile.isAuxiliary,"is-career-only":__props.tile.isCareerOnly}),onClick:withModifiers(onClick,[`stop`]),onFocus,onBlur,"bng-nav-item":``},[createBaseVNode(`div`,_hoisted_2$233,[createVNode(unref(bngImage_default),{class:normalizeClass([`item-image`,{"top-aligned":__props.tileImagesTopAligned}]),src:__props.tile.preview},null,8,[`class`,`src`]),isListItem.value?createCommentVNode(``,!0):(openBlock(),createElementBlock(Fragment,{key:0},[!__props.isConfig&&__props.tile.subElementCount>=1?(openBlock(),createElementBlock(`div`,_hoisted_3$207,toDisplayString(__props.tile.subElementCount),1)):createCommentVNode(``,!0),__props.isFavourite||__props.tile.showFavouriteIconPercent>=1?(openBlock(),createBlock(unref(bngIcon_default),{key:1,class:`favorite-indicator`,type:`star`})):createCommentVNode(``,!0)],64))]),createBaseVNode(`div`,_hoisted_4$177,[createBaseVNode(`span`,_hoisted_5$152,toDisplayString(__props.tile.name),1),createBaseVNode(`div`,_hoisted_6$131,[__props.tile.sourceIcons?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(__props.tile.sourceIcons,sourceIcon=>(openBlock(),createElementBlock(Fragment,{key:sourceIcon},[sourceIcon.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:sourceIcon.icon,class:`source-icon`,color:`var(--bng-cool-gray-100)`},null,8,[`type`])):createCommentVNode(``,!0),sourceIcon.svg?(openBlock(),createElementBlock(`img`,{key:1,class:`svg-icon`,src:sourceIcon.svg,alt:``},null,8,_hoisted_7$117)):createCommentVNode(``,!0)],64))),128)):createCommentVNode(``,!0),isListItem.value&&__props.tile.showFavouriteIconPercent>0?(openBlock(),createBlock(unref(bngIcon_default),{key:1,class:`favorite-indicator`,type:__props.tile.showFavouriteIconPercent>=1?`star`:`starSecondary`},null,8,[`type`])):createCommentVNode(``,!0)]),isListItem.value&&!__props.isConfig&&__props.tile.subElementCount>=1?(openBlock(),createElementBlock(`span`,_hoisted_8$98,toDisplayString(__props.tile.subElementCount),1)):isListItem.value?(openBlock(),createElementBlock(`span`,_hoisted_9$88)):createCommentVNode(``,!0)])],42,_hoisted_1$284)),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0,bubble:!0}],[unref(BngSoundClass_default),`bng_click_hover_generic`],[unref(BngDoubleClick_default),__props.tile.doubleClickDetails?()=>emit$1(`dblclick`):null,__props.tile.doubleClickMode]])],6))}}),Tile_default=__plugin_vue_export_helper_default(_sfc_main$320,[[`__scopeId`,`data-v-51fd3377`]]),_hoisted_1$283={class:`group-header`,"bng-list-title":``},_sfc_main$319={__name:`GroupHeader`,props:{label:{type:String,required:!0}},setup(__props){return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$283,[createVNode(bngCardHeading_default,{class:`header-label`},{default:withCtx(()=>[createTextVNode(toDisplayString(__props.label),1)]),_:1}),_cache[0]||=createBaseVNode(`div`,{class:`header-line`},null,-1)]))}},GroupHeader_default=__plugin_vue_export_helper_default(_sfc_main$319,[[`__scopeId`,`data-v-28596ef8`]]),_sfc_main$318={__name:`Grid`,props:{autoFocusKey:{type:String,default:null},activeItem:{type:Object,default:null},groups:{type:Array,required:!0},isConfig:{type:Boolean,default:!1},displaySize:{type:String,default:`medium`,validator:value=>[`tiny`,`small`,`medium`,`large`,`huge`,`list`].includes(value)},inDetails:{type:Boolean,default:!1},backendName:{type:String,default:`gridSelector`},tileImagesTopAligned:{type:Boolean,default:!1},doubleClickOverride:{type:Function,default:null}},emits:[`select-item`,`deselect-item`,`focus-item`],setup(__props,{emit:__emit}){let{showIfController}=storeToRefs(controls_default()),props=__props,emit$1=__emit,gridListRef=ref(),containerWidth=ref(0),baseFontSize=ref(16),tileSizeCalc=ctx=>Tile_default.getSizeCalc(props.displaySize)(ctx),maxTilesPerRow=computed(()=>{if(!containerWidth.value)return 1/0;let size$3=Tile_default.getSizeCalc(props.displaySize)({}),tileWidthPx=(size$3.width+size$3.margin)*baseFontSize.value;return(Math.floor(containerWidth.value/tileWidthPx)||1)*(props.displaySize===`list`?2:1)}),limitedGroups=computed(()=>props.groups.map(group=>({...group,tiles:group.isRecentGroup?group.tiles.slice(0,maxTilesPerRow.value):group.tiles}))),updateContainerWidth=()=>{gridListRef.value?.$el&&(containerWidth.value=gridListRef.value.$el.clientWidth,baseFontSize.value=parseFloat(getComputedStyle(document.documentElement).fontSize)||16)},resizeObserver;onMounted(()=>{updateContainerWidth(),gridListRef.value?.$el&&(resizeObserver=new ResizeObserver(debounce(updateContainerWidth,100)),resizeObserver.observe(gridListRef.value.$el))}),onUnmounted(()=>{resizeObserver&&resizeObserver.disconnect()}),provide(`gridSelectionState`,computed(()=>({inDetails:props.inDetails,activeItemKey:props.activeItem?.key||null,autoFocusKey:props.autoFocusKey})));let focusItem=tile=>{props.inDetails||(showIfController.value&&preselectItem(tile),emit$1(`focus-item`,tile))},selectItem=tile=>{preselectItem.cancel(),emit$1(`select-item`,tile)},preselectItem=debounce(tile=>emit$1(`select-item`,tile,!1),200),handleDoubleClick=async item=>{if(console.log(`handleDoubleClick`,item),item.doubleClickDetails)try{props.doubleClickOverride?props.doubleClickOverride(item):await Lua_default.ui_gridSelector.executeDoubleClick(props.backendName,item.doubleClickDetails)}catch(error){console.error(`Failed to execute double click:`,error)}};return(_ctx,_cache)=>(openBlock(),createBlock(unref(bngList_default),{ref_key:`gridListRef`,ref:gridListRef,class:`grid-list`,layout:unref(LIST_LAYOUTS).TILES,"no-background":``,big:``,immediate:``,"keep-alive":500,"title-width":20,"title-height":1.5,"title-margin":.5,"tile-size-calc":tileSizeCalc},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(limitedGroups.value,group=>(openBlock(),createElementBlock(Fragment,{key:group.label},[group.label?(openBlock(),createBlock(GroupHeader_default,{key:0,label:group.label,"bng-list-title":``},null,8,[`label`])):createCommentVNode(``,!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(group.tiles,tile=>(openBlock(),createBlock(Tile_default,{key:tile.key,tile,"is-config":__props.isConfig,"display-size":__props.displaySize,"is-favourite":group.label===`Favourites`,"tile-images-top-aligned":__props.tileImagesTopAligned,onFocus:$event=>focusItem(tile),onClick:$event=>selectItem(tile),onDblclick:$event=>handleDoubleClick(tile)},null,8,[`tile`,`is-config`,`display-size`,`is-favourite`,`tile-images-top-aligned`,`onFocus`,`onClick`,`onDblclick`]))),128))],64))),128))]),_:1},8,[`layout`]))}},Grid_default$1=__plugin_vue_export_helper_default(_sfc_main$318,[[`__scopeId`,`data-v-efa73a51`]]),_hoisted_1$282={class:`display-controls-container`},_hoisted_2$232={class:`control-group-label`},_hoisted_3$206={key:0,class:`reset-button-container`},_sfc_main$317={__name:`DisplayControls`,props:{displayData:{type:Array,required:!0},detailsMode:{type:String,required:!0},updateDisplayData:{type:Function,required:!0},resetDisplayDataToDefaults:{type:Function,required:!0},setDetailsMode:{type:Function,required:!0}},emits:[`focus-item`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,booleanToStringByKey=computed(()=>{let valuesByKey={};for(let option of props.displayData)if(option.type===`checkbox`){valuesByKey[option.key]={};for(let checkboxOption of option.options)valuesByKey[option.key][checkboxOption.value]=checkboxOption.label||(checkboxOption.value?`Yes`:`No`)}return valuesByKey}),controls$1=computed(()=>props.displayData.filter(x=>x.showInModes?.[props.detailsMode]).map(x=>({...x,checkboxLabel:x.type===`checkbox`?booleanToStringByKey.value[x.key]?.[x.value]:void 0}))),onOptionChanged=(key,newValue)=>{props.updateDisplayData(key,newValue),emit$1(`focus-item`,key)},resetToDefaults=()=>{props.resetDisplayDataToDefaults()};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$282,[createBaseVNode(`div`,{class:normalizeClass([`display-controls`,{"display-controls-list":__props.detailsMode===`displayControls`||__props.detailsMode===`default`}])},[(openBlock(!0),createElementBlock(Fragment,null,renderList(controls$1.value,option=>(openBlock(),createElementBlock(`div`,{key:option.key,class:normalizeClass([`control-group`,{"force-full-width":__props.detailsMode===`default`}])},[createBaseVNode(`div`,_hoisted_2$232,toDisplayString(option.label),1),createVNode(bngTooltip_default,{text:option.description||`No description available`,position:`top`},{default:withCtx(()=>[option.type===`dropdown`?(openBlock(),createBlock(unref(bngSmartSelect_default),{key:0,modelValue:option.value,items:option.options||[],"onUpdate:modelValue":newValue=>onOptionChanged(option.key,newValue),threshold:8},null,8,[`modelValue`,`items`,`onUpdate:modelValue`])):option.type===`checkbox`?(openBlock(),createBlock(unref(bngSwitch_default),{key:1,class:normalizeClass([`full-width-checkbox`,{active:option.value}]),modelValue:option.value,"onUpdate:modelValue":newValue=>onOptionChanged(option.key,newValue),labelBefore:``,alwaysTransparent:``},{default:withCtx(()=>[createTextVNode(toDisplayString(option.checkboxLabel),1)]),_:2},1032,[`class`,`modelValue`,`onUpdate:modelValue`])):option.type===`number`?(openBlock(),createBlock(unref(bngInputNew_default),{key:2,modelValue:option.value,min:option.min,max:option.max,showExternalButton:!1,type:`number`,"onUpdate:modelValue":newValue=>onOptionChanged(option.key,newValue)},null,8,[`modelValue`,`min`,`max`,`onUpdate:modelValue`])):createCommentVNode(``,!0)]),_:2},1032,[`text`])],2))),128))],2),__props.detailsMode===`displayControls`?(openBlock(),createElementBlock(`div`,_hoisted_3$206,[createVNode(unref(bngButton_default),{onClick:resetToDefaults,accent:`attention`,iconLeft:`trashBin1`,class:`reset-button`},{default:withCtx(()=>[..._cache[0]||=[createTextVNode(` Reset to Defaults `,-1)]]),_:1})])):createCommentVNode(``,!0)]))}},DisplayControls_default=__plugin_vue_export_helper_default(_sfc_main$317,[[`__scopeId`,`data-v-863e411a`]]),_sfc_main$316={__name:`SearchBar`,props:{searchText:{type:String,required:!0},setSearchText:{type:Function,required:!0},placeholder:{type:String,default:`Search...`},fullWidth:{type:Boolean,default:!1},showClearAllButton:{type:Boolean,default:!1}},emits:[`focus-item`,`clear-all`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,clearSearch=()=>{props.setSearchText(``),emit$1(`focus-item`,`search`)},commitSearch=()=>{},onSearchChanged=value=>{props.setSearchText(value),emit$1(`focus-item`,`search`)};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`search-container`,{"full-width":__props.fullWidth}])},[createVNode(unref(bngInput_default),{class:`search-input`,modelValue:__props.searchText,placeholder:__props.placeholder,onValueChanged:onSearchChanged,onKeydown:withKeys(commitSearch,[`enter`]),onBlur:commitSearch,onFocus:_cache[0]||=$event=>emit$1(`focus-item`,`search`)},null,8,[`modelValue`,`placeholder`]),createBaseVNode(`div`,{class:normalizeClass([`search-icon-container`,{active:__props.searchText}]),onClick:clearSearch},[createVNode(unref(bngIcon_default),{type:unref(icons).search,class:`search-icon show-unhovered`},null,8,[`type`]),createVNode(unref(bngIcon_default),{type:unref(icons).trashBin2,class:`search-icon show-hovered`},null,8,[`type`])],2)],2))}},SearchBar_default=__plugin_vue_export_helper_default(_sfc_main$316,[[`__scopeId`,`data-v-67aff9c0`]]),_hoisted_1$281={class:`filters`},_hoisted_2$231={key:0,class:`search-section`},_hoisted_3$205={key:1,class:`filter-options-grid`},_hoisted_4$176={class:`option-label`},_hoisted_5$151={class:`option-icon`},_hoisted_6$130={key:2,class:`filters-container`},_hoisted_7$116={class:`filter-container`,navigable:``,tabindex:`0`},_hoisted_8$97={class:`filter-content`},_hoisted_9$87={key:0,class:`filter-options`},_hoisted_10$76={class:`filter-options-grid`},_hoisted_11$68={class:`option-label`},_hoisted_12$56={class:`option-icon`},_hoisted_13$48={key:1,class:`filter-options`},_hoisted_14$43={class:`range-bar-container`},_hoisted_15$41={class:`range-bar`},_hoisted_16$39={class:`range-inputs`},_hoisted_17$32={class:`range-input-group`},_hoisted_18$29={class:`range-input-group`},_sfc_main$315={__name:`DetailedFilters`,props:{filterList:{type:Array,required:!0},filterByProp:{type:Object,required:!0},searchText:{type:String,default:``},commonFilters:{type:Array,default:()=>[]},detailsMode:{type:String,required:!0},onlyCommonFilters:{type:Boolean,default:!0},isFilterLocked:{type:Function,required:!0},isFilterOptionLocked:{type:Function,required:!0},isRangeFilterLocked:{type:Function,required:!0},toggleFilter:{type:Function,required:!0},updateRangeFilter:{type:Function,required:!0},resetRangeFilter:{type:Function,required:!0},setSearchText:{type:Function,required:!0},setDetailsMode:{type:Function,required:!0}},emits:[`focus-item`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,expandedAccordions=ref({}),pendingRangeUpdates=ref({}),debouncedUpdateFunctions=ref({}),getDebouncedUpdate=propName=>(debouncedUpdateFunctions.value[propName]||(debouncedUpdateFunctions.value[propName]=debounce(()=>{if(pendingRangeUpdates.value[propName]){let{min:min$1,max:max$1}=pendingRangeUpdates.value[propName];props.updateRangeFilter(propName,min$1,max$1),delete pendingRangeUpdates.value[propName]}},300)),debouncedUpdateFunctions.value[propName]);onUnmounted(()=>{Object.values(debouncedUpdateFunctions.value).forEach(debouncedFn=>{debouncedFn&&debouncedFn.cancel&&debouncedFn.cancel()}),debouncedUpdateFunctions.value={},pendingRangeUpdates.value={}});let formatFilterName=key=>key,getFilterOptionClass=(propName,option)=>{let filter=props.filterList.find(f=>f.propName===propName);if(!filter||!filter.options)return``;let allEnabled=filter.options.every(opt=>props.filterByProp[propName]?.[opt]===!0),currentOptionEnabled=props.filterByProp[propName]?.[option]===!0;return allEnabled?`filter-neutral`:currentOptionEnabled?`filter-active`:`filter-inactive`},hasActiveFilters=propName=>{if(!props.filterList)return!1;let filter=props.filterList.find(f=>f.propName===propName);if(!filter)return!1;if(filter.type===`range`){let filterData=props.filterByProp[propName];if(!filterData)return!1;let currentMin=filterData.min,currentMax=filterData.max,defaultMin=filter.min,defaultMax=filter.max;return currentMin>defaultMin||currentMaxprops.filterByProp[propName]?.[option]===!1)},toggleFilter=(propName,option,event)=>{if(props.isFilterOptionLocked(propName,option)){console.log(`Cannot toggle locked filter:`,propName,option);return}event&&(event.preventDefault(),event.stopPropagation()),emit$1(`focus-item`,`filters`),props.toggleFilter(propName,option)},onRangeFilterChanged=(propName,newValue,field)=>{if(props.isRangeFilterLocked(propName)){console.log(`Cannot update locked range filter:`,propName);return}let filter=props.filterList.find(f=>f.propName===propName);if(!filter||filter.type!==`range`)return;let filterData=props.filterByProp[propName];if(!filterData)return;let currentPending=pendingRangeUpdates.value[propName],min$1=currentPending?currentPending.min:filterData.min,max$1=currentPending?currentPending.max:filterData.max;field===`min`?min$1=newValue:field===`max`&&(max$1=newValue),min$1=Math.max(filter.min,Math.min(filter.max,min$1)),max$1=Math.max(filter.min,Math.min(filter.max,max$1)),min$1>max$1&&([min$1,max$1]=[max$1,min$1]),pendingRangeUpdates.value[propName]={min:min$1,max:max$1},getDebouncedUpdate(propName)(),emit$1(`focus-item`,propName)},isFilterActive=filter=>hasActiveFilters(filter.propName),getRangeBarStyle=propName=>{let filter=props.filterList.find(f=>f.propName===propName);if(!filter||filter.type!==`range`)return{};let filterData=props.filterByProp[propName];if(!filterData)return{};let currentMin=filterData.min,currentMax=filterData.max,totalRange=filter.max-filter.min,leftPosition=(currentMin-filter.min)/totalRange*100,width$1=(currentMax-currentMin)/totalRange*100;return{left:`${leftPosition}%`,width:`${width$1}%`,backgroundColor:`var(--bng-orange-500)`}};return onMounted(()=>{props.filterList&&props.filterList.forEach(filter=>{hasActiveFilters(filter.propName)&&(expandedAccordions.value[filter.propName]=!0)})}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$281,[__props.detailsMode===`filter`?(openBlock(),createElementBlock(`div`,_hoisted_2$231,[createVNode(SearchBar_default,{searchText:__props.searchText,setSearchText:__props.setSearchText,placeholder:`Search items...`,"full-width":!0,onFocusItem:_cache[0]||=$event=>emit$1(`focus-item`,$event)},null,8,[`searchText`,`setSearchText`])])):createCommentVNode(``,!0),__props.detailsMode===`filter`?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_3$205,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.commonFilters,(filter,index)=>(openBlock(),createBlock(unref(bngPill_default),{key:index,class:normalizeClass([[getFilterOptionClass(filter[0],filter[1]),{"filter-locked":props.isFilterOptionLocked(filter[0],filter[1])}],`filter-option-chip`]),style:normalizeStyle({cursor:props.isFilterOptionLocked(filter[0],filter[1])?`not-allowed`:`pointer`}),"bng-nav-item":``,onClick:$event=>toggleFilter(filter[0],filter[1])},{default:withCtx(()=>[createBaseVNode(`span`,_hoisted_4$176,toDisplayString(filter[1]),1),createBaseVNode(`span`,_hoisted_5$151,[__props.filterByProp&&__props.filterByProp[filter[0]]&&__props.filterByProp[filter[0]][filter[1]]?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:unref(icons).checkmark},null,8,[`type`])):(openBlock(),createBlock(unref(bngIcon_default),{key:1,type:unref(icons).xmark},null,8,[`type`])),props.isFilterOptionLocked(filter[0],filter[1])?(openBlock(),createBlock(unref(bngIcon_default),{key:2,type:unref(icons).lockClosed,class:`lock-icon`},null,8,[`type`])):createCommentVNode(``,!0)])]),_:2},1032,[`class`,`style`,`onClick`]))),128))])),__props.detailsMode===`filter`?(openBlock(),createElementBlock(`div`,_hoisted_6$130,[createVNode(unref(accordion_default),{class:`filters-accordion`},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.filterList,filter=>(openBlock(),createElementBlock(`div`,{key:filter.propName,class:`filter-wrapper`},[createVNode(unref(accordionItem_default),{navigable:``,static:!filter.options||filter.options.length===0,"arrow-big":``,"expand-hint-inline":``,expanded:expandedAccordions.value[filter.propName],class:normalizeClass({"has-active-filters":isFilterActive(filter)}),onFocus:$event=>emit$1(`focus-item`,filter.propName)},{caption:withCtx(()=>[createBaseVNode(`div`,_hoisted_7$116,[createBaseVNode(`div`,_hoisted_8$97,toDisplayString(formatFilterName(filter.propName)),1)])]),default:withCtx(()=>[filter.type===`set`&&filter.options?(openBlock(),createElementBlock(`div`,_hoisted_9$87,[createBaseVNode(`div`,_hoisted_10$76,[(openBlock(!0),createElementBlock(Fragment,null,renderList(filter.options,(option,index)=>(openBlock(),createBlock(unref(bngPill_default),{key:index,class:normalizeClass([[getFilterOptionClass(filter.propName,option),{"filter-locked":props.isFilterOptionLocked(filter.propName,option)}],`filter-option-chip`]),style:normalizeStyle({cursor:props.isFilterOptionLocked(filter.propName,option)?`not-allowed`:`pointer`}),onClick:$event=>toggleFilter(filter.propName,option)},{default:withCtx(()=>[createBaseVNode(`span`,_hoisted_11$68,toDisplayString(option),1),createBaseVNode(`span`,_hoisted_12$56,[__props.filterByProp[filter.propName][option]?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:unref(icons).checkmark},null,8,[`type`])):(openBlock(),createBlock(unref(bngIcon_default),{key:1,type:unref(icons).abandon},null,8,[`type`])),props.isFilterOptionLocked(filter.propName,option)?(openBlock(),createBlock(unref(bngIcon_default),{key:2,type:unref(icons).lockClosed,class:`lock-icon`},null,8,[`type`])):createCommentVNode(``,!0)])]),_:2},1032,[`class`,`style`,`onClick`]))),128))])])):createCommentVNode(``,!0),filter.type===`range`?(openBlock(),createElementBlock(`div`,_hoisted_13$48,[createBaseVNode(`div`,_hoisted_14$43,[createBaseVNode(`div`,_hoisted_15$41,[createBaseVNode(`div`,{class:`range-selection`,style:normalizeStyle(getRangeBarStyle(filter.propName))},null,4)])]),createBaseVNode(`div`,_hoisted_16$39,[createBaseVNode(`div`,_hoisted_17$32,[_cache[1]||=createBaseVNode(`label`,{class:`range-label`},`Min:`,-1),(openBlock(),createBlock(unref(bngInput_default),{key:filter.propName+`min`,modelValue:__props.filterByProp[filter.propName].min,type:`number`,min:filter.min,max:filter.max,step:filter.step||1,disabled:props.isRangeFilterLocked(filter.propName),onValueChanged:val=>onRangeFilterChanged(filter.propName,val,`min`)},null,8,[`modelValue`,`min`,`max`,`step`,`disabled`,`onValueChanged`]))]),createBaseVNode(`div`,_hoisted_18$29,[_cache[2]||=createBaseVNode(`label`,{class:`range-label`},`Max:`,-1),(openBlock(),createBlock(unref(bngInput_default),{key:filter.propName+`max`,modelValue:__props.filterByProp[filter.propName].max,type:`number`,min:filter.min,max:filter.max,step:filter.step||1,disabled:props.isRangeFilterLocked(filter.propName),onValueChanged:val=>onRangeFilterChanged(filter.propName,val,`max`)},null,8,[`modelValue`,`min`,`max`,`step`,`disabled`,`onValueChanged`]))])])])):createCommentVNode(``,!0)]),_:2},1032,[`static`,`expanded`,`class`,`onFocus`])]))),128))]),_:1})])):createCommentVNode(``,!0)]))}},DetailedFilters_default=__plugin_vue_export_helper_default(_sfc_main$315,[[`__scopeId`,`data-v-a4758924`]]),_hoisted_1$280={key:1},_hoisted_2$230={key:1},_hoisted_3$204={key:1},_hoisted_4$175={key:1},_sfc_main$314={__name:`HeaderButtons`,props:{canSwitchDetails:{type:Boolean,default:!1},hiddenTabs:{type:Array,default:()=>[]},detailsMode:{type:String,required:!0},slim:{type:Boolean,default:!1}},emits:[`switch-details-mode`],setup(__props){return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`header-buttons`,{slim:__props.slim}])},[withDirectives(createVNode(unref(bngBinding_default),{class:`header-buttons-binding`,"ui-event":`context`,controller:``,"track-ignore":``},null,512),[[vShow,__props.canSwitchDetails]]),__props.hiddenTabs.includes(`detail`)?createCommentVNode(``,!0):withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:0,class:normalizeClass([`header-button`,{selected:__props.detailsMode===`detail`}]),accent:unref(ACCENTS).text,onClick:_cache[0]||=$event=>_ctx.$emit(`switch-details-mode`,`detail`)},{default:withCtx(()=>[__props.slim?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:unref(icons).info},null,8,[`type`])):(openBlock(),createElementBlock(`span`,_hoisted_1$280,`Details`))]),_:1},8,[`class`,`accent`])),[[unref(BngTooltip_default),`Details`,`top`]]),__props.hiddenTabs.includes(`advanced`)?createCommentVNode(``,!0):withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:1,class:normalizeClass([`header-button`,{selected:__props.detailsMode===`advanced`}]),accent:unref(ACCENTS).text,onClick:_cache[1]||=$event=>_ctx.$emit(`switch-details-mode`,`advanced`)},{default:withCtx(()=>[__props.slim?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:unref(icons).laneProperties},null,8,[`type`])):(openBlock(),createElementBlock(`span`,_hoisted_2$230,`Advanced`))]),_:1},8,[`class`,`accent`])),[[unref(BngTooltip_default),`Advanced`,`top`]]),__props.hiddenTabs.includes(`filter`)?createCommentVNode(``,!0):withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:2,class:normalizeClass([`header-button`,{selected:__props.detailsMode===`filter`}]),accent:unref(ACCENTS).text,onClick:_cache[2]||=$event=>_ctx.$emit(`switch-details-mode`,`filter`)},{default:withCtx(()=>[__props.slim?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:unref(icons).filter},null,8,[`type`])):(openBlock(),createElementBlock(`span`,_hoisted_3$204,`Filters`))]),_:1},8,[`class`,`accent`])),[[unref(BngTooltip_default),`Filters`,`top`]]),__props.hiddenTabs.includes(`displayControls`)?createCommentVNode(``,!0):withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:3,class:normalizeClass([`header-button`,{selected:__props.detailsMode===`displayControls`}]),accent:unref(ACCENTS).text,onClick:_cache[3]||=$event=>_ctx.$emit(`switch-details-mode`,`displayControls`)},{default:withCtx(()=>[__props.slim?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:unref(icons).adjust},null,8,[`type`])):(openBlock(),createElementBlock(`span`,_hoisted_4$175,`Display`))]),_:1},8,[`class`,`accent`])),[[unref(BngTooltip_default),`Display`,`top`]])],2))}},HeaderButtons_default=__plugin_vue_export_helper_default(_sfc_main$314,[[`__scopeId`,`data-v-157cdc63`]]),_sfc_main$313={__name:`Slideshow`,props:{images:Array,transition:Boolean,delay:{type:Number,default:1e4},parent:Object,shuffle:Boolean},setup(__props,{expose:__expose}){useCssVars(_ctx=>({v095d52f4:imgPrev.value,v095f8174:imgNext.value}));let props=__props,anim=ref(!1),imgPrev=ref(``),imgNext=ref(``),imgIndex=ref(-1),sequence=[],sequenceIndex=-1,tmrMain,tmrAnim,wImages,wParent;__expose({imgIndex,nextImage,carousel:{showNext:nextImage}}),onUnmounted(stopTimers);function stopTimers(){tmrMain&&=(clearTimeout(tmrMain),null),tmrAnim&&=(clearTimeout(tmrAnim),null)}watch(()=>props.parent,parent=>{wImages&&=(wImages(),null),wParent&&=(wParent(),null),parent?wParent=watch([()=>props.images,()=>parent.imgIndex],([images,index])=>{images&&(imgIndex.value=index,images.length>0&&nextTick(nextImage))},{immediate:!0}):wImages=watch([()=>props.images,()=>props.shuffle],([images,shuffle])=>{images&&(imgIndex.value=-1,images.length>0&&(shuffle&&(sequenceIndex=-1,sequence=Array.from(images).map((_,i)=>i).sort(()=>Math.random()-.5)),nextTick(nextImage)))},{immediate:!0})},{immediate:!0});function nextImage(){stopTimers(),props.parent||(props.shuffle&&sequence.length>0?(sequenceIndex=++sequenceIndex%props.images.length,imgIndex.value=sequence[sequenceIndex]):imgIndex.value=++imgIndex.value%props.images.length);let img=`url("${getAssetURL(props.images[imgIndex.value])}")`;props.transition?(imgNext.value=img,anim.value=!0,tmrAnim=setTimeout(()=>{tmrAnim=null,anim.value=!1,imgPrev.value=imgNext.value,imgNext.value=``},1e3)):imgPrev.value=img,!props.parent&&props.images.length>1&&(tmrMain=setTimeout(nextImage,props.delay))}return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass({anim:anim.value})},null,2))}},Slideshow_default=__plugin_vue_export_helper_default(_sfc_main$313,[[`__scopeId`,`data-v-f788946d`]]),_hoisted_1$279={key:0,class:`blur-wrap`},_sfc_main$312={__name:`BlurBackground`,setup(__props){let parentCarousel=inject(`mainBackground`),backgroundsBlur=inject(`mainBackgroundBlur`),bgRequired=sysInfo_default.mainMenuBackgroundRequired;return(_ctx,_cache)=>unref(bgRequired)?(openBlock(),createElementBlock(`div`,_hoisted_1$279,[createVNode(Slideshow_default,{class:`blur-carousel`,images:unref(backgroundsBlur),parent:unref(parentCarousel),transition:``},null,8,[`images`,`parent`])])):createCommentVNode(``,!0)}},BlurBackground_default=__plugin_vue_export_helper_default(_sfc_main$312,[[`__scopeId`,`data-v-cc1c4815`]]),_hoisted_1$278={class:`header-container`},_hoisted_2$229={key:1},_hoisted_3$203={class:`content-container`},_hoisted_4$174={class:`header-back-button`},_hoisted_5$150={key:0,class:`header-title-container`},_hoisted_6$129={class:`header-back-button`},_hoisted_7$115={class:`header-back-button`},_hoisted_8$96={key:0,class:`scrollable-content`},_hoisted_9$86={class:`details-mode-buttons`},_hoisted_10$75={key:1,class:`scrollable-content`},_hoisted_11$67={key:0,class:`details-content`},_hoisted_12$55={key:1,class:`scrollable-content`},_sfc_main$311={__name:`GridSelector`,props:{backendName:{type:String,default:`gridSelector`},routePath:{type:String,default:`/grid-selector`},defaultPath:{type:Object,default:()=>({keys:[`allModels`]})},defaultDetailsMode:{type:String,default:`detail`},hiddenTabs:{type:Array,default:()=>[]},tileImagesTopAligned:{type:Boolean,default:!1},doubleClickOverride:{type:Function,default:null},noBreadcrumbs:{type:Boolean,default:!1},overrideBackFromGrid:{type:Function,default:null},inlineHeaderContainer:{type:Boolean,default:!0},selectCallback:{type:Function,default:null},bubbleEvents:{type:Array,default:()=>[]}},setup(__props,{expose:__expose}){let props=__props,{showIfController}=storeToRefs(controls_default()),store$1=useGridSelector(props.backendName,props.defaultPath,props.defaultDetailsMode),{groups,displayData,detailsMode,selectedItem,showScreenHeader,screenHeaderTitle,screenHeaderPath,activeItemDetails,activeItem,activeFilters}=store$1,route=useRoute(),router$1=useRouter(),detailsModeTitles={detail:`Details`,advanced:`Advanced`,filter:`Filters`,displayControls:`Display`},detailsModeBackTo={filter:`advanced`,displayControls:`advanced`};watch(()=>[props.backendName,props.defaultPath,props.defaultDetailsMode],([newBackendName,newDefaultPath,newDefaultDetailsMode],[oldBackendName,oldDefaultPath,oldDefaultDetailsMode])=>{newBackendName!==oldBackendName&&newDefaultPath&&newDefaultPath.keys&&store$1.setCurrentPath(newDefaultPath),newDefaultDetailsMode!==oldDefaultDetailsMode&&store$1.setDetailsMode(newDefaultDetailsMode)},{deep:!0});let scopedNavState=reactive({isGridActive:!1,isDetailsActive:!1}),setBack=inject(`setBack`),showTopbarTabBindings=inject(`showTopbarTabBindings`),showTopbarBackBinding=inject(`showTopbarBackBinding`),showBreadcrumbsBack=ref(!1),canUseTopbar=ref(!0);watch(()=>scopedNavState.isDetailsActive,val=>{canUseTopbar.value=!val,showTopbarTabBindings(canUseTopbar.value)}),watch(screenHeaderPath,val=>{showBreadcrumbsBack.value=val&&val.length>2,showTopbarBackBinding(!showBreadcrumbsBack.value)});let switchSeq=computed(()=>[`detail`,`advanced`,`displayControls`].filter(tab=>!props.hiddenTabs.includes(tab))),getNextSwitchSeq=mode=>{mode||=detailsMode.value,mode===`filter`&&(mode=`advanced`);let seq=switchSeq.value;if(seq.length===0)return`detail`;let currentIndex=seq.indexOf(mode);return currentIndex===-1?seq[0]:seq[(currentIndex+1)%seq.length]},canSeeDetails=ref(!0),hasSelectedItem=computed(()=>!!store$1.selectedItem.value),canSwitchDetails=computed(()=>activeSectionScope.value!==`default`||detailsMode.value===`advanced`);function switchDetailsMode(mode){console.log(`switchDetailsMode`,mode),typeof mode!=`string`&&(mode=getNextSwitchSeq(mode)),mode===`detail`&&!canSeeDetails.value&&(mode=getNextSwitchSeq(mode)),console.log(`switchDetailsMode`,mode),store$1.setDetailsMode(mode),switchScope(`details`)}function onToggleSectionScope(){activeSectionScope.value===`grid`?switchScope(`details`):switchDetailsMode()}let activeSectionScope=ref(`grid`);function switchScope(name,force=!1){name||=activeSectionScope.value===`grid`?`details`:`grid`,name===`details`?(scopedNavState.isGridActive=!1,force&&(scopedNavState.isDetailsActive=!1),nextTick(()=>{activeSectionScope.value=name,scopedNavState.isDetailsActive=!0})):(scopedNavState.isDetailsActive=!1,force&&(scopedNavState.isGridActive=!1),nextTick(()=>{activeSectionScope.value=name,scopedNavState.isGridActive=!0}))}let onGridActivate=()=>{scopedNavState.isGridActive=!0},onGridDeactivate=event=>{scopedNavState.isGridActive=!1},onDetailsActivate=()=>{scopedNavState.isDetailsActive=!0},onDetailsDeactivate=event=>{scopedNavState.isDetailsActive=!1},setDetailsScope=info=>{switchScope(`details`)},canBubbleGridEvent=event=>!!(event.detail.name===`rotate_v_cam`||event.detail.name===`menu`||canUseTopbar.value&&(event.detail.name===`tab_l`||event.detail.name===`tab_r`)||props.bubbleEvents.includes(event.detail.name)),canBubbleDetailsEvent=event=>!!(event.detail.name===`rotate_v_cam`||props.bubbleEvents.includes(event.detail.name)),canDeactivateGrid=()=>screenHeaderPath.value.length<=1,onBackFromDetails=()=>{if(detailsMode.value===`displayControls`||detailsMode.value===`filter`){toggleDetailsMode(`advanced`);return}switchScope(`grid`)},onToggleFavorite=()=>{store$1.toggleFavourite(activeItem.value)},gridContentRef=ref(null),scrollPositions$1=ref(new Map),scrollTimeout=null,displaySize=computed(()=>{let option=displayData.value.find(option$1=>option$1.key===`displaySize`);return option?option.value:`medium`});store$1.initialize(),store$1.setOnBackFromDetailsCallback(()=>{onBackFromDetails()}),props.defaultPath.keys;let currentPathSegments=computed(()=>{let pathMatch=route.params.pathMatch;if(!pathMatch)return props.defaultPath?.keys||(Array.isArray(props.defaultPath)?props.defaultPath:[]);let segments=Array.isArray(pathMatch)?pathMatch.map(segment=>decodeURIComponent(segment)):[decodeURIComponent(pathMatch)];if(route.params.itemDetails){let itemDetails=Array.isArray(route.params.itemDetails)?route.params.itemDetails.map(segment=>decodeURIComponent(segment)):[decodeURIComponent(route.params.itemDetails)];segments.push(...itemDetails)}return segments}),saveScrollPosition$1=()=>{if(!gridContentRef.value)return;let pathKey=currentPathSegments.value.join(`/`),scrollTop=gridContentRef.value.scrollTop;scrollPositions$1.value.set(pathKey,scrollTop)},debouncedSaveScrollPosition=()=>{scrollTimeout&&clearTimeout(scrollTimeout),scrollTimeout=setTimeout(()=>{saveScrollPosition$1()},100)},restoreScrollPosition=()=>{if(!gridContentRef.value)return;let pathKey=currentPathSegments.value.join(`/`),savedPosition=scrollPositions$1.value.get(pathKey);savedPosition!==void 0&&nextTick(()=>{gridContentRef.value.scrollTop=savedPosition})};watch(groups,async newGroups=>{newGroups&&(await nextTick(),await nextTick(),store$1.notifyUIReady(),restoreScrollPosition())},{immediate:!0}),watch([currentPathSegments],async([segments],[oldSegments])=>{if(oldSegments&&gridContentRef.value){let oldPathKey=oldSegments.join(`/`),currentScrollTop=gridContentRef.value.scrollTop;scrollPositions$1.value.set(oldPathKey,currentScrollTop)}let path={keys:segments};await store$1.setCurrentPath(path)},{immediate:!0}),watch(gridContentRef,newElement=>{if(newElement){let handleScroll=()=>{debouncedSaveScrollPosition()};newElement.addEventListener(`scroll`,handleScroll),newElement._scrollHandler=handleScroll}},{immediate:!0}),onBeforeMount(()=>{Lua_default.simTimeAuthority.pushPauseRequest(`gridSelector`)}),onMounted(()=>{setBack(props.backendName,onBackFromGrid),nextTick(()=>{scopedNavState.isGridActive=!0})}),onUnmounted(()=>{setBack(props.backendName),gridContentRef.value&&gridContentRef.value._scrollHandler&&gridContentRef.value.removeEventListener(`scroll`,gridContentRef.value._scrollHandler),scrollTimeout&&clearTimeout(scrollTimeout),Lua_default.ui_gridSelector.closedFromUI(props.backendName),Lua_default.simTimeAuthority.popPauseRequest(`gridSelector`)});let onItemFocus=item=>{item&&item.showDetails&&store$1.setPreviewItem(item)},onItemSelect=async(item,doNavigation=!0)=>{if(item.gotoPath&&Array.isArray(item.gotoPath))store$1.prevSelectedItem.value=item.key,doNavigation&&routeNav(item),store$1.clearSelectedItem(),doNavigation&&switchScope(`grid`),props.selectCallback&&await props.selectCallback(item,doNavigation);else if(item.showDetails){item.key,selectedItem.value?.key;let consumed=!1;props.selectCallback&&(consumed=await props.selectCallback(item,doNavigation)),consumed||(await store$1.setSelectedItem(item),doNavigation&&switchScope(`details`))}},onGridWrapperClick=event=>{store$1.clearSelectedItem(),switchScope(`grid`,!0)},onDetailsWrapperClick=event=>{switchScope(`details`,!0)},onItemDeselect=()=>{store$1.clearSelectedItem()},toggleDetailsMode=mode=>{store$1.setDetailsMode(mode)};function routeNav(item){if(item.gotoAngularState)return;let encodedPath=item.gotoPath.map(segment=>encodeURIComponent(segment)).join(`/`);router$1.push(`${props.routePath}/${encodedPath}`)}let onBackFromGrid=()=>{if(console.log(`onBackFromGrid`,screenHeaderPath.value),props.overrideBackFromGrid&&screenHeaderPath.value.length<=2)return props.overrideBackFromGrid();if(screenHeaderPath.value.length>1){let item=screenHeaderPath.value[screenHeaderPath.value.length-2];return store$1.prevSelectedItem.value&&(store$1.autoFocusKey.value=store$1.prevSelectedItem.value),gotoHeaderItem(item),!1}return!0},onBreadBack=()=>nextTick(onBackFromGrid),clearSearch=()=>{store$1.setSearchText(``)},clearFilters=()=>{console.log(`clearFilters`,activeFilters.value);for(let filter of activeFilters.value)console.log(`clearFilter`,filter),filter&&filter.type===`range`?store$1.resetRangeFilter(filter.propName):store$1.resetSetFilter(filter.propName)},setCurrentPath=path=>{store$1.setCurrentPath(path)},gotoHeaderItem=item=>{console.log(`gotoHeaderItem`,item),item.gotoAngularState?window.bngVue.gotoAngularState(item.gotoAngularState):item.gotoPath&&(item.clearSearch&&clearSearch(),item.clearFilters&&clearFilters(),setCurrentPath({keys:item.gotoPath}),routeNav(item),switchScope(`grid`))};return __expose({screenHeaderPath,clearSearch,clearFilters,setCurrentPath}),(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(layoutSingle_default),{class:`grid-selector`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$278,[__props.noBreadcrumbs?(openBlock(),createElementBlock(`div`,_hoisted_2$229)):(openBlock(),createBlock(unref(bngBreadcrumbs_default),{key:0,class:`header-breadcrumbs`,items:unref(screenHeaderPath),limit:`5`,simple:``,"disable-last-item":``,"show-back-button":showBreadcrumbsBack.value,onClick:gotoHeaderItem,onBack:onBreadBack},null,8,[`items`,`show-back-button`])),__props.inlineHeaderContainer?createCommentVNode(``,!0):(openBlock(),createBlock(HeaderButtons_default,{key:2,"can-switch-details":canSwitchDetails.value,"hidden-tabs":props.hiddenTabs,"details-mode":unref(detailsMode),onSwitchDetailsMode:switchDetailsMode},null,8,[`can-switch-details`,`hidden-tabs`,`details-mode`]))]),createBaseVNode(`div`,_hoisted_3$203,[createBaseVNode(`div`,{class:normalizeClass([`grid-wrapper`,{active:activeSectionScope.value===`grid`}])},[createVNode(BlurBackground_default),unref(showScreenHeader)?(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`header-row`,{active:activeSectionScope.value===`grid`&&unref(showIfController),"no-controller":!unref(showIfController)}])},[createVNode(unref(bngScreenHeadingV2_default),{type:`2`,class:`header-title-v2`},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(screenHeaderTitle)),1)]),_:1}),withDirectives(createBaseVNode(`div`,_hoisted_4$174,[createVNode(unref(bngBinding_default),{"ui-event":`back`,controller:``}),createVNode(unref(bngIcon_default),{type:unref(icons).undo},null,8,[`type`])],512),[[vShow,activeSectionScope.value===`grid`&&unref(showIfController)&¤tPathSegments.value.length>1]])],2)):createCommentVNode(``,!0),withDirectives((openBlock(),createElementBlock(`div`,{class:`grid-content`,ref_key:`gridContentRef`,ref:gridContentRef,"bng-nav-scroll":``,"bng-no-nav":`true`,tabindex:`-1`,onActivate:onGridActivate,onDeactivate:onGridDeactivate,onClick:onGridWrapperClick},[createVNode(Grid_default$1,{"in-details":activeSectionScope.value===`details`&&unref(detailsMode)===`detail`,"display-size":displaySize.value,"backend-name":props.backendName,"auto-focus-key":unref(store$1).autoFocusKey.value,"active-item":unref(store$1).activeItem.value,groups:unref(groups),"tile-images-top-aligned":__props.tileImagesTopAligned,onFocusItem:onItemFocus,onSelectItem:onItemSelect,onDeselectItem:onItemDeselect,"double-click-override":__props.doubleClickOverride},null,8,[`in-details`,`display-size`,`backend-name`,`auto-focus-key`,`active-item`,`groups`,`tile-images-top-aligned`,`double-click-override`])],32)),[[unref(BngScopedNav_default),{activated:scopedNavState.isGridActive,canBubbleEvent:canBubbleGridEvent,canDeactivate:canDeactivateGrid,preferAutoFocus:!0,autoFocusDelay:400}],[unref(BngOnUiNav_default),onToggleSectionScope,`context`],[unref(BngUiNavLabel_default),`Filters and more`,`context`],[unref(BngOnUiNav_default),onBackFromGrid,`back`],[unref(BngUiNavScroll_default)]])],2),withDirectives((openBlock(),createElementBlock(`div`,{class:normalizeClass([`details-wrapper wide`,{active:activeSectionScope.value===`details`,"no-controller":!unref(showIfController)}]),tabindex:`-1`,"bng-no-nav":`true`,onActivate:onDetailsActivate,onDeactivate:onDetailsDeactivate,onClick:onDetailsWrapperClick},[createVNode(BlurBackground_default),createBaseVNode(`div`,{class:normalizeClass([`header-row`,{active:activeSectionScope.value===`details`&&unref(showIfController),"no-controller":!unref(showIfController)}]),"bng-no-child-nav":`true`},[createVNode(HeaderButtons_default,{slim:``,"can-switch-details":canSwitchDetails.value,"hidden-tabs":props.hiddenTabs,"details-mode":unref(detailsMode),onSwitchDetailsMode:switchDetailsMode},null,8,[`can-switch-details`,`hidden-tabs`,`details-mode`]),__props.inlineHeaderContainer?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_5$150,[createVNode(unref(bngCardHeading_default),{type:`ribbon`,class:`header-title`},{default:withCtx(()=>[createTextVNode(toDisplayString(detailsModeTitles[unref(detailsMode)]),1)]),_:1}),detailsModeBackTo[unref(detailsMode)]?(openBlock(),createBlock(unref(bngButton_default),{key:0,"bng-no-nav":`true`,onClick:_cache[0]||=$event=>toggleDetailsMode(detailsModeBackTo[unref(detailsMode)]),accent:unref(ACCENTS).outlined,iconRight:`undo`},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{"ui-event":`back`,controller:``})]),_:1},8,[`accent`])):createCommentVNode(``,!0),withDirectives(createBaseVNode(`div`,_hoisted_6$129,[createVNode(unref(bngIcon_default),{type:unref(icons).adjust},null,8,[`type`]),createVNode(unref(bngBinding_default),{"ui-event":`context`,controller:``})],512),[[vShow,activeSectionScope.value===`grid`||!unref(showIfController)]]),withDirectives(createBaseVNode(`div`,_hoisted_7$115,[createVNode(unref(bngBinding_default),{"ui-event":`back`,controller:``}),createVNode(unref(bngIcon_default),{type:unref(icons).undo},null,8,[`type`])],512),[[vShow,activeSectionScope.value===`details`&&unref(showIfController)]])]))],2),unref(detailsMode)===`advanced`?(openBlock(),createElementBlock(`div`,_hoisted_8$96,[createVNode(SearchBar_default,{searchText:unref(store$1).searchText.value,setSearchText:unref(store$1).setSearchText},null,8,[`searchText`,`setSearchText`]),createVNode(DetailedFilters_default,{filterList:unref(store$1).filterList.value,filterByProp:unref(store$1).filterByProp.value,searchText:unref(store$1).searchText.value,commonFilters:unref(store$1).commonFilters.value,detailsMode:unref(store$1).detailsMode.value,onlyCommonFilters:unref(store$1).onlyCommonFilters.value,isFilterLocked:unref(store$1).isFilterLocked,isFilterOptionLocked:unref(store$1).isFilterOptionLocked,isRangeFilterLocked:unref(store$1).isRangeFilterLocked,toggleFilter:unref(store$1).toggleFilter,updateRangeFilter:unref(store$1).updateRangeFilter,resetRangeFilter:unref(store$1).resetRangeFilter,setSearchText:unref(store$1).setSearchText,setDetailsMode:unref(store$1).setDetailsMode},null,8,[`filterList`,`filterByProp`,`searchText`,`commonFilters`,`detailsMode`,`onlyCommonFilters`,`isFilterLocked`,`isFilterOptionLocked`,`isRangeFilterLocked`,`toggleFilter`,`updateRangeFilter`,`resetRangeFilter`,`setSearchText`,`setDetailsMode`]),createVNode(DisplayControls_default,{displayData:unref(store$1).displayData.value,detailsMode:unref(store$1).detailsMode.value,updateDisplayData:unref(store$1).updateDisplayData,resetDisplayDataToDefaults:unref(store$1).resetDisplayDataToDefaults,setDetailsMode:unref(store$1).setDetailsMode},null,8,[`displayData`,`detailsMode`,`updateDisplayData`,`resetDisplayDataToDefaults`,`setDetailsMode`]),createBaseVNode(`div`,_hoisted_9$86,[createVNode(unref(bngButton_default),{onClick:_cache[1]||=$event=>toggleDetailsMode(`filter`),accent:unref(ACCENTS).secondary,iconLeft:`filter`},{default:withCtx(()=>[..._cache[3]||=[createTextVNode(` More filters... `,-1)]]),_:1},8,[`accent`]),createVNode(unref(bngButton_default),{onClick:_cache[2]||=$event=>toggleDetailsMode(`displayControls`),accent:unref(ACCENTS).secondary,iconLeft:`adjust`},{default:withCtx(()=>[..._cache[4]||=[createTextVNode(` Display Options `,-1)]]),_:1},8,[`accent`])]),createVNode(unref(bngCardHeading_default),{type:`line`,class:`heading`},{default:withCtx(()=>[..._cache[5]||=[createTextVNode(`Management`,-1)]]),_:1}),renderSlot(_ctx.$slots,`management-details`,{managementDetails:unref(store$1).managementDetails.value,executeButton:unref(store$1).executeButton},void 0,!0)])):unref(detailsMode)===`filter`?(openBlock(),createElementBlock(`div`,_hoisted_10$75,[createVNode(DetailedFilters_default,{filterList:unref(store$1).filterList.value,filterByProp:unref(store$1).filterByProp.value,searchText:unref(store$1).searchText.value,commonFilters:unref(store$1).commonFilters.value,detailsMode:unref(store$1).detailsMode.value,onlyCommonFilters:unref(store$1).onlyCommonFilters.value,isFilterLocked:unref(store$1).isFilterLocked,isFilterOptionLocked:unref(store$1).isFilterOptionLocked,isRangeFilterLocked:unref(store$1).isRangeFilterLocked,toggleFilter:unref(store$1).toggleFilter,updateRangeFilter:unref(store$1).updateRangeFilter,resetRangeFilter:unref(store$1).resetRangeFilter,setSearchText:unref(store$1).setSearchText,setDetailsMode:unref(store$1).setDetailsMode},null,8,[`filterList`,`filterByProp`,`searchText`,`commonFilters`,`detailsMode`,`onlyCommonFilters`,`isFilterLocked`,`isFilterOptionLocked`,`isRangeFilterLocked`,`toggleFilter`,`updateRangeFilter`,`resetRangeFilter`,`setSearchText`,`setDetailsMode`])])):unref(detailsMode)===`displayControls`?(openBlock(),createBlock(DisplayControls_default,{key:2,class:`scrollable-content`,displayData:unref(store$1).displayData.value,detailsMode:unref(store$1).detailsMode.value,updateDisplayData:unref(store$1).updateDisplayData,resetDisplayDataToDefaults:unref(store$1).resetDisplayDataToDefaults,setDetailsMode:unref(store$1).setDetailsMode},null,8,[`displayData`,`detailsMode`,`updateDisplayData`,`resetDisplayDataToDefaults`,`setDetailsMode`])):unref(detailsMode)===`detail`?(openBlock(),createElementBlock(Fragment,{key:3},[hasSelectedItem.value?(openBlock(),createElementBlock(`div`,_hoisted_11$67,[renderSlot(_ctx.$slots,`item-details`,{activeItem:unref(store$1).activeItem.value,activeItemDetails:unref(store$1).activeItemDetails.value,executeButton:unref(store$1).executeButton,toggleFavourite:unref(store$1).toggleFavourite,exploreFolder:unref(store$1).exploreFolder,goToMod:unref(store$1).goToMod,onFocusItem:setDetailsScope},void 0,!0)])):(openBlock(),createElementBlock(`div`,_hoisted_12$55,[createVNode(SearchBar_default,{searchText:unref(store$1).searchText.value,setSearchText:unref(store$1).setSearchText},null,8,[`searchText`,`setSearchText`]),createVNode(DetailedFilters_default,{filterList:unref(store$1).filterList.value,filterByProp:unref(store$1).filterByProp.value,searchText:unref(store$1).searchText.value,commonFilters:unref(store$1).commonFilters.value,detailsMode:unref(store$1).detailsMode.value,onlyCommonFilters:unref(store$1).onlyCommonFilters.value,isFilterLocked:unref(store$1).isFilterLocked,isFilterOptionLocked:unref(store$1).isFilterOptionLocked,isRangeFilterLocked:unref(store$1).isRangeFilterLocked,toggleFilter:unref(store$1).toggleFilter,updateRangeFilter:unref(store$1).updateRangeFilter,resetRangeFilter:unref(store$1).resetRangeFilter,setSearchText:unref(store$1).setSearchText,setDetailsMode:unref(store$1).setDetailsMode},null,8,[`filterList`,`filterByProp`,`searchText`,`commonFilters`,`detailsMode`,`onlyCommonFilters`,`isFilterLocked`,`isFilterOptionLocked`,`isRangeFilterLocked`,`toggleFilter`,`updateRangeFilter`,`resetRangeFilter`,`setSearchText`,`setDetailsMode`]),createVNode(DisplayControls_default,{displayData:unref(store$1).displayData.value,detailsMode:unref(store$1).detailsMode.value,updateDisplayData:unref(store$1).updateDisplayData,resetDisplayDataToDefaults:unref(store$1).resetDisplayDataToDefaults,setDetailsMode:unref(store$1).setDetailsMode},null,8,[`displayData`,`detailsMode`,`updateDisplayData`,`resetDisplayDataToDefaults`,`setDetailsMode`]),createVNode(unref(bngCardHeading_default),{type:`line`,class:`heading`},{default:withCtx(()=>[..._cache[6]||=[createTextVNode(`Info`,-1)]]),_:1}),_cache[7]||=createBaseVNode(`div`,{class:`scrollable-content`},` Please select an item to see details. `,-1)]))],64)):createCommentVNode(``,!0)],34)),[[unref(BngScopedNav_default),{activated:scopedNavState.isDetailsActive,canDeactivate:()=>!1,canBubbleEvent:canBubbleDetailsEvent,bubbleWhitelistEvents:[`menu`]}],[unref(BngOnUiNav_default),onToggleSectionScope,`context`],[unref(BngUiNavLabel_default),`Filters and more`,`context`],[unref(BngOnUiNav_default),onToggleFavorite,`action_2`],[unref(BngUiNavLabel_default),`Toggle favorite`,`action_2`],[unref(BngOnUiNav_default),onBackFromDetails,`back`,{focusRequired:!0}]])])]),_:3})),[[unref(BngBlur_default)],[unref(BngOnUiNav_default),()=>{},`rotate_h_cam,rotate_v_cam`]])}},GridSelector_default=__plugin_vue_export_helper_default(_sfc_main$311,[[`__scopeId`,`data-v-d340d12f`]]),_hoisted_1$277={class:`details`,"bng-nav-scroll":``},_hoisted_2$228={key:0,class:`preview`},_hoisted_3$202={key:1,class:`content-header`},_hoisted_4$173={key:0,class:`description`},_hoisted_5$149={key:0,class:`specs-grid`},_hoisted_6$128={class:`specs-grid-container`},_hoisted_7$114={class:`spec-content`},_hoisted_8$95={class:`spec-label`},_hoisted_9$85={class:`spec-value`},_hoisted_10$74={key:2,class:`buttons-section`},_sfc_main$310={__name:`AppDetails`,props:{activeItem:{type:Object,default:null},activeItemDetails:{type:Object,default:null},executeButton:{type:Function,required:!0},toggleFavourite:{type:Function,required:!0}},setup(__props){let props=__props,handleButtonClick=buttonId=>{props.executeButton(buttonId)};return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$277,[__props.activeItemDetails?.preview?(openBlock(),createElementBlock(`div`,_hoisted_2$228,[createVNode(unref(aspectRatio_default),{class:`preview-image`,ratio:`16:8`,"external-image":__props.activeItemDetails.preview},null,8,[`external-image`])])):createCommentVNode(``,!0),__props.activeItemDetails?.headerTitle?(openBlock(),createElementBlock(`div`,_hoisted_3$202,[__props.activeItemDetails?.description?(openBlock(),createElementBlock(`div`,_hoisted_4$173,toDisplayString(__props.activeItemDetails.description),1)):createCommentVNode(``,!0)])):createCommentVNode(``,!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.activeItemDetails?.specifications,(specList,specListIndex)=>(openBlock(),createElementBlock(Fragment,{key:specListIndex},[specList.length>0?(openBlock(),createElementBlock(`div`,_hoisted_5$149,[createBaseVNode(`div`,_hoisted_6$128,[(openBlock(!0),createElementBlock(Fragment,null,renderList(specList,specification=>(openBlock(),createElementBlock(`div`,{key:specification.key,class:`spec-cell`},[specification.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:specification.icon,class:`spec-icon`},null,8,[`type`])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_7$114,[createBaseVNode(`div`,_hoisted_8$95,toDisplayString(specification.label)+`:`,1),createBaseVNode(`div`,_hoisted_9$85,[createBaseVNode(`span`,null,toDisplayString(specification.value),1)])])]))),128))])])):createCommentVNode(``,!0)],64))),128)),__props.activeItemDetails?.buttonInfo?.length>0?(openBlock(),createElementBlock(`div`,_hoisted_10$74,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.activeItemDetails.buttonInfo,button=>(openBlock(),createBlock(unref(bngButton_default),{key:button.buttonId,"bng-scoped-nav-autofocus":button.primary,accent:button.primary?`main`:`secondary`,label:button.label,icon:button.icon,onClick:$event=>handleButtonClick(button.buttonId)},null,8,[`bng-scoped-nav-autofocus`,`accent`,`label`,`icon`,`onClick`]))),128))])):createCommentVNode(``,!0)])),[[unref(BngUiNavScroll_default),void 0,void 0,{force:!0}]])}},AppDetails_default=__plugin_vue_export_helper_default(_sfc_main$310,[[`__scopeId`,`data-v-c8fb13f2`]]),_sfc_main$309={__name:`AppSelector`,setup(__props){return(_ctx,_cache)=>(openBlock(),createBlock(GridSelector_default,{backendName:`appSelector`,routePath:`/app-selector`,defaultPath:{keys:[`allApps`]},defaultDetailsMode:`advanced`},{"item-details":withCtx(({activeItem,activeItemDetails,executeButton,toggleFavourite})=>[createVNode(AppDetails_default,{activeItem,activeItemDetails,executeButton,toggleFavourite},null,8,[`activeItem`,`activeItemDetails`,`executeButton`,`toggleFavourite`])]),_:1}))}},AppSelector_default=_sfc_main$309,routes_default=[{name:`menu.appselector`,path:`/app-selector/:pathMatch(.*)*`,component:AppSelector_default,props:!0,meta:{clickThrough:!1,infoBar:{visible:!0,showSysInfo:!1},uiApps:{shown:!1},topBar:{visible:!0}}},{name:`menu.appedit`,path:`/app-edit/`,component:NotFound_default,meta:{clickThrough:!0,infoBar:{visible:!0,showSysInfo:!1},uiApps:{shown:!0},topBar:{visible:!0}}}],_hoisted_1$276={class:`main-info`},_hoisted_2$227={class:`heading`},_hoisted_3$201={key:0,class:`stars`},_hoisted_4$172={key:1,class:`aggregate-primary`},_hoisted_5$148={class:`label`},_hoisted_6$127={class:`value`},_hoisted_7$113={key:2,class:`empty-gap`},_sfc_main$308={__name:`PoiCard`,props:{poi:{type:Object,required:!0},shown:{type:Boolean,default:!0}},emits:[`select`,`hover`],setup(__props,{emit:__emit}){let debugLog$1=(message,data)=>{},props=__props,emit$1=__emit,onSelect=()=>{props.poi.id,props.poi.name,emit$1(`select`,props.poi.id)},thumbLoaded=props.shown&&!!props.poi?.thumbnail,thumbShown=ref(thumbLoaded),thumb=ref(thumbLoaded?`url("${props.poi?.thumbnail}")`:`none`),lastThumb=thumbLoaded?props.poi?.thumbnail:void 0;return watch([()=>props.shown,()=>props.poi],()=>{if(props.shown&&props.poi?.thumbnail){let url=props.poi.thumbnail;if(lastThumb!==url){lastThumb=url,thumbLoaded=!1;let img=new Image;img.src=url,img.onload=()=>{lastThumb===url&&(thumbLoaded=!0,thumb.value=`url("${url}")`,thumbShown.value=!0)}}}else props.poi?.thumbnail||(lastThumb=void 0,thumbLoaded=!1,thumb.value=`none`,thumbShown.value=!1)},{immediate:!0}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`poi-item`,{highlighted:__props.poi.isSelected}]),onClick:onSelect,"bng-nav-item":``},[createBaseVNode(`div`,{class:normalizeClass([`card-info`,{"content-shown":__props.shown,"thumb-show":thumbShown.value&&!!thumb.value}]),style:normalizeStyle({"--poi-image":thumb.value})},[__props.poi.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,class:`mission-icon`,type:__props.poi.icon,color:`white`},null,8,[`type`])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_1$276,[createBaseVNode(`div`,_hoisted_2$227,toDisplayString(__props.poi.name),1),__props.poi.formattedProgress?(openBlock(),createElementBlock(`div`,_hoisted_3$201,[__props.poi.formattedProgress.unlockedStars?(openBlock(),createBlock(unref(bngMainStars_default),{key:0,"individual-stars":__props.poi.formattedProgress.unlockedStars.defaults,class:`main-stars`,scale:.6,reverse:``},null,8,[`individual-stars`])):createCommentVNode(``,!0),__props.poi.formattedProgress.unlockedStars&&__props.poi.formattedProgress.unlockedStars.totalBonusStarCount>0?(openBlock(),createBlock(unref(bngMainStars_default),{key:1,"individual-stars":__props.poi.formattedProgress.unlockedStars.bonus,class:`bonus-stars`,scale:.6},null,8,[`individual-stars`])):createCommentVNode(``,!0)])):__props.poi.aggregatePrimary?(openBlock(),createElementBlock(`div`,_hoisted_4$172,[createBaseVNode(`span`,_hoisted_5$148,toDisplayString(__props.poi.aggregatePrimary.label)+`:`,1),createBaseVNode(`span`,_hoisted_6$127,toDisplayString(__props.poi.aggregatePrimary.value),1)])):(openBlock(),createElementBlock(`div`,_hoisted_7$113))]),createVNode(unref(bngBinding_default),{class:`input-icon`,"ui-event":`ok`,controller:``})],6)],2))}},PoiCard_default=__plugin_vue_export_helper_default(_sfc_main$308,[[`__scopeId`,`data-v-cd49bd11`]]),_hoisted_1$275={class:`poi-list`},_hoisted_2$226={class:`filter-header`},_hoisted_3$200={class:`poi-list-items`},_sfc_main$307={__name:`PoiList`,props:{store:{type:Object,required:!0}},setup(__props){let props=__props,poiListContainer=ref(null),shownCards=ref(new Set),{groupData,poiData,selectedPoi,selectPoi,onHover,debugLog:debugLog$1}=props.store,processedPoiData=computed(()=>{let processed={};if(!poiData.value)return processed;for(let[poiId,poi]of Object.entries(poiData.value))poi&&(processed[poiId]={id:poi.id||poiId,name:poi.name?$translate.instant(poi.name):``,icon:poi.icon?icons[poi.icon]:icons._empty,thumbnail:poi.thumbnailFile,formattedProgress:poi.formattedProgress,aggregatePrimary:poi.aggregatePrimary?.label&&poi.aggregatePrimary?.value?{label:$translate.instant(poi.aggregatePrimary.label),value:$translate.instant(poi.aggregatePrimary.value)}:null,isSelected:selectedPoi.value?.id===poi.id});return processed});debugLog$1(`PoiList`,`Component initialized`,{groupDataCount:groupData.value?.length||0,poiDataCount:Object.keys(poiData.value||{}).length,processedPoiCount:Object.keys(processedPoiData.value).length});let observer$2=new IntersectionObserver(entries=>{for(let entry of entries){let poiId=entry.target.getAttribute(`data-poi-id`);poiId&&entry.isIntersecting?shownCards.value.add(poiId):shownCards.value.delete(poiId)}},{threshold:.1,rootMargin:`10px`}),setupObserver=()=>{if(!poiListContainer.value)return;let elms$4=poiListContainer.value.querySelectorAll(`[data-poi-id]`),ids=[];for(let elm of elms$4){let poiId=elm.getAttribute(`data-poi-id`);poiId&&(ids.push(poiId),observer$2.observe(elm))}for(let id of shownCards.value)ids.includes(id)||shownCards.value.delete(id)};return watch(poiListContainer,cont=>cont&&nextTick(setupObserver),{immediate:!0}),watch([groupData,processedPoiData],()=>{nextTick(()=>{observer$2.disconnect(),setupObserver()})},{immediate:!1}),onUnmounted(()=>{shownCards.value.clear(),observer$2.disconnect()}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$275,[createBaseVNode(`div`,{class:`poi-list-content`,ref_key:`poiListContainer`,ref:poiListContainer},[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(groupData),section=>(openBlock(),createElementBlock(`div`,{key:section.key,class:`filter-section`},[createBaseVNode(`div`,_hoisted_2$226,[createVNode(unref(bngIcon_default),{type:section.icon},null,8,[`type`]),createBaseVNode(`span`,null,toDisplayString(section.title?_ctx.$tt(section.title):``),1)]),(openBlock(!0),createElementBlock(Fragment,null,renderList(section.groups,group=>(openBlock(),createElementBlock(`div`,{key:group.key,class:`mission-group`},[createVNode(unref(bngCardHeading_default),{class:`mission-group-header`,type:`ribbon`,outline:``},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(group.label)),1)]),_:2},1024),createBaseVNode(`div`,_hoisted_3$200,[(openBlock(!0),createElementBlock(Fragment,null,renderList(group.elementIds,poiId=>(openBlock(),createBlock(PoiCard_default,{key:poiId,"data-poi-id":poiId,shown:shownCards.value.has(poiId),poi:processedPoiData.value[poiId],onSelect:unref(selectPoi),onHover:unref(onHover)},null,8,[`data-poi-id`,`shown`,`poi`,`onSelect`,`onHover`]))),128))])]))),128))]))),128))],512)]))}},PoiList_default=__plugin_vue_export_helper_default(_sfc_main$307,[[`__scopeId`,`data-v-0ccba230`]]),_hoisted_1$274={class:`header`},_sfc_main$306={__name:`bngAdvCardHeading`,props:{blurDelay:Number,preheadings:Array,divider:Boolean,icon:String,type:{type:String,default:`line`,validator:v=>[`line`,`ribbon`].includes(v)||v===``}},setup(__props){let blurVal=ref(!1);onMounted(()=>window.setTimeout(()=>blurVal.value=!0,~~+props.blurDelay));let props=__props;return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`bng-screen-header`,{[`heading-style-${__props.type}`]:!0,prehead:__props.preheadings}])},[_cache[0]||=createBaseVNode(`div`,{class:`decorator`},null,-1),__props.preheadings?(openBlock(),createElementBlock(`span`,{key:0,class:normalizeClass([`pre-header`,{"with-divider":__props.divider}])},[__props.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:__props.icon,class:`pre-header-icon`},null,8,[`type`])):createCommentVNode(``,!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.preheadings,preheading=>(openBlock(),createElementBlock(`span`,{class:`location`,key:preheading},toDisplayString(preheading),1))),128))],2)):createCommentVNode(``,!0),createBaseVNode(`h1`,_hoisted_1$274,[renderSlot(_ctx.$slots,`default`,{},void 0,!0)])],2))}},bngAdvCardHeading_default=__plugin_vue_export_helper_default(_sfc_main$306,[[`__scopeId`,`data-v-16619e8d`]]),_hoisted_1$273={key:0,class:`poi-icons`},_hoisted_2$225=[`onClick`],_hoisted_3$199={key:1,class:`poi-details`},_hoisted_4$171={class:`poi-content`},_hoisted_5$147={class:`poi-scrollable`},_hoisted_6$126={key:0,class:`poi-aggregate-display`},_hoisted_7$112={key:0,class:`poi-stars`},_hoisted_8$94={class:`stars`},_hoisted_9$84={key:1,class:`aggregate-primary`},_hoisted_10$73={class:`label`},_hoisted_11$66={class:`value`},_hoisted_12$54={key:1,class:`poi-description`},_hoisted_13$47={class:`poi-actions`},_sfc_main$305={__name:`PoiDetails`,props:{store:{type:Object,required:!0}},emits:[`setRoute`,`teleport`],setup(__props,{emit:__emit}){let props=__props,{selectedPoi,selectedPoiIds,poiData,debugLog:debugLog$1}=props.store;debugLog$1(`PoiDetails`,`Component initialized`,{selectedPoiId:selectedPoi.value?.id,selectedPoiIdsCount:selectedPoiIds.value?.length||0});let selectedPoisList=computed(()=>{if(!selectedPoiIds.value||selectedPoiIds.value.length===0)return selectedPoi.value?[selectedPoi.value]:[];let pois=[];for(let poiId of selectedPoiIds.value){let poi=poiData.value[poiId];poi&&pois.push(poi)}return debugLog$1(`PoiDetails`,`Final pois list`,pois),pois}),currentPoiIndex=computed(()=>{if(selectedPoisList.value.length<=1)return 0;let index=selectedPoisList.value.findIndex(poi=>poi.id===selectedPoi.value?.id);return index>=0?index:0}),selectPoi=index=>{index>=0&&index{let headings=[];return selectedPoi.value?.label&&headings.push($translate.instant(selectedPoi.value.label)),headings}),preview=computed(()=>selectedPoi.value?.previewFiles?.length>0?selectedPoi.value.previewFiles[0]:selectedPoi.value?.thumbnailFile||null),safeTranslate=key=>{if(!key)return``;try{return typeof key==`string`?$translate.instant(key):(typeof key==`object`&&key.txt,$translate.contextTranslate(key))}catch(e){return console.warn(`Translation failed for key:`,key,e),typeof key==`string`?key:key?.txt||``}},aggregatePrimary=computed(()=>{let poi=selectedPoi.value;return poi?.aggregatePrimary?.label&&poi?.aggregatePrimary?.value?poi.aggregatePrimary:null}),onAction=action=>{props.store.executePoiAction(action.actionId)};return(_ctx,_cache)=>(openBlock(),createElementBlock(Fragment,null,[selectedPoisList.value.length>=1?withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$273,[(openBlock(!0),createElementBlock(Fragment,null,renderList(selectedPoisList.value,(poi,index)=>(openBlock(),createElementBlock(`div`,{key:poi.id||index,class:normalizeClass([`poi-icon`,{active:index===currentPoiIndex.value}]),onClick:$event=>selectPoi(index)},[createVNode(unref(bngSpriteIcon_default),{src:`map_`+poi.spriteIcon,style:{width:`100%`,height:`100%`}},null,8,[`src`])],10,_hoisted_2$225))),128))])),[[unref(BngBlur_default),!0]]):createCommentVNode(``,!0),unref(selectedPoi)?withDirectives((openBlock(),createElementBlock(`div`,_hoisted_3$199,[createBaseVNode(`div`,_hoisted_4$171,[createVNode(bngAdvCardHeading_default,{class:`poi-details-header`,type:`line`,preheadings:preheadings.value},{default:withCtx(()=>[createTextVNode(toDisplayString(safeTranslate(unref(selectedPoi).name)),1)]),_:1},8,[`preheadings`]),createBaseVNode(`div`,_hoisted_5$147,[preview.value?(openBlock(),createBlock(aspectRatio_default,{key:0,class:`poi-thumbnail`,ratio:`16:9`,externalImage:preview.value,imageMode:`cover`},{default:withCtx(()=>[aggregatePrimary.value||unref(selectedPoi).formattedProgress?(openBlock(),createElementBlock(`div`,_hoisted_6$126,[unref(selectedPoi).formattedProgress?(openBlock(),createElementBlock(`div`,_hoisted_7$112,[createBaseVNode(`div`,_hoisted_8$94,[unref(selectedPoi).formattedProgress.unlockedStars?(openBlock(),createBlock(unref(bngMainStars_default),{key:0,individualStars:unref(selectedPoi).formattedProgress.unlockedStars.defaults,class:`main-stars`,scale:.8,reverse:``},null,8,[`individualStars`])):createCommentVNode(``,!0),unref(selectedPoi).formattedProgress.unlockedStars&&unref(selectedPoi).formattedProgress.unlockedStars.totalBonusStarCount>0?(openBlock(),createBlock(unref(bngMainStars_default),{key:1,individualStars:unref(selectedPoi).formattedProgress.unlockedStars.bonus,class:`bonus-stars`,scale:.8},null,8,[`individualStars`])):createCommentVNode(``,!0)])])):aggregatePrimary.value?(openBlock(),createElementBlock(`div`,_hoisted_9$84,[createBaseVNode(`span`,_hoisted_10$73,toDisplayString(_ctx.$t(aggregatePrimary.value.label))+`:`,1),createBaseVNode(`span`,_hoisted_11$66,toDisplayString(_ctx.$t(aggregatePrimary.value.value)),1)])):createCommentVNode(``,!0)])):createCommentVNode(``,!0)]),_:1},8,[`externalImage`])):createCommentVNode(``,!0),unref(selectedPoi).description?(openBlock(),createElementBlock(`div`,_hoisted_12$54,toDisplayString(safeTranslate(unref(selectedPoi).description)),1)):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_13$47,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(selectedPoi).actions,action=>(openBlock(),createBlock(unref(bngButton_default),{key:action.id,accent:unref(ACCENTS).secondary,"icon-right":action.icon,label:action.label,onClick:$event=>onAction(action)},null,8,[`accent`,`icon-right`,`label`,`onClick`]))),128))])])])),[[unref(BngBlur_default),!0]]):createCommentVNode(``,!0)],64))}},PoiDetails_default=__plugin_vue_export_helper_default(_sfc_main$305,[[`__scopeId`,`data-v-35e47e7e`]]),_hoisted_1$272={class:`poi-filters`},_hoisted_2$224={key:0,class:`filter-row`},_hoisted_3$198=[`onClick`],_hoisted_4$170=[`onClick`],_sfc_main$304={__name:`PoiFilters`,props:{store:{type:Object,required:!0}},setup(__props){let props=__props,{filterData,debugLog:debugLog$1}=props.store;debugLog$1(`PoiFilters`,`Component initialized`,{filterDataCount:filterData.value?.length||0});let getGroupVisualState=(filter,group)=>{if(!filter||!group||!filter.groups||!Array.isArray(filter.groups))return`inactive`;let visibleGroups=0,totalGroups=0;for(let filterGroup of filter.groups)filterGroup&&filterGroup.elementCount>0&&(totalGroups++,filterGroup.visible&&visibleGroups++);let isAllGroupsActive=visibleGroups===totalGroups,isGroupActive=group.visible;return isAllGroupsActive?`neutral`:isGroupActive?`active`:`inactive`},getGroupColor=(filter,group)=>{switch(getGroupVisualState(filter,group)){case`neutral`:return`var(--bng-off-white)`;case`active`:return`var(--bng-add-green-100)`;case`inactive`:default:return`var(--bng-add-red-300)`}},hasActiveFilters=filter=>{if(!filter||!filter.groups||!Array.isArray(filter.groups))return!1;let visibleGroups=0,totalGroups=0;for(let group of filter.groups)group&&group.elementCount>0&&(totalGroups++,group.visible&&visibleGroups++);return visibleGroups{debugLog$1(`PoiFilters`,`Toggling group visibility`,groupKey),props.store.toggleGroupVisibility(groupKey)},toggleFilterSectionVisibility=filterKey=>{debugLog$1(`PoiFilters`,`Toggling filter section visibility`,filterKey),props.store.toggleFilterSectionVisibility(filterKey)};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$272,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(filterData),filterSection=>(openBlock(),createElementBlock(Fragment,{key:filterSection.key},[filterSection&&filterSection.groups?withDirectives((openBlock(),createElementBlock(`div`,_hoisted_2$224,[createBaseVNode(`div`,{class:normalizeClass([`filter-icon`,{"has-active-filters":hasActiveFilters(filterSection)}]),onClick:$event=>toggleFilterSectionVisibility(filterSection.key)},[createVNode(bngTooltip_default,{text:_ctx.$tt(filterSection.title)},{default:withCtx(()=>[createVNode(unref(bngIcon_default),{type:filterSection.icon},null,8,[`type`])]),_:2},1032,[`text`])],10,_hoisted_3$198),_cache[0]||=createBaseVNode(`div`,{class:`filter-separator`},null,-1),(openBlock(!0),createElementBlock(Fragment,null,renderList(filterSection.groups,group=>(openBlock(),createElementBlock(Fragment,{key:group.key},[group&&group.elementCount>0?(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`filter-group`,{inactive:!group.visible}]),onClick:$event=>toggleGroupVisibility(group.key)},[createVNode(bngTooltip_default,{text:_ctx.$tt(group.label)+` ×`+group.elementCount},{default:withCtx(()=>[createVNode(unref(bngIcon_default),{type:group.icon||`info`,color:getGroupColor(filterSection,group)},null,8,[`type`,`color`])]),_:2},1032,[`text`])],10,_hoisted_4$170)):createCommentVNode(``,!0)],64))),128))])),[[unref(BngBlur_default),!0]]):createCommentVNode(``,!0)],64))),128))]))}},PoiFilters_default=__plugin_vue_export_helper_default(_sfc_main$304,[[`__scopeId`,`data-v-43aa27ac`]]);const debugLog=(component,message,data)=>{};function useBigMap(){let selectedPoi=ref(null),selectedPoiIds=ref([]),filterData=ref([]),groupData=ref([]),poiData=ref({}),gameMode=ref(``),levelData=ref({title:``}),isPoiListVisible=ref(!1),isDetailsVisible=ref(!1),{events:events$3}=useBridge(),translatedPreheadings=computed(()=>{let preheadings=[];return gameMode.value&&preheadings.push($translate.instant(`ui.playmodes.${gameMode.value}`)),levelData.value?.title&&preheadings.push($translate.instant(levelData.value.title)),preheadings}),currentFilterTitle=computed(()=>$translate.instant(`bigMap.sideMenu.pois`)),getStaticDataFromLua=async()=>{try{poiData.value=await Lua_default.freeroam_vueBigMap.getPoiData()||{};let gameStateResult=await Lua_default.freeroam_vueBigMap.getGameStateInfo();gameStateResult&&(gameMode.value=gameStateResult.gameMode||``,levelData.value=gameStateResult.levelData||{title:``}),poiData.value,gameMode.value}catch(error){console.error(`Error getting static data from Lua:`,error)}},getDynamicDataFromLua=async()=>{try{filterData.value=await Lua_default.freeroam_vueBigMap.getFilters()||[],groupData.value=await Lua_default.freeroam_vueBigMap.getGroups()||[],filterData.value,groupData.value}catch(error){console.error(`Error getting dynamic data from Lua:`,error)}},handleShowPoiDetails=data=>{let poiIds=data?.poiIds||[];if(selectedPoiIds.value=poiIds,poiIds.length===0){selectedPoi.value=null,isDetailsVisible.value=!1;return}let selectedPoiId=poiIds[0];selectedPoiId&&poiData.value[selectedPoiId]?(selectedPoi.value=poiData.value[selectedPoiId],isDetailsVisible.value=!0):(selectedPoi.value=null,isDetailsVisible.value=!1)},toggleGroupVisibility=async groupKey=>{try{let filterIds=[groupKey];await Lua_default.freeroam_vueBigMap.toggleFiltersByIds(filterIds),await getDynamicDataFromLua()}catch(error){console.error(`Error toggling group visibility:`,error)}},toggleFilterSectionVisibility=async filterKey=>{try{await Lua_default.freeroam_vueBigMap.toggleFilterSectionById(filterKey),await getDynamicDataFromLua()}catch(error){console.error(`Error toggling filter visibility:`,error)}},selectPoi=async poiId=>{try{let result=await Lua_default.freeroam_vueBigMap.selectPoiFromList(poiId);result===`success`?poiId?(selectedPoi.value=poiData.value[poiId],isDetailsVisible.value=!0):(selectedPoi.value=null,isDetailsVisible.value=!1):console.error(`Failed to select POI:`,result)}catch(error){console.error(`Error selecting POI:`,error)}};return{selectedPoi,selectedPoiIds,filterData,groupData,poiData,gameMode,levelData,isPoiListVisible,isDetailsVisible,translatedPreheadings,currentFilterTitle,initialize:async()=>{try{await Lua_default.freeroam_vueBigMap.enterBigMap(),await getStaticDataFromLua(),await getDynamicDataFromLua(),events$3.on(`showPoiDetails`,handleShowPoiDetails)}catch(error){console.error(`Error initializing bigmap:`,error)}},cleanup:async()=>{try{await Lua_default.freeroam_vueBigMap.exitBigMap(),events$3.off(`showPoiDetails`)}catch(error){console.error(`Error cleaning up bigmap:`,error)}},selectPoi,showPoiList:()=>{isPoiListVisible.value=!0},hidePoiList:()=>{isPoiListVisible.value=!1,selectedPoi.value&&selectPoi(null)},onHover:async(poiId,active)=>{try{await Lua_default.freeroam_vueBigMap.hoverPoiFromList(poiId,active)}catch(error){console.error(`Error hovering POI:`,error)}},executePoiAction:async actionId=>{try{await Lua_default.freeroam_vueBigMap.executePoiAction(actionId)}catch(error){console.error(`Error executing POI action:`,error)}},toggleGroupVisibility,toggleFilterSectionVisibility,debugLog}}var _hoisted_1$271={class:`bigmap-container`},_hoisted_2$223={class:`bigmap-content`},_hoisted_3$197={class:`bigmap-left-content`},_hoisted_4$169={class:`bigmap-poilist-outline`},_hoisted_5$146={key:0,class:`bigmap-details-outline`},_sfc_main$303={__name:`BigMap`,setup(__props){let store$1=useBigMap(),{isPoiListVisible,isDetailsVisible,translatedPreheadings,currentFilterTitle,onSetRoute,onTeleport,toggleGroupVisibility,initialize,cleanup,debugLog:debugLog$1}=store$1,handleToggleGroupVisibility=groupKey=>{debugLog$1(`BigMap`,`Toggle group visibility`,groupKey),toggleGroupVisibility(groupKey)};return onMounted(()=>{debugLog$1(`BigMap`,`Component mounted, initializing bigmap`),initialize()}),onUnmounted(()=>{debugLog$1(`BigMap`,`Component unmounted, cleaning up bigmap`),cleanup()}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$271,[createVNode(unref(bngScreenHeading_default),{class:`bigmap-heading`,preheadings:unref(translatedPreheadings),divider:!0,type:`line`},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(currentFilterTitle)),1)]),_:1},8,[`preheadings`]),createBaseVNode(`div`,_hoisted_2$223,[createBaseVNode(`div`,_hoisted_3$197,[createVNode(PoiFilters_default,{store:unref(store$1),onToggleGroupVisibility:handleToggleGroupVisibility},null,8,[`store`]),createBaseVNode(`div`,_hoisted_4$169,[createVNode(unref(bngDrawer_default),{modelValue:unref(isPoiListVisible),"onUpdate:modelValue":_cache[0]||=$event=>isRef(isPoiListVisible)?isPoiListVisible.value=$event:null,position:`left`,blur:``,header:_ctx.$tt(`bigMap.sideMenu.pois`)},{default:withCtx(()=>[createVNode(PoiList_default,{class:`bigmap-poilist`,store:unref(store$1)},null,8,[`store`])]),_:1},8,[`modelValue`,`header`])])]),_cache[1]||=createBaseVNode(`div`,{class:`bigmap-center-outline`},null,-1),unref(isDetailsVisible)?(openBlock(),createElementBlock(`div`,_hoisted_5$146,[createVNode(PoiDetails_default,{store:unref(store$1),onSetRoute:unref(onSetRoute),onTeleport:unref(onTeleport)},null,8,[`store`,`onSetRoute`,`onTeleport`])])):createCommentVNode(``,!0)])]))}},BigMap_default=__plugin_vue_export_helper_default(_sfc_main$303,[[`__scopeId`,`data-v-e6716bb0`]]),_hoisted_1$270={class:`bigmap-view`},_sfc_main$302={__name:`BigMapView`,setup(__props){return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$270,[createVNode(BigMap_default)]))}},BigMapView_default=__plugin_vue_export_helper_default(_sfc_main$302,[[`__scopeId`,`data-v-044f4742`]]),routes_default$1=[{path:`/bigmap`,name:`bigmap`,component:BigMapView_default,meta:{uiApps:{shown:!1},infoBar:{visible:!0,showSysInfo:!0}}}],_hoisted_1$269={class:`progress-steps`},_hoisted_2$222={class:`step-container`},_hoisted_3$196={class:`step-header`},_hoisted_4$168={class:`step-number`},_hoisted_5$145={class:`step-icon`},_hoisted_6$125={class:`step-label`},_sfc_main$301={__name:`ProgressSteps`,props:{steps:{type:Array,required:!0,validator:steps=>steps.every(step=>step.label&&typeof step.label==`string`||step.title&&typeof step.title==`string`)},currentStep:{type:Number,required:!0,validator:step=>step>=0}},setup(__props){let props=__props,styles={answeredYes:{class:`answered-yes`,icon:`checkboxOn`},answeredNo:{class:`answered-no`,icon:`missionCheckboxCross`},current:{class:`not-answered current`,icon:`arrowLargeRight`},next:{class:`not-answered`,icon:`checkboxOff`}},steps=computed(()=>props.steps.map((step,idx)=>{let answer=step.isAnswered?step.answerType||`yes`:null,status=`next`;return idx(openBlock(),createElementBlock(`div`,_hoisted_1$269,[createBaseVNode(`div`,_hoisted_2$222,[(openBlock(!0),createElementBlock(Fragment,null,renderList(steps.value,(step,index)=>(openBlock(),createElementBlock(`div`,{key:index,class:normalizeClass([`step`,step.class])},[createBaseVNode(`div`,_hoisted_3$196,[createBaseVNode(`div`,_hoisted_4$168,toDisplayString(index+1),1),step.isLastStep?createCommentVNode(``,!0):(openBlock(),createElementBlock(Fragment,{key:0},[_cache[0]||=createBaseVNode(`div`,{class:`step-connector`},null,-1),createBaseVNode(`div`,_hoisted_5$145,[createVNode(unref(bngIcon_default),{type:step.icon},null,8,[`type`])])],64))]),createBaseVNode(`div`,_hoisted_6$125,toDisplayString(_ctx.$tt(step.label)),1)],2))),128))])]))}},ProgressSteps_default=__plugin_vue_export_helper_default(_sfc_main$301,[[`__scopeId`,`data-v-d5d29cd2`]]);function useWizard(options={}){let{allowSkip=!1,validateSteps=!0}=options,stepRegistry=ref(new Map),currentStepIndex=ref(0),completedSteps=ref(new Set),isFinished=ref(!1),steps=computed(()=>{if(stepRegistry.value.size===0)return[];let res=Array.from(stepRegistry.value.values());for(let step of res)if(!(!step.enabledWhen||step.enabledWhen.length===0)){for(let condition of step.enabledWhen)if(condition.step){let dependencyStep=res.find(s=>s.id===condition.step);if(!dependencyStep)continue;dependencyStep.requiredFor||=[],dependencyStep.requiredFor.includes(step.id)||dependencyStep.requiredFor.push(step.id)}}return res}),registerStep=stepConfig=>stepRegistry.value.set(stepConfig.id,stepConfig),unregisterStep=stepId=>stepRegistry.value.delete(stepId);provide(`registerWizardStep`,registerStep),provide(`unregisterWizardStep`,unregisterStep);let currentStep=computed(()=>steps.value[currentStepIndex.value]||null),isFirstStep=computed(()=>currentStepIndex.value===0),isLastStep=computed(()=>currentStepIndex.value===steps.value.length-1),canGoNext=computed(()=>{if(!validateSteps)return!0;let step=currentStep.value;return!step||!isStepEnabled(step)||step.advanceDisabled?!1:typeof step.validate==`function`?step.validate(step.modelValue||{}):step.type===`choice`&&step.required!==!1?step.modelValue?.choice!==void 0:(step.type,!0)}),isStepEnabled=step=>!step.enabledWhen||step.enabledWhen.length===0?!0:step.enabledWhen.every(condition=>{if(condition.step){let dependencyStepData=steps.value.find(s=>s.id===condition.step)?.modelValue||{};if(condition.value!==void 0)return dependencyStepData?.choice===condition.value||dependencyStepData?.[Object.keys(dependencyStepData)[0]]===condition.value;if(typeof condition.condition==`function`)return condition.condition(dependencyStepData)}return typeof condition.condition==`function`?condition.condition():!0}),canGoBack=computed(()=>!isFirstStep.value),canFinish=computed(()=>validateSteps?isLastStep.value&&canGoNext.value:isLastStep.value),goToStep=index=>{index<=0&&(currentStepIndex.value=0),index>=steps.value.length&&(currentStepIndex.value=steps.value.length-1),currentStepIndex.value=index},nextStep=async()=>{if(await nextTick(),!canGoNext.value)return!1;if(currentStep.value&&completedSteps.value.add(currentStepIndex.value),isLastStep.value)return!0;for(currentStepIndex.value++;currentStepIndex.value=steps.value.length&&(currentStepIndex.value=steps.value.length-1),!0};return{currentStepIndex,currentStep,completedSteps,isFinished,steps,stepRegistry,isFirstStep,isLastStep,canGoNext,canGoBack,canFinish,progress:computed(()=>steps.value.length===0?0:Math.round((currentStepIndex.value+1)/steps.value.length*100)),stepProgress:computed(()=>steps.value.map((step,index)=>{let data=step.modelValue||{},choiceAnalysis=null;if(step.type===`choice`&&step.choices&&data.choice!==void 0){let selectedChoice=step.choices.find(c=>c.value===data.choice),yesChoice=step.choices.find(c=>c.isYes),noChoice=step.choices.find(c=>c.isNo),answerType=null;selectedChoice&&(answerType=selectedChoice.isYes||yesChoice&&selectedChoice.value===yesChoice.value?`yes`:selectedChoice.isNo||noChoice&&selectedChoice.value===noChoice.value?`no`:!yesChoice&&!noChoice?`yes`:step.choices.length===2&&!selectedChoice.isYes&&!selectedChoice.isNo?`no`:`yes`),choiceAnalysis={selectedValue:data.choice,selectedChoice,answerType,hasYesFlag:!!yesChoice,hasNoFlag:!!noChoice}}return{...step,index,isCompleted:completedSteps.value.has(index),isCurrent:index===currentStepIndex.value,isAccessible:index<=currentStepIndex.value,isEnabled:isStepEnabled(step),data,hasData:Object.keys(data).length>0,isAnswered:step.type===`choice`?data.choice!==void 0:Object.keys(data).length>0,answerType:choiceAnalysis?.answerType||null,choiceAnalysis}})),goToStep,nextStep,previousStep:async()=>{if(await nextTick(),!canGoBack.value)return!1;for(currentStepIndex.value--;currentStepIndex.value>=0;){let targetStep=steps.value[currentStepIndex.value];if(isStepEnabled(targetStep)||targetStep.autoSkip===!1)break;currentStepIndex.value--}return currentStepIndex.value<0&&(currentStepIndex.value=0),!0},finish:()=>canFinish.value?(isFinished.value=!0,{success:!0,completedSteps:Array.from(completedSteps.value)}):{success:!1},reset:()=>{currentStepIndex.value=0,completedSteps.value.clear(),isFinished.value=!1},skip:()=>allowSkip?nextStep():!1,isStepEnabled,registerStep,unregisterStep}}var _hoisted_1$268={class:`wizard-container`},_hoisted_2$221={class:`wizard-content`},_hoisted_3$195={class:`wizard-step-content`},_hoisted_4$167={key:0,class:`wizard-validation`},_hoisted_5$144={class:`validation-message`},_hoisted_6$124={class:`wizard-navigation`},_hoisted_7$111={key:2,class:`switch-buttons`};const wizardProps={wizardOptions:{type:Object,default:()=>({})},title:String,preheadings:Array,showDivider:{type:Boolean,default:!0},showProgress:{type:Boolean,default:!0},showBackButton:{type:Boolean,default:!0},allowSkip:{type:Boolean,default:!1},backButtonText:{type:String,default:`ui.common.back`},nextButtonText:{type:String,default:`ui.common.next`},finishButtonText:{type:String,default:`ui.common.finish`},skipButtonText:{type:String,default:`ui.common.skip`},validationMessage:String};var _sfc_main$300={__name:`Wizard`,props:mergeModels(wizardProps,{modelValue:{default:()=>({})},modelModifiers:{}}),emits:mergeModels([`step-change`,`step-complete`,`wizard-finish`,`validation-error`],[`update:modelValue`]),setup(__props,{expose:__expose,emit:__emit}){let props=__props,modelValue=useModel(__props,`modelValue`),emit$1=__emit,{currentStepIndex,currentStep,isFirstStep,isLastStep,canGoNext,canGoBack,canFinish,progress,stepProgress,nextStep:wizardNextStep,previousStep:wizardPreviousStep,skip:wizardSkip,steps,registerStep:originalRegisterStep}=useWizard({...props.wizardOptions,allowSkip:props.allowSkip}),instance$1=getCurrentInstance(),hasCentralizedModel=computed(()=>!!(instance$1&&instance$1.attrs&&`onUpdate:modelValue`in instance$1.attrs));provide(`currentWizardStep`,currentStep),provide(`wizardNext`,()=>nextStep()),provide(`wizardSteps`,steps),provide(`registerWizardStep`,stepConfig=>hasCentralizedModel.value?originalRegisterStep({...stepConfig,get modelValue(){return modelValue.value?.[stepConfig.id]||{}},updateModelValue:newValue=>{modelValue.value={...modelValue.value,[stepConfig.id]:newValue}}}):originalRegisterStep(stepConfig)),provide(`unregisterWizardStep`,stepId=>{if(hasCentralizedModel.value&&props.modelValue[stepId]){let updatedData={...props.modelValue};delete updatedData[stepId],emit$1(`update:modelValue`,updatedData)}});let currentStepChoices=computed(()=>currentStep.value?.choices||[]),getChoiceButtonClass=(choiceValue,selectedChoice)=>selectedChoice?selectedChoice===choiceValue?`answered-selected`:`answered-not-selected`:`unanswered`,handleChoiceClick=choice=>{currentStep.value?.updateModelValue&&(currentStep.value.updateModelValue({...currentStep.value.modelValue,choice:choice.value}),nextTick(()=>!currentStep.value?.advanceDisabled&&nextStep()))},nextStep=()=>{let stepId=currentStep.value?.id,currentData=currentStep.value?.modelValue||{};emit$1(`step-complete`,{stepId,stepIndex:currentStepIndex.value,step:currentStep.value,data:currentData}),wizardNextStep()&&emit$1(`step-change`,{from:currentStepIndex.value-1,to:currentStepIndex.value,step:currentStep.value})},previousStep=()=>{let prevIndex=currentStepIndex.value;wizardPreviousStep()&&emit$1(`step-change`,{from:prevIndex,to:currentStepIndex.value,step:currentStep.value})},skip=()=>{wizardSkip()&&emit$1(`step-complete`,{stepId:currentStep.value?.id,stepIndex:currentStepIndex.value-1,skipped:!0,data:currentStep.value?.modelValue||{}})},handleFinish=()=>{let allStepData={};steps.value.forEach(step=>{step.modelValue&&Object.keys(step.modelValue).length>0&&(allStepData[step.id]=step.modelValue)}),canFinish.value?emit$1(`wizard-finish`,{success:!0,data:allStepData,completedSteps:Array.from({length:steps.value.length},(_,i)=>i)}):emit$1(`validation-error`,{step:currentStep.value,message:`Cannot finish wizard - validation failed`})};return __expose({currentStepIndex,currentStep,progress,stepProgress,nextStep,previousStep,finish:handleFinish,skip,steps}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$268,[createBaseVNode(`div`,_hoisted_2$221,[_ctx.title?(openBlock(),createBlock(unref(bngScreenHeading_default),{key:0,preheadings:_ctx.preheadings,"show-divider":_ctx.showDivider},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(_ctx.title)),1)]),_:1},8,[`preheadings`,`show-divider`])):createCommentVNode(``,!0),_ctx.showProgress?(openBlock(),createBlock(unref(bngCard_default),{key:1,class:`wizard-progress-card`},{default:withCtx(()=>[createVNode(ProgressSteps_default,{steps:unref(stepProgress),"current-step":unref(currentStepIndex)},null,8,[`steps`,`current-step`])]),_:1})):createCommentVNode(``,!0),createVNode(unref(bngCard_default),{class:`wizard-main-card`},{buttons:withCtx(()=>[createBaseVNode(`div`,_hoisted_6$124,[_ctx.showBackButton&&!unref(isFirstStep)?(openBlock(),createBlock(unref(bngButton_default),{key:0,disabled:!unref(canGoBack),accent:unref(ACCENTS).secondary,onClick:previousStep},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(_ctx.backButtonText)),1)]),_:1},8,[`disabled`,`accent`])):createCommentVNode(``,!0),_ctx.allowSkip&&!unref(isLastStep)&&unref(currentStep)?.type!==`choice`?(openBlock(),createBlock(unref(bngButton_default),{key:1,accent:unref(ACCENTS).secondary,onClick:skip},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(_ctx.skipButtonText)),1)]),_:1},8,[`accent`])):createCommentVNode(``,!0),_cache[0]||=createBaseVNode(`div`,{class:`spacer`},null,-1),unref(currentStep)?.type===`choice`?(openBlock(),createElementBlock(`div`,_hoisted_7$111,[(openBlock(!0),createElementBlock(Fragment,null,renderList(currentStepChoices.value,choice=>(openBlock(),createBlock(unref(bngButton_default),{key:choice.value,class:normalizeClass(getChoiceButtonClass(choice.value,unref(currentStep)?.modelValue?.choice||null)),accent:unref(ACCENTS).custom,icon:unref(currentStep)?.modelValue?.choice===choice.value?unref(icons).checkmark:null,disabled:unref(currentStep)?.advanceDisabled,onClick:$event=>handleChoiceClick(choice)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(choice.label)),1)]),_:2},1032,[`class`,`accent`,`icon`,`disabled`,`onClick`]))),128))])):createCommentVNode(``,!0),!unref(isLastStep)&&unref(currentStep)?.type!==`choice`?(openBlock(),createBlock(unref(bngButton_default),{key:3,disabled:!unref(canGoNext),accent:unref(ACCENTS).primary,onClick:nextStep},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(_ctx.nextButtonText)),1)]),_:1},8,[`disabled`,`accent`])):unref(isLastStep)?(openBlock(),createBlock(unref(bngButton_default),{key:4,disabled:!unref(canFinish),accent:unref(ACCENTS).primary,onClick:handleFinish},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(_ctx.finishButtonText)),1)]),_:1},8,[`disabled`,`accent`])):createCommentVNode(``,!0)])]),default:withCtx(()=>[unref(currentStep)?.title?(openBlock(),createBlock(unref(bngCardHeading_default),{key:0,type:`ribbon`},{default:withCtx(()=>[renderSlot(_ctx.$slots,`step-title`,{step:unref(currentStep)},()=>[createTextVNode(toDisplayString(_ctx.$tt(unref(currentStep).title)),1)],!0)]),_:3})):createCommentVNode(``,!0),withDirectives((openBlock(),createElementBlock(`div`,_hoisted_3$195,[renderSlot(_ctx.$slots,`step`,{step:unref(currentStep),stepData:unref(currentStep)?.modelValue,updateStepData:unref(currentStep)?.updateModelValue,stepIndex:unref(currentStepIndex),isFirst:unref(isFirstStep),isLast:unref(isLastStep)},()=>[renderSlot(_ctx.$slots,`default`,{},void 0,!0)],!0),_ctx.validationMessage?(openBlock(),createElementBlock(`div`,_hoisted_4$167,[createBaseVNode(`div`,_hoisted_5$144,toDisplayString(_ctx.validationMessage),1)])):createCommentVNode(``,!0)])),[[unref(BngUiNavScroll_default)]])]),_:3})])]))}},Wizard_default=__plugin_vue_export_helper_default(_sfc_main$300,[[`__scopeId`,`data-v-69c7b9c4`]]),_sfc_main$299={__name:`WizardView`,props:mergeModels({...wizardProps},{modelValue:{},modelModifiers:{}}),emits:mergeModels([`step-change`,`step-complete`,`wizard-finish`,`validation-error`],[`update:modelValue`]),setup(__props,{expose:__expose}){let props=__props,slots=useSlots(),wizardRef=ref(),wizardModel=useModel(__props,`modelValue`);return __expose({wizard:wizardRef,get currentStepIndex(){return wizardRef.value?.currentStepIndex},get currentStep(){return wizardRef.value?.currentStep},get progress(){return wizardRef.value?.progress},get stepProgress(){return wizardRef.value?.stepProgress},get steps(){return wizardRef.value?.steps},nextStep:()=>wizardRef.value?.nextStep(),previousStep:()=>wizardRef.value?.previousStep(),finish:()=>wizardRef.value?.finish(),skip:()=>wizardRef.value?.skip()}),(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(layoutSingle_default),{class:`layout-content-full content-center layout-paddings wizard-view`},{default:withCtx(()=>[createVNode(Wizard_default,mergeProps({ref_key:`wizardRef`,ref:wizardRef},props,{modelValue:wizardModel.value,"onUpdate:modelValue":_cache[0]||=$event=>wizardModel.value=$event,onStepChange:_cache[1]||=$event=>_ctx.$emit(`step-change`,$event),onStepComplete:_cache[2]||=$event=>_ctx.$emit(`step-complete`,$event),onWizardFinish:_cache[3]||=$event=>_ctx.$emit(`wizard-finish`,$event),onValidationError:_cache[4]||=$event=>_ctx.$emit(`validation-error`,$event)}),createSlots({_:2},[renderList(unref(slots),(slot,name)=>({name,fn:withCtx(props$1=>[renderSlot(_ctx.$slots,name,normalizeProps(guardReactiveProps(props$1)),void 0,!0)])}))]),1040,[`modelValue`])]),_:3})),[[unref(BngBlur_default)]])}},WizardView_default=__plugin_vue_export_helper_default(_sfc_main$299,[[`__scopeId`,`data-v-e47281c4`]]),_hoisted_1$267={key:0,class:`wizard-summary`},_sfc_main$298={__name:`WizardSummary`,props:{custom:{type:Array,default:()=>[],validator:items$2=>items$2.every(item=>item.label&&item.value!==void 0)},replace:{type:Boolean,default:!1}},setup(__props){let props=__props,steps=inject(`wizardSteps`,ref([])),summaryItems=computed(()=>{let customItems=props.custom.map(item=>({stepId:uniqueId(),title:item.label,selectedLabel:item.value,hasSelection:!item.disabled}));if(props.replace)return customItems;let stepsList=steps.value||[],automaticItems=[];return Array.isArray(stepsList)&&(automaticItems=stepsList.filter(step=>step.type===`choice`&&step.choices&&step.choices.length>0).map(step=>{let selectedChoice=step.modelValue?.choice,choiceOption=step.choices.find(choice=>choice.value===selectedChoice);return{stepId:step.id,title:step.title,selectedLabel:choiceOption?.label||null,hasSelection:!!selectedChoice}}).filter(item=>item.hasSelection)),[...automaticItems,...customItems]});return(_ctx,_cache)=>summaryItems.value.length>0?(openBlock(),createElementBlock(`div`,_hoisted_1$267,[(openBlock(!0),createElementBlock(Fragment,null,renderList(summaryItems.value,item=>(openBlock(),createElementBlock(`div`,{key:item.stepId,class:`summary-item`},[createBaseVNode(`strong`,null,toDisplayString(_ctx.$tt(item.title))+`:`,1),createBaseVNode(`span`,{class:normalizeClass({enabled:item.hasSelection,disabled:!item.hasSelection})},toDisplayString(_ctx.$tt(item.selectedLabel||`ui.common.unknown`)),3)]))),128))])):createCommentVNode(``,!0)}},WizardSummary_default=__plugin_vue_export_helper_default(_sfc_main$298,[[`__scopeId`,`data-v-69c45791`]]),_hoisted_1$266={key:0,class:`wizard-step-container`},_hoisted_2$220={key:0,class:`step-description`},_hoisted_3$194=[`innerHTML`],_hoisted_4$166={class:`step-content`},_hoisted_5$143={key:0,class:`wizard-choice-step`},_hoisted_6$123={key:1,class:`wizard-form-step`},_hoisted_7$110={key:2,class:`wizard-confirmation-step`},_hoisted_8$93={key:3,class:`wizard-custom-step`},_hoisted_9$83={class:`custom-placeholder`},_sfc_main$297={__name:`WizardStep`,props:mergeModels({id:{type:String,required:!0},title:String,description:String,type:{type:String,default:`custom`,validator:value=>[`choice`,`form`,`confirmation`,`custom`].includes(value)},autoSkip:{type:Boolean,default:!0},advanceDisabled:{type:Boolean,default:!1},advanceDelay:{type:Number,default:300},required:{type:Boolean,default:!0},validator:{type:Function,default:null},enabledWhen:{type:Array,default:()=>[]},choices:{type:Array,default:()=>[]},component:{type:[String,Object],default:null},componentProps:{type:Object,default:()=>({})}},{modelValue:{default:()=>({})},modelModifiers:{}}),emits:[`update:modelValue`],setup(__props,{expose:__expose}){let props=__props,modelValue=useModel(__props,`modelValue`),registerStep=inject(`registerWizardStep`,null),unregisterStep=inject(`unregisterWizardStep`,null),currentStep=inject(`currentWizardStep`,null),slots=useSlots(),stepContext={stepId:props.id,stepType:props.type};provide(`wizardStepContext`,stepContext),__expose({stepId:props.id,stepContext});let isCurrentStep=computed(()=>currentStep?.value?.id===props.id);return onMounted(()=>{registerStep?.({id:props.id,title:props.title,description:props.description,type:props.type,autoSkip:props.autoSkip,get advanceDisabled(){return props.advanceDisabled},advanceDelay:props.advanceDelay,required:props.required,enabledWhen:props.enabledWhen,validate:props.validator,component:props.component,componentProps:props.componentProps,choices:props.choices,get modelValue(){return modelValue.value},updateModelValue:value=>{modelValue.value=value},hasDefaultSlot:!!slots.default,hasDescriptionSlot:!!slots.description})}),onUnmounted(()=>{unregisterStep?.(props.id)}),(_ctx,_cache)=>isCurrentStep.value?(openBlock(),createElementBlock(`div`,_hoisted_1$266,[__props.description||_ctx.$slots.description?(openBlock(),createElementBlock(`div`,_hoisted_2$220,[renderSlot(_ctx.$slots,`description`,{},()=>[__props.description?(openBlock(),createElementBlock(`div`,{key:0,innerHTML:__props.description},null,8,_hoisted_3$194)):createCommentVNode(``,!0)],!0)])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_4$166,[__props.type===`choice`?(openBlock(),createElementBlock(`div`,_hoisted_5$143,[renderSlot(_ctx.$slots,`default`,{},void 0,!0)])):__props.type===`form`?(openBlock(),createElementBlock(`div`,_hoisted_6$123,[renderSlot(_ctx.$slots,`default`,{},()=>[_cache[0]||=createBaseVNode(`div`,{class:`form-placeholder`},[createBaseVNode(`p`,null,`Add your form content here using BngInput, BngDropdown, etc.`),createBaseVNode(`p`,{class:`form-note`},`Use v-model bindings to connect to step data.`)],-1)],!0)])):__props.type===`confirmation`?(openBlock(),createElementBlock(`div`,_hoisted_7$110,[renderSlot(_ctx.$slots,`default`,{},()=>[createVNode(WizardSummary_default)],!0)])):(openBlock(),createElementBlock(`div`,_hoisted_8$93,[renderSlot(_ctx.$slots,`default`,{},()=>[createBaseVNode(`div`,_hoisted_9$83,[createBaseVNode(`p`,null,`Custom step content for: `+toDisplayString(__props.title),1),_cache[1]||=createBaseVNode(`p`,{class:`custom-note`},`Add your custom content in the WizardStep default slot`,-1)])],!0)]))])])):createCommentVNode(``,!0)}},WizardStep_default=__plugin_vue_export_helper_default(_sfc_main$297,[[`__scopeId`,`data-v-ede4abc3`]]),_hoisted_1$265={class:`description`},_hoisted_2$219={class:`image-section`},_hoisted_3$193={class:`image-row`},_hoisted_4$165=[`src`],_hoisted_5$142=[`src`],_sfc_main$296={__name:`ButtonLayoutView`,setup(__props){let settings$1=useSettings(),handleFinish=async()=>{await settings$1.apply({showedInputLayoutPopupV37:!0}),window.bngVue.gotoGameState(`menu.mainmenu`)},goToControls=async()=>{await settings$1.apply({showedInputLayoutPopupV37:!0}),window.bngVue.gotoGameState(`menu.options.controls.bindings`)};return onMounted(async()=>{await settings$1.waitForData()}),(_ctx,_cache)=>(openBlock(),createBlock(unref(WizardView_default),{title:`Input Changes`,class:`wizard-view`,"show-progress":!1,"finish-button-text":`ui.common.continue`,onWizardFinish:handleFinish},{default:withCtx(()=>[createVNode(unref(WizardStep_default),{id:`buttonLayout`,title:`Extended Modifier Buttons`,type:`confirmation`},{default:withCtx(()=>[withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$265,[_cache[1]||=createBaseVNode(`p`,null,` We updated the default button layout for Xbox and Playstation controllers using modifier buttons. Below you see the new default layout. `,-1),_cache[2]||=createBaseVNode(`p`,null,[createBaseVNode(`strong`,{class:`warning-text`},`If you made any changes to the default layout on Xbox or Playstation, we suggest you review your current layout and then either edit it or reset to the default if needed.`)],-1),createVNode(unref(bngButton_default),{accent:unref(ACCENTS).primary,onClick:goToControls},{default:withCtx(()=>[..._cache[0]||=[createTextVNode(` Go to Controls `,-1)]]),_:1},8,[`accent`])])),[[unref(BngUiNavScroll_default)]]),createBaseVNode(`div`,_hoisted_2$219,[_cache[3]||=createBaseVNode(`h4`,null,`New Button Layout`,-1),createBaseVNode(`div`,_hoisted_3$193,[createBaseVNode(`img`,{src:unref(getAssetURL)(`images/buttonLayout1.jpg`),alt:`Button Layout`,class:`button-layout-image`},null,8,_hoisted_4$165),createBaseVNode(`img`,{src:unref(getAssetURL)(`images/buttonLayout2.jpg`),alt:`Button Layout`,class:`button-layout-image`},null,8,_hoisted_5$142)])])]),_:1})]),_:1}))}},ButtonLayoutView_default=__plugin_vue_export_helper_default(_sfc_main$296,[[`__scopeId`,`data-v-ff98d0e0`]]),routes_default$2=[{path:`/buttonLayout`,name:`buttonLayout`,component:ButtonLayoutView_default,meta:{infoBar:{visible:!0,showSysInfo:!0},uiApps:{shown:!1}}}],_hoisted_1$264={class:`left`},_hoisted_2$218={class:`branch-icon-assembly`},_hoisted_3$192=[`innerHTML`],_hoisted_4$164=[`innerHTML`],_sfc_main$295={__name:`BranchSkillProgressBar`,props:{skill:Object,mode:{type:String,default:`long`,validator:value=>[`long`,`short`,`simple`,`with-value-label`].includes(value)},showLevel:{type:Boolean,default:!1},showLockedIcon:{type:Boolean,default:!1},isMainProgress:{type:Boolean,default:!1}},setup(__props){let props=__props,headerLeft=computed(()=>props.skill.name),headerRightLevelOrStars=computed(()=>props.skill.isInDevelopment?``:props.skill.unlocked?(props.showLevel&&props.skill.unlocked,props.skill.showProgressAsStars?$translate.contextTranslate({txt:`ui.career.slashStars`,context:{cur:props.skill.value,max:props.skill.max}}):props.skill.levelLabel?props.skill.levelLabel:props.skill.level?$translate.contextTranslate({txt:`ui.career.lvlLabel`,context:{lvl:props.skill.level}}):`Level ${props.skill.level}`):$translate.contextTranslate(`ui.career.locked`)),value=computed(()=>props.skill.max===-1?1:props.skill.value-props.skill.min),max$1=computed(()=>props.skill.max===-1?1:props.skill.max-props.skill.min),valueLabelFormat=computed(()=>{if(props.skill.isInDevelopment)return $translate.contextTranslate(`ui.career.inDevelopment`);if(!props.skill.unlocked)return $translate.contextTranslate(`ui.career.locked`);if(props.mode===`simple`)return props.skill.showProgressAsStars?$translate.contextTranslate({txt:`ui.career.slashStars`,context:{cur:value.value,max:max$1.value}}):$translate.contextTranslate({txt:`ui.career.lvlLabel`,context:{lvl:props.skill.level}});let unit=props.skill.showProgressAsStars?`Stars`:`XP`;return props.skill.max===-1?$translate.contextTranslate({txt:`ui.career.just`+unit,context:{cur:value.value}}):$translate.contextTranslate({txt:`ui.career.slashXP`,context:{cur:value.value,max:max$1.value}})}),skillIcon=computed(()=>props.skill.isInDevelopment?icons.roadblockL:props.skill.unlocked?props.skill.icon||`info`:`lockClosed`),belowValueLabelFormat=computed(()=>{if(!props.skill.unlocked&&props.skill.lockedReason)return $translate.contextTranslate(props.skill.lockedReason?.label||`ui.career.locked`);if(props.skill.isInDevelopment)return $translate.contextTranslate(`ui.career.inDevelopment`);if(props.skill.isMaxLevel)return``;if(!props.skill.showProgressAsStars)return $translate.contextTranslate({txt:`ui.career.justXP`,context:{cur:props.skill.value}})}),branchBackgroundStyle=computed(()=>{let color=props.skill.accentColor;return color?color.startsWith(`--`)?{"background-color":`var(${color})`}:color.startsWith(`#`)?{"background-color":color}:{"background-color":`rgb(${color})`}:{"background-color":`#555555`}});return(_ctx,_cache)=>__props.mode===`simple`?(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`simple-progress`,{"is-locked":!props.skill.unlocked}])},[createBaseVNode(`div`,_hoisted_1$264,[createBaseVNode(`div`,_hoisted_2$218,[!__props.skill.isSkill&&!__props.skill.isBranch?(openBlock(),createElementBlock(`div`,{key:0,class:`branch-background`,style:normalizeStyle(branchBackgroundStyle.value)},null,4)):createCommentVNode(``,!0),createVNode(unref(bngIcon_default),{type:skillIcon.value,class:`assembly-icon`},null,8,[`type`])]),createTextVNode(` `+toDisplayString(_ctx.$ctx_t(headerLeft.value)),1)]),createBaseVNode(`div`,{class:`right`,innerHTML:valueLabelFormat.value},null,8,_hoisted_3$192)],2)):(openBlock(),createElementBlock(`div`,{key:1,class:normalizeClass([`flex-column`,{"is-locked":!props.skill.unlocked}])},[createVNode(unref(bngProgressBar_default),{class:normalizeClass([`stat-progress-bar`,{short:__props.mode===`short`,isMainProgress:__props.isMainProgress}]),headerLeft:_ctx.$ctx_t(headerLeft.value),headerRight:_ctx.$ctx_t(headerRightLevelOrStars.value),value:value.value,max:max$1.value+.001,showValueLabel:!0,valueLabelFormat:``,valueColor:`#eeeeee`},null,8,[`class`,`headerLeft`,`headerRight`,`value`,`max`]),!props.skill.unlocked&&__props.mode===`with-value-label`&&props.showLockedIcon?(openBlock(),createElementBlock(Fragment,{key:0},[],64)):createCommentVNode(``,!0),__props.mode===`with-value-label`?(openBlock(),createElementBlock(`div`,{key:1,class:`below-progress-bar`,innerHTML:belowValueLabelFormat.value},null,8,_hoisted_4$164)):createCommentVNode(``,!0)],2))}},BranchSkillProgressBar_default=__plugin_vue_export_helper_default(_sfc_main$295,[[`__scopeId`,`data-v-2f641a65`]]);function hexToRgb(hex){hex=hex.replace(/^#/,``);let bigint=parseInt(hex,16);return`${bigint>>16&255}, ${bigint>>8&255}, ${bigint&255}`}function getBranchColorStyle({color,accentColor}){let style={};color&&(color.startsWith(`#`)?style[`--branch-color`]=hexToRgb(color):color.startsWith(`var(--`)&&(style[`--branch-color`]=color));let accent=accentColor||color;return accent&&(accent.startsWith(`#`)?style[`--branch-accent-color`]=hexToRgb(accent):accent.startsWith(`var(--`)&&(style[`--branch-accent-color`]=accent)),style}function getIconBackgroundStyle(color){return color?color.startsWith(`--`)?{"background-color":`var(${color})`}:color.startsWith(`#`)?{"background-color":color}:{"background-color":`rgb(${color})`}:{"background-color":`#555555`}}var _hoisted_1$263={class:`branch-details`},_hoisted_2$217={class:`backdrop`},_hoisted_3$191={class:`skill-levels-wrapper`},_hoisted_4$163={key:0,class:`branch-name-container`},_hoisted_5$141={key:2,class:`branch-footer`},_hoisted_6$122={key:0,class:`branch-description`},_hoisted_7$109={key:0,class:`branch-description`},_hoisted_8$92={class:`branch-footer-content`},_hoisted_9$82={class:`certification-text`},_hoisted_10$72={class:`status`},_hoisted_11$65={class:`unlock-info-row`},_hoisted_12$53={class:`icon-box`},_hoisted_13$46={class:`certification-text`},_sfc_main$294={__name:`BranchSkillCard`,props:{branchKey:String,displayMode:{type:String,default:`card`}},emits:[`openBranchPage`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,branchData=ref();computed(()=>branchData.value&&`url(${getAssetURL(branchData.value.icon)})`);let branchColor=computed(()=>{let color=branchData.value&&branchData.value.color;return color?color.startsWith(`#`)?hexToRgb(color):color.startsWith(`var(--`)?`${color}`:`transparent`:``}),branchAccentColor=computed(()=>{let color=branchData.value&&(branchData.value.accentColor||branchData.value.color);return color?color.startsWith(`#`)?hexToRgb(color):color.startsWith(`var(--`)?`${color}`:`transparent`:``}),branchIconType=computed(()=>branchData.value&&branchData.value.isInDevelopment?icons.roadblockL:branchData.value&&branchData.value.unlocked?icons[branchData.value.glyphIcon]:icons.lockClosed),isHalf=computed(()=>{if(!branchData.value)return!1;let hasSkills=branchData.value.skills&&branchData.value.skills.length>0,hasDescription=branchData.value.shortDescription;return!hasSkills&&!hasDescription}),safeArray=arr=>Array.isArray(arr)?arr:[],openBranchPage=branchKey=>emit$1(`openBranchPage`,branchKey);function setup$3(data){branchData.value=data,branchData.value.skills=safeArray(data.skills)}let formatColor=color=>color?color.startsWith(`#`)?hexToRgb(color):color.startsWith(`var(--`)?`${color}`:`rgb(255, 255, 255)`:``;return onMounted(async()=>{setup$3(await Lua_default.career_modules_branches_landing.getBranchSkillCardData(props.branchKey))}),(_ctx,_cache)=>branchData.value?(openBlock(),createBlock(unref(bngCard_default),{key:0,class:normalizeClass([`branch-skill-card`,{"row-mode":__props.displayMode===`row`,locked:!branchData.value.unlocked,half:isHalf.value}]),onClick:_cache[0]||=$event=>openBranchPage(__props.branchKey),style:normalizeStyle({"--branch-color":branchColor.value,"--branch-accent-color":branchAccentColor.value})},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$263,[_cache[2]||=createBaseVNode(`div`,{class:`indicator left`},null,-1),_cache[3]||=createBaseVNode(`div`,{class:`indicator right`},null,-1),branchData.value.isDomain?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`branch-progress`,{"in-development":branchData.value.isInDevelopment}])},[branchData.value.isDomain?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`badge`,{"row-badge":__props.displayMode===`row`}])},[createBaseVNode(`div`,_hoisted_2$217,toDisplayString(branchData.value.value.color),1),createVNode(unref(bngIcon_default),{class:`icon-branch`,type:branchIconType.value},null,8,[`type`])],2))],2)),branchData.value.isDomain?(openBlock(),createBlock(unref(aspectRatio_default),{key:1,"external-image":branchData.value.cover,ratio:`16:9`,class:`image-container aspect-ratio`},null,8,[`external-image`])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_3$191,[__props.displayMode===`row`?(openBlock(),createElementBlock(`div`,_hoisted_4$163,[branchData.value?(openBlock(),createBlock(BranchSkillProgressBar_default,{key:0,class:`main-stat-progress-bar`,skill:branchData.value,showLevel:!0,mode:(branchData.value.isInDevelopment&&isHalf.value,``)},null,8,[`skill`,`mode`])):createCommentVNode(``,!0)])):createCommentVNode(``,!0)]),isHalf.value?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_5$141,[branchData.value.isInDevelopment?(openBlock(),createElementBlock(`div`,_hoisted_6$122,toDisplayString(_ctx.$ctx_t(`ui.career.inDevelopment`)),1)):(openBlock(),createElementBlock(Fragment,{key:1},[branchData.value.shortDescription?(openBlock(),createElementBlock(`div`,_hoisted_7$109,toDisplayString(_ctx.$ctx_t(branchData.value.shortDescription)),1)):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_8$92,[branchData.value.skills?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(branchData.value.skills,skill=>(openBlock(),createElementBlock(`div`,null,[branchData.value?(openBlock(),createBlock(BranchSkillProgressBar_default,{key:0,skill,mode:`simple`},null,8,[`skill`])):createCommentVNode(``,!0)]))),256)):createCommentVNode(``,!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(branchData.value.certifications,certification=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`certification-container`,certification.status])},[createVNode(unref(bngIcon_default),{type:unref(icons).badgeRoundStar,style:normalizeStyle({color:certification.status===`completed`?`white`:certification.status===`available`?`rgba(255, 255, 255, 0.6)`:`rgba(255, 255, 255, 0.5)`})},null,8,[`type`,`style`]),createBaseVNode(`div`,_hoisted_9$82,[createTextVNode(toDisplayString(_ctx.$ctx_t(`ui.career.certification.name`))+` `,1),createBaseVNode(`span`,_hoisted_10$72,toDisplayString(_ctx.$ctx_t(certification.statusLabel)),1)])],2))),256)),branchData.value.unlockInfos?(openBlock(),createElementBlock(Fragment,{key:1},[_cache[1]||=createBaseVNode(`div`,{class:`unlock-info-title`},`Required Certifications:`,-1),createBaseVNode(`div`,_hoisted_11$65,[(openBlock(!0),createElementBlock(Fragment,null,renderList(branchData.value.unlockInfos,unlockInfo=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`unlock-info-item`,unlockInfo.status]),style:normalizeStyle({"--unlock-color":formatColor(unlockInfo.color?unlockInfo.color:`var(--bng-cool-gray-500-rgb)`)})},[createBaseVNode(`div`,_hoisted_12$53,[createVNode(unref(bngIcon_default),{type:unref(icons).badgeRoundStar,class:`certification-icon`},null,8,[`type`])]),createBaseVNode(`div`,_hoisted_13$46,toDisplayString(_ctx.$ctx_t(unlockInfo.label)),1)],6))),256))])],64)):createCommentVNode(``,!0)])],64))]))])]),_:1},8,[`class`,`style`])):createCommentVNode(``,!0)}},BranchSkillCard_default=__plugin_vue_export_helper_default(_sfc_main$294,[[`__scopeId`,`data-v-4321db2f`]]),_hoisted_1$262={class:`condensed`},_hoisted_2$216={key:3,class:`dev-icon-container`},_hoisted_3$190={class:`main-info`},_hoisted_4$162={key:1,class:`stars`},_sfc_main$293={__name:`MissionCard`,props:{mission:Object,isSkeleton:Boolean,showStartableIcons:Boolean},emits:[`clicked`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,clicked=()=>emit$1(`clicked`,props.mission),backgroundImageStyle=computed(()=>({backgroundImage:`url(${props.mission.thumbnail})`,maskImage:`linear-gradient(to left, rgba(0, 0, 0, ${props.mission.startable?.75:.2}) 50%, rgba(0, 0, 0, 0.1) 100%)`,filter:props.mission.startable?`none`:`grayscale(100%)`})),iconType$1=computed(()=>props.isSkeleton?icons.medal:icons[props.mission.icon]||icons.medal),iconColor=computed(()=>props.isSkeleton||!props.mission.startable?`var(--bng-cool-gray-600)`:`#fff`),showStartableIcons=computed(()=>!props.isSkeleton&&props.showStartableIcons);return(_ctx,_cache)=>(openBlock(),createBlock(unref(bngCard_default),{"bng-nav-item":``,onClick:clicked,class:normalizeClass({"card-wrapper":!0,"click-startable":__props.mission&&__props.mission.startable})},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$262,[__props.isSkeleton?createCommentVNode(``,!0):(openBlock(),createBlock(unref(aspectRatio_default),{key:0,class:`image`,style:normalizeStyle(backgroundImageStyle.value)},null,8,[`style`])),!__props.isSkeleton&&!__props.mission.startable?(openBlock(),createBlock(unref(bngIcon_default),{key:1,class:`locked-icon`,type:unref(icons).lockClosed,color:iconColor.value},null,8,[`type`,`color`])):createCommentVNode(``,!0),!__props.isSkeleton&&showStartableIcons.value?(openBlock(),createElementBlock(Fragment,{key:2},[__props.mission.canStartFromProgressScreen&&__props.mission.startable?(openBlock(),createBlock(unref(bngIcon_default),{key:0,class:`locked-icon`,type:unref(icons).play,color:iconColor.value},null,8,[`type`,`color`])):createCommentVNode(``,!0),!__props.mission.canStartFromProgressScreen&&__props.mission.startable?(openBlock(),createBlock(unref(bngIcon_default),{key:1,class:`locked-icon`,type:unref(icons).mapPoint,color:iconColor.value},null,8,[`type`,`color`])):createCommentVNode(``,!0)],64)):createCommentVNode(``,!0),!__props.isSkeleton&&__props.mission.devMission?(openBlock(),createElementBlock(`div`,_hoisted_2$216,[createVNode(unref(bngIcon_default),{class:`dev-icon`,type:unref(icons).bug,color:`white`},null,8,[`type`]),_cache[0]||=createBaseVNode(`div`,{class:`dev-text`},` DEV MISSION `,-1)])):createCommentVNode(``,!0),_cache[1]||=createBaseVNode(`div`,{class:`highlight-marker`},null,-1),createVNode(unref(bngIcon_default),{class:`mission-icon`,type:iconType$1.value,color:iconColor.value},null,8,[`type`,`color`]),createVNode(unref(bngBinding_default),{class:`input-icon`,"ui-event":`ok`,controller:``}),createBaseVNode(`div`,_hoisted_3$190,[__props.isSkeleton?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`heading`,{locked:!__props.mission.startable}])},toDisplayString(_ctx.$tt(__props.mission.label)),3)),!__props.isSkeleton&&__props.mission.startable&&__props.mission.formattedProgress?(openBlock(),createElementBlock(`div`,_hoisted_4$162,[__props.mission.formattedProgress.unlockedStars&&__props.mission.formattedProgress.unlockedStars.totalDefaultStarCount?(openBlock(),createBlock(unref(bngMainStars_default),{key:0,individualStars:__props.mission.formattedProgress.unlockedStars.defaults,class:`main-stars`,scale:.6},null,8,[`individualStars`])):createCommentVNode(``,!0),__props.mission.formattedProgress.unlockedStars&&__props.mission.formattedProgress.unlockedStars.totalBonusStarCount>0?(openBlock(),createBlock(unref(bngMainStars_default),{key:1,individualStars:__props.mission.formattedProgress.unlockedStars.bonus,class:`bonus-stars`,scale:.6},null,8,[`individualStars`])):createCommentVNode(``,!0)])):createCommentVNode(``,!0)])])]),_:1},8,[`class`]))}},MissionCard_default=__plugin_vue_export_helper_default(_sfc_main$293,[[`__scopeId`,`data-v-52ea67db`]]),_hoisted_1$261={class:`rewards-pills-container`},_sfc_main$292={__name:`RewardPill`,props:{icon:String,attributeKey:String,rewardAmount:Number,highlight:Boolean,hideNumbers:Boolean,backgroundColor:{type:String,default:`rgba(var(--bng-cool-gray-900-rgb), 0.5)`}},setup(__props){return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$261,[createBaseVNode(`div`,{class:`pill`,style:normalizeStyle({backgroundColor:__props.backgroundColor,filter:__props.highlight?`brightness(350%)`:``})},[createVNode(unref(bngUnit_default),mergeProps({[__props.icon?`beamXP`:__props.attributeKey]:__props.rewardAmount},{options:__props.hideNumbers?{formatter:x=>null}:null,iconType:__props.icon?unref(icons)[__props.icon]:null,formatter:__props.attributeKey}),null,16,[`options`,`iconType`,`formatter`])],4)]))}},RewardPill_default=__plugin_vue_export_helper_default(_sfc_main$292,[[`__scopeId`,`data-v-7719e2fc`]]),_hoisted_1$260={class:`rewards-pills-container`},_sfc_main$291={__name:`RewardsPills`,props:{rewards:Object,hideNumbers:Boolean,negativeBackground:{type:Boolean,default:!0}},setup(__props){return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$260,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.rewards,reward=>(openBlock(),createBlock(RewardPill_default,{icon:reward.icon,hideNumbers:__props.hideNumbers,attributeKey:reward.attributeKey,rewardAmount:reward.rewardAmount,highlight:reward.highlight,backgroundColor:__props.negativeBackground&&reward.rewardAmount<0?`rgba(var(--bng-add-red-700-rgb), 0.5)`:void 0},null,8,[`icon`,`hideNumbers`,`attributeKey`,`rewardAmount`,`highlight`,`backgroundColor`]))),256))]))}},RewardsPills_default=__plugin_vue_export_helper_default(_sfc_main$291,[[`__scopeId`,`data-v-40e5103d`]]),_hoisted_1$259={key:0,class:`animated-border claimable`},_hoisted_2$215={key:1,class:`complete`},_hoisted_3$189={key:0,class:`complete`},_hoisted_4$161={key:1,class:`complete-badge`},_hoisted_5$140={key:2,class:`step`},_hoisted_6$121={key:3,class:`step`},_hoisted_7$108={class:`content`},_hoisted_8$91={class:`heading`},_hoisted_9$81={key:0,class:`middle-content`},_hoisted_10$71={key:1,class:`middle-content`},_hoisted_11$64={key:3,class:`progress`},_sfc_main$290={__name:`MilestoneCard`,props:{milestone:Object,isCondensed:Boolean},emits:[`claim`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,claimMilestone=()=>{console.log(`claimMilestone`,props.milestone),props.milestone.claimable&&(emit$1(`claim`,props.milestone),console.log(props.milestone))},milestoneColor=computed(()=>{let color=props.milestone.color;return color?color.startsWith(`#`)?hexToRgb$1(color):color.startsWith(`var(--`)?`${color}`:`transparent`:``});function hexToRgb$1(hex){return`${parseInt(hex.slice(1,3),16)}, ${parseInt(hex.slice(3,5),16)}, ${parseInt(hex.slice(5,7),16)}`}return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,{"bng-nav-item":``,onClick:claimMilestone,class:`condensed`},[__props.milestone.claimable?(openBlock(),createElementBlock(`div`,_hoisted_1$259)):createCommentVNode(``,!0),__props.milestone.completed?(openBlock(),createElementBlock(`div`,_hoisted_2$215)):createCommentVNode(``,!0),createVNode(unref(aspectRatio_default),{class:`image`,style:normalizeStyle({backgroundColor:`rgb(`+milestoneColor.value+`)`}),ratio:`21:9`},{default:withCtx(()=>[__props.milestone.completed?(openBlock(),createElementBlock(`div`,_hoisted_3$189)):createCommentVNode(``,!0),__props.milestone.completed?(openBlock(),createElementBlock(`div`,_hoisted_4$161,[createVNode(unref(bngIcon_default),{class:`glyph small`,type:unref(icons).checkmark},null,8,[`type`])])):createCommentVNode(``,!0),createVNode(unref(bngIcon_default),{class:`glyph`,type:unref(icons)[__props.milestone.icon]},null,8,[`type`]),__props.milestone.step!==void 0&&__props.milestone.maxStep!==void 0?(openBlock(),createElementBlock(`div`,_hoisted_5$140,toDisplayString(__props.milestone.step)+`/`+toDisplayString(__props.milestone.maxStep),1)):createCommentVNode(``,!0),__props.milestone.step!==void 0&&__props.milestone.maxStep===void 0?(openBlock(),createElementBlock(`div`,_hoisted_6$121,toDisplayString(__props.milestone.step),1)):createCommentVNode(``,!0)]),_:1},8,[`style`]),createBaseVNode(`div`,_hoisted_7$108,[createBaseVNode(`div`,_hoisted_8$91,toDisplayString(_ctx.$ctx_t(__props.milestone.label)),1),__props.milestone.description?(openBlock(),createElementBlock(`div`,_hoisted_9$81,toDisplayString(_ctx.$ctx_t(__props.milestone.description)),1)):createCommentVNode(``,!0),__props.milestone.rewards?(openBlock(),createElementBlock(`div`,_hoisted_10$71,[createVNode(RewardsPills_default,{rewards:__props.milestone.rewards},null,8,[`rewards`])])):createCommentVNode(``,!0),__props.milestone.completed?(openBlock(),createBlock(unref(bngProgressBar_default),{key:2,value:1,max:1,min:0,valueLabelFormat:`Complete!`,class:`progress`})):createCommentVNode(``,!0),__props.milestone.progress?(openBlock(),createElementBlock(`div`,_hoisted_11$64,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.milestone.progress,prog=>(openBlock(),createBlock(unref(bngProgressBar_default),{class:normalizeClass({claimProgressBar:__props.milestone.claimable}),value:prog.currValue,max:prog.maxValue,min:prog.minValue,valueLabelFormat:__props.milestone.claimable?`Click to claim!`:_ctx.$ctx_t(prog.label)},null,8,[`class`,`value`,`max`,`min`,`valueLabelFormat`]))),256))])):createCommentVNode(``,!0)])])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]])}},MilestoneCard_default=__plugin_vue_export_helper_default(_sfc_main$290,[[`__scopeId`,`data-v-8fc3424a`]]),_hoisted_1$258={class:`progress-track`},_hoisted_2$214={key:0,class:`progress-fill`,style:{height:`100%`}},_hoisted_3$188={class:`header`},_hoisted_4$160={class:`name`},_hoisted_5$139={key:0,class:`stars`},_hoisted_6$120={key:1,class:`stars`},_hoisted_7$107={class:`info`},_hoisted_8$90={class:`unlock-condition`},_hoisted_9$80={class:`info`},_hoisted_10$70={class:`label`},_hoisted_11$63={class:`description`},_hoisted_12$52={key:0,class:`cards-container`},_hoisted_13$45={class:`basic-card locked coming-soon`},_hoisted_14$42={class:`label`},_hoisted_15$40={key:1,class:`right`},_sfc_main$289={__name:`LeagueRow`,props:{league:Object,leagueMissionClicked:Function,condensed:Boolean,vertical:Boolean,nowUnlocked:Boolean},setup(__props){let props=__props;function hexToRgb$1(hex){hex=hex.replace(/^#/,``);let bigint=parseInt(hex,16);return`${bigint>>16&255}, ${bigint>>8&255}, ${bigint&255}`}let leagueStyle=computed(()=>{if(!props.league.accentColor)return{};let style={};return props.league.accentColor.startsWith(`#`)?style[`--league-accent-color`]=hexToRgb$1(props.league.accentColor):props.league.accentColor.startsWith(`var(--`)&&(style[`--league-accent-color`]=props.league.accentColor),style});return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`league-row`,{locked:!__props.league._unlocked,condensed:__props.condensed}]),style:normalizeStyle(leagueStyle.value)},[createBaseVNode(`div`,_hoisted_1$258,[__props.league._unlocked?(openBlock(),createElementBlock(`div`,_hoisted_2$214)):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_3$188,[createBaseVNode(`div`,_hoisted_4$160,[createVNode(unref(bngIcon_default),{type:unref(icons)[__props.league.icon],class:`skill-icon`,color:__props.league._unlocked?`white`:`gray`},null,8,[`type`,`color`]),createTextVNode(` `+toDisplayString(_ctx.$ctx_t(__props.league.name)),1)]),__props.nowUnlocked?(openBlock(),createElementBlock(`div`,_hoisted_6$120,[createVNode(unref(bngIcon_default),{type:unref(icons).lockOpened},null,8,[`type`])])):(openBlock(),createElementBlock(`div`,_hoisted_5$139,[__props.league._unlocked?(openBlock(),createBlock(unref(bngMainStars_default),{key:0,"unlocked-stars":__props.league.totalStarsObtained,"total-stars":__props.league.totalStarsAvailable,class:`main-stars`,scale:.8,reverse:``,numerical:``},null,8,[`unlocked-stars`,`total-stars`])):createCommentVNode(``,!0)]))]),createBaseVNode(`div`,{class:normalizeClass([`content-row`,{vertical:__props.vertical}])},[createBaseVNode(`div`,_hoisted_7$107,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.league.unlock,cond=>(openBlock(),createElementBlock(Fragment,null,[cond.hidden?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngCard_default),{key:0},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_8$90,[createBaseVNode(`div`,_hoisted_9$80,[createVNode(unref(bngIcon_default),{class:`icon`,type:cond.met?unref(icons).lockOpened:unref(icons).lockClosed,color:cond.met?`white`:`gray`},null,8,[`type`,`color`]),createBaseVNode(`div`,_hoisted_10$70,toDisplayString(cond.label),1)]),cond.progress?(openBlock(),createBlock(unref(bngProgressBar_default),{key:0,value:cond.progress.cur,min:cond.progress.min,max:cond.progress.max,valueLabelFormat:``,class:`progress`},null,8,[`value`,`min`,`max`])):createCommentVNode(``,!0)])]),_:2},1024))],64))),256)),createBaseVNode(`div`,_hoisted_11$63,toDisplayString(_ctx.$ctx_t(__props.league.description)),1)]),__props.condensed?(openBlock(),createElementBlock(`div`,_hoisted_15$40,toDisplayString(__props.league.missions.length)+` Challenges `,1)):(openBlock(),createElementBlock(`div`,_hoisted_12$52,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.league.missions,mission=>(openBlock(),createBlock(MissionCard_default,{class:`clickable-card`,key:mission.id,mission,onClicked:__props.leagueMissionClicked,showStartableIcons:!0},null,8,[`mission`,`onClicked`]))),128)),(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.league.driftSpots,driftSpot=>(openBlock(),createBlock(MissionCard_default,{class:`clickable-card`,key:driftSpot.id,mission:driftSpot,onClicked:__props.leagueMissionClicked},null,8,[`mission`,`onClicked`]))),128)),__props.league.comingSoon?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(__props.league.comingSoon,info=>(openBlock(),createBlock(unref(bngCard_default),{class:`card-height`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_13$45,[createVNode(unref(bngIcon_default),{class:`icon`,type:unref(icons)[info.icon],color:`gray`},null,8,[`type`]),createBaseVNode(`div`,_hoisted_14$42,toDisplayString(info.label),1)])]),_:2},1024))),256)):createCommentVNode(``,!0)]))],2)],6))}},LeagueRow_default=__plugin_vue_export_helper_default(_sfc_main$289,[[`__scopeId`,`data-v-f92a650f`]]),_hoisted_1$257={class:`label`},_hoisted_2$213={class:`text`},_hoisted_3$187={class:`description`},_sfc_main$288={__name:`TaskGoal`,props:{label:[String,Object],description:[String,Object],complete:Boolean,success:Boolean,settings:{type:Object,default:{animate:!1,animateOnMount:!1,successCallback:Function}}},setup(__props){let props=__props,slots=useSlots(),animationSettings=inject(`animationSettings`,props.settings),animate=ref(!1),labelParsed=computed(()=>parse$1($translate.contextTranslate(props.label,!0))),descriptionParsed=computed(()=>parse$1($translate.contextTranslate(props.description,!0))),checkboxSvgs=computed(()=>({"--checkbox-empty":`url(${getAssetURL(`icons/general/checkbox-empty.svg`)})`,"--checkbox-ok":`url(${getAssetURL(`icons/general/checkbox-ok.svg`)})`,"--checkbox-nope":`url(${getAssetURL(`icons/general/checkbox-nope.svg`)})`}));return watch(()=>[props.complete,props.success],(newValues,oldValues)=>{let isComplete=newValues[0],isSuccess=newValues[1];animate.value=animationSettings.animate&&isComplete,isSuccess&&animationSettings.successCallback()}),onBeforeMount(()=>{animate.value=props.settings.animate&&props.settings.animateOnMount}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`task-goal`,{success:__props.complete&&__props.success,fail:__props.complete&&!__props.success,animate:animate.value}])},[createBaseVNode(`div`,_hoisted_1$257,[createBaseVNode(`span`,{class:`checkbox`,style:normalizeStyle(checkboxSvgs.value)},null,4),createBaseVNode(`span`,_hoisted_2$213,[unref(slots).label?renderSlot(_ctx.$slots,`label`,{key:0},void 0,!0):__props.label?(openBlock(),createBlock(unref(dynamicComponent_default),{key:1,template:labelParsed.value},null,8,[`template`])):createCommentVNode(``,!0)])]),createBaseVNode(`span`,_hoisted_3$187,[unref(slots).description?renderSlot(_ctx.$slots,`description`,{key:0},void 0,!0):__props.description?(openBlock(),createBlock(unref(dynamicComponent_default),{key:1,template:descriptionParsed.value},null,8,[`template`])):createCommentVNode(``,!0)])],2))}},TaskGoal_default=__plugin_vue_export_helper_default(_sfc_main$288,[[`__scopeId`,`data-v-5a381682`]]),_hoisted_1$256={key:0,class:`wrapper`},_hoisted_2$212={class:`heading`},_hoisted_3$186={class:`description`},_hoisted_4$159={key:1,class:`tasklist wrapper`},_hoisted_5$138={class:`task-content`},_hoisted_6$119={class:`heading`},_hoisted_7$106={class:`description`},_sfc_main$287={__name:`UnlockCard`,props:{data:Object},setup(__props){return(_ctx,_cache)=>(openBlock(),createElementBlock(Fragment,null,[__props.data.type==`tasklist`?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_1$256,[createVNode(unref(bngIcon_default),{class:`icon`,type:unref(icons)[__props.data.icon]},null,8,[`type`]),createBaseVNode(`div`,_hoisted_2$212,toDisplayString(__props.data.heading),1),createBaseVNode(`div`,_hoisted_3$186,toDisplayString(__props.data.description),1)])),__props.data.type==`tasklist`?(openBlock(),createElementBlock(`div`,_hoisted_4$159,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.data.tasklistData.tasks,task=>(openBlock(),createElementBlock(`div`,{class:`task`,key:task.label},[createVNode(unref(bngIcon_default),{class:`icon`,type:unref(icons)[task.done?`checkboxOn`:`checkboxOff`]},null,8,[`type`]),createBaseVNode(`div`,_hoisted_5$138,[createBaseVNode(`div`,_hoisted_6$119,toDisplayString(task.label),1),createBaseVNode(`div`,_hoisted_7$106,toDisplayString(task.description),1)])]))),128))])):createCommentVNode(``,!0)],64))}},UnlockCard_default=__plugin_vue_export_helper_default(_sfc_main$287,[[`__scopeId`,`data-v-c5fa6ca1`]]),_hoisted_1$255={class:`unlock-rows`},_hoisted_2$211={class:`rows-container`},_hoisted_3$185={class:`progress-track`},_hoisted_4$158={key:0,class:`progress-fill`,style:{height:`100%`}},_hoisted_5$137={class:`header`},_hoisted_6$118={class:`level-name-and-heading`},_hoisted_7$105={class:`level-label`},_hoisted_8$89={key:0,class:`description-heading`},_hoisted_9$79={class:`content-row`},_hoisted_10$69={class:`description-column`},_hoisted_11$62={class:`unlock-condition`},_hoisted_12$51={class:`info`},_hoisted_13$44={class:`label`},_hoisted_14$41={key:1,class:`description-text`},_hoisted_15$39={class:`unlocks-column`},_hoisted_16$38={key:0,class:`unlocks-list`},_sfc_main$286={__name:`UnlockRows`,props:{value:{type:Number,default:0},min:{type:Number,default:0},max:{type:Number,required:!0},maxRequiredValue:{type:Number,required:!1},tiers:Array,currentTier:Number,unlocked:Boolean,progressFillColor:{type:String,default:`#ff6600`}},setup(__props){useCssVars(_ctx=>({v1b3c87f1:props.progressFillColor.startsWith(`var(--`)&&props.progressFillColor.endsWith(`-rgb)`)?`rgb(${props.progressFillColor})`:props.progressFillColor}));let props=__props;function hexToRgb$1(hex){hex=hex.replace(/^#/,``);let bigint=parseInt(hex,16);return`${bigint>>16&255}, ${bigint>>8&255}, ${bigint&255}`}let progressStyle=computed(()=>{if(!props.progressFillColor)return{};let style={};return props.progressFillColor.startsWith(`#`)?style[`--progress-fill-color`]=hexToRgb$1(props.progressFillColor):props.progressFillColor.startsWith(`var(--`)&&(style[`--progress-fill-color`]=props.progressFillColor),style});return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$255,[createBaseVNode(`div`,_hoisted_2$211,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.tiers,(tier,idx)=>(openBlock(),createElementBlock(`div`,{key:tier.index,class:normalizeClass({"tier-row":!0,"grayed-out":__props.currentTier<=tier.index-1,completed:__props.currentTier+1>tier.index,"in-development":tier.isInDevelopment,"first-tier":idx===0,"last-tier":idx===__props.tiers.length-1})},[createBaseVNode(`div`,_hoisted_3$185,[__props.currentTier+1>tier.index?(openBlock(),createElementBlock(`div`,_hoisted_4$158)):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_5$137,[createBaseVNode(`div`,_hoisted_6$118,[createBaseVNode(`span`,_hoisted_7$105,`Level `+toDisplayString(tier.label?tier.label:tier.index),1),tier.description&&tier.description.heading?(openBlock(),createElementBlock(`span`,_hoisted_8$89,`: `+toDisplayString(tier.description.heading),1)):createCommentVNode(``,!0)])]),createBaseVNode(`div`,_hoisted_9$79,[createBaseVNode(`div`,_hoisted_10$69,[tier.isInDevelopment||__props.currentTier+1<=tier.index||!__props.unlocked?(openBlock(),createBlock(unref(bngCard_default),{key:0,class:`unlock-condition-card`,style:normalizeStyle(progressStyle.value)},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_11$62,[createBaseVNode(`div`,_hoisted_12$51,[createVNode(unref(bngIcon_default),{class:`icon`,type:tier.isInDevelopment?unref(icons).roadblockL:unref(icons).lockClosed,color:`gray`},null,8,[`type`]),createBaseVNode(`div`,_hoisted_13$44,[tier.isInDevelopment?(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(` Coming Soon! `)],64)):(openBlock(),createElementBlock(Fragment,{key:1},[createTextVNode(toDisplayString(tier.xpCurrent)+` / `+toDisplayString(tier.xpRequired)+` XP `,1)],64))])]),!tier.isInDevelopment&&tier.currentValue&&tier.requiredValue?(openBlock(),createBlock(unref(bngProgressBar_default),{key:0,value:tier.xpCurrent,min:0,max:tier.xpRequired,valueLabelFormat:``,class:`progress`},null,8,[`value`,`max`])):createCommentVNode(``,!0)])]),_:2},1032,[`style`])):createCommentVNode(``,!0),tier.description&&tier.description.description?(openBlock(),createElementBlock(`div`,_hoisted_14$41,toDisplayString(tier.description.description),1)):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_15$39,[tier.list&&tier.list.length>0?(openBlock(),createElementBlock(`div`,_hoisted_16$38,[(openBlock(!0),createElementBlock(Fragment,null,renderList(tier.list,(item,idx$1)=>(openBlock(),createBlock(UnlockCard_default,{key:idx$1,class:`unlock-item`,data:item},null,8,[`data`]))),128))])):createCommentVNode(``,!0)])])],2))),128))])]))}},UnlockRows_default=__plugin_vue_export_helper_default(_sfc_main$286,[[`__scopeId`,`data-v-ec31f890`]]),_hoisted_1$254={class:`flex-row`},_hoisted_2$210={class:`player-content`},_hoisted_3$184={class:`stats-row`},_hoisted_4$157={class:`stat-content`},_sfc_main$285={__name:`careerSimpleStats`,setup(__props,{expose:__expose}){let careerStatsData=ref({}),handleCareerSimpleStats=data=>{data.branches.forEach(entry=>{entry.hasOwnProperty(`levelLabel`)&&(entry.name=$translate.contextTranslate(entry.name,!0),entry.levelLabel=$translate.contextTranslate(entry.levelLabel,!0))}),careerStatsData.value=data},updateDisplay=()=>{Lua_default.career_modules_uiUtils.getCareerSimpleStats().then(handleCareerSimpleStats)};return onMounted(()=>{updateDisplay()}),__expose({updateDisplay}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$254,[createBaseVNode(`div`,_hoisted_2$210,toDisplayString(careerStatsData.value.saveSlotName),1),createBaseVNode(`div`,_hoisted_3$184,[(openBlock(!0),createElementBlock(Fragment,null,renderList(careerStatsData.value.branches,branch=>(openBlock(),createElementBlock(`div`,_hoisted_4$157,[createVNode(unref(bngProgressBar_default),{class:`stat-progress-bar`,headerLeft:branch.name,headerRight:branch.levelLabel,min:branch.min,value:branch.value,max:branch.max},null,8,[`headerLeft`,`headerRight`,`min`,`value`,`max`])]))),256))])]))}},careerSimpleStats_default=__plugin_vue_export_helper_default(_sfc_main$285,[[`__scopeId`,`data-v-94a9390d`]]),_sfc_main$284={__name:`careerStatus`,props:{slim:{type:Boolean,default:!1}},setup(__props,{expose:__expose}){let careerStatusData=ref({}),handleCareerStatusData=data=>careerStatusData.value=data,updateDisplay=()=>Lua_default.career_modules_uiUtils.getCareerStatusData().then(handleCareerStatusData);return onMounted(updateDisplay),__expose({updateDisplay}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,null,[createBaseVNode(`div`,{class:normalizeClass([`career-status-progress`,{slim:__props.slim}])},[createVNode(unref(bngUnit_default),{class:`career-status-value`,insuranceScore:careerStatusData.value.insuranceScore},null,8,[`insuranceScore`]),createVNode(unref(bngDivider_default)),createVNode(unref(bngUnit_default),{class:`career-status-value`,vouchers:careerStatusData.value.vouchers},null,8,[`vouchers`]),createVNode(unref(bngDivider_default)),createVNode(unref(bngUnit_default),{class:`career-status-value`,money:careerStatusData.value.money},null,8,[`money`])],2)]))}},careerStatus_default=__plugin_vue_export_helper_default(_sfc_main$284,[[`__scopeId`,`data-v-0446c53b`]]),_hoisted_1$253={key:0},_sfc_main$283={__name:`TutorialButton`,props:{text:{type:String,default:``},icon:{type:Object,default:()=>icons.questionmark},pages:{type:Object,default:[]}},setup(__props){let props=__props,buttonRef=ref(null),seen$3=ref(!0);function clickHandler(){for(let key of props.pages)Lua_default.career_modules_linearTutorial.introPopup(key,!0);seen$3.value=!0}return onMounted(()=>{}),onUnmounted(()=>{}),(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(bngButton_default),{ref_key:`buttonRef`,ref:buttonRef,class:normalizeClass([`tut-btn`,{blink:!seen$3.value}]),icon:__props.icon,onClick:withModifiers(clickHandler,[`stop`])},{default:withCtx(()=>[__props.text?(openBlock(),createElementBlock(`span`,_hoisted_1$253,toDisplayString(__props.text),1)):createCommentVNode(``,!0)]),_:1},8,[`icon`,`class`])),[[unref(BngTooltip_default),__props.text?void 0:`View tutorial for this section`]])}},TutorialButton_default=__plugin_vue_export_helper_default(_sfc_main$283,[[`__scopeId`,`data-v-3e539b42`]]),_hoisted_1$252={class:`content`},_hoisted_2$209={class:`insurance-perks-div`},_hoisted_3$183={key:0,class:`leaving-insurance-wrapper`},_hoisted_4$156={class:`breakdown-items-wrapper`},_hoisted_5$136={class:`breakdown-item`},_hoisted_6$117={class:`orange-price`},_hoisted_7$104={class:`breakdown-item`},_hoisted_8$88={class:`red-price`},_hoisted_9$78={class:`breakdown-item total`},_hoisted_10$68={class:`breakdown-item-value-total green-price`},_hoisted_11$61={key:1,class:`no-insurance-wrapper`},_hoisted_12$50={key:2,class:`group-discount-wrapper`},_hoisted_13$43={class:`group-discount-icon-wrapper`},_hoisted_14$40={class:`group-discount-main-text`},_hoisted_15$38={class:`tier-text`},_hoisted_16$37={class:`tier-text`},_hoisted_17$31={class:`discount-text`},_hoisted_18$28={class:`grey-small-text`},_hoisted_19$24={key:3,class:`price-details-wrapper`},_hoisted_20$20={class:`price-tile`},_hoisted_21$18={key:0,class:`old-price-wrapper`},_hoisted_22$16={class:`old-price`},_hoisted_23$15={class:`price-tile-value-wrapper`},_hoisted_24$14={key:1,class:`deductible-discount`},_hoisted_25$13={class:`price-tile`},_hoisted_26$11={class:`price-tile-title`},_hoisted_27$11={class:`price-tile-value-wrapper`},_hoisted_28$10={class:`premium-extra-info`},_hoisted_29$10={class:`renewal-distance`},_sfc_main$282={__name:`insuranceCard`,props:{insuranceData:Object,isSelected:Boolean,isCurrentProvider:{type:Boolean,default:!1}},emits:[`select`],setup(__props,{emit:__emit}){let props=__props,{units}=useBridge(),emit$1=__emit,hasNoInsurance=computed(()=>props.insuranceData?.id===-1),pillText=computed(()=>{if(props.isCurrentProvider)return`CURRENT PROVIDER`;if(props.insuranceData.groupDiscountData){if(props.insuranceData.groupDiscountData?.willHaveGroupDiscountForTheFirstTime)return`MULTI-VEHICLE DISCOUNT AVAILABLE`;if(props.insuranceData.groupDiscountData?.willBumpTheirDiscount)return`BIGGER DISCOUNT AVAILABLE`;if(props.insuranceData.groupDiscountData?.currentTierData&&props.insuranceData.groupDiscountData?.currentTierData.id>0)return`MULTI-VEHICLE DISCOUNT ACTIVE`}return null}),renewsInFormatted=computed(()=>props.insuranceData?.renewsIn?units.buildString(`length`,props.insuranceData.renewsIn*1e3,0):``),leavingInsuranceRenewsInFormatted=computed(()=>props.insuranceData?.leavingInsuranceInfo?.renewsIn?units.buildString(`length`,props.insuranceData.leavingInsuranceInfo.renewsIn*1e3,0):``),selectCard=()=>{emit$1(`select`,props.insuranceData.id)},cardStyles=computed(()=>{let styles={};return!hasNoInsurance.value&&props.insuranceData.color&&(styles[`--insurance-card-rgb`]=hexToRgb(props.insuranceData.color)),styles});return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`insurance-card-container`,{selected:__props.isSelected,"no-insurance-card":hasNoInsurance.value,"current-provider":__props.isCurrentProvider}]),style:normalizeStyle(cardStyles.value),onClick:selectCard,"bng-nav-item":``},[pillText.value===null?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`top-pill`,{"no-insurance":hasNoInsurance.value,"orange-pill":__props.insuranceData.groupDiscountData?.willHaveGroupDiscountForTheFirstTime,"current-provider-pill":__props.isCurrentProvider}])},[createBaseVNode(`div`,null,toDisplayString(pillText.value),1)],2)),createBaseVNode(`div`,_hoisted_1$252,[createVNode(unref(insuranceIdentity_default),{class:`insurance-identity`,insuranceData:__props.insuranceData},null,8,[`insuranceData`]),_cache[13]||=createBaseVNode(`div`,{class:`separator`},null,-1),createBaseVNode(`div`,_hoisted_2$209,[hasNoInsurance.value?(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`perks-header`,{"no-insurance":hasNoInsurance.value}])},toDisplayString(hasNoInsurance.value?`Consequences`:`Included Benefits`),3)):createCommentVNode(``,!0),createVNode(unref(insurancePerks_default),{insuranceData:__props.insuranceData},null,8,[`insuranceData`])]),_cache[14]||=createBaseVNode(`div`,{class:`separator`},null,-1),hasNoInsurance.value&&__props.insuranceData.leavingInsuranceInfo&&!__props.isCurrentProvider?(openBlock(),createElementBlock(`div`,_hoisted_3$183,[_cache[4]||=createBaseVNode(`div`,{class:`leaving-insurance-title`},`Cancellation Refund`,-1),createBaseVNode(`div`,_hoisted_4$156,[createBaseVNode(`div`,_hoisted_5$136,[createBaseVNode(`span`,null,` Unused coverage (`+toDisplayString(leavingInsuranceRenewsInFormatted.value)+`) `,1),createBaseVNode(`span`,_hoisted_6$117,[_cache[0]||=createTextVNode(` + `,-1),createVNode(unref(bngUnit_default),{money:__props.insuranceData.leavingInsuranceInfo.coverageRefundPrice},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_7$104,[_cache[2]||=createBaseVNode(`span`,null,` Early Cancellation Fee (25%) `,-1),createBaseVNode(`span`,_hoisted_8$88,[_cache[1]||=createTextVNode(` - `,-1),createVNode(unref(bngUnit_default),{money:__props.insuranceData.leavingInsuranceInfo.earlyTerminationPenalty},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_9$78,[_cache[3]||=createBaseVNode(`span`,{class:`breakdown-item-label-total`},` You'll receive `,-1),createBaseVNode(`span`,_hoisted_10$68,[createVNode(unref(bngUnit_default),{money:__props.insuranceData.leavingInsuranceInfo.netRefundPrice},null,8,[`money`])])])])])):createCommentVNode(``,!0),hasNoInsurance.value?(openBlock(),createElementBlock(`div`,_hoisted_11$61,[..._cache[5]||=[createBaseVNode(`span`,{class:`no-insurance-warning`},` You will pay full repair costs `,-1),createBaseVNode(`span`,null,` No coverage or benefits included `,-1)]])):createCommentVNode(``,!0),!hasNoInsurance.value&&__props.insuranceData.groupDiscountData?.mainText?(openBlock(),createElementBlock(`div`,_hoisted_12$50,[createBaseVNode(`div`,null,[createBaseVNode(`span`,_hoisted_13$43,[createVNode(unref(bngIcon_default),{type:unref(icons).checkmark},null,8,[`type`])]),createBaseVNode(`span`,_hoisted_14$40,toDisplayString(__props.insuranceData.groupDiscountData?.mainText),1)]),createBaseVNode(`div`,null,[_cache[7]||=createBaseVNode(`span`,{class:`grey-small-text`},` Currently Insured : `,-1),createBaseVNode(`span`,null,[createVNode(unref(bngIcon_default),{class:`vehicles-icon`,type:unref(icons).car},null,8,[`type`])]),createBaseVNode(`span`,_hoisted_15$38,toDisplayString(__props.insuranceData.carsInsuredCount),1),__props.insuranceData.groupDiscountData?.currentTierData?.id>0?(openBlock(),createElementBlock(Fragment,{key:0},[_cache[6]||=createBaseVNode(`span`,{class:`vertical-separator`},` | `,-1),createBaseVNode(`span`,_hoisted_16$37,` Tier `+toDisplayString(__props.insuranceData.groupDiscountData?.currentTierData?.id),1),createBaseVNode(`span`,_hoisted_17$31,` - `+toDisplayString(__props.insuranceData.groupDiscountData?.currentTierData?.discount*100)+`% off `,1)],64)):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_18$28,toDisplayString(__props.insuranceData.groupDiscountData?.secondaryText),1)])):createCommentVNode(``,!0),hasNoInsurance.value?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_19$24,[createBaseVNode(`div`,_hoisted_20$20,[_cache[9]||=createBaseVNode(`span`,{class:`price-tile-title`},`Deductible`,-1),__props.insuranceData.baseDeductibledData?.oldPrice?(openBlock(),createElementBlock(`div`,_hoisted_21$18,[createBaseVNode(`div`,_hoisted_22$16,[createVNode(unref(bngUnit_default),{money:__props.insuranceData.baseDeductibledData.oldPrice},null,8,[`money`]),_cache[8]||=createBaseVNode(`div`,{class:`strike`},null,-1)])])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_23$15,[createVNode(unref(bngUnit_default),{money:__props.insuranceData.baseDeductibledData.price,class:normalizeClass(__props.insuranceData.baseDeductibledData.oldPrice?`green-price`:`orange-price`)},null,8,[`money`,`class`])]),_cache[10]||=createBaseVNode(`div`,{class:`deductible-tips`},[createBaseVNode(`div`,null,` - You pay your deductible for each crash repair `),createBaseVNode(`div`,null,` - Customize this value after purchase `)],-1),__props.insuranceData.baseDeductibledData.perkData?(openBlock(),createElementBlock(`div`,_hoisted_24$14,toDisplayString(__props.insuranceData.baseDeductibledData.perkData.discount*100)+`% discount applied `,1)):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_25$13,[createBaseVNode(`span`,_hoisted_26$11,toDisplayString(__props.insuranceData.amountDue>0?`Amount Due`:`Credit Received`),1),createBaseVNode(`div`,_hoisted_27$11,[createVNode(unref(bngUnit_default),{money:Math.abs(__props.insuranceData.amountDue),class:`green-price`},null,8,[`money`])]),createBaseVNode(`div`,_hoisted_28$10,[createBaseVNode(`div`,null,[_cache[11]||=createTextVNode(` Total policy : `,-1),createVNode(unref(bngUnit_default),{money:__props.insuranceData.futurePremiumDetails.totalPriceWithDriverScore},null,8,[`money`])]),createBaseVNode(`div`,null,[_cache[12]||=createBaseVNode(`span`,null,`Renews in : `,-1),createBaseVNode(`span`,_hoisted_29$10,toDisplayString(renewsInFormatted.value),1)])])])]))]),createBaseVNode(`div`,{class:normalizeClass([`background`,{"no-insurance":hasNoInsurance.value}])},null,2)],6))}},insuranceCard_default=__plugin_vue_export_helper_default(_sfc_main$282,[[`__scopeId`,`data-v-e481fbef`]]),_hoisted_1$251={class:`premium-wrapper`},_hoisted_2$208={class:`breakdown-item`},_hoisted_3$182={class:`breakdown-item-value`},_hoisted_4$155={class:`premium-value-wrapper`},_hoisted_5$135={class:`breakdown-item`},_hoisted_6$116={class:`breakdown-item-value`},_hoisted_7$103={class:`breakdown-item`},_hoisted_8$87={class:`breakdown-item-value`},_hoisted_9$77={class:`breakdown-item`},_hoisted_10$67={class:`breakdown-item-value orange-text`},_hoisted_11$60={class:`perks`},_hoisted_12$49={key:0,class:`grey-text`},_hoisted_13$42={key:1,class:`grey-text`},_hoisted_14$39={class:`group-discount-savings`},_hoisted_15$37={class:`breakdown-item`},_hoisted_16$36={key:0,class:`grey-text`},_hoisted_17$30={key:1,class:`grey-text`},_hoisted_18$27={class:`buttons`},_sfc_main$281={__name:`smallInsuranceCard`,props:{insuranceData:{type:Object,required:!0},driverScoreData:{type:Object,required:!0}},setup(__props){let{units}=useBridge(),props=__props,renewsEveryFormatted=computed(()=>units.buildString(`length`,props.insuranceData.renewsEvery*1e3,0)),renewsInFormatted=computed(()=>units.buildString(`length`,props.insuranceData.renewsIn*1e3,0)),buttonsDisabled=computed(()=>props.insuranceData.carsInsuredCount===0),openVehicleList=()=>{addPopup(vehicleInsuranceList_default,{insuranceData:props.insuranceData,driverScoreData:props.driverScoreData})},openEditPolicy=()=>{addPopup(editPolicy_default,{insuranceData:props.insuranceData,driverScoreData:props.driverScoreData})},tierToDisplay=computed(()=>props.insuranceData.groupDiscountData.currentTierData.id>0?props.insuranceData.groupDiscountData.currentTierData:props.insuranceData.groupDiscountData.groupDiscountTiers[0]);return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`small-insurance-card`,{"no-vehicles":buttonsDisabled.value}]),style:normalizeStyle({"border-top":`0.7rem solid ${props.insuranceData.color}`,background:`linear-gradient(180deg, ${props.insuranceData.color}80 0%, ${props.insuranceData.color}30 10%, ${props.insuranceData.color}10 35%, var(--bng-cool-gray-800) 50%, var(--blue-shade-100) 100%)`})},[createVNode(unref(insuranceIdentity_default),{class:`insurance-identity`,insuranceData:props.insuranceData},null,8,[`insuranceData`]),createBaseVNode(`div`,_hoisted_1$251,[createBaseVNode(`div`,_hoisted_2$208,[createBaseVNode(`span`,null,`Premium / `+toDisplayString(renewsEveryFormatted.value),1),createBaseVNode(`span`,_hoisted_3$182,[createBaseVNode(`div`,_hoisted_4$155,[createVNode(unref(bngUnit_default),{money:props.insuranceData.currentPremiumDetails.totalPriceWithDriverScore},null,8,[`money`])])])]),createBaseVNode(`div`,_hoisted_5$135,[_cache[0]||=createBaseVNode(`span`,null,`Renews in `,-1),createBaseVNode(`span`,_hoisted_6$116,[props.insuranceData.carsInsuredCount===0?(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(` - `)],64)):(openBlock(),createElementBlock(Fragment,{key:1},[createTextVNode(toDisplayString(renewsInFormatted.value),1)],64))])]),createBaseVNode(`div`,_hoisted_7$103,[_cache[1]||=createBaseVNode(`span`,null,`Vehicle Coverage`,-1),createBaseVNode(`span`,_hoisted_8$87,[createVNode(unref(bngUnit_default),{money:props.insuranceData.totalInsuranceVehsValue},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_9$77,[_cache[2]||=createBaseVNode(`span`,null,`Vehicles`,-1),createBaseVNode(`span`,_hoisted_10$67,toDisplayString(props.insuranceData.carsInsuredCount),1)])]),createBaseVNode(`div`,_hoisted_11$60,[createVNode(unref(insurancePerks_default),{insuranceData:props.insuranceData,noDescription:!0},null,8,[`insuranceData`])]),createBaseVNode(`div`,{class:normalizeClass([`group-discount-wrapper`,{disabled:props.insuranceData.groupDiscountData.currentTierData.id===-1}])},[props.insuranceData.carsInsuredCount===0?(openBlock(),createElementBlock(`div`,_hoisted_12$49,` No vehicles insured under this policy `)):props.insuranceData.carsInsuredCount===1?(openBlock(),createElementBlock(`div`,_hoisted_13$42,` Add a second vehicle to unlock Tier 1 (`+toDisplayString(props.insuranceData.groupDiscountData.groupDiscountTiers[0].discount*100)+`%) coverage savings. `,1)):(openBlock(),createElementBlock(Fragment,{key:2},[_cache[4]||=createBaseVNode(`div`,{class:`group-discount`},` MULTI-VEHICLE DISCOUNT `,-1),createBaseVNode(`div`,_hoisted_14$39,[_cache[3]||=createTextVNode(` Savings :`,-1),createVNode(unref(bngUnit_default),{money:props.insuranceData.currentPremiumDetails.groupDiscountSavings},null,8,[`money`])]),createBaseVNode(`div`,_hoisted_15$37,[tierToDisplay.value.max?(openBlock(),createElementBlock(`span`,_hoisted_16$36,` Your coverage falls in the `+toDisplayString(tierToDisplay.value.min/1e3)+`k - `+toDisplayString(tierToDisplay.value.max/1e3)+`k range `,1)):(openBlock(),createElementBlock(`span`,_hoisted_17$30,` Your coverage falls in the `+toDisplayString(tierToDisplay.value.min/1e3)+`k+ range `,1))]),createBaseVNode(`div`,null,[createVNode(unref(insuranceTiers_default),{showTier:!0,tiers:props.insuranceData.groupDiscountData.groupDiscountTiers},null,8,[`tiers`])])],64))],2),createBaseVNode(`div`,_hoisted_18$27,[createVNode(unref(bngButton_default),{class:`edit-policy-button bigger-button`,accent:`custom`,onClick:openEditPolicy,disabled:buttonsDisabled.value},{default:withCtx(()=>[createVNode(unref(bngIcon_default),{class:normalizeClass([`button-icon`,{disabled:buttonsDisabled.value}]),type:unref(icons).adjust},null,8,[`type`,`class`]),createBaseVNode(`span`,{class:normalizeClass([`button-text`,{disabled:buttonsDisabled.value}])},`Edit Policy`,2)]),_:1},8,[`disabled`]),createVNode(unref(bngButton_default),{class:`see-vehicles-button bigger-button`,accent:`custom`,onClick:openVehicleList,disabled:buttonsDisabled.value},{default:withCtx(()=>[createVNode(unref(bngIcon_default),{class:normalizeClass([`button-icon`,{disabled:buttonsDisabled.value}]),type:unref(icons).car},null,8,[`type`,`class`]),createBaseVNode(`span`,{class:normalizeClass([`button-text`,{disabled:buttonsDisabled.value}])},`See Vehicles`,2)]),_:1},8,[`disabled`])])],6))}},smallInsuranceCard_default=__plugin_vue_export_helper_default(_sfc_main$281,[[`__scopeId`,`data-v-38392c0c`]]),_hoisted_1$250={class:`insurance-details-wrapper`,"bng-ui-scope":`insuranceDetailsPopup`},_hoisted_2$207={class:`card-content`},_hoisted_3$181={class:`header`},_hoisted_4$154={class:`header-left`},_hoisted_5$134={class:`insurance-identity`},_hoisted_6$115={class:`insurance-name`},_hoisted_7$102={class:`insurance-slogan`},_hoisted_8$86={class:`covers-renew-info`},_hoisted_9$76={class:`header-right`},_hoisted_10$66={class:`vehicle-name`},_hoisted_11$59={class:`vehicle-value blue-price`},_hoisted_12$48={key:0,class:`group-discount-wrapper`},_hoisted_13$41={class:`group-discount-header`},_hoisted_14$38={class:`group-discount-icon-wrapper`},_hoisted_15$36={class:`group-discount-text-wrapper`},_hoisted_16$35={class:`group-discount-main-text`},_hoisted_17$29={class:`tiers-wrapper`},_hoisted_18$26={class:`textual-tiers-wrapper`},_hoisted_19$23={class:`tier-number`},_hoisted_20$19={class:`money-bracket`},_hoisted_21$17={key:0},_hoisted_22$15={key:1},_hoisted_23$14={class:`current-after-discount-price`},_hoisted_24$13={class:`tier-discount-price`},_hoisted_25$12={class:`policy-value`},_hoisted_26$10={class:`policy-tier`},_hoisted_27$10={class:`tier-discount-price isFutureTier`},_hoisted_28$9={class:`policy-value`},_hoisted_29$9={class:`policy-tier isFuture`},_hoisted_30$9={class:`price-breakdown-wrapper`},_hoisted_31$9={class:`prices-breakdown-header`},_hoisted_32$9={class:`breakdown-item`},_hoisted_33$9={class:`breakdown-details`},_hoisted_34$9={class:`breakdown-item-value`},_hoisted_35$8={class:`breakdown-value`},_hoisted_36$8={class:`breakdown-item-value orange`},_hoisted_37$7={class:`breakdown-value`},_hoisted_38$6={key:0,class:`breakdown-item-value orange`},_hoisted_39$6={class:`breakdown-label`},_hoisted_40$5={class:`breakdown-value`},_hoisted_41$5={class:`breakdown-item-value result`},_hoisted_42$4={class:`breakdown-value result`},_hoisted_43$4={class:`breakdown-item`},_hoisted_44$4={class:`breakdown-details`},_hoisted_45$4={key:0,class:`breakdown-item-value`},_hoisted_46$2={key:0,class:`strikethrough-line`},_hoisted_47$2={key:1,class:`breakdown-item-value`},_hoisted_48$2={class:`breakdown-label`},_hoisted_49$2={class:`tier-discount-badge`},_hoisted_50$2={class:`breakdown-value green-price`},_hoisted_51$2={key:0,class:`breakdown-item-value`},_hoisted_52$2={class:`breakdown-label`},_hoisted_53$2={class:`breakdown-value`},_hoisted_54$2={class:`breakdown-item-value subtotal`},_hoisted_55$2={class:`breakdown-value`},_hoisted_56$2={class:`breakdown-item-value`},_hoisted_57$1={class:`breakdown-item-value result`},_hoisted_58$1={class:`breakdown-value`},_hoisted_59$1={class:`sum-to-pay`},_hoisted_60$1={class:`sum-to-pay-value`},_hoisted_61$1={class:`closeButton`},__default__$5={wrapper:{fade:!0,blur:!0,style:popupContainer.default},position:[popupPosition.center,popupPosition.center]},_sfc_main$280=Object.assign(__default__$5,{__name:`purchaseInsuranceDetails`,props:{insuranceData:Object,vehicleInfo:Object,driverScoreData:Object},emits:[`return`],setup(__props,{emit:__emit}){let{units}=useBridge();useUINavScope(`insuranceDetailsPopup`);let props=__props,emit$1=__emit,closePopup=()=>{emit$1(`return`,!0)},driverScoreAdjustmentText=computed(()=>{let multiplier=props.driverScoreData.tier.multiplier;return multiplier<1?`↓${((1-multiplier)*100).toFixed(0)}%`:multiplier>1?`↑${((multiplier-1)*100).toFixed(0)}%`:`0%`}),driverScoreClass=computed(()=>{let multiplier=props.driverScoreData.tier.multiplier;return multiplier<1?`driver-score-discount`:multiplier>1?`driver-score-penalty`:``}),groupDiscountText=computed(()=>{if(props.insuranceData.groupDiscountData){if(props.insuranceData.groupDiscountData.willHaveGroupDiscountForTheFirstTime)return`Multi-vehicle discount available`;if(props.insuranceData.groupDiscountData.willBumpTheirDiscount)return`Bigger discount available`;if(props.insuranceData.groupDiscountData.currentTierData&&props.insuranceData.groupDiscountData.currentTierData.id>0)return`Multi-vehicle discount active`}return null}),renewsEveryFormatted=computed(()=>props.insuranceData?.renewsEvery?units.buildString(`length`,props.insuranceData.renewsEvery*1e3,0):``);return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$250,[createBaseVNode(`div`,_hoisted_2$207,[createBaseVNode(`div`,_hoisted_3$181,[createBaseVNode(`div`,_hoisted_4$154,[_cache[2]||=createBaseVNode(`div`,{class:`policy-details`},` Policy details `,-1),createBaseVNode(`div`,_hoisted_5$134,[createBaseVNode(`span`,_hoisted_6$115,toDisplayString(props.insuranceData.name),1),_cache[0]||=createBaseVNode(`span`,{class:`name-slogan-seperator`},null,-1),createBaseVNode(`span`,_hoisted_7$102,toDisplayString(props.insuranceData.slogan),1)]),createBaseVNode(`div`,_hoisted_8$86,[createBaseVNode(`span`,null,`Covers `+toDisplayString(props.insuranceData.carsInsuredCount)+` Vehicles`,1),_cache[1]||=createBaseVNode(`span`,{class:`covers-renew-seperator`},null,-1),createBaseVNode(`span`,null,`Renews every `+toDisplayString(renewsEveryFormatted.value),1)])]),createBaseVNode(`div`,_hoisted_9$76,[_cache[4]||=createBaseVNode(`div`,{class:`action-type`},`Adding vehicle`,-1),createBaseVNode(`div`,_hoisted_10$66,toDisplayString(props.vehicleInfo.Name),1),createBaseVNode(`div`,_hoisted_11$59,[_cache[3]||=createTextVNode(`Value : `,-1),createVNode(unref(bngUnit_default),{money:props.vehicleInfo.Value},null,8,[`money`])])])]),props.insuranceData.groupDiscountData.willHaveGroupDiscountForTheFirstTime||props.insuranceData.groupDiscountData.willBumpTheirDiscount||props.insuranceData.groupDiscountData.currentTierData.id>0?(openBlock(),createElementBlock(`div`,_hoisted_12$48,[createBaseVNode(`div`,_hoisted_13$41,[createBaseVNode(`div`,_hoisted_14$38,[createVNode(unref(bngIcon_default),{type:unref(icons).checkmark},null,8,[`type`])]),createBaseVNode(`div`,_hoisted_15$36,[createBaseVNode(`div`,_hoisted_16$35,toDisplayString(groupDiscountText.value),1),_cache[5]||=createBaseVNode(`div`,{class:`group-discount-secondary-text`},` Insurance discounts are based on the total value of your fleet. `,-1)])]),createBaseVNode(`div`,_hoisted_17$29,[createBaseVNode(`div`,_hoisted_18$26,[(openBlock(!0),createElementBlock(Fragment,null,renderList(props.insuranceData.groupDiscountData.groupDiscountTiers,tier=>(openBlock(),createElementBlock(`div`,{class:`tier`,key:tier.id},[createBaseVNode(`div`,_hoisted_19$23,` Tier `+toDisplayString(tier.id),1),createBaseVNode(`div`,_hoisted_20$19,[createBaseVNode(`span`,null,toDisplayString(tier.min/1e3)+`k`,1),tier.max?(openBlock(),createElementBlock(`span`,_hoisted_21$17,`-`+toDisplayString(tier.max/1e3)+`k`,1)):(openBlock(),createElementBlock(`span`,_hoisted_22$15,`+`))])]))),128))]),createVNode(unref(insuranceTiers_default),{tiers:props.insuranceData.groupDiscountData.groupDiscountTiers},null,8,[`tiers`])]),createBaseVNode(`div`,_hoisted_23$14,[createBaseVNode(`div`,_hoisted_24$13,[_cache[7]||=createBaseVNode(`div`,{class:`section-label deactivated`},` Current Tier `,-1),createBaseVNode(`div`,_hoisted_25$12,[_cache[6]||=createTextVNode(` Policy Value : `,-1),createVNode(unref(bngUnit_default),{money:props.insuranceData.totalInsuranceVehsValue},null,8,[`money`])]),createBaseVNode(`div`,_hoisted_26$10,` Tier `+toDisplayString(Math.max(props.insuranceData.groupDiscountData.currentTierData.id,0))+` - `+toDisplayString(props.insuranceData.groupDiscountData.currentTierData.discount*100)+`% off `,1)]),createBaseVNode(`div`,_hoisted_27$10,[_cache[9]||=createBaseVNode(`div`,{class:`section-label`},` After Purchase `,-1),createBaseVNode(`div`,_hoisted_28$9,[_cache[8]||=createTextVNode(` Policy Value : `,-1),createVNode(unref(bngUnit_default),{money:props.insuranceData.totalInsuranceVehsValue+props.insuranceData.vehicleValue},null,8,[`money`])]),createBaseVNode(`div`,_hoisted_29$9,` Tier `+toDisplayString(props.insuranceData.groupDiscountData.futureTierData.id)+` - `+toDisplayString(props.insuranceData.groupDiscountData.futureTierData.discount*100)+`% off `,1)])])])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_30$9,[createBaseVNode(`div`,_hoisted_31$9,[createBaseVNode(`div`,_hoisted_32$9,[_cache[13]||=createBaseVNode(`div`,{class:`section-label`},` Vehicle `,-1),createBaseVNode(`div`,_hoisted_33$9,[createBaseVNode(`div`,_hoisted_34$9,[_cache[10]||=createBaseVNode(`span`,{class:`breakdown-label`},` Coverage Cost `,-1),createBaseVNode(`span`,_hoisted_35$8,[createVNode(unref(bngUnit_default),{money:props.insuranceData.nonProRatedVehiclePremium},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_36$8,[_cache[11]||=createBaseVNode(`span`,{class:`breakdown-label`},` Pro-rated Renewal `,-1),createBaseVNode(`span`,_hoisted_37$7,` × `+toDisplayString(props.insuranceData.proRatedPercentage)+`% `,1)]),props.insuranceData.groupDiscountData?.currentTierData.id>0?(openBlock(),createElementBlock(`div`,_hoisted_38$6,[createBaseVNode(`span`,_hoisted_39$6,` Tier `+toDisplayString(props.insuranceData.groupDiscountData?.currentTierData.id)+` discount `,1),createBaseVNode(`span`,_hoisted_40$5,` - `+toDisplayString(props.insuranceData.groupDiscountData?.currentTierData.discount*100)+`% `,1)])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_41$5,[_cache[12]||=createBaseVNode(`span`,{class:`breakdown-label`},` Policy Add-On Cost `,-1),createBaseVNode(`span`,_hoisted_42$4,[createVNode(unref(bngUnit_default),{money:props.insuranceData.proRatedVehiclePremium},null,8,[`money`])])])])]),createBaseVNode(`div`,_hoisted_43$4,[_cache[18]||=createBaseVNode(`div`,{class:`section-label`},` New Premium `,-1),createBaseVNode(`div`,_hoisted_44$4,[props.insuranceData.futurePremiumDetails.items.vehsCoverage?(openBlock(),createElementBlock(`div`,_hoisted_45$4,[_cache[14]||=createBaseVNode(`div`,{class:`breakdown-label`},` Vehicles Coverage `,-1),createBaseVNode(`div`,{class:normalizeClass([`breakdown-value strikethrough-container`,{"strikethrough-grey":props.insuranceData.futurePremiumDetails.groupDiscountSavings>0}])},[createVNode(unref(bngUnit_default),{money:props.insuranceData.futurePremiumDetails.items.vehsCoverage.priceWithoutGroupDiscount},null,8,[`money`]),props.insuranceData.futurePremiumDetails.groupDiscountSavings>0?(openBlock(),createElementBlock(`div`,_hoisted_46$2)):createCommentVNode(``,!0)],2)])):createCommentVNode(``,!0),props.insuranceData.futurePremiumDetails.items.vehsCoverage&&props.insuranceData.futurePremiumDetails.groupDiscountSavings>0?(openBlock(),createElementBlock(`div`,_hoisted_47$2,[createBaseVNode(`div`,_hoisted_48$2,[createTextVNode(toDisplayString(props.insuranceData.futurePremiumDetails.items.vehsCoverage.name)+` `,1),createBaseVNode(`span`,null,[createTextVNode(`: Tier `+toDisplayString(props.insuranceData.groupDiscountData.currentTierData.id)+` `,1),createBaseVNode(`span`,_hoisted_49$2,`(`+toDisplayString(props.insuranceData.groupDiscountData.currentTierData.discount*100)+`% off)`,1)])]),createBaseVNode(`div`,_hoisted_50$2,[createVNode(unref(bngUnit_default),{money:props.insuranceData.futurePremiumDetails.items.vehsCoverage.price},null,8,[`money`])])])):createCommentVNode(``,!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(props.insuranceData.futurePremiumDetails.items,(item,key)=>(openBlock(),createElementBlock(Fragment,{key},[key===`vehsCoverage`?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_51$2,[createBaseVNode(`div`,_hoisted_52$2,toDisplayString(item.name),1),createBaseVNode(`div`,_hoisted_53$2,[createVNode(unref(bngUnit_default),{money:item.price},null,8,[`money`])])]))],64))),128)),createBaseVNode(`div`,_hoisted_54$2,[_cache[15]||=createBaseVNode(`div`,{class:`breakdown-label`},` Subtotal `,-1),createBaseVNode(`div`,_hoisted_55$2,[createVNode(unref(bngUnit_default),{money:props.insuranceData.futurePremiumDetails.totalPrice},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_56$2,[_cache[16]||=createBaseVNode(`div`,{class:`breakdown-label`},` Driver Score Adjustment `,-1),createBaseVNode(`div`,{class:normalizeClass([`breakdown-value`,driverScoreClass.value])},toDisplayString(driverScoreAdjustmentText.value),3)]),createBaseVNode(`div`,_hoisted_57$1,[_cache[17]||=createBaseVNode(`div`,{class:`breakdown-label`},` Total Premium `,-1),createBaseVNode(`div`,_hoisted_58$1,[createVNode(unref(bngUnit_default),{money:props.insuranceData.futurePremiumDetails.totalPriceWithDriverScore},null,8,[`money`])])])])])]),createBaseVNode(`div`,_hoisted_59$1,[_cache[19]||=createBaseVNode(`span`,null,`Amount due today`,-1),createBaseVNode(`span`,_hoisted_60$1,[createVNode(unref(bngUnit_default),{class:`green-price`,money:props.insuranceData.addVehiclePrice},null,8,[`money`])])])]),createBaseVNode(`div`,_hoisted_61$1,[createVNode(unref(bngButton_default),{accent:unref(ACCENTS).primary,onClick:closePopup},{default:withCtx(()=>[..._cache[20]||=[createTextVNode(` Close `,-1)]]),_:1},8,[`accent`])])])]))}}),purchaseInsuranceDetails_default=__plugin_vue_export_helper_default(_sfc_main$280,[[`__scopeId`,`data-v-9f20c127`]]),_hoisted_1$249={class:`content`},_hoisted_2$206={class:`top-banner`},_hoisted_3$180={class:`top-banner-left`},_hoisted_4$153={class:`insurance-details`},_hoisted_5$133={class:`insurance-name`},_hoisted_6$114={class:`insurance-slogan`},_hoisted_7$101={class:`small-grey-text`},_hoisted_8$85={class:`small-grey-text`},_hoisted_9$75={class:`top-banner-right`},_hoisted_10$65={class:`information-wrapper`},_hoisted_11$58={class:`information-value`},_hoisted_12$47={class:`driver-score-tier`},_hoisted_13$40={class:`premium-effect`},_hoisted_14$37={class:`switching-details-wrapper`},_hoisted_15$35={class:`three-columns-grid`},_hoisted_16$34={class:`switching-column column-leaving`},_hoisted_17$28={class:`column-header`},_hoisted_18$25={class:`column-details`},_hoisted_19$22={class:`detail-item`},_hoisted_20$18={class:`detail-value`},_hoisted_21$16={class:`detail-item`},_hoisted_22$14={class:`detail-item divider-above`},_hoisted_23$13={class:`detail-value-positive`},_hoisted_24$12={class:`detail-item`},_hoisted_25$11={class:`detail-value-negative`},_hoisted_26$9={class:`detail-item divider-above`},_hoisted_27$9={class:`detail-value-positive-bold`},_hoisted_28$8={class:`detail-note`},_hoisted_29$8={class:`switching-column column-vehicle`},_hoisted_30$8={class:`vehicle-display-box`},_hoisted_31$8=[`src`],_hoisted_32$8={class:`column-details`},_hoisted_33$8={class:`detail-item`},_hoisted_34$8={class:`detail-value-bold`},_hoisted_35$7={class:`detail-item`},_hoisted_36$7={class:`detail-value-bold`},_hoisted_37$6={class:`detail-item divider-above`},_hoisted_38$5={class:`detail-value-highlight`},_hoisted_39$5={class:`detail-note`},_hoisted_40$4={class:`switching-column column-joining`},_hoisted_41$4={class:`column-header`},_hoisted_42$3={class:`column-details`},_hoisted_43$3={class:`detail-item`},_hoisted_44$3={class:`detail-value`},_hoisted_45$3={class:`detail-item`},_hoisted_46$1={class:`detail-item divider-above`},_hoisted_47$1={class:`detail-value-negative`},_hoisted_48$1={class:`detail-item divider-above`},_hoisted_49$1={class:`detail-item divider-above`},_hoisted_50$1={class:`detail-value-bold`},_hoisted_51$1={class:`detail-note`},_hoisted_52$1={class:`final-amount-content-row`},_hoisted_53$1={class:`final-amount-label`},_hoisted_54$1={class:`final-amount-breakdown`},_hoisted_55$1={class:`buttons`},_hoisted_56$1={key:0},_sfc_main$279={__name:`changeInsuranceDetails`,props:{insuranceData:{type:Object,required:!0},vehicleInfo:{type:Object,default:()=>({})},driverScoreData:{type:Object,default:()=>({})}},emits:[`return`,`switch`],setup(__props,{emit:__emit}){let{units}=useBridge(),props=__props,emit$1=__emit,premiumSavingPercent=computed(()=>(1-(props.driverScoreData?.tier?.multiplier||1))*100),leavingInfo=computed(()=>props.insuranceData.leavingInsuranceInfo||null),leavingInsuranceName=computed(()=>leavingInfo.value?.currentInsuranceName||`Current Insurance`),tierDropped=computed(()=>leavingInfo.value?leavingInfo.value.discountTierData?.id>leavingInfo.value.newDiscountTierData?.id:!1),tierIncreased=computed(()=>{let current=props.insuranceData.groupDiscountData?.currentTierData?.id||0;return(props.insuranceData.groupDiscountData?.futureTierData?.id||current)>current}),currentTierId=computed(()=>props.insuranceData.groupDiscountData?.currentTierData?.id||0),futureTierId=computed(()=>props.insuranceData.groupDiscountData?.futureTierData?.id||props.insuranceData.groupDiscountData?.currentTierData?.id||0),proRatedPercentage=computed(()=>Math.round(props.insuranceData.proRatedPercentage||100)),driverScoreImpactPercent=computed(()=>(1-(props.driverScoreData?.tier?.multiplier||1))*100),driverScoreImpactClass=computed(()=>driverScoreImpactPercent.value>0?`saving`:driverScoreImpactPercent.value<0?`increase`:`neutral`),driverScoreImpactText=computed(()=>driverScoreImpactPercent.value>0?`↓${driverScoreImpactPercent.value.toFixed(0)}%`:driverScoreImpactPercent.value<0?`↑${Math.abs(driverScoreImpactPercent.value).toFixed(0)}%`:`0%`),renewsEveryFormatted=computed(()=>props.insuranceData?.renewsEvery?units.buildString(`length`,props.insuranceData.renewsEvery*1e3,0):``),renewsInFormatted=computed(()=>props.insuranceData?.renewsIn?units.buildString(`length`,props.insuranceData.renewsIn*1e3,0):``),leavingRenewsInFormatted=computed(()=>leavingInfo.value?.renewsIn?units.buildString(`length`,leavingInfo.value.renewsIn*1e3,0):``),closePopup=()=>{emit$1(`return`,!0)},onSwitchClick=()=>{Lua_default.career_modules_insurance_insurance.changeInvVehInsurance(props.vehicleInfo.invVehId,props.insuranceData.id),emit$1(`return`,!0)};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$249,[createBaseVNode(`div`,_hoisted_2$206,[createBaseVNode(`div`,_hoisted_3$180,[_cache[2]||=createBaseVNode(`div`,{class:`title`},` Change Insurance `,-1),createBaseVNode(`div`,_hoisted_4$153,[createBaseVNode(`span`,_hoisted_5$133,toDisplayString(props.insuranceData.name),1),_cache[0]||=createBaseVNode(`span`,{class:`name-slogan-seperator`},null,-1),createBaseVNode(`span`,_hoisted_6$114,` "`+toDisplayString(props.insuranceData.slogan)+`" `,1)]),createBaseVNode(`div`,null,[createBaseVNode(`span`,_hoisted_7$101,` Covers `+toDisplayString(props.insuranceData.carsInsuredCount)+` Vehicles `,1),_cache[1]||=createBaseVNode(`span`,{class:`dot-seperator`},null,-1),createBaseVNode(`span`,_hoisted_8$85,` Renews every `+toDisplayString(renewsEveryFormatted.value),1)])]),createBaseVNode(`div`,_hoisted_9$75,[createBaseVNode(`div`,_hoisted_10$65,[_cache[4]||=createBaseVNode(`div`,{class:`small-grey-text`},` Driver Score `,-1),createBaseVNode(`div`,_hoisted_11$58,toDisplayString(props.driverScoreData.score)+`: `+toDisplayString(props.driverScoreData.tier.risk),1),createBaseVNode(`div`,_hoisted_12$47,toDisplayString(props.driverScoreData.tier.name),1),createBaseVNode(`div`,_hoisted_13$40,[_cache[3]||=createBaseVNode(`span`,{class:`small-grey-text`},` Premium Effect : `,-1),createBaseVNode(`span`,{class:normalizeClass([`premium-effect-value`,{saving:premiumSavingPercent.value>0,increase:premiumSavingPercent.value<0}])},toDisplayString(premiumSavingPercent.value>0?`${premiumSavingPercent.value.toFixed(0)}% saving`:premiumSavingPercent.value<0?`${Math.abs(premiumSavingPercent.value).toFixed(0)}% increase`:`No change`),3)])])])]),createBaseVNode(`div`,_hoisted_14$37,[createBaseVNode(`div`,_hoisted_15$35,[createBaseVNode(`div`,_hoisted_16$34,[createBaseVNode(`div`,_hoisted_17$28,[_cache[5]||=createBaseVNode(`span`,null,`←`,-1),createTextVNode(` Leaving `+toDisplayString(leavingInsuranceName.value),1)]),createBaseVNode(`div`,_hoisted_18$25,[createBaseVNode(`div`,_hoisted_19$22,[_cache[6]||=createBaseVNode(`span`,{class:`detail-label`},`Vehicles:`,-1),createBaseVNode(`span`,_hoisted_20$18,toDisplayString(leavingInfo.value.vehicleCount)+` → `+toDisplayString(leavingInfo.value.newVehicleCount),1)]),createBaseVNode(`div`,_hoisted_21$16,[_cache[7]||=createBaseVNode(`span`,{class:`detail-label`},`Discount Tier:`,-1),createBaseVNode(`span`,{class:normalizeClass([`detail-value`,{"tier-change-down":tierDropped.value}])},toDisplayString(leavingInfo.value.discountTierData.id)+` → `+toDisplayString(leavingInfo.value.newDiscountTierData.id),3)]),createBaseVNode(`div`,_hoisted_22$14,[_cache[9]||=createBaseVNode(`span`,{class:`detail-label`},`Coverage refund:`,-1),createBaseVNode(`span`,_hoisted_23$13,[_cache[8]||=createTextVNode(`+`,-1),createVNode(unref(bngUnit_default),{money:leavingInfo.value.coverageRefundPrice},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_24$12,[_cache[11]||=createBaseVNode(`span`,{class:`detail-label`},`Cancellation fee (25%):`,-1),createBaseVNode(`span`,_hoisted_25$11,[_cache[10]||=createTextVNode(`-`,-1),createVNode(unref(bngUnit_default),{money:leavingInfo.value.earlyTerminationPenalty},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_26$9,[_cache[12]||=createBaseVNode(`span`,{class:`detail-label-bold`},`Net Refund:`,-1),createBaseVNode(`span`,_hoisted_27$9,[createVNode(unref(bngUnit_default),{money:leavingInfo.value.netRefundPrice},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_28$8,toDisplayString(leavingRenewsInFormatted.value)+` unused `,1)])]),createBaseVNode(`div`,_hoisted_29$8,[_cache[16]||=createBaseVNode(`div`,{class:`column-header column-header-center`},`Moving Vehicle`,-1),createBaseVNode(`div`,_hoisted_30$8,[createBaseVNode(`img`,{src:props.vehicleInfo?.thumbnail,alt:``,class:`vehicle-thumbnail`},null,8,_hoisted_31$8)]),createBaseVNode(`div`,_hoisted_32$8,[createBaseVNode(`div`,_hoisted_33$8,[_cache[13]||=createBaseVNode(`span`,{class:`detail-label`},`Vehicle:`,-1),createBaseVNode(`span`,_hoisted_34$8,toDisplayString(props.vehicleInfo.Name),1)]),createBaseVNode(`div`,_hoisted_35$7,[_cache[14]||=createBaseVNode(`span`,{class:`detail-label`},`Value:`,-1),createBaseVNode(`span`,_hoisted_36$7,[createVNode(unref(bngUnit_default),{money:props.vehicleInfo.Value},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_37$6,[_cache[15]||=createBaseVNode(`span`,{class:`detail-label`},`Joining mid-cycle:`,-1),createBaseVNode(`span`,_hoisted_38$5,`× `+toDisplayString(proRatedPercentage.value)+`%`,1)]),createBaseVNode(`div`,_hoisted_39$5,toDisplayString(renewsInFormatted.value)+` remaining in cycle `,1)])]),createBaseVNode(`div`,_hoisted_40$4,[createBaseVNode(`div`,_hoisted_41$4,[createTextVNode(` Joining `+toDisplayString(props.insuranceData.name)+` `,1),_cache[17]||=createBaseVNode(`span`,null,`→`,-1)]),createBaseVNode(`div`,_hoisted_42$3,[createBaseVNode(`div`,_hoisted_43$3,[_cache[18]||=createBaseVNode(`span`,{class:`detail-label`},`Vehicles:`,-1),createBaseVNode(`span`,_hoisted_44$3,toDisplayString(props.insuranceData.carsInsuredCount)+` → `+toDisplayString(props.insuranceData.carsInsuredCount+1),1)]),createBaseVNode(`div`,_hoisted_45$3,[_cache[19]||=createBaseVNode(`span`,{class:`detail-label`},`Discount Tier:`,-1),createBaseVNode(`span`,{class:normalizeClass([`detail-value`,{"tier-change-up":tierIncreased.value}])},toDisplayString(currentTierId.value)+` → `+toDisplayString(futureTierId.value),3)]),createBaseVNode(`div`,_hoisted_46$1,[_cache[21]||=createBaseVNode(`span`,{class:`detail-label`},`Add vehicle cost:`,-1),createBaseVNode(`span`,_hoisted_47$1,[_cache[20]||=createTextVNode(`+`,-1),createVNode(unref(bngUnit_default),{money:props.insuranceData.addVehiclePrice},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_48$1,[_cache[22]||=createBaseVNode(`span`,{class:`detail-label`},`Driver Score Impact:`,-1),createBaseVNode(`span`,{class:normalizeClass([`detail-value-impact`,driverScoreImpactClass.value])},toDisplayString(driverScoreImpactText.value),3)]),createBaseVNode(`div`,_hoisted_49$1,[_cache[23]||=createBaseVNode(`span`,{class:`detail-label-bold`},`New Policy Premium:`,-1),createBaseVNode(`span`,_hoisted_50$1,[createVNode(unref(bngUnit_default),{money:props.insuranceData.futurePremiumDetails.totalPriceWithDriverScore},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_51$1,toDisplayString(renewsInFormatted.value)+` until renewal `,1)])])]),createBaseVNode(`div`,{class:normalizeClass([`final-amount-box`,props.insuranceData.netSwitchingCost>0?`amount-credit`:`amount-payment`])},[createBaseVNode(`div`,_hoisted_52$1,[createBaseVNode(`div`,null,[createBaseVNode(`div`,_hoisted_53$1,toDisplayString(props.insuranceData.netSwitchingCost>0?`Credit Received Today`:`Amount Due Today`),1),createBaseVNode(`div`,_hoisted_54$1,[createVNode(unref(bngUnit_default),{money:leavingInfo.value.netRefundPrice},null,8,[`money`]),_cache[24]||=createTextVNode(` refund - `,-1),createVNode(unref(bngUnit_default),{money:props.insuranceData.addVehiclePrice},null,8,[`money`]),_cache[25]||=createTextVNode(` new cost `,-1)])]),createBaseVNode(`div`,{class:normalizeClass([`final-amount-total`,props.insuranceData.netSwitchingCost<0?`negative`:`positive`])},[createVNode(unref(bngUnit_default),{money:Math.abs(props.insuranceData.netSwitchingCost)},null,8,[`money`])],2)])],2)]),createBaseVNode(`div`,_hoisted_55$1,[createVNode(unref(bngButton_default),{class:`gray-button bigger-button`,accent:`custom`,onClick:closePopup},{default:withCtx(()=>[..._cache[26]||=[createTextVNode(` Cancel `,-1)]]),_:1}),createVNode(unref(bngButton_default),{class:`save-button bigger-button`,accent:`custom`,onClick:onSwitchClick},{default:withCtx(()=>[_cache[27]||=createTextVNode(` Switch for `,-1),props.insuranceData.netSwitchingCost<0?(openBlock(),createElementBlock(`div`,_hoisted_56$1,[createVNode(unref(bngUnit_default),{money:Math.abs(props.insuranceData.netSwitchingCost)},null,8,[`money`])])):createCommentVNode(``,!0)]),_:1})])]))}},changeInsuranceDetails_default=__plugin_vue_export_helper_default(_sfc_main$279,[[`__scopeId`,`data-v-9624a106`]]),_hoisted_1$248={class:`insurance-tiers`},_hoisted_2$205={key:0},_sfc_main$278={__name:`insuranceTiers`,props:{tiers:{type:Array,required:!0},showTier:{type:Boolean,default:!1}},setup(__props){let props=__props;return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$248,[(openBlock(!0),createElementBlock(Fragment,null,renderList(props.tiers,tier=>(openBlock(),createElementBlock(`div`,{class:`tier`,key:tier.id},[createBaseVNode(`div`,{class:normalizeClass([`tier-discount`,{isCurrent:tier.isCurrent}])},[props.showTier?(openBlock(),createElementBlock(`div`,_hoisted_2$205,` Tier `+toDisplayString(tier.id),1)):createCommentVNode(``,!0),createBaseVNode(`div`,null,toDisplayString(tier.discount*100)+`% `,1)],2)]))),128))]))}},insuranceTiers_default=__plugin_vue_export_helper_default(_sfc_main$278,[[`__scopeId`,`data-v-ccd1e875`]]),_hoisted_1$247={class:`popup-content`},_hoisted_2$204={class:`top-banner`},_hoisted_3$179={class:`top-info`},_hoisted_4$152={class:`top-info-title`},_hoisted_5$132={class:`top-info-policy-name`},_hoisted_6$113={class:`customize-coverage section`},_hoisted_7$100={class:`premium-details section`},_hoisted_8$84={class:`premium-details-content`},_hoisted_9$74={class:`premium-details-left`},_hoisted_10$64={class:`premium-details-label`},_hoisted_11$57={class:`premium-details-right`},_hoisted_12$46={key:0,class:`price-diff-container`},_hoisted_13$39={class:`premium-details-total premium-details-item`},_hoisted_14$36={class:`premium-details-left`},_hoisted_15$34={class:`driver-score-details-wrapper`},_hoisted_16$33={class:`driver-score-details`},_hoisted_17$27={class:`premium-details-right`},_hoisted_18$24={key:0,class:`price-diff-container`},_hoisted_19$21={class:`buttons`},_sfc_main$277={__name:`editPolicy`,props:{insuranceData:{type:Object,required:!0},driverScoreData:{type:Object,required:!0}},emits:[`return`],setup(__props,{emit:__emit}){let props=__props,changedCoverageOptions=ref({}),newPremiumDetails=ref({}),computedNewPremiumDiffs=computed(()=>{if(!newPremiumDetails.value?.items)return{};let diffs={};for(let key in newPremiumDetails.value.items){let newPrice=newPremiumDetails.value.items[key]?.price||0,oldPrice=props.insuranceData.currentPremiumDetails.items[key]?.price||0;diffs[key]={priceDiff:newPrice-oldPrice,newPrice,oldPrice}}return diffs}),computedTotalPriceDiff=computed(()=>newPremiumDetails.value?.totalPrice?newPremiumDetails.value.totalPrice-props.insuranceData.currentPremiumDetails.totalPrice:0),driverScoreColorClass=computed(()=>{let multiplier=props.driverScoreData?.tier?.multiplier;return multiplier?multiplier<1?`driver-score-good`:multiplier>1?`driver-score-bad`:``:``}),hasChangedCoverageOptions=computed(()=>props.insuranceData?.coverageOptionsData?props.insuranceData.coverageOptionsData.some(option=>changedCoverageOptions.value[option.key]!==option.currentValueId):!1);onMounted(()=>{props.insuranceData?.coverageOptionsData&&props.insuranceData.coverageOptionsData.forEach(option=>{changedCoverageOptions.value[option.key]=option.currentValueId})});let emit$1=__emit,closePopup=()=>{emit$1(`return`,!0)},openVehicleList=()=>{addPopup(vehicleInsuranceList_default,{insuranceData:props.insuranceData,driverScoreData:props.driverScoreData}),closePopup()},onSaveClick=()=>{Lua_default.career_modules_insurance_insurance.saveNewInsuranceCoverageOptions(props.insuranceData.id,changedCoverageOptions.value),emit$1(`return`,!0)},updatePremiumDetails=async()=>{newPremiumDetails.value=await Lua_default.career_modules_insurance_insurance.calculateInsurancePremium(props.insuranceData.id,changedCoverageOptions.value,null)},onToggleChange=(coverageOption,newValue)=>{let targetChoiceIndex=coverageOption.choices.findIndex(choice=>choice.value===newValue);targetChoiceIndex!==-1&&(changedCoverageOptions.value[coverageOption.key]=targetChoiceIndex+1,updatePremiumDetails())},onChoiceClick=(coverageOption,choice)=>{changedCoverageOptions.value[coverageOption.key]=choice.id,updatePremiumDetails()};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$247,[createBaseVNode(`div`,_hoisted_2$204,[createBaseVNode(`div`,_hoisted_3$179,[createBaseVNode(`div`,_hoisted_4$152,[_cache[0]||=createTextVNode(` Edit Policy: `,-1),createBaseVNode(`span`,_hoisted_5$132,toDisplayString(props.insuranceData.name),1)]),_cache[1]||=createBaseVNode(`div`,{class:`top-info-description`},` These settings apply to all vehicles under this policy. Set deductibles per vehicle by clicking "Edit Vehicles" `,-1)]),createVNode(unref(bngButton_default),{class:`edit-vehicles-button`,accent:`custom`,onClick:openVehicleList},{default:withCtx(()=>[..._cache[2]||=[createTextVNode(` Edit Vehicles `,-1)]]),_:1})]),createBaseVNode(`div`,_hoisted_6$113,[(openBlock(!0),createElementBlock(Fragment,null,renderList(props.insuranceData.coverageOptionsData,coverageOption=>(openBlock(),createBlock(unref(coverageOption_default),{key:coverageOption.name,coverageOption,changedCoverageOptions:changedCoverageOptions.value,onChoiceClick,onToggleChange},null,8,[`coverageOption`,`changedCoverageOptions`]))),128))]),createBaseVNode(`div`,_hoisted_7$100,[_cache[5]||=createBaseVNode(`div`,{class:`premium-details-header`},` Premium Breakdown `,-1),createBaseVNode(`div`,_hoisted_8$84,[(openBlock(!0),createElementBlock(Fragment,null,renderList(props.insuranceData.currentPremiumDetails.items,(detail,key)=>(openBlock(),createElementBlock(`div`,{class:`premium-details-item`,key},[createBaseVNode(`div`,_hoisted_9$74,[createBaseVNode(`div`,_hoisted_10$64,toDisplayString(detail.name),1)]),createBaseVNode(`div`,_hoisted_11$57,[computedNewPremiumDiffs.value[key]&&computedNewPremiumDiffs.value[key].priceDiff!==0?(openBlock(),createElementBlock(`div`,_hoisted_12$46,[createBaseVNode(`span`,{class:normalizeClass([`arrow`,{"green-price":computedNewPremiumDiffs.value[key].priceDiff<0,"red-price":computedNewPremiumDiffs.value[key].priceDiff>0}])},toDisplayString(computedNewPremiumDiffs.value[key].priceDiff>0?`↑`:`↓`),3),createVNode(unref(bngUnit_default),{class:normalizeClass([`price-diff`,{"green-price":computedNewPremiumDiffs.value[key].priceDiff<0,"red-price":computedNewPremiumDiffs.value[key].priceDiff>0}]),money:computedNewPremiumDiffs.value[key].priceDiff},null,8,[`class`,`money`])])):createCommentVNode(``,!0),createVNode(unref(bngUnit_default),{money:newPremiumDetails.value?.items?.[key]?.price||detail.price},null,8,[`money`])])]))),128)),createBaseVNode(`div`,_hoisted_13$39,[createBaseVNode(`div`,_hoisted_14$36,[_cache[4]||=createBaseVNode(`div`,null,` Final Premium `,-1),createBaseVNode(`div`,_hoisted_15$34,[createBaseVNode(`span`,_hoisted_16$33,[_cache[3]||=createTextVNode(` Base Premium : `,-1),createVNode(unref(bngUnit_default),{money:props.insuranceData.currentPremiumDetails.totalPrice},null,8,[`money`]),createTextVNode(` × Driver Score `+toDisplayString(props.driverScoreData.score)+` @ `,1)]),createBaseVNode(`span`,{class:normalizeClass([`driver-score`,driverScoreColorClass.value])},toDisplayString(Math.round(props.driverScoreData.tier.multiplier*100))+`% `,3)])]),createBaseVNode(`div`,_hoisted_17$27,[computedTotalPriceDiff.value===0?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_18$24,[createBaseVNode(`span`,{class:normalizeClass([`arrow`,{"green-price":computedTotalPriceDiff.value<0,"red-price":computedTotalPriceDiff.value>0}])},toDisplayString(computedTotalPriceDiff.value>0?`↑`:`↓`),3),createVNode(unref(bngUnit_default),{class:normalizeClass([`price-diff`,{"green-price":computedTotalPriceDiff.value<0,"red-price":computedTotalPriceDiff.value>0}]),money:computedTotalPriceDiff.value},null,8,[`class`,`money`])])),createVNode(unref(bngUnit_default),{money:newPremiumDetails.value?.totalPriceWithDriverScore||props.insuranceData.currentPremiumDetails.totalPriceWithDriverScore},null,8,[`money`])])])])]),createBaseVNode(`div`,_hoisted_19$21,[createVNode(unref(bngButton_default),{class:`cancel-button bigger-button`,accent:`custom`,onClick:closePopup},{default:withCtx(()=>[..._cache[6]||=[createTextVNode(` Cancel `,-1)]]),_:1}),createVNode(unref(bngButton_default),{class:`save-button bigger-button`,accent:`custom`,onClick:onSaveClick,disabled:!props.insuranceData.canPayPaperworkFees||!hasChangedCoverageOptions.value},{default:withCtx(()=>[props.insuranceData.canPayPaperworkFees?(openBlock(),createElementBlock(Fragment,{key:1},[_cache[7]||=createTextVNode(` Apply for `,-1),createVNode(unref(bngUnit_default),{money:props.insuranceData.paperworkFees},null,8,[`money`])],64)):(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(` Insufficient funds `)],64))]),_:1},8,[`disabled`])])]))}},editPolicy_default=__plugin_vue_export_helper_default(_sfc_main$277,[[`__scopeId`,`data-v-081fecf3`]]),_sfc_main$276={__name:`insurancePerkIcon`,props:{perkIconData:{type:Object,required:!0}},setup(__props){let props=__props,computedColor=computed(()=>props.perkIconData.isSignaturePerk===void 0?props.perkIconData.color:props.perkIconData.isSignaturePerk?`green`:`blue`);return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,{class:normalizeClass({"insurance-perk-icon":!__props.perkIconData.iconOnly,[computedColor.value]:computedColor.value})},[createVNode(unref(bngIcon_default),{type:unref(icons).shieldCheckmark,class:normalizeClass({"glowing-icon":!0,[computedColor.value]:computedColor.value})},null,8,[`type`,`class`]),__props.perkIconData.iconOnly?createCommentVNode(``,!0):(openBlock(),createElementBlock(`span`,{key:0,class:normalizeClass({"small-text":!0,[computedColor.value]:computedColor.value})},toDisplayString(__props.perkIconData.smallText),3))],2)),[[unref(BngTooltip_default),__props.perkIconData.iconOnly?null:__props.perkIconData.tooltipText,`top`]])}},insurancePerkIcon_default=__plugin_vue_export_helper_default(_sfc_main$276,[[`__scopeId`,`data-v-d2b025b6`]]),_hoisted_1$246={class:`insurance-perks-container`},_hoisted_2$203={class:`left`},_hoisted_3$178={class:`insurance-perk-icon-wrapper`},_hoisted_4$151={key:1},_hoisted_5$131={class:`insurance-perk-texts`},_hoisted_6$112={class:`insurance-perk-intro`},_hoisted_7$99={key:0,class:`insurance-perk-description`},_hoisted_8$83={key:0,class:`signature-perk-wrapper`},_sfc_main$275={__name:`insurancePerks`,props:{insuranceData:Object,noDescription:Boolean},setup(__props){let props=__props,sortedPerks=computed(()=>props.insuranceData.perks?[...Array.isArray(props.insuranceData.perks)?props.insuranceData.perks:Object.values(props.insuranceData.perks)].sort((a$1,b)=>Number(b.isSignaturePerk||!1)-Number(a$1.isSignaturePerk||!1)):[]);return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$246,[(openBlock(!0),createElementBlock(Fragment,null,renderList(sortedPerks.value,perk=>(openBlock(),createElementBlock(`div`,{key:perk.id,class:normalizeClass([`insurance-perk`,{highlighted:perk.isSignaturePerk,"no-insurance":__props.insuranceData.id===-1}])},[createBaseVNode(`div`,_hoisted_2$203,[createBaseVNode(`div`,_hoisted_3$178,[__props.insuranceData.id===-1?(openBlock(),createElementBlock(`span`,_hoisted_4$151,`-`)):(openBlock(),createBlock(insurancePerkIcon_default,{key:0,perkIconData:{iconOnly:!0,isSignaturePerk:perk.isSignaturePerk&&perk.isSignaturePerk||!1}},null,8,[`perkIconData`]))]),createBaseVNode(`div`,_hoisted_5$131,[createBaseVNode(`div`,_hoisted_6$112,toDisplayString(perk.intro),1),__props.noDescription?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_7$99,toDisplayString(perk.description),1))])]),perk.isSignaturePerk?(openBlock(),createElementBlock(`div`,_hoisted_8$83,[..._cache[0]||=[createBaseVNode(`div`,{class:`signature-perk`},` SIGNATURE PERK `,-1)]])):createCommentVNode(``,!0)],2))),128))]))}},insurancePerks_default=__plugin_vue_export_helper_default(_sfc_main$275,[[`__scopeId`,`data-v-75e74910`]]),_hoisted_1$245={class:`insurance-perk-notice`},_sfc_main$274={__name:`insurancePerkNotice`,props:{perkText:{type:String,required:!0}},setup(__props){let props=__props;return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$245,[createVNode(insurancePerkIcon_default,{perkIconData:{iconOnly:!0}}),createTextVNode(` `+toDisplayString(props.perkText),1)]))}},insurancePerkNotice_default=__plugin_vue_export_helper_default(_sfc_main$274,[[`__scopeId`,`data-v-a98b3238`]]),_hoisted_1$244={class:`popup-content`},_hoisted_2$202={class:`top-info`},_hoisted_3$177={class:`top-info-title`},_hoisted_4$150={class:`top-info-veh-name`},_hoisted_5$130={class:`top-info-value-and-insurance`},_hoisted_6$111={class:`section`},_hoisted_7$98={class:`section`},_hoisted_8$82={class:`contribution-wrapper`},_hoisted_9$73={class:`contribution-item-value`},_hoisted_10$63={key:0,class:`price-diff-container`},_hoisted_11$56={class:`contribution-item-value`},_hoisted_12$45={key:0,class:`price-diff-container`},_hoisted_13$38={class:`buttons`},_sfc_main$273={__name:`editVehicleCoverage`,props:{insuranceData:{type:Object,required:!0},vehicleData:{type:Object,required:!0}},emits:[`return`],setup(__props,{emit:__emit}){let props=__props,newPremiumPrice=ref(0),newInsurancePremiumDetails=ref({totalPriceWithDriverScore:0}),computedNewPremiumDiff=computed(()=>newPremiumPrice.value-props.vehicleData.insuranceData.currentPremiumPrice),computedNewInsurancePremiumDiff=computed(()=>newInsurancePremiumDetails.value.totalPriceWithDriverScore-props.insuranceData.currentPremiumDetails.totalPriceWithDriverScore),hasChangedCoverageOptions=computed(()=>props.vehicleData?.insuranceData?.coverageOptionsData?.currentCoverageOptionsSanitized?props.vehicleData.insuranceData.coverageOptionsData.currentCoverageOptionsSanitized.some(option=>changedCoverageOptions.value[option.key]!==option.currentValueId):!1),emit$1=__emit,closePopup=()=>{emit$1(`return`,!0)},changedCoverageOptions=ref({}),updatePremiumPrice=async()=>{newPremiumPrice.value=(await Lua_default.career_modules_insurance_insurance.calculateVehiclePremium(props.vehicleData.id,null,changedCoverageOptions.value)).cost,newInsurancePremiumDetails.value=await Lua_default.career_modules_insurance_insurance.calculateInsurancePremium(props.insuranceData.id,null,{[props.vehicleData.id]:changedCoverageOptions.value})},onChoiceClick=(coverageOption,choice)=>{changedCoverageOptions.value[coverageOption.key]=choice.id,updatePremiumPrice()},onToggleChange=(coverageOption,newValue)=>{let targetChoiceIndex=coverageOption.choices.findIndex(choice=>choice.value===newValue);targetChoiceIndex!==-1&&(changedCoverageOptions.value[coverageOption.key]=targetChoiceIndex+1),updatePremiumPrice()},onSaveClick=()=>{Lua_default.career_modules_insurance_insurance.saveNewVehicleCoverageOptions(props.vehicleData.id,changedCoverageOptions.value),emit$1(`return`,!0)},openSwitchProvider=()=>{addPopup(ChooseInsuranceMain_default,{menuMode:`change`,params:{vehicleId:props.vehicleData.id}})};return onMounted(()=>{props.vehicleData.insuranceData.coverageOptionsData.currentCoverageOptionsSanitized.forEach(option=>{changedCoverageOptions.value[option.key]=option.currentValueId}),updatePremiumPrice()}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$244,[createBaseVNode(`div`,_hoisted_2$202,[createBaseVNode(`div`,_hoisted_3$177,[_cache[0]||=createTextVNode(` Select Deductible: `,-1),createBaseVNode(`span`,_hoisted_4$150,toDisplayString(props.vehicleData.name),1)]),createBaseVNode(`div`,_hoisted_5$130,[_cache[1]||=createTextVNode(` Value: `,-1),createVNode(unref(bngUnit_default),{money:props.vehicleData.initialValue},null,8,[`money`]),createTextVNode(` • Policy: `+toDisplayString(props.insuranceData.name),1)]),_cache[2]||=createBaseVNode(`div`,{class:`top-info-description`},` Choose how much you'll pay out-of-pocket when repairing this vehicle. Lower deductibles cost more per km. `,-1)]),createBaseVNode(`div`,_hoisted_6$111,[_cache[3]||=createBaseVNode(`div`,null,[createBaseVNode(`div`,{class:`header title`},` Choose Your Deductible `),createBaseVNode(`div`,{class:`under-title`},` You pay this amount per repair. `)],-1),createBaseVNode(`div`,null,[(openBlock(!0),createElementBlock(Fragment,null,renderList(props.vehicleData.insuranceData.coverageOptionsData.currentCoverageOptionsSanitized,coverageOption=>(openBlock(),createBlock(unref(coverageOption_default),{class:`coverage-option`,key:coverageOption.name,coverageOption,onlyShowMainText:!0,changedCoverageOptions:changedCoverageOptions.value,dontShowName:!0,onChoiceClick,onToggleChange},null,8,[`coverageOption`,`changedCoverageOptions`]))),128))])]),createBaseVNode(`div`,_hoisted_7$98,[_cache[6]||=createBaseVNode(`div`,{class:`title`},` Policy Impact `,-1),createBaseVNode(`div`,_hoisted_8$82,[createBaseVNode(`div`,{class:normalizeClass([`contribution-item`,{green:computedNewInsurancePremiumDiff.value<0,red:computedNewInsurancePremiumDiff.value>0}])},[_cache[4]||=createBaseVNode(`div`,{class:`contribution-item-title`},` Insurance Premium `,-1),createBaseVNode(`div`,_hoisted_9$73,[createVNode(unref(bngUnit_default),{money:props.insuranceData.currentPremiumDetails.totalPriceWithDriverScore},null,8,[`money`]),computedNewInsurancePremiumDiff.value!==0&&!isNaN(computedNewInsurancePremiumDiff.value)?(openBlock(),createElementBlock(`div`,_hoisted_10$63,` → `)):createCommentVNode(``,!0),computedNewInsurancePremiumDiff.value!==0&&!isNaN(computedNewInsurancePremiumDiff.value)?(openBlock(),createBlock(unref(bngUnit_default),{key:1,money:newInsurancePremiumDetails.value.totalPriceWithDriverScore},null,8,[`money`])):createCommentVNode(``,!0)])],2),createBaseVNode(`div`,{class:normalizeClass([`contribution-item`,{green:computedNewInsurancePremiumDiff.value<0,red:computedNewInsurancePremiumDiff.value>0}])},[_cache[5]||=createBaseVNode(`div`,{class:`contribution-item-title`},` Vehicle Contribution `,-1),createBaseVNode(`div`,_hoisted_11$56,[createVNode(unref(bngUnit_default),{money:props.vehicleData.insuranceData.currentPremiumPrice},null,8,[`money`]),computedNewPremiumDiff.value!==0&&!isNaN(computedNewPremiumDiff.value)?(openBlock(),createElementBlock(`div`,_hoisted_12$45,` → `)):createCommentVNode(``,!0),computedNewPremiumDiff.value!==0&&!isNaN(computedNewPremiumDiff.value)?(openBlock(),createBlock(unref(bngUnit_default),{key:1,money:newPremiumPrice.value},null,8,[`money`])):createCommentVNode(``,!0)])],2)])]),createBaseVNode(`div`,_hoisted_13$38,[createVNode(unref(bngButton_default),{class:`gray-button bigger-button`,accent:`custom`,onClick:closePopup},{default:withCtx(()=>[..._cache[7]||=[createTextVNode(` Cancel `,-1)]]),_:1}),createVNode(unref(bngButton_default),{class:`save-button bigger-button`,accent:`custom`,onClick:onSaveClick,disabled:!props.insuranceData.canPayPaperworkFees||!hasChangedCoverageOptions.value},{default:withCtx(()=>[props.insuranceData.canPayPaperworkFees?(openBlock(),createElementBlock(Fragment,{key:1},[_cache[8]||=createTextVNode(` Apply for `,-1),createVNode(unref(bngUnit_default),{money:props.insuranceData.paperworkFees},null,8,[`money`])],64)):(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(` Insufficient funds `)],64))]),_:1},8,[`disabled`]),createVNode(unref(bngButton_default),{class:`gray-button bigger-button`,accent:`custom`,onClick:openSwitchProvider},{default:withCtx(()=>[..._cache[9]||=[createTextVNode(` Switch Provider `,-1)]]),_:1})])]))}},editVehicleCoverage_default=__plugin_vue_export_helper_default(_sfc_main$273,[[`__scopeId`,`data-v-9f014d2d`]]),_hoisted_1$243=[`innerHTML`],_hoisted_2$201={key:2,class:`insurance-icon`},_hoisted_3$176={class:`insurance-name`},_hoisted_4$149={key:3,class:`insurance-slogan`},_sfc_main$272={__name:`insuranceIdentity`,props:{insuranceData:{type:Object,required:!0}},setup(__props){let props=__props,hasInsurance=computed(()=>svgContent.value||props.insuranceData.image),hasNoInsurance=computed(()=>props.insuranceData?.id===-1),svgContent=ref(null);return watch(()=>props.insuranceData.image,async newPath=>{if(newPath&&newPath.endsWith(`.svg`))try{let rawSvg=await getFile(`/${newPath}`);rawSvg?svgContent.value=rawSvg.replace(/