Files
YG_FT/frontend/dist/assets/DataProcessCreateView-BRcOeTl0.js

58 lines
563 KiB
JavaScript
Raw Normal View History

var Sw=Object.defineProperty;var kv=d=>{throw TypeError(d)};var xw=(d,t,e)=>t in d?Sw(d,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):d[t]=e;var M=(d,t,e)=>xw(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),b=(d,t,e)=>(sg(d,t,"access private method"),e);var Yt=(d,t,e,s)=>({set _(i){p(d,t,i,e)},get _(){return n(d,t,s)}});import{E as Ew}from"./el-alert-B637c0uD.js";import{E as zu}from"./index-Cjkm461c.js";import{v as Cw}from"./directive-3LS7MhIx.js";import{d as Ci,o as O,c as $,q as C,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 Jt,A as gt,y as et,D as Si,H as cb,al as _w,aQ as kw,P as Kh,t as Tv,aL as ig,z as pg,ac as Tw,ag as Pw,aR as Mw,G as Iw,K as Dw,aB as Lw,v as Fw}from"./index-Bm7iyT19.js";import{A as Ow}from"./AppConfirmDialog-BAR6Fcz5.js";import{E as hb,a as db}from"./el-form-item-CvynSJxV.js";import{E as Vu}from"./index-DkR6LwTE.js";import{a as ub,E as Op}from"./el-checkbox-DL0-Fc2V.js";import{E as Gu}from"./el-input-number-C_rkeoCF.js";/* empty css */import{_ as _i}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{E as Rp,a as Np}from"./el-select-Coy48hrs.js";import{E as Rw}from"./el-slider-CYB529Rf.js";import{E as Nw}from"./el-switch-Lxp3gGtG.js";import"./el-popper-Cx0_J9GF.js";import"./el-tooltip-l0sNRNKZ.js";import"./el-scrollbar-D_ynOLJk.js";import{E as Bw}from"./el-tag--a5NWggH.js";import{E as fb}from"./el-pagination-Dtfv9w97.js";import{E as pb}from"./el-progress-Db4p3tIZ.js";import{E as $w}from"./el-upload-CPMQ5OT8.js";import{a as Uw,b as Hw,s as zw,c as Vw,r as Gw,u as jw,e as Ww,f as Pv,h as Xw,i as qw,j as Qm,k as ng,l as Yw,m as Jf,n as Kw,o as Qw,p as Jw,t as Zw,q as tA,v as eA,w as sA,x as iA}from"./dataProcess-DADxPp-0.js";import{u as nA}from"./models-CwRHbDay.js";import"./vnode-KYqNCiXT.js";import"./castArray-LORF7MNS.js";import"./_baseClone-BzWWMdsQ.js";import"./raf-B86d7yy1.js";import"./index-CP_NuSEU.js";import"./index-BKWXQsZE.js";import"./omit-C0nBouSp.js";import"./index-B9bly9PZ.js";import"./index-By4X7YdR.js";import"./index-DqqhIvOh.js";import"./scroll-D4HR_BvE.js";import"./clamp-DAwVuIno.js";import"./toNumber-DuDzSiiX.js";import"./_baseIteratee-Dbf0v8f3.js";import"./debounce-CMsC3AHY.js";import"./validator-Da8o9DBV.js";import"./model-CKKbc1oX.js";const Sl={min:1,max:50};function Jm(d,t=1){const e=Number(d),s=Number.isFinite(e)?Math.trunc(e):t;return Math.min(Sl.max,Math.max(Sl.min,s))}const rA={class:"generation-option-row dataset-split-row"},aA={class:"dataset-split-config"},oA={class:"dataset-split-grid"},lA={class:"dataset-split-field"},cA={class:"dataset-split-input"},hA={class:"dataset-split-field"},dA={class:"dataset-split-input"},uA={class:"dataset-split-field"},fA={class:"dataset-split-input"},pA={key:0,role:"alert"},gA=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 O(),$("div",rA,[l[9]||(l[9]=C("div",{class:"generation-option-copy"},[C("strong",null,"数据集划分"),C("small",null,"按比例将生成后的问答对随机划分为训练集、验证集和测试集")],-1)),C("div",aA,[C("div",oA,[C("label",lA,[l[4]||(l[4]=C("span",null,"训练集",-1)),C("span",cA,[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]=C("span",null,"%",-1))])]),C("label",hA,[l[6]||(l[6]=C("span",null,"验证集",-1)),C("span"
`).join("")}}kr=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 g1(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 Xt(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 xl(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 m1{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 v1{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 b1(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
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);
}
`;var wp,qn,Eo,yc,Ap,my;class Y1{constructor(){m(this,Ap);m(this,wp,null);m(this,qn,null);m(this,Eo,null);m(this,yc,null)}init(){return n(this,wp)||p(this,wp,b(this,Ap,my).call(this))}get isReady(){return n(this,qn)!==null}loadMeshShader(){if(!n(this,qn)||n(this,Eo))return;const t=n(this,qn).createShaderModule({code:q1});p(this,Eo,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,yc)}]},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 v=c.createBuffer({size:Math.max(e.byteLength,4),usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST});e.byteLength>0&&c.queue.writeBuffer(v,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,Eo).getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:w}}]}),x=new OffscreenCanvas(a,o),A=x.getContext("webgpu");A.configure({device:c,format:n(this,yc),alphaMode:r?"opaque":"premultiplied"});const _=r?{r:r[0]/255,g:r[1]/255,b:r[2]/255,a:1}:{r:0,g:0,b:0,a:0},E=c.createCommandEncoder(),k=E.beginRenderPass({colorAttachments:[{view:A.getCurrentTexture().createView(),clearValue:_,loadOp:"clear",storeOp:"store"}]});return s>0&&(k.setPipeline(n(this,Eo)),k.setBindGroup(0,S),k.setVertexBuffer(0,y),k.setVertexBuffer(1,v),k.draw(s)),k.end(),c.queue.submit([E.finish()]),y.destroy(),v.destroy(),w.destroy(),x.transferToImageBitmap()}}wp=new WeakMap,qn=new WeakMap,Eo=new WeakMap,yc=new WeakMap,Ap=new WeakSet,my=async function(){var t;if(!((t=globalThis.navigator)!=null&&t.gpu))return!1;try{const e=await navigator.gpu.requestAdapter();return e?(p(this,yc,navigator.gpu.getPreferredCanvasFormat()),p(this,qn,await e.requestDevice()),!0):!1}catch{return!1}};const Vp=new Y1;function K1(){return Vp.init()}function Q1(){return Vp.isReady}function J1(){Vp.loadMeshShader()}function Z1(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 tx 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")),_l.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 v=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:x}=S;if(y&&(x.type=f,g&&(x.step=g)),h.userValue){const _=h.userValue;if(y)if(f==="time"){const E=new Date(_),k=[E.getHours(),E.getMinutes(),E.getSeconds()];x.value=k.map(P=>P.toString().padStart(2,"0")).join(":")}else x.value=new Date(_-Bx).toISOString().split(f==="date"?"T":".",1)[0];else x.value=_}h.lastCommittedValue=x.value,h.commitKey=1,(A=this.data.actions)!=null&&A.Focus||(h.focused=!0)}),s.addEventListener("updatefromsandbox",S=>{this.container.classList.add("sandboxModified");const x={value(A){h.userValue=A.detail.value??"",y||t.setValue(e,{value:h.userValue.toString()}),A.target.value=h.userValue},formattedValue(A){const{formattedValue:_}=A.detail;h.formattedValue=_,_!=null&&A.target!==document.activeElement&&(A.target.value=_);const E={formattedValue:_};y&&(E.value=_),t.setValue(e,E)},selRange(A){A.target.setSelectionRange(...A.detail.selRange)},charLimit:A=>{var P;const{charLimit:_}=A.detail,{target:E}=A;if(_===0){E.removeAttribute("maxLength");return}E.setAttribute("maxLength",_);let k=h.userValue;!k||k.length<=_||(k=k.slice(0,_),E.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:E.selectionStart,selEnd:E.selectionEnd}}))}};this._dispatchEventFromSandbox(x,S)}),s.addEventListener("keydown",S=>{var _;h.commitKey=1;let x=-1;if(S.key==="Escape"?x=0:S.key==="Enter"&&!this.data.multiLine?x=2:S.key==="Tab"&&(h.commitKey=3),x===-1)return;const{value:A}=S.target;h.lastCommittedValue!==A&&(h.lastCommittedValue=A,h.userValue=A,(_=this.linkService.eventBus)==null||_.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:A,willCommit:!0,commitKey:x,selStart:S.target.selectionStart,selEnd:S.target.selectionEnd}}))});const w=v;v=null,s.addEventListener("blur",S=>{var _,E;if(!h.focused||!S.relatedTarget)return;(_=this.data.actions)!=null&&_.Blur||(h.focused=!1);const{target:x}=S;let{value:A}=x;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(),x.step=""}else A.includes("T")||(A=`${A}T00:00`),A=new Date(A).valueOf();x.type="text"}h.userValue=A,h.lastCommittedValue!==A&&((E=this.linkService.eventBus)==null||E.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:x,target:A}=S,{value:_,selectionStart:E,selectionEnd:k}=A;let P=E,L=k;switch(S.inputType){case"deleteWordBackward":{const D=_.substring(0,E).match(/\w*\W
`))e.push({name:"span",value:r,attributes:i});return s},qy=function(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||(t.key==="Enter"||t.key==="Escape"&&n(this,gn))&&b(this,vt,Df).call(this)},Yy=function(){if(n(this,ir)!==null)return;const{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:s,pageX:i,pageY:r}}}=n(this,Uc);let a=!!n(this,Hc),o=a?n(this,Hc):n(this,lu);for(const y of n(this,Ko))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)?(b(this,vt,Lf).call(this),n(this,ue).addEventListener("click",n(this,Bc)),n(this,ue).addEventListener("keydown",n(this,aa))):(b(this,vt,vm).call(this),n(this,ue).removeEventListener("click",n(this,Bc)),n(this,ue).removeEventListener("keydown",n(this,aa)))},Lf=function(){n(this,Gs)||this.render(),this.isVisible?n(this,gn)&&n(this,ue).classList.add("focused"):(b(this,vt,Yy).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 Ky 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 qx 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 Yx 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 Kx 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
`);if(!r)return;const a=window.getSelection();if(!a.rangeCount)return;this.editorDiv.normalize(),a.deleteFromDocument();const o=a.getRangeAt(0);if(!r.includes(`
`)){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 x=h;for(const A of this.editorDiv.childNodes){if(A===S){x=u;continue}x.push(b(v=Kt,wr,Nf).call(v,A))}}h.push(l.nodeValue.slice(0,c).replaceAll(af,""))}else if(l===this.editorDiv){let S=h,x=0;for(const A of this.editorDiv.childNodes)x++===c&&(S=u),S.push(b(w=Kt,wr,Nf).call(w,A))}p(this,js,`${h.join(`
`)}${r}${u.join(`
`)}`),b(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 x=S.nodeValue.length;if(g<=x){f.setStart(S,g),f.setEnd(S,g);break}g-=x}a.removeAllRanges(),a.addRange(f)}get contentDiv(){return this.editorDiv}getPDFRect(){const e=Kt._internalPadding*this.parentScale;return this.getRect(e,e)}static async deserialize(e,s,i){var o;let r=null;if(e instanceof Ky){const{data:{defaultAppearanceData:{fontSize:l,fontColor:c},rect:h,rotation:u,id:f,popupRef:g,richText:y,contentsObj:v,creationDate:w,modificationDate:S},textContent:x,textPosition:A,parent:{page:{pageNumber:_}}}=e;if(!(x!=null&&x.length))return null;r=e={annotationType:ct.FREETEXT,color:Array.from(c),fontSize:l,value:x.join(`
`),position:A,pageIndex:_-1,rect:h.slice(0),rotation:u,annotationElementId:f,id:f,deleted:!1,popupRef:g,comment:(v==null?void 0:v.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,b(o=Kt,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:b(this,xe,r0).call(this)});return this.addComment(i),e?(i.isCopy=!0,i):this.annotationElementId&&!b(this,xe,a0).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,sl=new WeakMap,Ws=new WeakMap,xe=new WeakSet,s0=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),b(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})},i0=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})},n0=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(b(i=Kt,wr,Nf).call(i,r)),s=r);return e.join(`
`)},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(`
`)){const s=document.createElement("div");s.append(e?document.createTextNode(e):document.createElement("br")),this.editorDiv.append(s)}},r0=function(){return n(this,js).replaceAll(" "," ")},xm=function(e){return e.replaceAll(" "," ")},a0=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(Kt,wr),M(Kt,"_freeTextDefaultContent",""),M(Kt,"_internalPadding",0),M(Kt,"_defaultColor",null),M(Kt,"_defaultFontSize",10),M(Kt,"_type","freetext"),M(Kt,"_editorType",ct.FREETEXT);let Sm=Kt;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,jc,Wc,mn,bt,il,nl,wu,Au,Xc,qc,ua,Su,Pp,Mp,_e,Hh,o0,l0,c0,h0,d0,u0;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,jc);m(this,Wc);m(this,mn,[]);m(this,bt,new Float32Array(18));m(this,il);m(this,nl);m(this,wu);m(this,Au);m(this,Xc);m(this,qc);m(this,ua,[]);p(this,Xs,s),p(this,qc,r*i),p(this,Wc,a),n(this,bt).set([NaN,NaN,NaN,NaN,t,e],6),p(this,jc,o),p(this,Au,n(Dn,Su)*i),p(this,wu,n(Dn,Mp)*i),p(this,Xc,i),n(this,ua).push(t,e)}isEmpty(){return isNaN(n(this,bt)[8])}add({x:t,y:e}){var I;p(this,il,t),p(this,nl,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),v=y/g,w=v*u,S=v*f;let x=o,A=l;o=c,l=h,c+=w,h+=S,(I=n(this,ua))==null||I.push(t,e);const _=-S/y,E=w/y,k=_*n(this,qc),P=E*n(this,qc);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([x,A,o,l,c,h],6),!this.isEmpty()):(n(this,bt).set([x,A,o,l,c,h],6),Math.abs(Math.atan2(A-l,x-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,x,A]=n(this,bt).subarray(14,18),n(this,zi).push(NaN,NaN,NaN,NaN,((x+o)/2-s)/r,((A+l)/2-i)/a),!0):([x,A,o,l,c,h]=n(this,bt).subarray(0,6),n(this,mn).push(((x+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,x,A]=n(this,bt).subarray(12,18),n(this,zi).push(((x+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 b(this,_e,o0).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]}`);b(this,_e,c0).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 b(this,_e,l0).call(this,s),s.join(" ")}newFreeDrawOutline(t,e,s,i,r,a){return new f0(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 PE(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(/[\u3400-\u4dbf\u4e00-\u9fff]|[A-Za-z0-9_]+|[^\s]/gu))==null?void 0:t.length)??0}const ME={class:"preview-step"},IE={class:"preview-file-switcher"},DE={class:"file-switcher-control"},LE={class:"file-option"},FE=["title"],OE={key:0},RE={class:"file-switcher-summary"},NE={class:"preview-workspace"},BE={class:"source-pane"},$E={class:"pane-header"},UE=["data-source-start"],HE={class:"line-number"},zE={class:"line-content"},VE={class:"preview-pane"},GE={class:"pane-header"},jE={class:"pane-header-actions"},WE={class:"preview-toolbar"},XE={class:"preview-list","aria-label":"预览条目列表"},qE=["data-preview-id","aria-selected","onClick","onKeydown"],YE={class:"item-name"},KE={class:"item-source"},QE={class:"item-actions"},JE={key:0,class:"empty-result"},ZE={key:1,class:"preview-editor"},tC={class:"editor-heading"},eC={class:"editor-actions"},xh=10,sC=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(()=>PE(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 v(I,D){const R=h.value;return!R||R.sourceStart==null||R.sourceEnd==null?!1:D>=R.sourceStart&&I<=R.sourceEnd}function w(I){s("update:selectedId",I)}function S(I){w(I.id),o.value=I.id,l.value=I.editedContent}function x(){o.value=null,l.value=""}function A(){u.value&&(s("update:item-content",u.value.id,l.value),x())}function _(){u.value&&(s("restore:item",u.value.id),x())}function E(I){w(I.id),s("remove:item",I.id)}function k(){x()}Si(r,()=>{a.value=1,x()}),Si(()=>e.selectedFileId,x),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 R=((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"));R==null||R.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 R=I.sourcePages[0],W=I.sourcePages[I.sourcePages.length-1];return R===W?`来源 ${R} `:`来源 ${R}${W} `}return I.sourceStartLine==null||I.sourceEndLine==null?"手动新增,无源文件定位":I.sourceStartLine===I.sourceEndLine?`来源 ${I.sourceStartLine} `:`来源 ${I.sourceStartLine}${I.sourceEndLine} `}return(I,D)=>{const R=Np,W=Rp,Q=zu,Y=Vu,yt=fb;return O(),$("section",ME,[C("div",IE,[C("div",DE,[D[5]||(D[5]=C("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(()=>[(O(!0),$(Ae,null,ii(d.files,T=>(O(),Ut(R,{key:T.id,label:T.name,value:T.id},{default:J(()=>[C("div",LE,[C("strong",{title:T.name},X(T.name),9,FE),C("span",null,X(T.count.toLocaleString())+" "+X(d.processType==="unstructured"?"个切片":"条记录"),1),T.modifiedCount?(O(),$("em",OE,X(T.modifiedCount)+" 处已修改",1)):ft("",!0)])]),_:2},1032,["label","value"]))),128))]),_:1},8,["model-value"])]),C("span",RE,X(d.files.length)+" 个文件 · 当前文件 "+X(d.items.length.toLocaleString())+" "+X(d.processType==="unstructured"?"个切片":"条记录"),1)]),C("div",NE,[C("div",BE,[C("div",$E,[C("div",