@ttmg/cli 0.3.2-beta.8 → 0.3.2

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 (26) hide show
  1. package/dist/index.js +4914 -118
  2. package/dist/index.js.map +1 -1
  3. package/dist/package.json +2 -1
  4. package/dist/public/assets/{index-C-hKdJe4.js → index-1wM1UVfn.js} +1 -1
  5. package/dist/public/assets/{index-DCvzzS3c.js → index-2_O0Ni9Y.js} +1 -1
  6. package/dist/public/assets/index-2_O0Ni9Y.js.br +0 -0
  7. package/dist/public/assets/{index-DZh72DCT.js → index-7NtcjwLK.js} +1 -1
  8. package/dist/public/assets/{index-CZeMe3yb.js → index-BCkKSQIw.js} +1 -1
  9. package/dist/public/assets/index-BCkKSQIw.js.br +0 -0
  10. package/dist/public/assets/{index-BGB_3rmy.js → index-Bf-QbPMA.js} +2 -2
  11. package/dist/public/assets/index-Bf-QbPMA.js.br +0 -0
  12. package/dist/public/assets/{index-Be7GH3NR.js → index-BgNtIG_5.js} +1 -1
  13. package/dist/public/assets/index-CSMGU1_6.js +1 -0
  14. package/dist/public/assets/{index-B7gDE9jg.js → index-DP2PME_F.js} +1 -1
  15. package/dist/public/assets/{index-BGxy8aq-.js → index-DPVNdLZW.js} +1 -1
  16. package/dist/public/assets/index-DPVNdLZW.js.br +0 -0
  17. package/dist/public/assets/{index-NjsKimh-.js → index-Dg4FSwnH.js} +1 -1
  18. package/dist/public/assets/{index-DTYGiGBE.js → index-Gj1EMh5l.js} +1 -1
  19. package/dist/public/assets/{index-dPxUjVAV.js → index-o7_85nIZ.js} +1 -1
  20. package/dist/public/index.html +1 -1
  21. package/package.json +2 -1
  22. package/dist/public/assets/index-BGB_3rmy.js.br +0 -0
  23. package/dist/public/assets/index-BGxy8aq-.js.br +0 -0
  24. package/dist/public/assets/index-CZeMe3yb.js.br +0 -0
  25. package/dist/public/assets/index-DCvzzS3c.js.br +0 -0
  26. package/dist/public/assets/index-sz2rmYug.js +0 -1
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttmg/cli",
3
- "version": "0.3.2-beta.8",
3
+ "version": "0.3.2",
4
4
  "description": "TikTok Mini Game Command Line Tool",
5
5
  "license": "ISC",
6
6
  "bin": {
@@ -52,6 +52,7 @@
52
52
  "prettier": "^3.6.2",
53
53
  "qs": "6.12.1",
54
54
  "semver": "^7.7.2",
55
+ "socks-proxy-agent": "^9.0.0",
55
56
  "ttmg-pack": "0.4.3",
56
57
  "ws": "^8.18.3"
57
58
  },
@@ -1 +1 @@
1
- import{j as e,T as s,i as c,W as o}from"./index-BGB_3rmy.js";import{D as n}from"./index-Be7GH3NR.js";const a=[{node:"item",name:c("quickStart"),link:"https://bytedance.sg.larkoffice.com/docx/MarqdNvQLoihvjxN4rFllgjBgwb"},{node:"item",name:c("jsApiList"),link:"https://bytedance.larkoffice.com/wiki/GQscwDOQSiPxyjkbzyfckh2pnDg"},{node:"item",name:c("advancedGuide"),link:"https://bytedance.larkoffice.com/wiki/AGqRwu0qQiXZpVkkToUcRP99nwc"},{node:"item",name:c("faq"),link:"https://bytedance.larkoffice.com/wiki/O6aWwFhDBiEglwkcnJ4ccJpdnmb"}],m=()=>e.jsx(n,{trigger:"hover",position:"bottomRight",render:e.jsx(e.Fragment,{children:a.map(i=>e.jsx(n.Item,{onClick:()=>{window.open(i.link)},children:i.name},i.name))}),children:e.jsxs("div",{className:"access-docs",children:[e.jsx(s.Text,{className:"access-docs-text",type:"primary",children:c("docs")}),e.jsx(o,{className:"access-docs-icon"})]})});export{m as AccessDocs};
1
+ import{j as e,T as s,i as c,W as o}from"./index-Bf-QbPMA.js";import{D as n}from"./index-BgNtIG_5.js";const a=[{node:"item",name:c("quickStart"),link:"https://bytedance.sg.larkoffice.com/docx/MarqdNvQLoihvjxN4rFllgjBgwb"},{node:"item",name:c("jsApiList"),link:"https://bytedance.larkoffice.com/wiki/GQscwDOQSiPxyjkbzyfckh2pnDg"},{node:"item",name:c("advancedGuide"),link:"https://bytedance.larkoffice.com/wiki/AGqRwu0qQiXZpVkkToUcRP99nwc"},{node:"item",name:c("faq"),link:"https://bytedance.larkoffice.com/wiki/O6aWwFhDBiEglwkcnJ4ccJpdnmb"}],m=()=>e.jsx(n,{trigger:"hover",position:"bottomRight",render:e.jsx(e.Fragment,{children:a.map(i=>e.jsx(n.Item,{onClick:()=>{window.open(i.link)},children:i.name},i.name))}),children:e.jsxs("div",{className:"access-docs",children:[e.jsx(s.Text,{className:"access-docs-text",type:"primary",children:c("docs")}),e.jsx(o,{className:"access-docs-icon"})]})});export{m as AccessDocs};
@@ -1 +1 @@
1
- import{G as re,r as f,B as q,c as P,R as b,v as Y,y as J,ag as ee,P as u,V as ne,ah as le,g as A,ai as ie,f as N,aj as z,i as c,j as s,m as j,h as $,F as H,ak as T,d as oe,u as ce,al as de,K as ue,ad as pe}from"./index-BGB_3rmy.js";function me(t){return f.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},t),f.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 4c0-1.1.9-2 2-2h5a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4Zm0 11c0-1.1.9-2 2-2h5a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-5ZM15 2a2 2 0 0 0-2 2v5c0 1.1.9 2 2 2h5a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2h-5Zm1 12.5a1.5 1.5 0 0 1 3 0V16h1.5a1.5 1.5 0 0 1 0 3H19v1.5a1.5 1.5 0 0 1-3 0V19h-1.5a1.5 1.5 0 0 1 0-3H16v-1.5Z",fill:"currentColor"}))}const fe=re(me,"customize"),W={PREFIX:`${q}-steps`,ITEM:`${q}-steps-item`};var F;(function(t){t.small="large",t.default="extra-large"})(F||(F={}));const M=t=>{const{prefixCls:e,className:r,size:a,title:n,description:l,status:m,style:d,active:i,done:o,icon:g,stepNumber:x,onClick:w,onChange:h,onKeyDown:C}=t,S=()=>{let _,E;if("icon"in t)b.isValidElement(g)&&(_=g);else if("status"in t)switch(m){case"error":_=b.createElement(ee,{size:F[a]});break;case"wait":_=b.createElement("span",{className:`${e}-number-icon`},x);break;case"process":_=b.createElement("span",{className:`${e}-number-icon`},x),E=!0;break;case"finish":_=b.createElement(J,{size:F[a]});break;case"warning":_=b.createElement(Y,{size:F[a]});break;default:_=null;break}const ae=P({[`${e}-icon`]:!0,[`${e}-custom-icon`]:"icon"in t,[`${e}-icon-process`]:E});return _?b.createElement("span",{className:ae},_):null},v=P(e,`${e}-${m}`,{[`${e}-active`]:i,[`${e}-done`]:o,[`${e}-hover`]:h||t.onClick,[`${e}-clickable`]:h||w,[`${e}-${m}-hover`]:h||t.onClick},r),p=_=>{w?.(_),h?.()},k=_=>{_.key==="Enter"&&(C?.(_),h?.())};return b.createElement("div",{role:t.role,"aria-label":t["aria-label"],tabIndex:0,"aria-current":"step",className:v,style:d,onClick:_=>p(_),onKeyDown:k},b.createElement("div",{className:`${e}-container`},b.createElement("div",{className:`${e}-left`},S()),b.createElement("div",{className:`${e}-content`},b.createElement("div",{className:`${e}-title`},b.createElement("div",{className:`${e}-title-text`},n)),l&&b.createElement("div",{className:`${e}-description`},l))))};M.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};M.defaultProps={prefixCls:W.ITEM,active:!1,done:!1,status:"wait",className:""};const B=t=>{const{prefixCls:e,className:r,title:a,description:n,status:l,style:m,onClick:d,icon:i,onChange:o,stepNumber:g,onKeyDown:x}=t,w=()=>{let S,v;if("icon"in t)S=i;else if("status"in t)switch(l){case"error":S=b.createElement(ee,{size:"extra-large"});break;case"wait":S=g;break;case"process":S=g,v=!0;break;case"finish":S=b.createElement(J,{size:"extra-large"});break;case"warning":S=b.createElement(Y,{size:"extra-large"});break;default:S=null;break}const p=P({[`${e}-left`]:!0,[`${e}-icon`]:"icon"in t,[`${e}-plain`]:!("icon"in t),[`${e}-icon-process`]:v,[`${e}-hover`]:o||d});return S?b.createElement("div",{className:p},S):null},h=S=>{d?.(S),o?.()},C=S=>{S.key==="Enter"&&(x?.(S),o?.())};return b.createElement("div",{role:t.role,"aria-label":t["aria-label"],"aria-current":"step",tabIndex:0,className:P({[e]:!0,[`${e}-${l}`]:!!l,[`${e}-${l}-hover`]:!!l&&(o||d),[`${e}-${l}-active`]:!!l&&(o||d),[`${e}-clickable`]:o||d},r),style:m,onClick:S=>{h(S)},onKeyDown:C},w(),b.createElement("div",{className:`${e}-content`},b.createElement("div",{className:`${e}-title`,title:typeof a=="string"?a:null},b.createElement("span",{className:`${e}-title-text`},a)),b.createElement("div",{className:`${e}-description`,title:typeof n=="string"?n:null},n)))};B.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};B.defaultProps={prefixCls:W.ITEM,status:"wait",className:""};const G=t=>{const{prefixCls:e,className:r,title:a,style:n,active:l,index:m,total:d,onClick:i,onKeyDown:o,onChange:g}=t,x=P(e,{[`${e}-active`]:l},r),w=C=>{i?.(C),g?.()},h=C=>{C.key==="Enter"&&(o?.(C),g?.())};return b.createElement("div",{role:t.role,"aria-label":t["aria-label"],"aria-current":"step",tabIndex:0,className:x,style:n,onClick:C=>w(C),onKeyDown:h},b.createElement("div",{className:`${e}-container`},b.createElement("div",{className:`${e}-content`},b.createElement("div",{className:`${e}-title`},a)),m!==d-1&&b.createElement("div",{className:`${e}-icon`},b.createElement(ne,{size:"small"}))))};G.propTypes={prefixCls:u.string,title:u.node,className:u.string,style:u.object,onClick:u.func,active:u.bool};G.defaultProps={prefixCls:W.ITEM,active:!1,className:""};const te=b.createContext(null),we=t=>{const{type:e}=f.useContext(te);return(()=>{switch(e){case"fill":return b.createElement(B,Object.assign({},t));case"basic":return b.createElement(M,Object.assign({},t));case"nav":return b.createElement(G,Object.assign({},t));default:return null}})()};var he=function(t,e){var r={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(r[a]=t[a]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,a=Object.getOwnPropertySymbols(t);n<a.length;n++)e.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(t,a[n])&&(r[a[n]]=t[a[n]]);return r};const V=t=>{const{current:e,status:r,children:a,prefixCls:n,initial:l,direction:m,className:d,style:i,onChange:o}=t,g=he(t,["current","status","children","prefixCls","initial","direction","className","style","onChange"]),x=f.useMemo(()=>{const h=f.Children.toArray(a).filter(v=>f.isValidElement(v)),C=m==="vertical"?null:{width:`${100/h.length}%`};return f.Children.map(h,(v,p)=>{if(!v)return null;const k=l+p,_=Object.assign({stepNumber:`${k+1}`,direction:m},v.props);return r==="error"&&p===e-1&&(_.className=`${n}-next-error`),v.props.status||(k===e?_.status=r:k<e?_.status="finish":_.status="wait"),_.onChange=o?()=>{p!==e&&o(p+l)}:void 0,b.createElement(le,{style:C},f.cloneElement(v,Object.assign({},_)))})},[a,l,n,m,r,e,o]),w=P(d,{[n]:!0,[`${n}-${m}`]:!0});return b.createElement("div",Object.assign({className:w,style:i,"aria-label":t["aria-label"]},A(g)),b.createElement(ie,{type:"flex",justify:"start"},x))};V.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"])};V.defaultProps={prefixCls:W.PREFIX,current:0,direction:"horizontal",initial:0,status:"process"};var ge=function(t,e){var r={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(r[a]=t[a]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,a=Object.getOwnPropertySymbols(t);n<a.length;n++)e.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(t,a[n])&&(r[a[n]]=t[a[n]]);return r};const U=t=>{const{size:e,current:r,status:a,children:n,prefixCls:l,initial:m,direction:d,className:i,style:o,hasLine:g,onChange:x}=t,w=ge(t,["size","current","status","children","prefixCls","initial","direction","className","style","hasLine","onChange"]),h=f.useMemo(()=>{const S=f.Children.toArray(n).filter(p=>f.isValidElement(p));return f.Children.map(S,(p,k)=>{if(!p)return null;const _=m+k,E=Object.assign({stepNumber:`${_+1}`,size:e},p.props);return a==="error"&&k===r-1&&(E.className=`${l}-next-error`),p.props.status||(_===r?E.status=a:_<r?E.status="finish":E.status="wait"),E.active=_===r,E.done=_<r,E.onChange=x?()=>{k!==r&&x(k+m)}:void 0,f.cloneElement(p,Object.assign({},E))})},[n,m,l,d,a,r,e,x]),C=P(i,{[`${l}-basic`]:!0,[`${l}-${d}`]:!0,[`${l}-${e}`]:e!=="default",[`${l}-hasline`]:g});return b.createElement("div",Object.assign({"aria-label":t["aria-label"],className:C,style:o},A(w)),h)};U.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};U.defaultProps={prefixCls:W.PREFIX,current:0,direction:"horizontal",size:"",initial:0,hasLine:!0,status:"process"};var xe=function(t,e){var r={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(r[a]=t[a]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,a=Object.getOwnPropertySymbols(t);n<a.length;n++)e.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(t,a[n])&&(r[a[n]]=t[a[n]]);return r};const L=t=>{const{size:e,current:r,initial:a,children:n,prefixCls:l,className:m,style:d,onChange:i}=t,o=xe(t,["size","current","initial","children","prefixCls","className","style","onChange"]),g=f.useMemo(()=>{const w=f.Children.toArray(n).filter(S=>f.isValidElement(S)),h=w.length;return f.Children.map(w,(S,v)=>{if(!S)return null;const p=Object.assign({index:v,total:h},S.props);return p.active=v===r,p.onChange=i?()=>{v!==r&&i(v+a)}:void 0,f.cloneElement(S,Object.assign({},p))})},[n,l,r,e,a,i]),x=P(m,{[`${l}-nav`]:!0,[`${l}-${e}`]:e!=="default"});return b.createElement("div",Object.assign({"aria-label":t["aria-label"],className:x,style:d},A(o)),g)};L.propTypes={prefixCls:u.string,className:u.string,style:u.object,current:u.number,initial:u.number,size:u.oneOf(["small","default"])};L.defaultProps={prefixCls:W.PREFIX,current:0,direction:"horizontal",size:"default",initial:0,status:"process"};var be=function(t,e){var r={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(r[a]=t[a]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,a=Object.getOwnPropertySymbols(t);n<a.length;n++)e.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(t,a[n])&&(r[a[n]]=t[a[n]]);return r};class R extends f.Component{renderComponent(){const e=this.props,{type:r}=e,a=be(e,["type"]);switch(r){case"fill":return b.createElement(V,Object.assign({},a));case"basic":return b.createElement(U,Object.assign({},a));case"nav":return b.createElement(L,Object.assign({},a));default:return null}}render(){const{type:e}=this.props;return b.createElement(te.Provider,{value:{type:e}},this.renderComponent())}}R.Step=we;R.propTypes={onChange:u.func,type:u.oneOf(["fill","basic","nav"]),size:u.oneOf(["small","default"])};R.defaultProps={type:"fill",size:"default"};const O={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 Se({codeMd5:t,clientKey:e}){return N({url:"/game/wasm-split-config",method:"GET",data:{codeMd5:t,clientKey:e}})}function ve(t){const{codePath:e,codeMd5:r,clientKey:a,desc:n}=t;return N({url:"/game/wasm-prepare",method:"POST",data:{codePath:e,clientKey:a,codeMd5:r,desc:n}})}function _e({codeMd5:t,clientKey:e}){return N({url:"/game/wasm-prepare-result",method:"POST",data:{codeMd5:t,clientKey:e}})}function Ce(t,e){const r=e?.intervalMs,a=e?.maxAttempts,n=e?.signal||new AbortController().signal;let l=0;return new Promise((m,d)=>{if(n?.aborted){d(new DOMException("Polling aborted","AbortError"));return}const i=()=>{clearTimeout(o),d(new DOMException("Polling aborted","AbortError"))};n?.addEventListener("abort",i,{once:!0});let o;const g=async()=>{l+=1;try{const x=await _e(t),{status:w}=x.data;if(w===O.WasmPreparedSuccess||w===O.WasmSplitDone){m(x);return}if(w<0){m(x);return}if(l>=a){d(new Error(`Polling timeout after ${a} attempts`));return}o=window.setTimeout(g,r)}catch(x){if(l>=a){d(x);return}o=window.setTimeout(g,r)}};g()})}function je({codeMd5:t,clientKey:e,codePath:r}){return N({url:"/game/wasm-prepare-download",method:"POST",data:{codeMd5:t,clientKey:e,codePath:r}})}function ye(t){const{codeMd5:e,clientKey:r}=t;return N({url:"/game/wasm-split",method:"POST",data:{codeMd5:e,clientKey:r}})}function ke({codeMd5:t,clientKey:e}){return N({url:"/game/wasm-split-result",method:"POST",data:{codeMd5:t,clientKey:e}})}function Ne(t,e){const r=e?.intervalMs,a=e?.maxAttempts,n=e?.signal||new AbortController().signal;let l=0;return new Promise((m,d)=>{if(n?.aborted){d(new DOMException("Polling aborted","AbortError"));return}const i=()=>{clearTimeout(o),d(new DOMException("Polling aborted","AbortError"))};n?.addEventListener("abort",i,{once:!0});let o;const g=async()=>{l+=1;try{const x=await ke(t),{status:w}=x.data;if(w!==O.WasmSplitDone){if(l>=a){d(new Error(`Polling timeout after ${a} attempts`));return}o=window.setTimeout(g,r);return}m(x)}catch(x){if(l>=a){d(x);return}o=window.setTimeout(g,r)}};g()})}function Ee({codeMd5:t,clientKey:e}){return N({url:"/game/wasm-split-download-result",method:"POST",data:{clientKey:e,codeMd5:t}})}function Pe(t){return N({url:"/game/wasm-split-download",method:"POST",data:t})}function se(t){const{codeMd5:e,clientKey:r,codePath:a}=t;return N({url:"/game/wasm-split-reset",method:"POST",data:{codeMd5:e,clientKey:r,codePath:a}})}function Oe({codeMd5:t,clientKey:e}){return N({url:"/game/wasm-taskinfo",method:"GET",data:{codeMd5:t,clientKey:e}})}function $e({codeMd5:t,clientKey:e}){return N({url:"/game/wasm-set-collect",method:"POST",data:{codeMd5:t,clientKey:e}})}function X(t){return N({url:"/game/wasm-collect-funcids",method:"GET",data:t})}function Re(t){return N({url:"/game/wasm-collect-info",method:"GET",data:t})}const D={container:"wasm-prepare-downloading-content",process:"wasm-prepare-downloading-text",success:"wasm-prepare-downloading-success",error:"wasm-prepare-downloading-error"},Te=({kind:t,children:e})=>{const r={process:D.process,success:D.success,error:D.error};return s.jsx("div",{className:r[t],children:e})},Z={star_fetch_prepared_wasm_url:{kind:"process",text:"fetchDownloadUrl",showSpin:!0},fetch_prepared_wasm_url_done:{kind:"success",text:"fetchDownloadUrlSuccess",showSpin:!0},fetch_prepared_wasm_url_failed:{kind:"error",text:"fetchDownloadUrlFailed",appendError:!0},start_download_prepared_wasm:{kind:"process",text:"downloadPreparedWasmCode",showSpin:!0},download_prepared_wasm_done:{kind:"success",text:"downloadPreparedWasmCodeSuccess",showSpin:!0},download_prepared_wasm_failed:{kind:"error",text:"downloadPreparedWasmCodeFailed",appendError:!0,showRetry:!0},start_compress_prepared_wasm:{kind:"process",text:"compressPreparedWasmCode",showSpin:!0},compress_prepared_wasm_done:{kind:"success",text:"compressPreparedWasmCodeSuccess",showSpin:!0},start_write_compress_prepared_wasm:{kind:"process",text:"writeCompressPreparedWasmCode",showSpin:!0},start_update_wasm_split_config:{kind:"process",text:"updateWasmSplitConfig",showSpin:!0},update_wasm_split_config_done:{kind:"success",text:"updateWasmSplitConfigSuccess"},update_wasm_split_config_failed:{kind:"error",text:"updateWasmSplitConfigFailed",appendError:!0},default:{kind:"process",text:"processing",showSpin:!0}},We=({onCancel:t,onRetry:e,onHide:r})=>{const[a,n]=f.useState(""),[l,m]=f.useState("");f.useEffect(()=>{const g=x=>{n(x.status),m(x.errorMsg||"")};return z.on("unitySplitStatus",g),()=>{z.off("unitySplitStatus",g)}},[]);const d=f.useMemo(()=>Z[a]??Z.default,[a]),i=s.jsx($,{size:"large",color:"primary"}),o=typeof d.text=="string"?c(d.text)??d.text:"";return s.jsxs("div",{className:D.container,children:[d.showSpin&&i,!!o&&s.jsx(Te,{kind:d.kind,children:o}),d.appendError&&!!l&&s.jsx("div",{className:D.error,children:l}),d.showRetry&&s.jsx(j,{onClick:e,children:c("retryDownload")}),s.jsx(j,{style:{marginTop:12},type:"tertiary",onClick:r,children:c("backgroundRun")})]})},Fe=({onSubmit:t,onCancel:e,onChange:r})=>s.jsxs(H,{style:{width:"100%",transform:"translateY(-20px)"},onChange:r,onSubmit:t,children:[s.jsx(H.TextArea,{rules:[{required:!0,message:c("inputSplitDesc")}],label:c("splitDesc"),placeholder:c("inputSplitDesc"),field:"desc"}),s.jsxs("div",{className:"wasm-prepare-form-button-container",children:[s.jsx(j,{type:"tertiary",htmlType:"submit",style:{marginRight:12},children:c("startPrepare")}),s.jsx(j,{type:"tertiary",onClick:e,children:c("cancel")})]})]}),y={init:"init",start:"start",processing:O.WasmPreparing,processingReady:O.WasmReadyToPrepare,success:O.WasmPreparedSuccess,failed:O.WasmPrepareFailed,splitDone:O.WasmSplitDone,downloading:"downloading",downloadFailed:"downloadFailed"},K=new AbortController,De=({codePath:t,codeMd5:e,clientKey:r,onCancel:a,onNext:n,onHide:l})=>{const[m,d]=f.useState(""),[i,o]=f.useState({code:0,data:{status:y.init}}),g=f.useMemo(()=>i?.data?.status,[i?.data?.status]),x=()=>{K.abort(),a(),se({codeMd5:e,clientKey:r,codePath:t}).then(p=>{p.code===0&&o({...i,data:{...i?.data,status:y.init}})})},w=()=>{o({code:0,data:{status:y.start}}),ve({codePath:t,codeMd5:e,clientKey:r,desc:m}).then(p=>{p.code===0||p?.error?.code===10024||p?.error?.code===10028?(o({...p,data:{...p?.data,status:y.processing}}),h()):o({...i,error:p?.error||{code:-1,message:"Internal server error, please try again later..."},data:{...i?.data,status:y.failed}})})},h=()=>{Ce({codeMd5:e,clientKey:r},{intervalMs:500,maxAttempts:100,signal:K.signal}).then(p=>{p.code===0?o(p):o({...i,data:{...i?.data}})})},C=()=>{o({...i,data:{...i?.data,status:"downloading"}}),je({codePath:t,codeMd5:e,clientKey:r}).then(p=>{p.code===0?(o({...i,data:{...i?.data,status:y.success}}),n()):o({...i,data:{...i?.data,status:y.downloadFailed}})})},S=p=>{d(p?.values?.desc)};let v=null;switch(g){case y.init:v=s.jsx(Fe,{onSubmit:w,onCancel:a,onChange:S});break;case y.start:v=s.jsxs("div",{className:"wasm-prepare-processing-content",children:[s.jsx($,{size:"large",color:"primary"}),s.jsx("div",{className:"wasm-prepare-processing-text",children:c("startingPrepare")}),s.jsx("div",{className:"wasm-prepare-processing-cancel",children:s.jsxs(T,{children:[s.jsx(j,{type:"danger",onClick:a,children:c("cancelPrepare")}),s.jsx(j,{onClick:()=>l(),children:c("backgroundRun")})]})})]});break;case y.processing:case y.processingReady:v=s.jsxs("div",{className:"wasm-prepare-processing-content",children:[s.jsx($,{size:"large",color:"primary"}),s.jsx("div",{className:"wasm-prepare-processing-text",children:c("preparingSplit")}),s.jsx("div",{className:"wasm-prepare-processing-warning",children:c("warningDuringPreparing")}),s.jsx("div",{className:"wasm-prepare-processing-cancel",children:s.jsxs(T,{children:[s.jsx(j,{type:"tertiary",onClick:()=>{x()},children:c("cancelPrepare")}),s.jsx(j,{type:"tertiary",onClick:()=>l(),children:c("backgroundRun")})]})})]});break;case y.success:case y.splitDone:v=s.jsxs("div",{className:"wasm-prepare-success-content",children:[s.jsx("div",{className:"wasm-prepare-success-text",children:c("preparingSplitSuccess")}),s.jsx("div",{className:"wasm-prepare-success-download",children:s.jsx(j,{type:"tertiary",onClick:()=>{C()},children:c("downloadPreparedWasmCode")})})]});break;case y.downloading:v=s.jsx(We,{onHide:l});break;case y.downloadFailed:const p=i?.error?.message||"Unknown error";v=s.jsxs("div",{className:"wasm-prepare-downloadfailed-content",children:[s.jsx("div",{className:"wasm-prepare-downloadfailed-text",children:c("downloadFailed")}),s.jsx("div",{className:"wasm-prepare-downloadfailed-warning",children:p}),s.jsx(j,{onClick:C,children:c("retryDownload")})]});break;case y.failed:const k=i?.error?.message||"Unknown error";v=s.jsxs("div",{className:"wasm-prepare-failed-content",children:[s.jsx("div",{className:"wasm-prepare-failed-text",children:c("preparingSplitFailed")}),i?.data?.status===y.failed&&s.jsx("div",{className:"wasm-prepare-failed-warning",children:k}),s.jsx(j,{type:"tertiary",style:{marginTop:12},onClick:w,children:c("retryPrepare")})]});break;default:v=null}return s.jsx("div",{className:"wasm-prepare-content-container",children:v})},Ie=({data:t})=>{const e={...t||{}},r=[{label:"Client key",value:"app_id"},{label:c("wasmSize"),value:"wasm_size",render:a=>`${(a/1024/1024).toFixed(2)} MB`},{label:c("totalFuncCount"),value:"total_wasm_func_count",render:a=>a>=1e3?`${(a/1e3).toFixed(2)} K`:`${a}`},{label:c("collectedFuncCount"),value:"collected_func_count",render:a=>a>=1e3?`${(a/1e3).toFixed(2)} K`:`${a}`},{label:"Wasm md5",value:"wasm_md5"}];return s.jsx("div",{className:"wasm-collect-status",children:r.map(a=>s.jsxs("div",{className:"wasm-collect-status-item",children:[s.jsx(oe,{size:"small",className:"wasm-collect-status-item-label",children:a.label}),s.jsx("span",{className:"wasm-collect-status-item-value",children:a.render?.(e[a.value])||e[a.value]})]},a.value))})},ze=({onNext:t,codeMd5:e,clientKey:r,onHide:a})=>{const{state:{devSchema:n}}=ce(),[l,m]=f.useState("willCollect"),[d,i]=f.useState(),[o,g]=f.useState(),[x,w]=f.useState(0),h=f.useRef(null),C=f.useMemo(()=>!o||!o?.total_wasm_func_count?!1:(x||0)/(o?.total_wasm_func_count||0)>=.08,[o,x]);f.useEffect(()=>{if(l!=="collecting"){h.current&&(window.clearInterval(h.current),h.current=null);return}if(!h.current)return X({codeMd5:e,clientKey:r}).then(p=>{w(p.data?.collected_func_count||0)}).catch(console.error),h.current=window.setInterval(()=>{X({codeMd5:e,clientKey:r}).then(p=>{w(p.data?.collected_func_count||0)}).catch(p=>{console.error(p)})},2e3),()=>{h.current&&(window.clearInterval(h.current),h.current=null)}},[l,e,r]);const S=async()=>{if(l!=="collecting")try{m("startCollect");const p=await $e({codeMd5:e,clientKey:r});m("collecting"),Oe({codeMd5:e,clientKey:r}).then(k=>{i(k.data)}).catch(console.error),Re({codeMd5:e,clientKey:r}).then(k=>{g(k.data||{})}).catch(console.error)}catch(p){console.error(p)}},v=()=>{h.current&&(window.clearInterval(h.current),h.current=null),m("willCollect"),t()};return s.jsxs("div",{className:"wasm-collect-content-container",children:[d&&s.jsx(Ie,{data:{...d||{},total_wasm_func_count:o?.total_wasm_func_count,collected_func_count:x}}),s.jsx("div",{className:"collect-qrcode-container",children:s.jsx(de,{value:n})}),s.jsx("div",{className:"collect-qrcode-desc",children:c("collectDesc")}),s.jsxs("div",{className:"collect-qrcode-button-container",children:[l!=="collecting"&&s.jsx(j,{loading:l==="startCollect",onClick:S,children:c("startCollect")}),l==="collecting"&&s.jsxs(T,{children:[C?s.jsx(j,{type:"tertiary",onClick:v,children:c("startSplit")}):s.jsx(ue,{content:c("cannotSplitTip"),children:s.jsx(j,{type:"tertiary",disabled:!0,children:c("startSplit")})}),s.jsx(j,{type:"tertiary",onClick:a,children:c("backgroundRun")})]})]})]})},Ae=({onCancel:t,onHide:e})=>{const[r,a]=f.useState(""),[n,l]=f.useState("");f.useEffect(()=>{const o=g=>{a(g.status),l(g.errorMsg||"")};return z.on("unitySplitStatus",o),()=>{z.off("unitySplitStatus",o)}},[]);let m=null;const d="wasm-split-downloading-content",i="wasm-split-downloading-text";switch(r){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":m=s.jsxs("div",{className:d,children:[s.jsx($,{size:"large",color:"primary"}),s.jsx("div",{className:i,children:c(r)}),s.jsxs(T,{children:[s.jsx(j,{type:"danger",onClick:t,children:c("cancelSplit")}),s.jsx(j,{onClick:e,children:c("backgroundRun")})]})]});break;default:m=s.jsxs("div",{className:d,children:[s.jsx($,{size:"large",color:"primary"}),s.jsx("div",{className:i,children:c("processing")})]})}return m},Q=new AbortController,Me=({onCancel:t,onHide:e,codeMd5:r,clientKey:a})=>{const[n,l]=f.useState("spliting"),[m,d]=f.useState(),i=()=>{Q.abort(),t()},o=()=>{l("downloadingSplitResult"),Pe(m?.result).then(h=>{h.code===0?l("downloadSuccess"):l("downloadFailed")}).catch(()=>{l("downloadFailed")})},g=()=>{l("spliting"),ye({codeMd5:r,clientKey:a}).then(h=>{h.code===0&&Ne({codeMd5:r,clientKey:a},{intervalMs:1e3,maxAttempts:1e3,signal:Q.signal}).then(C=>{l("splitSuccess"),x()})}).catch(()=>{l("splitFailed")})},x=()=>{l("startGetSplitResult"),Ee({clientKey:a,codeMd5:r}).then(h=>{h.code===0?(d(h.data),l("getSplitResultSuccess")):l("getSplitResultFailed")})};f.useEffect(()=>{g()},[]);let w=null;switch(n){case"spliting":w=s.jsxs("div",{className:"wasm-split-processing",children:[s.jsx($,{size:"large",color:"primary"}),s.jsx("div",{className:"wasm-split-processing-content",children:c("splittingDesc")}),s.jsx("div",{className:"wasm-split-processing-cancel",children:s.jsxs(T,{children:[s.jsx(j,{onClick:()=>i(),type:"danger",children:c("cancelSplit")}),s.jsx(j,{onClick:()=>e(),children:c("backgroundRun")})]})})]});break;case"splitSuccess":w=s.jsx("div",{className:"wasm-split-success",children:s.jsx("div",{className:"wasm-split-success-content",children:c("getSplitResult")})});break;case"startGetSplitResult":w=s.jsxs("div",{className:"wasm-split-processing",children:[s.jsx($,{}),s.jsx("div",{className:"wasm-split-processing-content",children:c("getSplitResult")})]});break;case"getSplitResultFailed":w=s.jsxs("div",{className:"wasm-split-failed",children:[s.jsx("div",{className:"wasm-split-failed-content",children:c("getSplitResultFailed")}),s.jsx("div",{className:"wasm-split-failed-retry",children:s.jsx(j,{type:"primary",onClick:()=>x(),children:c("retryGetSplitResult")})})]});break;case"getSplitResultSuccess":w=s.jsxs("div",{className:"wasm-split-success",children:[s.jsx("div",{className:"wasm-split-success-content",children:c("splitSuccess")}),s.jsx("div",{className:"wasm-split-success-download",children:s.jsx(j,{type:"primary",onClick:()=>o(),children:c("downloadSplitResult")})})]});break;case"getDownloadResultFailed":w=s.jsxs("div",{className:"wasm-split-failed",children:[s.jsx("div",{className:"wasm-split-failed-content",children:c("getSplitResultFailed")}),s.jsx("div",{className:"wasm-split-failed-retry",children:s.jsx(j,{type:"primary",onClick:()=>x(),children:c("retryGetSplitResult")})})]});break;case"downloadingSplitResult":w=s.jsx(Ae,{onCancel:i,onHide:e});break;case"downloadSuccess":w=s.jsxs("div",{className:"wasm-split-success",children:[s.jsx("div",{className:"wasm-split-success-content",children:c("downloadSplitResultSuccess")}),s.jsx("div",{className:"wasm-split-success-tip",children:c("downloadSplitResultTip")})]});break;default:w=null}return s.jsx("div",{className:"wasm-split-content-container",children:w})},I={prepare:{number:0,title:c("splitPrepare")},collect:{number:1,title:c("splitCollect")},split:{number:2,title:c("splitCode")},rollback:{number:3,title:c("rollback")}},Be=({stage:t})=>s.jsxs(R,{type:"basic",current:I[t].number,style:{marginTop:24},children:[s.jsx(R.Step,{title:I.prepare.title}),s.jsx(R.Step,{title:I.collect.title}),s.jsx(R.Step,{title:I.split.title})]}),Ge=({onCancel:t,errorType:e,onHide:r})=>s.jsxs("div",{className:"wasm-code-split-error",children:[e==="noWasmCode"&&s.jsxs("div",{className:"wasm-code-split-error-container",children:[s.jsx("div",{className:"wasm-code-split-error-title",children:c("noWasmCode")}),s.jsx("div",{className:"wasm-code-split-error-desc",children:c("noWasmCodeDesc")})]}),e==="hasSplited"&&s.jsxs("div",{className:"wasm-code-split-error-container",children:[s.jsx("div",{className:"wasm-code-split-error-title",children:c("hasSplitedTitle")}),s.jsx("div",{className:"wasm-code-split-error-desc",children:c("hasSplitedDesc")}),s.jsxs(T,{children:[s.jsx(j,{onClick:t,children:c("cancelSplit")}),s.jsx(j,{onClick:r,children:c("backgroundRun")})]})]}),e==="noSplitConfig"&&s.jsxs("div",{className:"wasm-code-split-error-container",children:[s.jsx("div",{className:"wasm-code-split-error-title",children:c("noSplitConfigTitle")}),s.jsx("div",{className:"wasm-code-split-error-desc",children:c("noSplitConfigDesc")})]})]}),Ve=()=>s.jsxs("div",{className:"split-loading",children:[s.jsx($,{size:"large",color:"primary"}),s.jsx("div",{className:"split-loading-text",children:"正在初始化分包环境"})]}),Ue=({codeMd5:t,clientKey:e,codePath:r,onHide:a,onReset:n})=>{const[l,m]=f.useState("rollbacking"),d=()=>{m("rollbacking"),se({codeMd5:t,clientKey:e,codePath:r}).then(g=>{g.code===0?(m("rollbackSuccess"),n()):m("rollbackFailed")})};f.useEffect(()=>{d()},[]);let i="",o=null;switch(l){case"rollbacking":i="回滚中...",o=s.jsx(j,{onClick:()=>{m("rollbackFailed")},children:"后台进行"});break;case"rollbackSuccess":i="回滚成功",o=s.jsx(j,{onClick:()=>{a()},children:"关闭"});break;case"rollbackFailed":i="回滚失败",o=s.jsx(j,{onClick:()=>{d()},children:"重试"});break}return s.jsx(s.Fragment,{children:s.jsxs("div",{className:"wasm-split-rollback-container",children:[s.jsx("div",{className:"wasm-split-rollback-text",children:i}),o]})})};function Le({enableWasmCollect:t,enableWasmSplit:e}){return typeof t=="boolean"&&(typeof e=="string"||e===!1)?t:!1}function qe({enableWasmSplit:t,hasWasmCode:e}){return t===!0?{errorType:"hasSplited",hasError:!0}:e?{hasError:!1}:{errorType:"noWasmCode",hasError:!0}}const Xe=({codePath:t,clientKey:e,codeMd5:r})=>{const[a,n]=f.useState(!1),[l,m]=f.useState(""),[d,i]=f.useState("loading"),[o,g]=f.useState(null),x=()=>{n(!0),(!o||d==="error")&&(i("loading"),Se({codeMd5:r,clientKey:e}).then(C=>{if(C.code===0){const{errorType:S,hasError:v}=qe({enableWasmSplit:C.data.enableWasmSplit,hasWasmCode:!!t});m(S),v?(m(S),i("error")):Le(C.data)?i("collect"):i("prepare"),g(C.data)}else i("error")}))},w=()=>{n(!1)},h=()=>{i("rollback")};return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:P("wasm-code-split",{}),onClick:x,children:[s.jsx(fe,{size:"default"}),s.jsx("span",{className:"wasm-code-split-text",children:c("wasmSplit")})]}),s.jsxs(pe,{centered:!0,keepDOM:!0,maskClosable:!1,visible:a,footer:null,style:{width:"90%"},onCancel:()=>n(!1),onOk:()=>n(!1),title:c("wasmSplit"),children:[d==="loading"&&s.jsx(Ve,{}),d==="error"&&s.jsx(Ge,{errorType:l,onCancel:h,onHide:w}),d!=="error"&&d!=="loading"&&s.jsx(Be,{stage:d}),d==="prepare"&&s.jsx(De,{codeMd5:r,codePath:t,clientKey:e,onCancel:()=>{n(!1)},onNext:()=>{i("collect")},onHide:w}),d==="collect"&&s.jsx(ze,{codeMd5:r,clientKey:e,onCancel:()=>{n(!1),i("prepare")},onHide:w,onNext:()=>{i("split")}}),d==="split"&&s.jsx(Me,{codeMd5:r,clientKey:e,onCancel:h,onHide:w}),d==="rollback"&&s.jsx(Ue,{codeMd5:r,clientKey:e,codePath:t,onHide:w,onReset:()=>{i("prepare")}})]})]})};export{Xe as WasmCodeSplit};
1
+ import{G as re,r as f,B as q,c as P,R as b,v as Y,y as J,ag as ee,P as u,V as ne,ah as le,g as A,ai as ie,f as N,aj as z,i as c,j as s,m as j,h as $,F as H,ak as T,d as oe,u as ce,al as de,K as ue,ad as pe}from"./index-Bf-QbPMA.js";function me(t){return f.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},t),f.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 4c0-1.1.9-2 2-2h5a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4Zm0 11c0-1.1.9-2 2-2h5a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-5ZM15 2a2 2 0 0 0-2 2v5c0 1.1.9 2 2 2h5a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2h-5Zm1 12.5a1.5 1.5 0 0 1 3 0V16h1.5a1.5 1.5 0 0 1 0 3H19v1.5a1.5 1.5 0 0 1-3 0V19h-1.5a1.5 1.5 0 0 1 0-3H16v-1.5Z",fill:"currentColor"}))}const fe=re(me,"customize"),W={PREFIX:`${q}-steps`,ITEM:`${q}-steps-item`};var F;(function(t){t.small="large",t.default="extra-large"})(F||(F={}));const M=t=>{const{prefixCls:e,className:r,size:a,title:n,description:l,status:m,style:d,active:i,done:o,icon:g,stepNumber:x,onClick:w,onChange:h,onKeyDown:C}=t,S=()=>{let _,E;if("icon"in t)b.isValidElement(g)&&(_=g);else if("status"in t)switch(m){case"error":_=b.createElement(ee,{size:F[a]});break;case"wait":_=b.createElement("span",{className:`${e}-number-icon`},x);break;case"process":_=b.createElement("span",{className:`${e}-number-icon`},x),E=!0;break;case"finish":_=b.createElement(J,{size:F[a]});break;case"warning":_=b.createElement(Y,{size:F[a]});break;default:_=null;break}const ae=P({[`${e}-icon`]:!0,[`${e}-custom-icon`]:"icon"in t,[`${e}-icon-process`]:E});return _?b.createElement("span",{className:ae},_):null},v=P(e,`${e}-${m}`,{[`${e}-active`]:i,[`${e}-done`]:o,[`${e}-hover`]:h||t.onClick,[`${e}-clickable`]:h||w,[`${e}-${m}-hover`]:h||t.onClick},r),p=_=>{w?.(_),h?.()},k=_=>{_.key==="Enter"&&(C?.(_),h?.())};return b.createElement("div",{role:t.role,"aria-label":t["aria-label"],tabIndex:0,"aria-current":"step",className:v,style:d,onClick:_=>p(_),onKeyDown:k},b.createElement("div",{className:`${e}-container`},b.createElement("div",{className:`${e}-left`},S()),b.createElement("div",{className:`${e}-content`},b.createElement("div",{className:`${e}-title`},b.createElement("div",{className:`${e}-title-text`},n)),l&&b.createElement("div",{className:`${e}-description`},l))))};M.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};M.defaultProps={prefixCls:W.ITEM,active:!1,done:!1,status:"wait",className:""};const B=t=>{const{prefixCls:e,className:r,title:a,description:n,status:l,style:m,onClick:d,icon:i,onChange:o,stepNumber:g,onKeyDown:x}=t,w=()=>{let S,v;if("icon"in t)S=i;else if("status"in t)switch(l){case"error":S=b.createElement(ee,{size:"extra-large"});break;case"wait":S=g;break;case"process":S=g,v=!0;break;case"finish":S=b.createElement(J,{size:"extra-large"});break;case"warning":S=b.createElement(Y,{size:"extra-large"});break;default:S=null;break}const p=P({[`${e}-left`]:!0,[`${e}-icon`]:"icon"in t,[`${e}-plain`]:!("icon"in t),[`${e}-icon-process`]:v,[`${e}-hover`]:o||d});return S?b.createElement("div",{className:p},S):null},h=S=>{d?.(S),o?.()},C=S=>{S.key==="Enter"&&(x?.(S),o?.())};return b.createElement("div",{role:t.role,"aria-label":t["aria-label"],"aria-current":"step",tabIndex:0,className:P({[e]:!0,[`${e}-${l}`]:!!l,[`${e}-${l}-hover`]:!!l&&(o||d),[`${e}-${l}-active`]:!!l&&(o||d),[`${e}-clickable`]:o||d},r),style:m,onClick:S=>{h(S)},onKeyDown:C},w(),b.createElement("div",{className:`${e}-content`},b.createElement("div",{className:`${e}-title`,title:typeof a=="string"?a:null},b.createElement("span",{className:`${e}-title-text`},a)),b.createElement("div",{className:`${e}-description`,title:typeof n=="string"?n:null},n)))};B.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};B.defaultProps={prefixCls:W.ITEM,status:"wait",className:""};const G=t=>{const{prefixCls:e,className:r,title:a,style:n,active:l,index:m,total:d,onClick:i,onKeyDown:o,onChange:g}=t,x=P(e,{[`${e}-active`]:l},r),w=C=>{i?.(C),g?.()},h=C=>{C.key==="Enter"&&(o?.(C),g?.())};return b.createElement("div",{role:t.role,"aria-label":t["aria-label"],"aria-current":"step",tabIndex:0,className:x,style:n,onClick:C=>w(C),onKeyDown:h},b.createElement("div",{className:`${e}-container`},b.createElement("div",{className:`${e}-content`},b.createElement("div",{className:`${e}-title`},a)),m!==d-1&&b.createElement("div",{className:`${e}-icon`},b.createElement(ne,{size:"small"}))))};G.propTypes={prefixCls:u.string,title:u.node,className:u.string,style:u.object,onClick:u.func,active:u.bool};G.defaultProps={prefixCls:W.ITEM,active:!1,className:""};const te=b.createContext(null),we=t=>{const{type:e}=f.useContext(te);return(()=>{switch(e){case"fill":return b.createElement(B,Object.assign({},t));case"basic":return b.createElement(M,Object.assign({},t));case"nav":return b.createElement(G,Object.assign({},t));default:return null}})()};var he=function(t,e){var r={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(r[a]=t[a]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,a=Object.getOwnPropertySymbols(t);n<a.length;n++)e.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(t,a[n])&&(r[a[n]]=t[a[n]]);return r};const V=t=>{const{current:e,status:r,children:a,prefixCls:n,initial:l,direction:m,className:d,style:i,onChange:o}=t,g=he(t,["current","status","children","prefixCls","initial","direction","className","style","onChange"]),x=f.useMemo(()=>{const h=f.Children.toArray(a).filter(v=>f.isValidElement(v)),C=m==="vertical"?null:{width:`${100/h.length}%`};return f.Children.map(h,(v,p)=>{if(!v)return null;const k=l+p,_=Object.assign({stepNumber:`${k+1}`,direction:m},v.props);return r==="error"&&p===e-1&&(_.className=`${n}-next-error`),v.props.status||(k===e?_.status=r:k<e?_.status="finish":_.status="wait"),_.onChange=o?()=>{p!==e&&o(p+l)}:void 0,b.createElement(le,{style:C},f.cloneElement(v,Object.assign({},_)))})},[a,l,n,m,r,e,o]),w=P(d,{[n]:!0,[`${n}-${m}`]:!0});return b.createElement("div",Object.assign({className:w,style:i,"aria-label":t["aria-label"]},A(g)),b.createElement(ie,{type:"flex",justify:"start"},x))};V.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"])};V.defaultProps={prefixCls:W.PREFIX,current:0,direction:"horizontal",initial:0,status:"process"};var ge=function(t,e){var r={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(r[a]=t[a]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,a=Object.getOwnPropertySymbols(t);n<a.length;n++)e.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(t,a[n])&&(r[a[n]]=t[a[n]]);return r};const U=t=>{const{size:e,current:r,status:a,children:n,prefixCls:l,initial:m,direction:d,className:i,style:o,hasLine:g,onChange:x}=t,w=ge(t,["size","current","status","children","prefixCls","initial","direction","className","style","hasLine","onChange"]),h=f.useMemo(()=>{const S=f.Children.toArray(n).filter(p=>f.isValidElement(p));return f.Children.map(S,(p,k)=>{if(!p)return null;const _=m+k,E=Object.assign({stepNumber:`${_+1}`,size:e},p.props);return a==="error"&&k===r-1&&(E.className=`${l}-next-error`),p.props.status||(_===r?E.status=a:_<r?E.status="finish":E.status="wait"),E.active=_===r,E.done=_<r,E.onChange=x?()=>{k!==r&&x(k+m)}:void 0,f.cloneElement(p,Object.assign({},E))})},[n,m,l,d,a,r,e,x]),C=P(i,{[`${l}-basic`]:!0,[`${l}-${d}`]:!0,[`${l}-${e}`]:e!=="default",[`${l}-hasline`]:g});return b.createElement("div",Object.assign({"aria-label":t["aria-label"],className:C,style:o},A(w)),h)};U.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};U.defaultProps={prefixCls:W.PREFIX,current:0,direction:"horizontal",size:"",initial:0,hasLine:!0,status:"process"};var xe=function(t,e){var r={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(r[a]=t[a]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,a=Object.getOwnPropertySymbols(t);n<a.length;n++)e.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(t,a[n])&&(r[a[n]]=t[a[n]]);return r};const L=t=>{const{size:e,current:r,initial:a,children:n,prefixCls:l,className:m,style:d,onChange:i}=t,o=xe(t,["size","current","initial","children","prefixCls","className","style","onChange"]),g=f.useMemo(()=>{const w=f.Children.toArray(n).filter(S=>f.isValidElement(S)),h=w.length;return f.Children.map(w,(S,v)=>{if(!S)return null;const p=Object.assign({index:v,total:h},S.props);return p.active=v===r,p.onChange=i?()=>{v!==r&&i(v+a)}:void 0,f.cloneElement(S,Object.assign({},p))})},[n,l,r,e,a,i]),x=P(m,{[`${l}-nav`]:!0,[`${l}-${e}`]:e!=="default"});return b.createElement("div",Object.assign({"aria-label":t["aria-label"],className:x,style:d},A(o)),g)};L.propTypes={prefixCls:u.string,className:u.string,style:u.object,current:u.number,initial:u.number,size:u.oneOf(["small","default"])};L.defaultProps={prefixCls:W.PREFIX,current:0,direction:"horizontal",size:"default",initial:0,status:"process"};var be=function(t,e){var r={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(r[a]=t[a]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,a=Object.getOwnPropertySymbols(t);n<a.length;n++)e.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(t,a[n])&&(r[a[n]]=t[a[n]]);return r};class R extends f.Component{renderComponent(){const e=this.props,{type:r}=e,a=be(e,["type"]);switch(r){case"fill":return b.createElement(V,Object.assign({},a));case"basic":return b.createElement(U,Object.assign({},a));case"nav":return b.createElement(L,Object.assign({},a));default:return null}}render(){const{type:e}=this.props;return b.createElement(te.Provider,{value:{type:e}},this.renderComponent())}}R.Step=we;R.propTypes={onChange:u.func,type:u.oneOf(["fill","basic","nav"]),size:u.oneOf(["small","default"])};R.defaultProps={type:"fill",size:"default"};const O={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 Se({codeMd5:t,clientKey:e}){return N({url:"/game/wasm-split-config",method:"GET",data:{codeMd5:t,clientKey:e}})}function ve(t){const{codePath:e,codeMd5:r,clientKey:a,desc:n}=t;return N({url:"/game/wasm-prepare",method:"POST",data:{codePath:e,clientKey:a,codeMd5:r,desc:n}})}function _e({codeMd5:t,clientKey:e}){return N({url:"/game/wasm-prepare-result",method:"POST",data:{codeMd5:t,clientKey:e}})}function Ce(t,e){const r=e?.intervalMs,a=e?.maxAttempts,n=e?.signal||new AbortController().signal;let l=0;return new Promise((m,d)=>{if(n?.aborted){d(new DOMException("Polling aborted","AbortError"));return}const i=()=>{clearTimeout(o),d(new DOMException("Polling aborted","AbortError"))};n?.addEventListener("abort",i,{once:!0});let o;const g=async()=>{l+=1;try{const x=await _e(t),{status:w}=x.data;if(w===O.WasmPreparedSuccess||w===O.WasmSplitDone){m(x);return}if(w<0){m(x);return}if(l>=a){d(new Error(`Polling timeout after ${a} attempts`));return}o=window.setTimeout(g,r)}catch(x){if(l>=a){d(x);return}o=window.setTimeout(g,r)}};g()})}function je({codeMd5:t,clientKey:e,codePath:r}){return N({url:"/game/wasm-prepare-download",method:"POST",data:{codeMd5:t,clientKey:e,codePath:r}})}function ye(t){const{codeMd5:e,clientKey:r}=t;return N({url:"/game/wasm-split",method:"POST",data:{codeMd5:e,clientKey:r}})}function ke({codeMd5:t,clientKey:e}){return N({url:"/game/wasm-split-result",method:"POST",data:{codeMd5:t,clientKey:e}})}function Ne(t,e){const r=e?.intervalMs,a=e?.maxAttempts,n=e?.signal||new AbortController().signal;let l=0;return new Promise((m,d)=>{if(n?.aborted){d(new DOMException("Polling aborted","AbortError"));return}const i=()=>{clearTimeout(o),d(new DOMException("Polling aborted","AbortError"))};n?.addEventListener("abort",i,{once:!0});let o;const g=async()=>{l+=1;try{const x=await ke(t),{status:w}=x.data;if(w!==O.WasmSplitDone){if(l>=a){d(new Error(`Polling timeout after ${a} attempts`));return}o=window.setTimeout(g,r);return}m(x)}catch(x){if(l>=a){d(x);return}o=window.setTimeout(g,r)}};g()})}function Ee({codeMd5:t,clientKey:e}){return N({url:"/game/wasm-split-download-result",method:"POST",data:{clientKey:e,codeMd5:t}})}function Pe(t){return N({url:"/game/wasm-split-download",method:"POST",data:t})}function se(t){const{codeMd5:e,clientKey:r,codePath:a}=t;return N({url:"/game/wasm-split-reset",method:"POST",data:{codeMd5:e,clientKey:r,codePath:a}})}function Oe({codeMd5:t,clientKey:e}){return N({url:"/game/wasm-taskinfo",method:"GET",data:{codeMd5:t,clientKey:e}})}function $e({codeMd5:t,clientKey:e}){return N({url:"/game/wasm-set-collect",method:"POST",data:{codeMd5:t,clientKey:e}})}function X(t){return N({url:"/game/wasm-collect-funcids",method:"GET",data:t})}function Re(t){return N({url:"/game/wasm-collect-info",method:"GET",data:t})}const D={container:"wasm-prepare-downloading-content",process:"wasm-prepare-downloading-text",success:"wasm-prepare-downloading-success",error:"wasm-prepare-downloading-error"},Te=({kind:t,children:e})=>{const r={process:D.process,success:D.success,error:D.error};return s.jsx("div",{className:r[t],children:e})},Z={star_fetch_prepared_wasm_url:{kind:"process",text:"fetchDownloadUrl",showSpin:!0},fetch_prepared_wasm_url_done:{kind:"success",text:"fetchDownloadUrlSuccess",showSpin:!0},fetch_prepared_wasm_url_failed:{kind:"error",text:"fetchDownloadUrlFailed",appendError:!0},start_download_prepared_wasm:{kind:"process",text:"downloadPreparedWasmCode",showSpin:!0},download_prepared_wasm_done:{kind:"success",text:"downloadPreparedWasmCodeSuccess",showSpin:!0},download_prepared_wasm_failed:{kind:"error",text:"downloadPreparedWasmCodeFailed",appendError:!0,showRetry:!0},start_compress_prepared_wasm:{kind:"process",text:"compressPreparedWasmCode",showSpin:!0},compress_prepared_wasm_done:{kind:"success",text:"compressPreparedWasmCodeSuccess",showSpin:!0},start_write_compress_prepared_wasm:{kind:"process",text:"writeCompressPreparedWasmCode",showSpin:!0},start_update_wasm_split_config:{kind:"process",text:"updateWasmSplitConfig",showSpin:!0},update_wasm_split_config_done:{kind:"success",text:"updateWasmSplitConfigSuccess"},update_wasm_split_config_failed:{kind:"error",text:"updateWasmSplitConfigFailed",appendError:!0},default:{kind:"process",text:"processing",showSpin:!0}},We=({onCancel:t,onRetry:e,onHide:r})=>{const[a,n]=f.useState(""),[l,m]=f.useState("");f.useEffect(()=>{const g=x=>{n(x.status),m(x.errorMsg||"")};return z.on("unitySplitStatus",g),()=>{z.off("unitySplitStatus",g)}},[]);const d=f.useMemo(()=>Z[a]??Z.default,[a]),i=s.jsx($,{size:"large",color:"primary"}),o=typeof d.text=="string"?c(d.text)??d.text:"";return s.jsxs("div",{className:D.container,children:[d.showSpin&&i,!!o&&s.jsx(Te,{kind:d.kind,children:o}),d.appendError&&!!l&&s.jsx("div",{className:D.error,children:l}),d.showRetry&&s.jsx(j,{onClick:e,children:c("retryDownload")}),s.jsx(j,{style:{marginTop:12},type:"tertiary",onClick:r,children:c("backgroundRun")})]})},Fe=({onSubmit:t,onCancel:e,onChange:r})=>s.jsxs(H,{style:{width:"100%",transform:"translateY(-20px)"},onChange:r,onSubmit:t,children:[s.jsx(H.TextArea,{rules:[{required:!0,message:c("inputSplitDesc")}],label:c("splitDesc"),placeholder:c("inputSplitDesc"),field:"desc"}),s.jsxs("div",{className:"wasm-prepare-form-button-container",children:[s.jsx(j,{type:"tertiary",htmlType:"submit",style:{marginRight:12},children:c("startPrepare")}),s.jsx(j,{type:"tertiary",onClick:e,children:c("cancel")})]})]}),y={init:"init",start:"start",processing:O.WasmPreparing,processingReady:O.WasmReadyToPrepare,success:O.WasmPreparedSuccess,failed:O.WasmPrepareFailed,splitDone:O.WasmSplitDone,downloading:"downloading",downloadFailed:"downloadFailed"},K=new AbortController,De=({codePath:t,codeMd5:e,clientKey:r,onCancel:a,onNext:n,onHide:l})=>{const[m,d]=f.useState(""),[i,o]=f.useState({code:0,data:{status:y.init}}),g=f.useMemo(()=>i?.data?.status,[i?.data?.status]),x=()=>{K.abort(),a(),se({codeMd5:e,clientKey:r,codePath:t}).then(p=>{p.code===0&&o({...i,data:{...i?.data,status:y.init}})})},w=()=>{o({code:0,data:{status:y.start}}),ve({codePath:t,codeMd5:e,clientKey:r,desc:m}).then(p=>{p.code===0||p?.error?.code===10024||p?.error?.code===10028?(o({...p,data:{...p?.data,status:y.processing}}),h()):o({...i,error:p?.error||{code:-1,message:"Internal server error, please try again later..."},data:{...i?.data,status:y.failed}})})},h=()=>{Ce({codeMd5:e,clientKey:r},{intervalMs:500,maxAttempts:100,signal:K.signal}).then(p=>{p.code===0?o(p):o({...i,data:{...i?.data}})})},C=()=>{o({...i,data:{...i?.data,status:"downloading"}}),je({codePath:t,codeMd5:e,clientKey:r}).then(p=>{p.code===0?(o({...i,data:{...i?.data,status:y.success}}),n()):o({...i,data:{...i?.data,status:y.downloadFailed}})})},S=p=>{d(p?.values?.desc)};let v=null;switch(g){case y.init:v=s.jsx(Fe,{onSubmit:w,onCancel:a,onChange:S});break;case y.start:v=s.jsxs("div",{className:"wasm-prepare-processing-content",children:[s.jsx($,{size:"large",color:"primary"}),s.jsx("div",{className:"wasm-prepare-processing-text",children:c("startingPrepare")}),s.jsx("div",{className:"wasm-prepare-processing-cancel",children:s.jsxs(T,{children:[s.jsx(j,{type:"danger",onClick:a,children:c("cancelPrepare")}),s.jsx(j,{onClick:()=>l(),children:c("backgroundRun")})]})})]});break;case y.processing:case y.processingReady:v=s.jsxs("div",{className:"wasm-prepare-processing-content",children:[s.jsx($,{size:"large",color:"primary"}),s.jsx("div",{className:"wasm-prepare-processing-text",children:c("preparingSplit")}),s.jsx("div",{className:"wasm-prepare-processing-warning",children:c("warningDuringPreparing")}),s.jsx("div",{className:"wasm-prepare-processing-cancel",children:s.jsxs(T,{children:[s.jsx(j,{type:"tertiary",onClick:()=>{x()},children:c("cancelPrepare")}),s.jsx(j,{type:"tertiary",onClick:()=>l(),children:c("backgroundRun")})]})})]});break;case y.success:case y.splitDone:v=s.jsxs("div",{className:"wasm-prepare-success-content",children:[s.jsx("div",{className:"wasm-prepare-success-text",children:c("preparingSplitSuccess")}),s.jsx("div",{className:"wasm-prepare-success-download",children:s.jsx(j,{type:"tertiary",onClick:()=>{C()},children:c("downloadPreparedWasmCode")})})]});break;case y.downloading:v=s.jsx(We,{onHide:l});break;case y.downloadFailed:const p=i?.error?.message||"Unknown error";v=s.jsxs("div",{className:"wasm-prepare-downloadfailed-content",children:[s.jsx("div",{className:"wasm-prepare-downloadfailed-text",children:c("downloadFailed")}),s.jsx("div",{className:"wasm-prepare-downloadfailed-warning",children:p}),s.jsx(j,{onClick:C,children:c("retryDownload")})]});break;case y.failed:const k=i?.error?.message||"Unknown error";v=s.jsxs("div",{className:"wasm-prepare-failed-content",children:[s.jsx("div",{className:"wasm-prepare-failed-text",children:c("preparingSplitFailed")}),i?.data?.status===y.failed&&s.jsx("div",{className:"wasm-prepare-failed-warning",children:k}),s.jsx(j,{type:"tertiary",style:{marginTop:12},onClick:w,children:c("retryPrepare")})]});break;default:v=null}return s.jsx("div",{className:"wasm-prepare-content-container",children:v})},Ie=({data:t})=>{const e={...t||{}},r=[{label:"Client key",value:"app_id"},{label:c("wasmSize"),value:"wasm_size",render:a=>`${(a/1024/1024).toFixed(2)} MB`},{label:c("totalFuncCount"),value:"total_wasm_func_count",render:a=>a>=1e3?`${(a/1e3).toFixed(2)} K`:`${a}`},{label:c("collectedFuncCount"),value:"collected_func_count",render:a=>a>=1e3?`${(a/1e3).toFixed(2)} K`:`${a}`},{label:"Wasm md5",value:"wasm_md5"}];return s.jsx("div",{className:"wasm-collect-status",children:r.map(a=>s.jsxs("div",{className:"wasm-collect-status-item",children:[s.jsx(oe,{size:"small",className:"wasm-collect-status-item-label",children:a.label}),s.jsx("span",{className:"wasm-collect-status-item-value",children:a.render?.(e[a.value])||e[a.value]})]},a.value))})},ze=({onNext:t,codeMd5:e,clientKey:r,onHide:a})=>{const{state:{devSchema:n}}=ce(),[l,m]=f.useState("willCollect"),[d,i]=f.useState(),[o,g]=f.useState(),[x,w]=f.useState(0),h=f.useRef(null),C=f.useMemo(()=>!o||!o?.total_wasm_func_count?!1:(x||0)/(o?.total_wasm_func_count||0)>=.08,[o,x]);f.useEffect(()=>{if(l!=="collecting"){h.current&&(window.clearInterval(h.current),h.current=null);return}if(!h.current)return X({codeMd5:e,clientKey:r}).then(p=>{w(p.data?.collected_func_count||0)}).catch(console.error),h.current=window.setInterval(()=>{X({codeMd5:e,clientKey:r}).then(p=>{w(p.data?.collected_func_count||0)}).catch(p=>{console.error(p)})},2e3),()=>{h.current&&(window.clearInterval(h.current),h.current=null)}},[l,e,r]);const S=async()=>{if(l!=="collecting")try{m("startCollect");const p=await $e({codeMd5:e,clientKey:r});m("collecting"),Oe({codeMd5:e,clientKey:r}).then(k=>{i(k.data)}).catch(console.error),Re({codeMd5:e,clientKey:r}).then(k=>{g(k.data||{})}).catch(console.error)}catch(p){console.error(p)}},v=()=>{h.current&&(window.clearInterval(h.current),h.current=null),m("willCollect"),t()};return s.jsxs("div",{className:"wasm-collect-content-container",children:[d&&s.jsx(Ie,{data:{...d||{},total_wasm_func_count:o?.total_wasm_func_count,collected_func_count:x}}),s.jsx("div",{className:"collect-qrcode-container",children:s.jsx(de,{value:n})}),s.jsx("div",{className:"collect-qrcode-desc",children:c("collectDesc")}),s.jsxs("div",{className:"collect-qrcode-button-container",children:[l!=="collecting"&&s.jsx(j,{loading:l==="startCollect",onClick:S,children:c("startCollect")}),l==="collecting"&&s.jsxs(T,{children:[C?s.jsx(j,{type:"tertiary",onClick:v,children:c("startSplit")}):s.jsx(ue,{content:c("cannotSplitTip"),children:s.jsx(j,{type:"tertiary",disabled:!0,children:c("startSplit")})}),s.jsx(j,{type:"tertiary",onClick:a,children:c("backgroundRun")})]})]})]})},Ae=({onCancel:t,onHide:e})=>{const[r,a]=f.useState(""),[n,l]=f.useState("");f.useEffect(()=>{const o=g=>{a(g.status),l(g.errorMsg||"")};return z.on("unitySplitStatus",o),()=>{z.off("unitySplitStatus",o)}},[]);let m=null;const d="wasm-split-downloading-content",i="wasm-split-downloading-text";switch(r){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":m=s.jsxs("div",{className:d,children:[s.jsx($,{size:"large",color:"primary"}),s.jsx("div",{className:i,children:c(r)}),s.jsxs(T,{children:[s.jsx(j,{type:"danger",onClick:t,children:c("cancelSplit")}),s.jsx(j,{onClick:e,children:c("backgroundRun")})]})]});break;default:m=s.jsxs("div",{className:d,children:[s.jsx($,{size:"large",color:"primary"}),s.jsx("div",{className:i,children:c("processing")})]})}return m},Q=new AbortController,Me=({onCancel:t,onHide:e,codeMd5:r,clientKey:a})=>{const[n,l]=f.useState("spliting"),[m,d]=f.useState(),i=()=>{Q.abort(),t()},o=()=>{l("downloadingSplitResult"),Pe(m?.result).then(h=>{h.code===0?l("downloadSuccess"):l("downloadFailed")}).catch(()=>{l("downloadFailed")})},g=()=>{l("spliting"),ye({codeMd5:r,clientKey:a}).then(h=>{h.code===0&&Ne({codeMd5:r,clientKey:a},{intervalMs:1e3,maxAttempts:1e3,signal:Q.signal}).then(C=>{l("splitSuccess"),x()})}).catch(()=>{l("splitFailed")})},x=()=>{l("startGetSplitResult"),Ee({clientKey:a,codeMd5:r}).then(h=>{h.code===0?(d(h.data),l("getSplitResultSuccess")):l("getSplitResultFailed")})};f.useEffect(()=>{g()},[]);let w=null;switch(n){case"spliting":w=s.jsxs("div",{className:"wasm-split-processing",children:[s.jsx($,{size:"large",color:"primary"}),s.jsx("div",{className:"wasm-split-processing-content",children:c("splittingDesc")}),s.jsx("div",{className:"wasm-split-processing-cancel",children:s.jsxs(T,{children:[s.jsx(j,{onClick:()=>i(),type:"danger",children:c("cancelSplit")}),s.jsx(j,{onClick:()=>e(),children:c("backgroundRun")})]})})]});break;case"splitSuccess":w=s.jsx("div",{className:"wasm-split-success",children:s.jsx("div",{className:"wasm-split-success-content",children:c("getSplitResult")})});break;case"startGetSplitResult":w=s.jsxs("div",{className:"wasm-split-processing",children:[s.jsx($,{}),s.jsx("div",{className:"wasm-split-processing-content",children:c("getSplitResult")})]});break;case"getSplitResultFailed":w=s.jsxs("div",{className:"wasm-split-failed",children:[s.jsx("div",{className:"wasm-split-failed-content",children:c("getSplitResultFailed")}),s.jsx("div",{className:"wasm-split-failed-retry",children:s.jsx(j,{type:"primary",onClick:()=>x(),children:c("retryGetSplitResult")})})]});break;case"getSplitResultSuccess":w=s.jsxs("div",{className:"wasm-split-success",children:[s.jsx("div",{className:"wasm-split-success-content",children:c("splitSuccess")}),s.jsx("div",{className:"wasm-split-success-download",children:s.jsx(j,{type:"primary",onClick:()=>o(),children:c("downloadSplitResult")})})]});break;case"getDownloadResultFailed":w=s.jsxs("div",{className:"wasm-split-failed",children:[s.jsx("div",{className:"wasm-split-failed-content",children:c("getSplitResultFailed")}),s.jsx("div",{className:"wasm-split-failed-retry",children:s.jsx(j,{type:"primary",onClick:()=>x(),children:c("retryGetSplitResult")})})]});break;case"downloadingSplitResult":w=s.jsx(Ae,{onCancel:i,onHide:e});break;case"downloadSuccess":w=s.jsxs("div",{className:"wasm-split-success",children:[s.jsx("div",{className:"wasm-split-success-content",children:c("downloadSplitResultSuccess")}),s.jsx("div",{className:"wasm-split-success-tip",children:c("downloadSplitResultTip")})]});break;default:w=null}return s.jsx("div",{className:"wasm-split-content-container",children:w})},I={prepare:{number:0,title:c("splitPrepare")},collect:{number:1,title:c("splitCollect")},split:{number:2,title:c("splitCode")},rollback:{number:3,title:c("rollback")}},Be=({stage:t})=>s.jsxs(R,{type:"basic",current:I[t].number,style:{marginTop:24},children:[s.jsx(R.Step,{title:I.prepare.title}),s.jsx(R.Step,{title:I.collect.title}),s.jsx(R.Step,{title:I.split.title})]}),Ge=({onCancel:t,errorType:e,onHide:r})=>s.jsxs("div",{className:"wasm-code-split-error",children:[e==="noWasmCode"&&s.jsxs("div",{className:"wasm-code-split-error-container",children:[s.jsx("div",{className:"wasm-code-split-error-title",children:c("noWasmCode")}),s.jsx("div",{className:"wasm-code-split-error-desc",children:c("noWasmCodeDesc")})]}),e==="hasSplited"&&s.jsxs("div",{className:"wasm-code-split-error-container",children:[s.jsx("div",{className:"wasm-code-split-error-title",children:c("hasSplitedTitle")}),s.jsx("div",{className:"wasm-code-split-error-desc",children:c("hasSplitedDesc")}),s.jsxs(T,{children:[s.jsx(j,{onClick:t,children:c("cancelSplit")}),s.jsx(j,{onClick:r,children:c("backgroundRun")})]})]}),e==="noSplitConfig"&&s.jsxs("div",{className:"wasm-code-split-error-container",children:[s.jsx("div",{className:"wasm-code-split-error-title",children:c("noSplitConfigTitle")}),s.jsx("div",{className:"wasm-code-split-error-desc",children:c("noSplitConfigDesc")})]})]}),Ve=()=>s.jsxs("div",{className:"split-loading",children:[s.jsx($,{size:"large",color:"primary"}),s.jsx("div",{className:"split-loading-text",children:"正在初始化分包环境"})]}),Ue=({codeMd5:t,clientKey:e,codePath:r,onHide:a,onReset:n})=>{const[l,m]=f.useState("rollbacking"),d=()=>{m("rollbacking"),se({codeMd5:t,clientKey:e,codePath:r}).then(g=>{g.code===0?(m("rollbackSuccess"),n()):m("rollbackFailed")})};f.useEffect(()=>{d()},[]);let i="",o=null;switch(l){case"rollbacking":i="回滚中...",o=s.jsx(j,{onClick:()=>{m("rollbackFailed")},children:"后台进行"});break;case"rollbackSuccess":i="回滚成功",o=s.jsx(j,{onClick:()=>{a()},children:"关闭"});break;case"rollbackFailed":i="回滚失败",o=s.jsx(j,{onClick:()=>{d()},children:"重试"});break}return s.jsx(s.Fragment,{children:s.jsxs("div",{className:"wasm-split-rollback-container",children:[s.jsx("div",{className:"wasm-split-rollback-text",children:i}),o]})})};function Le({enableWasmCollect:t,enableWasmSplit:e}){return typeof t=="boolean"&&(typeof e=="string"||e===!1)?t:!1}function qe({enableWasmSplit:t,hasWasmCode:e}){return t===!0?{errorType:"hasSplited",hasError:!0}:e?{hasError:!1}:{errorType:"noWasmCode",hasError:!0}}const Xe=({codePath:t,clientKey:e,codeMd5:r})=>{const[a,n]=f.useState(!1),[l,m]=f.useState(""),[d,i]=f.useState("loading"),[o,g]=f.useState(null),x=()=>{n(!0),(!o||d==="error")&&(i("loading"),Se({codeMd5:r,clientKey:e}).then(C=>{if(C.code===0){const{errorType:S,hasError:v}=qe({enableWasmSplit:C.data.enableWasmSplit,hasWasmCode:!!t});m(S),v?(m(S),i("error")):Le(C.data)?i("collect"):i("prepare"),g(C.data)}else i("error")}))},w=()=>{n(!1)},h=()=>{i("rollback")};return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:P("wasm-code-split",{}),onClick:x,children:[s.jsx(fe,{size:"default"}),s.jsx("span",{className:"wasm-code-split-text",children:c("wasmSplit")})]}),s.jsxs(pe,{centered:!0,keepDOM:!0,maskClosable:!1,visible:a,footer:null,style:{width:"90%"},onCancel:()=>n(!1),onOk:()=>n(!1),title:c("wasmSplit"),children:[d==="loading"&&s.jsx(Ve,{}),d==="error"&&s.jsx(Ge,{errorType:l,onCancel:h,onHide:w}),d!=="error"&&d!=="loading"&&s.jsx(Be,{stage:d}),d==="prepare"&&s.jsx(De,{codeMd5:r,codePath:t,clientKey:e,onCancel:()=>{n(!1)},onNext:()=>{i("collect")},onHide:w}),d==="collect"&&s.jsx(ze,{codeMd5:r,clientKey:e,onCancel:()=>{n(!1),i("prepare")},onHide:w,onNext:()=>{i("split")}}),d==="split"&&s.jsx(Me,{codeMd5:r,clientKey:e,onCancel:h,onHide:w}),d==="rollback"&&s.jsx(Ue,{codeMd5:r,clientKey:e,codePath:t,onHide:w,onReset:()=>{i("prepare")}})]})]})};export{Xe as WasmCodeSplit};
@@ -1 +1 @@
1
- import{r as s,j as e,S as b,C as k,T as g}from"./index-BGB_3rmy.js";const m=c=>{const{open:C,onClose:u}=c,[t,n]=s.useState(!0),[o,l]=s.useState(!1),[d,i]=s.useState(!1),[x,E]=s.useState(!1),r=[{label:"是否开启域名校验",description:"开启后,客户端将校验所有请求的域名是否合法,建议开发环境关闭以便调试。",checked:t,onChange:n},{label:"是否开启 IAA Mock",description:"启用后,广告相关接口将返回模拟数据,方便开发和测试广告逻辑。",checked:o,onChange:l},{label:"是否开启 IAP Mock",description:"启用后,内购相关流程将使用模拟支付,避免真实扣费。",checked:d,onChange:i}];return e.jsx("div",{children:e.jsx(b,{vertical:!0,align:"start",spacing:"loose",children:r.map((a,h)=>e.jsxs("div",{children:[e.jsx(k,{checked:a.checked,onChange:p=>a.onChange(p.target.checked),children:a.label}),e.jsx(g.Text,{type:"tertiary",style:{display:"block",marginTop:4},children:a.description})]},h))})})};export{m as DebugSetting};
1
+ import{r as s,j as e,S as b,C as k,T as g}from"./index-Bf-QbPMA.js";const m=c=>{const{open:C,onClose:u}=c,[t,n]=s.useState(!0),[o,l]=s.useState(!1),[d,i]=s.useState(!1),[x,E]=s.useState(!1),r=[{label:"是否开启域名校验",description:"开启后,客户端将校验所有请求的域名是否合法,建议开发环境关闭以便调试。",checked:t,onChange:n},{label:"是否开启 IAA Mock",description:"启用后,广告相关接口将返回模拟数据,方便开发和测试广告逻辑。",checked:o,onChange:l},{label:"是否开启 IAP Mock",description:"启用后,内购相关流程将使用模拟支付,避免真实扣费。",checked:d,onChange:i}];return e.jsx("div",{children:e.jsx(b,{vertical:!0,align:"start",spacing:"loose",children:r.map((a,h)=>e.jsxs("div",{children:[e.jsx(k,{checked:a.checked,onChange:p=>a.onChange(p.target.checked),children:a.label}),e.jsx(g.Text,{type:"tertiary",style:{display:"block",marginTop:4},children:a.description})]},h))})})};export{m as DebugSetting};
@@ -1 +1 @@
1
- import{G as ge,r as b,B as Te,a as oe,l as z,H as V,J as ye,R as a,b as le,K as Oe,M as _e,c as K,O as Ae,Q as be,P as o,t as S,U as De,V as ie,W as ae,A as Pe,m as re,X as ce,L as je,s as He,j as u,Y as ee,u as Me,w as Le,Z as Re,d as Ve,i as W,D as ke}from"./index-BGB_3rmy.js";import{D as se}from"./index-Be7GH3NR.js";function $e(p){return b.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},p),b.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 4.5a7.5 7.5 0 1 1-7.07 10 1.5 1.5 0 0 0-2.83 1 10.5 10.5 0 1 0 1.27-9.48l-.43-1.45a1.5 1.5 0 1 0-2.88.86l1.5 5c.23.74.98 1.2 1.73 1.04l5-1a1.5 1.5 0 0 0-.58-2.94l-2.01.4A7.5 7.5 0 0 1 12 4.5Zm1.5 3a1.5 1.5 0 0 0-3 0V12c0 .4.16.78.44 1.06l3 3a1.5 1.5 0 0 0 2.12-2.12l-2.56-2.56V7.5Z",fill:"currentColor"}))}const Fe=ge($e,"history");function Ge(p){return b.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},p),b.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5 2h14a3 3 0 0 1 3 3v14a3 3 0 0 1-3 3H5a3 3 0 0 1-3-3V5a3 3 0 0 1 3-3Zm1 2a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1H6Z",fill:"currentColor"}))}const Ze=ge(Ge,"sidebar"),de="horizontal",pe="vertical",x={PREFIX:`${Te}-navigation`},h={MODE:[pe,de],MODE_VERTICAL:pe,MODE_HORIZONTAL:de,ICON_POS_LEFT:"left",ICON_POS_RIGHT:"right",TOGGLE_ICON_LEFT:"left",TOGGLE_ICON_RIGHT:"right"},$={DEFAULT_SUBNAV_MAX_HEIGHT:999,DEFAULT_TOOLTIP_SHOW_DELAY:0,DEFAULT_TOOLTIP_HIDE_DELAY:100,DEFAULT_SUBNAV_OPEN_DELAY:0,DEFAULT_SUBNAV_CLOSE_DELAY:100},ue={open:"chevron_up",closed:"chevron_down"};let Be=class ne{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(t==null||typeof t!="object")&&(t={text:t,itemKey:t,maxHeight:$.DEFAULT_SUBNAV_MAX_HEIGHT,link:null,items:null,icon:"",indent:!1});for(const e of Object.keys(t))this[e]=t[e];t.items&&Array.isArray(t.items)&&t.items.length?(this.items=t.items.map(e=>new ne(e)),"toggleIcon"in t?this.toggleIcon=ne.isValidToggleIcon(t.toggleIcon)?Object.assign({},t.toggleIcon):Object.assign({},ue):this.toggleIcon=Object.assign({},ue)):this.items=null}static isValidToggleIcon(t){return!!(t&&typeof t=="object"&&typeof t.open=="string"&&t.open.length&&typeof t.closed=="string"&&t.closed.length)}};class F extends oe{constructor(t){super(Object.assign({},t))}static getZeroParentKeys(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const e=[];for(var s=arguments.length,n=new Array(s>1?s-1:0),i=1;i<s;i++)n[i-1]=arguments[i];if(n.length){for(const l of n)if(Array.isArray(t[l])&&t[l].length){const r=t[l][0];V(r)||e.push(r)}}return e}static buildItemKeysMap(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"itemKey";var i;if(Array.isArray(t)&&t.length)for(const l of t)if(Array.isArray(l))F.buildItemKeysMap(l,e,[...s],n);else{let r;if(l&&typeof l=="object"&&(r=l[n]||l.props&&l.props[n]),r){e[r]=[...s];const c=(i=l.props)===null||i===void 0?void 0:i.children;if(Array.isArray(l.items)&&l.items.length)F.buildItemKeysMap(l.items,e,[...s,r],n);else if(c){const d=Array.isArray(c)?c:[c];F.buildItemKeysMap(d,e,[...s,r],n)}}}return e}init(t){const{defaultSelectedKeys:e,selectedKeys:s}=this.getProps();let n=s||e||[];const{itemKeysMap:i,willOpenKeys:l,formattedItems:r}=this.getCalcState(),c=this.selectLevelZeroParentKeys(i,n);if(n=n.concat(c),t==="constructor")return{selectedKeys:n,itemKeysMap:i,openKeys:l,items:r};this._adapter.updateSelectedKeys(n,!1),this._adapter.setItemKeysMap(i),this._adapter.updateOpenKeys(l),this._adapter.updateItems(r),this._adapter.setItemsChanged(!0)}getCalcState(){const{itemKeysMap:t,formattedItems:e}=this.getFormattedItems(),s=this.getWillOpenKeys(t);return{itemKeysMap:t,willOpenKeys:s,formattedItems:e}}getFormattedItems(){const{items:t,children:e}=this.getProps(),s=this.formatItems(t),n=Array.isArray(t)&&t.length?s:e;return{itemKeysMap:F.buildItemKeysMap(n),formattedItems:s}}getWillOpenKeys(t){const{defaultOpenKeys:e,openKeys:s,defaultSelectedKeys:n,selectedKeys:i,mode:l}=this.getProps(),{openKeys:r=[]}=this.getStates();let c=s||e||[];if(!(Array.isArray(e)||Array.isArray(s))&&l===h.MODE_VERTICAL&&(Array.isArray(n)||Array.isArray(i))){const d=Array.isArray(i)?i:n;c=r.concat(this.getShouldOpenKeys(t,d)),c=Array.from(new Set(c))}return[...c]}getShouldOpenKeys(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const s=new Set;return Array.isArray(e)&&e.length&&e.forEach(n=>{if(n){const i=z(t,n);Array.isArray(i)&&i.forEach(l=>s.add(l))}}),[...s]}destroy(){}selectLevelZeroParentKeys(t,e){const s=V(t)?this.getState("itemKeysMap"):t,n=[];if(e.length){for(const i of e)if(Array.isArray(s[i])&&s[i].length){const l=s[i][0];V(l)||n.push(l)}}return n.length?n:[]}formatItems(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];const e=[];for(const s of t)e.push(new Be(s));return e}handleSelect(t){this._adapter.notifySelect(t)}judgeIfOpen(t,e){let s=!1;const n=Array.isArray(t)?t:t&&[t];if(n&&Array.isArray(e)&&e.length){for(const i of e)if(s=n.includes(i.itemKey)||this.judgeIfOpen(n,i.items),s)break}return s}handleCollapseChange(){const t=!this.getState("isCollapsed");this._isControlledComponent("isCollapsed")||this._adapter.setIsCollapsed(t),this._adapter.notifyCollapseChange(t)}handleItemsChange(t){this._adapter.setItemsChanged(t)}}const he=function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];const e=new Set(t);for(var s=arguments.length,n=new Array(s>1?s-1:0),i=1;i<s;i++)n[i-1]=arguments[i];return n.forEach(l=>l&&e.add(l)),Array.from(e)},me=function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];const e=new Set(t);for(var s=arguments.length,n=new Array(s>1?s-1:0),i=1;i<s;i++)n[i-1]=arguments[i];return n.forEach(l=>l&&e.delete(l)),Array.from(e)};class Ue extends oe{constructor(t){super(Object.assign({},t))}init(){this._timer=null}destroy(){this.clearDelayTimer()}clearDelayTimer(){this._timer&&(clearTimeout(this._timer),this._timer=null)}isValidKey(t){return t!=null&&(typeof t=="number"||typeof t=="string")}handleDropdownVisibleChange(t){const e=this.getProp("itemKey"),s=this._adapter.getOpenKeysIsControlled(),n=this._adapter.getCanUpdateOpenKeys(),i=this._adapter.getOpenKeys(),l=t?he(i,e):me(i,e);this.clearDelayTimer(),s||n&&this._adapter.updateOpen(t),this._adapter.notifyGlobalOpenChange({itemKey:e,openKeys:l,isOpen:t})}handleClick(t,e){const{itemKey:s,disabled:n}=this.getProps();if(n)return;const i=e&&e.contains(t.target);let l=!!this._adapter.getIsOpen();i?l=!l:l=!1;const r=l?he(this._adapter.getOpenKeys(),s):me(this._adapter.getOpenKeys(),s),c={itemKey:s,openKeys:r,isOpen:l,domEvent:t},d=this._adapter.getOpenKeysIsControlled(),m=this._adapter.getCanUpdateOpenKeys();!d&&m&&this._adapter.updateOpen(l),this._adapter.notifyGlobalOpenChange(c),this._adapter.notifyGlobalOnClick(c)}handleKeyPress(t,e){ye(t)&&this.handleClick(t,e)}}class Xe extends oe{constructor(t){super(Object.assign({},t))}init(){this._timer=null,this._mounted=!0}destroy(){this._mounted=!1}isValidKey(t){return t!=null&&(typeof t=="string"||typeof t=="number")}handleClick(t){const{isSubNav:e,itemKey:s,text:n,disabled:i}=this.getProps();if(i)return;!e&&this.isValidKey(s)&&!this._adapter.getSelectedKeysIsControlled()&&!this._adapter.getSelected()&&this._adapter.updateSelected(!0);const l=[s];if(!e){if(!this._adapter.getSelected()){const r=[this._adapter.cloneDeep(this.getProps())];this._adapter.notifyGlobalOnSelect({itemKey:s,selectedKeys:l,selectedItems:r,domEvent:t})}this._adapter.notifyGlobalOnClick({itemKey:s,text:n,domEvent:t})}this._adapter.notifyClick({itemKey:s,text:n,domEvent:t})}handleKeyPress(t){if(ye(t)){const{link:e,linkOptions:s}=this.getProps(),n=z(s,"target","_self");this.handleClick(t),typeof e=="string"&&(n==="_blank"?window.open(e):window.location.href=e)}}}const G=a.createContext({isCollapsed:!1,selectedKeys:[],openKeys:[]}),y=`${x.PREFIX}-item`;class Z extends le{constructor(t){super(t),this.setItemRef=e=>{this.props.forwardRef&&this.props.forwardRef(e)},this.wrapTooltip=e=>{const{text:s,tooltipHideDelay:n,tooltipShowDelay:i}=this.props,l=n??this.context.tooltipHideDelay,r=i??this.context.tooltipShowDelay;return a.createElement(Oe,{content:s,wrapWhenSpecial:!1,position:"right",trigger:"hover",mouseEnterDelay:r,mouseLeaveDelay:l},e)},this.handleClick=e=>this.foundation.handleClick(e),this.handleKeyPress=e=>this.foundation.handleKeyPress(e),this.state={tooltipShow:!1},this.foundation=new Xe(this.adapter)}_invokeContextFunc(t){if(t&&this.context&&typeof this.context[t]=="function"){for(var e=arguments.length,s=new Array(e>1?e-1:0),n=1;n<e;n++)s[n-1]=arguments[n];return this.context[t](...s)}return null}get adapter(){var t=this;return Object.assign(Object.assign({},super.adapter),{cloneDeep:_e,updateTooltipShow:e=>this.setState({tooltipShow:e}),updateSelected:e=>this._invokeContextFunc("updateSelectedKeys",[this.props.itemKey]),updateGlobalSelectedKeys:e=>this._invokeContextFunc("updateSelectedKeys",[...e]),getSelectedKeys:()=>this.context&&this.context.selectedKeys,getSelectedKeysIsControlled:()=>this.context&&this.context.selectedKeysIsControlled,notifyGlobalOnSelect:function(){for(var e=arguments.length,s=new Array(e),n=0;n<e;n++)s[n]=arguments[n];return t._invokeContextFunc("onSelect",...s)},notifyGlobalOnClick:function(){for(var e=arguments.length,s=new Array(e),n=0;n<e;n++)s[n]=arguments[n];return t._invokeContextFunc("onClick",...s)},notifyClick:function(){return t.props.onClick(...arguments)},notifyMouseEnter:function(){return t.props.onMouseEnter(...arguments)},notifyMouseLeave:function(){return t.props.onMouseLeave(...arguments)},getIsCollapsed:()=>this.props.isCollapsed||!!(this.context&&this.context.isCollapsed)||!1,getSelected:()=>!!(this.context&&this.context.selectedKeys&&this.context.selectedKeys.includes(this.props.itemKey)),getIsOpen:()=>!!(this.context&&this.context.openKeys&&this.context.openKeys.includes(this.props.itemKey))})}renderIcon(t,e){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(this.props.isSubNav||!t&&this.context.mode===h.MODE_HORIZONTAL)return null;let i="large";e===h.ICON_POS_RIGHT&&(i="default");const l=K(`${y}-icon`,{[`${y}-icon-toggle-${this.context.toggleIconPosition}`]:s,[`${y}-icon-info`]:!s});return a.createElement("i",{className:l,key:n},Ae(t)?a.cloneElement(t,{size:t.props.size||i}):t)}render(){var t;const{text:e,icon:s,toggleIcon:n,className:i,isSubNav:l,style:r,indent:c,onMouseEnter:d,onMouseLeave:m,link:C,linkOptions:w,disabled:I,level:g=0,tabIndex:L}=this.props,{mode:O,isInSubNav:f,prefixCls:v,limitIndent:B}=this.context,N=this.adapter.getIsCollapsed(),D=this.adapter.getSelected();let E=null;const q=(t=this.props)===null||t===void 0?void 0:t.children;if(!V(q))E=q;else{let j=null;if(O===h.MODE_VERTICAL&&!B&&!N){const T=s&&!c?g:g-1;j=be(T,U=>this.renderIcon(null,h.ICON_POS_RIGHT,!1,U))}E=a.createElement(a.Fragment,null,j,this.context.toggleIconPosition===h.TOGGLE_ICON_LEFT&&this.renderIcon(n,h.ICON_POS_RIGHT,!0,"key-toggle-pos-right"),s||c||f?this.renderIcon(s,h.ICON_POS_LEFT,!1,"key-position-left"):null,V(e)?"":a.createElement("span",{className:`${x.PREFIX}-item-text`},e),this.context.toggleIconPosition===h.TOGGLE_ICON_RIGHT&&this.renderIcon(n,h.ICON_POS_RIGHT,!0,"key-toggle-pos-right"))}typeof C=="string"&&(E=a.createElement("a",Object.assign({className:`${v}-item-link`,href:C,tabIndex:-1},w),E));let P="";if(f&&(N||O===h.MODE_HORIZONTAL)){const j=K({[y]:!0,[`${y}-sub`]:l,[`${y}-selected`]:D,[`${y}-collapsed`]:N,[`${y}-disabled`]:I});P=a.createElement(se.Item,{selected:D,active:D,forwardRef:this.setItemRef,className:j,onClick:this.handleClick,onMouseEnter:d,onMouseLeave:m,disabled:I,onKeyDown:this.handleKeyPress},E)}else{const j=K(`${i||`${y}-normal`}`,{[y]:!0,[`${y}-sub`]:l,[`${y}-selected`]:D&&!l,[`${y}-collapsed`]:N,[`${y}-disabled`]:I,[`${y}-has-link`]:typeof C=="string"}),T={"aria-disabled":I};if(l){const U=this.adapter.getIsOpen();T["aria-expanded"]=U}P=a.createElement("li",Object.assign({role:l?null:"menuitem",tabIndex:l?-1:L},T,{style:r,ref:this.setItemRef,className:j,onClick:this.handleClick,onMouseEnter:d,onMouseLeave:m,onKeyPress:this.handleKeyPress},this.getDataAttr(this.props)),E)}return(N&&!f&&!l||N&&l&&I)&&(P=this.wrapTooltip(P)),typeof this.context.renderWrapper=="function"?this.context.renderWrapper({itemElement:P,isSubNav:l,isInSubNav:f,props:this.props}):P}}Z.contextType=G;Z.propTypes={text:o.oneOfType([o.string,o.node]),itemKey:o.oneOfType([o.string,o.number]),onClick:o.func,onMouseEnter:o.func,onMouseLeave:o.func,icon:o.oneOfType([o.node]),className:o.string,toggleIcon:o.string,style:o.object,forwardRef:o.func,indent:o.oneOfType([o.bool,o.number]),isCollapsed:o.bool,isSubNav:o.bool,link:o.string,linkOptions:o.object,disabled:o.bool,tabIndex:o.number};Z.defaultProps={isSubNav:!1,indent:!1,forwardRef:S,isCollapsed:!1,onClick:S,onMouseEnter:S,onMouseLeave:S,disabled:!1,tabIndex:0};class Y extends le{constructor(t){super(t),this.setItemRef=e=>{e&&e.current?this.itemRef=e:this.itemRef={current:e}},this.setTitleRef=e=>{e&&e.current?this.titleRef=e:this.titleRef={current:e}},this.handleClick=e=>{this.foundation.handleClick(e&&e.nativeEvent,this.titleRef&&this.titleRef.current)},this.handleKeyPress=e=>{this.foundation.handleKeyPress(e&&e.nativeEvent,this.titleRef&&this.titleRef.current)},this.handleDropdownVisible=e=>this.foundation.handleDropdownVisibleChange(e),this.state={isHovered:!1},this.adapter.setCache("firstMounted",!0),this.titleRef=a.createRef(),this.itemRef=a.createRef(),this.foundation=new Ue(this.adapter)}_invokeContextFunc(t){if(t&&this.context&&typeof this.context[t]=="function"){for(var e=arguments.length,s=new Array(e>1?e-1:0),n=1;n<e;n++)s[n-1]=arguments[n];return this.context[t](...s)}return null}get adapter(){var t=this;return Object.assign(Object.assign({},super.adapter),{updateIsHovered:e=>this.setState({isHovered:e}),getOpenKeys:()=>this.context&&this.context.openKeys,getOpenKeysIsControlled:()=>this.context&&this.context.openKeysIsControlled,getCanUpdateOpenKeys:()=>this.context&&this.context.canUpdateOpenKeys,updateOpen:e=>this._invokeContextFunc(e?"addOpenKeys":"removeOpenKeys",this.props.itemKey),notifyGlobalOpenChange:function(){for(var e=arguments.length,s=new Array(e),n=0;n<e;n++)s[n]=arguments[n];return t._invokeContextFunc("onOpenChange",...s)},notifyGlobalOnSelect:function(){for(var e=arguments.length,s=new Array(e),n=0;n<e;n++)s[n]=arguments[n];return t._invokeContextFunc("onSelect",...s)},notifyGlobalOnClick:function(){for(var e=arguments.length,s=new Array(e),n=0;n<e;n++)s[n]=arguments[n];return t._invokeContextFunc("onClick",...s)},getIsSelected:e=>!!(!V(e)&&z(this.context,"selectedKeys",[]).includes(String(e))),getIsOpen:()=>{const{itemKey:e}=this.props;return!!(this.context&&this.context.openKeys&&this.context.openKeys.includes(this.props.itemKey))}})}renderIcon(t,e,s){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;const{prefixCls:l}=this.context;let r="large";e===h.ICON_POS_RIGHT&&(r="default");const c=K(`${l}-item-icon`,{[`${l}-item-icon-toggle-${this.context.toggleIconPosition}`]:n,[`${l}-item-icon-info`]:!n}),d=this.adapter.getIsOpen(),m=a.isValidElement(t)?s?a.createElement(De,{animationState:d?"enter":"leave",startClassName:`${x.PREFIX}-icon-rotate-${d?"180":"0"}`},C=>{let{animationClassName:w}=C;return a.cloneElement(t,{size:r,className:w})}):a.cloneElement(t,{size:r}):null;return a.createElement("i",{key:i,className:c},m)}renderTitleDiv(){const{text:t,icon:e,itemKey:s,indent:n,disabled:i,level:l,expandIcon:r}=this.props,{mode:c,isInSubNav:d,isCollapsed:m,prefixCls:C,subNavMotion:w,limitIndent:I}=this.context,g=this.adapter.getIsOpen(),L=K(`${C}-sub-title`,{[`${C}-sub-title-selected`]:this.adapter.getIsSelected(s),[`${C}-sub-title-disabled`]:i});let O=!1,f="";m?d?f=a.createElement(ie,null):f=null:c===h.MODE_HORIZONTAL?d?f=a.createElement(ie,{"aria-hidden":!0}):f=r||a.createElement(ae,{"aria-hidden":!0}):(w&&(O=!0),f=r||a.createElement(ae,{"aria-hidden":!0}));let v=null;if(c===h.MODE_VERTICAL&&!I&&!m){const D=e&&!n?l:l-1;v=be(D,E=>this.renderIcon(null,h.ICON_POS_RIGHT,!1,!1,E))}const B=!m&&d&&c===h.MODE_HORIZONTAL||m&&d;return a.createElement("div",{role:"menuitem",tabIndex:B?-1:0,ref:this.setTitleRef,className:L,onClick:this.handleClick,onKeyPress:this.handleKeyPress,"aria-expanded":g?"true":"false"},a.createElement("div",{className:`${C}-item-inner`},v,this.context.toggleIconPosition===h.TOGGLE_ICON_LEFT&&this.renderIcon(f,h.ICON_POS_RIGHT,O,!0,"key-toggle-position-left"),e||n||d&&c!==h.MODE_HORIZONTAL?this.renderIcon(e,h.ICON_POS_LEFT,!1,!1,"key-inSubNav-position-left"):null,a.createElement("span",{className:`${C}-item-text`},t),this.context.toggleIconPosition===h.TOGGLE_ICON_RIGHT&&this.renderIcon(f,h.ICON_POS_RIGHT,O,!0,"key-toggle-position-right")))}renderSubUl(){const{children:t,maxHeight:e}=this.props,{isCollapsed:s,mode:n,subNavMotion:i,prefixCls:l}=this.context,r=this.adapter.getIsOpen(),c=n===h.MODE_HORIZONTAL,d=K(`${l}-sub`,{[`${l}-sub-open`]:r,[`${l}-sub-popover`]:s||c});return c?null:i?a.createElement(Pe,{motion:i,isOpen:r,keepDOM:!1,fade:!0},s?null:a.createElement("ul",{className:d},t)):r&&!s?a.createElement("ul",{className:d},t):null}wrapDropdown(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";const{children:s,dropdownStyle:n,disabled:i,subDropdownProps:l,dropdownProps:r}=this.props,{mode:c,isInSubNav:d,isCollapsed:m,subNavCloseDelay:C,subNavOpenDelay:w,prefixCls:I,getPopupContainer:g}=this.context,L=this.adapter.getIsOpen(),O=this.adapter.getOpenKeysIsControlled(),f=K({[`${I}-popover`]:m}),v={trigger:"hover",style:n};return O&&(v.trigger="custom",v.visible=L),g&&(v.getPopupContainer=g),(m||c===h.MODE_HORIZONTAL)&&(e=i?e:a.createElement(se,Object.assign({className:f,render:a.createElement(se.Menu,null,s),position:c===h.MODE_HORIZONTAL&&!d?"bottomLeft":"rightTop",mouseEnterDelay:w,mouseLeaveDelay:C,onVisibleChange:this.handleDropdownVisible},r||l,v),e)),e}render(){const{itemKey:t,style:e,onMouseEnter:s,onMouseLeave:n,disabled:i,text:l}=this.props,{mode:r,isCollapsed:c,prefixCls:d}=this.context;let m=this.renderTitleDiv();const C=this.renderSubUl();return(c||r===h.MODE_HORIZONTAL)&&(m=this.wrapDropdown(m)),a.createElement(Z,{style:e,isSubNav:!0,itemKey:t,forwardRef:this.setItemRef,isCollapsed:c,className:`${d}-sub-wrap`,onMouseEnter:s,onMouseLeave:n,disabled:i,text:l},a.createElement(G.Provider,{value:Object.assign(Object.assign({},this.context),{isInSubNav:!0})},m,C))}}Y.contextType=G;Y.propTypes={itemKey:o.oneOfType([o.string,o.number]),text:o.oneOfType([o.string,o.node]),isOpen:o.bool,isCollapsed:o.bool,indent:o.oneOfType([o.bool,o.number]),children:o.node,style:o.object,icon:o.node,maxHeight:o.number,onMouseEnter:o.func,onMouseLeave:o.func,disabled:o.bool,level:o.number};Y.defaultProps={level:0,indent:!1,isCollapsed:!1,isOpen:!1,maxHeight:$.DEFAULT_SUBNAV_MAX_HEIGHT,disabled:!1};function We(p){let{prefixCls:t,locale:e,collapseText:s,isCollapsed:n,onClick:i=S}=p;const l=()=>{typeof i=="function"&&i(!n)},r={icon:a.createElement(Ze,null),type:"tertiary",theme:"borderless",onClick:l};let c=n?e?.expandText:e?.collapseText;return typeof s=="function"&&(c=s(n)),a.createElement("div",{className:`${t}-collapse-btn`},n?a.createElement(Oe,{content:c,position:"right"},a.createElement(re,Object.assign({},r))):a.createElement(re,Object.assign({},r),c))}class H extends b.PureComponent{constructor(){super(...arguments),this.renderCollapseButton=()=>{const{collapseButton:t,collapseText:e}=this.props;if(a.isValidElement(t))return t;const{onCollapseChange:s,prefixCls:n,locale:i,isCollapsed:l}=this.context;return a.createElement(We,{prefixCls:n,isCollapsed:l,locale:i,onClick:s,collapseText:e})}}render(){const{style:t,className:e,collapseButton:s,onClick:n}=this.props;let{children:i}=this.props;const{isCollapsed:l,mode:r}=this.context;!a.isValidElement(i)&&s&&r!==h.MODE_HORIZONTAL&&(i=this.renderCollapseButton());const c=K(e,`${x.PREFIX}-footer`,{[`${x.PREFIX}-footer-collapsed`]:l});return a.createElement("div",{className:c,style:t,onClick:n},i)}}H.contextType=G;H.propTypes={children:o.node,style:o.object,className:o.string,collapseButton:o.oneOfType([o.node,o.bool]),collapseText:o.func,onClick:o.func};H.defaultProps={collapseButton:!1,onClick:S};H.elementType="NavFooter";class M extends b.PureComponent{renderLogo(t){return a.isValidElement(t)?t:null}render(){const{children:t,style:e,className:s,logo:n,text:i,link:l,linkOptions:r,prefixCls:c}=this.props,{isCollapsed:d}=this.context,m=K(s,`${x.PREFIX}-header`,{[`${x.PREFIX}-header-collapsed`]:d});let C=a.createElement(a.Fragment,null,n?a.createElement("i",{className:`${x.PREFIX}-header-logo`},this.renderLogo(n)):null,!V(i)&&!d?a.createElement("span",{className:`${x.PREFIX}-header-text`},i):null,t);return typeof l=="string"&&(C=a.createElement("a",Object.assign({className:`${c}-header-link`,href:l},r),C)),a.createElement("div",{className:m,style:e},C)}}M.contextType=G;M.propTypes={prefixCls:o.string,logo:o.oneOfType([o.string,o.object,o.node]),text:o.oneOfType([o.string,o.node]),children:o.node,style:o.object,className:o.string,link:o.string,linkOptions:o.object};M.defaultProps={prefixCls:x.PREFIX};M.elementType="NavHeader";var ze=function(p,t){var e={};for(var s in p)Object.prototype.hasOwnProperty.call(p,s)&&t.indexOf(s)<0&&(e[s]=p[s]);if(p!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,s=Object.getOwnPropertySymbols(p);n<s.length;n++)t.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(p,s[n])&&(e[s[n]]=p[s[n]]);return e};function Ce(p,t){return function(){const s=new Set(p.state[t]);for(var n=arguments.length,i=new Array(n),l=0;l<n;l++)i[l]=arguments[l];i.forEach(r=>r&&s.add(r)),p.setState({[t]:Array.from(s)})}}function fe(p,t){return function(){const s=new Set(p.state[t]);for(var n=arguments.length,i=new Array(n),l=0;l<n;l++)i[l]=arguments[l];i.forEach(r=>r&&s.delete(r)),p.setState({[t]:Array.from(s)})}}const{hasOwnProperty:Ye}=Object.prototype;class A extends le{constructor(t){super(t),this.onCollapseChange=()=>{this.foundation.handleCollapseChange()},this.foundation=new F(this.adapter),this.itemsChanged=!0;const{isCollapsed:e,defaultIsCollapsed:s,items:n,children:i}=t,l={isCollapsed:!!(this.isControlled("isCollapsed")?e:s),openKeys:[],items:[],itemKeysMap:{},selectedKeys:[]};if(this.state=Object.assign({},l),n&&n.length||i){const r=this.foundation.init("constructor");this.state=Object.assign(Object.assign({},l),r)}}static getDerivedStateFromProps(t,e){const s={};return Ye.call(t,"isCollapsed")&&t.isCollapsed!==e.isCollapsed&&(s.isCollapsed=t.isCollapsed),s}componentDidMount(){}componentDidUpdate(t){if(t.items!==this.props.items||t.children!==this.props.children)this.foundation.init();else{if(this.foundation.handleItemsChange(!1),this.props.selectedKeys&&!ce(t.selectedKeys,this.props.selectedKeys)){this.adapter.updateSelectedKeys(this.props.selectedKeys);const e=this.foundation.getWillOpenKeys(this.state.itemKeysMap);this.adapter.updateOpenKeys(e)}this.props.openKeys&&!ce(t.openKeys,this.props.openKeys)&&this.adapter.updateOpenKeys(this.props.openKeys)}}get adapter(){var t=this;return Object.assign(Object.assign({},super.adapter),{notifySelect:function(){return t.props.onSelect(...arguments)},notifyOpenChange:function(){return t.props.onOpenChange(...arguments)},setIsCollapsed:e=>this.setState({isCollapsed:e}),notifyCollapseChange:function(){return t.props.onCollapseChange(...arguments)},updateItems:e=>this.setState({items:[...e]}),setItemKeysMap:e=>this.setState({itemKeysMap:Object.assign({},e)}),addSelectedKeys:Ce(this,"selectedKeys"),removeSelectedKeys:fe(this,"selectedKeys"),updateSelectedKeys:function(e){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=e;if(s){const i=t.foundation.selectLevelZeroParentKeys(null,e);n=Array.from(new Set(e.concat(i)))}t.setState({selectedKeys:n})},updateOpenKeys:e=>this.setState({openKeys:[...e]}),addOpenKeys:Ce(this,"openKeys"),removeOpenKeys:fe(this,"openKeys"),setItemsChanged:e=>{this.itemsChanged=e}})}renderItems(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const{expandIcon:s,subDropdownProps:n}=this.props;return a.createElement(a.Fragment,null,t.map((l,r)=>Array.isArray(l.items)&&l.items.length?a.createElement(Y,Object.assign({key:l.itemKey||String(e)+r},l,{level:e,expandIcon:s,subDropdownProps:n}),this.renderItems(l.items,e+1)):a.createElement(Z,Object.assign({key:l.itemKey||String(e)+r},l,{level:e}))))}render(){const t=this.props,{children:e,mode:s,onOpenChange:n,onSelect:i,onClick:l,style:r,className:c,subNavCloseDelay:d,subNavOpenDelay:m,subNavMotion:C,tooltipShowDelay:w,tooltipHideDelay:I,prefixCls:g,bodyStyle:L,footer:O,header:f,toggleIconPosition:v,limitIndent:B,renderWrapper:N,getPopupContainer:D}=t,E=ze(t,["children","mode","onOpenChange","onSelect","onClick","style","className","subNavCloseDelay","subNavOpenDelay","subNavMotion","tooltipShowDelay","tooltipHideDelay","prefixCls","bodyStyle","footer","header","toggleIconPosition","limitIndent","renderWrapper","getPopupContainer"]),{selectedKeys:q,openKeys:P,items:j,isCollapsed:T}=this.state,{updateOpenKeys:U,addOpenKeys:Ie,removeOpenKeys:ve,updateSelectedKeys:Ke,addSelectedKeys:xe,removeSelectedKeys:Ee}=this.adapter,Se=Object.assign({},r);let _=b.Children.toArray(e);const Q=[],J=[];if(a.isValidElement(O)?Q.push(a.createElement(H,{key:0},O)):O&&typeof O=="object"&&Q.push(a.createElement(H,Object.assign({key:0},O))),a.isValidElement(f)?J.push(a.createElement(M,{key:0},f)):f&&typeof f=="object"&&J.push(a.createElement(M,Object.assign({key:0},f))),Array.isArray(_)&&_.length){_=[..._];let X=_.length;for(let R=0;R<X;R++){const k=_[R];k.type===H||z(k,"type.elementType")==="NavFooter"?(Q.push(k),_.splice(R,1),R--,X--):(k.type===M||z(k,"type.elementType")==="NavHeader")&&(J.push(k),_.splice(R,1),R--,X--)}}const we=K(g,c,{[`${g}-collapsed`]:T,[`${g}-horizontal`]:s==="horizontal",[`${g}-vertical`]:s==="vertical"}),Ne=K(`${g}-header-list-outer`,{[`${g}-header-list-outer-collapsed`]:T});return this.itemsChanged&&this.adapter.setCache("itemElems",this.renderItems(j)),a.createElement(je,{componentName:"Navigation"},X=>a.createElement(G.Provider,{value:{subNavCloseDelay:d,subNavOpenDelay:m,subNavMotion:C,tooltipShowDelay:w,tooltipHideDelay:I,openKeys:P,openKeysIsControlled:this.isControlled("openKeys")&&s==="vertical"&&!T,canUpdateOpenKeys:!0,selectedKeys:q,selectedKeysIsControlled:this.isControlled("selectedKeys"),isCollapsed:T,onCollapseChange:this.onCollapseChange,mode:s,onSelect:i,onOpenChange:n,updateOpenKeys:U,addOpenKeys:Ie,removeOpenKeys:ve,updateSelectedKeys:Ke,addSelectedKeys:xe,removeSelectedKeys:Ee,onClick:l,locale:X,prefixCls:g,toggleIconPosition:v,limitIndent:B,renderWrapper:N,getPopupContainer:D}},a.createElement("div",Object.assign({className:we,style:Se},this.getDataAttr(E)),a.createElement("div",{className:`${g}-inner`},a.createElement("div",{className:Ne},J,a.createElement("div",{style:L,className:`${g}-list-wrapper`},a.createElement("ul",{role:"menu","aria-orientation":s,className:`${g}-list`},this.adapter.getCache("itemElems"),_))),Q))))}}A.Sub=Y;A.Item=Z;A.Header=M;A.Footer=H;A.propTypes={collapseIcon:o.node,defaultOpenKeys:o.arrayOf(o.oneOfType([o.string,o.number])),openKeys:o.arrayOf(o.oneOfType([o.string,o.number])),defaultSelectedKeys:o.arrayOf(o.oneOfType([o.string,o.number])),expandIcon:o.node,selectedKeys:o.arrayOf(o.oneOfType([o.string,o.number])),mode:o.oneOf([...h.MODE]),onSelect:o.func,onClick:o.func,onOpenChange:o.func,items:o.array,isCollapsed:o.bool,defaultIsCollapsed:o.bool,onCollapseChange:o.func,multiple:o.bool,onDeselect:o.func,subNavMotion:o.oneOfType([o.bool,o.object,o.func]),subNavCloseDelay:o.number,subNavOpenDelay:o.number,tooltipShowDelay:o.number,tooltipHideDelay:o.number,children:o.node,style:o.object,bodyStyle:o.object,className:o.string,toggleIconPosition:o.string,prefixCls:o.string,header:o.oneOfType([o.node,o.object]),footer:o.oneOfType([o.node,o.object]),limitIndent:o.bool,getPopupContainer:o.func};A.__SemiComponentName__="Navigation";A.defaultProps=He(A.__SemiComponentName__,{subNavCloseDelay:$.DEFAULT_SUBNAV_CLOSE_DELAY,subNavOpenDelay:$.DEFAULT_SUBNAV_OPEN_DELAY,tooltipHideDelay:$.DEFAULT_TOOLTIP_HIDE_DELAY,tooltipShowDelay:$.DEFAULT_TOOLTIP_SHOW_DELAY,onCollapseChange:S,onSelect:S,onClick:S,onOpenChange:S,toggleIconPosition:"right",limitIndent:!0,prefixCls:x.PREFIX,subNavMotion:!0,mode:h.MODE_VERTICAL});function qe(){return u.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:u.jsx("path",{d:"M8.48092 0.748384C8.16727 0.653859 7.83272 0.653859 7.51907 0.748384C7.30423 0.813133 7.13028 0.92386 6.97716 1.04125C6.83512 1.15015 6.67675 1.2924 6.50211 1.44927L2.21784 5.29713C2.00105 5.49145 1.80997 5.66273 1.66845 5.87532C1.54419 6.062 1.4522 6.26826 1.39635 6.48545C1.33275 6.73279 1.333 6.9894 1.33329 7.28054L1.33333 12.4241C1.33331 12.6835 1.3333 12.9169 1.34917 13.1111C1.36616 13.3191 1.40462 13.5401 1.51499 13.7567C1.67477 14.0703 1.92974 14.3253 2.24335 14.485C2.45995 14.5954 2.68093 14.6339 2.88891 14.6509C3.08312 14.6667 3.31653 14.6667 3.57591 14.6667H12.4241C12.6835 14.6667 12.9169 14.6667 13.1111 14.6509C13.3191 14.6339 13.54 14.5954 13.7566 14.485C14.0703 14.3253 14.3252 14.0703 14.485 13.7567C14.5954 13.5401 14.6338 13.3191 14.6508 13.1111C14.6667 12.9169 14.6667 12.6835 14.6667 12.4241L14.6667 7.28053C14.667 6.9894 14.6672 6.73279 14.6036 6.48545C14.5478 6.26826 14.4558 6.062 14.3315 5.87532C14.19 5.66273 13.9989 5.49145 13.7822 5.29713L9.49788 1.44927C9.32325 1.2924 9.16488 1.15015 9.02284 1.04125C8.86971 0.923861 8.69577 0.813133 8.48092 0.748384ZM7.90381 2.025C7.96654 2.0061 8.03345 2.0061 8.09618 2.025C8.09682 2.02519 8.10364 2.0272 8.11997 2.0364C8.13837 2.04678 8.16717 2.06534 8.21161 2.0994C8.30743 2.17287 8.42696 2.27959 8.62365 2.45625L12.8467 6.24917C13.1328 6.50615 13.1858 6.56032 13.2216 6.61414C13.263 6.67637 13.2937 6.74512 13.3123 6.81752C13.3284 6.88014 13.3333 6.95575 13.3333 7.34034V12.4C13.3333 12.6911 13.3328 12.8692 13.3219 13.0025C13.3168 13.0646 13.3105 13.1022 13.3051 13.125C13.3025 13.1359 13.3004 13.1426 13.2991 13.1462C13.2979 13.1496 13.2971 13.1511 13.297 13.1514C13.265 13.2141 13.214 13.2651 13.1513 13.297C13.1511 13.2972 13.1496 13.2979 13.1461 13.2991C13.1425 13.3004 13.1359 13.3026 13.125 13.3051C13.1022 13.3105 13.0646 13.3169 13.0025 13.322C12.8692 13.3328 12.691 13.3334 12.4 13.3334H8.66667V8.50008C8.66667 8.31599 8.51743 8.16675 8.33333 8.16675H7.66667C7.48257 8.16675 7.33333 8.31599 7.33333 8.50008V13.3334H3.6C3.30897 13.3334 3.13079 13.3328 2.99749 13.322C2.93539 13.3169 2.89781 13.3105 2.875 13.3051C2.86414 13.3026 2.85747 13.3004 2.85386 13.2991C2.85039 13.2979 2.84894 13.2972 2.84867 13.297C2.78595 13.2651 2.73495 13.2141 2.70299 13.1514C2.70291 13.1512 2.70256 13.1505 2.70199 13.1491C2.70168 13.1483 2.70131 13.1474 2.70088 13.1462C2.69959 13.1426 2.69745 13.1359 2.69489 13.125C2.68952 13.1022 2.68315 13.0646 2.67807 13.0025C2.66718 12.8692 2.66666 12.6911 2.66666 12.4V7.34034C2.66666 6.95575 2.67157 6.88014 2.68767 6.81752C2.70629 6.74512 2.73695 6.67637 2.77837 6.61414C2.8142 6.56032 2.86717 6.50615 3.1533 6.24917L7.37634 2.45625C7.57304 2.27959 7.69256 2.17287 7.78839 2.0994C7.83282 2.06534 7.86162 2.04678 7.88003 2.0364C7.89635 2.0272 7.90317 2.02519 7.90381 2.025Z",fill:"black",fillOpacity:"0.65"})})}const Qe=()=>u.jsx(ee,{svg:u.jsx(qe,{})});function Je(){return u.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[u.jsx("path",{d:"M5.33333 7.66675C5.14924 7.66675 5 7.51751 5 7.33341V6.66675C5 6.48265 5.14924 6.33341 5.33333 6.33341H10.6667C10.8508 6.33341 11 6.48265 11 6.66675V7.33341C11 7.51751 10.8508 7.66675 10.6667 7.66675H5.33333Z",fill:"black",fillOpacity:"0.65"}),u.jsx("path",{d:"M5.33333 10.6667C5.14924 10.6667 5 10.5175 5 10.3334V9.66675C5 9.48265 5.14924 9.33341 5.33333 9.33341H8.33333C8.51743 9.33341 8.66667 9.48265 8.66667 9.66675V10.3334C8.66667 10.5175 8.51743 10.6667 8.33333 10.6667H5.33333Z",fill:"black",fillOpacity:"0.65"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.33333 0.666748C5.14924 0.666748 5 0.815986 5 1.00008V2.00013C4.01165 2.0009 3.49359 2.01346 3.09202 2.21807C2.71569 2.40982 2.40973 2.71578 2.21799 3.0921C2 3.51992 2 4.07998 2 5.20008V12.1334C2 13.2535 2 13.8136 2.21799 14.2414C2.40973 14.6177 2.71569 14.9237 3.09202 15.1154C3.51984 15.3334 4.0799 15.3334 5.2 15.3334H10.8C11.9201 15.3334 12.4802 15.3334 12.908 15.1154C13.2843 14.9237 13.5903 14.6177 13.782 14.2414C14 13.8136 14 13.2535 14 12.1334V5.20008C14 4.07998 14 3.51992 13.782 3.0921C13.5903 2.71578 13.2843 2.40982 12.908 2.21807C12.5064 2.01346 11.9883 2.0009 11 2.00013V1.00008C11 0.815986 10.8508 0.666748 10.6667 0.666748H10C9.81591 0.666748 9.66667 0.815986 9.66667 1.00008V2.00008H6.33333V1.00008C6.33333 0.815986 6.1841 0.666748 6 0.666748H5.33333ZM3.99498 3.35623C4.22961 3.33707 4.53372 3.33396 5 3.33349V4.00008C5 4.18418 5.14924 4.33341 5.33333 4.33341H6C6.1841 4.33341 6.33333 4.18418 6.33333 4.00008V3.33341H9.66667V4.00008C9.66667 4.18418 9.81591 4.33341 10 4.33341H10.6667C10.8508 4.33341 11 4.18418 11 4.00008V3.33349C11.4663 3.33396 11.7704 3.33707 12.005 3.35623C12.1292 3.36638 12.2044 3.37913 12.25 3.38988C12.2717 3.39499 12.2851 3.39927 12.2923 3.40185C12.2992 3.40432 12.3027 3.40608 12.3027 3.40608C12.4281 3.46999 12.5301 3.57198 12.594 3.69742C12.594 3.69742 12.5958 3.70087 12.5982 3.7078C12.6008 3.71502 12.6051 3.72837 12.6102 3.75008C12.621 3.79572 12.6337 3.87086 12.6438 3.99506C12.6656 4.26168 12.6667 4.61803 12.6667 5.20008V12.1334C12.6667 12.7155 12.6656 13.0718 12.6438 13.3384C12.6337 13.4626 12.621 13.5378 12.6102 13.5834C12.6051 13.6051 12.6008 13.6185 12.5982 13.6257C12.5969 13.6295 12.5958 13.632 12.5951 13.6337C12.5945 13.6351 12.594 13.6361 12.594 13.6361C12.5301 13.7615 12.4281 13.8635 12.3027 13.9274C12.3027 13.9274 12.2992 13.9292 12.2923 13.9316C12.2851 13.9342 12.2717 13.9385 12.25 13.9436C12.2044 13.9544 12.1292 13.9671 12.005 13.9773C11.7384 13.999 11.3821 14.0001 10.8 14.0001H5.2C4.61795 14.0001 4.26159 13.999 3.99498 13.9773C3.87078 13.9671 3.79563 13.9544 3.75 13.9436C3.72829 13.9385 3.71494 13.9342 3.70772 13.9316C3.70078 13.9292 3.69734 13.9274 3.69734 13.9274C3.5719 13.8635 3.46991 13.7615 3.406 13.6361C3.406 13.6361 3.40424 13.6326 3.40177 13.6257C3.39919 13.6185 3.39491 13.6051 3.38979 13.5834C3.37905 13.5378 3.3663 13.4626 3.35615 13.3384C3.33437 13.0718 3.33333 12.7155 3.33333 12.1334V5.20008C3.33333 4.61803 3.33437 4.26168 3.35615 3.99506C3.3663 3.87086 3.37905 3.79572 3.38979 3.75008C3.39491 3.72837 3.39919 3.71502 3.40177 3.7078C3.40424 3.70087 3.406 3.69742 3.406 3.69742C3.46991 3.57198 3.5719 3.46999 3.69734 3.40608C3.69734 3.40608 3.70078 3.40432 3.70772 3.40185C3.71494 3.39927 3.72829 3.39499 3.75 3.38988C3.79563 3.37913 3.87078 3.36638 3.99498 3.35623Z",fill:"black",fillOpacity:"0.65"})]})}const et=()=>u.jsx(ee,{svg:u.jsx(Je,{})});function tt(){return u.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 7.16667C7.33518 7.16667 8.45466 6.24312 8.75446 5H14.6667C14.8508 5 15 4.85076 15 4.66667V4C15 3.81591 14.8508 3.66667 14.6667 3.66667H8.75446C8.45466 2.42355 7.33518 1.5 6 1.5C4.66482 1.5 3.54534 2.42355 3.24554 3.66667H1.33333C1.14924 3.66667 1 3.81591 1 4V4.66667C1 4.85076 1.14924 5 1.33333 5H3.24554C3.54534 6.24312 4.66482 7.16667 6 7.16667ZM7.5 4.33333C7.5 5.16176 6.82843 5.83333 6 5.83333C5.17157 5.83333 4.5 5.16176 4.5 4.33333C4.5 3.50491 5.17157 2.83333 6 2.83333C6.82843 2.83333 7.5 3.50491 7.5 4.33333Z",fill:"black",fillOpacity:"0.65"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 14.5C11.3352 14.5 12.4547 13.5765 12.7545 12.3333H14.6667C14.8508 12.3333 15 12.1841 15 12V11.3333C15 11.1492 14.8508 11 14.6667 11H12.7545C12.4547 9.75688 11.3352 8.83333 10 8.83333C8.66482 8.83333 7.54534 9.75688 7.24554 11H1.33333C1.14924 11 1 11.1492 1 11.3333V12C1 12.1841 1.14924 12.3333 1.33333 12.3333H7.24554C7.54534 13.5765 8.66482 14.5 10 14.5ZM11.5 11.6667C11.5 12.4951 10.8284 13.1667 10 13.1667C9.17157 13.1667 8.5 12.4951 8.5 11.6667C8.5 10.8382 9.17157 10.1667 10 10.1667C10.8284 10.1667 11.5 10.8382 11.5 11.6667Z",fill:"black",fillOpacity:"0.65"})]})}const st=()=>u.jsx(ee,{svg:u.jsx(tt,{})});function nt(){return u.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[u.jsx("path",{d:"M5.66666 2.66659C5.85076 2.66659 6 2.51735 6 2.33325V1.66659C6 1.48249 5.85076 1.33325 5.66666 1.33325H5.59999C4.10652 1.33325 3.35979 1.33325 2.78935 1.6239C2.28759 1.87956 1.87964 2.28751 1.62398 2.78928C1.33333 3.35971 1.33333 4.10645 1.33333 5.59992V5.66658C1.33333 5.85068 1.48257 5.99992 1.66666 5.99992H2.33333C2.51742 5.99992 2.66666 5.85068 2.66666 5.66658V5.59992C2.66666 4.83118 2.6677 4.33482 2.69856 3.95703C2.72816 3.59482 2.7784 3.46052 2.81199 3.3946C2.93982 3.14372 3.14379 2.93974 3.39467 2.81191C3.4606 2.77832 3.59489 2.72808 3.95711 2.69849C4.33489 2.66762 4.83126 2.66659 5.59999 2.66659H5.66666Z",fill:"black",fillOpacity:"0.65"}),u.jsx("path",{d:"M14.6667 5.66658C14.6667 5.85068 14.5174 5.99992 14.3333 5.99992H13.6667C13.4826 5.99992 13.3333 5.85068 13.3333 5.66658V5.59992C13.3333 4.83118 13.3323 4.33482 13.3014 3.95703C13.2718 3.59482 13.2216 3.46052 13.188 3.3946C13.0602 3.14372 12.8562 2.93974 12.6053 2.81191C12.5394 2.77832 12.4051 2.72808 12.0429 2.69849C11.6651 2.66762 11.1687 2.66659 10.4 2.66659H10.3333C10.1492 2.66659 10 2.51735 10 2.33325V1.66659C10 1.48249 10.1492 1.33325 10.3333 1.33325H10.4C11.8935 1.33325 12.6402 1.33325 13.2106 1.6239C13.7124 1.87956 14.1203 2.28751 14.376 2.78928C14.6667 3.35971 14.6667 4.10645 14.6667 5.59992V5.66658Z",fill:"black",fillOpacity:"0.65"}),u.jsx("path",{d:"M1.66666 9.99992C1.48257 9.99992 1.33333 10.1492 1.33333 10.3333V10.3999C1.33333 11.8934 1.33333 12.6401 1.62398 13.2106C1.87964 13.7123 2.28759 14.1203 2.78935 14.3759C3.35979 14.6666 4.10652 14.6666 5.59999 14.6666H5.66666C5.85076 14.6666 6 14.5173 6 14.3333V13.6666C6 13.4825 5.85076 13.3333 5.66666 13.3333H5.59999C4.83126 13.3333 4.33489 13.3322 3.95711 13.3013C3.59489 13.2718 3.4606 13.2215 3.39467 13.1879C3.14379 13.0601 2.93982 12.8561 2.81199 12.6052C2.7784 12.5393 2.72816 12.405 2.69856 12.0428C2.6677 11.665 2.66666 11.1687 2.66666 10.3999V10.3333C2.66666 10.1492 2.51742 9.99992 2.33333 9.99992H1.66666Z",fill:"black",fillOpacity:"0.65"}),u.jsx("path",{d:"M10.3333 13.3333C10.1492 13.3333 10 13.4825 10 13.6666V14.3333C10 14.5173 10.1492 14.6666 10.3333 14.6666H10.4C11.8935 14.6666 12.6402 14.6666 13.2106 14.3759C13.7124 14.1203 14.1203 13.7123 14.376 13.2106C14.6667 12.6401 14.6667 11.8934 14.6667 10.3999V10.3333C14.6667 10.1492 14.5174 9.99992 14.3333 9.99992H13.6667C13.4826 9.99992 13.3333 10.1492 13.3333 10.3333V10.3999C13.3333 11.1687 13.3323 11.665 13.3014 12.0428C13.2718 12.405 13.2216 12.5393 13.188 12.6052C13.0602 12.8561 12.8562 13.0601 12.6053 13.1879C12.5394 13.2215 12.4051 13.2718 12.0429 13.3013C11.6651 13.3322 11.1687 13.3333 10.4 13.3333H10.3333Z",fill:"black",fillOpacity:"0.65"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.17159 10.1144C8.64463 10.4634 8.01272 10.6667 7.33333 10.6667C5.49238 10.6667 3.99999 9.17428 3.99999 7.33333C3.99999 5.49238 5.49238 4 7.33333 4C9.17428 4 10.6667 5.49238 10.6667 7.33333C10.6667 8.01272 10.4634 8.64464 10.1144 9.17159L11.7357 10.7929C11.8659 10.9231 11.8659 11.1341 11.7357 11.2643L11.2643 11.7357C11.1341 11.8659 10.9231 11.8659 10.7929 11.7357L9.17159 10.1144ZM9.33333 7.33333C9.33333 8.4379 8.4379 9.33333 7.33333 9.33333C6.22876 9.33333 5.33333 8.4379 5.33333 7.33333C5.33333 6.22876 6.22876 5.33333 7.33333 5.33333C8.4379 5.33333 9.33333 6.22876 9.33333 7.33333Z",fill:"black",fillOpacity:"0.65"})]})}const ot=()=>u.jsx(ee,{svg:u.jsx(nt,{})}),te=[{text:W("scanQRCode2Debug"),itemKey:"scan_qrcode",icon:u.jsx(Qe,{}),path:"/"},{itemKey:"launch_mode",text:W("launchMode"),icon:u.jsx(st,{}),path:"/launch_mode"},{itemKey:"precheck_code",text:W("codePreCheck"),icon:u.jsx(ot,{}),path:"/precheck_code"},{itemKey:"project_info",text:W("projectInfo"),icon:u.jsx(et,{}),path:"/project_detail"},{itemKey:"changelog",text:W("changelog"),icon:u.jsx(Fe,{size:"default",style:{fontWeight:"300",color:"#666"}}),path:"/changelog"}],at=()=>{const{state:{devToolVersion:p}}=Me(),t=Le(),[e,s]=b.useState("scan_qrcode"),[n,i]=b.useState(!1);b.useEffect(()=>{i(Re(p))},[p]);const l=b.useMemo(()=>te.map(c=>c.itemKey==="changelog"?{...c,text:u.jsxs("span",{className:"sidebar-changelog-label",children:[c.text,n&&u.jsx(Ve,{className:"sidebar-changelog-new-tag",color:"red",shape:"circle",size:"small",type:"solid",children:"NEW"})]})}:c),[n]),r=c=>{const d=te.find(m=>m.itemKey===c.itemKey);d&&(d.itemKey==="changelog"&&p&&(ke(p),i(!1)),t(d.path),s(d.itemKey))};return b.useEffect(()=>{const c=window.location.pathname,d=te.find(m=>m.path===c);s(d?d.itemKey:"")},[t]),u.jsx(A,{limitIndent:!1,bodyStyle:{height:"100vh",paddingLeft:"12px",width:"100%"},items:l,selectedKeys:[e],onSelect:r})};export{at as Sidebar};
1
+ import{G as ge,r as b,B as Te,a as oe,l as z,H as V,J as ye,R as a,b as le,K as Oe,M as _e,c as K,O as Ae,Q as be,P as o,t as S,U as De,V as ie,W as ae,A as Pe,m as re,X as ce,L as je,s as He,j as u,Y as ee,u as Me,w as Le,Z as Re,d as Ve,i as W,D as ke}from"./index-Bf-QbPMA.js";import{D as se}from"./index-BgNtIG_5.js";function $e(p){return b.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},p),b.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 4.5a7.5 7.5 0 1 1-7.07 10 1.5 1.5 0 0 0-2.83 1 10.5 10.5 0 1 0 1.27-9.48l-.43-1.45a1.5 1.5 0 1 0-2.88.86l1.5 5c.23.74.98 1.2 1.73 1.04l5-1a1.5 1.5 0 0 0-.58-2.94l-2.01.4A7.5 7.5 0 0 1 12 4.5Zm1.5 3a1.5 1.5 0 0 0-3 0V12c0 .4.16.78.44 1.06l3 3a1.5 1.5 0 0 0 2.12-2.12l-2.56-2.56V7.5Z",fill:"currentColor"}))}const Fe=ge($e,"history");function Ge(p){return b.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},p),b.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5 2h14a3 3 0 0 1 3 3v14a3 3 0 0 1-3 3H5a3 3 0 0 1-3-3V5a3 3 0 0 1 3-3Zm1 2a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1H6Z",fill:"currentColor"}))}const Ze=ge(Ge,"sidebar"),de="horizontal",pe="vertical",x={PREFIX:`${Te}-navigation`},h={MODE:[pe,de],MODE_VERTICAL:pe,MODE_HORIZONTAL:de,ICON_POS_LEFT:"left",ICON_POS_RIGHT:"right",TOGGLE_ICON_LEFT:"left",TOGGLE_ICON_RIGHT:"right"},$={DEFAULT_SUBNAV_MAX_HEIGHT:999,DEFAULT_TOOLTIP_SHOW_DELAY:0,DEFAULT_TOOLTIP_HIDE_DELAY:100,DEFAULT_SUBNAV_OPEN_DELAY:0,DEFAULT_SUBNAV_CLOSE_DELAY:100},ue={open:"chevron_up",closed:"chevron_down"};let Be=class ne{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(t==null||typeof t!="object")&&(t={text:t,itemKey:t,maxHeight:$.DEFAULT_SUBNAV_MAX_HEIGHT,link:null,items:null,icon:"",indent:!1});for(const e of Object.keys(t))this[e]=t[e];t.items&&Array.isArray(t.items)&&t.items.length?(this.items=t.items.map(e=>new ne(e)),"toggleIcon"in t?this.toggleIcon=ne.isValidToggleIcon(t.toggleIcon)?Object.assign({},t.toggleIcon):Object.assign({},ue):this.toggleIcon=Object.assign({},ue)):this.items=null}static isValidToggleIcon(t){return!!(t&&typeof t=="object"&&typeof t.open=="string"&&t.open.length&&typeof t.closed=="string"&&t.closed.length)}};class F extends oe{constructor(t){super(Object.assign({},t))}static getZeroParentKeys(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const e=[];for(var s=arguments.length,n=new Array(s>1?s-1:0),i=1;i<s;i++)n[i-1]=arguments[i];if(n.length){for(const l of n)if(Array.isArray(t[l])&&t[l].length){const r=t[l][0];V(r)||e.push(r)}}return e}static buildItemKeysMap(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"itemKey";var i;if(Array.isArray(t)&&t.length)for(const l of t)if(Array.isArray(l))F.buildItemKeysMap(l,e,[...s],n);else{let r;if(l&&typeof l=="object"&&(r=l[n]||l.props&&l.props[n]),r){e[r]=[...s];const c=(i=l.props)===null||i===void 0?void 0:i.children;if(Array.isArray(l.items)&&l.items.length)F.buildItemKeysMap(l.items,e,[...s,r],n);else if(c){const d=Array.isArray(c)?c:[c];F.buildItemKeysMap(d,e,[...s,r],n)}}}return e}init(t){const{defaultSelectedKeys:e,selectedKeys:s}=this.getProps();let n=s||e||[];const{itemKeysMap:i,willOpenKeys:l,formattedItems:r}=this.getCalcState(),c=this.selectLevelZeroParentKeys(i,n);if(n=n.concat(c),t==="constructor")return{selectedKeys:n,itemKeysMap:i,openKeys:l,items:r};this._adapter.updateSelectedKeys(n,!1),this._adapter.setItemKeysMap(i),this._adapter.updateOpenKeys(l),this._adapter.updateItems(r),this._adapter.setItemsChanged(!0)}getCalcState(){const{itemKeysMap:t,formattedItems:e}=this.getFormattedItems(),s=this.getWillOpenKeys(t);return{itemKeysMap:t,willOpenKeys:s,formattedItems:e}}getFormattedItems(){const{items:t,children:e}=this.getProps(),s=this.formatItems(t),n=Array.isArray(t)&&t.length?s:e;return{itemKeysMap:F.buildItemKeysMap(n),formattedItems:s}}getWillOpenKeys(t){const{defaultOpenKeys:e,openKeys:s,defaultSelectedKeys:n,selectedKeys:i,mode:l}=this.getProps(),{openKeys:r=[]}=this.getStates();let c=s||e||[];if(!(Array.isArray(e)||Array.isArray(s))&&l===h.MODE_VERTICAL&&(Array.isArray(n)||Array.isArray(i))){const d=Array.isArray(i)?i:n;c=r.concat(this.getShouldOpenKeys(t,d)),c=Array.from(new Set(c))}return[...c]}getShouldOpenKeys(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const s=new Set;return Array.isArray(e)&&e.length&&e.forEach(n=>{if(n){const i=z(t,n);Array.isArray(i)&&i.forEach(l=>s.add(l))}}),[...s]}destroy(){}selectLevelZeroParentKeys(t,e){const s=V(t)?this.getState("itemKeysMap"):t,n=[];if(e.length){for(const i of e)if(Array.isArray(s[i])&&s[i].length){const l=s[i][0];V(l)||n.push(l)}}return n.length?n:[]}formatItems(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];const e=[];for(const s of t)e.push(new Be(s));return e}handleSelect(t){this._adapter.notifySelect(t)}judgeIfOpen(t,e){let s=!1;const n=Array.isArray(t)?t:t&&[t];if(n&&Array.isArray(e)&&e.length){for(const i of e)if(s=n.includes(i.itemKey)||this.judgeIfOpen(n,i.items),s)break}return s}handleCollapseChange(){const t=!this.getState("isCollapsed");this._isControlledComponent("isCollapsed")||this._adapter.setIsCollapsed(t),this._adapter.notifyCollapseChange(t)}handleItemsChange(t){this._adapter.setItemsChanged(t)}}const he=function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];const e=new Set(t);for(var s=arguments.length,n=new Array(s>1?s-1:0),i=1;i<s;i++)n[i-1]=arguments[i];return n.forEach(l=>l&&e.add(l)),Array.from(e)},me=function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];const e=new Set(t);for(var s=arguments.length,n=new Array(s>1?s-1:0),i=1;i<s;i++)n[i-1]=arguments[i];return n.forEach(l=>l&&e.delete(l)),Array.from(e)};class Ue extends oe{constructor(t){super(Object.assign({},t))}init(){this._timer=null}destroy(){this.clearDelayTimer()}clearDelayTimer(){this._timer&&(clearTimeout(this._timer),this._timer=null)}isValidKey(t){return t!=null&&(typeof t=="number"||typeof t=="string")}handleDropdownVisibleChange(t){const e=this.getProp("itemKey"),s=this._adapter.getOpenKeysIsControlled(),n=this._adapter.getCanUpdateOpenKeys(),i=this._adapter.getOpenKeys(),l=t?he(i,e):me(i,e);this.clearDelayTimer(),s||n&&this._adapter.updateOpen(t),this._adapter.notifyGlobalOpenChange({itemKey:e,openKeys:l,isOpen:t})}handleClick(t,e){const{itemKey:s,disabled:n}=this.getProps();if(n)return;const i=e&&e.contains(t.target);let l=!!this._adapter.getIsOpen();i?l=!l:l=!1;const r=l?he(this._adapter.getOpenKeys(),s):me(this._adapter.getOpenKeys(),s),c={itemKey:s,openKeys:r,isOpen:l,domEvent:t},d=this._adapter.getOpenKeysIsControlled(),m=this._adapter.getCanUpdateOpenKeys();!d&&m&&this._adapter.updateOpen(l),this._adapter.notifyGlobalOpenChange(c),this._adapter.notifyGlobalOnClick(c)}handleKeyPress(t,e){ye(t)&&this.handleClick(t,e)}}class Xe extends oe{constructor(t){super(Object.assign({},t))}init(){this._timer=null,this._mounted=!0}destroy(){this._mounted=!1}isValidKey(t){return t!=null&&(typeof t=="string"||typeof t=="number")}handleClick(t){const{isSubNav:e,itemKey:s,text:n,disabled:i}=this.getProps();if(i)return;!e&&this.isValidKey(s)&&!this._adapter.getSelectedKeysIsControlled()&&!this._adapter.getSelected()&&this._adapter.updateSelected(!0);const l=[s];if(!e){if(!this._adapter.getSelected()){const r=[this._adapter.cloneDeep(this.getProps())];this._adapter.notifyGlobalOnSelect({itemKey:s,selectedKeys:l,selectedItems:r,domEvent:t})}this._adapter.notifyGlobalOnClick({itemKey:s,text:n,domEvent:t})}this._adapter.notifyClick({itemKey:s,text:n,domEvent:t})}handleKeyPress(t){if(ye(t)){const{link:e,linkOptions:s}=this.getProps(),n=z(s,"target","_self");this.handleClick(t),typeof e=="string"&&(n==="_blank"?window.open(e):window.location.href=e)}}}const G=a.createContext({isCollapsed:!1,selectedKeys:[],openKeys:[]}),y=`${x.PREFIX}-item`;class Z extends le{constructor(t){super(t),this.setItemRef=e=>{this.props.forwardRef&&this.props.forwardRef(e)},this.wrapTooltip=e=>{const{text:s,tooltipHideDelay:n,tooltipShowDelay:i}=this.props,l=n??this.context.tooltipHideDelay,r=i??this.context.tooltipShowDelay;return a.createElement(Oe,{content:s,wrapWhenSpecial:!1,position:"right",trigger:"hover",mouseEnterDelay:r,mouseLeaveDelay:l},e)},this.handleClick=e=>this.foundation.handleClick(e),this.handleKeyPress=e=>this.foundation.handleKeyPress(e),this.state={tooltipShow:!1},this.foundation=new Xe(this.adapter)}_invokeContextFunc(t){if(t&&this.context&&typeof this.context[t]=="function"){for(var e=arguments.length,s=new Array(e>1?e-1:0),n=1;n<e;n++)s[n-1]=arguments[n];return this.context[t](...s)}return null}get adapter(){var t=this;return Object.assign(Object.assign({},super.adapter),{cloneDeep:_e,updateTooltipShow:e=>this.setState({tooltipShow:e}),updateSelected:e=>this._invokeContextFunc("updateSelectedKeys",[this.props.itemKey]),updateGlobalSelectedKeys:e=>this._invokeContextFunc("updateSelectedKeys",[...e]),getSelectedKeys:()=>this.context&&this.context.selectedKeys,getSelectedKeysIsControlled:()=>this.context&&this.context.selectedKeysIsControlled,notifyGlobalOnSelect:function(){for(var e=arguments.length,s=new Array(e),n=0;n<e;n++)s[n]=arguments[n];return t._invokeContextFunc("onSelect",...s)},notifyGlobalOnClick:function(){for(var e=arguments.length,s=new Array(e),n=0;n<e;n++)s[n]=arguments[n];return t._invokeContextFunc("onClick",...s)},notifyClick:function(){return t.props.onClick(...arguments)},notifyMouseEnter:function(){return t.props.onMouseEnter(...arguments)},notifyMouseLeave:function(){return t.props.onMouseLeave(...arguments)},getIsCollapsed:()=>this.props.isCollapsed||!!(this.context&&this.context.isCollapsed)||!1,getSelected:()=>!!(this.context&&this.context.selectedKeys&&this.context.selectedKeys.includes(this.props.itemKey)),getIsOpen:()=>!!(this.context&&this.context.openKeys&&this.context.openKeys.includes(this.props.itemKey))})}renderIcon(t,e){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(this.props.isSubNav||!t&&this.context.mode===h.MODE_HORIZONTAL)return null;let i="large";e===h.ICON_POS_RIGHT&&(i="default");const l=K(`${y}-icon`,{[`${y}-icon-toggle-${this.context.toggleIconPosition}`]:s,[`${y}-icon-info`]:!s});return a.createElement("i",{className:l,key:n},Ae(t)?a.cloneElement(t,{size:t.props.size||i}):t)}render(){var t;const{text:e,icon:s,toggleIcon:n,className:i,isSubNav:l,style:r,indent:c,onMouseEnter:d,onMouseLeave:m,link:C,linkOptions:w,disabled:I,level:g=0,tabIndex:L}=this.props,{mode:O,isInSubNav:f,prefixCls:v,limitIndent:B}=this.context,N=this.adapter.getIsCollapsed(),D=this.adapter.getSelected();let E=null;const q=(t=this.props)===null||t===void 0?void 0:t.children;if(!V(q))E=q;else{let j=null;if(O===h.MODE_VERTICAL&&!B&&!N){const T=s&&!c?g:g-1;j=be(T,U=>this.renderIcon(null,h.ICON_POS_RIGHT,!1,U))}E=a.createElement(a.Fragment,null,j,this.context.toggleIconPosition===h.TOGGLE_ICON_LEFT&&this.renderIcon(n,h.ICON_POS_RIGHT,!0,"key-toggle-pos-right"),s||c||f?this.renderIcon(s,h.ICON_POS_LEFT,!1,"key-position-left"):null,V(e)?"":a.createElement("span",{className:`${x.PREFIX}-item-text`},e),this.context.toggleIconPosition===h.TOGGLE_ICON_RIGHT&&this.renderIcon(n,h.ICON_POS_RIGHT,!0,"key-toggle-pos-right"))}typeof C=="string"&&(E=a.createElement("a",Object.assign({className:`${v}-item-link`,href:C,tabIndex:-1},w),E));let P="";if(f&&(N||O===h.MODE_HORIZONTAL)){const j=K({[y]:!0,[`${y}-sub`]:l,[`${y}-selected`]:D,[`${y}-collapsed`]:N,[`${y}-disabled`]:I});P=a.createElement(se.Item,{selected:D,active:D,forwardRef:this.setItemRef,className:j,onClick:this.handleClick,onMouseEnter:d,onMouseLeave:m,disabled:I,onKeyDown:this.handleKeyPress},E)}else{const j=K(`${i||`${y}-normal`}`,{[y]:!0,[`${y}-sub`]:l,[`${y}-selected`]:D&&!l,[`${y}-collapsed`]:N,[`${y}-disabled`]:I,[`${y}-has-link`]:typeof C=="string"}),T={"aria-disabled":I};if(l){const U=this.adapter.getIsOpen();T["aria-expanded"]=U}P=a.createElement("li",Object.assign({role:l?null:"menuitem",tabIndex:l?-1:L},T,{style:r,ref:this.setItemRef,className:j,onClick:this.handleClick,onMouseEnter:d,onMouseLeave:m,onKeyPress:this.handleKeyPress},this.getDataAttr(this.props)),E)}return(N&&!f&&!l||N&&l&&I)&&(P=this.wrapTooltip(P)),typeof this.context.renderWrapper=="function"?this.context.renderWrapper({itemElement:P,isSubNav:l,isInSubNav:f,props:this.props}):P}}Z.contextType=G;Z.propTypes={text:o.oneOfType([o.string,o.node]),itemKey:o.oneOfType([o.string,o.number]),onClick:o.func,onMouseEnter:o.func,onMouseLeave:o.func,icon:o.oneOfType([o.node]),className:o.string,toggleIcon:o.string,style:o.object,forwardRef:o.func,indent:o.oneOfType([o.bool,o.number]),isCollapsed:o.bool,isSubNav:o.bool,link:o.string,linkOptions:o.object,disabled:o.bool,tabIndex:o.number};Z.defaultProps={isSubNav:!1,indent:!1,forwardRef:S,isCollapsed:!1,onClick:S,onMouseEnter:S,onMouseLeave:S,disabled:!1,tabIndex:0};class Y extends le{constructor(t){super(t),this.setItemRef=e=>{e&&e.current?this.itemRef=e:this.itemRef={current:e}},this.setTitleRef=e=>{e&&e.current?this.titleRef=e:this.titleRef={current:e}},this.handleClick=e=>{this.foundation.handleClick(e&&e.nativeEvent,this.titleRef&&this.titleRef.current)},this.handleKeyPress=e=>{this.foundation.handleKeyPress(e&&e.nativeEvent,this.titleRef&&this.titleRef.current)},this.handleDropdownVisible=e=>this.foundation.handleDropdownVisibleChange(e),this.state={isHovered:!1},this.adapter.setCache("firstMounted",!0),this.titleRef=a.createRef(),this.itemRef=a.createRef(),this.foundation=new Ue(this.adapter)}_invokeContextFunc(t){if(t&&this.context&&typeof this.context[t]=="function"){for(var e=arguments.length,s=new Array(e>1?e-1:0),n=1;n<e;n++)s[n-1]=arguments[n];return this.context[t](...s)}return null}get adapter(){var t=this;return Object.assign(Object.assign({},super.adapter),{updateIsHovered:e=>this.setState({isHovered:e}),getOpenKeys:()=>this.context&&this.context.openKeys,getOpenKeysIsControlled:()=>this.context&&this.context.openKeysIsControlled,getCanUpdateOpenKeys:()=>this.context&&this.context.canUpdateOpenKeys,updateOpen:e=>this._invokeContextFunc(e?"addOpenKeys":"removeOpenKeys",this.props.itemKey),notifyGlobalOpenChange:function(){for(var e=arguments.length,s=new Array(e),n=0;n<e;n++)s[n]=arguments[n];return t._invokeContextFunc("onOpenChange",...s)},notifyGlobalOnSelect:function(){for(var e=arguments.length,s=new Array(e),n=0;n<e;n++)s[n]=arguments[n];return t._invokeContextFunc("onSelect",...s)},notifyGlobalOnClick:function(){for(var e=arguments.length,s=new Array(e),n=0;n<e;n++)s[n]=arguments[n];return t._invokeContextFunc("onClick",...s)},getIsSelected:e=>!!(!V(e)&&z(this.context,"selectedKeys",[]).includes(String(e))),getIsOpen:()=>{const{itemKey:e}=this.props;return!!(this.context&&this.context.openKeys&&this.context.openKeys.includes(this.props.itemKey))}})}renderIcon(t,e,s){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;const{prefixCls:l}=this.context;let r="large";e===h.ICON_POS_RIGHT&&(r="default");const c=K(`${l}-item-icon`,{[`${l}-item-icon-toggle-${this.context.toggleIconPosition}`]:n,[`${l}-item-icon-info`]:!n}),d=this.adapter.getIsOpen(),m=a.isValidElement(t)?s?a.createElement(De,{animationState:d?"enter":"leave",startClassName:`${x.PREFIX}-icon-rotate-${d?"180":"0"}`},C=>{let{animationClassName:w}=C;return a.cloneElement(t,{size:r,className:w})}):a.cloneElement(t,{size:r}):null;return a.createElement("i",{key:i,className:c},m)}renderTitleDiv(){const{text:t,icon:e,itemKey:s,indent:n,disabled:i,level:l,expandIcon:r}=this.props,{mode:c,isInSubNav:d,isCollapsed:m,prefixCls:C,subNavMotion:w,limitIndent:I}=this.context,g=this.adapter.getIsOpen(),L=K(`${C}-sub-title`,{[`${C}-sub-title-selected`]:this.adapter.getIsSelected(s),[`${C}-sub-title-disabled`]:i});let O=!1,f="";m?d?f=a.createElement(ie,null):f=null:c===h.MODE_HORIZONTAL?d?f=a.createElement(ie,{"aria-hidden":!0}):f=r||a.createElement(ae,{"aria-hidden":!0}):(w&&(O=!0),f=r||a.createElement(ae,{"aria-hidden":!0}));let v=null;if(c===h.MODE_VERTICAL&&!I&&!m){const D=e&&!n?l:l-1;v=be(D,E=>this.renderIcon(null,h.ICON_POS_RIGHT,!1,!1,E))}const B=!m&&d&&c===h.MODE_HORIZONTAL||m&&d;return a.createElement("div",{role:"menuitem",tabIndex:B?-1:0,ref:this.setTitleRef,className:L,onClick:this.handleClick,onKeyPress:this.handleKeyPress,"aria-expanded":g?"true":"false"},a.createElement("div",{className:`${C}-item-inner`},v,this.context.toggleIconPosition===h.TOGGLE_ICON_LEFT&&this.renderIcon(f,h.ICON_POS_RIGHT,O,!0,"key-toggle-position-left"),e||n||d&&c!==h.MODE_HORIZONTAL?this.renderIcon(e,h.ICON_POS_LEFT,!1,!1,"key-inSubNav-position-left"):null,a.createElement("span",{className:`${C}-item-text`},t),this.context.toggleIconPosition===h.TOGGLE_ICON_RIGHT&&this.renderIcon(f,h.ICON_POS_RIGHT,O,!0,"key-toggle-position-right")))}renderSubUl(){const{children:t,maxHeight:e}=this.props,{isCollapsed:s,mode:n,subNavMotion:i,prefixCls:l}=this.context,r=this.adapter.getIsOpen(),c=n===h.MODE_HORIZONTAL,d=K(`${l}-sub`,{[`${l}-sub-open`]:r,[`${l}-sub-popover`]:s||c});return c?null:i?a.createElement(Pe,{motion:i,isOpen:r,keepDOM:!1,fade:!0},s?null:a.createElement("ul",{className:d},t)):r&&!s?a.createElement("ul",{className:d},t):null}wrapDropdown(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";const{children:s,dropdownStyle:n,disabled:i,subDropdownProps:l,dropdownProps:r}=this.props,{mode:c,isInSubNav:d,isCollapsed:m,subNavCloseDelay:C,subNavOpenDelay:w,prefixCls:I,getPopupContainer:g}=this.context,L=this.adapter.getIsOpen(),O=this.adapter.getOpenKeysIsControlled(),f=K({[`${I}-popover`]:m}),v={trigger:"hover",style:n};return O&&(v.trigger="custom",v.visible=L),g&&(v.getPopupContainer=g),(m||c===h.MODE_HORIZONTAL)&&(e=i?e:a.createElement(se,Object.assign({className:f,render:a.createElement(se.Menu,null,s),position:c===h.MODE_HORIZONTAL&&!d?"bottomLeft":"rightTop",mouseEnterDelay:w,mouseLeaveDelay:C,onVisibleChange:this.handleDropdownVisible},r||l,v),e)),e}render(){const{itemKey:t,style:e,onMouseEnter:s,onMouseLeave:n,disabled:i,text:l}=this.props,{mode:r,isCollapsed:c,prefixCls:d}=this.context;let m=this.renderTitleDiv();const C=this.renderSubUl();return(c||r===h.MODE_HORIZONTAL)&&(m=this.wrapDropdown(m)),a.createElement(Z,{style:e,isSubNav:!0,itemKey:t,forwardRef:this.setItemRef,isCollapsed:c,className:`${d}-sub-wrap`,onMouseEnter:s,onMouseLeave:n,disabled:i,text:l},a.createElement(G.Provider,{value:Object.assign(Object.assign({},this.context),{isInSubNav:!0})},m,C))}}Y.contextType=G;Y.propTypes={itemKey:o.oneOfType([o.string,o.number]),text:o.oneOfType([o.string,o.node]),isOpen:o.bool,isCollapsed:o.bool,indent:o.oneOfType([o.bool,o.number]),children:o.node,style:o.object,icon:o.node,maxHeight:o.number,onMouseEnter:o.func,onMouseLeave:o.func,disabled:o.bool,level:o.number};Y.defaultProps={level:0,indent:!1,isCollapsed:!1,isOpen:!1,maxHeight:$.DEFAULT_SUBNAV_MAX_HEIGHT,disabled:!1};function We(p){let{prefixCls:t,locale:e,collapseText:s,isCollapsed:n,onClick:i=S}=p;const l=()=>{typeof i=="function"&&i(!n)},r={icon:a.createElement(Ze,null),type:"tertiary",theme:"borderless",onClick:l};let c=n?e?.expandText:e?.collapseText;return typeof s=="function"&&(c=s(n)),a.createElement("div",{className:`${t}-collapse-btn`},n?a.createElement(Oe,{content:c,position:"right"},a.createElement(re,Object.assign({},r))):a.createElement(re,Object.assign({},r),c))}class H extends b.PureComponent{constructor(){super(...arguments),this.renderCollapseButton=()=>{const{collapseButton:t,collapseText:e}=this.props;if(a.isValidElement(t))return t;const{onCollapseChange:s,prefixCls:n,locale:i,isCollapsed:l}=this.context;return a.createElement(We,{prefixCls:n,isCollapsed:l,locale:i,onClick:s,collapseText:e})}}render(){const{style:t,className:e,collapseButton:s,onClick:n}=this.props;let{children:i}=this.props;const{isCollapsed:l,mode:r}=this.context;!a.isValidElement(i)&&s&&r!==h.MODE_HORIZONTAL&&(i=this.renderCollapseButton());const c=K(e,`${x.PREFIX}-footer`,{[`${x.PREFIX}-footer-collapsed`]:l});return a.createElement("div",{className:c,style:t,onClick:n},i)}}H.contextType=G;H.propTypes={children:o.node,style:o.object,className:o.string,collapseButton:o.oneOfType([o.node,o.bool]),collapseText:o.func,onClick:o.func};H.defaultProps={collapseButton:!1,onClick:S};H.elementType="NavFooter";class M extends b.PureComponent{renderLogo(t){return a.isValidElement(t)?t:null}render(){const{children:t,style:e,className:s,logo:n,text:i,link:l,linkOptions:r,prefixCls:c}=this.props,{isCollapsed:d}=this.context,m=K(s,`${x.PREFIX}-header`,{[`${x.PREFIX}-header-collapsed`]:d});let C=a.createElement(a.Fragment,null,n?a.createElement("i",{className:`${x.PREFIX}-header-logo`},this.renderLogo(n)):null,!V(i)&&!d?a.createElement("span",{className:`${x.PREFIX}-header-text`},i):null,t);return typeof l=="string"&&(C=a.createElement("a",Object.assign({className:`${c}-header-link`,href:l},r),C)),a.createElement("div",{className:m,style:e},C)}}M.contextType=G;M.propTypes={prefixCls:o.string,logo:o.oneOfType([o.string,o.object,o.node]),text:o.oneOfType([o.string,o.node]),children:o.node,style:o.object,className:o.string,link:o.string,linkOptions:o.object};M.defaultProps={prefixCls:x.PREFIX};M.elementType="NavHeader";var ze=function(p,t){var e={};for(var s in p)Object.prototype.hasOwnProperty.call(p,s)&&t.indexOf(s)<0&&(e[s]=p[s]);if(p!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,s=Object.getOwnPropertySymbols(p);n<s.length;n++)t.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(p,s[n])&&(e[s[n]]=p[s[n]]);return e};function Ce(p,t){return function(){const s=new Set(p.state[t]);for(var n=arguments.length,i=new Array(n),l=0;l<n;l++)i[l]=arguments[l];i.forEach(r=>r&&s.add(r)),p.setState({[t]:Array.from(s)})}}function fe(p,t){return function(){const s=new Set(p.state[t]);for(var n=arguments.length,i=new Array(n),l=0;l<n;l++)i[l]=arguments[l];i.forEach(r=>r&&s.delete(r)),p.setState({[t]:Array.from(s)})}}const{hasOwnProperty:Ye}=Object.prototype;class A extends le{constructor(t){super(t),this.onCollapseChange=()=>{this.foundation.handleCollapseChange()},this.foundation=new F(this.adapter),this.itemsChanged=!0;const{isCollapsed:e,defaultIsCollapsed:s,items:n,children:i}=t,l={isCollapsed:!!(this.isControlled("isCollapsed")?e:s),openKeys:[],items:[],itemKeysMap:{},selectedKeys:[]};if(this.state=Object.assign({},l),n&&n.length||i){const r=this.foundation.init("constructor");this.state=Object.assign(Object.assign({},l),r)}}static getDerivedStateFromProps(t,e){const s={};return Ye.call(t,"isCollapsed")&&t.isCollapsed!==e.isCollapsed&&(s.isCollapsed=t.isCollapsed),s}componentDidMount(){}componentDidUpdate(t){if(t.items!==this.props.items||t.children!==this.props.children)this.foundation.init();else{if(this.foundation.handleItemsChange(!1),this.props.selectedKeys&&!ce(t.selectedKeys,this.props.selectedKeys)){this.adapter.updateSelectedKeys(this.props.selectedKeys);const e=this.foundation.getWillOpenKeys(this.state.itemKeysMap);this.adapter.updateOpenKeys(e)}this.props.openKeys&&!ce(t.openKeys,this.props.openKeys)&&this.adapter.updateOpenKeys(this.props.openKeys)}}get adapter(){var t=this;return Object.assign(Object.assign({},super.adapter),{notifySelect:function(){return t.props.onSelect(...arguments)},notifyOpenChange:function(){return t.props.onOpenChange(...arguments)},setIsCollapsed:e=>this.setState({isCollapsed:e}),notifyCollapseChange:function(){return t.props.onCollapseChange(...arguments)},updateItems:e=>this.setState({items:[...e]}),setItemKeysMap:e=>this.setState({itemKeysMap:Object.assign({},e)}),addSelectedKeys:Ce(this,"selectedKeys"),removeSelectedKeys:fe(this,"selectedKeys"),updateSelectedKeys:function(e){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=e;if(s){const i=t.foundation.selectLevelZeroParentKeys(null,e);n=Array.from(new Set(e.concat(i)))}t.setState({selectedKeys:n})},updateOpenKeys:e=>this.setState({openKeys:[...e]}),addOpenKeys:Ce(this,"openKeys"),removeOpenKeys:fe(this,"openKeys"),setItemsChanged:e=>{this.itemsChanged=e}})}renderItems(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const{expandIcon:s,subDropdownProps:n}=this.props;return a.createElement(a.Fragment,null,t.map((l,r)=>Array.isArray(l.items)&&l.items.length?a.createElement(Y,Object.assign({key:l.itemKey||String(e)+r},l,{level:e,expandIcon:s,subDropdownProps:n}),this.renderItems(l.items,e+1)):a.createElement(Z,Object.assign({key:l.itemKey||String(e)+r},l,{level:e}))))}render(){const t=this.props,{children:e,mode:s,onOpenChange:n,onSelect:i,onClick:l,style:r,className:c,subNavCloseDelay:d,subNavOpenDelay:m,subNavMotion:C,tooltipShowDelay:w,tooltipHideDelay:I,prefixCls:g,bodyStyle:L,footer:O,header:f,toggleIconPosition:v,limitIndent:B,renderWrapper:N,getPopupContainer:D}=t,E=ze(t,["children","mode","onOpenChange","onSelect","onClick","style","className","subNavCloseDelay","subNavOpenDelay","subNavMotion","tooltipShowDelay","tooltipHideDelay","prefixCls","bodyStyle","footer","header","toggleIconPosition","limitIndent","renderWrapper","getPopupContainer"]),{selectedKeys:q,openKeys:P,items:j,isCollapsed:T}=this.state,{updateOpenKeys:U,addOpenKeys:Ie,removeOpenKeys:ve,updateSelectedKeys:Ke,addSelectedKeys:xe,removeSelectedKeys:Ee}=this.adapter,Se=Object.assign({},r);let _=b.Children.toArray(e);const Q=[],J=[];if(a.isValidElement(O)?Q.push(a.createElement(H,{key:0},O)):O&&typeof O=="object"&&Q.push(a.createElement(H,Object.assign({key:0},O))),a.isValidElement(f)?J.push(a.createElement(M,{key:0},f)):f&&typeof f=="object"&&J.push(a.createElement(M,Object.assign({key:0},f))),Array.isArray(_)&&_.length){_=[..._];let X=_.length;for(let R=0;R<X;R++){const k=_[R];k.type===H||z(k,"type.elementType")==="NavFooter"?(Q.push(k),_.splice(R,1),R--,X--):(k.type===M||z(k,"type.elementType")==="NavHeader")&&(J.push(k),_.splice(R,1),R--,X--)}}const we=K(g,c,{[`${g}-collapsed`]:T,[`${g}-horizontal`]:s==="horizontal",[`${g}-vertical`]:s==="vertical"}),Ne=K(`${g}-header-list-outer`,{[`${g}-header-list-outer-collapsed`]:T});return this.itemsChanged&&this.adapter.setCache("itemElems",this.renderItems(j)),a.createElement(je,{componentName:"Navigation"},X=>a.createElement(G.Provider,{value:{subNavCloseDelay:d,subNavOpenDelay:m,subNavMotion:C,tooltipShowDelay:w,tooltipHideDelay:I,openKeys:P,openKeysIsControlled:this.isControlled("openKeys")&&s==="vertical"&&!T,canUpdateOpenKeys:!0,selectedKeys:q,selectedKeysIsControlled:this.isControlled("selectedKeys"),isCollapsed:T,onCollapseChange:this.onCollapseChange,mode:s,onSelect:i,onOpenChange:n,updateOpenKeys:U,addOpenKeys:Ie,removeOpenKeys:ve,updateSelectedKeys:Ke,addSelectedKeys:xe,removeSelectedKeys:Ee,onClick:l,locale:X,prefixCls:g,toggleIconPosition:v,limitIndent:B,renderWrapper:N,getPopupContainer:D}},a.createElement("div",Object.assign({className:we,style:Se},this.getDataAttr(E)),a.createElement("div",{className:`${g}-inner`},a.createElement("div",{className:Ne},J,a.createElement("div",{style:L,className:`${g}-list-wrapper`},a.createElement("ul",{role:"menu","aria-orientation":s,className:`${g}-list`},this.adapter.getCache("itemElems"),_))),Q))))}}A.Sub=Y;A.Item=Z;A.Header=M;A.Footer=H;A.propTypes={collapseIcon:o.node,defaultOpenKeys:o.arrayOf(o.oneOfType([o.string,o.number])),openKeys:o.arrayOf(o.oneOfType([o.string,o.number])),defaultSelectedKeys:o.arrayOf(o.oneOfType([o.string,o.number])),expandIcon:o.node,selectedKeys:o.arrayOf(o.oneOfType([o.string,o.number])),mode:o.oneOf([...h.MODE]),onSelect:o.func,onClick:o.func,onOpenChange:o.func,items:o.array,isCollapsed:o.bool,defaultIsCollapsed:o.bool,onCollapseChange:o.func,multiple:o.bool,onDeselect:o.func,subNavMotion:o.oneOfType([o.bool,o.object,o.func]),subNavCloseDelay:o.number,subNavOpenDelay:o.number,tooltipShowDelay:o.number,tooltipHideDelay:o.number,children:o.node,style:o.object,bodyStyle:o.object,className:o.string,toggleIconPosition:o.string,prefixCls:o.string,header:o.oneOfType([o.node,o.object]),footer:o.oneOfType([o.node,o.object]),limitIndent:o.bool,getPopupContainer:o.func};A.__SemiComponentName__="Navigation";A.defaultProps=He(A.__SemiComponentName__,{subNavCloseDelay:$.DEFAULT_SUBNAV_CLOSE_DELAY,subNavOpenDelay:$.DEFAULT_SUBNAV_OPEN_DELAY,tooltipHideDelay:$.DEFAULT_TOOLTIP_HIDE_DELAY,tooltipShowDelay:$.DEFAULT_TOOLTIP_SHOW_DELAY,onCollapseChange:S,onSelect:S,onClick:S,onOpenChange:S,toggleIconPosition:"right",limitIndent:!0,prefixCls:x.PREFIX,subNavMotion:!0,mode:h.MODE_VERTICAL});function qe(){return u.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:u.jsx("path",{d:"M8.48092 0.748384C8.16727 0.653859 7.83272 0.653859 7.51907 0.748384C7.30423 0.813133 7.13028 0.92386 6.97716 1.04125C6.83512 1.15015 6.67675 1.2924 6.50211 1.44927L2.21784 5.29713C2.00105 5.49145 1.80997 5.66273 1.66845 5.87532C1.54419 6.062 1.4522 6.26826 1.39635 6.48545C1.33275 6.73279 1.333 6.9894 1.33329 7.28054L1.33333 12.4241C1.33331 12.6835 1.3333 12.9169 1.34917 13.1111C1.36616 13.3191 1.40462 13.5401 1.51499 13.7567C1.67477 14.0703 1.92974 14.3253 2.24335 14.485C2.45995 14.5954 2.68093 14.6339 2.88891 14.6509C3.08312 14.6667 3.31653 14.6667 3.57591 14.6667H12.4241C12.6835 14.6667 12.9169 14.6667 13.1111 14.6509C13.3191 14.6339 13.54 14.5954 13.7566 14.485C14.0703 14.3253 14.3252 14.0703 14.485 13.7567C14.5954 13.5401 14.6338 13.3191 14.6508 13.1111C14.6667 12.9169 14.6667 12.6835 14.6667 12.4241L14.6667 7.28053C14.667 6.9894 14.6672 6.73279 14.6036 6.48545C14.5478 6.26826 14.4558 6.062 14.3315 5.87532C14.19 5.66273 13.9989 5.49145 13.7822 5.29713L9.49788 1.44927C9.32325 1.2924 9.16488 1.15015 9.02284 1.04125C8.86971 0.923861 8.69577 0.813133 8.48092 0.748384ZM7.90381 2.025C7.96654 2.0061 8.03345 2.0061 8.09618 2.025C8.09682 2.02519 8.10364 2.0272 8.11997 2.0364C8.13837 2.04678 8.16717 2.06534 8.21161 2.0994C8.30743 2.17287 8.42696 2.27959 8.62365 2.45625L12.8467 6.24917C13.1328 6.50615 13.1858 6.56032 13.2216 6.61414C13.263 6.67637 13.2937 6.74512 13.3123 6.81752C13.3284 6.88014 13.3333 6.95575 13.3333 7.34034V12.4C13.3333 12.6911 13.3328 12.8692 13.3219 13.0025C13.3168 13.0646 13.3105 13.1022 13.3051 13.125C13.3025 13.1359 13.3004 13.1426 13.2991 13.1462C13.2979 13.1496 13.2971 13.1511 13.297 13.1514C13.265 13.2141 13.214 13.2651 13.1513 13.297C13.1511 13.2972 13.1496 13.2979 13.1461 13.2991C13.1425 13.3004 13.1359 13.3026 13.125 13.3051C13.1022 13.3105 13.0646 13.3169 13.0025 13.322C12.8692 13.3328 12.691 13.3334 12.4 13.3334H8.66667V8.50008C8.66667 8.31599 8.51743 8.16675 8.33333 8.16675H7.66667C7.48257 8.16675 7.33333 8.31599 7.33333 8.50008V13.3334H3.6C3.30897 13.3334 3.13079 13.3328 2.99749 13.322C2.93539 13.3169 2.89781 13.3105 2.875 13.3051C2.86414 13.3026 2.85747 13.3004 2.85386 13.2991C2.85039 13.2979 2.84894 13.2972 2.84867 13.297C2.78595 13.2651 2.73495 13.2141 2.70299 13.1514C2.70291 13.1512 2.70256 13.1505 2.70199 13.1491C2.70168 13.1483 2.70131 13.1474 2.70088 13.1462C2.69959 13.1426 2.69745 13.1359 2.69489 13.125C2.68952 13.1022 2.68315 13.0646 2.67807 13.0025C2.66718 12.8692 2.66666 12.6911 2.66666 12.4V7.34034C2.66666 6.95575 2.67157 6.88014 2.68767 6.81752C2.70629 6.74512 2.73695 6.67637 2.77837 6.61414C2.8142 6.56032 2.86717 6.50615 3.1533 6.24917L7.37634 2.45625C7.57304 2.27959 7.69256 2.17287 7.78839 2.0994C7.83282 2.06534 7.86162 2.04678 7.88003 2.0364C7.89635 2.0272 7.90317 2.02519 7.90381 2.025Z",fill:"black",fillOpacity:"0.65"})})}const Qe=()=>u.jsx(ee,{svg:u.jsx(qe,{})});function Je(){return u.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[u.jsx("path",{d:"M5.33333 7.66675C5.14924 7.66675 5 7.51751 5 7.33341V6.66675C5 6.48265 5.14924 6.33341 5.33333 6.33341H10.6667C10.8508 6.33341 11 6.48265 11 6.66675V7.33341C11 7.51751 10.8508 7.66675 10.6667 7.66675H5.33333Z",fill:"black",fillOpacity:"0.65"}),u.jsx("path",{d:"M5.33333 10.6667C5.14924 10.6667 5 10.5175 5 10.3334V9.66675C5 9.48265 5.14924 9.33341 5.33333 9.33341H8.33333C8.51743 9.33341 8.66667 9.48265 8.66667 9.66675V10.3334C8.66667 10.5175 8.51743 10.6667 8.33333 10.6667H5.33333Z",fill:"black",fillOpacity:"0.65"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.33333 0.666748C5.14924 0.666748 5 0.815986 5 1.00008V2.00013C4.01165 2.0009 3.49359 2.01346 3.09202 2.21807C2.71569 2.40982 2.40973 2.71578 2.21799 3.0921C2 3.51992 2 4.07998 2 5.20008V12.1334C2 13.2535 2 13.8136 2.21799 14.2414C2.40973 14.6177 2.71569 14.9237 3.09202 15.1154C3.51984 15.3334 4.0799 15.3334 5.2 15.3334H10.8C11.9201 15.3334 12.4802 15.3334 12.908 15.1154C13.2843 14.9237 13.5903 14.6177 13.782 14.2414C14 13.8136 14 13.2535 14 12.1334V5.20008C14 4.07998 14 3.51992 13.782 3.0921C13.5903 2.71578 13.2843 2.40982 12.908 2.21807C12.5064 2.01346 11.9883 2.0009 11 2.00013V1.00008C11 0.815986 10.8508 0.666748 10.6667 0.666748H10C9.81591 0.666748 9.66667 0.815986 9.66667 1.00008V2.00008H6.33333V1.00008C6.33333 0.815986 6.1841 0.666748 6 0.666748H5.33333ZM3.99498 3.35623C4.22961 3.33707 4.53372 3.33396 5 3.33349V4.00008C5 4.18418 5.14924 4.33341 5.33333 4.33341H6C6.1841 4.33341 6.33333 4.18418 6.33333 4.00008V3.33341H9.66667V4.00008C9.66667 4.18418 9.81591 4.33341 10 4.33341H10.6667C10.8508 4.33341 11 4.18418 11 4.00008V3.33349C11.4663 3.33396 11.7704 3.33707 12.005 3.35623C12.1292 3.36638 12.2044 3.37913 12.25 3.38988C12.2717 3.39499 12.2851 3.39927 12.2923 3.40185C12.2992 3.40432 12.3027 3.40608 12.3027 3.40608C12.4281 3.46999 12.5301 3.57198 12.594 3.69742C12.594 3.69742 12.5958 3.70087 12.5982 3.7078C12.6008 3.71502 12.6051 3.72837 12.6102 3.75008C12.621 3.79572 12.6337 3.87086 12.6438 3.99506C12.6656 4.26168 12.6667 4.61803 12.6667 5.20008V12.1334C12.6667 12.7155 12.6656 13.0718 12.6438 13.3384C12.6337 13.4626 12.621 13.5378 12.6102 13.5834C12.6051 13.6051 12.6008 13.6185 12.5982 13.6257C12.5969 13.6295 12.5958 13.632 12.5951 13.6337C12.5945 13.6351 12.594 13.6361 12.594 13.6361C12.5301 13.7615 12.4281 13.8635 12.3027 13.9274C12.3027 13.9274 12.2992 13.9292 12.2923 13.9316C12.2851 13.9342 12.2717 13.9385 12.25 13.9436C12.2044 13.9544 12.1292 13.9671 12.005 13.9773C11.7384 13.999 11.3821 14.0001 10.8 14.0001H5.2C4.61795 14.0001 4.26159 13.999 3.99498 13.9773C3.87078 13.9671 3.79563 13.9544 3.75 13.9436C3.72829 13.9385 3.71494 13.9342 3.70772 13.9316C3.70078 13.9292 3.69734 13.9274 3.69734 13.9274C3.5719 13.8635 3.46991 13.7615 3.406 13.6361C3.406 13.6361 3.40424 13.6326 3.40177 13.6257C3.39919 13.6185 3.39491 13.6051 3.38979 13.5834C3.37905 13.5378 3.3663 13.4626 3.35615 13.3384C3.33437 13.0718 3.33333 12.7155 3.33333 12.1334V5.20008C3.33333 4.61803 3.33437 4.26168 3.35615 3.99506C3.3663 3.87086 3.37905 3.79572 3.38979 3.75008C3.39491 3.72837 3.39919 3.71502 3.40177 3.7078C3.40424 3.70087 3.406 3.69742 3.406 3.69742C3.46991 3.57198 3.5719 3.46999 3.69734 3.40608C3.69734 3.40608 3.70078 3.40432 3.70772 3.40185C3.71494 3.39927 3.72829 3.39499 3.75 3.38988C3.79563 3.37913 3.87078 3.36638 3.99498 3.35623Z",fill:"black",fillOpacity:"0.65"})]})}const et=()=>u.jsx(ee,{svg:u.jsx(Je,{})});function tt(){return u.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 7.16667C7.33518 7.16667 8.45466 6.24312 8.75446 5H14.6667C14.8508 5 15 4.85076 15 4.66667V4C15 3.81591 14.8508 3.66667 14.6667 3.66667H8.75446C8.45466 2.42355 7.33518 1.5 6 1.5C4.66482 1.5 3.54534 2.42355 3.24554 3.66667H1.33333C1.14924 3.66667 1 3.81591 1 4V4.66667C1 4.85076 1.14924 5 1.33333 5H3.24554C3.54534 6.24312 4.66482 7.16667 6 7.16667ZM7.5 4.33333C7.5 5.16176 6.82843 5.83333 6 5.83333C5.17157 5.83333 4.5 5.16176 4.5 4.33333C4.5 3.50491 5.17157 2.83333 6 2.83333C6.82843 2.83333 7.5 3.50491 7.5 4.33333Z",fill:"black",fillOpacity:"0.65"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 14.5C11.3352 14.5 12.4547 13.5765 12.7545 12.3333H14.6667C14.8508 12.3333 15 12.1841 15 12V11.3333C15 11.1492 14.8508 11 14.6667 11H12.7545C12.4547 9.75688 11.3352 8.83333 10 8.83333C8.66482 8.83333 7.54534 9.75688 7.24554 11H1.33333C1.14924 11 1 11.1492 1 11.3333V12C1 12.1841 1.14924 12.3333 1.33333 12.3333H7.24554C7.54534 13.5765 8.66482 14.5 10 14.5ZM11.5 11.6667C11.5 12.4951 10.8284 13.1667 10 13.1667C9.17157 13.1667 8.5 12.4951 8.5 11.6667C8.5 10.8382 9.17157 10.1667 10 10.1667C10.8284 10.1667 11.5 10.8382 11.5 11.6667Z",fill:"black",fillOpacity:"0.65"})]})}const st=()=>u.jsx(ee,{svg:u.jsx(tt,{})});function nt(){return u.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[u.jsx("path",{d:"M5.66666 2.66659C5.85076 2.66659 6 2.51735 6 2.33325V1.66659C6 1.48249 5.85076 1.33325 5.66666 1.33325H5.59999C4.10652 1.33325 3.35979 1.33325 2.78935 1.6239C2.28759 1.87956 1.87964 2.28751 1.62398 2.78928C1.33333 3.35971 1.33333 4.10645 1.33333 5.59992V5.66658C1.33333 5.85068 1.48257 5.99992 1.66666 5.99992H2.33333C2.51742 5.99992 2.66666 5.85068 2.66666 5.66658V5.59992C2.66666 4.83118 2.6677 4.33482 2.69856 3.95703C2.72816 3.59482 2.7784 3.46052 2.81199 3.3946C2.93982 3.14372 3.14379 2.93974 3.39467 2.81191C3.4606 2.77832 3.59489 2.72808 3.95711 2.69849C4.33489 2.66762 4.83126 2.66659 5.59999 2.66659H5.66666Z",fill:"black",fillOpacity:"0.65"}),u.jsx("path",{d:"M14.6667 5.66658C14.6667 5.85068 14.5174 5.99992 14.3333 5.99992H13.6667C13.4826 5.99992 13.3333 5.85068 13.3333 5.66658V5.59992C13.3333 4.83118 13.3323 4.33482 13.3014 3.95703C13.2718 3.59482 13.2216 3.46052 13.188 3.3946C13.0602 3.14372 12.8562 2.93974 12.6053 2.81191C12.5394 2.77832 12.4051 2.72808 12.0429 2.69849C11.6651 2.66762 11.1687 2.66659 10.4 2.66659H10.3333C10.1492 2.66659 10 2.51735 10 2.33325V1.66659C10 1.48249 10.1492 1.33325 10.3333 1.33325H10.4C11.8935 1.33325 12.6402 1.33325 13.2106 1.6239C13.7124 1.87956 14.1203 2.28751 14.376 2.78928C14.6667 3.35971 14.6667 4.10645 14.6667 5.59992V5.66658Z",fill:"black",fillOpacity:"0.65"}),u.jsx("path",{d:"M1.66666 9.99992C1.48257 9.99992 1.33333 10.1492 1.33333 10.3333V10.3999C1.33333 11.8934 1.33333 12.6401 1.62398 13.2106C1.87964 13.7123 2.28759 14.1203 2.78935 14.3759C3.35979 14.6666 4.10652 14.6666 5.59999 14.6666H5.66666C5.85076 14.6666 6 14.5173 6 14.3333V13.6666C6 13.4825 5.85076 13.3333 5.66666 13.3333H5.59999C4.83126 13.3333 4.33489 13.3322 3.95711 13.3013C3.59489 13.2718 3.4606 13.2215 3.39467 13.1879C3.14379 13.0601 2.93982 12.8561 2.81199 12.6052C2.7784 12.5393 2.72816 12.405 2.69856 12.0428C2.6677 11.665 2.66666 11.1687 2.66666 10.3999V10.3333C2.66666 10.1492 2.51742 9.99992 2.33333 9.99992H1.66666Z",fill:"black",fillOpacity:"0.65"}),u.jsx("path",{d:"M10.3333 13.3333C10.1492 13.3333 10 13.4825 10 13.6666V14.3333C10 14.5173 10.1492 14.6666 10.3333 14.6666H10.4C11.8935 14.6666 12.6402 14.6666 13.2106 14.3759C13.7124 14.1203 14.1203 13.7123 14.376 13.2106C14.6667 12.6401 14.6667 11.8934 14.6667 10.3999V10.3333C14.6667 10.1492 14.5174 9.99992 14.3333 9.99992H13.6667C13.4826 9.99992 13.3333 10.1492 13.3333 10.3333V10.3999C13.3333 11.1687 13.3323 11.665 13.3014 12.0428C13.2718 12.405 13.2216 12.5393 13.188 12.6052C13.0602 12.8561 12.8562 13.0601 12.6053 13.1879C12.5394 13.2215 12.4051 13.2718 12.0429 13.3013C11.6651 13.3322 11.1687 13.3333 10.4 13.3333H10.3333Z",fill:"black",fillOpacity:"0.65"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.17159 10.1144C8.64463 10.4634 8.01272 10.6667 7.33333 10.6667C5.49238 10.6667 3.99999 9.17428 3.99999 7.33333C3.99999 5.49238 5.49238 4 7.33333 4C9.17428 4 10.6667 5.49238 10.6667 7.33333C10.6667 8.01272 10.4634 8.64464 10.1144 9.17159L11.7357 10.7929C11.8659 10.9231 11.8659 11.1341 11.7357 11.2643L11.2643 11.7357C11.1341 11.8659 10.9231 11.8659 10.7929 11.7357L9.17159 10.1144ZM9.33333 7.33333C9.33333 8.4379 8.4379 9.33333 7.33333 9.33333C6.22876 9.33333 5.33333 8.4379 5.33333 7.33333C5.33333 6.22876 6.22876 5.33333 7.33333 5.33333C8.4379 5.33333 9.33333 6.22876 9.33333 7.33333Z",fill:"black",fillOpacity:"0.65"})]})}const ot=()=>u.jsx(ee,{svg:u.jsx(nt,{})}),te=[{text:W("scanQRCode2Debug"),itemKey:"scan_qrcode",icon:u.jsx(Qe,{}),path:"/"},{itemKey:"launch_mode",text:W("launchMode"),icon:u.jsx(st,{}),path:"/launch_mode"},{itemKey:"precheck_code",text:W("codePreCheck"),icon:u.jsx(ot,{}),path:"/precheck_code"},{itemKey:"project_info",text:W("projectInfo"),icon:u.jsx(et,{}),path:"/project_detail"},{itemKey:"changelog",text:W("changelog"),icon:u.jsx(Fe,{size:"default",style:{fontWeight:"300",color:"#666"}}),path:"/changelog"}],at=()=>{const{state:{devToolVersion:p}}=Me(),t=Le(),[e,s]=b.useState("scan_qrcode"),[n,i]=b.useState(!1);b.useEffect(()=>{i(Re(p))},[p]);const l=b.useMemo(()=>te.map(c=>c.itemKey==="changelog"?{...c,text:u.jsxs("span",{className:"sidebar-changelog-label",children:[c.text,n&&u.jsx(Ve,{className:"sidebar-changelog-new-tag",color:"red",shape:"circle",size:"small",type:"solid",children:"NEW"})]})}:c),[n]),r=c=>{const d=te.find(m=>m.itemKey===c.itemKey);d&&(d.itemKey==="changelog"&&p&&(ke(p),i(!1)),t(d.path),s(d.itemKey))};return b.useEffect(()=>{const c=window.location.pathname,d=te.find(m=>m.path===c);s(d?d.itemKey:"")},[t]),u.jsx(A,{limitIndent:!1,bodyStyle:{height:"100vh",paddingLeft:"12px",width:"100%"},items:l,selectedKeys:[e],onSelect:r})};export{at as Sidebar};