template-designer 0.2.1 → 0.2.2

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.
@@ -270,6 +270,36 @@ const e = {
270
270
  default: "transparent"
271
271
  }
272
272
  ]
273
+ },
274
+ image: {
275
+ width: 12,
276
+ height: 12,
277
+ rotation: 0,
278
+ lockAspectRatio: !1,
279
+ propertyPanel: [
280
+ { prop: "ImageSrc", label: "图片地址", type: "file", accept: "image/*", default: "" },
281
+ {
282
+ prop: "ScaleMode",
283
+ label: "图片缩放",
284
+ type: "select",
285
+ options: [
286
+ { label: "原始尺寸", value: 1 },
287
+ { label: "居中裁剪", value: 2 },
288
+ { label: "填充", value: 3 }
289
+ ],
290
+ default: 1
291
+ },
292
+ {
293
+ prop: "IsPrint",
294
+ label: "是否打印",
295
+ type: "select",
296
+ options: [
297
+ { label: "是", value: !0 },
298
+ { label: "否", value: !1 }
299
+ ],
300
+ default: !0
301
+ }
302
+ ]
273
303
  }
274
304
  };
275
305
  export {
@@ -6747,7 +6747,7 @@ const zw = /* @__PURE__ */ RA(Lw, [["render", Yw]]), bc = [
6747
6747
  ], Hc = bc.flatMap((e) => e.components);
6748
6748
  async function jw(e) {
6749
6749
  try {
6750
- return (await ed(/* @__PURE__ */ Object.assign({ "./props/lodop.js": () => import("./lodop-25ec3af8.mjs"), "./props/rfid.js": () => import("./rfid-b84da009.mjs") }), `./props/${e}.js`)).default;
6750
+ return (await ed(/* @__PURE__ */ Object.assign({ "./props/lodop.js": () => import("./lodop-25ec3af8.mjs"), "./props/rfid.js": () => import("./rfid-ac52a396.mjs") }), `./props/${e}.js`)).default;
6751
6751
  } catch {
6752
6752
  return console.warn(`配置文件 ./props/${e}.js 不存在,使用默认配置`), (await import("./lodop-25ec3af8.mjs")).default;
6753
6753
  }
@@ -56,4 +56,4 @@ Minimum version required to store current data is: `+a+`.
56
56
  content: "" !important;
57
57
  display: none !important;
58
58
  }`,cy=function(e){dy(e,"."+Wa+iy+Gc+`
59
- .`+Da+sy+Gc)},dy=function(e,A){var t=e.ownerDocument;if(t){var r=t.createElement("style");r.textContent=A,e.appendChild(r)}},Yc=function(){function e(){}return e.getOrigin=function(A){var t=e._link;return t?(t.href=A,t.href=t.href,t.protocol+t.hostname+t.port):"about:blank"},e.isSameOrigin=function(A){return e.getOrigin(A)===e._origin},e.setContext=function(A){e._link=A.document.createElement("a"),e._origin=e.getOrigin(A.location.href)},e._origin="about:blank",e}(),uy=function(){function e(A,t){this.context=A,this._options=t,this._cache={}}return e.prototype.addImage=function(A){var t=Promise.resolve();return this.has(A)||(La(A)||gy(A))&&(this._cache[A]=this.loadImage(A)).catch(function(){}),t},e.prototype.match=function(A){return this._cache[A]},e.prototype.loadImage=function(A){return CA(this,void 0,void 0,function(){var t,r,n,a,l=this;return UA(this,function(i){switch(i.label){case 0:return t=Yc.isSameOrigin(A),r=!Ja(A)&&this._options.useCORS===!0&&pA.SUPPORT_CORS_IMAGES&&!t,n=!Ja(A)&&!t&&!La(A)&&typeof this._options.proxy=="string"&&pA.SUPPORT_CORS_XHR&&!r,!t&&this._options.allowTaint===!1&&!Ja(A)&&!La(A)&&!n&&!r?[2]:(a=A,n?[4,this.proxy(a)]:[3,2]);case 1:a=i.sent(),i.label=2;case 2:return this.context.logger.debug("Added image "+A.substring(0,256)),[4,new Promise(function(s,c){var d=new Image;d.onload=function(){return s(d)},d.onerror=c,(py(a)||r)&&(d.crossOrigin="anonymous"),d.src=a,d.complete===!0&&setTimeout(function(){return s(d)},500),l._options.imageTimeout>0&&setTimeout(function(){return c("Timed out ("+l._options.imageTimeout+"ms) loading image")},l._options.imageTimeout)})];case 3:return[2,i.sent()]}})})},e.prototype.has=function(A){return typeof this._cache[A]<"u"},e.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},e.prototype.proxy=function(A){var t=this,r=this._options.proxy;if(!r)throw new Error("No proxy defined");var n=A.substring(0,256);return new Promise(function(a,l){var i=pA.SUPPORT_RESPONSE_TYPE?"blob":"text",s=new XMLHttpRequest;s.onload=function(){if(s.status===200)if(i==="text")a(s.response);else{var u=new FileReader;u.addEventListener("load",function(){return a(u.result)},!1),u.addEventListener("error",function(B){return l(B)},!1),u.readAsDataURL(s.response)}else l("Failed to proxy resource "+n+" with status code "+s.status)},s.onerror=l;var c=r.indexOf("?")>-1?"&":"?";if(s.open("GET",""+r+c+"url="+encodeURIComponent(A)+"&responseType="+i),i!=="text"&&s instanceof XMLHttpRequest&&(s.responseType=i),t._options.imageTimeout){var d=t._options.imageTimeout;s.timeout=d,s.ontimeout=function(){return l("Timed out ("+d+"ms) proxying "+n)}}s.send()})},e}(),By=/^data:image\/svg\+xml/i,fy=/^data:image\/.*;base64,/i,hy=/^data:image\/.*/i,gy=function(e){return pA.SUPPORT_SVG_DRAWING||!Uy(e)},Ja=function(e){return hy.test(e)},py=function(e){return fy.test(e)},La=function(e){return e.substr(0,4)==="blob"},Uy=function(e){return e.substr(-3).toLowerCase()==="svg"||By.test(e)},S=function(){function e(A,t){this.type=0,this.x=A,this.y=t}return e.prototype.add=function(A,t){return new e(this.x+A,this.y+t)},e}(),ct=function(e,A,t){return new S(e.x+(A.x-e.x)*t,e.y+(A.y-e.y)*t)},Qn=function(){function e(A,t,r,n){this.type=1,this.start=A,this.startControl=t,this.endControl=r,this.end=n}return e.prototype.subdivide=function(A,t){var r=ct(this.start,this.startControl,A),n=ct(this.startControl,this.endControl,A),a=ct(this.endControl,this.end,A),l=ct(r,n,A),i=ct(n,a,A),s=ct(l,i,A);return t?new e(this.start,r,l,s):new e(s,i,a,this.end)},e.prototype.add=function(A,t){return new e(this.start.add(A,t),this.startControl.add(A,t),this.endControl.add(A,t),this.end.add(A,t))},e.prototype.reverse=function(){return new e(this.end,this.endControl,this.startControl,this.start)},e}(),ZA=function(e){return e.type===1},Qy=function(){function e(A){var t=A.styles,r=A.bounds,n=Yt(t.borderTopLeftRadius,r.width,r.height),a=n[0],l=n[1],i=Yt(t.borderTopRightRadius,r.width,r.height),s=i[0],c=i[1],d=Yt(t.borderBottomRightRadius,r.width,r.height),u=d[0],B=d[1],g=Yt(t.borderBottomLeftRadius,r.width,r.height),h=g[0],f=g[1],U=[];U.push((a+s)/r.width),U.push((h+u)/r.width),U.push((l+f)/r.height),U.push((c+B)/r.height);var p=Math.max.apply(Math,U);p>1&&(a/=p,l/=p,s/=p,c/=p,u/=p,B/=p,h/=p,f/=p);var w=r.width-s,Q=r.height-B,E=r.width-u,y=r.height-f,m=t.borderTopWidth,T=t.borderRightWidth,v=t.borderBottomWidth,V=t.borderLeftWidth,N=eA(t.paddingTop,A.bounds.width),H=eA(t.paddingRight,A.bounds.width),Z=eA(t.paddingBottom,A.bounds.width),I=eA(t.paddingLeft,A.bounds.width);this.topLeftBorderDoubleOuterBox=a>0||l>0?nA(r.left+V/3,r.top+m/3,a-V/3,l-m/3,P.TOP_LEFT):new S(r.left+V/3,r.top+m/3),this.topRightBorderDoubleOuterBox=a>0||l>0?nA(r.left+w,r.top+m/3,s-T/3,c-m/3,P.TOP_RIGHT):new S(r.left+r.width-T/3,r.top+m/3),this.bottomRightBorderDoubleOuterBox=u>0||B>0?nA(r.left+E,r.top+Q,u-T/3,B-v/3,P.BOTTOM_RIGHT):new S(r.left+r.width-T/3,r.top+r.height-v/3),this.bottomLeftBorderDoubleOuterBox=h>0||f>0?nA(r.left+V/3,r.top+y,h-V/3,f-v/3,P.BOTTOM_LEFT):new S(r.left+V/3,r.top+r.height-v/3),this.topLeftBorderDoubleInnerBox=a>0||l>0?nA(r.left+V*2/3,r.top+m*2/3,a-V*2/3,l-m*2/3,P.TOP_LEFT):new S(r.left+V*2/3,r.top+m*2/3),this.topRightBorderDoubleInnerBox=a>0||l>0?nA(r.left+w,r.top+m*2/3,s-T*2/3,c-m*2/3,P.TOP_RIGHT):new S(r.left+r.width-T*2/3,r.top+m*2/3),this.bottomRightBorderDoubleInnerBox=u>0||B>0?nA(r.left+E,r.top+Q,u-T*2/3,B-v*2/3,P.BOTTOM_RIGHT):new S(r.left+r.width-T*2/3,r.top+r.height-v*2/3),this.bottomLeftBorderDoubleInnerBox=h>0||f>0?nA(r.left+V*2/3,r.top+y,h-V*2/3,f-v*2/3,P.BOTTOM_LEFT):new S(r.left+V*2/3,r.top+r.height-v*2/3),this.topLeftBorderStroke=a>0||l>0?nA(r.left+V/2,r.top+m/2,a-V/2,l-m/2,P.TOP_LEFT):new S(r.left+V/2,r.top+m/2),this.topRightBorderStroke=a>0||l>0?nA(r.left+w,r.top+m/2,s-T/2,c-m/2,P.TOP_RIGHT):new S(r.left+r.width-T/2,r.top+m/2),this.bottomRightBorderStroke=u>0||B>0?nA(r.left+E,r.top+Q,u-T/2,B-v/2,P.BOTTOM_RIGHT):new S(r.left+r.width-T/2,r.top+r.height-v/2),this.bottomLeftBorderStroke=h>0||f>0?nA(r.left+V/2,r.top+y,h-V/2,f-v/2,P.BOTTOM_LEFT):new S(r.left+V/2,r.top+r.height-v/2),this.topLeftBorderBox=a>0||l>0?nA(r.left,r.top,a,l,P.TOP_LEFT):new S(r.left,r.top),this.topRightBorderBox=s>0||c>0?nA(r.left+w,r.top,s,c,P.TOP_RIGHT):new S(r.left+r.width,r.top),this.bottomRightBorderBox=u>0||B>0?nA(r.left+E,r.top+Q,u,B,P.BOTTOM_RIGHT):new S(r.left+r.width,r.top+r.height),this.bottomLeftBorderBox=h>0||f>0?nA(r.left,r.top+y,h,f,P.BOTTOM_LEFT):new S(r.left,r.top+r.height),this.topLeftPaddingBox=a>0||l>0?nA(r.left+V,r.top+m,Math.max(0,a-V),Math.max(0,l-m),P.TOP_LEFT):new S(r.left+V,r.top+m),this.topRightPaddingBox=s>0||c>0?nA(r.left+Math.min(w,r.width-T),r.top+m,w>r.width+T?0:Math.max(0,s-T),Math.max(0,c-m),P.TOP_RIGHT):new S(r.left+r.width-T,r.top+m),this.bottomRightPaddingBox=u>0||B>0?nA(r.left+Math.min(E,r.width-V),r.top+Math.min(Q,r.height-v),Math.max(0,u-T),Math.max(0,B-v),P.BOTTOM_RIGHT):new S(r.left+r.width-T,r.top+r.height-v),this.bottomLeftPaddingBox=h>0||f>0?nA(r.left+V,r.top+Math.min(y,r.height-v),Math.max(0,h-V),Math.max(0,f-v),P.BOTTOM_LEFT):new S(r.left+V,r.top+r.height-v),this.topLeftContentBox=a>0||l>0?nA(r.left+V+I,r.top+m+N,Math.max(0,a-(V+I)),Math.max(0,l-(m+N)),P.TOP_LEFT):new S(r.left+V+I,r.top+m+N),this.topRightContentBox=s>0||c>0?nA(r.left+Math.min(w,r.width+V+I),r.top+m+N,w>r.width+V+I?0:s-V+I,c-(m+N),P.TOP_RIGHT):new S(r.left+r.width-(T+H),r.top+m+N),this.bottomRightContentBox=u>0||B>0?nA(r.left+Math.min(E,r.width-(V+I)),r.top+Math.min(Q,r.height+m+N),Math.max(0,u-(T+H)),B-(v+Z),P.BOTTOM_RIGHT):new S(r.left+r.width-(T+H),r.top+r.height-(v+Z)),this.bottomLeftContentBox=h>0||f>0?nA(r.left+V+I,r.top+y,Math.max(0,h-(V+I)),f-(v+Z),P.BOTTOM_LEFT):new S(r.left+V+I,r.top+r.height-(v+Z))}return e}(),P;(function(e){e[e.TOP_LEFT=0]="TOP_LEFT",e[e.TOP_RIGHT=1]="TOP_RIGHT",e[e.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",e[e.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(P||(P={}));var nA=function(e,A,t,r,n){var a=4*((Math.sqrt(2)-1)/3),l=t*a,i=r*a,s=e+t,c=A+r;switch(n){case P.TOP_LEFT:return new Qn(new S(e,c),new S(e,c-i),new S(s-l,A),new S(s,A));case P.TOP_RIGHT:return new Qn(new S(e,A),new S(e+l,A),new S(s,c-i),new S(s,c));case P.BOTTOM_RIGHT:return new Qn(new S(s,A),new S(s,A+i),new S(e+l,c),new S(e,c));case P.BOTTOM_LEFT:default:return new Qn(new S(s,c),new S(s-l,c),new S(e,A+i),new S(e,A))}},wn=function(e){return[e.topLeftBorderBox,e.topRightBorderBox,e.bottomRightBorderBox,e.bottomLeftBorderBox]},wy=function(e){return[e.topLeftContentBox,e.topRightContentBox,e.bottomRightContentBox,e.bottomLeftContentBox]},Fn=function(e){return[e.topLeftPaddingBox,e.topRightPaddingBox,e.bottomRightPaddingBox,e.bottomLeftPaddingBox]},Fy=function(){function e(A,t,r){this.offsetX=A,this.offsetY=t,this.matrix=r,this.type=0,this.target=6}return e}(),En=function(){function e(A,t){this.path=A,this.target=t,this.type=1}return e}(),Ey=function(){function e(A){this.opacity=A,this.type=2,this.target=6}return e}(),my=function(e){return e.type===0},zc=function(e){return e.type===1},Cy=function(e){return e.type===2},jc=function(e,A){return e.length===A.length?e.some(function(t,r){return t===A[r]}):!1},yy=function(e,A,t,r,n){return e.map(function(a,l){switch(l){case 0:return a.add(A,t);case 1:return a.add(A+r,t);case 2:return a.add(A+r,t+n);case 3:return a.add(A,t+n)}return a})},Xc=function(){function e(A){this.element=A,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return e}(),Pc=function(){function e(A,t){if(this.container=A,this.parent=t,this.effects=[],this.curves=new Qy(this.container),this.container.styles.opacity<1&&this.effects.push(new Ey(this.container.styles.opacity)),this.container.styles.transform!==null){var r=this.container.bounds.left+this.container.styles.transformOrigin[0].number,n=this.container.bounds.top+this.container.styles.transformOrigin[1].number,a=this.container.styles.transform;this.effects.push(new Fy(r,n,a))}if(this.container.styles.overflowX!==0){var l=wn(this.curves),i=Fn(this.curves);jc(l,i)?this.effects.push(new En(l,6)):(this.effects.push(new En(l,2)),this.effects.push(new En(i,4)))}}return e.prototype.getEffects=function(A){for(var t=[2,3].indexOf(this.container.styles.position)===-1,r=this.parent,n=this.effects.slice(0);r;){var a=r.effects.filter(function(s){return!zc(s)});if(t||r.container.styles.position!==0||!r.parent){if(n.unshift.apply(n,a),t=[2,3].indexOf(r.container.styles.position)===-1,r.container.styles.overflowX!==0){var l=wn(r.curves),i=Fn(r.curves);jc(l,i)||n.unshift(new En(i,6))}}else n.unshift.apply(n,a);r=r.parent}return n.filter(function(s){return uA(s.target,A)})},e}(),Ka=function(e,A,t,r){e.container.elements.forEach(function(n){var a=uA(n.flags,4),l=uA(n.flags,2),i=new Pc(n,e);uA(n.styles.display,2048)&&r.push(i);var s=uA(n.flags,8)?[]:r;if(a||l){var c=a||n.styles.isPositioned()?t:A,d=new Xc(i);if(n.styles.isPositioned()||n.styles.opacity<1||n.styles.isTransformed()){var u=n.styles.zIndex.order;if(u<0){var B=0;c.negativeZIndex.some(function(h,f){return u>h.element.container.styles.zIndex.order?(B=f,!1):B>0}),c.negativeZIndex.splice(B,0,d)}else if(u>0){var g=0;c.positiveZIndex.some(function(h,f){return u>=h.element.container.styles.zIndex.order?(g=f+1,!1):g>0}),c.positiveZIndex.splice(g,0,d)}else c.zeroOrAutoZIndexOrTransformedOrOpacity.push(d)}else n.styles.isFloating()?c.nonPositionedFloats.push(d):c.nonPositionedInlineLevel.push(d);Ka(i,d,a?d:t,s)}else n.styles.isInlineLevel()?A.inlineLevel.push(i):A.nonInlineLevel.push(i),Ka(i,A,t,s);uA(n.flags,8)&&_c(n,s)})},_c=function(e,A){for(var t=e instanceof ba?e.start:1,r=e instanceof ba?e.reversed:!1,n=0;n<A.length;n++){var a=A[n];a.container instanceof Ec&&typeof a.container.value=="number"&&a.container.value!==0&&(t=a.container.value),a.listValue=qt(t,a.container.styles.listStyleType,!0),t+=r?-1:1}},Vy=function(e){var A=new Pc(e,null),t=new Xc(A),r=[];return Ka(A,t,t,r),_c(A.container,r),t},qc=function(e,A){switch(A){case 0:return OA(e.topLeftBorderBox,e.topLeftPaddingBox,e.topRightBorderBox,e.topRightPaddingBox);case 1:return OA(e.topRightBorderBox,e.topRightPaddingBox,e.bottomRightBorderBox,e.bottomRightPaddingBox);case 2:return OA(e.bottomRightBorderBox,e.bottomRightPaddingBox,e.bottomLeftBorderBox,e.bottomLeftPaddingBox);case 3:default:return OA(e.bottomLeftBorderBox,e.bottomLeftPaddingBox,e.topLeftBorderBox,e.topLeftPaddingBox)}},Ry=function(e,A){switch(A){case 0:return OA(e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox,e.topRightBorderBox,e.topRightBorderDoubleOuterBox);case 1:return OA(e.topRightBorderBox,e.topRightBorderDoubleOuterBox,e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox);case 2:return OA(e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox,e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox);case 3:default:return OA(e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox,e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox)}},Ty=function(e,A){switch(A){case 0:return OA(e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox,e.topRightBorderDoubleInnerBox,e.topRightPaddingBox);case 1:return OA(e.topRightBorderDoubleInnerBox,e.topRightPaddingBox,e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox);case 2:return OA(e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox,e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox);case 3:default:return OA(e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox,e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox)}},Ny=function(e,A){switch(A){case 0:return mn(e.topLeftBorderStroke,e.topRightBorderStroke);case 1:return mn(e.topRightBorderStroke,e.bottomRightBorderStroke);case 2:return mn(e.bottomRightBorderStroke,e.bottomLeftBorderStroke);case 3:default:return mn(e.bottomLeftBorderStroke,e.topLeftBorderStroke)}},mn=function(e,A){var t=[];return ZA(e)?t.push(e.subdivide(.5,!1)):t.push(e),ZA(A)?t.push(A.subdivide(.5,!0)):t.push(A),t},OA=function(e,A,t,r){var n=[];return ZA(e)?n.push(e.subdivide(.5,!1)):n.push(e),ZA(t)?n.push(t.subdivide(.5,!0)):n.push(t),ZA(r)?n.push(r.subdivide(.5,!0).reverse()):n.push(r),ZA(A)?n.push(A.subdivide(.5,!1).reverse()):n.push(A),n},$c=function(e){var A=e.bounds,t=e.styles;return A.add(t.borderLeftWidth,t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth),-(t.borderTopWidth+t.borderBottomWidth))},Cn=function(e){var A=e.styles,t=e.bounds,r=eA(A.paddingLeft,t.width),n=eA(A.paddingRight,t.width),a=eA(A.paddingTop,t.width),l=eA(A.paddingBottom,t.width);return t.add(r+A.borderLeftWidth,a+A.borderTopWidth,-(A.borderRightWidth+A.borderLeftWidth+r+n),-(A.borderTopWidth+A.borderBottomWidth+a+l))},vy=function(e,A){return e===0?A.bounds:e===2?Cn(A):$c(A)},Iy=function(e,A){return e===0?A.bounds:e===2?Cn(A):$c(A)},Ga=function(e,A,t){var r=vy(ut(e.styles.backgroundOrigin,A),e),n=Iy(ut(e.styles.backgroundClip,A),e),a=Sy(ut(e.styles.backgroundSize,A),t,r),l=a[0],i=a[1],s=Yt(ut(e.styles.backgroundPosition,A),r.width-l,r.height-i),c=by(ut(e.styles.backgroundRepeat,A),s,a,r,n),d=Math.round(r.left+s[0]),u=Math.round(r.top+s[1]);return[c,d,u,l,i]},dt=function(e){return q(e)&&e.value===at.AUTO},yn=function(e){return typeof e=="number"},Sy=function(e,A,t){var r=A[0],n=A[1],a=A[2],l=e[0],i=e[1];if(!l)return[0,0];if(cA(l)&&i&&cA(i))return[eA(l,t.width),eA(i,t.height)];var s=yn(a);if(q(l)&&(l.value===at.CONTAIN||l.value===at.COVER)){if(yn(a)){var c=t.width/t.height;return c<a!=(l.value===at.COVER)?[t.width,t.width/a]:[t.height*a,t.height]}return[t.width,t.height]}var d=yn(r),u=yn(n),B=d||u;if(dt(l)&&(!i||dt(i))){if(d&&u)return[r,n];if(!s&&!B)return[t.width,t.height];if(B&&s){var g=d?r:n*a,h=u?n:r/a;return[g,h]}var f=d?r:t.width,U=u?n:t.height;return[f,U]}if(s){var p=0,w=0;return cA(l)?p=eA(l,t.width):cA(i)&&(w=eA(i,t.height)),dt(l)?p=w*a:(!i||dt(i))&&(w=p/a),[p,w]}var Q=null,E=null;if(cA(l)?Q=eA(l,t.width):i&&cA(i)&&(E=eA(i,t.height)),Q!==null&&(!i||dt(i))&&(E=d&&u?Q/r*n:t.height),E!==null&&dt(l)&&(Q=d&&u?E/n*r:t.width),Q!==null&&E!==null)return[Q,E];throw new Error("Unable to calculate background-size for element")},ut=function(e,A){var t=e[A];return typeof t>"u"?e[0]:t},by=function(e,A,t,r,n){var a=A[0],l=A[1],i=t[0],s=t[1];switch(e){case 2:return[new S(Math.round(r.left),Math.round(r.top+l)),new S(Math.round(r.left+r.width),Math.round(r.top+l)),new S(Math.round(r.left+r.width),Math.round(s+r.top+l)),new S(Math.round(r.left),Math.round(s+r.top+l))];case 3:return[new S(Math.round(r.left+a),Math.round(r.top)),new S(Math.round(r.left+a+i),Math.round(r.top)),new S(Math.round(r.left+a+i),Math.round(r.height+r.top)),new S(Math.round(r.left+a),Math.round(r.height+r.top))];case 1:return[new S(Math.round(r.left+a),Math.round(r.top+l)),new S(Math.round(r.left+a+i),Math.round(r.top+l)),new S(Math.round(r.left+a+i),Math.round(r.top+l+s)),new S(Math.round(r.left+a),Math.round(r.top+l+s))];default:return[new S(Math.round(n.left),Math.round(n.top)),new S(Math.round(n.left+n.width),Math.round(n.top)),new S(Math.round(n.left+n.width),Math.round(n.height+n.top)),new S(Math.round(n.left),Math.round(n.height+n.top))]}},My="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",Ad="Hidden Text",Hy=function(){function e(A){this._data={},this._document=A}return e.prototype.parseMetrics=function(A,t){var r=this._document.createElement("div"),n=this._document.createElement("img"),a=this._document.createElement("span"),l=this._document.body;r.style.visibility="hidden",r.style.fontFamily=A,r.style.fontSize=t,r.style.margin="0",r.style.padding="0",r.style.whiteSpace="nowrap",l.appendChild(r),n.src=My,n.width=1,n.height=1,n.style.margin="0",n.style.padding="0",n.style.verticalAlign="baseline",a.style.fontFamily=A,a.style.fontSize=t,a.style.margin="0",a.style.padding="0",a.appendChild(this._document.createTextNode(Ad)),r.appendChild(a),r.appendChild(n);var i=n.offsetTop-a.offsetTop+2;r.removeChild(a),r.appendChild(this._document.createTextNode(Ad)),r.style.lineHeight="normal",n.style.verticalAlign="super";var s=n.offsetTop-r.offsetTop+2;return l.removeChild(r),{baseline:i,middle:s}},e.prototype.getMetrics=function(A,t){var r=A+" "+t;return typeof this._data[r]>"u"&&(this._data[r]=this.parseMetrics(A,t)),this._data[r]},e}(),ed=function(){function e(A,t){this.context=A,this.options=t}return e}(),xy=1e4,ky=function(e){JA(A,e);function A(t,r){var n=e.call(this,t,r)||this;return n._activeEffects=[],n.canvas=r.canvas?r.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),r.canvas||(n.canvas.width=Math.floor(r.width*r.scale),n.canvas.height=Math.floor(r.height*r.scale),n.canvas.style.width=r.width+"px",n.canvas.style.height=r.height+"px"),n.fontMetrics=new Hy(document),n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-r.x,-r.y),n.ctx.textBaseline="bottom",n._activeEffects=[],n.context.logger.debug("Canvas renderer initialized ("+r.width+"x"+r.height+") with scale "+r.scale),n}return A.prototype.applyEffects=function(t){for(var r=this;this._activeEffects.length;)this.popEffect();t.forEach(function(n){return r.applyEffect(n)})},A.prototype.applyEffect=function(t){this.ctx.save(),Cy(t)&&(this.ctx.globalAlpha=t.opacity),my(t)&&(this.ctx.translate(t.offsetX,t.offsetY),this.ctx.transform(t.matrix[0],t.matrix[1],t.matrix[2],t.matrix[3],t.matrix[4],t.matrix[5]),this.ctx.translate(-t.offsetX,-t.offsetY)),zc(t)&&(this.path(t.path),this.ctx.clip()),this._activeEffects.push(t)},A.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},A.prototype.renderStack=function(t){return CA(this,void 0,void 0,function(){var r;return UA(this,function(n){switch(n.label){case 0:return r=t.element.container.styles,r.isVisible()?[4,this.renderStackContent(t)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}})})},A.prototype.renderNode=function(t){return CA(this,void 0,void 0,function(){return UA(this,function(r){switch(r.label){case 0:if(uA(t.container.flags,16))debugger;return t.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(t)]:[3,3];case 1:return r.sent(),[4,this.renderNodeContent(t)];case 2:r.sent(),r.label=3;case 3:return[2]}})})},A.prototype.renderTextWithLetterSpacing=function(t,r,n){var a=this;if(r===0)this.ctx.fillText(t.text,t.bounds.left,t.bounds.top+n);else{var l=Sa(t.text);l.reduce(function(i,s){return a.ctx.fillText(s,i,t.bounds.top+n),i+a.ctx.measureText(s).width},t.bounds.left)}},A.prototype.createFontStyle=function(t){var r=t.fontVariant.filter(function(l){return l==="normal"||l==="small-caps"}).join(""),n=Jy(t.fontFamily).join(", "),a=Gt(t.fontSize)?""+t.fontSize.number+t.fontSize.unit:t.fontSize.number+"px";return[[t.fontStyle,r,t.fontWeight,a,n].join(" "),n,a]},A.prototype.renderTextNode=function(t,r){return CA(this,void 0,void 0,function(){var n,a,l,i,s,c,d,u,B=this;return UA(this,function(g){return n=this.createFontStyle(r),a=n[0],l=n[1],i=n[2],this.ctx.font=a,this.ctx.direction=r.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",s=this.fontMetrics.getMetrics(l,i),c=s.baseline,d=s.middle,u=r.paintOrder,t.textBounds.forEach(function(h){u.forEach(function(f){switch(f){case 0:B.ctx.fillStyle=hA(r.color),B.renderTextWithLetterSpacing(h,r.letterSpacing,c);var U=r.textShadow;U.length&&h.text.trim().length&&(U.slice(0).reverse().forEach(function(p){B.ctx.shadowColor=hA(p.color),B.ctx.shadowOffsetX=p.offsetX.number*B.options.scale,B.ctx.shadowOffsetY=p.offsetY.number*B.options.scale,B.ctx.shadowBlur=p.blur.number,B.renderTextWithLetterSpacing(h,r.letterSpacing,c)}),B.ctx.shadowColor="",B.ctx.shadowOffsetX=0,B.ctx.shadowOffsetY=0,B.ctx.shadowBlur=0),r.textDecorationLine.length&&(B.ctx.fillStyle=hA(r.textDecorationColor||r.color),r.textDecorationLine.forEach(function(p){switch(p){case 1:B.ctx.fillRect(h.bounds.left,Math.round(h.bounds.top+c),h.bounds.width,1);break;case 2:B.ctx.fillRect(h.bounds.left,Math.round(h.bounds.top),h.bounds.width,1);break;case 3:B.ctx.fillRect(h.bounds.left,Math.ceil(h.bounds.top+d),h.bounds.width,1);break}}));break;case 1:r.webkitTextStrokeWidth&&h.text.trim().length&&(B.ctx.strokeStyle=hA(r.webkitTextStrokeColor),B.ctx.lineWidth=r.webkitTextStrokeWidth,B.ctx.lineJoin=window.chrome?"miter":"round",B.ctx.strokeText(h.text,h.bounds.left,h.bounds.top+c)),B.ctx.strokeStyle="",B.ctx.lineWidth=0,B.ctx.lineJoin="miter";break}})}),[2]})})},A.prototype.renderReplacedElement=function(t,r,n){if(n&&t.intrinsicWidth>0&&t.intrinsicHeight>0){var a=Cn(t),l=Fn(r);this.path(l),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(n,0,0,t.intrinsicWidth,t.intrinsicHeight,a.left,a.top,a.width,a.height),this.ctx.restore()}},A.prototype.renderNodeContent=function(t){return CA(this,void 0,void 0,function(){var r,n,a,l,i,s,w,w,c,d,u,B,E,g,h,y,f,U,p,w,Q,E,y;return UA(this,function(m){switch(m.label){case 0:this.applyEffects(t.getEffects(4)),r=t.container,n=t.curves,a=r.styles,l=0,i=r.textNodes,m.label=1;case 1:return l<i.length?(s=i[l],[4,this.renderTextNode(s,a)]):[3,4];case 2:m.sent(),m.label=3;case 3:return l++,[3,1];case 4:if(!(r instanceof Qc))return[3,8];m.label=5;case 5:return m.trys.push([5,7,,8]),[4,this.context.cache.match(r.src)];case 6:return w=m.sent(),this.renderReplacedElement(r,n,w),[3,8];case 7:return m.sent(),this.context.logger.error("Error loading image "+r.src),[3,8];case 8:if(r instanceof wc&&this.renderReplacedElement(r,n,r.canvas),!(r instanceof Fc))return[3,12];m.label=9;case 9:return m.trys.push([9,11,,12]),[4,this.context.cache.match(r.svg)];case 10:return w=m.sent(),this.renderReplacedElement(r,n,w),[3,12];case 11:return m.sent(),this.context.logger.error("Error loading svg "+r.svg.substring(0,255)),[3,12];case 12:return r instanceof Vc&&r.tree?(c=new A(this.context,{scale:this.options.scale,backgroundColor:r.backgroundColor,x:0,y:0,width:r.width,height:r.height}),[4,c.render(r.tree)]):[3,14];case 13:d=m.sent(),r.width&&r.height&&this.ctx.drawImage(d,0,0,r.width,r.height,r.bounds.left,r.bounds.top,r.bounds.width,r.bounds.height),m.label=14;case 14:if(r instanceof Ma&&(u=Math.min(r.bounds.width,r.bounds.height),r.type===Bn?r.checked&&(this.ctx.save(),this.path([new S(r.bounds.left+u*.39363,r.bounds.top+u*.79),new S(r.bounds.left+u*.16,r.bounds.top+u*.5549),new S(r.bounds.left+u*.27347,r.bounds.top+u*.44071),new S(r.bounds.left+u*.39694,r.bounds.top+u*.5649),new S(r.bounds.left+u*.72983,r.bounds.top+u*.23),new S(r.bounds.left+u*.84,r.bounds.top+u*.34085),new S(r.bounds.left+u*.39363,r.bounds.top+u*.79)]),this.ctx.fillStyle=hA(mc),this.ctx.fill(),this.ctx.restore()):r.type===fn&&r.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(r.bounds.left+u/2,r.bounds.top+u/2,u/4,0,Math.PI*2,!0),this.ctx.fillStyle=hA(mc),this.ctx.fill(),this.ctx.restore())),Zy(r)&&r.value.length){switch(B=this.createFontStyle(a),E=B[0],g=B[1],h=this.fontMetrics.getMetrics(E,g).baseline,this.ctx.font=E,this.ctx.fillStyle=hA(a.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=Wy(r.styles.textAlign),y=Cn(r),f=0,r.styles.textAlign){case 1:f+=y.width/2;break;case 2:f+=y.width;break}U=y.add(f,0,0,-y.height/2+1),this.ctx.save(),this.path([new S(y.left,y.top),new S(y.left+y.width,y.top),new S(y.left+y.width,y.top+y.height),new S(y.left,y.top+y.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new Pt(r.value,U),a.letterSpacing,h),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!uA(r.styles.display,2048))return[3,20];if(r.styles.listStyleImage===null)return[3,19];if(p=r.styles.listStyleImage,p.type!==0)return[3,18];w=void 0,Q=p.url,m.label=15;case 15:return m.trys.push([15,17,,18]),[4,this.context.cache.match(Q)];case 16:return w=m.sent(),this.ctx.drawImage(w,r.bounds.left-(w.width+10),r.bounds.top),[3,18];case 17:return m.sent(),this.context.logger.error("Error loading list-style-image "+Q),[3,18];case 18:return[3,20];case 19:t.listValue&&r.styles.listStyleType!==-1&&(E=this.createFontStyle(a)[0],this.ctx.font=E,this.ctx.fillStyle=hA(a.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",y=new Ae(r.bounds.left,r.bounds.top+eA(r.styles.paddingTop,r.bounds.width),r.bounds.width,Ac(a.lineHeight,a.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new Pt(t.listValue,y),a.letterSpacing,Ac(a.lineHeight,a.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),m.label=20;case 20:return[2]}})})},A.prototype.renderStackContent=function(t){return CA(this,void 0,void 0,function(){var r,n,p,a,l,p,i,s,p,c,d,p,u,B,p,g,h,p,f,U,p;return UA(this,function(w){switch(w.label){case 0:if(uA(t.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(t.element)];case 1:w.sent(),r=0,n=t.negativeZIndex,w.label=2;case 2:return r<n.length?(p=n[r],[4,this.renderStack(p)]):[3,5];case 3:w.sent(),w.label=4;case 4:return r++,[3,2];case 5:return[4,this.renderNodeContent(t.element)];case 6:w.sent(),a=0,l=t.nonInlineLevel,w.label=7;case 7:return a<l.length?(p=l[a],[4,this.renderNode(p)]):[3,10];case 8:w.sent(),w.label=9;case 9:return a++,[3,7];case 10:i=0,s=t.nonPositionedFloats,w.label=11;case 11:return i<s.length?(p=s[i],[4,this.renderStack(p)]):[3,14];case 12:w.sent(),w.label=13;case 13:return i++,[3,11];case 14:c=0,d=t.nonPositionedInlineLevel,w.label=15;case 15:return c<d.length?(p=d[c],[4,this.renderStack(p)]):[3,18];case 16:w.sent(),w.label=17;case 17:return c++,[3,15];case 18:u=0,B=t.inlineLevel,w.label=19;case 19:return u<B.length?(p=B[u],[4,this.renderNode(p)]):[3,22];case 20:w.sent(),w.label=21;case 21:return u++,[3,19];case 22:g=0,h=t.zeroOrAutoZIndexOrTransformedOrOpacity,w.label=23;case 23:return g<h.length?(p=h[g],[4,this.renderStack(p)]):[3,26];case 24:w.sent(),w.label=25;case 25:return g++,[3,23];case 26:f=0,U=t.positiveZIndex,w.label=27;case 27:return f<U.length?(p=U[f],[4,this.renderStack(p)]):[3,30];case 28:w.sent(),w.label=29;case 29:return f++,[3,27];case 30:return[2]}})})},A.prototype.mask=function(t){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(t.slice(0).reverse()),this.ctx.closePath()},A.prototype.path=function(t){this.ctx.beginPath(),this.formatPath(t),this.ctx.closePath()},A.prototype.formatPath=function(t){var r=this;t.forEach(function(n,a){var l=ZA(n)?n.start:n;a===0?r.ctx.moveTo(l.x,l.y):r.ctx.lineTo(l.x,l.y),ZA(n)&&r.ctx.bezierCurveTo(n.startControl.x,n.startControl.y,n.endControl.x,n.endControl.y,n.end.x,n.end.y)})},A.prototype.renderRepeat=function(t,r,n,a){this.path(t),this.ctx.fillStyle=r,this.ctx.translate(n,a),this.ctx.fill(),this.ctx.translate(-n,-a)},A.prototype.resizeImage=function(t,r,n){var a;if(t.width===r&&t.height===n)return t;var l=(a=this.canvas.ownerDocument)!==null&&a!==void 0?a:document,i=l.createElement("canvas");i.width=Math.max(1,r),i.height=Math.max(1,n);var s=i.getContext("2d");return s.drawImage(t,0,0,t.width,t.height,0,0,r,n),i},A.prototype.renderBackgroundImage=function(t){return CA(this,void 0,void 0,function(){var r,n,a,l,i,s;return UA(this,function(c){switch(c.label){case 0:r=t.styles.backgroundImage.length-1,n=function(d){var u,B,g,N,O,K,I,L,v,h,N,O,K,I,L,f,U,p,w,Q,E,y,m,T,v,V,N,H,Z,I,L,$,O,K,j,oA,rA,_,J,D,wA,dA;return UA(this,function(iA){switch(iA.label){case 0:if(d.type!==0)return[3,5];u=void 0,B=d.url,iA.label=1;case 1:return iA.trys.push([1,3,,4]),[4,a.context.cache.match(B)];case 2:return u=iA.sent(),[3,4];case 3:return iA.sent(),a.context.logger.error("Error loading background-image "+B),[3,4];case 4:return u&&(g=Ga(t,r,[u.width,u.height,u.width/u.height]),N=g[0],O=g[1],K=g[2],I=g[3],L=g[4],v=a.ctx.createPattern(a.resizeImage(u,I,L),"repeat"),a.renderRepeat(N,v,O,K)),[3,6];case 5:mE(d)?(h=Ga(t,r,[null,null,null]),N=h[0],O=h[1],K=h[2],I=h[3],L=h[4],f=UE(d.angle,I,L),U=f[0],p=f[1],w=f[2],Q=f[3],E=f[4],y=document.createElement("canvas"),y.width=I,y.height=L,m=y.getContext("2d"),T=m.createLinearGradient(p,Q,w,E),Ls(d.stops,U).forEach(function(sA){return T.addColorStop(sA.stop,hA(sA.color))}),m.fillStyle=T,m.fillRect(0,0,I,L),I>0&&L>0&&(v=a.ctx.createPattern(y,"repeat"),a.renderRepeat(N,v,O,K))):CE(d)&&(V=Ga(t,r,[null,null,null]),N=V[0],H=V[1],Z=V[2],I=V[3],L=V[4],$=d.position.length===0?[pa]:d.position,O=eA($[0],I),K=eA($[$.length-1],L),j=QE(d,O,K,I,L),oA=j[0],rA=j[1],oA>0&&rA>0&&(_=a.ctx.createRadialGradient(H+O,Z+K,0,H+O,Z+K,oA),Ls(d.stops,oA*2).forEach(function(sA){return _.addColorStop(sA.stop,hA(sA.color))}),a.path(N),a.ctx.fillStyle=_,oA!==rA?(J=t.bounds.left+.5*t.bounds.width,D=t.bounds.top+.5*t.bounds.height,wA=rA/oA,dA=1/wA,a.ctx.save(),a.ctx.translate(J,D),a.ctx.transform(1,0,0,wA,0,0),a.ctx.translate(-J,-D),a.ctx.fillRect(H,dA*(Z-D)+D,I,L*dA),a.ctx.restore()):a.ctx.fill())),iA.label=6;case 6:return r--,[2]}})},a=this,l=0,i=t.styles.backgroundImage.slice(0).reverse(),c.label=1;case 1:return l<i.length?(s=i[l],[5,n(s)]):[3,4];case 2:c.sent(),c.label=3;case 3:return l++,[3,1];case 4:return[2]}})})},A.prototype.renderSolidBorder=function(t,r,n){return CA(this,void 0,void 0,function(){return UA(this,function(a){return this.path(qc(n,r)),this.ctx.fillStyle=hA(t),this.ctx.fill(),[2]})})},A.prototype.renderDoubleBorder=function(t,r,n,a){return CA(this,void 0,void 0,function(){var l,i;return UA(this,function(s){switch(s.label){case 0:return r<3?[4,this.renderSolidBorder(t,n,a)]:[3,2];case 1:return s.sent(),[2];case 2:return l=Ry(a,n),this.path(l),this.ctx.fillStyle=hA(t),this.ctx.fill(),i=Ty(a,n),this.path(i),this.ctx.fill(),[2]}})})},A.prototype.renderNodeBackgroundAndBorders=function(t){return CA(this,void 0,void 0,function(){var r,n,a,l,i,s,c,d,u=this;return UA(this,function(B){switch(B.label){case 0:return this.applyEffects(t.getEffects(2)),r=t.container.styles,n=!Be(r.backgroundColor)||r.backgroundImage.length,a=[{style:r.borderTopStyle,color:r.borderTopColor,width:r.borderTopWidth},{style:r.borderRightStyle,color:r.borderRightColor,width:r.borderRightWidth},{style:r.borderBottomStyle,color:r.borderBottomColor,width:r.borderBottomWidth},{style:r.borderLeftStyle,color:r.borderLeftColor,width:r.borderLeftWidth}],l=Oy(ut(r.backgroundClip,0),t.curves),n||r.boxShadow.length?(this.ctx.save(),this.path(l),this.ctx.clip(),Be(r.backgroundColor)||(this.ctx.fillStyle=hA(r.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(t.container)]):[3,2];case 1:B.sent(),this.ctx.restore(),r.boxShadow.slice(0).reverse().forEach(function(g){u.ctx.save();var h=wn(t.curves),f=g.inset?0:xy,U=yy(h,-f+(g.inset?1:-1)*g.spread.number,(g.inset?1:-1)*g.spread.number,g.spread.number*(g.inset?-2:2),g.spread.number*(g.inset?-2:2));g.inset?(u.path(h),u.ctx.clip(),u.mask(U)):(u.mask(h),u.ctx.clip(),u.path(U)),u.ctx.shadowOffsetX=g.offsetX.number+f,u.ctx.shadowOffsetY=g.offsetY.number,u.ctx.shadowColor=hA(g.color),u.ctx.shadowBlur=g.blur.number,u.ctx.fillStyle=g.inset?hA(g.color):"rgba(0,0,0,1)",u.ctx.fill(),u.ctx.restore()}),B.label=2;case 2:i=0,s=0,c=a,B.label=3;case 3:return s<c.length?(d=c[s],d.style!==0&&!Be(d.color)&&d.width>0?d.style!==2?[3,5]:[4,this.renderDashedDottedBorder(d.color,d.width,i,t.curves,2)]:[3,11]):[3,13];case 4:return B.sent(),[3,11];case 5:return d.style!==3?[3,7]:[4,this.renderDashedDottedBorder(d.color,d.width,i,t.curves,3)];case 6:return B.sent(),[3,11];case 7:return d.style!==4?[3,9]:[4,this.renderDoubleBorder(d.color,d.width,i,t.curves)];case 8:return B.sent(),[3,11];case 9:return[4,this.renderSolidBorder(d.color,i,t.curves)];case 10:B.sent(),B.label=11;case 11:i++,B.label=12;case 12:return s++,[3,3];case 13:return[2]}})})},A.prototype.renderDashedDottedBorder=function(t,r,n,a,l){return CA(this,void 0,void 0,function(){var i,s,c,d,u,B,g,h,f,U,p,w,Q,E,y,m,y,m;return UA(this,function(T){return this.ctx.save(),i=Ny(a,n),s=qc(a,n),l===2&&(this.path(s),this.ctx.clip()),ZA(s[0])?(c=s[0].start.x,d=s[0].start.y):(c=s[0].x,d=s[0].y),ZA(s[1])?(u=s[1].end.x,B=s[1].end.y):(u=s[1].x,B=s[1].y),n===0||n===2?g=Math.abs(c-u):g=Math.abs(d-B),this.ctx.beginPath(),l===3?this.formatPath(i):this.formatPath(s.slice(0,2)),h=r<3?r*3:r*2,f=r<3?r*2:r,l===3&&(h=r,f=r),U=!0,g<=h*2?U=!1:g<=h*2+f?(p=g/(2*h+f),h*=p,f*=p):(w=Math.floor((g+f)/(h+f)),Q=(g-w*h)/(w-1),E=(g-(w+1)*h)/w,f=E<=0||Math.abs(f-Q)<Math.abs(f-E)?Q:E),U&&(l===3?this.ctx.setLineDash([0,h+f]):this.ctx.setLineDash([h,f])),l===3?(this.ctx.lineCap="round",this.ctx.lineWidth=r):this.ctx.lineWidth=r*2+1.1,this.ctx.strokeStyle=hA(t),this.ctx.stroke(),this.ctx.setLineDash([]),l===2&&(ZA(s[0])&&(y=s[3],m=s[0],this.ctx.beginPath(),this.formatPath([new S(y.end.x,y.end.y),new S(m.start.x,m.start.y)]),this.ctx.stroke()),ZA(s[1])&&(y=s[1],m=s[2],this.ctx.beginPath(),this.formatPath([new S(y.end.x,y.end.y),new S(m.start.x,m.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},A.prototype.render=function(t){return CA(this,void 0,void 0,function(){var r;return UA(this,function(n){switch(n.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=hA(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),r=Vy(t),[4,this.renderStack(r)];case 1:return n.sent(),this.applyEffects([]),[2,this.canvas]}})})},A}(ed),Zy=function(e){return e instanceof yc||e instanceof Cc?!0:e instanceof Ma&&e.type!==fn&&e.type!==Bn},Oy=function(e,A){switch(e){case 0:return wn(A);case 2:return wy(A);case 1:default:return Fn(A)}},Wy=function(e){switch(e){case 1:return"center";case 2:return"right";case 0:default:return"left"}},Dy=["-apple-system","system-ui"],Jy=function(e){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?e.filter(function(A){return Dy.indexOf(A)===-1}):e},Ly=function(e){JA(A,e);function A(t,r){var n=e.call(this,t,r)||this;return n.canvas=r.canvas?r.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),n.options=r,n.canvas.width=Math.floor(r.width*r.scale),n.canvas.height=Math.floor(r.height*r.scale),n.canvas.style.width=r.width+"px",n.canvas.style.height=r.height+"px",n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-r.x,-r.y),n.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+r.width+"x"+r.height+" at "+r.x+","+r.y+") with scale "+r.scale),n}return A.prototype.render=function(t){return CA(this,void 0,void 0,function(){var r,n;return UA(this,function(a){switch(a.label){case 0:return r=Ia(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,t),[4,Ky(r)];case 1:return n=a.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=hA(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(n,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},A}(ed),Ky=function(e){return new Promise(function(A,t){var r=new Image;r.onload=function(){A(r)},r.onerror=t,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(e))})},Gy=function(){function e(A){var t=A.id,r=A.enabled;this.id=t,this.enabled=r,this.start=Date.now()}return e.prototype.debug=function(){for(var A=[],t=0;t<arguments.length;t++)A[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug.apply(console,Sr([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},e.prototype.getTime=function(){return Date.now()-this.start},e.prototype.info=function(){for(var A=[],t=0;t<arguments.length;t++)A[t]=arguments[t];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,Sr([this.id,this.getTime()+"ms"],A))},e.prototype.warn=function(){for(var A=[],t=0;t<arguments.length;t++)A[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,Sr([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},e.prototype.error=function(){for(var A=[],t=0;t<arguments.length;t++)A[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,Sr([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},e.instances={},e}(),Yy=function(){function e(A,t){var r;this.windowBounds=t,this.instanceName="#"+e.instanceCount++,this.logger=new Gy({id:this.instanceName,enabled:A.logging}),this.cache=(r=A.cache)!==null&&r!==void 0?r:new uy(this,A)}return e.instanceCount=1,e}(),zy=function(e,A){return A===void 0&&(A={}),jy(e,A)};typeof window<"u"&&Yc.setContext(window);var jy=function(e,A){return CA(void 0,void 0,void 0,function(){var t,r,n,a,l,i,s,c,d,u,B,g,h,f,U,p,w,Q,E,y,T,m,T,v,V,N,H,Z,I,L,$,O,K,j,oA,rA,_,J,D,wA;return UA(this,function(dA){switch(dA.label){case 0:if(!e||typeof e!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(t=e.ownerDocument,!t)throw new Error("Element is not attached to a Document");if(r=t.defaultView,!r)throw new Error("Document is not attached to a Window");return n={allowTaint:(v=A.allowTaint)!==null&&v!==void 0?v:!1,imageTimeout:(V=A.imageTimeout)!==null&&V!==void 0?V:15e3,proxy:A.proxy,useCORS:(N=A.useCORS)!==null&&N!==void 0?N:!1},a=Po({logging:(H=A.logging)!==null&&H!==void 0?H:!0,cache:A.cache},n),l={windowWidth:(Z=A.windowWidth)!==null&&Z!==void 0?Z:r.innerWidth,windowHeight:(I=A.windowHeight)!==null&&I!==void 0?I:r.innerHeight,scrollX:(L=A.scrollX)!==null&&L!==void 0?L:r.pageXOffset,scrollY:($=A.scrollY)!==null&&$!==void 0?$:r.pageYOffset},i=new Ae(l.scrollX,l.scrollY,l.windowWidth,l.windowHeight),s=new Yy(a,i),c=(O=A.foreignObjectRendering)!==null&&O!==void 0?O:!1,d={allowTaint:(K=A.allowTaint)!==null&&K!==void 0?K:!1,onclone:A.onclone,ignoreElements:A.ignoreElements,inlineImages:c,copyStyles:c},s.logger.debug("Starting document clone with size "+i.width+"x"+i.height+" scrolled to "+-i.left+","+-i.top),u=new Kc(s,e,d),B=u.clonedReferenceElement,B?[4,u.toIFrame(t,i)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return g=dA.sent(),h=xa(B)||XC(B)?yw(B.ownerDocument):br(s,B),f=h.width,U=h.height,p=h.left,w=h.top,Q=Xy(s,B,A.backgroundColor),E={canvas:A.canvas,backgroundColor:Q,scale:(oA=(j=A.scale)!==null&&j!==void 0?j:r.devicePixelRatio)!==null&&oA!==void 0?oA:1,x:((rA=A.x)!==null&&rA!==void 0?rA:0)+p,y:((_=A.y)!==null&&_!==void 0?_:0)+w,width:(J=A.width)!==null&&J!==void 0?J:Math.ceil(f),height:(D=A.height)!==null&&D!==void 0?D:Math.ceil(U)},c?(s.logger.debug("Document cloned, using foreign object rendering"),T=new Ly(s,E),[4,T.render(B)]):[3,3];case 2:return y=dA.sent(),[3,5];case 3:return s.logger.debug("Document cloned, element located at "+p+","+w+" with size "+f+"x"+U+" using computed rendering"),s.logger.debug("Starting DOM parsing"),m=Tc(s,B),Q===m.styles.backgroundColor&&(m.styles.backgroundColor=te.TRANSPARENT),s.logger.debug("Starting renderer for element at "+E.x+","+E.y+" with size "+E.width+"x"+E.height),T=new ky(s,E),[4,T.render(m)];case 4:y=dA.sent(),dA.label=5;case 5:return(!((wA=A.removeContainer)!==null&&wA!==void 0)||wA)&&(Kc.destroy(g)||s.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),s.logger.debug("Finished rendering"),[2,y]}})})},Xy=function(e,A,t){var r=A.ownerDocument,n=r.documentElement?zt(e,getComputedStyle(r.documentElement).backgroundColor):te.TRANSPARENT,a=r.body?zt(e,getComputedStyle(r.body).backgroundColor):te.TRANSPARENT,l=typeof t=="string"?zt(e,t):t===null?te.TRANSPARENT:4294967295;return A===r.documentElement?Be(n)?Be(a)?l:a:n:l};const sR="",Py={class:"label-designer"},_y={class:"toolbar"},qy={class:"center-container"},$y={class:"center-toolbar"},AV={class:"zoom-controls"},eV=["disabled"],tV=["disabled"],rV={class:"canvas-container"},nV={class:"ruler-horizontal"},oV={class:"ruler-vertical"},aV={key:0,class:"drag-extend-lines"},lV={key:1,class:"alignment-guides"},iV=["data-item-id","onMousedown","onClick"],sV=["onMousedown"],cV=["onMousedown"],dV=["onMousedown"],uV=["onMousedown"],BV=["onMousedown"],fV=["onMousedown"],hV=["onMousedown"],gV=["onClick"],pV={class:"property-panel",tabindex:"0"},UV={class:"position-controls"},QV={class:"control-group"},wV={class:"number-input"},FV={class:"control-group"},EV={class:"number-input"},mV={key:0,class:"control-group"},CV={class:"number-input"},yV={key:1,class:"control-group"},VV={class:"number-input"},RV={class:"control-group"},TV={class:"number-input"},NV={key:2,class:"control-group"},vV={class:"switch-input"},Vn=.05,IV=fA({__name:"panels",props:{templateInfo:{type:Object,default:()=>({graphData:{},width:0,height:0,printWidth:0,printHeight:0,items:[]})},options:{type:Object,default:()=>({})},showGraphConfig:{type:Boolean,default:!1},templateType:{type:String,default:"lodop"},config:{type:Object,default:()=>({})}},setup(e,{expose:A}){const t=e,r=o.ref({}),n=o.ref(0),a=o.ref([]),l=o.ref(1);let i=1;const s=o.computed(()=>{var C;return((C=r.value)==null?void 0:C.printWidth)||0}),c=o.computed(()=>{var C;return((C=r.value)==null?void 0:C.printHeight)||0});o.ref(!1);const d=o.ref(!1),u=o.ref(!1),B=o.ref(new Map),g=o.ref(new Map),h=new Map(_i.map(C=>[C.type,C])),{selectedItems:f,selectItem:U,getCurrentSelected:p,clearSelection:w}=pw(),{dragging:Q,dragItem:E,startDrag:y}=hw({scale:l,canvasWidth:s,canvasHeight:c,selectItem:U,onStartDrag:()=>{d.value=!0},onStopDrag:()=>{d.value=!1,o.nextTick(()=>{u.value=!1}),V()},onDragUpdate:()=>{v()}}),{alignmentGuides:m,showGuides:T,updateAlignmentGuides:v,clearAlignmentGuides:V}=Ew({items:a,dragItem:E,dragging:Q}),{startResize:N}=gw(s,c,l,f),{startRotate:H}=Uw();o.watch(()=>f.value,()=>{B.value.clear()},{deep:!0});const Z=C=>{const F=`${C.id}_${C.props.x.toFixed(1)}_${C.props.y.toFixed(1)}_${C.props.width}_${C.props.height}_${C.props.rotation}`;if(g.value.has(F))return g.value.get(F);const G=(C.props.rotation||0)*Math.PI/180,k=[{x:0,y:0},{x:C.props.width,y:0},{x:C.props.width,y:C.props.height},{x:0,y:C.props.height}],x=C.props.width/2,W=C.props.height/2,z=k.map(R=>{const AA=R.x-x,X=R.y-W,be=AA*Math.cos(G)-X*Math.sin(G),Me=AA*Math.sin(G)+X*Math.cos(G);return{x:Number((be+x+C.props.x).toFixed(2)),y:Number((Me+W+C.props.y).toFixed(2))}});if(g.value.set(F,z),g.value.size>100){const R=g.value.keys().next().value;g.value.delete(R)}return z},I=C=>{const F=Z(C),M=F.map(AA=>AA.x),G=F.map(AA=>AA.y),k=Number(Math.min(...M).toFixed(2)),x=Number(Math.max(...M).toFixed(2)),W=Number(Math.min(...G).toFixed(2)),z=Number(Math.max(...G).toFixed(2));return{minX:k,maxX:x,minY:W,maxY:z,width:x-k,height:z-W,centerX:(k+x)/2,centerY:(W+z)/2}},L=(C,F)=>{const M=I(C);if(C.type==="horline"&&F==="bottom"){const x=parseFloat(C.props.LineWidth||"0.75")*1.333/3.78;return{top:M.minY+x+"mm"}}if(C.type==="verline"&&F==="right"){const x=parseFloat(C.props.LineWidth||"0.75")*1.333/3.78;return{left:M.minX+x+"mm"}}switch(F){case"left":return{left:M.minX+"mm"};case"right":return{left:M.maxX+"mm"};case"top":return{top:M.minY+"mm"};case"bottom":return{top:M.maxY+"mm"};default:return{}}},$=()=>{o.nextTick(()=>{const C=document.querySelector(".canvas-container");if(!C||!s.value||!c.value)return;const F=C.getBoundingClientRect(),M=mr(s.value),G=mr(c.value);let k=F.width/M,x=F.height/G;k=k-40*k/M,x=x-40*x/G;let W=Math.min(k,x);i=Math.max(.8,Math.min(4,W)),l.value=i=O(i,1),setTimeout(()=>n.value=1,100)})};function O(C,F){C=C.toString();let M=C.indexOf(".");return M!==-1?C=C.substring(0,F+M+1):C=C.substring(0),Number(parseFloat(C).toFixed(F))}const K=C=>h.get(C)||null,j=C=>{const F=f.value.indexOf(C),M=F===f.value.length-1,G=F!==-1,k=`${C.id}_${Math.round(C.props.x*10)}_${Math.round(C.props.y*10)}_${C.props.width}_${C.props.height}_${C.props.rotation}_${G}_${M}`;if(B.value.has(k))return B.value.get(k);const x={width:C.props.width+"mm",height:C.props.height+"mm",transform:`translate(${C.props.x}mm, ${C.props.y}mm) rotate(${C.props.rotation}deg)`};if(G?M?x.zIndex=1e3:x.zIndex=999:x.zIndex=10,B.value.set(k,x),B.value.size>200){const W=B.value.keys().next().value;B.value.delete(W)}return x},oA=C=>{const F=f.value.some(G=>G.id===C.id),M=p()===C;return{"component-selected":F,"component-current":F&&M,"no-outline":F&&(C.type==="horline"||C.type==="verline")}},rA=(C,F)=>{const G=((C.props.rotation||0)%360+360)%360;if(C.type==="horline"&&(F==="left"||F==="right"))return{cursor:F==="left"?"w-resize":"e-resize",top:"50%",transform:"translateY(-50%)"};if(C.type==="verline"&&(F==="top"||F==="bottom"))return{cursor:F==="top"?"n-resize":"s-resize",left:"50%",transform:"translateX(-50%)"};const x=({top:0,"top-right":45,right:90,"bottom-right":135,bottom:180,"bottom-left":225,left:270,"top-left":315}[F]+G)%360;let W="pointer";return x>=337.5||x<22.5?W="n-resize":x>=22.5&&x<67.5?W="ne-resize":x>=67.5&&x<112.5?W="e-resize":x>=112.5&&x<157.5?W="se-resize":x>=157.5&&x<202.5?W="s-resize":x>=202.5&&x<247.5?W="sw-resize":x>=247.5&&x<292.5?W="w-resize":x>=292.5&&x<337.5&&(W="nw-resize"),{cursor:W}},_=()=>{l.value<4&&(l.value+=.1)},J=()=>{l.value>.8&&(l.value-=.1)};function D(C){const F=document.activeElement.tagName.toLowerCase();if(F==="input"||F==="textarea")return;const M=p();if(!M)return;const G=Number(M.props.width)||0,k=Number(M.props.height)||0;let x=M.props.x,W=M.props.y,z=!1;if(C.key==="ArrowLeft"?(x=Number((M.props.x-Vn).toFixed(2)),z=!0):C.key==="ArrowRight"?(x=Number((M.props.x+Vn).toFixed(2)),z=!0):C.key==="ArrowUp"?(W=Number((M.props.y-Vn).toFixed(2)),z=!0):C.key==="ArrowDown"&&(W=Number((M.props.y+Vn).toFixed(2)),z=!0),z){const R=s.value-G,AA=c.value-k;x<0?x=0:x>R&&(x=R),W<0?W=0:W>AA&&(W=AA),M.props.x=x,M.props.y=W,C.preventDefault()}}const wA=({e:C,comp:F,previewDiv:M})=>{var G,k;(G=C==null?void 0:C.dataTransfer)==null||G.setData("comp",JSON.stringify(F)),document.body.appendChild(M),(k=C==null?void 0:C.dataTransfer)==null||k.setDragImage(M,0,0),setTimeout(()=>document.body.removeChild(M),0)},dA=async C=>{var Sn,od,ad;C.preventDefault();const F=JSON.parse(((od=(Sn=C==null?void 0:C.dataTransfer)==null?void 0:Sn.getData)==null?void 0:od.call(Sn,"comp"))||"{}")||{},M=(F==null?void 0:F.type)||"";if(!M)return;const G=document.querySelector("#design").getBoundingClientRect(),k=(C.clientX-G.left)/l.value,x=(C.clientY-G.top)/l.value,W=BA.value[M]||{};let z=Ci(k),R=Ci(x);const AA=W.width,X=W.height,be=s.value-AA,Me=c.value-X;z=Math.max(0,Math.min(z,be)),R=Math.max(0,Math.min(R,Me));const{propertyPanel:vn,...bV}=W;let In={...bV,x:Number(z.toFixed(2)),y:Number(R.toFixed(2)),width:Number(AA.toFixed(2)),height:Number(X.toFixed(2))};if((ad=BA.value[M])!=null&&ad.propertyPanel){const Xa=Ve(BA.value[M].propertyPanel)||{};if(In={...In,...Xa},M==="horline"&&Xa.LineWidth){const MV=parseFloat(Xa.LineWidth)*.3528;In.height=Number(MV.toFixed(3))}}const nd={id:Ya(),type:M,props:In};a.value.push(nd),U(nd)};function iA(C){let F=C.target;for(;F&&F!==document.querySelector("#design");){if(F.classList&&(F.classList.contains("canvas-item")||F.classList.contains("resize-handle")||F.classList.contains("delete-btn")||F.classList.contains("rotate-handle")))return;F=F.parentElement}w()}const sA=(C,F)=>{if(f.value.length===0){U(F),y(C,F);return}if(p()===F){y(C,F);return}U(F),y(C,F)},FA=C=>{const F=[];for(const k of B.value.keys())k.includes(C)&&F.push(k);F.forEach(k=>B.value.delete(k));const M=[];for(const k of g.value.keys())k.includes(C)&&M.push(k);if(M.forEach(k=>g.value.delete(k)),B.value.clear(),g.value.clear(),a.value.find(k=>k.id===C)&&(a.value=a.value.filter(k=>k.id!==C)),f.value.some(k=>k.id===C)){const k=f.value.filter(x=>x.id!==C);f.value=k}o.nextTick(()=>{})},WA=C=>{var M;const F=document.activeElement.tagName.toLowerCase();F==="input"||F==="textarea"||(C.key==="Delete"||C.key==="Backspace")&&f.value.length>0&&FA((M=p())==null?void 0:M.id)},{handleMouseWheel:_A,handleInputChange:Se,adjustRotation:Ar}=ww(f,s,c),Bt=()=>{setTimeout(()=>{const C=document.querySelector(".center-container");if(!C)return;const F=C.getBoundingClientRect();C.style.height=`calc(100vh - ${F==null?void 0:F.top}px)`,$()},200)};o.watch(()=>t.templateInfo,(C,F)=>{C!==F&&(r.value=C||{},a.value=(C==null?void 0:C.items)||[],Bt())},{deep:!0,immediate:!0});const{handleCopy:Tn,handlePaste:KA}=Fw(a,f,s,c),BA=o.ref({}),GA=o.ref(!1),pe=async C=>{try{GA.value=!1,BA.value=await LQ(C),GA.value=!0}catch(F){console.error("加载属性配置失败:",F),BA.value={},GA.value=!0}};o.watch(()=>t.templateType,async C=>{try{await pe(C),w(),B.value.clear(),g.value.clear(),console.log("配置切换成功:",C)}catch(F){console.error("配置切换失败:",F)}},{immediate:!0}),o.onMounted(async()=>{GA.value||await pe(t.templateType),window.addEventListener("resize",Bt),window.addEventListener("keydown",WA),window.addEventListener("keydown",Tn),window.addEventListener("keydown",KA),window.addEventListener("keydown",D),Bt(),ft()}),o.onBeforeUnmount(()=>{window.removeEventListener("resize",Bt),window.removeEventListener("keydown",WA),window.removeEventListener("keydown",Tn),window.removeEventListener("keydown",KA),window.removeEventListener("keydown",D)});function Ya(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,C=>{const F=Math.random()*16|0;return(C==="x"?F:F&3|8).toString(16)})}const za=C=>{var M;if(!BA.value||!BA.value[C])return console.warn(`组件类型 ${C} 在当前配置中不存在`),{};const F=BA.value[C]||{};return C==="image"&&((M=t.config)!=null&&M.image)?{...F,image:{...F.image,...t.config.image}}:F},Nn=()=>Qw(a,r.value),ja=C=>{r.value.graphData=C||{},ft()},ft=()=>{var F;const C=Cw(r.value.graphData)||"";C&&((F=document.querySelector("#design"))==null||F.appendChild(C))},rd=()=>new Promise((C,F)=>{w(),JSON.parse(JSON.stringify(a.value));const M=JSON.parse(JSON.stringify(a.value));M==null||M.forEach(k=>{var x,W;if(k.type=="text"){const z=((W=(x=t.options)==null?void 0:x.fields)==null?void 0:W.find(R=>{var AA;return R.value==((AA=k==null?void 0:k.props)==null?void 0:AA.FieldName)}))||{};k.props.Text=k.props.Text||(z==null?void 0:z.label)}}),[...M];const G=()=>{var W;const k=((W=document.querySelector("#design"))==null?void 0:W.querySelectorAll("img"))||[],x=Array.from(k).map(z=>z.complete?Promise.resolve():new Promise(R=>{z.onload=z.onerror=R}));return Promise.all(x)};o.nextTick(()=>{const k=document.querySelector("#design");if(!k){F(new Error("找不到要转换的DOM元素"));return}const x=l.value;G().then(()=>{zy(k,{scale:window.devicePixelRatio*(x<1?5:3)*x,useCORS:!0,allowTaint:!0,backgroundColor:null,logging:!1,onclone:W=>{const z=W.querySelector(".canvas-wrapper");if(z){const X=z.style.transform.replace(/scale\([^)]*\)/g,"").replace(/\s+/g," ").trim();z.style.transform=X||"none",z.style.opacity="1"}const R=W.querySelector("#design");if(R){const AA=window.getComputedStyle(k);for(let X=0;X<AA.length;X++){const be=AA[X];R.style[be]=AA.getPropertyValue(be)}}}}).then(W=>{const z=W.toDataURL("image/png");C({data:Nn(),image:z})}).catch(W=>{F(W)})}).catch(W=>{F(W)})})}),yA=()=>new Promise((C,F)=>{a.value.forEach(G=>{if(G.type==="image"&&!G.props.ImageSrc)return Qt.warning("图片控件请选择图片!"),F("图片控件请选择图片!")}),C(!0)});return A({getJson:()=>yA().then(()=>Nn()),clear:()=>{a.value=[],w()},snapshot:()=>yA().then(()=>rd())}),(C,F)=>{var W,z;const M=o.resolveComponent("el-icon-refresh-left"),G=o.resolveComponent("el-icon"),k=o.resolveComponent("el-icon-close"),x=o.resolveComponent("el-switch");return o.openBlock(),o.createElementBlock("div",Py,[o.createElementVNode("div",_y,[o.createVNode(_Q,{onDragStart:wA,config:e.config,propsConfig:BA.value},null,8,["config","propsConfig"])]),o.createElementVNode("div",qy,[o.createElementVNode("div",$y,[e.showGraphConfig?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createVNode(fw,{"graph-data":(W=r.value)==null?void 0:W.graphData,onSuccess:ja},null,8,["graph-data"]),F[24]||(F[24]=o.createElementVNode("div",{style:{width:"30px"}},null,-1))],64)):o.createCommentVNode("",!0),o.createElementVNode("div",AV,[o.createElementVNode("button",{onClick:J,disabled:l.value<=.8},"-",8,eV),o.createElementVNode("span",null,o.toDisplayString(Math.round(l.value*100))+"%",1),o.createElementVNode("button",{onClick:_,disabled:l.value>=4},"+",8,tV)])]),o.createElementVNode("div",rV,[o.createElementVNode("div",{class:"canvas-wrapper",style:o.normalizeStyle(`transform: scale(${l.value});opacity: ${n.value};`)},[s.value&&c.value?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("div",nV,[o.createVNode(qi,{direction:"horizontal",length:s.value},null,8,["length"])]),o.createElementVNode("div",oV,[o.createVNode(qi,{direction:"vertical",length:c.value},null,8,["length"])])],64)):o.createCommentVNode("",!0),o.createElementVNode("div",{id:"design",class:"canvas",style:o.normalizeStyle(`width: ${s.value}mm; height: ${c.value}mm;`),onDrop:dA,onDragover:F[1]||(F[1]=o.withModifiers(()=>{},["prevent"])),onPointerdown:iA},[o.unref(Q)&&o.unref(E)?(o.openBlock(),o.createElementBlock("div",aV,[o.createElementVNode("div",{class:"drag-extend-line vertical",style:o.normalizeStyle(L(o.unref(E),"left"))},null,4),o.createElementVNode("div",{class:"drag-extend-line vertical",style:o.normalizeStyle(L(o.unref(E),"right"))},null,4),o.createElementVNode("div",{class:"drag-extend-line horizontal",style:o.normalizeStyle(L(o.unref(E),"top"))},null,4),o.createElementVNode("div",{class:"drag-extend-line horizontal",style:o.normalizeStyle(L(o.unref(E),"bottom"))},null,4)])):o.createCommentVNode("",!0),o.unref(T)?(o.openBlock(),o.createElementBlock("div",lV,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(m).horizontal,(R,AA)=>(o.openBlock(),o.createElementBlock("div",{key:`h-${AA}`,class:"alignment-guide horizontal",style:o.normalizeStyle({top:`${R.y}mm`,left:"0",right:"0"})},null,4))),128)),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(m).vertical,(R,AA)=>(o.openBlock(),o.createElementBlock("div",{key:`v-${AA}`,class:"alignment-guide vertical",style:o.normalizeStyle({left:`${R.x}mm`,top:"0",bottom:"0"})},null,4))),128))])):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.value,R=>{var AA;return o.openBlock(),o.createElementBlock("div",{key:R.id,class:o.normalizeClass(["canvas-item",oA(R)]),style:o.normalizeStyle(j(R)),"data-item-id":R.id,onMousedown:o.withModifiers(X=>sA(X,R),["stop"]),onClick:o.withModifiers(X=>o.unref(U)(R),["stop"])},[o.unref(p)()===R?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[R.props.lockAspectRatio?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[R.type!=="verline"&&R.type!=="horline"?(o.openBlock(),o.createElementBlock("div",{key:0,class:"resize-handle right",style:o.normalizeStyle(rA(R,"right")),onMousedown:o.withModifiers(X=>o.unref(N)(X,R,"right"),["stop"])},null,44,sV)):o.createCommentVNode("",!0),R.type!=="horline"?(o.openBlock(),o.createElementBlock("div",{key:1,class:"resize-handle bottom",style:o.normalizeStyle(rA(R,"bottom")),onMousedown:o.withModifiers(X=>o.unref(N)(X,R,"bottom"),["stop"])},null,44,cV)):o.createCommentVNode("",!0),R.type!=="verline"?(o.openBlock(),o.createElementBlock("div",{key:2,class:"resize-handle left",style:o.normalizeStyle(rA(R,"left")),onMousedown:o.withModifiers(X=>o.unref(N)(X,R,"left"),["stop"])},null,44,dV)):o.createCommentVNode("",!0)],64)),R.type!=="horline"&&R.type!=="verline"?(o.openBlock(),o.createElementBlock("div",{key:1,class:"resize-handle top-left",style:o.normalizeStyle(rA(R,"top-left")),onMousedown:o.withModifiers(X=>o.unref(N)(X,R,"top-left"),["stop"])},null,44,uV)):o.createCommentVNode("",!0),R.type!=="horline"&&R.type!=="verline"?(o.openBlock(),o.createElementBlock("div",{key:2,class:"resize-handle bottom-right",style:o.normalizeStyle(rA(R,"bottom-right")),onMousedown:o.withModifiers(X=>o.unref(N)(X,R,"bottom-right"),["stop"])},null,44,BV)):o.createCommentVNode("",!0),R.type!=="horline"&&R.type!=="verline"?(o.openBlock(),o.createElementBlock("div",{key:3,class:"resize-handle bottom-left",style:o.normalizeStyle(rA(R,"bottom-left")),onMousedown:o.withModifiers(X=>o.unref(N)(X,R,"bottom-left"),["stop"])},null,44,fV)):o.createCommentVNode("",!0),R.type!=="verline"?(o.openBlock(),o.createElementBlock("div",{key:4,class:"rotate-handle",onMousedown:o.withModifiers(X=>o.unref(H)(X,R),["stop"])},[o.createVNode(G,{size:"6"},{default:o.withCtx(()=>[o.createVNode(M)]),_:1})],40,hV)):o.createCommentVNode("",!0),o.createElementVNode("div",{class:"delete-btn",onMousedown:F[0]||(F[0]=o.withModifiers(()=>{},["stop"])),onClick:o.withModifiers(X=>FA(R.id),["stop"]),title:"删除"},[o.createVNode(G,{size:"6"},{default:o.withCtx(()=>[o.createVNode(k)]),_:1})],40,gV)],64)):o.createCommentVNode("",!0),R.props&&GA.value?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(((AA=K(R.type))==null?void 0:AA.component)||null),{key:`${R.id}-${R.type}`,modelValue:{...R.props,__selected:o.unref(p)()===R},propsConfig:BA.value,"onUpdate:modelValue":X=>{const{__selected:be,...Me}=X;Object.keys(Me).forEach(vn=>{Me[vn]!==void 0&&(R.props[vn]=Me[vn])})}},null,8,["modelValue","propsConfig","onUpdate:modelValue"])):o.createCommentVNode("",!0)],46,iV)}),128))],36)],4)])]),o.createElementVNode("div",pV,[o.unref(f).length>0?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[F[31]||(F[31]=o.createElementVNode("h3",{class:"property-panel-title"},"属性设置",-1)),o.createElementVNode("div",UV,[o.createElementVNode("div",QV,[F[25]||(F[25]=o.createElementVNode("label",null,"X坐标:",-1)),o.createElementVNode("div",wV,[o.createElementVNode("button",{onClick:F[2]||(F[2]=R=>o.unref(_A)(R,"x",-.5))},"-"),o.withDirectives(o.createElementVNode("input",{type:"number","onUpdate:modelValue":F[3]||(F[3]=R=>o.unref(p)().props.x=R),onInput:F[4]||(F[4]=R=>o.unref(Se)("x",R.target.value))},null,544),[[o.vModelText,o.unref(p)().props.x,void 0,{number:!0}]]),o.createElementVNode("button",{onClick:F[5]||(F[5]=R=>o.unref(_A)(R,"x",.5))},"+")])]),o.createElementVNode("div",FV,[F[26]||(F[26]=o.createElementVNode("label",null,"Y坐标:",-1)),o.createElementVNode("div",EV,[o.createElementVNode("button",{onClick:F[6]||(F[6]=R=>o.unref(_A)(R,"y",-.5))},"-"),o.withDirectives(o.createElementVNode("input",{type:"number","onUpdate:modelValue":F[7]||(F[7]=R=>o.unref(p)().props.y=R),onInput:F[8]||(F[8]=R=>o.unref(Se)("y",R.target.value))},null,544),[[o.vModelText,o.unref(p)().props.y,void 0,{number:!0}]]),o.createElementVNode("button",{onClick:F[9]||(F[9]=R=>o.unref(_A)(R,"y",.5))},"+")])]),o.unref(p)().type!=="verline"?(o.openBlock(),o.createElementBlock("div",mV,[F[27]||(F[27]=o.createElementVNode("label",null,"宽度:",-1)),o.createElementVNode("div",CV,[o.createElementVNode("button",{onClick:F[10]||(F[10]=R=>o.unref(_A)(R,"width",-.5,1))},"-"),o.withDirectives(o.createElementVNode("input",{type:"number","onUpdate:modelValue":F[11]||(F[11]=R=>o.unref(p)().props.width=R),onInput:F[12]||(F[12]=R=>o.unref(Se)("width",R.target.value))},null,544),[[o.vModelText,o.unref(p)().props.width,void 0,{number:!0}]]),o.createElementVNode("button",{onClick:F[13]||(F[13]=R=>o.unref(_A)(R,"width",.5,1))},"+")])])):o.createCommentVNode("",!0),o.unref(p)().type!=="horline"?(o.openBlock(),o.createElementBlock("div",yV,[F[28]||(F[28]=o.createElementVNode("label",null,"高度:",-1)),o.createElementVNode("div",VV,[o.createElementVNode("button",{onClick:F[14]||(F[14]=R=>o.unref(_A)(R,"height",-.5,1))},"-"),o.withDirectives(o.createElementVNode("input",{type:"number","onUpdate:modelValue":F[15]||(F[15]=R=>o.unref(p)().props.height=R),onInput:F[16]||(F[16]=R=>o.unref(Se)("height",R.target.value))},null,544),[[o.vModelText,o.unref(p)().props.height,void 0,{number:!0}]]),o.createElementVNode("button",{onClick:F[17]||(F[17]=R=>o.unref(_A)(R,"height",.5,1))},"+")])])):o.createCommentVNode("",!0),o.createElementVNode("div",RV,[F[29]||(F[29]=o.createElementVNode("label",null,"旋转:",-1)),o.createElementVNode("div",TV,[o.createElementVNode("button",{onClick:F[18]||(F[18]=R=>o.unref(Ar)(-1))},"-"),o.withDirectives(o.createElementVNode("input",{type:"number","onUpdate:modelValue":F[19]||(F[19]=R=>o.unref(p)().props.rotation=R),onInput:F[20]||(F[20]=R=>o.unref(Se)("rotation",R.target.value))},null,544),[[o.vModelText,o.unref(p)().props.rotation,void 0,{number:!0}]]),o.createElementVNode("button",{onClick:F[21]||(F[21]=R=>o.unref(Ar)(1))},"+")])]),o.unref(p)().type!=="horline"?(o.openBlock(),o.createElementBlock("div",NV,[F[30]||(F[30]=o.createElementVNode("label",null,"锁定宽高比:",-1)),o.createElementVNode("div",vV,[o.createVNode(x,{modelValue:o.unref(p)().props.lockAspectRatio,"onUpdate:modelValue":F[22]||(F[22]=R=>o.unref(p)().props.lockAspectRatio=R),"active-value":!0,"inactive-value":!1},null,8,["modelValue"])])])):o.createCommentVNode("",!0)]),(o.openBlock(),o.createBlock(o.resolveDynamicComponent(((z=K(o.unref(p)().type))==null?void 0:z.propertyPanel)||null),{modelValue:o.unref(p)().props,"onUpdate:modelValue":F[23]||(F[23]=R=>o.unref(p)().props=R),options:e.options,"props-config":za(o.unref(p)().type)},null,8,["modelValue","options","props-config"]))],64)):o.createCommentVNode("",!0)])])}}},[["__scopeId","data-v-eadd84a0"]]),dR="",Rn=fA({__name:"index",props:{templateData:{type:Object,default:()=>({graphData:{},width:0,height:0,printWidth:0,printHeight:0,items:[]})},config:{type:Object,default:()=>({})}},setup(e){const A=o.getCurrentInstance(),t=e,r=o.ref(!1),n=o.ref({}),a=o.ref(),l=o.ref(0),i=o.ref(!1),s=(f,U)=>{let p;return function(...Q){const E=()=>{clearTimeout(p),f(...Q)};clearTimeout(p),p=setTimeout(E,U)}},c=o.ref({rectTop:0,isInModal:!1}),d=()=>{if(!a.value)return;const f=a.value.getBoundingClientRect(),U=B(a.value);let p=0;if(f.top>0)p=f.top;else if(U){const w=g(a.value);p=w>0?w:60}else{const w=a.value.offsetTop;w>0?p=w:p=60}(p!==c.value.rectTop||U!==c.value.isInModal)&&(l.value=p,i.value=U,c.value={rectTop:p,isInModal:U})},u=s(d,100),B=f=>{let U=f.parentElement;for(;U;){if(U.classList&&(U.classList.contains("el-dialog")||U.classList.contains("el-drawer")||U.classList.contains("sc-dialog")))return!0;U=U.parentElement}return!1},g=f=>{let U=f.parentElement;for(;U;){if(U.classList&&(U.classList.contains("el-dialog")||U.classList.contains("el-drawer")||U.classList.contains("sc-dialog"))){const p=U.getBoundingClientRect();return p.top>0?p.top:60}U=U.parentElement}return 60};o.onMounted(()=>{setTimeout(()=>d(),100),setTimeout(()=>d(),300),window.addEventListener("resize",u),o.onBeforeUnmount(()=>{window.removeEventListener("resize",u)})}),o.watch(()=>r.value,f=>{f&&o.nextTick(()=>setTimeout(()=>d(),50))}),o.watch(()=>t.templateData,async f=>{r.value=(f==null?void 0:f.width)>0&&(f==null?void 0:f.height)>0,n.value=f},{deep:!0,immediate:!0});function h(f){A.exposed=f||{},A.exposeProxy=f||{}}return(f,U)=>{const p=o.resolveDirective("loading");return o.withDirectives((o.openBlock(),o.createElementBlock("div",{ref_key:"templateDesignerRef",ref:a,class:o.normalizeClass(["template-designer",{"template-designer-border-top":i.value}]),style:o.normalizeStyle({height:"calc(100vh - "+(l.value+1)+"px)"})},[r.value?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(o.h(IV,{...f.$attrs,...t,ref:h},f.$slots)),{key:0,"template-info":n.value},null,8,["template-info"])):o.createCommentVNode("",!0)],6)),[[p,!r.value]])}}},[["__scopeId","data-v-300f49ad"]]);Rn.install=e=>{e.component(Rn.name||"TemplateDesigner",Rn)};const td=Object.freeze(Object.defineProperty({__proto__:null,default:{text:{width:20,height:4.2,rotation:0,lockAspectRatio:!1,propertyPanel:[{prop:"Title",label:"标题",default:"",layout:"full"},{prop:"FieldName",label:"字段名称",type:"select",optionsKey:"fields",default:"",layout:"full"},{prop:"Text",label:"测试数据",default:"测试文本",layout:"full"},{prop:"FontName",label:"字体名称",type:"select",options:[{label:"黑体",value:"黑体",cssValue:"SimHei"},{label:"楷体",value:"楷体",cssValue:"KaiTi"},{label:"宋体",value:"宋体",cssValue:"SimSun"}],default:"黑体",layout:"half"},{prop:"FontSize",label:"字体大小",type:"number",min:1,max:100,default:10,layout:"half"},{prop:"FontColor",label:"字体颜色",type:"color",hide:!0,default:"#000000",layout:"half"},{prop:"Bold",label:"字体加粗",type:"select",options:[{label:"加粗",value:1},{label:"不加粗",value:0}],default:0,layout:"half"},{prop:"Italic",label:"是否斜体",type:"select",options:[{label:"是",value:1},{label:"否",value:0}],default:0,layout:"half"},{prop:"Underline",label:"下划线",type:"select",options:[{label:"是",value:1},{label:"否",value:0}],default:0,hide:!0},{prop:"Alignment",label:"对齐方式",type:"select",options:[{label:"居左",value:1},{label:"居中",value:2},{label:"居右",value:3}],default:2},{prop:"TextWrap",label:"文本换行",type:"select",options:[{label:"换行",value:1},{label:"不换行&省略",value:2},{label:"不换行&隐藏",value:3}],default:1},{prop:"HOrient",label:"水平锁定",type:"select",options:[{label:"无",value:0},{label:"左边距锁定",value:1},{label:"右边距锁定",value:2},{label:"水平居中",value:3}],hide:!0,default:0},{prop:"VOrient",label:"垂直锁定",type:"select",options:[{label:"无",value:0},{label:"上边距锁定",value:1},{label:"下边距锁定",value:2},{label:"垂直居中",value:3}],hide:!0,default:0},{prop:"PenWidth",label:"线宽",type:"number",min:0,hide:!0,default:0},{prop:"PenStyle",label:"线型",type:"select",hide:!0,options:[{label:"实线",value:0},{label:"破折线",value:1},{label:"点线",value:2},{label:"点划线",value:3},{label:"双点划线",value:4}],default:0},{prop:"Stretch",label:"缩放模式",type:"select",options:[{label:"扩展",value:1},{label:"缩放",value:2}],hide:!0,default:1},{prop:"PreviewOnly",label:"仅预览",type:"select",hide:!0,options:[{label:"是",value:1},{label:"否",value:0}],default:0},{prop:"ReadOnly",label:"只读",type:"select",hide:!0,options:[{label:"是",value:1},{label:"否",value:0}],default:0}]},barcode:{width:20,height:6,rotation:0,lockAspectRatio:!1,propertyPanel:[{prop:"FieldName",label:"字段名称",type:"select",optionsKey:"fields",default:"goodsSn",layout:"full"},{prop:"BarcodeValue",label:"测试数据",type:"text",default:"1234567890"},{prop:"CodeType",label:"条码类型",type:"select",options:[{label:"CODE128",value:"128Auto",compValue:"CODE128"},{label:"CODE39",value:"Code39",compValue:"CODE39"},{label:"EAN13",value:"EAN13",compValue:"EAN13"}],hide:!0,default:"128Auto"},{prop:"AlignJustify",label:"对齐方式",type:"select",options:[{label:"两端对齐",value:0},{label:"左",value:1},{label:"中",value:2},{label:"右",value:3}],hide:!0,default:0},{prop:"LineColor",label:"条形码颜色",type:"color",hide:!0,default:"#000000"}]},qrcode:{width:10,height:10,rotation:0,lockAspectRatio:!0,propertyPanel:[{prop:"FieldName",label:"字段名称",type:"select",optionsKey:"fields",default:"",layout:"full"},{prop:"QRCodeValue",label:"测试数据",type:"text",default:"FB-GOLD"},{prop:"QRCodeVersion",label:"二维码版本",type:"number",min:1,max:40,hide:!0,default:7},{prop:"QRCodeErrorLevel",label:"纠错级别",type:"select",options:[{label:"L (7%)",value:"L"},{label:"M (15%)",value:"M"},{label:"Q (25%)",value:"Q"},{label:"H (30%)",value:"H"}],hide:!0,default:"Q"},{prop:"QRCodeEncodeMode",label:"编码模式",type:"select",options:[{label:"数字",value:"N"},{label:"二进制或汉语",value:"B"},{label:"英文字母",value:"A"}],hide:!0,default:"B"},{prop:"QRCodeForeground",label:"前景色",type:"color",hide:!0,default:"#000000"},{prop:"QRCodeBackground",label:"背景景色",type:"color",hide:!0,default:"transparent"}]},image:{width:12,height:12,rotation:0,lockAspectRatio:!1,propertyPanel:[{prop:"ImageSrc",label:"图片地址",type:"file",accept:"image/*",default:""},{prop:"ScaleMode",label:"图片缩放",type:"select",options:[{label:"原始尺寸",value:1},{label:"居中裁剪",value:2},{label:"填充",value:3}],default:1},{prop:"IsPrint",label:"是否打印",type:"select",options:[{label:"是",value:!0},{label:"否",value:!1}],default:!0}]},rectangle:{width:15,height:10,rotation:0,lockAspectRatio:!1,propertyPanel:[{prop:"LineWidth",type:"select",label:"线宽",default:"0.75pt",options:[{label:"0.75pt",value:"0.75pt"},{label:"1.5pt",value:"1.5pt"},{label:"2.25pt",value:"2.25pt"},{label:"3pt",value:"3pt"},{label:"3.75pt",value:"3.75pt"},{label:"4.5pt",value:"4.5pt"},{label:"5.25pt",value:"5.25pt"},{label:"6pt",value:"6pt"},{label:"6.75pt",value:"6.75pt"}]},{prop:"LineStyle",type:"select",label:"样式",default:"实线",options:[{label:"实线",value:"实线"},{label:"虚线",value:"虚线"}]},{prop:"BorderRadius",type:"number",label:"圆角",default:0,min:0,step:1}]},horline:{width:15,height:.75,rotation:0,lockAspectRatio:!1,propertyPanel:[{prop:"LineWidth",type:"select",label:"线宽",default:"0.75pt",options:[{label:"0.75pt",value:"0.75pt"},{label:"1.5pt",value:"1.5pt"},{label:"2.25pt",value:"2.25pt"},{label:"3pt",value:"3pt"},{label:"3.75pt",value:"3.75pt"},{label:"4.5pt",value:"4.5pt"},{label:"5.25pt",value:"5.25pt"},{label:"6pt",value:"6pt"},{label:"6.75pt",value:"6.75pt"}]},{prop:"LineStyle",type:"select",label:"样式",default:"实线",options:[{label:"实线",value:"实线"},{label:"虚线",value:"虚线"}]}]}}},Symbol.toStringTag,{value:"Module"})),SV=Object.freeze(Object.defineProperty({__proto__:null,default:{text:{x:0,y:0,width:20,height:4.2,rotation:0,Title:"",FieldName:"",Text:"测试文本",FontName:"黑体",FontSize:10,FontColor:"#000000",Bold:0,Italic:0,Underline:0,Alignment:2,TextWrap:1,HOrient:0,VOrient:0,PenWidth:0,PenStyle:0,Stretch:1,PreviewOnly:0,ReadOnly:0,propertyPanel:[{prop:"Title",label:"标题",default:"",layout:"full"},{prop:"FieldName",label:"字段名称",type:"select",optionsKey:"fields",default:"",layout:"full"},{prop:"Text",label:"测试数据",default:"测试文本",layout:"full"},{prop:"FontName",label:"字体名称",type:"select",options:[{label:"黑体",value:"黑体",cssValue:"SimHei"},{label:"楷体",value:"楷体",cssValue:"KaiTi"},{label:"宋体",value:"宋体",cssValue:"SimSun"}],default:"黑体",layout:"half"},{prop:"FontSize",label:"字体大小",type:"number",min:1,max:100,default:10,layout:"half"},{prop:"FontColor",label:"字体颜色",type:"color",hide:!0,default:"#000000",layout:"half"},{prop:"Bold",label:"字体加粗",type:"select",options:[{label:"加粗",value:1},{label:"不加粗",value:0}],default:0,layout:"half"},{prop:"Italic",label:"是否斜体",type:"select",options:[{label:"是",value:1},{label:"否",value:0}],default:0,layout:"half"},{prop:"Alignment",label:"对齐方式",type:"select",options:[{label:"居左",value:1},{label:"居中",value:2},{label:"居右",value:3}],default:2,layout:"half"},{prop:"TextWrap",label:"文本换行",type:"select",options:[{label:"换行",value:1},{label:"不换行&省略",value:2},{label:"不换行&隐藏",value:3}],default:1,layout:"half"}]},barcode:{x:0,y:0,width:20,height:6,rotation:0,FieldName:"goodsSn",BarcodeValue:"1234567890",CodeType:"128Auto",AlignJustify:0,LineColor:"#000000",propertyPanel:[{prop:"FieldName",label:"字段名称",type:"select",optionsKey:"fields",default:"goodsSn",layout:"full"},{prop:"BarcodeValue",label:"测试数据",type:"text",default:"1234567890"},{prop:"CodeType",label:"条码类型",type:"select",options:[{label:"CODE128",value:"128Auto",compValue:"CODE128"},{label:"CODE39",value:"Code39",compValue:"CODE39"},{label:"EAN13",value:"EAN13",compValue:"EAN13"}],hide:!0,default:"128Auto"},{prop:"AlignJustify",label:"对齐方式",type:"select",options:[{label:"两端对齐",value:0},{label:"左",value:1},{label:"中",value:2},{label:"右",value:3}],hide:!0,default:0},{prop:"LineColor",label:"条形码颜色",type:"color",hide:!0,default:"#000000"}]},qrcode:{x:0,y:0,width:10,height:10,rotation:0,FieldName:"",QRCodeValue:"FB-GOLD",QRCodeVersion:7,QRCodeErrorLevel:"Q",QRCodeEncodeMode:"B",QRCodeForeground:"#000000",QRCodeBackground:"transparent",LockAspectRatio:!0,lockAspectRatio:!0,propertyPanel:[{prop:"FieldName",label:"字段名称",type:"select",optionsKey:"fields",default:"",layout:"full"},{prop:"QRCodeValue",label:"测试数据",type:"text",default:"FB-GOLD"},{prop:"QRCodeVersion",label:"二维码版本",type:"number",min:1,max:40,hide:!0,default:7},{prop:"QRCodeErrorLevel",label:"纠错级别",type:"select",options:[{label:"L (7%)",value:"L"},{label:"M (15%)",value:"M"},{label:"Q (25%)",value:"Q"},{label:"H (30%)",value:"H"}],hide:!0,default:"Q"},{prop:"QRCodeEncodeMode",label:"编码模式",type:"select",options:[{label:"数字",value:"N"},{label:"二进制或汉语",value:"B"},{label:"英文字母",value:"A"}],hide:!0,default:"B"},{prop:"QRCodeForeground",label:"前景色",type:"color",hide:!0,default:"#000000"},{prop:"QRCodeBackground",label:"背景景色",type:"color",hide:!0,default:"transparent"}]}}},Symbol.toStringTag,{value:"Module"}));return Rn});
59
+ .`+Da+sy+Gc)},dy=function(e,A){var t=e.ownerDocument;if(t){var r=t.createElement("style");r.textContent=A,e.appendChild(r)}},Yc=function(){function e(){}return e.getOrigin=function(A){var t=e._link;return t?(t.href=A,t.href=t.href,t.protocol+t.hostname+t.port):"about:blank"},e.isSameOrigin=function(A){return e.getOrigin(A)===e._origin},e.setContext=function(A){e._link=A.document.createElement("a"),e._origin=e.getOrigin(A.location.href)},e._origin="about:blank",e}(),uy=function(){function e(A,t){this.context=A,this._options=t,this._cache={}}return e.prototype.addImage=function(A){var t=Promise.resolve();return this.has(A)||(La(A)||gy(A))&&(this._cache[A]=this.loadImage(A)).catch(function(){}),t},e.prototype.match=function(A){return this._cache[A]},e.prototype.loadImage=function(A){return CA(this,void 0,void 0,function(){var t,r,n,a,l=this;return UA(this,function(i){switch(i.label){case 0:return t=Yc.isSameOrigin(A),r=!Ja(A)&&this._options.useCORS===!0&&pA.SUPPORT_CORS_IMAGES&&!t,n=!Ja(A)&&!t&&!La(A)&&typeof this._options.proxy=="string"&&pA.SUPPORT_CORS_XHR&&!r,!t&&this._options.allowTaint===!1&&!Ja(A)&&!La(A)&&!n&&!r?[2]:(a=A,n?[4,this.proxy(a)]:[3,2]);case 1:a=i.sent(),i.label=2;case 2:return this.context.logger.debug("Added image "+A.substring(0,256)),[4,new Promise(function(s,c){var d=new Image;d.onload=function(){return s(d)},d.onerror=c,(py(a)||r)&&(d.crossOrigin="anonymous"),d.src=a,d.complete===!0&&setTimeout(function(){return s(d)},500),l._options.imageTimeout>0&&setTimeout(function(){return c("Timed out ("+l._options.imageTimeout+"ms) loading image")},l._options.imageTimeout)})];case 3:return[2,i.sent()]}})})},e.prototype.has=function(A){return typeof this._cache[A]<"u"},e.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},e.prototype.proxy=function(A){var t=this,r=this._options.proxy;if(!r)throw new Error("No proxy defined");var n=A.substring(0,256);return new Promise(function(a,l){var i=pA.SUPPORT_RESPONSE_TYPE?"blob":"text",s=new XMLHttpRequest;s.onload=function(){if(s.status===200)if(i==="text")a(s.response);else{var u=new FileReader;u.addEventListener("load",function(){return a(u.result)},!1),u.addEventListener("error",function(B){return l(B)},!1),u.readAsDataURL(s.response)}else l("Failed to proxy resource "+n+" with status code "+s.status)},s.onerror=l;var c=r.indexOf("?")>-1?"&":"?";if(s.open("GET",""+r+c+"url="+encodeURIComponent(A)+"&responseType="+i),i!=="text"&&s instanceof XMLHttpRequest&&(s.responseType=i),t._options.imageTimeout){var d=t._options.imageTimeout;s.timeout=d,s.ontimeout=function(){return l("Timed out ("+d+"ms) proxying "+n)}}s.send()})},e}(),By=/^data:image\/svg\+xml/i,fy=/^data:image\/.*;base64,/i,hy=/^data:image\/.*/i,gy=function(e){return pA.SUPPORT_SVG_DRAWING||!Uy(e)},Ja=function(e){return hy.test(e)},py=function(e){return fy.test(e)},La=function(e){return e.substr(0,4)==="blob"},Uy=function(e){return e.substr(-3).toLowerCase()==="svg"||By.test(e)},S=function(){function e(A,t){this.type=0,this.x=A,this.y=t}return e.prototype.add=function(A,t){return new e(this.x+A,this.y+t)},e}(),ct=function(e,A,t){return new S(e.x+(A.x-e.x)*t,e.y+(A.y-e.y)*t)},Qn=function(){function e(A,t,r,n){this.type=1,this.start=A,this.startControl=t,this.endControl=r,this.end=n}return e.prototype.subdivide=function(A,t){var r=ct(this.start,this.startControl,A),n=ct(this.startControl,this.endControl,A),a=ct(this.endControl,this.end,A),l=ct(r,n,A),i=ct(n,a,A),s=ct(l,i,A);return t?new e(this.start,r,l,s):new e(s,i,a,this.end)},e.prototype.add=function(A,t){return new e(this.start.add(A,t),this.startControl.add(A,t),this.endControl.add(A,t),this.end.add(A,t))},e.prototype.reverse=function(){return new e(this.end,this.endControl,this.startControl,this.start)},e}(),ZA=function(e){return e.type===1},Qy=function(){function e(A){var t=A.styles,r=A.bounds,n=Yt(t.borderTopLeftRadius,r.width,r.height),a=n[0],l=n[1],i=Yt(t.borderTopRightRadius,r.width,r.height),s=i[0],c=i[1],d=Yt(t.borderBottomRightRadius,r.width,r.height),u=d[0],B=d[1],g=Yt(t.borderBottomLeftRadius,r.width,r.height),h=g[0],f=g[1],U=[];U.push((a+s)/r.width),U.push((h+u)/r.width),U.push((l+f)/r.height),U.push((c+B)/r.height);var p=Math.max.apply(Math,U);p>1&&(a/=p,l/=p,s/=p,c/=p,u/=p,B/=p,h/=p,f/=p);var w=r.width-s,Q=r.height-B,E=r.width-u,y=r.height-f,m=t.borderTopWidth,T=t.borderRightWidth,v=t.borderBottomWidth,V=t.borderLeftWidth,N=eA(t.paddingTop,A.bounds.width),H=eA(t.paddingRight,A.bounds.width),Z=eA(t.paddingBottom,A.bounds.width),I=eA(t.paddingLeft,A.bounds.width);this.topLeftBorderDoubleOuterBox=a>0||l>0?nA(r.left+V/3,r.top+m/3,a-V/3,l-m/3,P.TOP_LEFT):new S(r.left+V/3,r.top+m/3),this.topRightBorderDoubleOuterBox=a>0||l>0?nA(r.left+w,r.top+m/3,s-T/3,c-m/3,P.TOP_RIGHT):new S(r.left+r.width-T/3,r.top+m/3),this.bottomRightBorderDoubleOuterBox=u>0||B>0?nA(r.left+E,r.top+Q,u-T/3,B-v/3,P.BOTTOM_RIGHT):new S(r.left+r.width-T/3,r.top+r.height-v/3),this.bottomLeftBorderDoubleOuterBox=h>0||f>0?nA(r.left+V/3,r.top+y,h-V/3,f-v/3,P.BOTTOM_LEFT):new S(r.left+V/3,r.top+r.height-v/3),this.topLeftBorderDoubleInnerBox=a>0||l>0?nA(r.left+V*2/3,r.top+m*2/3,a-V*2/3,l-m*2/3,P.TOP_LEFT):new S(r.left+V*2/3,r.top+m*2/3),this.topRightBorderDoubleInnerBox=a>0||l>0?nA(r.left+w,r.top+m*2/3,s-T*2/3,c-m*2/3,P.TOP_RIGHT):new S(r.left+r.width-T*2/3,r.top+m*2/3),this.bottomRightBorderDoubleInnerBox=u>0||B>0?nA(r.left+E,r.top+Q,u-T*2/3,B-v*2/3,P.BOTTOM_RIGHT):new S(r.left+r.width-T*2/3,r.top+r.height-v*2/3),this.bottomLeftBorderDoubleInnerBox=h>0||f>0?nA(r.left+V*2/3,r.top+y,h-V*2/3,f-v*2/3,P.BOTTOM_LEFT):new S(r.left+V*2/3,r.top+r.height-v*2/3),this.topLeftBorderStroke=a>0||l>0?nA(r.left+V/2,r.top+m/2,a-V/2,l-m/2,P.TOP_LEFT):new S(r.left+V/2,r.top+m/2),this.topRightBorderStroke=a>0||l>0?nA(r.left+w,r.top+m/2,s-T/2,c-m/2,P.TOP_RIGHT):new S(r.left+r.width-T/2,r.top+m/2),this.bottomRightBorderStroke=u>0||B>0?nA(r.left+E,r.top+Q,u-T/2,B-v/2,P.BOTTOM_RIGHT):new S(r.left+r.width-T/2,r.top+r.height-v/2),this.bottomLeftBorderStroke=h>0||f>0?nA(r.left+V/2,r.top+y,h-V/2,f-v/2,P.BOTTOM_LEFT):new S(r.left+V/2,r.top+r.height-v/2),this.topLeftBorderBox=a>0||l>0?nA(r.left,r.top,a,l,P.TOP_LEFT):new S(r.left,r.top),this.topRightBorderBox=s>0||c>0?nA(r.left+w,r.top,s,c,P.TOP_RIGHT):new S(r.left+r.width,r.top),this.bottomRightBorderBox=u>0||B>0?nA(r.left+E,r.top+Q,u,B,P.BOTTOM_RIGHT):new S(r.left+r.width,r.top+r.height),this.bottomLeftBorderBox=h>0||f>0?nA(r.left,r.top+y,h,f,P.BOTTOM_LEFT):new S(r.left,r.top+r.height),this.topLeftPaddingBox=a>0||l>0?nA(r.left+V,r.top+m,Math.max(0,a-V),Math.max(0,l-m),P.TOP_LEFT):new S(r.left+V,r.top+m),this.topRightPaddingBox=s>0||c>0?nA(r.left+Math.min(w,r.width-T),r.top+m,w>r.width+T?0:Math.max(0,s-T),Math.max(0,c-m),P.TOP_RIGHT):new S(r.left+r.width-T,r.top+m),this.bottomRightPaddingBox=u>0||B>0?nA(r.left+Math.min(E,r.width-V),r.top+Math.min(Q,r.height-v),Math.max(0,u-T),Math.max(0,B-v),P.BOTTOM_RIGHT):new S(r.left+r.width-T,r.top+r.height-v),this.bottomLeftPaddingBox=h>0||f>0?nA(r.left+V,r.top+Math.min(y,r.height-v),Math.max(0,h-V),Math.max(0,f-v),P.BOTTOM_LEFT):new S(r.left+V,r.top+r.height-v),this.topLeftContentBox=a>0||l>0?nA(r.left+V+I,r.top+m+N,Math.max(0,a-(V+I)),Math.max(0,l-(m+N)),P.TOP_LEFT):new S(r.left+V+I,r.top+m+N),this.topRightContentBox=s>0||c>0?nA(r.left+Math.min(w,r.width+V+I),r.top+m+N,w>r.width+V+I?0:s-V+I,c-(m+N),P.TOP_RIGHT):new S(r.left+r.width-(T+H),r.top+m+N),this.bottomRightContentBox=u>0||B>0?nA(r.left+Math.min(E,r.width-(V+I)),r.top+Math.min(Q,r.height+m+N),Math.max(0,u-(T+H)),B-(v+Z),P.BOTTOM_RIGHT):new S(r.left+r.width-(T+H),r.top+r.height-(v+Z)),this.bottomLeftContentBox=h>0||f>0?nA(r.left+V+I,r.top+y,Math.max(0,h-(V+I)),f-(v+Z),P.BOTTOM_LEFT):new S(r.left+V+I,r.top+r.height-(v+Z))}return e}(),P;(function(e){e[e.TOP_LEFT=0]="TOP_LEFT",e[e.TOP_RIGHT=1]="TOP_RIGHT",e[e.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",e[e.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(P||(P={}));var nA=function(e,A,t,r,n){var a=4*((Math.sqrt(2)-1)/3),l=t*a,i=r*a,s=e+t,c=A+r;switch(n){case P.TOP_LEFT:return new Qn(new S(e,c),new S(e,c-i),new S(s-l,A),new S(s,A));case P.TOP_RIGHT:return new Qn(new S(e,A),new S(e+l,A),new S(s,c-i),new S(s,c));case P.BOTTOM_RIGHT:return new Qn(new S(s,A),new S(s,A+i),new S(e+l,c),new S(e,c));case P.BOTTOM_LEFT:default:return new Qn(new S(s,c),new S(s-l,c),new S(e,A+i),new S(e,A))}},wn=function(e){return[e.topLeftBorderBox,e.topRightBorderBox,e.bottomRightBorderBox,e.bottomLeftBorderBox]},wy=function(e){return[e.topLeftContentBox,e.topRightContentBox,e.bottomRightContentBox,e.bottomLeftContentBox]},Fn=function(e){return[e.topLeftPaddingBox,e.topRightPaddingBox,e.bottomRightPaddingBox,e.bottomLeftPaddingBox]},Fy=function(){function e(A,t,r){this.offsetX=A,this.offsetY=t,this.matrix=r,this.type=0,this.target=6}return e}(),En=function(){function e(A,t){this.path=A,this.target=t,this.type=1}return e}(),Ey=function(){function e(A){this.opacity=A,this.type=2,this.target=6}return e}(),my=function(e){return e.type===0},zc=function(e){return e.type===1},Cy=function(e){return e.type===2},jc=function(e,A){return e.length===A.length?e.some(function(t,r){return t===A[r]}):!1},yy=function(e,A,t,r,n){return e.map(function(a,l){switch(l){case 0:return a.add(A,t);case 1:return a.add(A+r,t);case 2:return a.add(A+r,t+n);case 3:return a.add(A,t+n)}return a})},Xc=function(){function e(A){this.element=A,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return e}(),Pc=function(){function e(A,t){if(this.container=A,this.parent=t,this.effects=[],this.curves=new Qy(this.container),this.container.styles.opacity<1&&this.effects.push(new Ey(this.container.styles.opacity)),this.container.styles.transform!==null){var r=this.container.bounds.left+this.container.styles.transformOrigin[0].number,n=this.container.bounds.top+this.container.styles.transformOrigin[1].number,a=this.container.styles.transform;this.effects.push(new Fy(r,n,a))}if(this.container.styles.overflowX!==0){var l=wn(this.curves),i=Fn(this.curves);jc(l,i)?this.effects.push(new En(l,6)):(this.effects.push(new En(l,2)),this.effects.push(new En(i,4)))}}return e.prototype.getEffects=function(A){for(var t=[2,3].indexOf(this.container.styles.position)===-1,r=this.parent,n=this.effects.slice(0);r;){var a=r.effects.filter(function(s){return!zc(s)});if(t||r.container.styles.position!==0||!r.parent){if(n.unshift.apply(n,a),t=[2,3].indexOf(r.container.styles.position)===-1,r.container.styles.overflowX!==0){var l=wn(r.curves),i=Fn(r.curves);jc(l,i)||n.unshift(new En(i,6))}}else n.unshift.apply(n,a);r=r.parent}return n.filter(function(s){return uA(s.target,A)})},e}(),Ka=function(e,A,t,r){e.container.elements.forEach(function(n){var a=uA(n.flags,4),l=uA(n.flags,2),i=new Pc(n,e);uA(n.styles.display,2048)&&r.push(i);var s=uA(n.flags,8)?[]:r;if(a||l){var c=a||n.styles.isPositioned()?t:A,d=new Xc(i);if(n.styles.isPositioned()||n.styles.opacity<1||n.styles.isTransformed()){var u=n.styles.zIndex.order;if(u<0){var B=0;c.negativeZIndex.some(function(h,f){return u>h.element.container.styles.zIndex.order?(B=f,!1):B>0}),c.negativeZIndex.splice(B,0,d)}else if(u>0){var g=0;c.positiveZIndex.some(function(h,f){return u>=h.element.container.styles.zIndex.order?(g=f+1,!1):g>0}),c.positiveZIndex.splice(g,0,d)}else c.zeroOrAutoZIndexOrTransformedOrOpacity.push(d)}else n.styles.isFloating()?c.nonPositionedFloats.push(d):c.nonPositionedInlineLevel.push(d);Ka(i,d,a?d:t,s)}else n.styles.isInlineLevel()?A.inlineLevel.push(i):A.nonInlineLevel.push(i),Ka(i,A,t,s);uA(n.flags,8)&&_c(n,s)})},_c=function(e,A){for(var t=e instanceof ba?e.start:1,r=e instanceof ba?e.reversed:!1,n=0;n<A.length;n++){var a=A[n];a.container instanceof Ec&&typeof a.container.value=="number"&&a.container.value!==0&&(t=a.container.value),a.listValue=qt(t,a.container.styles.listStyleType,!0),t+=r?-1:1}},Vy=function(e){var A=new Pc(e,null),t=new Xc(A),r=[];return Ka(A,t,t,r),_c(A.container,r),t},qc=function(e,A){switch(A){case 0:return OA(e.topLeftBorderBox,e.topLeftPaddingBox,e.topRightBorderBox,e.topRightPaddingBox);case 1:return OA(e.topRightBorderBox,e.topRightPaddingBox,e.bottomRightBorderBox,e.bottomRightPaddingBox);case 2:return OA(e.bottomRightBorderBox,e.bottomRightPaddingBox,e.bottomLeftBorderBox,e.bottomLeftPaddingBox);case 3:default:return OA(e.bottomLeftBorderBox,e.bottomLeftPaddingBox,e.topLeftBorderBox,e.topLeftPaddingBox)}},Ry=function(e,A){switch(A){case 0:return OA(e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox,e.topRightBorderBox,e.topRightBorderDoubleOuterBox);case 1:return OA(e.topRightBorderBox,e.topRightBorderDoubleOuterBox,e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox);case 2:return OA(e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox,e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox);case 3:default:return OA(e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox,e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox)}},Ty=function(e,A){switch(A){case 0:return OA(e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox,e.topRightBorderDoubleInnerBox,e.topRightPaddingBox);case 1:return OA(e.topRightBorderDoubleInnerBox,e.topRightPaddingBox,e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox);case 2:return OA(e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox,e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox);case 3:default:return OA(e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox,e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox)}},Ny=function(e,A){switch(A){case 0:return mn(e.topLeftBorderStroke,e.topRightBorderStroke);case 1:return mn(e.topRightBorderStroke,e.bottomRightBorderStroke);case 2:return mn(e.bottomRightBorderStroke,e.bottomLeftBorderStroke);case 3:default:return mn(e.bottomLeftBorderStroke,e.topLeftBorderStroke)}},mn=function(e,A){var t=[];return ZA(e)?t.push(e.subdivide(.5,!1)):t.push(e),ZA(A)?t.push(A.subdivide(.5,!0)):t.push(A),t},OA=function(e,A,t,r){var n=[];return ZA(e)?n.push(e.subdivide(.5,!1)):n.push(e),ZA(t)?n.push(t.subdivide(.5,!0)):n.push(t),ZA(r)?n.push(r.subdivide(.5,!0).reverse()):n.push(r),ZA(A)?n.push(A.subdivide(.5,!1).reverse()):n.push(A),n},$c=function(e){var A=e.bounds,t=e.styles;return A.add(t.borderLeftWidth,t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth),-(t.borderTopWidth+t.borderBottomWidth))},Cn=function(e){var A=e.styles,t=e.bounds,r=eA(A.paddingLeft,t.width),n=eA(A.paddingRight,t.width),a=eA(A.paddingTop,t.width),l=eA(A.paddingBottom,t.width);return t.add(r+A.borderLeftWidth,a+A.borderTopWidth,-(A.borderRightWidth+A.borderLeftWidth+r+n),-(A.borderTopWidth+A.borderBottomWidth+a+l))},vy=function(e,A){return e===0?A.bounds:e===2?Cn(A):$c(A)},Iy=function(e,A){return e===0?A.bounds:e===2?Cn(A):$c(A)},Ga=function(e,A,t){var r=vy(ut(e.styles.backgroundOrigin,A),e),n=Iy(ut(e.styles.backgroundClip,A),e),a=Sy(ut(e.styles.backgroundSize,A),t,r),l=a[0],i=a[1],s=Yt(ut(e.styles.backgroundPosition,A),r.width-l,r.height-i),c=by(ut(e.styles.backgroundRepeat,A),s,a,r,n),d=Math.round(r.left+s[0]),u=Math.round(r.top+s[1]);return[c,d,u,l,i]},dt=function(e){return q(e)&&e.value===at.AUTO},yn=function(e){return typeof e=="number"},Sy=function(e,A,t){var r=A[0],n=A[1],a=A[2],l=e[0],i=e[1];if(!l)return[0,0];if(cA(l)&&i&&cA(i))return[eA(l,t.width),eA(i,t.height)];var s=yn(a);if(q(l)&&(l.value===at.CONTAIN||l.value===at.COVER)){if(yn(a)){var c=t.width/t.height;return c<a!=(l.value===at.COVER)?[t.width,t.width/a]:[t.height*a,t.height]}return[t.width,t.height]}var d=yn(r),u=yn(n),B=d||u;if(dt(l)&&(!i||dt(i))){if(d&&u)return[r,n];if(!s&&!B)return[t.width,t.height];if(B&&s){var g=d?r:n*a,h=u?n:r/a;return[g,h]}var f=d?r:t.width,U=u?n:t.height;return[f,U]}if(s){var p=0,w=0;return cA(l)?p=eA(l,t.width):cA(i)&&(w=eA(i,t.height)),dt(l)?p=w*a:(!i||dt(i))&&(w=p/a),[p,w]}var Q=null,E=null;if(cA(l)?Q=eA(l,t.width):i&&cA(i)&&(E=eA(i,t.height)),Q!==null&&(!i||dt(i))&&(E=d&&u?Q/r*n:t.height),E!==null&&dt(l)&&(Q=d&&u?E/n*r:t.width),Q!==null&&E!==null)return[Q,E];throw new Error("Unable to calculate background-size for element")},ut=function(e,A){var t=e[A];return typeof t>"u"?e[0]:t},by=function(e,A,t,r,n){var a=A[0],l=A[1],i=t[0],s=t[1];switch(e){case 2:return[new S(Math.round(r.left),Math.round(r.top+l)),new S(Math.round(r.left+r.width),Math.round(r.top+l)),new S(Math.round(r.left+r.width),Math.round(s+r.top+l)),new S(Math.round(r.left),Math.round(s+r.top+l))];case 3:return[new S(Math.round(r.left+a),Math.round(r.top)),new S(Math.round(r.left+a+i),Math.round(r.top)),new S(Math.round(r.left+a+i),Math.round(r.height+r.top)),new S(Math.round(r.left+a),Math.round(r.height+r.top))];case 1:return[new S(Math.round(r.left+a),Math.round(r.top+l)),new S(Math.round(r.left+a+i),Math.round(r.top+l)),new S(Math.round(r.left+a+i),Math.round(r.top+l+s)),new S(Math.round(r.left+a),Math.round(r.top+l+s))];default:return[new S(Math.round(n.left),Math.round(n.top)),new S(Math.round(n.left+n.width),Math.round(n.top)),new S(Math.round(n.left+n.width),Math.round(n.height+n.top)),new S(Math.round(n.left),Math.round(n.height+n.top))]}},My="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",Ad="Hidden Text",Hy=function(){function e(A){this._data={},this._document=A}return e.prototype.parseMetrics=function(A,t){var r=this._document.createElement("div"),n=this._document.createElement("img"),a=this._document.createElement("span"),l=this._document.body;r.style.visibility="hidden",r.style.fontFamily=A,r.style.fontSize=t,r.style.margin="0",r.style.padding="0",r.style.whiteSpace="nowrap",l.appendChild(r),n.src=My,n.width=1,n.height=1,n.style.margin="0",n.style.padding="0",n.style.verticalAlign="baseline",a.style.fontFamily=A,a.style.fontSize=t,a.style.margin="0",a.style.padding="0",a.appendChild(this._document.createTextNode(Ad)),r.appendChild(a),r.appendChild(n);var i=n.offsetTop-a.offsetTop+2;r.removeChild(a),r.appendChild(this._document.createTextNode(Ad)),r.style.lineHeight="normal",n.style.verticalAlign="super";var s=n.offsetTop-r.offsetTop+2;return l.removeChild(r),{baseline:i,middle:s}},e.prototype.getMetrics=function(A,t){var r=A+" "+t;return typeof this._data[r]>"u"&&(this._data[r]=this.parseMetrics(A,t)),this._data[r]},e}(),ed=function(){function e(A,t){this.context=A,this.options=t}return e}(),xy=1e4,ky=function(e){JA(A,e);function A(t,r){var n=e.call(this,t,r)||this;return n._activeEffects=[],n.canvas=r.canvas?r.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),r.canvas||(n.canvas.width=Math.floor(r.width*r.scale),n.canvas.height=Math.floor(r.height*r.scale),n.canvas.style.width=r.width+"px",n.canvas.style.height=r.height+"px"),n.fontMetrics=new Hy(document),n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-r.x,-r.y),n.ctx.textBaseline="bottom",n._activeEffects=[],n.context.logger.debug("Canvas renderer initialized ("+r.width+"x"+r.height+") with scale "+r.scale),n}return A.prototype.applyEffects=function(t){for(var r=this;this._activeEffects.length;)this.popEffect();t.forEach(function(n){return r.applyEffect(n)})},A.prototype.applyEffect=function(t){this.ctx.save(),Cy(t)&&(this.ctx.globalAlpha=t.opacity),my(t)&&(this.ctx.translate(t.offsetX,t.offsetY),this.ctx.transform(t.matrix[0],t.matrix[1],t.matrix[2],t.matrix[3],t.matrix[4],t.matrix[5]),this.ctx.translate(-t.offsetX,-t.offsetY)),zc(t)&&(this.path(t.path),this.ctx.clip()),this._activeEffects.push(t)},A.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},A.prototype.renderStack=function(t){return CA(this,void 0,void 0,function(){var r;return UA(this,function(n){switch(n.label){case 0:return r=t.element.container.styles,r.isVisible()?[4,this.renderStackContent(t)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}})})},A.prototype.renderNode=function(t){return CA(this,void 0,void 0,function(){return UA(this,function(r){switch(r.label){case 0:if(uA(t.container.flags,16))debugger;return t.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(t)]:[3,3];case 1:return r.sent(),[4,this.renderNodeContent(t)];case 2:r.sent(),r.label=3;case 3:return[2]}})})},A.prototype.renderTextWithLetterSpacing=function(t,r,n){var a=this;if(r===0)this.ctx.fillText(t.text,t.bounds.left,t.bounds.top+n);else{var l=Sa(t.text);l.reduce(function(i,s){return a.ctx.fillText(s,i,t.bounds.top+n),i+a.ctx.measureText(s).width},t.bounds.left)}},A.prototype.createFontStyle=function(t){var r=t.fontVariant.filter(function(l){return l==="normal"||l==="small-caps"}).join(""),n=Jy(t.fontFamily).join(", "),a=Gt(t.fontSize)?""+t.fontSize.number+t.fontSize.unit:t.fontSize.number+"px";return[[t.fontStyle,r,t.fontWeight,a,n].join(" "),n,a]},A.prototype.renderTextNode=function(t,r){return CA(this,void 0,void 0,function(){var n,a,l,i,s,c,d,u,B=this;return UA(this,function(g){return n=this.createFontStyle(r),a=n[0],l=n[1],i=n[2],this.ctx.font=a,this.ctx.direction=r.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",s=this.fontMetrics.getMetrics(l,i),c=s.baseline,d=s.middle,u=r.paintOrder,t.textBounds.forEach(function(h){u.forEach(function(f){switch(f){case 0:B.ctx.fillStyle=hA(r.color),B.renderTextWithLetterSpacing(h,r.letterSpacing,c);var U=r.textShadow;U.length&&h.text.trim().length&&(U.slice(0).reverse().forEach(function(p){B.ctx.shadowColor=hA(p.color),B.ctx.shadowOffsetX=p.offsetX.number*B.options.scale,B.ctx.shadowOffsetY=p.offsetY.number*B.options.scale,B.ctx.shadowBlur=p.blur.number,B.renderTextWithLetterSpacing(h,r.letterSpacing,c)}),B.ctx.shadowColor="",B.ctx.shadowOffsetX=0,B.ctx.shadowOffsetY=0,B.ctx.shadowBlur=0),r.textDecorationLine.length&&(B.ctx.fillStyle=hA(r.textDecorationColor||r.color),r.textDecorationLine.forEach(function(p){switch(p){case 1:B.ctx.fillRect(h.bounds.left,Math.round(h.bounds.top+c),h.bounds.width,1);break;case 2:B.ctx.fillRect(h.bounds.left,Math.round(h.bounds.top),h.bounds.width,1);break;case 3:B.ctx.fillRect(h.bounds.left,Math.ceil(h.bounds.top+d),h.bounds.width,1);break}}));break;case 1:r.webkitTextStrokeWidth&&h.text.trim().length&&(B.ctx.strokeStyle=hA(r.webkitTextStrokeColor),B.ctx.lineWidth=r.webkitTextStrokeWidth,B.ctx.lineJoin=window.chrome?"miter":"round",B.ctx.strokeText(h.text,h.bounds.left,h.bounds.top+c)),B.ctx.strokeStyle="",B.ctx.lineWidth=0,B.ctx.lineJoin="miter";break}})}),[2]})})},A.prototype.renderReplacedElement=function(t,r,n){if(n&&t.intrinsicWidth>0&&t.intrinsicHeight>0){var a=Cn(t),l=Fn(r);this.path(l),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(n,0,0,t.intrinsicWidth,t.intrinsicHeight,a.left,a.top,a.width,a.height),this.ctx.restore()}},A.prototype.renderNodeContent=function(t){return CA(this,void 0,void 0,function(){var r,n,a,l,i,s,w,w,c,d,u,B,E,g,h,y,f,U,p,w,Q,E,y;return UA(this,function(m){switch(m.label){case 0:this.applyEffects(t.getEffects(4)),r=t.container,n=t.curves,a=r.styles,l=0,i=r.textNodes,m.label=1;case 1:return l<i.length?(s=i[l],[4,this.renderTextNode(s,a)]):[3,4];case 2:m.sent(),m.label=3;case 3:return l++,[3,1];case 4:if(!(r instanceof Qc))return[3,8];m.label=5;case 5:return m.trys.push([5,7,,8]),[4,this.context.cache.match(r.src)];case 6:return w=m.sent(),this.renderReplacedElement(r,n,w),[3,8];case 7:return m.sent(),this.context.logger.error("Error loading image "+r.src),[3,8];case 8:if(r instanceof wc&&this.renderReplacedElement(r,n,r.canvas),!(r instanceof Fc))return[3,12];m.label=9;case 9:return m.trys.push([9,11,,12]),[4,this.context.cache.match(r.svg)];case 10:return w=m.sent(),this.renderReplacedElement(r,n,w),[3,12];case 11:return m.sent(),this.context.logger.error("Error loading svg "+r.svg.substring(0,255)),[3,12];case 12:return r instanceof Vc&&r.tree?(c=new A(this.context,{scale:this.options.scale,backgroundColor:r.backgroundColor,x:0,y:0,width:r.width,height:r.height}),[4,c.render(r.tree)]):[3,14];case 13:d=m.sent(),r.width&&r.height&&this.ctx.drawImage(d,0,0,r.width,r.height,r.bounds.left,r.bounds.top,r.bounds.width,r.bounds.height),m.label=14;case 14:if(r instanceof Ma&&(u=Math.min(r.bounds.width,r.bounds.height),r.type===Bn?r.checked&&(this.ctx.save(),this.path([new S(r.bounds.left+u*.39363,r.bounds.top+u*.79),new S(r.bounds.left+u*.16,r.bounds.top+u*.5549),new S(r.bounds.left+u*.27347,r.bounds.top+u*.44071),new S(r.bounds.left+u*.39694,r.bounds.top+u*.5649),new S(r.bounds.left+u*.72983,r.bounds.top+u*.23),new S(r.bounds.left+u*.84,r.bounds.top+u*.34085),new S(r.bounds.left+u*.39363,r.bounds.top+u*.79)]),this.ctx.fillStyle=hA(mc),this.ctx.fill(),this.ctx.restore()):r.type===fn&&r.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(r.bounds.left+u/2,r.bounds.top+u/2,u/4,0,Math.PI*2,!0),this.ctx.fillStyle=hA(mc),this.ctx.fill(),this.ctx.restore())),Zy(r)&&r.value.length){switch(B=this.createFontStyle(a),E=B[0],g=B[1],h=this.fontMetrics.getMetrics(E,g).baseline,this.ctx.font=E,this.ctx.fillStyle=hA(a.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=Wy(r.styles.textAlign),y=Cn(r),f=0,r.styles.textAlign){case 1:f+=y.width/2;break;case 2:f+=y.width;break}U=y.add(f,0,0,-y.height/2+1),this.ctx.save(),this.path([new S(y.left,y.top),new S(y.left+y.width,y.top),new S(y.left+y.width,y.top+y.height),new S(y.left,y.top+y.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new Pt(r.value,U),a.letterSpacing,h),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!uA(r.styles.display,2048))return[3,20];if(r.styles.listStyleImage===null)return[3,19];if(p=r.styles.listStyleImage,p.type!==0)return[3,18];w=void 0,Q=p.url,m.label=15;case 15:return m.trys.push([15,17,,18]),[4,this.context.cache.match(Q)];case 16:return w=m.sent(),this.ctx.drawImage(w,r.bounds.left-(w.width+10),r.bounds.top),[3,18];case 17:return m.sent(),this.context.logger.error("Error loading list-style-image "+Q),[3,18];case 18:return[3,20];case 19:t.listValue&&r.styles.listStyleType!==-1&&(E=this.createFontStyle(a)[0],this.ctx.font=E,this.ctx.fillStyle=hA(a.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",y=new Ae(r.bounds.left,r.bounds.top+eA(r.styles.paddingTop,r.bounds.width),r.bounds.width,Ac(a.lineHeight,a.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new Pt(t.listValue,y),a.letterSpacing,Ac(a.lineHeight,a.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),m.label=20;case 20:return[2]}})})},A.prototype.renderStackContent=function(t){return CA(this,void 0,void 0,function(){var r,n,p,a,l,p,i,s,p,c,d,p,u,B,p,g,h,p,f,U,p;return UA(this,function(w){switch(w.label){case 0:if(uA(t.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(t.element)];case 1:w.sent(),r=0,n=t.negativeZIndex,w.label=2;case 2:return r<n.length?(p=n[r],[4,this.renderStack(p)]):[3,5];case 3:w.sent(),w.label=4;case 4:return r++,[3,2];case 5:return[4,this.renderNodeContent(t.element)];case 6:w.sent(),a=0,l=t.nonInlineLevel,w.label=7;case 7:return a<l.length?(p=l[a],[4,this.renderNode(p)]):[3,10];case 8:w.sent(),w.label=9;case 9:return a++,[3,7];case 10:i=0,s=t.nonPositionedFloats,w.label=11;case 11:return i<s.length?(p=s[i],[4,this.renderStack(p)]):[3,14];case 12:w.sent(),w.label=13;case 13:return i++,[3,11];case 14:c=0,d=t.nonPositionedInlineLevel,w.label=15;case 15:return c<d.length?(p=d[c],[4,this.renderStack(p)]):[3,18];case 16:w.sent(),w.label=17;case 17:return c++,[3,15];case 18:u=0,B=t.inlineLevel,w.label=19;case 19:return u<B.length?(p=B[u],[4,this.renderNode(p)]):[3,22];case 20:w.sent(),w.label=21;case 21:return u++,[3,19];case 22:g=0,h=t.zeroOrAutoZIndexOrTransformedOrOpacity,w.label=23;case 23:return g<h.length?(p=h[g],[4,this.renderStack(p)]):[3,26];case 24:w.sent(),w.label=25;case 25:return g++,[3,23];case 26:f=0,U=t.positiveZIndex,w.label=27;case 27:return f<U.length?(p=U[f],[4,this.renderStack(p)]):[3,30];case 28:w.sent(),w.label=29;case 29:return f++,[3,27];case 30:return[2]}})})},A.prototype.mask=function(t){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(t.slice(0).reverse()),this.ctx.closePath()},A.prototype.path=function(t){this.ctx.beginPath(),this.formatPath(t),this.ctx.closePath()},A.prototype.formatPath=function(t){var r=this;t.forEach(function(n,a){var l=ZA(n)?n.start:n;a===0?r.ctx.moveTo(l.x,l.y):r.ctx.lineTo(l.x,l.y),ZA(n)&&r.ctx.bezierCurveTo(n.startControl.x,n.startControl.y,n.endControl.x,n.endControl.y,n.end.x,n.end.y)})},A.prototype.renderRepeat=function(t,r,n,a){this.path(t),this.ctx.fillStyle=r,this.ctx.translate(n,a),this.ctx.fill(),this.ctx.translate(-n,-a)},A.prototype.resizeImage=function(t,r,n){var a;if(t.width===r&&t.height===n)return t;var l=(a=this.canvas.ownerDocument)!==null&&a!==void 0?a:document,i=l.createElement("canvas");i.width=Math.max(1,r),i.height=Math.max(1,n);var s=i.getContext("2d");return s.drawImage(t,0,0,t.width,t.height,0,0,r,n),i},A.prototype.renderBackgroundImage=function(t){return CA(this,void 0,void 0,function(){var r,n,a,l,i,s;return UA(this,function(c){switch(c.label){case 0:r=t.styles.backgroundImage.length-1,n=function(d){var u,B,g,N,O,K,I,L,v,h,N,O,K,I,L,f,U,p,w,Q,E,y,m,T,v,V,N,H,Z,I,L,$,O,K,j,oA,rA,_,J,D,wA,dA;return UA(this,function(iA){switch(iA.label){case 0:if(d.type!==0)return[3,5];u=void 0,B=d.url,iA.label=1;case 1:return iA.trys.push([1,3,,4]),[4,a.context.cache.match(B)];case 2:return u=iA.sent(),[3,4];case 3:return iA.sent(),a.context.logger.error("Error loading background-image "+B),[3,4];case 4:return u&&(g=Ga(t,r,[u.width,u.height,u.width/u.height]),N=g[0],O=g[1],K=g[2],I=g[3],L=g[4],v=a.ctx.createPattern(a.resizeImage(u,I,L),"repeat"),a.renderRepeat(N,v,O,K)),[3,6];case 5:mE(d)?(h=Ga(t,r,[null,null,null]),N=h[0],O=h[1],K=h[2],I=h[3],L=h[4],f=UE(d.angle,I,L),U=f[0],p=f[1],w=f[2],Q=f[3],E=f[4],y=document.createElement("canvas"),y.width=I,y.height=L,m=y.getContext("2d"),T=m.createLinearGradient(p,Q,w,E),Ls(d.stops,U).forEach(function(sA){return T.addColorStop(sA.stop,hA(sA.color))}),m.fillStyle=T,m.fillRect(0,0,I,L),I>0&&L>0&&(v=a.ctx.createPattern(y,"repeat"),a.renderRepeat(N,v,O,K))):CE(d)&&(V=Ga(t,r,[null,null,null]),N=V[0],H=V[1],Z=V[2],I=V[3],L=V[4],$=d.position.length===0?[pa]:d.position,O=eA($[0],I),K=eA($[$.length-1],L),j=QE(d,O,K,I,L),oA=j[0],rA=j[1],oA>0&&rA>0&&(_=a.ctx.createRadialGradient(H+O,Z+K,0,H+O,Z+K,oA),Ls(d.stops,oA*2).forEach(function(sA){return _.addColorStop(sA.stop,hA(sA.color))}),a.path(N),a.ctx.fillStyle=_,oA!==rA?(J=t.bounds.left+.5*t.bounds.width,D=t.bounds.top+.5*t.bounds.height,wA=rA/oA,dA=1/wA,a.ctx.save(),a.ctx.translate(J,D),a.ctx.transform(1,0,0,wA,0,0),a.ctx.translate(-J,-D),a.ctx.fillRect(H,dA*(Z-D)+D,I,L*dA),a.ctx.restore()):a.ctx.fill())),iA.label=6;case 6:return r--,[2]}})},a=this,l=0,i=t.styles.backgroundImage.slice(0).reverse(),c.label=1;case 1:return l<i.length?(s=i[l],[5,n(s)]):[3,4];case 2:c.sent(),c.label=3;case 3:return l++,[3,1];case 4:return[2]}})})},A.prototype.renderSolidBorder=function(t,r,n){return CA(this,void 0,void 0,function(){return UA(this,function(a){return this.path(qc(n,r)),this.ctx.fillStyle=hA(t),this.ctx.fill(),[2]})})},A.prototype.renderDoubleBorder=function(t,r,n,a){return CA(this,void 0,void 0,function(){var l,i;return UA(this,function(s){switch(s.label){case 0:return r<3?[4,this.renderSolidBorder(t,n,a)]:[3,2];case 1:return s.sent(),[2];case 2:return l=Ry(a,n),this.path(l),this.ctx.fillStyle=hA(t),this.ctx.fill(),i=Ty(a,n),this.path(i),this.ctx.fill(),[2]}})})},A.prototype.renderNodeBackgroundAndBorders=function(t){return CA(this,void 0,void 0,function(){var r,n,a,l,i,s,c,d,u=this;return UA(this,function(B){switch(B.label){case 0:return this.applyEffects(t.getEffects(2)),r=t.container.styles,n=!Be(r.backgroundColor)||r.backgroundImage.length,a=[{style:r.borderTopStyle,color:r.borderTopColor,width:r.borderTopWidth},{style:r.borderRightStyle,color:r.borderRightColor,width:r.borderRightWidth},{style:r.borderBottomStyle,color:r.borderBottomColor,width:r.borderBottomWidth},{style:r.borderLeftStyle,color:r.borderLeftColor,width:r.borderLeftWidth}],l=Oy(ut(r.backgroundClip,0),t.curves),n||r.boxShadow.length?(this.ctx.save(),this.path(l),this.ctx.clip(),Be(r.backgroundColor)||(this.ctx.fillStyle=hA(r.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(t.container)]):[3,2];case 1:B.sent(),this.ctx.restore(),r.boxShadow.slice(0).reverse().forEach(function(g){u.ctx.save();var h=wn(t.curves),f=g.inset?0:xy,U=yy(h,-f+(g.inset?1:-1)*g.spread.number,(g.inset?1:-1)*g.spread.number,g.spread.number*(g.inset?-2:2),g.spread.number*(g.inset?-2:2));g.inset?(u.path(h),u.ctx.clip(),u.mask(U)):(u.mask(h),u.ctx.clip(),u.path(U)),u.ctx.shadowOffsetX=g.offsetX.number+f,u.ctx.shadowOffsetY=g.offsetY.number,u.ctx.shadowColor=hA(g.color),u.ctx.shadowBlur=g.blur.number,u.ctx.fillStyle=g.inset?hA(g.color):"rgba(0,0,0,1)",u.ctx.fill(),u.ctx.restore()}),B.label=2;case 2:i=0,s=0,c=a,B.label=3;case 3:return s<c.length?(d=c[s],d.style!==0&&!Be(d.color)&&d.width>0?d.style!==2?[3,5]:[4,this.renderDashedDottedBorder(d.color,d.width,i,t.curves,2)]:[3,11]):[3,13];case 4:return B.sent(),[3,11];case 5:return d.style!==3?[3,7]:[4,this.renderDashedDottedBorder(d.color,d.width,i,t.curves,3)];case 6:return B.sent(),[3,11];case 7:return d.style!==4?[3,9]:[4,this.renderDoubleBorder(d.color,d.width,i,t.curves)];case 8:return B.sent(),[3,11];case 9:return[4,this.renderSolidBorder(d.color,i,t.curves)];case 10:B.sent(),B.label=11;case 11:i++,B.label=12;case 12:return s++,[3,3];case 13:return[2]}})})},A.prototype.renderDashedDottedBorder=function(t,r,n,a,l){return CA(this,void 0,void 0,function(){var i,s,c,d,u,B,g,h,f,U,p,w,Q,E,y,m,y,m;return UA(this,function(T){return this.ctx.save(),i=Ny(a,n),s=qc(a,n),l===2&&(this.path(s),this.ctx.clip()),ZA(s[0])?(c=s[0].start.x,d=s[0].start.y):(c=s[0].x,d=s[0].y),ZA(s[1])?(u=s[1].end.x,B=s[1].end.y):(u=s[1].x,B=s[1].y),n===0||n===2?g=Math.abs(c-u):g=Math.abs(d-B),this.ctx.beginPath(),l===3?this.formatPath(i):this.formatPath(s.slice(0,2)),h=r<3?r*3:r*2,f=r<3?r*2:r,l===3&&(h=r,f=r),U=!0,g<=h*2?U=!1:g<=h*2+f?(p=g/(2*h+f),h*=p,f*=p):(w=Math.floor((g+f)/(h+f)),Q=(g-w*h)/(w-1),E=(g-(w+1)*h)/w,f=E<=0||Math.abs(f-Q)<Math.abs(f-E)?Q:E),U&&(l===3?this.ctx.setLineDash([0,h+f]):this.ctx.setLineDash([h,f])),l===3?(this.ctx.lineCap="round",this.ctx.lineWidth=r):this.ctx.lineWidth=r*2+1.1,this.ctx.strokeStyle=hA(t),this.ctx.stroke(),this.ctx.setLineDash([]),l===2&&(ZA(s[0])&&(y=s[3],m=s[0],this.ctx.beginPath(),this.formatPath([new S(y.end.x,y.end.y),new S(m.start.x,m.start.y)]),this.ctx.stroke()),ZA(s[1])&&(y=s[1],m=s[2],this.ctx.beginPath(),this.formatPath([new S(y.end.x,y.end.y),new S(m.start.x,m.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},A.prototype.render=function(t){return CA(this,void 0,void 0,function(){var r;return UA(this,function(n){switch(n.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=hA(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),r=Vy(t),[4,this.renderStack(r)];case 1:return n.sent(),this.applyEffects([]),[2,this.canvas]}})})},A}(ed),Zy=function(e){return e instanceof yc||e instanceof Cc?!0:e instanceof Ma&&e.type!==fn&&e.type!==Bn},Oy=function(e,A){switch(e){case 0:return wn(A);case 2:return wy(A);case 1:default:return Fn(A)}},Wy=function(e){switch(e){case 1:return"center";case 2:return"right";case 0:default:return"left"}},Dy=["-apple-system","system-ui"],Jy=function(e){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?e.filter(function(A){return Dy.indexOf(A)===-1}):e},Ly=function(e){JA(A,e);function A(t,r){var n=e.call(this,t,r)||this;return n.canvas=r.canvas?r.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),n.options=r,n.canvas.width=Math.floor(r.width*r.scale),n.canvas.height=Math.floor(r.height*r.scale),n.canvas.style.width=r.width+"px",n.canvas.style.height=r.height+"px",n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-r.x,-r.y),n.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+r.width+"x"+r.height+" at "+r.x+","+r.y+") with scale "+r.scale),n}return A.prototype.render=function(t){return CA(this,void 0,void 0,function(){var r,n;return UA(this,function(a){switch(a.label){case 0:return r=Ia(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,t),[4,Ky(r)];case 1:return n=a.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=hA(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(n,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},A}(ed),Ky=function(e){return new Promise(function(A,t){var r=new Image;r.onload=function(){A(r)},r.onerror=t,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(e))})},Gy=function(){function e(A){var t=A.id,r=A.enabled;this.id=t,this.enabled=r,this.start=Date.now()}return e.prototype.debug=function(){for(var A=[],t=0;t<arguments.length;t++)A[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug.apply(console,Sr([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},e.prototype.getTime=function(){return Date.now()-this.start},e.prototype.info=function(){for(var A=[],t=0;t<arguments.length;t++)A[t]=arguments[t];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,Sr([this.id,this.getTime()+"ms"],A))},e.prototype.warn=function(){for(var A=[],t=0;t<arguments.length;t++)A[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,Sr([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},e.prototype.error=function(){for(var A=[],t=0;t<arguments.length;t++)A[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,Sr([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},e.instances={},e}(),Yy=function(){function e(A,t){var r;this.windowBounds=t,this.instanceName="#"+e.instanceCount++,this.logger=new Gy({id:this.instanceName,enabled:A.logging}),this.cache=(r=A.cache)!==null&&r!==void 0?r:new uy(this,A)}return e.instanceCount=1,e}(),zy=function(e,A){return A===void 0&&(A={}),jy(e,A)};typeof window<"u"&&Yc.setContext(window);var jy=function(e,A){return CA(void 0,void 0,void 0,function(){var t,r,n,a,l,i,s,c,d,u,B,g,h,f,U,p,w,Q,E,y,T,m,T,v,V,N,H,Z,I,L,$,O,K,j,oA,rA,_,J,D,wA;return UA(this,function(dA){switch(dA.label){case 0:if(!e||typeof e!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(t=e.ownerDocument,!t)throw new Error("Element is not attached to a Document");if(r=t.defaultView,!r)throw new Error("Document is not attached to a Window");return n={allowTaint:(v=A.allowTaint)!==null&&v!==void 0?v:!1,imageTimeout:(V=A.imageTimeout)!==null&&V!==void 0?V:15e3,proxy:A.proxy,useCORS:(N=A.useCORS)!==null&&N!==void 0?N:!1},a=Po({logging:(H=A.logging)!==null&&H!==void 0?H:!0,cache:A.cache},n),l={windowWidth:(Z=A.windowWidth)!==null&&Z!==void 0?Z:r.innerWidth,windowHeight:(I=A.windowHeight)!==null&&I!==void 0?I:r.innerHeight,scrollX:(L=A.scrollX)!==null&&L!==void 0?L:r.pageXOffset,scrollY:($=A.scrollY)!==null&&$!==void 0?$:r.pageYOffset},i=new Ae(l.scrollX,l.scrollY,l.windowWidth,l.windowHeight),s=new Yy(a,i),c=(O=A.foreignObjectRendering)!==null&&O!==void 0?O:!1,d={allowTaint:(K=A.allowTaint)!==null&&K!==void 0?K:!1,onclone:A.onclone,ignoreElements:A.ignoreElements,inlineImages:c,copyStyles:c},s.logger.debug("Starting document clone with size "+i.width+"x"+i.height+" scrolled to "+-i.left+","+-i.top),u=new Kc(s,e,d),B=u.clonedReferenceElement,B?[4,u.toIFrame(t,i)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return g=dA.sent(),h=xa(B)||XC(B)?yw(B.ownerDocument):br(s,B),f=h.width,U=h.height,p=h.left,w=h.top,Q=Xy(s,B,A.backgroundColor),E={canvas:A.canvas,backgroundColor:Q,scale:(oA=(j=A.scale)!==null&&j!==void 0?j:r.devicePixelRatio)!==null&&oA!==void 0?oA:1,x:((rA=A.x)!==null&&rA!==void 0?rA:0)+p,y:((_=A.y)!==null&&_!==void 0?_:0)+w,width:(J=A.width)!==null&&J!==void 0?J:Math.ceil(f),height:(D=A.height)!==null&&D!==void 0?D:Math.ceil(U)},c?(s.logger.debug("Document cloned, using foreign object rendering"),T=new Ly(s,E),[4,T.render(B)]):[3,3];case 2:return y=dA.sent(),[3,5];case 3:return s.logger.debug("Document cloned, element located at "+p+","+w+" with size "+f+"x"+U+" using computed rendering"),s.logger.debug("Starting DOM parsing"),m=Tc(s,B),Q===m.styles.backgroundColor&&(m.styles.backgroundColor=te.TRANSPARENT),s.logger.debug("Starting renderer for element at "+E.x+","+E.y+" with size "+E.width+"x"+E.height),T=new ky(s,E),[4,T.render(m)];case 4:y=dA.sent(),dA.label=5;case 5:return(!((wA=A.removeContainer)!==null&&wA!==void 0)||wA)&&(Kc.destroy(g)||s.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),s.logger.debug("Finished rendering"),[2,y]}})})},Xy=function(e,A,t){var r=A.ownerDocument,n=r.documentElement?zt(e,getComputedStyle(r.documentElement).backgroundColor):te.TRANSPARENT,a=r.body?zt(e,getComputedStyle(r.body).backgroundColor):te.TRANSPARENT,l=typeof t=="string"?zt(e,t):t===null?te.TRANSPARENT:4294967295;return A===r.documentElement?Be(n)?Be(a)?l:a:n:l};const sR="",Py={class:"label-designer"},_y={class:"toolbar"},qy={class:"center-container"},$y={class:"center-toolbar"},AV={class:"zoom-controls"},eV=["disabled"],tV=["disabled"],rV={class:"canvas-container"},nV={class:"ruler-horizontal"},oV={class:"ruler-vertical"},aV={key:0,class:"drag-extend-lines"},lV={key:1,class:"alignment-guides"},iV=["data-item-id","onMousedown","onClick"],sV=["onMousedown"],cV=["onMousedown"],dV=["onMousedown"],uV=["onMousedown"],BV=["onMousedown"],fV=["onMousedown"],hV=["onMousedown"],gV=["onClick"],pV={class:"property-panel",tabindex:"0"},UV={class:"position-controls"},QV={class:"control-group"},wV={class:"number-input"},FV={class:"control-group"},EV={class:"number-input"},mV={key:0,class:"control-group"},CV={class:"number-input"},yV={key:1,class:"control-group"},VV={class:"number-input"},RV={class:"control-group"},TV={class:"number-input"},NV={key:2,class:"control-group"},vV={class:"switch-input"},Vn=.05,IV=fA({__name:"panels",props:{templateInfo:{type:Object,default:()=>({graphData:{},width:0,height:0,printWidth:0,printHeight:0,items:[]})},options:{type:Object,default:()=>({})},showGraphConfig:{type:Boolean,default:!1},templateType:{type:String,default:"lodop"},config:{type:Object,default:()=>({})}},setup(e,{expose:A}){const t=e,r=o.ref({}),n=o.ref(0),a=o.ref([]),l=o.ref(1);let i=1;const s=o.computed(()=>{var C;return((C=r.value)==null?void 0:C.printWidth)||0}),c=o.computed(()=>{var C;return((C=r.value)==null?void 0:C.printHeight)||0});o.ref(!1);const d=o.ref(!1),u=o.ref(!1),B=o.ref(new Map),g=o.ref(new Map),h=new Map(_i.map(C=>[C.type,C])),{selectedItems:f,selectItem:U,getCurrentSelected:p,clearSelection:w}=pw(),{dragging:Q,dragItem:E,startDrag:y}=hw({scale:l,canvasWidth:s,canvasHeight:c,selectItem:U,onStartDrag:()=>{d.value=!0},onStopDrag:()=>{d.value=!1,o.nextTick(()=>{u.value=!1}),V()},onDragUpdate:()=>{v()}}),{alignmentGuides:m,showGuides:T,updateAlignmentGuides:v,clearAlignmentGuides:V}=Ew({items:a,dragItem:E,dragging:Q}),{startResize:N}=gw(s,c,l,f),{startRotate:H}=Uw();o.watch(()=>f.value,()=>{B.value.clear()},{deep:!0});const Z=C=>{const F=`${C.id}_${C.props.x.toFixed(1)}_${C.props.y.toFixed(1)}_${C.props.width}_${C.props.height}_${C.props.rotation}`;if(g.value.has(F))return g.value.get(F);const G=(C.props.rotation||0)*Math.PI/180,k=[{x:0,y:0},{x:C.props.width,y:0},{x:C.props.width,y:C.props.height},{x:0,y:C.props.height}],x=C.props.width/2,W=C.props.height/2,z=k.map(R=>{const AA=R.x-x,X=R.y-W,be=AA*Math.cos(G)-X*Math.sin(G),Me=AA*Math.sin(G)+X*Math.cos(G);return{x:Number((be+x+C.props.x).toFixed(2)),y:Number((Me+W+C.props.y).toFixed(2))}});if(g.value.set(F,z),g.value.size>100){const R=g.value.keys().next().value;g.value.delete(R)}return z},I=C=>{const F=Z(C),M=F.map(AA=>AA.x),G=F.map(AA=>AA.y),k=Number(Math.min(...M).toFixed(2)),x=Number(Math.max(...M).toFixed(2)),W=Number(Math.min(...G).toFixed(2)),z=Number(Math.max(...G).toFixed(2));return{minX:k,maxX:x,minY:W,maxY:z,width:x-k,height:z-W,centerX:(k+x)/2,centerY:(W+z)/2}},L=(C,F)=>{const M=I(C);if(C.type==="horline"&&F==="bottom"){const x=parseFloat(C.props.LineWidth||"0.75")*1.333/3.78;return{top:M.minY+x+"mm"}}if(C.type==="verline"&&F==="right"){const x=parseFloat(C.props.LineWidth||"0.75")*1.333/3.78;return{left:M.minX+x+"mm"}}switch(F){case"left":return{left:M.minX+"mm"};case"right":return{left:M.maxX+"mm"};case"top":return{top:M.minY+"mm"};case"bottom":return{top:M.maxY+"mm"};default:return{}}},$=()=>{o.nextTick(()=>{const C=document.querySelector(".canvas-container");if(!C||!s.value||!c.value)return;const F=C.getBoundingClientRect(),M=mr(s.value),G=mr(c.value);let k=F.width/M,x=F.height/G;k=k-40*k/M,x=x-40*x/G;let W=Math.min(k,x);i=Math.max(.8,Math.min(4,W)),l.value=i=O(i,1),setTimeout(()=>n.value=1,100)})};function O(C,F){C=C.toString();let M=C.indexOf(".");return M!==-1?C=C.substring(0,F+M+1):C=C.substring(0),Number(parseFloat(C).toFixed(F))}const K=C=>h.get(C)||null,j=C=>{const F=f.value.indexOf(C),M=F===f.value.length-1,G=F!==-1,k=`${C.id}_${Math.round(C.props.x*10)}_${Math.round(C.props.y*10)}_${C.props.width}_${C.props.height}_${C.props.rotation}_${G}_${M}`;if(B.value.has(k))return B.value.get(k);const x={width:C.props.width+"mm",height:C.props.height+"mm",transform:`translate(${C.props.x}mm, ${C.props.y}mm) rotate(${C.props.rotation}deg)`};if(G?M?x.zIndex=1e3:x.zIndex=999:x.zIndex=10,B.value.set(k,x),B.value.size>200){const W=B.value.keys().next().value;B.value.delete(W)}return x},oA=C=>{const F=f.value.some(G=>G.id===C.id),M=p()===C;return{"component-selected":F,"component-current":F&&M,"no-outline":F&&(C.type==="horline"||C.type==="verline")}},rA=(C,F)=>{const G=((C.props.rotation||0)%360+360)%360;if(C.type==="horline"&&(F==="left"||F==="right"))return{cursor:F==="left"?"w-resize":"e-resize",top:"50%",transform:"translateY(-50%)"};if(C.type==="verline"&&(F==="top"||F==="bottom"))return{cursor:F==="top"?"n-resize":"s-resize",left:"50%",transform:"translateX(-50%)"};const x=({top:0,"top-right":45,right:90,"bottom-right":135,bottom:180,"bottom-left":225,left:270,"top-left":315}[F]+G)%360;let W="pointer";return x>=337.5||x<22.5?W="n-resize":x>=22.5&&x<67.5?W="ne-resize":x>=67.5&&x<112.5?W="e-resize":x>=112.5&&x<157.5?W="se-resize":x>=157.5&&x<202.5?W="s-resize":x>=202.5&&x<247.5?W="sw-resize":x>=247.5&&x<292.5?W="w-resize":x>=292.5&&x<337.5&&(W="nw-resize"),{cursor:W}},_=()=>{l.value<4&&(l.value+=.1)},J=()=>{l.value>.8&&(l.value-=.1)};function D(C){const F=document.activeElement.tagName.toLowerCase();if(F==="input"||F==="textarea")return;const M=p();if(!M)return;const G=Number(M.props.width)||0,k=Number(M.props.height)||0;let x=M.props.x,W=M.props.y,z=!1;if(C.key==="ArrowLeft"?(x=Number((M.props.x-Vn).toFixed(2)),z=!0):C.key==="ArrowRight"?(x=Number((M.props.x+Vn).toFixed(2)),z=!0):C.key==="ArrowUp"?(W=Number((M.props.y-Vn).toFixed(2)),z=!0):C.key==="ArrowDown"&&(W=Number((M.props.y+Vn).toFixed(2)),z=!0),z){const R=s.value-G,AA=c.value-k;x<0?x=0:x>R&&(x=R),W<0?W=0:W>AA&&(W=AA),M.props.x=x,M.props.y=W,C.preventDefault()}}const wA=({e:C,comp:F,previewDiv:M})=>{var G,k;(G=C==null?void 0:C.dataTransfer)==null||G.setData("comp",JSON.stringify(F)),document.body.appendChild(M),(k=C==null?void 0:C.dataTransfer)==null||k.setDragImage(M,0,0),setTimeout(()=>document.body.removeChild(M),0)},dA=async C=>{var Sn,od,ad;C.preventDefault();const F=JSON.parse(((od=(Sn=C==null?void 0:C.dataTransfer)==null?void 0:Sn.getData)==null?void 0:od.call(Sn,"comp"))||"{}")||{},M=(F==null?void 0:F.type)||"";if(!M)return;const G=document.querySelector("#design").getBoundingClientRect(),k=(C.clientX-G.left)/l.value,x=(C.clientY-G.top)/l.value,W=BA.value[M]||{};let z=Ci(k),R=Ci(x);const AA=W.width,X=W.height,be=s.value-AA,Me=c.value-X;z=Math.max(0,Math.min(z,be)),R=Math.max(0,Math.min(R,Me));const{propertyPanel:vn,...bV}=W;let In={...bV,x:Number(z.toFixed(2)),y:Number(R.toFixed(2)),width:Number(AA.toFixed(2)),height:Number(X.toFixed(2))};if((ad=BA.value[M])!=null&&ad.propertyPanel){const Xa=Ve(BA.value[M].propertyPanel)||{};if(In={...In,...Xa},M==="horline"&&Xa.LineWidth){const MV=parseFloat(Xa.LineWidth)*.3528;In.height=Number(MV.toFixed(3))}}const nd={id:Ya(),type:M,props:In};a.value.push(nd),U(nd)};function iA(C){let F=C.target;for(;F&&F!==document.querySelector("#design");){if(F.classList&&(F.classList.contains("canvas-item")||F.classList.contains("resize-handle")||F.classList.contains("delete-btn")||F.classList.contains("rotate-handle")))return;F=F.parentElement}w()}const sA=(C,F)=>{if(f.value.length===0){U(F),y(C,F);return}if(p()===F){y(C,F);return}U(F),y(C,F)},FA=C=>{const F=[];for(const k of B.value.keys())k.includes(C)&&F.push(k);F.forEach(k=>B.value.delete(k));const M=[];for(const k of g.value.keys())k.includes(C)&&M.push(k);if(M.forEach(k=>g.value.delete(k)),B.value.clear(),g.value.clear(),a.value.find(k=>k.id===C)&&(a.value=a.value.filter(k=>k.id!==C)),f.value.some(k=>k.id===C)){const k=f.value.filter(x=>x.id!==C);f.value=k}o.nextTick(()=>{})},WA=C=>{var M;const F=document.activeElement.tagName.toLowerCase();F==="input"||F==="textarea"||(C.key==="Delete"||C.key==="Backspace")&&f.value.length>0&&FA((M=p())==null?void 0:M.id)},{handleMouseWheel:_A,handleInputChange:Se,adjustRotation:Ar}=ww(f,s,c),Bt=()=>{setTimeout(()=>{const C=document.querySelector(".center-container");if(!C)return;const F=C.getBoundingClientRect();C.style.height=`calc(100vh - ${F==null?void 0:F.top}px)`,$()},200)};o.watch(()=>t.templateInfo,(C,F)=>{C!==F&&(r.value=C||{},a.value=(C==null?void 0:C.items)||[],Bt())},{deep:!0,immediate:!0});const{handleCopy:Tn,handlePaste:KA}=Fw(a,f,s,c),BA=o.ref({}),GA=o.ref(!1),pe=async C=>{try{GA.value=!1,BA.value=await LQ(C),GA.value=!0}catch(F){console.error("加载属性配置失败:",F),BA.value={},GA.value=!0}};o.watch(()=>t.templateType,async C=>{try{await pe(C),w(),B.value.clear(),g.value.clear(),console.log("配置切换成功:",C)}catch(F){console.error("配置切换失败:",F)}},{immediate:!0}),o.onMounted(async()=>{GA.value||await pe(t.templateType),window.addEventListener("resize",Bt),window.addEventListener("keydown",WA),window.addEventListener("keydown",Tn),window.addEventListener("keydown",KA),window.addEventListener("keydown",D),Bt(),ft()}),o.onBeforeUnmount(()=>{window.removeEventListener("resize",Bt),window.removeEventListener("keydown",WA),window.removeEventListener("keydown",Tn),window.removeEventListener("keydown",KA),window.removeEventListener("keydown",D)});function Ya(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,C=>{const F=Math.random()*16|0;return(C==="x"?F:F&3|8).toString(16)})}const za=C=>{var M;if(!BA.value||!BA.value[C])return console.warn(`组件类型 ${C} 在当前配置中不存在`),{};const F=BA.value[C]||{};return C==="image"&&((M=t.config)!=null&&M.image)?{...F,image:{...F.image,...t.config.image}}:F},Nn=()=>Qw(a,r.value),ja=C=>{r.value.graphData=C||{},ft()},ft=()=>{var F;const C=Cw(r.value.graphData)||"";C&&((F=document.querySelector("#design"))==null||F.appendChild(C))},rd=()=>new Promise((C,F)=>{w(),JSON.parse(JSON.stringify(a.value));const M=JSON.parse(JSON.stringify(a.value));M==null||M.forEach(k=>{var x,W;if(k.type=="text"){const z=((W=(x=t.options)==null?void 0:x.fields)==null?void 0:W.find(R=>{var AA;return R.value==((AA=k==null?void 0:k.props)==null?void 0:AA.FieldName)}))||{};k.props.Text=k.props.Text||(z==null?void 0:z.label)}}),[...M];const G=()=>{var W;const k=((W=document.querySelector("#design"))==null?void 0:W.querySelectorAll("img"))||[],x=Array.from(k).map(z=>z.complete?Promise.resolve():new Promise(R=>{z.onload=z.onerror=R}));return Promise.all(x)};o.nextTick(()=>{const k=document.querySelector("#design");if(!k){F(new Error("找不到要转换的DOM元素"));return}const x=l.value;G().then(()=>{zy(k,{scale:window.devicePixelRatio*(x<1?5:3)*x,useCORS:!0,allowTaint:!0,backgroundColor:null,logging:!1,onclone:W=>{const z=W.querySelector(".canvas-wrapper");if(z){const X=z.style.transform.replace(/scale\([^)]*\)/g,"").replace(/\s+/g," ").trim();z.style.transform=X||"none",z.style.opacity="1"}const R=W.querySelector("#design");if(R){const AA=window.getComputedStyle(k);for(let X=0;X<AA.length;X++){const be=AA[X];R.style[be]=AA.getPropertyValue(be)}}}}).then(W=>{const z=W.toDataURL("image/png");C({data:Nn(),image:z})}).catch(W=>{F(W)})}).catch(W=>{F(W)})})}),yA=()=>new Promise((C,F)=>{a.value.forEach(G=>{if(G.type==="image"&&!G.props.ImageSrc)return Qt.warning("图片控件请选择图片!"),F("图片控件请选择图片!")}),C(!0)});return A({getJson:()=>yA().then(()=>Nn()),clear:()=>{a.value=[],w()},snapshot:()=>yA().then(()=>rd())}),(C,F)=>{var W,z;const M=o.resolveComponent("el-icon-refresh-left"),G=o.resolveComponent("el-icon"),k=o.resolveComponent("el-icon-close"),x=o.resolveComponent("el-switch");return o.openBlock(),o.createElementBlock("div",Py,[o.createElementVNode("div",_y,[o.createVNode(_Q,{onDragStart:wA,config:e.config,propsConfig:BA.value},null,8,["config","propsConfig"])]),o.createElementVNode("div",qy,[o.createElementVNode("div",$y,[e.showGraphConfig?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createVNode(fw,{"graph-data":(W=r.value)==null?void 0:W.graphData,onSuccess:ja},null,8,["graph-data"]),F[24]||(F[24]=o.createElementVNode("div",{style:{width:"30px"}},null,-1))],64)):o.createCommentVNode("",!0),o.createElementVNode("div",AV,[o.createElementVNode("button",{onClick:J,disabled:l.value<=.8},"-",8,eV),o.createElementVNode("span",null,o.toDisplayString(Math.round(l.value*100))+"%",1),o.createElementVNode("button",{onClick:_,disabled:l.value>=4},"+",8,tV)])]),o.createElementVNode("div",rV,[o.createElementVNode("div",{class:"canvas-wrapper",style:o.normalizeStyle(`transform: scale(${l.value});opacity: ${n.value};`)},[s.value&&c.value?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("div",nV,[o.createVNode(qi,{direction:"horizontal",length:s.value},null,8,["length"])]),o.createElementVNode("div",oV,[o.createVNode(qi,{direction:"vertical",length:c.value},null,8,["length"])])],64)):o.createCommentVNode("",!0),o.createElementVNode("div",{id:"design",class:"canvas",style:o.normalizeStyle(`width: ${s.value}mm; height: ${c.value}mm;`),onDrop:dA,onDragover:F[1]||(F[1]=o.withModifiers(()=>{},["prevent"])),onPointerdown:iA},[o.unref(Q)&&o.unref(E)?(o.openBlock(),o.createElementBlock("div",aV,[o.createElementVNode("div",{class:"drag-extend-line vertical",style:o.normalizeStyle(L(o.unref(E),"left"))},null,4),o.createElementVNode("div",{class:"drag-extend-line vertical",style:o.normalizeStyle(L(o.unref(E),"right"))},null,4),o.createElementVNode("div",{class:"drag-extend-line horizontal",style:o.normalizeStyle(L(o.unref(E),"top"))},null,4),o.createElementVNode("div",{class:"drag-extend-line horizontal",style:o.normalizeStyle(L(o.unref(E),"bottom"))},null,4)])):o.createCommentVNode("",!0),o.unref(T)?(o.openBlock(),o.createElementBlock("div",lV,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(m).horizontal,(R,AA)=>(o.openBlock(),o.createElementBlock("div",{key:`h-${AA}`,class:"alignment-guide horizontal",style:o.normalizeStyle({top:`${R.y}mm`,left:"0",right:"0"})},null,4))),128)),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(m).vertical,(R,AA)=>(o.openBlock(),o.createElementBlock("div",{key:`v-${AA}`,class:"alignment-guide vertical",style:o.normalizeStyle({left:`${R.x}mm`,top:"0",bottom:"0"})},null,4))),128))])):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.value,R=>{var AA;return o.openBlock(),o.createElementBlock("div",{key:R.id,class:o.normalizeClass(["canvas-item",oA(R)]),style:o.normalizeStyle(j(R)),"data-item-id":R.id,onMousedown:o.withModifiers(X=>sA(X,R),["stop"]),onClick:o.withModifiers(X=>o.unref(U)(R),["stop"])},[o.unref(p)()===R?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[R.props.lockAspectRatio?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[R.type!=="verline"&&R.type!=="horline"?(o.openBlock(),o.createElementBlock("div",{key:0,class:"resize-handle right",style:o.normalizeStyle(rA(R,"right")),onMousedown:o.withModifiers(X=>o.unref(N)(X,R,"right"),["stop"])},null,44,sV)):o.createCommentVNode("",!0),R.type!=="horline"?(o.openBlock(),o.createElementBlock("div",{key:1,class:"resize-handle bottom",style:o.normalizeStyle(rA(R,"bottom")),onMousedown:o.withModifiers(X=>o.unref(N)(X,R,"bottom"),["stop"])},null,44,cV)):o.createCommentVNode("",!0),R.type!=="verline"?(o.openBlock(),o.createElementBlock("div",{key:2,class:"resize-handle left",style:o.normalizeStyle(rA(R,"left")),onMousedown:o.withModifiers(X=>o.unref(N)(X,R,"left"),["stop"])},null,44,dV)):o.createCommentVNode("",!0)],64)),R.type!=="horline"&&R.type!=="verline"?(o.openBlock(),o.createElementBlock("div",{key:1,class:"resize-handle top-left",style:o.normalizeStyle(rA(R,"top-left")),onMousedown:o.withModifiers(X=>o.unref(N)(X,R,"top-left"),["stop"])},null,44,uV)):o.createCommentVNode("",!0),R.type!=="horline"&&R.type!=="verline"?(o.openBlock(),o.createElementBlock("div",{key:2,class:"resize-handle bottom-right",style:o.normalizeStyle(rA(R,"bottom-right")),onMousedown:o.withModifiers(X=>o.unref(N)(X,R,"bottom-right"),["stop"])},null,44,BV)):o.createCommentVNode("",!0),R.type!=="horline"&&R.type!=="verline"?(o.openBlock(),o.createElementBlock("div",{key:3,class:"resize-handle bottom-left",style:o.normalizeStyle(rA(R,"bottom-left")),onMousedown:o.withModifiers(X=>o.unref(N)(X,R,"bottom-left"),["stop"])},null,44,fV)):o.createCommentVNode("",!0),R.type!=="verline"?(o.openBlock(),o.createElementBlock("div",{key:4,class:"rotate-handle",onMousedown:o.withModifiers(X=>o.unref(H)(X,R),["stop"])},[o.createVNode(G,{size:"6"},{default:o.withCtx(()=>[o.createVNode(M)]),_:1})],40,hV)):o.createCommentVNode("",!0),o.createElementVNode("div",{class:"delete-btn",onMousedown:F[0]||(F[0]=o.withModifiers(()=>{},["stop"])),onClick:o.withModifiers(X=>FA(R.id),["stop"]),title:"删除"},[o.createVNode(G,{size:"6"},{default:o.withCtx(()=>[o.createVNode(k)]),_:1})],40,gV)],64)):o.createCommentVNode("",!0),R.props&&GA.value?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(((AA=K(R.type))==null?void 0:AA.component)||null),{key:`${R.id}-${R.type}`,modelValue:{...R.props,__selected:o.unref(p)()===R},propsConfig:BA.value,"onUpdate:modelValue":X=>{const{__selected:be,...Me}=X;Object.keys(Me).forEach(vn=>{Me[vn]!==void 0&&(R.props[vn]=Me[vn])})}},null,8,["modelValue","propsConfig","onUpdate:modelValue"])):o.createCommentVNode("",!0)],46,iV)}),128))],36)],4)])]),o.createElementVNode("div",pV,[o.unref(f).length>0?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[F[31]||(F[31]=o.createElementVNode("h3",{class:"property-panel-title"},"属性设置",-1)),o.createElementVNode("div",UV,[o.createElementVNode("div",QV,[F[25]||(F[25]=o.createElementVNode("label",null,"X坐标:",-1)),o.createElementVNode("div",wV,[o.createElementVNode("button",{onClick:F[2]||(F[2]=R=>o.unref(_A)(R,"x",-.5))},"-"),o.withDirectives(o.createElementVNode("input",{type:"number","onUpdate:modelValue":F[3]||(F[3]=R=>o.unref(p)().props.x=R),onInput:F[4]||(F[4]=R=>o.unref(Se)("x",R.target.value))},null,544),[[o.vModelText,o.unref(p)().props.x,void 0,{number:!0}]]),o.createElementVNode("button",{onClick:F[5]||(F[5]=R=>o.unref(_A)(R,"x",.5))},"+")])]),o.createElementVNode("div",FV,[F[26]||(F[26]=o.createElementVNode("label",null,"Y坐标:",-1)),o.createElementVNode("div",EV,[o.createElementVNode("button",{onClick:F[6]||(F[6]=R=>o.unref(_A)(R,"y",-.5))},"-"),o.withDirectives(o.createElementVNode("input",{type:"number","onUpdate:modelValue":F[7]||(F[7]=R=>o.unref(p)().props.y=R),onInput:F[8]||(F[8]=R=>o.unref(Se)("y",R.target.value))},null,544),[[o.vModelText,o.unref(p)().props.y,void 0,{number:!0}]]),o.createElementVNode("button",{onClick:F[9]||(F[9]=R=>o.unref(_A)(R,"y",.5))},"+")])]),o.unref(p)().type!=="verline"?(o.openBlock(),o.createElementBlock("div",mV,[F[27]||(F[27]=o.createElementVNode("label",null,"宽度:",-1)),o.createElementVNode("div",CV,[o.createElementVNode("button",{onClick:F[10]||(F[10]=R=>o.unref(_A)(R,"width",-.5,1))},"-"),o.withDirectives(o.createElementVNode("input",{type:"number","onUpdate:modelValue":F[11]||(F[11]=R=>o.unref(p)().props.width=R),onInput:F[12]||(F[12]=R=>o.unref(Se)("width",R.target.value))},null,544),[[o.vModelText,o.unref(p)().props.width,void 0,{number:!0}]]),o.createElementVNode("button",{onClick:F[13]||(F[13]=R=>o.unref(_A)(R,"width",.5,1))},"+")])])):o.createCommentVNode("",!0),o.unref(p)().type!=="horline"?(o.openBlock(),o.createElementBlock("div",yV,[F[28]||(F[28]=o.createElementVNode("label",null,"高度:",-1)),o.createElementVNode("div",VV,[o.createElementVNode("button",{onClick:F[14]||(F[14]=R=>o.unref(_A)(R,"height",-.5,1))},"-"),o.withDirectives(o.createElementVNode("input",{type:"number","onUpdate:modelValue":F[15]||(F[15]=R=>o.unref(p)().props.height=R),onInput:F[16]||(F[16]=R=>o.unref(Se)("height",R.target.value))},null,544),[[o.vModelText,o.unref(p)().props.height,void 0,{number:!0}]]),o.createElementVNode("button",{onClick:F[17]||(F[17]=R=>o.unref(_A)(R,"height",.5,1))},"+")])])):o.createCommentVNode("",!0),o.createElementVNode("div",RV,[F[29]||(F[29]=o.createElementVNode("label",null,"旋转:",-1)),o.createElementVNode("div",TV,[o.createElementVNode("button",{onClick:F[18]||(F[18]=R=>o.unref(Ar)(-1))},"-"),o.withDirectives(o.createElementVNode("input",{type:"number","onUpdate:modelValue":F[19]||(F[19]=R=>o.unref(p)().props.rotation=R),onInput:F[20]||(F[20]=R=>o.unref(Se)("rotation",R.target.value))},null,544),[[o.vModelText,o.unref(p)().props.rotation,void 0,{number:!0}]]),o.createElementVNode("button",{onClick:F[21]||(F[21]=R=>o.unref(Ar)(1))},"+")])]),o.unref(p)().type!=="horline"?(o.openBlock(),o.createElementBlock("div",NV,[F[30]||(F[30]=o.createElementVNode("label",null,"锁定宽高比:",-1)),o.createElementVNode("div",vV,[o.createVNode(x,{modelValue:o.unref(p)().props.lockAspectRatio,"onUpdate:modelValue":F[22]||(F[22]=R=>o.unref(p)().props.lockAspectRatio=R),"active-value":!0,"inactive-value":!1},null,8,["modelValue"])])])):o.createCommentVNode("",!0)]),(o.openBlock(),o.createBlock(o.resolveDynamicComponent(((z=K(o.unref(p)().type))==null?void 0:z.propertyPanel)||null),{modelValue:o.unref(p)().props,"onUpdate:modelValue":F[23]||(F[23]=R=>o.unref(p)().props=R),options:e.options,"props-config":za(o.unref(p)().type)},null,8,["modelValue","options","props-config"]))],64)):o.createCommentVNode("",!0)])])}}},[["__scopeId","data-v-eadd84a0"]]),dR="",Rn=fA({__name:"index",props:{templateData:{type:Object,default:()=>({graphData:{},width:0,height:0,printWidth:0,printHeight:0,items:[]})},config:{type:Object,default:()=>({})}},setup(e){const A=o.getCurrentInstance(),t=e,r=o.ref(!1),n=o.ref({}),a=o.ref(),l=o.ref(0),i=o.ref(!1),s=(f,U)=>{let p;return function(...Q){const E=()=>{clearTimeout(p),f(...Q)};clearTimeout(p),p=setTimeout(E,U)}},c=o.ref({rectTop:0,isInModal:!1}),d=()=>{if(!a.value)return;const f=a.value.getBoundingClientRect(),U=B(a.value);let p=0;if(f.top>0)p=f.top;else if(U){const w=g(a.value);p=w>0?w:60}else{const w=a.value.offsetTop;w>0?p=w:p=60}(p!==c.value.rectTop||U!==c.value.isInModal)&&(l.value=p,i.value=U,c.value={rectTop:p,isInModal:U})},u=s(d,100),B=f=>{let U=f.parentElement;for(;U;){if(U.classList&&(U.classList.contains("el-dialog")||U.classList.contains("el-drawer")||U.classList.contains("sc-dialog")))return!0;U=U.parentElement}return!1},g=f=>{let U=f.parentElement;for(;U;){if(U.classList&&(U.classList.contains("el-dialog")||U.classList.contains("el-drawer")||U.classList.contains("sc-dialog"))){const p=U.getBoundingClientRect();return p.top>0?p.top:60}U=U.parentElement}return 60};o.onMounted(()=>{setTimeout(()=>d(),100),setTimeout(()=>d(),300),window.addEventListener("resize",u),o.onBeforeUnmount(()=>{window.removeEventListener("resize",u)})}),o.watch(()=>r.value,f=>{f&&o.nextTick(()=>setTimeout(()=>d(),50))}),o.watch(()=>t.templateData,async f=>{r.value=(f==null?void 0:f.width)>0&&(f==null?void 0:f.height)>0,n.value=f},{deep:!0,immediate:!0});function h(f){A.exposed=f||{},A.exposeProxy=f||{}}return(f,U)=>{const p=o.resolveDirective("loading");return o.withDirectives((o.openBlock(),o.createElementBlock("div",{ref_key:"templateDesignerRef",ref:a,class:o.normalizeClass(["template-designer",{"template-designer-border-top":i.value}]),style:o.normalizeStyle({height:"calc(100vh - "+(l.value+1)+"px)"})},[r.value?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(o.h(IV,{...f.$attrs,...t,ref:h},f.$slots)),{key:0,"template-info":n.value},null,8,["template-info"])):o.createCommentVNode("",!0)],6)),[[p,!r.value]])}}},[["__scopeId","data-v-300f49ad"]]);Rn.install=e=>{e.component(Rn.name||"TemplateDesigner",Rn)};const td=Object.freeze(Object.defineProperty({__proto__:null,default:{text:{width:20,height:4.2,rotation:0,lockAspectRatio:!1,propertyPanel:[{prop:"Title",label:"标题",default:"",layout:"full"},{prop:"FieldName",label:"字段名称",type:"select",optionsKey:"fields",default:"",layout:"full"},{prop:"Text",label:"测试数据",default:"测试文本",layout:"full"},{prop:"FontName",label:"字体名称",type:"select",options:[{label:"黑体",value:"黑体",cssValue:"SimHei"},{label:"楷体",value:"楷体",cssValue:"KaiTi"},{label:"宋体",value:"宋体",cssValue:"SimSun"}],default:"黑体",layout:"half"},{prop:"FontSize",label:"字体大小",type:"number",min:1,max:100,default:10,layout:"half"},{prop:"FontColor",label:"字体颜色",type:"color",hide:!0,default:"#000000",layout:"half"},{prop:"Bold",label:"字体加粗",type:"select",options:[{label:"加粗",value:1},{label:"不加粗",value:0}],default:0,layout:"half"},{prop:"Italic",label:"是否斜体",type:"select",options:[{label:"是",value:1},{label:"否",value:0}],default:0,layout:"half"},{prop:"Underline",label:"下划线",type:"select",options:[{label:"是",value:1},{label:"否",value:0}],default:0,hide:!0},{prop:"Alignment",label:"对齐方式",type:"select",options:[{label:"居左",value:1},{label:"居中",value:2},{label:"居右",value:3}],default:2},{prop:"TextWrap",label:"文本换行",type:"select",options:[{label:"换行",value:1},{label:"不换行&省略",value:2},{label:"不换行&隐藏",value:3}],default:1},{prop:"HOrient",label:"水平锁定",type:"select",options:[{label:"无",value:0},{label:"左边距锁定",value:1},{label:"右边距锁定",value:2},{label:"水平居中",value:3}],hide:!0,default:0},{prop:"VOrient",label:"垂直锁定",type:"select",options:[{label:"无",value:0},{label:"上边距锁定",value:1},{label:"下边距锁定",value:2},{label:"垂直居中",value:3}],hide:!0,default:0},{prop:"PenWidth",label:"线宽",type:"number",min:0,hide:!0,default:0},{prop:"PenStyle",label:"线型",type:"select",hide:!0,options:[{label:"实线",value:0},{label:"破折线",value:1},{label:"点线",value:2},{label:"点划线",value:3},{label:"双点划线",value:4}],default:0},{prop:"Stretch",label:"缩放模式",type:"select",options:[{label:"扩展",value:1},{label:"缩放",value:2}],hide:!0,default:1},{prop:"PreviewOnly",label:"仅预览",type:"select",hide:!0,options:[{label:"是",value:1},{label:"否",value:0}],default:0},{prop:"ReadOnly",label:"只读",type:"select",hide:!0,options:[{label:"是",value:1},{label:"否",value:0}],default:0}]},barcode:{width:20,height:6,rotation:0,lockAspectRatio:!1,propertyPanel:[{prop:"FieldName",label:"字段名称",type:"select",optionsKey:"fields",default:"goodsSn",layout:"full"},{prop:"BarcodeValue",label:"测试数据",type:"text",default:"1234567890"},{prop:"CodeType",label:"条码类型",type:"select",options:[{label:"CODE128",value:"128Auto",compValue:"CODE128"},{label:"CODE39",value:"Code39",compValue:"CODE39"},{label:"EAN13",value:"EAN13",compValue:"EAN13"}],hide:!0,default:"128Auto"},{prop:"AlignJustify",label:"对齐方式",type:"select",options:[{label:"两端对齐",value:0},{label:"左",value:1},{label:"中",value:2},{label:"右",value:3}],hide:!0,default:0},{prop:"LineColor",label:"条形码颜色",type:"color",hide:!0,default:"#000000"}]},qrcode:{width:10,height:10,rotation:0,lockAspectRatio:!0,propertyPanel:[{prop:"FieldName",label:"字段名称",type:"select",optionsKey:"fields",default:"",layout:"full"},{prop:"QRCodeValue",label:"测试数据",type:"text",default:"FB-GOLD"},{prop:"QRCodeVersion",label:"二维码版本",type:"number",min:1,max:40,hide:!0,default:7},{prop:"QRCodeErrorLevel",label:"纠错级别",type:"select",options:[{label:"L (7%)",value:"L"},{label:"M (15%)",value:"M"},{label:"Q (25%)",value:"Q"},{label:"H (30%)",value:"H"}],hide:!0,default:"Q"},{prop:"QRCodeEncodeMode",label:"编码模式",type:"select",options:[{label:"数字",value:"N"},{label:"二进制或汉语",value:"B"},{label:"英文字母",value:"A"}],hide:!0,default:"B"},{prop:"QRCodeForeground",label:"前景色",type:"color",hide:!0,default:"#000000"},{prop:"QRCodeBackground",label:"背景景色",type:"color",hide:!0,default:"transparent"}]},image:{width:12,height:12,rotation:0,lockAspectRatio:!1,propertyPanel:[{prop:"ImageSrc",label:"图片地址",type:"file",accept:"image/*",default:""},{prop:"ScaleMode",label:"图片缩放",type:"select",options:[{label:"原始尺寸",value:1},{label:"居中裁剪",value:2},{label:"填充",value:3}],default:1},{prop:"IsPrint",label:"是否打印",type:"select",options:[{label:"是",value:!0},{label:"否",value:!1}],default:!0}]},rectangle:{width:15,height:10,rotation:0,lockAspectRatio:!1,propertyPanel:[{prop:"LineWidth",type:"select",label:"线宽",default:"0.75pt",options:[{label:"0.75pt",value:"0.75pt"},{label:"1.5pt",value:"1.5pt"},{label:"2.25pt",value:"2.25pt"},{label:"3pt",value:"3pt"},{label:"3.75pt",value:"3.75pt"},{label:"4.5pt",value:"4.5pt"},{label:"5.25pt",value:"5.25pt"},{label:"6pt",value:"6pt"},{label:"6.75pt",value:"6.75pt"}]},{prop:"LineStyle",type:"select",label:"样式",default:"实线",options:[{label:"实线",value:"实线"},{label:"虚线",value:"虚线"}]},{prop:"BorderRadius",type:"number",label:"圆角",default:0,min:0,step:1}]},horline:{width:15,height:.75,rotation:0,lockAspectRatio:!1,propertyPanel:[{prop:"LineWidth",type:"select",label:"线宽",default:"0.75pt",options:[{label:"0.75pt",value:"0.75pt"},{label:"1.5pt",value:"1.5pt"},{label:"2.25pt",value:"2.25pt"},{label:"3pt",value:"3pt"},{label:"3.75pt",value:"3.75pt"},{label:"4.5pt",value:"4.5pt"},{label:"5.25pt",value:"5.25pt"},{label:"6pt",value:"6pt"},{label:"6.75pt",value:"6.75pt"}]},{prop:"LineStyle",type:"select",label:"样式",default:"实线",options:[{label:"实线",value:"实线"},{label:"虚线",value:"虚线"}]}]}}},Symbol.toStringTag,{value:"Module"})),SV=Object.freeze(Object.defineProperty({__proto__:null,default:{text:{x:0,y:0,width:20,height:4.2,rotation:0,Title:"",FieldName:"",Text:"测试文本",FontName:"黑体",FontSize:10,FontColor:"#000000",Bold:0,Italic:0,Underline:0,Alignment:2,TextWrap:1,HOrient:0,VOrient:0,PenWidth:0,PenStyle:0,Stretch:1,PreviewOnly:0,ReadOnly:0,propertyPanel:[{prop:"Title",label:"标题",default:"",layout:"full"},{prop:"FieldName",label:"字段名称",type:"select",optionsKey:"fields",default:"",layout:"full"},{prop:"Text",label:"测试数据",default:"测试文本",layout:"full"},{prop:"FontName",label:"字体名称",type:"select",options:[{label:"黑体",value:"黑体",cssValue:"SimHei"},{label:"楷体",value:"楷体",cssValue:"KaiTi"},{label:"宋体",value:"宋体",cssValue:"SimSun"}],default:"黑体",layout:"half"},{prop:"FontSize",label:"字体大小",type:"number",min:1,max:100,default:10,layout:"half"},{prop:"FontColor",label:"字体颜色",type:"color",hide:!0,default:"#000000",layout:"half"},{prop:"Bold",label:"字体加粗",type:"select",options:[{label:"加粗",value:1},{label:"不加粗",value:0}],default:0,layout:"half"},{prop:"Italic",label:"是否斜体",type:"select",options:[{label:"是",value:1},{label:"否",value:0}],default:0,layout:"half"},{prop:"Alignment",label:"对齐方式",type:"select",options:[{label:"居左",value:1},{label:"居中",value:2},{label:"居右",value:3}],default:2,layout:"half"},{prop:"TextWrap",label:"文本换行",type:"select",options:[{label:"换行",value:1},{label:"不换行&省略",value:2},{label:"不换行&隐藏",value:3}],default:1,layout:"half"}]},barcode:{x:0,y:0,width:20,height:6,rotation:0,FieldName:"goodsSn",BarcodeValue:"1234567890",CodeType:"128Auto",AlignJustify:0,LineColor:"#000000",propertyPanel:[{prop:"FieldName",label:"字段名称",type:"select",optionsKey:"fields",default:"goodsSn",layout:"full"},{prop:"BarcodeValue",label:"测试数据",type:"text",default:"1234567890"},{prop:"CodeType",label:"条码类型",type:"select",options:[{label:"CODE128",value:"128Auto",compValue:"CODE128"},{label:"CODE39",value:"Code39",compValue:"CODE39"},{label:"EAN13",value:"EAN13",compValue:"EAN13"}],hide:!0,default:"128Auto"},{prop:"AlignJustify",label:"对齐方式",type:"select",options:[{label:"两端对齐",value:0},{label:"左",value:1},{label:"中",value:2},{label:"右",value:3}],hide:!0,default:0},{prop:"LineColor",label:"条形码颜色",type:"color",hide:!0,default:"#000000"}]},qrcode:{x:0,y:0,width:10,height:10,rotation:0,FieldName:"",QRCodeValue:"FB-GOLD",QRCodeVersion:7,QRCodeErrorLevel:"Q",QRCodeEncodeMode:"B",QRCodeForeground:"#000000",QRCodeBackground:"transparent",LockAspectRatio:!0,lockAspectRatio:!0,propertyPanel:[{prop:"FieldName",label:"字段名称",type:"select",optionsKey:"fields",default:"",layout:"full"},{prop:"QRCodeValue",label:"测试数据",type:"text",default:"FB-GOLD"},{prop:"QRCodeVersion",label:"二维码版本",type:"number",min:1,max:40,hide:!0,default:7},{prop:"QRCodeErrorLevel",label:"纠错级别",type:"select",options:[{label:"L (7%)",value:"L"},{label:"M (15%)",value:"M"},{label:"Q (25%)",value:"Q"},{label:"H (30%)",value:"H"}],hide:!0,default:"Q"},{prop:"QRCodeEncodeMode",label:"编码模式",type:"select",options:[{label:"数字",value:"N"},{label:"二进制或汉语",value:"B"},{label:"英文字母",value:"A"}],hide:!0,default:"B"},{prop:"QRCodeForeground",label:"前景色",type:"color",hide:!0,default:"#000000"},{prop:"QRCodeBackground",label:"背景景色",type:"color",hide:!0,default:"transparent"}]},image:{width:12,height:12,rotation:0,lockAspectRatio:!1,propertyPanel:[{prop:"ImageSrc",label:"图片地址",type:"file",accept:"image/*",default:""},{prop:"ScaleMode",label:"图片缩放",type:"select",options:[{label:"原始尺寸",value:1},{label:"居中裁剪",value:2},{label:"填充",value:3}],default:1},{prop:"IsPrint",label:"是否打印",type:"select",options:[{label:"是",value:!0},{label:"否",value:!1}],default:!0}]}}},Symbol.toStringTag,{value:"Module"}));return Rn});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "template-designer",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "模板拖拽设计器组件库",
5
5
  "main": "dist/template-designer.umd.js",
6
6
  "module": "dist/template-designer.esm.js",