@zhin.js/console 1.0.13 → 1.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/README.md +144 -1
- package/dist/client.js +1 -9
- package/dist/index.js +1 -9
- package/dist/lucide-react.js +0 -9294
- package/dist/radix-ui-themes.js +272 -288
- package/dist/radix-ui.js +337 -348
- package/dist/react-dom-client.js +22 -76
- package/dist/react-dom.js +1 -10
- package/dist/react-jsx-dev-runtime.js +1 -10
- package/dist/react-jsx-runtime.js +1 -10
- package/dist/react-router.js +5517 -4507
- package/dist/react.js +1 -10
- package/dist/style.css +2 -2
- package/lib/dev.js +76 -63
- package/lib/index.d.ts +18 -7
- package/lib/index.js +337 -102
- package/lib/websocket.d.ts +1 -0
- package/lib/websocket.js +69 -1
- package/package.json +19 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @zhin.js/console
|
|
2
2
|
|
|
3
|
+
## 1.0.15
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f9faa1d: fix: test release
|
|
8
|
+
- Updated dependencies [f9faa1d]
|
|
9
|
+
- @zhin.js/client@1.0.7
|
|
10
|
+
- @zhin.js/core@1.0.19
|
|
11
|
+
- @zhin.js/http@1.0.10
|
|
12
|
+
|
|
13
|
+
## 1.0.14
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- d16a69c: fix: test trust publish
|
|
18
|
+
- Updated dependencies [d16a69c]
|
|
19
|
+
- @zhin.js/client@1.0.6
|
|
20
|
+
- @zhin.js/core@1.0.18
|
|
21
|
+
- @zhin.js/http@1.0.9
|
|
22
|
+
|
|
3
23
|
## 1.0.13
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -24,10 +24,34 @@ Zhin 机器人框架的 Web 控制台插件,提供开发环境下的可视化
|
|
|
24
24
|
|
|
25
25
|
## 安装
|
|
26
26
|
|
|
27
|
+
### 开发环境(完整安装)
|
|
28
|
+
|
|
27
29
|
```bash
|
|
28
30
|
npm install @zhin.js/console
|
|
31
|
+
# 或
|
|
32
|
+
pnpm add @zhin.js/console
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### 生产环境(轻量安装)
|
|
36
|
+
|
|
37
|
+
**重要**:生产环境不需要 React、Vite 等依赖!
|
|
38
|
+
|
|
39
|
+
前端代码已在构建时打包到 `dist/` 目录,运行时只需要:
|
|
40
|
+
- `mime`:文件类型识别
|
|
41
|
+
- `ws`:WebSocket 服务器
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# 生产环境安装(自动跳过 devDependencies)
|
|
45
|
+
npm install @zhin.js/console --production
|
|
46
|
+
# 或
|
|
47
|
+
pnpm add @zhin.js/console --prod
|
|
29
48
|
```
|
|
30
49
|
|
|
50
|
+
**效果**:
|
|
51
|
+
- ✅ 磁盘占用:~2MB(vs 开发环境 ~200MB)
|
|
52
|
+
- ✅ 运行时内存:17MB(直接读取静态文件)
|
|
53
|
+
- ✅ 依赖数量:2 个(vs 开发环境 20+ 个)
|
|
54
|
+
|
|
31
55
|
## 使用
|
|
32
56
|
|
|
33
57
|
### 基本配置
|
|
@@ -38,7 +62,7 @@ import '@zhin.js/console'
|
|
|
38
62
|
```
|
|
39
63
|
|
|
40
64
|
插件会自动:
|
|
41
|
-
1. 启动 Vite
|
|
65
|
+
1. 启动 Vite 开发服务器(开发模式)
|
|
42
66
|
2. 配置路由中间件
|
|
43
67
|
3. 设置 WebSocket 连接
|
|
44
68
|
4. 提供静态文件服务
|
|
@@ -50,6 +74,125 @@ import '@zhin.js/console'
|
|
|
50
74
|
http://localhost:8086/vite/
|
|
51
75
|
```
|
|
52
76
|
|
|
77
|
+
### 配置选项
|
|
78
|
+
|
|
79
|
+
在 `zhin.config.yml` 中配置 console 插件:
|
|
80
|
+
|
|
81
|
+
```yaml
|
|
82
|
+
plugins:
|
|
83
|
+
console:
|
|
84
|
+
# 是否启用控制台插件,默认 true
|
|
85
|
+
enabled: true
|
|
86
|
+
|
|
87
|
+
# 是否延迟加载 Vite(开发模式),默认 false
|
|
88
|
+
# false: 启动时立即加载 Vite(推荐,确保 addEntry 等功能可用)
|
|
89
|
+
# true: 首次访问时才启动 Vite(节省 ~23MB 内存,但可能导致其他插件功能异常)
|
|
90
|
+
lazyLoad: false
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
#### ⚠️ 关于 lazyLoad 的重要说明
|
|
94
|
+
|
|
95
|
+
**默认值为 `false`(不延迟加载)**,原因:
|
|
96
|
+
|
|
97
|
+
1. **其他插件依赖 `addEntry`**:`@zhin.js/adapter-sandbox`、`@zhin.js/adapter-icqq` 等插件需要在启动时调用 `web.addEntry()` 注册前端入口
|
|
98
|
+
2. **WebSocket 需要提前准备**:实时通信功能需要 WebSocket 服务器立即可用
|
|
99
|
+
3. **用户体验更好**:访问控制台时立即可用,无需等待 Vite 启动
|
|
100
|
+
|
|
101
|
+
**如果你确定不需要这些功能**,可以启用延迟加载节省内存:
|
|
102
|
+
```yaml
|
|
103
|
+
plugins:
|
|
104
|
+
console:
|
|
105
|
+
lazyLoad: true # 节省 ~23MB 启动内存
|
|
106
|
+
```
|
|
107
|
+
- ✅ 启动时内存: **18-20MB**
|
|
108
|
+
- ⚠️ 首次访问控制台: **+23MB**(Vite + React 生态)
|
|
109
|
+
- 💡 适合:不常访问控制台的生产环境
|
|
110
|
+
|
|
111
|
+
**立即加载模式**:
|
|
112
|
+
```yaml
|
|
113
|
+
plugins:
|
|
114
|
+
console:
|
|
115
|
+
lazyLoad: false
|
|
116
|
+
```
|
|
117
|
+
- ⚠️ 启动时内存: **42MB**
|
|
118
|
+
- ✅ 访问控制台: 无延迟
|
|
119
|
+
- 💡 适合:频繁使用控制台的开发环境
|
|
120
|
+
|
|
121
|
+
**禁用控制台**:
|
|
122
|
+
```yaml
|
|
123
|
+
plugins:
|
|
124
|
+
console:
|
|
125
|
+
enabled: false
|
|
126
|
+
```
|
|
127
|
+
- ✅ 内存: **0MB**(不加载)
|
|
128
|
+
- 💡 适合:生产环境或不需要 Web 控制台
|
|
129
|
+
|
|
130
|
+
## 生产环境优化
|
|
131
|
+
|
|
132
|
+
### 依赖优化
|
|
133
|
+
|
|
134
|
+
Console 插件采用**构建时打包**策略:
|
|
135
|
+
|
|
136
|
+
**构建时**(开发环境):
|
|
137
|
+
```bash
|
|
138
|
+
# 安装所有依赖(包括 React、Vite)
|
|
139
|
+
pnpm install
|
|
140
|
+
|
|
141
|
+
# 构建前端到 dist/ 目录
|
|
142
|
+
pnpm --filter @zhin.js/console build:client
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
**运行时**(生产环境):
|
|
146
|
+
```bash
|
|
147
|
+
# 只安装生产依赖(mime + ws)
|
|
148
|
+
pnpm install --prod
|
|
149
|
+
|
|
150
|
+
# 直接读取 dist/ 静态文件,无需 React
|
|
151
|
+
NODE_ENV=production pnpm start
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
**节省效果**:
|
|
155
|
+
- ✅ 磁盘空间: ~200MB → ~2MB(98% 减少)
|
|
156
|
+
- ✅ 依赖数量: 20+ → 2(90% 减少)
|
|
157
|
+
- ✅ 运行时内存: 保持 17MB(无额外开销)
|
|
158
|
+
|
|
159
|
+
### 环境变量
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
# 生产模式(使用预构建的静态文件)
|
|
163
|
+
NODE_ENV=production pnpm start
|
|
164
|
+
|
|
165
|
+
# 开发模式(使用 Vite HMR)
|
|
166
|
+
NODE_ENV=development pnpm dev
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### 部署建议
|
|
170
|
+
|
|
171
|
+
1. **仅 API 服务**:禁用 console 插件
|
|
172
|
+
```yaml
|
|
173
|
+
plugins:
|
|
174
|
+
console:
|
|
175
|
+
enabled: false
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
2. **需要 Web 控制台**:使用静态模式
|
|
179
|
+
```bash
|
|
180
|
+
# 构建前端
|
|
181
|
+
pnpm --filter @zhin.js/console build:client
|
|
182
|
+
|
|
183
|
+
# 生产环境启动(自动使用静态文件)
|
|
184
|
+
NODE_ENV=production pnpm start
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
3. **开发环境**:使用完整功能
|
|
188
|
+
```bash
|
|
189
|
+
# 安装所有依赖(包括可选依赖)
|
|
190
|
+
pnpm install
|
|
191
|
+
|
|
192
|
+
# 开发模式启动
|
|
193
|
+
pnpm dev
|
|
194
|
+
```
|
|
195
|
+
|
|
53
196
|
## 核心功能
|
|
54
197
|
|
|
55
198
|
### Web 服务器集成
|
package/dist/client.js
CHANGED
|
@@ -1,9 +1 @@
|
|
|
1
|
-
import*as H from"./react.js";import Fr,{useMemo as ft,useCallback as F,useEffect as fe,useState as nr}from"./react.js";import{jsx as Ue}from"./react-jsx-runtime.js";import{createBrowserRouter as qr,RouterProvider as $r,Outlet as Gr}from"./react-router.js";import{Link as si,Outlet as ii,useNavigate as ai,useOutlet as ci,useParams as li}from"./react-router.js";function or(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=or(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Lr(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=or(e))&&(n&&(n+=" "),n+=t);return n}const pt="-",Ur=e=>{const t=Vr(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{const c=i.split(pt);return c[0]===""&&c.length!==1&&c.shift(),sr(c,t)||Br(i)},getConflictingClassGroupIds:(i,c)=>{const a=r[i]||[];return c&&n[i]?[...a,...n[i]]:a}}},sr=(e,t)=>{if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),o=n?sr(e.slice(1),n):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(pt);return t.validators.find(({validator:i})=>i(s))?.classGroupId},Nt=/^\[(.+)\]$/,Br=e=>{if(Nt.test(e)){const t=Nt.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Vr=e=>{const{theme:t,classGroups:r}=e,n={nextPart:new Map,validators:[]};for(const o in r)tt(r[o],n,o,t);return n},tt=(e,t,r,n)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:jt(t,o);s.classGroupId=r;return}if(typeof o=="function"){if(Hr(o)){tt(o(n),t,r,n);return}t.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([s,i])=>{tt(i,jt(t,s),r,n)})})},jt=(e,t)=>{let r=e;return t.split(pt).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},Hr=e=>e.isThemeGetter,Kr=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const o=(s,i)=>{r.set(s,i),t++,t>e&&(t=0,n=r,r=new Map)};return{get(s){let i=r.get(s);if(i!==void 0)return i;if((i=n.get(s))!==void 0)return o(s,i),i},set(s,i){r.has(s)?r.set(s,i):o(s,i)}}},rt="!",nt=":",Xr=nt.length,Jr=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=o=>{const s=[];let i=0,c=0,a=0,d;for(let k=0;k<o.length;k++){let m=o[k];if(i===0&&c===0){if(m===nt){s.push(o.slice(a,k)),a=k+Xr;continue}if(m==="/"){d=k;continue}}m==="["?i++:m==="]"?i--:m==="("?c++:m===")"&&c--}const l=s.length===0?o:o.substring(a),u=Qr(l),g=u!==l,y=d&&d>a?d-a:void 0;return{modifiers:s,hasImportantModifier:g,baseClassName:u,maybePostfixModifierPosition:y}};if(t){const o=t+nt,s=n;n=i=>i.startsWith(o)?s(i.substring(o.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:i,maybePostfixModifierPosition:void 0}}if(r){const o=n;n=s=>r({className:s,parseClassName:o})}return n},Qr=e=>e.endsWith(rt)?e.substring(0,e.length-1):e.startsWith(rt)?e.substring(1):e,Yr=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(n=>[n,!0]));return n=>{if(n.length<=1)return n;const o=[];let s=[];return n.forEach(i=>{i[0]==="["||t[i]?(o.push(...s.sort(),i),s=[]):s.push(i)}),o.push(...s.sort()),o}},Zr=e=>({cache:Kr(e.cacheSize),parseClassName:Jr(e),sortModifiers:Yr(e),...Ur(e)}),en=/\s+/,tn=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:s}=t,i=[],c=e.trim().split(en);let a="";for(let d=c.length-1;d>=0;d-=1){const l=c[d],{isExternal:u,modifiers:g,hasImportantModifier:y,baseClassName:k,maybePostfixModifierPosition:m}=r(l);if(u){a=l+(a.length>0?" "+a:a);continue}let x=!!m,_=n(x?k.substring(0,m):k);if(!_){if(!x){a=l+(a.length>0?" "+a:a);continue}if(_=n(k),!_){a=l+(a.length>0?" "+a:a);continue}x=!1}const O=s(g).join(":"),v=y?O+rt:O,b=v+_;if(i.includes(b))continue;i.push(b);const w=o(_,x);for(let C=0;C<w.length;++C){const R=w[C];i.push(v+R)}a=l+(a.length>0?" "+a:a)}return a};function rn(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=ir(t))&&(n&&(n+=" "),n+=r);return n}const ir=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=ir(e[n]))&&(r&&(r+=" "),r+=t);return r};function nn(e,...t){let r,n,o,s=i;function i(a){const d=t.reduce((l,u)=>u(l),e());return r=Zr(d),n=r.cache.get,o=r.cache.set,s=c,c(a)}function c(a){const d=n(a);if(d)return d;const l=tn(a,r);return o(a,l),l}return function(){return s(rn.apply(null,arguments))}}const T=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},ar=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,cr=/^\((?:(\w[\w-]*):)?(.+)\)$/i,on=/^\d+\/\d+$/,sn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,an=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,cn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ln=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,un=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ne=e=>on.test(e),E=e=>!!e&&!Number.isNaN(Number(e)),V=e=>!!e&&Number.isInteger(Number(e)),Be=e=>e.endsWith("%")&&E(e.slice(0,-1)),G=e=>sn.test(e),dn=()=>!0,fn=e=>an.test(e)&&!cn.test(e),lr=()=>!1,pn=e=>ln.test(e),hn=e=>un.test(e),mn=e=>!p(e)&&!h(e),gn=e=>se(e,fr,lr),p=e=>ar.test(e),X=e=>se(e,pr,fn),Ve=e=>se(e,Sn,E),Dt=e=>se(e,ur,lr),yn=e=>se(e,dr,hn),xe=e=>se(e,hr,pn),h=e=>cr.test(e),ce=e=>ie(e,pr),bn=e=>ie(e,kn),Wt=e=>ie(e,ur),wn=e=>ie(e,fr),vn=e=>ie(e,dr),Ce=e=>ie(e,hr,!0),se=(e,t,r)=>{const n=ar.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},ie=(e,t,r=!1)=>{const n=cr.exec(e);return n?n[1]?t(n[1]):r:!1},ur=e=>e==="position"||e==="percentage",dr=e=>e==="image"||e==="url",fr=e=>e==="length"||e==="size"||e==="bg-size",pr=e=>e==="length",Sn=e=>e==="number",kn=e=>e==="family-name",hr=e=>e==="shadow",xn=()=>{const e=T("color"),t=T("font"),r=T("text"),n=T("font-weight"),o=T("tracking"),s=T("leading"),i=T("breakpoint"),c=T("container"),a=T("spacing"),d=T("radius"),l=T("shadow"),u=T("inset-shadow"),g=T("text-shadow"),y=T("drop-shadow"),k=T("blur"),m=T("perspective"),x=T("aspect"),_=T("ease"),O=T("animate"),v=()=>["auto","avoid","all","avoid-page","page","left","right","column"],b=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],w=()=>[...b(),h,p],C=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto","contain","none"],f=()=>[h,p,a],A=()=>[ne,"full","auto",...f()],ae=()=>[V,"none","subgrid",h,p],ye=()=>["auto",{span:["full",V,h,p]},V,h,p],be=()=>[V,"auto",h,p],Pt=()=>["auto","min","max","fr",h,p],$e=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],re=()=>["start","end","center","stretch","center-safe","end-safe"],$=()=>["auto",...f()],K=()=>[ne,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...f()],S=()=>[e,h,p],At=()=>[...b(),Wt,Dt,{position:[h,p]}],Tt=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Mt=()=>["auto","cover","contain",wn,gn,{size:[h,p]}],Ge=()=>[Be,ce,X],z=()=>["","none","full",d,h,p],N=()=>["",E,ce,X],we=()=>["solid","dashed","dotted","double"],It=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],M=()=>[E,Be,Wt,Dt],zt=()=>["","none",k,h,p],ve=()=>["none",E,h,p],Se=()=>["none",E,h,p],Le=()=>[E,h,p],ke=()=>[ne,"full",...f()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[G],breakpoint:[G],color:[dn],container:[G],"drop-shadow":[G],ease:["in","out","in-out"],font:[mn],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[G],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[G],shadow:[G],spacing:["px",E],text:[G],"text-shadow":[G],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ne,p,h,x]}],container:["container"],columns:[{columns:[E,p,h,c]}],"break-after":[{"break-after":v()}],"break-before":[{"break-before":v()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:w()}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:A()}],"inset-x":[{"inset-x":A()}],"inset-y":[{"inset-y":A()}],start:[{start:A()}],end:[{end:A()}],top:[{top:A()}],right:[{right:A()}],bottom:[{bottom:A()}],left:[{left:A()}],visibility:["visible","invisible","collapse"],z:[{z:[V,"auto",h,p]}],basis:[{basis:[ne,"full","auto",c,...f()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[E,ne,"auto","initial","none",p]}],grow:[{grow:["",E,h,p]}],shrink:[{shrink:["",E,h,p]}],order:[{order:[V,"first","last","none",h,p]}],"grid-cols":[{"grid-cols":ae()}],"col-start-end":[{col:ye()}],"col-start":[{"col-start":be()}],"col-end":[{"col-end":be()}],"grid-rows":[{"grid-rows":ae()}],"row-start-end":[{row:ye()}],"row-start":[{"row-start":be()}],"row-end":[{"row-end":be()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Pt()}],"auto-rows":[{"auto-rows":Pt()}],gap:[{gap:f()}],"gap-x":[{"gap-x":f()}],"gap-y":[{"gap-y":f()}],"justify-content":[{justify:[...$e(),"normal"]}],"justify-items":[{"justify-items":[...re(),"normal"]}],"justify-self":[{"justify-self":["auto",...re()]}],"align-content":[{content:["normal",...$e()]}],"align-items":[{items:[...re(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...re(),{baseline:["","last"]}]}],"place-content":[{"place-content":$e()}],"place-items":[{"place-items":[...re(),"baseline"]}],"place-self":[{"place-self":["auto",...re()]}],p:[{p:f()}],px:[{px:f()}],py:[{py:f()}],ps:[{ps:f()}],pe:[{pe:f()}],pt:[{pt:f()}],pr:[{pr:f()}],pb:[{pb:f()}],pl:[{pl:f()}],m:[{m:$()}],mx:[{mx:$()}],my:[{my:$()}],ms:[{ms:$()}],me:[{me:$()}],mt:[{mt:$()}],mr:[{mr:$()}],mb:[{mb:$()}],ml:[{ml:$()}],"space-x":[{"space-x":f()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":f()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],w:[{w:[c,"screen",...K()]}],"min-w":[{"min-w":[c,"screen","none",...K()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[i]},...K()]}],h:[{h:["screen","lh",...K()]}],"min-h":[{"min-h":["screen","lh","none",...K()]}],"max-h":[{"max-h":["screen","lh",...K()]}],"font-size":[{text:["base",r,ce,X]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,h,Ve]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Be,p]}],"font-family":[{font:[bn,p,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,h,p]}],"line-clamp":[{"line-clamp":[E,"none",h,Ve]}],leading:[{leading:[s,...f()]}],"list-image":[{"list-image":["none",h,p]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",h,p]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:S()}],"text-color":[{text:S()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...we(),"wavy"]}],"text-decoration-thickness":[{decoration:[E,"from-font","auto",h,X]}],"text-decoration-color":[{decoration:S()}],"underline-offset":[{"underline-offset":[E,"auto",h,p]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:f()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",h,p]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",h,p]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:At()}],"bg-repeat":[{bg:Tt()}],"bg-size":[{bg:Mt()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},V,h,p],radial:["",h,p],conic:[V,h,p]},vn,yn]}],"bg-color":[{bg:S()}],"gradient-from-pos":[{from:Ge()}],"gradient-via-pos":[{via:Ge()}],"gradient-to-pos":[{to:Ge()}],"gradient-from":[{from:S()}],"gradient-via":[{via:S()}],"gradient-to":[{to:S()}],rounded:[{rounded:z()}],"rounded-s":[{"rounded-s":z()}],"rounded-e":[{"rounded-e":z()}],"rounded-t":[{"rounded-t":z()}],"rounded-r":[{"rounded-r":z()}],"rounded-b":[{"rounded-b":z()}],"rounded-l":[{"rounded-l":z()}],"rounded-ss":[{"rounded-ss":z()}],"rounded-se":[{"rounded-se":z()}],"rounded-ee":[{"rounded-ee":z()}],"rounded-es":[{"rounded-es":z()}],"rounded-tl":[{"rounded-tl":z()}],"rounded-tr":[{"rounded-tr":z()}],"rounded-br":[{"rounded-br":z()}],"rounded-bl":[{"rounded-bl":z()}],"border-w":[{border:N()}],"border-w-x":[{"border-x":N()}],"border-w-y":[{"border-y":N()}],"border-w-s":[{"border-s":N()}],"border-w-e":[{"border-e":N()}],"border-w-t":[{"border-t":N()}],"border-w-r":[{"border-r":N()}],"border-w-b":[{"border-b":N()}],"border-w-l":[{"border-l":N()}],"divide-x":[{"divide-x":N()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":N()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...we(),"hidden","none"]}],"divide-style":[{divide:[...we(),"hidden","none"]}],"border-color":[{border:S()}],"border-color-x":[{"border-x":S()}],"border-color-y":[{"border-y":S()}],"border-color-s":[{"border-s":S()}],"border-color-e":[{"border-e":S()}],"border-color-t":[{"border-t":S()}],"border-color-r":[{"border-r":S()}],"border-color-b":[{"border-b":S()}],"border-color-l":[{"border-l":S()}],"divide-color":[{divide:S()}],"outline-style":[{outline:[...we(),"none","hidden"]}],"outline-offset":[{"outline-offset":[E,h,p]}],"outline-w":[{outline:["",E,ce,X]}],"outline-color":[{outline:S()}],shadow:[{shadow:["","none",l,Ce,xe]}],"shadow-color":[{shadow:S()}],"inset-shadow":[{"inset-shadow":["none",u,Ce,xe]}],"inset-shadow-color":[{"inset-shadow":S()}],"ring-w":[{ring:N()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:S()}],"ring-offset-w":[{"ring-offset":[E,X]}],"ring-offset-color":[{"ring-offset":S()}],"inset-ring-w":[{"inset-ring":N()}],"inset-ring-color":[{"inset-ring":S()}],"text-shadow":[{"text-shadow":["none",g,Ce,xe]}],"text-shadow-color":[{"text-shadow":S()}],opacity:[{opacity:[E,h,p]}],"mix-blend":[{"mix-blend":[...It(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":It()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[E]}],"mask-image-linear-from-pos":[{"mask-linear-from":M()}],"mask-image-linear-to-pos":[{"mask-linear-to":M()}],"mask-image-linear-from-color":[{"mask-linear-from":S()}],"mask-image-linear-to-color":[{"mask-linear-to":S()}],"mask-image-t-from-pos":[{"mask-t-from":M()}],"mask-image-t-to-pos":[{"mask-t-to":M()}],"mask-image-t-from-color":[{"mask-t-from":S()}],"mask-image-t-to-color":[{"mask-t-to":S()}],"mask-image-r-from-pos":[{"mask-r-from":M()}],"mask-image-r-to-pos":[{"mask-r-to":M()}],"mask-image-r-from-color":[{"mask-r-from":S()}],"mask-image-r-to-color":[{"mask-r-to":S()}],"mask-image-b-from-pos":[{"mask-b-from":M()}],"mask-image-b-to-pos":[{"mask-b-to":M()}],"mask-image-b-from-color":[{"mask-b-from":S()}],"mask-image-b-to-color":[{"mask-b-to":S()}],"mask-image-l-from-pos":[{"mask-l-from":M()}],"mask-image-l-to-pos":[{"mask-l-to":M()}],"mask-image-l-from-color":[{"mask-l-from":S()}],"mask-image-l-to-color":[{"mask-l-to":S()}],"mask-image-x-from-pos":[{"mask-x-from":M()}],"mask-image-x-to-pos":[{"mask-x-to":M()}],"mask-image-x-from-color":[{"mask-x-from":S()}],"mask-image-x-to-color":[{"mask-x-to":S()}],"mask-image-y-from-pos":[{"mask-y-from":M()}],"mask-image-y-to-pos":[{"mask-y-to":M()}],"mask-image-y-from-color":[{"mask-y-from":S()}],"mask-image-y-to-color":[{"mask-y-to":S()}],"mask-image-radial":[{"mask-radial":[h,p]}],"mask-image-radial-from-pos":[{"mask-radial-from":M()}],"mask-image-radial-to-pos":[{"mask-radial-to":M()}],"mask-image-radial-from-color":[{"mask-radial-from":S()}],"mask-image-radial-to-color":[{"mask-radial-to":S()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[E]}],"mask-image-conic-from-pos":[{"mask-conic-from":M()}],"mask-image-conic-to-pos":[{"mask-conic-to":M()}],"mask-image-conic-from-color":[{"mask-conic-from":S()}],"mask-image-conic-to-color":[{"mask-conic-to":S()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:At()}],"mask-repeat":[{mask:Tt()}],"mask-size":[{mask:Mt()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",h,p]}],filter:[{filter:["","none",h,p]}],blur:[{blur:zt()}],brightness:[{brightness:[E,h,p]}],contrast:[{contrast:[E,h,p]}],"drop-shadow":[{"drop-shadow":["","none",y,Ce,xe]}],"drop-shadow-color":[{"drop-shadow":S()}],grayscale:[{grayscale:["",E,h,p]}],"hue-rotate":[{"hue-rotate":[E,h,p]}],invert:[{invert:["",E,h,p]}],saturate:[{saturate:[E,h,p]}],sepia:[{sepia:["",E,h,p]}],"backdrop-filter":[{"backdrop-filter":["","none",h,p]}],"backdrop-blur":[{"backdrop-blur":zt()}],"backdrop-brightness":[{"backdrop-brightness":[E,h,p]}],"backdrop-contrast":[{"backdrop-contrast":[E,h,p]}],"backdrop-grayscale":[{"backdrop-grayscale":["",E,h,p]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[E,h,p]}],"backdrop-invert":[{"backdrop-invert":["",E,h,p]}],"backdrop-opacity":[{"backdrop-opacity":[E,h,p]}],"backdrop-saturate":[{"backdrop-saturate":[E,h,p]}],"backdrop-sepia":[{"backdrop-sepia":["",E,h,p]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":f()}],"border-spacing-x":[{"border-spacing-x":f()}],"border-spacing-y":[{"border-spacing-y":f()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",h,p]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[E,"initial",h,p]}],ease:[{ease:["linear","initial",_,h,p]}],delay:[{delay:[E,h,p]}],animate:[{animate:["none",O,h,p]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,h,p]}],"perspective-origin":[{"perspective-origin":w()}],rotate:[{rotate:ve()}],"rotate-x":[{"rotate-x":ve()}],"rotate-y":[{"rotate-y":ve()}],"rotate-z":[{"rotate-z":ve()}],scale:[{scale:Se()}],"scale-x":[{"scale-x":Se()}],"scale-y":[{"scale-y":Se()}],"scale-z":[{"scale-z":Se()}],"scale-3d":["scale-3d"],skew:[{skew:Le()}],"skew-x":[{"skew-x":Le()}],"skew-y":[{"skew-y":Le()}],transform:[{transform:[h,p,"","none","gpu","cpu"]}],"transform-origin":[{origin:w()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ke()}],"translate-x":[{"translate-x":ke()}],"translate-y":[{"translate-y":ke()}],"translate-z":[{"translate-z":ke()}],"translate-none":["translate-none"],accent:[{accent:S()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:S()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",h,p]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":f()}],"scroll-mx":[{"scroll-mx":f()}],"scroll-my":[{"scroll-my":f()}],"scroll-ms":[{"scroll-ms":f()}],"scroll-me":[{"scroll-me":f()}],"scroll-mt":[{"scroll-mt":f()}],"scroll-mr":[{"scroll-mr":f()}],"scroll-mb":[{"scroll-mb":f()}],"scroll-ml":[{"scroll-ml":f()}],"scroll-p":[{"scroll-p":f()}],"scroll-px":[{"scroll-px":f()}],"scroll-py":[{"scroll-py":f()}],"scroll-ps":[{"scroll-ps":f()}],"scroll-pe":[{"scroll-pe":f()}],"scroll-pt":[{"scroll-pt":f()}],"scroll-pr":[{"scroll-pr":f()}],"scroll-pb":[{"scroll-pb":f()}],"scroll-pl":[{"scroll-pl":f()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",h,p]}],fill:[{fill:["none",...S()]}],"stroke-w":[{stroke:[E,ce,X,Ve]}],stroke:[{stroke:["none",...S()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Cn=nn(xn);function I(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var En=typeof Symbol=="function"&&Symbol.observable||"@@observable",Ft=En,He=()=>Math.random().toString(36).substring(7).split("").join("."),_n={INIT:`@@redux/INIT${He()}`,REPLACE:`@@redux/REPLACE${He()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${He()}`},Te=_n;function ht(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function mt(e,t,r){if(typeof e!="function")throw new Error(I(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(I(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(I(1));return r(mt)(e,t)}let n=e,o=t,s=new Map,i=s,c=0,a=!1;function d(){i===s&&(i=new Map,s.forEach((x,_)=>{i.set(_,x)}))}function l(){if(a)throw new Error(I(3));return o}function u(x){if(typeof x!="function")throw new Error(I(4));if(a)throw new Error(I(5));let _=!0;d();const O=c++;return i.set(O,x),function(){if(_){if(a)throw new Error(I(6));_=!1,d(),i.delete(O),s=null}}}function g(x){if(!ht(x))throw new Error(I(7));if(typeof x.type>"u")throw new Error(I(8));if(typeof x.type!="string")throw new Error(I(17));if(a)throw new Error(I(9));try{a=!0,o=n(o,x)}finally{a=!1}return(s=i).forEach(O=>{O()}),x}function y(x){if(typeof x!="function")throw new Error(I(10));n=x,g({type:Te.REPLACE})}function k(){const x=u;return{subscribe(_){if(typeof _!="object"||_===null)throw new Error(I(11));function O(){const b=_;b.next&&b.next(l())}return O(),{unsubscribe:x(O)}},[Ft](){return this}}}return g({type:Te.INIT}),{dispatch:g,subscribe:u,getState:l,replaceReducer:y,[Ft]:k}}function Rn(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:Te.INIT})>"u")throw new Error(I(12));if(typeof r(void 0,{type:Te.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(I(13))})}function gt(e){const t=Object.keys(e),r={};for(let s=0;s<t.length;s++){const i=t[s];typeof e[i]=="function"&&(r[i]=e[i])}const n=Object.keys(r);let o;try{Rn(r)}catch(s){o=s}return function(i={},c){if(o)throw o;let a=!1;const d={};for(let l=0;l<n.length;l++){const u=n[l],g=r[u],y=i[u],k=g(y,c);if(typeof k>"u")throw c&&c.type,new Error(I(14));d[u]=k,a=a||k!==y}return a=a||n.length!==Object.keys(i).length,a?d:i}}function Me(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function On(...e){return t=>(r,n)=>{const o=t(r,n);let s=()=>{throw new Error(I(15))};const i={getState:o.getState,dispatch:(a,...d)=>s(a,...d)},c=e.map(a=>a(i));return s=Me(...c)(o.dispatch),{...o,dispatch:s}}}function Pn(e){return ht(e)&&"type"in e&&typeof e.type=="string"}var mr=Symbol.for("immer-nothing"),qt=Symbol.for("immer-draftable"),j=Symbol.for("immer-state");function q(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var oe=Object.getPrototypeOf;function Z(e){return!!e&&!!e[j]}function B(e){return e?gr(e)||Array.isArray(e)||!!e[qt]||!!e.constructor?.[qt]||me(e)||De(e):!1}var An=Object.prototype.constructor.toString();function gr(e){if(!e||typeof e!="object")return!1;const t=oe(e);if(t===null)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===An}function Ie(e,t){je(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function je(e){const t=e[j];return t?t.type_:Array.isArray(e)?1:me(e)?2:De(e)?3:0}function ot(e,t){return je(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function yr(e,t,r){const n=je(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Tn(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function me(e){return e instanceof Map}function De(e){return e instanceof Set}function J(e){return e.copy_||e.base_}function st(e,t){if(me(e))return new Map(e);if(De(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=gr(e);if(t===!0||t==="class_only"&&!r){const n=Object.getOwnPropertyDescriptors(e);delete n[j];let o=Reflect.ownKeys(n);for(let s=0;s<o.length;s++){const i=o[s],c=n[i];c.writable===!1&&(c.writable=!0,c.configurable=!0),(c.get||c.set)&&(n[i]={configurable:!0,writable:!0,enumerable:c.enumerable,value:e[i]})}return Object.create(oe(e),n)}else{const n=oe(e);if(n!==null&&r)return{...e};const o=Object.create(n);return Object.assign(o,e)}}function yt(e,t=!1){return We(e)||Z(e)||!B(e)||(je(e)>1&&Object.defineProperties(e,{set:{value:Ee},add:{value:Ee},clear:{value:Ee},delete:{value:Ee}}),Object.freeze(e),t&&Object.values(e).forEach(r=>yt(r,!0))),e}function Ee(){q(2)}function We(e){return Object.isFrozen(e)}var Mn={};function ee(e){const t=Mn[e];return t||q(0,e),t}var pe;function br(){return pe}function In(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function $t(e,t){t&&(ee("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function it(e){at(e),e.drafts_.forEach(zn),e.drafts_=null}function at(e){e===pe&&(pe=e.parent_)}function Gt(e){return pe=In(pe,e)}function zn(e){const t=e[j];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Lt(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[j].modified_&&(it(t),q(4)),B(e)&&(e=ze(t,e),t.parent_||Ne(t,e)),t.patches_&&ee("Patches").generateReplacementPatches_(r[j].base_,e,t.patches_,t.inversePatches_)):e=ze(t,r,[]),it(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==mr?e:void 0}function ze(e,t,r){if(We(t))return t;const n=t[j];if(!n)return Ie(t,(o,s)=>Ut(e,n,t,o,s,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return Ne(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;const o=n.copy_;let s=o,i=!1;n.type_===3&&(s=new Set(o),o.clear(),i=!0),Ie(s,(c,a)=>Ut(e,n,o,c,a,r,i)),Ne(e,o,!1),r&&e.patches_&&ee("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function Ut(e,t,r,n,o,s,i){if(Z(o)){const c=s&&t&&t.type_!==3&&!ot(t.assigned_,n)?s.concat(n):void 0,a=ze(e,o,c);if(yr(r,n,a),Z(a))e.canAutoFreeze_=!1;else return}else i&&r.add(o);if(B(o)&&!We(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;ze(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(me(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&Ne(e,o)}}function Ne(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&yt(t,r)}function Nn(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:br(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=n,s=bt;r&&(o=[n],s=he);const{revoke:i,proxy:c}=Proxy.revocable(o,s);return n.draft_=c,n.revoke_=i,c}var bt={get(e,t){if(t===j)return e;const r=J(e);if(!ot(r,t))return jn(e,r,t);const n=r[t];return e.finalized_||!B(n)?n:n===Ke(e.base_,t)?(Xe(e),e.copy_[t]=lt(n,e)):n},has(e,t){return t in J(e)},ownKeys(e){return Reflect.ownKeys(J(e))},set(e,t,r){const n=wr(J(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const o=Ke(J(e),t),s=o?.[j];if(s&&s.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Tn(r,o)&&(r!==void 0||ot(e.base_,t)))return!0;Xe(e),ct(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Ke(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Xe(e),ct(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=J(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){q(11)},getPrototypeOf(e){return oe(e.base_)},setPrototypeOf(){q(12)}},he={};Ie(bt,(e,t)=>{he[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});he.deleteProperty=function(e,t){return he.set.call(this,e,t,void 0)};he.set=function(e,t,r){return bt.set.call(this,e[0],t,r,e[0])};function Ke(e,t){const r=e[j];return(r?J(r):e)[t]}function jn(e,t,r){const n=wr(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function wr(e,t){if(!(t in e))return;let r=oe(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=oe(r)}}function ct(e){e.modified_||(e.modified_=!0,e.parent_&&ct(e.parent_))}function Xe(e){e.copy_||(e.copy_=st(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Dn=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){const s=r;r=t;const i=this;return function(a=s,...d){return i.produce(a,l=>r.call(this,l,...d))}}typeof r!="function"&&q(6),n!==void 0&&typeof n!="function"&&q(7);let o;if(B(t)){const s=Gt(this),i=lt(t,void 0);let c=!0;try{o=r(i),c=!1}finally{c?it(s):at(s)}return $t(s,n),Lt(o,s)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===mr&&(o=void 0),this.autoFreeze_&&yt(o,!0),n){const s=[],i=[];ee("Patches").generateReplacementPatches_(t,o,s,i),n(s,i)}return o}else q(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(i,...c)=>this.produceWithPatches(i,a=>t(a,...c));let n,o;return[this.produce(t,r,(i,c)=>{n=i,o=c}),n,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){B(e)||q(8),Z(e)&&(e=Wn(e));const t=Gt(this),r=lt(e,void 0);return r[j].isManual_=!0,at(t),r}finishDraft(e,t){const r=e&&e[j];(!r||!r.isManual_)&&q(9);const{scope_:n}=r;return $t(n,t),Lt(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));const n=ee("Patches").applyPatches_;return Z(e)?n(e,t):this.produce(e,o=>n(o,t))}};function lt(e,t){const r=me(e)?ee("MapSet").proxyMap_(e,t):De(e)?ee("MapSet").proxySet_(e,t):Nn(e,t);return(t?t.scope_:br()).drafts_.push(r),r}function Wn(e){return Z(e)||q(10,e),vr(e)}function vr(e){if(!B(e)||We(e))return e;const t=e[j];let r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=st(e,t.scope_.immer_.useStrictShallowCopy_)}else r=st(e,!0);return Ie(r,(n,o)=>{yr(r,n,vr(o))}),t&&(t.finalized_=!1),r}var Fn=new Dn,Sr=Fn.produce;function kr(e){return({dispatch:r,getState:n})=>o=>s=>typeof s=="function"?s(r,n,e):o(s)}var qn=kr(),$n=kr,Gn=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Me:Me.apply(null,arguments)},Ln=e=>e&&typeof e.match=="function";function de(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(U(0));return{type:e,payload:o.payload,..."meta"in o&&{meta:o.meta},..."error"in o&&{error:o.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>Pn(n)&&n.type===e,r}var xr=class le extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,le.prototype)}static get[Symbol.species](){return le}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new le(...t[0].concat(this)):new le(...t.concat(this))}};function Bt(e){return B(e)?Sr(e,()=>{}):e}function _e(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function Un(e){return typeof e=="boolean"}var Bn=()=>function(t){const{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:s=!0}=t??{};let i=new xr;return r&&(Un(r)?i.push(qn):i.push($n(r.extraArgument))),i},Vn="RTK_autoBatch",Vt=e=>t=>{setTimeout(t,e)},Hn=(e={type:"raf"})=>t=>(...r)=>{const n=t(...r);let o=!0,s=!1,i=!1;const c=new Set,a=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Vt(10):e.type==="callback"?e.queueNotification:Vt(e.timeout),d=()=>{i=!1,s&&(s=!1,c.forEach(l=>l()))};return Object.assign({},n,{subscribe(l){const u=()=>o&&l(),g=n.subscribe(u);return c.add(l),()=>{g(),c.delete(l)}},dispatch(l){try{return o=!l?.meta?.[Vn],s=!o,s&&(i||(i=!0,a(d))),n.dispatch(l)}finally{o=!0}}})},Kn=e=>function(r){const{autoBatch:n=!0}=r??{};let o=new xr(e);return n&&o.push(Hn(typeof n=="object"?n:void 0)),o};function Xn(e){const t=Bn(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:s=void 0,enhancers:i=void 0}=e||{};let c;if(typeof r=="function")c=r;else if(ht(r))c=gt(r);else throw new Error(U(1));let a;typeof n=="function"?a=n(t):a=t();let d=Me;o&&(d=Gn({trace:!1,...typeof o=="object"&&o}));const l=On(...a),u=Kn(l);let g=typeof i=="function"?i(u):u();const y=d(...g);return mt(c,s,y)}function Cr(e){const t={},r=[];let n;const o={addCase(s,i){const c=typeof s=="string"?s:s.type;if(!c)throw new Error(U(28));if(c in t)throw new Error(U(29));return t[c]=i,o},addAsyncThunk(s,i){return i.pending&&(t[s.pending.type]=i.pending),i.rejected&&(t[s.rejected.type]=i.rejected),i.fulfilled&&(t[s.fulfilled.type]=i.fulfilled),i.settled&&r.push({matcher:s.settled,reducer:i.settled}),o},addMatcher(s,i){return r.push({matcher:s,reducer:i}),o},addDefaultCase(s){return n=s,o}};return e(o),[t,r,n]}function Jn(e){return typeof e=="function"}function Qn(e,t){let[r,n,o]=Cr(t),s;if(Jn(e))s=()=>Bt(e());else{const c=Bt(e);s=()=>c}function i(c=s(),a){let d=[r[a.type],...n.filter(({matcher:l})=>l(a)).map(({reducer:l})=>l)];return d.filter(l=>!!l).length===0&&(d=[o]),d.reduce((l,u)=>{if(u)if(Z(l)){const y=u(l,a);return y===void 0?l:y}else{if(B(l))return Sr(l,g=>u(g,a));{const g=u(l,a);if(g===void 0){if(l===null)return l;throw Error("A case reducer on a non-draftable value must not return undefined")}return g}}return l},c)}return i.getInitialState=s,i}var Yn=(e,t)=>Ln(e)?e.match(t):e(t);function Zn(...e){return t=>e.some(r=>Yn(r,t))}var eo="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",to=(e=21)=>{let t="",r=e;for(;r--;)t+=eo[Math.random()*64|0];return t},ro=["name","message","stack","code"],Je=class{constructor(e,t){this.payload=e,this.meta=t}_type},Ht=class{constructor(e,t){this.payload=e,this.meta=t}_type},no=e=>{if(typeof e=="object"&&e!==null){const t={};for(const r of ro)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},Kt="External signal was aborted",wt=(()=>{function e(t,r,n){const o=de(t+"/fulfilled",(a,d,l,u)=>({payload:a,meta:{...u||{},arg:l,requestId:d,requestStatus:"fulfilled"}})),s=de(t+"/pending",(a,d,l)=>({payload:void 0,meta:{...l||{},arg:d,requestId:a,requestStatus:"pending"}})),i=de(t+"/rejected",(a,d,l,u,g)=>({payload:u,error:(n&&n.serializeError||no)(a||"Rejected"),meta:{...g||{},arg:l,requestId:d,rejectedWithValue:!!u,requestStatus:"rejected",aborted:a?.name==="AbortError",condition:a?.name==="ConditionError"}}));function c(a,{signal:d}={}){return(l,u,g)=>{const y=n?.idGenerator?n.idGenerator(a):to(),k=new AbortController;let m,x;function _(v){x=v,k.abort()}d&&(d.aborted?_(Kt):d.addEventListener("abort",()=>_(Kt),{once:!0}));const O=(async function(){let v;try{let w=n?.condition?.(a,{getState:u,extra:g});if(so(w)&&(w=await w),w===!1||k.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const C=new Promise((R,f)=>{m=()=>{f({name:"AbortError",message:x||"Aborted"})},k.signal.addEventListener("abort",m)});l(s(y,a,n?.getPendingMeta?.({requestId:y,arg:a},{getState:u,extra:g}))),v=await Promise.race([C,Promise.resolve(r(a,{dispatch:l,getState:u,extra:g,requestId:y,signal:k.signal,abort:_,rejectWithValue:(R,f)=>new Je(R,f),fulfillWithValue:(R,f)=>new Ht(R,f)})).then(R=>{if(R instanceof Je)throw R;return R instanceof Ht?o(R.payload,y,a,R.meta):o(R,y,a)})])}catch(w){v=w instanceof Je?i(null,y,a,w.payload,w.meta):i(w,y,a)}finally{m&&k.signal.removeEventListener("abort",m)}return n&&!n.dispatchConditionRejection&&i.match(v)&&v.meta.condition||l(v),v})();return Object.assign(O,{abort:_,requestId:y,arg:a,unwrap(){return O.then(oo)}})}}return Object.assign(c,{pending:s,rejected:i,fulfilled:o,settled:Zn(i,o),typePrefix:t})}return e.withTypes=()=>e,e})();function oo(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function so(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var io=Symbol.for("rtk-slice-createasyncthunk");function ao(e,t){return`${e}/${t}`}function co({creators:e}={}){const t=e?.asyncThunk?.[io];return function(n){const{name:o,reducerPath:s=o}=n;if(!o)throw new Error(U(11));const i=(typeof n.reducers=="function"?n.reducers(uo()):n.reducers)||{},c=Object.keys(i),a={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},d={addCase(v,b){const w=typeof v=="string"?v:v.type;if(!w)throw new Error(U(12));if(w in a.sliceCaseReducersByType)throw new Error(U(13));return a.sliceCaseReducersByType[w]=b,d},addMatcher(v,b){return a.sliceMatchers.push({matcher:v,reducer:b}),d},exposeAction(v,b){return a.actionCreators[v]=b,d},exposeCaseReducer(v,b){return a.sliceCaseReducersByName[v]=b,d}};c.forEach(v=>{const b=i[v],w={reducerName:v,type:ao(o,v),createNotation:typeof n.reducers=="function"};po(b)?mo(w,b,d,t):fo(w,b,d)});function l(){const[v={},b=[],w=void 0]=typeof n.extraReducers=="function"?Cr(n.extraReducers):[n.extraReducers],C={...v,...a.sliceCaseReducersByType};return Qn(n.initialState,R=>{for(let f in C)R.addCase(f,C[f]);for(let f of a.sliceMatchers)R.addMatcher(f.matcher,f.reducer);for(let f of b)R.addMatcher(f.matcher,f.reducer);w&&R.addDefaultCase(w)})}const u=v=>v,g=new Map,y=new WeakMap;let k;function m(v,b){return k||(k=l()),k(v,b)}function x(){return k||(k=l()),k.getInitialState()}function _(v,b=!1){function w(R){let f=R[v];return typeof f>"u"&&b&&(f=_e(y,w,x)),f}function C(R=u){const f=_e(g,b,()=>new WeakMap);return _e(f,R,()=>{const A={};for(const[ae,ye]of Object.entries(n.selectors??{}))A[ae]=lo(ye,R,()=>_e(y,R,x),b);return A})}return{reducerPath:v,getSelectors:C,get selectors(){return C(w)},selectSlice:w}}const O={name:o,reducer:m,actions:a.actionCreators,caseReducers:a.sliceCaseReducersByName,getInitialState:x,..._(s),injectInto(v,{reducerPath:b,...w}={}){const C=b??s;return v.inject({reducerPath:C,reducer:m},w),{...O,..._(C,!0)}}};return O}}function lo(e,t,r,n){function o(s,...i){let c=t(s);return typeof c>"u"&&n&&(c=r()),e(c,...i)}return o.unwrapped=e,o}var Fe=co();function uo(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function fo({type:e,reducerName:t,createNotation:r},n,o){let s,i;if("reducer"in n){if(r&&!ho(n))throw new Error(U(17));s=n.reducer,i=n.prepare}else s=n;o.addCase(e,s).exposeCaseReducer(t,s).exposeAction(t,i?de(e,i):de(e))}function po(e){return e._reducerDefinitionType==="asyncThunk"}function ho(e){return e._reducerDefinitionType==="reducerWithPrepare"}function mo({type:e,reducerName:t},r,n,o){if(!o)throw new Error(U(18));const{payloadCreator:s,fulfilled:i,pending:c,rejected:a,settled:d,options:l}=r,u=o(e,s,l);n.exposeAction(t,u),i&&n.addCase(u.fulfilled,i),c&&n.addCase(u.pending,c),a&&n.addCase(u.rejected,a),d&&n.addMatcher(u.settled,d),n.exposeCaseReducer(t,{fulfilled:i||Re,pending:c||Re,rejected:a||Re,settled:d||Re})}function Re(){}function U(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var vt="persist:",St="persist/FLUSH",qe="persist/REHYDRATE",kt="persist/PAUSE",xt="persist/PERSIST",Ct="persist/PURGE",Et="persist/REGISTER",go=-1;function Pe(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Pe=function(r){return typeof r}:Pe=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Pe(e)}function Xt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function yo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Xt(r,!0).forEach(function(n){bo(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xt(r).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function bo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wo(e,t,r,n){n.debug;var o=yo({},r);return e&&Pe(e)==="object"&&Object.keys(e).forEach(function(s){s!=="_persist"&&t[s]===r[s]&&(o[s]=e[s])}),o}function vo(e){var t=e.blacklist||null,r=e.whitelist||null,n=e.transforms||[],o=e.throttle||0,s="".concat(e.keyPrefix!==void 0?e.keyPrefix:vt).concat(e.key),i=e.storage,c;e.serialize===!1?c=function(w){return w}:typeof e.serialize=="function"?c=e.serialize:c=So;var a=e.writeFailHandler||null,d={},l={},u=[],g=null,y=null,k=function(w){Object.keys(w).forEach(function(C){_(C)&&d[C]!==w[C]&&u.indexOf(C)===-1&&u.push(C)}),Object.keys(d).forEach(function(C){w[C]===void 0&&_(C)&&u.indexOf(C)===-1&&d[C]!==void 0&&u.push(C)}),g===null&&(g=setInterval(m,o)),d=w};function m(){if(u.length===0){g&&clearInterval(g),g=null;return}var b=u.shift(),w=n.reduce(function(C,R){return R.in(C,b,d)},d[b]);if(w!==void 0)try{l[b]=c(w)}catch(C){console.error("redux-persist/createPersistoid: error serializing state",C)}else delete l[b];u.length===0&&x()}function x(){Object.keys(l).forEach(function(b){d[b]===void 0&&delete l[b]}),y=i.setItem(s,c(l)).catch(O)}function _(b){return!(r&&r.indexOf(b)===-1&&b!=="_persist"||t&&t.indexOf(b)!==-1)}function O(b){a&&a(b)}var v=function(){for(;u.length!==0;)m();return y||Promise.resolve()};return{update:k,flush:v}}function So(e){return JSON.stringify(e)}function ko(e){var t=e.transforms||[],r="".concat(e.keyPrefix!==void 0?e.keyPrefix:vt).concat(e.key),n=e.storage;e.debug;var o;return e.deserialize===!1?o=function(i){return i}:typeof e.deserialize=="function"?o=e.deserialize:o=xo,n.getItem(r).then(function(s){if(s)try{var i={},c=o(s);return Object.keys(c).forEach(function(a){i[a]=t.reduceRight(function(d,l){return l.out(d,a,c)},o(c[a]))}),i}catch(a){throw a}else return})}function xo(e){return JSON.parse(e)}function Co(e){var t=e.storage,r="".concat(e.keyPrefix!==void 0?e.keyPrefix:vt).concat(e.key);return t.removeItem(r,Eo)}function Eo(e){}function Jt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function L(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Jt(r,!0).forEach(function(n){_o(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Jt(r).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function _o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ro(e,t){if(e==null)return{};var r=Oo(e,t),n,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)n=s[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Oo(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,s;for(s=0;s<n.length;s++)o=n[s],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}var Po=5e3;function Er(e,t){var r=e.version!==void 0?e.version:go;e.debug;var n=e.stateReconciler===void 0?wo:e.stateReconciler,o=e.getStoredState||ko,s=e.timeout!==void 0?e.timeout:Po,i=null,c=!1,a=!0,d=function(u){return u._persist.rehydrated&&i&&!a&&i.update(u),u};return function(l,u){var g=l||{},y=g._persist,k=Ro(g,["_persist"]),m=k;if(u.type===xt){var x=!1,_=function(f,A){x||(u.rehydrate(e.key,f,A),x=!0)};if(s&&setTimeout(function(){!x&&_(void 0,new Error('redux-persist: persist timed out for persist key "'.concat(e.key,'"')))},s),a=!1,i||(i=vo(e)),y)return L({},t(m,u),{_persist:y});if(typeof u.rehydrate!="function"||typeof u.register!="function")throw new Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");return u.register(e.key),o(e).then(function(R){var f=e.migrate||function(A,ae){return Promise.resolve(A)};f(R,r).then(function(A){_(A)},function(A){_(void 0,A)})},function(R){_(void 0,R)}),L({},t(m,u),{_persist:{version:r,rehydrated:!1}})}else{if(u.type===Ct)return c=!0,u.result(Co(e)),L({},t(m,u),{_persist:y});if(u.type===St)return u.result(i&&i.flush()),L({},t(m,u),{_persist:y});if(u.type===kt)a=!0;else if(u.type===qe){if(c)return L({},m,{_persist:L({},y,{rehydrated:!0})});if(u.key===e.key){var O=t(m,u),v=u.payload,b=n!==!1&&v!==void 0?n(v,l,O,e):O,w=L({},b,{_persist:L({},y,{rehydrated:!0})});return d(w)}}}if(!y)return t(l,u);var C=t(m,u);return C===m?l:d(L({},C,{_persist:y}))}}function Qt(e){return Mo(e)||To(e)||Ao()}function Ao(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function To(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function Mo(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}function Yt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function ut(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Yt(r,!0).forEach(function(n){Io(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yt(r).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Io(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var _r={registry:[],bootstrapped:!1},zo=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_r,r=arguments.length>1?arguments[1]:void 0;switch(r.type){case Et:return ut({},t,{registry:[].concat(Qt(t.registry),[r.key])});case qe:var n=t.registry.indexOf(r.key),o=Qt(t.registry);return o.splice(n,1),ut({},t,{registry:o,bootstrapped:o.length===0});default:return t}};function No(e,t,r){var n=mt(zo,_r,void 0),o=function(a){n.dispatch({type:Et,key:a})},s=function(a,d,l){var u={type:qe,payload:d,err:l,key:a};e.dispatch(u),n.dispatch(u)},i=ut({},n,{purge:function(){var a=[];return e.dispatch({type:Ct,result:function(l){a.push(l)}}),Promise.all(a)},flush:function(){var a=[];return e.dispatch({type:St,result:function(l){a.push(l)}}),Promise.all(a)},pause:function(){e.dispatch({type:kt})},persist:function(){e.dispatch({type:xt,register:o,rehydrate:s})}});return i.persist(),i}function Rr(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=r.whitelist||null,o=r.blacklist||null;function s(i){return!!(n&&n.indexOf(i)===-1||o&&o.indexOf(i)!==-1)}return{in:function(c,a,d){return!s(a)&&e?e(c,a,d):c},out:function(c,a,d){return!s(a)&&t?t(c,a,d):c}}}function Ae(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ae=function(r){return typeof r}:Ae=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ae(e)}function Qe(){}var jo={getItem:Qe,setItem:Qe,removeItem:Qe};function Do(e){if((typeof self>"u"?"undefined":Ae(self))!=="object"||!(e in self))return!1;try{var t=self[e],r="redux-persist ".concat(e," test");t.setItem(r,"test"),t.getItem(r),t.removeItem(r)}catch{return!1}return!0}function Wo(e){var t="".concat(e,"Storage");return Do(t)?self[t]:jo}function Fo(e){var t=Wo(e);return{getItem:function(n){return new Promise(function(o,s){o(t.getItem(n))})},setItem:function(n,o){return new Promise(function(s,i){s(t.setItem(n,o))})},removeItem:function(n){return new Promise(function(o,s){o(t.removeItem(n))})}}}const qo=Fo("local"),$o={sidebarOpen:!0,activeMenu:"home"},Or=Fe({name:"ui",initialState:$o,reducers:{toggleSidebar:e=>{e.sidebarOpen=!e.sidebarOpen},setSidebarOpen:(e,t)=>{e.sidebarOpen=t.payload},setActiveMenu:(e,t)=>{e.activeMenu=t.payload}}}),{toggleSidebar:Ms,setSidebarOpen:Is,setActiveMenu:zs}=Or.actions,Go=Or.reducer,Lo={routes:[]},Uo=(e,t)=>{const r=t.split("/").filter(Boolean);for(let n=r.length-1;n>0;n--){const o="/"+r.slice(0,n).join("/"),s=e.find(i=>i.path===o);if(s)return s}return e.find(n=>n.path==="/")||null},Bo=(e,t)=>e==="/"?t:t.replace(e+"/",""),Pr=Fe({name:"route",initialState:Lo,reducers:{addRoute:(e,t)=>{const r=t.payload,n=Uo(e.routes,r.path);if(n){n.children||(n.children=[]);const o=Bo(n.path,r.path);n.children.push({...r,path:o})}else e.routes.push(r);e.routes.sort((o,s)=>(o.meta?.order||999)-(s.meta?.order||999))},removeRoute:(e,t)=>{const r=t.payload,n=o=>{const s=o.findIndex(i=>i.path===r);if(s>=0)return o.splice(s,1),!0;for(const i of o)if(i.children&&n(i.children))return!0;return!1};n(e.routes)},updateRoute:(e,t)=>{const{path:r,updates:n}=t.payload,o=s=>{const i=s.findIndex(c=>c.path===r);if(i>=0)return s[i]={...s[i],...n},!0;for(const c of s)if(c.children&&o(c.children))return!0;return!1};o(e.routes)},setRoutes:(e,t)=>{e.routes=t.payload,e.routes.sort((r,n)=>(r.meta?.order||999)-(n.meta?.order||999))},clearRoutes:e=>{e.routes=[]}}}),{addRoute:Vo,removeRoute:Ho,updateRoute:Ko,setRoutes:Ns,clearRoutes:Xo}=Pr.actions,Jo=Pr.reducer,Qo={entries:[],loadedScripts:[]},_t=wt("script/loadScript",async e=>new Promise((t,r)=>{const n=document.createElement("script");n.type="module",n.src=e,n.dataset.dynamicEntry="true",n.onload=()=>t(e),n.onerror=o=>{console.error("[Script] Load failed:",e),r(o)},document.body.appendChild(n)})),Ar=wt("script/loadScripts",async(e,{dispatch:t})=>(await Promise.allSettled(e.map(n=>t(_t(n)).unwrap()))).filter(n=>n.status==="fulfilled").map(n=>n.value)),Tr=wt("script/unloadScript",async e=>(document.querySelectorAll(`script[src="${e}"][data-dynamic-entry="true"]`).forEach(r=>r.remove()),e)),Mr=Fe({name:"script",initialState:Qo,reducers:{syncEntries:(e,t)=>{e.entries=t.payload},addEntry:(e,t)=>{e.entries.includes(t.payload)||e.entries.push(t.payload)},removeEntry:(e,t)=>{e.entries=e.entries.filter(r=>r!==t.payload),e.loadedScripts=e.loadedScripts.filter(r=>r!==t.payload)}},extraReducers:e=>{e.addCase(_t.fulfilled,(t,r)=>{t.loadedScripts.includes(r.payload)||t.loadedScripts.push(r.payload)}),e.addCase(Ar.fulfilled,(t,r)=>{r.payload.forEach(n=>{t.loadedScripts.includes(n)||t.loadedScripts.push(n)})}),e.addCase(Tr.fulfilled,(t,r)=>{t.loadedScripts=t.loadedScripts.filter(n=>n!==r.payload)})}}),{syncEntries:js,addEntry:Ds,removeEntry:Ws}=Mr.actions,Yo=Mr.reducer,Zo={configs:{},schemas:{},loading:{},errors:{},connected:!1},Ir=Fe({name:"config",initialState:Zo,reducers:{setConnected:(e,t)=>{e.connected=t.payload},setLoading:(e,t)=>{const{pluginName:r,loading:n}=t.payload;e.loading[r]=n},setError:(e,t)=>{const{pluginName:r,error:n}=t.payload;e.errors[r]=n},updateConfig:(e,t)=>{const{pluginName:r,config:n}=t.payload;e.configs[r]=n,e.loading[r]=!1,e.errors[r]=null},updateSchema:(e,t)=>{const{pluginName:r,schema:n}=t.payload;e.schemas[r]=n},updateConfigs:(e,t)=>{e.configs={...e.configs,...t.payload}},updateSchemas:(e,t)=>{e.schemas={...e.schemas,...t.payload}},removeConfig:(e,t)=>{const r=t.payload;delete e.configs[r],delete e.schemas[r],delete e.loading[r],delete e.errors[r]},clearConfigs:e=>{e.configs={},e.schemas={},e.loading={},e.errors={}}}}),{setConnected:Ye,setLoading:Oe,setError:ue,updateConfig:es,updateSchema:ts,updateConfigs:zr,updateSchemas:Nr,removeConfig:Fs,clearConfigs:qs}=Ir.actions,rs=Ir.reducer,ns=(e,t)=>e.config.configs[t],os=(e,t)=>e.config.schemas[t],ss=(e,t)=>e.config.loading[t]||!1,is=(e,t)=>e.config.errors[t]||null,Rt=e=>e.config.connected,as=e=>e.config.configs,cs=e=>e.config.schemas,dt={ui:Go,route:Jo,script:Yo,config:rs};var Ze={exports:{}},et={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* use-sync-external-store-with-selector.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Zt;function ls(){if(Zt)return et;Zt=1;var e=Fr;function t(a,d){return a===d&&(a!==0||1/a===1/d)||a!==a&&d!==d}var r=typeof Object.is=="function"?Object.is:t,n=e.useSyncExternalStore,o=e.useRef,s=e.useEffect,i=e.useMemo,c=e.useDebugValue;return et.useSyncExternalStoreWithSelector=function(a,d,l,u,g){var y=o(null);if(y.current===null){var k={hasValue:!1,value:null};y.current=k}else k=y.current;y=i(function(){function x(w){if(!_){if(_=!0,O=w,w=u(w),g!==void 0&&k.hasValue){var C=k.value;if(g(C,w))return v=C}return v=w}if(C=v,r(O,w))return C;var R=u(w);return g!==void 0&&g(C,R)?(O=w,C):(O=w,v=R)}var _=!1,O,v,b=l===void 0?null:l;return[function(){return x(d())},b===null?void 0:function(){return x(b())}]},[d,l,u,g]);var m=n(a,y[0],y[1]);return s(function(){k.hasValue=!0,k.value=m},[m]),c(m),m},et}var er;function us(){return er||(er=1,Ze.exports=ls()),Ze.exports}var ds=us(),fs=Symbol.for("react-redux-context"),ps=typeof globalThis<"u"?globalThis:{};function hs(){if(!H.createContext)return{};const e=ps[fs]??=new Map;let t=e.get(H.createContext);return t||(t=H.createContext(null),e.set(H.createContext,t)),t}var te=hs();function Ot(e=te){return function(){return H.useContext(e)}}var jr=Ot();function Dr(e=te){const t=e===te?jr:Ot(e),r=()=>{const{store:n}=t();return n};return Object.assign(r,{withTypes:()=>r}),r}var ms=Dr();function gs(e=te){const t=e===te?ms:Dr(e),r=()=>t().dispatch;return Object.assign(r,{withTypes:()=>r}),r}var ys=gs(),bs=(e,t)=>e===t;function ws(e=te){const t=e===te?jr:Ot(e),r=(n,o={})=>{const{equalityFn:s=bs}=typeof o=="function"?{equalityFn:o}:o,i=t(),{store:c,subscription:a,getServerState:d}=i;H.useRef(!0);const l=H.useCallback({[n.name](g){return n(g)}}[n.name],[n]),u=ds.useSyncExternalStoreWithSelector(a.addNestedSub,c.getState,d||c.getState,l,s);return H.useDebugValue(u),u};return Object.assign(r,{withTypes:()=>r}),r}var vs=ws();const Ss=Rr(e=>{const{routes:t,...r}=e;return r},e=>({...e,routes:[]}),{whitelist:["route"]}),ks=Rr(e=>{const{entries:t,loadedScripts:r,...n}=e;return n},e=>({...e,entries:[],loadedScripts:[]}),{whitelist:["script"]}),Wr={key:"root",storage:qo,transforms:[Ss,ks]},xs=Er(Wr,gt(dt)),P=Xn({reducer:xs,middleware:e=>e({serializableCheck:{ignoredActions:[St,qe,kt,xt,Ct,Et,"route/addRoute","route/updateRoute","route/setRoutes"],ignoredPaths:["route.routes"]}})}),$s=No(P);typeof window<"u"&&(window.__REDUX_STORE__=P);function Gs(e,t){dt[e]=t;const r=Er(Wr,gt(dt));P.replaceReducer(r)}const Cs=ys,W=vs,Ls=e=>P.dispatch(Vo(e)),Us=e=>P.dispatch(Ho(e)),Bs=(e,t)=>P.dispatch(Ko({path:e,updates:t})),Vs=e=>P.getState().route.routes.find(t=>t.path===e),Hs=()=>P.getState().route.routes,Ks=()=>P.dispatch(Xo());function Xs(){const e=W(r=>r.route.routes);console.log(e);const t=ft(()=>{const r=s=>{const i={path:s.path,element:s.element,Component:s.Component};return s.children&&s.children.length>0&&(i.children=s.children.map(c=>r(c))),i},n=e.map(r);return qr([{path:"/",element:Ue(Gr,{}),children:n},{path:"*",element:Ue("div",{children:"404 - Page Not Found"})}])},[e]);return Ue($r,{router:t})}var D=(e=>(e.DISCONNECTED="disconnected",e.CONNECTING="connecting",e.CONNECTED="connected",e.RECONNECTING="reconnecting",e.ERROR="error",e))(D||{});class Q extends Error{constructor(t,r,n){super(t),this.code=r,this.originalError=n,this.name="WebSocketError"}}class Es extends Q{constructor(t){super(`Request ${t} timed out`,"REQUEST_TIMEOUT")}}class tr extends Q{constructor(t,r){super(t,"CONNECTION_ERROR",r)}}class rr extends Q{constructor(t,r){super(t,"MESSAGE_ERROR",r)}}class _s{static handle(t){try{switch(t.type){case"sync":this.handleScriptSync(t);break;case"add":this.handleScriptAdd(t);break;case"delete":this.handleScriptDelete(t);break;case"config:updated":this.handleConfigUpdated(t);break;case"config:batch":this.handleConfigBatch(t);break;case"config:error":this.handleConfigError(t);break;case"schema:updated":this.handleSchemaUpdated(t);break;case"schema:batch":this.handleSchemaBatch(t);break;case"init-data":case"data-update":this.handleSystemMessage(t);break;default:console.warn("[WebSocket] Unknown message type:",t.type)}}catch(r){console.error("[WebSocket] Message handling error:",r)}}static handleScriptSync(t){if(t.data?.key==="entries"){const r=Array.isArray(t.data.value)?t.data.value:[t.data.value];P.dispatch({type:"script/syncEntries",payload:r}),P.dispatch(Ar(r))}}static handleScriptAdd(t){t.data?.key==="entries"&&(P.dispatch({type:"script/addEntry",payload:t.data.value}),P.dispatch(_t(t.data.value)))}static handleScriptDelete(t){t.data?.key==="entries"&&(P.dispatch({type:"script/removeEntry",payload:t.data.value}),P.dispatch(Tr(t.data.value)))}static handleConfigUpdated(t){t.pluginName&&t.data!==void 0&&P.dispatch(es({pluginName:t.pluginName,config:t.data}))}static handleConfigBatch(t){t.data&&P.dispatch(zr(t.data))}static handleConfigError(t){t.pluginName&&t.error&&P.dispatch(ue({pluginName:t.pluginName,error:t.error}))}static handleSchemaUpdated(t){t.pluginName&&t.data!==void 0&&P.dispatch(ts({pluginName:t.pluginName,schema:t.data}))}static handleSchemaBatch(t){t.data&&P.dispatch(Nr(t.data))}static handleSystemMessage(t){}}class Rs{ws=null;config;callbacks;state=D.DISCONNECTED;reconnectAttempts=0;reconnectTimer=null;requestId=0;pendingRequests=new Map;constructor(t={},r={}){this.config={url:this.buildWebSocketUrl(t.url),reconnectInterval:t.reconnectInterval??3e3,maxReconnectAttempts:t.maxReconnectAttempts??10,requestTimeout:t.requestTimeout??1e4},this.callbacks=r}connect(){if(!(this.state===D.CONNECTED||this.state===D.CONNECTING)){this.setState(D.CONNECTING);try{this.ws=new WebSocket(this.config.url),this.attachEventHandlers()}catch(t){this.handleConnectionError(new tr("Failed to create WebSocket",t))}}}disconnect(){this.clearReconnectTimer(),this.clearPendingRequests(),this.ws&&(this.ws.close(),this.ws=null),this.setState(D.DISCONNECTED),P.dispatch(Ye(!1))}send(t){if(!this.isConnected())throw new Q("WebSocket is not connected","NOT_CONNECTED");try{this.ws.send(JSON.stringify(t))}catch(r){throw new rr("Failed to send message",r)}}async sendRequest(t){if(!this.isConnected())throw new Q("WebSocket is not connected","NOT_CONNECTED");return new Promise((r,n)=>{const o=++this.requestId,s={...t,requestId:o},i=setTimeout(()=>{this.pendingRequests.delete(o),n(new Es(o))},this.config.requestTimeout);this.pendingRequests.set(o,{resolve:r,reject:n,timer:i});try{this.ws.send(JSON.stringify(s))}catch(c){this.pendingRequests.delete(o),clearTimeout(i),n(new rr("Failed to send request",c))}})}isConnected(){return this.ws?.readyState===WebSocket.OPEN}getState(){return this.state}async getConfig(t){return this.sendRequest({type:"config:get",pluginName:t})}async setConfig(t,r){await this.sendRequest({type:"config:set",pluginName:t,data:r})}async getSchema(t){return this.sendRequest({type:"schema:get",pluginName:t})}async getAllConfigs(){return this.sendRequest({type:"config:get-all"})}async getAllSchemas(){return this.sendRequest({type:"schema:get-all"})}buildWebSocketUrl(t){if(t)return t;const r=window.location.protocol==="https:"?"wss:":"ws:",n=window.location.host;return`${r}//${n}/server`}setState(t){const r=this.state;this.state=t,console.log(`[WebSocket] State changed: ${r} -> ${t}`)}attachEventHandlers(){this.ws&&(this.ws.onopen=()=>{this.handleConnectionOpen()},this.ws.onmessage=t=>{this.handleMessage(t)},this.ws.onclose=t=>{this.handleConnectionClose(t)},this.ws.onerror=t=>{this.handleConnectionError(new tr("WebSocket error",t))})}handleConnectionOpen(){this.setState(D.CONNECTED),this.reconnectAttempts=0,P.dispatch(Ye(!0)),this.initializeData(),this.callbacks.onConnect?.()}handleMessage(t){try{const r=JSON.parse(t.data);if(r.requestId&&this.pendingRequests.has(r.requestId)){this.handleRequestResponse(r);return}_s.handle(r),this.callbacks.onMessage?.(r)}catch(r){console.error("[WebSocket] Message parsing error:",r)}}handleRequestResponse(t){const{requestId:r}=t,n=this.pendingRequests.get(r);n&&(this.pendingRequests.delete(r),clearTimeout(n.timer),t.error?n.reject(new Q(t.error,"SERVER_ERROR")):n.resolve(t.data))}handleConnectionClose(t){this.ws=null,P.dispatch(Ye(!1)),this.state!==D.DISCONNECTED&&(this.setState(D.RECONNECTING),this.callbacks.onDisconnect?.(),this.scheduleReconnect())}handleConnectionError(t){this.setState(D.ERROR),console.error("[WebSocket] Connection error:",t),this.callbacks.onError?.(t)}scheduleReconnect(){if(this.reconnectAttempts>=this.config.maxReconnectAttempts){console.error("[WebSocket] Max reconnect attempts reached"),this.setState(D.ERROR);return}this.reconnectAttempts++;const t=this.config.reconnectInterval*this.reconnectAttempts;console.log(`[WebSocket] Reconnecting in ${t}ms (attempt ${this.reconnectAttempts}/${this.config.maxReconnectAttempts})`),this.reconnectTimer=setTimeout(()=>{this.state===D.RECONNECTING&&this.connect()},t)}clearReconnectTimer(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}clearPendingRequests(){for(const[t,{reject:r,timer:n}]of this.pendingRequests)clearTimeout(n),r(new Q("Connection closed","CONNECTION_CLOSED"));this.pendingRequests.clear()}async initializeData(){try{const[t,r]=await Promise.all([this.getAllConfigs().catch(n=>(console.warn("[WebSocket] Failed to load configs:",n),{})),this.getAllSchemas().catch(n=>(console.warn("[WebSocket] Failed to load schemas:",n),{}))]);P.dispatch(zr(t)),P.dispatch(Nr(r))}catch(t){console.error("[WebSocket] Data initialization failed:",t)}}}let Y=null;function ge(){return Y||(Y=new Rs,typeof window<"u"&&Y.connect()),Y}function Os(){Y&&(Y.disconnect(),Y=null)}function Js(){Os()}function Qs(e={}){const{autoConnect:t=!0}=e,r=ge(),n=W(Rt),o=W(g=>g.script?.entries||[]),s=W(g=>g.script?.loadedScripts||[]),i=F(()=>{r.connect()},[r]),c=F(()=>{r.disconnect()},[r]),a=F(g=>{r.send(g)},[r]),d=F(async g=>r.sendRequest(g),[r]),l=F(()=>r.isConnected(),[r]),u=F(()=>r.isConnected()?"connected":"disconnected",[r]);return fe(()=>{t&&!n&&i()},[t,n,i]),{connected:n,entries:o,loadedScripts:s,connect:i,disconnect:c,send:a,sendRequest:d,isConnected:l,getState:u,manager:r}}function Ys(e,t={}){const{autoLoad:r=!0,autoLoadSchema:n=!0}=t,o=Cs(),s=ge(),i=W(m=>ns(m,e)),c=W(m=>os(m,e)),a=W(m=>ss(m,e)),d=W(m=>is(m,e)),l=W(Rt),u=F(async()=>{o(Oe({pluginName:e,loading:!0})),o(ue({pluginName:e,error:null}));try{return await s.getConfig(e)}catch(m){console.log("getConfig",m);const x=m instanceof Error?m.message:"Unknown error";throw o(ue({pluginName:e,error:x})),m}finally{o(Oe({pluginName:e,loading:!1}))}},[e,s,o]),g=F(async m=>{o(Oe({pluginName:e,loading:!0})),o(ue({pluginName:e,error:null}));try{await s.setConfig(e,m)}catch(x){console.log("setConfig",x);const _=x instanceof Error?x.message:"Unknown error";throw o(ue({pluginName:e,error:_})),x}finally{o(Oe({pluginName:e,loading:!1}))}},[e,s,o]),y=F(async()=>{try{return await s.getSchema(e)}catch(m){throw console.error(`Failed to get schema for plugin ${e}:`,m),m}},[e,s]),k=F(async()=>{const m=[];r&&m.push(u()),n&&m.push(y()),await Promise.all(m)},[r,n,u,y]);return fe(()=>{l&&r&&!i&&!a&&u().catch(console.error)},[l,r,i,a,u]),fe(()=>{l&&n&&!c&&y().catch(console.error)},[l,n,c,y]),ft(()=>({config:i,schema:c,loading:a,error:d,connected:l,getConfig:u,setConfig:g,getSchema:y,reload:k}),[i,c,a,d,l,u,g,y,k])}function Zs(){const e=ge(),t=W(as),r=W(cs),n=W(Rt),o=F(async()=>{try{const[s,i]=await Promise.all([e.getAllConfigs(),e.getAllSchemas()]);return{configs:s,schemas:i}}catch(s){throw console.error("Failed to refresh all configs:",s),s}},[e]);return ft(()=>({configs:t,schemas:r,connected:n,refreshAll:o}),[t,r,n,o])}function ei(){const e=ge(),[t,r]=nr(e.getState());return fe(()=>{const o=setInterval(()=>{const s=e.getState();s!==t&&r(s)},1e3);return()=>clearInterval(o)},[e,t]),t}function ti(e,t){const[r,n]=nr([]);return fe(()=>{ge()},[e,t]),r}function ri(...e){return Cn(Lr(e))}export{tr as ConnectionError,D as ConnectionState,Xs as DynamicRouter,si as Link,rr as MessageError,_s as MessageHandler,ii as Outlet,Es as RequestTimeoutError,Q as WebSocketError,Rs as WebSocketManager,Ds as addEntry,Ls as addPage,Gs as addReducer,Vo as addRoute,qs as clearConfigs,Ks as clearPages,Xo as clearRoutes,ri as cn,Os as destroyWebSocketManager,Hs as getAllPages,Vs as getPage,ge as getWebSocketManager,_t as loadScript,Ar as loadScripts,$s as persistor,Fs as removeConfig,Ws as removeEntry,Us as removePage,Ho as removeRoute,Js as resetWebSocketManager,as as selectAllConfigs,cs as selectAllSchemas,ns as selectConfig,Rt as selectConfigConnected,is as selectConfigError,ss as selectConfigLoading,os as selectSchema,zs as setActiveMenu,Ye as setConnected,ue as setError,Oe as setLoading,Ns as setRoutes,Is as setSidebarOpen,P as store,js as syncEntries,Ms as toggleSidebar,Tr as unloadScript,es as updateConfig,zr as updateConfigs,Bs as updatePage,Ko as updateRoute,ts as updateSchema,Nr as updateSchemas,Zs as useAllConfigs,Ys as useConfig,Ys as useConfigLegacy,Cs as useDispatch,ai as useNavigate,ci as useOutlet,li as useParams,W as useSelector,Qs as useWebSocket,ti as useWebSocketMessages,ei as useWebSocketState};
|
|
1
|
+
import*as Y from"./react.js";import un,{useMemo as Ct,useCallback as L,useEffect as he,useState as kr}from"./react.js";import{jsx as nt}from"./react-jsx-runtime.js";import{createBrowserRouter as dn,RouterProvider as fn,Outlet as pn}from"./react-router.js";import{Link as Ui,Outlet as $i,useNavigate as Gi,useOutlet as Bi,useParams as Vi}from"./react-router.js";function _r(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=_r(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function hn(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=_r(e))&&(n&&(n+=" "),n+=t);return n}const mn=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},gn=(e,t)=>({classGroupId:e,validator:t}),xr=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),De="-",Xt=[],yn="arbitrary..",bn=e=>{const t=vn(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return wn(i);const c=i.split(De),a=c[0]===""&&c.length>1?1:0;return Cr(c,a,t)},getConflictingClassGroupIds:(i,c)=>{if(c){const a=n[i],l=r[i];return a?l?mn(l,a):a:l||Xt}return r[i]||Xt}}},Cr=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const o=e[t],s=r.nextPart.get(o);if(s){const l=Cr(e,t+1,s);if(l)return l}const i=r.validators;if(i===null)return;const c=t===0?e.join(De):e.slice(t).join(De),a=i.length;for(let l=0;l<a;l++){const u=i[l];if(u.validator(c))return u.classGroupId}},wn=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?yn+n:void 0})(),vn=e=>{const{theme:t,classGroups:r}=e;return Sn(r,t)},Sn=(e,t)=>{const r=xr();for(const n in e){const o=e[n];Et(o,r,n,t)}return r},Et=(e,t,r,n)=>{const o=e.length;for(let s=0;s<o;s++){const i=e[s];kn(i,t,r,n)}},kn=(e,t,r,n)=>{if(typeof e=="string"){_n(e,t,r);return}if(typeof e=="function"){xn(e,t,r,n);return}Cn(e,t,r,n)},_n=(e,t,r)=>{const n=e===""?t:Er(t,e);n.classGroupId=r},xn=(e,t,r,n)=>{if(En(e)){Et(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(gn(r,e))},Cn=(e,t,r,n)=>{const o=Object.entries(e),s=o.length;for(let i=0;i<s;i++){const[c,a]=o[i];Et(a,Er(t,c),r,n)}},Er=(e,t)=>{let r=e;const n=t.split(De),o=n.length;for(let s=0;s<o;s++){const i=n[s];let c=r.nextPart.get(i);c||(c=xr(),r.nextPart.set(i,c)),r=c}return r},En=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Rn=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const o=(s,i)=>{r[s]=i,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(s){let i=r[s];if(i!==void 0)return i;if((i=n[s])!==void 0)return o(s,i),i},set(s,i){s in r?r[s]=i:o(s,i)}}},ht="!",Yt=":",On=[],Jt=(e,t,r,n,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:o}),Pn=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=o=>{const s=[];let i=0,c=0,a=0,l;const u=o.length;for(let g=0;g<u;g++){const v=o[g];if(i===0&&c===0){if(v===Yt){s.push(o.slice(a,g)),a=g+1;continue}if(v==="/"){l=g;continue}}v==="["?i++:v==="]"?i--:v==="("?c++:v===")"&&c--}const d=s.length===0?o:o.slice(a);let m=d,y=!1;d.endsWith(ht)?(m=d.slice(0,-1),y=!0):d.startsWith(ht)&&(m=d.slice(1),y=!0);const x=l&&l>a?l-a:void 0;return Jt(s,y,m,x)};if(t){const o=t+Yt,s=n;n=i=>i.startsWith(o)?s(i.slice(o.length)):Jt(On,!1,i,void 0,!0)}if(r){const o=n;n=s=>r({className:s,parseClassName:o})}return n},An=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let o=[];for(let s=0;s<r.length;s++){const i=r[s],c=i[0]==="[",a=t.has(i);c||a?(o.length>0&&(o.sort(),n.push(...o),o=[]),n.push(i)):o.push(i)}return o.length>0&&(o.sort(),n.push(...o)),n}},Tn=e=>({cache:Rn(e.cacheSize),parseClassName:Pn(e),sortModifiers:An(e),...bn(e)}),In=/\s+/,Mn=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:s}=t,i=[],c=e.trim().split(In);let a="";for(let l=c.length-1;l>=0;l-=1){const u=c[l],{isExternal:d,modifiers:m,hasImportantModifier:y,baseClassName:x,maybePostfixModifierPosition:g}=r(u);if(d){a=u+(a.length>0?" "+a:a);continue}let v=!!g,E=n(v?x.substring(0,g):x);if(!E){if(!v){a=u+(a.length>0?" "+a:a);continue}if(E=n(x),!E){a=u+(a.length>0?" "+a:a);continue}v=!1}const O=m.length===0?"":m.length===1?m[0]:s(m).join(":"),S=y?O+ht:O,b=S+E;if(i.indexOf(b)>-1)continue;i.push(b);const w=o(E,v);for(let _=0;_<w.length;++_){const R=w[_];i.push(S+R)}a=u+(a.length>0?" "+a:a)}return a},zn=(...e)=>{let t=0,r,n,o="";for(;t<e.length;)(r=e[t++])&&(n=Rr(r))&&(o&&(o+=" "),o+=n);return o},Rr=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Rr(e[n]))&&(r&&(r+=" "),r+=t);return r},Nn=(e,...t)=>{let r,n,o,s;const i=a=>{const l=t.reduce((u,d)=>d(u),e());return r=Tn(l),n=r.cache.get,o=r.cache.set,s=c,c(a)},c=a=>{const l=n(a);if(l)return l;const u=Mn(a,r);return o(a,u),u};return s=i,(...a)=>s(zn(...a))},Dn=[],T=e=>{const t=r=>r[e]||Dn;return t.isThemeGetter=!0,t},Or=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Pr=/^\((?:(\w[\w-]*):)?(.+)\)$/i,jn=/^\d+\/\d+$/,Wn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Fn=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ln=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,qn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Un=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,oe=e=>jn.test(e),C=e=>!!e&&!Number.isNaN(Number(e)),X=e=>!!e&&Number.isInteger(Number(e)),ot=e=>e.endsWith("%")&&C(e.slice(0,-1)),G=e=>Wn.test(e),$n=()=>!0,Gn=e=>Fn.test(e)&&!Ln.test(e),Ar=()=>!1,Bn=e=>qn.test(e),Vn=e=>Un.test(e),Hn=e=>!p(e)&&!h(e),Kn=e=>ae(e,Mr,Ar),p=e=>Or.test(e),Q=e=>ae(e,zr,Gn),st=e=>ae(e,Zn,C),Qt=e=>ae(e,Tr,Ar),Xn=e=>ae(e,Ir,Vn),Ee=e=>ae(e,Nr,Bn),h=e=>Pr.test(e),ue=e=>ce(e,zr),Yn=e=>ce(e,eo),Zt=e=>ce(e,Tr),Jn=e=>ce(e,Mr),Qn=e=>ce(e,Ir),Re=e=>ce(e,Nr,!0),ae=(e,t,r)=>{const n=Or.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},ce=(e,t,r=!1)=>{const n=Pr.exec(e);return n?n[1]?t(n[1]):r:!1},Tr=e=>e==="position"||e==="percentage",Ir=e=>e==="image"||e==="url",Mr=e=>e==="length"||e==="size"||e==="bg-size",zr=e=>e==="length",Zn=e=>e==="number",eo=e=>e==="family-name",Nr=e=>e==="shadow",to=()=>{const e=T("color"),t=T("font"),r=T("text"),n=T("font-weight"),o=T("tracking"),s=T("leading"),i=T("breakpoint"),c=T("container"),a=T("spacing"),l=T("radius"),u=T("shadow"),d=T("inset-shadow"),m=T("text-shadow"),y=T("drop-shadow"),x=T("blur"),g=T("perspective"),v=T("aspect"),E=T("ease"),O=T("animate"),S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],b=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],w=()=>[...b(),h,p],_=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto","contain","none"],f=()=>[h,p,a],A=()=>[oe,"full","auto",...f()],le=()=>[X,"none","subgrid",h,p],ve=()=>["auto",{span:["full",X,h,p]},X,h,p],Se=()=>[X,"auto",h,p],$t=()=>["auto","min","max","fr",h,p],et=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ne=()=>["start","end","center","stretch","center-safe","end-safe"],$=()=>["auto",...f()],J=()=>[oe,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...f()],k=()=>[e,h,p],Gt=()=>[...b(),Zt,Qt,{position:[h,p]}],Bt=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Vt=()=>["auto","cover","contain",Jn,Kn,{size:[h,p]}],tt=()=>[ot,ue,Q],z=()=>["","none","full",l,h,p],D=()=>["",C,ue,Q],ke=()=>["solid","dashed","dotted","double"],Ht=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],I=()=>[C,ot,Zt,Qt],Kt=()=>["","none",x,h,p],_e=()=>["none",C,h,p],xe=()=>["none",C,h,p],rt=()=>[C,h,p],Ce=()=>[oe,"full",...f()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[G],breakpoint:[G],color:[$n],container:[G],"drop-shadow":[G],ease:["in","out","in-out"],font:[Hn],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[G],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[G],shadow:[G],spacing:["px",C],text:[G],"text-shadow":[G],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",oe,p,h,v]}],container:["container"],columns:[{columns:[C,p,h,c]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:w()}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:A()}],"inset-x":[{"inset-x":A()}],"inset-y":[{"inset-y":A()}],start:[{start:A()}],end:[{end:A()}],top:[{top:A()}],right:[{right:A()}],bottom:[{bottom:A()}],left:[{left:A()}],visibility:["visible","invisible","collapse"],z:[{z:[X,"auto",h,p]}],basis:[{basis:[oe,"full","auto",c,...f()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[C,oe,"auto","initial","none",p]}],grow:[{grow:["",C,h,p]}],shrink:[{shrink:["",C,h,p]}],order:[{order:[X,"first","last","none",h,p]}],"grid-cols":[{"grid-cols":le()}],"col-start-end":[{col:ve()}],"col-start":[{"col-start":Se()}],"col-end":[{"col-end":Se()}],"grid-rows":[{"grid-rows":le()}],"row-start-end":[{row:ve()}],"row-start":[{"row-start":Se()}],"row-end":[{"row-end":Se()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":$t()}],"auto-rows":[{"auto-rows":$t()}],gap:[{gap:f()}],"gap-x":[{"gap-x":f()}],"gap-y":[{"gap-y":f()}],"justify-content":[{justify:[...et(),"normal"]}],"justify-items":[{"justify-items":[...ne(),"normal"]}],"justify-self":[{"justify-self":["auto",...ne()]}],"align-content":[{content:["normal",...et()]}],"align-items":[{items:[...ne(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ne(),{baseline:["","last"]}]}],"place-content":[{"place-content":et()}],"place-items":[{"place-items":[...ne(),"baseline"]}],"place-self":[{"place-self":["auto",...ne()]}],p:[{p:f()}],px:[{px:f()}],py:[{py:f()}],ps:[{ps:f()}],pe:[{pe:f()}],pt:[{pt:f()}],pr:[{pr:f()}],pb:[{pb:f()}],pl:[{pl:f()}],m:[{m:$()}],mx:[{mx:$()}],my:[{my:$()}],ms:[{ms:$()}],me:[{me:$()}],mt:[{mt:$()}],mr:[{mr:$()}],mb:[{mb:$()}],ml:[{ml:$()}],"space-x":[{"space-x":f()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":f()}],"space-y-reverse":["space-y-reverse"],size:[{size:J()}],w:[{w:[c,"screen",...J()]}],"min-w":[{"min-w":[c,"screen","none",...J()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[i]},...J()]}],h:[{h:["screen","lh",...J()]}],"min-h":[{"min-h":["screen","lh","none",...J()]}],"max-h":[{"max-h":["screen","lh",...J()]}],"font-size":[{text:["base",r,ue,Q]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,h,st]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ot,p]}],"font-family":[{font:[Yn,p,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,h,p]}],"line-clamp":[{"line-clamp":[C,"none",h,st]}],leading:[{leading:[s,...f()]}],"list-image":[{"list-image":["none",h,p]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",h,p]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:k()}],"text-color":[{text:k()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ke(),"wavy"]}],"text-decoration-thickness":[{decoration:[C,"from-font","auto",h,Q]}],"text-decoration-color":[{decoration:k()}],"underline-offset":[{"underline-offset":[C,"auto",h,p]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:f()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",h,p]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",h,p]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Gt()}],"bg-repeat":[{bg:Bt()}],"bg-size":[{bg:Vt()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},X,h,p],radial:["",h,p],conic:[X,h,p]},Qn,Xn]}],"bg-color":[{bg:k()}],"gradient-from-pos":[{from:tt()}],"gradient-via-pos":[{via:tt()}],"gradient-to-pos":[{to:tt()}],"gradient-from":[{from:k()}],"gradient-via":[{via:k()}],"gradient-to":[{to:k()}],rounded:[{rounded:z()}],"rounded-s":[{"rounded-s":z()}],"rounded-e":[{"rounded-e":z()}],"rounded-t":[{"rounded-t":z()}],"rounded-r":[{"rounded-r":z()}],"rounded-b":[{"rounded-b":z()}],"rounded-l":[{"rounded-l":z()}],"rounded-ss":[{"rounded-ss":z()}],"rounded-se":[{"rounded-se":z()}],"rounded-ee":[{"rounded-ee":z()}],"rounded-es":[{"rounded-es":z()}],"rounded-tl":[{"rounded-tl":z()}],"rounded-tr":[{"rounded-tr":z()}],"rounded-br":[{"rounded-br":z()}],"rounded-bl":[{"rounded-bl":z()}],"border-w":[{border:D()}],"border-w-x":[{"border-x":D()}],"border-w-y":[{"border-y":D()}],"border-w-s":[{"border-s":D()}],"border-w-e":[{"border-e":D()}],"border-w-t":[{"border-t":D()}],"border-w-r":[{"border-r":D()}],"border-w-b":[{"border-b":D()}],"border-w-l":[{"border-l":D()}],"divide-x":[{"divide-x":D()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":D()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ke(),"hidden","none"]}],"divide-style":[{divide:[...ke(),"hidden","none"]}],"border-color":[{border:k()}],"border-color-x":[{"border-x":k()}],"border-color-y":[{"border-y":k()}],"border-color-s":[{"border-s":k()}],"border-color-e":[{"border-e":k()}],"border-color-t":[{"border-t":k()}],"border-color-r":[{"border-r":k()}],"border-color-b":[{"border-b":k()}],"border-color-l":[{"border-l":k()}],"divide-color":[{divide:k()}],"outline-style":[{outline:[...ke(),"none","hidden"]}],"outline-offset":[{"outline-offset":[C,h,p]}],"outline-w":[{outline:["",C,ue,Q]}],"outline-color":[{outline:k()}],shadow:[{shadow:["","none",u,Re,Ee]}],"shadow-color":[{shadow:k()}],"inset-shadow":[{"inset-shadow":["none",d,Re,Ee]}],"inset-shadow-color":[{"inset-shadow":k()}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:k()}],"ring-offset-w":[{"ring-offset":[C,Q]}],"ring-offset-color":[{"ring-offset":k()}],"inset-ring-w":[{"inset-ring":D()}],"inset-ring-color":[{"inset-ring":k()}],"text-shadow":[{"text-shadow":["none",m,Re,Ee]}],"text-shadow-color":[{"text-shadow":k()}],opacity:[{opacity:[C,h,p]}],"mix-blend":[{"mix-blend":[...Ht(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ht()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[C]}],"mask-image-linear-from-pos":[{"mask-linear-from":I()}],"mask-image-linear-to-pos":[{"mask-linear-to":I()}],"mask-image-linear-from-color":[{"mask-linear-from":k()}],"mask-image-linear-to-color":[{"mask-linear-to":k()}],"mask-image-t-from-pos":[{"mask-t-from":I()}],"mask-image-t-to-pos":[{"mask-t-to":I()}],"mask-image-t-from-color":[{"mask-t-from":k()}],"mask-image-t-to-color":[{"mask-t-to":k()}],"mask-image-r-from-pos":[{"mask-r-from":I()}],"mask-image-r-to-pos":[{"mask-r-to":I()}],"mask-image-r-from-color":[{"mask-r-from":k()}],"mask-image-r-to-color":[{"mask-r-to":k()}],"mask-image-b-from-pos":[{"mask-b-from":I()}],"mask-image-b-to-pos":[{"mask-b-to":I()}],"mask-image-b-from-color":[{"mask-b-from":k()}],"mask-image-b-to-color":[{"mask-b-to":k()}],"mask-image-l-from-pos":[{"mask-l-from":I()}],"mask-image-l-to-pos":[{"mask-l-to":I()}],"mask-image-l-from-color":[{"mask-l-from":k()}],"mask-image-l-to-color":[{"mask-l-to":k()}],"mask-image-x-from-pos":[{"mask-x-from":I()}],"mask-image-x-to-pos":[{"mask-x-to":I()}],"mask-image-x-from-color":[{"mask-x-from":k()}],"mask-image-x-to-color":[{"mask-x-to":k()}],"mask-image-y-from-pos":[{"mask-y-from":I()}],"mask-image-y-to-pos":[{"mask-y-to":I()}],"mask-image-y-from-color":[{"mask-y-from":k()}],"mask-image-y-to-color":[{"mask-y-to":k()}],"mask-image-radial":[{"mask-radial":[h,p]}],"mask-image-radial-from-pos":[{"mask-radial-from":I()}],"mask-image-radial-to-pos":[{"mask-radial-to":I()}],"mask-image-radial-from-color":[{"mask-radial-from":k()}],"mask-image-radial-to-color":[{"mask-radial-to":k()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[C]}],"mask-image-conic-from-pos":[{"mask-conic-from":I()}],"mask-image-conic-to-pos":[{"mask-conic-to":I()}],"mask-image-conic-from-color":[{"mask-conic-from":k()}],"mask-image-conic-to-color":[{"mask-conic-to":k()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Gt()}],"mask-repeat":[{mask:Bt()}],"mask-size":[{mask:Vt()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",h,p]}],filter:[{filter:["","none",h,p]}],blur:[{blur:Kt()}],brightness:[{brightness:[C,h,p]}],contrast:[{contrast:[C,h,p]}],"drop-shadow":[{"drop-shadow":["","none",y,Re,Ee]}],"drop-shadow-color":[{"drop-shadow":k()}],grayscale:[{grayscale:["",C,h,p]}],"hue-rotate":[{"hue-rotate":[C,h,p]}],invert:[{invert:["",C,h,p]}],saturate:[{saturate:[C,h,p]}],sepia:[{sepia:["",C,h,p]}],"backdrop-filter":[{"backdrop-filter":["","none",h,p]}],"backdrop-blur":[{"backdrop-blur":Kt()}],"backdrop-brightness":[{"backdrop-brightness":[C,h,p]}],"backdrop-contrast":[{"backdrop-contrast":[C,h,p]}],"backdrop-grayscale":[{"backdrop-grayscale":["",C,h,p]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[C,h,p]}],"backdrop-invert":[{"backdrop-invert":["",C,h,p]}],"backdrop-opacity":[{"backdrop-opacity":[C,h,p]}],"backdrop-saturate":[{"backdrop-saturate":[C,h,p]}],"backdrop-sepia":[{"backdrop-sepia":["",C,h,p]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":f()}],"border-spacing-x":[{"border-spacing-x":f()}],"border-spacing-y":[{"border-spacing-y":f()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",h,p]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[C,"initial",h,p]}],ease:[{ease:["linear","initial",E,h,p]}],delay:[{delay:[C,h,p]}],animate:[{animate:["none",O,h,p]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,h,p]}],"perspective-origin":[{"perspective-origin":w()}],rotate:[{rotate:_e()}],"rotate-x":[{"rotate-x":_e()}],"rotate-y":[{"rotate-y":_e()}],"rotate-z":[{"rotate-z":_e()}],scale:[{scale:xe()}],"scale-x":[{"scale-x":xe()}],"scale-y":[{"scale-y":xe()}],"scale-z":[{"scale-z":xe()}],"scale-3d":["scale-3d"],skew:[{skew:rt()}],"skew-x":[{"skew-x":rt()}],"skew-y":[{"skew-y":rt()}],transform:[{transform:[h,p,"","none","gpu","cpu"]}],"transform-origin":[{origin:w()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ce()}],"translate-x":[{"translate-x":Ce()}],"translate-y":[{"translate-y":Ce()}],"translate-z":[{"translate-z":Ce()}],"translate-none":["translate-none"],accent:[{accent:k()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:k()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",h,p]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":f()}],"scroll-mx":[{"scroll-mx":f()}],"scroll-my":[{"scroll-my":f()}],"scroll-ms":[{"scroll-ms":f()}],"scroll-me":[{"scroll-me":f()}],"scroll-mt":[{"scroll-mt":f()}],"scroll-mr":[{"scroll-mr":f()}],"scroll-mb":[{"scroll-mb":f()}],"scroll-ml":[{"scroll-ml":f()}],"scroll-p":[{"scroll-p":f()}],"scroll-px":[{"scroll-px":f()}],"scroll-py":[{"scroll-py":f()}],"scroll-ps":[{"scroll-ps":f()}],"scroll-pe":[{"scroll-pe":f()}],"scroll-pt":[{"scroll-pt":f()}],"scroll-pr":[{"scroll-pr":f()}],"scroll-pb":[{"scroll-pb":f()}],"scroll-pl":[{"scroll-pl":f()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",h,p]}],fill:[{fill:["none",...k()]}],"stroke-w":[{stroke:[C,ue,Q,st]}],stroke:[{stroke:["none",...k()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},ro=Nn(to);function M(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var no=typeof Symbol=="function"&&Symbol.observable||"@@observable",er=no,it=()=>Math.random().toString(36).substring(7).split("").join("."),oo={INIT:`@@redux/INIT${it()}`,REPLACE:`@@redux/REPLACE${it()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${it()}`},je=oo;function Rt(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Ot(e,t,r){if(typeof e!="function")throw new Error(M(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(M(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(M(1));return r(Ot)(e,t)}let n=e,o=t,s=new Map,i=s,c=0,a=!1;function l(){i===s&&(i=new Map,s.forEach((v,E)=>{i.set(E,v)}))}function u(){if(a)throw new Error(M(3));return o}function d(v){if(typeof v!="function")throw new Error(M(4));if(a)throw new Error(M(5));let E=!0;l();const O=c++;return i.set(O,v),function(){if(E){if(a)throw new Error(M(6));E=!1,l(),i.delete(O),s=null}}}function m(v){if(!Rt(v))throw new Error(M(7));if(typeof v.type>"u")throw new Error(M(8));if(typeof v.type!="string")throw new Error(M(17));if(a)throw new Error(M(9));try{a=!0,o=n(o,v)}finally{a=!1}return(s=i).forEach(O=>{O()}),v}function y(v){if(typeof v!="function")throw new Error(M(10));n=v,m({type:je.REPLACE})}function x(){const v=d;return{subscribe(E){if(typeof E!="object"||E===null)throw new Error(M(11));function O(){const b=E;b.next&&b.next(u())}return O(),{unsubscribe:v(O)}},[er](){return this}}}return m({type:je.INIT}),{dispatch:m,subscribe:d,getState:u,replaceReducer:y,[er]:x}}function so(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:je.INIT})>"u")throw new Error(M(12));if(typeof r(void 0,{type:je.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(M(13))})}function Pt(e){const t=Object.keys(e),r={};for(let s=0;s<t.length;s++){const i=t[s];typeof e[i]=="function"&&(r[i]=e[i])}const n=Object.keys(r);let o;try{so(r)}catch(s){o=s}return function(i={},c){if(o)throw o;let a=!1;const l={};for(let u=0;u<n.length;u++){const d=n[u],m=r[d],y=i[d],x=m(y,c);if(typeof x>"u")throw c&&c.type,new Error(M(14));l[d]=x,a=a||x!==y}return a=a||n.length!==Object.keys(i).length,a?l:i}}function We(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function io(...e){return t=>(r,n)=>{const o=t(r,n);let s=()=>{throw new Error(M(15))};const i={getState:o.getState,dispatch:(a,...l)=>s(a,...l)},c=e.map(a=>a(i));return s=We(...c)(o.dispatch),{...o,dispatch:s}}}function ao(e){return Rt(e)&&"type"in e&&typeof e.type=="string"}var Dr=Symbol.for("immer-nothing"),tr=Symbol.for("immer-draftable"),N=Symbol.for("immer-state");function q(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var j=Object,ie=j.getPrototypeOf,Fe="constructor",Be="prototype",mt="configurable",Le="enumerable",Ie="writable",me="value",K=e=>!!e&&!!e[N];function U(e){return e?jr(e)||He(e)||!!e[tr]||!!e[Fe]?.[tr]||Ke(e)||Xe(e):!1}var co=j[Be][Fe].toString(),rr=new WeakMap;function jr(e){if(!e||!At(e))return!1;const t=ie(e);if(t===null||t===j[Be])return!0;const r=j.hasOwnProperty.call(t,Fe)&&t[Fe];if(r===Object)return!0;if(!se(r))return!1;let n=rr.get(r);return n===void 0&&(n=Function.toString.call(r),rr.set(r,n)),n===co}function Ve(e,t,r=!0){be(e)===0?(r?Reflect.ownKeys(e):j.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function be(e){const t=e[N];return t?t.type_:He(e)?1:Ke(e)?2:Xe(e)?3:0}var nr=(e,t,r=be(e))=>r===2?e.has(t):j[Be].hasOwnProperty.call(e,t),gt=(e,t,r=be(e))=>r===2?e.get(t):e[t],qe=(e,t,r,n=be(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function lo(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var He=Array.isArray,Ke=e=>e instanceof Map,Xe=e=>e instanceof Set,At=e=>typeof e=="object",se=e=>typeof e=="function",at=e=>typeof e=="boolean";function uo(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var V=e=>e.copy_||e.base_,Tt=e=>e.modified_?e.copy_:e.base_;function yt(e,t){if(Ke(e))return new Map(e);if(Xe(e))return new Set(e);if(He(e))return Array[Be].slice.call(e);const r=jr(e);if(t===!0||t==="class_only"&&!r){const n=j.getOwnPropertyDescriptors(e);delete n[N];let o=Reflect.ownKeys(n);for(let s=0;s<o.length;s++){const i=o[s],c=n[i];c[Ie]===!1&&(c[Ie]=!0,c[mt]=!0),(c.get||c.set)&&(n[i]={[mt]:!0,[Ie]:!0,[Le]:c[Le],[me]:e[i]})}return j.create(ie(e),n)}else{const n=ie(e);if(n!==null&&r)return{...e};const o=j.create(n);return j.assign(o,e)}}function It(e,t=!1){return Ye(e)||K(e)||!U(e)||(be(e)>1&&j.defineProperties(e,{set:Oe,add:Oe,clear:Oe,delete:Oe}),j.freeze(e),t&&Ve(e,(r,n)=>{It(n,!0)},!1)),e}function fo(){q(2)}var Oe={[me]:fo};function Ye(e){return e===null||!At(e)?!0:j.isFrozen(e)}var Ue="MapSet",bt="Patches",or="ArrayMethods",Wr={};function te(e){const t=Wr[e];return t||q(0,e),t}var sr=e=>!!Wr[e],ge,Fr=()=>ge,po=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:sr(Ue)?te(Ue):void 0,arrayMethodsPlugin_:sr(or)?te(or):void 0});function ir(e,t){t&&(e.patchPlugin_=te(bt),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function wt(e){vt(e),e.drafts_.forEach(ho),e.drafts_=null}function vt(e){e===ge&&(ge=e.parent_)}var ar=e=>ge=po(ge,e);function ho(e){const t=e[N];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function cr(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];if(e!==void 0&&e!==r){r[N].modified_&&(wt(t),q(4)),U(e)&&(e=lr(t,e));const{patchPlugin_:o}=t;o&&o.generateReplacementPatches_(r[N].base_,e,t)}else e=lr(t,r);return mo(t,e,!0),wt(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Dr?e:void 0}function lr(e,t){if(Ye(t))return t;const r=t[N];if(!r)return $e(t,e.handledSet_,e);if(!Je(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){const{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(e);Ur(r,e)}return r.copy_}function mo(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&It(t,r)}function Lr(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Je=(e,t)=>e.scope_===t,go=[];function qr(e,t,r,n){const o=V(e),s=e.type_;if(n!==void 0&>(o,n,s)===t){qe(o,n,r,s);return}if(!e.draftLocations_){const c=e.draftLocations_=new Map;Ve(o,(a,l)=>{if(K(l)){const u=c.get(l)||[];u.push(a),c.set(l,u)}})}const i=e.draftLocations_.get(t)??go;for(const c of i)qe(o,c,r,s)}function yo(e,t,r){e.callbacks_.push(function(o){const s=t;if(!s||!Je(s,o))return;o.mapSetPlugin_?.fixSetContents(s);const i=Tt(s);qr(e,s.draft_??s,i,r),Ur(s,o)})}function Ur(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){const{patchPlugin_:n}=t;if(n){const o=n.getPath(e);o&&n.generatePatches_(e,o,t)}Lr(e)}}function bo(e,t,r){const{scope_:n}=e;if(K(r)){const o=r[N];Je(o,n)&&o.callbacks_.push(function(){Me(e);const i=Tt(o);qr(e,r,i,t)})}else U(r)&&e.callbacks_.push(function(){const s=V(e);e.type_===3?s.has(r)&&$e(r,n.handledSet_,n):gt(s,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&$e(gt(e.copy_,t,e.type_),n.handledSet_,n)})}function $e(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||K(e)||t.has(e)||!U(e)||Ye(e)||(t.add(e),Ve(e,(n,o)=>{if(K(o)){const s=o[N];if(Je(s,r)){const i=Tt(s);qe(e,n,i,e.type_),Lr(s)}}else U(o)&&$e(o,t,r)})),e}function wo(e,t){const r=He(e),n={type_:r?1:0,scope_:t?t.scope_:Fr(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let o=n,s=Ge;r&&(o=[n],s=ye);const{revoke:i,proxy:c}=Proxy.revocable(o,s);return n.draft_=c,n.revoke_=i,[c,n]}var Ge={get(e,t){if(t===N)return e;let r=e.scope_.arrayMethodsPlugin_;const n=e.type_===1&&typeof t=="string";if(n&&r?.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);const o=V(e);if(!nr(o,t,e.type_))return vo(e,o,t);const s=o[t];if(e.finalized_||!U(s)||n&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&uo(t))return s;if(s===ct(e.base_,t)){Me(e);const i=e.type_===1?+t:t,c=kt(e.scope_,s,e,i);return e.copy_[i]=c}return s},has(e,t){return t in V(e)},ownKeys(e){return Reflect.ownKeys(V(e))},set(e,t,r){const n=$r(V(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const o=ct(V(e),t),s=o?.[N];if(s&&s.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(lo(r,o)&&(r!==void 0||nr(e.base_,t,e.type_)))return!0;Me(e),St(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),bo(e,t,r)),!0},deleteProperty(e,t){return Me(e),ct(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),St(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=V(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[Ie]:!0,[mt]:e.type_!==1||t!=="length",[Le]:n[Le],[me]:r[t]}},defineProperty(){q(11)},getPrototypeOf(e){return ie(e.base_)},setPrototypeOf(){q(12)}},ye={};for(let e in Ge){let t=Ge[e];ye[e]=function(){const r=arguments;return r[0]=r[0][0],t.apply(this,r)}}ye.deleteProperty=function(e,t){return ye.set.call(this,e,t,void 0)};ye.set=function(e,t,r){return Ge.set.call(this,e[0],t,r,e[0])};function ct(e,t){const r=e[N];return(r?V(r):e)[t]}function vo(e,t,r){const n=$r(t,r);return n?me in n?n[me]:n.get?.call(e.draft_):void 0}function $r(e,t){if(!(t in e))return;let r=ie(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=ie(r)}}function St(e){e.modified_||(e.modified_=!0,e.parent_&&St(e.parent_))}function Me(e){e.copy_||(e.assigned_=new Map,e.copy_=yt(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var So=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,r,n)=>{if(se(t)&&!se(r)){const s=r;r=t;const i=this;return function(a=s,...l){return i.produce(a,u=>r.call(this,u,...l))}}se(r)||q(6),n!==void 0&&!se(n)&&q(7);let o;if(U(t)){const s=ar(this),i=kt(s,t,void 0);let c=!0;try{o=r(i),c=!1}finally{c?wt(s):vt(s)}return ir(s,n),cr(o,s)}else if(!t||!At(t)){if(o=r(t),o===void 0&&(o=t),o===Dr&&(o=void 0),this.autoFreeze_&&It(o,!0),n){const s=[],i=[];te(bt).generateReplacementPatches_(t,o,{patches_:s,inversePatches_:i}),n(s,i)}return o}else q(1,t)},this.produceWithPatches=(t,r)=>{if(se(t))return(i,...c)=>this.produceWithPatches(i,a=>t(a,...c));let n,o;return[this.produce(t,r,(i,c)=>{n=i,o=c}),n,o]},at(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),at(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),at(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){U(e)||q(8),K(e)&&(e=ko(e));const t=ar(this),r=kt(t,e,void 0);return r[N].isManual_=!0,vt(t),r}finishDraft(e,t){const r=e&&e[N];(!r||!r.isManual_)&&q(9);const{scope_:n}=r;return ir(n,t),cr(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));const n=te(bt).applyPatches_;return K(e)?n(e,t):this.produce(e,o=>n(o,t))}};function kt(e,t,r,n){const[o,s]=Ke(t)?te(Ue).proxyMap_(t,r):Xe(t)?te(Ue).proxySet_(t,r):wo(t,r);return(r?.scope_??Fr()).drafts_.push(o),s.callbacks_=r?.callbacks_??[],s.key_=n,r&&n!==void 0?yo(r,s,n):s.callbacks_.push(function(a){a.mapSetPlugin_?.fixSetContents(s);const{patchPlugin_:l}=a;s.modified_&&l&&l.generatePatches_(s,[],a)}),o}function ko(e){return K(e)||q(10,e),Gr(e)}function Gr(e){if(!U(e)||Ye(e))return e;const t=e[N];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=yt(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=yt(e,!0);return Ve(r,(o,s)=>{qe(r,o,Gr(s))},n),t&&(t.finalized_=!1),r}var _o=new So,Br=_o.produce;function Vr(e){return({dispatch:r,getState:n})=>o=>s=>typeof s=="function"?s(r,n,e):o(s)}var xo=Vr(),Co=Vr,Eo=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?We:We.apply(null,arguments)},Ro=e=>e&&typeof e.match=="function";function pe(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(H(0));return{type:e,payload:o.payload,..."meta"in o&&{meta:o.meta},..."error"in o&&{error:o.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>ao(n)&&n.type===e,r}var Hr=class de extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,de.prototype)}static get[Symbol.species](){return de}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new de(...t[0].concat(this)):new de(...t.concat(this))}};function ur(e){return U(e)?Br(e,()=>{}):e}function Pe(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function Oo(e){return typeof e=="boolean"}var Po=()=>function(t){const{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:s=!0}=t??{};let i=new Hr;return r&&(Oo(r)?i.push(xo):i.push(Co(r.extraArgument))),i},Ao="RTK_autoBatch",dr=e=>t=>{setTimeout(t,e)},To=(e={type:"raf"})=>t=>(...r)=>{const n=t(...r);let o=!0,s=!1,i=!1;const c=new Set,a=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:dr(10):e.type==="callback"?e.queueNotification:dr(e.timeout),l=()=>{i=!1,s&&(s=!1,c.forEach(u=>u()))};return Object.assign({},n,{subscribe(u){const d=()=>o&&u(),m=n.subscribe(d);return c.add(u),()=>{m(),c.delete(u)}},dispatch(u){try{return o=!u?.meta?.[Ao],s=!o,s&&(i||(i=!0,a(l))),n.dispatch(u)}finally{o=!0}}})},Io=e=>function(r){const{autoBatch:n=!0}=r??{};let o=new Hr(e);return n&&o.push(To(typeof n=="object"?n:void 0)),o};function Mo(e){const t=Po(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:s=void 0,enhancers:i=void 0}=e||{};let c;if(typeof r=="function")c=r;else if(Rt(r))c=Pt(r);else throw new Error(H(1));let a;typeof n=="function"?a=n(t):a=t();let l=We;o&&(l=Eo({trace:!1,...typeof o=="object"&&o}));const u=io(...a),d=Io(u);let m=typeof i=="function"?i(d):d();const y=l(...m);return Ot(c,s,y)}function Kr(e){const t={},r=[];let n;const o={addCase(s,i){const c=typeof s=="string"?s:s.type;if(!c)throw new Error(H(28));if(c in t)throw new Error(H(29));return t[c]=i,o},addAsyncThunk(s,i){return i.pending&&(t[s.pending.type]=i.pending),i.rejected&&(t[s.rejected.type]=i.rejected),i.fulfilled&&(t[s.fulfilled.type]=i.fulfilled),i.settled&&r.push({matcher:s.settled,reducer:i.settled}),o},addMatcher(s,i){return r.push({matcher:s,reducer:i}),o},addDefaultCase(s){return n=s,o}};return e(o),[t,r,n]}function zo(e){return typeof e=="function"}function No(e,t){let[r,n,o]=Kr(t),s;if(zo(e))s=()=>ur(e());else{const c=ur(e);s=()=>c}function i(c=s(),a){let l=[r[a.type],...n.filter(({matcher:u})=>u(a)).map(({reducer:u})=>u)];return l.filter(u=>!!u).length===0&&(l=[o]),l.reduce((u,d)=>{if(d)if(K(u)){const y=d(u,a);return y===void 0?u:y}else{if(U(u))return Br(u,m=>d(m,a));{const m=d(u,a);if(m===void 0){if(u===null)return u;throw Error("A case reducer on a non-draftable value must not return undefined")}return m}}return u},c)}return i.getInitialState=s,i}var Do=(e,t)=>Ro(e)?e.match(t):e(t);function jo(...e){return t=>e.some(r=>Do(r,t))}var Wo="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Fo=(e=21)=>{let t="",r=e;for(;r--;)t+=Wo[Math.random()*64|0];return t},Lo=["name","message","stack","code"],lt=class{constructor(e,t){this.payload=e,this.meta=t}_type},fr=class{constructor(e,t){this.payload=e,this.meta=t}_type},qo=e=>{if(typeof e=="object"&&e!==null){const t={};for(const r of Lo)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},pr="External signal was aborted",Mt=(()=>{function e(t,r,n){const o=pe(t+"/fulfilled",(a,l,u,d)=>({payload:a,meta:{...d||{},arg:u,requestId:l,requestStatus:"fulfilled"}})),s=pe(t+"/pending",(a,l,u)=>({payload:void 0,meta:{...u||{},arg:l,requestId:a,requestStatus:"pending"}})),i=pe(t+"/rejected",(a,l,u,d,m)=>({payload:d,error:(n&&n.serializeError||qo)(a||"Rejected"),meta:{...m||{},arg:u,requestId:l,rejectedWithValue:!!d,requestStatus:"rejected",aborted:a?.name==="AbortError",condition:a?.name==="ConditionError"}}));function c(a,{signal:l}={}){return(u,d,m)=>{const y=n?.idGenerator?n.idGenerator(a):Fo(),x=new AbortController;let g,v;function E(S){v=S,x.abort()}l&&(l.aborted?E(pr):l.addEventListener("abort",()=>E(pr),{once:!0}));const O=(async function(){let S;try{let w=n?.condition?.(a,{getState:d,extra:m});if($o(w)&&(w=await w),w===!1||x.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const _=new Promise((R,f)=>{g=()=>{f({name:"AbortError",message:v||"Aborted"})},x.signal.addEventListener("abort",g,{once:!0})});u(s(y,a,n?.getPendingMeta?.({requestId:y,arg:a},{getState:d,extra:m}))),S=await Promise.race([_,Promise.resolve(r(a,{dispatch:u,getState:d,extra:m,requestId:y,signal:x.signal,abort:E,rejectWithValue:(R,f)=>new lt(R,f),fulfillWithValue:(R,f)=>new fr(R,f)})).then(R=>{if(R instanceof lt)throw R;return R instanceof fr?o(R.payload,y,a,R.meta):o(R,y,a)})])}catch(w){S=w instanceof lt?i(null,y,a,w.payload,w.meta):i(w,y,a)}finally{g&&x.signal.removeEventListener("abort",g)}return n&&!n.dispatchConditionRejection&&i.match(S)&&S.meta.condition||u(S),S})();return Object.assign(O,{abort:E,requestId:y,arg:a,unwrap(){return O.then(Uo)}})}}return Object.assign(c,{pending:s,rejected:i,fulfilled:o,settled:jo(i,o),typePrefix:t})}return e.withTypes=()=>e,e})();function Uo(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function $o(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var Go=Symbol.for("rtk-slice-createasyncthunk");function Bo(e,t){return`${e}/${t}`}function Vo({creators:e}={}){const t=e?.asyncThunk?.[Go];return function(n){const{name:o,reducerPath:s=o}=n;if(!o)throw new Error(H(11));const i=(typeof n.reducers=="function"?n.reducers(Ko()):n.reducers)||{},c=Object.keys(i),a={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},l={addCase(S,b){const w=typeof S=="string"?S:S.type;if(!w)throw new Error(H(12));if(w in a.sliceCaseReducersByType)throw new Error(H(13));return a.sliceCaseReducersByType[w]=b,l},addMatcher(S,b){return a.sliceMatchers.push({matcher:S,reducer:b}),l},exposeAction(S,b){return a.actionCreators[S]=b,l},exposeCaseReducer(S,b){return a.sliceCaseReducersByName[S]=b,l}};c.forEach(S=>{const b=i[S],w={reducerName:S,type:Bo(o,S),createNotation:typeof n.reducers=="function"};Yo(b)?Qo(w,b,l,t):Xo(w,b,l)});function u(){const[S={},b=[],w=void 0]=typeof n.extraReducers=="function"?Kr(n.extraReducers):[n.extraReducers],_={...S,...a.sliceCaseReducersByType};return No(n.initialState,R=>{for(let f in _)R.addCase(f,_[f]);for(let f of a.sliceMatchers)R.addMatcher(f.matcher,f.reducer);for(let f of b)R.addMatcher(f.matcher,f.reducer);w&&R.addDefaultCase(w)})}const d=S=>S,m=new Map,y=new WeakMap;let x;function g(S,b){return x||(x=u()),x(S,b)}function v(){return x||(x=u()),x.getInitialState()}function E(S,b=!1){function w(R){let f=R[S];return typeof f>"u"&&b&&(f=Pe(y,w,v)),f}function _(R=d){const f=Pe(m,b,()=>new WeakMap);return Pe(f,R,()=>{const A={};for(const[le,ve]of Object.entries(n.selectors??{}))A[le]=Ho(ve,R,()=>Pe(y,R,v),b);return A})}return{reducerPath:S,getSelectors:_,get selectors(){return _(w)},selectSlice:w}}const O={name:o,reducer:g,actions:a.actionCreators,caseReducers:a.sliceCaseReducersByName,getInitialState:v,...E(s),injectInto(S,{reducerPath:b,...w}={}){const _=b??s;return S.inject({reducerPath:_,reducer:g},w),{...O,...E(_,!0)}}};return O}}function Ho(e,t,r,n){function o(s,...i){let c=t(s);return typeof c>"u"&&n&&(c=r()),e(c,...i)}return o.unwrapped=e,o}var Qe=Vo();function Ko(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function Xo({type:e,reducerName:t,createNotation:r},n,o){let s,i;if("reducer"in n){if(r&&!Jo(n))throw new Error(H(17));s=n.reducer,i=n.prepare}else s=n;o.addCase(e,s).exposeCaseReducer(t,s).exposeAction(t,i?pe(e,i):pe(e))}function Yo(e){return e._reducerDefinitionType==="asyncThunk"}function Jo(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Qo({type:e,reducerName:t},r,n,o){if(!o)throw new Error(H(18));const{payloadCreator:s,fulfilled:i,pending:c,rejected:a,settled:l,options:u}=r,d=o(e,s,u);n.exposeAction(t,d),i&&n.addCase(d.fulfilled,i),c&&n.addCase(d.pending,c),a&&n.addCase(d.rejected,a),l&&n.addMatcher(d.settled,l),n.exposeCaseReducer(t,{fulfilled:i||Ae,pending:c||Ae,rejected:a||Ae,settled:l||Ae})}function Ae(){}function H(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var zt="persist:",Nt="persist/FLUSH",Ze="persist/REHYDRATE",Dt="persist/PAUSE",jt="persist/PERSIST",Wt="persist/PURGE",Ft="persist/REGISTER",Zo=-1;function ze(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ze=function(r){return typeof r}:ze=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ze(e)}function hr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function es(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?hr(r,!0).forEach(function(n){ts(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hr(r).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ts(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rs(e,t,r,n){n.debug;var o=es({},r);return e&&ze(e)==="object"&&Object.keys(e).forEach(function(s){s!=="_persist"&&t[s]===r[s]&&(o[s]=e[s])}),o}function ns(e){var t=e.blacklist||null,r=e.whitelist||null,n=e.transforms||[],o=e.throttle||0,s="".concat(e.keyPrefix!==void 0?e.keyPrefix:zt).concat(e.key),i=e.storage,c;e.serialize===!1?c=function(w){return w}:typeof e.serialize=="function"?c=e.serialize:c=os;var a=e.writeFailHandler||null,l={},u={},d=[],m=null,y=null,x=function(w){Object.keys(w).forEach(function(_){E(_)&&l[_]!==w[_]&&d.indexOf(_)===-1&&d.push(_)}),Object.keys(l).forEach(function(_){w[_]===void 0&&E(_)&&d.indexOf(_)===-1&&l[_]!==void 0&&d.push(_)}),m===null&&(m=setInterval(g,o)),l=w};function g(){if(d.length===0){m&&clearInterval(m),m=null;return}var b=d.shift(),w=n.reduce(function(_,R){return R.in(_,b,l)},l[b]);if(w!==void 0)try{u[b]=c(w)}catch(_){console.error("redux-persist/createPersistoid: error serializing state",_)}else delete u[b];d.length===0&&v()}function v(){Object.keys(u).forEach(function(b){l[b]===void 0&&delete u[b]}),y=i.setItem(s,c(u)).catch(O)}function E(b){return!(r&&r.indexOf(b)===-1&&b!=="_persist"||t&&t.indexOf(b)!==-1)}function O(b){a&&a(b)}var S=function(){for(;d.length!==0;)g();return y||Promise.resolve()};return{update:x,flush:S}}function os(e){return JSON.stringify(e)}function ss(e){var t=e.transforms||[],r="".concat(e.keyPrefix!==void 0?e.keyPrefix:zt).concat(e.key),n=e.storage;e.debug;var o;return e.deserialize===!1?o=function(i){return i}:typeof e.deserialize=="function"?o=e.deserialize:o=is,n.getItem(r).then(function(s){if(s)try{var i={},c=o(s);return Object.keys(c).forEach(function(a){i[a]=t.reduceRight(function(l,u){return u.out(l,a,c)},o(c[a]))}),i}catch(a){throw a}else return})}function is(e){return JSON.parse(e)}function as(e){var t=e.storage,r="".concat(e.keyPrefix!==void 0?e.keyPrefix:zt).concat(e.key);return t.removeItem(r,cs)}function cs(e){}function mr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function B(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?mr(r,!0).forEach(function(n){ls(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mr(r).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ls(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function us(e,t){if(e==null)return{};var r=ds(e,t),n,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)n=s[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ds(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,s;for(s=0;s<n.length;s++)o=n[s],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}var fs=5e3;function Xr(e,t){var r=e.version!==void 0?e.version:Zo;e.debug;var n=e.stateReconciler===void 0?rs:e.stateReconciler,o=e.getStoredState||ss,s=e.timeout!==void 0?e.timeout:fs,i=null,c=!1,a=!0,l=function(d){return d._persist.rehydrated&&i&&!a&&i.update(d),d};return function(u,d){var m=u||{},y=m._persist,x=us(m,["_persist"]),g=x;if(d.type===jt){var v=!1,E=function(f,A){v||(d.rehydrate(e.key,f,A),v=!0)};if(s&&setTimeout(function(){!v&&E(void 0,new Error('redux-persist: persist timed out for persist key "'.concat(e.key,'"')))},s),a=!1,i||(i=ns(e)),y)return B({},t(g,d),{_persist:y});if(typeof d.rehydrate!="function"||typeof d.register!="function")throw new Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");return d.register(e.key),o(e).then(function(R){var f=e.migrate||function(A,le){return Promise.resolve(A)};f(R,r).then(function(A){E(A)},function(A){E(void 0,A)})},function(R){E(void 0,R)}),B({},t(g,d),{_persist:{version:r,rehydrated:!1}})}else{if(d.type===Wt)return c=!0,d.result(as(e)),B({},t(g,d),{_persist:y});if(d.type===Nt)return d.result(i&&i.flush()),B({},t(g,d),{_persist:y});if(d.type===Dt)a=!0;else if(d.type===Ze){if(c)return B({},g,{_persist:B({},y,{rehydrated:!0})});if(d.key===e.key){var O=t(g,d),S=d.payload,b=n!==!1&&S!==void 0?n(S,u,O,e):O,w=B({},b,{_persist:B({},y,{rehydrated:!0})});return l(w)}}}if(!y)return t(u,d);var _=t(g,d);return _===g?u:l(B({},_,{_persist:y}))}}function gr(e){return ms(e)||hs(e)||ps()}function ps(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function hs(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function ms(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}function yr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function _t(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?yr(r,!0).forEach(function(n){gs(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yr(r).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function gs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Yr={registry:[],bootstrapped:!1},ys=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Yr,r=arguments.length>1?arguments[1]:void 0;switch(r.type){case Ft:return _t({},t,{registry:[].concat(gr(t.registry),[r.key])});case Ze:var n=t.registry.indexOf(r.key),o=gr(t.registry);return o.splice(n,1),_t({},t,{registry:o,bootstrapped:o.length===0});default:return t}};function bs(e,t,r){var n=Ot(ys,Yr,void 0),o=function(a){n.dispatch({type:Ft,key:a})},s=function(a,l,u){var d={type:Ze,payload:l,err:u,key:a};e.dispatch(d),n.dispatch(d)},i=_t({},n,{purge:function(){var a=[];return e.dispatch({type:Wt,result:function(u){a.push(u)}}),Promise.all(a)},flush:function(){var a=[];return e.dispatch({type:Nt,result:function(u){a.push(u)}}),Promise.all(a)},pause:function(){e.dispatch({type:Dt})},persist:function(){e.dispatch({type:jt,register:o,rehydrate:s})}});return i.persist(),i}function Jr(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=r.whitelist||null,o=r.blacklist||null;function s(i){return!!(n&&n.indexOf(i)===-1||o&&o.indexOf(i)!==-1)}return{in:function(c,a,l){return!s(a)&&e?e(c,a,l):c},out:function(c,a,l){return!s(a)&&t?t(c,a,l):c}}}function Ne(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ne=function(r){return typeof r}:Ne=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ne(e)}function ut(){}var ws={getItem:ut,setItem:ut,removeItem:ut};function vs(e){if((typeof self>"u"?"undefined":Ne(self))!=="object"||!(e in self))return!1;try{var t=self[e],r="redux-persist ".concat(e," test");t.setItem(r,"test"),t.getItem(r),t.removeItem(r)}catch{return!1}return!0}function Ss(e){var t="".concat(e,"Storage");return vs(t)?self[t]:ws}function ks(e){var t=Ss(e);return{getItem:function(n){return new Promise(function(o,s){o(t.getItem(n))})},setItem:function(n,o){return new Promise(function(s,i){s(t.setItem(n,o))})},removeItem:function(n){return new Promise(function(o,s){o(t.removeItem(n))})}}}const _s=ks("local"),xs={sidebarOpen:!0,activeMenu:"home"},Qr=Qe({name:"ui",initialState:xs,reducers:{toggleSidebar:e=>{e.sidebarOpen=!e.sidebarOpen},setSidebarOpen:(e,t)=>{e.sidebarOpen=t.payload},setActiveMenu:(e,t)=>{e.activeMenu=t.payload}}}),{toggleSidebar:mi,setSidebarOpen:gi,setActiveMenu:yi}=Qr.actions,Cs=Qr.reducer,Es={routes:[]},Rs=(e,t)=>{const r=t.split("/").filter(Boolean);for(let n=r.length-1;n>0;n--){const o="/"+r.slice(0,n).join("/"),s=e.find(i=>i.path===o);if(s)return s}return e.find(n=>n.path==="/")||null},Os=(e,t)=>e==="/"?t:t.replace(e+"/",""),Zr=Qe({name:"route",initialState:Es,reducers:{addRoute:(e,t)=>{const r=t.payload,n=Rs(e.routes,r.path);if(n){n.children||(n.children=[]);const o=Os(n.path,r.path);n.children.push({...r,path:o})}else e.routes.push(r);e.routes.sort((o,s)=>(o.meta?.order||999)-(s.meta?.order||999))},removeRoute:(e,t)=>{const r=t.payload,n=o=>{const s=o.findIndex(i=>i.path===r);if(s>=0)return o.splice(s,1),!0;for(const i of o)if(i.children&&n(i.children))return!0;return!1};n(e.routes)},updateRoute:(e,t)=>{const{path:r,updates:n}=t.payload,o=s=>{const i=s.findIndex(c=>c.path===r);if(i>=0)return s[i]={...s[i],...n},!0;for(const c of s)if(c.children&&o(c.children))return!0;return!1};o(e.routes)},setRoutes:(e,t)=>{e.routes=t.payload,e.routes.sort((r,n)=>(r.meta?.order||999)-(n.meta?.order||999))},clearRoutes:e=>{e.routes=[]}}}),{addRoute:Ps,removeRoute:As,updateRoute:Ts,setRoutes:bi,clearRoutes:Is}=Zr.actions,Ms=Zr.reducer,zs={entries:[],loadedScripts:[]},Lt=Mt("script/loadScript",async e=>new Promise((t,r)=>{const n=document.createElement("script");n.type="module",n.src=e,n.dataset.dynamicEntry="true",n.onload=()=>t(e),n.onerror=o=>{console.error("[Script] Load failed:",e),r(o)},document.body.appendChild(n)})),en=Mt("script/loadScripts",async(e,{dispatch:t})=>(await Promise.allSettled(e.map(n=>t(Lt(n)).unwrap()))).filter(n=>n.status==="fulfilled").map(n=>n.value)),tn=Mt("script/unloadScript",async e=>(document.querySelectorAll(`script[src="${e}"][data-dynamic-entry="true"]`).forEach(r=>r.remove()),e)),rn=Qe({name:"script",initialState:zs,reducers:{syncEntries:(e,t)=>{e.entries=t.payload},addEntry:(e,t)=>{e.entries.includes(t.payload)||e.entries.push(t.payload)},removeEntry:(e,t)=>{e.entries=e.entries.filter(r=>r!==t.payload),e.loadedScripts=e.loadedScripts.filter(r=>r!==t.payload)}},extraReducers:e=>{e.addCase(Lt.fulfilled,(t,r)=>{t.loadedScripts.includes(r.payload)||t.loadedScripts.push(r.payload)}),e.addCase(en.fulfilled,(t,r)=>{r.payload.forEach(n=>{t.loadedScripts.includes(n)||t.loadedScripts.push(n)})}),e.addCase(tn.fulfilled,(t,r)=>{t.loadedScripts=t.loadedScripts.filter(n=>n!==r.payload)})}}),{syncEntries:wi,addEntry:vi,removeEntry:Si}=rn.actions,Ns=rn.reducer,Ds={configs:{},schemas:{},loading:{},errors:{},connected:!1},nn=Qe({name:"config",initialState:Ds,reducers:{setConnected:(e,t)=>{e.connected=t.payload},setLoading:(e,t)=>{const{pluginName:r,loading:n}=t.payload;e.loading[r]=n},setError:(e,t)=>{const{pluginName:r,error:n}=t.payload;e.errors[r]=n},updateConfig:(e,t)=>{const{pluginName:r,config:n}=t.payload;e.configs[r]=n,e.loading[r]=!1,e.errors[r]=null},updateSchema:(e,t)=>{const{pluginName:r,schema:n}=t.payload;e.schemas[r]=n},updateConfigs:(e,t)=>{e.configs={...e.configs,...t.payload}},updateSchemas:(e,t)=>{e.schemas={...e.schemas,...t.payload}},removeConfig:(e,t)=>{const r=t.payload;delete e.configs[r],delete e.schemas[r],delete e.loading[r],delete e.errors[r]},clearConfigs:e=>{e.configs={},e.schemas={},e.loading={},e.errors={}}}}),{setConnected:dt,setLoading:Te,setError:fe,updateConfig:js,updateSchema:Ws,updateConfigs:on,updateSchemas:sn,removeConfig:ki,clearConfigs:_i}=nn.actions,Fs=nn.reducer,Ls=(e,t)=>e.config.configs[t],qs=(e,t)=>e.config.schemas[t],Us=(e,t)=>e.config.loading[t]||!1,$s=(e,t)=>e.config.errors[t]||null,qt=e=>e.config.connected,Gs=e=>e.config.configs,Bs=e=>e.config.schemas,xt={ui:Cs,route:Ms,script:Ns,config:Fs};var ft={exports:{}},pt={};var br;function Vs(){if(br)return pt;br=1;var e=un;function t(a,l){return a===l&&(a!==0||1/a===1/l)||a!==a&&l!==l}var r=typeof Object.is=="function"?Object.is:t,n=e.useSyncExternalStore,o=e.useRef,s=e.useEffect,i=e.useMemo,c=e.useDebugValue;return pt.useSyncExternalStoreWithSelector=function(a,l,u,d,m){var y=o(null);if(y.current===null){var x={hasValue:!1,value:null};y.current=x}else x=y.current;y=i(function(){function v(w){if(!E){if(E=!0,O=w,w=d(w),m!==void 0&&x.hasValue){var _=x.value;if(m(_,w))return S=_}return S=w}if(_=S,r(O,w))return _;var R=d(w);return m!==void 0&&m(_,R)?(O=w,_):(O=w,S=R)}var E=!1,O,S,b=u===void 0?null:u;return[function(){return v(l())},b===null?void 0:function(){return v(b())}]},[l,u,d,m]);var g=n(a,y[0],y[1]);return s(function(){x.hasValue=!0,x.value=g},[g]),c(g),g},pt}var wr;function Hs(){return wr||(wr=1,ft.exports=Vs()),ft.exports}var Ks=Hs(),Xs=Symbol.for("react-redux-context"),Ys=typeof globalThis<"u"?globalThis:{};function Js(){if(!Y.createContext)return{};const e=Ys[Xs]??=new Map;let t=e.get(Y.createContext);return t||(t=Y.createContext(null),e.set(Y.createContext,t)),t}var re=Js();function Ut(e=re){return function(){return Y.useContext(e)}}var an=Ut();function cn(e=re){const t=e===re?an:Ut(e),r=()=>{const{store:n}=t();return n};return Object.assign(r,{withTypes:()=>r}),r}var Qs=cn();function Zs(e=re){const t=e===re?Qs:cn(e),r=()=>t().dispatch;return Object.assign(r,{withTypes:()=>r}),r}var ei=Zs(),ti=(e,t)=>e===t;function ri(e=re){const t=e===re?an:Ut(e),r=(n,o={})=>{const{equalityFn:s=ti}=typeof o=="function"?{equalityFn:o}:o,i=t(),{store:c,subscription:a,getServerState:l}=i;Y.useRef(!0);const u=Y.useCallback({[n.name](m){return n(m)}}[n.name],[n]),d=Ks.useSyncExternalStoreWithSelector(a.addNestedSub,c.getState,l||c.getState,u,s);return Y.useDebugValue(d),d};return Object.assign(r,{withTypes:()=>r}),r}var ni=ri();const oi=Jr(e=>{const{routes:t,...r}=e;return r},e=>({...e,routes:[]}),{whitelist:["route"]}),si=Jr(e=>{const{entries:t,loadedScripts:r,...n}=e;return n},e=>({...e,entries:[],loadedScripts:[]}),{whitelist:["script"]}),ln={key:"root",storage:_s,transforms:[oi,si]},ii=Xr(ln,Pt(xt)),P=Mo({reducer:ii,middleware:e=>e({serializableCheck:{ignoredActions:[Nt,Ze,Dt,jt,Wt,Ft,"route/addRoute","route/updateRoute","route/setRoutes"],ignoredPaths:["route.routes"]}})}),xi=bs(P);typeof window<"u"&&(window.__REDUX_STORE__=P);function Ci(e,t){xt[e]=t;const r=Xr(ln,Pt(xt));P.replaceReducer(r)}const ai=ei,F=ni,Ei=e=>P.dispatch(Ps(e)),Ri=e=>P.dispatch(As(e)),Oi=(e,t)=>P.dispatch(Ts({path:e,updates:t})),Pi=e=>P.getState().route.routes.find(t=>t.path===e),Ai=()=>P.getState().route.routes,Ti=()=>P.dispatch(Is());function Ii(){const e=F(r=>r.route.routes);console.log(e);const t=Ct(()=>{const r=s=>{const i={path:s.path,element:s.element,Component:s.Component};return s.children&&s.children.length>0&&(i.children=s.children.map(c=>r(c))),i},n=e.map(r);return dn([{path:"/",element:nt(pn,{}),children:n},{path:"*",element:nt("div",{children:"404 - Page Not Found"})}])},[e]);return nt(fn,{router:t})}var W=(e=>(e.DISCONNECTED="disconnected",e.CONNECTING="connecting",e.CONNECTED="connected",e.RECONNECTING="reconnecting",e.ERROR="error",e))(W||{});class Z extends Error{constructor(t,r,n){super(t),this.code=r,this.originalError=n,this.name="WebSocketError"}}class ci extends Z{constructor(t){super(`Request ${t} timed out`,"REQUEST_TIMEOUT")}}class vr extends Z{constructor(t,r){super(t,"CONNECTION_ERROR",r)}}class Sr extends Z{constructor(t,r){super(t,"MESSAGE_ERROR",r)}}class li{static handle(t){try{switch(t.type){case"sync":this.handleScriptSync(t);break;case"add":this.handleScriptAdd(t);break;case"delete":this.handleScriptDelete(t);break;case"config:updated":this.handleConfigUpdated(t);break;case"config:batch":this.handleConfigBatch(t);break;case"config:error":this.handleConfigError(t);break;case"schema:updated":this.handleSchemaUpdated(t);break;case"schema:batch":this.handleSchemaBatch(t);break;case"init-data":case"data-update":this.handleSystemMessage(t);break;default:console.warn("[WebSocket] Unknown message type:",t.type)}}catch(r){console.error("[WebSocket] Message handling error:",r)}}static handleScriptSync(t){if(t.data?.key==="entries"){const r=Array.isArray(t.data.value)?t.data.value:[t.data.value];P.dispatch({type:"script/syncEntries",payload:r}),P.dispatch(en(r))}}static handleScriptAdd(t){t.data?.key==="entries"&&(P.dispatch({type:"script/addEntry",payload:t.data.value}),P.dispatch(Lt(t.data.value)))}static handleScriptDelete(t){t.data?.key==="entries"&&(P.dispatch({type:"script/removeEntry",payload:t.data.value}),P.dispatch(tn(t.data.value)))}static handleConfigUpdated(t){t.pluginName&&t.data!==void 0&&P.dispatch(js({pluginName:t.pluginName,config:t.data}))}static handleConfigBatch(t){t.data&&P.dispatch(on(t.data))}static handleConfigError(t){t.pluginName&&t.error&&P.dispatch(fe({pluginName:t.pluginName,error:t.error}))}static handleSchemaUpdated(t){t.pluginName&&t.data!==void 0&&P.dispatch(Ws({pluginName:t.pluginName,schema:t.data}))}static handleSchemaBatch(t){t.data&&P.dispatch(sn(t.data))}static handleSystemMessage(t){}}class ui{ws=null;config;callbacks;state=W.DISCONNECTED;reconnectAttempts=0;reconnectTimer=null;requestId=0;pendingRequests=new Map;constructor(t={},r={}){this.config={url:this.buildWebSocketUrl(t.url),reconnectInterval:t.reconnectInterval??3e3,maxReconnectAttempts:t.maxReconnectAttempts??10,requestTimeout:t.requestTimeout??1e4},this.callbacks=r}connect(){if(!(this.state===W.CONNECTED||this.state===W.CONNECTING)){this.setState(W.CONNECTING);try{this.ws=new WebSocket(this.config.url),this.attachEventHandlers()}catch(t){this.handleConnectionError(new vr("Failed to create WebSocket",t))}}}disconnect(){this.clearReconnectTimer(),this.clearPendingRequests(),this.ws&&(this.ws.close(),this.ws=null),this.setState(W.DISCONNECTED),P.dispatch(dt(!1))}send(t){if(!this.isConnected())throw new Z("WebSocket is not connected","NOT_CONNECTED");try{this.ws.send(JSON.stringify(t))}catch(r){throw new Sr("Failed to send message",r)}}async sendRequest(t){if(!this.isConnected())throw new Z("WebSocket is not connected","NOT_CONNECTED");return new Promise((r,n)=>{const o=++this.requestId,s={...t,requestId:o},i=setTimeout(()=>{this.pendingRequests.delete(o),n(new ci(o))},this.config.requestTimeout);this.pendingRequests.set(o,{resolve:r,reject:n,timer:i});try{this.ws.send(JSON.stringify(s))}catch(c){this.pendingRequests.delete(o),clearTimeout(i),n(new Sr("Failed to send request",c))}})}isConnected(){return this.ws?.readyState===WebSocket.OPEN}getState(){return this.state}async getConfig(t){return this.sendRequest({type:"config:get",pluginName:t})}async setConfig(t,r){await this.sendRequest({type:"config:set",pluginName:t,data:r})}async getSchema(t){return this.sendRequest({type:"schema:get",pluginName:t})}async getAllConfigs(){return this.sendRequest({type:"config:get-all"})}async getAllSchemas(){return this.sendRequest({type:"schema:get-all"})}buildWebSocketUrl(t){if(t)return t;const r=window.location.protocol==="https:"?"wss:":"ws:",n=window.location.host;return`${r}//${n}/server`}setState(t){const r=this.state;this.state=t,console.log(`[WebSocket] State changed: ${r} -> ${t}`)}attachEventHandlers(){this.ws&&(this.ws.onopen=()=>{this.handleConnectionOpen()},this.ws.onmessage=t=>{this.handleMessage(t)},this.ws.onclose=t=>{this.handleConnectionClose(t)},this.ws.onerror=t=>{this.handleConnectionError(new vr("WebSocket error",t))})}handleConnectionOpen(){this.setState(W.CONNECTED),this.reconnectAttempts=0,P.dispatch(dt(!0)),this.initializeData(),this.callbacks.onConnect?.()}handleMessage(t){try{const r=JSON.parse(t.data);if(r.requestId&&this.pendingRequests.has(r.requestId)){this.handleRequestResponse(r);return}li.handle(r),this.callbacks.onMessage?.(r)}catch(r){console.error("[WebSocket] Message parsing error:",r)}}handleRequestResponse(t){const{requestId:r}=t,n=this.pendingRequests.get(r);n&&(this.pendingRequests.delete(r),clearTimeout(n.timer),t.error?n.reject(new Z(t.error,"SERVER_ERROR")):n.resolve(t.data))}handleConnectionClose(t){this.ws=null,P.dispatch(dt(!1)),this.state!==W.DISCONNECTED&&(this.setState(W.RECONNECTING),this.callbacks.onDisconnect?.(),this.scheduleReconnect())}handleConnectionError(t){this.setState(W.ERROR),console.error("[WebSocket] Connection error:",t),this.callbacks.onError?.(t)}scheduleReconnect(){if(this.reconnectAttempts>=this.config.maxReconnectAttempts){console.error("[WebSocket] Max reconnect attempts reached"),this.setState(W.ERROR);return}this.reconnectAttempts++;const t=this.config.reconnectInterval*this.reconnectAttempts;console.log(`[WebSocket] Reconnecting in ${t}ms (attempt ${this.reconnectAttempts}/${this.config.maxReconnectAttempts})`),this.reconnectTimer=setTimeout(()=>{this.state===W.RECONNECTING&&this.connect()},t)}clearReconnectTimer(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}clearPendingRequests(){for(const[t,{reject:r,timer:n}]of this.pendingRequests)clearTimeout(n),r(new Z("Connection closed","CONNECTION_CLOSED"));this.pendingRequests.clear()}async initializeData(){try{const[t,r]=await Promise.all([this.getAllConfigs().catch(n=>(console.warn("[WebSocket] Failed to load configs:",n),{})),this.getAllSchemas().catch(n=>(console.warn("[WebSocket] Failed to load schemas:",n),{}))]);P.dispatch(on(t)),P.dispatch(sn(r))}catch(t){console.error("[WebSocket] Data initialization failed:",t)}}}let ee=null;function we(){return ee||(ee=new ui,typeof window<"u"&&ee.connect()),ee}function di(){ee&&(ee.disconnect(),ee=null)}function Mi(){di()}function zi(e={}){const{autoConnect:t=!0}=e,r=we(),n=F(qt),o=F(m=>m.script?.entries||[]),s=F(m=>m.script?.loadedScripts||[]),i=L(()=>{r.connect()},[r]),c=L(()=>{r.disconnect()},[r]),a=L(m=>{r.send(m)},[r]),l=L(async m=>r.sendRequest(m),[r]),u=L(()=>r.isConnected(),[r]),d=L(()=>r.isConnected()?"connected":"disconnected",[r]);return he(()=>{t&&!n&&i()},[t,n,i]),{connected:n,entries:o,loadedScripts:s,connect:i,disconnect:c,send:a,sendRequest:l,isConnected:u,getState:d,manager:r}}function Ni(e,t={}){const{autoLoad:r=!0,autoLoadSchema:n=!0}=t,o=ai(),s=we(),i=F(g=>Ls(g,e)),c=F(g=>qs(g,e)),a=F(g=>Us(g,e)),l=F(g=>$s(g,e)),u=F(qt),d=L(async()=>{o(Te({pluginName:e,loading:!0})),o(fe({pluginName:e,error:null}));try{return await s.getConfig(e)}catch(g){console.log("getConfig",g);const v=g instanceof Error?g.message:"Unknown error";throw o(fe({pluginName:e,error:v})),g}finally{o(Te({pluginName:e,loading:!1}))}},[e,s,o]),m=L(async g=>{o(Te({pluginName:e,loading:!0})),o(fe({pluginName:e,error:null}));try{await s.setConfig(e,g)}catch(v){console.log("setConfig",v);const E=v instanceof Error?v.message:"Unknown error";throw o(fe({pluginName:e,error:E})),v}finally{o(Te({pluginName:e,loading:!1}))}},[e,s,o]),y=L(async()=>{try{return await s.getSchema(e)}catch(g){throw console.error(`Failed to get schema for plugin ${e}:`,g),g}},[e,s]),x=L(async()=>{const g=[];r&&g.push(d()),n&&g.push(y()),await Promise.all(g)},[r,n,d,y]);return he(()=>{u&&r&&!i&&!a&&d().catch(console.error)},[u,r,i,a,d]),he(()=>{u&&n&&!c&&y().catch(console.error)},[u,n,c,y]),Ct(()=>({config:i,schema:c,loading:a,error:l,connected:u,getConfig:d,setConfig:m,getSchema:y,reload:x}),[i,c,a,l,u,d,m,y,x])}function Di(){const e=we(),t=F(Gs),r=F(Bs),n=F(qt),o=L(async()=>{try{const[s,i]=await Promise.all([e.getAllConfigs(),e.getAllSchemas()]);return{configs:s,schemas:i}}catch(s){throw console.error("Failed to refresh all configs:",s),s}},[e]);return Ct(()=>({configs:t,schemas:r,connected:n,refreshAll:o}),[t,r,n,o])}function ji(){const e=we(),[t,r]=kr(e.getState());return he(()=>{const o=setInterval(()=>{const s=e.getState();s!==t&&r(s)},1e3);return()=>clearInterval(o)},[e,t]),t}function Wi(e,t){const[r,n]=kr([]);return he(()=>{we()},[e,t]),r}function Fi(...e){return ro(hn(e))}export{vr as ConnectionError,W as ConnectionState,Ii as DynamicRouter,Ui as Link,Sr as MessageError,li as MessageHandler,$i as Outlet,ci as RequestTimeoutError,Z as WebSocketError,ui as WebSocketManager,vi as addEntry,Ei as addPage,Ci as addReducer,Ps as addRoute,_i as clearConfigs,Ti as clearPages,Is as clearRoutes,Fi as cn,di as destroyWebSocketManager,Ai as getAllPages,Pi as getPage,we as getWebSocketManager,Lt as loadScript,en as loadScripts,xi as persistor,ki as removeConfig,Si as removeEntry,Ri as removePage,As as removeRoute,Mi as resetWebSocketManager,Gs as selectAllConfigs,Bs as selectAllSchemas,Ls as selectConfig,qt as selectConfigConnected,$s as selectConfigError,Us as selectConfigLoading,qs as selectSchema,yi as setActiveMenu,dt as setConnected,fe as setError,Te as setLoading,bi as setRoutes,gi as setSidebarOpen,P as store,wi as syncEntries,mi as toggleSidebar,tn as unloadScript,js as updateConfig,on as updateConfigs,Oi as updatePage,Ts as updateRoute,Ws as updateSchema,sn as updateSchemas,Di as useAllConfigs,Ni as useConfig,Ni as useConfigLegacy,ai as useDispatch,Gi as useNavigate,Bi as useOutlet,Vi as useParams,F as useSelector,zi as useWebSocket,Wi as useWebSocketMessages,ji as useWebSocketState};
|