@htmlbricks/hb-stylus-notebook 0.71.35 → 0.71.37
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/README.md +93 -19
- package/main.iife.js +1 -1
- package/main.iife.js.map +1 -1
- package/manifest.json +17 -88
- package/package.json +2 -2
- package/types/webcomponent.type.d.json +0 -30
- package/types/webcomponent.type.d.ts +1 -5
- package/types/webcomponent_events.type.d.json +0 -17
package/README.md
CHANGED
|
@@ -1,34 +1,108 @@
|
|
|
1
|
-
|
|
1
|
+
# `hb-stylus-notebook` — integrator guide
|
|
2
2
|
|
|
3
|
-
**Category:** inputs
|
|
4
|
-
**Tags:** inputs, drawing
|
|
3
|
+
**Category:** inputs · **Tags:** inputs, drawing · **Package:** `@htmlbricks/hb-stylus-notebook`
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
**Declared layout size:** fullscreen (see `extra/docs.ts`).
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
## Summary
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
`hb-stylus-notebook` is a **notebook shell** around the drawing web component **`hb-stylus-paper`**. It renders a **toolbar** (`part="controller"`) and a **paper region** (`part="paper-container"`) that hosts the nested canvas. The shell wires **mode switching** (draw / select / eraser), **undo/redo**, a **Save** action that exports the current drawing as **JSON** via a download, **load** and **insert** flows using **`hb-input-file`**, and optional restoration of strokes from a **`load_draw`** payload.
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
**Peer components:** this package expects **`hb-stylus-paper`** and **`hb-input-file`** to be registered (see `extra/docs.ts` → `dependencies`).
|
|
13
12
|
|
|
14
|
-
|
|
13
|
+
## Custom element
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
```text
|
|
16
|
+
hb-stylus-notebook
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Attributes (snake_case, string-friendly)
|
|
20
|
+
|
|
21
|
+
HTML and `setAttribute` only expose **strings**. Serialize objects as **JSON strings**.
|
|
22
|
+
|
|
23
|
+
| Attribute | Required | Description |
|
|
24
|
+
| --- | --- | --- |
|
|
25
|
+
| `id` | No | Optional host identifier string. |
|
|
26
|
+
| `style` | No | Optional inline style string (reserved in typings; not applied inside `component.wc.svelte` today). |
|
|
27
|
+
| `load_draw` | No | JSON string of a saved notebook payload (`TSave`). When the value is a non-empty string, the component attempts `JSON.parse` in an effect. Passed through to `hb-stylus-paper` as a serialized string when set. |
|
|
28
|
+
|
|
29
|
+
### `load_draw` / save payload shape (`TSave`)
|
|
30
|
+
|
|
31
|
+
From `types/webcomponent.type.d.ts`:
|
|
32
|
+
|
|
33
|
+
- **`type`:** `"pdf"` \| `"json"` \| `"png"` \| `"svg"` \| `"jpg"`
|
|
34
|
+
- **`draw`:** array of **`IStroke`** objects (strokes, multipaths, eraser, move, etc.)
|
|
35
|
+
- **`id`**, **`draw_id`**, **`name`**, **`version`:** strings / numbers as defined in the type file
|
|
36
|
+
|
|
37
|
+
Strokes include fields such as `type`, `id`, `visible`, `actionIndex`, optional `path`, `pathData`, `color`, `opacity`, bounds `min`/`max`, and related metadata. Treat the typings as the source of truth for exact fields.
|
|
38
|
+
|
|
39
|
+
## Toolbar and nested paper (runtime behavior)
|
|
40
|
+
|
|
41
|
+
The **`controller`** part contains:
|
|
42
|
+
|
|
43
|
+
- **clear** — switches `hb-stylus-paper` to **eraser** mode
|
|
44
|
+
- **select** — **select** mode
|
|
45
|
+
- **draw** — **draw** mode
|
|
46
|
+
- **undo** / **redo** — driven by history index from the paper’s `historyIndex` event
|
|
47
|
+
- **save** — sets an internal `save_as` `{ name: "test", type: "json" }`, then clears it after the paper fires **`save`**; the handler **`downloadObjectAsJson`** saves `{detail}.name + ".json"`
|
|
48
|
+
- **brush** — disabled unless mode is **draw**
|
|
49
|
+
- **load** — `hb-input-file` reads a **text** file and **`JSON.parse`**s it into **`load_draw`**
|
|
50
|
+
- **insert** — `hb-input-file` reads an **image** file as **data URL** and passes **`insert_image`** to the paper (PNG/JPG inferred from the data URL)
|
|
51
|
+
|
|
52
|
+
The **`paper-container`** part wraps **`hb-stylus-paper`** with props including `mode`, `goto` (history navigation), `save_as`, `load_draw`, `insert_image`, `insert_text`, `background_color` (currently `"green"` in source), and listeners for **`historyIndex`** and **`save`**.
|
|
53
|
+
|
|
54
|
+
## Events
|
|
55
|
+
|
|
56
|
+
No custom events are declared for this component (`Events` is `{}` in `types/webcomponent.type.d.ts`).
|
|
57
|
+
|
|
58
|
+
## Styling
|
|
20
59
|
|
|
21
|
-
|
|
60
|
+
- **Bulma 1.x** is included for the shell; theme with **`--bulma-*`** variables on `:host` or ancestors (see [Bulma CSS variables](https://bulma.io/documentation/features/css-variables/)).
|
|
22
61
|
|
|
23
|
-
|
|
62
|
+
### CSS custom properties (`styleSetup`)
|
|
24
63
|
|
|
25
|
-
|
|
64
|
+
| Variable | Role |
|
|
65
|
+
| --- | --- |
|
|
66
|
+
| `--bulma-scheme-main-bis` | Background behind the nested paper in `#paper-container` (falls back in SCSS if unset). |
|
|
26
67
|
|
|
27
|
-
|
|
28
|
-
- Declared **size** metadata: fullscreen layout.
|
|
68
|
+
### CSS parts
|
|
29
69
|
|
|
30
|
-
|
|
70
|
+
| Part | Role |
|
|
71
|
+
| --- | --- |
|
|
72
|
+
| `controller` | Toolbar row: modes, undo/redo, save, and file inputs. |
|
|
73
|
+
| `paper-container` | Region that hosts **`hb-stylus-paper`**. |
|
|
74
|
+
|
|
75
|
+
### Layout (`styles/webcomponent.scss`)
|
|
76
|
+
|
|
77
|
+
`:host` is a **fullscreen-sized grid** (`position: absolute; inset: 0; width/height 100%`) with rows **`header`** (toolbar) and **`paper`** (canvas area, `min-height: 0` for correct flex/grid scrolling).
|
|
78
|
+
|
|
79
|
+
### Slots
|
|
80
|
+
|
|
81
|
+
None (`htmlSlots` is empty in `extra/docs.ts`).
|
|
82
|
+
|
|
83
|
+
## Examples
|
|
84
|
+
|
|
85
|
+
### Minimal
|
|
31
86
|
|
|
32
87
|
```html
|
|
33
|
-
<hb-stylus-notebook
|
|
88
|
+
<hb-stylus-notebook></hb-stylus-notebook>
|
|
34
89
|
```
|
|
90
|
+
|
|
91
|
+
### With `load_draw` (attribute must be a JSON string)
|
|
92
|
+
|
|
93
|
+
```html
|
|
94
|
+
<hb-stylus-notebook
|
|
95
|
+
load_draw='{"type":"json","id":"stylus-paper","draw_id":"example","name":"sketch","version":0,"draw":[]}'
|
|
96
|
+
></hb-stylus-notebook>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Replace the JSON value with a real `TSave` payload exported from your app or from a previous session.
|
|
100
|
+
|
|
101
|
+
## Related packages
|
|
102
|
+
|
|
103
|
+
- **`@htmlbricks/hb-stylus-paper`** — drawing surface API (modes, history, save detail, inserts).
|
|
104
|
+
- **`@htmlbricks/hb-input-file`** — file picking for load / insert rows in the toolbar.
|
|
105
|
+
|
|
106
|
+
## License
|
|
107
|
+
|
|
108
|
+
See `extra/docs.ts` → `licenses` (Apache-2.0 entry) for catalog metadata.
|
package/main.iife.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);var t={},n=Symbol(),r=`http://www.w3.org/1999/xhtml`,i=Array.isArray,a=Array.prototype.indexOf,o=Array.prototype.includes,s=Array.from,c=Object.keys,l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyDescriptors,f=Object.prototype,p=Array.prototype,m=Object.getPrototypeOf,h=Object.isExtensible,g=()=>{};function ee(e){for(var t=0;t<e.length;t++)e[t]()}function _(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var v=1024,y=2048,b=4096,te=8192,ne=16384,re=32768,ie=1<<25,ae=65536,x=1<<19,oe=1<<20,S=65536,se=1<<21,ce=1<<22,le=1<<23,C=Symbol(`$state`),ue=Symbol(`legacy props`),de=Symbol(``),w=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},fe=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`);function pe(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function me(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function he(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function ge(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function _e(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function ve(){throw Error(`https://svelte.dev/e/hydration_failed`)}function ye(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function be(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function xe(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function Se(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function Ce(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}function we(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function Te(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var T=!1;function Ee(e){T=e}var E;function D(e){if(e===null)throw we(),t;return E=e}function De(){return D(R(E))}function Oe(e){if(T){if(R(E)!==null)throw we(),t;E=e}}function ke(e=1){if(T){for(var t=e,n=E;t--;)n=R(n);E=n}}function Ae(e=!0){for(var t=0,n=E;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else (r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=R(n);e&&n.remove(),n=i}}function je(e){return e===this.v}function Me(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function Ne(e){return!Me(e,this.v)}var Pe=!1,Fe=!1,O=null;function Ie(e){O=e}function Le(e,t=!1,n){O={p:O,i:!1,c:null,e:null,s:e,x:null,r:K,l:Fe&&!t?{s:null,u:null,$:[]}:null}}function Re(e){var t=O,n=t.e;if(n!==null){t.e=null;for(var r of n)sn(r)}return e!==void 0&&(t.x=e),t.i=!0,O=t.p,e??{}}function ze(){return!Fe||O!==null&&O.l===null}var Be=[];function Ve(){var e=Be;Be=[],ee(e)}function He(e){if(Be.length===0&&!$e){var t=Be;queueMicrotask(()=>{t===Be&&Ve()})}Be.push(e)}function Ue(){for(;Be.length>0;)Ve()}function We(e){var t=K;if(t===null)return U.f|=le,e;if(!(t.f&32768)&&!(t.f&4))throw e;k(e,t)}function k(e,t){for(;t!==null;){if(t.f&128){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}var Ge=~(y|b|v);function A(e,t){e.f=e.f&Ge|t}function Ke(e){e.f&512||e.deps===null?A(e,v):A(e,b)}function qe(e){if(e!==null)for(let t of e)!(t.f&2)||!(t.f&65536)||(t.f^=S,qe(t.deps))}function Je(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),qe(e.deps),A(e,v)}var Ye=!1,Xe=!1;function Ze(e){var t=Xe;try{return Xe=!1,[e(),Xe]}finally{Xe=t}}var j=new Set,M=null,N=null,Qe=null,$e=!1,et=!1,tt=null,nt=null,rt=0,it=1,at=class e{id=it++;current=new Map;previous=new Map;#e=new Set;#t=new Set;#n=new Map;#r=new Map;#i=null;#a=[];#o=new Set;#s=new Set;#c=new Map;is_fork=!1;#l=!1;#u=new Set;#d(){return this.is_fork||this.#r.size>0}#f(){for(let n of this.#u)for(let r of n.#r.keys()){for(var e=!1,t=r;t.parent!==null;){if(this.#c.has(t)){e=!0;break}t=t.parent}if(!e)return!0}return!1}skip_effect(e){this.#c.has(e)||this.#c.set(e,{d:[],m:[]})}unskip_effect(e){var t=this.#c.get(e);if(t){this.#c.delete(e);for(var n of t.d)A(n,y),this.schedule(n);for(n of t.m)A(n,b),this.schedule(n)}}#p(){if(rt++>1e3&&(j.delete(this),st()),!this.#d()){for(let e of this.#o)this.#s.delete(e),A(e,y),this.schedule(e);for(let e of this.#s)A(e,b),this.schedule(e)}let t=this.#a;this.#a=[],this.apply();var n=tt=[],r=[],i=nt=[];for(let e of t)try{this.#m(e,n,r)}catch(t){throw pt(e),t}if(M=null,i.length>0){var a=e.ensure();for(let e of i)a.schedule(e)}if(tt=null,nt=null,this.#d()||this.#f()){this.#h(r),this.#h(n);for(let[e,t]of this.#c)ft(e,t)}else{this.#n.size===0&&j.delete(this),this.#o.clear(),this.#s.clear();for(let e of this.#e)e(this);this.#e.clear(),ct(r),ct(n),this.#i?.resolve()}var o=M;if(this.#a.length>0){let e=o??=this;e.#a.push(...this.#a.filter(t=>!e.#a.includes(t)))}o!==null&&(j.add(o),o.#p()),j.has(this)||this.#g()}#m(e,t,n){e.f^=v;for(var r=e.first;r!==null;){var i=r.f,a=(i&96)!=0;if(!(a&&i&1024||i&8192||this.#c.has(r))&&r.fn!==null){a?r.f^=v:i&4?t.push(r):Pe&&i&16777224?n.push(r):Pn(r)&&(i&16&&this.#s.add(r),zn(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#h(e){for(var t=0;t<e.length;t+=1)Je(e[t],this.#o,this.#s)}capture(e,t,r=!1){t!==n&&!this.previous.has(e)&&this.previous.set(e,t),e.f&8388608||(this.current.set(e,[e.v,r]),N?.set(e,e.v))}activate(){M=this}deactivate(){M=null,N=null}flush(){try{et=!0,M=this,this.#p()}finally{rt=0,Qe=null,tt=null,nt=null,et=!1,M=null,N=null,F.clear()}}discard(){for(let e of this.#t)e(this);this.#t.clear(),j.delete(this)}#g(){for(let c of j){var e=c.id<this.id,t=[];for(let[r,[i,a]]of this.current){if(c.current.has(r)){var n=c.current.get(r)[0];if(e&&i!==n)c.current.set(r,[i,a]);else continue}t.push(r)}var r=[...c.current.keys()].filter(e=>!this.current.has(e));if(r.length===0)e&&c.discard();else if(t.length>0){c.activate();var i=new Set,a=new Map;for(var o of t)lt(o,r,i,a);if(c.#a.length>0){c.apply();for(var s of c.#a)c.#m(s,[],[]);c.#a=[]}c.deactivate()}}for(let e of j)e.#u.has(this)&&(e.#u.delete(this),e.#u.size===0&&!e.#d()&&(e.activate(),e.#p()))}increment(e,t){let n=this.#n.get(t)??0;if(this.#n.set(t,n+1),e){let e=this.#r.get(t)??0;this.#r.set(t,e+1)}}decrement(e,t,n){let r=this.#n.get(t)??0;if(r===1?this.#n.delete(t):this.#n.set(t,r-1),e){let e=this.#r.get(t)??0;e===1?this.#r.delete(t):this.#r.set(t,e-1)}this.#l||n||(this.#l=!0,He(()=>{this.#l=!1,this.flush()}))}transfer_effects(e,t){for(let t of e)this.#o.add(t);for(let e of t)this.#s.add(e);e.clear(),t.clear()}oncommit(e){this.#e.add(e)}ondiscard(e){this.#t.add(e)}settled(){return(this.#i??=_()).promise}static ensure(){if(M===null){let t=M=new e;et||(j.add(M),$e||He(()=>{M===t&&t.flush()}))}return M}apply(){if(!Pe||!this.is_fork&&j.size===1){N=null;return}N=new Map;for(let[e,[t]]of this.current)N.set(e,t);for(let n of j)if(!(n===this||n.is_fork)){var e=!1,t=!1;if(n.id<this.id)for(let[r,[,i]]of n.current)i||(e||=this.current.has(r),t||=!this.current.has(r));if(e&&t)this.#u.add(n);else for(let[e,t]of n.previous)N.has(e)||N.set(e,t)}}schedule(e){if(Qe=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var n=t.f;if(tt!==null&&t===K&&(Pe||(U===null||!(U.f&2))&&!Ye))return;if(n&96){if(!(n&1024))return;t.f^=v}}this.#a.push(t)}};function ot(e){var t=$e;$e=!0;try{var n;for(e&&(M!==null&&!M.is_fork&&M.flush(),n=e());;){if(Ue(),M===null)return n;M.flush()}}finally{$e=t}}function st(){try{_e()}catch(e){k(e,Qe)}}var P=null;function ct(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&24576)&&Pn(r)&&(P=new Set,zn(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&bn(r),P?.size>0)){F.clear();for(let e of P){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)P.has(n)&&(P.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||zn(n)}}P.clear()}}P=null}}function lt(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(let i of e.reactions){let e=i.f;e&2?lt(i,t,n,r):e&4194320&&!(e&2048)&&ut(i,t,r)&&(A(i,y),dt(i))}}function ut(e,t,n){let r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(let r of e.deps){if(o.call(t,r))return!0;if(r.f&2&&ut(r,t,n))return n.set(r,!0),!0}return n.set(e,!1),!1}function dt(e){M.schedule(e)}function ft(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),A(e,v);for(var n=e.first;n!==null;)ft(n,t),n=n.next}}function pt(e){A(e,v);for(var t=e.first;t!==null;)pt(t),t=t.next}function mt(e){let t=0,n=Pt(0),r;return()=>{rn()&&(Q(n),fn(()=>(t===0&&(r=Hn(()=>e(()=>zt(n)))),t+=1,()=>{He(()=>{--t,t===0&&(r?.(),r=void 0,zt(n))})})))}}var ht=ae|x;function gt(e,t,n,r){new _t(e,t,n,r)}var _t=class{parent;is_pending=!1;transform_error;#e;#t=T?E:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Set;#p=new Set;#m=null;#h=mt(()=>(this.#m=Pt(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=K;t.b=this,t.f|=128,n(e)},this.parent=K.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=mn(()=>{if(T){let e=this.#t;De();let t=e.data===`[!`;if(e.data.startsWith(`[?`)){let t=JSON.parse(e.data.slice(2));this.#_(t)}else t?this.#v():this.#g()}else this.#y()},ht),T&&(this.#e=E)}#g(){try{this.#a=hn(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed;t&&(this.#s=hn(()=>{t(this.#e,()=>e,()=>()=>{})}))}#v(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=hn(()=>e(this.#e)),He(()=>{var e=this.#c=document.createDocumentFragment(),t=qt();e.append(t),this.#a=this.#x(()=>hn(()=>this.#r(t))),this.#u===0&&(this.#e.before(e),this.#c=null,xn(this.#o,()=>{this.#o=null}),this.#b(M))}))}#y(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=hn(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();Cn(this.#a,e);let t=this.#n.pending;this.#o=hn(()=>t(this.#e))}else this.#b(M)}catch(e){this.error(e)}}#b(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){Je(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#x(e){var t=K,n=U,r=O;q(this.#i),G(this.#i),Ie(this.#i.ctx);try{return at.ensure(),e()}catch(e){return We(e),null}finally{q(t),G(n),Ie(r)}}#S(e,t){if(!this.has_pending_snippet()){this.parent&&this.parent.#S(e,t);return}this.#u+=e,this.#u===0&&(this.#b(t),this.#o&&xn(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))}update_pending_count(e,t){this.#S(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,He(()=>{this.#d=!1,this.#m&&It(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),Q(this.#m)}error(e){var t=this.#n.onerror;let n=this.#n.failed;if(!t&&!n)throw e;this.#a&&=(V(this.#a),null),this.#o&&=(V(this.#o),null),this.#s&&=(V(this.#s),null),T&&(D(this.#t),ke(),D(Ae()));var r=!1,i=!1;let a=()=>{if(r){Te();return}r=!0,i&&Ce(),this.#s!==null&&xn(this.#s,()=>{this.#s=null}),this.#x(()=>{this.#y()})},o=e=>{try{i=!0,t?.(e,a),i=!1}catch(e){k(e,this.#i&&this.#i.parent)}n&&(this.#s=this.#x(()=>{try{return hn(()=>{var t=K;t.b=this,t.f|=128,n(this.#e,()=>e,()=>a)})}catch(e){return k(e,this.#i.parent),null}}))};He(()=>{var t;try{t=this.transform_error(e)}catch(e){k(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(o,e=>k(e,this.#i&&this.#i.parent)):o(t)})}};function vt(e,t,n,r){let i=ze()?St:Tt;var a=e.filter(e=>!e.settled);if(n.length===0&&a.length===0){r(t.map(i));return}var o=K,s=yt(),c=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function l(e){s();try{r(e)}catch(e){o.f&16384||k(e,o)}bt()}if(n.length===0){c.then(()=>l(t.map(i)));return}var u=xt();function d(){Promise.all(n.map(e=>Ct(e))).then(e=>l([...t.map(i),...e])).catch(e=>k(e,o)).finally(()=>u())}c?c.then(()=>{s(),d(),bt()}):d()}function yt(){var e=K,t=U,n=O,r=M;return function(i=!0){q(e),G(t),Ie(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function bt(e=!0){q(null),G(null),Ie(null),e&&M?.deactivate()}function xt(){var e=K,t=e.b,n=M,r=t.is_rendered();return t.update_pending_count(1,n),n.increment(r,e),(i=!1)=>{t.update_pending_count(-1,n),n.decrement(r,e,i)}}function St(e){var t=2|y,r=U!==null&&U.f&2?U:null;return K!==null&&(K.f|=x),{ctx:O,deps:null,effects:null,equals:je,f:t,fn:e,reactions:null,rv:0,v:n,wv:0,parent:r??K,ac:null}}function Ct(e,t,r){let i=K;i===null&&pe();var a=void 0,o=Pt(n),s=!U,c=new Map;return dn(()=>{var t=K,n=_();a=n.promise;try{Promise.resolve(e()).then(n.resolve,n.reject).finally(bt)}catch(e){n.reject(e),bt()}var r=M;if(s){if(t.f&32768)var l=xt();if(i.b.is_rendered())c.get(r)?.reject(w),c.delete(r);else{for(let e of c.values())e.reject(w);c.clear()}c.set(r,n)}let u=(e,n=void 0)=>{if(l&&l(n===w),!(n===w||t.f&16384)){if(r.activate(),n)o.f|=le,It(o,n);else{o.f&8388608&&(o.f^=le),It(o,e);for(let[e,t]of c){if(c.delete(e),e===r)break;t.reject(w)}}r.deactivate()}};n.promise.then(u,e=>u(null,e||`unknown`))}),an(()=>{for(let e of c.values())e.reject(w)}),new Promise(e=>{function t(n){function r(){n===a?e(o):t(a)}n.then(r,r)}t(a)})}function wt(e){let t=St(e);return Pe||Dn(t),t}function Tt(e){let t=St(e);return t.equals=Ne,t}function Et(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)V(t[n])}}function Dt(e){for(var t=e.parent;t!==null;){if(!(t.f&2))return t.f&16384?null:t;t=t.parent}return null}function Ot(e){var t,n=K;q(Dt(e));try{e.f&=~S,Et(e),t=In(e)}finally{q(n)}return t}function kt(e){var t=e.v,n=Ot(e);if(!e.equals(n)&&(e.wv=Nn(),(!M?.is_fork||e.deps===null)&&(e.v=n,M?.capture(e,t,!0),e.deps===null))){A(e,v);return}H||(N===null?Ke(e):(rn()||M?.is_fork)&&N.set(e,n))}function At(e){if(e.effects!==null)for(let t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac?.abort(w),t.teardown=g,t.ac=null,Rn(t,0),_n(t))}function jt(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&zn(t)}var Mt=new Set,F=new Map,Nt=!1;function Pt(e,t){return{f:0,v:e,reactions:null,equals:je,rv:0,wv:0}}function I(e,t){let n=Pt(e,t);return Dn(n),n}function Ft(e,t=!1,n=!0){let r=Pt(e);return t||(r.equals=Ne),Fe&&n&&O!==null&&O.l!==null&&(O.l.s??=[]).push(r),r}function L(e,t,n=!1){return U!==null&&(!W||U.f&131072)&&ze()&&U.f&4325394&&(J===null||!o.call(J,e))&&Se(),It(e,n?Vt(t):t,nt)}function It(e,t,n=null){if(!e.equals(t)){var r=e.v;H?F.set(e,t):F.set(e,r),e.v=t;var i=at.ensure();if(i.capture(e,r),e.f&2){let t=e;e.f&2048&&Ot(t),N===null&&Ke(t)}e.wv=Nn(),Bt(e,y,n),ze()&&K!==null&&K.f&1024&&!(K.f&96)&&(Z===null?On([e]):Z.push(e)),!i.is_fork&&Mt.size>0&&!Nt&&Lt()}return t}function Lt(){Nt=!1;for(let e of Mt)e.f&1024&&A(e,b),Pn(e)&&zn(e);Mt.clear()}function Rt(e,t=1){var n=Q(e),r=t===1?n++:n--;return L(e,n),r}function zt(e){L(e,e.v+1)}function Bt(e,t,n){var r=e.reactions;if(r!==null)for(var i=ze(),a=r.length,o=0;o<a;o++){var s=r[o],c=s.f;if(!(!i&&s===K)){var l=(c&y)===0;if(l&&A(s,t),c&2){var u=s;N?.delete(u),c&65536||(c&512&&(s.f|=S),Bt(u,b,n))}else if(l){var d=s;c&16&&P!==null&&P.add(d),n===null?dt(d):n.push(d)}}}}function Vt(e){if(typeof e!=`object`||!e||C in e)return e;let t=m(e);if(t!==f&&t!==p)return e;var r=new Map,a=i(e),o=I(0),s=null,c=jn,l=e=>{if(jn===c)return e();var t=U,n=jn;G(null),Mn(c);var r=e();return G(t),Mn(n),r};return a&&r.set(`length`,I(e.length,s)),new Proxy(e,{defineProperty(e,t,n){(!(`value`in n)||n.configurable===!1||n.enumerable===!1||n.writable===!1)&&be();var i=r.get(t);return i===void 0?l(()=>{var e=I(n.value,s);return r.set(t,e),e}):L(i,n.value,!0),!0},deleteProperty(e,t){var i=r.get(t);if(i===void 0){if(t in e){let e=l(()=>I(n,s));r.set(t,e),zt(o)}}else L(i,n),zt(o);return!0},get(t,i,a){if(i===C)return e;var o=r.get(i),c=i in t;if(o===void 0&&(!c||u(t,i)?.writable)&&(o=l(()=>I(Vt(c?t[i]:n),s)),r.set(i,o)),o!==void 0){var d=Q(o);return d===n?void 0:d}return Reflect.get(t,i,a)},getOwnPropertyDescriptor(e,t){var i=Reflect.getOwnPropertyDescriptor(e,t);if(i&&`value`in i){var a=r.get(t);a&&(i.value=Q(a))}else if(i===void 0){var o=r.get(t),s=o?.v;if(o!==void 0&&s!==n)return{enumerable:!0,configurable:!0,value:s,writable:!0}}return i},has(e,t){if(t===C)return!0;var i=r.get(t),a=i!==void 0&&i.v!==n||Reflect.has(e,t);return(i!==void 0||K!==null&&(!a||u(e,t)?.writable))&&(i===void 0&&(i=l(()=>I(a?Vt(e[t]):n,s)),r.set(t,i)),Q(i)===n)?!1:a},set(e,t,i,c){var d=r.get(t),f=t in e;if(a&&t===`length`)for(var p=i;p<d.v;p+=1){var m=r.get(p+``);m===void 0?p in e&&(m=l(()=>I(n,s)),r.set(p+``,m)):L(m,n)}if(d===void 0)(!f||u(e,t)?.writable)&&(d=l(()=>I(void 0,s)),L(d,Vt(i)),r.set(t,d));else{f=d.v!==n;var h=l(()=>Vt(i));L(d,h)}var g=Reflect.getOwnPropertyDescriptor(e,t);if(g?.set&&g.set.call(c,i),!f){if(a&&typeof t==`string`){var ee=r.get(`length`),_=Number(t);Number.isInteger(_)&&_>=ee.v&&L(ee,_+1)}zt(o)}return!0},ownKeys(e){Q(o);var t=Reflect.ownKeys(e).filter(e=>{var t=r.get(e);return t===void 0||t.v!==n});for(var[i,a]of r)a.v!==n&&!(i in e)&&t.push(i);return t},setPrototypeOf(){xe()}})}var Ht,Ut,Wt,Gt;function Kt(){if(Ht===void 0){Ht=window,Ut=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Wt=u(t,`firstChild`).get,Gt=u(t,`nextSibling`).get,h(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),h(n)&&(n.__t=void 0)}}function qt(e=``){return document.createTextNode(e)}function Jt(e){return Wt.call(e)}function R(e){return Gt.call(e)}function Yt(e,t){if(!T)return Jt(e);var n=Jt(E);if(n===null)n=E.appendChild(qt());else if(t&&n.nodeType!==3){var r=qt();return n?.before(r),D(r),r}return t&&$t(n),D(n),n}function Xt(e,t=!1){if(!T){var n=Jt(e);return n instanceof Comment&&n.data===``?R(n):n}if(t){if(E?.nodeType!==3){var r=qt();return E?.before(r),D(r),r}$t(E)}return E}function z(e,t=1,n=!1){let r=T?E:e;for(var i;t--;)i=r,r=R(r);if(!T)return r;if(n){if(r?.nodeType!==3){var a=qt();return r===null?i?.after(a):r.before(a),D(a),a}$t(r)}return D(r),r}function Zt(e){e.textContent=``}function Qt(e,t,n){let r=n?{is:n}:void 0;return document.createElementNS(t??`http://www.w3.org/1999/xhtml`,e,r)}function $t(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function en(e){var t=U,n=K;G(null),q(null);try{return e()}finally{G(t),q(n)}}function tn(e){K===null&&(U===null&&ge(e),he()),H&&me(e)}function nn(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function B(e,t){var n=K;n!==null&&n.f&8192&&(e|=te);var r={ctx:O,deps:null,nodes:null,f:e|y|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null},i=r;if(e&4)tt===null?at.ensure().schedule(r):tt.push(r);else if(t!==null){try{zn(r)}catch(e){throw V(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=ae))}if(i!==null&&(i.parent=n,n!==null&&nn(i,n),U!==null&&U.f&2&&!(e&64))){var a=U;(a.effects??=[]).push(i)}return r}function rn(){return U!==null&&!W}function an(e){let t=B(8,null);return A(t,v),t.teardown=e,t}function on(e){tn(`$effect`);var t=K.f;if(!U&&t&32&&!(t&32768)){var n=O;(n.e??=[]).push(e)}else return sn(e)}function sn(e){return B(4|oe,e)}function cn(e){at.ensure();let t=B(64|x,e);return()=>{V(t)}}function ln(e){at.ensure();let t=B(64|x,e);return(e={})=>new Promise(n=>{e.outro?xn(t,()=>{V(t),n(void 0)}):(V(t),n(void 0))})}function un(e){return B(4,e)}function dn(e){return B(ce|x,e)}function fn(e,t=0){return B(8|t,e)}function pn(e,t=[],n=[],r=[]){vt(r,t,n,t=>{B(8,()=>e(...t.map(Q)))})}function mn(e,t=0){return B(16|t,e)}function hn(e){return B(32|x,e)}function gn(e){var t=e.teardown;if(t!==null){let e=H,n=U;En(!0),G(null);try{t.call(null)}finally{En(e),G(n)}}}function _n(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&en(()=>{e.abort(w)});var r=n.next;n.f&64?n.parent=null:V(n,t),n=r}}function vn(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||V(t),t=n}}function V(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(yn(e.nodes.start,e.nodes.end),n=!0),A(e,ie),_n(e,t&&!n),Rn(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();gn(e),e.f^=ie,e.f|=ne;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=e.b=null}function yn(e,t){for(;e!==null;){var n=e===t?null:R(e);e.remove(),e=n}}function bn(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function xn(e,t,n=!0){var r=[];Sn(e,r,!0);var i=()=>{n&&V(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function Sn(e,t,n){if(!(e.f&8192)){e.f^=te;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next,o=(i.f&65536)!=0||(i.f&32)!=0&&(e.f&16)!=0;Sn(i,t,o?n:!1),i=a}}}function Cn(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:R(n);t.append(n),n=i}}var wn=null,Tn=!1,H=!1;function En(e){H=e}var U=null,W=!1;function G(e){U=e}var K=null;function q(e){K=e}var J=null;function Dn(e){U!==null&&(!Pe||U.f&2)&&(J===null?J=[e]:J.push(e))}var Y=null,X=0,Z=null;function On(e){Z=e}var kn=1,An=0,jn=An;function Mn(e){jn=e}function Nn(){return++kn}function Pn(e){var t=e.f;if(t&2048)return!0;if(t&2&&(e.f&=~S),t&4096){for(var n=e.deps,r=n.length,i=0;i<r;i++){var a=n[i];if(Pn(a)&&kt(a),a.wv>e.wv)return!0}t&512&&N===null&&A(e,v)}return!1}function Fn(e,t,n=!0){var r=e.reactions;if(r!==null&&!(!Pe&&J!==null&&o.call(J,e)))for(var i=0;i<r.length;i++){var a=r[i];a.f&2?Fn(a,t,!1):t===a&&(n?A(a,y):a.f&1024&&A(a,b),dt(a))}}function In(e){var t=Y,n=X,r=Z,i=U,a=J,o=O,s=W,c=jn,l=e.f;Y=null,X=0,Z=null,U=l&96?null:e,J=null,Ie(e.ctx),W=!1,jn=++An,e.ac!==null&&(en(()=>{e.ac.abort(w)}),e.ac=null);try{e.f|=se;var u=e.fn,d=u();e.f|=re;var f=e.deps,p=M?.is_fork;if(Y!==null){var m;if(p||Rn(e,X),f!==null&&X>0)for(f.length=X+Y.length,m=0;m<Y.length;m++)f[X+m]=Y[m];else e.deps=f=Y;if(rn()&&e.f&512)for(m=X;m<f.length;m++)(f[m].reactions??=[]).push(e)}else !p&&f!==null&&X<f.length&&(Rn(e,X),f.length=X);if(ze()&&Z!==null&&!W&&f!==null&&!(e.f&6146))for(m=0;m<Z.length;m++)Fn(Z[m],e);if(i!==null&&i!==e){if(An++,i.deps!==null)for(let e=0;e<n;e+=1)i.deps[e].rv=An;if(t!==null)for(let e of t)e.rv=An;Z!==null&&(r===null?r=Z:r.push(...Z))}return e.f&8388608&&(e.f^=le),d}catch(e){return We(e)}finally{e.f^=se,Y=t,X=n,Z=r,U=i,J=a,Ie(o),W=s,jn=c}}function Ln(e,t){let n=t.reactions;if(n!==null){var r=a.call(n,e);if(r!==-1){var i=n.length-1;i===0?n=t.reactions=null:(n[r]=n[i],n.pop())}}if(n===null&&t.f&2&&(Y===null||!o.call(Y,t))){var s=t;s.f&512&&(s.f^=512,s.f&=~S),Ke(s),At(s),Rn(s,0)}}function Rn(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)Ln(e,n[r])}function zn(e){var t=e.f;if(!(t&16384)){A(e,v);var n=K,r=Tn;K=e,Tn=!0;try{t&16777232?vn(e):_n(e),gn(e);var i=In(e);e.teardown=typeof i==`function`?i:null,e.wv=kn}finally{Tn=r,K=n}}}function Q(e){var t=(e.f&2)!=0;if(wn?.add(e),U!==null&&!W&&!(K!==null&&K.f&16384)&&(J===null||!o.call(J,e))){var n=U.deps;if(U.f&2097152)e.rv<An&&(e.rv=An,Y===null&&n!==null&&n[X]===e?X++:Y===null?Y=[e]:Y.push(e));else{(U.deps??=[]).push(e);var r=e.reactions;r===null?e.reactions=[U]:o.call(r,U)||r.push(U)}}if(H&&F.has(e))return F.get(e);if(t){var i=e;if(H){var a=i.v;return(!(i.f&1024)&&i.reactions!==null||Vn(i))&&(a=Ot(i)),F.set(i,a),a}var s=(i.f&512)==0&&!W&&U!==null&&(Tn||(U.f&512)!=0),c=(i.f&re)===0;Pn(i)&&(s&&(i.f|=512),kt(i)),s&&!c&&(jt(i),Bn(i))}if(N?.has(e))return N.get(e);if(e.f&8388608)throw e.v;return e.v}function Bn(e){if(e.f|=512,e.deps!==null)for(let t of e.deps)(t.reactions??=[]).push(e),t.f&2&&!(t.f&512)&&(jt(t),Bn(t))}function Vn(e){if(e.v===n)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(F.has(t)||t.f&2&&Vn(t))return!0;return!1}function Hn(e){var t=W;try{return W=!0,e()}finally{W=t}}var Un=Symbol(`events`),Wn=new Set,Gn=new Set;function Kn(e,t,n,r={}){function i(e){if(r.capture||Zn.call(t,e),!e.cancelBubble)return en(()=>n?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?He(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function qn(e,t,n,r,i){var a={capture:r,passive:i},o=Kn(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&an(()=>{t.removeEventListener(e,o,a)})}function Jn(e,t,n){(t[Un]??={})[e]=n}function Yn(e){for(var t=0;t<e.length;t++)Wn.add(e[t]);for(var n of Gn)n(e)}var Xn=null;function Zn(e){var t=this,n=t.ownerDocument,r=e.type,i=e.composedPath?.()||[],a=i[0]||e.target;Xn=e;var o=0,s=Xn===e&&e[Un];if(s){var c=i.indexOf(s);if(c!==-1&&(t===document||t===window)){e[Un]=t;return}var u=i.indexOf(t);if(u===-1)return;c<=u&&(o=c)}if(a=i[o]||e.target,a!==t){l(e,`currentTarget`,{configurable:!0,get(){return a||n}});var d=U,f=K;G(null),q(null);try{for(var p,m=[];a!==null;){var h=a.assignedSlot||a.parentNode||a.host||null;try{var g=a[Un]?.[r];g!=null&&(!a.disabled||e.target===a)&&g.call(a,e)}catch(e){p?m.push(e):p=e}if(e.cancelBubble||h===t||h===null)break;a=h}if(p){for(let e of m)queueMicrotask(()=>{throw e});throw p}}finally{e[Un]=t,delete e.currentTarget,G(d),q(f)}}}var Qn=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function $n(e){return Qn?.createHTML(e)??e}function er(e){var t=Qt(`template`);return t.innerHTML=$n(e.replaceAll(`<!>`,`<!---->`)),t.content}function tr(e,t){var n=K;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function nr(e,t){var n=(t&1)!=0,r=(t&2)!=0,i,a=!e.startsWith(`<!>`);return()=>{if(T)return tr(E,null),E;i===void 0&&(i=er(a?e:`<!>`+e),n||(i=Jt(i)));var t=r||Ut?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=Jt(t),s=t.lastChild;tr(o,s)}else tr(t,t);return t}}function rr(e,t){if(T){var n=K;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=E),De();return}e!==null&&e.before(t)}[...`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`)];var ir=[`touchstart`,`touchmove`];function ar(e){return ir.includes(e)}function or(e,t){return lr(e,t)}function sr(e,n){Kt(),n.intro=n.intro??!1;let r=n.target,i=T,a=E;try{for(var o=Jt(r);o&&(o.nodeType!==8||o.data!==`[`);)o=R(o);if(!o)throw t;Ee(!0),D(o);let i=lr(e,{...n,anchor:o});return Ee(!1),i}catch(i){if(i instanceof Error&&i.message.split(`
|
|
2
2
|
`).some(e=>e.startsWith(`https://svelte.dev/e/`)))throw i;return i!==t&&console.warn(`Failed to hydrate: `,i),n.recover===!1&&ve(),Kt(),Zt(r),Ee(!1),or(e,n)}finally{Ee(i),D(a)}}var cr=new Map;function lr(e,{target:n,anchor:r,props:i={},events:a,context:o,intro:c=!0,transformError:l}){Kt();var u=void 0,d=ln(()=>{var c=r??n.appendChild(qt());gt(c,{pending:()=>{}},n=>{Le({});var r=O;if(o&&(r.c=o),a&&(i.$$events=a),T&&tr(n,null),u=e(n,i)||{},T&&(K.nodes.end=E,E===null||E.nodeType!==8||E.data!==`]`))throw we(),t;Re()},l);var d=new Set,f=e=>{for(var t=0;t<e.length;t++){var r=e[t];if(!d.has(r)){d.add(r);var i=ar(r);for(let e of[n,document]){var a=cr.get(e);a===void 0&&(a=new Map,cr.set(e,a));var o=a.get(r);o===void 0?(e.addEventListener(r,Zn,{passive:i}),a.set(r,1)):a.set(r,o+1)}}}};return f(s(Wn)),Gn.add(f),()=>{for(var e of d)for(let r of[n,document]){var t=cr.get(r),i=t.get(e);--i==0?(r.removeEventListener(e,Zn),t.delete(e),t.size===0&&cr.delete(r)):t.set(e,i)}Gn.delete(f),c!==r&&c.parentNode?.removeChild(c)}});return ur.set(u,d),u}var ur=new WeakMap;function dr(e,t){let n=ur.get(e);return n?(ur.delete(e),n(t)):Promise.resolve()}function fr(e,t){un(()=>{var n=e.getRootNode(),r=n.host?n:n.head??n.ownerDocument.head;if(!r.querySelector(`#`+t.hash)){let e=Qt(`style`);e.id=t.hash,e.textContent=t.code,r.appendChild(e)}})}var pr=[...`
|
|
3
|
-
\r\f\xA0\v`];function mr(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||pr.includes(r[o-1]))&&(s===r.length||pr.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function hr(e,t,n,r,i,a){var o=e.__className;if(T||o!==n||o===void 0){var s=mr(n,r,a);(!T||s!==e.getAttribute(`class`))&&(s==null?e.removeAttribute(`class`):t?e.className=s:e.setAttribute(`class`,s)),e.__className=n}else if(a&&i!==a)for(var c in a){var l=!!a[c];(i==null||l!==!!i[c])&&e.classList.toggle(c,l)}return a}var gr=Symbol(`is custom element`),_r=Symbol(`is html`),vr=fe?`link`:`LINK`;function yr(e,t,n,r){var i=br(e);T&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===vr)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[de]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&Sr(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function $(e,t,n){var r=U,i=K;let a=T;T&&Ee(!1),G(null),q(null);try{t!==`style`&&(xr.has(e.getAttribute(`is`)||e.nodeName)||!customElements||customElements.get(e.getAttribute(`is`)||e.nodeName.toLowerCase())?Sr(e).includes(t):n&&typeof n==`object`)?e[t]=n:yr(e,t,n==null?n:String(n))}finally{G(r),q(i),a&&Ee(!0)}}function br(e){return e.__attributes??={[gr]:e.nodeName.includes(`-`),[_r]:e.namespaceURI===r}}var xr=new Map;function Sr(e){var t=e.getAttribute(`is`)||e.nodeName,n=xr.get(t);if(n)return n;xr.set(t,n=[]);for(var r,i=e,a=Element.prototype;a!==i;){for(var o in r=d(i),r)r[o].set&&n.push(o);i=m(i)}return n}function Cr(e,t,n,r){var i=!Fe||(n&2)!=0,a=(n&8)!=0,o=(n&16)!=0,s=r,c=!0,l=()=>(c&&(c=!1,s=o?Hn(r):r),s);let d;if(a){var f=C in e||ue in e;d=u(e,t)?.set??(f&&t in e?n=>e[t]=n:void 0)}var p,m=!1;a?[p,m]=Ze(()=>e[t]):p=e[t],p===void 0&&r!==void 0&&(p=l(),d&&(i&&ye(t),d(p)));var h=i?()=>{var n=e[t];return n===void 0?l():(c=!0,n)}:()=>{var n=e[t];return n!==void 0&&(s=void 0),n===void 0?s:n};if(i&&!(n&4))return h;if(d){var g=e.$$legacy;return(function(e,t){return arguments.length>0?((!i||!t||g||m)&&d(t?h():e),e):h()})}var ee=!1,_=(n&1?St:Tt)(()=>(ee=!1,h()));a&&Q(_);var v=K;return(function(e,t){if(arguments.length>0){let n=t?Q(_):i&&a?Vt(e):e;return L(_,n),ee=!0,s!==void 0&&(s=n),e}return H&&ee||v.f&16384?_.v:Q(_)})}function wr(e){return new Tr(e)}var Tr=class{#e;#t;constructor(e){var t=new Map,n=(e,n)=>{var r=Ft(n,!1,!1);return t.set(e,r),r};let r=new Proxy({...e.props||{},$$events:{}},{get(e,r){return Q(t.get(r)??n(r,Reflect.get(e,r)))},has(e,r){return r===ue?!0:(Q(t.get(r)??n(r,Reflect.get(e,r))),Reflect.has(e,r))},set(e,r,i){return L(t.get(r)??n(r,i),i),Reflect.set(e,r,i)}});this.#t=(e.hydrate?sr:or)(e.component,{target:e.target,anchor:e.anchor,props:r,context:e.context,intro:e.intro??!1,recover:e.recover,transformError:e.transformError}),!Pe&&(!e?.props?.$$host||e.sync===!1)&&ot(),this.#e=r.$$events;for(let e of Object.keys(this.#t))e===`$set`||e===`$destroy`||e===`$on`||l(this,e,{get(){return this.#t[e]},set(t){this.#t[e]=t},enumerable:!0});this.#t.$set=e=>{Object.assign(r,e)},this.#t.$destroy=()=>{dr(this.#t)}}$set(e){this.#t.$set(e)}$on(e,t){this.#e[e]=this.#e[e]||[];let n=(...e)=>t.call(this,...e);return this.#e[e].push(n),()=>{this.#e[e]=this.#e[e].filter(e=>e!==n)}}$destroy(){this.#t.$destroy()}},Er;typeof HTMLElement==`function`&&(Er=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;$$shadowRoot=null;constructor(e,t,n){super(),this.$$ctor=e,this.$$s=t,n&&(this.$$shadowRoot=this.attachShadow(n))}addEventListener(e,t,n){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){let n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}super.addEventListener(e,t,n)}removeEventListener(e,t,n){if(super.removeEventListener(e,t,n),this.$$c){let e=this.$$l_u.get(t);e&&(e(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){if(await Promise.resolve(),!this.$$cn||this.$$c)return;function e(e){return t=>{let n=Qt(`slot`);e!==`default`&&(n.name=e),rr(t,n)}}let t={},n=Or(this);for(let r of this.$$s)r in n&&(r===`default`&&!this.$$d.children?(this.$$d.children=e(r),t.default=!0):t[r]=e(r));for(let e of this.attributes){let t=this.$$g_p(e.name);t in this.$$d||(this.$$d[t]=Dr(t,e.value,this.$$p_d,`toProp`))}for(let e in this.$$p_d)!(e in this.$$d)&&this[e]!==void 0&&(this.$$d[e]=this[e],delete this[e]);this.$$c=wr({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=cn(()=>{fn(()=>{this.$$r=!0;for(let e of c(this.$$c)){if(!this.$$p_d[e]?.reflect)continue;this.$$d[e]=this.$$c[e];let t=Dr(e,this.$$d[e],this.$$p_d,`toAttribute`);t==null?this.removeAttribute(this.$$p_d[e].attribute||e):this.setAttribute(this.$$p_d[e].attribute||e,t)}this.$$r=!1})});for(let e in this.$$l)for(let t of this.$$l[e]){let n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}this.$$l={}}}attributeChangedCallback(e,t,n){this.$$r||(e=this.$$g_p(e),this.$$d[e]=Dr(e,n,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 c(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function Dr(e,t,n,r){let i=n[e]?.type;if(t=i===`Boolean`&&typeof t!=`boolean`?t!=null:t,!r||!n[e])return t;if(r===`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 Or(e){let t={};return e.childNodes.forEach(e=>{t[e.slot||`default`]=!0}),t}function kr(e,t,n,r,i,a){let o=class extends Er{constructor(){super(e,n,i),this.$$p_d=t}static get observedAttributes(){return c(t).map(e=>(t[e].attribute||e).toLowerCase())}};return c(t).forEach(e=>{l(o.prototype,e,{get(){return this.$$c&&e in this.$$c?this.$$c[e]:this.$$d[e]},set(n){n=Dr(e,n,t),this.$$d[e]=n;var r=this.$$c;r&&(u(r,e)?.get?r[e]=n:r.$set({[e]:n}))}})}),r.forEach(e=>{l(o.prototype,e,{get(){return this.$$c?.[e]}})}),a&&(o=a(o)),e.element=o,o}var Ar={name:`@htmlbricks/svelte-webcomponent`,private:!0,version:`0.71.
|
|
3
|
+
\r\f\xA0\v`];function mr(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||pr.includes(r[o-1]))&&(s===r.length||pr.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function hr(e,t,n,r,i,a){var o=e.__className;if(T||o!==n||o===void 0){var s=mr(n,r,a);(!T||s!==e.getAttribute(`class`))&&(s==null?e.removeAttribute(`class`):t?e.className=s:e.setAttribute(`class`,s)),e.__className=n}else if(a&&i!==a)for(var c in a){var l=!!a[c];(i==null||l!==!!i[c])&&e.classList.toggle(c,l)}return a}var gr=Symbol(`is custom element`),_r=Symbol(`is html`),vr=fe?`link`:`LINK`;function yr(e,t,n,r){var i=br(e);T&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===vr)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[de]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&Sr(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function $(e,t,n){var r=U,i=K;let a=T;T&&Ee(!1),G(null),q(null);try{t!==`style`&&(xr.has(e.getAttribute(`is`)||e.nodeName)||!customElements||customElements.get(e.getAttribute(`is`)||e.nodeName.toLowerCase())?Sr(e).includes(t):n&&typeof n==`object`)?e[t]=n:yr(e,t,n==null?n:String(n))}finally{G(r),q(i),a&&Ee(!0)}}function br(e){return e.__attributes??={[gr]:e.nodeName.includes(`-`),[_r]:e.namespaceURI===r}}var xr=new Map;function Sr(e){var t=e.getAttribute(`is`)||e.nodeName,n=xr.get(t);if(n)return n;xr.set(t,n=[]);for(var r,i=e,a=Element.prototype;a!==i;){for(var o in r=d(i),r)r[o].set&&n.push(o);i=m(i)}return n}function Cr(e,t,n,r){var i=!Fe||(n&2)!=0,a=(n&8)!=0,o=(n&16)!=0,s=r,c=!0,l=()=>(c&&(c=!1,s=o?Hn(r):r),s);let d;if(a){var f=C in e||ue in e;d=u(e,t)?.set??(f&&t in e?n=>e[t]=n:void 0)}var p,m=!1;a?[p,m]=Ze(()=>e[t]):p=e[t],p===void 0&&r!==void 0&&(p=l(),d&&(i&&ye(t),d(p)));var h=i?()=>{var n=e[t];return n===void 0?l():(c=!0,n)}:()=>{var n=e[t];return n!==void 0&&(s=void 0),n===void 0?s:n};if(i&&!(n&4))return h;if(d){var g=e.$$legacy;return(function(e,t){return arguments.length>0?((!i||!t||g||m)&&d(t?h():e),e):h()})}var ee=!1,_=(n&1?St:Tt)(()=>(ee=!1,h()));a&&Q(_);var v=K;return(function(e,t){if(arguments.length>0){let n=t?Q(_):i&&a?Vt(e):e;return L(_,n),ee=!0,s!==void 0&&(s=n),e}return H&&ee||v.f&16384?_.v:Q(_)})}function wr(e){return new Tr(e)}var Tr=class{#e;#t;constructor(e){var t=new Map,n=(e,n)=>{var r=Ft(n,!1,!1);return t.set(e,r),r};let r=new Proxy({...e.props||{},$$events:{}},{get(e,r){return Q(t.get(r)??n(r,Reflect.get(e,r)))},has(e,r){return r===ue?!0:(Q(t.get(r)??n(r,Reflect.get(e,r))),Reflect.has(e,r))},set(e,r,i){return L(t.get(r)??n(r,i),i),Reflect.set(e,r,i)}});this.#t=(e.hydrate?sr:or)(e.component,{target:e.target,anchor:e.anchor,props:r,context:e.context,intro:e.intro??!1,recover:e.recover,transformError:e.transformError}),!Pe&&(!e?.props?.$$host||e.sync===!1)&&ot(),this.#e=r.$$events;for(let e of Object.keys(this.#t))e===`$set`||e===`$destroy`||e===`$on`||l(this,e,{get(){return this.#t[e]},set(t){this.#t[e]=t},enumerable:!0});this.#t.$set=e=>{Object.assign(r,e)},this.#t.$destroy=()=>{dr(this.#t)}}$set(e){this.#t.$set(e)}$on(e,t){this.#e[e]=this.#e[e]||[];let n=(...e)=>t.call(this,...e);return this.#e[e].push(n),()=>{this.#e[e]=this.#e[e].filter(e=>e!==n)}}$destroy(){this.#t.$destroy()}},Er;typeof HTMLElement==`function`&&(Er=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;$$shadowRoot=null;constructor(e,t,n){super(),this.$$ctor=e,this.$$s=t,n&&(this.$$shadowRoot=this.attachShadow(n))}addEventListener(e,t,n){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){let n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}super.addEventListener(e,t,n)}removeEventListener(e,t,n){if(super.removeEventListener(e,t,n),this.$$c){let e=this.$$l_u.get(t);e&&(e(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){if(await Promise.resolve(),!this.$$cn||this.$$c)return;function e(e){return t=>{let n=Qt(`slot`);e!==`default`&&(n.name=e),rr(t,n)}}let t={},n=Or(this);for(let r of this.$$s)r in n&&(r===`default`&&!this.$$d.children?(this.$$d.children=e(r),t.default=!0):t[r]=e(r));for(let e of this.attributes){let t=this.$$g_p(e.name);t in this.$$d||(this.$$d[t]=Dr(t,e.value,this.$$p_d,`toProp`))}for(let e in this.$$p_d)!(e in this.$$d)&&this[e]!==void 0&&(this.$$d[e]=this[e],delete this[e]);this.$$c=wr({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=cn(()=>{fn(()=>{this.$$r=!0;for(let e of c(this.$$c)){if(!this.$$p_d[e]?.reflect)continue;this.$$d[e]=this.$$c[e];let t=Dr(e,this.$$d[e],this.$$p_d,`toAttribute`);t==null?this.removeAttribute(this.$$p_d[e].attribute||e):this.setAttribute(this.$$p_d[e].attribute||e,t)}this.$$r=!1})});for(let e in this.$$l)for(let t of this.$$l[e]){let n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}this.$$l={}}}attributeChangedCallback(e,t,n){this.$$r||(e=this.$$g_p(e),this.$$d[e]=Dr(e,n,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 c(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function Dr(e,t,n,r){let i=n[e]?.type;if(t=i===`Boolean`&&typeof t!=`boolean`?t!=null:t,!r||!n[e])return t;if(r===`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 Or(e){let t={};return e.childNodes.forEach(e=>{t[e.slot||`default`]=!0}),t}function kr(e,t,n,r,i,a){let o=class extends Er{constructor(){super(e,n,i),this.$$p_d=t}static get observedAttributes(){return c(t).map(e=>(t[e].attribute||e).toLowerCase())}};return c(t).forEach(e=>{l(o.prototype,e,{get(){return this.$$c&&e in this.$$c?this.$$c[e]:this.$$d[e]},set(n){n=Dr(e,n,t),this.$$d[e]=n;var r=this.$$c;r&&(u(r,e)?.get?r[e]=n:r.$set({[e]:n}))}})}),r.forEach(e=>{l(o.prototype,e,{get(){return this.$$c?.[e]}})}),a&&(o=a(o)),e.element=o,o}var Ar={name:`@htmlbricks/svelte-webcomponent`,private:!0,version:`0.71.37`,type:`module`,scripts:{dev:`vite --open`,build:`vite build`,"publish:wc":`node publish.ts`,"build:wc":`node build.ts`,"watch:wc":`node watch.ts`,preview:`vite preview`,check:`svelte-check --tsconfig ./tsconfig.app.json && tsc -p tsconfig.node.json`,"release:patch":`npm version patch && git push && git push --tags && npm run build:wc && npm run publish:wc`,"release:minor":`npm version minor && git push && git push --tags && npm run build:wc && npm run publish:wc`,"release:major":`npm version major && git push && git push --tags && npm run build:wc && npm run publish:wc`},devDependencies:{"@google-pay/button-element":`^3.2.1`,"@paypal/paypal-js":`^9.5.0`,"@sveltejs/vite-plugin-svelte":`^7.0.0`,"@tsconfig/svelte":`^5.0.8`,"@types/debounce":`^1.2.4`,"@types/node":`^24.10.1`,"@types/rgb-hex":`^3.0.0`,"chart.js":`^4.5.1`,"date-holidays":`^3.26.12`,dayjs:`^1.11.20`,"hls.js":`^1.6.15`,"html5-joystick-new":`^0.0.6`,ol:`^10.8.0`,"perfect-freehand":`^1.2.3`,prettier:`^3.8.1`,"rollup-plugin-terser":`^7.0.2`,"sass-embedded":`^1.98.0`,"simple-serverless-auth-client":`^0.0.6`,"simple-webrtc-element":`^0.0.1`,"simple-webrtc-element-whep":`^0.2.3`,"style-to-object":`^1.0.14`,svelte:`^5.55.0`,"svelte-check":`^4.4.5`,terser:`^5.46.1`,"ts-json-schema-generator":`^2.9.0`,typescript:`^6.0.2`,vite:`^8.0.3`},dependencies:{"@floating-ui/dom":`^1.7.6`,"@popperjs/core":`^2.11.8`,debounce:`^3.0.0`,"html-colors":`^0.0.6`,marked:`^17.0.5`,raphael:`^2.3.0`,"rgb-hex":`^4.1.0`,"wc-js-utils":`^0.5.4`}};function jr(e){let t=e?.repoName.split(`/`)?.[1]||e?.repoName;if(!t)throw Error(`wrong componentPath `+e?.repoName);if(!e?.version)throw Error(`wrong version `+e?.version);let n=e?.iifePath||`main.iife.js`;if(!document.getElementById(t+`-script`)&&!customElements?.get?.(t)&&!window?.customElements?.get?.(t))try{let r=document.createElement(`script`);if(r.id=t+`-script`,r.src=`https://cdn.jsdelivr.net/npm/${e.repoName}@${e.version}/${n}`,e?.local)r.src=`${e.local}`;else if(location.href.includes(`localhost:6006`)){let e=t.split(`-`)[0];r.src=`http://localhost:6006/webcomponents/${t.replace(e+`-`,``)}/${n}`}document.head.appendChild(r)}catch(e){console.warn(e)}}var Mr=nr(`<div part="controller" id="controller" class="svelte-1swbd4i"><button class="svelte-1swbd4i">clear</button> <button class="svelte-1swbd4i">select</button> <button class="svelte-1swbd4i">draw</button> <button class="svelte-1swbd4i">undo</button> <button class="svelte-1swbd4i">redo</button> <button class="svelte-1swbd4i">save</button> <button class="svelte-1swbd4i">brush</button> <br class="svelte-1swbd4i"/>load:<hb-input-file></hb-input-file> insert:<hb-input-file></hb-input-file></div> <div part="paper-container" id="paper-container" class="svelte-1swbd4i"><hb-stylus-paper></hb-stylus-paper></div>`,3),Nr={hash:`svelte-1swbd4i`,code:`@charset "UTF-8";
|
|
4
4
|
/*!
|
|
5
5
|
* Bulma 1.x (Sass) for hb-stylus-notebook — :host theme tokens only (notebook shell is custom CSS).
|
|
6
6
|
*/
|