@brightspot/ui 1.3.0 → 1.4.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.
Files changed (131) hide show
  1. package/dist/custom-elements.json +144 -144
  2. package/dist/global.d.ts +10 -0
  3. package/dist/storybook/assets/{Avatar.stories-CpXI9mXR.js → Avatar.stories-QxWs-YfX.js} +1 -1
  4. package/dist/storybook/assets/{AvatarGroup.stories-D4NymG47.js → AvatarGroup.stories-Cy_Bvn7E.js} +1 -1
  5. package/dist/storybook/assets/{Badge.stories-BP4Yixze.js → Badge.stories-BpaApWbR.js} +1 -1
  6. package/dist/storybook/assets/{Button.stories-DDpQzCOq.js → Button.stories-C5h2usmd.js} +1 -1
  7. package/dist/storybook/assets/{CircularProgress.stories-B82LXwfS.js → CircularProgress.stories-DlPOiGja.js} +1 -1
  8. package/dist/storybook/assets/{ClipboardMixin.stories-Cr3efF-v.js → ClipboardMixin.stories-Bb45-UOM.js} +1 -1
  9. package/dist/storybook/assets/Color-6BZIO3FS-CcgGYVAo.js +1 -0
  10. package/dist/storybook/assets/{Colors.stories-CeKs5FaB.js → Colors.stories-DP2JKWUJ.js} +1 -1
  11. package/dist/storybook/assets/{ComponentStatesMixin-BkLj42wt.js → ComponentStatesMixin-B7ci0thi.js} +1 -1
  12. package/dist/storybook/assets/{ComponentStatesMixin.stories--YPoyrpQ.js → ComponentStatesMixin.stories-CyQ2aSTu.js} +1 -1
  13. package/dist/storybook/assets/{CopyToClipboard.stories-6vqDwd-F.js → CopyToClipboard.stories-DR7pckeV.js} +1 -1
  14. package/dist/storybook/assets/Debounce.stories-hkqyvqmg.js +199 -0
  15. package/dist/storybook/assets/DocsRenderer-LL677BLK-Dtw9GMer.js +758 -0
  16. package/dist/storybook/assets/{Events.stories-DD9wfoHi.js → Events.stories-BAgDzdyl.js} +1 -1
  17. package/dist/storybook/assets/{Heading.stories-D-Pvm7NG.js → Heading.stories-CN_fPsRf.js} +1 -1
  18. package/dist/storybook/assets/{Icon.stories-BbR3S56H.js → Icon.stories-CSx_2K8V.js} +1 -1
  19. package/dist/storybook/assets/{LinearProgress.stories-B9XHLvVn.js → LinearProgress.stories-In48DY2g.js} +1 -1
  20. package/dist/storybook/assets/Rtc.stories-19d7WXe4.js +281 -0
  21. package/dist/storybook/assets/{ScrollShadow.stories-CHFpB4Zf.js → ScrollShadow.stories-BFjracVd.js} +1 -1
  22. package/dist/storybook/assets/{Throttle.stories-BGNJSyDp.js → Throttle.stories-DD6ydiVq.js} +8 -8
  23. package/dist/storybook/assets/WithTooltip-65CFNBJE-Be1dKqOF.js +9 -0
  24. package/dist/storybook/assets/formatter-EIJCOSYU-anC2P5HS.js +1 -0
  25. package/dist/storybook/assets/{iframe-CpEKhsmw.css → iframe-B4njXYq6.css} +1 -1
  26. package/dist/storybook/assets/iframe-Bl9oHz5c.js +1061 -0
  27. package/dist/storybook/assets/index-Cn5E5A3G.js +1 -0
  28. package/dist/storybook/assets/onFind-DqriYjEB.js +1 -0
  29. package/dist/storybook/assets/onFind.stories-BMDLUk0l.js +1069 -0
  30. package/dist/storybook/assets/onRemove.stories-C3FcxtYh.js +234 -0
  31. package/dist/storybook/assets/onVisible.stories-B8Zyu0Th.js +187 -0
  32. package/dist/storybook/assets/syntaxhighlighter-ED5Y7EFY-BfTKsIVL.js +6 -0
  33. package/dist/storybook/iframe.html +57 -39
  34. package/dist/storybook/index.html +11 -4
  35. package/dist/storybook/index.json +1 -1
  36. package/dist/storybook/project.json +1 -1
  37. package/dist/storybook/sb-addons/docs-1/manager-bundle.js +1 -1
  38. package/dist/storybook/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +112 -290
  39. package/dist/storybook/sb-addons/vitest-2/manager-bundle.js +3 -0
  40. package/dist/storybook/sb-manager/globals-runtime.js +60754 -66346
  41. package/dist/storybook/sb-manager/globals.js +2 -3
  42. package/dist/storybook/sb-manager/manager-stores.js +23 -0
  43. package/dist/storybook/sb-manager/runtime.js +12983 -11699
  44. package/dist/storybook/vite-inject-mocker-entry.js +2 -2
  45. package/dist/tailwind-plugin-button.js +3 -0
  46. package/dist/tailwind-plugin-button.js.map +1 -1
  47. package/dist/tailwind-plugin-button.ts +4 -0
  48. package/dist/util/Socket.d.ts +29 -0
  49. package/dist/util/Socket.d.ts.map +1 -0
  50. package/dist/util/Socket.js +153 -0
  51. package/dist/util/Socket.js.map +1 -0
  52. package/dist/util/Tether.d.ts +18 -0
  53. package/dist/util/Tether.d.ts.map +1 -0
  54. package/dist/util/Tether.js +102 -0
  55. package/dist/util/Tether.js.map +1 -0
  56. package/dist/util/TetherLayout.d.ts +12 -0
  57. package/dist/util/TetherLayout.d.ts.map +1 -0
  58. package/dist/util/TetherLayout.js +121 -0
  59. package/dist/util/TetherLayout.js.map +1 -0
  60. package/dist/util/debounce.d.ts +3 -0
  61. package/dist/util/debounce.d.ts.map +1 -0
  62. package/dist/util/debounce.js +15 -0
  63. package/dist/util/debounce.js.map +1 -0
  64. package/dist/util/focusable.d.ts +9 -0
  65. package/dist/util/focusable.d.ts.map +1 -0
  66. package/dist/util/focusable.js +19 -0
  67. package/dist/util/focusable.js.map +1 -0
  68. package/dist/util/getComponentKey.d.ts +2 -0
  69. package/dist/util/getComponentKey.d.ts.map +1 -0
  70. package/dist/util/getComponentKey.js +21 -0
  71. package/dist/util/getComponentKey.js.map +1 -0
  72. package/dist/util/keyboard.d.ts +8 -0
  73. package/dist/util/keyboard.d.ts.map +1 -0
  74. package/dist/util/keyboard.js +138 -0
  75. package/dist/util/keyboard.js.map +1 -0
  76. package/dist/util/noise.d.ts +6 -0
  77. package/dist/util/noise.d.ts.map +1 -0
  78. package/dist/util/noise.js +43 -0
  79. package/dist/util/noise.js.map +1 -0
  80. package/dist/util/onFind.d.ts +1 -0
  81. package/dist/util/onFind.d.ts.map +1 -1
  82. package/dist/util/onFind.js +73 -48
  83. package/dist/util/onFind.js.map +1 -1
  84. package/dist/util/onFindOnce.d.ts +3 -0
  85. package/dist/util/onFindOnce.d.ts.map +1 -0
  86. package/dist/util/onFindOnce.js +25 -0
  87. package/dist/util/onFindOnce.js.map +1 -0
  88. package/dist/util/onRTEReady.d.ts +22 -0
  89. package/dist/util/onRTEReady.d.ts.map +1 -0
  90. package/dist/util/onRTEReady.js +69 -0
  91. package/dist/util/onRTEReady.js.map +1 -0
  92. package/dist/util/onRemove.d.ts +7 -0
  93. package/dist/util/onRemove.d.ts.map +1 -0
  94. package/dist/util/onRemove.js +24 -0
  95. package/dist/util/onRemove.js.map +1 -0
  96. package/dist/util/onVisible.d.ts +3 -0
  97. package/dist/util/onVisible.d.ts.map +1 -0
  98. package/dist/util/onVisible.js +33 -0
  99. package/dist/util/onVisible.js.map +1 -0
  100. package/dist/util/previousUntil.d.ts +2 -0
  101. package/dist/util/previousUntil.d.ts.map +1 -0
  102. package/dist/util/previousUntil.js +21 -0
  103. package/dist/util/previousUntil.js.map +1 -0
  104. package/dist/util/repaint.d.ts +3 -0
  105. package/dist/util/repaint.d.ts.map +1 -0
  106. package/dist/util/repaint.js +14 -0
  107. package/dist/util/repaint.js.map +1 -0
  108. package/dist/util/rtc.d.ts +10 -0
  109. package/dist/util/rtc.d.ts.map +1 -0
  110. package/dist/util/rtc.js +184 -0
  111. package/dist/util/rtc.js.map +1 -0
  112. package/dist/util/storage.d.ts +6 -0
  113. package/dist/util/storage.d.ts.map +1 -0
  114. package/dist/util/storage.js +18 -0
  115. package/dist/util/storage.js.map +1 -0
  116. package/dist/util/transition.d.ts +2 -0
  117. package/dist/util/transition.d.ts.map +1 -0
  118. package/dist/util/transition.js +4 -0
  119. package/dist/util/transition.js.map +1 -0
  120. package/dist/util/types.d.ts +10 -0
  121. package/dist/util/types.d.ts.map +1 -0
  122. package/dist/util/types.js +2 -0
  123. package/dist/util/types.js.map +1 -0
  124. package/package.json +17 -6
  125. package/dist/storybook/assets/Color-64QXVMR3-BucypS4O.js +0 -1
  126. package/dist/storybook/assets/WithTooltip-SK46ZJ2J-QQZnlVfm.js +0 -825
  127. package/dist/storybook/assets/formatter-OMEEQ6HG-D3LRXsK-.js +0 -1
  128. package/dist/storybook/assets/iframe-D-tG1MVV.js +0 -1064
  129. package/dist/storybook/assets/index-mcT8sPvs.js +0 -1
  130. package/dist/storybook/assets/onFind.stories-Dagoyfc5.js +0 -284
  131. package/dist/storybook/assets/syntaxhighlighter-CAVLW7PM-BoS99i_u.js +0 -6
@@ -1,4 +1,4 @@
1
- import{x as d}from"./iframe-D-tG1MVV.js";import"./preload-helper-PPVm8Dsz.js";var n=Object.freeze,r=Object.defineProperty,s=(t,i)=>n(r(t,"raw",{value:n(t.slice())})),o;const l={title:"Mixins/Events",tags:["autodocs"],parameters:{docs:{subtitle:"Events inherited from EventEmitterMixin",description:{component:`
1
+ import{x as d}from"./iframe-Bl9oHz5c.js";import"./preload-helper-PPVm8Dsz.js";var n=Object.freeze,r=Object.defineProperty,s=(t,i)=>n(r(t,"raw",{value:n(t.slice())})),o;const l={title:"Mixins/Events",tags:["autodocs"],parameters:{docs:{subtitle:"Events inherited from EventEmitterMixin",description:{component:`
2
2
  <h3>EventEmitterMixin Events</h3>
3
3
 
4
4
  <p>All Brightspot UI components that extend EventEmitterMixin emit the following lifecycle events in addition to those inherited from LitElement. These events use CustomEvent and bubble through the DOM with <code>composed: true</code>, meaning they cross shadow DOM boundaries.</p>
@@ -1,3 +1,3 @@
1
- import{x as s}from"./iframe-D-tG1MVV.js";import"./preload-helper-PPVm8Dsz.js";const r=({size:t})=>s` <div class=${[`btu-heading-${t}`].join(" ")}>Heading</div> `,o={title:"CSS Plugins/Heading",component:"btu-heading",tags:["autodocs"],parameters:{docs:{subtitle:"This Tailwind CSS plugin provides the `.btu-heading` utility class for styling headings. It supports five different sizes, from 1 (largest) to 5 (smallest). Apply the class to `<h1>` through `<h5>` elements to style them accordingly."},controls:{expanded:!0}},render:t=>r(t),argTypes:{size:{control:{type:"range",min:1,max:5,step:1},description:"Heading size from 1 to 5, where 1 is the largest and 5 is the smallest."}},args:{size:1}},e={args:{}};e.parameters={...e.parameters,docs:{...e.parameters?.docs,source:{originalSource:`{
1
+ import{x as s}from"./iframe-Bl9oHz5c.js";import"./preload-helper-PPVm8Dsz.js";const r=({size:t})=>s` <div class=${[`btu-heading-${t}`].join(" ")}>Heading</div> `,o={title:"CSS Plugins/Heading",component:"btu-heading",tags:["autodocs"],parameters:{docs:{subtitle:"This Tailwind CSS plugin provides the `.btu-heading` utility class for styling headings. It supports five different sizes, from 1 (largest) to 5 (smallest). Apply the class to `<h1>` through `<h5>` elements to style them accordingly."},controls:{expanded:!0}},render:t=>r(t),argTypes:{size:{control:{type:"range",min:1,max:5,step:1},description:"Heading size from 1 to 5, where 1 is the largest and 5 is the smallest."}},args:{size:1}},e={args:{}};e.parameters={...e.parameters,docs:{...e.parameters?.docs,source:{originalSource:`{
2
2
  args: {}
3
3
  }`,...e.parameters?.docs?.source}}};const n=["Default"];export{e as Default,n as __namedExportsOrder,o as default};
@@ -1,4 +1,4 @@
1
- import{g as d,x as r}from"./iframe-D-tG1MVV.js";import"./preload-helper-PPVm8Dsz.js";const p="0.508.0",b={version:p},l=b.version,{events:u,args:m,argTypes:t}=d("btu-icon"),g=["xs","sm","md","lg","xl"],x=["ai","error","gray","primary","purple","rose","success","teal","warning"],v={title:"Components/Icon",component:"btu-icon",tags:["autodocs"],parameters:{docs:{subtitle:"An icon component using Lucide icons with built-in support for custom colors and sizes.",description:{component:`
1
+ import{g as d,x as r}from"./iframe-Bl9oHz5c.js";import"./preload-helper-PPVm8Dsz.js";const p="0.508.0",b={version:p},l=b.version,{events:u,args:m,argTypes:t}=d("btu-icon"),g=["xs","sm","md","lg","xl"],x=["ai","error","gray","primary","purple","rose","success","teal","warning"],v={title:"Components/Icon",component:"btu-icon",tags:["autodocs"],parameters:{docs:{subtitle:"An icon component using Lucide icons with built-in support for custom colors and sizes.",description:{component:`
2
2
  <strong>When to use:</strong>
3
3
  <ul>
4
4
  <li>To visually reinforce actions, states, or categories</li>
@@ -1,4 +1,4 @@
1
- import{g as I,E as h,x as T}from"./iframe-D-tG1MVV.js";import"./preload-helper-PPVm8Dsz.js";const{events:D,args:V,argTypes:g}=I("btu-linear-progress"),k={title:"Components/Linear Progress",component:"btu-linear-progress",tags:["autodocs"],parameters:{docs:{subtitle:"A horizontal progress bar for showing task completion",description:{component:`
1
+ import{g as I,E as h,x as T}from"./iframe-Bl9oHz5c.js";import"./preload-helper-PPVm8Dsz.js";const{events:D,args:V,argTypes:g}=I("btu-linear-progress"),k={title:"Components/Linear Progress",component:"btu-linear-progress",tags:["autodocs"],parameters:{docs:{subtitle:"A horizontal progress bar for showing task completion",description:{component:`
2
2
  <h3>When to use:</h3>
3
3
  <ul>
4
4
  <li>To show progress of a specific task with known completion percentage</li>
@@ -0,0 +1,281 @@
1
+ import{x as o}from"./iframe-Bl9oHz5c.js";import"./preload-helper-PPVm8Dsz.js";const r={title:"Utilities/RTC",tags:["autodocs"],parameters:{docs:{subtitle:"The `rtc` module provides real-time communication between browser tabs and the Brightspot CMS server. Uses BroadcastChannel for cross-tab coordination with leader election, and Server-Sent Events for server communication."},controls:{expanded:!0}}},e={render:()=>o`
2
+ <div class="space-y-6 text-sm">
3
+ <div>
4
+ <h3 class="mb-2 font-bold">Overview</h3>
5
+ <p class="mb-4 text-gray-700">
6
+ The RTC module manages real-time updates between the CMS server and multiple browser tabs. It uses a
7
+ leader-election pattern so only one tab maintains a server connection, then broadcasts messages to other tabs
8
+ via BroadcastChannel.
9
+ </p>
10
+ </div>
11
+
12
+ <div class="rounded border border-gray-200 bg-gray-50 p-4">
13
+ <h4 class="mb-2 font-bold">Architecture Diagram</h4>
14
+ <pre class="text-xs leading-relaxed text-gray-700">
15
+ ┌─────────────────────────────────────────────────┐
16
+ │ CMS Server │
17
+ │ (Server-Sent Events) │
18
+ └────────────────────┬────────────────────────────┘
19
+
20
+ ┌──────┴──────┐
21
+ │ Leader Tab │ ← Socket connection
22
+ │ (Tab 1) │
23
+ └──────┬──────┘
24
+ │ BroadcastChannel
25
+ ┌──────────┼──────────┐
26
+ │ │ │
27
+ ┌────┴───┐ ┌───┴────┐ ┌──┴─────┐
28
+ │ Tab 2 │ │ Tab 3 │ │ Tab 4 │
29
+ └────────┘ └────────┘ └────────┘</pre
30
+ >
31
+ </div>
32
+
33
+ <div>
34
+ <h3 class="mb-2 font-bold">Key Concepts</h3>
35
+ <ul class="list-inside list-disc space-y-1 text-gray-700">
36
+ <li><strong>Leader election</strong>: One tab owns the server connection; others communicate through it</li>
37
+ <li>
38
+ <strong>State restore</strong>: When connecting, each tab restores its subscribed states from the server
39
+ </li>
40
+ <li><strong>Broadcasts</strong>: Server pushes events (publish, assignment, conversation) to all tabs</li>
41
+ <li>
42
+ <strong>Graceful degradation</strong>: When RTC is disabled or no user session exists, all methods become
43
+ no-ops
44
+ </li>
45
+ </ul>
46
+ </div>
47
+ </div>
48
+ `,parameters:{docs:{description:{story:"High-level architecture of the RTC (Real-Time Communication) system."}}}},t={render:()=>o`
49
+ <div class="space-y-4 text-sm">
50
+ <div>
51
+ <h3 class="mb-2 font-bold">Receiving Broadcasts</h3>
52
+ <pre
53
+ class="overflow-x-auto rounded bg-gray-900 p-4 text-gray-100"
54
+ ><code>import rtc from '@brightspot/ui/util/rtc.js'
55
+
56
+ // Listen for content publish events
57
+ rtc.receive('com.psddev.cms.tool.page.content.PublishBroadcast', (data) => {
58
+ console.log('Content published:', data)
59
+ refreshContent()
60
+ })
61
+
62
+ // Listen once (single-fire)
63
+ rtc.receiveOnce('com.psddev.cms.conversation.PostBroadcast', () => {
64
+ showNotification('New conversation post')
65
+ })</code></pre>
66
+ </div>
67
+
68
+ <div>
69
+ <h3 class="mb-2 font-bold">State Management</h3>
70
+ <pre
71
+ class="overflow-x-auto rounded bg-gray-900 p-4 text-gray-100"
72
+ ><code>// Initialize a stateful connection (auto-disconnects on page unload)
73
+ rtc.initialize('com.example.MyState', { id: '123' }, () => {
74
+ console.log('State restored from server')
75
+ })
76
+
77
+ // Restore state without unload handling
78
+ rtc.restore('com.example.MyState', { id: '123' }, () => {
79
+ console.log('State restored')
80
+ })</code></pre>
81
+ </div>
82
+
83
+ <div>
84
+ <h3 class="mb-2 font-bold">Executing Actions</h3>
85
+ <pre class="overflow-x-auto rounded bg-gray-900 p-4 text-gray-100"><code>// Send an action to the server
86
+ rtc.execute('com.example.MyAction', { id: '123', value: 'updated' })</code></pre>
87
+ </div>
88
+
89
+ <div>
90
+ <h3 class="mb-2 font-bold">API Reference</h3>
91
+ <ul class="space-y-2">
92
+ <li>
93
+ <code class="rounded bg-gray-200 px-1">rtc.initialize(state, data, callback)</code> — Connect to server
94
+ state with automatic unload cleanup
95
+ </li>
96
+ <li>
97
+ <code class="rounded bg-gray-200 px-1">rtc.restore(state, data, callback)</code> — Restore state from server
98
+ without unload handling
99
+ </li>
100
+ <li>
101
+ <code class="rounded bg-gray-200 px-1">rtc.receive(broadcast, callback)</code> — Subscribe to broadcast
102
+ events (fires on every occurrence)
103
+ </li>
104
+ <li>
105
+ <code class="rounded bg-gray-200 px-1">rtc.receiveOnce(broadcast, callback)</code> — Subscribe to a
106
+ broadcast event (fires once)
107
+ </li>
108
+ <li>
109
+ <code class="rounded bg-gray-200 px-1">rtc.execute(action, data)</code> — Send an action to the server
110
+ </li>
111
+ </ul>
112
+ </div>
113
+
114
+ <div>
115
+ <h3 class="mb-2 font-bold">Configuration</h3>
116
+ <ul class="list-inside list-disc space-y-1 text-gray-700">
117
+ <li>
118
+ <code class="rounded bg-gray-200 px-1">window.DISABLE_RTC</code> — Set to
119
+ <code class="rounded bg-gray-200 px-1">true</code> to disable all RTC functionality
120
+ </li>
121
+ <li>
122
+ <code class="rounded bg-gray-200 px-1">window.ROOT_PATH</code> — Server root path for the
123
+ <code class="rounded bg-gray-200 px-1">/_rtc</code> endpoint
124
+ </li>
125
+ <li>
126
+ <code class="rounded bg-gray-200 px-1">data-user-id</code> on
127
+ <code class="rounded bg-gray-200 px-1">&lt;html&gt;</code> — Required for RTC to activate
128
+ </li>
129
+ </ul>
130
+ </div>
131
+ </div>
132
+ `,parameters:{docs:{description:{story:"Code examples and API documentation for the RTC module."}}}};e.parameters={...e.parameters,docs:{...e.parameters?.docs,source:{originalSource:`{
133
+ render: () => html\`
134
+ <div class="space-y-6 text-sm">
135
+ <div>
136
+ <h3 class="mb-2 font-bold">Overview</h3>
137
+ <p class="mb-4 text-gray-700">
138
+ The RTC module manages real-time updates between the CMS server and multiple browser tabs. It uses a
139
+ leader-election pattern so only one tab maintains a server connection, then broadcasts messages to other tabs
140
+ via BroadcastChannel.
141
+ </p>
142
+ </div>
143
+
144
+ <div class="rounded border border-gray-200 bg-gray-50 p-4">
145
+ <h4 class="mb-2 font-bold">Architecture Diagram</h4>
146
+ <pre class="text-xs leading-relaxed text-gray-700">
147
+ ┌─────────────────────────────────────────────────┐
148
+ │ CMS Server │
149
+ │ (Server-Sent Events) │
150
+ └────────────────────┬────────────────────────────┘
151
+
152
+ ┌──────┴──────┐
153
+ │ Leader Tab │ ← Socket connection
154
+ │ (Tab 1) │
155
+ └──────┬──────┘
156
+ │ BroadcastChannel
157
+ ┌──────────┼──────────┐
158
+ │ │ │
159
+ ┌────┴───┐ ┌───┴────┐ ┌──┴─────┐
160
+ │ Tab 2 │ │ Tab 3 │ │ Tab 4 │
161
+ └────────┘ └────────┘ └────────┘</pre
162
+ >
163
+ </div>
164
+
165
+ <div>
166
+ <h3 class="mb-2 font-bold">Key Concepts</h3>
167
+ <ul class="list-inside list-disc space-y-1 text-gray-700">
168
+ <li><strong>Leader election</strong>: One tab owns the server connection; others communicate through it</li>
169
+ <li>
170
+ <strong>State restore</strong>: When connecting, each tab restores its subscribed states from the server
171
+ </li>
172
+ <li><strong>Broadcasts</strong>: Server pushes events (publish, assignment, conversation) to all tabs</li>
173
+ <li>
174
+ <strong>Graceful degradation</strong>: When RTC is disabled or no user session exists, all methods become
175
+ no-ops
176
+ </li>
177
+ </ul>
178
+ </div>
179
+ </div>
180
+ \`,
181
+ parameters: {
182
+ docs: {
183
+ description: {
184
+ story: \`High-level architecture of the RTC (Real-Time Communication) system.\`
185
+ }
186
+ }
187
+ }
188
+ }`,...e.parameters?.docs?.source}}};t.parameters={...t.parameters,docs:{...t.parameters?.docs,source:{originalSource:`{
189
+ render: () => html\`
190
+ <div class="space-y-4 text-sm">
191
+ <div>
192
+ <h3 class="mb-2 font-bold">Receiving Broadcasts</h3>
193
+ <pre
194
+ class="overflow-x-auto rounded bg-gray-900 p-4 text-gray-100"
195
+ ><code>import rtc from '@brightspot/ui/util/rtc.js'
196
+
197
+ // Listen for content publish events
198
+ rtc.receive('com.psddev.cms.tool.page.content.PublishBroadcast', (data) => {
199
+ console.log('Content published:', data)
200
+ refreshContent()
201
+ })
202
+
203
+ // Listen once (single-fire)
204
+ rtc.receiveOnce('com.psddev.cms.conversation.PostBroadcast', () => {
205
+ showNotification('New conversation post')
206
+ })</code></pre>
207
+ </div>
208
+
209
+ <div>
210
+ <h3 class="mb-2 font-bold">State Management</h3>
211
+ <pre
212
+ class="overflow-x-auto rounded bg-gray-900 p-4 text-gray-100"
213
+ ><code>// Initialize a stateful connection (auto-disconnects on page unload)
214
+ rtc.initialize('com.example.MyState', { id: '123' }, () => {
215
+ console.log('State restored from server')
216
+ })
217
+
218
+ // Restore state without unload handling
219
+ rtc.restore('com.example.MyState', { id: '123' }, () => {
220
+ console.log('State restored')
221
+ })</code></pre>
222
+ </div>
223
+
224
+ <div>
225
+ <h3 class="mb-2 font-bold">Executing Actions</h3>
226
+ <pre class="overflow-x-auto rounded bg-gray-900 p-4 text-gray-100"><code>// Send an action to the server
227
+ rtc.execute('com.example.MyAction', { id: '123', value: 'updated' })</code></pre>
228
+ </div>
229
+
230
+ <div>
231
+ <h3 class="mb-2 font-bold">API Reference</h3>
232
+ <ul class="space-y-2">
233
+ <li>
234
+ <code class="rounded bg-gray-200 px-1">rtc.initialize(state, data, callback)</code> — Connect to server
235
+ state with automatic unload cleanup
236
+ </li>
237
+ <li>
238
+ <code class="rounded bg-gray-200 px-1">rtc.restore(state, data, callback)</code> — Restore state from server
239
+ without unload handling
240
+ </li>
241
+ <li>
242
+ <code class="rounded bg-gray-200 px-1">rtc.receive(broadcast, callback)</code> — Subscribe to broadcast
243
+ events (fires on every occurrence)
244
+ </li>
245
+ <li>
246
+ <code class="rounded bg-gray-200 px-1">rtc.receiveOnce(broadcast, callback)</code> — Subscribe to a
247
+ broadcast event (fires once)
248
+ </li>
249
+ <li>
250
+ <code class="rounded bg-gray-200 px-1">rtc.execute(action, data)</code> — Send an action to the server
251
+ </li>
252
+ </ul>
253
+ </div>
254
+
255
+ <div>
256
+ <h3 class="mb-2 font-bold">Configuration</h3>
257
+ <ul class="list-inside list-disc space-y-1 text-gray-700">
258
+ <li>
259
+ <code class="rounded bg-gray-200 px-1">window.DISABLE_RTC</code> — Set to
260
+ <code class="rounded bg-gray-200 px-1">true</code> to disable all RTC functionality
261
+ </li>
262
+ <li>
263
+ <code class="rounded bg-gray-200 px-1">window.ROOT_PATH</code> — Server root path for the
264
+ <code class="rounded bg-gray-200 px-1">/_rtc</code> endpoint
265
+ </li>
266
+ <li>
267
+ <code class="rounded bg-gray-200 px-1">data-user-id</code> on
268
+ <code class="rounded bg-gray-200 px-1">&lt;html&gt;</code> — Required for RTC to activate
269
+ </li>
270
+ </ul>
271
+ </div>
272
+ </div>
273
+ \`,
274
+ parameters: {
275
+ docs: {
276
+ description: {
277
+ story: \`Code examples and API documentation for the RTC module.\`
278
+ }
279
+ }
280
+ }
281
+ }`,...t.parameters?.docs?.source}}};const n=["Architecture","UsageExample"];export{e as Architecture,t as UsageExample,n as __namedExportsOrder,r as default};
@@ -1,4 +1,4 @@
1
- import{x as a}from"./iframe-D-tG1MVV.js";import"./preload-helper-PPVm8Dsz.js";const l=({theme:e="btu-scrollshadow-25"})=>{const r=new Array(100).fill(0).map((s,t)=>`Item ${t+1}`);return a`
1
+ import{x as a}from"./iframe-Bl9oHz5c.js";import"./preload-helper-PPVm8Dsz.js";const l=({theme:e="btu-scrollshadow-25"})=>{const r=new Array(100).fill(0).map((s,t)=>`Item ${t+1}`);return a`
2
2
  <style>
3
3
  :root {
4
4
  --can-scroll: ;
@@ -1,4 +1,4 @@
1
- import{x as u}from"./iframe-D-tG1MVV.js";import"./preload-helper-PPVm8Dsz.js";function v(e,t){if(e<=0)return t;let n,o=0;return function(){if(n)return;const r=Date.now(),s=e-r+o;s<=0?(o=r,t.apply(this,[...arguments])):n=setTimeout(()=>{o=r,n=void 0,t.apply(this,[...arguments])},s)}}const x={title:"Utilities/Throttle",tags:["autodocs"],parameters:{docs:{subtitle:"The `throttle` utility function limits how often a function can execute, ensuring it runs at most once per specified interval. Useful for high-frequency events like scroll, resize, or mousemove."},controls:{expanded:!0}},argTypes:{interval:{control:{type:"number",min:0,max:2e3,step:50},description:"Throttle interval in milliseconds"}},args:{interval:200}},a={render:e=>{const t=`throttle-${Math.random().toString(36).substring(2,9)}`;let n=0,o=0;const r=()=>{const h=document.getElementById(`${t}-normal-count`),m=document.getElementById(`${t}-throttled-count`);h&&(h.textContent=String(n)),m&&(m.textContent=String(o))},s=v(e.interval,()=>{o++,r()}),d=()=>{n++,r()},l=()=>{d(),s()};return u`
1
+ import{x as u}from"./iframe-Bl9oHz5c.js";import"./preload-helper-PPVm8Dsz.js";function v(e,t){if(e<=0)return t;let n,o=0;return function(){if(n)return;const r=Date.now(),s=e-r+o;s<=0?(o=r,t.apply(this,[...arguments])):n=setTimeout(()=>{o=r,n=void 0,t.apply(this,[...arguments])},s)}}const x={title:"Utilities/Throttle",tags:["autodocs"],parameters:{docs:{subtitle:"The `throttle` utility function limits how often a function can execute, ensuring it runs at most once per specified interval. Useful for high-frequency events like scroll, resize, or mousemove."},controls:{expanded:!0}},argTypes:{interval:{control:{type:"number",min:0,max:2e3,step:50},description:"Throttle interval in milliseconds"}},args:{interval:200}},d={render:e=>{const t=`throttle-${Math.random().toString(36).substring(2,9)}`;let n=0,o=0;const r=()=>{const h=document.getElementById(`${t}-normal-count`),m=document.getElementById(`${t}-throttled-count`);h&&(h.textContent=String(n)),m&&(m.textContent=String(o))},s=v(e.interval,()=>{o++,r()}),a=()=>{n++,r()},l=()=>{a(),s()};return u`
2
2
  <div class="space-y-4">
3
3
  <div class="text-base">
4
4
  <p class="mb-2">
@@ -30,7 +30,7 @@ import{x as u}from"./iframe-D-tG1MVV.js";import"./preload-helper-PPVm8Dsz.js";fu
30
30
  Reset Counters
31
31
  </button>
32
32
  </div>
33
- `},parameters:{docs:{description:{story:"Interactive example showing throttle in action. Move your mouse over the box to see how throttling reduces function calls."}}}},i={render:()=>{const e=`scroll-${Math.random().toString(36).substring(2,9)}`;let t=0,n=0;const o=()=>{const d=document.getElementById(`${e}-normal-count`),l=document.getElementById(`${e}-throttled-count`);d&&(d.textContent=String(t)),l&&(l.textContent=String(n))},r=v(300,()=>{n++,o()});return u`
33
+ `},parameters:{docs:{description:{story:"Interactive example showing throttle in action. Move your mouse over the box to see how throttling reduces function calls."}}}},i={render:()=>{const e=`scroll-${Math.random().toString(36).substring(2,9)}`;let t=0,n=0;const o=()=>{const a=document.getElementById(`${e}-normal-count`),l=document.getElementById(`${e}-throttled-count`);a&&(a.textContent=String(t)),l&&(l.textContent=String(n))},r=v(300,()=>{n++,o()});return u`
34
34
  <div class="space-y-4">
35
35
  <div class="text-base">
36
36
  <p class="mb-2">
@@ -41,7 +41,7 @@ import{x as u}from"./iframe-D-tG1MVV.js";import"./preload-helper-PPVm8Dsz.js";fu
41
41
 
42
42
  <div @scroll=${()=>{t++,o(),r()}} class="h-64 overflow-y-scroll rounded border-2 border-gray-300 bg-gray-50 p-4">
43
43
  <div class="space-y-4">
44
- ${Array.from({length:50},(d,l)=>u` <div class="rounded border bg-white p-4">Item ${l+1}</div> `)}
44
+ ${Array.from({length:50},(a,l)=>u` <div class="rounded border bg-white p-4">Item ${l+1}</div> `)}
45
45
  </div>
46
46
  </div>
47
47
 
@@ -69,7 +69,7 @@ import{x as u}from"./iframe-D-tG1MVV.js";import"./preload-helper-PPVm8Dsz.js";fu
69
69
  <h3 class="mb-2 font-bold">Basic Usage</h3>
70
70
  <pre
71
71
  class="overflow-x-auto rounded bg-gray-900 p-4 text-gray-100"
72
- ><code>import { throttle } from '@brightspot/ui/dist/util/throttle.js'
72
+ ><code>import { throttle } from '@brightspot/ui/util/throttle.js'
73
73
 
74
74
  const handleScroll = throttle(200, () => {
75
75
  console.log('Scroll handler - max once per 200ms')
@@ -109,7 +109,7 @@ window.addEventListener('scroll', handleScroll)</code></pre>
109
109
  </p>
110
110
  </div>
111
111
  </div>
112
- `,parameters:{docs:{description:{story:"Code examples and documentation for using the throttle utility."}}}};a.parameters={...a.parameters,docs:{...a.parameters?.docs,source:{originalSource:`{
112
+ `,parameters:{docs:{description:{story:"Code examples and documentation for using the throttle utility."}}}};d.parameters={...d.parameters,docs:{...d.parameters?.docs,source:{originalSource:`{
113
113
  render: args => {
114
114
  const instanceId = \`throttle-\${Math.random().toString(36).substring(2, 9)}\`;
115
115
  let normalCount = 0;
@@ -177,7 +177,7 @@ window.addEventListener('scroll', handleScroll)</code></pre>
177
177
  }
178
178
  }
179
179
  }
180
- }`,...a.parameters?.docs?.source}}};i.parameters={...i.parameters,docs:{...i.parameters?.docs,source:{originalSource:`{
180
+ }`,...d.parameters?.docs?.source}}};i.parameters={...i.parameters,docs:{...i.parameters?.docs,source:{originalSource:`{
181
181
  render: () => {
182
182
  const instanceId = \`scroll-\${Math.random().toString(36).substring(2, 9)}\`;
183
183
  let scrollCount = 0;
@@ -252,7 +252,7 @@ window.addEventListener('scroll', handleScroll)</code></pre>
252
252
  <h3 class="mb-2 font-bold">Basic Usage</h3>
253
253
  <pre
254
254
  class="overflow-x-auto rounded bg-gray-900 p-4 text-gray-100"
255
- ><code>import { throttle } from '@brightspot/ui/dist/util/throttle.js'
255
+ ><code>import { throttle } from '@brightspot/ui/util/throttle.js'
256
256
 
257
257
  const handleScroll = throttle(200, () => {
258
258
  console.log('Scroll handler - max once per 200ms')
@@ -300,4 +300,4 @@ window.addEventListener('scroll', handleScroll)</code></pre>
300
300
  }
301
301
  }
302
302
  }
303
- }`,...c.parameters?.docs?.source}}};const y=["Interactive","ScrollExample","UsageExample"];export{a as Interactive,i as ScrollExample,c as UsageExample,y as __namedExportsOrder,x as default};
303
+ }`,...c.parameters?.docs?.source}}};const y=["Interactive","ScrollExample","UsageExample"];export{d as Interactive,i as ScrollExample,c as UsageExample,y as __namedExportsOrder,x as default};
@@ -0,0 +1,9 @@
1
+ import{R as U,s as Re,r as y,l as pe,e as Bt,b as Pt,a as te,_ as Mt,f as _t}from"./DocsRenderer-LL677BLK-Dtw9GMer.js";import{K as We,_ as ft}from"./iframe-Bl9oHz5c.js";import"./preload-helper-PPVm8Dsz.js";import"./_commonjsHelpers-CqkleIqs.js";var Ht=ft({"../../node_modules/react-fast-compare/index.js"(e,t){var r=typeof Element<"u",o=typeof Map=="function",n=typeof Set=="function",s=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function l(u,a){if(u===a)return!0;if(u&&a&&typeof u=="object"&&typeof a=="object"){if(u.constructor!==a.constructor)return!1;var i,f,p;if(Array.isArray(u)){if(i=u.length,i!=a.length)return!1;for(f=i;f--!==0;)if(!l(u[f],a[f]))return!1;return!0}var c;if(o&&u instanceof Map&&a instanceof Map){if(u.size!==a.size)return!1;for(c=u.entries();!(f=c.next()).done;)if(!a.has(f.value[0]))return!1;for(c=u.entries();!(f=c.next()).done;)if(!l(f.value[1],a.get(f.value[0])))return!1;return!0}if(n&&u instanceof Set&&a instanceof Set){if(u.size!==a.size)return!1;for(c=u.entries();!(f=c.next()).done;)if(!a.has(f.value[0]))return!1;return!0}if(s&&ArrayBuffer.isView(u)&&ArrayBuffer.isView(a)){if(i=u.length,i!=a.length)return!1;for(f=i;f--!==0;)if(u[f]!==a[f])return!1;return!0}if(u.constructor===RegExp)return u.source===a.source&&u.flags===a.flags;if(u.valueOf!==Object.prototype.valueOf&&typeof u.valueOf=="function"&&typeof a.valueOf=="function")return u.valueOf()===a.valueOf();if(u.toString!==Object.prototype.toString&&typeof u.toString=="function"&&typeof a.toString=="function")return u.toString()===a.toString();if(p=Object.keys(u),i=p.length,i!==Object.keys(a).length)return!1;for(f=i;f--!==0;)if(!Object.prototype.hasOwnProperty.call(a,p[f]))return!1;if(r&&u instanceof Element)return!1;for(f=i;f--!==0;)if(!((p[f]==="_owner"||p[f]==="__v"||p[f]==="__o")&&u.$$typeof)&&!l(u[p[f]],a[p[f]]))return!1;return!0}return u!==u&&a!==a}t.exports=function(u,a){try{return l(u,a)}catch(i){if((i.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw i}}}}),Nt=ft({"../../node_modules/warning/warning.js"(e,t){var r=function(){};t.exports=r}}),Vt=We(Pt(),1);const{deprecate:lt}=__STORYBOOK_MODULE_CLIENT_LOGGER__,{global:qt}=__STORYBOOK_MODULE_GLOBAL__;y.createContext();y.createContext();var Ke=function(e){return e.reduce(function(t,r){var o=r[0],n=r[1];return t[o]=n,t},{})},Je=typeof window<"u"&&window.document&&window.document.createElement?y.useLayoutEffect:y.useEffect,j="top",H="bottom",N="right",B="left",$e="auto",ye=[j,H,N,B],ie="start",ge="end",Ut="clippingParents",ct="viewport",ce="popper",zt="reference",Qe=ye.reduce(function(e,t){return e.concat([t+"-"+ie,t+"-"+ge])},[]),pt=[].concat(ye,[$e]).reduce(function(e,t){return e.concat([t,t+"-"+ie,t+"-"+ge])},[]),It="beforeRead",Yt="read",Xt="afterRead",Ft="beforeMain",Gt="main",Kt="afterMain",Jt="beforeWrite",Qt="write",Zt="afterWrite",er=[It,Yt,Xt,Ft,Gt,Kt,Jt,Qt,Zt];function I(e){return e?(e.nodeName||"").toLowerCase():null}function P(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function ne(e){var t=P(e).Element;return e instanceof t||e instanceof Element}function _(e){var t=P(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function je(e){if(typeof ShadowRoot>"u")return!1;var t=P(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function tr(e){var t=e.state;Object.keys(t.elements).forEach(function(r){var o=t.styles[r]||{},n=t.attributes[r]||{},s=t.elements[r];!_(s)||!I(s)||(Object.assign(s.style,o),Object.keys(n).forEach(function(l){var u=n[l];u===!1?s.removeAttribute(l):s.setAttribute(l,u===!0?"":u)}))})}function rr(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(o){var n=t.elements[o],s=t.attributes[o]||{},l=Object.keys(t.styles.hasOwnProperty(o)?t.styles[o]:r[o]),u=l.reduce(function(a,i){return a[i]="",a},{});!_(n)||!I(n)||(Object.assign(n.style,u),Object.keys(s).forEach(function(a){n.removeAttribute(a)}))})}}var dt={name:"applyStyles",enabled:!0,phase:"write",fn:tr,effect:rr,requires:["computeStyles"]};function z(e){return e.split("-")[0]}var re=Math.max,Te=Math.min,ae=Math.round;function ke(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function vt(){return!/^((?!chrome|android).)*safari/i.test(ke())}function se(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!1);var o=e.getBoundingClientRect(),n=1,s=1;t&&_(e)&&(n=e.offsetWidth>0&&ae(o.width)/e.offsetWidth||1,s=e.offsetHeight>0&&ae(o.height)/e.offsetHeight||1);var l=ne(e)?P(e):window,u=l.visualViewport,a=!vt()&&r,i=(o.left+(a&&u?u.offsetLeft:0))/n,f=(o.top+(a&&u?u.offsetTop:0))/s,p=o.width/n,c=o.height/s;return{width:p,height:c,top:f,right:i+p,bottom:f+c,left:i,x:i,y:f}}function Be(e){var t=se(e),r=e.offsetWidth,o=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-o)<=1&&(o=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:o}}function mt(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&je(r)){var o=t;do{if(o&&e.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function F(e){return P(e).getComputedStyle(e)}function nr(e){return["table","td","th"].indexOf(I(e))>=0}function K(e){return((ne(e)?e.ownerDocument:e.document)||window.document).documentElement}function Le(e){return I(e)==="html"?e:e.assignedSlot||e.parentNode||(je(e)?e.host:null)||K(e)}function Ze(e){return!_(e)||F(e).position==="fixed"?null:e.offsetParent}function or(e){var t=/firefox/i.test(ke()),r=/Trident/i.test(ke());if(r&&_(e)){var o=F(e);if(o.position==="fixed")return null}var n=Le(e);for(je(n)&&(n=n.host);_(n)&&["html","body"].indexOf(I(n))<0;){var s=F(n);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||t&&s.willChange==="filter"||t&&s.filter&&s.filter!=="none")return n;n=n.parentNode}return null}function be(e){for(var t=P(e),r=Ze(e);r&&nr(r)&&F(r).position==="static";)r=Ze(r);return r&&(I(r)==="html"||I(r)==="body"&&F(r).position==="static")?t:r||or(e)||t}function Pe(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function de(e,t,r){return re(e,Te(t,r))}function ir(e,t,r){var o=de(e,t,r);return o>r?r:o}function gt(){return{top:0,right:0,bottom:0,left:0}}function ht(e){return Object.assign({},gt(),e)}function yt(e,t){return t.reduce(function(r,o){return r[o]=e,r},{})}var ar=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,ht(typeof e!="number"?e:yt(e,ye))};function sr(e){var t,r=e.state,o=e.name,n=e.options,s=r.elements.arrow,l=r.modifiersData.popperOffsets,u=z(r.placement),a=Pe(u),i=[B,N].indexOf(u)>=0,f=i?"height":"width";if(!(!s||!l)){var p=ar(n.padding,r),c=Be(s),v=a==="y"?j:B,g=a==="y"?H:N,d=r.rects.reference[f]+r.rects.reference[a]-l[a]-r.rects.popper[f],x=l[a]-r.rects.reference[a],O=be(s),L=O?a==="y"?O.clientHeight||0:O.clientWidth||0:0,A=d/2-x/2,m=p[v],b=L-c[f]-p[g],E=L/2-c[f]/2+A,T=de(m,E,b),S=a;r.modifiersData[o]=(t={},t[S]=T,t.centerOffset=T-E,t)}}function ur(e){var t=e.state,r=e.options,o=r.element,n=o===void 0?"[data-popper-arrow]":o;n!=null&&(typeof n=="string"&&(n=t.elements.popper.querySelector(n),!n)||mt(t.elements.popper,n)&&(t.elements.arrow=n))}var fr={name:"arrow",enabled:!0,phase:"main",fn:sr,effect:ur,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ue(e){return e.split("-")[1]}var lr={top:"auto",right:"auto",bottom:"auto",left:"auto"};function cr(e,t){var r=e.x,o=e.y,n=t.devicePixelRatio||1;return{x:ae(r*n)/n||0,y:ae(o*n)/n||0}}function et(e){var t,r=e.popper,o=e.popperRect,n=e.placement,s=e.variation,l=e.offsets,u=e.position,a=e.gpuAcceleration,i=e.adaptive,f=e.roundOffsets,p=e.isFixed,c=l.x,v=c===void 0?0:c,g=l.y,d=g===void 0?0:g,x=typeof f=="function"?f({x:v,y:d}):{x:v,y:d};v=x.x,d=x.y;var O=l.hasOwnProperty("x"),L=l.hasOwnProperty("y"),A=B,m=j,b=window;if(i){var E=be(r),T="clientHeight",S="clientWidth";if(E===P(r)&&(E=K(r),F(E).position!=="static"&&u==="absolute"&&(T="scrollHeight",S="scrollWidth")),E=E,n===j||(n===B||n===N)&&s===ge){m=H;var w=p&&E===b&&b.visualViewport?b.visualViewport.height:E[T];d-=w-o.height,d*=a?1:-1}if(n===B||(n===j||n===H)&&s===ge){A=N;var R=p&&E===b&&b.visualViewport?b.visualViewport.width:E[S];v-=R-o.width,v*=a?1:-1}}var k=Object.assign({position:u},i&&lr),$=f===!0?cr({x:v,y:d},P(r)):{x:v,y:d};if(v=$.x,d=$.y,a){var W;return Object.assign({},k,(W={},W[m]=L?"0":"",W[A]=O?"0":"",W.transform=(b.devicePixelRatio||1)<=1?"translate("+v+"px, "+d+"px)":"translate3d("+v+"px, "+d+"px, 0)",W))}return Object.assign({},k,(t={},t[m]=L?d+"px":"",t[A]=O?v+"px":"",t.transform="",t))}function pr(e){var t=e.state,r=e.options,o=r.gpuAcceleration,n=o===void 0?!0:o,s=r.adaptive,l=s===void 0?!0:s,u=r.roundOffsets,a=u===void 0?!0:u,i={placement:z(t.placement),variation:ue(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:n,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,et(Object.assign({},i,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:l,roundOffsets:a})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,et(Object.assign({},i,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:a})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var bt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:pr,data:{}},Ee={passive:!0};function dr(e){var t=e.state,r=e.instance,o=e.options,n=o.scroll,s=n===void 0?!0:n,l=o.resize,u=l===void 0?!0:l,a=P(t.elements.popper),i=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&i.forEach(function(f){f.addEventListener("scroll",r.update,Ee)}),u&&a.addEventListener("resize",r.update,Ee),function(){s&&i.forEach(function(f){f.removeEventListener("scroll",r.update,Ee)}),u&&a.removeEventListener("resize",r.update,Ee)}}var wt={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:dr,data:{}},vr={left:"right",right:"left",bottom:"top",top:"bottom"};function Se(e){return e.replace(/left|right|bottom|top/g,function(t){return vr[t]})}var mr={start:"end",end:"start"};function tt(e){return e.replace(/start|end/g,function(t){return mr[t]})}function Me(e){var t=P(e),r=t.pageXOffset,o=t.pageYOffset;return{scrollLeft:r,scrollTop:o}}function _e(e){return se(K(e)).left+Me(e).scrollLeft}function gr(e,t){var r=P(e),o=K(e),n=r.visualViewport,s=o.clientWidth,l=o.clientHeight,u=0,a=0;if(n){s=n.width,l=n.height;var i=vt();(i||!i&&t==="fixed")&&(u=n.offsetLeft,a=n.offsetTop)}return{width:s,height:l,x:u+_e(e),y:a}}function hr(e){var t,r=K(e),o=Me(e),n=(t=e.ownerDocument)==null?void 0:t.body,s=re(r.scrollWidth,r.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),l=re(r.scrollHeight,r.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),u=-o.scrollLeft+_e(e),a=-o.scrollTop;return F(n||r).direction==="rtl"&&(u+=re(r.clientWidth,n?n.clientWidth:0)-s),{width:s,height:l,x:u,y:a}}function He(e){var t=F(e),r=t.overflow,o=t.overflowX,n=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+n+o)}function xt(e){return["html","body","#document"].indexOf(I(e))>=0?e.ownerDocument.body:_(e)&&He(e)?e:xt(Le(e))}function ve(e,t){var r;t===void 0&&(t=[]);var o=xt(e),n=o===((r=e.ownerDocument)==null?void 0:r.body),s=P(o),l=n?[s].concat(s.visualViewport||[],He(o)?o:[]):o,u=t.concat(l);return n?u:u.concat(ve(Le(l)))}function De(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function yr(e,t){var r=se(e,!1,t==="fixed");return r.top=r.top+e.clientTop,r.left=r.left+e.clientLeft,r.bottom=r.top+e.clientHeight,r.right=r.left+e.clientWidth,r.width=e.clientWidth,r.height=e.clientHeight,r.x=r.left,r.y=r.top,r}function rt(e,t,r){return t===ct?De(gr(e,r)):ne(t)?yr(t,r):De(hr(K(e)))}function br(e){var t=ve(Le(e)),r=["absolute","fixed"].indexOf(F(e).position)>=0,o=r&&_(e)?be(e):e;return ne(o)?t.filter(function(n){return ne(n)&&mt(n,o)&&I(n)!=="body"}):[]}function wr(e,t,r,o){var n=t==="clippingParents"?br(e):[].concat(t),s=[].concat(n,[r]),l=s[0],u=s.reduce(function(a,i){var f=rt(e,i,o);return a.top=re(f.top,a.top),a.right=Te(f.right,a.right),a.bottom=Te(f.bottom,a.bottom),a.left=re(f.left,a.left),a},rt(e,l,o));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function Ot(e){var t=e.reference,r=e.element,o=e.placement,n=o?z(o):null,s=o?ue(o):null,l=t.x+t.width/2-r.width/2,u=t.y+t.height/2-r.height/2,a;switch(n){case j:a={x:l,y:t.y-r.height};break;case H:a={x:l,y:t.y+t.height};break;case N:a={x:t.x+t.width,y:u};break;case B:a={x:t.x-r.width,y:u};break;default:a={x:t.x,y:t.y}}var i=n?Pe(n):null;if(i!=null){var f=i==="y"?"height":"width";switch(s){case ie:a[i]=a[i]-(t[f]/2-r[f]/2);break;case ge:a[i]=a[i]+(t[f]/2-r[f]/2);break}}return a}function he(e,t){t===void 0&&(t={});var r=t,o=r.placement,n=o===void 0?e.placement:o,s=r.strategy,l=s===void 0?e.strategy:s,u=r.boundary,a=u===void 0?Ut:u,i=r.rootBoundary,f=i===void 0?ct:i,p=r.elementContext,c=p===void 0?ce:p,v=r.altBoundary,g=v===void 0?!1:v,d=r.padding,x=d===void 0?0:d,O=ht(typeof x!="number"?x:yt(x,ye)),L=c===ce?zt:ce,A=e.rects.popper,m=e.elements[g?L:c],b=wr(ne(m)?m:m.contextElement||K(e.elements.popper),a,f,l),E=se(e.elements.reference),T=Ot({reference:E,element:A,placement:n}),S=De(Object.assign({},A,T)),w=c===ce?S:E,R={top:b.top-w.top+O.top,bottom:w.bottom-b.bottom+O.bottom,left:b.left-w.left+O.left,right:w.right-b.right+O.right},k=e.modifiersData.offset;if(c===ce&&k){var $=k[n];Object.keys(R).forEach(function(W){var V=[N,H].indexOf(W)>=0?1:-1,h=[j,H].indexOf(W)>=0?"y":"x";R[W]+=$[h]*V})}return R}function xr(e,t){t===void 0&&(t={});var r=t,o=r.placement,n=r.boundary,s=r.rootBoundary,l=r.padding,u=r.flipVariations,a=r.allowedAutoPlacements,i=a===void 0?pt:a,f=ue(o),p=f?u?Qe:Qe.filter(function(g){return ue(g)===f}):ye,c=p.filter(function(g){return i.indexOf(g)>=0});c.length===0&&(c=p);var v=c.reduce(function(g,d){return g[d]=he(e,{placement:d,boundary:n,rootBoundary:s,padding:l})[z(d)],g},{});return Object.keys(v).sort(function(g,d){return v[g]-v[d]})}function Or(e){if(z(e)===$e)return[];var t=Se(e);return[tt(e),t,tt(t)]}function Er(e){var t=e.state,r=e.options,o=e.name;if(!t.modifiersData[o]._skip){for(var n=r.mainAxis,s=n===void 0?!0:n,l=r.altAxis,u=l===void 0?!0:l,a=r.fallbackPlacements,i=r.padding,f=r.boundary,p=r.rootBoundary,c=r.altBoundary,v=r.flipVariations,g=v===void 0?!0:v,d=r.allowedAutoPlacements,x=t.options.placement,O=z(x),L=O===x,A=a||(L||!g?[Se(x)]:Or(x)),m=[x].concat(A).reduce(function(Z,X){return Z.concat(z(X)===$e?xr(t,{placement:X,boundary:f,rootBoundary:p,padding:i,flipVariations:g,allowedAutoPlacements:d}):X)},[]),b=t.rects.reference,E=t.rects.popper,T=new Map,S=!0,w=m[0],R=0;R<m.length;R++){var k=m[R],$=z(k),W=ue(k)===ie,V=[j,H].indexOf($)>=0,h=V?"width":"height",C=he(t,{placement:k,boundary:f,rootBoundary:p,altBoundary:c,padding:i}),D=V?W?N:B:W?H:j;b[h]>E[h]&&(D=Se(D));var Y=Se(D),q=[];if(s&&q.push(C[$]<=0),u&&q.push(C[D]<=0,C[Y]<=0),q.every(function(Z){return Z})){w=k,S=!1;break}T.set(k,q)}if(S)for(var J=g?3:1,Q=function(Z){var X=m.find(function(xe){var le=T.get(xe);if(le)return le.slice(0,Z).every(function(oe){return oe})});if(X)return w=X,"break"},fe=J;fe>0;fe--){var we=Q(fe);if(we==="break")break}t.placement!==w&&(t.modifiersData[o]._skip=!0,t.placement=w,t.reset=!0)}}var Sr={name:"flip",enabled:!0,phase:"main",fn:Er,requiresIfExists:["offset"],data:{_skip:!1}};function nt(e,t,r){return r===void 0&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function ot(e){return[j,N,H,B].some(function(t){return e[t]>=0})}function Tr(e){var t=e.state,r=e.name,o=t.rects.reference,n=t.rects.popper,s=t.modifiersData.preventOverflow,l=he(t,{elementContext:"reference"}),u=he(t,{altBoundary:!0}),a=nt(l,o),i=nt(u,n,s),f=ot(a),p=ot(i);t.modifiersData[r]={referenceClippingOffsets:a,popperEscapeOffsets:i,isReferenceHidden:f,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":p})}var Rr={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Tr};function Lr(e,t,r){var o=z(e),n=[B,j].indexOf(o)>=0?-1:1,s=typeof r=="function"?r(Object.assign({},t,{placement:e})):r,l=s[0],u=s[1];return l=l||0,u=(u||0)*n,[B,N].indexOf(o)>=0?{x:u,y:l}:{x:l,y:u}}function Cr(e){var t=e.state,r=e.options,o=e.name,n=r.offset,s=n===void 0?[0,0]:n,l=pt.reduce(function(f,p){return f[p]=Lr(p,t.rects,s),f},{}),u=l[t.placement],a=u.x,i=u.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=a,t.modifiersData.popperOffsets.y+=i),t.modifiersData[o]=l}var Ar={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Cr};function kr(e){var t=e.state,r=e.name;t.modifiersData[r]=Ot({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}var Et={name:"popperOffsets",enabled:!0,phase:"read",fn:kr,data:{}};function Dr(e){return e==="x"?"y":"x"}function Wr(e){var t=e.state,r=e.options,o=e.name,n=r.mainAxis,s=n===void 0?!0:n,l=r.altAxis,u=l===void 0?!1:l,a=r.boundary,i=r.rootBoundary,f=r.altBoundary,p=r.padding,c=r.tether,v=c===void 0?!0:c,g=r.tetherOffset,d=g===void 0?0:g,x=he(t,{boundary:a,rootBoundary:i,padding:p,altBoundary:f}),O=z(t.placement),L=ue(t.placement),A=!L,m=Pe(O),b=Dr(m),E=t.modifiersData.popperOffsets,T=t.rects.reference,S=t.rects.popper,w=typeof d=="function"?d(Object.assign({},t.rects,{placement:t.placement})):d,R=typeof w=="number"?{mainAxis:w,altAxis:w}:Object.assign({mainAxis:0,altAxis:0},w),k=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,$={x:0,y:0};if(E){if(s){var W,V=m==="y"?j:B,h=m==="y"?H:N,C=m==="y"?"height":"width",D=E[m],Y=D+x[V],q=D-x[h],J=v?-S[C]/2:0,Q=L===ie?T[C]:S[C],fe=L===ie?-S[C]:-T[C],we=t.elements.arrow,Z=v&&we?Be(we):{width:0,height:0},X=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:gt(),xe=X[V],le=X[h],oe=de(0,T[C],Z[C]),Ct=A?T[C]/2-J-oe-xe-R.mainAxis:Q-oe-xe-R.mainAxis,At=A?-T[C]/2+J+oe+le+R.mainAxis:fe+oe+le+R.mainAxis,Ce=t.elements.arrow&&be(t.elements.arrow),kt=Ce?m==="y"?Ce.clientTop||0:Ce.clientLeft||0:0,Ve=(W=k?.[m])!=null?W:0,Dt=D+Ct-Ve-kt,Wt=D+At-Ve,qe=de(v?Te(Y,Dt):Y,D,v?re(q,Wt):q);E[m]=qe,$[m]=qe-D}if(u){var Ue,$t=m==="x"?j:B,jt=m==="x"?H:N,ee=E[b],Oe=b==="y"?"height":"width",ze=ee+x[$t],Ie=ee-x[jt],Ae=[j,B].indexOf(O)!==-1,Ye=(Ue=k?.[b])!=null?Ue:0,Xe=Ae?ze:ee-T[Oe]-S[Oe]-Ye+R.altAxis,Fe=Ae?ee+T[Oe]+S[Oe]-Ye-R.altAxis:Ie,Ge=v&&Ae?ir(Xe,ee,Fe):de(v?Xe:ze,ee,v?Fe:Ie);E[b]=Ge,$[b]=Ge-ee}t.modifiersData[o]=$}}var $r={name:"preventOverflow",enabled:!0,phase:"main",fn:Wr,requiresIfExists:["offset"]};function jr(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Br(e){return e===P(e)||!_(e)?Me(e):jr(e)}function Pr(e){var t=e.getBoundingClientRect(),r=ae(t.width)/e.offsetWidth||1,o=ae(t.height)/e.offsetHeight||1;return r!==1||o!==1}function Mr(e,t,r){r===void 0&&(r=!1);var o=_(t),n=_(t)&&Pr(t),s=K(t),l=se(e,n,r),u={scrollLeft:0,scrollTop:0},a={x:0,y:0};return(o||!o&&!r)&&((I(t)!=="body"||He(s))&&(u=Br(t)),_(t)?(a=se(t,!0),a.x+=t.clientLeft,a.y+=t.clientTop):s&&(a.x=_e(s))),{x:l.left+u.scrollLeft-a.x,y:l.top+u.scrollTop-a.y,width:l.width,height:l.height}}function _r(e){var t=new Map,r=new Set,o=[];e.forEach(function(s){t.set(s.name,s)});function n(s){r.add(s.name);var l=[].concat(s.requires||[],s.requiresIfExists||[]);l.forEach(function(u){if(!r.has(u)){var a=t.get(u);a&&n(a)}}),o.push(s)}return e.forEach(function(s){r.has(s.name)||n(s)}),o}function Hr(e){var t=_r(e);return er.reduce(function(r,o){return r.concat(t.filter(function(n){return n.phase===o}))},[])}function Nr(e){var t;return function(){return t||(t=new Promise(function(r){Promise.resolve().then(function(){t=void 0,r(e())})})),t}}function Vr(e){var t=e.reduce(function(r,o){var n=r[o.name];return r[o.name]=n?Object.assign({},n,o,{options:Object.assign({},n.options,o.options),data:Object.assign({},n.data,o.data)}):o,r},{});return Object.keys(t).map(function(r){return t[r]})}var it={placement:"bottom",modifiers:[],strategy:"absolute"};function at(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return!t.some(function(o){return!(o&&typeof o.getBoundingClientRect=="function")})}function Ne(e){e===void 0&&(e={});var t=e,r=t.defaultModifiers,o=r===void 0?[]:r,n=t.defaultOptions,s=n===void 0?it:n;return function(l,u,a){a===void 0&&(a=s);var i={placement:"bottom",orderedModifiers:[],options:Object.assign({},it,s),modifiersData:{},elements:{reference:l,popper:u},attributes:{},styles:{}},f=[],p=!1,c={state:i,setOptions:function(d){var x=typeof d=="function"?d(i.options):d;g(),i.options=Object.assign({},s,i.options,x),i.scrollParents={reference:ne(l)?ve(l):l.contextElement?ve(l.contextElement):[],popper:ve(u)};var O=Hr(Vr([].concat(o,i.options.modifiers)));return i.orderedModifiers=O.filter(function(L){return L.enabled}),v(),c.update()},forceUpdate:function(){if(!p){var d=i.elements,x=d.reference,O=d.popper;if(at(x,O)){i.rects={reference:Mr(x,be(O),i.options.strategy==="fixed"),popper:Be(O)},i.reset=!1,i.placement=i.options.placement,i.orderedModifiers.forEach(function(S){return i.modifiersData[S.name]=Object.assign({},S.data)});for(var L=0;L<i.orderedModifiers.length;L++){if(i.reset===!0){i.reset=!1,L=-1;continue}var A=i.orderedModifiers[L],m=A.fn,b=A.options,E=b===void 0?{}:b,T=A.name;typeof m=="function"&&(i=m({state:i,options:E,name:T,instance:c})||i)}}}},update:Nr(function(){return new Promise(function(d){c.forceUpdate(),d(i)})}),destroy:function(){g(),p=!0}};if(!at(l,u))return c;c.setOptions(a).then(function(d){!p&&a.onFirstUpdate&&a.onFirstUpdate(d)});function v(){i.orderedModifiers.forEach(function(d){var x=d.name,O=d.options,L=O===void 0?{}:O,A=d.effect;if(typeof A=="function"){var m=A({state:i,name:x,instance:c,options:L}),b=function(){};f.push(m||b)}})}function g(){f.forEach(function(d){return d()}),f=[]}return c}}Ne();var qr=[wt,Et,bt,dt];Ne({defaultModifiers:qr});var Ur=[wt,Et,bt,dt,Ar,Sr,$r,fr,Rr],zr=Ne({defaultModifiers:Ur}),Ir=We(Ht()),Yr=[],Xr=function(e,t,r){r===void 0&&(r={});var o=y.useRef(null),n={onFirstUpdate:r.onFirstUpdate,placement:r.placement||"bottom",strategy:r.strategy||"absolute",modifiers:r.modifiers||Yr},s=y.useState({styles:{popper:{position:n.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),l=s[0],u=s[1],a=y.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(p){var c=p.state,v=Object.keys(c.elements);_t.flushSync(function(){u({styles:Ke(v.map(function(g){return[g,c.styles[g]||{}]})),attributes:Ke(v.map(function(g){return[g,c.attributes[g]]}))})})},requires:["computeStyles"]}},[]),i=y.useMemo(function(){var p={onFirstUpdate:n.onFirstUpdate,placement:n.placement,strategy:n.strategy,modifiers:[].concat(n.modifiers,[a,{name:"applyStyles",enabled:!1}])};return(0,Ir.default)(o.current,p)?o.current||p:(o.current=p,p)},[n.onFirstUpdate,n.placement,n.strategy,n.modifiers,a]),f=y.useRef();return Je(function(){f.current&&f.current.setOptions(i)},[i]),Je(function(){if(!(e==null||t==null)){var p=r.createPopper||zr,c=p(e,t,i);return f.current=c,function(){c.destroy(),f.current=null}}},[e,t,r.createPopper]),{state:f.current?f.current.state:null,styles:l.styles,attributes:l.attributes,update:f.current?f.current.update:null,forceUpdate:f.current?f.current.forceUpdate:null}};We(Nt());function St(e){var t=y.useRef(e);return t.current=e,y.useCallback(function(){return t.current},[])}var Fr=function(){};function Gr(e){var t=e.initial,r=e.value,o=e.onChange,n=o===void 0?Fr:o;if(t===void 0&&r===void 0)throw new TypeError('Either "value" or "initial" variable must be set. Now both are undefined');var s=y.useState(t),l=s[0],u=s[1],a=St(l),i=y.useCallback(function(p){var c=a(),v=typeof p=="function"?p(c):p;typeof v.persist=="function"&&v.persist(),u(v),typeof n=="function"&&n(v)},[a,n]),f=r!==void 0;return[f?r:l,f?n:i]}function Tt(e,t){return e===void 0&&(e=0),t===void 0&&(t=0),function(){return{width:0,height:0,top:t,right:e,bottom:t,left:e,x:0,y:0,toJSON:function(){return null}}}}var Kr=["styles","attributes"],st={getBoundingClientRect:Tt()},ut={closeOnOutsideClick:!0,closeOnTriggerHidden:!1,defaultVisible:!1,delayHide:0,delayShow:0,followCursor:!1,interactive:!1,mutationObserverOptions:{attributes:!0,childList:!0,subtree:!0},offset:[0,6],trigger:"hover"};function Jr(e,t){var r,o,n;e===void 0&&(e={}),t===void 0&&(t={});var s=Object.keys(ut).reduce(function(h,C){var D;return te({},h,(D={},D[C]=h[C]!==void 0?h[C]:ut[C],D))},e),l=y.useMemo(function(){return[{name:"offset",options:{offset:s.offset}}]},Array.isArray(s.offset)?s.offset:[]),u=te({},t,{placement:t.placement||s.placement,modifiers:t.modifiers||l}),a=y.useState(null),i=a[0],f=a[1],p=y.useState(null),c=p[0],v=p[1],g=Gr({initial:s.defaultVisible,value:s.visible,onChange:s.onVisibleChange}),d=g[0],x=g[1],O=y.useRef();y.useEffect(function(){return function(){return clearTimeout(O.current)}},[]);var L=Xr(s.followCursor?st:i,c,u),A=L.styles,m=L.attributes,b=Mt(L,Kr),E=b.update,T=St({visible:d,triggerRef:i,tooltipRef:c,finalConfig:s}),S=y.useCallback(function(h){return Array.isArray(s.trigger)?s.trigger.includes(h):s.trigger===h},Array.isArray(s.trigger)?s.trigger:[s.trigger]),w=y.useCallback(function(){clearTimeout(O.current),O.current=window.setTimeout(function(){return x(!1)},s.delayHide)},[s.delayHide,x]),R=y.useCallback(function(){clearTimeout(O.current),O.current=window.setTimeout(function(){return x(!0)},s.delayShow)},[s.delayShow,x]),k=y.useCallback(function(){T().visible?w():R()},[T,w,R]);y.useEffect(function(){if(T().finalConfig.closeOnOutsideClick){var h=function(C){var D,Y=T(),q=Y.tooltipRef,J=Y.triggerRef,Q=(C.composedPath==null||(D=C.composedPath())==null?void 0:D[0])||C.target;Q instanceof Node&&q!=null&&J!=null&&!q.contains(Q)&&!J.contains(Q)&&w()};return document.addEventListener("mousedown",h),function(){return document.removeEventListener("mousedown",h)}}},[T,w]),y.useEffect(function(){if(!(i==null||!S("click")))return i.addEventListener("click",k),function(){return i.removeEventListener("click",k)}},[i,S,k]),y.useEffect(function(){if(!(i==null||!S("double-click")))return i.addEventListener("dblclick",k),function(){return i.removeEventListener("dblclick",k)}},[i,S,k]),y.useEffect(function(){if(!(i==null||!S("right-click"))){var h=function(C){C.preventDefault(),k()};return i.addEventListener("contextmenu",h),function(){return i.removeEventListener("contextmenu",h)}}},[i,S,k]),y.useEffect(function(){if(!(i==null||!S("focus")))return i.addEventListener("focus",R),i.addEventListener("blur",w),function(){i.removeEventListener("focus",R),i.removeEventListener("blur",w)}},[i,S,R,w]),y.useEffect(function(){if(!(i==null||!S("hover")))return i.addEventListener("mouseenter",R),i.addEventListener("mouseleave",w),function(){i.removeEventListener("mouseenter",R),i.removeEventListener("mouseleave",w)}},[i,S,R,w]),y.useEffect(function(){if(!(c==null||!S("hover")||!T().finalConfig.interactive))return c.addEventListener("mouseenter",R),c.addEventListener("mouseleave",w),function(){c.removeEventListener("mouseenter",R),c.removeEventListener("mouseleave",w)}},[c,S,R,w,T]);var $=b==null||(r=b.state)==null||(o=r.modifiersData)==null||(n=o.hide)==null?void 0:n.isReferenceHidden;y.useEffect(function(){s.closeOnTriggerHidden&&$&&w()},[s.closeOnTriggerHidden,w,$]),y.useEffect(function(){if(!s.followCursor||i==null)return;function h(C){var D=C.clientX,Y=C.clientY;st.getBoundingClientRect=Tt(D,Y),E?.()}return i.addEventListener("mousemove",h),function(){return i.removeEventListener("mousemove",h)}},[s.followCursor,i,E]),y.useEffect(function(){if(!(c==null||E==null||s.mutationObserverOptions==null)){var h=new MutationObserver(E);return h.observe(c,s.mutationObserverOptions),function(){return h.disconnect()}}},[s.mutationObserverOptions,c,E]);var W=function(h){return h===void 0&&(h={}),te({},h,{style:te({},h.style,A.popper)},m.popper,{"data-popper-interactive":s.interactive})},V=function(h){return h===void 0&&(h={}),te({},h,m.arrow,{style:te({},h.style,A.arrow),"data-popper-arrow":!0})};return te({getArrowProps:V,getTooltipProps:W,setTooltipRef:v,setTriggerRef:f,tooltipRef:c,triggerRef:i,visible:d},b)}var{document:me}=qt,M=(0,Vt.default)(1e3)((e,t,r,o=0)=>t.split("-")[0]===e?r:o),G=8,Qr=Re.div({position:"absolute",borderStyle:"solid"},({placement:e})=>{let t=0,r=0;switch(!0){case(e.startsWith("left")||e.startsWith("right")):{r=8;break}case(e.startsWith("top")||e.startsWith("bottom")):{t=8;break}}return{transform:`translate3d(${t}px, ${r}px, 0px)`}},({theme:e,color:t,placement:r})=>({bottom:`${M("top",r,`${G*-1}px`,"auto")}`,top:`${M("bottom",r,`${G*-1}px`,"auto")}`,right:`${M("left",r,`${G*-1}px`,"auto")}`,left:`${M("right",r,`${G*-1}px`,"auto")}`,borderBottomWidth:`${M("top",r,"0",G)}px`,borderTopWidth:`${M("bottom",r,"0",G)}px`,borderRightWidth:`${M("left",r,"0",G)}px`,borderLeftWidth:`${M("right",r,"0",G)}px`,borderTopColor:M("top",r,e.color[t]||t||e.base==="light"?pe(e.background.app):e.background.app,"transparent"),borderBottomColor:M("bottom",r,e.color[t]||t||e.base==="light"?pe(e.background.app):e.background.app,"transparent"),borderLeftColor:M("left",r,e.color[t]||t||e.base==="light"?pe(e.background.app):e.background.app,"transparent"),borderRightColor:M("right",r,e.color[t]||t||e.base==="light"?pe(e.background.app):e.background.app,"transparent")})),Zr=Re.div(({hidden:e})=>({display:e?"none":"inline-block",zIndex:2147483647,colorScheme:"light dark"}),({theme:e,color:t,hasChrome:r})=>r?{background:t&&e.color[t]||t||e.base==="light"?pe(e.background.app):e.background.app,filter:`
2
+ drop-shadow(0px 5px 5px rgba(0,0,0,0.05))
3
+ drop-shadow(0 1px 3px rgba(0,0,0,0.1))
4
+ `,borderRadius:e.appBorderRadius+2,fontSize:e.typography.size.s1}:{}),Rt=U.forwardRef(({placement:e="top",hasChrome:t=!0,children:r,arrowProps:o={},tooltipRef:n,color:s,withArrows:l,...u},a)=>U.createElement(Zr,{"data-testid":"tooltip",hasChrome:t,ref:a,...u,color:s},t&&l&&U.createElement(Qr,{placement:e,...o,color:s}),r));Rt.displayName="Tooltip";var en=Re.div`
5
+ display: inline-block;
6
+ cursor: ${e=>e.trigger==="hover"||e.trigger?.includes("hover")?"default":"pointer"};
7
+ `,tn=Re.g`
8
+ cursor: ${e=>e.trigger==="hover"||e.trigger?.includes("hover")?"default":"pointer"};
9
+ `,Lt=({svg:e=!1,trigger:t="click",closeOnOutsideClick:r=!1,placement:o="top",modifiers:n=[{name:"preventOverflow",options:{padding:8}},{name:"offset",options:{offset:[8,8]}},{name:"arrow",options:{padding:8}}],hasChrome:s=!0,defaultVisible:l=!1,withArrows:u,offset:a,tooltip:i,children:f,closeOnTriggerHidden:p,mutationObserverOptions:c,delayHide:v=t==="hover"?200:0,visible:g,interactive:d,delayShow:x=t==="hover"?400:0,strategy:O,followCursor:L,onVisibleChange:A,portalContainer:m,...b})=>{let E=e?tn:en,{getArrowProps:T,getTooltipProps:S,setTooltipRef:w,setTriggerRef:R,visible:k,state:$}=Jr({trigger:t,placement:o,defaultVisible:l,delayHide:v,interactive:d,closeOnOutsideClick:r,closeOnTriggerHidden:p,onVisibleChange:A,delayShow:x,followCursor:L,mutationObserverOptions:c,visible:g,offset:a},{modifiers:n,strategy:O}),W=(typeof m=="string"?me.querySelector(m):m)||me.body,V=k?U.createElement(Rt,{placement:$?.placement,ref:w,hasChrome:s,arrowProps:T(),withArrows:u,...S()},typeof i=="function"?i({onHide:()=>A(!1)}):i):null;return U.createElement(U.Fragment,null,U.createElement(E,{trigger:t,ref:R,...b},f),k&&Bt.createPortal(V,W))},rn=({startOpen:e=!1,onVisibleChange:t,...r})=>{let[o,n]=y.useState(e),s=y.useCallback(l=>{t&&t(l)===!1||n(l)},[t]);return y.useEffect(()=>{let l=()=>s(!1),u=f=>{f.key==="Escape"&&l()};me.addEventListener("keydown",u,!1);let a=Array.from(me.getElementsByTagName("iframe")),i=[];return a.forEach(f=>{let p=()=>{try{f.contentWindow.document&&(f.contentWindow.document.addEventListener("click",l),i.push(()=>{try{f.contentWindow.document.removeEventListener("click",l)}catch{}}))}catch{}};p(),f.addEventListener("load",p),i.push(()=>{f.removeEventListener("load",p)})}),()=>{me.removeEventListener("keydown",u),i.forEach(f=>{f()})}}),U.createElement(Lt,{...r,visible:o,onVisibleChange:s})},un=e=>(lt("WithTooltipPure is deprecated and will be removed in Storybook 11. Please use WithTooltip instead."),U.createElement(Lt,{"data-deprecated":"WithTooltipPure",...e})),fn=e=>(lt("WithToolTipState is deprecated and will be removed in Storybook 11. Please use WithTooltip instead."),U.createElement(rn,{"data-deprecated":"WithToolTipState",...e}));export{Rt as Tooltip,fn as WithToolTipState,rn as WithTooltip,un as WithTooltipPure};
@@ -0,0 +1 @@
1
+ import{d as m,b as e}from"./DocsRenderer-LL677BLK-Dtw9GMer.js";import{K as o}from"./iframe-Bl9oHz5c.js";import"./preload-helper-PPVm8Dsz.js";import"./_commonjsHelpers-CqkleIqs.js";var t=o(e(),1),s=(0,t.default)(2)(async(i,r)=>i===!1?r:m(r));export{s as formatter};