@camstack/addon-training 0.1.18 → 0.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_stub.js +944 -1085
- package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_training_page-DxDW0S-7.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_training_page-BlFM0TmL.mjs} +3 -3
- package/dist/addon-training.css +1 -1
- package/dist/{dist-iLuyzcbv.js → dist-l5PSmQZo.js} +19 -1
- package/dist/{dist-DSHERvpS.mjs → dist-p0tvRgy8.mjs} +19 -1
- package/dist/{hostInit-D_oEji-z.mjs → hostInit-Dy4zvQir.mjs} +2 -2
- package/dist/index.js +1 -1
- package/dist/orchestrator/training.addon.js +1 -1
- package/dist/orchestrator/training.addon.mjs +1 -1
- package/dist/providers/modal/training-modal.addon.js +1 -1
- package/dist/providers/modal/training-modal.addon.mjs +1 -1
- package/dist/remoteEntry.js +1 -1
- package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_training_page__remoteEntry_js-BTvC04Wb.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_training_page__remoteEntry_js-CacDWi0w.mjs} +1 -1
- package/package.json +1 -1
package/dist/_stub.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./virtualExposes-0m8NqEDE.mjs";
|
|
2
|
-
import { a as e, i as t, o as n, r } from "./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_training_page__remoteEntry_js-
|
|
2
|
+
import { a as e, i as t, o as n, r } from "./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_training_page__remoteEntry_js-CacDWi0w.mjs";
|
|
3
3
|
import { S as i, _ as a, b as o, c as s, d as c, f as l, g as u, h as d, i as f, l as p, m, n as h, p as g, r as _, t as v, u as y, v as b, x, y as S } from "./_virtual_mf___mfe_internal__addon_training_page__loadShare__react__loadShare__.js-DeDbF7NI.mjs";
|
|
4
4
|
import { _ as C, a as w, b as T, c as E, d as D, f as O, g as k, h as A, i as j, l as M, m as N, n as P, o as F, p as I, r as ee, s as te, t as ne, u as re, v as ie, y as L } from "./responsive-emJo3EdF.mjs";
|
|
5
5
|
import { c as ae, d as oe, l as se, s as ce, u as le } from "./scene-monitor-copy-CcQxbRXa.mjs";
|
|
@@ -6292,7 +6292,7 @@ var bs = ys("inline-flex items-center justify-center rounded-md font-medium tran
|
|
|
6292
6292
|
//#endregion
|
|
6293
6293
|
//#region ../ui-library/src/primitives/input.tsx
|
|
6294
6294
|
xs.displayName = "IconButton", i();
|
|
6295
|
-
var Ss = ys("h-7 w-full px-2.5 text-xs bg-surface border rounded-md text-foreground placeholder:text-foreground-subtle focus:outline-none focus:ring-1 focus:ring-primary transition-colors disabled:opacity-50 disabled:cursor-not-allowed", {
|
|
6295
|
+
var Ss = ys("h-7 w-full px-2.5 text-xs bg-surface border rounded-md text-foreground placeholder:text-foreground-subtle focus:outline-none focus:ring-1 focus:ring-inset focus:ring-primary transition-colors disabled:opacity-50 disabled:cursor-not-allowed", {
|
|
6296
6296
|
variants: { state: {
|
|
6297
6297
|
default: "border-border",
|
|
6298
6298
|
error: "border-danger"
|
|
@@ -6502,7 +6502,7 @@ W.deviceManager.getChildren.useQuery, W.deviceManager.getChildrenBatch.useQuery,
|
|
|
6502
6502
|
var Ks = W.deviceManager.getBindings.useQuery;
|
|
6503
6503
|
W.deviceManager.getBindingsBatch.useQuery, W.deviceManager.getAllBindings.useQuery, W.deviceManager.listDeviceIdsByCaps.useQuery, W.deviceManager.setWrapperActive.useMutation, W.deviceManager.getWrapperActivation.useQuery, W.deviceManager.listWrappersForCap.useQuery, W.deviceManager.listBindableCapsForDeviceType.useQuery, W.deviceManager.getDeviceSettingsAggregate.useQuery, W.deviceManager.getDeviceLiveInfoAggregate.useQuery, W.deviceManager.getDeviceAggregate.useQuery, W.deviceManager.runDeviceAction.useMutation, W.deviceManager.updateDeviceField.useMutation, W.deviceManager.updateDeviceFieldsBatch.useMutation, W.deviceManager.discoverDevices.useMutation, W.deviceManager.adoptDevice.useMutation, W.deviceManager.getCreationSchema.useQuery, W.deviceManager.createDevice.useMutation, W.deviceManager.testCreationField.useMutation, W.deviceManager.adoptionListCandidateFilters.useQuery, W.deviceManager.adoptionListCandidates.useQuery, W.deviceManager.adoptionRefresh.useMutation, W.deviceManager.adoptionAdopt.useMutation, W.deviceManager.adoptionRelease.useMutation, W.deviceManager.adoptionStartJob.useMutation, W.deviceManager.adoptionListJobs.useQuery, W.deviceManager.adoptionCancelJob.useMutation, W.deviceManager.adoptionResync.useMutation, W.deviceManager.discoveryProviders.useQuery, W.deviceManager.discoverAllProviders.useMutation, W.deviceManager.discoverProvider.useMutation, W.deviceManager.providerCreationType.useQuery, W.deviceManager.providerDiscoveryParamsSchema.useQuery, W.deviceManager.testField.useMutation, W.deviceManager.getDeviceStatusAggregate.useQuery, W.deviceManager.getDeviceStatusAggregateBatch.useQuery, W.deviceOps.getStreamSources.useQuery, W.deviceOps.getConfigEntries.useQuery, W.deviceOps.setConfig.useMutation, W.deviceOps.runAction.useMutation, W.deviceOps.removeDevice.useMutation, W.deviceOps.getSettingsSchema.useQuery, W.deviceOps.getRawState.useQuery, W.deviceProvider.start.useMutation, W.deviceProvider.stop.useMutation, W.deviceProvider.getStatus.useQuery, W.deviceProvider.getDevices.useQuery, W.deviceProvider.reloadDevice.useMutation, W.deviceProvider.supportsDiscovery.useQuery, W.deviceProvider.discoverDevices.useMutation, W.deviceProvider.getDiscoveryParamsSchema.useQuery, W.deviceProvider.getManualCreationType.useQuery, W.deviceProvider.adoptDiscoveredDevice.useMutation, W.deviceProvider.supportsManualCreation.useQuery, W.deviceProvider.getChildCreationSchema.useQuery, W.deviceProvider.createDevice.useMutation, W.deviceProvider.testCreationField.useMutation, W.deviceState.getSnapshot.useQuery, W.deviceState.getCapSlice.useQuery, W.deviceState.getAllSnapshots.useQuery, W.deviceState.setCapSlice.useMutation, W.deviceState.claimFields.useMutation, W.deviceState.patchOwnedFields.useMutation, W.deviceState.releaseClaim.useMutation, W.deviceState.listClaims.useQuery, W.deviceState.getNativeCapSlice.useQuery, W.deviceStatus.getStatus.useQuery, W.doorbell.getStatus.useQuery, W.enumSensor.getStatus.useQuery, W.eventEmitter.getStatus.useQuery, W.faceGallery.listIdentities.useQuery, W.faceGallery.createIdentity.useMutation, W.faceGallery.renameIdentity.useMutation, W.faceGallery.deleteIdentity.useMutation, W.faceGallery.listIdentitySamples.useQuery, W.faceGallery.auditIdentitySamples.useQuery, W.faceGallery.removeSample.useMutation, W.faceGallery.listRecentFaces.useQuery, W.faceGallery.getFaceByTrack.useQuery, W.faceGallery.getFaceMedia.useQuery, W.faceGallery.assignFace.useMutation, W.faceGallery.unassignFace.useMutation, W.faceGallery.deleteFace.useMutation, W.faceGallery.assignFaces.useMutation, W.faceGallery.unassignFaces.useMutation, W.faceGallery.suggestFaceClusters.useQuery, W.fanControl.setPercentage.useMutation, W.fanControl.setPreset.useMutation, W.fanControl.setDirection.useMutation, W.fanControl.setOscillating.useMutation, W.fanControl.getStatus.useQuery, W.featureProbe.getStatus.useQuery, W.flood.getStatus.useQuery, W.gas.getStatus.useQuery, W.humidifier.setOn.useMutation, W.humidifier.setTargetHumidity.useMutation, W.humidifier.setMode.useMutation, W.humidifier.getStatus.useQuery, W.humiditySensor.getStatus.useQuery, W.image.getStatus.useQuery, W.imageSettings.getOptions.useQuery, W.imageSettings.setSettings.useMutation, W.imageSettings.getStatus.useQuery, W.integrations.list.useQuery, W.integrations.get.useQuery, W.integrations.getByAddonId.useQuery, W.integrations.create.useMutation, W.integrations.update.useMutation, W.integrations.delete.useMutation, W.integrations.getSettings.useQuery, W.integrations.setSettings.useMutation, W.integrations.getAvailableTypes.useQuery, W.integrations.testConnection.useMutation, W.intercom.startSession.useMutation, W.intercom.handleAnswer.useMutation, W.intercom.stopSession.useMutation, W.intercom.startTalkSession.useMutation, W.intercom.pushTalkAudio.useMutation, W.intercom.endTalkSession.useMutation, W.intercom.getStatus.useQuery, W.keychainAdmin.status.useQuery, W.keychainAdmin.listSecrets.useQuery, W.keychainAdmin.listAudit.useQuery, W.keychainAdmin.reveal.useMutation, W.keychainAdmin.setSystemSecret.useMutation, W.keychainAdmin.deleteOrphans.useMutation, W.keychainAdmin.rotateMasterKey.useMutation, W.keychainAdmin.purgeRetiredKeys.useMutation, W.keychainAdmin.downloadRecoveryKey.useMutation, W.keychainAdmin.resetKeychain.useMutation, W.keychainAdmin.resetReport.useQuery, W.keychainAdmin.acknowledgeReset.useMutation, W.lawnMowerControl.startMowing.useMutation, W.lawnMowerControl.pause.useMutation, W.lawnMowerControl.dock.useMutation, W.lawnMowerControl.getStatus.useQuery, W.llm.generate.useMutation, W.llm.generateVision.useMutation, W.llm.cancel.useMutation, W.llm.listProfileKinds.useQuery, W.llm.listProfiles.useQuery, W.llm.upsertProfile.useMutation, W.llm.deleteProfile.useMutation, W.llm.testProfile.useMutation, W.llm.listModels.useQuery, W.llm.getDefaults.useQuery, W.llm.setDefault.useMutation, W.llm.getUsage.useQuery, W.llm.listModelCatalog.useQuery, W.llm.listRuntimeNodes.useQuery, W.llm.listNodeModels.useQuery, W.llm.resolveModelRef.useMutation, W.llm.installModel.useMutation, W.llm.deleteModel.useMutation, W.llm.getRuntimeStatus.useQuery, W.llm.startRuntime.useMutation, W.llm.stopRuntime.useMutation, W.localNetwork.list.useQuery, W.localNetwork.getPreferred.useQuery, W.localNetwork.getConnectionEndpoints.useQuery, W.localNetwork.getNotificationEndpoint.useQuery, W.localNetwork.setNotificationEndpoint.useMutation, W.localNetwork.getViewerEndpoints.useQuery, W.localNetwork.setViewerEndpoints.useMutation, W.localNetwork.getAddresses.useQuery, W.localNetwork.addCustomAddress.useMutation, W.localNetwork.removeCustomAddress.useMutation, W.localNetwork.setAddressRole.useMutation, W.localNetwork.getHubAddresses.useQuery, W.localNetwork.getAllowedAddresses.useQuery, W.localNetwork.setAllowedAddresses.useMutation, W.localNetwork.resetAllowlistToBestMatch.useMutation, W.localNetwork.getTlsStatus.useQuery, W.localNetwork.regenerateCertificate.useMutation, W.localNetwork.uploadCertificate.useMutation, W.localNetwork.downloadCa.useQuery, W.localNetwork.revertToGeneratedCertificate.useMutation, W.lockControl.lock.useMutation, W.lockControl.unlock.useMutation, W.lockControl.open.useMutation, W.lockControl.getStatus.useQuery, W.mediaPlayer.play.useMutation, W.mediaPlayer.pause.useMutation, W.mediaPlayer.stop.useMutation, W.mediaPlayer.next.useMutation, W.mediaPlayer.previous.useMutation, W.mediaPlayer.seek.useMutation, W.mediaPlayer.setVolume.useMutation, W.mediaPlayer.setMute.useMutation, W.mediaPlayer.setShuffle.useMutation, W.mediaPlayer.setRepeat.useMutation, W.mediaPlayer.selectSource.useMutation, W.mediaPlayer.playMedia.useMutation, W.mediaPlayer.getStatus.useQuery, W.meshNetwork.getStatus.useQuery, W.meshNetwork.join.useMutation, W.meshNetwork.startLogin.useMutation, W.meshNetwork.leave.useMutation, W.meshNetwork.logout.useMutation, W.meshNetwork.listPeers.useQuery, W.meshNetwork.testConnection.useMutation, W.metricsProvider.collectSnapshot.useQuery, W.metricsProvider.getCached.useQuery, W.metricsProvider.getCurrent.useQuery, W.metricsProvider.getDiskSpace.useQuery, W.metricsProvider.getGpuInfo.useQuery, W.metricsProvider.getCpuTemperature.useQuery, W.metricsProvider.getProcessStats.useQuery, W.metricsProvider.listAddonInstances.useQuery, W.metricsProvider.getAddonStats.useQuery, W.metricsProvider.listNodeProcesses.useQuery, W.metricsProvider.getLoadSeries.useQuery, W.motion.isDetected.useQuery, W.motion.getStatus.useQuery, W.motionDetection.analyze.useMutation, W.motionDetection.removeCamera.useMutation, W.motionDetection.reset.useMutation, W.motionDetection.getDeviceSettingsContribution.useQuery, W.motionDetection.getDeviceLiveContribution.useQuery, W.motionDetection.applyDeviceSettingsPatch.useMutation, W.motionTrigger.setMotionTrigger.useMutation, W.motionTrigger.getStatus.useQuery, W.motionZones.getOptions.useQuery, W.motionZones.setZone.useMutation, W.motionZones.getStatus.useQuery, W.mqttBroker.listBrokers.useQuery, W.mqttBroker.getBrokerConfig.useQuery, W.mqttBroker.addBroker.useMutation, W.mqttBroker.removeBroker.useMutation, W.mqttBroker.testConnection.useMutation, W.mqttBroker.startEmbeddedBroker.useMutation, W.mqttBroker.stopEmbeddedBroker.useMutation, W.mqttBroker.getStatus.useQuery, W.nativeObjectDetection.getOptions.useQuery, W.nativeObjectDetection.setSettings.useMutation, W.nativeObjectDetection.setEnabled.useMutation, W.nativeObjectDetection.getStatus.useQuery, W.navigation.move.useMutation, W.navigation.stop.useMutation, W.navigation.goToPoint.useMutation, W.navigation.listActions.useQuery, W.navigation.runAction.useMutation, W.navigation.playSound.useMutation, W.navigation.setLightOn.useMutation, W.navigation.setLightMode.useMutation, W.navigation.setLightLevel.useMutation, W.navigation.getFeatures.useQuery, W.navigation.getStatus.useQuery, W.networkAccess.start.useMutation, W.networkAccess.stop.useMutation, W.networkAccess.getEndpoint.useQuery, W.networkAccess.getStatus.useQuery, W.networkAccess.listEndpoints.useQuery, W.networkLink.getStatus.useQuery, W.networkQuality.getDeviceStats.useQuery, W.networkQuality.getAllStats.useQuery, W.networkQuality.reportClientStats.useMutation, W.nodes.topology.useQuery, W.nodes.directory.useQuery, W.nodes.deployAddon.useMutation, W.nodes.undeployAddon.useMutation, W.nodes.restartAddon.useMutation, W.nodes.restartProcess.useMutation, W.nodes.restartNode.useMutation, W.nodes.shutdownNode.useMutation, W.nodes.renameNode.useMutation, W.nodes.clusterAddonStatus.useQuery, W.nodes.getCapUsageGraph.useQuery, W.nodes.getNodeAddons.useQuery, W.nodes.setProcessLogLevel.useMutation, W.nodes.executeQuery.useMutation;
|
|
6504
6504
|
var qs = W.notificationOutput.listTargetKinds.useQuery, Js = W.notificationOutput.listTargets.useQuery;
|
|
6505
|
-
W.notificationOutput.getTarget.useQuery, W.notificationOutput.discoverTargets.useQuery, W.notificationOutput.probeTargetConfig.useMutation, W.notificationOutput.send.useMutation, W.notificationOutput.testTarget.useMutation, W.notificationOutput.upsertTarget.useMutation, W.notificationOutput.deleteTarget.useMutation, W.notificationOutput.setTargetEnabled.useMutation, W.notificationRules.listRules.useQuery, W.notificationRules.getRule.useQuery, W.notificationRules.createRule.useMutation, W.notificationRules.updateRule.useMutation, W.notificationRules.deleteRule.useMutation, W.notificationRules.setRuleEnabled.useMutation, W.notificationRules.listSequences.useQuery, W.notificationRules.getSequence.useQuery, W.notificationRules.createSequence.useMutation, W.notificationRules.updateSequence.useMutation, W.notificationRules.deleteSequence.useMutation, W.notificationRules.getClipRetentionAsks.useQuery, W.notificationRules.listDeviceMutes.useQuery, W.notificationRules.setDeviceMuted.useMutation, W.notificationRules.testRule.useMutation, W.notificationRules.previewStateSummary.useMutation, W.notificationRules.getConditionCatalog.useQuery, W.notificationRules.getTemplateCatalog.useQuery, W.notificationRules.previewTemplate.useMutation, W.notificationRules.getHistory.useQuery, W.notificationRules.getRuleLastRuns.useQuery, W.notificationRules.resolveArtifactUrl.useQuery, W.notificationRules.listSnoozes.useQuery, W.notificationRules.createSnooze.useMutation, W.notificationRules.cancelSnooze.useMutation, W.notificationRules.getAlarmConfig.useQuery, W.notificationRules.setAlarmConfig.useMutation, W.notificationRules.createAlarmProfile.useMutation, W.notificationRules.renameAlarmProfile.useMutation, W.notificationRules.deleteAlarmProfile.useMutation, W.notificationRules.activateAlarmProfile.useMutation, W.notificationRules.getAlarmSensors.useQuery, W.notifier.send.useMutation, W.notifier.cancel.useMutation, W.notifier.getStatus.useQuery, W.numericSensor.getStatus.useQuery, W.osd.setOverlay.useMutation, W.osd.getStatus.useQuery, W.osdManager.getDeviceOsd.useQuery, W.osdManager.getSourceCatalog.useQuery, W.osdManager.getConditionSupport.useQuery, W.osdManager.setSlotBinding.useMutation, W.osdManager.clearSlotBinding.useMutation, W.osdManager.copyDeviceConfiguration.useMutation, W.osdManager.previewSlot.useMutation, W.osdManager.renderDevice.useMutation, W.osdManager.listTemplates.useQuery, W.osdManager.upsertTemplate.useMutation, W.osdManager.deleteTemplate.useMutation, W.petFeeder.feed.useMutation, W.petFeeder.cancelFeed.useMutation, W.petFeeder.resetDesiccant.useMutation, W.petFeeder.markFoodReplenished.useMutation, W.petFeeder.callPet.useMutation, W.petFeeder.playSound.useMutation, W.petFeeder.setChildLock.useMutation, W.petFeeder.setIndicatorLight.useMutation, W.petFeeder.setFeedSound.useMutation, W.petFeeder.setVolume.useMutation, W.petFeeder.getStatus.useQuery, W.pipelineAnalytics.getActiveTracks.useQuery, W.pipelineAnalytics.getTrack.useQuery, W.pipelineAnalytics.listTracks.useQuery, W.pipelineAnalytics.listRecentTracks.useQuery, W.pipelineAnalytics.clearTracks.useMutation;
|
|
6505
|
+
W.notificationOutput.getTarget.useQuery, W.notificationOutput.discoverTargets.useQuery, W.notificationOutput.probeTargetConfig.useMutation, W.notificationOutput.send.useMutation, W.notificationOutput.testTarget.useMutation, W.notificationOutput.upsertTarget.useMutation, W.notificationOutput.deleteTarget.useMutation, W.notificationOutput.setTargetEnabled.useMutation, W.notificationRules.listRules.useQuery, W.notificationRules.getRule.useQuery, W.notificationRules.createRule.useMutation, W.notificationRules.updateRule.useMutation, W.notificationRules.deleteRule.useMutation, W.notificationRules.setRuleEnabled.useMutation, W.notificationRules.listSequences.useQuery, W.notificationRules.getSequence.useQuery, W.notificationRules.createSequence.useMutation, W.notificationRules.updateSequence.useMutation, W.notificationRules.deleteSequence.useMutation, W.notificationRules.getClipRetentionAsks.useQuery, W.notificationRules.listDeviceMutes.useQuery, W.notificationRules.setDeviceMuted.useMutation, W.notificationRules.testRule.useMutation, W.notificationRules.previewStateSummary.useMutation, W.notificationRules.getConditionCatalog.useQuery, W.notificationRules.getTemplateCatalog.useQuery, W.notificationRules.previewTemplate.useMutation, W.notificationRules.getHistory.useQuery, W.notificationRules.getRuleLastRuns.useQuery, W.notificationRules.resolveArtifactUrl.useQuery, W.notificationRules.listSnoozes.useQuery, W.notificationRules.createSnooze.useMutation, W.notificationRules.cancelSnooze.useMutation, W.notificationRules.getAlarmConfig.useQuery, W.notificationRules.setAlarmConfig.useMutation, W.notificationRules.createAlarmProfile.useMutation, W.notificationRules.renameAlarmProfile.useMutation, W.notificationRules.deleteAlarmProfile.useMutation, W.notificationRules.activateAlarmProfile.useMutation, W.notificationRules.getAlarmSensors.useQuery, W.notifier.send.useMutation, W.notifier.cancel.useMutation, W.notifier.getStatus.useQuery, W.numericSensor.getStatus.useQuery, W.osd.setOverlay.useMutation, W.osd.getStatus.useQuery, W.osdManager.getDeviceOsd.useQuery, W.osdManager.getSourceCatalog.useQuery, W.osdManager.getConditionSupport.useQuery, W.osdManager.setSlotBinding.useMutation, W.osdManager.clearSlotBinding.useMutation, W.osdManager.setSlotCameraEnabled.useMutation, W.osdManager.copyDeviceConfiguration.useMutation, W.osdManager.previewSlot.useMutation, W.osdManager.renderDevice.useMutation, W.osdManager.listTemplates.useQuery, W.osdManager.upsertTemplate.useMutation, W.osdManager.deleteTemplate.useMutation, W.petFeeder.feed.useMutation, W.petFeeder.cancelFeed.useMutation, W.petFeeder.resetDesiccant.useMutation, W.petFeeder.markFoodReplenished.useMutation, W.petFeeder.callPet.useMutation, W.petFeeder.playSound.useMutation, W.petFeeder.setChildLock.useMutation, W.petFeeder.setIndicatorLight.useMutation, W.petFeeder.setFeedSound.useMutation, W.petFeeder.setVolume.useMutation, W.petFeeder.getStatus.useQuery, W.pipelineAnalytics.getActiveTracks.useQuery, W.pipelineAnalytics.getTrack.useQuery, W.pipelineAnalytics.listTracks.useQuery, W.pipelineAnalytics.listRecentTracks.useQuery, W.pipelineAnalytics.clearTracks.useMutation;
|
|
6506
6506
|
var Ys = W.pipelineAnalytics.getMotionEvents.useQuery, Xs = W.pipelineAnalytics.getObjectEvents.useQuery, Zs = W.pipelineAnalytics.getAudioEvents.useQuery;
|
|
6507
6507
|
W.pipelineAnalytics.listEventKinds.useQuery, W.pipelineAnalytics.listEventKindsBatch.useQuery, W.pipelineAnalytics.getSensorEvents.useQuery, W.pipelineAnalytics.getKeyEvents.useQuery, W.pipelineAnalytics.getKeyEventsBatch.useQuery, W.pipelineAnalytics.readLongTermSeries.useQuery;
|
|
6508
6508
|
var Qs = W.pipelineAnalytics.getEventDensity.useQuery;
|
|
@@ -16222,37 +16222,39 @@ function bg() {
|
|
|
16222
16222
|
if (!e) throw Error("Tabs compound components must be used within <Tabs>");
|
|
16223
16223
|
return e;
|
|
16224
16224
|
}
|
|
16225
|
-
function xg({ value: e, onValueChange: t, defaultValue: n = "",
|
|
16226
|
-
let [
|
|
16227
|
-
t?.(n), e === void 0 &&
|
|
16225
|
+
function xg({ value: e, onValueChange: t, defaultValue: n = "", appearance: r = "underline", className: i, ...o }) {
|
|
16226
|
+
let [c, l] = a(n), u = e ?? c, d = s((n) => {
|
|
16227
|
+
t?.(n), e === void 0 && l(n);
|
|
16228
16228
|
}, [e, t]);
|
|
16229
16229
|
return /* @__PURE__ */ V(yg.Provider, {
|
|
16230
16230
|
value: {
|
|
16231
|
-
value:
|
|
16232
|
-
setValue:
|
|
16231
|
+
value: u,
|
|
16232
|
+
setValue: d,
|
|
16233
|
+
appearance: r
|
|
16233
16234
|
},
|
|
16234
16235
|
children: /* @__PURE__ */ V("div", {
|
|
16235
|
-
className:
|
|
16236
|
-
...
|
|
16236
|
+
className: i,
|
|
16237
|
+
...o
|
|
16237
16238
|
})
|
|
16238
16239
|
});
|
|
16239
16240
|
}
|
|
16240
16241
|
function Sg({ className: e, ...t }) {
|
|
16242
|
+
let { appearance: n } = bg();
|
|
16241
16243
|
return /* @__PURE__ */ V("div", {
|
|
16242
16244
|
role: "tablist",
|
|
16243
|
-
className: J("flex flex-row overflow-x-auto overflow-y-hidden border-b border-border-subtle", e),
|
|
16245
|
+
className: J("flex flex-row overflow-x-auto overflow-y-hidden", n === "pills" ? "gap-1 border-b border-border-subtle py-1" : "border-b border-border-subtle", e),
|
|
16244
16246
|
...t
|
|
16245
16247
|
});
|
|
16246
16248
|
}
|
|
16247
16249
|
function Cg({ value: e, className: t, ...n }) {
|
|
16248
|
-
let { value: r, setValue: i } = bg(),
|
|
16250
|
+
let { value: r, setValue: i, appearance: a } = bg(), o = e === r;
|
|
16249
16251
|
return /* @__PURE__ */ V("button", {
|
|
16250
16252
|
type: "button",
|
|
16251
16253
|
role: "tab",
|
|
16252
|
-
"aria-selected":
|
|
16254
|
+
"aria-selected": o,
|
|
16253
16255
|
"aria-controls": `tabpanel-${e}`,
|
|
16254
|
-
tabIndex:
|
|
16255
|
-
className: J("h-7 shrink-0 whitespace-nowrap text-xs px-3 transition-colors", a ? "border-b-2 border-primary text-foreground font-medium" : "text-foreground-muted hover:text-foreground", t),
|
|
16256
|
+
tabIndex: o ? 0 : -1,
|
|
16257
|
+
className: J("h-7 shrink-0 whitespace-nowrap text-xs px-3 transition-colors", a === "pills" ? o ? "rounded-md bg-primary/10 font-medium text-primary" : "rounded-md text-foreground-muted hover:bg-surface-hover hover:text-foreground" : o ? "border-b-2 border-primary text-foreground font-medium" : "text-foreground-muted hover:text-foreground", t),
|
|
16256
16258
|
onClick: () => i(e),
|
|
16257
16259
|
...n
|
|
16258
16260
|
});
|
|
@@ -28142,7 +28144,7 @@ function NA({ open: e, onClose: t, title: n, icon: r, error: i, width: a = "lg",
|
|
|
28142
28144
|
children: s
|
|
28143
28145
|
}),
|
|
28144
28146
|
/* @__PURE__ */ V(Fp, {
|
|
28145
|
-
className: "space-y-3
|
|
28147
|
+
className: "space-y-3 px-1",
|
|
28146
28148
|
children: o
|
|
28147
28149
|
}),
|
|
28148
28150
|
c != null && /* @__PURE__ */ V(Ip, {
|
|
@@ -28196,183 +28198,11 @@ function LA(e = {}) {
|
|
|
28196
28198
|
};
|
|
28197
28199
|
}
|
|
28198
28200
|
//#endregion
|
|
28199
|
-
//#region ../ui-library/src/composites/provider-entries/AddProviderEntryDialog.tsx
|
|
28200
|
-
i(), i();
|
|
28201
|
-
function RA({ open: e, onOpenChange: t, types: n, onCreate: r, submitting: i = !1, title: o = "Add provider entry", description: s = "Pick a provider type and name this credential set." }) {
|
|
28202
|
-
let l = c(), u = c(), [d, f] = a(""), [p, m] = a("");
|
|
28203
|
-
y(() => {
|
|
28204
|
-
e && (f(n[0]?.typeId ?? ""), m(""));
|
|
28205
|
-
}, [e, n]);
|
|
28206
|
-
let h = d !== "" && p.trim().length > 0 && !i && n.length > 0, g = () => {
|
|
28207
|
-
h && r({
|
|
28208
|
-
typeId: d,
|
|
28209
|
-
name: p.trim()
|
|
28210
|
-
});
|
|
28211
|
-
};
|
|
28212
|
-
return /* @__PURE__ */ V(jp, {
|
|
28213
|
-
open: e,
|
|
28214
|
-
onOpenChange: (e) => !i && t(e),
|
|
28215
|
-
children: /* @__PURE__ */ H(Np, {
|
|
28216
|
-
width: "sm",
|
|
28217
|
-
placement: "sheet-on-mobile",
|
|
28218
|
-
scroll: "body",
|
|
28219
|
-
children: [
|
|
28220
|
-
/* @__PURE__ */ H(Pp, { children: [/* @__PURE__ */ V(Lp, { children: o }), /* @__PURE__ */ V(Rp, { children: s })] }),
|
|
28221
|
-
/* @__PURE__ */ V(Fp, {
|
|
28222
|
-
className: "space-y-3",
|
|
28223
|
-
children: n.length === 0 ? /* @__PURE__ */ V("p", {
|
|
28224
|
-
className: "text-xs text-foreground-subtle",
|
|
28225
|
-
children: "No provider types are available yet. Install a training provider addon first."
|
|
28226
|
-
}) : /* @__PURE__ */ H(U, { children: [/* @__PURE__ */ H("div", {
|
|
28227
|
-
className: "space-y-1",
|
|
28228
|
-
children: [/* @__PURE__ */ V(ng, {
|
|
28229
|
-
htmlFor: l,
|
|
28230
|
-
children: "Provider type"
|
|
28231
|
-
}), /* @__PURE__ */ H("div", {
|
|
28232
|
-
className: "flex items-center gap-2",
|
|
28233
|
-
children: [/* @__PURE__ */ V(zA, { url: n.find((e) => e.typeId === d)?.iconUrl ?? null }), /* @__PURE__ */ V(nd, {
|
|
28234
|
-
id: l,
|
|
28235
|
-
"aria-label": "Provider type",
|
|
28236
|
-
className: "flex-1",
|
|
28237
|
-
value: d,
|
|
28238
|
-
onChange: (e) => f(e.target.value),
|
|
28239
|
-
options: n.map((e) => ({
|
|
28240
|
-
value: e.typeId,
|
|
28241
|
-
label: e.label
|
|
28242
|
-
})),
|
|
28243
|
-
disabled: i
|
|
28244
|
-
})]
|
|
28245
|
-
})]
|
|
28246
|
-
}), /* @__PURE__ */ H("div", {
|
|
28247
|
-
className: "space-y-1",
|
|
28248
|
-
children: [/* @__PURE__ */ V(ng, {
|
|
28249
|
-
htmlFor: u,
|
|
28250
|
-
children: "Name"
|
|
28251
|
-
}), /* @__PURE__ */ V(Cs, {
|
|
28252
|
-
id: u,
|
|
28253
|
-
"aria-label": "Name",
|
|
28254
|
-
value: p,
|
|
28255
|
-
onChange: (e) => m(e.target.value),
|
|
28256
|
-
placeholder: "Production",
|
|
28257
|
-
disabled: i,
|
|
28258
|
-
onKeyDown: (e) => {
|
|
28259
|
-
e.key === "Enter" && (e.preventDefault(), g());
|
|
28260
|
-
}
|
|
28261
|
-
})]
|
|
28262
|
-
})] })
|
|
28263
|
-
}),
|
|
28264
|
-
/* @__PURE__ */ H(Ip, { children: [/* @__PURE__ */ V(X, {
|
|
28265
|
-
type: "button",
|
|
28266
|
-
variant: "ghost",
|
|
28267
|
-
size: "sm",
|
|
28268
|
-
disabled: i,
|
|
28269
|
-
onClick: () => t(!1),
|
|
28270
|
-
children: "Cancel"
|
|
28271
|
-
}), /* @__PURE__ */ H(X, {
|
|
28272
|
-
type: "button",
|
|
28273
|
-
size: "sm",
|
|
28274
|
-
disabled: !h,
|
|
28275
|
-
onClick: g,
|
|
28276
|
-
children: [i && /* @__PURE__ */ V(hr, {
|
|
28277
|
-
className: "h-3.5 w-3.5 animate-spin",
|
|
28278
|
-
"aria-hidden": !0
|
|
28279
|
-
}), "Create"]
|
|
28280
|
-
})] })
|
|
28281
|
-
]
|
|
28282
|
-
})
|
|
28283
|
-
});
|
|
28284
|
-
}
|
|
28285
|
-
function zA({ url: e }) {
|
|
28286
|
-
return e === null ? /* @__PURE__ */ V("span", {
|
|
28287
|
-
className: J("inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md", "border border-border bg-surface text-[10px] text-foreground-subtle"),
|
|
28288
|
-
"aria-hidden": !0,
|
|
28289
|
-
children: "?"
|
|
28290
|
-
}) : /* @__PURE__ */ V("img", {
|
|
28291
|
-
src: e,
|
|
28292
|
-
alt: "",
|
|
28293
|
-
className: "h-7 w-7 shrink-0 rounded-md border border-border bg-surface object-contain p-0.5"
|
|
28294
|
-
});
|
|
28295
|
-
}
|
|
28296
|
-
//#endregion
|
|
28297
|
-
//#region ../ui-library/src/composites/provider-entries/ProviderEntryPills.tsx
|
|
28298
|
-
var BA = J(P, "min-w-0 max-w-full gap-1.5 py-1 pl-1 pr-2.5 text-xs font-normal", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40"), VA = J(ne, "font-medium"), HA = ee, UA = {
|
|
28299
|
-
ok: "bg-success",
|
|
28300
|
-
warning: "bg-warning",
|
|
28301
|
-
error: "bg-danger",
|
|
28302
|
-
unknown: "border border-foreground-subtle bg-transparent"
|
|
28303
|
-
}, WA = {
|
|
28304
|
-
ok: "OK",
|
|
28305
|
-
warning: "Warning",
|
|
28306
|
-
error: "Error",
|
|
28307
|
-
unknown: "Unknown"
|
|
28308
|
-
};
|
|
28309
|
-
function GA({ label: e, entries: t, selectedEntryId: n, onSelect: r, onAdd: i, addLabel: a = "Add provider" }) {
|
|
28310
|
-
return /* @__PURE__ */ V("nav", {
|
|
28311
|
-
"aria-label": e,
|
|
28312
|
-
className: "min-w-0",
|
|
28313
|
-
children: /* @__PURE__ */ H("div", {
|
|
28314
|
-
className: "flex min-w-0 flex-wrap items-center gap-1.5",
|
|
28315
|
-
children: [t.map((e) => /* @__PURE__ */ V(KA, {
|
|
28316
|
-
entry: e,
|
|
28317
|
-
current: e.entryId === n,
|
|
28318
|
-
onSelect: r
|
|
28319
|
-
}, e.entryId)), i !== void 0 && /* @__PURE__ */ H("button", {
|
|
28320
|
-
type: "button",
|
|
28321
|
-
onClick: i,
|
|
28322
|
-
className: J(BA, "border-dashed border-border pl-2 text-foreground-subtle", "hover:border-primary/50 hover:text-foreground"),
|
|
28323
|
-
children: [/* @__PURE__ */ V(Yr, {
|
|
28324
|
-
className: "h-3.5 w-3.5 shrink-0",
|
|
28325
|
-
"aria-hidden": !0
|
|
28326
|
-
}), /* @__PURE__ */ V("span", {
|
|
28327
|
-
className: "truncate",
|
|
28328
|
-
children: a
|
|
28329
|
-
})]
|
|
28330
|
-
})]
|
|
28331
|
-
})
|
|
28332
|
-
});
|
|
28333
|
-
}
|
|
28334
|
-
function KA({ entry: e, current: t, onSelect: n }) {
|
|
28335
|
-
let r = e.status === "ok";
|
|
28336
|
-
return /* @__PURE__ */ H("button", {
|
|
28337
|
-
type: "button",
|
|
28338
|
-
"aria-current": t ? "true" : void 0,
|
|
28339
|
-
"data-testid": `provider-entry-pill-${e.entryId}`,
|
|
28340
|
-
onClick: () => n(e.entryId),
|
|
28341
|
-
className: J(BA, t ? VA : HA),
|
|
28342
|
-
children: [
|
|
28343
|
-
/* @__PURE__ */ V(qA, { url: e.iconUrl }),
|
|
28344
|
-
/* @__PURE__ */ V("span", {
|
|
28345
|
-
className: "truncate",
|
|
28346
|
-
children: e.name
|
|
28347
|
-
}),
|
|
28348
|
-
/* @__PURE__ */ V("span", {
|
|
28349
|
-
className: J("h-1.5 w-1.5 shrink-0 rounded-full", UA[e.status]),
|
|
28350
|
-
"aria-hidden": !0
|
|
28351
|
-
}),
|
|
28352
|
-
/* @__PURE__ */ V("span", {
|
|
28353
|
-
className: r ? "sr-only" : "shrink-0 text-[10px] font-normal text-foreground-subtle",
|
|
28354
|
-
children: WA[e.status]
|
|
28355
|
-
})
|
|
28356
|
-
]
|
|
28357
|
-
});
|
|
28358
|
-
}
|
|
28359
|
-
function qA({ url: e }) {
|
|
28360
|
-
return e === null ? /* @__PURE__ */ V("span", {
|
|
28361
|
-
className: "inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-surface text-[9px] text-foreground-subtle",
|
|
28362
|
-
"aria-hidden": !0,
|
|
28363
|
-
children: "?"
|
|
28364
|
-
}) : /* @__PURE__ */ V("img", {
|
|
28365
|
-
src: e,
|
|
28366
|
-
alt: "",
|
|
28367
|
-
className: "h-5 w-5 shrink-0 rounded-full object-contain"
|
|
28368
|
-
});
|
|
28369
|
-
}
|
|
28370
|
-
//#endregion
|
|
28371
28201
|
//#region ../ui-library/src/composites/snapshot-button.tsx
|
|
28372
|
-
i(), i(), i();
|
|
28202
|
+
i(), i(), J(P, "min-w-0 max-w-full gap-1.5 py-1 pl-1 pr-2.5 text-xs font-normal", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40"), J(ne, "font-medium"), i(), i(), i();
|
|
28373
28203
|
//#endregion
|
|
28374
28204
|
//#region ../ui-library/src/composites/stat-card.tsx
|
|
28375
|
-
function
|
|
28205
|
+
function RA({ value: e, label: t, icon: n, subtext: r, valueClassName: i, trend: a, className: o }) {
|
|
28376
28206
|
return /* @__PURE__ */ H("div", {
|
|
28377
28207
|
className: J("rounded-lg border border-border bg-surface p-2 sm:p-2.5 min-w-0", o),
|
|
28378
28208
|
children: [
|
|
@@ -28410,7 +28240,7 @@ function JA({ value: e, label: t, icon: n, subtext: r, valueClassName: i, trend:
|
|
|
28410
28240
|
//#endregion
|
|
28411
28241
|
//#region ../ui-library/src/composites/step-inspector/step-inspector-panel.tsx
|
|
28412
28242
|
i(), i();
|
|
28413
|
-
function
|
|
28243
|
+
function zA({ dirtyCount: e, saving: t, status: n, error: r, onSave: i, onDiscard: a, scope: o }) {
|
|
28414
28244
|
let s = e > 0, c = t ? "Saving…" : s ? `${e} unsaved change${e === 1 ? "" : "s"}` : n === "saved" ? "Saved" : n === "error" ? r ?? "Save failed" : "No unsaved changes";
|
|
28415
28245
|
return /* @__PURE__ */ H("footer", {
|
|
28416
28246
|
className: "shrink-0 space-y-2 border-t border-border bg-surface px-4 py-2 pb-[max(0.5rem,env(safe-area-inset-bottom))] md:pb-2",
|
|
@@ -28483,16 +28313,16 @@ _(function({ title: e, subtitle: t, headerActions: n, headerExtra: r, leading: i
|
|
|
28483
28313
|
className: "min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 py-3",
|
|
28484
28314
|
children: s
|
|
28485
28315
|
}),
|
|
28486
|
-
a !== void 0 && /* @__PURE__ */ V(
|
|
28316
|
+
a !== void 0 && /* @__PURE__ */ V(zA, { ...a })
|
|
28487
28317
|
]
|
|
28488
28318
|
});
|
|
28489
28319
|
}), i(), i(), i();
|
|
28490
28320
|
//#endregion
|
|
28491
28321
|
//#region ../ui-library/src/composites/device-picker/device-picker-model.ts
|
|
28492
|
-
function
|
|
28322
|
+
function BA(e, t) {
|
|
28493
28323
|
return typeof e == "number" && typeof t == "number" ? e - t : String(e).localeCompare(String(t));
|
|
28494
28324
|
}
|
|
28495
|
-
function
|
|
28325
|
+
function VA(e) {
|
|
28496
28326
|
return `${[
|
|
28497
28327
|
e.name,
|
|
28498
28328
|
e.location ?? "",
|
|
@@ -28500,29 +28330,29 @@ function ZA(e) {
|
|
|
28500
28330
|
e.detail ?? ""
|
|
28501
28331
|
].join(" ")} ${String(e.id)}`.toLowerCase();
|
|
28502
28332
|
}
|
|
28503
|
-
function
|
|
28333
|
+
function HA(e) {
|
|
28504
28334
|
return e.trim().toLowerCase().split(/\s+/).filter((e) => e.length > 0);
|
|
28505
28335
|
}
|
|
28506
|
-
function
|
|
28507
|
-
let n =
|
|
28336
|
+
function UA(e, t) {
|
|
28337
|
+
let n = HA(t);
|
|
28508
28338
|
return n.length === 0 ? e : e.filter((e) => {
|
|
28509
|
-
let t =
|
|
28339
|
+
let t = VA(e);
|
|
28510
28340
|
return n.every((e) => t.includes(e));
|
|
28511
28341
|
});
|
|
28512
28342
|
}
|
|
28513
|
-
function
|
|
28343
|
+
function WA(e, t) {
|
|
28514
28344
|
return e === t ? 0 : e === null ? 1 : t === null ? -1 : e.localeCompare(t);
|
|
28515
28345
|
}
|
|
28516
|
-
function
|
|
28346
|
+
function GA(e) {
|
|
28517
28347
|
return e == null || e.trim() === "" ? null : e;
|
|
28518
28348
|
}
|
|
28519
|
-
function
|
|
28349
|
+
function KA(e, t) {
|
|
28520
28350
|
return `${e ?? ""}|${t ?? ""}`;
|
|
28521
28351
|
}
|
|
28522
|
-
function
|
|
28352
|
+
function qA(e, t) {
|
|
28523
28353
|
let n = new Set(t), r = /* @__PURE__ */ new Map();
|
|
28524
28354
|
for (let t of e) {
|
|
28525
|
-
let e =
|
|
28355
|
+
let e = GA(t.type), n = GA(t.location), i = KA(e, n), a = r.get(i);
|
|
28526
28356
|
a === void 0 ? r.set(i, {
|
|
28527
28357
|
type: e,
|
|
28528
28358
|
location: n,
|
|
@@ -28531,7 +28361,7 @@ function rj(e, t) {
|
|
|
28531
28361
|
}
|
|
28532
28362
|
let i = [];
|
|
28533
28363
|
for (let [e, t] of r) {
|
|
28534
|
-
let r = [...t.devices].sort((e, t) => e.name.localeCompare(t.name) ||
|
|
28364
|
+
let r = [...t.devices].sort((e, t) => e.name.localeCompare(t.name) || BA(e.id, t.id));
|
|
28535
28365
|
i.push({
|
|
28536
28366
|
key: e,
|
|
28537
28367
|
type: t.type,
|
|
@@ -28540,16 +28370,16 @@ function rj(e, t) {
|
|
|
28540
28370
|
selectedCount: r.filter((e) => n.has(e.id)).length
|
|
28541
28371
|
});
|
|
28542
28372
|
}
|
|
28543
|
-
return i.sort((e, t) =>
|
|
28373
|
+
return i.sort((e, t) => WA(e.type, t.type) || WA(e.location, t.location));
|
|
28544
28374
|
}
|
|
28545
|
-
function
|
|
28375
|
+
function JA(e, t, n) {
|
|
28546
28376
|
let r = t.get(e.key);
|
|
28547
28377
|
return r === void 0 ? n || e.selectedCount > 0 ? !0 : e.devices.length <= 8 : r;
|
|
28548
28378
|
}
|
|
28549
|
-
function
|
|
28379
|
+
function YA(e, t, n, r) {
|
|
28550
28380
|
let i = new Set(t), a = [];
|
|
28551
28381
|
for (let t of e) {
|
|
28552
|
-
let e =
|
|
28382
|
+
let e = JA(t, n, r);
|
|
28553
28383
|
if (a.push({
|
|
28554
28384
|
kind: "header",
|
|
28555
28385
|
key: `h:${t.key}`,
|
|
@@ -28565,19 +28395,19 @@ function aj(e, t, n, r) {
|
|
|
28565
28395
|
}
|
|
28566
28396
|
return a;
|
|
28567
28397
|
}
|
|
28568
|
-
function
|
|
28398
|
+
function XA(e, t) {
|
|
28569
28399
|
return e.includes(t) ? e.filter((e) => e !== t) : [...e, t];
|
|
28570
28400
|
}
|
|
28571
|
-
function
|
|
28401
|
+
function ZA(e, t) {
|
|
28572
28402
|
let n = [...e], r = new Set(e);
|
|
28573
28403
|
for (let e of t.devices) r.has(e.id) || n.push(e.id);
|
|
28574
28404
|
return n;
|
|
28575
28405
|
}
|
|
28576
|
-
function
|
|
28406
|
+
function QA(e, t) {
|
|
28577
28407
|
let n = new Set(t.devices.map((e) => e.id));
|
|
28578
28408
|
return e.filter((e) => !n.has(e));
|
|
28579
28409
|
}
|
|
28580
|
-
function
|
|
28410
|
+
function $A(e, t) {
|
|
28581
28411
|
return t || e.length <= 6 ? {
|
|
28582
28412
|
shown: e,
|
|
28583
28413
|
hidden: 0
|
|
@@ -28586,51 +28416,51 @@ function lj(e, t) {
|
|
|
28586
28416
|
hidden: e.length - 6
|
|
28587
28417
|
};
|
|
28588
28418
|
}
|
|
28589
|
-
function
|
|
28419
|
+
function ej(e, t) {
|
|
28590
28420
|
let n = Math.max(0, Math.min(e.length, t));
|
|
28591
28421
|
return {
|
|
28592
28422
|
rows: e.slice(0, n),
|
|
28593
28423
|
remaining: e.length - n
|
|
28594
28424
|
};
|
|
28595
28425
|
}
|
|
28596
|
-
var
|
|
28426
|
+
var tj = [
|
|
28597
28427
|
"zone",
|
|
28598
28428
|
"location",
|
|
28599
28429
|
"none"
|
|
28600
|
-
],
|
|
28601
|
-
function
|
|
28602
|
-
return e === "zone" || e === "location" || e === "none" ? e :
|
|
28430
|
+
], nj = "zone";
|
|
28431
|
+
function rj(e) {
|
|
28432
|
+
return e === "zone" || e === "location" || e === "none" ? e : nj;
|
|
28603
28433
|
}
|
|
28604
|
-
function
|
|
28434
|
+
function ij(e) {
|
|
28605
28435
|
return e.trim().toLowerCase();
|
|
28606
28436
|
}
|
|
28607
|
-
var
|
|
28608
|
-
function
|
|
28609
|
-
return e.name.localeCompare(t.name) ||
|
|
28437
|
+
var aj = 1, oj = 2;
|
|
28438
|
+
function sj(e, t) {
|
|
28439
|
+
return e.name.localeCompare(t.name) || BA(e.id, t.id);
|
|
28610
28440
|
}
|
|
28611
|
-
function
|
|
28441
|
+
function cj(e) {
|
|
28612
28442
|
return e.kind === "zone" || e.kind === "location" ? e.label : "";
|
|
28613
28443
|
}
|
|
28614
|
-
var
|
|
28444
|
+
var lj = {
|
|
28615
28445
|
key: "-location",
|
|
28616
28446
|
heading: { kind: "no-location" },
|
|
28617
|
-
rank:
|
|
28618
|
-
},
|
|
28447
|
+
rank: oj
|
|
28448
|
+
}, uj = {
|
|
28619
28449
|
key: "-zone",
|
|
28620
28450
|
heading: { kind: "no-zone" },
|
|
28621
|
-
rank:
|
|
28451
|
+
rank: aj
|
|
28622
28452
|
};
|
|
28623
|
-
function
|
|
28453
|
+
function dj(e) {
|
|
28624
28454
|
let t = /* @__PURE__ */ new Map();
|
|
28625
28455
|
for (let n of e) for (let e of n.locationKeys) {
|
|
28626
|
-
let r =
|
|
28456
|
+
let r = ij(e);
|
|
28627
28457
|
t.has(r) || t.set(r, n);
|
|
28628
28458
|
}
|
|
28629
28459
|
return t;
|
|
28630
28460
|
}
|
|
28631
|
-
function
|
|
28632
|
-
return e === null ?
|
|
28633
|
-
key: `l:${
|
|
28461
|
+
function fj(e) {
|
|
28462
|
+
return e === null ? lj : {
|
|
28463
|
+
key: `l:${ij(e)}`,
|
|
28634
28464
|
heading: {
|
|
28635
28465
|
kind: "location",
|
|
28636
28466
|
label: e.trim()
|
|
@@ -28638,10 +28468,10 @@ function Sj(e) {
|
|
|
28638
28468
|
rank: 0
|
|
28639
28469
|
};
|
|
28640
28470
|
}
|
|
28641
|
-
function
|
|
28642
|
-
if (e === null) return
|
|
28643
|
-
let n = t.get(
|
|
28644
|
-
return n === void 0 ?
|
|
28471
|
+
function pj(e, t) {
|
|
28472
|
+
if (e === null) return lj;
|
|
28473
|
+
let n = t.get(ij(e));
|
|
28474
|
+
return n === void 0 ? uj : {
|
|
28645
28475
|
key: `z:${n.zoneKey}`,
|
|
28646
28476
|
heading: {
|
|
28647
28477
|
kind: "zone",
|
|
@@ -28650,8 +28480,8 @@ function Cj(e, t) {
|
|
|
28650
28480
|
rank: 0
|
|
28651
28481
|
};
|
|
28652
28482
|
}
|
|
28653
|
-
function
|
|
28654
|
-
let i = new Set(t), a = [...e].sort(
|
|
28483
|
+
function mj(e, t, n, r) {
|
|
28484
|
+
let i = new Set(t), a = [...e].sort(sj), o = (e) => e.filter((e) => i.has(e.id)).length;
|
|
28655
28485
|
if (n === "none") return {
|
|
28656
28486
|
groupBy: n,
|
|
28657
28487
|
fallback: null,
|
|
@@ -28664,9 +28494,9 @@ function wj(e, t, n, r) {
|
|
|
28664
28494
|
selectedCount: o(a)
|
|
28665
28495
|
}]
|
|
28666
28496
|
};
|
|
28667
|
-
let s = n === "zone" && r.state !== "answered" ? r.state : null, c = s === null ? n : "location", l = r.state === "answered" ?
|
|
28497
|
+
let s = n === "zone" && r.state !== "answered" ? r.state : null, c = s === null ? n : "location", l = r.state === "answered" ? dj(r.zones) : /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map();
|
|
28668
28498
|
for (let e of a) {
|
|
28669
|
-
let t =
|
|
28499
|
+
let t = GA(e.location), n = c === "zone" ? pj(t, l) : fj(t), r = u.get(n.key);
|
|
28670
28500
|
r === void 0 ? u.set(n.key, {
|
|
28671
28501
|
heading: n.heading,
|
|
28672
28502
|
rank: n.rank,
|
|
@@ -28677,7 +28507,7 @@ function wj(e, t, n, r) {
|
|
|
28677
28507
|
groupBy: c,
|
|
28678
28508
|
fallback: s,
|
|
28679
28509
|
flat: !1,
|
|
28680
|
-
groups: [...u].sort(([, e], [, t]) => e.rank - t.rank ||
|
|
28510
|
+
groups: [...u].sort(([, e], [, t]) => e.rank - t.rank || cj(e.heading).localeCompare(cj(t.heading))).map(([e, t]) => ({
|
|
28681
28511
|
key: e,
|
|
28682
28512
|
type: null,
|
|
28683
28513
|
location: t.heading.kind === "location" ? t.heading.label : null,
|
|
@@ -28687,8 +28517,8 @@ function wj(e, t, n, r) {
|
|
|
28687
28517
|
}))
|
|
28688
28518
|
};
|
|
28689
28519
|
}
|
|
28690
|
-
function
|
|
28691
|
-
if (!e.flat) return
|
|
28520
|
+
function hj(e, t, n, r) {
|
|
28521
|
+
if (!e.flat) return YA(e.groups, t, n, r);
|
|
28692
28522
|
let i = new Set(t), a = [];
|
|
28693
28523
|
for (let t of e.groups) for (let e of t.devices) a.push({
|
|
28694
28524
|
kind: "device",
|
|
@@ -28699,53 +28529,53 @@ function Tj(e, t, n, r) {
|
|
|
28699
28529
|
});
|
|
28700
28530
|
return a;
|
|
28701
28531
|
}
|
|
28702
|
-
function
|
|
28532
|
+
function gj(e, t) {
|
|
28703
28533
|
return {
|
|
28704
|
-
location: t === "location" ? null :
|
|
28705
|
-
type:
|
|
28534
|
+
location: t === "location" ? null : GA(e.location),
|
|
28535
|
+
type: GA(e.type)
|
|
28706
28536
|
};
|
|
28707
28537
|
}
|
|
28708
|
-
var
|
|
28538
|
+
var _j = "(none)", vj = {
|
|
28709
28539
|
query: "",
|
|
28710
28540
|
types: [],
|
|
28711
28541
|
zones: [],
|
|
28712
28542
|
locations: []
|
|
28713
|
-
},
|
|
28714
|
-
key:
|
|
28543
|
+
}, yj = {
|
|
28544
|
+
key: _j,
|
|
28715
28545
|
label: null
|
|
28716
28546
|
};
|
|
28717
|
-
function
|
|
28547
|
+
function bj(e, t, n) {
|
|
28718
28548
|
if (t === "type") {
|
|
28719
|
-
let t =
|
|
28720
|
-
return t === null ?
|
|
28549
|
+
let t = GA(e.type);
|
|
28550
|
+
return t === null ? yj : {
|
|
28721
28551
|
key: t,
|
|
28722
28552
|
label: t
|
|
28723
28553
|
};
|
|
28724
28554
|
}
|
|
28725
|
-
let r =
|
|
28726
|
-
if (r === null) return
|
|
28555
|
+
let r = GA(e.location);
|
|
28556
|
+
if (r === null) return yj;
|
|
28727
28557
|
if (t === "location") return {
|
|
28728
|
-
key:
|
|
28558
|
+
key: ij(r),
|
|
28729
28559
|
label: r.trim()
|
|
28730
28560
|
};
|
|
28731
|
-
if (n.state !== "answered") return
|
|
28732
|
-
let i =
|
|
28733
|
-
return i === void 0 ?
|
|
28561
|
+
if (n.state !== "answered") return yj;
|
|
28562
|
+
let i = dj(n.zones).get(ij(r));
|
|
28563
|
+
return i === void 0 ? yj : {
|
|
28734
28564
|
key: i.zoneKey,
|
|
28735
28565
|
label: i.label
|
|
28736
28566
|
};
|
|
28737
28567
|
}
|
|
28738
|
-
function
|
|
28739
|
-
return
|
|
28568
|
+
function xj(e, t, n) {
|
|
28569
|
+
return bj(e, t, n).key;
|
|
28740
28570
|
}
|
|
28741
|
-
function
|
|
28571
|
+
function Sj(e, t) {
|
|
28742
28572
|
return e.key === "(none)" || t.key === "(none)" ? e.key === t.key ? 0 : e.key === "(none)" ? 1 : -1 : (e.label ?? "").localeCompare(t.label ?? "");
|
|
28743
28573
|
}
|
|
28744
|
-
function
|
|
28574
|
+
function Cj(e, t, n, r) {
|
|
28745
28575
|
if (t === "zone" && r.state !== "answered") return [];
|
|
28746
28576
|
let i = /* @__PURE__ */ new Map();
|
|
28747
28577
|
for (let n of e) {
|
|
28748
|
-
let e =
|
|
28578
|
+
let e = bj(n, t, r), a = i.get(e.key);
|
|
28749
28579
|
a === void 0 ? i.set(e.key, {
|
|
28750
28580
|
label: e.label,
|
|
28751
28581
|
count: 1
|
|
@@ -28761,59 +28591,59 @@ function Nj(e, t, n, r) {
|
|
|
28761
28591
|
label: t.label,
|
|
28762
28592
|
count: t.count
|
|
28763
28593
|
});
|
|
28764
|
-
return a.sort(
|
|
28594
|
+
return a.sort(Sj);
|
|
28765
28595
|
}
|
|
28766
|
-
function
|
|
28596
|
+
function wj(e, t) {
|
|
28767
28597
|
return e.zones.length > 0 && t.state !== "answered";
|
|
28768
28598
|
}
|
|
28769
|
-
function
|
|
28770
|
-
return n.length === 0 ? e : e.filter((e) => n.includes(
|
|
28599
|
+
function Tj(e, t, n, r) {
|
|
28600
|
+
return n.length === 0 ? e : e.filter((e) => n.includes(xj(e, t, r)));
|
|
28771
28601
|
}
|
|
28772
|
-
function
|
|
28773
|
-
let r =
|
|
28774
|
-
return
|
|
28602
|
+
function Ej(e, t, n) {
|
|
28603
|
+
let r = Tj(UA(e, t.query), "type", t.types, n);
|
|
28604
|
+
return Tj(n.state === "answered" ? Tj(r, "zone", t.zones, n) : r, "location", t.locations, n);
|
|
28775
28605
|
}
|
|
28776
|
-
function
|
|
28606
|
+
function Dj(e, t) {
|
|
28777
28607
|
return e.includes(t) ? e.filter((e) => e !== t) : [...e, t];
|
|
28778
28608
|
}
|
|
28779
|
-
function
|
|
28609
|
+
function Oj(e) {
|
|
28780
28610
|
return e.query.trim() !== "" || e.types.length > 0 || e.zones.length > 0 || e.locations.length > 0;
|
|
28781
28611
|
}
|
|
28782
|
-
function
|
|
28783
|
-
return
|
|
28612
|
+
function kj() {
|
|
28613
|
+
return vj;
|
|
28784
28614
|
}
|
|
28785
|
-
function
|
|
28615
|
+
function Aj(e, t, n) {
|
|
28786
28616
|
let r = new Set(t.map((e) => e.id)), i = new Set(n.map((e) => e.id));
|
|
28787
28617
|
return e.filter((e) => r.has(e) && !i.has(e)).length;
|
|
28788
28618
|
}
|
|
28789
|
-
function
|
|
28619
|
+
function jj(e, t) {
|
|
28790
28620
|
return e.length >= 2 || t.length > 0;
|
|
28791
28621
|
}
|
|
28792
28622
|
//#endregion
|
|
28793
28623
|
//#region ../ui-library/src/composites/device-picker/device-filter-bar.tsx
|
|
28794
28624
|
i();
|
|
28795
|
-
function
|
|
28625
|
+
function Mj(e) {
|
|
28796
28626
|
if (e === null) return "No type";
|
|
28797
28627
|
let t = e.replaceAll("-", " ");
|
|
28798
28628
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
28799
28629
|
}
|
|
28800
|
-
var
|
|
28630
|
+
var Nj = {
|
|
28801
28631
|
zone: "Zone",
|
|
28802
28632
|
location: "Location",
|
|
28803
28633
|
none: "None"
|
|
28804
|
-
},
|
|
28634
|
+
}, Pj = {
|
|
28805
28635
|
type: "Type",
|
|
28806
28636
|
zone: "Zone",
|
|
28807
28637
|
location: "Location"
|
|
28808
|
-
},
|
|
28638
|
+
}, Fj = {
|
|
28809
28639
|
type: "No type",
|
|
28810
28640
|
zone: "No zone",
|
|
28811
28641
|
location: "No location"
|
|
28812
28642
|
};
|
|
28813
|
-
function
|
|
28814
|
-
return t.key === "(none)" || t.label === null ?
|
|
28643
|
+
function Ij(e, t) {
|
|
28644
|
+
return t.key === "(none)" || t.label === null ? Fj[e] : e === "type" ? Mj(t.label) : t.label;
|
|
28815
28645
|
}
|
|
28816
|
-
function
|
|
28646
|
+
function Lj({ grouping: e }) {
|
|
28817
28647
|
return /* @__PURE__ */ H("div", {
|
|
28818
28648
|
className: "mb-1.5",
|
|
28819
28649
|
children: [/* @__PURE__ */ H("div", {
|
|
@@ -28823,7 +28653,7 @@ function qj({ grouping: e }) {
|
|
|
28823
28653
|
children: [/* @__PURE__ */ V("span", {
|
|
28824
28654
|
className: "mr-1 font-semibold uppercase tracking-wide",
|
|
28825
28655
|
children: "Group by"
|
|
28826
|
-
}),
|
|
28656
|
+
}), tj.map((t) => {
|
|
28827
28657
|
let n = t === e.groupBy;
|
|
28828
28658
|
return /* @__PURE__ */ V("button", {
|
|
28829
28659
|
type: "button",
|
|
@@ -28831,7 +28661,7 @@ function qj({ grouping: e }) {
|
|
|
28831
28661
|
"aria-checked": n,
|
|
28832
28662
|
onClick: () => e.onGroupByChange(t),
|
|
28833
28663
|
className: n ? "rounded-md border border-primary bg-primary/10 px-1.5 py-0.5 text-[11px] text-primary" : "rounded-md border border-border px-1.5 py-0.5 text-[11px] text-foreground-subtle hover:bg-surface-hover",
|
|
28834
|
-
children:
|
|
28664
|
+
children: Nj[t]
|
|
28835
28665
|
}, t);
|
|
28836
28666
|
})]
|
|
28837
28667
|
}), e.fallback !== null && /* @__PURE__ */ V("p", {
|
|
@@ -28841,8 +28671,8 @@ function qj({ grouping: e }) {
|
|
|
28841
28671
|
})]
|
|
28842
28672
|
});
|
|
28843
28673
|
}
|
|
28844
|
-
function
|
|
28845
|
-
let o =
|
|
28674
|
+
function Rj({ facet: e, options: t, chosen: n, onChange: r, unavailable: i, disabled: a }) {
|
|
28675
|
+
let o = Pj[e], s = i === void 0 ? n.length === 0 ? "All" : `${String(n.length)} selected` : i;
|
|
28846
28676
|
return /* @__PURE__ */ V("div", {
|
|
28847
28677
|
"data-testid": `picker-filter-${e}`,
|
|
28848
28678
|
children: /* @__PURE__ */ H(gg, { children: [/* @__PURE__ */ H(_g, {
|
|
@@ -28856,13 +28686,13 @@ function Jj({ facet: e, options: t, chosen: n, onChange: r, unavailable: i, disa
|
|
|
28856
28686
|
}), /* @__PURE__ */ V(vg, {
|
|
28857
28687
|
className: "min-w-[200px] max-h-[40vh] overflow-y-auto p-1",
|
|
28858
28688
|
children: t.map((t) => {
|
|
28859
|
-
let i =
|
|
28689
|
+
let i = Ij(e, t);
|
|
28860
28690
|
return /* @__PURE__ */ H("label", {
|
|
28861
28691
|
className: "flex cursor-pointer items-center gap-2 px-2 py-1 text-xs text-foreground hover:bg-surface-hover",
|
|
28862
28692
|
children: [
|
|
28863
28693
|
/* @__PURE__ */ V(ag, {
|
|
28864
28694
|
checked: n.includes(t.key),
|
|
28865
|
-
onChange: () => r(
|
|
28695
|
+
onChange: () => r(Dj(n, t.key)),
|
|
28866
28696
|
"aria-label": i
|
|
28867
28697
|
}),
|
|
28868
28698
|
/* @__PURE__ */ V("span", {
|
|
@@ -28883,11 +28713,11 @@ function Jj({ facet: e, options: t, chosen: n, onChange: r, unavailable: i, disa
|
|
|
28883
28713
|
})] })
|
|
28884
28714
|
});
|
|
28885
28715
|
}
|
|
28886
|
-
function
|
|
28716
|
+
function zj(e) {
|
|
28887
28717
|
if (e.state === "pending") return "loading zones…";
|
|
28888
28718
|
if (e.state === "failed") return "zones unavailable";
|
|
28889
28719
|
}
|
|
28890
|
-
function
|
|
28720
|
+
function Bj({ filters: e, onFiltersChange: t, typeOptions: n, zoneOptions: r, locationOptions: i, zones: o, grouping: s, searchPlaceholder: c, searchLabel: l, disabled: d = !1 }) {
|
|
28891
28721
|
let [f, p] = a(e.query), m = u({
|
|
28892
28722
|
filters: e,
|
|
28893
28723
|
onFiltersChange: t
|
|
@@ -28903,12 +28733,12 @@ function Xj({ filters: e, onFiltersChange: t, typeOptions: n, zoneOptions: r, lo
|
|
|
28903
28733
|
}), 200);
|
|
28904
28734
|
return () => clearTimeout(e);
|
|
28905
28735
|
}, [f]);
|
|
28906
|
-
let h =
|
|
28736
|
+
let h = zj(o), g = h !== void 0 || jj(r, e.zones), _ = Oj(e) || f.trim() !== "";
|
|
28907
28737
|
return /* @__PURE__ */ H("div", {
|
|
28908
28738
|
className: "space-y-1.5",
|
|
28909
28739
|
"data-testid": "device-filter-bar",
|
|
28910
28740
|
children: [
|
|
28911
|
-
s !== void 0 && /* @__PURE__ */ V(
|
|
28741
|
+
s !== void 0 && /* @__PURE__ */ V(Lj, { grouping: s }),
|
|
28912
28742
|
/* @__PURE__ */ H("div", {
|
|
28913
28743
|
className: pl,
|
|
28914
28744
|
children: [/* @__PURE__ */ V(pi, { className: "h-3.5 w-3.5 shrink-0 text-foreground-subtle" }), /* @__PURE__ */ V("input", {
|
|
@@ -28923,7 +28753,7 @@ function Xj({ filters: e, onFiltersChange: t, typeOptions: n, zoneOptions: r, lo
|
|
|
28923
28753
|
/* @__PURE__ */ H("div", {
|
|
28924
28754
|
className: "flex flex-wrap items-center gap-1",
|
|
28925
28755
|
children: [
|
|
28926
|
-
|
|
28756
|
+
jj(n, e.types) && /* @__PURE__ */ V(Rj, {
|
|
28927
28757
|
facet: "type",
|
|
28928
28758
|
options: n,
|
|
28929
28759
|
chosen: e.types,
|
|
@@ -28933,7 +28763,7 @@ function Xj({ filters: e, onFiltersChange: t, typeOptions: n, zoneOptions: r, lo
|
|
|
28933
28763
|
}),
|
|
28934
28764
|
disabled: d
|
|
28935
28765
|
}),
|
|
28936
|
-
g && /* @__PURE__ */ V(
|
|
28766
|
+
g && /* @__PURE__ */ V(Rj, {
|
|
28937
28767
|
facet: "zone",
|
|
28938
28768
|
options: r,
|
|
28939
28769
|
chosen: e.zones,
|
|
@@ -28944,7 +28774,7 @@ function Xj({ filters: e, onFiltersChange: t, typeOptions: n, zoneOptions: r, lo
|
|
|
28944
28774
|
...h === void 0 ? {} : { unavailable: h },
|
|
28945
28775
|
disabled: d
|
|
28946
28776
|
}),
|
|
28947
|
-
|
|
28777
|
+
jj(i, e.locations) && /* @__PURE__ */ V(Rj, {
|
|
28948
28778
|
facet: "location",
|
|
28949
28779
|
options: i,
|
|
28950
28780
|
chosen: e.locations,
|
|
@@ -28958,13 +28788,13 @@ function Xj({ filters: e, onFiltersChange: t, typeOptions: n, zoneOptions: r, lo
|
|
|
28958
28788
|
variant: "ghost",
|
|
28959
28789
|
"data-testid": "picker-reset-filters",
|
|
28960
28790
|
onClick: () => {
|
|
28961
|
-
p(""), t(
|
|
28791
|
+
p(""), t(kj());
|
|
28962
28792
|
},
|
|
28963
28793
|
children: "Reset filters"
|
|
28964
28794
|
})
|
|
28965
28795
|
]
|
|
28966
28796
|
}),
|
|
28967
|
-
|
|
28797
|
+
wj(e, o) && /* @__PURE__ */ V("p", {
|
|
28968
28798
|
className: "text-[10px] text-foreground-subtle",
|
|
28969
28799
|
"data-testid": "picker-zone-filter-paused",
|
|
28970
28800
|
children: "Zone filter paused — zones not loaded"
|
|
@@ -28974,7 +28804,7 @@ function Xj({ filters: e, onFiltersChange: t, typeOptions: n, zoneOptions: r, lo
|
|
|
28974
28804
|
}
|
|
28975
28805
|
//#endregion
|
|
28976
28806
|
//#region ../ui-library/src/composites/device-picker/device-parent.ts
|
|
28977
|
-
function
|
|
28807
|
+
function Vj(e) {
|
|
28978
28808
|
let t = /* @__PURE__ */ new Map();
|
|
28979
28809
|
for (let n of e) t.set(n.id, n.name);
|
|
28980
28810
|
let n = /* @__PURE__ */ new Map();
|
|
@@ -28984,19 +28814,19 @@ function Zj(e) {
|
|
|
28984
28814
|
}
|
|
28985
28815
|
return n;
|
|
28986
28816
|
}
|
|
28987
|
-
function
|
|
28817
|
+
function Hj(e) {
|
|
28988
28818
|
if (!(e === void 0 || e.length === 0)) return `in ${e}`;
|
|
28989
28819
|
}
|
|
28990
|
-
function
|
|
28820
|
+
function Uj(e) {
|
|
28991
28821
|
let t = e.filter((e) => typeof e.id == "number");
|
|
28992
28822
|
if (t.length === 0) return e;
|
|
28993
|
-
let n =
|
|
28823
|
+
let n = Vj(t.map((e) => ({
|
|
28994
28824
|
id: e.id,
|
|
28995
28825
|
name: e.name,
|
|
28996
28826
|
parentDeviceId: e.parentDeviceId ?? null
|
|
28997
28827
|
}))), r = !1, i = e.map((e) => {
|
|
28998
28828
|
if (e.detail !== void 0 || typeof e.id != "number") return e;
|
|
28999
|
-
let t =
|
|
28829
|
+
let t = Hj(n.get(e.id));
|
|
29000
28830
|
return t === void 0 ? e : (r = !0, {
|
|
29001
28831
|
...e,
|
|
29002
28832
|
detail: t
|
|
@@ -29007,34 +28837,34 @@ function $j(e) {
|
|
|
29007
28837
|
//#endregion
|
|
29008
28838
|
//#region ../ui-library/src/composites/device-picker/device-picker-grouping.ts
|
|
29009
28839
|
i();
|
|
29010
|
-
var
|
|
29011
|
-
function
|
|
28840
|
+
var Wj = "camstack.admin.device-picker.group-by", Gj = [["deviceManager", "listSiteZones"], "device-picker"], Kj = 6e4;
|
|
28841
|
+
function qj() {
|
|
29012
28842
|
try {
|
|
29013
28843
|
let e = globalThis.localStorage?.getItem("camstack.admin.device-picker.group-by") ?? null;
|
|
29014
|
-
return e === null ?
|
|
28844
|
+
return e === null ? nj : rj(e);
|
|
29015
28845
|
} catch {
|
|
29016
|
-
return
|
|
28846
|
+
return nj;
|
|
29017
28847
|
}
|
|
29018
28848
|
}
|
|
29019
|
-
function
|
|
28849
|
+
function Jj(e) {
|
|
29020
28850
|
try {
|
|
29021
|
-
globalThis.localStorage?.setItem(
|
|
28851
|
+
globalThis.localStorage?.setItem(Wj, e);
|
|
29022
28852
|
} catch {}
|
|
29023
28853
|
}
|
|
29024
|
-
function
|
|
29025
|
-
let [e, t] = a(
|
|
28854
|
+
function Yj() {
|
|
28855
|
+
let [e, t] = a(qj);
|
|
29026
28856
|
return {
|
|
29027
28857
|
groupBy: e,
|
|
29028
28858
|
setGroupBy: (e) => {
|
|
29029
|
-
t(e),
|
|
28859
|
+
t(e), Jj(e);
|
|
29030
28860
|
}
|
|
29031
28861
|
};
|
|
29032
28862
|
}
|
|
29033
|
-
function
|
|
28863
|
+
function Xj(e) {
|
|
29034
28864
|
let t = ie().trpcClient, { data: n, isError: r } = ft({
|
|
29035
|
-
queryKey:
|
|
28865
|
+
queryKey: Gj,
|
|
29036
28866
|
enabled: e,
|
|
29037
|
-
staleTime:
|
|
28867
|
+
staleTime: Kj,
|
|
29038
28868
|
queryFn: () => t.deviceManager.listSiteZones.query()
|
|
29039
28869
|
});
|
|
29040
28870
|
return m(() => n === void 0 ? r ? { state: "failed" } : { state: "pending" } : {
|
|
@@ -29044,10 +28874,10 @@ function oM(e) {
|
|
|
29044
28874
|
}
|
|
29045
28875
|
//#endregion
|
|
29046
28876
|
//#region ../ui-library/src/composites/device-picker/device-selection.ts
|
|
29047
|
-
function
|
|
28877
|
+
function Zj(e) {
|
|
29048
28878
|
return e.data === void 0 ? e.isError ? "failed" : "pending" : "answered";
|
|
29049
28879
|
}
|
|
29050
|
-
function
|
|
28880
|
+
function Qj(e, t, n) {
|
|
29051
28881
|
if (n !== "answered" || t === void 0) return e.map((e) => ({
|
|
29052
28882
|
id: e,
|
|
29053
28883
|
removed: !1
|
|
@@ -29065,19 +28895,19 @@ function cM(e, t, n) {
|
|
|
29065
28895
|
};
|
|
29066
28896
|
});
|
|
29067
28897
|
}
|
|
29068
|
-
function
|
|
28898
|
+
function $j(e, t, n, r) {
|
|
29069
28899
|
let i = new Set((t ?? []).map((e) => e.id));
|
|
29070
|
-
return
|
|
28900
|
+
return Qj(e.filter((e) => !i.has(e)), n, r);
|
|
29071
28901
|
}
|
|
29072
|
-
function
|
|
28902
|
+
function eM(e, t, n) {
|
|
29073
28903
|
return e === "answered" && t === 0 && n === 0;
|
|
29074
28904
|
}
|
|
29075
|
-
function
|
|
28905
|
+
function tM(e, t, n) {
|
|
29076
28906
|
return e && t === 0 && n;
|
|
29077
28907
|
}
|
|
29078
28908
|
//#endregion
|
|
29079
28909
|
//#region ../ui-library/src/composites/device-picker/device-selection-rows.tsx
|
|
29080
|
-
var
|
|
28910
|
+
var nM = {
|
|
29081
28911
|
camera: "cameras",
|
|
29082
28912
|
device: "devices",
|
|
29083
28913
|
node: "nodes",
|
|
@@ -29087,7 +28917,7 @@ var fM = {
|
|
|
29087
28917
|
face: "faces",
|
|
29088
28918
|
calendar: "calendars"
|
|
29089
28919
|
};
|
|
29090
|
-
function
|
|
28920
|
+
function rM(e, t = "device") {
|
|
29091
28921
|
let n = String(e.id);
|
|
29092
28922
|
switch (t) {
|
|
29093
28923
|
case "node": return e.removed ? `Node ${n} — unknown to the hub` : e.name ?? `Node ${n}`;
|
|
@@ -29100,7 +28930,7 @@ function pM(e, t = "device") {
|
|
|
29100
28930
|
case "device": return e.removed ? `Device #${n} — removed` : e.name ?? `Device #${n}`;
|
|
29101
28931
|
}
|
|
29102
28932
|
}
|
|
29103
|
-
function
|
|
28933
|
+
function iM({ noun: e = "camera" }) {
|
|
29104
28934
|
return /* @__PURE__ */ H("p", {
|
|
29105
28935
|
className: "mt-1 text-[11px] text-warning",
|
|
29106
28936
|
"data-testid": "devices-widen-warning",
|
|
@@ -29108,12 +28938,12 @@ function mM({ noun: e = "camera" }) {
|
|
|
29108
28938
|
"No ",
|
|
29109
28939
|
e,
|
|
29110
28940
|
" selected: the rule will apply to ALL ",
|
|
29111
|
-
|
|
28941
|
+
nM[e],
|
|
29112
28942
|
"."
|
|
29113
28943
|
]
|
|
29114
28944
|
});
|
|
29115
28945
|
}
|
|
29116
|
-
function
|
|
28946
|
+
function aM({ noun: e = "cameras" }) {
|
|
29117
28947
|
return /* @__PURE__ */ H("p", {
|
|
29118
28948
|
className: "text-[11px] text-foreground-subtle",
|
|
29119
28949
|
children: [
|
|
@@ -29123,7 +28953,7 @@ function hM({ noun: e = "cameras" }) {
|
|
|
29123
28953
|
]
|
|
29124
28954
|
});
|
|
29125
28955
|
}
|
|
29126
|
-
function
|
|
28956
|
+
function oM({ noun: e = "devices" }) {
|
|
29127
28957
|
return /* @__PURE__ */ H("p", {
|
|
29128
28958
|
className: "text-[11px] text-warning",
|
|
29129
28959
|
children: [
|
|
@@ -29136,7 +28966,7 @@ function gM({ noun: e = "devices" }) {
|
|
|
29136
28966
|
//#endregion
|
|
29137
28967
|
//#region ../ui-library/src/composites/device-picker/DevicePicker.tsx
|
|
29138
28968
|
i();
|
|
29139
|
-
function
|
|
28969
|
+
function sM(e) {
|
|
29140
28970
|
switch (e.kind) {
|
|
29141
28971
|
case "zone":
|
|
29142
28972
|
case "location": return e.label;
|
|
@@ -29144,14 +28974,14 @@ function _M(e) {
|
|
|
29144
28974
|
case "no-location": return "No location";
|
|
29145
28975
|
}
|
|
29146
28976
|
}
|
|
29147
|
-
function
|
|
29148
|
-
return e.heading === void 0 ? `${
|
|
28977
|
+
function cM(e) {
|
|
28978
|
+
return e.heading === void 0 ? `${Mj(e.type)} · ${e.location ?? "No room"}` : sM(e.heading);
|
|
29149
28979
|
}
|
|
29150
|
-
function
|
|
28980
|
+
function lM(e) {
|
|
29151
28981
|
return e === "camera" || e === "device";
|
|
29152
28982
|
}
|
|
29153
|
-
function
|
|
29154
|
-
let i = new Map(t.map((e) => [e.id, e.name])), a = new Map(
|
|
28983
|
+
function uM(e, t, n, r) {
|
|
28984
|
+
let i = new Map(t.map((e) => [e.id, e.name])), a = new Map($j(e, t, n.devices, n.state).map((e) => [e.id, e]));
|
|
29155
28985
|
return e.map((e) => {
|
|
29156
28986
|
let t = i.get(e);
|
|
29157
28987
|
if (t !== void 0) return {
|
|
@@ -29165,34 +28995,34 @@ function bM(e, t, n, r) {
|
|
|
29165
28995
|
};
|
|
29166
28996
|
return {
|
|
29167
28997
|
id: e,
|
|
29168
|
-
label:
|
|
28998
|
+
label: rM(n, r),
|
|
29169
28999
|
removed: n.removed
|
|
29170
29000
|
};
|
|
29171
29001
|
});
|
|
29172
29002
|
}
|
|
29173
|
-
function
|
|
29174
|
-
let n =
|
|
29003
|
+
function dM(e, t) {
|
|
29004
|
+
let n = nM[e];
|
|
29175
29005
|
return t ? e === "camera" || e === "device" ? "No cameras available — the rule applies to all devices." : `No ${n} available — the rule applies to every ${e}.` : `No ${n} available.`;
|
|
29176
29006
|
}
|
|
29177
|
-
function
|
|
29178
|
-
let g = m(() =>
|
|
29007
|
+
function fM({ devices: e, listState: t, fleet: n, value: r, onChange: i, emptyMeansAll: o = !1, savedHadDevices: s = !1, noun: c = "camera", groupTitle: l = cM, emptyLabel: u, annotate: d, disabled: f = !1, testId: p, showAll: h = !1 }) {
|
|
29008
|
+
let g = m(() => Uj(e), [e]), _ = n ?? {
|
|
29179
29009
|
state: t,
|
|
29180
29010
|
devices: t === "answered" ? g : void 0
|
|
29181
29011
|
}, [v, y] = a(!1), [b, x] = a(!1), [S, C] = a(s || r.length > 0);
|
|
29182
29012
|
r.length > 0 && !S && C(!0);
|
|
29183
|
-
let w =
|
|
29184
|
-
return t === "answered" &&
|
|
29013
|
+
let w = uM(r, g, _, c), T = $A(w, b || h), E = v || h, D = tM(o, r.length, S), O = nM[c];
|
|
29014
|
+
return t === "answered" && eM(t, g.length, r.length) ? /* @__PURE__ */ H("div", {
|
|
29185
29015
|
"data-testid": p,
|
|
29186
29016
|
children: [/* @__PURE__ */ V("p", {
|
|
29187
29017
|
className: "text-[10px] text-foreground-subtle mt-0.5",
|
|
29188
|
-
children:
|
|
29189
|
-
}), D && /* @__PURE__ */ V(
|
|
29018
|
+
children: dM(c, o)
|
|
29019
|
+
}), D && /* @__PURE__ */ V(iM, { noun: c })]
|
|
29190
29020
|
}) : /* @__PURE__ */ H("div", {
|
|
29191
29021
|
className: "mt-1 space-y-1.5",
|
|
29192
29022
|
"data-testid": p,
|
|
29193
29023
|
children: [
|
|
29194
|
-
t === "pending" && /* @__PURE__ */ V(
|
|
29195
|
-
t === "failed" && /* @__PURE__ */ V(
|
|
29024
|
+
t === "pending" && /* @__PURE__ */ V(aM, { noun: O }),
|
|
29025
|
+
t === "failed" && /* @__PURE__ */ V(oM, { noun: c === "camera" ? "devices" : O }),
|
|
29196
29026
|
/* @__PURE__ */ H("div", {
|
|
29197
29027
|
className: "flex flex-wrap items-center gap-1",
|
|
29198
29028
|
children: [
|
|
@@ -29231,7 +29061,7 @@ function SM({ devices: e, listState: t, fleet: n, value: r, onChange: i, emptyMe
|
|
|
29231
29061
|
})
|
|
29232
29062
|
]
|
|
29233
29063
|
}),
|
|
29234
|
-
E && t === "answered" && (
|
|
29064
|
+
E && t === "answered" && (lM(c) ? /* @__PURE__ */ V(pM, {
|
|
29235
29065
|
devices: g,
|
|
29236
29066
|
value: r,
|
|
29237
29067
|
onChange: i,
|
|
@@ -29240,7 +29070,7 @@ function SM({ devices: e, listState: t, fleet: n, value: r, onChange: i, emptyMe
|
|
|
29240
29070
|
noun: c,
|
|
29241
29071
|
disabled: f,
|
|
29242
29072
|
showAll: h
|
|
29243
|
-
}) : /* @__PURE__ */ V(
|
|
29073
|
+
}) : /* @__PURE__ */ V(gM, {
|
|
29244
29074
|
devices: g,
|
|
29245
29075
|
value: r,
|
|
29246
29076
|
onChange: i,
|
|
@@ -29250,13 +29080,13 @@ function SM({ devices: e, listState: t, fleet: n, value: r, onChange: i, emptyMe
|
|
|
29250
29080
|
disabled: f,
|
|
29251
29081
|
showAll: h
|
|
29252
29082
|
})),
|
|
29253
|
-
D && /* @__PURE__ */ V(
|
|
29083
|
+
D && /* @__PURE__ */ V(iM, { noun: c })
|
|
29254
29084
|
]
|
|
29255
29085
|
});
|
|
29256
29086
|
}
|
|
29257
|
-
function
|
|
29258
|
-
let { groupBy: t, setGroupBy: n } =
|
|
29259
|
-
return /* @__PURE__ */ V(
|
|
29087
|
+
function pM(e) {
|
|
29088
|
+
let { groupBy: t, setGroupBy: n } = Yj(), r = Xj(!0);
|
|
29089
|
+
return /* @__PURE__ */ V(gM, {
|
|
29260
29090
|
...e,
|
|
29261
29091
|
grouping: {
|
|
29262
29092
|
groupBy: t,
|
|
@@ -29265,52 +29095,52 @@ function CM(e) {
|
|
|
29265
29095
|
}
|
|
29266
29096
|
});
|
|
29267
29097
|
}
|
|
29268
|
-
function
|
|
29098
|
+
function mM(e) {
|
|
29269
29099
|
return e === "camera" || e === "device" ? "Search by name, room or type…" : e === "class" ? "Search by class or category…" : e === "zone" ? "Search by camera or zone…" : "Search by name or id…";
|
|
29270
29100
|
}
|
|
29271
|
-
var
|
|
29101
|
+
var hM = {
|
|
29272
29102
|
state: "answered",
|
|
29273
29103
|
zones: []
|
|
29274
29104
|
};
|
|
29275
|
-
function
|
|
29276
|
-
let [u, d] = a(
|
|
29105
|
+
function gM({ devices: e, value: t, onChange: n, annotate: r, groupTitle: i, noun: o, disabled: s, showAll: c, grouping: l }) {
|
|
29106
|
+
let [u, d] = a(vj), [f, p] = a(/* @__PURE__ */ new Map()), [h, g] = a(60), _ = c || HA(u.query).length > 0, v = l?.groupBy, y = l?.zones ?? hM, b = m(() => Ej(e, u, y), [
|
|
29277
29107
|
e,
|
|
29278
29108
|
u,
|
|
29279
29109
|
y
|
|
29280
|
-
]), x = m(() => v === void 0 ? null :
|
|
29110
|
+
]), x = m(() => v === void 0 ? null : mj(b, t, v, y), [
|
|
29281
29111
|
b,
|
|
29282
29112
|
t,
|
|
29283
29113
|
v,
|
|
29284
29114
|
y
|
|
29285
|
-
]), S = m(() => x === null ?
|
|
29115
|
+
]), S = m(() => x === null ? YA(qA(b, t), t, f, _) : hj(x, t, f, _), [
|
|
29286
29116
|
x,
|
|
29287
29117
|
b,
|
|
29288
29118
|
t,
|
|
29289
29119
|
f,
|
|
29290
29120
|
_
|
|
29291
|
-
]), C = x?.groupBy ?? null, w = m(() =>
|
|
29121
|
+
]), C = x?.groupBy ?? null, w = m(() => Cj(e, "type", u.types, y), [
|
|
29292
29122
|
e,
|
|
29293
29123
|
u.types,
|
|
29294
29124
|
y
|
|
29295
|
-
]), T = m(() =>
|
|
29125
|
+
]), T = m(() => Cj(e, "zone", u.zones, y), [
|
|
29296
29126
|
e,
|
|
29297
29127
|
u.zones,
|
|
29298
29128
|
y
|
|
29299
|
-
]), E = m(() => l === void 0 ? [] :
|
|
29129
|
+
]), E = m(() => l === void 0 ? [] : Cj(e, "location", u.locations, y), [
|
|
29300
29130
|
e,
|
|
29301
29131
|
u.locations,
|
|
29302
29132
|
y,
|
|
29303
29133
|
l
|
|
29304
|
-
]), D = m(() =>
|
|
29134
|
+
]), D = m(() => Aj(t, e, b), [
|
|
29305
29135
|
e,
|
|
29306
29136
|
t,
|
|
29307
29137
|
b
|
|
29308
|
-
]), O =
|
|
29138
|
+
]), O = ej(S, c ? S.length : h), k = (e, t) => p((n) => new Map([...n, [e.key, !t]]));
|
|
29309
29139
|
return /* @__PURE__ */ H("div", {
|
|
29310
29140
|
className: "rounded-md border border-border bg-surface p-2",
|
|
29311
29141
|
"data-testid": "device-picker-panel",
|
|
29312
29142
|
children: [
|
|
29313
|
-
/* @__PURE__ */ V(
|
|
29143
|
+
/* @__PURE__ */ V(Bj, {
|
|
29314
29144
|
filters: u,
|
|
29315
29145
|
onFiltersChange: (e) => {
|
|
29316
29146
|
d(e), g(60);
|
|
@@ -29324,8 +29154,8 @@ function EM({ devices: e, value: t, onChange: n, annotate: r, groupTitle: i, nou
|
|
|
29324
29154
|
onGroupByChange: l.onGroupByChange,
|
|
29325
29155
|
fallback: x?.fallback ?? null
|
|
29326
29156
|
} },
|
|
29327
|
-
searchPlaceholder:
|
|
29328
|
-
searchLabel: o === "camera" || o === "device" ? "Search devices" : `Search ${
|
|
29157
|
+
searchPlaceholder: mM(o),
|
|
29158
|
+
searchLabel: o === "camera" || o === "device" ? "Search devices" : `Search ${nM[o]}`,
|
|
29329
29159
|
disabled: s
|
|
29330
29160
|
}),
|
|
29331
29161
|
/* @__PURE__ */ H("p", {
|
|
@@ -29345,7 +29175,7 @@ function EM({ devices: e, value: t, onChange: n, annotate: r, groupTitle: i, nou
|
|
|
29345
29175
|
}) : /* @__PURE__ */ H("div", {
|
|
29346
29176
|
className: c ? "mt-1" : "mt-1 max-h-72 overflow-y-auto",
|
|
29347
29177
|
"data-testid": "device-picker-rows",
|
|
29348
|
-
children: [O.rows.map((e) => /* @__PURE__ */ V(
|
|
29178
|
+
children: [O.rows.map((e) => /* @__PURE__ */ V(vM, {
|
|
29349
29179
|
row: e,
|
|
29350
29180
|
value: t,
|
|
29351
29181
|
onChange: n,
|
|
@@ -29375,16 +29205,16 @@ function EM({ devices: e, value: t, onChange: n, annotate: r, groupTitle: i, nou
|
|
|
29375
29205
|
]
|
|
29376
29206
|
});
|
|
29377
29207
|
}
|
|
29378
|
-
function
|
|
29208
|
+
function _M(e, t) {
|
|
29379
29209
|
if (t === null) return e.detail;
|
|
29380
|
-
let n =
|
|
29210
|
+
let n = gj(e, t), r = [
|
|
29381
29211
|
n.location,
|
|
29382
|
-
n.type === null ? null :
|
|
29212
|
+
n.type === null ? null : Mj(n.type),
|
|
29383
29213
|
e.detail ?? null
|
|
29384
29214
|
].filter((e) => e !== null);
|
|
29385
29215
|
return r.length > 0 ? r.join(" · ") : void 0;
|
|
29386
29216
|
}
|
|
29387
|
-
function
|
|
29217
|
+
function vM({ row: e, value: t, onChange: n, onToggleGroup: r, annotate: i, groupTitle: a, groupBy: o, disabled: s }) {
|
|
29388
29218
|
if (e.kind === "header") {
|
|
29389
29219
|
let { group: i, expanded: o } = e;
|
|
29390
29220
|
return /* @__PURE__ */ H("div", {
|
|
@@ -29418,20 +29248,20 @@ function OM({ row: e, value: t, onChange: n, onToggleGroup: r, annotate: i, grou
|
|
|
29418
29248
|
type: "button",
|
|
29419
29249
|
disabled: s,
|
|
29420
29250
|
className: "text-[10px] text-primary hover:underline disabled:opacity-50",
|
|
29421
|
-
onClick: () => n(
|
|
29251
|
+
onClick: () => n(ZA(t, i)),
|
|
29422
29252
|
children: "All"
|
|
29423
29253
|
}),
|
|
29424
29254
|
/* @__PURE__ */ V("button", {
|
|
29425
29255
|
type: "button",
|
|
29426
29256
|
disabled: s,
|
|
29427
29257
|
className: "text-[10px] text-foreground-subtle hover:underline disabled:opacity-50",
|
|
29428
|
-
onClick: () => n(
|
|
29258
|
+
onClick: () => n(QA(t, i)),
|
|
29429
29259
|
children: "Clear"
|
|
29430
29260
|
})
|
|
29431
29261
|
]
|
|
29432
29262
|
});
|
|
29433
29263
|
}
|
|
29434
|
-
let c = i?.(e.device.id), l =
|
|
29264
|
+
let c = i?.(e.device.id), l = _M(e.device, o);
|
|
29435
29265
|
return /* @__PURE__ */ H("label", {
|
|
29436
29266
|
className: "flex cursor-pointer items-center gap-2.5 px-3 py-1 text-xs text-foreground hover:bg-surface-hover",
|
|
29437
29267
|
"data-testid": "device-picker-row",
|
|
@@ -29439,7 +29269,7 @@ function OM({ row: e, value: t, onChange: n, onToggleGroup: r, annotate: i, grou
|
|
|
29439
29269
|
type: "checkbox",
|
|
29440
29270
|
checked: e.selected,
|
|
29441
29271
|
disabled: s,
|
|
29442
|
-
onChange: () => n(
|
|
29272
|
+
onChange: () => n(XA(t, e.device.id)),
|
|
29443
29273
|
className: "accent-primary",
|
|
29444
29274
|
"data-device-id": String(e.device.id)
|
|
29445
29275
|
}), /* @__PURE__ */ H("span", {
|
|
@@ -29464,21 +29294,21 @@ function OM({ row: e, value: t, onChange: n, onToggleGroup: r, annotate: i, grou
|
|
|
29464
29294
|
i(), i(), L("camstack:zone-editing", null), i(), i(), i(), i(), i(), f(() => import("./MaskShapeCanvas-Kfg9dl6B.mjs").then((e) => ({ default: e.MaskShapeCanvas }))), f(() => import("./MotionZonesSettings-DflIL9ss.mjs").then((e) => ({ default: e.MotionZonesSettings }))), f(() => import("./SceneMonitorEditor-DnQJ7Hx3.mjs").then((e) => ({ default: e.SceneMonitorEditor }))), f(() => import("./PrivacyMaskSettings-Bo1S23wt.mjs").then((e) => ({ default: e.PrivacyMaskSettings })));
|
|
29465
29295
|
//#endregion
|
|
29466
29296
|
//#region src/page/frames/lib/retrain-assist-defaults.ts
|
|
29467
|
-
var
|
|
29468
|
-
function
|
|
29297
|
+
var yM = "object-detection";
|
|
29298
|
+
function bM(e, t) {
|
|
29469
29299
|
for (let n of e) {
|
|
29470
29300
|
if (n.addonId === t) return n;
|
|
29471
|
-
let e = n.children === void 0 ? void 0 :
|
|
29301
|
+
let e = n.children === void 0 ? void 0 : bM(n.children, t);
|
|
29472
29302
|
if (e !== void 0) return e;
|
|
29473
29303
|
}
|
|
29474
29304
|
}
|
|
29475
|
-
function
|
|
29305
|
+
function xM(e, t) {
|
|
29476
29306
|
for (let n of e.slots) {
|
|
29477
29307
|
let e = n.addons.find((e) => e.id === t);
|
|
29478
29308
|
if (e !== void 0) return e;
|
|
29479
29309
|
}
|
|
29480
29310
|
}
|
|
29481
|
-
function
|
|
29311
|
+
function SM(e) {
|
|
29482
29312
|
let { status: t, nodeDevices: n, schema: r, resolvedSteps: i } = e;
|
|
29483
29313
|
if (t === void 0) return {
|
|
29484
29314
|
kind: "unknown",
|
|
@@ -29502,7 +29332,7 @@ function MM(e) {
|
|
|
29502
29332
|
kind: "unknown",
|
|
29503
29333
|
gap: "device-unknown"
|
|
29504
29334
|
};
|
|
29505
|
-
let s =
|
|
29335
|
+
let s = xM(r, yM);
|
|
29506
29336
|
if (s === void 0) return {
|
|
29507
29337
|
kind: "unknown",
|
|
29508
29338
|
gap: "step-unknown"
|
|
@@ -29510,8 +29340,8 @@ function MM(e) {
|
|
|
29510
29340
|
let c = tg({
|
|
29511
29341
|
catalog: s,
|
|
29512
29342
|
device: o,
|
|
29513
|
-
override:
|
|
29514
|
-
base: o.steps?.[
|
|
29343
|
+
override: bM(i, yM)?.modelId,
|
|
29344
|
+
base: o.steps?.[yM]?.modelId
|
|
29515
29345
|
});
|
|
29516
29346
|
return c === void 0 ? {
|
|
29517
29347
|
kind: "unknown",
|
|
@@ -29523,11 +29353,11 @@ function MM(e) {
|
|
|
29523
29353
|
minScore: s.models.find((e) => e.id === c)?.defaultConfidence ?? s.defaultConfidence
|
|
29524
29354
|
};
|
|
29525
29355
|
}
|
|
29526
|
-
function
|
|
29356
|
+
function CM(e, t) {
|
|
29527
29357
|
let n = Math.max(0, Math.min(e.x + e.w, t.x + t.w) - Math.max(e.x, t.x)) * Math.max(0, Math.min(e.y + e.h, t.y + t.h) - Math.max(e.y, t.y)), r = e.w * e.h + t.w * t.h - n;
|
|
29528
29358
|
return r > 0 ? n / r : 0;
|
|
29529
29359
|
}
|
|
29530
|
-
function
|
|
29360
|
+
function wM(e, t) {
|
|
29531
29361
|
let n = e.nextKey;
|
|
29532
29362
|
return {
|
|
29533
29363
|
boxes: t.map((e) => {
|
|
@@ -29540,7 +29370,7 @@ function PM(e, t) {
|
|
|
29540
29370
|
nextKey: n
|
|
29541
29371
|
};
|
|
29542
29372
|
}
|
|
29543
|
-
function
|
|
29373
|
+
function TM(e) {
|
|
29544
29374
|
return {
|
|
29545
29375
|
bbox: e.bbox,
|
|
29546
29376
|
macroClass: e.macroClass,
|
|
@@ -29553,7 +29383,7 @@ function FM(e) {
|
|
|
29553
29383
|
draft: !1
|
|
29554
29384
|
};
|
|
29555
29385
|
}
|
|
29556
|
-
function
|
|
29386
|
+
function EM(e) {
|
|
29557
29387
|
return e.map((e) => ({
|
|
29558
29388
|
bbox: e.bbox,
|
|
29559
29389
|
macroClass: e.macroClass,
|
|
@@ -29567,23 +29397,23 @@ function IM(e) {
|
|
|
29567
29397
|
note: e.basis === "subject-box" ? "The box the pipeline recorded on this very frame." : `The pipeline's track position ${String(Math.round(e.deltaMs))} ms from this frame.`
|
|
29568
29398
|
}));
|
|
29569
29399
|
}
|
|
29570
|
-
var
|
|
29400
|
+
var DM = {
|
|
29571
29401
|
boxes: [],
|
|
29572
29402
|
selectedKey: null,
|
|
29573
29403
|
nextKey: 0
|
|
29574
29404
|
};
|
|
29575
|
-
function
|
|
29576
|
-
let n =
|
|
29577
|
-
return
|
|
29405
|
+
function OM(e, t) {
|
|
29406
|
+
let n = wM(DM, e.map(TM));
|
|
29407
|
+
return kM({
|
|
29578
29408
|
boxes: n.boxes,
|
|
29579
29409
|
selectedKey: null,
|
|
29580
29410
|
nextKey: n.nextKey
|
|
29581
|
-
},
|
|
29411
|
+
}, EM(t)).state;
|
|
29582
29412
|
}
|
|
29583
|
-
function
|
|
29413
|
+
function kM(e, t) {
|
|
29584
29414
|
let n = [], r = 0;
|
|
29585
29415
|
for (let i of t) {
|
|
29586
|
-
if ([...e.boxes, ...n].some((e) =>
|
|
29416
|
+
if ([...e.boxes, ...n].some((e) => CM(e.bbox, i.bbox) >= .8)) {
|
|
29587
29417
|
r += 1;
|
|
29588
29418
|
continue;
|
|
29589
29419
|
}
|
|
@@ -29592,7 +29422,7 @@ function zM(e, t) {
|
|
|
29592
29422
|
draft: !0
|
|
29593
29423
|
});
|
|
29594
29424
|
}
|
|
29595
|
-
let i =
|
|
29425
|
+
let i = wM(e, n);
|
|
29596
29426
|
return {
|
|
29597
29427
|
state: {
|
|
29598
29428
|
...e,
|
|
@@ -29602,8 +29432,8 @@ function zM(e, t) {
|
|
|
29602
29432
|
skipped: r
|
|
29603
29433
|
};
|
|
29604
29434
|
}
|
|
29605
|
-
function
|
|
29606
|
-
let r =
|
|
29435
|
+
function AM(e, t, n) {
|
|
29436
|
+
let r = wM(e, [{
|
|
29607
29437
|
bbox: t,
|
|
29608
29438
|
macroClass: n,
|
|
29609
29439
|
kind: "subject",
|
|
@@ -29616,26 +29446,26 @@ function BM(e, t, n) {
|
|
|
29616
29446
|
nextKey: r.nextKey
|
|
29617
29447
|
};
|
|
29618
29448
|
}
|
|
29619
|
-
function
|
|
29449
|
+
function jM(e, t, n) {
|
|
29620
29450
|
return {
|
|
29621
29451
|
...e,
|
|
29622
29452
|
boxes: e.boxes.map((e) => e.key === t ? n(e) : e)
|
|
29623
29453
|
};
|
|
29624
29454
|
}
|
|
29625
|
-
function
|
|
29626
|
-
return
|
|
29455
|
+
function MM(e, t, n) {
|
|
29456
|
+
return jM(e, t, (e) => ({
|
|
29627
29457
|
...e,
|
|
29628
29458
|
...n,
|
|
29629
29459
|
draft: !1
|
|
29630
29460
|
}));
|
|
29631
29461
|
}
|
|
29632
|
-
function
|
|
29633
|
-
return
|
|
29462
|
+
function NM(e, t) {
|
|
29463
|
+
return jM(e, t, (e) => ({
|
|
29634
29464
|
...e,
|
|
29635
29465
|
draft: !1
|
|
29636
29466
|
}));
|
|
29637
29467
|
}
|
|
29638
|
-
function
|
|
29468
|
+
function PM(e) {
|
|
29639
29469
|
return {
|
|
29640
29470
|
...e,
|
|
29641
29471
|
boxes: e.boxes.map((e) => e.draft ? {
|
|
@@ -29644,27 +29474,27 @@ function WM(e) {
|
|
|
29644
29474
|
} : e)
|
|
29645
29475
|
};
|
|
29646
29476
|
}
|
|
29647
|
-
function
|
|
29648
|
-
return
|
|
29477
|
+
function FM(e, t) {
|
|
29478
|
+
return jM(e, t, (e) => ({
|
|
29649
29479
|
...e,
|
|
29650
29480
|
kind: e.kind === "model_error" ? "subject" : "model_error",
|
|
29651
29481
|
draft: !1
|
|
29652
29482
|
}));
|
|
29653
29483
|
}
|
|
29654
|
-
function
|
|
29484
|
+
function IM(e, t) {
|
|
29655
29485
|
return {
|
|
29656
29486
|
...e,
|
|
29657
29487
|
boxes: e.boxes.filter((e) => e.key !== t),
|
|
29658
29488
|
selectedKey: e.selectedKey === t ? null : e.selectedKey
|
|
29659
29489
|
};
|
|
29660
29490
|
}
|
|
29661
|
-
function
|
|
29491
|
+
function LM(e, t) {
|
|
29662
29492
|
return {
|
|
29663
29493
|
...e,
|
|
29664
29494
|
selectedKey: t
|
|
29665
29495
|
};
|
|
29666
29496
|
}
|
|
29667
|
-
function
|
|
29497
|
+
function RM(e, t) {
|
|
29668
29498
|
return {
|
|
29669
29499
|
...e,
|
|
29670
29500
|
boxes: e.boxes.map((e) => {
|
|
@@ -29676,7 +29506,7 @@ function JM(e, t) {
|
|
|
29676
29506
|
})
|
|
29677
29507
|
};
|
|
29678
29508
|
}
|
|
29679
|
-
function
|
|
29509
|
+
function zM(e, t) {
|
|
29680
29510
|
return new Map(e.map((e) => [e.ref, {
|
|
29681
29511
|
verdict: e.verdict,
|
|
29682
29512
|
reason: e.reason,
|
|
@@ -29684,16 +29514,16 @@ function YM(e, t) {
|
|
|
29684
29514
|
...e.suggestedClass === void 0 ? {} : { suggestedClass: e.suggestedClass }
|
|
29685
29515
|
}]));
|
|
29686
29516
|
}
|
|
29687
|
-
function
|
|
29517
|
+
function BM(e) {
|
|
29688
29518
|
return e.boxes.filter((e) => e.draft).length;
|
|
29689
29519
|
}
|
|
29690
|
-
function
|
|
29520
|
+
function VM(e) {
|
|
29691
29521
|
let t = e?.trim();
|
|
29692
29522
|
return t === void 0 || t === "" ? void 0 : t;
|
|
29693
29523
|
}
|
|
29694
|
-
function
|
|
29524
|
+
function HM(e) {
|
|
29695
29525
|
return e.boxes.filter((e) => !e.draft).map((e) => {
|
|
29696
|
-
let t =
|
|
29526
|
+
let t = VM(e.label), n = VM(e.subLabel);
|
|
29697
29527
|
return {
|
|
29698
29528
|
bbox: e.bbox,
|
|
29699
29529
|
macroClass: e.macroClass,
|
|
@@ -29708,29 +29538,29 @@ function QM(e) {
|
|
|
29708
29538
|
}
|
|
29709
29539
|
//#endregion
|
|
29710
29540
|
//#region src/page/frames/RetrainAnnotationEditor.tsx
|
|
29711
|
-
var
|
|
29541
|
+
var UM = [
|
|
29712
29542
|
"person",
|
|
29713
29543
|
"vehicle",
|
|
29714
29544
|
"animal",
|
|
29715
29545
|
"package",
|
|
29716
29546
|
"face",
|
|
29717
29547
|
"plate"
|
|
29718
|
-
],
|
|
29548
|
+
], WM = new Set(UM), GM = {
|
|
29719
29549
|
operator: "drawn",
|
|
29720
29550
|
pipeline: "pipeline",
|
|
29721
29551
|
assist: "detector",
|
|
29722
29552
|
llm: "AI vision"
|
|
29723
29553
|
};
|
|
29724
|
-
function
|
|
29554
|
+
function KM(e) {
|
|
29725
29555
|
let t = e?.trim().toLowerCase();
|
|
29726
|
-
return t === void 0 || t === "" ? null :
|
|
29556
|
+
return t === void 0 || t === "" ? null : WM.has(t) ? `"${t}" is a macro class, not a label — person / postman / Marco are three different tiers` : null;
|
|
29727
29557
|
}
|
|
29728
|
-
function
|
|
29558
|
+
function qM(e) {
|
|
29729
29559
|
if (e.source === "operator") return null;
|
|
29730
|
-
let t = [
|
|
29560
|
+
let t = [GM[e.source]];
|
|
29731
29561
|
return e.assistModelId !== void 0 && t.push(e.assistModelId), e.assistScore !== void 0 && t.push(e.assistScore.toFixed(2)), t.join(" · ");
|
|
29732
29562
|
}
|
|
29733
|
-
function
|
|
29563
|
+
function JM({ boxes: e, selectedKey: t, onSelect: n, onChange: r, onAccept: i, onToggleModelError: a, onDelete: o }) {
|
|
29734
29564
|
return e.length === 0 ? /* @__PURE__ */ H("p", {
|
|
29735
29565
|
className: "text-[11px] text-foreground-subtle p-3",
|
|
29736
29566
|
children: [
|
|
@@ -29742,7 +29572,7 @@ function iN({ boxes: e, selectedKey: t, onSelect: n, onChange: r, onAccept: i, o
|
|
|
29742
29572
|
}) : /* @__PURE__ */ V("ul", {
|
|
29743
29573
|
className: "divide-y divide-border",
|
|
29744
29574
|
children: e.map((e) => {
|
|
29745
|
-
let s = e.key === t, c =
|
|
29575
|
+
let s = e.key === t, c = KM(e.label), l = KM(e.subLabel), u = qM(e);
|
|
29746
29576
|
return /* @__PURE__ */ H("li", {
|
|
29747
29577
|
"data-testid": `retrain-row-${e.key}`,
|
|
29748
29578
|
className: `p-2.5 space-y-1.5 ${s ? "bg-surface-hover" : ""}`,
|
|
@@ -29760,12 +29590,12 @@ function iN({ boxes: e, selectedKey: t, onSelect: n, onChange: r, onAccept: i, o
|
|
|
29760
29590
|
className: "w-28",
|
|
29761
29591
|
"aria-label": "Class",
|
|
29762
29592
|
value: e.macroClass,
|
|
29763
|
-
options:
|
|
29593
|
+
options: UM.map((e) => ({
|
|
29764
29594
|
value: e,
|
|
29765
29595
|
label: e
|
|
29766
29596
|
})),
|
|
29767
29597
|
onChange: (t) => {
|
|
29768
|
-
let n =
|
|
29598
|
+
let n = UM.find((e) => e === t.target.value);
|
|
29769
29599
|
n !== void 0 && r(e.key, { macroClass: n });
|
|
29770
29600
|
}
|
|
29771
29601
|
}),
|
|
@@ -29857,15 +29687,15 @@ function iN({ boxes: e, selectedKey: t, onSelect: n, onChange: r, onAccept: i, o
|
|
|
29857
29687
|
})
|
|
29858
29688
|
});
|
|
29859
29689
|
}
|
|
29860
|
-
function
|
|
29861
|
-
return e.filter((e) => !e.draft).every((e) =>
|
|
29690
|
+
function YM(e) {
|
|
29691
|
+
return e.filter((e) => !e.draft).every((e) => KM(e.label) === null && KM(e.subLabel) === null && WM.has(e.macroClass));
|
|
29862
29692
|
}
|
|
29863
29693
|
//#endregion
|
|
29864
29694
|
//#region src/page/frames/lib/retrain-teacher.ts
|
|
29865
|
-
var
|
|
29866
|
-
function
|
|
29695
|
+
var XM = .25;
|
|
29696
|
+
function ZM(e, t) {
|
|
29867
29697
|
if (e === void 0) return [];
|
|
29868
|
-
let n = e.selectedEngine.format, r = e.slots.flatMap((e) => e.addons).find((e) => e.id ===
|
|
29698
|
+
let n = e.selectedEngine.format, r = e.slots.flatMap((e) => e.addons).find((e) => e.id === yM);
|
|
29869
29699
|
if (r === void 0) return [];
|
|
29870
29700
|
let i = r.models.filter((e) => e.legacy !== !0 && e.provider === void 0).flatMap((e) => {
|
|
29871
29701
|
let t = e.formats[n];
|
|
@@ -29879,7 +29709,7 @@ function sN(e, t) {
|
|
|
29879
29709
|
}
|
|
29880
29710
|
//#endregion
|
|
29881
29711
|
//#region src/page/frames/frame-address.ts
|
|
29882
|
-
function
|
|
29712
|
+
function QM(e) {
|
|
29883
29713
|
return {
|
|
29884
29714
|
deviceId: e.deviceId,
|
|
29885
29715
|
...e.trackId === void 0 ? {} : { trackId: e.trackId },
|
|
@@ -29889,7 +29719,7 @@ function cN(e) {
|
|
|
29889
29719
|
//#endregion
|
|
29890
29720
|
//#region src/page/frames/RetrainAssistPanel.tsx
|
|
29891
29721
|
i();
|
|
29892
|
-
var
|
|
29722
|
+
var $M = [
|
|
29893
29723
|
{
|
|
29894
29724
|
value: "teacher",
|
|
29895
29725
|
label: "Bigger detector"
|
|
@@ -29902,19 +29732,19 @@ var lN = [
|
|
|
29902
29732
|
value: "both",
|
|
29903
29733
|
label: "Both"
|
|
29904
29734
|
}
|
|
29905
|
-
],
|
|
29735
|
+
], eN = [
|
|
29906
29736
|
"person",
|
|
29907
29737
|
"vehicle",
|
|
29908
29738
|
"animal",
|
|
29909
29739
|
"package"
|
|
29910
|
-
],
|
|
29740
|
+
], tN = [
|
|
29911
29741
|
"person",
|
|
29912
29742
|
"vehicle",
|
|
29913
29743
|
"animal",
|
|
29914
29744
|
"package",
|
|
29915
29745
|
"face",
|
|
29916
29746
|
"plate"
|
|
29917
|
-
],
|
|
29747
|
+
], nN = {
|
|
29918
29748
|
"unknown-frame": "The frame is no longer in the dataset.",
|
|
29919
29749
|
"unreadable-frame": "The frame copy could not be read.",
|
|
29920
29750
|
"unknown-profile": "That AI profile no longer exists.",
|
|
@@ -29924,13 +29754,13 @@ var lN = [
|
|
|
29924
29754
|
"llm-error": "The AI model call failed.",
|
|
29925
29755
|
"malformed-answer": "The AI answered in a shape that cannot be trusted, so nothing was drawn."
|
|
29926
29756
|
};
|
|
29927
|
-
function
|
|
29928
|
-
let o = sc({}, { retry: !1 }), s = nc(), c = cc(), [l, d] = a("teacher"), f = m(() =>
|
|
29757
|
+
function rN({ frame: e, history: t, detector: n, schema: r, setNotice: i }) {
|
|
29758
|
+
let o = sc({}, { retry: !1 }), s = nc(), c = cc(), [l, d] = a("teacher"), f = m(() => ZM(r, n.kind === "resolved" ? n.modelId : void 0), [r, n]), [p, h] = a(null), g = f.find((e) => e.modelId === p) ?? f[0], [_, v] = a(XM), [y, b] = a(null), x = (o.data ?? []).find((e) => e.id === y) ?? o.data?.[0], [S, C] = a(eN), [w, T] = a(!1), [E, D] = a(!1), O = u(t.editor);
|
|
29929
29759
|
O.current = t.editor;
|
|
29930
29760
|
let k = l !== "llm", A = l !== "teacher", j = n.kind === "resolved" && g !== void 0, M = x !== void 0 && S.length > 0, N = (!k || j) && (!A || M), P = async () => {
|
|
29931
29761
|
if (n.kind !== "resolved" || g === void 0) return "";
|
|
29932
29762
|
let r = await s.mutateAsync({
|
|
29933
|
-
...
|
|
29763
|
+
...QM(e),
|
|
29934
29764
|
subject: {
|
|
29935
29765
|
kind: "objects",
|
|
29936
29766
|
modelId: g.modelId,
|
|
@@ -29939,7 +29769,7 @@ function pN({ frame: e, history: t, detector: n, schema: r, setNotice: i }) {
|
|
|
29939
29769
|
nodeId: n.nodeId
|
|
29940
29770
|
});
|
|
29941
29771
|
if (r.kind === "refused") return `${g.name} refused: ${r.reason}${r.detail === void 0 ? "" : ` — ${r.detail}`}.`;
|
|
29942
|
-
let i =
|
|
29772
|
+
let i = kM(O.current, r.proposals.map((e) => ({
|
|
29943
29773
|
bbox: e.bbox,
|
|
29944
29774
|
macroClass: e.macroClass,
|
|
29945
29775
|
...e.label === void 0 ? {} : { label: e.label },
|
|
@@ -29956,7 +29786,7 @@ function pN({ frame: e, history: t, detector: n, schema: r, setNotice: i }) {
|
|
|
29956
29786
|
}, F = async (n) => {
|
|
29957
29787
|
if (x === void 0) return "";
|
|
29958
29788
|
let r = O.current, i = await c.mutateAsync({
|
|
29959
|
-
...
|
|
29789
|
+
...QM(e),
|
|
29960
29790
|
profileId: x.id,
|
|
29961
29791
|
classes: [...S],
|
|
29962
29792
|
boxes: r.boxes.slice(0, 50).map((e) => ({
|
|
@@ -29967,7 +29797,7 @@ function pN({ frame: e, history: t, detector: n, schema: r, setNotice: i }) {
|
|
|
29967
29797
|
})),
|
|
29968
29798
|
allowCloud: n
|
|
29969
29799
|
});
|
|
29970
|
-
if (i.kind === "refused") return `${
|
|
29800
|
+
if (i.kind === "refused") return `${nN[i.reason] ?? i.reason}${i.detail === void 0 ? "" : ` (${i.detail})`}`;
|
|
29971
29801
|
let a = i.proposals.map((e) => ({
|
|
29972
29802
|
bbox: e.bbox,
|
|
29973
29803
|
macroClass: e.macroClass,
|
|
@@ -29978,8 +29808,8 @@ function pN({ frame: e, history: t, detector: n, schema: r, setNotice: i }) {
|
|
|
29978
29808
|
...e.assistScore === void 0 ? {} : { assistScore: e.assistScore },
|
|
29979
29809
|
draft: !0,
|
|
29980
29810
|
note: `${i.model}: ${e.reason}`
|
|
29981
|
-
})), o =
|
|
29982
|
-
t.setEditor((e) =>
|
|
29811
|
+
})), o = zM(i.reviews, i.model), s = kM(O.current, a);
|
|
29812
|
+
t.setEditor((e) => RM(kM(e, a).state, o));
|
|
29983
29813
|
let l = i.proposals.length - s.skipped, u = i.reviews.filter((e) => e.verdict !== "confirmed").length;
|
|
29984
29814
|
return `${x.name}: ${String(l)} new draft${l === 1 ? "" : "s"}, ${String(u)} box${u === 1 ? "" : "es"} questioned${i.rejected > 0 ? `, ${String(i.rejected)} unusable item${i.rejected === 1 ? "" : "s"} dropped` : ""}.`;
|
|
29985
29815
|
}, I = async (e) => {
|
|
@@ -30008,12 +29838,12 @@ function pN({ frame: e, history: t, detector: n, schema: r, setNotice: i }) {
|
|
|
30008
29838
|
className: "w-36",
|
|
30009
29839
|
"aria-label": "Assist engine",
|
|
30010
29840
|
value: l,
|
|
30011
|
-
options:
|
|
29841
|
+
options: $M.map((e) => ({
|
|
30012
29842
|
value: e.value,
|
|
30013
29843
|
label: e.label
|
|
30014
29844
|
})),
|
|
30015
29845
|
onChange: (e) => {
|
|
30016
|
-
let t =
|
|
29846
|
+
let t = $M.find((t) => t.value === e.target.value);
|
|
30017
29847
|
t !== void 0 && d(t.value);
|
|
30018
29848
|
}
|
|
30019
29849
|
}),
|
|
@@ -30099,7 +29929,7 @@ function pN({ frame: e, history: t, detector: n, schema: r, setNotice: i }) {
|
|
|
30099
29929
|
children: [/* @__PURE__ */ V("span", {
|
|
30100
29930
|
className: "text-foreground-subtle",
|
|
30101
29931
|
children: "Look for:"
|
|
30102
|
-
}),
|
|
29932
|
+
}), tN.map((e) => {
|
|
30103
29933
|
let t = S.includes(e);
|
|
30104
29934
|
return /* @__PURE__ */ V("button", {
|
|
30105
29935
|
type: "button",
|
|
@@ -30135,7 +29965,7 @@ function pN({ frame: e, history: t, detector: n, schema: r, setNotice: i }) {
|
|
|
30135
29965
|
}
|
|
30136
29966
|
//#endregion
|
|
30137
29967
|
//#region src/page/frames/lib/retrain-boxes.ts
|
|
30138
|
-
function
|
|
29968
|
+
function iN(e, t, n, r) {
|
|
30139
29969
|
if (!(e > 0) || !(t > 0) || !(n > 0) || !(r > 0)) return null;
|
|
30140
29970
|
let i = Math.min(e / n, t / r), a = n * i, o = r * i;
|
|
30141
29971
|
return {
|
|
@@ -30145,7 +29975,7 @@ function mN(e, t, n, r) {
|
|
|
30145
29975
|
height: o
|
|
30146
29976
|
};
|
|
30147
29977
|
}
|
|
30148
|
-
function
|
|
29978
|
+
function aN(e, t) {
|
|
30149
29979
|
return {
|
|
30150
29980
|
x: Math.min(e.x, t.x),
|
|
30151
29981
|
y: Math.min(e.y, t.y),
|
|
@@ -30153,11 +29983,11 @@ function hN(e, t) {
|
|
|
30153
29983
|
h: Math.abs(t.y - e.y)
|
|
30154
29984
|
};
|
|
30155
29985
|
}
|
|
30156
|
-
var
|
|
30157
|
-
function
|
|
29986
|
+
var oN = .01;
|
|
29987
|
+
function sN(e) {
|
|
30158
29988
|
return e.w >= .01 && e.h >= .01;
|
|
30159
29989
|
}
|
|
30160
|
-
function
|
|
29990
|
+
function cN(e, t) {
|
|
30161
29991
|
let n = -1, r = Infinity;
|
|
30162
29992
|
return e.forEach((e, i) => {
|
|
30163
29993
|
if (!(t.x >= e.x && t.x <= e.x + e.w && t.y >= e.y && t.y <= e.y + e.h)) return;
|
|
@@ -30165,7 +29995,7 @@ function vN(e, t) {
|
|
|
30165
29995
|
a < r && (n = i, r = a);
|
|
30166
29996
|
}), n;
|
|
30167
29997
|
}
|
|
30168
|
-
var
|
|
29998
|
+
var lN = [
|
|
30169
29999
|
"nw",
|
|
30170
30000
|
"n",
|
|
30171
30001
|
"ne",
|
|
@@ -30175,7 +30005,7 @@ var yN = [
|
|
|
30175
30005
|
"sw",
|
|
30176
30006
|
"w"
|
|
30177
30007
|
];
|
|
30178
|
-
function
|
|
30008
|
+
function uN(e, t, n) {
|
|
30179
30009
|
return {
|
|
30180
30010
|
x: Math.min(Math.max(0, e.x + t), Math.max(0, 1 - e.w)),
|
|
30181
30011
|
y: Math.min(Math.max(0, e.y + n), Math.max(0, 1 - e.h)),
|
|
@@ -30183,9 +30013,9 @@ function bN(e, t, n) {
|
|
|
30183
30013
|
h: e.h
|
|
30184
30014
|
};
|
|
30185
30015
|
}
|
|
30186
|
-
function
|
|
30016
|
+
function dN(e, t, n, r) {
|
|
30187
30017
|
if (n) {
|
|
30188
|
-
let e = Math.min(Math.max(0, r), t -
|
|
30018
|
+
let e = Math.min(Math.max(0, r), t - oN);
|
|
30189
30019
|
return {
|
|
30190
30020
|
start: e,
|
|
30191
30021
|
size: t - e
|
|
@@ -30193,14 +30023,14 @@ function xN(e, t, n, r) {
|
|
|
30193
30023
|
}
|
|
30194
30024
|
return {
|
|
30195
30025
|
start: e,
|
|
30196
|
-
size: Math.max(Math.min(1, r), e +
|
|
30026
|
+
size: Math.max(Math.min(1, r), e + oN) - e
|
|
30197
30027
|
};
|
|
30198
30028
|
}
|
|
30199
|
-
function
|
|
30200
|
-
let r = t.includes("w") || t.includes("e") ?
|
|
30029
|
+
function fN(e, t, n) {
|
|
30030
|
+
let r = t.includes("w") || t.includes("e") ? dN(e.x, e.x + e.w, t.includes("w"), n.x) : {
|
|
30201
30031
|
start: e.x,
|
|
30202
30032
|
size: e.w
|
|
30203
|
-
}, i = t.includes("n") || t.includes("s") ?
|
|
30033
|
+
}, i = t.includes("n") || t.includes("s") ? dN(e.y, e.y + e.h, t.includes("n"), n.y) : {
|
|
30204
30034
|
start: e.y,
|
|
30205
30035
|
size: e.h
|
|
30206
30036
|
};
|
|
@@ -30211,44 +30041,44 @@ function SN(e, t, n) {
|
|
|
30211
30041
|
h: i.size
|
|
30212
30042
|
};
|
|
30213
30043
|
}
|
|
30214
|
-
function
|
|
30044
|
+
function pN(e, t) {
|
|
30215
30045
|
return {
|
|
30216
30046
|
x: t.includes("w") ? e.x : t.includes("e") ? e.x + e.w : e.x + e.w / 2,
|
|
30217
30047
|
y: t.includes("n") ? e.y : t.includes("s") ? e.y + e.h : e.y + e.h / 2
|
|
30218
30048
|
};
|
|
30219
30049
|
}
|
|
30220
|
-
function
|
|
30050
|
+
function mN(e, t, n) {
|
|
30221
30051
|
let r = (e, t, n) => Math.abs(e - t) <= n, i = r(t.x, e.x, n.x), a = r(t.x, e.x + e.w, n.x), o = r(t.y, e.y, n.y), s = r(t.y, e.y + e.h, n.y), c = t.x >= e.x - n.x && t.x <= e.x + e.w + n.x, l = t.y >= e.y - n.y && t.y <= e.y + e.h + n.y;
|
|
30222
30052
|
return !c || !l ? null : o && i ? "nw" : o && a ? "ne" : s && i ? "sw" : s && a ? "se" : o ? "n" : s ? "s" : i ? "w" : a ? "e" : t.x >= e.x && t.x <= e.x + e.w && t.y >= e.y && t.y <= e.y + e.h ? "body" : null;
|
|
30223
30053
|
}
|
|
30224
30054
|
//#endregion
|
|
30225
30055
|
//#region src/page/frames/lib/retrain-zoom.ts
|
|
30226
|
-
var
|
|
30056
|
+
var hN = {
|
|
30227
30057
|
x: 0,
|
|
30228
30058
|
y: 0,
|
|
30229
30059
|
w: 1,
|
|
30230
30060
|
h: 1
|
|
30231
|
-
},
|
|
30232
|
-
function
|
|
30061
|
+
}, gN = 1.5;
|
|
30062
|
+
function _N(e, t, n) {
|
|
30233
30063
|
return e < t ? t : e > n ? n : e;
|
|
30234
30064
|
}
|
|
30235
|
-
function
|
|
30065
|
+
function vN(e) {
|
|
30236
30066
|
return 1 / e.w;
|
|
30237
30067
|
}
|
|
30238
|
-
function
|
|
30068
|
+
function yN(e, t, n, r) {
|
|
30239
30069
|
return {
|
|
30240
|
-
x:
|
|
30241
|
-
y:
|
|
30070
|
+
x: _N(r.x + (e - n.left) / n.width * r.w, 0, 1),
|
|
30071
|
+
y: _N(r.y + (t - n.top) / n.height * r.h, 0, 1)
|
|
30242
30072
|
};
|
|
30243
30073
|
}
|
|
30244
|
-
function
|
|
30074
|
+
function bN(e, t, n) {
|
|
30245
30075
|
return {
|
|
30246
30076
|
x: t.left + (e.x - n.x) / n.w * t.width,
|
|
30247
30077
|
y: t.top + (e.y - n.y) / n.h * t.height
|
|
30248
30078
|
};
|
|
30249
30079
|
}
|
|
30250
|
-
function
|
|
30251
|
-
let r =
|
|
30080
|
+
function xN(e, t, n) {
|
|
30081
|
+
let r = bN(e, t, n);
|
|
30252
30082
|
return {
|
|
30253
30083
|
left: r.x,
|
|
30254
30084
|
top: r.y,
|
|
@@ -30256,7 +30086,7 @@ function jN(e, t, n) {
|
|
|
30256
30086
|
height: e.h / n.h * t.height
|
|
30257
30087
|
};
|
|
30258
30088
|
}
|
|
30259
|
-
function
|
|
30089
|
+
function SN(e, t) {
|
|
30260
30090
|
return {
|
|
30261
30091
|
left: e.left - t.x / t.w * e.width,
|
|
30262
30092
|
top: e.top - t.y / t.h * e.height,
|
|
@@ -30264,24 +30094,24 @@ function MN(e, t) {
|
|
|
30264
30094
|
height: e.height / t.h
|
|
30265
30095
|
};
|
|
30266
30096
|
}
|
|
30267
|
-
function
|
|
30268
|
-
let r =
|
|
30097
|
+
function CN(e, t, n) {
|
|
30098
|
+
let r = _N(e.w / n, 1 / 16, 1), i = r / e.w;
|
|
30269
30099
|
return {
|
|
30270
|
-
x:
|
|
30271
|
-
y:
|
|
30100
|
+
x: _N(t.x - (t.x - e.x) * i, 0, 1 - r),
|
|
30101
|
+
y: _N(t.y - (t.y - e.y) * i, 0, 1 - r),
|
|
30272
30102
|
w: r,
|
|
30273
30103
|
h: r
|
|
30274
30104
|
};
|
|
30275
30105
|
}
|
|
30276
|
-
function
|
|
30106
|
+
function wN(e, t, n) {
|
|
30277
30107
|
return {
|
|
30278
|
-
x:
|
|
30279
|
-
y:
|
|
30108
|
+
x: _N(e.x + t, 0, 1 - e.w),
|
|
30109
|
+
y: _N(e.y + n, 0, 1 - e.h),
|
|
30280
30110
|
w: e.w,
|
|
30281
30111
|
h: e.h
|
|
30282
30112
|
};
|
|
30283
30113
|
}
|
|
30284
|
-
function
|
|
30114
|
+
function TN(e) {
|
|
30285
30115
|
return {
|
|
30286
30116
|
x: e.x + e.w / 2,
|
|
30287
30117
|
y: e.y + e.h / 2
|
|
@@ -30289,7 +30119,7 @@ function FN(e) {
|
|
|
30289
30119
|
}
|
|
30290
30120
|
//#endregion
|
|
30291
30121
|
//#region src/page/frames/lib/retrain-shortcuts.ts
|
|
30292
|
-
var
|
|
30122
|
+
var EN = [
|
|
30293
30123
|
"person",
|
|
30294
30124
|
"vehicle",
|
|
30295
30125
|
"animal",
|
|
@@ -30297,12 +30127,12 @@ var IN = [
|
|
|
30297
30127
|
"face",
|
|
30298
30128
|
"plate"
|
|
30299
30129
|
];
|
|
30300
|
-
function
|
|
30130
|
+
function DN(e) {
|
|
30301
30131
|
if (typeof e != "object" || !e || !("tagName" in e)) return !1;
|
|
30302
30132
|
let t = String(e.tagName).toUpperCase();
|
|
30303
30133
|
return t === "INPUT" || t === "TEXTAREA" || t === "SELECT" ? !0 : "isContentEditable" in e && e.isContentEditable === !0;
|
|
30304
30134
|
}
|
|
30305
|
-
function
|
|
30135
|
+
function ON(e) {
|
|
30306
30136
|
let t = e.ctrlKey || e.metaKey, n = e.key.toLowerCase();
|
|
30307
30137
|
if (t && !e.altKey) return n === "s" && !e.shiftKey ? { kind: "save" } : e.typing ? null : n === "z" ? e.shiftKey ? { kind: "redo" } : { kind: "undo" } : n === "y" && !e.shiftKey ? { kind: "redo" } : null;
|
|
30308
30138
|
if (e.typing || t || e.altKey) return null;
|
|
@@ -30321,8 +30151,8 @@ function RN(e) {
|
|
|
30321
30151
|
default: break;
|
|
30322
30152
|
}
|
|
30323
30153
|
let r = Number.parseInt(e.key, 10);
|
|
30324
|
-
if (Number.isInteger(r) && r >= 1 && r <=
|
|
30325
|
-
let e =
|
|
30154
|
+
if (Number.isInteger(r) && r >= 1 && r <= EN.length) {
|
|
30155
|
+
let e = EN[r - 1];
|
|
30326
30156
|
return e === void 0 ? null : {
|
|
30327
30157
|
kind: "set-class",
|
|
30328
30158
|
macroClass: e
|
|
@@ -30330,7 +30160,7 @@ function RN(e) {
|
|
|
30330
30160
|
}
|
|
30331
30161
|
return n === "a" ? e.shiftKey ? { kind: "accept-all" } : { kind: "accept" } : n === "e" && !e.shiftKey ? { kind: "toggle-model-error" } : n === "c" && !e.shiftKey ? { kind: "toggle-complete" } : null;
|
|
30332
30162
|
}
|
|
30333
|
-
var
|
|
30163
|
+
var kN = [
|
|
30334
30164
|
{
|
|
30335
30165
|
keys: "← / →",
|
|
30336
30166
|
does: "Previous / next frame"
|
|
@@ -30399,13 +30229,13 @@ var zN = [
|
|
|
30399
30229
|
//#endregion
|
|
30400
30230
|
//#region src/page/frames/RetrainCanvas.tsx
|
|
30401
30231
|
i();
|
|
30402
|
-
var
|
|
30232
|
+
var AN = .0015, jN = {
|
|
30403
30233
|
pipeline: "var(--color-foreground-muted)",
|
|
30404
30234
|
assist: "var(--color-info)",
|
|
30405
30235
|
llm: "var(--color-warning)",
|
|
30406
30236
|
operator: "var(--color-success)"
|
|
30407
30237
|
};
|
|
30408
|
-
function
|
|
30238
|
+
function MN(e, t) {
|
|
30409
30239
|
return e.kind === "model_error" ? {
|
|
30410
30240
|
color: "var(--color-danger)",
|
|
30411
30241
|
dashed: !0,
|
|
@@ -30415,7 +30245,7 @@ function HN(e, t) {
|
|
|
30415
30245
|
dashed: e.draft,
|
|
30416
30246
|
opacity: 1
|
|
30417
30247
|
} : e.draft ? {
|
|
30418
|
-
color:
|
|
30248
|
+
color: jN[e.source],
|
|
30419
30249
|
dashed: !0,
|
|
30420
30250
|
opacity: .8
|
|
30421
30251
|
} : {
|
|
@@ -30424,16 +30254,16 @@ function HN(e, t) {
|
|
|
30424
30254
|
opacity: 1
|
|
30425
30255
|
};
|
|
30426
30256
|
}
|
|
30427
|
-
function
|
|
30257
|
+
function NN(e, t) {
|
|
30428
30258
|
return Math.hypot(e.x - t.x, e.y - t.y);
|
|
30429
30259
|
}
|
|
30430
|
-
function
|
|
30260
|
+
function PN(e, t) {
|
|
30431
30261
|
return {
|
|
30432
30262
|
x: (e.x + t.x) / 2,
|
|
30433
30263
|
y: (e.y + t.y) / 2
|
|
30434
30264
|
};
|
|
30435
30265
|
}
|
|
30436
|
-
function
|
|
30266
|
+
function FN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey: i, viewport: o, onViewportChange: c, panMode: l, onSelect: d, onDraw: f, onGestureStart: p, onGestureBox: m, onGestureEnd: h }) {
|
|
30437
30267
|
let _ = u(null), [v, b] = a({
|
|
30438
30268
|
w: 0,
|
|
30439
30269
|
h: 0
|
|
@@ -30451,10 +30281,10 @@ function GN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
|
|
|
30451
30281
|
n.disconnect();
|
|
30452
30282
|
};
|
|
30453
30283
|
}, []);
|
|
30454
|
-
let D =
|
|
30284
|
+
let D = iN(v.w, v.h, t, n);
|
|
30455
30285
|
y(() => {
|
|
30456
30286
|
let e = (e) => {
|
|
30457
|
-
e.key !== " " ||
|
|
30287
|
+
e.key !== " " || DN(e.target) || (e.preventDefault(), w(!0));
|
|
30458
30288
|
}, t = (e) => {
|
|
30459
30289
|
e.key === " " && w(!1);
|
|
30460
30290
|
};
|
|
@@ -30479,7 +30309,7 @@ function GN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
|
|
|
30479
30309
|
if (n === null) return;
|
|
30480
30310
|
t.preventDefault();
|
|
30481
30311
|
let a = e.getBoundingClientRect();
|
|
30482
|
-
i(
|
|
30312
|
+
i(CN(r, yN(t.clientX - a.left, t.clientY - a.top, n, r), Math.exp(-t.deltaY * AN)));
|
|
30483
30313
|
};
|
|
30484
30314
|
return e.addEventListener("wheel", t, { passive: !1 }), () => {
|
|
30485
30315
|
e.removeEventListener("wheel", t);
|
|
@@ -30491,7 +30321,7 @@ function GN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
|
|
|
30491
30321
|
x: e.clientX - (t?.left ?? 0),
|
|
30492
30322
|
y: e.clientY - (t?.top ?? 0)
|
|
30493
30323
|
};
|
|
30494
|
-
}, []), A = s((e) => D === null ? null :
|
|
30324
|
+
}, []), A = s((e) => D === null ? null : yN(e.x, e.y, D, o), [D, o]), j = s(() => {
|
|
30495
30325
|
let e = E.current;
|
|
30496
30326
|
(e.mode === "move" || e.mode === "resize") && h(), e.mode === "draw" && S(null), E.current = { mode: "none" };
|
|
30497
30327
|
}, [h]), M = (e) => {
|
|
@@ -30501,11 +30331,11 @@ function GN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
|
|
|
30501
30331
|
j();
|
|
30502
30332
|
let [e, t] = [...T.current.values()];
|
|
30503
30333
|
if (e === void 0 || t === void 0) return;
|
|
30504
|
-
let n =
|
|
30334
|
+
let n = PN(e, t);
|
|
30505
30335
|
E.current = {
|
|
30506
30336
|
mode: "pinch",
|
|
30507
|
-
startDistance: Math.max(1,
|
|
30508
|
-
anchor:
|
|
30337
|
+
startDistance: Math.max(1, NN(e, t)),
|
|
30338
|
+
anchor: yN(n.x, n.y, D, o),
|
|
30509
30339
|
from: o
|
|
30510
30340
|
};
|
|
30511
30341
|
return;
|
|
@@ -30520,12 +30350,12 @@ function GN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
|
|
|
30520
30350
|
return;
|
|
30521
30351
|
}
|
|
30522
30352
|
if (e.button !== 0) return;
|
|
30523
|
-
let n =
|
|
30353
|
+
let n = yN(t.x, t.y, D, o), a = {
|
|
30524
30354
|
x: 12 / D.width * o.w,
|
|
30525
30355
|
y: 12 / D.height * o.h
|
|
30526
30356
|
}, s = r.find((e) => e.key === i);
|
|
30527
30357
|
if (s !== void 0) {
|
|
30528
|
-
let e =
|
|
30358
|
+
let e = mN(s.bbox, n, a);
|
|
30529
30359
|
if (e !== null && e !== "body") {
|
|
30530
30360
|
p(), E.current = {
|
|
30531
30361
|
mode: "resize",
|
|
@@ -30536,7 +30366,7 @@ function GN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
|
|
|
30536
30366
|
return;
|
|
30537
30367
|
}
|
|
30538
30368
|
}
|
|
30539
|
-
let c = r[
|
|
30369
|
+
let c = r[cN(r.map((e) => e.bbox), n)];
|
|
30540
30370
|
if (c !== void 0) {
|
|
30541
30371
|
c.key !== i && d(c.key), p(), E.current = {
|
|
30542
30372
|
mode: "move",
|
|
@@ -30549,7 +30379,7 @@ function GN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
|
|
|
30549
30379
|
E.current = {
|
|
30550
30380
|
mode: "draw",
|
|
30551
30381
|
start: n
|
|
30552
|
-
}, S(
|
|
30382
|
+
}, S(aN(n, n));
|
|
30553
30383
|
}, N = (e) => {
|
|
30554
30384
|
if (!T.current.has(e.pointerId) || D === null) return;
|
|
30555
30385
|
let t = k(e);
|
|
@@ -30559,28 +30389,28 @@ function GN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
|
|
|
30559
30389
|
case "pinch": {
|
|
30560
30390
|
let [e, t] = [...T.current.values()];
|
|
30561
30391
|
if (e === void 0 || t === void 0) return;
|
|
30562
|
-
let r =
|
|
30563
|
-
c(
|
|
30392
|
+
let r = CN(n.from, n.anchor, NN(e, t) / n.startDistance), i = PN(e, t), a = yN(i.x, i.y, D, r);
|
|
30393
|
+
c(wN(r, n.anchor.x - a.x, n.anchor.y - a.y));
|
|
30564
30394
|
return;
|
|
30565
30395
|
}
|
|
30566
30396
|
case "pan": {
|
|
30567
30397
|
let e = (t.x - n.startPx.x) / D.width * n.from.w, r = (t.y - n.startPx.y) / D.height * n.from.h;
|
|
30568
|
-
c(
|
|
30398
|
+
c(wN(n.from, -e, -r));
|
|
30569
30399
|
return;
|
|
30570
30400
|
}
|
|
30571
30401
|
case "move": {
|
|
30572
|
-
let e =
|
|
30573
|
-
m(n.key,
|
|
30402
|
+
let e = yN(t.x, t.y, D, o);
|
|
30403
|
+
m(n.key, uN(n.from, e.x - n.start.x, e.y - n.start.y));
|
|
30574
30404
|
return;
|
|
30575
30405
|
}
|
|
30576
30406
|
case "resize": {
|
|
30577
|
-
let e =
|
|
30578
|
-
m(n.key,
|
|
30407
|
+
let e = yN(t.x, t.y, D, o);
|
|
30408
|
+
m(n.key, fN(n.from, n.handle, e));
|
|
30579
30409
|
return;
|
|
30580
30410
|
}
|
|
30581
30411
|
case "draw": {
|
|
30582
|
-
let e =
|
|
30583
|
-
S(
|
|
30412
|
+
let e = yN(t.x, t.y, D, o);
|
|
30413
|
+
S(aN(n.start, e));
|
|
30584
30414
|
return;
|
|
30585
30415
|
}
|
|
30586
30416
|
default: return;
|
|
@@ -30594,12 +30424,12 @@ function GN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
|
|
|
30594
30424
|
return;
|
|
30595
30425
|
}
|
|
30596
30426
|
if (t.mode === "draw") {
|
|
30597
|
-
let n = A(k(e)), r = n === null ? null :
|
|
30598
|
-
S(null), E.current = { mode: "none" }, r !== null &&
|
|
30427
|
+
let n = A(k(e)), r = n === null ? null : aN(t.start, n);
|
|
30428
|
+
S(null), E.current = { mode: "none" }, r !== null && sN(r) ? f(r) : d(null);
|
|
30599
30429
|
return;
|
|
30600
30430
|
}
|
|
30601
30431
|
j();
|
|
30602
|
-
}, F = r.find((e) => e.key === i), I = C || l, ee = D === null ? null :
|
|
30432
|
+
}, F = r.find((e) => e.key === i), I = C || l, ee = D === null ? null : SN(D, o);
|
|
30603
30433
|
return /* @__PURE__ */ H("div", {
|
|
30604
30434
|
ref: _,
|
|
30605
30435
|
"data-testid": "retrain-canvas",
|
|
@@ -30618,7 +30448,7 @@ function GN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
|
|
|
30618
30448
|
style: ee
|
|
30619
30449
|
}),
|
|
30620
30450
|
D !== null && r.map((e) => {
|
|
30621
|
-
let t =
|
|
30451
|
+
let t = xN(e.bbox, D, o), n = e.key === i, r = MN(e, n);
|
|
30622
30452
|
return /* @__PURE__ */ V("div", {
|
|
30623
30453
|
"data-testid": `retrain-box-${e.key}`,
|
|
30624
30454
|
"data-draft": e.draft ? "true" : "false",
|
|
@@ -30644,8 +30474,8 @@ function GN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
|
|
|
30644
30474
|
})
|
|
30645
30475
|
}, e.key);
|
|
30646
30476
|
}),
|
|
30647
|
-
D !== null && F !== void 0 &&
|
|
30648
|
-
let t =
|
|
30477
|
+
D !== null && F !== void 0 && lN.map((e) => {
|
|
30478
|
+
let t = bN(pN(F.bbox, e), D, o);
|
|
30649
30479
|
return /* @__PURE__ */ V("div", {
|
|
30650
30480
|
"data-testid": `retrain-handle-${e}`,
|
|
30651
30481
|
className: "absolute h-2.5 w-2.5 -translate-x-1/2 -translate-y-1/2 rounded-sm border border-background bg-primary pointer-events-none",
|
|
@@ -30657,7 +30487,7 @@ function GN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
|
|
|
30657
30487
|
}),
|
|
30658
30488
|
x !== null && D !== null && /* @__PURE__ */ V("div", {
|
|
30659
30489
|
className: "absolute border border-dashed border-primary pointer-events-none",
|
|
30660
|
-
style:
|
|
30490
|
+
style: xN(x, D, o)
|
|
30661
30491
|
})
|
|
30662
30492
|
]
|
|
30663
30493
|
});
|
|
@@ -30665,19 +30495,19 @@ function GN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
|
|
|
30665
30495
|
//#endregion
|
|
30666
30496
|
//#region src/page/frames/RetrainCanvasToolbar.tsx
|
|
30667
30497
|
i();
|
|
30668
|
-
function
|
|
30669
|
-
let [e, t] = a(
|
|
30498
|
+
function IN() {
|
|
30499
|
+
let [e, t] = a(hN), [n, r] = a(!1);
|
|
30670
30500
|
return {
|
|
30671
30501
|
viewport: e,
|
|
30672
30502
|
setViewport: t,
|
|
30673
30503
|
zoomIn: s(() => {
|
|
30674
|
-
t((e) =>
|
|
30504
|
+
t((e) => CN(e, TN(e), gN));
|
|
30675
30505
|
}, []),
|
|
30676
30506
|
zoomOut: s(() => {
|
|
30677
|
-
t((e) =>
|
|
30507
|
+
t((e) => CN(e, TN(e), 1 / gN));
|
|
30678
30508
|
}, []),
|
|
30679
30509
|
fit: s(() => {
|
|
30680
|
-
t(
|
|
30510
|
+
t(hN);
|
|
30681
30511
|
}, []),
|
|
30682
30512
|
panMode: n,
|
|
30683
30513
|
togglePan: s(() => {
|
|
@@ -30685,8 +30515,8 @@ function KN() {
|
|
|
30685
30515
|
}, [])
|
|
30686
30516
|
};
|
|
30687
30517
|
}
|
|
30688
|
-
function
|
|
30689
|
-
let a =
|
|
30518
|
+
function LN({ view: e, canUndo: t, canRedo: n, onUndo: r, onRedo: i }) {
|
|
30519
|
+
let a = vN(e.viewport);
|
|
30690
30520
|
return /* @__PURE__ */ H("div", {
|
|
30691
30521
|
className: "flex items-center gap-1 px-2 py-1 border-b border-border bg-surface",
|
|
30692
30522
|
children: [
|
|
@@ -30752,7 +30582,7 @@ function qN({ view: e, canUndo: t, canRedo: n, onUndo: r, onRedo: i }) {
|
|
|
30752
30582
|
children: "Keyboard and gestures"
|
|
30753
30583
|
}), /* @__PURE__ */ V("table", {
|
|
30754
30584
|
className: "w-full text-[11px]",
|
|
30755
|
-
children: /* @__PURE__ */ V("tbody", { children:
|
|
30585
|
+
children: /* @__PURE__ */ V("tbody", { children: kN.map((e) => /* @__PURE__ */ H("tr", {
|
|
30756
30586
|
className: "align-top",
|
|
30757
30587
|
children: [/* @__PURE__ */ V("td", {
|
|
30758
30588
|
className: "py-0.5 pr-2 font-mono whitespace-nowrap text-foreground",
|
|
@@ -30767,7 +30597,7 @@ function qN({ view: e, canUndo: t, canRedo: n, onUndo: r, onRedo: i }) {
|
|
|
30767
30597
|
]
|
|
30768
30598
|
});
|
|
30769
30599
|
}
|
|
30770
|
-
function
|
|
30600
|
+
function RN(e) {
|
|
30771
30601
|
return {
|
|
30772
30602
|
past: [],
|
|
30773
30603
|
present: e,
|
|
@@ -30775,25 +30605,25 @@ function JN(e) {
|
|
|
30775
30605
|
gestureBase: null
|
|
30776
30606
|
};
|
|
30777
30607
|
}
|
|
30778
|
-
function
|
|
30608
|
+
function zN(e, t) {
|
|
30779
30609
|
let n = [...e, t];
|
|
30780
30610
|
return n.length > 100 ? n.slice(n.length - 100) : n;
|
|
30781
30611
|
}
|
|
30782
|
-
function
|
|
30612
|
+
function BN(e, t) {
|
|
30783
30613
|
return t === e.present ? e : {
|
|
30784
|
-
past:
|
|
30614
|
+
past: zN(e.past, e.present),
|
|
30785
30615
|
present: t,
|
|
30786
30616
|
future: [],
|
|
30787
30617
|
gestureBase: null
|
|
30788
30618
|
};
|
|
30789
30619
|
}
|
|
30790
|
-
function
|
|
30620
|
+
function VN(e, t) {
|
|
30791
30621
|
return {
|
|
30792
30622
|
...e,
|
|
30793
30623
|
present: t
|
|
30794
30624
|
};
|
|
30795
30625
|
}
|
|
30796
|
-
function
|
|
30626
|
+
function HN(e) {
|
|
30797
30627
|
let t = e.past[e.past.length - 1];
|
|
30798
30628
|
return t === void 0 ? e : {
|
|
30799
30629
|
past: e.past.slice(0, -1),
|
|
@@ -30802,68 +30632,68 @@ function QN(e) {
|
|
|
30802
30632
|
gestureBase: null
|
|
30803
30633
|
};
|
|
30804
30634
|
}
|
|
30805
|
-
function
|
|
30635
|
+
function UN(e) {
|
|
30806
30636
|
let [t, ...n] = e.future;
|
|
30807
30637
|
return t === void 0 ? e : {
|
|
30808
|
-
past:
|
|
30638
|
+
past: zN(e.past, e.present),
|
|
30809
30639
|
present: t,
|
|
30810
30640
|
future: n,
|
|
30811
30641
|
gestureBase: null
|
|
30812
30642
|
};
|
|
30813
30643
|
}
|
|
30814
|
-
function
|
|
30644
|
+
function WN(e) {
|
|
30815
30645
|
return {
|
|
30816
30646
|
...e,
|
|
30817
30647
|
gestureBase: e.present
|
|
30818
30648
|
};
|
|
30819
30649
|
}
|
|
30820
|
-
function
|
|
30650
|
+
function GN(e, t) {
|
|
30821
30651
|
return {
|
|
30822
30652
|
...e,
|
|
30823
30653
|
present: t
|
|
30824
30654
|
};
|
|
30825
30655
|
}
|
|
30826
|
-
function
|
|
30656
|
+
function KN(e) {
|
|
30827
30657
|
let t = e.gestureBase;
|
|
30828
30658
|
return t === null ? e : t === e.present ? {
|
|
30829
30659
|
...e,
|
|
30830
30660
|
gestureBase: null
|
|
30831
30661
|
} : {
|
|
30832
|
-
past:
|
|
30662
|
+
past: zN(e.past, t),
|
|
30833
30663
|
present: e.present,
|
|
30834
30664
|
future: [],
|
|
30835
30665
|
gestureBase: null
|
|
30836
30666
|
};
|
|
30837
30667
|
}
|
|
30838
|
-
function
|
|
30668
|
+
function qN(e) {
|
|
30839
30669
|
return e.past.length > 0;
|
|
30840
30670
|
}
|
|
30841
|
-
function
|
|
30671
|
+
function JN(e) {
|
|
30842
30672
|
return e.future.length > 0;
|
|
30843
30673
|
}
|
|
30844
30674
|
//#endregion
|
|
30845
30675
|
//#region src/page/frames/use-retrain-editor-history.ts
|
|
30846
30676
|
i();
|
|
30847
|
-
function
|
|
30677
|
+
function YN(e, t) {
|
|
30848
30678
|
return typeof e == "function" ? e(t) : e;
|
|
30849
30679
|
}
|
|
30850
|
-
function
|
|
30851
|
-
let [t, n] = a(() =>
|
|
30852
|
-
n((t) =>
|
|
30680
|
+
function XN(e) {
|
|
30681
|
+
let [t, n] = a(() => RN(e())), r = s((e) => {
|
|
30682
|
+
n((t) => BN(t, YN(e, t.present)));
|
|
30853
30683
|
}, []), i = s((e) => {
|
|
30854
|
-
n(
|
|
30684
|
+
n(RN(e));
|
|
30855
30685
|
}, []), o = s((e) => {
|
|
30856
|
-
n((t) =>
|
|
30686
|
+
n((t) => VN(t, YN(e, t.present)));
|
|
30857
30687
|
}, []), c = s(() => {
|
|
30858
|
-
n((e) =>
|
|
30688
|
+
n((e) => WN(e));
|
|
30859
30689
|
}, []), l = s((e) => {
|
|
30860
|
-
n((t) =>
|
|
30690
|
+
n((t) => GN(t, YN(e, t.present)));
|
|
30861
30691
|
}, []), u = s(() => {
|
|
30862
|
-
n((e) =>
|
|
30692
|
+
n((e) => KN(e));
|
|
30863
30693
|
}, []), d = s(() => {
|
|
30864
|
-
n((e) =>
|
|
30694
|
+
n((e) => HN(e));
|
|
30865
30695
|
}, []), f = s(() => {
|
|
30866
|
-
n((e) =>
|
|
30696
|
+
n((e) => UN(e));
|
|
30867
30697
|
}, []);
|
|
30868
30698
|
return {
|
|
30869
30699
|
editor: t.present,
|
|
@@ -30875,20 +30705,20 @@ function oP(e) {
|
|
|
30875
30705
|
endGesture: u,
|
|
30876
30706
|
undo: d,
|
|
30877
30707
|
redo: f,
|
|
30878
|
-
canUndo:
|
|
30879
|
-
canRedo:
|
|
30708
|
+
canUndo: qN(t),
|
|
30709
|
+
canRedo: JN(t)
|
|
30880
30710
|
};
|
|
30881
30711
|
}
|
|
30882
30712
|
//#endregion
|
|
30883
30713
|
//#region src/page/frames/use-retrain-shortcuts.ts
|
|
30884
30714
|
i();
|
|
30885
|
-
function
|
|
30715
|
+
function ZN(e, t) {
|
|
30886
30716
|
let n = e.boxes.length;
|
|
30887
30717
|
if (n === 0) return null;
|
|
30888
30718
|
let r = e.boxes.findIndex((t) => t.key === e.selectedKey), i = r < 0 ? t === 1 ? 0 : n - 1 : (r + t + n) % n;
|
|
30889
30719
|
return e.boxes[i]?.key ?? null;
|
|
30890
30720
|
}
|
|
30891
|
-
function
|
|
30721
|
+
function QN(e, t) {
|
|
30892
30722
|
let { history: n } = t, r = n.editor.selectedKey;
|
|
30893
30723
|
switch (e.kind) {
|
|
30894
30724
|
case "next-frame": return t.onNextFrame();
|
|
@@ -30900,39 +30730,39 @@ function cP(e, t) {
|
|
|
30900
30730
|
case "zoom-in": return t.onZoomIn(), !0;
|
|
30901
30731
|
case "zoom-out": return t.onZoomOut(), !0;
|
|
30902
30732
|
case "zoom-fit": return t.onZoomFit(), !0;
|
|
30903
|
-
case "accept-all": return n.setEditor((e) =>
|
|
30733
|
+
case "accept-all": return n.setEditor((e) => PM(e)), !0;
|
|
30904
30734
|
case "select-next":
|
|
30905
30735
|
case "select-prev": {
|
|
30906
|
-
let t =
|
|
30907
|
-
return t === null ? !1 : (n.selectOnly((e) =>
|
|
30736
|
+
let t = ZN(n.editor, e.kind === "select-next" ? 1 : -1);
|
|
30737
|
+
return t === null ? !1 : (n.selectOnly((e) => LM(e, t)), !0);
|
|
30908
30738
|
}
|
|
30909
|
-
case "deselect": return r === null ? !1 : (n.selectOnly((e) =>
|
|
30739
|
+
case "deselect": return r === null ? !1 : (n.selectOnly((e) => LM(e, null)), !0);
|
|
30910
30740
|
default: break;
|
|
30911
30741
|
}
|
|
30912
30742
|
if (r === null) return !1;
|
|
30913
30743
|
switch (e.kind) {
|
|
30914
|
-
case "delete": return n.setEditor((e) =>
|
|
30915
|
-
case "set-class": return n.setEditor((t) =>
|
|
30916
|
-
case "accept": return n.setEditor((e) =>
|
|
30917
|
-
case "toggle-model-error": return n.setEditor((e) =>
|
|
30744
|
+
case "delete": return n.setEditor((e) => IM(e, r)), !0;
|
|
30745
|
+
case "set-class": return n.setEditor((t) => MM(t, r, { macroClass: e.macroClass })), !0;
|
|
30746
|
+
case "accept": return n.setEditor((e) => NM(e, r)), !0;
|
|
30747
|
+
case "toggle-model-error": return n.setEditor((e) => FM(e, r)), !0;
|
|
30918
30748
|
default: return !1;
|
|
30919
30749
|
}
|
|
30920
30750
|
}
|
|
30921
|
-
function
|
|
30751
|
+
function $N(e, t) {
|
|
30922
30752
|
let n = u(t);
|
|
30923
30753
|
n.current = t, y(() => {
|
|
30924
30754
|
if (!e) return;
|
|
30925
30755
|
let t = (e) => {
|
|
30926
30756
|
if (e.defaultPrevented || e.isComposing) return;
|
|
30927
|
-
let t =
|
|
30757
|
+
let t = ON({
|
|
30928
30758
|
key: e.key,
|
|
30929
30759
|
ctrlKey: e.ctrlKey,
|
|
30930
30760
|
metaKey: e.metaKey,
|
|
30931
30761
|
shiftKey: e.shiftKey,
|
|
30932
30762
|
altKey: e.altKey,
|
|
30933
|
-
typing:
|
|
30763
|
+
typing: DN(e.target)
|
|
30934
30764
|
});
|
|
30935
|
-
t !== null &&
|
|
30765
|
+
t !== null && QN(t, n.current) && e.preventDefault();
|
|
30936
30766
|
};
|
|
30937
30767
|
return window.addEventListener("keydown", t), () => {
|
|
30938
30768
|
window.removeEventListener("keydown", t);
|
|
@@ -30942,7 +30772,7 @@ function lP(e, t) {
|
|
|
30942
30772
|
//#endregion
|
|
30943
30773
|
//#region src/page/frames/RetrainWorkbench.tsx
|
|
30944
30774
|
i();
|
|
30945
|
-
var
|
|
30775
|
+
var eP = "person", tP = {
|
|
30946
30776
|
pending: "Reading which detector this camera runs…",
|
|
30947
30777
|
"placement-unreadable": "The detection stage of this camera could not be read, so the model it runs is unknown — not absent.",
|
|
30948
30778
|
"detection-off": "This camera runs no object detector, so there is no proposal to mirror.",
|
|
@@ -30951,8 +30781,8 @@ var uP = "person", dP = {
|
|
|
30951
30781
|
"step-unknown": "That node carries no object-detection step in its catalog.",
|
|
30952
30782
|
"no-model": "No object-detection model on that accelerator can be resolved for this camera."
|
|
30953
30783
|
};
|
|
30954
|
-
function
|
|
30955
|
-
let c = e.find((e) => e.frameId === t), l = c?.deviceId ?? null, d =
|
|
30784
|
+
function nP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r, onSaved: i, setNotice: o }) {
|
|
30785
|
+
let c = e.find((e) => e.frameId === t), l = c?.deviceId ?? null, d = XN(() => OM([], [])), { editor: f, setEditor: p, resetEditor: h, selectOnly: g } = d, _ = IN(), v = rc({ frameIds: [t] }), b = tc({ frameId: t }), x = nc(), S = ic(), C = oc(), w = _c({ deviceIds: l === null ? [] : [l] }, {
|
|
30956
30786
|
enabled: l !== null,
|
|
30957
30787
|
staleTime: 3e4
|
|
30958
30788
|
}), T = w.data?.[0]?.detection?.nodeId ?? null, E = hc({ nodeId: T ?? "" }, {
|
|
@@ -30964,7 +30794,7 @@ function fP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
|
|
|
30964
30794
|
}), O = gc({ deviceId: l ?? 0 }, {
|
|
30965
30795
|
enabled: l !== null,
|
|
30966
30796
|
staleTime: 3e4
|
|
30967
|
-
}), k = m(() =>
|
|
30797
|
+
}), k = m(() => SM({
|
|
30968
30798
|
status: w.data?.[0],
|
|
30969
30799
|
nodeDevices: E.data,
|
|
30970
30800
|
schema: D.data,
|
|
@@ -30986,7 +30816,7 @@ function fP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
|
|
|
30986
30816
|
y(() => {
|
|
30987
30817
|
_.fit();
|
|
30988
30818
|
let { stored: e, copy: n } = A.current;
|
|
30989
|
-
h(
|
|
30819
|
+
h(OM((e ?? []).filter((e) => e.mediaKey === t), n?.pipelineBoxes ?? []));
|
|
30990
30820
|
}, [
|
|
30991
30821
|
t,
|
|
30992
30822
|
v.dataUpdatedAt,
|
|
@@ -30996,7 +30826,7 @@ function fP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
|
|
|
30996
30826
|
]);
|
|
30997
30827
|
let M = s(async (e) => {
|
|
30998
30828
|
c !== void 0 && (await C.mutateAsync({
|
|
30999
|
-
...
|
|
30829
|
+
...QM(c),
|
|
31000
30830
|
complete: e
|
|
31001
30831
|
}), await r());
|
|
31002
30832
|
}, [
|
|
@@ -31006,11 +30836,11 @@ function fP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
|
|
|
31006
30836
|
]), N = s(async (e) => {
|
|
31007
30837
|
if (c === void 0) return;
|
|
31008
30838
|
if (o(null), k.kind !== "resolved") {
|
|
31009
|
-
o(
|
|
30839
|
+
o(tP[k.gap]);
|
|
31010
30840
|
return;
|
|
31011
30841
|
}
|
|
31012
30842
|
let t = await x.mutateAsync({
|
|
31013
|
-
...
|
|
30843
|
+
...QM(c),
|
|
31014
30844
|
subject: e === "package" ? { kind: "package" } : {
|
|
31015
30845
|
kind: "objects",
|
|
31016
30846
|
modelId: k.modelId,
|
|
@@ -31022,7 +30852,7 @@ function fP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
|
|
|
31022
30852
|
o(t.reason === "no-zone" ? "A package proposal runs on the zone crop only — this camera has no zone, and running the detector on the whole frame at 0.35 proposes furniture." : `The pipeline refused: ${t.reason}${t.detail === void 0 ? "" : ` — ${t.detail}`}`);
|
|
31023
30853
|
return;
|
|
31024
30854
|
}
|
|
31025
|
-
let n =
|
|
30855
|
+
let n = kM(f, t.proposals.map((e) => ({
|
|
31026
30856
|
bbox: e.bbox,
|
|
31027
30857
|
macroClass: e.macroClass,
|
|
31028
30858
|
...e.label === void 0 ? {} : { label: e.label },
|
|
@@ -31041,15 +30871,15 @@ function fP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
|
|
|
31041
30871
|
p,
|
|
31042
30872
|
o
|
|
31043
30873
|
]), P = s((e) => {
|
|
31044
|
-
p((t) =>
|
|
30874
|
+
p((t) => AM(t, e, eP));
|
|
31045
30875
|
}, [p]), [F, I] = a(!1), ee = s(async () => {
|
|
31046
30876
|
if (c === void 0) return;
|
|
31047
|
-
let e =
|
|
30877
|
+
let e = BM(f);
|
|
31048
30878
|
I(!0);
|
|
31049
30879
|
try {
|
|
31050
30880
|
await S.mutateAsync({
|
|
31051
|
-
...
|
|
31052
|
-
annotations: [...
|
|
30881
|
+
...QM(c),
|
|
30882
|
+
annotations: [...HM(f)]
|
|
31053
30883
|
}), await v.refetch();
|
|
31054
30884
|
} finally {
|
|
31055
30885
|
I(!1);
|
|
@@ -31062,11 +30892,11 @@ function fP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
|
|
|
31062
30892
|
v,
|
|
31063
30893
|
i,
|
|
31064
30894
|
o
|
|
31065
|
-
]), te = b.data, ne =
|
|
30895
|
+
]), te = b.data, ne = YM(f.boxes) && c !== void 0, re = BM(f), ie = e.map((e) => e.frameId), L = (e) => {
|
|
31066
30896
|
let r = ie.indexOf(t), i = ie[r + e];
|
|
31067
30897
|
return r < 0 || i === void 0 ? !1 : (n(i), !0);
|
|
31068
30898
|
};
|
|
31069
|
-
return
|
|
30899
|
+
return $N(!F, {
|
|
31070
30900
|
history: d,
|
|
31071
30901
|
onNextFrame: () => L(1),
|
|
31072
30902
|
onPrevFrame: () => L(-1),
|
|
@@ -31080,7 +30910,7 @@ function fP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
|
|
|
31080
30910
|
"aria-busy": F,
|
|
31081
30911
|
children: [/* @__PURE__ */ H("div", {
|
|
31082
30912
|
className: "rounded-md border border-border overflow-hidden flex flex-col",
|
|
31083
|
-
children: [/* @__PURE__ */ V(
|
|
30913
|
+
children: [/* @__PURE__ */ V(LN, {
|
|
31084
30914
|
view: _,
|
|
31085
30915
|
canUndo: d.canUndo,
|
|
31086
30916
|
canRedo: d.canRedo,
|
|
@@ -31089,7 +30919,7 @@ function fP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
|
|
|
31089
30919
|
}), te === void 0 ? /* @__PURE__ */ H("div", {
|
|
31090
30920
|
className: "flex items-center gap-2 p-6 text-xs text-foreground-subtle",
|
|
31091
30921
|
children: [/* @__PURE__ */ V(hr, { className: "h-3.5 w-3.5 animate-spin" }), "Loading the frame…"]
|
|
31092
|
-
}) : /* @__PURE__ */ V(
|
|
30922
|
+
}) : /* @__PURE__ */ V(FN, {
|
|
31093
30923
|
imageSrc: `data:image/jpeg;base64,${te.base64}`,
|
|
31094
30924
|
imageWidth: te.width,
|
|
31095
30925
|
imageHeight: te.height,
|
|
@@ -31099,12 +30929,12 @@ function fP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
|
|
|
31099
30929
|
onViewportChange: _.setViewport,
|
|
31100
30930
|
panMode: _.panMode,
|
|
31101
30931
|
onSelect: (e) => {
|
|
31102
|
-
g((t) =>
|
|
30932
|
+
g((t) => LM(t, e));
|
|
31103
30933
|
},
|
|
31104
30934
|
onDraw: P,
|
|
31105
30935
|
onGestureStart: d.beginGesture,
|
|
31106
30936
|
onGestureBox: (e, t) => {
|
|
31107
|
-
d.updateGesture((n) =>
|
|
30937
|
+
d.updateGesture((n) => MM(n, e, { bbox: t }));
|
|
31108
30938
|
},
|
|
31109
30939
|
onGestureEnd: d.endGesture
|
|
31110
30940
|
})]
|
|
@@ -31146,9 +30976,9 @@ function fP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
|
|
|
31146
30976
|
}),
|
|
31147
30977
|
/* @__PURE__ */ V("div", {
|
|
31148
30978
|
className: "px-3 py-1 border-b border-border text-[11px] text-foreground-subtle",
|
|
31149
|
-
children: k.kind === "resolved" ? `Proposals come from ${k.modelId} at ${k.minScore.toFixed(2)}, on ${k.nodeId} — what this camera really runs.` :
|
|
30979
|
+
children: k.kind === "resolved" ? `Proposals come from ${k.modelId} at ${k.minScore.toFixed(2)}, on ${k.nodeId} — what this camera really runs.` : tP[k.gap]
|
|
31150
30980
|
}),
|
|
31151
|
-
c !== void 0 && /* @__PURE__ */ V(
|
|
30981
|
+
c !== void 0 && /* @__PURE__ */ V(rN, {
|
|
31152
30982
|
frame: c,
|
|
31153
30983
|
history: d,
|
|
31154
30984
|
detector: k,
|
|
@@ -31157,23 +30987,23 @@ function fP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
|
|
|
31157
30987
|
}),
|
|
31158
30988
|
/* @__PURE__ */ V("div", {
|
|
31159
30989
|
className: "flex-1 overflow-y-auto",
|
|
31160
|
-
children: /* @__PURE__ */ V(
|
|
30990
|
+
children: /* @__PURE__ */ V(JM, {
|
|
31161
30991
|
boxes: f.boxes,
|
|
31162
30992
|
selectedKey: f.selectedKey,
|
|
31163
30993
|
onSelect: (e) => {
|
|
31164
|
-
g((t) =>
|
|
30994
|
+
g((t) => LM(t, e));
|
|
31165
30995
|
},
|
|
31166
30996
|
onChange: (e, t) => {
|
|
31167
|
-
p((n) =>
|
|
30997
|
+
p((n) => MM(n, e, t));
|
|
31168
30998
|
},
|
|
31169
30999
|
onAccept: (e) => {
|
|
31170
|
-
p((t) =>
|
|
31000
|
+
p((t) => NM(t, e));
|
|
31171
31001
|
},
|
|
31172
31002
|
onToggleModelError: (e) => {
|
|
31173
|
-
p((t) =>
|
|
31003
|
+
p((t) => FM(t, e));
|
|
31174
31004
|
},
|
|
31175
31005
|
onDelete: (e) => {
|
|
31176
|
-
p((t) =>
|
|
31006
|
+
p((t) => IM(t, e));
|
|
31177
31007
|
}
|
|
31178
31008
|
})
|
|
31179
31009
|
}),
|
|
@@ -31206,7 +31036,7 @@ function fP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
|
|
|
31206
31036
|
variant: "secondary",
|
|
31207
31037
|
size: "sm",
|
|
31208
31038
|
onClick: () => {
|
|
31209
|
-
p((e) =>
|
|
31039
|
+
p((e) => PM(e));
|
|
31210
31040
|
},
|
|
31211
31041
|
children: [/* @__PURE__ */ V(Zt, { className: "h-3 w-3" }), /* @__PURE__ */ V("span", {
|
|
31212
31042
|
className: "ml-1",
|
|
@@ -31233,7 +31063,7 @@ function fP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
|
|
|
31233
31063
|
//#endregion
|
|
31234
31064
|
//#region src/page/frames/CorpusAnnotateOverlay.tsx
|
|
31235
31065
|
i();
|
|
31236
|
-
function
|
|
31066
|
+
function rP({ open: e, frames: t, activeFrameId: n, onActiveFrame: r, onClose: i, onFramesChanged: o, onSaved: s }) {
|
|
31237
31067
|
let [c, l] = a(null);
|
|
31238
31068
|
return y(() => {
|
|
31239
31069
|
l(null);
|
|
@@ -31261,7 +31091,7 @@ function pP({ open: e, frames: t, activeFrameId: n, onActiveFrame: r, onClose: i
|
|
|
31261
31091
|
})
|
|
31262
31092
|
}), /* @__PURE__ */ V(Fp, {
|
|
31263
31093
|
className: "flex min-h-0 flex-1 flex-col overflow-y-auto p-3 sm:p-4",
|
|
31264
|
-
children: /* @__PURE__ */ V(
|
|
31094
|
+
children: /* @__PURE__ */ V(nP, {
|
|
31265
31095
|
frames: t,
|
|
31266
31096
|
activeFrameId: n,
|
|
31267
31097
|
onActiveFrame: r,
|
|
@@ -31276,7 +31106,7 @@ function pP({ open: e, frames: t, activeFrameId: n, onActiveFrame: r, onClose: i
|
|
|
31276
31106
|
//#endregion
|
|
31277
31107
|
//#region src/page/frames/RetrainCollectionsList.tsx
|
|
31278
31108
|
i();
|
|
31279
|
-
function
|
|
31109
|
+
function iP({ collections: e, isLoading: t, selectedId: n, onSelect: r, onCreate: i, onRename: o, onDelete: s }) {
|
|
31280
31110
|
let [c, l] = a(""), [u, d] = a(null), [f, p] = a(null), m = async () => {
|
|
31281
31111
|
let e = await i(c);
|
|
31282
31112
|
d(e), e === null && l("");
|
|
@@ -31384,19 +31214,19 @@ function mP({ collections: e, isLoading: t, selectedId: n, onSelect: r, onCreate
|
|
|
31384
31214
|
}
|
|
31385
31215
|
//#endregion
|
|
31386
31216
|
//#region src/page/frames/CorpusCollectionsSection.tsx
|
|
31387
|
-
var
|
|
31217
|
+
var aP = {
|
|
31388
31218
|
"empty-name": "Give the collection a name.",
|
|
31389
31219
|
"duplicate-name": "A collection with that name already exists.",
|
|
31390
31220
|
"unknown-collection": "That collection no longer exists."
|
|
31391
31221
|
};
|
|
31392
|
-
function
|
|
31222
|
+
function oP({ collections: e, isLoading: t, selectedId: n, onSelect: r, onCreate: i, onRename: a, onDelete: o }) {
|
|
31393
31223
|
return /* @__PURE__ */ V(Wg, {
|
|
31394
31224
|
headingId: "corpus-collections-heading",
|
|
31395
31225
|
title: "Collections",
|
|
31396
31226
|
testId: "corpus-collections",
|
|
31397
31227
|
children: /* @__PURE__ */ V("div", {
|
|
31398
31228
|
className: w,
|
|
31399
|
-
children: /* @__PURE__ */ V(
|
|
31229
|
+
children: /* @__PURE__ */ V(iP, {
|
|
31400
31230
|
collections: e ?? [],
|
|
31401
31231
|
isLoading: t,
|
|
31402
31232
|
selectedId: n,
|
|
@@ -31410,8 +31240,8 @@ function gP({ collections: e, isLoading: t, selectedId: n, onSelect: r, onCreate
|
|
|
31410
31240
|
}
|
|
31411
31241
|
//#endregion
|
|
31412
31242
|
//#region src/page/frames/lib/authed-download.ts
|
|
31413
|
-
var
|
|
31414
|
-
function
|
|
31243
|
+
var sP = "camstack_admin_token", cP = 6e4;
|
|
31244
|
+
function lP(e) {
|
|
31415
31245
|
if (e === null) return null;
|
|
31416
31246
|
let t = /filename\*=UTF-8''([^;]+)/i.exec(e);
|
|
31417
31247
|
if (t?.[1] !== void 0) try {
|
|
@@ -31419,20 +31249,20 @@ function yP(e) {
|
|
|
31419
31249
|
} catch {}
|
|
31420
31250
|
return /filename="?([^";]+)"?/i.exec(e)?.[1]?.trim() ?? null;
|
|
31421
31251
|
}
|
|
31422
|
-
async function
|
|
31423
|
-
let n = localStorage.getItem(
|
|
31252
|
+
async function uP(e, t) {
|
|
31253
|
+
let n = localStorage.getItem(sP), r = {};
|
|
31424
31254
|
n !== null && (r.Authorization = `Bearer ${n}`);
|
|
31425
31255
|
let i = await fetch(e, { headers: r });
|
|
31426
31256
|
if (!i.ok) throw Error(`download failed: ${String(i.status)}`);
|
|
31427
|
-
let a = await i.blob(), o =
|
|
31257
|
+
let a = await i.blob(), o = lP(i.headers.get("content-disposition")) ?? t, s = URL.createObjectURL(a), c = document.createElement("a");
|
|
31428
31258
|
c.href = s, c.download = o, c.click(), setTimeout(() => {
|
|
31429
31259
|
URL.revokeObjectURL(s);
|
|
31430
|
-
},
|
|
31260
|
+
}, cP);
|
|
31431
31261
|
}
|
|
31432
31262
|
//#endregion
|
|
31433
31263
|
//#region src/page/frames/CorpusFilterBar.tsx
|
|
31434
31264
|
i();
|
|
31435
|
-
var
|
|
31265
|
+
var dP = [
|
|
31436
31266
|
{
|
|
31437
31267
|
value: void 0,
|
|
31438
31268
|
label: "All"
|
|
@@ -31449,7 +31279,7 @@ var xP = [
|
|
|
31449
31279
|
value: "complete",
|
|
31450
31280
|
label: "Complete"
|
|
31451
31281
|
}
|
|
31452
|
-
],
|
|
31282
|
+
], fP = [
|
|
31453
31283
|
"person",
|
|
31454
31284
|
"vehicle",
|
|
31455
31285
|
"animal",
|
|
@@ -31457,10 +31287,10 @@ var xP = [
|
|
|
31457
31287
|
"face",
|
|
31458
31288
|
"plate"
|
|
31459
31289
|
];
|
|
31460
|
-
function
|
|
31290
|
+
function pP(e) {
|
|
31461
31291
|
return e ?? "all";
|
|
31462
31292
|
}
|
|
31463
|
-
function
|
|
31293
|
+
function mP({ filter: e, onChange: t, cameraItems: n, camerasListState: r, collections: i, collectionsPending: o }) {
|
|
31464
31294
|
let s = ac(m(() => ({
|
|
31465
31295
|
...e.workState === void 0 ? {} : { workState: e.workState },
|
|
31466
31296
|
...e.deviceIds.length > 0 ? { deviceIds: [...e.deviceIds] } : {},
|
|
@@ -31484,7 +31314,7 @@ function wP({ filter: e, onChange: t, cameraItems: n, camerasListState: r, colle
|
|
|
31484
31314
|
if (s.data !== void 0) {
|
|
31485
31315
|
l(!0), d(null);
|
|
31486
31316
|
try {
|
|
31487
|
-
await
|
|
31317
|
+
await uP(ae(s.data.url), "camstack-retrain-export.tar");
|
|
31488
31318
|
} catch (e) {
|
|
31489
31319
|
d(e instanceof Error ? e.message : String(e));
|
|
31490
31320
|
} finally {
|
|
@@ -31504,8 +31334,8 @@ function wP({ filter: e, onChange: t, cameraItems: n, camerasListState: r, colle
|
|
|
31504
31334
|
role: "group",
|
|
31505
31335
|
"aria-label": "Work state",
|
|
31506
31336
|
"data-testid": "corpus-work-state-filter",
|
|
31507
|
-
children:
|
|
31508
|
-
let n =
|
|
31337
|
+
children: dP.map((t) => {
|
|
31338
|
+
let n = pP(e.workState) === pP(t.value);
|
|
31509
31339
|
return /* @__PURE__ */ V("button", {
|
|
31510
31340
|
type: "button",
|
|
31511
31341
|
"aria-pressed": n,
|
|
@@ -31514,12 +31344,12 @@ function wP({ filter: e, onChange: t, cameraItems: n, camerasListState: r, colle
|
|
|
31514
31344
|
},
|
|
31515
31345
|
className: J(P, "px-2", n ? ne : ee),
|
|
31516
31346
|
children: t.label
|
|
31517
|
-
},
|
|
31347
|
+
}, pP(t.value));
|
|
31518
31348
|
})
|
|
31519
31349
|
}),
|
|
31520
31350
|
/* @__PURE__ */ V("div", {
|
|
31521
31351
|
className: "min-w-0 flex-1 basis-full sm:basis-64",
|
|
31522
|
-
children: /* @__PURE__ */ V(
|
|
31352
|
+
children: /* @__PURE__ */ V(fM, {
|
|
31523
31353
|
devices: n,
|
|
31524
31354
|
listState: r,
|
|
31525
31355
|
value: e.deviceIds,
|
|
@@ -31565,7 +31395,7 @@ function wP({ filter: e, onChange: t, cameraItems: n, camerasListState: r, colle
|
|
|
31565
31395
|
role: "group",
|
|
31566
31396
|
"aria-label": "Annotated classes",
|
|
31567
31397
|
"data-testid": "corpus-class-filter",
|
|
31568
|
-
children:
|
|
31398
|
+
children: fP.map((t) => {
|
|
31569
31399
|
let n = e.classes.includes(t);
|
|
31570
31400
|
return /* @__PURE__ */ V("button", {
|
|
31571
31401
|
type: "button",
|
|
@@ -31588,7 +31418,7 @@ function wP({ filter: e, onChange: t, cameraItems: n, camerasListState: r, colle
|
|
|
31588
31418
|
}
|
|
31589
31419
|
//#endregion
|
|
31590
31420
|
//#region src/page/frames/corpus-frame-badge.ts
|
|
31591
|
-
function
|
|
31421
|
+
function hP(e) {
|
|
31592
31422
|
switch (e) {
|
|
31593
31423
|
case "unannotated": return {
|
|
31594
31424
|
label: "To do",
|
|
@@ -31606,13 +31436,13 @@ function TP(e) {
|
|
|
31606
31436
|
}
|
|
31607
31437
|
//#endregion
|
|
31608
31438
|
//#region src/page/frames/CorpusFrameGrid.tsx
|
|
31609
|
-
var
|
|
31439
|
+
var gP = [
|
|
31610
31440
|
25,
|
|
31611
31441
|
50,
|
|
31612
31442
|
100
|
|
31613
31443
|
];
|
|
31614
|
-
function
|
|
31615
|
-
let r = tc({ frameId: e.frameId }), i =
|
|
31444
|
+
function _P({ frame: e, cameraName: t, onOpen: n }) {
|
|
31445
|
+
let r = tc({ frameId: e.frameId }), i = hP(e.workState), a = r.data === void 0 ? void 0 : `data:image/jpeg;base64,${r.data.base64}`;
|
|
31616
31446
|
return /* @__PURE__ */ H("button", {
|
|
31617
31447
|
type: "button",
|
|
31618
31448
|
className: "group flex min-w-0 flex-col overflow-hidden rounded-md border border-border bg-surface text-left hover:border-primary/40 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary/40",
|
|
@@ -31640,7 +31470,7 @@ function DP({ frame: e, cameraName: t, onOpen: n }) {
|
|
|
31640
31470
|
})]
|
|
31641
31471
|
});
|
|
31642
31472
|
}
|
|
31643
|
-
function
|
|
31473
|
+
function vP({ frames: e, total: t, page: n, pageSize: r, isLoading: i, isError: a, deviceNames: o, onPageChange: s, onPageSizeChange: c, onOpenFrame: l }) {
|
|
31644
31474
|
let u = e !== void 0 && t !== void 0;
|
|
31645
31475
|
return /* @__PURE__ */ H("div", {
|
|
31646
31476
|
className: "space-y-3",
|
|
@@ -31662,7 +31492,7 @@ function OP({ frames: e, total: t, page: n, pageSize: r, isLoading: i, isError:
|
|
|
31662
31492
|
}) : null,
|
|
31663
31493
|
u && e.length > 0 ? /* @__PURE__ */ V("div", {
|
|
31664
31494
|
className: "grid grid-cols-2 gap-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5",
|
|
31665
|
-
children: e.map((e) => /* @__PURE__ */ V(
|
|
31495
|
+
children: e.map((e) => /* @__PURE__ */ V(_P, {
|
|
31666
31496
|
frame: e,
|
|
31667
31497
|
cameraName: o.get(e.deviceId) ?? `Camera ${String(e.deviceId)}`,
|
|
31668
31498
|
onOpen: () => {
|
|
@@ -31674,7 +31504,7 @@ function OP({ frames: e, total: t, page: n, pageSize: r, isLoading: i, isError:
|
|
|
31674
31504
|
className: "flex flex-wrap items-center justify-between gap-2",
|
|
31675
31505
|
children: [/* @__PURE__ */ V(dA, {
|
|
31676
31506
|
value: r,
|
|
31677
|
-
options:
|
|
31507
|
+
options: gP,
|
|
31678
31508
|
onChange: c,
|
|
31679
31509
|
ariaLabel: "Frames per page"
|
|
31680
31510
|
}), /* @__PURE__ */ V(vd, {
|
|
@@ -31691,18 +31521,18 @@ function OP({ frames: e, total: t, page: n, pageSize: r, isLoading: i, isError:
|
|
|
31691
31521
|
//#endregion
|
|
31692
31522
|
//#region src/page/frames/CorpusKpiBar.tsx
|
|
31693
31523
|
i();
|
|
31694
|
-
var
|
|
31695
|
-
function
|
|
31524
|
+
var yP = 8;
|
|
31525
|
+
function bP(e, t) {
|
|
31696
31526
|
return t.get(e) ?? `Camera ${String(e)}`;
|
|
31697
31527
|
}
|
|
31698
|
-
function
|
|
31528
|
+
function xP(e) {
|
|
31699
31529
|
return e === null ? "—" : `${(e * 100).toFixed(0)}%`;
|
|
31700
31530
|
}
|
|
31701
|
-
function
|
|
31531
|
+
function SP(e) {
|
|
31702
31532
|
return [...e].toSorted((e, t) => t.unannotated === e.unannotated ? e.deviceId - t.deviceId : t.unannotated - e.unannotated);
|
|
31703
31533
|
}
|
|
31704
|
-
function
|
|
31705
|
-
let [o, s] = a(!1), c = m(() => e === void 0 ? [] :
|
|
31534
|
+
function CP({ kpi: e, isLoading: t, isError: n, deviceNames: r, onSelectCamera: i }) {
|
|
31535
|
+
let [o, s] = a(!1), c = m(() => e === void 0 ? [] : SP(e.cameras), [e]), l = o ? c : c.slice(0, yP);
|
|
31706
31536
|
return /* @__PURE__ */ H("div", {
|
|
31707
31537
|
className: "space-y-3",
|
|
31708
31538
|
"data-testid": "corpus-kpi-bar",
|
|
@@ -31724,22 +31554,22 @@ function NP({ kpi: e, isLoading: t, isError: n, deviceNames: r, onSelectCamera:
|
|
|
31724
31554
|
e === void 0 ? null : /* @__PURE__ */ H("div", {
|
|
31725
31555
|
className: j,
|
|
31726
31556
|
children: [
|
|
31727
|
-
/* @__PURE__ */ V(
|
|
31557
|
+
/* @__PURE__ */ V(RA, {
|
|
31728
31558
|
icon: $n,
|
|
31729
31559
|
label: "Total frames",
|
|
31730
31560
|
value: e.total
|
|
31731
31561
|
}),
|
|
31732
|
-
/* @__PURE__ */ V(
|
|
31562
|
+
/* @__PURE__ */ V(RA, {
|
|
31733
31563
|
icon: an,
|
|
31734
31564
|
label: "Unannotated",
|
|
31735
31565
|
value: e.unannotated
|
|
31736
31566
|
}),
|
|
31737
|
-
/* @__PURE__ */ V(
|
|
31567
|
+
/* @__PURE__ */ V(RA, {
|
|
31738
31568
|
icon: Vr,
|
|
31739
31569
|
label: "Annotated",
|
|
31740
31570
|
value: e.annotated
|
|
31741
31571
|
}),
|
|
31742
|
-
/* @__PURE__ */ V(
|
|
31572
|
+
/* @__PURE__ */ V(RA, {
|
|
31743
31573
|
icon: rn,
|
|
31744
31574
|
label: "Complete",
|
|
31745
31575
|
value: e.complete
|
|
@@ -31773,10 +31603,10 @@ function NP({ kpi: e, isLoading: t, isError: n, deviceNames: r, onSelectCamera:
|
|
|
31773
31603
|
className: "flex items-center justify-between gap-2",
|
|
31774
31604
|
children: [/* @__PURE__ */ V("span", {
|
|
31775
31605
|
className: "min-w-0 truncate font-medium text-foreground",
|
|
31776
|
-
children:
|
|
31606
|
+
children: bP(e.deviceId, r)
|
|
31777
31607
|
}), /* @__PURE__ */ V("span", {
|
|
31778
31608
|
className: "shrink-0 text-foreground-muted",
|
|
31779
|
-
children:
|
|
31609
|
+
children: xP(e.pctOfCorpus)
|
|
31780
31610
|
})]
|
|
31781
31611
|
}),
|
|
31782
31612
|
/* @__PURE__ */ H("div", {
|
|
@@ -31799,7 +31629,7 @@ function NP({ kpi: e, isLoading: t, isError: n, deviceNames: r, onSelectCamera:
|
|
|
31799
31629
|
}) }, e.deviceId);
|
|
31800
31630
|
})
|
|
31801
31631
|
}),
|
|
31802
|
-
!o && c.length >
|
|
31632
|
+
!o && c.length > yP ? /* @__PURE__ */ H(X, {
|
|
31803
31633
|
type: "button",
|
|
31804
31634
|
variant: "ghost",
|
|
31805
31635
|
size: "sm",
|
|
@@ -31820,11 +31650,11 @@ function NP({ kpi: e, isLoading: t, isError: n, deviceNames: r, onSelectCamera:
|
|
|
31820
31650
|
}
|
|
31821
31651
|
//#endregion
|
|
31822
31652
|
//#region src/page/frames/corpus-filter-url.ts
|
|
31823
|
-
var
|
|
31653
|
+
var wP = new Set([
|
|
31824
31654
|
"unannotated",
|
|
31825
31655
|
"annotated",
|
|
31826
31656
|
"complete"
|
|
31827
|
-
]),
|
|
31657
|
+
]), TP = new Set([
|
|
31828
31658
|
"person",
|
|
31829
31659
|
"vehicle",
|
|
31830
31660
|
"animal",
|
|
@@ -31832,72 +31662,72 @@ var PP = new Set([
|
|
|
31832
31662
|
"face",
|
|
31833
31663
|
"plate"
|
|
31834
31664
|
]);
|
|
31835
|
-
function
|
|
31665
|
+
function EP(e) {
|
|
31836
31666
|
return e === null || e.trim() === "" ? [] : e.split(",").map((e) => e.trim()).filter((e) => e.length > 0);
|
|
31837
31667
|
}
|
|
31838
|
-
function
|
|
31668
|
+
function DP(e) {
|
|
31839
31669
|
let t = [];
|
|
31840
|
-
for (let n of
|
|
31670
|
+
for (let n of EP(e)) {
|
|
31841
31671
|
let e = Number.parseInt(n, 10);
|
|
31842
31672
|
Number.isInteger(e) && e > 0 && !t.includes(e) && t.push(e);
|
|
31843
31673
|
}
|
|
31844
31674
|
return t;
|
|
31845
31675
|
}
|
|
31846
|
-
function
|
|
31847
|
-
return
|
|
31676
|
+
function OP(e) {
|
|
31677
|
+
return TP.has(e);
|
|
31848
31678
|
}
|
|
31849
|
-
function
|
|
31850
|
-
return
|
|
31679
|
+
function kP(e) {
|
|
31680
|
+
return wP.has(e);
|
|
31851
31681
|
}
|
|
31852
|
-
function
|
|
31682
|
+
function AP(e) {
|
|
31853
31683
|
let t = [];
|
|
31854
|
-
for (let n of
|
|
31684
|
+
for (let n of EP(e)) !OP(n) || t.includes(n) || t.push(n);
|
|
31855
31685
|
return t;
|
|
31856
31686
|
}
|
|
31857
|
-
function
|
|
31858
|
-
if (!(e === null || e === "")) return
|
|
31687
|
+
function jP(e) {
|
|
31688
|
+
if (!(e === null || e === "")) return kP(e) ? e : void 0;
|
|
31859
31689
|
}
|
|
31860
|
-
function
|
|
31690
|
+
function MP(e) {
|
|
31861
31691
|
if (e === null || e === "") return 1;
|
|
31862
31692
|
let t = Number.parseInt(e, 10);
|
|
31863
31693
|
return Number.isInteger(t) && t >= 1 ? t : 1;
|
|
31864
31694
|
}
|
|
31865
|
-
function
|
|
31695
|
+
function NP(e) {
|
|
31866
31696
|
let t = e.get("collection")?.trim() ?? "";
|
|
31867
31697
|
return {
|
|
31868
|
-
workState:
|
|
31869
|
-
deviceIds:
|
|
31698
|
+
workState: jP(e.get("workState")),
|
|
31699
|
+
deviceIds: DP(e.get("camera")),
|
|
31870
31700
|
collectionId: t.length > 0 ? t : void 0,
|
|
31871
|
-
classes:
|
|
31872
|
-
page:
|
|
31701
|
+
classes: AP(e.get("class")),
|
|
31702
|
+
page: MP(e.get("page"))
|
|
31873
31703
|
};
|
|
31874
31704
|
}
|
|
31875
|
-
function
|
|
31705
|
+
function PP(e, t) {
|
|
31876
31706
|
t.workState === void 0 ? e.delete("workState") : e.set("workState", t.workState), t.deviceIds.length === 0 ? e.delete("camera") : e.set("camera", t.deviceIds.join(",")), t.collectionId === void 0 || t.collectionId === "" ? e.delete("collection") : e.set("collection", t.collectionId), t.classes.length === 0 ? e.delete("class") : e.set("class", t.classes.join(",")), t.page <= 1 ? e.delete("page") : e.set("page", String(t.page));
|
|
31877
31707
|
}
|
|
31878
|
-
function
|
|
31708
|
+
function FP(e) {
|
|
31879
31709
|
if (typeof window > "u") return;
|
|
31880
31710
|
let t = new URL(window.location.href);
|
|
31881
|
-
|
|
31711
|
+
PP(t.searchParams, e), window.history.replaceState({}, "", t.toString());
|
|
31882
31712
|
}
|
|
31883
31713
|
//#endregion
|
|
31884
31714
|
//#region src/page/frames/FramesSection.tsx
|
|
31885
31715
|
i();
|
|
31886
|
-
var
|
|
31716
|
+
var IP = [
|
|
31887
31717
|
25,
|
|
31888
31718
|
50,
|
|
31889
31719
|
100
|
|
31890
31720
|
];
|
|
31891
|
-
function
|
|
31721
|
+
function LP() {
|
|
31892
31722
|
return typeof window > "u" ? {
|
|
31893
31723
|
workState: void 0,
|
|
31894
31724
|
deviceIds: [],
|
|
31895
31725
|
collectionId: void 0,
|
|
31896
31726
|
classes: [],
|
|
31897
31727
|
page: 1
|
|
31898
|
-
} :
|
|
31728
|
+
} : NP(new URLSearchParams(window.location.search));
|
|
31899
31729
|
}
|
|
31900
|
-
function
|
|
31730
|
+
function RP(e, t) {
|
|
31901
31731
|
return {
|
|
31902
31732
|
page: e.page,
|
|
31903
31733
|
pageSize: t,
|
|
@@ -31907,13 +31737,13 @@ function JP(e, t) {
|
|
|
31907
31737
|
...e.classes.length > 0 ? { classes: [...e.classes] } : {}
|
|
31908
31738
|
};
|
|
31909
31739
|
}
|
|
31910
|
-
function
|
|
31911
|
-
let [e, t] = a(
|
|
31740
|
+
function zP() {
|
|
31741
|
+
let [e, t] = a(LP), [n, r] = lA({
|
|
31912
31742
|
storageKey: "training-corpus-page-size",
|
|
31913
|
-
options:
|
|
31743
|
+
options: IP,
|
|
31914
31744
|
defaultSize: 50
|
|
31915
31745
|
}), [i, o] = a(null), c = s((e) => {
|
|
31916
|
-
t(e),
|
|
31746
|
+
t(e), FP(e);
|
|
31917
31747
|
}, []), l = Ws({
|
|
31918
31748
|
projection: "slim",
|
|
31919
31749
|
isCamera: !0
|
|
@@ -31926,7 +31756,7 @@ function YP() {
|
|
|
31926
31756
|
name: e.name,
|
|
31927
31757
|
type: e.type,
|
|
31928
31758
|
location: typeof e.location == "string" ? e.location : null
|
|
31929
|
-
})), [l.data]), f =
|
|
31759
|
+
})), [l.data]), f = Zj(l), p = ec({}), h = $s(RP(e, n)), g = uc({}), _ = lc(), v = dc(), b = fc();
|
|
31930
31760
|
y(() => {
|
|
31931
31761
|
let t = h.data?.total;
|
|
31932
31762
|
if (t === void 0) return;
|
|
@@ -31949,7 +31779,7 @@ function YP() {
|
|
|
31949
31779
|
});
|
|
31950
31780
|
}, [e, c]), S = s(async (t) => {
|
|
31951
31781
|
let n = await _.mutateAsync({ name: t });
|
|
31952
|
-
return await g.refetch(), n.kind === "refused" ?
|
|
31782
|
+
return await g.refetch(), n.kind === "refused" ? aP[n.reason] ?? n.reason : (c({
|
|
31953
31783
|
...e,
|
|
31954
31784
|
collectionId: n.collection.id,
|
|
31955
31785
|
page: 1
|
|
@@ -31964,7 +31794,7 @@ function YP() {
|
|
|
31964
31794
|
id: e,
|
|
31965
31795
|
name: t
|
|
31966
31796
|
});
|
|
31967
|
-
return await g.refetch(), n.kind === "refused" ?
|
|
31797
|
+
return await g.refetch(), n.kind === "refused" ? aP[n.reason] ?? n.reason : null;
|
|
31968
31798
|
}, [v, g]), w = s(async (t) => {
|
|
31969
31799
|
await b.mutateAsync({ id: t }), e.collectionId === t && c({
|
|
31970
31800
|
...e,
|
|
@@ -31987,14 +31817,14 @@ function YP() {
|
|
|
31987
31817
|
className: "space-y-4",
|
|
31988
31818
|
"data-testid": "frames-section",
|
|
31989
31819
|
children: [
|
|
31990
|
-
/* @__PURE__ */ V(
|
|
31820
|
+
/* @__PURE__ */ V(CP, {
|
|
31991
31821
|
kpi: p.data,
|
|
31992
31822
|
isLoading: p.isLoading,
|
|
31993
31823
|
isError: p.isError,
|
|
31994
31824
|
deviceNames: u,
|
|
31995
31825
|
onSelectCamera: x
|
|
31996
31826
|
}),
|
|
31997
|
-
/* @__PURE__ */ V(
|
|
31827
|
+
/* @__PURE__ */ V(oP, {
|
|
31998
31828
|
collections: g.data,
|
|
31999
31829
|
isLoading: g.isLoading,
|
|
32000
31830
|
selectedId: e.collectionId ?? null,
|
|
@@ -32009,7 +31839,7 @@ function YP() {
|
|
|
32009
31839
|
onRename: C,
|
|
32010
31840
|
onDelete: w
|
|
32011
31841
|
}),
|
|
32012
|
-
/* @__PURE__ */ V(
|
|
31842
|
+
/* @__PURE__ */ V(mP, {
|
|
32013
31843
|
filter: e,
|
|
32014
31844
|
onChange: c,
|
|
32015
31845
|
cameraItems: d,
|
|
@@ -32017,7 +31847,7 @@ function YP() {
|
|
|
32017
31847
|
collections: g.data,
|
|
32018
31848
|
collectionsPending: g.isLoading && g.data === void 0
|
|
32019
31849
|
}),
|
|
32020
|
-
/* @__PURE__ */ V(
|
|
31850
|
+
/* @__PURE__ */ V(vP, {
|
|
32021
31851
|
frames: h.data?.frames,
|
|
32022
31852
|
total: h.data?.total,
|
|
32023
31853
|
page: e.page,
|
|
@@ -32039,7 +31869,7 @@ function YP() {
|
|
|
32039
31869
|
},
|
|
32040
31870
|
onOpenFrame: T
|
|
32041
31871
|
}),
|
|
32042
|
-
i === null ? null : /* @__PURE__ */ V(
|
|
31872
|
+
i === null ? null : /* @__PURE__ */ V(rP, {
|
|
32043
31873
|
open: !0,
|
|
32044
31874
|
frames: D,
|
|
32045
31875
|
activeFrameId: i,
|
|
@@ -32053,7 +31883,7 @@ function YP() {
|
|
|
32053
31883
|
}
|
|
32054
31884
|
//#endregion
|
|
32055
31885
|
//#region src/page/view-model.ts
|
|
32056
|
-
var
|
|
31886
|
+
var BP = [
|
|
32057
31887
|
"uploading",
|
|
32058
31888
|
"submitted",
|
|
32059
31889
|
"starting",
|
|
@@ -32062,7 +31892,7 @@ var XP = [
|
|
|
32062
31892
|
"ready",
|
|
32063
31893
|
"registered",
|
|
32064
31894
|
"canary"
|
|
32065
|
-
],
|
|
31895
|
+
], VP = {
|
|
32066
31896
|
queued: "Queued",
|
|
32067
31897
|
uploading: "Uploading",
|
|
32068
31898
|
submitted: "Submitted",
|
|
@@ -32078,7 +31908,7 @@ var XP = [
|
|
|
32078
31908
|
lost: "Lost",
|
|
32079
31909
|
expired: "Expired",
|
|
32080
31910
|
discarded: "Discarded"
|
|
32081
|
-
},
|
|
31911
|
+
}, HP = new Set([
|
|
32082
31912
|
"ready",
|
|
32083
31913
|
"registered",
|
|
32084
31914
|
"canary",
|
|
@@ -32088,64 +31918,64 @@ var XP = [
|
|
|
32088
31918
|
"expired",
|
|
32089
31919
|
"discarded"
|
|
32090
31920
|
]);
|
|
32091
|
-
function
|
|
32092
|
-
return
|
|
31921
|
+
function UP(e) {
|
|
31922
|
+
return HP.has(e);
|
|
32093
31923
|
}
|
|
32094
|
-
function
|
|
32095
|
-
return e.some((e) =>
|
|
31924
|
+
function WP(e) {
|
|
31925
|
+
return e.some((e) => !UP(e.state));
|
|
32096
31926
|
}
|
|
32097
|
-
function
|
|
32098
|
-
let t =
|
|
31927
|
+
function GP(e) {
|
|
31928
|
+
let t = BP.indexOf(e.state);
|
|
32099
31929
|
if (t >= 0) return t;
|
|
32100
|
-
if (e.artifacts !== null || e.registeredModelIds.length > 0) return
|
|
31930
|
+
if (e.artifacts !== null || e.registeredModelIds.length > 0) return BP.indexOf("ready");
|
|
32101
31931
|
switch (e.provider.state) {
|
|
32102
|
-
case "succeeded": return
|
|
31932
|
+
case "succeeded": return BP.indexOf("collecting");
|
|
32103
31933
|
case "running":
|
|
32104
31934
|
case "failed":
|
|
32105
|
-
case "cancelled": return
|
|
32106
|
-
case "starting": return
|
|
32107
|
-
case "pending": return
|
|
31935
|
+
case "cancelled": return BP.indexOf("running");
|
|
31936
|
+
case "starting": return BP.indexOf("starting");
|
|
31937
|
+
case "pending": return BP.indexOf("submitted");
|
|
32108
31938
|
default: return 0;
|
|
32109
31939
|
}
|
|
32110
31940
|
}
|
|
32111
|
-
function
|
|
32112
|
-
if (e.state === "queued") return
|
|
31941
|
+
function KP(e) {
|
|
31942
|
+
if (e.state === "queued") return BP.map((e) => ({
|
|
32113
31943
|
state: e,
|
|
32114
|
-
label:
|
|
31944
|
+
label: VP[e],
|
|
32115
31945
|
status: "todo"
|
|
32116
31946
|
}));
|
|
32117
|
-
let t = !
|
|
32118
|
-
return
|
|
31947
|
+
let t = !BP.includes(e.state), n = GP(e);
|
|
31948
|
+
return BP.map((r, i) => {
|
|
32119
31949
|
let a = "todo";
|
|
32120
31950
|
return i < n ? a = "done" : i === n && (a = t && e.state !== "expired" ? "failed" : "current"), {
|
|
32121
31951
|
state: r,
|
|
32122
|
-
label:
|
|
31952
|
+
label: VP[r],
|
|
32123
31953
|
status: a
|
|
32124
31954
|
};
|
|
32125
31955
|
});
|
|
32126
31956
|
}
|
|
32127
|
-
function
|
|
31957
|
+
function qP(e, t) {
|
|
32128
31958
|
let n = `$${e.toFixed(2)}`;
|
|
32129
31959
|
return t ? `≈ ${n}` : n;
|
|
32130
31960
|
}
|
|
32131
|
-
function
|
|
31961
|
+
function JP(e) {
|
|
32132
31962
|
let t = Math.max(0, Math.round(e));
|
|
32133
31963
|
return t < 60 ? `${String(t)} s` : t < 3600 ? `${String(Math.floor(t / 60))} min ${String(t % 60)} s` : `${String(Math.floor(t / 3600))} h ${String(Math.floor(t % 3600 / 60))} min`;
|
|
32134
31964
|
}
|
|
32135
|
-
function
|
|
31965
|
+
function YP(e) {
|
|
32136
31966
|
return e < 1024 * 1024 ? `${(e / 1024).toFixed(0)} KB` : e < 1024 ** 3 ? `${(e / 1024 ** 2).toFixed(1)} MB` : `${(e / 1024 ** 3).toFixed(2)} GB`;
|
|
32137
31967
|
}
|
|
32138
|
-
function
|
|
31968
|
+
function XP(e) {
|
|
32139
31969
|
return e == null ? "—" : `${(e * 100).toFixed(1)}%`;
|
|
32140
31970
|
}
|
|
32141
|
-
function
|
|
31971
|
+
function ZP(e, t) {
|
|
32142
31972
|
let n = e.provider.startedAt;
|
|
32143
31973
|
return n === null ? null : ((e.provider.endedAt ?? t) - n) / 1e3;
|
|
32144
31974
|
}
|
|
32145
|
-
function
|
|
31975
|
+
function QP(e, t) {
|
|
32146
31976
|
return e?.classes[t] ?? null;
|
|
32147
31977
|
}
|
|
32148
|
-
function
|
|
31978
|
+
function $P(e) {
|
|
32149
31979
|
let t = e.evaluation;
|
|
32150
31980
|
return t === void 0 ? [] : [...new Set([
|
|
32151
31981
|
...Object.keys(t.baseline?.classes ?? {}),
|
|
@@ -32153,12 +31983,12 @@ function lF(e) {
|
|
|
32153
31983
|
...Object.keys(t.candidateInt8?.classes ?? {})
|
|
32154
31984
|
])].toSorted().map((e) => ({
|
|
32155
31985
|
cls: e,
|
|
32156
|
-
baseline:
|
|
32157
|
-
candidate:
|
|
32158
|
-
int8:
|
|
31986
|
+
baseline: QP(t.baseline, e),
|
|
31987
|
+
candidate: QP(t.candidate, e),
|
|
31988
|
+
int8: QP(t.candidateInt8, e)
|
|
32159
31989
|
}));
|
|
32160
31990
|
}
|
|
32161
|
-
function
|
|
31991
|
+
function eF(e) {
|
|
32162
31992
|
let t = e.evaluation?.recallDeltaByCamera ?? {}, n = [];
|
|
32163
31993
|
for (let [e, r] of Object.entries(t)) for (let [t, i] of Object.entries(r)) {
|
|
32164
31994
|
let r = i < -.01 ? "worse" : i > .01 ? "better" : "same";
|
|
@@ -32171,17 +32001,17 @@ function uF(e) {
|
|
|
32171
32001
|
}
|
|
32172
32002
|
return n.toSorted((e, t) => e.cls.localeCompare(t.cls) || e.deviceId - t.deviceId);
|
|
32173
32003
|
}
|
|
32174
|
-
function
|
|
32004
|
+
function tF(e) {
|
|
32175
32005
|
return e === "ready" || e === "registered" || e === "canary" ? "success" : e === "failed" || e === "lost" ? "danger" : e === "cancelling" || e === "cancelled" || e === "expired" || e === "discarded" ? "default" : "info";
|
|
32176
32006
|
}
|
|
32177
32007
|
//#endregion
|
|
32178
32008
|
//#region src/page/ComparisonTable.tsx
|
|
32179
|
-
var
|
|
32009
|
+
var nF = {
|
|
32180
32010
|
better: "text-success",
|
|
32181
32011
|
worse: "text-danger",
|
|
32182
32012
|
same: "text-foreground-muted"
|
|
32183
32013
|
};
|
|
32184
|
-
function
|
|
32014
|
+
function rF({ c: e }) {
|
|
32185
32015
|
if (e === null) return /* @__PURE__ */ V("td", {
|
|
32186
32016
|
className: "px-2 py-1 text-foreground-subtle",
|
|
32187
32017
|
children: "—"
|
|
@@ -32191,26 +32021,26 @@ function pF({ c: e }) {
|
|
|
32191
32021
|
className: "px-2 py-1 text-foreground",
|
|
32192
32022
|
children: [
|
|
32193
32023
|
"P ",
|
|
32194
|
-
|
|
32024
|
+
XP(e.precision),
|
|
32195
32025
|
" · R ",
|
|
32196
|
-
|
|
32026
|
+
XP(e.recall),
|
|
32197
32027
|
" · AP50 ",
|
|
32198
|
-
|
|
32028
|
+
XP(e.ap50),
|
|
32199
32029
|
/* @__PURE__ */ H("span", {
|
|
32200
32030
|
className: "block text-xs text-foreground-subtle",
|
|
32201
32031
|
children: [
|
|
32202
32032
|
"floor ",
|
|
32203
32033
|
e.floor === null ? "—" : e.floor.toFixed(2),
|
|
32204
32034
|
" · night R ",
|
|
32205
|
-
|
|
32035
|
+
XP(t),
|
|
32206
32036
|
n
|
|
32207
32037
|
]
|
|
32208
32038
|
})
|
|
32209
32039
|
]
|
|
32210
32040
|
});
|
|
32211
32041
|
}
|
|
32212
|
-
function
|
|
32213
|
-
let n =
|
|
32042
|
+
function iF({ result: e, cameraName: t }) {
|
|
32043
|
+
let n = $P(e), r = eF(e), i = n.some((e) => e.int8 !== null);
|
|
32214
32044
|
return n.length === 0 ? /* @__PURE__ */ V("p", {
|
|
32215
32045
|
className: "text-sm text-foreground-muted",
|
|
32216
32046
|
children: "No held-out evaluation in this result."
|
|
@@ -32251,16 +32081,16 @@ function mF({ result: e, cameraName: t }) {
|
|
|
32251
32081
|
")"
|
|
32252
32082
|
]
|
|
32253
32083
|
}),
|
|
32254
|
-
/* @__PURE__ */ V(
|
|
32255
|
-
/* @__PURE__ */ V(
|
|
32256
|
-
i && /* @__PURE__ */ V(
|
|
32084
|
+
/* @__PURE__ */ V(rF, { c: e.baseline }),
|
|
32085
|
+
/* @__PURE__ */ V(rF, { c: e.candidate }),
|
|
32086
|
+
i && /* @__PURE__ */ V(rF, { c: e.int8 })
|
|
32257
32087
|
]
|
|
32258
32088
|
}, e.cls)) })]
|
|
32259
32089
|
}), r.length > 0 && /* @__PURE__ */ V("ul", {
|
|
32260
32090
|
className: "flex flex-wrap gap-x-4 gap-y-1 text-xs",
|
|
32261
32091
|
"aria-label": "Recall change per camera",
|
|
32262
32092
|
children: r.map((e) => /* @__PURE__ */ H("li", {
|
|
32263
|
-
className:
|
|
32093
|
+
className: nF[e.tone],
|
|
32264
32094
|
children: [
|
|
32265
32095
|
t(e.deviceId),
|
|
32266
32096
|
" ",
|
|
@@ -32277,10 +32107,10 @@ function mF({ result: e, cameraName: t }) {
|
|
|
32277
32107
|
//#endregion
|
|
32278
32108
|
//#region src/page/use-async.ts
|
|
32279
32109
|
i();
|
|
32280
|
-
function
|
|
32110
|
+
function aF(e) {
|
|
32281
32111
|
return e instanceof Error ? e.message : String(e);
|
|
32282
32112
|
}
|
|
32283
|
-
function
|
|
32113
|
+
function oF(e, t, n = {}) {
|
|
32284
32114
|
let [r, i] = a({ status: "pending" }), [o, c] = a(0), l = u(e);
|
|
32285
32115
|
l.current = e;
|
|
32286
32116
|
let d = s(() => c((e) => e + 1), []);
|
|
@@ -32294,7 +32124,7 @@ function gF(e, t, n = {}) {
|
|
|
32294
32124
|
}).catch((t) => {
|
|
32295
32125
|
e && i({
|
|
32296
32126
|
status: "error",
|
|
32297
|
-
error:
|
|
32127
|
+
error: aF(t)
|
|
32298
32128
|
});
|
|
32299
32129
|
}), () => {
|
|
32300
32130
|
e = !1;
|
|
@@ -32318,13 +32148,13 @@ function gF(e, t, n = {}) {
|
|
|
32318
32148
|
//#endregion
|
|
32319
32149
|
//#region src/page/ResultPanel.tsx
|
|
32320
32150
|
i();
|
|
32321
|
-
function
|
|
32322
|
-
let i = Wl(), o =
|
|
32151
|
+
function sF({ job: e, trpc: t, onChanged: n, cameraName: r }) {
|
|
32152
|
+
let i = Wl(), o = oF(() => t.training.getJobResult.query({ id: e.id }), [e.id, e.state]), s = oF(async () => (await t.deviceManager.listAll.query({ slim: !0 })).filter((e) => e.type === "camera"), []), [c, l] = a([]), [u, d] = a(!1), [f, p] = a(null), m = async (e) => {
|
|
32323
32153
|
d(!0), p(null);
|
|
32324
32154
|
try {
|
|
32325
32155
|
await e(), n();
|
|
32326
32156
|
} catch (e) {
|
|
32327
|
-
p(
|
|
32157
|
+
p(aF(e));
|
|
32328
32158
|
} finally {
|
|
32329
32159
|
d(!1);
|
|
32330
32160
|
}
|
|
@@ -32366,7 +32196,7 @@ function _F({ job: e, trpc: t, onChanged: n, cameraName: r }) {
|
|
|
32366
32196
|
className: "space-y-3 border-t border-border pt-3",
|
|
32367
32197
|
"data-testid": "result-panel",
|
|
32368
32198
|
children: [
|
|
32369
|
-
/* @__PURE__ */ V(
|
|
32199
|
+
/* @__PURE__ */ V(iF, {
|
|
32370
32200
|
result: y,
|
|
32371
32201
|
cameraName: r
|
|
32372
32202
|
}),
|
|
@@ -32393,7 +32223,7 @@ function _F({ job: e, trpc: t, onChanged: n, cameraName: r }) {
|
|
|
32393
32223
|
children: [
|
|
32394
32224
|
b.length,
|
|
32395
32225
|
" files, ",
|
|
32396
|
-
|
|
32226
|
+
YP(b.reduce((e, t) => e + t.bytes, 0)),
|
|
32397
32227
|
" · ",
|
|
32398
32228
|
y.licence
|
|
32399
32229
|
]
|
|
@@ -32501,12 +32331,12 @@ function _F({ job: e, trpc: t, onChanged: n, cameraName: r }) {
|
|
|
32501
32331
|
}
|
|
32502
32332
|
//#endregion
|
|
32503
32333
|
//#region src/page/Sparkline.tsx
|
|
32504
|
-
function
|
|
32334
|
+
function cF(e, t, n) {
|
|
32505
32335
|
if (e.length === 0) return "";
|
|
32506
32336
|
let r = Math.max(...e, 1e-4), i = e.length > 1 ? t / (e.length - 1) : 0;
|
|
32507
32337
|
return e.map((e, t) => `${t === 0 ? "M" : "L"}${(t * i).toFixed(1)},${(n - e / r * n).toFixed(1)}`).join(" ");
|
|
32508
32338
|
}
|
|
32509
|
-
function
|
|
32339
|
+
function lF({ series: e, width: t = 160, height: n = 32 }) {
|
|
32510
32340
|
let r = e.map((e) => e.map50 ?? 0);
|
|
32511
32341
|
if (r.length < 2) return /* @__PURE__ */ V("span", {
|
|
32512
32342
|
className: "text-xs text-foreground-subtle",
|
|
@@ -32522,7 +32352,7 @@ function yF({ series: e, width: t = 160, height: n = 32 }) {
|
|
|
32522
32352
|
viewBox: `0 0 ${String(t)} ${String(n)}`,
|
|
32523
32353
|
"aria-label": "mAP50 per epoch",
|
|
32524
32354
|
children: /* @__PURE__ */ V("path", {
|
|
32525
|
-
d:
|
|
32355
|
+
d: cF(r, t, n),
|
|
32526
32356
|
fill: "none",
|
|
32527
32357
|
stroke: "currentColor",
|
|
32528
32358
|
strokeWidth: 1.5
|
|
@@ -32536,13 +32366,13 @@ function yF({ series: e, width: t = 160, height: n = 32 }) {
|
|
|
32536
32366
|
//#endregion
|
|
32537
32367
|
//#region src/page/JobDetail.tsx
|
|
32538
32368
|
i();
|
|
32539
|
-
var
|
|
32369
|
+
var uF = {
|
|
32540
32370
|
done: "bg-primary/15 text-primary",
|
|
32541
32371
|
current: "bg-primary text-primary-foreground",
|
|
32542
32372
|
failed: "bg-danger text-white",
|
|
32543
32373
|
todo: "bg-surface-hover text-foreground-subtle"
|
|
32544
32374
|
};
|
|
32545
|
-
function
|
|
32375
|
+
function dF({ lines: e }) {
|
|
32546
32376
|
let t = u(null);
|
|
32547
32377
|
return y(() => {
|
|
32548
32378
|
t.current !== null && (t.current.scrollTop = t.current.scrollHeight);
|
|
@@ -32553,8 +32383,8 @@ function xF({ lines: e }) {
|
|
|
32553
32383
|
children: e.join("\n")
|
|
32554
32384
|
});
|
|
32555
32385
|
}
|
|
32556
|
-
function
|
|
32557
|
-
let a =
|
|
32386
|
+
function fF({ job: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }) {
|
|
32387
|
+
let a = ZP(e, Date.now()), { epoch: o, epochs: s, etaSec: c, series: l } = e.progress, u = e.state === "ready" || e.state === "registered" || e.state === "canary", d = e.request.selection.collectionIds.map((e) => i(e));
|
|
32558
32388
|
return /* @__PURE__ */ H("section", {
|
|
32559
32389
|
className: "space-y-3 rounded-lg border border-border bg-surface p-3 sm:p-4",
|
|
32560
32390
|
"data-testid": `job-detail-${e.id}`,
|
|
@@ -32568,10 +32398,10 @@ function SF({ job: e, trpc: t, onChanged: n, cameraName: r, collectionName: i })
|
|
|
32568
32398
|
children: e.name
|
|
32569
32399
|
}),
|
|
32570
32400
|
/* @__PURE__ */ V(ll, {
|
|
32571
|
-
variant:
|
|
32572
|
-
children:
|
|
32401
|
+
variant: tF(e.state),
|
|
32402
|
+
children: VP[e.state]
|
|
32573
32403
|
}),
|
|
32574
|
-
e.stage !== null &&
|
|
32404
|
+
e.stage !== null && !UP(e.state) && /* @__PURE__ */ V(ll, {
|
|
32575
32405
|
variant: "info",
|
|
32576
32406
|
children: e.stage
|
|
32577
32407
|
}),
|
|
@@ -32596,10 +32426,10 @@ function SF({ job: e, trpc: t, onChanged: n, cameraName: r, collectionName: i })
|
|
|
32596
32426
|
/* @__PURE__ */ V("ol", {
|
|
32597
32427
|
className: "flex flex-wrap gap-1",
|
|
32598
32428
|
"aria-label": "Job progress",
|
|
32599
|
-
children:
|
|
32600
|
-
className: `rounded-full px-2 py-0.5 text-xs ${
|
|
32429
|
+
children: KP(e).map((t) => /* @__PURE__ */ V("li", {
|
|
32430
|
+
className: `rounded-full px-2 py-0.5 text-xs ${uF[t.status]}`,
|
|
32601
32431
|
"aria-current": t.status === "current" ? "step" : void 0,
|
|
32602
|
-
children: t.status === "failed" ? `${t.label} — ${
|
|
32432
|
+
children: t.status === "failed" ? `${t.label} — ${VP[e.state]}` : t.label
|
|
32603
32433
|
}, t.state))
|
|
32604
32434
|
}),
|
|
32605
32435
|
e.failure !== null && /* @__PURE__ */ H("p", {
|
|
@@ -32631,17 +32461,17 @@ function SF({ job: e, trpc: t, onChanged: n, cameraName: r, collectionName: i })
|
|
|
32631
32461
|
o,
|
|
32632
32462
|
" / ",
|
|
32633
32463
|
s,
|
|
32634
|
-
c !== null &&
|
|
32464
|
+
c !== null && !UP(e.state) ? ` · about ${JP(c)} left` : ""
|
|
32635
32465
|
]
|
|
32636
32466
|
})]
|
|
32637
32467
|
}),
|
|
32638
|
-
/* @__PURE__ */ V(
|
|
32468
|
+
/* @__PURE__ */ V(lF, { series: l }),
|
|
32639
32469
|
/* @__PURE__ */ H("p", {
|
|
32640
32470
|
className: "text-xs text-foreground-muted",
|
|
32641
32471
|
children: [
|
|
32642
|
-
a !== null && `Ran ${
|
|
32472
|
+
a !== null && `Ran ${JP(a)} · `,
|
|
32643
32473
|
"Cost ",
|
|
32644
|
-
|
|
32474
|
+
qP(e.provider.costUsd, e.provider.costIsEstimate),
|
|
32645
32475
|
" of $",
|
|
32646
32476
|
e.maxCostUsd.toFixed(2),
|
|
32647
32477
|
" cap",
|
|
@@ -32649,8 +32479,8 @@ function SF({ job: e, trpc: t, onChanged: n, cameraName: r, collectionName: i })
|
|
|
32649
32479
|
e.artifacts !== null && ` · result kept on the hub until ${new Date(e.artifacts.expiresAt).toLocaleDateString()}`
|
|
32650
32480
|
]
|
|
32651
32481
|
}),
|
|
32652
|
-
/* @__PURE__ */ V(
|
|
32653
|
-
u && /* @__PURE__ */ V(
|
|
32482
|
+
/* @__PURE__ */ V(dF, { lines: e.logTail }),
|
|
32483
|
+
u && /* @__PURE__ */ V(sF, {
|
|
32654
32484
|
job: e,
|
|
32655
32485
|
trpc: t,
|
|
32656
32486
|
onChanged: n,
|
|
@@ -32662,18 +32492,18 @@ function SF({ job: e, trpc: t, onChanged: n, cameraName: r, collectionName: i })
|
|
|
32662
32492
|
//#endregion
|
|
32663
32493
|
//#region src/page/JobsTable.tsx
|
|
32664
32494
|
i();
|
|
32665
|
-
var
|
|
32495
|
+
var pF = {
|
|
32666
32496
|
searchText: (e) => [
|
|
32667
32497
|
e.name,
|
|
32668
32498
|
e.id,
|
|
32669
32499
|
e.request.baseModelId,
|
|
32670
32500
|
e.request.gpuType,
|
|
32671
|
-
|
|
32501
|
+
VP[e.state],
|
|
32672
32502
|
e.stage ?? ""
|
|
32673
32503
|
],
|
|
32674
32504
|
facetValue: (e) => e.state
|
|
32675
32505
|
};
|
|
32676
|
-
function
|
|
32506
|
+
function mF({ job: e }) {
|
|
32677
32507
|
let { epoch: t, epochs: n } = e.progress;
|
|
32678
32508
|
return t === null || n === null ? /* @__PURE__ */ V("span", {
|
|
32679
32509
|
className: "text-foreground-subtle",
|
|
@@ -32687,9 +32517,9 @@ function wF({ job: e }) {
|
|
|
32687
32517
|
]
|
|
32688
32518
|
});
|
|
32689
32519
|
}
|
|
32690
|
-
function
|
|
32520
|
+
function hF({ job: e, trpc: t, onChanged: n }) {
|
|
32691
32521
|
let r = Wl(), [i, o] = a(null);
|
|
32692
|
-
if (
|
|
32522
|
+
if (UP(e.state) || e.state === "cancelling") return null;
|
|
32693
32523
|
let s = async () => {
|
|
32694
32524
|
if (await r({
|
|
32695
32525
|
title: "Cancel this job?",
|
|
@@ -32699,7 +32529,7 @@ function TF({ job: e, trpc: t, onChanged: n }) {
|
|
|
32699
32529
|
})) try {
|
|
32700
32530
|
await t.training.cancelJob.mutate({ id: e.id }), n();
|
|
32701
32531
|
} catch (e) {
|
|
32702
|
-
o(
|
|
32532
|
+
o(aF(e));
|
|
32703
32533
|
}
|
|
32704
32534
|
};
|
|
32705
32535
|
return /* @__PURE__ */ H("div", {
|
|
@@ -32715,8 +32545,8 @@ function TF({ job: e, trpc: t, onChanged: n }) {
|
|
|
32715
32545
|
})]
|
|
32716
32546
|
});
|
|
32717
32547
|
}
|
|
32718
|
-
function
|
|
32719
|
-
let o = y_(e,
|
|
32548
|
+
function gF({ jobs: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }) {
|
|
32549
|
+
let o = y_(e, pF), [s, c] = a(null);
|
|
32720
32550
|
y(() => {
|
|
32721
32551
|
if (o.rows.length === 0) {
|
|
32722
32552
|
c(null);
|
|
@@ -32753,9 +32583,9 @@ function EF({ jobs: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }
|
|
|
32753
32583
|
render: (e) => /* @__PURE__ */ H("span", {
|
|
32754
32584
|
className: "inline-flex flex-wrap items-center gap-1",
|
|
32755
32585
|
children: [/* @__PURE__ */ V(ll, {
|
|
32756
|
-
variant:
|
|
32757
|
-
children:
|
|
32758
|
-
}), e.stage !== null &&
|
|
32586
|
+
variant: tF(e.state),
|
|
32587
|
+
children: VP[e.state]
|
|
32588
|
+
}), e.stage !== null && !UP(e.state) && /* @__PURE__ */ V(ll, {
|
|
32759
32589
|
variant: "info",
|
|
32760
32590
|
children: e.stage
|
|
32761
32591
|
})]
|
|
@@ -32779,7 +32609,7 @@ function EF({ jobs: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }
|
|
|
32779
32609
|
key: "progress",
|
|
32780
32610
|
header: "Progress",
|
|
32781
32611
|
sortValue: (e) => e.progress.epoch ?? -1,
|
|
32782
|
-
render: (e) => /* @__PURE__ */ V(
|
|
32612
|
+
render: (e) => /* @__PURE__ */ V(mF, { job: e })
|
|
32783
32613
|
},
|
|
32784
32614
|
{
|
|
32785
32615
|
key: "cost",
|
|
@@ -32789,7 +32619,7 @@ function EF({ jobs: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }
|
|
|
32789
32619
|
render: (e) => /* @__PURE__ */ H("span", {
|
|
32790
32620
|
className: "font-mono text-[11px] tabular-nums",
|
|
32791
32621
|
children: [
|
|
32792
|
-
|
|
32622
|
+
qP(e.provider.costUsd, e.provider.costIsEstimate),
|
|
32793
32623
|
" / $",
|
|
32794
32624
|
e.maxCostUsd.toFixed(2)
|
|
32795
32625
|
]
|
|
@@ -32807,7 +32637,7 @@ function EF({ jobs: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }
|
|
|
32807
32637
|
{
|
|
32808
32638
|
key: "actions",
|
|
32809
32639
|
align: "right",
|
|
32810
|
-
render: (e) => /* @__PURE__ */ V(
|
|
32640
|
+
render: (e) => /* @__PURE__ */ V(hF, {
|
|
32811
32641
|
job: e,
|
|
32812
32642
|
trpc: t,
|
|
32813
32643
|
onChanged: n
|
|
@@ -32824,7 +32654,7 @@ function EF({ jobs: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }
|
|
|
32824
32654
|
/* @__PURE__ */ V(v_, {
|
|
32825
32655
|
state: o.state,
|
|
32826
32656
|
facets: o.facets,
|
|
32827
|
-
facetLabel: (e) =>
|
|
32657
|
+
facetLabel: (e) => VP[e] ?? e,
|
|
32828
32658
|
labels: {
|
|
32829
32659
|
searchPlaceholder: "Search jobs…",
|
|
32830
32660
|
searchLabel: "Search jobs",
|
|
@@ -32850,7 +32680,7 @@ function EF({ jobs: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }
|
|
|
32850
32680
|
onRowClick: (e) => c(e.id),
|
|
32851
32681
|
rowClassName: (e) => e.id === s ? "bg-primary/[0.04]" : void 0
|
|
32852
32682
|
}),
|
|
32853
|
-
l !== null && /* @__PURE__ */ V(
|
|
32683
|
+
l !== null && /* @__PURE__ */ V(fF, {
|
|
32854
32684
|
job: l,
|
|
32855
32685
|
trpc: t,
|
|
32856
32686
|
onChanged: n,
|
|
@@ -32862,7 +32692,7 @@ function EF({ jobs: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }
|
|
|
32862
32692
|
}
|
|
32863
32693
|
//#endregion
|
|
32864
32694
|
//#region src/page/cluster-root-model-rows.ts
|
|
32865
|
-
function
|
|
32695
|
+
function _F(e) {
|
|
32866
32696
|
for (let t of e.slots) for (let e of t.addons) if (e.id === "object-detection") return typeof e.defaultModelId != "string" || e.defaultModelId.length === 0 ? null : {
|
|
32867
32697
|
defaultModelId: e.defaultModelId,
|
|
32868
32698
|
...e.defaultModelIdByFormat === void 0 ? {} : { defaultModelIdByFormat: e.defaultModelIdByFormat },
|
|
@@ -32875,10 +32705,10 @@ function DF(e) {
|
|
|
32875
32705
|
};
|
|
32876
32706
|
return null;
|
|
32877
32707
|
}
|
|
32878
|
-
function
|
|
32708
|
+
function vF(e) {
|
|
32879
32709
|
let t = [];
|
|
32880
32710
|
for (let n of e) {
|
|
32881
|
-
let e =
|
|
32711
|
+
let e = _F(n.schema);
|
|
32882
32712
|
e !== null && t.push({
|
|
32883
32713
|
nodeId: n.nodeId,
|
|
32884
32714
|
devices: n.devices,
|
|
@@ -32887,8 +32717,8 @@ function OF(e) {
|
|
|
32887
32717
|
}
|
|
32888
32718
|
return t;
|
|
32889
32719
|
}
|
|
32890
|
-
function
|
|
32891
|
-
let n = $g(
|
|
32720
|
+
function yF(e, t) {
|
|
32721
|
+
let n = $g(vF(t)), r = e_(n);
|
|
32892
32722
|
return {
|
|
32893
32723
|
models: e.map((e) => ({
|
|
32894
32724
|
modelId: e.modelId,
|
|
@@ -32901,7 +32731,7 @@ function kF(e, t) {
|
|
|
32901
32731
|
}
|
|
32902
32732
|
//#endregion
|
|
32903
32733
|
//#region src/page/PlanSummary.tsx
|
|
32904
|
-
function
|
|
32734
|
+
function bF({ plan: e, cameraName: t }) {
|
|
32905
32735
|
let { split: n, estimate: r } = e;
|
|
32906
32736
|
return /* @__PURE__ */ H("div", {
|
|
32907
32737
|
className: "space-y-2 text-sm",
|
|
@@ -32947,14 +32777,14 @@ function AF({ plan: e, cameraName: t }) {
|
|
|
32947
32777
|
] }),
|
|
32948
32778
|
/* @__PURE__ */ H("span", { children: [
|
|
32949
32779
|
"GPU time: ",
|
|
32950
|
-
|
|
32780
|
+
JP(r.gpuSecondsLow),
|
|
32951
32781
|
" –",
|
|
32952
32782
|
" ",
|
|
32953
|
-
|
|
32783
|
+
JP(r.gpuSecondsHigh)
|
|
32954
32784
|
] }),
|
|
32955
32785
|
/* @__PURE__ */ H("span", { children: [
|
|
32956
32786
|
"Upload: about ",
|
|
32957
|
-
|
|
32787
|
+
YP(r.datasetBytes),
|
|
32958
32788
|
", ",
|
|
32959
32789
|
r.uploadMinutesAt20Mbps,
|
|
32960
32790
|
" min at 20 Mbit/s"
|
|
@@ -32974,16 +32804,16 @@ function AF({ plan: e, cameraName: t }) {
|
|
|
32974
32804
|
}
|
|
32975
32805
|
//#endregion
|
|
32976
32806
|
//#region src/page/plan-form.ts
|
|
32977
|
-
var
|
|
32807
|
+
var xF = {
|
|
32978
32808
|
quick: "Quick — 15 epochs",
|
|
32979
32809
|
standard: "Standard — 40 epochs",
|
|
32980
32810
|
thorough: "Thorough — 80 epochs, nothing frozen"
|
|
32981
|
-
},
|
|
32811
|
+
}, SF = {
|
|
32982
32812
|
complete: "Complete frames only",
|
|
32983
32813
|
annotated_or_complete: "Annotated or complete",
|
|
32984
32814
|
any_annotated: "Any annotated (incl. hard negatives)"
|
|
32985
32815
|
};
|
|
32986
|
-
function
|
|
32816
|
+
function CF(e) {
|
|
32987
32817
|
let t = e.baseModelIds[0];
|
|
32988
32818
|
if (e.collectionIds.length === 0 || e.entryId === "" || e.gpuType === "" || t === void 0) return null;
|
|
32989
32819
|
let n = e.freeze.trim() === "" ? null : Number(e.freeze);
|
|
@@ -33001,7 +32831,7 @@ function NF(e) {
|
|
|
33001
32831
|
holdoutCameras: e.holdoutCameras.length > 0 ? [...e.holdoutCameras] : null
|
|
33002
32832
|
};
|
|
33003
32833
|
}
|
|
33004
|
-
function
|
|
32834
|
+
function wF(e, t) {
|
|
33005
32835
|
return {
|
|
33006
32836
|
...e,
|
|
33007
32837
|
entryId: t.entryId,
|
|
@@ -33009,7 +32839,7 @@ function PF(e, t) {
|
|
|
33009
32839
|
region: t.defaults.region
|
|
33010
32840
|
};
|
|
33011
32841
|
}
|
|
33012
|
-
var
|
|
32842
|
+
var TF = {
|
|
33013
32843
|
collectionIds: [],
|
|
33014
32844
|
workState: "complete",
|
|
33015
32845
|
entryId: "",
|
|
@@ -33023,24 +32853,24 @@ var FF = {
|
|
|
33023
32853
|
//#endregion
|
|
33024
32854
|
//#region src/page/NewJobSection.tsx
|
|
33025
32855
|
i();
|
|
33026
|
-
function
|
|
32856
|
+
function EF(e) {
|
|
33027
32857
|
if (typeof e != "object" || !e) return !1;
|
|
33028
32858
|
let t = Reflect.get(e, "slots");
|
|
33029
32859
|
return Array.isArray(t);
|
|
33030
32860
|
}
|
|
33031
|
-
function
|
|
32861
|
+
function DF(e) {
|
|
33032
32862
|
if (typeof e != "object" || !e) return [];
|
|
33033
32863
|
let t = Reflect.get(e, "devices");
|
|
33034
32864
|
return Array.isArray(t) ? t.flatMap((e) => {
|
|
33035
|
-
let t =
|
|
32865
|
+
let t = OF(e);
|
|
33036
32866
|
return t === null ? [] : [t];
|
|
33037
32867
|
}) : [];
|
|
33038
32868
|
}
|
|
33039
|
-
function
|
|
32869
|
+
function OF(e) {
|
|
33040
32870
|
if (typeof e != "object" || !e) return null;
|
|
33041
32871
|
let t = Reflect.get(e, "key"), n = Reflect.get(e, "backend"), r = Reflect.get(e, "device"), i = Reflect.get(e, "enabled"), a = Reflect.get(e, "format");
|
|
33042
32872
|
if (typeof t != "string" || typeof n != "string" || typeof r != "string" || typeof i != "boolean" || typeof a != "string") return null;
|
|
33043
|
-
let o = Reflect.get(e, "defaultModelId"), s =
|
|
32873
|
+
let o = Reflect.get(e, "defaultModelId"), s = kF(Reflect.get(e, "steps"));
|
|
33044
32874
|
return {
|
|
33045
32875
|
key: t,
|
|
33046
32876
|
backend: n,
|
|
@@ -33051,7 +32881,7 @@ function RF(e) {
|
|
|
33051
32881
|
...s === void 0 ? {} : { steps: s }
|
|
33052
32882
|
};
|
|
33053
32883
|
}
|
|
33054
|
-
function
|
|
32884
|
+
function kF(e) {
|
|
33055
32885
|
if (typeof e != "object" || !e) return;
|
|
33056
32886
|
let t = {};
|
|
33057
32887
|
for (let [n, r] of Object.entries(e)) {
|
|
@@ -33061,8 +32891,8 @@ function zF(e) {
|
|
|
33061
32891
|
}
|
|
33062
32892
|
return t;
|
|
33063
32893
|
}
|
|
33064
|
-
function
|
|
33065
|
-
let s = Wl(), { nodes: c } = ja(), l = m(() => c.filter((e) => e.isOnline).map((e) => e.id), [c]), u = l.join("\0"), [d, f] = a(
|
|
32894
|
+
function AF({ trpc: e, providers: t, baseModels: n, collections: r, cameraName: i, onStarted: o }) {
|
|
32895
|
+
let s = Wl(), { nodes: c } = ja(), l = m(() => c.filter((e) => e.isOnline).map((e) => e.id), [c]), u = l.join("\0"), [d, f] = a(TF), [p, h] = a(""), [g, _] = a(""), [v, b] = a(""), [x, S] = a(null), [C, T] = a(!1), [E, D] = a(!1), O = oF(async () => {
|
|
33066
32896
|
if (n.length === 0) return {
|
|
33067
32897
|
models: [],
|
|
33068
32898
|
clusterRootModelIds: []
|
|
@@ -33071,14 +32901,14 @@ function BF({ trpc: e, providers: t, baseModels: n, collections: r, cameraName:
|
|
|
33071
32901
|
return await Promise.all(l.map(async (n) => {
|
|
33072
32902
|
try {
|
|
33073
32903
|
let [r, i] = await Promise.all([e.pipelineOrchestrator.getNodeInferenceDevices.query({ nodeId: n }), e.pipelineExecutor.getSchema.query({ nodeId: n })]);
|
|
33074
|
-
if (!
|
|
32904
|
+
if (!EF(i)) return;
|
|
33075
32905
|
t.push({
|
|
33076
32906
|
nodeId: n,
|
|
33077
|
-
devices:
|
|
32907
|
+
devices: DF(r),
|
|
33078
32908
|
schema: i
|
|
33079
32909
|
});
|
|
33080
32910
|
} catch {}
|
|
33081
|
-
})),
|
|
32911
|
+
})), yF(n, t);
|
|
33082
32912
|
}, [u, n.map((e) => e.modelId).join("\0")]), k = O.state.status === "ok" ? O.state.data.models : n.map((e) => ({
|
|
33083
32913
|
modelId: e.modelId,
|
|
33084
32914
|
label: e.label,
|
|
@@ -33091,7 +32921,7 @@ function BF({ trpc: e, providers: t, baseModels: n, collections: r, cameraName:
|
|
|
33091
32921
|
...e,
|
|
33092
32922
|
holdoutCameras: []
|
|
33093
32923
|
}, r = t.find((e) => e.configured) ?? t[0];
|
|
33094
|
-
return n.entryId === "" && r !== void 0 && (n =
|
|
32924
|
+
return n.entryId === "" && r !== void 0 && (n = wF(n, r)), n;
|
|
33095
32925
|
});
|
|
33096
32926
|
}, [t]), y(() => {
|
|
33097
32927
|
if (E || O.state.status !== "ok") return;
|
|
@@ -33105,7 +32935,7 @@ function BF({ trpc: e, providers: t, baseModels: n, collections: r, cameraName:
|
|
|
33105
32935
|
k,
|
|
33106
32936
|
E
|
|
33107
32937
|
]);
|
|
33108
|
-
let j =
|
|
32938
|
+
let j = CF(d), M = oF(async () => j === null ? null : e.training.planJob.query(j), [JSON.stringify(j)]), N = M.state.status === "ok" ? M.state.data : null;
|
|
33109
32939
|
y(() => {
|
|
33110
32940
|
N?.defaults != null && (_(N.defaults.maxCostUsd.toFixed(2)), b((N.defaults.maxRuntimeSec / 3600).toFixed(1)));
|
|
33111
32941
|
}, [N?.defaults?.maxCostUsd, N?.defaults?.maxRuntimeSec]);
|
|
@@ -33136,7 +32966,7 @@ function BF({ trpc: e, providers: t, baseModels: n, collections: r, cameraName:
|
|
|
33136
32966
|
});
|
|
33137
32967
|
t.kind === "refused" ? S(`Refused (${t.reason}): ${t.detail}`) : o();
|
|
33138
32968
|
} catch (e) {
|
|
33139
|
-
S(
|
|
32969
|
+
S(aF(e));
|
|
33140
32970
|
} finally {
|
|
33141
32971
|
T(!1);
|
|
33142
32972
|
}
|
|
@@ -33163,7 +32993,7 @@ function BF({ trpc: e, providers: t, baseModels: n, collections: r, cameraName:
|
|
|
33163
32993
|
value: d.entryId,
|
|
33164
32994
|
onChange: (e) => {
|
|
33165
32995
|
let n = t.find((t) => t.entryId === e.target.value);
|
|
33166
|
-
n !== void 0 && f((e) =>
|
|
32996
|
+
n !== void 0 && f((e) => wF(e, n));
|
|
33167
32997
|
},
|
|
33168
32998
|
options: t.map((e) => ({
|
|
33169
32999
|
value: e.entryId,
|
|
@@ -33207,9 +33037,9 @@ function BF({ trpc: e, providers: t, baseModels: n, collections: r, cameraName:
|
|
|
33207
33037
|
let t = e.target.value;
|
|
33208
33038
|
(t === "complete" || t === "annotated_or_complete" || t === "any_annotated") && ne({ workState: t });
|
|
33209
33039
|
},
|
|
33210
|
-
options: Object.keys(
|
|
33040
|
+
options: Object.keys(SF).map((e) => ({
|
|
33211
33041
|
value: e,
|
|
33212
|
-
label:
|
|
33042
|
+
label: SF[e]
|
|
33213
33043
|
}))
|
|
33214
33044
|
})]
|
|
33215
33045
|
}),
|
|
@@ -33234,7 +33064,7 @@ function BF({ trpc: e, providers: t, baseModels: n, collections: r, cameraName:
|
|
|
33234
33064
|
children: [/* @__PURE__ */ V("span", { children: "Preset" }), /* @__PURE__ */ V(nd, {
|
|
33235
33065
|
value: d.preset,
|
|
33236
33066
|
onChange: (e) => ne({ preset: e.target.value === "quick" ? "quick" : e.target.value === "thorough" ? "thorough" : "standard" }),
|
|
33237
|
-
options: Object.entries(
|
|
33067
|
+
options: Object.entries(xF).map(([e, t]) => ({
|
|
33238
33068
|
value: e,
|
|
33239
33069
|
label: t
|
|
33240
33070
|
}))
|
|
@@ -33289,7 +33119,7 @@ function BF({ trpc: e, providers: t, baseModels: n, collections: r, cameraName:
|
|
|
33289
33119
|
className: "text-sm text-danger",
|
|
33290
33120
|
children: ["Could not plan: ", M.state.error]
|
|
33291
33121
|
}),
|
|
33292
|
-
N !== null && /* @__PURE__ */ V(
|
|
33122
|
+
N !== null && /* @__PURE__ */ V(bF, {
|
|
33293
33123
|
plan: N,
|
|
33294
33124
|
cameraName: i
|
|
33295
33125
|
}),
|
|
@@ -33339,7 +33169,7 @@ function BF({ trpc: e, providers: t, baseModels: n, collections: r, cameraName:
|
|
|
33339
33169
|
}
|
|
33340
33170
|
//#endregion
|
|
33341
33171
|
//#region src/page/SectionState.tsx
|
|
33342
|
-
function
|
|
33172
|
+
function jF({ state: e, empty: t, emptyAction: n, children: r }) {
|
|
33343
33173
|
return e.status === "pending" ? /* @__PURE__ */ V(rd, { className: "h-16 w-full" }) : e.status === "error" ? /* @__PURE__ */ H("p", {
|
|
33344
33174
|
className: "text-sm text-danger",
|
|
33345
33175
|
children: ["Could not load: ", e.error]
|
|
@@ -33355,12 +33185,12 @@ function VF({ state: e, empty: t, emptyAction: n, children: r }) {
|
|
|
33355
33185
|
//#endregion
|
|
33356
33186
|
//#region src/page/JobsSection.tsx
|
|
33357
33187
|
i();
|
|
33358
|
-
function
|
|
33188
|
+
function MF(e) {
|
|
33359
33189
|
let t = new Map((e ?? []).map((e) => [e.id, e.name]));
|
|
33360
33190
|
return (e) => t.get(e) ?? e;
|
|
33361
33191
|
}
|
|
33362
|
-
function
|
|
33363
|
-
let l = m(() =>
|
|
33192
|
+
function NF({ trpc: e, providers: t, baseModels: n, collections: r, jobs: i, onJobsReload: a, cameraName: o, depsPending: s, depsError: c }) {
|
|
33193
|
+
let l = m(() => MF(r), [r]);
|
|
33364
33194
|
return /* @__PURE__ */ H("div", {
|
|
33365
33195
|
className: "space-y-4",
|
|
33366
33196
|
children: [s ? /* @__PURE__ */ V(Wg, {
|
|
@@ -33383,7 +33213,7 @@ function UF({ trpc: e, providers: t, baseModels: n, collections: r, jobs: i, onJ
|
|
|
33383
33213
|
message: c ?? "Providers, base models, or collections are unavailable."
|
|
33384
33214
|
})
|
|
33385
33215
|
})
|
|
33386
|
-
}) : /* @__PURE__ */ V(
|
|
33216
|
+
}) : /* @__PURE__ */ V(AF, {
|
|
33387
33217
|
trpc: e,
|
|
33388
33218
|
providers: t,
|
|
33389
33219
|
baseModels: n,
|
|
@@ -33395,10 +33225,10 @@ function UF({ trpc: e, providers: t, baseModels: n, collections: r, jobs: i, onJ
|
|
|
33395
33225
|
title: "Jobs",
|
|
33396
33226
|
children: /* @__PURE__ */ V("div", {
|
|
33397
33227
|
className: `${w} space-y-3`,
|
|
33398
|
-
children: /* @__PURE__ */ V(
|
|
33228
|
+
children: /* @__PURE__ */ V(jF, {
|
|
33399
33229
|
state: i,
|
|
33400
33230
|
empty: "No training job yet.",
|
|
33401
|
-
children: (t) => /* @__PURE__ */ V(
|
|
33231
|
+
children: (t) => /* @__PURE__ */ V(gF, {
|
|
33402
33232
|
jobs: t,
|
|
33403
33233
|
trpc: e,
|
|
33404
33234
|
onChanged: a,
|
|
@@ -33412,36 +33242,17 @@ function UF({ trpc: e, providers: t, baseModels: n, collections: r, jobs: i, onJ
|
|
|
33412
33242
|
}
|
|
33413
33243
|
//#endregion
|
|
33414
33244
|
//#region src/page/provider-icon-url.ts
|
|
33415
|
-
function
|
|
33245
|
+
function PF(e, t) {
|
|
33416
33246
|
let n = t.trim();
|
|
33417
33247
|
return n.length === 0 || n.includes("..") ? null : ae(`/api/addon-assets/${encodeURIComponent(e)}/${n}`);
|
|
33418
33248
|
}
|
|
33419
33249
|
//#endregion
|
|
33420
33250
|
//#region src/page/ProviderSection.tsx
|
|
33421
33251
|
i();
|
|
33422
|
-
function
|
|
33423
|
-
return e ? "ok" : "warning";
|
|
33424
|
-
}
|
|
33425
|
-
function KF(e) {
|
|
33252
|
+
function FF(e) {
|
|
33426
33253
|
return e.map((e) => `${e.typeId}\0${e.label}\0${e.addonId}\0${e.iconAsset}`).join("\n");
|
|
33427
33254
|
}
|
|
33428
|
-
function
|
|
33429
|
-
return e.map((e) => ({
|
|
33430
|
-
typeId: e.typeId,
|
|
33431
|
-
label: e.label,
|
|
33432
|
-
iconUrl: WF(e.addonId, e.iconAsset)
|
|
33433
|
-
}));
|
|
33434
|
-
}
|
|
33435
|
-
function JF(e) {
|
|
33436
|
-
return e.map((e) => ({
|
|
33437
|
-
entryId: e.entryId,
|
|
33438
|
-
name: e.name,
|
|
33439
|
-
typeId: e.typeId,
|
|
33440
|
-
iconUrl: WF(e.addonId, e.iconAsset),
|
|
33441
|
-
status: GF(e.configured)
|
|
33442
|
-
}));
|
|
33443
|
-
}
|
|
33444
|
-
function YF({ state: e }) {
|
|
33255
|
+
function IF({ state: e }) {
|
|
33445
33256
|
if (e.kind === "idle") return null;
|
|
33446
33257
|
if (e.kind === "running") return /* @__PURE__ */ V("span", {
|
|
33447
33258
|
className: "text-xs text-foreground-subtle",
|
|
@@ -33460,15 +33271,11 @@ function YF({ state: e }) {
|
|
|
33460
33271
|
children: [t.reason ?? "refused", t.detail === void 0 ? "" : `: ${t.detail}`]
|
|
33461
33272
|
});
|
|
33462
33273
|
}
|
|
33463
|
-
function
|
|
33464
|
-
let [
|
|
33465
|
-
|
|
33466
|
-
i({ kind: "idle" });
|
|
33467
|
-
}, [e.entryId]);
|
|
33468
|
-
let o = async () => {
|
|
33469
|
-
i({ kind: "running" });
|
|
33274
|
+
function LF({ entry: e, trpc: t }) {
|
|
33275
|
+
let [n, r] = a({ kind: "idle" }), i = e.defaults, o = async () => {
|
|
33276
|
+
r({ kind: "running" });
|
|
33470
33277
|
try {
|
|
33471
|
-
|
|
33278
|
+
r({
|
|
33472
33279
|
kind: "done",
|
|
33473
33280
|
check: await t.trainingProvider.validateCredentials.mutate({
|
|
33474
33281
|
entryId: e.entryId,
|
|
@@ -33476,303 +33283,353 @@ function XF({ entry: e, trpc: t, onEdit: n }) {
|
|
|
33476
33283
|
})
|
|
33477
33284
|
});
|
|
33478
33285
|
} catch (e) {
|
|
33479
|
-
|
|
33286
|
+
r({
|
|
33480
33287
|
kind: "error",
|
|
33481
|
-
message:
|
|
33288
|
+
message: aF(e)
|
|
33482
33289
|
});
|
|
33483
33290
|
}
|
|
33484
33291
|
};
|
|
33485
|
-
return /* @__PURE__ */ H("
|
|
33486
|
-
className: "space-y-
|
|
33487
|
-
"
|
|
33292
|
+
return /* @__PURE__ */ H(U, { children: [/* @__PURE__ */ H("section", {
|
|
33293
|
+
className: "space-y-2",
|
|
33294
|
+
"aria-labelledby": "provider-about-heading",
|
|
33488
33295
|
children: [
|
|
33489
|
-
/* @__PURE__ */
|
|
33490
|
-
|
|
33296
|
+
/* @__PURE__ */ V("h3", {
|
|
33297
|
+
id: "provider-about-heading",
|
|
33298
|
+
className: "text-sm font-medium text-foreground",
|
|
33299
|
+
children: "About"
|
|
33300
|
+
}),
|
|
33301
|
+
/* @__PURE__ */ V("p", {
|
|
33302
|
+
className: "text-sm text-foreground-muted",
|
|
33303
|
+
children: e.dataResidencyNote
|
|
33304
|
+
}),
|
|
33305
|
+
e.freeTierNote === void 0 ? null : /* @__PURE__ */ V("p", {
|
|
33306
|
+
className: "text-xs text-foreground-muted",
|
|
33307
|
+
children: e.freeTierNote
|
|
33308
|
+
}),
|
|
33309
|
+
/* @__PURE__ */ H("p", {
|
|
33310
|
+
className: "text-xs text-foreground-muted",
|
|
33491
33311
|
children: [
|
|
33492
|
-
|
|
33493
|
-
|
|
33494
|
-
|
|
33495
|
-
|
|
33496
|
-
|
|
33497
|
-
|
|
33498
|
-
|
|
33499
|
-
|
|
33500
|
-
|
|
33501
|
-
|
|
33502
|
-
|
|
33503
|
-
|
|
33504
|
-
|
|
33505
|
-
variant: "secondary",
|
|
33506
|
-
className: "ml-auto",
|
|
33507
|
-
onClick: n,
|
|
33508
|
-
children: "Edit"
|
|
33509
|
-
}),
|
|
33510
|
-
/* @__PURE__ */ V(X, {
|
|
33511
|
-
variant: "secondary",
|
|
33512
|
-
disabled: !e.configured || r.kind === "running",
|
|
33513
|
-
onClick: () => void o(),
|
|
33514
|
-
children: "Test"
|
|
33515
|
-
})
|
|
33312
|
+
"Defaults: ",
|
|
33313
|
+
i.gpuType,
|
|
33314
|
+
", region ",
|
|
33315
|
+
i.region === "" ? "any" : i.region,
|
|
33316
|
+
", cost cap $",
|
|
33317
|
+
i.costCapUsd.toFixed(2),
|
|
33318
|
+
", runtime ≤",
|
|
33319
|
+
" ",
|
|
33320
|
+
(i.maxRuntimeSec / 3600).toFixed(1),
|
|
33321
|
+
" h, a failed job's dataset kept",
|
|
33322
|
+
" ",
|
|
33323
|
+
i.failedDatasetGraceHours,
|
|
33324
|
+
" h."
|
|
33516
33325
|
]
|
|
33517
33326
|
}),
|
|
33518
|
-
/* @__PURE__ */
|
|
33327
|
+
/* @__PURE__ */ H("div", {
|
|
33328
|
+
className: "flex flex-wrap items-center gap-2",
|
|
33329
|
+
children: [/* @__PURE__ */ V(X, {
|
|
33330
|
+
type: "button",
|
|
33331
|
+
variant: "secondary",
|
|
33332
|
+
size: "sm",
|
|
33333
|
+
disabled: !e.configured || n.kind === "running",
|
|
33334
|
+
onClick: () => void o(),
|
|
33335
|
+
children: "Test credentials"
|
|
33336
|
+
}), /* @__PURE__ */ V(IF, { state: n })]
|
|
33337
|
+
})
|
|
33338
|
+
]
|
|
33339
|
+
}), /* @__PURE__ */ H("section", {
|
|
33340
|
+
className: "space-y-2",
|
|
33341
|
+
"aria-labelledby": "provider-settings-heading",
|
|
33342
|
+
children: [
|
|
33343
|
+
/* @__PURE__ */ V("h3", {
|
|
33344
|
+
id: "provider-settings-heading",
|
|
33345
|
+
className: "text-sm font-medium text-foreground",
|
|
33346
|
+
children: "Settings"
|
|
33347
|
+
}),
|
|
33519
33348
|
/* @__PURE__ */ V("p", {
|
|
33520
33349
|
className: "text-xs text-foreground-subtle",
|
|
33521
|
-
children: "Credentials and defaults
|
|
33350
|
+
children: "Credentials and per-entry defaults for this provider. Secrets stay in the keychain."
|
|
33351
|
+
}),
|
|
33352
|
+
/* @__PURE__ */ V(Jh, {
|
|
33353
|
+
trpc: t,
|
|
33354
|
+
addonId: e.addonId,
|
|
33355
|
+
nodeId: "hub"
|
|
33522
33356
|
})
|
|
33523
33357
|
]
|
|
33524
|
-
});
|
|
33525
|
-
}
|
|
33526
|
-
function ZF({ entry: e, trpc: t }) {
|
|
33527
|
-
let n = e.defaults;
|
|
33528
|
-
return /* @__PURE__ */ H("div", {
|
|
33529
|
-
className: "space-y-4",
|
|
33530
|
-
children: [/* @__PURE__ */ H("section", {
|
|
33531
|
-
className: "space-y-2",
|
|
33532
|
-
"aria-labelledby": "provider-about-heading",
|
|
33533
|
-
children: [
|
|
33534
|
-
/* @__PURE__ */ V("h3", {
|
|
33535
|
-
id: "provider-about-heading",
|
|
33536
|
-
className: "text-sm font-medium text-foreground",
|
|
33537
|
-
children: "About"
|
|
33538
|
-
}),
|
|
33539
|
-
/* @__PURE__ */ V("p", {
|
|
33540
|
-
className: "text-sm text-foreground-muted",
|
|
33541
|
-
children: e.dataResidencyNote
|
|
33542
|
-
}),
|
|
33543
|
-
e.freeTierNote === void 0 ? null : /* @__PURE__ */ V("p", {
|
|
33544
|
-
className: "text-xs text-foreground-muted",
|
|
33545
|
-
children: e.freeTierNote
|
|
33546
|
-
}),
|
|
33547
|
-
/* @__PURE__ */ H("p", {
|
|
33548
|
-
className: "text-xs text-foreground-muted",
|
|
33549
|
-
children: [
|
|
33550
|
-
"Defaults: ",
|
|
33551
|
-
n.gpuType,
|
|
33552
|
-
", region ",
|
|
33553
|
-
n.region === "" ? "any" : n.region,
|
|
33554
|
-
", cost cap $",
|
|
33555
|
-
n.costCapUsd.toFixed(2),
|
|
33556
|
-
", runtime ≤",
|
|
33557
|
-
" ",
|
|
33558
|
-
(n.maxRuntimeSec / 3600).toFixed(1),
|
|
33559
|
-
" h, a failed job's dataset kept",
|
|
33560
|
-
" ",
|
|
33561
|
-
n.failedDatasetGraceHours,
|
|
33562
|
-
" h."
|
|
33563
|
-
]
|
|
33564
|
-
})
|
|
33565
|
-
]
|
|
33566
|
-
}), /* @__PURE__ */ H("section", {
|
|
33567
|
-
className: "space-y-2",
|
|
33568
|
-
"aria-labelledby": "provider-settings-heading",
|
|
33569
|
-
children: [
|
|
33570
|
-
/* @__PURE__ */ V("h3", {
|
|
33571
|
-
id: "provider-settings-heading",
|
|
33572
|
-
className: "text-sm font-medium text-foreground",
|
|
33573
|
-
children: "Settings"
|
|
33574
|
-
}),
|
|
33575
|
-
/* @__PURE__ */ V("p", {
|
|
33576
|
-
className: "text-xs text-foreground-subtle",
|
|
33577
|
-
children: "Credentials and per-entry defaults for this provider (including plan / tier notes when the provider exposes them). Secrets stay in the keychain."
|
|
33578
|
-
}),
|
|
33579
|
-
/* @__PURE__ */ V(Jh, {
|
|
33580
|
-
trpc: t,
|
|
33581
|
-
addonId: e.addonId,
|
|
33582
|
-
nodeId: "hub"
|
|
33583
|
-
})
|
|
33584
|
-
]
|
|
33585
|
-
})]
|
|
33586
|
-
});
|
|
33358
|
+
})] });
|
|
33587
33359
|
}
|
|
33588
|
-
function
|
|
33589
|
-
let
|
|
33590
|
-
|
|
33591
|
-
|
|
33592
|
-
|
|
33593
|
-
|
|
33594
|
-
|
|
33595
|
-
let e = /* @__PURE__ */ new Map(), t =
|
|
33360
|
+
function RF({ trpc: e, navigate: t, createRequested: n = !1, onCreateConsumed: r }) {
|
|
33361
|
+
let i = ed("training-provider"), o = Wl(), c = LA({
|
|
33362
|
+
editKey: "edit",
|
|
33363
|
+
newKey: "new"
|
|
33364
|
+
}), [l, d] = a(!1), [f, p] = a(null), [h, g] = a(""), [_, v] = a(""), b = oF(() => e.trainingProvider.describe.query({}), []), x = oF(() => e.trainingProvider.describeTypes.query({}), []), S = x.state.status === "ok" ? x.state.data : null, C = S === null ? "" : FF(S), w = u(S);
|
|
33365
|
+
w.current = S;
|
|
33366
|
+
let T = m(() => {
|
|
33367
|
+
let e = /* @__PURE__ */ new Map(), t = w.current;
|
|
33596
33368
|
if (t !== null) for (let n of t) e.set(n.typeId, n);
|
|
33597
33369
|
return e;
|
|
33598
|
-
}, [
|
|
33599
|
-
|
|
33600
|
-
|
|
33601
|
-
|
|
33602
|
-
|
|
33370
|
+
}, [C]), E = m(() => {
|
|
33371
|
+
let e = w.current;
|
|
33372
|
+
return e === null ? [] : e.map((e) => ({
|
|
33373
|
+
value: e.typeId,
|
|
33374
|
+
label: e.label
|
|
33375
|
+
}));
|
|
33376
|
+
}, [C]), D = b.state.status === "ok" ? b.state.data : [];
|
|
33603
33377
|
y(() => {
|
|
33604
|
-
|
|
33605
|
-
}, [
|
|
33606
|
-
|
|
33607
|
-
|
|
33608
|
-
|
|
33609
|
-
|
|
33610
|
-
|
|
33611
|
-
|
|
33612
|
-
|
|
33613
|
-
|
|
33614
|
-
if (n === void 0) {
|
|
33615
|
-
h("That provider type is no longer available.");
|
|
33378
|
+
n && x.state.status === "ok" && (p(null), g(E[0]?.value ?? ""), v(""), c.openNew(), r?.());
|
|
33379
|
+
}, [n, x.state.status]);
|
|
33380
|
+
let O = c.state.mode === "edit" ? D.find((e) => e.entryId === c.state.id) ?? null : null, k = s(async () => {
|
|
33381
|
+
let t = T.get(h);
|
|
33382
|
+
if (t === void 0) {
|
|
33383
|
+
p("That provider type is no longer available.");
|
|
33384
|
+
return;
|
|
33385
|
+
}
|
|
33386
|
+
if (_.trim() === "") {
|
|
33387
|
+
p("Name is required.");
|
|
33616
33388
|
return;
|
|
33617
33389
|
}
|
|
33618
|
-
|
|
33390
|
+
d(!0), p(null);
|
|
33619
33391
|
try {
|
|
33620
|
-
let
|
|
33621
|
-
typeId:
|
|
33622
|
-
name:
|
|
33623
|
-
addonId:
|
|
33392
|
+
let n = await e.trainingProvider.createEntry.mutate({
|
|
33393
|
+
typeId: h,
|
|
33394
|
+
name: _.trim(),
|
|
33395
|
+
addonId: t.addonId
|
|
33624
33396
|
});
|
|
33625
|
-
|
|
33397
|
+
b.reload(), x.reload(), c.openEdit(n.entryId);
|
|
33626
33398
|
} catch (e) {
|
|
33627
|
-
|
|
33399
|
+
p(aF(e));
|
|
33628
33400
|
} finally {
|
|
33629
|
-
|
|
33401
|
+
d(!1);
|
|
33630
33402
|
}
|
|
33631
33403
|
}, [
|
|
33632
|
-
|
|
33633
|
-
|
|
33404
|
+
b,
|
|
33405
|
+
_,
|
|
33406
|
+
h,
|
|
33407
|
+
c,
|
|
33634
33408
|
e,
|
|
33635
|
-
|
|
33636
|
-
|
|
33637
|
-
])
|
|
33638
|
-
|
|
33639
|
-
|
|
33640
|
-
|
|
33641
|
-
|
|
33642
|
-
|
|
33643
|
-
|
|
33644
|
-
})
|
|
33645
|
-
|
|
33646
|
-
|
|
33647
|
-
|
|
33648
|
-
|
|
33649
|
-
|
|
33650
|
-
|
|
33651
|
-
|
|
33652
|
-
|
|
33653
|
-
|
|
33409
|
+
T,
|
|
33410
|
+
x
|
|
33411
|
+
]), A = s(async (t) => {
|
|
33412
|
+
await o({
|
|
33413
|
+
title: "Delete provider entry?",
|
|
33414
|
+
message: `Remove “${t.name}” (${t.label}). Credentials for this entry are dropped.`,
|
|
33415
|
+
confirmLabel: "Delete",
|
|
33416
|
+
cancelLabel: "Cancel",
|
|
33417
|
+
variant: "danger"
|
|
33418
|
+
}) && (await e.trainingProvider.deleteEntry.mutate({
|
|
33419
|
+
entryId: t.entryId,
|
|
33420
|
+
addonId: t.addonId
|
|
33421
|
+
}), c.state.mode === "edit" && c.state.id === t.entryId && c.close(), b.reload());
|
|
33422
|
+
}, [
|
|
33423
|
+
o,
|
|
33424
|
+
b,
|
|
33425
|
+
c,
|
|
33426
|
+
e
|
|
33427
|
+
]), j = m(() => [
|
|
33428
|
+
{
|
|
33429
|
+
key: "name",
|
|
33430
|
+
header: "Name",
|
|
33431
|
+
sortValue: (e) => e.name,
|
|
33432
|
+
render: (e) => /* @__PURE__ */ H("div", {
|
|
33433
|
+
className: "flex min-w-0 items-center gap-2",
|
|
33434
|
+
children: [/* @__PURE__ */ V("img", {
|
|
33435
|
+
src: PF(e.addonId, e.iconAsset),
|
|
33436
|
+
alt: "",
|
|
33437
|
+
className: "h-4 w-4 shrink-0"
|
|
33438
|
+
}), /* @__PURE__ */ V("span", {
|
|
33439
|
+
className: "truncate font-medium text-foreground",
|
|
33440
|
+
children: e.name
|
|
33441
|
+
})]
|
|
33654
33442
|
})
|
|
33655
|
-
}
|
|
33656
|
-
|
|
33657
|
-
|
|
33658
|
-
|
|
33659
|
-
|
|
33660
|
-
|
|
33661
|
-
|
|
33662
|
-
|
|
33663
|
-
title: "No training provider installed",
|
|
33664
|
-
description: "Install a training provider addon (for example Modal) from the Addons page, then create an entry here.",
|
|
33665
|
-
action: /* @__PURE__ */ V(X, {
|
|
33666
|
-
variant: "outline",
|
|
33667
|
-
onClick: () => t("/system/addons?capability=training-provider"),
|
|
33668
|
-
children: "Addons"
|
|
33669
|
-
})
|
|
33443
|
+
},
|
|
33444
|
+
{
|
|
33445
|
+
key: "type",
|
|
33446
|
+
header: "Type",
|
|
33447
|
+
sortValue: (e) => e.label,
|
|
33448
|
+
render: (e) => /* @__PURE__ */ V("span", {
|
|
33449
|
+
className: "text-xs text-foreground-muted",
|
|
33450
|
+
children: e.label
|
|
33670
33451
|
})
|
|
33452
|
+
},
|
|
33453
|
+
{
|
|
33454
|
+
key: "status",
|
|
33455
|
+
header: "Status",
|
|
33456
|
+
notSortableReason: "Badge",
|
|
33457
|
+
render: (e) => /* @__PURE__ */ V(ll, {
|
|
33458
|
+
variant: e.configured ? "success" : "warning",
|
|
33459
|
+
children: e.configured ? "Configured" : "Not configured"
|
|
33460
|
+
})
|
|
33461
|
+
},
|
|
33462
|
+
{
|
|
33463
|
+
key: "actions",
|
|
33464
|
+
header: "",
|
|
33465
|
+
align: "right",
|
|
33466
|
+
notSortableReason: "Row actions",
|
|
33467
|
+
nowrap: !0,
|
|
33468
|
+
render: (e) => /* @__PURE__ */ H("div", {
|
|
33469
|
+
className: "flex justify-end gap-1",
|
|
33470
|
+
children: [/* @__PURE__ */ V(X, {
|
|
33471
|
+
type: "button",
|
|
33472
|
+
size: "sm",
|
|
33473
|
+
variant: "secondary",
|
|
33474
|
+
onClick: (t) => {
|
|
33475
|
+
t.stopPropagation(), c.openEdit(e.entryId);
|
|
33476
|
+
},
|
|
33477
|
+
children: "Edit"
|
|
33478
|
+
}), /* @__PURE__ */ V(X, {
|
|
33479
|
+
type: "button",
|
|
33480
|
+
size: "sm",
|
|
33481
|
+
variant: "ghost",
|
|
33482
|
+
onClick: (t) => {
|
|
33483
|
+
t.stopPropagation(), A(e);
|
|
33484
|
+
},
|
|
33485
|
+
children: "Delete"
|
|
33486
|
+
})]
|
|
33487
|
+
})
|
|
33488
|
+
}
|
|
33489
|
+
], [c, A]);
|
|
33490
|
+
if (i === "pending") return /* @__PURE__ */ V(rd, {
|
|
33491
|
+
className: "h-16 w-full",
|
|
33492
|
+
"data-testid": "training-providers"
|
|
33493
|
+
});
|
|
33494
|
+
if (i === "unknown") return /* @__PURE__ */ V("p", {
|
|
33495
|
+
className: "text-sm text-danger",
|
|
33496
|
+
"data-testid": "training-providers",
|
|
33497
|
+
children: "Could not reach the capability registry."
|
|
33498
|
+
});
|
|
33499
|
+
if (i === "absent") return /* @__PURE__ */ V(yd, {
|
|
33500
|
+
title: "No training provider installed",
|
|
33501
|
+
description: "Install a training provider addon (for example Modal) from the Addons page, then create an entry here.",
|
|
33502
|
+
action: /* @__PURE__ */ V(X, {
|
|
33503
|
+
variant: "outline",
|
|
33504
|
+
onClick: () => t("/system/addons?capability=training-provider"),
|
|
33505
|
+
children: "Addons"
|
|
33671
33506
|
})
|
|
33672
33507
|
});
|
|
33673
|
-
let
|
|
33674
|
-
return /* @__PURE__ */
|
|
33675
|
-
|
|
33676
|
-
|
|
33677
|
-
children:
|
|
33678
|
-
|
|
33679
|
-
|
|
33680
|
-
|
|
33681
|
-
|
|
33682
|
-
|
|
33683
|
-
|
|
33684
|
-
|
|
33685
|
-
|
|
33686
|
-
|
|
33687
|
-
|
|
33688
|
-
|
|
33689
|
-
|
|
33690
|
-
|
|
33691
|
-
|
|
33692
|
-
|
|
33693
|
-
|
|
33694
|
-
|
|
33695
|
-
|
|
33696
|
-
|
|
33697
|
-
|
|
33698
|
-
|
|
33699
|
-
|
|
33700
|
-
|
|
33701
|
-
|
|
33702
|
-
|
|
33703
|
-
|
|
33704
|
-
|
|
33705
|
-
|
|
33706
|
-
|
|
33707
|
-
|
|
33708
|
-
|
|
33709
|
-
|
|
33710
|
-
|
|
33711
|
-
|
|
33712
|
-
|
|
33508
|
+
let M = x.state.status === "ok", N = c.state.mode === "new";
|
|
33509
|
+
return /* @__PURE__ */ H("div", {
|
|
33510
|
+
className: "flex min-h-0 flex-1 flex-col gap-3",
|
|
33511
|
+
"data-testid": "training-providers",
|
|
33512
|
+
children: [
|
|
33513
|
+
b.state.status === "error" ? /* @__PURE__ */ H("p", {
|
|
33514
|
+
className: "text-sm text-danger",
|
|
33515
|
+
children: ["Could not load entries: ", b.state.error]
|
|
33516
|
+
}) : null,
|
|
33517
|
+
x.state.status === "error" ? /* @__PURE__ */ H("p", {
|
|
33518
|
+
className: "text-sm text-danger",
|
|
33519
|
+
children: ["Could not load types: ", x.state.error]
|
|
33520
|
+
}) : null,
|
|
33521
|
+
b.state.status === "pending" ? /* @__PURE__ */ V(rd, { className: "h-32 w-full" }) : /* @__PURE__ */ V(Hg, {
|
|
33522
|
+
columns: j,
|
|
33523
|
+
rows: D,
|
|
33524
|
+
rowKey: (e) => e.entryId,
|
|
33525
|
+
pageSize: 25,
|
|
33526
|
+
fill: !0,
|
|
33527
|
+
mobileMode: "scroll",
|
|
33528
|
+
emptyMessage: "No provider entries yet. Add one to store credentials and run cloud jobs.",
|
|
33529
|
+
onRowClick: (e) => c.openEdit(e.entryId),
|
|
33530
|
+
defaultSort: {
|
|
33531
|
+
columnKey: "name",
|
|
33532
|
+
dir: "asc"
|
|
33533
|
+
}
|
|
33534
|
+
}),
|
|
33535
|
+
/* @__PURE__ */ V(NA, {
|
|
33536
|
+
open: N || O !== null,
|
|
33537
|
+
onClose: () => {
|
|
33538
|
+
c.close(), p(null);
|
|
33539
|
+
},
|
|
33540
|
+
title: N ? "Add provider" : `Edit ${O?.name ?? "provider"}`,
|
|
33541
|
+
icon: gn,
|
|
33542
|
+
width: "xl",
|
|
33543
|
+
testId: "provider-entry-editor",
|
|
33544
|
+
error: f,
|
|
33545
|
+
footer: N ? /* @__PURE__ */ V(X, {
|
|
33546
|
+
type: "button",
|
|
33547
|
+
size: "sm",
|
|
33548
|
+
disabled: l || !M || h === "",
|
|
33549
|
+
onClick: () => void k(),
|
|
33550
|
+
children: l ? "Creating…" : "Create"
|
|
33551
|
+
}) : /* @__PURE__ */ V(X, {
|
|
33552
|
+
type: "button",
|
|
33553
|
+
size: "sm",
|
|
33554
|
+
variant: "secondary",
|
|
33555
|
+
onClick: () => c.close(),
|
|
33556
|
+
children: "Done"
|
|
33713
33557
|
}),
|
|
33714
|
-
|
|
33715
|
-
|
|
33716
|
-
|
|
33717
|
-
|
|
33718
|
-
|
|
33719
|
-
|
|
33720
|
-
|
|
33721
|
-
|
|
33722
|
-
|
|
33723
|
-
|
|
33558
|
+
children: N ? /* @__PURE__ */ H(U, { children: [
|
|
33559
|
+
/* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V(ng, {
|
|
33560
|
+
htmlFor: "training-provider-type",
|
|
33561
|
+
children: "Provider type"
|
|
33562
|
+
}), /* @__PURE__ */ V(nd, {
|
|
33563
|
+
id: "training-provider-type",
|
|
33564
|
+
"aria-label": "Provider type",
|
|
33565
|
+
value: h,
|
|
33566
|
+
options: [{
|
|
33567
|
+
value: "",
|
|
33568
|
+
label: "Select type…"
|
|
33569
|
+
}, ...E],
|
|
33570
|
+
onChange: (e) => g(e.target.value),
|
|
33571
|
+
disabled: !M
|
|
33572
|
+
})] }),
|
|
33573
|
+
/* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V(ng, {
|
|
33574
|
+
htmlFor: "training-provider-name",
|
|
33575
|
+
children: "Name"
|
|
33576
|
+
}), /* @__PURE__ */ V(Cs, {
|
|
33577
|
+
id: "training-provider-name",
|
|
33578
|
+
value: _,
|
|
33579
|
+
onChange: (e) => v(e.target.value),
|
|
33580
|
+
placeholder: "e.g. Production"
|
|
33581
|
+
})] }),
|
|
33582
|
+
/* @__PURE__ */ V("p", {
|
|
33583
|
+
className: "text-xs text-foreground-muted",
|
|
33584
|
+
children: "Create stores the entry; settings and credentials open next."
|
|
33724
33585
|
})
|
|
33725
|
-
}),
|
|
33726
|
-
|
|
33727
|
-
|
|
33728
|
-
|
|
33729
|
-
|
|
33730
|
-
|
|
33731
|
-
A ? /* @__PURE__ */ V(RA, {
|
|
33732
|
-
open: c,
|
|
33733
|
-
onOpenChange: l,
|
|
33734
|
-
types: S,
|
|
33735
|
-
onCreate: k,
|
|
33736
|
-
submitting: d,
|
|
33737
|
-
title: "Add provider entry",
|
|
33738
|
-
description: "Pick a provider type and name this credential set. Add creates an entry here; installing a new provider addon is via Addons → training-provider."
|
|
33739
|
-
}) : null
|
|
33740
|
-
]
|
|
33741
|
-
})
|
|
33586
|
+
] }) : O === null ? null : /* @__PURE__ */ V(LF, {
|
|
33587
|
+
entry: O,
|
|
33588
|
+
trpc: e
|
|
33589
|
+
})
|
|
33590
|
+
})
|
|
33591
|
+
]
|
|
33742
33592
|
});
|
|
33743
33593
|
}
|
|
33744
33594
|
//#endregion
|
|
33745
33595
|
//#region src/page/training-tab.ts
|
|
33746
|
-
function
|
|
33596
|
+
function zF(e) {
|
|
33747
33597
|
let t = new URLSearchParams(e.startsWith("?") ? e.slice(1) : e).get("tab");
|
|
33748
33598
|
return t === "jobs" || t === "providers" || t === "frames" ? t : "frames";
|
|
33749
33599
|
}
|
|
33750
33600
|
//#endregion
|
|
33751
33601
|
//#region src/page.tsx
|
|
33752
33602
|
i();
|
|
33753
|
-
var
|
|
33754
|
-
function
|
|
33603
|
+
var BF = 5e3;
|
|
33604
|
+
function VF(e) {
|
|
33755
33605
|
let t = new URL(window.location.href);
|
|
33756
33606
|
t.searchParams.set("tab", e), window.history.replaceState({}, "", t.toString());
|
|
33757
33607
|
}
|
|
33758
|
-
function
|
|
33759
|
-
let [n, r] = a(() => typeof window > "u" ? "frames" :
|
|
33760
|
-
r(e),
|
|
33761
|
-
}, []),
|
|
33762
|
-
pollMs:
|
|
33763
|
-
poll:
|
|
33764
|
-
}),
|
|
33608
|
+
function HF({ trpc: e, navigate: t }) {
|
|
33609
|
+
let [n, r] = a(() => typeof window > "u" ? "frames" : zF(window.location.search)), [i, o] = a(!1), c = s((e) => {
|
|
33610
|
+
r(e), VF(e);
|
|
33611
|
+
}, []), l = oF(() => e.trainingProvider.describe.query({}), []), u = oF(() => e.training.listBaseModels.query({}), []), d = oF(() => e.pipelineAnalytics.listRetrainCollections.query({}), []), f = oF(() => e.deviceManager.listAll.query({ projection: "slim" }), []), p = oF(() => e.training.listJobs.query({}), [], {
|
|
33612
|
+
pollMs: BF,
|
|
33613
|
+
poll: WP
|
|
33614
|
+
}), h = m(() => new Map(f.state.status === "ok" ? f.state.data.map((e) => [e.id, e.name]) : []), [f.state]), g = s((e) => h.get(e) ?? `#${String(e)}`, [h]), _ = l.state.status === "pending" || u.state.status === "pending" || d.state.status === "pending", v = (() => {
|
|
33765
33615
|
let e = [];
|
|
33766
|
-
return
|
|
33616
|
+
return l.state.status === "error" && e.push(`providers: ${l.state.error}`), u.state.status === "error" && e.push(`base models: ${u.state.error}`), d.state.status === "error" && e.push(`collections: ${d.state.error}`), e.length > 0 ? e.join("; ") : null;
|
|
33767
33617
|
})();
|
|
33768
33618
|
return /* @__PURE__ */ H(MA, {
|
|
33769
33619
|
title: "Training",
|
|
33770
33620
|
subtitle: "Annotate the retrain corpus, run cloud fine-tunes on your GPU account, and configure providers.",
|
|
33621
|
+
actions: n === "providers" ? /* @__PURE__ */ H(X, {
|
|
33622
|
+
type: "button",
|
|
33623
|
+
size: "sm",
|
|
33624
|
+
"data-testid": "training-providers-add",
|
|
33625
|
+
onClick: () => o(!0),
|
|
33626
|
+
children: [/* @__PURE__ */ V(Yr, { className: "h-3.5 w-3.5" }), "Add provider"]
|
|
33627
|
+
}) : void 0,
|
|
33771
33628
|
children: [
|
|
33772
33629
|
/* @__PURE__ */ V(xg, {
|
|
33773
33630
|
value: n,
|
|
33774
33631
|
onValueChange: (e) => {
|
|
33775
|
-
(e === "frames" || e === "jobs" || e === "providers") &&
|
|
33632
|
+
(e === "frames" || e === "jobs" || e === "providers") && c(e);
|
|
33776
33633
|
},
|
|
33777
33634
|
children: /* @__PURE__ */ H(Sg, { children: [
|
|
33778
33635
|
/* @__PURE__ */ V(Cg, {
|
|
@@ -33789,24 +33646,26 @@ function nI({ trpc: e, navigate: t }) {
|
|
|
33789
33646
|
})
|
|
33790
33647
|
] })
|
|
33791
33648
|
}),
|
|
33792
|
-
n === "frames" ? /* @__PURE__ */ V(
|
|
33793
|
-
n === "providers" ? /* @__PURE__ */ V(
|
|
33649
|
+
n === "frames" ? /* @__PURE__ */ V(zP, {}) : null,
|
|
33650
|
+
n === "providers" ? /* @__PURE__ */ V(RF, {
|
|
33794
33651
|
trpc: e,
|
|
33795
|
-
navigate: t
|
|
33652
|
+
navigate: t,
|
|
33653
|
+
createRequested: i,
|
|
33654
|
+
onCreateConsumed: () => o(!1)
|
|
33796
33655
|
}) : null,
|
|
33797
|
-
n === "jobs" ? /* @__PURE__ */ V(
|
|
33656
|
+
n === "jobs" ? /* @__PURE__ */ V(NF, {
|
|
33798
33657
|
trpc: e,
|
|
33799
|
-
providers:
|
|
33800
|
-
baseModels:
|
|
33801
|
-
collections:
|
|
33802
|
-
jobs:
|
|
33803
|
-
onJobsReload:
|
|
33804
|
-
cameraName:
|
|
33805
|
-
depsPending:
|
|
33806
|
-
depsError:
|
|
33658
|
+
providers: l.state.status === "ok" ? l.state.data : null,
|
|
33659
|
+
baseModels: u.state.status === "ok" ? u.state.data : null,
|
|
33660
|
+
collections: d.state.status === "ok" ? d.state.data : null,
|
|
33661
|
+
jobs: p.state,
|
|
33662
|
+
onJobsReload: p.reload,
|
|
33663
|
+
cameraName: g,
|
|
33664
|
+
depsPending: _,
|
|
33665
|
+
depsError: v
|
|
33807
33666
|
}) : null
|
|
33808
33667
|
]
|
|
33809
33668
|
});
|
|
33810
33669
|
}
|
|
33811
33670
|
//#endregion
|
|
33812
|
-
export {
|
|
33671
|
+
export { BF as JOB_POLL_MS, HF as default, zF as readTrainingTab };
|