@camstack/addon-pipeline-orchestrator 1.2.604 → 1.2.605
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/assets/viewer/.viewer-current-files.json +2 -2
- package/assets/viewer/.viewer-version +1 -1
- package/assets/viewer/_expo/static/js/web/{__common-9186121cdd8e84b37963670cd7556b7e.js → __common-9209f030f5701da0e2e0d599fceea2f3.js} +9 -9
- package/assets/viewer/_expo/static/js/web/{index-5ea107bdcc99730e8fa2e5ef6ddb4a89.js → index-e0ee1e84f97c3608e8d3f41b36e5cf8e.js} +2 -2
- package/assets/viewer/index.html +1 -1
- package/dist/_stub.js +1 -1
- package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_orchestrator_widgets-C2QZ2EO2.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_orchestrator_widgets-CX6Mz1A2.mjs} +3 -3
- package/dist/_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-Wjbq284_.mjs +26 -0
- package/dist/{hostInit-4-EcE1hm.mjs → hostInit-BPiBtFhh.mjs} +3 -3
- package/dist/index.js +229 -196
- package/dist/index.mjs +229 -196
- package/dist/remoteEntry.js +1 -1
- package/package.json +1 -1
- package/assets/viewer/_expo/static/js/web/cameras-b1835891e5675d9822c90116cac3b30c.js +0 -21
- package/dist/_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-v4PWqk1N.mjs +0 -26
package/dist/index.mjs
CHANGED
|
@@ -7948,6 +7948,12 @@ function normalizeAddonInitResult(result) {
|
|
|
7948
7948
|
if (Array.isArray(result)) return { providers: result };
|
|
7949
7949
|
return result;
|
|
7950
7950
|
}
|
|
7951
|
+
/**
|
|
7952
|
+
* The share-view scope kinds a `csv_*` share token can carry. The hub mints
|
|
7953
|
+
* and validates them (`share-token.service.ts` builds its enum from this
|
|
7954
|
+
* list); a data plane names the kinds it ACCEPTS in `share`.
|
|
7955
|
+
*/
|
|
7956
|
+
var SHARE_VIEW_KINDS = ["grid-view", "events-view"];
|
|
7951
7957
|
/** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
|
|
7952
7958
|
var PeerBytesTicketSchema = object({
|
|
7953
7959
|
/** `http://127.0.0.1:<port>/<token>`. One `GET` takes it. */
|
|
@@ -13797,6 +13803,229 @@ var ConvertResultSchema = object({
|
|
|
13797
13803
|
files: array(string()).readonly()
|
|
13798
13804
|
})).readonly()
|
|
13799
13805
|
});
|
|
13806
|
+
/**
|
|
13807
|
+
* Zod schemas for persisted record types.
|
|
13808
|
+
*
|
|
13809
|
+
* These schemas serve as the single source of truth for types that are
|
|
13810
|
+
* stored in the settings-store backend and retrieved via tRPC. They
|
|
13811
|
+
* replace the manual TypeScript interfaces with schema-derived types,
|
|
13812
|
+
* enabling runtime validation when reading from the backend.
|
|
13813
|
+
*
|
|
13814
|
+
* Convention: each schema is named `<Type>Schema`, the inferred TS type
|
|
13815
|
+
* keeps the original name for backward compatibility.
|
|
13816
|
+
*/
|
|
13817
|
+
/**
|
|
13818
|
+
* Auth model (v2 — 2026-05-12 caps-only):
|
|
13819
|
+
*
|
|
13820
|
+
* Two principals:
|
|
13821
|
+
* - `isAdmin: true` — full bypass. Admin scope set is ignored.
|
|
13822
|
+
* - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
|
|
13823
|
+
*
|
|
13824
|
+
* No role enum. There used to be `viewer / agent / scoped` and earlier
|
|
13825
|
+
* `super_admin` — collapsed onto the single boolean because every
|
|
13826
|
+
* non-admin caller is governed by the same scope-check rules; the
|
|
13827
|
+
* distinction was only ever used to route role-specific procedures
|
|
13828
|
+
* which we no longer have. CLI / webhook integrations are `cst_*` tokens
|
|
13829
|
+
* with `isAdmin: false` + an explicit scope list.
|
|
13830
|
+
*/
|
|
13831
|
+
/** Per-method access flavour. Materialised on every cap method via codegen. */
|
|
13832
|
+
var MethodAccessSchema = _enum([
|
|
13833
|
+
"view",
|
|
13834
|
+
"create",
|
|
13835
|
+
"delete"
|
|
13836
|
+
]);
|
|
13837
|
+
/**
|
|
13838
|
+
* A single scope grant. Three forms — checked in matcher with OR
|
|
13839
|
+
* semantics; the first match decides whether the call passes:
|
|
13840
|
+
*
|
|
13841
|
+
* - `category` — broadest. `target: 'device' | 'system'` selects every
|
|
13842
|
+
* cap with the matching `scope` declaration. New caps inherit grants
|
|
13843
|
+
* automatically — adding a device cap to the codebase makes it
|
|
13844
|
+
* reachable to every user with `category:device [...]` without a
|
|
13845
|
+
* re-grant. Use this for "family viewer" / "operator" tiers.
|
|
13846
|
+
*
|
|
13847
|
+
* - `addon` — every cap that ships inside a given addon id. Niche;
|
|
13848
|
+
* useful when an integration needs to interact with one specific
|
|
13849
|
+
* addon's surface regardless of how many caps it exports.
|
|
13850
|
+
*
|
|
13851
|
+
* - `capability` — the most precise form. Single cap name. Use for
|
|
13852
|
+
* integration tokens where you want to grant `addons.installPackage`
|
|
13853
|
+
* and nothing else.
|
|
13854
|
+
*
|
|
13855
|
+
* `access` is REQUIRED with min 1 element. `admin` bypass is the
|
|
13856
|
+
* "give me everything" escape; there is no wildcard scope.
|
|
13857
|
+
*/
|
|
13858
|
+
var AllowedProviderSchema = union([literal("*"), array(string())]);
|
|
13859
|
+
var AllowedDevicesSchema = record(string(), union([literal("*"), array(string())]));
|
|
13860
|
+
var CapScopeSchema = _enum(["device", "system"]);
|
|
13861
|
+
/**
|
|
13862
|
+
* DeviceSelector (scope model v3 — 2026-08-12).
|
|
13863
|
+
*
|
|
13864
|
+
* A `device` grant no longer carries a frozen list of deviceIds. It carries
|
|
13865
|
+
* a SELECTOR the matcher resolves against the live fleet, so the grant can be
|
|
13866
|
+
* DYNAMIC: a `types:['camera']` selector automatically covers a camera added
|
|
13867
|
+
* AFTER the grant was minted — no re-grant, no re-login.
|
|
13868
|
+
*
|
|
13869
|
+
* - `all` — every device in the deployment. The broad viewer/operator
|
|
13870
|
+
* lever without a `category` grant (a `category` grant also covers device
|
|
13871
|
+
* caps that carry no deviceId; `all` is specifically the device set).
|
|
13872
|
+
* - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
|
|
13873
|
+
* grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
|
|
13874
|
+
* is NOT covered until the grant is edited.
|
|
13875
|
+
* - `types` — every device of a `DeviceType` (e.g. every `camera`).
|
|
13876
|
+
* DYNAMIC. A device that changes type, or a new device of the type,
|
|
13877
|
+
* re-resolves on the next request.
|
|
13878
|
+
* - `locations` — every device whose operator-assigned `location` label is
|
|
13879
|
+
* in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
|
|
13880
|
+
* null/unset location matches NO `locations` selector.
|
|
13881
|
+
*/
|
|
13882
|
+
var DeviceSelectorSchema = discriminatedUnion("kind", [
|
|
13883
|
+
object({ kind: literal("all") }),
|
|
13884
|
+
object({
|
|
13885
|
+
kind: literal("ids"),
|
|
13886
|
+
ids: array(number().int()).min(1)
|
|
13887
|
+
}),
|
|
13888
|
+
object({
|
|
13889
|
+
kind: literal("types"),
|
|
13890
|
+
types: array(_enum(DeviceType)).min(1)
|
|
13891
|
+
}),
|
|
13892
|
+
object({
|
|
13893
|
+
kind: literal("locations"),
|
|
13894
|
+
locations: array(string().min(1)).min(1)
|
|
13895
|
+
})
|
|
13896
|
+
]);
|
|
13897
|
+
var DeviceTokenScopeSchema = object({
|
|
13898
|
+
type: literal("device"),
|
|
13899
|
+
/** The device SET this grant covers — resolved against the live fleet. */
|
|
13900
|
+
selector: DeviceSelectorSchema,
|
|
13901
|
+
access: array(MethodAccessSchema).min(1),
|
|
13902
|
+
/**
|
|
13903
|
+
* Whether a grant on a PARENT device transparently covers its accessory
|
|
13904
|
+
* CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
|
|
13905
|
+
* Direction is parent → children ONLY.
|
|
13906
|
+
*
|
|
13907
|
+
* Absent → the matcher DERIVES it from the access flavour: `view`
|
|
13908
|
+
* inherits (a camera viewer sees the camera's accessories), `create` /
|
|
13909
|
+
* `delete` do NOT (actuating/removing a child is an explicit act the
|
|
13910
|
+
* operator must grant on the child, not inherit from the parent). Set it
|
|
13911
|
+
* explicitly to override that default per grant.
|
|
13912
|
+
*/
|
|
13913
|
+
includeLinked: boolean().optional()
|
|
13914
|
+
});
|
|
13915
|
+
/**
|
|
13916
|
+
* v2 → v3 lazy migration. A pre-v3 `device` grant carried
|
|
13917
|
+
* `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
|
|
13918
|
+
* `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
|
|
13919
|
+
* EVERY parse path — stored records AND the JWT-carried scope arrays
|
|
13920
|
+
* normalised at the request boundary ({@link normalizeTokenScopes} in
|
|
13921
|
+
* `device-selector.ts`). Chosen over a one-time DB migration because a
|
|
13922
|
+
* migration cannot reach a JWT already in a client's hands; parse-time
|
|
13923
|
+
* migration covers both without a flag day. No cast — the raw object is read
|
|
13924
|
+
* through `Reflect.get` (its static type is `unknown`).
|
|
13925
|
+
*/
|
|
13926
|
+
function migrateLegacyTokenScope(raw) {
|
|
13927
|
+
if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
|
|
13928
|
+
if (Reflect.get(raw, "type") !== "device") return raw;
|
|
13929
|
+
if (Reflect.get(raw, "selector") !== void 0) return raw;
|
|
13930
|
+
const targets = Reflect.get(raw, "targets");
|
|
13931
|
+
if (!Array.isArray(targets)) return raw;
|
|
13932
|
+
return {
|
|
13933
|
+
type: "device",
|
|
13934
|
+
selector: {
|
|
13935
|
+
kind: "ids",
|
|
13936
|
+
ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
|
|
13937
|
+
},
|
|
13938
|
+
access: Reflect.get(raw, "access")
|
|
13939
|
+
};
|
|
13940
|
+
}
|
|
13941
|
+
var TokenScopeSchema = preprocess(migrateLegacyTokenScope, discriminatedUnion("type", [
|
|
13942
|
+
object({
|
|
13943
|
+
type: literal("category"),
|
|
13944
|
+
target: CapScopeSchema,
|
|
13945
|
+
access: array(MethodAccessSchema).min(1)
|
|
13946
|
+
}),
|
|
13947
|
+
object({
|
|
13948
|
+
type: literal("capability"),
|
|
13949
|
+
target: string(),
|
|
13950
|
+
access: array(MethodAccessSchema).min(1)
|
|
13951
|
+
}),
|
|
13952
|
+
object({
|
|
13953
|
+
type: literal("addon"),
|
|
13954
|
+
target: string(),
|
|
13955
|
+
access: array(MethodAccessSchema).min(1)
|
|
13956
|
+
}),
|
|
13957
|
+
DeviceTokenScopeSchema
|
|
13958
|
+
]));
|
|
13959
|
+
object({
|
|
13960
|
+
id: string(),
|
|
13961
|
+
username: string(),
|
|
13962
|
+
passwordHash: string(),
|
|
13963
|
+
/**
|
|
13964
|
+
* Admin bypass. When true, the middleware skips the scope-access
|
|
13965
|
+
* check entirely. There is no other axis of privilege; the legacy
|
|
13966
|
+
* role enum collapsed onto this boolean in v2.
|
|
13967
|
+
*/
|
|
13968
|
+
isAdmin: boolean().default(false),
|
|
13969
|
+
allowedProviders: AllowedProviderSchema,
|
|
13970
|
+
allowedDevices: AllowedDevicesSchema,
|
|
13971
|
+
/**
|
|
13972
|
+
* Scopes granted to this user. Admins bypass; their `scopes` is
|
|
13973
|
+
* ignored. Non-admins without scopes are locked out of every
|
|
13974
|
+
* protected call.
|
|
13975
|
+
*/
|
|
13976
|
+
scopes: array(TokenScopeSchema).default([]),
|
|
13977
|
+
createdAt: number(),
|
|
13978
|
+
updatedAt: number()
|
|
13979
|
+
});
|
|
13980
|
+
object({
|
|
13981
|
+
id: string(),
|
|
13982
|
+
label: string(),
|
|
13983
|
+
isAdmin: boolean().default(false),
|
|
13984
|
+
allowedProviders: AllowedProviderSchema,
|
|
13985
|
+
allowedDevices: AllowedDevicesSchema,
|
|
13986
|
+
tokenHash: string(),
|
|
13987
|
+
tokenPrefix: string(),
|
|
13988
|
+
createdAt: number(),
|
|
13989
|
+
lastUsedAt: number().optional()
|
|
13990
|
+
});
|
|
13991
|
+
object({
|
|
13992
|
+
id: string(),
|
|
13993
|
+
userId: string(),
|
|
13994
|
+
name: string(),
|
|
13995
|
+
tokenHash: string(),
|
|
13996
|
+
tokenPrefix: string(),
|
|
13997
|
+
scopes: array(TokenScopeSchema),
|
|
13998
|
+
expiresAt: number().nullish(),
|
|
13999
|
+
lastUsedAt: number().nullish(),
|
|
14000
|
+
createdAt: number()
|
|
14001
|
+
});
|
|
14002
|
+
/** What a share-view grant lets its holder see. */
|
|
14003
|
+
var ShareViewGrantSchema = object({
|
|
14004
|
+
kind: _enum(SHARE_VIEW_KINDS),
|
|
14005
|
+
deviceIds: array(number().int().nonnegative()).min(1).max(64),
|
|
14006
|
+
/** Talk-back, opt-in at mint time; absent means off. */
|
|
14007
|
+
talk: boolean().optional()
|
|
14008
|
+
});
|
|
14009
|
+
var ShareViewScopeSchema = object({
|
|
14010
|
+
type: literal("share-view"),
|
|
14011
|
+
grant: ShareViewGrantSchema
|
|
14012
|
+
});
|
|
14013
|
+
var AddonRoutesScopeSchema = object({
|
|
14014
|
+
type: literal("addon-routes"),
|
|
14015
|
+
access: array(MethodAccessSchema).min(1)
|
|
14016
|
+
});
|
|
14017
|
+
var CredentialScopeSchema = union([
|
|
14018
|
+
literal("*"),
|
|
14019
|
+
ShareViewScopeSchema,
|
|
14020
|
+
AddonRoutesScopeSchema,
|
|
14021
|
+
TokenScopeSchema
|
|
14022
|
+
]);
|
|
14023
|
+
object({
|
|
14024
|
+
kind: literal("credential"),
|
|
14025
|
+
sub: string().min(1),
|
|
14026
|
+
jti: string().min(16),
|
|
14027
|
+
scopes: array(CredentialScopeSchema).min(1)
|
|
14028
|
+
});
|
|
13800
14029
|
_enum(["new-session", "step-up"]);
|
|
13801
14030
|
/** The languages the hub's app landing pages are written in (D858). */
|
|
13802
14031
|
var AppPageLangSchema = _enum(["en", "it"]);
|
|
@@ -44991,202 +45220,6 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
|
|
|
44991
45220
|
auth: "admin"
|
|
44992
45221
|
}), method(NcAlarmSensorsInputSchema, NcAlarmSensorsSchema, { auth: "admin" });
|
|
44993
45222
|
/**
|
|
44994
|
-
* Zod schemas for persisted record types.
|
|
44995
|
-
*
|
|
44996
|
-
* These schemas serve as the single source of truth for types that are
|
|
44997
|
-
* stored in the settings-store backend and retrieved via tRPC. They
|
|
44998
|
-
* replace the manual TypeScript interfaces with schema-derived types,
|
|
44999
|
-
* enabling runtime validation when reading from the backend.
|
|
45000
|
-
*
|
|
45001
|
-
* Convention: each schema is named `<Type>Schema`, the inferred TS type
|
|
45002
|
-
* keeps the original name for backward compatibility.
|
|
45003
|
-
*/
|
|
45004
|
-
/**
|
|
45005
|
-
* Auth model (v2 — 2026-05-12 caps-only):
|
|
45006
|
-
*
|
|
45007
|
-
* Two principals:
|
|
45008
|
-
* - `isAdmin: true` — full bypass. Admin scope set is ignored.
|
|
45009
|
-
* - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
|
|
45010
|
-
*
|
|
45011
|
-
* No role enum. There used to be `viewer / agent / scoped` and earlier
|
|
45012
|
-
* `super_admin` — collapsed onto the single boolean because every
|
|
45013
|
-
* non-admin caller is governed by the same scope-check rules; the
|
|
45014
|
-
* distinction was only ever used to route role-specific procedures
|
|
45015
|
-
* which we no longer have. CLI / webhook integrations are `cst_*` tokens
|
|
45016
|
-
* with `isAdmin: false` + an explicit scope list.
|
|
45017
|
-
*/
|
|
45018
|
-
/** Per-method access flavour. Materialised on every cap method via codegen. */
|
|
45019
|
-
var MethodAccessSchema = _enum([
|
|
45020
|
-
"view",
|
|
45021
|
-
"create",
|
|
45022
|
-
"delete"
|
|
45023
|
-
]);
|
|
45024
|
-
/**
|
|
45025
|
-
* A single scope grant. Three forms — checked in matcher with OR
|
|
45026
|
-
* semantics; the first match decides whether the call passes:
|
|
45027
|
-
*
|
|
45028
|
-
* - `category` — broadest. `target: 'device' | 'system'` selects every
|
|
45029
|
-
* cap with the matching `scope` declaration. New caps inherit grants
|
|
45030
|
-
* automatically — adding a device cap to the codebase makes it
|
|
45031
|
-
* reachable to every user with `category:device [...]` without a
|
|
45032
|
-
* re-grant. Use this for "family viewer" / "operator" tiers.
|
|
45033
|
-
*
|
|
45034
|
-
* - `addon` — every cap that ships inside a given addon id. Niche;
|
|
45035
|
-
* useful when an integration needs to interact with one specific
|
|
45036
|
-
* addon's surface regardless of how many caps it exports.
|
|
45037
|
-
*
|
|
45038
|
-
* - `capability` — the most precise form. Single cap name. Use for
|
|
45039
|
-
* integration tokens where you want to grant `addons.installPackage`
|
|
45040
|
-
* and nothing else.
|
|
45041
|
-
*
|
|
45042
|
-
* `access` is REQUIRED with min 1 element. `admin` bypass is the
|
|
45043
|
-
* "give me everything" escape; there is no wildcard scope.
|
|
45044
|
-
*/
|
|
45045
|
-
var AllowedProviderSchema = union([literal("*"), array(string())]);
|
|
45046
|
-
var AllowedDevicesSchema = record(string(), union([literal("*"), array(string())]));
|
|
45047
|
-
var CapScopeSchema = _enum(["device", "system"]);
|
|
45048
|
-
/**
|
|
45049
|
-
* DeviceSelector (scope model v3 — 2026-08-12).
|
|
45050
|
-
*
|
|
45051
|
-
* A `device` grant no longer carries a frozen list of deviceIds. It carries
|
|
45052
|
-
* a SELECTOR the matcher resolves against the live fleet, so the grant can be
|
|
45053
|
-
* DYNAMIC: a `types:['camera']` selector automatically covers a camera added
|
|
45054
|
-
* AFTER the grant was minted — no re-grant, no re-login.
|
|
45055
|
-
*
|
|
45056
|
-
* - `all` — every device in the deployment. The broad viewer/operator
|
|
45057
|
-
* lever without a `category` grant (a `category` grant also covers device
|
|
45058
|
-
* caps that carry no deviceId; `all` is specifically the device set).
|
|
45059
|
-
* - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
|
|
45060
|
-
* grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
|
|
45061
|
-
* is NOT covered until the grant is edited.
|
|
45062
|
-
* - `types` — every device of a `DeviceType` (e.g. every `camera`).
|
|
45063
|
-
* DYNAMIC. A device that changes type, or a new device of the type,
|
|
45064
|
-
* re-resolves on the next request.
|
|
45065
|
-
* - `locations` — every device whose operator-assigned `location` label is
|
|
45066
|
-
* in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
|
|
45067
|
-
* null/unset location matches NO `locations` selector.
|
|
45068
|
-
*/
|
|
45069
|
-
var DeviceSelectorSchema = discriminatedUnion("kind", [
|
|
45070
|
-
object({ kind: literal("all") }),
|
|
45071
|
-
object({
|
|
45072
|
-
kind: literal("ids"),
|
|
45073
|
-
ids: array(number().int()).min(1)
|
|
45074
|
-
}),
|
|
45075
|
-
object({
|
|
45076
|
-
kind: literal("types"),
|
|
45077
|
-
types: array(_enum(DeviceType)).min(1)
|
|
45078
|
-
}),
|
|
45079
|
-
object({
|
|
45080
|
-
kind: literal("locations"),
|
|
45081
|
-
locations: array(string().min(1)).min(1)
|
|
45082
|
-
})
|
|
45083
|
-
]);
|
|
45084
|
-
var DeviceTokenScopeSchema = object({
|
|
45085
|
-
type: literal("device"),
|
|
45086
|
-
/** The device SET this grant covers — resolved against the live fleet. */
|
|
45087
|
-
selector: DeviceSelectorSchema,
|
|
45088
|
-
access: array(MethodAccessSchema).min(1),
|
|
45089
|
-
/**
|
|
45090
|
-
* Whether a grant on a PARENT device transparently covers its accessory
|
|
45091
|
-
* CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
|
|
45092
|
-
* Direction is parent → children ONLY.
|
|
45093
|
-
*
|
|
45094
|
-
* Absent → the matcher DERIVES it from the access flavour: `view`
|
|
45095
|
-
* inherits (a camera viewer sees the camera's accessories), `create` /
|
|
45096
|
-
* `delete` do NOT (actuating/removing a child is an explicit act the
|
|
45097
|
-
* operator must grant on the child, not inherit from the parent). Set it
|
|
45098
|
-
* explicitly to override that default per grant.
|
|
45099
|
-
*/
|
|
45100
|
-
includeLinked: boolean().optional()
|
|
45101
|
-
});
|
|
45102
|
-
/**
|
|
45103
|
-
* v2 → v3 lazy migration. A pre-v3 `device` grant carried
|
|
45104
|
-
* `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
|
|
45105
|
-
* `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
|
|
45106
|
-
* EVERY parse path — stored records AND the JWT-carried scope arrays
|
|
45107
|
-
* normalised at the request boundary ({@link normalizeTokenScopes} in
|
|
45108
|
-
* `device-selector.ts`). Chosen over a one-time DB migration because a
|
|
45109
|
-
* migration cannot reach a JWT already in a client's hands; parse-time
|
|
45110
|
-
* migration covers both without a flag day. No cast — the raw object is read
|
|
45111
|
-
* through `Reflect.get` (its static type is `unknown`).
|
|
45112
|
-
*/
|
|
45113
|
-
function migrateLegacyTokenScope(raw) {
|
|
45114
|
-
if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
|
|
45115
|
-
if (Reflect.get(raw, "type") !== "device") return raw;
|
|
45116
|
-
if (Reflect.get(raw, "selector") !== void 0) return raw;
|
|
45117
|
-
const targets = Reflect.get(raw, "targets");
|
|
45118
|
-
if (!Array.isArray(targets)) return raw;
|
|
45119
|
-
return {
|
|
45120
|
-
type: "device",
|
|
45121
|
-
selector: {
|
|
45122
|
-
kind: "ids",
|
|
45123
|
-
ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
|
|
45124
|
-
},
|
|
45125
|
-
access: Reflect.get(raw, "access")
|
|
45126
|
-
};
|
|
45127
|
-
}
|
|
45128
|
-
var TokenScopeSchema = preprocess(migrateLegacyTokenScope, discriminatedUnion("type", [
|
|
45129
|
-
object({
|
|
45130
|
-
type: literal("category"),
|
|
45131
|
-
target: CapScopeSchema,
|
|
45132
|
-
access: array(MethodAccessSchema).min(1)
|
|
45133
|
-
}),
|
|
45134
|
-
object({
|
|
45135
|
-
type: literal("capability"),
|
|
45136
|
-
target: string(),
|
|
45137
|
-
access: array(MethodAccessSchema).min(1)
|
|
45138
|
-
}),
|
|
45139
|
-
object({
|
|
45140
|
-
type: literal("addon"),
|
|
45141
|
-
target: string(),
|
|
45142
|
-
access: array(MethodAccessSchema).min(1)
|
|
45143
|
-
}),
|
|
45144
|
-
DeviceTokenScopeSchema
|
|
45145
|
-
]));
|
|
45146
|
-
object({
|
|
45147
|
-
id: string(),
|
|
45148
|
-
username: string(),
|
|
45149
|
-
passwordHash: string(),
|
|
45150
|
-
/**
|
|
45151
|
-
* Admin bypass. When true, the middleware skips the scope-access
|
|
45152
|
-
* check entirely. There is no other axis of privilege; the legacy
|
|
45153
|
-
* role enum collapsed onto this boolean in v2.
|
|
45154
|
-
*/
|
|
45155
|
-
isAdmin: boolean().default(false),
|
|
45156
|
-
allowedProviders: AllowedProviderSchema,
|
|
45157
|
-
allowedDevices: AllowedDevicesSchema,
|
|
45158
|
-
/**
|
|
45159
|
-
* Scopes granted to this user. Admins bypass; their `scopes` is
|
|
45160
|
-
* ignored. Non-admins without scopes are locked out of every
|
|
45161
|
-
* protected call.
|
|
45162
|
-
*/
|
|
45163
|
-
scopes: array(TokenScopeSchema).default([]),
|
|
45164
|
-
createdAt: number(),
|
|
45165
|
-
updatedAt: number()
|
|
45166
|
-
});
|
|
45167
|
-
object({
|
|
45168
|
-
id: string(),
|
|
45169
|
-
label: string(),
|
|
45170
|
-
isAdmin: boolean().default(false),
|
|
45171
|
-
allowedProviders: AllowedProviderSchema,
|
|
45172
|
-
allowedDevices: AllowedDevicesSchema,
|
|
45173
|
-
tokenHash: string(),
|
|
45174
|
-
tokenPrefix: string(),
|
|
45175
|
-
createdAt: number(),
|
|
45176
|
-
lastUsedAt: number().optional()
|
|
45177
|
-
});
|
|
45178
|
-
object({
|
|
45179
|
-
id: string(),
|
|
45180
|
-
userId: string(),
|
|
45181
|
-
name: string(),
|
|
45182
|
-
tokenHash: string(),
|
|
45183
|
-
tokenPrefix: string(),
|
|
45184
|
-
scopes: array(TokenScopeSchema),
|
|
45185
|
-
expiresAt: number().nullish(),
|
|
45186
|
-
lastUsedAt: number().nullish(),
|
|
45187
|
-
createdAt: number()
|
|
45188
|
-
});
|
|
45189
|
-
/**
|
|
45190
45223
|
* `oauth-integration` — a collection cap by which an addon declares
|
|
45191
45224
|
* itself a linkable OAuth client of the hub's core `/oauth2/*` server.
|
|
45192
45225
|
* Each provider returns a static descriptor; the core enumerates them
|
package/dist/remoteEntry.js
CHANGED
|
@@ -30,7 +30,7 @@ async function d(e) {
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
async function f() {
|
|
33
|
-
return l ||= d(() => import("./_virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_orchestrator_widgets-
|
|
33
|
+
return l ||= d(() => import("./_virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_orchestrator_widgets-CX6Mz1A2.mjs")).catch((e) => {
|
|
34
34
|
throw l = void 0, e;
|
|
35
35
|
}), l;
|
|
36
36
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-pipeline-orchestrator",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.605",
|
|
4
4
|
"description": "Hub-side camera-to-agent load balancer — tracks runner capacity and dispatches attachCamera calls to the optimal pipeline-runner instance",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});var t=r(d[0]),n=r(d[1]),c=r(d[2]);function o(){const o=(0,t.c)(1);let u;return o[0]===Symbol.for("react.memo_cache_sentinel")?(u=(0,c.jsx)(n.CamerasScreen,{}),o[0]=u):u=o[0],u}},748,[787,796,10]);
|
|
2
|
-
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.CamerasScreen=function(){const e=(0,t.c)(112),{t:c}=(0,f.useTranslation)(),{state:oe,startingUp:ge}=(0,p.useConnection)(),{colors:Ce}=(0,h.useTheme)(),ye=(0,S.useRouter)(),be=(0,Z.useGridColumns)(),{data:ve,error:xe,isLoading:Ee,refetch:Ie}=(0,B.useCameras)();let Re;e[0]!==ve?(Re=void 0===ve?[]:ve,e[0]=ve,e[1]=Re):Re=e[1];const je=Re,[Ae,Oe]=(0,n.useState)(null),Te=(0,W.useLocationIcons)(),Pe=(0,k.useSiteZones)(),Ne=(0,V.useCameraFavouritesStore)(Se),Me=(0,V.useCameraFavouritesStore)(fe),We=(0,V.useCameraFavouritesStore)(me);let ke,we,Fe;e[2]!==We?(ke=()=>{We()},we=[We],e[2]=We,e[3]=ke,e[4]=we):(ke=e[3],we=e[4]);(0,n.useEffect)(ke,we),e[5]!==je?(Fe=(0,M.locationsOf)(je),e[5]=je,e[6]=Fe):Fe=e[6];const Ve=Fe;let ze,Ge;e[7]!==Pe.data?(ze=Pe.data??[],e[7]=Pe.data,e[8]=ze):ze=e[8];e[9]!==je||e[10]!==Ae||e[11]!==Ne||e[12]!==ze?(Ge=(0,M.camerasInBucket)(je,Ae,Ne,ze),e[9]=je,e[10]=Ae,e[11]=Ne,e[12]=ze,e[13]=Ge):Ge=e[13];const Be=Ge,[Le,De]=(0,n.useState)(!1);let He;e[14]===Symbol.for("react.memo_cache_sentinel")?(He=()=>De(de),e[14]=He):He=e[14];const Ue=He;let Ze;e[15]!==je?(Ze=je.map(ue),e[15]=je,e[16]=Ze):Ze=e[16];const $e=Ze,qe=(0,w.useMotionRecency)($e,Le);let Ke;e[17]!==Be||e[18]!==Le||e[19]!==qe?(Ke=Le?(0,F.orderByMotionRecency)(Be,qe):Be,e[17]=Be,e[18]=Le,e[19]=qe,e[20]=Ke):Ke=e[20];const Qe=Ke,Ye=(0,_.useSnapshotRefreshStore)(ce),{settings:Je}=(0,q.useSettings)(),[Xe,et]=(0,n.useState)(!1);let tt;e[21]!==Ye||e[22]!==Ie?(tt=()=>{(0,y.hapticTap)(),Ye(),et(!0),Ie().finally(()=>et(!1))},e[21]=Ye,e[22]=Ie,e[23]=tt):tt=e[23];const nt=tt,rt=(0,J.useBottomNavInset)();let ot;e[24]!==Je.events.reelThumbSize?(ot=(0,K.reelThumbSizePx)(Je.events.reelThumbSize),e[24]=Je.events.reelThumbSize,e[25]=ot):ot=e[25];const lt=ot,[st,at]=(0,n.useState)(!1),[it,ct]=(0,n.useState)(!1),ut=(0,O.useReelFilterStore)(ie);let dt;e[26]!==ut?(dt=(0,O.reelFilterCondition)(ut),e[26]=ut,e[27]=dt):dt=e[27];const mt=dt,[ft,St]=(0,n.useState)(!1),[pt,ht]=(0,n.useState)(null);let gt;e[28]!==Qe||e[29]!==pt?(gt=Qe.find(e=>e.id===pt)??null,e[28]=Qe,e[29]=pt,e[30]=gt):gt=e[30];const Ct=gt;let _t;e[31]!==Qe?(_t=Qe.map(ae),e[31]=Qe,e[32]=_t):_t=e[32];const yt=_t,bt=(0,U.useScreenActive)(),vt=(0,Y.useSeekToMoment)(),xt="connected"===oe;let Et,It;e[33]!==vt?(Et=(e,t)=>vt(e.deviceId,t),e[33]=vt,e[34]=Et):Et=e[34];e[35]!==lt||e[36]!==xt||e[37]!==Et?(It=(0,X.jsx)(P.RecentReelBlock,{cardWidth:lt,live:xt,onSeek:Et}),e[35]=lt,e[36]=xt,e[37]=Et,e[38]=It):It=e[38];const Rt=It,[jt,At]=(0,n.useState)(null);let Ot;e[39]===Symbol.for("react.memo_cache_sentinel")?(Ot=e=>{const{viewableItems:t}=e;At(t.map(se).filter(le))},e[39]=Ot):Ot=e[39];const Tt=Ot;let Pt;e[40]===Symbol.for("react.memo_cache_sentinel")?(Pt=[],e[40]=Pt):Pt=e[40];const[Nt,Mt]=(0,n.useState)(Pt);let Wt;e[41]===Symbol.for("react.memo_cache_sentinel")?(Wt={all:[],visible:[]},e[41]=Wt):Wt=e[41];const kt=(0,n.useRef)(Wt);let wt,Ft,Vt,zt,Gt,Bt,Lt;e[42]!==yt||e[43]!==jt?(wt=()=>{kt.current={all:yt,visible:jt??[]}},Ft=[yt,jt],e[42]=yt,e[43]=jt,e[44]=wt,e[45]=Ft):(wt=e[44],Ft=e[45]);(0,n.useEffect)(wt,Ft),e[46]!==bt?(Vt=()=>{if(!bt||ee)return;let e=new Set,t=null;const n=()=>{null!==t&&clearInterval(t),t=null},o=()=>{const t=(0,C.nextSweepSlice)({all:kt.current.all,visible:kt.current.visible,covered:e,size:C.SWEEP_SLICE_SIZE});e=t.covered,Mt(t.warm),t.done&&(kt.current.all.length>0&&(ee=!0),n(),Mt([]))};return t=setInterval(o,C.SWEEP_TICK_MS),o(),()=>{n(),Mt([])}},zt=[bt],e[46]=bt,e[47]=Vt,e[48]=zt):(Vt=e[47],zt=e[48]);(0,n.useEffect)(Vt,zt),e[49]!==yt||e[50]!==bt||e[51]!==jt||e[52]!==Nt?(Gt=()=>{if(!bt)return void H.snapshotViewport.forget(H.CAMERAS_VIEWPORT_OWNER);const e=(0,H.listViewportReport)(yt,jt,Nt);null===e?H.snapshotViewport.forget(H.CAMERAS_VIEWPORT_OWNER):H.snapshotViewport.report(H.CAMERAS_VIEWPORT_OWNER,e)},Bt=[bt,jt,Nt,yt],e[49]=yt,e[50]=bt,e[51]=jt,e[52]=Nt,e[53]=Gt,e[54]=Bt):(Gt=e[53],Bt=e[54]);(0,n.useEffect)(Gt,Bt),e[55]===Symbol.for("react.memo_cache_sentinel")?(Lt=[],e[55]=Lt):Lt=e[55];(0,n.useEffect)(re,Lt);const{hasNoViewableDevices:Dt}=(0,$.useUserScope)();let Ht,Ut,Zt,$t,qt,Kt;e[56]!==Ce.background?(Ht={flex:1,backgroundColor:Ce.background},e[56]=Ce.background,e[57]=Ht):Ht=e[57];e[58]===Symbol.for("react.memo_cache_sentinel")?(Ut=(0,X.jsx)(v.ScreenHeader,{}),e[58]=Ut):Ut=e[58];e[59]===Symbol.for("react.memo_cache_sentinel")?(Zt=()=>at(!1),e[59]=Zt):Zt=e[59];e[60]!==st?($t=(0,X.jsx)(j.CamerasDisplaySheet,{visible:st,onClose:Zt}),e[60]=st,e[61]=$t):$t=e[61];e[62]===Symbol.for("react.memo_cache_sentinel")?(qt=()=>ct(!1),e[62]=qt):qt=e[62];e[63]!==it?(Kt=(0,X.jsx)(A.ReelFilterSheet,{visible:it,onClose:qt}),e[63]=it,e[64]=Kt):Kt=e[64];const Qt=null!==pt;let Yt,Jt,Xt,en,tn,nn,rn;e[65]===Symbol.for("react.memo_cache_sentinel")?(Yt=()=>ht(null),e[65]=Yt):Yt=e[65];e[66]!==Ct||e[67]!==Qt?(Jt=(0,X.jsx)(T.CameraControlsOverlay,{visible:Qt,camera:Ct,onClose:Yt}),e[66]=Ct,e[67]=Qt,e[68]=Jt):Jt=e[68];e[69]===Symbol.for("react.memo_cache_sentinel")?(Xt=(0,X.jsx)(b.ConnectionBanner,{}),e[69]=Xt):Xt=e[69];e[70]!==je.length||e[71]!==Ae||e[72]!==Qe||e[73]!==Ce.foregroundMuted||e[74]!==Ce.foregroundSubtle||e[75]!==Ce.primary||e[76]!==xe||e[77]!==Ne||e[78]!==Dt||e[79]!==Ee||e[80]!==Te||e[81]!==Ve||e[82]!==Le||e[83]!==rt||e[84]!==be||e[85]!==nt||e[86]!==Xe||e[87]!==Rt||e[88]!==lt||e[89]!==ye||e[90]!==Pe.data||e[91]!==ge||e[92]!==oe||e[93]!==c||e[94]!==Me?(en=je.length>0?(0,X.jsxs)(X.Fragment,{children:[Rt,(0,X.jsx)(N.CameraLocationBar,{locations:Ve,bucket:Ae,onSelect:Oe,favouriteCount:Ne.size,icons:Te.data,zones:Pe.data,motionOrder:Le,onToggleMotionOrder:Ue}),(0,X.jsx)(o.default,{testID:G.CAMERAS_LIST_TEST_ID,style:pe.listWrap,children:(0,X.jsx)(s.default,{data:Qe,ListEmptyComponent:(0,X.jsx)(l.default,{style:{color:Ce.foregroundMuted,fontSize:13,textAlign:"center",paddingVertical:Q.SPACING.xl},children:c("v2.cameras.bucketEmpty")}),numColumns:be,keyExtractor:ne,onViewableItemsChanged:Tt,viewabilityConfig:H.SNAPSHOT_VIEWABILITY_CONFIG,refreshControl:(0,X.jsx)(u.default,{refreshing:Xe,onRefresh:nt,tintColor:Ce.foregroundMuted,colors:[Ce.primary]}),contentContainerStyle:{padding:Q.SPACING.md,paddingBottom:Q.SPACING.md+88+rt,gap:Q.SPACING.md},columnWrapperStyle:be>1?{gap:Q.SPACING.md}:void 0,renderItem:e=>{const{item:t}=e;return(0,X.jsx)(o.default,{style:{flex:1/be},children:(0,X.jsx)(x.CameraCard,{camera:t,isFavourite:Ne.has(t.id),onToggleFavourite:()=>{Me(t.id)},onPress:()=>{(0,y.hapticTap)(),ye.push(`/camera/${t.id}`)},onOpenOverlay:()=>{(0,y.hapticTap)(),(0,E.openOnDemandPlayer)((0,I.liveOnDemandRequest)(t.id))},onOpenControls:()=>{(0,y.hapticTap)(),ht(t.id)}})})}},`cols-${be}`)})]}):ge||Ee?(0,X.jsx)(R.CamerasGridSkeleton,{numColumns:be,reelCardWidth:lt}):"connected"!==oe?null:(0,X.jsxs)(he,{children:[(0,X.jsx)(l.default,{style:{color:Ce.foregroundMuted,fontSize:15},children:c(Dt?"v2.cameras.emptyOutOfScope":"v2.cameras.empty")}),Dt?(0,X.jsx)(l.default,{style:{color:Ce.foregroundSubtle,fontSize:12,textAlign:"center"},children:c("v2.cameras.emptyOutOfScopeHint")}):null,xe?(0,X.jsx)(l.default,{style:{color:Ce.foregroundSubtle,fontSize:12,textAlign:"center"},children:(0,L.isQueryDeadlineError)(xe)?c("v2.cameras.hubNotAnswering"):xe instanceof Error?xe.message:c("v2.common.loadError")}):null]}),e[70]=je.length,e[71]=Ae,e[72]=Qe,e[73]=Ce.foregroundMuted,e[74]=Ce.foregroundSubtle,e[75]=Ce.primary,e[76]=xe,e[77]=Ne,e[78]=Dt,e[79]=Ee,e[80]=Te,e[81]=Ve,e[82]=Le,e[83]=rt,e[84]=be,e[85]=nt,e[86]=Xe,e[87]=Rt,e[88]=lt,e[89]=ye,e[90]=Pe.data,e[91]=ge,e[92]=oe,e[93]=c,e[94]=Me,e[95]=en):en=e[95];e[96]!==ft||e[97]!==mt||e[98]!==ye||e[99]!==oe?(tn="connected"===oe?(0,X.jsx)(z.CamerasFab,{open:ft,onToggle:()=>St(te),onClose:()=>St(!1),onAppearance:()=>{St(!1),at(!0)},onEditList:()=>{St(!1),ye.push("/settings/cameras")},reelCondition:mt,onReelFilter:()=>{St(!1),ct(!0)}}):null,e[96]=ft,e[97]=mt,e[98]=ye,e[99]=oe,e[100]=tn):tn=e[100];e[101]!==Ht||e[102]!==$t||e[103]!==Kt||e[104]!==Jt||e[105]!==en||e[106]!==tn?(nn=(0,X.jsxs)(o.default,{style:Ht,children:[Ut,$t,Kt,Jt,Xt,en,tn]}),e[101]=Ht,e[102]=$t,e[103]=Kt,e[104]=Jt,e[105]=en,e[106]=tn,e[107]=nn):nn=e[107];e[108]!==yt||e[109]!==bt||e[110]!==nn?(rn=(0,X.jsx)(D.CameraBadgesProvider,{deviceIds:yt,enabled:bt,children:nn}),e[108]=yt,e[109]=bt,e[110]=nn,e[111]=rn):rn=e[111];return rn};var t=r(d[0]),n=r(d[1]),o=e(r(d[2])),l=e(r(d[3])),s=e(r(d[4])),c=e(r(d[5])),u=e(r(d[6])),f=r(d[7]),S=r(d[8]),p=r(d[9]),h=r(d[10]),C=r(d[11]),_=r(d[12]),y=r(d[13]),b=r(d[14]),v=r(d[15]),x=r(d[16]),E=r(d[17]),I=r(d[18]),R=r(d[19]),j=r(d[20]),A=r(d[21]),O=r(d[22]),T=r(d[23]),P=r(d[24]),N=r(d[25]),M=r(d[26]),W=r(d[27]),k=r(d[28]),w=r(d[29]),F=r(d[30]),V=r(d[31]),z=r(d[32]),G=r(d[33]),B=r(d[34]),L=r(d[35]),D=r(d[36]),H=r(d[37]),U=r(d[38]),Z=r(d[39]),$=r(d[40]),q=r(d[41]),K=r(d[42]),Q=r(d[43]),Y=r(d[44]),J=r(d[45]),X=r(d[46]);let ee=!1;function te(e){return!e}function ne(e){return String(e.id)}function re(){return oe}function oe(){H.snapshotViewport.forget(H.CAMERAS_VIEWPORT_OWNER)}function le(e){return Number.isFinite(e)&&e>0}function se(e){return Number(e.key)}function ae(e){return e.id}function ie(e){return e.filter}function ce(e){return e.bumpSnapshots}function ue(e){return e.id}function de(e){return!e}function me(e){return e.hydrate}function fe(e){return e.toggle}function Se(e){return e.ids}const pe=c.default.create({listWrap:{flex:1}});function he(e){const n=(0,t.c)(3),{children:l}=e;let s,c;return n[0]===Symbol.for("react.memo_cache_sentinel")?(s={flex:1,alignItems:"center",justifyContent:"center",padding:Q.SPACING["2xl"],gap:Q.SPACING.sm},n[0]=s):s=n[0],n[1]!==l?(c=(0,X.jsx)(o.default,{style:s,children:l}),n[1]=l,n[2]=c):c=n[2],c}},796,[787,16,114,193,112,32,137,816,788,817,789,797,818,819,820,821,798,822,823,800,805,806,824,807,801,808,809,810,825,811,812,813,814,815,826,827,828,829,830,790,831,832,833,834,835,794,10]);
|
|
3
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"SWEEP_SLICE_SIZE",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"SWEEP_TICK_MS",{enumerable:!0,get:function(){return t}}),e.nextSweepSlice=function(n){const{all:t,visible:o,covered:c,size:s}=n,u=new Set(c);for(const n of o)u.add(n);const f=[];for(const n of t){if(f.length>=s)break;u.has(n)||(f.push(n),u.add(n))}return{warm:f,covered:u,done:t.every(n=>u.has(n))}};const n=2,t=12e3},797,[]);
|
|
4
|
-
__d(function(g,r,i,a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"CameraCard",{enumerable:!0,get:function(){return _}});var t=r(d[0]),o=r(d[1]),n=e(o),s=e(r(d[2])),l=e(r(d[3])),c=e(r(d[4])),u=e(r(d[5])),f=e(r(d[6])),h=r(d[7]),b=r(d[8]),p=r(d[9]),m=r(d[10]),y=r(d[11]),x=r(d[12]),S=r(d[13]),j=r(d[14]),v=r(d[15]),C=r(d[16]),I=r(d[17]),k=r(d[18]),w=r(d[19]),P=r(d[20]),B=r(d[21]),M=r(d[22]),L=r(d[23]),A=r(d[24]),z=r(d[25]),R=r(d[26]),N=r(d[27]),D=r(d[28]),O=r(d[29]),G=r(d[30]),T=r(d[31]),E=r(d[32]),H=r(d[33]);function V(e){if(null===e)return'\u2014';const t=Math.round(e/1e3);if(t<60)return`${String(t)}s`;const o=Math.round(t/60);return o<60?`${String(o)}m`:`${String(Math.round(o/60))}h`}const _=n.default.memo(function({camera:e,onPress:t,onOpenControls:n,onOpenOverlay:y,isFavourite:_,onToggleFavourite:U}){const{t:F}=(0,h.useTranslation)(),{colors:q}=(0,m.useTheme)(),J=(0,P.useStatusDetail)(),K=(0,o.useMemo)(()=>$(q),[q]),Q=e.features.includes(x.FEATURE.battery),X=(0,z.useScreenActive)(),{settings:Y}=(0,I.useSettings)(),Z=Y.cameraList,ee=e.disabled,te=(0,S.useCameraBadgeRow)(e.id),oe=!te.supported&&!te.pending,{data:re=null}=(0,C.useBattery)(e.id,Q&&X&&!ee&&oe),ne=te.supported?te.row.battery:re,se=Q&&!0===ne?.sleeping,{data:ie=null}=(0,L.useNetworkLink)(e.id,X&&!ee&&oe),le=te.supported?te.row.networkLink:ie,{data:ae=[]}=(0,E.useCameraChildrenStates)(e.id,e.online&&X&&!ee),de={screenActive:X,online:e.online,disabled:ee,sleeping:se},ce=(0,G.isLiveEdge)(de),ue=(0,G.shouldRequestSnapshot)(de),fe=(0,R.useCardSnapshotWidth)(),ge=(0,j.useSnapshot)(e.id,ue,fe),{uri:he,isLoading:be,refreshing:pe}=ge,me=(0,A.useMotionHighlight)(e.id,ce&&Z.motionBorder),ye=be&&!ge.hubUnresponsive,xe=ge.hubUnresponsive,Se=ge.stale&&null!==he&&!ye;return(0,H.jsxs)(c.default,{onPress:t,style:({pressed:e})=>[K.card,e&&K.cardPressed],children:[(0,H.jsxs)(s.default,{style:K.media,children:[(0,H.jsx)(N.SnapshotImage,{source:ge,deviceId:e.id,style:u.default.absoluteFill}),ye?(0,H.jsx)(v.SkeletonBox,{}):xe?(0,H.jsxs)(s.default,{style:K.overlay,pointerEvents:"none",children:[(0,H.jsx)(b.ImageOff,{size:22,color:q.foregroundSubtle}),(0,H.jsx)(l.default,{style:K.overlaySubtleText,children:F('v2.cameras.hubNotProvisioning')})]}):null,pe&&!ye?(0,H.jsx)(s.default,{style:K.refreshChip,pointerEvents:"none",accessibilityLabel:F('v2.cameras.refreshing'),children:(0,H.jsx)(f.default,{size:"small",color:"#fff",style:K.refreshSpinner})}):null,(0,H.jsxs)(s.default,{style:K.topLeft,pointerEvents:"box-none",children:[(0,H.jsx)(c.default,{onPress:()=>{(0,p.hapticTap)(),U()},hitSlop:8,accessibilityRole:"button",accessibilityState:{selected:_},accessibilityLabel:_?F('v2.cameras.unfavourite','Remove from favourites'):F('v2.cameras.favourite','Add to favourites'),style:K.heartChip,children:(0,H.jsx)(b.Heart,{size:13,color:_?'#ff4d6d':'#fff',fill:_?'#ff4d6d':'transparent'})}),Se?(0,H.jsxs)(s.default,{style:K.staleChip,pointerEvents:"none",accessibilityLabel:F('v2.cameras.snapshotStale',{age:V(ge.ageMs)}),children:[(0,H.jsx)(b.Clock,{size:10,color:"#fff"}),(0,H.jsx)(l.default,{style:K.staleChipText,children:V(ge.ageMs)})]}):null]}),(0,H.jsx)(T.OccupancyBadge,{deviceId:e.id,enabled:ce&&'off'!==Z.occupancy,corner:'off'===Z.occupancy?'bottom-left':Z.occupancy}),me&&!ee&&Z.motionBorder?(0,H.jsx)(D.MotionBorder,{}):null,(0,H.jsx)(P.StatusDetailPopover,{controller:J,battery:ne,link:le,deviceId:e.id,colors:q,placement:"insideBottom"})]}),(0,H.jsxs)(s.default,{style:K.footer,children:[(0,H.jsx)(s.default,{style:K.dot,children:se&&!e.disabled?(0,H.jsx)(b.Moon,{size:12,color:q.foregroundMuted}):(0,H.jsx)(O.CameraStatusDot,{deviceId:e.id,online:e.online,disabled:e.disabled,enabled:!se})}),(0,H.jsx)(l.default,{style:K.name,numberOfLines:1,children:e.name}),(0,H.jsxs)(s.default,{style:K.hints,children:[ae.map(e=>(0,H.jsx)(W,{child:e,colors:q},e.id)),Q&&ne?(0,H.jsx)(P.StatusBadgeButton,{subject:"battery",lines:(0,B.batteryDetailLines)(ne),controller:J,children:(0,H.jsx)(k.BatteryBadge,{battery:ne,colors:q})}):null,(0,w.networkLinkBadgeVisible)(le)&&le?(0,H.jsx)(P.StatusBadgeButton,{subject:"link",lines:(0,B.networkLinkDetailLines)(le),controller:J,children:(0,H.jsx)(w.NetworkLinkBadge,{link:le,colors:q})}):null,(0,M.streamBadgeVisible)({batteryVisible:Boolean(Q&&ne),linkVisible:Boolean((0,w.networkLinkBadgeVisible)(le)&&le)})?(0,H.jsx)(P.StatusBadgeButton,{subject:"stream",lines:[],controller:J,children:(0,H.jsx)(M.StreamBadge,{colors:q})}):null]}),(0,H.jsx)(c.default,{onPress:e=>{e.stopPropagation(),y()},hitSlop:8,accessibilityRole:"button",accessibilityLabel:F('v2.cameras.overlayA11y'),style:({pressed:e})=>[K.controlsBtn,e&&{backgroundColor:q.surfaceHover}],children:(0,H.jsx)(b.PictureInPicture2,{size:18,color:q.foregroundMuted})}),(0,H.jsx)(c.default,{onPress:e=>{e.stopPropagation(),n()},hitSlop:8,accessibilityRole:"button",accessibilityLabel:F('v2.cameras.controlsA11y'),style:({pressed:e})=>[K.controlsBtn,e&&{backgroundColor:q.surfaceHover}],children:(0,H.jsx)(b.Lightbulb,{size:18,color:q.foregroundMuted})})]})]})}),U={light:b.Lightbulb,switch:b.Power,siren:b.Siren,other:b.Plug};function W(e){const o=(0,t.c)(14),{child:n,colors:l}=e,c=U[n.kind],u="siren"===n.kind?l.danger:l.warning;let f,h,p;return o[0]!==c||o[1]!==n.hasSwitch||o[2]!==n.on||o[3]!==l.foregroundMuted||o[4]!==u?(f=n.hasSwitch?(0,H.jsx)(c,{size:14,color:n.on?u:l.foregroundMuted}):null,o[0]=c,o[1]=n.hasSwitch,o[2]=n.on,o[3]=l.foregroundMuted,o[4]=u,o[5]=f):f=o[5],o[6]!==n.hasMotion||o[7]!==n.motionOn||o[8]!==l.foregroundMuted||o[9]!==l.primary?(h=n.hasMotion?(0,H.jsx)(b.Activity,{size:14,color:n.motionOn?l.primary:l.foregroundMuted}):null,o[6]=n.hasMotion,o[7]=n.motionOn,o[8]=l.foregroundMuted,o[9]=l.primary,o[10]=h):h=o[10],o[11]!==f||o[12]!==h?(p=(0,H.jsxs)(s.default,{style:F.row,children:[f,h]}),o[11]=f,o[12]=h,o[13]=p):p=o[13],p}const F=u.default.create({row:{flexDirection:'row',alignItems:'center',gap:y.SPACING.xs},text:{fontSize:11,fontWeight:'600'}});function $(e){return u.default.create({card:{backgroundColor:e.surface,borderColor:e.border,borderWidth:1,borderRadius:y.RADIUS.lg,overflow:'hidden'},cardPressed:{backgroundColor:e.surfaceHover},media:{width:'100%',aspectRatio:1.7777777777777777,backgroundColor:e.backgroundElevated,alignItems:'center',justifyContent:'center'},overlay:{alignItems:'center',justifyContent:'center',gap:y.SPACING.xs},refreshChip:{position:'absolute',top:y.SPACING.sm,right:y.SPACING.sm,width:24,height:24,borderRadius:12,backgroundColor:'rgba(0,0,0,0.35)',alignItems:'center',justifyContent:'center'},refreshSpinner:{transform:[{scale:.65}]},topLeft:{position:'absolute',top:y.SPACING.sm,left:y.SPACING.sm,flexDirection:'row',alignItems:'center',gap:4},heartChip:{width:24,height:24,borderRadius:12,backgroundColor:'rgba(0,0,0,0.35)',alignItems:'center',justifyContent:'center'},staleChip:{flexDirection:'row',alignItems:'center',gap:3,paddingHorizontal:6,paddingVertical:2,borderRadius:8,backgroundColor:'rgba(0,0,0,0.45)'},staleChipText:{color:'#fff',fontSize:10,fontWeight:'500'},overlaySubtleText:{color:e.foregroundSubtle,fontSize:12},footer:{flexDirection:'row',alignItems:'center',gap:y.SPACING.sm,paddingVertical:y.SPACING.md,paddingHorizontal:y.SPACING.lg},dot:{width:8,alignItems:'center'},name:{flex:1,color:e.foreground,fontSize:15,fontWeight:'600'},hints:{flexDirection:'row',alignItems:'center',gap:y.SPACING.md},controlsBtn:{width:28,height:28,borderRadius:y.RADIUS.md,alignItems:'center',justifyContent:'center'}})}},798,[787,16,114,193,247,32,232,816,836,819,789,834,826,828,837,838,839,832,840,841,842,843,844,845,846,830,790,847,848,849,850,851,799,10]);
|
|
5
|
-
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"ChildrenStatesAbortedError",{enumerable:!0,get:function(){return l}}),_e.resolveChildrenStates=h,_e.useCameraChildrenStates=function(c,u){const l=(0,e.c)(9),{controller:f,state:y}=(0,n.useConnection)();let w;l[0]!==c?(w=["v2","children-states",c],l[0]=c,l[1]=w):w=l[1];const C=u&&"connected"===y;let b,p;l[2]!==c||l[3]!==f?(b=async e=>{const{signal:t}=e,n=f.getSystem();return n?h(n.trpcClient,c,t):o},l[2]=c,l[3]=f,l[4]=b):b=l[4];l[5]!==w||l[6]!==C||l[7]!==b?(p={queryKey:w,enabled:C,staleTime:s.RECONCILE_MS,refetchInterval:s.RECONCILE_MS,queryFn:b},l[5]=w,l[6]=C,l[7]=b,l[8]=p):p=l[8];return(0,t.useQuery)(p)};var e=r(d[0]),t=r(d[1]),n=r(d[2]),s=r(d[3]);const o=[];function c(e){return'light'===e?'light':'siren'===e?'siren':'switch'===e?'switch':'other'}function u(e){return'object'==typeof e&&null!==e}class l extends Error{constructor(){super('children-states query aborted'),this.name='ChildrenStatesAbortedError'}}function f(e){if(!0===e?.aborted)throw new l}async function y(e,t,n,s){f(s);const o=e[t];if(!u(o))return null;const c=o.getStatus;if(!u(c)||'function'!=typeof c.query)return null;try{const e=await c.query({deviceId:n},{signal:s});return u(e)?e:null}catch{return f(s),null}}async function h(e,t,n){let s;try{s=await e.deviceManager.getChildren.query({parentDeviceId:t},{signal:n})}catch{return f(n),o}f(n);const l=Array.isArray(s)?s.filter(u):[];return(await Promise.all(l.map(async t=>{const s=t.id;if('number'!=typeof s)return null;const o=t.type,u='string'==typeof t.name?t.name:`#${s}`,l='switch'===o||'light'===o||'siren'===o,f=(Array.isArray(t.features)?t.features:[]).includes('motion-trigger');if(!l&&!f)return null;let h=!1;if(l){const t=await y(e,'switch',s,n);h=!0===t?.on}let w=!1;if(f){const t=await y(e,'motionTrigger',s,n);w=!0===t?.enabled}return{id:s,name:u,kind:c(o),hasSwitch:l,on:h,hasMotion:f,motionOn:w}}))).filter(e=>null!==e)}},799,[787,852,817,853]);
|
|
6
|
-
__d(function(g,r,_i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.CamerasGridSkeleton=function(e){const o=(0,t.c)(10),{numColumns:n,reelCardWidth:s}=e,S=n*f;let j,y,b;o[0]!==s?(j=(0,u.jsx)(c.RecentReelBlock,{cardWidth:s,live:!1}),o[0]=s,o[1]=j):j=o[1];if(o[2]!==S||o[3]!==n){let e;o[5]!==n?(e=(e,t)=>(0,u.jsx)(l.default,{style:{width:100/n+"%",padding:i.SPACING.md/2},children:(0,u.jsx)(h,{})},t),o[5]=n,o[6]=e):e=o[6],y=(0,u.jsx)(l.default,{style:x.gridPad,children:(0,u.jsx)(l.default,{style:x.grid,children:Array.from({length:S},e)})}),o[2]=S,o[3]=n,o[4]=y}else y=o[4];o[7]!==j||o[8]!==y?(b=(0,u.jsxs)(l.default,{children:[j,y]}),o[7]=j,o[8]=y,o[9]=b):b=o[9];return b},_e.CameraCardSkeleton=h;var t=r(d[0]);r(d[1]);var l=e(r(d[2])),o=e(r(d[3])),n=r(d[4]),i=r(d[5]),s=r(d[6]),c=r(d[7]),u=r(d[8]);const f=3;function h(){const e=(0,t.c)(8),{colors:o}=(0,n.useTheme)();let i,c,f,h,S;return e[0]!==o.border||e[1]!==o.surface?(i=[x.card,{backgroundColor:o.surface,borderColor:o.border}],e[0]=o.border,e[1]=o.surface,e[2]=i):i=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(c=(0,u.jsx)(l.default,{style:x.media,children:(0,u.jsx)(s.SkeletonBox,{})}),e[3]=c):c=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(f=(0,u.jsx)(l.default,{style:x.dot,children:(0,u.jsx)(s.SkeletonBox,{style:x.dotShape})}),e[4]=f):f=e[4],e[5]===Symbol.for("react.memo_cache_sentinel")?(h=(0,u.jsxs)(l.default,{style:x.footer,children:[f,(0,u.jsx)(l.default,{style:x.nameLine,children:(0,u.jsx)(s.SkeletonBox,{style:x.lineShape})})]}),e[5]=h):h=e[5],e[6]!==i?(S=(0,u.jsxs)(l.default,{style:i,children:[c,h]}),e[6]=i,e[7]=S):S=e[7],S}const x=o.default.create({gridPad:{padding:i.SPACING.md},grid:{flexDirection:'row',flexWrap:'wrap',margin:-i.SPACING.md/2},card:{borderWidth:1,borderRadius:i.RADIUS.lg,overflow:'hidden'},media:{width:'100%',aspectRatio:1.7777777777777777},footer:{flexDirection:'row',alignItems:'center',gap:i.SPACING.sm,paddingVertical:i.SPACING.md,paddingHorizontal:i.SPACING.lg},dot:{width:8,height:8},dotShape:{borderRadius:4},nameLine:{width:'55%',height:20},lineShape:{borderRadius:7}})},800,[787,16,114,32,789,834,838,801,10]);
|
|
7
|
-
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.RecentReelBlock=function(e){const l=(0,t.c)(19),{cardWidth:s,live:S,onSeek:h}=e,{t:D}=(0,c.useTranslation)(),{colors:O}=(0,u.useTheme)(),k=(0,E.reelFilterCondition)((0,E.useReelFilterStore)(I));let L;l[0]!==D?(L=D("v2.tracks.recent","Recent"),l[0]=D,l[1]=L):L=l[1];const C=L,N="all"===k.kind?C:`${C} \xb7 ${"default"===k.kind?D("v2.cameras.reelFilterDefaultTag","Detections"):D("v2.cameras.reelFilterCountTag","{{count}} types",{count:k.count})}`;let P,v,B,b,A,x;l[2]!==s?(P=(0,f.reelBlockHeight)(s),l[2]=s,l[3]=P):P=l[3];l[4]!==P?(v=[R.block,{height:P}],l[4]=P,l[5]=v):v=l[5];l[6]!==O.foregroundSubtle?(B=[R.caption,{color:O.foregroundSubtle}],l[6]=O.foregroundSubtle,l[7]=B):B=l[7];l[8]!==N||l[9]!==B?(b=(0,p.jsx)(o.default,{testID:f.REEL_CAPTION_TEST_ID,numberOfLines:1,style:B,children:N}),l[8]=N,l[9]=B,l[10]=b):b=l[10];l[11]!==s||l[12]!==S||l[13]!==h?(A=S?(0,p.jsx)(T.TrackReel,{cardWidth:s,onSeek:h}):(0,p.jsx)(_.ReelStripSkeleton,{cardWidth:s}),l[11]=s,l[12]=S,l[13]=h,l[14]=A):A=l[14];l[15]!==v||l[16]!==b||l[17]!==A?(x=(0,p.jsxs)(n.default,{testID:f.RECENT_REEL_TEST_ID,style:v,children:[b,A]}),l[15]=v,l[16]=b,l[17]=A,l[18]=x):x=l[18];return x};var t=r(d[0]);r(d[1]);var n=e(r(d[2])),o=e(r(d[3])),l=e(r(d[4])),c=r(d[5]),u=r(d[6]),s=r(d[7]),_=r(d[8]),T=r(d[9]),f=r(d[10]),E=r(d[11]),p=r(d[12]);function I(e){return e.filter}const R=l.default.create({block:{paddingTop:f.REEL_BLOCK_PADDING_TOP,paddingBottom:f.REEL_BLOCK_PADDING_BOTTOM,overflow:'hidden'},caption:{fontSize:11,fontWeight:'700',textTransform:'uppercase',letterSpacing:.4,lineHeight:f.REEL_CAPTION_LINE_HEIGHT,paddingHorizontal:s.SPACING.xl,paddingBottom:f.REEL_CAPTION_PADDING_BOTTOM}})},801,[787,16,114,193,32,816,789,834,802,804,803,824,10]);
|
|
8
|
-
__d(function(g,r,_i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.ReelStripSkeleton=function(e){const l=(0,t.c)(10),{cardWidth:i}=e,{colors:w}=(0,n.useTheme)();let S,x,_,j;l[0]!==i?(S=(0,s.reelRowHeight)(i),l[0]=i,l[1]=S):S=l[1];l[2]!==S?(x=[f.row,{height:S}],l[2]=S,l[3]=x):x=l[3];l[4]!==i||l[5]!==w?(_=Array.from({length:h},(e,t)=>(0,u.jsx)(o.default,{style:[f.card,{width:i,backgroundColor:w.surface}],children:(0,u.jsx)(o.default,{style:{width:i,height:i},children:(0,u.jsx)(c.SkeletonBox,{})})},t)),l[4]=i,l[5]=w,l[6]=_):_=l[6];l[7]!==x||l[8]!==_?(j=(0,u.jsx)(o.default,{style:x,children:_}),l[7]=x,l[8]=_,l[9]=j):j=l[9];return j};var t=r(d[0]);r(d[1]);var o=e(r(d[2])),l=e(r(d[3])),n=r(d[4]),i=r(d[5]),c=r(d[6]),s=r(d[7]),u=r(d[8]);const h=8;const f=l.default.create({row:{flexDirection:'row',gap:i.SPACING.sm,paddingHorizontal:i.SPACING.md,paddingVertical:i.SPACING.sm,overflow:'hidden'},card:{flexShrink:0,borderRadius:i.RADIUS.md,overflow:'hidden'}})},802,[787,16,114,32,789,834,838,803,10]);
|
|
9
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.reelRowHeight=n,Object.defineProperty(e,"REEL_BLOCK_PADDING_TOP",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"REEL_CAPTION_LINE_HEIGHT",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"REEL_CAPTION_PADDING_BOTTOM",{enumerable:!0,get:function(){return _}}),Object.defineProperty(e,"REEL_BLOCK_PADDING_BOTTOM",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"RECENT_REEL_TEST_ID",{enumerable:!0,get:function(){return E}}),Object.defineProperty(e,"REEL_FILTER_DOT_TEST_ID",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"REEL_CAPTION_TEST_ID",{enumerable:!0,get:function(){return O}}),e.reelBlockHeight=function(t){return u+c+_+n(t)+o};var t=r(d[0]);function n(n){return n+2*t.SPACING.sm}const u=t.SPACING.md,c=14,_=t.SPACING.xs,o=t.SPACING.sm,E='cameras-recent-reel',f='cameras-reel-filter-dot',O='cameras-recent-reel-caption'},803,[834]);
|
|
10
|
-
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.TrackReel=function(e){const l=(0,t.c)(109),{deviceId:I,cardWidth:P,onSeek:F}=e,q=void 0===P?80:P,{t:B}=(0,f.useTranslation)(),{colors:J}=(0,k.useTheme)(),Q=(0,j.useDateLocale)(),{settings:X}=(0,b.useSettings)(),{serverUrl:Y,bearer:Z}=(0,x.useThumbAuth)(),$=(0,p.useEventKindLabels)();let ee;l[0]!==$?(ee=(0,C.buildKindLabels)($),l[0]=$,l[1]=ee):ee=l[1];const te=ee,[se]=(0,s.useState)(O);let re;l[2]===Symbol.for("react.memo_cache_sentinel")?(re={includeHidden:!0},l[2]=re):re=l[2];const{data:oe}=(0,v.useCameras)(re);let ne;l[3]!==oe||l[4]!==I?(ne=void 0!==I?[I]:(oe??[]).map(D),l[3]=oe,l[4]=I,l[5]=ne):ne=l[5];const le=ne;let ae;l[6]!==oe?(ae=e=>oe?.find(t=>t.id===e)?.name??"",l[6]=oe,l[7]=ae):ae=l[7];const ie=ae,de=(0,T.useReelFilterStore)(z),ce=(0,T.useReelFilterStore)(H);let ue,he;l[8]!==ce?(ue=()=>{ce()},he=[ce],l[8]=ce,l[9]=ue,l[10]=he):(ue=l[9],he=l[10]);(0,s.useEffect)(ue,he);const fe=(0,y.useEventKinds)(le);let me;l[11]!==fe.data||l[12]!==de?(me=(0,T.resolveReelClasses)(de,fe.data),l[11]=fe.data,l[12]=de,l[13]=me):me=l[13];const be=me;let ge;l[14]!==fe.data||l[15]!==de?(ge=(0,T.resolveReelExcludeSources)(de,fe.data),l[14]=fe.data,l[15]=de,l[16]=ge):ge=l[16];const ve=ge;let ye,pe,we;l[17]!==I?(ye=void 0!==I?[I]:[],l[17]=I,l[18]=ye):ye=l[18];l[19]===Symbol.for("react.memo_cache_sentinel")?(pe=[],l[19]=pe):pe=l[19];l[20]!==be||l[21]!==ve||l[22]!==se||l[23]!==ye?(we={view:"reel",deviceIds:ye,classes:be,attrs:pe,search:"",searchMode:"text",sort:"time",excludeSources:ve,anchorMs:se,maxAgeMs:U},l[20]=be,l[21]=ve,l[22]=se,l[23]=ye,l[24]=we):we=l[24];const xe=(0,w.useEventsGalleryFeed)(we),{selected:Se,intent:Me,open:je,select:ke,close:Ie}=(0,S.useOpenTrack)();let Te;l[25]!==ie||l[26]!==xe.rows||l[27]!==ke||l[28]!==Se?(Te={tracks:xe.rows,selected:Se,cameraNameFor:ie,onSelect:ke},l[25]=ie,l[26]=xe.rows,l[27]=ke,l[28]=Se,l[29]=Te):Te=l[29];const Le=(0,M.useTrackListNavigation)(Te);let Ce;l[30]!==Ie||l[31]!==F||l[32]!==Se?(Ce=e=>{Se&&F&&F(Se,e),Ie()},l[30]=Ie,l[31]=F,l[32]=Se,l[33]=Ce):Ce=l[33];const Re=Ce;let Ee;l[34]!==xe.iconIds||l[35]!==te||l[36]!==Q||l[37]!==se||l[38]!==X.events.reelLabelMode?(Ee={labelMode:X.events.reelLabelMode,showAdminFlags:!1,kindLabels:te,iconIds:xe.iconIds,locale:Q,nowMs:se},l[34]=xe.iconIds,l[35]=te,l[36]=Q,l[37]=se,l[38]=X.events.reelLabelMode,l[39]=Ee):Ee=l[39];const Pe=Ee;let Ae;l[40]!==q?(Ae=(0,A.thumbPxForEdge)(q,o.default.get()),l[40]=q,l[41]=Ae):Ae=l[41];const Fe=Ae;let Ne;l[42]!==Z||l[43]!==q||l[44]!==Pe||l[45]!==je||l[46]!==Y||l[47]!==Fe?(Ne=e=>{const{item:t}=e;return(0,N.jsx)(K,{row:t,edge:q,imageUri:null===Y?null:(0,L.buildTrackThumbUrl)(Y,t.trackId,Fe),bearer:Z,chipOptions:Pe,onPress:je})},l[42]=Z,l[43]=q,l[44]=Pe,l[45]=je,l[46]=Y,l[47]=Fe,l[48]=Ne):Ne=l[48];const Ue=Ne,{loadMore:Ge}=xe;let He;l[49]!==xe.tail||l[50]!==Ge?(He=()=>{"more"===xe.tail&&Ge()},l[49]=xe.tail,l[50]=Ge,l[51]=He):He=l[51];const ze=He;let De;l[52]!==q?(De=(0,E.reelRowHeight)(q),l[52]=q,l[53]=De):De=l[53];const Oe=De;let Ke,We;if(xe.loading&&0===xe.rows.length){let e;l[54]!==q?(e=(0,N.jsx)(R.ReelStripSkeleton,{cardWidth:q}),l[54]=q,l[55]=e):e=l[55],Ke=e}else if(null!==xe.error&&0===xe.rows.length){let e,t,s,o;l[56]!==Oe?(e=[V.band,{height:Oe}],l[56]=Oe,l[57]=e):e=l[57],l[58]!==J.foregroundMuted?(t=[V.bandText,{color:J.foregroundMuted}],l[58]=J.foregroundMuted,l[59]=t):t=l[59],l[60]!==B?(s=B("v2.events.loadError"),l[60]=B,l[61]=s):s=l[61],l[62]!==t||l[63]!==s?(o=(0,N.jsx)(c.default,{style:t,children:s}),l[62]=t,l[63]=s,l[64]=o):o=l[64];const h=xe.retry;let f,b,v,y,p;l[65]!==J.primary?(f=[V.bandText,{color:J.primary}],l[65]=J.primary,l[66]=f):f=l[66],l[67]!==B?(b=B("v2.events.retry"),l[67]=B,l[68]=b):b=l[68],l[69]!==f||l[70]!==b?(v=(0,N.jsx)(c.default,{style:f,children:b}),l[69]=f,l[70]=b,l[71]=v):v=l[71],l[72]!==xe.retry||l[73]!==v?(y=(0,N.jsx)(n.default,{onPress:h,accessibilityRole:"button",hitSlop:8,children:v}),l[72]=xe.retry,l[73]=v,l[74]=y):y=l[74],l[75]!==e||l[76]!==o||l[77]!==y?(p=(0,N.jsxs)(u.default,{style:e,children:[o,y]}),l[75]=e,l[76]=o,l[77]=y,l[78]=p):p=l[78],Ke=p}else if(0===xe.rows.length){let e,t,s,o,n;l[79]!==Oe?(e=[V.band,{height:Oe}],l[79]=Oe,l[80]=e):e=l[80],l[81]!==J.foregroundMuted?(t=[V.bandText,{color:J.foregroundMuted}],l[81]=J.foregroundMuted,l[82]=t):t=l[82],l[83]!==B?(s=B("v2.events.empty"),l[83]=B,l[84]=s):s=l[84],l[85]!==t||l[86]!==s?(o=(0,N.jsx)(c.default,{style:t,children:s}),l[85]=t,l[86]=s,l[87]=o):o=l[87],l[88]!==e||l[89]!==o?(n=(0,N.jsx)(u.default,{style:e,children:o}),l[88]=e,l[89]=o,l[90]=n):n=l[90],Ke=n}else{let e;l[91]!==xe.rows||l[92]!==ze||l[93]!==Ue?(e=(0,N.jsx)(h.FlashList,{horizontal:!0,data:xe.rows,renderItem:Ue,keyExtractor:G,onEndReached:ze,onEndReachedThreshold:1.5,showsHorizontalScrollIndicator:!1,contentContainerStyle:V.list,ItemSeparatorComponent:W}),l[91]=xe.rows,l[92]=ze,l[93]=Ue,l[94]=e):e=l[94],Ke=e}l[95]!==Oe?(We=[V.strip,{height:Oe}],l[95]=Oe,l[96]=We):We=l[96];const Ve=F?Re:void 0;let qe,Be,Je;l[97]!==Le?(qe=void 0!==Le?{navigation:Le}:{},l[97]=Le,l[98]=qe):qe=l[98];l[99]!==Ie||l[100]!==Me||l[101]!==Se||l[102]!==Ve||l[103]!==qe?(Be=(0,N.jsx)(_.TrackDetailModal,{track:Se,onSeek:Ve,onClose:Ie,openIntent:Me,...qe}),l[99]=Ie,l[100]=Me,l[101]=Se,l[102]=Ve,l[103]=qe,l[104]=Be):Be=l[104];l[105]!==Ke||l[106]!==We||l[107]!==Be?(Je=(0,N.jsxs)(u.default,{style:We,children:[Ke,Be]}),l[105]=Ke,l[106]=We,l[107]=Be,l[108]=Je):Je=l[108];return Je};var t=r(d[0]),s=r(d[1]),o=e(r(d[2])),n=e(r(d[3])),l=e(r(d[4])),c=e(r(d[5])),u=e(r(d[6])),h=r(d[7]),f=r(d[8]),b=r(d[9]),v=r(d[10]),y=r(d[11]),p=r(d[12]),w=r(d[13]),x=r(d[14]),S=r(d[15]),M=r(d[16]),j=r(d[17]),k=r(d[18]),I=r(d[19]),T=r(d[20]),L=r(d[21]),C=r(d[22]),R=r(d[23]),_=r(d[24]),E=r(d[25]),P=r(d[26]),A=r(d[27]),F=r(d[28]),N=r(d[29]);const U=864e5;function G(e){return e.trackId}function H(e){return e.hydrate}function z(e){return e.filter}function D(e){return e.id}function O(){return Date.now()}const K=(0,s.memo)(function(e){const s=(0,t.c)(32),{row:o,edge:l,imageUri:c,bearer:h,chipOptions:f,onPress:b}=e,{colors:v}=(0,k.useTheme)();let y;s[0]!==f||s[1]!==o?(y=(0,F.tileChips)(o,f),s[0]=f,s[1]=o,s[2]=y):y=s[2];const p=y,w="off"!==f.labelMode;let x,S,M,j,I,T,L;return s[3]!==v.surface||s[4]!==l?(x=[V.card,{width:l,backgroundColor:v.surface}],s[3]=v.surface,s[4]=l,s[5]=x):x=s[5],s[6]!==b||s[7]!==o?(S=()=>b(o),s[6]=b,s[7]=o,s[8]=S):S=s[8],s[9]!==f.kindLabels||s[10]!==p.time||s[11]!==o?(M=(0,F.tileAccessibilityLabel)(o,f.kindLabels,p.time),s[9]=f.kindLabels,s[10]=p.time,s[11]=o,s[12]=M):M=s[12],s[13]!==h||s[14]!==p||s[15]!==l||s[16]!==c||s[17]!==o?(j=(0,N.jsx)(P.TileHero,{row:o,chips:p,edge:l,imageUri:c,bearer:h,showTime:!0}),s[13]=h,s[14]=p,s[15]=l,s[16]=c,s[17]=o,s[18]=j):j=s[18],s[19]!==S||s[20]!==M||s[21]!==j?(I=(0,N.jsx)(n.default,{onPress:S,accessibilityRole:"button",accessibilityLabel:M,children:j}),s[19]=S,s[20]=M,s[21]=j,s[22]=I):I=s[22],s[23]!==p||s[24]!==l||s[25]!==o||s[26]!==w?(T=(0,N.jsx)(P.TileLabels,{row:o,chips:p,edge:l,showCapsule:w}),s[23]=p,s[24]=l,s[25]=o,s[26]=w,s[27]=T):T=s[27],s[28]!==x||s[29]!==I||s[30]!==T?(L=(0,N.jsxs)(u.default,{style:x,children:[I,T]}),s[28]=x,s[29]=I,s[30]=T,s[31]=L):L=s[31],L});function W(){const e=(0,t.c)(1);let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,N.jsx)(u.default,{style:V.separator}),e[0]=s):s=e[0],s}const V=l.default.create({strip:{overflow:'hidden',width:'100%'},list:{paddingHorizontal:I.SPACING.md,paddingVertical:I.SPACING.sm},separator:{width:I.SPACING.sm},card:{borderRadius:I.RADIUS.md,overflow:'hidden'},band:{alignItems:'center',justifyContent:'center',gap:I.SPACING.md},bandText:{fontSize:13}})},804,[787,16,186,247,32,193,114,854,816,832,826,855,856,857,858,859,860,861,789,834,824,862,863,802,864,803,865,866,867,10]);
|
|
11
|
-
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"CamerasDisplaySheet",{enumerable:!0,get:function(){return B}});var t=r(d[0]),o=r(d[1]),n=e(r(d[2])),l=e(r(d[3])),s=e(r(d[4])),c=e(r(d[5])),u=e(r(d[6])),f=r(d[7]),p=r(d[8]),S=r(d[9]),h=r(d[10]),v=r(d[11]),b=r(d[12]),x=r(d[13]),y=r(d[14]),C=r(d[15]),I=r(d[16]),L=r(d[17]),j=r(d[18]),A=r(d[19]);const B=(0,o.memo)(function(e){const o=(0,t.c)(108),{visible:u,onClose:B}=e,{colors:T}=(0,h.useTheme)(),{t:z}=(0,p.useTranslation)(),M=(0,f.useSafeAreaInsets)(),{settings:R,setEvents:G,setCameraList:N}=(0,I.useSettings)();let k;if(o[0]!==z){const e={small:z("v2.settings.reelSizeSmall"),medium:z("v2.settings.reelSizeMedium"),large:z("v2.settings.reelSizeLarge")};k=j.REEL_THUMB_SIZES.map(t=>({value:t,label:e[t]})),o[0]=z,o[1]=k}else k=o[1];const D=k;let E;o[2]!==z?(E=j.TILE_LABEL_MODES.map(e=>({value:e,label:z("v2.settings.reelLabelMode"+("off"===e?"Off":"icon"===e?"Icon":"Label"))})),o[2]=z,o[3]=E):E=o[3];const _=E;let w,O,H,U,V,F,W,Z,X,q,J,K,Q,Y,$,ee,te,oe,ne,re,le,ie,se,ae,de,ce,ue,ge,fe;o[4]!==T.backgroundElevated?(w=[P.sheet,{backgroundColor:T.backgroundElevated}],o[4]=T.backgroundElevated,o[5]=w):w=o[5],o[6]!==T.foreground?(O=[P.title,{color:T.foreground}],o[6]=T.foreground,o[7]=O):O=o[7],o[8]!==z?(H=z("v2.events.displayTitle"),o[8]=z,o[9]=H):H=o[9],o[10]!==O||o[11]!==H?(U=(0,A.jsx)(l.default,{style:O,children:H}),o[10]=O,o[11]=H,o[12]=U):U=o[12],o[13]!==T.surface?(V=[P.iconBtn,{backgroundColor:T.surface}],o[13]=T.surface,o[14]=V):V=o[14],o[15]!==T.foreground?(F=(0,A.jsx)(S.X,{size:18,color:T.foreground}),o[15]=T.foreground,o[16]=F):F=o[16],o[17]!==B||o[18]!==V||o[19]!==F?(W=(0,A.jsx)(s.default,{onPress:B,hitSlop:10,style:V,children:F}),o[17]=B,o[18]=V,o[19]=F,o[20]=W):W=o[20],o[21]!==U||o[22]!==W?(Z=(0,A.jsxs)(n.default,{style:P.header,children:[U,W]}),o[21]=U,o[22]=W,o[23]=Z):Z=o[23],o[24]!==z?(X=z("v2.settings.listOverlays"),o[24]=z,o[25]=X):X=o[25],o[26]!==z?(q=z("v2.settings.listMotionBorder"),o[26]=z,o[27]=q):q=o[27],o[28]!==z?(J=z("v2.settings.listMotionBorderHint"),o[28]=z,o[29]=J):J=o[29],o[30]!==N?(K=e=>N("motionBorder",e),o[30]=N,o[31]=K):K=o[31],o[32]!==R.cameraList.motionBorder||o[33]!==q||o[34]!==J||o[35]!==K?(Q=(0,A.jsx)(y.ToggleRow,{icon:S.Zap,label:q,description:J,value:R.cameraList.motionBorder,onValueChange:K}),o[32]=R.cameraList.motionBorder,o[33]=q,o[34]=J,o[35]=K,o[36]=Q):Q=o[36],o[37]!==T.foreground?(Y=[P.positionLabel,{color:T.foreground}],o[37]=T.foreground,o[38]=Y):Y=o[38],o[39]!==z?($=z("v2.settings.listOccupancy"),o[39]=z,o[40]=$):$=o[40],o[41]!==Y||o[42]!==$?(ee=(0,A.jsx)(l.default,{style:Y,children:$}),o[41]=Y,o[42]=$,o[43]=ee):ee=o[43],o[44]!==N?(te=e=>N("occupancy",e),o[44]=N,o[45]=te):te=o[45],o[46]!==R.cameraList.occupancy||o[47]!==te?(oe=(0,A.jsx)(L.OverlayPositionPicker,{value:R.cameraList.occupancy,onChange:te,allowOff:!0}),o[46]=R.cameraList.occupancy,o[47]=te,o[48]=oe):oe=o[48],o[49]!==ee||o[50]!==oe?(ne=(0,A.jsxs)(n.default,{style:P.positionRow,children:[ee,oe]}),o[49]=ee,o[50]=oe,o[51]=ne):ne=o[51],o[52]!==X||o[53]!==Q||o[54]!==ne?(re=(0,A.jsxs)(x.Section,{title:X,children:[Q,ne]}),o[52]=X,o[53]=Q,o[54]=ne,o[55]=re):re=o[55],o[56]!==z?(le=z("v2.settings.reel"),o[56]=z,o[57]=le):le=o[57],o[58]!==z?(ie=z("v2.settings.reelThumbSize"),o[58]=z,o[59]=ie):ie=o[59],o[60]!==G?(se=e=>G("reelThumbSize",e),o[60]=G,o[61]=se):se=o[61],o[62]!==D||o[63]!==R.events.reelThumbSize||o[64]!==ie||o[65]!==se?(ae=(0,A.jsx)(C.SegmentBlock,{label:ie,options:D,value:R.events.reelThumbSize,onChange:se}),o[62]=D,o[63]=R.events.reelThumbSize,o[64]=ie,o[65]=se,o[66]=ae):ae=o[66],o[67]!==z?(de=z("v2.settings.reelLabelMode"),o[67]=z,o[68]=de):de=o[68],o[69]!==G?(ce=e=>G("reelLabelMode",e),o[69]=G,o[70]=ce):ce=o[70],o[71]!==_||o[72]!==R.events.reelLabelMode||o[73]!==de||o[74]!==ce?(ue=(0,A.jsx)(C.SegmentBlock,{label:de,options:_,value:R.events.reelLabelMode,onChange:ce}),o[71]=_,o[72]=R.events.reelLabelMode,o[73]=de,o[74]=ce,o[75]=ue):ue=o[75],o[76]!==le||o[77]!==ae||o[78]!==ue?(ge=(0,A.jsxs)(x.Section,{title:le,children:[ae,ue]}),o[76]=le,o[77]=ae,o[78]=ue,o[79]=ge):ge=o[79],o[80]!==re||o[81]!==ge?(fe=(0,A.jsxs)(c.default,{contentContainerStyle:P.scroll,children:[re,ge]}),o[80]=re,o[81]=ge,o[82]=fe):fe=o[82];const me=M.bottom+v.SPACING.md;let pe,Se,he,ve,be,xe,ye,Ce;return o[83]!==me?(pe=[P.footer,{paddingBottom:me}],o[83]=me,o[84]=pe):pe=o[84],o[85]!==T.primary?(Se=[P.footerBtn,{backgroundColor:T.primary}],o[85]=T.primary,o[86]=Se):Se=o[86],o[87]!==T.primaryForeground?(he=[P.footerBtnText,{color:T.primaryForeground}],o[87]=T.primaryForeground,o[88]=he):he=o[88],o[89]!==z?(ve=z("v2.events.done","Done"),o[89]=z,o[90]=ve):ve=o[90],o[91]!==he||o[92]!==ve?(be=(0,A.jsx)(l.default,{style:he,children:ve}),o[91]=he,o[92]=ve,o[93]=be):be=o[93],o[94]!==B||o[95]!==Se||o[96]!==be?(xe=(0,A.jsx)(s.default,{onPress:B,style:Se,children:be}),o[94]=B,o[95]=Se,o[96]=be,o[97]=xe):xe=o[97],o[98]!==pe||o[99]!==xe?(ye=(0,A.jsx)(n.default,{style:pe,children:xe}),o[98]=pe,o[99]=xe,o[100]=ye):ye=o[100],o[101]!==B||o[102]!==Z||o[103]!==w||o[104]!==fe||o[105]!==ye||o[106]!==u?(Ce=(0,A.jsxs)(b.SheetModal,{visible:u,onClose:B,sheetStyle:w,children:[Z,fe,ye]}),o[101]=B,o[102]=Z,o[103]=w,o[104]=fe,o[105]=ye,o[106]=u,o[107]=Ce):Ce=o[107],Ce}),P=u.default.create({sheet:{maxHeight:'85%',borderTopLeftRadius:v.RADIUS.xl,borderTopRightRadius:v.RADIUS.xl,paddingHorizontal:v.SPACING.md,paddingTop:v.SPACING.md},header:{flexDirection:'row',alignItems:'center',justifyContent:'space-between',paddingBottom:v.SPACING.sm},title:{fontSize:18,fontWeight:'700'},iconBtn:{width:32,height:32,borderRadius:v.RADIUS.md,alignItems:'center',justifyContent:'center'},scroll:{gap:v.SPACING.xl,paddingVertical:v.SPACING.sm},positionRow:{flexDirection:'row',alignItems:'center',gap:v.SPACING.md,paddingHorizontal:v.SPACING.xl,paddingVertical:v.SPACING.md},positionLabel:{flexShrink:1,fontSize:15,fontWeight:'500'},footer:{flexDirection:'row',gap:v.SPACING.sm,paddingTop:v.SPACING.sm},footerBtn:{flex:1,alignItems:'center',paddingVertical:v.SPACING.md,borderRadius:v.RADIUS.md},footerBtnText:{fontSize:15,fontWeight:'700'}})},805,[787,16,114,193,247,138,32,273,816,836,789,834,868,869,870,871,832,872,833,10]);
|
|
12
|
-
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"ReelFilterSheet",{enumerable:!0,get:function(){return I}});var t=r(d[0]),o=r(d[1]),n=e(r(d[2])),l=e(r(d[3])),s=e(r(d[4])),u=e(r(d[5])),c=e(r(d[6])),f=r(d[7]),b=r(d[8]),S=r(d[9]),h=r(d[10]),p=r(d[11]),y=r(d[12]),C=r(d[13]),v=r(d[14]),x=r(d[15]),A=r(d[16]),P=r(d[17]);const j=[],I=(0,o.memo)(function(e){const o=(0,t.c)(90),{visible:c,onClose:I}=e,{colors:N}=(0,h.useTheme)(),{t:M}=(0,b.useTranslation)(),_=(0,f.useSafeAreaInsets)(),z=(0,x.useReelFilterStore)(T),H=(0,x.useReelFilterStore)(k),U=(0,x.useReelFilterStore)(w),E=(0,x.useReelFilterStore)(D);let B;o[0]===Symbol.for("react.memo_cache_sentinel")?(B={includeHidden:!0},o[0]=B):B=o[0];const{data:K}=(0,C.useCameras)(B);let L,O;o[1]!==K?(L=K??[],o[1]=K,o[2]=L):L=o[2],o[3]!==L?(O=L.map(G),o[3]=L,o[4]=O):O=o[4];const W=O,V=(0,v.useEventKinds)(W);let X;o[5]!==V.data||o[6]!==z?(X=(0,x.resolveReelClasses)(z,V.data),o[5]=V.data,o[6]=z,o[7]=X):X=o[7];const q=X;let J,Q,Y,Z,$,ee,te,oe,ne,re,le,se;if(o[8]!==N.background||o[9]!==N.foreground||o[10]!==N.foregroundMuted||o[11]!==N.foregroundSubtle||o[12]!==z||o[13]!==_.bottom||o[14]!==I||o[15]!==M||o[16]!==c){Y=(0,x.reelFilterCondition)(z),Q=y.SheetModal,ne=c,re=I;const e=_.bottom+p.SPACING.lg;let t,u,f,b,h,C;o[27]!==N.background||o[28]!==e?(Z=[F.sheet,{backgroundColor:N.background,paddingBottom:e}],o[27]=N.background,o[28]=e,o[29]=Z):Z=o[29],o[30]!==N.foreground?(t=[F.title,{color:N.foreground}],o[30]=N.foreground,o[31]=t):t=o[31],o[32]!==M?(u=M("v2.cameras.reelFilter","Recent events"),o[32]=M,o[33]=u):u=o[33],o[34]!==t||o[35]!==u?(f=(0,P.jsx)(l.default,{style:t,children:u}),o[34]=t,o[35]=u,o[36]=f):f=o[36],o[37]!==M?(b=M("v2.common.close","Close"),o[37]=M,o[38]=b):b=o[38],o[39]!==N.foregroundMuted?(h=(0,P.jsx)(S.X,{size:20,color:N.foregroundMuted}),o[39]=N.foregroundMuted,o[40]=h):h=o[40],o[41]!==I||o[42]!==b||o[43]!==h?(C=(0,P.jsx)(s.default,{onPress:I,accessibilityRole:"button",accessibilityLabel:b,hitSlop:8,children:h}),o[41]=I,o[42]=b,o[43]=h,o[44]=C):C=o[44],o[45]!==f||o[46]!==C?($=(0,P.jsxs)(n.default,{style:F.head,children:[f,C]}),o[45]=f,o[46]=C,o[47]=$):$=o[47],J=l.default,ee="reel-filter-condition",o[48]!==N.foregroundSubtle?(te=[F.condition,{color:N.foregroundSubtle}],o[48]=N.foregroundSubtle,o[49]=te):te=o[49],oe="all"===Y.kind?M("v2.cameras.reelFilterAll","Showing every event"):"default"===Y.kind?M("v2.cameras.reelFilterDefaultHint","Showing detection events only \u2014 audio and sensor events are hidden"):M("v2.cameras.reelFilterCount","{{count}} event types shown",{count:Y.count}),o[8]=N.background,o[9]=N.foreground,o[10]=N.foregroundMuted,o[11]=N.foregroundSubtle,o[12]=z,o[13]=_.bottom,o[14]=I,o[15]=M,o[16]=c,o[17]=J,o[18]=Q,o[19]=Y,o[20]=Z,o[21]=$,o[22]=ee,o[23]=te,o[24]=oe,o[25]=ne,o[26]=re}else J=o[17],Q=o[18],Y=o[19],Z=o[20],$=o[21],ee=o[22],te=o[23],oe=o[24],ne=o[25],re=o[26];o[50]!==J||o[51]!==ee||o[52]!==te||o[53]!==oe?(le=(0,P.jsx)(J,{testID:ee,style:te,children:oe}),o[50]=J,o[51]=ee,o[52]=te,o[53]=oe,o[54]=le):le=o[54],o[55]!==M?(se=M("v2.cameras.reelFilterUseDefault","Default"),o[55]=M,o[56]=se):se=o[56];const ie="default"===Y.kind;let de,ae;o[57]!==N||o[58]!==se||o[59]!==ie||o[60]!==E?(de=(0,P.jsx)(R,{label:se,active:ie,onPress:E,colors:N}),o[57]=N,o[58]=se,o[59]=ie,o[60]=E,o[61]=de):de=o[61],o[62]!==M?(ae=M("v2.cameras.reelFilterShowAll","Everything"),o[62]=M,o[63]=ae):ae=o[63];const ue="all"===Y.kind;let ce,fe,ge,be,Se,me;return o[64]!==N||o[65]!==U||o[66]!==ae||o[67]!==ue?(ce=(0,P.jsx)(R,{label:ae,active:ue,onPress:U,colors:N}),o[64]=N,o[65]=U,o[66]=ae,o[67]=ue,o[68]=ce):ce=o[68],o[69]!==de||o[70]!==ce?(fe=(0,P.jsxs)(n.default,{style:F.presets,children:[de,ce]}),o[69]=de,o[70]=ce,o[71]=fe):fe=o[71],o[72]!==q||o[73]!==H?(ge=e=>{H(e,q)},be=e=>{const t=new Set(e),o=new Set(q);for(const e of t)o.has(e)||H(e,q);for(const e of o)t.has(e)||H(e,q)},o[72]=q,o[73]=H,o[74]=ge,o[75]=be):(ge=o[74],be=o[75]),o[76]!==V.data||o[77]!==q||o[78]!==ge||o[79]!==be?(Se=(0,P.jsx)(u.default,{style:F.body,contentContainerStyle:F.bodyContent,children:(0,P.jsx)(A.EventKindTreeSection,{descriptors:V.data,observedClasses:j,selected:q,onToggleClass:ge,onSetClasses:be})}),o[76]=V.data,o[77]=q,o[78]=ge,o[79]=be,o[80]=Se):Se=o[80],o[81]!==Q||o[82]!==Z||o[83]!==$||o[84]!==le||o[85]!==fe||o[86]!==Se||o[87]!==ne||o[88]!==re?(me=(0,P.jsxs)(Q,{visible:ne,onClose:re,sheetStyle:Z,children:[$,le,fe,Se]}),o[81]=Q,o[82]=Z,o[83]=$,o[84]=le,o[85]=fe,o[86]=Se,o[87]=ne,o[88]=re,o[89]=me):me=o[89],me});function R(e){const o=(0,t.c)(14),{label:n,active:u,onPress:c,colors:f}=e;let b;o[0]!==u?(b={selected:u},o[0]=u,o[1]=b):b=o[1];const S=u?f.primary:f.surface;let h;o[2]!==S?(h=[F.preset,{backgroundColor:S}],o[2]=S,o[3]=h):h=o[3];const p=u?f.primaryForeground:f.foregroundMuted;let y,C,v;return o[4]!==p?(y=[F.presetText,{color:p}],o[4]=p,o[5]=y):y=o[5],o[6]!==n||o[7]!==y?(C=(0,P.jsx)(l.default,{style:y,children:n}),o[6]=n,o[7]=y,o[8]=C):C=o[8],o[9]!==c||o[10]!==b||o[11]!==h||o[12]!==C?(v=(0,P.jsx)(s.default,{onPress:c,accessibilityRole:"button",accessibilityState:b,style:h,children:C}),o[9]=c,o[10]=b,o[11]=h,o[12]=C,o[13]=v):v=o[13],v}const F=c.default.create({sheet:{position:'absolute',left:0,right:0,bottom:0,maxHeight:'80%',borderTopLeftRadius:p.RADIUS.lg,borderTopRightRadius:p.RADIUS.lg,paddingHorizontal:p.SPACING.lg,paddingTop:p.SPACING.lg},head:{flexDirection:'row',alignItems:'center',justifyContent:'space-between'},title:{fontSize:17,fontWeight:'700'},condition:{fontSize:12,marginTop:p.SPACING.xs},presets:{flexDirection:'row',gap:p.SPACING.sm,marginTop:p.SPACING.md},preset:{paddingHorizontal:p.SPACING.md,paddingVertical:p.SPACING.xs,borderRadius:p.RADIUS.xl},presetText:{fontSize:13,fontWeight:'600'},body:{marginTop:p.SPACING.md},bodyContent:{paddingBottom:p.SPACING.lg}});function T(e){return e.filter}function k(e){return e.toggleClass}function w(e){return e.showAll}function D(e){return e.useDefault}function G(e){return e.id}},806,[787,16,114,193,247,138,32,273,816,836,789,834,868,826,855,824,873,10]);
|
|
13
|
-
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"CameraControlsOverlay",{enumerable:!0,get:function(){return D}});var t=r(d[0]),n=r(d[1]),o=e(r(d[2])),l=e(r(d[3]));r(d[4]);var s=e(r(d[5])),c=e(r(d[6])),u=e(r(d[7])),f=r(d[8]),h=r(d[9]),b=r(d[10]),y=r(d[11]),C=r(d[12]),v=r(d[13]),p=r(d[14]),S=r(d[15]),j=r(d[16]),x=r(d[17]),I=r(d[18]),A=r(d[19]),P=r(d[20]),N=r(d[21]);const D=(0,n.memo)(function(e){const n=(0,t.c)(55),{visible:u,camera:D,onClose:k}=e,{t:B}=(0,h.useTranslation)(),{colors:G}=(0,y.useTheme)(),T=(0,f.useSafeAreaInsets)(),z=(0,S.useCanActuate)(),_=u&&null!==D,E=D?.id??-1,{data:L}=(0,A.useDeviceCapNames)(_?E:-1,_);let M;n[0]!==L?(M=void 0===L?[]:L,n[0]=L,n[1]=M):M=n[1];const O=M;if(!_||null===D)return null;let U;n[2]!==D.features||n[3]!==z?(U=z&&D.features.includes(j.FEATURE.ptz),n[2]=D.features,n[3]=z,n[4]=U):U=n[4];const w=U;let F;n[5]!==z||n[6]!==O?(F=z&&O.includes("navigation"),n[5]=z,n[6]=O,n[7]=F):F=n[7];const H=F;let K,V,W,X,q,J,Q,Y,Z;n[8]!==B?(K=B("v2.cameraDetail.close"),n[8]=B,n[9]=K):K=n[9],n[10]!==G.backgroundElevated?(V=[R.sheet,{backgroundColor:G.backgroundElevated}],n[10]=G.backgroundElevated,n[11]=V):V=n[11],n[12]!==G.foreground?(W=[R.title,{color:G.foreground}],n[12]=G.foreground,n[13]=W):W=n[13],n[14]!==D.name||n[15]!==W?(X=(0,N.jsx)(l.default,{style:W,numberOfLines:1,children:D.name}),n[14]=D.name,n[15]=W,n[16]=X):X=n[16],n[17]!==B?(q=B("v2.cameraDetail.close"),n[17]=B,n[18]=q):q=n[18],n[19]!==G.surface?(J=[R.iconBtn,{backgroundColor:G.surface}],n[19]=G.surface,n[20]=J):J=n[20],n[21]!==G.foreground?(Q=(0,N.jsx)(b.X,{size:18,color:G.foreground}),n[21]=G.foreground,n[22]=Q):Q=n[22],n[23]!==k||n[24]!==J||n[25]!==Q||n[26]!==q?(Y=(0,N.jsx)(s.default,{onPress:k,hitSlop:10,accessibilityRole:"button",accessibilityLabel:q,style:J,children:Q}),n[23]=k,n[24]=J,n[25]=Q,n[26]=q,n[27]=Y):Y=n[27],n[28]!==Y||n[29]!==X?(Z=(0,N.jsxs)(o.default,{style:R.header,children:[X,Y]}),n[28]=Y,n[29]=X,n[30]=Z):Z=n[30];const $=T.bottom+C.SPACING.lg;let ee,te,ne,ae,oe,ie;return n[31]!==$?(ee=[R.scroll,{paddingBottom:$}],n[31]=$,n[32]=ee):ee=n[32],n[33]!==D.id||n[34]!==w||n[35]!==B?(te=w?(0,N.jsx)(p.Section,{title:B("v2.cameraDetail.ptz"),children:(0,N.jsx)(o.default,{style:R.sectionBody,children:(0,N.jsx)(x.PtzControls,{deviceId:D.id,hasFeature:w})})}):null,n[33]=D.id,n[34]=w,n[35]=B,n[36]=te):te=n[36],n[37]!==D.id||n[38]!==H||n[39]!==B?(ne=H?(0,N.jsx)(p.Section,{title:B("v2.navigation.title"),children:(0,N.jsx)(o.default,{style:R.sectionBody,children:(0,N.jsx)(I.NavigationControls,{deviceId:D.id,hasCap:H})})}):null,n[37]=D.id,n[38]=H,n[39]=B,n[40]=ne):ne=n[40],n[41]!==D.id||n[42]!==D.name?(ae=(0,N.jsx)(p.Section,{children:(0,N.jsx)(o.default,{style:R.sectionBody,children:(0,N.jsx)(P.CameraAccessoryPanel,{deviceId:D.id,cameraName:D.name})})}),n[41]=D.id,n[42]=D.name,n[43]=ae):ae=n[43],n[44]!==ee||n[45]!==te||n[46]!==ne||n[47]!==ae?(oe=(0,N.jsxs)(c.default,{contentContainerStyle:ee,automaticallyAdjustKeyboardInsets:!1,keyboardShouldPersistTaps:"handled",keyboardDismissMode:"interactive",children:[te,ne,ae]}),n[44]=ee,n[45]=te,n[46]=ne,n[47]=ae,n[48]=oe):oe=n[48],n[49]!==k||n[50]!==Z||n[51]!==oe||n[52]!==K||n[53]!==V?(ie=(0,N.jsxs)(v.SheetModal,{visible:!0,onClose:k,backdropLabel:K,sheetStyle:V,children:[Z,oe]}),n[49]=k,n[50]=Z,n[51]=oe,n[52]=K,n[53]=V,n[54]=ie):ie=n[54],ie}),R=u.default.create({sheet:{maxHeight:'85%',borderTopLeftRadius:C.RADIUS.xl,borderTopRightRadius:C.RADIUS.xl,paddingHorizontal:C.SPACING.md,paddingTop:C.SPACING.md},header:{flexDirection:'row',alignItems:'center',justifyContent:'space-between',gap:C.SPACING.sm,paddingBottom:C.SPACING.sm},title:{flex:1,fontSize:18,fontWeight:'700'},iconBtn:{width:32,height:32,borderRadius:C.RADIUS.md,alignItems:'center',justifyContent:'center'},scroll:{gap:C.SPACING.lg,paddingVertical:C.SPACING.sm},sectionBody:{padding:C.SPACING.md}})},807,[787,16,114,193,109,247,138,32,273,816,836,789,834,868,869,831,826,874,875,876,877,10]);
|
|
14
|
-
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"CameraLocationBar",{enumerable:!0,get:function(){return S}});var o=r(d[0]),n=r(d[1]),t=e(r(d[2])),u=e(r(d[3])),l=e(r(d[4])),c=e(r(d[5])),s=r(d[6]),f=r(d[7]),y=r(d[8]),p=r(d[9]),F=r(d[10]),M=r(d[11]),v=r(d[12]),b=r(d[13]);const S=(0,n.memo)(function(e){const n=(0,o.c)(74),{locations:l,bucket:p,onSelect:S,favouriteCount:z,icons:C,zones:I,motionOrder:x,onToggleMotionOrder:h}=e;let _;n[0]!==I?(_=void 0===I?[]:I,n[0]=I,n[1]=_):_=n[1];const A=_,{t:E}=(0,s.useTranslation)(),{colors:O}=(0,y.useTheme)();let U;n[2]!==O.foregroundMuted||n[3]!==O.primary||n[4]!==O.primaryForeground||n[5]!==O.surface?(U=(e,o,n,u,l)=>(0,b.jsxs)(t.default,{onPress:u,accessibilityRole:"button",accessibilityState:{selected:n},accessibilityLabel:o,style:[T.chip,{backgroundColor:n?O.primary:O.surface}],children:[l,(0,b.jsx)(c.default,{style:[T.chipText,{color:n?O.primaryForeground:O.foregroundMuted}],children:o})]},e),n[2]=O.foregroundMuted,n[3]=O.primary,n[4]=O.primaryForeground,n[5]=O.surface,n[6]=U):U=n[6];const j=U;let B,K,R,P,V,k,w;if(n[7]!==E?(B=E("v2.cameras.locationFilter","Filter by location"),n[7]=E,n[8]=B):B=n[8],n[9]!==p||n[10]!==j||n[11]!==O.foregroundMuted||n[12]!==O.primaryForeground||n[13]!==z||n[14]!==S||n[15]!==E){let e;n[17]!==p||n[18]!==S?(e=()=>{S(p===F.FAVOURITES_BUCKET?null:F.FAVOURITES_BUCKET)},n[17]=p,n[18]=S,n[19]=e):e=n[19];const o=p===F.FAVOURITES_BUCKET?O.primaryForeground:O.foregroundMuted,t=p===F.FAVOURITES_BUCKET?O.primaryForeground:"transparent";let u;n[20]!==o||n[21]!==t?(u=(0,b.jsx)(f.Heart,{size:13,color:o,fill:t}),n[20]=o,n[21]=t,n[22]=u):u=n[22],K=j("favourites",z>0?`${E("v2.cameras.favourites","Favourites")} \xb7 ${String(z)}`:E("v2.cameras.favourites","Favourites"),p===F.FAVOURITES_BUCKET,e,u),n[9]=p,n[10]=j,n[11]=O.foregroundMuted,n[12]=O.primaryForeground,n[13]=z,n[14]=S,n[15]=E,n[16]=K}else K=n[16];if(n[23]!==p||n[24]!==j||n[25]!==S||n[26]!==E){let e;n[28]!==S?(e=()=>{S(null)},n[28]=S,n[29]=e):e=n[29],R=j("all",E("v2.events.all","All"),null===p,e),n[23]=p,n[24]=j,n[25]=S,n[26]=E,n[27]=R}else R=n[27];if(n[30]!==j||n[31]!==O.foregroundMuted||n[32]!==O.primaryForeground||n[33]!==x||n[34]!==h||n[35]!==E){const e=x?O.primaryForeground:O.foregroundMuted;let o;n[37]!==e?(o=(0,b.jsx)(f.Activity,{size:13,color:e}),n[37]=e,n[38]=o):o=n[38],P=j("motion",E("v2.cameras.motionOrder","Motion"),x,h,o),n[30]=j,n[31]=O.foregroundMuted,n[32]=O.primaryForeground,n[33]=x,n[34]=h,n[35]=E,n[36]=P}else P=n[36];if(n[39]!==p||n[40]!==j||n[41]!==O.foregroundMuted||n[42]!==O.primaryForeground||n[43]!==S||n[44]!==A){let e;n[46]!==p||n[47]!==j||n[48]!==O.foregroundMuted||n[49]!==O.primaryForeground||n[50]!==S?(e=e=>{const o=(0,F.zoneBucket)(e.zoneKey),n=p===o;return j(`zone:${e.zoneKey}`,e.label,n,()=>{S(n?null:o)},null===e.icon?void 0:(0,b.jsx)(M.CatalogIcon,{iconKey:e.icon,size:13,color:n?O.primaryForeground:O.foregroundMuted}))},n[46]=p,n[47]=j,n[48]=O.foregroundMuted,n[49]=O.primaryForeground,n[50]=S,n[51]=e):e=n[51],V=A.map(e),n[39]=p,n[40]=j,n[41]=O.foregroundMuted,n[42]=O.primaryForeground,n[43]=S,n[44]=A,n[45]=V}else V=n[45];if(n[52]!==p||n[53]!==j||n[54]!==O.foregroundMuted||n[55]!==O.primaryForeground||n[56]!==C||n[57]!==l||n[58]!==S){let e;n[60]!==p||n[61]!==j||n[62]!==O.foregroundMuted||n[63]!==O.primaryForeground||n[64]!==C||n[65]!==S?(e=e=>{const o=void 0===C?null:(0,v.locationIconFor)(C,e),n=(0,F.locationBucket)(e),t=p===n;return j(e,e,t,()=>{S(t?null:n)},null===o?void 0:(0,b.jsx)(M.CatalogIcon,{iconKey:o,size:13,color:t?O.primaryForeground:O.foregroundMuted}))},n[60]=p,n[61]=j,n[62]=O.foregroundMuted,n[63]=O.primaryForeground,n[64]=C,n[65]=S,n[66]=e):e=n[66],k=l.map(e),n[52]=p,n[53]=j,n[54]=O.foregroundMuted,n[55]=O.primaryForeground,n[56]=C,n[57]=l,n[58]=S,n[59]=k}else k=n[59];return n[67]!==B||n[68]!==K||n[69]!==R||n[70]!==P||n[71]!==V||n[72]!==k?(w=(0,b.jsxs)(u.default,{horizontal:!0,showsHorizontalScrollIndicator:!1,style:T.bar,contentContainerStyle:T.row,accessibilityLabel:B,children:[K,R,P,V,k]}),n[67]=B,n[68]=K,n[69]=R,n[70]=P,n[71]=V,n[72]=k,n[73]=w):w=n[73],w}),T=l.default.create({bar:{flexGrow:0,flexShrink:0},row:{paddingHorizontal:p.SPACING.md,paddingBottom:p.SPACING.sm,gap:p.SPACING.xs,alignItems:'center'},chip:{flexDirection:'row',alignItems:'center',gap:5,paddingHorizontal:12,paddingVertical:6,borderRadius:999},chipText:{fontSize:12,fontWeight:'600'}})},808,[787,16,247,138,32,193,816,836,789,834,809,878,879,10]);
|
|
15
|
-
__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"FAVOURITES_BUCKET",{enumerable:!0,get:function(){return t}}),e.locationBucket=function(t){return`l:${n(t)}`},e.zoneBucket=function(t){return`z:${n(t)}`},e.locationsOf=function(t){const n=new Map;for(const o of t){const t=o.location?.trim();if(void 0===t||0===t.length)continue;const c=t.toLowerCase();n.has(c)||n.set(c,t)}return[...n.values()].sort((t,n)=>t.localeCompare(n,void 0,{sensitivity:'base'}))},e.camerasInBucket=function(o,c,s,u=[]){if(null===c)return o;if(c===t)return o.filter(t=>s.has(t.id));if(c.startsWith('z:')){const t=c.slice(2),s=u.find(o=>n(o.zoneKey)===t);if(void 0===s)return[];const a=new Set(s.locationKeys.map(n));return o.filter(t=>a.has(n(t.location??'')))}const a=c.startsWith('l:')?c.slice(2):n(c);return o.filter(t=>n(t.location??'')===a)};const t='fav';function n(t){return t.trim().toLowerCase()}},809,[]);
|
|
16
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"LOCATION_ICONS_KEY",{enumerable:!0,get:function(){return l}}),e.parseLocationIcons=y,e.useLocationIcons=function(){const o=(0,n.c)(6),{controller:f,state:_}=(0,c.useConnection)();let p;o[0]===Symbol.for("react.memo_cache_sentinel")?(p=["v2",l],o[0]=p):p=o[0];const I="connected"===_;let b,C;o[1]!==f?(b=async()=>{const n=f.getSystem();if(!n)throw new Error("not connected");return y(await(0,s.capQuery)(n.trpcClient,"deviceManager","listLocationIcons",{}))},o[1]=f,o[2]=b):b=o[2];o[3]!==I||o[4]!==b?(C={queryKey:p,enabled:I,staleTime:u.RECONCILE_MS,queryFn:b},o[3]=I,o[4]=b,o[5]=C):C=o[5];return(0,t.useQuery)(C)};var n=r(d[0]),t=r(d[1]),o=r(d[2]),c=r(d[3]),s=r(d[4]),u=r(d[5]);const l='location-icons';function y(n){const t=new Map;if(!Array.isArray(n))return t;for(const c of n){if('object'!=typeof c||null===c)continue;const n=c,s=n.locationKey;if('string'!=typeof s||0===s.length)continue;const u=(0,o.drawableIcon)(n.icon);null!==u&&t.set((0,o.locationIconKey)(s),u)}return t}},810,[787,852,879,817,880,853]);
|
|
17
|
-
__d(function(g,_r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useCoalescedRecency=f,e.useMotionRecency=function(a,R){const S=(0,t.c)(22),{controller:E,state:M}=(0,u.useConnection)(),v=R&&"connected"===M,{applied:w,push:b}=f(R);let O;S[0]!==a?(O=[...a].sort(_).join(","),S[0]=a,S[1]=O):O=S[1];const T=O;let h;S[2]!==T?(h=["v2","motion-recency-seed",T],S[2]=T,S[3]=h):h=S[3];const C=v&&a.length>0;let I,D;S[4]!==E||S[5]!==a?(I=async()=>{const t=E.getSystem();if(!t)return[];return(await Promise.allSettled(a.map(async n=>{const r=await t.trpcClient.motion.getStatus.query({deviceId:n});return{deviceId:n,start:(0,s.motionStartFromStatus)(n,r),detected:l(r)}}))).flatMap(p)},S[4]=E,S[5]=a,S[6]=I):I=S[6];S[7]!==h||S[8]!==C||S[9]!==I?(D={queryKey:h,enabled:C,staleTime:c.RECONCILE_MS,queryFn:I},S[7]=h,S[8]=C,S[9]=I,S[10]=D):D=S[10];const{data:N}=(0,r.useQuery)(D);let j;S[11]===Symbol.for("react.memo_cache_sentinel")?(j=new Map,S[11]=j):j=S[11];const q=(0,n.useRef)(j);let F,A,L,P;S[12]!==R||S[13]!==b||S[14]!==N?(F=()=>{R?void 0!==N&&(q.current=new Map([...(0,s.motionEdgesFromStatuses)(N),...q.current]),b(N.flatMap(y))):q.current=new Map},A=[R,N,b],S[12]=R,S[13]=b,S[14]=N,S[15]=F,S[16]=A):(F=S[15],A=S[16]);(0,n.useEffect)(F,A),S[17]!==E||S[18]!==v||S[19]!==b?(L=()=>{if(!v)return;const t=E.getSystem();return t?t.subscribeEvent(o.MOTION_CATEGORY,t=>{const{edges:n,start:r}=(0,s.motionRisingEdge)(q.current,t,Date.now());q.current=n,null!==r&&b([r])}):void 0},P=[E,v,b],S[17]=E,S[18]=v,S[19]=b,S[20]=L,S[21]=P):(L=S[20],P=S[21]);return(0,n.useEffect)(L,P),w};var t=_r(d[0]),n=_r(d[1]),r=_r(d[2]),u=_r(d[3]),c=_r(d[4]),o=_r(d[5]),s=_r(d[6]);function l(t){return'object'==typeof t&&null!==t&&'detected'in t&&!0===t.detected}const a=new Map;function f(r,u){const c=(0,t.c)(11),o=void 0===u?s.MOTION_REORDER_INTERVAL_MS:u,[l,f]=(0,n.useState)(a),y=(0,n.useRef)(a),p=(0,n.useRef)(null),_=(0,n.useRef)(null);let R;c[0]===Symbol.for("react.memo_cache_sentinel")?(R=()=>{_.current=null,p.current=Date.now(),f(y.current)},c[0]=R):R=c[0];const S=R;let E;c[1]!==o?(E=t=>{if(0===t.length)return;if(y.current=(0,s.mergeMotionRecency)(y.current,t),null!==_.current)return;const n=(0,s.reorderDelay)(Date.now(),p.current,o);0===n?S():_.current=setTimeout(S,n)},c[1]=o,c[2]=E):E=c[2];const M=E,[v,w]=(0,n.useState)(r);let b,O,T,h,C;return r!==v&&(w(r),r||f(a)),c[3]!==r?(b=()=>{r||(null!==_.current&&clearTimeout(_.current),_.current=null,y.current=a,p.current=null)},O=[r],c[3]=r,c[4]=b,c[5]=O):(b=c[4],O=c[5]),(0,n.useEffect)(b,O),c[6]===Symbol.for("react.memo_cache_sentinel")?(T=()=>()=>{null!==_.current&&clearTimeout(_.current)},h=[],c[6]=T,c[7]=h):(T=c[6],h=c[7]),(0,n.useEffect)(T,h),c[8]!==l||c[9]!==M?(C={applied:l,push:M},c[8]=l,c[9]=M,c[10]=C):C=c[10],C}function y(t){return null!==t.start?[t.start]:[]}function p(t){return"fulfilled"===t.status?[t.value]:[]}function _(t,n){return t-n}},811,[787,16,852,817,853,846,812]);
|
|
18
|
-
__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MOTION_REORDER_INTERVAL_MS",{enumerable:!0,get:function(){return n}}),e.parseMotionStart=o,e.motionRisingEdge=function(n,c,u){const s=(0,t.parseMotionEvent)(c);if(null===s)return{edges:n,start:null};const a=!0===n.get(s.deviceId),l=new Map(n);return l.set(s.deviceId,s.detected),!s.detected||a?{edges:l,start:null}:{edges:l,start:o(c,u)}},e.motionEdgesFromStatuses=function(t){return new Map(t.map(t=>[t.deviceId,t.detected]))},e.motionStartFromStatus=function(t,n){if('object'!=typeof n||null===n||!('lastDetectedAt'in n))return null;const o=n.lastDetectedAt;return'number'==typeof o&&Number.isFinite(o)?{deviceId:t,at:o}:null},e.mergeMotionRecency=function(t,n){const o=new Map(t);for(const{deviceId:t,at:c}of n){const n=o.get(t);(void 0===n||c>n)&&o.set(t,c)}return o},e.orderByMotionRecency=function(t,n){const o=[],c=[];t.forEach((t,u)=>{const s=n.get(t.id);void 0===s?c.push(t):o.push({camera:t,at:s,index:u})});return[...[...o].sort((t,n)=>n.at-t.at||t.index-n.index).map(t=>t.camera),...c]},e.reorderDelay=function(t,o,c=n){return null===o?0:Math.max(0,o+c-t)};var t=r(d[0]);const n=5e3;function o(n,o){const c=(0,t.parseMotionEvent)(n);if(null===c||!c.detected)return null;const u=(0,t.motionEventPayload)(n)?.timestamp,s='number'==typeof u&&Number.isFinite(u)?u:o;return{deviceId:c.deviceId,at:s}}},812,[846]);
|
|
19
|
-
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.parseFavourites=c,Object.defineProperty(_e,"useCameraFavouritesStore",{enumerable:!0,get:function(){return o}});var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e},s=r(d[1]);const u='camstack.camera-favourites.v1';function c(e){if(null===e)return new Set;try{const t=JSON.parse(e);return Array.isArray(t)?new Set(t.filter(e=>'number'==typeof e&&Number.isFinite(e))):new Set}catch{return new Set}}const o=(0,s.create)((e,t)=>({ids:new Set,hydrated:!1,hydrate:async()=>{if(t().hydrated)return;const s=await n.default.getItem(u).catch(()=>null);e({ids:c(s),hydrated:!0})},toggle:s=>{const c=new Set(t().ids);var o;c.has(s)?c.delete(s):c.add(s),e({ids:c}),o=c,n.default.setItem(u,JSON.stringify([...o])).catch(()=>{})}}))},813,[881,882]);
|
|
20
|
-
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.CamerasFab=function(e){const I=(0,t.c)(59),{open:F,onToggle:P,onClose:j,onAppearance:v,onEditList:A,reelCondition:k,onReelFilter:L}=e,{t:R}=(0,c.useTranslation)(),{colors:G}=(0,f.useTheme)(),N=(0,p.useBottomNavInset)(),D="all"!==k.kind;let _;I[0]!==k.count||I[1]!==k.kind||I[2]!==R?(_="all"===k.kind?R("v2.events.all","All"):"default"===k.kind?R("v2.cameras.reelFilterDefaultTag","Detections"):R("v2.cameras.reelFilterCountTag","{{count}} types",{count:k.count}),I[0]=k.count,I[1]=k.kind,I[2]=R,I[3]=_):_=I[3];const T=_;let E,w,z;I[4]!==R?(E=R("v2.cameras.appearance"),I[4]=R,I[5]=E):E=I[5];I[6]!==v||I[7]!==E?(w={key:"appearance",icon:u.SlidersHorizontal,label:E,onPress:v},I[6]=v,I[7]=E,I[8]=w):w=I[8];I[9]!==R?(z=R("v2.cameras.reelFilter","Recent events"),I[9]=R,I[10]=z):z=I[10];const O=`${z} \xb7 ${T}`;let H,M,V,$;I[11]!==L||I[12]!==O?(H={key:"reel",icon:u.ListFilter,label:O,onPress:L},I[11]=L,I[12]=O,I[13]=H):H=I[13];I[14]!==R?(M=R("v2.cameras.editList"),I[14]=R,I[15]=M):M=I[15];I[16]!==A||I[17]!==M?(V={key:"edit",icon:u.ListOrdered,label:M,onPress:A},I[16]=A,I[17]=M,I[18]=V):V=I[18];I[19]!==w||I[20]!==H||I[21]!==V?($=[w,H,V],I[19]=w,I[20]=H,I[21]=V,I[22]=$):$=I[22];const B=$,U=b.SPACING.lg+N;let W,X,q,J,K,Q,Y,Z,ee,te;I[23]!==j||I[24]!==F?(W=F?(0,x.jsx)(l.default,{style:s.default.absoluteFill,onPress:j,accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants"}):null,I[23]=j,I[24]=F,I[25]=W):W=I[25];I[26]!==G.foreground||I[27]!==G.surface||I[28]!==U||I[29]!==B||I[30]!==F?(X=F?(0,x.jsx)(n.default,{style:[C.menuAnchor,{right:b.SPACING.lg,bottom:U+S+b.SPACING.sm}],pointerEvents:"box-none",children:(0,x.jsx)(y.GlassSurface,{variant:"bar",radius:b.RADIUS.xl,contentStyle:C.menuSurface,children:B.map(e=>{const{key:t,icon:s,label:c,onPress:u}=e;return(0,x.jsxs)(l.default,{accessibilityRole:"button",accessibilityLabel:c,onPress:u,style:C.menuRow,children:[(0,x.jsx)(o.default,{numberOfLines:1,style:[C.menuLabel,{color:G.foreground}],children:c}),(0,x.jsx)(n.default,{style:[C.iconSlot,{backgroundColor:G.surface}],children:(0,x.jsx)(s,{size:18,color:G.foreground})})]},t)})})}):null,I[26]=G.foreground,I[27]=G.surface,I[28]=U,I[29]=B,I[30]=F,I[31]=X):X=I[31];I[32]!==R?(q=R("v2.cameras.listOptions"),I[32]=R,I[33]=q):q=I[33];I[34]!==F?(J={expanded:F},I[34]=F,I[35]=J):J=I[35];I[36]!==G.primary||I[37]!==U?(K=[C.fab,{backgroundColor:G.primary,right:b.SPACING.lg,bottom:U}],I[36]=G.primary,I[37]=U,I[38]=K):K=I[38];I[39]!==G.primaryForeground||I[40]!==F?(Q=F?(0,x.jsx)(u.X,{size:24,color:G.primaryForeground}):(0,x.jsx)(u.Settings2,{size:24,color:G.primaryForeground}),I[39]=G.primaryForeground,I[40]=F,I[41]=Q):Q=I[41];I[42]!==G.primaryForeground||I[43]!==F||I[44]!==D?(Y=!F&&D?(0,x.jsx)(n.default,{testID:h.REEL_FILTER_DOT_TEST_ID,style:[C.fabDot,{backgroundColor:G.primaryForeground}]}):null,I[42]=G.primaryForeground,I[43]=F,I[44]=D,I[45]=Y):Y=I[45];I[46]!==P||I[47]!==q||I[48]!==J||I[49]!==K||I[50]!==Q||I[51]!==Y?(Z=(0,x.jsxs)(l.default,{onPress:P,accessibilityRole:"button",accessibilityLabel:q,accessibilityState:J,style:K,children:[Q,Y]}),I[46]=P,I[47]=q,I[48]=J,I[49]=K,I[50]=Q,I[51]=Y,I[52]=Z):Z=I[52];I[53]!==X||I[54]!==Z?(ee=(0,x.jsxs)(n.default,{style:s.default.absoluteFill,pointerEvents:"box-none",children:[X,Z]}),I[53]=X,I[54]=Z,I[55]=ee):ee=I[55];I[56]!==W||I[57]!==ee?(te=(0,x.jsxs)(x.Fragment,{children:[W,ee]}),I[56]=W,I[57]=ee,I[58]=te):te=I[58];return te};var t=r(d[0]);r(d[1]);var n=e(r(d[2])),o=e(r(d[3])),l=e(r(d[4])),s=e(r(d[5])),c=r(d[6]),u=r(d[7]),f=r(d[8]),b=r(d[9]),p=r(d[10]),y=r(d[11]),h=r(d[12]),x=r(d[13]);const S=56,C=s.default.create({fab:{position:'absolute',width:S,height:S,borderRadius:28,alignItems:'center',justifyContent:'center',elevation:6},menuAnchor:{position:'absolute',alignItems:'flex-end'},fabDot:{position:'absolute',top:12,right:12,width:8,height:8,borderRadius:4},menuSurface:{flexDirection:'column',alignItems:'stretch',paddingVertical:b.SPACING.sm,paddingHorizontal:b.SPACING.sm,gap:b.SPACING.xs},menuRow:{flexDirection:'row',alignItems:'center',justifyContent:'flex-end',gap:b.SPACING.md,paddingVertical:b.SPACING.xs,paddingLeft:b.SPACING.md,minHeight:36},menuLabel:{fontSize:13,fontWeight:'600',flexShrink:1,textAlign:'right'},iconSlot:{width:36,height:36,borderRadius:18,alignItems:'center',justifyContent:'center',flexShrink:0}})},814,[787,16,114,193,247,32,816,836,789,834,794,883,803,10]);
|
|
21
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"CAMERAS_LIST_TEST_ID",{enumerable:!0,get:function(){return t}});const t='cameras-list'},815,[]);
|