@aitmed/aitmed-document-template 1.49.0 → 1.51.0
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.
|
@@ -17248,7 +17248,7 @@ const s6 = (e) => {
|
|
|
17248
17248
|
], 2)
|
|
17249
17249
|
]));
|
|
17250
17250
|
}
|
|
17251
|
-
}), N6 = /* @__PURE__ */ ya(O6, [["__scopeId", "data-v-516516a5"]]), k6 = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='6'%20height='6'%20viewBox='0%200%206%206'%3e%3ccircle%20id='椭圆_711'%20data-name='椭圆%20711'%20cx='3'%20cy='3'%20r='3'%20fill='%23005795'/%3e%3c/svg%3e", Nv = (e) => (Vs("data-v-
|
|
17251
|
+
}), N6 = /* @__PURE__ */ ya(O6, [["__scopeId", "data-v-516516a5"]]), k6 = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='6'%20height='6'%20viewBox='0%200%206%206'%3e%3ccircle%20id='椭圆_711'%20data-name='椭圆%20711'%20cx='3'%20cy='3'%20r='3'%20fill='%23005795'/%3e%3c/svg%3e", Nv = (e) => (Vs("data-v-45ebd5d5"), e = e(), Ws(), e), R6 = { class: "recommend-diagnoses" }, B6 = /* @__PURE__ */ Nv(() => /* @__PURE__ */ V("div", { class: "header" }, null, -1)), P6 = /* @__PURE__ */ Nv(() => /* @__PURE__ */ V("div", { class: "recommend-diagnoses-title" }, [
|
|
17252
17252
|
/* @__PURE__ */ V("img", {
|
|
17253
17253
|
class: "recommend-diagnoses-title_icon",
|
|
17254
17254
|
src: k6
|
|
@@ -17258,12 +17258,12 @@ const s6 = (e) => {
|
|
|
17258
17258
|
__name: "RecommendDiagnosis",
|
|
17259
17259
|
setup(e) {
|
|
17260
17260
|
aa((M) => ({
|
|
17261
|
-
"
|
|
17262
|
-
|
|
17263
|
-
"
|
|
17264
|
-
"
|
|
17261
|
+
"5f9b895a": b.width,
|
|
17262
|
+
"1c46353a": b.height,
|
|
17263
|
+
"4a45ce22": b.top,
|
|
17264
|
+
"031fa64c": b.left
|
|
17265
17265
|
}));
|
|
17266
|
-
const n = pe(va()),
|
|
17266
|
+
const n = pe(va()), r = ui(), i = r.getDocumentTemplate(), s = i.ecos, l = i.info, c = Ic().getRecommendDiagnosis(), h = ut([]), v = ut(c.options.formData), g = pe(!1), y = pe(null), m = c.cache;
|
|
17267
17267
|
let C = "";
|
|
17268
17268
|
const b = ut({
|
|
17269
17269
|
top: "",
|
|
@@ -17324,11 +17324,13 @@ const s6 = (e) => {
|
|
|
17324
17324
|
}, D = (M) => {
|
|
17325
17325
|
M.target === y.value && c.close();
|
|
17326
17326
|
}, A = async () => {
|
|
17327
|
-
|
|
17328
|
-
|
|
17329
|
-
|
|
17330
|
-
|
|
17331
|
-
|
|
17327
|
+
console.log(r.documentTemplateData), h.forEach((M) => {
|
|
17328
|
+
M.isChecked && r.documentTemplateData.value.Diagnosis.push({
|
|
17329
|
+
code: M.code,
|
|
17330
|
+
comment: M.comment,
|
|
17331
|
+
description: M.description
|
|
17332
|
+
});
|
|
17333
|
+
});
|
|
17332
17334
|
};
|
|
17333
17335
|
return (M, O) => {
|
|
17334
17336
|
const K = qg, R = io;
|
|
@@ -17378,7 +17380,7 @@ const s6 = (e) => {
|
|
|
17378
17380
|
], 2);
|
|
17379
17381
|
};
|
|
17380
17382
|
}
|
|
17381
|
-
}), W6 = /* @__PURE__ */ ya(V6, [["__scopeId", "data-v-
|
|
17383
|
+
}), W6 = /* @__PURE__ */ ya(V6, [["__scopeId", "data-v-45ebd5d5"]]), H6 = /* @__PURE__ */ xe({
|
|
17382
17384
|
__name: "DocumentTemplate",
|
|
17383
17385
|
props: {
|
|
17384
17386
|
json: {
|
|
@@ -76,7 +76,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
76
76
|
*
|
|
77
77
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
78
78
|
* @license MIT
|
|
79
|
-
*/(function(e){const r=ka,o=ql,a=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=f,e.SlowBuffer=A,e.INSPECT_MAX_BYTES=50;const l=2147483647;e.kMaxLength=l,f.TYPED_ARRAY_SUPPORT=c(),!f.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function c(){try{const x=new Uint8Array(1),p={foo:function(){return 42}};return Object.setPrototypeOf(p,Uint8Array.prototype),Object.setPrototypeOf(x,p),x.foo()===42}catch{return!1}}Object.defineProperty(f.prototype,"parent",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.buffer}}),Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.byteOffset}});function u(x){if(x>l)throw new RangeError('The value "'+x+'" is invalid for option "size"');const p=new Uint8Array(x);return Object.setPrototypeOf(p,f.prototype),p}function f(x,p,h){if(typeof x=="number"){if(typeof p=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return w(x)}return m(x,p,h)}f.poolSize=8192;function m(x,p,h){if(typeof x=="string")return b(x,p);if(ArrayBuffer.isView(x))return E(x);if(x==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof x);if(it(x,ArrayBuffer)||x&&it(x.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(it(x,SharedArrayBuffer)||x&&it(x.buffer,SharedArrayBuffer)))return S(x,p,h);if(typeof x=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const T=x.valueOf&&x.valueOf();if(T!=null&&T!==x)return f.from(T,p,h);const z=N(x);if(z)return z;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof x[Symbol.toPrimitive]=="function")return f.from(x[Symbol.toPrimitive]("string"),p,h);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof x)}f.from=function(x,p,h){return m(x,p,h)},Object.setPrototypeOf(f.prototype,Uint8Array.prototype),Object.setPrototypeOf(f,Uint8Array);function y(x){if(typeof x!="number")throw new TypeError('"size" argument must be of type number');if(x<0)throw new RangeError('The value "'+x+'" is invalid for option "size"')}function g(x,p,h){return y(x),x<=0?u(x):p!==void 0?typeof h=="string"?u(x).fill(p,h):u(x).fill(p):u(x)}f.alloc=function(x,p,h){return g(x,p,h)};function w(x){return y(x),u(x<0?0:k(x)|0)}f.allocUnsafe=function(x){return w(x)},f.allocUnsafeSlow=function(x){return w(x)};function b(x,p){if((typeof p!="string"||p==="")&&(p="utf8"),!f.isEncoding(p))throw new TypeError("Unknown encoding: "+p);const h=B(x,p)|0;let T=u(h);const z=T.write(x,p);return z!==h&&(T=T.slice(0,z)),T}function M(x){const p=x.length<0?0:k(x.length)|0,h=u(p);for(let T=0;T<p;T+=1)h[T]=x[T]&255;return h}function E(x){if(it(x,Uint8Array)){const p=new Uint8Array(x);return S(p.buffer,p.byteOffset,p.byteLength)}return M(x)}function S(x,p,h){if(p<0||x.byteLength<p)throw new RangeError('"offset" is outside of buffer bounds');if(x.byteLength<p+(h||0))throw new RangeError('"length" is outside of buffer bounds');let T;return p===void 0&&h===void 0?T=new Uint8Array(x):h===void 0?T=new Uint8Array(x,p):T=new Uint8Array(x,p,h),Object.setPrototypeOf(T,f.prototype),T}function N(x){if(f.isBuffer(x)){const p=k(x.length)|0,h=u(p);return h.length===0||x.copy(h,0,0,p),h}if(x.length!==void 0)return typeof x.length!="number"||Lt(x.length)?u(0):M(x);if(x.type==="Buffer"&&Array.isArray(x.data))return M(x.data)}function k(x){if(x>=l)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+l.toString(16)+" bytes");return x|0}function A(x){return+x!=x&&(x=0),f.alloc(+x)}f.isBuffer=function(p){return p!=null&&p._isBuffer===!0&&p!==f.prototype},f.compare=function(p,h){if(it(p,Uint8Array)&&(p=f.from(p,p.offset,p.byteLength)),it(h,Uint8Array)&&(h=f.from(h,h.offset,h.byteLength)),!f.isBuffer(p)||!f.isBuffer(h))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(p===h)return 0;let T=p.length,z=h.length;for(let U=0,ee=Math.min(T,z);U<ee;++U)if(p[U]!==h[U]){T=p[U],z=h[U];break}return T<z?-1:z<T?1:0},f.isEncoding=function(p){switch(String(p).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(p,h){if(!Array.isArray(p))throw new TypeError('"list" argument must be an Array of Buffers');if(p.length===0)return f.alloc(0);let T;if(h===void 0)for(h=0,T=0;T<p.length;++T)h+=p[T].length;const z=f.allocUnsafe(h);let U=0;for(T=0;T<p.length;++T){let ee=p[T];if(it(ee,Uint8Array))U+ee.length>z.length?(f.isBuffer(ee)||(ee=f.from(ee)),ee.copy(z,U)):Uint8Array.prototype.set.call(z,ee,U);else if(f.isBuffer(ee))ee.copy(z,U);else throw new TypeError('"list" argument must be an Array of Buffers');U+=ee.length}return z};function B(x,p){if(f.isBuffer(x))return x.length;if(ArrayBuffer.isView(x)||it(x,ArrayBuffer))return x.byteLength;if(typeof x!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof x);const h=x.length,T=arguments.length>2&&arguments[2]===!0;if(!T&&h===0)return 0;let z=!1;for(;;)switch(p){case"ascii":case"latin1":case"binary":return h;case"utf8":case"utf-8":return j(x).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h*2;case"hex":return h>>>1;case"base64":return Ke(x).length;default:if(z)return T?-1:j(x).length;p=(""+p).toLowerCase(),z=!0}}f.byteLength=B;function W(x,p,h){let T=!1;if((p===void 0||p<0)&&(p=0),p>this.length||((h===void 0||h>this.length)&&(h=this.length),h<=0)||(h>>>=0,p>>>=0,h<=p))return"";for(x||(x="utf8");;)switch(x){case"hex":return ie(this,p,h);case"utf8":case"utf-8":return le(this,p,h);case"ascii":return V(this,p,h);case"latin1":case"binary":return F(this,p,h);case"base64":return ye(this,p,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ue(this,p,h);default:if(T)throw new TypeError("Unknown encoding: "+x);x=(x+"").toLowerCase(),T=!0}}f.prototype._isBuffer=!0;function L(x,p,h){const T=x[p];x[p]=x[h],x[h]=T}f.prototype.swap16=function(){const p=this.length;if(p%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let h=0;h<p;h+=2)L(this,h,h+1);return this},f.prototype.swap32=function(){const p=this.length;if(p%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let h=0;h<p;h+=4)L(this,h,h+3),L(this,h+1,h+2);return this},f.prototype.swap64=function(){const p=this.length;if(p%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let h=0;h<p;h+=8)L(this,h,h+7),L(this,h+1,h+6),L(this,h+2,h+5),L(this,h+3,h+4);return this},f.prototype.toString=function(){const p=this.length;return p===0?"":arguments.length===0?le(this,0,p):W.apply(this,arguments)},f.prototype.toLocaleString=f.prototype.toString,f.prototype.equals=function(p){if(!f.isBuffer(p))throw new TypeError("Argument must be a Buffer");return this===p?!0:f.compare(this,p)===0},f.prototype.inspect=function(){let p="";const h=e.INSPECT_MAX_BYTES;return p=this.toString("hex",0,h).replace(/(.{2})/g,"$1 ").trim(),this.length>h&&(p+=" ... "),"<Buffer "+p+">"},a&&(f.prototype[a]=f.prototype.inspect),f.prototype.compare=function(p,h,T,z,U){if(it(p,Uint8Array)&&(p=f.from(p,p.offset,p.byteLength)),!f.isBuffer(p))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof p);if(h===void 0&&(h=0),T===void 0&&(T=p?p.length:0),z===void 0&&(z=0),U===void 0&&(U=this.length),h<0||T>p.length||z<0||U>this.length)throw new RangeError("out of range index");if(z>=U&&h>=T)return 0;if(z>=U)return-1;if(h>=T)return 1;if(h>>>=0,T>>>=0,z>>>=0,U>>>=0,this===p)return 0;let ee=U-z,ve=T-h;const nt=Math.min(ee,ve),Xe=this.slice(z,U),rt=p.slice(h,T);for(let qe=0;qe<nt;++qe)if(Xe[qe]!==rt[qe]){ee=Xe[qe],ve=rt[qe];break}return ee<ve?-1:ve<ee?1:0};function G(x,p,h,T,z){if(x.length===0)return-1;if(typeof h=="string"?(T=h,h=0):h>2147483647?h=2147483647:h<-2147483648&&(h=-2147483648),h=+h,Lt(h)&&(h=z?0:x.length-1),h<0&&(h=x.length+h),h>=x.length){if(z)return-1;h=x.length-1}else if(h<0)if(z)h=0;else return-1;if(typeof p=="string"&&(p=f.from(p,T)),f.isBuffer(p))return p.length===0?-1:H(x,p,h,T,z);if(typeof p=="number")return p=p&255,typeof Uint8Array.prototype.indexOf=="function"?z?Uint8Array.prototype.indexOf.call(x,p,h):Uint8Array.prototype.lastIndexOf.call(x,p,h):H(x,[p],h,T,z);throw new TypeError("val must be string, number or Buffer")}function H(x,p,h,T,z){let U=1,ee=x.length,ve=p.length;if(T!==void 0&&(T=String(T).toLowerCase(),T==="ucs2"||T==="ucs-2"||T==="utf16le"||T==="utf-16le")){if(x.length<2||p.length<2)return-1;U=2,ee/=2,ve/=2,h/=2}function nt(rt,qe){return U===1?rt[qe]:rt.readUInt16BE(qe*U)}let Xe;if(z){let rt=-1;for(Xe=h;Xe<ee;Xe++)if(nt(x,Xe)===nt(p,rt===-1?0:Xe-rt)){if(rt===-1&&(rt=Xe),Xe-rt+1===ve)return rt*U}else rt!==-1&&(Xe-=Xe-rt),rt=-1}else for(h+ve>ee&&(h=ee-ve),Xe=h;Xe>=0;Xe--){let rt=!0;for(let qe=0;qe<ve;qe++)if(nt(x,Xe+qe)!==nt(p,qe)){rt=!1;break}if(rt)return Xe}return-1}f.prototype.includes=function(p,h,T){return this.indexOf(p,h,T)!==-1},f.prototype.indexOf=function(p,h,T){return G(this,p,h,T,!0)},f.prototype.lastIndexOf=function(p,h,T){return G(this,p,h,T,!1)};function te(x,p,h,T){h=Number(h)||0;const z=x.length-h;T?(T=Number(T),T>z&&(T=z)):T=z;const U=p.length;T>U/2&&(T=U/2);let ee;for(ee=0;ee<T;++ee){const ve=parseInt(p.substr(ee*2,2),16);if(Lt(ve))return ee;x[h+ee]=ve}return ee}function K(x,p,h,T){return Ue(j(p,x.length-h),x,h,T)}function q(x,p,h,T){return Ue(fe(p),x,h,T)}function X(x,p,h,T){return Ue(Ke(p),x,h,T)}function se(x,p,h,T){return Ue(Ye(p,x.length-h),x,h,T)}f.prototype.write=function(p,h,T,z){if(h===void 0)z="utf8",T=this.length,h=0;else if(T===void 0&&typeof h=="string")z=h,T=this.length,h=0;else if(isFinite(h))h=h>>>0,isFinite(T)?(T=T>>>0,z===void 0&&(z="utf8")):(z=T,T=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const U=this.length-h;if((T===void 0||T>U)&&(T=U),p.length>0&&(T<0||h<0)||h>this.length)throw new RangeError("Attempt to write outside buffer bounds");z||(z="utf8");let ee=!1;for(;;)switch(z){case"hex":return te(this,p,h,T);case"utf8":case"utf-8":return K(this,p,h,T);case"ascii":case"latin1":case"binary":return q(this,p,h,T);case"base64":return X(this,p,h,T);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return se(this,p,h,T);default:if(ee)throw new TypeError("Unknown encoding: "+z);z=(""+z).toLowerCase(),ee=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ye(x,p,h){return p===0&&h===x.length?r.fromByteArray(x):r.fromByteArray(x.slice(p,h))}function le(x,p,h){h=Math.min(x.length,h);const T=[];let z=p;for(;z<h;){const U=x[z];let ee=null,ve=U>239?4:U>223?3:U>191?2:1;if(z+ve<=h){let nt,Xe,rt,qe;switch(ve){case 1:U<128&&(ee=U);break;case 2:nt=x[z+1],(nt&192)===128&&(qe=(U&31)<<6|nt&63,qe>127&&(ee=qe));break;case 3:nt=x[z+1],Xe=x[z+2],(nt&192)===128&&(Xe&192)===128&&(qe=(U&15)<<12|(nt&63)<<6|Xe&63,qe>2047&&(qe<55296||qe>57343)&&(ee=qe));break;case 4:nt=x[z+1],Xe=x[z+2],rt=x[z+3],(nt&192)===128&&(Xe&192)===128&&(rt&192)===128&&(qe=(U&15)<<18|(nt&63)<<12|(Xe&63)<<6|rt&63,qe>65535&&qe<1114112&&(ee=qe))}}ee===null?(ee=65533,ve=1):ee>65535&&(ee-=65536,T.push(ee>>>10&1023|55296),ee=56320|ee&1023),T.push(ee),z+=ve}return R(T)}const D=4096;function R(x){const p=x.length;if(p<=D)return String.fromCharCode.apply(String,x);let h="",T=0;for(;T<p;)h+=String.fromCharCode.apply(String,x.slice(T,T+=D));return h}function V(x,p,h){let T="";h=Math.min(x.length,h);for(let z=p;z<h;++z)T+=String.fromCharCode(x[z]&127);return T}function F(x,p,h){let T="";h=Math.min(x.length,h);for(let z=p;z<h;++z)T+=String.fromCharCode(x[z]);return T}function ie(x,p,h){const T=x.length;(!p||p<0)&&(p=0),(!h||h<0||h>T)&&(h=T);let z="";for(let U=p;U<h;++U)z+=Qt[x[U]];return z}function ue(x,p,h){const T=x.slice(p,h);let z="";for(let U=0;U<T.length-1;U+=2)z+=String.fromCharCode(T[U]+T[U+1]*256);return z}f.prototype.slice=function(p,h){const T=this.length;p=~~p,h=h===void 0?T:~~h,p<0?(p+=T,p<0&&(p=0)):p>T&&(p=T),h<0?(h+=T,h<0&&(h=0)):h>T&&(h=T),h<p&&(h=p);const z=this.subarray(p,h);return Object.setPrototypeOf(z,f.prototype),z};function de(x,p,h){if(x%1!==0||x<0)throw new RangeError("offset is not uint");if(x+p>h)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUintLE=f.prototype.readUIntLE=function(p,h,T){p=p>>>0,h=h>>>0,T||de(p,h,this.length);let z=this[p],U=1,ee=0;for(;++ee<h&&(U*=256);)z+=this[p+ee]*U;return z},f.prototype.readUintBE=f.prototype.readUIntBE=function(p,h,T){p=p>>>0,h=h>>>0,T||de(p,h,this.length);let z=this[p+--h],U=1;for(;h>0&&(U*=256);)z+=this[p+--h]*U;return z},f.prototype.readUint8=f.prototype.readUInt8=function(p,h){return p=p>>>0,h||de(p,1,this.length),this[p]},f.prototype.readUint16LE=f.prototype.readUInt16LE=function(p,h){return p=p>>>0,h||de(p,2,this.length),this[p]|this[p+1]<<8},f.prototype.readUint16BE=f.prototype.readUInt16BE=function(p,h){return p=p>>>0,h||de(p,2,this.length),this[p]<<8|this[p+1]},f.prototype.readUint32LE=f.prototype.readUInt32LE=function(p,h){return p=p>>>0,h||de(p,4,this.length),(this[p]|this[p+1]<<8|this[p+2]<<16)+this[p+3]*16777216},f.prototype.readUint32BE=f.prototype.readUInt32BE=function(p,h){return p=p>>>0,h||de(p,4,this.length),this[p]*16777216+(this[p+1]<<16|this[p+2]<<8|this[p+3])},f.prototype.readBigUInt64LE=oe(function(p){p=p>>>0,Pe(p,"offset");const h=this[p],T=this[p+7];(h===void 0||T===void 0)&&ot(p,this.length-8);const z=h+this[++p]*2**8+this[++p]*2**16+this[++p]*2**24,U=this[++p]+this[++p]*2**8+this[++p]*2**16+T*2**24;return BigInt(z)+(BigInt(U)<<BigInt(32))}),f.prototype.readBigUInt64BE=oe(function(p){p=p>>>0,Pe(p,"offset");const h=this[p],T=this[p+7];(h===void 0||T===void 0)&&ot(p,this.length-8);const z=h*2**24+this[++p]*2**16+this[++p]*2**8+this[++p],U=this[++p]*2**24+this[++p]*2**16+this[++p]*2**8+T;return(BigInt(z)<<BigInt(32))+BigInt(U)}),f.prototype.readIntLE=function(p,h,T){p=p>>>0,h=h>>>0,T||de(p,h,this.length);let z=this[p],U=1,ee=0;for(;++ee<h&&(U*=256);)z+=this[p+ee]*U;return U*=128,z>=U&&(z-=Math.pow(2,8*h)),z},f.prototype.readIntBE=function(p,h,T){p=p>>>0,h=h>>>0,T||de(p,h,this.length);let z=h,U=1,ee=this[p+--z];for(;z>0&&(U*=256);)ee+=this[p+--z]*U;return U*=128,ee>=U&&(ee-=Math.pow(2,8*h)),ee},f.prototype.readInt8=function(p,h){return p=p>>>0,h||de(p,1,this.length),this[p]&128?(255-this[p]+1)*-1:this[p]},f.prototype.readInt16LE=function(p,h){p=p>>>0,h||de(p,2,this.length);const T=this[p]|this[p+1]<<8;return T&32768?T|4294901760:T},f.prototype.readInt16BE=function(p,h){p=p>>>0,h||de(p,2,this.length);const T=this[p+1]|this[p]<<8;return T&32768?T|4294901760:T},f.prototype.readInt32LE=function(p,h){return p=p>>>0,h||de(p,4,this.length),this[p]|this[p+1]<<8|this[p+2]<<16|this[p+3]<<24},f.prototype.readInt32BE=function(p,h){return p=p>>>0,h||de(p,4,this.length),this[p]<<24|this[p+1]<<16|this[p+2]<<8|this[p+3]},f.prototype.readBigInt64LE=oe(function(p){p=p>>>0,Pe(p,"offset");const h=this[p],T=this[p+7];(h===void 0||T===void 0)&&ot(p,this.length-8);const z=this[p+4]+this[p+5]*2**8+this[p+6]*2**16+(T<<24);return(BigInt(z)<<BigInt(32))+BigInt(h+this[++p]*2**8+this[++p]*2**16+this[++p]*2**24)}),f.prototype.readBigInt64BE=oe(function(p){p=p>>>0,Pe(p,"offset");const h=this[p],T=this[p+7];(h===void 0||T===void 0)&&ot(p,this.length-8);const z=(h<<24)+this[++p]*2**16+this[++p]*2**8+this[++p];return(BigInt(z)<<BigInt(32))+BigInt(this[++p]*2**24+this[++p]*2**16+this[++p]*2**8+T)}),f.prototype.readFloatLE=function(p,h){return p=p>>>0,h||de(p,4,this.length),o.read(this,p,!0,23,4)},f.prototype.readFloatBE=function(p,h){return p=p>>>0,h||de(p,4,this.length),o.read(this,p,!1,23,4)},f.prototype.readDoubleLE=function(p,h){return p=p>>>0,h||de(p,8,this.length),o.read(this,p,!0,52,8)},f.prototype.readDoubleBE=function(p,h){return p=p>>>0,h||de(p,8,this.length),o.read(this,p,!1,52,8)};function ge(x,p,h,T,z,U){if(!f.isBuffer(x))throw new TypeError('"buffer" argument must be a Buffer instance');if(p>z||p<U)throw new RangeError('"value" argument is out of bounds');if(h+T>x.length)throw new RangeError("Index out of range")}f.prototype.writeUintLE=f.prototype.writeUIntLE=function(p,h,T,z){if(p=+p,h=h>>>0,T=T>>>0,!z){const ve=Math.pow(2,8*T)-1;ge(this,p,h,T,ve,0)}let U=1,ee=0;for(this[h]=p&255;++ee<T&&(U*=256);)this[h+ee]=p/U&255;return h+T},f.prototype.writeUintBE=f.prototype.writeUIntBE=function(p,h,T,z){if(p=+p,h=h>>>0,T=T>>>0,!z){const ve=Math.pow(2,8*T)-1;ge(this,p,h,T,ve,0)}let U=T-1,ee=1;for(this[h+U]=p&255;--U>=0&&(ee*=256);)this[h+U]=p/ee&255;return h+T},f.prototype.writeUint8=f.prototype.writeUInt8=function(p,h,T){return p=+p,h=h>>>0,T||ge(this,p,h,1,255,0),this[h]=p&255,h+1},f.prototype.writeUint16LE=f.prototype.writeUInt16LE=function(p,h,T){return p=+p,h=h>>>0,T||ge(this,p,h,2,65535,0),this[h]=p&255,this[h+1]=p>>>8,h+2},f.prototype.writeUint16BE=f.prototype.writeUInt16BE=function(p,h,T){return p=+p,h=h>>>0,T||ge(this,p,h,2,65535,0),this[h]=p>>>8,this[h+1]=p&255,h+2},f.prototype.writeUint32LE=f.prototype.writeUInt32LE=function(p,h,T){return p=+p,h=h>>>0,T||ge(this,p,h,4,4294967295,0),this[h+3]=p>>>24,this[h+2]=p>>>16,this[h+1]=p>>>8,this[h]=p&255,h+4},f.prototype.writeUint32BE=f.prototype.writeUInt32BE=function(p,h,T){return p=+p,h=h>>>0,T||ge(this,p,h,4,4294967295,0),this[h]=p>>>24,this[h+1]=p>>>16,this[h+2]=p>>>8,this[h+3]=p&255,h+4};function Ie(x,p,h,T,z){We(p,T,z,x,h,7);let U=Number(p&BigInt(4294967295));x[h++]=U,U=U>>8,x[h++]=U,U=U>>8,x[h++]=U,U=U>>8,x[h++]=U;let ee=Number(p>>BigInt(32)&BigInt(4294967295));return x[h++]=ee,ee=ee>>8,x[h++]=ee,ee=ee>>8,x[h++]=ee,ee=ee>>8,x[h++]=ee,h}function Se(x,p,h,T,z){We(p,T,z,x,h,7);let U=Number(p&BigInt(4294967295));x[h+7]=U,U=U>>8,x[h+6]=U,U=U>>8,x[h+5]=U,U=U>>8,x[h+4]=U;let ee=Number(p>>BigInt(32)&BigInt(4294967295));return x[h+3]=ee,ee=ee>>8,x[h+2]=ee,ee=ee>>8,x[h+1]=ee,ee=ee>>8,x[h]=ee,h+8}f.prototype.writeBigUInt64LE=oe(function(p,h=0){return Ie(this,p,h,BigInt(0),BigInt("0xffffffffffffffff"))}),f.prototype.writeBigUInt64BE=oe(function(p,h=0){return Se(this,p,h,BigInt(0),BigInt("0xffffffffffffffff"))}),f.prototype.writeIntLE=function(p,h,T,z){if(p=+p,h=h>>>0,!z){const nt=Math.pow(2,8*T-1);ge(this,p,h,T,nt-1,-nt)}let U=0,ee=1,ve=0;for(this[h]=p&255;++U<T&&(ee*=256);)p<0&&ve===0&&this[h+U-1]!==0&&(ve=1),this[h+U]=(p/ee>>0)-ve&255;return h+T},f.prototype.writeIntBE=function(p,h,T,z){if(p=+p,h=h>>>0,!z){const nt=Math.pow(2,8*T-1);ge(this,p,h,T,nt-1,-nt)}let U=T-1,ee=1,ve=0;for(this[h+U]=p&255;--U>=0&&(ee*=256);)p<0&&ve===0&&this[h+U+1]!==0&&(ve=1),this[h+U]=(p/ee>>0)-ve&255;return h+T},f.prototype.writeInt8=function(p,h,T){return p=+p,h=h>>>0,T||ge(this,p,h,1,127,-128),p<0&&(p=255+p+1),this[h]=p&255,h+1},f.prototype.writeInt16LE=function(p,h,T){return p=+p,h=h>>>0,T||ge(this,p,h,2,32767,-32768),this[h]=p&255,this[h+1]=p>>>8,h+2},f.prototype.writeInt16BE=function(p,h,T){return p=+p,h=h>>>0,T||ge(this,p,h,2,32767,-32768),this[h]=p>>>8,this[h+1]=p&255,h+2},f.prototype.writeInt32LE=function(p,h,T){return p=+p,h=h>>>0,T||ge(this,p,h,4,2147483647,-2147483648),this[h]=p&255,this[h+1]=p>>>8,this[h+2]=p>>>16,this[h+3]=p>>>24,h+4},f.prototype.writeInt32BE=function(p,h,T){return p=+p,h=h>>>0,T||ge(this,p,h,4,2147483647,-2147483648),p<0&&(p=4294967295+p+1),this[h]=p>>>24,this[h+1]=p>>>16,this[h+2]=p>>>8,this[h+3]=p&255,h+4},f.prototype.writeBigInt64LE=oe(function(p,h=0){return Ie(this,p,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),f.prototype.writeBigInt64BE=oe(function(p,h=0){return Se(this,p,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Te(x,p,h,T,z,U){if(h+T>x.length)throw new RangeError("Index out of range");if(h<0)throw new RangeError("Index out of range")}function pe(x,p,h,T,z){return p=+p,h=h>>>0,z||Te(x,p,h,4),o.write(x,p,h,T,23,4),h+4}f.prototype.writeFloatLE=function(p,h,T){return pe(this,p,h,!0,T)},f.prototype.writeFloatBE=function(p,h,T){return pe(this,p,h,!1,T)};function ae(x,p,h,T,z){return p=+p,h=h>>>0,z||Te(x,p,h,8),o.write(x,p,h,T,52,8),h+8}f.prototype.writeDoubleLE=function(p,h,T){return ae(this,p,h,!0,T)},f.prototype.writeDoubleBE=function(p,h,T){return ae(this,p,h,!1,T)},f.prototype.copy=function(p,h,T,z){if(!f.isBuffer(p))throw new TypeError("argument should be a Buffer");if(T||(T=0),!z&&z!==0&&(z=this.length),h>=p.length&&(h=p.length),h||(h=0),z>0&&z<T&&(z=T),z===T||p.length===0||this.length===0)return 0;if(h<0)throw new RangeError("targetStart out of bounds");if(T<0||T>=this.length)throw new RangeError("Index out of range");if(z<0)throw new RangeError("sourceEnd out of bounds");z>this.length&&(z=this.length),p.length-h<z-T&&(z=p.length-h+T);const U=z-T;return this===p&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(h,T,z):Uint8Array.prototype.set.call(p,this.subarray(T,z),h),U},f.prototype.fill=function(p,h,T,z){if(typeof p=="string"){if(typeof h=="string"?(z=h,h=0,T=this.length):typeof T=="string"&&(z=T,T=this.length),z!==void 0&&typeof z!="string")throw new TypeError("encoding must be a string");if(typeof z=="string"&&!f.isEncoding(z))throw new TypeError("Unknown encoding: "+z);if(p.length===1){const ee=p.charCodeAt(0);(z==="utf8"&&ee<128||z==="latin1")&&(p=ee)}}else typeof p=="number"?p=p&255:typeof p=="boolean"&&(p=Number(p));if(h<0||this.length<h||this.length<T)throw new RangeError("Out of range index");if(T<=h)return this;h=h>>>0,T=T===void 0?this.length:T>>>0,p||(p=0);let U;if(typeof p=="number")for(U=h;U<T;++U)this[U]=p;else{const ee=f.isBuffer(p)?p:f.from(p,z),ve=ee.length;if(ve===0)throw new TypeError('The value "'+p+'" is invalid for argument "value"');for(U=0;U<T-h;++U)this[U+h]=ee[U%ve]}return this};const he={};function Ce(x,p,h){he[x]=class extends h{constructor(){super(),Object.defineProperty(this,"message",{value:p.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${x}]`,this.stack,delete this.name}get code(){return x}set code(z){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:z,writable:!0})}toString(){return`${this.name} [${x}]: ${this.message}`}}}Ce("ERR_BUFFER_OUT_OF_BOUNDS",function(x){return x?`${x} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Ce("ERR_INVALID_ARG_TYPE",function(x,p){return`The "${x}" argument must be of type number. Received type ${typeof p}`},TypeError),Ce("ERR_OUT_OF_RANGE",function(x,p,h){let T=`The value of "${x}" is out of range.`,z=h;return Number.isInteger(h)&&Math.abs(h)>2**32?z=xe(String(h)):typeof h=="bigint"&&(z=String(h),(h>BigInt(2)**BigInt(32)||h<-(BigInt(2)**BigInt(32)))&&(z=xe(z)),z+="n"),T+=` It must be ${p}. Received ${z}`,T},RangeError);function xe(x){let p="",h=x.length;const T=x[0]==="-"?1:0;for(;h>=T+4;h-=3)p=`_${x.slice(h-3,h)}${p}`;return`${x.slice(0,h)}${p}`}function Le(x,p,h){Pe(p,"offset"),(x[p]===void 0||x[p+h]===void 0)&&ot(p,x.length-(h+1))}function We(x,p,h,T,z,U){if(x>h||x<p){const ee=typeof p=="bigint"?"n":"";let ve;throw p===0||p===BigInt(0)?ve=`>= 0${ee} and < 2${ee} ** ${(U+1)*8}${ee}`:ve=`>= -(2${ee} ** ${(U+1)*8-1}${ee}) and < 2 ** ${(U+1)*8-1}${ee}`,new he.ERR_OUT_OF_RANGE("value",ve,x)}Le(T,z,U)}function Pe(x,p){if(typeof x!="number")throw new he.ERR_INVALID_ARG_TYPE(p,"number",x)}function ot(x,p,h){throw Math.floor(x)!==x?(Pe(x,h),new he.ERR_OUT_OF_RANGE("offset","an integer",x)):p<0?new he.ERR_BUFFER_OUT_OF_BOUNDS:new he.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${p}`,x)}const St=/[^+/0-9A-Za-z-_]/g;function yt(x){if(x=x.split("=")[0],x=x.trim().replace(St,""),x.length<2)return"";for(;x.length%4!==0;)x=x+"=";return x}function j(x,p){p=p||1/0;let h;const T=x.length;let z=null;const U=[];for(let ee=0;ee<T;++ee){if(h=x.charCodeAt(ee),h>55295&&h<57344){if(!z){if(h>56319){(p-=3)>-1&&U.push(239,191,189);continue}else if(ee+1===T){(p-=3)>-1&&U.push(239,191,189);continue}z=h;continue}if(h<56320){(p-=3)>-1&&U.push(239,191,189),z=h;continue}h=(z-55296<<10|h-56320)+65536}else z&&(p-=3)>-1&&U.push(239,191,189);if(z=null,h<128){if((p-=1)<0)break;U.push(h)}else if(h<2048){if((p-=2)<0)break;U.push(h>>6|192,h&63|128)}else if(h<65536){if((p-=3)<0)break;U.push(h>>12|224,h>>6&63|128,h&63|128)}else if(h<1114112){if((p-=4)<0)break;U.push(h>>18|240,h>>12&63|128,h>>6&63|128,h&63|128)}else throw new Error("Invalid code point")}return U}function fe(x){const p=[];for(let h=0;h<x.length;++h)p.push(x.charCodeAt(h)&255);return p}function Ye(x,p){let h,T,z;const U=[];for(let ee=0;ee<x.length&&!((p-=2)<0);++ee)h=x.charCodeAt(ee),T=h>>8,z=h%256,U.push(z),U.push(T);return U}function Ke(x){return r.toByteArray(yt(x))}function Ue(x,p,h,T){let z;for(z=0;z<T&&!(z+h>=p.length||z>=x.length);++z)p[z+h]=x[z];return z}function it(x,p){return x instanceof p||x!=null&&x.constructor!=null&&x.constructor.name!=null&&x.constructor.name===p.name}function Lt(x){return x!==x}const Qt=function(){const x="0123456789abcdef",p=new Array(256);for(let h=0;h<16;++h){const T=h*16;for(let z=0;z<16;++z)p[T+z]=x[h]+x[z]}return p}();function oe(x){return typeof BigInt>"u"?Ae:x}function Ae(){throw new Error("BigInt not supported")}})(ih);const kk=e=>{const r=atob(e),o=r.length,a=new Uint8Array(o);for(let l=0;l<o;l++)a[l]=r.charCodeAt(l);return a},Mk=({type:e,data:r})=>`data:${e};base64,${r}`,Ak=e=>kk(e),sh=(e,r)=>{const o=Ak(e),a=ih.Buffer.from(o.buffer);return new Blob([a.buffer],{type:r})},lh="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16.828'%20height='16.828'%20viewBox='0%200%2016.828%2016.828'%3e%3cg%20id='组_10025'%20data-name='组%2010025'%20transform='translate(0.914%201.414)'%3e%3cline%20id='直线_1370'%20data-name='直线%201370'%20x2='14'%20y2='14'%20transform='translate(0.5)'%20fill='none'%20stroke='%23c1c1c1'%20stroke-linecap='round'%20stroke-width='2'/%3e%3cline%20id='直线_1371'%20data-name='直线%201371'%20x1='14'%20y2='14'%20transform='translate(0.5)'%20fill='none'%20stroke='%23c1c1c1'%20stroke-linecap='round'%20stroke-width='2'/%3e%3c/g%3e%3c/svg%3e",Tk="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%3e%3cg%20id='组_11460'%20data-name='组%2011460'%20transform='translate(-1070%20-577)'%3e%3cpath%20id='路径_9629'%20data-name='路径%209629'%20d='M8,14.625A6.625,6.625,0,1,0,1.375,8,6.625,6.625,0,0,0,8,14.625ZM8,16a8,8,0,1,1,8-8A8,8,0,0,1,8,16Z'%20transform='translate(1070%20577)'%20fill='%23999'/%3e%3cpath%20id='路径_9630'%20data-name='路径%209630'%20d='M449.688,212.688a.687.687,0,1,0-1.375,0v5.3a.687.687,0,1,0,1.375,0ZM449,219.375a1,1,0,1,0,1,1A1,1,0,0,0,449,219.375Z'%20transform='translate(629%20368.313)'%20fill='%23999'/%3e%3c/g%3e%3c/svg%3e",Ma=e=>(t.pushScopeId("data-v-50a3cf13"),e=e(),t.popScopeId(),e),Nk={class:"signature_box"},vk=Ma(()=>t.createElementVNode("div",{class:"signature_tilte"},"Signature",-1)),Bk=Ma(()=>t.createElementVNode("div",{class:"subtitle"},"Click on the signature box below to finger sign",-1)),Dk=Ma(()=>t.createElementVNode("div",{class:"label"},"X",-1)),Lk=Ma(()=>t.createElementVNode("div",{class:"signature_tips"},[t.createElementVNode("img",{class:"signature_icon",src:Tk}),t.createElementVNode("div",{class:"tips"},"The signature is saved for later use.")],-1)),Ok={class:"signature_operate"},Rk=gi(t.defineComponent({__name:"SignaturePad",setup(e){t.useCssVars(K=>({"68ae9541":te.width,d955cde8:te.height,"4c4bcb90":te.top,"3d29dd2c":te.left}));const r=t.ref(hi()),a=vr().getDocumentTemplate(),l=t.ref(null),c=t.ref(null),u=t.ref(null),m=Is().getSignaturePad(),y=m.confirm,g=t.reactive({status:!1,ctx:null,originSignature:"",saveSignature:"",points:new Array,beginPoint:null}),w=t.reactive({x:0,y:0}),b=K=>{let[q,X]=[K.offsetLeft,K.offsetTop];const se=ye=>{X+=ye.offsetTop,q+=ye.offsetLeft,ye.offsetParent&&se(ye.offsetParent)};return K.offsetParent&&se(K.offsetParent),{left:q,top:X}},M=K=>{let{left:q,top:X}=K.getBoundingClientRect();return{left:q,top:X}},E=K=>{const q=document.createElement("canvas");q.width=K.width,q.height=K.height;const X=q.getContext("2d");return X==null||X.putImageData(K,0,0),q.toDataURL().split(",")[1]},S=K=>{if(c.value)if(K.preventDefault(),K.stopPropagation(),g.status=!0,r.value){const{left:q,top:X}=M(c.value);K=K,w.x=K.targetTouches[0].clientX-q,w.y=K.targetTouches[0].clientY-X,g.points.push({x:w.x,y:w.y})}else{const{left:q,top:X}=b(c.value);K=K,w.x=K.clientX-q,w.y=K.clientY-X,g.points.push({x:w.x,y:w.y})}},N=(K,q,X)=>{const se=g.ctx;se.beginPath(),se.moveTo(K.x,K.y),se.quadraticCurveTo(q.x,q.y,X.x,X.y),se.stroke(),se.closePath()},k=K=>{if(c.value&&(K.preventDefault(),K.stopPropagation(),g.status&&g.ctx)){if(r.value){const{left:q,top:X}=M(c.value);K=K;const se=K.targetTouches[0].clientX-q,ye=K.targetTouches[0].clientY-X;g.points.push({x:se,y:ye})}else{const{left:q,top:X}=b(c.value);K=K;const se=K.clientX-q,ye=K.clientY-X;g.points.push({x:se,y:ye})}if(g.points.length>3){const q=g.points.slice(-2),X=q[0],se={x:(q[0].x+q[1].x)/2,y:(q[0].y+q[1].y)/2};g.beginPoint&&N(g.beginPoint,X,se),g.beginPoint=se}}},A=K=>{if(c.value){K.preventDefault(),K.stopPropagation();const q=c.value;if(q.style.cursor="auto",g.status){if(r.value){const{left:ye,top:le}=M(c.value);K=K;const D=K.changedTouches[0].clientX-ye,R=K.changedTouches[0].clientY-le;g.points.push({x:D,y:R})}else{const{left:ye,top:le}=b(c.value);K=K;const D=K.clientX-ye,R=K.clientY-le;g.points.push({x:D,y:R})}if(g.points.length>3){const ye=g.points.slice(-2),le=ye[0],D=ye[1];g.beginPoint&&N(g.beginPoint,le,D)}g.beginPoint=null,g.points=[];const X=g.ctx;X==null||X.closePath();const se=X==null?void 0:X.getImageData(0,0,q.width,q.height);g.saveSignature=E(se)}}g.status=!1},B=()=>{m.close()},W=()=>{g.ctx&&(r.value?g.ctx.clearRect(0,0,g.ctx.canvas.height,g.ctx.canvas.width):g.ctx.clearRect(0,0,g.ctx.canvas.width,g.ctx.canvas.height),g.saveSignature="")},L=K=>{K.target===u.value&&m.close()},G=async()=>{if(g.saveSignature!==g.originSignature){const K=ha.service({target:a.relatedDom||document.body});await y(m.options.dataKey,g.saveSignature,m.options.isGuardian?465921:345601,m.options.type),K.close(),m.close()}},H=()=>{B()},te=t.reactive({top:"",left:"",width:"",height:""});return t.onMounted(async()=>{var q;r.value?(te.top="calc((100vh - 100vw) / 2)",te.left="calc((100vw - 100vh) / 2)",te.width="100vh",te.height="100vw"):a.relatedDom?(te.top=`${a.relatedDom.offsetTop}px`,te.left=`${a.relatedDom.offsetLeft}px`,te.width=`${a.relatedDom.clientWidth}px`,te.height=`${a.relatedDom.clientHeight}px`):(te.top="0",te.left="0",te.width="100vw",te.height="100vh");const K=ha.service({target:a.relatedDom||document.body});if(c.value&&l.value){const X=c.value,se=X.getContext("2d",{willReadFrequently:!0});g.ctx=se,r.value?t.nextTick(()=>{var le,D;X.width=((le=l.value)==null?void 0:le.clientWidth)||0,X.height=((D=l.value)==null?void 0:D.clientHeight)||0,se.translate(X.width/2,X.height/2),se.rotate(-Math.PI/2),se.translate(-X.height/2,-X.width/2),se.lineWidth=5}):(X.width=l.value.clientWidth,X.height=l.value.clientHeight,se.lineWidth=3),se.lineJoin="round",se.lineCap="round";const ye=m.options;if(ye.dataKey)if(Rn.get(ye.formData,ye.dataKey)){const D=((q=m.options)==null?void 0:q.value)||"";if(D){const R=new Image;R.src=D,R.onload=()=>{se.drawImage(R,0,0,R.width,R.height);const V=se==null?void 0:se.getImageData(0,0,X.width,X.height);g.originSignature=E(V),g.saveSignature=g.originSignature}}else g.originSignature="",g.saveSignature=""}else g.originSignature="",g.saveSignature=""}K.close()}),(K,q)=>{const X=br;return t.openBlock(),t.createElementBlock("div",null,[t.createElementVNode("div",{ref_key:"signatureView",ref:u,class:t.normalizeClass(r.value?"signature_view signature_view_mobile":"signature_view signature_view_ps"),onClick:L},[t.createElementVNode("div",Nk,[t.createElementVNode("img",{class:"signature_close",src:lh,onClick:B}),vk,t.createElementVNode("div",{class:"signature_subtitle"},[Bk,t.createElementVNode("div",{class:"signature_clear",onClick:W},"Clear")]),t.createElementVNode("div",{class:"signature_pad",ref_key:"signatureBox",ref:l},[t.createElementVNode("canvas",{class:"pad",ref_key:"signaturePad",ref:c,onMousedown:q[0]||(q[0]=se=>!r.value&&S(se)),onMouseup:q[1]||(q[1]=se=>!r.value&&A(se)),onMousemoveCapture:q[2]||(q[2]=se=>!r.value&&k(se)),onMouseleave:q[3]||(q[3]=se=>!r.value&&A(se)),onTouchstart:q[4]||(q[4]=se=>S(se)),onTouchend:q[5]||(q[5]=se=>A(se)),onTouchmoveCapture:q[6]||(q[6]=se=>k(se)),onTouchcancel:q[7]||(q[7]=se=>A(se))},null,544),Dk],512),Lk,t.createElementVNode("div",Ok,[t.createVNode(X,{class:"signature_chioce_button signature_cancel",onClick:H},{default:t.withCtx(()=>[t.createTextVNode("Cancel")]),_:1}),t.createVNode(X,{class:"signature_chioce_button signature_confirm",onClick:G},{default:t.withCtx(()=>[t.createTextVNode("Confirm")]),_:1})])])],2)])}}}),[["__scopeId","data-v-50a3cf13"]]),Vk="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='20'%20height='20.002'%20viewBox='0%200%2020%2020.002'%3e%3cg%20id='组_22313'%20data-name='组%2022313'%20transform='translate(-106.404%20-80.254)'%3e%3cpath%20id='路径_23519'%20data-name='路径%2023519'%20d='M209.607,82.221a1.53,1.53,0,0,1,2.154.006l1.077,1.077a1.533,1.533,0,0,1,.006,2.154L201.509,96.794h1.079l-4.316-4.316v1.079l11.335-11.335Zm-1.079-1.079L197.193,92.477a.763.763,0,0,0,0,1.079l4.316,4.316a.763.763,0,0,0,1.079,0l11.335-11.335a3.059,3.059,0,0,0-.006-4.312l-1.077-1.077a3.056,3.056,0,0,0-4.312-.006Zm-1.623,2.7,4.316,4.316,1.079-1.079-4.316-4.316L206.9,83.845Z'%20transform='translate(-88.406)'%20fill='%23333'/%3e%3cpath%20id='路径_23520'%20data-name='路径%2023520'%20d='M108.6,583.993l-2.158,6.475a.763.763,0,0,0,.965.965l6.474-2.158a.763.763,0,0,0,.3-1.263l-4.316-4.316a.763.763,0,0,0-1.263.3Zm1.448.483-1.263.3,4.316,4.316.3-1.263-6.474,2.158.965.965,2.158-6.474Z'%20transform='translate(0%20-491.217)'%20fill='%23333'/%3e%3c/g%3e%3c/svg%3e",zk={clearIcon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMC4yMDEiIHZpZXdCb3g9IjAgMCAyMCAyMC4yMDEiPjxnIGRhdGEtbmFtZT0i57uEIDIyMzYzIj48ZyBkYXRhLW5hbWU9Iue7hCAyMjM2MiIgZmlsbD0iIzMzMyIgc3Ryb2tlPSIjMzMzIiBzdHJva2Utd2lkdGg9Ii40Ij48cGF0aCBkYXRhLW5hbWU9Iui3r+W+hCAyMzUzNyIgZD0iTTE4LjM4NCAxMC45MDRoLS4zNTd2NS40NDFhMTIuOTUyIDEyLjk1MiAwIDAgMCAuMzU3IDIuOTQzLjcxNi43MTYgMCAwIDEtLjcxNC43MTRIMi4zM2EuNzE2LjcxNiAwIDAgMS0uNzEzLS43MTQgMTIuMTI4IDEyLjEyOCAwIDAgMCAuMzU3LTIuODcydi01LjUxMmgtLjM1N2EuNzE2LjcxNiAwIDAgMS0uNzE0LS43MTRWNi42MjNhLjcxNi43MTYgMCAwIDEgLjcxNC0uNzE0aDYuMDY1VjEuOTg1QTEuNzg5IDEuNzg5IDAgMCAxIDkuNDY2LjIwMWgxLjA3YTEuNzg5IDEuNzg5IDAgMCAxIDEuNzg0IDEuNzg0djMuOTI0aDYuMDY1YS43MTYuNzE2IDAgMCAxIC43MTQuNzE0djMuNTY4YS43MTYuNzE2IDAgMCAxLS43MTQuNzE0em0tMTIuMzEgOC4zODR2LTQuNzI3YS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jA3LTEuNDU4YS42ODYuNjg2IDAgMCAxLS4yMDctLjk3Mi42NzYuNjc2IDAgMCAxIC45NjUtLjIwOGw0LjEzOCAyLjc3OGEuNjMzLjYzMyAwIDAgMSAuMjc2LjU1Ni44Ni44NiAwIDAgMS0uMjc2LjU1NkwxMi44MyA4LjQ2NGMtLjA2OS4xMzktLjIwNy4xMzktLjM0NS4xMzlhLjg0OS44NDkgMCAwIDEtLjU1Mi0uMjc4LjY4Ni42ODYgMCAwIDEgLjIwNy0uOTcybDIuMjc2LTEuNTI4SDYuOWE1LjU1NiA1LjU1NiAwIDAgMCAwIDExLjExMmgxMi40MWEuNjk1LjY5NSAwIDAgMSAwIDEuMzg5SDYuOWE2Ljk0NSA2Ljk0NSAwIDAgMSAwLTEzLjg5eiIgZmlsbD0iI2MxYzFjMSIvPjxwYXRoIGRhdGEtbmFtZT0i55+p5b2iIDIzMTQ5IiBmaWxsPSJub25lIiBkPSJNMCAwaDIwdjIwSDB6Ii8+PC9zdmc+"},qt=e=>zk[e],Pk=e=>(t.pushScopeId("data-v-516516a5"),e=e(),t.popScopeId(),e),$k={class:"image-editor-box"},Fk={key:0,class:"image-editor-controler"},jk={key:0,class:"image-editor-no_edit"},Uk={key:1,class:"image-editor-editing"},Wk={class:"left"},Hk=["src"],Yk=["src"],Gk=["src"],Kk=[Pk(()=>t.createElementVNode("div",null,"Confirm",-1))],qk=gi(t.defineComponent({__name:"ImageEditor",setup(e){t.useCssVars(D=>({"455fdd5f":N.width,"4cccd4ae":N.height,b366f9a4:N.top,"2340194e":N.left}));const r=t.ref(hi()),a=ks().getImageEditor(),c=vr().getDocumentTemplate(),u=a.confirm,f=t.ref(null),m=t.ref(null),y=t.ref(null),g=t.reactive({x:0,y:0,width:0,height:0}),w=t.reactive({x:0,y:0}),b=t.reactive({isEditable:!1,clearIcon:qt("clearDisableIcon"),undoIcon:qt("undoDisableIcon"),redoIcon:qt("redoDisableIcon"),ctx:null,isDrawing:!1,color:"#ff0000",stroke:"2",originImg:void 0,index:0,operateList:new Array,redoList:new Array,originImage:"",currentImage:"",saveImage:"",type:"",points:new Array,beginPoint:null}),M=D=>{let[R,V]=[D.offsetLeft,D.offsetTop];const F=ie=>{V+=ie.offsetTop,R+=ie.offsetLeft,ie.offsetParent&&F(ie.offsetParent)};return D.offsetParent&&F(D.offsetParent),{left:R,top:V}},E=D=>{let{left:R,top:V}=D.getBoundingClientRect();return{left:R,top:V}},S=({i_width:D,i_height:R,c_width:V,c_height:F})=>{const ie=D/R,ue=V/F;switch(!0){case ie>ue:D=V,R=D/ie;break;case ie<ue:R=F,D=R*ie;break;case ie==ue:D=V,R=F;break}return{width:D,height:R}},N=t.reactive({top:"",left:"",width:"",height:""});t.onMounted(async()=>{let D=a.options.src;const R=D.split(/[:;]/);if(R.length===3?b.type=R[1]:b.type="image/png",r.value?(N.top="0",N.left="0",N.width="100vw",N.height="100vh"):c.relatedDom?(N.top=`${c.relatedDom.offsetTop}px`,N.left=`${c.relatedDom.offsetLeft}px`,N.width=`${c.relatedDom.clientWidth}px`,N.height=`${c.relatedDom.clientHeight}px`):(N.top="0",N.left="0",N.width="100vw",N.height="100vh"),f.value&&y.value){const V=f.value,F=V.getContext("2d",{willReadFrequently:!0});b.ctx=F,V.width=y.value.clientWidth,V.height=y.value.clientHeight;const ie=V.width,ue=V.height,de=new Image;de.src=D,de.onload=()=>{F.clearRect(0,0,V.width,V.height);const ge=de.width,Ie=de.height,Se=S({i_width:ge,i_height:Ie,c_width:ie,c_height:ue});g.width=Se.width,g.height=Se.height,V.width=g.width,V.height=g.height,g.x=(V.width-g.width)/2,g.y=(V.height-g.height)/2,F==null||F.drawImage(de,g.x,g.y,g.width,g.height);const Te=F==null?void 0:F.getImageData(0,0,V.width,V.height);Te&&(b.originImg=Te,b.operateList.push(Te),b.originImage=L(Te),b.currentImage=b.originImage,b.saveImage=b.originImage)}}});const k=async()=>{if(b.saveImage!==b.originImage){const D=ha.service({target:c.relatedDom||document.body});await u(a.options.dataKey,b.saveImage,b.type),D.close()}a.close()},A=D=>{D.target===m.value&&a.close()},B=()=>{b.operateList[b.index]!==b.originImg?b.clearIcon=qt("clearIcon"):b.clearIcon=qt("clearDisableIcon"),b.index>0?b.undoIcon=qt("undoIcon"):b.undoIcon=qt("undoDisableIcon"),b.redoList.length>0?b.redoIcon=qt("redoIcon"):b.redoIcon=qt("redoDisableIcon")},W=()=>{var R;const D=(R=b.ctx)==null?void 0:R.getImageData(g.x,g.y,g.width,g.height);b.currentImage=L(D),B()},L=D=>{const R=document.createElement("canvas");R.width=D.width,R.height=D.height;const V=R.getContext("2d");return V==null||V.putImageData(D,0,0),R.toDataURL().split(",")[1]},G=D=>{if(f.value){D.preventDefault(),D.stopPropagation();const R=b.ctx;if(R.strokeStyle=b.color,R.lineWidth=parseInt(b.stroke),b.isDrawing=!0,r.value){const{left:V,top:F}=E(f.value);D=D,w.x=D.targetTouches[0].clientX-V,w.y=D.targetTouches[0].clientY-F,b.points.push({x:w.x,y:w.y})}else{const{left:V,top:F}=M(f.value);D=D,w.x=D.clientX-V,w.y=D.clientY-F,b.points.push({x:w.x,y:w.y})}}},H=(D,R,V)=>{const F=b.ctx;F.beginPath(),F.moveTo(D.x,D.y),F.quadraticCurveTo(R.x,R.y,V.x,V.y),F.stroke(),F.closePath()},te=D=>{var R;if(f.value&&(D.preventDefault(),D.stopPropagation(),f.value.style.cursor="auto",b.isDrawing)){if(r.value){const{left:ie,top:ue}=E(f.value);D=D;const de=D.changedTouches[0].clientX-ie,ge=D.changedTouches[0].clientY-ue;b.points.push({x:de,y:ge})}else{const{left:ie,top:ue}=M(f.value);D=D;const de=D.clientX-ie,ge=D.clientY-ue;b.points.push({x:de,y:ge})}if(b.points.length>3){const ie=b.points.slice(-2),ue=ie[0],de=ie[1];b.beginPoint&&H(b.beginPoint,ue,de)}b.beginPoint=null,b.points=[];const V=b.ctx;V==null||V.closePath();const F=(R=b.ctx)==null?void 0:R.getImageData(g.x,g.y,g.width,g.height);b.operateList.push(F),b.redoList=new Array,b.index++}b.isDrawing=!1,W()},K=D=>{if(f.value&&(D.preventDefault(),D.stopPropagation(),b.isDrawing)){if(r.value){const{left:R,top:V}=E(f.value);D=D;const F=D.targetTouches[0].clientX-R,ie=D.targetTouches[0].clientY-V;b.points.push({x:F,y:ie})}else{const{left:R,top:V}=M(f.value);D=D;const F=D.clientX-R,ie=D.clientY-V;b.points.push({x:F,y:ie})}if(b.points.length>3){const R=b.points.slice(-2),V=R[0],F={x:(R[0].x+R[1].x)/2,y:(R[0].y+R[1].y)/2};b.beginPoint&&H(b.beginPoint,V,F),b.beginPoint=F}}},q=()=>{if(f.value){const D=f.value;r.value?(D.addEventListener("touchstart",G),D.addEventListener("touchend",te),D.addEventListener("touchcancel",te),D.addEventListener("touchmove",K)):(D.addEventListener("mousedown",G),D.addEventListener("mouseup",te),D.addEventListener("mouseleave",te),D.addEventListener("mousemove",K)),b.isEditable=!0}},X=()=>{if(f.value){const D=f.value;D.removeEventListener("mousedown",G),D.removeEventListener("mouseup",te),D.removeEventListener("mouseleave",te),D.removeEventListener("mousemove",K),b.isEditable=!1,b.saveImage=b.currentImage}},se=()=>{const D=b.ctx;D&&b.originImg&&(b.index++,b.operateList.push(b.originImg),b.redoList=new Array,D.putImageData(b.originImg,g.x,g.y),W())},ye=()=>{var R;const D=b.operateList.pop();b.redoList.push(D),b.index--,b.redoIcon=qt("redoIcon"),(R=b.ctx)==null||R.putImageData(b.operateList[b.index],g.x,g.y),W()},le=()=>{var R;const D=b.redoList.pop();b.operateList.push(D),b.index++,(R=b.ctx)==null||R.putImageData(D,g.x,g.y),W()};return(D,R)=>(t.openBlock(),t.createElementBlock("div",null,[t.createElementVNode("div",{ref_key:"editorView",ref:m,class:t.normalizeClass(r.value?"image-editor-view image-editor-view-mobile":"image-editor-view image-editor-view-ps"),onClick:A},[t.createElementVNode("div",$k,[t.createElementVNode("img",{class:"image-editor-close_icon",src:oh,onClick:k}),t.createElementVNode("div",{ref_key:"editorBox",ref:y,class:"image-editor-console-box"},[t.createElementVNode("canvas",{class:"image-editor-console",ref_key:"editorDom",ref:f},null,512)],512),t.unref(a).options.markable?(t.openBlock(),t.createElementBlock("div",Fk,[b.isEditable?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",jk,[t.createElementVNode("img",{src:Vk,class:"image-editor-editImg",onClick:q})])),b.isEditable?(t.openBlock(),t.createElementBlock("div",Uk,[t.createElementVNode("div",Wk,[t.withDirectives(t.createElementVNode("input",{class:"image-editor-color",type:"color","onUpdate:modelValue":R[0]||(R[0]=V=>b.color=V)},null,512),[[t.vModelText,b.color]]),t.withDirectives(t.createElementVNode("input",{class:"image-editor-stroke",type:"range",min:"1",max:"15","onUpdate:modelValue":R[1]||(R[1]=V=>b.stroke=V)},null,512),[[t.vModelText,b.stroke]]),t.createElementVNode("img",{class:"image-editor-clear",src:b.clearIcon,onClick:R[2]||(R[2]=V=>b.clearIcon==t.unref(qt)("clearIcon")&&se())},null,8,Hk),t.createElementVNode("img",{class:"image-editor-undo",src:b.undoIcon,onClick:R[3]||(R[3]=V=>b.undoIcon==t.unref(qt)("undoIcon")&&ye())},null,8,Yk),t.createElementVNode("img",{class:"image-editor-redo",src:b.redoIcon,onClick:R[4]||(R[4]=V=>b.redoIcon==t.unref(qt)("redoIcon")&&le())},null,8,Gk)]),t.createElementVNode("div",{class:"right"},[t.createElementVNode("div",{class:"image-editor-comfirm",onClick:X},Kk)])])):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)])],2)]))}}),[["__scopeId","data-v-516516a5"]]),Qk="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='6'%20height='6'%20viewBox='0%200%206%206'%3e%3ccircle%20id='椭圆_711'%20data-name='椭圆%20711'%20cx='3'%20cy='3'%20r='3'%20fill='%23005795'/%3e%3c/svg%3e",ch=e=>(t.pushScopeId("data-v-e8ca6aa0"),e=e(),t.popScopeId(),e),Zk={class:"recommend-diagnoses"},Xk=ch(()=>t.createElementVNode("div",{class:"header"},null,-1)),Jk=ch(()=>t.createElementVNode("div",{class:"recommend-diagnoses-title"},[t.createElementVNode("img",{class:"recommend-diagnoses-title_icon",src:Qk}),t.createElementVNode("span",{class:"recommend-diagnoses-title_text"},"Recommend Diagnoses")],-1)),eM={class:"recommend-diagnoses-list"},tM={class:"recommend-diagnoses-item"},nM={class:"recommend-diagnoses-item-code"},rM={class:"recommend-diagnosis-item-comment"},oM={class:"recommend-diagnoses-confirm"},iM=gi(t.defineComponent({__name:"RecommendDiagnosis",setup(e){t.useCssVars(A=>({"996181f0":E.width,c66cafb6:E.height,"866b89d2":E.top,"470d42f6":E.left}));const r=t.ref(hi()),a=vr().getDocumentTemplate(),l=a.ecos,c=a.info,f=Ms().getRecommendDiagnosis(),m=t.reactive([]),y=t.reactive(f.options.formData),g=t.ref(!1),w=t.ref(null),b=f.cache;let M="";const E=t.reactive({top:"",left:"",width:"",height:""});t.onMounted(async()=>{const B=vr().getDocumentTemplate();B.relatedDom?(E.top=`${B.relatedDom.offsetTop}px`,E.left=`${B.relatedDom.offsetLeft}px`,E.width=`${B.relatedDom.clientWidth}px`,E.height=`${B.relatedDom.clientHeight}px`):(E.top="0",E.left="0",E.width="100vw",E.height="100vh");const W=ha.service({target:B.relatedDom||document.body}),L=y.Diagnosis,G=new Set(L.map(K=>K.code));let H=[];if(b.hasCache)H=b.list;else{const K=await l.retrieveDocument({idList:[c==null?void 0:c.facilityId,...(c==null?void 0:c.locationIds)||[],c==null?void 0:c.patientId],options:{ObjType:28,sfname:'{"result":"D.*", "join": "INNER JOIN Edge E on E.id=D.reid INNER JOIN Edge E2 on E.refid=E2.id"}',xfname:"(E.bvid,E2.Bvid) | (E.evid,E2.Bvid)",scondition:"E.type=40000 AND E.subtype&0xff=6 AND E2.type=40000 AND E2.subtype&0xff in(1,9) AND D.type=186881",asc:!1,obfname:"D.ctime",maxcount:100}});if(K.code===0){let q=[];K.document.forEach(X=>{const se=X.name.data.diagnosis.descriptiveList;q=q.concat(se)}),b.hasCache=!0,b.list=Rn.cloneDeep(q),H=q}else b.hasCache=!0,b.list=[],H=[]}H.forEach(K=>{G.has(K.code)?K.isChecked=!0:K.isChecked=!1});let te=new Set;H=H.filter(K=>te.has(K.code)?!1:(te.add(K.code),!0)),H.forEach(K=>{K.isChecked?M+="1":M+="0",m.push(K)}),W.close()}),t.watch(m,()=>{let A="";m.forEach(B=>{B.isChecked?A+="1":A+="0"}),g.value=M!==A});const S=()=>{f.close()},N=A=>{A.target===w.value&&f.close()},k=async()=>{a.data.value.Diagnosis.push(m.map(A=>({code:A.code,description:A.description,comment:A.comment})))};return(A,B)=>{const W=sp,L=br;return t.openBlock(),t.createElementBlock("div",{ref_key:"diagnosisView",ref:w,class:t.normalizeClass(r.value?"recommend-diagnoses-view recommend-diagnoses-mobile":"recommend-diagnoses-view"),onClick:N},[t.createElementVNode("div",Zk,[Xk,t.createElementVNode("div",{class:"recommend-diagnoses-close"},[t.createElementVNode("img",{class:"recommend-diagnoses-close_icon",src:lh,onClick:S})]),Jk,t.createElementVNode("div",eM,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m,G=>(t.openBlock(),t.createElementBlock("div",tM,[t.createElementVNode("div",nM,[t.createVNode(W,{modelValue:G.isChecked,"onUpdate:modelValue":H=>G.isChecked=H},null,8,["modelValue","onUpdate:modelValue"]),t.createTextVNode(" "+t.toDisplayString(G.code)+" - "+t.toDisplayString(G.description),1)]),t.createElementVNode("div",rM,t.toDisplayString(G.comment),1)]))),256))]),t.createElementVNode("div",oM,[t.createVNode(L,{class:t.normalizeClass(`
|
|
79
|
+
*/(function(e){const r=ka,o=ql,a=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=f,e.SlowBuffer=A,e.INSPECT_MAX_BYTES=50;const l=2147483647;e.kMaxLength=l,f.TYPED_ARRAY_SUPPORT=c(),!f.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function c(){try{const x=new Uint8Array(1),p={foo:function(){return 42}};return Object.setPrototypeOf(p,Uint8Array.prototype),Object.setPrototypeOf(x,p),x.foo()===42}catch{return!1}}Object.defineProperty(f.prototype,"parent",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.buffer}}),Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.byteOffset}});function u(x){if(x>l)throw new RangeError('The value "'+x+'" is invalid for option "size"');const p=new Uint8Array(x);return Object.setPrototypeOf(p,f.prototype),p}function f(x,p,h){if(typeof x=="number"){if(typeof p=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return w(x)}return m(x,p,h)}f.poolSize=8192;function m(x,p,h){if(typeof x=="string")return b(x,p);if(ArrayBuffer.isView(x))return E(x);if(x==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof x);if(it(x,ArrayBuffer)||x&&it(x.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(it(x,SharedArrayBuffer)||x&&it(x.buffer,SharedArrayBuffer)))return S(x,p,h);if(typeof x=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const T=x.valueOf&&x.valueOf();if(T!=null&&T!==x)return f.from(T,p,h);const z=N(x);if(z)return z;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof x[Symbol.toPrimitive]=="function")return f.from(x[Symbol.toPrimitive]("string"),p,h);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof x)}f.from=function(x,p,h){return m(x,p,h)},Object.setPrototypeOf(f.prototype,Uint8Array.prototype),Object.setPrototypeOf(f,Uint8Array);function y(x){if(typeof x!="number")throw new TypeError('"size" argument must be of type number');if(x<0)throw new RangeError('The value "'+x+'" is invalid for option "size"')}function g(x,p,h){return y(x),x<=0?u(x):p!==void 0?typeof h=="string"?u(x).fill(p,h):u(x).fill(p):u(x)}f.alloc=function(x,p,h){return g(x,p,h)};function w(x){return y(x),u(x<0?0:k(x)|0)}f.allocUnsafe=function(x){return w(x)},f.allocUnsafeSlow=function(x){return w(x)};function b(x,p){if((typeof p!="string"||p==="")&&(p="utf8"),!f.isEncoding(p))throw new TypeError("Unknown encoding: "+p);const h=B(x,p)|0;let T=u(h);const z=T.write(x,p);return z!==h&&(T=T.slice(0,z)),T}function M(x){const p=x.length<0?0:k(x.length)|0,h=u(p);for(let T=0;T<p;T+=1)h[T]=x[T]&255;return h}function E(x){if(it(x,Uint8Array)){const p=new Uint8Array(x);return S(p.buffer,p.byteOffset,p.byteLength)}return M(x)}function S(x,p,h){if(p<0||x.byteLength<p)throw new RangeError('"offset" is outside of buffer bounds');if(x.byteLength<p+(h||0))throw new RangeError('"length" is outside of buffer bounds');let T;return p===void 0&&h===void 0?T=new Uint8Array(x):h===void 0?T=new Uint8Array(x,p):T=new Uint8Array(x,p,h),Object.setPrototypeOf(T,f.prototype),T}function N(x){if(f.isBuffer(x)){const p=k(x.length)|0,h=u(p);return h.length===0||x.copy(h,0,0,p),h}if(x.length!==void 0)return typeof x.length!="number"||Lt(x.length)?u(0):M(x);if(x.type==="Buffer"&&Array.isArray(x.data))return M(x.data)}function k(x){if(x>=l)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+l.toString(16)+" bytes");return x|0}function A(x){return+x!=x&&(x=0),f.alloc(+x)}f.isBuffer=function(p){return p!=null&&p._isBuffer===!0&&p!==f.prototype},f.compare=function(p,h){if(it(p,Uint8Array)&&(p=f.from(p,p.offset,p.byteLength)),it(h,Uint8Array)&&(h=f.from(h,h.offset,h.byteLength)),!f.isBuffer(p)||!f.isBuffer(h))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(p===h)return 0;let T=p.length,z=h.length;for(let U=0,ee=Math.min(T,z);U<ee;++U)if(p[U]!==h[U]){T=p[U],z=h[U];break}return T<z?-1:z<T?1:0},f.isEncoding=function(p){switch(String(p).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(p,h){if(!Array.isArray(p))throw new TypeError('"list" argument must be an Array of Buffers');if(p.length===0)return f.alloc(0);let T;if(h===void 0)for(h=0,T=0;T<p.length;++T)h+=p[T].length;const z=f.allocUnsafe(h);let U=0;for(T=0;T<p.length;++T){let ee=p[T];if(it(ee,Uint8Array))U+ee.length>z.length?(f.isBuffer(ee)||(ee=f.from(ee)),ee.copy(z,U)):Uint8Array.prototype.set.call(z,ee,U);else if(f.isBuffer(ee))ee.copy(z,U);else throw new TypeError('"list" argument must be an Array of Buffers');U+=ee.length}return z};function B(x,p){if(f.isBuffer(x))return x.length;if(ArrayBuffer.isView(x)||it(x,ArrayBuffer))return x.byteLength;if(typeof x!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof x);const h=x.length,T=arguments.length>2&&arguments[2]===!0;if(!T&&h===0)return 0;let z=!1;for(;;)switch(p){case"ascii":case"latin1":case"binary":return h;case"utf8":case"utf-8":return j(x).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h*2;case"hex":return h>>>1;case"base64":return Ke(x).length;default:if(z)return T?-1:j(x).length;p=(""+p).toLowerCase(),z=!0}}f.byteLength=B;function W(x,p,h){let T=!1;if((p===void 0||p<0)&&(p=0),p>this.length||((h===void 0||h>this.length)&&(h=this.length),h<=0)||(h>>>=0,p>>>=0,h<=p))return"";for(x||(x="utf8");;)switch(x){case"hex":return ie(this,p,h);case"utf8":case"utf-8":return le(this,p,h);case"ascii":return V(this,p,h);case"latin1":case"binary":return F(this,p,h);case"base64":return ye(this,p,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ue(this,p,h);default:if(T)throw new TypeError("Unknown encoding: "+x);x=(x+"").toLowerCase(),T=!0}}f.prototype._isBuffer=!0;function L(x,p,h){const T=x[p];x[p]=x[h],x[h]=T}f.prototype.swap16=function(){const p=this.length;if(p%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let h=0;h<p;h+=2)L(this,h,h+1);return this},f.prototype.swap32=function(){const p=this.length;if(p%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let h=0;h<p;h+=4)L(this,h,h+3),L(this,h+1,h+2);return this},f.prototype.swap64=function(){const p=this.length;if(p%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let h=0;h<p;h+=8)L(this,h,h+7),L(this,h+1,h+6),L(this,h+2,h+5),L(this,h+3,h+4);return this},f.prototype.toString=function(){const p=this.length;return p===0?"":arguments.length===0?le(this,0,p):W.apply(this,arguments)},f.prototype.toLocaleString=f.prototype.toString,f.prototype.equals=function(p){if(!f.isBuffer(p))throw new TypeError("Argument must be a Buffer");return this===p?!0:f.compare(this,p)===0},f.prototype.inspect=function(){let p="";const h=e.INSPECT_MAX_BYTES;return p=this.toString("hex",0,h).replace(/(.{2})/g,"$1 ").trim(),this.length>h&&(p+=" ... "),"<Buffer "+p+">"},a&&(f.prototype[a]=f.prototype.inspect),f.prototype.compare=function(p,h,T,z,U){if(it(p,Uint8Array)&&(p=f.from(p,p.offset,p.byteLength)),!f.isBuffer(p))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof p);if(h===void 0&&(h=0),T===void 0&&(T=p?p.length:0),z===void 0&&(z=0),U===void 0&&(U=this.length),h<0||T>p.length||z<0||U>this.length)throw new RangeError("out of range index");if(z>=U&&h>=T)return 0;if(z>=U)return-1;if(h>=T)return 1;if(h>>>=0,T>>>=0,z>>>=0,U>>>=0,this===p)return 0;let ee=U-z,ve=T-h;const nt=Math.min(ee,ve),Xe=this.slice(z,U),rt=p.slice(h,T);for(let qe=0;qe<nt;++qe)if(Xe[qe]!==rt[qe]){ee=Xe[qe],ve=rt[qe];break}return ee<ve?-1:ve<ee?1:0};function G(x,p,h,T,z){if(x.length===0)return-1;if(typeof h=="string"?(T=h,h=0):h>2147483647?h=2147483647:h<-2147483648&&(h=-2147483648),h=+h,Lt(h)&&(h=z?0:x.length-1),h<0&&(h=x.length+h),h>=x.length){if(z)return-1;h=x.length-1}else if(h<0)if(z)h=0;else return-1;if(typeof p=="string"&&(p=f.from(p,T)),f.isBuffer(p))return p.length===0?-1:H(x,p,h,T,z);if(typeof p=="number")return p=p&255,typeof Uint8Array.prototype.indexOf=="function"?z?Uint8Array.prototype.indexOf.call(x,p,h):Uint8Array.prototype.lastIndexOf.call(x,p,h):H(x,[p],h,T,z);throw new TypeError("val must be string, number or Buffer")}function H(x,p,h,T,z){let U=1,ee=x.length,ve=p.length;if(T!==void 0&&(T=String(T).toLowerCase(),T==="ucs2"||T==="ucs-2"||T==="utf16le"||T==="utf-16le")){if(x.length<2||p.length<2)return-1;U=2,ee/=2,ve/=2,h/=2}function nt(rt,qe){return U===1?rt[qe]:rt.readUInt16BE(qe*U)}let Xe;if(z){let rt=-1;for(Xe=h;Xe<ee;Xe++)if(nt(x,Xe)===nt(p,rt===-1?0:Xe-rt)){if(rt===-1&&(rt=Xe),Xe-rt+1===ve)return rt*U}else rt!==-1&&(Xe-=Xe-rt),rt=-1}else for(h+ve>ee&&(h=ee-ve),Xe=h;Xe>=0;Xe--){let rt=!0;for(let qe=0;qe<ve;qe++)if(nt(x,Xe+qe)!==nt(p,qe)){rt=!1;break}if(rt)return Xe}return-1}f.prototype.includes=function(p,h,T){return this.indexOf(p,h,T)!==-1},f.prototype.indexOf=function(p,h,T){return G(this,p,h,T,!0)},f.prototype.lastIndexOf=function(p,h,T){return G(this,p,h,T,!1)};function te(x,p,h,T){h=Number(h)||0;const z=x.length-h;T?(T=Number(T),T>z&&(T=z)):T=z;const U=p.length;T>U/2&&(T=U/2);let ee;for(ee=0;ee<T;++ee){const ve=parseInt(p.substr(ee*2,2),16);if(Lt(ve))return ee;x[h+ee]=ve}return ee}function K(x,p,h,T){return Ue(j(p,x.length-h),x,h,T)}function q(x,p,h,T){return Ue(fe(p),x,h,T)}function X(x,p,h,T){return Ue(Ke(p),x,h,T)}function se(x,p,h,T){return Ue(Ye(p,x.length-h),x,h,T)}f.prototype.write=function(p,h,T,z){if(h===void 0)z="utf8",T=this.length,h=0;else if(T===void 0&&typeof h=="string")z=h,T=this.length,h=0;else if(isFinite(h))h=h>>>0,isFinite(T)?(T=T>>>0,z===void 0&&(z="utf8")):(z=T,T=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const U=this.length-h;if((T===void 0||T>U)&&(T=U),p.length>0&&(T<0||h<0)||h>this.length)throw new RangeError("Attempt to write outside buffer bounds");z||(z="utf8");let ee=!1;for(;;)switch(z){case"hex":return te(this,p,h,T);case"utf8":case"utf-8":return K(this,p,h,T);case"ascii":case"latin1":case"binary":return q(this,p,h,T);case"base64":return X(this,p,h,T);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return se(this,p,h,T);default:if(ee)throw new TypeError("Unknown encoding: "+z);z=(""+z).toLowerCase(),ee=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ye(x,p,h){return p===0&&h===x.length?r.fromByteArray(x):r.fromByteArray(x.slice(p,h))}function le(x,p,h){h=Math.min(x.length,h);const T=[];let z=p;for(;z<h;){const U=x[z];let ee=null,ve=U>239?4:U>223?3:U>191?2:1;if(z+ve<=h){let nt,Xe,rt,qe;switch(ve){case 1:U<128&&(ee=U);break;case 2:nt=x[z+1],(nt&192)===128&&(qe=(U&31)<<6|nt&63,qe>127&&(ee=qe));break;case 3:nt=x[z+1],Xe=x[z+2],(nt&192)===128&&(Xe&192)===128&&(qe=(U&15)<<12|(nt&63)<<6|Xe&63,qe>2047&&(qe<55296||qe>57343)&&(ee=qe));break;case 4:nt=x[z+1],Xe=x[z+2],rt=x[z+3],(nt&192)===128&&(Xe&192)===128&&(rt&192)===128&&(qe=(U&15)<<18|(nt&63)<<12|(Xe&63)<<6|rt&63,qe>65535&&qe<1114112&&(ee=qe))}}ee===null?(ee=65533,ve=1):ee>65535&&(ee-=65536,T.push(ee>>>10&1023|55296),ee=56320|ee&1023),T.push(ee),z+=ve}return R(T)}const D=4096;function R(x){const p=x.length;if(p<=D)return String.fromCharCode.apply(String,x);let h="",T=0;for(;T<p;)h+=String.fromCharCode.apply(String,x.slice(T,T+=D));return h}function V(x,p,h){let T="";h=Math.min(x.length,h);for(let z=p;z<h;++z)T+=String.fromCharCode(x[z]&127);return T}function F(x,p,h){let T="";h=Math.min(x.length,h);for(let z=p;z<h;++z)T+=String.fromCharCode(x[z]);return T}function ie(x,p,h){const T=x.length;(!p||p<0)&&(p=0),(!h||h<0||h>T)&&(h=T);let z="";for(let U=p;U<h;++U)z+=Qt[x[U]];return z}function ue(x,p,h){const T=x.slice(p,h);let z="";for(let U=0;U<T.length-1;U+=2)z+=String.fromCharCode(T[U]+T[U+1]*256);return z}f.prototype.slice=function(p,h){const T=this.length;p=~~p,h=h===void 0?T:~~h,p<0?(p+=T,p<0&&(p=0)):p>T&&(p=T),h<0?(h+=T,h<0&&(h=0)):h>T&&(h=T),h<p&&(h=p);const z=this.subarray(p,h);return Object.setPrototypeOf(z,f.prototype),z};function de(x,p,h){if(x%1!==0||x<0)throw new RangeError("offset is not uint");if(x+p>h)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUintLE=f.prototype.readUIntLE=function(p,h,T){p=p>>>0,h=h>>>0,T||de(p,h,this.length);let z=this[p],U=1,ee=0;for(;++ee<h&&(U*=256);)z+=this[p+ee]*U;return z},f.prototype.readUintBE=f.prototype.readUIntBE=function(p,h,T){p=p>>>0,h=h>>>0,T||de(p,h,this.length);let z=this[p+--h],U=1;for(;h>0&&(U*=256);)z+=this[p+--h]*U;return z},f.prototype.readUint8=f.prototype.readUInt8=function(p,h){return p=p>>>0,h||de(p,1,this.length),this[p]},f.prototype.readUint16LE=f.prototype.readUInt16LE=function(p,h){return p=p>>>0,h||de(p,2,this.length),this[p]|this[p+1]<<8},f.prototype.readUint16BE=f.prototype.readUInt16BE=function(p,h){return p=p>>>0,h||de(p,2,this.length),this[p]<<8|this[p+1]},f.prototype.readUint32LE=f.prototype.readUInt32LE=function(p,h){return p=p>>>0,h||de(p,4,this.length),(this[p]|this[p+1]<<8|this[p+2]<<16)+this[p+3]*16777216},f.prototype.readUint32BE=f.prototype.readUInt32BE=function(p,h){return p=p>>>0,h||de(p,4,this.length),this[p]*16777216+(this[p+1]<<16|this[p+2]<<8|this[p+3])},f.prototype.readBigUInt64LE=oe(function(p){p=p>>>0,Pe(p,"offset");const h=this[p],T=this[p+7];(h===void 0||T===void 0)&&ot(p,this.length-8);const z=h+this[++p]*2**8+this[++p]*2**16+this[++p]*2**24,U=this[++p]+this[++p]*2**8+this[++p]*2**16+T*2**24;return BigInt(z)+(BigInt(U)<<BigInt(32))}),f.prototype.readBigUInt64BE=oe(function(p){p=p>>>0,Pe(p,"offset");const h=this[p],T=this[p+7];(h===void 0||T===void 0)&&ot(p,this.length-8);const z=h*2**24+this[++p]*2**16+this[++p]*2**8+this[++p],U=this[++p]*2**24+this[++p]*2**16+this[++p]*2**8+T;return(BigInt(z)<<BigInt(32))+BigInt(U)}),f.prototype.readIntLE=function(p,h,T){p=p>>>0,h=h>>>0,T||de(p,h,this.length);let z=this[p],U=1,ee=0;for(;++ee<h&&(U*=256);)z+=this[p+ee]*U;return U*=128,z>=U&&(z-=Math.pow(2,8*h)),z},f.prototype.readIntBE=function(p,h,T){p=p>>>0,h=h>>>0,T||de(p,h,this.length);let z=h,U=1,ee=this[p+--z];for(;z>0&&(U*=256);)ee+=this[p+--z]*U;return U*=128,ee>=U&&(ee-=Math.pow(2,8*h)),ee},f.prototype.readInt8=function(p,h){return p=p>>>0,h||de(p,1,this.length),this[p]&128?(255-this[p]+1)*-1:this[p]},f.prototype.readInt16LE=function(p,h){p=p>>>0,h||de(p,2,this.length);const T=this[p]|this[p+1]<<8;return T&32768?T|4294901760:T},f.prototype.readInt16BE=function(p,h){p=p>>>0,h||de(p,2,this.length);const T=this[p+1]|this[p]<<8;return T&32768?T|4294901760:T},f.prototype.readInt32LE=function(p,h){return p=p>>>0,h||de(p,4,this.length),this[p]|this[p+1]<<8|this[p+2]<<16|this[p+3]<<24},f.prototype.readInt32BE=function(p,h){return p=p>>>0,h||de(p,4,this.length),this[p]<<24|this[p+1]<<16|this[p+2]<<8|this[p+3]},f.prototype.readBigInt64LE=oe(function(p){p=p>>>0,Pe(p,"offset");const h=this[p],T=this[p+7];(h===void 0||T===void 0)&&ot(p,this.length-8);const z=this[p+4]+this[p+5]*2**8+this[p+6]*2**16+(T<<24);return(BigInt(z)<<BigInt(32))+BigInt(h+this[++p]*2**8+this[++p]*2**16+this[++p]*2**24)}),f.prototype.readBigInt64BE=oe(function(p){p=p>>>0,Pe(p,"offset");const h=this[p],T=this[p+7];(h===void 0||T===void 0)&&ot(p,this.length-8);const z=(h<<24)+this[++p]*2**16+this[++p]*2**8+this[++p];return(BigInt(z)<<BigInt(32))+BigInt(this[++p]*2**24+this[++p]*2**16+this[++p]*2**8+T)}),f.prototype.readFloatLE=function(p,h){return p=p>>>0,h||de(p,4,this.length),o.read(this,p,!0,23,4)},f.prototype.readFloatBE=function(p,h){return p=p>>>0,h||de(p,4,this.length),o.read(this,p,!1,23,4)},f.prototype.readDoubleLE=function(p,h){return p=p>>>0,h||de(p,8,this.length),o.read(this,p,!0,52,8)},f.prototype.readDoubleBE=function(p,h){return p=p>>>0,h||de(p,8,this.length),o.read(this,p,!1,52,8)};function ge(x,p,h,T,z,U){if(!f.isBuffer(x))throw new TypeError('"buffer" argument must be a Buffer instance');if(p>z||p<U)throw new RangeError('"value" argument is out of bounds');if(h+T>x.length)throw new RangeError("Index out of range")}f.prototype.writeUintLE=f.prototype.writeUIntLE=function(p,h,T,z){if(p=+p,h=h>>>0,T=T>>>0,!z){const ve=Math.pow(2,8*T)-1;ge(this,p,h,T,ve,0)}let U=1,ee=0;for(this[h]=p&255;++ee<T&&(U*=256);)this[h+ee]=p/U&255;return h+T},f.prototype.writeUintBE=f.prototype.writeUIntBE=function(p,h,T,z){if(p=+p,h=h>>>0,T=T>>>0,!z){const ve=Math.pow(2,8*T)-1;ge(this,p,h,T,ve,0)}let U=T-1,ee=1;for(this[h+U]=p&255;--U>=0&&(ee*=256);)this[h+U]=p/ee&255;return h+T},f.prototype.writeUint8=f.prototype.writeUInt8=function(p,h,T){return p=+p,h=h>>>0,T||ge(this,p,h,1,255,0),this[h]=p&255,h+1},f.prototype.writeUint16LE=f.prototype.writeUInt16LE=function(p,h,T){return p=+p,h=h>>>0,T||ge(this,p,h,2,65535,0),this[h]=p&255,this[h+1]=p>>>8,h+2},f.prototype.writeUint16BE=f.prototype.writeUInt16BE=function(p,h,T){return p=+p,h=h>>>0,T||ge(this,p,h,2,65535,0),this[h]=p>>>8,this[h+1]=p&255,h+2},f.prototype.writeUint32LE=f.prototype.writeUInt32LE=function(p,h,T){return p=+p,h=h>>>0,T||ge(this,p,h,4,4294967295,0),this[h+3]=p>>>24,this[h+2]=p>>>16,this[h+1]=p>>>8,this[h]=p&255,h+4},f.prototype.writeUint32BE=f.prototype.writeUInt32BE=function(p,h,T){return p=+p,h=h>>>0,T||ge(this,p,h,4,4294967295,0),this[h]=p>>>24,this[h+1]=p>>>16,this[h+2]=p>>>8,this[h+3]=p&255,h+4};function Ie(x,p,h,T,z){We(p,T,z,x,h,7);let U=Number(p&BigInt(4294967295));x[h++]=U,U=U>>8,x[h++]=U,U=U>>8,x[h++]=U,U=U>>8,x[h++]=U;let ee=Number(p>>BigInt(32)&BigInt(4294967295));return x[h++]=ee,ee=ee>>8,x[h++]=ee,ee=ee>>8,x[h++]=ee,ee=ee>>8,x[h++]=ee,h}function Se(x,p,h,T,z){We(p,T,z,x,h,7);let U=Number(p&BigInt(4294967295));x[h+7]=U,U=U>>8,x[h+6]=U,U=U>>8,x[h+5]=U,U=U>>8,x[h+4]=U;let ee=Number(p>>BigInt(32)&BigInt(4294967295));return x[h+3]=ee,ee=ee>>8,x[h+2]=ee,ee=ee>>8,x[h+1]=ee,ee=ee>>8,x[h]=ee,h+8}f.prototype.writeBigUInt64LE=oe(function(p,h=0){return Ie(this,p,h,BigInt(0),BigInt("0xffffffffffffffff"))}),f.prototype.writeBigUInt64BE=oe(function(p,h=0){return Se(this,p,h,BigInt(0),BigInt("0xffffffffffffffff"))}),f.prototype.writeIntLE=function(p,h,T,z){if(p=+p,h=h>>>0,!z){const nt=Math.pow(2,8*T-1);ge(this,p,h,T,nt-1,-nt)}let U=0,ee=1,ve=0;for(this[h]=p&255;++U<T&&(ee*=256);)p<0&&ve===0&&this[h+U-1]!==0&&(ve=1),this[h+U]=(p/ee>>0)-ve&255;return h+T},f.prototype.writeIntBE=function(p,h,T,z){if(p=+p,h=h>>>0,!z){const nt=Math.pow(2,8*T-1);ge(this,p,h,T,nt-1,-nt)}let U=T-1,ee=1,ve=0;for(this[h+U]=p&255;--U>=0&&(ee*=256);)p<0&&ve===0&&this[h+U+1]!==0&&(ve=1),this[h+U]=(p/ee>>0)-ve&255;return h+T},f.prototype.writeInt8=function(p,h,T){return p=+p,h=h>>>0,T||ge(this,p,h,1,127,-128),p<0&&(p=255+p+1),this[h]=p&255,h+1},f.prototype.writeInt16LE=function(p,h,T){return p=+p,h=h>>>0,T||ge(this,p,h,2,32767,-32768),this[h]=p&255,this[h+1]=p>>>8,h+2},f.prototype.writeInt16BE=function(p,h,T){return p=+p,h=h>>>0,T||ge(this,p,h,2,32767,-32768),this[h]=p>>>8,this[h+1]=p&255,h+2},f.prototype.writeInt32LE=function(p,h,T){return p=+p,h=h>>>0,T||ge(this,p,h,4,2147483647,-2147483648),this[h]=p&255,this[h+1]=p>>>8,this[h+2]=p>>>16,this[h+3]=p>>>24,h+4},f.prototype.writeInt32BE=function(p,h,T){return p=+p,h=h>>>0,T||ge(this,p,h,4,2147483647,-2147483648),p<0&&(p=4294967295+p+1),this[h]=p>>>24,this[h+1]=p>>>16,this[h+2]=p>>>8,this[h+3]=p&255,h+4},f.prototype.writeBigInt64LE=oe(function(p,h=0){return Ie(this,p,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),f.prototype.writeBigInt64BE=oe(function(p,h=0){return Se(this,p,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Te(x,p,h,T,z,U){if(h+T>x.length)throw new RangeError("Index out of range");if(h<0)throw new RangeError("Index out of range")}function pe(x,p,h,T,z){return p=+p,h=h>>>0,z||Te(x,p,h,4),o.write(x,p,h,T,23,4),h+4}f.prototype.writeFloatLE=function(p,h,T){return pe(this,p,h,!0,T)},f.prototype.writeFloatBE=function(p,h,T){return pe(this,p,h,!1,T)};function ae(x,p,h,T,z){return p=+p,h=h>>>0,z||Te(x,p,h,8),o.write(x,p,h,T,52,8),h+8}f.prototype.writeDoubleLE=function(p,h,T){return ae(this,p,h,!0,T)},f.prototype.writeDoubleBE=function(p,h,T){return ae(this,p,h,!1,T)},f.prototype.copy=function(p,h,T,z){if(!f.isBuffer(p))throw new TypeError("argument should be a Buffer");if(T||(T=0),!z&&z!==0&&(z=this.length),h>=p.length&&(h=p.length),h||(h=0),z>0&&z<T&&(z=T),z===T||p.length===0||this.length===0)return 0;if(h<0)throw new RangeError("targetStart out of bounds");if(T<0||T>=this.length)throw new RangeError("Index out of range");if(z<0)throw new RangeError("sourceEnd out of bounds");z>this.length&&(z=this.length),p.length-h<z-T&&(z=p.length-h+T);const U=z-T;return this===p&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(h,T,z):Uint8Array.prototype.set.call(p,this.subarray(T,z),h),U},f.prototype.fill=function(p,h,T,z){if(typeof p=="string"){if(typeof h=="string"?(z=h,h=0,T=this.length):typeof T=="string"&&(z=T,T=this.length),z!==void 0&&typeof z!="string")throw new TypeError("encoding must be a string");if(typeof z=="string"&&!f.isEncoding(z))throw new TypeError("Unknown encoding: "+z);if(p.length===1){const ee=p.charCodeAt(0);(z==="utf8"&&ee<128||z==="latin1")&&(p=ee)}}else typeof p=="number"?p=p&255:typeof p=="boolean"&&(p=Number(p));if(h<0||this.length<h||this.length<T)throw new RangeError("Out of range index");if(T<=h)return this;h=h>>>0,T=T===void 0?this.length:T>>>0,p||(p=0);let U;if(typeof p=="number")for(U=h;U<T;++U)this[U]=p;else{const ee=f.isBuffer(p)?p:f.from(p,z),ve=ee.length;if(ve===0)throw new TypeError('The value "'+p+'" is invalid for argument "value"');for(U=0;U<T-h;++U)this[U+h]=ee[U%ve]}return this};const he={};function Ce(x,p,h){he[x]=class extends h{constructor(){super(),Object.defineProperty(this,"message",{value:p.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${x}]`,this.stack,delete this.name}get code(){return x}set code(z){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:z,writable:!0})}toString(){return`${this.name} [${x}]: ${this.message}`}}}Ce("ERR_BUFFER_OUT_OF_BOUNDS",function(x){return x?`${x} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Ce("ERR_INVALID_ARG_TYPE",function(x,p){return`The "${x}" argument must be of type number. Received type ${typeof p}`},TypeError),Ce("ERR_OUT_OF_RANGE",function(x,p,h){let T=`The value of "${x}" is out of range.`,z=h;return Number.isInteger(h)&&Math.abs(h)>2**32?z=xe(String(h)):typeof h=="bigint"&&(z=String(h),(h>BigInt(2)**BigInt(32)||h<-(BigInt(2)**BigInt(32)))&&(z=xe(z)),z+="n"),T+=` It must be ${p}. Received ${z}`,T},RangeError);function xe(x){let p="",h=x.length;const T=x[0]==="-"?1:0;for(;h>=T+4;h-=3)p=`_${x.slice(h-3,h)}${p}`;return`${x.slice(0,h)}${p}`}function Le(x,p,h){Pe(p,"offset"),(x[p]===void 0||x[p+h]===void 0)&&ot(p,x.length-(h+1))}function We(x,p,h,T,z,U){if(x>h||x<p){const ee=typeof p=="bigint"?"n":"";let ve;throw p===0||p===BigInt(0)?ve=`>= 0${ee} and < 2${ee} ** ${(U+1)*8}${ee}`:ve=`>= -(2${ee} ** ${(U+1)*8-1}${ee}) and < 2 ** ${(U+1)*8-1}${ee}`,new he.ERR_OUT_OF_RANGE("value",ve,x)}Le(T,z,U)}function Pe(x,p){if(typeof x!="number")throw new he.ERR_INVALID_ARG_TYPE(p,"number",x)}function ot(x,p,h){throw Math.floor(x)!==x?(Pe(x,h),new he.ERR_OUT_OF_RANGE("offset","an integer",x)):p<0?new he.ERR_BUFFER_OUT_OF_BOUNDS:new he.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${p}`,x)}const St=/[^+/0-9A-Za-z-_]/g;function yt(x){if(x=x.split("=")[0],x=x.trim().replace(St,""),x.length<2)return"";for(;x.length%4!==0;)x=x+"=";return x}function j(x,p){p=p||1/0;let h;const T=x.length;let z=null;const U=[];for(let ee=0;ee<T;++ee){if(h=x.charCodeAt(ee),h>55295&&h<57344){if(!z){if(h>56319){(p-=3)>-1&&U.push(239,191,189);continue}else if(ee+1===T){(p-=3)>-1&&U.push(239,191,189);continue}z=h;continue}if(h<56320){(p-=3)>-1&&U.push(239,191,189),z=h;continue}h=(z-55296<<10|h-56320)+65536}else z&&(p-=3)>-1&&U.push(239,191,189);if(z=null,h<128){if((p-=1)<0)break;U.push(h)}else if(h<2048){if((p-=2)<0)break;U.push(h>>6|192,h&63|128)}else if(h<65536){if((p-=3)<0)break;U.push(h>>12|224,h>>6&63|128,h&63|128)}else if(h<1114112){if((p-=4)<0)break;U.push(h>>18|240,h>>12&63|128,h>>6&63|128,h&63|128)}else throw new Error("Invalid code point")}return U}function fe(x){const p=[];for(let h=0;h<x.length;++h)p.push(x.charCodeAt(h)&255);return p}function Ye(x,p){let h,T,z;const U=[];for(let ee=0;ee<x.length&&!((p-=2)<0);++ee)h=x.charCodeAt(ee),T=h>>8,z=h%256,U.push(z),U.push(T);return U}function Ke(x){return r.toByteArray(yt(x))}function Ue(x,p,h,T){let z;for(z=0;z<T&&!(z+h>=p.length||z>=x.length);++z)p[z+h]=x[z];return z}function it(x,p){return x instanceof p||x!=null&&x.constructor!=null&&x.constructor.name!=null&&x.constructor.name===p.name}function Lt(x){return x!==x}const Qt=function(){const x="0123456789abcdef",p=new Array(256);for(let h=0;h<16;++h){const T=h*16;for(let z=0;z<16;++z)p[T+z]=x[h]+x[z]}return p}();function oe(x){return typeof BigInt>"u"?Ae:x}function Ae(){throw new Error("BigInt not supported")}})(ih);const kk=e=>{const r=atob(e),o=r.length,a=new Uint8Array(o);for(let l=0;l<o;l++)a[l]=r.charCodeAt(l);return a},Mk=({type:e,data:r})=>`data:${e};base64,${r}`,Ak=e=>kk(e),sh=(e,r)=>{const o=Ak(e),a=ih.Buffer.from(o.buffer);return new Blob([a.buffer],{type:r})},lh="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16.828'%20height='16.828'%20viewBox='0%200%2016.828%2016.828'%3e%3cg%20id='组_10025'%20data-name='组%2010025'%20transform='translate(0.914%201.414)'%3e%3cline%20id='直线_1370'%20data-name='直线%201370'%20x2='14'%20y2='14'%20transform='translate(0.5)'%20fill='none'%20stroke='%23c1c1c1'%20stroke-linecap='round'%20stroke-width='2'/%3e%3cline%20id='直线_1371'%20data-name='直线%201371'%20x1='14'%20y2='14'%20transform='translate(0.5)'%20fill='none'%20stroke='%23c1c1c1'%20stroke-linecap='round'%20stroke-width='2'/%3e%3c/g%3e%3c/svg%3e",Tk="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%3e%3cg%20id='组_11460'%20data-name='组%2011460'%20transform='translate(-1070%20-577)'%3e%3cpath%20id='路径_9629'%20data-name='路径%209629'%20d='M8,14.625A6.625,6.625,0,1,0,1.375,8,6.625,6.625,0,0,0,8,14.625ZM8,16a8,8,0,1,1,8-8A8,8,0,0,1,8,16Z'%20transform='translate(1070%20577)'%20fill='%23999'/%3e%3cpath%20id='路径_9630'%20data-name='路径%209630'%20d='M449.688,212.688a.687.687,0,1,0-1.375,0v5.3a.687.687,0,1,0,1.375,0ZM449,219.375a1,1,0,1,0,1,1A1,1,0,0,0,449,219.375Z'%20transform='translate(629%20368.313)'%20fill='%23999'/%3e%3c/g%3e%3c/svg%3e",Ma=e=>(t.pushScopeId("data-v-50a3cf13"),e=e(),t.popScopeId(),e),Nk={class:"signature_box"},vk=Ma(()=>t.createElementVNode("div",{class:"signature_tilte"},"Signature",-1)),Bk=Ma(()=>t.createElementVNode("div",{class:"subtitle"},"Click on the signature box below to finger sign",-1)),Dk=Ma(()=>t.createElementVNode("div",{class:"label"},"X",-1)),Lk=Ma(()=>t.createElementVNode("div",{class:"signature_tips"},[t.createElementVNode("img",{class:"signature_icon",src:Tk}),t.createElementVNode("div",{class:"tips"},"The signature is saved for later use.")],-1)),Ok={class:"signature_operate"},Rk=gi(t.defineComponent({__name:"SignaturePad",setup(e){t.useCssVars(K=>({"68ae9541":te.width,d955cde8:te.height,"4c4bcb90":te.top,"3d29dd2c":te.left}));const r=t.ref(hi()),a=vr().getDocumentTemplate(),l=t.ref(null),c=t.ref(null),u=t.ref(null),m=Is().getSignaturePad(),y=m.confirm,g=t.reactive({status:!1,ctx:null,originSignature:"",saveSignature:"",points:new Array,beginPoint:null}),w=t.reactive({x:0,y:0}),b=K=>{let[q,X]=[K.offsetLeft,K.offsetTop];const se=ye=>{X+=ye.offsetTop,q+=ye.offsetLeft,ye.offsetParent&&se(ye.offsetParent)};return K.offsetParent&&se(K.offsetParent),{left:q,top:X}},M=K=>{let{left:q,top:X}=K.getBoundingClientRect();return{left:q,top:X}},E=K=>{const q=document.createElement("canvas");q.width=K.width,q.height=K.height;const X=q.getContext("2d");return X==null||X.putImageData(K,0,0),q.toDataURL().split(",")[1]},S=K=>{if(c.value)if(K.preventDefault(),K.stopPropagation(),g.status=!0,r.value){const{left:q,top:X}=M(c.value);K=K,w.x=K.targetTouches[0].clientX-q,w.y=K.targetTouches[0].clientY-X,g.points.push({x:w.x,y:w.y})}else{const{left:q,top:X}=b(c.value);K=K,w.x=K.clientX-q,w.y=K.clientY-X,g.points.push({x:w.x,y:w.y})}},N=(K,q,X)=>{const se=g.ctx;se.beginPath(),se.moveTo(K.x,K.y),se.quadraticCurveTo(q.x,q.y,X.x,X.y),se.stroke(),se.closePath()},k=K=>{if(c.value&&(K.preventDefault(),K.stopPropagation(),g.status&&g.ctx)){if(r.value){const{left:q,top:X}=M(c.value);K=K;const se=K.targetTouches[0].clientX-q,ye=K.targetTouches[0].clientY-X;g.points.push({x:se,y:ye})}else{const{left:q,top:X}=b(c.value);K=K;const se=K.clientX-q,ye=K.clientY-X;g.points.push({x:se,y:ye})}if(g.points.length>3){const q=g.points.slice(-2),X=q[0],se={x:(q[0].x+q[1].x)/2,y:(q[0].y+q[1].y)/2};g.beginPoint&&N(g.beginPoint,X,se),g.beginPoint=se}}},A=K=>{if(c.value){K.preventDefault(),K.stopPropagation();const q=c.value;if(q.style.cursor="auto",g.status){if(r.value){const{left:ye,top:le}=M(c.value);K=K;const D=K.changedTouches[0].clientX-ye,R=K.changedTouches[0].clientY-le;g.points.push({x:D,y:R})}else{const{left:ye,top:le}=b(c.value);K=K;const D=K.clientX-ye,R=K.clientY-le;g.points.push({x:D,y:R})}if(g.points.length>3){const ye=g.points.slice(-2),le=ye[0],D=ye[1];g.beginPoint&&N(g.beginPoint,le,D)}g.beginPoint=null,g.points=[];const X=g.ctx;X==null||X.closePath();const se=X==null?void 0:X.getImageData(0,0,q.width,q.height);g.saveSignature=E(se)}}g.status=!1},B=()=>{m.close()},W=()=>{g.ctx&&(r.value?g.ctx.clearRect(0,0,g.ctx.canvas.height,g.ctx.canvas.width):g.ctx.clearRect(0,0,g.ctx.canvas.width,g.ctx.canvas.height),g.saveSignature="")},L=K=>{K.target===u.value&&m.close()},G=async()=>{if(g.saveSignature!==g.originSignature){const K=ha.service({target:a.relatedDom||document.body});await y(m.options.dataKey,g.saveSignature,m.options.isGuardian?465921:345601,m.options.type),K.close(),m.close()}},H=()=>{B()},te=t.reactive({top:"",left:"",width:"",height:""});return t.onMounted(async()=>{var q;r.value?(te.top="calc((100vh - 100vw) / 2)",te.left="calc((100vw - 100vh) / 2)",te.width="100vh",te.height="100vw"):a.relatedDom?(te.top=`${a.relatedDom.offsetTop}px`,te.left=`${a.relatedDom.offsetLeft}px`,te.width=`${a.relatedDom.clientWidth}px`,te.height=`${a.relatedDom.clientHeight}px`):(te.top="0",te.left="0",te.width="100vw",te.height="100vh");const K=ha.service({target:a.relatedDom||document.body});if(c.value&&l.value){const X=c.value,se=X.getContext("2d",{willReadFrequently:!0});g.ctx=se,r.value?t.nextTick(()=>{var le,D;X.width=((le=l.value)==null?void 0:le.clientWidth)||0,X.height=((D=l.value)==null?void 0:D.clientHeight)||0,se.translate(X.width/2,X.height/2),se.rotate(-Math.PI/2),se.translate(-X.height/2,-X.width/2),se.lineWidth=5}):(X.width=l.value.clientWidth,X.height=l.value.clientHeight,se.lineWidth=3),se.lineJoin="round",se.lineCap="round";const ye=m.options;if(ye.dataKey)if(Rn.get(ye.formData,ye.dataKey)){const D=((q=m.options)==null?void 0:q.value)||"";if(D){const R=new Image;R.src=D,R.onload=()=>{se.drawImage(R,0,0,R.width,R.height);const V=se==null?void 0:se.getImageData(0,0,X.width,X.height);g.originSignature=E(V),g.saveSignature=g.originSignature}}else g.originSignature="",g.saveSignature=""}else g.originSignature="",g.saveSignature=""}K.close()}),(K,q)=>{const X=br;return t.openBlock(),t.createElementBlock("div",null,[t.createElementVNode("div",{ref_key:"signatureView",ref:u,class:t.normalizeClass(r.value?"signature_view signature_view_mobile":"signature_view signature_view_ps"),onClick:L},[t.createElementVNode("div",Nk,[t.createElementVNode("img",{class:"signature_close",src:lh,onClick:B}),vk,t.createElementVNode("div",{class:"signature_subtitle"},[Bk,t.createElementVNode("div",{class:"signature_clear",onClick:W},"Clear")]),t.createElementVNode("div",{class:"signature_pad",ref_key:"signatureBox",ref:l},[t.createElementVNode("canvas",{class:"pad",ref_key:"signaturePad",ref:c,onMousedown:q[0]||(q[0]=se=>!r.value&&S(se)),onMouseup:q[1]||(q[1]=se=>!r.value&&A(se)),onMousemoveCapture:q[2]||(q[2]=se=>!r.value&&k(se)),onMouseleave:q[3]||(q[3]=se=>!r.value&&A(se)),onTouchstart:q[4]||(q[4]=se=>S(se)),onTouchend:q[5]||(q[5]=se=>A(se)),onTouchmoveCapture:q[6]||(q[6]=se=>k(se)),onTouchcancel:q[7]||(q[7]=se=>A(se))},null,544),Dk],512),Lk,t.createElementVNode("div",Ok,[t.createVNode(X,{class:"signature_chioce_button signature_cancel",onClick:H},{default:t.withCtx(()=>[t.createTextVNode("Cancel")]),_:1}),t.createVNode(X,{class:"signature_chioce_button signature_confirm",onClick:G},{default:t.withCtx(()=>[t.createTextVNode("Confirm")]),_:1})])])],2)])}}}),[["__scopeId","data-v-50a3cf13"]]),Vk="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='20'%20height='20.002'%20viewBox='0%200%2020%2020.002'%3e%3cg%20id='组_22313'%20data-name='组%2022313'%20transform='translate(-106.404%20-80.254)'%3e%3cpath%20id='路径_23519'%20data-name='路径%2023519'%20d='M209.607,82.221a1.53,1.53,0,0,1,2.154.006l1.077,1.077a1.533,1.533,0,0,1,.006,2.154L201.509,96.794h1.079l-4.316-4.316v1.079l11.335-11.335Zm-1.079-1.079L197.193,92.477a.763.763,0,0,0,0,1.079l4.316,4.316a.763.763,0,0,0,1.079,0l11.335-11.335a3.059,3.059,0,0,0-.006-4.312l-1.077-1.077a3.056,3.056,0,0,0-4.312-.006Zm-1.623,2.7,4.316,4.316,1.079-1.079-4.316-4.316L206.9,83.845Z'%20transform='translate(-88.406)'%20fill='%23333'/%3e%3cpath%20id='路径_23520'%20data-name='路径%2023520'%20d='M108.6,583.993l-2.158,6.475a.763.763,0,0,0,.965.965l6.474-2.158a.763.763,0,0,0,.3-1.263l-4.316-4.316a.763.763,0,0,0-1.263.3Zm1.448.483-1.263.3,4.316,4.316.3-1.263-6.474,2.158.965.965,2.158-6.474Z'%20transform='translate(0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S4xMzlhLjg0OS44NDkgMCAwIDEtLjU1Mi0uMjc4LjY4Ni42ODYgMCAwIDEgLjIwNy0uOTcybDIuMjc2LTEuNTI4SDYuOWE1LjU1NiA1LjU1NiAwIDAgMCAwIDExLjExMmgxMi40MWEuNjk1LjY5NSAwIDAgMSAwIDEuMzg5SDYuOWE2Ljk0NSA2Ljk0NSAwIDAgMSAwLTEzLjg5eiIgZmlsbD0iI2MxYzFjMSIvPjxwYXRoIGRhdGEtbmFtZT0i55+p5b2iIDIzMTQ5IiBmaWxsPSJub25lIiBkPSJNMCAwaDIwdjIwSDB6Ii8+PC9zdmc+"},qt=e=>zk[e],Pk=e=>(t.pushScopeId("data-v-516516a5"),e=e(),t.popScopeId(),e),$k={class:"image-editor-box"},Fk={key:0,class:"image-editor-controler"},jk={key:0,class:"image-editor-no_edit"},Uk={key:1,class:"image-editor-editing"},Wk={class:"left"},Hk=["src"],Yk=["src"],Gk=["src"],Kk=[Pk(()=>t.createElementVNode("div",null,"Confirm",-1))],qk=gi(t.defineComponent({__name:"ImageEditor",setup(e){t.useCssVars(D=>({"455fdd5f":N.width,"4cccd4ae":N.height,b366f9a4:N.top,"2340194e":N.left}));const r=t.ref(hi()),a=ks().getImageEditor(),c=vr().getDocumentTemplate(),u=a.confirm,f=t.ref(null),m=t.ref(null),y=t.ref(null),g=t.reactive({x:0,y:0,width:0,height:0}),w=t.reactive({x:0,y:0}),b=t.reactive({isEditable:!1,clearIcon:qt("clearDisableIcon"),undoIcon:qt("undoDisableIcon"),redoIcon:qt("redoDisableIcon"),ctx:null,isDrawing:!1,color:"#ff0000",stroke:"2",originImg:void 0,index:0,operateList:new Array,redoList:new Array,originImage:"",currentImage:"",saveImage:"",type:"",points:new Array,beginPoint:null}),M=D=>{let[R,V]=[D.offsetLeft,D.offsetTop];const F=ie=>{V+=ie.offsetTop,R+=ie.offsetLeft,ie.offsetParent&&F(ie.offsetParent)};return D.offsetParent&&F(D.offsetParent),{left:R,top:V}},E=D=>{let{left:R,top:V}=D.getBoundingClientRect();return{left:R,top:V}},S=({i_width:D,i_height:R,c_width:V,c_height:F})=>{const ie=D/R,ue=V/F;switch(!0){case ie>ue:D=V,R=D/ie;break;case ie<ue:R=F,D=R*ie;break;case ie==ue:D=V,R=F;break}return{width:D,height:R}},N=t.reactive({top:"",left:"",width:"",height:""});t.onMounted(async()=>{let D=a.options.src;const R=D.split(/[:;]/);if(R.length===3?b.type=R[1]:b.type="image/png",r.value?(N.top="0",N.left="0",N.width="100vw",N.height="100vh"):c.relatedDom?(N.top=`${c.relatedDom.offsetTop}px`,N.left=`${c.relatedDom.offsetLeft}px`,N.width=`${c.relatedDom.clientWidth}px`,N.height=`${c.relatedDom.clientHeight}px`):(N.top="0",N.left="0",N.width="100vw",N.height="100vh"),f.value&&y.value){const V=f.value,F=V.getContext("2d",{willReadFrequently:!0});b.ctx=F,V.width=y.value.clientWidth,V.height=y.value.clientHeight;const ie=V.width,ue=V.height,de=new Image;de.src=D,de.onload=()=>{F.clearRect(0,0,V.width,V.height);const ge=de.width,Ie=de.height,Se=S({i_width:ge,i_height:Ie,c_width:ie,c_height:ue});g.width=Se.width,g.height=Se.height,V.width=g.width,V.height=g.height,g.x=(V.width-g.width)/2,g.y=(V.height-g.height)/2,F==null||F.drawImage(de,g.x,g.y,g.width,g.height);const Te=F==null?void 0:F.getImageData(0,0,V.width,V.height);Te&&(b.originImg=Te,b.operateList.push(Te),b.originImage=L(Te),b.currentImage=b.originImage,b.saveImage=b.originImage)}}});const k=async()=>{if(b.saveImage!==b.originImage){const D=ha.service({target:c.relatedDom||document.body});await u(a.options.dataKey,b.saveImage,b.type),D.close()}a.close()},A=D=>{D.target===m.value&&a.close()},B=()=>{b.operateList[b.index]!==b.originImg?b.clearIcon=qt("clearIcon"):b.clearIcon=qt("clearDisableIcon"),b.index>0?b.undoIcon=qt("undoIcon"):b.undoIcon=qt("undoDisableIcon"),b.redoList.length>0?b.redoIcon=qt("redoIcon"):b.redoIcon=qt("redoDisableIcon")},W=()=>{var R;const D=(R=b.ctx)==null?void 0:R.getImageData(g.x,g.y,g.width,g.height);b.currentImage=L(D),B()},L=D=>{const R=document.createElement("canvas");R.width=D.width,R.height=D.height;const V=R.getContext("2d");return V==null||V.putImageData(D,0,0),R.toDataURL().split(",")[1]},G=D=>{if(f.value){D.preventDefault(),D.stopPropagation();const R=b.ctx;if(R.strokeStyle=b.color,R.lineWidth=parseInt(b.stroke),b.isDrawing=!0,r.value){const{left:V,top:F}=E(f.value);D=D,w.x=D.targetTouches[0].clientX-V,w.y=D.targetTouches[0].clientY-F,b.points.push({x:w.x,y:w.y})}else{const{left:V,top:F}=M(f.value);D=D,w.x=D.clientX-V,w.y=D.clientY-F,b.points.push({x:w.x,y:w.y})}}},H=(D,R,V)=>{const F=b.ctx;F.beginPath(),F.moveTo(D.x,D.y),F.quadraticCurveTo(R.x,R.y,V.x,V.y),F.stroke(),F.closePath()},te=D=>{var R;if(f.value&&(D.preventDefault(),D.stopPropagation(),f.value.style.cursor="auto",b.isDrawing)){if(r.value){const{left:ie,top:ue}=E(f.value);D=D;const de=D.changedTouches[0].clientX-ie,ge=D.changedTouches[0].clientY-ue;b.points.push({x:de,y:ge})}else{const{left:ie,top:ue}=M(f.value);D=D;const de=D.clientX-ie,ge=D.clientY-ue;b.points.push({x:de,y:ge})}if(b.points.length>3){const ie=b.points.slice(-2),ue=ie[0],de=ie[1];b.beginPoint&&H(b.beginPoint,ue,de)}b.beginPoint=null,b.points=[];const V=b.ctx;V==null||V.closePath();const F=(R=b.ctx)==null?void 0:R.getImageData(g.x,g.y,g.width,g.height);b.operateList.push(F),b.redoList=new Array,b.index++}b.isDrawing=!1,W()},K=D=>{if(f.value&&(D.preventDefault(),D.stopPropagation(),b.isDrawing)){if(r.value){const{left:R,top:V}=E(f.value);D=D;const F=D.targetTouches[0].clientX-R,ie=D.targetTouches[0].clientY-V;b.points.push({x:F,y:ie})}else{const{left:R,top:V}=M(f.value);D=D;const F=D.clientX-R,ie=D.clientY-V;b.points.push({x:F,y:ie})}if(b.points.length>3){const R=b.points.slice(-2),V=R[0],F={x:(R[0].x+R[1].x)/2,y:(R[0].y+R[1].y)/2};b.beginPoint&&H(b.beginPoint,V,F),b.beginPoint=F}}},q=()=>{if(f.value){const D=f.value;r.value?(D.addEventListener("touchstart",G),D.addEventListener("touchend",te),D.addEventListener("touchcancel",te),D.addEventListener("touchmove",K)):(D.addEventListener("mousedown",G),D.addEventListener("mouseup",te),D.addEventListener("mouseleave",te),D.addEventListener("mousemove",K)),b.isEditable=!0}},X=()=>{if(f.value){const D=f.value;D.removeEventListener("mousedown",G),D.removeEventListener("mouseup",te),D.removeEventListener("mouseleave",te),D.removeEventListener("mousemove",K),b.isEditable=!1,b.saveImage=b.currentImage}},se=()=>{const D=b.ctx;D&&b.originImg&&(b.index++,b.operateList.push(b.originImg),b.redoList=new Array,D.putImageData(b.originImg,g.x,g.y),W())},ye=()=>{var R;const D=b.operateList.pop();b.redoList.push(D),b.index--,b.redoIcon=qt("redoIcon"),(R=b.ctx)==null||R.putImageData(b.operateList[b.index],g.x,g.y),W()},le=()=>{var R;const D=b.redoList.pop();b.operateList.push(D),b.index++,(R=b.ctx)==null||R.putImageData(D,g.x,g.y),W()};return(D,R)=>(t.openBlock(),t.createElementBlock("div",null,[t.createElementVNode("div",{ref_key:"editorView",ref:m,class:t.normalizeClass(r.value?"image-editor-view image-editor-view-mobile":"image-editor-view image-editor-view-ps"),onClick:A},[t.createElementVNode("div",$k,[t.createElementVNode("img",{class:"image-editor-close_icon",src:oh,onClick:k}),t.createElementVNode("div",{ref_key:"editorBox",ref:y,class:"image-editor-console-box"},[t.createElementVNode("canvas",{class:"image-editor-console",ref_key:"editorDom",ref:f},null,512)],512),t.unref(a).options.markable?(t.openBlock(),t.createElementBlock("div",Fk,[b.isEditable?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",jk,[t.createElementVNode("img",{src:Vk,class:"image-editor-editImg",onClick:q})])),b.isEditable?(t.openBlock(),t.createElementBlock("div",Uk,[t.createElementVNode("div",Wk,[t.withDirectives(t.createElementVNode("input",{class:"image-editor-color",type:"color","onUpdate:modelValue":R[0]||(R[0]=V=>b.color=V)},null,512),[[t.vModelText,b.color]]),t.withDirectives(t.createElementVNode("input",{class:"image-editor-stroke",type:"range",min:"1",max:"15","onUpdate:modelValue":R[1]||(R[1]=V=>b.stroke=V)},null,512),[[t.vModelText,b.stroke]]),t.createElementVNode("img",{class:"image-editor-clear",src:b.clearIcon,onClick:R[2]||(R[2]=V=>b.clearIcon==t.unref(qt)("clearIcon")&&se())},null,8,Hk),t.createElementVNode("img",{class:"image-editor-undo",src:b.undoIcon,onClick:R[3]||(R[3]=V=>b.undoIcon==t.unref(qt)("undoIcon")&&ye())},null,8,Yk),t.createElementVNode("img",{class:"image-editor-redo",src:b.redoIcon,onClick:R[4]||(R[4]=V=>b.redoIcon==t.unref(qt)("redoIcon")&&le())},null,8,Gk)]),t.createElementVNode("div",{class:"right"},[t.createElementVNode("div",{class:"image-editor-comfirm",onClick:X},Kk)])])):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)])],2)]))}}),[["__scopeId","data-v-516516a5"]]),Qk="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='6'%20height='6'%20viewBox='0%200%206%206'%3e%3ccircle%20id='椭圆_711'%20data-name='椭圆%20711'%20cx='3'%20cy='3'%20r='3'%20fill='%23005795'/%3e%3c/svg%3e",ch=e=>(t.pushScopeId("data-v-45ebd5d5"),e=e(),t.popScopeId(),e),Zk={class:"recommend-diagnoses"},Xk=ch(()=>t.createElementVNode("div",{class:"header"},null,-1)),Jk=ch(()=>t.createElementVNode("div",{class:"recommend-diagnoses-title"},[t.createElementVNode("img",{class:"recommend-diagnoses-title_icon",src:Qk}),t.createElementVNode("span",{class:"recommend-diagnoses-title_text"},"Recommend Diagnoses")],-1)),eM={class:"recommend-diagnoses-list"},tM={class:"recommend-diagnoses-item"},nM={class:"recommend-diagnoses-item-code"},rM={class:"recommend-diagnosis-item-comment"},oM={class:"recommend-diagnoses-confirm"},iM=gi(t.defineComponent({__name:"RecommendDiagnosis",setup(e){t.useCssVars(A=>({"5f9b895a":E.width,"1c46353a":E.height,"4a45ce22":E.top,"031fa64c":E.left}));const r=t.ref(hi()),o=vr(),a=o.getDocumentTemplate(),l=a.ecos,c=a.info,f=Ms().getRecommendDiagnosis(),m=t.reactive([]),y=t.reactive(f.options.formData),g=t.ref(!1),w=t.ref(null),b=f.cache;let M="";const E=t.reactive({top:"",left:"",width:"",height:""});t.onMounted(async()=>{const B=vr().getDocumentTemplate();B.relatedDom?(E.top=`${B.relatedDom.offsetTop}px`,E.left=`${B.relatedDom.offsetLeft}px`,E.width=`${B.relatedDom.clientWidth}px`,E.height=`${B.relatedDom.clientHeight}px`):(E.top="0",E.left="0",E.width="100vw",E.height="100vh");const W=ha.service({target:B.relatedDom||document.body}),L=y.Diagnosis,G=new Set(L.map(K=>K.code));let H=[];if(b.hasCache)H=b.list;else{const K=await l.retrieveDocument({idList:[c==null?void 0:c.facilityId,...(c==null?void 0:c.locationIds)||[],c==null?void 0:c.patientId],options:{ObjType:28,sfname:'{"result":"D.*", "join": "INNER JOIN Edge E on E.id=D.reid INNER JOIN Edge E2 on E.refid=E2.id"}',xfname:"(E.bvid,E2.Bvid) | (E.evid,E2.Bvid)",scondition:"E.type=40000 AND E.subtype&0xff=6 AND E2.type=40000 AND E2.subtype&0xff in(1,9) AND D.type=186881",asc:!1,obfname:"D.ctime",maxcount:100}});if(K.code===0){let q=[];K.document.forEach(X=>{const se=X.name.data.diagnosis.descriptiveList;q=q.concat(se)}),b.hasCache=!0,b.list=Rn.cloneDeep(q),H=q}else b.hasCache=!0,b.list=[],H=[]}H.forEach(K=>{G.has(K.code)?K.isChecked=!0:K.isChecked=!1});let te=new Set;H=H.filter(K=>te.has(K.code)?!1:(te.add(K.code),!0)),H.forEach(K=>{K.isChecked?M+="1":M+="0",m.push(K)}),W.close()}),t.watch(m,()=>{let A="";m.forEach(B=>{B.isChecked?A+="1":A+="0"}),g.value=M!==A});const S=()=>{f.close()},N=A=>{A.target===w.value&&f.close()},k=async()=>{console.log(o.documentTemplateData),m.forEach(A=>{A.isChecked&&o.documentTemplateData.value.Diagnosis.push({code:A.code,comment:A.comment,description:A.description})})};return(A,B)=>{const W=sp,L=br;return t.openBlock(),t.createElementBlock("div",{ref_key:"diagnosisView",ref:w,class:t.normalizeClass(r.value?"recommend-diagnoses-view recommend-diagnoses-mobile":"recommend-diagnoses-view"),onClick:N},[t.createElementVNode("div",Zk,[Xk,t.createElementVNode("div",{class:"recommend-diagnoses-close"},[t.createElementVNode("img",{class:"recommend-diagnoses-close_icon",src:lh,onClick:S})]),Jk,t.createElementVNode("div",eM,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m,G=>(t.openBlock(),t.createElementBlock("div",tM,[t.createElementVNode("div",nM,[t.createVNode(W,{modelValue:G.isChecked,"onUpdate:modelValue":H=>G.isChecked=H},null,8,["modelValue","onUpdate:modelValue"]),t.createTextVNode(" "+t.toDisplayString(G.code)+" - "+t.toDisplayString(G.description),1)]),t.createElementVNode("div",rM,t.toDisplayString(G.comment),1)]))),256))]),t.createElementVNode("div",oM,[t.createVNode(L,{class:t.normalizeClass(`
|
|
80
80
|
recommend-diagnoses-button
|
|
81
81
|
${g.value?"recommend-diagnoses-button-able":"recommend-diagnoses-button-disable"}
|
|
82
|
-
`),onClick:k},{default:t.withCtx(()=>[t.createTextVNode("Confirm")]),_:1},8,["class"])])])],2)}}}),[["__scopeId","data-v-
|
|
82
|
+
`),onClick:k},{default:t.withCtx(()=>[t.createTextVNode("Confirm")]),_:1},8,["class"])])])],2)}}}),[["__scopeId","data-v-45ebd5d5"]]),uh=t.defineComponent({__name:"DocumentTemplate",props:{json:{type:Array,required:!0,default:{}},formData:{type:Object,require:!0,default:{}},isEditable:{type:Boolean,default:!0,required:!0}},setup(e){var X,se;const r=vr(),o=r.getDocumentTemplate(),l=_s().getCalendarPciker(),u=Is().getSignaturePad(),m=ks().getImageEditor(),g=Ms().getRecommendDiagnosis(),w=e,b=w.formData,M=w.json,E=w.isEditable,S=o.ecos,N=o.role,k=o.docType,A=o.info;u.confirm=async(ye,le,D=345601,R)=>{var Se,Te,pe,ae,he,Ce,xe,Le,We;const F=sh(le,"image/png");let ie="",ue="",de="",ge="";switch(R){case Vt.provider:{ie=((Se=A==null?void 0:A.providerSignatureInfo)==null?void 0:Se.eid)||"",de=((Te=A==null?void 0:A.providerSignatureInfo)==null?void 0:Te.fid)||"",ue=Rn.get(b,ye);const Pe=await S.retrieveDocument({idList:[ue]});Pe.code===0&&Pe.document.length&&(ge=Pe.document[0].name.title),await S.createEdge({bvid:(pe=A==null?void 0:A.providerSignatureInfo)==null?void 0:pe.vid,type:1030});break}case Vt.patient:{ie=((ae=A==null?void 0:A.patientSignatureInfo)==null?void 0:ae.eid)||"",de=((he=A==null?void 0:A.patientSignatureInfo)==null?void 0:he.fid)||"",await S.createEdge({bvid:(Ce=A==null?void 0:A.patientSignatureInfo)==null?void 0:Ce.vid,type:1030});break}case Vt.attorney:{ie=((xe=A==null?void 0:A.attorneySignatureInfo)==null?void 0:xe.eid)||"",de=((Le=A==null?void 0:A.attorneySignatureInfo)==null?void 0:Le.fid)||"",await S.createEdge({bvid:(We=A==null?void 0:A.attorneySignatureInfo)==null?void 0:We.vid,type:1030});break}}const Ie=await S.createDocument({atimes:-10,id:ue,eid:ie,type:D,name:{data:F,title:ge}});if(Ie.code===0){const Pe=Ie.document;switch(Rn.set(b,ye,Pe.id),R){case Vt.provider:await S.createEdge({bvid:de,type:1030}),B.otherData.providerSignature=await K(Pe.id);break;case Vt.patient:B.otherData.patientSignature=await K(Pe.id);break;case Vt.attorney:B.otherData.attorneySignature=await K(Pe.id);break}}},m.confirm=async(ye,le,D)=>{const R=sh(le,D),V=await S.createDocument({atimes:-10,eid:A==null?void 0:A.rootNotebookID,type:430081,name:{data:R,type:D},subtype:{isEditable:!0}});if(V.code===0){const F=V.document;Rn.set(b,ye,F.id)}};const B=t.reactive({formData:b,json:M,isEditable:E,role:N,docType:k,otherData:{providerSignature:"",patientSignature:"",attorneySignature:""},otherTableInfo:{}});r.setFormData(B.formData);const W=t.ref(((X=B.role)==null?void 0:X.toString())===((se=B.docType)==null?void 0:se.toString())),L=t.ref(B.role===Vt.provider),G=t.ref(B.role===Vt.patient),H=t.ref(B.role===Vt.attorney),te=t.reactive({provider:B.isEditable&&L,patient:B.isEditable&&G,attorney:B.isEditable&&H}),K=async ye=>{if(S&&ye){const le=await S.retrieveDocument({idList:[ye]});if(le.code===0&&le.document.length>0){const D=le.document[0];return Mk({type:D.name.type,data:D.name.data})}else return""}else return""},q=(ye,le)=>{const D=new Array,R=V=>{if(_o.isArray(V))V.forEach(F=>{R(F)});else if(_o.isObject(V)&&"type"in V){switch(V.type){case"atblock":case"sharpblock":case"table":case"image":break;case"paragraph":default:R(V.children)}V.type===le&&D.push(V)}};return R(ye),D};return t.onBeforeMount(()=>{q(B.json,"image").forEach(async D=>{B.otherData[D.alt]=await K(B.formData[D.alt]),t.watch(()=>B.formData[D.alt],async R=>{B.otherData[D.alt]=await K(R)})}),q(B.json,"table").forEach(D=>{const V=(D.width==="auto"?D.width:Cp.fullWidth)==="auto"?0:100,F=new Array,ie=D.children[0].children;if(B.otherTableInfo[D.key]={tableWidthArray:new Array,flexShrinks:new Array},ie.forEach(ue=>{V===0?F.push(ue!=null&&ue.width&&(ue==null?void 0:ue.width)!=="auto"?parseFloat(ue.width):30):F.push(ue!=null&&ue.width&&(ue==null?void 0:ue.width)!=="auto"?parseFloat(ue.width):Math.floor(1e4/ie.length)/100)}),V===0){let ue=0;F.forEach(de=>{ue+=de}),F.forEach((de,ge)=>{de===30?(B.otherTableInfo[D.key].tableWidthArray[ge]=`${b.atrribute.noodl_font.tableMinWidth}`,B.otherTableInfo[D.key].flexShrinks[ge]=0):(B.otherTableInfo[D.key].tableWidthArray[ge]=`${100*Math.floor(100*de/ue)/100}%`,B.otherTableInfo[D.key].flexShrinks[ge]=1)})}else{let ue=0,de=1;F.forEach(ge=>{ge===Math.floor(1e4/ie.length)/100?de-=ge/100:ue+=ge}),F.forEach((ge,Ie)=>{ge===Math.floor(1e4/ie.length)/100?(B.otherTableInfo[D.key].tableWidthArray[Ie]=`calc(${ge}%)`,B.otherTableInfo[D.key].flexShrinks[Ie]=0):(B.otherTableInfo[D.key].tableWidthArray[Ie]=`calc(${Math.floor(1e4*de*ge/ue)/100}%)`,B.otherTableInfo[D.key].flexShrinks[Ie]=1)})}}),_o.isArray(B.formData.Diagnosis)||(B.formData.Diagnosis=[])}),t.onMounted(async()=>{B.otherData.providerSignature=await K(B.formData.signatureId),B.otherData.patientSignature=await K(B.formData.patdSignatureId),B.otherData.attorneySignature=await K(B.formData.attSignatureId)}),(ye,le)=>(t.openBlock(),t.createElementBlock("div",null,[t.createVNode(Gl,{node:t.unref(M),formData:t.unref(b),isEditable:B.isEditable&&W.value,editability:te,otherData:B.otherData,otherTableInfo:B.otherTableInfo},null,8,["node","formData","isEditable","editability","otherData","otherTableInfo"]),t.unref(l).status?(t.openBlock(),t.createBlock(yk,{key:0})):t.createCommentVNode("",!0),t.unref(u).status?(t.openBlock(),t.createBlock(Rk,{key:1})):t.createCommentVNode("",!0),t.unref(m).status?(t.openBlock(),t.createBlock(qk,{key:2})):t.createCommentVNode("",!0),t.unref(g).status?(t.openBlock(),t.createBlock(iM,{key:3})):t.createCommentVNode("",!0)]))}}),aM=Nn.createPinia(),fh=e=>{e.use(aM),e.component("DocumentTemplate",uh)},sM={install:fh};gt.DocumentTemplate=uh,gt.aitmedTemplateRole=Vt,gt.aitmedTemplateType=mu,gt.default=sM,gt.install=fh,gt.useDocumentTemplateStore=vr,Object.defineProperties(gt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|