@aitmed/aitmed-document-template 1.13.0 → 1.14.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.
@@ -16901,6 +16901,7 @@ const CR = (e) => {
16901
16901
  } else
16902
16902
  se === sr.patient && (Ie = O.patientRootNotebookID || "");
16903
16903
  const M = await A.createDocument({
16904
+ atimes: -10,
16904
16905
  id: H,
16905
16906
  eid: Ie,
16906
16907
  type: ie,
@@ -76,4 +76,4 @@ function print() { __p += __j.call(arguments, '') }
76
76
  */(function(e){const r=Ca,o=Kl,a=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=f,e.SlowBuffer=O,e.INSPECT_MAX_BYTES=50;const s=2147483647;e.kMaxLength=s,f.TYPED_ARRAY_SUPPORT=u(),!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 u(){try{const S=new Uint8Array(1),p={foo:function(){return 42}};return Object.setPrototypeOf(p,Uint8Array.prototype),Object.setPrototypeOf(S,p),S.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 c(S){if(S>s)throw new RangeError('The value "'+S+'" is invalid for option "size"');const p=new Uint8Array(S);return Object.setPrototypeOf(p,f.prototype),p}function f(S,p,m){if(typeof S=="number"){if(typeof p=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return b(S)}return g(S,p,m)}f.poolSize=8192;function g(S,p,m){if(typeof S=="string")return y(S,p);if(ArrayBuffer.isView(S))return E(S);if(S==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof S);if(at(S,ArrayBuffer)||S&&at(S.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(at(S,SharedArrayBuffer)||S&&at(S.buffer,SharedArrayBuffer)))return C(S,p,m);if(typeof S=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const T=S.valueOf&&S.valueOf();if(T!=null&&T!==S)return f.from(T,p,m);const $=A(S);if($)return $;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof S[Symbol.toPrimitive]=="function")return f.from(S[Symbol.toPrimitive]("string"),p,m);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof S)}f.from=function(S,p,m){return g(S,p,m)},Object.setPrototypeOf(f.prototype,Uint8Array.prototype),Object.setPrototypeOf(f,Uint8Array);function h(S){if(typeof S!="number")throw new TypeError('"size" argument must be of type number');if(S<0)throw new RangeError('The value "'+S+'" is invalid for option "size"')}function w(S,p,m){return h(S),S<=0?c(S):p!==void 0?typeof m=="string"?c(S).fill(p,m):c(S).fill(p):c(S)}f.alloc=function(S,p,m){return w(S,p,m)};function b(S){return h(S),c(S<0?0:x(S)|0)}f.allocUnsafe=function(S){return b(S)},f.allocUnsafeSlow=function(S){return b(S)};function y(S,p){if((typeof p!="string"||p==="")&&(p="utf8"),!f.isEncoding(p))throw new TypeError("Unknown encoding: "+p);const m=D(S,p)|0;let T=c(m);const $=T.write(S,p);return $!==m&&(T=T.slice(0,$)),T}function B(S){const p=S.length<0?0:x(S.length)|0,m=c(p);for(let T=0;T<p;T+=1)m[T]=S[T]&255;return m}function E(S){if(at(S,Uint8Array)){const p=new Uint8Array(S);return C(p.buffer,p.byteOffset,p.byteLength)}return B(S)}function C(S,p,m){if(p<0||S.byteLength<p)throw new RangeError('"offset" is outside of buffer bounds');if(S.byteLength<p+(m||0))throw new RangeError('"length" is outside of buffer bounds');let T;return p===void 0&&m===void 0?T=new Uint8Array(S):m===void 0?T=new Uint8Array(S,p):T=new Uint8Array(S,p,m),Object.setPrototypeOf(T,f.prototype),T}function A(S){if(f.isBuffer(S)){const p=x(S.length)|0,m=c(p);return m.length===0||S.copy(m,0,0,p),m}if(S.length!==void 0)return typeof S.length!="number"||Rt(S.length)?c(0):B(S);if(S.type==="Buffer"&&Array.isArray(S.data))return B(S.data)}function x(S){if(S>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return S|0}function O(S){return+S!=S&&(S=0),f.alloc(+S)}f.isBuffer=function(p){return p!=null&&p._isBuffer===!0&&p!==f.prototype},f.compare=function(p,m){if(at(p,Uint8Array)&&(p=f.from(p,p.offset,p.byteLength)),at(m,Uint8Array)&&(m=f.from(m,m.offset,m.byteLength)),!f.isBuffer(p)||!f.isBuffer(m))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(p===m)return 0;let T=p.length,$=m.length;for(let j=0,Q=Math.min(T,$);j<Q;++j)if(p[j]!==m[j]){T=p[j],$=m[j];break}return T<$?-1:$<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,m){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(m===void 0)for(m=0,T=0;T<p.length;++T)m+=p[T].length;const $=f.allocUnsafe(m);let j=0;for(T=0;T<p.length;++T){let Q=p[T];if(at(Q,Uint8Array))j+Q.length>$.length?(f.isBuffer(Q)||(Q=f.from(Q)),Q.copy($,j)):Uint8Array.prototype.set.call($,Q,j);else if(f.isBuffer(Q))Q.copy($,j);else throw new TypeError('"list" argument must be an Array of Buffers');j+=Q.length}return $};function D(S,p){if(f.isBuffer(S))return S.length;if(ArrayBuffer.isView(S)||at(S,ArrayBuffer))return S.byteLength;if(typeof S!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof S);const m=S.length,T=arguments.length>2&&arguments[2]===!0;if(!T&&m===0)return 0;let $=!1;for(;;)switch(p){case"ascii":case"latin1":case"binary":return m;case"utf8":case"utf-8":return je(S).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m*2;case"hex":return m>>>1;case"base64":return Et(S).length;default:if($)return T?-1:je(S).length;p=(""+p).toLowerCase(),$=!0}}f.byteLength=D;function R(S,p,m){let T=!1;if((p===void 0||p<0)&&(p=0),p>this.length||((m===void 0||m>this.length)&&(m=this.length),m<=0)||(m>>>=0,p>>>=0,m<=p))return"";for(S||(S="utf8");;)switch(S){case"hex":return ce(this,p,m);case"utf8":case"utf-8":return F(this,p,m);case"ascii":return z(this,p,m);case"latin1":case"binary":return Z(this,p,m);case"base64":return be(this,p,m);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return de(this,p,m);default:if(T)throw new TypeError("Unknown encoding: "+S);S=(S+"").toLowerCase(),T=!0}}f.prototype._isBuffer=!0;function H(S,p,m){const T=S[p];S[p]=S[m],S[m]=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 m=0;m<p;m+=2)H(this,m,m+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 m=0;m<p;m+=4)H(this,m,m+3),H(this,m+1,m+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 m=0;m<p;m+=8)H(this,m,m+7),H(this,m+1,m+6),H(this,m+2,m+5),H(this,m+3,m+4);return this},f.prototype.toString=function(){const p=this.length;return p===0?"":arguments.length===0?F(this,0,p):R.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 m=e.INSPECT_MAX_BYTES;return p=this.toString("hex",0,m).replace(/(.{2})/g,"$1 ").trim(),this.length>m&&(p+=" ... "),"<Buffer "+p+">"},a&&(f.prototype[a]=f.prototype.inspect),f.prototype.compare=function(p,m,T,$,j){if(at(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(m===void 0&&(m=0),T===void 0&&(T=p?p.length:0),$===void 0&&($=0),j===void 0&&(j=this.length),m<0||T>p.length||$<0||j>this.length)throw new RangeError("out of range index");if($>=j&&m>=T)return 0;if($>=j)return-1;if(m>=T)return 1;if(m>>>=0,T>>>=0,$>>>=0,j>>>=0,this===p)return 0;let Q=j-$,Ae=T-m;const Xe=Math.min(Q,Ae),qe=this.slice($,j),Qe=p.slice(m,T);for(let Ke=0;Ke<Xe;++Ke)if(qe[Ke]!==Qe[Ke]){Q=qe[Ke],Ae=Qe[Ke];break}return Q<Ae?-1:Ae<Q?1:0};function K(S,p,m,T,$){if(S.length===0)return-1;if(typeof m=="string"?(T=m,m=0):m>2147483647?m=2147483647:m<-2147483648&&(m=-2147483648),m=+m,Rt(m)&&(m=$?0:S.length-1),m<0&&(m=S.length+m),m>=S.length){if($)return-1;m=S.length-1}else if(m<0)if($)m=0;else return-1;if(typeof p=="string"&&(p=f.from(p,T)),f.isBuffer(p))return p.length===0?-1:P(S,p,m,T,$);if(typeof p=="number")return p=p&255,typeof Uint8Array.prototype.indexOf=="function"?$?Uint8Array.prototype.indexOf.call(S,p,m):Uint8Array.prototype.lastIndexOf.call(S,p,m):P(S,[p],m,T,$);throw new TypeError("val must be string, number or Buffer")}function P(S,p,m,T,$){let j=1,Q=S.length,Ae=p.length;if(T!==void 0&&(T=String(T).toLowerCase(),T==="ucs2"||T==="ucs-2"||T==="utf16le"||T==="utf-16le")){if(S.length<2||p.length<2)return-1;j=2,Q/=2,Ae/=2,m/=2}function Xe(Qe,Ke){return j===1?Qe[Ke]:Qe.readUInt16BE(Ke*j)}let qe;if($){let Qe=-1;for(qe=m;qe<Q;qe++)if(Xe(S,qe)===Xe(p,Qe===-1?0:qe-Qe)){if(Qe===-1&&(Qe=qe),qe-Qe+1===Ae)return Qe*j}else Qe!==-1&&(qe-=qe-Qe),Qe=-1}else for(m+Ae>Q&&(m=Q-Ae),qe=m;qe>=0;qe--){let Qe=!0;for(let Ke=0;Ke<Ae;Ke++)if(Xe(S,qe+Ke)!==Xe(p,Ke)){Qe=!1;break}if(Qe)return qe}return-1}f.prototype.includes=function(p,m,T){return this.indexOf(p,m,T)!==-1},f.prototype.indexOf=function(p,m,T){return K(this,p,m,T,!0)},f.prototype.lastIndexOf=function(p,m,T){return K(this,p,m,T,!1)};function q(S,p,m,T){m=Number(m)||0;const $=S.length-m;T?(T=Number(T),T>$&&(T=$)):T=$;const j=p.length;T>j/2&&(T=j/2);let Q;for(Q=0;Q<T;++Q){const Ae=parseInt(p.substr(Q*2,2),16);if(Rt(Ae))return Q;S[m+Q]=Ae}return Q}function ee(S,p,m,T){return nt(je(p,S.length-m),S,m,T)}function ne(S,p,m,T){return nt(St(p),S,m,T)}function ae(S,p,m,T){return nt(Et(p),S,m,T)}function pe(S,p,m,T){return nt(sn(p,S.length-m),S,m,T)}f.prototype.write=function(p,m,T,$){if(m===void 0)$="utf8",T=this.length,m=0;else if(T===void 0&&typeof m=="string")$=m,T=this.length,m=0;else if(isFinite(m))m=m>>>0,isFinite(T)?(T=T>>>0,$===void 0&&($="utf8")):($=T,T=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const j=this.length-m;if((T===void 0||T>j)&&(T=j),p.length>0&&(T<0||m<0)||m>this.length)throw new RangeError("Attempt to write outside buffer bounds");$||($="utf8");let Q=!1;for(;;)switch($){case"hex":return q(this,p,m,T);case"utf8":case"utf-8":return ee(this,p,m,T);case"ascii":case"latin1":case"binary":return ne(this,p,m,T);case"base64":return ae(this,p,m,T);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pe(this,p,m,T);default:if(Q)throw new TypeError("Unknown encoding: "+$);$=(""+$).toLowerCase(),Q=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function be(S,p,m){return p===0&&m===S.length?r.fromByteArray(S):r.fromByteArray(S.slice(p,m))}function F(S,p,m){m=Math.min(S.length,m);const T=[];let $=p;for(;$<m;){const j=S[$];let Q=null,Ae=j>239?4:j>223?3:j>191?2:1;if($+Ae<=m){let Xe,qe,Qe,Ke;switch(Ae){case 1:j<128&&(Q=j);break;case 2:Xe=S[$+1],(Xe&192)===128&&(Ke=(j&31)<<6|Xe&63,Ke>127&&(Q=Ke));break;case 3:Xe=S[$+1],qe=S[$+2],(Xe&192)===128&&(qe&192)===128&&(Ke=(j&15)<<12|(Xe&63)<<6|qe&63,Ke>2047&&(Ke<55296||Ke>57343)&&(Q=Ke));break;case 4:Xe=S[$+1],qe=S[$+2],Qe=S[$+3],(Xe&192)===128&&(qe&192)===128&&(Qe&192)===128&&(Ke=(j&15)<<18|(Xe&63)<<12|(qe&63)<<6|Qe&63,Ke>65535&&Ke<1114112&&(Q=Ke))}}Q===null?(Q=65533,Ae=1):Q>65535&&(Q-=65536,T.push(Q>>>10&1023|55296),Q=56320|Q&1023),T.push(Q),$+=Ae}return L(T)}const U=4096;function L(S){const p=S.length;if(p<=U)return String.fromCharCode.apply(String,S);let m="",T=0;for(;T<p;)m+=String.fromCharCode.apply(String,S.slice(T,T+=U));return m}function z(S,p,m){let T="";m=Math.min(S.length,m);for(let $=p;$<m;++$)T+=String.fromCharCode(S[$]&127);return T}function Z(S,p,m){let T="";m=Math.min(S.length,m);for(let $=p;$<m;++$)T+=String.fromCharCode(S[$]);return T}function ce(S,p,m){const T=S.length;(!p||p<0)&&(p=0),(!m||m<0||m>T)&&(m=T);let $="";for(let j=p;j<m;++j)$+=Gt[S[j]];return $}function de(S,p,m){const T=S.slice(p,m);let $="";for(let j=0;j<T.length-1;j+=2)$+=String.fromCharCode(T[j]+T[j+1]*256);return $}f.prototype.slice=function(p,m){const T=this.length;p=~~p,m=m===void 0?T:~~m,p<0?(p+=T,p<0&&(p=0)):p>T&&(p=T),m<0?(m+=T,m<0&&(m=0)):m>T&&(m=T),m<p&&(m=p);const $=this.subarray(p,m);return Object.setPrototypeOf($,f.prototype),$};function he(S,p,m){if(S%1!==0||S<0)throw new RangeError("offset is not uint");if(S+p>m)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUintLE=f.prototype.readUIntLE=function(p,m,T){p=p>>>0,m=m>>>0,T||he(p,m,this.length);let $=this[p],j=1,Q=0;for(;++Q<m&&(j*=256);)$+=this[p+Q]*j;return $},f.prototype.readUintBE=f.prototype.readUIntBE=function(p,m,T){p=p>>>0,m=m>>>0,T||he(p,m,this.length);let $=this[p+--m],j=1;for(;m>0&&(j*=256);)$+=this[p+--m]*j;return $},f.prototype.readUint8=f.prototype.readUInt8=function(p,m){return p=p>>>0,m||he(p,1,this.length),this[p]},f.prototype.readUint16LE=f.prototype.readUInt16LE=function(p,m){return p=p>>>0,m||he(p,2,this.length),this[p]|this[p+1]<<8},f.prototype.readUint16BE=f.prototype.readUInt16BE=function(p,m){return p=p>>>0,m||he(p,2,this.length),this[p]<<8|this[p+1]},f.prototype.readUint32LE=f.prototype.readUInt32LE=function(p,m){return p=p>>>0,m||he(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,m){return p=p>>>0,m||he(p,4,this.length),this[p]*16777216+(this[p+1]<<16|this[p+2]<<8|this[p+3])},f.prototype.readBigUInt64LE=ie(function(p){p=p>>>0,tt(p,"offset");const m=this[p],T=this[p+7];(m===void 0||T===void 0)&&W(p,this.length-8);const $=m+this[++p]*2**8+this[++p]*2**16+this[++p]*2**24,j=this[++p]+this[++p]*2**8+this[++p]*2**16+T*2**24;return BigInt($)+(BigInt(j)<<BigInt(32))}),f.prototype.readBigUInt64BE=ie(function(p){p=p>>>0,tt(p,"offset");const m=this[p],T=this[p+7];(m===void 0||T===void 0)&&W(p,this.length-8);const $=m*2**24+this[++p]*2**16+this[++p]*2**8+this[++p],j=this[++p]*2**24+this[++p]*2**16+this[++p]*2**8+T;return(BigInt($)<<BigInt(32))+BigInt(j)}),f.prototype.readIntLE=function(p,m,T){p=p>>>0,m=m>>>0,T||he(p,m,this.length);let $=this[p],j=1,Q=0;for(;++Q<m&&(j*=256);)$+=this[p+Q]*j;return j*=128,$>=j&&($-=Math.pow(2,8*m)),$},f.prototype.readIntBE=function(p,m,T){p=p>>>0,m=m>>>0,T||he(p,m,this.length);let $=m,j=1,Q=this[p+--$];for(;$>0&&(j*=256);)Q+=this[p+--$]*j;return j*=128,Q>=j&&(Q-=Math.pow(2,8*m)),Q},f.prototype.readInt8=function(p,m){return p=p>>>0,m||he(p,1,this.length),this[p]&128?(255-this[p]+1)*-1:this[p]},f.prototype.readInt16LE=function(p,m){p=p>>>0,m||he(p,2,this.length);const T=this[p]|this[p+1]<<8;return T&32768?T|4294901760:T},f.prototype.readInt16BE=function(p,m){p=p>>>0,m||he(p,2,this.length);const T=this[p+1]|this[p]<<8;return T&32768?T|4294901760:T},f.prototype.readInt32LE=function(p,m){return p=p>>>0,m||he(p,4,this.length),this[p]|this[p+1]<<8|this[p+2]<<16|this[p+3]<<24},f.prototype.readInt32BE=function(p,m){return p=p>>>0,m||he(p,4,this.length),this[p]<<24|this[p+1]<<16|this[p+2]<<8|this[p+3]},f.prototype.readBigInt64LE=ie(function(p){p=p>>>0,tt(p,"offset");const m=this[p],T=this[p+7];(m===void 0||T===void 0)&&W(p,this.length-8);const $=this[p+4]+this[p+5]*2**8+this[p+6]*2**16+(T<<24);return(BigInt($)<<BigInt(32))+BigInt(m+this[++p]*2**8+this[++p]*2**16+this[++p]*2**24)}),f.prototype.readBigInt64BE=ie(function(p){p=p>>>0,tt(p,"offset");const m=this[p],T=this[p+7];(m===void 0||T===void 0)&&W(p,this.length-8);const $=(m<<24)+this[++p]*2**16+this[++p]*2**8+this[++p];return(BigInt($)<<BigInt(32))+BigInt(this[++p]*2**24+this[++p]*2**16+this[++p]*2**8+T)}),f.prototype.readFloatLE=function(p,m){return p=p>>>0,m||he(p,4,this.length),o.read(this,p,!0,23,4)},f.prototype.readFloatBE=function(p,m){return p=p>>>0,m||he(p,4,this.length),o.read(this,p,!1,23,4)},f.prototype.readDoubleLE=function(p,m){return p=p>>>0,m||he(p,8,this.length),o.read(this,p,!0,52,8)},f.prototype.readDoubleBE=function(p,m){return p=p>>>0,m||he(p,8,this.length),o.read(this,p,!1,52,8)};function we(S,p,m,T,$,j){if(!f.isBuffer(S))throw new TypeError('"buffer" argument must be a Buffer instance');if(p>$||p<j)throw new RangeError('"value" argument is out of bounds');if(m+T>S.length)throw new RangeError("Index out of range")}f.prototype.writeUintLE=f.prototype.writeUIntLE=function(p,m,T,$){if(p=+p,m=m>>>0,T=T>>>0,!$){const Ae=Math.pow(2,8*T)-1;we(this,p,m,T,Ae,0)}let j=1,Q=0;for(this[m]=p&255;++Q<T&&(j*=256);)this[m+Q]=p/j&255;return m+T},f.prototype.writeUintBE=f.prototype.writeUIntBE=function(p,m,T,$){if(p=+p,m=m>>>0,T=T>>>0,!$){const Ae=Math.pow(2,8*T)-1;we(this,p,m,T,Ae,0)}let j=T-1,Q=1;for(this[m+j]=p&255;--j>=0&&(Q*=256);)this[m+j]=p/Q&255;return m+T},f.prototype.writeUint8=f.prototype.writeUInt8=function(p,m,T){return p=+p,m=m>>>0,T||we(this,p,m,1,255,0),this[m]=p&255,m+1},f.prototype.writeUint16LE=f.prototype.writeUInt16LE=function(p,m,T){return p=+p,m=m>>>0,T||we(this,p,m,2,65535,0),this[m]=p&255,this[m+1]=p>>>8,m+2},f.prototype.writeUint16BE=f.prototype.writeUInt16BE=function(p,m,T){return p=+p,m=m>>>0,T||we(this,p,m,2,65535,0),this[m]=p>>>8,this[m+1]=p&255,m+2},f.prototype.writeUint32LE=f.prototype.writeUInt32LE=function(p,m,T){return p=+p,m=m>>>0,T||we(this,p,m,4,4294967295,0),this[m+3]=p>>>24,this[m+2]=p>>>16,this[m+1]=p>>>8,this[m]=p&255,m+4},f.prototype.writeUint32BE=f.prototype.writeUInt32BE=function(p,m,T){return p=+p,m=m>>>0,T||we(this,p,m,4,4294967295,0),this[m]=p>>>24,this[m+1]=p>>>16,this[m+2]=p>>>8,this[m+3]=p&255,m+4};function Be(S,p,m,T,$){ut(p,T,$,S,m,7);let j=Number(p&BigInt(4294967295));S[m++]=j,j=j>>8,S[m++]=j,j=j>>8,S[m++]=j,j=j>>8,S[m++]=j;let Q=Number(p>>BigInt(32)&BigInt(4294967295));return S[m++]=Q,Q=Q>>8,S[m++]=Q,Q=Q>>8,S[m++]=Q,Q=Q>>8,S[m++]=Q,m}function oe(S,p,m,T,$){ut(p,T,$,S,m,7);let j=Number(p&BigInt(4294967295));S[m+7]=j,j=j>>8,S[m+6]=j,j=j>>8,S[m+5]=j,j=j>>8,S[m+4]=j;let Q=Number(p>>BigInt(32)&BigInt(4294967295));return S[m+3]=Q,Q=Q>>8,S[m+2]=Q,Q=Q>>8,S[m+1]=Q,Q=Q>>8,S[m]=Q,m+8}f.prototype.writeBigUInt64LE=ie(function(p,m=0){return Be(this,p,m,BigInt(0),BigInt("0xffffffffffffffff"))}),f.prototype.writeBigUInt64BE=ie(function(p,m=0){return oe(this,p,m,BigInt(0),BigInt("0xffffffffffffffff"))}),f.prototype.writeIntLE=function(p,m,T,$){if(p=+p,m=m>>>0,!$){const Xe=Math.pow(2,8*T-1);we(this,p,m,T,Xe-1,-Xe)}let j=0,Q=1,Ae=0;for(this[m]=p&255;++j<T&&(Q*=256);)p<0&&Ae===0&&this[m+j-1]!==0&&(Ae=1),this[m+j]=(p/Q>>0)-Ae&255;return m+T},f.prototype.writeIntBE=function(p,m,T,$){if(p=+p,m=m>>>0,!$){const Xe=Math.pow(2,8*T-1);we(this,p,m,T,Xe-1,-Xe)}let j=T-1,Q=1,Ae=0;for(this[m+j]=p&255;--j>=0&&(Q*=256);)p<0&&Ae===0&&this[m+j+1]!==0&&(Ae=1),this[m+j]=(p/Q>>0)-Ae&255;return m+T},f.prototype.writeInt8=function(p,m,T){return p=+p,m=m>>>0,T||we(this,p,m,1,127,-128),p<0&&(p=255+p+1),this[m]=p&255,m+1},f.prototype.writeInt16LE=function(p,m,T){return p=+p,m=m>>>0,T||we(this,p,m,2,32767,-32768),this[m]=p&255,this[m+1]=p>>>8,m+2},f.prototype.writeInt16BE=function(p,m,T){return p=+p,m=m>>>0,T||we(this,p,m,2,32767,-32768),this[m]=p>>>8,this[m+1]=p&255,m+2},f.prototype.writeInt32LE=function(p,m,T){return p=+p,m=m>>>0,T||we(this,p,m,4,2147483647,-2147483648),this[m]=p&255,this[m+1]=p>>>8,this[m+2]=p>>>16,this[m+3]=p>>>24,m+4},f.prototype.writeInt32BE=function(p,m,T){return p=+p,m=m>>>0,T||we(this,p,m,4,2147483647,-2147483648),p<0&&(p=4294967295+p+1),this[m]=p>>>24,this[m+1]=p>>>16,this[m+2]=p>>>8,this[m+3]=p&255,m+4},f.prototype.writeBigInt64LE=ie(function(p,m=0){return Be(this,p,m,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),f.prototype.writeBigInt64BE=ie(function(p,m=0){return oe(this,p,m,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function le(S,p,m,T,$,j){if(m+T>S.length)throw new RangeError("Index out of range");if(m<0)throw new RangeError("Index out of range")}function ye(S,p,m,T,$){return p=+p,m=m>>>0,$||le(S,p,m,4),o.write(S,p,m,T,23,4),m+4}f.prototype.writeFloatLE=function(p,m,T){return ye(this,p,m,!0,T)},f.prototype.writeFloatBE=function(p,m,T){return ye(this,p,m,!1,T)};function Ce(S,p,m,T,$){return p=+p,m=m>>>0,$||le(S,p,m,8),o.write(S,p,m,T,52,8),m+8}f.prototype.writeDoubleLE=function(p,m,T){return Ce(this,p,m,!0,T)},f.prototype.writeDoubleBE=function(p,m,T){return Ce(this,p,m,!1,T)},f.prototype.copy=function(p,m,T,$){if(!f.isBuffer(p))throw new TypeError("argument should be a Buffer");if(T||(T=0),!$&&$!==0&&($=this.length),m>=p.length&&(m=p.length),m||(m=0),$>0&&$<T&&($=T),$===T||p.length===0||this.length===0)return 0;if(m<0)throw new RangeError("targetStart out of bounds");if(T<0||T>=this.length)throw new RangeError("Index out of range");if($<0)throw new RangeError("sourceEnd out of bounds");$>this.length&&($=this.length),p.length-m<$-T&&($=p.length-m+T);const j=$-T;return this===p&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(m,T,$):Uint8Array.prototype.set.call(p,this.subarray(T,$),m),j},f.prototype.fill=function(p,m,T,$){if(typeof p=="string"){if(typeof m=="string"?($=m,m=0,T=this.length):typeof T=="string"&&($=T,T=this.length),$!==void 0&&typeof $!="string")throw new TypeError("encoding must be a string");if(typeof $=="string"&&!f.isEncoding($))throw new TypeError("Unknown encoding: "+$);if(p.length===1){const Q=p.charCodeAt(0);($==="utf8"&&Q<128||$==="latin1")&&(p=Q)}}else typeof p=="number"?p=p&255:typeof p=="boolean"&&(p=Number(p));if(m<0||this.length<m||this.length<T)throw new RangeError("Out of range index");if(T<=m)return this;m=m>>>0,T=T===void 0?this.length:T>>>0,p||(p=0);let j;if(typeof p=="number")for(j=m;j<T;++j)this[j]=p;else{const Q=f.isBuffer(p)?p:f.from(p,$),Ae=Q.length;if(Ae===0)throw new TypeError('The value "'+p+'" is invalid for argument "value"');for(j=0;j<T-m;++j)this[j+m]=Q[j%Ae]}return this};const Ee={};function Pe(S,p,m){Ee[S]=class extends m{constructor(){super(),Object.defineProperty(this,"message",{value:p.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${S}]`,this.stack,delete this.name}get code(){return S}set code($){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:$,writable:!0})}toString(){return`${this.name} [${S}]: ${this.message}`}}}Pe("ERR_BUFFER_OUT_OF_BOUNDS",function(S){return S?`${S} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Pe("ERR_INVALID_ARG_TYPE",function(S,p){return`The "${S}" argument must be of type number. Received type ${typeof p}`},TypeError),Pe("ERR_OUT_OF_RANGE",function(S,p,m){let T=`The value of "${S}" is out of range.`,$=m;return Number.isInteger(m)&&Math.abs(m)>2**32?$=Fe(String(m)):typeof m=="bigint"&&($=String(m),(m>BigInt(2)**BigInt(32)||m<-(BigInt(2)**BigInt(32)))&&($=Fe($)),$+="n"),T+=` It must be ${p}. Received ${$}`,T},RangeError);function Fe(S){let p="",m=S.length;const T=S[0]==="-"?1:0;for(;m>=T+4;m-=3)p=`_${S.slice(m-3,m)}${p}`;return`${S.slice(0,m)}${p}`}function We(S,p,m){tt(p,"offset"),(S[p]===void 0||S[p+m]===void 0)&&W(p,S.length-(m+1))}function ut(S,p,m,T,$,j){if(S>m||S<p){const Q=typeof p=="bigint"?"n":"";let Ae;throw p===0||p===BigInt(0)?Ae=`>= 0${Q} and < 2${Q} ** ${(j+1)*8}${Q}`:Ae=`>= -(2${Q} ** ${(j+1)*8-1}${Q}) and < 2 ** ${(j+1)*8-1}${Q}`,new Ee.ERR_OUT_OF_RANGE("value",Ae,S)}We(T,$,j)}function tt(S,p){if(typeof S!="number")throw new Ee.ERR_INVALID_ARG_TYPE(p,"number",S)}function W(S,p,m){throw Math.floor(S)!==S?(tt(S,m),new Ee.ERR_OUT_OF_RANGE("offset","an integer",S)):p<0?new Ee.ERR_BUFFER_OUT_OF_BOUNDS:new Ee.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${p}`,S)}const ue=/[^+/0-9A-Za-z-_]/g;function ze(S){if(S=S.split("=")[0],S=S.trim().replace(ue,""),S.length<2)return"";for(;S.length%4!==0;)S=S+"=";return S}function je(S,p){p=p||1/0;let m;const T=S.length;let $=null;const j=[];for(let Q=0;Q<T;++Q){if(m=S.charCodeAt(Q),m>55295&&m<57344){if(!$){if(m>56319){(p-=3)>-1&&j.push(239,191,189);continue}else if(Q+1===T){(p-=3)>-1&&j.push(239,191,189);continue}$=m;continue}if(m<56320){(p-=3)>-1&&j.push(239,191,189),$=m;continue}m=($-55296<<10|m-56320)+65536}else $&&(p-=3)>-1&&j.push(239,191,189);if($=null,m<128){if((p-=1)<0)break;j.push(m)}else if(m<2048){if((p-=2)<0)break;j.push(m>>6|192,m&63|128)}else if(m<65536){if((p-=3)<0)break;j.push(m>>12|224,m>>6&63|128,m&63|128)}else if(m<1114112){if((p-=4)<0)break;j.push(m>>18|240,m>>12&63|128,m>>6&63|128,m&63|128)}else throw new Error("Invalid code point")}return j}function St(S){const p=[];for(let m=0;m<S.length;++m)p.push(S.charCodeAt(m)&255);return p}function sn(S,p){let m,T,$;const j=[];for(let Q=0;Q<S.length&&!((p-=2)<0);++Q)m=S.charCodeAt(Q),T=m>>8,$=m%256,j.push($),j.push(T);return j}function Et(S){return r.toByteArray(ze(S))}function nt(S,p,m,T){let $;for($=0;$<T&&!($+m>=p.length||$>=S.length);++$)p[$+m]=S[$];return $}function at(S,p){return S instanceof p||S!=null&&S.constructor!=null&&S.constructor.name!=null&&S.constructor.name===p.name}function Rt(S){return S!==S}const Gt=function(){const S="0123456789abcdef",p=new Array(256);for(let m=0;m<16;++m){const T=m*16;for(let $=0;$<16;++$)p[T+$]=S[m]+S[$]}return p}();function ie(S){return typeof BigInt>"u"?ke:S}function ke(){throw new Error("BigInt not supported")}})(rh);const Wk=e=>{const r=atob(e),o=r.length,a=new Uint8Array(o);for(let s=0;s<o;s++)a[s]=r.charCodeAt(s);return a},jk=({type:e,data:r})=>`data:${e};base64,${r}`,Kk=e=>Wk(e),ih=(e,r)=>{const o=Kk(e),a=rh.Buffer.from(o.buffer);return new Blob([a.buffer],{type:r})},ah="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",Gk="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",Sa=e=>(t.pushScopeId("data-v-8ccb97bc"),e=e(),t.popScopeId(),e),qk={class:"signature_box"},Yk=Sa(()=>t.createElementVNode("div",{class:"signature_tilte"},"Signature",-1)),Jk=Sa(()=>t.createElementVNode("div",{class:"subtitle"},"Click on the signature box below to finger sign",-1)),Zk=Sa(()=>t.createElementVNode("div",{class:"label"},"X",-1)),Xk=Sa(()=>t.createElementVNode("div",{class:"signature_tips"},[t.createElementVNode("img",{class:"signature_icon",src:Gk}),t.createElementVNode("div",{class:"tips"},"The signature is saved for later use.")],-1)),Qk={class:"signature_operate"},eB=pi(t.defineComponent({__name:"SignaturePad",setup(e){t.useCssVars(P=>({"2ef5e76c":K.width,"0e4d8323":K.height,"1c3670d9":K.top,"6a93e103":K.left}));const o=Ar().getDocumentTemplate(),a=t.ref(null),s=t.ref(null),u=t.ref(null),f=_s().getSignaturePad(),g=f.confirm,h=t.reactive({status:!1,ctx:null,originSignature:"",saveSignature:"",points:new Array,beginPoint:null}),w=t.reactive({x:0,y:0}),b=P=>{let[q,ee]=[P.offsetLeft,P.offsetTop];const ne=ae=>{ee+=ae.offsetTop,q+=ae.offsetLeft,ae.offsetParent&&ne(ae.offsetParent)};return P.offsetParent&&ne(P.offsetParent),{left:q,top:ee}},y=P=>{const q=document.createElement("canvas");q.width=P.width,q.height=P.height;const ee=q.getContext("2d");return ee==null||ee.putImageData(P,0,0),q.toDataURL().split(",")[1]},B=P=>{if(s.value){h.status=!0;const{left:q,top:ee}=b(s.value);h.ctx,w.x=P.clientX-q,w.y=P.clientY-ee,h.points.push({x:w.x,y:w.y})}},E=(P,q,ee)=>{const ne=h.ctx;ne.beginPath(),ne.moveTo(P.x,P.y),ne.quadraticCurveTo(q.x,q.y,ee.x,ee.y),ne.stroke(),ne.closePath()},C=P=>{if(s.value){const{left:q,top:ee}=b(s.value);if(h.status&&h.ctx){const ne=P.clientX-q,ae=P.clientY-ee;if(h.points.push({x:ne,y:ae}),h.points.length>3){const pe=h.points.slice(-2),be=pe[0],F={x:(pe[0].x+pe[1].x)/2,y:(pe[0].y+pe[1].y)/2};h.beginPoint&&E(h.beginPoint,be,F),h.beginPoint=F}}}},A=P=>{if(s.value){P.stopPropagation();const q=s.value;if(q.style.cursor="auto",h.status){const{left:ee,top:ne}=b(s.value),ae=P.clientX-ee,pe=P.clientY-ne;if(h.points.push({x:ae,y:pe}),h.points.length>3){const U=h.points.slice(-2),L=U[0],z=U[1];h.beginPoint&&E(h.beginPoint,L,z)}h.beginPoint=null,h.points=[];const be=h.ctx;be==null||be.closePath();const F=be==null?void 0:be.getImageData(0,0,q.width,q.height);h.saveSignature=y(F)}}h.status=!1},x=()=>{f.close()},O=()=>{h.ctx&&(h.ctx.clearRect(0,0,h.ctx.canvas.width,h.ctx.canvas.height),h.saveSignature="")},D=P=>{P.target===u.value&&f.close()},R=async()=>{if(h.saveSignature!==h.originSignature){const P=ua.service({target:o.relatedDom||document.body});await g(f.options.dataKey,h.saveSignature,f.options.isGuardian?465921:345601,f.options.type),P.close(),f.close()}},H=()=>{x()},K=t.reactive({top:"",left:"",width:"",height:""});return t.onMounted(async()=>{var q;o.relatedDom?(K.top=`${o.relatedDom.offsetTop}px`,K.left=`${o.relatedDom.offsetLeft}px`,K.width=`${o.relatedDom.clientWidth}px`,K.height=`${o.relatedDom.clientHeight}px`):(K.top="0",K.left="0",K.width="100vw",K.height="100vh");const P=ua.service({target:o.relatedDom||document.body});if(s.value&&a.value){const ee=s.value;ee.width=a.value.clientWidth,ee.height=a.value.clientHeight;const ne=ee.getContext("2d",{willReadFrequently:!0});h.ctx=ne,ne.lineWidth=3,ne.lineJoin="round",ne.lineCap="round";const ae=f.options;if(ae.dataKey)if($n.get(ae.formData,ae.dataKey)){const be=((q=f.options)==null?void 0:q.value)||"";if(be){const F=new Image;F.src=be,F.onload=()=>{ne.drawImage(F,0,0,F.width,F.height);const U=ne==null?void 0:ne.getImageData(0,0,ee.width,ee.height);h.originSignature=y(U),h.saveSignature=h.originSignature}}else h.originSignature="",h.saveSignature=""}else h.originSignature="",h.saveSignature=""}P.close()}),(P,q)=>{const ee=gr;return t.openBlock(),t.createElementBlock("div",null,[t.createElementVNode("div",{ref_key:"signatureView",ref:u,class:"signature_view",onClick:D},[t.createElementVNode("div",qk,[t.createElementVNode("img",{class:"signature_close",src:ah,onClick:x}),Yk,t.createElementVNode("div",{class:"signature_subtitle"},[Jk,t.createElementVNode("div",{class:"signature_clear",onClick:O},"Clear")]),t.createElementVNode("div",{class:"signature_pad",ref_key:"signatureBox",ref:a},[t.createElementVNode("canvas",{class:"pad",ref_key:"signaturePad",ref:s,onMousedown:B,onMouseup:A,onMousemoveCapture:C,onMouseleave:A},null,544),Zk],512),Xk,t.createElementVNode("div",Qk,[t.createVNode(ee,{class:"signature_chioce_button signature_cancel",onClick:H},{default:t.withCtx(()=>[t.createTextVNode("Cancel")]),_:1}),t.createVNode(ee,{class:"signature_chioce_button signature_confirm",onClick:R},{default:t.withCtx(()=>[t.createTextVNode("Confirm")]),_:1})])])],512)])}}}),[["__scopeId","data-v-8ccb97bc"]]),tB="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",nB=e=>(t.pushScopeId("data-v-d7707f13"),e=e(),t.popScopeId(),e),rB={class:"image-editor-box"},oB={key:0,class:"image-editor-controler"},iB={key:0,class:"image-editor-no_edit"},aB={key:1,class:"image-editor-editing"},sB={class:"left"},lB=["src"],cB=["src"],uB=["src"],fB=[nB(()=>t.createElementVNode("div",null,"Confirm",-1))],dB=pi(t.defineComponent({__name:"ImageEditor",setup(e){t.useCssVars(F=>({"38a96d96":C.width,"7a956952":C.height,"374a95b6":C.top,b20fb392:C.left}));const o=Cs().getImageEditor(),s=Ar().getDocumentTemplate(),u=o.confirm,c=t.ref(null),f=t.ref(null),g=t.ref(null),h=t.reactive({x:0,y:0,width:0,height:0}),w=t.reactive({x:0,y:0}),b=t.reactive({clearIcon:"./src/assets/images/components/clearEditImg.svg",clearDisableIcon:"./src/assets/images/components/clearEditImgPre.svg",undoIcon:"./src/assets/images/components/undoEdit.svg",undoDisableIcon:"./src/assets/images/components/undoEditPre.svg",redoIcon:"./src/assets/images/components/redoEdit.svg",redoDisableIcon:"./src/assets/images/components/redoEditPre.svg"}),y=t.reactive({isEditable:!1,clearIcon:b.clearDisableIcon,undoIcon:b.undoDisableIcon,redoIcon:b.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}),B=F=>{let[U,L]=[F.offsetLeft,F.offsetTop];const z=Z=>{L+=Z.offsetTop,U+=Z.offsetLeft,Z.offsetParent&&z(Z.offsetParent)};return F.offsetParent&&z(F.offsetParent),{left:U,top:L}},E=({i_width:F,i_height:U,c_width:L,c_height:z})=>{const Z=F/U,ce=L/z;switch(!0){case Z>ce:F=L,U=F/Z;break;case Z<ce:U=z,F=U*Z;break;case Z==ce:F=L,U=z;break}return{width:F,height:U}},C=t.reactive({top:"",left:"",width:"",height:""});t.onMounted(async()=>{let F=o.options.src;const U=F.split(/[:;]/);if(U.length===3?y.type=U[1]:y.type="image/png",c.value&&g.value){const L=c.value,z=L.getContext("2d",{willReadFrequently:!0});y.ctx=z,L.width=g.value.clientWidth,L.height=g.value.clientHeight;const Z=L.width,ce=L.height,de=new Image;de.src=F,de.onload=()=>{z.clearRect(0,0,L.width,L.height);const he=de.width,we=de.height,Be=E({i_width:he,i_height:we,c_width:Z,c_height:ce});h.width=Be.width,h.height=Be.height,L.width=h.width,L.height=h.height,h.x=(L.width-h.width)/2,h.y=(L.height-h.height)/2,z==null||z.drawImage(de,h.x,h.y,h.width,h.height);const oe=z==null?void 0:z.getImageData(0,0,L.width,L.height);oe&&(y.originImg=oe,y.operateList.push(oe),y.originImage=R(oe),y.currentImage=y.originImage,y.saveImage=y.originImage)}}s.relatedDom?(C.top=`${s.relatedDom.offsetTop}px`,C.left=`${s.relatedDom.offsetLeft}px`,C.width=`${s.relatedDom.clientWidth}px`,C.height=`${s.relatedDom.clientHeight}px`):(C.top="0",C.left="0",C.width="100vw",C.height="100vh")});const A=async()=>{if(y.saveImage!==y.originImage){const F=ua.service({target:s.relatedDom||document.body});await u(o.options.dataKey,y.saveImage,y.type),F.close()}o.close()},x=F=>{F.target===f.value&&o.close()},O=()=>{y.operateList[y.index]!==y.originImg?y.clearIcon=b.clearIcon:y.clearIcon=b.clearDisableIcon,y.index>0?y.undoIcon=b.undoIcon:y.undoIcon=b.undoDisableIcon,y.redoList.length>0?y.redoIcon=b.redoIcon:y.redoIcon=b.redoDisableIcon},D=()=>{var U;const F=(U=y.ctx)==null?void 0:U.getImageData(h.x,h.y,h.width,h.height);y.currentImage=R(F),O()},R=F=>{const U=document.createElement("canvas");U.width=F.width,U.height=F.height;const L=U.getContext("2d");return L==null||L.putImageData(F,0,0),U.toDataURL().split(",")[1]},H=F=>{if(c.value){const{left:U,top:L}=B(c.value),z=y.ctx;z.strokeStyle=y.color,z.lineWidth=parseInt(y.stroke),y.isDrawing=!0,w.x=F.clientX-U,w.y=F.clientY-L,y.points.push({x:w.x,y:w.y})}},K=(F,U,L)=>{const z=y.ctx;z.beginPath(),z.moveTo(F.x,F.y),z.quadraticCurveTo(U.x,U.y,L.x,L.y),z.stroke(),z.closePath()},P=F=>{var U;if(c.value&&(c.value.style.cursor="auto",y.isDrawing)){const{left:L,top:z}=B(c.value),Z=F.clientX-L,ce=F.clientY-z;if(y.points.push({x:Z,y:ce}),y.points.length>3){const we=y.points.slice(-2),Be=we[0],oe=we[1];y.beginPoint&&K(y.beginPoint,Be,oe)}y.beginPoint=null,y.points=[];const de=y.ctx;de==null||de.closePath();const he=(U=y.ctx)==null?void 0:U.getImageData(h.x,h.y,h.width,h.height);y.operateList.push(he),y.redoList=new Array,y.index++}y.isDrawing=!1,D()},q=F=>{if(c.value){const{left:U,top:L}=B(c.value);if(y.isDrawing){const z=F.clientX-U,Z=F.clientY-L;if(y.points.push({x:z,y:Z}),y.points.length>3){const ce=y.points.slice(-2),de=ce[0],he={x:(ce[0].x+ce[1].x)/2,y:(ce[0].y+ce[1].y)/2};y.beginPoint&&K(y.beginPoint,de,he),y.beginPoint=he}}}},ee=()=>{if(c.value){const F=c.value;F.addEventListener("mousedown",H),F.addEventListener("mouseup",P),F.addEventListener("mouseleave",P),F.addEventListener("mousemove",q),y.isEditable=!0}},ne=()=>{if(c.value){const F=c.value;F.removeEventListener("mousedown",H),F.removeEventListener("mouseup",P),F.removeEventListener("mouseleave",P),F.removeEventListener("mousemove",q),y.isEditable=!1,y.saveImage=y.currentImage}},ae=()=>{const F=y.ctx;F&&y.originImg&&(y.index++,y.operateList.push(y.originImg),y.redoList=new Array,F.putImageData(y.originImg,h.x,h.y),D())},pe=()=>{var U;const F=y.operateList.pop();y.redoList.push(F),y.index--,y.redoIcon=b.redoIcon,(U=y.ctx)==null||U.putImageData(y.operateList[y.index],h.x,h.y),D()},be=()=>{var U;const F=y.redoList.pop();y.operateList.push(F),y.index++,(U=y.ctx)==null||U.putImageData(F,h.x,h.y),D()};return(F,U)=>(t.openBlock(),t.createElementBlock("div",null,[t.createElementVNode("div",{ref_key:"editorView",ref:f,class:"image-editor-view",onClick:x},[t.createElementVNode("div",rB,[t.createElementVNode("img",{class:"image-editor-close_icon",src:nh,onClick:A}),t.createElementVNode("div",{ref_key:"editorBox",ref:g,class:"image-editor-console-box"},[t.createElementVNode("canvas",{class:"image-editor-console",ref_key:"editorDom",ref:c},null,512)],512),t.unref(o).options.markable?(t.openBlock(),t.createElementBlock("div",oB,[y.isEditable?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",iB,[t.createElementVNode("img",{src:tB,class:"image-editor-editImg",onClick:ee})])),y.isEditable?(t.openBlock(),t.createElementBlock("div",aB,[t.createElementVNode("div",sB,[t.withDirectives(t.createElementVNode("input",{class:"image-editor-color",type:"color","onUpdate:modelValue":U[0]||(U[0]=L=>y.color=L)},null,512),[[t.vModelText,y.color]]),t.withDirectives(t.createElementVNode("input",{class:"image-editor-stroke",type:"range",min:"1",max:"15","onUpdate:modelValue":U[1]||(U[1]=L=>y.stroke=L)},null,512),[[t.vModelText,y.stroke]]),t.createElementVNode("img",{class:"image-editor-clear",src:y.clearIcon,onClick:U[2]||(U[2]=L=>y.clearIcon==b.clearIcon&&ae())},null,8,lB),t.createElementVNode("img",{class:"image-editor-undo",src:y.undoIcon,onClick:U[3]||(U[3]=L=>y.undoIcon==b.undoIcon&&pe())},null,8,cB),t.createElementVNode("img",{class:"image-editor-redo",src:y.redoIcon,onClick:U[4]||(U[4]=L=>y.redoIcon==b.redoIcon&&be())},null,8,uB)]),t.createElementVNode("div",{class:"right"},[t.createElementVNode("div",{class:"image-editor-comfirm",onClick:ne},fB)])])):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)])],512)]))}}),[["__scopeId","data-v-d7707f13"]]),pB="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",sh=e=>(t.pushScopeId("data-v-e873c3ae"),e=e(),t.popScopeId(),e),hB={class:"recommend-diagnoses"},mB=sh(()=>t.createElementVNode("div",{class:"header"},null,-1)),gB=sh(()=>t.createElementVNode("div",{class:"recommend-diagnoses-title"},[t.createElementVNode("img",{class:"recommend-diagnoses-title_icon",src:pB}),t.createElementVNode("span",{class:"recommend-diagnoses-title_text"},"Recommend Diagnoses")],-1)),yB={class:"recommend-diagnoses-list"},bB={class:"recommend-diagnoses-item"},wB={class:"recommend-diagnoses-item-code"},EB={class:"recommend-diagnosis-item-comment"},_B={class:"recommend-diagnoses-confirm"},CB=pi(t.defineComponent({__name:"RecommendDiagnosis",setup(e){t.useCssVars(x=>({"1b65e850":B.width,"378827dd":B.height,"58ead342":B.top,c4772786:B.left}));const o=Ar().getDocumentTemplate(),a=o.ecos,s=o.info,c=Ss().getRecommendDiagnosis(),f=t.reactive([]),g=t.reactive(c.options.formData),h=t.ref(!1),w=t.ref(null),b=c.cache;let y="";const B=t.reactive({top:"",left:"",width:"",height:""});t.onMounted(async()=>{const O=Ar().getDocumentTemplate();O.relatedDom?(B.top=`${O.relatedDom.offsetTop}px`,B.left=`${O.relatedDom.offsetLeft}px`,B.width=`${O.relatedDom.clientWidth}px`,B.height=`${O.relatedDom.clientHeight}px`):(B.top="0",B.left="0",B.width="100vw",B.height="100vh");const D=ua.service({target:O.relatedDom||document.body}),R=g.Diagnosis,H=new Set(R.map(q=>q.code));let K=[];if(b.hasCache)K=b.list;else{const q=await a.retrieveDocument({idList:[s.facilityId,...s.locationIds,s.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(q.code===0){let ee=[];q.document.forEach(ne=>{const ae=ne.name.data.diagnosis.descriptiveList;ee=ee.concat(ae)}),b.hasCache=!0,b.list=$n.cloneDeep(ee),K=ee}else b.hasCache=!0,b.list=[],K=[]}K.forEach(q=>{H.has(q.code)?q.isChecked=!0:q.isChecked=!1});let P=new Set;K=K.filter(q=>P.has(q.code)?!1:(P.add(q.code),!0)),K.forEach(q=>{q.isChecked?y+="1":y+="0",f.push(q)}),D.close()}),t.watch(f,()=>{let x="";f.forEach(O=>{O.isChecked?x+="1":x+="0"}),h.value=y!==x});const E=()=>{c.close()},C=x=>{x.target===w.value&&c.close()},A=async()=>{};return(x,O)=>{const D=op,R=gr;return t.openBlock(),t.createElementBlock("div",{ref_key:"diagnosisView",ref:w,class:"recommend-diagnoses-view",onClick:C},[t.createElementVNode("div",hB,[mB,t.createElementVNode("div",{class:"recommend-diagnoses-close"},[t.createElementVNode("img",{class:"recommend-diagnoses-close_icon",src:ah,onClick:E})]),gB,t.createElementVNode("div",yB,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(f,H=>(t.openBlock(),t.createElementBlock("div",bB,[t.createElementVNode("div",wB,[t.createVNode(D,{modelValue:H.isChecked,"onUpdate:modelValue":K=>H.isChecked=K},null,8,["modelValue","onUpdate:modelValue"]),t.createTextVNode(" "+t.toDisplayString(H.code)+" - "+t.toDisplayString(H.description),1)]),t.createElementVNode("div",EB,t.toDisplayString(H.comment),1)]))),256))]),t.createElementVNode("div",_B,[t.createVNode(R,{class:t.normalizeClass(`
77
77
  recommend-diagnoses-button
78
78
  ${h.value?"recommend-diagnoses-button-able":"recommend-diagnoses-button-disable"}
79
- `),onClick:A},{default:t.withCtx(()=>[t.createTextVNode("Confirm")]),_:1},8,["class"])])])],512)}}}),[["__scopeId","data-v-e873c3ae"]]),lh=t.defineComponent({__name:"DocumentTemplate",setup(e){const o=Ar().getDocumentTemplate(),s=Es().getCalendarPciker(),c=_s().getSignaturePad(),g=Cs().getImageEditor(),w=Ss().getRecommendDiagnosis(),b=o.data,y=o.json,B=o.ecos,E=o.role,C=o.docType,A=o.info;c.confirm=async(P,q,ee=345601,ne)=>{var z,Z,ce;const pe=ih(q,"image/png");let be="",F="",U="";if(ne===yn.provider){be=((z=A.providerSignatureInfo)==null?void 0:z.eid)||"",F=$n.get(b,P);const de=await B.retrieveDocument({idList:[F]});de.code===0&&de.document.length&&(U=de.document[0].name.title),await B.createEdge({bvid:(Z=A.providerSignatureInfo)==null?void 0:Z.vid,type:1030})}else ne===yn.patient&&(be=A.patientRootNotebookID||"");const L=await B.createDocument({id:F,eid:be,type:ee,name:{data:pe,title:U}});if(L.code===0){const de=L.document;$n.set(b,P,de.id),ne===yn.provider?(await B.createEdge({bvid:(ce=A.providerSignatureInfo)==null?void 0:ce.fid,type:1030}),x.otherData.providerSignature=await H(de.id)):ne===yn.patient&&(x.otherData.patientSignature=await H(de.id))}},g.confirm=async(P,q,ee)=>{const ne=ih(q,ee),ae=await B.createDocument({atimes:-10,eid:A.rootNotebookID,type:430081,name:{data:ne,type:ee},subtype:{isEditable:!0}});if(ae.code===0){const pe=ae.document;$n.set(b,P,pe.id)}};const x=t.reactive({formData:b,json:y,role:E,docType:C,otherData:{providerSignature:"",patientSignature:""},otherTableInfo:{}}),O=t.ref(x.role.toString()===x.docType.toString()),D=t.ref(x.role===yn.provider),R=t.ref(x.role===yn.patient),H=async P=>{if(B){const q=await B.retrieveDocument({idList:[P]});if(q.code===0&&q.document.length>0){const ee=q.document[0];return jk({type:ee.name.type,data:ee.name.data})}else return""}else return""},K=(P,q)=>{const ee=new Array,ne=ae=>{if(Bl.isArray(ae))ae.forEach(pe=>{ne(pe)});else if(Bl.isObject(ae)&&"type"in ae){switch(ae.type){case"atblock":case"sharpblock":case"table":case"image":break;case"paragraph":default:ne(ae.children)}ae.type===q&&ee.push(ae)}};return ne(P),ee};return t.onBeforeMount(()=>{K(x.json,"image").forEach(async ee=>{x.otherData[ee.alt]=await H(x.formData[ee.alt]),t.watch(()=>x.formData[ee.alt],async ne=>{x.otherData[ee.alt]=await H(ne)})}),K(x.json,"table").forEach(ee=>{const ae=(ee.width==="auto"?ee.width:bp.fullWidth)==="auto"?0:100,pe=new Array,be=ee.children[0].children;if(x.otherTableInfo[ee.key]={tableWidthArray:new Array,flexShrinks:new Array},be.forEach(F=>{ae===0?pe.push(F!=null&&F.width&&(F==null?void 0:F.width)!=="auto"?parseFloat(F.width):30):pe.push(F!=null&&F.width&&(F==null?void 0:F.width)!=="auto"?parseFloat(F.width):Math.floor(1e4/be.length)/100)}),ae===0){let F=0;pe.forEach(U=>{F+=U}),pe.forEach((U,L)=>{U===30?(x.otherTableInfo[ee.key].tableWidthArray[L]=`${b.atrribute.noodl_font.tableMinWidth}`,x.otherTableInfo[ee.key].flexShrinks[L]=0):(x.otherTableInfo[ee.key].tableWidthArray[L]=`${100*Math.floor(100*U/F)/100}%`,x.otherTableInfo[ee.key].flexShrinks[L]=1)})}else{let F=0,U=1;pe.forEach(L=>{L===Math.floor(1e4/be.length)/100?U-=L/100:F+=L}),pe.forEach((L,z)=>{L===Math.floor(1e4/be.length)/100?(x.otherTableInfo[ee.key].tableWidthArray[z]=`calc(${L}%)`,x.otherTableInfo[ee.key].flexShrinks[z]=0):(x.otherTableInfo[ee.key].tableWidthArray[z]=`calc(${Math.floor(1e4*U*L/F)/100}%)`,x.otherTableInfo[ee.key].flexShrinks[z]=1)})}}),Bl.isArray(x.formData.Diagnosis)||(x.formData.Diagnosis=[])}),t.onMounted(async()=>{x.otherData.providerSignature=await H(x.formData.signatureId),x.otherData.patientSignature=await H(x.formData.patdSignatureId)}),(P,q)=>(t.openBlock(),t.createElementBlock("div",null,[t.createVNode(Wl,{node:x.json,formData:x.formData,isEditable:O.value,providerEditability:D.value,patientEditability:R.value,otherData:x.otherData,otherTableInfo:x.otherTableInfo},null,8,["node","formData","isEditable","providerEditability","patientEditability","otherData","otherTableInfo"]),t.unref(s).status?(t.openBlock(),t.createBlock($k,{key:0})):t.createCommentVNode("",!0),t.unref(c).status?(t.openBlock(),t.createBlock(eB,{key:1})):t.createCommentVNode("",!0),t.unref(g).status?(t.openBlock(),t.createBlock(dB,{key:2})):t.createCommentVNode("",!0),t.unref(w).status?(t.openBlock(),t.createBlock(CB,{key:3})):t.createCommentVNode("",!0)]))}}),SB=An.createPinia(),ch=e=>{e.use(SB),e.component("DocumentTemplate",lh)},xB={install:ch};mt.DocumentTemplate=lh,mt.aitmedTemplateRole=yn,mt.aitmedTemplateType=du,mt.default=xB,mt.install=ch,mt.useDocumentTemplateStore=Ar,Object.defineProperties(mt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
79
+ `),onClick:A},{default:t.withCtx(()=>[t.createTextVNode("Confirm")]),_:1},8,["class"])])])],512)}}}),[["__scopeId","data-v-e873c3ae"]]),lh=t.defineComponent({__name:"DocumentTemplate",setup(e){const o=Ar().getDocumentTemplate(),s=Es().getCalendarPciker(),c=_s().getSignaturePad(),g=Cs().getImageEditor(),w=Ss().getRecommendDiagnosis(),b=o.data,y=o.json,B=o.ecos,E=o.role,C=o.docType,A=o.info;c.confirm=async(P,q,ee=345601,ne)=>{var z,Z,ce;const pe=ih(q,"image/png");let be="",F="",U="";if(ne===yn.provider){be=((z=A.providerSignatureInfo)==null?void 0:z.eid)||"",F=$n.get(b,P);const de=await B.retrieveDocument({idList:[F]});de.code===0&&de.document.length&&(U=de.document[0].name.title),await B.createEdge({bvid:(Z=A.providerSignatureInfo)==null?void 0:Z.vid,type:1030})}else ne===yn.patient&&(be=A.patientRootNotebookID||"");const L=await B.createDocument({atimes:-10,id:F,eid:be,type:ee,name:{data:pe,title:U}});if(L.code===0){const de=L.document;$n.set(b,P,de.id),ne===yn.provider?(await B.createEdge({bvid:(ce=A.providerSignatureInfo)==null?void 0:ce.fid,type:1030}),x.otherData.providerSignature=await H(de.id)):ne===yn.patient&&(x.otherData.patientSignature=await H(de.id))}},g.confirm=async(P,q,ee)=>{const ne=ih(q,ee),ae=await B.createDocument({atimes:-10,eid:A.rootNotebookID,type:430081,name:{data:ne,type:ee},subtype:{isEditable:!0}});if(ae.code===0){const pe=ae.document;$n.set(b,P,pe.id)}};const x=t.reactive({formData:b,json:y,role:E,docType:C,otherData:{providerSignature:"",patientSignature:""},otherTableInfo:{}}),O=t.ref(x.role.toString()===x.docType.toString()),D=t.ref(x.role===yn.provider),R=t.ref(x.role===yn.patient),H=async P=>{if(B){const q=await B.retrieveDocument({idList:[P]});if(q.code===0&&q.document.length>0){const ee=q.document[0];return jk({type:ee.name.type,data:ee.name.data})}else return""}else return""},K=(P,q)=>{const ee=new Array,ne=ae=>{if(Bl.isArray(ae))ae.forEach(pe=>{ne(pe)});else if(Bl.isObject(ae)&&"type"in ae){switch(ae.type){case"atblock":case"sharpblock":case"table":case"image":break;case"paragraph":default:ne(ae.children)}ae.type===q&&ee.push(ae)}};return ne(P),ee};return t.onBeforeMount(()=>{K(x.json,"image").forEach(async ee=>{x.otherData[ee.alt]=await H(x.formData[ee.alt]),t.watch(()=>x.formData[ee.alt],async ne=>{x.otherData[ee.alt]=await H(ne)})}),K(x.json,"table").forEach(ee=>{const ae=(ee.width==="auto"?ee.width:bp.fullWidth)==="auto"?0:100,pe=new Array,be=ee.children[0].children;if(x.otherTableInfo[ee.key]={tableWidthArray:new Array,flexShrinks:new Array},be.forEach(F=>{ae===0?pe.push(F!=null&&F.width&&(F==null?void 0:F.width)!=="auto"?parseFloat(F.width):30):pe.push(F!=null&&F.width&&(F==null?void 0:F.width)!=="auto"?parseFloat(F.width):Math.floor(1e4/be.length)/100)}),ae===0){let F=0;pe.forEach(U=>{F+=U}),pe.forEach((U,L)=>{U===30?(x.otherTableInfo[ee.key].tableWidthArray[L]=`${b.atrribute.noodl_font.tableMinWidth}`,x.otherTableInfo[ee.key].flexShrinks[L]=0):(x.otherTableInfo[ee.key].tableWidthArray[L]=`${100*Math.floor(100*U/F)/100}%`,x.otherTableInfo[ee.key].flexShrinks[L]=1)})}else{let F=0,U=1;pe.forEach(L=>{L===Math.floor(1e4/be.length)/100?U-=L/100:F+=L}),pe.forEach((L,z)=>{L===Math.floor(1e4/be.length)/100?(x.otherTableInfo[ee.key].tableWidthArray[z]=`calc(${L}%)`,x.otherTableInfo[ee.key].flexShrinks[z]=0):(x.otherTableInfo[ee.key].tableWidthArray[z]=`calc(${Math.floor(1e4*U*L/F)/100}%)`,x.otherTableInfo[ee.key].flexShrinks[z]=1)})}}),Bl.isArray(x.formData.Diagnosis)||(x.formData.Diagnosis=[])}),t.onMounted(async()=>{x.otherData.providerSignature=await H(x.formData.signatureId),x.otherData.patientSignature=await H(x.formData.patdSignatureId)}),(P,q)=>(t.openBlock(),t.createElementBlock("div",null,[t.createVNode(Wl,{node:x.json,formData:x.formData,isEditable:O.value,providerEditability:D.value,patientEditability:R.value,otherData:x.otherData,otherTableInfo:x.otherTableInfo},null,8,["node","formData","isEditable","providerEditability","patientEditability","otherData","otherTableInfo"]),t.unref(s).status?(t.openBlock(),t.createBlock($k,{key:0})):t.createCommentVNode("",!0),t.unref(c).status?(t.openBlock(),t.createBlock(eB,{key:1})):t.createCommentVNode("",!0),t.unref(g).status?(t.openBlock(),t.createBlock(dB,{key:2})):t.createCommentVNode("",!0),t.unref(w).status?(t.openBlock(),t.createBlock(CB,{key:3})):t.createCommentVNode("",!0)]))}}),SB=An.createPinia(),ch=e=>{e.use(SB),e.component("DocumentTemplate",lh)},xB={install:ch};mt.DocumentTemplate=lh,mt.aitmedTemplateRole=yn,mt.aitmedTemplateType=du,mt.default=xB,mt.install=ch,mt.useDocumentTemplateStore=Ar,Object.defineProperties(mt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aitmed/aitmed-document-template",
3
- "version": "1.13.0",
3
+ "version": "1.14.0",
4
4
  "main": "./dist/my-component-library.umd.js",
5
5
  "module": "./dist/my-component-library.es.js",
6
6
  "types": "./dist/index.d.ts",