@camstack/addon-training 0.1.18 → 0.1.19

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