2026-07-27 10:43:53 +08:00
var kw = Object . defineProperty ; var kv = d => { throw TypeError ( d ) } ; var Tw = ( d , t , e ) => t in d ? kw ( d , t , { enumerable : ! 0 , configurable : ! 0 , writable : ! 0 , value : e } ) : d [ t ] = e ; var M = ( d , t , e ) => Tw ( d , typeof t != "symbol" ? t + "" : t , e ) , sg = ( d , t , e ) => t . has ( d ) || kv ( "Cannot " + e ) ; var n = ( d , t , e ) => ( sg ( d , t , "read from private field" ) , e ? e . call ( d ) : t . get ( d ) ) , m = ( d , t , e ) => t . has ( d ) ? kv ( "Cannot add the same private member more than once" ) : t instanceof WeakSet ? t . add ( d ) : t . set ( d , e ) , p = ( d , t , e , s ) => ( sg ( d , t , "write to private field" ) , s ? s . call ( d , e ) : t . set ( d , e ) , e ) , v = ( d , t , e ) => ( sg ( d , t , "access private method" ) , e ) ; var Kt = ( d , t , e , s ) => ( { set _ ( i ) { p ( d , t , i , e ) } , get _ ( ) { return n ( d , t , s ) } } ) ; import { E as Pw } from "./el-alert-DBfM1mZE.js" ; import { E as zu } from "./index-CCavIuTY.js" ; import { v as Mw } from "./directive-vzjADwzS.js" ; import { d as Ci , o as R , c as $ , q as _ , s as H , n as Se , aa as X , g as ft , j as rt , x as ut , w as J , M as Ae , ad as ii , e as Ut , f as Xt , A as gt , y as et , D as Si , H as cb , al as Iw , aQ as Dw , P as Kh , t as Tv , aL as ig , z as pg , v as hb , ac as Lw , ag as Fw , aR as Ow , G as Rw , K as Nw , aB as Bw } from "./index-CGB0A5x_.js" ; import { A as $w } from "./AppConfirmDialog-B3AUVDne.js" ; import { E as db , a as ub } from "./el-form-item-Ct_zBuY0.js" ; import { E as Vu } from "./index-CbmPSBt0.js" ; import { a as fb , E as Op } from "./el-checkbox-Ci1DH0Aj.js" ; import { E as Gu } from "./el-input-number-VAjRO6-I.js" ; /* empty css */ import { _ as _i } from "./_plugin-vue_export-helper-DlAUqK2U.js" ; import { E as Rp , a as Np } from "./el-select-C59URVI0.js" ; import { E as Uw } from "./el-slider-CM3VEvCM.js" ; import { E as Hw } from "./el-switch-ZjdGiO6T.js" ; import "./el-popper-DvBtRO32.js" ; import "./el-tooltip-l0sNRNKZ.js" ; import "./el-scrollbar-p6_f_LH2.js" ; import { E as zw } from "./el-tag-C_D80BPW.js" ; import { E as pb } from "./el-pagination-DGQ0vO_O.js" ; import { E as gb } from "./el-progress-Wh76Cs6O.js" ; import { E as Vw } from "./el-upload-C_d7Re6v.js" ; import { a as Gw , b as jw , s as Ww , c as Xw , r as qw , u as Yw , e as Kw , f as Pv , h as Qw , i as Jw , j as Qm , k as ng , l as Zw , m as Jf , n as tA , o as eA , p as sA , t as iA , q as nA , v as rA , w as aA , x as oA } from "./dataProcess-D7vRt2n_.js" ; import { u as lA } from "./models-CmYPjWPP.js" ; import "./vnode-DFpZw5lG.js" ; import "./castArray-Cgg396Sr.js" ; import "./_baseClone-CX1E8HTZ.js" ; import "./raf-CCivjDro.js" ; import "./index-D2-3cnGo.js" ; import "./index-DMVRI44M.js" ; import "./omit-DaFv1hTo.js" ; import "./index-CL2S8yHq.js" ; import "./index-BPwPlcbL.js" ; import "./index-khuXz7sd.js" ; import "./scroll-C0BSy_Rk.js" ; import "./clamp-BqqU4KQ-.js" ; import "./toNumber-IRhFg6gN.js" ; import "./_baseIteratee-uVh0OyD5.js" ; import "./debounce-Bqww2DS8.js" ; import "./validator-D7tSoy2w.js" ; import "./model-xlHsHa68.js" ; const xl = { min : 1 , max : 50 } ; function Jm ( d , t = 1 ) { const e = Number ( d ) , s = Number . isFinite ( e ) ? Math . trunc ( e ) : t ; return Math . min ( xl . max , Math . max ( xl . min , s ) ) } const cA = { class : "generation-option-row dataset-split-row" } , hA = { class : "dataset-split-config" } , dA = { class : "dataset-split-grid" } , uA = { class : "dataset-split-field" } , fA = { class : "dataset-split-input" } , pA = { class : "dataset-split-field" } , gA = { class : "dataset-split-input" } , mA = { class : "dataset-split-field" } , vA = { class : "dataset-split-input" } , bA = { key : 0 , role : "alert" } , yA = Ci ( { _ _name : "DatasetSplitEditor" , props : { modelValue : { } , ariaLabelPrefix : { default : "" } } , emits : [ "update:modelValue" ] , setup ( d , { emit : t } ) { const e = d , s = t , i = rt ( ( ) => { const { train : o , validation : l , test : c } = e . modelValue ; return o + l + c } ) ; function r ( o , l ) { s ( "update:modelValue" , { ... e . modelValue , [ o ] : Math . min ( 100 , Math . max ( 0 , Number ( l ) || 0 ) ) } ) } function a ( o ) { return ` ${ e . ariaLabelPrefix } ${ o } 比例 ` } return ( o , l ) => { const c = Gu ; return R ( ) , $ ( "div" , cA , [ l [ 9 ] || ( l [ 9 ] = _ ( "div" , { class : "generation-option-copy" } , [ _ ( "strong" , null , "数据集划分" ) , _ ( "small" , null , "按比例将生成后的问答对随机划分为训练集、验证集和测试集" ) ] , - 1 ) ) , _ ( "div" , hA , [ _ ( "div" , dA , [ _ ( "label" , uA , [ l [ 4 ] || ( l [ 4 ] = _ ( "span" , null , "训练集" , - 1 ) ) , _ ( "span" , fA , [ H ( c , { "model-value" : d . modelValue . train , min : 0 , max : 100 , step : 1 , precision : 0 , "controls-position" : "right" , "aria-label" : a ( "训练集" ) , "onUpdate:modelValue" : l [ 0 ] || ( l [ 0 ] = h => r ( "train" , h ) ) } , null , 8 , [ "model-value" , "aria-label" ] ) , l [ 3 ] || ( l [ 3 ] = _ ( "span" , null , "%" , - 1 ) ) ] ) ] ) , _ ( "label" , pA , [ l [ 6 ] || ( l [ 6 ] = _ ( "span" , null , "验证集" , - 1 ) ) , _ ( "span"
` ).join("")}}Tr=new WeakMap;function Wh(d,t){const e=t?URL.parse(d,t):URL.parse(d);return/https?:/.test((e==null?void 0:e.protocol)??"")}function Ei(d){d.preventDefault()}function re(d){d.preventDefault(),d.stopPropagation()}var sd;class tp{static toDateObject(t){if(t instanceof Date)return t;if(!t||typeof t!="string")return null;n(this,sd)||p(this,sd,new RegExp("^D:( \\ d{4})( \\ d{2})?( \\ d{2})?( \\ d{2})?( \\ d{2})?( \\ d{2})?([Z|+ \\ -])?( \\ d{2})?'?( \\ d{2})?'?"));const e=n(this,sd).exec(t);if(!e)return null;const s=parseInt(e[1],10);let i=parseInt(e[2],10);i=i>=1&&i<=12?i-1:0;let r=parseInt(e[3],10);r=r>=1&&r<=31?r:1;let a=parseInt(e[4],10);a=a>=0&&a<=23?a:0;let o=parseInt(e[5],10);o=o>=0&&o<=59?o:0;let l=parseInt(e[6],10);l=l>=0&&l<=59?l:0;const c=e[7]||"Z";let h=parseInt(e[8],10);h=h>=0&&h<=23?h:0;let u=parseInt(e[9],10)||0;return u=u>=0&&u<=59?u:0,c==="-"?(a+=h,o+=u):c==="+"&&(a-=h,o-=u),new Date(Date.UTC(s,i,r,a,o,l))}}sd=new WeakMap,m(tp,sd);function Xu(d){if(d.startsWith("#")){const e=d.slice(1);return[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16),e.length>=8?parseInt(e.slice(6,8),16)/255:1]}if(d.startsWith("rgb(")){const[e,s,i]=d.slice(4,-1).split(",").map(r=>parseInt(r,10));return[e,s,i,1]}if(d.startsWith("rgba(")){const e=d.slice(5,-1).split(",");return[parseInt(e[0],10),parseInt(e[1],10),parseInt(e[2],10),parseFloat(e[3])]}const t=d.match(/^color \( srgb \s +([ \d .]+) \s +([ \d .]+) \s +([ \d .]+)(?: \s * \/ \s *([ \d .]+|none))? \) $ /);return t?[Math.round(parseFloat(t[1])*255),Math.round(parseFloat(t[2])*255),Math.round(parseFloat(t[3])*255),t[4]!==void 0&&t[4]!=="none"?parseFloat(t[4]):1]:null}function qu(d){const t=Xu(d);return t?t.slice(0,3):(ht( ` Not a valid color format : "${d}" ` ),[0,0,0])}function y1(d){const t=document.createElement("span");t.style.visibility="hidden",t.style.colorScheme="only light",document.body.append(t);for(const e of d.keys()){t.style.color=e;const s=window.getComputedStyle(t).color;d.set(e,qu(s))}t.remove()}function qt(d){const{a:t,b:e,c:s,d:i,e:r,f:a}=d.getTransform();return[t,e,s,i,r,a]}function Yi(d){const{a:t,b:e,c:s,d:i,e:r,f:a}=d.getTransform().invertSelf();return[t,e,s,i,r,a]}function El(d,t,e=!1,s=!0){if(t instanceof Wu){const{pageWidth:i,pageHeight:r}=t.rawDims,{style:a}=d,o= ` round ( down , var ( -- total - scale - factor ) * $ { i } px , var ( -- scale - round - x ) ) ` ,l= ` round ( down , var ( -- total - scale - factor ) * $ { r } px , var ( -- scale - round - y ) ) ` ;!e||t.rotation%180===0?(a.width=o,a.height=l):(a.width=l,a.height=o)}s&&d.setAttribute("data-main-rotation",t.rotation)}class _n{constructor(){const{pixelRatio:t}=_n;this.sx=t,this.sy=t}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}limitCanvas(t,e,s,i,r=-1){let a=1/0,o=1/0,l=1/0;s=_n.capPixels(s,r),s>0&&(a=Math.sqrt(s/(t*e))),i!==-1&&(o=i/t,l=i/e);const c=Math.min(a,o,l);return this.sx>c||this.sy>c?(this.sx=c,this.sy=c,!0):!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(t,e){if(e>=0){const s=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+e/100));return t>0?Math.min(t,s):s}return t}}const Ag=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];class w1{static get isDarkMode(){var t;return ot(this,"isDarkMode",!!((t=window==null?void 0:window.matchMedia)!=null&&t.call(window,"(prefers-color-scheme: dark)").matches))}}class A1{static get commentForegroundColor(){const t=document.createElement("span");t.classList.add("comment","sidebar");const{style:e}=t;e.width=e.height="0",e.display="none",e.color="var(--comment-fg-color)",document.body.append(t);const{color:s}=window.getComputedStyle(t);return t.remove(),ot(this,"commentForegroundColor",qu(s))}}function S1(d,t){t=Zt(t??1,0,1);const e=255*(1-t);return d.map(s=>Math.round(s*t+e))}function Dv(d,t){const e=d[0]/255,s=d[1]/255,i=d[2]/255,r=Math.max(e,s,i),a=Math.min(e,s,i),o=(r+a)/2;if(r===a)t[0]=t[1]=0;else{const l=r-a;switch(t[1]=o<.5?l/(r+a):l/(2-r-a),r){case e:t[0]=((s-i)/l+(s<i?6:0))*60;break;case s:t[0]=((i-e)/l+2)*60;break;case i:t
2026-07-25 22:41:16 +08:00
struct Uniforms {
offsetX : f32 ,
offsetY : f32 ,
scaleX : f32 ,
scaleY : f32 ,
paddedWidth : f32 ,
paddedHeight : f32 ,
borderSize : f32 ,
_pad : f32 ,
} ;
@ group ( 0 ) @ binding ( 0 ) var < uniform > u : Uniforms ;
struct VertexInput {
@ location ( 0 ) position : vec2 < f32 > ,
@ location ( 1 ) color : vec4 < f32 > ,
} ;
struct VertexOutput {
@ builtin ( position ) position : vec4 < f32 > ,
@ location ( 0 ) color : vec3 < f32 > ,
} ;
@ vertex
fn vs _main ( in : VertexInput ) - > VertexOutput {
var out : VertexOutput ;
let cx = ( in . position . x + u . offsetX ) * u . scaleX ;
let cy = ( in . position . y + u . offsetY ) * u . scaleY ;
out . position = vec4 < f32 > (
( ( cx + u . borderSize ) / u . paddedWidth ) * 2.0 - 1.0 ,
1.0 - ( ( cy + u . borderSize ) / u . paddedHeight ) * 2.0 ,
0.0 ,
1.0
) ;
out . color = in . color . rgb ;
return out ;
}
@ fragment
fn fs _main ( in : VertexOutput ) - > @ location ( 0 ) vec4 < f32 > {
return vec4 < f32 > ( in . color , 1.0 ) ;
}
2026-07-27 10:43:53 +08:00
` ;var wp,qn,Co,wc,Ap,vy;class Z1{constructor(){m(this,Ap);m(this,wp,null);m(this,qn,null);m(this,Co,null);m(this,wc,null)}init(){return n(this,wp)||p(this,wp,v(this,Ap,vy).call(this))}get isReady(){return n(this,qn)!==null}loadMeshShader(){if(!n(this,qn)||n(this,Co))return;const t=n(this,qn).createShaderModule({code:J1});p(this,Co,n(this,qn).createRenderPipeline({layout:"auto",vertex:{module:t,entryPoint:"vs_main",buffers:[{arrayStride:8,attributes:[{shaderLocation:0,offset:0,format:"float32x2"}]},{arrayStride:4,attributes:[{shaderLocation:1,offset:0,format:"unorm8x4"}]}]},fragment:{module:t,entryPoint:"fs_main",targets:[{format:n(this,wc)}]},primitive:{topology:"triangle-list"}}))}draw(t,e,s,i,r,a,o,l){this.loadMeshShader();const c=n(this,qn),{offsetX:h,offsetY:u,scaleX:f,scaleY:g}=i,y=c.createBuffer({size:Math.max(t.byteLength,4),usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST});t.byteLength>0&&c.queue.writeBuffer(y,0,t);const b=c.createBuffer({size:Math.max(e.byteLength,4),usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST});e.byteLength>0&&c.queue.writeBuffer(b,0,e);const w=c.createBuffer({size:32,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST});c.queue.writeBuffer(w,0,new Float32Array([h,u,f,g,a,o,l,0]));const S=c.createBindGroup({layout:n(this,Co).getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:w}}]}),E=new OffscreenCanvas(a,o),A=E.getContext("webgpu");A.configure({device:c,format:n(this,wc),alphaMode:r?"opaque":"premultiplied"});const C=r?{r:r[0]/255,g:r[1]/255,b:r[2]/255,a:1}:{r:0,g:0,b:0,a:0},x=c.createCommandEncoder(),k=x.beginRenderPass({colorAttachments:[{view:A.getCurrentTexture().createView(),clearValue:C,loadOp:"clear",storeOp:"store"}]});return s>0&&(k.setPipeline(n(this,Co)),k.setBindGroup(0,S),k.setVertexBuffer(0,y),k.setVertexBuffer(1,b),k.draw(s)),k.end(),c.queue.submit([x.finish()]),y.destroy(),b.destroy(),w.destroy(),E.transferToImageBitmap()}}wp=new WeakMap,qn=new WeakMap,Co=new WeakMap,wc=new WeakMap,Ap=new WeakSet,vy=async function(){var t;if(!((t=globalThis.navigator)!=null&&t.gpu))return!1;try{const e=await navigator.gpu.requestAdapter();return e?(p(this,wc,navigator.gpu.getPreferredCanvasFormat()),p(this,qn,await e.requestDevice()),!0):!1}catch{return!1}};const Vp=new Z1;function tx(){return Vp.init()}function ex(){return Vp.isReady}function sx(){Vp.loadMeshShader()}function ix(d,t,e,s,i,r,a,o){return Vp.draw(d,t,e,s,i,r,a,o)}const Xe={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function xf(d,t){if(!t)return;const e=t[2]-t[0],s=t[3]-t[1],i=new Path2D;i.rect(t[0],t[1],e,s),d.clip(i)}class rv{isModifyingCurrentTransform(){return!1}getPattern(){Ct("Abstract method ` getPattern ` called.")}}class nx extends rv{constructor(t){super(),this._type=t[1],this._bbox=t[2],this._colorStops=t[3],this._p0=t[4],this._p1=t[5],this._r0=t[6],this._r1=t[7],this.matrix=null}isOriginBased(){return this._p0[0]===0&&this._p0[1]===0&&(!this.isRadial()||this._p1[0]===0&&this._p1[1]===0)}isRadial(){return this._type==="radial"}areConic(){if(!this.isRadial())return!1;const t=Math.hypot(this._p0[0]-this._p1[0],this._p0[1]-this._p1[1]);return t+this._r1>this._r0&&t+this._r0>this._r1}_createGradient(t,e=null){let s,i=this._p0,r=this._p1;if(e&&(i=i.slice(),r=r.slice(),B.applyTransform(i,e),B.applyTransform(r,e)),this._type==="axial")s=t.createLinearGradient(i[0],i[1],r[0],r[1]);else if(this._type==="radial"){let a=this._r0,o=this._r1;if(e){const l=new Float32Array(2);B.singularValueDecompose2dScale(e,l),a*=l[0],o*=l[0]}s=t.createRadialGradient(i[0],i[1],a,r[0],r[1],o)}for(const a of this._colorStops)s.addColorStop(a[0],a[1]);return s}_createReversedGradient(t,e=null){let s=this._p1,i=this._p0;e&&(s=s.slice(),i=i.slice(),B.applyTransform(s,e),B.applyTransform(i,e));let r=this._r1,a=this._r0;if(e){const c=new Float32Array(2);B.singularValueDecompose2dScale(e,c),r*=c[0],a*=c[0]}const o=t.createRadialGradient(s[0],s[1],r,i[0],i[1],a),l=this._colorStops.map(([c,h])=>[1-c,h]).reverse();for(const[c,h]of l)o.addColorStop(c,h);return o}getPattern(t,e,s,i){let r;if(i===Xe.STROKE||i===Xe.FILL){if(this.isOriginBa
` ))||null;c&&this.data.comb&&(c=c.replaceAll(/ \s +/g,""));const h={userValue:o,formattedValue:c,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(s=document.createElement("textarea"),s.textContent=c??o,this.data.doNotScroll&&(s.style.overflowY="hidden")):(s=document.createElement("input"),s.type=this.data.password?"password":"text",s.setAttribute("value",c??o),this.data.doNotScroll&&(s.style.overflowX="hidden")),this.data.hasOwnCanvas&&(this.container.classList.add("hasOwnCanvas"),t.has(e)&&this.container.classList.add("sandboxModified")),kl.add(s),this.contentElement=s,s.setAttribute("data-element-id",e),s.disabled=this.data.readOnly,s.name=this.data.fieldName,s.tabIndex=0;const{datetimeFormat:u,datetimeType:f,timeStep:g}=this.data,y=!!f&&this.enableScripting;u&&(s.title=u),this._setRequired(s,this.data.required),l&&(s.maxLength=l),s.addEventListener("input",w=>{t.setValue(e,{value:w.target.value}),this.setPropertyOnSiblings(s,"value",w.target.value,"value"),h.formattedValue=null}),s.addEventListener("resetform",w=>{const S=this.data.defaultFieldValue??"";s.value=h.userValue=S,h.formattedValue=null});let b=w=>{const{formattedValue:S}=h;S!=null&&(w.target.value=S),w.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){s.addEventListener("focus",S=>{var A;if(h.focused)return;const{target:E}=S;if(y&&(E.type=f,g&&(E.step=g)),h.userValue){const C=h.userValue;if(y)if(f==="time"){const x=new Date(C),k=[x.getHours(),x.getMinutes(),x.getSeconds()];E.value=k.map(P=>P.toString().padStart(2,"0")).join(":")}else E.value=new Date(C-zx).toISOString().split(f==="date"?"T":".",1)[0];else E.value=C}h.lastCommittedValue=E.value,h.commitKey=1,(A=this.data.actions)!=null&&A.Focus||(h.focused=!0)}),s.addEventListener("updatefromsandbox",S=>{this.container.classList.add("sandboxModified");const E={value(A){h.userValue=A.detail.value??"",y||t.setValue(e,{value:h.userValue.toString()}),A.target.value=h.userValue},formattedValue(A){const{formattedValue:C}=A.detail;h.formattedValue=C,C!=null&&A.target!==document.activeElement&&(A.target.value=C);const x={formattedValue:C};y&&(x.value=C),t.setValue(e,x)},selRange(A){A.target.setSelectionRange(...A.detail.selRange)},charLimit:A=>{var P;const{charLimit:C}=A.detail,{target:x}=A;if(C===0){x.removeAttribute("maxLength");return}x.setAttribute("maxLength",C);let k=h.userValue;!k||k.length<=C||(k=k.slice(0,C),x.value=h.userValue=k,t.setValue(e,{value:k}),(P=this.linkService.eventBus)==null||P.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:k,willCommit:!0,commitKey:1,selStart:x.selectionStart,selEnd:x.selectionEnd}}))}};this._dispatchEventFromSandbox(E,S)}),s.addEventListener("keydown",S=>{var C;h.commitKey=1;let E=-1;if(S.key==="Escape"?E=0:S.key==="Enter"&&!this.data.multiLine?E=2:S.key==="Tab"&&(h.commitKey=3),E===-1)return;const{value:A}=S.target;h.lastCommittedValue!==A&&(h.lastCommittedValue=A,h.userValue=A,(C=this.linkService.eventBus)==null||C.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:A,willCommit:!0,commitKey:E,selStart:S.target.selectionStart,selEnd:S.target.selectionEnd}}))});const w=b;b=null,s.addEventListener("blur",S=>{var C,x;if(!h.focused||!S.relatedTarget)return;(C=this.data.actions)!=null&&C.Blur||(h.focused=!1);const{target:E}=S;let{value:A}=E;if(y){if(A&&f==="time"){const k=A.split(":").map(P=>parseInt(P,10));A=new Date(2e3,0,1,k[0],k[1],k[2]||0).valueOf(),E.step=""}else A.includes("T")||(A= ` $ { A } T00 : 00 ` ),A=new Date(A).valueOf();E.type="text"}h.userValue=A,h.lastCommittedValue!==A&&((x=this.linkService.eventBus)==null||x.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:A,willCommit:!0,commitKey:h.commitKey,selStart:S.target.selectionStart,selEnd:S.target.selectionEnd}})),w(S)}),(r=this.data.actions)!=null&&r.Keystroke&&s.addEventListener("beforeinput",S=>{var I;h.lastCommittedValue=null;const{data:E,target:A}=S,{value:C,selectionStart:x,selectionEnd:k}=A;let P=x,L=k;switch(S.inputType){case"deleteWordBackward":{const D=C.substring(0,x).match(/ \w * \W
` ))e.push({name:"span",value:r,attributes:i});return s},Yy=function(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||(t.key==="Enter"||t.key==="Escape"&&n(this,gn))&&v(this,vt,Df).call(this)},Ky=function(){if(n(this,ir)!==null)return;const{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:s,pageX:i,pageY:r}}}=n(this,Hc);let a=!!n(this,zc),o=a?n(this,zc):n(this,lu);for(const y of n(this,Qo))if(!o||B.intersect(y.data.rect,o)!==null){o=y.data.rect,a=!0;break}const l=B.normalizeRect([o[0],t[3]-o[1]+t[1],o[2],t[3]-o[3]+t[1]]),h=a?o[2]-o[0]+5:0,u=l[0]+h,f=l[1];p(this,ir,[100*(u-i)/e,100*(f-r)/s]);const{style:g}=n(this,ue);g.left= ` $ { n ( this , ir ) [ 0 ] } % ` ,g.top= ` $ { n ( this , ir ) [ 1 ] } % ` },Df=function(){if(n(this,Vs)){n(this,Vs).toggleCommentPopup(this,!1);return}p(this,gn,!n(this,gn)),n(this,gn)?(v(this,vt,Lf).call(this),n(this,ue).addEventListener("click",n(this, $ c)),n(this,ue).addEventListener("keydown",n(this,oa))):(v(this,vt,vm).call(this),n(this,ue).removeEventListener("click",n(this, $ c)),n(this,ue).removeEventListener("keydown",n(this,oa)))},Lf=function(){n(this,Gs)||this.render(),this.isVisible?n(this,gn)&&n(this,ue).classList.add("focused"):(v(this,vt,Ky).call(this),n(this,ue).hidden=!1,n(this,ue).style.zIndex=parseInt(n(this,ue).style.zIndex,10)+1e3)},vm=function(){n(this,ue).classList.remove("focused"),!(n(this,gn)||!this.isVisible)&&(n(this,ue).hidden=!0,n(this,ue).style.zIndex=parseInt(n(this,ue).style.zIndex,10)-1e3)};class Qy extends se{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=ct.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const t=this.contentElement=document.createElement("div");t.classList.add("annotationTextContent"),t.setAttribute("role","comment");for(const e of this.textContent){const s=document.createElement("span");s.textContent=e,t.append(s)}this.container.append(t)}return!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this._editOnDoubleClick(),this.container}}var cu;class Jx extends se{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});m(this,cu,null)}render(){this.container.classList.add("lineAnnotation");const{data:e,width:s,height:i}=this,r=this.svgFactory.create(s,i,!0),a=p(this,cu,this.svgFactory.createElement("svg:line"));return a.setAttribute("x1",e.rect[2]-e.lineCoordinates[0]),a.setAttribute("y1",e.rect[3]-e.lineCoordinates[1]),a.setAttribute("x2",e.rect[2]-e.lineCoordinates[2]),a.setAttribute("y2",e.rect[3]-e.lineCoordinates[3]),a.setAttribute("stroke-width",e.borderStyle.width||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),r.append(a),this.container.append(r),!e.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return n(this,cu)}addHighlightArea(){this.container.classList.add("highlightArea")}}cu=new WeakMap;var hu;class Zx extends se{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});m(this,hu,null)}render(){this.container.classList.add("squareAnnotation");const{data:e,width:s,height:i}=this,r=this.svgFactory.create(s,i,!0),a=e.borderStyle.width,o=p(this,hu,this.svgFactory.createElement("svg:rect"));return o.setAttribute("x",a/2),o.setAttribute("y",a/2),o.setAttribute("width",s-a),o.setAttribute("height",i-a),o.setAttribute("stroke-width",a||1),o.setAttribute("stroke","transparent"),o.setAttribute("fill","transparent"),r.append(o),this.container.append(r),!e.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return n(this,hu)}addHighlightArea(){this.container.classList.add("highlightArea")}}hu=new WeakMap;var du;class tE extends se{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});m(this,du,null)}render(){this.container.classList.add("circleAnnotation");const{data:e,width:s,height:i}=this,r=this.svgFactory.create(s,i,!0),a=e.borderStyle.width,o=p(this,du,this.svgFactory.createElement("svg:ellipse"));retur
2026-07-25 22:41:16 +08:00
` );if(!r)return;const a=window.getSelection();if(!a.rangeCount)return;this.editorDiv.normalize(),a.deleteFromDocument();const o=a.getRangeAt(0);if(!r.includes( `
2026-07-27 10:43:53 +08:00
` )){o.insertNode(document.createTextNode(r)),this.editorDiv.normalize(),a.collapseToStart();return}const{startContainer:l,startOffset:c}=o,h=[],u=[];if(l.nodeType===Node.TEXT_NODE){const S=l.parentElement;if(u.push(l.nodeValue.slice(c).replaceAll(af,"")),S!==this.editorDiv){let E=h;for(const A of this.editorDiv.childNodes){if(A===S){E=u;continue}E.push(v(b=Qt,wr,Nf).call(b,A))}}h.push(l.nodeValue.slice(0,c).replaceAll(af,""))}else if(l===this.editorDiv){let S=h,E=0;for(const A of this.editorDiv.childNodes)E++===c&&(S=u),S.push(v(w=Qt,wr,Nf).call(w,A))}p(this,js, ` $ { h . join ( `
2026-07-25 22:41:16 +08:00
` )} ${ r } ${ u . join ( `
2026-07-27 10:43:53 +08:00
` )} ` ) , v ( this , xe , Bf ) . call ( this ) ; const f = new Range ; let g = Math . sumPrecise ( h . map ( S => S . length ) ) ; for ( const { firstChild : S } of this . editorDiv . childNodes ) if ( S . nodeType === Node . TEXT _NODE ) { const E = S . nodeValue . length ; if ( g <= E ) { f . setStart ( S , g ) , f . setEnd ( S , g ) ; break } g -= E } a . removeAllRanges ( ) , a . addRange ( f ) } get contentDiv ( ) { return this . editorDiv } getPDFRect ( ) { const e = Qt . _internalPadding * this . parentScale ; return this . getRect ( e , e ) } static async deserialize ( e , s , i ) { var o ; let r = null ; if ( e instanceof Qy ) { const { data : { defaultAppearanceData : { fontSize : l , fontColor : c } , rect : h , rotation : u , id : f , popupRef : g , richText : y , contentsObj : b , creationDate : w , modificationDate : S } , textContent : E , textPosition : A , parent : { page : { pageNumber : C } } } = e ; if ( ! ( E != null && E . length ) ) return null ; r = e = { annotationType : ct . FREETEXT , color : Array . from ( c ) , fontSize : l , value : E . join ( `
` ),position:A,pageIndex:C-1,rect:h.slice(0),rotation:u,annotationElementId:f,id:f,deleted:!1,popupRef:g,comment:(b==null?void 0:b.str)||null,richText:y,creationDate:w,modificationDate:S}}const a=await super.deserialize(e,s,i);return p(a,Ws,e.fontSize),a.color=B.makeHexColor(...e.color),p(a,js,v(o=Qt,wr,xm).call(o,e.value)),a._initialData=r,e.comment&&a.setCommentData(e),a}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const s=Mt._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.color),i=Object.assign(super.serialize(e),{color:s,fontSize:n(this,Ws),value:v(this,xe,a0).call(this)});return this.addComment(i),e?(i.isCopy=!0,i):this.annotationElementId&&!v(this,xe,o0).call(this,i)?null:(i.id=this.annotationElementId,i)}renderAnnotationElement(e){const s=super.renderAnnotationElement(e);if(!s)return null;const{style:i}=s;i.fontSize= ` calc ( $ { n ( this , Ws ) } px * var ( -- total - scale - factor ) ) ` ,i.color=this.color,s.replaceChildren();for(const r of n(this,js).split( `
` )){const a=document.createElement("div");a.append(r?document.createTextNode(r):document.createElement("br")),s.append(a)}return e.updateEdited({rect:this.getPDFRect(),popup:this._uiManager.hasCommentManager()||this.hasEditedComment?this.comment:{text:n(this,js)}}),s}resetAnnotationElement(e){super.resetAnnotationElement(e),e.resetEdited()}};js=new WeakMap,yu=new WeakMap,il=new WeakMap,Ws=new WeakMap,xe=new WeakSet,i0=function(e){const s=r=>{this.editorDiv.style.fontSize= ` calc ( $ { r } px * var ( -- total - scale - factor ) ) ` ,this.translate(0,-(r-n(this,Ws))*this.parentScale),p(this,Ws,r),v(this,xe,Rf).call(this)},i=n(this,Ws);this.addCommands({cmd:s.bind(this,e),undo:s.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:pt.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},n0=function(e){const s=r=>{this.color=r,this.onUpdatedColor()},i=this.color;this.addCommands({cmd:s.bind(this,e),undo:s.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:pt.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},r0=function(){var i;const e=[];this.editorDiv.normalize();let s=null;for(const r of this.editorDiv.childNodes)(s==null?void 0:s.nodeType)===Node.TEXT_NODE&&r.nodeName==="BR"||(e.push(v(i=Qt,wr,Nf).call(i,r)),s=r);return e.join( `
2026-07-27 09:12:03 +08:00
` )},Rf=function(){const[e,s]=this.parentDimensions;let i;if(this.isAttachedToDOM)i=this.div.getBoundingClientRect();else{const{currentLayer:r,div:a}=this,o=a.style.display,l=a.classList.contains("hidden");a.classList.remove("hidden"),a.style.display="hidden",r.div.append(this.div),i=a.getBoundingClientRect(),a.remove(),a.style.display=o,a.classList.toggle("hidden",l)}this.rotation%180===this.parentRotation%180?(this.width=i.width/e,this.height=i.height/s):(this.width=i.height/e,this.height=i.width/s),this.fixAndSetPosition()},wr=new WeakSet,Nf=function(e){return(e.nodeType===Node.TEXT_NODE?e.nodeValue:e.innerText).replaceAll(af,"")},Bf=function(){if(this.editorDiv.replaceChildren(),!!n(this,js))for(const e of n(this,js).split( `
2026-07-27 10:43:53 +08:00
` )){const s=document.createElement("div");s.append(e?document.createTextNode(e):document.createElement("br")),this.editorDiv.append(s)}},a0=function(){return n(this,js).replaceAll(" "," ")},xm=function(e){return e.replaceAll(" "," ")},o0=function(e){const{value:s,fontSize:i,color:r,pageIndex:a}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||e.value!==s||e.fontSize!==i||e.color.some((o,l)=>o!==r[l])||e.pageIndex!==a},m(Qt,wr),M(Qt,"_freeTextDefaultContent",""),M(Qt,"_internalPadding",0),M(Qt,"_defaultColor",null),M(Qt,"_defaultFontSize",10),M(Qt,"_type","freetext"),M(Qt,"_editorType",ct.FREETEXT);let Sm=Qt;class q{toSVGPath(){Ct("Abstract method ` toSVGPath ` must be implemented.")}get box(){Ct("Abstract getter ` box ` must be implemented.")}serialize(t,e){Ct("Abstract method ` serialize ` must be implemented.")}static _rescale(t,e,s,i,r,a){a||(a=new Float32Array(t.length));for(let o=0,l=t.length;o<l;o+=2)a[o]=e+t[o]*i,a[o+1]=s+t[o+1]*r;return a}static _rescaleAndSwap(t,e,s,i,r,a){a||(a=new Float32Array(t.length));for(let o=0,l=t.length;o<l;o+=2)a[o]=e+t[o+1]*i,a[o+1]=s+t[o]*r;return a}static _translate(t,e,s,i){i||(i=new Float32Array(t.length));for(let r=0,a=t.length;r<a;r+=2)i[r]=e+t[r],i[r+1]=s+t[r+1];return i}static svgRound(t){return Math.round(t*1e4)}static _normalizePoint(t,e,s,i,r){switch(r){case 90:return[1-e/s,t/i];case 180:return[1-t/s,1-e/i];case 270:return[e/s,1-t/i];default:return[t/s,e/i]}}static createBezierPoints(t,e,s,i,r,a){return[(t+5*s)/6,(e+5*i)/6,(5*s+r)/6,(5*i+a)/6,(s+r)/2,(i+a)/2]}}M(q,"PRECISION",1e-4);var Xs,zi,Wc,Xc,mn,bt,nl,rl,wu,Au,qc,Yc,fa,Su,Pp,Mp,_e,Hh,l0,c0,h0,d0,u0,f0;const Dn=class Dn{constructor({x:t,y:e},s,i,r,a,o=0){m(this,_e);m(this,Xs);m(this,zi,[]);m(this,Wc);m(this,Xc);m(this,mn,[]);m(this,bt,new Float32Array(18));m(this,nl);m(this,rl);m(this,wu);m(this,Au);m(this,qc);m(this,Yc);m(this,fa,[]);p(this,Xs,s),p(this,Yc,r*i),p(this,Xc,a),n(this,bt).set([NaN,NaN,NaN,NaN,t,e],6),p(this,Wc,o),p(this,Au,n(Dn,Su)*i),p(this,wu,n(Dn,Mp)*i),p(this,qc,i),n(this,fa).push(t,e)}isEmpty(){return isNaN(n(this,bt)[8])}add({x:t,y:e}){var I;p(this,nl,t),p(this,rl,e);const[s,i,r,a]=n(this,Xs);let[o,l,c,h]=n(this,bt).subarray(8,12);const u=t-c,f=e-h,g=Math.hypot(u,f);if(g<n(this,wu))return!1;const y=g-n(this,Au),b=y/g,w=b*u,S=b*f;let E=o,A=l;o=c,l=h,c+=w,h+=S,(I=n(this,fa))==null||I.push(t,e);const C=-S/y,x=w/y,k=C*n(this,Yc),P=x*n(this,Yc);return n(this,bt).set(n(this,bt).subarray(2,8),0),n(this,bt).set([c+k,h+P],4),n(this,bt).set(n(this,bt).subarray(14,18),12),n(this,bt).set([c-k,h-P],16),isNaN(n(this,bt)[6])?(n(this,mn).length===0&&(n(this,bt).set([o+k,l+P],2),n(this,mn).push(NaN,NaN,NaN,NaN,(o+k-s)/r,(l+P-i)/a),n(this,bt).set([o-k,l-P],14),n(this,zi).push(NaN,NaN,NaN,NaN,(o-k-s)/r,(l-P-i)/a)),n(this,bt).set([E,A,o,l,c,h],6),!this.isEmpty()):(n(this,bt).set([E,A,o,l,c,h],6),Math.abs(Math.atan2(A-l,E-o)-Math.atan2(S,w))<Math.PI/2?([o,l,c,h]=n(this,bt).subarray(2,6),n(this,mn).push(NaN,NaN,NaN,NaN,((o+c)/2-s)/r,((l+h)/2-i)/a),[o,l,E,A]=n(this,bt).subarray(14,18),n(this,zi).push(NaN,NaN,NaN,NaN,((E+o)/2-s)/r,((A+l)/2-i)/a),!0):([E,A,o,l,c,h]=n(this,bt).subarray(0,6),n(this,mn).push(((E+5*o)/6-s)/r,((A+5*l)/6-i)/a,((5*o+c)/6-s)/r,((5*l+h)/6-i)/a,((o+c)/2-s)/r,((l+h)/2-i)/a),[c,h,o,l,E,A]=n(this,bt).subarray(12,18),n(this,zi).push(((E+5*o)/6-s)/r,((A+5*l)/6-i)/a,((5*o+c)/6-s)/r,((5*l+h)/6-i)/a,((o+c)/2-s)/r,((l+h)/2-i)/a),!0))}toSVGPath(){if(this.isEmpty())return"";const t=n(this,mn),e=n(this,zi);if(isNaN(n(this,bt)[6])&&!this.isEmpty())return v(this,_e,l0).call(this);const s=[];s.push( ` M$ { t [ 4 ] } $ { t [ 5 ] } ` );for(let i=6;i<t.length;i+=6)isNaN(t[i])?s.push( ` L$ { t [ i + 4 ] } $ { t [ i + 5 ] } ` ):s.push( ` C$ { t [ i ] } $ { t [ i + 1 ] } $ { t [ i + 2 ] } $ { t [ i + 3 ] } $ { t [ i + 4 ] } $ { t [ i + 5 ] } ` );v(this,_e,h0).call(this,s);for(let i=e.length-6;i>=6;i-=6)isNaN(e[i])?s.push( ` L$ { e [ i + 4 ] } $ { e [ i + 5 ] } ` ):s.push( ` C$ { e [ i ] } $ { e [ i + 1 ] } $ { e [ i + 2 ] } $ { e [ i + 3 ] } $ { e [ i + 4 ] } $ { e [ i + 5 ] } ` );return v(this,_e,c0).call(this,s),s.join(" ")}newFreeDrawOutline(t,e,s,i,r,a){return new p0(t,e,s,i,r,a)}getOutlines(){var u;const t=n(this,mn),e=n(this,zi),s=n(this,bt),[i,r,a,o]=n
` );function LE(d){const t=d.split( `
` );let e=0;return t.map((s,i)=>{const r=e,a=r+s.length;return e=a+(i<t.length-1?1:0),{number:i+1,content:s,start:r,end:a}})}function nb(d){var t;return((t=d.match(/[ \u 3400- \u 4dbf \u 4e00- \u 9fff]|[A-Za-z0-9_]+|[^ \s ]/gu))==null?void 0:t.length)??0}const FE={class:"preview-step"},OE={class:"preview-file-switcher"},RE={class:"file-switcher-control"},NE={class:"file-option"},BE=["title"], $ E={key:0},UE={class:"file-switcher-summary"},HE={class:"preview-workspace"},zE={class:"source-pane"},VE={class:"pane-header"},GE=["data-source-start"],jE={class:"line-number"},WE={class:"line-content"},XE={class:"preview-pane"},qE={class:"pane-header"},YE={class:"pane-header-actions"},KE={class:"preview-toolbar"},QE={class:"preview-list","aria-label":"预览条目列表"},JE=["data-preview-id","aria-selected","onClick","onKeydown"],ZE={class:"item-name"},tC={class:"item-source"},eC={class:"item-actions"},sC={key:0,class:"empty-result"},iC={key:1,class:"preview-editor"},nC={class:"editor-heading"},rC={class:"editor-actions"},xh=10,aC=Ci({__name:"PreviewCompareStep",props:{sourceText:{},items:{},selectedId:{},processType:{},fileName:{},taskId:{},sourceFileId:{},files:{},selectedFileId:{}},emits:["update:selectedId","update:selectedFileId","update:item-content","restore:item","add:item","remove:item"],setup(d,{emit:t}){const e=d,s=t,i=et(null),r=et(""),a=et(1),o=et(null),l=et(""),c=rt(()=>LE(e.sourceText)),h=rt(()=>e.items.find(I=>I.id===e.selectedId)??e.items[0]),u=rt(()=>e.items.find(I=>I.id===o.value)),f=rt(()=>/ \. pdf $ /i.test(e.fileName)),g=rt(()=>e.items.filter((I,D)=>!r.value.trim()||I.editedContent.toLowerCase().includes(r.value.trim().toLowerCase())||String(D+1).includes(r.value.trim()))),y=rt(()=>{const I=(a.value-1)*xh;return g.value.slice(I,I+xh)});function b(I,D){const O=h.value;return!O||O.sourceStart==null||O.sourceEnd==null?!1:D>=O.sourceStart&&I<=O.sourceEnd}function w(I){s("update:selectedId",I)}function S(I){w(I.id),o.value=I.id,l.value=I.editedContent}function E(){o.value=null,l.value=""}function A(){u.value&&(s("update:item-content",u.value.id,l.value),E())}function C(){u.value&&(s("restore:item",u.value.id),E())}function x(I){w(I.id),s("remove:item",I.id)}function k(){E()}Si(r,()=>{a.value=1,E()}),Si(()=>e.selectedFileId,E),Si(h,async I=>{var W,Q;if(!I)return;const D=g.value.findIndex(Y=>Y.id===I.id);if(D>=0&&(a.value=Math.floor(D/xh)+1),f.value||I.sourceStart==null)return;await Kh();const O=((W=i.value)==null?void 0:W.querySelector( ` [ data - source - start = "${I.sourceStart}" ] ` ))??((Q=i.value)==null?void 0:Q.querySelector(".source-line.is-highlighted"));O==null||O.scrollIntoView({block:"center",behavior:"smooth"})},{immediate:!0});function P(I){return e.items.findIndex(D=>D.id===I.id)+1}function L(I){var D;if((D=I.sourcePages)!=null&&D.length){const O=I.sourcePages[0],W=I.sourcePages[I.sourcePages.length-1];return O===W? ` 来源 : 第 $ { O } 页 ` : ` 来源 : 第 $ { O } – $ { W } 页 ` }return I.sourceStartLine==null||I.sourceEndLine==null?"手动新增,无源文件定位":I.sourceStartLine===I.sourceEndLine? ` 来源 : 第 $ { I . sourceStartLine } 行 ` : ` 来源 : 第 $ { I . sourceStartLine } – $ { I . sourceEndLine } 行 ` }return(I,D)=>{const O=Np,W=Rp,Q=zu,Y=Vu,yt=pb;return R(), $ ("section",FE,[_("div",OE,[_("div",RE,[D[5]||(D[5]=_("span",null,"当前文件",-1)),H(W,{"model-value":d.selectedFileId,filterable:"",placeholder:"选择文件","aria-label":"选择当前预览文件","onUpdate:modelValue":D[0]||(D[0]=T=>s("update:selectedFileId",T))},{default:J(()=>[(R(!0), $ (Ae,null,ii(d.files,T=>(R(),Ut(O,{key:T.id,label:T.name,value:T.id},{default:J(()=>[_("div",NE,[_("strong",{title:T.name},X(T.name),9,BE),_("span",null,X(T.count.toLocaleString())+" "+X(d.processType==="unstructured"?"个切片":"条记录"),1),T.modifiedCount?(R(), $ ("em", $ E,X(T.modifiedCount)+" 处已修改",1)):ft("",!0)])]),_:2},1032,["label","value"]))),128))]),_:1},8,["model-value"])]),_("span",UE,X(d.files.length)+" 个文件 · 当前文件 "+X(d.items.length.toLocaleString())+" "+X(d.processType==="unstructured"?"个切片":"条记录"),1)]),_("div",HE,[_("div",zE,[_("div",VE,[_("div",