react-semaphor 0.1.537 → 0.1.538

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.
Files changed (173) hide show
  1. package/dist/analytics-protocol/index.js +352 -341
  2. package/dist/assistant-context/index.js +10 -0
  3. package/dist/assistant-protocol/index.js +104 -0
  4. package/dist/brand-studio/index.js +35 -31
  5. package/dist/briefings/index.js +46 -45
  6. package/dist/chunks/_commonjsHelpers-BkfeUUK-.js +28 -0
  7. package/dist/chunks/add-to-dashboard-CxtTfISD.js +56 -0
  8. package/dist/chunks/aggregate-table-row-presentation-Qgpv6_G8.js +979 -0
  9. package/dist/chunks/analytics-base-schemas-BFAoRlkU.js +472 -0
  10. package/dist/chunks/apply-dashboard-operations-C-iahGka.js +402 -0
  11. package/dist/chunks/assistant-chat-BAqUIFp5.js +7966 -0
  12. package/dist/chunks/availability-Bp5Gfu1I.js +44 -0
  13. package/dist/chunks/{bookmark-state-B-I9BDD0.js → bookmark-state-k7y5SNGf.js} +9 -9
  14. package/dist/chunks/{braces-8TRlDwDw.js → braces-o9UiRQes.js} +1 -1
  15. package/dist/chunks/calculated-field-identity-DcBS2NPP.js +2161 -0
  16. package/dist/chunks/calendar-day-equality-Bpl15IBo.js +487 -0
  17. package/dist/chunks/class-utils-Df1OVOT1.js +2315 -0
  18. package/dist/chunks/{field-dependencies-CpRUwr9J.js → common-types-CUf03Htv.js} +65 -58
  19. package/dist/chunks/context-HD9usB1P.js +349 -0
  20. package/dist/chunks/conversation-sQiWYUOb.js +16 -0
  21. package/dist/chunks/csv-utils-GUfKyT1J.js +56 -0
  22. package/dist/chunks/custom-visual-inputs-BrUOIwln.js +3288 -0
  23. package/dist/chunks/{dashboard-BPJo-Fnd.js → dashboard-DTDDFQsS.js} +1 -1
  24. package/dist/chunks/{dashboard-briefing-launcher-A2uVpHCp.js → dashboard-briefing-launcher-Bb2QUqOa.js} +764 -740
  25. package/dist/chunks/{dashboard-controls-DxTuVis_.js → dashboard-controls-FpONU8QV.js} +683 -686
  26. package/dist/chunks/{common-types-g7yS12Cg.js → dashboard-filter-value-compatibility-D95O4nd7.js} +18 -24
  27. package/dist/chunks/dashboard-json-DazPhBU_.js +69 -0
  28. package/dist/chunks/document-dashboard-inputs-D96rlU7S.js +10678 -0
  29. package/dist/chunks/document-sheet-utils-C1eEldxs.js +1076 -0
  30. package/dist/chunks/{edit-dashboard-visual-ByV0OwSp.js → edit-dashboard-visual-CIhZodVH.js} +4744 -4746
  31. package/dist/chunks/editor-draft-sync-BN5qYHPF.js +15 -0
  32. package/dist/chunks/filter-value-text-BhWugPWE.js +163 -0
  33. package/dist/chunks/index-CqMiAkay.js +3164 -0
  34. package/dist/chunks/index-CuHybtft.js +51 -0
  35. package/dist/chunks/layout-grid-Bgzth8vd.js +16 -0
  36. package/dist/chunks/{matrix-analytical-definition-CgBTD6H8.js → matrix-analytical-definition-bcprSe4u.js} +1 -1
  37. package/dist/chunks/{matrix-card-CAdizkUl.js → matrix-card-CJn1hB5V.js} +13 -12
  38. package/dist/chunks/matrix-definition-DQDI2okF.js +206 -0
  39. package/dist/chunks/{matrix-formatter-DJCk8Znf.js → matrix-formatter-Bgw32tb3.js} +648 -457
  40. package/dist/chunks/matrix-member-presentation-BNPSDKBG.js +105 -0
  41. package/dist/chunks/{matrix-operation-contract-BKupLHXL.js → matrix-operation-contract-B8PBF1Gd.js} +134 -133
  42. package/dist/chunks/{metric-comparison-BKHyvnAy.js → metric-comparison-CojWeLqx.js} +1 -1
  43. package/dist/chunks/{palette-Cp1hqZtm.js → palette-D10o_yYX.js} +1 -1
  44. package/dist/chunks/pivot-header-presentation-MkcKnjn3.js +42 -0
  45. package/dist/chunks/{pivot-result-identity-Bs4tLtLo.js → pivot-result-identity-D6hhcRXi.js} +1 -1
  46. package/dist/chunks/pivot-result-lifecycle-8qCDmpKc.js +804 -0
  47. package/dist/chunks/raw-temporal-D61lr48Y.js +1464 -0
  48. package/dist/chunks/{raw-temporal-contract-mLFS-9wk.js → raw-temporal-contract-C51YG48G.js} +1 -1
  49. package/dist/chunks/report-preferences-dialog-BCGs4-AE.js +1808 -0
  50. package/dist/chunks/{report-runtime-context-CG_I0PPW.js → report-runtime-context-B984Nq1E.js} +8 -7
  51. package/dist/chunks/save-CfJpQQ68.js +21 -0
  52. package/dist/chunks/saved-dashboard-context-BrTkjcod.js +566 -0
  53. package/dist/chunks/{selection-reducer-CiDEtmAq.js → selection-reducer-vKIb_jS6.js} +2 -2
  54. package/dist/chunks/{semaphor-ready-indicator-CHu1L-lo.js → semaphor-ready-indicator-CHHoWhil.js} +65586 -62749
  55. package/dist/chunks/{shelf-drop-preview-context-i-H6DFyU.js → shelf-drop-preview-context-EsayECEC.js} +199 -196
  56. package/dist/chunks/{source-entity-resolution-C-oNyYMp.js → source-entity-resolution-CVA1a85c.js} +8 -8
  57. package/dist/chunks/switch-CvItuC1Q.js +8199 -0
  58. package/dist/chunks/{temporal-bucket-DlFuhCnT.js → temporal-bucket-D8JF7zKz.js} +86 -71
  59. package/dist/chunks/{temporal-bucket-contract-D2OuaVZ7.js → temporal-bucket-contract-DaOajRC7.js} +1 -1
  60. package/dist/chunks/{token-types-DtSJOUjh.js → token-types-bxUxXDX2.js} +1 -1
  61. package/dist/chunks/{upload-CAIpsti1.js → upload-BFX7apKV.js} +1 -1
  62. package/dist/chunks/{use-create-flow-overlay-state-Bj63WwHc.js → use-create-flow-overlay-state-BqA92GkX.js} +331 -339
  63. package/dist/chunks/{validators-DMSH81OM.js → validators-Ej1DdCXa.js} +1050 -1510
  64. package/dist/chunks/visual-choice-JiJ-_3bi.js +204 -0
  65. package/dist/chunks/x-4f5U2XwU.js +100 -0
  66. package/dist/chunks/{zoned-wall-clock-1qlWCE20.js → zoned-wall-clock-MulfA26h.js} +2 -2
  67. package/dist/dashboard/index.js +2 -2
  68. package/dist/dashboard-authoring/index.js +823 -661
  69. package/dist/data-app-sdk/index.js +32 -30
  70. package/dist/data-app-sdk-adapters/index.js +23 -22
  71. package/dist/data-app-sdk-validation/index.js +23 -22
  72. package/dist/format-utils/index.js +173 -168
  73. package/dist/index.js +267 -258
  74. package/dist/layouts/index.js +236 -24
  75. package/dist/report-runtime-context/index.js +2 -2
  76. package/dist/style.css +1 -1
  77. package/dist/surfboard/index.js +2 -2
  78. package/dist/types/assistant-context.d.ts +2 -0
  79. package/dist/types/assistant-protocol.d.ts +2 -0
  80. package/dist/types/components/assistant/assistant-entry-points.d.ts +18 -0
  81. package/dist/types/components/assistant/assistant-provider.d.ts +19 -0
  82. package/dist/types/components/assistant/assistant-store.d.ts +52 -0
  83. package/dist/types/components/assistant/use-assistant.d.ts +38 -0
  84. package/dist/types/components/index.d.ts +5 -1
  85. package/dist/types/components/surfboard/filter/types.d.ts +5 -2
  86. package/dist/types/index.js +50 -51
  87. package/dist/types/lib/api/invalidate-token.d.ts +7 -0
  88. package/dist/types/lib/charts/cartesian-fields.d.ts +64 -0
  89. package/dist/types/lib/charts/types.d.ts +7 -0
  90. package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-storage-transition.d.ts +14 -2
  91. package/dist/types/lib/dashboard-inputs/dashboard-input-target-context.d.ts +5 -6
  92. package/dist/types/lib/dashboard-inputs/dashboard-input-values.d.ts +8 -3
  93. package/dist/types/lib/dashboard-inputs/resolve-dashboard-input-context.d.ts +11 -6
  94. package/dist/types/lib/dashboard-pagination/dashboard-card-pagination.d.ts +7 -0
  95. package/dist/types/lib/dashboard-viewer/compatibility-input-storage.d.ts +79 -0
  96. package/dist/types/lib/dashboard-viewer/viewer-state.d.ts +3 -2
  97. package/dist/types/lib/document/document-table-data-policy.d.ts +15 -0
  98. package/dist/types/lib/filter-values/filter-mode.d.ts +22 -0
  99. package/dist/types/lib/hooks/use-calendar-context.d.ts +5 -0
  100. package/dist/types/lib/hooks/use-text-filter.d.ts +7 -0
  101. package/dist/types/lib/print/print-inputs.d.ts +4 -2
  102. package/dist/types/lib/query-context/build-card-query-context.d.ts +12 -4
  103. package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +93 -0
  104. package/dist/types/lib/query-context/card-server-request.d.ts +72 -0
  105. package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +7 -0
  106. package/dist/types/lib/query-context/describe-card-execution-snapshot.d.ts +56 -0
  107. package/dist/types/lib/query-context/document-section-card-query.d.ts +45 -0
  108. package/dist/types/lib/query-context/resolve-runtime-card-filters.d.ts +17 -2
  109. package/dist/types/lib/stores/dashboard-store.d.ts +34 -11
  110. package/dist/types/lib/stores/editor-store.d.ts +4 -2
  111. package/dist/types/lib/types/token-types.d.ts +11 -0
  112. package/dist/types/lib/utils/card-type-change.d.ts +30 -0
  113. package/dist/types/lib/utils/comparison-window-caption.d.ts +12 -0
  114. package/dist/types/lib/utils/filter-default-value-utils.d.ts +13 -2
  115. package/dist/types/shared/analytics-protocol/applied-constraints.d.ts +74 -0
  116. package/dist/types/shared/analytics-protocol/contracts.d.ts +3 -0
  117. package/dist/types/shared/analytics-protocol/filter-field-ownership.d.ts +43 -0
  118. package/dist/types/shared/analytics-protocol/index.d.ts +3 -0
  119. package/dist/types/shared/analytics-protocol/matrix-window-contract.d.ts +1 -1
  120. package/dist/types/shared/analytics-protocol/visual-choice.d.ts +75 -0
  121. package/dist/types/shared/assistant-context/index.d.ts +9 -0
  122. package/dist/types/shared/assistant-context/project-context.d.ts +55 -0
  123. package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +130 -0
  124. package/dist/types/shared/assistant-protocol/add-to-dashboard.d.ts +17 -0
  125. package/dist/types/shared/assistant-protocol/artifact.d.ts +63 -0
  126. package/dist/types/shared/assistant-protocol/availability.d.ts +39 -0
  127. package/dist/types/shared/assistant-protocol/context.d.ts +952 -0
  128. package/dist/types/shared/assistant-protocol/conversation.d.ts +38 -0
  129. package/dist/types/shared/assistant-protocol/index.d.ts +16 -0
  130. package/dist/types/shared/assistant-protocol/limits.d.ts +53 -0
  131. package/dist/types/shared/assistant-protocol/parts.d.ts +131 -0
  132. package/dist/types/shared/assistant-protocol/request.d.ts +77 -0
  133. package/dist/types/shared/assistant-protocol/sources.d.ts +27 -0
  134. package/dist/types/shared/assistant-protocol/token-config.d.ts +32 -0
  135. package/dist/types/shared/assistant-protocol/transcript.d.ts +40 -0
  136. package/dist/types/shared/dashboard-authoring/card-query-request.d.ts +112 -0
  137. package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +1794 -0
  138. package/dist/types/shared/dashboard-authoring/index.d.ts +5 -0
  139. package/dist/types/shared/dashboard-authoring/new-card.d.ts +10 -0
  140. package/dist/types/shared/dashboard-authoring/operations/apply-dashboard-operations.d.ts +40 -0
  141. package/dist/types/shared/dashboard-authoring/resolved-primary-date-field-validation.d.ts +16 -0
  142. package/dist/types/shared/format-utils/filter-detail.d.ts +70 -0
  143. package/dist/types/shared/format-utils/filter-value-text.d.ts +15 -0
  144. package/dist/types/shared/format-utils/index.d.ts +3 -0
  145. package/dist/types/shared/format-utils/raw-temporal.d.ts +7 -0
  146. package/dist/types/shared/format-utils/temporal-bucket.d.ts +7 -0
  147. package/dist/types/shared/layouts/frame-layouts.d.ts +23 -0
  148. package/dist/types/shared/layouts/index.d.ts +1 -0
  149. package/package.json +12 -2
  150. package/dist/chunks/calculated-field-identity-BptYhyOP.js +0 -1326
  151. package/dist/chunks/calendar-day-equality-BRjN1S9h.js +0 -383
  152. package/dist/chunks/card-config-utils-BOM1dxCk.js +0 -1150
  153. package/dist/chunks/constants-DNWVy8Y3.js +0 -9
  154. package/dist/chunks/dashboard-json-B1dEQu98.js +0 -65
  155. package/dist/chunks/field-aggregations-CoLzYHeL.js +0 -1229
  156. package/dist/chunks/index-DTcTAGGM.js +0 -4101
  157. package/dist/chunks/matrix-continuation-C4sRcjZU.js +0 -72
  158. package/dist/chunks/matrix-control-sources-DTqcA2_L.js +0 -636
  159. package/dist/chunks/matrix-definition-D9iShKZI.js +0 -87
  160. package/dist/chunks/matrix-member-presentation-Ct8GuxHt.js +0 -209
  161. package/dist/chunks/numeric-presentation-CWu3gunq.js +0 -537
  162. package/dist/chunks/pivot-header-presentation-CHs2GFrM.js +0 -753
  163. package/dist/chunks/pivot-result-lifecycle-DQz_gjGu.js +0 -789
  164. package/dist/chunks/raw-temporal-iMXRK-Qz.js +0 -930
  165. package/dist/chunks/report-preferences-dialog-DXPjteCU.js +0 -1623
  166. package/dist/chunks/save-kO6cIaob.js +0 -34
  167. package/dist/chunks/semantic-format-DiqYeKwU.js +0 -192
  168. package/dist/chunks/switch-DO8a0EfJ.js +0 -25004
  169. package/dist/chunks/temporal-input-presentation-BD7YNUzu.js +0 -195
  170. package/dist/chunks/x-CXDkqdur.js +0 -149
  171. package/dist/types/lib/class-utils.d.ts +0 -2
  172. package/dist/types/lib/document/document-input-runtime.d.ts +0 -26
  173. package/dist/types/lib/utils.d.ts +0 -51
@@ -1,383 +0,0 @@
1
- import { B as A } from "./validators-DMSH81OM.js";
2
- import { b as B, w as y, z as S } from "./zoned-wall-clock-1qlWCE20.js";
3
- function tt(t) {
4
- return `compat-filter:${t}`;
5
- }
6
- function et(t) {
7
- return `compat-control:${t}`;
8
- }
9
- function nt(t, e) {
10
- return `compat-inline-filter:${t}:${e}`;
11
- }
12
- function st(t, e) {
13
- return `compat-card-control:${t}:${e}`;
14
- }
15
- function U(t, e) {
16
- const n = t.split(".").map((a) => a.trim()), s = e.split(".").map((a) => a.trim());
17
- if (n.length === 0 || s.length === 0 || n.some((a) => !a) || s.some((a) => !a))
18
- return !1;
19
- const [i, o] = n.length <= s.length ? [n, s] : [s, n], r = o.length - i.length;
20
- return i.every((a, c) => a === o[c + r]);
21
- }
22
- function W(t, e) {
23
- const n = t.split("."), s = e.split("."), i = n.pop(), o = s.pop();
24
- return !!(i && i === o && n.length > 0 && s.length > 0 && U(
25
- n.join("."),
26
- s.join(".")
27
- ));
28
- }
29
- function j(t) {
30
- const e = t.map((s) => s.trim()).filter(Boolean);
31
- if (e.every(
32
- (s, i) => e.slice(i + 1).every(
33
- (o) => U(s, o)
34
- )
35
- ))
36
- return [...e].sort(
37
- (s, i) => i.split(".").length - s.split(".").length
38
- )[0];
39
- }
40
- function m(t) {
41
- return typeof t == "object" && t !== null && !Array.isArray(t);
42
- }
43
- function k(t) {
44
- if (typeof t != "string") return "";
45
- const e = t.split(".").map((n) => n.trim());
46
- return e.length > 1 && e.every(Boolean) ? e.join(".") : "";
47
- }
48
- function v(t) {
49
- if (typeof t != "string") return "";
50
- const e = t.split(".").map((n) => n.trim());
51
- return e.length > 0 && e.every(Boolean) ? e.join(".") : "";
52
- }
53
- function d(t) {
54
- return typeof t == "string" ? t.trim() : "";
55
- }
56
- function P(t, e) {
57
- return t.every(
58
- (n, s) => t.slice(s + 1).every((i) => e(n, i))
59
- );
60
- }
61
- function L(t, e) {
62
- const n = d(t.id), s = d(t.name), i = d(e.entityId), o = d(e.entityName);
63
- return !s || !i && !o ? !1 : (!i || i === n || i === s) && (!o || o === s);
64
- }
65
- function R(t) {
66
- const e = m(t.semanticContext) ? t.semanticContext : void 0, n = m(t.fieldMeta) ? t.fieldMeta : void 0, s = d(e == null ? void 0 : e.semanticDomainId), i = Array.isArray(e == null ? void 0 : e.selectedEntities) ? e.selectedEntities.filter(
67
- (I) => m(I) && I.type === "dataset"
68
- ) : [];
69
- if (!!!(s || i.length > 0 || (n == null ? void 0 : n.entityType) === "dataset")) return;
70
- if (!s)
71
- return { status: "unresolved", reason: "incomplete_source_identity" };
72
- const r = d(n == null ? void 0 : n.entityId), a = d(n == null ? void 0 : n.entityName), c = !!(r || a), l = c ? i.filter(
73
- (I) => L(I, {
74
- entityId: r,
75
- entityName: a
76
- })
77
- ) : i;
78
- if (l.length > 1)
79
- return { status: "unresolved", reason: "incomplete_source_identity" };
80
- if (c && i.length > 0 && l.length === 0)
81
- return { status: "unresolved", reason: "divergent_source_identity" };
82
- const u = l[0], f = d(u == null ? void 0 : u.domainId), D = d(u == null ? void 0 : u.id), h = d(u == null ? void 0 : u.name);
83
- if (f && f !== s)
84
- return { status: "unresolved", reason: "divergent_source_identity" };
85
- const E = D, F = h || a;
86
- return F ? {
87
- status: "resolved",
88
- source: {
89
- kind: "semantic",
90
- domainId: s,
91
- datasetName: F,
92
- ...E ? { datasetId: E } : {}
93
- }
94
- } : { status: "unresolved", reason: "incomplete_source_identity" };
95
- }
96
- function O(t, e) {
97
- const n = d(t.connectionId), s = m(t.semanticContext) ? t.semanticContext : void 0, i = d(s == null ? void 0 : s.connectionId);
98
- if (n && i && n !== i)
99
- return { status: "unresolved", reason: "divergent_source_identity" };
100
- const o = n || i, r = m(t.fieldMeta) ? t.fieldMeta : void 0, a = e.split(".").slice(0, -1).join("."), c = v(t.qualifiedTableName), l = v(
101
- r == null ? void 0 : r.qualifiedEntityName
102
- ), u = [
103
- c,
104
- l,
105
- a
106
- ].filter(Boolean), f = j(u);
107
- return !f && u.length > 0 ? { status: "unresolved", reason: "divergent_source_identity" } : !o || !f ? { status: "unresolved", reason: "incomplete_source_identity" } : {
108
- status: "resolved",
109
- source: { kind: "physical", connectionId: o, tableName: f }
110
- };
111
- }
112
- function Q(t, e) {
113
- const n = m(t.fieldMeta) ? t.fieldMeta : void 0, s = typeof (n == null ? void 0 : n.qualifiedFieldName) == "string" ? n.qualifiedFieldName.trim() : "", i = k(
114
- n == null ? void 0 : n.qualifiedFieldName
115
- ), o = typeof t.column == "string" ? t.column.trim() : "", r = k(o), a = typeof t.qualifiedTableName == "string" ? t.qualifiedTableName.trim() : "", c = v(
116
- t.qualifiedTableName
117
- );
118
- if (s && !i || e && a && !c || o.includes(".") && !r)
119
- return { status: "unresolved", reason: "incomplete_field_identity" };
120
- const l = r.split("."), u = r ? l[l.length - 1] : o, f = e && c && u ? `${c}.${u}` : "", D = [
121
- i,
122
- r,
123
- f
124
- ].filter(Boolean);
125
- if (!P(
126
- D,
127
- W
128
- ))
129
- return { status: "unresolved", reason: "divergent_field_identity" };
130
- const h = r || i || f;
131
- return h ? { status: "resolved", qualifiedFieldName: h } : { status: "unresolved", reason: "incomplete_field_identity" };
132
- }
133
- function Y(t) {
134
- if (!m(t))
135
- return { status: "ineligible", reason: "invalid_input" };
136
- if (t.kind === "global-date")
137
- return { status: "eligible", kind: "global_date" };
138
- const e = A(t.dataType);
139
- if (e !== "date" && e !== "datetime")
140
- return { status: "ineligible", reason: "non_date_filter" };
141
- const n = m(t.fieldMeta) ? t.fieldMeta : void 0, s = A(
142
- n == null ? void 0 : n.dataType
143
- );
144
- if ((n == null ? void 0 : n.dataType) !== void 0 && s !== "date" && s !== "datetime")
145
- return { status: "ineligible", reason: "non_date_filter" };
146
- if (t.customFilterPreferences)
147
- return { status: "ineligible", reason: "custom_filter" };
148
- if (t.targetColumns !== void 0 && (!Array.isArray(t.targetColumns) || t.targetColumns.length > 0))
149
- return { status: "ineligible", reason: "multi_target_filter" };
150
- const i = R(t), o = Q(t, i === void 0);
151
- if (o.status === "unresolved")
152
- return { status: "ineligible", reason: o.reason };
153
- const r = i || O(t, o.qualifiedFieldName);
154
- return r.status === "resolved" ? {
155
- status: "eligible",
156
- kind: "field_date",
157
- qualifiedFieldName: o.qualifiedFieldName,
158
- source: r.source
159
- } : { status: "ineligible", reason: r.reason };
160
- }
161
- function H(t) {
162
- if (!m(t) || t.kind !== "filter" || !m(t.filter))
163
- return { status: "ineligible", reason: "invalid_input" };
164
- const e = Y(
165
- t.filter
166
- );
167
- return e.status === "ineligible" ? e : e.kind === "field_date" && m(t.compatibility) && t.compatibility.source === "cardInlineFilter" ? { status: "ineligible", reason: "card_inline_filter" } : e;
168
- }
169
- function it(t) {
170
- return H(t).status === "eligible";
171
- }
172
- const T = 864e5, q = {
173
- second: 1e3,
174
- minute: 6e4,
175
- hour: 36e5
176
- };
177
- function N(t, e) {
178
- return {
179
- ...S(t, e),
180
- millisecond: (t.getTime() % 1e3 + 1e3) % 1e3
181
- };
182
- }
183
- function g(t, e) {
184
- return B(t, e);
185
- }
186
- function _(t) {
187
- const e = new Date(t);
188
- return {
189
- year: e.getUTCFullYear(),
190
- month: e.getUTCMonth() + 1,
191
- day: e.getUTCDate(),
192
- hour: e.getUTCHours(),
193
- minute: e.getUTCMinutes(),
194
- second: e.getUTCSeconds(),
195
- millisecond: e.getUTCMilliseconds()
196
- };
197
- }
198
- function $(t, e) {
199
- const n = /* @__PURE__ */ new Date(0);
200
- return n.setUTCFullYear(t, e, 0), n.getUTCDate();
201
- }
202
- function C(t, e) {
203
- const n = t.year * 12 + (t.month - 1) + e, s = Math.floor(n / 12), i = n - s * 12 + 1;
204
- return { ...t, year: s, month: i, day: Math.min(t.day, $(s, i)) };
205
- }
206
- function p(t, e, n) {
207
- if (e === 0) return t;
208
- switch (n) {
209
- case "second":
210
- case "minute":
211
- case "hour":
212
- return _(
213
- y(t) + e * q[n]
214
- );
215
- case "day":
216
- return _(y(t) + e * T);
217
- case "week":
218
- return _(y(t) + e * 7 * T);
219
- case "month":
220
- return C(t, e);
221
- case "quarter":
222
- return C(t, e * 3);
223
- case "year":
224
- return C(t, e * 12);
225
- }
226
- }
227
- function G(t) {
228
- return new Date(
229
- y({ ...t, hour: 0, minute: 0, second: 0 })
230
- ).getUTCDay();
231
- }
232
- function M(t) {
233
- var n;
234
- const e = (n = t.fiscalCalendar) == null ? void 0 : n.yearStartMonth;
235
- return e && e >= 1 && e <= 12 ? e : 1;
236
- }
237
- function J(t, e, n) {
238
- const s = { ...t, hour: 0, minute: 0, second: 0, millisecond: 0 };
239
- switch (e) {
240
- case "day":
241
- return s;
242
- case "week":
243
- return p(
244
- s,
245
- -((G(t) - n.weekStart + 7) % 7),
246
- "day"
247
- );
248
- case "month":
249
- return { ...s, day: 1 };
250
- case "quarter": {
251
- const i = (t.month - M(n) + 12) % 12;
252
- return C({ ...s, day: 1 }, -(i % 3));
253
- }
254
- case "year": {
255
- const i = M(n);
256
- return {
257
- ...s,
258
- year: t.month >= i ? t.year : t.year - 1,
259
- month: i,
260
- day: 1
261
- };
262
- }
263
- }
264
- }
265
- function b(t, e, n, s = 0) {
266
- const i = q[e];
267
- if (i !== void 0) {
268
- const a = N(t, n.tz), c = a.millisecond + (e === "second" ? 0 : a.second * 1e3) + (e === "hour" ? a.minute * 6e4 : 0), l = t.getTime() - c + s * i;
269
- return { start: new Date(l), endExclusive: new Date(l + i) };
270
- }
271
- const o = e, r = p(
272
- J(N(t, n.tz), o, n),
273
- s,
274
- e
275
- );
276
- return {
277
- start: g(r, n.tz),
278
- endExclusive: g(p(r, 1, e), n.tz)
279
- };
280
- }
281
- function z(t, e, n) {
282
- return b(t, e, n).start;
283
- }
284
- function w(t, e, n) {
285
- return new Date(b(t, e, n).endExclusive.getTime() - 1);
286
- }
287
- function K(t, e, n, s) {
288
- return e === 0 ? t : g(
289
- p(N(t, s.tz), e, n),
290
- s.tz
291
- );
292
- }
293
- function ot(t, e, n) {
294
- const s = (i) => {
295
- const { year: o, month: r, day: a } = S(i, n);
296
- return y({ year: o, month: r, day: a, hour: 0, minute: 0, second: 0 });
297
- };
298
- return Math.round((s(e) - s(t)) / T);
299
- }
300
- const V = /^(\d{4})-(\d{2})-(\d{2})$/;
301
- function rt(t, e) {
302
- const { year: n, month: s, day: i } = S(t, e);
303
- return `${String(n).padStart(4, "0")}-${String(s).padStart(2, "0")}-${String(i).padStart(2, "0")}`;
304
- }
305
- function x(t) {
306
- const e = V.exec(t);
307
- if (!e) return null;
308
- const n = Number(e[1]), s = Number(e[2]), i = Number(e[3]);
309
- return s < 1 || s > 12 || i < 1 || i > $(n, s) ? null : { year: n, month: s, day: i };
310
- }
311
- function at(t, e) {
312
- const n = x(t);
313
- if (!n) return null;
314
- const s = { ...n, hour: 0, minute: 0, second: 0, millisecond: 0 };
315
- return {
316
- start: g(s, e),
317
- endExclusive: g(p(s, 1, "day"), e)
318
- };
319
- }
320
- function ut(t, e, n) {
321
- const s = (o) => new Date(b(n, t.unit, e, o).endExclusive.getTime() - 1), i = (o) => b(n, t.unit, e, o).start;
322
- switch (t.mode) {
323
- case "last":
324
- return t.unit === "minute" || t.unit === "hour" ? {
325
- start: new Date(
326
- n.getTime() - t.n * q[t.unit]
327
- ),
328
- end: n
329
- } : t.complete ? { start: i(-t.n), end: s(-1) } : { start: K(n, -t.n, t.unit, e), end: n };
330
- case "this": {
331
- if (t.boundary && t.unit === "month") {
332
- const o = t.boundary === "first_day" ? z(n, "month", e) : w(n, "month", e);
333
- return {
334
- start: z(o, "day", e),
335
- end: w(o, "day", e)
336
- };
337
- }
338
- return { start: i(0), end: t.toDate ? n : s(0) };
339
- }
340
- case "previous":
341
- return { start: i(-1), end: s(-1) };
342
- case "between":
343
- return { start: i(t.from), end: s(t.to) };
344
- }
345
- }
346
- function ct(t) {
347
- const { operation: e, values: n, temporalPrecision: s } = t;
348
- if (e !== "=" && e !== "!=" || s === "minute")
349
- return null;
350
- const i = Array.isArray(n) ? n : [n];
351
- if (i.length !== 1 || typeof i[0] != "string") return null;
352
- const o = i[0].trim();
353
- return x(o) ? { operation: e, day: o } : null;
354
- }
355
- export {
356
- q as E,
357
- L as a,
358
- H as b,
359
- et as c,
360
- nt as d,
361
- st as e,
362
- g as f,
363
- tt as g,
364
- $ as h,
365
- it as i,
366
- p as j,
367
- G as k,
368
- z as l,
369
- w as m,
370
- ot as n,
371
- rt as o,
372
- b as p,
373
- x as q,
374
- Y as r,
375
- K as s,
376
- at as t,
377
- ut as u,
378
- ct as v,
379
- N as w,
380
- j as x,
381
- W as y,
382
- U as z
383
- };