@myrjfa/state 2.3.5 → 2.3.6

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/LICENSE CHANGED
@@ -1,201 +1,201 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS
177
-
178
- APPENDIX: How to apply the Apache License to your work.
179
-
180
- To apply the Apache License to your work, attach the following
181
- boilerplate notice, with the fields enclosed by brackets "[]"
182
- replaced with your own identifying information. (Don't include
183
- the brackets!) The text should be enclosed in the appropriate
184
- comment syntax for the file format. We also recommend that a
185
- file or class name and description of purpose be included on the
186
- same "printed page" as the copyright notice for easier
187
- identification within third-party archives.
188
-
189
- Copyright [yyyy] [name of copyright owner]
190
-
191
- Licensed under the Apache License, Version 2.0 (the "License");
192
- you may not use this file except in compliance with the License.
193
- You may obtain a copy of the License at
194
-
195
- http://www.apache.org/licenses/LICENSE-2.0
196
-
197
- Unless required by applicable law or agreed to in writing, software
198
- distributed under the License is distributed on an "AS IS" BASIS,
199
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
- See the License for the specific language governing permissions and
201
- limitations under the License.
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # frontend-state
2
- this is shared state management, api calls and utils library for myrjfa-frontend
3
-
1
+ # frontend-state
2
+ this is shared state management, api calls and utils library for myrjfa-frontend
3
+
4
4
  ![Build & dist](https://github.com/Trippeaze/frontend-state/actions/workflows/build-dist.yml/badge.svg)
5
5
 
6
6
  ## AI And Team Onboarding
@@ -14,6 +14,7 @@ export declare function usePersistentDraftState<T>({ key, initialState, shouldPe
14
14
  {
15
15
  saveNow: () => void;
16
16
  clear: () => void;
17
+ isHydrated: boolean;
17
18
  }
18
19
  ];
19
20
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"usePersistentDraftState.d.ts","sourceRoot":"","sources":["../../src/hooks/usePersistentDraftState.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAuB,MAAM,OAAO,CAAC;AAEtE,KAAK,2BAA2B,CAAC,CAAC,IAAI;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,CAAC,CAAC;IAChB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,CAAC;IACtC,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC,CAAC;AAEF,wBAAgB,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,CAK3D;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,QAGjD;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,QAGrC;AAED,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,EACzC,GAAG,EACH,YAAY,EACZ,aAAa,EACb,WAAW,GACZ,EAAE,2BAA2B,CAAC,CAAC,CAAC,GAAG;IAClC,CAAC;IACD,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IAC3B;QAAE,OAAO,EAAE,MAAM,IAAI,CAAC;QAAC,KAAK,EAAE,MAAM,IAAI,CAAA;KAAE;CAC3C,CA2BA"}
1
+ {"version":3,"file":"usePersistentDraftState.d.ts","sourceRoot":"","sources":["../../src/hooks/usePersistentDraftState.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAA+B,MAAM,OAAO,CAAC;AAE9E,KAAK,2BAA2B,CAAC,CAAC,IAAI;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,CAAC,CAAC;IAChB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,CAAC;IACtC,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC,CAAC;AAEF,wBAAgB,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,CAK3D;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,QAGjD;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,QAGrC;AAED,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,EACzC,GAAG,EACH,YAAY,EACZ,aAAa,EACb,WAAW,GACZ,EAAE,2BAA2B,CAAC,CAAC,CAAC,GAAG;IAClC,CAAC;IACD,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IAC3B;QAAE,OAAO,EAAE,MAAM,IAAI,CAAC;QAAC,KAAK,EAAE,MAAM,IAAI,CAAC;QAAC,UAAU,EAAE,OAAO,CAAA;KAAE;CAChE,CAsCA"}
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { useEffect, useState } from "react";
2
+ import { useEffect, useRef, useState } from "react";
3
3
  export function loadDraft(key) {
4
4
  if (typeof window === "undefined")
5
5
  return null;
@@ -20,6 +20,12 @@ export function clearDraft(key) {
20
20
  }
21
21
  export function usePersistentDraftState({ key, initialState, shouldPersist, onLoadError, }) {
22
22
  const [state, setState] = useState(initialState);
23
+ const [hydratedKey, setHydratedKey] = useState(null);
24
+ const isHydrated = hydratedKey === key;
25
+ const onLoadErrorRef = useRef(onLoadError);
26
+ useEffect(() => {
27
+ onLoadErrorRef.current = onLoadError;
28
+ }, [onLoadError]);
23
29
  useEffect(() => {
24
30
  try {
25
31
  const saved = loadDraft(key);
@@ -28,20 +34,26 @@ export function usePersistentDraftState({ key, initialState, shouldPersist, onLo
28
34
  }
29
35
  }
30
36
  catch (error) {
31
- onLoadError?.(error);
37
+ onLoadErrorRef.current?.(error);
38
+ }
39
+ finally {
40
+ setHydratedKey(key);
32
41
  }
33
- }, [key, onLoadError]);
42
+ }, [key]);
34
43
  useEffect(() => {
44
+ if (!isHydrated)
45
+ return;
35
46
  if (shouldPersist && !shouldPersist(state))
36
47
  return;
37
48
  saveDraft(key, state);
38
- }, [key, shouldPersist, state]);
49
+ }, [isHydrated, key, shouldPersist, state]);
39
50
  return [
40
51
  state,
41
52
  setState,
42
53
  {
43
54
  saveNow: () => saveDraft(key, state),
44
55
  clear: () => clearDraft(key),
56
+ isHydrated,
45
57
  },
46
58
  ];
47
59
  }
@@ -321,13 +321,13 @@ export declare function updateSocialLink(type: SocialPlatformType, url: string,
321
321
  message?: string;
322
322
  error?: string;
323
323
  }>;
324
- export declare function getUsersWithRole(role: string): Promise<{
324
+ export declare function getOpportunityObservers(): Promise<{
325
325
  success: boolean;
326
326
  message?: string;
327
327
  error?: string;
328
328
  observers: any[];
329
329
  }>;
330
- export declare function getVariableUserData(role: string): Promise<{
330
+ export declare function getVariableUserData(accountType: "user" | "host"): Promise<{
331
331
  success: boolean;
332
332
  message?: string;
333
333
  error?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/lib/actions.ts"],"names":[],"mapp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AAM,GAAG,MAAM,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAS3K;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAS5J"}
@@ -985,12 +985,9 @@ export async function updateSocialLink(type, url, role) {
985
985
  };
986
986
  }
987
987
  }
988
- export async function getUsersWithRole(role) {
988
+ export async function getOpportunityObservers() {
989
989
  try {
990
- const endpoint = role === "admin" || role === "observer"
991
- ? `/admin/allUsers`
992
- : `/${role}s/allUsers`;
993
- const data = await get(endpoint);
990
+ const data = await get(`/admin/allUsers`);
994
991
  return {
995
992
  success: true,
996
993
  message: data.message,
@@ -1006,9 +1003,9 @@ export async function getUsersWithRole(role) {
1006
1003
  };
1007
1004
  }
1008
1005
  }
1009
- export async function getVariableUserData(role) {
1006
+ export async function getVariableUserData(accountType) {
1010
1007
  try {
1011
- const endpoint = role == "admin" ? `/admin/variables` : `/${role}s/variables`;
1008
+ const endpoint = accountType === "host" ? `/hosts/variables` : `/users/variables`;
1012
1009
  const data = await get(endpoint);
1013
1010
  return {
1014
1011
  success: true,
@@ -150,7 +150,7 @@ export declare function getHostEarningsBookings(params?: {
150
150
  export declare function updateListingAvailability(id: string, data: {
151
151
  category: string;
152
152
  dates: string[];
153
- action: "block" | "unblock" | "set-inventory-blocks" | "add-inventory-blocks";
153
+ action: "block" | "unblock" | "set-inventory-blocks" | "add-inventory-blocks" | "set-date-capacity";
154
154
  count?: number;
155
155
  }): Promise<{
156
156
  success: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"hostDashboardActions.d.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
  };
15
- export declare const STAFF_DASHBOARD_PERMISSIONS: readonly ["roles.read", "roles.manage", "permissions.read", "permissions.manage", "users.read", "users.manage", "hosts.read", "hosts.manage", "staff.read", "staff.manage", "listings.read", "listings.moderate", "content.moderate", "opportunities.applications.read", "bookings.read.all", "bookings.manage.all", "payouts.read", "payouts.record", "platform.settings.read", "platform.settings.manage", "discounts.manage.platform", "partner_programs.read", "partner_programs.manage", "rewards.read.all", "rewards.manage", "memberships.read.all", "memberships.manage", "host_performance.read.all", "host_performance.manage", "verification.read", "verification.manage", "support.contacts.read", "audit.read", "developer.diagnostics.read"];
16
- export declare const MODERATION_DASHBOARD_PERMISSIONS: readonly ["listings.read", "listings.moderate", "content.moderate"];
15
+ export declare const STAFF_DASHBOARD_PERMISSIONS: readonly ["roles.read", "roles.manage", "permissions.read", "permissions.manage", "users.read", "users.manage", "hosts.read", "hosts.manage", "staff.read", "staff.manage", "listings.read", "listings.create", "listings.moderate", "content.moderate", "opportunities.applications.read", "bookings.read.all", "bookings.manage.all", "payouts.read", "payouts.record", "platform.settings.read", "platform.settings.manage", "discounts.manage.platform", "partner_programs.read", "partner_programs.manage", "rewards.read.all", "rewards.manage", "memberships.read.all", "memberships.manage", "host_performance.read.all", "host_performance.manage", "verification.read", "verification.manage", "support.contacts.read", "audit.read", "developer.diagnostics.read", "database.collections.read"];
16
+ export declare const LISTING_MODERATION_DASHBOARD_PERMISSIONS: readonly ["listings.moderate"];
17
+ export declare const CONTENT_MODERATION_DASHBOARD_PERMISSIONS: readonly ["content.moderate"];
18
+ export declare const MODERATION_DASHBOARD_PERMISSIONS: readonly ["listings.moderate", "content.moderate"];
17
19
  export declare const PAYOUT_DASHBOARD_PERMISSIONS: readonly ["payouts.read", "payouts.record"];
18
20
  export declare const PLATFORM_DASHBOARD_PERMISSIONS: readonly ["platform.settings.read", "platform.settings.manage", "discounts.manage.platform", "partner_programs.read", "partner_programs.manage", "rewards.read.all", "rewards.manage", "memberships.read.all", "memberships.manage", "host_performance.read.all", "host_performance.manage"];
19
21
  export declare const AUTHORIZATION_DASHBOARD_PERMISSIONS: readonly ["roles.read", "roles.manage", "permissions.read", "permissions.manage"];
20
22
  export declare const ADMIN_ROUTE_PERMISSION_GROUPS: {
21
23
  readonly applications: readonly ["opportunities.applications.read"];
22
24
  readonly authorization: readonly ["roles.read", "roles.manage", "permissions.read", "permissions.manage"];
23
- readonly moderation: readonly ["listings.read", "listings.moderate", "content.moderate"];
25
+ readonly listingModeration: readonly ["listings.moderate"];
26
+ readonly contentModeration: readonly ["content.moderate"];
24
27
  readonly payouts: readonly ["payouts.read", "payouts.record"];
25
28
  readonly platform: readonly ["platform.settings.read", "platform.settings.manage", "discounts.manage.platform", "partner_programs.read", "partner_programs.manage", "rewards.read.all", "rewards.manage", "memberships.read.all", "memberships.manage", "host_performance.read.all", "host_performance.manage"];
26
29
  readonly registrations: readonly ["bookings.read.all", "bookings.manage.all"];
@@ -103,6 +106,8 @@ export declare function canCreateListingForHost(actor: PermissionAwareActor | nu
103
106
  export declare function canAccessListingEditor(actor: PermissionAwareActor | null | undefined): boolean;
104
107
  export declare function canAccessOpportunityApplicationReview(actor: PermissionAwareActor | null | undefined): boolean;
105
108
  export declare function getOpportunityApplicationApprovalStatus(actor: PermissionAwareActor | null | undefined): "adminApproved" | "approved";
106
- export declare function getAdminDashboardRoutePermissions(pathname: string): readonly ["roles.read", "roles.manage", "permissions.read", "permissions.manage", "users.read", "users.manage", "hosts.read", "hosts.manage", "staff.read", "staff.manage", "listings.read", "listings.moderate", "content.moderate", "opportunities.applications.read", "bookings.read.all", "bookings.manage.all", "payouts.read", "payouts.record", "platform.settings.read", "platform.settings.manage", "discounts.manage.platform", "partner_programs.read", "partner_programs.manage", "rewards.read.all", "rewards.manage", "memberships.read.all", "memberships.manage", "host_performance.read.all", "host_performance.manage", "verification.read", "verification.manage", "support.contacts.read", "audit.read", "developer.diagnostics.read"] | readonly ["listings.read", "listings.moderate", "content.moderate"] | readonly ["payouts.read", "payouts.record"] | readonly ["roles.read", "roles.manage", "permissions.read", "permissions.manage"] | readonly ["opportunities.applications.read"] | readonly ["bookings.read.all", "bookings.manage.all"];
109
+ export declare function getAdminDashboardRoutePermissions(pathname: string): readonly ["listings.moderate"] | readonly ["content.moderate"] | readonly ["payouts.read", "payouts.record"] | readonly ["roles.read", "roles.manage", "permissions.read", "permissions.manage"] | readonly ["opportunities.applications.read"] | readonly ["bookings.read.all", "bookings.manage.all"] | readonly [];
107
110
  export declare function hasAdminDashboardRouteAccess(actor: PermissionAwareActor | null | undefined, pathname: string): boolean;
111
+ export declare function getHostDashboardRoutePermissions(pathname: string): readonly ["listings.moderate"] | readonly ["opportunities.applications.read"] | readonly ["bookings.read.all", "bookings.manage.all"] | readonly [] | readonly ["listings.create"];
112
+ export declare function hasHostDashboardRouteAccess(actor: PermissionAwareActor | null | undefined, pathname: string): boolean;
108
113
  //# sourceMappingURL=authorization.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"authorization.d.ts","sourceRoot":"","sources":["../../../src/lib/models/authorization.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,oFAQtB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;AAE9E,eAAO,MAAM,yBAAyB,+jCAkD5B,CAAC;AAEX,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;AAE1F,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,MAAM,CAAC;AAC9C,MAAM,MAAM,WAAW,GAAG,eAAe,GAAG,OAAO,CAAC;AAEpD,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CA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CAAC,KAAK,EAAE,oBAAoB,GAAG,IAAI,GAAG,SAAS,WAKrF;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,oBAAoB,GAAG,IAAI,GAAG,SAAS,WAEpF;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,oBAAoB,GAAG,IAAI,GAAG,SAAS,8DAIpF;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,oBAAoB,GAAG,IAAI,GAAG,SAAS,WAM9E;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,oBAAoB,GAAG,IAAI,GAAG,SAAS,WAMrF;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,oBAAoB,GAAG,IAAI,GAAG,SAAS,WAMpF;AAED,wBAAgB,qCAAqC,CACnD,KAAK,EAAE,oBAAoB,GAAG,IAAI,GAAG,SAAS,WAO/C;AAED,wBAAgB,uCAAuC,CACrD,KAAK,EAAE,oBAAoB,GAAG,IAAI,GAAG,SAAS,gCAK/C;AAED,wBAAgB,iCAAiC,CAAC,QAAQ,EAAE,MAAM,yTAyCjE;AAED,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,oBAAoB,GAAG,IAAI,GAAG,SAAS,EAC9C,QAAQ,EAAE,MAAM,WAOjB;AAED,wBAAgB,gCAAgC,CAAC,QAAQ,EAAE,MAAM,sLAyBhE;AAED,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,oBAAoB,GAAG,IAAI,GAAG,SAAS,EAC9C,QAAQ,EAAE,MAAM,WAKjB"}
@@ -70,6 +70,7 @@ export const STAFF_DASHBOARD_PERMISSIONS = [
70
70
  "staff.read",
71
71
  "staff.manage",
72
72
  "listings.read",
73
+ "listings.create",
73
74
  "listings.moderate",
74
75
  "content.moderate",
75
76
  "opportunities.applications.read",
@@ -93,11 +94,13 @@ export const STAFF_DASHBOARD_PERMISSIONS = [
93
94
  "support.contacts.read",
94
95
  "audit.read",
95
96
  "developer.diagnostics.read",
97
+ "database.collections.read",
96
98
  ];
99
+ export const LISTING_MODERATION_DASHBOARD_PERMISSIONS = ["listings.moderate"];
100
+ export const CONTENT_MODERATION_DASHBOARD_PERMISSIONS = ["content.moderate"];
97
101
  export const MODERATION_DASHBOARD_PERMISSIONS = [
98
- "listings.read",
99
- "listings.moderate",
100
- "content.moderate",
102
+ ...LISTING_MODERATION_DASHBOARD_PERMISSIONS,
103
+ ...CONTENT_MODERATION_DASHBOARD_PERMISSIONS,
101
104
  ];
102
105
  export const PAYOUT_DASHBOARD_PERMISSIONS = [
103
106
  "payouts.read",
@@ -125,7 +128,8 @@ export const AUTHORIZATION_DASHBOARD_PERMISSIONS = [
125
128
  export const ADMIN_ROUTE_PERMISSION_GROUPS = {
126
129
  applications: ["opportunities.applications.read"],
127
130
  authorization: AUTHORIZATION_DASHBOARD_PERMISSIONS,
128
- moderation: MODERATION_DASHBOARD_PERMISSIONS,
131
+ listingModeration: LISTING_MODERATION_DASHBOARD_PERMISSIONS,
132
+ contentModeration: CONTENT_MODERATION_DASHBOARD_PERMISSIONS,
129
133
  payouts: PAYOUT_DASHBOARD_PERMISSIONS,
130
134
  platform: PLATFORM_DASHBOARD_PERMISSIONS,
131
135
  registrations: ["bookings.read.all", "bookings.manage.all"],
@@ -149,12 +153,7 @@ export function isTravellerAccount(actor) {
149
153
  getActorRole(actor) === "user");
150
154
  }
151
155
  export function isStaffSession(actor) {
152
- if (!actor)
153
- return false;
154
- if (actor.accountType === "staff")
155
- return true;
156
- const role = String(actor.role || "").trim().toLowerCase();
157
- return ["admin", "hr", "sales", "developer", "customer_support"].includes(role) || Boolean(actor.staffProfileId);
156
+ return Boolean(actor?.accountType === "staff" && actor.staffProfileId);
158
157
  }
159
158
  export function isHostSession(actor) {
160
159
  return Boolean(actor &&
@@ -182,7 +181,7 @@ export function hasRole(actor, role) {
182
181
  export function hasPermission(actor, permission) {
183
182
  const permissionKey = String(permission || "").trim().toLowerCase();
184
183
  return Boolean(permissionKey &&
185
- (hasRole(actor, "admin") || getActorPermissions(actor).includes(permissionKey)));
184
+ getActorPermissions(actor).includes(permissionKey));
186
185
  }
187
186
  export function hasAnyPermission(actor, permissions) {
188
187
  return permissions.some((permission) => hasPermission(actor, permission));
@@ -191,13 +190,14 @@ export function hasAllPermissions(actor, permissions) {
191
190
  return permissions.every((permission) => hasPermission(actor, permission));
192
191
  }
193
192
  export function hasStaffDashboardAccess(actor) {
194
- return isStaffSession(actor);
193
+ return Boolean(isStaffSession(actor) &&
194
+ hasAnyPermission(actor, STAFF_DASHBOARD_PERMISSIONS));
195
195
  }
196
196
  export function hasHostDashboardAccess(actor) {
197
197
  return isHostSession(actor) && hasRole(actor, "host");
198
198
  }
199
199
  export function getActorDashboardRoute(actor) {
200
- if (hasStaffDashboardAccess(actor))
200
+ if (isStaffSession(actor))
201
201
  return "/dashboard/staff";
202
202
  if (isHostSession(actor))
203
203
  return "/dashboard/host";
@@ -241,7 +241,7 @@ export function getAdminDashboardRoutePermissions(pathname) {
241
241
  if (path.startsWith("/dashboard/staff/payouts") || path.startsWith("/dashboard/admin/payouts"))
242
242
  return ADMIN_ROUTE_PERMISSION_GROUPS.payouts;
243
243
  if (path.startsWith("/dashboard/staff/host-listings") || path.startsWith("/dashboard/admin/host-listings")) {
244
- return ADMIN_ROUTE_PERMISSION_GROUPS.moderation;
244
+ return ADMIN_ROUTE_PERMISSION_GROUPS.listingModeration;
245
245
  }
246
246
  if ([
247
247
  "/dashboard/admin/stays",
@@ -250,24 +250,53 @@ export function getAdminDashboardRoutePermissions(pathname) {
250
250
  "/dashboard/admin/packages",
251
251
  "/dashboard/admin/events",
252
252
  "/dashboard/admin/opportunities",
253
- "/dashboard/admin/blogs",
254
253
  "/dashboard/staff/stays",
255
254
  "/dashboard/staff/adventures",
256
255
  "/dashboard/staff/rentals",
257
256
  "/dashboard/staff/packages",
258
257
  "/dashboard/staff/events",
259
258
  "/dashboard/staff/opportunities",
260
- "/dashboard/staff/blogs",
261
259
  ].some((prefix) => path.startsWith(prefix))) {
262
- return ADMIN_ROUTE_PERMISSION_GROUPS.moderation;
260
+ return ADMIN_ROUTE_PERMISSION_GROUPS.listingModeration;
261
+ }
262
+ if (path.startsWith("/dashboard/admin/blogs") ||
263
+ path.startsWith("/dashboard/staff/blogs")) {
264
+ return ADMIN_ROUTE_PERMISSION_GROUPS.contentModeration;
263
265
  }
264
- return STAFF_DASHBOARD_PERMISSIONS;
266
+ return [];
265
267
  }
266
268
  export function hasAdminDashboardRouteAccess(actor, pathname) {
267
269
  if (!isStaffSession(actor))
268
270
  return false;
269
271
  if (/^\/dashboard\/(staff|admin)(\/overview)?\/?$/.test(pathname.toLowerCase())) {
270
- return true;
272
+ return hasStaffDashboardAccess(actor);
271
273
  }
272
274
  return hasAnyPermission(actor, getAdminDashboardRoutePermissions(pathname));
273
275
  }
276
+ export function getHostDashboardRoutePermissions(pathname) {
277
+ const path = String(pathname || "").toLowerCase().split("?")[0] || "";
278
+ if (/\/dashboard\/host\/(?:stays|adventures|rentals|packages|events|guides|opportunities)\/create\/?$/.test(path)) {
279
+ return ["listings.create"];
280
+ }
281
+ if (/\/dashboard\/host\/(?:stays|adventures|rentals|packages|events|guides|opportunities)\/[^/]+\/edit\/?$/.test(path) ||
282
+ /\/dashboard\/host\/stays\/[^/]+\/manage\/?$/.test(path) ||
283
+ /\/dashboard\/host\/stays\/[^/]+\/rooms\/(?:create|[^/]+\/edit)\/?$/.test(path) ||
284
+ path.startsWith("/dashboard/host/listings/")) {
285
+ return ["listings.moderate"];
286
+ }
287
+ if (path.startsWith("/dashboard/host/applications") ||
288
+ /\/dashboard\/host\/opportunities\/[^/]+\/applicants\/?$/.test(path)) {
289
+ return ["opportunities.applications.read"];
290
+ }
291
+ if (path.startsWith("/dashboard/host/bookings")) {
292
+ return ["bookings.read.all", "bookings.manage.all"];
293
+ }
294
+ return [];
295
+ }
296
+ export function hasHostDashboardRouteAccess(actor, pathname) {
297
+ if (isHostSession(actor))
298
+ return true;
299
+ if (!isStaffSession(actor))
300
+ return false;
301
+ return hasAnyPermission(actor, getHostDashboardRoutePermissions(pathname));
302
+ }
@@ -292,6 +292,18 @@ export declare const TravelPackageSchema: z.ZodObject<{
292
292
  date: string | Date;
293
293
  count: number;
294
294
  }>, "many">>;
295
+ dateCapacityOverrides: z.ZodOptional<z.ZodArray<z.ZodObject<{
296
+ date: z.ZodUnion<[z.ZodDate, z.ZodString]>;
297
+ capacity: z.ZodNumber;
298
+ }, "strip", z.ZodTypeAny, {
299
+ date: string | Date;
300
+ capacity: number;
301
+ }, {
302
+ date: string | Date;
303
+ capacity: number;
304
+ }>, "many">>;
305
+ availableDateKeys: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
306
+ bookedDateCounts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
295
307
  thingsToDo: z.ZodArray<z.ZodString, "many">;
296
308
  thingsNotToDo: z.ZodArray<z.ZodString, "many">;
297
309
  thingsToCarry: z.ZodArray<z.ZodString, "many">;
@@ -718,6 +730,12 @@ export declare const TravelPackageSchema: z.ZodObject<{
718
730
  date: string | Date;
719
731
  count: number;
720
732
  }[] | undefined;
733
+ dateCapacityOverrides?: {
734
+ date: string | Date;
735
+ capacity: number;
736
+ }[] | undefined;
737
+ availableDateKeys?: string[] | undefined;
738
+ bookedDateCounts?: Record<string, number> | undefined;
721
739
  activities?: {
722
740
  type: "optional" | "compulsory";
723
741
  name: string;
@@ -879,6 +897,12 @@ export declare const TravelPackageSchema: z.ZodObject<{
879
897
  date: string | Date;
880
898
  count: number;
881
899
  }[] | undefined;
900
+ dateCapacityOverrides?: {
901
+ date: string | Date;
902
+ capacity: number;
903
+ }[] | undefined;
904
+ availableDateKeys?: string[] | undefined;
905
+ bookedDateCounts?: Record<string, number> | undefined;
882
906
  activities?: {
883
907
  type: "optional" | "compulsory";
884
908
  name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"travelPackage.d.ts","sourceRoot":"","sources":["../../../src/lib/models/travelPackage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA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UAAU,EAAE,uBAAuB,GAAG,IAAI,CAAC;IAC3C,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AA+FF,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAMpF"}
@@ -217,6 +217,12 @@ export const TravelPackageSchema = z.object({
217
217
  date: z.union([z.date(), z.string()]),
218
218
  count: z.number(),
219
219
  })).optional(),
220
+ dateCapacityOverrides: z.array(z.object({
221
+ date: z.union([z.date(), z.string()]),
222
+ capacity: z.number(),
223
+ })).optional(),
224
+ availableDateKeys: z.array(z.string()).optional(),
225
+ bookedDateCounts: z.record(z.string(), z.number()).optional(),
220
226
  thingsToDo: z.array(z.string()),
221
227
  thingsNotToDo: z.array(z.string()),
222
228
  thingsToCarry: z.array(z.string()),
@@ -0,0 +1,10 @@
1
+ export declare function packageDateKey(value: string | Date): string;
2
+ export declare function isPackageScheduledDate(entity: any, requestedDate: string | Date): boolean;
3
+ export declare function getPackageBaseCapacityForDate(entity: any, requestedDate: string | Date): number;
4
+ export declare function getPackageAvailableCapacityForDate(entity: any, requestedDate: string | Date, bookedCount?: number): number;
5
+ export declare function buildPackageAvailableDateKeys(entity: any, { horizonDays, fromDate }?: {
6
+ horizonDays?: number;
7
+ fromDate?: string | Date;
8
+ }): any;
9
+ export declare function resolvePackageBookingDateKey(availableDateKeys: Array<string | Date>, currentDate?: string | Date | null, preferredDate?: string | Date | null): string;
10
+ //# sourceMappingURL=packageAvailability.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"packageAvailability.d.ts","sourceRoot":"","sources":["../../src/lib/packageAvailability.ts"],"names":[],"mappings":"AAEA,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,UAYlD;AAiBD,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,GAAG,IAAI,WA0B/E;AASD,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,GAAG,IAAI,UAKtF;AAED,wBAAgB,kCAAkC,CAChD,MAAM,EAAE,GAAG,EACX,aAAa,EAAE,MAAM,GAAG,IAAI,EAC5B,WAAW,SAAI,UAchB;AAED,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,GAAG,EACX,EAAE,WAAiB,EAAE,QAAqB,EAAE,GAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAO,OAgBtG;AAED,wBAAgB,4BAA4B,CAC1C,iBAAiB,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,EACvC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,EAClC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,UAUrC"}
@@ -0,0 +1,102 @@
1
+ const DAY_MS = 24 * 60 * 60 * 1000;
2
+ export function packageDateKey(value) {
3
+ if (typeof value === "string") {
4
+ const match = value.match(/^(\d{4}-\d{2}-\d{2})/);
5
+ if (match)
6
+ return match[1];
7
+ }
8
+ const date = new Date(value);
9
+ if (Number.isNaN(date.getTime()))
10
+ return "";
11
+ return [
12
+ date.getFullYear(),
13
+ String(date.getMonth() + 1).padStart(2, "0"),
14
+ String(date.getDate()).padStart(2, "0"),
15
+ ].join("-");
16
+ }
17
+ function toUtcDay(value) {
18
+ const key = value ? packageDateKey(value) : "";
19
+ return key ? new Date(`${key}T12:00:00.000Z`) : null;
20
+ }
21
+ function addMonthsClamped(date, months) {
22
+ const next = new Date(date);
23
+ const day = next.getUTCDate();
24
+ next.setUTCDate(1);
25
+ next.setUTCMonth(next.getUTCMonth() + months);
26
+ const lastDay = new Date(Date.UTC(next.getUTCFullYear(), next.getUTCMonth() + 1, 0)).getUTCDate();
27
+ next.setUTCDate(Math.min(day, lastDay));
28
+ return next;
29
+ }
30
+ export function isPackageScheduledDate(entity, requestedDate) {
31
+ const start = toUtcDay(entity?.availableFrom);
32
+ const requested = toUtcDay(requestedDate);
33
+ if (!start || !requested || requested < start)
34
+ return false;
35
+ const frequency = String(entity?.frequency || "weekly").toLowerCase();
36
+ const dayDifference = Math.round((requested.getTime() - start.getTime()) / DAY_MS);
37
+ const intervalDays = frequency === "daily" ? 1 :
38
+ frequency === "weekly" ? 7 :
39
+ frequency === "bi-weekly" || frequency === "biweekly" ? 14 :
40
+ frequency === "custom" ? Math.max(1, Number(entity?.customFrequencyDays) || 1) :
41
+ null;
42
+ if (intervalDays)
43
+ return dayDifference % intervalDays === 0;
44
+ if (frequency === "monthly" || frequency === "yearly") {
45
+ const monthDifference = (requested.getUTCFullYear() - start.getUTCFullYear()) * 12 +
46
+ requested.getUTCMonth() - start.getUTCMonth();
47
+ const intervalMonths = frequency === "yearly" ? 12 : 1;
48
+ return monthDifference >= 0 &&
49
+ monthDifference % intervalMonths === 0 &&
50
+ packageDateKey(addMonthsClamped(start, monthDifference)) === packageDateKey(requested);
51
+ }
52
+ return dayDifference % 7 === 0;
53
+ }
54
+ function findDateEntry(entries, requestedDate) {
55
+ const key = packageDateKey(requestedDate);
56
+ return (Array.isArray(entries) ? entries : []).find((entry) => packageDateKey(entry?.date) === key);
57
+ }
58
+ export function getPackageBaseCapacityForDate(entity, requestedDate) {
59
+ const maximumCapacity = Math.max(1, Number(entity?.peopleRequired) || 1);
60
+ const override = findDateEntry(entity?.dateCapacityOverrides, requestedDate);
61
+ if (override)
62
+ return Math.max(0, Math.min(maximumCapacity, Number(override.capacity) || 0));
63
+ return isPackageScheduledDate(entity, requestedDate) ? maximumCapacity : 0;
64
+ }
65
+ export function getPackageAvailableCapacityForDate(entity, requestedDate, bookedCount = 0) {
66
+ const key = packageDateKey(requestedDate);
67
+ const blocked = (entity?.blockedDates || []).some((date) => packageDateKey(date) === key);
68
+ if (blocked)
69
+ return 0;
70
+ const manualBlock = findDateEntry(entity?.inventoryBlocks, requestedDate);
71
+ return Math.max(0, getPackageBaseCapacityForDate(entity, requestedDate) -
72
+ Math.max(0, Number(manualBlock?.count) || 0) -
73
+ Math.max(0, Number(bookedCount) || 0));
74
+ }
75
+ export function buildPackageAvailableDateKeys(entity, { horizonDays = 730, fromDate = new Date() } = {}) {
76
+ if (Array.isArray(entity?.availableDateKeys)) {
77
+ return entity.availableDateKeys.map((value) => packageDateKey(value));
78
+ }
79
+ const from = toUtcDay(fromDate);
80
+ if (!from)
81
+ return [];
82
+ const bookedCounts = entity?.bookedDateCounts || {};
83
+ const keys = [];
84
+ for (let offset = 0; offset <= horizonDays; offset += 1) {
85
+ const date = new Date(from);
86
+ date.setUTCDate(date.getUTCDate() + offset);
87
+ const key = packageDateKey(date);
88
+ if (getPackageAvailableCapacityForDate(entity, date, bookedCounts[key] || 0) > 0)
89
+ keys.push(key);
90
+ }
91
+ return keys;
92
+ }
93
+ export function resolvePackageBookingDateKey(availableDateKeys, currentDate, preferredDate) {
94
+ const keys = availableDateKeys.map(packageDateKey).filter(Boolean);
95
+ const currentKey = currentDate ? packageDateKey(currentDate) : "";
96
+ if (currentKey && keys.includes(currentKey))
97
+ return currentKey;
98
+ const preferredKey = preferredDate ? packageDateKey(preferredDate) : "";
99
+ if (preferredKey && keys.includes(preferredKey))
100
+ return preferredKey;
101
+ return keys[0] || "";
102
+ }
@@ -48,6 +48,7 @@ export declare function createRental(formData: FormData): Promise<{
48
48
  }>;
49
49
  export declare function editRental(formData: FormData, slug: string): Promise<{
50
50
  success: boolean;
51
+ slug?: string;
51
52
  message?: string;
52
53
  error?: string;
53
54
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"rentalActions.d.ts","sourceRoot":"","sources":["../../src/lib/rentalActions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAI/D,wBAAsB,cAAc,CAClC,KAAK,CAAC,EAAE,MAAM,EACd,OAAO,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,GAC3E,OAAO,CAAC;IACT,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC,CAmBD;AAED,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;IAChE,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC,CAED;AAED,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IACzD,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC,CAUD;AAED,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1D,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;IAChC,OAAO,CAAC,EAA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,GAChB,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,GAAG,CAAA;CAAE,CAAC,CAY7E;AAED,wBAAsB,YAAY,CAChC,IAAI,EAAE,MAAM,EACZ,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAUjE;AAED,wBAAsB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IACtE,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,GAAG,EAAE,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC,CAOD"}
@@ -92,7 +92,7 @@ export async function rentalsByHost() {
92
92
  export async function createRental(formData) {
93
93
  try {
94
94
  const data = await post(`/rentals/create`, formData);
95
- return { success: true, slug: data.data, message: data.message };
95
+ return { success: true, slug: data.data.slug, message: data.message };
96
96
  }
97
97
  catch (error) {
98
98
  console.error("Failed to create rental:", error);
@@ -102,7 +102,7 @@ export async function createRental(formData) {
102
102
  export async function editRental(formData, slug) {
103
103
  try {
104
104
  const data = await patch(`/rentals/update/${slug}`, formData);
105
- return { success: true, message: data.message };
105
+ return { success: true, slug: data.data.slug, message: data.message };
106
106
  }
107
107
  catch (error) {
108
108
  console.error("Failed to update rental:", error);
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,MAAM,CAAC;AAG7C,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAGrC,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAEnC,eAAO,MAAM,eAAe,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AO,MAAM,YAAY,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,WACO,CAAC;AAEhE,eAAO,MAAM,QAAQ,GAAI,OAAO,MAAM,WAKrC,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,EAAE,SAAS,MAAM,EAAE,MAAM,MAAM,WACE,CAAC;AAE3E,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAcjE;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAElE;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,CAM5D;AAED,eAAO,MAAM,eAAe,GAAI,MAAM,IAAI,WAczC,CAAC;AAEF,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,SAAM,UAItE;AAGD,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,WAAW,EACX,IAAI,GACL,EAAE;IACD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;;;;;;;;;;;;;;;;;;;;;;;EA8BA;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAaxD;AAED,eAAO,MAAM,eAAe,UAA0D,CAAC;AAEvF,wBAAgB,aAAa,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,EAAE,CAanD"}
package/dist/lib/utils.js CHANGED
@@ -5,7 +5,10 @@ import he from "he";
5
5
  import { twMerge } from "tailwind-merge";
6
6
  export const MAX_IMAGE_SIZE_MB = 5;
7
7
  export const MAX_PDF_SIZE_MB = 10;
8
- export const validRoles = ["host", "user", "admin", "hr", "sales", "developer", "customer_support"];
8
+ // Legacy role-cookie fallback is account-surface routing metadata only. Staff
9
+ // sessions require the explicit accountType cookie and must never be inferred
10
+ // from a role name.
11
+ export const validRoles = ["host", "user"];
9
12
  export function cn(...inputs) {
10
13
  return twMerge(clsx(inputs));
11
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myrjfa/state",
3
- "version": "2.3.5",
3
+ "version": "2.3.6",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./dist/*": "./dist/*.js"