@lumyne/omni-desktop-app 0.1.16 → 0.1.20
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/app/assets/{CartesianChart-CGNvk6St.js → CartesianChart-aa0EJ6w3.js} +1 -1
- package/app/assets/{CollaborationWorkspace-YQKm5DVb.js → CollaborationWorkspace-mIgLrpSm.js} +1 -1
- package/app/assets/{CompetitorAnalysis-BGZeiXTW.js → CompetitorAnalysis-Ct6wLjw6.js} +1 -1
- package/app/assets/EmptyState-CpQOdGYD.js +1 -0
- package/app/assets/{ErrorBarContext-BRHs6mfT.js → ErrorBarContext-BeuyujN4.js} +1 -1
- package/app/assets/{EvidenceSourceGuide-ByFna5T0.js → EvidenceSourceGuide-BeBcvVcI.js} +1 -1
- package/app/assets/{FavoritePicker-DLuTORpI.js → FavoritePicker-LfvebaXO.js} +1 -1
- package/app/assets/{Favorites-BL-1v7QD.js → Favorites-C6Xd2Vyz.js} +1 -1
- package/app/assets/{HelpTip-DaIyNCfF.js → HelpTip-BfrAVfV_.js} +1 -1
- package/app/assets/{LineChart-Dg6rxQct.js → LineChart-tppycNHl.js} +1 -1
- package/app/assets/{Opportunities-Dw5CnA2W.js → Opportunities-BfmikZ5o.js} +1 -1
- package/app/assets/{ProgressiveRows-DfUZC_6R.js → ProgressiveRows-CNmxc71t.js} +1 -1
- package/app/assets/{ShopLayoutPage-AkChJyxu.js → ShopLayoutPage-B943t2t1.js} +1 -1
- package/app/assets/{TrendChart-DURd5oGd.js → TrendChart-Doe6C5Aa.js} +1 -1
- package/app/assets/arrow-down-Dm8ejo47.js +1 -0
- package/app/assets/arrow-left-CrtjcWhu.js +1 -0
- package/app/assets/arrow-up-right-FAUwydEi.js +1 -0
- package/app/assets/{book-open-Bce54GC0.js → book-open-BHnwW_0N.js} +1 -1
- package/app/assets/{calendar-days-A-WQG43X.js → calendar-days-DQXKth-z.js} +1 -1
- package/app/assets/{chart-column-DueDyWTO.js → chart-column-B3ugUaKH.js} +1 -1
- package/app/assets/{chart-no-axes-combined-0SqHx_x6.js → chart-no-axes-combined-DbjiVuVa.js} +1 -1
- package/app/assets/check-B7m80-Hk.js +1 -0
- package/app/assets/chevron-down-9e3l9_Db.js +1 -0
- package/app/assets/chevron-right-DyOe1NsY.js +1 -0
- package/app/assets/{clock-3-BpHSopJF.js → clock-3-TXgD8tS6.js} +1 -1
- package/app/assets/{components-HGHI0_0I.js → components-DMbkJLkK.js} +2 -2
- package/app/assets/{download-Dsft-5wR.js → download-BMipQ3n8.js} +1 -1
- package/app/assets/entry-C4p4TKbJ.js +1 -0
- package/app/assets/{entry-TXFczQeM.js → entry-CGu91Jpg.js} +2 -2
- package/app/assets/{entry-CJFtoBLa.js → entry-CeW_5ZGi.js} +1 -1
- package/app/assets/{entry-CNxdnf29.js → entry-Cxj3NkyT.js} +3 -3
- package/app/assets/{entry-CZo_9EKi.js → entry-DcwBlAO0.js} +2 -2
- package/app/assets/{entry-DQEAnjCp.js → entry-aDwWfs__.js} +1 -1
- package/app/assets/{favorites.module-D06hxuat.js → favorites.module-CaTR2ido.js} +1 -1
- package/app/assets/{file-text-BpkjdOot.js → file-text-D6meDmAz.js} +1 -1
- package/app/assets/{getRadiusAndStrokeWidthFromDot-BX82bq7e.js → getRadiusAndStrokeWidthFromDot-zEte6bM_.js} +1 -1
- package/app/assets/{grid-2x2-Cb1v7yqK.js → grid-2x2-sRKLAhuD.js} +1 -1
- package/app/assets/{index-CShNDEcL.js → index-Dfy2jMWq.js} +2 -2
- package/app/assets/{layers-C4KI3Uxn.js → layers-B4gCFnEm.js} +1 -1
- package/app/assets/{layout-dashboard-CTmjmcDE.js → layout-dashboard-C54_ZKS5.js} +1 -1
- package/app/assets/{link-2-BrR_cwPw.js → link-2-CC7rgyRC.js} +1 -1
- package/app/assets/{list-Djz-XKts.js → list-DI2UZ46g.js} +1 -1
- package/app/assets/{module-host-rk0glcaW.js → module-host-BIy_fI1T.js} +1 -1
- package/app/assets/{orbit-Bw_YF8Ru.js → orbit-tMF8WRbG.js} +1 -1
- package/app/assets/{package-b8jiLApm.js → package-rnaOiBPn.js} +1 -1
- package/app/assets/play-DjZ3mG-r.js +1 -0
- package/app/assets/plus-_W4OFi32.js +1 -0
- package/app/assets/{products-DTLdF8-b.js → products-6S_LnOq6.js} +1 -1
- package/app/assets/{project-public-DQMVYsEz.js → project-public-B9DNEfwS.js} +1 -1
- package/app/assets/{project-public-CnKWSlv4.js → project-public-DN0-E_G2.js} +1 -1
- package/app/assets/public-Csb687JC.js +1 -0
- package/app/assets/{refresh-cw-BwEoF6sI.js → refresh-cw-CiIEylYp.js} +1 -1
- package/app/assets/search-DlLds8Ae.js +1 -0
- package/app/assets/{star-CjnKtEU7.js → star-CcsEzP_q.js} +1 -1
- package/app/assets/trending-up-CWfLLrC6.js +1 -0
- package/app/assets/{triangle-alert-3SxL0RNM.js → triangle-alert-CEMUxCrJ.js} +1 -1
- package/app/assets/{ui-public-4hoRHIFG.js → ui-public-DVwBGbKN.js} +1 -1
- package/app/assets/{workbench-DRbHsOSr.js → workbench-jvMSCBRw.js} +2 -2
- package/app/assets/{workspace-view-state-DRhGUGLj.js → workspace-view-state-BuK4-c0r.js} +1 -1
- package/app/desktop/main.mjs +10 -9
- package/app/index.html +1 -1
- package/app/tools/bootstrap.bin +0 -0
- package/package.json +1 -1
- package/release.json +1 -1
- package/release.sig +1 -1
- package/app/assets/EmptyState-BrzYB6Fm.js +0 -1
- package/app/assets/arrow-down-f54IiPCV.js +0 -1
- package/app/assets/arrow-left-D6ZJJ6TV.js +0 -1
- package/app/assets/arrow-up-right-D1eLXOum.js +0 -1
- package/app/assets/check-DpavxwQP.js +0 -1
- package/app/assets/chevron-down-DjHGm5jP.js +0 -1
- package/app/assets/chevron-right-D8cbEJBE.js +0 -1
- package/app/assets/entry-bIaBkZxY.js +0 -1
- package/app/assets/play-eKkJOouQ.js +0 -1
- package/app/assets/plus-CuQU-dIh.js +0 -1
- package/app/assets/public-D27wclc8.js +0 -1
- package/app/assets/search-BDEOXxcW.js +0 -1
- package/app/assets/trending-up-BPVwzUjj.js +0 -1
package/app/assets/{CollaborationWorkspace-YQKm5DVb.js → CollaborationWorkspace-mIgLrpSm.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./check-DpavxwQP.js";import{t}from"./chevron-down-DjHGm5jP.js";import{t as n}from"./chevron-right-D8cbEJBE.js";import{t as r}from"./file-text-BpkjdOot.js";import{t as i}from"./list-Djz-XKts.js";import{t as a}from"./plus-CuQU-dIh.js";import{t as o}from"./search-BDEOXxcW.js";import{_ as s,a as c,b as l,c as u,d,h as f,i as p,l as m,v as h,x as g,y as _}from"./index-CShNDEcL.js";import{n as v}from"./module-host-rk0glcaW.js";import{n as y}from"./workspace-view-state-DRhGUGLj.js";import"./public-D27wclc8.js";var b=f(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),x=f(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),S=f(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),C=f(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),w=f(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),T=f(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),E=f(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),D=f(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),O=f(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),ee=f(`panels-top-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M9 21V9`,key:`1oto5p`}]]),te=f(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),ne=f(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),re=f(`pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]),k=f(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),A=g(h(),1),j=u(),ie=(0,A.createContext)(null),ae=`/api/workbench/collaboration`;async function oe(e,t){let n=await fetch(ae+e,{method:t?`POST`:`GET`,headers:t?{"Content-Type":`application/json`}:void 0,body:t?JSON.stringify(t):void 0}),r=await n.json();if(!n.ok)throw Error(typeof r.error==`string`?r.error:r.error?.message||`项目服务暂时不可用`);return r}function se(e){return`${location.origin}${location.pathname}?mode=center&view=projects§ion=all&project=${encodeURIComponent(e)}`}function ce({children:e}){let[t,n]=(0,A.useState)(null),[r,i]=(0,A.useState)(``),a=(0,A.useRef)(void 0),o=(0,A.useRef)(Promise.resolve()),s=(0,A.useRef)(!0);(0,A.useEffect)(()=>(s.current=!0,()=>{s.current=!1}),[]),(0,A.useEffect)(()=>{let e=!0;return oe(`/session`).then(t=>{e&&n(t)}).catch(t=>{e&&i(t.message)}),()=>{e=!1}},[]);let c=(0,A.useCallback)(async(e,n={})=>{let r=o.current.then(async()=>{try{if(!s.current)throw Error(`项目工作区已切换,本次操作已停止`);let r=new URL(e,location.origin),i=r.pathname.replace(/^\/api/,``)+r.search;if(i===`/auth/session`)return Response.json({ok:!0,data:t});if(i===`/state`){let e=await oe(`/state`);return a.current=e.data.revision,Response.json(e)}let o={},c;if(n.body instanceof FormData){c=[];for(let[e,t]of n.body.entries())if(t instanceof File){if(t.size>2*1024*1024)throw Error(`附件最大为 2 MB`);let n=new Uint8Array(await t.arrayBuffer()),r=``;for(let e=0;e<n.length;e+=16384)r+=String.fromCharCode(...n.subarray(e,e+16384));c.push({name:e,file:!0,filename:t.name,type:t.type,base64:btoa(r)})}else c.push({name:e,value:t})}else n.body&&(o=JSON.parse(String(n.body)));let l=new Headers(n.headers),u=await oe(`/command`,{path:i,method:n.method||`GET`,body:o,form:c,clientMemberId:t?.memberId,expectedRevision:a.current,requestId:l.get(`idempotency-key`)||crypto.randomUUID()});return typeof u.revision==`number`&&(a.current=u.revision),Response.json(u)}catch(e){return Response.json({ok:!1,error:{message:e.message,code:`PROJECT_REQUEST_FAILED`}},{status:400})}});return o.current=r.then(()=>void 0,()=>void 0),r},[t]),l=(0,A.useMemo)(()=>({fetch:c,platformIdentity:()=>{if(!t)throw Error(`企业身份尚未就绪`);return t}}),[t,c]);return r?(0,j.jsxs)(`p`,{role:`alert`,children:[r,` `,(0,j.jsx)(`button`,{onClick:()=>location.reload(),children:`重新连接`})]}):t?(0,j.jsx)(ie.Provider,{value:l,children:e}):(0,j.jsx)(`p`,{role:`status`,children:`正在确认企业身份…`})}function le(){let e=(0,A.useContext)(ie);if(!e)throw Error(`需要企业项目上下文`);return e}var ue=0,de=new Set;function M(){ue=Date.now();for(let e of de)e()}function fe(){let e=ue>0&&Date.now()-ue<3e4;return ue=0,e}function pe(e){return de.add(e),()=>{de.delete(e)}}function me(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var N=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,he=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,P={};function ge(e,t){return((t||P).jsx?he:N).test(e)}var F=/[ \t\n\f\r]/g;function _e(e){return typeof e==`object`?e.type===`text`?ve(e.value):!1:ve(e)}function ve(e){return e.replace(F,``)===``}var ye=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};ye.prototype.normal={},ye.prototype.property={},ye.prototype.space=void 0;function be(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new ye(n,r,t)}function I(e){return e.toLowerCase()}var L=class{constructor(e,t){this.attribute=t,this.property=e}};L.prototype.attribute=``,L.prototype.booleanish=!1,L.prototype.boolean=!1,L.prototype.commaOrSpaceSeparated=!1,L.prototype.commaSeparated=!1,L.prototype.defined=!1,L.prototype.mustUseProperty=!1,L.prototype.number=!1,L.prototype.overloadedBoolean=!1,L.prototype.property=``,L.prototype.spaceSeparated=!1,L.prototype.space=void 0;var xe=l({boolean:()=>R,booleanish:()=>z,commaOrSpaceSeparated:()=>we,commaSeparated:()=>H,number:()=>B,overloadedBoolean:()=>Ce,spaceSeparated:()=>V}),Se=0,R=U(),z=U(),Ce=U(),B=U(),V=U(),H=U(),we=U();function U(){return 2**++Se}var Te=Object.keys(xe),Ee=class extends L{constructor(e,t,n,r){let i=-1;if(super(e,t),De(this,`space`,r),typeof n==`number`)for(;++i<Te.length;){let e=Te[i];De(this,Te[i],(n&xe[e])===xe[e])}}};Ee.prototype.defined=!0;function De(e,t,n){n&&(e[t]=n)}function Oe(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Ee(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[I(r)]=r,n[I(a.attribute)]=r}return new ye(t,n,e.space)}var ke=Oe({properties:{ariaActiveDescendant:null,ariaAtomic:z,ariaAutoComplete:null,ariaBusy:z,ariaChecked:z,ariaColCount:B,ariaColIndex:B,ariaColSpan:B,ariaControls:V,ariaCurrent:null,ariaDescribedBy:V,ariaDetails:null,ariaDisabled:z,ariaDropEffect:V,ariaErrorMessage:null,ariaExpanded:z,ariaFlowTo:V,ariaGrabbed:z,ariaHasPopup:null,ariaHidden:z,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:V,ariaLevel:B,ariaLive:null,ariaModal:z,ariaMultiLine:z,ariaMultiSelectable:z,ariaOrientation:null,ariaOwns:V,ariaPlaceholder:null,ariaPosInSet:B,ariaPressed:z,ariaReadOnly:z,ariaRelevant:null,ariaRequired:z,ariaRoleDescription:V,ariaRowCount:B,ariaRowIndex:B,ariaRowSpan:B,ariaSelected:z,ariaSetSize:B,ariaSort:null,ariaValueMax:B,ariaValueMin:B,ariaValueNow:B,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Ae(e,t){return t in e?e[t]:t}function je(e,t){return Ae(e,t.toLowerCase())}var Me=Oe({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:H,acceptCharset:V,accessKey:V,action:null,allow:null,allowFullScreen:R,allowPaymentRequest:R,allowUserMedia:R,alpha:R,alt:null,as:null,async:R,autoCapitalize:null,autoComplete:V,autoFocus:R,autoPlay:R,blocking:V,capture:null,charSet:null,checked:R,cite:null,className:V,closedBy:null,colorSpace:null,cols:B,colSpan:B,command:null,commandFor:null,content:null,contentEditable:z,controls:R,controlsList:V,coords:B|H,crossOrigin:null,data:null,dateTime:null,decoding:null,default:R,defer:R,dir:null,dirName:null,disabled:R,download:Ce,draggable:z,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:R,formTarget:null,headers:V,height:B,hidden:Ce,high:B,href:null,hrefLang:null,htmlFor:V,httpEquiv:V,id:null,imageSizes:null,imageSrcSet:null,inert:R,inputMode:null,integrity:null,is:null,isMap:R,itemId:null,itemProp:V,itemRef:V,itemScope:R,itemType:V,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:R,low:B,manifest:null,max:null,maxLength:B,media:null,method:null,min:null,minLength:B,multiple:R,muted:R,name:null,nonce:null,noModule:R,noValidate:R,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:R,optimum:B,pattern:null,ping:V,placeholder:null,playsInline:R,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:R,referrerPolicy:null,rel:V,required:R,reversed:R,rows:B,rowSpan:B,sandbox:V,scope:null,scoped:R,seamless:R,selected:R,shadowRootClonable:R,shadowRootCustomElementRegistry:R,shadowRootDelegatesFocus:R,shadowRootMode:null,shadowRootSerializable:R,shape:null,size:B,sizes:null,slot:null,span:B,spellCheck:z,src:null,srcDoc:null,srcLang:null,srcSet:null,start:B,step:null,style:null,tabIndex:B,target:null,title:null,translate:null,type:null,typeMustMatch:R,useMap:null,value:z,width:B,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:V,axis:null,background:null,bgColor:null,border:B,borderColor:null,bottomMargin:B,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:R,declare:R,event:null,face:null,frame:null,frameBorder:null,hSpace:B,leftMargin:B,link:null,longDesc:null,lowSrc:null,marginHeight:B,marginWidth:B,noResize:R,noHref:R,noShade:R,noWrap:R,object:null,profile:null,prompt:null,rev:null,rightMargin:B,rules:null,scheme:null,scrolling:z,standby:null,summary:null,text:null,topMargin:B,valueType:null,version:null,vAlign:null,vLink:null,vSpace:B,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:R,disablePictureInPicture:R,disableRemotePlayback:R,exportParts:H,part:V,prefix:null,property:null,results:B,security:null,unselectable:null},space:`html`,transform:je}),Ne=Oe({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:we,accentHeight:B,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:B,amplitude:B,arabicForm:null,ascent:B,attributeName:null,attributeType:null,azimuth:B,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:B,by:null,calcMode:null,capHeight:B,className:V,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:B,diffuseConstant:B,direction:null,display:null,dur:null,divisor:B,dominantBaseline:null,download:R,dx:null,dy:null,edgeMode:null,editable:null,elevation:B,enableBackground:null,end:null,event:null,exponent:B,externalResourcesRequired:null,fill:null,fillOpacity:B,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:H,g2:H,glyphName:H,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:B,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:B,horizOriginX:B,horizOriginY:B,id:null,ideographic:B,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:B,k:B,k1:B,k2:B,k3:B,k4:B,kernelMatrix:we,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:B,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:B,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:B,overlineThickness:B,paintOrder:null,panose1:null,path:null,pathLength:B,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:V,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:B,pointsAtY:B,pointsAtZ:B,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:we,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:we,rev:we,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:we,requiredFeatures:we,requiredFonts:we,requiredFormats:we,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:B,specularExponent:B,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:B,strikethroughThickness:B,string:null,stroke:null,strokeDashArray:we,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:B,strokeOpacity:B,strokeWidth:null,style:null,surfaceScale:B,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:we,tabIndex:B,tableValues:null,target:null,targetX:B,targetY:B,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:we,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:B,underlineThickness:B,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:B,values:null,vAlphabetic:B,vMathematical:B,vectorEffect:null,vHanging:B,vIdeographic:B,version:null,vertAdvY:B,vertOriginX:B,vertOriginY:B,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:B,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Ae}),W=Oe({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),Pe=Oe({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:je}),Fe=Oe({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Ie={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},Le=/[A-Z]/g,Re=/-[a-z]/g,ze=/^data[-\w.:]+$/i;function Be(e,t){let n=I(t),r=t,i=L;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&ze.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Re,He);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Re.test(e)){let n=e.replace(Le,Ve);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Ee}return new i(r,t)}function Ve(e){return`-`+e.toLowerCase()}function He(e){return e.charAt(1).toUpperCase()}var Ue=be([ke,Me,W,Pe,Fe],`html`),We=be([ke,Ne,W,Pe,Fe],`svg`);function Ge(e){return e.join(` `).trim()}var Ke=/\/\*(?:[^*]|\*(?!\/))*\*\//g,qe=/\n/g,Je=/^\s*/,Ye=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Xe=/^:\s*/,Ze=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,Qe=/^[;\s]*/,$e=`
|
|
1
|
+
import{t as e}from"./check-B7m80-Hk.js";import{t}from"./chevron-down-9e3l9_Db.js";import{t as n}from"./chevron-right-DyOe1NsY.js";import{t as r}from"./file-text-D6meDmAz.js";import{t as i}from"./list-DI2UZ46g.js";import{t as a}from"./plus-_W4OFi32.js";import{t as o}from"./search-DlLds8Ae.js";import{_ as s,a as c,b as l,c as u,d,h as f,i as p,l as m,v as h,x as g,y as _}from"./index-Dfy2jMWq.js";import{n as v}from"./module-host-BIy_fI1T.js";import{n as y}from"./workspace-view-state-BuK4-c0r.js";import"./public-Csb687JC.js";var b=f(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),x=f(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),S=f(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),C=f(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),w=f(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),T=f(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),E=f(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),D=f(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),O=f(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),ee=f(`panels-top-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M9 21V9`,key:`1oto5p`}]]),te=f(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),ne=f(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),re=f(`pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]),k=f(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),A=g(h(),1),j=u(),ie=(0,A.createContext)(null),ae=`/api/workbench/collaboration`;async function oe(e,t){let n=await fetch(ae+e,{method:t?`POST`:`GET`,headers:t?{"Content-Type":`application/json`}:void 0,body:t?JSON.stringify(t):void 0}),r=await n.json();if(!n.ok)throw Error(typeof r.error==`string`?r.error:r.error?.message||`项目服务暂时不可用`);return r}function se(e){return`${location.origin}${location.pathname}?mode=center&view=projects§ion=all&project=${encodeURIComponent(e)}`}function ce({children:e}){let[t,n]=(0,A.useState)(null),[r,i]=(0,A.useState)(``),a=(0,A.useRef)(void 0),o=(0,A.useRef)(Promise.resolve()),s=(0,A.useRef)(!0);(0,A.useEffect)(()=>(s.current=!0,()=>{s.current=!1}),[]),(0,A.useEffect)(()=>{let e=!0;return oe(`/session`).then(t=>{e&&n(t)}).catch(t=>{e&&i(t.message)}),()=>{e=!1}},[]);let c=(0,A.useCallback)(async(e,n={})=>{let r=o.current.then(async()=>{try{if(!s.current)throw Error(`项目工作区已切换,本次操作已停止`);let r=new URL(e,location.origin),i=r.pathname.replace(/^\/api/,``)+r.search;if(i===`/auth/session`)return Response.json({ok:!0,data:t});if(i===`/state`){let e=await oe(`/state`);return a.current=e.data.revision,Response.json(e)}let o={},c;if(n.body instanceof FormData){c=[];for(let[e,t]of n.body.entries())if(t instanceof File){if(t.size>2*1024*1024)throw Error(`附件最大为 2 MB`);let n=new Uint8Array(await t.arrayBuffer()),r=``;for(let e=0;e<n.length;e+=16384)r+=String.fromCharCode(...n.subarray(e,e+16384));c.push({name:e,file:!0,filename:t.name,type:t.type,base64:btoa(r)})}else c.push({name:e,value:t})}else n.body&&(o=JSON.parse(String(n.body)));let l=new Headers(n.headers),u=await oe(`/command`,{path:i,method:n.method||`GET`,body:o,form:c,clientMemberId:t?.memberId,expectedRevision:a.current,requestId:l.get(`idempotency-key`)||crypto.randomUUID()});return typeof u.revision==`number`&&(a.current=u.revision),Response.json(u)}catch(e){return Response.json({ok:!1,error:{message:e.message,code:`PROJECT_REQUEST_FAILED`}},{status:400})}});return o.current=r.then(()=>void 0,()=>void 0),r},[t]),l=(0,A.useMemo)(()=>({fetch:c,platformIdentity:()=>{if(!t)throw Error(`企业身份尚未就绪`);return t}}),[t,c]);return r?(0,j.jsxs)(`p`,{role:`alert`,children:[r,` `,(0,j.jsx)(`button`,{onClick:()=>location.reload(),children:`重新连接`})]}):t?(0,j.jsx)(ie.Provider,{value:l,children:e}):(0,j.jsx)(`p`,{role:`status`,children:`正在确认企业身份…`})}function le(){let e=(0,A.useContext)(ie);if(!e)throw Error(`需要企业项目上下文`);return e}var ue=0,de=new Set;function M(){ue=Date.now();for(let e of de)e()}function fe(){let e=ue>0&&Date.now()-ue<3e4;return ue=0,e}function pe(e){return de.add(e),()=>{de.delete(e)}}function me(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var N=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,he=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,P={};function ge(e,t){return((t||P).jsx?he:N).test(e)}var F=/[ \t\n\f\r]/g;function _e(e){return typeof e==`object`?e.type===`text`?ve(e.value):!1:ve(e)}function ve(e){return e.replace(F,``)===``}var ye=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};ye.prototype.normal={},ye.prototype.property={},ye.prototype.space=void 0;function be(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new ye(n,r,t)}function I(e){return e.toLowerCase()}var L=class{constructor(e,t){this.attribute=t,this.property=e}};L.prototype.attribute=``,L.prototype.booleanish=!1,L.prototype.boolean=!1,L.prototype.commaOrSpaceSeparated=!1,L.prototype.commaSeparated=!1,L.prototype.defined=!1,L.prototype.mustUseProperty=!1,L.prototype.number=!1,L.prototype.overloadedBoolean=!1,L.prototype.property=``,L.prototype.spaceSeparated=!1,L.prototype.space=void 0;var xe=l({boolean:()=>R,booleanish:()=>z,commaOrSpaceSeparated:()=>we,commaSeparated:()=>H,number:()=>B,overloadedBoolean:()=>Ce,spaceSeparated:()=>V}),Se=0,R=U(),z=U(),Ce=U(),B=U(),V=U(),H=U(),we=U();function U(){return 2**++Se}var Te=Object.keys(xe),Ee=class extends L{constructor(e,t,n,r){let i=-1;if(super(e,t),De(this,`space`,r),typeof n==`number`)for(;++i<Te.length;){let e=Te[i];De(this,Te[i],(n&xe[e])===xe[e])}}};Ee.prototype.defined=!0;function De(e,t,n){n&&(e[t]=n)}function Oe(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Ee(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[I(r)]=r,n[I(a.attribute)]=r}return new ye(t,n,e.space)}var ke=Oe({properties:{ariaActiveDescendant:null,ariaAtomic:z,ariaAutoComplete:null,ariaBusy:z,ariaChecked:z,ariaColCount:B,ariaColIndex:B,ariaColSpan:B,ariaControls:V,ariaCurrent:null,ariaDescribedBy:V,ariaDetails:null,ariaDisabled:z,ariaDropEffect:V,ariaErrorMessage:null,ariaExpanded:z,ariaFlowTo:V,ariaGrabbed:z,ariaHasPopup:null,ariaHidden:z,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:V,ariaLevel:B,ariaLive:null,ariaModal:z,ariaMultiLine:z,ariaMultiSelectable:z,ariaOrientation:null,ariaOwns:V,ariaPlaceholder:null,ariaPosInSet:B,ariaPressed:z,ariaReadOnly:z,ariaRelevant:null,ariaRequired:z,ariaRoleDescription:V,ariaRowCount:B,ariaRowIndex:B,ariaRowSpan:B,ariaSelected:z,ariaSetSize:B,ariaSort:null,ariaValueMax:B,ariaValueMin:B,ariaValueNow:B,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Ae(e,t){return t in e?e[t]:t}function je(e,t){return Ae(e,t.toLowerCase())}var Me=Oe({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:H,acceptCharset:V,accessKey:V,action:null,allow:null,allowFullScreen:R,allowPaymentRequest:R,allowUserMedia:R,alpha:R,alt:null,as:null,async:R,autoCapitalize:null,autoComplete:V,autoFocus:R,autoPlay:R,blocking:V,capture:null,charSet:null,checked:R,cite:null,className:V,closedBy:null,colorSpace:null,cols:B,colSpan:B,command:null,commandFor:null,content:null,contentEditable:z,controls:R,controlsList:V,coords:B|H,crossOrigin:null,data:null,dateTime:null,decoding:null,default:R,defer:R,dir:null,dirName:null,disabled:R,download:Ce,draggable:z,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:R,formTarget:null,headers:V,height:B,hidden:Ce,high:B,href:null,hrefLang:null,htmlFor:V,httpEquiv:V,id:null,imageSizes:null,imageSrcSet:null,inert:R,inputMode:null,integrity:null,is:null,isMap:R,itemId:null,itemProp:V,itemRef:V,itemScope:R,itemType:V,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:R,low:B,manifest:null,max:null,maxLength:B,media:null,method:null,min:null,minLength:B,multiple:R,muted:R,name:null,nonce:null,noModule:R,noValidate:R,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:R,optimum:B,pattern:null,ping:V,placeholder:null,playsInline:R,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:R,referrerPolicy:null,rel:V,required:R,reversed:R,rows:B,rowSpan:B,sandbox:V,scope:null,scoped:R,seamless:R,selected:R,shadowRootClonable:R,shadowRootCustomElementRegistry:R,shadowRootDelegatesFocus:R,shadowRootMode:null,shadowRootSerializable:R,shape:null,size:B,sizes:null,slot:null,span:B,spellCheck:z,src:null,srcDoc:null,srcLang:null,srcSet:null,start:B,step:null,style:null,tabIndex:B,target:null,title:null,translate:null,type:null,typeMustMatch:R,useMap:null,value:z,width:B,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:V,axis:null,background:null,bgColor:null,border:B,borderColor:null,bottomMargin:B,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:R,declare:R,event:null,face:null,frame:null,frameBorder:null,hSpace:B,leftMargin:B,link:null,longDesc:null,lowSrc:null,marginHeight:B,marginWidth:B,noResize:R,noHref:R,noShade:R,noWrap:R,object:null,profile:null,prompt:null,rev:null,rightMargin:B,rules:null,scheme:null,scrolling:z,standby:null,summary:null,text:null,topMargin:B,valueType:null,version:null,vAlign:null,vLink:null,vSpace:B,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:R,disablePictureInPicture:R,disableRemotePlayback:R,exportParts:H,part:V,prefix:null,property:null,results:B,security:null,unselectable:null},space:`html`,transform:je}),Ne=Oe({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:we,accentHeight:B,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:B,amplitude:B,arabicForm:null,ascent:B,attributeName:null,attributeType:null,azimuth:B,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:B,by:null,calcMode:null,capHeight:B,className:V,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:B,diffuseConstant:B,direction:null,display:null,dur:null,divisor:B,dominantBaseline:null,download:R,dx:null,dy:null,edgeMode:null,editable:null,elevation:B,enableBackground:null,end:null,event:null,exponent:B,externalResourcesRequired:null,fill:null,fillOpacity:B,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:H,g2:H,glyphName:H,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:B,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:B,horizOriginX:B,horizOriginY:B,id:null,ideographic:B,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:B,k:B,k1:B,k2:B,k3:B,k4:B,kernelMatrix:we,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:B,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:B,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:B,overlineThickness:B,paintOrder:null,panose1:null,path:null,pathLength:B,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:V,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:B,pointsAtY:B,pointsAtZ:B,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:we,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:we,rev:we,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:we,requiredFeatures:we,requiredFonts:we,requiredFormats:we,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:B,specularExponent:B,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:B,strikethroughThickness:B,string:null,stroke:null,strokeDashArray:we,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:B,strokeOpacity:B,strokeWidth:null,style:null,surfaceScale:B,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:we,tabIndex:B,tableValues:null,target:null,targetX:B,targetY:B,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:we,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:B,underlineThickness:B,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:B,values:null,vAlphabetic:B,vMathematical:B,vectorEffect:null,vHanging:B,vIdeographic:B,version:null,vertAdvY:B,vertOriginX:B,vertOriginY:B,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:B,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Ae}),W=Oe({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),Pe=Oe({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:je}),Fe=Oe({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Ie={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},Le=/[A-Z]/g,Re=/-[a-z]/g,ze=/^data[-\w.:]+$/i;function Be(e,t){let n=I(t),r=t,i=L;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&ze.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Re,He);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Re.test(e)){let n=e.replace(Le,Ve);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Ee}return new i(r,t)}function Ve(e){return`-`+e.toLowerCase()}function He(e){return e.charAt(1).toUpperCase()}var Ue=be([ke,Me,W,Pe,Fe],`html`),We=be([ke,Ne,W,Pe,Fe],`svg`);function Ge(e){return e.join(` `).trim()}var Ke=/\/\*(?:[^*]|\*(?!\/))*\*\//g,qe=/\n/g,Je=/^\s*/,Ye=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Xe=/^:\s*/,Ze=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,Qe=/^[;\s]*/,$e=`
|
|
2
2
|
`,et=`/`,tt=`*`,nt=``,rt=`comment`,it=`declaration`;function at(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var n=1,r=1;function i(e){var t=e.match(qe);t&&(n+=t.length);var i=e.lastIndexOf($e);r=~i?e.length-i:r+e.length}function a(){var e={line:n,column:r};return function(t){return t.position=new o(e),l(),t}}function o(e){this.start=e,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(i){var a=Error(t.source+`:`+n+`:`+r+`: `+i);if(a.reason=i,a.filename=t.source,a.line=n,a.column=r,a.source=e,!t.silent)throw a}function c(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function l(){c(Je)}function u(e){for(var t;t=d();)e.push(t);return e}function d(){var t=a();if(!(et!=e.charAt(0)||tt!=e.charAt(1))){for(var n=2;nt!=e.charAt(n)&&(tt!=e.charAt(n)||et!=e.charAt(n+1));)++n;if(n+=2,nt===e.charAt(n-1))return s(`End of comment missing`);var o=e.slice(2,n-2);return r+=2,i(o),e=e.slice(n),r+=2,t({type:rt,comment:o})}}function f(){var e=a(),t=c(Ye);if(t){if(d(),!c(Xe))return s(`property missing ':'`);var n=c(Ze),r=e({type:it,property:t[0].replace(Ke,nt).trim(),value:n?n[0].replace(Ke,nt).trim():nt});return c(Qe),r}}function p(){var e=[];u(e);for(var t;t=f();)e.push(t),u(e);return e}return l(),p()}function ot(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=at(e),i=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:a}=e;i?t(r,a,e):a&&(n??={},n[r]=a)}),n}var st=lt(`end`),ct=lt(`start`);function lt(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function ut(e){let t=ct(e),n=st(e);if(t&&n)return{start:t,end:n}}function dt(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?pt(e.position):`start`in e||`end`in e?pt(e):`line`in e||`column`in e?ft(e):``}function ft(e){return mt(e&&e.line)+`:`+mt(e&&e.column)}function pt(e){return ft(e&&e.start)+`-`+ft(e&&e.end)}function mt(e){return e&&typeof e==`number`?e:1}var ht=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=dt(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Object.defineProperties(ht.prototype,{file:{configurable:!0,enumerable:!0,value:``,writable:!0},name:{configurable:!0,enumerable:!0,value:``,writable:!0},reason:{configurable:!0,enumerable:!0,value:``,writable:!0},message:{configurable:!0,enumerable:!0,value:``,writable:!0},stack:{configurable:!0,enumerable:!0,value:``,writable:!0},column:{configurable:!0,enumerable:!0,writable:!0},line:{configurable:!0,enumerable:!0,writable:!0},ancestors:{configurable:!0,enumerable:!0,writable:!0},cause:{configurable:!0,enumerable:!0,writable:!0},fatal:{configurable:!0,enumerable:!0,writable:!0},place:{configurable:!0,enumerable:!0,writable:!0},ruleId:{configurable:!0,enumerable:!0,writable:!0},source:{configurable:!0,enumerable:!0,writable:!0}});var gt={}.hasOwnProperty,_t=new Map,vt=/[A-Z]/g,yt=/-([a-z])/g,bt=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),xt=new Set([`td`,`th`]),St=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Ct(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=Pt(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=Nt(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?We:Ue,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=wt(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function wt(e,t,n){if(t.type===`element`)return Tt(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Et(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Ot(e,t,n);if(t.type===`mdxjsEsm`)return Dt(e,t);if(t.type===`root`)return kt(e,t,n);if(t.type===`text`)return At(e,t)}function Tt(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=We,e.schema=i),e.ancestors.push(t);let a=Bt(e,t.tagName,!1),o=Ft(e,t),s=Lt(e,t);return bt.has(t.tagName)&&(s=s.filter(function(e){return typeof e==`string`?!_e(e):!0})),jt(e,o,a,t),Mt(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Et(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Vt(e,t.position)}function Dt(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Vt(e,t.position)}function Ot(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=We,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Bt(e,t.name,!0),o=It(e,t),s=Lt(e,t);return jt(e,o,a,t),Mt(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function kt(e,t,n){let r={};return Mt(r,Lt(e,t)),e.create(t,e.Fragment,r,n)}function At(e,t){return t.value}function jt(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Mt(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Nt(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function Pt(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=ct(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function Ft(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&>.call(t.properties,i)){let a=Rt(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&xt.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function It(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Vt(e,t.position);else{let{name:i}=r,a;if(r.value&&typeof r.value==`object`)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else Vt(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function Lt(e,t){let n=[],r=-1,i=e.passKeys?new Map:_t;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=wt(e,a,o);s!==void 0&&n.push(s)}return n}function Rt(e,t,n){if(n==null||typeof n==`number`&&Number.isNaN(n))return;let r=Be(e.schema,t);return Array.isArray(n)&&(n=r.commaSeparated?me(n):Ge(n)),r.property===`style`?[`style`,typeof n==`object`?e.stylePropertyNameCase===`dom`?n:Ht(n):zt(e,String(n))]:[e.elementAttributeNameCase===`react`&&r.space?Ie[r.property]||r.property:r.attribute,n]}function zt(e,t){let n={};try{ot(t,function(t,r){if(t&&r){let i=t;i.slice(0,2)!==`--`&&(i=i.toLowerCase(),e.stylePropertyNameCase===`dom`&&(i.slice(0,4)===`-ms-`&&(i=i.slice(1)),i=i.replace(yt,Gt))),n[i]=r}})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new ht("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=St+`#cannot-parse-style-attribute`,r}return n}function Bt(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=ge(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=ge(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return gt.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Vt(e)}function Vt(e,t){let n=new ht("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=St+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function Ht(e){let t={},n;for(n in e)gt.call(e,n)&&(t[Ut(n)]=e[n]);return t}function Ut(e){if(e.slice(0,2)===`--`)return e;let t=e.replace(vt,Wt);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function Wt(e){return`-`+e.toLowerCase()}function Gt(e,t){return t.toUpperCase()}var Kt={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},qt={};function Jt(e,t){let n=t||qt;return Yt(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function Yt(e,t,n){if(Zt(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return Xt(e.children,t,n)}return Array.isArray(e)?Xt(e,t,n):``}function Xt(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Yt(e[i],t,n);return r.join(``)}function Zt(e){return!!(e&&typeof e==`object`)}var Qt=document.createElement(`i`);function G(e){let t=`&`+e+`;`;Qt.innerHTML=t;let n=Qt.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}function $t(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function en(e,t){return e.length>0?($t(e,e.length,0,t),e):t}var tn={}.hasOwnProperty;function nn(e){let t={},n=-1;for(;++n<e.length;)rn(t,e[n]);return t}function rn(e,t){let n;for(n in t){let r=(tn.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){tn.call(r,a)||(r[a]=[]);let e=i[a];an(r[a],Array.isArray(e)?e:e?[e]:[])}}}function an(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);$t(e,0,0,r)}function on(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function sn(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var cn=mn(/[A-Za-z]/),K=mn(/[\dA-Za-z]/),ln=mn(/[#-'*+\--9=?A-Z^-~]/);function un(e){return e!==null&&(e<32||e===127)}var dn=mn(/\d/),fn=mn(/[\dA-Fa-f]/),pn=mn(/[!-/:-@[-`{-~]/);function q(e){return e!==null&&e<-2}function J(e){return e!==null&&(e<0||e===32)}function Y(e){return e===-2||e===-1||e===32}var X=mn(/\p{P}|\p{S}/u),Z=mn(/\s/);function mn(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function hn(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&K(e.charCodeAt(n+1))&&K(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function Q(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return Y(r)?(e.enter(n),s(r)):t(r)}function s(r){return Y(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function gn(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&Y(t)?(e.enter(r),c(t)):l(t)}function c(t){return Y(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var _n={tokenize:vn};function vn(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Q(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return q(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var yn=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){bn(this,e,t,n,!1)}addBefore(e,t,n){bn(this,e,t,n,!0)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function bn(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}var xn={tokenize:Cn},Sn={tokenize:wn};function Cn(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;let c=new yn;return c.add(a+1,0,t.events.slice(n)),c.add(n,s-n,[]),c.consume(t.events),l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Sn,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(Sn,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return q(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;let l=new yn;l.add(a+1,0,t.events.slice(n)),l.add(n,e-n,[]),l.consume(t.events)}}function _(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function wn(e,t,n){return Q(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function Tn(e){if(e===null||J(e)||Z(e))return 1;if(X(e))return 2}function En(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var Dn={name:`attention`,resolveAll:On,tokenize:kn};function On(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`attentionSequence`&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};An(o,-a),An(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=en(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=en(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=en(r,En(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=en(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=en(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),$t(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function kn(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Tn(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=Tn(o),u=!l||l===2&&i||n.includes(o)&&o!==42&&o!==95,d=!i||i===2&&l||n.includes(r)&&r!==42&&r!==95;return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function An(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var jn={name:`autolink`,tokenize:Mn};function Mn(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return cn(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||K(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||K(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||un(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):ln(t)?(e.consume(t),l):n(t)}function u(e){return K(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||K(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var Nn={partial:!0,tokenize:Pn};function Pn(e,t,n){return r;function r(t){return Y(t)?Q(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||q(e)?t(e):n(e)}}var Fn={continuation:{tokenize:Ln},exit:Rn,name:`blockQuote`,tokenize:In};function In(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return Y(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function Ln(e,t,n){let r=this;return i;function i(t){return Y(t)?Q(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(Fn,t,n)(r)}}function Rn(e){e.exit(`blockQuote`)}var zn={name:`characterEscape`,tokenize:Bn};function Bn(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return pn(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var Vn={name:`characterReference`,tokenize:Hn};function Hn(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=K,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=fn,u):(e.enter(`characterReferenceValue`),a=7,o=dn,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===K&&!G(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var Un={partial:!0,tokenize:Wn};function Wn(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var Gn={concrete:!0,name:`codeFenced`,tokenize:Kn};function Kn(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),Y(t)?Q(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||q(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(Un,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||q(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):Y(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Q(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||q(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||q(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&Y(t)?Q(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||q(t)?e.check(Un,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||q(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),Y(t)?Q(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),Y(t)?Q(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||q(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var qn={name:`codeIndented`,tokenize:Yn},Jn={partial:!0,tokenize:Xn};function Yn(e,t,n){return r;function r(t){return e.enter(`codeIndented`),gn(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):q(t)?e.attempt(Jn,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||q(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function Xn(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):q(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):gn(e,t,a,`linePrefix`,4,4)(o)}function a(e){return q(e)?i(e):n(e)}}var Zn={name:`codeText`,previous:$n,resolve:Qn,tokenize:er};function Qn(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function $n(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function er(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||q(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var tr=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&nr(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),nr(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),nr(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);nr(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);nr(this.left,t.reverse())}}};function nr(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function rr(e){let t={},n=-1,r,i,a,o,s,c,l,u=new tr(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,ir(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return $t(e,0,1/0,u.slice(0)),!l}function ir(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var ar={resolve:sr,tokenize:cr},or={partial:!0,tokenize:lr};function sr(e){return rr(e),e}function cr(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):q(t)?e.check(or,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function lr(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Q(e,a,`linePrefix`)}function a(i){if(i===null||q(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function ur(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||un(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||q(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||J(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||un(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function dr(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):q(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||q(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!Y(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function fr(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Q(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||q(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function pr(e,t){let n;return r;function r(i){return q(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):Y(i)?Q(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var mr={name:`definition`,tokenize:gr},hr={partial:!0,tokenize:_r};function gr(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return dr.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=sn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return J(t)?pr(e,l)(t):l(t)}function l(t){return ur(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(hr,d,d)(t)}function d(t){return Y(t)?Q(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||q(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function _r(e,t,n){return r;function r(t){return J(t)?pr(e,i)(t):n(t)}function i(t){return fr(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return Y(t)?Q(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||q(e)?t(e):n(e)}}var vr={name:`hardBreakEscape`,tokenize:yr};function yr(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return q(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var br={name:`headingAtx`,resolve:xr,tokenize:Sr};function xr(e,t){let n=e.length-2,r=3;if(e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r){let i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`};$t(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function Sr(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||J(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||q(n)?(e.exit(`atxHeading`),t(n)):Y(n)?Q(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||J(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Cr=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),wr=[`pre`,`script`,`style`,`textarea`],Tr={concrete:!0,name:`htmlFlow`,resolveTo:Dr,tokenize:Or},Er={partial:!0,tokenize:kr};function Dr(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Or(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:ie):cn(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):cn(a)?(e.consume(a),i=4,r.interrupt?t:ie):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:ie):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return cn(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||J(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&wr.includes(l)?(i=1,r.interrupt?t(s):O(s)):Cr.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||K(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return Y(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||cn(t)?(e.consume(t),b):Y(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||K(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):Y(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):Y(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||q(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||J(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||Y(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||q(t)?O(t):Y(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),re):t===60&&i===1?(e.consume(t),k):t===62&&i===4?(e.consume(t),ae):t===63&&i===3?(e.consume(t),ie):t===93&&i===5?(e.consume(t),j):q(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Er,oe,ee)(t)):t===null||q(t)?(e.exit(`htmlFlowData`),ee(t)):(e.consume(t),O)}function ee(t){return e.check(Un,te,oe)(t)}function te(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ne}function ne(t){return t===null||q(t)?ee(t):(e.enter(`htmlFlowData`),O(t))}function re(t){return t===45?(e.consume(t),ie):O(t)}function k(t){return t===47?(e.consume(t),o=``,A):O(t)}function A(t){if(t===62){let n=o.toLowerCase();return wr.includes(n)?(e.consume(t),ae):O(t)}return cn(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),A):O(t)}function j(t){return t===93?(e.consume(t),ie):O(t)}function ie(t){return t===62?(e.consume(t),ae):t===45&&i===2?(e.consume(t),ie):O(t)}function ae(t){return t===null||q(t)?(e.exit(`htmlFlowData`),oe(t)):(e.consume(t),ae)}function oe(n){return e.exit(`htmlFlow`),t(n)}}function kr(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Nn,t,n)}}var Ar={name:`htmlText`,tokenize:jr};function jr(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):cn(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):cn(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):q(t)?(o=d,k(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?re(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):q(t)?(o=h,k(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?re(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?re(t):q(t)?(o=v,k(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):q(t)?(o=y,k(t)):(e.consume(t),y)}function b(e){return e===62?re(e):y(e)}function x(t){return cn(t)?(e.consume(t),S):n(t)}function S(t){return t===45||K(t)?(e.consume(t),S):C(t)}function C(t){return q(t)?(o=C,k(t)):Y(t)?(e.consume(t),C):re(t)}function w(t){return t===45||K(t)?(e.consume(t),w):t===47||t===62||J(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),re):t===58||t===95||cn(t)?(e.consume(t),E):q(t)?(o=T,k(t)):Y(t)?(e.consume(t),T):re(t)}function E(t){return t===45||t===46||t===58||t===95||K(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):q(t)?(o=D,k(t)):Y(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,ee):q(t)?(o=O,k(t)):Y(t)?(e.consume(t),O):(e.consume(t),te)}function ee(t){return t===i?(e.consume(t),i=void 0,ne):t===null?n(t):q(t)?(o=ee,k(t)):(e.consume(t),ee)}function te(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||J(t)?T(t):(e.consume(t),te)}function ne(e){return e===47||e===62||J(e)?T(e):n(e)}function re(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function k(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),A}function A(t){return Y(t)?Q(e,j,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):j(t)}function j(t){return e.enter(`htmlTextData`),o(t)}}var Mr={name:`labelEnd`,resolveAll:Ir,resolveTo:Lr,tokenize:Rr},Nr={tokenize:zr},Pr={tokenize:Br},Fr={tokenize:Vr};function Ir(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&$t(e,0,e.length,n),e}function Lr(e,t){let n=e.length,r=0,i,a,o;for(;n--;){let t=e[n][1];if(i){if(t.type===`link`||t.type===`labelLink`&&t._inactive)break;e[n][0]===`enter`&&t.type===`labelLink`&&(t._inactive=!0)}else if(a){if(e[n][0]===`enter`&&(t.type===`labelImage`||t.type===`labelLink`)&&!t._balanced&&(i=n,t.type!==`labelLink`)){r=2;break}}else t.type===`labelEnd`&&(a=n)}let s={type:e[i][1].type===`labelLink`?`link`:`image`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:`label`,start:{...e[i][1].start},end:{...e[a][1].end}},l={type:`labelText`,start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return o=[[`enter`,s,t],[`enter`,c,t]],o=en(o,e.slice(i+1,i+r+3)),o=en(o,[[`enter`,l,t]]),o=en(o,En(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=en(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=en(o,e.slice(a+1)),o=en(o,[[`exit`,s,t]]),$t(e,i,e.length,o),e}function Rr(e,t,n){let r=this,i=r._labelStarts,a,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(sn(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Nr,u,o?u:d)(t):t===91?e.attempt(Pr,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Fr,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function zr(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return J(t)?pr(e,a)(t):a(t)}function a(t){return t===41?u(t):ur(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return J(t)?pr(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?fr(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return J(t)?pr(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function Br(e,t,n){let r=this;return i;function i(t){return dr.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(sn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Vr(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var Hr={name:`labelStartImage`,resolveAll:Mr.resolveAll,tokenize:Ur};function Ur(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var Wr={name:`labelStartLink`,resolveAll:Mr.resolveAll,tokenize:Gr};function Gr(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var Kr={name:`lineEnding`,tokenize:qr};function qr(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Q(e,t,`linePrefix`)}}var Jr={name:`thematicBreak`,tokenize:Yr};function Yr(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||q(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),Y(t)?Q(e,s,`whitespace`)(t):s(t))}}var Xr={continuation:{tokenize:ei},exit:ni,name:`list`,tokenize:$r},Zr={partial:!0,tokenize:ri},Qr={partial:!0,tokenize:ti};function $r(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:dn(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(Jr,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return dn(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(Nn,r.interrupt?n:u,e.attempt(Zr,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return Y(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function ei(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Nn,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Q(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!Y(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Qr,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Q(e,e.attempt(Xr,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function ti(e,t,n){let r=this;return Q(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function ni(e){e.exit(this.containerState.type)}function ri(e,t,n){let r=this;return Q(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!Y(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var ii={name:`setextUnderline`,resolveTo:ai,tokenize:oi};function ai(e,t){let n=new yn,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function oi(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),Y(t)?Q(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||q(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var si={tokenize:ci};function ci(e){let t=this,n=e.attempt(Nn,r,e.attempt(this.parser.constructs.flowInitial,i,Q(e,e.attempt(this.parser.constructs.flow,i,e.attempt(ar,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var li={resolveAll:pi()},ui=fi(`string`),di=fi(`text`);function fi(e){return{resolveAll:pi(e===`text`?mi:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function pi(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function mi(e,t){let n=new yn,r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type===`lineEnding`)&&e[r-1][1].type===`data`){let i=e[r-1][1],a=t.sliceStream(i),o=a.length,s=-1,c=0,l;for(;o--;){let e=a[o];if(typeof e==`string`){for(s=e.length;e.charCodeAt(s-1)===32;)c++,s--;if(s)break;s=-1}else if(e===-2)l=!0,c++;else if(e!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(c=0),c){let a={type:r===e.length||l||c<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):n.add(r,0,[[`enter`,a,t],[`exit`,a,t]])}r++}return n.consume(e),e}var hi=l({attentionMarkers:()=>Ci,contentInitial:()=>_i,disable:()=>wi,document:()=>gi,flow:()=>yi,flowInitial:()=>vi,insideSpan:()=>Si,string:()=>bi,text:()=>xi}),gi={42:Xr,43:Xr,45:Xr,48:Xr,49:Xr,50:Xr,51:Xr,52:Xr,53:Xr,54:Xr,55:Xr,56:Xr,57:Xr,62:Fn},_i={91:mr},vi={[-2]:qn,[-1]:qn,32:qn},yi={35:br,42:Jr,45:[ii,Jr],60:Tr,61:ii,95:Jr,96:Gn,126:Gn},bi={38:Vn,92:zn},xi={[-5]:Kr,[-4]:Kr,[-3]:Kr,33:Hr,38:Vn,42:Dn,60:[jn,Ar],91:Wr,92:[vr,zn],93:Mr,95:Dn,96:Zn},Si={null:[Dn,li]},Ci={null:[42,95]},wi={null:[]};function Ti(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=en(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=En(a,l.events,l),l.events):[]}function f(e,t){return Di(p(e),t)}function p(e){return Ei(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){for(;r._index<o.length;){let e=o[r._index];if(typeof e==`string`){let t=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===t&&r._bufferIndex<e.length;)_(e.charCodeAt(r._bufferIndex))}else _(e)}}function _(e){u=u(e)}function v(e){q(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&$t(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Ei(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Di(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
3
3
|
`;break;case-3:o=`\r
|
|
4
4
|
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function Oi(e){let t={constructs:nn([hi,...(e||{}).extensions||[]]),content:n(_n),defined:[],document:n(xn),flow:n(si),lazy:{},string:n(ui),text:n(di)};return t;function n(e){return n;function n(n){return Ti(t,e,n)}}}function ki(e){for(;!rr(e););return e}var Ai=/[\0\t\n\r]/g;function ji(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i));let s=[],c=0;for(t=``,n&&=(i.charCodeAt(0)===65279&&c++,void 0);c<i.length;){Ai.lastIndex=c;let n=Ai.exec(i),a=n&&n.index!==void 0?n.index:i.length,o=i.charCodeAt(a);if(!n){t=i.slice(c);break}if(o===10&&c===a&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),c<a&&(s.push(i.slice(c,a)),e+=a-c),o){case 0:s.push(65533),e++;break;case 9:{let t=Math.ceil(e/4)*4;for(s.push(-2);e++<t;)s.push(-1);break}case 10:s.push(-4),e=1;break;default:r=!0,e=1}c=a+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var Mi=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Ni(e){return e.replace(Mi,Pi)}function Pi(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return on(n.slice(t?2:1),t?16:10)}return G(n)||e}var Fi={}.hasOwnProperty;function Ii(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),Li(n)(ki(Oi(n).document().write(ji()(e,t,!0))))}function Li(e){let t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:o(be),autolinkProtocol:E,autolinkEmail:E,atxHeading:o(F),blockQuote:o(me),characterEscape:E,characterReference:E,codeFenced:o(N),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(N,s),codeText:o(he,s),codeTextData:E,data:E,codeFlowValue:E,definition:o(P),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(ge),hardBreakEscape:o(_e),hardBreakTrailing:o(_e),htmlFlow:o(ve,s),htmlFlowData:E,htmlText:o(ve,s),htmlTextData:E,image:o(ye),label:s,link:o(be),listItem:o(L),listItemValue:p,listOrdered:o(I,f),listUnordered:o(I),paragraph:o(xe),reference:ce,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(F),strong:o(Se),thematicBreak:o(z)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:pe,autolinkProtocol:fe,blockQuote:l(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:ue,characterReferenceMarkerNumeric:ue,characterReferenceValue:de,characterReference:M,codeFenced:l(_),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:D,codeIndented:l(v),codeText:l(re),codeTextData:D,data:D,definition:l(),definitionDestinationString:x,definitionLabelString:y,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(ee),hardBreakTrailing:l(ee),htmlFlow:l(te),htmlFlowData:D,htmlText:l(ne),htmlTextData:D,image:l(A),label:ie,labelText:j,lineEnding:O,link:l(k),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:le,resourceDestinationString:ae,resourceTitleString:oe,resource:se,setextHeading:l(T),setextHeadingLineSequence:w,setextHeadingText:C,strong:l(),thematicBreak:l()}};zi(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[],position:void 0},o={stack:[r],tokenStack:[],config:t,enter:c,exit:u,buffer:s,resume:d,data:n},l=[],f=[],p=-1;for(;++p<e.length;)f.push(e[p]),(e[p][1].type===`listOrdered`||e[p][1].type===`listUnordered`)&&(e[p][0]===`enter`?l.push(f.length-1):a(f,l.pop()));for(e=f,p=-1;++p<e.length;){let n=t[e[p][0]];e[p][0]===`enter`&&t.beforeEnter.length>0&&i(t.beforeEnter,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),Fi.call(n,e[p][1].type)&&n[e[p][1].type].call({...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),e[p][0]===`exit`&&t.afterExit.length>0&&i(t.afterExit,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1])}if(o.tokenStack.length>0){let e=o.tokenStack[o.tokenStack.length-1];(e[1]||Vi).call(o,void 0,e[0])}for(r.position={start:Ri(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Ri(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},p=-1;++p<t.transforms.length;)r=t.transforms[p](r)||r;return r}function i(e,t,n){let r=-1;for(;++r<e.length;)e[r].call(t,n)}function a(e,t){let n=e.length-1,r=t-1,i=-1,a=!1,o,s,c,l,u=[];for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let n=r;for(s=void 0;n--;){let t=e[n];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=n}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),u.push({at:s||r,event:[`exit`,o,t[2]]})}if(t[1].type===`listItemPrefix`){let e={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=e,u.push({at:r,event:[`enter`,e,t[2]]}),c=void 0,l=!0}}}let d=e.splice(t),f=0;for(r=-1;++r<d.length;){for(;f<u.length&&u[f].at===t+r;)e.push(u[f++].event);e.push(d[r])}e[t][1]._spread=a}function o(e,t){return n;function n(n){c.call(this,e(n),n),t&&t.call(this,n)}}function s(){this.stack.push({type:`fragment`,children:[]})}function c(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:Ri(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),u.call(this,t)}}function u(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw Error("Cannot close `"+e.type+"` ("+dt({start:e.start,end:e.end})+`): it’s not open`);r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||Vi).call(this,e,r[0])),n.position.end=Ri(e.end)}function d(){return Jt(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function h(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function v(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function y(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=sn(this.sliceSerialize(e)).toLowerCase()}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function x(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function S(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function C(){this.data.setextHeadingSlurpLineEnding=!0}function w(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function E(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=R(),n.position={start:Ri(e.start),end:void 0},t.push(n)),this.stack.push(n)}function D(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=Ri(e.end)}function O(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=Ri(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(E.call(this,e),D.call(this,e))}function ee(){this.data.atHardBreak=!0}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function re(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function k(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function A(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function j(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=Ni(t),n.identifier=sn(t).toLowerCase()}function ie(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function ae(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function oe(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function se(){this.data.inReference=void 0}function ce(){this.data.referenceType=`collapsed`}function le(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=sn(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ue(e){this.data.characterReferenceType=e.type}function de(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=on(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=G(t);let i=this.stack[this.stack.length-1];i.value+=r}function M(e){let t=this.stack.pop();t.position.end=Ri(e.end)}function fe(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function pe(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function me(){return{type:`blockquote`,children:[],position:void 0}}function N(){return{type:`code`,lang:null,meta:null,value:``,position:void 0}}function he(){return{type:`inlineCode`,value:``,position:void 0}}function P(){return{type:`definition`,identifier:``,label:null,title:null,url:``,position:void 0}}function ge(){return{type:`emphasis`,children:[],position:void 0}}function F(){return{type:`heading`,depth:0,children:[],position:void 0}}function _e(){return{type:`break`,position:void 0}}function ve(){return{type:`html`,value:``,position:void 0}}function ye(){return{type:`image`,title:null,url:``,alt:null,position:void 0}}function be(){return{type:`link`,title:null,url:``,children:[],position:void 0}}function I(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[],position:void 0}}function L(e){return{type:`listItem`,spread:e._spread,checked:null,children:[],position:void 0}}function xe(){return{type:`paragraph`,children:[],position:void 0}}function Se(){return{type:`strong`,children:[],position:void 0}}function R(){return{type:`text`,value:``,position:void 0}}function z(){return{type:`thematicBreak`,position:void 0}}}function Ri(e){return{line:e.line,column:e.column,offset:e.offset}}function zi(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?zi(e,r):Bi(e,r)}}function Bi(e,t){let n;for(n in t)if(Fi.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`afterExit`:case`beforeEnter`:{let r=t[n];r&&e[n].push(r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function Vi(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+dt({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+dt({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+dt({start:t.start,end:t.end})+`) is still open`)}function Hi(e){let t=this;t.parser=n;function n(n){return Ii(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function Ui(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Wi(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./arrow-up-right-D1eLXOum.js";import{t}from"./chart-column-DueDyWTO.js";import{t as n}from"./check-DpavxwQP.js";import{t as r}from"./link-2-BrR_cwPw.js";import{t as i}from"./package-b8jiLApm.js";import{t as a}from"./plus-CuQU-dIh.js";import{t as o}from"./refresh-cw-BwEoF6sI.js";import{c as s,h as c,l,v as u,x as d}from"./index-CShNDEcL.js";import{i as f,l as p,o as m}from"./components-HGHI0_0I.js";import{a as h,i as g,n as _,r as ee}from"./competitor-analysis-XIYJL66C.js";import{_ as v,n as y,nt as b,o as x,r as S}from"./CartesianChart-CGNvk6St.js";import{n as C,r as w,t as T}from"./FavoritePicker-DLuTORpI.js";var te=c(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),E=d(u(),1),D=`请在“关于与更新”中更新山海客户端,完成后重启以启用内置达摩盘。`;async function O(e){if(!window.omni?.competitorAnalysis)throw Error(D);let t=await window.omni.competitorAnalysis(e);if(!t.ok)throw Error(t.error);return t.value}async function k(){let e=await O({op:`dmp-window-status`}).catch(e=>{throw e instanceof Error&&e.message===`请先登录山海 Dev`||e instanceof Error&&/不支持的竞品分析操作|仅在源码 Dev 中提供|No handler registered/.test(e.message)?Error(D):e});if(!e||typeof e!=`object`||!(`account`in e)||`id`in e||e.account!==null&&typeof e.account!=`string`)throw Error(D);return{account:e.account}}var A={windowStatus:k,async openWindow(){return await k(),O({op:`open-dmp-window`})},history:(e=0)=>O({op:`history`,page:e}),async connect(){return await k(),O({op:`connect`})},start:async e=>{let{account:t}=await k();if(!t||t!==e.account)throw Error(`请先确认当前达摩盘取数账号`);return O(e)},status:e=>O({op:`status`,id:e}),cancel:e=>O({op:`cancel`,id:e})},j={page:`_page_1yhky_1`,header:`_header_1yhky_2`,eyebrow:`_eyebrow_1yhky_3`,note:`_note_1yhky_5`,period:`_period_1yhky_5`,productSlots:`_productSlots_1yhky_9`,productCard:`_productCard_1yhky_10`,emptySlot:`_emptySlot_1yhky_10`,slotNumber:`_slotNumber_1yhky_11`,remove:`_remove_1yhky_11`,productInfo:`_productInfo_1yhky_12`,placeholder:`_placeholder_1yhky_12`,cardLinks:`_cardLinks_1yhky_13`,addForm:`_addForm_1yhky_14`,controls:`_controls_1yhky_14`,primary:`_primary_1yhky_14`,connection:`_connection_1yhky_15`,alert:`_alert_1yhky_16`,progress:`_progress_1yhky_17`,results:`_results_1yhky_18`,dimensionTabs:`_dimensionTabs_1yhky_18`,resultBody:`_resultBody_1yhky_18`,tableWrap:`_tableWrap_1yhky_18`,comparisonTable:`_comparisonTable_1yhky_18`,metricRow:`_metricRow_1yhky_18`,groupRow:`_groupRow_1yhky_18`,range:`_range_1yhky_18`,missing:`_missing_1yhky_18`,notes:`_notes_1yhky_18`,emptyResult:`_emptyResult_1yhky_19`,audienceToolbar:`_audienceToolbar_1yhky_21`,audienceBehaviors:`_audienceBehaviors_1yhky_22`,audienceLegend:`_audienceLegend_1yhky_22`,audienceTooltip:`_audienceTooltip_1yhky_22`,audienceMetrics:`_audienceMetrics_1yhky_23`,costColumns:`_costColumns_1yhky_24`,audienceColumns:`_audienceColumns_1yhky_24`,costColumn:`_costColumn_1yhky_24`,audienceColumn:`_audienceColumn_1yhky_24`,costProduct:`_costProduct_1yhky_24`,audienceProduct:`_audienceProduct_1yhky_24`,audienceChart:`_audienceChart_1yhky_25`,audienceChartEmpty:`_audienceChartEmpty_1yhky_25`,audienceEmpty:`_audienceEmpty_1yhky_25`,audienceMissing:`_audienceMissing_1yhky_25`,audienceValues:`_audienceValues_1yhky_27`,costChart:`_costChart_1yhky_30`,costChartEmpty:`_costChartEmpty_1yhky_30`,costCoverage:`_costCoverage_1yhky_30`,costTooltip:`_costTooltip_1yhky_30`,channelTable:`_channelTable_1yhky_32`,channelHeading:`_channelHeading_1yhky_32`,channelMetrics:`_channelMetrics_1yhky_32`,channelEmpty:`_channelEmpty_1yhky_32`,channelToggle:`_channelToggle_1yhky_34`,channelChild:`_channelChild_1yhky_34`,headerActions:`_headerActions_1yhky_36`,historyList:`_historyList_1yhky_36`,historyCard:`_historyCard_1yhky_36`,historyHeading:`_historyHeading_1yhky_36`,historyFooter:`_historyFooter_1yhky_36`,historyProducts:`_historyProducts_1yhky_36`,addDialog:`_addDialog_1yhky_38`,dialogHeading:`_dialogHeading_1yhky_38`,sourceChoices:`_sourceChoices_1yhky_38`,pickerForm:`_pickerForm_1yhky_38`,pickerBrowse:`_pickerBrowse_1yhky_38`},M=[{key:`viewers`,label:`浏览`,value:1},{key:`favorites`,label:`收藏`,value:2},{key:`cartAdders`,label:`加购`,value:3},{key:`buyers`,label:`购买`,value:4}];function N(e,t,n){let r=M.filter(e=>t.includes(e.key)),i=[...new Set(e.flatMap(e=>r.flatMap(({key:t})=>(e?.[t]||[]).map(e=>e.name))))],a=!1,o=e.map(e=>i.map(t=>({name:t,...Object.fromEntries(r.map(({key:r})=>{let i=e?.[r]?.find(e=>e.name===t)?.[n];return i==null?[r,null]:!Number.isFinite(i)||i<0||n===`rate`&&i>1?(a=!0,[r,null]):[r,i]}))}))),s=Math.max(1,...o.flatMap(e=>e.flatMap(e=>r.map(({key:t})=>e[t]??0)))),c=10**Math.floor(Math.log10(s)),l=Math.max(4,Math.ceil(Math.ceil(s/c)*c/4)*4);return{columns:o,ceiling:n===`rate`?1:l,invalid:a}}var P=s(),F={viewers:`var(--omni-chart-primary,#469eff)`,favorites:`var(--omni-chart-secondary,#b99aff)`,cartAdders:`var(--omni-chart-orange,#d4a25c)`,buyers:`var(--omni-chart-teal,#34b9ac)`};function I(e,t){return e==null?`—`:(t?e*100:e).toLocaleString(`zh-CN`,{maximumFractionDigits:2})+(t?`%`:``)}function L({x:e=0,y:t=0,payload:n}){let r=String(n?.value||``).match(/.{1,6}/gu)||[];return(0,P.jsx)(`text`,{x:e,y:t+12,textAnchor:`middle`,fill:`var(--omni-muted,var(--omni-chart-primary,#91a9c0))`,fontSize:10,children:r.map((t,n)=>(0,P.jsx)(`tspan`,{x:e,dy:n?14:0,children:t},n))})}function ne({results:e,products:t}){let[r,i]=p(`competitor.audienceDimension`,`性别`),[a,o]=p(`competitor.audienceMetric`,`rate`),[s,c]=p(`competitor.audienceBehaviors`,[`viewers`,`buyers`]),l=a===`rate`,u=M.filter(e=>s.includes(e.key)),d=Array.from({length:2},(n,i)=>{let a=t[i],o=e.find(e=>e.product.id===a?.id);return{product:o?.product||a,group:o?.audiences.find(e=>e.name===r)}}),f=N(d.map(e=>e.group),s,a),m=l?`占比`:`人数`,h=d.some(({group:e})=>e&&(e.favorites===void 0||e.cartAdders===void 0));return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{className:j.dimensionTabs,"aria-label":`画像维度`,children:[`性别`,`年龄`,`购买力`,`城市等级`].map(e=>(0,P.jsx)(`button`,{"aria-pressed":e===r,onClick:()=>i(e),children:e},e))}),(0,P.jsxs)(`div`,{className:j.audienceToolbar,children:[(0,P.jsxs)(`div`,{className:j.audienceBehaviors,role:`group`,"aria-label":`对比人群(可多选)`,children:[(0,P.jsxs)(`span`,{children:[`对比人群 `,(0,P.jsx)(`small`,{children:`可多选`})]}),M.map(({key:e,label:t})=>(0,P.jsxs)(`button`,{"aria-label":`${t}人群`,"aria-pressed":s.includes(e),onClick:()=>c(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),children:[(0,P.jsx)(`i`,{style:{background:F[e]}}),t,s.includes(e)&&(0,P.jsx)(n,{size:12})]},e))]}),(0,P.jsx)(`div`,{className:j.audienceMetrics,role:`group`,"aria-label":`画像对比指标`,children:[`rate`,`count`].map(e=>(0,P.jsx)(`button`,{"aria-pressed":a===e,onClick:()=>o(e),children:e===`rate`?`占比`:`人数`},e))})]}),(0,P.jsxs)(`p`,{className:j.note,children:[`两列同刻度 · `,l?`0–100%`:`0–${I(f.ceiling,!1)} 人`,` · 同色代表同类人群`]}),u.length?(0,P.jsx)(`div`,{className:j.tableWrap,children:(0,P.jsx)(`div`,{className:j.audienceColumns,"aria-label":`${r} · ${m}竖向柱状对比`,children:d.map(({product:e,group:t},n)=>{let i=f.columns[n],a=u.filter(({key:e})=>!i.some(t=>t[e]!=null));return(0,P.jsxs)(`section`,{className:j.audienceColumn,"aria-label":`竞品 ${n+1} ${m}`,children:[(0,P.jsxs)(`header`,{className:j.audienceProduct,children:[(0,P.jsxs)(`small`,{children:[`竞品 `,n+1]}),(0,P.jsx)(`strong`,{title:e?.name,children:e?.name||`等待添加商品`})]}),(0,P.jsx)(`div`,{className:j.audienceLegend,children:u.map(({key:e,label:t})=>(0,P.jsxs)(`span`,{children:[(0,P.jsx)(`i`,{style:{background:F[e]}}),t]},e))}),e&&i.length&&a.length<u.length?(0,P.jsx)(`div`,{className:j.audienceChart,children:(0,P.jsx)(b,{width:`100%`,height:`100%`,minWidth:0,initialDimension:{width:400,height:300},children:(0,P.jsxs)(C,{data:i,margin:{top:16,right:14,bottom:8,left:0},barCategoryGap:`20%`,barGap:3,accessibilityLayer:!0,children:[(0,P.jsx)(x,{stroke:`var(--omni-line,var(--omni-chart-track,#294052))`,vertical:!1}),(0,P.jsx)(S,{dataKey:`name`,interval:0,tick:(0,P.jsx)(L,{}),height:54,tickLine:!1,axisLine:{stroke:`var(--omni-line,#294052)`}}),(0,P.jsx)(y,{domain:[0,f.ceiling],ticks:[0,.25,.5,.75,1].map(e=>e*f.ceiling),width:60,tickLine:!1,axisLine:!1,tick:{fontSize:10,fill:`var(--omni-muted,#91a9c0)`},tickFormatter:e=>l?`${e*100}%`:e>=1e4?`${I(e/1e4,!1)}万`:I(e,!1)}),(0,P.jsx)(v,{cursor:{fill:`var(--omni-panel,#102236)`,opacity:.45},content:({active:e,label:n})=>!e||n==null?null:(0,P.jsxs)(`div`,{className:j.audienceTooltip,children:[(0,P.jsx)(`strong`,{children:n}),u.map(({key:e,label:r})=>{let i=t?.[e]?.find(e=>e.name===String(n));return(0,P.jsxs)(`p`,{children:[(0,P.jsx)(`i`,{style:{background:F[e]}}),r,(0,P.jsxs)(`span`,{children:[I(i?.count,!1),` 人 · `,I(i?.rate,!0)]})]},e)})]})}),u.map(({key:e,label:t})=>(0,P.jsx)(w,{name:t,dataKey:e,fill:F[e],maxBarSize:40,radius:[3,3,0,0],isAnimationActive:!1},e))]},u.map(e=>e.key).join(`,`))})}):(0,P.jsx)(`div`,{className:j.audienceChartEmpty,children:e?`所选人群暂无可用数据`:`添加第二个商品即可对比`}),e&&a.length>0&&(0,P.jsxs)(`p`,{className:j.audienceMissing,children:[a.map(e=>e.label).join(`、`),`:当前维度暂无可用数据`]}),e&&i.length>0&&(0,P.jsxs)(`details`,{className:j.audienceValues,children:[(0,P.jsxs)(`summary`,{children:[`查看`,m,`明细(含缺失项)`]}),(0,P.jsxs)(`table`,{children:[(0,P.jsxs)(`caption`,{children:[r,` · `,m,!l&&`(人)`]}),(0,P.jsx)(`thead`,{children:(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`th`,{scope:`col`,children:`分类`}),u.map(({key:e,label:t})=>(0,P.jsx)(`th`,{scope:`col`,children:t},e))]})}),(0,P.jsx)(`tbody`,{children:i.map(e=>(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`th`,{scope:`row`,children:e.name}),u.map(({key:t})=>(0,P.jsx)(`td`,{children:I(e[t],l)},t))]},e.name))})]})]})]},n)})})}):(0,P.jsx)(`p`,{className:j.audienceEmpty,children:`请选择至少一类人群,可同时选择浏览和购买进行对比。`}),f.invalid&&(0,P.jsx)(`p`,{className:j.note,children:`部分数值超出有效范围,未绘制柱形;未按零值处理。`}),(0,P.jsxs)(`p`,{className:j.note,children:[`悬停查看人数与占比;明细中“—”表示缺失,0 表示已返回的零值。`,h&&`当前结果尚未采集收藏和加购人群,请重新开始分析。`]}),(0,P.jsx)(`p`,{className:j.note,children:`各类人群可能重叠,不相加为总人数;占比按各自人群的原始分母展示,差异反映人群结构,不能直接当作转化率。`})]})}function re({products:e,onAdd:t,onBrowse:n,onClose:r}){let i=(0,E.useRef)(null),[a,o]=(0,E.useState)(`id`),[s,c]=(0,E.useState)(``),[u,d]=(0,E.useState)(``);(0,E.useEffect)(()=>{let e=document.activeElement;return i.current?.showModal(),()=>e?.focus()},[]);function f(e){try{t(e),r()}catch(e){d(e instanceof Error?e.message:`添加未完成`)}}function p(){let e=_(s);if(!e){d(`请输入有效商品 ID,或带 id 参数的淘宝/天猫商品链接`);return}f({id:e,name:`商品 ${e}`})}return(0,P.jsxs)(`dialog`,{ref:i,className:j.addDialog,"aria-labelledby":`competitor-picker-title`,onCancel:e=>{e.preventDefault(),r()},onClick:e=>{e.target===e.currentTarget&&r()},children:[(0,P.jsxs)(`div`,{className:j.dialogHeading,children:[(0,P.jsx)(`h2`,{id:`competitor-picker-title`,children:`添加竞品商品`}),(0,P.jsx)(`button`,{onClick:r,"aria-label":`关闭商品选择`,children:(0,P.jsx)(l,{size:18})})]}),(0,P.jsxs)(`p`,{className:j.note,children:[`已选择 `,e.length,` / `,2,` 个商品`]}),(0,P.jsx)(`nav`,{className:j.sourceChoices,"aria-label":`商品添加方式`,children:[[`id`,`输入 ID / 链接`],[`ranking`,`从商品榜单添加`],[`favorites`,`从收藏商品添加`]].map(([e,t])=>(0,P.jsx)(`button`,{"aria-pressed":a===e,onClick:()=>{o(e),d(``)},children:t},e))}),u&&(0,P.jsx)(`p`,{role:`alert`,className:j.alert,children:u}),a===`id`&&(0,P.jsxs)(`form`,{className:j.pickerForm,onSubmit:e=>{e.preventDefault(),p()},children:[(0,P.jsx)(`label`,{htmlFor:`competitor-picker-id`,children:`商品 ID / 链接`}),(0,P.jsx)(`input`,{id:`competitor-picker-id`,value:s,onChange:e=>c(e.target.value),placeholder:`输入淘宝/天猫商品 ID 或链接`}),(0,P.jsx)(`button`,{type:`submit`,disabled:!s.trim()||e.length>=2,children:`添加到竞品分析`})]}),a===`ranking`&&(0,P.jsxs)(`div`,{className:j.pickerBrowse,children:[(0,P.jsx)(`p`,{children:`在商品排行榜选择商品,点击“加入分析”,已选商品会保留。`}),(0,P.jsx)(`button`,{onClick:()=>{r(),n()},children:`前往商品排行榜`})]}),a===`favorites`&&(0,P.jsx)(T,{kind:`product`,selectedIds:e.map(e=>e.id),onSelect:({record:e})=>{e?.id&&f({id:e.id,name:e.name||`商品 ${e.id}`,imageUrl:e.imageUrl,shopName:e.shopName})}})]})}var ie={queued:`排队中`,running:`采集中`,complete:`已完成`,cancelled:`已停止`,error:`采集异常`,interrupted:`已中断`};function ae({onOpen:e}){let[t,n]=(0,E.useState)(0),[r,i]=(0,E.useState)(0),[a,o]=(0,E.useState)(null),[s,c]=(0,E.useState)(``);return(0,E.useEffect)(()=>{let e=!1,n;async function r(){try{let i=await A.history(t);if(e)return;o(i),c(``),n=setTimeout(()=>void r(),5e3)}catch(t){e||c(t instanceof Error?t.message:`历史分析加载失败`)}}return r(),()=>{e=!0,clearTimeout(n)}},[t,r]),(0,P.jsxs)(`section`,{"aria-label":`历史分析`,children:[(0,P.jsx)(`p`,{className:j.note,children:`历史按当前账号保存到企业数据库,换电脑登录后可查看。返回榜单后会继续采集,请保持这台电脑在线,并保持山海和达摩盘窗口打开。`}),s&&(0,P.jsxs)(`div`,{className:j.alert,role:`alert`,children:[s,` `,(0,P.jsx)(`button`,{onClick:()=>{c(``),i(e=>e+1)},children:`重新加载`})]}),!a&&!s&&(0,P.jsx)(`p`,{role:`status`,children:`正在读取历史分析…`}),a?.items.length===0&&(0,P.jsxs)(`div`,{className:j.emptyResult,children:[(0,P.jsx)(`h2`,{children:`还没有历史分析`}),(0,P.jsx)(`p`,{children:`新建分析后会自动保存,可随时回来查看进度和结果。`})]}),(0,P.jsx)(`div`,{className:j.historyList,children:a?.items.map(t=>(0,P.jsxs)(`article`,{className:j.historyCard,children:[(0,P.jsxs)(`div`,{className:j.historyHeading,children:[(0,P.jsx)(`strong`,{children:ie[t.status]}),(0,P.jsx)(`time`,{children:new Date(t.startedAt).toLocaleString(`zh-CN`)})]}),(0,P.jsx)(`div`,{className:j.historyProducts,children:t.products.map((e,t)=>(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`small`,{children:[`竞品 `,t+1]}),(0,P.jsx)(`strong`,{title:e.name,children:e.name}),(0,P.jsxs)(`small`,{children:[`ID `,e.id]})]},e.id))}),(0,P.jsxs)(`div`,{className:j.historyFooter,children:[(0,P.jsxs)(`span`,{children:[t.window.startDate,` 至 `,t.window.endDate,` · `,t.progress.completed,` / `,t.progress.total,` 项`]}),(0,P.jsx)(`button`,{onClick:()=>e(t.id),children:`查看分析`})]}),t.saveError&&(0,P.jsx)(`p`,{role:`alert`,children:t.saveError})]},t.id))}),a&&(0,P.jsxs)(`div`,{className:j.historyFooter,children:[(0,P.jsx)(`button`,{disabled:t===0,onClick:()=>{o(null),c(``),n(e=>e-1)},children:`上一页`}),(0,P.jsxs)(`span`,{children:[`第 `,t+1,` 页`]}),(0,P.jsx)(`button`,{disabled:!a.hasMore,onClick:()=>{o(null),c(``),n(e=>e+1)},children:`下一页`})]})]})}var oe=[[`summary`,`核心对比`],[`costs`,`推广花费`],[`audience`,`人群画像`],[`strategies`,`投放策略`],[`channels`,`流量渠道`]];function R(e,t=!1){return e==null?`—`:(t?e*100:e).toLocaleString(`zh-CN`,{maximumFractionDigits:2})+(t?`%`:``)}function z({metric:e,percent:t=!1}){return!e||e.value==null?(0,P.jsx)(`span`,{className:j.missing,children:`—`}):(0,P.jsxs)(`span`,{className:e.precision===`range`?j.range:``,children:[typeof e.value==`number`?R(e.value,t):e.value,e.precision===`range`&&(0,P.jsx)(`small`,{children:`区间`})]})}function B({results:e,products:t,rows:n}){let r=Array.from({length:2},(n,r)=>({product:t[r],result:e.find(e=>e.product.id===t[r]?.id)}));return(0,P.jsx)(`div`,{className:j.tableWrap,children:(0,P.jsxs)(`table`,{className:j.comparisonTable,children:[(0,P.jsx)(`thead`,{children:(0,P.jsx)(`tr`,{children:r.map(({product:e,result:t},n)=>(0,P.jsxs)(`th`,{scope:`col`,children:[(0,P.jsxs)(`small`,{children:[`竞品 `,n+1]}),(0,P.jsx)(`strong`,{title:t?.product.name||e?.name,children:t?.product.name||e?.name||`等待添加商品`})]},n))})}),(0,P.jsx)(`tbody`,{children:n.map((e,t)=>(0,P.jsx)(`tr`,{className:e.render?void 0:j.groupRow,children:r.map(({result:t},n)=>(0,P.jsx)(`td`,{children:e.render?(0,P.jsxs)(`div`,{className:j.metricRow,children:[(0,P.jsx)(`span`,{children:e.label}),(0,P.jsx)(`span`,{children:t?e.render(t):`—`})]}):(0,P.jsx)(`strong`,{children:e.label})},n))},e.key||`${e.label}:${t}`))})]})})}function se(e){return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(B,{...e,rows:[{label:`推广总花费(元)`,render:e=>(0,P.jsx)(`strong`,{children:R(e.totalCost)})},{label:`花费记录天数`,render:e=>e.daily.length||`—`},{label:`推广点击量`,render:e=>(0,P.jsx)(z,{metric:e.metrics.click})},{label:`成交笔数(1 日归因)`,render:e=>(0,P.jsx)(z,{metric:e.metrics.alipayCnt1d})}]}),(0,P.jsx)(`p`,{className:j.note,children:`仅展示监控竞品的数据。平台区间保留原值,缺失项显示“—”;不把不同归因范围拼成精确销售额或整体 ROI。`})]})}function ce(e){let t=Date.parse(`${e.window.startDate}T00:00:00Z`),n=Array.from({length:e.window.days},(e,n)=>new Date(t+n*864e5).toISOString().slice(0,10)),r=Array.from({length:2},(t,r)=>{let i=e.products[r],a=e.results.find(e=>e.product.id===i?.id),o=new Map(a?.daily.map(e=>[e.date,e.cost]));return{product:a?.product||i,data:n.map(e=>({date:e,cost:o.get(e)??null}))}}),i=r.flatMap(e=>e.data.map(e=>e.cost)).filter(e=>e!==null&&Number.isFinite(e)),a=Math.max(1,...i),o=10**Math.floor(Math.log10(a)),s=Math.ceil(a/o)*o,c=Math.floor(Math.min(0,...i)/o)*o,l=Array.from({length:5},(e,t)=>c+(s-c)*t/4),u=n.filter((e,t)=>t%Math.ceil(n.length/6)===0||t===n.length-1);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(B,{...e,rows:[`关键词推广`,`货品全站推`,`人群推广`,`内容运营`,`线索推广`].map(e=>({label:`${e}(元)`,render:t=>R(t.costs.find(t=>t.label===e)?.value)}))}),(0,P.jsx)(`h3`,{children:`逐日推广花费`}),(0,P.jsx)(`p`,{className:j.note,children:`按日期查看每日花费 · 单位:元 · 两列同刻度 · 悬停查看当天金额`}),(0,P.jsx)(`div`,{className:j.tableWrap,children:(0,P.jsx)(`div`,{className:j.costColumns,"aria-label":`逐日推广花费柱状对比`,children:r.map(({product:e,data:t},n)=>{let r=t.filter(e=>e.cost===null),i=n===0?`var(--omni-chart-primary,#469eff)`:`var(--omni-chart-teal,#34b9ac)`;return(0,P.jsxs)(`section`,{className:j.costColumn,"aria-label":`竞品 ${n+1} 每日推广花费`,children:[(0,P.jsxs)(`header`,{className:j.costProduct,children:[(0,P.jsxs)(`small`,{children:[(0,P.jsx)(`i`,{style:{background:i}}),`竞品 `,n+1]}),(0,P.jsx)(`strong`,{title:e?.name,children:e?.name||`等待添加商品`})]}),e&&r.length<t.length?(0,P.jsx)(`div`,{className:j.costChart,children:(0,P.jsx)(b,{width:`100%`,height:`100%`,minWidth:0,initialDimension:{width:400,height:280},children:(0,P.jsxs)(C,{data:t,margin:{top:16,right:20,bottom:6,left:0},barCategoryGap:`24%`,accessibilityLayer:!0,children:[(0,P.jsx)(x,{stroke:`var(--omni-line,var(--omni-chart-track,#294052))`,vertical:!1}),(0,P.jsx)(S,{dataKey:`date`,ticks:u,interval:0,tickFormatter:e=>String(e).slice(5).replace(`-`,`/`),height:30,tick:{fontSize:10,fill:`var(--omni-muted,#91a9c0)`},tickLine:!1,axisLine:{stroke:`var(--omni-line,#294052)`}}),(0,P.jsx)(y,{domain:[c,s],ticks:l,width:60,tickLine:!1,axisLine:!1,tick:{fontSize:10,fill:`var(--omni-muted,#91a9c0)`},tickFormatter:e=>Math.abs(e)>=1e4?`${R(e/1e4)}万`:R(e)}),(0,P.jsx)(v,{filterNull:!1,cursor:{fill:`var(--omni-panel,#102236)`,opacity:.45},content:({active:e,label:r})=>{if(!e||r==null)return null;let i=t.find(e=>e.date===r)?.cost;return(0,P.jsxs)(`div`,{className:j.costTooltip,children:[(0,P.jsx)(`strong`,{children:r}),(0,P.jsxs)(`p`,{children:[`竞品 `,n+1,` · 推广花费`]}),(0,P.jsx)(`b`,{children:i==null?`未返回数据`:`${R(i)} 元`})]})}}),(0,P.jsx)(w,{dataKey:`cost`,name:`推广花费(元)`,fill:i,maxBarSize:32,radius:[3,3,0,0],isAnimationActive:!1})]})})}):(0,P.jsx)(`div`,{className:j.costChartEmpty,children:e?`当前商品暂无有效逐日花费`:`添加第二个商品即可对比`}),e&&(0,P.jsxs)(`p`,{className:j.costCoverage,children:[`有效花费 `,t.length-r.length,` / `,t.length,` 天`,r.length>0&&(0,P.jsxs)(P.Fragment,{children:[` · 缺失:`,r.slice(0,4).map(e=>e.date.slice(5)).join(`、`),r.length>4&&` 等 ${r.length} 天`]})]})]},n)})})}),(0,P.jsx)(`h3`,{children:`逐日花费明细(元)`}),(0,P.jsx)(B,{...e,rows:n.map(e=>({label:e,render:t=>R(t.daily.find(t=>t.date===e)?.cost)}))}),(0,P.jsx)(`p`,{className:j.note,children:`合计仅覆盖接口实际返回的日期;未返回的日期不补零。`})]})}var V=[[`impression`,`展现量`],[`click`,`点击量`],[`ctr`,`点击率`],[`cpc`,`点击成本(元)`],[`chargeRatio`,`消耗占比`],[`directDealAmount`,`直接成交额(元)`],[`directRoi`,`直接 ROI`]],H=[[`click`,`点击量`],[`alipayCnt`,`成交笔数`],[`cartRate`,`加购率`],[`alipayConversion`,`支付转化率`],[`clickRate`,`点击率`]];function U(e){return JSON.stringify([e.parent,e.name])}function le(e){let t=[...new Map(e.results.flatMap(e=>e.scenes).map(e=>[U(e),e])).values()].flatMap(e=>[{label:[e.parent,e.name].filter(Boolean).join(` / `)},...V.map(([t,n])=>({label:n,render:n=>(0,P.jsx)(z,{metric:n.scenes.find(t=>U(t)===U(e))?.metrics[t],percent:t===`ctr`||t===`chargeRatio`})}))]);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(B,{...e,rows:t.length?t:[{label:`投放策略`,render:()=>`暂无数据`}]}),(0,P.jsx)(`p`,{className:j.note,children:`两个竞品的场景和策略按同一顺序对齐。直接成交额属于相应场景,不代表商品全渠道销售额。`})]})}function ue(e){let[t,n]=(0,E.useState)([]),r=[...new Map(e.results.flatMap(e=>e.channels).map(e=>[U(e),e])).values()],i=[...new Set(r.map(e=>e.parent||e.name))].flatMap(e=>[r.find(t=>!t.parent&&t.name===e)||{name:e,parent:null,type:``,metrics:{}},...t.includes(e)?r.filter(t=>t.parent===e):[]]),a=Array.from({length:2},(t,n)=>({product:e.products[n],result:e.results.find(t=>t.product.id===e.products[n]?.id)}));return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{className:j.tableWrap,tabIndex:0,role:`region`,"aria-label":`流量渠道对比,可横向滚动`,children:(0,P.jsxs)(`table`,{className:`${j.comparisonTable} ${j.channelTable}`,"aria-label":`两个竞品的渠道指标`,children:[(0,P.jsx)(`thead`,{children:(0,P.jsx)(`tr`,{children:a.map(({product:e,result:t},n)=>(0,P.jsxs)(`th`,{scope:`col`,children:[(0,P.jsxs)(`small`,{children:[`竞品 `,n+1]}),(0,P.jsx)(`strong`,{title:t?.product.name||e?.name,children:t?.product.name||e?.name||`等待添加商品`})]},n))})}),(0,P.jsx)(`tbody`,{children:r.length?i.map(e=>(0,P.jsx)(`tr`,{children:a.map(({result:i},a)=>{let o=i?.channels.find(t=>U(t)===U(e)),s=o?.type&&{organic:`免费`,ad:`付费`,brand_ad:`品牌广告`}[o.type]||`—`;return(0,P.jsxs)(`td`,{children:[(0,P.jsxs)(`div`,{className:j.channelHeading,children:[!e.parent&&r.some(t=>t.parent===e.name)?(0,P.jsxs)(`button`,{className:j.channelToggle,"aria-expanded":t.includes(e.name),onClick:()=>n(t=>t.includes(e.name)?t.filter(t=>t!==e.name):[...t,e.name]),children:[t.includes(e.name)?`▾`:`▸`,` `,e.name,(0,P.jsxs)(`small`,{children:[r.filter(t=>t.parent===e.name).length,` 个子渠道`]})]}):(0,P.jsxs)(`strong`,{className:e.parent?j.channelChild:void 0,children:[e.parent?`↳ `:``,e.name]}),(0,P.jsxs)(`span`,{children:[`渠道类型:`,s]})]}),(0,P.jsx)(`dl`,{className:j.channelMetrics,children:H.map(([e,t])=>(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`dt`,{children:t}),(0,P.jsx)(`dd`,{children:(0,P.jsx)(z,{metric:o?.metrics[e],percent:[`cartRate`,`alipayConversion`,`clickRate`].includes(e)})})]},e))})]},a)})},U(e))):(0,P.jsx)(`tr`,{children:(0,P.jsx)(`td`,{colSpan:2,className:j.channelEmpty,children:`暂无流量渠道数据`})})})]})}),(0,P.jsx)(`p`,{className:j.note,children:`父渠道与子渠道存在包含关系,不能重复加总;没有广告曝光口径的渠道可能不返回点击率。`})]})}function de({products:s,onAdd:c,onRemove:u,onBrowse:d,onStarted:v}){let[y,b]=(0,E.useState)(``),[x,S]=(0,E.useState)(``),[C,w]=(0,E.useState)(null),T=C!==null,O=C===`connect`,[k,M]=p(`competitor.days`,30),[N,F]=p(`competitor.endDate`,h()),[I,L]=(0,E.useState)(null),[R,z]=p(`competitor.job`,null),[B,V]=p(`competitor.section`,`summary`),[H,U]=p(`competitor.view.v2`,`new`),[de,fe]=(0,E.useState)(!1),[W,G]=(0,E.useState)(``),K=W===D,q=(0,E.useRef)(!0),J=(0,E.useRef)(0),Y=R?.status===`running`||R?.status===`queued`,X=R?.id;(0,E.useEffect)(()=>(q.current=!0,()=>{q.current=!1}),[]),(0,E.useEffect)(()=>{let e=!0,t=window.omni?.onDmpDisconnected?.(()=>{e=!1,L(null),G(`达摩盘页面已关闭、刷新或需要重新确认账号`)});return A.windowStatus().then(t=>{e&&t.account&&L({account:t.account})}).catch(t=>{e&&G(t instanceof Error?t.message:`达摩盘连接状态读取失败`)}),()=>{e=!1,t?.()}},[]),(0,E.useEffect)(()=>{if(!X||!Y)return;let e=!1,t;async function n(){try{let r=await A.status(X);e||(z(r),(r.status===`error`||r.status===`cancelled`)&&L(null),S(``),(r.status===`running`||r.status===`queued`)&&(t=setTimeout(()=>void n(),1500)))}catch(r){e||(S(r instanceof Error?r.message:`分析状态读取失败`),t=setTimeout(()=>void n(),5e3))}}return t=setTimeout(()=>void n(),500),()=>{e=!0,clearTimeout(t)}},[X,Y,z,L]);async function Z(e,t=`other`){w(t),S(``);try{await e()}catch(e){q.current&&(t===`open`?G:S)(e instanceof Error?e.message:`操作未完成`)}finally{q.current&&w(null)}}async function pe(){w(`connect`),L(null),G(``),S(``);try{let e=await A.connect();if(!e?.account?.trim())throw Error(`未能确认取数账号,请检查达摩盘窗口是否已显示店铺页面`);q.current&&(G(``),L(e))}catch(e){q.current&&G(e instanceof Error?e.message:`未能连接达摩盘,请检查窗口和登录状态`)}finally{q.current&&w(null)}}function me(){try{let e=_(y);if(!e)throw Error(`请输入有效商品 ID,或带 id 参数的淘宝/天猫商品链接`);c({id:e,name:`商品 ${e}`}),b(``),S(``)}catch(e){S(e.message)}}let Q=``;try{let e=g(k,N);Q=`${e.startDate} 至 ${e.endDate}`}catch{}let $=R?.results||[];return(0,P.jsxs)(`section`,{className:j.page,"aria-label":`竞品分析`,children:[(0,P.jsxs)(`header`,{className:j.header,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{className:j.eyebrow,children:`市场大盘 / 竞品研究`}),(0,P.jsxs)(`h1`,{children:[H===`history`?`历史分析`:H===`new`?`新建竞品分析`:`竞品分析详情`,` `,H===`new`&&(0,P.jsxs)(`span`,{children:[s.length,` / `,2]})]}),(0,P.jsx)(`p`,{children:`从推广投入、客群与渠道,看清商品之间的差异。`})]}),(0,P.jsxs)(`div`,{className:j.headerActions,children:[(0,P.jsx)(`button`,{onClick:()=>{J.current++,U(`history`),S(``)},children:`历史分析`}),(0,P.jsx)(`button`,{onClick:()=>{J.current++,U(`new`),z(null),S(``)},children:`新建分析`}),(0,P.jsxs)(`button`,{onClick:d,children:[(0,P.jsx)(a,{size:15}),`从商品排行榜添加`]})]})]}),x&&(0,P.jsx)(`div`,{className:j.alert,role:`alert`,children:x}),H===`history`&&(0,P.jsx)(ae,{onOpen:e=>{let t=++J.current;Z(async()=>{let n=await A.status(e);q.current&&t===J.current&&(z(n),U(`detail`))})}}),de&&(0,P.jsx)(re,{products:s,onAdd:c,onBrowse:d,onClose:()=>fe(!1)}),H===`new`&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{className:j.productSlots,children:Array.from({length:2},(t,n)=>{let o=s[n],c=$.find(e=>e.product.id===o?.id)?.product||o;return o?(0,P.jsxs)(`article`,{className:j.productCard,children:[(0,P.jsxs)(`span`,{className:j.slotNumber,children:[`0`,n+1]}),(0,P.jsx)(`button`,{className:j.remove,"aria-label":`移除商品 ${o.id}`,disabled:T,onClick:()=>u(o.id),children:(0,P.jsx)(l,{size:15})}),(0,P.jsxs)(`div`,{className:j.productInfo,children:[c.imageUrl?(0,P.jsx)(m,{src:c.imageUrl,name:c.name}):(0,P.jsx)(`span`,{className:j.placeholder,children:(0,P.jsx)(i,{size:26})}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`strong`,{title:c.name,children:c.name}),(0,P.jsx)(`small`,{children:c.shopName||`待查询店铺资料`}),(0,P.jsxs)(`small`,{children:[`ID `,o.id]})]})]}),(0,P.jsxs)(`div`,{className:j.cardLinks,children:[(0,P.jsxs)(`a`,{href:ee(o),target:`_blank`,rel:`noreferrer`,children:[`商品链接 `,(0,P.jsx)(e,{size:13})]}),(0,P.jsx)(f,{text:ee(o),label:`复制商品链接 ${o.id}`,title:`复制商品链接`,children:(0,P.jsx)(r,{size:14})})]})]},o.id):(0,P.jsxs)(`button`,{type:`button`,className:j.emptySlot,disabled:T,"aria-label":`添加第 ${n+1} 个竞品商品`,onClick:()=>fe(!0),children:[(0,P.jsxs)(`span`,{children:[`0`,n+1]}),(0,P.jsx)(a,{size:22}),(0,P.jsx)(`p`,{children:n===0?`添加第一个分析商品`:`添加商品进行并排对比`})]},n)})}),(0,P.jsxs)(`form`,{className:j.addForm,onSubmit:e=>{e.preventDefault(),me()},children:[(0,P.jsx)(`label`,{htmlFor:`competitor-input`,children:`商品 ID / 链接`}),(0,P.jsx)(`input`,{id:`competitor-input`,value:y,onChange:e=>b(e.target.value),placeholder:`粘贴淘宝/天猫商品链接或商品 ID`,disabled:s.length>=2||T}),(0,P.jsxs)(`button`,{type:`submit`,disabled:!y.trim()||s.length>=2||T,children:[(0,P.jsx)(a,{size:15}),`添加商品`]})]}),(0,P.jsxs)(`div`,{className:j.controls,children:[(0,P.jsxs)(`label`,{children:[`分析周期`,(0,P.jsxs)(`select`,{value:k,disabled:T,onChange:e=>M(Number(e.target.value)),children:[(0,P.jsx)(`option`,{value:7,children:`近 7 天`}),(0,P.jsx)(`option`,{value:30,children:`近 30 天`})]})]}),(0,P.jsxs)(`label`,{children:[`截至日期`,(0,P.jsx)(`input`,{type:`date`,max:h(),value:N,disabled:T,onChange:e=>F(e.target.value)})]}),(0,P.jsx)(`button`,{disabled:T||K,onClick:()=>void Z(async()=>{G(``),await A.openWindow()},`open`),children:C===`open`?`正在打开…`:`打开达摩盘`}),(0,P.jsxs)(`button`,{disabled:T||K,onClick:()=>void pe(),children:[(0,P.jsx)(o,{size:14}),O?`正在确认账号…`:I?`重新确认取数账号`:`确认取数账号`]}),(0,P.jsxs)(`button`,{className:j.primary,disabled:!s.length||!I||T||K,onClick:()=>void Z(async()=>{g(k,N);let e=await A.start({op:`start`,products:s,days:k,endDate:N,account:I.account});v(s),q.current&&(z(e),U(`detail`))},`save`),children:[(0,P.jsx)(t,{size:16}),C===`save`?`正在保存…`:`开始分析并保存`]})]}),(0,P.jsx)(`div`,{"aria-live":`polite`,"aria-atomic":`true`,children:O?(0,P.jsx)(`div`,{className:j.connection,role:`status`,children:(0,P.jsxs)(`span`,{children:[(0,P.jsx)(o,{size:16}),`正在连接达摩盘,确认登录状态和取数账号,请稍候…`]})}):W?(0,P.jsxs)(`div`,{className:j.alert,role:`alert`,children:[(0,P.jsx)(`strong`,{children:K?`需要更新桌面端`:`尚未确认取数账号`}),(0,P.jsx)(`div`,{children:W}),!K&&(0,P.jsx)(`div`,{children:`处理后点击“确认取数账号”重试。`})]}):I?(0,P.jsxs)(`div`,{className:j.connection,role:`status`,children:[(0,P.jsxs)(`span`,{children:[(0,P.jsx)(n,{size:18}),(0,P.jsx)(`strong`,{children:`达摩盘连接成功`})]}),(0,P.jsxs)(`span`,{children:[`取数账号:`,I.account]}),(0,P.jsx)(`span`,{children:`可以添加 1~2 个商品并开始分析。`})]}):(0,P.jsx)(`p`,{className:j.note,children:`点击“打开达摩盘”,在新窗口登录。看到店铺页面后回到这里点击“确认取数账号”。分析期间请保持达摩盘窗口打开。`})}),Q&&(0,P.jsxs)(`p`,{className:j.period,children:[Q,` · 统一周期对比 · 数据截至完整自然日`]}),(0,P.jsx)(`p`,{className:j.note,children:`提交成功后清空榜单待选商品;已有采集时,新分析自动排队。保存失败会保留当前选择。`})]}),H===`detail`&&R&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{className:j.historyProducts,children:R.products.map((e,t)=>(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`small`,{children:[`竞品 `,t+1]}),(0,P.jsx)(`strong`,{children:R.results.find(t=>t.product.id===e.id)?.product.name||e.name}),(0,P.jsxs)(`small`,{children:[`ID `,e.id]})]},e.id))}),(0,P.jsxs)(`div`,{className:j.historyFooter,children:[(0,P.jsxs)(`span`,{children:[R.window.startDate,` 至 `,R.window.endDate,` · `,ie[R.status]]}),Y&&R.canCancel&&(0,P.jsxs)(`button`,{disabled:T,onClick:()=>void Z(async()=>{let e=await A.cancel(R.id);q.current&&z(e)}),children:[(0,P.jsx)(te,{size:13}),R.status===`queued`?`取消排队`:`停止采集`]})]}),R.saveError?(0,P.jsxs)(`p`,{className:j.alert,role:`alert`,children:[R.saveError,`;当前页面可能含尚未保存的数据。`]}):R.savedAt&&(0,P.jsxs)(`p`,{className:j.note,children:[`已保存到企业数据库 · `,new Date(R.savedAt).toLocaleString(`zh-CN`)]}),R&&(0,P.jsxs)(`div`,{className:j.progress,role:`status`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`strong`,{children:R.progress.label}),(0,P.jsxs)(`span`,{children:[R.progress.completed,` / `,R.progress.total,` 项`]})]}),(0,P.jsx)(`progress`,{value:R.progress.completed,max:R.progress.total}),R.error&&(0,P.jsx)(`p`,{children:R.error})]}),$.length?(0,P.jsxs)(`section`,{className:j.results,children:[(0,P.jsx)(`nav`,{"aria-label":`竞品分析结果`,children:oe.map(([e,t])=>(0,P.jsx)(`button`,{"aria-pressed":B===e,onClick:()=>V(e),children:t},e))}),(0,P.jsx)(`div`,{className:j.resultBody,children:B===`summary`?(0,P.jsx)(se,{results:$,products:R.products}):B===`costs`?(0,P.jsx)(ce,{results:$,products:R.products,window:R.window}):B===`audience`?(0,P.jsx)(ne,{results:$,products:R.products}):B===`strategies`?(0,P.jsx)(le,{results:$,products:R.products}):(0,P.jsx)(ue,{results:$,products:R.products})}),$.some(e=>e.warnings.length||!e.complete)&&(0,P.jsxs)(`details`,{className:j.notes,children:[(0,P.jsx)(`summary`,{children:`数据完整性与口径说明`}),$.map(e=>(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`strong`,{children:e.product.name}),!e.complete&&(0,P.jsx)(`p`,{children:`该商品尚未完成全部查询,空白项不代表零。`}),e.warnings.map(e=>(0,P.jsx)(`p`,{children:e},e))]},e.product.id))]})]}):(0,P.jsxs)(`div`,{className:j.emptyResult,children:[(0,P.jsx)(t,{size:34}),(0,P.jsx)(`h2`,{children:`两个竞品,一眼对比`}),(0,P.jsx)(`p`,{children:`结果会随采集进度出现,可以返回历史列表或新建下一组分析。`}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{children:`推广投入`}),(0,P.jsx)(`span`,{children:`购买人群`}),(0,P.jsx)(`span`,{children:`投放策略`}),(0,P.jsx)(`span`,{children:`流量渠道`})]})]})]})]})}export{de as default};
|
|
1
|
+
import{t as e}from"./arrow-up-right-FAUwydEi.js";import{t}from"./chart-column-B3ugUaKH.js";import{t as n}from"./check-B7m80-Hk.js";import{t as r}from"./link-2-CC7rgyRC.js";import{t as i}from"./package-rnaOiBPn.js";import{t as a}from"./plus-_W4OFi32.js";import{t as o}from"./refresh-cw-CiIEylYp.js";import{c as s,h as c,l,v as u,x as d}from"./index-Dfy2jMWq.js";import{i as f,l as p,o as m}from"./components-DMbkJLkK.js";import{a as h,i as g,n as _,r as ee}from"./competitor-analysis-XIYJL66C.js";import{_ as v,n as y,nt as b,o as x,r as S}from"./CartesianChart-aa0EJ6w3.js";import{n as C,r as w,t as T}from"./FavoritePicker-LfvebaXO.js";var te=c(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),E=d(u(),1),D=`请在“关于与更新”中更新山海客户端,完成后重启以启用内置达摩盘。`;async function O(e){if(!window.omni?.competitorAnalysis)throw Error(D);let t=await window.omni.competitorAnalysis(e);if(!t.ok)throw Error(t.error);return t.value}async function k(){let e=await O({op:`dmp-window-status`}).catch(e=>{throw e instanceof Error&&e.message===`请先登录山海 Dev`||e instanceof Error&&/不支持的竞品分析操作|仅在源码 Dev 中提供|No handler registered/.test(e.message)?Error(D):e});if(!e||typeof e!=`object`||!(`account`in e)||`id`in e||e.account!==null&&typeof e.account!=`string`)throw Error(D);return{account:e.account}}var A={windowStatus:k,async openWindow(){return await k(),O({op:`open-dmp-window`})},history:(e=0)=>O({op:`history`,page:e}),async connect(){return await k(),O({op:`connect`})},start:async e=>{let{account:t}=await k();if(!t||t!==e.account)throw Error(`请先确认当前达摩盘取数账号`);return O(e)},status:e=>O({op:`status`,id:e}),cancel:e=>O({op:`cancel`,id:e})},j={page:`_page_1yhky_1`,header:`_header_1yhky_2`,eyebrow:`_eyebrow_1yhky_3`,note:`_note_1yhky_5`,period:`_period_1yhky_5`,productSlots:`_productSlots_1yhky_9`,productCard:`_productCard_1yhky_10`,emptySlot:`_emptySlot_1yhky_10`,slotNumber:`_slotNumber_1yhky_11`,remove:`_remove_1yhky_11`,productInfo:`_productInfo_1yhky_12`,placeholder:`_placeholder_1yhky_12`,cardLinks:`_cardLinks_1yhky_13`,addForm:`_addForm_1yhky_14`,controls:`_controls_1yhky_14`,primary:`_primary_1yhky_14`,connection:`_connection_1yhky_15`,alert:`_alert_1yhky_16`,progress:`_progress_1yhky_17`,results:`_results_1yhky_18`,dimensionTabs:`_dimensionTabs_1yhky_18`,resultBody:`_resultBody_1yhky_18`,tableWrap:`_tableWrap_1yhky_18`,comparisonTable:`_comparisonTable_1yhky_18`,metricRow:`_metricRow_1yhky_18`,groupRow:`_groupRow_1yhky_18`,range:`_range_1yhky_18`,missing:`_missing_1yhky_18`,notes:`_notes_1yhky_18`,emptyResult:`_emptyResult_1yhky_19`,audienceToolbar:`_audienceToolbar_1yhky_21`,audienceBehaviors:`_audienceBehaviors_1yhky_22`,audienceLegend:`_audienceLegend_1yhky_22`,audienceTooltip:`_audienceTooltip_1yhky_22`,audienceMetrics:`_audienceMetrics_1yhky_23`,costColumns:`_costColumns_1yhky_24`,audienceColumns:`_audienceColumns_1yhky_24`,costColumn:`_costColumn_1yhky_24`,audienceColumn:`_audienceColumn_1yhky_24`,costProduct:`_costProduct_1yhky_24`,audienceProduct:`_audienceProduct_1yhky_24`,audienceChart:`_audienceChart_1yhky_25`,audienceChartEmpty:`_audienceChartEmpty_1yhky_25`,audienceEmpty:`_audienceEmpty_1yhky_25`,audienceMissing:`_audienceMissing_1yhky_25`,audienceValues:`_audienceValues_1yhky_27`,costChart:`_costChart_1yhky_30`,costChartEmpty:`_costChartEmpty_1yhky_30`,costCoverage:`_costCoverage_1yhky_30`,costTooltip:`_costTooltip_1yhky_30`,channelTable:`_channelTable_1yhky_32`,channelHeading:`_channelHeading_1yhky_32`,channelMetrics:`_channelMetrics_1yhky_32`,channelEmpty:`_channelEmpty_1yhky_32`,channelToggle:`_channelToggle_1yhky_34`,channelChild:`_channelChild_1yhky_34`,headerActions:`_headerActions_1yhky_36`,historyList:`_historyList_1yhky_36`,historyCard:`_historyCard_1yhky_36`,historyHeading:`_historyHeading_1yhky_36`,historyFooter:`_historyFooter_1yhky_36`,historyProducts:`_historyProducts_1yhky_36`,addDialog:`_addDialog_1yhky_38`,dialogHeading:`_dialogHeading_1yhky_38`,sourceChoices:`_sourceChoices_1yhky_38`,pickerForm:`_pickerForm_1yhky_38`,pickerBrowse:`_pickerBrowse_1yhky_38`},M=[{key:`viewers`,label:`浏览`,value:1},{key:`favorites`,label:`收藏`,value:2},{key:`cartAdders`,label:`加购`,value:3},{key:`buyers`,label:`购买`,value:4}];function N(e,t,n){let r=M.filter(e=>t.includes(e.key)),i=[...new Set(e.flatMap(e=>r.flatMap(({key:t})=>(e?.[t]||[]).map(e=>e.name))))],a=!1,o=e.map(e=>i.map(t=>({name:t,...Object.fromEntries(r.map(({key:r})=>{let i=e?.[r]?.find(e=>e.name===t)?.[n];return i==null?[r,null]:!Number.isFinite(i)||i<0||n===`rate`&&i>1?(a=!0,[r,null]):[r,i]}))}))),s=Math.max(1,...o.flatMap(e=>e.flatMap(e=>r.map(({key:t})=>e[t]??0)))),c=10**Math.floor(Math.log10(s)),l=Math.max(4,Math.ceil(Math.ceil(s/c)*c/4)*4);return{columns:o,ceiling:n===`rate`?1:l,invalid:a}}var P=s(),F={viewers:`var(--omni-chart-primary,#469eff)`,favorites:`var(--omni-chart-secondary,#b99aff)`,cartAdders:`var(--omni-chart-orange,#d4a25c)`,buyers:`var(--omni-chart-teal,#34b9ac)`};function I(e,t){return e==null?`—`:(t?e*100:e).toLocaleString(`zh-CN`,{maximumFractionDigits:2})+(t?`%`:``)}function L({x:e=0,y:t=0,payload:n}){let r=String(n?.value||``).match(/.{1,6}/gu)||[];return(0,P.jsx)(`text`,{x:e,y:t+12,textAnchor:`middle`,fill:`var(--omni-muted,var(--omni-chart-primary,#91a9c0))`,fontSize:10,children:r.map((t,n)=>(0,P.jsx)(`tspan`,{x:e,dy:n?14:0,children:t},n))})}function ne({results:e,products:t}){let[r,i]=p(`competitor.audienceDimension`,`性别`),[a,o]=p(`competitor.audienceMetric`,`rate`),[s,c]=p(`competitor.audienceBehaviors`,[`viewers`,`buyers`]),l=a===`rate`,u=M.filter(e=>s.includes(e.key)),d=Array.from({length:2},(n,i)=>{let a=t[i],o=e.find(e=>e.product.id===a?.id);return{product:o?.product||a,group:o?.audiences.find(e=>e.name===r)}}),f=N(d.map(e=>e.group),s,a),m=l?`占比`:`人数`,h=d.some(({group:e})=>e&&(e.favorites===void 0||e.cartAdders===void 0));return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{className:j.dimensionTabs,"aria-label":`画像维度`,children:[`性别`,`年龄`,`购买力`,`城市等级`].map(e=>(0,P.jsx)(`button`,{"aria-pressed":e===r,onClick:()=>i(e),children:e},e))}),(0,P.jsxs)(`div`,{className:j.audienceToolbar,children:[(0,P.jsxs)(`div`,{className:j.audienceBehaviors,role:`group`,"aria-label":`对比人群(可多选)`,children:[(0,P.jsxs)(`span`,{children:[`对比人群 `,(0,P.jsx)(`small`,{children:`可多选`})]}),M.map(({key:e,label:t})=>(0,P.jsxs)(`button`,{"aria-label":`${t}人群`,"aria-pressed":s.includes(e),onClick:()=>c(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),children:[(0,P.jsx)(`i`,{style:{background:F[e]}}),t,s.includes(e)&&(0,P.jsx)(n,{size:12})]},e))]}),(0,P.jsx)(`div`,{className:j.audienceMetrics,role:`group`,"aria-label":`画像对比指标`,children:[`rate`,`count`].map(e=>(0,P.jsx)(`button`,{"aria-pressed":a===e,onClick:()=>o(e),children:e===`rate`?`占比`:`人数`},e))})]}),(0,P.jsxs)(`p`,{className:j.note,children:[`两列同刻度 · `,l?`0–100%`:`0–${I(f.ceiling,!1)} 人`,` · 同色代表同类人群`]}),u.length?(0,P.jsx)(`div`,{className:j.tableWrap,children:(0,P.jsx)(`div`,{className:j.audienceColumns,"aria-label":`${r} · ${m}竖向柱状对比`,children:d.map(({product:e,group:t},n)=>{let i=f.columns[n],a=u.filter(({key:e})=>!i.some(t=>t[e]!=null));return(0,P.jsxs)(`section`,{className:j.audienceColumn,"aria-label":`竞品 ${n+1} ${m}`,children:[(0,P.jsxs)(`header`,{className:j.audienceProduct,children:[(0,P.jsxs)(`small`,{children:[`竞品 `,n+1]}),(0,P.jsx)(`strong`,{title:e?.name,children:e?.name||`等待添加商品`})]}),(0,P.jsx)(`div`,{className:j.audienceLegend,children:u.map(({key:e,label:t})=>(0,P.jsxs)(`span`,{children:[(0,P.jsx)(`i`,{style:{background:F[e]}}),t]},e))}),e&&i.length&&a.length<u.length?(0,P.jsx)(`div`,{className:j.audienceChart,children:(0,P.jsx)(b,{width:`100%`,height:`100%`,minWidth:0,initialDimension:{width:400,height:300},children:(0,P.jsxs)(C,{data:i,margin:{top:16,right:14,bottom:8,left:0},barCategoryGap:`20%`,barGap:3,accessibilityLayer:!0,children:[(0,P.jsx)(x,{stroke:`var(--omni-line,var(--omni-chart-track,#294052))`,vertical:!1}),(0,P.jsx)(S,{dataKey:`name`,interval:0,tick:(0,P.jsx)(L,{}),height:54,tickLine:!1,axisLine:{stroke:`var(--omni-line,#294052)`}}),(0,P.jsx)(y,{domain:[0,f.ceiling],ticks:[0,.25,.5,.75,1].map(e=>e*f.ceiling),width:60,tickLine:!1,axisLine:!1,tick:{fontSize:10,fill:`var(--omni-muted,#91a9c0)`},tickFormatter:e=>l?`${e*100}%`:e>=1e4?`${I(e/1e4,!1)}万`:I(e,!1)}),(0,P.jsx)(v,{cursor:{fill:`var(--omni-panel,#102236)`,opacity:.45},content:({active:e,label:n})=>!e||n==null?null:(0,P.jsxs)(`div`,{className:j.audienceTooltip,children:[(0,P.jsx)(`strong`,{children:n}),u.map(({key:e,label:r})=>{let i=t?.[e]?.find(e=>e.name===String(n));return(0,P.jsxs)(`p`,{children:[(0,P.jsx)(`i`,{style:{background:F[e]}}),r,(0,P.jsxs)(`span`,{children:[I(i?.count,!1),` 人 · `,I(i?.rate,!0)]})]},e)})]})}),u.map(({key:e,label:t})=>(0,P.jsx)(w,{name:t,dataKey:e,fill:F[e],maxBarSize:40,radius:[3,3,0,0],isAnimationActive:!1},e))]},u.map(e=>e.key).join(`,`))})}):(0,P.jsx)(`div`,{className:j.audienceChartEmpty,children:e?`所选人群暂无可用数据`:`添加第二个商品即可对比`}),e&&a.length>0&&(0,P.jsxs)(`p`,{className:j.audienceMissing,children:[a.map(e=>e.label).join(`、`),`:当前维度暂无可用数据`]}),e&&i.length>0&&(0,P.jsxs)(`details`,{className:j.audienceValues,children:[(0,P.jsxs)(`summary`,{children:[`查看`,m,`明细(含缺失项)`]}),(0,P.jsxs)(`table`,{children:[(0,P.jsxs)(`caption`,{children:[r,` · `,m,!l&&`(人)`]}),(0,P.jsx)(`thead`,{children:(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`th`,{scope:`col`,children:`分类`}),u.map(({key:e,label:t})=>(0,P.jsx)(`th`,{scope:`col`,children:t},e))]})}),(0,P.jsx)(`tbody`,{children:i.map(e=>(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`th`,{scope:`row`,children:e.name}),u.map(({key:t})=>(0,P.jsx)(`td`,{children:I(e[t],l)},t))]},e.name))})]})]})]},n)})})}):(0,P.jsx)(`p`,{className:j.audienceEmpty,children:`请选择至少一类人群,可同时选择浏览和购买进行对比。`}),f.invalid&&(0,P.jsx)(`p`,{className:j.note,children:`部分数值超出有效范围,未绘制柱形;未按零值处理。`}),(0,P.jsxs)(`p`,{className:j.note,children:[`悬停查看人数与占比;明细中“—”表示缺失,0 表示已返回的零值。`,h&&`当前结果尚未采集收藏和加购人群,请重新开始分析。`]}),(0,P.jsx)(`p`,{className:j.note,children:`各类人群可能重叠,不相加为总人数;占比按各自人群的原始分母展示,差异反映人群结构,不能直接当作转化率。`})]})}function re({products:e,onAdd:t,onBrowse:n,onClose:r}){let i=(0,E.useRef)(null),[a,o]=(0,E.useState)(`id`),[s,c]=(0,E.useState)(``),[u,d]=(0,E.useState)(``);(0,E.useEffect)(()=>{let e=document.activeElement;return i.current?.showModal(),()=>e?.focus()},[]);function f(e){try{t(e),r()}catch(e){d(e instanceof Error?e.message:`添加未完成`)}}function p(){let e=_(s);if(!e){d(`请输入有效商品 ID,或带 id 参数的淘宝/天猫商品链接`);return}f({id:e,name:`商品 ${e}`})}return(0,P.jsxs)(`dialog`,{ref:i,className:j.addDialog,"aria-labelledby":`competitor-picker-title`,onCancel:e=>{e.preventDefault(),r()},onClick:e=>{e.target===e.currentTarget&&r()},children:[(0,P.jsxs)(`div`,{className:j.dialogHeading,children:[(0,P.jsx)(`h2`,{id:`competitor-picker-title`,children:`添加竞品商品`}),(0,P.jsx)(`button`,{onClick:r,"aria-label":`关闭商品选择`,children:(0,P.jsx)(l,{size:18})})]}),(0,P.jsxs)(`p`,{className:j.note,children:[`已选择 `,e.length,` / `,2,` 个商品`]}),(0,P.jsx)(`nav`,{className:j.sourceChoices,"aria-label":`商品添加方式`,children:[[`id`,`输入 ID / 链接`],[`ranking`,`从商品榜单添加`],[`favorites`,`从收藏商品添加`]].map(([e,t])=>(0,P.jsx)(`button`,{"aria-pressed":a===e,onClick:()=>{o(e),d(``)},children:t},e))}),u&&(0,P.jsx)(`p`,{role:`alert`,className:j.alert,children:u}),a===`id`&&(0,P.jsxs)(`form`,{className:j.pickerForm,onSubmit:e=>{e.preventDefault(),p()},children:[(0,P.jsx)(`label`,{htmlFor:`competitor-picker-id`,children:`商品 ID / 链接`}),(0,P.jsx)(`input`,{id:`competitor-picker-id`,value:s,onChange:e=>c(e.target.value),placeholder:`输入淘宝/天猫商品 ID 或链接`}),(0,P.jsx)(`button`,{type:`submit`,disabled:!s.trim()||e.length>=2,children:`添加到竞品分析`})]}),a===`ranking`&&(0,P.jsxs)(`div`,{className:j.pickerBrowse,children:[(0,P.jsx)(`p`,{children:`在商品排行榜选择商品,点击“加入分析”,已选商品会保留。`}),(0,P.jsx)(`button`,{onClick:()=>{r(),n()},children:`前往商品排行榜`})]}),a===`favorites`&&(0,P.jsx)(T,{kind:`product`,selectedIds:e.map(e=>e.id),onSelect:({record:e})=>{e?.id&&f({id:e.id,name:e.name||`商品 ${e.id}`,imageUrl:e.imageUrl,shopName:e.shopName})}})]})}var ie={queued:`排队中`,running:`采集中`,complete:`已完成`,cancelled:`已停止`,error:`采集异常`,interrupted:`已中断`};function ae({onOpen:e}){let[t,n]=(0,E.useState)(0),[r,i]=(0,E.useState)(0),[a,o]=(0,E.useState)(null),[s,c]=(0,E.useState)(``);return(0,E.useEffect)(()=>{let e=!1,n;async function r(){try{let i=await A.history(t);if(e)return;o(i),c(``),n=setTimeout(()=>void r(),5e3)}catch(t){e||c(t instanceof Error?t.message:`历史分析加载失败`)}}return r(),()=>{e=!0,clearTimeout(n)}},[t,r]),(0,P.jsxs)(`section`,{"aria-label":`历史分析`,children:[(0,P.jsx)(`p`,{className:j.note,children:`历史按当前账号保存到企业数据库,换电脑登录后可查看。返回榜单后会继续采集,请保持这台电脑在线,并保持山海和达摩盘窗口打开。`}),s&&(0,P.jsxs)(`div`,{className:j.alert,role:`alert`,children:[s,` `,(0,P.jsx)(`button`,{onClick:()=>{c(``),i(e=>e+1)},children:`重新加载`})]}),!a&&!s&&(0,P.jsx)(`p`,{role:`status`,children:`正在读取历史分析…`}),a?.items.length===0&&(0,P.jsxs)(`div`,{className:j.emptyResult,children:[(0,P.jsx)(`h2`,{children:`还没有历史分析`}),(0,P.jsx)(`p`,{children:`新建分析后会自动保存,可随时回来查看进度和结果。`})]}),(0,P.jsx)(`div`,{className:j.historyList,children:a?.items.map(t=>(0,P.jsxs)(`article`,{className:j.historyCard,children:[(0,P.jsxs)(`div`,{className:j.historyHeading,children:[(0,P.jsx)(`strong`,{children:ie[t.status]}),(0,P.jsx)(`time`,{children:new Date(t.startedAt).toLocaleString(`zh-CN`)})]}),(0,P.jsx)(`div`,{className:j.historyProducts,children:t.products.map((e,t)=>(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`small`,{children:[`竞品 `,t+1]}),(0,P.jsx)(`strong`,{title:e.name,children:e.name}),(0,P.jsxs)(`small`,{children:[`ID `,e.id]})]},e.id))}),(0,P.jsxs)(`div`,{className:j.historyFooter,children:[(0,P.jsxs)(`span`,{children:[t.window.startDate,` 至 `,t.window.endDate,` · `,t.progress.completed,` / `,t.progress.total,` 项`]}),(0,P.jsx)(`button`,{onClick:()=>e(t.id),children:`查看分析`})]}),t.saveError&&(0,P.jsx)(`p`,{role:`alert`,children:t.saveError})]},t.id))}),a&&(0,P.jsxs)(`div`,{className:j.historyFooter,children:[(0,P.jsx)(`button`,{disabled:t===0,onClick:()=>{o(null),c(``),n(e=>e-1)},children:`上一页`}),(0,P.jsxs)(`span`,{children:[`第 `,t+1,` 页`]}),(0,P.jsx)(`button`,{disabled:!a.hasMore,onClick:()=>{o(null),c(``),n(e=>e+1)},children:`下一页`})]})]})}var oe=[[`summary`,`核心对比`],[`costs`,`推广花费`],[`audience`,`人群画像`],[`strategies`,`投放策略`],[`channels`,`流量渠道`]];function R(e,t=!1){return e==null?`—`:(t?e*100:e).toLocaleString(`zh-CN`,{maximumFractionDigits:2})+(t?`%`:``)}function z({metric:e,percent:t=!1}){return!e||e.value==null?(0,P.jsx)(`span`,{className:j.missing,children:`—`}):(0,P.jsxs)(`span`,{className:e.precision===`range`?j.range:``,children:[typeof e.value==`number`?R(e.value,t):e.value,e.precision===`range`&&(0,P.jsx)(`small`,{children:`区间`})]})}function B({results:e,products:t,rows:n}){let r=Array.from({length:2},(n,r)=>({product:t[r],result:e.find(e=>e.product.id===t[r]?.id)}));return(0,P.jsx)(`div`,{className:j.tableWrap,children:(0,P.jsxs)(`table`,{className:j.comparisonTable,children:[(0,P.jsx)(`thead`,{children:(0,P.jsx)(`tr`,{children:r.map(({product:e,result:t},n)=>(0,P.jsxs)(`th`,{scope:`col`,children:[(0,P.jsxs)(`small`,{children:[`竞品 `,n+1]}),(0,P.jsx)(`strong`,{title:t?.product.name||e?.name,children:t?.product.name||e?.name||`等待添加商品`})]},n))})}),(0,P.jsx)(`tbody`,{children:n.map((e,t)=>(0,P.jsx)(`tr`,{className:e.render?void 0:j.groupRow,children:r.map(({result:t},n)=>(0,P.jsx)(`td`,{children:e.render?(0,P.jsxs)(`div`,{className:j.metricRow,children:[(0,P.jsx)(`span`,{children:e.label}),(0,P.jsx)(`span`,{children:t?e.render(t):`—`})]}):(0,P.jsx)(`strong`,{children:e.label})},n))},e.key||`${e.label}:${t}`))})]})})}function se(e){return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(B,{...e,rows:[{label:`推广总花费(元)`,render:e=>(0,P.jsx)(`strong`,{children:R(e.totalCost)})},{label:`花费记录天数`,render:e=>e.daily.length||`—`},{label:`推广点击量`,render:e=>(0,P.jsx)(z,{metric:e.metrics.click})},{label:`成交笔数(1 日归因)`,render:e=>(0,P.jsx)(z,{metric:e.metrics.alipayCnt1d})}]}),(0,P.jsx)(`p`,{className:j.note,children:`仅展示监控竞品的数据。平台区间保留原值,缺失项显示“—”;不把不同归因范围拼成精确销售额或整体 ROI。`})]})}function ce(e){let t=Date.parse(`${e.window.startDate}T00:00:00Z`),n=Array.from({length:e.window.days},(e,n)=>new Date(t+n*864e5).toISOString().slice(0,10)),r=Array.from({length:2},(t,r)=>{let i=e.products[r],a=e.results.find(e=>e.product.id===i?.id),o=new Map(a?.daily.map(e=>[e.date,e.cost]));return{product:a?.product||i,data:n.map(e=>({date:e,cost:o.get(e)??null}))}}),i=r.flatMap(e=>e.data.map(e=>e.cost)).filter(e=>e!==null&&Number.isFinite(e)),a=Math.max(1,...i),o=10**Math.floor(Math.log10(a)),s=Math.ceil(a/o)*o,c=Math.floor(Math.min(0,...i)/o)*o,l=Array.from({length:5},(e,t)=>c+(s-c)*t/4),u=n.filter((e,t)=>t%Math.ceil(n.length/6)===0||t===n.length-1);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(B,{...e,rows:[`关键词推广`,`货品全站推`,`人群推广`,`内容运营`,`线索推广`].map(e=>({label:`${e}(元)`,render:t=>R(t.costs.find(t=>t.label===e)?.value)}))}),(0,P.jsx)(`h3`,{children:`逐日推广花费`}),(0,P.jsx)(`p`,{className:j.note,children:`按日期查看每日花费 · 单位:元 · 两列同刻度 · 悬停查看当天金额`}),(0,P.jsx)(`div`,{className:j.tableWrap,children:(0,P.jsx)(`div`,{className:j.costColumns,"aria-label":`逐日推广花费柱状对比`,children:r.map(({product:e,data:t},n)=>{let r=t.filter(e=>e.cost===null),i=n===0?`var(--omni-chart-primary,#469eff)`:`var(--omni-chart-teal,#34b9ac)`;return(0,P.jsxs)(`section`,{className:j.costColumn,"aria-label":`竞品 ${n+1} 每日推广花费`,children:[(0,P.jsxs)(`header`,{className:j.costProduct,children:[(0,P.jsxs)(`small`,{children:[(0,P.jsx)(`i`,{style:{background:i}}),`竞品 `,n+1]}),(0,P.jsx)(`strong`,{title:e?.name,children:e?.name||`等待添加商品`})]}),e&&r.length<t.length?(0,P.jsx)(`div`,{className:j.costChart,children:(0,P.jsx)(b,{width:`100%`,height:`100%`,minWidth:0,initialDimension:{width:400,height:280},children:(0,P.jsxs)(C,{data:t,margin:{top:16,right:20,bottom:6,left:0},barCategoryGap:`24%`,accessibilityLayer:!0,children:[(0,P.jsx)(x,{stroke:`var(--omni-line,var(--omni-chart-track,#294052))`,vertical:!1}),(0,P.jsx)(S,{dataKey:`date`,ticks:u,interval:0,tickFormatter:e=>String(e).slice(5).replace(`-`,`/`),height:30,tick:{fontSize:10,fill:`var(--omni-muted,#91a9c0)`},tickLine:!1,axisLine:{stroke:`var(--omni-line,#294052)`}}),(0,P.jsx)(y,{domain:[c,s],ticks:l,width:60,tickLine:!1,axisLine:!1,tick:{fontSize:10,fill:`var(--omni-muted,#91a9c0)`},tickFormatter:e=>Math.abs(e)>=1e4?`${R(e/1e4)}万`:R(e)}),(0,P.jsx)(v,{filterNull:!1,cursor:{fill:`var(--omni-panel,#102236)`,opacity:.45},content:({active:e,label:r})=>{if(!e||r==null)return null;let i=t.find(e=>e.date===r)?.cost;return(0,P.jsxs)(`div`,{className:j.costTooltip,children:[(0,P.jsx)(`strong`,{children:r}),(0,P.jsxs)(`p`,{children:[`竞品 `,n+1,` · 推广花费`]}),(0,P.jsx)(`b`,{children:i==null?`未返回数据`:`${R(i)} 元`})]})}}),(0,P.jsx)(w,{dataKey:`cost`,name:`推广花费(元)`,fill:i,maxBarSize:32,radius:[3,3,0,0],isAnimationActive:!1})]})})}):(0,P.jsx)(`div`,{className:j.costChartEmpty,children:e?`当前商品暂无有效逐日花费`:`添加第二个商品即可对比`}),e&&(0,P.jsxs)(`p`,{className:j.costCoverage,children:[`有效花费 `,t.length-r.length,` / `,t.length,` 天`,r.length>0&&(0,P.jsxs)(P.Fragment,{children:[` · 缺失:`,r.slice(0,4).map(e=>e.date.slice(5)).join(`、`),r.length>4&&` 等 ${r.length} 天`]})]})]},n)})})}),(0,P.jsx)(`h3`,{children:`逐日花费明细(元)`}),(0,P.jsx)(B,{...e,rows:n.map(e=>({label:e,render:t=>R(t.daily.find(t=>t.date===e)?.cost)}))}),(0,P.jsx)(`p`,{className:j.note,children:`合计仅覆盖接口实际返回的日期;未返回的日期不补零。`})]})}var V=[[`impression`,`展现量`],[`click`,`点击量`],[`ctr`,`点击率`],[`cpc`,`点击成本(元)`],[`chargeRatio`,`消耗占比`],[`directDealAmount`,`直接成交额(元)`],[`directRoi`,`直接 ROI`]],H=[[`click`,`点击量`],[`alipayCnt`,`成交笔数`],[`cartRate`,`加购率`],[`alipayConversion`,`支付转化率`],[`clickRate`,`点击率`]];function U(e){return JSON.stringify([e.parent,e.name])}function le(e){let t=[...new Map(e.results.flatMap(e=>e.scenes).map(e=>[U(e),e])).values()].flatMap(e=>[{label:[e.parent,e.name].filter(Boolean).join(` / `)},...V.map(([t,n])=>({label:n,render:n=>(0,P.jsx)(z,{metric:n.scenes.find(t=>U(t)===U(e))?.metrics[t],percent:t===`ctr`||t===`chargeRatio`})}))]);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(B,{...e,rows:t.length?t:[{label:`投放策略`,render:()=>`暂无数据`}]}),(0,P.jsx)(`p`,{className:j.note,children:`两个竞品的场景和策略按同一顺序对齐。直接成交额属于相应场景,不代表商品全渠道销售额。`})]})}function ue(e){let[t,n]=(0,E.useState)([]),r=[...new Map(e.results.flatMap(e=>e.channels).map(e=>[U(e),e])).values()],i=[...new Set(r.map(e=>e.parent||e.name))].flatMap(e=>[r.find(t=>!t.parent&&t.name===e)||{name:e,parent:null,type:``,metrics:{}},...t.includes(e)?r.filter(t=>t.parent===e):[]]),a=Array.from({length:2},(t,n)=>({product:e.products[n],result:e.results.find(t=>t.product.id===e.products[n]?.id)}));return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{className:j.tableWrap,tabIndex:0,role:`region`,"aria-label":`流量渠道对比,可横向滚动`,children:(0,P.jsxs)(`table`,{className:`${j.comparisonTable} ${j.channelTable}`,"aria-label":`两个竞品的渠道指标`,children:[(0,P.jsx)(`thead`,{children:(0,P.jsx)(`tr`,{children:a.map(({product:e,result:t},n)=>(0,P.jsxs)(`th`,{scope:`col`,children:[(0,P.jsxs)(`small`,{children:[`竞品 `,n+1]}),(0,P.jsx)(`strong`,{title:t?.product.name||e?.name,children:t?.product.name||e?.name||`等待添加商品`})]},n))})}),(0,P.jsx)(`tbody`,{children:r.length?i.map(e=>(0,P.jsx)(`tr`,{children:a.map(({result:i},a)=>{let o=i?.channels.find(t=>U(t)===U(e)),s=o?.type&&{organic:`免费`,ad:`付费`,brand_ad:`品牌广告`}[o.type]||`—`;return(0,P.jsxs)(`td`,{children:[(0,P.jsxs)(`div`,{className:j.channelHeading,children:[!e.parent&&r.some(t=>t.parent===e.name)?(0,P.jsxs)(`button`,{className:j.channelToggle,"aria-expanded":t.includes(e.name),onClick:()=>n(t=>t.includes(e.name)?t.filter(t=>t!==e.name):[...t,e.name]),children:[t.includes(e.name)?`▾`:`▸`,` `,e.name,(0,P.jsxs)(`small`,{children:[r.filter(t=>t.parent===e.name).length,` 个子渠道`]})]}):(0,P.jsxs)(`strong`,{className:e.parent?j.channelChild:void 0,children:[e.parent?`↳ `:``,e.name]}),(0,P.jsxs)(`span`,{children:[`渠道类型:`,s]})]}),(0,P.jsx)(`dl`,{className:j.channelMetrics,children:H.map(([e,t])=>(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`dt`,{children:t}),(0,P.jsx)(`dd`,{children:(0,P.jsx)(z,{metric:o?.metrics[e],percent:[`cartRate`,`alipayConversion`,`clickRate`].includes(e)})})]},e))})]},a)})},U(e))):(0,P.jsx)(`tr`,{children:(0,P.jsx)(`td`,{colSpan:2,className:j.channelEmpty,children:`暂无流量渠道数据`})})})]})}),(0,P.jsx)(`p`,{className:j.note,children:`父渠道与子渠道存在包含关系,不能重复加总;没有广告曝光口径的渠道可能不返回点击率。`})]})}function de({products:s,onAdd:c,onRemove:u,onBrowse:d,onStarted:v}){let[y,b]=(0,E.useState)(``),[x,S]=(0,E.useState)(``),[C,w]=(0,E.useState)(null),T=C!==null,O=C===`connect`,[k,M]=p(`competitor.days`,30),[N,F]=p(`competitor.endDate`,h()),[I,L]=(0,E.useState)(null),[R,z]=p(`competitor.job`,null),[B,V]=p(`competitor.section`,`summary`),[H,U]=p(`competitor.view.v2`,`new`),[de,fe]=(0,E.useState)(!1),[W,G]=(0,E.useState)(``),K=W===D,q=(0,E.useRef)(!0),J=(0,E.useRef)(0),Y=R?.status===`running`||R?.status===`queued`,X=R?.id;(0,E.useEffect)(()=>(q.current=!0,()=>{q.current=!1}),[]),(0,E.useEffect)(()=>{let e=!0,t=window.omni?.onDmpDisconnected?.(()=>{e=!1,L(null),G(`达摩盘页面已关闭、刷新或需要重新确认账号`)});return A.windowStatus().then(t=>{e&&t.account&&L({account:t.account})}).catch(t=>{e&&G(t instanceof Error?t.message:`达摩盘连接状态读取失败`)}),()=>{e=!1,t?.()}},[]),(0,E.useEffect)(()=>{if(!X||!Y)return;let e=!1,t;async function n(){try{let r=await A.status(X);e||(z(r),(r.status===`error`||r.status===`cancelled`)&&L(null),S(``),(r.status===`running`||r.status===`queued`)&&(t=setTimeout(()=>void n(),1500)))}catch(r){e||(S(r instanceof Error?r.message:`分析状态读取失败`),t=setTimeout(()=>void n(),5e3))}}return t=setTimeout(()=>void n(),500),()=>{e=!0,clearTimeout(t)}},[X,Y,z,L]);async function Z(e,t=`other`){w(t),S(``);try{await e()}catch(e){q.current&&(t===`open`?G:S)(e instanceof Error?e.message:`操作未完成`)}finally{q.current&&w(null)}}async function pe(){w(`connect`),L(null),G(``),S(``);try{let e=await A.connect();if(!e?.account?.trim())throw Error(`未能确认取数账号,请检查达摩盘窗口是否已显示店铺页面`);q.current&&(G(``),L(e))}catch(e){q.current&&G(e instanceof Error?e.message:`未能连接达摩盘,请检查窗口和登录状态`)}finally{q.current&&w(null)}}function me(){try{let e=_(y);if(!e)throw Error(`请输入有效商品 ID,或带 id 参数的淘宝/天猫商品链接`);c({id:e,name:`商品 ${e}`}),b(``),S(``)}catch(e){S(e.message)}}let Q=``;try{let e=g(k,N);Q=`${e.startDate} 至 ${e.endDate}`}catch{}let $=R?.results||[];return(0,P.jsxs)(`section`,{className:j.page,"aria-label":`竞品分析`,children:[(0,P.jsxs)(`header`,{className:j.header,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{className:j.eyebrow,children:`市场大盘 / 竞品研究`}),(0,P.jsxs)(`h1`,{children:[H===`history`?`历史分析`:H===`new`?`新建竞品分析`:`竞品分析详情`,` `,H===`new`&&(0,P.jsxs)(`span`,{children:[s.length,` / `,2]})]}),(0,P.jsx)(`p`,{children:`从推广投入、客群与渠道,看清商品之间的差异。`})]}),(0,P.jsxs)(`div`,{className:j.headerActions,children:[(0,P.jsx)(`button`,{onClick:()=>{J.current++,U(`history`),S(``)},children:`历史分析`}),(0,P.jsx)(`button`,{onClick:()=>{J.current++,U(`new`),z(null),S(``)},children:`新建分析`}),(0,P.jsxs)(`button`,{onClick:d,children:[(0,P.jsx)(a,{size:15}),`从商品排行榜添加`]})]})]}),x&&(0,P.jsx)(`div`,{className:j.alert,role:`alert`,children:x}),H===`history`&&(0,P.jsx)(ae,{onOpen:e=>{let t=++J.current;Z(async()=>{let n=await A.status(e);q.current&&t===J.current&&(z(n),U(`detail`))})}}),de&&(0,P.jsx)(re,{products:s,onAdd:c,onBrowse:d,onClose:()=>fe(!1)}),H===`new`&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{className:j.productSlots,children:Array.from({length:2},(t,n)=>{let o=s[n],c=$.find(e=>e.product.id===o?.id)?.product||o;return o?(0,P.jsxs)(`article`,{className:j.productCard,children:[(0,P.jsxs)(`span`,{className:j.slotNumber,children:[`0`,n+1]}),(0,P.jsx)(`button`,{className:j.remove,"aria-label":`移除商品 ${o.id}`,disabled:T,onClick:()=>u(o.id),children:(0,P.jsx)(l,{size:15})}),(0,P.jsxs)(`div`,{className:j.productInfo,children:[c.imageUrl?(0,P.jsx)(m,{src:c.imageUrl,name:c.name}):(0,P.jsx)(`span`,{className:j.placeholder,children:(0,P.jsx)(i,{size:26})}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`strong`,{title:c.name,children:c.name}),(0,P.jsx)(`small`,{children:c.shopName||`待查询店铺资料`}),(0,P.jsxs)(`small`,{children:[`ID `,o.id]})]})]}),(0,P.jsxs)(`div`,{className:j.cardLinks,children:[(0,P.jsxs)(`a`,{href:ee(o),target:`_blank`,rel:`noreferrer`,children:[`商品链接 `,(0,P.jsx)(e,{size:13})]}),(0,P.jsx)(f,{text:ee(o),label:`复制商品链接 ${o.id}`,title:`复制商品链接`,children:(0,P.jsx)(r,{size:14})})]})]},o.id):(0,P.jsxs)(`button`,{type:`button`,className:j.emptySlot,disabled:T,"aria-label":`添加第 ${n+1} 个竞品商品`,onClick:()=>fe(!0),children:[(0,P.jsxs)(`span`,{children:[`0`,n+1]}),(0,P.jsx)(a,{size:22}),(0,P.jsx)(`p`,{children:n===0?`添加第一个分析商品`:`添加商品进行并排对比`})]},n)})}),(0,P.jsxs)(`form`,{className:j.addForm,onSubmit:e=>{e.preventDefault(),me()},children:[(0,P.jsx)(`label`,{htmlFor:`competitor-input`,children:`商品 ID / 链接`}),(0,P.jsx)(`input`,{id:`competitor-input`,value:y,onChange:e=>b(e.target.value),placeholder:`粘贴淘宝/天猫商品链接或商品 ID`,disabled:s.length>=2||T}),(0,P.jsxs)(`button`,{type:`submit`,disabled:!y.trim()||s.length>=2||T,children:[(0,P.jsx)(a,{size:15}),`添加商品`]})]}),(0,P.jsxs)(`div`,{className:j.controls,children:[(0,P.jsxs)(`label`,{children:[`分析周期`,(0,P.jsxs)(`select`,{value:k,disabled:T,onChange:e=>M(Number(e.target.value)),children:[(0,P.jsx)(`option`,{value:7,children:`近 7 天`}),(0,P.jsx)(`option`,{value:30,children:`近 30 天`})]})]}),(0,P.jsxs)(`label`,{children:[`截至日期`,(0,P.jsx)(`input`,{type:`date`,max:h(),value:N,disabled:T,onChange:e=>F(e.target.value)})]}),(0,P.jsx)(`button`,{disabled:T||K,onClick:()=>void Z(async()=>{G(``),await A.openWindow()},`open`),children:C===`open`?`正在打开…`:`打开达摩盘`}),(0,P.jsxs)(`button`,{disabled:T||K,onClick:()=>void pe(),children:[(0,P.jsx)(o,{size:14}),O?`正在确认账号…`:I?`重新确认取数账号`:`确认取数账号`]}),(0,P.jsxs)(`button`,{className:j.primary,disabled:!s.length||!I||T||K,onClick:()=>void Z(async()=>{g(k,N);let e=await A.start({op:`start`,products:s,days:k,endDate:N,account:I.account});v(s),q.current&&(z(e),U(`detail`))},`save`),children:[(0,P.jsx)(t,{size:16}),C===`save`?`正在保存…`:`开始分析并保存`]})]}),(0,P.jsx)(`div`,{"aria-live":`polite`,"aria-atomic":`true`,children:O?(0,P.jsx)(`div`,{className:j.connection,role:`status`,children:(0,P.jsxs)(`span`,{children:[(0,P.jsx)(o,{size:16}),`正在连接达摩盘,确认登录状态和取数账号,请稍候…`]})}):W?(0,P.jsxs)(`div`,{className:j.alert,role:`alert`,children:[(0,P.jsx)(`strong`,{children:K?`需要更新桌面端`:`尚未确认取数账号`}),(0,P.jsx)(`div`,{children:W}),!K&&(0,P.jsx)(`div`,{children:`处理后点击“确认取数账号”重试。`})]}):I?(0,P.jsxs)(`div`,{className:j.connection,role:`status`,children:[(0,P.jsxs)(`span`,{children:[(0,P.jsx)(n,{size:18}),(0,P.jsx)(`strong`,{children:`达摩盘连接成功`})]}),(0,P.jsxs)(`span`,{children:[`取数账号:`,I.account]}),(0,P.jsx)(`span`,{children:`可以添加 1~2 个商品并开始分析。`})]}):(0,P.jsx)(`p`,{className:j.note,children:`点击“打开达摩盘”,在新窗口登录。看到店铺页面后回到这里点击“确认取数账号”。分析期间请保持达摩盘窗口打开。`})}),Q&&(0,P.jsxs)(`p`,{className:j.period,children:[Q,` · 统一周期对比 · 数据截至完整自然日`]}),(0,P.jsx)(`p`,{className:j.note,children:`提交成功后清空榜单待选商品;已有采集时,新分析自动排队。保存失败会保留当前选择。`})]}),H===`detail`&&R&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{className:j.historyProducts,children:R.products.map((e,t)=>(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`small`,{children:[`竞品 `,t+1]}),(0,P.jsx)(`strong`,{children:R.results.find(t=>t.product.id===e.id)?.product.name||e.name}),(0,P.jsxs)(`small`,{children:[`ID `,e.id]})]},e.id))}),(0,P.jsxs)(`div`,{className:j.historyFooter,children:[(0,P.jsxs)(`span`,{children:[R.window.startDate,` 至 `,R.window.endDate,` · `,ie[R.status]]}),Y&&R.canCancel&&(0,P.jsxs)(`button`,{disabled:T,onClick:()=>void Z(async()=>{let e=await A.cancel(R.id);q.current&&z(e)}),children:[(0,P.jsx)(te,{size:13}),R.status===`queued`?`取消排队`:`停止采集`]})]}),R.saveError?(0,P.jsxs)(`p`,{className:j.alert,role:`alert`,children:[R.saveError,`;当前页面可能含尚未保存的数据。`]}):R.savedAt&&(0,P.jsxs)(`p`,{className:j.note,children:[`已保存到企业数据库 · `,new Date(R.savedAt).toLocaleString(`zh-CN`)]}),R&&(0,P.jsxs)(`div`,{className:j.progress,role:`status`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`strong`,{children:R.progress.label}),(0,P.jsxs)(`span`,{children:[R.progress.completed,` / `,R.progress.total,` 项`]})]}),(0,P.jsx)(`progress`,{value:R.progress.completed,max:R.progress.total}),R.error&&(0,P.jsx)(`p`,{children:R.error})]}),$.length?(0,P.jsxs)(`section`,{className:j.results,children:[(0,P.jsx)(`nav`,{"aria-label":`竞品分析结果`,children:oe.map(([e,t])=>(0,P.jsx)(`button`,{"aria-pressed":B===e,onClick:()=>V(e),children:t},e))}),(0,P.jsx)(`div`,{className:j.resultBody,children:B===`summary`?(0,P.jsx)(se,{results:$,products:R.products}):B===`costs`?(0,P.jsx)(ce,{results:$,products:R.products,window:R.window}):B===`audience`?(0,P.jsx)(ne,{results:$,products:R.products}):B===`strategies`?(0,P.jsx)(le,{results:$,products:R.products}):(0,P.jsx)(ue,{results:$,products:R.products})}),$.some(e=>e.warnings.length||!e.complete)&&(0,P.jsxs)(`details`,{className:j.notes,children:[(0,P.jsx)(`summary`,{children:`数据完整性与口径说明`}),$.map(e=>(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`strong`,{children:e.product.name}),!e.complete&&(0,P.jsx)(`p`,{children:`该商品尚未完成全部查询,空白项不代表零。`}),e.warnings.map(e=>(0,P.jsx)(`p`,{children:e},e))]},e.product.id))]})]}):(0,P.jsxs)(`div`,{className:j.emptyResult,children:[(0,P.jsx)(t,{size:34}),(0,P.jsx)(`h2`,{children:`两个竞品,一眼对比`}),(0,P.jsx)(`p`,{children:`结果会随采集进度出现,可以返回历史列表或新建下一组分析。`}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{children:`推广投入`}),(0,P.jsx)(`span`,{children:`购买人群`}),(0,P.jsx)(`span`,{children:`投放策略`}),(0,P.jsx)(`span`,{children:`流量渠道`})]})]})]})]})}export{de as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./layers-B4gCFnEm.js";import{c as t}from"./index-Dfy2jMWq.js";var n=t();function r({title:t,children:r,action:i}){return(0,n.jsxs)(`div`,{className:`wb-empty`,children:[(0,n.jsx)(e,{size:30}),(0,n.jsx)(`h3`,{children:t}),(0,n.jsx)(`p`,{children:r}),i]})}export{r as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{v as e,x as t}from"./index-CShNDEcL.js";import{Et as n,Ft as r,G as i,H as a,K as o,Lt as s,Mt as c,Nt as l,Pt as u,St as d,U as f,Ut as p,V as m,W as ee,kt as h,zt as g}from"./CartesianChart-CGNvk6St.js";var _=Math.cos,v=Math.sin,y=Math.sqrt,b=Math.PI;b/2;var x=2*b,S={draw(e,t){let n=y(t/b);e.moveTo(n,0),e.arc(0,0,n,0,x)}},C={draw(e,t){let n=y(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},w=y(1/3),T=w*2,E={draw(e,t){let n=y(t/T),r=n*w;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},D={draw(e,t){let n=y(t),r=-n/2;e.rect(r,r,n,n)}},O=.8908130915292852,k=v(b/10)/v(7*b/10),A=v(x/10)*k,j=-_(x/10)*k,M={draw(e,t){let n=y(t*O),r=A*n,i=j*n;e.moveTo(0,-n),e.lineTo(r,i);for(let t=1;t<5;++t){let a=x*t/5,o=_(a),s=v(a);e.lineTo(s*n,-o*n),e.lineTo(o*r-s*i,s*r+o*i)}e.closePath()}},N=y(3),P={draw(e,t){let n=-y(t/(N*3));e.moveTo(0,n*2),e.lineTo(-N*n,-n),e.lineTo(N*n,-n),e.closePath()}},F=-.5,I=y(3)/2,L=1/y(12),te=(L/2+1)*3,ne={draw(e,t){let n=y(t/te),r=n/2,i=n*L,a=r,o=n*L+n,s=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(s,c),e.lineTo(F*r-I*i,I*r+F*i),e.lineTo(F*a-I*o,I*a+F*o),e.lineTo(F*s-I*c,I*s+F*c),e.lineTo(F*r+I*i,F*i-I*r),e.lineTo(F*a+I*o,F*o-I*a),e.lineTo(F*s+I*c,F*c-I*s),e.closePath()}};function re(e,t){let n=null,i=u(a);e=typeof e==`function`?e:r(e||S),t=typeof t==`function`?t:r(t===void 0?64:+t);function a(){let r;if(n||=r=i(),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),r)return n=null,r+``||null}return a.type=function(t){return arguments.length?(e=typeof t==`function`?t:r(t),a):e},a.size=function(e){return arguments.length?(t=typeof e==`function`?e:r(+e),a):t},a.context=function(e){return arguments.length?(n=e??null,a):n},a}var R=t(e()),ie=[`type`,`size`,`sizeType`];function z(){return z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},z.apply(null,arguments)}function B(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function V(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?B(Object(n),!0).forEach(function(t){ae(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ae(e,t,n){return(t=oe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oe(e){var t=se(e,`string`);return typeof t==`symbol`?t:t+``}function se(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function ce(e,t){if(e==null)return{};var n,r,i=le(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function le(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var H={symbolCircle:S,symbolCross:C,symbolDiamond:E,symbolSquare:D,symbolStar:M,symbolTriangle:P,symbolWye:ne},ue=Math.PI/180,U=e=>H[`symbol${c(e)}`]||S,de=(e,t,n)=>{if(t===`area`)return e;switch(n){case`cross`:return 5*e*e/9;case`diamond`:return .5*e*e/Math.sqrt(3);case`square`:return e*e;case`star`:var r=18*ue;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2);case`triangle`:return Math.sqrt(3)*e*e/4;case`wye`:return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},fe=(e,t)=>{H[`symbol${c(e)}`]=t},W=e=>{var{type:t=`circle`,size:n=64,sizeType:r=`area`}=e,i=V(V({},ce(e,ie)),{},{type:t,size:n,sizeType:r}),a=`circle`;typeof t==`string`&&(a=t);var o=()=>{var e=U(a),t=re().type(e).size(de(n,r,a))();if(t!==null)return t},{className:s,cx:c,cy:l}=i,u=g(i);return h(c)&&h(l)&&h(n)?R.createElement(`path`,z({},u,{className:p(`recharts-symbols`,s),transform:`translate(${c}, ${l})`,d:o()})):null};W.registerSymbol=fe;function pe(e){if(typeof e!=`object`||!e)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!==`[object Object]`){let t=e[Symbol.toStringTag];return t==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${t}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}var me,he,ge,_e,ve;function G(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function K(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?G(Object(n),!0).forEach(function(t){ye(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):G(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ye(e,t,n){return(t=be(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function be(e){var t=xe(e,`string`);return typeof t==`symbol`?t:t+``}function xe(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function q(){return q=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},q.apply(null,arguments)}function J(e,t){return t||=e.slice(0),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Y=(e,t,n,r,i)=>{var a=n-r,o=l(me||=J([`M `,`,`,``]),e,t);return o+=l(he||=J([`L `,`,`,``]),e+n,t),o+=l(ge||=J([`L `,`,`,``]),e+n-a/2,t+i),o+=l(_e||=J([`L `,`,`,``]),e+n-a/2-r,t+i),o+=l(ve||=J([`L `,`,`,` Z`]),e,t),o},Se={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:`ease`},Ce=e=>{var t=d(e,Se),{x:r,y:a,upperWidth:o,lowerWidth:s,height:c,className:l}=t,{animationEasing:u,animationDuration:m,animationBegin:h,isUpdateAnimationActive:_}=t,v=(0,R.useRef)(null),[y,b]=(0,R.useState)(-1),x=(0,R.useRef)(o),S=(0,R.useRef)(s),C=(0,R.useRef)(c),w=(0,R.useRef)(r),T=(0,R.useRef)(a),E=f(e,`trapezoid-`);if((0,R.useEffect)(()=>{if(v.current&&v.current.getTotalLength)try{var e=v.current.getTotalLength();e&&b(e)}catch{}},[]),r!==+r||a!==+a||o!==+o||s!==+s||c!==+c||o===0&&s===0||c===0)return null;var D=p(`recharts-trapezoid`,l);if(!_)return R.createElement(`g`,null,R.createElement(`path`,q({},g(t),{className:D,d:Y(r,a,o,s,c)})));var O=x.current,k=S.current,A=C.current,j=w.current,M=T.current,N=`0px ${y===-1?1:y}px`,P=`${y}px ${y}px`,F=i([`strokeDasharray`],m,u);return R.createElement(ee,{animationId:E,key:E,canBegin:y>0,duration:m,easing:u,isActive:_,begin:h},e=>{var i=n(O,o,e),l=n(k,s,e),u=n(A,c,e),d=n(j,r,e),f=n(M,a,e);v.current&&(x.current=i,S.current=l,C.current=u,w.current=d,T.current=f);var p=e>0?{transition:F,strokeDasharray:P}:{strokeDasharray:N};return R.createElement(`path`,q({},g(t),{className:D,d:Y(d,f,i,l,u),ref:v,style:K(K({},p),t.style)}))})},we=[`option`,`shapeType`,`activeClassName`,`inActiveClassName`];function Te(e,t){if(e==null)return{};var n,r,i=Ee(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ee(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function X(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Z(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?X(Object(n),!0).forEach(function(t){De(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function De(e,t,n){return(t=Oe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Oe(e){var t=ke(e,`string`);return typeof t==`symbol`?t:t+``}function ke(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Q(e,t){return Z(Z({},t),e)}function Ae(e,t){return e===`symbols`}function $(e){var{shapeType:t,elementProps:n}=e;switch(t){case`rectangle`:return R.createElement(a,n);case`trapezoid`:return R.createElement(Ce,n);case`sector`:return R.createElement(m,n);case`symbols`:if(Ae(t,n))return R.createElement(W,n);break;case`curve`:return R.createElement(o,n);default:return null}}function je(e){return(0,R.isValidElement)(e)?e.props:e}function Me(e){var{option:t,shapeType:n,activeClassName:r=`recharts-active-shape`,inActiveClassName:i=`recharts-shape`}=e,a=Te(e,we),o;if((0,R.isValidElement)(t))o=(0,R.cloneElement)(t,Z(Z({},a),je(t)));else if(typeof t==`function`)o=t(a,a.index);else if(pe(t)&&typeof t!=`boolean`){var c=Q(t,a);o=R.createElement($,{shapeType:n,elementProps:c})}else{var l=a;o=R.createElement($,{shapeType:n,elementProps:l})}return a.isActive?R.createElement(s,{className:r},o):R.createElement(s,{className:i},o)}var Ne=[`children`];function Pe(e,t){if(e==null)return{};var n,r,i=Fe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Fe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Ie=(0,R.createContext)({data:[],xAxisId:`xAxis-0`,yAxisId:`yAxis-0`,dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0});function Le(e){var{children:t}=e,n=Pe(e,Ne);return R.createElement(Ie.Provider,{value:n},t)}export{Me as n,W as r,Le as t};
|
|
1
|
+
import{v as e,x as t}from"./index-Dfy2jMWq.js";import{Et as n,Ft as r,G as i,H as a,K as o,Lt as s,Mt as c,Nt as l,Pt as u,St as d,U as f,Ut as p,V as m,W as ee,kt as h,zt as g}from"./CartesianChart-aa0EJ6w3.js";var _=Math.cos,v=Math.sin,y=Math.sqrt,b=Math.PI;b/2;var x=2*b,S={draw(e,t){let n=y(t/b);e.moveTo(n,0),e.arc(0,0,n,0,x)}},C={draw(e,t){let n=y(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},w=y(1/3),T=w*2,E={draw(e,t){let n=y(t/T),r=n*w;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},D={draw(e,t){let n=y(t),r=-n/2;e.rect(r,r,n,n)}},O=.8908130915292852,k=v(b/10)/v(7*b/10),A=v(x/10)*k,j=-_(x/10)*k,M={draw(e,t){let n=y(t*O),r=A*n,i=j*n;e.moveTo(0,-n),e.lineTo(r,i);for(let t=1;t<5;++t){let a=x*t/5,o=_(a),s=v(a);e.lineTo(s*n,-o*n),e.lineTo(o*r-s*i,s*r+o*i)}e.closePath()}},N=y(3),P={draw(e,t){let n=-y(t/(N*3));e.moveTo(0,n*2),e.lineTo(-N*n,-n),e.lineTo(N*n,-n),e.closePath()}},F=-.5,I=y(3)/2,L=1/y(12),te=(L/2+1)*3,ne={draw(e,t){let n=y(t/te),r=n/2,i=n*L,a=r,o=n*L+n,s=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(s,c),e.lineTo(F*r-I*i,I*r+F*i),e.lineTo(F*a-I*o,I*a+F*o),e.lineTo(F*s-I*c,I*s+F*c),e.lineTo(F*r+I*i,F*i-I*r),e.lineTo(F*a+I*o,F*o-I*a),e.lineTo(F*s+I*c,F*c-I*s),e.closePath()}};function re(e,t){let n=null,i=u(a);e=typeof e==`function`?e:r(e||S),t=typeof t==`function`?t:r(t===void 0?64:+t);function a(){let r;if(n||=r=i(),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),r)return n=null,r+``||null}return a.type=function(t){return arguments.length?(e=typeof t==`function`?t:r(t),a):e},a.size=function(e){return arguments.length?(t=typeof e==`function`?e:r(+e),a):t},a.context=function(e){return arguments.length?(n=e??null,a):n},a}var R=t(e()),ie=[`type`,`size`,`sizeType`];function z(){return z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},z.apply(null,arguments)}function B(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function V(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?B(Object(n),!0).forEach(function(t){ae(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ae(e,t,n){return(t=oe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oe(e){var t=se(e,`string`);return typeof t==`symbol`?t:t+``}function se(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function ce(e,t){if(e==null)return{};var n,r,i=le(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function le(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var H={symbolCircle:S,symbolCross:C,symbolDiamond:E,symbolSquare:D,symbolStar:M,symbolTriangle:P,symbolWye:ne},ue=Math.PI/180,U=e=>H[`symbol${c(e)}`]||S,de=(e,t,n)=>{if(t===`area`)return e;switch(n){case`cross`:return 5*e*e/9;case`diamond`:return .5*e*e/Math.sqrt(3);case`square`:return e*e;case`star`:var r=18*ue;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2);case`triangle`:return Math.sqrt(3)*e*e/4;case`wye`:return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},fe=(e,t)=>{H[`symbol${c(e)}`]=t},W=e=>{var{type:t=`circle`,size:n=64,sizeType:r=`area`}=e,i=V(V({},ce(e,ie)),{},{type:t,size:n,sizeType:r}),a=`circle`;typeof t==`string`&&(a=t);var o=()=>{var e=U(a),t=re().type(e).size(de(n,r,a))();if(t!==null)return t},{className:s,cx:c,cy:l}=i,u=g(i);return h(c)&&h(l)&&h(n)?R.createElement(`path`,z({},u,{className:p(`recharts-symbols`,s),transform:`translate(${c}, ${l})`,d:o()})):null};W.registerSymbol=fe;function pe(e){if(typeof e!=`object`||!e)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!==`[object Object]`){let t=e[Symbol.toStringTag];return t==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${t}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}var me,he,ge,_e,ve;function G(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function K(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?G(Object(n),!0).forEach(function(t){ye(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):G(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ye(e,t,n){return(t=be(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function be(e){var t=xe(e,`string`);return typeof t==`symbol`?t:t+``}function xe(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function q(){return q=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},q.apply(null,arguments)}function J(e,t){return t||=e.slice(0),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Y=(e,t,n,r,i)=>{var a=n-r,o=l(me||=J([`M `,`,`,``]),e,t);return o+=l(he||=J([`L `,`,`,``]),e+n,t),o+=l(ge||=J([`L `,`,`,``]),e+n-a/2,t+i),o+=l(_e||=J([`L `,`,`,``]),e+n-a/2-r,t+i),o+=l(ve||=J([`L `,`,`,` Z`]),e,t),o},Se={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:`ease`},Ce=e=>{var t=d(e,Se),{x:r,y:a,upperWidth:o,lowerWidth:s,height:c,className:l}=t,{animationEasing:u,animationDuration:m,animationBegin:h,isUpdateAnimationActive:_}=t,v=(0,R.useRef)(null),[y,b]=(0,R.useState)(-1),x=(0,R.useRef)(o),S=(0,R.useRef)(s),C=(0,R.useRef)(c),w=(0,R.useRef)(r),T=(0,R.useRef)(a),E=f(e,`trapezoid-`);if((0,R.useEffect)(()=>{if(v.current&&v.current.getTotalLength)try{var e=v.current.getTotalLength();e&&b(e)}catch{}},[]),r!==+r||a!==+a||o!==+o||s!==+s||c!==+c||o===0&&s===0||c===0)return null;var D=p(`recharts-trapezoid`,l);if(!_)return R.createElement(`g`,null,R.createElement(`path`,q({},g(t),{className:D,d:Y(r,a,o,s,c)})));var O=x.current,k=S.current,A=C.current,j=w.current,M=T.current,N=`0px ${y===-1?1:y}px`,P=`${y}px ${y}px`,F=i([`strokeDasharray`],m,u);return R.createElement(ee,{animationId:E,key:E,canBegin:y>0,duration:m,easing:u,isActive:_,begin:h},e=>{var i=n(O,o,e),l=n(k,s,e),u=n(A,c,e),d=n(j,r,e),f=n(M,a,e);v.current&&(x.current=i,S.current=l,C.current=u,w.current=d,T.current=f);var p=e>0?{transition:F,strokeDasharray:P}:{strokeDasharray:N};return R.createElement(`path`,q({},g(t),{className:D,d:Y(d,f,i,l,u),ref:v,style:K(K({},p),t.style)}))})},we=[`option`,`shapeType`,`activeClassName`,`inActiveClassName`];function Te(e,t){if(e==null)return{};var n,r,i=Ee(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ee(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function X(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Z(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?X(Object(n),!0).forEach(function(t){De(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function De(e,t,n){return(t=Oe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Oe(e){var t=ke(e,`string`);return typeof t==`symbol`?t:t+``}function ke(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Q(e,t){return Z(Z({},t),e)}function Ae(e,t){return e===`symbols`}function $(e){var{shapeType:t,elementProps:n}=e;switch(t){case`rectangle`:return R.createElement(a,n);case`trapezoid`:return R.createElement(Ce,n);case`sector`:return R.createElement(m,n);case`symbols`:if(Ae(t,n))return R.createElement(W,n);break;case`curve`:return R.createElement(o,n);default:return null}}function je(e){return(0,R.isValidElement)(e)?e.props:e}function Me(e){var{option:t,shapeType:n,activeClassName:r=`recharts-active-shape`,inActiveClassName:i=`recharts-shape`}=e,a=Te(e,we),o;if((0,R.isValidElement)(t))o=(0,R.cloneElement)(t,Z(Z({},a),je(t)));else if(typeof t==`function`)o=t(a,a.index);else if(pe(t)&&typeof t!=`boolean`){var c=Q(t,a);o=R.createElement($,{shapeType:n,elementProps:c})}else{var l=a;o=R.createElement($,{shapeType:n,elementProps:l})}return a.isActive?R.createElement(s,{className:r},o):R.createElement(s,{className:i},o)}var Ne=[`children`];function Pe(e,t){if(e==null)return{};var n,r,i=Fe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Fe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Ie=(0,R.createContext)({data:[],xAxisId:`xAxis-0`,yAxisId:`yAxis-0`,dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0});function Le(e){var{children:t}=e,n=Pe(e,Ne);return R.createElement(Ie.Provider,{value:n},t)}export{Me as n,W as r,Le as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e,v as t,x as n}from"./index-
|
|
1
|
+
import{c as e,v as t,x as n}from"./index-Dfy2jMWq.js";import{t as r}from"./HelpTip-BfrAVfV_.js";var i=n(t(),1),a=e();function o(e,t,n){let r=JSON.parse(e);if(!r||r.project_id!==t||r.format!==n)throw Error(`资料不属于当前项目或类型不匹配,请选择对应的资料包。`);return r}function s({data:e,raw:t,onLoad:n,format:s,source:c,question:l,disabled:u=!1,onSourceSelected:d}){let[f,p]=(0,i.useState)(``),[m,h]=(0,i.useState)(``),[g,_]=(0,i.useState)(!1),[v,y]=(0,i.useState)(null),b=(0,i.useRef)(0),x=(0,i.useRef)(!0),S=(0,i.useRef)({raw:t,disabled:u,projectId:e.project.id});S.current={raw:t,disabled:u,projectId:e.project.id},(0,i.useEffect)(()=>(x.current=!0,()=>{x.current=!1,++b.current}),[]);async function C(r,i,a=``){if(u||t&&!window.confirm(`读取新资料会替换当前未保存草稿,是否继续?`))return;let c=t,l=e.project.id,f=++b.current;_(!0),h(``);try{let t=await i();if(o(t,e.project.id,s),!x.current||f!==b.current||S.current.projectId!==l)return;if(S.current.disabled||S.current.raw!==c){h(`读取期间草稿已变化或正在保存,未替换。请稍后重试。`);return}n(t),d?.(a),y({text:t,name:r}),h(`已填入当前草稿。请核对商品、日期和口径后再运行,尚未保存。`)}catch(e){x.current&&f===b.current&&h(e.message)}finally{x.current&&f===b.current&&_(!1)}}return(0,a.jsxs)(`div`,{className:`card`,children:[(0,a.jsxs)(`h3`,{children:[`先选资料,不用从空表开始`,(0,a.jsx)(r,{label:`如何准备资料`,children:`优先复用当前项目归档。读取时核对项目和资料类型;这不代表内容完整,最终仍需按原有规则校验。不会自动选择商品、日期、金额或启用监控。`})]}),(0,a.jsx)(`p`,{children:l}),(0,a.jsxs)(`p`,{className:`muted`,children:[`需要的来源:`,c,`。已有标准 JSON 资料可直接读取;Excel、截图和普通导出文件需先整理为对应资料包,不能直接当作标准资料导入。`]}),(0,a.jsxs)(`details`,{style:{margin:`12px 0`},children:[(0,a.jsx)(`summary`,{children:`只有 Excel、截图或普通导出?按这三步准备`}),(0,a.jsxs)(`ol`,{children:[(0,a.jsx)(`li`,{children:`保留原始文件,写清商品或店铺范围、统计起止日期、指标含义与单位。缺失值留空,不能当作零。`}),(0,a.jsx)(`li`,{children:`在“证据与附件”归档原件,或请助手按本页资料类型整理。这里只读取已整理资料,不会自动解析 Excel、识别截图或调用模型。`}),(0,a.jsx)(`li`,{children:`整理后核对原件行数、日期、金额/人数单位及来源,再从下方读取。读取只填草稿,之后仍需检查和保存。`})]}),(0,a.jsx)(`p`,{children:`给整理人员的要求:保留原文与来源;确认当前项目;不得补造缺失数据;使用本页对应的资料格式。结果必须通过本页的项目和类型校验。`}),(0,a.jsxs)(`details`,{children:[(0,a.jsx)(`summary`,{children:`整理人员需要的格式信息`}),(0,a.jsxs)(`p`,{children:[`资料格式:`,(0,a.jsx)(`code`,{children:s}),`;项目编号:`,(0,a.jsx)(`code`,{children:e.project.id}),`。详细必需字段以本页输入模板或业务校验为准,不能只填写这两个标识。`]})]})]}),(0,a.jsxs)(`label`,{children:[`已有资料在哪里?`,(0,a.jsxs)(`select`,{value:f,disabled:u||g,onChange:e=>p(e.target.value),children:[(0,a.jsx)(`option`,{value:``,children:`请选择本项目归档,不会自动替你选择`}),(e.files||[]).filter(e=>e.name.endsWith(`.json`)).map(e=>(0,a.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]}),(0,a.jsx)(`button`,{type:`button`,disabled:u||g||!f,onClick:()=>C(e.files.find(e=>e.id===f)?.name||f,async()=>{let t=await fetch(`/api/workbench/`+encodeURIComponent(e.project.id)+`/file/`+encodeURIComponent(f));if(!t.ok)throw Error(`读取失败,原草稿未改变`);return t.text()},f),children:`读取资料到草稿`}),(0,a.jsxs)(`label`,{children:[`或选择已整理的 JSON 文件`,(0,a.jsx)(`input`,{type:`file`,accept:`.json`,disabled:u||g,onChange:e=>{let t=e.target.files?.[0];t&&C(t.name,async()=>{if(t.size>3e5)throw Error(`资料包上限 300KB`);return t.text()}),e.target.value=``}})]}),(0,a.jsx)(`p`,{role:`status`,children:m}),(0,a.jsx)(`p`,{className:`muted`,children:t?v?.text===t?`当前草稿来源:${v?.name};项目与资料类型已匹配,内容完整性待运行校验。`:`当前草稿来自其他入口或已手动修改,请重新核对来源及缺项。`:`待补:先选择资料来源,再核对商品、周期和必需字段。`})]})}export{s as t};
|