@ttmg/cli 0.3.9 → 0.4.0-beta.1

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.
Files changed (67) hide show
  1. package/dist/index.js +416 -81
  2. package/dist/index.js.map +1 -1
  3. package/dist/package.json +1 -1
  4. package/dist/public/assets/{Card-DvUkoCA3.js → Card-C35olIke.js} +1 -1
  5. package/dist/public/assets/Detail-Bw_dl9hw.js +1 -0
  6. package/dist/public/assets/Detail-Bw_dl9hw.js.br +0 -0
  7. package/dist/public/assets/MonetizationMode-C7Wyv9Mg.js +1 -0
  8. package/dist/public/assets/{MonetizationModeSummary--L4WcmYS.js → MonetizationModeSummary-D-zuX05a.js} +1 -1
  9. package/dist/public/assets/{SectionHeader-DfBBWmpa.js → SectionHeader-DRXnax7L.js} +1 -1
  10. package/dist/public/assets/{Tag-DuP9fCS0.js → Tag-CgPHrk93.js} +1 -1
  11. package/dist/public/assets/{arrow-left-1V5G0Kw7.js → arrow-left-CNdHGsDz.js} +1 -1
  12. package/dist/public/assets/{baseForm-2J62W6xr.js → baseForm-C2Ms-wqt.js} +1 -1
  13. package/dist/public/assets/baseForm-C2Ms-wqt.js.br +0 -0
  14. package/dist/public/assets/{chevron-right-C5K8xBff.js → chevron-right-CX-Bo3I2.js} +1 -1
  15. package/dist/public/assets/{compass-DZKQ36UU.js → compass-BUqxZo39.js} +1 -1
  16. package/dist/public/assets/{index-B13yZ-GH.js → index-8z6tNstf.js} +1 -1
  17. package/dist/public/assets/index-AGEFeR2m.js +1 -0
  18. package/dist/public/assets/{index-B-k2MmlV.js → index-B8dmfh3A.js} +1 -1
  19. package/dist/public/assets/{index-Br2fR8kJ.js → index-B9C7FZes.js} +1 -1
  20. package/dist/public/assets/{index-DYxQAjNc.js → index-BULJJdeE.js} +1 -1
  21. package/dist/public/assets/index-BULJJdeE.js.br +0 -0
  22. package/dist/public/assets/index-B_iiHvzl.js +1 -0
  23. package/dist/public/assets/index-B_iiHvzl.js.br +0 -0
  24. package/dist/public/assets/{index-fS7DhM40.js → index-BmmpJdOy.js} +1 -1
  25. package/dist/public/assets/index-BmmpJdOy.js.br +0 -0
  26. package/dist/public/assets/{index-DqoKSlOn.js → index-BuGJ38RF.js} +1 -1
  27. package/dist/public/assets/{index-CmVUh50W.css → index-ByX5RuFA.css} +1 -1
  28. package/dist/public/assets/{index-CgTtqphq.js → index-ByqGLZ4G.js} +1 -1
  29. package/dist/public/assets/{index-Bmw61rl1.css → index-CFd8iglC.css} +1 -1
  30. package/dist/public/assets/index-CFd8iglC.css.br +0 -0
  31. package/dist/public/assets/{index-CwYCdibK.js → index-CIIptoBi.js} +1 -1
  32. package/dist/public/assets/{index-BWWe1lsP.js → index-CLXkCzG6.js} +1 -1
  33. package/dist/public/assets/{index-WZnCtUAc.js → index-CUV27PJL.js} +1 -1
  34. package/dist/public/assets/{index-BttcxiCg.js → index-CxeatYOZ.js} +1 -1
  35. package/dist/public/assets/{index-BdDJLxXD.js → index-D0DgrJ_K.js} +1 -1
  36. package/dist/public/assets/{index-BaZPp3HP.js → index-D28D1GWM.js} +1 -1
  37. package/dist/public/assets/index-DCZsvwKh.js +1 -0
  38. package/dist/public/assets/index-Dd2rc2_1.js +1 -0
  39. package/dist/public/assets/index-Dd2rc2_1.js.br +0 -0
  40. package/dist/public/assets/index-Dk9_4hQ4.js +1 -0
  41. package/dist/public/assets/{index-DNktXE2W.js → index-EorOvXWq.js} +1 -1
  42. package/dist/public/assets/{index-B-AeuNlL.css → index-_6n0s04V.css} +1 -1
  43. package/dist/public/assets/index-_6n0s04V.css.br +0 -0
  44. package/dist/public/assets/{index-CnReCFYA.js → index-cC0QApVl.js} +8 -8
  45. package/dist/public/assets/index-cC0QApVl.js.br +0 -0
  46. package/dist/public/assets/{index-CZ7VVYfd.js → index-l16xoaSk.js} +1 -1
  47. package/dist/public/assets/{sparkles-tr6K1Npg.js → sparkles-C54nzN2M.js} +1 -1
  48. package/dist/public/assets/{zap-CuMRVa_B.js → zap-g-acVHwy.js} +1 -1
  49. package/dist/public/index.html +1 -1
  50. package/package.json +1 -1
  51. package/CHANGELOG.md +0 -241
  52. package/dist/public/assets/Detail-Cbq9dDUe.js +0 -1
  53. package/dist/public/assets/Detail-Cbq9dDUe.js.br +0 -0
  54. package/dist/public/assets/MonetizationMode-0taoFj2g.js +0 -1
  55. package/dist/public/assets/baseForm-2J62W6xr.js.br +0 -0
  56. package/dist/public/assets/index-B-AeuNlL.css.br +0 -0
  57. package/dist/public/assets/index-Bmw61rl1.css.br +0 -0
  58. package/dist/public/assets/index-CcxOfQrE.js +0 -1
  59. package/dist/public/assets/index-CcxOfQrE.js.br +0 -0
  60. package/dist/public/assets/index-CnReCFYA.js.br +0 -0
  61. package/dist/public/assets/index-DYxQAjNc.js.br +0 -0
  62. package/dist/public/assets/index-YkO-JjYA.js +0 -1
  63. package/dist/public/assets/index-cPr70sDS.js +0 -1
  64. package/dist/public/assets/index-fS7DhM40.js.br +0 -0
  65. package/dist/public/assets/index-qHht7NSU.js +0 -1
  66. package/dist/public/assets/index-qHht7NSU.js.br +0 -0
  67. /package/dist/public/assets/{index-B6NHbQwP.js → index-CjInIkcE.js} +0 -0
@@ -1 +1 @@
1
- import{c as o,u as c,i as r,j as e,P as n}from"./index-CnReCFYA.js";import{C as t}from"./Card-DvUkoCA3.js";import{T as p}from"./Tag-DuP9fCS0.js";import{Z as m}from"./zap-CuMRVa_B.js";import{C as h}from"./chevron-right-C5K8xBff.js";const f=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],x=o("boxes",f),u=()=>{const l=c(),i=[{key:"wasm_split",title:r("performance.card.wasmSplit.title"),description:r("performance.card.wasmSplit.desc"),icon:m,path:"/wasm_split",tags:[{label:"Unity",tone:"info"},{label:"Wasm",tone:"neutral"}]}];return e.jsxs("div",{className:"perf-page",children:[e.jsx(n,{title:r("performance.overview.title"),subtitle:r("performance.overview.desc")}),e.jsx("section",{className:"perf-section",children:e.jsxs("div",{className:"perf-tool-grid",children:[i.map(a=>{const d=a.icon;return e.jsxs(t,{interactive:!0,padding:"md",className:"perf-tool-card",onClick:()=>l(a.path),role:"button",tabIndex:0,children:[e.jsxs("div",{className:"perf-tool-card-head",children:[e.jsx("span",{className:"perf-tool-card-glyph","aria-hidden":"true",children:e.jsx(d,{size:18,strokeWidth:1.75})}),e.jsx("div",{className:"perf-tool-card-titlewrap",children:e.jsxs("div",{className:"perf-tool-card-title-row",children:[e.jsx("h3",{className:"perf-tool-card-title",children:a.title}),a.tags.map(s=>e.jsx(p,{tone:s.tone??"neutral",size:"sm",variant:"outline",children:s.label},s.label))]})}),e.jsx("span",{className:"perf-tool-card-chevron","aria-hidden":"true",children:e.jsx(h,{size:16,strokeWidth:2})})]}),e.jsx("p",{className:"perf-tool-card-desc",children:a.description})]},a.key)}),e.jsx(t,{padding:"md",className:"perf-tool-card perf-tool-card-placeholder",children:e.jsxs("div",{className:"perf-tool-card-head",children:[e.jsx("span",{className:"perf-tool-card-glyph perf-tool-card-glyph-muted","aria-hidden":"true",children:e.jsx(x,{size:18,strokeWidth:1.75})}),e.jsx("div",{className:"perf-tool-card-titlewrap",children:e.jsx("div",{className:"perf-tool-card-title-row",children:e.jsx("h3",{className:"perf-tool-card-title perf-tool-card-title-muted",children:r("performance.empty.comingSoon")})})})]})})]})})]})};export{u as Performance};
1
+ import{c as o,u as c,i as r,j as e,P as n}from"./index-cC0QApVl.js";import{C as t}from"./Card-C35olIke.js";import{T as p}from"./Tag-CgPHrk93.js";import{Z as m}from"./zap-g-acVHwy.js";import{C as h}from"./chevron-right-CX-Bo3I2.js";const f=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],x=o("boxes",f),u=()=>{const l=c(),i=[{key:"wasm_split",title:r("performance.card.wasmSplit.title"),description:r("performance.card.wasmSplit.desc"),icon:m,path:"/wasm_split",tags:[{label:"Unity",tone:"info"},{label:"Wasm",tone:"neutral"}]}];return e.jsxs("div",{className:"perf-page",children:[e.jsx(n,{title:r("performance.overview.title"),subtitle:r("performance.overview.desc")}),e.jsx("section",{className:"perf-section",children:e.jsxs("div",{className:"perf-tool-grid",children:[i.map(a=>{const d=a.icon;return e.jsxs(t,{interactive:!0,padding:"md",className:"perf-tool-card",onClick:()=>l(a.path),role:"button",tabIndex:0,children:[e.jsxs("div",{className:"perf-tool-card-head",children:[e.jsx("span",{className:"perf-tool-card-glyph","aria-hidden":"true",children:e.jsx(d,{size:18,strokeWidth:1.75})}),e.jsx("div",{className:"perf-tool-card-titlewrap",children:e.jsxs("div",{className:"perf-tool-card-title-row",children:[e.jsx("h3",{className:"perf-tool-card-title",children:a.title}),a.tags.map(s=>e.jsx(p,{tone:s.tone??"neutral",size:"sm",variant:"outline",children:s.label},s.label))]})}),e.jsx("span",{className:"perf-tool-card-chevron","aria-hidden":"true",children:e.jsx(h,{size:16,strokeWidth:2})})]}),e.jsx("p",{className:"perf-tool-card-desc",children:a.description})]},a.key)}),e.jsx(t,{padding:"md",className:"perf-tool-card perf-tool-card-placeholder",children:e.jsxs("div",{className:"perf-tool-card-head",children:[e.jsx("span",{className:"perf-tool-card-glyph perf-tool-card-glyph-muted","aria-hidden":"true",children:e.jsx(x,{size:18,strokeWidth:1.75})}),e.jsx("div",{className:"perf-tool-card-titlewrap",children:e.jsx("div",{className:"perf-tool-card-title-row",children:e.jsx("h3",{className:"perf-tool-card-title perf-tool-card-title-muted",children:r("performance.empty.comingSoon")})})})]})})]})})]})};export{u as Performance};
@@ -1 +1 @@
1
- import{c as a}from"./index-CnReCFYA.js";const e=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],l=a("sparkles",e);export{l as S};
1
+ import{c as a}from"./index-cC0QApVl.js";const e=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],l=a("sparkles",e);export{l as S};
@@ -1 +1 @@
1
- import{c as a}from"./index-CnReCFYA.js";const o=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],e=a("zap",o);export{e as Z};
1
+ import{c as a}from"./index-cC0QApVl.js";const o=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],e=a("zap",o);export{e as Z};
@@ -12,7 +12,7 @@
12
12
  rel="stylesheet"
13
13
  />
14
14
  <title>TikTok Mini Games DevTool</title>
15
- <script type="module" crossorigin src="/assets/index-CnReCFYA.js"></script>
15
+ <script type="module" crossorigin src="/assets/index-cC0QApVl.js"></script>
16
16
  <link rel="stylesheet" crossorigin href="/assets/index-ROKxx4f7.css">
17
17
  </head>
18
18
  <!--
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttmg/cli",
3
- "version": "0.3.9",
3
+ "version": "0.4.0-beta.1",
4
4
  "description": "TikTok Mini Game Command Line Tool",
5
5
  "license": "ISC",
6
6
  "bin": {
package/CHANGELOG.md DELETED
@@ -1,241 +0,0 @@
1
- ## 0.1.0
2
-
3
- 发布正式版本,支持 H5 小游戏和原生小游戏的初始化、开发调试和打包构建。支持 Windows 系统
4
-
5
- ## 0.1.0-beta.1
6
-
7
- 移除 Client WS 端口和 Http 端口默认 -1 的配置,变成通过和 Node CLI 通信显示发端口
8
-
9
- ## 0.1.0-beta.8
10
-
11
- 支持自动打开浏览器,且聚焦在 devTools 窗口
12
-
13
- ## 0.1.0-beta.9
14
-
15
- 1. 支持文件上传进度显示
16
- 2. 支持自动打开浏览器调试模式
17
-
18
- ## 0.1.0-beta.10
19
-
20
- fix: 修复还未完成新编译就直接上传了的问题
21
-
22
- ## 0.1.0-beta.11
23
-
24
- feat: 先关闭自动上传能力
25
-
26
- ## 0.1.0-beta.12
27
-
28
- feat: 支持文件变更监听,告知浏览器文件变更,提醒开发者重新加载游戏
29
-
30
- ## 0.1.0-beta.13
31
-
32
- 1. 支持 sourcemap
33
- 2. 优化上传环节产物,过滤 sourcemap 文件,提高上传效率
34
-
35
- ## 0.1.0-beta.14
36
-
37
- 1. 修复 client key 未成功写入 mock meta 的问题,导致不一致
38
-
39
- ## 0.1.0-beta.15
40
-
41
- 1. 还原 open url 历史方法
42
-
43
- ## 0.1.1
44
-
45
- 发布最新版本,提醒开发者升级最新版本
46
-
47
- ## 0.1.2
48
-
49
- 发布最新版本,支持 sourcemap
50
-
51
- ## 0.1.3-beta.1
52
-
53
- 优化显示二维码问题
54
-
55
- ## 0.1.3-beta.2
56
-
57
- 彻底修复二维码兼容问题
58
-
59
- ## 0.1.3-beta.3
60
-
61
- 修复 sourcemap 错乱问题
62
-
63
- ## 0.1.3-beta.4
64
-
65
- 修复循环依赖问题
66
-
67
- ## 0.1.3-beta.5
68
-
69
- 修复监听文件变化报错问题
70
-
71
- ## 0.1.3
72
-
73
- 发布优化版本 CLI
74
-
75
- ## 0.1.4
76
-
77
- 优化页面交互
78
-
79
- ## 0.1.5
80
-
81
- 1.fix: 控制台报错问题 2. feat: 优化
82
-
83
- ## 0.1.6
84
-
85
- 1. 优化控制台报错日志
86
- 2. 优化调试启动环节耗时
87
-
88
- ## 0.1.7
89
-
90
- - 修复 Windows 调试资源加载失败问题
91
-
92
- ## 0.1.8
93
-
94
- 优化 DevTool 网页端启动时间
95
-
96
- ## 0.1.9-beta.1
97
-
98
- 发布测试版本,供客户端调试使用
99
-
100
- ## 0.1.9-beta.2
101
-
102
- 发布测试版本,用于 Windows 测试
103
-
104
- ## 0.1.9
105
-
106
- 发布正式版本,支持
107
-
108
- - login
109
- - 支持上传游戏包
110
- - 支持启动模式
111
- - 支持 Debug Settings
112
-
113
- ## 0.2.0-beta.1
114
-
115
- 发布测试版本,用于 Windows 测试 login 登录异常逻辑
116
-
117
- ## 0.2.0
118
-
119
- 发布正式版本,支持 Windows 登录加载报错提示
120
-
121
- ## 0.2.1
122
-
123
- 1. 移除项目详情部分,比较冗余,不常用,融合到代码预检中
124
- 2. 打开调试页面地址增加 version 参数,来规避新老版本缓存问题和不同网页之间的隔离(未来支持)
125
- 3. 优化登录失败提示,增加网络检查提示,并给出如何修改网络设置的文档链接
126
- 4. 补充发送 meta 至客户端链路,增加调试链路日志信息,便于排查问题
127
-
128
- ## 0.2.2
129
-
130
- 1. 修复访问无权限的小游戏,顶部报错问题
131
-
132
- ## 0.2.3
133
-
134
- 优化扫码连接不上问题,支持手动绑定电脑本地 IP 地址
135
-
136
- ## 0.2.4
137
-
138
- 支持新的 DevTool 平台
139
-
140
- ## 0.2.5
141
-
142
- 1. 增加不在游戏根目录启动调试校验
143
- 2. 支持手动绑定客户端 IP 地址和端口
144
- 3. 调整启动模式中的场景列表表达文案
145
- 4. 修复文件上传问题,避免偶现上传失败
146
- 5. 支持展示游戏详情模块,支持开发者查看当前小游戏基本信息
147
- 6. 支持调试环节消费平台配置的域名
148
- 7. 升级 ttmg-pack 0.1.7,修复构建环节对开发者 JS 代码降级的问题
149
- 8. 文档新增常见问题部分,替换原有的开发文档
150
-
151
- ## 0.2.6
152
-
153
- 修复启动模式中场景列表展示问题,重复展示默认启动模式
154
-
155
- ## 0.2.7
156
- 1. 升级 ttmg-pack 0.2.3,调整 esbuild 配置,目标 es2020
157
- 2. 支持校验子包配置文件名是否符合规范,对于非法文件名,提示开发者修改
158
- 3. 调整域名校验默认逻辑,默认开启,校验失败时,提示开发者修改
159
-
160
- ## 0.2.8
161
- 1. 升级 ttmg-pack 0.2.4,修复 open data context 文件丢失问题
162
-
163
- ## 0.2.9
164
- 1. 升级 ttmg-pack 0.2.5,修复 open data context 打包问题
165
- ## 0.3.0
166
- 新增/优化功能适用 TikTok 版本 iOS >=43.1 | Android>=43.1
167
- 支持了开发信息蒙层,打开后可以查看游戏 FPS、设备信息、调试开关等信息,便于查看游戏运行状态 了解如何使用
168
- 支持删除历史启动模式,便于管理历史启动模式
169
- 调整调试设置模块名称为开发选项,和客户端内调开发者选项保持一致 了解如何使用
170
- 调试设置新增定义 vConsole 和 开发信息浮层设置
171
- 支持了变更日志,用户可以在调试环境下查看游戏的变更记录,部分新功能可通过更多信息查看使用
172
- 支持了调试设置开关本地缓存,避免每次都需要重新设置
173
- 修复上传名称为中文的游戏时,平台展示乱码的问题
174
- 修复启动模式模块,自定义query 参数无法持久化的问题
175
- 修复扫描二维码模块,内容过多,纵向无法滚动问题
176
-
177
- ## 0.3.1
178
- - 支持 unity 小游戏本地一些列调试功能,如 Wasm 分包、包大小校验、一键上传代码包至平台等 了解如何使用
179
- - 增加用户登录过期的异常提示,提醒开发者重新登录
180
- - 优化上传代码包至平台功能,开发者只用添加描述后点击上传便可自动压缩当前目录下的代码包上传至开发者平台
181
- - 优化 ttmg login 终端网络代理异常导致无法登录的报错引导,提示用户检查网络设置
182
-
183
- ## 0.3.2-beta.1
184
- 支持 cocos 2.0 openDataContext 相关适配
185
-
186
- ## 0.3.2
187
- - 小游戏详情查询升级到 TikTok DevPortal v4 `devtool/info` 接口,字段映射更完整
188
- - 支持一键打包当前目录并上传代码包到开发者平台;上传失败提示更明确,文件名非法字符自动处理
189
- - Unity Wasm 分包:更新 `game.json` 子包配置写入逻辑(兼容 `subpackages`/`subPackages` 字段),Android/iOS main/sub 配置去重合并
190
- - 启动校验增强:检查是否在小游戏根目录执行,并提示 `subPackages` 拼写错误
191
- 增加对 unity 是否需要分包的检查,对于需要分包的 unity 项目,给出明确提示
192
- 支持通过 `ttmg setup` 配置 CLI 语言,调试环境会跟随语言设置展示文案,首次调试时会自动同步默认语言,后续 CLI 与 IDE 语言保持一致,减少反复切换
193
- 调试与预检支持多语言展示,关键提示与校验信息更易理解
194
- 支持 Cocos 2.0 openDataContext 配置
195
- 变更记录新增提醒功能,当有新版本发布时,会通过弹窗提醒开发者更新
196
- ttmg login 支持 ttmg login --verbose 参数,打印更多登录信息
197
- API 预检建议文案统一收敛,避免重复提示,阅读更清晰
198
- 顶部区域透出项目预检错误与警告信息,便于开发者及时发现问题并修复
199
- 语言选择策略优化:优先使用 CLI 本地设置,未设置时自动回退浏览器语言
200
- 启动校验增强:检查是否在小游戏根目录执行,对于分包配置 subPackages 给出明确报错,引导开发者修改为 subpackages
201
- 修复项目详情中展示的主包大小限制和代码预检不一致的情况
202
-
203
- ## 0.3.3
204
- 升级 ttmg-pack 到 0.4.5,解决安卓无法调试 unity 项目问题
205
-
206
- ## 0.3.4
207
- 优化校验逻辑,给出提示
208
-
209
- ## 0.3.5
210
- 优化连接和代理,帮助开发者自助解决问题
211
-
212
- ## 0.3.6
213
- 修复分包过程超时问题
214
-
215
- ## 0.3.7
216
- 新增/优化功能适用 TikTok 版本 iOS >=43.1 | Android >=43.1
217
-
218
- 1. 新增能力接入助手,帮助开发者基于小游戏变现类型获取关键能力的接入引导。
219
- 2. 优化上传发布环节,将代码预检与代码上传整合为完整的上传发布流程。
220
- 3. 扩充包体大小预检说明,补充整包、主包、独立分包限制规则与详细文档入口,便于开发者理解和处理包体超限问题。
221
-
222
- ## 0.3.8
223
- 修复 `ttmg login` 后接口鉴权异常的问题:
224
-
225
- 1. 登录时把 `Set-Cookie` 响应头中的 `Path / Domain / Max-Age / Expires / Secure / HttpOnly / SameSite` 等属性被当成 cookie 拼接到 `Cookie` 字段,导致 CLI 发请求时把属性当成"假 cookie"一并带上。
226
- 2. 同一域名下同名 cookie(例如服务端用 `Max-Age=0` 显式删除的占位 cookie)也会被一起发送,污染掉真正有效的同名 cookie,浏览器会自动过滤这种情况,CLI 不会,造成登录态接口异常。
227
- 3. 修复后与浏览器行为保持一致:剥离 cookie 属性、过滤 `Max-Age<=0` 或 `Expires` 已过期的 cookie,仅保留 `name=value` 用于请求。
228
- 4. 已登录用户无需重新登录,下次发起请求时会自动清洗 rc 中已存的脏数据。
229
-
230
- ## 0.3.9
231
- 本次主要优化调试 IDE 的视觉、交互与多语言一致性:
232
-
233
- 1. 调试 IDE 默认使用浅色主题,暗色模式改为开发者手动开启并记忆选择,避免跟随系统强制进入暗色导致不适应。
234
- 2. 优化暗色模式下二维码显示,调整背景避免过亮刺眼,同时保证扫码识别率。
235
- 3. Wasm 分包页面及相关组件补齐多语言,修复此前页面文案中英文混排的问题。
236
- 4. 能力接入助手页面视觉升级:变现模式卡片新增图标与强调色,关键能力标签按「必需 / 可选 / 实验」分级展示,信息层级更清晰。
237
- 5. 完成扫码连接后,首页标题与说明文案会切换为「已连接」状态,状态反馈更明确。
238
- 6. 新版本提示由红点改为「有更新」文字标签,含义更直观。
239
- 7. 上传游戏包按钮配色与产品主题色统一。
240
- 8. 修复多个页面中标题与正文内容未对齐的问题,整体排版更整齐。
241
- 9. 文案细节调整:「身份与授权」更名为「登录与授权」;移除侧边栏冗余的「查看文档」入口。
@@ -1 +0,0 @@
1
- import{c as be,e as U,u as ce,d as Ce,r as c,i as a,j as e,s as Ge,F as qe,T as l,K as re,b as E,B as O,f as Ue,G as _e,Q as Qe,N as Se,M as Be,P as Ye}from"./index-CnReCFYA.js";import{E as ze}from"./index-B13yZ-GH.js";import{S as te}from"./SectionHeader-DfBBWmpa.js";import{C as H}from"./Card-DvUkoCA3.js";import{T as He}from"./Tag-DuP9fCS0.js";import{F as I}from"./baseForm-2J62W6xr.js";import{c as We}from"./index-B6NHbQwP.js";import{A as Je}from"./arrow-left-1V5G0Kw7.js";import{S as Xe}from"./sparkles-tr6K1Npg.js";import"./index-CcxOfQrE.js";const Ze=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],ea=be("book-open",Ze);const aa=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],ta=be("list-checks",aa);function sa(t={}){return U({url:"/game/direct-feed-card/list",method:"POST",data:t})}function ia(t={}){return U({url:"/game/direct-feed-card/scenarios",method:"POST",data:t})}function ra(t){return U({url:"/game/direct-feed-card/create",method:"POST",data:t})}function na(t){return U({url:"/game/direct-feed-card/asset-preview",method:"POST",data:t})}function ca(t={}){return U({url:"/game/assets",method:"POST",data:t})}const da="fyf_promotion_direct_feed_play",ve="direct-play-debug",se="__create_direct_play_card__",ne="recover_stamina_dynamic",la=2,G=String(la),oa={cardName:"",cardDesc:"",cardType:G,scenario:ne,subPkg:"__GAME__",params:""};function w(t,n){if(typeof t=="string"&&t.trim())return t;if(t&&typeof t=="object"){const i=t;if(i.errorMsg)return i.errorMsg;if(i.StatusMessage)return i.StatusMessage;if(i.message)return i.message}return n}function ua(t){return t?t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/1024/1024).toFixed(2)} MB`:"-"}function pa(t){return t?new Date(t*1e3).toLocaleString():"-"}function ga(t){return t==="preview"?a("ia.directPlay.stage2.assetGroup.preview"):t==="live"?a("ia.directPlay.stage2.assetGroup.live"):a("ia.directPlay.stage2.assetGroup.review")}function ma(t){return{...t||Se,scene:da}}function ya(t){return t.pkgType==="independent"?t.independentPkg||t.pkgName||a("independentPackage"):a("gameMainPackage")}function ie(t){return!t||t==="__GAME__"?a("gameMainPackage"):t}function Te(t){const n=String(t||"").trim();return n?n==="reward_issue_static"||n==="reward_issue_dynamic"?a("ia.directPlay.stage2.create.scenario.rewardIssue"):n==="recover_stamina_static"||n==="recover_stamina_dynamic"||n==="strength_recovery"?a("ia.directPlay.stage2.create.scenario.recoverStamina"):n==="unlock_level_static"||n==="unlock_level_dynamic"?a("ia.directPlay.stage2.create.scenario.unlockLevel"):n==="recall_scenario"?a("ia.directPlay.stage2.create.scenario.rewardIssue"):"":""}function q(t,n){if(!t)return"-";const i=Te(t);return i||(n?.[t]?n[t]:t)}function ha(t){const n=String(t||"").trim();if(n.endsWith("_static"))return 1;if(n.endsWith("_dynamic"))return 2}function Pe(t,n){const i=Number(n),p=t.cardType===void 0?ha(t.value):Number(t.cardType);return p===void 0||p===i}function Ne(t,n){const i=new Set;return t.filter(p=>{const f=q(p.value,n);return i.has(f)?!1:(i.add(f),!0)})}function xa(t){return t?Number(t.audit_status)===1?a("ia.directPlay.stage2.cardStatus.approved"):Number(t.audit_status)===0||Number(t.status)===0?a("ia.directPlay.stage2.cardStatus.pending"):"":""}function fa(t,n){const i=t?.direct_feed_card||{},p=String(t?.content_id||i.content_id||"").trim();return p?{audit_status:Number(i.audit_status??1),status:Number(i.status??1),content_id:p,card_name:String(i.card_name||n.cardName),card_desc:String(i.card_desc||n.cardDesc),card_type:Number(i.card_type??n.cardType),scenario:String(i.scenario||n.scenario),sub_pkg:String(i.sub_pkg||n.subPkg),params:String(i.params||n.params||""),priority:i.priority===void 0?void 0:Number(i.priority)}:null}function W(){return[{value:ne,label:q(ne)}]}const ja=()=>{const t=ce(),{state:{selectedLaunchOption:n,gameDetail:i,launchOptions:p,packages:f},setLaunchOptions:d,setSelectedLaunchOption:u}=Ce(),[b,Q]=c.useState([]),[C,M]=c.useState([]),[P,$]=c.useState("select"),[j,B]=c.useState(""),[D,de]=c.useState(""),[le,Y]=c.useState(""),[oe,ue]=c.useState(""),[pe,R]=c.useState(""),[ge,J]=c.useState(""),[me,X]=c.useState(""),[ke,ye]=c.useState(!0),[Ie,he]=c.useState(!1),[we,xe]=c.useState(!1),[fe,Z]=c.useState(G),[L,je]=c.useState(W),S=c.useRef(null),ee=c.useMemo(()=>ma(n),[n]),h=c.useMemo(()=>({appId:i?.app_id,clientKey:i?.client_key,miniGameId:i?.app_id}),[i?.app_id,i?.client_key]),T=c.useMemo(()=>b.find(s=>s.content_id===j)||null,[b,j]),A=c.useMemo(()=>C.find(s=>s.asset_id===D)||null,[C,D]),k=c.useMemo(()=>L.reduce((s,r)=>(r?.value&&(s[r.value]=Te(r.value)||(r.label&&r.label!==r.value?r.label:r.value)),s),{}),[L]),z=c.useMemo(()=>{const s=L.filter(o=>Pe(o,fe)),r=s.length>0?s:W();return Ne(r,k).map(o=>({...o,label:q(o.value,k)}))},[fe,k,L]),Ee=c.useMemo(()=>C.map(s=>({label:`${s.file_name||s.asset_id} · v${s.version||"-"}`,value:s.asset_id})),[C]),Me=c.useMemo(()=>[{label:a("ia.directPlay.stage2.create.option"),value:se},...b.map(s=>({label:`${s.card_name} · ${q(s.scenario,k)} · ${ie(s.sub_pkg)}`,value:s.content_id}))],[b,k]),De=c.useMemo(()=>[{label:a("ia.directPlay.stage2.create.cardType.fixed"),value:"1"},{label:a("ia.directPlay.stage2.create.cardType.dynamic"),value:"2"}],[]),Le=c.useMemo(()=>{const s=new Set(["__GAME__"]);return(f||[]).forEach(r=>{r?.type==="independent"&&r.name&&s.add(r.name)}),p.forEach(r=>{r.pkgType==="independent"&&r.independentPkg&&s.add(r.independentPkg)}),Array.from(s).map(r=>({label:ie(r),value:r}))},[p,f]),Ae=c.useMemo(()=>e.jsxs("span",{className:"integration-assistant-direct-play-label-with-info",children:[e.jsx("span",{children:a("ia.directPlay.stage2.create.cardType")}),e.jsx(Ge,{position:"top",trigger:"hover",showArrow:!0,content:e.jsxs("div",{className:"integration-assistant-direct-play-info-popover",children:[e.jsx(l.Text,{children:a("ia.directPlay.stage2.create.cardType.dynamicDesc")}),e.jsx(l.Text,{children:a("ia.directPlay.stage2.create.cardType.fixedDesc")})]}),children:e.jsx("span",{className:"integration-assistant-direct-play-info-icon","aria-label":"card type info",children:e.jsx(qe,{})})})]}),[]),Oe=c.useCallback(s=>{const r=String(s||G);Z(r);const o=L.filter(m=>Pe(m,r)),x=o.length>0?Ne(o,k):W(),y=x[0]?.value,_=S.current?.getValue?.("scenario"),N=x.some(m=>m.value===_);S.current?.setValue?.("cardType",r),y&&!N&&S.current?.setValue?.("scenario",y)},[k,L]),F=c.useCallback(async s=>{ye(!0),ue("");try{const[r,o,x]=await Promise.allSettled([sa({appId:h.appId,clientKey:h.clientKey}),ca({appId:h.appId,miniGameId:h.miniGameId,clientKey:h.clientKey}),ia({appId:h.appId,clientKey:h.clientKey})]),y=r.status==="fulfilled"?r.value:null,_=o.status==="fulfilled"?o.value:null,N=x.status==="fulfilled"?x.value:null;if(r.status==="rejected"||y?.error||y?.code!==0||!y?.data)throw new Error(w(y?.error,a("ia.directPlay.stage2.loadCardsFailed")));if(o.status==="rejected"||_?.error||_?.code!==0||!_?.data)throw new Error(w(_?.error,a("ia.directPlay.stage2.loadAssetsFailed")));const m=y.data.cards||[],V=(_.data.preview_assets||[]).map(g=>({...g,group:"preview"}));Q(m),M(V),N?.code===0&&N.data?.scenarios?.length?je(N.data.scenarios):je(g=>g.length>0?g:W()),B(g=>{if(s?.contentId&&m.some(v=>v.content_id===s.contentId))return s.contentId;if(s?.cardName){const v=m.find(ae=>ae.card_name===s.cardName);if(v?.content_id)return v.content_id}return g&&m.some(v=>v.content_id===g)?g:m[0]?.content_id||""}),de(g=>g&&V.some(v=>v.asset_id===g)?g:V[0]?.asset_id||"")}catch(r){ue(w(r,a("ia.directPlay.stage2.loadResourcesFailed")))}finally{ye(!1)}},[h.appId,h.clientKey,h.miniGameId]);c.useEffect(()=>{F()},[F]),c.useEffect(()=>{const s=z[0]?.value;if(!s)return;const r=S.current?.getValue?.("scenario");z.some(x=>x.value===r)||S.current?.setValue?.("scenario",s)},[z]);const Ke=c.useCallback(()=>{const s={...ee,id:ve,name:a("ia.directPlay.stage1.generatedModeName")},r=p.filter(y=>y.id!==ve),o=r.findIndex(y=>y.id==="created"),x=o>=0?[...r.slice(0,o),s,...r.slice(o)]:[...r,s];d(x),u(s),t("/")},[p,t,d,u,ee]),$e=c.useCallback(async()=>{try{const s=await S.current?.validate(),r=String(s?.cardName||"").trim(),o=String(s?.cardDesc||"").trim(),x=String(s?.scenario||"").trim(),y=String(s?.subPkg||"__GAME__").trim()||"__GAME__",_=String(s?.params||"").trim(),N=Number(s?.cardType||0);if(!r||!o||!x||!N)return;xe(!0),J(""),X("");const m=await ra({appId:h.appId,clientKey:h.clientKey,directFeedCard:{cardName:r,cardDesc:o,cardType:N,scenario:x,subPkg:y,params:_||void 0}});if(m?.error||m?.code!==0)throw new Error(w(m?.error,a("ia.directPlay.stage2.create.failed")));const V=String(m?.data?.content_id||m?.data?.direct_feed_card?.content_id||""),g=fa(m?.data,{cardName:r,cardDesc:o,cardType:N,scenario:x,subPkg:y,params:_});await F({contentId:V,cardName:r}),g&&(Q(v=>{const ae=v.filter(Ve=>Ve.content_id!==g.content_id);return[g,...ae]}),B(g.content_id)),$("select"),X(a("ia.directPlay.stage2.create.success")),R(""),Y(""),S.current?.reset?.(),Z(G)}catch(s){if(s?.name==="ValidateError")return;J(w(s,a("ia.directPlay.stage2.create.failed")))}finally{xe(!1)}},[F,h.appId,h.clientKey]),Re=c.useCallback(s=>{if(s===se){$("create"),B(""),R(""),Y("");return}$("select"),B(s||"")},[]),Fe=c.useCallback(async()=>{if(!j||!D){R(a("ia.directPlay.stage2.selectRequired"));return}he(!0),R("");try{const s=await na({assetId:D,contentId:j});if(s?.error||s?.code!==0||!s?.data?.preview_url)throw new Error(w(s?.error,a("ia.directPlay.stage2.previewFailed")));Y(s.data.preview_url)}catch(s){Y(""),R(w(s,a("ia.directPlay.stage2.previewFailed")))}finally{he(!1)}},[D,j]);return e.jsxs("div",{className:"integration-assistant-direct-play-grid",children:[e.jsxs(re,{className:"integration-assistant-direct-play-card",bordered:!0,children:[e.jsx("div",{className:"integration-assistant-section-head",children:e.jsxs("div",{children:[e.jsx(l.Title,{heading:5,children:a("ia.directPlay.stage1.title")}),e.jsx(l.Paragraph,{className:"integration-assistant-section-desc",children:a("ia.directPlay.stage1.desc")})]})}),e.jsxs("div",{className:"integration-assistant-direct-play-summary",children:[e.jsxs("div",{className:"integration-assistant-direct-play-row",children:[e.jsx(l.Text,{strong:!0,children:a("ia.directPlay.stage1.modeName")}),e.jsx(l.Text,{children:a("ia.directPlay.stage1.modeValue")})]}),e.jsxs("div",{className:"integration-assistant-direct-play-row",children:[e.jsx(l.Text,{strong:!0,children:a("ia.directPlay.stage1.scene")}),e.jsx(l.Text,{children:a("scene_fyf_promotion_direct_feed_play")})]}),e.jsxs("div",{className:"integration-assistant-direct-play-row",children:[e.jsx(l.Text,{strong:!0,children:a("ia.directPlay.stage1.package")}),e.jsx(l.Text,{children:ya(ee)})]})]}),e.jsx("div",{className:"integration-assistant-actions",children:e.jsx(E,{theme:"solid",onClick:Ke,children:a("ia.directPlay.stage1.createQr")})})]}),e.jsxs(re,{className:"integration-assistant-direct-play-card",bordered:!0,children:[e.jsx(O,{className:"integration-assistant-direct-play-banner integration-assistant-direct-play-banner-top",fullMode:!1,bordered:!1,closeIcon:null,type:"info",description:a("ia.directPlay.stage2.banner")}),e.jsx("div",{className:"integration-assistant-section-head",children:e.jsxs("div",{className:"integration-assistant-direct-play-stage-head",children:[e.jsx(l.Title,{heading:5,children:a("ia.directPlay.stage2.title")}),e.jsx(l.Paragraph,{className:"integration-assistant-section-desc",children:a("ia.directPlay.stage2.desc")})]})}),e.jsx(O,{className:"integration-assistant-direct-play-banner integration-assistant-direct-play-banner-inline",fullMode:!1,bordered:!1,closeIcon:null,type:"warning",description:a("ia.directPlay.versionNotice")}),oe?e.jsx(O,{className:"integration-assistant-direct-play-banner",fullMode:!1,bordered:!1,closeIcon:null,type:"danger",description:oe}):null,pe?e.jsx(O,{className:"integration-assistant-direct-play-banner",fullMode:!1,bordered:!1,closeIcon:null,type:"danger",description:pe}):null,ge?e.jsx(O,{className:"integration-assistant-direct-play-banner",fullMode:!1,bordered:!1,closeIcon:null,type:"danger",description:ge}):null,me?e.jsx(O,{className:"integration-assistant-direct-play-banner",fullMode:!1,bordered:!1,closeIcon:null,type:"success",description:me}):null,ke?e.jsx("div",{className:"integration-assistant-direct-play-loading",children:e.jsx(Ue,{size:"large"})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"integration-assistant-direct-play-form",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"integration-assistant-direct-play-field-head",children:[e.jsx(l.Text,{strong:!0,children:a("ia.directPlay.stage2.cardSelect")}),e.jsx(E,{theme:"borderless",onClick:()=>F(),children:a("ia.directPlay.stage2.refresh")})]}),e.jsx(_e,{className:"integration-assistant-direct-play-select",value:P==="create"?se:j||void 0,optionList:Me,onChange:s=>Re(s),placeholder:a("ia.directPlay.stage2.cardSelect")})]}),P==="select"?e.jsxs("div",{children:[e.jsx(l.Text,{strong:!0,children:a("ia.directPlay.stage2.assetSelect")}),e.jsx(_e,{className:"integration-assistant-direct-play-select",value:D||void 0,optionList:Ee,onChange:s=>de(s),placeholder:a("ia.directPlay.stage2.assetSelect")})]}):null]}),P==="create"?e.jsx("div",{className:"integration-assistant-direct-play-create-wrap",children:e.jsxs("div",{className:"integration-assistant-direct-play-panel",children:[e.jsx(l.Text,{strong:!0,children:a("ia.directPlay.stage2.create.title")}),e.jsx(l.Paragraph,{className:"integration-assistant-section-desc",children:a("ia.directPlay.stage2.create.desc")}),e.jsx(I,{className:"integration-assistant-direct-play-create-form",initValues:oa,getFormApi:s=>{S.current=s},onValueChange:s=>{if(J(""),X(""),s&&typeof s=="object"&&"cardType"in s){const r=String(s.cardType||G);Z(r)}},children:e.jsxs("div",{className:"integration-assistant-direct-play-create-grid",children:[e.jsx(I.Input,{field:"cardName",label:a("ia.directPlay.stage2.create.cardName"),placeholder:a("ia.directPlay.stage2.create.cardNamePlaceholder"),rules:[{required:!0,message:a("notEmpty")}]}),e.jsx(I.Select,{field:"cardType",label:Ae,optionList:De,onChange:Oe,rules:[{required:!0,message:a("notEmpty")}]}),e.jsx(I.Input,{field:"cardDesc",label:a("ia.directPlay.stage2.create.cardDesc"),placeholder:a("ia.directPlay.stage2.create.cardDescPlaceholder"),rules:[{required:!0,message:a("notEmpty")}]}),e.jsx(I.Select,{field:"subPkg",label:a("ia.directPlay.stage2.create.subPkg"),optionList:Le,rules:[{required:!0,message:a("notEmpty")}]}),e.jsx(I.Select,{field:"scenario",label:a("ia.directPlay.stage2.create.scenario"),optionList:z,rules:[{required:!0,message:a("notEmpty")}]}),e.jsx(I.Input,{field:"params",label:a("ia.directPlay.stage2.create.params"),placeholder:a("ia.directPlay.stage2.create.paramsPlaceholder")})]})}),e.jsx("div",{className:"integration-assistant-actions",children:e.jsx(E,{theme:"solid",type:"primary",loading:we,onClick:$e,children:a("ia.directPlay.stage2.create.submit")})})]})}):null,P==="select"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"integration-assistant-direct-play-details",children:[e.jsxs("div",{className:"integration-assistant-direct-play-panel",children:[e.jsx(l.Text,{strong:!0,children:a("ia.directPlay.stage2.selectedCard")}),T?e.jsxs("ul",{className:"integration-assistant-detail-list",children:[e.jsx("li",{children:`${a("ia.directPlay.stage2.cardName")}${T.card_name}`}),e.jsx("li",{children:`${a("ia.directPlay.stage2.cardContentId")}${T.content_id||"-"}`}),e.jsx("li",{children:`${a("ia.directPlay.stage2.cardDesc")}${T.card_desc||"-"}`}),e.jsx("li",{children:`${a("ia.directPlay.stage2.cardScenario")}${q(T.scenario,k)}`}),e.jsx("li",{children:`${a("ia.directPlay.stage2.cardStatus")}${xa(T)||"-"}`}),e.jsx("li",{children:`${a("ia.directPlay.stage2.cardPackage")}${ie(T.sub_pkg)}`}),e.jsx("li",{children:`${a("ia.directPlay.stage2.cardQueries")}${T.params||"-"}`})]}):e.jsx(l.Paragraph,{className:"integration-assistant-section-desc",children:a("ia.directPlay.stage2.emptyCard")})]}),e.jsxs("div",{className:"integration-assistant-direct-play-panel",children:[e.jsx(l.Text,{strong:!0,children:a("ia.directPlay.stage2.selectedAsset")}),A?e.jsxs("ul",{className:"integration-assistant-detail-list",children:[e.jsx("li",{children:`${a("ia.directPlay.stage2.assetGroup")}${ga(A.group)}`}),e.jsx("li",{children:`${a("ia.directPlay.stage2.assetFile")}${A.file_name||"-"}`}),e.jsx("li",{children:`${a("ia.directPlay.stage2.assetVersion")}${A.version||"-"}`}),e.jsx("li",{children:`${a("ia.directPlay.stage2.assetSize")}${ua(A.file_size)}`}),e.jsx("li",{children:`${a("ia.directPlay.stage2.assetUploaded")}${pa(A.uploaded_at)}`})]}):e.jsx(l.Paragraph,{className:"integration-assistant-section-desc",children:a("ia.directPlay.stage2.emptyAsset")})]})]}),e.jsx("div",{className:"integration-assistant-actions",children:e.jsx(E,{theme:"solid",loading:Ie,onClick:Fe,children:a("ia.directPlay.stage2.generate")})})]}):null,P==="select"&&le?e.jsxs("div",{className:"integration-assistant-direct-play-preview",children:[e.jsx("div",{className:"integration-assistant-direct-play-qr",children:e.jsx(Qe,{value:le,size:180})}),e.jsx("div",{className:"integration-assistant-direct-play-preview-content",children:e.jsx(l.Text,{className:"integration-assistant-section-desc",children:a("ia.directPlay.stage2.qrDesc")})})]}):null]})]})]})},_a={sidebar_revisit:{modeId:"sidebar-revisit-debug",scene:"center",sceneKey:"scene_center",titleKey:"ia.revisit.sidebar.panel.title",descKey:"ia.revisit.sidebar.panel.desc",modeValueKey:"ia.revisit.sidebar.panel.modeValue",generatedModeNameKey:"ia.revisit.sidebar.panel.generatedModeName",signalValueKey:"ia.revisit.sidebar.panel.signalValue",createQrKey:"ia.revisit.sidebar.panel.createQr"},shortcut_revisit:{modeId:"shortcut-revisit-debug",scene:"desktop_shortcut",sceneKey:"scene_shortcut",titleKey:"ia.revisit.shortcut.panel.title",descKey:"ia.revisit.shortcut.panel.desc",modeValueKey:"ia.revisit.shortcut.panel.modeValue",generatedModeNameKey:"ia.revisit.shortcut.panel.generatedModeName",signalValueKey:"ia.revisit.shortcut.panel.signalValue",createQrKey:"ia.revisit.shortcut.panel.createQr"}};function va(t,n){return{...t||Se,scene:n}}function Pa(t){return t.pkgType==="independent"?t.independentPkg||t.pkgName||a("independentPackage"):a("gameMainPackage")}const Na=({capabilityKey:t})=>{const n=ce(),{state:{selectedLaunchOption:i,launchOptions:p},setLaunchOptions:f,setSelectedLaunchOption:d}=Ce(),u=_a[t],b=c.useMemo(()=>va(i,u.scene),[u.scene,i]),Q=c.useCallback(()=>{const C={...b,id:u.modeId,name:a(u.generatedModeNameKey)},M=p.filter(j=>j.id!==u.modeId),P=M.findIndex(j=>j.id==="created"),$=P>=0?[...M.slice(0,P),C,...M.slice(P)]:[...M,C];f($),d(C),n("/")},[u.generatedModeNameKey,u.modeId,p,n,b,f,d]);return e.jsx("div",{className:"integration-assistant-direct-play-grid",children:e.jsxs(re,{className:"integration-assistant-direct-play-card",bordered:!0,children:[e.jsx("div",{className:"integration-assistant-section-head",children:e.jsxs("div",{children:[e.jsx(l.Title,{heading:5,children:a(u.titleKey)}),e.jsx(l.Paragraph,{className:"integration-assistant-section-desc",children:a(u.descKey)})]})}),e.jsxs("div",{className:"integration-assistant-direct-play-summary",children:[e.jsxs("div",{className:"integration-assistant-direct-play-row",children:[e.jsx(l.Text,{strong:!0,children:a("ia.revisit.panel.modeName")}),e.jsx(l.Text,{children:a(u.modeValueKey)})]}),e.jsxs("div",{className:"integration-assistant-direct-play-row",children:[e.jsx(l.Text,{strong:!0,children:a("ia.revisit.panel.scene")}),e.jsx(l.Text,{children:a(u.sceneKey)})]}),e.jsxs("div",{className:"integration-assistant-direct-play-row",children:[e.jsx(l.Text,{strong:!0,children:a("ia.revisit.panel.launchParams")}),e.jsx(l.Text,{children:`scene=${u.scene}`})]}),e.jsxs("div",{className:"integration-assistant-direct-play-row",children:[e.jsx(l.Text,{strong:!0,children:a("ia.revisit.panel.package")}),e.jsx(l.Text,{children:Pa(b)})]}),e.jsxs("div",{className:"integration-assistant-direct-play-row",children:[e.jsx(l.Text,{strong:!0,children:a("ia.revisit.panel.signal")}),e.jsx(l.Text,{children:a(u.signalValueKey)})]})]}),e.jsx("div",{className:"integration-assistant-actions",children:e.jsx(E,{theme:"solid",onClick:Q,children:a(u.createQrKey)})})]})})},K=t=>a(t),La=()=>{const t=ce(),{capabilityKey:n}=Be(),i=n?We[n]:void 0;c.useEffect(()=>{i?.customPath&&t(i.customPath,{replace:!0})},[i,t]);const p=i?.actions.filter(d=>d.labelKey==="ia.action.openCapabilityDoc")||[],f=d=>{if(d.type==="external"&&d.href){window.open(d.href,d.target||"_blank","noopener,noreferrer");return}d.type==="route"&&d.path&&t(d.path)};return!i||i.hidden?e.jsx("div",{className:"ia-page ia-page-detail",children:e.jsxs(H,{padding:"lg",children:[e.jsx(ze,{description:a("ia.detail.notFound")}),e.jsx("div",{className:"ia-back-row",children:e.jsx(E,{onClick:()=>t("/integration_assistant"),children:a("ia.detail.backToMap")})})]})}):e.jsxs("div",{className:"ia-page ia-page-detail",children:[e.jsxs("button",{type:"button",className:"ia-back-link",onClick:()=>t("/integration_assistant"),children:[e.jsx(Je,{size:14,strokeWidth:2}),e.jsx("span",{children:a("ia.detail.backToMap")})]}),e.jsx(Ye,{title:e.jsxs("span",{className:"ia-detail-title-row",children:[e.jsx("span",{className:"ia-detail-glyph","aria-hidden":"true",children:i.icon}),e.jsx("span",{children:K(i.titleKey)})]}),subtitle:K(i.summaryKey),action:p.length?e.jsx("div",{className:"ia-detail-actions",children:p.map(d=>e.jsx(E,{theme:d.theme||"solid",type:"primary",onClick:()=>f(d),children:K(d.labelKey)},`${d.type}:${d.path||d.href||d.labelKey}`))}):null}),i.apiTags.length?e.jsx("div",{className:"ia-detail-tags",children:i.apiTags.map(d=>e.jsx(He,{tone:"neutral",size:"sm",children:e.jsx("code",{className:"ia-detail-tag-code",children:d})},d))}):null,e.jsxs("div",{className:"ia-detail-grid",children:[e.jsxs(H,{padding:"md",children:[e.jsx(te,{icon:ea,title:a("ia.section.prerequisites"),as:"h3"}),e.jsx("ul",{className:"ia-detail-list",children:i.prerequisiteKeys.map(d=>e.jsxs("li",{className:"ia-detail-list-item",children:[e.jsx("span",{className:"ia-detail-list-bullet","aria-hidden":"true"}),e.jsx("span",{children:K(d)})]},d))})]}),e.jsxs(H,{padding:"md",children:[e.jsx(te,{icon:ta,title:a("ia.section.steps"),as:"h3"}),e.jsx("ol",{className:"ia-detail-steps",children:i.stepKeys.map((d,u)=>e.jsxs("li",{className:"ia-detail-step",children:[e.jsx("span",{className:"ia-detail-step-index",children:u+1}),e.jsx("span",{className:"ia-detail-step-text",children:K(d)})]},d))})]}),e.jsxs(H,{padding:"md",children:[e.jsx(te,{icon:Xe,title:a("ia.section.tips"),as:"h3"}),e.jsx("ul",{className:"ia-detail-list",children:i.tipKeys.map(d=>e.jsxs("li",{className:"ia-detail-list-item",children:[e.jsx("span",{className:"ia-detail-list-bullet","aria-hidden":"true"}),e.jsx("span",{children:K(d)})]},d))})]})]}),i.key==="direct_play_card"?e.jsx(ja,{}):null,i.key==="sidebar_revisit"||i.key==="shortcut_revisit"?e.jsx(Na,{capabilityKey:i.key}):null]})};export{La as IntegrationAssistantDetail};
@@ -1 +0,0 @@
1
- import{u as l,M as m,r as d,j as i,i as s,b as p,P as x}from"./index-CnReCFYA.js";import{E as j}from"./index-B13yZ-GH.js";import{S as o}from"./SectionHeader-DfBBWmpa.js";import{C as u}from"./Card-DvUkoCA3.js";import{T as b}from"./Tag-DuP9fCS0.js";import{b as y,f as g,C as r,M as f,c as h,a as v}from"./MonetizationModeSummary--L4WcmYS.js";import"./index-B6NHbQwP.js";import{A as M}from"./arrow-left-1V5G0Kw7.js";import{C}from"./compass-DZKQ36UU.js";import"./chevron-right-C5K8xBff.js";const e=t=>s(t),R=()=>{const t=l(),{modeKey:n}=m(),a=n?y[n]:void 0,c=d.useMemo(()=>g,[]);return a?i.jsxs("div",{className:"ia-page ia-page-detail",children:[i.jsxs("button",{type:"button",className:"ia-back-link",onClick:()=>t("/integration_assistant"),children:[i.jsx(M,{size:14,strokeWidth:2}),i.jsx("span",{children:s("ia.detail.backToMap")})]}),i.jsx(x,{title:e(a.titleKey),subtitle:e(a.summaryKey),action:i.jsx(b,{tone:"accent",size:"md",children:e(a.titleKey)})}),i.jsxs("section",{className:"ia-section",children:[i.jsx(o,{icon:r,title:s("ia.monetization.core.title"),subtitle:e(a.descriptionKey)}),i.jsx(f,{mode:a,clickableTags:!0})]}),i.jsxs("section",{className:"ia-section",children:[i.jsx(o,{icon:r,title:s("ia.monetization.core.title")}),i.jsx(h,{capabilityKeys:a.capabilityKeys,capabilityRequirementMap:a.capabilityRequirementMap,columns:2})]}),i.jsxs("section",{className:"ia-section",children:[i.jsx(o,{icon:C,title:s("ia.overview.groups.title"),subtitle:s("ia.overview.groups.desc")}),i.jsx("div",{className:"ia-section-stack",children:i.jsx(v,{sections:c})})]})]}):i.jsx("div",{className:"ia-page ia-page-detail",children:i.jsxs(u,{padding:"lg",children:[i.jsx(j,{description:s("ia.detail.notFound")}),i.jsx("div",{className:"ia-back-row",children:i.jsx(p,{onClick:()=>t("/integration_assistant"),children:s("ia.detail.backToMap")})})]})})};export{R as IntegrationAssistantMonetizationMode};
@@ -1 +0,0 @@
1
- import{a6 as U,r as T,bw as z,bx as J,an as H,k as R,l as L,aF as _,bl as Q,R as o,o as P,w as I,t,n as M,aJ as w,aE as ee,aK as te}from"./index-CnReCFYA.js";function ae(u){return T.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},u),T.createElement("path",{d:"M5 12.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 5 12.5Z",fill:"currentColor"}))}const se=U(ae,"checkbox_indeterminate");function ne(u){return T.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},u),T.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.41 7.3c.66.51.78 1.45.28 2.11l-6.5 8.5a1.5 1.5 0 0 1-2.37.01l-3.5-4.5a1.5 1.5 0 1 1 2.36-1.84L10 14.54l5.32-6.95a1.5 1.5 0 0 1 2.1-.28Z",fill:"currentColor"}))}const re=U(ne,"checkbox_tick");var $,j;function ie(){if(j)return $;j=1;var u=z(),e=J(),a="[object Boolean]";function s(r){return r===!0||r===!1||e(r)&&u(r)==a}return $=s,$}var oe=ie();const le=H(oe),G={PREFIX:`${R}-checkbox`,INPUT:`${R}-checkbox-input`,WRAPPER:""},de={PREFIX:`${R}-checkboxGroup`},p={DIRECTION_SET:["horizontal","vertical"],TYPE_DEFAULT:"default",TYPE_CARD:"card",TYPE_PURECARD:"pureCard",DEFAULT_DIRECTION:"vertical"};class ce extends L{constructor(e){super(Object.assign({},e)),this.clickState=!1,this.handleFocusVisible=a=>{const{target:s}=a;try{if(this.clickState){this.clickState=!1;return}s.matches(":focus-visible")&&this._adapter.setFocusVisible(!0)}catch{_(!0,"Warning: [Semi Checkbox] The current browser does not support the focus-visible")}},this.handleBlur=()=>{this.clickState=!1,this._adapter.setFocusVisible(!1)}}init(){const{children:e,extra:a,extraId:s,addonId:r}=this.getProps();e&&!r&&this._adapter.setAddonId(),a&&!s&&this._adapter.setExtraId()}notifyChange(e,a){const s=this._adapter.generateEvent(e,a);this._adapter.notifyChange(s)}handleChange(e){if(this.getProp("disabled"))return;if(e?.type==="click"&&(this.clickState=!0),this._adapter.focusCheckboxEntity(),this._adapter.getIsInGroup()){this._adapter.getGroupDisabled()||this.handleChangeInGroup(e);return}const d=!this.getState("checked");this._isControlledComponent("checked")?this.notifyChange(d,e):(this.setChecked(d),this.notifyChange(d,e))}handleChangeInGroup(e){const{value:a}=this.getProps(),d=!this._adapter.getGroupValue().includes(a),c=this._adapter.generateEvent(d,e);this._adapter.notifyChange(c),this._adapter.notifyGroupChange(c)}handleEnterPress(e){Q(e)&&this.handleChange(e)}setChecked(e){this._adapter.setNativeControlChecked(e)}destroy(){}}const N=o.createContext({});class A extends T.PureComponent{blur(){this.inputEntity.blur()}focus(){const{preventScroll:e}=this.props;this.inputEntity.focus({preventScroll:e})}render(){const{indeterminate:e,checked:a,disabled:s,prefixCls:r,name:d,isPureCardType:c,addonId:E,extraId:x,focusInner:f,onInputFocus:g,onInputBlur:m}=this.props,h=r||G.PREFIX,v=P({[`${h}-inner`]:!0,[`${h}-inner-checked`]:!!a,[`${h}-inner-pureCardType`]:c},G.WRAPPER),k=P({[`${h}-inner-display`]:!0,[`${h}-focus`]:f,[`${h}-focus-border`]:f&&!a}),C=a?o.createElement(re,null):e?o.createElement(se,null):null,i={type:"checkbox","aria-label":this.props["aria-label"],"aria-disabled":s,"aria-checked":a,"aria-labelledby":E,"aria-describedby":x||this.props["aria-describedby"],"aria-invalid":this.props["aria-invalid"],"aria-errormessage":this.props["aria-errormessage"],"aria-required":this.props["aria-required"],className:G.INPUT,onChange:I,checked:a,disabled:s,onFocus:g,onBlur:m};return d&&(i.name=d),o.createElement("span",{className:v},o.createElement("input",Object.assign({},i,{ref:b=>{this.inputEntity=b}})),o.createElement("span",{className:k},C))}}A.contextType=N;A.propTypes={"aria-describedby":t.string,"aria-errormessage":t.string,"aria-invalid":t.bool,"aria-labelledby":t.string,"aria-required":t.bool,checked:t.bool,disabled:t.bool,onChange:t.func,children:t.node,grouped:t.bool,value:t.any,isPureCardType:t.bool,addonId:t.string,extraId:t.string,focusInner:t.bool,onInputFocus:t.func,onInputBlur:t.func,preventScroll:t.bool};A.defaultProps={onChange:I};class y extends M{get adapter(){return Object.assign(Object.assign({},super.adapter),{setNativeControlChecked:e=>{this.setState({checked:e})},notifyChange:e=>{const{onChange:a}=this.props;a&&a(e)},generateEvent:(e,a)=>{const{props:s}=this;return{target:Object.assign(Object.assign({},s),{checked:e}),stopPropagation:()=>{a.stopPropagation()},preventDefault:()=>{a.preventDefault()},nativeEvent:{stopImmediatePropagation:()=>{a.nativeEvent&&typeof a.nativeEvent.stopImmediatePropagation=="function"&&a.nativeEvent.stopImmediatePropagation()}}}},getIsInGroup:()=>this.isInGroup(),getGroupValue:()=>this.context&&this.context.checkboxGroup.value||[],notifyGroupChange:e=>{this.context.checkboxGroup.onChange(e)},getGroupDisabled:()=>this.context&&this.context.checkboxGroup.disabled,setAddonId:()=>{this.setState({addonId:w({prefix:"addon"})})},setExtraId:()=>{this.setState({extraId:w({prefix:"extra"})})},setFocusVisible:e=>{this.setState({focusVisible:e})},focusCheckboxEntity:()=>{this.focus()}})}constructor(e){super(e),this.handleChange=s=>this.foundation.handleChange(s),this.handleEnterPress=s=>this.foundation.handleEnterPress(s),this.handleFocusVisible=s=>{this.foundation.handleFocusVisible(s)},this.handleBlur=s=>{this.foundation.handleBlur()};const a=!1;this.state={checked:e.checked||e.defaultChecked||a,addonId:e.addonId,extraId:e.extraId,focusVisible:!1},this.checkboxEntity=null,this.foundation=new ce(this.adapter)}componentDidUpdate(e){this.props.checked!==e.checked&&(ee(this.props.checked)?this.foundation.setChecked(!1):le(this.props.checked)&&this.foundation.setChecked(this.props.checked))}isInGroup(){return!!(this.context&&this.context.checkboxGroup&&"value"in this.props)}focus(){this.checkboxEntity&&this.checkboxEntity.focus()}blur(){this.checkboxEntity&&this.checkboxEntity.blur()}render(){const{disabled:e,style:a,prefixCls:s,className:r,indeterminate:d,children:c,onMouseEnter:E,onMouseLeave:x,extra:f,value:g,role:m,tabIndex:h,id:v,type:k}=this.props,{checked:C,addonId:i,extraId:b,focusVisible:V}=this.state,n={checked:C,disabled:e},O=this.isInGroup();if(O){if(this.context.checkboxGroup.value){const Z=(this.context.checkboxGroup.value||[]).includes(g);n.checked=Z}this.context.checkboxGroup.disabled&&(n.disabled=this.context.checkboxGroup.disabled||this.props.disabled);const{isCardType:D,isPureCardType:K}=this.context.checkboxGroup;n.isCardType=D,n.isPureCardType=K,n.name=this.context.checkboxGroup.name}else n.isPureCardType=k===p.TYPE_PURECARD,n.isCardType=k===p.TYPE_CARD||n.isPureCardType;const l=s||G.PREFIX,B=n.isCardType||n.isPureCardType,Y=P(l,{[`${l}-disabled`]:n.disabled,[`${l}-indeterminate`]:d,[`${l}-checked`]:n.checked,[`${l}-unChecked`]:!n.checked,[`${l}-cardType`]:n.isCardType,[`${l}-cardType_disabled`]:n.disabled&&n.isCardType,[`${l}-cardType_enable`]:!(n.disabled&&n.isCardType),[`${l}-cardType_checked`]:n.isCardType&&n.checked&&!n.disabled,[`${l}-cardType_checked_disabled`]:n.isCardType&&n.checked&&n.disabled,[r]:!!r,[`${l}-focus`]:V&&B}),q=P(`${l}-extra`,{[`${l}-cardType_extra_noChildren`]:n.isCardType&&!c});O&&this.context.checkboxGroup.name;const W=this.props["x-semi-children-alias"]||"children",X=()=>!c&&!f?null:o.createElement("div",{className:`${l}-content`},c?o.createElement("span",{id:i,className:`${l}-addon`,"x-semi-prop":W},c):null,f?o.createElement("div",{id:b,className:q,"x-semi-prop":"extra"},f):null);return o.createElement("span",Object.assign({role:m,tabIndex:h,style:a,className:Y,id:v,onMouseEnter:E,onMouseLeave:x,onClick:this.handleChange,onKeyPress:this.handleEnterPress,"aria-labelledby":this.props["aria-labelledby"]},this.getDataAttr(this.props)),o.createElement(A,Object.assign({},this.props,n,{addonId:c&&i,extraId:f&&b,isPureCardType:n.isPureCardType,ref:D=>{this.checkboxEntity=D},focusInner:V&&!B,onInputFocus:this.handleFocusVisible,onInputBlur:this.handleBlur})),X())}}y.contextType=N;y.propTypes={"aria-describedby":t.string,"aria-errormessage":t.string,"aria-invalid":t.bool,"aria-labelledby":t.string,"aria-required":t.bool,checked:t.bool,defaultChecked:t.bool,disabled:t.bool,indeterminate:t.bool,onChange:t.func,value:t.any,style:t.object,className:t.string,prefixCls:t.string,onMouseEnter:t.func,onMouseLeave:t.func,extra:t.node,index:t.number,"aria-label":t.string,tabIndex:t.number,preventScroll:t.bool,type:t.string};y.defaultProps={defaultChecked:!1,indeterminate:!1,onChange:I,onMouseEnter:I,onMouseLeave:I,type:"default"};y.elementType="Checkbox";class F extends L{static get checkboxGroupDefaultAdapter(){return{}}constructor(e){super(Object.assign(Object.assign({},F.checkboxGroupDefaultAdapter),e))}init(){const{defaultValue:e,value:a}=this.getProps();typeof e<"u"&&!Array.isArray(e)&&_(!0,"Warning: [Semi CheckboxGroup] defaultValue should be an Array"),typeof a<"u"&&!Array.isArray(a)&&_(!0,"Warning: [Semi CheckboxGroup] value should be an Array")}notifyChange(e){this._adapter.notifyChange(e)}handleChange(e){const a=this.getState("value");let s=[];Array.isArray(a)||(s=[a]),e.target.checked?s=[...a,e.target.value]:s=a.filter((d,c)=>d!==e.target.value),"value"in this.getProps()?this.notifyChange(s):(this._adapter.updateGroupValue(s),this.notifyChange(s))}getFormatName(){return this.getProp("name")||"default"}handlePropValueChange(e){Array.isArray(e)?this._adapter.updateGroupValue(e):(typeof e>"u"&&this._adapter.updateGroupValue([]),_(!0,"Warning: [Semi CheckboxGroup] value should be an Array"))}destroy(){}}class S extends M{get adapter(){return Object.assign(Object.assign({},super.adapter),{updateGroupValue:e=>{this.setState({value:e})},notifyChange:e=>{this.props.onChange&&this.props.onChange(e)}})}constructor(e){super(e),this.state={value:e.value||e.defaultValue},this.foundation=new F(this.adapter),this.onChange=this.onChange.bind(this)}componentDidMount(){this.foundation.init()}componentDidUpdate(e){te(e.value,this.props.value)||this.foundation.handlePropValueChange(this.props.value)}componentWillUnmount(){this.foundation.destroy()}onChange(e){this.foundation.handleChange(e)}render(){const{children:e,options:a,prefixCls:s,direction:r,className:d,id:c,style:E,type:x,disabled:f}=this.props,g=x===p.TYPE_PURECARD,m=x===p.TYPE_CARD||g,h=s||de.PREFIX,v=P({[h]:!0,[`${h}-wrapper`]:!0,[`${h}-${r}`]:r,[`${h}-${r}-cardType`]:r&&m,[`${h}-${r}-pureCardType`]:r&&g},d),k=this.state.value.slice();let C;return a?C=(a||[]).map((i,b)=>typeof i=="string"?o.createElement(y,{role:"listitem",key:b,disabled:this.props.disabled,value:i,prefixCls:s},i):o.createElement(y,{role:"listitem",key:b,disabled:i.disabled||this.props.disabled,value:i.value,prefixCls:s,extra:i.extra,className:i.className,style:i.style,onChange:i.onChange},i.label)):e&&(C=o.Children.toArray(e).map((i,b)=>o.cloneElement(i,{key:b,role:"listitem"}))),o.createElement("div",Object.assign({id:c,role:"list","aria-label":this.props["aria-label"],className:v,style:E,"aria-labelledby":this.props["aria-labelledby"],"aria-describedby":this.props["aria-describedby"]},this.getDataAttr(this.props)),o.createElement(N.Provider,{value:{checkboxGroup:{onChange:this.onChange,value:k,disabled:this.props.disabled,name:this.foundation.getFormatName(),isCardType:m,isPureCardType:g}}},C))}}S.propTypes={"aria-describedby":t.string,"aria-errormessage":t.string,"aria-invalid":t.bool,"aria-labelledby":t.string,"aria-required":t.bool,defaultValue:t.array,disabled:t.bool,name:t.string,options:t.array,value:t.array,onChange:t.func,children:t.node,prefixCls:t.string,direction:t.oneOf(p.DIRECTION_SET),className:t.string,type:t.oneOf([p.TYPE_DEFAULT,p.TYPE_CARD,p.TYPE_PURECARD]),style:t.object};S.defaultProps={disabled:!1,onChange:()=>{},type:p.TYPE_DEFAULT,defaultValue:[],direction:p.DEFAULT_DIRECTION};class he extends y{}he.Group=S;export{he as C,le as _,y as a,S as b};
@@ -1 +0,0 @@
1
- import{k as I,l as q,m as R,_ as k,n as D,o as T,R as r,b as x,I as A,p as U,L as z,q as M,s as X,C as Q,t as o,v as Z,w as j,x as G,i as s,u as H,d as J,r as y,N as w,j as m,B as K,y as W}from"./index-CnReCFYA.js";import{F as P}from"./baseForm-2J62W6xr.js";import"./index-CcxOfQrE.js";const B={PREFIX:`${I}-popconfirm`,POPOVER:`${I}-popconfirm-popover`},Y={DEFAULT_Z_INDEX:1030};class ee extends q{init(){}destroy(){}handleCancel(e){const t=this._adapter.notifyCancel(e);R(t)?(this._adapter.updateCancelLoading(!0),t.then(n=>{this.handleVisibleChange(!1),this._adapter.updateCancelLoading(!1)},n=>{this._adapter.updateCancelLoading(!1)})):this.handleVisibleChange(!1)}handleConfirm(e){const t=this._adapter.notifyConfirm(e);R(t)?(this._adapter.updateConfirmLoading(!0),t.then(n=>{this._adapter.updateConfirmLoading(!1),this.handleVisibleChange(!1)},n=>{this._adapter.updateConfirmLoading(!1)})):this.handleVisibleChange(!1)}handleClickOutSide(e){this._adapter.notifyClickOutSide(e)}handleVisibleChange(e){this._isControlledComponent("visible")||this._adapter.setVisible(e),e?this.handleFocusOperateButton():this._adapter.focusPrevFocusElement(),this._adapter.notifyVisibleChange(e)}handleFocusOperateButton(){const{cancelButtonProps:e,okButtonProps:t}=this._adapter.getProps();k(e,"autoFocus")&&!k(e,"disabled")?this._adapter.focusCancelButton():k(t,"autoFocus")&&!k(t,"disabled")&&this._adapter.focusOkButton()}}var te=function(u,e){var t={};for(var n in u)Object.prototype.hasOwnProperty.call(u,n)&&e.indexOf(n)<0&&(t[n]=u[n]);if(u!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(u);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(u,n[i])&&(t[n[i]]=u[n[i]]);return t};class O extends D{constructor(e){super(e),this.handleCancel=t=>this.foundation.handleCancel(t&&t.nativeEvent),this.handleConfirm=t=>this.foundation.handleConfirm(t&&t.nativeEvent),this.handleVisibleChange=t=>this.foundation.handleVisibleChange(t),this.handleClickOutSide=t=>this.foundation.handleClickOutSide(t),this.stopImmediatePropagation=t=>t&&t.nativeEvent&&t.nativeEvent.stopImmediatePropagation(),this.renderConfirmPopCard=t=>{let{initialFocusRef:n}=t;const{content:i,title:g,className:p,style:f,cancelType:b,icon:h,prefixCls:l,showCloseIcon:v}=this.props,{direction:_}=this.context,S=T(l,p,{[`${l}-rtl`]:_==="rtl"}),E=g!==null&&typeof g<"u",F=!(i===null||typeof i>"u"),V=r.isValidElement(h),N=T({[`${l}-body`]:!0,[`${l}-body-withIcon`]:V});return r.createElement("div",{className:S,onClick:this.stopImmediatePropagation,style:f},r.createElement("div",{className:`${l}-inner`},r.createElement("div",{className:`${l}-header`},V?r.createElement("i",{className:`${l}-header-icon`,"x-semi-prop":"icon"},h):null,r.createElement("div",{className:`${l}-header-body`},E?r.createElement("div",{className:`${l}-header-title`,"x-semi-prop":"title"},g):null),v?r.createElement(x,{className:`${l}-btn-close`,icon:r.createElement(A,null),size:"small",theme:"borderless",type:b,onClick:this.handleCancel}):null),F?r.createElement("div",{className:N,"x-semi-prop":"content"},U(i)?i({initialFocusRef:n}):i):null,r.createElement("div",{className:`${l}-footer`,ref:this.footerRef},this.renderControls())))},this.state={cancelLoading:!1,confirmLoading:!1,visible:e.defaultVisible||!1},this.foundation=new ee(this.adapter),this.footerRef=r.createRef(),this.popoverRef=r.createRef()}static getDerivedStateFromProps(e,t){const n={},{hasOwnProperty:i}=Object.prototype;return i.call(e,"visible")&&(n.visible=e.visible),n}get adapter(){return Object.assign(Object.assign({},super.adapter),{setVisible:e=>this.setState({visible:e}),updateConfirmLoading:e=>this.setState({confirmLoading:e}),updateCancelLoading:e=>this.setState({cancelLoading:e}),notifyConfirm:e=>this.props.onConfirm(e),notifyCancel:e=>this.props.onCancel(e),notifyVisibleChange:e=>this.props.onVisibleChange(e),notifyClickOutSide:e=>this.props.onClickOutSide(e),focusCancelButton:()=>{var e,t;const n=(t=(e=this.footerRef)===null||e===void 0?void 0:e.current)===null||t===void 0?void 0:t.querySelector("[data-type=cancel]");n?.focus({preventScroll:!0})},focusOkButton:()=>{var e,t;const n=(t=(e=this.footerRef)===null||e===void 0?void 0:e.current)===null||t===void 0?void 0:t.querySelector("[data-type=ok]");n?.focus({preventScroll:!0})},focusPrevFocusElement:()=>{var e;(e=this.popoverRef.current)===null||e===void 0||e.focusTrigger()}})}renderControls(){const{okText:e,cancelText:t,okType:n,cancelType:i,cancelButtonProps:g,okButtonProps:p}=this.props,{cancelLoading:f,confirmLoading:b}=this.state;return r.createElement(z,{componentName:"Popconfirm"},(h,l)=>r.createElement(r.Fragment,null,r.createElement(x,Object.assign({"data-type":"cancel",type:i,onClick:this.handleCancel,loading:f},M(g,"autoFocus")),t||k(h,"cancel")),r.createElement(x,Object.assign({"data-type":"ok",type:n,theme:"solid",onClick:this.handleConfirm,loading:b},M(p,"autoFocus")),e||k(h,"confirm"))))}render(){const{direction:e}=this.context,t=e==="rtl"?"bottomRight":"bottomLeft",n=this.props,{className:i,prefixCls:g,disabled:p,children:f,style:b,position:h=t}=n,l=te(n,["className","prefixCls","disabled","children","style","position"]);if(p)return f;const{visible:v}=this.state,_={onVisibleChange:this.handleVisibleChange,className:B.POPOVER,onClickOutSide:this.handleClickOutSide};return this.isControlled("visible")&&(_.trigger="custom"),r.createElement(X,Object.assign({ref:this.popoverRef},l,{content:S=>{let{initialFocusRef:E}=S;return this.renderConfirmPopCard({initialFocusRef:E})},visible:v,position:h},_),f)}}O.contextType=Q;O.propTypes={motion:o.oneOfType([o.bool,o.func,o.object]),disabled:o.bool,content:o.oneOfType([o.node,o.func]),title:o.any,prefixCls:o.string,className:o.string,style:o.object,icon:o.node,okText:o.string,okType:o.string,cancelText:o.string,cancelType:o.string,onCancel:o.func,onConfirm:o.func,onClickOutSide:o.func,onVisibleChange:o.func,visible:o.bool,defaultVisible:o.bool,okButtonProps:o.object,cancelButtonProps:o.object,stopPropagation:o.oneOfType([o.bool,o.string]),showCloseIcon:o.bool,zIndex:o.number,trigger:o.string,position:o.string};O.__SemiComponentName__="Popconfirm";O.defaultProps=Z(O.__SemiComponentName__,{stopPropagation:!0,trigger:"click",onVisibleChange:j,disabled:!1,icon:r.createElement(G,{size:"extra-large"}),okType:"primary",cancelType:"tertiary",prefixCls:B.PREFIX,zIndex:Y.DEFAULT_Z_INDEX,showCloseIcon:!0,onCancel:j,onConfirm:j,onClickOutSide:j});const ne=[{label:s("scene_scan_qrcode"),value:"scan_qrcode"},{label:s("scene_search"),value:"search"},{label:s("scene_fyf_promotion_direct_feed_play"),value:"fyf_promotion_direct_feed_play"},{label:s("scene_anchor"),value:"anchor"},{label:s("scene_center"),value:"center"},{label:s("scene_ad"),value:"ads"},{label:s("scene_shortcut"),value:"desktop_shortcut"},{label:s("scene_sharing"),value:"dm_sharing"},{label:s("scene_link"),value:"minis_link"}],ie=()=>{const u=H(),{state:{launchOptions:e,selectedLaunchOption:t,packages:n},setLaunchOptions:i,setSelectedLaunchOption:g}=J(),p=y.useRef(null),f=t||w,[b,h]=y.useState(f),[l,v]=y.useState(f.id),_=n.map(a=>{if(a.type==="main")return{label:s("gameMainPackage"),value:a.name};if(a.type==="independent")return{label:`${s("independentPackage")}: ${a.name}`,value:a.name}}).filter(Boolean),S=y.useCallback(a=>{const c={...b,...a};c.pkgType==="main"&&c.independentPkg!==void 0&&(c.independentPkg=void 0,p.current&&p.current.setValues({independentPkg:void 0})),h(c)},[b]),E=y.useCallback(()=>{if(!p.current)return;const a=p.current.getValues();a.pkgType==="main"&&(a.independentPkg=void 0);const c=e.findIndex(C=>C.name===a.name&&C.id!=="created"&&C.id!=="normal");let d;c!==-1?(d=[...e],d[c]=a):(a.id=Date.now().toString(),d=[...e.slice(0,-1),a,...e.slice(-1)]),i(d),h(a),g(a),u("/")},[e,u,i,g]),F=y.useCallback(a=>{const c=e.find(d=>d.id===a);if(c){v(a);const d={...c};a==="created"?d.name="":a==="normal"&&(d.name=s("normalLaunchMode")),h(d),p.current?.setValues(d)}},[e]),V=y.useCallback(()=>{const a=l;if(["normal","created"].includes(a))return;const c=e.filter(L=>L.id!==a);i(c);const d=c.find(L=>L.id==="normal")||c.find(L=>L.id==="created")||c[0]||w,C={...d,...d.id==="created"?{name:""}:{},...d.id==="normal"?{name:s("normalLaunchMode")}:{}};g(C),v(C.id),h(C),p.current?.setValues(C)},[e,l,i,g]),N=y.useCallback(()=>{h(f),p.current?.setValues(f),u("/")},[f,u]),$=e.find(a=>a.id===l);return m.jsxs("div",{children:[m.jsx(K,{style:{marginBottom:32},fullMode:!1,icon:null,closeIcon:null,description:s("launchModeDesc"),type:"info"}),m.jsxs(P,{initValues:b,onValueChange:S,getFormApi:a=>p.current=a,style:{padding:20,border:"1px solid var(--tt-border)",borderRadius:8},onSubmit:E,children:[m.jsx(P.Select,{placeholder:s("selectLaunchMode"),rules:[{required:!0,message:s("selectLaunchMode")}],field:"id",label:s("selectLaunchMode"),optionList:e.map(a=>({label:a.name,value:a.id})),onChange:F,style:{width:"100%"},value:l}),m.jsx(P.Input,{required:!0,placeholder:s("launchModeName"),field:"name",label:s("launchModeName"),rules:[{required:!0,message:s("notEmpty")}],style:{width:"100%"},trigger:"blur"}),m.jsx(P.Select,{field:"pkgName",label:s("selectLaunchPkg"),placeholder:s("selectLaunchPkg"),rules:[{required:!0,message:s("notEmpty")}],optionList:_,style:{width:"100%"}}),m.jsx(P.Select,{field:"scene",label:s("selectScene"),rules:[{required:!0,message:s("notEmpty")}],placeholder:s("selectScene"),optionList:ne,style:{width:"100%"},filter:!0}),m.jsx(P.Input,{field:"queries",label:s("launchQueries"),placeholder:s("launchQueriesDesc"),trigger:"blur",rules:[{validator:(a,c)=>{const{isValid:d,message:C}=W(c);return d?Promise.resolve():Promise.reject(C)}}],style:{width:"100%"}}),m.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",marginTop:20},children:[["created","normal"].includes(l)?m.jsx(x,{style:{marginRight:12},onClick:N,children:s("cancel")}):m.jsx(O,{title:s("deleteLaunchModeConfirm",{name:$?.name??""}),onConfirm:V,position:"bottomRight",children:m.jsx(x,{type:"danger",style:{marginRight:12},children:s("delete")})}),m.jsx(x,{htmlType:"submit",type:"primary",children:s("saveAndUse")})]})]})]})};export{ie as LaunchMode};
@@ -1 +0,0 @@
1
- import{a8 as G,k as X,l as B,a9 as z,aa as U,ab as _,ac as Y,ad as q,ae as W,af as Z,ag as H,ah as J,ai as Q,R as a,n as F,o as g,t as s,aj as V,w,r as ee,a2 as te,_ as $,v as se,ak as ne}from"./index-CnReCFYA.js";const N={PREFIX:`${X}-dropdown`},O={POSITION_SET:G.POSITION_SET,TRIGGER_SET:["hover","focus","click","custom","contextMenu"],DEFAULT_LEAVE_DELAY:100,ITEM_TYPE:["primary","secondary","tertiary","warning","danger"]},R={SPACING:4,NESTED_SPACING:2};class oe extends B{handleVisibleChange(e){this._adapter.setPopVisible(e),this._adapter.notifyVisibleChange(e);const{trigger:n}=this.getProps();if(e&&n==="click"){const t=this._adapter.getPopupId();this.setFocusToFirstMenuItem(t)}}getMenuItemNodes(e){const n=document.getElementById(e);return n?Array.from(n.getElementsByTagName("li")).filter(t=>t.ariaDisabled==="false"):null}setFocusToFirstMenuItem(e){const n=this.getMenuItemNodes(e);n&&z(n)}setFocusToLastMenuItem(e){const n=this.getMenuItemNodes(e);n&&U(n)}handleKeyDown(e){var n,t;const o=(t=(n=e.target)===null||n===void 0?void 0:n.attributes["data-popupid"])===null||t===void 0?void 0:t.value,{visible:r}=this._adapter.getStates();switch(e.key){case" ":case"Enter":e.target.click();break;case"ArrowDown":this.setFocusToFirstMenuItem(o),r&&_(e);break;case"ArrowUp":this.setFocusToLastMenuItem(o),r&&_(e);break}}}class re extends B{constructor(){super(...arguments),this.menuItemNodes=null,this.firstChars=[]}handleEscape(e){this._adapter.getContext("trigger")==="custom"&&(e&&Y(document.querySelectorAll("[data-popupid]"),e.id)).focus()}setFocusByFirstCharacter(e,n){const t=q(this.menuItemNodes,e,this.firstChars,n);t>=0&&W(this.menuItemNodes,this.menuItemNodes[t])}onMenuKeydown(e){const n=Z(e.target,"tooltip");this.menuItemNodes||(this.menuItemNodes=[...e.target.parentNode.getElementsByTagName("li")].filter(o=>o.ariaDisabled!=="true")),this.firstChars.length===0&&this.menuItemNodes.forEach(o=>{var r;this.firstChars.push((r=o.textContent.trim()[0])===null||r===void 0?void 0:r.toLowerCase())});const t=this.menuItemNodes.find(o=>o.tabIndex===0);switch(e.key){case" ":case"Enter":e.target.click();break;case"Escape":this.handleEscape(n);break;case"ArrowUp":Q(this.menuItemNodes,t),_(e);break;case"ArrowDown":J(this.menuItemNodes,t),_(e);break;default:H(e.key)&&this.setFocusByFirstCharacter(t,e.key);break}}}const E=a.createContext({level:0});var ae=function(i,e){var n={};for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&e.indexOf(t)<0&&(n[t]=i[t]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,t=Object.getOwnPropertySymbols(i);o<t.length;o++)e.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(i,t[o])&&(n[t[o]]=i[t[o]]);return n};const ie=N.PREFIX;class M extends F{constructor(e){super(e),this.foundation=new re(this.adapter)}get adapter(){return Object.assign({},super.adapter)}render(){const e=this.props,{children:n,className:t,style:o}=e,r=ae(e,["children","className","style"]);return a.createElement("ul",Object.assign({role:"menu","aria-orientation":"vertical"},r,{className:g(`${ie}-menu`,t),style:o,onKeyDown:l=>this.foundation.onMenuKeydown(l)}),n)}}M.propTypes={children:s.node,className:s.string,style:s.object};M.contextType=E;const f=N.PREFIX;class x extends F{render(){const{children:e,disabled:n,className:t,forwardRef:o,style:r,type:l,active:u,icon:m,onKeyDown:I,showTick:v,hover:h}=this.props,{showTick:C}=this.context,d=C??v,P=g(t,{[`${f}-item`]:!0,[`${f}-item-disabled`]:n,[`${f}-item-hover`]:h,[`${f}-item-withTick`]:d,[`${f}-item-${l}`]:l,[`${f}-item-active`]:u}),y={};n||["onClick","onMouseEnter","onMouseLeave","onContextMenu"].forEach(p=>{this.context.level!==1&&p==="onClick"?y.onMouseDown=A=>{var j,k;A.button===0&&((k=(j=this.props)[p])===null||k===void 0||k.call(j,A))}:y[p]=this.props[p]});let b=null;switch(!0){case(d&&u):b=a.createElement(V,null);break;case(d&&!u):b=a.createElement(V,{style:{color:"transparent"}});break;default:b=null;break}let T=null;return m&&(T=a.createElement("div",{className:`${f}-item-icon`},m)),a.createElement("li",Object.assign({role:"menuitem",tabIndex:-1,"aria-disabled":n},y,{onKeyDown:I,ref:p=>o(p),className:P,style:r},this.getDataAttr(this.props)),b,T,e)}}x.propTypes={children:s.oneOfType([s.string,s.node]),name:s.string,disabled:s.bool,selected:s.bool,onClick:s.func,onMouseEnter:s.func,onMouseLeave:s.func,onContextMenu:s.func,className:s.string,style:s.object,forwardRef:s.func,type:s.oneOf(O.ITEM_TYPE),active:s.bool,icon:s.node};x.contextType=E;x.defaultProps={disabled:!1,divided:!1,selected:!1,onMouseEnter:w,onMouseLeave:w,forwardRef:w};x.elementType="Dropdown.Item";const le=N.PREFIX,K=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{style:e,className:n}=i;return a.createElement("div",{className:g(`${le}-divider`,n),style:e})};K.propTypes={style:s.object,className:s.string};const L=N.PREFIX;class S extends ee.PureComponent{render(){const{className:e,style:n,children:t}=this.props,{showTick:o}=this.context,r=g({[`${L}-title`]:!0,[`${L}-title-withTick`]:o},e);return a.createElement("div",{className:r,style:n},t)}}S.propTypes={children:s.node,className:s.string,style:s.object};S.contextType=E;var D=function(i,e){var n={};for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&e.indexOf(t)<0&&(n[t]=i[t]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,t=Object.getOwnPropertySymbols(i);o<t.length;o++)e.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(i,t[o])&&(n[t[o]]=i[t[o]]);return n};const ce=O.POSITION_SET,ue=O.TRIGGER_SET;class c extends F{constructor(e){super(e),this.handleVisibleChange=n=>this.foundation.handleVisibleChange(n),this.state={popVisible:e.visible},this.foundation=new oe(this.adapter),this.tooltipRef=a.createRef()}get adapter(){return Object.assign(Object.assign({},super.adapter),{setPopVisible:e=>this.setState({popVisible:e}),notifyVisibleChange:e=>{var n,t;return(t=(n=this.props).onVisibleChange)===null||t===void 0?void 0:t.call(n,e)},getPopupId:()=>this.tooltipRef.current.getPopupId()})}renderContent(){const{render:e,menu:n,contentClassName:t,style:o,showTick:r,prefixCls:l,trigger:u}=this.props,m=g(l,t),{level:I=0}=this.context,v={showTick:r,level:I+1,trigger:u};let h=null;return a.isValidElement(e)?h=e:Array.isArray(n)&&(h=this.renderMenu()),a.createElement(E.Provider,{value:v},a.createElement("div",{className:m,style:o},a.createElement("div",{className:`${l}-content`,"x-semi-prop":"render"},h)))}renderMenu(){const{menu:e}=this.props,n=e.map((t,o)=>{switch(t.node){case"title":{const{name:r,node:l}=t,u=D(t,["name","node"]);return a.createElement(c.Title,Object.assign({},u,{key:l+r+o}),r)}case"item":{const{node:r,name:l}=t,u=D(t,["node","name"]);return a.createElement(c.Item,Object.assign({},u,{key:r+l+o}),l)}case"divider":return a.createElement(c.Divider,{key:t.node+o});default:return null}});return a.createElement(c.Menu,null,n)}renderPopCard(){const{render:e,contentClassName:n,style:t,showTick:o,prefixCls:r}=this.props,l=g(r,n),{level:u=0}=this.context,m={showTick:o,level:u+1};return a.createElement(E.Provider,{value:m},a.createElement("div",{className:l,style:t},a.createElement("div",{className:`${r}-content`},e)))}render(){const e=this.props,{children:n,position:t,trigger:o,onVisibleChange:r,zIndex:l,className:u,motion:m,margin:I,style:v,prefixCls:h}=e,C=D(e,["children","position","trigger","onVisibleChange","zIndex","className","motion","margin","style","prefixCls"]);let{spacing:d}=this.props;const{level:P}=this.context,{popVisible:y}=this.state,b=this.renderContent();return P>0?d=typeof d=="number"?d:R.NESTED_SPACING:(d===null||typeof d>"u")&&(d=R.SPACING),a.createElement(te,Object.assign({zIndex:l,motion:m,margin:I,content:b,className:u,prefixCls:h,spacing:d,position:t,trigger:o,onVisibleChange:this.handleVisibleChange,showArrow:!1,returnFocusOnClose:!0,ref:this.tooltipRef},C),a.isValidElement(n)?a.cloneElement(n,{className:g($(n,"props.className"),{[`${h}-showing`]:y}),"aria-haspopup":!0,"aria-expanded":y,onKeyDown:T=>{this.foundation.handleKeyDown(T);const p=$(n,"props.onKeyDown");p&&p(T)}}):n)}}c.Menu=M;c.Item=x;c.Divider=K;c.Title=S;c.contextType=E;c.propTypes={children:s.node,contentClassName:s.oneOfType([s.string,s.array]),className:s.string,getPopupContainer:s.func,margin:s.oneOfType([s.number,s.object]),mouseEnterDelay:s.number,mouseLeaveDelay:s.number,menu:s.array,motion:s.oneOfType([s.bool,s.func,s.object]),onVisibleChange:s.func,prefixCls:s.string,position:s.oneOf(ce),rePosKey:s.oneOfType([s.string,s.number]),render:s.node,spacing:s.oneOfType([s.number,s.object]),showTick:s.bool,style:s.object,trigger:s.oneOf(ue),visible:s.bool,zIndex:s.number};c.__SemiComponentName__="Dropdown";c.defaultProps=se(c.__SemiComponentName__,{onVisibleChange:w,prefixCls:N.PREFIX,zIndex:ne.DEFAULT_Z_INDEX,motion:!0,trigger:"hover",position:"bottom",mouseLeaveDelay:O.DEFAULT_LEAVE_DELAY,showTick:!1,closeOnEsc:!0,onEscKeyDown:w});export{c as D};
@@ -1 +0,0 @@
1
- import{k as ae,o as I,R as m,x as ie,z as oe,U as ce,t as u,V as qe,r as w,W as de,l as Fe,X as Xe,n as Me,Y as He,Z as Ge,I as Ue,F as Ve,C as Ke,v as Qe,w as ne,$ as re,a0 as ve,a1 as Ze,c as K,e as $,j as e,i as r,b as N,a as Ye,d as We,f as A,Q as Je,a2 as et,a3 as Z,a4 as q,u as tt,P as te}from"./index-CnReCFYA.js";import{S as Se}from"./SectionHeader-DfBBWmpa.js";import{C as Q}from"./Card-DvUkoCA3.js";import{T as st}from"./Tag-DuP9fCS0.js";import{a as at,R as nt,F as Ce}from"./baseForm-2J62W6xr.js";/* empty css */import{A as se}from"./arrow-left-1V5G0Kw7.js";import{S as rt}from"./sparkles-tr6K1Npg.js";import"./index-CcxOfQrE.js";const X={PREFIX:`${ae}-steps`,ITEM:`${ae}-steps-item`};var U;(function(n){n.small="large",n.default="extra-large"})(U||(U={}));const pe=n=>{const{prefixCls:s,className:t,size:a,title:l,description:i,status:c,style:d,active:o,done:p,icon:h,stepNumber:x,onClick:S,onChange:C,onKeyDown:b}=n,g=()=>{let v,E;if("icon"in n)m.isValidElement(h)&&(v=h);else if("status"in n)switch(c){case"error":v=m.createElement(ce,{size:U[a]});break;case"wait":v=m.createElement("span",{className:`${s}-number-icon`},x);break;case"process":v=m.createElement("span",{className:`${s}-number-icon`},x),E=!0;break;case"finish":v=m.createElement(oe,{size:U[a]});break;case"warning":v=m.createElement(ie,{size:U[a]});break;default:v=null;break}const F=I({[`${s}-icon`]:!0,[`${s}-custom-icon`]:"icon"in n,[`${s}-icon-process`]:E});return v?m.createElement("span",{className:F},v):null},y=I(s,`${s}-${c}`,{[`${s}-active`]:o,[`${s}-done`]:p,[`${s}-hover`]:C||n.onClick,[`${s}-clickable`]:C||S,[`${s}-${c}-hover`]:C||n.onClick},t),f=v=>{S?.(v),C?.()},j=v=>{v.key==="Enter"&&(b?.(v),C?.())};return m.createElement("div",{role:n.role,"aria-label":n["aria-label"],tabIndex:0,"aria-current":"step",className:y,style:d,onClick:v=>f(v),onKeyDown:j},m.createElement("div",{className:`${s}-container`},m.createElement("div",{className:`${s}-left`},g()),m.createElement("div",{className:`${s}-content`},m.createElement("div",{className:`${s}-title`},m.createElement("div",{className:`${s}-title-text`},l)),i&&m.createElement("div",{className:`${s}-description`},i))))};pe.propTypes={prefixCls:u.string,description:u.node,icon:u.node,status:u.oneOf(["wait","process","finish","error","warning"]),title:u.node,className:u.string,style:u.object,onClick:u.func,active:u.bool,done:u.bool};pe.defaultProps={prefixCls:X.ITEM,active:!1,done:!1,status:"wait",className:""};const me=n=>{const{prefixCls:s,className:t,title:a,description:l,status:i,style:c,onClick:d,icon:o,onChange:p,stepNumber:h,onKeyDown:x}=n,S=()=>{let g,y;if("icon"in n)g=o;else if("status"in n)switch(i){case"error":g=m.createElement(ce,{size:"extra-large"});break;case"wait":g=h;break;case"process":g=h,y=!0;break;case"finish":g=m.createElement(oe,{size:"extra-large"});break;case"warning":g=m.createElement(ie,{size:"extra-large"});break;default:g=null;break}const f=I({[`${s}-left`]:!0,[`${s}-icon`]:"icon"in n,[`${s}-plain`]:!("icon"in n),[`${s}-icon-process`]:y,[`${s}-hover`]:p||d});return g?m.createElement("div",{className:f},g):null},C=g=>{d?.(g),p?.()},b=g=>{g.key==="Enter"&&(x?.(g),p?.())};return m.createElement("div",{role:n.role,"aria-label":n["aria-label"],"aria-current":"step",tabIndex:0,className:I({[s]:!0,[`${s}-${i}`]:!!i,[`${s}-${i}-hover`]:!!i&&(p||d),[`${s}-${i}-active`]:!!i&&(p||d),[`${s}-clickable`]:p||d},t),style:c,onClick:g=>{C(g)},onKeyDown:b},S(),m.createElement("div",{className:`${s}-content`},m.createElement("div",{className:`${s}-title`,title:typeof a=="string"?a:null},m.createElement("span",{className:`${s}-title-text`},a)),m.createElement("div",{className:`${s}-description`,title:typeof l=="string"?l:null},l)))};me.propTypes={prefixCls:u.string,description:u.node,icon:u.node,status:u.oneOf(["wait","process","finish","error","warning"]),title:u.node,className:u.string,style:u.object,onClick:u.func};me.defaultProps={prefixCls:X.ITEM,status:"wait",className:""};const ue=n=>{const{prefixCls:s,className:t,title:a,style:l,active:i,index:c,total:d,onClick:o,onKeyDown:p,onChange:h}=n,x=I(s,{[`${s}-active`]:i},t),S=b=>{o?.(b),h?.()},C=b=>{b.key==="Enter"&&(p?.(b),h?.())};return m.createElement("div",{role:n.role,"aria-label":n["aria-label"],"aria-current":"step",tabIndex:0,className:x,style:l,onClick:b=>S(b),onKeyDown:C},m.createElement("div",{className:`${s}-container`},m.createElement("div",{className:`${s}-content`},m.createElement("div",{className:`${s}-title`},a)),c!==d-1&&m.createElement("div",{className:`${s}-icon`},m.createElement(qe,{size:"small"}))))};ue.propTypes={prefixCls:u.string,title:u.node,className:u.string,style:u.object,onClick:u.func,active:u.bool};ue.defaultProps={prefixCls:X.ITEM,active:!1,className:""};const ze=m.createContext(null),lt=n=>{const{type:s}=w.useContext(ze);return(()=>{switch(s){case"fill":return m.createElement(me,Object.assign({},n));case"basic":return m.createElement(pe,Object.assign({},n));case"nav":return m.createElement(ue,Object.assign({},n));default:return null}})()};var it=function(n,s){var t={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&s.indexOf(a)<0&&(t[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,a=Object.getOwnPropertySymbols(n);l<a.length;l++)s.indexOf(a[l])<0&&Object.prototype.propertyIsEnumerable.call(n,a[l])&&(t[a[l]]=n[a[l]]);return t};const he=n=>{const{current:s,status:t,children:a,prefixCls:l,initial:i,direction:c,className:d,style:o,onChange:p}=n,h=it(n,["current","status","children","prefixCls","initial","direction","className","style","onChange"]),x=w.useMemo(()=>{const C=w.Children.toArray(a).filter(y=>w.isValidElement(y)),b=c==="vertical"?null:{width:`${100/C.length}%`};return w.Children.map(C,(y,f)=>{if(!y)return null;const j=i+f,v=Object.assign({stepNumber:`${j+1}`,direction:c},y.props);return t==="error"&&f===s-1&&(v.className=`${l}-next-error`),y.props.status||(j===s?v.status=t:j<s?v.status="finish":v.status="wait"),v.onChange=p?()=>{f!==s&&p(f+i)}:void 0,m.createElement(at,{style:b},w.cloneElement(y,Object.assign({},v)))})},[a,i,l,c,t,s,p]),S=I(d,{[l]:!0,[`${l}-${c}`]:!0});return m.createElement("div",Object.assign({className:S,style:o,"aria-label":n["aria-label"]},de(h)),m.createElement(nt,{type:"flex",justify:"start"},x))};he.propTypes={prefixCls:u.string,className:u.string,style:u.object,current:u.number,initial:u.number,direction:u.oneOf(["horizontal","vertical"]),status:u.oneOf(["wait","process","finish","error","warning"])};he.defaultProps={prefixCls:X.PREFIX,current:0,direction:"horizontal",initial:0,status:"process"};var ot=function(n,s){var t={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&s.indexOf(a)<0&&(t[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,a=Object.getOwnPropertySymbols(n);l<a.length;l++)s.indexOf(a[l])<0&&Object.prototype.propertyIsEnumerable.call(n,a[l])&&(t[a[l]]=n[a[l]]);return t};const fe=n=>{const{size:s,current:t,status:a,children:l,prefixCls:i,initial:c,direction:d,className:o,style:p,hasLine:h,onChange:x}=n,S=ot(n,["size","current","status","children","prefixCls","initial","direction","className","style","hasLine","onChange"]),C=w.useMemo(()=>{const g=w.Children.toArray(l).filter(f=>w.isValidElement(f));return w.Children.map(g,(f,j)=>{if(!f)return null;const v=c+j,E=Object.assign({stepNumber:`${v+1}`,size:s},f.props);return a==="error"&&j===t-1&&(E.className=`${i}-next-error`),f.props.status||(v===t?E.status=a:v<t?E.status="finish":E.status="wait"),E.active=v===t,E.done=v<t,E.onChange=x?()=>{j!==t&&x(j+c)}:void 0,w.cloneElement(f,Object.assign({},E))})},[l,c,i,d,a,t,s,x]),b=I(o,{[`${i}-basic`]:!0,[`${i}-${d}`]:!0,[`${i}-${s}`]:s!=="default",[`${i}-hasline`]:h});return m.createElement("div",Object.assign({"aria-label":n["aria-label"],className:b,style:p},de(S)),C)};fe.propTypes={prefixCls:u.string,className:u.string,style:u.object,current:u.number,initial:u.number,direction:u.oneOf(["horizontal","vertical"]),status:u.oneOf(["wait","process","finish","error","warning"]),hasLine:u.bool};fe.defaultProps={prefixCls:X.PREFIX,current:0,direction:"horizontal",size:"",initial:0,hasLine:!0,status:"process"};var ct=function(n,s){var t={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&s.indexOf(a)<0&&(t[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,a=Object.getOwnPropertySymbols(n);l<a.length;l++)s.indexOf(a[l])<0&&Object.prototype.propertyIsEnumerable.call(n,a[l])&&(t[a[l]]=n[a[l]]);return t};const ge=n=>{const{size:s,current:t,initial:a,children:l,prefixCls:i,className:c,style:d,onChange:o}=n,p=ct(n,["size","current","initial","children","prefixCls","className","style","onChange"]),h=w.useMemo(()=>{const S=w.Children.toArray(l).filter(g=>w.isValidElement(g)),C=S.length;return w.Children.map(S,(g,y)=>{if(!g)return null;const f=Object.assign({index:y,total:C},g.props);return f.active=y===t,f.onChange=o?()=>{y!==t&&o(y+a)}:void 0,w.cloneElement(g,Object.assign({},f))})},[l,i,t,s,a,o]),x=I(c,{[`${i}-nav`]:!0,[`${i}-${s}`]:s!=="default"});return m.createElement("div",Object.assign({"aria-label":n["aria-label"],className:x,style:d},de(p)),h)};ge.propTypes={prefixCls:u.string,className:u.string,style:u.object,current:u.number,initial:u.number,size:u.oneOf(["small","default"])};ge.defaultProps={prefixCls:X.PREFIX,current:0,direction:"horizontal",size:"default",initial:0,status:"process"};var dt=function(n,s){var t={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&s.indexOf(a)<0&&(t[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,a=Object.getOwnPropertySymbols(n);l<a.length;l++)s.indexOf(a[l])<0&&Object.prototype.propertyIsEnumerable.call(n,a[l])&&(t[a[l]]=n[a[l]]);return t};class D extends w.Component{renderComponent(){const s=this.props,{type:t}=s,a=dt(s,["type"]);switch(t){case"fill":return m.createElement(he,Object.assign({},a));case"basic":return m.createElement(fe,Object.assign({},a));case"nav":return m.createElement(ge,Object.assign({},a));default:return null}}render(){const{type:s}=this.props;return m.createElement(ze.Provider,{value:{type:s}},this.renderComponent())}}D.Step=lt;D.propTypes={onChange:u.func,type:u.oneOf(["fill","basic","nav"]),size:u.oneOf(["small","default"])};D.defaultProps={type:"fill",size:"default"};class we extends Fe{constructor(s){super(Object.assign(Object.assign({},we.defaultAdapter),s)),this.handleMouseInSideChange=t=>{this._adapter.handleMouseInSideChange(t)},this.getInputWrapperRect=()=>this._adapter.getInputWrapperRect()}hasToast(s){return this._adapter.getState("list").map(a=>{let{id:l}=a;return l}).includes(s)}addToast(s){const t=this._adapter.getState("list");t.push(s),this._adapter.updateToast(t,[],[])}updateToast(s,t){let a=this._adapter.getState("list");a=a.map(i=>i.id===s?Object.assign(Object.assign({},i),t):i);const l=a.filter(i=>i.id===s);this._adapter.updateToast(a,[],l)}removeToast(s){let t=this._adapter.getState("list");const a=[];t=t.filter(l=>l.id===s?(a.push(l),!1):!0),this._adapter.updateToast(t,a,[])}destroyAll(){const s=this._adapter.getState("list");s.length>0&&this._adapter.updateToast([],s,[])}}const ke=`${ae}-toast`,B={PREFIX:ke,WRAPPER:`${ke}-wrapper`},V={types:["warning","success","info","error","default"],themes:["normal","light"],directions:["ltr","rtl"]},pt={duration:3};class xe extends Fe{constructor(s){super(Object.assign(Object.assign({},xe.defaultAdapter),s)),this._timer=null,this._id=null}init(){this.startCloseTimer_(),this._id=this._adapter.getProp("id")}destroy(){this.clearCloseTimer_()}startCloseTimer_(){const s=this._adapter.getProp("duration");s&&Xe(s)&&(this._timer=setTimeout(()=>{this.close()},s*1e3))}close(s){s&&s.stopPropagation(),this._adapter.notifyWrapperToRemove(this._id),this._adapter.notifyClose()}clearCloseTimer_(){this._timer&&(clearTimeout(this._timer),this._timer=null)}restartCloseTimer(){this.clearCloseTimer_(),this.startCloseTimer_()}}const R=B.PREFIX;let L=class extends Me{constructor(s){super(s),this.toastEle=m.createRef(),this.clearCloseTimer=()=>{this.foundation.clearCloseTimer_()},this.startCloseTimer=()=>{this.foundation.startCloseTimer_()},this.restartCloseTimer=()=>{this.foundation.restartCloseTimer()},this.state={},this.foundation=new xe(this.adapter)}get adapter(){return Object.assign(Object.assign({},super.adapter),{notifyWrapperToRemove:s=>{this.props.close(s)},notifyClose:()=>{this.props.onClose()}})}componentDidMount(){this.foundation.init()}componentWillUnmount(){this.foundation.destroy()}close(s){this.foundation.close(s)}renderIcon(){const{type:s,icon:t}=this.props,l={warning:m.createElement(ie,null),success:m.createElement(oe,null),info:m.createElement(Ve,null),error:m.createElement(ce,null)}[s],i="large",c=I(`${R}-icon`,`${R}-icon-${s}`);return t?He(t)?m.cloneElement(t,{size:i,className:`${R}-icon`}):t:s&&l?m.cloneElement(l,{size:i,className:c}):null}render(){const{content:s,type:t,theme:a,showClose:l,textMaxWidth:i,className:c,style:d}=this.props,o=this.props.direction||this.context.direction,p=I(R,c,{[`${R}-${t}`]:!0,[`${R}-${a}`]:a==="light",[`${R}-rtl`]:o==="rtl"}),h={};h.maxWidth=i;const x="borderless",S="small",C=this.props.positionInList?this.props.positionInList.length-this.props.positionInList.index-1:0,b=m.createElement("div",{ref:this.toastEle,role:"alert","aria-label":`${t||"default"} type`,className:p,style:Object.assign(Object.assign({},d),{transform:`translate3d(0,0,${C*-10}px)`}),onMouseEnter:this.clearCloseTimer,onMouseLeave:this.startCloseTimer,onAnimationStart:this.props.onAnimationStart,onAnimationEnd:this.props.onAnimationEnd},m.createElement("div",{className:`${R}-content`},this.renderIcon(),m.createElement("span",{className:`${R}-content-text`,style:h,"x-semi-prop":"content"},s),l&&m.createElement("div",{className:`${R}-close-button`},m.createElement(Ge,{onClick:g=>this.close(g),type:"tertiary",icon:m.createElement(Ue,{"x-semi-prop":"icon"}),theme:x,size:S}))));if(this.props.stack){const g=this.props.stackExpanded&&this.toastEle.current&&getComputedStyle(this.toastEle.current).height||0;return m.createElement("div",{className:`${R}-zero-height-wrapper`,style:{height:g}},b)}else return b}};L.contextType=Ke;L.propTypes={onClose:u.func,content:u.node,close:u.func,duration:u.number,theme:u.oneOf(V.themes),type:u.oneOf(V.types),textMaxWidth:u.oneOfType([u.string,u.number]),style:u.object,className:u.string,showClose:u.bool,stack:u.bool,stackExpanded:u.bool,icon:u.node,direction:u.oneOf(V.directions)};L.__SemiComponentName__="Toast";L.defaultProps=Qe(L.__SemiComponentName__,{onClose:ne,content:"",close:ne,duration:pt.duration,textMaxWidth:450,showClose:!0,stack:!1,stackExpanded:!1,theme:"normal"});var mt=function(n,s){var t={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&s.indexOf(a)<0&&(t[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,a=Object.getOwnPropertySymbols(n);l<a.length;l++)s.indexOf(a[l])<0&&Object.prototype.propertyIsEnumerable.call(n,a[l])&&(t[a[l]]=n[a[l]]);return t};const ut=(n,s)=>{var{afterClose:t}=n,a=mt(n,["afterClose"]);const[l,i]=w.useState(!0),c=()=>{i(!1)};return m.useImperativeHandle(s,()=>({close:()=>{i(!1)}})),w.useEffect(()=>{l||t(a.id)},[l]),l?m.createElement(L,Object.assign({},a,{close:c})):null},ht=m.forwardRef(ut),G={motion:!0,zIndex:1010,duration:3};function ft(){const[n,s]=m.useState([]);function t(a,l){return s(i=>[{element:a,config:l},...i]),i=>{s(c=>c.filter(d=>{let{config:o}=d;return o.id!==i}))}}return[n,t]}function gt(){const[n,s]=ft(),t=w.useRef(new Map),a=i=>{const c=re("semi_toast_"),d=Object.assign(Object.assign({},i),{id:c});let o;const p=m.createElement(ht,Object.assign({},d,{key:c,afterClose:h=>o(h),ref:h=>{var x;t.current.set(c,{close:(x=h?.close)!==null&&x!==void 0?x:ne})}}));return o=s(p,Object.assign({},d)),c},l=i=>{var c;const{close:d}=(c=t.current.get(i))!==null&&c!==void 0?c:{};d?.()};return[{success:i=>a(Object.assign(Object.assign(Object.assign({},G),i),{type:"success"})),info:i=>a(Object.assign(Object.assign(Object.assign({},G),i),{type:"info"})),error:i=>a(Object.assign(Object.assign(Object.assign({},G),i),{type:"error"})),warning:i=>a(Object.assign(Object.assign(Object.assign({},G),i),{type:"warning"})),open:i=>a(Object.assign(Object.assign(Object.assign({},G),i),{type:"default"})),close:i=>l(i)},m.createElement(m.Fragment,null,Array.isArray(n)&&n.length?m.createElement(m.Fragment,null,n.map(i=>i.element)):null)]}const wt=()=>{var n;return n=class k extends Me{constructor(t){super(t),this.stack=!1,this.innerWrapperRef=m.createRef(),this.handleMouseEnter=a=>{this.stack&&this.foundation.handleMouseInSideChange(!0)},this.handleMouseLeave=a=>{var l;this.stack&&!((l=this.foundation.getInputWrapperRect())===null||l===void 0)&&l.height&&this.foundation.handleMouseInSideChange(!1)},this.state={list:[],removedItems:[],updatedItems:[],mouseInSide:!1},this.foundation=new we(this.adapter)}get adapter(){return Object.assign(Object.assign({},super.adapter),{updateToast:(t,a,l)=>{this.setState({list:t,removedItems:a,updatedItems:l})},handleMouseInSideChange:t=>{this.setState({mouseInSide:t})},getInputWrapperRect:()=>{var t;return(t=this.innerWrapperRef.current)===null||t===void 0?void 0:t.getBoundingClientRect()}})}static create(t){var a;const l=(a=t.id)!==null&&a!==void 0?a:re("toast");if(k.ref){const i=document.querySelector(`#${this.wrapperId}`);["top","left","bottom","right"].map(c=>{c in t&&(i.style[c]=typeof t[c]=="number"?`${t[c]}px`:t[c])}),!!t.stack!==k.ref.stack&&(k.ref.stack=!!t.stack),k.ref.has(l)?k.ref.update(l,Object.assign(Object.assign({},t),{id:l})):k.ref.add(Object.assign(Object.assign({},t),{id:l}))}else{const i=document.createElement("div");this.wrapperId||(this.wrapperId=re("toast-wrapper").slice(0,26)),i.className=B.WRAPPER,i.id=this.wrapperId,i.style.zIndex=String(typeof t.zIndex=="number"?t.zIndex:k.defaultOpts.zIndex),["top","left","bottom","right"].map(c=>{if(c in k.defaultOpts||c in t){const d=t[c]?t[c]:k.defaultOpts[c];i.style[c]=typeof d=="number"?`${d}px`:d}}),k.defaultOpts.getPopupContainer?k.defaultOpts.getPopupContainer().appendChild(i):document.body.appendChild(i),ve.render(m.createElement(k,{ref:c=>k.ref=c}),i,()=>{k.ref.add(Object.assign(Object.assign({},t),{id:l})),k.ref.stack=!!t.stack})}return l}static close(t){k.ref&&k.ref.remove(t)}static destroyAll(){if(k.ref){k.ref.destroyAll();const t=document.querySelector(`#${this.wrapperId}`);ve.unmountComponentAtNode(t),t&&t.parentNode.removeChild(t),k.ref=null,this.wrapperId=null}}static getWrapperId(){return this.wrapperId}static info(t){return typeof t=="string"&&(t={content:t}),this.create(Object.assign(Object.assign(Object.assign({},k.defaultOpts),t),{type:"info"}))}static warning(t){return typeof t=="string"&&(t={content:t}),this.create(Object.assign(Object.assign(Object.assign({},k.defaultOpts),t),{type:"warning"}))}static error(t){return typeof t=="string"&&(t={content:t}),this.create(Object.assign(Object.assign(Object.assign({},k.defaultOpts),t),{type:"error"}))}static success(t){return typeof t=="string"&&(t={content:t}),this.create(Object.assign(Object.assign(Object.assign({},k.defaultOpts),t),{type:"success"}))}static config(t){["top","left","bottom","right"].forEach(a=>{a in t&&(k.defaultOpts[a]=t[a])}),typeof t.theme=="string"&&V.themes.includes(t.theme)&&(k.defaultOpts.theme=t.theme),typeof t.zIndex=="number"&&(k.defaultOpts.zIndex=t.zIndex),typeof t.duration=="number"&&(k.defaultOpts.duration=t.duration),typeof t.getPopupContainer=="function"&&(k.defaultOpts.getPopupContainer=t.getPopupContainer)}has(t){return this.foundation.hasToast(t)}add(t){return this.foundation.addToast(t)}update(t,a){return this.foundation.updateToast(t,a)}remove(t){return this.foundation.removeToast(t)}destroyAll(){return this.foundation.destroyAll()}render(){let{list:t}=this.state;const{removedItems:a,updatedItems:l}=this.state;t=Array.from(new Set([...t,...a]));const i=l.map(d=>{let{id:o}=d;return o}),c=d=>{var o;!((o=d?.foundation)===null||o===void 0)&&o._id&&i.includes(d.foundation._id)&&d.foundation.restartCloseTimer()};return m.createElement(m.Fragment,null,m.createElement("div",{className:I({[`${B.PREFIX}-innerWrapper`]:!0,[`${B.PREFIX}-innerWrapper-hover`]:this.state.mouseInSide}),ref:this.innerWrapperRef,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},t.map((d,o)=>{const p=a.find(h=>h.id===d.id)!==void 0;return m.createElement(Ze,{key:d.id,motion:d.motion,animationState:p?"leave":"enter",startClassName:p?`${B.PREFIX}-animation-hide`:`${B.PREFIX}-animation-show`},h=>{let{animationClassName:x,animationEventsNeedBind:S,isAnimating:C}=h;return p&&!C?null:m.createElement(L,Object.assign({},d,{stack:this.stack,stackExpanded:this.state.mouseInSide,positionInList:{length:t.length,index:o},className:I({[d.className]:!!d.className,[x]:!0})},S,{style:Object.assign({},d.style),close:b=>this.remove(b),ref:c}))})})))}},n.defaultOpts={motion:!0,zIndex:1010,content:""},n.propTypes={content:u.node,duration:u.number,onClose:u.func,icon:u.node,direction:u.oneOf(V.directions),stack:u.bool},n.defaultProps={},n};class xt{static create(s){const t=wt();return t.useToast=gt,s&&t.config(s),t}}const le=xt.create();const bt=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],jt=K("check",bt);const yt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Ne=K("circle-alert",yt);const vt=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],St=K("cloud",vt);const Ct=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],kt=K("cpu",Ct);const Nt=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],_t=K("workflow",Nt),M={Idle:0,WasmPreparing:1,WasmPrepared:2,WasmSplitIssued:3,WasmSplitting:4,WasmSplitDone:5,WasmReadyToPrepare:6,WasmSplitPreparing:7,WasmPreparedSuccess:8,WasmCollecting:9,WasmUploadFail:-1,WasmDownloadFail:-2,WasmFileNotExist:-3,WasmSplitFail:-4,WasmSplitUpdateDBFail:-5,WasmSplitPrepareFail:-6,WasmPrepareFailed:-1};function _e({codeMd5:n,clientKey:s}){return $({url:"/game/wasm-split-config",method:"GET",data:{codeMd5:n,clientKey:s}})}function Et(n){const{codePath:s,codeMd5:t,clientKey:a,desc:l}=n;return $({url:"/game/wasm-prepare",method:"POST",data:{codePath:s,clientKey:a,codeMd5:t,desc:l}})}function Ot({codeMd5:n,clientKey:s}){return $({url:"/game/wasm-prepare-result",method:"POST",data:{codeMd5:n,clientKey:s}})}function $t(n,s){const t=s?.intervalMs,a=s?.maxAttempts,l=s?.signal||new AbortController().signal;let i=0;return new Promise((c,d)=>{if(l?.aborted){d(new DOMException("Polling aborted","AbortError"));return}const o=()=>{clearTimeout(p),d(new DOMException("Polling aborted","AbortError"))};l?.addEventListener("abort",o,{once:!0});let p;const h=async()=>{i+=1;try{const x=await Ot(n),{status:S}=x.data;if(S===M.WasmPreparedSuccess||S===M.WasmSplitDone){c(x);return}if(S<0){c(x);return}if(i>=a){d(new Error(`Polling timeout after ${a} attempts`));return}p=window.setTimeout(h,t)}catch(x){if(i>=a){d(x);return}p=window.setTimeout(h,t)}};h()})}function Pt({codeMd5:n,clientKey:s,codePath:t}){return $({url:"/game/wasm-prepare-download",method:"POST",data:{codeMd5:n,clientKey:s,codePath:t}})}function Ee(n){const{codeMd5:s,clientKey:t,archive:a}=n;return $({url:"/game/wasm-split",method:"POST",data:{codeMd5:s,clientKey:t,archive:a??!1}})}function Tt({codeMd5:n,clientKey:s}){return $({url:"/game/wasm-split-result",method:"POST",data:{codeMd5:n,clientKey:s}})}function It(n,s){const t=s?.intervalMs,a=s?.maxAttempts,l=s?.signal||new AbortController().signal;let i=0;return new Promise((c,d)=>{if(l?.aborted){d(new DOMException("Polling aborted","AbortError"));return}const o=()=>{clearTimeout(p),d(new DOMException("Polling aborted","AbortError"))};l?.addEventListener("abort",o,{once:!0});let p;const h=async()=>{i+=1;try{const x=await Tt(n),{status:S}=x.data;if(S!==M.WasmSplitDone){if(i>=a){d(new Error(`Polling timeout after ${a} attempts`));return}p=window.setTimeout(h,t);return}c(x)}catch(x){if(i>=a){d(x);return}p=window.setTimeout(h,t)}};h()})}function Rt({codeMd5:n,clientKey:s}){return $({url:"/game/wasm-split-download-result",method:"POST",data:{clientKey:s,codeMd5:n}})}function Oe(n){return $({url:"/game/wasm-split-download",method:"POST",data:n})}function De(n){const{codeMd5:s,clientKey:t,codePath:a}=n;return $({url:"/game/wasm-split-reset",method:"POST",data:{codeMd5:s,clientKey:t,codePath:a}})}function Ft({codeMd5:n,clientKey:s}){return $({url:"/game/wasm-taskinfo",method:"GET",data:{codeMd5:n,clientKey:s}})}function Mt({codeMd5:n,clientKey:s}){return $({url:"/game/wasm-collect-start",method:"POST",data:{codeMd5:n,clientKey:s}})}function Wt({codeMd5:n,clientKey:s}){return $({url:"/game/wasm-set-collect",method:"POST",data:{codeMd5:n,clientKey:s}})}function $e(n){return $({url:"/game/wasm-collect-funcids",method:"GET",data:n})}function zt(n){return $({url:"/game/wasm-collect-info",method:"GET",data:n})}function Pe(n){return $({url:"/game/pipeline-mode",method:"POST",data:{mode:n}})}const Dt=({onSubmit:n,onCancel:s,onChange:t})=>e.jsxs(Ce,{style:{width:"100%"},onChange:t,onSubmit:n,children:[e.jsx(Ce.TextArea,{rules:[{required:!0,message:r("inputSplitDesc")}],label:r("splitDesc"),placeholder:r("inputSplitDesc"),field:"desc"}),e.jsxs("div",{className:"wasm-prepare-form-button-container",children:[e.jsx(N,{type:"primary",htmlType:"submit",style:{marginRight:12},children:r("startPrepare")}),e.jsx(N,{type:"tertiary",onClick:s,children:r("cancel")})]})]}),O={init:"init",start:"start",processing:M.WasmPreparing,processingReady:M.WasmReadyToPrepare,success:M.WasmPreparedSuccess,failed:M.WasmPrepareFailed,splitDone:M.WasmSplitDone},At=({codePath:n,codeMd5:s,clientKey:t,onCancel:a,onNext:l,onHide:i})=>{const[c,d]=w.useState(""),[o,p]=w.useState({code:0,data:{status:O.init}}),h=w.useRef(null),x=w.useMemo(()=>o?.data?.status,[o?.data?.status]),S=()=>{h.current?.abort(),a(),De({codeMd5:s,clientKey:t,codePath:n}).then(f=>{f.code===0&&p({...o,data:{...o?.data,status:O.init}})})},C=async()=>{h.current=new AbortController,p({code:0,data:{status:O.start}}),Et({codePath:n,codeMd5:s,clientKey:t,desc:c}).then(f=>{f.code===0||f?.error?.code===10024||f?.error?.code===10028?(p({...f,data:{...f?.data,status:O.processing}}),b()):p({...o,error:f?.error||{code:-1,message:"Internal server error, please try again later..."},data:{...o?.data,status:O.failed}})})},b=()=>{$t({codeMd5:s,clientKey:t},{intervalMs:2e3,maxAttempts:240,signal:h.current?.signal}).then(f=>{f.code===0?Pt({codeMd5:s,clientKey:t,codePath:n}).then(j=>{j.code===0?l():p({...o,error:{code:-1,message:j?.error?.message||"Download prepared wasm failed"},data:{...o?.data,status:O.failed}})}).catch(j=>{p({...o,error:{code:-1,message:j?.message||"Download prepared wasm failed"},data:{...o?.data,status:O.failed}})}):p({...o,data:{...o?.data,status:O.failed}})}).catch(f=>{f?.name!=="AbortError"&&p(j=>({...j,error:{code:-1,message:f?.message||"Polling failed"},data:{...j?.data,status:O.failed}}))})},g=f=>{d(f?.values?.desc)};let y=null;switch(x){case O.init:y=e.jsx(Dt,{onSubmit:C,onCancel:a,onChange:g});break;case O.start:y=e.jsxs("div",{className:"wasm-prepare-processing-content",children:[e.jsx("div",{className:"wasm-prepare-processing-spinner",role:"status","aria-label":r("startingPrepare")}),e.jsx("div",{className:"wasm-prepare-processing-text",children:r("startingPrepare")}),e.jsxs("div",{className:"wasm-prepare-processing-cancel",children:[e.jsx(N,{type:"tertiary",onClick:a,children:r("cancelPrepare")}),e.jsx(N,{type:"primary",onClick:()=>i(),children:r("backgroundRun")})]})]});break;case O.processing:case O.processingReady:y=e.jsxs("div",{className:"wasm-prepare-processing-content",children:[e.jsx("div",{className:"wasm-prepare-processing-spinner",role:"status","aria-label":r("preparingSplit")}),e.jsx("div",{className:"wasm-prepare-processing-text",children:r("preparingSplit")}),e.jsx("div",{className:"wasm-prepare-processing-warning",children:r("warningDuringPreparing")}),e.jsxs("div",{className:"wasm-prepare-processing-cancel",children:[e.jsx(N,{type:"tertiary",onClick:()=>{S()},children:r("cancelPrepare")}),e.jsx(N,{type:"primary",onClick:()=>i(),children:r("backgroundRun")})]})]});break;case O.success:case O.splitDone:break;case O.failed:const f=o?.error?.message||"Unknown error";y=e.jsxs("div",{className:"wasm-prepare-failed-content",children:[e.jsx("div",{className:"wasm-prepare-failed-text",children:r("preparingSplitFailed")}),o?.data?.status===O.failed&&e.jsx("div",{className:"wasm-prepare-failed-warning",children:f}),e.jsx(N,{type:"tertiary",style:{marginTop:12},onClick:C,children:r("retryPrepare")})]});break;default:y=null}return e.jsx("div",{className:"wasm-prepare-content-container",children:y})},Lt=({data:n})=>{const s={...n||{}},t=[{label:"Client key",value:"app_id"},{label:r("wasmSize"),value:"wasm_size",render:a=>`${(a/1024/1024).toFixed(2)} MB`},{label:r("totalFuncCount"),value:"total_wasm_func_count",render:a=>a>=1e3?`${(a/1e3).toFixed(2)} K`:`${a}`},{label:r("collectedFuncCount"),value:"collected_func_count",render:a=>a>=1e3?`${(a/1e3).toFixed(2)} K`:`${a}`},{label:"Wasm md5",value:"wasm_md5"}];return e.jsx("div",{className:"wasm-collect-status",children:t.map(a=>e.jsxs("div",{className:"wasm-collect-status-item",children:[e.jsx(Ye,{size:"small",className:"wasm-collect-status-item-label",children:a.label}),e.jsx("span",{className:"wasm-collect-status-item-value",children:a.render?.(s[a.value])||s[a.value]})]},a.value))})},Bt=({onNext:n,onCancel:s,codeMd5:t,clientKey:a,onHide:l,pipelineMode:i="local"})=>{const c=i==="remote",{state:{devSchema:d}}=We(),[o,p]=w.useState("startCollect"),[h,x]=w.useState(),[S,C]=w.useState(),[b,g]=w.useState(0),y=w.useRef(null),f=w.useRef(!1),j=w.useRef(!1),v=.08,E=w.useMemo(()=>{if(!S)return!1;const T=S?.total_wasm_func_count;return T?b/T>=v:!1},[S,b]);w.useEffect(()=>{if(o!=="collecting"){y.current&&(window.clearInterval(y.current),y.current=null);return}if(y.current)return;const T=P=>{g(P.data?.collected_func_count||0);const W=P.data?.collect_state;W==="closed"&&!f.current?(f.current=!0,le.warning({content:r("collect.sessionClosed"),duration:5})):W==="open"&&(f.current=!1)};return $e({codeMd5:t,clientKey:a}).then(T).catch(console.error),y.current=window.setInterval(()=>{$e({codeMd5:t,clientKey:a}).then(T).catch(P=>{console.error(P)})},2e3),()=>{y.current&&(window.clearInterval(y.current),y.current=null)}},[o,t,a]);const F=async()=>{if(o!=="collecting")try{if(p("startCollect"),(await Mt({codeMd5:t,clientKey:a})).code!==0){p("willCollect");return}Wt({codeMd5:t,clientKey:a}).catch(console.error),p("collecting"),Ft({codeMd5:t,clientKey:a}).then(P=>{x(P.data)}).catch(console.error),zt({codeMd5:t,clientKey:a}).then(P=>{C(P.data||{})}).catch(console.error)}catch(T){console.error(T),le.error({content:r("collect.startFailed"),duration:4}),p("willCollect")}};w.useEffect(()=>{j.current||(j.current=!0,F())},[]);const H=()=>{y.current&&(window.clearInterval(y.current),y.current=null),p("willCollect"),n()};return e.jsxs("div",{className:"wasm-collect-content-container",children:[o!=="willCollect"&&(h?e.jsx(Lt,{data:{...h||{},total_wasm_func_count:S?.total_wasm_func_count,collected_func_count:b}}):e.jsxs("div",{className:"wasm-collect-status-loading",children:[e.jsx(A,{size:"middle"}),e.jsx("span",{className:"wasm-collect-status-loading-text",children:r("startingCollect")})]})),e.jsx("div",{className:"collect-qrcode-container",children:e.jsx(Je,{value:d})}),e.jsx("div",{className:"collect-qrcode-desc",children:r("collectDesc")}),e.jsxs("div",{className:"collect-qrcode-button-container",children:[o==="willCollect"&&e.jsxs(e.Fragment,{children:[e.jsx(N,{type:"primary",onClick:F,children:r("startCollect")}),e.jsx(N,{type:"tertiary",onClick:s,children:r("cancelSplit")})]}),o!=="willCollect"&&e.jsxs(e.Fragment,{children:[c&&(E?e.jsx(N,{type:"primary",onClick:H,children:r("startSplit")}):e.jsx(et,{content:r("cannotSplitTip"),children:e.jsx(N,{type:"primary",disabled:!0,children:r("startSplit")})})),e.jsx(N,{type:"tertiary",onClick:l,children:r("backgroundRun")}),e.jsx(N,{type:"tertiary",onClick:s,children:r("cancelSplit")})]})]})]})},Te=({onCancel:n,onRetry:s,onHide:t,forcedStatus:a,forcedErrorMsg:l})=>{const[i,c]=w.useState(""),[d,o]=w.useState("");w.useEffect(()=>{const b=g=>{c(g.status),o(g.errorMsg||"")};return Z.on("unitySplitStatus",b),()=>{Z.off("unitySplitStatus",b)}},[]);const p="wasm-split-downloading-content",h="wasm-split-downloading-text",x=a||i,S=l||d;let C=null;switch(x){case"start_download_android_main_wasm":case"download_android_main_wasm_done":case"start_compress_android_main_wasm":case"compress_android_main_wasm_done":case"start_download_android_sub_wasm_code":case"download_android_sub_wasm_code_done":case"start_compress_android_sub_wasm_code":case"compress_android_sub_wasm_code_done":case"start_download_ios_main_wasm":case"download_ios_main_wasm_done":case"start_compress_ios_main_wasm":case"compress_ios_main_wasm_done":case"start_download_ios_range_json":case"download_ios_range_json_done":case"start_download_ios_js_data_br":case"download_ios_js_data_br_done":case"start_compress_ios_sub_wasm_code":case"compress_ios_sub_wasm_code_done":case"start_write_splited_wasm_br":case"write_splited_wasm_done":case"start_update_wasm_split_config":case"update_wasm_split_config_done":C=e.jsxs("div",{className:p,children:[e.jsx(A,{size:"large",color:"primary"}),e.jsx("div",{className:h,children:r(x)}),e.jsxs(q,{children:[e.jsx(N,{type:"danger",onClick:n,children:r("cancelSplit")}),e.jsx(N,{onClick:t,children:r("backgroundRun")})]})]});break;case"wasm_split_failed":C=e.jsxs("div",{className:p,children:[e.jsx("div",{className:h,children:r("downloadSplitResultFailed")}),S?e.jsx("div",{className:h,children:S}):null,e.jsxs(q,{children:[e.jsx(N,{type:"primary",onClick:s,children:r("retryDownloadSplitResult")}),e.jsx(N,{type:"danger",onClick:n,children:r("cancelSplit")}),e.jsx(N,{onClick:t,children:r("backgroundRun")})]})]});break;default:C=e.jsxs("div",{className:p,children:[e.jsx(A,{size:"large",color:"primary"}),e.jsx("div",{className:h,children:r("processing")})]})}return C},qt=({onCancel:n,onHide:s,codeMd5:t,clientKey:a,archive:l,pipelineMode:i="local"})=>{const c=i==="local",[d,o]=w.useState("spliting"),[p,h]=w.useState(""),[x,S]=w.useState(),C=()=>{o("spliting"),h(""),Ee({codeMd5:t,clientKey:a,archive:l}).then(j=>{if(j.code===0){const v=j.data?.func_count;return o("writing"),Oe({}).then(E=>{E.code===0?(o("success"),typeof v=="number"&&v>0&&le.success({content:r("wasmSplit.splitDoneToast",{count:String(v)}),duration:3})):(h(E?.error?.errorMsg||E?.msg||r("splitFailed")),o("writeFailed"))})}else h(j?.error?.message||j?.msg||r("splitFailed")),o("splitFailed")}).catch(j=>{h(j?.message||r("splitFailed")),o("splitFailed")})},b=()=>{o("spliting"),h(""),Ee({codeMd5:t,clientKey:a,archive:l}).then(j=>{if(j.code===0)return o("remotePolling"),It({codeMd5:t,clientKey:a},{intervalMs:1e3,maxAttempts:1e3}).then(()=>(o("remoteFetchingResult"),Rt({clientKey:a,codeMd5:t}).then(v=>{v.code===0?(S(v.data),o("remoteReadyToDownload")):(h(r("getSplitResultFailed")),o("splitFailed"))})));h(j?.error?.message||j?.msg||r("splitFailed")),o("splitFailed")}).catch(j=>{h(j?.message||r("splitFailed")),o("splitFailed")})},g=()=>{o("remoteDownloading"),h(""),Oe(x?.result).then(j=>{j.code===0?o("success"):(h(j?.error?.errorMsg||j?.msg||r("downloadSplitResultFailed")),o("remoteDownloadFailed"))}).catch(j=>{h(j?.message||r("downloadSplitResultFailed")),o("remoteDownloadFailed")})},y=c?C:b;w.useEffect(()=>{y()},[]);let f=null;switch(d){case"spliting":f=e.jsxs("div",{className:"wasm-split-processing",children:[e.jsx(A,{size:"large",color:"primary"}),e.jsx("div",{className:"wasm-split-processing-content",children:r("splittingDesc")}),e.jsx("div",{className:"wasm-split-processing-cancel",children:e.jsxs(q,{children:[e.jsx(N,{onClick:()=>n(),type:"danger",children:r("cancelSplit")}),e.jsx(N,{onClick:()=>s(),children:r("backgroundRun")})]})})]});break;case"writing":f=e.jsxs("div",{className:"wasm-split-processing",children:[e.jsx(A,{size:"large",color:"primary"}),e.jsx("div",{className:"wasm-split-processing-content",children:r("writingSplitResult")||"正在写入分包产物..."})]});break;case"splitFailed":case"writeFailed":f=e.jsxs("div",{className:"wasm-split-failed",children:[e.jsx("div",{className:"wasm-split-failed-content",children:p||r("splitFailed")}),e.jsx("div",{className:"wasm-split-failed-retry",children:e.jsxs(q,{children:[e.jsx(N,{type:"primary",onClick:()=>y(),children:r("retry")||"重试"}),e.jsx(N,{type:"tertiary",onClick:()=>n(),children:r("cancelSplit")})]})})]});break;case"remotePolling":case"remoteFetchingResult":f=e.jsxs("div",{className:"wasm-split-processing",children:[e.jsx(A,{size:"large",color:"primary"}),e.jsx("div",{className:"wasm-split-processing-content",children:d==="remotePolling"?r("splittingDesc"):r("getSplitResult")||"获取分包结果..."}),e.jsx("div",{className:"wasm-split-processing-cancel",children:e.jsxs(q,{children:[e.jsx(N,{onClick:()=>n(),type:"danger",children:r("cancelSplit")}),e.jsx(N,{onClick:()=>s(),children:r("backgroundRun")})]})})]});break;case"remoteReadyToDownload":f=e.jsxs("div",{className:"wasm-split-success",children:[e.jsx("div",{className:"wasm-split-success-content",children:r("splitSuccess")||"分包成功"}),e.jsx("div",{className:"wasm-split-success-download",children:e.jsx(N,{type:"primary",onClick:g,children:r("downloadSplitResult")||"下载分包产物"})})]});break;case"remoteDownloading":f=e.jsx(Te,{onCancel:n,onRetry:g,onHide:s});break;case"remoteDownloadFailed":f=e.jsx(Te,{onCancel:n,onRetry:g,onHide:s,forcedStatus:"wasm_split_failed",forcedErrorMsg:p});break;case"success":f=e.jsxs("div",{className:"wasm-split-success",children:[e.jsx("div",{className:"wasm-split-success-content",children:r("downloadSplitResultSuccess")}),e.jsx("div",{className:"wasm-split-success-tip",children:r("downloadSplitResultTip")})]});break;default:f=null}return e.jsx("div",{className:"wasm-split-content-container",children:f})},z={prepare:{number:0,title:r("splitPrepare"),description:r("splitPrepare.desc")},collect:{number:1,title:r("splitCollect"),description:r("splitCollect.desc")},split:{number:2,title:r("splitCode"),description:r("splitCode.desc")},rollback:{number:3,title:r("rollback"),description:""}},Xt=({stage:n})=>e.jsxs(D,{type:"basic",current:z[n].number,className:"tt-wasm-steps",children:[e.jsx(D.Step,{title:z.prepare.title,description:z.prepare.description}),e.jsx(D.Step,{title:z.collect.title,description:z.collect.description}),e.jsx(D.Step,{title:z.split.title,description:z.split.description})]}),Ht=({onCancel:n,errorType:s,onHide:t})=>e.jsxs("div",{className:"wasm-code-split-error",children:[s==="noWasmCode"&&e.jsxs("div",{className:"wasm-code-split-error-container",children:[e.jsx("div",{className:"wasm-code-split-error-title",children:r("noWasmCode")}),e.jsx("div",{className:"wasm-code-split-error-desc",children:r("noWasmCodeDesc")})]}),s==="hasSplited"&&e.jsxs("div",{className:"wasm-code-split-error-container",children:[e.jsx("div",{className:"wasm-code-split-error-title",children:r("hasSplitedTitle")}),e.jsx("div",{className:"wasm-code-split-error-desc",children:r("hasSplitedDesc")}),e.jsxs(q,{children:[e.jsx(N,{onClick:n,children:r("cancelSplit")}),e.jsx(N,{onClick:t,children:r("backgroundRun")})]})]}),s==="noSplitConfig"&&e.jsxs("div",{className:"wasm-code-split-error-container",children:[e.jsx("div",{className:"wasm-code-split-error-title",children:r("noSplitConfigTitle")}),e.jsx("div",{className:"wasm-code-split-error-desc",children:r("noSplitConfigDesc")})]})]}),Ie=()=>e.jsxs("div",{className:"split-loading",children:[e.jsx(A,{size:"large",color:"primary"}),e.jsx("div",{className:"split-loading-text",children:r("wasmSplit.initializingEnv")})]}),Gt=({codeMd5:n,clientKey:s,codePath:t,onHide:a,onReset:l})=>{const[i,c]=w.useState("rollbacking"),d=()=>{c("rollbacking"),De({codeMd5:n,clientKey:s,codePath:t}).then(h=>{h.code===0?(c("rollbackSuccess"),l()):c("rollbackFailed")})};w.useEffect(()=>{d()},[]);let o="",p=null;switch(i){case"rollbacking":o=r("rollback.rollbacking"),p=e.jsx(N,{onClick:()=>{c("rollbackFailed")},children:r("rollback.backgroundRun")});break;case"rollbackSuccess":o=r("rollback.success"),p=e.jsx(N,{onClick:()=>{a()},children:r("rollback.close")});break;case"rollbackFailed":o=r("rollback.failed"),p=e.jsx(N,{onClick:()=>{d()},children:r("rollback.retry")});break}return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"wasm-split-rollback-container",children:[e.jsx("div",{className:"wasm-split-rollback-text",children:o}),p]})})},Ut=()=>{const[n,s]=w.useState({kind:"idle"}),t=w.useRef(null);if(w.useEffect(()=>{const d=()=>{t.current!==null&&(window.clearTimeout(t.current),t.current=null)},o=({status:p,msg:h,progress:x})=>{switch(p){case"start":d(),s({kind:"uploading",progress:0});break;case"process":d(),s({kind:"uploading",progress:Math.max(0,Math.min(1,x??0))});break;case"success":d(),s({kind:"success"}),t.current=window.setTimeout(()=>{s({kind:"idle"}),t.current=null},2500);break;case"restart":d(),s({kind:"restart"});break;case"error":d(),s({kind:"error",msg:h});break}};return Z.on("uploadGame",o),()=>{Z.off("uploadGame",o),d()}},[]),n.kind==="idle")return null;let a="",l="",i="0%",c="uploading";switch(n.kind){case"uploading":{const d=Math.round(n.progress*100);a=r("uploadStart"),l=`${d}%`,i=`${d}%`,c="uploading";break}case"success":a=r("uploadSuccess"),l="100%",i="100%",c="success";break;case"restart":a=r("uploadStart"),l="",i="0%",c="uploading";break;case"error":a=r("uploadError"),n.msg&&(a=`${a}: ${n.msg}`),l="",i="100%",c="error";break}return e.jsxs("div",{className:`tt-wasm-upload-progress tt-wasm-upload-progress--${c}`,role:"status","aria-live":"polite",title:a,children:[e.jsxs("div",{className:"tt-wasm-upload-progress-meta",children:[e.jsx("span",{className:"tt-wasm-upload-progress-label",children:a}),l&&e.jsx("span",{className:"tt-wasm-upload-progress-percent",children:l})]}),e.jsx("div",{className:"tt-wasm-upload-progress-track",children:e.jsx("div",{className:"tt-wasm-upload-progress-fill",style:{width:i}})})]})};function Vt({enableWasmCollect:n,enableWasmSplit:s}){return typeof n=="boolean"&&(typeof s=="string"||s===!1)?n:!1}function Kt({enableWasmSplit:n,hasWasmCode:s}){return n===!0?{errorType:"hasSplited",hasError:!0}:s?{hasError:!1}:{errorType:"noWasmCode",hasError:!0}}const Qt={loading:"neutral",prepare:"accent",collect:"accent",split:"success",rollback:"warn",error:"error"},Zt=n=>({label:r(`wasmSplit.stage.${n}`),tone:Qt[n]}),Yt=n=>{const s=a=>r(`wasmSplit.help.${n}.${a}`),t={loading:["line1"],prepare:["line1","line2"],collect:["line1","line2"],split:["line1","line2"],rollback:["line1"],error:["line1"]};return{title:s("title"),lines:t[n].map(s)}},Re=({active:n,recommended:s,icon:t,title:a,description:l,onSelect:i})=>e.jsxs("button",{type:"button",className:`tt-wasm-mode-card${n?" tt-wasm-mode-card-active":""}`,onClick:i,"aria-pressed":n,children:[e.jsx("span",{className:"tt-wasm-mode-card-icon",children:t}),e.jsxs("span",{className:"tt-wasm-mode-card-body",children:[e.jsxs("span",{className:"tt-wasm-mode-card-title-row",children:[e.jsx("span",{className:"tt-wasm-mode-card-title",children:a}),s&&e.jsx("span",{className:"tt-wasm-mode-card-badge",children:r("wasmSplit.recommended")})]}),e.jsx("span",{className:"tt-wasm-mode-card-desc",children:l})]}),n&&e.jsx("span",{className:"tt-wasm-mode-card-check","aria-hidden":"true",children:e.jsx(jt,{size:14,strokeWidth:2.5})})]}),cs=()=>{const n=tt(),{state:{engine:s,packages:t,gameDetail:a}}=We(),l=t?.find(_=>_.name==="wasmcode"),i=l?.root||"",c=l?.md5||"",d=l?.size,o=a?.client_key||"",p=a?.name?.trim()||"",x=(_=>typeof _!="number"||_<=0?"":_<1024?`${_} B`:_<1024*1024?`${(_/1024).toFixed(1)} KB`:`${(_/1024/1024).toFixed(2)} MB`)(d),[S,C]=w.useState(""),[b,g]=w.useState("loading"),[y,f]=w.useState(null),[j,v]=w.useState("local"),E=_=>{v(_),Pe(_)},F=a===null,H=!F&&(!c||!o);w.useEffect(()=>{F||H||(g("loading"),_e({codeMd5:c,clientKey:o}).then(_=>{if(_.code===0){const{errorType:J,hasError:ee}=Kt({enableWasmSplit:_.data.enableWasmSplit,hasWasmCode:!!i});ee?(C(J),g("error")):Vt(_.data)?g("collect"):g("prepare"),f(_.data),Pe("local")}else C("noSplitConfig"),g("error")}))},[c,o,i,F,H]);const T=()=>{g("rollback")},P=()=>{n("/")},W=()=>{n("/")},be=(_,J,ee,Be)=>e.jsxs("div",{className:"tt-wasm-split-shell tt-wasm-split-page",children:[e.jsxs("div",{className:"tt-wasm-split-hero-strip",children:[e.jsxs("button",{type:"button",className:"tt-wasm-split-back",onClick:W,children:[e.jsx(se,{size:14,strokeWidth:2}),e.jsx("span",{children:r("back")})]}),e.jsx(te,{title:r("wasmSplit")})]}),e.jsxs(Q,{padding:"lg",className:"tt-wasm-split-empty-card",children:[e.jsx("div",{className:"tt-wasm-split-empty-icon","aria-hidden":"true",children:e.jsx(Ne,{size:24,strokeWidth:1.75})}),e.jsx("h2",{className:"tt-wasm-split-empty-title",children:_}),e.jsx("p",{className:"tt-wasm-split-empty",children:J}),e.jsx("div",{className:"tt-wasm-split-empty-actions",children:e.jsx("button",{type:"button",className:"tt-wasm-split-empty-cta",onClick:()=>n(Be),children:ee})})]})]});if(F)return e.jsxs("div",{className:"tt-wasm-split-shell tt-wasm-split-page",children:[e.jsxs("div",{className:"tt-wasm-split-hero-strip",children:[e.jsxs("button",{type:"button",className:"tt-wasm-split-back",onClick:W,children:[e.jsx(se,{size:14,strokeWidth:2}),e.jsx("span",{children:r("back")})]}),e.jsx(te,{title:r("wasmSplit")})]}),e.jsx(Q,{padding:"lg",children:e.jsx(Ie,{})})]});if(s&&s!=="unity")return be(r("wasmSplit.empty.unityOnly.title"),r("wasmSplit.empty.unityOnly.desc"),r("wasmSplit.empty.backHome"),"/");if(H)return be(r("wasmSplit.empty.needDevice.title"),r("wasmSplit.empty.needDevice.desc"),r("wasmSplit.empty.connectDevice"),"/");const Y=Zt(b),je=Yt(b),Ae=b==="prepare",Le=b==="collect"||b==="split",ye=b!=="error"&&b!=="loading";return e.jsxs("div",{className:"tt-wasm-split-shell tt-wasm-split-page",children:[e.jsxs("div",{className:"tt-wasm-split-hero-strip",children:[e.jsxs("button",{type:"button",className:"tt-wasm-split-back",onClick:W,children:[e.jsx(se,{size:14,strokeWidth:2}),e.jsx("span",{children:r("back")})]}),e.jsx(te,{title:r("wasmSplit"),subtitle:r("wasmSplit.subtitle"),action:e.jsx(st,{tone:Y.tone,withDot:!0,variant:"solid",children:Y.label})})]}),Ae&&e.jsxs("section",{className:"tt-wasm-split-section",children:[e.jsx(Se,{icon:_t,eyebrow:"STEP 0",title:r("wasmSplit.strategy.title"),subtitle:r("wasmSplit.strategy.subtitle")}),e.jsxs("div",{className:"tt-wasm-mode-grid",children:[e.jsx(Re,{active:j==="local",recommended:!0,icon:e.jsx(kt,{size:18,strokeWidth:2}),title:r("wasmSplit.mode.local.title"),description:r("wasmSplit.mode.local.desc"),onSelect:()=>E("local")}),e.jsx(Re,{active:j==="remote",icon:e.jsx(St,{size:18,strokeWidth:2}),title:r("wasmSplit.mode.remote.title"),description:r("wasmSplit.mode.remote.desc"),onSelect:()=>E("remote")})]})]}),e.jsxs("div",{className:"tt-wasm-split-grid",children:[e.jsx("aside",{className:"tt-wasm-split-helper",children:e.jsx(Q,{padding:"lg",className:"tt-wasm-split-helper-card",children:e.jsxs("div",{className:"tt-wasm-split-helper-grid",children:[e.jsxs("div",{className:"tt-wasm-split-helper-main",children:[e.jsx(Se,{icon:b==="error"?Ne:rt,title:je.title}),e.jsx("ul",{className:"tt-wasm-split-helper-list",children:je.lines.map(_=>e.jsx("li",{children:_},_))})]}),e.jsxs("div",{className:"tt-wasm-split-helper-meta",children:[e.jsxs("div",{children:[e.jsx("span",{className:"tt-wasm-split-helper-meta-label",children:r("wasmSplit.meta.stage")}),e.jsx("span",{className:"tt-wasm-split-helper-meta-value",children:Y.label})]}),e.jsxs("div",{children:[e.jsx("span",{className:"tt-wasm-split-helper-meta-label",children:r("wasmSplit.meta.mode")}),e.jsx("span",{className:"tt-wasm-split-helper-meta-value",children:j==="local"?r("wasmSplit.mode.local.title"):r("wasmSplit.mode.remote.title")})]}),e.jsxs("div",{children:[e.jsx("span",{className:"tt-wasm-split-helper-meta-label",children:r("wasmSplit.meta.engine")}),e.jsx("span",{className:"tt-wasm-split-helper-meta-value",children:"Unity"})]}),p&&e.jsxs("div",{children:[e.jsx("span",{className:"tt-wasm-split-helper-meta-label",children:r("wasmSplit.meta.game")}),e.jsx("span",{className:"tt-wasm-split-helper-meta-value tt-wasm-split-helper-meta-truncate",title:p,children:p})]}),x&&e.jsxs("div",{children:[e.jsx("span",{className:"tt-wasm-split-helper-meta-label",children:r("wasmSplit.meta.wasmSize")}),e.jsx("span",{className:"tt-wasm-split-helper-meta-value",children:x})]}),c&&e.jsxs("div",{children:[e.jsx("span",{className:"tt-wasm-split-helper-meta-label",children:r("wasmSplit.meta.wasmMd5")}),e.jsxs("span",{className:"tt-wasm-split-helper-meta-value tt-wasm-split-helper-meta-mono",title:c,children:[c.slice(0,8),"…",c.slice(-4)]})]})]})]})})}),e.jsxs(Q,{padding:"lg",className:"tt-wasm-split-workflow-card",children:[Le&&e.jsxs("div",{className:"tt-wasm-status-row tt-wasm-status-row-inset",children:[e.jsxs("div",{className:"tt-pipeline-mode-chip",children:[e.jsx("span",{className:"tt-pipeline-mode-dot"}),r("wasmSplit.currentMode"),e.jsx("strong",{children:j==="local"?r("wasmSplit.mode.local.title"):r("wasmSplit.mode.remote.title")})]}),e.jsx(Ut,{})]}),b==="loading"&&e.jsx(Ie,{}),b==="error"&&e.jsx(Ht,{errorType:S,onCancel:T,onHide:P}),ye&&e.jsx("div",{className:"tt-wasm-split-steps-wrap",children:e.jsx(Xt,{stage:b})}),ye&&e.jsxs("div",{className:"tt-wasm-split-stage",children:[b==="prepare"&&e.jsx(At,{codeMd5:c,codePath:i,clientKey:o,onCancel:W,onNext:()=>g("collect"),onHide:P}),b==="collect"&&e.jsx(Bt,{codeMd5:c,clientKey:o,pipelineMode:j,onCancel:T,onHide:P,onNext:()=>{_e({codeMd5:c,clientKey:o}).then(_=>{_.code===0&&f(_.data),g("split")})}}),b==="split"&&e.jsx(qt,{codeMd5:c,clientKey:o,archive:y?.enableArchiveMode===!0,pipelineMode:j,onCancel:T,onHide:P}),b==="rollback"&&e.jsx(Gt,{codeMd5:c,clientKey:o,codePath:i,onHide:P,onReset:()=>g("prepare")})]})]})]})]})};export{cs as WasmCodeSplit};