@commercelayer/app-elements 5.4.2 → 5.5.0

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 (44) hide show
  1. package/dist/CodeEditorComponent-CyKOXTx9.js +739 -0
  2. package/dist/{InputDateComponent-BB1cA4uH.js → InputDateComponent-CX954J1N.js} +1174 -1301
  3. package/dist/RuleEngineComponent-BJQQwo47.js +1376 -0
  4. package/dist/fetchCoreResourcesSuggestions-CZkDwjO2.js +126 -0
  5. package/dist/helpers/giftCards.d.ts +1 -0
  6. package/dist/helpers/giftCards.test.d.ts +1 -0
  7. package/dist/{main-DvygJyZL.js → main-ClKWD_hr.js} +8804 -8137
  8. package/dist/main.d.ts +3 -0
  9. package/dist/main.js +137 -133
  10. package/dist/parseISO-DltoM17h.js +120 -0
  11. package/dist/style.css +1 -1
  12. package/dist/tailwind.config.js +5 -5
  13. package/dist/ui/atoms/Icon/icons.d.ts +5 -0
  14. package/dist/ui/composite/ListItem.d.ts +3 -1
  15. package/dist/ui/composite/Timeline.d.ts +1 -0
  16. package/dist/ui/composite/Toast.d.ts +8 -0
  17. package/dist/ui/forms/CodeEditor/CodeEditor.d.ts +2 -1
  18. package/dist/ui/forms/CodeEditor/CodeEditorComponent.d.ts +10 -1
  19. package/dist/ui/forms/CodeEditor/fetchCoreResourcesSuggestions.d.ts +34 -18
  20. package/dist/ui/forms/RuleEngine/Action/ActionListItem.d.ts +6 -0
  21. package/dist/ui/forms/RuleEngine/Action/ActionValue.d.ts +5 -0
  22. package/dist/ui/forms/RuleEngine/Action/index.d.ts +4 -0
  23. package/dist/ui/forms/RuleEngine/Condition/ConditionListItem.d.ts +8 -0
  24. package/dist/ui/forms/RuleEngine/Condition/ConditionMatcher.d.ts +6 -0
  25. package/dist/ui/forms/RuleEngine/Condition/ConditionValue.d.ts +12 -0
  26. package/dist/ui/forms/RuleEngine/Condition/ValueComponents/InputArrayMatch.d.ts +6 -0
  27. package/dist/ui/forms/RuleEngine/Condition/ValueComponents/InputNumberRange.d.ts +6 -0
  28. package/dist/ui/forms/RuleEngine/Condition/ValueComponents/InputTextRange.d.ts +6 -0
  29. package/dist/ui/forms/RuleEngine/Condition/hooks.d.ts +5 -0
  30. package/dist/ui/forms/RuleEngine/Condition/index.d.ts +8 -0
  31. package/dist/ui/forms/RuleEngine/Condition/utils.d.ts +3 -0
  32. package/dist/ui/forms/RuleEngine/RuleEngine.d.ts +3 -0
  33. package/dist/ui/forms/RuleEngine/RuleEngineComponent.d.ts +22 -0
  34. package/dist/ui/forms/RuleEngine/RuleEngineContext.d.ts +18 -0
  35. package/dist/ui/forms/RuleEngine/RuleName.d.ts +1 -0
  36. package/dist/ui/forms/RuleEngine/index.d.ts +2 -0
  37. package/dist/ui/forms/RuleEngine/schema.order_rules.d.ts +335 -0
  38. package/dist/ui/forms/RuleEngine/schema.price_rules.d.ts +286 -0
  39. package/dist/ui/forms/RuleEngine/utils.d.ts +24 -0
  40. package/dist/ui/internals/Overlay.d.ts +13 -0
  41. package/dist/ui/resources/ResourceLineItems/ResourceLineItems.mocks.d.ts +17 -0
  42. package/dist/vendor.css +1 -1
  43. package/package.json +6 -2
  44. package/dist/CodeEditorComponent-CZdWLH8G.js +0 -794
package/dist/main.d.ts CHANGED
@@ -3,6 +3,7 @@ export { isAttachmentValidNote, referenceOrigins } from './helpers/attachments';
3
3
  export { currencies, currencyInputSelectOptions, type CurrencyCode } from './helpers/currencies';
4
4
  export { formatDate, formatDateRange, formatDateWithPredicate, getEventDateInfo, getIsoDateAtDayEdge, getIsoDateAtDaysBefore, isDateValid, makeDateYearsRange, removeMillisecondsFromIsoDate, sortAndGroupByDate, timeSeparator } from './helpers/date';
5
5
  export { downloadJsonAsFile } from './helpers/downloadJsonAsFile';
6
+ export { maskGiftCardCode } from './helpers/giftCards';
6
7
  export { isMock, isMockedId } from './helpers/mocks';
7
8
  export { computeFullname, formatDisplayName } from './helpers/name';
8
9
  export { formatResourceName, getResourceEndpoint, type TriggerAttribute } from './helpers/resources';
@@ -76,6 +77,7 @@ export { createRoute, createTypedRoute, GenericPageNotFound, LoadingPage, Routes
76
77
  export { SearchBar, type SearchBarProps } from './ui/composite/SearchBar';
77
78
  export { TableData, type TableDataProps } from './ui/composite/TableData';
78
79
  export { Timeline, type TimelineEvent, type TimelineProps } from './ui/composite/Timeline';
80
+ export { toast, ToastContainer } from './ui/composite/Toast';
79
81
  export { Toolbar, type ToolbarProps } from './ui/composite/Toolbar';
80
82
  export { CodeEditor, HookedCodeEditor, type CodeEditorProps, type HookedCodeEditorProps } from './ui/forms/CodeEditor';
81
83
  export { HookedForm } from './ui/forms/Form';
@@ -101,6 +103,7 @@ export { Label, type LabelProps } from './ui/forms/Label';
101
103
  export { Legend, type LegendProps } from './ui/forms/Legend';
102
104
  export { HookedMarketWithCurrencySelector, type HookedMarketWithCurrencySelectorProps } from './ui/forms/MarketWithCurrencySelector';
103
105
  export { HookedValidationApiError, HookedValidationError, setApiFormErrors, useValidationFeedback } from './ui/forms/ReactHookForm';
106
+ export { RuleEngine, type RuleEngineProps } from './ui/forms/RuleEngine';
104
107
  export { getResourceAddressFormFieldsSchema, ResourceAddress, ResourceAddressFormFields, useResourceAddressOverlay, type ResourceAddressFormFieldsProps, type ResourceAddressProps } from './ui/resources/ResourceAddress';
105
108
  export { ResourceAttachments, type ResourceAttachmentsProps } from './ui/resources/ResourceAttachments';
106
109
  export { ResourceDetails, type ResourceDetailsProps } from './ui/resources/ResourceDetails';
package/dist/main.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { aO as s, bs as t, bt as o, aP as r, aQ as c, aR as n, aS as u, aT as i, aU as d, aV as l, aW as p, bu as b, aX as g, bR as m, aY as S, aZ as I, az as k, bv as T, bw as R, bx as D, by as y, a_ as h, aD as A, aE as C, bK as P, a$ as H, b0 as F, bz as v, bS as f, bT as B, bU as L, bW as O, bY as E, b$ as N, c2 as G, c4 as M, c9 as w, cb as V, cg as x, cl as W, cn as J, cp as U, cr as Y, ct as X, cx as Z, cy as _, cz as $, b1 as j, aH as q, b2 as z, bV as K, bX as Q, bZ as aa, c0 as ea, c1 as sa, c3 as ta, c5 as oa, c6 as ra, c7 as ca, c8 as na, ca as ua, cc as ia, ch as da, cm as la, co as pa, cq as ba, cs as ga, cu as ma, cv as Sa, cw as Ia, bA as ka, bB as Ta, bC as Ra, bD as Da, bL as ya, aM as ha, bE as Aa, b3 as Ca, bF as Pa, bG as Ha, b4 as Fa, b5 as va, b6 as fa, b7 as Ba, bH as La, cD as Oa, cE as Ea, cG as Na, cH as Ga, cI as Ma, cJ as wa, cK as Va, cL as xa, cN as Wa, cO as Ja, cP as Ua, bM as Ya, b8 as Xa, bN as Za, b9 as _a, ba as $a, bb as ja, bc as qa, be as za, bf as Ka, bg as Qa, bh as ae, bi as ee, bn as se, bj as te, bO as oe, bo as re, bp as ce, bk as ne, bq as ue, bl as ie, bP as de, aN as le, bQ as pe, br as be, bm as ge, aJ as me, ad as Se, aC as Ie, bI as ke, bJ as Te, _ as Re, $ as De, aa as ye, aL as he, ce as Ae, b_ as Ce, a0 as Pe, a1 as He, a2 as Fe, ae as ve, af as fe, ah as Be, cS as Le, cT as Oe, cf as Ee, a3 as Ne, a4 as Ge, a5 as Me, cU as we, cV as Ve, cW as xe, cX as We, cY as Je, ai as Ue, aj as Ye, cM as Xe, cZ as Ze, cC as _e, ag as $e, c_ as je, c$ as qe, d0 as ze, ak as Ke, al as Qe, d1 as as, d2 as es, d3 as ss, ap as ts, aq as os, W as rs, am as cs, an as ns, aG as us, Y as is, R as ds, ci as ls, ab as ps, ac as bs, cj as gs, ck as ms, a6 as Ss, X as Is, ao as ks, Z as Ts, a7 as Rs, cA as Ds, a8 as ys, aI as hs, a9 as As, ar as Cs, as as Ps, aA as Hs, aB as Fs, at as vs, au as fs, av as Bs, cd as Ls, aw as Os, ax as Es, ay as Ns, cF as Gs, cQ as Ms, cR as ws, aF as Vs, u as xs, aK as Ws, cB as Js, bd as Us } from "./main-DvygJyZL.js";
2
+ import { b5 as s, bJ as t, bK as o, b6 as r, b7 as c, b8 as n, b9 as u, B as i, ba as d, bb as l, bc as p, bL as b, bd as g, C as m, be as S, bf as I, aS as k, D as T, s as D, l as R, bM as y, bg as C, aW as h, aX as A, bY as P, bh as H, bi as F, bN as f, c5 as v, c6 as B, c7 as L, c8 as O, ca as E, cd as N, cg as G, ch as M, cl as w, cn as V, cs as x, cu as W, cw as J, cy as U, cA as q, cC as Y, cG as j, cH as z, cI as K, bj as Q, a_ as X, n as Z, f as _, c9 as $, cb as aa, ce as ea, cf as sa, r as ta, q as oa, ci as ra, cj as ca, ck as na, cm as ua, co as ia, h as da, cv as la, cx as pa, cz as ba, cB as ga, cD as ma, cE as Sa, cF as Ia, bO as ka, bP as Ta, bQ as Da, bR as Ra, bZ as ya, b3 as Ca, bS as ha, bk as Aa, bT as Pa, bU as Ha, bl as Fa, bm as fa, bn as va, bo as Ba, bV as La, cN as Oa, cO as Ea, cQ as Na, cR as Ga, cS as Ma, cT as wa, cU as Va, cV as xa, cX as Wa, cY as Ja, cZ as Ua, b_ as qa, cL as Ya, bp as ja, b$ as za, bq as Ka, br as Qa, bs as Xa, bt as Za, bv as _a, bw as $a, bx as ae, by as ee, bz as se, bE as te, bA as oe, c0 as re, bF as ce, bG as ne, bB as ue, bH as ie, bC as de, c1 as le, c3 as pe, b4 as be, c4 as ge, bI as me, bD as Se, b0 as Ie, aw as ke, aV as Te, bW as De, bX as Re, ag as ye, ah as Ce, as as he, b2 as Ae, cq as Pe, cc as He, ai as Fe, aj as fe, ak as ve, ax as Be, ay as Le, aA as Oe, d0 as Ee, d1 as Ne, cr as Ge, al as Me, am as we, an as Ve, d2 as xe, d3 as We, d4 as Je, d5 as Ue, d6 as qe, aB as Ye, aC as je, cW as ze, d7 as Ke, cM as Qe, az as Xe, d8 as Ze, d9 as _e, da as $e, aD as as, aE as es, db as ss, dc as ts, dd as os, aI as rs, aJ as cs, ac as ns, aF as us, aG as is, aZ as ds, ae as ls, a8 as ps, ct as bs, au as gs, av as ms, p as Ss, k as Is, ao as ks, at as Ts, ad as Ds, aH as Rs, af as ys, ap as Cs, cJ as hs, aq as As, a$ as Ps, ar as Hs, c2 as Fs, aK as fs, aL as vs, aT as Bs, aU as Ls, aM as Os, aN as Es, aO as Ns, cp as Gs, aP as Ms, aQ as ws, aR as Vs, cP as xs, c_ as Ws, c$ as Js, aY as Us, u as qs, b1 as Ys, cK as js, bu as zs } from "./main-ClKWD_hr.js";
3
3
  export {
4
4
  s as A,
5
5
  t as ActionButtons,
@@ -19,17 +19,17 @@ export {
19
19
  I as CopyToClipboard,
20
20
  k as CoreSdkProvider,
21
21
  T as Dropdown,
22
- R as DropdownDivider,
23
- D as DropdownItem,
22
+ D as DropdownDivider,
23
+ R as DropdownItem,
24
24
  y as DropdownSearch,
25
- h as EmptyState,
26
- A as ErrorBoundary,
27
- C as GTMProvider,
25
+ C as EmptyState,
26
+ h as ErrorBoundary,
27
+ A as GTMProvider,
28
28
  P as GenericPageNotFound,
29
29
  H as Grid,
30
30
  F as Hint,
31
- v as HomePageLayout,
32
- f as HookedCodeEditor,
31
+ f as HomePageLayout,
32
+ v as HookedCodeEditor,
33
33
  B as HookedForm,
34
34
  L as HookedInput,
35
35
  O as HookedInputCheckbox,
@@ -43,16 +43,16 @@ export {
43
43
  W as HookedInputSimpleSelect,
44
44
  J as HookedInputSpinner,
45
45
  U as HookedInputSwitch,
46
- Y as HookedInputTextArea,
47
- X as HookedInputToggleButton,
48
- Z as HookedMarketWithCurrencySelector,
49
- _ as HookedValidationApiError,
50
- $ as HookedValidationError,
51
- j as Hr,
52
- q as I18NProvider,
53
- z as Icon,
54
- K as Input,
55
- Q as InputCheckbox,
46
+ q as HookedInputTextArea,
47
+ Y as HookedInputToggleButton,
48
+ j as HookedMarketWithCurrencySelector,
49
+ z as HookedValidationApiError,
50
+ K as HookedValidationError,
51
+ Q as Hr,
52
+ X as I18NProvider,
53
+ Z as Icon,
54
+ _ as Input,
55
+ $ as InputCheckbox,
56
56
  aa as InputCheckboxGroup,
57
57
  ea as InputCurrency,
58
58
  sa as InputCurrencyRange,
@@ -73,17 +73,17 @@ export {
73
73
  Ia as Legend,
74
74
  ka as List,
75
75
  Ta as ListDetails,
76
- Ra as ListDetailsItem,
77
- Da as ListItem,
76
+ Da as ListDetailsItem,
77
+ Ra as ListItem,
78
78
  ya as LoadingPage,
79
- ha as MetaTags,
80
- Aa as PageError,
81
- Ca as PageHeading,
79
+ Ca as MetaTags,
80
+ ha as PageError,
81
+ Aa as PageHeading,
82
82
  Pa as PageLayout,
83
83
  Ha as PageSkeleton,
84
84
  Fa as Pagination,
85
- va as Progress,
86
- fa as RadialProgress,
85
+ fa as Progress,
86
+ va as RadialProgress,
87
87
  Ba as RemoveButton,
88
88
  La as Report,
89
89
  Oa as ResourceAddress,
@@ -97,112 +97,116 @@ export {
97
97
  Wa as ResourcePaymentMethod,
98
98
  Ja as ResourceShipmentParcels,
99
99
  Ua as ResourceTags,
100
- Ya as Routes,
101
- Xa as ScrollToTop,
102
- Za as SearchBar,
103
- _a as Section,
104
- $a as Skeleton,
105
- ja as SkeletonItem,
106
- qa as SkeletonTemplate,
107
- za as Spacer,
108
- Ka as Stack,
109
- Qa as StatusDot,
110
- ae as StatusIcon,
111
- ee as Steps,
112
- se as Tab,
113
- te as Table,
114
- oe as TableData,
115
- re as Tabs,
116
- ce as Tag,
117
- ne as Td,
118
- ue as Text,
119
- ie as Th,
120
- de as Timeline,
121
- le as TokenProvider,
122
- pe as Toolbar,
123
- be as Tooltip,
124
- ge as Tr,
125
- me as Trans,
126
- Se as computeFullname,
127
- Ie as createApp,
128
- ke as createRoute,
129
- Te as createTypedRoute,
130
- Re as currencies,
131
- De as currencyInputSelectOptions,
132
- ye as downloadJsonAsFile,
133
- he as encodeExtras,
134
- Ae as flatSelectValues,
135
- Ce as formatCentsToCurrency,
136
- Pe as formatDate,
137
- He as formatDateRange,
138
- Fe as formatDateWithPredicate,
139
- ve as formatDisplayName,
140
- fe as formatResourceName,
141
- Be as getAvatarSrcFromRate,
142
- Le as getCustomerDisplayStatus,
143
- Oe as getCustomerStatusName,
144
- Ee as getDefaultValueFromFlatten,
145
- Ne as getEventDateInfo,
146
- Ge as getIsoDateAtDayEdge,
147
- Me as getIsoDateAtDaysBefore,
148
- we as getOrderDisplayStatus,
149
- Ve as getOrderFulfillmentStatusName,
150
- xe as getOrderPaymentStatusName,
151
- We as getOrderStatusName,
152
- Je as getOrderTransactionName,
153
- Ue as getParcelTrackingDetail,
154
- Ye as getParcelTrackingDetails,
155
- Xe as getPaymentMethodLogoSrc,
156
- Ze as getPromotionDisplayStatus,
157
- _e as getResourceAddressFormFieldsSchema,
158
- $e as getResourceEndpoint,
159
- je as getReturnDisplayStatus,
160
- qe as getReturnStatusName,
161
- ze as getShipmentDisplayStatus,
162
- Ke as getShipmentRate,
163
- Qe as getShipmentRates,
164
- as as getShipmentStatusName,
165
- es as getStockTransferDisplayStatus,
166
- ss as getStockTransferStatusName,
167
- ts as getUnitOfWeightName,
168
- os as getUnitsOfWeightForSelect,
169
- rs as goBack,
170
- cs as hasBeenPurchased,
171
- ns as hasSingleTracking,
172
- us as i18nLocales,
173
- is as isAttachmentValidNote,
174
- ds as isDateValid,
175
- ls as isGroupedSelectValues,
176
- ps as isMock,
177
- bs as isMockedId,
178
- gs as isMultiValueSelected,
179
- ms as isSingleValueSelected,
180
- Ss as makeDateYearsRange,
181
- Is as navigateTo,
182
- ks as orderTransactionIsAnAsyncCapture,
183
- Ts as referenceOrigins,
184
- Rs as removeMillisecondsFromIsoDate,
185
- Ds as setApiFormErrors,
186
- ys as sortAndGroupByDate,
187
- hs as t,
188
- As as timeSeparator,
189
- Cs as useAppLinking,
190
- Ps as useClickAway,
191
- Hs as useCoreApi,
192
- Fs as useCoreSdkProvider,
193
- vs as useDelayShow,
194
- fs as useEditMetadataOverlay,
195
- Bs as useEditTagsOverlay,
196
- Ls as useInputResourceGroupOverlay,
197
- Os as useIsChanged,
198
- Es as useOnBlurFromContainer,
199
- Ns as useOverlay,
200
- Gs as useResourceAddressOverlay,
201
- Ms as useResourceFilters,
202
- ws as useResourceList,
203
- Vs as useTagManager,
204
- xs as useTokenProvider,
205
- Ws as useTranslation,
206
- Js as useValidationFeedback,
207
- Us as withSkeletonTemplate
100
+ qa as Routes,
101
+ Ya as RuleEngine,
102
+ ja as ScrollToTop,
103
+ za as SearchBar,
104
+ Ka as Section,
105
+ Qa as Skeleton,
106
+ Xa as SkeletonItem,
107
+ Za as SkeletonTemplate,
108
+ _a as Spacer,
109
+ $a as Stack,
110
+ ae as StatusDot,
111
+ ee as StatusIcon,
112
+ se as Steps,
113
+ te as Tab,
114
+ oe as Table,
115
+ re as TableData,
116
+ ce as Tabs,
117
+ ne as Tag,
118
+ ue as Td,
119
+ ie as Text,
120
+ de as Th,
121
+ le as Timeline,
122
+ pe as ToastContainer,
123
+ be as TokenProvider,
124
+ ge as Toolbar,
125
+ me as Tooltip,
126
+ Se as Tr,
127
+ Ie as Trans,
128
+ ke as computeFullname,
129
+ Te as createApp,
130
+ De as createRoute,
131
+ Re as createTypedRoute,
132
+ ye as currencies,
133
+ Ce as currencyInputSelectOptions,
134
+ he as downloadJsonAsFile,
135
+ Ae as encodeExtras,
136
+ Pe as flatSelectValues,
137
+ He as formatCentsToCurrency,
138
+ Fe as formatDate,
139
+ fe as formatDateRange,
140
+ ve as formatDateWithPredicate,
141
+ Be as formatDisplayName,
142
+ Le as formatResourceName,
143
+ Oe as getAvatarSrcFromRate,
144
+ Ee as getCustomerDisplayStatus,
145
+ Ne as getCustomerStatusName,
146
+ Ge as getDefaultValueFromFlatten,
147
+ Me as getEventDateInfo,
148
+ we as getIsoDateAtDayEdge,
149
+ Ve as getIsoDateAtDaysBefore,
150
+ xe as getOrderDisplayStatus,
151
+ We as getOrderFulfillmentStatusName,
152
+ Je as getOrderPaymentStatusName,
153
+ Ue as getOrderStatusName,
154
+ qe as getOrderTransactionName,
155
+ Ye as getParcelTrackingDetail,
156
+ je as getParcelTrackingDetails,
157
+ ze as getPaymentMethodLogoSrc,
158
+ Ke as getPromotionDisplayStatus,
159
+ Qe as getResourceAddressFormFieldsSchema,
160
+ Xe as getResourceEndpoint,
161
+ Ze as getReturnDisplayStatus,
162
+ _e as getReturnStatusName,
163
+ $e as getShipmentDisplayStatus,
164
+ as as getShipmentRate,
165
+ es as getShipmentRates,
166
+ ss as getShipmentStatusName,
167
+ ts as getStockTransferDisplayStatus,
168
+ os as getStockTransferStatusName,
169
+ rs as getUnitOfWeightName,
170
+ cs as getUnitsOfWeightForSelect,
171
+ ns as goBack,
172
+ us as hasBeenPurchased,
173
+ is as hasSingleTracking,
174
+ ds as i18nLocales,
175
+ ls as isAttachmentValidNote,
176
+ ps as isDateValid,
177
+ bs as isGroupedSelectValues,
178
+ gs as isMock,
179
+ ms as isMockedId,
180
+ Ss as isMultiValueSelected,
181
+ Is as isSingleValueSelected,
182
+ ks as makeDateYearsRange,
183
+ Ts as maskGiftCardCode,
184
+ Ds as navigateTo,
185
+ Rs as orderTransactionIsAnAsyncCapture,
186
+ ys as referenceOrigins,
187
+ Cs as removeMillisecondsFromIsoDate,
188
+ hs as setApiFormErrors,
189
+ As as sortAndGroupByDate,
190
+ Ps as t,
191
+ Hs as timeSeparator,
192
+ Fs as toast,
193
+ fs as useAppLinking,
194
+ vs as useClickAway,
195
+ Bs as useCoreApi,
196
+ Ls as useCoreSdkProvider,
197
+ Os as useDelayShow,
198
+ Es as useEditMetadataOverlay,
199
+ Ns as useEditTagsOverlay,
200
+ Gs as useInputResourceGroupOverlay,
201
+ Ms as useIsChanged,
202
+ ws as useOnBlurFromContainer,
203
+ Vs as useOverlay,
204
+ xs as useResourceAddressOverlay,
205
+ Ws as useResourceFilters,
206
+ Js as useResourceList,
207
+ Us as useTagManager,
208
+ qs as useTokenProvider,
209
+ Ys as useTranslation,
210
+ js as useValidationFeedback,
211
+ zs as withSkeletonTemplate
208
212
  };
@@ -0,0 +1,120 @@
1
+ "use client";
2
+ import { c as p, t as D, m as N, a as g } from "./main-ClKWD_hr.js";
3
+ function W(t, e) {
4
+ const n = () => p(e == null ? void 0 : e.in, NaN), a = I(t);
5
+ let s;
6
+ if (a.date) {
7
+ const i = x(a.date, 2);
8
+ s = Y(i.restDateString, i.year);
9
+ }
10
+ if (!s || isNaN(+s)) return n();
11
+ const l = +s;
12
+ let c = 0, u;
13
+ if (a.time && (c = w(a.time), isNaN(c)))
14
+ return n();
15
+ if (a.timezone) {
16
+ if (u = y(a.timezone), isNaN(u)) return n();
17
+ } else {
18
+ const i = new Date(l + c), d = D(0, e == null ? void 0 : e.in);
19
+ return d.setFullYear(
20
+ i.getUTCFullYear(),
21
+ i.getUTCMonth(),
22
+ i.getUTCDate()
23
+ ), d.setHours(
24
+ i.getUTCHours(),
25
+ i.getUTCMinutes(),
26
+ i.getUTCSeconds(),
27
+ i.getUTCMilliseconds()
28
+ ), d;
29
+ }
30
+ return D(l + c + u, e == null ? void 0 : e.in);
31
+ }
32
+ const f = {
33
+ dateTimeDelimiter: /[T ]/,
34
+ timeZoneDelimiter: /[Z ]/i,
35
+ timezone: /([Z+-].*)$/
36
+ }, U = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/, h = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/, C = /^([+-])(\d{2})(?::?(\d{2}))?$/;
37
+ function I(t) {
38
+ const e = {}, n = t.split(f.dateTimeDelimiter);
39
+ let r;
40
+ if (n.length > 2)
41
+ return e;
42
+ if (/:/.test(n[0]) ? r = n[0] : (e.date = n[0], r = n[1], f.timeZoneDelimiter.test(e.date) && (e.date = t.split(f.timeZoneDelimiter)[0], r = t.substr(
43
+ e.date.length,
44
+ t.length
45
+ ))), r) {
46
+ const a = f.timezone.exec(r);
47
+ a ? (e.time = r.replace(a[1], ""), e.timezone = a[1]) : e.time = r;
48
+ }
49
+ return e;
50
+ }
51
+ function x(t, e) {
52
+ const n = new RegExp(
53
+ "^(?:(\\d{4}|[+-]\\d{" + (4 + e) + "})|(\\d{2}|[+-]\\d{" + (2 + e) + "})$)"
54
+ ), r = t.match(n);
55
+ if (!r) return { year: NaN, restDateString: "" };
56
+ const a = r[1] ? parseInt(r[1]) : null, s = r[2] ? parseInt(r[2]) : null;
57
+ return {
58
+ year: s === null ? a : s * 100,
59
+ restDateString: t.slice((r[1] || r[2]).length)
60
+ };
61
+ }
62
+ function Y(t, e) {
63
+ if (e === null) return /* @__PURE__ */ new Date(NaN);
64
+ const n = t.match(U);
65
+ if (!n) return /* @__PURE__ */ new Date(NaN);
66
+ const r = !!n[4], a = o(n[1]), s = o(n[2]) - 1, l = o(n[3]), c = o(n[4]), u = o(n[5]) - 1;
67
+ if (r)
68
+ return Z(e, c, u) ? z(e, c, u) : /* @__PURE__ */ new Date(NaN);
69
+ {
70
+ const i = /* @__PURE__ */ new Date(0);
71
+ return !M(e, s, l) || !O(e, a) ? /* @__PURE__ */ new Date(NaN) : (i.setUTCFullYear(e, s, Math.max(a, l)), i);
72
+ }
73
+ }
74
+ function o(t) {
75
+ return t ? parseInt(t) : 1;
76
+ }
77
+ function w(t) {
78
+ const e = t.match(h);
79
+ if (!e) return NaN;
80
+ const n = m(e[1]), r = m(e[2]), a = m(e[3]);
81
+ return k(n, r, a) ? n * N + r * g + a * 1e3 : NaN;
82
+ }
83
+ function m(t) {
84
+ return t && parseFloat(t.replace(",", ".")) || 0;
85
+ }
86
+ function y(t) {
87
+ if (t === "Z") return 0;
88
+ const e = t.match(C);
89
+ if (!e) return 0;
90
+ const n = e[1] === "+" ? -1 : 1, r = parseInt(e[2]), a = e[3] && parseInt(e[3]) || 0;
91
+ return R(r, a) ? n * (r * N + a * g) : NaN;
92
+ }
93
+ function z(t, e, n) {
94
+ const r = /* @__PURE__ */ new Date(0);
95
+ r.setUTCFullYear(t, 0, 4);
96
+ const a = r.getUTCDay() || 7, s = (e - 1) * 7 + n + 1 - a;
97
+ return r.setUTCDate(r.getUTCDate() + s), r;
98
+ }
99
+ const F = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
100
+ function T(t) {
101
+ return t % 400 === 0 || t % 4 === 0 && t % 100 !== 0;
102
+ }
103
+ function M(t, e, n) {
104
+ return e >= 0 && e <= 11 && n >= 1 && n <= (F[e] || (T(t) ? 29 : 28));
105
+ }
106
+ function O(t, e) {
107
+ return e >= 1 && e <= (T(t) ? 366 : 365);
108
+ }
109
+ function Z(t, e, n) {
110
+ return e >= 1 && e <= 53 && n >= 0 && n <= 6;
111
+ }
112
+ function k(t, e, n) {
113
+ return t === 24 ? e === 0 && n === 0 : n >= 0 && n < 60 && e >= 0 && e < 60 && t >= 0 && t < 25;
114
+ }
115
+ function R(t, e) {
116
+ return e >= 0 && e <= 59;
117
+ }
118
+ export {
119
+ W as p
120
+ };