@wsxjs/wsx-marked-components 0.0.18
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/LICENSE +21 -0
- package/README.md +223 -0
- package/dist/index.cjs +1 -0
- package/dist/index.js +1680 -0
- package/package.json +62 -0
- package/src/Blockquote.css +12 -0
- package/src/Blockquote.wsx +26 -0
- package/src/Code.css +34 -0
- package/src/Code.wsx +46 -0
- package/src/Error.wsx +34 -0
- package/src/Heading.css +37 -0
- package/src/Heading.wsx +44 -0
- package/src/List.wsx +67 -0
- package/src/Markdown.css +66 -0
- package/src/Markdown.wsx +269 -0
- package/src/Paragraph.wsx +36 -0
- package/src/index.ts +16 -0
- package/src/marked-utils.ts +111 -0
- package/src/types/wsx.d.ts +5 -0
- package/src/types.ts +57 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 WSXJS Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
# @wsxjs/wsx-marked-components
|
|
2
|
+
|
|
3
|
+
Markdown rendering components built with WSXJS for the [marked](https://marked.js.org/) library.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @wsxjs/wsx-marked-components marked
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Components
|
|
12
|
+
|
|
13
|
+
### Heading
|
|
14
|
+
|
|
15
|
+
Renders markdown headings (h1-h6) with customizable styling.
|
|
16
|
+
|
|
17
|
+
**Tag**: `<wsx-marked-heading>`
|
|
18
|
+
|
|
19
|
+
**Attributes**:
|
|
20
|
+
- `level` (number): Heading level (1-6)
|
|
21
|
+
- `text` (string): Heading text content
|
|
22
|
+
|
|
23
|
+
**Example**:
|
|
24
|
+
```html
|
|
25
|
+
<wsx-marked-heading level="1" text="Hello World"></wsx-marked-heading>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Code
|
|
29
|
+
|
|
30
|
+
Renders code blocks with syntax highlighting support.
|
|
31
|
+
|
|
32
|
+
**Tag**: `<wsx-marked-code>`
|
|
33
|
+
|
|
34
|
+
**Attributes**:
|
|
35
|
+
- `code` (string): Code content
|
|
36
|
+
- `language` (string): Programming language identifier
|
|
37
|
+
|
|
38
|
+
**Example**:
|
|
39
|
+
```html
|
|
40
|
+
<wsx-marked-code code="console.log('Hello');" language="javascript"></wsx-marked-code>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Blockquote
|
|
44
|
+
|
|
45
|
+
Renders blockquotes with styling.
|
|
46
|
+
|
|
47
|
+
**Tag**: `<wsx-marked-blockquote>`
|
|
48
|
+
|
|
49
|
+
**Example**:
|
|
50
|
+
```html
|
|
51
|
+
<wsx-marked-blockquote>
|
|
52
|
+
<p>This is a quote</p>
|
|
53
|
+
</wsx-marked-blockquote>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Paragraph
|
|
57
|
+
|
|
58
|
+
Renders paragraphs with HTML content support.
|
|
59
|
+
|
|
60
|
+
**Tag**: `<wsx-marked-paragraph>`
|
|
61
|
+
|
|
62
|
+
**Attributes**:
|
|
63
|
+
- `content` (string): HTML content for the paragraph
|
|
64
|
+
|
|
65
|
+
**Example**:
|
|
66
|
+
```html
|
|
67
|
+
<wsx-marked-paragraph content="This is a <strong>paragraph</strong>"></wsx-marked-paragraph>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### List
|
|
71
|
+
|
|
72
|
+
Renders ordered or unordered lists.
|
|
73
|
+
|
|
74
|
+
**Tag**: `<wsx-marked-list>`
|
|
75
|
+
|
|
76
|
+
**Attributes**:
|
|
77
|
+
- `ordered` (boolean): Whether the list is ordered
|
|
78
|
+
- `items` (string): JSON stringified array of HTML item content
|
|
79
|
+
|
|
80
|
+
**Example**:
|
|
81
|
+
```html
|
|
82
|
+
<wsx-marked-list ordered="false" items='["Item 1", "Item 2"]'></wsx-marked-list>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Error
|
|
86
|
+
|
|
87
|
+
Displays error messages during markdown rendering.
|
|
88
|
+
|
|
89
|
+
**Tag**: `<wsx-marked-error>`
|
|
90
|
+
|
|
91
|
+
**Attributes**:
|
|
92
|
+
- `message` (string): Error message
|
|
93
|
+
|
|
94
|
+
**Example**:
|
|
95
|
+
```html
|
|
96
|
+
<wsx-marked-error message="Failed to parse markdown"></wsx-marked-error>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Markdown
|
|
100
|
+
|
|
101
|
+
A complete markdown renderer component that converts markdown to WSX marked components.
|
|
102
|
+
|
|
103
|
+
**Tag**: `<wsx-markdown>`
|
|
104
|
+
|
|
105
|
+
**Attributes**:
|
|
106
|
+
- `markdown` (string): Markdown content to render
|
|
107
|
+
|
|
108
|
+
**Methods**:
|
|
109
|
+
- `setCustomRenderers(renderers: CustomRenderers)`: Set custom token renderers
|
|
110
|
+
- `getCustomRenderers()`: Get current custom renderers
|
|
111
|
+
|
|
112
|
+
**Example - Basic Usage**:
|
|
113
|
+
```html
|
|
114
|
+
<wsx-markdown markdown="# Hello World"></wsx-markdown>
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**Example - With Custom Renderers**:
|
|
118
|
+
```typescript
|
|
119
|
+
import { Markdown, type TokenRenderer } from "@wsxjs/wsx-marked-components";
|
|
120
|
+
import type { Tokens } from "marked";
|
|
121
|
+
|
|
122
|
+
const markdown = document.querySelector("wsx-markdown") as Markdown;
|
|
123
|
+
|
|
124
|
+
const customHeadingRenderer: TokenRenderer = (token, defaultRender) => {
|
|
125
|
+
if (token.type === "heading") {
|
|
126
|
+
const headingToken = token as Tokens.Heading;
|
|
127
|
+
// Custom rendering logic
|
|
128
|
+
const customElement = document.createElement("div");
|
|
129
|
+
customElement.className = "custom-heading";
|
|
130
|
+
customElement.textContent = `Custom: ${headingToken.text}`;
|
|
131
|
+
return customElement;
|
|
132
|
+
}
|
|
133
|
+
return null; // Use default for other types
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
markdown.setCustomRenderers({
|
|
137
|
+
heading: customHeadingRenderer,
|
|
138
|
+
});
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Utilities
|
|
142
|
+
|
|
143
|
+
### `extractInlineTokens(tokens: Tokens.Generic[]): Tokens.Generic[]`
|
|
144
|
+
|
|
145
|
+
Extracts inline tokens from a list of tokens, handling paragraph tokens by extracting their inline tokens.
|
|
146
|
+
|
|
147
|
+
### `renderInlineTokens(tokens: Tokens.Generic[]): string`
|
|
148
|
+
|
|
149
|
+
Renders inline tokens to HTML string.
|
|
150
|
+
|
|
151
|
+
### `escapeHtml(text: string): string`
|
|
152
|
+
|
|
153
|
+
Escapes HTML special characters for safe attribute values.
|
|
154
|
+
|
|
155
|
+
## Usage
|
|
156
|
+
|
|
157
|
+
### Using Individual Components
|
|
158
|
+
|
|
159
|
+
```typescript
|
|
160
|
+
import "@wsxjs/wsx-marked-components";
|
|
161
|
+
import { marked } from "marked";
|
|
162
|
+
|
|
163
|
+
// Components are automatically registered as custom elements
|
|
164
|
+
// You can use them in HTML strings or JSX
|
|
165
|
+
const html = marked.parse("# Hello World");
|
|
166
|
+
// Returns: '<wsx-marked-heading level="1" text="Hello World"></wsx-marked-heading>'
|
|
167
|
+
|
|
168
|
+
// Or with code block:
|
|
169
|
+
const codeHtml = marked.parse("```js\nconsole.log('Hello');\n```");
|
|
170
|
+
// Returns: '<wsx-marked-code code="console.log(\'Hello\');" language="js"></wsx-marked-code>'
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### Using Markdown Component
|
|
174
|
+
|
|
175
|
+
The `Markdown` component provides a complete solution for rendering markdown:
|
|
176
|
+
|
|
177
|
+
```html
|
|
178
|
+
<!-- Simple usage -->
|
|
179
|
+
<wsx-markdown markdown="# Hello World"></wsx-markdown>
|
|
180
|
+
|
|
181
|
+
<!-- With custom renderers -->
|
|
182
|
+
<script type="module">
|
|
183
|
+
import { Markdown, type TokenRenderer } from "@wsxjs/wsx-marked-components";
|
|
184
|
+
import type { Tokens } from "marked";
|
|
185
|
+
|
|
186
|
+
const markdown = document.querySelector("wsx-markdown");
|
|
187
|
+
const customRenderer: TokenRenderer = (token, defaultRender) => {
|
|
188
|
+
// Your custom logic here
|
|
189
|
+
return defaultRender();
|
|
190
|
+
};
|
|
191
|
+
markdown.setCustomRenderers({ heading: customRenderer });
|
|
192
|
+
</script>
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### Customization
|
|
196
|
+
|
|
197
|
+
The `Markdown` component is designed to be extensible. You can customize rendering for any token type:
|
|
198
|
+
|
|
199
|
+
```typescript
|
|
200
|
+
import { Markdown, type TokenRenderer, type CustomRenderers } from "@wsxjs/wsx-marked-components";
|
|
201
|
+
import type { Tokens } from "marked";
|
|
202
|
+
|
|
203
|
+
const markdown = document.querySelector("wsx-markdown") as Markdown;
|
|
204
|
+
|
|
205
|
+
// Custom renderers can override default behavior
|
|
206
|
+
const customRenderers: CustomRenderers = {
|
|
207
|
+
heading: (token, defaultRender) => {
|
|
208
|
+
// Custom heading rendering
|
|
209
|
+
return defaultRender();
|
|
210
|
+
},
|
|
211
|
+
code: (token, defaultRender) => {
|
|
212
|
+
// Custom code block rendering
|
|
213
|
+
return defaultRender();
|
|
214
|
+
},
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
markdown.setCustomRenderers(customRenderers);
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## License
|
|
221
|
+
|
|
222
|
+
MIT
|
|
223
|
+
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const z=require("@wsxjs/wsx-core"),pe=require("marked"),be="wsx-marked-heading{display:block}wsx-marked-heading h1{font-size:2.5rem;font-weight:700;margin:1.5rem 0 1rem;color:var(--text-primary, #2c3e50);border-bottom:2px solid var(--primary-red, #dc2626);padding-bottom:.5rem}wsx-marked-heading h2{font-size:2rem;font-weight:600;margin:1.25rem 0 .75rem;color:var(--text-primary, #2c3e50)}wsx-marked-heading h3{font-size:1.5rem;font-weight:600;margin:1rem 0 .5rem;color:var(--text-primary, #2c3e50)}wsx-marked-heading h4,wsx-marked-heading h5,wsx-marked-heading h6{font-size:1.25rem;font-weight:600;margin:.75rem 0 .5rem;color:var(--text-primary, #2c3e50)}";var Ce;let Ae,Re;function oe(e,t,r){return(t=De(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lt(e,t,r,c,v,M){function j(n,o,l){return function(a,s){return l&&l(a),n[o].call(a,s)}}function S(n,o){for(var l=0;l<n.length;l++)n[l].call(o);return o}function y(n,o,l,a){if(typeof n!="function"&&(a||n!==void 0))throw new TypeError(o+" must "+(l||"be")+" a function"+(a?"":" or undefined"));return n}function m(n,o,l,a,s,R,D,$,q,k,b,h,g){function x(u){if(!g(u))throw new TypeError("Attempted to access private element on non-instance")}var f,w=o[0],_=o[3],A=!$;if(!A){l||Array.isArray(w)||(w=[w]);var i={},T=[],p=s===3?"get":s===4||h?"set":"value";k?(b||h?i={get:ye(function(){return _(this)},a,"get"),set:function(u){o[4](this,u)}}:i[p]=_,b||ye(i[p],a,s===2?"":p)):b||(i=Object.getOwnPropertyDescriptor(n,a))}for(var d=n,P=w.length-1;P>=0;P-=l?2:1){var K=w[P],W=l?w[P-1]:void 0,J={},N={kind:["field","accessor","method","getter","setter","class"][s],name:a,metadata:R,addInitializer:(function(u,O){if(u.v)throw Error("attempted to call addInitializer after decoration was finished");y(O,"An initializer","be",!0),D.push(O)}).bind(null,J)};try{if(A)(f=y(K.call(W,d,N),"class decorators","return"))&&(d=f);else{var H,V;N.static=q,N.private=k,k?s===2?H=function(u){return x(u),i.value}:(s<4&&(H=j(i,"get",x)),s!==3&&(V=j(i,"set",x))):(H=function(u){return u[a]},(s<2||s===4)&&(V=function(u,O){u[a]=O}));var G=N.access={has:k?g.bind():function(u){return a in u}};if(H&&(G.get=H),V&&(G.set=V),d=K.call(W,h?{get:i.get,set:i.set}:i[p],N),h){if(typeof d=="object"&&d)(f=y(d.get,"accessor.get"))&&(i.get=f),(f=y(d.set,"accessor.set"))&&(i.set=f),(f=y(d.init,"accessor.init"))&&T.push(f);else if(d!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else y(d,(b?"field":"method")+" decorators","return")&&(b?T.push(d):i[p]=d)}}finally{J.v=!0}}return(b||h)&&$.push(function(u,O){for(var B=T.length-1;B>=0;B--)O=T[B].call(u,O);return O}),b||A||(k?h?$.push(j(i,"get"),j(i,"set")):$.push(s===2?i[p]:j.call.bind(i[p])):Object.defineProperty(n,a,i)),d}function E(n,o){return Object.defineProperty(n,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:o})}if(arguments.length>=6)var L=M[Symbol.metadata||Symbol.for("Symbol.metadata")];var I=Object.create(L??null),C=function(n,o,l,a){var s,R,D=[],$=function(p){return ft(p)===n},q=new Map;function k(p){p&&D.push(S.bind(null,p))}for(var b=0;b<o.length;b++){var h=o[b];if(Array.isArray(h)){var g=h[1],x=h[2],f=h.length>3,w=16&g,_=!!(8&g),A=(g&=7)==0,i=x+"/"+_;if(!A&&!f){var T=q.get(i);if(T===!0||T===3&&g!==4||T===4&&g!==3)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+x);q.set(i,!(g>2)||g)}m(_?n:n.prototype,h,w,f?"#"+x:De(x),g,a,_?R=R||[]:s=s||[],D,_,f,A,g===1,_&&f?$:l)}}return k(s),k(R),D}(e,t,v,I);return r.length||E(e,I),{e:C,get c(){var n=[];return r.length&&[E(m(e,[r],c,e.name,5,I,n),I),S.bind(null,n,e)]}}}function De(e){var t=ut(e,"string");return typeof t=="symbol"?t:t+""}function ut(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var c=r.call(e,t);if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function ye(e,t,r){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:r?r+" "+t:t})}catch{}return e}function ft(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}Re=[z.autoRegister({tagName:"wsx-marked-heading"})];exports.Heading=void 0;class dt extends z.LightComponent{constructor(){super({styles:be,styleName:"wsx-marked-heading"}),oe(this,"_autoStyles",be),oe(this,"level",1),oe(this,"text","")}static get observedAttributes(){return["level","text"]}attributeChangedCallback(t,r,c){t==="level"?this.level=parseInt(c,10)||1:t==="text"&&(this.text=c),this.rerender()}render(){return this.level===1?z.jsx("h1",null,this.text):this.level===2?z.jsx("h2",null,this.text):this.level===3?z.jsx("h3",null,this.text):this.level===4?z.jsx("h4",null,this.text):this.level===5?z.jsx("h5",null,this.text):z.jsx("h6",null,this.text)}}Ce=dt;[exports.Heading,Ae]=lt(Ce,[],Re,0,void 0,z.LightComponent).c;Ae();const ve="wsx-marked-code{display:block;margin:1rem 0}wsx-marked-code pre{background:var(--bg-secondary, #f5f5f5);border:1px solid var(--border-color, #e0e0e0);border-radius:8px;padding:1rem;overflow-x:auto;font-family:Courier New,monospace;font-size:.9rem;line-height:1.5}wsx-marked-code code{background:transparent;padding:0;border:none;font-family:inherit}wsx-marked-code .language-label{display:inline-block;background:var(--primary-red, #dc2626);color:#fff;padding:.25rem .5rem;font-size:.75rem;border-radius:4px 4px 0 0;margin-bottom:-1px}";var Me;let Ie,Ne;function ae(e,t,r){return(t=He(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mt(e,t,r,c,v,M){function j(n,o,l){return function(a,s){return l&&l(a),n[o].call(a,s)}}function S(n,o){for(var l=0;l<n.length;l++)n[l].call(o);return o}function y(n,o,l,a){if(typeof n!="function"&&(a||n!==void 0))throw new TypeError(o+" must "+(l||"be")+" a function"+(a?"":" or undefined"));return n}function m(n,o,l,a,s,R,D,$,q,k,b,h,g){function x(u){if(!g(u))throw new TypeError("Attempted to access private element on non-instance")}var f,w=o[0],_=o[3],A=!$;if(!A){l||Array.isArray(w)||(w=[w]);var i={},T=[],p=s===3?"get":s===4||h?"set":"value";k?(b||h?i={get:ke(function(){return _(this)},a,"get"),set:function(u){o[4](this,u)}}:i[p]=_,b||ke(i[p],a,s===2?"":p)):b||(i=Object.getOwnPropertyDescriptor(n,a))}for(var d=n,P=w.length-1;P>=0;P-=l?2:1){var K=w[P],W=l?w[P-1]:void 0,J={},N={kind:["field","accessor","method","getter","setter","class"][s],name:a,metadata:R,addInitializer:(function(u,O){if(u.v)throw Error("attempted to call addInitializer after decoration was finished");y(O,"An initializer","be",!0),D.push(O)}).bind(null,J)};try{if(A)(f=y(K.call(W,d,N),"class decorators","return"))&&(d=f);else{var H,V;N.static=q,N.private=k,k?s===2?H=function(u){return x(u),i.value}:(s<4&&(H=j(i,"get",x)),s!==3&&(V=j(i,"set",x))):(H=function(u){return u[a]},(s<2||s===4)&&(V=function(u,O){u[a]=O}));var G=N.access={has:k?g.bind():function(u){return a in u}};if(H&&(G.get=H),V&&(G.set=V),d=K.call(W,h?{get:i.get,set:i.set}:i[p],N),h){if(typeof d=="object"&&d)(f=y(d.get,"accessor.get"))&&(i.get=f),(f=y(d.set,"accessor.set"))&&(i.set=f),(f=y(d.init,"accessor.init"))&&T.push(f);else if(d!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else y(d,(b?"field":"method")+" decorators","return")&&(b?T.push(d):i[p]=d)}}finally{J.v=!0}}return(b||h)&&$.push(function(u,O){for(var B=T.length-1;B>=0;B--)O=T[B].call(u,O);return O}),b||A||(k?h?$.push(j(i,"get"),j(i,"set")):$.push(s===2?i[p]:j.call.bind(i[p])):Object.defineProperty(n,a,i)),d}function E(n,o){return Object.defineProperty(n,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:o})}if(arguments.length>=6)var L=M[Symbol.metadata||Symbol.for("Symbol.metadata")];var I=Object.create(L??null),C=function(n,o,l,a){var s,R,D=[],$=function(p){return gt(p)===n},q=new Map;function k(p){p&&D.push(S.bind(null,p))}for(var b=0;b<o.length;b++){var h=o[b];if(Array.isArray(h)){var g=h[1],x=h[2],f=h.length>3,w=16&g,_=!!(8&g),A=(g&=7)==0,i=x+"/"+_;if(!A&&!f){var T=q.get(i);if(T===!0||T===3&&g!==4||T===4&&g!==3)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+x);q.set(i,!(g>2)||g)}m(_?n:n.prototype,h,w,f?"#"+x:He(x),g,a,_?R=R||[]:s=s||[],D,_,f,A,g===1,_&&f?$:l)}}return k(s),k(R),D}(e,t,v,I);return r.length||E(e,I),{e:C,get c(){var n=[];return r.length&&[E(m(e,[r],c,e.name,5,I,n),I),S.bind(null,n,e)]}}}function He(e){var t=ht(e,"string");return typeof t=="symbol"?t:t+""}function ht(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var c=r.call(e,t);if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function ke(e,t,r){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:r?r+" "+t:t})}catch{}return e}function gt(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}Ne=[z.autoRegister({tagName:"wsx-marked-code"})];exports.Code=void 0;class pt extends z.LightComponent{constructor(){super({styles:ve,styleName:"wsx-marked-code"}),ae(this,"_autoStyles",ve),ae(this,"code",""),ae(this,"language","")}static get observedAttributes(){return["code","language"]}attributeChangedCallback(t,r,c){t==="code"?this.code=c||"":t==="language"&&(this.language=c||""),this.rerender()}render(){return z.jsx("div",null,this.language&&z.jsx("span",{class:"language-label"},this.language),z.jsx("pre",null,z.jsx("code",null,this.code)))}}Me=pt;[exports.Code,Ie]=mt(Me,[],Ne,0,void 0,z.LightComponent).c;Ie();const je="wsx-marked-blockquote{display:block;margin:1rem 0;padding:1rem 1.5rem;border-left:4px solid var(--primary-red, #dc2626);background:var(--bg-secondary, #f9f9f9);border-radius:4px;font-style:italic;color:var(--text-secondary, #666)}";var qe;let Pe,Ve;function bt(e,t,r){return(t=Be(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yt(e,t,r,c,v,M){function j(n,o,l){return function(a,s){return l&&l(a),n[o].call(a,s)}}function S(n,o){for(var l=0;l<n.length;l++)n[l].call(o);return o}function y(n,o,l,a){if(typeof n!="function"&&(a||n!==void 0))throw new TypeError(o+" must "+(l||"be")+" a function"+(a?"":" or undefined"));return n}function m(n,o,l,a,s,R,D,$,q,k,b,h,g){function x(u){if(!g(u))throw new TypeError("Attempted to access private element on non-instance")}var f,w=o[0],_=o[3],A=!$;if(!A){l||Array.isArray(w)||(w=[w]);var i={},T=[],p=s===3?"get":s===4||h?"set":"value";k?(b||h?i={get:xe(function(){return _(this)},a,"get"),set:function(u){o[4](this,u)}}:i[p]=_,b||xe(i[p],a,s===2?"":p)):b||(i=Object.getOwnPropertyDescriptor(n,a))}for(var d=n,P=w.length-1;P>=0;P-=l?2:1){var K=w[P],W=l?w[P-1]:void 0,J={},N={kind:["field","accessor","method","getter","setter","class"][s],name:a,metadata:R,addInitializer:(function(u,O){if(u.v)throw Error("attempted to call addInitializer after decoration was finished");y(O,"An initializer","be",!0),D.push(O)}).bind(null,J)};try{if(A)(f=y(K.call(W,d,N),"class decorators","return"))&&(d=f);else{var H,V;N.static=q,N.private=k,k?s===2?H=function(u){return x(u),i.value}:(s<4&&(H=j(i,"get",x)),s!==3&&(V=j(i,"set",x))):(H=function(u){return u[a]},(s<2||s===4)&&(V=function(u,O){u[a]=O}));var G=N.access={has:k?g.bind():function(u){return a in u}};if(H&&(G.get=H),V&&(G.set=V),d=K.call(W,h?{get:i.get,set:i.set}:i[p],N),h){if(typeof d=="object"&&d)(f=y(d.get,"accessor.get"))&&(i.get=f),(f=y(d.set,"accessor.set"))&&(i.set=f),(f=y(d.init,"accessor.init"))&&T.push(f);else if(d!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else y(d,(b?"field":"method")+" decorators","return")&&(b?T.push(d):i[p]=d)}}finally{J.v=!0}}return(b||h)&&$.push(function(u,O){for(var B=T.length-1;B>=0;B--)O=T[B].call(u,O);return O}),b||A||(k?h?$.push(j(i,"get"),j(i,"set")):$.push(s===2?i[p]:j.call.bind(i[p])):Object.defineProperty(n,a,i)),d}function E(n,o){return Object.defineProperty(n,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:o})}if(arguments.length>=6)var L=M[Symbol.metadata||Symbol.for("Symbol.metadata")];var I=Object.create(L??null),C=function(n,o,l,a){var s,R,D=[],$=function(p){return kt(p)===n},q=new Map;function k(p){p&&D.push(S.bind(null,p))}for(var b=0;b<o.length;b++){var h=o[b];if(Array.isArray(h)){var g=h[1],x=h[2],f=h.length>3,w=16&g,_=!!(8&g),A=(g&=7)==0,i=x+"/"+_;if(!A&&!f){var T=q.get(i);if(T===!0||T===3&&g!==4||T===4&&g!==3)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+x);q.set(i,!(g>2)||g)}m(_?n:n.prototype,h,w,f?"#"+x:Be(x),g,a,_?R=R||[]:s=s||[],D,_,f,A,g===1,_&&f?$:l)}}return k(s),k(R),D}(e,t,v,I);return r.length||E(e,I),{e:C,get c(){var n=[];return r.length&&[E(m(e,[r],c,e.name,5,I,n),I),S.bind(null,n,e)]}}}function Be(e){var t=vt(e,"string");return typeof t=="symbol"?t:t+""}function vt(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var c=r.call(e,t);if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function xe(e,t,r){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:r?r+" "+t:t})}catch{}return e}function kt(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}Ve=[z.autoRegister({tagName:"wsx-marked-blockquote"})];exports.Blockquote=void 0;class jt extends z.LightComponent{constructor(){super({styles:je,styleName:"wsx-marked-blockquote"}),bt(this,"_autoStyles",je)}render(){return z.jsx("blockquote",null,z.jsx("slot",null))}}qe=jt;[exports.Blockquote,Pe]=yt(qe,[],Ve,0,void 0,z.LightComponent).c;Pe();var Ke;let We,Je;function xt(e,t,r){return(t=Ge(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wt(e,t,r,c,v,M){function j(n,o,l){return function(a,s){return l&&l(a),n[o].call(a,s)}}function S(n,o){for(var l=0;l<n.length;l++)n[l].call(o);return o}function y(n,o,l,a){if(typeof n!="function"&&(a||n!==void 0))throw new TypeError(o+" must "+(l||"be")+" a function"+(a?"":" or undefined"));return n}function m(n,o,l,a,s,R,D,$,q,k,b,h,g){function x(u){if(!g(u))throw new TypeError("Attempted to access private element on non-instance")}var f,w=o[0],_=o[3],A=!$;if(!A){l||Array.isArray(w)||(w=[w]);var i={},T=[],p=s===3?"get":s===4||h?"set":"value";k?(b||h?i={get:we(function(){return _(this)},a,"get"),set:function(u){o[4](this,u)}}:i[p]=_,b||we(i[p],a,s===2?"":p)):b||(i=Object.getOwnPropertyDescriptor(n,a))}for(var d=n,P=w.length-1;P>=0;P-=l?2:1){var K=w[P],W=l?w[P-1]:void 0,J={},N={kind:["field","accessor","method","getter","setter","class"][s],name:a,metadata:R,addInitializer:(function(u,O){if(u.v)throw Error("attempted to call addInitializer after decoration was finished");y(O,"An initializer","be",!0),D.push(O)}).bind(null,J)};try{if(A)(f=y(K.call(W,d,N),"class decorators","return"))&&(d=f);else{var H,V;N.static=q,N.private=k,k?s===2?H=function(u){return x(u),i.value}:(s<4&&(H=j(i,"get",x)),s!==3&&(V=j(i,"set",x))):(H=function(u){return u[a]},(s<2||s===4)&&(V=function(u,O){u[a]=O}));var G=N.access={has:k?g.bind():function(u){return a in u}};if(H&&(G.get=H),V&&(G.set=V),d=K.call(W,h?{get:i.get,set:i.set}:i[p],N),h){if(typeof d=="object"&&d)(f=y(d.get,"accessor.get"))&&(i.get=f),(f=y(d.set,"accessor.set"))&&(i.set=f),(f=y(d.init,"accessor.init"))&&T.push(f);else if(d!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else y(d,(b?"field":"method")+" decorators","return")&&(b?T.push(d):i[p]=d)}}finally{J.v=!0}}return(b||h)&&$.push(function(u,O){for(var B=T.length-1;B>=0;B--)O=T[B].call(u,O);return O}),b||A||(k?h?$.push(j(i,"get"),j(i,"set")):$.push(s===2?i[p]:j.call.bind(i[p])):Object.defineProperty(n,a,i)),d}function E(n,o){return Object.defineProperty(n,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:o})}if(arguments.length>=6)var L=M[Symbol.metadata||Symbol.for("Symbol.metadata")];var I=Object.create(L??null),C=function(n,o,l,a){var s,R,D=[],$=function(p){return Tt(p)===n},q=new Map;function k(p){p&&D.push(S.bind(null,p))}for(var b=0;b<o.length;b++){var h=o[b];if(Array.isArray(h)){var g=h[1],x=h[2],f=h.length>3,w=16&g,_=!!(8&g),A=(g&=7)==0,i=x+"/"+_;if(!A&&!f){var T=q.get(i);if(T===!0||T===3&&g!==4||T===4&&g!==3)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+x);q.set(i,!(g>2)||g)}m(_?n:n.prototype,h,w,f?"#"+x:Ge(x),g,a,_?R=R||[]:s=s||[],D,_,f,A,g===1,_&&f?$:l)}}return k(s),k(R),D}(e,t,v,I);return r.length||E(e,I),{e:C,get c(){var n=[];return r.length&&[E(m(e,[r],c,e.name,5,I,n),I),S.bind(null,n,e)]}}}function Ge(e){var t=_t(e,"string");return typeof t=="symbol"?t:t+""}function _t(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var c=r.call(e,t);if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function we(e,t,r){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:r?r+" "+t:t})}catch{}return e}function Tt(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}Je=[z.autoRegister({tagName:"wsx-marked-paragraph"})];exports.Paragraph=void 0;class Ot extends z.LightComponent{constructor(){super({styleName:"wsx-marked-paragraph"}),xt(this,"content",void 0);const[t,r]=this.useState("content","");Object.defineProperty(this,"content",{get:t,set:r,enumerable:!0,configurable:!0})}static get observedAttributes(){return["content"]}attributeChangedCallback(t,r,c){t==="content"&&(this.content=c||"")}render(){return z.jsx("p",{class:"marked-paragraph"},this.content)}}Ke=Ot;[exports.Paragraph,We]=wt(Ke,[],Je,0,void 0,z.LightComponent).c;We();var Xe;let Fe,Ue;function _e(e,t,r){return(t=Qe(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Et(e,t,r,c,v,M){function j(n,o,l){return function(a,s){return l&&l(a),n[o].call(a,s)}}function S(n,o){for(var l=0;l<n.length;l++)n[l].call(o);return o}function y(n,o,l,a){if(typeof n!="function"&&(a||n!==void 0))throw new TypeError(o+" must "+(l||"be")+" a function"+(a?"":" or undefined"));return n}function m(n,o,l,a,s,R,D,$,q,k,b,h,g){function x(u){if(!g(u))throw new TypeError("Attempted to access private element on non-instance")}var f,w=o[0],_=o[3],A=!$;if(!A){l||Array.isArray(w)||(w=[w]);var i={},T=[],p=s===3?"get":s===4||h?"set":"value";k?(b||h?i={get:Te(function(){return _(this)},a,"get"),set:function(u){o[4](this,u)}}:i[p]=_,b||Te(i[p],a,s===2?"":p)):b||(i=Object.getOwnPropertyDescriptor(n,a))}for(var d=n,P=w.length-1;P>=0;P-=l?2:1){var K=w[P],W=l?w[P-1]:void 0,J={},N={kind:["field","accessor","method","getter","setter","class"][s],name:a,metadata:R,addInitializer:(function(u,O){if(u.v)throw Error("attempted to call addInitializer after decoration was finished");y(O,"An initializer","be",!0),D.push(O)}).bind(null,J)};try{if(A)(f=y(K.call(W,d,N),"class decorators","return"))&&(d=f);else{var H,V;N.static=q,N.private=k,k?s===2?H=function(u){return x(u),i.value}:(s<4&&(H=j(i,"get",x)),s!==3&&(V=j(i,"set",x))):(H=function(u){return u[a]},(s<2||s===4)&&(V=function(u,O){u[a]=O}));var G=N.access={has:k?g.bind():function(u){return a in u}};if(H&&(G.get=H),V&&(G.set=V),d=K.call(W,h?{get:i.get,set:i.set}:i[p],N),h){if(typeof d=="object"&&d)(f=y(d.get,"accessor.get"))&&(i.get=f),(f=y(d.set,"accessor.set"))&&(i.set=f),(f=y(d.init,"accessor.init"))&&T.push(f);else if(d!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else y(d,(b?"field":"method")+" decorators","return")&&(b?T.push(d):i[p]=d)}}finally{J.v=!0}}return(b||h)&&$.push(function(u,O){for(var B=T.length-1;B>=0;B--)O=T[B].call(u,O);return O}),b||A||(k?h?$.push(j(i,"get"),j(i,"set")):$.push(s===2?i[p]:j.call.bind(i[p])):Object.defineProperty(n,a,i)),d}function E(n,o){return Object.defineProperty(n,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:o})}if(arguments.length>=6)var L=M[Symbol.metadata||Symbol.for("Symbol.metadata")];var I=Object.create(L??null),C=function(n,o,l,a){var s,R,D=[],$=function(p){return Lt(p)===n},q=new Map;function k(p){p&&D.push(S.bind(null,p))}for(var b=0;b<o.length;b++){var h=o[b];if(Array.isArray(h)){var g=h[1],x=h[2],f=h.length>3,w=16&g,_=!!(8&g),A=(g&=7)==0,i=x+"/"+_;if(!A&&!f){var T=q.get(i);if(T===!0||T===3&&g!==4||T===4&&g!==3)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+x);q.set(i,!(g>2)||g)}m(_?n:n.prototype,h,w,f?"#"+x:Qe(x),g,a,_?R=R||[]:s=s||[],D,_,f,A,g===1,_&&f?$:l)}}return k(s),k(R),D}(e,t,v,I);return r.length||E(e,I),{e:C,get c(){var n=[];return r.length&&[E(m(e,[r],c,e.name,5,I,n),I),S.bind(null,n,e)]}}}function Qe(e){var t=St(e,"string");return typeof t=="symbol"?t:t+""}function St(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var c=r.call(e,t);if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Te(e,t,r){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:r?r+" "+t:t})}catch{}return e}function Lt(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}Ue=[z.autoRegister({tagName:"wsx-marked-list"})];exports.List=void 0;class zt extends z.LightComponent{constructor(){super({styleName:"wsx-marked-list"}),_e(this,"ordered",void 0),_e(this,"items",void 0);const[t,r]=this.useState("ordered",!1);Object.defineProperty(this,"ordered",{get:t,set:r,enumerable:!0,configurable:!0});let c=this.reactive([]);Object.defineProperty(this,"items",{get:()=>c,set:v=>{c=v!==null&&typeof v<"u"&&(Array.isArray(v)||typeof v=="object")?this.reactive(v):v,this.scheduleRerender()},enumerable:!0,configurable:!0})}static get observedAttributes(){return["ordered","items"]}attributeChangedCallback(t,r,c){if(t==="ordered")this.ordered=c==="true";else if(t==="items")try{this.items=JSON.parse(c||"[]")}catch{this.items=[]}}render(){return this.ordered?z.jsx("ol",{class:"marked-list"},this.items.map((t,r)=>z.jsx("li",{key:r,class:"marked-list-item"},t))):z.jsx("ul",{class:"marked-list"},this.items.map((t,r)=>z.jsx("li",{key:r,class:"marked-list-item"},t)))}}Xe=zt;[exports.List,Fe]=Et(Xe,[],Ue,0,void 0,z.LightComponent).c;Fe();var Ye;let Ze,et;function $t(e,t,r){return(t=tt(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ct(e,t,r,c,v,M){function j(n,o,l){return function(a,s){return l&&l(a),n[o].call(a,s)}}function S(n,o){for(var l=0;l<n.length;l++)n[l].call(o);return o}function y(n,o,l,a){if(typeof n!="function"&&(a||n!==void 0))throw new TypeError(o+" must "+(l||"be")+" a function"+(a?"":" or undefined"));return n}function m(n,o,l,a,s,R,D,$,q,k,b,h,g){function x(u){if(!g(u))throw new TypeError("Attempted to access private element on non-instance")}var f,w=o[0],_=o[3],A=!$;if(!A){l||Array.isArray(w)||(w=[w]);var i={},T=[],p=s===3?"get":s===4||h?"set":"value";k?(b||h?i={get:Oe(function(){return _(this)},a,"get"),set:function(u){o[4](this,u)}}:i[p]=_,b||Oe(i[p],a,s===2?"":p)):b||(i=Object.getOwnPropertyDescriptor(n,a))}for(var d=n,P=w.length-1;P>=0;P-=l?2:1){var K=w[P],W=l?w[P-1]:void 0,J={},N={kind:["field","accessor","method","getter","setter","class"][s],name:a,metadata:R,addInitializer:(function(u,O){if(u.v)throw ue("attempted to call addInitializer after decoration was finished");y(O,"An initializer","be",!0),D.push(O)}).bind(null,J)};try{if(A)(f=y(K.call(W,d,N),"class decorators","return"))&&(d=f);else{var H,V;N.static=q,N.private=k,k?s===2?H=function(u){return x(u),i.value}:(s<4&&(H=j(i,"get",x)),s!==3&&(V=j(i,"set",x))):(H=function(u){return u[a]},(s<2||s===4)&&(V=function(u,O){u[a]=O}));var G=N.access={has:k?g.bind():function(u){return a in u}};if(H&&(G.get=H),V&&(G.set=V),d=K.call(W,h?{get:i.get,set:i.set}:i[p],N),h){if(typeof d=="object"&&d)(f=y(d.get,"accessor.get"))&&(i.get=f),(f=y(d.set,"accessor.set"))&&(i.set=f),(f=y(d.init,"accessor.init"))&&T.push(f);else if(d!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else y(d,(b?"field":"method")+" decorators","return")&&(b?T.push(d):i[p]=d)}}finally{J.v=!0}}return(b||h)&&$.push(function(u,O){for(var B=T.length-1;B>=0;B--)O=T[B].call(u,O);return O}),b||A||(k?h?$.push(j(i,"get"),j(i,"set")):$.push(s===2?i[p]:j.call.bind(i[p])):Object.defineProperty(n,a,i)),d}function E(n,o){return Object.defineProperty(n,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:o})}if(arguments.length>=6)var L=M[Symbol.metadata||Symbol.for("Symbol.metadata")];var I=Object.create(L??null),C=function(n,o,l,a){var s,R,D=[],$=function(p){return Rt(p)===n},q=new Map;function k(p){p&&D.push(S.bind(null,p))}for(var b=0;b<o.length;b++){var h=o[b];if(Array.isArray(h)){var g=h[1],x=h[2],f=h.length>3,w=16&g,_=!!(8&g),A=(g&=7)==0,i=x+"/"+_;if(!A&&!f){var T=q.get(i);if(T===!0||T===3&&g!==4||T===4&&g!==3)throw ue("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+x);q.set(i,!(g>2)||g)}m(_?n:n.prototype,h,w,f?"#"+x:tt(x),g,a,_?R=R||[]:s=s||[],D,_,f,A,g===1,_&&f?$:l)}}return k(s),k(R),D}(e,t,v,I);return r.length||E(e,I),{e:C,get c(){var n=[];return r.length&&[E(m(e,[r],c,e.name,5,I,n),I),S.bind(null,n,e)]}}}function tt(e){var t=At(e,"string");return typeof t=="symbol"?t:t+""}function At(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var c=r.call(e,t);if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Oe(e,t,r){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:r?r+" "+t:t})}catch{}return e}function Rt(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}et=[z.autoRegister({tagName:"wsx-marked-error"})];exports.Error=void 0;let ue=class extends z.LightComponent{constructor(){super({styleName:"wsx-marked-error"}),$t(this,"message","")}static get observedAttributes(){return["message"]}attributeChangedCallback(t,r,c){t==="message"&&(this.message=c||"",this.rerender())}render(){return z.jsx("div",{class:"error"},this.message)}};Ye=ue;[exports.Error,Ze]=Ct(Ye,[],et,0,void 0,z.LightComponent).c;Ze();function Dt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ie={exports:{}};function Mt(e){try{return JSON.stringify(e)}catch{return'"[Circular]"'}}var It=Nt;function Nt(e,t,r){var c=r&&r.stringify||Mt,v=1;if(typeof e=="object"&&e!==null){var M=t.length+v;if(M===1)return e;var j=new Array(M);j[0]=c(e);for(var S=1;S<M;S++)j[S]=c(t[S]);return j.join(" ")}if(typeof e!="string")return e;var y=t.length;if(y===0)return e;for(var m="",E=1-v,L=-1,I=e&&e.length||0,C=0;C<I;){if(e.charCodeAt(C)===37&&C+1<I){switch(L=L>-1?L:0,e.charCodeAt(C+1)){case 100:case 102:if(E>=y||t[E]==null)break;L<C&&(m+=e.slice(L,C)),m+=Number(t[E]),L=C+2,C++;break;case 105:if(E>=y||t[E]==null)break;L<C&&(m+=e.slice(L,C)),m+=Math.floor(Number(t[E])),L=C+2,C++;break;case 79:case 111:case 106:if(E>=y||t[E]===void 0)break;L<C&&(m+=e.slice(L,C));var n=typeof t[E];if(n==="string"){m+="'"+t[E]+"'",L=C+2,C++;break}if(n==="function"){m+=t[E].name||"<anonymous>",L=C+2,C++;break}m+=c(t[E]),L=C+2,C++;break;case 115:if(E>=y)break;L<C&&(m+=e.slice(L,C)),m+=String(t[E]),L=C+2,C++;break;case 37:L<C&&(m+=e.slice(L,C)),m+="%",L=C+2,C++,E--;break}++E}++C}return L===-1?e:(L<I&&(m+=e.slice(L)),m)}const Ee=It;ie.exports=X;const Z=Zt().console||{},Ht={mapHttpRequest:ee,mapHttpResponse:ee,wrapRequestSerializer:se,wrapResponseSerializer:se,wrapErrorSerializer:se,req:ee,res:ee,err:Le,errWithCause:Le};function F(e,t){return e==="silent"?1/0:t.levels.values[e]}const he=Symbol("pino.logFuncs"),fe=Symbol("pino.hierarchy"),qt={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function Se(e,t){const r={logger:t,parent:e[fe]};t[fe]=r}function Pt(e,t,r){const c={};t.forEach(v=>{c[v]=r[v]?r[v]:Z[v]||Z[qt[v]||"log"]||Q}),e[he]=c}function Vt(e,t){return Array.isArray(e)?e.filter(function(c){return c!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function X(e){e=e||{},e.browser=e.browser||{};const t=e.browser.transmit;if(t&&typeof t.send!="function")throw Error("pino: transmit option must have a send function");const r=e.browser.write||Z;e.browser.write&&(e.browser.asObject=!0);const c=e.serializers||{},v=Vt(e.browser.serialize,c);let M=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(M=!1);const j=Object.keys(e.customLevels||{}),S=["error","fatal","warn","info","debug","trace"].concat(j);typeof r=="function"&&S.forEach(function(o){r[o]=r}),(e.enabled===!1||e.browser.disabled)&&(e.level="silent");const y=e.level||"info",m=Object.create(r);m.log||(m.log=Q),Pt(m,S,r),Se({},m),Object.defineProperty(m,"levelVal",{get:L}),Object.defineProperty(m,"level",{get:I,set:C});const E={transmit:t,serialize:v,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:S,timestamp:Ut(e),messageKey:e.messageKey||"msg",onChild:e.onChild||Q};m.levels=Bt(e),m.level=y,m.isLevelEnabled=function(o){return this.levels.values[o]?this.levels.values[o]>=this.levels.values[this.level]:!1},m.setMaxListeners=m.getMaxListeners=m.emit=m.addListener=m.on=m.prependListener=m.once=m.prependOnceListener=m.removeListener=m.removeAllListeners=m.listeners=m.listenerCount=m.eventNames=m.write=m.flush=Q,m.serializers=c,m._serialize=v,m._stdErrSerialize=M,m.child=function(...o){return n.call(this,E,...o)},t&&(m._logEvent=de());function L(){return F(this.level,this)}function I(){return this._level}function C(o){if(o!=="silent"&&!this.levels.values[o])throw Error("unknown level "+o);this._level=o,U(this,E,m,"error"),U(this,E,m,"fatal"),U(this,E,m,"warn"),U(this,E,m,"info"),U(this,E,m,"debug"),U(this,E,m,"trace"),j.forEach(l=>{U(this,E,m,l)})}function n(o,l,a){if(!l)throw new Error("missing bindings for child Pino");a=a||{},v&&l.serializers&&(a.serializers=l.serializers);const s=a.serializers;if(v&&s){var R=Object.assign({},c,s),D=e.browser.serialize===!0?Object.keys(R):v;delete l.serializers,ge([l],D,R,this._stdErrSerialize)}function $(k){this._childLevel=(k._childLevel|0)+1,this.bindings=l,R&&(this.serializers=R,this._serialize=D),t&&(this._logEvent=de([].concat(k._logEvent.bindings,l)))}$.prototype=this;const q=new $(this);return Se(this,q),q.child=function(...k){return n.call(this,o,...k)},q.level=a.level||this.level,o.onChild(q),q}return m}function Bt(e){const t=e.customLevels||{},r=Object.assign({},X.levels.values,t),c=Object.assign({},X.levels.labels,Kt(t));return{values:r,labels:c}}function Kt(e){const t={};return Object.keys(e).forEach(function(r){t[e[r]]=r}),t}X.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};X.stdSerializers=Ht;X.stdTimeFunctions=Object.assign({},{nullTime:rt,epochTime:nt,unixTime:Qt,isoTime:Yt});function Wt(e){const t=[];e.bindings&&t.push(e.bindings);let r=e[fe];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}function U(e,t,r,c){if(Object.defineProperty(e,c,{value:F(e.level,r)>F(c,r)?Q:r[he][c],writable:!0,enumerable:!0,configurable:!0}),e[c]===Q){if(!t.transmit)return;const M=t.transmit.level||e.level,j=F(M,r);if(F(c,r)<j)return}e[c]=Gt(e,t,r,c);const v=Wt(e);v.length!==0&&(e[c]=Jt(v,e[c]))}function Jt(e,t){return function(){return t.apply(this,[...e,...arguments])}}function Gt(e,t,r,c){return function(v){return function(){const j=t.timestamp(),S=new Array(arguments.length),y=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Z?Z:this;for(var m=0;m<S.length;m++)S[m]=arguments[m];var E=!1;if(t.serialize&&(ge(S,this._serialize,this.serializers,this._stdErrSerialize),E=!0),t.asObject||t.formatters?v.call(y,...Xt(this,c,S,j,t)):v.apply(y,S),t.transmit){const L=t.transmit.level||e._level,I=F(L,r),C=F(c,r);if(C<I)return;Ft(this,{ts:j,methodLevel:c,methodValue:C,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:F(e._level,r)},S,E)}}}(e[he][c])}function Xt(e,t,r,c,v){const{level:M,log:j=L=>L}=v.formatters||{},S=r.slice();let y=S[0];const m={};let E=(e._childLevel|0)+1;if(E<1&&(E=1),c&&(m.time=c),M){const L=M(t,e.levels.values[t]);Object.assign(m,L)}else m.level=e.levels.values[t];if(v.asObjectBindingsOnly){if(y!==null&&typeof y=="object")for(;E--&&typeof S[0]=="object";)Object.assign(m,S.shift());return[j(m),...S]}else{if(y!==null&&typeof y=="object"){for(;E--&&typeof S[0]=="object";)Object.assign(m,S.shift());y=S.length?Ee(S.shift(),S):void 0}else typeof y=="string"&&(y=Ee(S.shift(),S));return y!==void 0&&(m[v.messageKey]=y),[j(m)]}}function ge(e,t,r,c){for(const v in e)if(c&&e[v]instanceof Error)e[v]=X.stdSerializers.err(e[v]);else if(typeof e[v]=="object"&&!Array.isArray(e[v])&&t)for(const M in e[v])t.indexOf(M)>-1&&M in r&&(e[v][M]=r[M](e[v][M]))}function Ft(e,t,r,c=!1){const v=t.send,M=t.ts,j=t.methodLevel,S=t.methodValue,y=t.val,m=e._logEvent.bindings;c||ge(r,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=M,e._logEvent.messages=r.filter(function(E){return m.indexOf(E)===-1}),e._logEvent.level.label=j,e._logEvent.level.value=S,v(j,e._logEvent,y),e._logEvent=de(m)}function de(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function Le(e){const t={type:e.constructor.name,msg:e.message,stack:e.stack};for(const r in e)t[r]===void 0&&(t[r]=e[r]);return t}function Ut(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?rt:nt}function ee(){return{}}function se(e){return e}function Q(){}function rt(){return!1}function nt(){return Date.now()}function Qt(){return Math.round(Date.now()/1e3)}function Yt(){return new Date(Date.now()).toISOString()}function Zt(){function e(t){return typeof t<"u"&&t}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return e(self)||e(window)||e(this)||{}}}ie.exports.default=X;ie.exports.pino=X;var er=ie.exports;const te=Dt(er);function ne(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function tr(){var e;return typeof process<"u"&&((e=process.versions)==null?void 0:e.node)!==void 0}function rr(){return typeof window<"u"&&typeof document<"u"}const ce={name:"WSX",level:ne()?"info":"debug",pretty:!ne()};function nr(e={}){const{name:t,level:r,pretty:c,pinoOptions:v}={...ce,...e},M={name:t||ce.name,level:r||ce.level,...v};if(rr()&&(M.browser={asObject:!1,write:void 0,...(v==null?void 0:v.browser)||{}}),c&&tr()&&!ne())try{return te(M,te.transport({target:"pino-pretty",options:{colorize:!0,translateTime:"HH:MM:ss.l",ignore:"pid,hostname",singleLine:!1}}))}catch{return console.warn("[wsx-logger] pino-pretty not available, using default formatter"),te(M)}return te(M)}class it{constructor(t={}){this.isProd=ne(),this.pinoLogger=nr(t)}debug(t,...r){this.isProd||(r.length>0?this.pinoLogger.debug({args:r},t):this.pinoLogger.debug(t))}info(t,...r){this.isProd?r.length>0?this.pinoLogger.info({args:r},t):this.pinoLogger.info(t):r.length>0?this.pinoLogger.info({args:r},t):this.pinoLogger.info(t)}warn(t,...r){r.length>0?this.pinoLogger.warn({args:r},t):this.pinoLogger.warn(t)}error(t,...r){r.length>0?this.pinoLogger.error({args:r},t):this.pinoLogger.error(t)}fatal(t,...r){r.length>0?this.pinoLogger.fatal({args:r},t):this.pinoLogger.fatal(t)}trace(t,...r){this.isProd||(r.length>0?this.pinoLogger.trace({args:r},t):this.pinoLogger.trace(t))}getPinoLogger(){return this.pinoLogger}}new it;function ir(e,t={}){return new it({...t,name:t.name||`WSX:${e}`})}const ze="wsx-markdown{display:block}.marked-content{line-height:1.7;color:var(--text-primary, #2c3e50)}.marked-content .marked-paragraph{margin:1rem 0;line-height:1.7}.marked-content .marked-list{margin:1rem 0;padding-left:2rem}.marked-content .marked-list-item{margin:.5rem 0;line-height:1.6}.marked-content a{color:var(--primary-red, #dc2626);text-decoration:none;border-bottom:1px solid transparent;transition:border-color .2s ease}.marked-content a:hover{border-bottom-color:var(--primary-red, #dc2626)}.marked-content strong{font-weight:600;color:var(--text-primary, #2c3e50)}.marked-content em{font-style:italic}.marked-content hr{border:none;border-top:2px solid var(--border-color, #e0e0e0);margin:2rem 0}.marked-content img{max-width:100%;height:auto;border-radius:8px;margin:1rem 0}.error{color:#dc2626;padding:1rem;background:#fee2e2;border-radius:6px;border:1px solid #fecaca}";function me(e){const t=document.createElement("div");return t.textContent=e,t.innerHTML}function or(e){if(!e||!Array.isArray(e))return[];const t=[];return e.forEach(r=>{if(r.type==="paragraph"){const c=r;c.tokens&&Array.isArray(c.tokens)&&t.push(...c.tokens)}else(r.type==="text"||r.type==="strong"||r.type==="em"||r.type==="link"||r.type==="code"||r.type==="br")&&t.push(r)}),t}function Y(e){return!e||!Array.isArray(e)?"":e.map(t=>{switch(t.type){case"text":return t.text||"";case"strong":{const r=t,c=r.tokens&&Array.isArray(r.tokens)?r.tokens:[];return`<strong>${Y(c)}</strong>`}case"em":{const r=t,c=r.tokens&&Array.isArray(r.tokens)?r.tokens:[];return`<em>${Y(c)}</em>`}case"link":{const r=t,c=r.title?` title="${me(r.title)}"`:"",v=r.tokens&&Array.isArray(r.tokens)?r.tokens:[];return`<a href="${r.href||"#"}"${c}>${Y(v)}</a>`}case"code":return`<code>${me(t.text||"")}</code>`;case"br":return"<br>";default:return""}}).join("")}var ot;let at,st;function le(e,t,r){return(t=ct(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ar(e,t,r,c,v,M){function j(n,o,l){return function(a,s){return l&&l(a),n[o].call(a,s)}}function S(n,o){for(var l=0;l<n.length;l++)n[l].call(o);return o}function y(n,o,l,a){if(typeof n!="function"&&(a||n!==void 0))throw new TypeError(o+" must "+(l||"be")+" a function"+(a?"":" or undefined"));return n}function m(n,o,l,a,s,R,D,$,q,k,b,h,g){function x(u){if(!g(u))throw new TypeError("Attempted to access private element on non-instance")}var f,w=o[0],_=o[3],A=!$;if(!A){l||Array.isArray(w)||(w=[w]);var i={},T=[],p=s===3?"get":s===4||h?"set":"value";k?(b||h?i={get:$e(function(){return _(this)},a,"get"),set:function(u){o[4](this,u)}}:i[p]=_,b||$e(i[p],a,s===2?"":p)):b||(i=Object.getOwnPropertyDescriptor(n,a))}for(var d=n,P=w.length-1;P>=0;P-=l?2:1){var K=w[P],W=l?w[P-1]:void 0,J={},N={kind:["field","accessor","method","getter","setter","class"][s],name:a,metadata:R,addInitializer:(function(u,O){if(u.v)throw Error("attempted to call addInitializer after decoration was finished");y(O,"An initializer","be",!0),D.push(O)}).bind(null,J)};try{if(A)(f=y(K.call(W,d,N),"class decorators","return"))&&(d=f);else{var H,V;N.static=q,N.private=k,k?s===2?H=function(u){return x(u),i.value}:(s<4&&(H=j(i,"get",x)),s!==3&&(V=j(i,"set",x))):(H=function(u){return u[a]},(s<2||s===4)&&(V=function(u,O){u[a]=O}));var G=N.access={has:k?g.bind():function(u){return a in u}};if(H&&(G.get=H),V&&(G.set=V),d=K.call(W,h?{get:i.get,set:i.set}:i[p],N),h){if(typeof d=="object"&&d)(f=y(d.get,"accessor.get"))&&(i.get=f),(f=y(d.set,"accessor.set"))&&(i.set=f),(f=y(d.init,"accessor.init"))&&T.push(f);else if(d!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else y(d,(b?"field":"method")+" decorators","return")&&(b?T.push(d):i[p]=d)}}finally{J.v=!0}}return(b||h)&&$.push(function(u,O){for(var B=T.length-1;B>=0;B--)O=T[B].call(u,O);return O}),b||A||(k?h?$.push(j(i,"get"),j(i,"set")):$.push(s===2?i[p]:j.call.bind(i[p])):Object.defineProperty(n,a,i)),d}function E(n,o){return Object.defineProperty(n,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:o})}if(arguments.length>=6)var L=M[Symbol.metadata||Symbol.for("Symbol.metadata")];var I=Object.create(L??null),C=function(n,o,l,a){var s,R,D=[],$=function(p){return cr(p)===n},q=new Map;function k(p){p&&D.push(S.bind(null,p))}for(var b=0;b<o.length;b++){var h=o[b];if(Array.isArray(h)){var g=h[1],x=h[2],f=h.length>3,w=16&g,_=!!(8&g),A=(g&=7)==0,i=x+"/"+_;if(!A&&!f){var T=q.get(i);if(T===!0||T===3&&g!==4||T===4&&g!==3)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+x);q.set(i,!(g>2)||g)}m(_?n:n.prototype,h,w,f?"#"+x:ct(x),g,a,_?R=R||[]:s=s||[],D,_,f,A,g===1,_&&f?$:l)}}return k(s),k(R),D}(e,t,v,I);return r.length||E(e,I),{e:C,get c(){var n=[];return r.length&&[E(m(e,[r],c,e.name,5,I,n),I),S.bind(null,n,e)]}}}function ct(e){var t=sr(e,"string");return typeof t=="symbol"?t:t+""}function sr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var c=r.call(e,t);if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function $e(e,t,r){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:r?r+" "+t:t})}catch{}return e}function cr(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}const re=ir("Markdown");st=[z.autoRegister({tagName:"wsx-markdown"})];exports.Markdown=void 0;class lr extends z.LightComponent{constructor(){super({styles:ze,styleName:"wsx-markdown",lightDOM:!0}),le(this,"_autoStyles",ze),le(this,"markdown",void 0),le(this,"customRenderers",{}),re.info("Markdown initialized");const[t,r]=this.useState("markdown","");Object.defineProperty(this,"markdown",{get:t,set:r,enumerable:!0,configurable:!0})}static get observedAttributes(){return["markdown"]}attributeChangedCallback(t,r,c){t==="markdown"&&(this.markdown=c||"",this.rerender())}setCustomRenderers(t){this.customRenderers={...this.customRenderers,...t},this.rerender()}getCustomRenderers(){return{...this.customRenderers}}render(){if(!this.markdown)return z.jsx("div",{class:"marked-content"});try{const t=pe.marked.lexer(this.markdown);return z.jsx("div",{class:"marked-content"},this.renderTokens(t))}catch(t){return re.error("Failed to render markdown",t),z.jsx("div",{class:"marked-content"},z.jsx("wsx-marked-error",{message:`Error: ${t}`}))}}onConnected(){const t=this.getAttribute("markdown");t&&(this.markdown=t)}renderTokens(t){return t.map(r=>this.renderToken(r)).filter(r=>r!==null)}renderToken(t){const r=this.customRenderers[t.type];if(r){const c=r(t,()=>this.defaultRenderToken(t));if(c!==null)return c}return this.defaultRenderToken(t)}defaultRenderToken(t){switch(t.type){case"heading":{const r=t;return z.jsx("wsx-marked-heading",{level:r.depth.toString(),text:Y(r.tokens)})}case"code":{const r=t;return z.jsx("wsx-marked-code",{code:r.text,language:r.lang||""})}case"blockquote":{const r=t;return z.jsx("wsx-marked-blockquote",null,this.renderTokens(r.tokens))}case"paragraph":{const r=t;return z.jsx("wsx-marked-paragraph",{content:Y(r.tokens)})}case"list":{const r=t,c=r.items.map(v=>{if(!v.tokens||!Array.isArray(v.tokens))return re.warn("List item has no tokens or tokens is not an array",{item:v}),"";const M=this.renderTokens(v.tokens);if(M.length===0)return"";const j=document.createElement("div");M.forEach(y=>{y&&j.appendChild(y)});const S=j.innerHTML;return S||re.warn("tempContainer.innerHTML is empty after appending elements",{renderedElementsCount:M.length,itemTokens:v.tokens}),S});return z.jsx("wsx-marked-list",{ordered:r.ordered?"true":"false",items:JSON.stringify(c)})}case"html":{const r=t;return z.jsx("div",null,r.text)}case"hr":return z.jsx("hr",null);case"space":return null;case"text":{const r=t;return z.jsx("span",null,r.text||"")}default:{const c=new pe.marked.Renderer()[t.type],v=(c==null?void 0:c(t))||"";return v?z.jsx("div",null,v):null}}}}ot=lr;[exports.Markdown,at]=ar(ot,[],st,0,void 0,z.LightComponent).c;at();exports.escapeHtml=me;exports.extractInlineTokens=or;exports.renderInlineTokens=Y;
|