@walker-di/fortalece-ai-sdk 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +44 -0
- package/README.md +246 -0
- package/dist/fortalece-ai-sdk.iife.js +47 -0
- package/dist/fortalece-ai-sdk.js +3312 -0
- package/dist/fortalece-ai-sdk.umd.cjs +47 -0
- package/package.json +101 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.1.0] - 2024-12-11
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Initial release of `@walker-di/fortalece-ai-sdk`
|
|
13
|
+
- `<support-chat>` web component for customer support chat
|
|
14
|
+
- Real-time chat interface
|
|
15
|
+
- Customizable theme (light/dark/auto)
|
|
16
|
+
- Configurable position (bottom-right/bottom-left)
|
|
17
|
+
- Custom primary color support
|
|
18
|
+
- Welcome message configuration
|
|
19
|
+
- `<feedback-panel>` web component for feedback collection
|
|
20
|
+
- Multiple feedback types (bug, feature, improvement, question, other)
|
|
21
|
+
- Priority selector (low/medium/high)
|
|
22
|
+
- Form validation
|
|
23
|
+
- Success state handling
|
|
24
|
+
- API client for backend communication
|
|
25
|
+
- `sendMessage()` function for chat
|
|
26
|
+
- `submitFeedback()` function for feedback
|
|
27
|
+
- `createApiConfig()` helper
|
|
28
|
+
- TypeScript type definitions
|
|
29
|
+
- Shadow DOM encapsulation for style isolation
|
|
30
|
+
- Three build formats:
|
|
31
|
+
- ES Module (`fortalece-ai-sdk.js`)
|
|
32
|
+
- UMD (`fortalece-ai-sdk.umd.cjs`)
|
|
33
|
+
- IIFE (`fortalece-ai-sdk.iife.js`) for CDN usage
|
|
34
|
+
- Storybook documentation
|
|
35
|
+
- E2E tests with Playwright
|
|
36
|
+
- Demo page for testing
|
|
37
|
+
|
|
38
|
+
### Technical Details
|
|
39
|
+
|
|
40
|
+
- Built with Svelte 5
|
|
41
|
+
- Vite library mode for bundling
|
|
42
|
+
- Custom elements API for web components
|
|
43
|
+
- CSS custom properties for theming
|
|
44
|
+
|
package/README.md
ADDED
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
# @walker-di/fortalece-ai-sdk
|
|
2
|
+
|
|
3
|
+
Web Components library for Fortalece AI integration. Provides `<support-chat>` and `<feedback-panel>` custom elements that can be used in any web application.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Support Chat Widget**: Interactive chat interface for customer support
|
|
8
|
+
- **Feedback Panel**: Form for collecting user feedback, bug reports, and feature requests
|
|
9
|
+
- **Web Components**: Works with any framework (React, Vue, Angular, vanilla JS)
|
|
10
|
+
- **CDN Ready**: Load directly from CDN with no build step required
|
|
11
|
+
- **Customizable**: Theming, positioning, and styling options
|
|
12
|
+
- **TypeScript Support**: Full type definitions included
|
|
13
|
+
- **Lightweight**: Minimal bundle size with no external dependencies
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
### CDN Usage (Recommended for quick integration)
|
|
18
|
+
|
|
19
|
+
Add the script tag to your HTML:
|
|
20
|
+
|
|
21
|
+
```html
|
|
22
|
+
<script src="https://cdn.jsdelivr.net/npm/@walker-di/fortalece-ai-sdk/dist/fortalece-ai-sdk.iife.js"></script>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Then use the components:
|
|
26
|
+
|
|
27
|
+
```html
|
|
28
|
+
<support-chat project-id="your-project-id"></support-chat>
|
|
29
|
+
<feedback-panel project-id="your-project-id"></feedback-panel>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### npm Installation
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm install @walker-di/fortalece-ai-sdk
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
```javascript
|
|
39
|
+
// Import to auto-register custom elements
|
|
40
|
+
import '@walker-di/fortalece-ai-sdk';
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Or use specific exports:
|
|
44
|
+
|
|
45
|
+
```javascript
|
|
46
|
+
import { sendMessage, submitFeedback, createApiConfig } from '@walker-di/fortalece-ai-sdk';
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Components
|
|
50
|
+
|
|
51
|
+
### `<support-chat>`
|
|
52
|
+
|
|
53
|
+
Interactive chat widget for customer support.
|
|
54
|
+
|
|
55
|
+
```html
|
|
56
|
+
<support-chat
|
|
57
|
+
project-id="your-project-id"
|
|
58
|
+
api-url="https://api.fortalece.ai"
|
|
59
|
+
position="bottom-right"
|
|
60
|
+
theme="light"
|
|
61
|
+
primary-color="#6366f1"
|
|
62
|
+
welcome-message="Hi! How can I help you?"
|
|
63
|
+
placeholder="Type a message..."
|
|
64
|
+
></support-chat>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
#### Attributes
|
|
68
|
+
|
|
69
|
+
| Attribute | Type | Default | Description |
|
|
70
|
+
|-----------|------|---------|-------------|
|
|
71
|
+
| `project-id` | string | **required** | Your Fortalece AI project ID |
|
|
72
|
+
| `api-url` | string | `https://api.fortalece.ai` | API endpoint URL |
|
|
73
|
+
| `position` | `bottom-right` \| `bottom-left` | `bottom-right` | Widget position |
|
|
74
|
+
| `theme` | `light` \| `dark` \| `auto` | `light` | Color theme |
|
|
75
|
+
| `primary-color` | string | `#6366f1` | Primary accent color (hex) |
|
|
76
|
+
| `welcome-message` | string | `Hi there! How can I help you today?` | Initial welcome message |
|
|
77
|
+
| `placeholder` | string | `Type a message...` | Input placeholder text |
|
|
78
|
+
|
|
79
|
+
### `<feedback-panel>`
|
|
80
|
+
|
|
81
|
+
Feedback collection widget with form.
|
|
82
|
+
|
|
83
|
+
```html
|
|
84
|
+
<feedback-panel
|
|
85
|
+
project-id="your-project-id"
|
|
86
|
+
api-url="https://api.fortalece.ai"
|
|
87
|
+
position="bottom-left"
|
|
88
|
+
theme="light"
|
|
89
|
+
primary-color="#6366f1"
|
|
90
|
+
show-priority="true"
|
|
91
|
+
allow-attachments="false"
|
|
92
|
+
></feedback-panel>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
#### Attributes
|
|
96
|
+
|
|
97
|
+
| Attribute | Type | Default | Description |
|
|
98
|
+
|-----------|------|---------|-------------|
|
|
99
|
+
| `project-id` | string | **required** | Your Fortalece AI project ID |
|
|
100
|
+
| `api-url` | string | `https://api.fortalece.ai` | API endpoint URL |
|
|
101
|
+
| `position` | `bottom-right` \| `bottom-left` | `bottom-right` | Widget position |
|
|
102
|
+
| `theme` | `light` \| `dark` \| `auto` | `light` | Color theme |
|
|
103
|
+
| `primary-color` | string | `#6366f1` | Primary accent color (hex) |
|
|
104
|
+
| `show-priority` | boolean | `true` | Show priority selector |
|
|
105
|
+
| `allow-attachments` | boolean | `false` | Allow file attachments |
|
|
106
|
+
|
|
107
|
+
## Programmatic API
|
|
108
|
+
|
|
109
|
+
For advanced usage, you can use the API client directly:
|
|
110
|
+
|
|
111
|
+
```javascript
|
|
112
|
+
import { sendMessage, submitFeedback, createApiConfig } from '@walker-di/fortalece-ai-sdk';
|
|
113
|
+
|
|
114
|
+
// Create API configuration
|
|
115
|
+
const config = createApiConfig('your-project-id', {
|
|
116
|
+
apiUrl: 'https://api.fortalece.ai',
|
|
117
|
+
apiKey: 'optional-api-key'
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
// Send a chat message
|
|
121
|
+
const chatResponse = await sendMessage(config, 'Hello, I need help!');
|
|
122
|
+
if (chatResponse.success) {
|
|
123
|
+
console.log('Assistant:', chatResponse.message.content);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// Submit feedback
|
|
127
|
+
const feedbackResponse = await submitFeedback(config, {
|
|
128
|
+
type: 'feature',
|
|
129
|
+
title: 'New Feature Request',
|
|
130
|
+
description: 'I would like to see...',
|
|
131
|
+
priority: 'medium',
|
|
132
|
+
email: 'user@example.com'
|
|
133
|
+
});
|
|
134
|
+
if (feedbackResponse.success) {
|
|
135
|
+
console.log('Feedback submitted:', feedbackResponse.feedbackId);
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Types
|
|
140
|
+
|
|
141
|
+
```typescript
|
|
142
|
+
import type {
|
|
143
|
+
ApiConfig,
|
|
144
|
+
ChatMessage,
|
|
145
|
+
MessageRole,
|
|
146
|
+
SendMessageRequest,
|
|
147
|
+
SendMessageResponse,
|
|
148
|
+
FeedbackRequest,
|
|
149
|
+
FeedbackResponse,
|
|
150
|
+
FeedbackType,
|
|
151
|
+
FeedbackPriority,
|
|
152
|
+
SupportChatConfig,
|
|
153
|
+
FeedbackPanelConfig
|
|
154
|
+
} from '@walker-di/fortalece-ai-sdk';
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## Customization
|
|
158
|
+
|
|
159
|
+
### CSS Custom Properties
|
|
160
|
+
|
|
161
|
+
Both components support CSS custom properties for styling:
|
|
162
|
+
|
|
163
|
+
```css
|
|
164
|
+
support-chat,
|
|
165
|
+
feedback-panel {
|
|
166
|
+
--fortalece-primary: #6366f1;
|
|
167
|
+
--fortalece-bg: #ffffff;
|
|
168
|
+
--fortalece-bg-secondary: #f9fafb;
|
|
169
|
+
--fortalece-text: #1f2937;
|
|
170
|
+
--fortalece-text-muted: #6b7280;
|
|
171
|
+
--fortalece-border: #e5e7eb;
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### Shadow DOM
|
|
176
|
+
|
|
177
|
+
Components use Shadow DOM for style encapsulation. This ensures your page styles don't affect the widget appearance and vice versa.
|
|
178
|
+
|
|
179
|
+
## Browser Support
|
|
180
|
+
|
|
181
|
+
- Chrome 67+
|
|
182
|
+
- Firefox 63+
|
|
183
|
+
- Safari 10.1+
|
|
184
|
+
- Edge 79+
|
|
185
|
+
|
|
186
|
+
## Development
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
# Install dependencies
|
|
190
|
+
npm install
|
|
191
|
+
|
|
192
|
+
# Start development server
|
|
193
|
+
npm run dev
|
|
194
|
+
|
|
195
|
+
# Build library
|
|
196
|
+
npm run build:lib
|
|
197
|
+
|
|
198
|
+
# Run tests
|
|
199
|
+
npm test
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
## Demo
|
|
203
|
+
|
|
204
|
+
Visit `/demo` in the development server to test the components with live configuration.
|
|
205
|
+
|
|
206
|
+
## CI/CD
|
|
207
|
+
|
|
208
|
+
This package uses GitHub Actions for CI/CD:
|
|
209
|
+
|
|
210
|
+
- **CI**: Runs on every push/PR to `main` that modifies `packages/fortalece-ai-sdk/`
|
|
211
|
+
- Type checking
|
|
212
|
+
- Library build
|
|
213
|
+
- E2E tests
|
|
214
|
+
|
|
215
|
+
- **Publish**: Runs on version tags (`fortalece-ai-sdk@*`) or manual trigger
|
|
216
|
+
- Publishes to npm
|
|
217
|
+
- Creates GitHub release with artifacts
|
|
218
|
+
|
|
219
|
+
### Releasing a New Version
|
|
220
|
+
|
|
221
|
+
1. Update the version in `package.json`
|
|
222
|
+
2. Update `CHANGELOG.md`
|
|
223
|
+
3. Commit changes: `git commit -am "chore: release @walker-di/fortalece-ai-sdk@x.x.x"`
|
|
224
|
+
4. Create a tag: `git tag fortalece-ai-sdk@x.x.x`
|
|
225
|
+
5. Push with tags: `git push --follow-tags`
|
|
226
|
+
|
|
227
|
+
Or use the convenience scripts:
|
|
228
|
+
|
|
229
|
+
```bash
|
|
230
|
+
# Patch release (0.1.0 -> 0.1.1)
|
|
231
|
+
npm run release:patch
|
|
232
|
+
|
|
233
|
+
# Minor release (0.1.0 -> 0.2.0)
|
|
234
|
+
npm run release:minor
|
|
235
|
+
|
|
236
|
+
# Major release (0.1.0 -> 1.0.0)
|
|
237
|
+
npm run release:major
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### Required Secrets
|
|
241
|
+
|
|
242
|
+
- `NPM_TOKEN`: npm access token with publish permissions for `@fortalece-ai` scope
|
|
243
|
+
|
|
244
|
+
## License
|
|
245
|
+
|
|
246
|
+
MIT
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
var FortaleceAI=(function(oe){"use strict";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add("5");const ts=1,rs=2,Or=4,ns=8,ss=16,is=1,as=2,Pr="[",Ot="[!",ir="]",tt={},P=Symbol(),ls="http://www.w3.org/1999/xhtml",ar=!1;var jr=Array.isArray,os=Array.prototype.indexOf,Pt=Array.from,jt=Object.keys,Dt=Object.defineProperty,rt=Object.getOwnPropertyDescriptor,fs=Object.getOwnPropertyDescriptors,cs=Object.prototype,us=Array.prototype,Dr=Object.getPrototypeOf,Fr=Object.isExtensible;function ds(e){for(var t=0;t<e.length;t++)e[t]()}function Ur(){var e,t,r=new Promise((n,i)=>{e=n,t=i});return{promise:r,resolve:e,reject:t}}const O=2,lr=4,or=8,vs=1<<24,$e=16,ze=32,je=64,Ft=128,fe=512,j=1024,V=2048,ke=4096,X=8192,Ee=16384,Ut=32768,nt=65536,Br=1<<17,qr=1<<18,Ve=1<<19,hs=1<<20,Se=1<<25,Ye=32768,fr=1<<21,cr=1<<22,De=1<<23,ur=Symbol("$state"),ps=Symbol("legacy props"),ms=Symbol(""),st=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},dr=3,it=8;function _s(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function gs(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function bs(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function ws(e){throw new Error("https://svelte.dev/e/effect_orphan")}function ys(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function xs(){throw new Error("https://svelte.dev/e/hydration_failed")}function $s(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function zs(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function ks(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Es(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function Bt(e){console.warn("https://svelte.dev/e/hydration_mismatch")}function Ss(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let w=!1;function Ae(e){w=e}let E;function Y(e){if(e===null)throw Bt(),tt;return E=e}function qt(){return Y(Me(E))}function $(e){if(w){if(Me(E)!==null)throw Bt(),tt;E=e}}function gt(e=1){if(w){for(var t=e,r=E;t--;)r=Me(r);E=r}}function Ht(e=!0){for(var t=0,r=E;;){if(r.nodeType===it){var n=r.data;if(n===ir){if(t===0)return r;t-=1}else(n===Pr||n===Ot)&&(t+=1)}var i=Me(r);e&&r.remove(),r=i}}function Hr(e){if(!e||e.nodeType!==it)throw Bt(),tt;return e.data}function Zr(e){return e===this.v}function As(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function Vr(e){return!As(e,this.v)}let Ts=!1,ee=null;function at(e){ee=e}function vr(e,t=!1,r){ee={p:ee,i:!1,c:null,e:null,s:e,x:null,l:null}}function hr(e){var t=ee,r=t.e;if(r!==null){t.e=null;for(var n of r)mn(n)}return e!==void 0&&(t.x=e),t.i=!0,ee=t.p,e??{}}function Yr(){return!0}let Ke=[];function Kr(){var e=Ke;Ke=[],ds(e)}function lt(e){if(Ke.length===0&&!bt){var t=Ke;queueMicrotask(()=>{t===Ke&&Kr()})}Ke.push(e)}function Cs(){for(;Ke.length>0;)Kr()}function Wr(e){var t=x;if(t===null)return y.f|=De,e;if((t.f&Ut)===0){if((t.f&Ft)===0)throw e;t.b.error(e)}else ot(e,t)}function ot(e,t){for(;t!==null;){if((t.f&Ft)!==0)try{t.b.error(e);return}catch(r){e=r}t=t.parent}throw e}const Zt=new Set;let z=null,Vt=null,te=null,re=[],Yt=null,pr=!1,bt=!1;class ce{committed=!1;current=new Map;previous=new Map;#t=new Set;#e=new Set;#r=0;#n=0;#o=null;#i=[];#s=[];skipped_effects=new Set;is_fork=!1;is_deferred(){return this.is_fork||this.#n>0}process(t){re=[],Vt=null,this.apply();var r={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const n of t)this.#a(n,r);this.is_fork||this.#c(),this.is_deferred()?(this.#l(r.effects),this.#l(r.render_effects),this.#l(r.block_effects)):(Vt=this,z=null,Jr(r.render_effects),Jr(r.effects),Vt=null,this.#o?.resolve()),te=null}#a(t,r){t.f^=j;for(var n=t.first;n!==null;){var i=n.f,s=(i&(ze|je))!==0,a=s&&(i&j)!==0,l=a||(i&X)!==0||this.skipped_effects.has(n);if((n.f&Ft)!==0&&n.b?.is_pending()&&(r={parent:r,effect:n,effects:[],render_effects:[],block_effects:[]}),!l&&n.fn!==null){s?n.f^=j:(i&lr)!==0?r.effects.push(n):$t(n)&&((n.f&$e)!==0&&r.block_effects.push(n),zt(n));var o=n.first;if(o!==null){n=o;continue}}var f=n.parent;for(n=n.next;n===null&&f!==null;)f===r.effect&&(this.#l(r.effects),this.#l(r.render_effects),this.#l(r.block_effects),r=r.parent),n=f.next,f=f.parent}}#l(t){for(const r of t)((r.f&V)!==0?this.#i:this.#s).push(r),this.#f(r.deps),F(r,j)}#f(t){if(t!==null)for(const r of t)(r.f&O)===0||(r.f&Ye)===0||(r.f^=Ye,this.#f(r.deps))}capture(t,r){this.previous.has(t)||this.previous.set(t,r),(t.f&De)===0&&(this.current.set(t,t.v),te?.set(t,t.v))}activate(){z=this,this.apply()}deactivate(){z===this&&(z=null,te=null)}flush(){if(this.activate(),re.length>0){if(Gr(),z!==null&&z!==this)return}else this.#r===0&&this.process([]);this.deactivate()}discard(){for(const t of this.#e)t(this);this.#e.clear()}#c(){if(this.#n===0){for(const t of this.#t)t();this.#t.clear()}this.#r===0&&this.#u()}#u(){if(Zt.size>1){this.previous.clear();var t=te,r=!0,n={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const s of Zt){if(s===this){r=!1;continue}const a=[];for(const[o,f]of this.current){if(s.current.has(o))if(r&&f!==s.current.get(o))s.current.set(o,f);else continue;a.push(o)}if(a.length===0)continue;const l=[...s.current.keys()].filter(o=>!this.current.has(o));if(l.length>0){var i=re;re=[];const o=new Set,f=new Map;for(const c of a)Xr(c,l,o,f);if(re.length>0){z=s,s.apply();for(const c of re)s.#a(c,n);s.deactivate()}re=i}}z=null,te=t}this.committed=!0,Zt.delete(this)}increment(t){this.#r+=1,t&&(this.#n+=1)}decrement(t){this.#r-=1,t&&(this.#n-=1),this.revive()}revive(){for(const t of this.#i)F(t,V),We(t);for(const t of this.#s)F(t,ke),We(t);this.#i=[],this.#s=[],this.flush()}oncommit(t){this.#t.add(t)}ondiscard(t){this.#e.add(t)}settled(){return(this.#o??=Ur()).promise}static ensure(){if(z===null){const t=z=new ce;Zt.add(z),bt||ce.enqueue(()=>{z===t&&t.flush()})}return z}static enqueue(t){lt(t)}apply(){}}function D(e){var t=bt;bt=!0;try{for(var r;;){if(Cs(),re.length===0&&(z?.flush(),re.length===0))return Yt=null,r;Gr()}}finally{bt=t}}function Gr(){var e=Xe;pr=!0;var t=null;try{var r=0;for(Jt(!0);re.length>0;){var n=ce.ensure();if(r++>1e3){var i,s;Ms()}n.process(re),Fe.clear()}}finally{pr=!1,Jt(e),Yt=null}}function Ms(){try{ys()}catch(e){ot(e,Yt)}}let Te=null;function Jr(e){var t=e.length;if(t!==0){for(var r=0;r<t;){var n=e[r++];if((n.f&(Ee|X))===0&&$t(n)&&(Te=new Set,zt(n),n.deps===null&&n.first===null&&n.nodes===null&&(n.teardown===null&&n.ac===null?bn(n):n.fn=null),Te?.size>0)){Fe.clear();for(const i of Te){if((i.f&(Ee|X))!==0)continue;const s=[i];let a=i.parent;for(;a!==null;)Te.has(a)&&(Te.delete(a),s.push(a)),a=a.parent;for(let l=s.length-1;l>=0;l--){const o=s[l];(o.f&(Ee|X))===0&&zt(o)}}Te.clear()}}Te=null}}function Xr(e,t,r,n){if(!r.has(e)&&(r.add(e),e.reactions!==null))for(const i of e.reactions){const s=i.f;(s&O)!==0?Xr(i,t,r,n):(s&(cr|$e))!==0&&(s&V)===0&&Qr(i,t,n)&&(F(i,V),We(i))}}function Qr(e,t,r){const n=r.get(e);if(n!==void 0)return n;if(e.deps!==null)for(const i of e.deps){if(t.includes(i))return!0;if((i.f&O)!==0&&Qr(i,t,r))return r.set(i,!0),!0}return r.set(e,!1),!1}function We(e){for(var t=Yt=e;t.parent!==null;){t=t.parent;var r=t.f;if(pr&&t===x&&(r&$e)!==0&&(r&qr)===0)return;if((r&(je|ze))!==0){if((r&j)===0)return;t.f^=j}}re.push(t)}function Is(e){let t=0,r=Ge(0),n;return()=>{yt()&&(d(r),wr(()=>(t===0&&(n=In(()=>e(()=>wt(r)))),t+=1,()=>{lt(()=>{t-=1,t===0&&(n?.(),n=void 0,wt(r))})})))}}var Ns=nt|Ve|Ft;function Rs(e,t,r){new Ls(e,t,r)}class Ls{parent;#t=!1;#e;#r=w?E:null;#n;#o;#i;#s=null;#a=null;#l=null;#f=null;#c=null;#u=0;#d=0;#h=!1;#v=null;#b=Is(()=>(this.#v=Ge(this.#u),()=>{this.#v=null}));constructor(t,r,n){this.#e=t,this.#n=r,this.#o=n,this.parent=x.b,this.#t=!!this.#n.pending,this.#i=yr(()=>{if(x.b=this,w){const s=this.#r;qt(),s.nodeType===it&&s.data===Ot?this.#y():this.#w()}else{var i=this.#_();try{this.#s=se(()=>n(i))}catch(s){this.error(s)}this.#d>0?this.#m():this.#t=!1}return()=>{this.#c?.remove()}},Ns),w&&(this.#e=E)}#w(){try{this.#s=se(()=>this.#o(this.#e))}catch(t){this.error(t)}this.#t=!1}#y(){const t=this.#n.pending;t&&(this.#a=se(()=>t(this.#e)),ce.enqueue(()=>{var r=this.#_();this.#s=this.#p(()=>(ce.ensure(),se(()=>this.#o(r)))),this.#d>0?this.#m():(Je(this.#a,()=>{this.#a=null}),this.#t=!1)}))}#_(){var t=this.#e;return this.#t&&(this.#c=ne(),this.#e.before(this.#c),t=this.#c),t}is_pending(){return this.#t||!!this.parent&&this.parent.is_pending()}has_pending_snippet(){return!!this.#n.pending}#p(t){var r=x,n=y,i=ee;be(this.#i),K(this.#i),at(this.#i.ctx);try{return t()}catch(s){return Wr(s),null}finally{be(r),K(n),at(i)}}#m(){const t=this.#n.pending;this.#s!==null&&(this.#f=document.createDocumentFragment(),this.#f.append(this.#c),xn(this.#s,this.#f)),this.#a===null&&(this.#a=se(()=>t(this.#e)))}#g(t){if(!this.has_pending_snippet()){this.parent&&this.parent.#g(t);return}this.#d+=t,this.#d===0&&(this.#t=!1,this.#a&&Je(this.#a,()=>{this.#a=null}),this.#f&&(this.#e.before(this.#f),this.#f=null))}update_pending_count(t){this.#g(t),this.#u+=t,this.#v&&ct(this.#v,this.#u)}get_effect_pending(){return this.#b(),d(this.#v)}error(t){var r=this.#n.onerror;let n=this.#n.failed;if(this.#h||!r&&!n)throw t;this.#s&&(B(this.#s),this.#s=null),this.#a&&(B(this.#a),this.#a=null),this.#l&&(B(this.#l),this.#l=null),w&&(Y(this.#r),gt(),Y(Ht()));var i=!1,s=!1;const a=()=>{if(i){Ss();return}i=!0,s&&Es(),ce.ensure(),this.#u=0,this.#l!==null&&Je(this.#l,()=>{this.#l=null}),this.#t=this.has_pending_snippet(),this.#s=this.#p(()=>(this.#h=!1,se(()=>this.#o(this.#e)))),this.#d>0?this.#m():this.#t=!1};var l=y;try{K(null),s=!0,r?.(t,a),s=!1}catch(o){ot(o,this.#i&&this.#i.parent)}finally{K(l)}n&<(()=>{this.#l=this.#p(()=>{ce.ensure(),this.#h=!0;try{return se(()=>{n(this.#e,()=>t,()=>a)})}catch(o){return ot(o,this.#i.parent),null}finally{this.#h=!1}})})}}function Os(e,t,r,n){const i=Wt;if(r.length===0&&e.length===0){n(t.map(i));return}var s=z,a=x,l=Ps();function o(){Promise.all(r.map(f=>js(f))).then(f=>{l();try{n([...t.map(i),...f])}catch(c){(a.f&Ee)===0&&ot(c,a)}s?.deactivate(),Kt()}).catch(f=>{ot(f,a)})}e.length>0?Promise.all(e).then(()=>{l();try{return o()}finally{s?.deactivate(),Kt()}}):o()}function Ps(){var e=x,t=y,r=ee,n=z;return function(s=!0){be(e),K(t),at(r),s&&n?.activate()}}function Kt(){be(null),K(null),at(null)}function Wt(e){var t=O|V,r=y!==null&&(y.f&O)!==0?y:null;return x!==null&&(x.f|=Ve),{ctx:ee,deps:null,effects:null,equals:Zr,f:t,fn:e,reactions:null,rv:0,v:P,wv:0,parent:r??x,ac:null}}function js(e,t){let r=x;r===null&&_s();var n=r.b,i=void 0,s=Ge(P),a=!y,l=new Map;return Ks(()=>{var o=Ur();i=o.promise;try{Promise.resolve(e()).then(o.resolve,o.reject).then(()=>{f===z&&f.committed&&f.deactivate(),Kt()})}catch(u){o.reject(u),Kt()}var f=z;if(a){var c=!n.is_pending();n.update_pending_count(1),f.increment(c),l.get(f)?.reject(st),l.delete(f),l.set(f,o)}const p=(u,v=void 0)=>{if(f.activate(),v)v!==st&&(s.f|=De,ct(s,v));else{(s.f&De)!==0&&(s.f^=De),ct(s,u);for(const[g,T]of l){if(l.delete(g),g===f)break;T.reject(st)}}a&&(n.update_pending_count(-1),f.decrement(c))};o.promise.then(p,u=>p(null,u||"unknown"))}),hn(()=>{for(const o of l.values())o.reject(st)}),new Promise(o=>{function f(c){function p(){c===i?o(s):f(i)}c.then(p,p)}f(i)})}function ft(e){const t=Wt(e);return zn(t),t}function Ds(e){const t=Wt(e);return t.equals=Vr,t}function en(e){var t=e.effects;if(t!==null){e.effects=null;for(var r=0;r<t.length;r+=1)B(t[r])}}function Fs(e){for(var t=e.parent;t!==null;){if((t.f&O)===0)return(t.f&Ee)===0?t:null;t=t.parent}return null}function mr(e){var t,r=x;be(Fs(e));try{e.f&=~Ye,en(e),t=Tn(e)}finally{be(r)}return t}function tn(e){var t=mr(e);if(e.equals(t)||(z?.is_fork||(e.v=t),e.wv=Sn()),!Qe)if(te!==null)(yt()||z?.is_fork)&&te.set(e,t);else{var r=(e.f&fe)===0?ke:j;F(e,r)}}let _r=new Set;const Fe=new Map;let rn=!1;function Ge(e,t){var r={f:0,v:e,reactions:null,equals:Zr,rv:0,wv:0};return r}function M(e,t){const r=Ge(e);return zn(r),r}function nn(e,t=!1,r=!0){const n=Ge(e);return t||(n.equals=Vr),n}function m(e,t,r=!1){y!==null&&(!ge||(y.f&Br)!==0)&&Yr()&&(y.f&(O|$e|cr|Br))!==0&&!Ne?.includes(e)&&ks();let n=r?ut(t):t;return ct(e,n)}function ct(e,t){if(!e.equals(t)){var r=e.v;Qe?Fe.set(e,t):Fe.set(e,r),e.v=t;var n=ce.ensure();n.capture(e,r),(e.f&O)!==0&&((e.f&V)!==0&&mr(e),F(e,(e.f&fe)!==0?j:ke)),e.wv=Sn(),sn(e,V),x!==null&&(x.f&j)!==0&&(x.f&(ze|je))===0&&(ie===null?Js([e]):ie.push(e)),!n.is_fork&&_r.size>0&&!rn&&Us()}return t}function Us(){rn=!1;var e=Xe;Jt(!0);const t=Array.from(_r);try{for(const r of t)(r.f&j)!==0&&F(r,ke),$t(r)&&zt(r)}finally{Jt(e)}_r.clear()}function wt(e){m(e,e.v+1)}function sn(e,t){var r=e.reactions;if(r!==null)for(var n=r.length,i=0;i<n;i++){var s=r[i],a=s.f,l=(a&V)===0;if(l&&F(s,t),(a&O)!==0){var o=s;te?.delete(o),(a&Ye)===0&&(a&fe&&(s.f|=Ye),sn(o,ke))}else l&&((a&$e)!==0&&Te!==null&&Te.add(s),We(s))}}function ut(e){if(typeof e!="object"||e===null||ur in e)return e;const t=Dr(e);if(t!==cs&&t!==us)return e;var r=new Map,n=jr(e),i=M(0),s=et,a=l=>{if(et===s)return l();var o=y,f=et;K(null),En(s);var c=l();return K(o),En(f),c};return n&&r.set("length",M(e.length)),new Proxy(e,{defineProperty(l,o,f){(!("value"in f)||f.configurable===!1||f.enumerable===!1||f.writable===!1)&&$s();var c=r.get(o);return c===void 0?c=a(()=>{var p=M(f.value);return r.set(o,p),p}):m(c,f.value,!0),!0},deleteProperty(l,o){var f=r.get(o);if(f===void 0){if(o in l){const c=a(()=>M(P));r.set(o,c),wt(i)}}else m(f,P),wt(i);return!0},get(l,o,f){if(o===ur)return e;var c=r.get(o),p=o in l;if(c===void 0&&(!p||rt(l,o)?.writable)&&(c=a(()=>{var v=ut(p?l[o]:P),g=M(v);return g}),r.set(o,c)),c!==void 0){var u=d(c);return u===P?void 0:u}return Reflect.get(l,o,f)},getOwnPropertyDescriptor(l,o){var f=Reflect.getOwnPropertyDescriptor(l,o);if(f&&"value"in f){var c=r.get(o);c&&(f.value=d(c))}else if(f===void 0){var p=r.get(o),u=p?.v;if(p!==void 0&&u!==P)return{enumerable:!0,configurable:!0,value:u,writable:!0}}return f},has(l,o){if(o===ur)return!0;var f=r.get(o),c=f!==void 0&&f.v!==P||Reflect.has(l,o);if(f!==void 0||x!==null&&(!c||rt(l,o)?.writable)){f===void 0&&(f=a(()=>{var u=c?ut(l[o]):P,v=M(u);return v}),r.set(o,f));var p=d(f);if(p===P)return!1}return c},set(l,o,f,c){var p=r.get(o),u=o in l;if(n&&o==="length")for(var v=f;v<p.v;v+=1){var g=r.get(v+"");g!==void 0?m(g,P):v in l&&(g=a(()=>M(P)),r.set(v+"",g))}if(p===void 0)(!u||rt(l,o)?.writable)&&(p=a(()=>M(void 0)),m(p,ut(f)),r.set(o,p));else{u=p.v!==P;var T=a(()=>ut(f));m(p,T)}var h=Reflect.getOwnPropertyDescriptor(l,o);if(h?.set&&h.set.call(c,f),!u){if(n&&typeof o=="string"){var _=r.get("length"),H=Number(o);Number.isInteger(H)&&H>=_.v&&m(_,H+1)}wt(i)}return!0},ownKeys(l){d(i);var o=Reflect.ownKeys(l).filter(p=>{var u=r.get(p);return u===void 0||u.v!==P});for(var[f,c]of r)c.v!==P&&!(f in l)&&o.push(f);return o},setPrototypeOf(){zs()}})}var an,ln,on,fn;function gr(){if(an===void 0){an=window,ln=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,r=Text.prototype;on=rt(t,"firstChild").get,fn=rt(t,"nextSibling").get,Fr(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),Fr(r)&&(r.__t=void 0)}}function ne(e=""){return document.createTextNode(e)}function Ce(e){return on.call(e)}function Me(e){return fn.call(e)}function S(e,t){if(!w)return Ce(e);var r=Ce(E);if(r===null)r=E.appendChild(ne());else if(t&&r.nodeType!==dr){var n=ne();return r?.before(n),Y(n),n}return Y(r),r}function A(e,t=1,r=!1){let n=w?E:e;for(var i;t--;)i=n,n=Me(n);if(!w)return n;if(r&&n?.nodeType!==dr){var s=ne();return n===null?i?.after(s):n.before(s),Y(s),s}return Y(n),n}function br(e){e.textContent=""}function cn(){return!1}function un(e){w&&Ce(e)!==null&&br(e)}let dn=!1;function vn(){dn||(dn=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(const t of e.target.elements)t.__on_r?.()})},{capture:!0}))}function Gt(e){var t=y,r=x;K(null),be(null);try{return e()}finally{K(t),be(r)}}function Bs(e,t,r,n=r){e.addEventListener(t,()=>Gt(r));const i=e.__on_r;i?e.__on_r=()=>{i(),n(!0)}:e.__on_r=()=>n(!0),vn()}function qs(e){x===null&&(y===null&&ws(),bs()),Qe&&gs()}function Hs(e,t){var r=t.last;r===null?t.last=t.first=e:(r.next=e,e.prev=r,t.last=e)}function _e(e,t,r){var n=x;n!==null&&(n.f&X)!==0&&(e|=X);var i={ctx:ee,deps:null,nodes:null,f:e|V|fe,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};if(r)try{zt(i),i.f|=Ut}catch(l){throw B(i),l}else t!==null&&We(i);var s=i;if(r&&s.deps===null&&s.teardown===null&&s.nodes===null&&s.first===s.last&&(s.f&Ve)===0&&(s=s.first,(e&$e)!==0&&(e&nt)!==0&&s!==null&&(s.f|=nt)),s!==null&&(s.parent=n,n!==null&&Hs(s,n),y!==null&&(y.f&O)!==0&&(e&je)===0)){var a=y;(a.effects??=[]).push(s)}return i}function yt(){return y!==null&&!ge}function hn(e){const t=_e(or,null,!1);return F(t,j),t.teardown=e,t}function pn(e){qs();var t=x.f,r=!y&&(t&ze)!==0&&(t&Ut)===0;if(r){var n=ee;(n.e??=[]).push(e)}else return mn(e)}function mn(e){return _e(lr|hs,e,!1)}function Zs(e){ce.ensure();const t=_e(je|Ve,e,!0);return()=>{B(t)}}function Vs(e){ce.ensure();const t=_e(je|Ve,e,!0);return(r={})=>new Promise(n=>{r.outro?Je(t,()=>{B(t),n(void 0)}):(B(t),n(void 0))})}function Ys(e){return _e(lr,e,!1)}function Ks(e){return _e(cr|Ve,e,!0)}function wr(e,t=0){return _e(or|t,e,!0)}function Ie(e,t=[],r=[],n=[]){Os(n,t,r,i=>{_e(or,()=>e(...i.map(d)),!0)})}function yr(e,t=0){var r=_e($e|t,e,!0);return r}function se(e){return _e(ze|Ve,e,!0)}function _n(e){var t=e.teardown;if(t!==null){const r=Qe,n=y;$n(!0),K(null);try{t.call(null)}finally{$n(r),K(n)}}}function gn(e,t=!1){var r=e.first;for(e.first=e.last=null;r!==null;){const i=r.ac;i!==null&&Gt(()=>{i.abort(st)});var n=r.next;(r.f&je)!==0?r.parent=null:B(r,t),r=n}}function Ws(e){for(var t=e.first;t!==null;){var r=t.next;(t.f&ze)===0&&B(t),t=r}}function B(e,t=!0){var r=!1;(t||(e.f&qr)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(Gs(e.nodes.start,e.nodes.end),r=!0),gn(e,t&&!r),Xt(e,0),F(e,Ee);var n=e.nodes&&e.nodes.t;if(n!==null)for(const s of n)s.stop();_n(e);var i=e.parent;i!==null&&i.first!==null&&bn(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=null}function Gs(e,t){for(;e!==null;){var r=e===t?null:Me(e);e.remove(),e=r}}function bn(e){var t=e.parent,r=e.prev,n=e.next;r!==null&&(r.next=n),n!==null&&(n.prev=r),t!==null&&(t.first===e&&(t.first=n),t.last===e&&(t.last=r))}function Je(e,t,r=!0){var n=[];wn(e,n,!0);var i=()=>{r&&B(e),t&&t()},s=n.length;if(s>0){var a=()=>--s||i();for(var l of n)l.out(a)}else i()}function wn(e,t,r){if((e.f&X)===0){e.f^=X;var n=e.nodes&&e.nodes.t;if(n!==null)for(const l of n)(l.is_global||r)&&t.push(l);for(var i=e.first;i!==null;){var s=i.next,a=(i.f&nt)!==0||(i.f&ze)!==0&&(e.f&$e)!==0;wn(i,t,a?r:!1),i=s}}}function xr(e){yn(e,!0)}function yn(e,t){if((e.f&X)!==0){e.f^=X,(e.f&j)===0&&(F(e,V),We(e));for(var r=e.first;r!==null;){var n=r.next,i=(r.f&nt)!==0||(r.f&ze)!==0;yn(r,i?t:!1),r=n}var s=e.nodes&&e.nodes.t;if(s!==null)for(const a of s)(a.is_global||t)&&a.in()}}function xn(e,t){if(e.nodes)for(var r=e.nodes.start,n=e.nodes.end;r!==null;){var i=r===n?null:Me(r);t.append(r),r=i}}let Xe=!1;function Jt(e){Xe=e}let Qe=!1;function $n(e){Qe=e}let y=null,ge=!1;function K(e){y=e}let x=null;function be(e){x=e}let Ne=null;function zn(e){y!==null&&(Ne===null?Ne=[e]:Ne.push(e))}let q=null,Q=0,ie=null;function Js(e){ie=e}let kn=1,xt=0,et=xt;function En(e){et=e}function Sn(){return++kn}function $t(e){var t=e.f;if((t&V)!==0)return!0;if(t&O&&(e.f&=~Ye),(t&ke)!==0){var r=e.deps;if(r!==null)for(var n=r.length,i=0;i<n;i++){var s=r[i];if($t(s)&&tn(s),s.wv>e.wv)return!0}(t&fe)!==0&&te===null&&F(e,j)}return!1}function An(e,t,r=!0){var n=e.reactions;if(n!==null&&!Ne?.includes(e))for(var i=0;i<n.length;i++){var s=n[i];(s.f&O)!==0?An(s,t,!1):t===s&&(r?F(s,V):(s.f&j)!==0&&F(s,ke),We(s))}}function Tn(e){var t=q,r=Q,n=ie,i=y,s=Ne,a=ee,l=ge,o=et,f=e.f;q=null,Q=0,ie=null,y=(f&(ze|je))===0?e:null,Ne=null,at(e.ctx),ge=!1,et=++xt,e.ac!==null&&(Gt(()=>{e.ac.abort(st)}),e.ac=null);try{e.f|=fr;var c=e.fn,p=c(),u=e.deps;if(q!==null){var v;if(Xt(e,Q),u!==null&&Q>0)for(u.length=Q+q.length,v=0;v<q.length;v++)u[Q+v]=q[v];else e.deps=u=q;if(yt()&&(e.f&fe)!==0)for(v=Q;v<u.length;v++)(u[v].reactions??=[]).push(e)}else u!==null&&Q<u.length&&(Xt(e,Q),u.length=Q);if(Yr()&&ie!==null&&!ge&&u!==null&&(e.f&(O|ke|V))===0)for(v=0;v<ie.length;v++)An(ie[v],e);return i!==null&&i!==e&&(xt++,ie!==null&&(n===null?n=ie:n.push(...ie))),(e.f&De)!==0&&(e.f^=De),p}catch(g){return Wr(g)}finally{e.f^=fr,q=t,Q=r,ie=n,y=i,Ne=s,at(a),ge=l,et=o}}function Xs(e,t){let r=t.reactions;if(r!==null){var n=os.call(r,e);if(n!==-1){var i=r.length-1;i===0?r=t.reactions=null:(r[n]=r[i],r.pop())}}r===null&&(t.f&O)!==0&&(q===null||!q.includes(t))&&(F(t,ke),(t.f&fe)!==0&&(t.f^=fe,t.f&=~Ye),en(t),Xt(t,0))}function Xt(e,t){var r=e.deps;if(r!==null)for(var n=t;n<r.length;n++)Xs(e,r[n])}function zt(e){var t=e.f;if((t&Ee)===0){F(e,j);var r=x,n=Xe;x=e,Xe=!0;try{(t&($e|vs))!==0?Ws(e):gn(e),_n(e);var i=Tn(e);e.teardown=typeof i=="function"?i:null,e.wv=kn;var s;ar&&Ts&&(e.f&V)!==0&&e.deps}finally{Xe=n,x=r}}}async function Qs(){await Promise.resolve(),D()}function d(e){var t=e.f,r=(t&O)!==0;if(y!==null&&!ge){var n=x!==null&&(x.f&Ee)!==0;if(!n&&!Ne?.includes(e)){var i=y.deps;if((y.f&fr)!==0)e.rv<xt&&(e.rv=xt,q===null&&i!==null&&i[Q]===e?Q++:q===null?q=[e]:q.includes(e)||q.push(e));else{(y.deps??=[]).push(e);var s=e.reactions;s===null?e.reactions=[y]:s.includes(y)||s.push(y)}}}if(Qe){if(Fe.has(e))return Fe.get(e);if(r){var a=e,l=a.v;return((a.f&j)===0&&a.reactions!==null||Mn(a))&&(l=mr(a)),Fe.set(a,l),l}}else r&&(!te?.has(e)||z?.is_fork&&!yt())&&(a=e,$t(a)&&tn(a),Xe&&yt()&&(a.f&fe)===0&&Cn(a));if(te?.has(e))return te.get(e);if((e.f&De)!==0)throw e.v;return e.v}function Cn(e){if(e.deps!==null){e.f^=fe;for(const t of e.deps)(t.reactions??=[]).push(e),(t.f&O)!==0&&(t.f&fe)===0&&Cn(t)}}function Mn(e){if(e.v===P)return!0;if(e.deps===null)return!1;for(const t of e.deps)if(Fe.has(t)||(t.f&O)!==0&&Mn(t))return!0;return!1}function In(e){var t=ge;try{return ge=!0,e()}finally{ge=t}}const ei=-7169;function F(e,t){e.f=e.f&ei|t}const Nn=new Set,$r=new Set;function ti(e,t,r,n={}){function i(s){if(n.capture||kt.call(t,s),!s.cancelBubble)return Gt(()=>r?.call(this,s))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?lt(()=>{t.addEventListener(e,i,n)}):t.addEventListener(e,i,n),i}function Rn(e,t,r,n,i){var s={capture:n,passive:i},a=ti(e,t,r,s);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&hn(()=>{t.removeEventListener(e,a,s)})}function Ln(e){for(var t=0;t<e.length;t++)Nn.add(e[t]);for(var r of $r)r(e)}let On=null;function kt(e){var t=this,r=t.ownerDocument,n=e.type,i=e.composedPath?.()||[],s=i[0]||e.target;On=e;var a=0,l=On===e&&e.__root;if(l){var o=i.indexOf(l);if(o!==-1&&(t===document||t===window)){e.__root=t;return}var f=i.indexOf(t);if(f===-1)return;o<=f&&(a=o)}if(s=i[a]||e.target,s!==t){Dt(e,"currentTarget",{configurable:!0,get(){return s||r}});var c=y,p=x;K(null),be(null);try{for(var u,v=[];s!==null;){var g=s.assignedSlot||s.parentNode||s.host||null;try{var T=s["__"+n];T!=null&&(!s.disabled||e.target===s)&&T.call(s,e)}catch(h){u?v.push(h):u=h}if(e.cancelBubble||g===t||g===null)break;s=g}if(u){for(let h of v)queueMicrotask(()=>{throw h});throw u}}finally{e.__root=t,delete e.currentTarget,K(c),be(p)}}}function Pn(e){var t=document.createElement("template");return t.innerHTML=e.replaceAll("<!>","<!---->"),t.content}function Ue(e,t){var r=x;r.nodes===null&&(r.nodes={start:e,end:t,a:null,t:null})}function W(e,t){var r=(t&is)!==0,n=(t&as)!==0,i,s=!e.startsWith("<!>");return()=>{if(w)return Ue(E,null),E;i===void 0&&(i=Pn(s?e:"<!>"+e),r||(i=Ce(i)));var a=n||ln?document.importNode(i,!0):i.cloneNode(!0);if(r){var l=Ce(a),o=a.lastChild;Ue(l,o)}else Ue(a,a);return a}}function ri(e,t,r="svg"){var n=!e.startsWith("<!>"),i=`<${r}>${n?e:"<!>"+e}</${r}>`,s;return()=>{if(w)return Ue(E,null),E;if(!s){var a=Pn(i),l=Ce(a);s=Ce(l)}var o=s.cloneNode(!0);return Ue(o,o),o}}function Qt(e,t){return ri(e,t,"svg")}function ni(e=""){if(!w){var t=ne(e+"");return Ue(t,t),t}var r=E;return r.nodeType!==dr&&(r.before(r=ne()),Y(r)),Ue(r,r),r}function N(e,t){if(w){var r=x;((r.f&Ut)===0||r.nodes.end===null)&&(r.nodes.end=E),qt();return}e!==null&&e.before(t)}const si=["touchstart","touchmove"];function ii(e){return si.includes(e)}function dt(e,t){var r=t==null?"":typeof t=="object"?t+"":t;r!==(e.__t??=e.nodeValue)&&(e.__t=r,e.nodeValue=r+"")}function jn(e,t){return Dn(e,t)}function ai(e,t){gr(),t.intro=t.intro??!1;const r=t.target,n=w,i=E;try{for(var s=Ce(r);s&&(s.nodeType!==it||s.data!==Pr);)s=Me(s);if(!s)throw tt;Ae(!0),Y(s);const a=Dn(e,{...t,anchor:s});return Ae(!1),a}catch(a){if(a instanceof Error&&a.message.split(`
|
|
2
|
+
`).some(l=>l.startsWith("https://svelte.dev/e/")))throw a;return a!==tt&&console.warn("Failed to hydrate: ",a),t.recover===!1&&xs(),gr(),br(r),Ae(!1),jn(e,t)}finally{Ae(n),Y(i)}}const vt=new Map;function Dn(e,{target:t,anchor:r,props:n={},events:i,context:s,intro:a=!0}){gr();var l=new Set,o=p=>{for(var u=0;u<p.length;u++){var v=p[u];if(!l.has(v)){l.add(v);var g=ii(v);t.addEventListener(v,kt,{passive:g});var T=vt.get(v);T===void 0?(document.addEventListener(v,kt,{passive:g}),vt.set(v,1)):vt.set(v,T+1)}}};o(Pt(Nn)),$r.add(o);var f=void 0,c=Vs(()=>{var p=r??t.appendChild(ne());return Rs(p,{pending:()=>{}},u=>{if(s){vr({});var v=ee;v.c=s}if(i&&(n.$$events=i),w&&Ue(u,null),f=e(u,n)||{},w&&(x.nodes.end=E,E===null||E.nodeType!==it||E.data!==ir))throw Bt(),tt;s&&hr()}),()=>{for(var u of l){t.removeEventListener(u,kt);var v=vt.get(u);--v===0?(document.removeEventListener(u,kt),vt.delete(u)):vt.set(u,v)}$r.delete(o),p!==r&&p.parentNode?.removeChild(p)}});return zr.set(f,c),f}let zr=new WeakMap;function li(e,t){const r=zr.get(e);return r?(zr.delete(e),r(t)):Promise.resolve()}class oi{anchor;#t=new Map;#e=new Map;#r=new Map;#n=new Set;#o=!0;constructor(t,r=!0){this.anchor=t,this.#o=r}#i=()=>{var t=z;if(this.#t.has(t)){var r=this.#t.get(t),n=this.#e.get(r);if(n)xr(n),this.#n.delete(r);else{var i=this.#r.get(r);i&&(this.#e.set(r,i.effect),this.#r.delete(r),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),n=i.effect)}for(const[s,a]of this.#t){if(this.#t.delete(s),s===t)break;const l=this.#r.get(a);l&&(B(l.effect),this.#r.delete(a))}for(const[s,a]of this.#e){if(s===r||this.#n.has(s))continue;const l=()=>{if(Array.from(this.#t.values()).includes(s)){var f=document.createDocumentFragment();xn(a,f),f.append(ne()),this.#r.set(s,{effect:a,fragment:f})}else B(a);this.#n.delete(s),this.#e.delete(s)};this.#o||!n?(this.#n.add(s),Je(a,l,!1)):l()}}};#s=t=>{this.#t.delete(t);const r=Array.from(this.#t.values());for(const[n,i]of this.#r)r.includes(n)||(B(i.effect),this.#r.delete(n))};ensure(t,r){var n=z,i=cn();if(r&&!this.#e.has(t)&&!this.#r.has(t))if(i){var s=document.createDocumentFragment(),a=ne();s.append(a),this.#r.set(t,{effect:se(()=>r(a)),fragment:s})}else this.#e.set(t,se(()=>r(this.anchor)));if(this.#t.set(n,t),i){for(const[l,o]of this.#e)l===t?n.skipped_effects.delete(o):n.skipped_effects.add(o);for(const[l,o]of this.#r)l===t?n.skipped_effects.delete(o.effect):n.skipped_effects.add(o.effect);n.oncommit(this.#i),n.ondiscard(this.#s)}else w&&(this.anchor=E),this.#i()}}function we(e,t,r=!1){w&&qt();var n=new oi(e),i=r?nt:0;function s(a,l){if(w){const f=Hr(e)===Ot;if(a===f){var o=Ht();Y(o),n.anchor=o,Ae(!1),n.ensure(a,l),Ae(!0);return}}n.ensure(a,l)}yr(()=>{var a=!1;t((l,o=!0)=>{a=!0,s(o,l)}),a||s(!1,null)},i)}function fi(e,t,r){for(var n=[],i=t.length,s,a=t.length,l=0;l<i;l++){let p=t[l];Je(p,()=>{if(s){if(s.pending.delete(p),s.done.add(p),s.pending.size===0){var u=e.outrogroups;kr(Pt(s.done)),u.delete(s),u.size===0&&(e.outrogroups=null)}}else a-=1},!1)}if(a===0){var o=n.length===0&&r!==null;if(o){var f=r,c=f.parentNode;br(c),c.append(f),e.items.clear()}kr(t,!o)}else s={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(s)}function kr(e,t=!0){for(var r=0;r<e.length;r++)B(e[r],t)}var Fn;function Er(e,t,r,n,i,s=null){var a=e,l=new Map,o=(t&Or)!==0;if(o){var f=e;a=w?Y(Ce(f)):f.appendChild(ne())}w&&qt();var c=null,p=Ds(()=>{var _=r();return jr(_)?_:_==null?[]:Pt(_)}),u,v=!0;function g(){h.fallback=c,ci(h,u,a,t,n),c!==null&&(u.length===0?(c.f&Se)===0?xr(c):(c.f^=Se,Et(c,null,a)):Je(c,()=>{c=null}))}var T=yr(()=>{u=d(p);var _=u.length;let H=!1;if(w){var ue=Hr(a)===Ot;ue!==(_===0)&&(a=Ht(),Y(a),Ae(!1),H=!0)}for(var Z=new Set,de=z,J=cn(),I=0;I<_;I+=1){w&&E.nodeType===it&&E.data===ir&&(a=E,H=!0,Ae(!1));var ae=u[I],ye=n(ae,I),R=v?null:l.get(ye);R?(R.v&&ct(R.v,ae),R.i&&ct(R.i,I),J&&de.skipped_effects.delete(R.e)):(R=ui(l,v?a:Fn??=ne(),ae,ye,I,i,t,r),v||(R.e.f|=Se),l.set(ye,R)),Z.add(ye)}if(_===0&&s&&!c&&(v?c=se(()=>s(a)):(c=se(()=>s(Fn??=ne())),c.f|=Se)),w&&_>0&&Y(Ht()),!v)if(J){for(const[Re,Le]of l)Z.has(Re)||de.skipped_effects.add(Le.e);de.oncommit(g),de.ondiscard(()=>{})}else g();H&&Ae(!0),d(p)}),h={effect:T,items:l,outrogroups:null,fallback:c};v=!1,w&&(a=E)}function ci(e,t,r,n,i){var s=(n&ns)!==0,a=t.length,l=e.items,o=e.effect.first,f,c=null,p,u=[],v=[],g,T,h,_;if(s)for(_=0;_<a;_+=1)g=t[_],T=i(g,_),h=l.get(T).e,(h.f&Se)===0&&(h.nodes?.a?.measure(),(p??=new Set).add(h));for(_=0;_<a;_+=1){if(g=t[_],T=i(g,_),h=l.get(T).e,e.outrogroups!==null)for(const R of e.outrogroups)R.pending.delete(h),R.done.delete(h);if((h.f&Se)!==0)if(h.f^=Se,h===o)Et(h,null,r);else{var H=c?c.next:o;h===e.effect.last&&(e.effect.last=h.prev),h.prev&&(h.prev.next=h.next),h.next&&(h.next.prev=h.prev),Be(e,c,h),Be(e,h,H),Et(h,H,r),c=h,u=[],v=[],o=c.next;continue}if((h.f&X)!==0&&(xr(h),s&&(h.nodes?.a?.unfix(),(p??=new Set).delete(h))),h!==o){if(f!==void 0&&f.has(h)){if(u.length<v.length){var ue=v[0],Z;c=ue.prev;var de=u[0],J=u[u.length-1];for(Z=0;Z<u.length;Z+=1)Et(u[Z],ue,r);for(Z=0;Z<v.length;Z+=1)f.delete(v[Z]);Be(e,de.prev,J.next),Be(e,c,de),Be(e,J,ue),o=ue,c=J,_-=1,u=[],v=[]}else f.delete(h),Et(h,o,r),Be(e,h.prev,h.next),Be(e,h,c===null?e.effect.first:c.next),Be(e,c,h),c=h;continue}for(u=[],v=[];o!==null&&o!==h;)(f??=new Set).add(o),v.push(o),o=o.next;if(o===null)continue}(h.f&Se)===0&&u.push(h),c=h,o=h.next}if(e.outrogroups!==null){for(const R of e.outrogroups)R.pending.size===0&&(kr(Pt(R.done)),e.outrogroups?.delete(R));e.outrogroups.size===0&&(e.outrogroups=null)}if(o!==null||f!==void 0){var I=[];if(f!==void 0)for(h of f)(h.f&X)===0&&I.push(h);for(;o!==null;)(o.f&X)===0&&o!==e.fallback&&I.push(o),o=o.next;var ae=I.length;if(ae>0){var ye=(n&Or)!==0&&a===0?r:null;if(s){for(_=0;_<ae;_+=1)I[_].nodes?.a?.measure();for(_=0;_<ae;_+=1)I[_].nodes?.a?.fix()}fi(e,I,ye)}}s&<(()=>{if(p!==void 0)for(h of p)h.nodes?.a?.apply()})}function ui(e,t,r,n,i,s,a,l){var o=(a&ts)!==0?(a&ss)===0?nn(r,!1,!1):Ge(r):null,f=(a&rs)!==0?Ge(i):null;return{v:o,i:f,e:se(()=>(s(t,o??r,f??i,l),()=>{e.delete(n)}))}}function Et(e,t,r){if(e.nodes)for(var n=e.nodes.start,i=e.nodes.end,s=t&&(t.f&Se)===0?t.nodes.start:r;n!==null;){var a=Me(n);if(s.before(n),n===i)return;n=a}}function Be(e,t,r){t===null?e.effect.first=r:t.next=r,r===null?e.effect.last=t:r.prev=t}function Un(e,t){Ys(()=>{var r=e.getRootNode(),n=r.host?r:r.head??r.ownerDocument.head;if(!n.querySelector("#"+t.hash)){const i=document.createElement("style");i.id=t.hash,i.textContent=t.code,n.appendChild(i)}})}const Bn=[...`
|
|
3
|
+
\r\f \v\uFEFF`];function di(e,t,r){var n=e==null?"":""+e;if(t&&(n=n?n+" "+t:t),r){for(var i in r)if(r[i])n=n?n+" "+i:i;else if(n.length)for(var s=i.length,a=0;(a=n.indexOf(i,a))>=0;){var l=a+s;(a===0||Bn.includes(n[a-1]))&&(l===n.length||Bn.includes(n[l]))?n=(a===0?"":n.substring(0,a))+n.substring(l+1):a=l}}return n===""?null:n}function vi(e,t){return e==null?null:String(e)}function St(e,t,r,n,i,s){var a=e.__className;if(w||a!==r||a===void 0){var l=di(r,n,s);(!w||l!==e.getAttribute("class"))&&(l==null?e.removeAttribute("class"):e.className=l),e.__className=r}else if(s&&i!==s)for(var o in s){var f=!!s[o];(i==null||f!==!!i[o])&&e.classList.toggle(o,f)}return s}function Sr(e,t,r,n){var i=e.__style;if(w||i!==t){var s=vi(t);(!w||s!==e.getAttribute("style"))&&(s==null?e.removeAttribute("style"):e.style.cssText=s),e.__style=t}return n}const hi=Symbol("is custom element"),pi=Symbol("is html");function qn(e){if(w){var t=!1,r=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var n=e.value;At(e,"value",null),e.value=n}if(e.hasAttribute("checked")){var i=e.checked;At(e,"checked",null),e.checked=i}}};e.__on_r=r,lt(r),vn()}}function At(e,t,r,n){var i=mi(e);w&&(i[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||i[t]!==(i[t]=r)&&(t==="loading"&&(e[ms]=r),r==null?e.removeAttribute(t):typeof r!="string"&&_i(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function mi(e){return e.__attributes??={[hi]:e.nodeName.includes("-"),[pi]:e.namespaceURI===ls}}var Hn=new Map;function _i(e){var t=e.getAttribute("is")||e.nodeName,r=Hn.get(t);if(r)return r;Hn.set(t,r=[]);for(var n,i=e,s=Element.prototype;s!==i;){n=fs(i);for(var a in n)n[a].set&&r.push(a);i=Dr(i)}return r}function er(e,t,r=t){var n=new WeakSet;Bs(e,"input",async i=>{var s=i?e.defaultValue:e.value;if(s=Ar(e)?Tr(s):s,r(s),z!==null&&n.add(z),await Qs(),s!==(s=t())){var a=e.selectionStart,l=e.selectionEnd,o=e.value.length;if(e.value=s??"",l!==null){var f=e.value.length;a===l&&l===o&&f>o?(e.selectionStart=f,e.selectionEnd=f):(e.selectionStart=a,e.selectionEnd=Math.min(l,f))}}}),(w&&e.defaultValue!==e.value||In(t)==null&&e.value)&&(r(Ar(e)?Tr(e.value):e.value),z!==null&&n.add(z)),wr(()=>{var i=t();if(e===document.activeElement){var s=Vt??z;if(n.has(s))return}Ar(e)&&i===Tr(e.value)||e.type==="date"&&!i&&!e.value||i!==e.value&&(e.value=i??"")})}function Ar(e){var t=e.type;return t==="number"||t==="range"}function Tr(e){return e===""?null:+e}function G(e,t,r,n){var i=n,s=!0,a=()=>(s&&(s=!1,i=n),i),l;l=e[t],l===void 0&&n!==void 0&&(l=a());var o;o=()=>{var u=e[t];return u===void 0?a():(s=!0,u)};var f=!1,c=Wt(()=>(f=!1,o())),p=x;return(function(u,v){if(arguments.length>0){const g=v?d(c):u;return m(c,g),f=!0,i!==void 0&&(i=g),u}return Qe&&f||(p.f&Ee)!==0?c.v:d(c)})}function gi(e){return new bi(e)}class bi{#t;#e;constructor(t){var r=new Map,n=(s,a)=>{var l=nn(a,!1,!1);return r.set(s,l),l};const i=new Proxy({...t.props||{},$$events:{}},{get(s,a){return d(r.get(a)??n(a,Reflect.get(s,a)))},has(s,a){return a===ps?!0:(d(r.get(a)??n(a,Reflect.get(s,a))),Reflect.has(s,a))},set(s,a,l){return m(r.get(a)??n(a,l),l),Reflect.set(s,a,l)}});this.#e=(t.hydrate?ai:jn)(t.component,{target:t.target,anchor:t.anchor,props:i,context:t.context,intro:t.intro??!1,recover:t.recover}),(!t?.props?.$$host||t.sync===!1)&&D(),this.#t=i.$$events;for(const s of Object.keys(this.#e))s==="$set"||s==="$destroy"||s==="$on"||Dt(this,s,{get(){return this.#e[s]},set(a){this.#e[s]=a},enumerable:!0});this.#e.$set=s=>{Object.assign(i,s)},this.#e.$destroy=()=>{li(this.#e)}}$set(t){this.#e.$set(t)}$on(t,r){this.#t[t]=this.#t[t]||[];const n=(...i)=>r.call(this,...i);return this.#t[t].push(n),()=>{this.#t[t]=this.#t[t].filter(i=>i!==n)}}$destroy(){this.#e.$destroy()}}let Zn;typeof HTMLElement=="function"&&(Zn=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;constructor(e,t,r){super(),this.$$ctor=e,this.$$s=t,r&&this.attachShadow({mode:"open"})}addEventListener(e,t,r){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){const n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}super.addEventListener(e,t,r)}removeEventListener(e,t,r){if(super.removeEventListener(e,t,r),this.$$c){const n=this.$$l_u.get(t);n&&(n(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(n){return i=>{const s=document.createElement("slot");n!=="default"&&(s.name=n),N(i,s)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const t={},r=wi(this);for(const n of this.$$s)n in r&&(n==="default"&&!this.$$d.children?(this.$$d.children=e(n),t.default=!0):t[n]=e(n));for(const n of this.attributes){const i=this.$$g_p(n.name);i in this.$$d||(this.$$d[i]=tr(i,n.value,this.$$p_d,"toProp"))}for(const n in this.$$p_d)!(n in this.$$d)&&this[n]!==void 0&&(this.$$d[n]=this[n],delete this[n]);this.$$c=gi({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=Zs(()=>{wr(()=>{this.$$r=!0;for(const n of jt(this.$$c)){if(!this.$$p_d[n]?.reflect)continue;this.$$d[n]=this.$$c[n];const i=tr(n,this.$$d[n],this.$$p_d,"toAttribute");i==null?this.removeAttribute(this.$$p_d[n].attribute||n):this.setAttribute(this.$$p_d[n].attribute||n,i)}this.$$r=!1})});for(const n in this.$$l)for(const i of this.$$l[n]){const s=this.$$c.$on(n,i);this.$$l_u.set(i,s)}this.$$l={}}}attributeChangedCallback(e,t,r){this.$$r||(e=this.$$g_p(e),this.$$d[e]=tr(e,r,this.$$p_d,"toProp"),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return jt(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function tr(e,t,r,n){const i=r[e]?.type;if(t=i==="Boolean"&&typeof t!="boolean"?t!=null:t,!n||!r[e])return t;if(n==="toAttribute")switch(i){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(i){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function wi(e){const t={};return e.childNodes.forEach(r=>{t[r.slot||"default"]=!0}),t}function Vn(e,t,r,n,i,s){let a=class extends Zn{constructor(){super(e,r,i),this.$$p_d=t}static get observedAttributes(){return jt(t).map(l=>(t[l].attribute||l).toLowerCase())}};return jt(t).forEach(l=>{Dt(a.prototype,l,{get(){return this.$$c&&l in this.$$c?this.$$c[l]:this.$$d[l]},set(o){o=tr(l,o,t),this.$$d[l]=o;var f=this.$$c;if(f){var c=rt(f,l)?.get;c?f[l]=o:f.$set({[l]:o})}}})}),n.forEach(l=>{Dt(a.prototype,l,{get(){return this.$$c?.[l]}})}),e.element=a,a}const rr="https://api.fortalece.ai";function Cr(){return`msg_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}function Yn(e){const t={"Content-Type":"application/json"};return e.apiKey&&(t.Authorization=`Bearer ${e.apiKey}`),e.projectId&&(t["X-Project-ID"]=e.projectId),t}async function Kn(e,t,r){const n=e.apiUrl||rr,i={projectId:e.projectId,message:t,conversationId:r};try{const s=await fetch(`${n}/api/chat/message`,{method:"POST",headers:Yn(e),body:JSON.stringify(i)});if(!s.ok)return{success:!1,error:(await s.json().catch(()=>({}))).error||`Request failed with status ${s.status}`};const a=await s.json();return{success:!0,message:{id:a.id||Cr(),role:"assistant",content:a.message||a.content||"",timestamp:new Date(a.timestamp||Date.now()),metadata:a.metadata},conversationId:a.conversationId}}catch(s){return{success:!1,error:s instanceof Error?s.message:"Unknown error occurred"}}}function Wn(e){return{id:Cr(),role:"user",content:e,timestamp:new Date}}function nr(e){return{id:Cr(),role:"system",content:e,timestamp:new Date}}async function Gn(e,t){const r=e.apiUrl||rr,n={...t,projectId:e.projectId};try{const i=await fetch(`${r}/api/feedback`,{method:"POST",headers:Yn(e),body:JSON.stringify(n)});if(!i.ok)return{success:!1,error:(await i.json().catch(()=>({}))).error||`Request failed with status ${i.status}`};const s=await i.json();return{success:!0,feedbackId:s.feedbackId||s.id}}catch(i){return{success:!1,error:i instanceof Error?i.message:"Unknown error occurred"}}}function yi(e,t){return{projectId:e,apiUrl:t?.apiUrl||rr,apiKey:t?.apiKey}}var xi=Qt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-1105cax"><path fill-rule="evenodd" d="M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" class="svelte-1105cax"></path></svg>'),$i=Qt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-1105cax"><path fill-rule="evenodd" d="M4.804 21.644A6.707 6.707 0 0 0 6 21.75a6.721 6.721 0 0 0 3.583-1.029c.774.182 1.584.279 2.417.279 5.322 0 9.75-3.97 9.75-9 0-5.03-4.428-9-9.75-9s-9.75 3.97-9.75 9c0 2.409 1.025 4.587 2.674 6.192.232.226.277.428.254.543a3.73 3.73 0 0 1-.814 1.686.75.75 0 0 0 .44 1.223ZM8.25 10.875a1.125 1.125 0 1 0 0 2.25 1.125 1.125 0 0 0 0-2.25ZM10.875 12a1.125 1.125 0 1 1 2.25 0 1.125 1.125 0 0 1-2.25 0Zm4.875-1.125a1.125 1.125 0 1 0 0 2.25 1.125 1.125 0 0 0 0-2.25Z" clip-rule="evenodd" class="svelte-1105cax"></path></svg>'),zi=W('<span class="timestamp svelte-1105cax"> </span>'),ki=W('<div><div class="bubble svelte-1105cax"><p class="content svelte-1105cax"> </p> <!></div></div>'),Ei=W('<div class="message assistant svelte-1105cax"><div class="bubble loading-bubble svelte-1105cax"><div class="typing-indicator svelte-1105cax"><span class="svelte-1105cax"></span> <span class="svelte-1105cax"></span> <span class="svelte-1105cax"></span></div></div></div>'),Si=W('<div class="chat-window svelte-1105cax"><div class="header svelte-1105cax"><div class="header-content svelte-1105cax"><div class="header-icon svelte-1105cax"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="svelte-1105cax"><path fill-rule="evenodd" d="M4.804 21.644A6.707 6.707 0 0 0 6 21.75a6.721 6.721 0 0 0 3.583-1.029c.774.182 1.584.279 2.417.279 5.322 0 9.75-3.97 9.75-9 0-5.03-4.428-9-9.75-9s-9.75 3.97-9.75 9c0 2.409 1.025 4.587 2.674 6.192.232.226.277.428.254.543a3.73 3.73 0 0 1-.814 1.686.75.75 0 0 0 .44 1.223ZM8.25 10.875a1.125 1.125 0 1 0 0 2.25 1.125 1.125 0 0 0 0-2.25ZM10.875 12a1.125 1.125 0 1 1 2.25 0 1.125 1.125 0 0 1-2.25 0Zm4.875-1.125a1.125 1.125 0 1 0 0 2.25 1.125 1.125 0 0 0 0-2.25Z" clip-rule="evenodd" class="svelte-1105cax"></path></svg></div> <div class="header-text svelte-1105cax"><h3 class="svelte-1105cax">Support</h3> <p class="svelte-1105cax">We typically reply within minutes</p></div></div> <button class="close-btn svelte-1105cax" aria-label="Close chat"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="svelte-1105cax"><path fill-rule="evenodd" d="M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" class="svelte-1105cax"></path></svg></button></div> <div class="messages svelte-1105cax"><!> <!></div> <form class="input-wrapper svelte-1105cax"><textarea rows="1" class="input svelte-1105cax"></textarea> <button type="submit" class="send-btn svelte-1105cax" aria-label="Send message"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="send-icon svelte-1105cax"><path d="M3.478 2.404a.75.75 0 0 0-.926.941l2.432 7.905H13.5a.75.75 0 0 1 0 1.5H4.984l-2.432 7.905a.75.75 0 0 0 .926.94 60.519 60.519 0 0 0 18.445-8.986.75.75 0 0 0 0-1.218A60.517 60.517 0 0 0 3.478 2.404Z" class="svelte-1105cax"></path></svg></button></form> <div class="powered-by svelte-1105cax">Powered by <a href="https://fortalece.ai" target="_blank" rel="noopener noreferrer" class="svelte-1105cax">Fortalece AI</a></div></div>'),Ai=W('<div><button class="toggle-btn svelte-1105cax"><!></button> <!></div>');const Ti={hash:"svelte-1105cax",code:`.svelte-1105cax {box-sizing:border-box;margin:0;padding:0;}.support-chat.svelte-1105cax {--bg: #ffffff;--bg-secondary: #f9fafb;--text: #1f2937;--text-muted: #6b7280;--border: #e5e7eb;--shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);position:fixed;bottom:1rem;z-index:9999;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;}.support-chat.theme-dark.svelte-1105cax {--bg: #1f2937;--bg-secondary: #374151;--text: #f9fafb;--text-muted: #9ca3af;--border: #4b5563;}
|
|
4
|
+
|
|
5
|
+
@media (prefers-color-scheme: dark) {.support-chat.theme-auto.svelte-1105cax {--bg: #1f2937;--bg-secondary: #374151;--text: #f9fafb;--text-muted: #9ca3af;--border: #4b5563;}
|
|
6
|
+
}.toggle-btn.svelte-1105cax {position:absolute;bottom:0;right:0;width:3.5rem;height:3.5rem;border-radius:50%;border:none;background:var(--primary-color);color:white;cursor:pointer;box-shadow:var(--shadow);display:flex;align-items:center;justify-content:center;transition:transform 0.2s, opacity 0.2s;}.toggle-btn.svelte-1105cax:hover {transform:scale(1.05);}.toggle-btn.svelte-1105cax .icon:where(.svelte-1105cax) {width:1.5rem;height:1.5rem;}.chat-window.svelte-1105cax {position:absolute;bottom:4.5rem;right:0;width:380px;max-width:calc(100vw - 2rem);height:500px;max-height:calc(100vh - 8rem);background:var(--bg);border-radius:1rem;box-shadow:var(--shadow);display:flex;flex-direction:column;overflow:hidden;border:1px solid var(--border);}.header.svelte-1105cax {display:flex;align-items:center;justify-content:space-between;padding:1rem;background:var(--primary-color);color:white;}.header-content.svelte-1105cax {display:flex;align-items:center;gap:0.75rem;}.header-icon.svelte-1105cax {width:2.5rem;height:2.5rem;background:rgba(255, 255, 255, 0.2);border-radius:50%;display:flex;align-items:center;justify-content:center;}.header-icon.svelte-1105cax svg:where(.svelte-1105cax) {width:1.5rem;height:1.5rem;}.header-text.svelte-1105cax h3:where(.svelte-1105cax) {font-size:1rem;font-weight:600;margin:0;}.header-text.svelte-1105cax p:where(.svelte-1105cax) {font-size:0.75rem;opacity:0.9;margin:0;}.close-btn.svelte-1105cax {background:transparent;border:none;color:white;cursor:pointer;padding:0.5rem;border-radius:50%;display:flex;align-items:center;justify-content:center;transition:background 0.2s;}.close-btn.svelte-1105cax:hover {background:rgba(255, 255, 255, 0.2);}.close-btn.svelte-1105cax svg:where(.svelte-1105cax) {width:1.25rem;height:1.25rem;}.messages.svelte-1105cax {flex:1;overflow-y:auto;padding:1rem;background:var(--bg-secondary);}.message.svelte-1105cax {display:flex;margin-bottom:0.75rem;}.message.user.svelte-1105cax {justify-content:flex-end;}.message.assistant.svelte-1105cax {justify-content:flex-start;}.bubble.svelte-1105cax {max-width:85%;padding:0.75rem 1rem;border-radius:1rem;}.user.svelte-1105cax .bubble:where(.svelte-1105cax) {background:var(--primary-color);color:white;border-bottom-right-radius:0.25rem;}.assistant.svelte-1105cax .bubble:where(.svelte-1105cax) {background:var(--bg);color:var(--text);border-bottom-left-radius:0.25rem;border:1px solid var(--border);}.content.svelte-1105cax {font-size:0.875rem;line-height:1.5;word-wrap:break-word;white-space:pre-wrap;}.timestamp.svelte-1105cax {display:block;font-size:0.625rem;opacity:0.7;margin-top:0.25rem;text-align:right;}.loading-bubble.svelte-1105cax {padding:1rem 1.25rem;}.typing-indicator.svelte-1105cax {display:flex;gap:0.25rem;}.typing-indicator.svelte-1105cax span:where(.svelte-1105cax) {width:0.5rem;height:0.5rem;background:var(--text-muted);border-radius:50%;
|
|
7
|
+
animation: svelte-1105cax-bounce 1.4s infinite ease-in-out both;}.typing-indicator.svelte-1105cax span:where(.svelte-1105cax):nth-child(1) {animation-delay:-0.32s;}.typing-indicator.svelte-1105cax span:where(.svelte-1105cax):nth-child(2) {animation-delay:-0.16s;}
|
|
8
|
+
|
|
9
|
+
@keyframes svelte-1105cax-bounce {
|
|
10
|
+
0%,
|
|
11
|
+
80%,
|
|
12
|
+
100% {
|
|
13
|
+
transform: scale(0);
|
|
14
|
+
}
|
|
15
|
+
40% {
|
|
16
|
+
transform: scale(1);
|
|
17
|
+
}
|
|
18
|
+
}.input-wrapper.svelte-1105cax {display:flex;align-items:flex-end;gap:0.5rem;padding:0.75rem;background:var(--bg);border-top:1px solid var(--border);}.input.svelte-1105cax {flex:1;resize:none;border:1px solid var(--border);border-radius:1rem;padding:0.625rem 1rem;font-size:0.875rem;font-family:inherit;line-height:1.5;outline:none;max-height:100px;background:var(--bg);color:var(--text);}.input.svelte-1105cax:focus {border-color:var(--primary-color);box-shadow:0 0 0 2px rgba(99, 102, 241, 0.2);}.input.svelte-1105cax::placeholder {color:var(--text-muted);}.input.svelte-1105cax:disabled {opacity:0.6;cursor:not-allowed;}.send-btn.svelte-1105cax {display:flex;align-items:center;justify-content:center;width:2.25rem;height:2.25rem;border:none;border-radius:50%;background:var(--primary-color);color:white;cursor:pointer;transition:opacity 0.2s, transform 0.1s;flex-shrink:0;}.send-btn.svelte-1105cax:hover:not(:disabled) {opacity:0.9;transform:scale(1.05);}.send-btn.svelte-1105cax:disabled {opacity:0.5;cursor:not-allowed;}.send-icon.svelte-1105cax {width:1rem;height:1rem;}.powered-by.svelte-1105cax {padding:0.5rem;text-align:center;font-size:0.625rem;color:var(--text-muted);background:var(--bg);border-top:1px solid var(--border);}.powered-by.svelte-1105cax a:where(.svelte-1105cax) {color:var(--primary-color);text-decoration:none;font-weight:500;}.powered-by.svelte-1105cax a:where(.svelte-1105cax):hover {text-decoration:underline;}`};function Jn(e,t){vr(t,!0),Un(e,Ti);let r=G(t,"projectId"),n=G(t,"apiUrl",7,"https://api.fortalece.ai"),i=G(t,"position",7,"bottom-right"),s=G(t,"theme",7,"light"),a=G(t,"primaryColor",7,"#6366f1"),l=G(t,"welcomeMessage",7,"Hi there! How can I help you today?"),o=G(t,"placeholder",7,"Type a message..."),f=M(!1),c=M(ut([])),p=M(""),u=M(!1),v=M(void 0);const g=ft(()=>({projectId:r(),apiUrl:n()})),T=ft(()=>i()==="bottom-left"?"left: 1rem; right: auto;":"right: 1rem; left: auto;"),h=ft(()=>s()==="dark"?"theme-dark":s()==="auto"?"theme-auto":"theme-light");pn(()=>{l()&&d(c).length===0&&m(c,[nr(l())],!0)});function _(){const b=document.querySelector("support-chat")?.shadowRoot?.querySelector(".messages");b&&(b.scrollTop=b.scrollHeight)}pn(()=>{d(c).length>0&&setTimeout(_,50)});function H(){m(f,!d(f))}async function ue(b){if(!b.trim()||d(u))return;const ve=Wn(b);m(c,[...d(c),ve],!0),m(p,""),m(u,!0);try{const he=await Kn(d(g),b,d(v));he.success&&he.message?(m(c,[...d(c),he.message],!0),m(v,he.conversationId,!0)):m(c,[...d(c),nr(he.error||"Sorry, something went wrong. Please try again.")],!0)}catch{m(c,[...d(c),nr("Sorry, something went wrong. Please try again.")],!0)}finally{m(u,!1)}}function Z(b){return b?b.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):""}var de={get projectId(){return r()},set projectId(b){r(b),D()},get apiUrl(){return n()},set apiUrl(b="https://api.fortalece.ai"){n(b),D()},get position(){return i()},set position(b="bottom-right"){i(b),D()},get theme(){return s()},set theme(b="light"){s(b),D()},get primaryColor(){return a()},set primaryColor(b="#6366f1"){a(b),D()},get welcomeMessage(){return l()},set welcomeMessage(b="Hi there! How can I help you today?"){l(b),D()},get placeholder(){return o()},set placeholder(b="Type a message..."){o(b),D()}},J=Ai(),I=S(J);I.__click=H;var ae=S(I);{var ye=b=>{var ve=xi();N(b,ve)},R=b=>{var ve=$i();N(b,ve)};we(ae,b=>{d(f)?b(ye):b(R,!1)})}$(I);var Re=A(I,2);{var Le=b=>{var ve=Si(),he=S(ve),Mr=A(S(he),2);Mr.__click=H,$(he);var Tt=A(he,2),k=S(Tt);Er(k,17,()=>d(c),L=>L.id,(L,Pe)=>{var pe=ki();let me;var qe=S(pe),ht=S(qe),It=S(ht,!0);$(ht);var sr=A(ht,2);{var Nt=pt=>{var mt=zi(),Nr=S(mt,!0);$(mt),Ie(Rt=>dt(Nr,Rt),[()=>Z(d(Pe).timestamp)]),N(pt,mt)};we(sr,pt=>{d(Pe).timestamp&&pt(Nt)})}$(qe),$(pe),Ie(()=>{me=St(pe,1,"message svelte-1105cax",null,me,{user:d(Pe).role==="user",assistant:d(Pe).role!=="user"}),dt(It,d(Pe).content)}),N(L,pe)});var le=A(k,2);{var Ct=L=>{var Pe=Ei();N(L,Pe)};we(le,L=>{d(u)&&L(Ct)})}$(Tt);var Mt=A(Tt,2),Oe=S(Mt);un(Oe),Oe.__keydown=L=>{L.key==="Enter"&&!L.shiftKey&&(L.preventDefault(),ue(d(p)))};var Ir=A(Oe,2);$(Mt),gt(2),$(ve),Ie(L=>{At(Oe,"placeholder",o()),Oe.disabled=d(u),Ir.disabled=L},[()=>d(u)||!d(p).trim()]),Rn("submit",Mt,L=>{L.preventDefault(),ue(d(p))}),er(Oe,()=>d(p),L=>m(p,L)),N(b,ve)};we(Re,b=>{d(f)&&b(Le)})}return $(J),Ie(()=>{St(J,1,`support-chat ${d(h)??""}`,"svelte-1105cax"),Sr(J,`--primary-color: ${a()??""}; ${d(T)??""}`),At(I,"aria-label",d(f)?"Close chat":"Open chat")}),N(e,J),hr(de)}Ln(["click","keydown"]),customElements.define("support-chat",Vn(Jn,{projectId:{attribute:"project-id",reflect:!0},apiUrl:{attribute:"api-url",reflect:!0},position:{attribute:"position",reflect:!0},theme:{attribute:"theme",reflect:!0},primaryColor:{attribute:"primary-color",reflect:!0},welcomeMessage:{attribute:"welcome-message",reflect:!0},placeholder:{attribute:"placeholder",reflect:!0}},[],[],!0));var Ci=Qt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-p7nz7"><path fill-rule="evenodd" d="M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" class="svelte-p7nz7"></path></svg>'),Mi=Qt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-p7nz7"><path fill-rule="evenodd" d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm11.378-3.917c-.89-.777-2.366-.777-3.255 0a.75.75 0 0 1-.988-1.129c1.454-1.272 3.776-1.272 5.23 0 1.513 1.324 1.513 3.518 0 4.842a3.75 3.75 0 0 1-.837.552c-.676.328-1.028.774-1.028 1.152v.75a.75.75 0 0 1-1.5 0v-.75c0-1.279 1.06-2.107 1.875-2.502.182-.088.351-.199.503-.331.83-.727.83-1.857 0-2.584ZM12 18a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z" clip-rule="evenodd" class="svelte-p7nz7"></path></svg>'),Ii=W('<div class="success-state svelte-p7nz7"><div class="success-icon svelte-p7nz7"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="svelte-p7nz7"><path fill-rule="evenodd" d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z" clip-rule="evenodd" class="svelte-p7nz7"></path></svg></div> <h4 class="svelte-p7nz7">Thank you!</h4> <p class="svelte-p7nz7">Your feedback has been submitted successfully.</p> <button class="btn btn-primary svelte-p7nz7">Send more feedback</button></div>'),Ni=W('<button type="button"><span class="type-icon svelte-p7nz7"> </span> <span class="type-label svelte-p7nz7"> </span></button>'),Ri=W('<button type="button"> </button>'),Li=W('<div class="form-group svelte-p7nz7"><span class="form-label svelte-p7nz7" id="priority-label">Priority</span> <div class="priority-selector svelte-p7nz7" role="group" aria-labelledby="priority-label"></div></div>'),Oi=W('<div class="error-message svelte-p7nz7"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="svelte-p7nz7"><path fill-rule="evenodd" d="M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003ZM12 8.25a.75.75 0 0 1 .75.75v3.75a.75.75 0 0 1-1.5 0V9a.75.75 0 0 1 .75-.75Zm0 8.25a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z" clip-rule="evenodd" class="svelte-p7nz7"></path></svg> </div>'),Pi=W('<span class="spinner svelte-p7nz7"></span> Submitting...',1),ji=W(`<form class="svelte-p7nz7"><div class="form-group svelte-p7nz7"><span class="form-label svelte-p7nz7" id="type-label">Type</span> <div class="type-selector svelte-p7nz7" role="group" aria-labelledby="type-label"></div></div> <div class="form-group svelte-p7nz7"><label class="form-label svelte-p7nz7" for="title">Title <span class="required svelte-p7nz7">*</span></label> <input type="text" id="title" class="form-input svelte-p7nz7" placeholder="Brief summary of your feedback" required/></div> <div class="form-group svelte-p7nz7"><label class="form-label svelte-p7nz7" for="description">Description <span class="required svelte-p7nz7">*</span></label> <textarea id="description" class="form-textarea svelte-p7nz7" placeholder="Provide more details about your feedback..." rows="4" required></textarea></div> <!> <div class="form-group svelte-p7nz7"><label class="form-label svelte-p7nz7" for="email">Email (optional)</label> <input type="email" id="email" class="form-input svelte-p7nz7" placeholder="your@email.com"/> <span class="form-hint svelte-p7nz7">We'll only contact you if we need more information</span></div> <!> <button type="submit" class="btn btn-primary btn-submit svelte-p7nz7"><!></button></form>`),Di=W(`<div class="panel-window svelte-p7nz7"><div class="header svelte-p7nz7"><div class="header-content svelte-p7nz7"><div class="header-icon svelte-p7nz7"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="svelte-p7nz7"><path fill-rule="evenodd" d="M7.502 6h7.128A3.375 3.375 0 0 1 18 9.375v9.375a3 3 0 0 0 3-3V6.108c0-1.505-1.125-2.811-2.664-2.94a48.972 48.972 0 0 0-.673-.05A3 3 0 0 0 15 1.5h-1.5a3 3 0 0 0-2.663 1.618c-.225.015-.45.032-.673.05C8.662 3.295 7.554 4.542 7.502 6ZM13.5 3A1.5 1.5 0 0 0 12 4.5h4.5A1.5 1.5 0 0 0 15 3h-1.5Z" clip-rule="evenodd" class="svelte-p7nz7"></path><path fill-rule="evenodd" d="M3 9.375C3 8.339 3.84 7.5 4.875 7.5h9.75c1.036 0 1.875.84 1.875 1.875v11.25c0 1.035-.84 1.875-1.875 1.875h-9.75A1.875 1.875 0 0 1 3 20.625V9.375Zm9.586 4.594a.75.75 0 0 0-1.172-.938l-2.476 3.096-.908-.907a.75.75 0 0 0-1.06 1.06l1.5 1.5a.75.75 0 0 0 1.116-.062l3-3.75Z" clip-rule="evenodd" class="svelte-p7nz7"></path></svg></div> <div class="header-text svelte-p7nz7"><h3 class="svelte-p7nz7">Send Feedback</h3> <p class="svelte-p7nz7">We'd love to hear from you</p></div></div> <button class="close-btn svelte-p7nz7" aria-label="Close"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="svelte-p7nz7"><path fill-rule="evenodd" d="M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" class="svelte-p7nz7"></path></svg></button></div> <div class="content svelte-p7nz7"><!></div> <div class="powered-by svelte-p7nz7">Powered by <a href="https://fortalece.ai" target="_blank" rel="noopener noreferrer" class="svelte-p7nz7">Fortalece AI</a></div></div>`),Fi=W('<div><button class="toggle-btn svelte-p7nz7"><!></button> <!></div>');const Ui={hash:"svelte-p7nz7",code:`.svelte-p7nz7 {box-sizing:border-box;margin:0;padding:0;}.feedback-panel.svelte-p7nz7 {--bg: #ffffff;--bg-secondary: #f9fafb;--text: #1f2937;--text-muted: #6b7280;--border: #e5e7eb;--shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);--error: #ef4444;--success: #22c55e;position:fixed;bottom:1rem;z-index:9999;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;}.feedback-panel.theme-dark.svelte-p7nz7 {--bg: #1f2937;--bg-secondary: #374151;--text: #f9fafb;--text-muted: #9ca3af;--border: #4b5563;}
|
|
19
|
+
|
|
20
|
+
@media (prefers-color-scheme: dark) {.feedback-panel.theme-auto.svelte-p7nz7 {--bg: #1f2937;--bg-secondary: #374151;--text: #f9fafb;--text-muted: #9ca3af;--border: #4b5563;}
|
|
21
|
+
}.toggle-btn.svelte-p7nz7 {position:absolute;bottom:0;right:0;width:3.5rem;height:3.5rem;border-radius:50%;border:none;background:var(--primary-color);color:white;cursor:pointer;box-shadow:var(--shadow);display:flex;align-items:center;justify-content:center;transition:transform 0.2s, opacity 0.2s;}.toggle-btn.svelte-p7nz7:hover {transform:scale(1.05);}.toggle-btn.svelte-p7nz7 .icon:where(.svelte-p7nz7) {width:1.5rem;height:1.5rem;}.panel-window.svelte-p7nz7 {position:absolute;bottom:4.5rem;right:0;width:400px;max-width:calc(100vw - 2rem);max-height:calc(100vh - 8rem);background:var(--bg);border-radius:1rem;box-shadow:var(--shadow);display:flex;flex-direction:column;overflow:hidden;border:1px solid var(--border);}.header.svelte-p7nz7 {display:flex;align-items:center;justify-content:space-between;padding:1rem;background:var(--primary-color);color:white;}.header-content.svelte-p7nz7 {display:flex;align-items:center;gap:0.75rem;}.header-icon.svelte-p7nz7 {width:2.5rem;height:2.5rem;background:rgba(255, 255, 255, 0.2);border-radius:50%;display:flex;align-items:center;justify-content:center;}.header-icon.svelte-p7nz7 svg:where(.svelte-p7nz7) {width:1.5rem;height:1.5rem;}.header-text.svelte-p7nz7 h3:where(.svelte-p7nz7) {font-size:1rem;font-weight:600;margin:0;}.header-text.svelte-p7nz7 p:where(.svelte-p7nz7) {font-size:0.75rem;opacity:0.9;margin:0;}.close-btn.svelte-p7nz7 {background:transparent;border:none;color:white;cursor:pointer;padding:0.5rem;border-radius:50%;display:flex;align-items:center;justify-content:center;transition:background 0.2s;}.close-btn.svelte-p7nz7:hover {background:rgba(255, 255, 255, 0.2);}.close-btn.svelte-p7nz7 svg:where(.svelte-p7nz7) {width:1.25rem;height:1.25rem;}.content.svelte-p7nz7 {flex:1;overflow-y:auto;padding:1rem;background:var(--bg);}
|
|
22
|
+
|
|
23
|
+
/* Form Styles */.form-group.svelte-p7nz7 {margin-bottom:1rem;}.form-label.svelte-p7nz7 {display:block;font-size:0.875rem;font-weight:500;color:var(--text);margin-bottom:0.375rem;}.required.svelte-p7nz7 {color:var(--error);}.form-input.svelte-p7nz7,
|
|
24
|
+
.form-textarea.svelte-p7nz7 {width:100%;padding:0.625rem 0.75rem;border:1px solid var(--border);border-radius:0.5rem;font-size:0.875rem;font-family:inherit;background:var(--bg);color:var(--text);outline:none;transition:border-color 0.2s, box-shadow 0.2s;}.form-input.svelte-p7nz7:focus,
|
|
25
|
+
.form-textarea.svelte-p7nz7:focus {border-color:var(--primary-color);box-shadow:0 0 0 2px rgba(99, 102, 241, 0.2);}.form-input.svelte-p7nz7::placeholder,
|
|
26
|
+
.form-textarea.svelte-p7nz7::placeholder {color:var(--text-muted);}.form-textarea.svelte-p7nz7 {resize:vertical;min-height:80px;}.form-hint.svelte-p7nz7 {display:block;font-size:0.75rem;color:var(--text-muted);margin-top:0.25rem;}
|
|
27
|
+
|
|
28
|
+
/* Type Selector */.type-selector.svelte-p7nz7 {display:flex;flex-wrap:wrap;gap:0.5rem;}.type-btn.svelte-p7nz7 {display:flex;align-items:center;gap:0.375rem;padding:0.5rem 0.75rem;border:1px solid var(--border);border-radius:2rem;background:var(--bg);color:var(--text);font-size:0.75rem;cursor:pointer;transition:all 0.2s;}.type-btn.svelte-p7nz7:hover {border-color:var(--primary-color);}.type-btn.active.svelte-p7nz7 {background:var(--primary-color);border-color:var(--primary-color);color:white;}.type-icon.svelte-p7nz7 {font-size:0.875rem;}
|
|
29
|
+
|
|
30
|
+
/* Priority Selector */.priority-selector.svelte-p7nz7 {display:flex;gap:0.5rem;}.priority-btn.svelte-p7nz7 {flex:1;padding:0.5rem;border:1px solid var(--border);border-radius:0.5rem;background:var(--bg);color:var(--text);font-size:0.75rem;cursor:pointer;transition:all 0.2s;}.priority-btn.svelte-p7nz7:hover {border-color:var(--priority-color);}.priority-btn.active.svelte-p7nz7 {background:var(--priority-color);border-color:var(--priority-color);color:white;}
|
|
31
|
+
|
|
32
|
+
/* Error Message */.error-message.svelte-p7nz7 {display:flex;align-items:center;gap:0.5rem;padding:0.75rem;background:rgba(239, 68, 68, 0.1);border:1px solid rgba(239, 68, 68, 0.3);border-radius:0.5rem;color:var(--error);font-size:0.875rem;margin-bottom:1rem;}.error-message.svelte-p7nz7 svg:where(.svelte-p7nz7) {width:1.25rem;height:1.25rem;flex-shrink:0;}
|
|
33
|
+
|
|
34
|
+
/* Buttons */.btn.svelte-p7nz7 {display:inline-flex;align-items:center;justify-content:center;gap:0.5rem;padding:0.75rem 1.25rem;border:none;border-radius:0.5rem;font-size:0.875rem;font-weight:500;font-family:inherit;cursor:pointer;transition:opacity 0.2s, transform 0.1s;}.btn-primary.svelte-p7nz7 {background:var(--primary-color);color:white;}.btn-primary.svelte-p7nz7:hover:not(:disabled) {opacity:0.9;}.btn-primary.svelte-p7nz7:disabled {opacity:0.6;cursor:not-allowed;}.btn-submit.svelte-p7nz7 {width:100%;margin-top:0.5rem;}
|
|
35
|
+
|
|
36
|
+
/* Spinner */.spinner.svelte-p7nz7 {width:1rem;height:1rem;border:2px solid rgba(255, 255, 255, 0.3);border-top-color:white;border-radius:50%;
|
|
37
|
+
animation: svelte-p7nz7-spin 0.6s linear infinite;}
|
|
38
|
+
|
|
39
|
+
@keyframes svelte-p7nz7-spin {
|
|
40
|
+
to {
|
|
41
|
+
transform: rotate(360deg);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* Success State */.success-state.svelte-p7nz7 {display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:2rem 1rem;}.success-icon.svelte-p7nz7 {width:4rem;height:4rem;color:var(--success);margin-bottom:1rem;}.success-icon.svelte-p7nz7 svg:where(.svelte-p7nz7) {width:100%;height:100%;}.success-state.svelte-p7nz7 h4:where(.svelte-p7nz7) {font-size:1.25rem;font-weight:600;color:var(--text);margin-bottom:0.5rem;}.success-state.svelte-p7nz7 p:where(.svelte-p7nz7) {font-size:0.875rem;color:var(--text-muted);margin-bottom:1.5rem;}
|
|
46
|
+
|
|
47
|
+
/* Powered by */.powered-by.svelte-p7nz7 {padding:0.5rem;text-align:center;font-size:0.625rem;color:var(--text-muted);background:var(--bg);border-top:1px solid var(--border);}.powered-by.svelte-p7nz7 a:where(.svelte-p7nz7) {color:var(--primary-color);text-decoration:none;font-weight:500;}.powered-by.svelte-p7nz7 a:where(.svelte-p7nz7):hover {text-decoration:underline;}`};function Xn(e,t){vr(t,!0),Un(e,Ui);let r=G(t,"projectId"),n=G(t,"apiUrl",7,"https://api.fortalece.ai"),i=G(t,"position",7,"bottom-right"),s=G(t,"theme",7,"light"),a=G(t,"primaryColor",7,"#6366f1"),l=G(t,"showPriority",7,!0),o=G(t,"allowAttachments",7,!1),f=M(!1),c=M(!1),p=M(!1),u=M(null),v=M("improvement"),g=M(""),T=M(""),h=M("medium"),_=M("");const H=ft(()=>({projectId:r(),apiUrl:n()})),ue=ft(()=>i()==="bottom-left"?"left: 1rem; right: auto;":"right: 1rem; left: auto;"),Z=ft(()=>s()==="dark"?"theme-dark":s()==="auto"?"theme-auto":"theme-light"),de=[{value:"bug",label:"Bug Report",icon:"đ"},{value:"feature",label:"Feature Request",icon:"â¨"},{value:"improvement",label:"Improvement",icon:"đĄ"},{value:"question",label:"Question",icon:"â"},{value:"other",label:"Other",icon:"đ"}],J=[{value:"low",label:"Low",color:"#22c55e"},{value:"medium",label:"Medium",color:"#f59e0b"},{value:"high",label:"High",color:"#ef4444"}];function I(){m(f,!d(f)),d(f)||ae()}function ae(){m(v,"improvement"),m(g,""),m(T,""),m(h,"medium"),m(_,""),m(u,null),m(p,!1)}async function ye(k){if(k.preventDefault(),!d(g).trim()||!d(T).trim()){m(u,"Please fill in all required fields.");return}m(c,!0),m(u,null);try{const le=await Gn(d(H),{type:d(v),title:d(g).trim(),description:d(T).trim(),priority:l()?d(h):void 0,email:d(_).trim()||void 0});le.success?m(p,!0):m(u,le.error||"Failed to submit feedback. Please try again.",!0)}catch{m(u,"An unexpected error occurred. Please try again.")}finally{m(c,!1)}}var R={get projectId(){return r()},set projectId(k){r(k),D()},get apiUrl(){return n()},set apiUrl(k="https://api.fortalece.ai"){n(k),D()},get position(){return i()},set position(k="bottom-right"){i(k),D()},get theme(){return s()},set theme(k="light"){s(k),D()},get primaryColor(){return a()},set primaryColor(k="#6366f1"){a(k),D()},get showPriority(){return l()},set showPriority(k=!0){l(k),D()},get allowAttachments(){return o()},set allowAttachments(k=!1){o(k),D()}},Re=Fi(),Le=S(Re);Le.__click=I;var b=S(Le);{var ve=k=>{var le=Ci();N(k,le)},he=k=>{var le=Mi();N(k,le)};we(b,k=>{d(f)?k(ve):k(he,!1)})}$(Le);var Mr=A(Le,2);{var Tt=k=>{var le=Di(),Ct=S(le),Mt=A(S(Ct),2);Mt.__click=I,$(Ct);var Oe=A(Ct,2),Ir=S(Oe);{var L=pe=>{var me=Ii(),qe=A(S(me),6);qe.__click=ae,$(me),N(pe,me)},Pe=pe=>{var me=ji(),qe=S(me),ht=A(S(qe),2);Er(ht,21,()=>de,C=>C.value,(C,U)=>{var xe=Ni();let _t;xe.__click=()=>m(v,d(U).value,!0);var He=S(xe),Ze=S(He,!0);$(He);var Lt=A(He,2),Lr=S(Lt,!0);$(Lt),$(xe),Ie(()=>{_t=St(xe,1,"type-btn svelte-p7nz7",null,_t,{active:d(v)===d(U).value}),dt(Ze,d(U).icon),dt(Lr,d(U).label)}),N(C,xe)}),$(ht),$(qe);var It=A(qe,2),sr=A(S(It),2);qn(sr),$(It);var Nt=A(It,2),pt=A(S(Nt),2);un(pt),$(Nt);var mt=A(Nt,2);{var Nr=C=>{var U=Li(),xe=A(S(U),2);Er(xe,21,()=>J,_t=>_t.value,(_t,He)=>{var Ze=Ri();let Lt;Ze.__click=()=>m(h,d(He).value,!0);var Lr=S(Ze,!0);$(Ze),Ie(()=>{Lt=St(Ze,1,"priority-btn svelte-p7nz7",null,Lt,{active:d(h)===d(He).value}),Sr(Ze,`--priority-color: ${d(He).color??""}`),dt(Lr,d(He).label)}),N(_t,Ze)}),$(xe),$(U),N(C,U)};we(mt,C=>{l()&&C(Nr)})}var Rt=A(mt,2),Qn=A(S(Rt),2);qn(Qn),gt(2),$(Rt);var es=A(Rt,2);{var qi=C=>{var U=Oi(),xe=A(S(U));$(U),Ie(()=>dt(xe,` ${d(u)??""}`)),N(C,U)};we(es,C=>{d(u)&&C(qi)})}var Rr=A(es,2),Hi=S(Rr);{var Zi=C=>{var U=Pi();gt(),N(C,U)},Vi=C=>{var U=ni("Submit Feedback");N(C,U)};we(Hi,C=>{d(c)?C(Zi):C(Vi,!1)})}$(Rr),$(me),Ie(()=>Rr.disabled=d(c)),Rn("submit",me,ye),er(sr,()=>d(g),C=>m(g,C)),er(pt,()=>d(T),C=>m(T,C)),er(Qn,()=>d(_),C=>m(_,C)),N(pe,me)};we(Ir,pe=>{d(p)?pe(L):pe(Pe,!1)})}$(Oe),gt(2),$(le),N(k,le)};we(Mr,k=>{d(f)&&k(Tt)})}return $(Re),Ie(()=>{St(Re,1,`feedback-panel ${d(Z)??""}`,"svelte-p7nz7"),Sr(Re,`--primary-color: ${a()??""}; ${d(ue)??""}`),At(Le,"aria-label",d(f)?"Close feedback":"Send feedback")}),N(e,Re),hr(R)}Ln(["click"]),customElements.define("feedback-panel",Vn(Xn,{projectId:{attribute:"project-id",reflect:!0},apiUrl:{attribute:"api-url",reflect:!0},position:{attribute:"position",reflect:!0},theme:{attribute:"theme",reflect:!0},primaryColor:{attribute:"primary-color",reflect:!0},showPriority:{attribute:"show-priority",reflect:!0,type:"Boolean"},allowAttachments:{attribute:"allow-attachments",reflect:!0,type:"Boolean"}},[],[],!0));const Bi="0.1.0";return oe.DEFAULT_API_URL=rr,oe.FeedbackPanel=Xn,oe.SupportChat=Jn,oe.VERSION=Bi,oe.createApiConfig=yi,oe.createSystemMessage=nr,oe.createUserMessage=Wn,oe.sendMessage=Kn,oe.submitFeedback=Gn,Object.defineProperty(oe,Symbol.toStringTag,{value:"Module"}),oe})({});
|