@gientech/modual 1.0.4 → 1.0.5
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/chat.js +111 -111
- package/database.js +2 -2
- package/databaseId.js +6 -6
- package/databaseTable.js +4 -4
- package/gientechStreamFilesReader.js +2 -2
- package/modelManage.js +1 -1
- package/package.json +1 -21
- package/sensitive.js +1 -1
- package/streamFilesReader.js +33 -33
- package/assets/jsx-runtime-vC1aA8e7.js +0 -9
package/streamFilesReader.js
CHANGED
|
@@ -1,103 +1,103 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{jsxs as $,jsx as s,Fragment as gu}from"react/jsx-runtime";import Qu,{useState as k,useRef as q,useEffect as uu,useCallback as l}from"react";import{d as v}from"./assets/styled-components.browser.esm-BKnFpJ_S.js";import{a as au}from"./assets/index-NIGUFBhG.js";import{c as H}from"./assets/createLucideIcon-Bj5DlX2s.js";import{C as Vu}from"./assets/chevron-right-CrkLSPrQ.js";import{X as Nu}from"./assets/x-CdZQbi--.js";import{parseFile as hu,Fviewer as su}from"@mxmweb/fviewer";/**
|
|
2
2
|
* @license lucide-react v0.456.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const
|
|
6
|
+
*/const zu=H("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
7
7
|
* @license lucide-react v0.456.0 - ISC
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
10
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const
|
|
11
|
+
*/const Tu=H("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
12
12
|
* @license lucide-react v0.456.0 - ISC
|
|
13
13
|
*
|
|
14
14
|
* This source code is licensed under the ISC license.
|
|
15
15
|
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const
|
|
16
|
+
*/const uo=H("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"}]]);/**
|
|
17
17
|
* @license lucide-react v0.456.0 - ISC
|
|
18
18
|
*
|
|
19
19
|
* This source code is licensed under the ISC license.
|
|
20
20
|
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const
|
|
21
|
+
*/const oo=H("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
|
|
22
22
|
* @license lucide-react v0.456.0 - ISC
|
|
23
23
|
*
|
|
24
24
|
* This source code is licensed under the ISC license.
|
|
25
25
|
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/const
|
|
26
|
+
*/const eo=H("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
|
|
27
27
|
* @license lucide-react v0.456.0 - ISC
|
|
28
28
|
*
|
|
29
29
|
* This source code is licensed under the ISC license.
|
|
30
30
|
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
-
*/const
|
|
31
|
+
*/const to=H("ZoomIn",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);/**
|
|
32
32
|
* @license lucide-react v0.456.0 - ISC
|
|
33
33
|
*
|
|
34
34
|
* This source code is licensed under the ISC license.
|
|
35
35
|
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/const
|
|
36
|
+
*/const no=H("ZoomOut",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),ro=v.div`
|
|
37
37
|
display: flex;
|
|
38
38
|
align-items: center;
|
|
39
39
|
padding: 0px 12px;
|
|
40
40
|
justify-content: space-between;
|
|
41
|
-
padding: ${
|
|
42
|
-
border-bottom: 1px solid ${
|
|
43
|
-
background: ${
|
|
41
|
+
padding: ${n=>n.$theme.space.padding};
|
|
42
|
+
border-bottom: 1px solid ${n=>n.$theme.colors.border};
|
|
43
|
+
background: ${n=>n.$theme.colors.background};
|
|
44
44
|
min-height: 52px;
|
|
45
|
-
`,
|
|
45
|
+
`,ao=v.div`
|
|
46
46
|
display: flex;
|
|
47
47
|
align-items: center;
|
|
48
48
|
gap: 8px;
|
|
49
49
|
flex: 1;
|
|
50
50
|
min-width: 0;
|
|
51
|
-
`,
|
|
51
|
+
`,so=v.div`
|
|
52
52
|
font-size: 14px;
|
|
53
53
|
font-weight: 500;
|
|
54
|
-
color: ${
|
|
54
|
+
color: ${n=>n.$theme.colors.text};
|
|
55
55
|
white-space: nowrap;
|
|
56
56
|
overflow: hidden;
|
|
57
57
|
text-overflow: ellipsis;
|
|
58
|
-
`,
|
|
58
|
+
`,co=v.div`
|
|
59
59
|
font-size: 12px;
|
|
60
|
-
color: ${
|
|
60
|
+
color: ${n=>n.$theme.colors.disabledText};
|
|
61
61
|
white-space: nowrap;
|
|
62
|
-
`,
|
|
62
|
+
`,lo=v.div`
|
|
63
63
|
display: flex;
|
|
64
64
|
align-items: center;
|
|
65
65
|
gap: 4px;
|
|
66
|
-
`,
|
|
66
|
+
`,I=v.button`
|
|
67
67
|
display: flex;
|
|
68
68
|
align-items: center;
|
|
69
69
|
justify-content: center;
|
|
70
70
|
width: 32px;
|
|
71
71
|
height: 32px;
|
|
72
72
|
border: none;
|
|
73
|
-
border-radius: ${
|
|
74
|
-
background: ${
|
|
75
|
-
color: ${
|
|
73
|
+
border-radius: ${n=>n.$theme.space.radius};
|
|
74
|
+
background: ${n=>n.$active?n.$theme.colors.primary+"20":"transparent"};
|
|
75
|
+
color: ${n=>n.$active?n.$theme.colors.primary:n.$theme.colors.text};
|
|
76
76
|
cursor: pointer;
|
|
77
77
|
transition: all 0.2s ease;
|
|
78
78
|
|
|
79
79
|
&:hover {
|
|
80
|
-
background: ${
|
|
81
|
-
color: ${
|
|
80
|
+
background: ${n=>n.$theme.colors.primary+"10"};
|
|
81
|
+
color: ${n=>n.$theme.colors.primary};
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
&:disabled {
|
|
85
85
|
opacity: 0.5;
|
|
86
86
|
cursor: not-allowed;
|
|
87
87
|
}
|
|
88
|
-
`,
|
|
88
|
+
`,io=v.div`
|
|
89
89
|
font-size: 12px;
|
|
90
|
-
color: ${
|
|
90
|
+
color: ${n=>n.$theme.colors.disabledText};
|
|
91
91
|
min-width: 40px;
|
|
92
92
|
text-align: center;
|
|
93
|
-
`,
|
|
93
|
+
`,Fo={colors:{primary:"#007bff",secondary:"#6c757d",success:"#008000",warning:"#FFA500",error:"#FF0000",info:"#0000FF",background:"#f8f9fa",text:"#343a40",border:"#dee2e6",disabled:"#808080",disabledBackground:"#F5F5F5",disabledText:"#808080"},space:{sidebar:"md",size:"md",radius:"md",padding:"md",margin:"md",shadow:"md",lineHeight:"md"}},Ou=Qu.memo(({fileName:n="\u672A\u77E5\u6587\u4EF6",currentPage:d=1,totalPage:e=0,tools:B={annotation:!0,download:!0,zoom:!0,close:!0,navigation:!0,rotate:!0},styles:_,onPrevPage:g,onNextPage:G,onZoomIn:h,onZoomOut:cu,onAnnotationToggle:b,onDownload:F,onRotateLeft:c,onRotateRight:V,onClose:x,scale:f=1,isAnnotating:U=!1,className:ou})=>{const i=(_==null?void 0:_.theme)||Fo;return console.log("Header\u7EC4\u4EF6\u6E32\u67D3 - currentPage:",d,"totalPage:",e),$(ro,{$theme:i,className:ou,children:[s(ao,{$theme:i,children:s(so,{$theme:i,children:n})}),$(lo,{$theme:i,children:[B.navigation&&$(gu,{children:[s(I,{$theme:i,onClick:g,disabled:d<=1,title:"\u4E0A\u4E00\u9875",children:s(zu,{size:16})}),e>0&&$(co,{$theme:i,children:[d," / ",e]}),s(I,{$theme:i,onClick:G,disabled:!e||d>=e,title:"\u4E0B\u4E00\u9875",children:s(Vu,{size:16})})]}),B.zoom&&$(gu,{children:[s(I,{$theme:i,onClick:cu,disabled:f<=.3,title:"\u7F29\u5C0F",children:s(no,{size:16})}),$(io,{$theme:i,children:[Math.round(f*100),"%"]}),s(I,{$theme:i,onClick:h,disabled:f>=3,title:"\u653E\u5927",children:s(to,{size:16})})]}),B.annotation&&s(I,{$theme:i,$active:U,onClick:b,title:U?"\u9000\u51FA\u6807\u6CE8":"\u5F00\u59CB\u6807\u6CE8",children:s(uo,{size:16})}),B.download&&s(I,{$theme:i,onClick:F,title:"\u4E0B\u8F7D",children:s(Tu,{size:16})}),B.rotate&&$(gu,{children:[s(I,{$theme:i,onClick:c,title:"\u5411\u5DE6\u65CB\u8F6C",children:s(oo,{size:16})}),s(I,{$theme:i,onClick:V,title:"\u5411\u53F3\u65CB\u8F6C",children:s(eo,{size:16})})]}),B.close&&s(I,{$theme:i,onClick:x,title:"\u5173\u95ED",children:s(Nu,{size:16})})]})]})}),fu=v.div`
|
|
94
94
|
display: flex;
|
|
95
95
|
flex-direction: column;
|
|
96
96
|
height: 100%;
|
|
97
97
|
width: 100%;
|
|
98
|
-
background: ${
|
|
99
|
-
border: 1px solid ${
|
|
100
|
-
border-radius: ${
|
|
98
|
+
background: ${n=>n.$theme.colors.background};
|
|
99
|
+
border: 1px solid ${n=>n.$theme.colors.border};
|
|
100
|
+
border-radius: ${n=>n.$theme.space.radius};
|
|
101
101
|
overflow: hidden;
|
|
102
102
|
min-height: 0;
|
|
103
103
|
position: relative; // 添加相对定位,用于loading遮罩的绝对定位
|
|
@@ -107,7 +107,7 @@ import{j as t}from"./assets/jsx-runtime-vC1aA8e7.js";import Yu,{useState as w,us
|
|
|
107
107
|
0% { transform: rotate(0deg); }
|
|
108
108
|
100% { transform: rotate(360deg); }
|
|
109
109
|
}
|
|
110
|
-
`,
|
|
110
|
+
`,Do=({status:n,theme:d})=>$("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",padding:"40px",background:d.colors.background},children:[$("div",{style:{position:"relative",width:"80px",height:"80px",marginBottom:"24px"},children:[s("div",{style:{width:"60px",height:"80px",background:d.colors.primary,borderRadius:"8px 8px 0 0",position:"relative",margin:"0 auto"},children:s("div",{style:{position:"absolute",top:"0",right:"0",width:"0",height:"0",borderStyle:"solid",borderWidth:"0 20px 20px 0",borderColor:`transparent ${d.colors.background} transparent transparent`}})}),s("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"20px",height:"20px",borderRadius:"50%",background:d.colors.background,animation:"pulse 1.5s ease-in-out infinite"}})]}),s("div",{style:{fontSize:"16px",fontWeight:"500",color:d.colors.text,marginBottom:"8px",textAlign:"center"},children:n}),s("div",{style:{width:"200px",height:"4px",background:d.colors.border,borderRadius:"2px",overflow:"hidden",position:"relative"},children:s("div",{style:{width:"30%",height:"100%",background:d.colors.primary,borderRadius:"2px",animation:"loading-progress 2s ease-in-out infinite"}})}),s("style",{children:`
|
|
111
111
|
@keyframes pulse {
|
|
112
112
|
0%, 100% {
|
|
113
113
|
opacity: 1;
|
|
@@ -130,13 +130,13 @@ import{j as t}from"./assets/jsx-runtime-vC1aA8e7.js";import Yu,{useState as w,us
|
|
|
130
130
|
transform: translateX(100%);
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
|
-
`})]}),
|
|
133
|
+
`})]}),go=v.div`
|
|
134
134
|
display: flex;
|
|
135
135
|
flex-direction: column;
|
|
136
136
|
align-items: center;
|
|
137
137
|
justify-content: center;
|
|
138
138
|
height: 100%;
|
|
139
|
-
color: ${
|
|
139
|
+
color: ${n=>n.$theme.colors.error};
|
|
140
140
|
text-align: center;
|
|
141
141
|
padding: 20px;
|
|
142
|
-
`,Do="http://10.15.12.13:9005/proxy/index/knowledgeBase/file/stream",p=300*1e3,go={colors:{primary:"#007bff",secondary:"#6c757d",success:"#008000",warning:"#FFA500",error:"#FF0000",info:"#0000FF",background:"#f8f9fa",text:"#343a40",border:"#dee2e6",disabled:"#808080",disabledBackground:"#F5F5F5",disabledText:"#808080"},space:{sidebar:"md",size:"md",radius:"md",padding:"md",margin:"md",shadow:"md",lineHeight:"md"}},po=({convertedFilePath:r,fileName:d,fileType:e,csrfToken:B,initialPage:R=1,totalPages:g,annotations:H=[],pageSize:h=5,initialZoom:au=100,streamApiUrl:j=Do,authorization:F,eventsEmit:c=()=>{},tools:Q,styles:$,customComponents:m,className:G,headerClass:uu,contentClass:i})=>{const[cu,f]=w(!0),[hu,C]=w("\u6B63\u5728\u52A0\u8F7D\u6587\u6863..."),[lu,I]=w(null),[v,L]=w(R),[x,U]=w(g||0),[A,Iu]=w(au/100),[V,du]=w(0),[vu,mu]=w(null),[Ou,fu]=w(null),[W,Cu]=w(""),[Lu,iu]=w(null),[Mu,Bu]=w(null),[xu,Fu]=w({}),N=Z(!1),ou=Z(!1),Y=Z({}),b=Z({}),J=Z(null),Su=Z(null),M=Z(R),S=($==null?void 0:$.theme)||go;T(()=>{N.current=!1,ou.current=!1},[e,r]);const K=l(()=>{const u={annotation:!0,download:!0,zoom:!0,close:!0,navigation:!0,rotate:!1};let o;switch(e){case"pdf":case"pdf_slides":o={...u,annotation:!1,download:!1,navigation:!0,rotate:!1};break;case"image":o={...u,annotation:!1,download:!1,navigation:!1,rotate:!0,zoom:!0};break;case"markdown":case"markdown_table":o={...u,annotation:!1,download:!1,navigation:!1,rotate:!1,zoom:!1};break;case"text":case"html":case"unknown":o={...u,annotation:!1,download:!1,navigation:!1,rotate:!1,zoom:!1};break;default:o=u}return Q?{...o,...Q}:o},[e,Q])(),O=l((u,o)=>{const s=Math.floor((u-1)/o)*o+1;return`${s}-${s+o-1}`},[]),Eu=l(async u=>{var k;if(!(e==="pdf"||e==="pdf_slides"))return console.log(`\u6587\u4EF6\u7C7B\u578B ${e} \u4E0D\u662FPDF\uFF0C\u8DF3\u8FC7\u7F13\u5B58\u68C0\u67E5`),null;console.log(`\u68C0\u67E5\u9875\u9762 ${u} \u662F\u5426\u5728\u7F13\u5B58\u4E2D`);const s=Y.current[u];if(s&&Date.now()-s.timestamp<p)return console.log(`\u4F7F\u7528\u5355\u4E2A\u9875\u9762\u7F13\u5B58: ${u}`),s.pdfDocument?(console.log(`\u76F4\u63A5\u8FD4\u56DE\u7F13\u5B58\u7684PDF\u6587\u6863: ${u}`),s.pdfDocument):null;const n=O(u,h),a=b.current[n];if(console.log(`\u68C0\u67E5chunk\u7F13\u5B58: ${n}, \u5B58\u5728: ${!!a}, \u5305\u542B\u9875\u9762: ${((k=a==null?void 0:a.pages)==null?void 0:k.join(", "))||"\u65E0"}`),a&&Date.now()-a.timestamp<p){if(a.pages.includes(u))return console.log(`\u4F7F\u7528chunk\u7F13\u5B58: ${u} (chunk: ${n})`),a.pdfDocument?(console.log(`\u76F4\u63A5\u8FD4\u56DE\u7F13\u5B58\u7684PDF\u6587\u6863: ${u}`),a.pdfDocument):null;console.log(`\u9875\u9762 ${u} \u4E0D\u5728chunk ${n} \u4E2D\uFF0Cchunk\u5305\u542B: ${a.pages.join(", ")}`)}return console.log(`\u9875\u9762 ${u} \u4E0D\u5728\u4EFB\u4F55\u7F13\u5B58\u4E2D\uFF0C\u9700\u8981\u91CD\u65B0\u8BF7\u6C42`),null},[h,O,e]),wu=l(async u=>{var o;try{if(!(e==="pdf"||e==="pdf_slides"))throw console.log(`\u6587\u4EF6\u7C7B\u578B ${e} \u4E0D\u9700\u8981\u5206\u9875\u53C2\u6570\uFF0C\u83B7\u53D6\u5B8C\u6574\u5185\u5BB9`),new Error(`\u6587\u4EF6\u7C7B\u578B ${e} \u4E0D\u652F\u6301\u5206\u9875\u52A0\u8F7D`);const n=Math.floor((u-1)/h)*h+1,a=O(u,h);console.log(`\u8BF7\u6C42PDF chunk\u6570\u636E: ${n} (\u5305\u542B\u9875\u9762 ${n}-${n+h-1})`);const k={"Content-Type":"application/json"};F&&(k.Authorization=F),B&&(k["X-CSRF-TOKEN-IN"]=B);const E={convertedFilePath:r,pageNo:n,pageSize:h},D=await ru.post(j,E,{headers:k,responseType:"arraybuffer"}),X=D.headers["x-csrf-token-out"]||D.headers["X-CSRF-TOKEN-OUT"];X&&(console.log("\u83B7\u53D6\u5230\u54CD\u5E94\u5934\u4E2D\u7684CSRF Token:",X),c("request_finish",X));const z=Array.from({length:h},(mo,Wu)=>n+Wu);return b.current[a]={data:D.data,pages:z,timestamp:Date.now(),totalPages:g},console.log(`\u7F13\u5B58PDF chunk\u6570\u636E: ${a}, \u5305\u542B\u9875\u9762: ${z.join(", ")}, \u8BF7\u6C42\u7684\u9875\u9762: ${u}`),console.log("\u5F53\u524D\u6240\u6709\u7F13\u5B58:",Object.keys(b.current)),D.data}catch(s){throw console.error("\u83B7\u53D6PDF stream\u6570\u636E\u5931\u8D25:",s),new Error(`PDF\u8BF7\u6C42\u5931\u8D25: ${((o=s.response)==null?void 0:o.status)||"\u7F51\u7EDC\u9519\u8BEF"}`)}},[j,r,h,F,O,g,x,e,c]),eu=l(async(u,o=!1)=>{var n;if(!u)return;if(!(e==="pdf"||e==="pdf_slides"))return console.log(`\u6587\u4EF6\u7C7B\u578B ${e} \u4E0D\u662FPDF\uFF0C\u8DF3\u8FC7PDF\u52A0\u8F7D\u903B\u8F91`),null;try{o?(f(!0),C("\u6B63\u5728\u52A0\u8F7DPDF\u6587\u6863...")):(f(!0),C(`\u6B63\u5728\u52A0\u8F7D\u7B2C ${u} \u9875...`)),I(null),console.log(`\u5F00\u59CB\u52A0\u8F7DPDF\u9875\u9762: ${u}, \u521D\u59CB\u52A0\u8F7D: ${o}`);const a=await Eu(u);if(a)return console.log(`\u4F7F\u7528\u7F13\u5B58\u7684PDF\u6587\u6863: ${u}`),mu(a),f(!1),C(""),console.log(`\u9875\u9762 ${u} \u52A0\u8F7D\u5B8C\u6210\uFF08\u4F7F\u7528\u7F13\u5B58\uFF09`),a;const k=await wu(u),E=await Du(k,{fileName:d||"Stream\u6587\u6863",fileType:"pdf",token:F});if(E.error)throw new Error(E.error);if(E.type!=="pdf"||!((n=E.content)!=null&&n.document))throw new Error("\u89E3\u6790\u7ED3\u679C\u4E0D\u662F\u6709\u6548\u7684PDF\u6587\u6863");const D=E.content.document;console.log("\u8BBE\u7F6EPDF\u6587\u6863:",D),console.log("PDF\u6587\u6863\u7C7B\u578B:",typeof D),console.log("PDF\u6587\u6863\u65B9\u6CD5:",D?Object.getOwnPropertyNames(Object.getPrototypeOf(D)):"\u65E0\u6587\u6863"),console.log("PDF\u6587\u6863\u9875\u6570:",D?D.numPages:"\u65E0\u9875\u6570"),console.log("\u5F53\u524D\u8BF7\u6C42\u7684\u9875\u9762:",u),console.log("PDF\u6587\u6863\u5305\u542B\u7684\u9875\u9762\u8303\u56F4:",D?`1-${D.numPages}`:"\u65E0\u9875\u6570"),mu(D);const X=O(u,h);if(b.current[X]&&(b.current[X].pdfDocument=D,console.log(`\u7F13\u5B58PDF\u6587\u6863\u5230chunk: ${X}`)),g)console.log(`\u4F7F\u7528\u7528\u6237\u4F20\u5165\u7684\u603B\u9875\u6570: ${g}`),U(g);else if(D&&D.numPages){const z=D.numPages;console.log(`\u7528\u6237\u672A\u4F20\u5165\u603B\u9875\u6570\uFF0C\u4ECEPDF\u6587\u6863\u83B7\u53D6\u5B9E\u9645\u603B\u9875\u6570: ${z}`),U(z)}return f(!1),C(""),console.log(`\u9875\u9762 ${u} \u52A0\u8F7D\u5B8C\u6210`),D}catch(a){throw console.error("PDF\u52A0\u8F7D\u5931\u8D25:",a),I(a.message||"PDF\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"),f(!1),C(""),a}},[wu,d,F,x,Eu,O,h,e]),ku=l(u=>{if(!(e==="pdf"||e==="pdf_slides"))return!1;const s=Y.current[u];if(s&&Date.now()-s.timestamp<p)return!!s.pdfDocument;const n=O(u,h),a=b.current[n];return a&&Date.now()-a.timestamp<p?a.pages.includes(u)&&!!a.pdfDocument:!1},[h,O,e]),$u=l(()=>{console.log("\u68C0\u67E5markdown\u5185\u5BB9\u662F\u5426\u5728\u7F13\u5B58\u4E2D");const u=J.current;return u&&Date.now()-u.timestamp<p?(console.log("\u4F7F\u7528markdown\u5185\u5BB9\u7F13\u5B58"),u.data):(console.log("markdown\u5185\u5BB9\u4E0D\u5728\u7F13\u5B58\u4E2D\uFF0C\u9700\u8981\u91CD\u65B0\u8BF7\u6C42"),null)},[]),pu=l(async()=>{var u;try{console.log("\u8BF7\u6C42\u5B8C\u6574markdown\u6570\u636E");const o={"Content-Type":"application/json"};F&&(o.Authorization=F),B&&(o["X-CSRF-TOKEN-IN"]=B);const s={convertedFilePath:r};console.log("\u53D1\u9001markdown\u8BF7\u6C42:",s);const n=await ru.post(j,s,{headers:o,responseType:"text"}),a=n.headers["x-csrf-token-out"]||n.headers["X-CSRF-TOKEN-OUT"];return a&&(console.log("\u83B7\u53D6\u5230\u54CD\u5E94\u5934\u4E2D\u7684CSRF Token:",a),c("request_finish",a)),console.log("markdown\u54CD\u5E94\u72B6\u6001:",n.status),console.log("markdown\u54CD\u5E94\u6570\u636E\u957F\u5EA6:",((u=n.data)==null?void 0:u.length)||0),n.data}catch(o){throw console.error("\u83B7\u53D6markdown\u6570\u636E\u5931\u8D25:",o),new Error(`\u83B7\u53D6markdown\u6570\u636E\u5931\u8D25: ${o.message}`)}},[r,F,j,c]),ju=l(async()=>{try{f(!0),C("\u6B63\u5728\u52A0\u8F7Dmarkdown\u6587\u6863..."),I(null),console.log("\u5F00\u59CB\u52A0\u8F7D\u5B8C\u6574markdown\u6587\u6863");const u=$u();if(u)return console.log("\u4F7F\u7528\u7F13\u5B58\u7684markdown\u5185\u5BB9"),Cu(u),f(!1),C(""),u;const o=await pu();return J.current={data:o,timestamp:Date.now()},Cu(o),f(!1),C(""),console.log("\u5B8C\u6574markdown\u6587\u6863\u52A0\u8F7D\u5B8C\u6210"),o}catch(u){throw console.error("markdown\u52A0\u8F7D\u5931\u8D25:",u),I(u.message||"markdown\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"),f(!1),C(""),u}},[pu,$u]),Au=l(async()=>{try{const u={"Content-Type":"application/json"};F&&(u.Authorization=F),B&&(u["X-CSRF-TOKEN-IN"]=B);const o={convertedFilePath:r},s=await ru.post(j,o,{headers:u,responseType:"arraybuffer"}),n=s.headers["x-csrf-token-out"]||s.headers["X-CSRF-TOKEN-OUT"];return n&&(console.log("\u83B7\u53D6\u5230\u54CD\u5E94\u5934\u4E2D\u7684CSRF Token:",n),c("request_finish",n)),s.data}catch(u){throw console.error("\u83B7\u53D6\u56FE\u7247\u6570\u636E\u5931\u8D25:",u),new Error(`\u83B7\u53D6\u56FE\u7247\u6570\u636E\u5931\u8D25: ${u.message}`)}},[r,F,j,c]),bu=l(async()=>{try{f(!0),C("\u6B63\u5728\u52A0\u8F7D\u56FE\u7247..."),I(null);const u=await Au(),o=await Du(u,{fileName:d||"\u56FE\u7247",fileType:"image",token:F});if(o.error)throw new Error(o.error);if(o.type!=="image"||!o.content)throw new Error("\u89E3\u6790\u7ED3\u679C\u4E0D\u662F\u6709\u6548\u7684\u56FE\u7247");return fu(o.content),f(!1),C(""),o.content}catch(u){throw console.error("\u56FE\u7247\u52A0\u8F7D\u5931\u8D25:",u),I(u.message||"\u56FE\u7247\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"),f(!1),C(""),u}},[F,d,Au]),Pu=l(async()=>{var u;try{console.log(`\u8BF7\u6C42\u901A\u7528\u6587\u4EF6\u6570\u636E\uFF0C\u6587\u4EF6\u7C7B\u578B: ${e}`);const o={"Content-Type":"application/json"};F&&(o.Authorization=F),B&&(o["X-CSRF-TOKEN-IN"]=B);const s={convertedFilePath:r};console.log("\u53D1\u9001\u901A\u7528\u6587\u4EF6\u8BF7\u6C42:",s);const n=await ru.post(j,s,{headers:o,responseType:"arraybuffer"}),a=n.headers["x-csrf-token-out"]||n.headers["X-CSRF-TOKEN-OUT"];return a&&(console.log("\u83B7\u53D6\u5230\u54CD\u5E94\u5934\u4E2D\u7684CSRF Token:",a),c("request_finish",a)),console.log("\u901A\u7528\u6587\u4EF6\u54CD\u5E94\u72B6\u6001:",n.status),console.log("\u901A\u7528\u6587\u4EF6\u54CD\u5E94\u6570\u636E\u957F\u5EA6:",((u=n.data)==null?void 0:u.byteLength)||0),n.data}catch(o){throw console.error("\u83B7\u53D6\u901A\u7528\u6587\u4EF6\u6570\u636E\u5931\u8D25:",o),new Error(`\u83B7\u53D6\u901A\u7528\u6587\u4EF6\u6570\u636E\u5931\u8D25: ${o.message}`)}},[r,F,j,c]),Ku=l(async()=>{try{if(console.log("=== loadGenericDocument \u88AB\u8C03\u7528 ==="),console.log("\u8C03\u7528\u6808:",new Error().stack),console.log("\u5F53\u524D\u65F6\u95F4:",new Date().toISOString()),N.current){console.log(`\u901A\u7528\u6587\u6863\u6B63\u5728\u52A0\u8F7D\u4E2D\uFF0C\u5FFD\u7565\u91CD\u590D\u8BF7\u6C42\uFF0C\u6587\u4EF6\u7C7B\u578B: ${e}`);return}if(ou.current){console.log(`\u901A\u7528\u6587\u6863\u5DF2\u7ECF\u52A0\u8F7D\u8FC7\uFF0C\u5FFD\u7565\u91CD\u590D\u8BF7\u6C42\uFF0C\u6587\u4EF6\u7C7B\u578B: ${e}`);return}const u=`${e}_${r}`,o=xu[u];if(console.log(`\u68C0\u67E5\u901A\u7528\u6587\u6863\u7F13\u5B58\uFF0Ckey: ${u}, \u7F13\u5B58\u5B58\u5728: ${!!o}, \u7F13\u5B58\u65F6\u95F4: ${o?Date.now()-o.timestamp:"N/A"}ms`),o&&Date.now()-o.timestamp<p)return console.log(`\u4F7F\u7528\u7F13\u5B58\u7684\u901A\u7528\u6587\u6863\u5185\u5BB9\uFF0C\u6587\u4EF6\u7C7B\u578B: ${e}`),e==="text"&&o.content?iu(o.content):e==="html"&&o.content&&Bu(o.content),L(1),U(g||1),f(!1),C(""),o.content;N.current=!0,f(!0),C(`\u6B63\u5728\u52A0\u8F7D${e}\u6587\u6863...`),I(null),console.log(`\u5F00\u59CB\u52A0\u8F7D\u901A\u7528\u6587\u6863\uFF0C\u6587\u4EF6\u7C7B\u578B: ${e}`);const s=await Pu(),n=await Du(s,{fileName:d||`${e}\u6587\u6863`,fileType:e,token:F});if(n.error)throw new Error(n.error);let a=null;if(n.type==="text"&&n.content)iu(n.content),a=n.content;else if(n.type==="html"&&n.content)Bu(n.content),a=n.content;else if(n.type==="image"&&n.content)fu(n.content),a=n.content;else{const E=new TextDecoder("utf-8").decode(s);iu({type:"text",content:E}),a={type:"text",content:E}}if(a){const k=`${e}_${r}`,E={...xu,[k]:{content:a,timestamp:Date.now()}};Fu(E),console.log(`\u901A\u7528\u6587\u6863\u5185\u5BB9\u5DF2\u7F13\u5B58\uFF0C\u6587\u4EF6\u7C7B\u578B: ${e}, \u7F13\u5B58\u952E: ${k}`),console.log("\u5F53\u524D\u7F13\u5B58\u72B6\u6001:",E)}return f(!1),C(""),N.current=!1,ou.current=!0,console.log(`\u901A\u7528\u6587\u6863\u52A0\u8F7D\u5B8C\u6210\uFF0C\u6587\u4EF6\u7C7B\u578B: ${e}`),n}catch(u){throw console.error("\u901A\u7528\u6587\u6863\u52A0\u8F7D\u5931\u8D25:",u),I(u.message||"\u901A\u7528\u6587\u6863\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"),f(!1),C(""),N.current=!1,ou.current=!0,u}},[Pu,d,F]),tu=l(async u=>{if(u===M.current)return;if(cu){console.log("\u9875\u9762\u6B63\u5728\u52A0\u8F7D\u4E2D\uFF0C\u5FFD\u7565\u7FFB\u9875\u8BF7\u6C42");return}if(!(e==="pdf"||e==="pdf_slides")){console.log(`\u6587\u4EF6\u7C7B\u578B ${e} \u4E0D\u652F\u6301\u7FFB\u9875\uFF0C\u5FFD\u7565\u7FFB\u9875\u8BF7\u6C42`);return}console.log("PDF\u9875\u9762\u53D8\u5316:",u,"\u5F53\u524D\u9875:",M.current),console.log(`\u9875\u9762 ${u} \u662F\u5426\u5728\u7F13\u5B58\u4E2D:`,ku(u)),M.current=u,L(u);try{await eu(u,!1),c("pageChange",{pageNumber:u,totalPages:g||x})}catch(s){console.error("PDF\u9875\u9762\u52A0\u8F7D\u5931\u8D25:",s);const n=M.current;L(n)}},[eu,x,c,ku,cu,e]);T(()=>{M.current=v,console.log("\u5F53\u524D\u9875\u72B6\u6001\u66F4\u65B0:",v)},[v]);const nu=l(u=>{Iu(u),c("zoomChange",{scale:u})},[c]),Ru=l(()=>{c("viewer:close")},[c]),Xu=l(()=>{const u=Math.min(3,A+.1);nu(u)},[A,nu]),Zu=l(()=>{const u=Math.max(.3,A-.1);nu(u)},[A,nu]),qu=l(()=>{const u=(V-90+360)%360;du(u),c("rotateChange",{rotation:u})},[V,c]),Hu=l(()=>{const u=(V+90)%360;du(u),c("rotateChange",{rotation:u})},[V,c]),Gu=l(()=>{if(!(e==="pdf"||e==="pdf_slides")){console.log(`\u6587\u4EF6\u7C7B\u578B ${e} \u4E0D\u652F\u6301\u7FFB\u9875\uFF0C\u5FFD\u7565\u7FFB\u9875\u8BF7\u6C42`);return}const o=M.current-1;o>=1&&tu(o)},[tu,e]),Uu=l(()=>{if(!(e==="pdf"||e==="pdf_slides")){console.log(`\u6587\u4EF6\u7C7B\u578B ${e} \u4E0D\u652F\u6301\u7FFB\u9875\uFF0C\u5FFD\u7565\u7FFB\u9875\u8BF7\u6C42`);return}const o=M.current+1,s=g||x;s&&o<=s&&tu(o)},[x,tu,e]),yu=l(()=>{const u=Date.now();Object.keys(Y.current).forEach(o=>{const s=Y.current[parseInt(o)];u-s.timestamp>p&&(delete Y.current[parseInt(o)],console.log(`\u6E05\u7406\u8FC7\u671F\u9875\u9762\u7F13\u5B58: ${o}`))}),Object.keys(b.current).forEach(o=>{const s=b.current[o];u-s.timestamp>p&&(delete b.current[o],console.log(`\u6E05\u7406\u8FC7\u671Fchunk\u7F13\u5B58: ${o}`))}),J.current&&u-J.current.timestamp>p&&(J.current=null,console.log("\u6E05\u7406\u8FC7\u671Fmarkdown\u5185\u5BB9\u7F13\u5B58")),Fu(o=>{const s={...o};return Object.keys(s).forEach(n=>{u-s[n].timestamp>p&&(delete s[n],console.log(`\u6E05\u7406\u8FC7\u671F\u901A\u7528\u6587\u4EF6\u7F13\u5B58: ${n}`))}),s})},[]),P=l(()=>{if(d)return d;try{const u=new URL(r);return decodeURIComponent(u.pathname.split("/").pop()||"")||"Stream\u6587\u6863"}catch{const u=r.split("/");return decodeURIComponent(u[u.length-1])||"Stream\u6587\u6863"}},[r,d]);return T(()=>{const u=setInterval(yu,p);return()=>clearInterval(u)},[yu]),T(()=>()=>{Y.current={},b.current={},J.current=null,Fu({}),console.log("\u7EC4\u4EF6\u5378\u8F7D\uFF0C\u6E05\u7406\u6240\u6709\u7F13\u5B58")},[]),T(()=>{console.log("=== useEffect \u88AB\u89E6\u53D1 ==="),console.log("\u89E6\u53D1\u65F6\u95F4:",new Date().toISOString()),console.log("\u89E6\u53D1\u539F\u56E0:",{initialPage:R,fileType:e}),(async()=>{try{const o=e==="pdf"||e==="pdf_slides",s=o&&R||1;console.log("\u5F00\u59CB\u521D\u59CB\u52A0\u8F7D\uFF0C\u6587\u4EF6\u7C7B\u578B:",e,"\u6709\u6548\u9875\u7801:",s,"\u662F\u5426PDF:",o),e==="markdown"||e==="markdown_table"?(await ju(),L(1),U(g||1),c("pageChange",{pageNumber:1,totalPages:g||1})):e==="image"?(await bu(),L(1),U(g||1),du(0),c("pageChange",{pageNumber:1,totalPages:g||1})):o?(await eu(s,!0),L(s),setTimeout(()=>{c("pageChange",{pageNumber:s,totalPages:g||x})},0)):(console.log("=== \u521D\u59CB\u52A0\u8F7D\uFF1A\u4F7F\u7528\u901A\u7528\u52A0\u8F7D\u51FD\u6570\u5904\u7406\u6587\u4EF6\u7C7B\u578B ===",e),await Ku(),L(1),U(g||1),c("pageChange",{pageNumber:1,totalPages:g||1}))}catch(o){console.error("\u521D\u59CB\u52A0\u8F7D\u5931\u8D25:",o)}})()},[R,e,eu,ju,bu,c]),lu?t.jsx(gu,{$theme:S,className:G,children:m!=null&&m.ErrorComponent?t.jsx(m.ErrorComponent,{error:lu,theme:S}):t.jsxs(Fo,{$theme:S,children:[t.jsx("div",{children:"\u52A0\u8F7D\u5931\u8D25"}),t.jsx("div",{style:{fontSize:"12px",marginTop:"8px"},children:lu})]})}):cu?t.jsxs(gu,{$theme:S,className:G,children:[t.jsx(_u,{fileName:P(),currentPage:v,totalPage:x,scale:A,isAnnotating:!1,tools:K,styles:$,onPrevPage:()=>{},onNextPage:()=>{},onZoomIn:()=>{},onZoomOut:()=>{},onAnnotationToggle:()=>{},onDownload:()=>{},onClose:Ru,className:uu}),m!=null&&m.LoadingComponent?t.jsx(m.LoadingComponent,{status:hu,theme:S}):t.jsx(io,{status:hu,theme:S})]}):t.jsxs(gu,{$theme:S,className:G,children:[t.jsx(_u,{fileName:P(),currentPage:v,totalPage:x,scale:A,isAnnotating:!1,tools:{...K,navigation:e==="pdf"||e==="pdf_slides"?K.navigation:!1,rotate:e==="image"},styles:$,onPrevPage:Gu,onNextPage:Uu,onZoomIn:Xu,onZoomOut:Zu,onRotateLeft:e==="image"?qu:void 0,onRotateRight:e==="image"?Hu:void 0,onAnnotationToggle:()=>{},onDownload:()=>{},onClose:Ru,className:uu}),e==="markdown"||e==="markdown_table"?t.jsxs("div",{ref:Su,style:{flex:1,overflow:"auto",position:"relative"},className:i,children:[t.jsx(su,{data:{content:W,...P()&&{fileName:P()},...e&&{fileType:e},...x&&{totalPages:x}},annotationData:H,totalPage:x,currentPage:v,scale:A,eventsEmit:(u,o)=>{console.log("Fviewer\u4E8B\u4EF6:",u,o),c(u==="md_annotation_add"?"md_annotation_add":u==="table_annotation_add"?"table_annotation_add":u,o)},styles:$,tools:K,customComponents:m,contentClass:i}),(console.log("=== \u4F20\u9012\u7ED9Fviewer\u7684markdown\u5185\u5BB9 ==="),console.log("markdownContent:",W),console.log("markdownContent\u957F\u5EA6:",W.length),console.log("markdownContent\u524D100\u5B57\u7B26:",W.substring(0,100)),console.log("markdownContent\u540E100\u5B57\u7B26:",W.substring(W.length-100)),null)]}):e==="image"?t.jsx(su,{data:{content:Ou,...P()&&{fileName:P()},...e&&{fileType:e}},annotationData:H,totalPage:1,currentPage:1,scale:A,rotation:V,eventsEmit:c,styles:$,tools:{...K,navigation:!1,rotate:!0},customComponents:m,contentClass:i}):e==="pdf"||e==="pdf_slides"?t.jsx(su,{data:{content:{document:vu},...P()&&{fileName:P()},...e&&{fileType:e},...x&&{totalPages:x},pdfStartPage:Math.floor((v-1)/h)*h+1},annotationData:H,totalPage:x,currentPage:v,scale:A,eventsEmit:(u,o)=>{console.log("Fviewer\u4E8B\u4EF6:",u,o),u==="scaleChange"&&console.log("\u6536\u5230\u7F29\u653E\u53D8\u5316\u4E8B\u4EF6:",o),c(u,o)},styles:$,tools:K,customComponents:m,contentClass:i}):t.jsx(su,{data:{content:Lu||Mu||{type:"text",content:"\u6587\u4EF6\u5185\u5BB9\u52A0\u8F7D\u4E2D..."},...P()&&{fileName:P()},...e&&{fileType:e}},annotationData:H,totalPage:1,currentPage:1,scale:A,eventsEmit:c,styles:$,tools:{...K,navigation:!1},customComponents:m,contentClass:i})]})};export{po as default};
|
|
142
|
+
`,ho="http://10.15.12.13:9005/proxy/index/knowledgeBase/file/stream",A=300*1e3,fo={colors:{primary:"#007bff",secondary:"#6c757d",success:"#008000",warning:"#FFA500",error:"#FF0000",info:"#0000FF",background:"#f8f9fa",text:"#343a40",border:"#dee2e6",disabled:"#808080",disabledBackground:"#F5F5F5",disabledText:"#808080"},space:{sidebar:"md",size:"md",radius:"md",padding:"md",margin:"md",shadow:"md",lineHeight:"md"}},bo=({convertedFilePath:n,fileName:d,fileType:e,csrfToken:B,initialPage:_=1,totalPages:g,annotations:G=[],pageSize:h=5,initialZoom:cu=100,streamApiUrl:b=ho,authorization:F,eventsEmit:c=()=>{},tools:V,styles:x,customComponents:f,className:U,headerClass:ou,contentClass:i})=>{const[lu,C]=k(!0),[Cu,m]=k("\u6B63\u5728\u52A0\u8F7D\u6587\u6863..."),[du,O]=k(null),[j,M]=k(_),[E,W]=k(g||0),[P,ju]=k(cu/100),[N,iu]=k(0),[Lu,mu]=k(null),[Mu,Bu]=k(null),[Y,Eu]=k(""),[Su,Fu]=k(null),[Ku,wu]=k(null),[ku,Du]=k({}),z=q(!1),eu=q(!1),J=q({}),R=q({}),Q=q(null),Xu=q(null),S=q(_),K=(x==null?void 0:x.theme)||fo;uu(()=>{z.current=!1,eu.current=!1},[e,n]);const X=l(()=>{const u={annotation:!0,download:!0,zoom:!0,close:!0,navigation:!0,rotate:!1};let o;switch(e){case"pdf":case"pdf_slides":o={...u,annotation:!1,download:!1,navigation:!0,rotate:!1};break;case"image":o={...u,annotation:!1,download:!1,navigation:!1,rotate:!0,zoom:!0};break;case"markdown":case"markdown_table":o={...u,annotation:!1,download:!1,navigation:!1,rotate:!1,zoom:!1};break;case"text":case"html":case"unknown":o={...u,annotation:!1,download:!1,navigation:!1,rotate:!1,zoom:!1};break;default:o=u}return V?{...o,...V}:o},[e,V])(),L=l((u,o)=>{const r=Math.floor((u-1)/o)*o+1;return`${r}-${r+o-1}`},[]),$u=l(async u=>{var p;if(!(e==="pdf"||e==="pdf_slides"))return console.log(`\u6587\u4EF6\u7C7B\u578B ${e} \u4E0D\u662FPDF\uFF0C\u8DF3\u8FC7\u7F13\u5B58\u68C0\u67E5`),null;console.log(`\u68C0\u67E5\u9875\u9762 ${u} \u662F\u5426\u5728\u7F13\u5B58\u4E2D`);const r=J.current[u];if(r&&Date.now()-r.timestamp<A)return console.log(`\u4F7F\u7528\u5355\u4E2A\u9875\u9762\u7F13\u5B58: ${u}`),r.pdfDocument?(console.log(`\u76F4\u63A5\u8FD4\u56DE\u7F13\u5B58\u7684PDF\u6587\u6863: ${u}`),r.pdfDocument):null;const t=L(u,h),a=R.current[t];if(console.log(`\u68C0\u67E5chunk\u7F13\u5B58: ${t}, \u5B58\u5728: ${!!a}, \u5305\u542B\u9875\u9762: ${((p=a==null?void 0:a.pages)==null?void 0:p.join(", "))||"\u65E0"}`),a&&Date.now()-a.timestamp<A){if(a.pages.includes(u))return console.log(`\u4F7F\u7528chunk\u7F13\u5B58: ${u} (chunk: ${t})`),a.pdfDocument?(console.log(`\u76F4\u63A5\u8FD4\u56DE\u7F13\u5B58\u7684PDF\u6587\u6863: ${u}`),a.pdfDocument):null;console.log(`\u9875\u9762 ${u} \u4E0D\u5728chunk ${t} \u4E2D\uFF0Cchunk\u5305\u542B: ${a.pages.join(", ")}`)}return console.log(`\u9875\u9762 ${u} \u4E0D\u5728\u4EFB\u4F55\u7F13\u5B58\u4E2D\uFF0C\u9700\u8981\u91CD\u65B0\u8BF7\u6C42`),null},[h,L,e]),pu=l(async u=>{var o;try{if(!(e==="pdf"||e==="pdf_slides"))throw console.log(`\u6587\u4EF6\u7C7B\u578B ${e} \u4E0D\u9700\u8981\u5206\u9875\u53C2\u6570\uFF0C\u83B7\u53D6\u5B8C\u6574\u5185\u5BB9`),new Error(`\u6587\u4EF6\u7C7B\u578B ${e} \u4E0D\u652F\u6301\u5206\u9875\u52A0\u8F7D`);const t=Math.floor((u-1)/h)*h+1,a=L(u,h);console.log(`\u8BF7\u6C42PDF chunk\u6570\u636E: ${t} (\u5305\u542B\u9875\u9762 ${t}-${t+h-1})`);const p={"Content-Type":"application/json"};F&&(p.Authorization=F),B&&(p["X-CSRF-TOKEN-IN"]=B);const w={convertedFilePath:n,pageNo:t,pageSize:h},D=await au.post(b,w,{headers:p,responseType:"arraybuffer"}),Z=D.headers["x-csrf-token-out"]||D.headers["X-CSRF-TOKEN-OUT"];Z&&(console.log("\u83B7\u53D6\u5230\u54CD\u5E94\u5934\u4E2D\u7684CSRF Token:",Z),c("request_finish",Z));const T=Array.from({length:h},(mo,Ju)=>t+Ju);return R.current[a]={data:D.data,pages:T,timestamp:Date.now(),totalPages:g},console.log(`\u7F13\u5B58PDF chunk\u6570\u636E: ${a}, \u5305\u542B\u9875\u9762: ${T.join(", ")}, \u8BF7\u6C42\u7684\u9875\u9762: ${u}`),console.log("\u5F53\u524D\u6240\u6709\u7F13\u5B58:",Object.keys(R.current)),D.data}catch(r){throw console.error("\u83B7\u53D6PDF stream\u6570\u636E\u5931\u8D25:",r),new Error(`PDF\u8BF7\u6C42\u5931\u8D25: ${((o=r.response)==null?void 0:o.status)||"\u7F51\u7EDC\u9519\u8BEF"}`)}},[b,n,h,F,L,g,E,e,c]),tu=l(async(u,o=!1)=>{var t;if(!u)return;if(!(e==="pdf"||e==="pdf_slides"))return console.log(`\u6587\u4EF6\u7C7B\u578B ${e} \u4E0D\u662FPDF\uFF0C\u8DF3\u8FC7PDF\u52A0\u8F7D\u903B\u8F91`),null;try{o?(C(!0),m("\u6B63\u5728\u52A0\u8F7DPDF\u6587\u6863...")):(C(!0),m(`\u6B63\u5728\u52A0\u8F7D\u7B2C ${u} \u9875...`)),O(null),console.log(`\u5F00\u59CB\u52A0\u8F7DPDF\u9875\u9762: ${u}, \u521D\u59CB\u52A0\u8F7D: ${o}`);const a=await $u(u);if(a)return console.log(`\u4F7F\u7528\u7F13\u5B58\u7684PDF\u6587\u6863: ${u}`),mu(a),C(!1),m(""),console.log(`\u9875\u9762 ${u} \u52A0\u8F7D\u5B8C\u6210\uFF08\u4F7F\u7528\u7F13\u5B58\uFF09`),a;const p=await pu(u),w=await hu(p,{fileName:d||"Stream\u6587\u6863",fileType:"pdf",token:F});if(w.error)throw new Error(w.error);if(w.type!=="pdf"||!((t=w.content)!=null&&t.document))throw new Error("\u89E3\u6790\u7ED3\u679C\u4E0D\u662F\u6709\u6548\u7684PDF\u6587\u6863");const D=w.content.document;console.log("\u8BBE\u7F6EPDF\u6587\u6863:",D),console.log("PDF\u6587\u6863\u7C7B\u578B:",typeof D),console.log("PDF\u6587\u6863\u65B9\u6CD5:",D?Object.getOwnPropertyNames(Object.getPrototypeOf(D)):"\u65E0\u6587\u6863"),console.log("PDF\u6587\u6863\u9875\u6570:",D?D.numPages:"\u65E0\u9875\u6570"),console.log("\u5F53\u524D\u8BF7\u6C42\u7684\u9875\u9762:",u),console.log("PDF\u6587\u6863\u5305\u542B\u7684\u9875\u9762\u8303\u56F4:",D?`1-${D.numPages}`:"\u65E0\u9875\u6570"),mu(D);const Z=L(u,h);if(R.current[Z]&&(R.current[Z].pdfDocument=D,console.log(`\u7F13\u5B58PDF\u6587\u6863\u5230chunk: ${Z}`)),g)console.log(`\u4F7F\u7528\u7528\u6237\u4F20\u5165\u7684\u603B\u9875\u6570: ${g}`),W(g);else if(D&&D.numPages){const T=D.numPages;console.log(`\u7528\u6237\u672A\u4F20\u5165\u603B\u9875\u6570\uFF0C\u4ECEPDF\u6587\u6863\u83B7\u53D6\u5B9E\u9645\u603B\u9875\u6570: ${T}`),W(T)}return C(!1),m(""),console.log(`\u9875\u9762 ${u} \u52A0\u8F7D\u5B8C\u6210`),D}catch(a){throw console.error("PDF\u52A0\u8F7D\u5931\u8D25:",a),O(a.message||"PDF\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"),C(!1),m(""),a}},[pu,d,F,E,$u,L,h,e]),xu=l(u=>{if(!(e==="pdf"||e==="pdf_slides"))return!1;const r=J.current[u];if(r&&Date.now()-r.timestamp<A)return!!r.pdfDocument;const t=L(u,h),a=R.current[t];return a&&Date.now()-a.timestamp<A?a.pages.includes(u)&&!!a.pdfDocument:!1},[h,L,e]),Au=l(()=>{console.log("\u68C0\u67E5markdown\u5185\u5BB9\u662F\u5426\u5728\u7F13\u5B58\u4E2D");const u=Q.current;return u&&Date.now()-u.timestamp<A?(console.log("\u4F7F\u7528markdown\u5185\u5BB9\u7F13\u5B58"),u.data):(console.log("markdown\u5185\u5BB9\u4E0D\u5728\u7F13\u5B58\u4E2D\uFF0C\u9700\u8981\u91CD\u65B0\u8BF7\u6C42"),null)},[]),bu=l(async()=>{var u;try{console.log("\u8BF7\u6C42\u5B8C\u6574markdown\u6570\u636E");const o={"Content-Type":"application/json"};F&&(o.Authorization=F),B&&(o["X-CSRF-TOKEN-IN"]=B);const r={convertedFilePath:n};console.log("\u53D1\u9001markdown\u8BF7\u6C42:",r);const t=await au.post(b,r,{headers:o,responseType:"text"}),a=t.headers["x-csrf-token-out"]||t.headers["X-CSRF-TOKEN-OUT"];return a&&(console.log("\u83B7\u53D6\u5230\u54CD\u5E94\u5934\u4E2D\u7684CSRF Token:",a),c("request_finish",a)),console.log("markdown\u54CD\u5E94\u72B6\u6001:",t.status),console.log("markdown\u54CD\u5E94\u6570\u636E\u957F\u5EA6:",((u=t.data)==null?void 0:u.length)||0),t.data}catch(o){throw console.error("\u83B7\u53D6markdown\u6570\u636E\u5931\u8D25:",o),new Error(`\u83B7\u53D6markdown\u6570\u636E\u5931\u8D25: ${o.message}`)}},[n,F,b,c]),Pu=l(async()=>{try{C(!0),m("\u6B63\u5728\u52A0\u8F7Dmarkdown\u6587\u6863..."),O(null),console.log("\u5F00\u59CB\u52A0\u8F7D\u5B8C\u6574markdown\u6587\u6863");const u=Au();if(u)return console.log("\u4F7F\u7528\u7F13\u5B58\u7684markdown\u5185\u5BB9"),Eu(u),C(!1),m(""),u;const o=await bu();return Q.current={data:o,timestamp:Date.now()},Eu(o),C(!1),m(""),console.log("\u5B8C\u6574markdown\u6587\u6863\u52A0\u8F7D\u5B8C\u6210"),o}catch(u){throw console.error("markdown\u52A0\u8F7D\u5931\u8D25:",u),O(u.message||"markdown\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"),C(!1),m(""),u}},[bu,Au]),Ru=l(async()=>{try{const u={"Content-Type":"application/json"};F&&(u.Authorization=F),B&&(u["X-CSRF-TOKEN-IN"]=B);const o={convertedFilePath:n},r=await au.post(b,o,{headers:u,responseType:"arraybuffer"}),t=r.headers["x-csrf-token-out"]||r.headers["X-CSRF-TOKEN-OUT"];return t&&(console.log("\u83B7\u53D6\u5230\u54CD\u5E94\u5934\u4E2D\u7684CSRF Token:",t),c("request_finish",t)),r.data}catch(u){throw console.error("\u83B7\u53D6\u56FE\u7247\u6570\u636E\u5931\u8D25:",u),new Error(`\u83B7\u53D6\u56FE\u7247\u6570\u636E\u5931\u8D25: ${u.message}`)}},[n,F,b,c]),yu=l(async()=>{try{C(!0),m("\u6B63\u5728\u52A0\u8F7D\u56FE\u7247..."),O(null);const u=await Ru(),o=await hu(u,{fileName:d||"\u56FE\u7247",fileType:"image",token:F});if(o.error)throw new Error(o.error);if(o.type!=="image"||!o.content)throw new Error("\u89E3\u6790\u7ED3\u679C\u4E0D\u662F\u6709\u6548\u7684\u56FE\u7247");return Bu(o.content),C(!1),m(""),o.content}catch(u){throw console.error("\u56FE\u7247\u52A0\u8F7D\u5931\u8D25:",u),O(u.message||"\u56FE\u7247\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"),C(!1),m(""),u}},[F,d,Ru]),_u=l(async()=>{var u;try{console.log(`\u8BF7\u6C42\u901A\u7528\u6587\u4EF6\u6570\u636E\uFF0C\u6587\u4EF6\u7C7B\u578B: ${e}`);const o={"Content-Type":"application/json"};F&&(o.Authorization=F),B&&(o["X-CSRF-TOKEN-IN"]=B);const r={convertedFilePath:n};console.log("\u53D1\u9001\u901A\u7528\u6587\u4EF6\u8BF7\u6C42:",r);const t=await au.post(b,r,{headers:o,responseType:"arraybuffer"}),a=t.headers["x-csrf-token-out"]||t.headers["X-CSRF-TOKEN-OUT"];return a&&(console.log("\u83B7\u53D6\u5230\u54CD\u5E94\u5934\u4E2D\u7684CSRF Token:",a),c("request_finish",a)),console.log("\u901A\u7528\u6587\u4EF6\u54CD\u5E94\u72B6\u6001:",t.status),console.log("\u901A\u7528\u6587\u4EF6\u54CD\u5E94\u6570\u636E\u957F\u5EA6:",((u=t.data)==null?void 0:u.byteLength)||0),t.data}catch(o){throw console.error("\u83B7\u53D6\u901A\u7528\u6587\u4EF6\u6570\u636E\u5931\u8D25:",o),new Error(`\u83B7\u53D6\u901A\u7528\u6587\u4EF6\u6570\u636E\u5931\u8D25: ${o.message}`)}},[n,F,b,c]),Zu=l(async()=>{try{if(console.log("=== loadGenericDocument \u88AB\u8C03\u7528 ==="),console.log("\u8C03\u7528\u6808:",new Error().stack),console.log("\u5F53\u524D\u65F6\u95F4:",new Date().toISOString()),z.current){console.log(`\u901A\u7528\u6587\u6863\u6B63\u5728\u52A0\u8F7D\u4E2D\uFF0C\u5FFD\u7565\u91CD\u590D\u8BF7\u6C42\uFF0C\u6587\u4EF6\u7C7B\u578B: ${e}`);return}if(eu.current){console.log(`\u901A\u7528\u6587\u6863\u5DF2\u7ECF\u52A0\u8F7D\u8FC7\uFF0C\u5FFD\u7565\u91CD\u590D\u8BF7\u6C42\uFF0C\u6587\u4EF6\u7C7B\u578B: ${e}`);return}const u=`${e}_${n}`,o=ku[u];if(console.log(`\u68C0\u67E5\u901A\u7528\u6587\u6863\u7F13\u5B58\uFF0Ckey: ${u}, \u7F13\u5B58\u5B58\u5728: ${!!o}, \u7F13\u5B58\u65F6\u95F4: ${o?Date.now()-o.timestamp:"N/A"}ms`),o&&Date.now()-o.timestamp<A)return console.log(`\u4F7F\u7528\u7F13\u5B58\u7684\u901A\u7528\u6587\u6863\u5185\u5BB9\uFF0C\u6587\u4EF6\u7C7B\u578B: ${e}`),e==="text"&&o.content?Fu(o.content):e==="html"&&o.content&&wu(o.content),M(1),W(g||1),C(!1),m(""),o.content;z.current=!0,C(!0),m(`\u6B63\u5728\u52A0\u8F7D${e}\u6587\u6863...`),O(null),console.log(`\u5F00\u59CB\u52A0\u8F7D\u901A\u7528\u6587\u6863\uFF0C\u6587\u4EF6\u7C7B\u578B: ${e}`);const r=await _u(),t=await hu(r,{fileName:d||`${e}\u6587\u6863`,fileType:e,token:F});if(t.error)throw new Error(t.error);let a=null;if(t.type==="text"&&t.content)Fu(t.content),a=t.content;else if(t.type==="html"&&t.content)wu(t.content),a=t.content;else if(t.type==="image"&&t.content)Bu(t.content),a=t.content;else{const w=new TextDecoder("utf-8").decode(r);Fu({type:"text",content:w}),a={type:"text",content:w}}if(a){const p=`${e}_${n}`,w={...ku,[p]:{content:a,timestamp:Date.now()}};Du(w),console.log(`\u901A\u7528\u6587\u6863\u5185\u5BB9\u5DF2\u7F13\u5B58\uFF0C\u6587\u4EF6\u7C7B\u578B: ${e}, \u7F13\u5B58\u952E: ${p}`),console.log("\u5F53\u524D\u7F13\u5B58\u72B6\u6001:",w)}return C(!1),m(""),z.current=!1,eu.current=!0,console.log(`\u901A\u7528\u6587\u6863\u52A0\u8F7D\u5B8C\u6210\uFF0C\u6587\u4EF6\u7C7B\u578B: ${e}`),t}catch(u){throw console.error("\u901A\u7528\u6587\u6863\u52A0\u8F7D\u5931\u8D25:",u),O(u.message||"\u901A\u7528\u6587\u6863\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"),C(!1),m(""),z.current=!1,eu.current=!0,u}},[_u,d,F]),nu=l(async u=>{if(u===S.current)return;if(lu){console.log("\u9875\u9762\u6B63\u5728\u52A0\u8F7D\u4E2D\uFF0C\u5FFD\u7565\u7FFB\u9875\u8BF7\u6C42");return}if(!(e==="pdf"||e==="pdf_slides")){console.log(`\u6587\u4EF6\u7C7B\u578B ${e} \u4E0D\u652F\u6301\u7FFB\u9875\uFF0C\u5FFD\u7565\u7FFB\u9875\u8BF7\u6C42`);return}console.log("PDF\u9875\u9762\u53D8\u5316:",u,"\u5F53\u524D\u9875:",S.current),console.log(`\u9875\u9762 ${u} \u662F\u5426\u5728\u7F13\u5B58\u4E2D:`,xu(u)),S.current=u,M(u);try{await tu(u,!1),c("pageChange",{pageNumber:u,totalPages:g||E})}catch(r){console.error("PDF\u9875\u9762\u52A0\u8F7D\u5931\u8D25:",r);const t=S.current;M(t)}},[tu,E,c,xu,lu,e]);uu(()=>{S.current=j,console.log("\u5F53\u524D\u9875\u72B6\u6001\u66F4\u65B0:",j)},[j]);const ru=l(u=>{ju(u),c("zoomChange",{scale:u})},[c]),Iu=l(()=>{c("viewer:close")},[c]),qu=l(()=>{const u=Math.min(3,P+.1);ru(u)},[P,ru]),Hu=l(()=>{const u=Math.max(.3,P-.1);ru(u)},[P,ru]),Gu=l(()=>{const u=(N-90+360)%360;iu(u),c("rotateChange",{rotation:u})},[N,c]),Uu=l(()=>{const u=(N+90)%360;iu(u),c("rotateChange",{rotation:u})},[N,c]),Wu=l(()=>{if(!(e==="pdf"||e==="pdf_slides")){console.log(`\u6587\u4EF6\u7C7B\u578B ${e} \u4E0D\u652F\u6301\u7FFB\u9875\uFF0C\u5FFD\u7565\u7FFB\u9875\u8BF7\u6C42`);return}const o=S.current-1;o>=1&&nu(o)},[nu,e]),Yu=l(()=>{if(!(e==="pdf"||e==="pdf_slides")){console.log(`\u6587\u4EF6\u7C7B\u578B ${e} \u4E0D\u652F\u6301\u7FFB\u9875\uFF0C\u5FFD\u7565\u7FFB\u9875\u8BF7\u6C42`);return}const o=S.current+1,r=g||E;r&&o<=r&&nu(o)},[E,nu,e]),vu=l(()=>{const u=Date.now();Object.keys(J.current).forEach(o=>{const r=J.current[parseInt(o)];u-r.timestamp>A&&(delete J.current[parseInt(o)],console.log(`\u6E05\u7406\u8FC7\u671F\u9875\u9762\u7F13\u5B58: ${o}`))}),Object.keys(R.current).forEach(o=>{const r=R.current[o];u-r.timestamp>A&&(delete R.current[o],console.log(`\u6E05\u7406\u8FC7\u671Fchunk\u7F13\u5B58: ${o}`))}),Q.current&&u-Q.current.timestamp>A&&(Q.current=null,console.log("\u6E05\u7406\u8FC7\u671Fmarkdown\u5185\u5BB9\u7F13\u5B58")),Du(o=>{const r={...o};return Object.keys(r).forEach(t=>{u-r[t].timestamp>A&&(delete r[t],console.log(`\u6E05\u7406\u8FC7\u671F\u901A\u7528\u6587\u4EF6\u7F13\u5B58: ${t}`))}),r})},[]),y=l(()=>{if(d)return d;try{const u=new URL(n);return decodeURIComponent(u.pathname.split("/").pop()||"")||"Stream\u6587\u6863"}catch{const u=n.split("/");return decodeURIComponent(u[u.length-1])||"Stream\u6587\u6863"}},[n,d]);return uu(()=>{const u=setInterval(vu,A);return()=>clearInterval(u)},[vu]),uu(()=>()=>{J.current={},R.current={},Q.current=null,Du({}),console.log("\u7EC4\u4EF6\u5378\u8F7D\uFF0C\u6E05\u7406\u6240\u6709\u7F13\u5B58")},[]),uu(()=>{console.log("=== useEffect \u88AB\u89E6\u53D1 ==="),console.log("\u89E6\u53D1\u65F6\u95F4:",new Date().toISOString()),console.log("\u89E6\u53D1\u539F\u56E0:",{initialPage:_,fileType:e}),(async()=>{try{const o=e==="pdf"||e==="pdf_slides",r=o&&_||1;console.log("\u5F00\u59CB\u521D\u59CB\u52A0\u8F7D\uFF0C\u6587\u4EF6\u7C7B\u578B:",e,"\u6709\u6548\u9875\u7801:",r,"\u662F\u5426PDF:",o),e==="markdown"||e==="markdown_table"?(await Pu(),M(1),W(g||1),c("pageChange",{pageNumber:1,totalPages:g||1})):e==="image"?(await yu(),M(1),W(g||1),iu(0),c("pageChange",{pageNumber:1,totalPages:g||1})):o?(await tu(r,!0),M(r),setTimeout(()=>{c("pageChange",{pageNumber:r,totalPages:g||E})},0)):(console.log("=== \u521D\u59CB\u52A0\u8F7D\uFF1A\u4F7F\u7528\u901A\u7528\u52A0\u8F7D\u51FD\u6570\u5904\u7406\u6587\u4EF6\u7C7B\u578B ===",e),await Zu(),M(1),W(g||1),c("pageChange",{pageNumber:1,totalPages:g||1}))}catch(o){console.error("\u521D\u59CB\u52A0\u8F7D\u5931\u8D25:",o)}})()},[_,e,tu,Pu,yu,c]),du?s(fu,{$theme:K,className:U,children:f!=null&&f.ErrorComponent?s(f.ErrorComponent,{error:du,theme:K}):$(go,{$theme:K,children:[s("div",{children:"\u52A0\u8F7D\u5931\u8D25"}),s("div",{style:{fontSize:"12px",marginTop:"8px"},children:du})]})}):lu?$(fu,{$theme:K,className:U,children:[s(Ou,{fileName:y(),currentPage:j,totalPage:E,scale:P,isAnnotating:!1,tools:X,styles:x,onPrevPage:()=>{},onNextPage:()=>{},onZoomIn:()=>{},onZoomOut:()=>{},onAnnotationToggle:()=>{},onDownload:()=>{},onClose:Iu,className:ou}),f!=null&&f.LoadingComponent?s(f.LoadingComponent,{status:Cu,theme:K}):s(Do,{status:Cu,theme:K})]}):$(fu,{$theme:K,className:U,children:[s(Ou,{fileName:y(),currentPage:j,totalPage:E,scale:P,isAnnotating:!1,tools:{...X,navigation:e==="pdf"||e==="pdf_slides"?X.navigation:!1,rotate:e==="image"},styles:x,onPrevPage:Wu,onNextPage:Yu,onZoomIn:qu,onZoomOut:Hu,onRotateLeft:e==="image"?Gu:void 0,onRotateRight:e==="image"?Uu:void 0,onAnnotationToggle:()=>{},onDownload:()=>{},onClose:Iu,className:ou}),e==="markdown"||e==="markdown_table"?$("div",{ref:Xu,style:{flex:1,overflow:"auto",position:"relative"},className:i,children:[s(su,{data:{content:Y,...y()&&{fileName:y()},...e&&{fileType:e},...E&&{totalPages:E}},annotationData:G,totalPage:E,currentPage:j,scale:P,eventsEmit:(u,o)=>{console.log("Fviewer\u4E8B\u4EF6:",u,o),c(u==="md_annotation_add"?"md_annotation_add":u==="table_annotation_add"?"table_annotation_add":u,o)},styles:x,tools:X,customComponents:f,contentClass:i}),(console.log("=== \u4F20\u9012\u7ED9Fviewer\u7684markdown\u5185\u5BB9 ==="),console.log("markdownContent:",Y),console.log("markdownContent\u957F\u5EA6:",Y.length),console.log("markdownContent\u524D100\u5B57\u7B26:",Y.substring(0,100)),console.log("markdownContent\u540E100\u5B57\u7B26:",Y.substring(Y.length-100)),null)]}):e==="image"?s(su,{data:{content:Mu,...y()&&{fileName:y()},...e&&{fileType:e}},annotationData:G,totalPage:1,currentPage:1,scale:P,rotation:N,eventsEmit:c,styles:x,tools:{...X,navigation:!1,rotate:!0},customComponents:f,contentClass:i}):e==="pdf"||e==="pdf_slides"?s(su,{data:{content:{document:Lu},...y()&&{fileName:y()},...e&&{fileType:e},...E&&{totalPages:E},pdfStartPage:Math.floor((j-1)/h)*h+1},annotationData:G,totalPage:E,currentPage:j,scale:P,eventsEmit:(u,o)=>{console.log("Fviewer\u4E8B\u4EF6:",u,o),u==="scaleChange"&&console.log("\u6536\u5230\u7F29\u653E\u53D8\u5316\u4E8B\u4EF6:",o),c(u,o)},styles:x,tools:X,customComponents:f,contentClass:i}):s(su,{data:{content:Su||Ku||{type:"text",content:"\u6587\u4EF6\u5185\u5BB9\u52A0\u8F7D\u4E2D..."},...y()&&{fileName:y()},...e&&{fileType:e}},annotationData:G,totalPage:1,currentPage:1,scale:P,eventsEmit:c,styles:x,tools:{...X,navigation:!1},customComponents:f,contentClass:i})]})};export{bo as default};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import v from"react";var i={exports:{}},t={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var p;function y(){if(p)return t;p=1;var R=v,a=Symbol.for("react.element"),x=Symbol.for("react.fragment"),c=Object.prototype.hasOwnProperty,l=R.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,d={key:!0,ref:!0,__self:!0,__source:!0};function s(n,r,_){var e,o={},u=null,f=null;_!==void 0&&(u=""+_),r.key!==void 0&&(u=""+r.key),r.ref!==void 0&&(f=r.ref);for(e in r)c.call(r,e)&&!d.hasOwnProperty(e)&&(o[e]=r[e]);if(n&&n.defaultProps)for(e in r=n.defaultProps,r)o[e]===void 0&&(o[e]=r[e]);return{$$typeof:a,type:n,key:u,ref:f,props:o,_owner:l.current}}return t.Fragment=x,t.jsx=s,t.jsxs=s,t}var m;function O(){return m||(m=1,i.exports=y()),i.exports}var j=O();export{j};
|