@rpcbase/ui 0.218.0 → 0.220.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (230) hide show
  1. package/dist/components/AddressAutocompleteInput/index.d.ts.map +1 -1
  2. package/dist/index100.js +4 -5
  3. package/dist/index100.js.map +1 -1
  4. package/dist/index101.js +8 -4
  5. package/dist/index101.js.map +1 -1
  6. package/dist/index102.js +5 -8
  7. package/dist/index102.js.map +1 -1
  8. package/dist/index103.js +4 -5
  9. package/dist/index103.js.map +1 -1
  10. package/dist/index104.js +3 -3
  11. package/dist/index104.js.map +1 -1
  12. package/dist/index105.js +6 -4
  13. package/dist/index105.js.map +1 -1
  14. package/dist/index106.js +145 -6
  15. package/dist/index106.js.map +1 -1
  16. package/dist/index107.js +38 -144
  17. package/dist/index107.js.map +1 -1
  18. package/dist/index108.js +4 -39
  19. package/dist/index108.js.map +1 -1
  20. package/dist/index109.js +7 -4
  21. package/dist/index109.js.map +1 -1
  22. package/dist/index110.js +12 -6
  23. package/dist/index110.js.map +1 -1
  24. package/dist/index111.js +13 -13
  25. package/dist/index111.js.map +1 -1
  26. package/dist/index112.js +7 -13
  27. package/dist/index112.js.map +1 -1
  28. package/dist/index113.js +30 -6
  29. package/dist/index113.js.map +1 -1
  30. package/dist/index114.js +10 -31
  31. package/dist/index114.js.map +1 -1
  32. package/dist/index115.js +10 -10
  33. package/dist/index115.js.map +1 -1
  34. package/dist/index116.js +8 -10
  35. package/dist/index116.js.map +1 -1
  36. package/dist/index117.js +13 -8
  37. package/dist/index117.js.map +1 -1
  38. package/dist/index118.js +101 -13
  39. package/dist/index118.js.map +1 -1
  40. package/dist/index119.js +20 -102
  41. package/dist/index119.js.map +1 -1
  42. package/dist/index120.js +54 -20
  43. package/dist/index120.js.map +1 -1
  44. package/dist/index121.js +70 -51
  45. package/dist/index121.js.map +1 -1
  46. package/dist/index122.js +9 -72
  47. package/dist/index122.js.map +1 -1
  48. package/dist/index123.js +20 -9
  49. package/dist/index123.js.map +1 -1
  50. package/dist/index124.js +16 -20
  51. package/dist/index124.js.map +1 -1
  52. package/dist/index125.js +23 -16
  53. package/dist/index125.js.map +1 -1
  54. package/dist/index126.js +6 -23
  55. package/dist/index126.js.map +1 -1
  56. package/dist/index127.js +5 -6
  57. package/dist/index127.js.map +1 -1
  58. package/dist/index128.js +23 -5
  59. package/dist/index128.js.map +1 -1
  60. package/dist/index129.js +35 -24
  61. package/dist/index129.js.map +1 -1
  62. package/dist/index130.js +16 -35
  63. package/dist/index130.js.map +1 -1
  64. package/dist/index131.js +7 -16
  65. package/dist/index131.js.map +1 -1
  66. package/dist/index132.js +4 -6
  67. package/dist/index132.js.map +1 -1
  68. package/dist/index133.js +4 -4
  69. package/dist/index133.js.map +1 -1
  70. package/dist/index134.js +4 -4
  71. package/dist/index134.js.map +1 -1
  72. package/dist/index135.js +4 -4
  73. package/dist/index135.js.map +1 -1
  74. package/dist/index136.js +3 -4
  75. package/dist/index136.js.map +1 -1
  76. package/dist/index137.js +6 -3
  77. package/dist/index137.js.map +1 -1
  78. package/dist/index138.js +24 -7
  79. package/dist/index138.js.map +1 -1
  80. package/dist/index139.js +8 -24
  81. package/dist/index139.js.map +1 -1
  82. package/dist/index140.js +6 -7
  83. package/dist/index140.js.map +1 -1
  84. package/dist/index141.js +5 -6
  85. package/dist/index141.js.map +1 -1
  86. package/dist/index142.js +3 -5
  87. package/dist/index142.js.map +1 -1
  88. package/dist/index143.js +3 -3
  89. package/dist/index143.js.map +1 -1
  90. package/dist/index144.js +4 -3
  91. package/dist/index144.js.map +1 -1
  92. package/dist/index145.js +3 -4
  93. package/dist/index145.js.map +1 -1
  94. package/dist/index146.js +4 -3
  95. package/dist/index146.js.map +1 -1
  96. package/dist/index147.js +3 -4
  97. package/dist/index147.js.map +1 -1
  98. package/dist/index148.js +3 -3
  99. package/dist/index148.js.map +1 -1
  100. package/dist/index149.js +3 -3
  101. package/dist/index149.js.map +1 -1
  102. package/dist/index150.js +46 -3
  103. package/dist/index150.js.map +1 -1
  104. package/dist/index151.js +1 -1
  105. package/dist/index153.js +1 -1
  106. package/dist/index154.js +1 -1
  107. package/dist/index181.js +1 -1
  108. package/dist/index228.js +1 -1
  109. package/dist/index231.js +1 -1
  110. package/dist/index233.js +1 -1
  111. package/dist/index234.js +1 -1
  112. package/dist/index235.js +3 -3
  113. package/dist/index236.js +2 -2
  114. package/dist/index269.js +1 -1
  115. package/dist/index271.js +4 -4
  116. package/dist/index294.js +69 -65
  117. package/dist/index294.js.map +1 -1
  118. package/dist/index295.js +8 -68
  119. package/dist/index295.js.map +1 -1
  120. package/dist/index296.js +14 -9
  121. package/dist/index296.js.map +1 -1
  122. package/dist/index297.js +66 -14
  123. package/dist/index297.js.map +1 -1
  124. package/dist/index298.js +64 -65
  125. package/dist/index298.js.map +1 -1
  126. package/dist/index3.js +99 -87
  127. package/dist/index3.js.map +1 -1
  128. package/dist/index31.js +5 -5
  129. package/dist/index32.js +24 -24
  130. package/dist/index33.js +3 -3
  131. package/dist/index36.js +1 -1
  132. package/dist/index37.js +2 -2
  133. package/dist/index41.js +20 -20
  134. package/dist/index49.js +1 -1
  135. package/dist/index50.js +1 -1
  136. package/dist/index53.js +7 -2
  137. package/dist/index53.js.map +1 -1
  138. package/dist/index54.js +34 -2
  139. package/dist/index54.js.map +1 -1
  140. package/dist/index55.js +47 -5
  141. package/dist/index55.js.map +1 -1
  142. package/dist/index56.js +7 -33
  143. package/dist/index56.js.map +1 -1
  144. package/dist/index57.js +11 -48
  145. package/dist/index57.js.map +1 -1
  146. package/dist/index58.js +3 -7
  147. package/dist/index58.js.map +1 -1
  148. package/dist/index59.js +47 -11
  149. package/dist/index59.js.map +1 -1
  150. package/dist/index60.js +50 -3
  151. package/dist/index60.js.map +1 -1
  152. package/dist/index61.js +7 -47
  153. package/dist/index61.js.map +1 -1
  154. package/dist/index62.js +12 -48
  155. package/dist/index62.js.map +1 -1
  156. package/dist/index63.js +133 -7
  157. package/dist/index63.js.map +1 -1
  158. package/dist/index64.js +10 -14
  159. package/dist/index64.js.map +1 -1
  160. package/dist/index65.js +210 -127
  161. package/dist/index65.js.map +1 -1
  162. package/dist/index66.js +12 -10
  163. package/dist/index66.js.map +1 -1
  164. package/dist/index67.js +44 -214
  165. package/dist/index67.js.map +1 -1
  166. package/dist/index68.js +49 -12
  167. package/dist/index68.js.map +1 -1
  168. package/dist/index69.js +4 -47
  169. package/dist/index69.js.map +1 -1
  170. package/dist/index70.js +5 -49
  171. package/dist/index70.js.map +1 -1
  172. package/dist/index71.js +28 -4
  173. package/dist/index71.js.map +1 -1
  174. package/dist/index72.js +50 -6
  175. package/dist/index72.js.map +1 -1
  176. package/dist/index73.js +9 -28
  177. package/dist/index73.js.map +1 -1
  178. package/dist/index74.js +6 -50
  179. package/dist/index74.js.map +1 -1
  180. package/dist/index75.js +8 -9
  181. package/dist/index75.js.map +1 -1
  182. package/dist/index76.js +5 -5
  183. package/dist/index76.js.map +1 -1
  184. package/dist/index77.js +2 -8
  185. package/dist/index77.js.map +1 -1
  186. package/dist/index78.js +2 -6
  187. package/dist/index78.js.map +1 -1
  188. package/dist/index79.js +52 -47
  189. package/dist/index79.js.map +1 -1
  190. package/dist/index80.js +5 -52
  191. package/dist/index80.js.map +1 -1
  192. package/dist/index81.js +4 -4
  193. package/dist/index81.js.map +1 -1
  194. package/dist/index82.js +15 -4
  195. package/dist/index82.js.map +1 -1
  196. package/dist/index83.js +5 -15
  197. package/dist/index83.js.map +1 -1
  198. package/dist/index84.js +7 -5
  199. package/dist/index84.js.map +1 -1
  200. package/dist/index85.js +15 -6
  201. package/dist/index85.js.map +1 -1
  202. package/dist/index86.js +4 -16
  203. package/dist/index86.js.map +1 -1
  204. package/dist/index87.js +1 -1
  205. package/dist/index87.js.map +1 -1
  206. package/dist/index88.js +5 -4
  207. package/dist/index88.js.map +1 -1
  208. package/dist/index89.js +4 -4
  209. package/dist/index89.js.map +1 -1
  210. package/dist/index90.js +4 -5
  211. package/dist/index90.js.map +1 -1
  212. package/dist/index91.js +2 -2
  213. package/dist/index91.js.map +1 -1
  214. package/dist/index92.js +5 -3
  215. package/dist/index92.js.map +1 -1
  216. package/dist/index93.js +24 -6
  217. package/dist/index93.js.map +1 -1
  218. package/dist/index94.js +6 -24
  219. package/dist/index94.js.map +1 -1
  220. package/dist/index95.js +4 -6
  221. package/dist/index95.js.map +1 -1
  222. package/dist/index96.js +5 -3
  223. package/dist/index96.js.map +1 -1
  224. package/dist/index97.js +5 -6
  225. package/dist/index97.js.map +1 -1
  226. package/dist/index98.js +4 -5
  227. package/dist/index98.js.map +1 -1
  228. package/dist/index99.js +4 -3
  229. package/dist/index99.js.map +1 -1
  230. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index297.js","sources":["../../../node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js"],"sourcesContent":["var passiveSupported = false;\nif (typeof window !== 'undefined') {\n try {\n var options = Object.defineProperty({}, 'passive', {\n get: function () {\n passiveSupported = true;\n return true;\n },\n });\n // @ts-ignore\n window.addEventListener('test', options, options);\n // @ts-ignore\n window.removeEventListener('test', options, options);\n }\n catch (err) {\n passiveSupported = false;\n }\n}\nexport var nonPassive = passiveSupported ? { passive: false } : false;\n"],"names":["passiveSupported","options","nonPassive"],"mappings":"AAAA,IAAIA,IAAmB;AACvB,IAAI,OAAO,SAAW;AAClB,MAAI;AACA,QAAIC,IAAU,OAAO,eAAe,CAAA,GAAI,WAAW;AAAA,MAC/C,KAAK,WAAY;AACb,eAAAD,IAAmB,IACZ;AAAA,MACX;AAAA,IACZ,CAAS;AAED,WAAO,iBAAiB,QAAQC,GAASA,CAAO,GAEhD,OAAO,oBAAoB,QAAQA,GAASA,CAAO;AAAA,EACvD,QACY;AACR,IAAAD,IAAmB;AAAA,EACvB;AAEM,IAACE,IAAaF,IAAmB,EAAE,SAAS,GAAK,IAAK;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index297.js","sources":["../../../node_modules/react-remove-scroll/dist/es2015/handleScroll.js"],"sourcesContent":["var alwaysContainsScroll = function (node) {\n // textarea will always _contain_ scroll inside self. It only can be hidden\n return node.tagName === 'TEXTAREA';\n};\nvar elementCanBeScrolled = function (node, overflow) {\n if (!(node instanceof Element)) {\n return false;\n }\n var styles = window.getComputedStyle(node);\n return (\n // not-not-scrollable\n styles[overflow] !== 'hidden' &&\n // contains scroll inside self\n !(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === 'visible'));\n};\nvar elementCouldBeVScrolled = function (node) { return elementCanBeScrolled(node, 'overflowY'); };\nvar elementCouldBeHScrolled = function (node) { return elementCanBeScrolled(node, 'overflowX'); };\nexport var locationCouldBeScrolled = function (axis, node) {\n var ownerDocument = node.ownerDocument;\n var current = node;\n do {\n // Skip over shadow root\n if (typeof ShadowRoot !== 'undefined' && current instanceof ShadowRoot) {\n current = current.host;\n }\n var isScrollable = elementCouldBeScrolled(axis, current);\n if (isScrollable) {\n var _a = getScrollVariables(axis, current), scrollHeight = _a[1], clientHeight = _a[2];\n if (scrollHeight > clientHeight) {\n return true;\n }\n }\n current = current.parentNode;\n } while (current && current !== ownerDocument.body);\n return false;\n};\nvar getVScrollVariables = function (_a) {\n var scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight;\n return [\n scrollTop,\n scrollHeight,\n clientHeight,\n ];\n};\nvar getHScrollVariables = function (_a) {\n var scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth;\n return [\n scrollLeft,\n scrollWidth,\n clientWidth,\n ];\n};\nvar elementCouldBeScrolled = function (axis, node) {\n return axis === 'v' ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node);\n};\nvar getScrollVariables = function (axis, node) {\n return axis === 'v' ? getVScrollVariables(node) : getHScrollVariables(node);\n};\nvar getDirectionFactor = function (axis, direction) {\n /**\n * If the element's direction is rtl (right-to-left), then scrollLeft is 0 when the scrollbar is at its rightmost position,\n * and then increasingly negative as you scroll towards the end of the content.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft\n */\n return axis === 'h' && direction === 'rtl' ? -1 : 1;\n};\nexport var handleScroll = function (axis, endTarget, event, sourceDelta, noOverscroll) {\n var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction);\n var delta = directionFactor * sourceDelta;\n // find scrollable target\n var target = event.target;\n var targetInLock = endTarget.contains(target);\n var shouldCancelScroll = false;\n var isDeltaPositive = delta > 0;\n var availableScroll = 0;\n var availableScrollTop = 0;\n do {\n if (!target) {\n break;\n }\n var _a = getScrollVariables(axis, target), position = _a[0], scroll_1 = _a[1], capacity = _a[2];\n var elementScroll = scroll_1 - capacity - directionFactor * position;\n if (position || elementScroll) {\n if (elementCouldBeScrolled(axis, target)) {\n availableScroll += elementScroll;\n availableScrollTop += position;\n }\n }\n var parent_1 = target.parentNode;\n // we will \"bubble\" from ShadowDom in case we are, or just to the parent in normal case\n // this is the same logic used in focus-lock\n target = (parent_1 && parent_1.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? parent_1.host : parent_1);\n } while (\n // portaled content\n (!targetInLock && target !== document.body) ||\n // self content\n (targetInLock && (endTarget.contains(target) || endTarget === target)));\n // handle epsilon around 0 (non standard zoom levels)\n if (isDeltaPositive &&\n ((noOverscroll && Math.abs(availableScroll) < 1) || (!noOverscroll && delta > availableScroll))) {\n shouldCancelScroll = true;\n }\n else if (!isDeltaPositive &&\n ((noOverscroll && Math.abs(availableScrollTop) < 1) || (!noOverscroll && -delta > availableScrollTop))) {\n shouldCancelScroll = true;\n }\n return shouldCancelScroll;\n};\n"],"names":["alwaysContainsScroll","node","elementCanBeScrolled","overflow","styles","elementCouldBeVScrolled","elementCouldBeHScrolled","locationCouldBeScrolled","axis","ownerDocument","current","isScrollable","elementCouldBeScrolled","_a","getScrollVariables","scrollHeight","clientHeight","getVScrollVariables","scrollTop","getHScrollVariables","scrollLeft","scrollWidth","clientWidth","getDirectionFactor","direction","handleScroll","endTarget","event","sourceDelta","noOverscroll","directionFactor","delta","target","targetInLock","shouldCancelScroll","isDeltaPositive","availableScroll","availableScrollTop","position","scroll_1","capacity","elementScroll","parent_1"],"mappings":"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","x_google_ignoreList":[0]}
package/dist/index298.js CHANGED
@@ -1,69 +1,68 @@
1
- var N = function(r) {
2
- return r.tagName === "TEXTAREA";
3
- }, b = function(r, e) {
4
- if (!(r instanceof Element))
5
- return !1;
6
- var t = window.getComputedStyle(r);
7
- return (
8
- // not-not-scrollable
9
- t[e] !== "hidden" && // contains scroll inside self
10
- !(t.overflowY === t.overflowX && !N(r) && t[e] === "visible")
11
- );
12
- }, D = function(r) {
13
- return b(r, "overflowY");
14
- }, E = function(r) {
15
- return b(r, "overflowX");
16
- }, T = function(r, e) {
17
- var t = e.ownerDocument, l = e;
18
- do {
19
- typeof ShadowRoot < "u" && l instanceof ShadowRoot && (l = l.host);
20
- var f = g(r, l);
21
- if (f) {
22
- var n = m(r, l), i = n[1], o = n[2];
23
- if (i > o)
24
- return !0;
1
+ import { __assign as d } from "./index237.js";
2
+ function l(r) {
3
+ return r;
4
+ }
5
+ function h(r, t) {
6
+ t === void 0 && (t = l);
7
+ var e = [], o = !1, c = {
8
+ read: function() {
9
+ if (o)
10
+ throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
11
+ return e.length ? e[e.length - 1] : r;
12
+ },
13
+ useMedium: function(u) {
14
+ var n = t(u, o);
15
+ return e.push(n), function() {
16
+ e = e.filter(function(i) {
17
+ return i !== n;
18
+ });
19
+ };
20
+ },
21
+ assignSyncMedium: function(u) {
22
+ for (o = !0; e.length; ) {
23
+ var n = e;
24
+ e = [], n.forEach(u);
25
+ }
26
+ e = {
27
+ push: function(i) {
28
+ return u(i);
29
+ },
30
+ filter: function() {
31
+ return e;
32
+ }
33
+ };
34
+ },
35
+ assignMedium: function(u) {
36
+ o = !0;
37
+ var n = [];
38
+ if (e.length) {
39
+ var i = e;
40
+ e = [], i.forEach(u), n = e;
41
+ }
42
+ var s = function() {
43
+ var f = n;
44
+ n = [], f.forEach(u);
45
+ }, a = function() {
46
+ return Promise.resolve().then(s);
47
+ };
48
+ a(), e = {
49
+ push: function(f) {
50
+ n.push(f), a();
51
+ },
52
+ filter: function(f) {
53
+ return n = n.filter(f), e;
54
+ }
55
+ };
25
56
  }
26
- l = l.parentNode;
27
- } while (l && l !== t.body);
28
- return !1;
29
- }, H = function(r) {
30
- var e = r.scrollTop, t = r.scrollHeight, l = r.clientHeight;
31
- return [
32
- e,
33
- t,
34
- l
35
- ];
36
- }, p = function(r) {
37
- var e = r.scrollLeft, t = r.scrollWidth, l = r.clientWidth;
38
- return [
39
- e,
40
- t,
41
- l
42
- ];
43
- }, g = function(r, e) {
44
- return r === "v" ? D(e) : E(e);
45
- }, m = function(r, e) {
46
- return r === "v" ? H(e) : p(e);
47
- }, B = function(r, e) {
48
- return r === "h" && e === "rtl" ? -1 : 1;
49
- }, V = function(r, e, t, l, f) {
50
- var n = B(r, window.getComputedStyle(e).direction), i = n * l, o = t.target, d = e.contains(o), c = !1, s = i > 0, h = 0, S = 0;
51
- do {
52
- if (!o)
53
- break;
54
- var u = m(r, o), v = u[0], C = u[1], y = u[2], w = C - y - n * v;
55
- (v || w) && g(r, o) && (h += w, S += v);
56
- var a = o.parentNode;
57
- o = a && a.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? a.host : a;
58
- } while (
59
- // portaled content
60
- !d && o !== document.body || // self content
61
- d && (e.contains(o) || e === o)
62
- );
63
- return (s && Math.abs(h) < 1 || !s && Math.abs(S) < 1) && (c = !0), c;
64
- };
57
+ };
58
+ return c;
59
+ }
60
+ function v(r) {
61
+ r === void 0 && (r = {});
62
+ var t = h(null);
63
+ return t.options = d({ async: !0, ssr: !1 }, r), t;
64
+ }
65
65
  export {
66
- V as handleScroll,
67
- T as locationCouldBeScrolled
66
+ v as createSidecarMedium
68
67
  };
69
68
  //# sourceMappingURL=index298.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index298.js","sources":["../../../node_modules/react-remove-scroll/dist/es2015/handleScroll.js"],"sourcesContent":["var alwaysContainsScroll = function (node) {\n // textarea will always _contain_ scroll inside self. It only can be hidden\n return node.tagName === 'TEXTAREA';\n};\nvar elementCanBeScrolled = function (node, overflow) {\n if (!(node instanceof Element)) {\n return false;\n }\n var styles = window.getComputedStyle(node);\n return (\n // not-not-scrollable\n styles[overflow] !== 'hidden' &&\n // contains scroll inside self\n !(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === 'visible'));\n};\nvar elementCouldBeVScrolled = function (node) { return elementCanBeScrolled(node, 'overflowY'); };\nvar elementCouldBeHScrolled = function (node) { return elementCanBeScrolled(node, 'overflowX'); };\nexport var locationCouldBeScrolled = function (axis, node) {\n var ownerDocument = node.ownerDocument;\n var current = node;\n do {\n // Skip over shadow root\n if (typeof ShadowRoot !== 'undefined' && current instanceof ShadowRoot) {\n current = current.host;\n }\n var isScrollable = elementCouldBeScrolled(axis, current);\n if (isScrollable) {\n var _a = getScrollVariables(axis, current), scrollHeight = _a[1], clientHeight = _a[2];\n if (scrollHeight > clientHeight) {\n return true;\n }\n }\n current = current.parentNode;\n } while (current && current !== ownerDocument.body);\n return false;\n};\nvar getVScrollVariables = function (_a) {\n var scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight;\n return [\n scrollTop,\n scrollHeight,\n clientHeight,\n ];\n};\nvar getHScrollVariables = function (_a) {\n var scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth;\n return [\n scrollLeft,\n scrollWidth,\n clientWidth,\n ];\n};\nvar elementCouldBeScrolled = function (axis, node) {\n return axis === 'v' ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node);\n};\nvar getScrollVariables = function (axis, node) {\n return axis === 'v' ? getVScrollVariables(node) : getHScrollVariables(node);\n};\nvar getDirectionFactor = function (axis, direction) {\n /**\n * If the element's direction is rtl (right-to-left), then scrollLeft is 0 when the scrollbar is at its rightmost position,\n * and then increasingly negative as you scroll towards the end of the content.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft\n */\n return axis === 'h' && direction === 'rtl' ? -1 : 1;\n};\nexport var handleScroll = function (axis, endTarget, event, sourceDelta, noOverscroll) {\n var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction);\n var delta = directionFactor * sourceDelta;\n // find scrollable target\n var target = event.target;\n var targetInLock = endTarget.contains(target);\n var shouldCancelScroll = false;\n var isDeltaPositive = delta > 0;\n var availableScroll = 0;\n var availableScrollTop = 0;\n do {\n if (!target) {\n break;\n }\n var _a = getScrollVariables(axis, target), position = _a[0], scroll_1 = _a[1], capacity = _a[2];\n var elementScroll = scroll_1 - capacity - directionFactor * position;\n if (position || elementScroll) {\n if (elementCouldBeScrolled(axis, target)) {\n availableScroll += elementScroll;\n availableScrollTop += position;\n }\n }\n var parent_1 = target.parentNode;\n // we will \"bubble\" from ShadowDom in case we are, or just to the parent in normal case\n // this is the same logic used in focus-lock\n target = (parent_1 && parent_1.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? parent_1.host : parent_1);\n } while (\n // portaled content\n (!targetInLock && target !== document.body) ||\n // self content\n (targetInLock && (endTarget.contains(target) || endTarget === target)));\n // handle epsilon around 0 (non standard zoom levels)\n if (isDeltaPositive &&\n ((noOverscroll && Math.abs(availableScroll) < 1) || (!noOverscroll && delta > availableScroll))) {\n shouldCancelScroll = true;\n }\n else if (!isDeltaPositive &&\n ((noOverscroll && Math.abs(availableScrollTop) < 1) || (!noOverscroll && -delta > availableScrollTop))) {\n shouldCancelScroll = true;\n }\n return shouldCancelScroll;\n};\n"],"names":["alwaysContainsScroll","node","elementCanBeScrolled","overflow","styles","elementCouldBeVScrolled","elementCouldBeHScrolled","locationCouldBeScrolled","axis","ownerDocument","current","isScrollable","elementCouldBeScrolled","_a","getScrollVariables","scrollHeight","clientHeight","getVScrollVariables","scrollTop","getHScrollVariables","scrollLeft","scrollWidth","clientWidth","getDirectionFactor","direction","handleScroll","endTarget","event","sourceDelta","noOverscroll","directionFactor","delta","target","targetInLock","shouldCancelScroll","isDeltaPositive","availableScroll","availableScrollTop","position","scroll_1","capacity","elementScroll","parent_1"],"mappings":"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","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index298.js","sources":["../../../node_modules/use-sidecar/dist/es2015/medium.js"],"sourcesContent":["import { __assign } from \"tslib\";\nfunction ItoI(a) {\n return a;\n}\nfunction innerCreateMedium(defaults, middleware) {\n if (middleware === void 0) { middleware = ItoI; }\n var buffer = [];\n var assigned = false;\n var medium = {\n read: function () {\n if (assigned) {\n throw new Error('Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.');\n }\n if (buffer.length) {\n return buffer[buffer.length - 1];\n }\n return defaults;\n },\n useMedium: function (data) {\n var item = middleware(data, assigned);\n buffer.push(item);\n return function () {\n buffer = buffer.filter(function (x) { return x !== item; });\n };\n },\n assignSyncMedium: function (cb) {\n assigned = true;\n while (buffer.length) {\n var cbs = buffer;\n buffer = [];\n cbs.forEach(cb);\n }\n buffer = {\n push: function (x) { return cb(x); },\n filter: function () { return buffer; },\n };\n },\n assignMedium: function (cb) {\n assigned = true;\n var pendingQueue = [];\n if (buffer.length) {\n var cbs = buffer;\n buffer = [];\n cbs.forEach(cb);\n pendingQueue = buffer;\n }\n var executeQueue = function () {\n var cbs = pendingQueue;\n pendingQueue = [];\n cbs.forEach(cb);\n };\n var cycle = function () { return Promise.resolve().then(executeQueue); };\n cycle();\n buffer = {\n push: function (x) {\n pendingQueue.push(x);\n cycle();\n },\n filter: function (filter) {\n pendingQueue = pendingQueue.filter(filter);\n return buffer;\n },\n };\n },\n };\n return medium;\n}\nexport function createMedium(defaults, middleware) {\n if (middleware === void 0) { middleware = ItoI; }\n return innerCreateMedium(defaults, middleware);\n}\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function createSidecarMedium(options) {\n if (options === void 0) { options = {}; }\n var medium = innerCreateMedium(null);\n medium.options = __assign({ async: true, ssr: false }, options);\n return medium;\n}\n"],"names":["ItoI","a","innerCreateMedium","defaults","middleware","buffer","assigned","medium","data","item","x","cb","cbs","pendingQueue","executeQueue","cycle","filter","createSidecarMedium","options","__assign"],"mappings":";AACA,SAASA,EAAKC,GAAG;AACb,SAAOA;AACX;AACA,SAASC,EAAkBC,GAAUC,GAAY;AAC7C,EAAIA,MAAe,WAAUA,IAAaJ;AAC1C,MAAIK,IAAS,CAAA,GACTC,IAAW,IACXC,IAAS;AAAA,IACT,MAAM,WAAY;AACd,UAAID;AACA,cAAM,IAAI,MAAM,kGAAkG;AAEtH,aAAID,EAAO,SACAA,EAAOA,EAAO,SAAS,CAAC,IAE5BF;AAAA,IACX;AAAA,IACA,WAAW,SAAUK,GAAM;AACvB,UAAIC,IAAOL,EAAWI,GAAMF,CAAQ;AACpC,aAAAD,EAAO,KAAKI,CAAI,GACT,WAAY;AACf,QAAAJ,IAASA,EAAO,OAAO,SAAUK,GAAG;AAAE,iBAAOA,MAAMD;AAAA,QAAM,CAAC;AAAA,MAC9D;AAAA,IACJ;AAAA,IACA,kBAAkB,SAAUE,GAAI;AAE5B,WADAL,IAAW,IACJD,EAAO,UAAQ;AAClB,YAAIO,IAAMP;AACV,QAAAA,IAAS,CAAA,GACTO,EAAI,QAAQD,CAAE;AAAA,MAClB;AACA,MAAAN,IAAS;AAAA,QACL,MAAM,SAAUK,GAAG;AAAE,iBAAOC,EAAGD,CAAC;AAAA,QAAG;AAAA,QACnC,QAAQ,WAAY;AAAE,iBAAOL;AAAA,QAAQ;AAAA,MACrD;AAAA,IACQ;AAAA,IACA,cAAc,SAAUM,GAAI;AACxB,MAAAL,IAAW;AACX,UAAIO,IAAe,CAAA;AACnB,UAAIR,EAAO,QAAQ;AACf,YAAIO,IAAMP;AACV,QAAAA,IAAS,CAAA,GACTO,EAAI,QAAQD,CAAE,GACdE,IAAeR;AAAA,MACnB;AACA,UAAIS,IAAe,WAAY;AAC3B,YAAIF,IAAMC;AACV,QAAAA,IAAe,CAAA,GACfD,EAAI,QAAQD,CAAE;AAAA,MAClB,GACII,IAAQ,WAAY;AAAE,eAAO,QAAQ,QAAO,EAAG,KAAKD,CAAY;AAAA,MAAG;AACvE,MAAAC,EAAK,GACLV,IAAS;AAAA,QACL,MAAM,SAAUK,GAAG;AACf,UAAAG,EAAa,KAAKH,CAAC,GACnBK,EAAK;AAAA,QACT;AAAA,QACA,QAAQ,SAAUC,GAAQ;AACtB,iBAAAH,IAAeA,EAAa,OAAOG,CAAM,GAClCX;AAAA,QACX;AAAA,MAChB;AAAA,IACQ;AAAA,EACR;AACI,SAAOE;AACX;AAMO,SAASU,EAAoBC,GAAS;AACzC,EAAIA,MAAY,WAAUA,IAAU,CAAA;AACpC,MAAIX,IAASL,EAAkB,IAAI;AACnC,SAAAK,EAAO,UAAUY,EAAS,EAAE,OAAO,IAAM,KAAK,GAAK,GAAID,CAAO,GACvDX;AACX;","x_google_ignoreList":[0]}
package/dist/index3.js CHANGED
@@ -1,181 +1,193 @@
1
1
  import { j as c } from "./index30.js";
2
- import { c as V } from "./index28.js";
3
- import { useState as N, useRef as b, useMemo as X, useEffect as O } from "react";
4
- import { clsx as Z } from "./index26.js";
5
- import { useMapsLibrary as ee } from "./index22.js";
6
- import { Input as te } from "./index14.js";
7
- import { cn as re } from "./index2.js";
8
- const ne = /* @__PURE__ */ new Set(["street_address", "route", "premise", "subpremise", "intersection", "sublocality", "sublocality_level_1", "sublocality_level_2", "sublocality_level_3", "sublocality_level_4", "sublocality_level_5", "administrative_area_level_1", "administrative_area_level_2", "administrative_area_level_3", "administrative_area_level_4", "administrative_area_level_5", "administrative_area_level_6", "administrative_area_level_7", "postal_code", "locality", "country", "geocode", "plus_code", "political", "neighborhood", "colloquial_area", "lodging", "train_station", "transit_station"]), U = (n) => (n.text?.text ?? "").replace(/, France$/, "").trim(), se = (n) => {
9
- const e = V.c(8), {
2
+ import { c as Z } from "./index28.js";
3
+ import { useState as S, useRef as w, useMemo as ee, useEffect as O } from "react";
4
+ import { clsx as te } from "./index26.js";
5
+ import { Loader2 as re } from "lucide-react";
6
+ import { useMapsLibrary as se } from "./index22.js";
7
+ import { Input as ne } from "./index14.js";
8
+ import { cn as oe } from "./index2.js";
9
+ const le = /* @__PURE__ */ new Set(["street_address", "route", "premise", "subpremise", "intersection", "sublocality", "sublocality_level_1", "sublocality_level_2", "sublocality_level_3", "sublocality_level_4", "sublocality_level_5", "administrative_area_level_1", "administrative_area_level_2", "administrative_area_level_3", "administrative_area_level_4", "administrative_area_level_5", "administrative_area_level_6", "administrative_area_level_7", "postal_code", "locality", "country", "geocode", "plus_code", "political", "neighborhood", "colloquial_area", "lodging", "train_station", "transit_station"]), q = (n) => (n.text?.text ?? "").replace(/, France$/, "").trim(), ie = (n) => {
10
+ const e = Z.c(8), {
10
11
  prediction: l
11
12
  } = n;
12
- let r, o, d;
13
+ let r, o, m;
13
14
  if (e[0] !== l) {
14
- d = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
15
+ m = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
15
16
  e: {
16
- r = U(l);
17
- const h = l.text?.text ?? "", E = l.text?.matches ?? [], F = r.length < h.length;
18
- if (E.length === 0) {
19
- d = /* @__PURE__ */ c.jsx(c.Fragment, { children: r });
17
+ r = q(l);
18
+ const h = l.text?.text ?? "", P = l.text?.matches ?? [], F = r.length < h.length;
19
+ if (P.length === 0) {
20
+ m = /* @__PURE__ */ c.jsx(c.Fragment, { children: r });
20
21
  break e;
21
22
  }
22
23
  o = [];
23
24
  let f = 0;
24
- E.forEach((y, u) => {
25
+ P.forEach((y, u) => {
25
26
  if (F && y.startOffset >= r.length)
26
27
  return;
27
28
  const g = y.startOffset, i = Math.min(y.endOffset, r.length);
28
29
  if (g > f && o.push(r.substring(f, g)), i > g) {
29
- const m = r.substring(g, i);
30
- o.push(/* @__PURE__ */ c.jsx("strong", { children: m }, u));
30
+ const d = r.substring(g, i);
31
+ o.push(/* @__PURE__ */ c.jsx("strong", { children: d }, u));
31
32
  }
32
33
  f = Math.max(f, i);
33
34
  }), f < r.length && o.push(r.substring(f));
34
35
  }
35
- e[0] = l, e[1] = r, e[2] = o, e[3] = d;
36
+ e[0] = l, e[1] = r, e[2] = o, e[3] = m;
36
37
  } else
37
- r = e[1], o = e[2], d = e[3];
38
- if (d !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel"))
39
- return d;
38
+ r = e[1], o = e[2], m = e[3];
39
+ if (m !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel"))
40
+ return m;
40
41
  if (o.length === 0) {
41
42
  let h;
42
43
  return e[4] !== r ? (h = /* @__PURE__ */ c.jsx(c.Fragment, { children: r }), e[4] = r, e[5] = h) : h = e[5], h;
43
44
  }
44
45
  let p;
45
46
  return e[6] !== o ? (p = /* @__PURE__ */ c.jsx(c.Fragment, { children: o }), e[6] = o, e[7] = p) : p = e[7], p;
46
- }, oe = (n, e) => !n.types || n.types.length === 0 || !e || e.size === 0 ? !0 : n.types.some((l) => e.has(l)), le = (n, e) => n.placeId || `${n.text?.text ?? "prediction"}-${e}`, ie = (n) => {
47
+ }, ce = (n, e) => !n.types || n.types.length === 0 || !e || e.size === 0 ? !0 : n.types.some((l) => e.has(l)), ae = (n, e) => n.placeId || `${n.text?.text ?? "prediction"}-${e}`, ue = (n) => {
47
48
  const e = /* @__PURE__ */ new Map();
48
49
  return n.forEach((l) => {
49
50
  const r = l.placeId;
50
51
  r && (e.has(r) || e.set(r, l));
51
52
  }), Array.from(e.values());
52
- }, ce = (n, e) => n.filter((l) => oe(l, e)), ae = (n) => n.sort((e, l) => {
53
+ }, fe = (n, e) => n.filter((l) => ce(l, e)), de = (n) => n.sort((e, l) => {
53
54
  const r = e.distanceMeters ?? Number.POSITIVE_INFINITY, o = l.distanceMeters ?? Number.POSITIVE_INFINITY;
54
55
  return r - o;
55
- }), ue = (n, e) => ae(ce(ie(n), e)), fe = (n, e) => U(n).toLowerCase() === e.trim().toLowerCase(), ve = ({
56
+ }), me = (n, e) => de(fe(ue(n), e)), pe = (n, e) => q(n).toLowerCase() === e.trim().toLowerCase(), Ie = ({
56
57
  id: n,
57
58
  label: e,
58
59
  placeholder: l,
59
60
  value: r,
60
61
  onValueChange: o,
61
- disabled: d,
62
+ disabled: m,
62
63
  name: p,
63
64
  className: h,
64
- autofillShimName: E,
65
+ autofillShimName: P,
65
66
  googleMapsApiKey: F,
66
67
  locationRestriction: f,
67
68
  allowedTypes: y
68
69
  }) => {
69
- const [u, g] = N(r ?? ""), [i, m] = N([]), [S, a] = N(!1), [v, M] = N(-1), L = b(null), P = b(null), R = b(!1), k = b(!1), x = b(null), $ = b([]), _ = b("smooth"), B = ee("places", F), q = X(() => {
70
+ const [u, g] = S(r ?? ""), [i, d] = S([]), [j, a] = S(!1), [v, M] = S(-1), [H, b] = S(!1), R = w(null), k = w(null), $ = w(!1), N = w(!1), x = w(null), B = w([]), I = w("smooth"), C = se("places", F), Y = ee(() => {
70
71
  if (!y)
71
- return ne;
72
+ return le;
72
73
  const t = /* @__PURE__ */ new Set();
73
74
  for (const s of y)
74
75
  t.add(s);
75
76
  return t;
76
77
  }, [y]);
77
78
  O(() => {
78
- g(r ?? ""), k.current = !1;
79
+ g(r ?? ""), N.current = !1;
79
80
  }, [r]), O(() => {
80
- if (R.current) {
81
- R.current = !1;
81
+ if ($.current) {
82
+ $.current = !1;
82
83
  return;
83
84
  }
84
- let t = !0;
85
- const s = setTimeout(() => {
86
- if (!t)
85
+ const t = u.trim();
86
+ b(t !== "");
87
+ let s = !0;
88
+ const _ = setTimeout(() => {
89
+ if (!s)
87
90
  return;
88
- if (u.trim() === "") {
89
- m([]), a(!1), x.current = null, r !== "" && o("");
91
+ if (t === "") {
92
+ d([]), a(!1), x.current = null, r !== "" && o("");
90
93
  return;
91
94
  }
92
- if (!B) return;
95
+ if (!C) return;
93
96
  const {
94
- AutocompleteSuggestion: I,
95
- AutocompleteSessionToken: j
96
- } = B;
97
- if (!I || !j) {
98
- console.error("AddressAutocompleteInput: missing AutocompleteSuggestion or AutocompleteSessionToken exports"), m([]), a(!1);
97
+ AutocompleteSuggestion: A,
98
+ AutocompleteSessionToken: L
99
+ } = C;
100
+ if (!A || !L) {
101
+ console.error("AddressAutocompleteInput: missing AutocompleteSuggestion or AutocompleteSessionToken exports"), d([]), a(!1), b(!1);
99
102
  return;
100
103
  }
101
- x.current || (x.current = new j());
102
- const A = {
104
+ x.current || (x.current = new L());
105
+ const T = {
103
106
  input: u,
104
107
  sessionToken: x.current ?? void 0,
105
108
  includedRegionCodes: ["fr"]
106
109
  };
107
- f && (A.locationRestriction = f), I.fetchAutocompleteSuggestions(A).then((T) => {
108
- if (!t)
110
+ f && (T.locationRestriction = f), A.fetchAutocompleteSuggestions(T).then((D) => {
111
+ if (!s)
109
112
  return;
110
- const J = T.suggestions.map((C) => C.placePrediction).filter((C) => !!C), D = ue(J, q), z = D[0], Q = z && D.length === 1 && fe(z, u);
111
- if (!k.current && Q) {
112
- m(D), a(!1);
113
+ const V = D.suggestions.map((U) => U.placePrediction).filter((U) => !!U), E = me(V, Y), W = E[0], X = W && E.length === 1 && pe(W, u);
114
+ if (!N.current && X) {
115
+ d(E), a(!1), b(!1);
113
116
  return;
114
117
  }
115
- D.length > 0 ? (m(D), k.current && a(!0), M(-1)) : (m([]), a(!1));
116
- }).catch((T) => {
117
- t && (console.error("AddressAutocompleteInput: suggestion fetch failed", T), m([]), a(!1));
118
+ E.length > 0 ? (d(E), N.current && a(!0), M(-1)) : (d([]), a(!1)), b(!1);
119
+ }).catch((D) => {
120
+ s && (console.error("AddressAutocompleteInput: suggestion fetch failed", D), d([]), a(!1), b(!1));
118
121
  });
119
122
  }, 300);
120
123
  return () => {
121
- t = !1, clearTimeout(s);
124
+ s = !1, clearTimeout(_);
122
125
  };
123
- }, [u, B, o, r, f, q]), O(() => {
126
+ }, [u, C, o, r, f, Y]), O(() => {
124
127
  const t = (s) => {
125
- L.current && !L.current.contains(s.target) && P.current && !P.current.contains(s.target) && a(!1);
128
+ R.current && !R.current.contains(s.target) && k.current && !k.current.contains(s.target) && a(!1);
126
129
  };
127
130
  return document.addEventListener("mousedown", t), () => {
128
131
  document.removeEventListener("mousedown", t);
129
132
  };
130
133
  }, []);
131
- const H = (t) => {
132
- R.current = !0;
133
- const s = U(t);
134
- g(s), o(s), m([]), a(!1), x.current = null;
135
- }, K = (t) => {
136
- k.current = !0, g(t.target.value);
137
- }, W = (t) => {
138
- if (!S || i.length === 0) {
134
+ const z = (t) => {
135
+ $.current = !0;
136
+ const s = q(t);
137
+ g(s), o(s), d([]), a(!1), b(!1), x.current = null;
138
+ }, G = (t) => {
139
+ N.current = !0, g(t.target.value);
140
+ }, J = (t) => {
141
+ if (!j || i.length === 0) {
139
142
  t.key === "Enter" && (t.preventDefault(), o(u), a(!1), x.current = null);
140
143
  return;
141
144
  }
142
- t.key === "ArrowDown" ? (_.current = t.repeat ? "auto" : "smooth", t.preventDefault(), M((s) => i.length === 0 ? -1 : s < 0 ? 0 : (s + 1) % i.length)) : t.key === "ArrowUp" ? (_.current = t.repeat ? "auto" : "smooth", t.preventDefault(), M((s) => i.length === 0 ? -1 : s <= 0 ? i.length - 1 : (s - 1) % i.length)) : t.key === "Enter" ? (t.preventDefault(), v > -1 && i[v] ? H(i[v]) : (o(u), a(!1), x.current = null)) : t.key === "Escape" && a(!1);
143
- }, G = () => {
145
+ t.key === "ArrowDown" ? (I.current = t.repeat ? "auto" : "smooth", t.preventDefault(), M((s) => i.length === 0 ? -1 : s < 0 ? 0 : (s + 1) % i.length)) : t.key === "ArrowUp" ? (I.current = t.repeat ? "auto" : "smooth", t.preventDefault(), M((s) => i.length === 0 ? -1 : s <= 0 ? i.length - 1 : (s - 1) % i.length)) : t.key === "Enter" ? (t.preventDefault(), v > -1 && i[v] ? z(i[v]) : (o(u), a(!1), x.current = null)) : t.key === "Escape" && a(!1);
146
+ }, Q = () => {
144
147
  a(!1), r !== u && o(u), x.current = null;
145
- }, Y = E ?? (p ? `${p}_shim` : void 0);
148
+ }, K = P ?? (p ? `${p}_shim` : void 0);
146
149
  return O(() => {
147
- if (!S || v < 0) {
148
- _.current = "smooth";
150
+ if (!j || v < 0) {
151
+ I.current = "smooth";
149
152
  return;
150
153
  }
151
- const t = $.current[v], s = P.current;
154
+ const t = B.current[v], s = k.current;
152
155
  if (!t || !s) {
153
- _.current = "smooth";
156
+ I.current = "smooth";
154
157
  return;
155
158
  }
156
- const w = _.current;
157
- _.current = "smooth";
158
- const I = t.offsetTop, j = I + t.offsetHeight, A = s.scrollTop, T = A + s.clientHeight;
159
- I >= A && j <= T || t.scrollIntoView({
159
+ const _ = I.current;
160
+ I.current = "smooth";
161
+ const A = t.offsetTop, L = A + t.offsetHeight, T = s.scrollTop, D = T + s.clientHeight;
162
+ A >= T && L <= D || t.scrollIntoView({
160
163
  block: "nearest",
161
- behavior: w
164
+ behavior: _
162
165
  });
163
- }, [v, S]), $.current.length = i.length, /* @__PURE__ */ c.jsxs("div", { className: "relative", children: [
164
- Y && /* @__PURE__ */ c.jsx("input", { tabIndex: -1, autoComplete: "street-address", name: Y, "aria-hidden": "true", className: "pointer-events-none absolute left-0 top-0 h-0 w-0 opacity-0" }),
166
+ }, [v, j]), B.current.length = i.length, /* @__PURE__ */ c.jsxs("div", { className: "relative", children: [
167
+ K && /* @__PURE__ */ c.jsx("input", { tabIndex: -1, autoComplete: "street-address", name: K, "aria-hidden": "true", style: {
168
+ position: "absolute",
169
+ left: "-9999px",
170
+ top: "-9999px",
171
+ height: "1px",
172
+ width: "1px"
173
+ } }),
165
174
  /* @__PURE__ */ c.jsx("label", { htmlFor: n, className: "text-left block text-sm font-medium text-gray-700 mb-1 cursor-pointer", children: e }),
166
- /* @__PURE__ */ c.jsx(te, { ref: L, id: n, type: "text", placeholder: l, name: p ?? `${n}_input`, value: u, onChange: K, onKeyDown: W, onFocus: () => {
167
- i.length > 0 && u && a(!0);
168
- }, onBlur: G, disabled: d, autoComplete: "off", className: re("w-full", h) }),
169
- S && i.length > 0 && /* @__PURE__ */ c.jsx("ul", { ref: P, className: "absolute z-10 mt-1 w-full max-h-60 overflow-y-auto rounded-md border border-gray-200 bg-white text-left shadow-lg", role: "listbox", children: i.map((t, s) => /* @__PURE__ */ c.jsx("li", { ref: (w) => {
170
- $.current[s] = w;
171
- }, className: Z("cursor-pointer px-3 py-2 text-sm text-gray-700 hover:bg-gray-100", {
175
+ /* @__PURE__ */ c.jsxs("div", { className: "relative", children: [
176
+ /* @__PURE__ */ c.jsx(ne, { ref: R, id: n, type: "text", placeholder: l, name: p ?? `${n}_input`, value: u, onChange: G, onKeyDown: J, onFocus: () => {
177
+ i.length > 0 && u && a(!0);
178
+ }, onBlur: Q, disabled: m, autoComplete: "new-password", className: oe("w-full", H && "pr-9", h) }),
179
+ H && /* @__PURE__ */ c.jsx(re, { className: "pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 animate-spin text-gray-400", "aria-hidden": "true" })
180
+ ] }),
181
+ j && i.length > 0 && /* @__PURE__ */ c.jsx("ul", { ref: k, className: "absolute z-10 mt-1 w-full max-h-60 overflow-y-auto rounded-md border border-gray-200 bg-white text-left shadow-lg", role: "listbox", children: i.map((t, s) => /* @__PURE__ */ c.jsx("li", { ref: (_) => {
182
+ B.current[s] = _;
183
+ }, className: te("cursor-pointer px-3 py-2 text-sm text-gray-700 hover:bg-gray-100", {
172
184
  "bg-gray-100": v === s
173
- }), role: "option", onMouseDown: (w) => {
174
- w.preventDefault(), H(t);
175
- }, children: /* @__PURE__ */ c.jsx(se, { prediction: t }) }, le(t, s))) })
185
+ }), role: "option", onMouseDown: (_) => {
186
+ _.preventDefault(), z(t);
187
+ }, children: /* @__PURE__ */ c.jsx(ie, { prediction: t }) }, ae(t, s))) })
176
188
  ] });
177
189
  };
178
190
  export {
179
- ve as AddressAutocompleteInput
191
+ Ie as AddressAutocompleteInput
180
192
  };
181
193
  //# sourceMappingURL=index3.js.map