@luxfi/ui 8.2.7 → 8.2.9

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 (241) hide show
  1. package/dist/3d-model-viewer.cjs +25 -421
  2. package/dist/3d-model-viewer.js +20 -416
  3. package/dist/accordion.cjs +3 -10
  4. package/dist/accordion.js +2 -10
  5. package/dist/advanced-navigation-bar.cjs +5 -401
  6. package/dist/advanced-navigation-bar.js +5 -401
  7. package/dist/ai-agents.cjs +45 -890
  8. package/dist/ai-agents.js +8 -834
  9. package/dist/ai-assistant.cjs +13 -740
  10. package/dist/ai-assistant.js +10 -738
  11. package/dist/ai-chat.cjs +24 -770
  12. package/dist/ai-chat.js +18 -765
  13. package/dist/ai-code.cjs +67 -923
  14. package/dist/ai-code.js +49 -905
  15. package/dist/ai-playground.cjs +25 -801
  16. package/dist/ai-playground.js +18 -795
  17. package/dist/ai-tools.cjs +22 -767
  18. package/dist/ai-tools.js +15 -761
  19. package/dist/ai-vision.cjs +41 -993
  20. package/dist/ai-vision.js +30 -983
  21. package/dist/ai-voice-settings.cjs +35 -1006
  22. package/dist/ai-voice-settings.js +32 -1004
  23. package/dist/ai-voice.cjs +51 -1024
  24. package/dist/ai-voice.js +9 -963
  25. package/dist/alert.cjs +11 -129
  26. package/dist/alert.js +8 -127
  27. package/dist/announcement.cjs +6 -402
  28. package/dist/announcement.js +6 -402
  29. package/dist/app-switcher-navigation-bar.cjs +5 -401
  30. package/dist/app-switcher-navigation-bar.js +5 -401
  31. package/dist/apple-cards-carousel.cjs +84 -480
  32. package/dist/apple-cards-carousel.js +19 -415
  33. package/dist/auth.cjs +10 -387
  34. package/dist/auth.js +7 -385
  35. package/dist/avatar.cjs +2 -9
  36. package/dist/avatar.js +2 -10
  37. package/dist/badge.cjs +8 -228
  38. package/dist/badge.js +5 -210
  39. package/dist/button.cjs +14 -67
  40. package/dist/button.js +12 -65
  41. package/dist/chrome.cjs +29 -493
  42. package/dist/chrome.js +9 -474
  43. package/dist/code-block.cjs +16 -664
  44. package/dist/code-block.js +13 -662
  45. package/dist/code-compare.cjs +28 -1302
  46. package/dist/code-compare.js +18 -1293
  47. package/dist/code-diff.cjs +21 -669
  48. package/dist/code-diff.js +17 -666
  49. package/dist/code-editor.cjs +13 -409
  50. package/dist/code-editor.js +12 -408
  51. package/dist/code-explorer.cjs +14 -456
  52. package/dist/code-explorer.js +13 -456
  53. package/dist/code-preview.cjs +31 -983
  54. package/dist/code-preview.js +23 -976
  55. package/dist/code-snippet.cjs +19 -667
  56. package/dist/code-snippet.js +14 -663
  57. package/dist/code-terminal.cjs +24 -485
  58. package/dist/code-terminal.js +19 -481
  59. package/dist/collapsible.cjs +13 -347
  60. package/dist/collapsible.js +11 -330
  61. package/dist/color-picker.cjs +8 -450
  62. package/dist/color-picker.js +7 -450
  63. package/dist/combobox.cjs +6 -402
  64. package/dist/combobox.js +6 -402
  65. package/dist/communication-navigation-bar.cjs +7 -403
  66. package/dist/communication-navigation-bar.js +5 -401
  67. package/dist/dashboard-navigation-bar.cjs +6 -402
  68. package/dist/dashboard-navigation-bar.js +5 -401
  69. package/dist/dialog-stack.cjs +5 -401
  70. package/dist/dialog-stack.js +5 -401
  71. package/dist/dialog.cjs +13 -70
  72. package/dist/dialog.js +13 -70
  73. package/dist/drawer.cjs +23 -99
  74. package/dist/drawer.js +19 -96
  75. package/dist/e-commerce-navigation-bar.cjs +7 -403
  76. package/dist/e-commerce-navigation-bar.js +5 -401
  77. package/dist/editor.cjs +9 -405
  78. package/dist/editor.js +6 -402
  79. package/dist/iam.cjs +2 -123
  80. package/dist/iam.js +1 -122
  81. package/dist/icon-button.cjs +2 -56
  82. package/dist/icon-button.js +1 -55
  83. package/dist/identity.cjs +28 -242
  84. package/dist/identity.js +20 -235
  85. package/dist/image-crop.cjs +10 -406
  86. package/dist/image-crop.js +7 -403
  87. package/dist/image.cjs +14 -83
  88. package/dist/image.js +13 -67
  89. package/dist/index.cjs +1868 -38770
  90. package/dist/index.js +174 -38320
  91. package/dist/input-group.cjs +3 -10
  92. package/dist/input-group.js +2 -10
  93. package/dist/item.cjs +2 -27
  94. package/dist/item.js +1 -22
  95. package/dist/kanban.cjs +25 -751
  96. package/dist/kanban.js +15 -742
  97. package/dist/limelight-nav.cjs +10 -452
  98. package/dist/limelight-nav.js +9 -452
  99. package/dist/link.cjs +11 -80
  100. package/dist/link.js +6 -60
  101. package/dist/lux.config.cjs +14 -32
  102. package/dist/lux.config.js +3 -26
  103. package/dist/menu.cjs +5 -13
  104. package/dist/menu.js +1 -9
  105. package/dist/message-dock.cjs +5 -401
  106. package/dist/message-dock.js +5 -401
  107. package/dist/mini-calendar.cjs +7 -403
  108. package/dist/mini-calendar.js +6 -402
  109. package/dist/music-player.cjs +30 -528
  110. package/dist/music-player.js +22 -520
  111. package/dist/next.cjs +8 -89
  112. package/dist/next.js +3 -86
  113. package/dist/popover.cjs +17 -74
  114. package/dist/popover.js +16 -73
  115. package/dist/progress-circle.cjs +3 -10
  116. package/dist/progress-circle.js +2 -10
  117. package/dist/provider.cjs +7 -176
  118. package/dist/provider.js +4 -174
  119. package/dist/select.cjs +36 -89
  120. package/dist/select.js +35 -88
  121. package/dist/sidebar.cjs +22 -493
  122. package/dist/sidebar.js +17 -489
  123. package/dist/site/commerce/ui/context.cjs +9 -214
  124. package/dist/site/commerce/ui/context.js +6 -215
  125. package/dist/site/components/analytics.cjs +2 -42
  126. package/dist/site/components/analytics.js +1 -37
  127. package/dist/site/components/auth/callback.cjs +2 -8
  128. package/dist/site/components/auth/callback.js +1 -7
  129. package/dist/site/components/auth/login-panel.cjs +15 -74
  130. package/dist/site/components/auth/login-panel.js +12 -73
  131. package/dist/site/components/auth/login.cjs +2 -6
  132. package/dist/site/components/auth/login.js +1 -5
  133. package/dist/site/components/auth/widget.cjs +2 -6
  134. package/dist/site/components/auth/widget.js +1 -5
  135. package/dist/site/components/commerce/bag-button.cjs +2 -3
  136. package/dist/site/components/commerce/bag-button.js +2 -3
  137. package/dist/site/components/commerce/buy-button.cjs +2 -11
  138. package/dist/site/components/commerce/buy-button.js +1 -10
  139. package/dist/site/components/commerce/checkout-button.cjs +2 -3
  140. package/dist/site/components/commerce/checkout-button.js +2 -3
  141. package/dist/site/components/commerce/checkout-panel/desktop-cp.cjs +15 -173
  142. package/dist/site/components/commerce/checkout-panel/desktop-cp.js +14 -174
  143. package/dist/site/components/commerce/checkout-panel/index.cjs +9 -400
  144. package/dist/site/components/commerce/checkout-panel/index.js +10 -403
  145. package/dist/site/components/commerce/checkout-panel/mobile-cp.cjs +15 -236
  146. package/dist/site/components/commerce/checkout-panel/mobile-cp.js +13 -237
  147. package/dist/site/components/commerce/desktop-bag-popup.cjs +7 -8
  148. package/dist/site/components/commerce/desktop-bag-popup.js +3 -8
  149. package/dist/site/components/commerce/drawer/index.cjs +15 -289
  150. package/dist/site/components/commerce/drawer/index.js +10 -290
  151. package/dist/site/components/commerce/drawer/micro.cjs +8 -115
  152. package/dist/site/components/commerce/drawer/micro.js +4 -115
  153. package/dist/site/components/commerce/drawer/shell.cjs +2 -10
  154. package/dist/site/components/commerce/drawer/shell.js +2 -10
  155. package/dist/site/components/contact-dialog/index.cjs +6 -69
  156. package/dist/site/components/contact-dialog/index.js +7 -71
  157. package/dist/site/components/drawer-margin.cjs +2 -10
  158. package/dist/site/components/drawer-margin.js +2 -10
  159. package/dist/site/components/footer.cjs +11 -81
  160. package/dist/site/components/footer.js +8 -80
  161. package/dist/site/components/header/desktop.cjs +18 -374
  162. package/dist/site/components/header/desktop.js +12 -355
  163. package/dist/site/components/header/index.cjs +9 -674
  164. package/dist/site/components/header/index.js +8 -657
  165. package/dist/site/components/header/mobile-bag-drawer.cjs +6 -71
  166. package/dist/site/components/header/mobile-bag-drawer.js +5 -74
  167. package/dist/site/components/header/mobile-nav-menu-ai.cjs +2 -31
  168. package/dist/site/components/header/mobile-nav-menu-ai.js +1 -26
  169. package/dist/site/components/header/mobile-nav-menu-item.cjs +6 -60
  170. package/dist/site/components/header/mobile-nav-menu-item.js +6 -61
  171. package/dist/site/components/header/mobile-nav-menu.cjs +7 -110
  172. package/dist/site/components/header/mobile-nav-menu.js +7 -112
  173. package/dist/site/components/header/mobile.cjs +25 -330
  174. package/dist/site/components/header/mobile.js +20 -330
  175. package/dist/site/components/icons/index.cjs +34 -35
  176. package/dist/site/components/icons/index.js +5 -33
  177. package/dist/site/components/index.cjs +118 -1961
  178. package/dist/site/components/index.js +23 -1951
  179. package/dist/site/components/mini-chart/index.cjs +7 -90
  180. package/dist/site/components/mini-chart/index.js +1 -92
  181. package/dist/site/components/mini-chart/wrapper.cjs +7 -76
  182. package/dist/site/components/mini-chart/wrapper.js +4 -77
  183. package/dist/site/components/not-found/index.cjs +9 -819
  184. package/dist/site/components/not-found/index.js +8 -802
  185. package/dist/site/components/security/index.cjs +9 -819
  186. package/dist/site/components/security/index.js +8 -802
  187. package/dist/site/next/analytics/index.cjs +16 -49
  188. package/dist/site/next/analytics/index.js +3 -49
  189. package/dist/site/next/analytics/pixel-analytics.cjs +23 -8
  190. package/dist/site/next/analytics/pixel-analytics.js +4 -8
  191. package/dist/site/next/index.cjs +13 -140
  192. package/dist/site/next/index.js +2 -140
  193. package/dist/site/root-layout/index.cjs +12 -1435
  194. package/dist/site/root-layout/index.css +0 -133
  195. package/dist/site/root-layout/index.js +12 -1416
  196. package/dist/site/site-def/footer/community.cjs +11 -27
  197. package/dist/site/site-def/footer/community.js +2 -18
  198. package/dist/site/site-def/footer/company.d.ts +3 -3
  199. package/dist/site/site-def/footer/index.cjs +38 -218
  200. package/dist/site/site-def/footer/index.js +14 -215
  201. package/dist/site/site-def/index.cjs +28 -620
  202. package/dist/site/site-def/index.js +3 -624
  203. package/dist/table.cjs +20 -338
  204. package/dist/table.js +19 -338
  205. package/dist/tabs.cjs +3 -10
  206. package/dist/tabs.js +1 -9
  207. package/dist/tag.cjs +9 -270
  208. package/dist/tag.js +6 -268
  209. package/dist/tags.cjs +6 -314
  210. package/dist/tags.js +5 -314
  211. package/dist/textarea.cjs +4 -50
  212. package/dist/textarea.js +3 -49
  213. package/dist/tooltip.cjs +15 -34
  214. package/dist/tooltip.js +13 -33
  215. package/dist/vite.cjs +3 -82
  216. package/dist/vite.js +1 -80
  217. package/package.json +1 -1
  218. package/dist/index.css +0 -132
  219. package/dist/site/components/auth/login-panel.css +0 -4
  220. package/dist/site/components/commerce/bag-button.css +0 -4
  221. package/dist/site/components/commerce/checkout-button.css +0 -4
  222. package/dist/site/components/commerce/checkout-panel/desktop-cp.css +0 -132
  223. package/dist/site/components/commerce/checkout-panel/index.css +0 -132
  224. package/dist/site/components/commerce/checkout-panel/mobile-cp.css +0 -132
  225. package/dist/site/components/commerce/desktop-bag-popup.css +0 -4
  226. package/dist/site/components/commerce/drawer/index.css +0 -132
  227. package/dist/site/components/commerce/drawer/micro.css +0 -4
  228. package/dist/site/components/header/desktop.css +0 -4
  229. package/dist/site/components/header/index.css +0 -132
  230. package/dist/site/components/header/mobile-bag-drawer.css +0 -4
  231. package/dist/site/components/header/mobile-nav-menu-ai.css +0 -132
  232. package/dist/site/components/header/mobile-nav-menu-item.css +0 -132
  233. package/dist/site/components/header/mobile-nav-menu.css +0 -132
  234. package/dist/site/components/header/mobile.css +0 -132
  235. package/dist/site/components/icons/index.css +0 -4
  236. package/dist/site/components/index.css +0 -132
  237. package/dist/site/components/not-found/index.css +0 -132
  238. package/dist/site/components/security/index.css +0 -132
  239. package/dist/site/site-def/footer/community.css +0 -4
  240. package/dist/site/site-def/footer/index.css +0 -4
  241. package/dist/site/site-def/index.css +0 -4
@@ -6,221 +6,16 @@ var mobxReactLite = require('mobx-react-lite');
6
6
  var navigation = require('next/navigation');
7
7
  var usehooksTs = require('usehooks-ts');
8
8
  var commerce = require('@hanzo/commerce');
9
- var mobx = require('mobx');
9
+ var store_cjs = require('./store.cjs');
10
+ var conf = require('./conf.cjs');
10
11
  var jsxRuntime = require('react/jsx-runtime');
11
12
 
12
- var log = (s) => {
13
- {
14
- console.log("COMMERCE_UI " + s);
15
- }
16
- };
17
- var CommerceUIStore = class {
18
- // points to either this._pointsConfig.md or this._pointsConfig.dt
19
- constructor(s, conf) {
20
- this._vHeight = 0;
21
- this._routeChangedTime = 0;
22
- this._currentSkuPath = void 0;
23
- this._closedByUser = false;
24
- this._checkingOut = void 0;
25
- this._ignoreStateChange = false;
26
- this._activePoint = null;
27
- this._reactionDisposers = [];
28
- this.initialize = () => {
29
- this._reactionDisposers.push(mobx.reaction(
30
- () => this.state,
31
- (s) => {
32
- if (this.ignoreStateChange) {
33
- log(`STATE CHANGE to "${s}" (IGNORED)`);
34
- this.setIgnoreStateChange(false);
35
- return;
36
- } else {
37
- log(`STATE CHANGE to "${s}" (UI REACTED)`);
38
- this._syncUIToState(s);
39
- }
40
- }
41
- ));
42
- };
43
- this.newRoute = () => {
44
- this.setRouteChangedTime((/* @__PURE__ */ new Date()).getTime());
45
- this.hideVariants();
46
- this.setClosedByUser(false);
47
- };
48
- this.onActivePointChanged = (newPoint) => {
49
- log("ON onActivePointChanged: " + newPoint);
50
- if (newPoint === this._points.micro && this.activePoint === this._points.full) {
51
- log("ON onActivePointChanged: to MICRO");
52
- this.setIgnoreStateChange(true);
53
- this.hideVariants();
54
- } else if (newPoint === this._points.full && this.activePoint === this._points.micro) {
55
- log("ON onActivePointChanged: to FULL");
56
- this.setIgnoreStateChange(true);
57
- this.showRecentVariants();
58
- }
59
- this.setActivePoint(newPoint);
60
- };
61
- this.showVariants = (skuPath) => {
62
- this._service.setCurrentItem(void 0);
63
- this._currentSkuPath = skuPath;
64
- this._closedByUser = false;
65
- };
66
- this.showRecentVariants = () => {
67
- const recentItemInfo = this._service.recentItem;
68
- if (recentItemInfo) {
69
- this._service.setCurrentItem(void 0);
70
- this._currentSkuPath = recentItemInfo.item.sku;
71
- this._closedByUser = false;
72
- }
73
- };
74
- this.hideVariants = () => {
75
- this._currentSkuPath = void 0;
76
- };
77
- this.setClosedByUser = (b) => {
78
- this._closedByUser = b;
79
- };
80
- this.setIgnoreStateChange = (b) => {
81
- this._ignoreStateChange = b;
82
- };
83
- this.setCheckingOut = (b) => {
84
- this._checkingOut = b;
85
- };
86
- this.setActivePoint = (pt) => {
87
- this._activePoint = pt;
88
- };
89
- this.setRouteChangedTime = (t) => {
90
- this._routeChangedTime = t;
91
- };
92
- this._syncUIToState = (s) => {
93
- log("_syncUIToState: " + s);
94
- if (s === "micro") {
95
- this.setActivePoint(this.points[0]);
96
- } else if (s === "full") {
97
- this.setActivePoint(this.points[this.points.length - 1]);
98
- } else {
99
- this.setActivePoint(null);
100
- }
101
- };
102
- this.setMobile = (b) => {
103
- log("setMobile: " + b);
104
- this._points = b ? this._pointsConfig.mb : this._pointsConfig.dt;
105
- };
106
- this.setViewportHeight = (v) => {
107
- this._vHeight = v;
108
- };
109
- this.dispose = () => {
110
- this._reactionDisposers.forEach((d) => {
111
- d();
112
- });
113
- };
114
- this._service = s;
115
- this._pointsConfig = conf;
116
- this._points = this._pointsConfig.dt;
117
- mobx.makeObservable(this, {
118
- _currentSkuPath: mobx.observable,
119
- _closedByUser: mobx.observable,
120
- _checkingOut: mobx.observable,
121
- _activePoint: mobx.observable,
122
- _points: mobx.observableRef,
123
- _vHeight: mobx.observable,
124
- _routeChangedTime: mobx.observable,
125
- showVariants: mobx.action,
126
- showRecentVariants: mobx.action,
127
- hideVariants: mobx.action,
128
- setClosedByUser: mobx.action,
129
- setCheckingOut: mobx.action,
130
- setActivePoint: mobx.action,
131
- setMobile: mobx.action,
132
- setViewportHeight: mobx.action,
133
- setRouteChangedTime: mobx.action,
134
- activePoint: mobx.computed,
135
- checkingOut: mobx.computed,
136
- closedByUser: mobx.computed,
137
- currentSkuPath: mobx.computed,
138
- microHeight: mobx.computed,
139
- modal: mobx.computed,
140
- points: mobx.computed,
141
- showRecent: mobx.computed,
142
- showBuy: mobx.computed,
143
- showCheckout: mobx.computed,
144
- snapPointPx: mobx.computed,
145
- state: mobx.computed,
146
- open: mobx.computed
147
- });
148
- }
149
- get currentSkuPath() {
150
- return this._currentSkuPath;
151
- }
152
- get closedByUser() {
153
- return this._closedByUser;
154
- }
155
- get ignoreStateChange() {
156
- return this._ignoreStateChange;
157
- }
158
- get checkingOut() {
159
- return this._checkingOut;
160
- }
161
- get activePoint() {
162
- return this._activePoint;
163
- }
164
- get points() {
165
- return [this._points.micro, this._points.full];
166
- }
167
- get open() {
168
- log(
169
- "open(): showCheckout: " + this.showCheckout + " showRecent: " + this.showRecent + " showBuy: " + this.showBuy
170
- );
171
- return this._checkingOut !== void 0 && !this._checkingOut && !this.closedByUser && (this.showCheckout || this.showRecent || this.showBuy);
172
- }
173
- get state() {
174
- if (!this.closedByUser && !this._checkingOut) {
175
- if (this.showBuy) {
176
- return "full";
177
- } else if (this.showRecent || this.showCheckout) {
178
- return "micro";
179
- }
180
- }
181
- return "closed";
182
- }
183
- get showRecent() {
184
- const recentInfo = this._service.recentItem;
185
- return !!recentInfo && recentInfo.modified > this._routeChangedTime;
186
- }
187
- get showBuy() {
188
- return !!this.currentSkuPath;
189
- }
190
- get showCheckout() {
191
- return !this._service.cartEmpty;
192
- }
193
- get modal() {
194
- return this.state !== "micro";
195
- }
196
- get microHeight() {
197
- return this._points.micro;
198
- }
199
- get isMobile() {
200
- return this._pointsConfig.mb === this._points;
201
- }
202
- get snapPointPx() {
203
- if (!this._activePoint || this._vHeight === 0) return 0;
204
- if (typeof this._activePoint === "string") {
205
- return parseInt(this._activePoint);
206
- }
207
- return this._vHeight * this._activePoint;
208
- }
209
- };
13
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
14
+
15
+ var conf__default = /*#__PURE__*/_interopDefault(conf);
210
16
 
211
- // src/site/commerce/ui/conf.ts
212
- var conf_default = {
213
- mb: {
214
- micro: "72px",
215
- full: "600px"
216
- },
217
- dt: {
218
- micro: "90px",
219
- full: "620px"
220
- }
221
- };
222
17
  var DESKTOP_MIN = 768;
223
- var log2 = (s) => {
18
+ var log = (s) => {
224
19
  };
225
20
  mobxReactLite.enableStaticRendering(typeof window === "undefined");
226
21
  var CommerceUIContext = react.createContext(void 0);
@@ -235,7 +30,7 @@ var CommerceUIProvider = ({
235
30
  }) => {
236
31
  const cmmc = commerce.useCommerce();
237
32
  const pathname = navigation.usePathname();
238
- const storeRef = react.useRef(new CommerceUIStore(cmmc, conf_default));
33
+ const storeRef = react.useRef(new store_cjs.CommerceUIStore(cmmc, conf__default.default));
239
34
  const prevPathRef = react.useRef("initial");
240
35
  const onResize = () => {
241
36
  const width = window.innerWidth;
@@ -260,7 +55,7 @@ var CommerceUIProvider = ({
260
55
  }, []);
261
56
  react.useEffect(() => {
262
57
  const checkingOut = pathname === "/checkout";
263
- log2("useEffect: prev pathname: " + prevPathRef.current);
58
+ log("useEffect: prev pathname: " + prevPathRef.current);
264
59
  if (storeRef.current.checkingOut === void 0 || storeRef.current._checkingOut !== checkingOut) {
265
60
  storeRef.current.setCheckingOut(checkingOut);
266
61
  }
@@ -270,7 +65,7 @@ var CommerceUIProvider = ({
270
65
  } else if (!checkingOut && prevPathRef.current !== pathname) {
271
66
  storeRef.current.newRoute();
272
67
  prevPathRef.current = pathname;
273
- log2("ROUTE CHANGE: " + pathname + ": " + storeRef.current._routeChangedTime);
68
+ log("ROUTE CHANGE: " + pathname + ": " + storeRef.current._routeChangedTime);
274
69
  }
275
70
  }, [pathname]);
276
71
  return /* @__PURE__ */ jsxRuntime.jsx(CommerceUIContext.Provider, { value: storeRef.current, children });
@@ -4,221 +4,12 @@ import { enableStaticRendering } from 'mobx-react-lite';
4
4
  import { usePathname } from 'next/navigation';
5
5
  import { useDebounceCallback } from 'usehooks-ts';
6
6
  import { useCommerce } from '@hanzo/commerce';
7
- import { reaction, makeObservable, computed, action, observable, observableRef } from 'mobx';
7
+ import { CommerceUIStore } from './store.js';
8
+ import conf from './conf.js';
8
9
  import { jsx } from 'react/jsx-runtime';
9
10
 
10
- var log = (s) => {
11
- {
12
- console.log("COMMERCE_UI " + s);
13
- }
14
- };
15
- var CommerceUIStore = class {
16
- // points to either this._pointsConfig.md or this._pointsConfig.dt
17
- constructor(s, conf) {
18
- this._vHeight = 0;
19
- this._routeChangedTime = 0;
20
- this._currentSkuPath = void 0;
21
- this._closedByUser = false;
22
- this._checkingOut = void 0;
23
- this._ignoreStateChange = false;
24
- this._activePoint = null;
25
- this._reactionDisposers = [];
26
- this.initialize = () => {
27
- this._reactionDisposers.push(reaction(
28
- () => this.state,
29
- (s) => {
30
- if (this.ignoreStateChange) {
31
- log(`STATE CHANGE to "${s}" (IGNORED)`);
32
- this.setIgnoreStateChange(false);
33
- return;
34
- } else {
35
- log(`STATE CHANGE to "${s}" (UI REACTED)`);
36
- this._syncUIToState(s);
37
- }
38
- }
39
- ));
40
- };
41
- this.newRoute = () => {
42
- this.setRouteChangedTime((/* @__PURE__ */ new Date()).getTime());
43
- this.hideVariants();
44
- this.setClosedByUser(false);
45
- };
46
- this.onActivePointChanged = (newPoint) => {
47
- log("ON onActivePointChanged: " + newPoint);
48
- if (newPoint === this._points.micro && this.activePoint === this._points.full) {
49
- log("ON onActivePointChanged: to MICRO");
50
- this.setIgnoreStateChange(true);
51
- this.hideVariants();
52
- } else if (newPoint === this._points.full && this.activePoint === this._points.micro) {
53
- log("ON onActivePointChanged: to FULL");
54
- this.setIgnoreStateChange(true);
55
- this.showRecentVariants();
56
- }
57
- this.setActivePoint(newPoint);
58
- };
59
- this.showVariants = (skuPath) => {
60
- this._service.setCurrentItem(void 0);
61
- this._currentSkuPath = skuPath;
62
- this._closedByUser = false;
63
- };
64
- this.showRecentVariants = () => {
65
- const recentItemInfo = this._service.recentItem;
66
- if (recentItemInfo) {
67
- this._service.setCurrentItem(void 0);
68
- this._currentSkuPath = recentItemInfo.item.sku;
69
- this._closedByUser = false;
70
- }
71
- };
72
- this.hideVariants = () => {
73
- this._currentSkuPath = void 0;
74
- };
75
- this.setClosedByUser = (b) => {
76
- this._closedByUser = b;
77
- };
78
- this.setIgnoreStateChange = (b) => {
79
- this._ignoreStateChange = b;
80
- };
81
- this.setCheckingOut = (b) => {
82
- this._checkingOut = b;
83
- };
84
- this.setActivePoint = (pt) => {
85
- this._activePoint = pt;
86
- };
87
- this.setRouteChangedTime = (t) => {
88
- this._routeChangedTime = t;
89
- };
90
- this._syncUIToState = (s) => {
91
- log("_syncUIToState: " + s);
92
- if (s === "micro") {
93
- this.setActivePoint(this.points[0]);
94
- } else if (s === "full") {
95
- this.setActivePoint(this.points[this.points.length - 1]);
96
- } else {
97
- this.setActivePoint(null);
98
- }
99
- };
100
- this.setMobile = (b) => {
101
- log("setMobile: " + b);
102
- this._points = b ? this._pointsConfig.mb : this._pointsConfig.dt;
103
- };
104
- this.setViewportHeight = (v) => {
105
- this._vHeight = v;
106
- };
107
- this.dispose = () => {
108
- this._reactionDisposers.forEach((d) => {
109
- d();
110
- });
111
- };
112
- this._service = s;
113
- this._pointsConfig = conf;
114
- this._points = this._pointsConfig.dt;
115
- makeObservable(this, {
116
- _currentSkuPath: observable,
117
- _closedByUser: observable,
118
- _checkingOut: observable,
119
- _activePoint: observable,
120
- _points: observableRef,
121
- _vHeight: observable,
122
- _routeChangedTime: observable,
123
- showVariants: action,
124
- showRecentVariants: action,
125
- hideVariants: action,
126
- setClosedByUser: action,
127
- setCheckingOut: action,
128
- setActivePoint: action,
129
- setMobile: action,
130
- setViewportHeight: action,
131
- setRouteChangedTime: action,
132
- activePoint: computed,
133
- checkingOut: computed,
134
- closedByUser: computed,
135
- currentSkuPath: computed,
136
- microHeight: computed,
137
- modal: computed,
138
- points: computed,
139
- showRecent: computed,
140
- showBuy: computed,
141
- showCheckout: computed,
142
- snapPointPx: computed,
143
- state: computed,
144
- open: computed
145
- });
146
- }
147
- get currentSkuPath() {
148
- return this._currentSkuPath;
149
- }
150
- get closedByUser() {
151
- return this._closedByUser;
152
- }
153
- get ignoreStateChange() {
154
- return this._ignoreStateChange;
155
- }
156
- get checkingOut() {
157
- return this._checkingOut;
158
- }
159
- get activePoint() {
160
- return this._activePoint;
161
- }
162
- get points() {
163
- return [this._points.micro, this._points.full];
164
- }
165
- get open() {
166
- log(
167
- "open(): showCheckout: " + this.showCheckout + " showRecent: " + this.showRecent + " showBuy: " + this.showBuy
168
- );
169
- return this._checkingOut !== void 0 && !this._checkingOut && !this.closedByUser && (this.showCheckout || this.showRecent || this.showBuy);
170
- }
171
- get state() {
172
- if (!this.closedByUser && !this._checkingOut) {
173
- if (this.showBuy) {
174
- return "full";
175
- } else if (this.showRecent || this.showCheckout) {
176
- return "micro";
177
- }
178
- }
179
- return "closed";
180
- }
181
- get showRecent() {
182
- const recentInfo = this._service.recentItem;
183
- return !!recentInfo && recentInfo.modified > this._routeChangedTime;
184
- }
185
- get showBuy() {
186
- return !!this.currentSkuPath;
187
- }
188
- get showCheckout() {
189
- return !this._service.cartEmpty;
190
- }
191
- get modal() {
192
- return this.state !== "micro";
193
- }
194
- get microHeight() {
195
- return this._points.micro;
196
- }
197
- get isMobile() {
198
- return this._pointsConfig.mb === this._points;
199
- }
200
- get snapPointPx() {
201
- if (!this._activePoint || this._vHeight === 0) return 0;
202
- if (typeof this._activePoint === "string") {
203
- return parseInt(this._activePoint);
204
- }
205
- return this._vHeight * this._activePoint;
206
- }
207
- };
208
-
209
- // src/site/commerce/ui/conf.ts
210
- var conf_default = {
211
- mb: {
212
- micro: "72px",
213
- full: "600px"
214
- },
215
- dt: {
216
- micro: "90px",
217
- full: "620px"
218
- }
219
- };
220
11
  var DESKTOP_MIN = 768;
221
- var log2 = (s) => {
12
+ var log = (s) => {
222
13
  };
223
14
  enableStaticRendering(typeof window === "undefined");
224
15
  var CommerceUIContext = createContext(void 0);
@@ -233,7 +24,7 @@ var CommerceUIProvider = ({
233
24
  }) => {
234
25
  const cmmc = useCommerce();
235
26
  const pathname = usePathname();
236
- const storeRef = useRef(new CommerceUIStore(cmmc, conf_default));
27
+ const storeRef = useRef(new CommerceUIStore(cmmc, conf));
237
28
  const prevPathRef = useRef("initial");
238
29
  const onResize = () => {
239
30
  const width = window.innerWidth;
@@ -258,7 +49,7 @@ var CommerceUIProvider = ({
258
49
  }, []);
259
50
  useEffect(() => {
260
51
  const checkingOut = pathname === "/checkout";
261
- log2("useEffect: prev pathname: " + prevPathRef.current);
52
+ log("useEffect: prev pathname: " + prevPathRef.current);
262
53
  if (storeRef.current.checkingOut === void 0 || storeRef.current._checkingOut !== checkingOut) {
263
54
  storeRef.current.setCheckingOut(checkingOut);
264
55
  }
@@ -268,7 +59,7 @@ var CommerceUIProvider = ({
268
59
  } else if (!checkingOut && prevPathRef.current !== pathname) {
269
60
  storeRef.current.newRoute();
270
61
  prevPathRef.current = pathname;
271
- log2("ROUTE CHANGE: " + pathname + ": " + storeRef.current._routeChangedTime);
62
+ log("ROUTE CHANGE: " + pathname + ": " + storeRef.current._routeChangedTime);
272
63
  }
273
64
  }, [pathname]);
274
65
  return /* @__PURE__ */ jsx(CommerceUIContext.Provider, { value: storeRef.current, children });
@@ -2,51 +2,11 @@
2
2
  'use strict';
3
3
 
4
4
  var google = require('@next/third-parties/google');
5
- var react = require('react');
6
- var navigation = require('next/navigation');
7
- var Script = require('next/script');
5
+ var index_cjs = require('../next/analytics/index.cjs');
8
6
  var jsxRuntime = require('react/jsx-runtime');
9
7
 
10
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
11
-
12
- var Script__default = /*#__PURE__*/_interopDefault(Script);
13
-
14
- // src/site/next/analytics/fpixel.ts
15
- var FB_PIXEL_ID = process.env.NEXT_PUBLIC_FACEBOOK_PIXEL_ID || "";
16
- var pageview = () => {
17
- window.fbq("track", "PageView");
18
- };
19
- var FacebookPixel = () => {
20
- const [loaded, setLoaded] = react.useState(false);
21
- const pathname = navigation.usePathname();
22
- react.useEffect(() => {
23
- if (!loaded) return;
24
- pageview();
25
- }, [pathname, loaded]);
26
- return /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(
27
- Script__default.default,
28
- {
29
- id: "fb-pixel",
30
- strategy: "afterInteractive",
31
- onLoad: () => setLoaded(true),
32
- dangerouslySetInnerHTML: {
33
- __html: `
34
- !function(f,b,e,v,n,t,s)
35
- {if(f.fbq)return;n=f.fbq=function(){n.callMethod?
36
- n.callMethod.apply(n,arguments):n.queue.push(arguments)};
37
- if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
38
- n.queue=[];t=b.createElement(e);t.async=!0;
39
- t.src=v;s=b.getElementsByTagName(e)[0];
40
- s.parentNode.insertBefore(t,s)}(window, document,'script',
41
- 'https://connect.facebook.net/en_US/fbevents.js');
42
- fbq('init', ${FB_PIXEL_ID});
43
- `
44
- }
45
- }
46
- ) });
47
- };
48
8
  var Analytics = () => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
49
- /* @__PURE__ */ jsxRuntime.jsx(FacebookPixel, {}),
9
+ /* @__PURE__ */ jsxRuntime.jsx(index_cjs.FacebookPixel, {}),
50
10
  /* @__PURE__ */ jsxRuntime.jsx(google.GoogleAnalytics, { gaId: process.env.NEXT_PUBLIC_GA_MEASUREMENT_ID ?? "" })
51
11
  ] });
52
12
 
@@ -1,44 +1,8 @@
1
1
  'use client';
2
2
  import { GoogleAnalytics } from '@next/third-parties/google';
3
- import { useState, useEffect } from 'react';
4
- import { usePathname } from 'next/navigation';
5
- import Script from 'next/script';
3
+ import { FacebookPixel } from '../next/analytics/index.js';
6
4
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
7
5
 
8
- // src/site/next/analytics/fpixel.ts
9
- var FB_PIXEL_ID = process.env.NEXT_PUBLIC_FACEBOOK_PIXEL_ID || "";
10
- var pageview = () => {
11
- window.fbq("track", "PageView");
12
- };
13
- var FacebookPixel = () => {
14
- const [loaded, setLoaded] = useState(false);
15
- const pathname = usePathname();
16
- useEffect(() => {
17
- if (!loaded) return;
18
- pageview();
19
- }, [pathname, loaded]);
20
- return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
21
- Script,
22
- {
23
- id: "fb-pixel",
24
- strategy: "afterInteractive",
25
- onLoad: () => setLoaded(true),
26
- dangerouslySetInnerHTML: {
27
- __html: `
28
- !function(f,b,e,v,n,t,s)
29
- {if(f.fbq)return;n=f.fbq=function(){n.callMethod?
30
- n.callMethod.apply(n,arguments):n.queue.push(arguments)};
31
- if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
32
- n.queue=[];t=b.createElement(e);t.async=!0;
33
- t.src=v;s=b.getElementsByTagName(e)[0];
34
- s.parentNode.insertBefore(t,s)}(window, document,'script',
35
- 'https://connect.facebook.net/en_US/fbevents.js');
36
- fbq('init', ${FB_PIXEL_ID});
37
- `
38
- }
39
- }
40
- ) });
41
- };
42
6
  var Analytics = () => /* @__PURE__ */ jsxs(Fragment, { children: [
43
7
  /* @__PURE__ */ jsx(FacebookPixel, {}),
44
8
  /* @__PURE__ */ jsx(GoogleAnalytics, { gaId: process.env.NEXT_PUBLIC_GA_MEASUREMENT_ID ?? "" })
@@ -3,21 +3,15 @@
3
3
 
4
4
  var react$1 = require('react');
5
5
  var react = require('@hanzo/iam/react');
6
+ var resume_cjs = require('./resume.cjs');
6
7
  var jsxRuntime = require('react/jsx-runtime');
7
8
 
8
- // src/site/components/auth/resume.ts
9
- var KEY = "lux-auth-resume";
10
- var resume = () => {
11
- const to = sessionStorage.getItem(KEY);
12
- sessionStorage.removeItem(KEY);
13
- return to ?? "/";
14
- };
15
9
  var Callback = () => {
16
10
  const { handleCallback } = react.useIam();
17
11
  const [error, setError] = react$1.useState(null);
18
12
  react$1.useEffect(() => {
19
13
  handleCallback().then(() => {
20
- window.location.replace(resume());
14
+ window.location.replace(resume_cjs.resume());
21
15
  }).catch((e) => {
22
16
  setError(e.message);
23
17
  });
@@ -1,15 +1,9 @@
1
1
  'use client';
2
2
  import { useState, useEffect } from 'react';
3
3
  import { useIam } from '@hanzo/iam/react';
4
+ import { resume } from './resume.js';
4
5
  import { jsx, jsxs } from 'react/jsx-runtime';
5
6
 
6
- // src/site/components/auth/resume.ts
7
- var KEY = "lux-auth-resume";
8
- var resume = () => {
9
- const to = sessionStorage.getItem(KEY);
10
- sessionStorage.removeItem(KEY);
11
- return to ?? "/";
12
- };
13
7
  var Callback = () => {
14
8
  const { handleCallback } = useIam();
15
9
  const [error, setError] = useState(null);