@atom.io/template-preact-svg-editor 0.0.77 → 0.0.79
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/.turbo/turbo-build.log +2 -2
- package/CHANGELOG.md +17 -0
- package/LICENSE +201 -0
- package/package.json +9 -8
- package/dist/assets/index-C7fFu3CN.js +0 -5
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
$ vite build
|
|
2
|
-
[36mvite v8.
|
|
2
|
+
[36mvite v8.2.0 [32mbuilding client environment for production...[36m[39m
|
|
3
3
|
[2K
|
|
4
4
|
rendering chunks...
|
|
5
5
|
computing gzip size...
|
|
@@ -7,4 +7,4 @@ dist/index.html 0.52 kB │ gzip: 0.32 kB
|
|
|
7
7
|
dist/assets/index-BNVXGhU4.css 1.58 kB │ gzip: 0.72 kB
|
|
8
8
|
dist/assets/index-C7fFu3CN.js 82.55 kB │ gzip: 25.73 kB
|
|
9
9
|
|
|
10
|
-
[32m✓ built in
|
|
10
|
+
[32m✓ built in 165ms[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atom.io/template-preact-svg-editor
|
|
2
2
|
|
|
3
|
+
## 0.0.79
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 53686a9: License `atom.io` and `create-atom.io` under MPL 2.0, while licensing the
|
|
8
|
+
project templates under Apache License 2.0. Document MPL's consumer-friendly,
|
|
9
|
+
file-level copyleft boundaries.
|
|
10
|
+
- Updated dependencies [53686a9]
|
|
11
|
+
- atom.io@0.50.2
|
|
12
|
+
|
|
13
|
+
## 0.0.78
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [b14a9b6]
|
|
18
|
+
- atom.io@0.50.1
|
|
19
|
+
|
|
3
20
|
## 0.0.77
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atom.io/template-preact-svg-editor",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.79",
|
|
4
|
+
"license": "Apache-2.0",
|
|
4
5
|
"publishConfig": {
|
|
5
6
|
"access": "public"
|
|
6
7
|
},
|
|
@@ -14,17 +15,17 @@
|
|
|
14
15
|
"preact": "10.29.7",
|
|
15
16
|
"react": "npm:@preact/compat@18.3.2",
|
|
16
17
|
"react-dom": "npm:@preact/compat@18.3.2",
|
|
17
|
-
"atom.io": "0.50.
|
|
18
|
+
"atom.io": "0.50.2"
|
|
18
19
|
},
|
|
19
20
|
"devDependencies": {
|
|
20
|
-
"@eslint-react/eslint-plugin": "5.
|
|
21
|
-
"@preact/preset-vite": "2.10.
|
|
22
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
23
|
-
"@typescript-eslint/parser": "8.
|
|
21
|
+
"@eslint-react/eslint-plugin": "5.18.1",
|
|
22
|
+
"@preact/preset-vite": "2.10.6",
|
|
23
|
+
"@typescript-eslint/eslint-plugin": "8.65.0",
|
|
24
|
+
"@typescript-eslint/parser": "8.65.0",
|
|
24
25
|
"eslint-plugin-import-x": "4.17.1",
|
|
25
|
-
"eslint-plugin-simple-import-sort": "
|
|
26
|
+
"eslint-plugin-simple-import-sort": "14.0.0",
|
|
26
27
|
"typescript": "7.0.2",
|
|
27
|
-
"vite": "8.
|
|
28
|
+
"vite": "8.2.0"
|
|
28
29
|
},
|
|
29
30
|
"scripts": {
|
|
30
31
|
"dev": "vite",
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h={},g=[],_=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,v=Array.isArray;function y(e,t){for(var n in t)e[n]=t[n];return e}function ee(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function b(t,n,r){var i,a,o,s={};for(o in n)o==`key`?i=n[o]:o==`ref`?a=n[o]:s[o]=n[o];if(arguments.length>2&&(s.children=arguments.length>3?e.call(arguments,2):r),typeof t==`function`&&t.defaultProps!=null)for(o in t.defaultProps)s[o]===void 0&&(s[o]=t.defaultProps[o]);return x(t,s,i,a,null)}function x(e,r,i,a,o){var s={type:e,props:r,key:i,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++n,__i:-1,__u:0};return o==null&&t.vnode!=null&&t.vnode(s),s}function S(e){return e.children}function C(e,t){this.props=e,this.context=t}function w(e,t){if(t==null)return e.__?w(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?w(e):null}function T(e){if(e.__P&&e.__d){var n=e.__v,r=n.__e,i=[],a=[],o=y({},n);o.__v=n.__v+1,t.vnode&&t.vnode(o),se(e.__P,o,n,e.__n,e.__P.namespaceURI,32&n.__u?[r]:null,i,r??w(n),!!(32&n.__u),a),o.__v=n.__v,o.__.__k[o.__i]=o,le(i,o,a),n.__e=n.__=null,o.__e!=r&&E(o)}}function E(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),E(e)}function D(e){(!e.__d&&(e.__d=!0)&&r.push(e)&&!O.__r++||i!=t.debounceRendering)&&((i=t.debounceRendering)||a)(O)}function O(){try{for(var e,t=1;r.length;)r.length>t&&r.sort(o),e=r.shift(),t=r.length,T(e)}finally{r.length=O.__r=0}}function te(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,_,v,y,ee=r&&r.__k||g,b=t.length;for(c=ne(n,t,ee,c,b),d=0;d<b;d++)(p=n.__k[d])!=null&&(f=p.__i!=-1&&ee[p.__i]||h,p.__i=d,v=se(e,p,f,i,a,o,s,c,l,u),m=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&fe(f.ref,null,p),u.push(p.ref,p.__c||m,p)),_==null&&m!=null&&(_=m),(y=!!(4&p.__u))||f.__k===p.__k?(c=re(p,c,e,y),y&&f.__e&&(f.__e=null)):typeof p.type==`function`&&v!==void 0?c=v:m&&(c=m.nextSibling),p.__u&=-7);return n.__e=_,c}function ne(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?o=e.__k[a]=x(null,o,null,null,null):v(o)?o=e.__k[a]=x(S,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=e.__k[a]=x(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[a]=o,c=a+f,o.__=e,o.__b=e.__b+1,s=null,(l=o.__i=A(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=w(s)),pe(s,s));return r}function re(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=re(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=w(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function k(e,t){return t||=[],e==null||typeof e==`boolean`||(v(e)?e.some(function(e){k(e,t)}):t.push(e)),t}function A(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&(2&l.__u)==0;if(l===null&&s==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function ie(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n==null?``:typeof n!=`number`||_.test(t)?n:n+`px`}function ae(e,t,n,r,i){var a,o;n:if(t==`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||ie(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||ie(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(u,`$1`)),o=t.toLowerCase(),t=o in e||t==`onFocusOut`||t==`onFocusIn`?o.slice(2):t.slice(2),e.l||={},e.l[t+a]=n,n?r?n[l]=r[l]:(n[l]=d,e.addEventListener(t,a?p:f,a)):e.removeEventListener(t,a?p:f,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function oe(e){return function(n){if(this.l){var r=this.l[n.type+e];if(n[c]==null)n[c]=d++;else if(n[c]<r[l])return;return r(t.event?t.event(n):n)}}}function se(e,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,_,b,x,w,T,E,D,O,ne,re,k,A=n.type;if(n.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),o=[c=n.__e=r.__e]),(d=t.__b)&&d(n);n:if(typeof A==`function`){f=s.length;try{if(w=n.props,T=A.prototype&&A.prototype.render,E=(d=A.contextType)&&i[d.__c],D=d?E?E.props.value:d.__:i,r.__c?x=(p=n.__c=r.__c).__=p.__E:(T?n.__c=p=new A(w,D):(n.__c=p=new C(w,D),p.constructor=A,p.render=me),E&&E.sub(p),p.state||={},p.__n=i,m=p.__d=!0,p.__h=[],p._sb=[]),T&&p.__s==null&&(p.__s=p.state),T&&A.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=y({},p.__s)),y(p.__s,A.getDerivedStateFromProps(w,p.__s))),h=p.props,_=p.state,p.__v=n,m)T&&A.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),T&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(T&&A.getDerivedStateFromProps==null&&w!==h&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(w,D),n.__v==r.__v||!p.__e&&p.shouldComponentUpdate!=null&&!1===p.shouldComponentUpdate(w,p.__s,D)){n.__v!=r.__v&&(p.props=w,p.state=p.__s,p.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.some(function(e){e&&(e.__=n)}),g.push.apply(p.__h,p._sb),p._sb=[],p.__h.length&&s.push(p);break n}p.componentWillUpdate!=null&&p.componentWillUpdate(w,p.__s,D),T&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(h,_,b)})}if(p.context=D,p.props=w,p.__P=e,p.__e=!1,O=t.__r,ne=0,T)p.state=p.__s,p.__d=!1,O&&O(n),d=p.render(p.props,p.state,p.context),g.push.apply(p.__h,p._sb),p._sb=[];else do p.__d=!1,O&&O(n),d=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++ne<25);p.state=p.__s,p.getChildContext!=null&&(i=y(y({},i),p.getChildContext())),T&&!m&&p.getSnapshotBeforeUpdate!=null&&(b=p.getSnapshotBeforeUpdate(h,_)),re=d!=null&&d.type===S&&d.key==null?ue(d.props.children):d,c=te(e,v(re)?re:[re],n,r,i,a,o,s,c,l,u),p.base=n.__e,n.__u&=-161,p.__h.length&&s.push(p),x&&(p.__E=p.__=null)}catch(e){if(s.length=f,n.__v=null,l||o!=null){if(e.then){for(n.__u|=l?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;o!=null&&(o[o.indexOf(c)]=null),n.__e=c}else if(o!=null)for(k=o.length;k--;)ee(o[k])}else n.__e=r.__e;n.__k??=r.__k||[],e.then||ce(n),t.__e(e,n,r)}}else o==null&&n.__v==r.__v?(n.__k=r.__k,n.__e=r.__e):c=n.__e=de(r.__e,n,r,i,a,o,s,l,u);return(d=t.diffed)&&d(n),128&n.__u?void 0:c}function ce(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(ce))}function le(e,n,r){for(var i=0;i<r.length;i++)fe(r[i],r[++i],r[++i]);t.__c&&t.__c(n,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(e){e.call(n)})}catch(e){t.__e(e,n.__v)}})}function ue(e){return typeof e!=`object`||!e||e.__b>0?e:v(e)?e.map(ue):e.constructor===void 0?y({},e):null}function de(n,r,i,a,o,s,c,l,u){var d,f,p,m,g,_,y,b=i.props||h,x=r.props,S=r.type;if(S==`svg`?o=`http://www.w3.org/2000/svg`:S==`math`?o=`http://www.w3.org/1998/Math/MathML`:o||=`http://www.w3.org/1999/xhtml`,s!=null){for(d=0;d<s.length;d++)if((g=s[d])&&`setAttribute`in g==!!S&&(S?g.localName==S:g.nodeType==3)){n=g,s[d]=null;break}}if(n==null){if(S==null)return document.createTextNode(x);n=document.createElementNS(o,S,x.is&&x),l&&=(t.__m&&t.__m(r,s),!1),s=null}if(S==null)b===x||l&&n.data==x||(n.data=x);else{if(s=S==`textarea`&&x.defaultValue!=null?null:s&&e.call(n.childNodes),!l&&s!=null)for(b={},d=0;d<n.attributes.length;d++)b[(g=n.attributes[d]).name]=g.value;for(d in b)g=b[d],d==`dangerouslySetInnerHTML`?p=g:d==`children`||d in x||d==`value`&&`defaultValue`in x||d==`checked`&&`defaultChecked`in x||ae(n,d,null,g,o);for(d in x)g=x[d],d==`children`?m=g:d==`dangerouslySetInnerHTML`?f=g:d==`value`?_=g:d==`checked`?y=g:l&&typeof g!=`function`||b[d]===g||ae(n,d,g,b[d],o);if(f)l||p&&(f.__html==p.__html||f.__html==n.innerHTML)||(n.innerHTML=f.__html),r.__k=[];else if(p&&(n.innerHTML=``),te(r.type==`template`?n.content:n,v(m)?m:[m],r,i,a,S==`foreignObject`?`http://www.w3.org/1999/xhtml`:o,s,c,s?s[0]:i.__k&&w(i,0),l,u),s!=null)for(d=s.length;d--;)ee(s[d]);l&&S!=`textarea`||(d=`value`,S==`progress`&&_==null?n.removeAttribute(`value`):_!=null&&(_!==n[d]||S==`progress`&&!_||S==`option`&&_!=b[d])&&ae(n,d,_,b[d],o),d=`checked`,y!=null&&y!=n[d]&&ae(n,d,y,b[d],o))}return n}function fe(e,n,r){try{if(typeof e==`function`){var i=typeof e.__u==`function`;i&&e.__u(),i&&n==null||(e.__u=e(n))}else e.current=n}catch(e){t.__e(e,r)}}function pe(e,n,r){var i,a;if(t.unmount&&t.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||fe(i,null,n)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){t.__e(e,n)}i.base=i.__P=i.__n=null}if(i=e.__k)for(a=0;a<i.length;a++)i[a]&&pe(i[a],n,r||typeof e.type!=`function`);r||ee(e.__e),e.__c=e.__=e.__e=void 0}function me(e,t,n){return this.constructor(e,n)}function he(n,r,i){var a,o,s,c;r==document&&(r=document.documentElement),t.__&&t.__(n,r),o=(a=typeof i==`function`)?null:i&&i.__k||r.__k,s=[],c=[],se(r,n=(!a&&i||r).__k=b(S,null,[n]),o||h,h,r.namespaceURI,!a&&i?[i]:o?null:r.firstChild?e.call(r.childNodes):null,s,!a&&i?i:o?o.__e:r.firstChild,a,c),le(s,n,c),n.props.children=null}function ge(e){function t(e){var n,r;return this.getChildContext||(n=new Set,(r={})[t.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach(function(e){e.__e=!0,D(e)})},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}return t.__c=`__cC`+m++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}e=g.slice,t={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},n=0,C.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=y({},this.state);typeof e==`function`&&(e=e(y({},n),this.props)),e&&y(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),D(this))},C.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),D(this))},C.prototype.render=S,r=[],a=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,o=function(e,t){return e.__v.__b-t.__v.__b},O.__r=0,s=Math.random().toString(8),c=`__d`+s,l=`__a`+s,u=/(PointerCapture)$|Capture$/i,d=0,f=oe(!1),p=oe(!0),m=0;function j(e){return JSON.parse(e)}var M=e=>JSON.stringify(e);Array.prototype,Boolean.prototype,Number.prototype,String.prototype;var N=class{Subscriber;subscribers=new Map;subscribe(e,t){return this.subscribers.set(e,t),()=>{this.unsubscribe(e)}}unsubscribe(e){this.subscribers.delete(e)}next(e){let t=this.subscribers.values();for(let n of t)n(e)}},_e=class extends N{state;constructor(e){super(),this.state=e}next(e){this.state=e,super.next(e)}},ve=``,ye=``,be=``,xe=``;function Se(e){if(e===null)return ye;switch(typeof e){case`string`:return be+e;case`number`:return xe+e;case`boolean`:return ve+ +e;case`object`:return JSON.stringify(e)}}function Ce(e){switch(e[0]){case be:return e.slice(1);case xe:return+e.slice(1);case ve:return e.slice(1)===`1`;case ye:return null;case`[`:return JSON.parse(e)}}function we(e){let t={},n=0;for(let r of e)t[r]=n,t[n]=r,++n;return t}var Te=we([`add`,`delete`,`clear`]),Ee=class e extends Set{mode=`record`;subject=new N;constructor(t){super(t),t instanceof e}READONLY_VIEW=this;toJSON(){return[...this]}static fromJSON(t){return new e(t)}add(e){let t=super.add(e);return this.mode===`record`&&this.emit({type:`add`,value:e}),t}clear(){let e=this.mode===`record`?[...this]:null;super.clear(),e&&this.emit({type:`clear`,values:e})}delete(e){let t=super.delete(e);return this.mode===`record`&&this.emit({type:`delete`,value:e}),t}subscribe(e,t){return this.subject.subscribe(e,t)}emit(t){this.subject.next(e.packUpdate(t))}do(t){this.mode=`playback`;let n=e.unpackUpdate(t);switch(n.type){case`add`:this.add(n.value);break;case`delete`:this.delete(n.value);break;case`clear`:this.clear()}return this.mode=`record`,null}undo(t){let n=e.unpackUpdate(t);switch(this.mode=`playback`,n.type){case`add`:this.delete(n.value);break;case`delete`:this.add(n.value);break;case`clear`:{let e=n.values;for(let t of e)this.add(t)}}return this.mode=`record`,null}static packUpdate(e){let t=Te[e.type]+``;return e.type===`clear`?t+e.values.map(Se).join(``):t+Se(e.value)}static unpackUpdate(e){let[t,n]=e.split(``),r=Te[t];return r===`clear`?{type:`clear`,values:n.split(``).map(Ce)}:{type:r,value:Ce(n)}}},P=class extends Map{deleted=new Set;changed=new Set;source;appendedSource=new Set;sourceCleared=!1;constructor(e){super(),this.source=e}get(e){if(super.has(e))return super.get(e);if(!this.deleted.has(e)&&this.source.has(e))return this.source.get(e)}getOrInsert(e,t){return this.has(e)?this.get(e):(this.set(e,t),t)}getOrInsertComputed(e,t){if(this.has(e))return this.get(e);let n=t(e);return this.set(e,n),n}set(e,t){let n=this.appendedSource.has(e)||this.sourceCleared&&this.deleted.has(e);return this.source.has(e)&&n?(this.deleted.delete(e),this.changed.delete(e),this.appendedSource.add(e)):this.source.has(e)&&(this.deleted.delete(e),this.appendedSource.delete(e),this.changed.add(e)),super.set(e,t)}hasOwn(e){return super.has(e)}has(e){return super.has(e)?!0:!this.deleted.has(e)&&this.source.has(e)}delete(e){return this.source.has(e)?(this.deleted.add(e),this.changed.delete(e),this.appendedSource.delete(e),super.delete(e),!0):super.delete(e)}clear(){this.deleted=new Set(this.source.keys()),this.appendedSource.clear(),this.changed.clear(),this.sourceCleared=!0,super.clear()}*[Symbol.iterator](){for(let[e,t]of this.source)this.deleted.has(e)||this.appendedSource.has(e)||(this.changed.has(e)?yield[e,super.get(e)]:yield[e,t]);for(let e of super[Symbol.iterator]())this.changed.has(e[0])||(yield e)}*entries(){yield*this[Symbol.iterator]()}*keys(){for(let e of this.source.keys())!this.deleted.has(e)&&!this.appendedSource.has(e)&&(yield e);for(let e of super.keys())this.changed.has(e)||(yield e)}*values(){for(let[,e]of this[Symbol.iterator]())yield e}forEach(e,t){for(let[n,r]of this[Symbol.iterator]())e.call(t,r,n,this)}get size(){return super.size+this.source.size-this.changed.size-this.deleted.size-this.appendedSource.size}};function*De(e){let t=e.keys();for(let e=t.next();!e.done;e=t.next())yield e.value}var Oe=class extends Set{deleted=new Set;source;appendedSource=new Set;sourceCleared=!1;constructor(e){super(),this.source=e}add(e){let t=this.appendedSource.has(e)||this.sourceCleared&&this.deleted.has(e);return this.source.has(e)&&t?(this.deleted.delete(e),this.appendedSource.add(e),super.add(e)):this.source.has(e)?(this.deleted.delete(e),this.appendedSource.delete(e),this):super.add(e)}hasOwn(e){return super.has(e)}has(e){return super.has(e)||!this.deleted.has(e)&&this.source.has(e)}delete(e){return this.source.has(e)?(this.deleted.add(e),this.appendedSource.delete(e),super.delete(e),!0):super.delete(e)}clear(){this.deleted=new Set(this.source),this.appendedSource.clear(),this.sourceCleared=!0,super.clear()}*[Symbol.iterator](){for(let e of this.source)!this.deleted.has(e)&&!this.appendedSource.has(e)&&(yield e);yield*super[Symbol.iterator]()}*keys(){yield*this[Symbol.iterator]()}*values(){yield*this[Symbol.iterator]()}*entries(){for(let e of this[Symbol.iterator]())yield[e,e]}forEach(e,t){for(let n of this[Symbol.iterator]())e.call(t,n,n,this)}union(e){let t=new Set(this);for(let n of De(e))t.add(n);return t}intersection(e){let t=new Set,n=e,r=this;if(this.size<=e.size)for(let e of this)n.has(e)&&t.add(e);else for(let n of De(e))r.has(n)&&t.add(n);return t}difference(e){let t=new Set,n=e;if(this.size<=e.size)for(let e of this)n.has(e)||t.add(e);else{for(let e of this)t.add(e);for(let n of De(e))t.delete(n)}return t}symmetricDifference(e){let t=new Set(this);for(let n of De(e))t.has(n)?t.delete(n):t.add(n);return t}isSubsetOf(e){if(this.size>e.size)return!1;for(let t of this)if(!e.has(t))return!1;return!0}isSupersetOf(e){if(this.size<e.size)return!1;for(let t of De(e))if(!this.has(t))return!1;return!0}isDisjointFrom(e){if(this.size<=e.size){for(let t of this)if(e.has(t))return!1}else for(let t of De(e))if(this.has(t))return!1;return!0}*iterateOwn(){yield*super[Symbol.iterator]()}get size(){return super.size+this.source.size-this.deleted.size-this.appendedSource.size}},ke=class extends Promise{fate;resolve;reject;done=!1;constructor(e){let t,n;super((e,r)=>{t=e,n=r}),this.resolve=t,this.reject=n,this.use(e instanceof Promise?e:new Promise(e))}pass(e,t){e===this.fate&&(this.resolve(t),this.done=!0)}fail(e,t){e===this.fate&&(this.reject(t),this.done=!0)}use(e){if(this!==e)if(e instanceof Promise){let t=e;this.fate=t,t.then(e=>{this.pass(t,e)},e=>{this.fail(t,e)})}else this.resolve(e),this.fate=void 0}},Ae=class extends Map{deleted=new Set;source;constructor(e){super(),this.source=e}get(e){if(super.has(e))return super.get(e);if(!this.deleted.has(e)&&this.source.has(e)){let t=new Oe(this.source.get(e));return super.set(e,t),t}}set(e,t){return this.deleted.delete(e),super.set(e,t)}has(e){return!this.deleted.has(e)&&(super.has(e)||this.source.has(e))}delete(e){return this.deleted.add(e),super.delete(e)}},F=class e{a;b;cardinality;relations=new Map;contents=new Map;isAType;isBType;isContent;makeContentKey=(e,t)=>`${e}:${t}`;warn;getRelatedKeys(e){return this.relations.get(e)}addRelation(e,t){let n=this.relations.get(e),r=this.relations.get(t);n?n.add(t):(n=new Set([t]),this.relations.set(e,n)),r?r.add(e):(r=new Set([e]),this.relations.set(t,r))}deleteRelation(e,t){let n=this.relations.get(e);if(n){n.delete(t),n.size===0&&this.relations.delete(e);let r=this.relations.get(t);r&&(r.delete(e),r.size===0&&this.relations.delete(t))}}replaceRelationsUnsafely(e,t){this.relations.set(e,new Set(t));for(let n of t){let t=new Set().add(e);this.relations.set(n,t)}}replaceRelationsSafely(e,t){let n=this.relations.get(e),r=this.isAType?.(e)?e:void 0,i=r===void 0?e:void 0;if(n)for(let t of n){r??=t,i??=t;let n=this.relations.get(t);n&&(n.size===1?this.relations.delete(t):n.delete(e),this.contents.delete(this.makeContentKey(r,i)))}this.relations.set(e,new Set(t));for(let n of t){let t=this.relations.get(n);t?t.add(e):(t=new Set().add(e),this.relations.set(n,t))}}getContentInternal(e){return this.contents.get(e)}setContent(e,t){this.contents.set(e,t)}deleteContent(e){this.contents.delete(e)}constructor(e,t){if(this.a=e.between[0],this.b=e.between[1],this.cardinality=e.cardinality,this.isAType=t?.isAType??null,this.isBType=t?.isBType??null,this.isContent=t?.isContent??null,t?.makeContentKey&&(this.makeContentKey=t.makeContentKey),!t?.externalStore){let n=t?.source;n===void 0&&(this.relations=new Map(e.relations?.map(([e,t])=>[e,new Set(t)])),this.contents=new Map(e.contents)),n&&(this.relations=new Ae(n.relations),this.contents=new P(n.contents))}if(t?.externalStore){let n=t.externalStore;this.has=(e,t)=>n.has(e,t),this.addRelation=(e,t)=>{n.addRelation(e,t)},this.deleteRelation=(e,t)=>{n.deleteRelation(e,t)},this.replaceRelationsSafely=(e,t)=>{n.replaceRelationsSafely(e,t)},this.replaceRelationsUnsafely=(e,t)=>{n.replaceRelationsUnsafely(e,t)},this.getRelatedKeys=(e=>n.getRelatedKeys(e)),n.getContent&&(this.getContentInternal=e=>n.getContent(e),this.setContent=(e,t)=>{n.setContent(e,t)},this.deleteContent=e=>{n.deleteContent(e)});for(let[t,n]of e.relations??[]){let e=this.isAType?.(t)?t:void 0,r=e===void 0?t:void 0;for(let t of n)e??=t,r??=t,this.addRelation(e,r)}for(let[t,n]of e.contents??[])this.setContent(t,n)}t?.warn&&(this.warn=t.warn)}toJSON(){return{between:[this.a,this.b],cardinality:this.cardinality,relations:[...this.relations.entries()].map(([e,t])=>[e,[...t]]),contents:[...this.contents.entries()]}}set(...e){let t,n,r;switch(e.length){case 1:{let i=e[0];t=i[this.a],n=i[this.b],r=void 0;break}case 2:{let i=e[0];typeof i==`string`?[t,n]=e:(t=i[this.a],n=i[this.b],r=e[1]);break}default:t=e[0],n=e[1],r=e[2];break}switch(this.cardinality){case`1:1`:{let e=this.getRelatedKey(t);e&&e!==n&&this.delete(t,e)}case`1:n`:{let e=this.getRelatedKey(n);e&&e!==t&&this.delete(e,n)}break;case`n:n`:}if(r){let e=this.makeContentKey(t,n);this.setContent(e,r)}return this.addRelation(t,n),this}delete(e,t){t=typeof t==`string`?t:e[this.b];let n=typeof e==`string`?e:e[this.a];if(n===void 0&&typeof t==`string`){let e=this.getRelatedKeys(t);if(e)for(let n of e)this.delete(n,t)}else if(typeof n==`string`&&t===void 0){let e=this.getRelatedKeys(n);if(e)for(let t of e)this.delete(n,t)}else if(typeof n==`string`&&typeof t==`string`){this.deleteRelation(n,t);let e=this.makeContentKey(n,t);this.deleteContent(e)}return this}getRelatedKey(e){let t=this.getRelatedKeys(e);if(t){t.size>1&&this.warn?.(`${t.size} related keys were found for key "${e}": (${[...t].map(e=>`"${e}"`).join(`, `)}). Only one related key was expected.`);let n;for(let e of t){n=e;break}return n}}replaceRelations(e,t,n){let r=!Array.isArray(t),i=r?Object.keys(t):t;if(n?.reckless?this.replaceRelationsUnsafely(e,i):this.replaceRelationsSafely(e,i),r)for(let n of i){let r=this.makeContentKey(e,n),i=t[n];this.setContent(r,i)}return this}getContent(e,t){let n=this.makeContentKey(e,t);return this.getContentInternal(n)}getRelationEntries(e){let t=e[this.a],n=e[this.b];if(t!==void 0&&n===void 0){let e=this.getRelatedKeys(t);if(e)return[...e].map(e=>[e,this.getContent(t,e)])}if(t===void 0&&n!==void 0){let e=this.getRelatedKeys(n);if(e)return[...e].map(e=>[e,this.getContent(e,n)])}return[]}has(e,t){return t?this.getRelatedKeys(e)?.has(t)??!1:this.relations.has(e)}overlay(){let t={source:this,makeContentKey:this.makeContentKey};return this.isAType&&(t.isAType=this.isAType),this.isBType&&(t.isBType=this.isBType),this.isContent&&(t.isContent=this.isContent),this.warn&&(t.warn=this.warn),new e({between:[this.a,this.b],cardinality:this.cardinality},t)}incorporate(e){let{relations:t,contents:n}=e;for(let[e,n]of t)if(n instanceof Oe){let{source:e}=n;for(let t of n.iterateOwn())e.add(t)}else this.relations.set(e,n);for(let e of t.deleted)this.relations.delete(e);for(let[e,t]of n)this.contents.set(e,t);for(let e of n.deleted)this.contents.delete(e)}};function je(e=Math.random){return e().toString(36).slice(2)}function I(e){let t=e;for(;t.child!==null;)t=t.child;return t}function Me(e){let t=e;for(;t.parent!==null;)t=t.parent;return t}var Ne=/^\[object (?:Async|Generator|AsyncGenerator)?Function\]$/;function L(e){let t=Object.prototype.toString.call(e);return Ne.test(t)}function Pe(e,t){return L(e)?e(t):e}var Fe=class e{_buffer;_index=0;constructor(e){let t;t=typeof e==`number`?e:e.length,this._buffer=Array.from({length:t})}get buffer(){return this._buffer}get index(){return this._index}add(e){this._buffer[this._index]=e,this._index=(this._index+1)%this._buffer.length}copy(){let t=new e([...this._buffer]);return t._index=this._index,t}};function R(e){let t={key:e.key,type:e.type};return`family`in e&&(t.family=e.family),t}function Ie(e){return e.startsWith(`🔍 `)}function Le(e){e.logger.info(`🪂`,`transaction`,e.transactionMeta.update.token.key,`Aborting transaction`),e.parent.child=null}function Re(e,t,n){return(...r)=>H(e,t).run(r,n)}function ze(e,t,n){let{token:r,update:{newValue:i,oldValue:a}}=t;K(e,r,n===`newValue`?i:a)}function Be(e,t){return H(e,{key:t.family.key,type:`${t.type}_family`})}var Ve={atom_family:`atom`,molecule_family:`molecule`,mutable_atom_family:`mutable_atom`,readonly_held_selector_family:`readonly_held_selector`,readonly_pure_selector_family:`readonly_pure_selector`,writable_held_selector_family:`writable_held_selector`,writable_pure_selector_family:`writable_pure_selector`},He=Symbol(`MUST_CREATE`),Ue=Symbol(`DO_NOT_CREATE`);function We(e,t,n,r){let i=M(r),a=t.molecules.get(i);if(!a&&t.config.lifespan===`immortal`){let{type:e,key:r}=n;return t.logger.warn(`💣`,`key`,i,`was used to mint a counterfeit token for`,e,`"${r}"`),{counterfeit:!0,key:`${r}(${i})`,type:Ve[e],family:{key:r,subKey:i}}}let o;if(e===He)t.logger.info(`👪`,n.type,n.key,`adds member`,typeof r==`string`?`\`${r}\``:r),o=n.create(r),a&&t.moleculeData.set(i,n.key);else{let{type:e,key:t}=n;return{key:`${t}(${i})`,type:Ve[e],family:{key:t,subKey:i}}}return o}function Ge(e,...t){let n,r,i,a,o;if(t.length===1){if(o=t[0],`family`in o){let t=Be(e,o);if(i=H(e,t),a=j(o.family.subKey),n=St(e,t,a),`counterfeit`in o)return{token:o,family:i,subKey:a};n?o=n:(r=We(He,e,t,a),o=r)}}else i=H(e,t[0]),a=t[1],n=St(e,i,a),n?o=n:(r=We(He,e,i,a),o=r);let s=`counterfeit`in o;if(r&&s===!1&&i){switch(o.type){case`readonly_pure_selector`:case`readonly_held_selector`:break;case`atom`:case`mutable_atom`:case`writable_pure_selector`:case`writable_held_selector`:break}let t={type:`atom_creation`,token:o,timestamp:Date.now()};`subject`in i&&i.subject.next(t);let n=I(e);if(o.family)if(at(n))switch(o.type){case`atom`:case`mutable_atom`:e.on.atomCreation.next(o);break;case`writable_pure_selector`:case`readonly_pure_selector`:case`writable_held_selector`:case`readonly_held_selector`:e.on.selectorCreation.next(o);break}else`subject`in i&&z(n)&&n.on.transactionApplying.state===null&&n.transactionMeta.update.subEvents.push(t)}return{token:o,family:i,subKey:a}}function Ke(e){let{stack:t}=e;return t?`
|
|
2
|
-
`+t.split(`
|
|
3
|
-
`)?.slice(1)?.join(`
|
|
4
|
-
`):``}function qe(e,t){return[e,t].sort().join(``)}function Je(e){if(typeof e!=`string`)return null;let[t,n]=e.split(`==`);if(!n)return null;let r=t.slice(4),[i,a]=n.split(`++`);return r&&i&&a?[r,i,a]:null}function Ye(e,t,n,r=`any`){let i=t,a=M(n),o=[],s=I(e);if(Array.isArray(i))for(let t of i){let n=M(t);s.molecules.get(n)?e.moleculeGraph.set(n,a,{source:n}):o.push(n)}else{let t=M(i);s.molecules.get(t)?e.moleculeGraph.set(t,a,{source:t}):o.push(t)}let c=new N;o.length===0&&s.molecules.set(a,{key:n,stringKey:a,dependsOn:r,subject:c});let l={type:`molecule_creation`,key:n,provenance:i,timestamp:Date.now()};z(s)&&s.transactionMeta.phase===`building`?s.transactionMeta.update.subEvents.push(l):s.on.moleculeCreation.next(l);for(let t of o){let r=e.disposalTraces.buffer.find(e=>e?.key===t);e.logger.error(`❌`,`key`,n,`allocation failed:`,`Could not allocate to ${t} in store "${e.config.name}".`,r?`\n ${t} was most recently disposed\n${r.trace}`:`No previous disposal trace for ${t} was found.`)}return n}function Xe(e,t){let n=M(t),r=e.molecules.get(n);if(!r){let r=e.disposalTraces.buffer.find(e=>e?.key===n);e.logger.error(`❌`,`key`,t,`deallocation failed:`,`Could not find allocation for ${n} in store "${e.config.name}".`,r?`\n This state was most recently deallocated\n${r.trace}`:`No previous disposal trace for ${n} was found.`);return}r.subject.next();let i=e.keyRefsInJoins.getRelatedKeys(n);if(i)for(let n of i){let r=e.joins.get(n);r&&r.relations.delete(t)}else{let n=Je(t);if(n){let[,t,r]=n,i=e.keyRefsInJoins.getRelatedKey(qe(t,r));if(i){let n=e.joins.get(i);n&&n.relations.delete(t,r)}}}e.keyRefsInJoins.delete(n);let a=[],o=[],s=e.moleculeGraph.getRelationEntries({downstreamMoleculeKey:n});if(s)for(let[t,{source:r}]of s)r===n?Xe(e,j(t)):a.push(r);let c=e.moleculeData.getRelatedKeys(r.stringKey);if(c)for(let n of c){let r=e.families.get(n),i=W(e,r,t);o.push([r.key,i]),kt(e,r,t)}let l={type:`molecule_disposal`,key:r.key,values:o,provenance:a,timestamp:Date.now()};e.molecules.delete(n);let u=z(e)&&e.transactionMeta.phase===`building`;u&&e.transactionMeta.update.subEvents.push(l),e.moleculeGraph.delete(r.stringKey),e.keyRefsInJoins.delete(r.stringKey),e.moleculeData.delete(r.stringKey),u||e.on.moleculeDisposal.next(l),e.molecules.delete(r.stringKey);let d=Ke(Error());e.disposalTraces.add({key:n,trace:d})}function Ze(e,t,n,r){let i=M(n),a=I(e),o=a.molecules.get(i);if(!o){let t=e.disposalTraces.buffer.find(e=>e?.key===i);return e.logger.error(`❌`,`key`,i,`claim failed:`,`Could not allocate to ${i} in store "${e.config.name}".`,t?`\n ${i} was most recently disposed\n${t.trace}`:`No previous disposal trace for ${i} was found.`),n}let s=M(t),c=a.molecules.get(s);if(!c){let t=e.disposalTraces.buffer.find(e=>e?.key===s);return e.logger.error(`❌`,`key`,n,`claim failed:`,`Could not allocate to ${s} in store "${e.config.name}".`,t?`\n ${s} was most recently disposed\n${t.trace}`:`No previous disposal trace for ${s} was found.`),n}let l=e.moleculeGraph.getRelationEntries({downstreamMoleculeKey:o.stringKey}).filter(([,{source:e}])=>e!==i).map(([e])=>j(e));r&&a.moleculeGraph.delete(i),a.moleculeGraph.set({upstreamMoleculeKey:c.stringKey,downstreamMoleculeKey:o.stringKey},{source:c.stringKey});let u={type:`molecule_transfer`,key:o.key,exclusive:!!r,from:l,to:[c.key],timestamp:Date.now()};return z(a)&&a.transactionMeta.phase===`building`&&a.transactionMeta.update.subEvents.push(u),n}function Qe(e,t,n){switch(n){case`newValue`:et(e,t);break;case`oldValue`:kt(e,t.token);break}}function $e(e,t,n){switch(n){case`newValue`:kt(e,t.token);break;case`oldValue`:et(e,t);break}}function et(e,t){let{token:n}=t;`value`in t?K(e,n,t.value):Ge(e,n)}function tt(e,t,n){switch(n){case`newValue`:Ye(e,t.provenance,t.key);break;case`oldValue`:Xe(e,t.key);break}}function nt(e,t,n){switch(n){case`newValue`:Xe(e,t.key);break;case`oldValue`:Ye(e,t.provenance.map(j),t.key);for(let[n,r]of t.values){let i=e.families.get(n);if(i){W(e,i,t.key);let a=`${n}(${M(t.key)})`;e.valueMap.set(a,r)}}break}}function rt(e,t,n){switch(n){case`newValue`:for(let n of t.to)Ze(e,n,t.key,t.exclusive?`exclusive`:void 0);break;case`oldValue`:{let n=`exclusive`;for(let r of t.from)Ze(e,r,t.key,n),n=void 0}break}}function it(e,t,n){let r=n===`newValue`?t.subEvents:[...t.subEvents].reverse();for(let t of r)switch(t.type){case`atom_update`:ze(e,t,n);break;case`atom_creation`:Qe(e,t,n);break;case`atom_disposal`:$e(e,t,n);break;case`molecule_creation`:tt(e,t,n);break;case`molecule_disposal`:nt(e,t,n);break;case`molecule_transfer`:rt(e,t,n);break;case`transaction_outcome`:it(e,t,n);break}}function at(e){return`epoch`in e.transactionMeta}function z(e){return`phase`in e.transactionMeta}function ot(e,t){return e.transactionMeta.actionContinuities.getRelatedKey(t)}function st(e,t){return e.transactionMeta.epoch.get(t)}function ct(e,t){let n=ot(e,t);if(n!==void 0)return st(e,n)}function lt(e,t,n){let r=ot(e,t);r!==void 0&&e.transactionMeta.epoch.set(r,n)}function ut(e,t){let n=I(e),{parent:r}=n;n.transactionMeta.phase=`applying`,n.transactionMeta.update.output=t,r.child=null,r.on.transactionApplying.next(n.transactionMeta);let{subEvents:i}=n.transactionMeta.update;e.logger.info(`🛄`,`transaction`,n.transactionMeta.update.token.key,`applying ${i.length} subEvents:`,i),it(r,n.transactionMeta.update,`newValue`),at(r)?(lt(r,n.transactionMeta.update.token.key,n.transactionMeta.update.epoch),H(e,{key:n.transactionMeta.update.token.key,type:`transaction`})?.subject.next(n.transactionMeta.update),e.logger.info(`🛬`,`transaction`,n.transactionMeta.update.token.key,`applied`)):z(r)&&r.transactionMeta.update.subEvents.push(n.transactionMeta.update),r.on.transactionApplying.next(null)}function dt(e){return{store:e}}function B(e){return e[0].toUpperCase()+e.slice(1)}function ft(e,t){let n=e.joins.get(t.key);if(n===void 0){let r=V.STORE.joins.get(t.key);if(r===void 0)throw Error(`Join "${t.key}" not found in store "${e.config.name}"`);n=new gt(Me(e),r.options),e.joins.set(t.key,n)}return n}function pt(e,t,n){let r=ft(e,t),i=I(e);if(z(i)){let{toolkit:e}=i.transactionMeta;r.transact(e,({relations:e})=>{n(e)})}else n(r.relations)}function mt(e,t,n){let r=ft(e,t),i;switch(t.cardinality){case`1:1`:{let a=`${t.a}KeyOf${B(t.b)}`,o=`${t.b}KeyOf${B(t.a)}`;i={get[a](){let t=r.states[a];return G(e,t,n)},get[o](){let t=r.states[o];return G(e,t,n)}};break}case`1:n`:{let a=`${t.a}KeyOf${B(t.b)}`,o=`${t.b}KeysOf${B(t.a)}`;i={get[a](){let t=r.states[a];return G(e,t,n)},get[o](){let t=r.states[o];return G(e,t,n)}};break}case`n:n`:{let a=`${t.a}KeysOf${B(t.b)}`,o=`${t.b}KeysOf${B(t.a)}`;i={get[a](){let t=r.states[a];return G(e,t,n)},get[o](){let t=r.states[o];return G(e,t,n)}}}}return i}function ht(e,t,n){let r=ft(e,t);return n===`split`?[r.relatedKeysAtoms,r.relatedKeysAtoms]:r.relatedKeysAtoms}var gt=class{toolkit;options;relations;states;relatedKeysAtoms;transact(e,t){let n=this.toolkit;this.toolkit=e,t(this),this.toolkit=n}store;[Symbol.dispose](){}constructor(e,t){this.store=e,this.options=t,this.store.miscResources.set(`join:${t.key}`,this),this.toolkit={get:((...t)=>W(e,...t)),set:((...t)=>{K(e,...t)}),find:((...t)=>G(e,...t)),json:t=>gn(e,t),relations:{edit:((...t)=>{pt(e,...t)}),find:((...t)=>mt(e,...t)),internal:((...t)=>ht(e,...t))}};let n=t.between[0],r=t.between[1],i=mn(e,{key:`${t.key}/relatedKeys`,class:Ee},[`join`,`relations`]);this.relatedKeysAtoms=i;let a=(t,n,r)=>{let{find:a,get:o,set:s}=t,c=a(i,n),l=o(c);for(let e of l)r.includes(e)||s(i,e,e=>(e.delete(n),e));s(c,t=>{t.clear();for(let c of r){let r=a(i,c),l=o(r),u=l.has(n);if(this.relations.cardinality===`1:n`){let t=[];for(let e of l){if(e===n)continue;let r;Gt(Wt,this.store,i,e,e=>(e.delete(c),r=e.size,e)),r===0&&t.push(e)}!u&&l.size>0&&s(r,e=>(e.clear(),e));for(let n of t)e.keyRefsInJoins.delete(qe(c,n))}u||s(r,e=>(e.add(n),e)),t.add(c)}return t})},o=(e,t,n)=>{let{set:r}=e;r(i,t,e=>{for(let t of n)e.add(t);return e});for(let e of n)r(i,e,e=>(e.add(t),e));return!0},s=new F(t,{externalStore:{getRelatedKeys:e=>this.toolkit.get(i,e),addRelation:(e,n)=>{this.store.keyRefsInJoins.set(`"${e}"`,t.key),this.store.keyRefsInJoins.set(`"${n}"`,t.key),this.store.keyRefsInJoins.set(qe(e,n),t.key),this.toolkit.set(i,e,e=>e.add(n)),this.toolkit.set(i,n,t=>t.add(e))},deleteRelation:(e,t)=>{this.toolkit.set(i,e,e=>(e.delete(t),e)),this.toolkit.set(i,t,t=>(t.delete(e),t));let n=qe(e,t);this.store.keyRefsInJoins.delete(n)},replaceRelationsSafely:(e,t)=>{a(this.toolkit,e,t)},replaceRelationsUnsafely:(e,t)=>{o(this.toolkit,e,t)},has:(e,t)=>{let n=this.toolkit.get(i,e);return t?n.has(t):n.size>0}},isAType:t.isAType,isBType:t.isBType}),c=()=>Ct(e,{key:`${t.key}/singleRelatedKey`,get:e=>({get:t})=>{let n=t(i,e);for(let e of n)return e;return null}},[`join`,`keys`]),l=()=>Ct(e,{key:`${t.key}/multipleRelatedKeys`,get:t=>({get:n})=>n(hn(i,e),t)},[`join`,`keys`]);switch(t.cardinality){case`1:1`:{let e=c(),t=`${n}KeyOf${B(r)}`,i=`${r}KeyOf${B(n)}`;this.relations=s,this.states={[t]:e,[i]:e};break}case`1:n`:{let e=c(),t=l(),i=`${n}KeyOf${B(r)}`,a=`${r}KeysOf${B(n)}`,o={[i]:e,[a]:t};this.relations=s,this.states=o;break}case`n:n`:{let e=l(),t=`${n}KeysOf${B(r)}`,i=`${r}KeysOf${B(n)}`;this.relations=s,this.states={[t]:e,[i]:e}}}}};function _t(e,t,n,r){let i=I(e),a={parent:i,child:null,on:i.on,loggers:i.loggers,logger:i.logger,config:i.config,atoms:new P(i.atoms),atomsThatAreDefault:new Set(i.atomsThatAreDefault),families:new P(i.families),joins:new P(i.joins),operation:{open:!1},readonlySelectors:new P(i.readonlySelectors),timelineFamilies:new P(i.timelineFamilies),timelines:new P(i.timelines),timelineTopics:i.timelineTopics.overlay(),trackers:new Map,transactions:new P(i.transactions),selectorAtoms:i.selectorAtoms.overlay(),selectorGraph:i.selectorGraph.overlay(),writableSelectors:new P(i.writableSelectors),valueMap:new P(i.valueMap),defaults:i.defaults,disposalTraces:e.disposalTraces.copy(),molecules:new P(i.molecules),moleculeGraph:i.moleculeGraph.overlay(),moleculeData:i.moleculeData.overlay(),keyRefsInJoins:i.keyRefsInJoins.overlay(),miscResources:new P(i.miscResources)},o=ct(e,t.key),s={phase:`building`,update:{type:`transaction_outcome`,token:t,id:r,epoch:o===void 0?NaN:o+1,timestamp:Date.now(),subEvents:[],params:n,output:void 0},toolkit:{get:((...e)=>W(c,...e)),set:((...e)=>{K(c,...e)}),reset:((...e)=>{Bt(c,...e)}),run:(e,t=je())=>Re(c,e,t),find:((...t)=>G(e,...t)),json:e=>gn(c,e),dispose:((...e)=>{kt(c,...e)}),env:()=>dt(c),relations:{edit:((...e)=>{pt(c,...e)}),find:((...e)=>mt(c,...e)),internal:((...e)=>ht(c,...e))}}},c=Object.assign(a,{transactionMeta:s});return i.child=c,e.logger.info(`🛫`,`transaction`,t.key,`building with params:`,n),c}function vt(e,t){let{key:n}=t,r=e.transactions.has(n),i={key:n,type:`transaction`,run:(r,a)=>{let o=_t(e,R(i),r,a);try{let{toolkit:e}=o.transactionMeta,n=t.do(e,...r);return ut(o,n),n}catch(t){throw Le(o),e.logger.warn(`💥`,`transaction`,n,`caught:`,t),t}},install:e=>vt(e,t),subject:new N};I(e).transactions.set(n,i);let a=R(i);return r||e.on.transactionCreation.next(a),a}var yt=class{parent=null;child=null;valueMap=new Map;defaults=new Map;atoms=new Map;writableSelectors=new Map;readonlySelectors=new Map;atomsThatAreDefault=new Set;selectorAtoms=new F({between:[`selectorKey`,`atomKey`],cardinality:`n:n`});selectorGraph=new F({between:[`upstreamSelectorKey`,`downstreamSelectorKey`],cardinality:`n:n`},{makeContentKey:(...e)=>e.sort().join(`:`)});trackers=new Map;families=new Map;joins=new Map;transactions=new Map;transactionMeta={epoch:new Map,actionContinuities:new F({between:[`continuity`,`action`],cardinality:`1:n`})};timelines=new Map;timelineFamilies=new Map;timelineTopics=new F({between:[`timelineKey`,`topicKey`],cardinality:`1:n`});disposalTraces=new Fe(100);molecules=new Map;moleculeGraph=new F({between:[`upstreamMoleculeKey`,`downstreamMoleculeKey`],cardinality:`n:n`},{makeContentKey:(...e)=>e.sort().join(`:`)});moleculeData=new F({between:[`moleculeKey`,`stateFamilyKey`],cardinality:`n:n`},{makeContentKey:(...e)=>e.sort().join(`:`)});keyRefsInJoins=new F({between:[`moleculeKey`,`joinKey`],cardinality:`n:n`},{makeContentKey:(...e)=>e.sort().join(`:`)});miscResources=new Map;on={atomCreation:new N,atomDisposal:new N,selectorCreation:new N,selectorDisposal:new N,timelineCreation:new N,timelineDisposal:new N,transactionCreation:new N,transactionApplying:new _e(null),operationClose:new N,moleculeCreation:new N,moleculeDisposal:new N};operation={open:!1};config={name:`IMPLICIT_STORE`,lifespan:`ephemeral`,isProduction:!0};loggers=[new jn(`warn`,(e,t,n)=>!Ie(n))];logger={error:(...e)=>{for(let t of this.loggers)t.error(...e)},info:(...e)=>{for(let t of this.loggers)t.info(...e)},warn:(...e)=>{for(let t of this.loggers)t.warn(...e)}};constructor(e,t=null){if(this.config={...t?.config,...e},t!==null){this.operation={...t?.operation},at(t)&&(this.transactionMeta={epoch:new Map(t?.transactionMeta.epoch),actionContinuities:new F(t?.transactionMeta.actionContinuities.toJSON())});for(let[,e]of t.families)e.internalRoles?.includes(`mutable`)||e.internalRoles?.includes(`join`)||e.install(this);let e=new Set;for(let[,n]of t.atoms)if(!e.has(n.key)&&(n.install(this),n.type===`mutable_atom`)){let r=gn(t,n),i=_n(n);e.add(r.key),e.add(i.key)}for(let[,e]of t.readonlySelectors)e.install(this);for(let[,n]of t.writableSelectors)e.has(n.key)||n.install(this);for(let[,e]of t.transactions)e.install(this);for(let[,e]of t.timelineFamilies)e.install(this);for(let[,e]of t.timelines)e.install(this)}}},V={get STORE(){return globalThis.ATOM_IO_IMPLICIT_STORE??=new yt({name:`IMPLICIT_STORE`,lifespan:`ephemeral`,isProduction:!0}),globalThis.ATOM_IO_IMPLICIT_STORE}};function H(e,t){let n,r=e;for(;r!==null;){switch(t.type){case`atom`:case`mutable_atom`:n=r.atoms.get(t.key);break;case`writable_pure_selector`:case`writable_held_selector`:n=r.writableSelectors.get(t.key);break;case`readonly_pure_selector`:case`readonly_held_selector`:n=r.readonlySelectors.get(t.key);break;case`atom_family`:case`mutable_atom_family`:case`writable_pure_selector_family`:case`readonly_pure_selector_family`:case`writable_held_selector_family`:case`readonly_held_selector_family`:n=r.families.get(t.key);break;case`timeline`:n=r.timelines.get(t.key);break;case`timeline_family`:n=r.timelineFamilies.get(t.key);break;case`transaction`:n=r.transactions.get(t.key);break}if(n)return n;r=r.child}throw new Mn(t,e.config.name)}function bt(e,t,n,r){let i=e.disposalTraces.buffer.find(e=>e?.key===M(r));switch(e.logger.error(`❌`,t.type,t.key,`gets a fallback value because key`,r,`is not allocated`,i?`This key was previously disposed:\n${i.trace}`:`(no previous disposal trace found)`),n.type){case`mutable_atom_family`:{if(e.defaults.has(n.key))return e.defaults.get(n.key);let t=new n.class;return e.defaults.set(n.key,t),t.READONLY_VIEW}case`atom_family`:{if(e.defaults.has(n.key))return e.defaults.get(n.key);let t=n.default,i=t(r);return e.defaults.set(n.key,i),i}case`readonly_pure_selector_family`:case`writable_pure_selector_family`:case`readonly_held_selector_family`:case`writable_held_selector_family`:{if(e.defaults.has(n.key))return e.defaults.get(n.key);let t=n.default(r);return e.defaults.set(n.key,t),t}}}function xt(e,t){let{type:n,key:r,catch:i}=t;switch(n){case`readonly_pure_selector`:case`writable_pure_selector`:{let a;e.logger.info(`🧮`,n,r,`computing value`);try{a=t.getFrom(e),a instanceof Promise&&(a=a.catch(t=>{if(e.logger.error(`💥`,n,r,`rejected:`,t),i){for(let e of i)if(t instanceof e)return t}throw t}))}catch(a){if(e.logger.error(`💥`,n,r,`rejected:`,a),i){for(let n of i)if(a instanceof n)return q(e,t,a)}throw a}return q(e,t,a)}case`atom`:{let a;if(L(t.default))try{a=t.default(),a instanceof Promise&&(a=a.catch(t=>{if(e.logger.error(`💥`,n,r,`rejected:`,t),i){for(let e of i)if(t instanceof e)return t}throw t}))}catch(o){if(e.logger.error(`💥`,n,r,`rejected:`,o),i){for(let n of i)if(o instanceof n)return a=q(e,t,o),e.logger.info(`✨`,t.type,r,`computed default`,a),a}throw o}else a=t.default,e.logger.info(`✨`,t.type,r,`using static default`,a);return q(e,t,a)}}}function U(e,t,n){if(e.valueMap.has(t.key))return yn(e,t,n);e.logger.info(`❔`,t.type,t.key,`value not found in cache`);let{key:r}=t;switch(t.type){case`readonly_held_selector`:case`writable_held_selector`:return e.logger.info(`🧮`,t.type,r,`computing value`),t.getFrom(e);case`writable_pure_selector`:case`readonly_pure_selector`:case`atom`:return xt(e,t);case`mutable_atom`:{let n=new t.class;return e.logger.info(`✨`,t.type,r,`created new instance`,n),q(e,t,n)}}}function W(e,...t){let{token:n,family:r,subKey:i}=Ge(e,...t);return`counterfeit`in n&&r&&i?bt(e,n,r,i):U(e,H(e,n))}function St(e,t,n){let r=M(n),i=`${t.key}(${r})`,a=I(e),o;switch(t.type){case`atom_family`:case`mutable_atom_family`:o=a.atoms.get(i);break;case`writable_held_selector_family`:case`writable_pure_selector_family`:o=a.writableSelectors.get(i);break;case`readonly_held_selector_family`:case`readonly_pure_selector_family`:o=a.readonlySelectors.get(i);break}return o&&R(o)}function G(e,t,n){let r=H(e,t);return St(e,t,n)||We(Ue,e,r,n)}function Ct(e,t,n){let r=t.key,i=`readonly_pure_selector_family`,a={key:r,type:i},o=e.families.get(r);o&&e.config.isProduction===!0&&e.logger.error(`❗`,i,r,`Overwriting an existing ${J[o.type]} "${o.key}" in store "${e.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);let s=n=>{let i=M(n),a={key:r,subKey:i},o=`${r}(${i})`,s=I(e),c={key:o,get:t.get(n)};return t.catch&&(c.catch=t.catch),tn(s,c,a)},c={...a,create:s,internalRoles:n,install:e=>Ct(e,t),default:n=>t.get(n)({get:W.bind(null,e),find:G.bind(null,e),json:t=>gn(e,t),relations:{find:mt.bind(null,e),internal:ht.bind(null,e)}})};return e.families.set(r,c),a}function wt(e,t,n){let r={key:t.key,type:`atom_family`},i=e.families.get(t.key);i&&e.config.isProduction===!0&&e.logger.error(`❗`,`atom_family`,t.key,`Overwriting an existing ${J[i.type]} "${i.key}" in store "${e.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);let a=new N,o=n=>{let r=M(n),i={key:t.key,subKey:r},a=`${t.key}(${r})`,o=I(e),s=t.default,c={key:a,default:L(s)?()=>s(n):s};return t.effects&&(c.effects=t.effects(n)),t.catch&&(c.catch=t.catch),Cn(o,c,i)},s={...r,create:o,default:t.default,subject:a,install:e=>wt(e,t),internalRoles:n};return e.families.set(t.key,s),L(t.default)===!1&&e.defaults.set(t.key,t.default),r}function Tt(e,t,n){let r=t.key,i=`readonly_held_selector_family`,a={key:r,type:i},o=e.families.get(r);o&&e.config.isProduction===!0&&e.logger.error(`❗`,i,r,`Overwriting an existing ${J[o.type]} "${o.key}" in store "${e.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);let s=n=>{let i=M(n),a={key:r,subKey:i},o=`${r}(${i})`;return en(I(e),{key:o,const:t.const(n),get:t.get(n)},a)},c={...a,create:s,internalRoles:n,install:e=>Tt(e,t),default:t.const};return e.families.set(r,c),a}function Et(e,t,n){let r=t.key,i=`writable_held_selector_family`,a={key:r,type:i},o=e.families.get(r);o&&e.config.isProduction===!0&&e.logger.error(`❗`,i,r,`Overwriting an existing ${J[o.type]} "${o.key}" in store "${e.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);let s=n=>{let i=M(n),a={key:r,subKey:i},o=`${r}(${i})`;return nn(I(e),{key:o,const:t.const(n),get:t.get(n),set:t.set(n)},a)},c={...a,create:s,internalRoles:n,install:e=>Et(e,t),default:t.const};return e.families.set(r,c),a}function Dt(e,t,n){let r=t.key,i=`writable_pure_selector_family`,a={key:r,type:i},o=e.families.get(r);o&&e.config.isProduction===!0&&e.logger.error(`❗`,i,r,`Overwriting an existing ${J[o.type]} "${o.key}" in store "${e.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);let s=n=>{let i=M(n),a={key:r,subKey:i},o=`${r}(${i})`,s=I(e),c={key:o,get:t.get(n),set:t.set(n)};return t.catch&&(c.catch=t.catch),rn(s,c,a)},c={...a,create:s,internalRoles:n,install:e=>Dt(e,t),default:n=>t.get(n)({get:((...t)=>W(e,...t)),find:((...t)=>G(e,...t)),json:t=>gn(e,t),relations:{find:((...t)=>mt(e,...t)),internal:((...t)=>ht(e,...t))}})};return e.families.set(r,c),a}function Ot(e,t){let n=`set`in t,r=`const`in t;return r&&n?Et(e,t,void 0):r?Tt(e,t,void 0):n?Dt(e,t):Ct(e,t)}function kt(e,...t){let n;if(t.length===1)n=t[0];else{let r=t[0],i=t[1];n=G(e,r,i)}try{H(e,n)}catch{e.logger.error(`❌`,n.type,n.key,`could not be disposed because it was not found in the store "${e.config.name}".`);return}switch(n.type){case`atom`:case`mutable_atom`:Tn(e,n);break;case`writable_pure_selector`:case`readonly_pure_selector`:case`writable_held_selector`:case`readonly_held_selector`:on(e,n);break}}function At(e,t){if(e.operation.open){let n=performance.now();return e.logger.info(`🚫`,t.type,t.key,`deferring setState at T-${n} until setState for "${e.operation.token.key}" is done`),n}return e.operation={open:!0,done:new Set,prev:new Map,timestamp:Date.now(),token:t,subEvents:[]},e.logger.info(`⭕`,t.type,t.key,`operation start in store "${e.config.name}"${z(e)?` ${e.transactionMeta.phase} "${e.transactionMeta.update.token.key}"`:``}`),e}function jt(e){e.operation.open&&e.logger.info(`🔴`,e.operation.token.type,e.operation.token.key,`operation done in store "${e.config.name}"`),e.operation={open:!1},e.on.operationClose.next(e.operation)}function Mt(e,t){return e.operation.open?e.operation.done.has(t):(e.logger.error(`🐞`,`unknown`,t,`isDone called outside of an operation. This is probably a bug in AtomIO.`),!0)}function Nt(e,t){if(!e.operation.open){e.logger.error(`🐞`,`unknown`,t,`markDone called outside of an operation. This is probably a bug in AtomIO.`);return}e.operation.done.add(t)}function Pt(e,t,n,r,i){let{oldValue:a,newValue:o}=n,s=`oldValue`in n,c=R(t);if(r&&i){t.subject.next({newValue:o});let n=I(e);if(c.family)switch(c.type){case`atom`:case`mutable_atom`:let t={checkpoint:!0,type:`atom_creation`,token:c,timestamp:Date.now(),value:o};e.operation.subEvents.push(t),i.subject.next(t),at(n)?e.on.atomCreation.next(c):z(n)&&n.on.transactionApplying.state===null&&n.transactionMeta.update.subEvents.push(t);break;case`writable_pure_selector`:case`writable_held_selector`:e.on.selectorCreation.next(c);break}return}let{key:l,subject:u,type:d}=t,f;if(f=s?{oldValue:vn(a)?a.READONLY_VIEW:a,newValue:vn(o)?o.READONLY_VIEW:o}:{newValue:vn(o)?o.READONLY_VIEW:o},at(e)){switch(d){case`mutable_atom`:e.logger.info(`📢`,d,l,`is now (`,o,`) subscribers:`,u.subscribers.keys());break;case`atom`:case`writable_pure_selector`:case`writable_held_selector`:e.logger.info(`📢`,d,l,`went (`,a,`->`,o,`) subscribers:`,u.subscribers.keys())}u.next(f)}if(z(e)&&(d===`mutable_atom`||d===`atom`)){if(e.on.transactionApplying.state===null){if(vn(o))return;let{timestamp:t}=e.operation,n={type:`atom_update`,token:c,timestamp:t,update:f};e.transactionMeta.update.subEvents.push(n),e.logger.info(`📁`,`atom`,l,`stowed (`,a,`->`,o,`)`);return}if(wn(t,`tracker:signal`)){let t=l.slice(1),n=e.atoms.get(t);U(e,n,`mut`).do(f.newValue)===null&&xn(e,n)}}}var Ft=Symbol(`UNSET`);function It(e,t,n){let r,i;if(L(n)){let a=U(e,t,`mut`);r=a,i=n(a)}else r=e.valueMap.has(t.key)?yn(e,t,`mut`):t.type===`atom`&&!L(t.default)?t.default:Ft,i=n;return e.logger.info(`⭐`,`atom`,t.key,`setting value`,i),i=q(e,t,i),Nt(e,t.key),xn(e,t),r===Ft?{newValue:i}:{oldValue:r,newValue:i}}function Lt(e,t){switch(t.type){case`mutable_atom`:return It(e,t,new t.class);case`atom`:{let n;return n=L(t.default)?xt(e,t):t.default,It(e,t,n)}}}function Rt(e,t){let n;switch(t.type){case`atom`:case`mutable_atom`:n=Lt(e,t);break;case`writable_held_selector`:{let r=Zt(e,t.key);for(let n of r.values())Pt(e,t,Lt(e,n),!1);let i=t.getFrom(e);n={oldValue:i,newValue:i}}break;case`writable_pure_selector`:{let r=xt(e,t),i=Zt(e,t.key);for(let n of i.values())Pt(e,t,Lt(e,n),!1);n={oldValue:r,newValue:xt(e,t)}}break}return n}function K(e,...t){Gt(Ut,e,...t)}var zt=Symbol(`RESET`);function Bt(e,...t){K(e,...t,zt)}function Vt(e,t,n){let r,i,a,{type:o,key:s}=t;switch(t.type){case`writable_pure_selector`:r=U(e,t,`mut`),i=Pe(n,r),i=q(e,t,i);break;case`writable_held_selector`:a=t.const,Pe(n,a),r=a,i=a}return e.logger.info(`⭐`,o,s,`setting to`,i),Nt(e,s),t.setSelf(i),{oldValue:r,newValue:i}}function Ht(e,t,n){let r;switch(t.type){case`atom`:case`mutable_atom`:r=It(e,t,n);break;case`writable_pure_selector`:case`writable_held_selector`:r=Vt(e,t,n);break}return r}var Ut=Symbol(`OWN_OP`),Wt=Symbol(`JOIN_OP`);function Gt(e,t,...n){let r,i,a,o,s,c;n.length===2?(a=n[0],c=n[1],`family`in a&&(o=Be(t,a),s=j(a.family.subKey),r=St(t,o,s),a=r||(i=We(He,t,o,s)))):(o=H(t,n[0]),s=n[1],c=n[2],r=St(t,o,s),a=r||(i=We(He,t,o,s)));let l=c===zt?`reset`:`set`,u;if(e===Ut){let n=At(t,a);if(typeof n==`number`){let r=n,i=t.on.operationClose.subscribe(`waiting to ${l} "${a.key}" at T-${r}`,function(){i(),t.logger.info(`🟢`,a.type,a.key,`resuming deferred`,l,`from T-${r}`),Gt(e,t,a,c)});return}u=n}else u=t;if(`counterfeit`in a&&`family`in a){let e=a.family.subKey,n=t.disposalTraces.buffer.find(t=>t?.key===e);t.logger.error(`❌`,a.type,a.key,`could not be`,l,`because key`,e,`is not allocated.`,n?`this key was previously disposed:${n.trace}`:`(no previous disposal trace found)`);return}let d=H(u,a),f;f=c===zt?Rt(u,d):Ht(u,d,c),Pt(u,d,f,!!i,o),e===Ut&&jt(u)}var Kt=(e,t)=>I(e).atoms.has(t),qt=(e,t)=>I(e).writableSelectors.has(t),Jt=(e,t)=>I(e).readonlySelectors.has(t),Yt=(e,t)=>Kt(e,t)||qt(e,t)||Jt(e,t);function Xt(e,t){return I(e).selectorGraph.getRelationEntries({downstreamSelectorKey:t}).filter(([e,{source:n}])=>n!==t).map(([e,{source:t}])=>t).filter(t=>Yt(e,t))}function Zt(e,t,n=new Set){let r=Xt(e,t),i=new Map;for(;r.length>0;){let t=r.pop();if(!n.has(t))if(n.add(t),Kt(e,t)){let n=e.atoms.get(t);i.set(n.key,n)}else r.push(...Xt(e,t))}return i}function Qt(e,t,n,r,i){let a=I(e),{type:o,key:s}=r;if(o===`atom`||o===`mutable_atom`)a.selectorAtoms.set({selectorKey:n,atomKey:s}),e.logger.info(`🔍`,t,n,`discovers root atom "${s}"`);else{let r=Zt(e,s,i);e.logger.info(`🔍`,t,n,`discovers root atoms: [ ${[...r.values()].map(e=>`"${e.key}"`).join(`, `)} ]`);for(let{key:e}of r.values())a.selectorAtoms=a.selectorAtoms.set({selectorKey:n,atomKey:e})}i.add(s)}function $t(e,t,n,r){return{get:(...i)=>{let a=I(e),{token:o,family:s,subKey:c}=Ge(e,...i),l;return l=`counterfeit`in o&&s&&c?bt(e,o,s,c):U(e,H(e,o)),e.logger.info(`🔌`,t,n,`registers dependency ( "${o.key}" =`,l,`)`),a.selectorGraph.set({upstreamSelectorKey:o.key,downstreamSelectorKey:n},{source:o.key}),Qt(e,t,n,o,r),l},set:((...t)=>{Gt(Wt,I(e),...t)}),find:((...t)=>G(e,...t)),json:t=>gn(e,t),relations:{edit:((...t)=>{pt(e,...t)}),find:((...t)=>mt(e,...t)),internal:((...t)=>ht(e,...t))}}}function en(e,t,n){let r=I(e),i=new N,a=new Set,{key:o,const:s}=t,c=`readonly_held_selector`;e.logger.info(`🔨`,c,o,`is being created`);let{get:l,find:u,json:d,relations:f}=$t(r,c,o,a),p=n=>{let r=n.selectorGraph.getRelationEntries({downstreamSelectorKey:o});for(let[e,{source:t}]of r)t!==o&&n.selectorGraph.delete(e,o);return n.selectorAtoms.delete(o),t.get({get:l,find:u,json:d,relations:f},s),q(n,m,s),e.logger.info(`✨`,c,o,`=`,s),a.clear(),s},m={...t,type:c,subject:i,getFrom:p,install:e=>en(e,t,n)};n&&(m.family=n),r.readonlySelectors.set(o,m);let h={key:o,type:c};return n&&(h.family=n),h}function tn(e,t,n){let r=I(e),i=new N,a=new Set,o=t.key,s=`readonly_pure_selector`;e.logger.info(`🔨`,s,o,`is being created`);let{get:c,find:l,json:u,relations:d}=$t(r,s,o,a),f=()=>{let n=I(e),r=n.selectorGraph.getRelationEntries({downstreamSelectorKey:o});for(let[e,{source:t}]of r)t!==o&&n.selectorGraph.delete(e,o);n.selectorAtoms.delete(o);let i=t.get({get:c,find:l,json:u,relations:d});return e.logger.info(`✨`,s,o,`=`,i),a.clear(),i},p={...t,type:s,subject:i,getFrom:f,install:e=>tn(e,t,n)};n&&(p.family=n),r.readonlySelectors.set(o,p);let m={key:o,type:s};return n&&(m.family=n),m}function nn(e,t,n){let r=I(e),i=new N,a=new Set,{key:o,const:s}=t,c=`writable_held_selector`;e.logger.info(`🔨`,c,o,`is being created`);let l=$t(r,c,o,a),{find:u,get:d,json:f,relations:p}=l,m={find:u,get:d,json:f,relations:p},h=n=>{let r=n.selectorGraph.getRelationEntries({downstreamSelectorKey:o});for(let[e,{source:t}]of r)t!==o&&n.selectorGraph.delete(e,o);return n.selectorAtoms.delete(o),t.get(m,s),q(n,_,s),e.logger.info(`✨`,c,o,`=`,s),a.clear(),s},g=()=>{t.set(l,s)},_={...t,type:c,subject:i,getFrom:h,setSelf:g,install:e=>nn(e,t,n)};n&&(_.family=n),r.writableSelectors.set(o,_);let v={key:o,type:c};return n&&(v.family=n),v}function rn(e,t,n){let r=I(e),i=new N,a=new Set,o=t.key,s=`writable_pure_selector`;e.logger.info(`🔨`,s,o,`is being created`);let c=$t(r,s,o,a),{find:l,get:u,json:d,relations:f}=c,p={find:l,get:u,json:d,relations:f},m=n=>{let r=n.selectorGraph.getRelationEntries({downstreamSelectorKey:o});for(let[e,{source:t}]of r)t!==o&&n.selectorGraph.delete(e,o);n.selectorAtoms.delete(o);let i=t.get(p);return e.logger.info(`✨`,s,o,`=`,i),a.clear(),i},h=e=>{t.set(c,e)},g={...t,type:s,subject:i,getFrom:m,setSelf:h,install:e=>rn(e,t,n)};n&&(g.family=n),r.writableSelectors.set(o,g);let _={key:o,type:s};return n&&(_.family=n),_}function an(e,t){let n=`set`in t,r=`const`in t;if(r&&n){let n=nn(e,t,void 0);return e.on.selectorCreation.next(n),n}if(r){let n=en(e,t,void 0);return e.on.selectorCreation.next(n),n}if(n){let n=rn(e,t,void 0);return e.on.selectorCreation.next(n),n}let i=tn(e,t,void 0);return e.on.selectorCreation.next(i),i}function on(e,t){let n=I(e),{key:r,type:i,family:a}=t;if(!a)e.logger.error(`❌`,i,r,`Standalone selectors cannot be disposed.`);else{switch(n.molecules.get(a.subKey)&&n.moleculeData.delete(a.subKey,a.key),t.type){case`writable_held_selector`:n.writableSelectors.delete(r),a.key;break;case`writable_pure_selector`:n.writableSelectors.delete(r),a.key;break;case`readonly_held_selector`:n.readonlySelectors.delete(r),a.key;break;case`readonly_pure_selector`:n.readonlySelectors.delete(r),a.key;break}if(n.valueMap.delete(r),n.selectorAtoms.delete(r),n.selectorGraph.delete(r),n.moleculeData.delete(a.key,a.subKey),e.logger.info(`🔥`,t.type,r,`deleted`),z(n)&&n.transactionMeta.phase===`building`)return;e.on.selectorDisposal.next(t)}}function sn(e,t){let n=I(e);return n.operation.open?n.operation.prev.get(t.key):n.valueMap.get(t.key)}function cn(e,t,n){return n.subject.subscribe(`${t.type}:${t.key}`,r=>{e.logger.info(`📢`,t.type,t.key,`root`,n.key,`went`,r.oldValue,`->`,r.newValue);let i=sn(e,t),a=U(e,t);e.logger.info(`✨`,t.type,t.key,`went`,i,`->`,a),t.subject.next({newValue:a,oldValue:i})})}function ln(e,t,n,r){function i(n){e.operation.open&&a?.type===`atom`&&wn(a,`tracker:signal`)&&`*`+e.operation.token.key===t.key&&`inboundTracker`in r||r(n)}Ge(e,t);let a=H(e,t);e.logger.info(`👀`,a.type,a.key,`Adding subscription "${n}"`);let o=a.type===`writable_pure_selector`||a.type===`readonly_pure_selector`,s=new Map,c=i;if(o){U(e,a);for(let[t,n]of Zt(e,a.key))s.set(t,cn(e,a,n));c=function(t){let n=Zt(e,a.key);for(let[e,t]of s)n.get(e)?n.delete(e):(t(),s.delete(e));for(let[t,r]of n)s.set(t,cn(e,a,r));i(t)}}let l=a.subject.subscribe(n,c);return()=>{e.logger.info(`🙈`,a.type,a.key,`Removing subscription "${n}"`),l();for(let e of s.values())e()}}function un(e,t,n,r){let i=H(e,t);e.logger.info(`👀`,`timeline`,t.key,`Adding subscription "${n}"`);let a=i.subject.subscribe(n,r);return()=>{e.logger.info(`🙈`,`timeline`,t.key,`Removing subscription "${n}" from timeline`),a()}}var dn=class{initializeSignalAtom(e,t){let n=`*${e.key}`;t.atoms.delete(n),t.valueMap.delete(n);let r=e.family?{key:`*${e.family.key}`,subKey:e.family.subKey}:void 0,i=Cn(t,{key:n,default:null},r,[`tracker:signal`]);if(t.parent?.valueMap.has(n)){let e=t.parent.valueMap.get(n);t.valueMap.set(n,e)}return i}unsubscribeFromInnerValue;unsubscribeFromState;captureSignalsFromCore(e,t,n){let r=e.key,i=`tracker-from-core:${n.config.name}:${z(n)?n.transactionMeta.update.token.key:`main`}:${r}`,a=e=>{Gt(Wt,n,t,e)},o=W(n,e);this.unsubscribeFromInnerValue=o.subscribe(i,a),this.unsubscribeFromState=ln(n,e,i,function(e){e.newValue!==e.oldValue&&(this.unsubscribeFromInnerValue(),this.unsubscribeFromInnerValue=e.newValue.subscribe(i,a))}.bind(this))}supplySignalsToCore(e,t,n){let r=e.key,i=`tracker-to-core:${n.config.name}:${z(n)?n.transactionMeta.update.token.key:`main`}:${r}`;ln(n,t,i,Object.assign(function({newValue:r,oldValue:a}){let o=n.timelineTopics.getRelatedKey(t.key);if(o&&n.timelines.get(o)?.timeTraveling){let t=un(n,{key:o,type:`timeline`},i,function(i){t(),K(n,e,e=>(i.event===`redo`&&r?e.do(r):i.event===`undo`&&a&&e.undo(a),e))});return}K(n,e,e=>(e.do(r),e))},{inboundTracker:!0}))}mutableAtomToken;latestSignalToken;[Symbol.dispose];constructor(e,t){let n=I(t),r=this.initializeSignalAtom(e,n);this.mutableAtomToken=e,this.latestSignalToken=r,this.captureSignalsFromCore(e,r,n),this.supplySignalsToCore(e,r,n),n.trackers.set(e.key,this),this[Symbol.dispose]=()=>{this.unsubscribeFromInnerValue(),this.unsubscribeFromState(),n.trackers.delete(e.key)}}};function fn(e,t,n){e.logger.info(`🔨`,`atom`,t.key,`creating in store "${e.config.name}"`);let r=I(e),{key:i}=t,a=r.atoms.get(i),o=`mutable_atom`;if(a?.type===o&&e.config.isProduction===!0)return e.logger.error(`❌`,o,i,`Tried to create atom, but it already exists in the store.`),R(a);let s=new N,c={...t,type:o,install:e=>(e.logger.info(`🛠️`,`atom`,i,`installing in store "${e.config.name}"`),fn(e,t,n)),subject:s};n&&(c.family=n),r.atoms.set(c.key,c);let l=R(c);if(new dn(l,e),n||an(e,{key:`${i}:JSON`,get:({get:e})=>e(l).toJSON(),set:({set:e},n)=>{e(l,t.class.fromJSON(n))}}),t.effects){let n=0,r=[];for(let i of t.effects){let t=i({resetSelf:()=>{Bt(e,l)},setSelf:t=>{K(e,l,t)},onSet:t=>ln(e,l,`effect[${n}]`,t),token:l,store:Me(e)});t&&r.push(t),++n}c.cleanup=()=>{for(let e of r)e instanceof Promise?e.then(e=>e?.()):e()}}return e.on.atomCreation.next(l),l}var pn=class{trackers=new Map;latestSignalAtoms;mutableAtoms;constructor(e,t){let n=wt(t,{key:`*${e.key}`,default:null},[`mutable`,`updates`]);this.latestSignalAtoms=H(t,n),this.mutableAtoms=e,this.mutableAtoms.subject.subscribe(`store=${t.config.name}::tracker-atom-family`,e=>{let{type:n,token:r}=e;if(r.family){let e=j(r.family.subKey);switch(n){case`atom_creation`:this.trackers.set(e,new dn(r,t));break;case`atom_disposal`:{let t=this.trackers.get(e);t&&(t[Symbol.dispose](),this.trackers.delete(e))}}}})}};function mn(e,t,n){let r={key:t.key,type:`mutable_atom_family`},i=e.families.get(t.key);i&&e.config.isProduction===!0&&e.logger.error(`❗`,`mutable_atom_family`,t.key,`Overwriting an existing ${J[i.type]} "${i.key}" in store "${e.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);let a=new N,o=n=>{let r=M(n),i={key:t.key,subKey:r},a=`${t.key}(${r})`,o=I(e),s={key:a,class:t.class};return t.effects&&(s.effects=t.effects(n)),fn(o,s,i)},s={...r,create:o,class:t.class,subject:a,install:e=>mn(e,t),internalRoles:n};return e.families.set(t.key,s),Dt(e,{key:`${t.key}:JSON`,get:e=>({get:t})=>t(r,e).toJSON(),set:e=>({set:n},i)=>{n(r,e,t.class.fromJSON(i))}},[`mutable`,`json`]),new pn(s,e),r}function hn(e,t){let n=I(t),r=`${e.key}:JSON`;return n.families.get(r)}var gn=(e,t)=>t.family?G(e,H(I(e),{key:`${t.family.key}:JSON`,type:`writable_pure_selector_family`}),j(t.family.subKey)):{type:`writable_pure_selector`,key:`${t.key}:JSON`};function _n(e){let t={type:`atom`,key:`*${e.key}`};return e.family&&(t.family={key:`*${e.family.key}`,subKey:e.family.subKey}),t}function vn(e){return typeof e==`object`&&!!e&&`do`in e&&`undo`in e&&`subscribe`in e&&`READONLY_VIEW`in e&&`toJSON`in e}function q(e,t,n){let{key:r,subject:i,type:a}=t,o=e.valueMap.get(r);if(o instanceof ke&&!o.done){let t=o;return n instanceof Promise?(t.use(n),t):(e.valueMap.set(r,n),n)}if(n instanceof Promise){let o=new ke(n);return e.valueMap.set(r,o),o.then(function(n){if(e.valueMap.get(r)===o){switch(At(e,t),q(e,t,n),a){case`atom`:xn(e,t);break;case`readonly_pure_selector`:case`writable_pure_selector`:Sn(e,r);break}jt(e),i.next({newValue:n,oldValue:o})}}).catch(n=>{e.logger.error(`💥`,t.type,r,`rejected:`,n)}),o}return e.logger.info(`📝`,t.type,t.key,`writing to cache`,n),e.valueMap.set(r,n),n}function yn(e,t,n){e.logger.info(`📖`,t.type,t.key,`reading cached value`);let r=e.valueMap.get(t.key);if(n===`mut`&&t.type===`mutable_atom`&&z(e)){let n=t,{parent:i}=e;if(e.valueMap.hasOwn(n.key))return r;let a=i.valueMap.get(n.key);e.logger.info(`📃`,`atom`,n.key,`copying`);let o=a.toJSON(),s=n.class.fromJSON(o);e.valueMap.set(n.key,s),new dn(n,i),r=s}return r}function bn(e,t){let n=e.valueMap.get(t);if(n instanceof ke){let r=e.readonlySelectors.get(t),i=e.writableSelectors.get(t),a=xt(e,r??i);n.use(a);return}e.operation.open&&e.operation.prev.set(t,n),e.valueMap.delete(t),e.logger.info(`🗑`,`state`,t,`evicted`)}function xn(e,t){let n=I(e),{key:r,type:i}=t,a=n.selectorAtoms.getRelatedKeys(r);if(n.logger.info(`🧹`,i,r,a?`evicting ${a.size} states downstream:`:`no downstream states`,a??`to evict`),a){n.operation.open&&n.logger.info(`🧹`,i,r,`[ ${[...n.operation.done].join(`, `)} ] already done`);for(let e of a)Mt(n,e)||(bn(n,e),Nt(n,e))}}function Sn(e,t){let n=I(e),r=n.selectorGraph.getRelationEntries({upstreamSelectorKey:t}).filter(([e,{source:n}])=>n===t);for(let[t]of r)Mt(n,t)||(bn(n,t),Nt(n,t),Sn(e,t))}function Cn(e,t,n,r){let i=`atom`,{key:a}=t;e.logger.info(`🔨`,i,a,`is being created`);let o=I(e),s=o.atoms.get(a);if(s?.type===i&&e.config.isProduction===!0)return e.logger.error(`❌`,`atom`,a,`Tried to create atom, but it already exists in the store.`),R(s);let c=new N,l={...t,type:i,install:e=>(e.logger.info(`🛠️`,i,a,`installing in store "${e.config.name}"`),Cn(e,t,n)),subject:c};n&&(l.family=n),r&&(l.internalRoles=r),o.atoms.set(a,l);let u=R(l);if(t.effects){let n=0,r=[];for(let i of t.effects){let t=i({resetSelf:()=>{Bt(e,u)},setSelf:t=>{K(e,u,t)},onSet:t=>ln(e,u,`effect[${n}]`,t),token:u,store:Me(e)});t&&r.push(t),++n}l.cleanup=()=>{for(let e of r)e instanceof Promise?e.then(e=>e?.()):e()}}return e.on.atomCreation.next(u),u}function wn(e,t){return`internalRoles`in e&&e.internalRoles.includes(t)}function Tn(e,t){let n=I(e),{key:r,family:i}=t,a=H(n,t);if(!i)e.logger.error(`❌`,`atom`,r,`Standalone atoms cannot be disposed.`);else{a.cleanup?.();let o=e.valueMap.has(a.key),s=H(e,Be(e,t)).subject,c={type:`atom_disposal`,token:t,timestamp:Date.now()};o&&(c.value=e.valueMap.get(a.key)),s.next(c);let l=z(n);if(n.atoms.delete(r),n.valueMap.delete(r),n.selectorAtoms.delete(r),n.atomsThatAreDefault.delete(r),n.moleculeData.delete(i.key,i.subKey),e.timelineTopics.delete(r),t.type===`mutable_atom`&&(Tn(e,_n(t)),e.trackers.delete(r)),e.logger.info(`🔥`,`atom`,r,`deleted`),l&&n.transactionMeta.phase===`building`){let e=n.transactionMeta.update.subEvents.at(-1),t=e?.type===`molecule_disposal`&&e.values.some(([e])=>e===a.family?.key),r=wn(a,`tracker:signal`);!t&&!r&&n.transactionMeta.update.subEvents.push(c)}else e.on.atomDisposal.next(t)}}function En(e){return Cn(V.STORE,e,void 0)}function Dn(e){return wt(V.STORE,e)}function On(...e){return W(V.STORE,...e)}var J={atom_family:`atom family`,atom:`atom`,continuity:`continuity`,key:`key`,mutable_atom_family:`atom family [m]`,mutable_atom:`atom [m]`,readonly_held_selector_family:`selector family [h]`,readonly_held_selector:`selector [h]`,readonly_pure_selector_family:`selector family`,readonly_pure_selector:`selector`,socket:`socket`,state:`state`,timeline:`timeline`,timeline_family:`timeline family`,transaction:`transaction`,unknown:`unknown`,user:`👤`,writable_held_selector_family:`selector family [wh]`,writable_held_selector:`selector [wh]`,writable_pure_selector_family:`selector family [w]`,writable_pure_selector:`selector [w]`},kn=(e,t)=>(n,r,i,a,...o)=>{console[e](`${t?`${t} `:``}${n} ${J[r]} \`${i}\` ${a}`,...o)},An={error:kn(`error`),info:kn(`info`),warn:kn(`warn`)},jn=class{logLevel;filter;logger;constructor(e,t,n=An){this.logLevel=e,this.filter=t,this.logger=n}error=(...e)=>{if(this.logLevel!==null){let t=this.filter?.(...e)??!0;t===!0?this.logger.error(...e):t&&this.logger.error(...t)}};info=(...e)=>{if(this.logLevel===`info`){let t=this.filter?.(...e)??!0;t===!0?this.logger.info(...e):t&&this.logger.info(...t)}};warn=(...e)=>{if(this.logLevel!==`error`&&this.logLevel!==null){let t=this.filter?.(...e)??!0;t===!0?this.logger.warn(...e):t&&this.logger.warn(...t)}}},Mn=class extends Error{constructor(e,t){super(`${J[e.type]} ${M(e.key)} not found in store "${t}".`)}};function Nn(...e){Bt(V.STORE,...e)}function Pn(e){return Ot(V.STORE,e)}function Y(...e){K(V.STORE,...e)}function Fn(e){return vt(V.STORE,e)}function In(e,t=je()){return Re(V.STORE,e,t)}var X,Z,Ln,Rn,zn=0,Bn=[],Q=t,Vn=Q.__b,Hn=Q.__r,Un=Q.diffed,Wn=Q.__c,Gn=Q.unmount,Kn=Q.__;function qn(e,t){Q.__h&&Q.__h(Z,e,zn||t),zn=0;var n=Z.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function Jn(e){return zn=1,Yn(lr,e)}function Yn(e,t,n){var r=qn(X++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):lr(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=Z,!Z.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=!1,o=r.__c.props!==e;if(r.__c.__H.__.some(function(e){if(e.__N){i=!0;var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),a){var s=a.call(this,e,t,n);return i?s||o:s}return!i||o};Z.__f=!0;var a=Z.shouldComponentUpdate,o=Z.componentWillUpdate;Z.componentWillUpdate=function(e,t,n){if(this.__e){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},Z.shouldComponentUpdate=i}return r.__N||r.__}function Xn(e,t){var n=qn(X++,3);!Q.__s&&cr(n.__H,t)&&(n.__=e,n.u=t,Z.__H.__h.push(n))}function Zn(e,t){var n=qn(X++,4);!Q.__s&&cr(n.__H,t)&&(n.__=e,n.u=t,Z.__h.push(n))}function Qn(e){return zn=5,$n(function(){return{current:e}},[])}function $n(e,t){var n=qn(X++,7);return cr(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function er(e,t){return zn=8,$n(function(){return e},t)}function tr(e){var t=Z.context[e.__c],n=qn(X++,9);return n.c=e,t?(n.__??(n.__=!0,t.sub(Z)),t.props.value):e.__}function nr(){var e=qn(X++,11);if(!e.__){for(var t=Z.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||=[0,0];e.__=`P`+n[0]+`-`+n[1]++}return e.__}function rr(){for(var e;e=Bn.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(or),t.__h.some(sr),t.__h=[]}catch(n){t.__h=[],Q.__e(n,e.__v)}}}Q.__b=function(e){Z=null,Vn&&Vn(e)},Q.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Kn&&Kn(e,t)},Q.__r=function(e){Hn&&Hn(e),X=0;var t=(Z=e.__c).__H;t&&(Ln===Z?(t.__h=[],Z.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(or),t.__h.some(sr),t.__h=[],X=0)),Ln=Z},Q.diffed=function(e){Un&&Un(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Bn.push(t)!==1&&Rn===Q.requestAnimationFrame||((Rn=Q.requestAnimationFrame)||ar)(rr)),t.__H.__.some(function(e){e.u&&=(e.__H=e.u,void 0)})),Ln=Z=null},Q.__c=function(e,t){t.some(function(e){try{e.__h.some(or),e.__h=e.__h.filter(function(e){return!e.__||sr(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],Q.__e(n,e.__v)}}),Wn&&Wn(e,t)},Q.unmount=function(e){Gn&&Gn(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{or(e)}catch(e){t=e}}),n.__H=void 0,t&&Q.__e(t,n.__v))};var ir=typeof requestAnimationFrame==`function`;function ar(e){var t,n=function(){clearTimeout(r),ir&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);ir&&(t=requestAnimationFrame(n))}function or(e){var t=Z,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),Z=t}function sr(e){var t=Z;e.__c=e.__(),Z=t}function cr(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function lr(e,t){return typeof t==`function`?t(e):t}function ur(e,t){for(var n in t)e[n]=t[n];return e}function dr(e,t){for(var n in e)if(n!==`__source`&&!(n in t))return!0;for(var r in t)if(r!==`__source`&&e[r]!==t[r])return!0;return!1}function fr(e,t){var n=t(),r=Jn({t:{__:n,u:t}}),i=r[0].t,a=r[1];return Zn(function(){i.__=n,i.u=t,pr(i)&&a({t:i})},[e,n,t]),Xn(function(){return pr(i)&&a({t:i}),e(function(){pr(i)&&a({t:i})})},[e]),n}function pr(e){try{return!((t=e.__)===(n=e.u())&&(t!==0||1/t==1/n)||t!=t&&n!=n)}catch{return!0}var t,n}function mr(e,t){this.props=e,this.context=t}(mr.prototype=new C).isPureReactComponent=!0,mr.prototype.shouldComponentUpdate=function(e,t){return dr(this.props,e)||dr(this.state,t)};var hr=t.__b;t.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),hr&&hr(e)},typeof Symbol<`u`&&Symbol.for;var gr=t.__e;t.__e=function(e,t,n,r){if(e.then){for(var i,a=t;a=a.__;)if((i=a.__c)&&i.__c)return t.__e??(t.__e=n.__e,t.__k=n.__k||[]),i.__c(e,t)}gr(e,t,n,r)};var _r=t.unmount;function vr(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){typeof e.__c==`function`&&e.__c()}),e.__c.__H=null),(e=ur({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return vr(e,t,n)})),e}function yr(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return yr(e,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function br(){this.__u=0,this.o=null,this.__b=null}function xr(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function Sr(){this.i=null,this.l=null}t.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),_r&&_r(e)},(br.prototype=new C).__c=function(e,t){var n=t.__c,r=this;r.o??=[],r.o.push(n);var i=xr(r.__v),a=!1,o=function(){a||r.__z||(a=!0,n.__R=null,i?i(c):c())};n.__R=o;var s=n.__P;n.__P=null;var c=function(){if(!--r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=yr(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.o.pop();)t.__P=s,t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(o,o)},br.prototype.componentWillUnmount=function(){this.o=[]},br.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement(`div`),r=this.__v.__k[0].__c;this.__v.__k[0]=vr(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__a&&b(S,null,e.fallback);return i&&(i.__u&=-33),[b(S,null,t.__a?null:e.children),i]};var Cr=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!==`t`||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(Sr.prototype=new C).__a=function(e){var t=this,n=xr(t.__v),r=t.l.get(e);return r[0]++,function(i){var a=function(){t.props.revealOrder?(r.push(i),Cr(t,e,r)):i()};n?n(a):a()}},Sr.prototype.render=function(e){this.i=null,this.l=new Map;var t=k(e.children);e.revealOrder&&e.revealOrder[0]===`b`&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},Sr.prototype.componentDidUpdate=Sr.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){Cr(e,n,t)})};var wr=typeof Symbol<`u`&&Symbol.for&&Symbol.for(`react.element`)||60103,Tr=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Er=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Dr=/[A-Z0-9]/g,Or=typeof document<`u`,kr=function(e){return(typeof Symbol<`u`&&typeof Symbol()==`symbol`?/fil|che|rad/:/fil|che|ra/).test(e)};C.prototype.isReactComponent=!0,[`componentWillMount`,`componentWillReceiveProps`,`componentWillUpdate`].forEach(function(e){Object.defineProperty(C.prototype,e,{configurable:!0,get:function(){return this[`UNSAFE_`+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Ar=t.event;t.event=function(e){return Ar&&(e=Ar(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var jr={configurable:!0,get:function(){return this.class}},Mr=t.vnode;t.vnode=function(e){typeof e.type==`string`&&function(e){var t=e.props,n=e.type,r={},i=n.indexOf(`-`)==-1;for(var a in t){var o=t[a];if(!(a===`value`&&`defaultValue`in t&&o==null||Or&&a===`children`&&n===`noscript`||a===`class`||a===`className`)){var s=a.toLowerCase();a===`defaultValue`&&`value`in t&&t.value==null?a=`value`:a===`download`&&!0===o?o=``:s===`translate`&&o===`no`?o=!1:s[0]===`o`&&s[1]===`n`?s===`ondoubleclick`?a=`ondblclick`:s!==`onchange`||n!==`input`&&n!==`textarea`||kr(t.type)?s===`onfocus`?a=`onfocusin`:s===`onblur`?a=`onfocusout`:Er.test(a)&&(a=s):s=a=`oninput`:i&&Tr.test(a)?a=a.replace(Dr,`-$&`).toLowerCase():o===null&&(o=void 0),s===`oninput`&&r[a=s]&&(a=`oninputCapture`),r[a]=o}}n==`select`&&(r.multiple&&Array.isArray(r.value)&&(r.value=k(t.children).forEach(function(e){e.props.selected=r.value.indexOf(e.props.value)!=-1})),r.defaultValue!=null&&(r.value=k(t.children).forEach(function(e){e.props.selected=r.multiple?r.defaultValue.indexOf(e.props.value)!=-1:r.defaultValue==e.props.value}))),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,"className",jr)):t.className&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=wr,Mr&&Mr(e)};var Nr=t.__r;t.__r=function(e){Nr&&Nr(e),e.__c};var Pr=t.diffed;t.diffed=function(e){Pr&&Pr(e);var t=e.props,n=e.__e;n!=null&&e.type===`textarea`&&`value`in t&&t.value!==n.value&&(n.value=t.value==null?``:t.value)};var Fr=0;Array.isArray;function $(e,n,r,i,a,o){n||={};var s,c,l=n;if(`ref`in l)for(c in l={},n)c==`ref`?s=n[c]:l[c]=n[c];var u={type:e,props:l,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Fr,__i:-1,__u:0,__source:a,__self:o};if(typeof e==`function`&&(s=e.defaultProps))for(c in s)l[c]===void 0&&(l[c]=s[c]);return t.vnode&&t.vnode(u),u}var Ir=ge(V.STORE);function Lr(...e){let t,n,r=tr(Ir);if(e.length===3){let i=e[0],a=e[1];t=G(r,i,a),n=e[2]}else t=e[0],n=e[1];let i=n(null);return Xn(()=>{K(r,t,i.current)},[t]),i}function Rr(e,...t){let n;if(t.length===2){let r=t[0],i=t[1];n=G(e,r,i)}else n=t[0];return n}function zr(...e){let t=tr(Ir),n=Rr(t,...e),r=nr();if(n.type===`mutable_atom`||n.type===`readonly_held_selector`||n.type===`writable_held_selector`){let[,e]=Jn(0),i=Qn(null),a=i.current;return(a===null||a.store!==t||a.tokenKey!==n.key)&&(a={store:t,tokenKey:n.key,value:W(t,n)},i.current=a),Xn(()=>ln(t,n,`use-o:${r}`,({newValue:t})=>{a.value=t,e(e=>e+1)}),[t,n.key]),a.value}let i=er(e=>ln(t,n,`use-o:${r}`,e),[t,n.key]),a=er(()=>W(t,n),[t,n.key]);return fr(i,a,a)}var Br=En({key:`pathKeys`,default:[]}),Vr=Dn({key:`subpathKeys`,default:[]}),Hr=Dn({key:`node`,default:null}),Ur=Dn({key:`edge`,default:!0}),Wr=Pn({key:`pathDraw`,get:e=>({get:t})=>t(Vr,e).map((e,n)=>{let r=t(Hr,e),i=t(Ur,e);return r===null?`Z`:n===0||i===!1?`M ${r.x} ${r.y}`:i===!0?`L ${r.x} ${r.y}`:`c`in i?`C ${i.c.x} ${i.c.y} ${i.s.x} ${i.s.y} ${r.x} ${r.y}`:`S ${i.s.x} ${i.s.y} ${r.x} ${r.y}`}).join(` `)});function Gr(e,t,n){return Math.max(t,Math.min(n,e))}function Kr({at:e,subpathKey:t,prevSubpathKey:n,node:r}){let i;switch(typeof r){case`undefined`:i=zr(Hr,n);break;default:i=r}return i===null?null:$(S,{children:[$(`line`,{class:`bezier`,x1:i.x,y1:i.y,x2:e.x,y2:e.y,stroke:`#777`,"stroke-width":1}),$(`circle`,{class:`bezier`,fill:`#777`,stroke:`#aaa`,"stroke-width":1,cx:e.x,cy:e.y,r:2}),$(`circle`,{class:`bezier-draggable`,fill:`transparent`,cx:e.x,cy:e.y,r:6,onPointerDown:e=>{e.currentTarget.setPointerCapture(e.pointerId),Y(Qr,{key:t,by:r?`s`:`c`})}})]})}function qr({subpathKey:e,nextSubpathKey:t}){let n=zr(Hr,e),r=zr(Ur,e);return n===null?null:$(S,{children:[typeof r==`boolean`?$(`rect`,{class:`node`,x:n.x-3,y:n.y-3,width:6,height:6}):$(S,{children:[$(Kr,{at:r.s,node:n,subpathKey:e,prevSubpathKey:t}),r.c?$(Kr,{at:r.c,subpathKey:e,prevSubpathKey:t}):null,$(`circle`,{class:`node`,cx:n.x,cy:n.y,r:3})]}),$(`circle`,{class:`node-draggable`,fill:`transparent`,cx:n.x,cy:n.y,r:10,onPointerDown:t=>{t.currentTarget.setPointerCapture(t.pointerId),Y(Qr,{key:e})}})]})}function Jr({pathKey:e}){return $(`path`,{d:`${zr(Wr,e)} Z`,class:`path`,style:{pointerEvents:`none`}})}function Yr({pathKey:e}){let t=zr(Vr,e);return $(S,{children:[$(Jr,{pathKey:e}),t.toReversed().map((e,t,n)=>$(qr,{subpathKey:e,nextSubpathKey:n[t+1]??n[0]},e))]})}function Xr(){return $(S,{children:zr(Br).map(e=>$(Yr,{pathKey:e},e))})}var Zr=En({key:`svgRef`,default:null}),Qr=En({key:`currentlyDragging`,default:null});function $r(e){e.preventDefault();let{key:t,by:n}=On(Qr)??{},r=On(Zr);if(!r||!t)return;let i=r.createSVGPoint();i.x=e.clientX,i.y=e.clientY;let a=r.getScreenCTM()?.inverse(),{x:o,y:s}=i.matrixTransform(a);switch(n){case void 0:Y(Hr,t,{x:Gr(o,-185,ri+185),y:Gr(s,-10,ii+10)});break;case`s`:Y(Ur,t,e=>({...e,s:{x:Gr(o,-185,ri+185),y:Gr(s,-10,ii+10)}}));break;case`c`:Y(Ur,t,e=>({...e,c:{x:Gr(o,-185,ri+185),y:Gr(s,-10,ii+10)}}));break}}var ei=[`m`,`M`,`l`,`L`,`c`,`C`,`v`,`V`,`z`,`Z`],ti=En({key:`preactLogo`,default:()=>fetch(`preact.svg`).then(e=>e.text())}),ni=In(Fn({key:`reset`,do:async()=>{let e=await On(ti);for(let e of On(Br))Nn(Vr,e);Nn(Br);let t=e.split(`
|
|
5
|
-
`).filter(e=>e.startsWith(` <path`)).map(e=>{let t=e.split(`d="`)[1].slice(0,-9),n,r=``,i=[],a=[];for(let e of t){if(ei.includes(e)){r&&=(i.push(Number.parseFloat(r)),``),n&&a.push({letter:n,numbers:i}),n=e,i=[];continue}if(e===` `){i.push(Number.parseFloat(r)),r=``;continue}if(e===`-`&&r){i.push(Number.parseFloat(r)),r=`-`;continue}r+=e}let o={x:0,y:0};return a.map(({letter:e,numbers:t})=>{let n,r;switch(e){case`m`:n={x:o.x+t[0],y:o.y+t[1]},r=!1;break;case`M`:n={x:t[0],y:t[1]},r=!1;break;case`l`:n={x:o.x+t[0],y:o.y+t[1]},r=!0;break;case`L`:n={x:t[0],y:t[1]},r=!0;break;case`c`:n={x:o.x+t[4],y:o.y+t[5]},r={c:{x:o.x+t[0],y:o.y+t[1]},s:{x:o.x+t[2],y:o.y+t[3]}};break;case`C`:n={x:t[4],y:t[5]},r={c:{x:t[0],y:t[1]},s:{x:t[2],y:t[3]}};break;case`v`:n={x:o.x,y:o.y+t[0]},r=!0;break;case`V`:n={x:o.x,y:t[0]},r=!0;break;case`z`:case`Z`:n=null,r=!0}return n&&(o=n),{node:n,edge:r}})}),n=0,r=0;for(let e of t){let t=r;for(let{node:t,edge:n}of e)Y(Ur,`subpath${r}`,n),Y(Hr,`subpath${r}`,t),r++;let i=r-t;Y(Vr,`path${n}`,Array.from({length:i},(e,n)=>`subpath${t+n}`)),Y(Br,e=>[...e,`path${n}`]),n++}}})),ri=256,ii=296;function ai(){let e=Lr(Zr,Qn),t=er(e=>{e.currentTarget.releasePointerCapture(e.pointerId),Y(Qr,null)},[]);return Xn(()=>void ni(),[]),$(`div`,{style:{display:`flex`,flexFlow:`column`,position:`relative`,overflow:`hidden`,maxWidth:`1280px`,width:`100vw`,alignItems:`center`},children:[$(`svg`,{ref:e,viewBox:`-185 -15 626 326`,width:1e3,height:500,onPointerMove:$r,onPointerUp:t,onPointerCancel:t,children:[$(`title`,{children:`Bezier Playground`}),$(`defs`,{children:$(`pattern`,{id:`grid`,width:`5`,height:`5`,patternUnits:`userSpaceOnUse`,children:$(`rect`,{x:`0`,y:`0`,width:`.5`,height:`.5`,fill:`none`,stroke:`#aaa`})})}),$(`rect`,{x:0,y:0,width:ri,height:ii,fill:`#aaa3`}),$(`rect`,{x:-185,y:-10,width:626,height:316,fill:`url(#grid)`}),$(Xr,{})]}),$(`button`,{type:`button`,class:`flat`,onClick:ni,children:`Reset`})]})}function oi(){return $(S,{children:[$(`h1`,{children:`Atom.io in Preact on Vite`}),$(`main`,{children:[$(ai,{}),$(`article`,{children:[$(si,{title:`Learn Atom.io`,description:`Atom.io is where data lives.`,href:`https://atom.io.fyi/docs/tutorial`}),$(si,{title:`Learn Preact`,description:`If you're new to Preact, try the interactive tutorial to learn important concepts`,href:`https://preactjs.com/tutorial`}),$(si,{title:`Learn Vite`,description:`To learn more about Vite and how you can customize it to fit your needs, take a look at their excellent documentation`,href:`https://vitejs.dev`})]})]})]})}function si(e){return $(`a`,{href:e.href,target:`_blank`,class:`resource`,rel:`noreferrer`,children:[$(`h2`,{children:e.title}),$(`p`,{children:e.description})]})}he($(oi,{}),document.getElementById(`app`));
|