@customize-agent/server 4.60.12 → 4.60.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +61 -61
- package/.next/prerender-manifest.json +3 -3
- package/.next/required-server-files.json +1 -1
- package/.next/server/chunks/1243.js +1 -1
- package/.next/server/chunks/1928.js +1 -1
- package/.next/server/chunks/1936.js +9 -9
- package/.next/server/chunks/2328.js +1 -1
- package/.next/server/chunks/4722.js +3 -3
- package/.next/server/chunks/6021.js +1 -0
- package/.next/server/chunks/6321.js +1 -1
- package/.next/server/chunks/6822.js +1 -1
- package/.next/server/chunks/8204.js +1 -1
- package/.next/server/chunks/9666.js +13 -13
- package/.next/server/instrumentation.js.nft.json +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/pages/api/assets/generated/preview.js.nft.json +1 -1
- package/.next/server/pages/api/assets/generated.js.nft.json +1 -1
- package/.next/server/pages/api/config/embedding/healthCheck.js.nft.json +1 -1
- package/.next/server/pages/api/documents/canvas/[id].js.nft.json +1 -1
- package/.next/server/pages/api/documents/export.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generate/preview.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generate.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated/[id]/events.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated/[id]/figure/[name].js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated/[id]/instruction.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated/[id]/nodes/[nodeId].js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated/[id]/nodes.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated/[id]/pause.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated/[id]/preview.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated/[id]/repair/[rid]/confirm.js +1 -1
- package/.next/server/pages/api/documents/generated/[id]/repair/[rid]/confirm.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated/[id]/repair/[rid]/rollback.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated/[id]/repair.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated/[id]/report.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated/[id]/resume-generate.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated/[id].js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated.js.nft.json +1 -1
- package/.next/server/pages/api/health.js +1 -1
- package/.next/server/pages/api/jobs/[id].js.nft.json +1 -1
- package/.next/server/pages/api/kb/categories.js.nft.json +1 -1
- package/.next/server/pages/api/kb/duplicates.js.nft.json +1 -1
- package/.next/server/pages/api/kb/files/detail.js.nft.json +1 -1
- package/.next/server/pages/api/kb/files/export.js.nft.json +1 -1
- package/.next/server/pages/api/kb/files/open.js.nft.json +1 -1
- package/.next/server/pages/api/kb/files/preview-pdf-page.js.nft.json +1 -1
- package/.next/server/pages/api/kb/files/reindex.js.nft.json +1 -1
- package/.next/server/pages/api/kb/files/search.js.nft.json +1 -1
- package/.next/server/pages/api/kb/files/source-preview.js.nft.json +1 -1
- package/.next/server/pages/api/kb/files.js.nft.json +1 -1
- package/.next/server/pages/api/kb/ignore.js.nft.json +1 -1
- package/.next/server/pages/api/kb/material-groups.js.nft.json +1 -1
- package/.next/server/pages/api/kb/operations.js.nft.json +1 -1
- package/.next/server/pages/api/kb/reindex.js.nft.json +1 -1
- package/.next/server/pages/api/kb/stats.js.nft.json +1 -1
- package/.next/server/pages/api/kb/tags.js.nft.json +1 -1
- package/.next/server/pages/api/kb/upload/complete.js.nft.json +1 -1
- package/.next/server/pages/api/kb/upload.js +1 -1
- package/.next/server/pages/api/kb/upload.js.nft.json +1 -1
- package/.next/server/pages/api/system/reset.js.nft.json +1 -1
- package/.next/server/pages/canvas/[id].html +1 -1
- package/.next/server/pages/canvas.html +1 -1
- package/.next/server/pages/documents.html +1 -1
- package/.next/server/pages/guide.html +1 -1
- package/.next/server/pages/index.html +1 -1
- package/.next/server/pages/knowledge/file-detail.html +1 -1
- package/.next/server/pages/knowledge/files.html +1 -1
- package/.next/server/pages/knowledge/manage.html +1 -1
- package/.next/server/pages/knowledge/source-preview.html +1 -1
- package/.next/server/pages/knowledge.html +1 -1
- package/.next/server/pages/models.html +1 -1
- package/.next/server/pages/overview.html +1 -1
- package/.next/server/pages/prompt.html +1 -1
- package/.next/server/pages/settings.html +1 -1
- package/.next/server/pages/skills/[id]/edit.html +1 -1
- package/.next/server/pages/skills/[id]/edit.js.nft.json +1 -1
- package/.next/server/pages/skills/[id].html +1 -1
- package/.next/server/pages/skills/[id].js.nft.json +1 -1
- package/.next/server/pages/skills/new.html +1 -1
- package/.next/server/pages/skills/new.js.nft.json +1 -1
- package/.next/server/pages/skills.html +1 -1
- package/.next/server/pages/system/logs.html +1 -1
- package/.next/server/pages-manifest.json +30 -30
- package/.next/static/c7f9aefd14f63a15dfe1a3ab4b189ce98e5784658308b514fdf3e998d82aba47/_buildManifest.js +1 -0
- package/.next/static/chunks/162-36b2a3e6ee7d9717.js +8 -0
- package/.next/static/chunks/257-879f095890deadad.js +1 -0
- package/.next/static/chunks/313-4b3ff7075e0ff3c3.js +1 -0
- package/.next/static/chunks/530-98c3b3fbf3fcd8e3.js +1 -0
- package/.next/static/chunks/551-446a9d48add4944f.js +16 -0
- package/.next/static/chunks/715-6285c5942e5ec5ea.js +1 -0
- package/.next/static/chunks/717-743b697a417dd5ee.js +4 -0
- package/.next/static/chunks/748-e13db510f76568b1.js +1 -0
- package/.next/static/chunks/795-3edd02531a6d39ae.js +1 -0
- package/.next/static/chunks/955-f0542d4dea118b62.js +1 -0
- package/.next/static/chunks/{964-569c27befeaff602.js → 964-82cc4701f08f7351.js} +2 -2
- package/.next/static/chunks/pages/{_app-28228d95968c4d44.js → _app-4165169ba0fabd04.js} +1 -1
- package/.next/static/chunks/pages/canvas/[id]-792d02e3874c19c0.js +1 -0
- package/.next/static/chunks/pages/{canvas-ffb08963e5cf9558.js → canvas-e011bb88585d3441.js} +1 -1
- package/.next/static/chunks/pages/guide-3185f12fbcb5a6af.js +1 -0
- package/.next/static/chunks/pages/knowledge/file-detail-c34e1f995fb8316f.js +1 -0
- package/.next/static/chunks/pages/knowledge/source-preview-814c683fc3723177.js +1 -0
- package/.next/static/chunks/pages/knowledge-3afd4bc337d44550.js +1 -0
- package/.next/static/chunks/pages/models-e07b2e29595effd7.js +1 -0
- package/.next/static/chunks/pages/prompt-47a1ac955831dedb.js +1 -0
- package/.next/static/chunks/pages/settings-8879d8c90bee2025.js +1 -0
- package/.next/static/chunks/pages/skills/[id]/{edit-89bbed9a3a854b04.js → edit-88e2490a4190467b.js} +1 -1
- package/.next/static/chunks/pages/skills/[id]-4700cd743c5efe05.js +1 -0
- package/.next/static/chunks/pages/skills/{new-124599c772150a1d.js → new-b2204742b055565a.js} +1 -1
- package/.next/static/chunks/pages/skills-1f6bcb42cd90abeb.js +1 -0
- package/.next/static/chunks/pages/system/logs-8c5dd4d06fa9d8c9.js +1 -0
- package/.next/static/css/cb79b8022e718258.css +1 -0
- package/package.json +2 -2
- package/scripts/half-built-scan.baseline.json +3 -4
- package/scripts/kb-index-worker.cjs +4 -1
- package/.next/server/chunks/9399.js +0 -1
- package/.next/static/b1bfae7c0251c082ada423097236fed51bd95e3e34a0749ccd55030dbf543f5d/_buildManifest.js +0 -1
- package/.next/static/chunks/162-a5be07e04aedf98a.js +0 -8
- package/.next/static/chunks/2-434e34e83819f4e4.js +0 -1
- package/.next/static/chunks/257-6938c7ab284ab21c.js +0 -1
- package/.next/static/chunks/280-3ce590d421b5c47d.js +0 -16
- package/.next/static/chunks/324-650dc02536b071bf.js +0 -4
- package/.next/static/chunks/425-42f2568bcdd98f4c.js +0 -1
- package/.next/static/chunks/530-7e79396d68742829.js +0 -1
- package/.next/static/chunks/564-d3426eef3e3e415b.js +0 -4
- package/.next/static/chunks/781-a6b83dbcd1a33cab.js +0 -1
- package/.next/static/chunks/795-1c1cb3bf1f600e99.js +0 -1
- package/.next/static/chunks/819-96247c9054ad9683.js +0 -1
- package/.next/static/chunks/pages/canvas/[id]-534b45f39f39630c.js +0 -1
- package/.next/static/chunks/pages/guide-82ae330966139191.js +0 -1
- package/.next/static/chunks/pages/knowledge/file-detail-dc1807f8ed32cd59.js +0 -1
- package/.next/static/chunks/pages/knowledge/source-preview-4309277bf497521c.js +0 -1
- package/.next/static/chunks/pages/knowledge-84e386d765ddd311.js +0 -1
- package/.next/static/chunks/pages/models-5eee2d09deb081fb.js +0 -1
- package/.next/static/chunks/pages/prompt-d75de6a6fead73c9.js +0 -1
- package/.next/static/chunks/pages/settings-f6dfff648cf9ac0e.js +0 -1
- package/.next/static/chunks/pages/skills/[id]-5130d68546be49cb.js +0 -1
- package/.next/static/chunks/pages/skills-476714776be63ce5.js +0 -1
- package/.next/static/chunks/pages/system/logs-40edb648d89b0749.js +0 -1
- package/.next/static/css/f4f2d386cfeae8e4.css +0 -1
- /package/.next/static/{b1bfae7c0251c082ada423097236fed51bd95e3e34a0749ccd55030dbf543f5d → c7f9aefd14f63a15dfe1a3ab4b189ce98e5784658308b514fdf3e998d82aba47}/_ssgManifest.js +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[636],{112:(e,t,r)=>{"use strict";function n(...e){return e.find(e=>void 0!==e)}r.d(t,{A:()=>n})},632:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=e=>`${e}-css-var`},1210:(e,t,r)=>{"use strict";r.d(t,{A:()=>C});var n=r(97109),o=r(39019),a=r(3638),i=r(76631),l=r(92162),s=r(26047),c=r(4034),u=r(74567),d=r(6831),f=r(632),p=r(27273),m=r(55359),h=r(73134),g=r(49644),b=r(42644),y=r(44390),v=r(10540),x=r(28403),$=r(84767);let w=(0,v.OF)(["Input","TextArea"],e=>(e=>{let{componentCls:t,paddingLG:r}=e,n=`${t}-textarea`;return{[`textarea${t}`]:{maxWidth:"100%",height:"auto",minHeight:e.controlHeight,lineHeight:e.lineHeight,verticalAlign:"bottom",transition:`all ${e.motionDurationSlow}`,resize:"vertical",[`&${t}-mouse-active`]:{transition:`all ${e.motionDurationSlow}, height 0s, width 0s`}},[`${t}-textarea-affix-wrapper-resize-dirty`]:{width:"auto"},[n]:{position:"relative","&-show-count":{[`${t}-data-count`]:{position:"absolute",bottom:e.calc(e.fontSize).mul(e.lineHeight).mul(-1).equal(),insetInlineEnd:0,color:e.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},[`
|
|
2
2
|
&-allow-clear > ${t},
|
|
3
3
|
&-affix-wrapper${n}-has-feedback ${t}
|
|
4
|
-
`]:{paddingInlineEnd:r},[`&-affix-wrapper${t}-affix-wrapper`]:{padding:0,[`> textarea${t}`]:{fontSize:"inherit",border:"none",outline:"none",background:"transparent",minHeight:e.calc(e.controlHeight).sub(e.calc(e.lineWidth).mul(2)).equal(),"&:focus":{boxShadow:"none !important"}},[`${t}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${t}-clear-icon`]:{position:"absolute",insetInlineEnd:e.paddingInline,insetBlockStart:e.paddingXS},[`${n}-suffix`]:{position:"absolute",top:0,insetInlineEnd:e.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}},[`&-affix-wrapper${t}-affix-wrapper-rtl`]:{[`${t}-suffix`]:{[`${t}-data-count`]:{direction:"ltr",insetInlineStart:0}}},[`&-affix-wrapper${t}-affix-wrapper-sm`]:{[`${t}-suffix`]:{[`${t}-clear-icon`]:{insetInlineEnd:e.paddingInlineSM}}}}}})((0,x.oX)(e,(0,$.C)(e))),$.b,{resetFont:!1}),C=(0,n.forwardRef)((e,t)=>{let{prefixCls:r,bordered:v=!0,size:x,disabled:$,status:C,allowClear:E,classNames:k,rootClassName:S,className:A,style:P,styles:R,variant:M,showCount:T,onMouseDown:O,onResize:N,...F}=e,{getPrefixCls:j,direction:I,allowClear:z,autoComplete:B,className:L,style:D,classNames:_,styles:H}=(0,u.TP)("textArea"),W=n.useContext(d.A),{status:q,hasFeedback:U,feedbackIcon:V}=n.useContext(m.$W),X=(0,c.v)(q,C),G=(0,l.XT)(D),K=(0,l.XT)(P),[Y,Q]=(0,l.AV)([_,k],[H,G,R,K],{props:e}),Z=n.useRef(null);n.useImperativeHandle(t,()=>({resizableTextArea:Z.current?.resizableTextArea,focus:e=>{(0,b.F4)(Z.current?.resizableTextArea?.textArea,e)},blur:()=>Z.current?.blur(),nativeElement:Z.current?.nativeElement||null}));let J=j("input",r),ee=(0,f.A)(J),[et,er]=(0,y.MG)(J,S);w(J,ee);let{compactSize:en,compactItemClassnames:eo}=(0,g.RQ)(J,I),ea=(0,p.A)(e=>x??en??e),[ei,el]=(0,h.A)("textArea",M,v),es=(0,i.O)({allowClear:E,contextAllowClear:z,componentName:"TextArea"}),[ec,eu]=n.useState(!1),[ed,ef]=n.useState(!1);return n.createElement(o.fs,{autoComplete:B,...F,style:Q.root,styles:Q,disabled:$??W,allowClear:es,className:(0,a.$)(er,ee,A,S,eo,L,Y.root,{[`${J}-textarea-affix-wrapper-resize-dirty`]:ed}),classNames:{...Y,textarea:(0,a.$)({[`${J}-sm`]:"small"===ea,[`${J}-lg`]:"large"===ea},et,Y.textarea,ec&&`${J}-mouse-active`),variant:(0,a.$)({[`${J}-${ei}`]:el},(0,c.L)(J,X)),affixWrapper:(0,a.$)(`${J}-textarea-affix-wrapper`,{[`${J}-affix-wrapper-rtl`]:"rtl"===I,[`${J}-affix-wrapper-sm`]:"small"===ea,[`${J}-affix-wrapper-lg`]:"large"===ea,[`${J}-textarea-show-count`]:T||e.count?.show},et)},prefixCls:J,suffix:U&&n.createElement("span",{className:`${J}-textarea-suffix`},V),showCount:T,ref:Z,onResize:e=>{if(N?.(e),ec&&(0,s.Tn)(getComputedStyle)){let e=Z.current?.nativeElement?.querySelector("textarea");e&&"both"===getComputedStyle(e).resize&&ef(!0)}},onMouseDown:e=>{eu(!0),O?.(e);let t=()=>{eu(!1),document.removeEventListener("mouseup",t)};document.addEventListener("mouseup",t)}})})},1278:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var n=r(97109);let o=(...e)=>e.filter((e,t,r)=>!!e&&r.indexOf(e)===t).join(" ");var a={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let i=(0,n.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:i,className:l="",children:s,iconNode:c,...u},d)=>(0,n.createElement)("svg",{ref:d,...a,width:t,height:t,stroke:e,strokeWidth:i?24*Number(r)/Number(t):r,className:o("lucide",l),...u},[...c.map(([e,t])=>(0,n.createElement)(e,t)),...Array.isArray(s)?s:[s]])),l=(e,t)=>{let r=(0,n.forwardRef)(({className:r,...a},l)=>(0,n.createElement)(i,{ref:l,iconNode:t,className:o(`lucide-${e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,r),...a}));return r.displayName=`${e}`,r}},2819:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>s,OX:()=>i});var n,o=r(97109);let a=0;function i(e,t){let r=String(t).replace(/[^a-zA-Z0-9_.:-]/g,"-");return`${e}-${r}`}let l={...n||(n=r.t(o,2))}.useId,s=l?function(e){let t=l();return e||t}:function(e){let[t,r]=o.useState("ssr-id");return(o.useEffect(()=>{let e=a;a+=1,r(`rc_unique_${e}`)},[]),e)?e:t}},3396:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},3454:(e,t,r)=>{e.exports=r(64041)},3515:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>l});var n=r(65321),o=r(3454),a=r.n(o),i=r(39507);function l(e){let{Component:t,pageProps:r}=e;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(a(),{children:[(0,n.jsx)("link",{rel:"icon",type:"image/svg+xml",href:"/favicon.svg"}),(0,n.jsx)("link",{rel:"icon",href:"/favicon.ico",sizes:"any"}),(0,n.jsx)("link",{rel:"apple-touch-icon",href:"/apple-touch-icon.png"})]}),(0,n.jsx)(i.PE,{children:(0,n.jsx)(t,{...r})})]})}r(46430),r(10090)},3638:(e,t,r)=>{"use strict";function n(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=function e(t){var r,n,o="";if("string"==typeof t||"number"==typeof t)o+=t;else if("object"==typeof t)if(Array.isArray(t)){var a=t.length;for(r=0;r<a;r++)t[r]&&(n=e(t[r]))&&(o&&(o+=" "),o+=n)}else for(n in t)t[n]&&(o&&(o+=" "),o+=n);return o}(e))&&(n&&(n+=" "),n+=t);return n}r.d(t,{$:()=>n,A:()=>o});let o=n},4034:(e,t,r)=>{"use strict";r.d(t,{L:()=>o,v:()=>a});var n=r(3638);let o=(e,t,r)=>(0,n.$)({[`${e}-status-success`]:"success"===t,[`${e}-status-warning`]:"warning"===t,[`${e}-status-error`]:"error"===t,[`${e}-status-validating`]:"validating"===t,[`${e}-has-feedback`]:r}),a=(e,t)=>t||e},4097:(e,t,r)=>{"use strict";r.d(t,{b:()=>o});var n=r(26047);let o=e=>(0,n.AZ)(e)?(0,n.Tn)(e)?e():e:null},4216:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var n=r(97109),o=r(28520),a=r(88483);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}let l=n.forwardRef((e,t)=>n.createElement(a.A,i({},e,{ref:t,icon:o.A})))},4932:(e,t,r)=>{"use strict";let n;r.d(t,{D0:()=>Y,_z:()=>s,Op:()=>eo,B8:()=>Q,EF:()=>c,Ay:()=>ec,mN:()=>er,FH:()=>el});var o=r(97109),a=r(42644);let i="RC_FORM_INTERNAL_HOOKS",l=()=>{(0,a.$e)(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},s=o.createContext({getFieldValue:l,getFieldsValue:l,getFieldError:l,getFieldWarning:l,getFieldsError:l,isFieldsTouched:l,isFieldTouched:l,isFieldValidating:l,isFieldsValidating:l,resetFields:l,setFields:l,setFieldValue:l,setFieldsValue:l,validateFields:l,submit:l,getInternalHooks:()=>(l(),{dispatch:l,initEntityValue:l,registerField:l,useSubscribe:l,setInitialValues:l,destroyForm:l,setCallbacks:l,registerWatch:l,getFields:l,setValidateMessages:l,setPreserve:l,getInitialValue:l})}),c=o.createContext(null);function u(e){return null==e?[]:Array.isArray(e)?e:[e]}function d(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",tel:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone(){let e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}let f=d();var p=r(55182);let m=/%[sdj%]/g,h=()=>{};function g(e){if(!e||!e.length)return null;let t={};return e.forEach(e=>{let r=e.field;t[r]=t[r]||[],t[r].push(e)}),t}function b(e,...t){let r=0,n=t.length;return"function"==typeof e?e.apply(null,t):"string"==typeof e?e.replace(m,e=>{if("%%"===e)return"%";if(r>=n)return e;switch(e){case"%s":return String(t[r++]);case"%d":return Number(t[r++]);case"%j":try{return JSON.stringify(t[r++])}catch(e){return"[Circular]"}default:return e}}):e}function y(e,t){return!!(null==e||"array"===t&&Array.isArray(e)&&!e.length)||("string"===t||"url"===t||"hex"===t||"email"===t||"date"===t||"pattern"===t||"tel"===t)&&"string"==typeof e&&!e||!1}function v(e,t,r){let n=0,o=e.length;!function a(i){if(i&&i.length)return void r(i);let l=n;n+=1,l<o?t(e[l],a):r([])}([])}void 0!==p&&p.env;class x extends Error{errors;fields;constructor(e,t){super("Async Validation Error"),this.errors=e,this.fields=t}}function $(e,t){return r=>{let n;return(n=e.fullFields?function(e,t){let r=e;for(let e=0;e<t.length&&void 0!=r;e++)r=r[t[e]];return r}(t,e.fullFields):t[r.field||e.fullField],r&&void 0!==r.message)?(r.field=r.field||e.fullField,r.fieldValue=n,r):{message:"function"==typeof r?r():r,fieldValue:n,field:r.field||e.fullField}}}function w(e,t){if(t){for(let r in t)if(t.hasOwnProperty(r)){let n=t[r];"object"==typeof n&&"object"==typeof e[r]?e[r]={...e[r],...n}:e[r]=n}}return e}let C="enum",E=(e,t,r,n,o,a)=>{e.required&&(!r.hasOwnProperty(e.field)||y(t,a||e.type))&&n.push(b(o.messages.required,e.fullField))},k={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,tel:/^(\+[0-9]{1,3}[-\s\u2011]?)?(\([0-9]{1,4}\)[-\s\u2011]?)?([0-9]+[-\s\u2011]?)*[0-9]+$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},S={integer:e=>S.number(e)&&parseInt(e,10)===e,float:e=>S.number(e)&&!S.integer(e),array:e=>Array.isArray(e),regexp(e){if(e instanceof RegExp)return!0;try{return new RegExp(e),!0}catch(e){return!1}},date:e=>"function"==typeof e.getTime&&"function"==typeof e.getMonth&&"function"==typeof e.getYear&&!isNaN(e.getTime()),number:e=>!isNaN(e)&&"number"==typeof e,object:e=>"object"==typeof e&&!S.array(e),method:e=>"function"==typeof e,email:e=>"string"==typeof e&&e.length<=320&&!!e.match(k.email),tel:e=>"string"==typeof e&&e.length<=32&&!!e.match(k.tel),url:e=>"string"==typeof e&&e.length<=2048&&!!e.match((()=>{if(n)return n;let e="[a-fA-F\\d:]",t=t=>t&&t.includeBoundaries?`(?:(?<=\\s|^)(?=${e})|(?<=${e})(?=\\s|$))`:"",r="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",o="[a-fA-F\\d]{1,4}",a=[`(?:${o}:){7}(?:${o}|:)`,`(?:${o}:){6}(?:${r}|:${o}|:)`,`(?:${o}:){5}(?::${r}|(?::${o}){1,2}|:)`,`(?:${o}:){4}(?:(?::${o}){0,1}:${r}|(?::${o}){1,3}|:)`,`(?:${o}:){3}(?:(?::${o}){0,2}:${r}|(?::${o}){1,4}|:)`,`(?:${o}:){2}(?:(?::${o}){0,3}:${r}|(?::${o}){1,5}|:)`,`(?:${o}:){1}(?:(?::${o}){0,4}:${r}|(?::${o}){1,6}|:)`,`(?::(?:(?::${o}){0,5}:${r}|(?::${o}){1,7}|:))`],i=`(?:${a.join("|")})(?:%[0-9a-zA-Z]{1,})?`,l=RegExp(`(?:^${r}$)|(?:^${i}$)`),s=RegExp(`^${r}$`),c=RegExp(`^${i}$`),u=e=>e&&e.exact?l:RegExp(`(?:${t(e)}${r}${t(e)})|(?:${t(e)}${i}${t(e)})`,"g");u.v4=e=>e&&e.exact?s:RegExp(`${t(e)}${r}${t(e)}`,"g"),u.v6=e=>e&&e.exact?c:RegExp(`${t(e)}${i}${t(e)}`,"g");let d=u.v4().source,f=u.v6().source,p=`(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))`,m=`(?:(?:(?:[a-z]+:)?//)|www\\.)(?:\\S+(?::\\S*)?@)?(?:localhost|${d}|${f}|(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*${p})(?::\\d{2,5})?(?:[/?#][^\\s"]*)?`;return n=RegExp(`(?:^${m}$)`,"i")})()),hex:e=>"string"==typeof e&&!!e.match(k.hex)},A={required:E,whitespace:(e,t,r,n,o)=>{(/^\s+$/.test(t)||""===t)&&n.push(b(o.messages.whitespace,e.fullField))},type:(e,t,r,n,o)=>{if(e.required&&void 0===t)return void E(e,t,r,n,o);let a=e.type;["integer","float","array","regexp","object","method","email","tel","number","date","url","hex"].indexOf(a)>-1?S[a](t)||n.push(b(o.messages.types[a],e.fullField,e.type)):a&&typeof t!==e.type&&n.push(b(o.messages.types[a],e.fullField,e.type))},range:(e,t,r,n,o)=>{let a="number"==typeof e.len,i="number"==typeof e.min,l="number"==typeof e.max,s=t,c=null,u="number"==typeof t,d="string"==typeof t,f=Array.isArray(t);if(u?c="number":d?c="string":f&&(c="array"),!c)return!1;f&&(s=t.length),d&&(s=t.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length),a?s!==e.len&&n.push(b(o.messages[c].len,e.fullField,e.len)):i&&!l&&s<e.min?n.push(b(o.messages[c].min,e.fullField,e.min)):l&&!i&&s>e.max?n.push(b(o.messages[c].max,e.fullField,e.max)):i&&l&&(s<e.min||s>e.max)&&n.push(b(o.messages[c].range,e.fullField,e.min,e.max))},enum:(e,t,r,n,o)=>{e[C]=Array.isArray(e[C])?e[C]:[],-1===e[C].indexOf(t)&&n.push(b(o.messages[C],e.fullField,e[C].join(", ")))},pattern:(e,t,r,n,o)=>{e.pattern&&(e.pattern instanceof RegExp?(e.pattern.lastIndex=0,e.pattern.test(t)||n.push(b(o.messages.pattern.mismatch,e.fullField,t,e.pattern))):"string"==typeof e.pattern&&(new RegExp(e.pattern).test(t)||n.push(b(o.messages.pattern.mismatch,e.fullField,t,e.pattern))))}},P=(e,t,r,n,o)=>{let a=e.type,i=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(y(t,a)&&!e.required)return r();A.required(e,t,n,i,o,a),y(t,a)||A.type(e,t,n,i,o)}r(i)},R={string:(e,t,r,n,o)=>{let a=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(y(t,"string")&&!e.required)return r();A.required(e,t,n,a,o,"string"),y(t,"string")||(A.type(e,t,n,a,o),A.range(e,t,n,a,o),A.pattern(e,t,n,a,o),!0===e.whitespace&&A.whitespace(e,t,n,a,o))}r(a)},method:(e,t,r,n,o)=>{let a=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(y(t)&&!e.required)return r();A.required(e,t,n,a,o),void 0!==t&&A.type(e,t,n,a,o)}r(a)},number:(e,t,r,n,o)=>{let a=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(""===t&&(t=void 0),y(t)&&!e.required)return r();A.required(e,t,n,a,o),void 0!==t&&(A.type(e,t,n,a,o),A.range(e,t,n,a,o))}r(a)},boolean:(e,t,r,n,o)=>{let a=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(y(t)&&!e.required)return r();A.required(e,t,n,a,o),void 0!==t&&A.type(e,t,n,a,o)}r(a)},regexp:(e,t,r,n,o)=>{let a=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(y(t)&&!e.required)return r();A.required(e,t,n,a,o),y(t)||A.type(e,t,n,a,o)}r(a)},integer:(e,t,r,n,o)=>{let a=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(y(t)&&!e.required)return r();A.required(e,t,n,a,o),void 0!==t&&(A.type(e,t,n,a,o),A.range(e,t,n,a,o))}r(a)},float:(e,t,r,n,o)=>{let a=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(y(t)&&!e.required)return r();A.required(e,t,n,a,o),void 0!==t&&(A.type(e,t,n,a,o),A.range(e,t,n,a,o))}r(a)},array:(e,t,r,n,o)=>{let a=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(null==t&&!e.required)return r();A.required(e,t,n,a,o,"array"),null!=t&&(A.type(e,t,n,a,o),A.range(e,t,n,a,o))}r(a)},object:(e,t,r,n,o)=>{let a=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(y(t)&&!e.required)return r();A.required(e,t,n,a,o),void 0!==t&&A.type(e,t,n,a,o)}r(a)},enum:(e,t,r,n,o)=>{let a=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(y(t)&&!e.required)return r();A.required(e,t,n,a,o),void 0!==t&&A.enum(e,t,n,a,o)}r(a)},pattern:(e,t,r,n,o)=>{let a=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(y(t,"string")&&!e.required)return r();A.required(e,t,n,a,o),y(t,"string")||A.pattern(e,t,n,a,o)}r(a)},date:(e,t,r,n,o)=>{let a=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(y(t,"date")&&!e.required)return r();if(A.required(e,t,n,a,o),!y(t,"date")){let r;r=t instanceof Date?t:new Date(t),A.type(e,r,n,a,o),r&&A.range(e,r.getTime(),n,a,o)}}r(a)},url:P,hex:P,email:P,tel:P,required:(e,t,r,n,o)=>{let a=[],i=Array.isArray(t)?"array":typeof t;A.required(e,t,n,a,o,i),r(a)},any:(e,t,r,n,o)=>{let a=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(y(t)&&!e.required)return r();A.required(e,t,n,a,o)}r(a)}};class M{static register=function(e,t){if("function"!=typeof t)throw Error("Cannot register a validator by type, validator is not a function");R[e]=t};static warning=h;static messages=f;static validators=R;rules=null;_messages=f;constructor(e){this.define(e)}define(e){if(!e)throw Error("Cannot configure a schema with no rules");if("object"!=typeof e||Array.isArray(e))throw Error("Rules must be an object");this.rules={},Object.keys(e).forEach(t=>{let r=e[t];this.rules[t]=Array.isArray(r)?r:[r]})}messages(e){return e&&(this._messages=w(d(),e)),this._messages}validate(e,t={},r=()=>{}){let n=e,o=t,a=r;if("function"==typeof o&&(a=o,o={}),!this.rules||0===Object.keys(this.rules).length)return a&&a(null,n),Promise.resolve(n);if(o.messages){let e=this.messages();e===f&&(e=d()),w(e,o.messages),o.messages=e}else o.messages=this.messages();let i={};(o.keys||Object.keys(this.rules)).forEach(t=>{let r=this.rules[t],o=n[t];r.forEach(r=>{let a=r;"function"==typeof a.transform&&(n===e&&(n={...n}),null!=(o=n[t]=a.transform(o))&&(a.type=a.type||(Array.isArray(o)?"array":typeof o))),(a="function"==typeof a?{validator:a}:{...a}).validator=this.getValidationMethod(a),a.validator&&(a.field=t,a.fullField=a.fullField||t,a.type=this.getType(a),i[t]=i[t]||[],i[t].push({rule:a,value:o,source:n,field:t}))})});let l={};return function(e,t,r,n,o){if(t.first){let t=new Promise((t,a)=>{v(function(e){let t=[];return Object.keys(e).forEach(r=>{t.push(...e[r]||[])}),t}(e),r,e=>(n(e),e.length?a(new x(e,g(e))):t(o)))});return t.catch(e=>e),t}let a=!0===t.firstFields?Object.keys(e):t.firstFields||[],i=Object.keys(e),l=i.length,s=0,c=[],u=new Promise((t,u)=>{let d=e=>{if(c.push.apply(c,e),++s===l)return n(c),c.length?u(new x(c,g(c))):t(o)};i.length||(n(c),t(o)),i.forEach(t=>{let n=e[t];if(-1!==a.indexOf(t))v(n,r,d);else{let e=[],t=0,a=n.length;function o(r){e.push(...r||[]),++t===a&&d(e)}n.forEach(e=>{r(e,o)})}})});return u.catch(e=>e),u}(i,o,(e,t)=>{let r,a=e.rule,i=("object"===a.type||"array"===a.type)&&("object"==typeof a.fields||"object"==typeof a.defaultField);function s(e,t){return{...t,fullField:`${a.fullField}.${e}`,fullFields:a.fullFields?[...a.fullFields,e]:[e]}}function c(r=[]){let u=Array.isArray(r)?r:[r];!o.suppressWarning&&u.length&&M.warning("async-validator:",u),u.length&&void 0!==a.message&&null!==a.message&&(u=[].concat(a.message));let d=u.map($(a,n));if(o.first&&d.length)return l[a.field]=1,t(d);if(i){if(a.required&&!e.value)return void 0!==a.message?d=[].concat(a.message).map($(a,n)):o.error&&(d=[o.error(a,b(o.messages.required,a.field))]),t(d);let r={};a.defaultField&&Object.keys(e.value).map(e=>{r[e]=a.defaultField});let i={};Object.keys(r={...r,...e.rule.fields}).forEach(e=>{let t=r[e],n=Array.isArray(t)?t:[t];i[e]=n.map(s.bind(null,e))});let l=new M(i);l.messages(o.messages),e.rule.options&&(e.rule.options.messages=o.messages,e.rule.options.error=o.error),l.validate(e.value,e.rule.options||o,e=>{let r=[];d&&d.length&&r.push(...d),e&&e.length&&r.push(...e),t(r.length?r:null)})}else t(d)}if(i=i&&(a.required||!a.required&&e.value),a.field=e.field,a.asyncValidator)r=a.asyncValidator(a,e.value,c,e.source,o);else if(a.validator){try{r=a.validator(a,e.value,c,e.source,o)}catch(e){console.error?.(e),o.suppressValidatorError||setTimeout(()=>{throw e},0),c(e.message)}!0===r?c():!1===r?c("function"==typeof a.message?a.message(a.fullField||a.field):a.message||`${a.fullField||a.field} fails`):r instanceof Array?c(r):r instanceof Error&&c(r.message)}r&&r.then&&r.then(()=>c(),e=>c(e))},e=>{var t;let r=[],o={};for(let n=0;n<e.length;n++)Array.isArray(t=e[n])?r=r.concat(...t):r.push(t);r.length?(o=g(r),a(r,o)):a(null,n)},n)}getType(e){if(void 0===e.type&&e.pattern instanceof RegExp&&(e.type="pattern"),"function"!=typeof e.validator&&e.type&&!R.hasOwnProperty(e.type))throw Error(b("Unknown rule type %s",e.type));return e.type||"string"}getValidationMethod(e){if("function"==typeof e.validator)return e.validator;let t=Object.keys(e),r=t.indexOf("message");return(-1!==r&&t.splice(r,1),1===t.length&&"required"===t[0])?R.required:R[this.getType(e)]||void 0}}let T="'${name}' is not a valid ${type}",O={default:"Validation error on field '${name}'",required:"'${name}' is required",enum:"'${name}' must be one of [${enum}]",whitespace:"'${name}' cannot be empty",date:{format:"'${name}' is invalid for format date",parse:"'${name}' could not be parsed as date",invalid:"'${name}' is invalid date"},types:{string:T,method:T,array:T,object:T,number:T,date:T,boolean:T,integer:T,float:T,regexp:T,email:T,tel:T,url:T,hex:T},string:{len:"'${name}' must be exactly ${len} characters",min:"'${name}' must be at least ${min} characters",max:"'${name}' cannot be longer than ${max} characters",range:"'${name}' must be between ${min} and ${max} characters"},number:{len:"'${name}' must equal ${len}",min:"'${name}' cannot be less than ${min}",max:"'${name}' cannot be greater than ${max}",range:"'${name}' must be between ${min} and ${max}"},array:{len:"'${name}' must be exactly ${len} in length",min:"'${name}' cannot be less than ${min} in length",max:"'${name}' cannot be greater than ${max} in length",range:"'${name}' must be between ${min} and ${max} in length"},pattern:{mismatch:"'${name}' does not match pattern ${pattern}"}},N="CODE_LOGIC_ERROR";async function F(e,t,r,n,i){let l={...r};if(delete l.ruleIndex,M.warning=()=>void 0,l.validator){let e=l.validator;l.validator=(...t)=>{try{return e(...t)}catch(e){return console.error(e),Promise.reject(N)}}}let s=null;l&&"array"===l.type&&l.defaultField&&(s=l.defaultField,delete l.defaultField);let c=new M({[e]:[l]}),u=(0,a.h1)(O,n.validateMessages);c.messages(u);let d=[];try{await Promise.resolve(c.validate({[e]:t},{...n}))}catch(e){e.errors&&(d=e.errors.map(({message:e},t)=>{let r=e===N?u.default:e;return o.isValidElement(r)?o.cloneElement(r,{key:`error_${t}`}):r}))}if(!d.length&&s&&Array.isArray(t)&&t.length>0)return(await Promise.all(t.map((t,r)=>F(`${e}.${r}`,t,s,n,i)))).reduce((e,t)=>[...e,...t],[]);let f={...r,name:e,enum:(r.enum||[]).join(", "),...i};return d.map(e=>{if("string"==typeof e)return e.replace(/\\?\$\{\w+\}/g,e=>e.startsWith("\\")?e.slice(1):f[e.slice(2,-1)]);return e})}async function j(e){return Promise.all(e).then(e=>[].concat(...e))}async function I(e){let t=0;return new Promise(r=>{e.forEach(n=>{n.then(n=>{n.errors.length&&r([n]),(t+=1)===e.length&&r([])})})})}function z(e){return u(e)}function B(e,t){let r={};return t.forEach(t=>{let n=(0,a.Jt)(e,t);r=(0,a.hZ)(r,t,n)}),r}function L(e,t,r=!1){return e&&e.some(e=>D(t,e,r))}function D(e,t,r=!1){return!!e&&!!t&&(!!r||e.length===t.length)&&t.every((t,r)=>e[r]===t)}function _(e,t,r){let{length:n}=e;if(t<0||t>=n||r<0||r>=n)return e;let o=e[t],a=t-r;return a>0?[...e.slice(0,r),o,...e.slice(r,t),...e.slice(t+1,n)]:a<0?[...e.slice(0,t),...e.slice(t+1,r+1),o,...e.slice(r+1,n)]:e}let H=e=>{let t=new MessageChannel;t.port1.onmessage=e,t.port2.postMessage(null)};class W{namePathList=[];taskId=0;watcherList=new Set;form;constructor(e){this.form=e}register(e){return this.watcherList.add(e),()=>{this.watcherList.delete(e)}}notify(e){e.forEach(e=>{this.namePathList.every(t=>!D(t,e))&&this.namePathList.push(e)}),this.doBatch()}doBatch(){this.taskId+=1;let e=this.taskId;H(()=>{if(e===this.taskId&&this.watcherList.size){let e=this.form.getForm(),t=e.getFieldsValue(),r=e.getFieldsValue(!0);this.watcherList.forEach(e=>{e(t,r,this.namePathList)}),this.namePathList=[]}})}}async function q(){return new Promise(e=>{H(()=>{(0,a.er)(()=>{e()})})})}function U(){return(U=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}let V=[],X=[];function G(e,t,r,n,o,a){return"function"==typeof e?e(t,r,"source"in a?{source:a.source}:{}):n!==o}class K extends o.PureComponent{static contextType=s;state={resetCount:0};cancelRegisterFunc=null;mounted=!1;touched=!1;dirty=!1;validatePromise;prevValidating;errors=V;warnings=X;constructor(e){if(super(e),e.fieldContext){let{getInternalHooks:t}=e.fieldContext,{initEntityValue:r}=t(i);r(this)}}componentDidMount(){let{shouldUpdate:e,fieldContext:t}=this.props;if(this.mounted=!0,t){let{getInternalHooks:e}=t,{registerField:r}=e(i);this.cancelRegisterFunc=r(this)}!0===e&&this.reRender()}componentWillUnmount(){this.cancelRegister(),this.triggerMetaEvent(!0),this.mounted=!1}cancelRegister=()=>{let{preserve:e,isListField:t,name:r}=this.props;this.cancelRegisterFunc&&this.cancelRegisterFunc(t,e,z(r)),this.cancelRegisterFunc=null};getNamePath=()=>{let{name:e,fieldContext:t}=this.props,{prefixName:r=[]}=t;return void 0!==e?[...r,...e]:[]};getRules=()=>{let{rules:e=[],fieldContext:t}=this.props;return e.map(e=>"function"==typeof e?e(t):e)};reRender(){this.mounted&&this.forceUpdate()}refresh=()=>{this.mounted&&this.setState(({resetCount:e})=>({resetCount:e+1}))};metaCache=null;triggerMetaEvent=e=>{let{onMetaChange:t}=this.props;if(t){let r={...this.getMeta(),destroy:e};(0,a.n4)(this.metaCache,r)||t(r),this.metaCache=r}else this.metaCache=null};onStoreChange=(e,t,r)=>{let{shouldUpdate:n,dependencies:o=[],onReset:i}=this.props,{store:l}=r,s=this.getNamePath(),c=this.getValue(e),u=this.getValue(l),d=t&&L(t,s);switch("valueUpdate"===r.type&&"external"===r.source&&!(0,a.n4)(c,u)&&(this.touched=!0,this.dirty=!0,this.validatePromise=null,this.errors=V,this.warnings=X,this.triggerMetaEvent()),r.type){case"reset":if(!t||d){this.touched=!1,this.dirty=!1,this.validatePromise=void 0,this.errors=V,this.warnings=X,this.triggerMetaEvent(),i?.(),this.refresh();return}break;case"remove":if(n&&G(n,e,l,c,u,r))return void this.reRender();break;case"setField":{let{data:o}=r;if(d){"touched"in o&&(this.touched=o.touched),"validating"in o&&!("originRCField"in o)&&(this.validatePromise=o.validating?Promise.resolve([]):null),"errors"in o&&(this.errors=o.errors||V),"warnings"in o&&(this.warnings=o.warnings||X),this.dirty=!0,this.triggerMetaEvent(),this.reRender();return}if("value"in o&&L(t,s,!0)||n&&!s.length&&G(n,e,l,c,u,r))return void this.reRender();break}case"dependenciesUpdate":if(o.map(z).some(e=>L(r.relatedFields,e)))return void this.reRender();break;default:if(d||(!o.length||s.length||n)&&G(n,e,l,c,u,r))return void this.reRender()}!0===n&&this.reRender()};validateRules=e=>{let t=this.getNamePath(),r=this.getValue(),{triggerName:n,validateOnly:o=!1,delayFrame:i}=e||{},l=Promise.resolve().then(async()=>{if(!this.mounted)return[];let{validateFirst:o=!1,messageVariables:s,validateDebounce:c}=this.props;i&&await q();let d=this.getRules();if(n&&(d=d.filter(e=>e).filter(e=>{let{validateTrigger:t}=e;return!t||u(t).includes(n)})),c&&n&&(await new Promise(e=>{setTimeout(e,c)}),this.validatePromise!==l))return[];let f=function(e,t,r,n,o,i){let l,s=e.join("."),c=r.map((e,t)=>{let r=e.validator,n={...e,ruleIndex:t};return r&&(n.validator=(e,t,n)=>{let o=!1,i=r(e,t,(...e)=>{Promise.resolve().then(()=>{(0,a.$e)(!o,"Your validator function has already return a promise. `callback` will be ignored."),o||n(...e)})});o=i&&"function"==typeof i.then&&"function"==typeof i.catch,(0,a.$e)(o,"`callback` is deprecated. Please return a promise instead."),o&&i.then(()=>{n()}).catch(e=>{n(e||" ")})}),n}).sort(({warningOnly:e,ruleIndex:t},{warningOnly:r,ruleIndex:n})=>!!e==!!r?t-n:e?1:-1);if(!0===o)l=new Promise(async(e,r)=>{for(let e=0;e<c.length;e+=1){let o=c[e],a=await F(s,t,o,n,i);if(a.length)return void r([{errors:a,rule:o}])}e([])});else{let e=c.map(e=>F(s,t,e,n,i).then(t=>({errors:t,rule:e})));l=(o?I(e):j(e)).then(e=>Promise.reject(e))}return l.catch(e=>e),l}(t,r,d,e,o,s);return f.catch(e=>e).then((e=V)=>{if(this.validatePromise===l){this.validatePromise=null;let t=[],r=[];e.forEach?.(({rule:{warningOnly:e},errors:n=V})=>{e?r.push(...n):t.push(...n)}),this.errors=t,this.warnings=r,this.triggerMetaEvent(),this.reRender()}}),f});return o||(this.validatePromise=l,this.dirty=!0,this.errors=V,this.warnings=X,this.triggerMetaEvent(),this.reRender()),l};isFieldValidating=()=>!!this.validatePromise;isFieldTouched=()=>this.touched;isFieldDirty=()=>{if(this.dirty||void 0!==this.props.initialValue)return!0;let{fieldContext:e}=this.props,{getInitialValue:t}=e.getInternalHooks(i);return void 0!==t(this.getNamePath())};getErrors=()=>this.errors;getWarnings=()=>this.warnings;isListField=()=>this.props.isListField;isList=()=>this.props.isList;isPreserve=()=>this.props.preserve;getMeta=()=>(this.prevValidating=this.isFieldValidating(),{touched:this.isFieldTouched(),validating:this.prevValidating,errors:this.errors,warnings:this.warnings,name:this.getNamePath(),validated:null===this.validatePromise});getOnlyChild=e=>{if("function"==typeof e){let t=this.getMeta();return{...this.getOnlyChild(e(this.getControlled(),t,this.props.fieldContext)),isFunction:!0}}let t=(0,a.$r)(e);return 1===t.length&&o.isValidElement(t[0])?{child:t[0],isFunction:!1}:{child:t,isFunction:!1}};getValue=e=>{let{getFieldsValue:t}=this.props.fieldContext,r=this.getNamePath();return(0,a.Jt)(e||t(!0),r)};getControlled=(e={})=>{let{name:t,trigger:r="onChange",validateTrigger:n,getValueFromEvent:o,normalize:a,valuePropName:l="value",getValueProps:s,fieldContext:c}=this.props,d=void 0!==n?n:c.validateTrigger,f=this.getNamePath(),{getInternalHooks:p,getFieldsValue:m}=c,{dispatch:h}=p(i),g=this.getValue(),b=s||(e=>({[l]:e})),y=e[r],v=void 0!==t?b(g):{},x={...e,...v};return x[r]=(...e)=>{let t;this.touched=!0,this.dirty=!0,this.triggerMetaEvent(),t=o?o(...e):function(e,...t){let r=t[0];return r&&r.target&&"object"==typeof r.target&&e in r.target?r.target[e]:r}(l,...e),a&&(t=a(t,g,m(!0))),t!==g&&h({type:"updateValue",namePath:f,value:t}),y&&y(...e)},u(d||[]).forEach(e=>{let t=x[e];x[e]=(...r)=>{t&&t(...r);let{rules:n}=this.props;n&&n.length&&h({type:"validateField",namePath:f,triggerName:e})}}),x};render(){let e,{resetCount:t}=this.state,{children:r}=this.props,{child:n,isFunction:i}=this.getOnlyChild(r);return i?e=n:o.isValidElement(n)?e=o.cloneElement(n,this.getControlled(n.props)):((0,a.$e)(!n,"`children` of Field is not validate ReactElement."),e=n),o.createElement(o.Fragment,{key:t},e)}}let Y=function({name:e,...t}){let r=o.useContext(s),n=o.useContext(c),a=void 0!==e?z(e):void 0,i=t.isListField??!!n,l="keep";return i||(l=`_${(a||[]).join("_")}`),o.createElement(K,U({key:l,name:a,isListField:i},t,{fieldContext:r}))},Q=function({name:e,initialValue:t,children:r,rules:n,validateTrigger:i,isListField:l}){let u=o.useContext(s),d=o.useContext(c),f=o.useRef({keys:[],id:0}).current,p=o.useMemo(()=>[...z(u.prefixName)||[],...z(e)],[u.prefixName,e]),m=o.useMemo(()=>({...u,prefixName:p}),[u,p]),h=o.useMemo(()=>({getKey:e=>{let t=p.length,r=e[t];return[f.keys[r],e.slice(t+1)]}}),[f,p]);return"function"!=typeof r?((0,a.$e)(!1,"Form.List only accepts function as children."),null):o.createElement(c.Provider,{value:h},o.createElement(s.Provider,{value:m},o.createElement(Y,{name:[],shouldUpdate:(e,t,{source:r})=>"internal"!==r&&e!==t,rules:n,validateTrigger:i,initialValue:t,isList:!0,isListField:l??!!d},({value:e=[],onChange:t},n)=>{let{getFieldValue:o}=u,a=()=>o(p||[])||[],i=e||[];return Array.isArray(i)||(i=[]),r(i.map((e,t)=>{let r=f.keys[t];return void 0===r&&(f.keys[t]=f.id,r=f.keys[t],f.id+=1),{name:t,key:r,isListField:!0}}),{add:(e,r)=>{let n=a();r>=0&&r<=n.length?(f.keys=[...f.keys.slice(0,r),f.id,...f.keys.slice(r)],t([...n.slice(0,r),e,...n.slice(r)])):(f.keys=[...f.keys,f.id],t([...n,e])),f.id+=1},remove:e=>{let r=a(),n=new Set(Array.isArray(e)?e:[e]);n.size<=0||(f.keys=f.keys.filter((e,t)=>!n.has(t)),t(r.filter((e,t)=>!n.has(t))))},move(e,r){if(e===r)return;let n=a();e<0||e>=n.length||r<0||r>=n.length||(f.keys=_(f.keys,e,r),t(_(n,e,r)))}},n)})))},Z="__@field_split__";function J(e){return e.map(e=>`${typeof e}:${e}`).join(Z)}class ee{kvs=new Map;set(e,t){this.kvs.set(J(e),t)}get(e){return this.kvs.get(J(e))}getAsPrefix(e){let t=J(e),r=t+Z,n=[],o=this.kvs.get(t);return void 0!==o&&n.push(o),this.kvs.forEach((e,t)=>{t.startsWith(r)&&n.push(e)}),n}update(e,t){let r=t(this.get(e));r?this.set(e,r):this.delete(e)}delete(e){this.kvs.delete(J(e))}map(e){return[...this.kvs.entries()].map(([t,r])=>e({key:t.split(Z).map(e=>{let[,t,r]=e.match(/^([^:]*):(.*)$/);return"number"===t?Number(r):r}),value:r}))}toJSON(){let e={};return this.map(({key:t,value:r})=>(e[t.join(".")]=r,null)),e}}class et{formHooked=!1;forceRootUpdate;subscribable=!0;store={};fieldEntities=[];initialValues={};callbacks={};validateMessages=null;preserve=null;lastValidatePromise=null;watcherCenter=new W(this);constructor(e){this.forceRootUpdate=e}getForm=()=>({getFieldValue:this.getFieldValue,getFieldsValue:this.getFieldsValue,getFieldError:this.getFieldError,getFieldWarning:this.getFieldWarning,getFieldsError:this.getFieldsError,isFieldsTouched:this.isFieldsTouched,isFieldTouched:this.isFieldTouched,isFieldValidating:this.isFieldValidating,isFieldsValidating:this.isFieldsValidating,resetFields:this.resetFields,setFields:this.setFields,setFieldValue:this.setFieldValue,setFieldsValue:this.setFieldsValue,validateFields:this.validateFields,submit:this.submit,_init:!0,getInternalHooks:this.getInternalHooks});getInternalHooks=e=>e===i?(this.formHooked=!0,{dispatch:this.dispatch,initEntityValue:this.initEntityValue,registerField:this.registerField,useSubscribe:this.useSubscribe,setInitialValues:this.setInitialValues,destroyForm:this.destroyForm,setCallbacks:this.setCallbacks,setValidateMessages:this.setValidateMessages,getFields:this.getFields,setPreserve:this.setPreserve,getInitialValue:this.getInitialValue,registerWatch:this.registerWatch}):((0,a.$e)(!1,"`getInternalHooks` is internal usage. Should not call directly."),null);useSubscribe=e=>{this.subscribable=e};prevWithoutPreserves=null;setInitialValues=(e,t)=>{if(this.initialValues=e||{},t){let t=(0,a.h1)(e,this.store);this.prevWithoutPreserves?.map(({key:r})=>{t=(0,a.hZ)(t,r,(0,a.Jt)(e,r))}),this.prevWithoutPreserves=null,this.updateStore(t)}};destroyForm=e=>{if(e)this.updateStore({});else{let e=new ee;this.getFieldEntities(!0).forEach(t=>{this.isMergedPreserve(t.isPreserve())||e.set(t.getNamePath(),!0)}),this.prevWithoutPreserves=e}};getInitialValue=e=>{let t=(0,a.Jt)(this.initialValues,e);return e.length?(0,a.h1)(t):t};setCallbacks=e=>{this.callbacks=e};setValidateMessages=e=>{this.validateMessages=e};setPreserve=e=>{this.preserve=e};registerWatch=e=>this.watcherCenter.register(e);notifyWatch=(e=[])=>{this.watcherCenter.notify(e)};timeoutId=null;warningUnhooked=()=>{};updateStore=e=>{this.store=e};getFieldEntities=(e=!1)=>e?this.fieldEntities.filter(e=>e.getNamePath().length):this.fieldEntities;getFieldsMap=(e=!1)=>{let t=new ee;return this.getFieldEntities(e).forEach(e=>{let r=e.getNamePath();t.set(r,e)}),t};getFieldEntitiesForNamePathList=(e,t=!1)=>{if(!e)return this.getFieldEntities(!0);let r=this.getFieldsMap(!0);return t?e.flatMap(e=>{let t=z(e),n=r.getAsPrefix(t);return n.length?n:[{INVALIDATE_NAME_PATH:t}]}):e.map(e=>{let t=z(e);return r.get(t)||{INVALIDATE_NAME_PATH:z(e)}})};getFieldsValue=(e,t)=>{let r,n;if(this.warningUnhooked(),!0===e||Array.isArray(e)?(r=e,n=t):e&&"object"==typeof e&&(n=e.filter),!0===r&&!n)return this.store;let o=this.getFieldEntitiesForNamePathList(Array.isArray(r)?r:null,!0),i=[],l=[];o.forEach(e=>{let t=e.INVALIDATE_NAME_PATH||e.getNamePath();if(e.isList?.())return void l.push(t);if(n){let r="getMeta"in e?e.getMeta():null;n(r)&&i.push(t)}else i.push(t)});let s=B(this.store,i.map(z));return l.forEach(e=>{(0,a.Jt)(s,e)||(s=(0,a.hZ)(s,e,[]))}),s};getFieldValue=e=>{this.warningUnhooked();let t=z(e);return(0,a.Jt)(this.store,t)};getFieldsError=e=>(this.warningUnhooked(),this.getFieldEntitiesForNamePathList(e).map((t,r)=>t&&!t.INVALIDATE_NAME_PATH?{name:t.getNamePath(),errors:t.getErrors(),warnings:t.getWarnings()}:{name:z(e[r]),errors:[],warnings:[]}));getFieldError=e=>{this.warningUnhooked();let t=z(e);return this.getFieldsError([t])[0].errors};getFieldWarning=e=>{this.warningUnhooked();let t=z(e);return this.getFieldsError([t])[0].warnings};isFieldsTouched=(...e)=>{let t;this.warningUnhooked();let[r,n]=e,o=!1;0===e.length?t=null:1===e.length?Array.isArray(r)?(t=r.map(z),o=!1):(t=null,o=r):(t=r.map(z),o=n);let a=this.getFieldEntities(!0),i=e=>e.isFieldTouched();if(!t)return o?a.every(e=>i(e)||e.isList()):a.some(i);let l=new ee;t.forEach(e=>{l.set(e,[])}),a.forEach(e=>{let r=e.getNamePath();t.forEach(t=>{t.every((e,t)=>r[t]===e)&&l.update(t,t=>[...t,e])})});let s=e=>e.some(i),c=l.map(({value:e})=>e);return o?c.every(s):c.some(s)};isFieldTouched=e=>(this.warningUnhooked(),this.isFieldsTouched([e]));isFieldsValidating=e=>{this.warningUnhooked();let t=this.getFieldEntities();if(!e)return t.some(e=>e.isFieldValidating());let r=e.map(z);return t.some(e=>L(r,e.getNamePath())&&e.isFieldValidating())};isFieldValidating=e=>(this.warningUnhooked(),this.isFieldsValidating([e]));resetWithFieldInitialValue=(e={})=>{let t,r=new ee,n=this.getFieldEntities(!0);n.forEach(e=>{let{initialValue:t}=e.props,n=e.getNamePath();if(void 0!==t){let o=r.get(n)||new Set;o.add({entity:e,value:t}),r.set(n,o)}});let o=t=>{t.forEach(t=>{let{initialValue:n}=t.props;if(void 0!==n){let n=t.getNamePath();if(void 0!==this.getInitialValue(n))(0,a.$e)(!1,`Form already set 'initialValues' with path '${n.join(".")}'. Field can not overwrite it.`);else{let o=r.get(n);if(o&&o.size>1)(0,a.$e)(!1,`Multiple Field with path '${n.join(".")}' set 'initialValue'. Can not decide which one to pick.`);else if(o){let r=this.getFieldValue(n);t.isListField()||e.skipExist&&void 0!==r||this.updateStore((0,a.hZ)(this.store,n,[...o][0].value))}}}})};e.entities?t=e.entities:e.namePathList?(t=[],e.namePathList.forEach(e=>{let n=r.get(e);n&&t.push(...[...n].map(e=>e.entity))})):t=n,o(t)};resetFields=e=>{this.warningUnhooked();let t=this.store;if(!e){this.updateStore((0,a.h1)(this.initialValues)),this.resetWithFieldInitialValue(),this.notifyObservers(t,null,{type:"reset"}),this.notifyWatch();return}let r=e.map(z);r.forEach(e=>{let t=this.getInitialValue(e);this.updateStore((0,a.hZ)(this.store,e,t))}),this.resetWithFieldInitialValue({namePathList:r}),this.notifyObservers(t,r,{type:"reset"}),this.notifyWatch(r)};setFields=e=>{this.warningUnhooked();let t=this.store,r=[];e.forEach(e=>{let{name:n,...o}=e,i=z(n);r.push(i),"value"in o&&this.updateStore((0,a.hZ)(this.store,i,o.value)),this.notifyObservers(t,[i],{type:"setField",data:e})}),this.notifyWatch(r)};getFields=()=>this.getFieldEntities(!0).map(e=>{let t=e.getNamePath(),r={...e.getMeta(),name:t,value:this.getFieldValue(t)};return Object.defineProperty(r,"originRCField",{value:!0}),r});initEntityValue=e=>{let{initialValue:t}=e.props;if(void 0!==t){let r=e.getNamePath();void 0===(0,a.Jt)(this.store,r)&&this.updateStore((0,a.hZ)(this.store,r,t))}};isMergedPreserve=e=>(void 0!==e?e:this.preserve)??!0;registerField=e=>{this.fieldEntities.push(e);let t=e.getNamePath();if(this.notifyWatch([t]),void 0!==e.props.initialValue){let t=this.store;this.resetWithFieldInitialValue({entities:[e],skipExist:!0}),this.notifyObservers(t,[e.getNamePath()],{type:"valueUpdate",source:"internal"})}return(r,n,o=[])=>{if(this.fieldEntities=this.fieldEntities.filter(t=>t!==e),!this.isMergedPreserve(n)&&(!r||o.length>1)){let e=r?void 0:this.getInitialValue(t);if(t.length&&this.getFieldValue(t)!==e&&this.fieldEntities.every(e=>!D(e.getNamePath(),t))){let r=this.store;this.updateStore((0,a.hZ)(r,t,e,!0)),this.notifyObservers(r,[t],{type:"remove"}),this.triggerDependenciesUpdate(r,t)}}this.notifyWatch([t])}};dispatch=e=>{switch(e.type){case"updateValue":{let{namePath:t,value:r}=e;this.updateValue(t,r);break}case"validateField":{let{namePath:t,triggerName:r}=e;this.validateFields([t],{triggerName:r})}}};notifyObservers=(e,t,r)=>{if(this.subscribable){let n={...r,store:this.getFieldsValue(!0)};this.getFieldEntities().forEach(({onStoreChange:r})=>{r(e,t,n)})}else this.forceRootUpdate()};triggerDependenciesUpdate=(e,t)=>{let r=this.getDependencyChildrenFields(t);return r.length&&this.validateFields(r,{delayFrame:!0}),this.notifyObservers(e,r,{type:"dependenciesUpdate",relatedFields:[t,...r]}),r};updateValue=(e,t)=>{let r=z(e),n=this.store;this.updateStore((0,a.hZ)(this.store,r,t)),this.notifyObservers(n,[r],{type:"valueUpdate",source:"internal"}),this.notifyWatch([r]);let o=this.triggerDependenciesUpdate(n,r),{onValuesChange:i}=this.callbacks;if(i){let e=B(this.store,[r]),t=this.getFieldsValue(),n=(0,a.hZ)(t,r,(0,a.Jt)(e,r));i(e,n)}this.triggerOnFieldsChange([r,...o])};setFieldsValue=e=>{this.warningUnhooked();let t=this.store;if(e){let t=(0,a.h1)(this.store,e);this.updateStore(t)}this.notifyObservers(t,null,{type:"valueUpdate",source:"external"}),this.notifyWatch()};setFieldValue=(e,t)=>{this.setFields([{name:e,value:t,errors:[],warnings:[],touched:!0}])};getDependencyChildrenFields=e=>{let t=new Set,r=[],n=new ee;this.getFieldEntities().forEach(e=>{let{dependencies:t}=e.props;(t||[]).forEach(t=>{let r=z(t);n.update(r,(t=new Set)=>(t.add(e),t))})});let o=e=>{(n.get(e)||new Set).forEach(e=>{if(!t.has(e)){t.add(e);let n=e.getNamePath();e.isFieldDirty()&&n.length&&(r.push(n),o(n))}})};return o(e),r};triggerOnFieldsChange=(e,t)=>{let{onFieldsChange:r}=this.callbacks;if(r){let n=this.getFields();if(t){let e=new ee;t.forEach(({name:t,errors:r})=>{e.set(t,r)}),n.forEach(t=>{t.errors=e.get(t.name)||t.errors})}let o=n.filter(({name:t})=>L(e,t));o.length&&r(o,n)}};validateFields=(e,t)=>{let r,n;this.warningUnhooked(),Array.isArray(e)||"string"==typeof e||"string"==typeof t?(r=e,n=t):n=e;let o=!!r,a=o?r.map(z):[],i=[...a],l=[],s=String(Date.now()),c=new Set,{recursive:u,dirty:d}=n||{};this.getFieldEntities(!0).forEach(e=>{let t=e.getNamePath();if((o||(e.isList()&&a.some(e=>D(e,t,!0))||i.push(t),a.push(t)),e.props.rules&&e.props.rules.length)&&(!d||e.isFieldDirty())&&(c.add(t.join(s)),!o||L(a,t,u))){let r=e.validateRules({validateMessages:{...O,...this.validateMessages},...n});l.push(r.then(()=>({name:t,errors:[],warnings:[]})).catch(e=>{let r=[],n=[];return(e.forEach?.(({rule:{warningOnly:e},errors:t})=>{e?n.push(...t):r.push(...t)}),r.length)?Promise.reject({name:t,errors:r,warnings:n}):{name:t,errors:r,warnings:n}}))}});let f=function(e){let t=!1,r=e.length,n=[];return e.length?new Promise((o,a)=>{e.forEach((e,i)=>{e.catch(e=>(t=!0,e)).then(e=>{r-=1,n[i]=e,r>0||(t&&a(n),o(n))})})}):Promise.resolve([])}(l);this.lastValidatePromise=f,f.catch(e=>e).then(e=>{let t=e.map(({name:e})=>e);this.notifyObservers(this.store,t,{type:"validateFinish"}),this.triggerOnFieldsChange(t,e)});let p=f.then(()=>this.lastValidatePromise===f?Promise.resolve(this.getFieldsValue(i)):Promise.reject([])).catch(e=>{let t=e.filter(e=>e&&e.errors.length);return Promise.reject({message:t[0]?.errors?.[0],values:this.getFieldsValue(a),errorFields:t,outOfDate:this.lastValidatePromise!==f})});p.catch(e=>e);let m=a.filter(e=>c.has(e.join(s)));return this.triggerOnFieldsChange(m),p};submit=()=>{this.warningUnhooked(),this.validateFields().then(e=>{let{onFinish:t}=this.callbacks;if(t)try{t(e)}catch(e){console.error(e)}}).catch(e=>{let{onFinishFailed:t}=this.callbacks;t&&t(e)})}}let er=function(e){let t=o.useRef(null),[,r]=o.useState({});return t.current||(e?t.current=e:t.current=new et(()=>{r({})}).getForm()),[t.current]},en=o.createContext({triggerFormChange:()=>{},triggerFormFinish:()=>{},registerForm:()=>{},unregisterForm:()=>{}}),eo=({validateMessages:e,onFormChange:t,onFormFinish:r,children:n})=>{let a=o.useContext(en),i=o.useRef({});return o.createElement(en.Provider,{value:{...a,validateMessages:{...a.validateMessages,...e},triggerFormChange:(e,r)=>{t&&t(e,{changedFields:r,forms:i.current}),a.triggerFormChange(e,r)},triggerFormFinish:(e,t)=>{r&&r(e,{values:t,forms:i.current}),a.triggerFormFinish(e,t)},registerForm:(e,t)=>{e&&(i.current={...i.current,[e]:t}),a.registerForm(e,t)},unregisterForm:e=>{let t={...i.current};delete t[e],i.current=t,a.unregisterForm(e)}}},n)};function ea(){return(ea=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function ei(e){try{return JSON.stringify(e)}catch{return Math.random()}}let el=function(...e){let[t,r={}]=e,n=r&&r._init?{form:r}:r,l=n.form,[c,u]=(0,o.useState)(()=>"function"==typeof t?t({}):void 0),d=(0,o.useMemo)(()=>ei(c),[c]);(0,o.useRef)(d).current=d;let f=(0,o.useContext)(s),p=l||f,m=p&&p._init,{getFieldsValue:h,getInternalHooks:g}=p,{registerWatch:b}=g(i),y=(0,a._q)((e,r)=>{let o=n.preserve?r??h(!0):e??h(),i="function"==typeof t?t(o):(0,a.Jt)(o,z(t));ei(c)!==ei(i)&&u(i)}),v="function"==typeof t?t:JSON.stringify(t);return(0,o.useEffect)(()=>{m&&y()},[m,v]),(0,o.useEffect)(()=>{if(m)return b((e,t)=>{y(e,t)})},[m]),c},es=o.forwardRef((e,t)=>{let r,{name:n,initialValues:a,fields:l,form:u,preserve:d,children:f,component:p="form",validateMessages:m,validateTrigger:h="onChange",onValuesChange:g,onFieldsChange:b,onFinish:y,onFinishFailed:v,clearOnDestroy:x,...$}=e,w=o.useRef(null),C=o.useContext(en),[E]=er(u),{useSubscribe:k,setInitialValues:S,setCallbacks:A,setValidateMessages:P,setPreserve:R,destroyForm:M}=E.getInternalHooks(i);o.useImperativeHandle(t,()=>({...E,nativeElement:w.current})),o.useEffect(()=>(C.registerForm(n,E),()=>{C.unregisterForm(n)}),[C,E,n]),P({...C.validateMessages,...m}),A({onValuesChange:g,onFieldsChange:(e,...t)=>{C.triggerFormChange(n,e),b&&b(e,...t)},onFinish:e=>{C.triggerFormFinish(n,e),y&&y(e)},onFinishFailed:v}),R(d);let T=o.useRef(null);S(a,!T.current),T.current||(T.current=!0),o.useEffect(()=>()=>M(x),[]);let O="function"==typeof f;r=O?f(E.getFieldsValue(!0),E):f,k(!O);let N=o.useRef(null);o.useEffect(()=>{!function(e,t){return e===t||(!!e||!t)&&(!e||!!t)&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&[...new Set([...Object.keys(e),...Object.keys(t)])].every(r=>{let n=e[r],o=t[r];return"function"==typeof n&&"function"==typeof o||n===o})}(N.current||[],l||[])&&E.setFields(l||[]),N.current=l},[l,E]);let F=o.useMemo(()=>({...E,validateTrigger:h}),[E,h]),j=o.createElement(c.Provider,{value:null},o.createElement(s.Provider,{value:F},r));return!1===p?j:o.createElement(p,ea({},$,{ref:w,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),E.submit()},onReset:e=>{e.preventDefault(),E.resetFields(),$.onReset?.(e)}}),j)});es.FormProvider=eo,es.Field=Y,es.List=Q,es.useForm=er,es.useWatch=el;let ec=es},5045:(e,t,r)=>{"use strict";r.d(t,{M:()=>a});var n=r(97109);let o=e=>"horizontal"===e||"vertical"===e,a=(e,t,r)=>(0,n.useMemo)(()=>{let n;return[n=o(e)?e:"boolean"==typeof t?t?"vertical":"horizontal":o(r)?r:"horizontal","vertical"===n]},[r,e,t])},5406:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});let n=Symbol.for("react.element"),o=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function i(e){return e&&"object"==typeof e&&(e.$$typeof===n||e.$$typeof===o)&&e.type===a}},5669:(e,t,r)=>{"use strict";let n;r.d(t,{A:()=>E});var o=r(97109),a=r(45042),i=r(72658),l=r(42644),s=r(3638),c=r(44137),u=r(48809),d=r(77960),f=r(36319),p=r(92162),m=r(26047),h=r(84649),g=r(58860),b=r(74567),y=r(632),v=r(93056),x=r(88762),$=r(43737),w=r(79412),C=r(19527);(0,l.OC)()&&window.document.documentElement&&document.documentElement.addEventListener("click",e=>{n={x:e.pageX,y:e.pageY},setTimeout(()=>{n=null},100)},!0);let E=e=>{let{prefixCls:t,className:r,rootClassName:E,open:k,wrapClassName:S,centered:A,getContainer:P,style:R,width:M=520,footer:T,classNames:O,styles:N,children:F,loading:j,confirmLoading:I,zIndex:z,mousePosition:B,onOk:L,onCancel:D,okButtonProps:_,cancelButtonProps:H,destroyOnHidden:W,destroyOnClose:q,panelRef:U=null,closable:V,mask:X,modalRender:G,maskClosable:K,scrollLock:Y,focusTriggerAfterClose:Q,focusable:Z,...J}=e,{getPopupContainer:ee,getPrefixCls:et,direction:er,className:en,style:eo,classNames:ea,styles:ei,centered:el,cancelButtonProps:es,okButtonProps:ec,mask:eu,focusable:ed}=(0,b.TP)("modal"),{modal:ef}=o.useContext(b.QO),[ep,em]=o.useMemo(()=>"boolean"==typeof V?[void 0,void 0]:[V?.afterClose,V?.onClose],[V]),eh=et("modal",t),eg=et(),[eb,ey,ev]=(0,u.u)(X,eu,eh,K),ex=(0,v.A)({...ed,...Z},eb,Q),e$=e=>{I||(D?.(e),em?.())},ew=(0,y.A)(eh),[eC,eE]=(0,C.Ay)(eh,ew),ek=(0,s.$)(S,{[`${eh}-centered`]:A??el,[`${eh}-wrap-rtl`]:"rtl"===er}),eS=null===T||j?null:o.createElement(w.w,{...e,okButtonProps:{...ec,..._},onOk:e=>{L?.(e),em?.()},cancelButtonProps:{...es,...H},onCancel:e$}),[eA,eP,eR,eM]=(0,d.$Z)((0,d.dG)(e),(0,d.dG)(ef),{closable:!0,closeIcon:o.createElement(a.A,{className:`${eh}-close-icon`}),closeIconRender:e=>(0,w.O)(eh,e)}),eT=!!eA&&{disabled:eR,closeIcon:eP,afterClose:ep,...eM},eO=G?e=>o.createElement("div",{className:`${eh}-render`},G(e)):void 0,eN=`.${eh}-${G?"render":"container"}`,eF=(0,$.f)(eN),ej=(0,l.K4)(U,eF),[eI,ez]=(0,f.YK)("Modal",z),eB={...e,width:M,panelRef:U,focusTriggerAfterClose:ex.focusTriggerAfterClose,focusable:ex,mask:eb,maskClosable:ev,zIndex:eI},[eL,eD]=(0,p.AV)([ea,O,ey],[ei,N],{props:eB}),[e_,eH]=o.useMemo(()=>(0,m.Qd)(M)?[void 0,M]:[M,void 0],[M]),eW=o.useMemo(()=>{let e={};return eH&&Object.keys(eH).forEach(t=>{let r=eH[t];(0,m.R)(r)&&(e[`--${eh}-${t}-width`]=(0,m.Et)(r)?`${r}px`:r)}),e},[eh,eH]);return o.createElement(c.A,{form:!0,space:!0},o.createElement(g.A.Provider,{value:ez},o.createElement(i.A,{width:e_,...J,zIndex:eI,getContainer:void 0===P?ee:P,prefixCls:eh,rootClassName:(0,s.$)(eC,E,eE,ew,eL.root),rootStyle:eD.root,footer:eS,visible:k,mousePosition:B??n,onClose:e$,closable:eT,closeIcon:eP,transitionName:(0,h.b)(eg,"zoom",e.transitionName),maskTransitionName:(0,h.b)(eg,"fade",e.maskTransitionName),mask:eb,maskClosable:ev,scrollLock:Y,className:(0,s.$)(eC,r,en),style:{...eo,...R,...eW},classNames:{...eL,wrapper:(0,s.$)(eL.wrapper,ek)},styles:eD,panelRef:ej,destroyOnHidden:W??q,modalRender:eO,focusTriggerAfterClose:ex.focusTriggerAfterClose,focusTrap:ex.trap},j?o.createElement(x.A,{active:!0,title:!1,paragraph:{rows:4},className:`${eh}-body-skeleton`}):F)))}},5688:(e,t,r)=>{"use strict";r.d(t,{b:()=>o});let n=e=>({animationDuration:e,animationFillMode:"both"}),o=(e,t,r,o,a=!1)=>{let i=a?"&":"";return{[`
|
|
4
|
+
`]:{paddingInlineEnd:r},[`&-affix-wrapper${t}-affix-wrapper`]:{padding:0,[`> textarea${t}`]:{fontSize:"inherit",border:"none",outline:"none",background:"transparent",minHeight:e.calc(e.controlHeight).sub(e.calc(e.lineWidth).mul(2)).equal(),"&:focus":{boxShadow:"none !important"}},[`${t}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${t}-clear-icon`]:{position:"absolute",insetInlineEnd:e.paddingInline,insetBlockStart:e.paddingXS},[`${n}-suffix`]:{position:"absolute",top:0,insetInlineEnd:e.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}},[`&-affix-wrapper${t}-affix-wrapper-rtl`]:{[`${t}-suffix`]:{[`${t}-data-count`]:{direction:"ltr",insetInlineStart:0}}},[`&-affix-wrapper${t}-affix-wrapper-sm`]:{[`${t}-suffix`]:{[`${t}-clear-icon`]:{insetInlineEnd:e.paddingInlineSM}}}}}})((0,x.oX)(e,(0,$.C)(e))),$.b,{resetFont:!1}),C=(0,n.forwardRef)((e,t)=>{let{prefixCls:r,bordered:v=!0,size:x,disabled:$,status:C,allowClear:E,classNames:k,rootClassName:S,className:A,style:P,styles:R,variant:M,showCount:T,onMouseDown:O,onResize:N,...F}=e,{getPrefixCls:j,direction:I,allowClear:z,autoComplete:B,className:L,style:D,classNames:_,styles:H}=(0,u.TP)("textArea"),W=n.useContext(d.A),{status:q,hasFeedback:U,feedbackIcon:V}=n.useContext(m.$W),X=(0,c.v)(q,C),G=(0,l.XT)(D),K=(0,l.XT)(P),[Y,Q]=(0,l.AV)([_,k],[H,G,R,K],{props:e}),Z=n.useRef(null);n.useImperativeHandle(t,()=>({resizableTextArea:Z.current?.resizableTextArea,focus:e=>{(0,b.F4)(Z.current?.resizableTextArea?.textArea,e)},blur:()=>Z.current?.blur(),nativeElement:Z.current?.nativeElement||null}));let J=j("input",r),ee=(0,f.A)(J),[et,er]=(0,y.MG)(J,S);w(J,ee);let{compactSize:en,compactItemClassnames:eo}=(0,g.RQ)(J,I),ea=(0,p.A)(e=>x??en??e),[ei,el]=(0,h.A)("textArea",M,v),es=(0,i.O)({allowClear:E,contextAllowClear:z,componentName:"TextArea"}),[ec,eu]=n.useState(!1),[ed,ef]=n.useState(!1);return n.createElement(o.fs,{autoComplete:B,...F,style:Q.root,styles:Q,disabled:$??W,allowClear:es,className:(0,a.$)(er,ee,A,S,eo,L,Y.root,{[`${J}-textarea-affix-wrapper-resize-dirty`]:ed}),classNames:{...Y,textarea:(0,a.$)({[`${J}-sm`]:"small"===ea,[`${J}-lg`]:"large"===ea},et,Y.textarea,ec&&`${J}-mouse-active`),variant:(0,a.$)({[`${J}-${ei}`]:el},(0,c.L)(J,X)),affixWrapper:(0,a.$)(`${J}-textarea-affix-wrapper`,{[`${J}-affix-wrapper-rtl`]:"rtl"===I,[`${J}-affix-wrapper-sm`]:"small"===ea,[`${J}-affix-wrapper-lg`]:"large"===ea,[`${J}-textarea-show-count`]:T||e.count?.show},et)},prefixCls:J,suffix:U&&n.createElement("span",{className:`${J}-textarea-suffix`},V),showCount:T,ref:Z,onResize:e=>{if(N?.(e),ec&&(0,s.Tn)(getComputedStyle)){let e=Z.current?.nativeElement?.querySelector("textarea");e&&"both"===getComputedStyle(e).resize&&ef(!0)}},onMouseDown:e=>{eu(!0),O?.(e);let t=()=>{eu(!1),document.removeEventListener("mouseup",t)};document.addEventListener("mouseup",t)}})})},1278:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var n=r(97109);let o=(...e)=>e.filter((e,t,r)=>!!e&&r.indexOf(e)===t).join(" ");var a={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let i=(0,n.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:i,className:l="",children:s,iconNode:c,...u},d)=>(0,n.createElement)("svg",{ref:d,...a,width:t,height:t,stroke:e,strokeWidth:i?24*Number(r)/Number(t):r,className:o("lucide",l),...u},[...c.map(([e,t])=>(0,n.createElement)(e,t)),...Array.isArray(s)?s:[s]])),l=(e,t)=>{let r=(0,n.forwardRef)(({className:r,...a},l)=>(0,n.createElement)(i,{ref:l,iconNode:t,className:o(`lucide-${e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,r),...a}));return r.displayName=`${e}`,r}},2819:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>s,OX:()=>i});var n,o=r(97109);let a=0;function i(e,t){let r=String(t).replace(/[^a-zA-Z0-9_.:-]/g,"-");return`${e}-${r}`}let l={...n||(n=r.t(o,2))}.useId,s=l?function(e){let t=l();return e||t}:function(e){let[t,r]=o.useState("ssr-id");return(o.useEffect(()=>{let e=a;a+=1,r(`rc_unique_${e}`)},[]),e)?e:t}},3396:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},3454:(e,t,r)=>{e.exports=r(64041)},3515:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>l});var n=r(65321),o=r(3454),a=r.n(o),i=r(39507);function l(e){let{Component:t,pageProps:r}=e;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(a(),{children:[(0,n.jsx)("link",{rel:"icon",type:"image/svg+xml",href:"/favicon.svg"}),(0,n.jsx)("link",{rel:"icon",href:"/favicon.ico",sizes:"any"}),(0,n.jsx)("link",{rel:"apple-touch-icon",href:"/apple-touch-icon.png"}),(0,n.jsx)("title",{children:"Customize Agent"})]}),(0,n.jsx)(i.PE,{children:(0,n.jsx)(t,{...r})})]})}r(46430),r(10090)},3638:(e,t,r)=>{"use strict";function n(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=function e(t){var r,n,o="";if("string"==typeof t||"number"==typeof t)o+=t;else if("object"==typeof t)if(Array.isArray(t)){var a=t.length;for(r=0;r<a;r++)t[r]&&(n=e(t[r]))&&(o&&(o+=" "),o+=n)}else for(n in t)t[n]&&(o&&(o+=" "),o+=n);return o}(e))&&(n&&(n+=" "),n+=t);return n}r.d(t,{$:()=>n,A:()=>o});let o=n},4034:(e,t,r)=>{"use strict";r.d(t,{L:()=>o,v:()=>a});var n=r(3638);let o=(e,t,r)=>(0,n.$)({[`${e}-status-success`]:"success"===t,[`${e}-status-warning`]:"warning"===t,[`${e}-status-error`]:"error"===t,[`${e}-status-validating`]:"validating"===t,[`${e}-has-feedback`]:r}),a=(e,t)=>t||e},4097:(e,t,r)=>{"use strict";r.d(t,{b:()=>o});var n=r(26047);let o=e=>(0,n.AZ)(e)?(0,n.Tn)(e)?e():e:null},4216:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var n=r(97109),o=r(28520),a=r(88483);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}let l=n.forwardRef((e,t)=>n.createElement(a.A,i({},e,{ref:t,icon:o.A})))},4932:(e,t,r)=>{"use strict";let n;r.d(t,{D0:()=>Y,_z:()=>s,Op:()=>eo,B8:()=>Q,EF:()=>c,Ay:()=>ec,mN:()=>er,FH:()=>el});var o=r(97109),a=r(42644);let i="RC_FORM_INTERNAL_HOOKS",l=()=>{(0,a.$e)(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},s=o.createContext({getFieldValue:l,getFieldsValue:l,getFieldError:l,getFieldWarning:l,getFieldsError:l,isFieldsTouched:l,isFieldTouched:l,isFieldValidating:l,isFieldsValidating:l,resetFields:l,setFields:l,setFieldValue:l,setFieldsValue:l,validateFields:l,submit:l,getInternalHooks:()=>(l(),{dispatch:l,initEntityValue:l,registerField:l,useSubscribe:l,setInitialValues:l,destroyForm:l,setCallbacks:l,registerWatch:l,getFields:l,setValidateMessages:l,setPreserve:l,getInitialValue:l})}),c=o.createContext(null);function u(e){return null==e?[]:Array.isArray(e)?e:[e]}function d(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",tel:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone(){let e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}let f=d();var p=r(55182);let m=/%[sdj%]/g,h=()=>{};function g(e){if(!e||!e.length)return null;let t={};return e.forEach(e=>{let r=e.field;t[r]=t[r]||[],t[r].push(e)}),t}function b(e,...t){let r=0,n=t.length;return"function"==typeof e?e.apply(null,t):"string"==typeof e?e.replace(m,e=>{if("%%"===e)return"%";if(r>=n)return e;switch(e){case"%s":return String(t[r++]);case"%d":return Number(t[r++]);case"%j":try{return JSON.stringify(t[r++])}catch(e){return"[Circular]"}default:return e}}):e}function y(e,t){return!!(null==e||"array"===t&&Array.isArray(e)&&!e.length)||("string"===t||"url"===t||"hex"===t||"email"===t||"date"===t||"pattern"===t||"tel"===t)&&"string"==typeof e&&!e||!1}function v(e,t,r){let n=0,o=e.length;!function a(i){if(i&&i.length)return void r(i);let l=n;n+=1,l<o?t(e[l],a):r([])}([])}void 0!==p&&p.env;class x extends Error{errors;fields;constructor(e,t){super("Async Validation Error"),this.errors=e,this.fields=t}}function $(e,t){return r=>{let n;return(n=e.fullFields?function(e,t){let r=e;for(let e=0;e<t.length&&void 0!=r;e++)r=r[t[e]];return r}(t,e.fullFields):t[r.field||e.fullField],r&&void 0!==r.message)?(r.field=r.field||e.fullField,r.fieldValue=n,r):{message:"function"==typeof r?r():r,fieldValue:n,field:r.field||e.fullField}}}function w(e,t){if(t){for(let r in t)if(t.hasOwnProperty(r)){let n=t[r];"object"==typeof n&&"object"==typeof e[r]?e[r]={...e[r],...n}:e[r]=n}}return e}let C="enum",E=(e,t,r,n,o,a)=>{e.required&&(!r.hasOwnProperty(e.field)||y(t,a||e.type))&&n.push(b(o.messages.required,e.fullField))},k={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,tel:/^(\+[0-9]{1,3}[-\s\u2011]?)?(\([0-9]{1,4}\)[-\s\u2011]?)?([0-9]+[-\s\u2011]?)*[0-9]+$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},S={integer:e=>S.number(e)&&parseInt(e,10)===e,float:e=>S.number(e)&&!S.integer(e),array:e=>Array.isArray(e),regexp(e){if(e instanceof RegExp)return!0;try{return new RegExp(e),!0}catch(e){return!1}},date:e=>"function"==typeof e.getTime&&"function"==typeof e.getMonth&&"function"==typeof e.getYear&&!isNaN(e.getTime()),number:e=>!isNaN(e)&&"number"==typeof e,object:e=>"object"==typeof e&&!S.array(e),method:e=>"function"==typeof e,email:e=>"string"==typeof e&&e.length<=320&&!!e.match(k.email),tel:e=>"string"==typeof e&&e.length<=32&&!!e.match(k.tel),url:e=>"string"==typeof e&&e.length<=2048&&!!e.match((()=>{if(n)return n;let e="[a-fA-F\\d:]",t=t=>t&&t.includeBoundaries?`(?:(?<=\\s|^)(?=${e})|(?<=${e})(?=\\s|$))`:"",r="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",o="[a-fA-F\\d]{1,4}",a=[`(?:${o}:){7}(?:${o}|:)`,`(?:${o}:){6}(?:${r}|:${o}|:)`,`(?:${o}:){5}(?::${r}|(?::${o}){1,2}|:)`,`(?:${o}:){4}(?:(?::${o}){0,1}:${r}|(?::${o}){1,3}|:)`,`(?:${o}:){3}(?:(?::${o}){0,2}:${r}|(?::${o}){1,4}|:)`,`(?:${o}:){2}(?:(?::${o}){0,3}:${r}|(?::${o}){1,5}|:)`,`(?:${o}:){1}(?:(?::${o}){0,4}:${r}|(?::${o}){1,6}|:)`,`(?::(?:(?::${o}){0,5}:${r}|(?::${o}){1,7}|:))`],i=`(?:${a.join("|")})(?:%[0-9a-zA-Z]{1,})?`,l=RegExp(`(?:^${r}$)|(?:^${i}$)`),s=RegExp(`^${r}$`),c=RegExp(`^${i}$`),u=e=>e&&e.exact?l:RegExp(`(?:${t(e)}${r}${t(e)})|(?:${t(e)}${i}${t(e)})`,"g");u.v4=e=>e&&e.exact?s:RegExp(`${t(e)}${r}${t(e)}`,"g"),u.v6=e=>e&&e.exact?c:RegExp(`${t(e)}${i}${t(e)}`,"g");let d=u.v4().source,f=u.v6().source,p=`(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))`,m=`(?:(?:(?:[a-z]+:)?//)|www\\.)(?:\\S+(?::\\S*)?@)?(?:localhost|${d}|${f}|(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*${p})(?::\\d{2,5})?(?:[/?#][^\\s"]*)?`;return n=RegExp(`(?:^${m}$)`,"i")})()),hex:e=>"string"==typeof e&&!!e.match(k.hex)},A={required:E,whitespace:(e,t,r,n,o)=>{(/^\s+$/.test(t)||""===t)&&n.push(b(o.messages.whitespace,e.fullField))},type:(e,t,r,n,o)=>{if(e.required&&void 0===t)return void E(e,t,r,n,o);let a=e.type;["integer","float","array","regexp","object","method","email","tel","number","date","url","hex"].indexOf(a)>-1?S[a](t)||n.push(b(o.messages.types[a],e.fullField,e.type)):a&&typeof t!==e.type&&n.push(b(o.messages.types[a],e.fullField,e.type))},range:(e,t,r,n,o)=>{let a="number"==typeof e.len,i="number"==typeof e.min,l="number"==typeof e.max,s=t,c=null,u="number"==typeof t,d="string"==typeof t,f=Array.isArray(t);if(u?c="number":d?c="string":f&&(c="array"),!c)return!1;f&&(s=t.length),d&&(s=t.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length),a?s!==e.len&&n.push(b(o.messages[c].len,e.fullField,e.len)):i&&!l&&s<e.min?n.push(b(o.messages[c].min,e.fullField,e.min)):l&&!i&&s>e.max?n.push(b(o.messages[c].max,e.fullField,e.max)):i&&l&&(s<e.min||s>e.max)&&n.push(b(o.messages[c].range,e.fullField,e.min,e.max))},enum:(e,t,r,n,o)=>{e[C]=Array.isArray(e[C])?e[C]:[],-1===e[C].indexOf(t)&&n.push(b(o.messages[C],e.fullField,e[C].join(", ")))},pattern:(e,t,r,n,o)=>{e.pattern&&(e.pattern instanceof RegExp?(e.pattern.lastIndex=0,e.pattern.test(t)||n.push(b(o.messages.pattern.mismatch,e.fullField,t,e.pattern))):"string"==typeof e.pattern&&(new RegExp(e.pattern).test(t)||n.push(b(o.messages.pattern.mismatch,e.fullField,t,e.pattern))))}},P=(e,t,r,n,o)=>{let a=e.type,i=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(y(t,a)&&!e.required)return r();A.required(e,t,n,i,o,a),y(t,a)||A.type(e,t,n,i,o)}r(i)},R={string:(e,t,r,n,o)=>{let a=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(y(t,"string")&&!e.required)return r();A.required(e,t,n,a,o,"string"),y(t,"string")||(A.type(e,t,n,a,o),A.range(e,t,n,a,o),A.pattern(e,t,n,a,o),!0===e.whitespace&&A.whitespace(e,t,n,a,o))}r(a)},method:(e,t,r,n,o)=>{let a=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(y(t)&&!e.required)return r();A.required(e,t,n,a,o),void 0!==t&&A.type(e,t,n,a,o)}r(a)},number:(e,t,r,n,o)=>{let a=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(""===t&&(t=void 0),y(t)&&!e.required)return r();A.required(e,t,n,a,o),void 0!==t&&(A.type(e,t,n,a,o),A.range(e,t,n,a,o))}r(a)},boolean:(e,t,r,n,o)=>{let a=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(y(t)&&!e.required)return r();A.required(e,t,n,a,o),void 0!==t&&A.type(e,t,n,a,o)}r(a)},regexp:(e,t,r,n,o)=>{let a=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(y(t)&&!e.required)return r();A.required(e,t,n,a,o),y(t)||A.type(e,t,n,a,o)}r(a)},integer:(e,t,r,n,o)=>{let a=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(y(t)&&!e.required)return r();A.required(e,t,n,a,o),void 0!==t&&(A.type(e,t,n,a,o),A.range(e,t,n,a,o))}r(a)},float:(e,t,r,n,o)=>{let a=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(y(t)&&!e.required)return r();A.required(e,t,n,a,o),void 0!==t&&(A.type(e,t,n,a,o),A.range(e,t,n,a,o))}r(a)},array:(e,t,r,n,o)=>{let a=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(null==t&&!e.required)return r();A.required(e,t,n,a,o,"array"),null!=t&&(A.type(e,t,n,a,o),A.range(e,t,n,a,o))}r(a)},object:(e,t,r,n,o)=>{let a=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(y(t)&&!e.required)return r();A.required(e,t,n,a,o),void 0!==t&&A.type(e,t,n,a,o)}r(a)},enum:(e,t,r,n,o)=>{let a=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(y(t)&&!e.required)return r();A.required(e,t,n,a,o),void 0!==t&&A.enum(e,t,n,a,o)}r(a)},pattern:(e,t,r,n,o)=>{let a=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(y(t,"string")&&!e.required)return r();A.required(e,t,n,a,o),y(t,"string")||A.pattern(e,t,n,a,o)}r(a)},date:(e,t,r,n,o)=>{let a=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(y(t,"date")&&!e.required)return r();if(A.required(e,t,n,a,o),!y(t,"date")){let r;r=t instanceof Date?t:new Date(t),A.type(e,r,n,a,o),r&&A.range(e,r.getTime(),n,a,o)}}r(a)},url:P,hex:P,email:P,tel:P,required:(e,t,r,n,o)=>{let a=[],i=Array.isArray(t)?"array":typeof t;A.required(e,t,n,a,o,i),r(a)},any:(e,t,r,n,o)=>{let a=[];if(e.required||!e.required&&n.hasOwnProperty(e.field)){if(y(t)&&!e.required)return r();A.required(e,t,n,a,o)}r(a)}};class M{static register=function(e,t){if("function"!=typeof t)throw Error("Cannot register a validator by type, validator is not a function");R[e]=t};static warning=h;static messages=f;static validators=R;rules=null;_messages=f;constructor(e){this.define(e)}define(e){if(!e)throw Error("Cannot configure a schema with no rules");if("object"!=typeof e||Array.isArray(e))throw Error("Rules must be an object");this.rules={},Object.keys(e).forEach(t=>{let r=e[t];this.rules[t]=Array.isArray(r)?r:[r]})}messages(e){return e&&(this._messages=w(d(),e)),this._messages}validate(e,t={},r=()=>{}){let n=e,o=t,a=r;if("function"==typeof o&&(a=o,o={}),!this.rules||0===Object.keys(this.rules).length)return a&&a(null,n),Promise.resolve(n);if(o.messages){let e=this.messages();e===f&&(e=d()),w(e,o.messages),o.messages=e}else o.messages=this.messages();let i={};(o.keys||Object.keys(this.rules)).forEach(t=>{let r=this.rules[t],o=n[t];r.forEach(r=>{let a=r;"function"==typeof a.transform&&(n===e&&(n={...n}),null!=(o=n[t]=a.transform(o))&&(a.type=a.type||(Array.isArray(o)?"array":typeof o))),(a="function"==typeof a?{validator:a}:{...a}).validator=this.getValidationMethod(a),a.validator&&(a.field=t,a.fullField=a.fullField||t,a.type=this.getType(a),i[t]=i[t]||[],i[t].push({rule:a,value:o,source:n,field:t}))})});let l={};return function(e,t,r,n,o){if(t.first){let t=new Promise((t,a)=>{v(function(e){let t=[];return Object.keys(e).forEach(r=>{t.push(...e[r]||[])}),t}(e),r,e=>(n(e),e.length?a(new x(e,g(e))):t(o)))});return t.catch(e=>e),t}let a=!0===t.firstFields?Object.keys(e):t.firstFields||[],i=Object.keys(e),l=i.length,s=0,c=[],u=new Promise((t,u)=>{let d=e=>{if(c.push.apply(c,e),++s===l)return n(c),c.length?u(new x(c,g(c))):t(o)};i.length||(n(c),t(o)),i.forEach(t=>{let n=e[t];if(-1!==a.indexOf(t))v(n,r,d);else{let e=[],t=0,a=n.length;function o(r){e.push(...r||[]),++t===a&&d(e)}n.forEach(e=>{r(e,o)})}})});return u.catch(e=>e),u}(i,o,(e,t)=>{let r,a=e.rule,i=("object"===a.type||"array"===a.type)&&("object"==typeof a.fields||"object"==typeof a.defaultField);function s(e,t){return{...t,fullField:`${a.fullField}.${e}`,fullFields:a.fullFields?[...a.fullFields,e]:[e]}}function c(r=[]){let u=Array.isArray(r)?r:[r];!o.suppressWarning&&u.length&&M.warning("async-validator:",u),u.length&&void 0!==a.message&&null!==a.message&&(u=[].concat(a.message));let d=u.map($(a,n));if(o.first&&d.length)return l[a.field]=1,t(d);if(i){if(a.required&&!e.value)return void 0!==a.message?d=[].concat(a.message).map($(a,n)):o.error&&(d=[o.error(a,b(o.messages.required,a.field))]),t(d);let r={};a.defaultField&&Object.keys(e.value).map(e=>{r[e]=a.defaultField});let i={};Object.keys(r={...r,...e.rule.fields}).forEach(e=>{let t=r[e],n=Array.isArray(t)?t:[t];i[e]=n.map(s.bind(null,e))});let l=new M(i);l.messages(o.messages),e.rule.options&&(e.rule.options.messages=o.messages,e.rule.options.error=o.error),l.validate(e.value,e.rule.options||o,e=>{let r=[];d&&d.length&&r.push(...d),e&&e.length&&r.push(...e),t(r.length?r:null)})}else t(d)}if(i=i&&(a.required||!a.required&&e.value),a.field=e.field,a.asyncValidator)r=a.asyncValidator(a,e.value,c,e.source,o);else if(a.validator){try{r=a.validator(a,e.value,c,e.source,o)}catch(e){console.error?.(e),o.suppressValidatorError||setTimeout(()=>{throw e},0),c(e.message)}!0===r?c():!1===r?c("function"==typeof a.message?a.message(a.fullField||a.field):a.message||`${a.fullField||a.field} fails`):r instanceof Array?c(r):r instanceof Error&&c(r.message)}r&&r.then&&r.then(()=>c(),e=>c(e))},e=>{var t;let r=[],o={};for(let n=0;n<e.length;n++)Array.isArray(t=e[n])?r=r.concat(...t):r.push(t);r.length?(o=g(r),a(r,o)):a(null,n)},n)}getType(e){if(void 0===e.type&&e.pattern instanceof RegExp&&(e.type="pattern"),"function"!=typeof e.validator&&e.type&&!R.hasOwnProperty(e.type))throw Error(b("Unknown rule type %s",e.type));return e.type||"string"}getValidationMethod(e){if("function"==typeof e.validator)return e.validator;let t=Object.keys(e),r=t.indexOf("message");return(-1!==r&&t.splice(r,1),1===t.length&&"required"===t[0])?R.required:R[this.getType(e)]||void 0}}let T="'${name}' is not a valid ${type}",O={default:"Validation error on field '${name}'",required:"'${name}' is required",enum:"'${name}' must be one of [${enum}]",whitespace:"'${name}' cannot be empty",date:{format:"'${name}' is invalid for format date",parse:"'${name}' could not be parsed as date",invalid:"'${name}' is invalid date"},types:{string:T,method:T,array:T,object:T,number:T,date:T,boolean:T,integer:T,float:T,regexp:T,email:T,tel:T,url:T,hex:T},string:{len:"'${name}' must be exactly ${len} characters",min:"'${name}' must be at least ${min} characters",max:"'${name}' cannot be longer than ${max} characters",range:"'${name}' must be between ${min} and ${max} characters"},number:{len:"'${name}' must equal ${len}",min:"'${name}' cannot be less than ${min}",max:"'${name}' cannot be greater than ${max}",range:"'${name}' must be between ${min} and ${max}"},array:{len:"'${name}' must be exactly ${len} in length",min:"'${name}' cannot be less than ${min} in length",max:"'${name}' cannot be greater than ${max} in length",range:"'${name}' must be between ${min} and ${max} in length"},pattern:{mismatch:"'${name}' does not match pattern ${pattern}"}},N="CODE_LOGIC_ERROR";async function F(e,t,r,n,i){let l={...r};if(delete l.ruleIndex,M.warning=()=>void 0,l.validator){let e=l.validator;l.validator=(...t)=>{try{return e(...t)}catch(e){return console.error(e),Promise.reject(N)}}}let s=null;l&&"array"===l.type&&l.defaultField&&(s=l.defaultField,delete l.defaultField);let c=new M({[e]:[l]}),u=(0,a.h1)(O,n.validateMessages);c.messages(u);let d=[];try{await Promise.resolve(c.validate({[e]:t},{...n}))}catch(e){e.errors&&(d=e.errors.map(({message:e},t)=>{let r=e===N?u.default:e;return o.isValidElement(r)?o.cloneElement(r,{key:`error_${t}`}):r}))}if(!d.length&&s&&Array.isArray(t)&&t.length>0)return(await Promise.all(t.map((t,r)=>F(`${e}.${r}`,t,s,n,i)))).reduce((e,t)=>[...e,...t],[]);let f={...r,name:e,enum:(r.enum||[]).join(", "),...i};return d.map(e=>{if("string"==typeof e)return e.replace(/\\?\$\{\w+\}/g,e=>e.startsWith("\\")?e.slice(1):f[e.slice(2,-1)]);return e})}async function j(e){return Promise.all(e).then(e=>[].concat(...e))}async function I(e){let t=0;return new Promise(r=>{e.forEach(n=>{n.then(n=>{n.errors.length&&r([n]),(t+=1)===e.length&&r([])})})})}function z(e){return u(e)}function B(e,t){let r={};return t.forEach(t=>{let n=(0,a.Jt)(e,t);r=(0,a.hZ)(r,t,n)}),r}function L(e,t,r=!1){return e&&e.some(e=>D(t,e,r))}function D(e,t,r=!1){return!!e&&!!t&&(!!r||e.length===t.length)&&t.every((t,r)=>e[r]===t)}function _(e,t,r){let{length:n}=e;if(t<0||t>=n||r<0||r>=n)return e;let o=e[t],a=t-r;return a>0?[...e.slice(0,r),o,...e.slice(r,t),...e.slice(t+1,n)]:a<0?[...e.slice(0,t),...e.slice(t+1,r+1),o,...e.slice(r+1,n)]:e}let H=e=>{let t=new MessageChannel;t.port1.onmessage=e,t.port2.postMessage(null)};class W{namePathList=[];taskId=0;watcherList=new Set;form;constructor(e){this.form=e}register(e){return this.watcherList.add(e),()=>{this.watcherList.delete(e)}}notify(e){e.forEach(e=>{this.namePathList.every(t=>!D(t,e))&&this.namePathList.push(e)}),this.doBatch()}doBatch(){this.taskId+=1;let e=this.taskId;H(()=>{if(e===this.taskId&&this.watcherList.size){let e=this.form.getForm(),t=e.getFieldsValue(),r=e.getFieldsValue(!0);this.watcherList.forEach(e=>{e(t,r,this.namePathList)}),this.namePathList=[]}})}}async function q(){return new Promise(e=>{H(()=>{(0,a.er)(()=>{e()})})})}function U(){return(U=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}let V=[],X=[];function G(e,t,r,n,o,a){return"function"==typeof e?e(t,r,"source"in a?{source:a.source}:{}):n!==o}class K extends o.PureComponent{static contextType=s;state={resetCount:0};cancelRegisterFunc=null;mounted=!1;touched=!1;dirty=!1;validatePromise;prevValidating;errors=V;warnings=X;constructor(e){if(super(e),e.fieldContext){let{getInternalHooks:t}=e.fieldContext,{initEntityValue:r}=t(i);r(this)}}componentDidMount(){let{shouldUpdate:e,fieldContext:t}=this.props;if(this.mounted=!0,t){let{getInternalHooks:e}=t,{registerField:r}=e(i);this.cancelRegisterFunc=r(this)}!0===e&&this.reRender()}componentWillUnmount(){this.cancelRegister(),this.triggerMetaEvent(!0),this.mounted=!1}cancelRegister=()=>{let{preserve:e,isListField:t,name:r}=this.props;this.cancelRegisterFunc&&this.cancelRegisterFunc(t,e,z(r)),this.cancelRegisterFunc=null};getNamePath=()=>{let{name:e,fieldContext:t}=this.props,{prefixName:r=[]}=t;return void 0!==e?[...r,...e]:[]};getRules=()=>{let{rules:e=[],fieldContext:t}=this.props;return e.map(e=>"function"==typeof e?e(t):e)};reRender(){this.mounted&&this.forceUpdate()}refresh=()=>{this.mounted&&this.setState(({resetCount:e})=>({resetCount:e+1}))};metaCache=null;triggerMetaEvent=e=>{let{onMetaChange:t}=this.props;if(t){let r={...this.getMeta(),destroy:e};(0,a.n4)(this.metaCache,r)||t(r),this.metaCache=r}else this.metaCache=null};onStoreChange=(e,t,r)=>{let{shouldUpdate:n,dependencies:o=[],onReset:i}=this.props,{store:l}=r,s=this.getNamePath(),c=this.getValue(e),u=this.getValue(l),d=t&&L(t,s);switch("valueUpdate"===r.type&&"external"===r.source&&!(0,a.n4)(c,u)&&(this.touched=!0,this.dirty=!0,this.validatePromise=null,this.errors=V,this.warnings=X,this.triggerMetaEvent()),r.type){case"reset":if(!t||d){this.touched=!1,this.dirty=!1,this.validatePromise=void 0,this.errors=V,this.warnings=X,this.triggerMetaEvent(),i?.(),this.refresh();return}break;case"remove":if(n&&G(n,e,l,c,u,r))return void this.reRender();break;case"setField":{let{data:o}=r;if(d){"touched"in o&&(this.touched=o.touched),"validating"in o&&!("originRCField"in o)&&(this.validatePromise=o.validating?Promise.resolve([]):null),"errors"in o&&(this.errors=o.errors||V),"warnings"in o&&(this.warnings=o.warnings||X),this.dirty=!0,this.triggerMetaEvent(),this.reRender();return}if("value"in o&&L(t,s,!0)||n&&!s.length&&G(n,e,l,c,u,r))return void this.reRender();break}case"dependenciesUpdate":if(o.map(z).some(e=>L(r.relatedFields,e)))return void this.reRender();break;default:if(d||(!o.length||s.length||n)&&G(n,e,l,c,u,r))return void this.reRender()}!0===n&&this.reRender()};validateRules=e=>{let t=this.getNamePath(),r=this.getValue(),{triggerName:n,validateOnly:o=!1,delayFrame:i}=e||{},l=Promise.resolve().then(async()=>{if(!this.mounted)return[];let{validateFirst:o=!1,messageVariables:s,validateDebounce:c}=this.props;i&&await q();let d=this.getRules();if(n&&(d=d.filter(e=>e).filter(e=>{let{validateTrigger:t}=e;return!t||u(t).includes(n)})),c&&n&&(await new Promise(e=>{setTimeout(e,c)}),this.validatePromise!==l))return[];let f=function(e,t,r,n,o,i){let l,s=e.join("."),c=r.map((e,t)=>{let r=e.validator,n={...e,ruleIndex:t};return r&&(n.validator=(e,t,n)=>{let o=!1,i=r(e,t,(...e)=>{Promise.resolve().then(()=>{(0,a.$e)(!o,"Your validator function has already return a promise. `callback` will be ignored."),o||n(...e)})});o=i&&"function"==typeof i.then&&"function"==typeof i.catch,(0,a.$e)(o,"`callback` is deprecated. Please return a promise instead."),o&&i.then(()=>{n()}).catch(e=>{n(e||" ")})}),n}).sort(({warningOnly:e,ruleIndex:t},{warningOnly:r,ruleIndex:n})=>!!e==!!r?t-n:e?1:-1);if(!0===o)l=new Promise(async(e,r)=>{for(let e=0;e<c.length;e+=1){let o=c[e],a=await F(s,t,o,n,i);if(a.length)return void r([{errors:a,rule:o}])}e([])});else{let e=c.map(e=>F(s,t,e,n,i).then(t=>({errors:t,rule:e})));l=(o?I(e):j(e)).then(e=>Promise.reject(e))}return l.catch(e=>e),l}(t,r,d,e,o,s);return f.catch(e=>e).then((e=V)=>{if(this.validatePromise===l){this.validatePromise=null;let t=[],r=[];e.forEach?.(({rule:{warningOnly:e},errors:n=V})=>{e?r.push(...n):t.push(...n)}),this.errors=t,this.warnings=r,this.triggerMetaEvent(),this.reRender()}}),f});return o||(this.validatePromise=l,this.dirty=!0,this.errors=V,this.warnings=X,this.triggerMetaEvent(),this.reRender()),l};isFieldValidating=()=>!!this.validatePromise;isFieldTouched=()=>this.touched;isFieldDirty=()=>{if(this.dirty||void 0!==this.props.initialValue)return!0;let{fieldContext:e}=this.props,{getInitialValue:t}=e.getInternalHooks(i);return void 0!==t(this.getNamePath())};getErrors=()=>this.errors;getWarnings=()=>this.warnings;isListField=()=>this.props.isListField;isList=()=>this.props.isList;isPreserve=()=>this.props.preserve;getMeta=()=>(this.prevValidating=this.isFieldValidating(),{touched:this.isFieldTouched(),validating:this.prevValidating,errors:this.errors,warnings:this.warnings,name:this.getNamePath(),validated:null===this.validatePromise});getOnlyChild=e=>{if("function"==typeof e){let t=this.getMeta();return{...this.getOnlyChild(e(this.getControlled(),t,this.props.fieldContext)),isFunction:!0}}let t=(0,a.$r)(e);return 1===t.length&&o.isValidElement(t[0])?{child:t[0],isFunction:!1}:{child:t,isFunction:!1}};getValue=e=>{let{getFieldsValue:t}=this.props.fieldContext,r=this.getNamePath();return(0,a.Jt)(e||t(!0),r)};getControlled=(e={})=>{let{name:t,trigger:r="onChange",validateTrigger:n,getValueFromEvent:o,normalize:a,valuePropName:l="value",getValueProps:s,fieldContext:c}=this.props,d=void 0!==n?n:c.validateTrigger,f=this.getNamePath(),{getInternalHooks:p,getFieldsValue:m}=c,{dispatch:h}=p(i),g=this.getValue(),b=s||(e=>({[l]:e})),y=e[r],v=void 0!==t?b(g):{},x={...e,...v};return x[r]=(...e)=>{let t;this.touched=!0,this.dirty=!0,this.triggerMetaEvent(),t=o?o(...e):function(e,...t){let r=t[0];return r&&r.target&&"object"==typeof r.target&&e in r.target?r.target[e]:r}(l,...e),a&&(t=a(t,g,m(!0))),t!==g&&h({type:"updateValue",namePath:f,value:t}),y&&y(...e)},u(d||[]).forEach(e=>{let t=x[e];x[e]=(...r)=>{t&&t(...r);let{rules:n}=this.props;n&&n.length&&h({type:"validateField",namePath:f,triggerName:e})}}),x};render(){let e,{resetCount:t}=this.state,{children:r}=this.props,{child:n,isFunction:i}=this.getOnlyChild(r);return i?e=n:o.isValidElement(n)?e=o.cloneElement(n,this.getControlled(n.props)):((0,a.$e)(!n,"`children` of Field is not validate ReactElement."),e=n),o.createElement(o.Fragment,{key:t},e)}}let Y=function({name:e,...t}){let r=o.useContext(s),n=o.useContext(c),a=void 0!==e?z(e):void 0,i=t.isListField??!!n,l="keep";return i||(l=`_${(a||[]).join("_")}`),o.createElement(K,U({key:l,name:a,isListField:i},t,{fieldContext:r}))},Q=function({name:e,initialValue:t,children:r,rules:n,validateTrigger:i,isListField:l}){let u=o.useContext(s),d=o.useContext(c),f=o.useRef({keys:[],id:0}).current,p=o.useMemo(()=>[...z(u.prefixName)||[],...z(e)],[u.prefixName,e]),m=o.useMemo(()=>({...u,prefixName:p}),[u,p]),h=o.useMemo(()=>({getKey:e=>{let t=p.length,r=e[t];return[f.keys[r],e.slice(t+1)]}}),[f,p]);return"function"!=typeof r?((0,a.$e)(!1,"Form.List only accepts function as children."),null):o.createElement(c.Provider,{value:h},o.createElement(s.Provider,{value:m},o.createElement(Y,{name:[],shouldUpdate:(e,t,{source:r})=>"internal"!==r&&e!==t,rules:n,validateTrigger:i,initialValue:t,isList:!0,isListField:l??!!d},({value:e=[],onChange:t},n)=>{let{getFieldValue:o}=u,a=()=>o(p||[])||[],i=e||[];return Array.isArray(i)||(i=[]),r(i.map((e,t)=>{let r=f.keys[t];return void 0===r&&(f.keys[t]=f.id,r=f.keys[t],f.id+=1),{name:t,key:r,isListField:!0}}),{add:(e,r)=>{let n=a();r>=0&&r<=n.length?(f.keys=[...f.keys.slice(0,r),f.id,...f.keys.slice(r)],t([...n.slice(0,r),e,...n.slice(r)])):(f.keys=[...f.keys,f.id],t([...n,e])),f.id+=1},remove:e=>{let r=a(),n=new Set(Array.isArray(e)?e:[e]);n.size<=0||(f.keys=f.keys.filter((e,t)=>!n.has(t)),t(r.filter((e,t)=>!n.has(t))))},move(e,r){if(e===r)return;let n=a();e<0||e>=n.length||r<0||r>=n.length||(f.keys=_(f.keys,e,r),t(_(n,e,r)))}},n)})))},Z="__@field_split__";function J(e){return e.map(e=>`${typeof e}:${e}`).join(Z)}class ee{kvs=new Map;set(e,t){this.kvs.set(J(e),t)}get(e){return this.kvs.get(J(e))}getAsPrefix(e){let t=J(e),r=t+Z,n=[],o=this.kvs.get(t);return void 0!==o&&n.push(o),this.kvs.forEach((e,t)=>{t.startsWith(r)&&n.push(e)}),n}update(e,t){let r=t(this.get(e));r?this.set(e,r):this.delete(e)}delete(e){this.kvs.delete(J(e))}map(e){return[...this.kvs.entries()].map(([t,r])=>e({key:t.split(Z).map(e=>{let[,t,r]=e.match(/^([^:]*):(.*)$/);return"number"===t?Number(r):r}),value:r}))}toJSON(){let e={};return this.map(({key:t,value:r})=>(e[t.join(".")]=r,null)),e}}class et{formHooked=!1;forceRootUpdate;subscribable=!0;store={};fieldEntities=[];initialValues={};callbacks={};validateMessages=null;preserve=null;lastValidatePromise=null;watcherCenter=new W(this);constructor(e){this.forceRootUpdate=e}getForm=()=>({getFieldValue:this.getFieldValue,getFieldsValue:this.getFieldsValue,getFieldError:this.getFieldError,getFieldWarning:this.getFieldWarning,getFieldsError:this.getFieldsError,isFieldsTouched:this.isFieldsTouched,isFieldTouched:this.isFieldTouched,isFieldValidating:this.isFieldValidating,isFieldsValidating:this.isFieldsValidating,resetFields:this.resetFields,setFields:this.setFields,setFieldValue:this.setFieldValue,setFieldsValue:this.setFieldsValue,validateFields:this.validateFields,submit:this.submit,_init:!0,getInternalHooks:this.getInternalHooks});getInternalHooks=e=>e===i?(this.formHooked=!0,{dispatch:this.dispatch,initEntityValue:this.initEntityValue,registerField:this.registerField,useSubscribe:this.useSubscribe,setInitialValues:this.setInitialValues,destroyForm:this.destroyForm,setCallbacks:this.setCallbacks,setValidateMessages:this.setValidateMessages,getFields:this.getFields,setPreserve:this.setPreserve,getInitialValue:this.getInitialValue,registerWatch:this.registerWatch}):((0,a.$e)(!1,"`getInternalHooks` is internal usage. Should not call directly."),null);useSubscribe=e=>{this.subscribable=e};prevWithoutPreserves=null;setInitialValues=(e,t)=>{if(this.initialValues=e||{},t){let t=(0,a.h1)(e,this.store);this.prevWithoutPreserves?.map(({key:r})=>{t=(0,a.hZ)(t,r,(0,a.Jt)(e,r))}),this.prevWithoutPreserves=null,this.updateStore(t)}};destroyForm=e=>{if(e)this.updateStore({});else{let e=new ee;this.getFieldEntities(!0).forEach(t=>{this.isMergedPreserve(t.isPreserve())||e.set(t.getNamePath(),!0)}),this.prevWithoutPreserves=e}};getInitialValue=e=>{let t=(0,a.Jt)(this.initialValues,e);return e.length?(0,a.h1)(t):t};setCallbacks=e=>{this.callbacks=e};setValidateMessages=e=>{this.validateMessages=e};setPreserve=e=>{this.preserve=e};registerWatch=e=>this.watcherCenter.register(e);notifyWatch=(e=[])=>{this.watcherCenter.notify(e)};timeoutId=null;warningUnhooked=()=>{};updateStore=e=>{this.store=e};getFieldEntities=(e=!1)=>e?this.fieldEntities.filter(e=>e.getNamePath().length):this.fieldEntities;getFieldsMap=(e=!1)=>{let t=new ee;return this.getFieldEntities(e).forEach(e=>{let r=e.getNamePath();t.set(r,e)}),t};getFieldEntitiesForNamePathList=(e,t=!1)=>{if(!e)return this.getFieldEntities(!0);let r=this.getFieldsMap(!0);return t?e.flatMap(e=>{let t=z(e),n=r.getAsPrefix(t);return n.length?n:[{INVALIDATE_NAME_PATH:t}]}):e.map(e=>{let t=z(e);return r.get(t)||{INVALIDATE_NAME_PATH:z(e)}})};getFieldsValue=(e,t)=>{let r,n;if(this.warningUnhooked(),!0===e||Array.isArray(e)?(r=e,n=t):e&&"object"==typeof e&&(n=e.filter),!0===r&&!n)return this.store;let o=this.getFieldEntitiesForNamePathList(Array.isArray(r)?r:null,!0),i=[],l=[];o.forEach(e=>{let t=e.INVALIDATE_NAME_PATH||e.getNamePath();if(e.isList?.())return void l.push(t);if(n){let r="getMeta"in e?e.getMeta():null;n(r)&&i.push(t)}else i.push(t)});let s=B(this.store,i.map(z));return l.forEach(e=>{(0,a.Jt)(s,e)||(s=(0,a.hZ)(s,e,[]))}),s};getFieldValue=e=>{this.warningUnhooked();let t=z(e);return(0,a.Jt)(this.store,t)};getFieldsError=e=>(this.warningUnhooked(),this.getFieldEntitiesForNamePathList(e).map((t,r)=>t&&!t.INVALIDATE_NAME_PATH?{name:t.getNamePath(),errors:t.getErrors(),warnings:t.getWarnings()}:{name:z(e[r]),errors:[],warnings:[]}));getFieldError=e=>{this.warningUnhooked();let t=z(e);return this.getFieldsError([t])[0].errors};getFieldWarning=e=>{this.warningUnhooked();let t=z(e);return this.getFieldsError([t])[0].warnings};isFieldsTouched=(...e)=>{let t;this.warningUnhooked();let[r,n]=e,o=!1;0===e.length?t=null:1===e.length?Array.isArray(r)?(t=r.map(z),o=!1):(t=null,o=r):(t=r.map(z),o=n);let a=this.getFieldEntities(!0),i=e=>e.isFieldTouched();if(!t)return o?a.every(e=>i(e)||e.isList()):a.some(i);let l=new ee;t.forEach(e=>{l.set(e,[])}),a.forEach(e=>{let r=e.getNamePath();t.forEach(t=>{t.every((e,t)=>r[t]===e)&&l.update(t,t=>[...t,e])})});let s=e=>e.some(i),c=l.map(({value:e})=>e);return o?c.every(s):c.some(s)};isFieldTouched=e=>(this.warningUnhooked(),this.isFieldsTouched([e]));isFieldsValidating=e=>{this.warningUnhooked();let t=this.getFieldEntities();if(!e)return t.some(e=>e.isFieldValidating());let r=e.map(z);return t.some(e=>L(r,e.getNamePath())&&e.isFieldValidating())};isFieldValidating=e=>(this.warningUnhooked(),this.isFieldsValidating([e]));resetWithFieldInitialValue=(e={})=>{let t,r=new ee,n=this.getFieldEntities(!0);n.forEach(e=>{let{initialValue:t}=e.props,n=e.getNamePath();if(void 0!==t){let o=r.get(n)||new Set;o.add({entity:e,value:t}),r.set(n,o)}});let o=t=>{t.forEach(t=>{let{initialValue:n}=t.props;if(void 0!==n){let n=t.getNamePath();if(void 0!==this.getInitialValue(n))(0,a.$e)(!1,`Form already set 'initialValues' with path '${n.join(".")}'. Field can not overwrite it.`);else{let o=r.get(n);if(o&&o.size>1)(0,a.$e)(!1,`Multiple Field with path '${n.join(".")}' set 'initialValue'. Can not decide which one to pick.`);else if(o){let r=this.getFieldValue(n);t.isListField()||e.skipExist&&void 0!==r||this.updateStore((0,a.hZ)(this.store,n,[...o][0].value))}}}})};e.entities?t=e.entities:e.namePathList?(t=[],e.namePathList.forEach(e=>{let n=r.get(e);n&&t.push(...[...n].map(e=>e.entity))})):t=n,o(t)};resetFields=e=>{this.warningUnhooked();let t=this.store;if(!e){this.updateStore((0,a.h1)(this.initialValues)),this.resetWithFieldInitialValue(),this.notifyObservers(t,null,{type:"reset"}),this.notifyWatch();return}let r=e.map(z);r.forEach(e=>{let t=this.getInitialValue(e);this.updateStore((0,a.hZ)(this.store,e,t))}),this.resetWithFieldInitialValue({namePathList:r}),this.notifyObservers(t,r,{type:"reset"}),this.notifyWatch(r)};setFields=e=>{this.warningUnhooked();let t=this.store,r=[];e.forEach(e=>{let{name:n,...o}=e,i=z(n);r.push(i),"value"in o&&this.updateStore((0,a.hZ)(this.store,i,o.value)),this.notifyObservers(t,[i],{type:"setField",data:e})}),this.notifyWatch(r)};getFields=()=>this.getFieldEntities(!0).map(e=>{let t=e.getNamePath(),r={...e.getMeta(),name:t,value:this.getFieldValue(t)};return Object.defineProperty(r,"originRCField",{value:!0}),r});initEntityValue=e=>{let{initialValue:t}=e.props;if(void 0!==t){let r=e.getNamePath();void 0===(0,a.Jt)(this.store,r)&&this.updateStore((0,a.hZ)(this.store,r,t))}};isMergedPreserve=e=>(void 0!==e?e:this.preserve)??!0;registerField=e=>{this.fieldEntities.push(e);let t=e.getNamePath();if(this.notifyWatch([t]),void 0!==e.props.initialValue){let t=this.store;this.resetWithFieldInitialValue({entities:[e],skipExist:!0}),this.notifyObservers(t,[e.getNamePath()],{type:"valueUpdate",source:"internal"})}return(r,n,o=[])=>{if(this.fieldEntities=this.fieldEntities.filter(t=>t!==e),!this.isMergedPreserve(n)&&(!r||o.length>1)){let e=r?void 0:this.getInitialValue(t);if(t.length&&this.getFieldValue(t)!==e&&this.fieldEntities.every(e=>!D(e.getNamePath(),t))){let r=this.store;this.updateStore((0,a.hZ)(r,t,e,!0)),this.notifyObservers(r,[t],{type:"remove"}),this.triggerDependenciesUpdate(r,t)}}this.notifyWatch([t])}};dispatch=e=>{switch(e.type){case"updateValue":{let{namePath:t,value:r}=e;this.updateValue(t,r);break}case"validateField":{let{namePath:t,triggerName:r}=e;this.validateFields([t],{triggerName:r})}}};notifyObservers=(e,t,r)=>{if(this.subscribable){let n={...r,store:this.getFieldsValue(!0)};this.getFieldEntities().forEach(({onStoreChange:r})=>{r(e,t,n)})}else this.forceRootUpdate()};triggerDependenciesUpdate=(e,t)=>{let r=this.getDependencyChildrenFields(t);return r.length&&this.validateFields(r,{delayFrame:!0}),this.notifyObservers(e,r,{type:"dependenciesUpdate",relatedFields:[t,...r]}),r};updateValue=(e,t)=>{let r=z(e),n=this.store;this.updateStore((0,a.hZ)(this.store,r,t)),this.notifyObservers(n,[r],{type:"valueUpdate",source:"internal"}),this.notifyWatch([r]);let o=this.triggerDependenciesUpdate(n,r),{onValuesChange:i}=this.callbacks;if(i){let e=B(this.store,[r]),t=this.getFieldsValue(),n=(0,a.hZ)(t,r,(0,a.Jt)(e,r));i(e,n)}this.triggerOnFieldsChange([r,...o])};setFieldsValue=e=>{this.warningUnhooked();let t=this.store;if(e){let t=(0,a.h1)(this.store,e);this.updateStore(t)}this.notifyObservers(t,null,{type:"valueUpdate",source:"external"}),this.notifyWatch()};setFieldValue=(e,t)=>{this.setFields([{name:e,value:t,errors:[],warnings:[],touched:!0}])};getDependencyChildrenFields=e=>{let t=new Set,r=[],n=new ee;this.getFieldEntities().forEach(e=>{let{dependencies:t}=e.props;(t||[]).forEach(t=>{let r=z(t);n.update(r,(t=new Set)=>(t.add(e),t))})});let o=e=>{(n.get(e)||new Set).forEach(e=>{if(!t.has(e)){t.add(e);let n=e.getNamePath();e.isFieldDirty()&&n.length&&(r.push(n),o(n))}})};return o(e),r};triggerOnFieldsChange=(e,t)=>{let{onFieldsChange:r}=this.callbacks;if(r){let n=this.getFields();if(t){let e=new ee;t.forEach(({name:t,errors:r})=>{e.set(t,r)}),n.forEach(t=>{t.errors=e.get(t.name)||t.errors})}let o=n.filter(({name:t})=>L(e,t));o.length&&r(o,n)}};validateFields=(e,t)=>{let r,n;this.warningUnhooked(),Array.isArray(e)||"string"==typeof e||"string"==typeof t?(r=e,n=t):n=e;let o=!!r,a=o?r.map(z):[],i=[...a],l=[],s=String(Date.now()),c=new Set,{recursive:u,dirty:d}=n||{};this.getFieldEntities(!0).forEach(e=>{let t=e.getNamePath();if((o||(e.isList()&&a.some(e=>D(e,t,!0))||i.push(t),a.push(t)),e.props.rules&&e.props.rules.length)&&(!d||e.isFieldDirty())&&(c.add(t.join(s)),!o||L(a,t,u))){let r=e.validateRules({validateMessages:{...O,...this.validateMessages},...n});l.push(r.then(()=>({name:t,errors:[],warnings:[]})).catch(e=>{let r=[],n=[];return(e.forEach?.(({rule:{warningOnly:e},errors:t})=>{e?n.push(...t):r.push(...t)}),r.length)?Promise.reject({name:t,errors:r,warnings:n}):{name:t,errors:r,warnings:n}}))}});let f=function(e){let t=!1,r=e.length,n=[];return e.length?new Promise((o,a)=>{e.forEach((e,i)=>{e.catch(e=>(t=!0,e)).then(e=>{r-=1,n[i]=e,r>0||(t&&a(n),o(n))})})}):Promise.resolve([])}(l);this.lastValidatePromise=f,f.catch(e=>e).then(e=>{let t=e.map(({name:e})=>e);this.notifyObservers(this.store,t,{type:"validateFinish"}),this.triggerOnFieldsChange(t,e)});let p=f.then(()=>this.lastValidatePromise===f?Promise.resolve(this.getFieldsValue(i)):Promise.reject([])).catch(e=>{let t=e.filter(e=>e&&e.errors.length);return Promise.reject({message:t[0]?.errors?.[0],values:this.getFieldsValue(a),errorFields:t,outOfDate:this.lastValidatePromise!==f})});p.catch(e=>e);let m=a.filter(e=>c.has(e.join(s)));return this.triggerOnFieldsChange(m),p};submit=()=>{this.warningUnhooked(),this.validateFields().then(e=>{let{onFinish:t}=this.callbacks;if(t)try{t(e)}catch(e){console.error(e)}}).catch(e=>{let{onFinishFailed:t}=this.callbacks;t&&t(e)})}}let er=function(e){let t=o.useRef(null),[,r]=o.useState({});return t.current||(e?t.current=e:t.current=new et(()=>{r({})}).getForm()),[t.current]},en=o.createContext({triggerFormChange:()=>{},triggerFormFinish:()=>{},registerForm:()=>{},unregisterForm:()=>{}}),eo=({validateMessages:e,onFormChange:t,onFormFinish:r,children:n})=>{let a=o.useContext(en),i=o.useRef({});return o.createElement(en.Provider,{value:{...a,validateMessages:{...a.validateMessages,...e},triggerFormChange:(e,r)=>{t&&t(e,{changedFields:r,forms:i.current}),a.triggerFormChange(e,r)},triggerFormFinish:(e,t)=>{r&&r(e,{values:t,forms:i.current}),a.triggerFormFinish(e,t)},registerForm:(e,t)=>{e&&(i.current={...i.current,[e]:t}),a.registerForm(e,t)},unregisterForm:e=>{let t={...i.current};delete t[e],i.current=t,a.unregisterForm(e)}}},n)};function ea(){return(ea=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function ei(e){try{return JSON.stringify(e)}catch{return Math.random()}}let el=function(...e){let[t,r={}]=e,n=r&&r._init?{form:r}:r,l=n.form,[c,u]=(0,o.useState)(()=>"function"==typeof t?t({}):void 0),d=(0,o.useMemo)(()=>ei(c),[c]);(0,o.useRef)(d).current=d;let f=(0,o.useContext)(s),p=l||f,m=p&&p._init,{getFieldsValue:h,getInternalHooks:g}=p,{registerWatch:b}=g(i),y=(0,a._q)((e,r)=>{let o=n.preserve?r??h(!0):e??h(),i="function"==typeof t?t(o):(0,a.Jt)(o,z(t));ei(c)!==ei(i)&&u(i)}),v="function"==typeof t?t:JSON.stringify(t);return(0,o.useEffect)(()=>{m&&y()},[m,v]),(0,o.useEffect)(()=>{if(m)return b((e,t)=>{y(e,t)})},[m]),c},es=o.forwardRef((e,t)=>{let r,{name:n,initialValues:a,fields:l,form:u,preserve:d,children:f,component:p="form",validateMessages:m,validateTrigger:h="onChange",onValuesChange:g,onFieldsChange:b,onFinish:y,onFinishFailed:v,clearOnDestroy:x,...$}=e,w=o.useRef(null),C=o.useContext(en),[E]=er(u),{useSubscribe:k,setInitialValues:S,setCallbacks:A,setValidateMessages:P,setPreserve:R,destroyForm:M}=E.getInternalHooks(i);o.useImperativeHandle(t,()=>({...E,nativeElement:w.current})),o.useEffect(()=>(C.registerForm(n,E),()=>{C.unregisterForm(n)}),[C,E,n]),P({...C.validateMessages,...m}),A({onValuesChange:g,onFieldsChange:(e,...t)=>{C.triggerFormChange(n,e),b&&b(e,...t)},onFinish:e=>{C.triggerFormFinish(n,e),y&&y(e)},onFinishFailed:v}),R(d);let T=o.useRef(null);S(a,!T.current),T.current||(T.current=!0),o.useEffect(()=>()=>M(x),[]);let O="function"==typeof f;r=O?f(E.getFieldsValue(!0),E):f,k(!O);let N=o.useRef(null);o.useEffect(()=>{!function(e,t){return e===t||(!!e||!t)&&(!e||!!t)&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&[...new Set([...Object.keys(e),...Object.keys(t)])].every(r=>{let n=e[r],o=t[r];return"function"==typeof n&&"function"==typeof o||n===o})}(N.current||[],l||[])&&E.setFields(l||[]),N.current=l},[l,E]);let F=o.useMemo(()=>({...E,validateTrigger:h}),[E,h]),j=o.createElement(c.Provider,{value:null},o.createElement(s.Provider,{value:F},r));return!1===p?j:o.createElement(p,ea({},$,{ref:w,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),E.submit()},onReset:e=>{e.preventDefault(),E.resetFields(),$.onReset?.(e)}}),j)});es.FormProvider=eo,es.Field=Y,es.List=Q,es.useForm=er,es.useWatch=el;let ec=es},5045:(e,t,r)=>{"use strict";r.d(t,{M:()=>a});var n=r(97109);let o=e=>"horizontal"===e||"vertical"===e,a=(e,t,r)=>(0,n.useMemo)(()=>{let n;return[n=o(e)?e:"boolean"==typeof t?t?"vertical":"horizontal":o(r)?r:"horizontal","vertical"===n]},[r,e,t])},5406:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});let n=Symbol.for("react.element"),o=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function i(e){return e&&"object"==typeof e&&(e.$$typeof===n||e.$$typeof===o)&&e.type===a}},5669:(e,t,r)=>{"use strict";let n;r.d(t,{A:()=>E});var o=r(97109),a=r(45042),i=r(72658),l=r(42644),s=r(3638),c=r(44137),u=r(48809),d=r(77960),f=r(36319),p=r(92162),m=r(26047),h=r(84649),g=r(58860),b=r(74567),y=r(632),v=r(93056),x=r(88762),$=r(43737),w=r(79412),C=r(19527);(0,l.OC)()&&window.document.documentElement&&document.documentElement.addEventListener("click",e=>{n={x:e.pageX,y:e.pageY},setTimeout(()=>{n=null},100)},!0);let E=e=>{let{prefixCls:t,className:r,rootClassName:E,open:k,wrapClassName:S,centered:A,getContainer:P,style:R,width:M=520,footer:T,classNames:O,styles:N,children:F,loading:j,confirmLoading:I,zIndex:z,mousePosition:B,onOk:L,onCancel:D,okButtonProps:_,cancelButtonProps:H,destroyOnHidden:W,destroyOnClose:q,panelRef:U=null,closable:V,mask:X,modalRender:G,maskClosable:K,scrollLock:Y,focusTriggerAfterClose:Q,focusable:Z,...J}=e,{getPopupContainer:ee,getPrefixCls:et,direction:er,className:en,style:eo,classNames:ea,styles:ei,centered:el,cancelButtonProps:es,okButtonProps:ec,mask:eu,focusable:ed}=(0,b.TP)("modal"),{modal:ef}=o.useContext(b.QO),[ep,em]=o.useMemo(()=>"boolean"==typeof V?[void 0,void 0]:[V?.afterClose,V?.onClose],[V]),eh=et("modal",t),eg=et(),[eb,ey,ev]=(0,u.u)(X,eu,eh,K),ex=(0,v.A)({...ed,...Z},eb,Q),e$=e=>{I||(D?.(e),em?.())},ew=(0,y.A)(eh),[eC,eE]=(0,C.Ay)(eh,ew),ek=(0,s.$)(S,{[`${eh}-centered`]:A??el,[`${eh}-wrap-rtl`]:"rtl"===er}),eS=null===T||j?null:o.createElement(w.w,{...e,okButtonProps:{...ec,..._},onOk:e=>{L?.(e),em?.()},cancelButtonProps:{...es,...H},onCancel:e$}),[eA,eP,eR,eM]=(0,d.$Z)((0,d.dG)(e),(0,d.dG)(ef),{closable:!0,closeIcon:o.createElement(a.A,{className:`${eh}-close-icon`}),closeIconRender:e=>(0,w.O)(eh,e)}),eT=!!eA&&{disabled:eR,closeIcon:eP,afterClose:ep,...eM},eO=G?e=>o.createElement("div",{className:`${eh}-render`},G(e)):void 0,eN=`.${eh}-${G?"render":"container"}`,eF=(0,$.f)(eN),ej=(0,l.K4)(U,eF),[eI,ez]=(0,f.YK)("Modal",z),eB={...e,width:M,panelRef:U,focusTriggerAfterClose:ex.focusTriggerAfterClose,focusable:ex,mask:eb,maskClosable:ev,zIndex:eI},[eL,eD]=(0,p.AV)([ea,O,ey],[ei,N],{props:eB}),[e_,eH]=o.useMemo(()=>(0,m.Qd)(M)?[void 0,M]:[M,void 0],[M]),eW=o.useMemo(()=>{let e={};return eH&&Object.keys(eH).forEach(t=>{let r=eH[t];(0,m.R)(r)&&(e[`--${eh}-${t}-width`]=(0,m.Et)(r)?`${r}px`:r)}),e},[eh,eH]);return o.createElement(c.A,{form:!0,space:!0},o.createElement(g.A.Provider,{value:ez},o.createElement(i.A,{width:e_,...J,zIndex:eI,getContainer:void 0===P?ee:P,prefixCls:eh,rootClassName:(0,s.$)(eC,E,eE,ew,eL.root),rootStyle:eD.root,footer:eS,visible:k,mousePosition:B??n,onClose:e$,closable:eT,closeIcon:eP,transitionName:(0,h.b)(eg,"zoom",e.transitionName),maskTransitionName:(0,h.b)(eg,"fade",e.maskTransitionName),mask:eb,maskClosable:ev,scrollLock:Y,className:(0,s.$)(eC,r,en),style:{...eo,...R,...eW},classNames:{...eL,wrapper:(0,s.$)(eL.wrapper,ek)},styles:eD,panelRef:ej,destroyOnHidden:W??q,modalRender:eO,focusTriggerAfterClose:ex.focusTriggerAfterClose,focusTrap:ex.trap},j?o.createElement(x.A,{active:!0,title:!1,paragraph:{rows:4},className:`${eh}-body-skeleton`}):F)))}},5688:(e,t,r)=>{"use strict";r.d(t,{b:()=>o});let n=e=>({animationDuration:e,animationFillMode:"both"}),o=(e,t,r,o,a=!1)=>{let i=a?"&":"";return{[`
|
|
5
5
|
${i}${e}-enter,
|
|
6
6
|
${i}${e}-appear
|
|
7
7
|
`]:{...n(o),animationPlayState:"paused"},[`${i}${e}-leave`]:{...n(o),animationPlayState:"paused"},[`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[790],{38977:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>eJ});var r=n(65321),l=n(97109),i=n(3454),a=n.n(i),o=n(43220),s=n.n(o),c=n(86109),d=n(48399),u=n(17807),h=n(42700),p=n(32941),m=n(33442),x=n(85114),g=n(25258),v=n(11702),f=n(85493),y=n(99811),j=n(6578),A=n(39507),b=n(93533),w=n(8090);function k(e){let{readings:t}=e,n=null==t?void 0:t.contractQuality;if(!n)return(0,r.jsx)("div",{role:"status",children:"七维评价尚未产出。"});let l=n.score,i=null==t?void 0:t.contractQualityStale;return Array.isArray(l.defects)?(0,r.jsxs)("div",{"aria-label":"七维评价",style:{fontSize:12,lineHeight:1.8},children:[(0,r.jsx)("strong",{children:i?"编辑前的历史七维诊断":"七维专业诊断"}),(0,r.jsxs)("span",{children:[";",i?"当前正文须重新评价":l.deliveryReady?"适用职责核验满足,待专业验收":"仍有缺陷或待核事项"]}),(0,r.jsxs)("div",{children:["阻断 ",l.blocking.length," 项;按根因归并的问题 ",l.defects.length," 项。专业档位不换算为未经标定的百分分数。"]}),i&&(0,r.jsx)("div",{children:i.reason}),(0,r.jsxs)("details",{children:[(0,r.jsx)("summary",{children:"查看七个维度"}),(0,r.jsxs)("table",{style:{width:"100%"},children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"维度"}),(0,r.jsx)("th",{children:"质量档位"}),(0,r.jsx)("th",{children:"满足 / 未满足 / 未判定"})]})}),(0,r.jsx)("tbody",{children:l.dimensions.map(e=>(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:e.label}),(0,r.jsx)("td",{children:"not-applicable"===e.status?"不适用":e.qualityLabel}),(0,r.jsxs)("td",{children:[e.verification.met," / ",e.verification.failed," / ",e.verification.unmeasured]})]},e.id))})]}),(0,r.jsx)("div",{children:n.expertValidated?"已完成专家校准。":"尚未完成专家校准。"})]})]}):(0,r.jsx)("div",{role:"status",children:"历史评价回执保留;按当前专业诊断口径重新评价后显示核验与质量档位。"})}let{Paragraph:S,Text:I}=d.A;function C(e){return new Date(e).toLocaleString()}function z(e){var t,n,i;let{status:a,title:o,html:s,source:c,truncated:d,totalChars:u,renderedChars:p,stats:g,gate:y,loading:j,error:A,onRetry:b,updatedAt:z,generatedAt:R,className:N,t:E,deliveryReadings:T}=e,M=null!=s?s:"",L=M.trim().length>0,D=g?function(e){let t=[];return e.droppedDangerousBlocks>0&&t.push("删除了 ".concat(e.droppedDangerousBlocks," 处可执行/可加载内容(脚本、样式、内嵌页面等)")),e.blockedUrls>0&&t.push("拦截了 ".concat(e.blockedUrls," 个协议不安全的链接(如 javascript: / data:)")),e.escapedTags>0&&t.push("转义了 ".concat(e.escapedTags," 个不支持的标签(原文里的原始 HTML 会以文字显示)")),e.droppedAttributes>0&&t.push("剥离了 ".concat(e.droppedAttributes," 个属性(样式、事件、非白名单属性)")),e.droppedComments>0&&t.push("删除了 ".concat(e.droppedComments," 处注释/声明")),t}(g):[],[P,B]=(0,l.useState)(!1),q=null!=(t=null==y?void 0:y.issues)?t:[],H=q.length>5,_=P?q:q.slice(0,5),W=q.length-_.length,F=W+(null!=(n=null==y?void 0:y.truncatedCount)?n:0),U=(0,r.jsxs)("div",{className:"deliverablePreviewMeta",children:[o&&(0,r.jsx)(I,{strong:!0,style:{fontSize:15},children:o}),a&&(0,r.jsx)(v.A,{color:(0,w.uj)(a),children:(0,w.GC)(a,E)}),c&&(0,r.jsx)(I,{type:"secondary",style:{fontSize:12},children:"预览正文:".concat("editedMarkdown"===c?"编辑后的正文(以它为准)":"markdown"===c?"记录里的正文(markdown 字段)":"draft"===c?"生成时的草案正文(draft.markdown)":"none"===c?"没有正文":"未识别的正文来源(".concat(c,")"))}),R?(0,r.jsx)(I,{type:"secondary",style:{fontSize:12},children:"生成于 ".concat(C(R))}):null,z?(0,r.jsx)(I,{type:"secondary",style:{fontSize:12},children:"更新于 ".concat(C(z))}):null]}),G=q.length>0&&(0,r.jsxs)("div",{style:{fontSize:12.5,lineHeight:1.8},children:[_.map((e,t)=>(0,r.jsxs)("div",{children:["\xb7 ",e]},"".concat(t,"-").concat(e.slice(0,12)))),F>0&&(0,r.jsx)("div",{children:"…还有 ".concat(F," 项未列出").concat(W>0&&(null!=(i=null==y?void 0:y.truncatedCount)?i:0)>0?"(服务端只下发了 ".concat(q.length," 项)"):"")}),H&&(0,r.jsx)(x.Ay,{type:"link",size:"small",style:{paddingInline:0},onClick:()=>B(e=>!e),children:P?"收起阻断项":"展开全部 ".concat(q.length," 项")})]}),Q=y?(0,r.jsx)(f.A,{style:{width:"100%"},type:y.passed?"success":"warning",showIcon:!0,message:y.passed?"交付门禁:通过":"交付门禁:阻断 ".concat(y.blockingCount," 项"),description:(0,r.jsxs)(m.A,{direction:"vertical",size:4,style:{width:"100%"},children:[(0,r.jsx)(I,{type:"secondary",style:{fontSize:12},children:"能否导出由服务端判定;此处仅供查看。"}),G]})}):(0,r.jsx)(f.A,{style:{width:"100%"},type:"info",showIcon:!0,message:"尚无交付门禁结论(生成中或尚未完成)——这不代表已通过。"});return(0,r.jsx)("div",{className:null!=N?N:"deliverablePreview",children:(0,r.jsxs)("div",{className:"deliverablePreviewStack",children:[U,(0,r.jsx)(k,{readings:T}),Q,d&&(0,r.jsx)(f.A,{style:{width:"100%"},type:"warning",showIcon:!0,message:"正文过长,预览只渲染了前 ".concat((null!=p?p:0).toLocaleString()," 字(共 ").concat((null!=u?u:0).toLocaleString()," 字)"),description:"后续内容未渲染;导出物是完整正文,不受预览截断影响。"}),D.length>0&&(0,r.jsx)(f.A,{style:{width:"100%"},type:"info",showIcon:!0,message:"预览已对内容做安全处置(与导出物可能存在差异)",description:(0,r.jsx)("div",{style:{fontSize:12,lineHeight:1.7},children:D.map(e=>(0,r.jsxs)("div",{children:["\xb7 ",e]},e))})}),j&&(0,r.jsxs)(m.A,{align:"center",size:8,children:[(0,r.jsx)(h.A,{size:"small"}),(0,r.jsx)(I,{type:"secondary",children:"正在取回成稿预览(服务端渲染 + 清洗)…"})]}),!j&&A&&(0,r.jsx)(f.A,{style:{width:"100%"},type:"error",showIcon:!0,message:"取回成稿预览失败",description:(0,r.jsxs)(m.A,{direction:"vertical",size:6,children:[(0,r.jsx)(I,{style:{fontSize:12},children:A}),b&&(0,r.jsx)(x.Ay,{size:"small",onClick:b,children:"重新取回"})]})}),!j&&!A&&!L&&(0,r.jsx)(f.A,{style:{width:"100%"},type:"info",showIcon:!0,message:"这条记录还没有可预览的正文",description:"生成完成后这里会显示成稿全文;生成中的记录只有节点日志(见画布),没有正文可预览。"}),!A&&L&&(0,r.jsxs)("div",{className:"deliverablePreviewPaper",children:[(0,r.jsx)("article",{className:"deliverablePreviewBody","aria-label":"成稿预览正文",dangerouslySetInnerHTML:{__html:M}}),(0,r.jsxs)("div",{className:"deliverablePreviewEnd",children:[(0,r.jsx)(I,{type:"secondary",style:{fontSize:12},children:d?"正文到此为止(预览有截断,见上方提示;导出物是完整正文)":p&&p>0?"正文到此为止:以上是本记录的全部正文,共 ".concat(p.toLocaleString()," 字(未截断)"):"正文到此为止:以上是本记录的全部正文(未截断)"}),y&&!y.passed&&(0,r.jsx)(I,{style:{fontSize:12,color:"var(--colorWarning)"},children:"交付门禁未通过(阻断 ".concat(y.blockingCount," 项)——正文在这里结束并不代表成稿完整,缺什么见上方的阻断项清单。")})]})]}),!A&&L&&(0,r.jsx)(S,{type:"secondary",style:{fontSize:12,marginBottom:0,textAlign:"center"},children:"预览为服务端渲染结果;排版细节(字体、页眉页脚、分页)以导出物为准。"})]})})}let R=new Set(["prepare","understand","plan","blueprint"]),N=new Set(["close","deliver"]),E=new Set(["chapter","write"]);function T(e,t){let n=new Map;for(let t of e){if(void 0===t.parentId)continue;let e=n.get(t.parentId);e?e.push(t.id):n.set(t.parentId,[t.id])}let r=new Set([t]),l=[t],i=[];for(;l.length>0;){var a;let e=l.shift();for(let t of(i.push(e),null!=(a=n.get(e))?a:[]))r.has(t)||(r.add(t),l.push(t))}return i}function M(e,t){var n;let r=new Map(e.map(e=>[e.id,e])),l=r.get(t);if(!l)return;let i=T(e,t),a=e.map(e=>e.id).sort();if(R.has(l.type))return{targetNodeId:t,kind:"contaminated",affectedNodeIds:a,reason:"".concat(l.type," 承载事实 / 命名 / 标题指纹 → 11.1:跨文档污染,**不可回滚**(要么回滚,要么重新校准)"),escalate:a.length>5,rollbackable:!1};let o=(n=l.type).split(".")[0]||n;if(N.has(l.type)||N.has(o))return{targetNodeId:t,kind:"propagated",affectedNodeIds:a,reason:"".concat(l.type," 属全篇收口 / 交付层 → 预算守恒与全量判据复检波及整篇(11.1)"),escalate:a.length>5,rollbackable:!0};if(E.has(l.type)||"round"===o){let n=function(e,t,n){let r=new Set([t]),l=e.get(t);for(;l;){if(n(l))return l;let t=l.parentId;if(void 0===t||r.has(t))break;r.add(t),l=e.get(t)}}(r,t,e=>E.has(e.type)),i=n?T(e,n.id):a;return{targetNodeId:t,kind:"propagated",affectedNodeIds:i,reason:n?"".concat(l.type," 在章级锚点「").concat(n.title||n.id,"」内 → 跨章数值一致性 / 复读 / 依据对账(11.1)波及同章其余部分"):"".concat(l.type," 无章级锚点 → 按整篇保守估算(11.1)"),escalate:i.length>5,rollbackable:!0}}return{targetNodeId:t,kind:"local",affectedNodeIds:i,reason:"".concat(l.type," 属定点补丁层(11.5:确定性处理节点)→ 影响面限自身子树"),escalate:i.length>5,rollbackable:!0}}function L(e){let t=Math.max(18,Math.abs(e.y2-e.y1)/2);return"M ".concat(e.x1," ").concat(e.y1," C ").concat(e.x1," ").concat(e.y1+t,", ").concat(e.x2," ").concat(e.y2-t,", ").concat(e.x2," ").concat(e.y2)}let D={default:"canvasEdge",active:"canvasEdge canvasEdgeActive",warn:"canvasEdge canvasEdgeWarn",affected:"canvasEdge canvasEdgeAffected"},P={default:"url(#canvasArrow)",active:"url(#canvasArrowActive)",warn:"url(#canvasArrowWarn)",affected:"url(#canvasArrow)"};function B(e){let{edge:t,tone:n="default"}=e;return(0,r.jsx)("path",{className:D[n],d:L(t),markerEnd:P[n],"data-edge":"".concat(t.fromId,"->").concat(t.toId)})}function q(e){let{edges:t,width:n,height:l,toneOf:i,flowing:a,style:o}=e;return(0,r.jsxs)("svg",{className:"canvasEdgeLayer",width:Math.max(1,n),height:Math.max(1,l),viewBox:"0 0 ".concat(Math.max(1,n)," ").concat(Math.max(1,l)),"aria-hidden":"true",focusable:"false",style:o,children:[(0,r.jsxs)("defs",{children:[(0,r.jsx)("marker",{id:"canvasArrow",markerWidth:"8",markerHeight:"8",refX:"7",refY:"4",orient:"auto",markerUnits:"strokeWidth",children:(0,r.jsx)("path",{d:"M0,0 L8,4 L0,8 z",fill:"var(--canvasEdge)"})}),(0,r.jsx)("marker",{id:"canvasArrowActive",markerWidth:"8",markerHeight:"8",refX:"7",refY:"4",orient:"auto",markerUnits:"strokeWidth",children:(0,r.jsx)("path",{d:"M0,0 L8,4 L0,8 z",fill:"var(--canvasEdgeActive)"})}),(0,r.jsx)("marker",{id:"canvasArrowWarn",markerWidth:"8",markerHeight:"8",refX:"7",refY:"4",orient:"auto",markerUnits:"strokeWidth",children:(0,r.jsx)("path",{d:"M0,0 L8,4 L0,8 z",fill:"var(--canvasEdgeWarn)"})})]}),t.map(e=>{var t;return(0,r.jsxs)("g",{children:[(0,r.jsx)(B,{edge:e,tone:null!=(t=null==i?void 0:i(e))?t:"default"}),(null==a?void 0:a.has(e.id))&&(0,r.jsx)("path",{className:"canvasEdgeFlow",d:L(e),"data-flow":"".concat(e.fromId,"->").concat(e.toId)})]},e.id)})]})}let H=new Set(["completed","failed","skipped"]),_=[{key:"chars",unit:" 字"},{key:"words",unit:" 字"},{key:"noteChars",unit:" 字"},{key:"turn",unit:" 轮",prefix:"第 "},{key:"chapters",unit:" 章"},{key:"facts",unit:" 条事实"},{key:"evidence",unit:" 条证据"},{key:"issues",unit:" 个问题"},{key:"toolCalls",unit:" 次工具调用"},{key:"totalFiles",unit:" 份资料"},{key:"totalChunks",unit:" 个切片"},{key:"roundIteration",unit:" 轮修复",prefix:"第 "}];function W(e){var t;let n=null==(t=e.metrics)?void 0:t.note;return"string"==typeof n&&n.trim()?n.trim():void 0}function F(e,t){let{input:n,output:r}=function(e){let t=e=>"string"==typeof e&&e.trim()?e.trim():void 0;return{input:t(e.inputSummary),output:t(e.outputSummary)}}(e);for(let l of"dispatch"===t?[n,W(e),e.title]:[r,W(e),e.title,function(e){var t;let n=null!=(t=e.metrics)?t:{},r=[];for(let{key:e,unit:t,prefix:l}of _){let i=n[e];if(("number"==typeof i||"string"==typeof i)&&""!==i&&0!==i&&(r.push("".concat(null!=l?l:"").concat("number"==typeof i?i.toLocaleString():i).concat(t)),2===r.length))break}return r.length>0?r.join(" \xb7 "):void 0}(e)])if(l&&l.trim())return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:24,n=e.replace(/\s+/gu," ").trim();return n.length>t?"".concat(n.slice(0,t-1),"…"):n}(l)}function U(e){let{bubbles:t,layout:n,static:l=!1}=e;return 0===t.length?null:(0,r.jsx)("div",{className:"canvasBubbleLayer",style:{width:Math.max(1,n.width),height:Math.max(1,n.height)},"aria-hidden":"true",children:t.map(e=>{let t=function(e,t){let n=t.edges.find(t=>t.fromId===e.fromId&&t.toId===e.toId);if(n)return L(n);let r=t.edges.find(t=>t.fromId===e.toId&&t.toId===e.fromId);return r?function(e){let t=L(e),n=/^M ([\d.-]+) ([\d.-]+) C ([\d.-]+) ([\d.-]+), ([\d.-]+) ([\d.-]+), ([\d.-]+) ([\d.-]+)$/u.exec(t);if(!n)return t;let[,r,l,i,a,o,s,c,d]=n;return"M ".concat(c," ").concat(d," C ").concat(o," ").concat(s,", ").concat(i," ").concat(a,", ").concat(r," ").concat(l)}(r):null}(e,n);return t?(0,r.jsx)("div",{className:l?"canvasBubble canvasBubbleStatic":"canvasBubble","data-kind":e.kind,"data-from":e.fromId,"data-to":e.toId,style:{offsetPath:'path("'.concat(t,'")'),offsetRotate:"0deg",animationDuration:"".concat(1500,"ms")},children:(0,r.jsx)("span",{className:"canvasBubbleBody",children:(0,r.jsx)("span",{className:"canvasBubbleText",children:e.label})})},e.id):null})})}var G=n(94394);function Q(e){return"stage-details"===e.source}let O=new Set(["running","repairing"]),X=new Set(["role_binding","knowledge_retrieval","file_understanding","fact_extraction","chapter_generation","llm_review","validation","reference"]);function V(e){var t;return X.has(e)?null!=(t=G.i_[e])?t:e:(0,w.z9)(e)}function J(e,t){var n;let r=null==(n=e.metrics)?void 0:n[t];return"string"==typeof r&&r.trim()?r.trim():void 0}function Y(e,t,n){var r;let l=function(e){var t;let n=null==(t=e.metrics)?void 0:t.stageType;return"string"==typeof n&&n.trim()?n.trim():e.type.split(".")[0]||"default"}(e),i=null!=(r=J(e,"stageSubtitle"))?r:J(e,"stageRoleId"),a=J(e,"note");return{id:e.id,kind:l,kindLabel:V(l),...i&&i!==e.title?{role:i}:{},title:e.title||V(l),...a?{activity:a}:{},status:e.status,..."number"==typeof e.startedAt?{startedAt:e.startedAt}:{},..."number"==typeof e.completedAt?{completedAt:e.completedAt}:{},metrics:(0,w.dB)(e.metrics,8),depth:t}}function K(e,t){if("number"==typeof e.startedAt)return Math.max(0,("number"==typeof e.completedAt?e.completedAt:t)-e.startedAt)}var $=n(46758),Z=n(99605);let{Text:ee}=d.A,et=["error","warning","info"],en={error:"#ff4d4f",warning:"#faad14",info:"#1677ff"};function er(e){let{node:t,x:n,y:i,selected:a,affected:o,flashed:s,onSelect:c,onDrag:d,t:u}=e,h=function(e){let t=[],n=[];for(let r of e.issues)(Q(r)?n:t).push(r);return{problems:t,details:n,counts:{error:t.filter(e=>"error"===e.level).length,warning:t.filter(e=>"warning"===e.level).length,info:t.filter(e=>"info"===e.level).length}}}(t),p=(0,w.Jy)(t),m=(0,w.O0)(t.metrics,2),x=(0,l.useRef)(null);return(0,l.useEffect)(()=>()=>{var e;null==(e=x.current)||e.call(x)},[]),(0,r.jsxs)("div",{className:"canvasNode".concat(a?" canvasNodeSelected":"").concat(o?" canvasNodeAffected":"").concat(s?" canvasNodeFlashed":""),style:{left:n,top:i,width:w.zT,height:w.EL},role:"button",tabIndex:0,"aria-label":"节点 ".concat(t.title),"data-node-id":t.id,onClick:e=>{e.stopPropagation(),c(t)},onPointerDown:e=>{var n,r;if(0!==e.button||(e.stopPropagation(),!d||(null==(r=e.target)||null==(n=r.closest)?void 0:n.call(r,"button, a, input, textarea"))))return;let l=e.clientX,i=e.clientY,a=e.pointerId,o=!1,s={dx:0,dy:0},c=e=>{e.pointerId===a&&(s={dx:e.clientX-l,dy:e.clientY-i},!o&&4>Math.abs(s.dx)&&4>Math.abs(s.dy)||(o=!0,d(t,s.dx,s.dy,"move")))},u=e=>{if(e.pointerId===a)document.removeEventListener("pointermove",c),document.removeEventListener("pointerup",u),document.removeEventListener("pointercancel",u),x.current=null,o&&(document.addEventListener("click",e=>{e.stopPropagation(),e.preventDefault()},{capture:!0,once:!0}),d(t,s.dx,s.dy,"end"))};document.addEventListener("pointermove",c),document.addEventListener("pointerup",u),document.addEventListener("pointercancel",u),x.current=()=>{document.removeEventListener("pointermove",c),document.removeEventListener("pointerup",u),document.removeEventListener("pointercancel",u)}},onContextMenu:e=>{e.preventDefault(),e.stopPropagation()},onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),c(t))},children:[(0,r.jsxs)("div",{className:"canvasNodeHeader",children:[(0,r.jsx)("span",{className:"canvasNodeIcon","data-status":t.status,children:(0,w.kH)(t.type)}),(0,r.jsx)(ee,{ellipsis:!0,style:{flex:1,minWidth:0,fontWeight:600,fontSize:13},title:t.title,children:t.title}),et.map(e=>h.counts[e]>0&&(0,r.jsx)("span",{"data-issue-level":e,style:{flexShrink:0},children:(0,r.jsx)($.A,{count:h.counts[e],size:"small",color:en[e]})},e))]}),(0,r.jsxs)("div",{className:"canvasNodeMeta",children:[(0,r.jsx)(v.A,{color:(0,w.uv)(t.status),style:{marginInlineEnd:4},children:(0,w.m_)(t.status,u)}),(0,r.jsx)(ee,{type:"secondary",style:{fontSize:11},ellipsis:!0,children:(0,w.z9)(t.type)})]}),t.progress&&t.progress.total>0?(0,r.jsx)(Z.A,{percent:Math.round(t.progress.current/t.progress.total*100),size:"small",showInfo:!1,status:"failed"===t.status?"exception":"completed"===t.status?"success":"active",style:{marginBottom:0}}):(0,r.jsxs)("div",{className:"canvasNodeMetrics",children:[m.map(e=>(0,r.jsx)(ee,{type:"secondary",style:{fontSize:11},ellipsis:!0,children:e},e)),0===m.length&&(0,r.jsx)(ee,{type:"secondary",style:{fontSize:11},children:(0,w.uH)(p)})]})]})}var el=n(14932),ei=n(55122),ea=n(32965),eo=n(44400),es=n(48156),ec=n(63046),ed=n(64068),eu=n(76830),eh=n(96651),ep=n(83914);function em(e){let{updatedAt:t,running:n}=e,[i,a]=(0,l.useState)(()=>Date.now());if((0,l.useEffect)(()=>{if(!n)return;let e=setInterval(()=>a(Date.now()),5e3);return()=>clearInterval(e)},[n]),!n||!t)return null;let o=Math.max(0,i-t);return o<=9e4?(0,r.jsx)(el.A,{title:"记录每 30 秒刷新一次(最近一次 ".concat(new Date(t).toLocaleTimeString(),")——长阶段里画布可能几分钟没有新节点,这个信号说明进程还在跑"),children:(0,r.jsxs)(v.A,{color:"processing",children:["心跳 ",Math.round(o/1e3)," 秒前"]})}):(0,r.jsx)(el.A,{title:"最后一次进度写入是 ".concat(new Date(t).toLocaleTimeString(),"——超过 ").concat(Math.round(1.5)," 分钟没有动静,进程可能已退出(可「继续生成」续跑)"),children:(0,r.jsxs)(v.A,{color:"warning",children:["心跳已停 ",Math.floor(o/6e4)," 分钟"]})})}function ex(e){let{startedAt:t,endedAt:n,running:i}=e,[a,o]=(0,l.useState)(()=>Date.now());if((0,l.useEffect)(()=>{if(!i)return;let e=setInterval(()=>o(Date.now()),1e3);return()=>clearInterval(e)},[i]),!t)return null;let s=Math.max(0,(i?a:null!=n?n:a)-t);return(0,r.jsx)(el.A,{title:"本轮生成的整体耗时(自 ".concat(new Date(t).toLocaleTimeString()," 起").concat(i?"":",已结束",")"),children:(0,r.jsx)(v.A,{color:"default",children:"耗时 ".concat((0,w.uH)(s))})})}var eg=n(55897),ev=n(49075),ef=n(84742);let{Text:ey}=d.A;function ej(e){var t;let{row:n,now:l,onLocate:i}=e;return(0,r.jsxs)("div",{className:"canvasAgentDetail","data-node-id":n.id,children:[(0,r.jsxs)("div",{className:"canvasAgentDetailHead",children:[(0,r.jsx)("span",{className:"canvasAgentIcon","data-status":n.status,children:(0,w.Qs)(n.kind)}),(0,r.jsx)(ey,{strong:!0,style:{fontSize:12},children:n.kindLabel}),n.role&&(0,r.jsxs)(ey,{type:"secondary",style:{fontSize:12},children:["\xb7 ",n.role]})]}),(0,r.jsxs)("div",{className:"canvasAgentDetailRow",children:[(0,r.jsx)(ey,{type:"secondary",style:{fontSize:12},children:"在干什么"}),(0,r.jsx)(ey,{style:{fontSize:12},children:null!=(t=n.activity)?t:n.title})]}),n.activity&&n.title&&n.activity!==n.title&&(0,r.jsxs)("div",{className:"canvasAgentDetailRow",children:[(0,r.jsx)(ey,{type:"secondary",style:{fontSize:12},children:"对象"}),(0,r.jsx)(ey,{style:{fontSize:12},children:n.title})]}),(0,r.jsxs)("div",{className:"canvasAgentDetailRow",children:[(0,r.jsx)(ey,{type:"secondary",style:{fontSize:12},children:n.completedAt?"耗时":"已跑"}),(0,r.jsx)(ey,{style:{fontSize:12},children:(0,w.uH)(K(n,l))})]}),n.metrics.length>0&&(0,r.jsxs)("div",{className:"canvasAgentDetailRow",children:[(0,r.jsx)(ey,{type:"secondary",style:{fontSize:12},children:"指标"}),(0,r.jsx)(ey,{style:{fontSize:12},children:n.metrics.map(e=>e.text).join(" \xb7 ")})]}),(0,r.jsxs)("button",{type:"button",className:"canvasAgentLocate",onClick:()=>i(n.id),title:"在画布上定位到这条节点",children:[(0,r.jsx)(ev.A,{})," 定位到节点"]})]})}function eA(e){return e.some(e=>"failed"===e.status)?"repairing":"completed"}function eb(e){let{view:t,running:n,onLocate:i,decisions:a=[],active:o=!1}=e,[s,c]=(0,l.useState)(()=>Date.now());if((0,l.useEffect)(()=>{if(!n)return;let e=setInterval(()=>c(Date.now()),1e3);return()=>clearInterval(e)},[n]),0===t.runningTotal&&0===t.recentTotal&&0===a.length&&!o)return null;let d=t.runningTotal-t.running.length;return(0,r.jsxs)(m.A,{size:4,align:"center",wrap:!0,"data-agents":t.runningTotal,className:"canvasAgentsChips",children:[(0,r.jsx)(el.A,{title:"本稿此刻在调度哪些智能体(点图标看在干什么)",children:(0,r.jsx)(ey,{type:"secondary",style:{fontSize:12},children:"智能体调度中心"})}),(o||a.length>0)&&(0,r.jsx)(eg.A,{trigger:"click",placement:"bottomLeft",content:(0,r.jsx)("div",{className:"canvasAgentDetail",children:0===a.length?(0,r.jsx)("div",{className:"canvasAgentDetailRow",children:(0,r.jsx)(ey,{type:"secondary",style:{fontSize:12},children:"尚无来源或任务裁决回执。主智能体负责施工部署、来源与工况核定及作者协调;当前执行进度见运行节点。"})}):a.map(e=>{var t;return(0,r.jsxs)("div",{className:"canvasAgentDetailRow",children:[(0,r.jsx)(ey,{type:"secondary",style:{fontSize:12},children:e.action}),(0,r.jsx)(ey,{style:{fontSize:12},children:null!=(t=e.note)?t:e.title})]},e.id)})}),children:(0,r.jsxs)("button",{type:"button",className:"canvasAgentChip canvasAgentChipMain","data-kind":"supervisor","data-status":eA(a),title:"主智能体:核定施工部署、裁决来源与工况、协调作者任务和交付",children:[(0,r.jsx)("span",{className:"canvasAgentAvatar","data-status":eA(a),children:(0,r.jsx)("span",{className:"canvasAgentAvatarGlyph",children:(0,w.Qs)("supervisor")})}),(0,r.jsx)("span",{className:"canvasAgentRole","data-role":"main",children:"主"})]})}),t.running.map(e=>{var t;return(0,r.jsx)(eg.A,{trigger:"click",placement:"bottomLeft",content:(0,r.jsx)(ej,{row:e,now:s,onLocate:i}),children:(0,r.jsxs)("button",{type:"button",className:"canvasAgentChip","data-node-id":e.id,"data-kind":e.kind,"data-status":e.status,title:"".concat(e.kindLabel).concat(e.role?" \xb7 ".concat(e.role):"",":").concat(null!=(t=e.activity)?t:e.title),children:[(0,r.jsx)("span",{className:"canvasAgentAvatar","data-status":e.status,children:(0,r.jsx)("span",{className:"canvasAgentAvatarGlyph",children:(0,w.Qs)(e.kind)})}),(0,r.jsx)("span",{className:"canvasAgentRole","data-role":"sub",title:"子智能体(执行具体环节)",children:"子"})]})},e.id)}),d>0&&(0,r.jsx)(el.A,{title:"另有 ".concat(d," 个在跑(画布上可逐个查看)"),children:(0,r.jsxs)(ey,{type:"secondary",style:{fontSize:12},children:["+",d]})}),t.recent.length>0&&(0,r.jsx)(el.A,{title:t.recent.map(e=>"".concat(e.kindLabel,":").concat(e.title,"(已完成)")).join("\n"),children:(0,r.jsxs)(ey,{type:"secondary",style:{fontSize:12},children:[(0,r.jsx)(ef.A,{})," 刚完成 ",t.recentTotal]})})]})}var ew=n(34052),ek=n(84253),eS=n(96538);function eI(e){let{reports:t,deliveryReadings:n,t:i}=e,[a,o]=(0,l.useState)(!1),s=(e,t)=>{let n=null==i?void 0:i(e);return n&&n!==e?n:t},c=(0,l.useSyncExternalStore)(j.p5,j.dH,j.dH),d=c?function(e,t){var n,r;let{receipt:l}=e,i=(e,n,r,l)=>t(e,n).replace("{count}",String(r))+(l?":".concat(l):""),a=[];"review"===l.exportPurpose&&a.push({key:"review-purpose",tone:"info",text:"审阅稿:验收结论保持原状态,独立问题报告与正文版本绑定"}),l.issuesReport&&a.push({key:"review-report",tone:"info",text:"独立问题报告:".concat(l.issuesReport.id.slice(0,12),";正文 SHA256:").concat(l.issuesReport.bodySha256)}),"mismatch"===l.gateBinding?a.push({key:"binding-mismatch",tone:"error",text:t("records.receiptBindingMismatch","正文与门禁指纹不匹配:放行依据不是这份正文(收口后被编辑/替换过)")}):"absent"===l.gateBinding&&a.push({key:"binding-absent",tone:"warning",text:t("records.receiptBindingAbsent","门禁未绑定正文指纹:无法核对放行依据是否就是这份正文")}),l.gateIssues&&l.gateIssues.length>0&&a.push({key:"gate-issues",tone:"error",text:i("records.receiptGateIssues","门禁阻断清单 {count} 项",l.gateIssues.length,l.gateIssues[0])}),l.contentIssues&&l.contentIssues.length>0&&a.push({key:"content-issues",tone:"warning",text:i("records.receiptContentIssues","内容问题 {count} 条",l.contentIssues.length,l.contentIssues[0])});let o=null!=(r=null==(n=l.figureInline)?void 0:n.failed)?r:[];return o.length>0&&a.push({key:"figure-inline",tone:"warning",text:i("records.receiptFigureFailures","图件未内联 {count} 张",o.length,o[0])}),l.renderAudit&&l.renderAudit.blockerCount>0&&a.push({key:"render-blockers",tone:"error",text:i("records.receiptRenderBlockers","渲染审计:源层结构缺陷 {count} 项",l.renderAudit.blockerCount)}),l.renderAudit&&l.renderAudit.notices.length>0&&a.push({key:"render-notices",tone:"warning",text:i("records.receiptRenderNotices","渲染审计告警 {count} 条",l.renderAudit.notices.length,l.renderAudit.notices[0])}),l.templateWarning&&a.push({key:"template-warning",tone:"warning",text:"".concat(t("records.receiptTemplateWarning","模板占位符缺失,已回退:")).concat(l.templateWarning)}),l.pageLimit&&a.push({key:"page-limit",tone:"warning",text:l.pageLimit}),"number"==typeof l.pdfPageCount&&a.push({key:"pdf-pages",tone:"info",text:t("records.receiptPdfPages","PDF 共 {count} 页").replace("{count}",String(l.pdfPageCount))}),a}(c,s):[],u=d.filter(e=>"info"!==e.tone),h=d.length>0;if(0===t.length&&!n&&0===u.length&&!(null==c?void 0:c.receipt.issuesReport)&&(null==c?void 0:c.receipt.exportPurpose)!=="review")return null;let p=[...t].sort((e,t)=>t.exportedAt-e.exportedAt),m=p.find(e=>{var t,n;return(null!=(n=null==(t=e.gateChecklist)?void 0:t.items.length)?n:0)>0});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(el.A,{title:s("records.reportTitle","导出闭环报告"),children:(0,r.jsxs)(x.Ay,{size:"small",icon:(0,r.jsx)(eu.A,{}),onClick:()=>o(!0),children:[(null==n?void 0:n.contractQuality)?"七维诊断".concat(n.contractQualityStale?"(历史)":n.contractQuality.score.deliveryReady?"(待验收)":"(待修验)"):s("records.reportEntry","导出报告"),t.length>0&&(0,r.jsx)("span",{className:"ml-1 text-[var(--colorTextTertiary)]",children:t.length}),u.length>0&&(0,r.jsx)(v.A,{color:u.some(e=>"error"===e.tone)?"error":"warning",className:"m-0 ml-1 border-0",children:s("records.receiptBadge","本次导出 {count} 项提醒").replace("{count}",String(u.length))})]})}),(0,r.jsxs)(ew.A,{title:s("records.reportTitle","导出闭环报告"),placement:"right",size:"default",open:a,onClose:()=>o(!1),styles:{body:{padding:16}},children:[h&&c&&(0,r.jsxs)("div",{className:"mb-3 rounded-xl border px-3 py-2.5 text-xs ".concat(u.length>0?"border-[var(--colorWarning)] bg-[var(--colorWarningBg)]":"border-[var(--borderColor)] bg-[var(--colorFillAlter)]"),children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,r.jsx)("span",{className:"font-semibold",children:s("records.receiptTitle","最近一次导出回执")}),(0,r.jsx)(v.A,{color:"blue",className:"m-0 border-0 font-semibold",children:c.format.toUpperCase()}),(0,r.jsx)("span",{className:"text-[var(--colorTextTertiary)]",children:new Date(c.at).toLocaleString()}),c.filename&&(0,r.jsx)("span",{className:"break-all text-[var(--colorTextTertiary)]",children:c.filename})]}),c.receipt.issuesReport&&(0,r.jsx)("a",{className:"text-[var(--colorPrimary)] underline",href:(0,j.Es)(c,c.receipt.issuesReport),children:"下载本份正文的独立问题报告"}),(0,r.jsx)("div",{className:"mt-2 flex flex-col gap-1.5",children:d.map(e=>(0,r.jsx)("div",{className:"error"===e.tone?"text-[var(--colorError)]":"warning"===e.tone?"text-[var(--colorWarning)]":"text-[var(--colorTextSecondary)]",children:e.text},e.key))})]}),n&&(0,r.jsxs)("div",{className:"mb-3 flex flex-col gap-2 rounded-xl border border-[var(--borderColor)] bg-[var(--colorFillAlter)] px-3 py-2.5 text-xs",children:[n.contractQuality&&(0,r.jsx)(k,{readings:n}),n.netChars&&(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,r.jsx)("span",{className:"text-[var(--colorTextSecondary)]",children:s("records.netCharsLabel","修复链净增字数")}),(0,r.jsxs)("span",{className:"font-semibold",children:[n.netChars.delta>0?"+":"",n.netChars.delta]}),(0,r.jsxs)("span",{className:"text-[var(--colorTextSecondary)]",children:["(",n.netChars.before," → ",n.netChars.after,",",s("records.netCharsRatio","占原稿")," ",(100*n.netChars.ratio).toFixed(1),"%)"]}),n.netChars.ratio>.05&&(0,r.jsx)(el.A,{title:s("records.netCharsWarn",'目标 ≤5%:净增越大,"分是修出来的"成分越高——首过写作的缺口被修复链补上了'),children:(0,r.jsx)(v.A,{color:"warning",className:"m-0 border-0",children:s("records.netCharsOver","超目标")})})]}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,r.jsx)("span",{className:"text-[var(--colorTextSecondary)]",children:s("records.reviewReportLabel","交付三件套报告")}),(0,r.jsx)("a",{href:"/api/documents/generated/".concat(encodeURIComponent(n.docId),"/report").concat(n.projectRoot?"?projectRoot=".concat(encodeURIComponent(n.projectRoot),"&download=1"):"?download=1"),className:"text-[var(--colorPrimary)] underline",children:s("records.reviewReportDownload","下载 .md")}),(0,r.jsx)("a",{href:"/api/documents/generated/".concat(encodeURIComponent(n.docId),"/report").concat(n.projectRoot?"?projectRoot=".concat(encodeURIComponent(n.projectRoot)):""),target:"_blank",rel:"noreferrer",className:"text-[var(--colorPrimary)] underline",children:s("records.reviewReportView","在线查看")}),(0,r.jsx)("span",{className:"text-[var(--colorTextTertiary)]",children:s("records.reviewReportHint","未跑到终门禁的记录没有报告(打开会说明原因)")})]})]}),0===p.length?(0,r.jsx)(ek.A,{image:ek.A.PRESENTED_IMAGE_SIMPLE,description:s("records.reportEmpty","还没有导出记录")}):(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[p.map((e,t)=>(0,r.jsxs)("div",{className:"rounded-xl border border-[var(--borderColor)] bg-[var(--colorFillAlter)] px-3 py-2.5 text-xs",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,r.jsx)(v.A,{color:"blue",className:"m-0 border-0 font-semibold",children:e.format.toUpperCase()}),(0,r.jsx)("span",{className:"text-[var(--colorTextSecondary)]",children:new Date(e.exportedAt).toLocaleString()}),"review"===e.exportPurpose&&(0,r.jsx)(v.A,{children:"审阅稿"}),e.reviewReport&&(0,r.jsx)("a",{className:"text-[var(--colorPrimary)] underline",href:(0,j.Es)({documentId:null==n?void 0:n.docId,projectRoot:null==n?void 0:n.projectRoot},e.reviewReport),children:"下载独立问题报告"})]}),(0,r.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-[var(--colorTextSecondary)]",children:[void 0!==e.durationMs&&(0,r.jsxs)("span",{children:[s("records.reportDuration","总用时")," ",(0,eS.a)(e.durationMs,{unit:"ms",style:"fine-decimal"})]}),void 0!==e.repairedCount&&(0,r.jsxs)("span",{children:[s("records.reportRepaired","修复")," ",e.repairedCount,void 0!==e.blockingCount?"(".concat(s("records.reportBlocking","质量诊断快照阻断")," ").concat(e.blockingCount,")"):""]}),e.ruleSummary&&e.ruleSummary.length>0&&(0,r.jsxs)("span",{children:[s("records.reportRules","规则")," ",e.ruleSummary.length]}),!1===e.gatePassed&&(0,r.jsxs)(v.A,{color:"error",className:"m-0 border-0",children:[s("records.reportGateBlocked","非交付物"),void 0!==e.gateIssueCount&&e.gateIssueCount>0?" \xb7 ".concat(s("records.reportGateBlockedCount","门禁阻断")," ").concat(e.gateIssueCount," ").concat(s("records.reportGateBlockedUnit","项")):" \xb7 ".concat(s("records.reportGateBlockedUnknown","阻断数未记录(清单缺失)"))]}),e.healthAlerts&&e.healthAlerts.length>0&&(0,r.jsxs)(v.A,{color:"warning",className:"m-0 border-0",children:[s("records.reportHealthAlerts","健康告警")," ",e.healthAlerts.length]})]})]},"".concat(e.exportedAt,"-").concat(t))),(null==m?void 0:m.gateChecklist)&&(0,r.jsxs)("div",{className:"rounded-xl border border-[var(--colorWarning)] bg-[var(--colorWarningBg)] px-3 py-2.5",children:[(0,r.jsxs)("div",{className:"text-xs font-semibold text-[var(--colorWarning)]",children:[s("records.reportChecklistTitle","最近一次非交付物导出的未收敛项"),"(",s("records.reportChecklistTotal","共 {count} 项").replace("{count}",String(m.gateChecklist.total)),")"]}),(0,r.jsx)("div",{className:"mt-2 flex flex-col gap-2",children:m.gateChecklist.items.map(e=>(0,r.jsxs)("div",{className:"text-xs",children:[(0,r.jsx)("div",{className:"whitespace-pre-wrap text-[var(--colorText)]",children:"".concat(e.index,".【").concat(e.category,"】").concat(e.problem)}),(0,r.jsxs)("div",{className:"text-[var(--colorTextSecondary)]",children:[e.repairPath,e.detectorId?"|".concat(e.detectorId):""]})]},e.index))})]})]})]})]})}let{Text:eC}=d.A,ez={connecting:{text:"通道连接中",color:"default"},open:{text:"事件通道已连",color:"success"},error:{text:"通道已断(改用增量补差)",color:"warning"},closed:{text:"通道已关闭",color:"default"}};function eR(e){let{title:t,status:n,updatedAt:l,wordCount:i,nodeCount:a,visibleCount:o,hiddenCount:s,degraded:c,skills:d,gate:u,connection:h,lastSeq:p,zoom:g,following:y,followStatus:j,generating:A,resumable:b,exporting:k,nonDeliverableExport:S,onFit:I,onToggleFollow:C,onContinue:z,onPause:R,onResume:N,onAbort:E,onExport:T,exportReports:M,deliveryReadings:L,previewOpen:D,onTogglePreview:P,hasNodeOffsets:B,onResetNodeLayout:q,agents:H,onLocateAgent:_,supervisorDecisions:W,agentsActive:F,startedAt:U,t:G,collapsed:Q=!1,onToggleCollapsed:O}=e,X=A&&!b,V=(0,r.jsxs)("div",{style:{fontSize:12,lineHeight:1.7},children:[(0,r.jsx)("div",{children:"导出当前真实正文供审阅,并下载独立问题报告;不会自动补齐缺章或签发交付验收。"}),(0,r.jsx)("div",{children:"审阅身份标在文件名和回执中,正文不添加诊断、封面或水印。"})]});return Q?(0,r.jsx)("div",{className:"canvasToolbar canvasToolbarCollapsed",children:(0,r.jsxs)("button",{type:"button",className:"canvasToolbarBubble","aria-expanded":!1,"aria-label":"展开画布工具条",onClick:()=>null==O?void 0:O(!1),children:[(0,r.jsx)(eo.A,{}),n&&(0,r.jsx)(v.A,{color:(0,w.uj)(n),className:"m-0",children:(0,w.GC)(n,G)}),(0,r.jsx)(em,{updatedAt:l,running:X}),u&&!u.passed&&(0,r.jsx)(v.A,{color:"error",className:"m-0",children:"门禁 ".concat(u.blockingCount)}),S?(0,r.jsx)(v.A,{color:"processing",className:"m-0",children:"已导出审阅稿"}):null]})}):(0,r.jsxs)("div",{className:"canvasToolbar",children:[(0,r.jsxs)(m.A,{wrap:!0,size:8,align:"center",style:{flex:1,minWidth:0},children:[(0,r.jsx)(eC,{strong:!0,style:{fontSize:14},ellipsis:!0,title:t,children:t}),n&&(0,r.jsx)(v.A,{color:(0,w.uj)(n),children:(0,w.GC)(n,G)}),(0,r.jsxs)(eC,{type:"secondary",style:{fontSize:12},children:[void 0!==i?"".concat(i.toLocaleString()," 字"):""," 已接收 ".concat(a," 个节点,显示 ").concat(o," 个"),s>0?"(未显示 ".concat(s,")"):"",l?" 更新于 ".concat(new Date(l).toLocaleTimeString()):""]}),(0,r.jsx)(em,{updatedAt:l,running:X}),(0,r.jsx)(ex,{startedAt:U,endedAt:l,running:X}),H&&(0,r.jsx)(eb,{view:H,running:H.runningTotal>0,onLocate:null!=_?_:()=>{},...W?{decisions:W}:{},active:!!F}),(0,r.jsx)(el.A,{title:"通道游标 seq=".concat(null!=p?p:0,"(断线重连用它补发;节点增量用日志时间 t)"),children:(0,r.jsx)(v.A,{color:ez[h].color,children:ez[h].text})}),d.hits.length>0&&(0,r.jsx)(el.A,{title:d.hits.map(e=>"".concat(e.title,"(").concat(e.skillId,")")).join("、"),children:(0,r.jsxs)(v.A,{color:"blue",children:["技能命中 ",d.hits.length]})}),u&&(0,r.jsx)(el.A,{title:u.issues.length>0?u.issues.join("\n"):"服务端门禁结论:通过",children:(0,r.jsx)(v.A,{color:u.passed?"success":"error",children:u.passed?"门禁:通过":"门禁:阻断 ".concat(u.blockingCount," 项")})})]}),(0,r.jsxs)(m.A,{wrap:!0,size:6,align:"center",children:[(0,r.jsxs)(eC,{type:"secondary",style:{fontSize:12,width:44,textAlign:"center"},children:[Math.round(100*g),"%"]}),(0,r.jsx)(el.A,{title:B?"把拖过的节点放回自动排布(手工摆放的是**偏移**,清空即恢复)":"没有手工拖过的节点:布局就是自动排布的",children:(0,r.jsx)(x.Ay,{size:"small",disabled:!B,onClick:q,children:"恢复布局"})}),(0,r.jsx)(el.A,{title:"适应窗口(按内容包围盒缩放)",children:(0,r.jsx)(x.Ay,{size:"small",onClick:I,children:"适应"})}),(0,r.jsx)(el.A,{title:null!=j?j:"跟随最新:生成中新出现的节点自动定位(关掉就不再打扰你的视角)",children:(0,r.jsx)(x.Ay,{size:"small",type:y?"primary":"default",onClick:C,children:y?(null==j?void 0:j.startsWith("跟随暂停"))?"跟随暂停中":"跟随中":"跟随最新"})}),(0,r.jsx)(ei.A,{type:"vertical"}),X&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(el.A,{title:"立即取消模型调用并保存已完成正文,停稳后可继续",children:(0,r.jsx)(x.Ay,{size:"small",icon:(0,r.jsx)(es.A,{}),onClick:R,children:"暂停"})}),(0,r.jsx)(ea.A,{title:"中止生成",description:"确定中止本次生成?已生成的章节会保留,可从中断处继续。",okText:"中止",cancelText:"取消",okButtonProps:{danger:!0},onConfirm:E,children:(0,r.jsx)(x.Ay,{size:"small",danger:!0,icon:(0,r.jsx)(ec.A,{}),children:"中止"})})]}),!X&&b&&(0,r.jsx)(x.Ay,{size:"small",type:"primary",icon:(0,r.jsx)(ed.A,{}),onClick:z,children:"继续生成"}),!X&&!b&&"paused"===n&&(0,r.jsx)(x.Ay,{size:"small",type:"primary",icon:(0,r.jsx)(ed.A,{}),onClick:N,children:"从暂停处继续"}),(0,r.jsx)(ei.A,{type:"vertical"}),(0,r.jsx)(el.A,{title:V,children:(0,r.jsxs)(m.A,{size:4,children:[(0,r.jsx)(eC,{type:"secondary",children:"审阅导出"}),[{key:"markdown",label:"MD"},{key:"html",label:"HTML"},{key:"docx",label:"DOCX"},{key:"pdf",label:"PDF",primary:!0}].map(e=>(0,r.jsx)(x.Ay,{size:"small",type:e.primary?"primary":"default",icon:"markdown"===e.key?(0,r.jsx)(eu.A,{}):void 0,loading:k===e.key,disabled:null!==k&&k!==e.key,onClick:()=>T(e.key),children:e.label},e.key))]})}),(0,r.jsx)(eI,{reports:null!=M?M:[],...L?{deliveryReadings:L}:{},...G?{t:G}:{}}),(0,r.jsx)(el.A,{title:"成稿预览(服务端渲染并清洗后的全文;只读,不提供导出)",children:(0,r.jsx)(x.Ay,{size:"small",type:D?"primary":"default",onClick:P,children:"成稿预览"})}),(0,r.jsx)(el.A,{title:"收起工具条(把画布还给内容;状态与门禁仍留在气泡上)",children:(0,r.jsx)(x.Ay,{size:"small",icon:(0,r.jsx)(eh.A,{}),"aria-label":"收起工具条",onClick:()=>null==O?void 0:O(!0)})})]}),S&&(0,r.jsx)(f.A,{style:{width:"100%",marginTop:8},type:"info",showIcon:!0,message:"已导出审阅稿与独立问题报告",description:(0,r.jsxs)("div",{style:{whiteSpace:"pre-wrap",fontSize:12},children:[(0,r.jsx)("div",{children:"正文保留实际内容;审阅导出不代表交付验收通过。"}),S.count>0&&(0,r.jsxs)("div",{style:{marginTop:4},children:["阻断项(".concat(S.count,"):"),S.issues.slice(0,5).map((e,t)=>(0,r.jsxs)("div",{children:["\xb7 ",e]},t)),S.count>5&&(0,r.jsx)("div",{children:"…还有 ".concat(S.count-5," 项")})]})]})}),c.length>0&&(0,r.jsx)(f.A,{style:{width:"100%",marginTop:8},type:"warning",showIcon:!0,message:"画布显示有取整(下列内容本次未下发;聚合值与节点信息不受影响)",description:(0,r.jsx)("div",{style:{fontSize:12},children:c.map((e,t)=>(0,r.jsxs)("div",{children:["\xb7 ",e]},t))})}),0===a&&A&&(0,r.jsx)(f.A,{style:{width:"100%",marginTop:8},type:"info",showIcon:!0,icon:(0,r.jsx)(ep.A,{}),message:"还没有节点日志:生成侧尚未写入第一个节点(节点日志是唯一真相源,画布不伪造占位节点)"})]})}var eN=n(57481),eE=n(28629),eT=n(52057),eM=n(8665),eL=n(38332),eD=n(7576),eP=n(58569),eB=n(76506),eq=n(45042);let{Paragraph:eH,Text:e_}=d.A,eW={local:{text:"影响面:局部",color:"blue",hint:"改动只落在该节点自身子树:定点补丁即可。"},propagated:{text:"影响面:传播",color:"orange",hint:'改动会沿依赖传播到同章其余部分:按 11.1,走"变更传播"而不是重跑整个节点。'},contaminated:{text:"影响面:事实/命名类",color:"red",hint:"该节点持有事实 / 命名 / 标题指纹:按 11.1,**要么回滚、要么重新校准**,不能当普通改动提交。"}},eF={error:{color:"red",text:"错误"},warning:{color:"orange",text:"警告"},info:{color:"blue",text:"提示"}};function eU(e){var t,n,i,a,o,s,c,d,u,h,p;let{node:g,impact:f,flatNodes:y,highlighted:j,generating:A,repairPreview:b,onFocusNode:k,onRequestRepair:S,onClose:I,onDraftRepairNote:C,onCancelRepairPreview:z,onMention:R,onLocate:N,onPause:E,onResume:T,nodeEvents:M,t:L,onRunRepair:D,onConfirmRepair:P,onRollbackRepair:B,repairRun:q,defaultRepairNote:H}=e,_="skill.load"===g.type||"string"==typeof g.metrics.skillId,W=new Map(y.map(e=>[e.id,e])),F=(0,w.Jy)(g),U=(0,w.dB)(g.metrics,24),G=g.issues.filter(e=>!Q(e)),O=g.issues.filter(e=>Q(e)),X=G.filter(e=>"error"===e.level).length,V=f?(0,r.jsxs)(m.A,{direction:"vertical",size:8,style:{width:"100%"},children:[(0,r.jsxs)(m.A,{wrap:!0,children:[(0,r.jsx)(v.A,{color:eW[f.kind].color,children:eW[f.kind].text}),(0,r.jsx)(v.A,{color:f.rollbackable?"default":"red",children:f.rollbackable?"可回滚":"需回滚或重新校准"}),(0,r.jsx)(v.A,{color:f.escalate?"red":"default",children:"波及 ".concat(f.affectedNodeIds.length," 节点").concat(f.escalate?"(超阈值)":"")})]}),(0,r.jsx)(e_,{type:"secondary",style:{fontSize:12},children:f.reason}),(0,r.jsx)(e_,{type:"secondary",style:{fontSize:12},children:eW[f.kind].hint}),f.escalate&&(0,r.jsx)(v.A,{color:"red",children:"影响面超出阈值:该改动需**人工确认**后才能提交(自动留痕不再适用)"}),(0,r.jsx)(eL.A,{size:"small",header:(0,r.jsx)(e_,{type:"secondary",style:{fontSize:12},children:"波及节点(点击定位)"}),dataSource:f.affectedNodeIds,renderItem:e=>{let t=W.get(e);return(0,r.jsx)(eL.A.Item,{style:{paddingBlock:4},children:(0,r.jsx)(x.Ay,{type:"link",size:"small",style:{padding:0,height:"auto"},onClick:()=>k(e),children:t?"".concat(t.title,"(").concat((0,w.z9)(t.type),")"):"未知节点 ".concat(e)})})}})]}):(0,r.jsxs)(m.A,{direction:"vertical",size:6,children:[(0,r.jsx)(ek.A,{image:ek.A.PRESENTED_IMAGE_SIMPLE,description:"该节点没有预计算的影响面"}),(0,r.jsx)(e_,{type:"secondary",style:{fontSize:12},children:"聚合接口只对**有问题的节点**与**修复节点**预计算影响面(首屏不做 O(n\xb2))。 这里可以按需触发一次修复请求,服务端会在事务前给出权威判定——**本面板不冒充结论**。"}),(0,r.jsx)(x.Ay,{size:"small",disabled:!S,onClick:()=>null==S?void 0:S(g),children:"按需评估影响面(走修复请求)"})]}),[J,Y]=(0,l.useState)("");(0,l.useEffect)(()=>{Y(null!=H?H:"")},[H,g.id]);let K=b&&b.nodeId===g.id?(0,r.jsx)("div",{className:"nodeInfoRepair",children:(0,r.jsxs)(m.A,{direction:"vertical",size:6,style:{width:"100%"},children:[(0,r.jsxs)(m.A,{wrap:!0,size:6,children:[(0,r.jsx)(e_,{strong:!0,style:{fontSize:13},children:"修复影响面预览"}),(0,r.jsx)(v.A,{color:eW[b.impact.kind].color,children:eW[b.impact.kind].text}),(0,r.jsx)(v.A,{color:b.impact.rollbackable?"default":"red",children:b.impact.rollbackable?"可回滚":"不可回滚"})]}),(0,r.jsxs)(e_,{type:"secondary",style:{fontSize:12},children:["波及 ".concat(b.impact.affectedNodeIds.length," 个节点").concat(b.impact.escalate?",超出阈值需人工确认":"","。"),b.impact.reason]}),!b.impact.rollbackable&&(0,r.jsx)(e_,{style:{fontSize:12,color:"var(--colorError)"},children:"11.1:污染类改动**要么回滚、要么重新校准**,不能当普通改动提交。"}),(0,r.jsxs)(m.A,{wrap:!0,size:6,children:[(0,r.jsx)(x.Ay,{size:"small",onClick:C,children:"把修复意图写进输入框"}),(0,r.jsx)(x.Ay,{size:"small",type:"text",onClick:z,children:"收起"})]}),D&&(0,r.jsxs)("div",{className:"nodeInfoRepairRun","data-repair-node":g.id,children:[(0,r.jsx)(e_,{type:"secondary",style:{fontSize:12},children:"修复说明(会逐字记进修复请求;服务端按它定位与归因)"}),(0,r.jsx)(eD.A.TextArea,{size:"small",autoSize:{minRows:2,maxRows:4},value:J,onChange:e=>Y(e.target.value),placeholder:"例如:这一节的开挖深度与资料不符,应按图纸标注 5.15m 改写"}),(0,r.jsxs)(m.A,{wrap:!0,size:6,children:[(0,r.jsx)(x.Ay,{size:"small",type:"primary",loading:(null==q?void 0:q.phase)==="creating"&&q.nodeId===g.id,disabled:0===J.trim().length,onClick:()=>D(J.trim()),children:"发起修复(@本节点)"}),(null==q?void 0:q.nodeId)===g.id&&"confirmable"===q.phase&&P&&!(q.needsLocalization&&(null!=(o=null==(t=q.candidates)?void 0:t.length)?o:0)>0)&&(0,r.jsx)(x.Ay,{size:"small",danger:!0,onClick:()=>P(),children:"确认执行变更事务"}),(null==q?void 0:q.nodeId)===g.id&&"executed"===q.phase&&q.requestId&&B&&(0,r.jsx)(x.Ay,{size:"small",onClick:B,children:"回滚这次修复"})]}),(null==q?void 0:q.nodeId)===g.id&&"creating"!==q.phase&&(0,r.jsxs)("div",{className:"nodeInfoRepairResult",children:["error"===q.phase&&(0,r.jsx)(e_,{style:{fontSize:12,color:"var(--colorError)"},children:"修复请求未建立:".concat(null!=(s=q.message)?s:"")}),"confirmable"===q.phase&&(0,r.jsx)(e_,{type:"secondary",style:{fontSize:12},children:"请求已建立(".concat(null!=(c=q.requestId)?c:"",")").concat(q.attribution?";归因:".concat(q.attribution):"","。")+(q.needsLocalization&&(null!=(d=null==(n=q.candidates)?void 0:n.length)?d:0)>0?"这句话该改哪个节点由你定:下面列出系统定位到的候选,点一个才会执行(缺定位服务端一律拒绝)。":'点「确认执行变更事务」后才会真的改正文——这是"必须人工确认"的落点。')}),"confirmable"===q.phase&&q.needsLocalization&&(null!=(u=null==(i=q.candidates)?void 0:i.length)?u:0)>0&&(0,r.jsx)(m.A,{direction:"vertical",size:4,style:{width:"100%"},children:q.candidates.map(e=>(0,r.jsx)("div",{"data-testid":"repair-location-candidate",children:(0,r.jsxs)(m.A,{size:6,wrap:!0,children:[(0,r.jsx)(v.A,{children:"匹配 ".concat(e.score.toFixed(2))}),(0,r.jsx)(e_,{style:{fontSize:12},children:e.excerpt.slice(0,60)}),P&&(0,r.jsx)(x.Ay,{size:"small",type:"primary",onClick:()=>P(e.nodeId),children:"定位到该节点并执行"})]})},e.nodeId))}),"executed"===q.phase&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(m.A,{wrap:!0,size:6,children:[(0,r.jsx)(v.A,{color:"applied"===q.outcome?"green":"rolled-back"===q.outcome?"orange":"red",children:"执行结果:".concat(null!=(h=q.outcome)?h:"未执行")}),q.attribution&&(0,r.jsx)(v.A,{children:"归因:".concat(q.attribution)}),void 0!==q.restoredChars&&(0,r.jsx)(v.A,{children:"恢复 ".concat(q.restoredChars," 字")})]}),q.notExecutedReason&&(0,r.jsx)(e_,{style:{fontSize:12,color:"var(--colorError)"},children:q.notExecutedReason})]})]})]})]})}):null;return(0,r.jsxs)("div",{className:"nodeInfoPanel","data-node-id":g.id,children:[(0,r.jsxs)("div",{className:"nodeInfoHeader",children:[(0,r.jsx)("span",{className:"nodeInfoHeaderIcon",children:(0,w.kH)(g.type)}),(0,r.jsx)(e_,{strong:!0,ellipsis:!0,style:{flex:1,minWidth:0,fontSize:14},title:g.title,children:g.title}),g.unknownType&&(0,r.jsx)(v.A,{children:"未知类型"}),(0,r.jsx)(v.A,{color:(0,w.uv)(g.status),children:(0,w.m_)(g.status,L)}),X>0&&(0,r.jsx)(v.A,{color:"red",children:"".concat(X," 个错误")}),A&&"running"===g.status&&(0,r.jsx)(e_,{type:"secondary",style:{fontSize:11},children:"运行中"}),I&&(0,r.jsx)(el.A,{title:"关闭(Esc)",children:(0,r.jsx)(x.Ay,{type:"text",size:"small",className:"nodeInfoClose","aria-label":"关闭信息卡片",onClick:I,children:(0,r.jsx)(eq.A,{})})})]}),(0,r.jsxs)("div",{className:"nodeInfoActions",children:[(0,r.jsx)(x.Ay,{size:"small",onClick:()=>null==R?void 0:R(g),children:"@ 到对话框"}),(0,r.jsx)(x.Ay,{size:"small",onClick:()=>null==N?void 0:N(g),children:"在画布中定位"}),(0,r.jsx)(x.Ay,{size:"small",danger:X>0,onClick:()=>null==S?void 0:S(g),children:"请求修复(预览影响面)"}),A&&"running"===g.status&&E&&(0,r.jsx)(x.Ay,{size:"small",onClick:E,children:"暂停"}),"paused"===g.status&&T&&(0,r.jsx)(x.Ay,{size:"small",onClick:T,children:"继续生成"})]}),K,(0,r.jsx)(eP.A,{size:"small",items:[{key:"overview",label:"概览",children:(0,r.jsxs)(eB.A,{size:"small",column:1,bordered:!0,children:[(0,r.jsx)(eB.A.Item,{label:"状态",children:(0,r.jsx)(v.A,{color:(0,w.uv)(g.status),children:(0,w.m_)(g.status,L)})}),(0,r.jsxs)(eB.A.Item,{label:"类型",children:[(0,w.z9)(g.type),g.unknownType?"(闭集外的类型,按通用卡片渲染)":""]}),(0,r.jsx)(eB.A.Item,{label:"节点 id",children:(0,r.jsx)(eH,{copyable:{text:g.id},style:{margin:0,fontSize:12},children:g.id})}),(0,r.jsx)(eB.A.Item,{label:"稳定序号",children:g.seq}),(0,r.jsx)(eB.A.Item,{label:"父节点",children:g.parentId?(0,r.jsx)(x.Ay,{type:"link",size:"small",style:{padding:0,height:"auto"},onClick:()=>k(g.parentId),children:null!=(p=null==(a=W.get(g.parentId))?void 0:a.title)?p:g.parentId}):"(根节点)"}),(0,r.jsxs)(eB.A.Item,{label:"耗时",children:[(0,w.uH)(F),"running"===g.status?"(运行中)":""]}),(0,r.jsx)(eB.A.Item,{label:"进度",children:g.progress?"".concat(g.progress.label||"进度",":").concat(g.progress.current,"/").concat(g.progress.total):"—"}),(0,r.jsxs)(eB.A.Item,{label:"子节点数",children:[g.children.length,j?"(当前处于影响面高亮)":""]}),(0,r.jsxs)(eB.A.Item,{label:"开始 / 完成",children:[g.startedAt?new Date(g.startedAt).toLocaleString():"—"," / ",g.completedAt?new Date(g.completedAt).toLocaleString():"—"]})]})},{key:"issues",label:"问题".concat(G.length>0?"(".concat(G.length,")"):""),children:0===G.length?(0,r.jsx)(ek.A,{image:ek.A.PRESENTED_IMAGE_SIMPLE,description:"该节点没有记录问题"}):(0,r.jsx)(eL.A,{size:"small",dataSource:G,renderItem:e=>{var t,n;let l=null!=(n=eF[e.level])?n:{color:"default",text:String(e.level)};return(0,r.jsx)(eL.A.Item,{children:(0,r.jsxs)(m.A,{direction:"vertical",size:2,style:{width:"100%"},children:[(0,r.jsxs)(m.A,{wrap:!0,size:4,children:[(0,r.jsx)(v.A,{color:l.color,children:l.text}),e.category&&(0,r.jsx)(v.A,{children:e.category}),e.repairability&&(0,r.jsx)(v.A,{color:"blue",children:e.repairability}),(null==(t=e.provenance)?void 0:t.detectorId)&&(0,r.jsx)(el.A,{title:e.provenance.fingerprint,children:(0,r.jsx)(v.A,{children:e.provenance.detectorId})})]}),(0,r.jsx)(e_,{style:{fontSize:12},children:e.message}),e.suggestion&&(0,r.jsxs)(e_,{type:"secondary",style:{fontSize:12},children:["建议:",e.suggestion]}),(e.chapterId||e.sectionTitle)&&(0,r.jsxs)(e_,{type:"secondary",style:{fontSize:11},children:["位置:",e.chapterId||""," ",e.sectionTitle||""]})]})})}})},...O.length>0?[{key:"details",label:"明细(".concat(O.length,")"),children:(0,r.jsx)(eL.A,{size:"small",dataSource:O,renderItem:e=>(0,r.jsx)(eL.A.Item,{style:{paddingBlock:3},children:(0,r.jsx)(e_,{type:"secondary",style:{fontSize:12},children:e.message})})})}]:[],...M&&M.length>0?[{key:"events",label:"事件(".concat(M.length,")"),children:(0,r.jsx)(eL.A,{size:"small",dataSource:[...M].slice(-40).reverse(),renderItem:e=>(0,r.jsx)(eL.A.Item,{style:{paddingBlock:3},children:(0,r.jsxs)(m.A,{size:6,wrap:!0,children:[(0,r.jsxs)(e_,{type:"secondary",style:{fontSize:11},children:["#",e.seq]}),(0,r.jsx)(v.A,{style:{fontSize:11},children:e.type}),(0,r.jsx)(e_,{type:"secondary",style:{fontSize:11},children:new Date(e.at).toLocaleTimeString()}),e.detail?(0,r.jsx)(e_,{style:{fontSize:11},ellipsis:!0,children:e.detail}):null]})})})}]:[],{key:"impact",label:"影响面",children:V},..._?[{key:"skills",label:"技能",children:(()=>{let e="string"==typeof g.metrics.skillId?g.metrics.skillId:void 0;return(0,r.jsxs)(eB.A,{size:"small",column:1,bordered:!0,children:[(0,r.jsx)(eB.A.Item,{label:"技能 id",children:null!=e?e:g.id}),(0,r.jsx)(eB.A.Item,{label:"技能名",children:g.title}),(0,r.jsx)(eB.A.Item,{label:"命中章节",children:"string"==typeof g.metrics.chapter?g.metrics.chapter:"—"}),(0,r.jsx)(eB.A.Item,{label:"状态",children:(0,r.jsx)(v.A,{color:(0,w.uv)(g.status),children:(0,w.m_)(g.status,L)})})]})})()}]:[],...U.length>0?[{key:"metrics",label:"指标",children:(0,r.jsx)(eB.A,{size:"small",column:1,bordered:!0,children:U.map(e=>(0,r.jsx)(eB.A.Item,{label:e.key,children:e.text.replace("".concat(e.key,": "),"")},e.key))})}]:[],...g.payloadRef?[{key:"payload",label:"载荷",children:(0,r.jsxs)(m.A,{direction:"vertical",size:6,children:[(0,r.jsx)(eH,{copyable:{text:g.payloadRef},style:{margin:0,fontSize:12},children:g.payloadRef}),(0,r.jsx)(e_,{type:"secondary",style:{fontSize:12},children:"8.6 / 附录 F.2:节点**不得携带载荷**(`agentWorkflow` 已是 p50 2.2 MB / max 94.6 MB)。 prompt / response / 证据快照等明细都在内容寻址的 `artifacts/<sha256>` 里,这里只有引用。"})]})}]:[]]})]})}var eG=n(34038);let{Text:eQ}=d.A,eO=["upsert","status","rollup","reset","start","stage","thinking","text","tool_call_preview","progress","error","done","complete","log"];function eX(e,t){var n,r;let l=null!=(n=e.projectRoot)?n:t;return{specId:e.templateId||e.id,promptIds:null!=(r=e.promptIds)?r:[],...e.materialRoot?{materialRoot:e.materialRoot}:{},...l?{projectRoot:l}:{},...e.templateName?{title:e.templateName}:{}}}function eV(e,t){let n=t.node;if(!n||"string"!=typeof n.id)return!0;if("upsert"===t.type)return e.set(n.id,n),!0;let r=e.get(n.id);if(!r){var l,i;return e.set(n.id,{...n,title:null!=(l=n.title)?l:n.id,seq:null!=(i=n.seq)?i:0}),!1}let{startedAt:a,...o}=n;return e.set(n.id,{...r,...o,id:r.id}),!0}function eJ(){var e,t,n,i,o,d,k,S,I,C,R,N,E,T,L,D,P,B,_,W,G,Q,X,V,J,$,Z,ee,et;let en=(0,c.useRouter)(),el=(0,A.Vr)(),{message:ei}=u.A.useApp(),ea="string"==typeof en.query.id?en.query.id:"",eo="string"==typeof en.query.projectRoot?en.query.projectRoot:void 0,[es,ec]=(0,l.useState)(null),[ed,eu]=(0,l.useState)(!0),[eh,ep]=(0,l.useState)(null),[em,ex]=(0,l.useState)(new Map),[eg,ev]=(0,l.useState)("connecting"),[ef,ey]=(0,l.useState)(0),[ej,eA]=(0,l.useState)(null),[eb,ew]=(0,l.useState)("all"),[ek,eS]=(0,l.useState)(!0),[eI,eC]=(0,l.useState)(0),[ez,eL]=(0,l.useState)(()=>Date.now()),eD=(0,l.useCallback)(()=>{ek&&eC(Date.now()+eT.WF)},[ek]),[eP,eB]=(0,l.useState)(""),[eq,eH]=(0,l.useState)(!1),[e_,eW]=(0,l.useState)([]),[,eF]=(0,l.useState)([]),[eJ,eK]=(0,l.useState)([]),[e$,eZ]=(0,l.useState)(null),[e0,e1]=(0,l.useState)(null),{bubbles:e2,push:e4,clear:e5}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1500,[t,n]=(0,l.useState)([]),r=(0,l.useRef)(null),i=(0,l.useCallback)(t=>{let r=function(e){var t,n;let r=null!=(t=e.now)?t:Date.now(),l=null!=(n=e.freshMs)?n:15e3,{before:i,after:a}=e,o=a.parentId;if(!o)return null;if(!i){if("number"!=typeof a.startedAt||r-a.startedAt>l||r-a.startedAt<-l)return null;let e=F(a,"dispatch");return e?{id:"".concat(o,"->").concat(a.id,":dispatch"),fromId:o,toId:a.id,kind:"dispatch",label:e,at:r}:null}if(!(H.has(a.status)&&!H.has(i.status))||"number"!=typeof a.completedAt||r-a.completedAt>l||r-a.completedAt<-l)return null;let s=F(a,"report");return s?{id:"".concat(a.id,"->").concat(o,":report"),fromId:a.id,toId:o,kind:"report",label:s,at:r}:null}(t);r&&n(t=>(function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1500,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:6,i=[...e.filter(e=>n-e.at<r&&e.id!==t.id),t];return i.length>l?i.slice(i.length-l):i})(t,r,r.at,e))},[e]),a=(0,l.useCallback)(()=>{n(e=>0===e.length?e:[])},[]);return(0,l.useEffect)(()=>{if(0!==t.length)return r.current=setTimeout(()=>{r.current=null,n(t=>(function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1500,r=e.filter(e=>t-e.at<n);return r.length===e.length?e:r})(t,Date.now(),e))},Math.max(0,t.reduce((e,t)=>Math.min(e,t.at),1/0)+e-Date.now())),()=>{r.current&&(clearTimeout(r.current),r.current=null)}},[t,e]),{bubbles:t,push:i,clear:a}}(),[e6,e8]=(0,l.useState)(!1);(0,l.useEffect)(()=>{if("function"!=typeof window.matchMedia)return;let e=window.matchMedia("(prefers-reduced-motion: reduce)"),t=()=>e8(e.matches);return t(),e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]);let[e3,e9]=(0,l.useState)(null),[e7,te]=(0,l.useState)(()=>new Map),[tt,tn]=(0,l.useState)([]),[tr,tl]=(0,l.useState)(null),[ti,ta]=(0,l.useState)(!1),[to,ts]=(0,l.useState)(!0),[tc,td]=(0,l.useState)(!0),[tu,th]=(0,l.useState)([]),[tp,tm]=(0,l.useState)(null),[tx,tg]=(0,l.useState)(!1),tv=(0,eT.s_)(),{centerOn:tf,fit:ty}=tv,tj=(0,l.useCallback)(()=>{var e;let t=null==(e=tv.containerRef.current)?void 0:e.getBoundingClientRect();if(!t)return{left:0,top:0,right:0,bottom:0};let n=e=>{let n=document.querySelector(e);if(!n)return null;let r=n.getBoundingClientRect();return{top:r.top-t.top,bottom:r.bottom-t.top}},r=n(".canvasToolbar"),l=n(".canvasInputBar"),i=Math.min(r?r.bottom+8:24,.4*t.height),a=Math.max(l?l.top-8:t.height-24,.6*t.height);return{left:24,top:i,right:t.width-24,bottom:a}},[tv.containerRef]),tA=(0,l.useRef)(new Map),tb=(0,l.useRef)(0),tw=(0,l.useRef)({nodes:[],events:[],cursor:0}),tk=(0,l.useRef)(null),tS=(0,l.useRef)(0),tI=(0,l.useRef)(eo),tC=(0,l.useCallback)(e=>{let t=e.key?el(e.key):e.text,n=t===e.key?e.text:t;tS.current+=1,eF(t=>[{id:tS.current,kind:e.kind,text:n,at:Date.now()},...t].slice(0,100)),"error"===e.kind?ei.error(n):"warning"===e.kind?ei.warning(n):"success"===e.kind&&ei.success(n)},[ei,el]),tz=(0,b.tl)({projectRoot:eo,documentId:ea||null,onNotice:tC,t:el}),{refreshDocuments:tR,applyRecord:tN}=tz,tE=function(e,t){let[n,r]=(0,l.useState)({loading:!1,error:null,preview:null}),i=(0,l.useRef)(0),a=(0,l.useCallback)(async()=>{if(!e)return void r({loading:!1,error:"缺少记录 id,无法取回成稿预览",preview:null});let n=i.current+1;i.current=n,r(e=>({...e,loading:!0,error:null}));try{let{preview:l}=await (0,j.sz)(e,t);if(i.current!==n)return;r({loading:!1,error:null,preview:l})}catch(e){if(i.current!==n)return;r({loading:!1,error:e instanceof Error?e.message:"取回成稿预览失败",preview:null})}},[e,t]),o=(0,l.useCallback)(()=>{i.current+=1,r({loading:!1,error:null,preview:null})},[]);return{...n,load:a,reset:o}}(ea,null!=(E=tI.current)?E:eo),tT=(0,l.useCallback)(()=>{var e;if(ti){tE.reset(),ta(!1);return}ta(!0),tE.load(),(0,j.f$)(null!=(e=tI.current)?e:eo).then(e=>th(e.assets.filter(e=>e.usedByDocumentIds.includes(ea)))).catch(()=>th([]))},[ti,tE,ea,eo]),tM=(0,l.useCallback)(e=>{var t;let n=null!=(t=tI.current)?t:eo;if("image"!==e.type)return void(0,j.oS)(e.id,"file",n).catch(()=>tC({kind:"error",text:"打开资产失败"}));tg(!1),tm(e)},[eo,tC]),tL=(0,l.useCallback)(e=>{tn(t=>t.includes(e)?t:[...t,e])},[]),tD=(0,l.useCallback)(()=>{tk.current||(tk.current=setTimeout(()=>{tk.current=null;let e=tw.current;if(tw.current={nodes:[],events:[],cursor:0},e.nodes.length>0){let n=tA.current,r=0;for(let l of e.nodes){var t;let e=null==(t=l.node)?void 0:t.id,i=e?n.get(e):void 0;eV(n,l)||(r+=1);let a=e?n.get(e):void 0;a&&e4({...i?{before:i}:{},after:a})}ex(new Map(n)),r>0&&tL("通道收到 ".concat(r," 条指向未知节点的补丁:已按最小节点收下(说明本客户端漏读了 upsert,或日志存在损坏)"))}if(e.cursor>tb.current&&(tb.current=e.cursor),e.events.length>0){let t=e.events;eW(e=>[...t.reverse(),...e].slice(0,200)),ey(e=>t.reduce((e,t)=>Math.max(e,t.seq),e))}},120))},[tL,e4]);(0,l.useEffect)(()=>()=>{tk.current&&clearTimeout(tk.current)},[]);let tP=(0,l.useCallback)((e,t)=>{let n=tw.current;t&&n.nodes.push(t),n.events.push(e),(null==t?void 0:t.logT)&&t.logT>n.cursor&&(n.cursor=t.logT),tD()},[tD]),tB=(0,l.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(ea){e.silent||eu(!0);try{var t,n,r,l,i,a;let e=tI.current?"?projectRoot=".concat(encodeURIComponent(tI.current)):"",o=await fetch("/api/documents/canvas/".concat(encodeURIComponent(ea)).concat(e));if(404===o.status)return void ep("记录不存在(可能已被删除)");if(!o.ok)throw Error(await o.text()||"HTTP ".concat(o.status));let s=await o.json();tI.current=null!=(r=s.document.projectRoot)?r:tI.current,ec(s),ep(null),tn(null!=(l=s.degraded)?l:[]);let c=function(e){let t=[],n=e=>{for(let r of e){let{children:e,...l}=r;t.push(l),e&&n(e)}};return n(e),t}(null!=(i=null==(t=s.nodes)?void 0:t.tree)?i:[]),d=new Map(c.map(e=>[e.id,e]));tA.current=d,ex(d),tb.current=Math.max(tb.current,null!=(a=null==(n=s.nodes)?void 0:n.cursor)?a:0)}catch(e){ep(e instanceof Error?e.message:String(e))}finally{e.silent||eu(!1)}}},[ea]);(0,l.useEffect)(()=>{tB()},[tB]),(0,l.useEffect)(()=>{var e;let t=null==es||null==(e=es.nodes)?void 0:e.depth;null!=t&&ew(t)},[es]),(0,l.useEffect)(()=>{ea&&tR()},[ea,tR]),(0,l.useEffect)(()=>{let e=tz.documents.find(e=>e.id===ea);e&&tN(e)},[tN,ea,tz.documents]);let tq=(0,l.useCallback)(async()=>{if(ea)try{var e,t;let n=new URLSearchParams({since:String(tb.current)});tI.current&&n.set("projectRoot",tI.current);let r=await fetch("/api/documents/generated/".concat(encodeURIComponent(ea),"/nodes?").concat(n.toString()));if(!r.ok)return;let l=await r.json(),i=tA.current;for(let t of null!=(e=l.nodes)?e:[])eV(i,{type:"upsert",node:t});(null!=(t=l.nodes)?t:[]).length>0&&ex(new Map(i)),l.cursor&&(tb.current=Math.max(tb.current,l.cursor)),l.downgraded&&tL(l.reason||"增量过大,服务端已降级为全量快照")}catch(e){}},[tL,ea]);(0,l.useEffect)(()=>{if(!ea)return;let e=setInterval(()=>{tq()},1e4);return()=>clearInterval(e)},[ea,tq]),(0,l.useEffect)(()=>{if(!ea||"undefined"==typeof EventSource)return;let e=tI.current?"?projectRoot=".concat(encodeURIComponent(tI.current)):"",t=new EventSource("/api/documents/generated/".concat(encodeURIComponent(ea),"/events").concat(e));ev("connecting");let n=e=>t=>{var n,r,l;let i={};try{i=JSON.parse(t.data)}catch(e){}let a=null!=(l=i.type)?l:e;"reset"===a&&(e5(),tB({silent:!0}),tL("通道补发不可用(服务端重启或环形覆盖):已重取全量快照"));let o=null==(n=i.node)?void 0:n.title;tP({seq:"number"==typeof i.seq?i.seq:0,type:a,at:"number"==typeof i.at?i.at:Date.now(),...i.nodeId?{nodeId:i.nodeId}:{},...o?{nodeTitle:o}:{},...(null==(r=i.payload)?void 0:r.message)?{detail:i.payload.message}:{}},i.node?{type:a,node:i.node,...i.logT?{logT:i.logT}:{}}:void 0),i.node&&tR()},r=eO.map(e=>[e,n(e)]);for(let[e,n]of(t.onopen=()=>ev("open"),t.onerror=()=>{ev("error"),tq()},r))t.addEventListener(e,n);return t.onmessage=n("message"),()=>{for(let[e,n]of r)t.removeEventListener(e,n);t.close()}},[tL,e5,ea,tB,tP,tR,tq]),(0,l.useEffect)(()=>{e5()},[e5,ea]);let tH=(0,l.useMemo)(()=>(0,w.Jr)([...em.values()],"all"===eb?void 0:eb),[em,eb]),t_=(0,l.useMemo)(()=>(0,w.x8)(tH),[tH]),tW=(0,l.useMemo)(()=>(0,w.PI)(tH),[tH]),tF=(0,l.useMemo)(()=>0!==e7.size||e3?(0,w.bJ)(tW,(0,w.Kq)(e7,e3)):tW,[tW,e7,e3]),tU=(0,l.useRef)(1);tU.current=tv.view.k;let tG=(0,l.useRef)(!1);tG.current=null!==e3;let tQ=(0,l.useCallback)((e,t,n,r)=>{let{dx:l,dy:i}=(0,w.qj)({dx:t,dy:n},tU.current);if("move"===r)return void e9({id:e.id,dx:l,dy:i});e9(null),(0!==t||0!==n)&&te(t=>{var n;let r=new Map(t),a=null!=(n=r.get(e.id))?n:{dx:0,dy:0};return r.set(e.id,{dx:a.dx+l,dy:a.dy+i}),r})},[]),tO=(0,l.useCallback)(()=>{e9(null),te(new Map)},[]),tX=(0,l.useMemo)(()=>new Map(t_.map(e=>[e.id,e])),[t_]),tV=ej&&null!=(T=tX.get(ej))?T:null,tJ=(0,l.useMemo)(()=>{if(ej)return M(t_.map(eY),ej)},[t_,ej]),tY=(0,l.useMemo)(()=>{var e;return new Set(null!=(e=null==tJ?void 0:tJ.affectedNodeIds)?e:[])},[tJ]),tK=(0,l.useMemo)(()=>new Set(ej?[...(0,w.II)(tH,ej),ej]:[]),[tH,ej]),t$=(0,l.useMemo)(()=>(0,w.Kg)(tF),[tF]),tZ=(0,l.useMemo)(()=>(function(e,t){var n,r;let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=null!=(n=l.limit)?n:6,a=null!=(r=l.recentLimit)?r:3,o=[],s=[],c=(e,n)=>{for(let r of e)O.has(r.status)?o.push(Y(r,n,t)):"completed"===r.status&&"number"==typeof r.completedAt&&t-r.completedAt<=9e4&&s.push(Y(r,n,t)),r.children.length>0&&c(r.children,n+1)};return c(e,0),o.sort((e,n)=>{var r,l;let i=null!=(r=K(e,t))?r:0;return(null!=(l=K(n,t))?l:0)-i||e.id.localeCompare(n.id)}),s.sort((e,t)=>{var n,r;return(null!=(n=t.completedAt)?n:0)-(null!=(r=e.completedAt)?r:0)||e.id.localeCompare(t.id)}),{running:o.slice(0,i),recent:s.slice(0,a),runningTotal:o.length,recentTotal:s.length}})(tH,Date.now()),[tH]),t0=(0,l.useMemo)(()=>(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4,n=[],r=e=>{for(let i of e){if("supervisor"===i.type){var t,l;let e="string"==typeof(null==(t=i.metrics)?void 0:t.action)?i.metrics.action:"unknown",r="string"==typeof(null==(l=i.metrics)?void 0:l.note)?i.metrics.note:void 0;n.push({id:i.id,action:e,title:i.title||"调度决策",...r?{note:r}:{},status:i.status,..."number"==typeof i.completedAt?{at:i.completedAt}:"number"==typeof i.startedAt?{at:i.startedAt}:{}})}i.children.length>0&&r(i.children)}};return r(e),n.sort((e,t)=>{var n,r;return(null!=(n=t.at)?n:0)-(null!=(r=e.at)?r:0)||e.id.localeCompare(t.id)}),n.slice(0,t)})(tH),[tH]),t1=(0,l.useCallback)(e=>{let t=tX.get(e.fromId);return t?tY.has(e.fromId)&&tY.has(e.toId)?"affected":2>=(0,w.vp)(t.status)?"warn":tK.has(e.fromId)&&tK.has(e.toId)?"active":"default":"default"},[tY,tK,tX]);(0,l.useEffect)(()=>{if(0===eI)return;let e=setInterval(()=>eL(Date.now()),1e3);return()=>clearInterval(e)},[eI]);let t2=(0,l.useMemo)(()=>{if(0===t_.length)return null;let e=t_.filter(e=>"running"===e.status),t=e.length>0?e:t_;return t.reduce((e,t)=>{var n,r;return(null!=(n=t.seq)?n:0)>=(null!=(r=e.seq)?r:0)?t:e},t[0])},[t_]),t4=null==t2?void 0:t2.id,t5=(0,l.useMemo)(()=>{var e;return(0,eT.be)({following:ek,pausedUntil:eI,now:ez,node:t2?{title:t2.title,...(null==(e=t2.metrics)?void 0:e.roundIteration)!==void 0?{round:t2.metrics.roundIteration}:{}}:void 0})},[ek,eI,ez,t2]);(0,l.useEffect)(()=>{var e;if(!ek||!t4||eI>Date.now()||tG.current)return;let t=null==(e=tv.containerRef.current)?void 0:e.getBoundingClientRect();if(!t)return;let n=tF.nodes.find(e=>e.node.id===t4);n&&(0,eT.xA)({x:n.x,y:n.y,width:w.zT,height:w.EL},tv.view,{width:t.width,height:t.height},tj())&&tf(n.x,n.y,void 0,tj())},[tf,ek,eI,tF.nodes,t4,tj,tv.containerRef,tv.view]),(0,l.useEffect)(()=>{var e;if(!(null==(e=tv.containerRef.current)?void 0:e.getBoundingClientRect())||0===tF.nodes.length)return;let{dx:t,dy:n}=(0,eT.B)({width:tF.width,height:tF.height},tv.view,tj());tv.panBy(t,n)},[tF.width,tF.height,tF.nodes.length]);let t6=(0,l.useCallback)(e=>{eA(e);let t=tF.nodes.find(t=>t.node.id===e);t&&tf(t.x,t.y,void 0,tj())},[tf,tF.nodes,tj]);(0,l.useEffect)(()=>{if(!ej)return;let e=e=>{"Escape"===e.key&&eA(null)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[ej]);let t8=(0,l.useCallback)(e=>{eB(t=>""===t||t.endsWith(" ")?"".concat(t,"@").concat(e.title," "):"".concat(t," @").concat(e.title," "))},[]),t3=(0,l.useCallback)(()=>{let e=null==es?void 0:es.document;if(!e)return;let t=eP.trim();t&&(eH(!0),(0,j.wI)(e.id,t,{...tI.current?{projectRoot:tI.current}:{}}).then(e=>{var t;tC({kind:"info",text:e.answer?"".concat(e.receipt,"\n").concat(e.answer):e.receipt}),eK(null!=(t=e.candidates)?t:[]),eB("")}).catch(e=>tC({kind:"error",text:e instanceof Error?e.message:"指令未受理"})).finally(()=>eH(!1)))},[es,tC,eP]),t9=(0,l.useCallback)(()=>{let e=null==es?void 0:es.document;e&&(eH(!0),tz.startGeneration(eX(e,tI.current),eP.trim()).finally(()=>eH(!1)))},[es,tz,eP]),t7=(0,l.useCallback)(e=>{let t=null==es?void 0:es.document;t&&(eH(!0),(0,j.wI)(t.id,"(选定:".concat(e.label,")"),{...tI.current?{projectRoot:tI.current}:{},acceptedCandidate:{kind:e.kind}}).then(e=>{tC({kind:"info",text:e.receipt}),eK([])}).catch(e=>tC({kind:"error",text:e instanceof Error?e.message:"指令未受理"})).finally(()=>eH(!1)))},[es,tC]),ne=(0,l.useCallback)(async()=>{let e=null==es?void 0:es.document;if(!e)return;let t=eX(e,tI.current);if(!t.projectRoot)return void tC({kind:"error",text:"未识别当前项目,无法预览结构"});try{let e=await (0,j.dk)({promptIds:t.promptIds,requirement:eP.trim(),...t.materialRoot?{materialRoot:t.materialRoot}:{},...t.title?{title:t.title}:{},projectRoot:t.projectRoot});tl({title:e.title,chapters:e.chapters,outlineSource:e.derivation.outlineSource,materialScope:e.materialScope})}catch(e){tC({kind:"error",text:e instanceof Error?e.message:"结构预览失败"})}},[es,tC,eP]),nt=(0,l.useCallback)(e=>{let t=M(t_.map(eY),e.id);if(!t)return void tC({kind:"warning",text:"该节点不在当前节点集合里,无法评估影响面"});eZ({nodeId:e.id,nodeTitle:e.title,nodeType:e.type,impact:t})},[t_,tC]),nn=(0,l.useCallback)(()=>{if(!e$)return;let e=(0,w.RV)(e$.nodeTitle,e$.impact);eB(t=>t?"".concat(t," ").concat(e):e),eZ(null)},[e$]),[nr,nl]=(0,l.useState)(null),[ni,na]=(0,l.useState)(null),no=(0,l.useCallback)(e=>{if(!e$)return;let t=e$.nodeId;nl({nodeId:t,phase:"creating"}),(0,j.xU)({documentId:ea,targetNodeId:t,userMessage:e}).then(e=>{var n,r,l,i;nl({nodeId:t,phase:"confirmable",requestId:null==(n=e.request)?void 0:n.id,attribution:"string"==typeof e.attribution?e.attribution:void 0,localizationNote:e.localizationNote,...e.needsLocalization?{needsLocalization:!0}:{},...(null==(i=e.request)||null==(l=i.localization)||null==(r=l.candidates)?void 0:r.length)?{candidates:e.request.localization.candidates}:{}})}).catch(e=>{nl({nodeId:t,phase:"error",message:e instanceof Error?e.message:String(e)})})},[ea,e$]),ns=(0,l.useCallback)(e=>{na({phase:"creating"}),(0,j.xU)({documentId:ea,userMessage:e}).then(e=>{var t,n,r,l;na({phase:"confirmable",requestId:null==(t=e.request)?void 0:t.id,attribution:"string"==typeof e.attribution?e.attribution:void 0,candidates:null!=(l=null==(r=e.request)||null==(n=r.localization)?void 0:n.candidates)?l:[],localizationNote:e.localizationNote})}).catch(e=>{na({phase:"error",message:e instanceof Error?e.message:String(e)})})},[ea]),nc=(0,l.useCallback)(e=>{(null==ni?void 0:ni.requestId)&&(0,j.Ho)({documentId:ea,requestId:ni.requestId,acceptedNodeId:e}).then(e=>{var t;na({...ni,phase:"executed",outcome:String(null!=(t=e.outcome)?t:""),notExecutedReason:e.notExecutedReason})}).catch(e=>{na({...ni,phase:"error",message:e instanceof Error?e.message:String(e)})})},[ni,ea]),nd=(0,l.useCallback)(e=>{(null==nr?void 0:nr.requestId)&&(0,j.Ho)({documentId:ea,requestId:nr.requestId,...e?{acceptedNodeId:e}:{}}).then(e=>{var t;nl({...nr,phase:"executed",outcome:String(null!=(t=e.outcome)?t:""),notExecutedReason:e.notExecutedReason,attribution:"string"==typeof e.attribution?e.attribution:nr.attribution})}).catch(e=>{nl({...nr,phase:"error",message:e instanceof Error?e.message:String(e)})})},[ea,nr]),nu=(0,l.useCallback)(()=>{(null==nr?void 0:nr.requestId)&&(0,j.vX)({documentId:ea,requestId:nr.requestId}).then(e=>{var t,n,r;let l=null==(t=e.restoredChars)?void 0:t.beforeChars,i=null==(n=e.restoredChars)?void 0:n.afterChars;nl({...nr,phase:"executed",outcome:String(null!=(r=e.outcome)?r:"rolled-back"),restoredChars:void 0!==l&&void 0!==i?l-i:void 0})}).catch(e=>{nl({...nr,phase:"error",message:e instanceof Error?e.message:String(e)})})},[ea,nr]),nh=(0,l.useCallback)(()=>{tz.pauseDocument(ea).catch(e=>tC({kind:"error",text:e instanceof Error?e.message:"暂停失败"}))},[ea,tz,tC]),np=(0,l.useCallback)(()=>{tz.resumePausedDocument(ea).catch(e=>tC({kind:"error",text:e instanceof Error?e.message:"继续失败"}))},[ea,tz,tC]),nm=null==es?void 0:es.document.status,nx=tz.loading||"generating"===nm||"queued"===nm,ng=(0,l.useRef)(null),nv=(0,l.useRef)(null),[nf,ny]=(0,l.useState)({width:0,height:0});(0,l.useLayoutEffect)(()=>{let e=nv.current;if(!e)return void ny({width:0,height:0});let t=()=>{let t=e.firstElementChild;if(!t)return;let n=e.offsetWidth,r=Math.max(t.scrollHeight,t.offsetHeight);ny(e=>Math.abs(e.width-n)>2||Math.abs(e.height-r)>2?{width:n,height:r}:e)};t();let n=new ResizeObserver(t);return n.observe(e),e.firstElementChild&&n.observe(e.firstElementChild),()=>n.disconnect()},[ej]);let nj=(0,l.useMemo)(()=>{var e;if(!ej)return null;let t=tF.nodes.find(e=>e.node.id===ej),n=null==(e=tv.containerRef.current)?void 0:e.getBoundingClientRect();if(!t||!n)return null;let r=[".canvasToolbar",".canvasInputBar",".canvasRecordsBall"].map(e=>{var t;return null==(t=document.querySelector(e))?void 0:t.getBoundingClientRect()}).filter(e=>!!e).map(e=>({left:e.left-n.left,top:e.top-n.top,right:e.right-n.left,bottom:e.bottom-n.top})),l="".concat(tv.view.x,",").concat(tv.view.y,",").concat(tv.view.k),i=ng.current,a=i&&i.id===ej&&i.viewKey===l?i:null,o=(0,w.Aq)({node:{x:t.x,y:t.y},view:tv.view,box:n,panelWidth:nf.width>0?nf.width:462,panelHeight:nf.height>0?nf.height:480,obstacles:r,...a?{pin:{left:a.left,top:a.top}}:{}});ng.current={id:ej,viewKey:l,left:o.left,top:o.top};let s=Math.round(.62*n.height);return{left:o.left,top:o.top,maxHeight:Math.max(180,Math.min(o.maxHeight,s))}},[tF.nodes,ej,tv,nf]),nA=(0,l.useCallback)(e=>{t8(e),requestAnimationFrame(()=>{var e;return null==(e=document.querySelector(".canvasInputBar textarea"))?void 0:e.focus()})},[t8]),nb=(0,l.useCallback)(e=>{t6(e.id),e1(e.id),window.setTimeout(()=>e1(t=>t===e.id?null:t),1200)},[t6]),nw=(0,l.useCallback)(async e=>{if(ea)try{let{document:t}=await (0,j.v7)(ea,!1,tI.current);if(!t)return void tC({kind:"warning",text:"记录不存在,无法导出"});await tz.export.exportRecord(t,e)}catch(e){tC({kind:"error",text:e instanceof Error?e.message:"导出失败"})}},[ea,tz.export,tC]),nk=tz.boundRecord,nS=function(e,t){if(!e)return;let n=(null==t?void 0:t.docId)===e.id?t:void 0,r=e.deliveryQuality;return r?{...n,docId:e.id,...e.projectRoot?{projectRoot:e.projectRoot}:{},contractQuality:r.receipt,...r.stale?{contractQualityStale:r.stale}:{contractQualityStale:void 0}}:n}(null==es?void 0:es.document,tz.deliveryReadings),nI=tz.canResume;return ea?eh?(0,r.jsx)(p.Ay,{status:"warning",title:"画布打不开",subTitle:eh,extra:(0,r.jsxs)(m.A,{children:[(0,r.jsx)(x.Ay,{icon:(0,r.jsx)(y.A,{}),onClick:()=>{tB()},children:"重试"}),(0,r.jsx)(s(),{href:"/documents",children:(0,r.jsx)(x.Ay,{type:"primary",children:"回到文档页"})})]})}):(0,r.jsxs)("div",{className:"canvasRoot",children:[(0,r.jsx)(a(),{children:(0,r.jsx)("title",{children:(null==es?void 0:es.document.title)?"".concat(es.document.title," \xb7 画布"):"生成画布"})}),(0,r.jsx)(eR,{title:(null==es?void 0:es.document.title)||"生成画布",...nm?{status:nm}:{},...(null==es?void 0:es.document.updatedAt)!==void 0?{updatedAt:es.document.updatedAt}:{},...(null==es?void 0:es.document.wordCount)!==void 0?{wordCount:es.document.wordCount}:{},agents:tZ,supervisorDecisions:t0,agentsActive:nx,...(null==es?void 0:es.document.createdAt)!==void 0?{startedAt:es.document.createdAt}:{},onLocateAgent:e=>{eA(e),e1(e)},nodeCount:em.size,visibleCount:tF.nodes.length,hiddenCount:null!=(L=null==es?void 0:es.nodes.hiddenCount)?L:0,degraded:tt,skills:{hits:null!=(D=null==es?void 0:es.skills.hits)?D:[],note:null!=(P=null==es?void 0:es.skills.note)?P:""},gate:null!=(B=null==es?void 0:es.gate)?B:null,connection:eg,lastSeq:ef,zoom:tv.view.k,following:ek,followStatus:t5.title,generating:!!nx,resumable:nI,exporting:tz.export.exporting,nonDeliverableExport:tz.export.nonDeliverableExport,onFit:()=>ty(tF.width,tF.height,tj()),onToggleFollow:()=>eS(e=>!e),onContinue:()=>{nk&&tz.resumeDocument(nk)},onPause:nh,onResume:np,onAbort:()=>{tz.abortGeneration()},onExport:e=>{nw(e)},exportReports:tz.export.exportReports,...nS?{deliveryReadings:nS}:{},previewOpen:ti,onTogglePreview:tT,hasNodeOffsets:e7.size>0,onResetNodeLayout:tO,collapsed:to,onToggleCollapsed:ts,t:el}),(0,r.jsxs)("div",{ref:tv.containerRef,className:"canvasStage",style:{backgroundImage:"radial-gradient(var(--canvasGridDot) 1px, transparent 1px)",backgroundSize:"".concat(eT.VF*tv.view.k,"px ").concat(eT.VF*tv.view.k,"px"),backgroundPosition:"".concat(tv.view.x,"px ").concat(tv.view.y,"px"),cursor:"grab"},onWheelCapture:eD,onPointerDown:e=>{var t;let n=e.target;null!=n&&null!=(t=n.closest)&&t.call(n,".nodeInfoLayer, .canvasToolbar, .canvasInputBar")||(eD(),tv.onPointerDown(e))},onPointerMove:tv.onPointerMove,onPointerUp:tv.endDrag,onPointerLeave:tv.endDrag,onClick:()=>eA(null),children:[ed&&(0,r.jsx)("div",{style:{position:"absolute",inset:0,display:"grid",placeItems:"center"},children:(0,r.jsxs)(m.A,{direction:"vertical",align:"center",children:[(0,r.jsx)(h.A,{}),(0,r.jsx)(eQ,{type:"secondary",children:"正在读取节点日志…"})]})}),!ed&&0===tF.nodes.length&&(0,r.jsx)("div",{style:{position:"absolute",inset:0,display:"grid",placeItems:"center",pointerEvents:"none"},children:(0,r.jsxs)(m.A,{direction:"vertical",align:"center",size:8,children:[(0,r.jsx)(eQ,{type:"secondary",children:"还没有节点日志"}),(0,r.jsx)(eQ,{type:"secondary",style:{fontSize:12},children:"节点日志是唯一真相源:这里**不造占位节点**,发起生成后节点会随日志追加而出现。"})]})}),(0,r.jsxs)("div",{style:{position:"absolute",left:0,top:0,transformOrigin:"0 0",transform:"translate(".concat(tv.view.x,"px, ").concat(tv.view.y,"px) scale(").concat(tv.view.k,")"),width:tF.width,height:tF.height},children:[(0,r.jsx)(q,{edges:tF.edges,width:tF.width,height:tF.height,toneOf:t1,flowing:t$}),(0,r.jsx)(U,{bubbles:e2,layout:tF,static:e6}),tF.nodes.map(e=>(0,r.jsx)(er,{node:e.node,x:e.x,y:e.y,selected:e.node.id===ej,affected:tY.has(e.node.id)&&e.node.id!==ej,flashed:e0===e.node.id,onDrag:tQ,onSelect:e=>eA(e.id),t:el},e.node.id))]}),tV&&nj&&(0,r.jsx)("div",{ref:nv,className:"nodeInfoLayer",style:{left:nj.left,top:nj.top,maxHeight:nj.maxHeight},onClick:e=>e.stopPropagation(),onContextMenu:e=>e.stopPropagation(),children:(0,r.jsx)(eU,{node:tV,...tJ?{impact:tJ}:{},flatNodes:t_,highlighted:!!(ej&&tY.has(ej)),generating:!!nx,repairPreview:e$,repairRun:nr,onRunRepair:no,onConfirmRepair:nd,onRollbackRepair:nu,defaultRepairNote:e$?(0,w.RV)(e$.nodeTitle,e$.impact):"",onFocusNode:t6,onRequestRepair:nt,onClose:()=>eA(null),onDraftRepairNote:nn,onCancelRepairPreview:()=>eZ(null),onMention:nA,onLocate:nb,onPause:nh,onResume:np,nodeEvents:e_.filter(e=>e.nodeId===(null==tV?void 0:tV.id)),t:el})})]}),(0,r.jsx)(eM._,{quickActions:[...eJ.map(e=>({key:e.kind,label:"按「".concat(e.label,"」执行"),onClick:()=>t7(e)})),{key:"document-repair",label:"按这段要求修复正文(先定位)",onClick:()=>ns(eP.trim())},{key:"regenerate",label:"按这段要求再生成一份",onClick:t9}],value:eP,onChange:eB,onSend:t3,generating:!!nx,submitting:eq,disabled:!es,...es?{}:{disabledReason:"正在读取记录…"},selectedNode:tV,onMentionSelected:()=>{tV&&t8(tV)},resumable:nI,onContinue:()=>{nk&&tz.resumeDocument(nk)},onPreviewStructure:()=>{ne()},collapsed:tc,onToggleCollapsed:td}),(0,r.jsx)(eN._,{currentDocumentId:ea,...eo?{projectRoot:eo}:{},onSelect:e=>{en.push((0,eE.p)(e.id,e.projectRoot||eo))},onCurrentDeleted:()=>{en.push("/canvas")}}),(0,r.jsxs)(g.A,{open:!!ni,title:"文档级修复(先定位)",onCancel:()=>na(null),footer:(0,r.jsx)(x.Ay,{onClick:()=>na(null),children:"关闭"}),width:640,children:[(null==ni?void 0:ni.phase)==="creating"&&(0,r.jsx)(eQ,{type:"secondary",children:"正在定位要改的节点…"}),(null==ni?void 0:ni.phase)==="error"&&(0,r.jsx)(eQ,{type:"danger",children:"修复请求未建立:".concat(null!=(_=ni.message)?_:"")}),(null==ni?void 0:ni.phase)==="confirmable"&&(0,r.jsxs)(m.A,{direction:"vertical",size:8,style:{width:"100%"},children:[(0,r.jsx)(eQ,{type:"secondary",style:{fontSize:12},children:"请求已建立(".concat(null!=(W=ni.requestId)?W:"",")").concat(ni.attribution?";归因:".concat(ni.attribution):"","。")+"点一个候选才会真的改正文——定位这件事由你定,系统不替你点头。"}),(null!=(G=null==(e=ni.candidates)?void 0:e.length)?G:0)===0?(0,r.jsx)(eQ,{type:"warning",children:"系统定位不出候选节点:请改用「@ 节点名」指定,或在节点面板里发起(不猜一个节点去改)"}):ni.candidates.map(e=>(0,r.jsx)("div",{"data-testid":"document-repair-candidate",children:(0,r.jsxs)(m.A,{size:6,wrap:!0,children:[(0,r.jsx)(v.A,{children:"匹配 ".concat(e.score.toFixed(2))}),(0,r.jsx)(eQ,{style:{fontSize:12},children:e.excerpt.slice(0,80)}),(0,r.jsx)(x.Ay,{size:"small",type:"primary",onClick:()=>nc(e.nodeId),children:"定位到该节点并执行"})]})},e.nodeId))]}),(null==ni?void 0:ni.phase)==="executed"&&(0,r.jsxs)(m.A,{direction:"vertical",size:6,children:[(0,r.jsx)(v.A,{color:"applied"===ni.outcome?"green":"rolled-back"===ni.outcome?"orange":"red",children:"执行结果:".concat(null!=(Q=ni.outcome)?Q:"未执行")}),ni.notExecutedReason&&(0,r.jsx)(eQ,{type:"danger",style:{fontSize:12},children:ni.notExecutedReason})]})]}),(0,r.jsx)(eG.B,{open:!!tr,title:null!=(X=null==tr?void 0:tr.title)?X:"",chapters:null!=(V=null==tr?void 0:tr.chapters)?V:[],...(null==tr?void 0:tr.outlineSource)?{outlineSource:tr.outlineSource}:{},...(null==tr?void 0:tr.materialScope)?{materialScope:tr.materialScope}:{},onClose:()=>tl(null)}),(0,r.jsxs)(g.A,{open:ti,title:"成稿预览",onCancel:()=>{tE.reset(),ta(!1)},footer:(0,r.jsxs)(m.A,{children:[(0,r.jsx)(x.Ay,{onClick:()=>{tE.load()},loading:tE.loading,children:"重新取回"}),(0,r.jsx)(x.Ay,{type:"primary",onClick:()=>{tE.reset(),ta(!1)},children:"关闭"})]}),width:920,styles:{body:{maxHeight:"72vh",overflow:"auto",background:"var(--colorBgLayout)",padding:"16px 20px"}},style:{top:32},children:[(0,r.jsx)(z,{status:null!=(J=null==(t=tE.preview)?void 0:t.status)?J:nm,title:null!=($=null==(n=tE.preview)?void 0:n.title)?$:null==es?void 0:es.document.title,html:null==(i=tE.preview)?void 0:i.html,source:null==(o=tE.preview)?void 0:o.source,truncated:null==(d=tE.preview)?void 0:d.truncated,totalChars:null==(k=tE.preview)?void 0:k.totalChars,renderedChars:null==(S=tE.preview)?void 0:S.renderedChars,stats:null==(I=tE.preview)?void 0:I.stats,gate:null!=(ee=null!=(Z=null==(C=tE.preview)?void 0:C.gate)?Z:null==es?void 0:es.gate)?ee:null,deliveryReadings:nS,loading:tE.loading,error:tE.error,onRetry:()=>{tE.load()},updatedAt:null==(R=tE.preview)?void 0:R.updatedAt,generatedAt:null==(N=tE.preview)?void 0:N.generatedAt,t:el}),(0,r.jsxs)("div",{style:{marginTop:16,borderTop:"1px solid var(--colorBorderSecondary)",paddingTop:12},children:[(0,r.jsx)(eQ,{strong:!0,style:{fontSize:13},children:"本档用到的资产"}),0===tu.length?(0,r.jsx)("div",{children:(0,r.jsx)(eQ,{type:"secondary",style:{fontSize:12},children:"本档暂无资产"})}):(0,r.jsxs)(m.A,{direction:"vertical",size:4,style:{width:"100%",marginTop:6},children:[tu.slice(0,20).map(e=>(0,r.jsxs)(m.A,{size:8,children:[(0,r.jsx)(eQ,{style:{fontSize:12},children:e.name}),(0,r.jsx)(x.Ay,{size:"small",type:"link",onClick:()=>tM(e),children:"打开"})]},e.id)),tu.length>20?(0,r.jsxs)(eQ,{type:"secondary",style:{fontSize:12},children:["还有 ",tu.length-20," 项未列出"]}):null]})]})]}),(0,r.jsxs)(g.A,{open:!!tp,title:tp?"资产预览:".concat(tp.name):"",onCancel:()=>{tm(null),tg(!1)},footer:(0,r.jsxs)(m.A,{children:[tx&&tp?(0,r.jsx)(x.Ay,{onClick:()=>{var e;(0,j.oS)(tp.id,"file",null!=(e=tI.current)?e:eo).catch(()=>tC({kind:"error",text:"打开资产失败"}))},children:"用系统程序打开"}):null,(0,r.jsx)(x.Ay,{type:"primary",onClick:()=>{tm(null),tg(!1)},children:"关闭"})]}),width:760,styles:{body:{maxHeight:"68vh",overflow:"auto"}},children:[tp&&!tx?(0,r.jsx)("img",{alt:tp.name,src:(0,j.iN)(tp.id,null!=(et=tI.current)?et:eo),style:{maxWidth:"100%",display:"block",margin:"0 auto"},onError:()=>tg(!0)}):null,tx&&(0,r.jsx)(f.A,{type:"info",showIcon:!0,message:"这个资产不能在应用内渲染",description:"服务端只对图片(PNG / JPEG / WebP,按文件头验证)提供应用内渲染;其它形态请用系统程序打开。"})]})]}):(0,r.jsx)("div",{className:"appShellPlaceholder",children:(0,r.jsx)(h.A,{style:{margin:48}})})}function eY(e){return e}},72210:(e,t,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/canvas/[id]",function(){return n(38977)}])}},e=>{e.O(0,[717,551,665,576,569,499,808,127,579,530,636,593,792],()=>e(e.s=72210)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[124],{20241:(e,t,o)=>{"use strict";o.d(t,{A:()=>l});var n=o(97109),r=o(89857),a=o(88483);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e}).apply(this,arguments)}let l=n.forwardRef((e,t)=>n.createElement(a.A,i({},e,{ref:t,icon:r.A})))},48161:(e,t,o)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/canvas",function(){return o(88785)}])},54746:(e,t,o)=>{"use strict";o.d(t,{A:()=>l});var n=o(97109),r=o(71242),a=o(88483);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e}).apply(this,arguments)}let l=n.forwardRef((e,t)=>n.createElement(a.A,i({},e,{ref:t,icon:r.A})))},71242:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"}},85493:(e,t,o)=>{"use strict";o.d(t,{A:()=>k});var n=o(97109),r=o(59188),a=o(4216),i=o(45042),l=o(97137),s=o(62188),c=o(67189),d=o(42644),u=o(3638),p=o(92162),m=o(26047),v=o(74567),g=o(15561),f=o(7961),h=o(10540);let b=(e,t,o)=>({background:e,[`${o}-icon`]:{color:t}}),y=(0,h.OF)("Alert",e=>[(e=>{let{componentCls:t,motionDurationSlow:o,marginXS:n,marginSM:r,fontSize:a,fontSizeLG:i,lineHeight:l,borderRadiusLG:s,motionEaseInOutCirc:c,withDescriptionIconSize:d,colorText:u,colorTextHeading:p,withDescriptionPadding:m,defaultPadding:v,lineWidth:h,lineType:b,colorSuccessBorder:y,colorWarningBorder:$,colorErrorBorder:S,colorInfoBorder:w}=e;return{[t]:{...(0,f.dF)(e),position:"relative",display:"flex",alignItems:"center",padding:v,wordWrap:"break-word",borderRadius:s,borderWidth:(0,g.zA)(h),borderStyle:b,[`&${t}-success`]:{borderColor:y},[`&${t}-info`]:{borderColor:w},[`&${t}-warning`]:{borderColor:$},[`&${t}-error`]:{borderColor:S},[`&${t}-filled`]:{borderColor:"transparent"},[`&${t}-rtl`]:{direction:"rtl"},[`${t}-section`]:{flex:1,minWidth:0},[`${t}-icon`]:{marginInlineEnd:n,lineHeight:0},"&-description":{display:"none",fontSize:a,lineHeight:l},"&-title":{color:p},[`&${t}-motion-leave`]:{overflow:"hidden",opacity:1,transition:["max-height","opacity","padding-top","padding-bottom","margin-bottom"].map(e=>`${e} ${o} ${c}`).join(", ")},[`&${t}-motion-leave-active`]:{maxHeight:0,marginBottom:"0 !important",paddingTop:0,paddingBottom:0,opacity:0},[`&${t}-with-description`]:{alignItems:"flex-start",padding:m,[`${t}-icon`]:{marginInlineEnd:r,fontSize:d,lineHeight:0},[`${t}-title`]:{display:"block",marginBottom:n,color:p,fontSize:i},[`${t}-description`]:{display:"block",color:u}},[`&${t}-banner`]:{marginBottom:0,border:"0 !important",borderRadius:0}}}})(e),(e=>{let{componentCls:t,colorSuccess:o,colorSuccessBg:n,colorWarning:r,colorWarningBg:a,colorError:i,colorErrorBg:l,colorInfo:s,colorInfoBg:c}=e;return{[t]:{"&-success":b(n,o,t),"&-info":b(c,s,t),"&-warning":b(a,r,t),"&-error":{...b(l,i,t),[`${t}-description > pre`]:{margin:0,padding:0}}}}})(e),(e=>{let{componentCls:t,iconCls:o,motionDurationMid:n,marginXS:r,fontSizeIcon:a,colorIcon:i,colorIconHover:l}=e;return{[t]:{[`${t}-actions`]:{marginInlineStart:r},[`${t}-close-icon`]:{marginInlineStart:r,padding:0,overflow:"hidden",fontSize:a,lineHeight:(0,g.zA)(a),backgroundColor:"transparent",border:"none",cursor:"pointer",...(0,f.K8)(e),[`${o}-close`]:{color:i,transition:`color ${n}`,"&:hover":{color:l}}},"&-close-text":{color:i,transition:`color ${n}`,"&:hover":{color:l}}}}})(e)],e=>({withDescriptionIconSize:e.fontSizeHeading3,defaultPadding:`${e.paddingContentVerticalSM}px 12px`,withDescriptionPadding:`${e.paddingMD}px ${e.paddingContentHorizontalLG}px`})),$=e=>{let{icon:t,type:o,className:i,style:c,successIcon:d,infoIcon:u,warningIcon:p,errorIcon:m}=e,v={success:d??n.createElement(r.A,null),info:u??n.createElement(s.A,null),error:m??n.createElement(a.A,null),warning:p??n.createElement(l.A,null)};return n.createElement("span",{className:i,style:c},t??v[o])},S=e=>{let{isClosable:t,prefixCls:o,closeIcon:r,handleClose:a,ariaProps:l,className:s,style:c}=e,d=!0===r||void 0===r?n.createElement(i.A,null):r;return t?n.createElement("button",{type:"button",onClick:a,className:(0,u.$)(`${o}-close-icon`,s),tabIndex:0,style:c,...l},d):null},w=n.forwardRef((e,t)=>{let{description:o,prefixCls:r,message:a,title:i,banner:l,className:s,rootClassName:g,style:f,onMouseEnter:h,onMouseLeave:b,onClick:w,afterClose:x,showIcon:E,closable:C,closeText:j,closeIcon:A,action:I,id:N,styles:k,classNames:P,...R}=e,z=i??a,[M,_]=n.useState(!1),O=n.useRef(null);n.useImperativeHandle(t,()=>({nativeElement:O.current}));let{getPrefixCls:D,direction:H,variant:q,closable:B,closeIcon:T,className:L,style:V,classNames:X,styles:Q,successIcon:F,infoIcon:G,warningIcon:K,errorIcon:W}=(0,v.TP)("alert"),U=D("alert",r),[J,Y]=y(U),{onClose:Z,afterClose:ee}=(0,m.Qd)(C)?C:{},et=t=>{_(!0),(Z??e.onClose)?.(t)},eo=n.useMemo(()=>void 0!==e.type?e.type:l?"warning":"info",[e.type,l]),en=e.variant??q??"outlined",er=n.useMemo(()=>!!(0,m.Qd)(C)&&!!C.closeIcon||!!j||("boolean"==typeof C?C:!!(!1!==A&&(0,m.R)(A))||!!B),[j,A,C,B]),ea=!!l&&void 0===E||E,ei={...e,prefixCls:U,variant:en,type:eo,showIcon:ea,closable:er},el=(0,p.XT)(V),es=(0,p.XT)(f),[ec,ed]=(0,p.AV)([X,P],[Q,el,k,es],{props:ei}),eu=(0,u.$)(U,`${U}-${eo}`,`${U}-${en}`,{[`${U}-with-description`]:!!o,[`${U}-no-icon`]:!ea,[`${U}-banner`]:!!l,[`${U}-rtl`]:"rtl"===H},L,s,g,ec.root,Y,J),ep=(0,d.KE)(R,{aria:!0,data:!0}),em=n.useMemo(()=>(0,m.Qd)(C)&&C.closeIcon?C.closeIcon:j||(void 0!==A?A:(0,m.Qd)(B)&&B.closeIcon?B.closeIcon:T),[A,C,B,j,T]),ev=n.useMemo(()=>{let e=C??B;return(0,m.Qd)(e)?(0,d.KE)(e,{data:!0,aria:!0}):{}},[C,B]);return n.createElement(c.Ay,{visible:!M,motionName:`${U}-motion`,motionAppear:!1,motionEnter:!1,onLeaveStart:e=>({maxHeight:e.offsetHeight}),onLeaveEnd:ee??x},({className:t,style:r},a)=>n.createElement("div",{id:N,ref:(0,d.K4)(O,a),"data-show":!M,className:(0,u.$)(eu,t),style:{...ed.root,...r},onMouseEnter:h,onMouseLeave:b,onClick:w,role:"alert",...ep},ea?n.createElement($,{className:(0,u.$)(`${U}-icon`,ec.icon),style:ed.icon,description:o,icon:e.icon,prefixCls:U,type:eo,successIcon:F,infoIcon:G,warningIcon:K,errorIcon:W}):null,n.createElement("div",{className:(0,u.$)(`${U}-section`,ec.section),style:ed.section},z?n.createElement("div",{className:(0,u.$)(`${U}-title`,ec.title),style:ed.title},z):null,o?n.createElement("div",{className:(0,u.$)(`${U}-description`,ec.description),style:ed.description},o):null),I?n.createElement("div",{className:(0,u.$)(`${U}-actions`,ec.actions),style:ed.actions},I):null,n.createElement(S,{className:ec.close,style:ed.close,isClosable:er,prefixCls:U,closeIcon:em,handleClose:et,ariaProps:ev})))});var x=o(41113),E=o(49939),C=o(90218),j=o(13076),A=o(83784),I=o(15472);let N=function(e){function t(){var e,o,n;return(0,x.A)(this,t),o=t,n=arguments,o=(0,C.A)(o),(e=(0,A.A)(this,(0,j.A)()?Reflect.construct(o,n||[],(0,C.A)(this).constructor):o.apply(this,n))).state={error:void 0,info:{}},e}return(0,I.A)(t,e),(0,E.A)(t,[{key:"componentDidCatch",value:function(e,t){this.setState({error:e,info:t})}},{key:"render",value:function(){let{message:e,title:t,description:o,id:r,children:a}=this.props,{error:i,info:l}=this.state,s=t??e,c=l?.componentStack||null,d=(0,m.R)(s)?s:i?.toString(),u=(0,m.R)(o)?o:c;return i?n.createElement(w,{id:r,type:"error",title:d,description:n.createElement("pre",{style:{fontSize:"0.9em",overflowX:"auto"}},u)}):a}}])}(n.PureComponent);w.ErrorBoundary=N;let k=w},88785:(e,t,o)=>{"use strict";o.r(t),o.d(t,{default:()=>f});var n=o(65321),r=o(97109),a=o(3454),i=o.n(a),l=o(86109),s=o(17807),c=o(6578),d=o(39507),u=o(8665),p=o(57481),m=o(28629),v=o(34038),g=o(52057);function f(){var e,t,o;let a=(0,g.s_)(),f=(0,l.useRouter)(),h=(0,d.Vr)(),{message:b}=s.A.useApp(),[y,$]=(0,r.useState)([]),[S,w]=(0,r.useState)([]),[x,E]=(0,r.useState)(""),[C,j]=(0,r.useState)(""),[A,I]=(0,r.useState)([]),[N,k]=(0,r.useState)(""),[P,R]=(0,r.useState)(!1),[z,M]=(0,r.useState)(null),[_,O]=(0,r.useState)(!0);(0,r.useEffect)(()=>{(async()=>{try{let[e,t]=await Promise.all([(0,c.ef)(),(0,c.dx)()]);w(e.groups),E(e.projectRoot),$(t)}catch(e){b.error(e instanceof Error?e.message:"读取项目资料/提示词失败")}})()},[b]);let D=(0,r.useMemo)(()=>S.map(e=>({value:e.root,label:"".concat(e.root,"(").concat(e.fileCount," 份").concat(e.mixedProjectNos?" \xb7 含多个项目编号,需先拆分":"",")")})),[S]),H=(0,r.useMemo)(()=>y.filter(e=>"custom"===e.source).map(e=>({value:e.id,label:e.projectName})),[y,x]),q=(0,r.useMemo)(()=>H.filter(e=>A.includes(e.value)),[H,A]),B=null!=(e=D.find(e=>e.value===C))?e:null,T=(0,r.useCallback)(e=>{j(e)},[]),L=(0,r.useCallback)(async()=>{if(0!==q.length&&B){R(!0);try{let e=await (0,c.OX)({promptIds:A,requirement:N,materialRoot:C,...C?{projectName:C}:{},projectRoot:x});if(!e.documentId)throw Error("服务端未返回 documentId");await f.push("/canvas/".concat(encodeURIComponent(e.documentId),"?projectRoot=").concat(encodeURIComponent(x)))}catch(e){b.error(e instanceof Error?e.message:"创建生成任务失败")}finally{R(!1)}}},[q,B,A,N,x,f,b]),V=(0,r.useCallback)(async()=>{if(0!==q.length&&B)try{let e=await (0,c.dk)({promptIds:A,requirement:N,materialRoot:C,...C?{projectName:C}:{},projectRoot:x});M({title:e.title,chapters:e.chapters,outlineSource:e.derivation.outlineSource,materialScope:e.materialScope})}catch(e){b.error(e instanceof Error?e.message:"结构预览失败")}},[q,B,A,N,x,b]);return(0,n.jsxs)("div",{className:"canvasRoot",children:[(0,n.jsx)(i(),{children:(0,n.jsx)("title",{children:h("nav.canvas")})}),(0,n.jsx)("div",{ref:a.containerRef,className:"canvasStage",style:{backgroundImage:"radial-gradient(var(--canvasGridDot) 1px, transparent 1px)",backgroundSize:"".concat(g.VF*a.view.k,"px ").concat(g.VF*a.view.k,"px"),backgroundPosition:"".concat(a.view.x,"px ").concat(a.view.y,"px"),cursor:"grab"},onPointerDown:a.onPointerDown,onPointerMove:a.onPointerMove,onPointerUp:a.endDrag,onPointerLeave:a.endDrag,children:(0,n.jsx)("div",{style:{position:"absolute",inset:0,display:"grid",placeItems:"center",pointerEvents:"none"},children:(0,n.jsxs)("div",{style:{textAlign:"center",maxWidth:420},children:[(0,n.jsx)("div",{style:{fontSize:15,marginBottom:6},children:"新画布"}),(0,n.jsxs)("div",{style:{fontSize:12,color:"var(--colorTextSecondary)",lineHeight:1.7},children:["还没有节点日志——节点日志是唯一真相源,这里不造占位节点。",(0,n.jsx)("br",{}),"点屏幕底部中央那个 ",(0,n.jsx)("b",{children:"^"})," 展开输入框:用里面的「+」选择提示词与项目, 写下要求后点「生成」,节点会随日志追加而出现。"]})]})})}),(0,n.jsx)(p._,{...x?{projectRoot:x}:{},onSelect:e=>{f.push((0,m.p)(e.id,e.projectRoot||x))},onCurrentDeleted:()=>void 0}),(0,n.jsx)(u._,{value:N,onChange:k,onSend:()=>{L()},generating:!1,submitting:P,disabled:!1,requireGenerationSetup:!0,promptOptions:H,projectOptions:D,selectedPrompts:q,selectedProject:B,onSelectPrompts:I,onSelectProject:T,selectedNode:null,onMentionSelected:()=>void 0,resumable:!1,onContinue:()=>void 0,onPreviewStructure:()=>{V()},collapsed:_,onToggleCollapsed:O}),(0,n.jsx)(v.B,{open:!!z,title:null!=(t=null==z?void 0:z.title)?t:"",chapters:null!=(o=null==z?void 0:z.chapters)?o:[],...(null==z?void 0:z.outlineSource)?{outlineSource:z.outlineSource}:{},...(null==z?void 0:z.materialScope)?{materialScope:z.materialScope}:{},onClose:()=>M(null)})]})}},89857:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"}}},e=>{e.O(0,[324,280,576,499,127,530,636,593,792],()=>e(e.s=48161)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[124],{20241:(e,t,o)=>{"use strict";o.d(t,{A:()=>l});var n=o(97109),r=o(89857),a=o(88483);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e}).apply(this,arguments)}let l=n.forwardRef((e,t)=>n.createElement(a.A,i({},e,{ref:t,icon:r.A})))},48161:(e,t,o)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/canvas",function(){return o(88785)}])},54746:(e,t,o)=>{"use strict";o.d(t,{A:()=>l});var n=o(97109),r=o(71242),a=o(88483);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e}).apply(this,arguments)}let l=n.forwardRef((e,t)=>n.createElement(a.A,i({},e,{ref:t,icon:r.A})))},71242:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"}},85493:(e,t,o)=>{"use strict";o.d(t,{A:()=>k});var n=o(97109),r=o(59188),a=o(4216),i=o(45042),l=o(97137),s=o(62188),c=o(67189),d=o(42644),u=o(3638),p=o(92162),m=o(26047),v=o(74567),g=o(15561),f=o(7961),h=o(10540);let b=(e,t,o)=>({background:e,[`${o}-icon`]:{color:t}}),y=(0,h.OF)("Alert",e=>[(e=>{let{componentCls:t,motionDurationSlow:o,marginXS:n,marginSM:r,fontSize:a,fontSizeLG:i,lineHeight:l,borderRadiusLG:s,motionEaseInOutCirc:c,withDescriptionIconSize:d,colorText:u,colorTextHeading:p,withDescriptionPadding:m,defaultPadding:v,lineWidth:h,lineType:b,colorSuccessBorder:y,colorWarningBorder:$,colorErrorBorder:S,colorInfoBorder:w}=e;return{[t]:{...(0,f.dF)(e),position:"relative",display:"flex",alignItems:"center",padding:v,wordWrap:"break-word",borderRadius:s,borderWidth:(0,g.zA)(h),borderStyle:b,[`&${t}-success`]:{borderColor:y},[`&${t}-info`]:{borderColor:w},[`&${t}-warning`]:{borderColor:$},[`&${t}-error`]:{borderColor:S},[`&${t}-filled`]:{borderColor:"transparent"},[`&${t}-rtl`]:{direction:"rtl"},[`${t}-section`]:{flex:1,minWidth:0},[`${t}-icon`]:{marginInlineEnd:n,lineHeight:0},"&-description":{display:"none",fontSize:a,lineHeight:l},"&-title":{color:p},[`&${t}-motion-leave`]:{overflow:"hidden",opacity:1,transition:["max-height","opacity","padding-top","padding-bottom","margin-bottom"].map(e=>`${e} ${o} ${c}`).join(", ")},[`&${t}-motion-leave-active`]:{maxHeight:0,marginBottom:"0 !important",paddingTop:0,paddingBottom:0,opacity:0},[`&${t}-with-description`]:{alignItems:"flex-start",padding:m,[`${t}-icon`]:{marginInlineEnd:r,fontSize:d,lineHeight:0},[`${t}-title`]:{display:"block",marginBottom:n,color:p,fontSize:i},[`${t}-description`]:{display:"block",color:u}},[`&${t}-banner`]:{marginBottom:0,border:"0 !important",borderRadius:0}}}})(e),(e=>{let{componentCls:t,colorSuccess:o,colorSuccessBg:n,colorWarning:r,colorWarningBg:a,colorError:i,colorErrorBg:l,colorInfo:s,colorInfoBg:c}=e;return{[t]:{"&-success":b(n,o,t),"&-info":b(c,s,t),"&-warning":b(a,r,t),"&-error":{...b(l,i,t),[`${t}-description > pre`]:{margin:0,padding:0}}}}})(e),(e=>{let{componentCls:t,iconCls:o,motionDurationMid:n,marginXS:r,fontSizeIcon:a,colorIcon:i,colorIconHover:l}=e;return{[t]:{[`${t}-actions`]:{marginInlineStart:r},[`${t}-close-icon`]:{marginInlineStart:r,padding:0,overflow:"hidden",fontSize:a,lineHeight:(0,g.zA)(a),backgroundColor:"transparent",border:"none",cursor:"pointer",...(0,f.K8)(e),[`${o}-close`]:{color:i,transition:`color ${n}`,"&:hover":{color:l}}},"&-close-text":{color:i,transition:`color ${n}`,"&:hover":{color:l}}}}})(e)],e=>({withDescriptionIconSize:e.fontSizeHeading3,defaultPadding:`${e.paddingContentVerticalSM}px 12px`,withDescriptionPadding:`${e.paddingMD}px ${e.paddingContentHorizontalLG}px`})),$=e=>{let{icon:t,type:o,className:i,style:c,successIcon:d,infoIcon:u,warningIcon:p,errorIcon:m}=e,v={success:d??n.createElement(r.A,null),info:u??n.createElement(s.A,null),error:m??n.createElement(a.A,null),warning:p??n.createElement(l.A,null)};return n.createElement("span",{className:i,style:c},t??v[o])},S=e=>{let{isClosable:t,prefixCls:o,closeIcon:r,handleClose:a,ariaProps:l,className:s,style:c}=e,d=!0===r||void 0===r?n.createElement(i.A,null):r;return t?n.createElement("button",{type:"button",onClick:a,className:(0,u.$)(`${o}-close-icon`,s),tabIndex:0,style:c,...l},d):null},w=n.forwardRef((e,t)=>{let{description:o,prefixCls:r,message:a,title:i,banner:l,className:s,rootClassName:g,style:f,onMouseEnter:h,onMouseLeave:b,onClick:w,afterClose:x,showIcon:E,closable:C,closeText:j,closeIcon:A,action:I,id:N,styles:k,classNames:P,...R}=e,z=i??a,[M,_]=n.useState(!1),O=n.useRef(null);n.useImperativeHandle(t,()=>({nativeElement:O.current}));let{getPrefixCls:D,direction:H,variant:q,closable:B,closeIcon:T,className:L,style:V,classNames:X,styles:Q,successIcon:F,infoIcon:G,warningIcon:K,errorIcon:W}=(0,v.TP)("alert"),U=D("alert",r),[J,Y]=y(U),{onClose:Z,afterClose:ee}=(0,m.Qd)(C)?C:{},et=t=>{_(!0),(Z??e.onClose)?.(t)},eo=n.useMemo(()=>void 0!==e.type?e.type:l?"warning":"info",[e.type,l]),en=e.variant??q??"outlined",er=n.useMemo(()=>!!(0,m.Qd)(C)&&!!C.closeIcon||!!j||("boolean"==typeof C?C:!!(!1!==A&&(0,m.R)(A))||!!B),[j,A,C,B]),ea=!!l&&void 0===E||E,ei={...e,prefixCls:U,variant:en,type:eo,showIcon:ea,closable:er},el=(0,p.XT)(V),es=(0,p.XT)(f),[ec,ed]=(0,p.AV)([X,P],[Q,el,k,es],{props:ei}),eu=(0,u.$)(U,`${U}-${eo}`,`${U}-${en}`,{[`${U}-with-description`]:!!o,[`${U}-no-icon`]:!ea,[`${U}-banner`]:!!l,[`${U}-rtl`]:"rtl"===H},L,s,g,ec.root,Y,J),ep=(0,d.KE)(R,{aria:!0,data:!0}),em=n.useMemo(()=>(0,m.Qd)(C)&&C.closeIcon?C.closeIcon:j||(void 0!==A?A:(0,m.Qd)(B)&&B.closeIcon?B.closeIcon:T),[A,C,B,j,T]),ev=n.useMemo(()=>{let e=C??B;return(0,m.Qd)(e)?(0,d.KE)(e,{data:!0,aria:!0}):{}},[C,B]);return n.createElement(c.Ay,{visible:!M,motionName:`${U}-motion`,motionAppear:!1,motionEnter:!1,onLeaveStart:e=>({maxHeight:e.offsetHeight}),onLeaveEnd:ee??x},({className:t,style:r},a)=>n.createElement("div",{id:N,ref:(0,d.K4)(O,a),"data-show":!M,className:(0,u.$)(eu,t),style:{...ed.root,...r},onMouseEnter:h,onMouseLeave:b,onClick:w,role:"alert",...ep},ea?n.createElement($,{className:(0,u.$)(`${U}-icon`,ec.icon),style:ed.icon,description:o,icon:e.icon,prefixCls:U,type:eo,successIcon:F,infoIcon:G,warningIcon:K,errorIcon:W}):null,n.createElement("div",{className:(0,u.$)(`${U}-section`,ec.section),style:ed.section},z?n.createElement("div",{className:(0,u.$)(`${U}-title`,ec.title),style:ed.title},z):null,o?n.createElement("div",{className:(0,u.$)(`${U}-description`,ec.description),style:ed.description},o):null),I?n.createElement("div",{className:(0,u.$)(`${U}-actions`,ec.actions),style:ed.actions},I):null,n.createElement(S,{className:ec.close,style:ed.close,isClosable:er,prefixCls:U,closeIcon:em,handleClose:et,ariaProps:ev})))});var x=o(41113),E=o(49939),C=o(90218),j=o(13076),A=o(83784),I=o(15472);let N=function(e){function t(){var e,o,n;return(0,x.A)(this,t),o=t,n=arguments,o=(0,C.A)(o),(e=(0,A.A)(this,(0,j.A)()?Reflect.construct(o,n||[],(0,C.A)(this).constructor):o.apply(this,n))).state={error:void 0,info:{}},e}return(0,I.A)(t,e),(0,E.A)(t,[{key:"componentDidCatch",value:function(e,t){this.setState({error:e,info:t})}},{key:"render",value:function(){let{message:e,title:t,description:o,id:r,children:a}=this.props,{error:i,info:l}=this.state,s=t??e,c=l?.componentStack||null,d=(0,m.R)(s)?s:i?.toString(),u=(0,m.R)(o)?o:c;return i?n.createElement(w,{id:r,type:"error",title:d,description:n.createElement("pre",{style:{fontSize:"0.9em",overflowX:"auto"}},u)}):a}}])}(n.PureComponent);w.ErrorBoundary=N;let k=w},88785:(e,t,o)=>{"use strict";o.r(t),o.d(t,{default:()=>f});var n=o(65321),r=o(97109),a=o(3454),i=o.n(a),l=o(86109),s=o(17807),c=o(6578),d=o(39507),u=o(8665),p=o(57481),m=o(28629),v=o(34038),g=o(52057);function f(){var e,t,o;let a=(0,g.s_)(),f=(0,l.useRouter)(),h=(0,d.Vr)(),{message:b}=s.A.useApp(),[y,$]=(0,r.useState)([]),[S,w]=(0,r.useState)([]),[x,E]=(0,r.useState)(""),[C,j]=(0,r.useState)(""),[A,I]=(0,r.useState)([]),[N,k]=(0,r.useState)(""),[P,R]=(0,r.useState)(!1),[z,M]=(0,r.useState)(null),[_,O]=(0,r.useState)(!0);(0,r.useEffect)(()=>{(async()=>{try{let[e,t]=await Promise.all([(0,c.ef)(),(0,c.dx)()]);w(e.groups),E(e.projectRoot),$(t)}catch(e){b.error(e instanceof Error?e.message:"读取项目资料/提示词失败")}})()},[b]);let D=(0,r.useMemo)(()=>S.map(e=>({value:e.root,label:"".concat(e.root,"(").concat(e.fileCount," 份").concat(e.mixedProjectNos?" \xb7 含多个项目编号,需先拆分":"",")")})),[S]),H=(0,r.useMemo)(()=>y.filter(e=>"custom"===e.source).map(e=>({value:e.id,label:e.projectName})),[y,x]),q=(0,r.useMemo)(()=>H.filter(e=>A.includes(e.value)),[H,A]),B=null!=(e=D.find(e=>e.value===C))?e:null,T=(0,r.useCallback)(e=>{j(e)},[]),L=(0,r.useCallback)(async()=>{if(0!==q.length&&B){R(!0);try{let e=await (0,c.OX)({promptIds:A,requirement:N,materialRoot:C,...C?{projectName:C}:{},projectRoot:x});if(!e.documentId)throw Error("服务端未返回 documentId");await f.push("/canvas/".concat(encodeURIComponent(e.documentId),"?projectRoot=").concat(encodeURIComponent(x)))}catch(e){b.error(e instanceof Error?e.message:"创建生成任务失败")}finally{R(!1)}}},[q,B,A,N,x,f,b]),V=(0,r.useCallback)(async()=>{if(0!==q.length&&B)try{let e=await (0,c.dk)({promptIds:A,requirement:N,materialRoot:C,...C?{projectName:C}:{},projectRoot:x});M({title:e.title,chapters:e.chapters,outlineSource:e.derivation.outlineSource,materialScope:e.materialScope})}catch(e){b.error(e instanceof Error?e.message:"结构预览失败")}},[q,B,A,N,x,b]);return(0,n.jsxs)("div",{className:"canvasRoot",children:[(0,n.jsx)(i(),{children:(0,n.jsx)("title",{children:h("nav.canvas")})}),(0,n.jsx)("div",{ref:a.containerRef,className:"canvasStage",style:{backgroundImage:"radial-gradient(var(--canvasGridDot) 1px, transparent 1px)",backgroundSize:"".concat(g.VF*a.view.k,"px ").concat(g.VF*a.view.k,"px"),backgroundPosition:"".concat(a.view.x,"px ").concat(a.view.y,"px"),cursor:"grab"},onPointerDown:a.onPointerDown,onPointerMove:a.onPointerMove,onPointerUp:a.endDrag,onPointerLeave:a.endDrag,children:(0,n.jsx)("div",{style:{position:"absolute",inset:0,display:"grid",placeItems:"center",pointerEvents:"none"},children:(0,n.jsxs)("div",{style:{textAlign:"center",maxWidth:420},children:[(0,n.jsx)("div",{style:{fontSize:15,marginBottom:6},children:"新画布"}),(0,n.jsxs)("div",{style:{fontSize:12,color:"var(--colorTextSecondary)",lineHeight:1.7},children:["还没有节点日志——节点日志是唯一真相源,这里不造占位节点。",(0,n.jsx)("br",{}),"点屏幕底部中央那个 ",(0,n.jsx)("b",{children:"^"})," 展开输入框:用里面的「+」选择提示词与项目, 写下要求后点「生成」,节点会随日志追加而出现。"]})]})})}),(0,n.jsx)(p._,{...x?{projectRoot:x}:{},onSelect:e=>{f.push((0,m.p)(e.id,e.projectRoot||x))},onCurrentDeleted:()=>void 0}),(0,n.jsx)(u._,{value:N,onChange:k,onSend:()=>{L()},generating:!1,submitting:P,disabled:!1,requireGenerationSetup:!0,promptOptions:H,projectOptions:D,selectedPrompts:q,selectedProject:B,onSelectPrompts:I,onSelectProject:T,selectedNode:null,onMentionSelected:()=>void 0,resumable:!1,onContinue:()=>void 0,onPreviewStructure:()=>{V()},collapsed:_,onToggleCollapsed:O}),(0,n.jsx)(v.B,{open:!!z,title:null!=(t=null==z?void 0:z.title)?t:"",chapters:null!=(o=null==z?void 0:z.chapters)?o:[],...(null==z?void 0:z.outlineSource)?{outlineSource:z.outlineSource}:{},...(null==z?void 0:z.materialScope)?{materialScope:z.materialScope}:{},onClose:()=>M(null)})]})}},89857:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"}}},e=>{e.O(0,[717,551,576,499,127,530,636,593,792],()=>e(e.s=48161)),_N_E=e.O()}]);
|