flemo 1.0.0 → 1.1.1

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/dist/index.mjs CHANGED
@@ -1,16 +1,16 @@
1
- import { jsx as P, jsxs as q, Fragment as tt } from "react/jsx-runtime";
2
- import { useEffect as I, createContext as O, useReducer as et, Children as Y, useContext as b, Suspense as nt, useImperativeHandle as at, useRef as R } from "react";
3
- import { d as N, c as M } from "./vendor-C8cPYUOQ.js";
4
- import { animate as st } from "motion";
5
- import { animate as w, transform as X, useAnimate as j, motion as K, useDragControls as rt } from "motion/react";
6
- function it(r, e, t) {
7
- const a = Array.isArray(r) ? r.find((i) => N.pathToRegexp(i).regexp.test(e)) || "" : N.pathToRegexp(r).regexp.test(e) ? r : "", n = N.match(a)(e), s = new URLSearchParams(t), c = Object.fromEntries(s.entries());
8
- return n ? { ...n.params, ...c } : {};
1
+ import { jsx as P, jsxs as tt } from "react/jsx-runtime";
2
+ import { useEffect as R, createContext as X, useReducer as gt, Children as et, useContext as q, Suspense as Pt, useImperativeHandle as yt, useRef as L } from "react";
3
+ import { d as I, c as U } from "./vendor-C8cPYUOQ.js";
4
+ import { animate as F } from "motion";
5
+ import { animate as M, transform as nt, useAnimate as rt, motion as at, useDragControls as wt } from "motion/react";
6
+ function St(n, e, t) {
7
+ const a = Array.isArray(n) ? n.find((i) => I.pathToRegexp(i).regexp.test(e)) || "" : I.pathToRegexp(n).regexp.test(e) ? n : "", r = I.match(a)(e), s = new URLSearchParams(t), o = Object.fromEntries(s.entries());
8
+ return r ? { ...r.params, ...o } : {};
9
9
  }
10
- function B() {
10
+ function J() {
11
11
  return typeof document > "u";
12
12
  }
13
- class ot {
13
+ class Et {
14
14
  tasks = /* @__PURE__ */ new Map();
15
15
  instanceId = Date.now().toString();
16
16
  isLocked = !1;
@@ -19,7 +19,7 @@ class ot {
19
19
  signalListeners = /* @__PURE__ */ new Map();
20
20
  // 신호 리스너
21
21
  async acquireLock(e) {
22
- for (let n = 0; n < 10; n++) {
22
+ for (let r = 0; r < 10; r++) {
23
23
  if (!this.isLocked)
24
24
  return this.isLocked = !0, this.currentTaskId = e, !0;
25
25
  await new Promise((s) => setTimeout(s, 100));
@@ -40,72 +40,72 @@ class ot {
40
40
  }
41
41
  async addTask(e, t = {}) {
42
42
  const a = t.id || this.generateTaskId();
43
- return new Promise((n, s) => {
43
+ return new Promise((r, s) => {
44
44
  this.taskQueue = this.taskQueue.then(async () => {
45
45
  try {
46
- const { control: c, validate: i, rollback: p, dependencies: h = [] } = t, o = {
46
+ const { control: o, validate: i, rollback: c, dependencies: p = [] } = t, u = {
47
47
  id: a,
48
48
  execute: e,
49
49
  timestamp: Date.now(),
50
50
  retryCount: 0,
51
51
  status: "PENDING",
52
- dependencies: h,
52
+ dependencies: p,
53
53
  instanceId: this.instanceId,
54
54
  validate: i,
55
- rollback: p,
56
- control: c
55
+ rollback: c,
56
+ control: o
57
57
  };
58
- this.tasks.set(o.id, o);
58
+ this.tasks.set(u.id, u);
59
59
  try {
60
- if (!await this.acquireLock(o.id))
61
- throw o.status = "FAILED", new Error("FAILED");
60
+ if (!await this.acquireLock(u.id))
61
+ throw u.status = "FAILED", new Error("FAILED");
62
62
  try {
63
- o.status = "PROCESSING";
64
- for (const l of o.dependencies) {
65
- const g = this.tasks.get(l);
66
- if (!g || g.status !== "COMPLETED")
67
- throw o.status = "FAILED", new Error("FAILED");
63
+ u.status = "PROCESSING";
64
+ for (const l of u.dependencies) {
65
+ const w = this.tasks.get(l);
66
+ if (!w || w.status !== "COMPLETED")
67
+ throw u.status = "FAILED", new Error("FAILED");
68
68
  }
69
- if (o.validate && !await o.validate())
70
- throw o.status = "FAILED", new Error("FAILED");
71
- const u = await o.execute();
69
+ if (u.validate && !await u.validate())
70
+ throw u.status = "FAILED", new Error("FAILED");
71
+ const d = await u.execute();
72
72
  if (t.control) {
73
73
  const l = t.control;
74
- if (l.delay && l.delay > 0 && await new Promise((g) => setTimeout(g, l.delay)), l.manual) {
75
- o.status = "MANUAL_PENDING", o.manualResolver = { resolve: n, reject: s, result: u };
74
+ if (l.delay && l.delay > 0 && await new Promise((w) => setTimeout(w, l.delay)), l.manual) {
75
+ u.status = "MANUAL_PENDING", u.manualResolver = { resolve: r, reject: s, result: d };
76
76
  return;
77
77
  }
78
78
  if (l.signal) {
79
- o.status = "MANUAL_PENDING", o.manualResolver = { resolve: n, reject: s, result: u }, this.signalListeners.has(l.signal) || this.signalListeners.set(l.signal, /* @__PURE__ */ new Set()), this.signalListeners.get(l.signal).add(o.id);
79
+ u.status = "MANUAL_PENDING", u.manualResolver = { resolve: r, reject: s, result: d }, this.signalListeners.has(l.signal) || this.signalListeners.set(l.signal, /* @__PURE__ */ new Set()), this.signalListeners.get(l.signal).add(u.id);
80
80
  return;
81
81
  }
82
82
  if (l.condition && !await l.condition()) {
83
- o.status = "MANUAL_PENDING", o.manualResolver = { resolve: n, reject: s, result: u };
83
+ u.status = "MANUAL_PENDING", u.manualResolver = { resolve: r, reject: s, result: d };
84
84
  return;
85
85
  }
86
86
  }
87
- o.status = "COMPLETED", n({
87
+ u.status = "COMPLETED", r({
88
88
  success: !0,
89
- result: u,
90
- taskId: o.id,
89
+ result: d,
90
+ taskId: u.id,
91
91
  timestamp: Date.now(),
92
92
  instanceId: this.instanceId
93
93
  });
94
- } catch (u) {
95
- if (o.status = "FAILED", o.rollback)
94
+ } catch (d) {
95
+ if (u.status = "FAILED", u.rollback)
96
96
  try {
97
- await o.rollback(), o.status = "ROLLEDBACK";
97
+ await u.rollback(), u.status = "ROLLEDBACK";
98
98
  } catch {
99
99
  }
100
- throw u;
100
+ throw d;
101
101
  } finally {
102
- this.releaseLock(o.id);
102
+ this.releaseLock(u.id);
103
103
  }
104
- } catch (d) {
105
- s(d);
104
+ } catch (h) {
105
+ s(h);
106
106
  }
107
- } catch (c) {
108
- s(c);
107
+ } catch (o) {
108
+ s(o);
109
109
  }
110
110
  }).catch(s);
111
111
  });
@@ -139,103 +139,103 @@ class ot {
139
139
  return Array.from(this.tasks.values()).filter((e) => e.status === "MANUAL_PENDING");
140
140
  }
141
141
  }
142
- const f = new ot(), T = M((r) => ({
142
+ const m = new Et(), x = U((n) => ({
143
143
  index: -1,
144
144
  histories: [],
145
- addHistory: (e) => r((t) => ({
145
+ addHistory: (e) => n((t) => ({
146
146
  index: t.index + 1,
147
147
  histories: t.histories.concat(e)
148
148
  })),
149
- replaceHistory: (e) => r((t) => (t.histories.splice(e, 1), {
149
+ replaceHistory: (e) => n((t) => (t.histories.splice(e, 1), {
150
150
  index: t.index - 1,
151
151
  histories: t.histories
152
152
  })),
153
- popHistory: (e) => r((t) => ({
153
+ popHistory: (e) => n((t) => ({
154
154
  index: t.index - 1,
155
- histories: t.histories.filter((a, n) => n !== e)
155
+ histories: t.histories.filter((a, r) => r !== e)
156
156
  }))
157
- })), k = M((r) => ({
157
+ })), C = U((n) => ({
158
158
  status: "IDLE",
159
- setStatus: (e) => r({ status: e })
159
+ setStatus: (e) => n({ status: e })
160
160
  }));
161
- function ct() {
162
- return I(() => {
163
- const r = async (e) => {
164
- await f.resolveAllPending();
165
- const { index: t, addHistory: a, popHistory: n } = T.getState(), s = k.getState().setStatus, c = e.state?.id, i = e.state?.index, p = e.state?.status, h = e.state?.params, o = e.state?.transitionName, d = i < t, u = p === "PUSHING" && i > t, l = p === "REPLACING" && i > t;
166
- d ? (await f.addTask(
161
+ function vt() {
162
+ return R(() => {
163
+ const n = async (e) => {
164
+ await m.resolveAllPending();
165
+ const { index: t, addHistory: a, popHistory: r } = x.getState(), s = C.getState().setStatus, o = e.state?.id, i = e.state?.index, c = e.state?.status, p = e.state?.params, u = e.state?.transitionName, h = i < t, d = c === "PUSHING" && i > t, l = c === "REPLACING" && i > t;
166
+ h ? (await m.addTask(
167
167
  async () => (s("POPPING"), async () => {
168
- n(i + 1), f.getManualPendingTasks().length || s("COMPLETED");
168
+ r(i + 1), m.getManualPendingTasks().length || s("COMPLETED");
169
169
  }),
170
170
  {
171
- id: c,
171
+ id: o,
172
172
  control: {
173
173
  manual: !0
174
174
  }
175
175
  }
176
- ))?.result?.() : u ? (await f.addTask(
176
+ ))?.result?.() : d ? (await m.addTask(
177
177
  async () => (s("PUSHING"), a({
178
- id: c,
178
+ id: o,
179
179
  pathname: window.location.pathname,
180
- params: h,
181
- transitionName: o
180
+ params: p,
181
+ transitionName: u
182
182
  }), async () => {
183
- f.getManualPendingTasks().length || s("COMPLETED");
183
+ m.getManualPendingTasks().length || s("COMPLETED");
184
184
  }),
185
185
  {
186
- id: c,
186
+ id: o,
187
187
  control: {
188
188
  manual: !0
189
189
  }
190
190
  }
191
- ))?.result?.() : l && (await f.addTask(
191
+ ))?.result?.() : l && (await m.addTask(
192
192
  async () => (s("REPLACING"), a({
193
- id: c,
193
+ id: o,
194
194
  pathname: window.location.pathname,
195
- params: h,
196
- transitionName: o
195
+ params: p,
196
+ transitionName: u
197
197
  }), async () => {
198
- f.getManualPendingTasks().length || s("COMPLETED");
198
+ m.getManualPendingTasks().length || s("COMPLETED");
199
199
  }),
200
200
  {
201
- id: c,
201
+ id: o,
202
202
  control: {
203
203
  manual: !0
204
204
  }
205
205
  }
206
206
  ))?.result?.();
207
207
  };
208
- return window.addEventListener("popstate", r), () => {
209
- window.removeEventListener("popstate", r);
208
+ return window.addEventListener("popstate", n), () => {
209
+ window.removeEventListener("popstate", n);
210
210
  };
211
211
  }, []), null;
212
212
  }
213
- const Q = O({}), V = O(() => {
213
+ const st = X({}), ot = X(() => {
214
214
  });
215
- function ut(r, e) {
215
+ function Lt(n, e) {
216
216
  switch (e.type) {
217
217
  case "SET":
218
218
  return e.params;
219
219
  default:
220
- return r;
220
+ return n;
221
221
  }
222
222
  }
223
- function lt({
224
- children: r,
223
+ function Tt({
224
+ children: n,
225
225
  active: e,
226
226
  params: t
227
227
  }) {
228
- const [a, n] = et(ut, t);
229
- return I(() => {
230
- const s = (c) => {
231
- c.state?.step && n({ type: "SET", params: c.state?.params || {} });
228
+ const [a, r] = gt(Lt, t);
229
+ return R(() => {
230
+ const s = (o) => {
231
+ o.state?.step && r({ type: "SET", params: o.state?.params || {} });
232
232
  };
233
233
  return e && window.addEventListener("popstate", s), () => {
234
234
  window.removeEventListener("popstate", s);
235
235
  };
236
- }, [e, n]), /* @__PURE__ */ P(V.Provider, { value: n, children: /* @__PURE__ */ P(Q.Provider, { value: a, children: r }) });
236
+ }, [e, r]), /* @__PURE__ */ P(ot.Provider, { value: r, children: /* @__PURE__ */ P(st.Provider, { value: a, children: n }) });
237
237
  }
238
- const W = O({
238
+ const it = X({
239
239
  id: "",
240
240
  isActive: !1,
241
241
  isRoot: !0,
@@ -246,42 +246,42 @@ const W = O({
246
246
  transitionName: "none",
247
247
  prevTransitionName: "none"
248
248
  });
249
- function dt({ children: r }) {
250
- const e = T((a) => a.index), t = T((a) => a.histories);
249
+ function Dt({ children: n }) {
250
+ const e = x((a) => a.index), t = x((a) => a.histories);
251
251
  return t.map(
252
- (a) => Y.toArray(r).filter(
253
- (n) => N.pathToRegexp(n.props.path).regexp.test(
252
+ (a) => et.toArray(n).filter(
253
+ (r) => I.pathToRegexp(r.props.path).regexp.test(
254
254
  a.pathname
255
255
  )
256
256
  )
257
- ).map(([a], n) => /* @__PURE__ */ P(
258
- W.Provider,
257
+ ).map(([a], r) => /* @__PURE__ */ P(
258
+ it.Provider,
259
259
  {
260
260
  value: {
261
- id: t[n].id,
262
- isActive: n === e,
263
- isRoot: n === 0,
264
- isPrev: n < e - 1,
265
- zIndex: n,
266
- pathname: t[n].pathname,
267
- params: t[n].params,
261
+ id: t[r].id,
262
+ isActive: r === e,
263
+ isRoot: r === 0,
264
+ isPrev: r < e - 1,
265
+ zIndex: r,
266
+ pathname: t[r].pathname,
267
+ params: t[r].params,
268
268
  transitionName: t[e].transitionName,
269
269
  prevTransitionName: t[e - 1]?.transitionName
270
270
  },
271
- children: /* @__PURE__ */ P(lt, { active: n === e, params: t[n].params, children: a })
271
+ children: /* @__PURE__ */ P(Tt, { active: r === e, params: t[r].params, children: a })
272
272
  },
273
- t[n].id
273
+ t[r].id
274
274
  ));
275
275
  }
276
- function pt({
277
- name: r,
276
+ function Nt({
277
+ name: n,
278
278
  initial: e,
279
279
  enter: t,
280
280
  exit: a,
281
- options: n
281
+ options: r
282
282
  }) {
283
283
  return {
284
- name: r,
284
+ name: n,
285
285
  initial: e,
286
286
  variants: {
287
287
  "IDLE-true": t,
@@ -295,10 +295,10 @@ function pt({
295
295
  "COMPLETED-false": a,
296
296
  "COMPLETED-true": t
297
297
  },
298
- ...n
298
+ ...r
299
299
  };
300
300
  }
301
- const ft = pt({
301
+ const kt = Nt({
302
302
  name: "overlay",
303
303
  initial: {
304
304
  opacity: 0,
@@ -326,32 +326,50 @@ const ft = pt({
326
326
  }
327
327
  },
328
328
  options: {
329
- onSwipe: (r, { prevDecorator: e }) => st(
329
+ onSwipeStart: (n, { prevDecorator: e }) => F(
330
330
  e,
331
331
  {
332
- opacity: Math.max(0, 1 - r / 100)
332
+ opacity: n ? 1 : 0
333
+ },
334
+ {
335
+ duration: 0.3
336
+ }
337
+ ),
338
+ onSwipe: (n, e, { prevDecorator: t }) => F(
339
+ t,
340
+ {
341
+ opacity: Math.max(0, 1 - e / 100)
333
342
  },
334
343
  {
335
344
  duration: 0
336
345
  }
346
+ ),
347
+ onSwipeEnd: (n, { prevDecorator: e }) => F(
348
+ e,
349
+ {
350
+ opacity: n ? 0 : 1
351
+ },
352
+ {
353
+ duration: 0.3
354
+ }
337
355
  )
338
356
  }
339
- }), H = /* @__PURE__ */ new Map([["overlay", ft]]), C = M((r) => ({
357
+ }), j = /* @__PURE__ */ new Map([["overlay", kt]]), _ = U((n) => ({
340
358
  defaultTransitionName: "cupertino",
341
- setDefaultTransitionName: (e) => r({ defaultTransitionName: e })
359
+ setDefaultTransitionName: (e) => n({ defaultTransitionName: e })
342
360
  }));
343
- function U({
344
- name: r,
361
+ function K({
362
+ name: n,
345
363
  initial: e,
346
364
  idle: t,
347
365
  enter: a,
348
- enterBack: n,
366
+ enterBack: r,
349
367
  exit: s,
350
- exitBack: c,
368
+ exitBack: o,
351
369
  options: i
352
370
  }) {
353
371
  return {
354
- name: r,
372
+ name: n,
355
373
  initial: e,
356
374
  variants: {
357
375
  "IDLE-true": t,
@@ -360,15 +378,15 @@ function U({
360
378
  "PUSHING-true": a,
361
379
  "REPLACING-false": s,
362
380
  "REPLACING-true": a,
363
- "POPPING-false": c,
364
- "POPPING-true": n,
381
+ "POPPING-false": o,
382
+ "POPPING-true": r,
365
383
  "COMPLETED-false": s,
366
384
  "COMPLETED-true": a
367
385
  },
368
386
  ...i
369
387
  };
370
388
  }
371
- const ht = U({
389
+ const It = K({
372
390
  name: "cupertino",
373
391
  initial: {
374
392
  x: "100%",
@@ -423,62 +441,54 @@ const ht = U({
423
441
  options: {
424
442
  decoratorName: "overlay",
425
443
  swipeDirection: "x",
426
- onSwipeStart: async (r, e, { currentScreen: t, dragControls: a }) => {
427
- const { offset: n } = e;
428
- n.x < 0 && (a.stop(), w(
429
- t,
430
- {
431
- x: 0
432
- },
433
- {
434
- duration: 0.3
435
- }
436
- ));
437
- },
438
- onSwipe: (r, e, { currentScreen: t, prevScreen: a }) => {
439
- const { offset: n } = e, s = n.x, c = X(s, [0, window.innerWidth], [0, 100]);
440
- return w(
444
+ onSwipeStart: async () => !0,
445
+ onSwipe: (n, e, { currentScreen: t, prevScreen: a, onProgress: r }) => {
446
+ const { offset: s } = e, o = s.x, i = nt(o, [0, window.innerWidth], [0, 100]);
447
+ return r?.(!0, i), M(
441
448
  t,
442
449
  {
443
- x: Math.max(0, s)
450
+ x: Math.max(0, o)
444
451
  },
445
452
  {
446
453
  duration: 0
447
454
  }
448
- ), w(
455
+ ), M(
449
456
  a,
450
457
  {
451
- x: -100 + c
458
+ x: -100 + i
452
459
  },
453
460
  {
454
461
  duration: 0
455
462
  }
456
- ), c;
457
- },
458
- onSwipeEnd: async (r, e, { currentScreen: t, prevScreen: a }) => {
459
- const { offset: n, velocity: s } = e, i = n.x > 50 || s.x > 20;
460
- return w(
461
- t,
462
- {
463
- x: i ? "100%" : 0
464
- },
465
- {
466
- duration: 0.3,
467
- ease: [0.32, 0.72, 0, 1]
468
- }
469
- ), w(
470
- a,
471
- {
472
- x: i ? 0 : -100
473
- },
474
- {
475
- duration: 0.3,
476
- ease: [0.32, 0.72, 0, 1]
477
- }
478
463
  ), i;
464
+ },
465
+ onSwipeEnd: async (n, e, { currentScreen: t, prevScreen: a, onStart: r }) => {
466
+ const { offset: s, velocity: o } = e, c = s.x > 50 || o.x > 20;
467
+ return r?.(c), await Promise.all([
468
+ M(
469
+ t,
470
+ {
471
+ x: c ? "100%" : 0
472
+ },
473
+ {
474
+ duration: 0.3,
475
+ ease: [0.32, 0.72, 0, 1]
476
+ }
477
+ ),
478
+ M(
479
+ a,
480
+ {
481
+ x: c ? 0 : -100
482
+ },
483
+ {
484
+ duration: 0.3,
485
+ ease: [0.32, 0.72, 0, 1]
486
+ }
487
+ )
488
+ ]), c;
479
489
  }
480
490
  }
481
- }), mt = U({
491
+ }), Mt = K({
482
492
  name: "material",
483
493
  initial: {
484
494
  y: "100%",
@@ -538,68 +548,56 @@ const ht = U({
538
548
  },
539
549
  options: {
540
550
  swipeDirection: "y",
541
- onSwipeStart: async (r, e, { currentScreen: t, dragControls: a }) => {
542
- const { offset: n } = e;
543
- n.y < 0 && (a.stop(), w(
544
- t,
545
- {
546
- y: 0,
547
- opacity: 1
548
- },
549
- {
550
- duration: 0.24
551
- }
552
- ));
553
- },
554
- onSwipe: (r, e, { currentScreen: t, prevScreen: a }) => {
555
- const { offset: n } = e, s = n.y, c = Math.max(0, Math.min(56, s)), i = X(c, [0, 56], [1, 0.96]), p = Math.max(0, s - 56), h = Math.min(1, p / 160), o = Math.sqrt(h) * 12, d = Math.max(0, c + o), u = Math.min(56, d);
556
- return w(
551
+ onSwipeStart: async () => !0,
552
+ onSwipe: (n, e, { currentScreen: t, prevScreen: a, onProgress: r }) => {
553
+ const { offset: s } = e, o = s.y, i = Math.max(0, Math.min(56, o)), c = nt(i, [0, 56], [1, 0.96]), p = Math.max(0, o - 56), u = Math.min(1, p / 160), h = Math.sqrt(u) * 12, d = Math.max(0, i + h), l = Math.min(56, d);
554
+ return r?.(!0, l), M(
557
555
  t,
558
556
  {
559
557
  y: d,
560
- opacity: i
558
+ opacity: c
561
559
  },
562
560
  {
563
561
  duration: 0
564
562
  }
565
- ), w(
563
+ ), M(
566
564
  a,
567
565
  {
568
- y: -56 + u,
569
- opacity: u / 56
566
+ y: -56 + l,
567
+ opacity: l / 56
570
568
  },
571
569
  { duration: 0 }
572
- ), u;
570
+ ), l;
573
571
  },
574
- onSwipeEnd: async (r, e, { currentScreen: t, prevScreen: a }) => {
575
- const { offset: n, velocity: s } = e, i = n.y > 56 || s.y > 20;
576
- return await Promise.all([
577
- w(
572
+ onSwipeEnd: async (n, e, { currentScreen: t, prevScreen: a, onStart: r }) => {
573
+ const { offset: s, velocity: o } = e, c = s.y > 56 || o.y > 20;
574
+ return r?.(c), await Promise.all([
575
+ M(
578
576
  t,
579
577
  {
580
- y: i ? "100%" : 0,
581
- opacity: i ? 0.96 : 1
578
+ y: c ? "100%" : 0,
579
+ opacity: c ? 0.96 : 1
582
580
  },
583
581
  {
584
- duration: i ? 0.22 : 0.24,
585
- ease: i ? [0.4, 0, 1, 1] : [0, 0, 0.2, 1]
582
+ duration: c ? 0.22 : 0.24,
583
+ ease: c ? [0.4, 0, 1, 1] : [0, 0, 0.2, 1]
586
584
  }
587
585
  ),
588
- w(
586
+ M(
589
587
  a,
590
588
  {
591
- y: i ? 0 : -56,
592
- opacity: i ? 1 : 0.96
589
+ y: c ? 0 : -56,
590
+ opacity: c ? 1 : 0.96
593
591
  },
594
592
  {
595
- duration: i ? 0.22 : 0.24,
596
- ease: i ? [0, 0, 0.2, 1] : [0.4, 0, 1, 1]
593
+ duration: c ? 0.22 : 0.24,
594
+ ease: c ? [0, 0, 0.2, 1] : [0.4, 0, 1, 1]
597
595
  }
598
596
  )
599
- ]), i;
597
+ ]), c;
600
598
  }
601
599
  }
602
- }), Pt = U({
600
+ }), xt = K({
603
601
  name: "none",
604
602
  initial: {
605
603
  transition: {
@@ -636,135 +634,147 @@ const ht = U({
636
634
  duration: 0
637
635
  }
638
636
  }
639
- }), A = /* @__PURE__ */ new Map([
640
- ["none", Pt],
641
- ["cupertino", ht],
642
- ["material", mt]
643
- ]), gt = (() => {
644
- const r = /* @__PURE__ */ Object.create(null), e = Object.prototype.hasOwnProperty;
645
- for (const t of A.values()) {
637
+ }), $ = /* @__PURE__ */ new Map([
638
+ ["none", xt],
639
+ ["cupertino", It],
640
+ ["material", Mt]
641
+ ]), Rt = (() => {
642
+ const n = /* @__PURE__ */ Object.create(null), e = Object.prototype.hasOwnProperty;
643
+ for (const t of $.values()) {
646
644
  const a = t.variants["IDLE-true"].value;
647
- for (const n in a)
648
- e.call(a, n) && (r[n] = a[n]);
645
+ for (const r in a)
646
+ e.call(a, r) && (n[r] = a[r]);
649
647
  }
650
- return r;
648
+ return n;
651
649
  })();
652
- function kt({
653
- children: r,
650
+ function Yt({
651
+ children: n,
654
652
  initPath: e = "/",
655
653
  defaultTransitionName: t = "cupertino",
656
654
  transitions: a = [],
657
- decorators: n = []
655
+ decorators: r = []
658
656
  }) {
659
- const s = B() ? e || "/" : window.location.pathname, c = B() ? s.split("?")[1] || "" : window.location.search;
660
- return C.setState({
657
+ const s = J() ? e || "/" : window.location.pathname, o = J() ? s.split("?")[1] || "" : window.location.search;
658
+ return _.setState({
661
659
  defaultTransitionName: t
662
- }), T.setState({
660
+ }), x.setState({
663
661
  index: 0,
664
662
  histories: [
665
663
  {
666
664
  id: "root",
667
665
  pathname: s,
668
- params: it(
669
- Y.toArray(r).map((i) => i.props.path).flat(),
666
+ params: St(
667
+ et.toArray(n).map((i) => i.props.path).flat(),
670
668
  s,
671
- c
669
+ o
672
670
  ),
673
671
  transitionName: t
674
672
  }
675
673
  ]
676
- }), I(() => {
677
- a.forEach((i) => A.set(i.name, i));
678
- }, [a]), I(() => {
679
- n.forEach((i) => H.set(i.name, i));
680
- }, [n]), /* @__PURE__ */ q(tt, { children: [
681
- /* @__PURE__ */ P(ct, {}),
682
- /* @__PURE__ */ P(dt, { children: r })
683
- ] });
674
+ }), R(() => {
675
+ a.forEach((i) => $.set(i.name, i));
676
+ }, [a]), R(() => {
677
+ r.forEach((i) => j.set(i.name, i));
678
+ }, [r]), /* @__PURE__ */ tt(
679
+ "div",
680
+ {
681
+ style: {
682
+ position: "fixed",
683
+ top: 0,
684
+ left: 0,
685
+ width: "100%",
686
+ height: "100%"
687
+ },
688
+ children: [
689
+ /* @__PURE__ */ P(vt, {}),
690
+ /* @__PURE__ */ P(Dt, { children: n })
691
+ ]
692
+ }
693
+ );
684
694
  }
685
- function xt({ element: r }) {
686
- return r;
695
+ function Xt({ element: n }) {
696
+ return n;
687
697
  }
688
- function Mt() {
698
+ function qt() {
689
699
  return {
690
- push: async (a, n, s = {}) => {
691
- if (f.getManualPendingTasks().length)
700
+ push: async (a, r, s = {}) => {
701
+ if (m.getManualPendingTasks().length)
692
702
  return;
693
- const { index: c, addHistory: i } = T.getState(), p = k.getState().setStatus, h = C.getState().defaultTransitionName, { transitionName: o = h } = s, d = f.generateTaskId();
694
- (await f.addTask(
703
+ const { index: o, addHistory: i } = x.getState(), c = C.getState().setStatus, p = _.getState().defaultTransitionName, { transitionName: u = p } = s, h = m.generateTaskId();
704
+ (await m.addTask(
695
705
  async () => {
696
- p("PUSHING");
697
- const u = N.compile(a)(n), l = N.parse(a).tokens.filter((E) => E.type === "param").map((E) => E.name), g = Object.fromEntries(
698
- Object.entries(n).filter(([E]) => !l.includes(E))
699
- ), D = new URLSearchParams(g).toString(), S = `${u}${D ? `?${D}` : ""}`;
706
+ c("PUSHING");
707
+ const d = I.compile(a)(r), l = I.parse(a).tokens.filter((v) => v.type === "param").map((v) => v.name), w = Object.fromEntries(
708
+ Object.entries(r).filter(([v]) => !l.includes(v))
709
+ ), A = new URLSearchParams(w).toString(), S = `${d}${A ? `?${A}` : ""}`;
700
710
  return window.history.state?.id || window.history.replaceState(
701
711
  {
702
712
  id: "root",
703
713
  index: 0,
704
714
  status: "IDLE",
705
715
  params: {},
706
- transitionName: o
716
+ transitionName: u
707
717
  },
708
718
  "",
709
719
  window.location.pathname
710
720
  ), window.history.pushState(
711
721
  {
712
- id: d,
713
- index: c + 1,
722
+ id: h,
723
+ index: o + 1,
714
724
  status: "PUSHING",
715
- params: n,
716
- transitionName: o
725
+ params: r,
726
+ transitionName: u
717
727
  },
718
728
  "",
719
729
  S
720
730
  ), i({
721
- id: d,
722
- pathname: u,
723
- params: n,
724
- transitionName: o
731
+ id: h,
732
+ pathname: d,
733
+ params: r,
734
+ transitionName: u
725
735
  }), () => {
726
- f.getManualPendingTasks().length || p("COMPLETED");
736
+ m.getManualPendingTasks().length || c("COMPLETED");
727
737
  };
728
738
  },
729
739
  {
730
- id: d,
740
+ id: h,
731
741
  control: {
732
742
  manual: !0
733
743
  }
734
744
  }
735
745
  )).result?.();
736
746
  },
737
- replace: async (a, n, s = {}) => {
738
- if (f.getManualPendingTasks().length)
747
+ replace: async (a, r, s = {}) => {
748
+ if (m.getManualPendingTasks().length)
739
749
  return;
740
- const { index: c, addHistory: i } = T.getState(), p = T.getState().replaceHistory, h = k.getState().setStatus, o = C.getState().defaultTransitionName, { transitionName: d = o } = s, u = f.generateTaskId();
741
- (await f.addTask(
750
+ const { index: o, addHistory: i } = x.getState(), c = x.getState().replaceHistory, p = C.getState().setStatus, u = _.getState().defaultTransitionName, { transitionName: h = u } = s, d = m.generateTaskId();
751
+ (await m.addTask(
742
752
  async () => {
743
- h("REPLACING");
744
- const l = N.compile(a)(n), g = N.parse(a).tokens.filter((v) => v.type === "param").map((v) => v.name), D = Object.fromEntries(
745
- Object.entries(n).filter(([v]) => !g.includes(v))
746
- ), S = new URLSearchParams(D).toString(), E = `${l}${S ? `?${S}` : ""}`;
753
+ p("REPLACING");
754
+ const l = I.compile(a)(r), w = I.parse(a).tokens.filter((E) => E.type === "param").map((E) => E.name), A = Object.fromEntries(
755
+ Object.entries(r).filter(([E]) => !w.includes(E))
756
+ ), S = new URLSearchParams(A).toString(), v = `${l}${S ? `?${S}` : ""}`;
747
757
  return window.history.replaceState(
748
758
  {
749
- id: u,
750
- index: c,
759
+ id: d,
760
+ index: o,
751
761
  status: "REPLACING",
752
- params: n,
753
- transitionName: d
762
+ params: r,
763
+ transitionName: h
754
764
  },
755
765
  "",
756
- E
766
+ v
757
767
  ), i({
758
- id: u,
768
+ id: d,
759
769
  pathname: l,
760
- params: n,
761
- transitionName: d
770
+ params: r,
771
+ transitionName: h
762
772
  }), async () => {
763
- await f.addTask(async () => p(c)), f.getManualPendingTasks().length || h("COMPLETED");
773
+ await m.addTask(async () => c(o)), m.getManualPendingTasks().length || p("COMPLETED");
764
774
  };
765
775
  },
766
776
  {
767
- id: u,
777
+ id: d,
768
778
  control: {
769
779
  manual: !0
770
780
  }
@@ -772,16 +782,16 @@ function Mt() {
772
782
  )).result?.();
773
783
  },
774
784
  pop: () => {
775
- f.getManualPendingTasks().length || window.history.back();
785
+ m.getManualPendingTasks().length || window.history.back();
776
786
  }
777
787
  };
778
788
  }
779
- function At() {
780
- const r = b(V);
789
+ function jt() {
790
+ const n = q(ot);
781
791
  return {
782
- pushStep: async (n) => {
783
- f.getManualPendingTasks().length || (await f.addTask(async () => {
784
- const s = new URLSearchParams(n).toString(), c = `${window.location.pathname}${s ? `?${s}` : ""}`;
792
+ pushStep: async (r) => {
793
+ m.getManualPendingTasks().length || (await m.addTask(async () => {
794
+ const s = new URLSearchParams(r).toString(), o = `${window.location.pathname}${s ? `?${s}` : ""}`;
785
795
  return window.history.state?.step || window.history.replaceState(
786
796
  {
787
797
  ...window.history.state,
@@ -793,128 +803,177 @@ function At() {
793
803
  {
794
804
  ...window.history.state,
795
805
  step: !0,
796
- params: n
806
+ params: r
797
807
  },
798
808
  "",
799
- c
800
- ), async () => r({ type: "SET", params: n });
809
+ o
810
+ ), async () => n({ type: "SET", params: r });
801
811
  })).result?.();
802
812
  },
803
- replaceStep: async (n) => {
804
- f.getManualPendingTasks().length || (await f.addTask(async () => {
805
- const s = new URLSearchParams(n).toString(), c = `${window.location.pathname}${s ? `?${s}` : ""}`;
813
+ replaceStep: async (r) => {
814
+ m.getManualPendingTasks().length || (await m.addTask(async () => {
815
+ const s = new URLSearchParams(r).toString(), o = `${window.location.pathname}${s ? `?${s}` : ""}`;
806
816
  return window.history.replaceState(
807
817
  {
808
818
  ...window.history.state,
809
819
  step: !0,
810
- params: n
820
+ params: r
811
821
  },
812
822
  "",
813
- c
814
- ), async () => r({ type: "SET", params: n });
823
+ o
824
+ ), async () => n({ type: "SET", params: r });
815
825
  })).result?.();
816
826
  },
817
827
  popStep: () => {
818
- f.getManualPendingTasks().length || window.history.back();
828
+ m.getManualPendingTasks().length || window.history.back();
819
829
  }
820
830
  };
821
831
  }
822
- function $() {
823
- return b(W);
832
+ function Q() {
833
+ return q(it);
824
834
  }
825
- function Rt() {
826
- return b(Q);
835
+ function Kt() {
836
+ return q(st);
827
837
  }
828
- function Ct({
829
- name: r,
838
+ function Qt({
839
+ name: n,
830
840
  initial: e,
831
841
  idle: t,
832
842
  pushOnEnter: a,
833
- pushOnExit: n,
843
+ pushOnExit: r,
834
844
  replaceOnEnter: s,
835
- replaceOnExit: c,
845
+ replaceOnExit: o,
836
846
  popOnEnter: i,
837
- popOnExit: p,
838
- completedOnExit: h,
839
- completedOnEnter: o,
840
- options: d
847
+ popOnExit: c,
848
+ completedOnExit: p,
849
+ completedOnEnter: u,
850
+ options: h
841
851
  }) {
842
852
  return {
843
- name: r,
853
+ name: n,
844
854
  initial: e,
845
855
  variants: {
846
856
  "IDLE-true": t,
847
857
  "IDLE-false": t,
848
- "PUSHING-false": n,
858
+ "PUSHING-false": r,
849
859
  "PUSHING-true": a,
850
- "REPLACING-false": c,
860
+ "REPLACING-false": o,
851
861
  "REPLACING-true": s,
852
- "POPPING-false": p,
862
+ "POPPING-false": c,
853
863
  "POPPING-true": i,
854
- "COMPLETED-false": h,
855
- "COMPLETED-true": o
864
+ "COMPLETED-false": p,
865
+ "COMPLETED-true": u
856
866
  },
857
- ...d
867
+ ...h
858
868
  };
859
869
  }
860
- function Gt({
861
- name: r,
870
+ function Vt({
871
+ name: n,
862
872
  initial: e,
863
873
  idle: t,
864
874
  pushOnEnter: a,
865
- pushOnExit: n,
875
+ pushOnExit: r,
866
876
  replaceOnEnter: s,
867
- replaceOnExit: c,
877
+ replaceOnExit: o,
868
878
  popOnEnter: i,
869
- popOnExit: p,
870
- completedOnEnter: h,
871
- completedOnExit: o,
872
- options: d
879
+ popOnExit: c,
880
+ completedOnEnter: p,
881
+ completedOnExit: u,
882
+ options: h
873
883
  }) {
874
884
  return {
875
- name: r,
885
+ name: n,
876
886
  initial: e,
877
887
  variants: {
878
888
  "IDLE-true": t,
879
889
  "IDLE-false": t,
880
- "PUSHING-false": n,
890
+ "PUSHING-false": r,
881
891
  "PUSHING-true": a,
882
- "REPLACING-false": c,
892
+ "REPLACING-false": o,
883
893
  "REPLACING-true": s,
884
- "POPPING-false": p,
894
+ "POPPING-false": c,
885
895
  "POPPING-true": i,
886
- "COMPLETED-false": o,
887
- "COMPLETED-true": h
896
+ "COMPLETED-false": u,
897
+ "COMPLETED-true": p
888
898
  },
889
- ...d
899
+ ...h
890
900
  };
891
901
  }
892
- const yt = { then() {
902
+ const At = { then() {
893
903
  } };
894
- function wt({
895
- freeze: r,
904
+ function Ct({
905
+ freeze: n,
896
906
  children: e
897
907
  }) {
898
- if (r)
899
- throw yt;
908
+ if (n)
909
+ throw At;
900
910
  return e;
901
911
  }
902
- function St({ freeze: r, children: e, placeholder: t }) {
903
- return /* @__PURE__ */ P(nt, { fallback: t, children: /* @__PURE__ */ P(wt, { freeze: r, children: e }) });
912
+ function Gt({ freeze: n, children: e, placeholder: t }) {
913
+ return /* @__PURE__ */ P(Pt, { fallback: t, children: /* @__PURE__ */ P(Ct, { freeze: n, children: e }) });
914
+ }
915
+ function Z(n, e) {
916
+ const {
917
+ direction: t = "x",
918
+ markerSelector: a = "[data-swipe-at-edge]",
919
+ depthLimit: r = 24,
920
+ verifyByScroll: s = !1
921
+ } = e ?? {}, o = bt(n);
922
+ if (!o) return { element: null, hasMarker: !1 };
923
+ const i = o.closest?.(a);
924
+ if (i instanceof HTMLElement && B(i, t) && (!s || z(i, t)))
925
+ return { element: i, hasMarker: !0 };
926
+ let c = o, p = 0;
927
+ for (; c && c !== document.body && p < r; ) {
928
+ if (B(c, t) && (!s || z(c, t)))
929
+ return { element: c, hasMarker: !1 };
930
+ c = c.parentElement, p++;
931
+ }
932
+ return { element: null, hasMarker: !1 };
933
+ }
934
+ function bt(n) {
935
+ if (!n) return null;
936
+ const e = n, t = typeof e.composedPath == "function" ? e.composedPath() : void 0;
937
+ if (t && t.length) {
938
+ for (const a of t)
939
+ if (a instanceof HTMLElement) return a;
940
+ }
941
+ return n;
942
+ }
943
+ function B(n, e) {
944
+ return e === "y" ? n.scrollHeight - n.clientHeight > 1 : n.scrollWidth - n.clientWidth > 1;
945
+ }
946
+ function z(n, e) {
947
+ if (!B(n, e)) return !1;
948
+ if (e === "y") {
949
+ const t = n.scrollTop;
950
+ if (n.scrollTop = t + 1, n.scrollTop !== t)
951
+ return n.scrollTop = t, !0;
952
+ n.scrollTop = t - 1;
953
+ const r = n.scrollTop !== t;
954
+ return n.scrollTop = t, r;
955
+ } else {
956
+ const t = n.scrollLeft;
957
+ if (n.scrollLeft = t + 1, n.scrollLeft !== t)
958
+ return n.scrollLeft = t, !0;
959
+ n.scrollLeft = t - 1;
960
+ const r = n.scrollLeft !== t;
961
+ return n.scrollLeft = t, r;
962
+ }
904
963
  }
905
- function Et({ children: r, ref: e, ...t }) {
906
- const { isActive: a, transitionName: n } = $(), [s, c] = j();
907
- at(e, () => s.current);
908
- const i = k((u) => u.status), p = A.get(n), { decoratorName: h } = p, { initial: o, variants: d } = H.get(h);
909
- return I(() => {
964
+ function Ot({ children: n, ref: e, ...t }) {
965
+ const { isActive: a, transitionName: r } = Q(), [s, o] = rt();
966
+ yt(e, () => s.current);
967
+ const i = C((d) => d.status), c = $.get(r), { decoratorName: p } = c, { initial: u, variants: h } = j.get(p);
968
+ return R(() => {
910
969
  if (!s.current) return;
911
- const { value: u, options: l } = d[`${i}-${a}`];
912
- c(s.current, u, l);
913
- }, [i, a, c, d, s]), /* @__PURE__ */ P(
914
- K.div,
970
+ const { value: d, options: l } = h[`${i}-${a}`];
971
+ o(s.current, d, l);
972
+ }, [i, a, o, h, s]), /* @__PURE__ */ P(
973
+ at.div,
915
974
  {
916
975
  ref: s,
917
- initial: o,
976
+ initial: u,
918
977
  style: {
919
978
  position: "absolute",
920
979
  top: 0,
@@ -928,82 +987,144 @@ function Et({ children: r, ref: e, ...t }) {
928
987
  }
929
988
  );
930
989
  }
931
- const G = M((r) => ({
990
+ const Y = U((n) => ({
932
991
  transitionStatus: "IDLE",
933
- setTransitionStatus: (e) => r({ transitionStatus: e })
992
+ setTransitionStatus: (e) => n({ transitionStatus: e })
934
993
  }));
935
- function vt({ children: r, ...e }) {
936
- const [t, a] = j(), { id: n, isActive: s, isRoot: c, transitionName: i, prevTransitionName: p } = $(), h = rt(), o = k((m) => m.status), d = G((m) => m.transitionStatus), u = G.getState().setTransitionStatus, l = A.get(i), { variants: g, initial: D, swipeDirection: S, decoratorName: E } = l, v = H.get(E), x = R(null), _ = R(null), F = R(null), J = async (m, y) => {
937
- S && (x.current = t.current?.previousSibling, F.current = t.current?.previousSibling?.querySelector("& > [data-decorator]"), l?.onSwipeStart(m, y, {
938
- currentScreen: t.current,
939
- prevScreen: x.current,
940
- dragControls: h
941
- }), u("PENDING"));
942
- }, Z = (m, y) => {
943
- if (!S || d !== "PENDING")
994
+ function Ht({
995
+ children: n,
996
+ ...e
997
+ }) {
998
+ const [t, a] = rt(), { id: r, isActive: s, isRoot: o, transitionName: i, prevTransitionName: c } = Q(), p = wt(), u = C((f) => f.status), h = Y((f) => f.transitionStatus), d = Y.getState().setTransitionStatus, l = $.get(i), { variants: w, initial: A, swipeDirection: S, decoratorName: v } = l, E = j.get(v), b = L(null), O = L(null), H = L(null), T = L(!1), G = L(!1), D = L({
999
+ element: null,
1000
+ hasMarker: !1
1001
+ }), N = L({ element: null, hasMarker: !1 }), V = L(0), W = L(0), ct = async (f, y) => {
1002
+ if (!S)
944
1003
  return;
945
- const L = l?.onSwipe(m, y, {
1004
+ b.current = t.current?.previousSibling, H.current = t.current?.previousSibling?.querySelector("[data-decorator]");
1005
+ const g = await l?.onSwipeStart(f, y, {
946
1006
  currentScreen: t.current,
947
- prevScreen: x.current,
948
- dragControls: h
1007
+ prevScreen: b.current,
1008
+ dragControls: p,
1009
+ onStart: (k) => E?.onSwipeStart?.(k, {
1010
+ currentDecorator: O.current,
1011
+ prevDecorator: H.current
1012
+ })
949
1013
  });
950
- v?.onSwipe?.(L, {
951
- currentDecorator: _.current,
952
- prevDecorator: F.current
1014
+ d(g ? "PENDING" : "IDLE");
1015
+ }, ut = (f, y) => {
1016
+ !S || h !== "PENDING" || l?.onSwipe(f, y, {
1017
+ currentScreen: t.current,
1018
+ prevScreen: b.current,
1019
+ dragControls: p,
1020
+ onProgress: (g, k) => E?.onSwipe?.(g, k, {
1021
+ currentDecorator: O.current,
1022
+ prevDecorator: H.current
1023
+ })
953
1024
  });
954
- }, z = async (m, y) => {
955
- if (!S || d !== "PENDING")
1025
+ }, lt = async (f, y) => {
1026
+ if (!S || h !== "PENDING")
956
1027
  return;
957
- await l?.onSwipeEnd(m, y, {
1028
+ await l?.onSwipeEnd(f, y, {
958
1029
  currentScreen: t.current,
959
- prevScreen: x.current
960
- }) ? window.history.back() : u("IDLE");
1030
+ prevScreen: b.current,
1031
+ onStart: (k) => E?.onSwipeEnd?.(k, {
1032
+ currentDecorator: O.current,
1033
+ prevDecorator: H.current
1034
+ })
1035
+ }) ? window.history.back() : d("IDLE");
1036
+ }, dt = (f) => {
1037
+ if (!(!o && s && u === "COMPLETED" && h === "IDLE" && !!S))
1038
+ return;
1039
+ D.current = Z(f.target, {
1040
+ direction: "x"
1041
+ }), N.current = Z(f.target, {
1042
+ direction: "y"
1043
+ }), V.current = f.clientX, W.current = f.clientY, (!D.current.element && !N.current.element || D.current.element || N.current.element) && (T.current = !0);
1044
+ }, pt = (f) => {
1045
+ const y = !D.current.element && !N.current.element;
1046
+ if (T.current && y)
1047
+ T.current = !1, G.current = !0, p.start(f);
1048
+ else if (T.current && !y) {
1049
+ const g = f.clientX - V.current, k = f.clientY - W.current, ht = N.current.element && N.current.element.scrollTop <= 0 && N.current.hasMarker, mt = D.current.element && D.current.element.scrollLeft <= 0 && D.current.hasMarker;
1050
+ (S === "y" && (ht || D.current.element) && k > 0 && g < 2 || S === "x" && (mt || N.current.element) && g > 0 && k < 2) && (T.current = !1, G.current = !0, p.start(f));
1051
+ }
1052
+ }, ft = () => {
1053
+ T.current = !1, G.current = !1;
961
1054
  };
962
- return I(() => {
963
- const m = t.current;
964
- if (!m) return;
965
- const y = (L) => L.preventDefault();
966
- return m.addEventListener("touchmove", y), () => {
967
- m.removeEventListener("touchmove", y);
1055
+ return R(() => {
1056
+ const f = t.current;
1057
+ if (!f) return;
1058
+ const y = (g) => {
1059
+ G.current && g.preventDefault(), g.target?.dataset.swipeAtEdgeBar === "true" && g.preventDefault();
968
1060
  };
969
- }, [t]), I(() => {
1061
+ return f.addEventListener("touchmove", y, {
1062
+ passive: !1
1063
+ }), () => {
1064
+ f.removeEventListener("touchmove", y);
1065
+ };
1066
+ }, [t]), R(() => {
970
1067
  t.current && (async () => {
971
- const { value: m, options: y } = g[`${o}-${s}`], L = o === "REPLACING" && p !== i;
972
- !s && L && (u("PENDING"), await a(t.current, gt, {
1068
+ const { value: f, options: y } = w[`${u}-${s}`], g = u === "REPLACING" && c !== i;
1069
+ !s && g && (d("PENDING"), await a(t.current, Rt, {
973
1070
  duration: 0.01
974
- })), await a(t.current, m, y), await f.resolveTask(n), !s && !L && u("IDLE");
1071
+ })), await a(t.current, f, y), await m.resolveTask(r), !s && !g && d("IDLE");
975
1072
  })();
976
1073
  }, [
977
- o,
1074
+ u,
978
1075
  s,
979
- n,
980
- p,
1076
+ r,
1077
+ c,
981
1078
  i,
982
1079
  a,
983
1080
  t,
984
- u,
985
- g
986
- ]), /* @__PURE__ */ q(
987
- K.div,
1081
+ d,
1082
+ w
1083
+ ]), /* @__PURE__ */ tt(
1084
+ at.div,
988
1085
  {
989
1086
  ref: t,
990
- initial: D,
1087
+ ...e,
1088
+ initial: A,
991
1089
  drag: S,
992
- dragListener: !c && s && o === "COMPLETED" && d === "IDLE",
993
- dragControls: h,
994
- onDragStart: J,
995
- onDrag: Z,
996
- onDragEnd: z,
1090
+ dragListener: !1,
1091
+ dragControls: p,
1092
+ onDragStart: ct,
1093
+ onDrag: ut,
1094
+ onDragEnd: lt,
1095
+ onPointerDown: dt,
1096
+ onPointerMove: pt,
1097
+ onPointerUp: ft,
997
1098
  style: {
998
1099
  position: "absolute",
999
1100
  top: 0,
1000
1101
  left: 0,
1001
1102
  width: "100%",
1002
1103
  height: "100%",
1104
+ display: "flex",
1105
+ flexDirection: "column",
1003
1106
  backgroundColor: "white",
1107
+ boxSizing: "border-box",
1108
+ touchAction: "none",
1109
+ isolation: "isolate",
1110
+ contain: "strict",
1004
1111
  ...e.style
1005
1112
  },
1006
1113
  children: [
1114
+ /* @__PURE__ */ P(
1115
+ "div",
1116
+ {
1117
+ "data-swipe-at-edge-bar": !0,
1118
+ style: {
1119
+ position: "absolute",
1120
+ top: 0,
1121
+ left: 0,
1122
+ width: 8,
1123
+ height: "100%",
1124
+ zIndex: 1
1125
+ }
1126
+ }
1127
+ ),
1007
1128
  /* @__PURE__ */ P(
1008
1129
  "div",
1009
1130
  {
@@ -1014,28 +1135,45 @@ function vt({ children: r, ...e }) {
1014
1135
  width: "100%",
1015
1136
  height: "100%"
1016
1137
  },
1017
- children: r
1138
+ children: n
1018
1139
  }
1019
1140
  ),
1020
- v && /* @__PURE__ */ P(Et, { ref: _ })
1141
+ E && /* @__PURE__ */ P(Ot, { ref: O }),
1142
+ /* @__PURE__ */ P(
1143
+ "div",
1144
+ {
1145
+ "data-swipe-at-edge-bar": !0,
1146
+ style: {
1147
+ position: "absolute",
1148
+ top: 0,
1149
+ right: 0,
1150
+ width: 8,
1151
+ height: "100%",
1152
+ zIndex: 1
1153
+ }
1154
+ }
1155
+ )
1021
1156
  ]
1022
1157
  }
1023
1158
  );
1024
1159
  }
1025
- function Ot({ children: r, ...e }) {
1026
- const { isActive: t, isPrev: a } = $(), n = k((p) => p.status), s = G((p) => p.transitionStatus);
1027
- return /* @__PURE__ */ P(St, { freeze: !t && (n === "COMPLETED" && s === "IDLE" || a), children: /* @__PURE__ */ P(vt, { ...e, children: r }) });
1160
+ function Wt({
1161
+ children: n,
1162
+ ...e
1163
+ }) {
1164
+ const { isActive: t, isPrev: a } = Q(), r = C((c) => c.status), s = Y((c) => c.transitionStatus);
1165
+ return /* @__PURE__ */ P(Gt, { freeze: !t && (r === "COMPLETED" && s === "IDLE" || a), children: /* @__PURE__ */ P(Ht, { ...e, children: n }) });
1028
1166
  }
1029
1167
  export {
1030
- xt as Route,
1031
- kt as Router,
1032
- Ot as Screen,
1033
- pt as createDecorator,
1034
- Gt as createRawDecorator,
1035
- Ct as createRawTransition,
1036
- U as createTransition,
1037
- Mt as useNavigate,
1038
- Rt as useParams,
1039
- $ as useScreen,
1040
- At as useStep
1168
+ Xt as Route,
1169
+ Yt as Router,
1170
+ Wt as Screen,
1171
+ Nt as createDecorator,
1172
+ Vt as createRawDecorator,
1173
+ Qt as createRawTransition,
1174
+ K as createTransition,
1175
+ qt as useNavigate,
1176
+ Kt as useParams,
1177
+ Q as useScreen,
1178
+ jt as useStep
1041
1179
  };